From ef5f46e9c25680f4df858bf4f369db6c3b89dee4 Mon Sep 17 00:00:00 2001 From: typeswitch-dev Date: Thu, 19 Dec 2024 20:49:50 +0000 Subject: [PATCH] Improve specializer and C99 output. (#318) * Improves the specializer so it can deduplicate specializations * Decouple specialization from inlining. * Inlined arrows are "codipped" properly during code generation, meaning they ignore extra things on the stack. * Detect panic-like functions by type signature, and track unreachable branches, to improve code generation. Fixes issue #239 --- Makefile | 8 +- bin/mirth0.c | 75076 +++++++++++++------------------------ lib/arg-parser/parse.mth | 1 - lib/std/buffer.mth | 2 +- lib/std/byte.mth | 298 +- lib/std/either.mth | 46 +- lib/std/file.mth | 10 +- lib/std/list.mth | 455 +- lib/std/map.mth | 14 +- lib/std/maybe.mth | 130 +- lib/std/prelude.mth | 691 +- lib/std/str.mth | 68 +- lib/std/world.mth | 11 +- src/c99.mth | 1258 +- src/elab.mth | 316 +- src/main.mth | 15 +- src/mirth.mth | 34 +- src/specializer.mth | 101 +- src/type.mth | 113 +- src/var.mth | 5 +- tools/build.bat | 6 +- 21 files changed, 29087 insertions(+), 49571 deletions(-) diff --git a/Makefile b/Makefile index 13299658..efab2151 100644 --- a/Makefile +++ b/Makefile @@ -17,11 +17,11 @@ default: show bin/snake.c bin/fractal.c show: bin/mirth0.c bin/mirth1.c bin/mirth2.c bin/mirth3.c diff --strip-trailing-cr bin/mirth0.c bin/mirth1.c | head -n 5 diff --strip-trailing-cr bin/mirth1.c bin/mirth2.c | head -n 10 - diff --strip-trailing-cr bin/mirth2.c bin/mirth3.c + diff --strip-trailing-cr bin/mirth2.c bin/mirth3.c | head -n 10 showsan: bin/mirth0.c bin/mirth1.c bin/mirth2.c bin/mirth3san.c diff --strip-trailing-cr bin/mirth0.c bin/mirth1.c | head -n 5 diff --strip-trailing-cr bin/mirth1.c bin/mirth2.c | head -n 10 - diff --strip-trailing-cr bin/mirth2.c bin/mirth3san.c + diff --strip-trailing-cr bin/mirth2.c bin/mirth3san.c | head -n 10 build: bin/mirth0 bin/mirth1 bin/mirth2 bin/mirth1.c bin/mirth2.c bin/mirth3.c buildsan: bin/mirth0 bin/mirth1 bin/mirth2san bin/mirth1.c bin/mirth2.c bin/mirth3san.c @@ -107,10 +107,10 @@ bin/mirth1.c: bin/mirth0 $(SRCS) bin/mirth0 src/main.mth -o bin/mirth1.c bin/mirth2.c: bin/mirth1 $(SRCS) - bin/mirth1 src/main.mth -o bin/mirth2.c + rm -f bin/mirth2.c && bin/mirth1 src/main.mth -o bin/mirth2.c bin/mirth3.c: bin/mirth2 $(SRCS) - bin/mirth2 src/main.mth -o bin/mirth3.c + rm -f bin/mirth3.c && bin/mirth2 src/main.mth -o bin/mirth3.c bin/mirth1debug.c: bin/mirth0 $(SRCS) bin/mirth0 --debug src/main.mth -o bin/mirth1debug.c diff --git a/bin/mirth0.c b/bin/mirth0.c index 6e0421c7..da5cfc48 100644 --- a/bin/mirth0.c +++ b/bin/mirth0.c @@ -1225,6 +1225,7 @@ static VAL lbl_spkey = MKNIL_C; static VAL lbl_spmap = MKNIL_C; static VAL lbl_depth = MKNIL_C; static VAL lbl_freshZ_counter = MKNIL_C; +static VAL lbl_putZ_enabled = MKNIL_C; static VAL lbl_ZPlusneeds = MKNIL_C; static VAL lbl_ZPlusoutput = MKNIL_C; static VAL lbl_pfx = MKNIL_C; @@ -1243,27 +1244,34 @@ static VAL lbl_argZ_index = MKNIL_C; static VAL lbl_expr = MKNIL_C; static VAL lbl_repr = MKNIL_C; static VAL lbl_source = MKNIL_C; -static VAL lbl_localZ_name = MKNIL_C; -static VAL lbl_localZ_repr = MKNIL_C; +static VAL lbl_valueZ_name = MKNIL_C; +static VAL lbl_valueZ_repr = MKNIL_C; +static VAL lbl_mustZ_flush = MKNIL_C; static VAL lbl_cname = MKNIL_C; static VAL lbl_inZ_params = MKNIL_C; static VAL lbl_returnZ_param = MKNIL_C; static VAL lbl_outZ_params = MKNIL_C; -static VAL lbl_mustZ_flushZAsk = MKNIL_C; +static VAL lbl_doesntZ_return = MKNIL_C; static VAL lbl_api = MKNIL_C; static VAL lbl_poppedZ_inputs = MKNIL_C; static VAL lbl_reservedZ_outputs = MKNIL_C; static VAL lbl_sep = MKNIL_C; -static VAL lbl_ZPluslocal = MKNIL_C; +static VAL lbl_reachable = MKNIL_C; +static VAL lbl_codZ_parts = MKNIL_C; +static VAL lbl_codZ_base = MKNIL_C; +static VAL lbl_domZ_parts = MKNIL_C; +static VAL lbl_domZ_base = MKNIL_C; +static VAL lbl_ZPlusscrutinee = MKNIL_C; static VAL lbl_ZPlusstr = MKNIL_C; static VAL lbl_avoidZ_hexdigit = MKNIL_C; -static VAL lbl_localZ_resourceZ_repr = MKNIL_C; -static VAL lbl_localZ_resourceZ_name = MKNIL_C; -static VAL lbl_ZPluscore = MKNIL_C; +static VAL lbl_resourceZ_repr = MKNIL_C; +static VAL lbl_resourceZ_name = MKNIL_C; +static VAL lbl_ZPlusc99 = MKNIL_C; static VAL lbl_ZPlusstack = MKNIL_C; static VAL lbl_ZPlusx = MKNIL_C; static VAL lbl_branchZ_splitZ_target = MKNIL_C; -static VAL lbl_branchZ_splitZ_mustZ_flushZAsk = MKNIL_C; +static VAL lbl_reachableZ_in = MKNIL_C; +static VAL lbl_reachableZ_out = MKNIL_C; static VAL lbl_ZPlusb = MKNIL_C; static VAL lbl_ZPlusa = MKNIL_C; static VAL lbl_ZPlusdipped = MKNIL_C; @@ -1287,7 +1295,6 @@ static VAL lbl_argZ_type = MKNIL_C; static VAL lbl_ZPlusfnptr = MKNIL_C; static VAL lbl_ZPlustup = MKNIL_C; static VAL lbl_var = MKNIL_C; -static VAL lbl_ZPlusscrutinee = MKNIL_C; static VAL lbl_ZPlusindex = MKNIL_C; static VAL lbl_stack = MKNIL_C; static VAL lbl_ZPlusset = MKNIL_C; @@ -1323,7 +1330,7 @@ static VAL mtw_std_buffer_ZPlusBuffer_ZPlusBuffer (int64_t x1, void* x2) { v3->cells[0] = MKI64(0LL /* +Buffer */); v3->cells[2] = MKPTR(x2); v3->cells[1] = MKI64(x1); - VAL v4 = (MKTUP(v3, 3)); + VAL v4 = MKTUP(v3, 3); return v4; } static void mtp_std_buffer_ZPlusBuffer_ZPlusBuffer (VAL x1, int64_t *x2, void* *x3) { @@ -1386,7 +1393,7 @@ static VAL mtw_std_input_ZPlusInputOpenState_ZPlusInputOpenState (int64_t x1, in v5->cells[3] = x3; v5->cells[2] = MKI64(x2); v5->cells[1] = MKI64(x1); - VAL v6 = (MKTUP(v5, 5)); + VAL v6 = MKTUP(v5, 5); return v6; } static void mtp_std_input_ZPlusInputOpenState_ZPlusInputOpenState (VAL x1, int64_t *x2, int64_t *x3, VAL *x4, VAL *x5) { @@ -1405,11 +1412,11 @@ static VAL mtw_std_input_ZPlusInput_ZPlusInputOpen (VAL x1) { v2->size = 2; v2->cells[0] = MKI64(0LL /* +InputOpen */); v2->cells[1] = x1; - VAL v3 = (MKTUP(v2, 2)); + VAL v3 = MKTUP(v2, 2); return v3; } static VAL mtp_std_input_ZPlusInput_ZPlusInputOpen (VAL x1) { - VAL v2 = (VTUP(x1)->cells[1]); + VAL v2 = VTUP(x1)->cells[1]; tup_decref_outer(VTUP(x1),2); return v2; } @@ -1418,11 +1425,11 @@ static VAL mtw_std_input_ZPlusInput_ZPlusInputDone (VAL x1) { v2->size = 2; v2->cells[0] = MKI64(1LL /* +InputDone */); v2->cells[1] = x1; - VAL v3 = (MKTUP(v2, 2)); + VAL v3 = MKTUP(v2, 2); return v3; } static VAL mtp_std_input_ZPlusInput_ZPlusInputDone (VAL x1) { - VAL v2 = (VTUP(x1)->cells[1]); + VAL v2 = VTUP(x1)->cells[1]; tup_decref_outer(VTUP(x1),2); return v2; } @@ -1433,7 +1440,7 @@ static VAL mtw_std_output_ZPlusOutput_ZPlusOutput (int64_t x1, VAL x2, VAL x3) { v4->cells[3] = x3; v4->cells[2] = x2; v4->cells[1] = MKI64(x1); - VAL v5 = (MKTUP(v4, 4)); + VAL v5 = MKTUP(v4, 4); return v5; } static void mtp_std_output_ZPlusOutput_ZPlusOutput (VAL x1, int64_t *x2, VAL *x3, VAL *x4) { @@ -1451,7 +1458,7 @@ static VAL mtw_std_file_ZPlusFile_ZPlusFile (int64_t x1, int64_t x2) { v3->cells[0] = MKI64(0LL /* +File */); v3->cells[2] = MKI64(x2); v3->cells[1] = MKI64(x1); - VAL v4 = (MKTUP(v3, 3)); + VAL v4 = MKTUP(v3, 3); return v4; } static void mtp_std_file_ZPlusFile_ZPlusFile (VAL x1, int64_t *x2, int64_t *x3) { @@ -1466,11 +1473,11 @@ static VAL mtw_std_file_ZPlusFileZAsk_ZPlusFileOk (VAL x1) { v2->size = 2; v2->cells[0] = MKI64(0LL /* +FileOk */); v2->cells[1] = x1; - VAL v3 = (MKTUP(v2, 2)); + VAL v3 = MKTUP(v2, 2); return v3; } static VAL mtp_std_file_ZPlusFileZAsk_ZPlusFileOk (VAL x1) { - VAL v2 = (VTUP(x1)->cells[1]); + VAL v2 = VTUP(x1)->cells[1]; tup_decref_outer(VTUP(x1),2); return v2; } @@ -1479,7 +1486,7 @@ static VAL mtw_std_file_ZPlusFileZAsk_ZPlusFileErr (VAL x1) { v2->size = 2; v2->cells[0] = MKI64(1LL /* +FileErr */); v2->cells[1] = x1; - VAL v3 = (MKTUP(v2, 2)); + VAL v3 = MKTUP(v2, 2); return v3; } static VAL mtp_std_file_ZPlusFileZAsk_ZPlusFileErr (VAL x1) { @@ -1560,7 +1567,7 @@ static VAL mtw_argZ_parser_types_ZPlusArgumentParser_1_ZPlusArgumentParser (VAL v3->cells[0] = MKI64(0LL /* +ArgumentParser */); v3->cells[2] = x2; v3->cells[1] = x1; - VAL v4 = (MKTUP(v3, 3)); + VAL v4 = MKTUP(v3, 3); return v4; } static void mtp_argZ_parser_types_ZPlusArgumentParser_1_ZPlusArgumentParser (VAL x1, VAL *x2, VAL *x3) { @@ -1746,7 +1753,7 @@ static VAL mtw_mirth_match_ZPlusMatch_ZPlusMatch (VAL x1, uint64_t x2, uint64_t v8->cells[3] = MKU64(x3); v8->cells[2] = MKU64(x2); v8->cells[1] = x1; - VAL v9 = (MKTUP(v8, 8)); + VAL v9 = MKTUP(v8, 8); return v9; } static void mtp_mirth_match_ZPlusMatch_ZPlusMatch (VAL x1, VAL *x2, uint64_t *x3, uint64_t *x4, VAL *x5, VAL *x6, VAL *x7, VAL *x8) { @@ -2026,14 +2033,6 @@ static uint64_t mtp_mirth_arrow_Op_OpBlockPush (VAL x1) { tup_decref_outer(VTUP(x1),2); return VU64(v2); } -static VAL mtw_mirth_arrow_Op_OpBlockRun (uint64_t x1) { - TUP* v2 = tup_new(2); - v2->size = 2; - v2->cells[0] = MKI64(15LL /* OpBlockRun */); - v2->cells[1] = MKU64(x1); - VAL v3 = MKTUP(v2, 2); - return v3; -} static uint64_t mtp_mirth_arrow_Op_OpBlockRun (VAL x1) { VAL v2 = VTUP(x1)->cells[1]; tup_decref_outer(VTUP(x1),2); @@ -3143,7 +3142,7 @@ static VAL mtw_mirth_mirth_ZPlusMirth_ZPlusMirth (int64_t x1, int64_t x2, int64_ v10->cells[3] = MKI64(x3); v10->cells[2] = MKI64(x2); v10->cells[1] = MKI64(x1); - VAL v11 = (MKTUP(v10, 10)); + VAL v11 = MKTUP(v10, 10); return v11; } static void mtp_mirth_mirth_ZPlusMirth_ZPlusMirth (VAL x1, int64_t *x2, int64_t *x3, int64_t *x4, VAL *x5, VAL *x6, VAL *x7, VAL *x8, VAL *x9, VAL *x10) { @@ -3658,7 +3657,7 @@ static VAL mtw_mirth_lexer_ZPlusLexer_ZPlusLexer (uint64_t x1, int64_t x2, int64 v7->cells[3] = MKI64(x3); v7->cells[2] = MKI64(x2); v7->cells[1] = MKU64(x1); - VAL v8 = (MKTUP(v7, 7)); + VAL v8 = MKTUP(v7, 7); return v8; } static void mtp_mirth_lexer_ZPlusLexer_ZPlusLexer (VAL x1, uint64_t *x2, int64_t *x3, int64_t *x4, VAL *x5, uint64_t *x6, VAL *x7) { @@ -3684,7 +3683,7 @@ static VAL mtw_mirth_elab_ZPlusTypeElab_ZPlusTypeElab (VAL x1, uint64_t x2, int6 v5->cells[3] = MKI64(x3); v5->cells[2] = MKU64(x2); v5->cells[1] = x1; - VAL v6 = (MKTUP(v5, 5)); + VAL v6 = MKTUP(v5, 5); return v6; } static void mtp_mirth_elab_ZPlusTypeElab_ZPlusTypeElab (VAL x1, VAL *x2, uint64_t *x3, int64_t *x4, int64_t *x5) { @@ -3709,7 +3708,7 @@ static VAL mtw_mirth_elab_ZPlusResolveDef_ZPlusResolveDef (VAL x1, uint64_t x2, v8->cells[3] = x3; v8->cells[2] = MKU64(x2); v8->cells[1] = x1; - VAL v9 = (MKTUP(v8, 8)); + VAL v9 = MKTUP(v8, 8); return v9; } static void mtp_mirth_elab_ZPlusResolveDef_ZPlusResolveDef (VAL x1, VAL *x2, uint64_t *x3, VAL *x4, VAL *x5, VAL *x6, int64_t *x7, int64_t *x8) { @@ -3975,11 +3974,11 @@ static VAL mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH (VAL x1, uint64_t x2 v5->cells[3] = MKU64(x2); v5->cells[2] = x1; v5->cells[1] = x4; - VAL v6 = (MKTUP(v5, 5)); + VAL v6 = MKTUP(v5, 5); return v6; } static void mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH (VAL x1, VAL *x2, uint64_t *x3, VAL *x4, VAL *x5) { - VAL v6 = (VTUP(x1)->cells[1]); + VAL v6 = VTUP(x1)->cells[1]; VAL v7 = VTUP(x1)->cells[2]; VAL v8 = VTUP(x1)->cells[3]; VAL v9 = VTUP(x1)->cells[4]; @@ -4047,7 +4046,7 @@ static VAL mtw_mirth_need_ZPlusNeeds_ZPlusNeeds (VAL x1, VAL x2) { v3->cells[0] = MKI64(0LL /* +Needs */); v3->cells[2] = x2; v3->cells[1] = x1; - VAL v4 = (MKTUP(v3, 3)); + VAL v4 = MKTUP(v3, 3); return v4; } static void mtp_mirth_need_ZPlusNeeds_ZPlusNeeds (VAL x1, VAL *x2, VAL *x3) { @@ -4066,33 +4065,36 @@ static VAL mtw_mirth_c99_C99z_Options_C99z_Options (VAL x1, int64_t x2) { VAL v4 = MKTUP(v3, 3); return v4; } -static VAL mtw_mirth_c99_ZPlusC99_ZPlusC99 (VAL x1, int64_t x2, int64_t x3, VAL x4, VAL x5, VAL x6) { - TUP* v7 = tup_new(7); - v7->size = 7; - v7->cells[0] = MKI64(0LL /* +C99 */); - v7->cells[6] = x6; - v7->cells[5] = x5; - v7->cells[4] = x4; - v7->cells[3] = MKI64(x3); - v7->cells[2] = MKI64(x2); - v7->cells[1] = x1; - VAL v8 = (MKTUP(v7, 7)); - return v8; +static VAL mtw_mirth_c99_ZPlusC99_ZPlusC99 (VAL x1, int64_t x2, int64_t x3, int64_t x4, VAL x5, VAL x6, VAL x7) { + TUP* v8 = tup_new(8); + v8->size = 8; + v8->cells[0] = MKI64(0LL /* +C99 */); + v8->cells[7] = x7; + v8->cells[6] = x6; + v8->cells[5] = x5; + v8->cells[4] = MKI64(x4); + v8->cells[3] = MKI64(x3); + v8->cells[2] = MKI64(x2); + v8->cells[1] = x1; + VAL v9 = MKTUP(v8, 8); + return v9; } -static void mtp_mirth_c99_ZPlusC99_ZPlusC99 (VAL x1, VAL *x2, int64_t *x3, int64_t *x4, VAL *x5, VAL *x6, VAL *x7) { - VAL v8 = VTUP(x1)->cells[1]; - VAL v9 = VTUP(x1)->cells[2]; - VAL v10 = VTUP(x1)->cells[3]; - VAL v11 = VTUP(x1)->cells[4]; - VAL v12 = VTUP(x1)->cells[5]; - VAL v13 = VTUP(x1)->cells[6]; - tup_decref_outer(VTUP(x1),7); - *x7 = v13; - *x6 = v12; - *x5 = v11; - *x4 = VI64(v10); - *x3 = VI64(v9); - *x2 = v8; +static void mtp_mirth_c99_ZPlusC99_ZPlusC99 (VAL x1, VAL *x2, int64_t *x3, int64_t *x4, int64_t *x5, VAL *x6, VAL *x7, VAL *x8) { + VAL v9 = VTUP(x1)->cells[1]; + VAL v10 = VTUP(x1)->cells[2]; + VAL v11 = VTUP(x1)->cells[3]; + VAL v12 = VTUP(x1)->cells[4]; + VAL v13 = VTUP(x1)->cells[5]; + VAL v14 = VTUP(x1)->cells[6]; + VAL v15 = VTUP(x1)->cells[7]; + tup_decref_outer(VTUP(x1),8); + *x8 = v15; + *x7 = v14; + *x6 = v13; + *x5 = VI64(v12); + *x4 = VI64(v11); + *x3 = VI64(v10); + *x2 = v9; } static VAL mtw_mirth_c99_C99APIArgSource_C99AASz_ValueLabel (uint64_t x1) { TUP* v2 = tup_new(2); @@ -4139,210 +4141,217 @@ static void mtp_mirth_c99_C99APIArg_C99APIArg (VAL x1, VAL *x2, int64_t *x3, VAL *x3 = VI64(v6); *x2 = v5; } -static VAL mtw_mirth_c99_C99API_C99API (VAL x1, VAL x2, VAL x3, VAL x4, VAL x5, int64_t x6) { - TUP* v7 = tup_new(7); - v7->size = 7; - v7->cells[0] = MKI64(0LL /* C99API */); - v7->cells[6] = MKI64(x6); - v7->cells[5] = x5; - v7->cells[4] = x4; - v7->cells[3] = x3; - v7->cells[2] = x2; - v7->cells[1] = x1; - VAL v8 = MKTUP(v7, 7); - return v8; +static VAL mtw_mirth_c99_C99API_C99API (VAL x1, VAL x2, VAL x3, VAL x4, VAL x5, int64_t x6, int64_t x7) { + TUP* v8 = tup_new(8); + v8->size = 8; + v8->cells[0] = MKI64(0LL /* C99API */); + v8->cells[7] = MKI64(x7); + v8->cells[6] = MKI64(x6); + v8->cells[5] = x5; + v8->cells[4] = x4; + v8->cells[3] = x3; + v8->cells[2] = x2; + v8->cells[1] = x1; + VAL v9 = MKTUP(v8, 8); + return v9; } -static VAL mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local (int64_t x1, VAL x2) { +static VAL mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value (int64_t x1, VAL x2) { TUP* v3 = tup_new(3); v3->size = 3; - v3->cells[0] = MKI64(0LL /* +C99Local */); + v3->cells[0] = MKI64(0LL /* +C99Value */); v3->cells[2] = x2; v3->cells[1] = MKI64(x1); - VAL v4 = (MKTUP(v3, 3)); + VAL v4 = MKTUP(v3, 3); return v4; } -static void mtp_mirth_c99_ZPlusC99Local_ZPlusC99Local (VAL x1, int64_t *x2, VAL *x3) { +static void mtp_mirth_c99_ZPlusC99Value_ZPlusC99Value (VAL x1, int64_t *x2, VAL *x3) { VAL v4 = VTUP(x1)->cells[1]; VAL v5 = VTUP(x1)->cells[2]; tup_decref_outer(VTUP(x1),3); *x3 = v5; *x2 = VI64(v4); } -static VAL mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource (int64_t x1, VAL x2) { +static VAL mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource (int64_t x1, VAL x2) { TUP* v3 = tup_new(3); v3->size = 3; - v3->cells[0] = MKI64(0LL /* +C99LocalResource */); + v3->cells[0] = MKI64(0LL /* +C99Resource */); v3->cells[2] = x2; v3->cells[1] = MKI64(x1); - VAL v4 = (MKTUP(v3, 3)); + VAL v4 = MKTUP(v3, 3); return v4; } -static void mtp_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource (VAL x1, int64_t *x2, VAL *x3) { +static void mtp_mirth_c99_ZPlusC99Resource_ZPlusC99Resource (VAL x1, int64_t *x2, VAL *x3) { VAL v4 = VTUP(x1)->cells[1]; VAL v5 = VTUP(x1)->cells[2]; tup_decref_outer(VTUP(x1),3); *x3 = v5; *x2 = VI64(v4); } -static VAL mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft (VAL x1) { +static VAL mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft (VAL x1) { TUP* v2 = tup_new(2); v2->size = 2; v2->cells[0] = MKI64(0LL /* +Left */); v2->cells[1] = x1; - VAL v3 = (MKTUP(v2, 2)); + VAL v3 = MKTUP(v2, 2); return v3; } -static VAL mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft (VAL x1) { - VAL v2 = (VTUP(x1)->cells[1]); +static VAL mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft (VAL x1) { + VAL v2 = VTUP(x1)->cells[1]; tup_decref_outer(VTUP(x1),2); return v2; } -static VAL mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight (VAL x1) { +static VAL mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight (VAL x1) { TUP* v2 = tup_new(2); v2->size = 2; v2->cells[0] = MKI64(1LL /* +Right */); v2->cells[1] = x1; - VAL v3 = (MKTUP(v2, 2)); + VAL v3 = MKTUP(v2, 2); return v3; } -static VAL mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight (VAL x1) { - VAL v2 = (VTUP(x1)->cells[1]); +static VAL mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight (VAL x1) { + VAL v2 = VTUP(x1)->cells[1]; tup_decref_outer(VTUP(x1),2); return v2; } -static VAL mtw_mirth_c99_ZPlusC99LocalZAsk_ZPlusC99LocalSome (VAL x1) { +static VAL mtw_mirth_c99_ZPlusC99ValueZAsk_ZPlusC99ValueSome (VAL x1) { TUP* v2 = tup_new(2); v2->size = 2; - v2->cells[0] = MKI64(1LL /* +C99LocalSome */); + v2->cells[0] = MKI64(1LL /* +C99ValueSome */); v2->cells[1] = x1; - VAL v3 = (MKTUP(v2, 2)); + VAL v3 = MKTUP(v2, 2); return v3; } -static VAL mtp_mirth_c99_ZPlusC99LocalZAsk_ZPlusC99LocalSome (VAL x1) { - VAL v2 = (VTUP(x1)->cells[1]); +static VAL mtp_mirth_c99_ZPlusC99ValueZAsk_ZPlusC99ValueSome (VAL x1) { + VAL v2 = VTUP(x1)->cells[1]; tup_decref_outer(VTUP(x1),2); return v2; } -static VAL mtw_mirth_c99_ZPlusC99LocalResourceZAsk_ZPlusC99LocalResourceSome (VAL x1) { +static VAL mtw_mirth_c99_ZPlusC99ResourceZAsk_ZPlusC99ResourceSome (VAL x1) { TUP* v2 = tup_new(2); v2->size = 2; - v2->cells[0] = MKI64(1LL /* +C99LocalResourceSome */); + v2->cells[0] = MKI64(1LL /* +C99ResourceSome */); v2->cells[1] = x1; - VAL v3 = (MKTUP(v2, 2)); + VAL v3 = MKTUP(v2, 2); return v3; } -static VAL mtp_mirth_c99_ZPlusC99LocalResourceZAsk_ZPlusC99LocalResourceSome (VAL x1) { - VAL v2 = (VTUP(x1)->cells[1]); +static VAL mtp_mirth_c99_ZPlusC99ResourceZAsk_ZPlusC99ResourceSome (VAL x1) { + VAL v2 = VTUP(x1)->cells[1]; tup_decref_outer(VTUP(x1),2); return v2; } -static VAL mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCCons (VAL x1, VAL x2) { +static VAL mtw_mirth_c99_ZPlusC99Stack_ZPlusSCons (VAL x1, VAL x2) { TUP* v3 = tup_new(3); v3->size = 3; - v3->cells[0] = MKI64(1LL /* +SCCons */); + v3->cells[0] = MKI64(1LL /* +SCons */); v3->cells[2] = x2; v3->cells[1] = x1; - VAL v4 = (MKTUP(v3, 3)); + VAL v4 = MKTUP(v3, 3); return v4; } -static void mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons (VAL x1, VAL *x2, VAL *x3) { - VAL v4 = (VTUP(x1)->cells[1]); - VAL v5 = (VTUP(x1)->cells[2]); +static void mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons (VAL x1, VAL *x2, VAL *x3) { + VAL v4 = VTUP(x1)->cells[1]; + VAL v5 = VTUP(x1)->cells[2]; tup_decref_outer(VTUP(x1),3); *x3 = v5; *x2 = v4; } -static VAL mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWith (VAL x1, VAL x2) { +static VAL mtw_mirth_c99_ZPlusC99Stack_ZPlusSWith (VAL x1, VAL x2) { TUP* v3 = tup_new(3); v3->size = 3; - v3->cells[0] = MKI64(2LL /* +SCWith */); + v3->cells[0] = MKI64(2LL /* +SWith */); v3->cells[2] = x2; v3->cells[1] = x1; - VAL v4 = (MKTUP(v3, 3)); + VAL v4 = MKTUP(v3, 3); return v4; } -static void mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith (VAL x1, VAL *x2, VAL *x3) { - VAL v4 = (VTUP(x1)->cells[1]); - VAL v5 = (VTUP(x1)->cells[2]); +static void mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith (VAL x1, VAL *x2, VAL *x3) { + VAL v4 = VTUP(x1)->cells[1]; + VAL v5 = VTUP(x1)->cells[2]; tup_decref_outer(VTUP(x1),3); *x3 = v5; *x2 = v4; } -static VAL mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel (VAL x1, VAL x2, uint64_t x3) { +static VAL mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel (VAL x1, VAL x2, uint64_t x3) { TUP* v4 = tup_new(4); v4->size = 4; - v4->cells[0] = MKI64(3LL /* +SCConsLabel */); + v4->cells[0] = MKI64(3LL /* +SConsLabel */); v4->cells[3] = x2; v4->cells[2] = x1; v4->cells[1] = MKU64(x3); - VAL v5 = (MKTUP(v4, 4)); + VAL v5 = MKTUP(v4, 4); return v5; } -static void mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel (VAL x1, VAL *x2, VAL *x3, uint64_t *x4) { +static void mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel (VAL x1, VAL *x2, VAL *x3, uint64_t *x4) { VAL v5 = VTUP(x1)->cells[1]; - VAL v6 = (VTUP(x1)->cells[2]); - VAL v7 = (VTUP(x1)->cells[3]); + VAL v6 = VTUP(x1)->cells[2]; + VAL v7 = VTUP(x1)->cells[3]; tup_decref_outer(VTUP(x1),4); *x4 = VU64(v5); *x3 = v7; *x2 = v6; } -static VAL mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel (VAL x1, VAL x2, uint64_t x3) { +static VAL mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel (VAL x1, VAL x2, uint64_t x3) { TUP* v4 = tup_new(4); v4->size = 4; - v4->cells[0] = MKI64(4LL /* +SCWithLabel */); + v4->cells[0] = MKI64(4LL /* +SWithLabel */); v4->cells[3] = x2; v4->cells[2] = x1; v4->cells[1] = MKU64(x3); - VAL v5 = (MKTUP(v4, 4)); + VAL v5 = MKTUP(v4, 4); return v5; } -static void mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel (VAL x1, VAL *x2, VAL *x3, uint64_t *x4) { +static void mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel (VAL x1, VAL *x2, VAL *x3, uint64_t *x4) { VAL v5 = VTUP(x1)->cells[1]; - VAL v6 = (VTUP(x1)->cells[2]); - VAL v7 = (VTUP(x1)->cells[3]); + VAL v6 = VTUP(x1)->cells[2]; + VAL v7 = VTUP(x1)->cells[3]; tup_decref_outer(VTUP(x1),4); *x4 = VU64(v5); *x3 = v7; *x2 = v6; } -static VAL mtw_mirth_c99_ZPlusC99BranchSplit_ZPlusC99BranchSplit (VAL x1, VAL x2, VAL x3, int64_t x4) { - TUP* v5 = tup_new(5); - v5->size = 5; - v5->cells[0] = MKI64(0LL /* +C99BranchSplit */); - v5->cells[4] = MKI64(x4); - v5->cells[3] = x3; - v5->cells[2] = x2; - v5->cells[1] = x1; - VAL v6 = (MKTUP(v5, 5)); - return v6; +static VAL mtw_mirth_c99_ZPlusC99BranchSplit_ZPlusC99BranchSplit (VAL x1, VAL x2, VAL x3, int64_t x4, int64_t x5) { + TUP* v6 = tup_new(6); + v6->size = 6; + v6->cells[0] = MKI64(0LL /* +C99BranchSplit */); + v6->cells[5] = MKI64(x5); + v6->cells[4] = MKI64(x4); + v6->cells[3] = x3; + v6->cells[2] = x2; + v6->cells[1] = x1; + VAL v7 = MKTUP(v6, 6); + return v7; } -static void mtp_mirth_c99_ZPlusC99BranchSplit_ZPlusC99BranchSplit (VAL x1, VAL *x2, VAL *x3, VAL *x4, int64_t *x5) { - VAL v6 = VTUP(x1)->cells[1]; - VAL v7 = VTUP(x1)->cells[2]; - VAL v8 = VTUP(x1)->cells[3]; - VAL v9 = VTUP(x1)->cells[4]; - tup_decref_outer(VTUP(x1),5); - *x5 = VI64(v9); - *x4 = v8; - *x3 = v7; - *x2 = v6; +static void mtp_mirth_c99_ZPlusC99BranchSplit_ZPlusC99BranchSplit (VAL x1, VAL *x2, VAL *x3, VAL *x4, int64_t *x5, int64_t *x6) { + VAL v7 = VTUP(x1)->cells[1]; + VAL v8 = VTUP(x1)->cells[2]; + VAL v9 = VTUP(x1)->cells[3]; + VAL v10 = VTUP(x1)->cells[4]; + VAL v11 = VTUP(x1)->cells[5]; + tup_decref_outer(VTUP(x1),6); + *x6 = VI64(v11); + *x5 = VI64(v10); + *x4 = v9; + *x3 = v8; + *x2 = v7; } -static VAL mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch (VAL x1, VAL x2) { - TUP* v3 = tup_new(3); - v3->size = 3; - v3->cells[0] = MKI64(0LL /* +C99Branch */); - v3->cells[2] = x2; - v3->cells[1] = x1; - VAL v4 = (MKTUP(v3, 3)); - return v4; +static VAL mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch (VAL x1, VAL x2, int64_t x3) { + TUP* v4 = tup_new(4); + v4->size = 4; + v4->cells[0] = MKI64(0LL /* +C99Branch */); + v4->cells[3] = MKI64(x3); + v4->cells[2] = x2; + v4->cells[1] = x1; + VAL v5 = MKTUP(v4, 4); + return v5; } -static void mtp_mirth_c99_ZPlusC99Branch_ZPlusC99Branch (VAL x1, VAL *x2, VAL *x3) { - VAL v4 = VTUP(x1)->cells[1]; - VAL v5 = VTUP(x1)->cells[2]; - tup_decref_outer(VTUP(x1),3); - *x3 = v5; - *x2 = v4; +static void mtp_mirth_c99_ZPlusC99Branch_ZPlusC99Branch (VAL x1, VAL *x2, VAL *x3, int64_t *x4) { + VAL v5 = VTUP(x1)->cells[1]; + VAL v6 = VTUP(x1)->cells[2]; + VAL v7 = VTUP(x1)->cells[3]; + tup_decref_outer(VTUP(x1),4); + *x4 = VI64(v7); + *x3 = v6; + *x2 = v5; } static VAL mtw_mirth_main_Arguments_Arguments (VAL x1, VAL x2, VAL x3, VAL x4, VAL x5, int64_t x6) { TUP* v7 = tup_new(7); @@ -4396,7 +4405,7 @@ size_t strlen (const char *); static void mext_std_ctypes_CStr_numZ_bytes (int64_t x1, void* x2, int64_t *x3, int64_t *x4) { const char * X2 = (const char *)(x2); size_t Y = strlen(X2); - int64_t v5 = ((int64_t)(0)); + int64_t v5 = (int64_t)(0); int64_t v6 = (int64_t)(Y); *x4 = v6; *x3 = v5; @@ -4446,7 +4455,7 @@ static void mext_std_world_posixZ_stat (int64_t x1, void* x2, void* x3, int64_t void* X3 = (void*)(x3); const char * X2 = (const char *)(x2); int Y = stat(X2, X3); - int64_t v6 = ((int64_t)(0)); + int64_t v6 = (int64_t)(0); int64_t v7 = (int64_t)(Y); *x5 = v7; *x4 = v6; @@ -4464,22 +4473,12 @@ static double mext_mirth_lexer_stringz_toz_float64 (void* x1) { } static VAL mw_std_either_Either_2_leftZAsk (VAL x1); static VAL mw_std_either_Either_2_rightZAsk (VAL x1); -static void mw_std_prim_Ptr_ZAtByte (void* x1, int64_t x2, int64_t *x3, int64_t *x4); -static int64_t mw_std_byte_Byte_isZ_upper (int64_t x1); -static int64_t mw_std_byte_Byte_isZ_lower (int64_t x1); -static int64_t mw_std_byte_Byte_isZ_digit (int64_t x1); -static int64_t mw_std_byte_Byte_isZ_alpha (int64_t x1); -static int64_t mw_std_byte_Byte_isZ_alnum (int64_t x1); -static int64_t mw_std_byte_Byte_isZ_printable (int64_t x1); -static int64_t mw_std_byte_Byte_isZ_hexdigit (int64_t x1); -static VAL mw_std_byte_Byte_emitZ_asciiZThen (VAL x1, int64_t x2); static VAL mw_std_byte_Byte_toZ_strZ_unsafe (int64_t x1); static VAL mw_std_byte_Byte_toZ_asciiZ_str (int64_t x1); static int64_t mw_std_byte_Byte_isZ_stringZ_end (int64_t x1); static void mw_std_byte_Byte_toZ_hexdigits (int64_t x1, int64_t *x2, int64_t *x3); static int64_t mw_std_byte_oneZ_hexdigitZ_byte (int64_t x1); static int64_t mw_std_byte_Byte_isZ_nameZ_byte (int64_t x1); -static int64_t mw_std_byte_Byte_isZ_sign (int64_t x1); static VAL mw_std_byte_Byte_zzencode (int64_t x1); static VAL mw_std_buffer_ZPlusBuffer_new (int64_t x1); static VAL mw_std_buffer_ZPlusBuffer_resizzeZBang (int64_t x1, VAL x2); @@ -4493,9 +4492,7 @@ static VAL mw_std_buffer_ZPlusBuffer_ZBangU8 (int64_t x1, int64_t x2, VAL x3); static VAL mw_std_buffer_ZPlusBuffer_ZBangByte (int64_t x1, int64_t x2, VAL x3); static VAL mw_std_buffer_ZPlusBuffer_ZBangStr (VAL x1, int64_t x2, VAL x3); static void mw_std_buffer_ZPlusBuffer_ZAtStr (int64_t x1, int64_t x2, VAL x3, VAL *x4, VAL *x5); -static void mw_std_prim_Ptr_ZBangStrZPlus (VAL x1, void* x2, int64_t x3, void* *x4, int64_t *x5); -static void mw_std_str_ZPlusStr_dupZBang (VAL x1, VAL *x2, VAL *x3); -static void mw_std_str_ZPlusStr_numZ_bytesZAsk (VAL x1, int64_t *x2, VAL *x3); +static int64_t mw_std_prim_Ptr_ZBangStr (VAL x1, void* x2, int64_t x3); static int64_t mw_std_prim_Str_lastZ_byte (VAL x1); static void mw_std_str_ZPlusStr_lastZ_byte (VAL x1, int64_t *x2, VAL *x3); static void mw_std_str_ZPlusStr_byteZAt (int64_t x1, VAL x2, int64_t *x3, VAL *x4); @@ -4518,11 +4515,14 @@ static void mw_std_str_ZPlusStr_splitZ_byte (int64_t x1, VAL x2, VAL *x3, VAL *x static VAL mw_std_prim_Str_splitZ_byte (int64_t x1, VAL x2); static void mw_std_str_ZPlusStr_pushZ_showZ_byteZBang (VAL x1, int64_t x2, int64_t x3, int64_t *x4, VAL *x5); static VAL mw_std_prim_Str_showZThen (VAL x1, VAL x2); +static VAL mw_std_list_L3 (VAL x1, VAL x2, VAL x3); static int64_t mw_std_list_List_1_ZDivL0 (VAL x1); static VAL mw_std_list_List_1_ZDivL1 (VAL x1); static VAL mw_std_list_List_1_ZDivL2 (VAL x1); static int64_t mw_std_list_List_1_emptyZAsk (VAL x1); static int64_t mw_std_list_List_1_len (VAL x1); +static VAL mw_std_list_ListZPlus_1_ZDivL1ZPlus (VAL x1); +static VAL mw_std_list_ListZPlus_1_ZDivL2ZPlus (VAL x1); static VAL mw_std_list_List_1_ZToListZPlus (VAL x1); static void mw_std_list_List_1_uncons (VAL x1, VAL *x2, VAL *x3); static void mw_std_list_ListZPlus_1_uncons (VAL x1, VAL *x2, VAL *x3); @@ -4536,14 +4536,14 @@ static VAL mw_std_list_ListZPlus_1_last (VAL x1); static VAL mw_std_list_List_1_reverse (VAL x1); static VAL mw_std_list_ListZPlus_1_reverse (VAL x1); static VAL mw_std_prim_Int_range (int64_t x1, int64_t x2); -static int64_t mw_std_maybe_Maybe_1_noneZAsk (VAL x1); -static int64_t mw_std_maybe_Maybe_1_someZAsk (VAL x1); -static int64_t mw_std_maybe_Maybe_1_ZToBool (VAL x1); static VAL mw_std_maybe_Maybe_1_ZToList (VAL x1); static VAL mw_std_maybe_Maybe_1_zzip (VAL x1, VAL x2); static int64_t mw_std_prim_Int_ZToOS (int64_t x1); static int64_t mw_std_prim_Int_ZToArch (int64_t x1); +static int64_t mw_std_prim_Int_max (int64_t x1, int64_t x2); +static int64_t mw_std_prim_Int_min (int64_t x1, int64_t x2); static VAL mw_std_prelude_ZAtZAsk (void* x1); +static void mw_std_prelude_impossibleZBang (void); static VAL mw_std_path_PATHz_SEPARATOR (void); static VAL mw_std_path_Path_joinZ_with (VAL x1, VAL x2, VAL x3); static VAL mw_std_path_Path_join (VAL x1, VAL x2); @@ -4582,6 +4582,7 @@ static void mw_std_prelude_ZPlusUnsafe_writeZ_bytesZBang (void* x1, int64_t x2, static void mw_std_prelude_ZPlusUnsafe_readZ_bytesZBang (void* x1, int64_t x2, VAL x3, int64_t x4, int64_t *x5, int64_t *x6, VAL *x7, int64_t *x8); static void mw_std_file_ZPlusFile_readZ_fileZBang (VAL x1, VAL *x2, VAL *x3); static int64_t mw_std_prim_ZPlusWorld_traceZ_ (VAL x1, int64_t x2); +static int64_t mw_std_prim_ZPlusWorld_trace (VAL x1, int64_t x2); static void mw_std_prim_ZPlusWorld_isZ_directoryZAsk (int64_t x1, VAL x2, int64_t *x3, int64_t *x4); static int64_t mw_std_world_Sz_IFMT (void); static int64_t mw_std_world_Sz_IFDIR (void); @@ -4622,7 +4623,6 @@ static uint64_t mw_mirth_var_Var_allocZBang (void); static uint64_t mw_mirth_var_Var_name (uint64_t x1); static VAL mw_mirth_var_Var_type (uint64_t x1); static VAL mw_mirth_var_Var_autoZ_runZAsk (uint64_t x1); -static int64_t mw_mirth_var_Var_ZEqualZEqual (uint64_t x1, uint64_t x2); static VAL mw_mirth_var_Var_typeZThen (VAL x1, uint64_t x2); static int64_t mw_mirth_var_Var_isZ_stackZAsk (uint64_t x1); static int64_t mw_mirth_var_Var_isZ_physicalZAsk (uint64_t x1); @@ -4806,19 +4806,15 @@ static VAL mw_mirth_arrow_Block_cod (uint64_t x1); static VAL mw_mirth_arrow_Block_home (uint64_t x1); static VAL mw_mirth_arrow_Block_type (uint64_t x1); static void mw_mirth_arrow_Block_arrow (VAL x1, uint64_t x2, VAL *x3, VAL *x4); -static void mw_mirth_arrow_Block_qname (VAL x1, uint64_t x2, VAL *x3, VAL *x4); static int64_t mw_mirth_arrow_Block_ZEqualZEqual (uint64_t x1, uint64_t x2); static void mw_mirth_arrow_Block_registerZ_homeZBang (uint64_t x1); static void mw_mirth_arrow_Block_cname (VAL x1, uint64_t x2, VAL *x3, VAL *x4); static void mw_mirth_arrow_Block_newZBang (VAL x1, VAL x2, VAL *x3, uint64_t *x4); -static void mw_mirth_arrow_Block_newZ_deferredZBang_1 (VAL x1, VAL x2, uint64_t x3, VAL x4, VAL x5, VAL *x6, uint64_t *x7); static VAL mw_mirth_arrow_Block_typecheckZBang (VAL x1, uint64_t x2); static void mw_mirth_arrow_blockZ_unifyZ_typeZBang (VAL x1, uint64_t x2, uint64_t x3, VAL x4, VAL *x5, uint64_t *x6, VAL *x7); static void mw_mirth_arrow_Block_toZ_runZ_var (VAL x1, uint64_t x2, VAL *x3, VAL *x4); static VAL mw_mirth_arrow_Arrow_toZ_runZ_var (VAL x1); static VAL mw_mirth_arrow_Atom_toZ_runZ_var (VAL x1); -static void mw_mirth_arrow_Arg_ZToStr (VAL x1, uint64_t x2, VAL *x3, VAL *x4); -static int64_t mw_mirth_arrow_Arg_ZEqualZEqual (uint64_t x1, uint64_t x2); static void mw_mirth_arrow_Block_freeZ_vars (VAL x1, uint64_t x2, VAL *x3, VAL *x4); static void mw_mirth_arrow_Arrow_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4); static void mw_mirth_arrow_Atom_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4); @@ -4827,7 +4823,6 @@ static void mw_mirth_arrow_Op_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4); static void mw_mirth_match_Match_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4); static void mw_mirth_match_Case_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4); static void mw_mirth_arrow_Lambda_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4); -static uint64_t mw_mirth_arrow_Arg_token (uint64_t x1); static int64_t mw_mirth_typedef_TypeDef_index (uint64_t x1); static uint64_t mw_mirth_typedef_TypeDef_allocZBang (void); static VAL mw_mirth_typedef_TypeDef_qnameZ_soft (uint64_t x1); @@ -4862,6 +4857,7 @@ static VAL mw_mirth_type_Type_morphismZAsk (VAL x1); static VAL mw_mirth_type_Type_primZAsk (VAL x1); static int64_t mw_mirth_type_Type_metaZEqual (uint64_t x1, VAL x2); static int64_t mw_mirth_type_Type_isZ_physicalZAsk (VAL x1); +static VAL mw_mirth_type_TYPEz_UNIT (void); static VAL mw_mirth_type_TYPEz_TYPE (void); static VAL mw_mirth_type_TYPEz_STACK (void); static VAL mw_mirth_type_TYPEz_RESOURCE (void); @@ -4891,6 +4887,9 @@ static void mw_mirth_table_Table_unifyZBang (VAL x1, uint64_t x2, uint64_t x3, u static int64_t mw_mirth_type_Type_hasZ_metaZAsk (uint64_t x1, VAL x2); static int64_t mw_mirth_type_Type_hasZ_meta2ZAsk (uint64_t x1, VAL x2, VAL x3); static int64_t mw_mirth_type_Value_hasZ_metaZAsk (uint64_t x1, VAL x2); +static int64_t mw_mirth_type_Type_hasZ_varZAsk (uint64_t x1, VAL x2); +static int64_t mw_mirth_type_Type_hasZ_var2ZAsk (uint64_t x1, VAL x2, VAL x3); +static int64_t mw_mirth_type_Value_hasZ_varZAsk (uint64_t x1, VAL x2); static VAL mw_mirth_type_Type_typeZThen (VAL x1, VAL x2); static VAL mw_mirth_type_Value_type (VAL x1); static VAL mw_mirth_type_PrimType_typeZThen (VAL x1, int64_t x2); @@ -4903,6 +4902,7 @@ static int64_t mw_mirth_type_MetaVar_index (uint64_t x1); static uint64_t mw_mirth_type_MetaVar_allocZBang (void); static VAL mw_mirth_type_MetaVar_typeZAsk (uint64_t x1); static int64_t mw_mirth_type_MetaVar_hasZ_metaZAsk (uint64_t x1, uint64_t x2); +static int64_t mw_mirth_type_MetaVar_hasZ_varZAsk (uint64_t x1, uint64_t x2); static VAL mw_mirth_type_MetaVar_typeZThen (VAL x1, uint64_t x2); static uint64_t mw_mirth_type_MetaVar_newZBang (void); static VAL mw_mirth_type_MetaVar_expand (uint64_t x1); @@ -4916,6 +4916,7 @@ static VAL mw_mirth_type_Type_appZ_typeZ_openZThenZThen (VAL x1, VAL x2, VAL x3) static VAL mw_mirth_type_Resource_ZToType (VAL x1); static VAL mw_mirth_type_Type_ZToResource (VAL x1); static int64_t mw_mirth_type_Resource_hasZ_metaZAsk (uint64_t x1, VAL x2); +static int64_t mw_mirth_type_Resource_hasZ_varZAsk (uint64_t x1, VAL x2); static void mw_mirth_type_Resource_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, VAL *x5, uint64_t *x6, VAL *x7); static void mw_mirth_type_Resource_unifyZ_errorZBang (VAL x1, uint64_t x2, VAL x3, VAL *x4, uint64_t *x5, VAL *x6); static VAL mw_mirth_type_Resource_typeZThen (VAL x1, VAL x2); @@ -4938,6 +4939,7 @@ static int64_t mw_mirth_type_StackType_topZ_typesZ_areZ_fineZAsk (VAL x1); static int64_t mw_mirth_type_StackType_topZ_valueZ_isZ_fineZAsk (VAL x1); static int64_t mw_mirth_type_StackType_topZ_resourceZ_isZ_fineZAsk (VAL x1); static int64_t mw_mirth_type_StackType_hasZ_metaZAsk (uint64_t x1, VAL x2); +static int64_t mw_mirth_type_StackType_hasZ_varZAsk (uint64_t x1, VAL x2); static void mw_mirth_type_StackType_unifyZ_failedZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, VAL *x5, uint64_t *x6, VAL *x7); static void mw_mirth_type_StackType_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, VAL *x5, uint64_t *x6, VAL *x7); static void mw_mirth_type_StackType_unifyZ_errorZBang (VAL x1, uint64_t x2, VAL x3, VAL *x4, uint64_t *x5, VAL *x6); @@ -4953,6 +4955,8 @@ static void mw_mirth_type_StackType_semifreshen (VAL x1, VAL x2, VAL *x3, VAL *x static void mw_mirth_type_StackType_freshen (VAL x1, VAL x2, VAL *x3, VAL *x4); static void mw_mirth_type_StackType_freshenZ_aux (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6); static void mw_mirth_type_StackType_rigidifyZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6); +static VAL mw_mirth_type_StackType_linearZ_baseZ_metaZAsk (VAL x1); +static VAL mw_mirth_type_StackType_linearZ_baseZ_varZAsk (VAL x1); static VAL mw_mirth_type_ArrowType_ZToType (VAL x1); static VAL mw_mirth_type_ArrowType_invert (VAL x1); static void mw_mirth_type_ArrowType_unpack (VAL x1, VAL *x2, VAL *x3); @@ -4961,6 +4965,7 @@ static VAL mw_mirth_type_ArrowType_cod (VAL x1); static void mw_mirth_type_ArrowType_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, VAL *x5, uint64_t *x6, VAL *x7); static void mw_mirth_type_ArrowType_unifyZ_errorZBang (VAL x1, uint64_t x2, VAL x3, VAL *x4, uint64_t *x5, VAL *x6); static int64_t mw_mirth_type_ArrowType_hasZ_metaZAsk (uint64_t x1, VAL x2); +static int64_t mw_mirth_type_ArrowType_hasZ_varZAsk (uint64_t x1, VAL x2); static VAL mw_mirth_type_ArrowType_sigZThen (VAL x1, VAL x2); static VAL mw_mirth_type_ArrowType_semifreshenZ_sig (VAL x1); static VAL mw_mirth_type_ArrowType_semifreshenZ_aux (VAL x1); @@ -4974,6 +4979,7 @@ static VAL mw_mirth_type_Subst_nil (void); static VAL mw_mirth_type_Subst_cons (VAL x1, uint64_t x2, VAL x3); static int64_t mw_mirth_type_Subst_hasZ_varZAsk (uint64_t x1, VAL x2); static VAL mw_mirth_type_Subst_getZ_var (uint64_t x1, VAL x2); +static int64_t mw_mirth_type_StackTypeBase_unitZAsk (VAL x1); static VAL mw_mirth_type_StackTypePart_cons (VAL x1, VAL x2); static void mw_mirth_type_StackType_splitZ_parts (VAL x1, VAL *x2, VAL *x3); static VAL mw_mirth_type_StackTypePart_typeZDivresource (VAL x1); @@ -5167,7 +5173,6 @@ static void mw_mirth_mirth_ZPlusMirth_popZ_diagnostics (VAL x1, VAL *x2, VAL *x3 static VAL mw_mirth_mirth_Diagnostic_diagnosticZThen (VAL x1, VAL x2); static void mw_mirth_mirth_PropLabel_prop (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5); static void mw_mirth_mirth_PropLabel_prop2 (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6); -static void mw_mirth_mirth_PropLabel_prop_1 (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6); static VAL mw_mirth_mirth_Prop_1_readyZAsk (VAL x1); static void mw_mirth_mirth_Prop_1_tryZ_forceZBang (void* x1, VAL x2, VAL *x3, VAL *x4); static void mw_mirth_mirth_Prop_1_forceZBang (void* x1, VAL x2, VAL *x3, VAL *x4); @@ -5508,6 +5513,7 @@ static void mw_mirth_elab_elabZ_defZ_qnameZ_undefined (VAL x1, uint64_t x2, VAL static void mw_mirth_elab_elabZ_defZ_head (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, uint64_t *x5, int64_t *x6, VAL *x7); static void mw_mirth_elab_parseZ_field (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, uint64_t *x5, uint64_t *x6, uint64_t *x7); static void mw_mirth_elab_elabZ_fieldZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4); +static int64_t mw_std_map_Map_2_len (VAL x1); static VAL mw_std_map_Map_2_empty (void); static VAL mw_std_map_Map_2_insert (VAL x1, VAL x2); static void mw_mirth_specializzer_runZ_specializzerZBang (VAL x1, VAL x2, VAL *x3, VAL *x4); @@ -5525,12 +5531,16 @@ static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_caseZBang (VAL x1, VAL x2, static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_lambdaZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6); static VAL mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_wordZBang (uint64_t x1, VAL x2); static VAL mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_blockZBang (uint64_t x1, VAL x2); -static int64_t mw_mirth_specializzer_SPKey_ZEqualZEqual (VAL x1, VAL x2); -static void mw_mirth_specializzer_SPKey_ZToStr (VAL x1, VAL x2, VAL *x3, VAL *x4); -static void mw_mirth_specializzer_SPKey_ZToName (VAL x1, VAL x2, VAL *x3, uint64_t *x4); +static void mw_mirth_arrow_Arg_similar (VAL x1, uint64_t x2, uint64_t x3, VAL *x4, int64_t *x5); +static void mw_mirth_arrow_Block_similar (VAL x1, uint64_t x2, uint64_t x3, VAL *x4, int64_t *x5); +static void mw_mirth_arrow_Arrow_similar (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5); +static void mw_mirth_arrow_Atom_similar (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5); +static void mw_mirth_arrow_Op_similar (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5); +static int64_t mw_mirth_arrow_Coerce_similar (int64_t x1, int64_t x2); +static int64_t mw_mirth_data_TagField_similar (VAL x1, VAL x2); +static void mw_mirth_specializzer_SPKey_similar (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5); static VAL mw_mirth_word_Word_spZ_synthed (uint64_t x1); static void mw_mirth_specializzer_specializzeZ_wordZBang (VAL x1, VAL x2, uint64_t x3, VAL *x4, uint64_t *x5); -static void mw_mirth_specializzer_specializzeZ_ctxZ_type (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6, VAL *x7); static void mw_mirth_specializzer_synthZ_specializzedZ_wordZBang (VAL x1, VAL x2, VAL x3, uint64_t x4, VAL *x5, VAL *x6); static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_arrowZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5); static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_atomZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5); @@ -5627,17 +5637,22 @@ static VAL mw_mirth_c99_ZPlusC99_indent (VAL x1); static void mw_mirth_c99_C99APIArg_popZ_consumeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4); static VAL mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang (VAL x1, VAL x2); static VAL mw_mirth_c99_C99APIArg_pushZ_toZBang (VAL x1, VAL x2, VAL x3); -static VAL mw_mirth_c99_C99APIArg_pushZ_asZ_localZBang (VAL x1, VAL x2); +static VAL mw_mirth_c99_C99APIArg_pushZ_apiZ_argZBang (VAL x1, VAL x2); static void mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_paramsZ_aux (VAL x1, VAL x2, int64_t *x3, VAL *x4, VAL *x5); static void mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_params (VAL x1, VAL x2, int64_t *x3, VAL *x4, VAL *x5); static void mw_mirth_c99_ZPlusC99_cnameZ_typeZ_toZ_c99Z_api (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5); -static void mw_mirth_c99_C99APIArg_reserveZ_asZ_newZ_localZBang (VAL x1, VAL x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_C99APIArg_reserveZ_asZ_newZ_valueZBang (VAL x1, VAL x2, VAL *x3, VAL *x4); static VAL mw_mirth_c99_C99APIArg_reserveZ_asZ_isZBang (VAL x1, VAL x2); static VAL mw_mirth_c99_c99Z_smartZ_callZBang (VAL x1, VAL x2, VAL x3); static VAL mw_mirth_c99_ZPlusC99_smartZ_sigZ_put (VAL x1, VAL x2); static VAL mw_mirth_c99_c99Z_smartZ_sigZBang (VAL x1, VAL x2); static VAL mw_mirth_c99_c99Z_apiZ_enterZBang (VAL x1, VAL x2); static VAL mw_mirth_c99_c99Z_apiZ_exitZBang (VAL x1, VAL x2); +static VAL mw_mirth_c99_c99Z_codipZ_arrowZBang (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99Branch_popZ_stackZBang (VAL x1, VAL x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_ZPlusC99Stack_popZ_stackZ_partZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5); +static VAL mw_mirth_c99_ZPlusC99Stack_reverseZ_catZBang (VAL x1, VAL x2); +static VAL mw_mirth_c99_ZPlusC99Stack_pushZ_stackZBang (VAL x1, VAL x2); static VAL mw_mirth_c99_c99Z_arrowZBang (VAL x1, VAL x2); static VAL mw_mirth_c99_c99Z_atomZBang (VAL x1, VAL x2); static int64_t mw_mirth_arrow_Atom_showZ_inZ_stackZ_traceZAsk (VAL x1); @@ -5649,12 +5664,12 @@ static VAL mw_mirth_c99_c99Z_tagZ_callZBang (VAL x1, uint64_t x2, VAL x3); static VAL mw_mirth_c99_c99Z_reverseZ_tagZBang (uint64_t x1, VAL x2); static VAL mw_mirth_c99_c99Z_labelZ_defsZBang (VAL x1); static VAL mw_mirth_c99_c99Z_labelZ_defZBang (uint64_t x1, VAL x2); -static VAL mw_mirth_c99_pushZ_localZ_labelZ_directZBang (uint64_t x1, VAL x2, VAL x3); -static VAL mw_mirth_c99_pushZ_localZ_labelZBang (uint64_t x1, VAL x2, VAL x3); -static VAL mw_mirth_c99_pushZ_localZ_resourceZ_labelZ_directZBang (uint64_t x1, VAL x2, VAL x3); -static VAL mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang (uint64_t x1, VAL x2, VAL x3); -static void mw_mirth_c99_popZ_localZ_labelZ_directZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5); -static void mw_mirth_c99_popZ_localZ_resourceZ_labelZ_directZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5); +static VAL mw_mirth_c99_pushZ_valueZ_labelZ_directZBang (uint64_t x1, VAL x2, VAL x3); +static VAL mw_mirth_c99_pushZ_valueZ_labelZBang (uint64_t x1, VAL x2, VAL x3); +static VAL mw_mirth_c99_pushZ_resourceZ_labelZ_directZBang (uint64_t x1, VAL x2, VAL x3); +static VAL mw_mirth_c99_pushZ_resourceZ_labelZBang (uint64_t x1, VAL x2, VAL x3); +static void mw_mirth_c99_popZ_valueZ_labelZ_directZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5); +static void mw_mirth_c99_popZ_resourceZ_labelZ_directZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5); static VAL mw_mirth_c99_c99Z_labelZ_pushZBang (VAL x1, uint64_t x2, VAL x3); static VAL mw_mirth_c99_c99Z_labelZ_pushZ_rZBang (VAL x1, uint64_t x2, VAL x3); static VAL mw_mirth_c99_c99Z_labelZ_popZBang (VAL x1, uint64_t x2, VAL x3); @@ -5668,6 +5683,7 @@ static void mw_mirth_c99_c99Z_stringZ_byteZBang (int64_t x1, int64_t x2, VAL x3, static int64_t mw_mirth_c99_C99ReprType_ZEqualZEqual (int64_t x1, int64_t x2); static int64_t mw_mirth_c99_C99ReprType_needsZ_refcountingZAsk (int64_t x1); static int64_t mw_mirth_c99_C99ReprType_isZ_intZ_likeZAsk (int64_t x1); +static VAL mw_mirth_c99_C99ReprType_dummyZ_value (int64_t x1); static VAL mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type (int64_t x1); static VAL mw_mirth_c99_C99ReprType_vZ_macro (int64_t x1); static VAL mw_mirth_c99_C99ReprType_mkZ_macro (int64_t x1); @@ -5677,61 +5693,61 @@ static void mw_mirth_type_Resource_c99Z_repr (VAL x1, VAL x2, int64_t *x3, VAL * static void mw_mirth_type_Type_c99Z_repr (VAL x1, VAL x2, int64_t *x3, VAL *x4); static int64_t mw_mirth_type_PrimType_c99Z_repr (int64_t x1); static void mw_mirth_data_Data_c99Z_repr (uint64_t x1, VAL x2, int64_t *x3, VAL *x4); -static void mw_mirth_c99_ZPlusC99Local_rdup (VAL x1, VAL *x2, VAL *x3); -static void mw_mirth_c99_ZPlusC99Local_rdrop (VAL x1); -static void mw_mirth_c99_C99ReprType_newZ_localZBang (int64_t x1, VAL x2, VAL *x3, VAL *x4); -static void mw_mirth_c99_C99ReprType_popZ_toZ_localZ_directZBang (int64_t x1, VAL x2, VAL *x3, VAL *x4); -static VAL mw_mirth_c99_ZPlusC99Local_pushZ_localZ_directZBang (VAL x1, VAL x2); -static VAL mw_mirth_c99_ZPlusC99Local_consume (VAL x1); -static VAL mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL (VAL x1); -static VAL mw_mirth_c99_ZPlusC99Local_consumeZ_as (int64_t x1, VAL x2); -static VAL mw_mirth_c99_ZPlusC99Local_dropZ_localZBang (VAL x1, VAL x2); -static void mw_mirth_c99_ZPlusC99Local_dupZ_localZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5); -static void mw_mirth_c99_ZPlusC99Local_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3); -static void mw_mirth_c99_ZPlusC99LocalResource_rdup (VAL x1, VAL *x2, VAL *x3); -static void mw_mirth_c99_ZPlusC99LocalResource_rdrop (VAL x1); -static VAL mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang (VAL x1); -static VAL mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang (VAL x1); -static VAL mw_mirth_c99_ZPlusC99LocalResource_dropZ_localZ_resourceZ_asZ_valueZBang (VAL x1, VAL x2); -static void mw_mirth_c99_ZPlusC99LocalResource_dupZ_localZ_resourceZ_asZ_valueZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5); -static VAL mw_mirth_c99_ZPlusC99LocalResource_consume (VAL x1); -static VAL mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL (VAL x1); -static void mw_mirth_c99_ZPlusC99_popZ_localZ_resourceZ_directZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4); -static VAL mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZ_directZBang (VAL x1, VAL x2); -static void mw_mirth_c99_ZPlusC99LocalResource_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3); -static VAL mw_mirth_c99_ZPlusC99LocalValueZDivResource_pushZ_localZ_valueZDivresourceZBang (VAL x1, VAL x2); -static void mw_mirth_c99_ZPlusC99LocalValueZDivResource_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3); -static void mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdup (VAL x1, VAL *x2, VAL *x3); -static void mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdrop (VAL x1); -static VAL mw_mirth_c99_ZPlusC99LocalValueZDivResource_consumeZ_asZ_VAL (VAL x1); -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_valueZDivresourceZ_dataZBang (uint64_t x1, VAL x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_ZPlusC99Value_rdup (VAL x1, VAL *x2, VAL *x3); +static void mw_mirth_c99_ZPlusC99Value_rdrop (VAL x1); +static void mw_mirth_c99_C99ReprType_newZ_valueZBang (int64_t x1, VAL x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_C99ReprType_popZ_valueZ_directZBang (int64_t x1, VAL x2, VAL *x3, VAL *x4); +static VAL mw_mirth_c99_ZPlusC99Value_pushZ_valueZ_directZBang (VAL x1, VAL x2); +static VAL mw_mirth_c99_ZPlusC99Value_consume (VAL x1); +static VAL mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL (VAL x1); +static VAL mw_mirth_c99_ZPlusC99Value_consumeZ_as (int64_t x1, VAL x2); +static VAL mw_mirth_c99_ZPlusC99Value_dropZ_valueZBang (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99Value_dupZ_valueZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5); +static void mw_mirth_c99_ZPlusC99Value_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3); +static void mw_mirth_c99_ZPlusC99Resource_rdup (VAL x1, VAL *x2, VAL *x3); +static void mw_mirth_c99_ZPlusC99Resource_rdrop (VAL x1); +static VAL mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang (VAL x1); +static VAL mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang (VAL x1); +static VAL mw_mirth_c99_ZPlusC99Resource_dropZ_resourceZ_asZ_valueZBang (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99Resource_dupZ_resourceZ_asZ_valueZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5); +static VAL mw_mirth_c99_ZPlusC99Resource_consume (VAL x1); +static VAL mw_mirth_c99_ZPlusC99Resource_consumeZ_asZ_VAL (VAL x1); +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_directZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4); +static VAL mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZ_directZBang (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99Resource_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3); +static VAL mw_mirth_c99_ZPlusC99ValueZDivResource_pushZ_valueZ_valueZDivresourceZBang (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99ValueZDivResource_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3); +static void mw_mirth_c99_ZPlusC99ValueZDivResource_rdup (VAL x1, VAL *x2, VAL *x3); +static void mw_mirth_c99_ZPlusC99ValueZDivResource_rdrop (VAL x1); +static VAL mw_mirth_c99_ZPlusC99ValueZDivResource_consumeZ_asZ_VAL (VAL x1); +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_valueZDivresourceZ_dataZBang (uint64_t x1, VAL x2, VAL *x3, VAL *x4); static VAL mw_mirth_c99_ZPlusC99Branch_refreshZ_branchZBang (VAL x1); -static VAL mw_mirth_c99_ZPlusC99StackCache_refreshZ_allZBang (VAL x1, VAL x2); -static VAL mw_mirth_c99_ZPlusC99StackCache_tieZ_knotZBang (VAL x1, VAL x2); -static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZAsk (VAL x1, VAL *x2, VAL *x3); -static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZAsk (VAL x1, VAL *x2, VAL *x3); -static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_labelZAsk (uint64_t x1, VAL x2, uint64_t *x3, VAL *x4, VAL *x5); -static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZ_labelZAsk (uint64_t x1, VAL x2, uint64_t *x3, VAL *x4, VAL *x5); -static VAL mw_mirth_c99_ZPlusC99StackCache_flushZ_allZBang (VAL x1, VAL x2); -static void mw_mirth_c99_ZPlusC99StackCache_rdup (VAL x1, VAL *x2, VAL *x3); -static void mw_mirth_c99_ZPlusC99StackCache_rdrop (VAL x1); +static VAL mw_mirth_c99_ZPlusC99Stack_refreshZ_allZBang (VAL x1, VAL x2, int64_t x3); +static VAL mw_mirth_c99_ZPlusC99Stack_tieZ_knotZBang (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99Stack_popZ_valueZAsk (VAL x1, VAL *x2, VAL *x3); +static void mw_mirth_c99_ZPlusC99Stack_popZ_resourceZAsk (VAL x1, VAL *x2, VAL *x3); +static void mw_mirth_c99_ZPlusC99Stack_popZ_valueZ_labelZAsk (uint64_t x1, VAL x2, uint64_t *x3, VAL *x4, VAL *x5); +static void mw_mirth_c99_ZPlusC99Stack_popZ_resourceZ_labelZAsk (uint64_t x1, VAL x2, uint64_t *x3, VAL *x4, VAL *x5); +static VAL mw_mirth_c99_ZPlusC99Stack_pushZ_stackZ_directZBang (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99Stack_rdup (VAL x1, VAL *x2, VAL *x3); +static void mw_mirth_c99_ZPlusC99Stack_rdrop (VAL x1); static VAL mw_mirth_c99_ZPlusC99Branch_beginZ_branchZ_splitZBang (VAL x1, VAL x2); static VAL mw_mirth_c99_ZPlusC99BranchSplit_endZ_branchZ_splitZBang (VAL x1); -static VAL mw_mirth_c99_ZPlusC99_startZ_branchZBang (VAL x1); -static VAL mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang (VAL x1); +static VAL mw_mirth_c99_ZPlusC99_startZ_branchZBang (VAL x1, int64_t x2); +static void mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang (VAL x1, VAL *x2, int64_t *x3); static VAL mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang (VAL x1); -static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4); -static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5); -static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4); -static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5); -static VAL mw_mirth_c99_ZPlusC99Local_pushZ_localZBang (VAL x1, VAL x2); -static VAL mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5); +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5); +static VAL mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang (VAL x1, VAL x2); +static VAL mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang (VAL x1, VAL x2); static void mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr (VAL x1, VAL x2, int64_t *x3, VAL *x4); static void mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr (VAL x1, VAL x2, int64_t *x3, VAL *x4); -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5); -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_fromZ_stackZ_typeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5); -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_labelZ_fromZ_stackZ_typeZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6); -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_labelZ_fromZ_stackZ_typeZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6); +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_fromZ_stackZ_typeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5); +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_fromZ_stackZ_typeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5); +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZ_fromZ_stackZ_typeZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6); +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZ_fromZ_stackZ_typeZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6); static VAL mw_mirth_c99_c99Z_primZBang (VAL x1, int64_t x2, VAL x3); static VAL mw_mirth_c99_c99Z_primZ_syntaxZBang (VAL x1, VAL x2); static VAL mw_mirth_c99_c99Z_binopZBang (VAL x1, int64_t x2, VAL x3, int64_t x4, VAL x5, int64_t x6, VAL x7, VAL x8); @@ -5784,33 +5800,92 @@ static void mw_mirth_main_compileZBang (VAL x1, int64_t x2, VAL x3, int64_t *x4, static VAL mw_mirth_main_parseZ_packageZ_def (VAL x1); static void mw_mirth_main_compilerZ_parseZ_args (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6); static int64_t mw_mirth_main_main (int64_t x1); +static VAL mw_std_list_List_1_for_1_sp1 (VAL x1, VAL x2); +static VAL mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2 (VAL x1); +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp1 (uint64_t x1, VAL x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp2 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp3 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static VAL mw_mirth_c99_ZPlusC99_c99Z_line_1_sp3 (VAL x1); +static VAL mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp1 (VAL x1, uint64_t x2, VAL x3); +static VAL mw_std_list_List_1_filter_1_sp1 (VAL x1); +static VAL mw_std_list_List_1_reverseZ_for_1_sp1 (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp4 (uint64_t x1, VAL x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp6 (VAL x1, VAL x2, int64_t *x3, VAL *x4); +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp7 (uint64_t x1, VAL x2, int64_t *x3, VAL *x4); +static void mw_std_maybe_Maybe_1_map_1_sp3 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static void mw_std_maybe_Maybe_1_map_1_sp4 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static VAL mw_std_list_List_1_unions_1_sp1 (VAL x1); +static VAL mw_std_list_List_1_union_1_sp1 (VAL x1, VAL x2); +static VAL mw_std_list_List_1_difference_1_sp1 (VAL x1, VAL x2); +static VAL mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp2 (VAL x1); +static VAL mw_std_list_List_1_for_1_sp17 (VAL x1, VAL x2); +static VAL mw_mirth_c99_ZPlusC99_c99Z_lineZ_if_1_sp21 (int64_t x1, VAL x2); +static VAL mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp3 (VAL x1); +static VAL mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp6 (VAL x1); +static VAL mw_std_list_List_1_reverseZ_for_1_sp5 (VAL x1, VAL x2); +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp12 (uint64_t x1, VAL x2, int64_t *x3, VAL *x4); +static VAL mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp22 (VAL x1, VAL x2); +static VAL mw_mirth_c99_pushZ_labelZ_expressionZBang_1_sp1 (VAL x1, int64_t x2, VAL x3, uint64_t x4); +static void mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp10 (VAL x1, VAL x2, int64_t x3, VAL *x4, VAL *x5); +static void mw_std_maybe_Maybe_1_filter_1_sp1 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static void mw_std_maybe_Maybe_1_filter_1_sp2 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp11 (int64_t x1, VAL x2, VAL x3, int64_t x4, VAL *x5, int64_t *x6, VAL *x7, VAL *x8); +static VAL mw_std_str_Str_1_sp14 (VAL x1); +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13 (uint64_t x1, VAL x2, VAL x3); +static void mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp22 (VAL x1, VAL x2, int64_t x3, VAL *x4, VAL *x5); +static void mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp58 (VAL x1, int64_t x2, VAL x3, VAL x4, VAL *x5, int64_t *x6, VAL *x7); +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp15 (uint64_t x1, VAL x2, VAL *x3, VAL *x4); +static void mw_mirth_c99_ZPlusC99_c99Z_line_1_sp90 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static VAL mw_mirth_c99_pushZ_labelZ_expressionZBang_1_sp5 (VAL x1, int64_t x2, int64_t x3, VAL x4, uint64_t x5); +static void mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp30 (VAL x1, int64_t x2, VAL x3, int64_t x4, VAL *x5, VAL *x6); +static VAL mw_std_maybe_Maybe_1_for_1_sp5 (VAL x1, VAL x2); +static void mw_std_file_ZPlusFileZAsk_unwrapZBang_1_sp1 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static VAL mw_std_list_List_1_for_1_sp46 (VAL x1, VAL x2); +static void mw_mirth_elab_abZ_buildZ_homZBang_1_sp1 (uint64_t x1, VAL x2, VAL x3, VAL x4, uint64_t x5, VAL x6, VAL *x7, VAL *x8); +static void mw_mirth_elab_ZPlusAB_gamma_1_sp1 (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6, VAL *x7); +static void mw_std_maybe_Maybe_1_filter_1_sp3 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static void mw_std_maybe_Maybe_1_filter_1_sp4 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static VAL mw_std_maybe_Maybe_1_map_1_sp10 (VAL x1); +static void mw_std_list_List_1_reverseZ_for_1_sp9 (VAL x1, VAL x2, VAL x3, VAL x4, VAL x5, VAL *x6, VAL *x7, VAL *x8, VAL *x9); +static VAL mw_std_maybe_Maybe_1_bind_1_sp5 (VAL x1); +static void mw_std_list_List_1_ZEqualZEqual_1_sp1 (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5); +static VAL mw_std_list_List_1_for_1_sp60 (VAL x1, VAL x2); +static void mw_std_maybe_Maybe_1_bind_1_sp7 (VAL x1, VAL x2, VAL *x3, VAL *x4); +static void mw_std_list_List_1_for_1_sp63 (VAL x1, VAL x2, VAL x3, VAL x4, VAL x5, VAL *x6, VAL *x7, VAL *x8, VAL *x9); +static int64_t mw_std_list_List_1_member_1_sp4 (VAL x1, VAL x2); +static VAL mw_std_list_List_1_for_1_sp80 (VAL x1, VAL x2); +static int64_t mw_std_maybe_Maybe_1_has_1_sp8 (VAL x1); +static VAL mw_std_maybe_Maybe_1_filter_1_sp12 (VAL x1); +static VAL mw_mirth_mirth_PropLabel_prop_1_sp15 (uint64_t x1, VAL x2); +static void mw_mirth_elab_abZ_buildZ_wordZBang_1_sp6 (uint64_t x1, VAL x2, uint64_t x3, uint64_t *x4, VAL *x5, uint64_t *x6); +static VAL mw_std_list_List_1_filterZ_some_1_sp4 (VAL x1); +static void mw_mirth_elab_abZ_buildZBang_1_sp32 (VAL x1, VAL x2, VAL x3, uint64_t x4, VAL x5, VAL *x6, VAL *x7); +static VAL mw_std_maybe_Maybe_1_for_1_sp17 (VAL x1, VAL x2); +static void mw_std_maybe_Maybe_1_map_1_sp14 (VAL x1, VAL x2, VAL *x3, VAL *x4); static void mb_mirth_main_main_1 (void); -static void mb_mirth_elab_elabZ_blockZ_atZBang_1 (void); -static void mb_mirth_elab_elabZ_defZBang_0 (void); -static void mb_mirth_elab_elabZ_defZBang_2 (void); -static void mb_mirth_elab_elabZ_defZBang_3 (void); -static void mb_mirth_elab_elabZ_defZ_typeZBang_2 (void); -static void mb_mirth_elab_elabZ_variableZBang_1 (void); -static void mb_mirth_elab_elabZ_fieldZBang_1 (void); -static void mb_mirth_elab_elabZ_fieldZBang_2 (void); -static void mb_mirth_elab_elabZ_dataZ_headerZBang_2 (void); -static void mb_mirth_elab_elabZ_dataZ_doneZBang_5 (void); -static void mb_mirth_elab_elabZ_dataZ_doneZBang_14 (void); static void mb_mirth_elab_elabZ_defZ_head_3 (void); -static void mb_mirth_elab_createZ_projectorsZBang_24 (void); -static void mb_mirth_elab_elabZ_externalZ_defZBang_2 (void); -static void mb_mirth_elab_elabZ_externalZ_defZBang_4 (void); -static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotspecializzerZDotspecializzeZ_wordZBangZDot81ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotspecializzerZDotspecializzeZ_wordZBangZDot63ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop4_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot267ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot167ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot134ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot106ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot73ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot45ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotelabZ_dataZ_doneZBangZDot104ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotelabZ_dataZ_tagZBangZDot42ZRParen_1 (void); -static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotelabZ_aliasZBangZDot21ZRParen_1 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp1_0 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp2_2 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp3_6 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp4_0 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp5_2 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp6_9 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp7_1 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp8_5 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp9_3 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp10_5 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp11_3 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp12_7 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp13_2 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp14_0 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp15_0 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp16_1 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp17_0 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp18_1 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp19_0 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp20_5 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp21_0 (void); +static void mb_mirth_mirth_PropLabel_prop_1_sp22_6 (void); static void* mfld_mirth_label_Label_ZTildename (uint64_t i); static void* mfld_mirth_var_Var_ZTildename (uint64_t i); static void* mfld_mirth_var_Var_ZTildetype (uint64_t i); @@ -5939,8 +6014,8 @@ static void* mfld_mirth_word_Word_ZTildec99Z_api (uint64_t i); int main (int argc, char** argv) { global_argc = argc; global_argv = argv; - int64_t v0 = (0 /* The World! */); - int64_t v1 = (mw_mirth_main_main(v0)); + int64_t v0 = 0 /* The World! */; + int64_t v1 = mw_mirth_main_main(v0); push_resource(MKI64(v1)); return 0; } @@ -6984,169 +7059,6 @@ static VAL mw_std_either_Either_2_rightZAsk (VAL x1) { } return x2; } -static void mw_std_prim_Ptr_ZAtByte (void* x1, int64_t x2, int64_t *x3, int64_t *x4) { - uint8_t v5 = *(uint8_t*)x1; - *x4 = x2; - *x3 = ((int64_t)v5); -} -static int64_t mw_std_byte_Byte_isZ_upper (int64_t x1) { - int64_t v2 = 65LL /* B'A' */; - int64_t v3 = 90LL /* B'Z' */; - bool v4 = (x1 >= v2); - bool v5 = (x1 <= v3); - bool v6 = (v4 && v5); - return ((int64_t)v6); -} -static int64_t mw_std_byte_Byte_isZ_lower (int64_t x1) { - int64_t v2 = 97LL /* B'a' */; - int64_t v3 = 122LL /* B'z' */; - bool v4 = (x1 >= v2); - bool v5 = (x1 <= v3); - bool v6 = (v4 && v5); - return ((int64_t)v6); -} -static int64_t mw_std_byte_Byte_isZ_digit (int64_t x1) { - int64_t v2 = 48LL /* B'0' */; - int64_t v3 = 57LL /* B'9' */; - bool v4 = (x1 >= v2); - bool v5 = (x1 <= v3); - bool v6 = (v4 && v5); - return ((int64_t)v6); -} -static int64_t mw_std_byte_Byte_isZ_alpha (int64_t x1) { - int64_t v2 = mw_std_byte_Byte_isZ_upper(x1); - int64_t x3; - if (((bool)v2)) { - int64_t v4 = 1LL /* True */; - x3 = v4; - } else { - int64_t v5 = mw_std_byte_Byte_isZ_lower(x1); - x3 = v5; - } - return x3; -} -static int64_t mw_std_byte_Byte_isZ_alnum (int64_t x1) { - int64_t v2 = mw_std_byte_Byte_isZ_digit(x1); - int64_t x3; - if (((bool)v2)) { - int64_t v4 = 1LL /* True */; - x3 = v4; - } else { - int64_t v5 = mw_std_byte_Byte_isZ_alpha(x1); - x3 = v5; - } - return x3; -} -static int64_t mw_std_byte_Byte_isZ_printable (int64_t x1) { - int64_t v2 = 33LL /* B'!' */; - int64_t v3 = 126LL /* B'~' */; - bool v4 = (x1 >= v2); - bool v5 = (x1 <= v3); - bool v6 = (v4 && v5); - return ((int64_t)v6); -} -static int64_t mw_std_byte_Byte_isZ_hexdigit (int64_t x1) { - int64_t x2; - switch (x1) { - case 48LL: { // B'0' - int64_t v3 = 1LL /* True */; - x2 = v3; - } break; - case 49LL: { // B'1' - int64_t v4 = 1LL /* True */; - x2 = v4; - } break; - case 50LL: { // B'2' - int64_t v5 = 1LL /* True */; - x2 = v5; - } break; - case 51LL: { // B'3' - int64_t v6 = 1LL /* True */; - x2 = v6; - } break; - case 52LL: { // B'4' - int64_t v7 = 1LL /* True */; - x2 = v7; - } break; - case 53LL: { // B'5' - int64_t v8 = 1LL /* True */; - x2 = v8; - } break; - case 54LL: { // B'6' - int64_t v9 = 1LL /* True */; - x2 = v9; - } break; - case 55LL: { // B'7' - int64_t v10 = 1LL /* True */; - x2 = v10; - } break; - case 56LL: { // B'8' - int64_t v11 = 1LL /* True */; - x2 = v11; - } break; - case 57LL: { // B'9' - int64_t v12 = 1LL /* True */; - x2 = v12; - } break; - case 65LL: { // B'A' - int64_t v13 = 1LL /* True */; - x2 = v13; - } break; - case 66LL: { // B'B' - int64_t v14 = 1LL /* True */; - x2 = v14; - } break; - case 67LL: { // B'C' - int64_t v15 = 1LL /* True */; - x2 = v15; - } break; - case 68LL: { // B'D' - int64_t v16 = 1LL /* True */; - x2 = v16; - } break; - case 69LL: { // B'E' - int64_t v17 = 1LL /* True */; - x2 = v17; - } break; - case 70LL: { // B'F' - int64_t v18 = 1LL /* True */; - x2 = v18; - } break; - case 97LL: { // B'a' - int64_t v19 = 1LL /* True */; - x2 = v19; - } break; - case 98LL: { // B'b' - int64_t v20 = 1LL /* True */; - x2 = v20; - } break; - case 99LL: { // B'c' - int64_t v21 = 1LL /* True */; - x2 = v21; - } break; - case 100LL: { // B'd' - int64_t v22 = 1LL /* True */; - x2 = v22; - } break; - case 101LL: { // B'e' - int64_t v23 = 1LL /* True */; - x2 = v23; - } break; - case 102LL: { // B'f' - int64_t v24 = 1LL /* True */; - x2 = v24; - } break; - default: { - int64_t v25 = 0LL /* False */; - x2 = v25; - } break; - } - return x2; -} -static VAL mw_std_byte_Byte_emitZ_asciiZThen (VAL x1, int64_t x2) { - VAL v3 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(x2, x1)); - return v3; -} static VAL mw_std_byte_Byte_toZ_strZ_unsafe (int64_t x1) { VAL v2 = MKI64(0LL /* Nil */); VAL v3 = mtw_std_list_List_1_Cons(MKI64(x1), v2); @@ -7270,24 +7182,6 @@ static int64_t mw_std_byte_Byte_isZ_nameZ_byte (int64_t x1) { } return x2; } -static int64_t mw_std_byte_Byte_isZ_sign (int64_t x1) { - int64_t x2; - switch (x1) { - case 45LL: { // B'-' - int64_t v3 = 1LL /* True */; - x2 = v3; - } break; - case 43LL: { // B'+' - int64_t v4 = 1LL /* True */; - x2 = v4; - } break; - default: { - int64_t v5 = 0LL /* False */; - x2 = v5; - } break; - } - return x2; -} static VAL mw_std_byte_Byte_zzencode (int64_t x1) { VAL x2; switch (x1) { @@ -7457,36 +7351,52 @@ static VAL mw_std_byte_Byte_zzencode (int64_t x1) { x2 = MKSTR(v35); } break; default: { - int64_t v36 = mw_std_byte_Byte_isZ_alnum(x1); - VAL x37; - if (((bool)v36)) { - VAL v38 = mw_std_byte_Byte_toZ_strZ_unsafe(x1); - x37 = v38; + int64_t v36 = 48LL /* B'0' */; + int64_t v37 = 57LL /* B'9' */; + bool v38 = (x1 >= v36); + bool v39 = (x1 <= v37); + bool v40 = (v38 && v39); + int64_t v41 = 65LL /* B'A' */; + int64_t v42 = 90LL /* B'Z' */; + bool v43 = (x1 >= v41); + bool v44 = (x1 <= v42); + bool v45 = (v43 && v44); + int64_t v46 = 97LL /* B'a' */; + int64_t v47 = 122LL /* B'z' */; + bool v48 = (x1 >= v46); + bool v49 = (x1 <= v47); + bool v50 = (v48 && v49); + bool v51 = (v45 || v50); + bool v52 = (v40 || v51); + VAL x53; + if (v52) { + VAL v54 = mw_std_byte_Byte_toZ_strZ_unsafe(x1); + x53 = v54; } else { - STR* v39; - STRLIT(v39, "", 0); - STR* v40; - STRLIT(v40, "Z", 1); - VAL v41 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v40), MKSTR(v39))); - STR* v42 = i64_show(x1); - VAL v43 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v42), v41)); - STR* v44; - STRLIT(v44, "U", 1); - VAL v45 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v44), v43)); - x37 = v45; + STR* v55; + STRLIT(v55, "", 0); + STR* v56; + STRLIT(v56, "Z", 1); + VAL v57 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v56), MKSTR(v55)); + STR* v58 = i64_show(x1); + VAL v59 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v58), v57); + STR* v60; + STRLIT(v60, "U", 1); + VAL v61 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v60), v59); + x53 = v61; } - x2 = x37; + x2 = x53; } break; } return x2; } static VAL mw_std_buffer_ZPlusBuffer_new (int64_t x1) { - int64_t v2 = (0LL /* +Unsafe */); + int64_t v2 = 0LL /* +Unsafe */; void* v3 = ptr_alloc(((uint64_t)x1));; - VAL v4 = (mtw_std_buffer_ZPlusBuffer_ZPlusBuffer(x1, v3)); + VAL v4 = mtw_std_buffer_ZPlusBuffer_ZPlusBuffer(x1, v3); int64_t v5 = 0LL; int64_t v6 = VI64(VTUP(v4)->cells[1]); - VAL v7 = (mw_std_buffer_ZPlusBuffer_eraseZ_spanZBang(v5, v6, v4)); + VAL v7 = mw_std_buffer_ZPlusBuffer_eraseZ_spanZBang(v5, v6, v4); return v7; } static VAL mw_std_buffer_ZPlusBuffer_resizzeZBang (int64_t x1, VAL x2) { @@ -7494,7 +7404,7 @@ static VAL mw_std_buffer_ZPlusBuffer_resizzeZBang (int64_t x1, VAL x2) { VTUP(x2)->cells[1] = MKI64(x1); int64_t v4 = VI64(VTUP(x2)->cells[1]); void* v5 = VPTR(VTUP(x2)->cells[2]); - int64_t v6 = (0LL /* +Unsafe */); + int64_t v6 = 0LL /* +Unsafe */; void* v7 = ptr_realloc(v5,((uint64_t)v4)); VTUP(x2)->cells[2] = MKPTR(v7); int64_t v8 = VI64(VTUP(x2)->cells[1]); @@ -7505,7 +7415,7 @@ static VAL mw_std_buffer_ZPlusBuffer_resizzeZBang (int64_t x1, VAL x2) { if (v11) { x12 = x2; } else { - VAL v13 = (mw_std_buffer_ZPlusBuffer_eraseZ_spanZBang(v3, v9, x2)); + VAL v13 = mw_std_buffer_ZPlusBuffer_eraseZ_spanZBang(v3, v9, x2); x12 = v13; } return x12; @@ -7518,18 +7428,9 @@ static VAL mw_std_buffer_ZPlusBuffer_expandZBang (int64_t x1, VAL x2) { int64_t v6 = VI64(VTUP(x2)->cells[1]); int64_t v7 = 2LL; int64_t v8 = i64_mul(v6, v7); - bool v9 = (x1 < v8); - int64_t x10; - if (v9) { - x10 = v8; - push_resource(x2); - } else { - x10 = x1; - push_resource(x2); - } - VAL r11 = pop_resource(); - VAL v12 = (mw_std_buffer_ZPlusBuffer_resizzeZBang(x10, r11)); - x5 = v12; + int64_t v9 = mw_std_prim_Int_max(x1, v8); + VAL v10 = mw_std_buffer_ZPlusBuffer_resizzeZBang(v9, x2); + x5 = v10; } else { x5 = x2; } @@ -7539,7 +7440,7 @@ static void mw_std_buffer_ZPlusBuffer_rdrop (VAL x1) { int64_t v2; void* v3; mtp_std_buffer_ZPlusBuffer_ZPlusBuffer(x1, &v2, &v3); - int64_t v4 = (0LL /* +Unsafe */); + int64_t v4 = 0LL /* +Unsafe */; free(v3); } static VAL mw_std_buffer_ZPlusBuffer_eraseZ_spanZBang (int64_t x1, int64_t x2, VAL x3) { @@ -7548,7 +7449,7 @@ static VAL mw_std_buffer_ZPlusBuffer_eraseZ_spanZBang (int64_t x1, int64_t x2, V VAL v6; mw_std_buffer_ZPlusBuffer_clampZ_spanZBang(x1, x2, x3, &v4, &v5, &v6); void* v7 = VPTR(VTUP(v6)->cells[2]); - int64_t v8 = (0LL /* +Unsafe */); + int64_t v8 = 0LL /* +Unsafe */; void* v9 = (void*)(v4 + (char*)v7); int64_t v10 = 0LL; ptr_fill(((uint8_t)v10), ((uint64_t)v5), v9); @@ -7569,22 +7470,10 @@ static void mw_std_buffer_ZPlusBuffer_clampZ_spanZBang (int64_t x1, int64_t x2, x12 = v14; x11 = x3; } else { - bool v16 = (v8 < x2); - int64_t x17; - if (v16) { - x17 = v8; - push_resource(x3); - push_i64(x1); - } else { - x17 = x2; - push_resource(x3); - push_i64(x1); - } - x13 = x17; - int64_t v18 = pop_i64(); - x12 = v18; - VAL r19 = pop_resource(); - x11 = r19; + int64_t v16 = mw_std_prim_Int_min(v8, x2); + x13 = v16; + x12 = x1; + x11 = x3; } *x6 = x11; *x5 = x13; @@ -7592,7 +7481,7 @@ static void mw_std_buffer_ZPlusBuffer_clampZ_spanZBang (int64_t x1, int64_t x2, } static void mw_std_buffer_ZPlusBuffer_prepareZ_spanZBang (int64_t x1, int64_t x2, VAL x3, int64_t *x4, VAL *x5) { int64_t v6 = i64_add(x2, x1); - VAL v7 = (mw_std_buffer_ZPlusBuffer_expandZBang(v6, x3)); + VAL v7 = mw_std_buffer_ZPlusBuffer_expandZBang(v6, x3); *x5 = v7; *x4 = x1; } @@ -7602,7 +7491,7 @@ static void mw_std_buffer_ZPlusBuffer_ZAtU8 (int64_t x1, VAL x2, int64_t *x3, VA VAL v7; mw_std_buffer_ZPlusBuffer_prepareZ_spanZBang(x1, v5, x2, &v6, &v7); void* v8 = VPTR(VTUP(v7)->cells[2]); - int64_t v9 = (0LL /* +Unsafe */); + int64_t v9 = 0LL /* +Unsafe */; void* v10 = (void*)(v6 + (char*)v8); uint8_t v11 = *(uint8_t*)v10; *x4 = v7; @@ -7614,153 +7503,76 @@ static VAL mw_std_buffer_ZPlusBuffer_ZBangU8 (int64_t x1, int64_t x2, VAL x3) { VAL v6; mw_std_buffer_ZPlusBuffer_prepareZ_spanZBang(x2, v4, x3, &v5, &v6); void* v7 = VPTR(VTUP(v6)->cells[2]); - int64_t v8 = (0LL /* +Unsafe */); + int64_t v8 = 0LL /* +Unsafe */; void* v9 = (void*)(v5 + (char*)v7); *(uint8_t*)v9 = ((uint8_t)x1); return v6; } static VAL mw_std_buffer_ZPlusBuffer_ZBangByte (int64_t x1, int64_t x2, VAL x3) { - VAL v4 = (mw_std_buffer_ZPlusBuffer_ZBangU8(x1, x2, x3)); + VAL v4 = mw_std_buffer_ZPlusBuffer_ZBangU8(x1, x2, x3); return v4; } static VAL mw_std_buffer_ZPlusBuffer_ZBangStr (VAL x1, int64_t x2, VAL x3) { incref(x1); uint64_t v4 = str_size(VSTR(x1)); - int64_t v5 = 0LL; - bool v6 = (((int64_t)v4) < v5); - int64_t x7; - if (v6) { - x7 = v5; - push_resource(x3); - push_value(x1); - push_i64(x2); - } else { - x7 = ((int64_t)v4); - push_resource(x3); - push_value(x1); - push_i64(x2); - } - VAL r8 = pop_resource(); - int64_t v9 = pop_i64(); - int64_t v10; - VAL v11; - mw_std_buffer_ZPlusBuffer_prepareZ_spanZBang(v9, x7, r8, &v10, &v11); - void* v12 = VPTR(VTUP(v11)->cells[2]); - int64_t v13 = (0LL /* +Unsafe */); - void* v14 = (void*)(v10 + (char*)v12); - VAL v15 = pop_value(); - void* v16; - int64_t v17; - mw_std_prim_Ptr_ZBangStrZPlus(v15, v14, v13, &v16, &v17); - return v11; + int64_t v5; + VAL v6; + mw_std_buffer_ZPlusBuffer_prepareZ_spanZBang(x2, ((int64_t)v4), x3, &v5, &v6); + void* v7 = VPTR(VTUP(v6)->cells[2]); + int64_t v8 = 0LL /* +Unsafe */; + void* v9 = (void*)(v5 + (char*)v7); + int64_t v10 = mw_std_prim_Ptr_ZBangStr(x1, v9, v8); + return v6; } static void mw_std_buffer_ZPlusBuffer_ZAtStr (int64_t x1, int64_t x2, VAL x3, VAL *x4, VAL *x5) { int64_t v6; VAL v7; mw_std_buffer_ZPlusBuffer_prepareZ_spanZBang(x1, x2, x3, &v6, &v7); void* v8 = VPTR(VTUP(v7)->cells[2]); - int64_t v9 = (0LL /* +Unsafe */); + int64_t v9 = 0LL /* +Unsafe */; void* v10 = (void*)(v6 + (char*)v8); STR* v11 = str_make(v10, ((uint64_t)x2)); *x5 = v7; *x4 = MKSTR(v11); } -static void mw_std_prim_Ptr_ZBangStrZPlus (VAL x1, void* x2, int64_t x3, void* *x4, int64_t *x5) { +static int64_t mw_std_prim_Ptr_ZBangStr (VAL x1, void* x2, int64_t x3) { incref(x1); incref(x1); - void* v6 = str_base(VSTR(x1)); - uint64_t v7 = str_size(VSTR(x1)); - int64_t v8 = 0LL; - bool v9 = (((int64_t)v7) < v8); - int64_t x10; - if (v9) { - x10 = v8; - push_resource(MKI64(x3)); - push_ptr(x2); - push_ptr(v6); - } else { - x10 = ((int64_t)v7); - push_resource(MKI64(x3)); - push_ptr(x2); - push_ptr(v6); - } - VAL v11 = pop_value(); - VAL v12 = pop_value(); - incref(v12); - void* v13 = (void*)(x10 + (char*)VPTR(v12)); - ptr_copy(VPTR(v11), ((uint64_t)x10), VPTR(v12)); + void* v4 = str_base(VSTR(x1)); + uint64_t v5 = str_size(VSTR(x1)); + ptr_copy(v4, v5, x2); decref(x1); - int64_t r14 = VI64(pop_resource()); - *x5 = r14; - *x4 = v13; -} -static void mw_std_str_ZPlusStr_dupZBang (VAL x1, VAL *x2, VAL *x3) { - incref(x1); - *x3 = x1; - *x2 = x1; + return x3; } -static void mw_std_str_ZPlusStr_numZ_bytesZAsk (VAL x1, int64_t *x2, VAL *x3) { +static int64_t mw_std_prim_Str_lastZ_byte (VAL x1) { incref(x1); - uint64_t v4 = str_size(VSTR(x1)); + uint64_t v2 = str_size(VSTR(x1)); + int64_t v3 = 1LL; + int64_t v4 = i64_sub(((int64_t)v2), v3); int64_t v5 = 0LL; - bool v6 = (((int64_t)v4) < v5); + bool v6 = (v4 < v5); int64_t x7; if (v6) { - x7 = v5; - push_value(x1); - } else { - x7 = ((int64_t)v4); - push_value(x1); - } - VAL v8 = pop_value(); - *x3 = v8; - *x2 = x7; -} -static int64_t mw_std_prim_Str_lastZ_byte (VAL x1) { - incref(x1); - uint64_t v2 = str_size(VSTR(x1)); - int64_t v3 = 0LL; - bool v4 = (((int64_t)v2) < v3); - int64_t x5; - if (v4) { - x5 = v3; - push_value(x1); - } else { - x5 = ((int64_t)v2); - push_value(x1); - } - int64_t v6 = 1LL; - int64_t v7 = i64_sub(x5, v6); - int64_t v8 = 0LL; - bool v9 = (v7 < v8); - int64_t x10; - if (v9) { - VAL v11 = pop_value(); - decref(v11); - int64_t v12 = 0LL /* BNUL */; - x10 = v12; + decref(x1); + int64_t v8 = 0LL /* BNUL */; + x7 = v8; } else { - VAL v13 = pop_value(); - int64_t v14 = mw_std_prim_Str_byteZAt(v7, v13); - x10 = v14; + int64_t v9 = mw_std_prim_Str_byteZAt(v4, x1); + x7 = v9; } - return x10; + return x7; } static void mw_std_str_ZPlusStr_lastZ_byte (VAL x1, int64_t *x2, VAL *x3) { - VAL v4; - VAL v5; - mw_std_str_ZPlusStr_dupZBang(x1, &v4, &v5); - int64_t v6 = mw_std_prim_Str_lastZ_byte(v4); - *x3 = v5; - *x2 = v6; + incref(x1); + int64_t v4 = mw_std_prim_Str_lastZ_byte(x1); + *x3 = x1; + *x2 = v4; } static void mw_std_str_ZPlusStr_byteZAt (int64_t x1, VAL x2, int64_t *x3, VAL *x4) { - VAL v5; - VAL v6; - mw_std_str_ZPlusStr_dupZBang(x2, &v5, &v6); - int64_t v7 = mw_std_prim_Str_byteZAt(x1, v5); - *x4 = v6; - *x3 = v7; + incref(x2); + int64_t v5 = mw_std_prim_Str_byteZAt(x1, x2); + *x4 = x2; + *x3 = v5; } static int64_t mw_std_str_offsetZ_inZ_bounds (int64_t x1, int64_t x2) { int64_t v3 = 0LL; @@ -7774,42 +7586,23 @@ static int64_t mw_std_prim_Str_byteZAt (int64_t x1, VAL x2) { incref(x2); void* v3 = str_base(VSTR(x2)); uint64_t v4 = str_size(VSTR(x2)); - int64_t v5 = 0LL; - bool v6 = (((int64_t)v4) < v5); - int64_t x7; - if (v6) { - x7 = v5; - push_i64(x1); - push_ptr(v3); - } else { - x7 = ((int64_t)v4); - push_i64(x1); - push_ptr(v3); - } - VAL v8 = pop_value(); - VAL v9 = pop_value(); - incref(v9); - int64_t v10 = mw_std_str_offsetZ_inZ_bounds(VI64(v9), x7); - int64_t x11; - if (((bool)v10)) { - int64_t v12 = (0LL /* +Unsafe */); - void* v13 = (void*)(VI64(v9) + (char*)VPTR(v8)); - int64_t v14; - int64_t v15; - mw_std_prim_Ptr_ZAtByte(v13, v12, &v14, &v15); - x11 = v14; + int64_t v5 = mw_std_str_offsetZ_inZ_bounds(x1, ((int64_t)v4)); + int64_t x6; + if (((bool)v5)) { + int64_t v7 = 0LL /* +Unsafe */; + void* v8 = (void*)(x1 + (char*)v3); + uint8_t v9 = *(uint8_t*)v8; + x6 = ((int64_t)v9); } else { - decref(v8); - decref(v9); - int64_t v16 = 0LL /* BNUL */; - x11 = v16; + int64_t v10 = 0LL /* BNUL */; + x6 = v10; } decref(x2); - return x11; + return x6; } static VAL mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang (int64_t x1, VAL x2) { VAL v3 = mw_std_byte_Byte_toZ_strZ_unsafe(x1); - VAL v4 = (mw_std_str_ZPlusStr_pushZ_strZBang(v3, x2)); + VAL v4 = mw_std_str_ZPlusStr_pushZ_strZBang(v3, x2); return v4; } static VAL mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang (int64_t x1, VAL x2) { @@ -7818,7 +7611,7 @@ static VAL mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang (int64_t x1, VAL x2) { switch (get_data_tag(v3)) { case 1LL: { // Some VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v6 = (mw_std_str_ZPlusStr_pushZ_strZBang(v5, x2)); + VAL v6 = mw_std_str_ZPlusStr_pushZ_strZBang(v5, x2); x4 = v6; } break; case 0LL: { // None @@ -7839,203 +7632,115 @@ static void mw_std_prim_Str_dropZ_bytes (int64_t x1, VAL x2, int64_t x3, VAL *x4 incref(x2); void* v6 = str_base(VSTR(x2)); uint64_t v7 = str_size(VSTR(x2)); - int64_t v8 = 0LL; - bool v9 = (((int64_t)v7) < v8); - int64_t x10; - if (v9) { - x10 = v8; - push_i64(x1); - push_resource(MKI64(x3)); - push_ptr(v6); - } else { - x10 = ((int64_t)v7); - push_i64(x1); - push_resource(MKI64(x3)); - push_ptr(v6); - } - VAL v11 = pop_value(); - VAL v12 = pop_value(); - incref(v12); - int64_t v13 = i64_sub(x10, VI64(v12)); - int64_t v14 = 0LL; - bool v15 = (v13 < v14); - VAL x16; - int64_t x17; - if (v15) { - decref(v11); - decref(v12); - STR* v18; - STRLIT(v18, "", 0); - int64_t r19 = VI64(pop_resource()); - x17 = r19; - x16 = MKSTR(v18); + int64_t v8 = i64_sub(((int64_t)v7), x1); + int64_t v9 = 0LL; + bool v10 = (v8 < v9); + int64_t x11; + VAL x12; + if (v10) { + STR* v13; + STRLIT(v13, "", 0); + x12 = MKSTR(v13); + x11 = x3; } else { - void* v20 = (void*)(VI64(v12) + (char*)VPTR(v11)); - STR* v21 = str_make(v20, ((uint64_t)v13)); - int64_t r22 = VI64(pop_resource()); - x17 = r22; - x16 = MKSTR(v21); + void* v14 = (void*)(x1 + (char*)v6); + STR* v15 = str_make(v14, ((uint64_t)v8)); + x12 = MKSTR(v15); + x11 = x3; } decref(x2); - *x5 = x17; - *x4 = x16; + *x5 = x11; + *x4 = x12; } static VAL mw_std_prim_Str_fromZ_bytesZ_unsafe (VAL x1) { incref(x1); int64_t v2 = mw_std_list_List_1_len(x1); - VAL v3 = (mw_std_buffer_ZPlusBuffer_new(v2)); + VAL v3 = mw_std_buffer_ZPlusBuffer_new(v2); int64_t v4 = 0LL; - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(x1, &v5, &v6); - VAL x7; - int64_t x8; - VAL x9; - int64_t x10; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v5); - VAL v12 = (mw_std_buffer_ZPlusBuffer_ZBangU8(VI64(v11), v4, v3)); - int64_t v13 = 1LL; - int64_t v14 = i64_add(v4, v13); - int64_t v15 = 1LL /* True */; - x10 = v15; - x9 = v6; - x8 = v14; - x7 = v12; - } break; - case 0LL: { // None - int64_t v16 = 0LL /* False */; - x10 = v16; - x9 = v6; - x8 = v4; - x7 = v3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v17 = (x7); - int64_t v18 = x8; - VAL v19 = x9; - int64_t v20 = x10; - while (((bool)v20)) { - VAL v21 = (v17); - int64_t v22 = v18; - VAL v23 = v19; - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v23, &v24, &v25); - VAL x26; - int64_t x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v24)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v24); - VAL v31 = (mw_std_buffer_ZPlusBuffer_ZBangU8(VI64(v30), v22, v21)); - int64_t v32 = 1LL; - int64_t v33 = i64_add(v22, v32); - int64_t v34 = 1LL /* True */; - x29 = v34; - x28 = v25; - x27 = v33; - x26 = v31; + int64_t v5 = 1LL /* True */; + VAL v6 = v3; + int64_t v7 = v4; + VAL v8 = x1; + int64_t v9 = v5; + int64_t v10 = v5; + while (((bool)v10)) { + VAL v11 = v6; + int64_t v12 = v7; + VAL v13 = v8; + int64_t v14 = v9; + VAL x15; + int64_t x16; + VAL x17; + int64_t x18; + switch (get_data_tag(v13)) { + case 1LL: { // Cons + VAL v19; + VAL v20; + mtp_std_list_List_1_Cons(v13, &v19, &v20); + VAL v21 = mw_std_buffer_ZPlusBuffer_ZBangU8(VI64(v19), v12, v11); + int64_t v22 = 1LL; + int64_t v23 = i64_add(v12, v22); + int64_t v24 = 1LL /* True */; + x18 = v24; + x17 = v20; + x16 = v23; + x15 = v21; } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x29 = v35; - x28 = v25; - x27 = v22; - x26 = v21; + case 0LL: { // Nil + VAL v25 = MKI64(0LL /* Nil */); + int64_t v26 = 0LL /* False */; + x18 = v26; + x17 = v25; + x16 = v12; + x15 = v11; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v20 = x29; - v19 = x28; - v18 = x27; - v17 = x26; + v10 = x18; + v9 = x18; + v8 = x17; + v7 = x16; + v6 = x15; } - decref(v19); - void* v36 = VPTR(VTUP(v17)->cells[2]); - int64_t v37 = VI64(VTUP(v17)->cells[1]); - int64_t v38 = (0LL /* +Unsafe */); - STR* v39 = str_make(v36, ((uint64_t)v37)); - mw_std_buffer_ZPlusBuffer_rdrop(v17); - return MKSTR(v39); + decref(v8); + void* v27 = VPTR(VTUP(v6)->cells[2]); + int64_t v28 = VI64(VTUP(v6)->cells[1]); + int64_t v29 = 0LL /* +Unsafe */; + STR* v30 = str_make(v27, ((uint64_t)v28)); + mw_std_buffer_ZPlusBuffer_rdrop(v6); + return MKSTR(v30); } static void mw_std_str_clampZ_sliceZ_offsetZ_sizze (int64_t x1, int64_t x2, int64_t x3, int64_t *x4, int64_t *x5) { - bool v6 = (x1 < x3); - int64_t x7; - if (v6) { - x7 = x1; - push_i64(x3); - } else { - x7 = x3; - push_i64(x3); - } - VAL v8 = pop_value(); - int64_t v9 = i64_sub(VI64(v8), x7); - int64_t v10 = 0LL; - bool v11 = (v9 < v10); - int64_t x12; - int64_t x13; - if (v11) { - int64_t v14 = 0LL; - x13 = v14; - x12 = x7; + int64_t v6 = mw_std_prim_Int_min(x1, x3); + int64_t v7 = i64_sub(x3, v6); + int64_t v8 = 0LL; + bool v9 = (v7 < v8); + int64_t x10; + if (v9) { + int64_t v11 = 0LL; + x10 = v11; } else { - bool v15 = (x2 < v9); - int64_t x16; - if (v15) { - x16 = x2; - push_i64(x7); - } else { - x16 = v9; - push_i64(x7); - } - x13 = x16; - int64_t v17 = pop_i64(); - x12 = v17; + int64_t v12 = mw_std_prim_Int_min(x2, v7); + x10 = v12; } - *x5 = x13; - *x4 = x12; + *x5 = x10; + *x4 = v6; } static void mw_std_prim_Str_slice (int64_t x1, int64_t x2, VAL x3, int64_t x4, VAL *x5, int64_t *x6) { incref(x3); incref(x3); void* v7 = str_base(VSTR(x3)); uint64_t v8 = str_size(VSTR(x3)); - int64_t v9 = 0LL; - bool v10 = (((int64_t)v8) < v9); - int64_t x11; - if (v10) { - x11 = v9; - push_i64(x1); - push_i64(x2); - push_resource(MKI64(x4)); - push_ptr(v7); - } else { - x11 = ((int64_t)v8); - push_i64(x1); - push_i64(x2); - push_resource(MKI64(x4)); - push_ptr(v7); - } - void* v12 = pop_ptr(); - int64_t v13 = pop_i64(); - int64_t v14 = pop_i64(); - int64_t v15; - int64_t v16; - mw_std_str_clampZ_sliceZ_offsetZ_sizze(v14, v13, x11, &v15, &v16); - void* v17 = (void*)(v15 + (char*)v12); - STR* v18 = str_make(v17, ((uint64_t)v16)); + int64_t v9; + int64_t v10; + mw_std_str_clampZ_sliceZ_offsetZ_sizze(x1, x2, ((int64_t)v8), &v9, &v10); + void* v11 = (void*)(v9 + (char*)v7); + STR* v12 = str_make(v11, ((uint64_t)v10)); decref(x3); - int64_t r19 = VI64(pop_resource()); - *x6 = r19; - *x5 = MKSTR(v18); + *x6 = x4; + *x5 = MKSTR(v12); } static void mw_std_prim_Str_dropZ_slice (int64_t x1, VAL x2, int64_t x3, VAL *x4, int64_t *x5) { VAL v6; @@ -8056,41 +7761,39 @@ static void mw_std_prim_Str_takeZ_slice (int64_t x1, VAL x2, int64_t x3, VAL *x4 *x4 = v6; } static void mw_std_str_ZPlusStr_slice (int64_t x1, int64_t x2, VAL x3, int64_t x4, VAL *x5, VAL *x6, int64_t *x7) { + incref(x3); VAL v8; - VAL v9; - mw_std_str_ZPlusStr_dupZBang(x3, &v8, &v9); - VAL v10; - int64_t v11; - mw_std_prim_Str_slice(x1, x2, v8, x4, &v10, &v11); - *x7 = v11; - *x6 = v9; - *x5 = v10; + int64_t v9; + mw_std_prim_Str_slice(x1, x2, x3, x4, &v8, &v9); + *x7 = v9; + *x6 = x3; + *x5 = v8; } static void mw_std_str_ZPlusStr_offsetZ_slice (int64_t x1, int64_t x2, VAL x3, int64_t x4, VAL *x5, VAL *x6, int64_t *x7) { int64_t v8 = i64_sub(x2, x1); int64_t v9 = 0LL; bool v10 = (v8 < v9); VAL x11; - VAL x12; - int64_t x13; + int64_t x12; + VAL x13; if (v10) { STR* v14; STRLIT(v14, "", 0); - x13 = x4; - x12 = x3; - x11 = MKSTR(v14); + x13 = MKSTR(v14); + x12 = x4; + x11 = x3; } else { VAL v15; VAL v16; int64_t v17; mw_std_str_ZPlusStr_slice(x1, v8, x3, x4, &v15, &v16, &v17); - x13 = v17; - x12 = v16; - x11 = v15; + x13 = v15; + x12 = v17; + x11 = v16; } - *x7 = x13; - *x6 = x12; - *x5 = x11; + *x7 = x12; + *x6 = x11; + *x5 = x13; } static void mw_std_str_ZPlusStr_takeZ_slice (int64_t x1, VAL x2, int64_t x3, VAL *x4, VAL *x5, int64_t *x6) { int64_t v7 = 0LL; @@ -8103,89 +7806,86 @@ static void mw_std_str_ZPlusStr_takeZ_slice (int64_t x1, VAL x2, int64_t x3, VAL *x4 = v8; } static void mw_std_str_ZPlusStr_dropZ_slice (int64_t x1, VAL x2, int64_t x3, VAL *x4, VAL *x5, int64_t *x6) { - int64_t v7; + incref(x2); + uint64_t v7 = str_size(VSTR(x2)); VAL v8; - mw_std_str_ZPlusStr_numZ_bytesZAsk(x2, &v7, &v8); VAL v9; - VAL v10; - int64_t v11; - mw_std_str_ZPlusStr_slice(x1, v7, v8, x3, &v9, &v10, &v11); - *x6 = v11; - *x5 = v10; - *x4 = v9; + int64_t v10; + mw_std_str_ZPlusStr_slice(x1, ((int64_t)v7), x2, x3, &v8, &v9, &v10); + *x6 = v10; + *x5 = v9; + *x4 = v8; } static void mw_std_str_ZPlusStr_splitZ_byte (int64_t x1, VAL x2, VAL *x3, VAL *x4) { VAL v5 = MKI64(0LL /* Nil */); VAL v6 = mw_std_list_List_1_reverse(v5); int64_t v7 = 0LL; - int64_t v8; - VAL v9; - mw_std_str_ZPlusStr_numZ_bytesZAsk(x2, &v8, &v9); - bool v10 = (v7 < v8); - int64_t v11 = x1; + incref(x2); + uint64_t v8 = str_size(VSTR(x2)); + bool v9 = (v7 < ((int64_t)v8)); + int64_t v10 = x1; + int64_t v11 = v7; int64_t v12 = v7; - int64_t v13 = v7; - VAL v14 = (v9); - VAL v15 = (v6); - bool v16 = v10; - while (v16) { + VAL v13 = x2; + VAL v14 = v6; + bool v15 = v9; + while (v15) { + int64_t v16 = v10; int64_t v17 = v11; int64_t v18 = v12; - int64_t v19 = v13; - VAL v20 = (v14); - VAL v21 = (v15); - int64_t v22; - VAL v23; - mw_std_str_ZPlusStr_byteZAt(v19, v20, &v22, &v23); - bool v24 = (v22 == v17); - int64_t x25; + VAL v19 = v13; + VAL v20 = v14; + int64_t v21; + VAL v22; + mw_std_str_ZPlusStr_byteZAt(v18, v19, &v21, &v22); + bool v23 = (v21 == v16); + int64_t x24; + VAL x25; VAL x26; - VAL x27; + int64_t x27; int64_t x28; - int64_t x29; - if (v24) { - int64_t v30 = (0LL /* +Unsafe */); + if (v23) { + int64_t v29 = 0LL /* +Unsafe */; + VAL v30; VAL v31; - VAL v32; - int64_t v33; - mw_std_str_ZPlusStr_offsetZ_slice(v18, v19, v23, v30, &v31, &v32, &v33); - VAL v34 = mtw_std_list_List_1_Cons(v31, v21); - int64_t v35 = 1LL; - int64_t v36 = i64_add(v19, v35); - x29 = v36; - x28 = v36; - x27 = v34; - x26 = v32; - x25 = v17; + int64_t v32; + mw_std_str_ZPlusStr_offsetZ_slice(v17, v18, v22, v29, &v30, &v31, &v32); + VAL v33 = mtw_std_list_List_1_Cons(v30, v20); + int64_t v34 = 1LL; + int64_t v35 = i64_add(v18, v34); + x28 = v35; + x27 = v35; + x26 = v33; + x25 = v31; + x24 = v16; } else { - int64_t v37 = 1LL; - int64_t v38 = i64_add(v19, v37); - x29 = v38; - x28 = v18; - x27 = v21; - x26 = v23; - x25 = v17; + int64_t v36 = 1LL; + int64_t v37 = i64_add(v18, v36); + x28 = v37; + x27 = v17; + x26 = v20; + x25 = v22; + x24 = v16; } - int64_t v39; - VAL v40; - mw_std_str_ZPlusStr_numZ_bytesZAsk(x26, &v39, &v40); - bool v41 = (x29 < v39); - v16 = v41; - v15 = x27; - v14 = v40; - v13 = x29; + incref(x25); + uint64_t v38 = str_size(VSTR(x25)); + bool v39 = (x28 < ((int64_t)v38)); + v15 = v39; + v14 = x26; + v13 = x25; v12 = x28; - v11 = x25; + v11 = x27; + v10 = x24; } - int64_t v42 = (0LL /* +Unsafe */); - VAL v43; - VAL v44; - int64_t v45; - mw_std_str_ZPlusStr_offsetZ_slice(v12, v13, v14, v42, &v43, &v44, &v45); - VAL v46 = mtw_std_list_ListZPlus_1_ListZPlus(v43, v15); - VAL v47 = mw_std_list_ListZPlus_1_reverse(v46); - *x4 = v44; - *x3 = v47; + int64_t v40 = 0LL /* +Unsafe */; + VAL v41; + VAL v42; + int64_t v43; + mw_std_str_ZPlusStr_offsetZ_slice(v11, v12, v13, v40, &v41, &v42, &v43); + VAL v44 = mtw_std_list_ListZPlus_1_ListZPlus(v41, v14); + VAL v45 = mw_std_list_ListZPlus_1_reverse(v44); + *x4 = v42; + *x3 = v45; } static VAL mw_std_prim_Str_splitZ_byte (int64_t x1, VAL x2) { VAL v3; @@ -8201,7 +7901,7 @@ static void mw_std_str_ZPlusStr_pushZ_showZ_byteZBang (VAL x1, int64_t x2, int64 case 34LL: { // BQUOTE STR* v8; STRLIT(v8, "\\\"", 2); - VAL v9 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), x1)); + VAL v9 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), x1); int64_t v10 = 0LL /* False */; x7 = v9; x6 = v10; @@ -8209,7 +7909,7 @@ static void mw_std_str_ZPlusStr_pushZ_showZ_byteZBang (VAL x1, int64_t x2, int64 case 92LL: { // B'\' STR* v11; STRLIT(v11, "\\\\", 2); - VAL v12 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), x1)); + VAL v12 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), x1); int64_t v13 = 0LL /* False */; x7 = v12; x6 = v13; @@ -8217,7 +7917,7 @@ static void mw_std_str_ZPlusStr_pushZ_showZ_byteZBang (VAL x1, int64_t x2, int64 case 10LL: { // BLF STR* v14; STRLIT(v14, "\n", 1); - VAL v15 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), x1)); + VAL v15 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), x1); int64_t v16 = 0LL /* False */; x7 = v15; x6 = v16; @@ -8225,7 +7925,7 @@ static void mw_std_str_ZPlusStr_pushZ_showZ_byteZBang (VAL x1, int64_t x2, int64 case 13LL: { // BCR STR* v17; STRLIT(v17, "\r", 1); - VAL v18 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v17), x1)); + VAL v18 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v17), x1); int64_t v19 = 0LL /* False */; x7 = v18; x6 = v19; @@ -8233,7 +7933,7 @@ static void mw_std_str_ZPlusStr_pushZ_showZ_byteZBang (VAL x1, int64_t x2, int64 case 9LL: { // BHT STR* v20; STRLIT(v20, "\t", 1); - VAL v21 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v20), x1)); + VAL v21 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v20), x1); int64_t v22 = 0LL /* False */; x7 = v21; x6 = v22; @@ -8244,62 +7944,69 @@ static void mw_std_str_ZPlusStr_pushZ_showZ_byteZBang (VAL x1, int64_t x2, int64 bool v25 = (x3 >= v23); bool v26 = (x3 <= v24); bool v27 = (v25 && v26); - VAL x28; + int64_t x28; int64_t x29; int64_t x30; - int64_t x31; if (v27) { - VAL x32; - int64_t x33; - int64_t x34; - int64_t x35; + int64_t x31; + int64_t x32; if (((bool)x2)) { - int64_t v36 = mw_std_byte_Byte_isZ_hexdigit(x3); - x35 = v36; - x34 = x2; - x33 = x3; - x32 = x1; + int64_t v33 = 48LL /* B'0' */; + int64_t v34 = 57LL /* B'9' */; + bool v35 = (x3 >= v33); + bool v36 = (x3 <= v34); + bool v37 = (v35 && v36); + int64_t v38 = 65LL /* B'A' */; + int64_t v39 = 70LL /* B'F' */; + bool v40 = (x3 >= v38); + bool v41 = (x3 <= v39); + bool v42 = (v40 && v41); + int64_t v43 = 97LL /* B'a' */; + int64_t v44 = 102LL /* B'f' */; + bool v45 = (x3 >= v43); + bool v46 = (x3 <= v44); + bool v47 = (v45 && v46); + bool v48 = (v42 || v47); + bool v49 = (v37 || v48); + x32 = ((int64_t)v49); + x31 = x3; } else { - int64_t v37 = 0LL /* False */; - x35 = v37; - x34 = x2; - x33 = x3; - x32 = x1; + int64_t v50 = 0LL /* False */; + x32 = v50; + x31 = x3; } - bool v38 = !((bool)x35); - x31 = ((int64_t)v38); - x30 = x33; - x29 = x34; - x28 = x32; + bool v51 = !((bool)x32); + x30 = ((int64_t)v51); + x29 = x2; + x28 = x31; } else { - int64_t v39 = 0LL /* False */; - x31 = v39; - x30 = x3; + int64_t v52 = 0LL /* False */; + x30 = v52; x29 = x2; - x28 = x1; + x28 = x3; } - VAL x40; - int64_t x41; - if (((bool)x31)) { - VAL v42 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(x30, x28)); - int64_t v43 = 0LL /* False */; - x41 = v43; - x40 = v42; + VAL x53; + int64_t x54; + if (((bool)x30)) { + VAL v55 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(x28, x1); + int64_t v56 = 0LL /* False */; + x54 = v56; + x53 = v55; } else { - STR* v44; - STRLIT(v44, "\\x", 2); - VAL v45 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v44), x28)); - int64_t v46; - int64_t v47; - mw_std_byte_Byte_toZ_hexdigits(x30, &v46, &v47); - VAL v48 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v46, v45)); - VAL v49 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v47, v48)); - int64_t v50 = 1LL /* True */; - x41 = v50; - x40 = v49; + STR* v57; + STRLIT(v57, "\\x", 2); + VAL v58 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v57), x1); + int64_t v59; + int64_t v60; + mw_std_byte_Byte_toZ_hexdigits(x28, &v59, &v60); + VAL v61 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v59, v58); + VAL v62 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v60, v61); + int64_t v63 = 1LL /* True */; + x54 = v63; + x53 = v62; } - x7 = x40; - x6 = x41; + x7 = x53; + x6 = x54; } break; } *x5 = x7; @@ -8308,75 +8015,63 @@ static void mw_std_str_ZPlusStr_pushZ_showZ_byteZBang (VAL x1, int64_t x2, int64 static VAL mw_std_prim_Str_showZThen (VAL x1, VAL x2) { STR* v3; STRLIT(v3, "\"", 1); - VAL v4 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v3), x2)); + VAL v4 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v3), x2); int64_t v5 = 0LL /* False */; incref(x1); incref(x1); void* v6 = str_base(VSTR(x1)); uint64_t v7 = str_size(VSTR(x1)); int64_t v8 = 0LL; - bool v9 = (((int64_t)v7) < v8); - int64_t x10; - if (v9) { - x10 = v8; - push_resource(v4); - lpush(&lbl_escapeZ_hex, MKI64(v5)); - push_ptr(v6); - } else { - x10 = ((int64_t)v7); - push_resource(v4); - lpush(&lbl_escapeZ_hex, MKI64(v5)); - push_ptr(v6); - } - int64_t v11 = 0LL; - bool v12 = (x10 > v11); - int64_t v13 = x10; - bool v14 = v12; + bool v9 = (((int64_t)v7) > v8); + VAL v10 = v4; + int64_t v11 = v5; + void* v12 = v6; + uint64_t v13 = v7; + bool v14 = v9; while (v14) { - int64_t v15 = v13; - void* v16 = pop_ptr(); - int64_t v17 = (0LL /* +Unsafe */); - int64_t v18; - int64_t v19; - mw_std_prim_Ptr_ZAtByte(v16, v17, &v18, &v19); - int64_t v20 = VI64(lpop(&lbl_escapeZ_hex)); - VAL r21 = pop_resource(); - int64_t v22; - VAL v23; - mw_std_str_ZPlusStr_pushZ_showZ_byteZBang(r21, v20, v18, &v22, &v23); - int64_t v24 = 1LL; - int64_t v25 = (0LL /* +Unsafe */); - void* v26 = (void*)(v24 + (char*)v16); - int64_t v27 = 1LL; - int64_t v28 = i64_sub(v15, v27); - int64_t v29 = 0LL; - bool v30 = (v28 < v29); - int64_t x31; - if (v30) { - int64_t v32 = 0LL; - x31 = v32; - lpush(&lbl_escapeZ_hex, MKI64(v22)); - push_resource(v23); - push_ptr(v26); + VAL v15 = v10; + int64_t v16 = v11; + void* v17 = v12; + uint64_t v18 = v13; + int64_t v19 = 0LL /* +Unsafe */; + uint8_t v20 = *(uint8_t*)v17; + int64_t v21; + VAL v22; + mw_std_str_ZPlusStr_pushZ_showZ_byteZBang(v15, v16, ((int64_t)v20), &v21, &v22); + int64_t v23 = 1LL; + int64_t v24 = 0LL /* +Unsafe */; + void* v25 = (void*)(v23 + (char*)v17); + int64_t v26 = 1LL; + int64_t v27 = i64_sub(((int64_t)v18), v26); + int64_t v28 = 0LL; + bool v29 = (v27 < v28); + int64_t x30; + if (v29) { + int64_t v31 = 0LL; + x30 = v31; } else { - x31 = v28; - lpush(&lbl_escapeZ_hex, MKI64(v22)); - push_resource(v23); - push_ptr(v26); + x30 = v27; } - int64_t v33 = 0LL; - bool v34 = (x31 > v33); - v14 = v34; - v13 = x31; + int64_t v32 = 0LL; + bool v33 = (x30 > v32); + v14 = v33; + v13 = ((uint64_t)x30); + v12 = v25; + v11 = v21; + v10 = v22; } - void* v35 = pop_ptr(); decref(x1); - int64_t v36 = VI64(lpop(&lbl_escapeZ_hex)); - STR* v37; - STRLIT(v37, "\"", 1); - VAL r38 = pop_resource(); - VAL v39 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v37), r38)); - return v39; + STR* v34; + STRLIT(v34, "\"", 1); + VAL v35 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v34), v10); + return v35; +} +static VAL mw_std_list_L3 (VAL x1, VAL x2, VAL x3) { + VAL v4 = MKI64(0LL /* Nil */); + VAL v5 = mtw_std_list_List_1_Cons(x3, v4); + VAL v6 = mtw_std_list_List_1_Cons(x2, v5); + VAL v7 = mtw_std_list_List_1_Cons(x1, v6); + return v7; } static int64_t mw_std_list_List_1_ZDivL0 (VAL x1) { int64_t x2; @@ -8477,72 +8172,95 @@ static int64_t mw_std_list_List_1_emptyZAsk (VAL x1) { } static int64_t mw_std_list_List_1_len (VAL x1) { int64_t v2 = 0LL; + int64_t v3 = 1LL /* True */; + int64_t v4 = v2; + VAL v5 = x1; + int64_t v6 = v3; + int64_t v7 = v3; + while (((bool)v7)) { + int64_t v8 = v4; + VAL v9 = v5; + int64_t v10 = v6; + int64_t x11; + VAL x12; + int64_t x13; + switch (get_data_tag(v9)) { + case 1LL: { // Cons + VAL v14; + VAL v15; + mtp_std_list_List_1_Cons(v9, &v14, &v15); + decref(v14); + int64_t v16 = 1LL; + int64_t v17 = i64_add(v8, v16); + int64_t v18 = 1LL /* True */; + x13 = v18; + x12 = v15; + x11 = v17; + } break; + case 0LL: { // Nil + VAL v19 = MKI64(0LL /* Nil */); + int64_t v20 = 0LL /* False */; + x13 = v20; + x12 = v19; + x11 = v8; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v7 = x13; + v6 = x13; + v5 = x12; + v4 = x11; + } + decref(v5); + return v4; +} +static VAL mw_std_list_ListZPlus_1_ZDivL1ZPlus (VAL x1) { + VAL v2; VAL v3; - VAL v4; - mw_std_list_List_1_uncons(x1, &v3, &v4); - int64_t x5; + mtp_std_list_ListZPlus_1_ListZPlus(x1, &v2, &v3); + int64_t v4 = mw_std_list_List_1_ZDivL0(v3); + VAL x5; + if (((bool)v4)) { + VAL v6 = mtw_std_maybe_Maybe_1_Some(v2); + x5 = v6; + } else { + decref(v2); + VAL v7 = MKI64(0LL /* None */); + x5 = v7; + } + return x5; +} +static VAL mw_std_list_ListZPlus_1_ZDivL2ZPlus (VAL x1) { + VAL v2; + VAL v3; + mtp_std_list_ListZPlus_1_ListZPlus(x1, &v2, &v3); + VAL v4 = mw_std_list_List_1_ZDivL1(v3); + VAL x5; VAL x6; - int64_t x7; - switch (get_data_tag(v3)) { + switch (get_data_tag(v4)) { case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v3); - decref(v8); - int64_t v9 = 1LL; - int64_t v10 = i64_add(v2, v9); - int64_t v11 = 1LL /* True */; - x7 = v11; - x6 = v4; - x5 = v10; + VAL v7 = mtp_std_maybe_Maybe_1_Some(v4); + incref(v2); + VAL v8 = MKNIL; + VAL v9 = mkcons(v8, v2); + VAL v10 = mkcons(v9, v7); + VAL v11 = mtw_std_maybe_Maybe_1_Some(v10); + x6 = v11; + x5 = v2; } break; case 0LL: { // None - int64_t v12 = 0LL /* False */; - x7 = v12; - x6 = v4; + VAL v12 = MKI64(0LL /* None */); + x6 = v12; x5 = v2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v13 = x5; - VAL v14 = x6; - int64_t v15 = x7; - while (((bool)v15)) { - int64_t v16 = v13; - VAL v17 = v14; - VAL v18; - VAL v19; - mw_std_list_List_1_uncons(v17, &v18, &v19); - int64_t x20; - VAL x21; - int64_t x22; - switch (get_data_tag(v18)) { - case 1LL: { // Some - VAL v23 = mtp_std_maybe_Maybe_1_Some(v18); - decref(v23); - int64_t v24 = 1LL; - int64_t v25 = i64_add(v16, v24); - int64_t v26 = 1LL /* True */; - x22 = v26; - x21 = v19; - x20 = v25; - } break; - case 0LL: { // None - int64_t v27 = 0LL /* False */; - x22 = v27; - x21 = v19; - x20 = v16; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v15 = x22; - v14 = x21; - v13 = x20; - } - decref(v14); - return v13; + decref(x5); + return x6; } static VAL mw_std_list_List_1_ZToListZPlus (VAL x1) { VAL x2; @@ -8623,68 +8341,8 @@ static VAL mw_std_list_List_1_cat (VAL x1, VAL x2) { } break; default: { VAL v4 = mw_std_list_List_1_reverse(x1); - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(v4, &v5, &v6); - VAL x7; - VAL x8; - int64_t x9; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v10 = mtp_std_maybe_Maybe_1_Some(v5); - VAL v11 = mtw_std_list_List_1_Cons(v10, x2); - int64_t v12 = 1LL /* True */; - x9 = v12; - x8 = v6; - x7 = v11; - } break; - case 0LL: { // None - int64_t v13 = 0LL /* False */; - x9 = v13; - x8 = v6; - x7 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v14 = x7; - VAL v15 = x8; - int64_t v16 = x9; - while (((bool)v16)) { - VAL v17 = v14; - VAL v18 = v15; - VAL v19; - VAL v20; - mw_std_list_List_1_uncons(v18, &v19, &v20); - VAL x21; - VAL x22; - int64_t x23; - switch (get_data_tag(v19)) { - case 1LL: { // Some - VAL v24 = mtp_std_maybe_Maybe_1_Some(v19); - VAL v25 = mtw_std_list_List_1_Cons(v24, v17); - int64_t v26 = 1LL /* True */; - x23 = v26; - x22 = v20; - x21 = v25; - } break; - case 0LL: { // None - int64_t v27 = 0LL /* False */; - x23 = v27; - x22 = v20; - x21 = v17; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v16 = x23; - v15 = x22; - v14 = x21; - } - decref(v15); - x3 = v14; + VAL v5 = mw_std_list_List_1_for_1_sp1(x2, v4); + x3 = v5; } break; } return x3; @@ -8741,133 +8399,52 @@ static VAL mw_std_list_ListZPlus_1_last (VAL x1) { VAL v2; VAL v3; mw_std_list_ListZPlus_1_uncons(x1, &v2, &v3); - VAL v4; - VAL v5; - mw_std_list_List_1_uncons(v3, &v4, &v5); - VAL x6; - VAL x7; - int64_t x8; - switch (get_data_tag(v4)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v4); - decref(v2); - int64_t v10 = 1LL /* True */; - x8 = v10; - x7 = v5; - x6 = v9; - } break; - case 0LL: { // None - int64_t v11 = 0LL /* False */; - x8 = v11; - x7 = v5; - x6 = v2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v12 = x6; - VAL v13 = x7; - int64_t v14 = x8; - while (((bool)v14)) { - VAL v15 = v12; - VAL v16 = v13; - VAL v17; - VAL v18; - mw_std_list_List_1_uncons(v16, &v17, &v18); - VAL x19; - VAL x20; - int64_t x21; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v17); - decref(v15); - int64_t v23 = 1LL /* True */; - x21 = v23; - x20 = v18; - x19 = v22; + int64_t v4 = 1LL /* True */; + VAL v5 = v2; + VAL v6 = v3; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL x12; + VAL x13; + int64_t x14; + switch (get_data_tag(v10)) { + case 1LL: { // Cons + VAL v15; + VAL v16; + mtp_std_list_List_1_Cons(v10, &v15, &v16); + decref(v9); + int64_t v17 = 1LL /* True */; + x14 = v17; + x13 = v16; + x12 = v15; } break; - case 0LL: { // None - int64_t v24 = 0LL /* False */; - x21 = v24; - x20 = v18; - x19 = v15; + case 0LL: { // Nil + VAL v18 = MKI64(0LL /* Nil */); + int64_t v19 = 0LL /* False */; + x14 = v19; + x13 = v18; + x12 = v9; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v14 = x21; - v13 = x20; - v12 = x19; + v8 = x14; + v7 = x14; + v6 = x13; + v5 = x12; } - decref(v13); - return v12; + decref(v6); + return v5; } static VAL mw_std_list_List_1_reverse (VAL x1) { VAL v2 = MKI64(0LL /* Nil */); - VAL v3; - VAL v4; - mw_std_list_List_1_uncons(x1, &v3, &v4); - VAL x5; - VAL x6; - int64_t x7; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v9 = mtw_std_list_List_1_Cons(v8, v2); - int64_t v10 = 1LL /* True */; - x7 = v10; - x6 = v4; - x5 = v9; - } break; - case 0LL: { // None - int64_t v11 = 0LL /* False */; - x7 = v11; - x6 = v4; - x5 = v2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v12 = x5; - VAL v13 = x6; - int64_t v14 = x7; - while (((bool)v14)) { - VAL v15 = v12; - VAL v16 = v13; - VAL v17; - VAL v18; - mw_std_list_List_1_uncons(v16, &v17, &v18); - VAL x19; - VAL x20; - int64_t x21; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v17); - VAL v23 = mtw_std_list_List_1_Cons(v22, v15); - int64_t v24 = 1LL /* True */; - x21 = v24; - x20 = v18; - x19 = v23; - } break; - case 0LL: { // None - int64_t v25 = 0LL /* False */; - x21 = v25; - x20 = v18; - x19 = v15; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v14 = x21; - v13 = x20; - v12 = x19; - } - decref(v13); - return v12; + VAL v3 = mw_std_list_List_1_for_1_sp1(v2, x1); + return v3; } static VAL mw_std_list_ListZPlus_1_reverse (VAL x1) { VAL v2; @@ -8875,76 +8452,51 @@ static VAL mw_std_list_ListZPlus_1_reverse (VAL x1) { mw_std_list_ListZPlus_1_uncons(x1, &v2, &v3); VAL v4 = MKI64(0LL /* Nil */); VAL v5 = mtw_std_list_ListZPlus_1_ListZPlus(v2, v4); - VAL v6; - VAL v7; - mw_std_list_List_1_uncons(v3, &v6, &v7); - VAL x8; - VAL x9; - int64_t x10; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v6); - VAL v12; - VAL v13; - mtp_std_list_ListZPlus_1_ListZPlus(v5, &v12, &v13); - VAL v14 = mtw_std_list_List_1_Cons(v12, v13); - VAL v15 = mtw_std_list_ListZPlus_1_ListZPlus(v11, v14); - int64_t v16 = 1LL /* True */; - x10 = v16; - x9 = v7; - x8 = v15; - } break; - case 0LL: { // None - int64_t v17 = 0LL /* False */; - x10 = v17; - x9 = v7; - x8 = v5; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v18 = x8; - VAL v19 = x9; - int64_t v20 = x10; - while (((bool)v20)) { - VAL v21 = v18; - VAL v22 = v19; - VAL v23; - VAL v24; - mw_std_list_List_1_uncons(v22, &v23, &v24); - VAL x25; - VAL x26; - int64_t x27; - switch (get_data_tag(v23)) { - case 1LL: { // Some - VAL v28 = mtp_std_maybe_Maybe_1_Some(v23); - VAL v29; - VAL v30; - mtp_std_list_ListZPlus_1_ListZPlus(v21, &v29, &v30); - VAL v31 = mtw_std_list_List_1_Cons(v29, v30); - VAL v32 = mtw_std_list_ListZPlus_1_ListZPlus(v28, v31); - int64_t v33 = 1LL /* True */; - x27 = v33; - x26 = v24; - x25 = v32; + int64_t v6 = 1LL /* True */; + VAL v7 = v5; + VAL v8 = v3; + int64_t v9 = v6; + int64_t v10 = v6; + while (((bool)v10)) { + VAL v11 = v7; + VAL v12 = v8; + int64_t v13 = v9; + VAL x14; + VAL x15; + int64_t x16; + switch (get_data_tag(v12)) { + case 1LL: { // Cons + VAL v17; + VAL v18; + mtp_std_list_List_1_Cons(v12, &v17, &v18); + VAL v19; + VAL v20; + mtp_std_list_ListZPlus_1_ListZPlus(v11, &v19, &v20); + VAL v21 = mtw_std_list_List_1_Cons(v19, v20); + VAL v22 = mtw_std_list_ListZPlus_1_ListZPlus(v17, v21); + int64_t v23 = 1LL /* True */; + x16 = v23; + x15 = v18; + x14 = v22; } break; - case 0LL: { // None - int64_t v34 = 0LL /* False */; - x27 = v34; - x26 = v24; - x25 = v21; + case 0LL: { // Nil + VAL v24 = MKI64(0LL /* Nil */); + int64_t v25 = 0LL /* False */; + x16 = v25; + x15 = v24; + x14 = v11; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v20 = x27; - v19 = x26; - v18 = x25; + v10 = x16; + v9 = x16; + v8 = x15; + v7 = x14; } - decref(v19); - return v18; + decref(v8); + return v7; } static VAL mw_std_prim_Int_range (int64_t x1, int64_t x2) { VAL v3 = MKI64(0LL /* Nil */); @@ -8952,12 +8504,12 @@ static VAL mw_std_prim_Int_range (int64_t x1, int64_t x2) { bool v5 = (x1 <= x2); int64_t v6 = x1; int64_t v7 = x2; - VAL v8 = (v4); + VAL v8 = v4; bool v9 = v5; while (v9) { int64_t v10 = v6; int64_t v11 = v7; - VAL v12 = (v8); + VAL v12 = v8; int64_t v13 = 1LL; int64_t v14 = i64_add(v10, v13); VAL v15 = mtw_std_list_List_1_Cons(MKI64(v10), v12); @@ -8970,48 +8522,6 @@ static VAL mw_std_prim_Int_range (int64_t x1, int64_t x2) { VAL v17 = mw_std_list_List_1_reverse(v8); return v17; } -static int64_t mw_std_maybe_Maybe_1_noneZAsk (VAL x1) { - int64_t x2; - switch (get_data_tag(x1)) { - case 0LL: { // None - int64_t v3 = 1LL /* True */; - x2 = v3; - } break; - case 1LL: { // Some - VAL v4 = mtp_std_maybe_Maybe_1_Some(x1); - decref(v4); - int64_t v5 = 0LL /* False */; - x2 = v5; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x2; -} -static int64_t mw_std_maybe_Maybe_1_someZAsk (VAL x1) { - int64_t x2; - switch (get_data_tag(x1)) { - case 0LL: { // None - int64_t v3 = 0LL /* False */; - x2 = v3; - } break; - case 1LL: { // Some - VAL v4 = mtp_std_maybe_Maybe_1_Some(x1); - decref(v4); - int64_t v5 = 1LL /* True */; - x2 = v5; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x2; -} -static int64_t mw_std_maybe_Maybe_1_ZToBool (VAL x1) { - int64_t v2 = mw_std_maybe_Maybe_1_someZAsk(x1); - return v2; -} static VAL mw_std_maybe_Maybe_1_ZToList (VAL x1) { VAL x2; switch (get_data_tag(x1)) { @@ -9098,6 +8608,26 @@ static int64_t mw_std_prim_Int_ZToArch (int64_t x1) { } return x7; } +static int64_t mw_std_prim_Int_max (int64_t x1, int64_t x2) { + bool v3 = (x1 < x2); + int64_t x4; + if (v3) { + x4 = x2; + } else { + x4 = x1; + } + return x4; +} +static int64_t mw_std_prim_Int_min (int64_t x1, int64_t x2) { + bool v3 = (x1 < x2); + int64_t x4; + if (v3) { + x4 = x1; + } else { + x4 = x2; + } + return x4; +} static VAL mw_std_prelude_ZAtZAsk (void* x1) { bool v2 = mut_is_set(x1); VAL x3; @@ -9111,6 +8641,11 @@ static VAL mw_std_prelude_ZAtZAsk (void* x1) { } return x3; } +static void mw_std_prelude_impossibleZBang (void) { + STR* v1; + STRLIT(v1, "Impossible! The impossible has occured!", 39); + do_panic(v1); +} static VAL mw_std_path_PATHz_SEPARATOR (void) { int64_t v1 = RUNNING_OS; int64_t v2 = mw_std_prim_Int_ZToOS(v1); @@ -9132,38 +8667,18 @@ static VAL mw_std_path_Path_joinZ_with (VAL x1, VAL x2, VAL x3) { incref(x1); uint64_t v4 = str_size(VSTR(x1)); int64_t v5 = 0LL; - bool v6 = (((int64_t)v4) < v5); - int64_t x7; + bool v6 = (((int64_t)v4) == v5); + VAL x7; if (v6) { - x7 = v5; - push_value(x1); - push_value(x2); - push_value(x3); - } else { - x7 = ((int64_t)v4); - push_value(x1); - push_value(x2); - push_value(x3); - } - int64_t v8 = 0LL; - bool v9 = (x7 == v8); - VAL x10; - if (v9) { - VAL v11 = pop_value(); - VAL v12 = pop_value(); - decref(v12); - VAL v13 = pop_value(); - decref(v13); - x10 = v11; + decref(x2); + decref(x1); + x7 = x3; } else { - VAL v14 = pop_value(); - VAL v15 = pop_value(); - VAL v16 = pop_value(); - STR* v17 = str_cat(VSTR(v16), VSTR(v15)); - STR* v18 = str_cat(v17, VSTR(v14)); - x10 = MKSTR(v18); + STR* v8 = str_cat(VSTR(x1), VSTR(x2)); + STR* v9 = str_cat(v8, VSTR(x3)); + x7 = MKSTR(v9); } - return x10; + return x7; } static VAL mw_std_path_Path_join (VAL x1, VAL x2) { VAL v3 = mw_std_path_PATHz_SEPARATOR(); @@ -9192,36 +8707,35 @@ static int64_t mw_std_byte_Byte_isZ_pathZ_separatorZAsk (int64_t x1) { return x2; } static void mw_std_path_Path_splitZ_last (VAL x1, VAL *x2, VAL *x3) { - int64_t v4; - VAL v5; - mw_std_str_ZPlusStr_numZ_bytesZAsk(x1, &v4, &v5); - VAL v6 = MKI64(0LL /* None */); - incref(v6); - int64_t v7 = mw_std_maybe_Maybe_1_noneZAsk(v6); - VAL x8; + incref(x1); + uint64_t v4 = str_size(VSTR(x1)); + VAL v5 = MKI64(0LL /* None */); + incref(v5); + int64_t v6 = get_data_tag(v5); + decref(v5); + int64_t v7 = 0LL; + bool v8 = (v6 == v7); int64_t x9; VAL x10; int64_t x11; - if (((bool)v7)) { + if (v8) { int64_t v12 = 0LL; - bool v13 = (v4 > v12); + bool v13 = (((int64_t)v4) > v12); x11 = ((int64_t)v13); - x10 = v6; - x9 = v4; - x8 = v5; + x10 = v5; + x9 = ((int64_t)v4); } else { int64_t v14 = 0LL /* False */; x11 = v14; - x10 = v6; - x9 = v4; - x8 = v5; + x10 = v5; + x9 = ((int64_t)v4); } - VAL v15 = (x8); + VAL v15 = x1; int64_t v16 = x9; VAL v17 = x10; int64_t v18 = x11; while (((bool)v18)) { - VAL v19 = (v15); + VAL v19 = v15; int64_t v20 = v16; VAL v21 = v17; decref(v21); @@ -9233,89 +8747,60 @@ static void mw_std_path_Path_splitZ_last (VAL x1, VAL *x2, VAL *x3) { if (v25) { int64_t v27 = 0LL; x26 = v27; - push_resource(v19); } else { x26 = v23; - push_resource(v19); } - VAL r28 = pop_resource(); - int64_t v29; - VAL v30; - mw_std_str_ZPlusStr_byteZAt(x26, r28, &v29, &v30); - int64_t v31 = mw_std_byte_Byte_isZ_pathZ_separatorZAsk(v29); - VAL x32; - int64_t x33; - VAL x34; - if (((bool)v31)) { - VAL v35 = mtw_std_maybe_Maybe_1_Some(MKI64(x26)); - x34 = v35; - x33 = x26; - x32 = v30; + int64_t v28; + VAL v29; + mw_std_str_ZPlusStr_byteZAt(x26, v19, &v28, &v29); + int64_t v30 = mw_std_byte_Byte_isZ_pathZ_separatorZAsk(v28); + VAL x31; + int64_t x32; + VAL x33; + if (((bool)v30)) { + VAL v34 = mtw_std_maybe_Maybe_1_Some(MKI64(x26)); + x33 = v34; + x32 = x26; + x31 = v29; } else { - VAL v36 = MKI64(0LL /* None */); - x34 = v36; - x33 = x26; - x32 = v30; - } - incref(x34); - int64_t v37 = mw_std_maybe_Maybe_1_noneZAsk(x34); - VAL x38; + VAL v35 = MKI64(0LL /* None */); + x33 = v35; + x32 = x26; + x31 = v29; + } + incref(x33); + int64_t v36 = get_data_tag(x33); + decref(x33); + int64_t v37 = 0LL; + bool v38 = (v36 == v37); int64_t x39; VAL x40; int64_t x41; - if (((bool)v37)) { + if (v38) { int64_t v42 = 0LL; - bool v43 = (x33 > v42); + bool v43 = (x32 > v42); x41 = ((int64_t)v43); - x40 = x34; - x39 = x33; - x38 = x32; + x40 = x33; + x39 = x32; } else { int64_t v44 = 0LL /* False */; x41 = v44; - x40 = x34; - x39 = x33; - x38 = x32; + x40 = x33; + x39 = x32; } v18 = x41; v17 = x40; v16 = x39; - v15 = x38; - } - VAL x45; - VAL x46; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v47 = mtp_std_maybe_Maybe_1_Some(v17); - int64_t v48 = (0LL /* +Unsafe */); - incref(v47); - incref(v15); - int64_t v49 = 1LL; - int64_t v50 = i64_add(VI64(v47), v49); - VAL v51; - int64_t v52; - mw_std_prim_Str_dropZ_slice(v50, v15, v48, &v51, &v52); - VAL v53; - int64_t v54; - mw_std_prim_Str_takeZ_slice(VI64(v47), v15, v52, &v53, &v54); - VAL v55 = mtw_std_maybe_Maybe_1_Some(v51); - x46 = v55; - x45 = v53; - } break; - case 0LL: { // None - VAL v56 = MKI64(0LL /* None */); - x46 = v56; - x45 = v15; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v15 = x31; } - *x3 = x46; - *x2 = x45; + VAL v45; + VAL v46; + mw_std_maybe_Maybe_1_map_1_sp14(v15, v17, &v45, &v46); + *x3 = v46; + *x2 = v45; } static VAL mw_std_path_Path_pathZThen (VAL x1, VAL x2) { - VAL v3 = (mw_std_str_ZPlusStr_pushZ_strZBang(x1, x2)); + VAL v3 = mw_std_str_ZPlusStr_pushZ_strZBang(x1, x2); return v3; } static VAL mw_std_input_ZPlusInputOpenState_endZBang (VAL x1) { @@ -9330,34 +8815,28 @@ static VAL mw_std_input_ZPlusInputOpenState_endZBang (VAL x1) { static int64_t mw_std_input_INPUTz_BUFFERz_SIZZE (void) { int64_t v1 = 8192LL; int64_t v2 = 0LL; - bool v3 = (v1 < v2); - int64_t x4; - if (v3) { - x4 = v2; - } else { - x4 = v1; - } - return x4; + int64_t v3 = mw_std_prim_Int_max(v1, v2); + return v3; } static VAL mw_std_input_ZPlusInput_startZBang (VAL x1) { int64_t v2 = mw_std_input_INPUTz_BUFFERz_SIZZE(); - VAL v3 = (mw_std_buffer_ZPlusBuffer_new(v2)); + VAL v3 = mw_std_buffer_ZPlusBuffer_new(v2); int64_t v4 = 0LL; int64_t v5 = 0LL; - VAL v6 = (mtw_std_input_ZPlusInputOpenState_ZPlusInputOpenState(v4, v5, x1, v3)); - VAL v7 = (mw_std_input_ZPlusInputOpenState_refillZ_bufferZBang(v6)); + VAL v6 = mtw_std_input_ZPlusInputOpenState_ZPlusInputOpenState(v4, v5, x1, v3); + VAL v7 = mw_std_input_ZPlusInputOpenState_refillZ_bufferZBang(v6); return v7; } static VAL mw_std_input_ZPlusInput_endZBang (VAL x1) { VAL x2; switch (get_data_tag(x1)) { case 0LL: { // +InputOpen - VAL v3 = (mtp_std_input_ZPlusInput_ZPlusInputOpen(x1)); - VAL v4 = (mw_std_input_ZPlusInputOpenState_endZBang(v3)); + VAL v3 = mtp_std_input_ZPlusInput_ZPlusInputOpen(x1); + VAL v4 = mw_std_input_ZPlusInputOpenState_endZBang(v3); x2 = v4; } break; case 1LL: { // +InputDone - VAL v5 = (mtp_std_input_ZPlusInput_ZPlusInputDone(x1)); + VAL v5 = mtp_std_input_ZPlusInput_ZPlusInputDone(x1); x2 = v5; } break; default: { @@ -9371,16 +8850,16 @@ static void mw_std_input_ZPlusInput_doneZAsk (VAL x1, int64_t *x2, VAL *x3) { VAL x5; switch (get_data_tag(x1)) { case 0LL: { // +InputOpen - VAL v6 = (mtp_std_input_ZPlusInput_ZPlusInputOpen(x1)); + VAL v6 = mtp_std_input_ZPlusInput_ZPlusInputOpen(x1); int64_t v7 = 0LL /* False */; - VAL v8 = (mtw_std_input_ZPlusInput_ZPlusInputOpen(v6)); + VAL v8 = mtw_std_input_ZPlusInput_ZPlusInputOpen(v6); x5 = v8; x4 = v7; } break; case 1LL: { // +InputDone - VAL v9 = (mtp_std_input_ZPlusInput_ZPlusInputDone(x1)); + VAL v9 = mtp_std_input_ZPlusInput_ZPlusInputDone(x1); int64_t v10 = 1LL /* True */; - VAL v11 = (mtw_std_input_ZPlusInput_ZPlusInputDone(v9)); + VAL v11 = mtw_std_input_ZPlusInput_ZPlusInputDone(v9); x5 = v11; x4 = v10; } break; @@ -9392,12 +8871,12 @@ static void mw_std_input_ZPlusInput_doneZAsk (VAL x1, int64_t *x2, VAL *x3) { *x2 = x4; } static VAL mw_std_input_ZPlusInputOpenState_refillZ_bufferZBang (VAL x1) { - VAL v2 = (VVAL(VTUP(x1)->cells[4])); + VAL v2 = VVAL(VTUP(x1)->cells[4]); void* v3 = VPTR(VTUP(v2)->cells[2]); int64_t v4 = VI64(VTUP(v2)->cells[1]); VTUP(x1)->cells[4] = v2; - VAL v5 = (VVAL(VTUP(x1)->cells[3])); - int64_t v6 = (0LL /* +Unsafe */); + VAL v5 = VVAL(VTUP(x1)->cells[3]); + int64_t v6 = 0LL /* +Unsafe */; int64_t v7; int64_t v8; VAL v9; @@ -9412,11 +8891,11 @@ static VAL mw_std_input_ZPlusInputOpenState_refillZ_bufferZBang (VAL x1) { VTUP(x1)->cells[1] = MKI64(v7); int64_t v15 = 0LL; VTUP(x1)->cells[2] = MKI64(v15); - VAL v16 = (mtw_std_input_ZPlusInput_ZPlusInputOpen(x1)); + VAL v16 = mtw_std_input_ZPlusInput_ZPlusInputOpen(x1); x14 = v16; } else { - VAL v17 = (mw_std_input_ZPlusInputOpenState_endZBang(x1)); - VAL v18 = (mtw_std_input_ZPlusInput_ZPlusInputDone(v17)); + VAL v17 = mw_std_input_ZPlusInputOpenState_endZBang(x1); + VAL v18 = mtw_std_input_ZPlusInput_ZPlusInputDone(v17); x14 = v18; } return x14; @@ -9426,21 +8905,21 @@ static void mw_std_input_ZPlusInput_peek (VAL x1, int64_t *x2, VAL *x3) { VAL x5; switch (get_data_tag(x1)) { case 0LL: { // +InputOpen - VAL v6 = (mtp_std_input_ZPlusInput_ZPlusInputOpen(x1)); + VAL v6 = mtp_std_input_ZPlusInput_ZPlusInputOpen(x1); int64_t v7 = VI64(VTUP(v6)->cells[2]); - VAL v8 = (VVAL(VTUP(v6)->cells[4])); + VAL v8 = VVAL(VTUP(v6)->cells[4]); int64_t v9; VAL v10; mw_std_buffer_ZPlusBuffer_ZAtU8(v7, v8, &v9, &v10); VTUP(v6)->cells[4] = v10; - VAL v11 = (mtw_std_input_ZPlusInput_ZPlusInputOpen(v6)); + VAL v11 = mtw_std_input_ZPlusInput_ZPlusInputOpen(v6); x5 = v11; x4 = v9; } break; case 1LL: { // +InputDone - VAL v12 = (mtp_std_input_ZPlusInput_ZPlusInputDone(x1)); + VAL v12 = mtp_std_input_ZPlusInput_ZPlusInputDone(x1); int64_t v13 = 0LL /* BNUL */; - VAL v14 = (mtw_std_input_ZPlusInput_ZPlusInputDone(v12)); + VAL v14 = mtw_std_input_ZPlusInput_ZPlusInputDone(v12); x5 = v14; x4 = v13; } break; @@ -9455,7 +8934,7 @@ static VAL mw_std_input_ZPlusInput_moveZBang (VAL x1) { VAL x2; switch (get_data_tag(x1)) { case 0LL: { // +InputOpen - VAL v3 = (mtp_std_input_ZPlusInput_ZPlusInputOpen(x1)); + VAL v3 = mtp_std_input_ZPlusInput_ZPlusInputOpen(x1); int64_t v4 = VI64(VTUP(v3)->cells[1]); int64_t v5 = 1LL; int64_t v6 = i64_sub(v4, v5); @@ -9473,12 +8952,12 @@ static VAL mw_std_input_ZPlusInput_moveZBang (VAL x1) { int64_t v12 = 1LL; int64_t v13 = i64_add(v11, v12); VTUP(v3)->cells[2] = MKI64(v13); - VAL v14 = (mw_std_input_ZPlusInputOpenState_prepareZ_forZ_moreZBang(v3)); + VAL v14 = mw_std_input_ZPlusInputOpenState_prepareZ_forZ_moreZBang(v3); x2 = v14; } break; case 1LL: { // +InputDone - VAL v15 = (mtp_std_input_ZPlusInput_ZPlusInputDone(x1)); - VAL v16 = (mtw_std_input_ZPlusInput_ZPlusInputDone(v15)); + VAL v15 = mtp_std_input_ZPlusInput_ZPlusInputDone(x1); + VAL v16 = mtw_std_input_ZPlusInput_ZPlusInputDone(v15); x2 = v16; } break; default: { @@ -9493,10 +8972,10 @@ static VAL mw_std_input_ZPlusInputOpenState_prepareZ_forZ_moreZBang (VAL x1) { bool v4 = (v2 == v3); VAL x5; if (v4) { - VAL v6 = (mw_std_input_ZPlusInputOpenState_refillZ_bufferZBang(x1)); + VAL v6 = mw_std_input_ZPlusInputOpenState_refillZ_bufferZBang(x1); x5 = v6; } else { - VAL v7 = (mtw_std_input_ZPlusInput_ZPlusInputOpen(x1)); + VAL v7 = mtw_std_input_ZPlusInput_ZPlusInputOpen(x1); x5 = v7; } return x5; @@ -9506,23 +8985,23 @@ static void mw_std_input_ZPlusInput_readZ_chunkZBang (VAL x1, VAL *x2, VAL *x3) VAL x5; switch (get_data_tag(x1)) { case 0LL: { // +InputOpen - VAL v6 = (mtp_std_input_ZPlusInput_ZPlusInputOpen(x1)); + VAL v6 = mtp_std_input_ZPlusInput_ZPlusInputOpen(x1); int64_t v7 = VI64(VTUP(v6)->cells[2]); int64_t v8 = VI64(VTUP(v6)->cells[1]); - VAL v9 = (VVAL(VTUP(v6)->cells[4])); + VAL v9 = VVAL(VTUP(v6)->cells[4]); VAL v10; VAL v11; mw_std_buffer_ZPlusBuffer_ZAtStr(v7, v8, v9, &v10, &v11); VTUP(v6)->cells[4] = v11; VAL v12 = mtw_std_maybe_Maybe_1_Some(v10); - VAL v13 = (mw_std_input_ZPlusInputOpenState_refillZ_bufferZBang(v6)); + VAL v13 = mw_std_input_ZPlusInputOpenState_refillZ_bufferZBang(v6); x5 = v13; x4 = v12; } break; case 1LL: { // +InputDone - VAL v14 = (mtp_std_input_ZPlusInput_ZPlusInputDone(x1)); + VAL v14 = mtp_std_input_ZPlusInput_ZPlusInputDone(x1); VAL v15 = MKI64(0LL /* None */); - VAL v16 = (mtw_std_input_ZPlusInput_ZPlusInputDone(v14)); + VAL v16 = mtw_std_input_ZPlusInput_ZPlusInputDone(v14); x5 = v16; x4 = v15; } break; @@ -9536,90 +9015,60 @@ static void mw_std_input_ZPlusInput_readZ_chunkZBang (VAL x1, VAL *x2, VAL *x3) static void mw_std_input_ZPlusInput_readZ_fileZBang (VAL x1, VAL *x2, VAL *x3) { STR* v4; STRLIT(v4, "", 0); - VAL v5; - VAL v6; - mw_std_input_ZPlusInput_readZ_chunkZBang(x1, &v5, &v6); - VAL x7; - VAL x8; - int64_t x9; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v10 = mtp_std_maybe_Maybe_1_Some(v5); - STR* v11 = str_cat(v4, VSTR(v10)); - int64_t v12 = 1LL /* True */; - x9 = v12; - x8 = MKSTR(v11); - x7 = v6; - } break; - case 0LL: { // None - int64_t v13 = 0LL /* False */; - x9 = v13; - x8 = MKSTR(v4); - x7 = v6; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v14 = (x7); - VAL v15 = x8; - int64_t v16 = x9; - while (((bool)v16)) { - VAL v17 = (v14); - VAL v18 = v15; - VAL v19; - VAL v20; - mw_std_input_ZPlusInput_readZ_chunkZBang(v17, &v19, &v20); - VAL x21; - VAL x22; - int64_t x23; - switch (get_data_tag(v19)) { + int64_t v5 = 1LL /* True */; + STR* v6 = v4; + VAL v7 = x1; + int64_t v8 = v5; + int64_t v9 = v5; + while (((bool)v9)) { + STR* v10 = v6; + VAL v11 = v7; + int64_t v12 = v8; + VAL v13; + VAL v14; + mw_std_input_ZPlusInput_readZ_chunkZBang(v11, &v13, &v14); + VAL x15; + int64_t x16; + switch (get_data_tag(v13)) { case 1LL: { // Some - VAL v24 = mtp_std_maybe_Maybe_1_Some(v19); - STR* v25 = str_cat(VSTR(v18), VSTR(v24)); - int64_t v26 = 1LL /* True */; - x23 = v26; - x22 = MKSTR(v25); - x21 = v20; + VAL v17 = mtp_std_maybe_Maybe_1_Some(v13); + STR* v18 = str_cat(v10, VSTR(v17)); + int64_t v19 = 1LL /* True */; + x16 = v19; + x15 = MKSTR(v18); } break; case 0LL: { // None - int64_t v27 = 0LL /* False */; - x23 = v27; - x22 = v18; - x21 = v20; + int64_t v20 = 0LL /* False */; + x16 = v20; + x15 = MKSTR(v10); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v16 = x23; - v15 = x22; - v14 = x21; + v9 = x16; + v8 = x16; + v7 = v14; + v6 = VSTR(x15); } - *x3 = v14; - *x2 = v15; + *x3 = v7; + *x2 = MKSTR(v6); } static int64_t mw_std_output_OUTPUTz_BUFFERz_SIZZE (void) { int64_t v1 = 4096LL; int64_t v2 = 0LL; - bool v3 = (v1 < v2); - int64_t x4; - if (v3) { - x4 = v2; - } else { - x4 = v1; - } - return x4; + int64_t v3 = mw_std_prim_Int_max(v1, v2); + return v3; } static VAL mw_std_output_ZPlusOutput_startZBang (VAL x1) { int64_t v2 = 0LL; int64_t v3 = mw_std_output_OUTPUTz_BUFFERz_SIZZE(); - VAL v4 = (mw_std_buffer_ZPlusBuffer_new(v3)); - VAL v5 = (mtw_std_output_ZPlusOutput_ZPlusOutput(v2, x1, v4)); + VAL v4 = mw_std_buffer_ZPlusBuffer_new(v3); + VAL v5 = mtw_std_output_ZPlusOutput_ZPlusOutput(v2, x1, v4); return v5; } static VAL mw_std_output_ZPlusOutput_endZBang (VAL x1) { - VAL v2 = (mw_std_output_ZPlusOutput_flushZBang(x1)); + VAL v2 = mw_std_output_ZPlusOutput_flushZBang(x1); int64_t v3; VAL v4; VAL v5; @@ -9628,12 +9077,12 @@ static VAL mw_std_output_ZPlusOutput_endZBang (VAL x1) { return v4; } static VAL mw_std_output_ZPlusOutput_flushZBang (VAL x1) { - VAL v2 = (VVAL(VTUP(x1)->cells[3])); + VAL v2 = VVAL(VTUP(x1)->cells[3]); void* v3 = VPTR(VTUP(v2)->cells[2]); VTUP(x1)->cells[3] = v2; int64_t v4 = VI64(VTUP(x1)->cells[1]); - VAL v5 = (VVAL(VTUP(x1)->cells[2])); - int64_t v6 = (0LL /* +Unsafe */); + VAL v5 = VVAL(VTUP(x1)->cells[2]); + int64_t v6 = 0LL /* +Unsafe */; int64_t v7; int64_t v8; VAL v9; @@ -9650,7 +9099,7 @@ static void mw_std_output_ZPlusOutput_offset (VAL x1, VAL *x2, int64_t *x3) { *x2 = x1; } static void mw_std_output_ZPlusOutput_capacityZ_total (VAL x1, int64_t *x2, VAL *x3) { - VAL v4 = (VVAL(VTUP(x1)->cells[3])); + VAL v4 = VVAL(VTUP(x1)->cells[3]); int64_t v5 = VI64(VTUP(v4)->cells[1]); VTUP(x1)->cells[3] = v4; *x3 = x1; @@ -9664,18 +9113,15 @@ static void mw_std_output_ZPlusOutput_capacityZ_remaining (VAL x1, int64_t *x2, int64_t v7 = i64_sub(v4, v6); int64_t v8 = 0LL; bool v9 = (v7 < v8); - VAL x10; - int64_t x11; + int64_t x10; if (v9) { - int64_t v12 = 0LL; - x11 = v12; - x10 = v5; + int64_t v11 = 0LL; + x10 = v11; } else { - x11 = v7; - x10 = v5; + x10 = v7; } - *x3 = x10; - *x2 = x11; + *x3 = v5; + *x2 = x10; } static void mw_std_output_ZPlusOutput_fullZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v4; @@ -9689,140 +9135,82 @@ static void mw_std_output_ZPlusOutput_fullZAsk (VAL x1, int64_t *x2, VAL *x3) { static VAL mw_std_output_ZPlusOutput_put (VAL x1, VAL x2) { incref(x1); uint64_t v3 = str_size(VSTR(x1)); - int64_t v4 = 0LL; - bool v5 = (((int64_t)v3) < v4); - int64_t x6; - if (v5) { - x6 = v4; - push_resource(x2); - push_value(x1); - } else { - x6 = ((int64_t)v3); - push_resource(x2); - push_value(x1); - } - VAL r7 = pop_resource(); - int64_t v8; - VAL v9; - mw_std_output_ZPlusOutput_capacityZ_remaining(r7, &v8, &v9); - bool v10 = (x6 > v8); - VAL x11; - if (v10) { - VAL v12 = (mw_std_output_ZPlusOutput_flushZBang(v9)); - VAL v13 = pop_value(); - incref(v13); - uint64_t v14 = str_size(VSTR(v13)); - int64_t v15 = 0LL; - bool v16 = (((int64_t)v14) < v15); - int64_t x17; - if (v16) { - x17 = v15; - push_resource(v12); - push_value(v13); - } else { - x17 = ((int64_t)v14); - push_resource(v12); - push_value(v13); - } - VAL r18 = pop_resource(); - int64_t v19; - VAL v20; - mw_std_output_ZPlusOutput_capacityZ_total(r18, &v19, &v20); - bool v21 = (x17 >= v19); - VAL x22; - if (v21) { - VAL v23 = pop_value(); - incref(v23); - incref(v23); - void* v24 = str_base(VSTR(v23)); - uint64_t v25 = str_size(VSTR(v23)); - int64_t v26 = 0LL; - bool v27 = (((int64_t)v25) < v26); - int64_t x28; - if (v27) { - x28 = v26; - push_resource(v20); - push_ptr(v24); - } else { - x28 = ((int64_t)v25); - push_resource(v20); - push_ptr(v24); - } - VAL r29 = pop_resource(); - VAL v30 = (VVAL(VTUP(r29)->cells[2])); - int64_t v31 = (0LL /* +Unsafe */); - void* v32 = pop_ptr(); - int64_t v33; - int64_t v34; - VAL v35; - int64_t v36; - mw_std_prelude_ZPlusUnsafe_writeZ_bytesZBang(v32, x28, v30, v31, &v33, &v34, &v35, &v36); - VTUP(r29)->cells[2] = v35; - decref(v23); - x22 = r29; + int64_t v4; + VAL v5; + mw_std_output_ZPlusOutput_capacityZ_remaining(x2, &v4, &v5); + bool v6 = (((int64_t)v3) > v4); + VAL x7; + if (v6) { + VAL v8 = mw_std_output_ZPlusOutput_flushZBang(v5); + incref(x1); + uint64_t v9 = str_size(VSTR(x1)); + int64_t v10; + VAL v11; + mw_std_output_ZPlusOutput_capacityZ_total(v8, &v10, &v11); + bool v12 = (((int64_t)v9) >= v10); + VAL x13; + if (v12) { + incref(x1); + incref(x1); + void* v14 = str_base(VSTR(x1)); + uint64_t v15 = str_size(VSTR(x1)); + VAL v16 = VVAL(VTUP(v11)->cells[2]); + int64_t v17 = 0LL /* +Unsafe */; + int64_t v18; + int64_t v19; + VAL v20; + int64_t v21; + mw_std_prelude_ZPlusUnsafe_writeZ_bytesZBang(v14, ((int64_t)v15), v16, v17, &v18, &v19, &v20, &v21); + VTUP(v11)->cells[2] = v20; + decref(x1); + x13 = v11; } else { - VAL v37 = pop_value(); - VAL v38 = (mw_std_output_ZPlusOutput_put(v37, v20)); - x22 = v38; + VAL v22 = mw_std_output_ZPlusOutput_put(x1, v11); + x13 = v22; } - x11 = x22; + x7 = x13; } else { - VAL v39 = pop_value(); - incref(v39); - VAL v40; - int64_t v41; - mw_std_output_ZPlusOutput_offset(v9, &v40, &v41); - VAL v42 = (VVAL(VTUP(v40)->cells[3])); - VAL v43 = (mw_std_buffer_ZPlusBuffer_ZBangStr(v39, v41, v42)); - VTUP(v40)->cells[3] = v43; - uint64_t v44 = str_size(VSTR(v39)); - int64_t v45 = 0LL; - bool v46 = (((int64_t)v44) < v45); - int64_t x47; - if (v46) { - x47 = v45; - push_resource(v40); - } else { - x47 = ((int64_t)v44); - push_resource(v40); - } - VAL r48 = pop_resource(); - int64_t v49 = VI64(VTUP(r48)->cells[1]); - int64_t v50 = i64_add(x47, v49); - VTUP(r48)->cells[1] = MKI64(v50); - x11 = r48; + incref(x1); + VAL v23; + int64_t v24; + mw_std_output_ZPlusOutput_offset(v5, &v23, &v24); + VAL v25 = VVAL(VTUP(v23)->cells[3]); + VAL v26 = mw_std_buffer_ZPlusBuffer_ZBangStr(x1, v24, v25); + VTUP(v23)->cells[3] = v26; + uint64_t v27 = str_size(VSTR(x1)); + int64_t v28 = VI64(VTUP(v23)->cells[1]); + int64_t v29 = i64_add(((int64_t)v27), v28); + VTUP(v23)->cells[1] = MKI64(v29); + x7 = v23; } - return x11; + return x7; } static VAL mw_std_output_ZPlusOutput_putZ_byte (int64_t x1, VAL x2) { int64_t v3; VAL v4; mw_std_output_ZPlusOutput_fullZAsk(x2, &v3, &v4); - int64_t x5; - VAL x6; + VAL x5; if (((bool)v3)) { - VAL v7 = (mw_std_output_ZPlusOutput_flushZBang(v4)); - x6 = v7; - x5 = x1; + VAL v6 = mw_std_output_ZPlusOutput_flushZBang(v4); + x5 = v6; } else { - x6 = v4; - x5 = x1; + x5 = v4; } - VAL v8; - int64_t v9; - mw_std_output_ZPlusOutput_offset(x6, &v8, &v9); - VAL v10 = (VVAL(VTUP(v8)->cells[3])); - VAL v11 = (mw_std_buffer_ZPlusBuffer_ZBangByte(x5, v9, v10)); - VTUP(v8)->cells[3] = v11; - int64_t v12 = VI64(VTUP(v8)->cells[1]); - int64_t v13 = 1LL; - int64_t v14 = i64_add(v12, v13); - VTUP(v8)->cells[1] = MKI64(v14); - return v8; + VAL v7; + int64_t v8; + mw_std_output_ZPlusOutput_offset(x5, &v7, &v8); + VAL v9 = VVAL(VTUP(v7)->cells[3]); + VAL v10 = mw_std_buffer_ZPlusBuffer_ZBangByte(x1, v8, v9); + VTUP(v7)->cells[3] = v10; + int64_t v11 = VI64(VTUP(v7)->cells[1]); + int64_t v12 = 1LL; + int64_t v13 = i64_add(v11, v12); + VTUP(v7)->cells[1] = MKI64(v13); + return v7; } static VAL mw_std_output_ZPlusOutput_line (VAL x1) { int64_t v2 = 10LL /* BLF */; - VAL v3 = (mw_std_output_ZPlusOutput_putZ_byte(v2, x1)); + VAL v3 = mw_std_output_ZPlusOutput_putZ_byte(v2, x1); return v3; } static int64_t mw_std_posix_posixZ_openZBang (VAL x1, int64_t x2, int64_t x3) { @@ -9844,8 +9232,8 @@ static void mw_std_prim_ZPlusWorld_openZ_fileZBang (VAL x1, int64_t x2, int64_t if (v9) { decref(x1); int64_t v12 = 1LL /* True */; - VAL v13 = (mtw_std_file_ZPlusFile_ZPlusFile(v7, v12)); - VAL v14 = (mtw_std_file_ZPlusFileZAsk_ZPlusFileOk(v13)); + VAL v13 = mtw_std_file_ZPlusFile_ZPlusFile(v7, v12); + VAL v14 = mtw_std_file_ZPlusFileZAsk_ZPlusFileOk(v13); x11 = v14; x10 = x2; } else { @@ -9853,9 +9241,9 @@ static void mw_std_prim_ZPlusWorld_openZ_fileZBang (VAL x1, int64_t x2, int64_t STRLIT(v15, "", 0); STR* v16; STRLIT(v16, "Failed to open file: ", 21); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), MKSTR(v15))); - VAL v18 = (mw_std_prim_Str_showZThen(x1, v17)); - VAL v19 = (mtw_std_file_ZPlusFileZAsk_ZPlusFileErr(v18)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), MKSTR(v15)); + VAL v18 = mw_std_prim_Str_showZThen(x1, v17); + VAL v19 = mtw_std_file_ZPlusFileZAsk_ZPlusFileErr(v18); x11 = v19; x10 = x2; } @@ -9865,58 +9253,52 @@ static void mw_std_prim_ZPlusWorld_openZ_fileZBang (VAL x1, int64_t x2, int64_t static void mw_std_prim_ZPlusWorld_createZ_fileZBang (VAL x1, int64_t x2, int64_t *x3, VAL *x4) { incref(x1); VAL v5 = mw_std_file_Oz_WRONLYZPipeOz_CREATZPipeOz_TRUNC(); - int64_t x6; - VAL x7; + VAL x6; switch (get_data_tag(v5)) { case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v5); - int64_t v9 = 438LL; - int64_t v10 = mw_std_posix_posixZ_openZBang(x1, VI64(v8), v9); - int64_t v11 = 0LL; - bool v12 = (v10 > v11); - int64_t x13; - VAL x14; - if (v12) { + VAL v7 = mtp_std_maybe_Maybe_1_Some(v5); + int64_t v8 = 438LL; + int64_t v9 = mw_std_posix_posixZ_openZBang(x1, VI64(v7), v8); + int64_t v10 = 0LL; + bool v11 = (v9 > v10); + VAL x12; + if (v11) { decref(x1); - int64_t v15 = 1LL /* True */; - VAL v16 = (mtw_std_file_ZPlusFile_ZPlusFile(v10, v15)); - VAL v17 = (mtw_std_file_ZPlusFileZAsk_ZPlusFileOk(v16)); - x14 = v17; - x13 = x2; + int64_t v13 = 1LL /* True */; + VAL v14 = mtw_std_file_ZPlusFile_ZPlusFile(v9, v13); + VAL v15 = mtw_std_file_ZPlusFileZAsk_ZPlusFileOk(v14); + x12 = v15; } else { - STR* v18; - STRLIT(v18, "", 0); - STR* v19; - STRLIT(v19, "Failed to create file: ", 23); - VAL v20 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v19), MKSTR(v18))); - VAL v21 = (mw_std_prim_Str_showZThen(x1, v20)); - VAL v22 = (mtw_std_file_ZPlusFileZAsk_ZPlusFileErr(v21)); - x14 = v22; - x13 = x2; + STR* v16; + STRLIT(v16, "", 0); + STR* v17; + STRLIT(v17, "Failed to create file: ", 23); + VAL v18 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v17), MKSTR(v16)); + VAL v19 = mw_std_prim_Str_showZThen(x1, v18); + VAL v20 = mtw_std_file_ZPlusFileZAsk_ZPlusFileErr(v19); + x12 = v20; } - x7 = x14; - x6 = x13; + x6 = x12; } break; case 0LL: { // None decref(x1); decref(x1); - STR* v23; - STRLIT(v23, "Don't know how to create file on unknown OS.", 44); - VAL v24 = (mtw_std_file_ZPlusFileZAsk_ZPlusFileErr(MKSTR(v23))); - x7 = v24; - x6 = x2; + STR* v21; + STRLIT(v21, "Don't know how to create file on unknown OS.", 44); + VAL v22 = mtw_std_file_ZPlusFileZAsk_ZPlusFileErr(MKSTR(v21)); + x6 = v22; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x4 = x7; - *x3 = x6; + *x4 = x6; + *x3 = x2; } static void mw_std_prim_ZPlusWorld_stderrZ_file (int64_t x1, int64_t *x2, VAL *x3) { int64_t v4 = 2LL; int64_t v5 = 0LL /* False */; - VAL v6 = (mtw_std_file_ZPlusFile_ZPlusFile(v4, v5)); + VAL v6 = mtw_std_file_ZPlusFile_ZPlusFile(v4, v5); *x3 = v6; *x2 = x1; } @@ -9960,22 +9342,14 @@ static int64_t mw_std_file_ZPlusFile_closeZ_fileZBang (int64_t x1, VAL x2) { int64_t v7 = 0LL; bool v8 = (v6 >= v7); int64_t x9; - int64_t x10; if (v8) { - x10 = v6; - x9 = x1; + x9 = v6; } else { - STR* v11; - STRLIT(v11, "Error while closing file.", 25); - push_resource(MKI64(x1)); - push_i64(v6); - do_panic(v11); - int64_t v12 = pop_i64(); - x10 = v12; - int64_t r13 = VI64(pop_resource()); - x9 = r13; + STR* v10; + STRLIT(v10, "Error while closing file.", 25); + do_panic(v10); } - x5 = x9; + x5 = x1; } else { x5 = x1; } @@ -9987,16 +9361,16 @@ static void mw_std_prelude_ZPlusUnsafe_writeZ_bytesZBang (void* x1, int64_t x2, int64_t v11 = 0LL; bool v12 = (x2 > v11); bool v13 = (v12 && ((bool)v9)); - VAL v14 = (x3); - int64_t v15 = (x4); + VAL v14 = x3; + int64_t v15 = x4; void* v16 = x1; int64_t v17 = v10; int64_t v18 = x2; int64_t v19 = v9; bool v20 = v13; while (v20) { - VAL v21 = (v14); - int64_t v22 = (v15); + VAL v21 = v14; + int64_t v22 = v15; void* v23 = v16; int64_t v24 = v17; int64_t v25 = v18; @@ -10006,64 +9380,46 @@ static void mw_std_prelude_ZPlusUnsafe_writeZ_bytesZBang (void* x1, int64_t x2, int64_t v29 = 0LL; bool v30 = (v28 < v29); int64_t x31; - VAL x32; - int64_t x33; + int64_t x32; + void* x33; int64_t x34; - void* x35; - int64_t x36; + int64_t x35; if (v30) { - int64_t v37 = 0LL /* False */; - x36 = v25; - x35 = v23; - x34 = v22; - x33 = v24; - x32 = v21; - x31 = v37; + int64_t v36 = 0LL /* False */; + x35 = v36; + x34 = v24; + x33 = v23; + x32 = v22; + x31 = v25; } else { - int64_t v38 = i64_add(v28, v24); - void* v39 = (void*)(v28 + (char*)v23); - int64_t v40 = i64_sub(v25, v28); - int64_t v41 = 0LL; - bool v42 = (v40 < v41); - int64_t x43; - VAL x44; - int64_t x45; - int64_t x46; - void* x47; - int64_t x48; - if (v42) { - int64_t v49 = 0LL; - x48 = v49; - x47 = v39; - x46 = v22; - x45 = v38; - x44 = v21; - x43 = v26; + int64_t v37 = i64_add(v28, v24); + void* v38 = (void*)(v28 + (char*)v23); + int64_t v39 = i64_sub(v25, v28); + int64_t v40 = 0LL; + bool v41 = (v39 < v40); + int64_t x42; + if (v41) { + int64_t v43 = 0LL; + x42 = v43; } else { - x48 = v40; - x47 = v39; - x46 = v22; - x45 = v38; - x44 = v21; - x43 = v26; + x42 = v39; } - x36 = x48; - x35 = x47; - x34 = x46; - x33 = x45; - x32 = x44; - x31 = x43; - } - int64_t v50 = 0LL; - bool v51 = (x36 > v50); - bool v52 = (v51 && ((bool)x31)); - v20 = v52; - v19 = x31; - v18 = x36; - v17 = x33; - v16 = x35; - v15 = x34; - v14 = x32; + x35 = v26; + x34 = v37; + x33 = v38; + x32 = v22; + x31 = x42; + } + int64_t v44 = 0LL; + bool v45 = (x31 > v44); + bool v46 = (v45 && ((bool)x35)); + v20 = v46; + v19 = x35; + v18 = x31; + v17 = x34; + v16 = x33; + v15 = x32; + v14 = v21; } *x8 = v15; *x7 = v14; @@ -10075,35 +9431,29 @@ static void mw_std_prelude_ZPlusUnsafe_readZ_bytesZBang (void* x1, int64_t x2, V int64_t v10 = mext_std_posix_externalZ_posixZ_read(v9, x1, x2); int64_t v11 = 0LL; bool v12 = (v10 < v11); - VAL x13; + int64_t x13; int64_t x14; - int64_t x15; - int64_t x16; if (v12) { - int64_t v17 = 0LL; - int64_t v18 = 0LL /* False */; - x16 = v18; - x15 = v17; - x14 = x4; - x13 = x3; + int64_t v15 = 0LL; + int64_t v16 = 0LL /* False */; + x14 = v16; + x13 = v15; } else { - int64_t v19 = 1LL /* True */; - x16 = v19; - x15 = v10; - x14 = x4; - x13 = x3; + int64_t v17 = 1LL /* True */; + x14 = v17; + x13 = v10; } - *x8 = x14; - *x7 = x13; - *x6 = x16; - *x5 = x15; + *x8 = x4; + *x7 = x3; + *x6 = x14; + *x5 = x13; } static void mw_std_file_ZPlusFile_readZ_fileZBang (VAL x1, VAL *x2, VAL *x3) { - VAL v4 = (mw_std_input_ZPlusInput_startZBang(x1)); + VAL v4 = mw_std_input_ZPlusInput_startZBang(x1); VAL v5; VAL v6; mw_std_input_ZPlusInput_readZ_fileZBang(v4, &v5, &v6); - VAL v7 = (mw_std_input_ZPlusInput_endZBang(v6)); + VAL v7 = mw_std_input_ZPlusInput_endZBang(v6); *x3 = v7; *x2 = v5; } @@ -10115,112 +9465,68 @@ static int64_t mw_std_prim_ZPlusWorld_traceZ_ (VAL x1, int64_t x2) { incref(x1); void* v5 = str_base(VSTR(x1)); uint64_t v6 = str_size(VSTR(x1)); - int64_t v7 = 0LL; - bool v8 = (((int64_t)v6) < v7); - int64_t x9; - if (v8) { - x9 = v7; - push_resource(MKI64(v3)); - push_resource(v4); - push_ptr(v5); - } else { - x9 = ((int64_t)v6); - push_resource(MKI64(v3)); - push_resource(v4); - push_ptr(v5); - } - int64_t v10 = (0LL /* +Unsafe */); - VAL r11 = pop_resource(); - void* v12 = pop_ptr(); - int64_t v13; - int64_t v14; - VAL v15; - int64_t v16; - mw_std_prelude_ZPlusUnsafe_writeZ_bytesZBang(v12, x9, r11, v10, &v13, &v14, &v15, &v16); + int64_t v7 = 0LL /* +Unsafe */; + int64_t v8; + int64_t v9; + VAL v10; + int64_t v11; + mw_std_prelude_ZPlusUnsafe_writeZ_bytesZBang(v5, ((int64_t)v6), v4, v7, &v8, &v9, &v10, &v11); decref(x1); - int64_t r17 = VI64(pop_resource()); - int64_t v18 = (mw_std_file_ZPlusFile_closeZ_fileZBang(r17, v15)); - return v18; + int64_t v12 = mw_std_file_ZPlusFile_closeZ_fileZBang(v3, v10); + return v12; +} +static int64_t mw_std_prim_ZPlusWorld_trace (VAL x1, int64_t x2) { + STR* v3; + STRLIT(v3, "\n", 1); + STR* v4 = str_cat(VSTR(x1), v3); + int64_t v5 = mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v4), x2); + return v5; } static void mw_std_prim_ZPlusWorld_isZ_directoryZAsk (int64_t x1, VAL x2, int64_t *x3, int64_t *x4) { int64_t v5 = 256LL; - VAL v6 = (mw_std_buffer_ZPlusBuffer_new(v5)); + VAL v6 = mw_std_buffer_ZPlusBuffer_new(v5); incref(x2); incref(x2); void* v7 = str_base(VSTR(x2)); uint64_t v8 = str_size(VSTR(x2)); - int64_t v9 = 0LL; - bool v10 = (((int64_t)v8) < v9); - int64_t x11; - if (v10) { - x11 = v9; - push_resource(MKI64(x1)); - push_resource(v6); - push_ptr(v7); + int64_t v9 = 0LL /* +Unsafe */; + void* v10 = (void*)(((int64_t)v8) + (char*)v7); + uint8_t v11 = *(uint8_t*)v10; + int64_t v12 = 0LL; + bool v13 = (((int64_t)v11) == v12); + if (v13) { } else { - x11 = ((int64_t)v8); - push_resource(MKI64(x1)); - push_resource(v6); - push_ptr(v7); + STR* v14; + STRLIT(v14, "tried to use Str as CStr, but Str is not zero terminated", 56); + do_panic(v14); } - VAL v12 = pop_value(); - incref(v12); - int64_t v13 = (0LL /* +Unsafe */); - void* v14 = (void*)(x11 + (char*)VPTR(v12)); - uint8_t v15 = *(uint8_t*)v14; - int64_t v16 = 0LL; - bool v17 = (((int64_t)v15) == v16); - int64_t x18; - VAL x19; - void* x20; - if (v17) { - x20 = VPTR(v12); - VAL r21 = pop_resource(); - x19 = r21; - int64_t r22 = VI64(pop_resource()); - x18 = r22; - } else { - STR* v23; - STRLIT(v23, "tried to use Str as CStr, but Str is not zero terminated", 56); - push_value(v12); - do_panic(v23); - void* v24 = pop_ptr(); - x20 = v24; - VAL r25 = pop_resource(); - x19 = r25; - int64_t r26 = VI64(pop_resource()); - x18 = r26; - } - void* v27 = VPTR(VTUP(x19)->cells[2]); - int64_t v28 = (0LL /* +Unsafe */); - int64_t v29; - int64_t v30; - mext_std_world_posixZ_stat(v28, x20, v27, &v29, &v30); - int64_t v31 = 0LL; - bool v32 = (v30 == v31); - int64_t x33; - VAL x34; - int64_t x35; - if (v32) { - void* v36 = VPTR(VTUP(x19)->cells[2]); - int64_t v37 = (0LL /* +Unsafe */); - int64_t v38; - int64_t v39; - mw_std_world_stz_modeZAt(v36, v37, &v38, &v39); - int64_t v40 = mw_std_world_Sz_ISDIR(v38); - x35 = v40; - x34 = x19; - x33 = x18; + void* v15 = VPTR(VTUP(v6)->cells[2]); + int64_t v16 = 0LL /* +Unsafe */; + int64_t v17; + int64_t v18; + mext_std_world_posixZ_stat(v16, v7, v15, &v17, &v18); + int64_t v19 = 0LL; + bool v20 = (v18 == v19); + VAL x21; + int64_t x22; + if (v20) { + void* v23 = VPTR(VTUP(v6)->cells[2]); + int64_t v24 = 0LL /* +Unsafe */; + int64_t v25; + int64_t v26; + mw_std_world_stz_modeZAt(v23, v24, &v25, &v26); + int64_t v27 = mw_std_world_Sz_ISDIR(v25); + x22 = v27; + x21 = v6; } else { - int64_t v41 = 0LL /* False */; - x35 = v41; - x34 = x19; - x33 = x18; + int64_t v28 = 0LL /* False */; + x22 = v28; + x21 = v6; } decref(x2); - mw_std_buffer_ZPlusBuffer_rdrop(x34); - *x4 = x35; - *x3 = x33; + mw_std_buffer_ZPlusBuffer_rdrop(x21); + *x4 = x22; + *x3 = x1; } static int64_t mw_std_world_Sz_IFMT (void) { int64_t v1 = 61440LL; @@ -10298,9 +9604,9 @@ static VAL mw_std_terminal_SGRColor_showZThen (VAL x1, VAL x2) { int64_t v4 = mtp_std_terminal_SGRColor_Numbered(x1); STR* v5; STRLIT(v5, ";5;", 3); - VAL v6 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v5), x2)); + VAL v6 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v5), x2); STR* v7 = i64_show(v4); - VAL v8 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6)); + VAL v8 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6); x3 = v8; } break; case 1LL: { // RGB @@ -10310,19 +9616,19 @@ static VAL mw_std_terminal_SGRColor_showZThen (VAL x1, VAL x2) { mtp_std_terminal_SGRColor_RGB(x1, &v9, &v10, &v11); STR* v12; STRLIT(v12, ";2;", 3); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), x2)); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), x2); STR* v14 = i64_show(v11); - VAL v15 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), v13)); + VAL v15 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), v13); STR* v16; STRLIT(v16, ";", 1); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), v15)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), v15); STR* v18 = i64_show(v10); - VAL v19 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), v17)); + VAL v19 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), v17); STR* v20; STRLIT(v20, ";", 1); - VAL v21 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v20), v19)); + VAL v21 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v20), v19); STR* v22 = i64_show(v9); - VAL v23 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v22), v21)); + VAL v23 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v22), v21); x3 = v23; } break; default: { @@ -10332,22 +9638,22 @@ static VAL mw_std_terminal_SGRColor_showZThen (VAL x1, VAL x2) { return x3; } static VAL mw_std_terminal_Sgr_emitZThen (VAL x1, VAL x2) { - VAL v3 = (mw_std_terminal_csiZThen(x2)); + VAL v3 = mw_std_terminal_csiZThen(x2); incref(x1); int64_t v4 = get_data_tag(x1); decref(x1); STR* v5 = i64_show(v4); - VAL v6 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v5), v3)); + VAL v6 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v5), v3); VAL x7; switch (get_data_tag(x1)) { case 38LL: { // FGColor VAL v8 = mtp_std_terminal_Sgr_FGColor(x1); - VAL v9 = (mw_std_terminal_SGRColor_showZThen(v8, v6)); + VAL v9 = mw_std_terminal_SGRColor_showZThen(v8, v6); x7 = v9; } break; case 48LL: { // BGColor VAL v10 = mtp_std_terminal_Sgr_BGColor(x1); - VAL v11 = (mw_std_terminal_SGRColor_showZThen(v10, v6)); + VAL v11 = mw_std_terminal_SGRColor_showZThen(v10, v6); x7 = v11; } break; default: { @@ -10357,20 +9663,20 @@ static VAL mw_std_terminal_Sgr_emitZThen (VAL x1, VAL x2) { } STR* v12; STRLIT(v12, "m", 1); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), x7)); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), x7); return v13; } static VAL mw_std_terminal_csiZThen (VAL x1) { int64_t v2 = 27LL /* BESC */; - VAL v3 = (mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(v2, x1)); + VAL v3 = mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(v2, x1); int64_t v4 = 91LL /* BLSQUARE */; - VAL v5 = (mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(v4, v3)); + VAL v5 = mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(v4, v3); return v5; } static VAL mw_argZ_parser_state_State_1_init (VAL x1) { VAL v2 = mw_argZ_parser_parse_argvZ_toZ_str(); int64_t v3 = 0LL; - int64_t v4 = (0LL /* +Unsafe */); + int64_t v4 = 0LL /* +Unsafe */; VAL v5; int64_t v6; mw_argZ_parser_parse_readZ_fromZ_argv(v4, v3, &v5, &v6); @@ -10476,37 +9782,37 @@ static VAL mw_argZ_parser_types_ArgumentParsingError_emitZThen (VAL x1, VAL x2) case 1LL: { // MissingArg VAL v4 = mtp_argZ_parser_types_ArgumentParsingError_MissingArg(x1); VAL v5 = MKI64(31LL /* FGRed */); - VAL v6 = (mw_std_terminal_Sgr_emitZThen(v5, x2)); + VAL v6 = mw_std_terminal_Sgr_emitZThen(v5, x2); STR* v7; STRLIT(v7, "Missing argument: ", 18); - VAL v8 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6)); + VAL v8 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6); VAL v9 = MKI64(0LL /* Reset */); - VAL v10 = (mw_std_terminal_Sgr_emitZThen(v9, v8)); - VAL v11 = (mw_std_str_ZPlusStr_pushZ_strZBang(v4, v10)); + VAL v10 = mw_std_terminal_Sgr_emitZThen(v9, v8); + VAL v11 = mw_std_str_ZPlusStr_pushZ_strZBang(v4, v10); x3 = v11; } break; case 0LL: { // MissingArgValue STR* v12; STRLIT(v12, "Missing associated value for flag option", 40); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), x2)); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), x2); x3 = v13; } break; case 2LL: { // TooManyArgs STR* v14; STRLIT(v14, "Too many positional arguments passed", 36); - VAL v15 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), x2)); + VAL v15 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), x2); x3 = v15; } break; case 3LL: { // TooFewArgs STR* v16; STRLIT(v16, "Too few positional arguments passed", 35); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), x2)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), x2); x3 = v17; } break; case 4LL: { // UnknownArg STR* v18; STRLIT(v18, "Got an unknown option", 21); - VAL v19 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), x2)); + VAL v19 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), x2); x3 = v19; } break; default: { @@ -10519,136 +9825,107 @@ static void mw_argZ_parser_types_ZPlusArgumentParser_1_usage (VAL x1, VAL *x2, V STR* v4; STRLIT(v4, "", 0); VAL v5 = MKI64(1LL /* Bold */); - VAL v6 = (mw_std_terminal_Sgr_emitZThen(v5, MKSTR(v4))); + VAL v6 = mw_std_terminal_Sgr_emitZThen(v5, MKSTR(v4)); STR* v7; STRLIT(v7, "Usage: ", 7); - VAL v8 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6)); + VAL v8 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6); VAL v9 = MKI64(0LL /* Reset */); - VAL v10 = (mw_std_terminal_Sgr_emitZThen(v9, v8)); + VAL v10 = mw_std_terminal_Sgr_emitZThen(v9, v8); STR* v11; STRLIT(v11, " ", 2); - VAL v12 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10)); + VAL v12 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10); VAL v13 = VVAL(VTUP(x1)->cells[2]); incref(v13); VAL v14 = mw_argZ_parser_state_State_1_programZ_name(v13); - VAL v15 = (mw_std_str_ZPlusStr_pushZ_strZBang(v14, v12)); + VAL v15 = mw_std_str_ZPlusStr_pushZ_strZBang(v14, v12); STR* v16; STRLIT(v16, " [options] ", 11); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), v15)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), v15); VAL v18 = VVAL(VTUP(x1)->cells[1]); incref(v18); VAL v19 = VVAL(VTUP(v18)->cells[3]); incref(v19); decref(v18); VAL x20; - VAL x21; switch (get_data_tag(v19)) { case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v19); - VAL v23 = (mw_std_str_ZPlusStr_pushZ_strZBang(v22, v17)); - x21 = v23; - x20 = x1; + VAL v21 = mtp_std_maybe_Maybe_1_Some(v19); + VAL v22 = mw_std_str_ZPlusStr_pushZ_strZBang(v21, v17); + x20 = v22; } break; case 0LL: { // None - x21 = v17; - x20 = x1; + x20 = v17; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - STR* v24; - STRLIT(v24, "\n\n", 2); - VAL v25 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v24), x21)); - VAL v26 = VVAL(VTUP(x20)->cells[1]); + STR* v23; + STRLIT(v23, "\n\n", 2); + VAL v24 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v23), x20); + VAL v25 = VVAL(VTUP(x1)->cells[1]); + incref(v25); + VAL v26 = VVAL(VTUP(v25)->cells[1]); incref(v26); - VAL v27 = VVAL(VTUP(v26)->cells[1]); - incref(v27); - decref(v26); - VAL v28; - VAL v29; - mw_std_list_List_1_uncons(v27, &v28, &v29); - VAL x30; - VAL x31; - VAL x32; - int64_t x33; - switch (get_data_tag(v28)) { - case 1LL: { // Some - VAL v34 = mtp_std_maybe_Maybe_1_Some(v28); - VAL v35; - VAL v36; - mw_argZ_parser_types_ArgpOption_usageZThen(x20, v25, v34, &v35, &v36); - int64_t v37 = 1LL /* True */; - x33 = v37; - x32 = v29; - x31 = v36; - x30 = v35; - } break; - case 0LL: { // None - int64_t v38 = 0LL /* False */; - x33 = v38; - x32 = v29; - x31 = v25; - x30 = x20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v39 = (x30); - VAL v40 = (x31); - VAL v41 = x32; - int64_t v42 = x33; - while (((bool)v42)) { - VAL v43 = (v39); - VAL v44 = (v40); - VAL v45 = v41; - VAL v46; - VAL v47; - mw_std_list_List_1_uncons(v45, &v46, &v47); - VAL x48; - VAL x49; - VAL x50; - int64_t x51; - switch (get_data_tag(v46)) { - case 1LL: { // Some - VAL v52 = mtp_std_maybe_Maybe_1_Some(v46); - VAL v53; - VAL v54; - mw_argZ_parser_types_ArgpOption_usageZThen(v43, v44, v52, &v53, &v54); - int64_t v55 = 1LL /* True */; - x51 = v55; - x50 = v47; - x49 = v54; - x48 = v53; + decref(v25); + int64_t v27 = 1LL /* True */; + VAL v28 = x1; + VAL v29 = v24; + VAL v30 = v26; + int64_t v31 = v27; + int64_t v32 = v27; + while (((bool)v32)) { + VAL v33 = v28; + VAL v34 = v29; + VAL v35 = v30; + int64_t v36 = v31; + VAL x37; + VAL x38; + VAL x39; + int64_t x40; + switch (get_data_tag(v35)) { + case 1LL: { // Cons + VAL v41; + VAL v42; + mtp_std_list_List_1_Cons(v35, &v41, &v42); + VAL v43; + VAL v44; + mw_argZ_parser_types_ArgpOption_usageZThen(v33, v34, v41, &v43, &v44); + int64_t v45 = 1LL /* True */; + x40 = v45; + x39 = v42; + x38 = v44; + x37 = v43; } break; - case 0LL: { // None - int64_t v56 = 0LL /* False */; - x51 = v56; - x50 = v47; - x49 = v44; - x48 = v43; + case 0LL: { // Nil + VAL v46 = MKI64(0LL /* Nil */); + int64_t v47 = 0LL /* False */; + x40 = v47; + x39 = v46; + x38 = v34; + x37 = v33; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v42 = x51; - v41 = x50; - v40 = x49; - v39 = x48; + v32 = x40; + v31 = x40; + v30 = x39; + v29 = x38; + v28 = x37; } - decref(v41); - STR* v57; - STRLIT(v57, "\n", 1); - VAL v58 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v57), v40)); - *x3 = v58; - *x2 = v39; + decref(v30); + STR* v48; + STRLIT(v48, "\n", 1); + VAL v49 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v48), v29); + *x3 = v49; + *x2 = v28; } static void mw_argZ_parser_types_ArgpOption_usageZThen (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { STR* v6; STRLIT(v6, " ", 2); - VAL v7 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), x2)); + VAL v7 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), x2); int64_t v8 = 0LL; incref(x3); VAL v9 = VVAL(VTUP(x3)->cells[2]); @@ -10661,35 +9938,33 @@ static void mw_argZ_parser_types_ArgpOption_usageZThen (VAL x1, VAL x2, VAL x3, switch (get_data_tag(v9)) { case 0LL: { // Short int64_t v14 = mtp_argZ_parser_types_ArgpOptionType_Short(v9); - int64_t v15 = mw_std_byte_Byte_isZ_printable(v14); - VAL x16; - VAL x17; - int64_t x18; - VAL x19; + int64_t v15 = 33LL /* B'!' */; + int64_t v16 = 126LL /* B'~' */; + bool v17 = (v14 >= v15); + bool v18 = (v14 <= v16); + bool v19 = (v17 && v18); int64_t x20; - if (((bool)v15)) { - int64_t v21 = 2LL; - int64_t v22 = i64_add(v8, v21); - STR* v23; - STRLIT(v23, "-", 1); - VAL v24 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v23), v7)); - VAL v25 = (mw_std_byte_Byte_emitZ_asciiZThen(v24, v14)); - x20 = v14; - x19 = x3; - x18 = v22; - x17 = v25; - x16 = x1; + int64_t x21; + VAL x22; + if (v19) { + int64_t v23 = 2LL; + int64_t v24 = i64_add(v8, v23); + STR* v25; + STRLIT(v25, "-", 1); + VAL v26 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v25), v7); + VAL v27 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v14, v26); + x22 = v27; + x21 = v14; + x20 = v24; } else { - x20 = v14; - x19 = x3; - x18 = v8; - x17 = v7; - x16 = x1; + x22 = v7; + x21 = v14; + x20 = v8; } - x13 = x19; - x12 = x18; - x11 = x17; - x10 = x16; + x13 = x3; + x12 = x20; + x11 = x22; + x10 = x1; } break; default: { decref(v9); @@ -10700,333 +9975,202 @@ static void mw_argZ_parser_types_ArgpOption_usageZThen (VAL x1, VAL x2, VAL x3, } break; } incref(x13); - VAL v26 = VVAL(VTUP(x13)->cells[2]); - incref(v26); + VAL v28 = VVAL(VTUP(x13)->cells[2]); + incref(v28); decref(x13); - int64_t v27 = mw_argZ_parser_types_ArgpOptionType_hasZ_shortZAsk(v26); - VAL x28; - VAL x29; - int64_t x30; - VAL x31; - int64_t x32; - if (((bool)v27)) { + int64_t v29 = mw_argZ_parser_types_ArgpOptionType_hasZ_shortZAsk(v28); + VAL x30; + int64_t x31; + if (((bool)v29)) { incref(x13); - VAL v33 = VVAL(VTUP(x13)->cells[1]); - incref(v33); + VAL v32 = VVAL(VTUP(x13)->cells[1]); + incref(v32); decref(x13); - int64_t v34 = mw_std_maybe_Maybe_1_someZAsk(v33); - x32 = v34; - x31 = x13; - x30 = x12; - x29 = x11; - x28 = x10; + int64_t v33 = get_data_tag(v32); + decref(v32); + int64_t v34 = 1LL; + bool v35 = (v33 == v34); + x31 = ((int64_t)v35); + x30 = x13; } else { - int64_t v35 = 0LL /* False */; - x32 = v35; - x31 = x13; - x30 = x12; - x29 = x11; - x28 = x10; + int64_t v36 = 0LL /* False */; + x31 = v36; + x30 = x13; } - VAL x36; VAL x37; int64_t x38; - VAL x39; - if (((bool)x32)) { - STR* v40; - STRLIT(v40, ", ", 2); - VAL v41 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v40), x29)); - int64_t v42 = 2LL; - int64_t v43 = i64_add(x30, v42); - x39 = x31; - x38 = v43; - x37 = v41; - x36 = x28; + if (((bool)x31)) { + STR* v39; + STRLIT(v39, ", ", 2); + VAL v40 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v39), x11); + int64_t v41 = 2LL; + int64_t v42 = i64_add(x12, v41); + x38 = v42; + x37 = v40; } else { - x39 = x31; - x38 = x30; - x37 = x29; - x36 = x28; + x38 = x12; + x37 = x11; } - incref(x39); - VAL v44 = VVAL(VTUP(x39)->cells[1]); - incref(v44); - decref(x39); + incref(x30); + VAL v43 = VVAL(VTUP(x30)->cells[1]); + incref(v43); + decref(x30); + int64_t x44; VAL x45; VAL x46; - int64_t x47; - VAL x48; - switch (get_data_tag(v44)) { + switch (get_data_tag(v43)) { case 1LL: { // Some - VAL v49 = mtp_std_maybe_Maybe_1_Some(v44); - incref(v49); - uint64_t v50 = str_size(VSTR(v49)); - int64_t v51 = 0LL; - bool v52 = (((int64_t)v50) < v51); - int64_t x53; - if (v52) { - x53 = v51; - push_resource(x36); - push_resource(x37); - lpush(&lbl_colZ_offset, MKI64(x38)); - push_value(x39); - push_value(v49); - } else { - x53 = ((int64_t)v50); - push_resource(x36); - push_resource(x37); - lpush(&lbl_colZ_offset, MKI64(x38)); - push_value(x39); - push_value(v49); - } - int64_t v54 = VI64(lpop(&lbl_colZ_offset)); - int64_t v55 = 2LL; - int64_t v56 = i64_add(v54, v55); - int64_t v57 = i64_add(x53, v56); - STR* v58; - STRLIT(v58, "--", 2); - VAL r59 = pop_resource(); - VAL v60 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v58), r59)); - VAL v61 = pop_value(); - VAL v62 = (mw_std_str_ZPlusStr_pushZ_strZBang(v61, v60)); - VAL v63 = pop_value(); - incref(v63); - VAL v64 = VVAL(VTUP(v63)->cells[3]); - incref(v64); - decref(v63); - VAL x65; - int64_t x66; - VAL x67; - VAL x68; - switch (get_data_tag(v64)) { + VAL v47 = mtp_std_maybe_Maybe_1_Some(v43); + incref(v47); + uint64_t v48 = str_size(VSTR(v47)); + int64_t v49 = 2LL; + int64_t v50 = i64_add(x38, v49); + int64_t v51 = i64_add(((int64_t)v48), v50); + STR* v52; + STRLIT(v52, "--", 2); + VAL v53 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v52), x37); + VAL v54 = mw_std_str_ZPlusStr_pushZ_strZBang(v47, v53); + incref(x30); + VAL v55 = VVAL(VTUP(x30)->cells[3]); + incref(v55); + decref(x30); + int64_t x56; + VAL x57; + switch (get_data_tag(v55)) { case 1LL: { // Some - VAL v69 = mtp_std_maybe_Maybe_1_Some(v64); - incref(v69); - uint64_t v70 = str_size(VSTR(v69)); - int64_t v71 = 0LL; - bool v72 = (((int64_t)v70) < v71); - int64_t x73; - if (v72) { - x73 = v71; - lpush(&lbl_colZ_offset, MKI64(v57)); - push_resource(v62); - push_value(v63); - push_value(v69); - } else { - x73 = ((int64_t)v70); - lpush(&lbl_colZ_offset, MKI64(v57)); - push_resource(v62); - push_value(v63); - push_value(v69); - } - int64_t v74 = VI64(lpop(&lbl_colZ_offset)); - int64_t v75 = 1LL; - int64_t v76 = i64_add(v74, v75); - int64_t v77 = i64_add(x73, v76); - STR* v78; - STRLIT(v78, " ", 1); - VAL r79 = pop_resource(); - VAL v80 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v78), r79)); - VAL v81 = pop_value(); - VAL v82 = (mw_std_str_ZPlusStr_pushZ_strZBang(v81, v80)); - VAL v83 = pop_value(); - x68 = v83; - x67 = v82; - x66 = v77; - VAL r84 = pop_resource(); - x65 = r84; + VAL v58 = mtp_std_maybe_Maybe_1_Some(v55); + incref(v58); + uint64_t v59 = str_size(VSTR(v58)); + int64_t v60 = 1LL; + int64_t v61 = i64_add(v51, v60); + int64_t v62 = i64_add(((int64_t)v59), v61); + STR* v63; + STRLIT(v63, " ", 1); + VAL v64 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v63), v54); + VAL v65 = mw_std_str_ZPlusStr_pushZ_strZBang(v58, v64); + x57 = v65; + x56 = v62; } break; case 0LL: { // None - x68 = v63; - x67 = v62; - x66 = v57; - VAL r85 = pop_resource(); - x65 = r85; + x57 = v54; + x56 = v51; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x48 = x68; - x47 = x66; - x46 = x67; - x45 = x65; + x46 = x30; + x45 = x57; + x44 = x56; } break; case 0LL: { // None - x48 = x39; - x47 = x38; - x46 = x37; - x45 = x36; + x46 = x30; + x45 = x37; + x44 = x38; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - incref(x48); - VAL v86 = VVAL(VTUP(x48)->cells[4]); - incref(v86); - decref(x48); - VAL x87; - VAL x88; - int64_t x89; - VAL x90; - switch (get_data_tag(v86)) { + incref(x46); + VAL v66 = VVAL(VTUP(x46)->cells[4]); + incref(v66); + decref(x46); + int64_t x67; + VAL x68; + VAL x69; + switch (get_data_tag(v66)) { case 1LL: { // Some - VAL v91 = mtp_std_maybe_Maybe_1_Some(v86); - VAL v92 = VVAL(VTUP(x45)->cells[2]); - incref(v92); - int64_t v93 = VI64(VTUP(v92)->cells[5]); - decref(v92); - bool v94 = (x47 < v93); - VAL x95; - VAL x96; - int64_t x97; - VAL x98; - VAL x99; - if (v94) { - int64_t v100 = i64_sub(v93, x47); - int64_t v101 = 0LL; - VAL v102 = mw_std_prim_Int_range(v101, v100); - VAL v103; - VAL v104; - mw_std_list_List_1_uncons(v102, &v103, &v104); - VAL x105; - VAL x106; - int64_t x107; - VAL x108; - VAL x109; - VAL x110; - int64_t x111; - switch (get_data_tag(v103)) { - case 1LL: { // Some - VAL v112 = mtp_std_maybe_Maybe_1_Some(v103); - decref(v112); - STR* v113; - STRLIT(v113, " ", 1); - VAL v114 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v113), x46)); - int64_t v115 = 1LL /* True */; - x111 = v115; - x110 = v104; - x109 = v114; - x108 = x45; - x107 = x47; - x106 = v91; - x105 = x48; - } break; - case 0LL: { // None - int64_t v116 = 0LL /* False */; - x111 = v116; - x110 = v104; - x109 = x46; - x108 = x45; - x107 = x47; - x106 = v91; - x105 = x48; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v117 = x105; - VAL v118 = x106; - int64_t v119 = x107; - VAL v120 = (x108); - VAL v121 = (x109); - VAL v122 = x110; - int64_t v123 = x111; - while (((bool)v123)) { - VAL v124 = v117; - VAL v125 = v118; - int64_t v126 = v119; - VAL v127 = (v120); - VAL v128 = (v121); - VAL v129 = v122; - VAL v130; - VAL v131; - mw_std_list_List_1_uncons(v129, &v130, &v131); - VAL x132; - VAL x133; - int64_t x134; - VAL x135; - VAL x136; - VAL x137; - int64_t x138; - switch (get_data_tag(v130)) { - case 1LL: { // Some - VAL v139 = mtp_std_maybe_Maybe_1_Some(v130); - decref(v139); - STR* v140; - STRLIT(v140, " ", 1); - VAL v141 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v140), v128)); - int64_t v142 = 1LL /* True */; - x138 = v142; - x137 = v131; - x136 = v141; - x135 = v127; - x134 = v126; - x133 = v125; - x132 = v124; + VAL v70 = mtp_std_maybe_Maybe_1_Some(v66); + VAL v71 = VVAL(VTUP(x10)->cells[2]); + incref(v71); + int64_t v72 = VI64(VTUP(v71)->cells[5]); + decref(v71); + bool v73 = (x44 < v72); + VAL x74; + int64_t x75; + VAL x76; + VAL x77; + if (v73) { + int64_t v78 = i64_sub(v72, x44); + int64_t v79 = 0LL; + VAL v80 = mw_std_prim_Int_range(v79, v78); + int64_t v81 = 1LL /* True */; + VAL v82 = x45; + VAL v83 = v80; + int64_t v84 = v81; + int64_t v85 = v81; + while (((bool)v85)) { + VAL v86 = v82; + VAL v87 = v83; + int64_t v88 = v84; + VAL x89; + VAL x90; + int64_t x91; + switch (get_data_tag(v87)) { + case 1LL: { // Cons + VAL v92; + VAL v93; + mtp_std_list_List_1_Cons(v87, &v92, &v93); + decref(v92); + STR* v94; + STRLIT(v94, " ", 1); + VAL v95 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v94), v86); + int64_t v96 = 1LL /* True */; + x91 = v96; + x90 = v93; + x89 = v95; } break; - case 0LL: { // None - int64_t v143 = 0LL /* False */; - x138 = v143; - x137 = v131; - x136 = v128; - x135 = v127; - x134 = v126; - x133 = v125; - x132 = v124; + case 0LL: { // Nil + VAL v97 = MKI64(0LL /* Nil */); + int64_t v98 = 0LL /* False */; + x91 = v98; + x90 = v97; + x89 = v86; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v123 = x138; - v122 = x137; - v121 = x136; - v120 = x135; - v119 = x134; - v118 = x133; - v117 = x132; + v85 = x91; + v84 = x91; + v83 = x90; + v82 = x89; } - decref(v122); - x99 = v121; - x98 = v120; - x97 = v119; - x96 = v118; - x95 = v117; + decref(v83); + x77 = v82; + x76 = x10; + x75 = x44; + x74 = v70; } else { - x99 = x46; - x98 = x45; - x97 = x47; - x96 = v91; - x95 = x48; + x77 = x45; + x76 = x10; + x75 = x44; + x74 = v70; } - STR* v144; - STRLIT(v144, " ", 4); - VAL v145 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v144), x99)); - VAL v146 = (mw_std_str_ZPlusStr_pushZ_strZBang(x96, v145)); - x90 = x95; - x89 = x97; - x88 = v146; - x87 = x98; + STR* v99; + STRLIT(v99, " ", 4); + VAL v100 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v99), x77); + VAL v101 = mw_std_str_ZPlusStr_pushZ_strZBang(x74, v100); + x69 = v101; + x68 = x76; + x67 = x75; } break; case 0LL: { // None - x90 = x48; - x89 = x47; - x88 = x46; - x87 = x45; + x69 = x45; + x68 = x10; + x67 = x44; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - STR* v147; - STRLIT(v147, "\n", 1); - VAL v148 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v147), x88)); - decref(x90); - *x5 = v148; - *x4 = x87; + STR* v102; + STRLIT(v102, "\n", 1); + VAL v103 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v102), x69); + decref(x46); + *x5 = v103; + *x4 = x68; } static void mw_argZ_parser_parse_checkZ_shortZ_flag (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, int64_t *x6) { incref(x2); @@ -11093,569 +10237,404 @@ static void mw_argZ_parser_parse_checkZ_longZ_flag (VAL x1, VAL x2, VAL x3, VAL static void mw_argZ_parser_parse_parseZ_flags (VAL x1, VAL x2, VAL *x3, VAL *x4) { incref(x2); uint64_t v5 = str_size(VSTR(x2)); - int64_t v6 = 0LL; - bool v7 = (((int64_t)v5) < v6); - int64_t x8; + int64_t v6 = 2LL; + bool v7 = (((int64_t)v5) >= v6); + VAL x8; + int64_t x9; if (v7) { - x8 = v6; - push_resource(x1); - push_value(x2); - } else { - x8 = ((int64_t)v5); - push_resource(x1); - push_value(x2); - } - int64_t v9 = 2LL; - bool v10 = (x8 >= v9); - VAL x11; - VAL x12; - int64_t x13; - if (v10) { - int64_t v14 = 1LL; - VAL v15 = pop_value(); - incref(v15); - int64_t v16 = mw_std_prim_Str_byteZAt(v14, v15); - int64_t v17 = 45LL /* B'-' */; - bool v18 = (v16 == v17); - x13 = ((int64_t)v18); - x12 = v15; - VAL r19 = pop_resource(); - x11 = r19; + int64_t v10 = 1LL; + incref(x2); + int64_t v11 = mw_std_prim_Str_byteZAt(v10, x2); + int64_t v12 = 45LL /* B'-' */; + bool v13 = (v11 == v12); + x9 = ((int64_t)v13); + x8 = x2; } else { - int64_t v20 = 0LL /* False */; - x13 = v20; - VAL v21 = pop_value(); - x12 = v21; - VAL r22 = pop_resource(); - x11 = r22; + int64_t v14 = 0LL /* False */; + x9 = v14; + x8 = x2; } - VAL x23; - VAL x24; - VAL x25; - if (((bool)x13)) { - int64_t v26 = 2LL; - incref(x12); - int64_t v27 = (0LL /* +Unsafe */); - VAL v28; - int64_t v29; - mw_std_prim_Str_dropZ_bytes(v26, x12, v27, &v28, &v29); - VAL v30 = VVAL(VTUP(x11)->cells[1]); - incref(v30); - VAL v31 = VVAL(VTUP(v30)->cells[1]); - incref(v31); - decref(v30); - VAL v32 = MKI64(0LL /* None */); - VAL v33; - VAL v34; - mw_std_list_List_1_uncons(v31, &v33, &v34); - VAL x35; - VAL x36; - VAL x37; - VAL x38; - int64_t x39; - switch (get_data_tag(v33)) { - case 1LL: { // Some - VAL v40 = mtp_std_maybe_Maybe_1_Some(v33); - incref(v40); - incref(v28); - VAL v41; - VAL v42; - int64_t v43; - mw_argZ_parser_parse_checkZ_longZ_flag(x11, v40, v28, &v41, &v42, &v43); - decref(v42); - VAL x44; - VAL x45; - VAL x46; - if (((bool)v43)) { - VAL v47 = mtw_std_maybe_Maybe_1_Some(v40); - x46 = v47; - x45 = v41; - x44 = v28; - push_value(x12); - } else { - decref(v40); - VAL v48 = MKI64(0LL /* None */); - x46 = v48; - x45 = v41; - x44 = v28; - push_value(x12); - } - VAL x49; - VAL x50; - VAL x51; - VAL x52; - switch (get_data_tag(x46)) { - case 0LL: { // None - x52 = v34; - x51 = v32; - x50 = x45; - x49 = x44; - } break; - default: { - decref(v34); - decref(v32); - VAL v53 = MKI64(0LL /* Nil */); - x52 = v53; - x51 = x46; - x50 = x45; - x49 = x44; - } break; - } - int64_t v54 = 1LL /* True */; - x39 = v54; - x38 = x52; - x37 = x51; - x36 = x50; - x35 = x49; - } break; - case 0LL: { // None - int64_t v55 = 0LL /* False */; - x39 = v55; - x38 = v34; - x37 = v32; - x36 = x11; - x35 = v28; - push_value(x12); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v56 = x35; - VAL v57 = (x36); - VAL v58 = x37; - VAL v59 = x38; - int64_t v60 = x39; - while (((bool)v60)) { - VAL v61 = v56; - VAL v62 = (v57); - VAL v63 = v58; - VAL v64 = v59; - VAL v65; - VAL v66; - mw_std_list_List_1_uncons(v64, &v65, &v66); - VAL x67; - VAL x68; - VAL x69; - VAL x70; - int64_t x71; - switch (get_data_tag(v65)) { + VAL x15; + VAL x16; + VAL x17; + if (((bool)x9)) { + int64_t v18 = 2LL; + incref(x8); + int64_t v19 = 0LL /* +Unsafe */; + VAL v20; + int64_t v21; + mw_std_prim_Str_dropZ_bytes(v18, x8, v19, &v20, &v21); + VAL v22 = VVAL(VTUP(x1)->cells[1]); + incref(v22); + VAL v23 = VVAL(VTUP(v22)->cells[1]); + incref(v23); + decref(v22); + VAL v24 = MKI64(0LL /* None */); + int64_t v25 = 1LL /* True */; + VAL v26 = x1; + VAL v27 = v20; + VAL v28 = v24; + VAL v29 = v23; + int64_t v30 = v25; + int64_t v31 = v25; + while (((bool)v31)) { + VAL v32 = v26; + VAL v33 = v27; + VAL v34 = v28; + VAL v35 = v29; + int64_t v36 = v30; + VAL v37; + VAL v38; + mw_std_list_List_1_uncons(v35, &v37, &v38); + VAL x39; + VAL x40; + VAL x41; + VAL x42; + int64_t x43; + switch (get_data_tag(v37)) { case 1LL: { // Some - VAL v72 = mtp_std_maybe_Maybe_1_Some(v65); - incref(v72); - incref(v61); - VAL v73; - VAL v74; - int64_t v75; - mw_argZ_parser_parse_checkZ_longZ_flag(v62, v72, v61, &v73, &v74, &v75); - decref(v74); - VAL x76; - VAL x77; - VAL x78; - if (((bool)v75)) { - VAL v79 = mtw_std_maybe_Maybe_1_Some(v72); - x78 = v79; - x77 = v73; - x76 = v61; + VAL v44 = mtp_std_maybe_Maybe_1_Some(v37); + incref(v44); + incref(v33); + VAL v45; + VAL v46; + int64_t v47; + mw_argZ_parser_parse_checkZ_longZ_flag(v32, v44, v33, &v45, &v46, &v47); + decref(v46); + VAL x48; + VAL x49; + VAL x50; + if (((bool)v47)) { + VAL v51 = mtw_std_maybe_Maybe_1_Some(v44); + x50 = v51; + x49 = v45; + x48 = v33; } else { - decref(v72); - VAL v80 = MKI64(0LL /* None */); - x78 = v80; - x77 = v73; - x76 = v61; + decref(v44); + VAL v52 = MKI64(0LL /* None */); + x50 = v52; + x49 = v45; + x48 = v33; } - VAL x81; - VAL x82; - VAL x83; - VAL x84; - switch (get_data_tag(x78)) { + VAL x53; + VAL x54; + VAL x55; + VAL x56; + switch (get_data_tag(x50)) { case 0LL: { // None - x84 = v66; - x83 = v63; - x82 = x77; - x81 = x76; + x56 = v38; + x55 = v34; + x54 = x49; + x53 = x48; } break; default: { - decref(v66); - decref(v63); - VAL v85 = MKI64(0LL /* Nil */); - x84 = v85; - x83 = x78; - x82 = x77; - x81 = x76; + decref(v38); + decref(v34); + VAL v57 = MKI64(0LL /* Nil */); + x56 = v57; + x55 = x50; + x54 = x49; + x53 = x48; } break; } - int64_t v86 = 1LL /* True */; - x71 = v86; - x70 = x84; - x69 = x83; - x68 = x82; - x67 = x81; + int64_t v58 = 1LL /* True */; + x43 = v58; + x42 = x56; + x41 = x55; + x40 = x54; + x39 = x53; } break; case 0LL: { // None - int64_t v87 = 0LL /* False */; - x71 = v87; - x70 = v66; - x69 = v63; - x68 = v62; - x67 = v61; + int64_t v59 = 0LL /* False */; + x43 = v59; + x42 = v38; + x41 = v34; + x40 = v32; + x39 = v33; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v60 = x71; - v59 = x70; - v58 = x69; - v57 = x68; - v56 = x67; - } - decref(v59); - decref(v56); - VAL x88; - VAL x89; - switch (get_data_tag(v58)) { + v31 = x43; + v30 = x43; + v29 = x42; + v28 = x41; + v27 = x39; + v26 = x40; + } + decref(v29); + decref(v27); + VAL x60; + VAL x61; + switch (get_data_tag(v28)) { case 1LL: { // Some - VAL v90 = mtp_std_maybe_Maybe_1_Some(v58); - incref(v90); - VAL v91 = VVAL(VTUP(v90)->cells[3]); - incref(v91); - decref(v90); - VAL x92; - switch (get_data_tag(v91)) { + VAL v62 = mtp_std_maybe_Maybe_1_Some(v28); + incref(v62); + VAL v63 = VVAL(VTUP(v62)->cells[3]); + incref(v63); + decref(v62); + VAL x64; + switch (get_data_tag(v63)) { case 1LL: { // Some - VAL v93 = mtp_std_maybe_Maybe_1_Some(v91); - int64_t v94 = 1LL /* True */; - VAL v95 = VVAL(VTUP(v57)->cells[2]); - incref(v95); - VAL v96 = mw_argZ_parser_state_State_1_parsingZAskZBang(v94, v95); - VAL v97 = VTUP(v57)->cells[2]; - decref(v97); - VTUP(v57)->cells[2] = v96; - decref(v93); - VAL v98 = mtw_std_maybe_Maybe_1_Some(v90); - VAL v99 = VVAL(VTUP(v57)->cells[2]); - incref(v99); - VAL v100 = mw_argZ_parser_state_State_1_optionZ_optionZBang(v98, v99); - VAL v101 = VTUP(v57)->cells[2]; - decref(v101); - VTUP(v57)->cells[2] = v100; - x92 = v57; + VAL v65 = mtp_std_maybe_Maybe_1_Some(v63); + int64_t v66 = 1LL /* True */; + VAL v67 = VVAL(VTUP(v26)->cells[2]); + incref(v67); + VAL v68 = mw_argZ_parser_state_State_1_parsingZAskZBang(v66, v67); + VAL v69 = VTUP(v26)->cells[2]; + decref(v69); + VTUP(v26)->cells[2] = v68; + decref(v65); + VAL v70 = mtw_std_maybe_Maybe_1_Some(v62); + VAL v71 = VVAL(VTUP(v26)->cells[2]); + incref(v71); + VAL v72 = mw_argZ_parser_state_State_1_optionZ_optionZBang(v70, v71); + VAL v73 = VTUP(v26)->cells[2]; + decref(v73); + VTUP(v26)->cells[2] = v72; + x64 = v26; } break; case 0LL: { // None - VAL v102 = VVAL(VTUP(v90)->cells[2]); - incref(v102); - decref(v90); - VAL v103 = VVAL(VTUP(v57)->cells[2]); - incref(v103); - VAL v104 = VVAL(VTUP(v103)->cells[1]); - incref(v104); - decref(v103); - VAL v105 = MKI64(0LL /* None */); - VAL v106; - VAL v107; - mw_argZ_parser_types_ZPlusArgumentParser_1_parser(v57, &v106, &v107); - push_value(v104); - push_value(v105); - push_value(v102); - push_resource(v106); - run_value(v107); - VAL r108 = pop_resource(); - VAL v109 = VVAL(VTUP(r108)->cells[2]); - incref(v109); - VAL v110 = pop_value(); - VAL v111 = tup_replace(v109, 1, v110); - VAL v112 = VTUP(r108)->cells[2]; - decref(v112); - VTUP(r108)->cells[2] = v111; - x92 = r108; + VAL v74 = VVAL(VTUP(v62)->cells[2]); + incref(v74); + decref(v62); + VAL v75 = VVAL(VTUP(v26)->cells[2]); + incref(v75); + VAL v76 = VVAL(VTUP(v75)->cells[1]); + incref(v76); + decref(v75); + VAL v77 = MKI64(0LL /* None */); + VAL v78; + VAL v79; + mw_argZ_parser_types_ZPlusArgumentParser_1_parser(v26, &v78, &v79); + push_value(v76); + push_value(v77); + push_value(v74); + push_resource(v78); + run_value(v79); + VAL r80 = pop_resource(); + VAL v81 = VVAL(VTUP(r80)->cells[2]); + incref(v81); + VAL v82 = pop_value(); + VAL v83 = tup_replace(v81, 1, v82); + VAL v84 = VTUP(r80)->cells[2]; + decref(v84); + VTUP(r80)->cells[2] = v83; + x64 = r80; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v113 = MKI64(0LL /* None */); - x89 = v113; - x88 = x92; + VAL v85 = MKI64(0LL /* None */); + x61 = v85; + x60 = x64; } break; case 0LL: { // None - VAL v114 = MKI64(4LL /* UnknownArg */); - VAL v115 = mtw_std_maybe_Maybe_1_Some(v114); - x89 = v115; - x88 = v57; + VAL v86 = MKI64(4LL /* UnknownArg */); + VAL v87 = mtw_std_maybe_Maybe_1_Some(v86); + x61 = v87; + x60 = v26; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x25 = x89; - x24 = x88; - VAL v116 = pop_value(); - x23 = v116; + x17 = x61; + x16 = x60; + x15 = x8; } else { - int64_t v117 = 1LL; - incref(x12); - int64_t v118 = (0LL /* +Unsafe */); - VAL v119; - int64_t v120; - mw_std_prim_Str_dropZ_bytes(v117, x12, v118, &v119, &v120); - VAL v121 = VVAL(VTUP(x11)->cells[1]); - incref(v121); - VAL v122 = VVAL(VTUP(v121)->cells[1]); - incref(v122); - decref(v121); - VAL v123 = MKI64(0LL /* None */); - VAL v124; - VAL v125; - mw_std_list_List_1_uncons(v122, &v124, &v125); - VAL x126; - VAL x127; - VAL x128; - VAL x129; - int64_t x130; - switch (get_data_tag(v124)) { - case 1LL: { // Some - VAL v131 = mtp_std_maybe_Maybe_1_Some(v124); - incref(v131); - incref(v119); - VAL v132; - VAL v133; - int64_t v134; - mw_argZ_parser_parse_checkZ_shortZ_flag(x11, v131, v119, &v132, &v133, &v134); - decref(v133); - VAL x135; - VAL x136; - VAL x137; - if (((bool)v134)) { - VAL v138 = mtw_std_maybe_Maybe_1_Some(v131); - x137 = v138; - x136 = v132; - x135 = v119; - push_value(x12); - } else { - decref(v131); - VAL v139 = MKI64(0LL /* None */); - x137 = v139; - x136 = v132; - x135 = v119; - push_value(x12); - } - VAL x140; - VAL x141; - VAL x142; - VAL x143; - switch (get_data_tag(x137)) { - case 0LL: { // None - x143 = v125; - x142 = v123; - x141 = x136; - x140 = x135; - } break; - default: { - decref(v125); - decref(v123); - VAL v144 = MKI64(0LL /* Nil */); - x143 = v144; - x142 = x137; - x141 = x136; - x140 = x135; - } break; - } - int64_t v145 = 1LL /* True */; - x130 = v145; - x129 = x143; - x128 = x142; - x127 = x141; - x126 = x140; - } break; - case 0LL: { // None - int64_t v146 = 0LL /* False */; - x130 = v146; - x129 = v125; - x128 = v123; - x127 = x11; - x126 = v119; - push_value(x12); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v147 = x126; - VAL v148 = (x127); - VAL v149 = x128; - VAL v150 = x129; - int64_t v151 = x130; - while (((bool)v151)) { - VAL v152 = v147; - VAL v153 = (v148); - VAL v154 = v149; - VAL v155 = v150; - VAL v156; - VAL v157; - mw_std_list_List_1_uncons(v155, &v156, &v157); - VAL x158; - VAL x159; - VAL x160; - VAL x161; - int64_t x162; - switch (get_data_tag(v156)) { + int64_t v88 = 1LL; + incref(x8); + int64_t v89 = 0LL /* +Unsafe */; + VAL v90; + int64_t v91; + mw_std_prim_Str_dropZ_bytes(v88, x8, v89, &v90, &v91); + VAL v92 = VVAL(VTUP(x1)->cells[1]); + incref(v92); + VAL v93 = VVAL(VTUP(v92)->cells[1]); + incref(v93); + decref(v92); + VAL v94 = MKI64(0LL /* None */); + int64_t v95 = 1LL /* True */; + VAL v96 = x1; + VAL v97 = v90; + VAL v98 = v94; + VAL v99 = v93; + int64_t v100 = v95; + int64_t v101 = v95; + while (((bool)v101)) { + VAL v102 = v96; + VAL v103 = v97; + VAL v104 = v98; + VAL v105 = v99; + int64_t v106 = v100; + VAL v107; + VAL v108; + mw_std_list_List_1_uncons(v105, &v107, &v108); + VAL x109; + VAL x110; + VAL x111; + VAL x112; + int64_t x113; + switch (get_data_tag(v107)) { case 1LL: { // Some - VAL v163 = mtp_std_maybe_Maybe_1_Some(v156); - incref(v163); - incref(v152); - VAL v164; - VAL v165; - int64_t v166; - mw_argZ_parser_parse_checkZ_shortZ_flag(v153, v163, v152, &v164, &v165, &v166); - decref(v165); - VAL x167; - VAL x168; - VAL x169; - if (((bool)v166)) { - VAL v170 = mtw_std_maybe_Maybe_1_Some(v163); - x169 = v170; - x168 = v164; - x167 = v152; + VAL v114 = mtp_std_maybe_Maybe_1_Some(v107); + incref(v114); + incref(v103); + VAL v115; + VAL v116; + int64_t v117; + mw_argZ_parser_parse_checkZ_shortZ_flag(v102, v114, v103, &v115, &v116, &v117); + decref(v116); + VAL x118; + VAL x119; + VAL x120; + if (((bool)v117)) { + VAL v121 = mtw_std_maybe_Maybe_1_Some(v114); + x120 = v121; + x119 = v115; + x118 = v103; } else { - decref(v163); - VAL v171 = MKI64(0LL /* None */); - x169 = v171; - x168 = v164; - x167 = v152; + decref(v114); + VAL v122 = MKI64(0LL /* None */); + x120 = v122; + x119 = v115; + x118 = v103; } - VAL x172; - VAL x173; - VAL x174; - VAL x175; - switch (get_data_tag(x169)) { + VAL x123; + VAL x124; + VAL x125; + VAL x126; + switch (get_data_tag(x120)) { case 0LL: { // None - x175 = v157; - x174 = v154; - x173 = x168; - x172 = x167; + x126 = v108; + x125 = v104; + x124 = x119; + x123 = x118; } break; default: { - decref(v157); - decref(v154); - VAL v176 = MKI64(0LL /* Nil */); - x175 = v176; - x174 = x169; - x173 = x168; - x172 = x167; + decref(v108); + decref(v104); + VAL v127 = MKI64(0LL /* Nil */); + x126 = v127; + x125 = x120; + x124 = x119; + x123 = x118; } break; } - int64_t v177 = 1LL /* True */; - x162 = v177; - x161 = x175; - x160 = x174; - x159 = x173; - x158 = x172; + int64_t v128 = 1LL /* True */; + x113 = v128; + x112 = x126; + x111 = x125; + x110 = x124; + x109 = x123; } break; case 0LL: { // None - int64_t v178 = 0LL /* False */; - x162 = v178; - x161 = v157; - x160 = v154; - x159 = v153; - x158 = v152; + int64_t v129 = 0LL /* False */; + x113 = v129; + x112 = v108; + x111 = v104; + x110 = v102; + x109 = v103; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v151 = x162; - v150 = x161; - v149 = x160; - v148 = x159; - v147 = x158; - } - decref(v150); - decref(v147); - VAL x179; - VAL x180; - switch (get_data_tag(v149)) { + v101 = x113; + v100 = x113; + v99 = x112; + v98 = x111; + v97 = x109; + v96 = x110; + } + decref(v99); + decref(v97); + VAL x130; + VAL x131; + switch (get_data_tag(v98)) { case 1LL: { // Some - VAL v181 = mtp_std_maybe_Maybe_1_Some(v149); - incref(v181); - VAL v182 = VVAL(VTUP(v181)->cells[3]); - incref(v182); - decref(v181); - VAL x183; - switch (get_data_tag(v182)) { + VAL v132 = mtp_std_maybe_Maybe_1_Some(v98); + incref(v132); + VAL v133 = VVAL(VTUP(v132)->cells[3]); + incref(v133); + decref(v132); + VAL x134; + switch (get_data_tag(v133)) { case 1LL: { // Some - VAL v184 = mtp_std_maybe_Maybe_1_Some(v182); - int64_t v185 = 1LL /* True */; - VAL v186 = VVAL(VTUP(v148)->cells[2]); - incref(v186); - VAL v187 = mw_argZ_parser_state_State_1_parsingZAskZBang(v185, v186); - VAL v188 = VTUP(v148)->cells[2]; - decref(v188); - VTUP(v148)->cells[2] = v187; - decref(v184); - VAL v189 = mtw_std_maybe_Maybe_1_Some(v181); - VAL v190 = VVAL(VTUP(v148)->cells[2]); - incref(v190); - VAL v191 = mw_argZ_parser_state_State_1_optionZ_optionZBang(v189, v190); - VAL v192 = VTUP(v148)->cells[2]; - decref(v192); - VTUP(v148)->cells[2] = v191; - x183 = v148; + VAL v135 = mtp_std_maybe_Maybe_1_Some(v133); + int64_t v136 = 1LL /* True */; + VAL v137 = VVAL(VTUP(v96)->cells[2]); + incref(v137); + VAL v138 = mw_argZ_parser_state_State_1_parsingZAskZBang(v136, v137); + VAL v139 = VTUP(v96)->cells[2]; + decref(v139); + VTUP(v96)->cells[2] = v138; + decref(v135); + VAL v140 = mtw_std_maybe_Maybe_1_Some(v132); + VAL v141 = VVAL(VTUP(v96)->cells[2]); + incref(v141); + VAL v142 = mw_argZ_parser_state_State_1_optionZ_optionZBang(v140, v141); + VAL v143 = VTUP(v96)->cells[2]; + decref(v143); + VTUP(v96)->cells[2] = v142; + x134 = v96; } break; case 0LL: { // None - VAL v193 = VVAL(VTUP(v181)->cells[2]); - incref(v193); - decref(v181); - VAL v194 = VVAL(VTUP(v148)->cells[2]); - incref(v194); - VAL v195 = VVAL(VTUP(v194)->cells[1]); - incref(v195); - decref(v194); - VAL v196 = MKI64(0LL /* None */); - VAL v197; - VAL v198; - mw_argZ_parser_types_ZPlusArgumentParser_1_parser(v148, &v197, &v198); - push_value(v195); - push_value(v196); - push_value(v193); - push_resource(v197); - run_value(v198); - VAL r199 = pop_resource(); - VAL v200 = VVAL(VTUP(r199)->cells[2]); - incref(v200); - VAL v201 = pop_value(); - VAL v202 = tup_replace(v200, 1, v201); - VAL v203 = VTUP(r199)->cells[2]; - decref(v203); - VTUP(r199)->cells[2] = v202; - x183 = r199; + VAL v144 = VVAL(VTUP(v132)->cells[2]); + incref(v144); + decref(v132); + VAL v145 = VVAL(VTUP(v96)->cells[2]); + incref(v145); + VAL v146 = VVAL(VTUP(v145)->cells[1]); + incref(v146); + decref(v145); + VAL v147 = MKI64(0LL /* None */); + VAL v148; + VAL v149; + mw_argZ_parser_types_ZPlusArgumentParser_1_parser(v96, &v148, &v149); + push_value(v146); + push_value(v147); + push_value(v144); + push_resource(v148); + run_value(v149); + VAL r150 = pop_resource(); + VAL v151 = VVAL(VTUP(r150)->cells[2]); + incref(v151); + VAL v152 = pop_value(); + VAL v153 = tup_replace(v151, 1, v152); + VAL v154 = VTUP(r150)->cells[2]; + decref(v154); + VTUP(r150)->cells[2] = v153; + x134 = r150; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v204 = MKI64(0LL /* None */); - x180 = v204; - x179 = x183; + VAL v155 = MKI64(0LL /* None */); + x131 = v155; + x130 = x134; } break; case 0LL: { // None - VAL v205 = MKI64(4LL /* UnknownArg */); - VAL v206 = mtw_std_maybe_Maybe_1_Some(v205); - x180 = v206; - x179 = v148; + VAL v156 = MKI64(4LL /* UnknownArg */); + VAL v157 = mtw_std_maybe_Maybe_1_Some(v156); + x131 = v157; + x130 = v96; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x25 = x180; - x24 = x179; - VAL v207 = pop_value(); - x23 = v207; + x17 = x131; + x16 = x130; + x15 = x8; } - decref(x23); - *x4 = x25; - *x3 = x24; + decref(x15); + *x4 = x17; + *x3 = x16; } static void mw_argZ_parser_parse_doZ_positionalZ_option (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5 = VVAL(VTUP(x1)->cells[2]); @@ -11699,950 +10678,491 @@ static void mw_argZ_parser_parse_doZ_positionalZ_option (VAL x1, VAL x2, VAL *x3 } static VAL mw_argZ_parser_parse_parseZ_args (VAL x1, VAL x2) { VAL v3 = mw_argZ_parser_state_State_1_init(x1); - VAL v4 = (mtw_argZ_parser_types_ZPlusArgumentParser_1_ZPlusArgumentParser(x2, v3)); + VAL v4 = mtw_argZ_parser_types_ZPlusArgumentParser_1_ZPlusArgumentParser(x2, v3); VAL v5 = VVAL(VTUP(v4)->cells[1]); incref(v5); VAL v6 = VVAL(VTUP(v5)->cells[1]); incref(v6); decref(v5); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v6, &v7, &v8); - VAL x9; - VAL x10; - int64_t x11; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v7); - int64_t v13 = 0LL; - incref(v12); - VAL v14 = VVAL(VTUP(v12)->cells[2]); - incref(v14); - decref(v12); - VAL x15; - VAL x16; - int64_t x17; - switch (get_data_tag(v14)) { - case 0LL: { // Short - int64_t v18 = mtp_argZ_parser_types_ArgpOptionType_Short(v14); - int64_t v19 = 2LL; - int64_t v20 = i64_add(v13, v19); - x17 = v20; - x16 = v12; - x15 = v4; - } break; - default: { - decref(v14); - x17 = v13; - x16 = v12; - x15 = v4; - } break; - } - incref(x16); - VAL v21 = VVAL(VTUP(x16)->cells[1]); - incref(v21); - decref(x16); - VAL x22; - int64_t x23; - VAL x24; - switch (get_data_tag(v21)) { - case 1LL: { // Some - VAL v25 = mtp_std_maybe_Maybe_1_Some(v21); - uint64_t v26 = str_size(VSTR(v25)); - int64_t v27 = 0LL; - bool v28 = (((int64_t)v26) < v27); - int64_t x29; - if (v28) { - x29 = v27; - push_resource(x15); - lpush(&lbl_docZ_length, MKI64(x17)); - push_value(x16); - } else { - x29 = ((int64_t)v26); - push_resource(x15); - lpush(&lbl_docZ_length, MKI64(x17)); - push_value(x16); - } - int64_t v30 = VI64(lpop(&lbl_docZ_length)); - int64_t v31 = 3LL; - int64_t v32 = i64_add(v30, v31); - int64_t v33 = i64_add(x29, v32); - VAL v34 = pop_value(); - x24 = v34; - x23 = v33; - VAL r35 = pop_resource(); - x22 = r35; - } break; - case 0LL: { // None - x24 = x16; - x23 = x17; - x22 = x15; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v36 = VVAL(VTUP(x24)->cells[3]); - incref(v36); - decref(x24); - VAL x37; - int64_t x38; - switch (get_data_tag(v36)) { - case 1LL: { // Some - VAL v39 = mtp_std_maybe_Maybe_1_Some(v36); - uint64_t v40 = str_size(VSTR(v39)); - int64_t v41 = 0LL; - bool v42 = (((int64_t)v40) < v41); - int64_t x43; - if (v42) { - x43 = v41; - push_resource(x22); - lpush(&lbl_docZ_length, MKI64(x23)); - } else { - x43 = ((int64_t)v40); - push_resource(x22); - lpush(&lbl_docZ_length, MKI64(x23)); - } - int64_t v44 = VI64(lpop(&lbl_docZ_length)); - int64_t v45 = 1LL; - int64_t v46 = i64_add(v44, v45); - int64_t v47 = i64_add(x43, v46); - x38 = v47; - VAL r48 = pop_resource(); - x37 = r48; - } break; - case 0LL: { // None - x38 = x23; - x37 = x22; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v49 = VVAL(VTUP(x37)->cells[2]); - incref(v49); - int64_t v50 = VI64(VTUP(v49)->cells[5]); - decref(v49); - bool v51 = (x38 > v50); - VAL x52; - if (v51) { - VAL v53 = VVAL(VTUP(x37)->cells[2]); - incref(v53); - VAL v54 = tup_replace(v53, 5, MKI64(x38)); - VAL v55 = VTUP(x37)->cells[2]; - decref(v55); - VTUP(x37)->cells[2] = v54; - x52 = x37; - } else { - x52 = x37; - } - int64_t v56 = 1LL /* True */; - x11 = v56; - x10 = v8; - x9 = x52; - } break; - case 0LL: { // None - int64_t v57 = 0LL /* False */; - x11 = v57; - x10 = v8; - x9 = v4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v58 = (x9); - VAL v59 = x10; - int64_t v60 = x11; - while (((bool)v60)) { - VAL v61 = (v58); - VAL v62 = v59; - VAL v63; - VAL v64; - mw_std_list_List_1_uncons(v62, &v63, &v64); - VAL x65; - VAL x66; - int64_t x67; - switch (get_data_tag(v63)) { - case 1LL: { // Some - VAL v68 = mtp_std_maybe_Maybe_1_Some(v63); - int64_t v69 = 0LL; - incref(v68); - VAL v70 = VVAL(VTUP(v68)->cells[2]); - incref(v70); - decref(v68); - VAL x71; - VAL x72; - int64_t x73; - switch (get_data_tag(v70)) { + int64_t v7 = 1LL /* True */; + VAL v8 = v4; + VAL v9 = v6; + int64_t v10 = v7; + int64_t v11 = v7; + while (((bool)v11)) { + VAL v12 = v8; + VAL v13 = v9; + int64_t v14 = v10; + VAL x15; + VAL x16; + int64_t x17; + switch (get_data_tag(v13)) { + case 1LL: { // Cons + VAL v18; + VAL v19; + mtp_std_list_List_1_Cons(v13, &v18, &v19); + int64_t v20 = 0LL; + incref(v18); + VAL v21 = VVAL(VTUP(v18)->cells[2]); + incref(v21); + decref(v18); + VAL x22; + VAL x23; + int64_t x24; + switch (get_data_tag(v21)) { case 0LL: { // Short - int64_t v74 = mtp_argZ_parser_types_ArgpOptionType_Short(v70); - int64_t v75 = 2LL; - int64_t v76 = i64_add(v69, v75); - x73 = v76; - x72 = v68; - x71 = v61; + int64_t v25 = mtp_argZ_parser_types_ArgpOptionType_Short(v21); + int64_t v26 = 2LL; + int64_t v27 = i64_add(v20, v26); + x24 = v27; + x23 = v18; + x22 = v12; } break; default: { - decref(v70); - x73 = v69; - x72 = v68; - x71 = v61; + decref(v21); + x24 = v20; + x23 = v18; + x22 = v12; } break; } - incref(x72); - VAL v77 = VVAL(VTUP(x72)->cells[1]); - incref(v77); - decref(x72); - VAL x78; - int64_t x79; - VAL x80; - switch (get_data_tag(v77)) { + incref(x23); + VAL v28 = VVAL(VTUP(x23)->cells[1]); + incref(v28); + decref(x23); + int64_t x29; + switch (get_data_tag(v28)) { case 1LL: { // Some - VAL v81 = mtp_std_maybe_Maybe_1_Some(v77); - uint64_t v82 = str_size(VSTR(v81)); - int64_t v83 = 0LL; - bool v84 = (((int64_t)v82) < v83); - int64_t x85; - if (v84) { - x85 = v83; - push_resource(x71); - lpush(&lbl_docZ_length, MKI64(x73)); - push_value(x72); - } else { - x85 = ((int64_t)v82); - push_resource(x71); - lpush(&lbl_docZ_length, MKI64(x73)); - push_value(x72); - } - int64_t v86 = VI64(lpop(&lbl_docZ_length)); - int64_t v87 = 3LL; - int64_t v88 = i64_add(v86, v87); - int64_t v89 = i64_add(x85, v88); - VAL v90 = pop_value(); - x80 = v90; - x79 = v89; - VAL r91 = pop_resource(); - x78 = r91; + VAL v30 = mtp_std_maybe_Maybe_1_Some(v28); + uint64_t v31 = str_size(VSTR(v30)); + int64_t v32 = 3LL; + int64_t v33 = i64_add(x24, v32); + int64_t v34 = i64_add(((int64_t)v31), v33); + x29 = v34; } break; case 0LL: { // None - x80 = x72; - x79 = x73; - x78 = x71; + x29 = x24; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v92 = VVAL(VTUP(x80)->cells[3]); - incref(v92); - decref(x80); - VAL x93; - int64_t x94; - switch (get_data_tag(v92)) { + VAL v35 = VVAL(VTUP(x23)->cells[3]); + incref(v35); + decref(x23); + int64_t x36; + switch (get_data_tag(v35)) { case 1LL: { // Some - VAL v95 = mtp_std_maybe_Maybe_1_Some(v92); - uint64_t v96 = str_size(VSTR(v95)); - int64_t v97 = 0LL; - bool v98 = (((int64_t)v96) < v97); - int64_t x99; - if (v98) { - x99 = v97; - push_resource(x78); - lpush(&lbl_docZ_length, MKI64(x79)); - } else { - x99 = ((int64_t)v96); - push_resource(x78); - lpush(&lbl_docZ_length, MKI64(x79)); - } - int64_t v100 = VI64(lpop(&lbl_docZ_length)); - int64_t v101 = 1LL; - int64_t v102 = i64_add(v100, v101); - int64_t v103 = i64_add(x99, v102); - x94 = v103; - VAL r104 = pop_resource(); - x93 = r104; + VAL v37 = mtp_std_maybe_Maybe_1_Some(v35); + uint64_t v38 = str_size(VSTR(v37)); + int64_t v39 = 1LL; + int64_t v40 = i64_add(x29, v39); + int64_t v41 = i64_add(((int64_t)v38), v40); + x36 = v41; } break; case 0LL: { // None - x94 = x79; - x93 = x78; + x36 = x29; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v105 = VVAL(VTUP(x93)->cells[2]); - incref(v105); - int64_t v106 = VI64(VTUP(v105)->cells[5]); - decref(v105); - bool v107 = (x94 > v106); - VAL x108; - if (v107) { - VAL v109 = VVAL(VTUP(x93)->cells[2]); - incref(v109); - VAL v110 = tup_replace(v109, 5, MKI64(x94)); - VAL v111 = VTUP(x93)->cells[2]; - decref(v111); - VTUP(x93)->cells[2] = v110; - x108 = x93; + VAL v42 = VVAL(VTUP(x22)->cells[2]); + incref(v42); + int64_t v43 = VI64(VTUP(v42)->cells[5]); + decref(v42); + bool v44 = (x36 > v43); + VAL x45; + if (v44) { + VAL v46 = VVAL(VTUP(x22)->cells[2]); + incref(v46); + VAL v47 = tup_replace(v46, 5, MKI64(x36)); + VAL v48 = VTUP(x22)->cells[2]; + decref(v48); + VTUP(x22)->cells[2] = v47; + x45 = x22; } else { - x108 = x93; + x45 = x22; } - int64_t v112 = 1LL /* True */; - x67 = v112; - x66 = v64; - x65 = x108; + int64_t v49 = 1LL /* True */; + x17 = v49; + x16 = v19; + x15 = x45; } break; - case 0LL: { // None - int64_t v113 = 0LL /* False */; - x67 = v113; - x66 = v64; - x65 = v61; + case 0LL: { // Nil + VAL v50 = MKI64(0LL /* Nil */); + int64_t v51 = 0LL /* False */; + x17 = v51; + x16 = v50; + x15 = v12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v60 = x67; - v59 = x66; - v58 = x65; + v11 = x17; + v10 = x17; + v9 = x16; + v8 = x15; } - decref(v59); - VAL v114 = VVAL(VTUP(v58)->cells[2]); - incref(v114); - VAL v115 = mw_argZ_parser_state_State_1_argv(v114); - VAL v116; - VAL v117; - mw_std_list_List_1_uncons(v115, &v116, &v117); - VAL x118; - VAL x119; - int64_t x120; - switch (get_data_tag(v116)) { - case 1LL: { // Some - VAL v121 = mtp_std_maybe_Maybe_1_Some(v116); - incref(v121); - uint64_t v122 = str_size(VSTR(v121)); - int64_t v123 = 0LL; - bool v124 = (((int64_t)v122) < v123); - int64_t x125; - if (v124) { - x125 = v123; - push_resource(v58); - push_value(v121); - } else { - x125 = ((int64_t)v122); - push_resource(v58); - push_value(v121); - } - int64_t v126 = 1LL; - bool v127 = (x125 > v126); - VAL x128; - VAL x129; - if (v127) { - int64_t v130 = 0LL; - VAL v131 = pop_value(); - incref(v131); - int64_t v132 = mw_std_prim_Str_byteZAt(v130, v131); - int64_t v133 = 45LL /* B'-' */; - bool v134 = (v132 == v133); - VAL x135; - VAL x136; - if (v134) { - VAL r137 = pop_resource(); - VAL v138 = VVAL(VTUP(r137)->cells[2]); - incref(v138); - int64_t v139 = mw_argZ_parser_state_State_1_parsingZAsk(v138); - VAL x140; - VAL x141; - if (((bool)v139)) { - decref(v131); - VAL v142 = VVAL(VTUP(r137)->cells[2]); - incref(v142); - VAL v143 = mw_argZ_parser_state_State_1_optionZ_option(v142); - VAL x144; - VAL x145; - switch (get_data_tag(v143)) { - case 1LL: { // Some - VAL v146 = mtp_std_maybe_Maybe_1_Some(v143); - VAL v147 = VVAL(VTUP(v146)->cells[3]); - incref(v147); - decref(v146); - VAL x148; - VAL x149; - switch (get_data_tag(v147)) { - case 1LL: { // Some - VAL v150 = mtp_std_maybe_Maybe_1_Some(v147); - decref(v150); - VAL v151 = MKI64(0LL /* MissingArgValue */); - VAL v152 = mtw_std_maybe_Maybe_1_Some(v151); - x149 = v152; - x148 = r137; - } break; - case 0LL: { // None - int64_t v153 = 0LL /* False */; - VAL v154 = VVAL(VTUP(r137)->cells[2]); - incref(v154); - VAL v155 = mw_argZ_parser_state_State_1_parsingZAskZBang(v153, v154); - VAL v156 = VTUP(r137)->cells[2]; - decref(v156); - VTUP(r137)->cells[2] = v155; - VAL v157 = MKI64(0LL /* None */); - x149 = v157; - x148 = r137; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x145 = x149; - x144 = x148; - } break; - case 0LL: { // None - VAL v158 = MKI64(0LL /* MissingArgValue */); - VAL v159 = mtw_std_maybe_Maybe_1_Some(v158); - x145 = v159; - x144 = r137; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x141 = x145; - x140 = x144; - } else { - VAL v160; - VAL v161; - mw_argZ_parser_parse_parseZ_flags(r137, v131, &v160, &v161); - x141 = v161; - x140 = v160; - } - x136 = x141; - x135 = x140; - } else { - VAL r162 = pop_resource(); - VAL v163 = VVAL(VTUP(r162)->cells[2]); - incref(v163); - int64_t v164 = mw_argZ_parser_state_State_1_parsingZAsk(v163); - VAL x165; - VAL x166; - if (((bool)v164)) { - VAL v167 = VVAL(VTUP(r162)->cells[2]); - incref(v167); - VAL v168 = mw_argZ_parser_state_State_1_optionZ_option(v167); - VAL x169; - VAL x170; - switch (get_data_tag(v168)) { - case 1LL: { // Some - VAL v171 = mtp_std_maybe_Maybe_1_Some(v168); - incref(v171); - VAL v172 = VVAL(VTUP(v171)->cells[3]); - incref(v172); - decref(v171); - VAL x173; - VAL x174; - switch (get_data_tag(v172)) { - case 1LL: { // Some - VAL v175 = mtp_std_maybe_Maybe_1_Some(v172); - decref(v175); - VAL v176 = VVAL(VTUP(r162)->cells[2]); - incref(v176); - VAL v177 = VVAL(VTUP(v176)->cells[1]); - incref(v177); - decref(v176); - VAL v178 = mtw_std_maybe_Maybe_1_Some(v131); - VAL v179 = VVAL(VTUP(v171)->cells[2]); - incref(v179); - decref(v171); - VAL v180; - VAL v181; - mw_argZ_parser_types_ZPlusArgumentParser_1_parser(r162, &v180, &v181); - push_value(v177); - push_value(v178); - push_value(v179); - push_resource(v180); - run_value(v181); - VAL r182 = pop_resource(); - VAL v183 = VVAL(VTUP(r182)->cells[2]); - incref(v183); - VAL v184 = pop_value(); - VAL v185 = tup_replace(v183, 1, v184); - VAL v186 = VTUP(r182)->cells[2]; - decref(v186); - VTUP(r182)->cells[2] = v185; - VAL v187 = MKI64(0LL /* None */); - x174 = v187; - x173 = r182; - } break; - case 0LL: { // None - decref(v171); - decref(v131); - VAL v188 = MKI64(4LL /* UnknownArg */); - VAL v189 = mtw_std_maybe_Maybe_1_Some(v188); - x174 = v189; - x173 = r162; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x170 = x174; - x169 = x173; - } break; - case 0LL: { // None - decref(v131); - VAL v190 = MKI64(4LL /* UnknownArg */); - VAL v191 = mtw_std_maybe_Maybe_1_Some(v190); - x170 = v191; - x169 = r162; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v192 = 0LL /* False */; - VAL v193 = VVAL(VTUP(x169)->cells[2]); - incref(v193); - VAL v194 = mw_argZ_parser_state_State_1_parsingZAskZBang(v192, v193); - VAL v195 = VTUP(x169)->cells[2]; - decref(v195); - VTUP(x169)->cells[2] = v194; - x166 = x169; - x165 = x170; - } else { - VAL v196; - VAL v197; - mw_argZ_parser_parse_doZ_positionalZ_option(r162, v131, &v196, &v197); - x166 = v196; - x165 = v197; - } - x136 = x165; - x135 = x166; - } - x129 = x136; - x128 = x135; - } else { - VAL v198 = pop_value(); - decref(v198); - VAL v199 = MKI64(0LL /* None */); - x129 = v199; - VAL r200 = pop_resource(); - x128 = r200; - } - VAL x201; - switch (get_data_tag(x129)) { - case 1LL: { // Some - VAL v202 = mtp_std_maybe_Maybe_1_Some(x129); - VAL v203 = mtw_std_maybe_Maybe_1_Some(v202); - VAL v204 = VVAL(VTUP(x128)->cells[2]); - incref(v204); - VAL v205 = tup_replace(v204, 6, v203); - VAL v206 = VTUP(x128)->cells[2]; - decref(v206); - VTUP(x128)->cells[2] = v205; - x201 = x128; - } break; - case 0LL: { // None - x201 = x128; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v207 = 1LL /* True */; - x120 = v207; - x119 = v117; - x118 = x201; - } break; - case 0LL: { // None - int64_t v208 = 0LL /* False */; - x120 = v208; - x119 = v117; - x118 = v58; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v209 = (x118); - VAL v210 = x119; - int64_t v211 = x120; - while (((bool)v211)) { - VAL v212 = (v209); - VAL v213 = v210; - VAL v214; - VAL v215; - mw_std_list_List_1_uncons(v213, &v214, &v215); - VAL x216; - VAL x217; - int64_t x218; - switch (get_data_tag(v214)) { - case 1LL: { // Some - VAL v219 = mtp_std_maybe_Maybe_1_Some(v214); - incref(v219); - uint64_t v220 = str_size(VSTR(v219)); - int64_t v221 = 0LL; - bool v222 = (((int64_t)v220) < v221); - int64_t x223; - if (v222) { - x223 = v221; - push_resource(v212); - push_value(v219); - } else { - x223 = ((int64_t)v220); - push_resource(v212); - push_value(v219); - } - int64_t v224 = 1LL; - bool v225 = (x223 > v224); - VAL x226; - VAL x227; - if (v225) { - int64_t v228 = 0LL; - VAL v229 = pop_value(); - incref(v229); - int64_t v230 = mw_std_prim_Str_byteZAt(v228, v229); - int64_t v231 = 45LL /* B'-' */; - bool v232 = (v230 == v231); - VAL x233; - VAL x234; - if (v232) { - VAL r235 = pop_resource(); - VAL v236 = VVAL(VTUP(r235)->cells[2]); - incref(v236); - int64_t v237 = mw_argZ_parser_state_State_1_parsingZAsk(v236); - VAL x238; - VAL x239; - if (((bool)v237)) { - decref(v229); - VAL v240 = VVAL(VTUP(r235)->cells[2]); - incref(v240); - VAL v241 = mw_argZ_parser_state_State_1_optionZ_option(v240); - VAL x242; - VAL x243; - switch (get_data_tag(v241)) { + decref(v9); + VAL v52 = VVAL(VTUP(v8)->cells[2]); + incref(v52); + VAL v53 = mw_argZ_parser_state_State_1_argv(v52); + int64_t v54 = 1LL /* True */; + VAL v55 = v8; + VAL v56 = v53; + int64_t v57 = v54; + int64_t v58 = v54; + while (((bool)v58)) { + VAL v59 = v55; + VAL v60 = v56; + int64_t v61 = v57; + VAL x62; + VAL x63; + int64_t x64; + switch (get_data_tag(v60)) { + case 1LL: { // Cons + VAL v65; + VAL v66; + mtp_std_list_List_1_Cons(v60, &v65, &v66); + incref(v65); + uint64_t v67 = str_size(VSTR(v65)); + int64_t v68 = 1LL; + bool v69 = (((int64_t)v67) > v68); + VAL x70; + VAL x71; + if (v69) { + int64_t v72 = 0LL; + incref(v65); + int64_t v73 = mw_std_prim_Str_byteZAt(v72, v65); + int64_t v74 = 45LL /* B'-' */; + bool v75 = (v73 == v74); + VAL x76; + VAL x77; + if (v75) { + VAL v78 = VVAL(VTUP(v59)->cells[2]); + incref(v78); + int64_t v79 = mw_argZ_parser_state_State_1_parsingZAsk(v78); + VAL x80; + VAL x81; + if (((bool)v79)) { + decref(v65); + VAL v82 = VVAL(VTUP(v59)->cells[2]); + incref(v82); + VAL v83 = mw_argZ_parser_state_State_1_optionZ_option(v82); + VAL x84; + VAL x85; + switch (get_data_tag(v83)) { case 1LL: { // Some - VAL v244 = mtp_std_maybe_Maybe_1_Some(v241); - VAL v245 = VVAL(VTUP(v244)->cells[3]); - incref(v245); - decref(v244); - VAL x246; - VAL x247; - switch (get_data_tag(v245)) { + VAL v86 = mtp_std_maybe_Maybe_1_Some(v83); + VAL v87 = VVAL(VTUP(v86)->cells[3]); + incref(v87); + decref(v86); + VAL x88; + VAL x89; + switch (get_data_tag(v87)) { case 1LL: { // Some - VAL v248 = mtp_std_maybe_Maybe_1_Some(v245); - decref(v248); - VAL v249 = MKI64(0LL /* MissingArgValue */); - VAL v250 = mtw_std_maybe_Maybe_1_Some(v249); - x247 = v250; - x246 = r235; + VAL v90 = mtp_std_maybe_Maybe_1_Some(v87); + decref(v90); + VAL v91 = MKI64(0LL /* MissingArgValue */); + VAL v92 = mtw_std_maybe_Maybe_1_Some(v91); + x89 = v92; + x88 = v59; } break; case 0LL: { // None - int64_t v251 = 0LL /* False */; - VAL v252 = VVAL(VTUP(r235)->cells[2]); - incref(v252); - VAL v253 = mw_argZ_parser_state_State_1_parsingZAskZBang(v251, v252); - VAL v254 = VTUP(r235)->cells[2]; - decref(v254); - VTUP(r235)->cells[2] = v253; - VAL v255 = MKI64(0LL /* None */); - x247 = v255; - x246 = r235; + int64_t v93 = 0LL /* False */; + VAL v94 = VVAL(VTUP(v59)->cells[2]); + incref(v94); + VAL v95 = mw_argZ_parser_state_State_1_parsingZAskZBang(v93, v94); + VAL v96 = VTUP(v59)->cells[2]; + decref(v96); + VTUP(v59)->cells[2] = v95; + VAL v97 = MKI64(0LL /* None */); + x89 = v97; + x88 = v59; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x243 = x247; - x242 = x246; + x85 = x89; + x84 = x88; } break; case 0LL: { // None - VAL v256 = MKI64(0LL /* MissingArgValue */); - VAL v257 = mtw_std_maybe_Maybe_1_Some(v256); - x243 = v257; - x242 = r235; + VAL v98 = MKI64(0LL /* MissingArgValue */); + VAL v99 = mtw_std_maybe_Maybe_1_Some(v98); + x85 = v99; + x84 = v59; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x239 = x243; - x238 = x242; + x81 = x85; + x80 = x84; } else { - VAL v258; - VAL v259; - mw_argZ_parser_parse_parseZ_flags(r235, v229, &v258, &v259); - x239 = v259; - x238 = v258; + VAL v100; + VAL v101; + mw_argZ_parser_parse_parseZ_flags(v59, v65, &v100, &v101); + x81 = v101; + x80 = v100; } - x234 = x239; - x233 = x238; + x77 = x81; + x76 = x80; } else { - VAL r260 = pop_resource(); - VAL v261 = VVAL(VTUP(r260)->cells[2]); - incref(v261); - int64_t v262 = mw_argZ_parser_state_State_1_parsingZAsk(v261); - VAL x263; - VAL x264; - if (((bool)v262)) { - VAL v265 = VVAL(VTUP(r260)->cells[2]); - incref(v265); - VAL v266 = mw_argZ_parser_state_State_1_optionZ_option(v265); - VAL x267; - VAL x268; - switch (get_data_tag(v266)) { + VAL v102 = VVAL(VTUP(v59)->cells[2]); + incref(v102); + int64_t v103 = mw_argZ_parser_state_State_1_parsingZAsk(v102); + VAL x104; + VAL x105; + if (((bool)v103)) { + VAL v106 = VVAL(VTUP(v59)->cells[2]); + incref(v106); + VAL v107 = mw_argZ_parser_state_State_1_optionZ_option(v106); + VAL x108; + VAL x109; + switch (get_data_tag(v107)) { case 1LL: { // Some - VAL v269 = mtp_std_maybe_Maybe_1_Some(v266); - incref(v269); - VAL v270 = VVAL(VTUP(v269)->cells[3]); - incref(v270); - decref(v269); - VAL x271; - VAL x272; - switch (get_data_tag(v270)) { + VAL v110 = mtp_std_maybe_Maybe_1_Some(v107); + incref(v110); + VAL v111 = VVAL(VTUP(v110)->cells[3]); + incref(v111); + decref(v110); + VAL x112; + VAL x113; + switch (get_data_tag(v111)) { case 1LL: { // Some - VAL v273 = mtp_std_maybe_Maybe_1_Some(v270); - decref(v273); - VAL v274 = VVAL(VTUP(r260)->cells[2]); - incref(v274); - VAL v275 = VVAL(VTUP(v274)->cells[1]); - incref(v275); - decref(v274); - VAL v276 = mtw_std_maybe_Maybe_1_Some(v229); - VAL v277 = VVAL(VTUP(v269)->cells[2]); - incref(v277); - decref(v269); - VAL v278; - VAL v279; - mw_argZ_parser_types_ZPlusArgumentParser_1_parser(r260, &v278, &v279); - push_value(v275); - push_value(v276); - push_value(v277); - push_resource(v278); - run_value(v279); - VAL r280 = pop_resource(); - VAL v281 = VVAL(VTUP(r280)->cells[2]); - incref(v281); - VAL v282 = pop_value(); - VAL v283 = tup_replace(v281, 1, v282); - VAL v284 = VTUP(r280)->cells[2]; - decref(v284); - VTUP(r280)->cells[2] = v283; - VAL v285 = MKI64(0LL /* None */); - x272 = v285; - x271 = r280; + VAL v114 = mtp_std_maybe_Maybe_1_Some(v111); + decref(v114); + VAL v115 = VVAL(VTUP(v59)->cells[2]); + incref(v115); + VAL v116 = VVAL(VTUP(v115)->cells[1]); + incref(v116); + decref(v115); + VAL v117 = mtw_std_maybe_Maybe_1_Some(v65); + VAL v118 = VVAL(VTUP(v110)->cells[2]); + incref(v118); + decref(v110); + VAL v119; + VAL v120; + mw_argZ_parser_types_ZPlusArgumentParser_1_parser(v59, &v119, &v120); + push_value(v116); + push_value(v117); + push_value(v118); + push_resource(v119); + run_value(v120); + VAL r121 = pop_resource(); + VAL v122 = pop_value(); + VAL v123 = VVAL(VTUP(r121)->cells[2]); + incref(v123); + VAL v124 = tup_replace(v123, 1, v122); + VAL v125 = VTUP(r121)->cells[2]; + decref(v125); + VTUP(r121)->cells[2] = v124; + VAL v126 = MKI64(0LL /* None */); + x113 = v126; + x112 = r121; } break; case 0LL: { // None - decref(v269); - decref(v229); - VAL v286 = MKI64(4LL /* UnknownArg */); - VAL v287 = mtw_std_maybe_Maybe_1_Some(v286); - x272 = v287; - x271 = r260; + decref(v110); + decref(v65); + VAL v127 = MKI64(4LL /* UnknownArg */); + VAL v128 = mtw_std_maybe_Maybe_1_Some(v127); + x113 = v128; + x112 = v59; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x268 = x272; - x267 = x271; + x109 = x113; + x108 = x112; } break; case 0LL: { // None - decref(v229); - VAL v288 = MKI64(4LL /* UnknownArg */); - VAL v289 = mtw_std_maybe_Maybe_1_Some(v288); - x268 = v289; - x267 = r260; + decref(v65); + VAL v129 = MKI64(4LL /* UnknownArg */); + VAL v130 = mtw_std_maybe_Maybe_1_Some(v129); + x109 = v130; + x108 = v59; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v290 = 0LL /* False */; - VAL v291 = VVAL(VTUP(x267)->cells[2]); - incref(v291); - VAL v292 = mw_argZ_parser_state_State_1_parsingZAskZBang(v290, v291); - VAL v293 = VTUP(x267)->cells[2]; - decref(v293); - VTUP(x267)->cells[2] = v292; - x264 = x267; - x263 = x268; + int64_t v131 = 0LL /* False */; + VAL v132 = VVAL(VTUP(x108)->cells[2]); + incref(v132); + VAL v133 = mw_argZ_parser_state_State_1_parsingZAskZBang(v131, v132); + VAL v134 = VTUP(x108)->cells[2]; + decref(v134); + VTUP(x108)->cells[2] = v133; + x105 = x108; + x104 = x109; } else { - VAL v294; - VAL v295; - mw_argZ_parser_parse_doZ_positionalZ_option(r260, v229, &v294, &v295); - x264 = v294; - x263 = v295; + VAL v135; + VAL v136; + mw_argZ_parser_parse_doZ_positionalZ_option(v59, v65, &v135, &v136); + x105 = v135; + x104 = v136; } - x234 = x263; - x233 = x264; + x77 = x104; + x76 = x105; } - x227 = x234; - x226 = x233; + x71 = x77; + x70 = x76; } else { - VAL v296 = pop_value(); - decref(v296); - VAL v297 = MKI64(0LL /* None */); - x227 = v297; - VAL r298 = pop_resource(); - x226 = r298; + decref(v65); + VAL v137 = MKI64(0LL /* None */); + x71 = v137; + x70 = v59; } - VAL x299; - switch (get_data_tag(x227)) { + VAL x138; + switch (get_data_tag(x71)) { case 1LL: { // Some - VAL v300 = mtp_std_maybe_Maybe_1_Some(x227); - VAL v301 = mtw_std_maybe_Maybe_1_Some(v300); - VAL v302 = VVAL(VTUP(x226)->cells[2]); - incref(v302); - VAL v303 = tup_replace(v302, 6, v301); - VAL v304 = VTUP(x226)->cells[2]; - decref(v304); - VTUP(x226)->cells[2] = v303; - x299 = x226; + VAL v139 = mtp_std_maybe_Maybe_1_Some(x71); + VAL v140 = mtw_std_maybe_Maybe_1_Some(v139); + VAL v141 = VVAL(VTUP(x70)->cells[2]); + incref(v141); + VAL v142 = tup_replace(v141, 6, v140); + VAL v143 = VTUP(x70)->cells[2]; + decref(v143); + VTUP(x70)->cells[2] = v142; + x138 = x70; } break; case 0LL: { // None - x299 = x226; + x138 = x70; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v305 = 1LL /* True */; - x218 = v305; - x217 = v215; - x216 = x299; + int64_t v144 = 1LL /* True */; + x64 = v144; + x63 = v66; + x62 = x138; } break; - case 0LL: { // None - int64_t v306 = 0LL /* False */; - x218 = v306; - x217 = v215; - x216 = v212; + case 0LL: { // Nil + VAL v145 = MKI64(0LL /* Nil */); + int64_t v146 = 0LL /* False */; + x64 = v146; + x63 = v145; + x62 = v59; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v211 = x218; - v210 = x217; - v209 = x216; + v58 = x64; + v57 = x64; + v56 = x63; + v55 = x62; } - decref(v210); - VAL v307 = VVAL(VTUP(v209)->cells[2]); - incref(v307); - int64_t v308 = mw_argZ_parser_state_State_1_parsingZAsk(v307); - VAL x309; - if (((bool)v308)) { - VAL v310 = MKI64(0LL /* MissingArgValue */); - VAL v311 = mtw_std_maybe_Maybe_1_Some(v310); - VAL v312 = VVAL(VTUP(v209)->cells[2]); - incref(v312); - VAL v313 = tup_replace(v312, 6, v311); - VAL v314 = VTUP(v209)->cells[2]; - decref(v314); - VTUP(v209)->cells[2] = v313; - x309 = v209; + decref(v56); + VAL v147 = VVAL(VTUP(v55)->cells[2]); + incref(v147); + int64_t v148 = mw_argZ_parser_state_State_1_parsingZAsk(v147); + VAL x149; + if (((bool)v148)) { + VAL v150 = MKI64(0LL /* MissingArgValue */); + VAL v151 = mtw_std_maybe_Maybe_1_Some(v150); + VAL v152 = VVAL(VTUP(v55)->cells[2]); + incref(v152); + VAL v153 = tup_replace(v152, 6, v151); + VAL v154 = VTUP(v55)->cells[2]; + decref(v154); + VTUP(v55)->cells[2] = v153; + x149 = v55; } else { - x309 = v209; - } - VAL v315 = VVAL(VTUP(x309)->cells[2]); - incref(v315); - VAL v316 = VVAL(VTUP(v315)->cells[1]); - incref(v316); - decref(v315); - VAL v317 = MKI64(0LL /* None */); - VAL v318 = MKI64(3LL /* End */); - VAL v319; - VAL v320; - mw_argZ_parser_types_ZPlusArgumentParser_1_parser(x309, &v319, &v320); - push_value(v316); - push_value(v317); - push_value(v318); - push_resource(v319); - run_value(v320); - VAL r321 = pop_resource(); - VAL v322 = VVAL(VTUP(r321)->cells[2]); - incref(v322); - VAL v323 = pop_value(); - VAL v324 = tup_replace(v322, 1, v323); - VAL v325 = VTUP(r321)->cells[2]; - decref(v325); - VTUP(r321)->cells[2] = v324; - VAL v326 = VVAL(VTUP(r321)->cells[2]); - incref(v326); - VAL v327 = VVAL(VTUP(v326)->cells[1]); - incref(v327); - decref(v326); - VAL v328 = VVAL(VTUP(r321)->cells[2]); - incref(v328); - VAL v329 = VVAL(VTUP(v328)->cells[6]); - incref(v329); - decref(v328); - VAL x330; - VAL x331; - switch (get_data_tag(v329)) { + x149 = v55; + } + VAL v155 = VVAL(VTUP(x149)->cells[2]); + incref(v155); + VAL v156 = VVAL(VTUP(v155)->cells[1]); + incref(v156); + decref(v155); + VAL v157 = MKI64(0LL /* None */); + VAL v158 = MKI64(3LL /* End */); + VAL v159; + VAL v160; + mw_argZ_parser_types_ZPlusArgumentParser_1_parser(x149, &v159, &v160); + push_value(v156); + push_value(v157); + push_value(v158); + push_resource(v159); + run_value(v160); + VAL r161 = pop_resource(); + VAL v162 = pop_value(); + VAL v163 = VVAL(VTUP(r161)->cells[2]); + incref(v163); + VAL v164 = tup_replace(v163, 1, v162); + VAL v165 = VTUP(r161)->cells[2]; + decref(v165); + VTUP(r161)->cells[2] = v164; + VAL v166 = VVAL(VTUP(r161)->cells[2]); + incref(v166); + VAL v167 = VVAL(VTUP(v166)->cells[1]); + incref(v167); + decref(v166); + VAL v168 = VVAL(VTUP(r161)->cells[2]); + incref(v168); + VAL v169 = VVAL(VTUP(v168)->cells[6]); + incref(v169); + decref(v168); + VAL x170; + VAL x171; + switch (get_data_tag(v169)) { case 1LL: { // Some - VAL v332 = mtp_std_maybe_Maybe_1_Some(v329); - VAL v333; - VAL v334; - mw_argZ_parser_types_ZPlusArgumentParser_1_usage(r321, &v333, &v334); - VAL v335 = MKNIL; - VAL v336 = mkcons(v335, v332); - VAL v337 = mkcons(v336, v334); - VAL v338 = mtw_std_either_Either_2_Left(v337); - decref(v327); - x331 = v338; - x330 = v333; + VAL v172 = mtp_std_maybe_Maybe_1_Some(v169); + VAL v173; + VAL v174; + mw_argZ_parser_types_ZPlusArgumentParser_1_usage(r161, &v173, &v174); + VAL v175 = MKNIL; + VAL v176 = mkcons(v175, v172); + VAL v177 = mkcons(v176, v174); + VAL v178 = mtw_std_either_Either_2_Left(v177); + decref(v167); + x171 = v178; + x170 = v173; } break; case 0LL: { // None - VAL v339 = mtw_std_either_Either_2_Right(v327); - x331 = v339; - x330 = r321; + VAL v179 = mtw_std_either_Either_2_Right(v167); + x171 = v179; + x170 = r161; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - mw_argZ_parser_types_ZPlusArgumentParser_1_rdrop(x330); - return x331; + mw_argZ_parser_types_ZPlusArgumentParser_1_rdrop(x170); + return x171; } static void mw_argZ_parser_parse_readZ_fromZ_argv (int64_t x1, int64_t x2, VAL *x3, int64_t *x4) { int64_t v5 = 0LL; bool v6 = (x2 < v5); - VAL x7; - int64_t x8; + int64_t x7; + VAL x8; if (v6) { STR* v9; STRLIT(v9, "", 0); - x8 = x1; - x7 = MKSTR(v9); + x8 = MKSTR(v9); + x7 = x1; } else { uint64_t v10 = sizeof(void*); int64_t v11 = 0LL; - bool v12 = (((int64_t)v10) < v11); - int64_t x13; - if (v12) { - x13 = v11; - push_resource(MKI64(x1)); - push_i64(x2); - } else { - x13 = ((int64_t)v10); - push_resource(MKI64(x1)); - push_i64(x2); - } - int64_t v14 = pop_i64(); - int64_t v15 = i64_mul(v14, x13); - void* v16 = global_argv; - void* v17 = (void*)(v15 + (char*)v16); - void* v18 = *(void**)v17; - int64_t r19 = VI64(pop_resource()); - int64_t v20; - int64_t v21; - mext_std_ctypes_CStr_numZ_bytes(r19, v18, &v20, &v21); - STR* v22 = str_make(v18, ((uint64_t)v21)); - x8 = v20; - x7 = MKSTR(v22); + int64_t v12 = mw_std_prim_Int_max(((int64_t)v10), v11); + int64_t v13 = i64_mul(x2, v12); + void* v14 = global_argv; + void* v15 = (void*)(v13 + (char*)v14); + void* v16 = *(void**)v15; + int64_t v17; + int64_t v18; + mext_std_ctypes_CStr_numZ_bytes(x1, v16, &v17, &v18); + STR* v19 = str_make(v16, ((uint64_t)v18)); + x8 = MKSTR(v19); + x7 = v17; } - *x4 = x8; - *x3 = x7; + *x4 = x7; + *x3 = x8; } static VAL mw_argZ_parser_parse_argvZ_toZ_str (void) { int64_t v1 = 1LL; @@ -12652,77 +11172,52 @@ static VAL mw_argZ_parser_parse_argvZ_toZ_str (void) { VAL v5 = mw_std_prim_Int_range(v1, v4); VAL v6 = MKI64(0LL /* Nil */); VAL v7 = mw_std_list_List_1_reverse(v6); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v5, &v8, &v9); - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v8); - int64_t v14 = (0LL /* +Unsafe */); - VAL v15; - int64_t v16; - mw_argZ_parser_parse_readZ_fromZ_argv(v14, VI64(v13), &v15, &v16); - VAL v17 = mtw_std_list_List_1_Cons(v15, v7); - int64_t v18 = 1LL /* True */; - x12 = v18; - x11 = v9; - x10 = v17; - } break; - case 0LL: { // None - int64_t v19 = 0LL /* False */; - x12 = v19; - x11 = v9; - x10 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v20 = (x10); - VAL v21 = x11; - int64_t v22 = x12; - while (((bool)v22)) { - VAL v23 = (v20); - VAL v24 = v21; - VAL v25; - VAL v26; - mw_std_list_List_1_uncons(v24, &v25, &v26); - VAL x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v25)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v25); - int64_t v31 = (0LL /* +Unsafe */); - VAL v32; - int64_t v33; - mw_argZ_parser_parse_readZ_fromZ_argv(v31, VI64(v30), &v32, &v33); - VAL v34 = mtw_std_list_List_1_Cons(v32, v23); - int64_t v35 = 1LL /* True */; - x29 = v35; - x28 = v26; - x27 = v34; + int64_t v8 = 1LL /* True */; + VAL v9 = v7; + VAL v10 = v5; + int64_t v11 = v8; + int64_t v12 = v8; + while (((bool)v12)) { + VAL v13 = v9; + VAL v14 = v10; + int64_t v15 = v11; + VAL x16; + VAL x17; + int64_t x18; + switch (get_data_tag(v14)) { + case 1LL: { // Cons + VAL v19; + VAL v20; + mtp_std_list_List_1_Cons(v14, &v19, &v20); + int64_t v21 = 0LL /* +Unsafe */; + VAL v22; + int64_t v23; + mw_argZ_parser_parse_readZ_fromZ_argv(v21, VI64(v19), &v22, &v23); + VAL v24 = mtw_std_list_List_1_Cons(v22, v13); + int64_t v25 = 1LL /* True */; + x18 = v25; + x17 = v20; + x16 = v24; } break; - case 0LL: { // None - int64_t v36 = 0LL /* False */; - x29 = v36; - x28 = v26; - x27 = v23; + case 0LL: { // Nil + VAL v26 = MKI64(0LL /* Nil */); + int64_t v27 = 0LL /* False */; + x18 = v27; + x17 = v26; + x16 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v22 = x29; - v21 = x28; - v20 = x27; + v12 = x18; + v11 = x18; + v10 = x17; + v9 = x16; } - decref(v21); - VAL v37 = mw_std_list_List_1_reverse(v20); - return v37; + decref(v10); + VAL v28 = mw_std_list_List_1_reverse(v9); + return v28; } static int64_t mw_mirth_label_Label_index (uint64_t x1) { return ((int64_t)x1); @@ -12805,16 +11300,10 @@ static VAL mw_mirth_var_Var_autoZ_runZAsk (uint64_t x1) { VAL v3 = mut_get(v2); return v3; } -static int64_t mw_mirth_var_Var_ZEqualZEqual (uint64_t x1, uint64_t x2) { - int64_t v3 = mw_mirth_var_Var_index(x1); - int64_t v4 = mw_mirth_var_Var_index(x2); - bool v5 = (v3 == v4); - return ((int64_t)v5); -} static VAL mw_mirth_var_Var_typeZThen (VAL x1, uint64_t x2) { uint64_t v3 = mw_mirth_var_Var_name(x2); VAL v4 = mw_mirth_name_Name_ZToStr(v3); - VAL v5 = (mw_std_str_ZPlusStr_pushZ_strZBang(v4, x1)); + VAL v5 = mw_std_str_ZPlusStr_pushZ_strZBang(v4, x1); return v5; } static int64_t mw_mirth_var_Var_isZ_stackZAsk (uint64_t x1) { @@ -12885,11 +11374,8 @@ static VAL mw_mirth_var_Ctx2 (uint64_t x1, uint64_t x2) { return v5; } static VAL mw_mirth_var_Ctx3 (uint64_t x1, uint64_t x2, uint64_t x3) { - VAL v4 = MKI64(0LL /* Nil */); - VAL v5 = mtw_std_list_List_1_Cons(MKU64(x3), v4); - VAL v6 = mtw_std_list_List_1_Cons(MKU64(x2), v5); - VAL v7 = mtw_std_list_List_1_Cons(MKU64(x1), v6); - return v7; + VAL v4 = mw_std_list_L3(MKU64(x1), MKU64(x2), MKU64(x3)); + return v4; } static VAL mw_mirth_var_Ctx_new (VAL x1, uint64_t x2) { VAL v3 = mw_mirth_var_Ctx_ZToList(x1); @@ -12903,231 +11389,141 @@ static VAL mw_mirth_var_Ctx_lookup (uint64_t x1, VAL x2) { VAL v3 = mw_mirth_var_Ctx_ZToList(x2); VAL v4 = mw_std_list_List_1_reverse(v3); VAL v5 = MKI64(0LL /* None */); - VAL v6; - VAL v7; - mw_std_list_List_1_uncons(v4, &v6, &v7); - uint64_t x8; - VAL x9; - VAL x10; - int64_t x11; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v6); - incref(v12); - uint64_t v13 = mw_mirth_var_Var_name(VU64(v12)); - int64_t v14 = mw_mirth_name_Name_ZEqualZEqual(x1, v13); - uint64_t x15; - VAL x16; - if (((bool)v14)) { - VAL v17 = mtw_std_maybe_Maybe_1_Some(v12); - x16 = v17; - x15 = x1; - } else { - decref(v12); - VAL v18 = MKI64(0LL /* None */); - x16 = v18; - x15 = x1; - } - uint64_t x19; - VAL x20; - VAL x21; - switch (get_data_tag(x16)) { - case 0LL: { // None - x21 = v7; - x20 = v5; - x19 = x15; - } break; - default: { - decref(v7); - decref(v5); - VAL v22 = MKI64(0LL /* Nil */); - x21 = v22; - x20 = x16; - x19 = x15; - } break; - } - int64_t v23 = 1LL /* True */; - x11 = v23; - x10 = x21; - x9 = x20; - x8 = x19; - } break; - case 0LL: { // None - int64_t v24 = 0LL /* False */; - x11 = v24; - x10 = v7; - x9 = v5; - x8 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v25 = x8; - VAL v26 = x9; - VAL v27 = x10; - int64_t v28 = x11; - while (((bool)v28)) { - uint64_t v29 = v25; - VAL v30 = v26; - VAL v31 = v27; - VAL v32; - VAL v33; - mw_std_list_List_1_uncons(v31, &v32, &v33); - uint64_t x34; - VAL x35; - VAL x36; - int64_t x37; - switch (get_data_tag(v32)) { + int64_t v6 = 1LL /* True */; + uint64_t v7 = x1; + VAL v8 = v5; + VAL v9 = v4; + int64_t v10 = v6; + int64_t v11 = v6; + while (((bool)v11)) { + uint64_t v12 = v7; + VAL v13 = v8; + VAL v14 = v9; + int64_t v15 = v10; + VAL v16; + VAL v17; + mw_std_list_List_1_uncons(v14, &v16, &v17); + uint64_t x18; + VAL x19; + VAL x20; + int64_t x21; + switch (get_data_tag(v16)) { case 1LL: { // Some - VAL v38 = mtp_std_maybe_Maybe_1_Some(v32); - incref(v38); - uint64_t v39 = mw_mirth_var_Var_name(VU64(v38)); - int64_t v40 = mw_mirth_name_Name_ZEqualZEqual(v29, v39); - uint64_t x41; - VAL x42; - if (((bool)v40)) { - VAL v43 = mtw_std_maybe_Maybe_1_Some(v38); - x42 = v43; - x41 = v29; + VAL v22 = mtp_std_maybe_Maybe_1_Some(v16); + incref(v22); + uint64_t v23 = mw_mirth_var_Var_name(VU64(v22)); + int64_t v24 = mw_mirth_name_Name_ZEqualZEqual(v12, v23); + uint64_t x25; + VAL x26; + if (((bool)v24)) { + VAL v27 = mtw_std_maybe_Maybe_1_Some(v22); + x26 = v27; + x25 = v12; } else { - decref(v38); - VAL v44 = MKI64(0LL /* None */); - x42 = v44; - x41 = v29; + decref(v22); + VAL v28 = MKI64(0LL /* None */); + x26 = v28; + x25 = v12; } - uint64_t x45; - VAL x46; - VAL x47; - switch (get_data_tag(x42)) { + uint64_t x29; + VAL x30; + VAL x31; + switch (get_data_tag(x26)) { case 0LL: { // None - x47 = v33; - x46 = v30; - x45 = x41; + x31 = v17; + x30 = v13; + x29 = x25; } break; default: { - decref(v33); - decref(v30); - VAL v48 = MKI64(0LL /* Nil */); - x47 = v48; - x46 = x42; - x45 = x41; + decref(v17); + decref(v13); + VAL v32 = MKI64(0LL /* Nil */); + x31 = v32; + x30 = x26; + x29 = x25; } break; } - int64_t v49 = 1LL /* True */; - x37 = v49; - x36 = x47; - x35 = x46; - x34 = x45; + int64_t v33 = 1LL /* True */; + x21 = v33; + x20 = x31; + x19 = x30; + x18 = x29; } break; case 0LL: { // None - int64_t v50 = 0LL /* False */; - x37 = v50; - x36 = v33; - x35 = v30; - x34 = v29; + int64_t v34 = 0LL /* False */; + x21 = v34; + x20 = v17; + x19 = v13; + x18 = v12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v28 = x37; - v27 = x36; - v26 = x35; - v25 = x34; + v11 = x21; + v10 = x21; + v9 = x20; + v8 = x19; + v7 = x18; } - decref(v27); - return v26; + decref(v9); + return v8; } static void mw_mirth_var_Ctx_freshZ_nameZBang (VAL x1, VAL *x2, uint64_t *x3) { int64_t v4 = 1LL; STR* v5; STRLIT(v5, "_x1", 3); uint64_t v6 = mw_std_prim_Str_ZToName(MKSTR(v5)); - incref(x1); - VAL v7 = mw_mirth_var_Ctx_lookup(v6, x1); - VAL x8; - VAL x9; - uint64_t x10; - int64_t x11; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v7); - decref(v12); - int64_t v13 = 1LL; - int64_t v14 = i64_add(v4, v13); - STR* v15; - STRLIT(v15, "_x", 2); - STR* v16 = i64_show(v14); - STR* v17 = str_cat(v15, v16); - uint64_t v18 = mw_std_prim_Str_ZToName(MKSTR(v17)); - int64_t v19 = 1LL /* True */; - x11 = v19; - x10 = v18; - x9 = MKI64(v14); - x8 = x1; - } break; - case 0LL: { // None - int64_t v20 = 0LL /* False */; - x11 = v20; - x10 = v6; - x9 = MKI64(v4); - x8 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v21 = x8; - VAL v22 = x9; - uint64_t v23 = x10; - int64_t v24 = x11; - while (((bool)v24)) { - VAL v25 = v21; - VAL v26 = v22; - uint64_t v27 = v23; - incref(v25); - VAL v28 = mw_mirth_var_Ctx_lookup(v27, v25); - VAL x29; - VAL x30; - uint64_t x31; - int64_t x32; - switch (get_data_tag(v28)) { + int64_t v7 = 1LL /* True */; + VAL v8 = x1; + int64_t v9 = v4; + uint64_t v10 = v6; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + VAL v13 = v8; + int64_t v14 = v9; + uint64_t v15 = v10; + int64_t v16 = v11; + incref(v13); + VAL v17 = mw_mirth_var_Ctx_lookup(v15, v13); + int64_t x18; + uint64_t x19; + int64_t x20; + switch (get_data_tag(v17)) { case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v28); - decref(v33); - int64_t v34 = 1LL; - int64_t v35 = i64_add(VI64(v26), v34); - STR* v36; - STRLIT(v36, "_x", 2); - STR* v37 = i64_show(v35); - STR* v38 = str_cat(v36, v37); - uint64_t v39 = mw_std_prim_Str_ZToName(MKSTR(v38)); - int64_t v40 = 1LL /* True */; - x32 = v40; - x31 = v39; - x30 = MKI64(v35); - x29 = v25; + VAL v21 = mtp_std_maybe_Maybe_1_Some(v17); + decref(v21); + int64_t v22 = 1LL; + int64_t v23 = i64_add(v14, v22); + STR* v24; + STRLIT(v24, "_x", 2); + STR* v25 = i64_show(v23); + STR* v26 = str_cat(v24, v25); + uint64_t v27 = mw_std_prim_Str_ZToName(MKSTR(v26)); + int64_t v28 = 1LL /* True */; + x20 = v28; + x19 = v27; + x18 = v23; } break; case 0LL: { // None - int64_t v41 = 0LL /* False */; - x32 = v41; - x31 = v27; - x30 = v26; - x29 = v25; + int64_t v29 = 0LL /* False */; + x20 = v29; + x19 = v15; + x18 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v24 = x32; - v23 = x31; - v22 = x30; - v21 = x29; + v12 = x20; + v11 = x20; + v10 = x19; + v9 = x18; + v8 = v13; } - decref(v22); - *x3 = v23; - *x2 = v21; + *x3 = v10; + *x2 = v8; } static void mw_mirth_var_Ctx_freshZ_stackZ_typeZ_varZBang (VAL x1, VAL *x2, uint64_t *x3) { int64_t v4 = 1LL /* PRIM_TYPE_STACK */; @@ -13157,29 +11553,31 @@ static void mw_mirth_var_Ctx_freshZ_varZBang (VAL x1, VAL x2, VAL *x3, uint64_t *x3 = v8; } static void mw_mirth_var_Var_unifyZBang (VAL x1, uint64_t x2, uint64_t x3, uint64_t x4, VAL *x5, uint64_t *x6, VAL *x7) { - int64_t v8 = mw_mirth_var_Var_ZEqualZEqual(x3, x4); - VAL x9; - uint64_t x10; + int64_t v8 = mw_mirth_var_Var_index(x3); + int64_t v9 = mw_mirth_var_Var_index(x4); + bool v10 = (v8 == v9); VAL x11; - if (((bool)v8)) { - VAL v12 = mtw_mirth_type_Type_TVar(x3); - x11 = v12; - x10 = x2; - x9 = x1; + uint64_t x12; + VAL x13; + if (v10) { + VAL v14 = mtw_mirth_type_Type_TVar(x3); + x13 = v14; + x12 = x2; + x11 = x1; } else { - VAL v13 = mtw_mirth_type_Type_TVar(x3); - VAL v14 = mtw_mirth_type_Type_TVar(x4); - VAL v15; - uint64_t v16; + VAL v15 = mtw_mirth_type_Type_TVar(x3); + VAL v16 = mtw_mirth_type_Type_TVar(x4); VAL v17; - mw_mirth_type_Type_unifyZ_failedZBang(x1, x2, v13, v14, &v15, &v16, &v17); + uint64_t v18; + VAL v19; + mw_mirth_type_Type_unifyZ_failedZBang(x1, x2, v15, v16, &v17, &v18, &v19); + x13 = v19; + x12 = v18; x11 = v17; - x10 = v16; - x9 = v15; } - *x7 = x11; - *x6 = x10; - *x5 = x9; + *x7 = x13; + *x6 = x12; + *x5 = x11; } static void mw_mirth_var_Var_freshen (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { incref(x1); @@ -13245,7 +11643,7 @@ static void mw_mirth_buffer_Buffer_newZBang (VAL x1, uint64_t x2, VAL x3, int64_ void* v10 = mfld_mirth_buffer_Buffer_ZTildehead(v7); mut_set(MKU64(x2), v10); VAL v11 = mtw_mirth_def_Def_DefBuffer(v7); - VAL v12 = (mw_mirth_def_Def_register(x1, v11)); + VAL v12 = mw_mirth_def_Def_register(x1, v11); *x6 = v7; *x5 = v12; } @@ -13264,22 +11662,8 @@ static uint64_t mw_mirth_word_Word_allocZBang (void) { static VAL mw_mirth_word_Word_qnameZ_soft (uint64_t x1) { void* v2 = mfld_mirth_word_Word_ZTildeqname(x1); VAL v3 = mw_std_prelude_ZAtZAsk(v2); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v6 = mw_mirth_mirth_Prop_1_readyZAsk(v5); - x4 = v6; - } break; - case 0LL: { // None - VAL v7 = MKI64(0LL /* None */); - x4 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x4; + VAL v4 = mw_std_maybe_Maybe_1_bind_1_sp5(v3); + return v4; } static void mw_mirth_word_Word_qnameZ_hard (uint64_t x1, VAL x2, VAL *x3, VAL *x4) { void* v5 = mfld_mirth_word_Word_ZTildeqname(x1); @@ -13381,8 +11765,8 @@ static void mw_mirth_word_Word_cname (uint64_t x1, VAL x2, VAL *x3, VAL *x4) { STRLIT(v15, "", 0); STR* v16; STRLIT(v16, "mw_", 3); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), MKSTR(v15))); - VAL v18 = (mw_std_str_ZPlusStr_pushZ_strZBang(v14, v17)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), MKSTR(v15)); + VAL v18 = mw_std_str_ZPlusStr_pushZ_strZBang(v14, v17); incref(v18); mut_set(v18, v5); x9 = v18; @@ -13454,7 +11838,7 @@ static void mw_mirth_word_Word_newZBang (uint64_t x1, VAL x2, uint64_t x3, uint6 void* v14 = mfld_mirth_word_Word_ZTildesigZAsk(v9); mut_set(x2, v14); VAL v15 = mtw_mirth_def_Def_DefWord(v9); - VAL v16 = (mw_mirth_def_Def_register(x6, v15)); + VAL v16 = mw_mirth_def_Def_register(x6, v15); *x8 = v16; *x7 = v9; } @@ -13511,22 +11895,8 @@ static uint64_t mw_mirth_table_Table_head (uint64_t x1) { static VAL mw_mirth_table_Table_qnameZ_soft (uint64_t x1) { void* v2 = mfld_mirth_table_Table_ZTildeqname(x1); VAL v3 = mw_std_prelude_ZAtZAsk(v2); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v6 = mw_mirth_mirth_Prop_1_readyZAsk(v5); - x4 = v6; - } break; - case 0LL: { // None - VAL v7 = MKI64(0LL /* None */); - x4 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x4; + VAL v4 = mw_std_maybe_Maybe_1_bind_1_sp5(v3); + return v4; } static void mw_mirth_table_Table_qnameZ_hard (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { void* v5 = mfld_mirth_table_Table_ZTildeqname(x2); @@ -13577,22 +11947,8 @@ static uint64_t mw_mirth_table_Field_name (uint64_t x1) { static VAL mw_mirth_table_Field_qnameZ_soft (uint64_t x1) { void* v2 = mfld_mirth_table_Field_ZTildeqname(x1); VAL v3 = mw_std_prelude_ZAtZAsk(v2); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v6 = mw_mirth_mirth_Prop_1_readyZAsk(v5); - x4 = v6; - } break; - case 0LL: { // None - VAL v7 = MKI64(0LL /* None */); - x4 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x4; + VAL v4 = mw_std_maybe_Maybe_1_bind_1_sp5(v3); + return v4; } static void mw_mirth_table_Field_qnameZ_hard (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { void* v5 = mfld_mirth_table_Field_ZTildeqname(x2); @@ -13759,60 +12115,57 @@ static void mw_mirth_tycon_Tycon_fullZ_typeZ_fresh (VAL x1, VAL x2, VAL *x3, VAL mw_mirth_data_Data_fullZ_type(x1, v7, &v9, &v10); VAL x11; VAL x12; - VAL x13; switch (get_data_tag(v10)) { case 0LL: { // Left - VAL v14 = mtp_std_either_Either_2_Left(v10); + VAL v13 = mtp_std_either_Either_2_Left(v10); + VAL v14; VAL v15; - VAL v16; - mw_mirth_type_Type_freshen(v8, v14, &v15, &v16); - VAL v17 = mtw_std_either_Either_2_Left(v16); - x13 = v17; - x12 = v15; - x11 = v9; + mw_mirth_type_Type_freshen(v8, v13, &v14, &v15); + VAL v16 = mtw_std_either_Either_2_Left(v15); + x12 = v16; + x11 = v14; } break; case 1LL: { // Right - VAL v18 = mtp_std_either_Either_2_Right(v10); + VAL v17 = mtp_std_either_Either_2_Right(v10); + VAL v18; VAL v19; - VAL v20; - mw_mirth_type_Resource_freshen(v8, v18, &v19, &v20); - VAL v21 = mtw_std_either_Either_2_Right(v20); - x13 = v21; - x12 = v19; - x11 = v9; + mw_mirth_type_Resource_freshen(v8, v17, &v18, &v19); + VAL v20 = mtw_std_either_Either_2_Right(v19); + x12 = v20; + x11 = v18; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - decref(x12); - x6 = x13; - x5 = x11; + decref(x11); + x6 = x12; + x5 = v9; } break; case 2LL: { // TYCON_PRIM - int64_t v22 = mtp_mirth_tycon_Tycon_TYCONz_PRIM(x2); - int64_t v23 = mw_mirth_type_PrimType_isZ_resourceZAsk(v22); + int64_t v21 = mtp_mirth_tycon_Tycon_TYCONz_PRIM(x2); + int64_t v22 = mw_mirth_type_PrimType_isZ_resourceZAsk(v21); + VAL x23; VAL x24; - VAL x25; - if (((bool)v23)) { - VAL v26 = mtw_mirth_type_Type_TPrim(v22); - VAL v27 = mtw_std_either_Either_2_Right(v26); - x25 = v27; - x24 = x1; + if (((bool)v22)) { + VAL v25 = mtw_mirth_type_Type_TPrim(v21); + VAL v26 = mtw_std_either_Either_2_Right(v25); + x24 = v26; + x23 = x1; } else { - VAL v28 = mtw_mirth_type_Type_TPrim(v22); - VAL v29 = mtw_std_either_Either_2_Left(v28); - x25 = v29; - x24 = x1; + VAL v27 = mtw_mirth_type_Type_TPrim(v21); + VAL v28 = mtw_std_either_Either_2_Left(v27); + x24 = v28; + x23 = x1; } - x6 = x25; - x5 = x24; + x6 = x24; + x5 = x23; } break; case 1LL: { // TYCON_TABLE - uint64_t v30 = mtp_mirth_tycon_Tycon_TYCONz_TABLE(x2); - VAL v31 = mtw_mirth_type_Type_TTable(v30); - VAL v32 = mtw_std_either_Either_2_Left(v31); - x6 = v32; + uint64_t v29 = mtp_mirth_tycon_Tycon_TYCONz_TABLE(x2); + VAL v30 = mtw_mirth_type_Type_TTable(v29); + VAL v31 = mtw_std_either_Either_2_Left(v30); + x6 = v31; x5 = x1; } break; default: { @@ -13847,22 +12200,8 @@ static uint64_t mw_mirth_data_Data_name (uint64_t x1) { static VAL mw_mirth_data_Data_qnameZ_soft (uint64_t x1) { void* v2 = mfld_mirth_data_Data_ZTildeqname(x1); VAL v3 = mw_std_prelude_ZAtZAsk(v2); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v6 = mw_mirth_mirth_Prop_1_readyZAsk(v5); - x4 = v6; - } break; - case 0LL: { // None - VAL v7 = MKI64(0LL /* None */); - x4 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x4; + VAL v4 = mw_std_maybe_Maybe_1_bind_1_sp5(v3); + return v4; } static void mw_mirth_data_Data_qnameZ_hard (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { void* v5 = mfld_mirth_data_Data_ZTildeqname(x2); @@ -14004,110 +12343,61 @@ static VAL mw_mirth_data_makeZ_primZ_dataZBang (VAL x1, VAL x2, VAL x3, uint64_t void* v20 = mfld_mirth_data_Data_ZTildectypeZAsk(x4); mut_set(v18, v20); incref(x5); - VAL v21; - VAL v22; - mw_std_list_List_1_uncons(x5, &v21, &v22); - VAL x23; - VAL x24; - uint64_t x25; - VAL x26; - VAL x27; - int64_t x28; - switch (get_data_tag(v21)) { - case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v21); - void* v30 = mfld_mirth_data_Tag_ZTildedata(VU64(v29)); - mut_set(MKU64(x4), v30); - int64_t v31 = 1LL /* True */; - x28 = v31; - x27 = v22; - x26 = x5; - x25 = x4; - x24 = v19; - x23 = x3; - } break; - case 0LL: { // None - int64_t v32 = 0LL /* False */; - x28 = v32; - x27 = v22; - x26 = x5; - x25 = x4; - x24 = v19; - x23 = x3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v33 = x23; - VAL v34 = (x24); - uint64_t v35 = x25; - VAL v36 = x26; - VAL v37 = x27; - int64_t v38 = x28; - while (((bool)v38)) { - VAL v39 = v33; - VAL v40 = (v34); - uint64_t v41 = v35; - VAL v42 = v36; - VAL v43 = v37; - VAL v44; - VAL v45; - mw_std_list_List_1_uncons(v43, &v44, &v45); - VAL x46; - VAL x47; - uint64_t x48; - VAL x49; - VAL x50; - int64_t x51; - switch (get_data_tag(v44)) { - case 1LL: { // Some - VAL v52 = mtp_std_maybe_Maybe_1_Some(v44); - void* v53 = mfld_mirth_data_Tag_ZTildedata(VU64(v52)); - mut_set(MKU64(v41), v53); - int64_t v54 = 1LL /* True */; - x51 = v54; - x50 = v45; - x49 = v42; - x48 = v41; - x47 = v40; - x46 = v39; + int64_t v21 = 1LL /* True */; + uint64_t v22 = x4; + VAL v23 = x5; + int64_t v24 = v21; + int64_t v25 = v21; + while (((bool)v25)) { + uint64_t v26 = v22; + VAL v27 = v23; + int64_t v28 = v24; + uint64_t x29; + VAL x30; + int64_t x31; + switch (get_data_tag(v27)) { + case 1LL: { // Cons + VAL v32; + VAL v33; + mtp_std_list_List_1_Cons(v27, &v32, &v33); + void* v34 = mfld_mirth_data_Tag_ZTildedata(VU64(v32)); + mut_set(MKU64(v26), v34); + int64_t v35 = 1LL /* True */; + x31 = v35; + x30 = v33; + x29 = v26; } break; - case 0LL: { // None - int64_t v55 = 0LL /* False */; - x51 = v55; - x50 = v45; - x49 = v42; - x48 = v41; - x47 = v40; - x46 = v39; + case 0LL: { // Nil + VAL v36 = MKI64(0LL /* Nil */); + int64_t v37 = 0LL /* False */; + x31 = v37; + x30 = v36; + x29 = v26; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v38 = x51; - v37 = x50; - v36 = x49; - v35 = x48; - v34 = x47; - v33 = x46; - } - decref(v37); - void* v56 = mfld_mirth_data_Data_ZTildetags(v35); - mut_set(v36, v56); - VAL v57 = mtw_mirth_mirth_PropLabel_DataParams(v35); - VAL v58; - VAL v59; - mw_mirth_mirth_PropLabel_prop(v33, v57, v34, &v58, &v59); - void* v60 = mfld_mirth_data_Data_ZTildeparams(v35); - mut_set(v58, v60); - VAL v61 = MKI64(0LL /* None */); - void* v62 = mfld_mirth_data_Data_ZTildeheadZAsk(v35); - mut_set(v61, v62); - VAL v63 = mtw_mirth_def_Def_DefData(v35); - VAL v64 = (mw_mirth_def_Def_register(v59, v63)); - return v64; + v25 = x31; + v24 = x31; + v23 = x30; + v22 = x29; + } + decref(v23); + void* v38 = mfld_mirth_data_Data_ZTildetags(v22); + mut_set(x5, v38); + VAL v39 = mtw_mirth_mirth_PropLabel_DataParams(v22); + VAL v40; + VAL v41; + mw_mirth_mirth_PropLabel_prop(x3, v39, v19, &v40, &v41); + void* v42 = mfld_mirth_data_Data_ZTildeparams(v22); + mut_set(v40, v42); + VAL v43 = MKI64(0LL /* None */); + void* v44 = mfld_mirth_data_Data_ZTildeheadZAsk(v22); + mut_set(v43, v44); + VAL v45 = mtw_mirth_def_Def_DefData(v22); + VAL v46 = mw_mirth_def_Def_register(v41, v45); + return v46; } static VAL mw_mirth_data_makeZ_primZ_tagZBang (VAL x1, VAL x2, int64_t x3, VAL x4, uint64_t x5) { uint64_t v6 = mw_mirth_data_Tag_data(x5); @@ -14147,7 +12437,7 @@ static VAL mw_mirth_data_makeZ_primZ_tagZBang (VAL x1, VAL x2, int64_t x3, VAL x void* v31 = mfld_mirth_data_Tag_ZTildectxZ_type(x5); mut_set(v29, v31); VAL v32 = mtw_mirth_def_Def_DefTag(x5); - VAL v33 = (mw_mirth_def_Def_register(v30, v32)); + VAL v33 = mw_mirth_def_Def_register(v30, v32); return v33; } static VAL mw_mirth_data_makeZ_primZ_intlikeZBang (VAL x1, uint64_t x2, VAL x3, uint64_t x4, VAL x5, VAL x6) { @@ -14156,12 +12446,12 @@ static VAL mw_mirth_data_makeZ_primZ_intlikeZBang (VAL x1, uint64_t x2, VAL x3, VAL v9 = mtw_std_list_List_1_Cons(MKU64(x4), v8); VAL v10 = mtw_mirth_type_CType_IntLike(x5); VAL v11 = mtw_std_maybe_Maybe_1_Some(v10); - VAL v12 = (mw_mirth_data_makeZ_primZ_dataZBang(x6, x1, v7, x2, v9, v11)); + VAL v12 = mw_mirth_data_makeZ_primZ_dataZBang(x6, x1, v7, x2, v9, v11); int64_t v13 = 0LL; VAL v14 = mw_mirth_type_TYPEz_INT(); VAL v15 = MKI64(0LL /* Nil */); VAL v16 = mtw_std_list_List_1_Cons(v14, v15); - VAL v17 = (mw_mirth_data_makeZ_primZ_tagZBang(v12, x3, v13, v16, x4)); + VAL v17 = mw_mirth_data_makeZ_primZ_tagZBang(v12, x3, v13, v16, x4); return v17; } static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { @@ -14187,7 +12477,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { STRLIT(v13, "_Bool", 5); VAL v14 = mtw_mirth_type_CType_IntLike(MKSTR(v13)); VAL v15 = mtw_std_maybe_Maybe_1_Some(v14); - VAL v16 = (mw_mirth_data_makeZ_primZ_dataZBang(x1, MKSTR(v2), v3, v5, v12, v15)); + VAL v16 = mw_mirth_data_makeZ_primZ_dataZBang(x1, MKSTR(v2), v3, v5, v12, v15); STR* v17; STRLIT(v17, "False", 5); int64_t v18 = 0LL; @@ -14196,7 +12486,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { incref(v20); uint64_t v21 = VU64(VTUP(v20)->cells[5]); decref(v20); - VAL v22 = (mw_mirth_data_makeZ_primZ_tagZBang(v16, MKSTR(v17), v18, v19, v21)); + VAL v22 = mw_mirth_data_makeZ_primZ_tagZBang(v16, MKSTR(v17), v18, v19, v21); STR* v23; STRLIT(v23, "True", 4); int64_t v24 = 1LL; @@ -14205,7 +12495,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { incref(v26); uint64_t v27 = VU64(VTUP(v26)->cells[4]); decref(v26); - VAL v28 = (mw_mirth_data_makeZ_primZ_tagZBang(v22, MKSTR(v23), v24, v25, v27)); + VAL v28 = mw_mirth_data_makeZ_primZ_tagZBang(v22, MKSTR(v23), v24, v25, v27); VAL v29 = mw_mirth_type_TYPEz_TYPE(); STR* v30; STRLIT(v30, "a", 1); @@ -14226,7 +12516,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { VAL v40 = MKI64(0LL /* Nil */); VAL v41 = mtw_std_list_List_1_Cons(MKU64(v39), v40); VAL v42 = MKI64(0LL /* None */); - VAL v43 = (mw_mirth_data_makeZ_primZ_dataZBang(v28, MKSTR(v33), v35, v37, v41, v42)); + VAL v43 = mw_mirth_data_makeZ_primZ_dataZBang(v28, MKSTR(v33), v35, v37, v41, v42); STR* v44; STRLIT(v44, "CPtr", 4); int64_t v45 = 0LL; @@ -14237,7 +12527,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { incref(v49); uint64_t v50 = VU64(VTUP(v49)->cells[53]); decref(v49); - VAL v51 = (mw_mirth_data_makeZ_primZ_tagZBang(v43, MKSTR(v44), v45, v48, v50)); + VAL v51 = mw_mirth_data_makeZ_primZ_tagZBang(v43, MKSTR(v44), v45, v48, v50); STR* v52; STRLIT(v52, "CConst", 6); VAL v53 = MKI64(0LL /* Nil */); @@ -14253,7 +12543,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { VAL v59 = MKI64(0LL /* Nil */); VAL v60 = mtw_std_list_List_1_Cons(MKU64(v58), v59); VAL v61 = MKI64(0LL /* None */); - VAL v62 = (mw_mirth_data_makeZ_primZ_dataZBang(v51, MKSTR(v52), v54, v56, v60, v61)); + VAL v62 = mw_mirth_data_makeZ_primZ_dataZBang(v51, MKSTR(v52), v54, v56, v60, v61); STR* v63; STRLIT(v63, "CConst", 6); int64_t v64 = 0LL; @@ -14264,7 +12554,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { incref(v68); uint64_t v69 = VU64(VTUP(v68)->cells[55]); decref(v68); - VAL v70 = (mw_mirth_data_makeZ_primZ_tagZBang(v62, MKSTR(v63), v64, v67, v69)); + VAL v70 = mw_mirth_data_makeZ_primZ_tagZBang(v62, MKSTR(v63), v64, v67, v69); STR* v71; STRLIT(v71, "CRestrict", 9); VAL v72 = MKI64(0LL /* Nil */); @@ -14280,7 +12570,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { VAL v78 = MKI64(0LL /* Nil */); VAL v79 = mtw_std_list_List_1_Cons(MKU64(v77), v78); VAL v80 = MKI64(0LL /* None */); - VAL v81 = (mw_mirth_data_makeZ_primZ_dataZBang(v70, MKSTR(v71), v73, v75, v79, v80)); + VAL v81 = mw_mirth_data_makeZ_primZ_dataZBang(v70, MKSTR(v71), v73, v75, v79, v80); STR* v82; STRLIT(v82, "CRestrict", 9); int64_t v83 = 0LL; @@ -14291,7 +12581,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { incref(v87); uint64_t v88 = VU64(VTUP(v87)->cells[57]); decref(v87); - VAL v89 = (mw_mirth_data_makeZ_primZ_tagZBang(v81, MKSTR(v82), v83, v86, v88)); + VAL v89 = mw_mirth_data_makeZ_primZ_tagZBang(v81, MKSTR(v82), v83, v86, v88); STR* v90; STRLIT(v90, "CVolatile", 9); VAL v91 = MKI64(0LL /* Nil */); @@ -14307,7 +12597,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { VAL v97 = MKI64(0LL /* Nil */); VAL v98 = mtw_std_list_List_1_Cons(MKU64(v96), v97); VAL v99 = MKI64(0LL /* None */); - VAL v100 = (mw_mirth_data_makeZ_primZ_dataZBang(v89, MKSTR(v90), v92, v94, v98, v99)); + VAL v100 = mw_mirth_data_makeZ_primZ_dataZBang(v89, MKSTR(v90), v92, v94, v98, v99); STR* v101; STRLIT(v101, "CVolatile", 9); int64_t v102 = 0LL; @@ -14318,7 +12608,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { incref(v106); uint64_t v107 = VU64(VTUP(v106)->cells[59]); decref(v106); - VAL v108 = (mw_mirth_data_makeZ_primZ_tagZBang(v100, MKSTR(v101), v102, v105, v107)); + VAL v108 = mw_mirth_data_makeZ_primZ_tagZBang(v100, MKSTR(v101), v102, v105, v107); STR* v109; STRLIT(v109, "CVoid", 5); VAL v110 = MKI64(0LL /* Nil */); @@ -14334,7 +12624,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { VAL v116 = mtw_std_list_List_1_Cons(MKU64(v114), v115); VAL v117 = MKI64(5LL /* Phantom */); VAL v118 = mtw_std_maybe_Maybe_1_Some(v117); - VAL v119 = (mw_mirth_data_makeZ_primZ_dataZBang(v108, MKSTR(v109), v110, v112, v116, v118)); + VAL v119 = mw_mirth_data_makeZ_primZ_dataZBang(v108, MKSTR(v109), v110, v112, v116, v118); STR* v120; STRLIT(v120, "CVoid", 5); int64_t v121 = 0LL; @@ -14343,7 +12633,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { incref(v123); uint64_t v124 = VU64(VTUP(v123)->cells[61]); decref(v123); - VAL v125 = (mw_mirth_data_makeZ_primZ_tagZBang(v119, MKSTR(v120), v121, v122, v124)); + VAL v125 = mw_mirth_data_makeZ_primZ_tagZBang(v119, MKSTR(v120), v121, v122, v124); STR* v126; STRLIT(v126, "U64", 3); VAL v127 = VVAL(VTUP(v125)->cells[4]); @@ -14358,7 +12648,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v130); STR* v132; STRLIT(v132, "uint64_t", 8); - VAL v133 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v126), v128, MKSTR(v129), v131, MKSTR(v132), v125)); + VAL v133 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v126), v128, MKSTR(v129), v131, MKSTR(v132), v125); STR* v134; STRLIT(v134, "U32", 3); VAL v135 = VVAL(VTUP(v133)->cells[4]); @@ -14373,7 +12663,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v138); STR* v140; STRLIT(v140, "uint32_t", 8); - VAL v141 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v134), v136, MKSTR(v137), v139, MKSTR(v140), v133)); + VAL v141 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v134), v136, MKSTR(v137), v139, MKSTR(v140), v133); STR* v142; STRLIT(v142, "U16", 3); VAL v143 = VVAL(VTUP(v141)->cells[4]); @@ -14388,7 +12678,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v146); STR* v148; STRLIT(v148, "uint16_t", 8); - VAL v149 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v142), v144, MKSTR(v145), v147, MKSTR(v148), v141)); + VAL v149 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v142), v144, MKSTR(v145), v147, MKSTR(v148), v141); STR* v150; STRLIT(v150, "U8", 2); VAL v151 = VVAL(VTUP(v149)->cells[4]); @@ -14403,7 +12693,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v154); STR* v156; STRLIT(v156, "uint8_t", 7); - VAL v157 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v150), v152, MKSTR(v153), v155, MKSTR(v156), v149)); + VAL v157 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v150), v152, MKSTR(v153), v155, MKSTR(v156), v149); STR* v158; STRLIT(v158, "I64", 3); VAL v159 = VVAL(VTUP(v157)->cells[4]); @@ -14418,7 +12708,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v162); STR* v164; STRLIT(v164, "int64_t", 7); - VAL v165 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v158), v160, MKSTR(v161), v163, MKSTR(v164), v157)); + VAL v165 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v158), v160, MKSTR(v161), v163, MKSTR(v164), v157); STR* v166; STRLIT(v166, "I32", 3); VAL v167 = VVAL(VTUP(v165)->cells[4]); @@ -14433,7 +12723,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v170); STR* v172; STRLIT(v172, "int32_t", 7); - VAL v173 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v166), v168, MKSTR(v169), v171, MKSTR(v172), v165)); + VAL v173 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v166), v168, MKSTR(v169), v171, MKSTR(v172), v165); STR* v174; STRLIT(v174, "I16", 3); VAL v175 = VVAL(VTUP(v173)->cells[4]); @@ -14448,7 +12738,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v178); STR* v180; STRLIT(v180, "int16_t", 7); - VAL v181 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v174), v176, MKSTR(v177), v179, MKSTR(v180), v173)); + VAL v181 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v174), v176, MKSTR(v177), v179, MKSTR(v180), v173); STR* v182; STRLIT(v182, "I8", 2); VAL v183 = VVAL(VTUP(v181)->cells[4]); @@ -14463,7 +12753,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v186); STR* v188; STRLIT(v188, "int8_t", 6); - VAL v189 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v182), v184, MKSTR(v185), v187, MKSTR(v188), v181)); + VAL v189 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v182), v184, MKSTR(v185), v187, MKSTR(v188), v181); STR* v190; STRLIT(v190, "CChar", 5); VAL v191 = VVAL(VTUP(v189)->cells[4]); @@ -14478,7 +12768,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v194); STR* v196; STRLIT(v196, "char", 4); - VAL v197 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v190), v192, MKSTR(v193), v195, MKSTR(v196), v189)); + VAL v197 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v190), v192, MKSTR(v193), v195, MKSTR(v196), v189); STR* v198; STRLIT(v198, "CIChar", 6); VAL v199 = VVAL(VTUP(v197)->cells[4]); @@ -14493,7 +12783,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v202); STR* v204; STRLIT(v204, "signed char", 11); - VAL v205 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v198), v200, MKSTR(v201), v203, MKSTR(v204), v197)); + VAL v205 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v198), v200, MKSTR(v201), v203, MKSTR(v204), v197); STR* v206; STRLIT(v206, "CShort", 6); VAL v207 = VVAL(VTUP(v205)->cells[4]); @@ -14508,7 +12798,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v210); STR* v212; STRLIT(v212, "short", 5); - VAL v213 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v206), v208, MKSTR(v209), v211, MKSTR(v212), v205)); + VAL v213 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v206), v208, MKSTR(v209), v211, MKSTR(v212), v205); STR* v214; STRLIT(v214, "CInt", 4); VAL v215 = VVAL(VTUP(v213)->cells[4]); @@ -14523,7 +12813,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v218); STR* v220; STRLIT(v220, "int", 3); - VAL v221 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v214), v216, MKSTR(v217), v219, MKSTR(v220), v213)); + VAL v221 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v214), v216, MKSTR(v217), v219, MKSTR(v220), v213); STR* v222; STRLIT(v222, "CLong", 5); VAL v223 = VVAL(VTUP(v221)->cells[4]); @@ -14538,7 +12828,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v226); STR* v228; STRLIT(v228, "long", 4); - VAL v229 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v222), v224, MKSTR(v225), v227, MKSTR(v228), v221)); + VAL v229 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v222), v224, MKSTR(v225), v227, MKSTR(v228), v221); STR* v230; STRLIT(v230, "CLongLong", 9); VAL v231 = VVAL(VTUP(v229)->cells[4]); @@ -14553,7 +12843,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v234); STR* v236; STRLIT(v236, "long long", 9); - VAL v237 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v230), v232, MKSTR(v233), v235, MKSTR(v236), v229)); + VAL v237 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v230), v232, MKSTR(v233), v235, MKSTR(v236), v229); STR* v238; STRLIT(v238, "CISize", 6); VAL v239 = VVAL(VTUP(v237)->cells[4]); @@ -14568,7 +12858,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v242); STR* v244; STRLIT(v244, "ssize_t", 7); - VAL v245 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v238), v240, MKSTR(v241), v243, MKSTR(v244), v237)); + VAL v245 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v238), v240, MKSTR(v241), v243, MKSTR(v244), v237); STR* v246; STRLIT(v246, "CIntPtr", 7); VAL v247 = VVAL(VTUP(v245)->cells[4]); @@ -14583,7 +12873,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v250); STR* v252; STRLIT(v252, "intptr_t", 8); - VAL v253 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v246), v248, MKSTR(v249), v251, MKSTR(v252), v245)); + VAL v253 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v246), v248, MKSTR(v249), v251, MKSTR(v252), v245); STR* v254; STRLIT(v254, "CUChar", 6); VAL v255 = VVAL(VTUP(v253)->cells[4]); @@ -14598,7 +12888,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v258); STR* v260; STRLIT(v260, "unsigned char", 13); - VAL v261 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v254), v256, MKSTR(v257), v259, MKSTR(v260), v253)); + VAL v261 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v254), v256, MKSTR(v257), v259, MKSTR(v260), v253); STR* v262; STRLIT(v262, "CUShort", 7); VAL v263 = VVAL(VTUP(v261)->cells[4]); @@ -14613,7 +12903,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v266); STR* v268; STRLIT(v268, "unsigned short", 14); - VAL v269 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v262), v264, MKSTR(v265), v267, MKSTR(v268), v261)); + VAL v269 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v262), v264, MKSTR(v265), v267, MKSTR(v268), v261); STR* v270; STRLIT(v270, "CUInt", 5); VAL v271 = VVAL(VTUP(v269)->cells[4]); @@ -14628,7 +12918,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v274); STR* v276; STRLIT(v276, "unsigned int", 12); - VAL v277 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v270), v272, MKSTR(v273), v275, MKSTR(v276), v269)); + VAL v277 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v270), v272, MKSTR(v273), v275, MKSTR(v276), v269); STR* v278; STRLIT(v278, "CULong", 6); VAL v279 = VVAL(VTUP(v277)->cells[4]); @@ -14643,7 +12933,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v282); STR* v284; STRLIT(v284, "unsigned long", 13); - VAL v285 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v278), v280, MKSTR(v281), v283, MKSTR(v284), v277)); + VAL v285 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v278), v280, MKSTR(v281), v283, MKSTR(v284), v277); STR* v286; STRLIT(v286, "CULongLong", 10); VAL v287 = VVAL(VTUP(v285)->cells[4]); @@ -14658,7 +12948,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v290); STR* v292; STRLIT(v292, "unsigned long long", 18); - VAL v293 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v286), v288, MKSTR(v289), v291, MKSTR(v292), v285)); + VAL v293 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v286), v288, MKSTR(v289), v291, MKSTR(v292), v285); STR* v294; STRLIT(v294, "CUSize", 6); VAL v295 = VVAL(VTUP(v293)->cells[4]); @@ -14673,7 +12963,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v298); STR* v300; STRLIT(v300, "size_t", 6); - VAL v301 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v294), v296, MKSTR(v297), v299, MKSTR(v300), v293)); + VAL v301 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v294), v296, MKSTR(v297), v299, MKSTR(v300), v293); STR* v302; STRLIT(v302, "CUIntPtr", 8); VAL v303 = VVAL(VTUP(v301)->cells[4]); @@ -14688,7 +12978,7 @@ static VAL mw_mirth_data_initZ_dataZBang (VAL x1) { decref(v306); STR* v308; STRLIT(v308, "uintptr_t", 9); - VAL v309 = (mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v302), v304, MKSTR(v305), v307, MKSTR(v308), v301)); + VAL v309 = mw_mirth_data_makeZ_primZ_intlikeZBang(MKSTR(v302), v304, MKSTR(v305), v307, MKSTR(v308), v301); return v309; } static VAL mw_mirth_data_dataZ_qname (uint64_t x1, uint64_t x2, int64_t x3) { @@ -14716,322 +13006,176 @@ static int64_t mw_mirth_data_Data_numZ_tags (uint64_t x1) { static VAL mw_mirth_data_Data_addZ_tagZBang (VAL x1, uint64_t x2, uint64_t x3) { void* v4 = mfld_mirth_data_Tag_ZTildevalue(x2); bool v5 = mut_is_set(v4); - VAL x6; - uint64_t x7; - uint64_t x8; - int64_t x9; + uint64_t x6; + int64_t x7; if (v5) { - VAL v10 = mut_get(v4); - x9 = VI64(v10); - x8 = x2; - x7 = x3; - x6 = x1; + VAL v8 = mut_get(v4); + x7 = VI64(v8); + x6 = x3; } else { - void* v11 = mfld_mirth_data_Data_ZTildelastZ_tagZ_value(x3); - VAL v12 = mw_std_prelude_ZAtZAsk(v11); - VAL x13; - uint64_t x14; - uint64_t x15; - int64_t x16; - switch (get_data_tag(v12)) { + void* v9 = mfld_mirth_data_Data_ZTildelastZ_tagZ_value(x3); + VAL v10 = mw_std_prelude_ZAtZAsk(v9); + int64_t x11; + switch (get_data_tag(v10)) { case 1LL: { // Some - VAL v17 = mtp_std_maybe_Maybe_1_Some(v12); - int64_t v18 = 1LL; - int64_t v19 = i64_add(VI64(v17), v18); - x16 = v19; - x15 = x3; - x14 = x2; - x13 = x1; + VAL v12 = mtp_std_maybe_Maybe_1_Some(v10); + int64_t v13 = 1LL; + int64_t v14 = i64_add(VI64(v12), v13); + x11 = v14; } break; case 0LL: { // None - int64_t v20 = 0LL; - x16 = v20; - x15 = x3; - x14 = x2; - x13 = x1; + int64_t v15 = 0LL; + x11 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - mut_set(MKI64(x16), v4); - x9 = x16; - x8 = x14; - x7 = x15; - x6 = x13; - } - VAL v21 = mw_mirth_data_Data_tags(x7); - VAL v22 = MKI64(0LL /* None */); - VAL v23; - VAL v24; - mw_std_list_List_1_uncons(v21, &v23, &v24); - VAL x25; - uint64_t x26; - int64_t x27; - uint64_t x28; - VAL x29; - VAL x30; - int64_t x31; - switch (get_data_tag(v23)) { - case 1LL: { // Some - VAL v32 = mtp_std_maybe_Maybe_1_Some(v23); - incref(v32); - int64_t v33 = mw_mirth_data_Tag_value(VU64(v32)); - bool v34 = (v33 == x9); - VAL x35; - uint64_t x36; - int64_t x37; - uint64_t x38; - VAL x39; - if (v34) { - VAL v40 = mtw_std_maybe_Maybe_1_Some(v32); - x39 = v40; - x38 = x7; - x37 = x9; - x36 = x8; - x35 = x6; - } else { - decref(v32); - VAL v41 = MKI64(0LL /* None */); - x39 = v41; - x38 = x7; - x37 = x9; - x36 = x8; - x35 = x6; - } - VAL x42; - uint64_t x43; - int64_t x44; - uint64_t x45; - VAL x46; - VAL x47; - switch (get_data_tag(x39)) { - case 0LL: { // None - x47 = v24; - x46 = v22; - x45 = x38; - x44 = x37; - x43 = x36; - x42 = x35; - } break; - default: { - decref(v24); - decref(v22); - VAL v48 = MKI64(0LL /* Nil */); - x47 = v48; - x46 = x39; - x45 = x38; - x44 = x37; - x43 = x36; - x42 = x35; - } break; - } - int64_t v49 = 1LL /* True */; - x31 = v49; - x30 = x47; - x29 = x46; - x28 = x45; - x27 = x44; - x26 = x43; - x25 = x42; - } break; - case 0LL: { // None - int64_t v50 = 0LL /* False */; - x31 = v50; - x30 = v24; - x29 = v22; - x28 = x7; - x27 = x9; - x26 = x8; - x25 = x6; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v51 = (x25); - uint64_t v52 = x26; - int64_t v53 = x27; - uint64_t v54 = x28; - VAL v55 = x29; - VAL v56 = x30; - int64_t v57 = x31; - while (((bool)v57)) { - VAL v58 = (v51); - uint64_t v59 = v52; - int64_t v60 = v53; - uint64_t v61 = v54; - VAL v62 = v55; - VAL v63 = v56; - VAL v64; - VAL v65; - mw_std_list_List_1_uncons(v63, &v64, &v65); - VAL x66; - uint64_t x67; - int64_t x68; - uint64_t x69; - VAL x70; - VAL x71; - int64_t x72; - switch (get_data_tag(v64)) { + mut_set(MKI64(x11), v4); + x7 = x11; + x6 = x3; + } + VAL v16 = mw_mirth_data_Data_tags(x6); + VAL v17 = MKI64(0LL /* None */); + int64_t v18 = 1LL /* True */; + int64_t v19 = x7; + VAL v20 = v17; + VAL v21 = v16; + int64_t v22 = v18; + int64_t v23 = v18; + while (((bool)v23)) { + int64_t v24 = v19; + VAL v25 = v20; + VAL v26 = v21; + int64_t v27 = v22; + VAL v28; + VAL v29; + mw_std_list_List_1_uncons(v26, &v28, &v29); + int64_t x30; + VAL x31; + VAL x32; + int64_t x33; + switch (get_data_tag(v28)) { case 1LL: { // Some - VAL v73 = mtp_std_maybe_Maybe_1_Some(v64); - incref(v73); - int64_t v74 = mw_mirth_data_Tag_value(VU64(v73)); - bool v75 = (v74 == v60); - VAL x76; - uint64_t x77; - int64_t x78; - uint64_t x79; - VAL x80; - if (v75) { - VAL v81 = mtw_std_maybe_Maybe_1_Some(v73); - x80 = v81; - x79 = v61; - x78 = v60; - x77 = v59; - x76 = v58; + VAL v34 = mtp_std_maybe_Maybe_1_Some(v28); + incref(v34); + int64_t v35 = mw_mirth_data_Tag_value(VU64(v34)); + bool v36 = (v35 == v24); + int64_t x37; + VAL x38; + if (v36) { + VAL v39 = mtw_std_maybe_Maybe_1_Some(v34); + x38 = v39; + x37 = v24; } else { - decref(v73); - VAL v82 = MKI64(0LL /* None */); - x80 = v82; - x79 = v61; - x78 = v60; - x77 = v59; - x76 = v58; + decref(v34); + VAL v40 = MKI64(0LL /* None */); + x38 = v40; + x37 = v24; } - VAL x83; - uint64_t x84; - int64_t x85; - uint64_t x86; - VAL x87; - VAL x88; - switch (get_data_tag(x80)) { + int64_t x41; + VAL x42; + VAL x43; + switch (get_data_tag(x38)) { case 0LL: { // None - x88 = v65; - x87 = v62; - x86 = x79; - x85 = x78; - x84 = x77; - x83 = x76; + x43 = v29; + x42 = v25; + x41 = x37; } break; default: { - decref(v65); - decref(v62); - VAL v89 = MKI64(0LL /* Nil */); - x88 = v89; - x87 = x80; - x86 = x79; - x85 = x78; - x84 = x77; - x83 = x76; + decref(v29); + decref(v25); + VAL v44 = MKI64(0LL /* Nil */); + x43 = v44; + x42 = x38; + x41 = x37; } break; } - int64_t v90 = 1LL /* True */; - x72 = v90; - x71 = x88; - x70 = x87; - x69 = x86; - x68 = x85; - x67 = x84; - x66 = x83; + int64_t v45 = 1LL /* True */; + x33 = v45; + x32 = x43; + x31 = x42; + x30 = x41; } break; case 0LL: { // None - int64_t v91 = 0LL /* False */; - x72 = v91; - x71 = v65; - x70 = v62; - x69 = v61; - x68 = v60; - x67 = v59; - x66 = v58; + int64_t v46 = 0LL /* False */; + x33 = v46; + x32 = v29; + x31 = v25; + x30 = v24; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v57 = x72; - v56 = x71; - v55 = x70; - v54 = x69; - v53 = x68; - v52 = x67; - v51 = x66; + v23 = x33; + v22 = x33; + v21 = x32; + v20 = x31; + v19 = x30; } - decref(v56); - VAL x92; - uint64_t x93; - int64_t x94; - uint64_t x95; - switch (get_data_tag(v55)) { + decref(v21); + uint64_t x47; + uint64_t x48; + VAL x49; + switch (get_data_tag(v20)) { case 1LL: { // Some - VAL v96 = mtp_std_maybe_Maybe_1_Some(v55); - STR* v97; - STRLIT(v97, "", 0); - STR* v98; - STRLIT(v98, "Constructors ", 13); - VAL v99 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v98), MKSTR(v97))); - uint64_t v100 = mw_mirth_data_Tag_name(VU64(v96)); - VAL v101 = mw_mirth_name_Name_ZToStr(v100); - VAL v102 = (mw_std_str_ZPlusStr_pushZ_strZBang(v101, v99)); - STR* v103; - STRLIT(v103, " and ", 5); - VAL v104 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v103), v102)); - uint64_t v105 = mw_mirth_data_Tag_name(v52); - VAL v106 = mw_mirth_name_Name_ZToStr(v105); - VAL v107 = (mw_std_str_ZPlusStr_pushZ_strZBang(v106, v104)); - STR* v108; - STRLIT(v108, " have the same tag value.", 25); - VAL v109 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v108), v107)); - VAL v110 = mw_mirth_data_Data_headZAsk(v54); - int64_t x111; - uint64_t x112; - uint64_t x113; - VAL x114; - switch (get_data_tag(v110)) { + VAL v50 = mtp_std_maybe_Maybe_1_Some(v20); + STR* v51; + STRLIT(v51, "", 0); + STR* v52; + STRLIT(v52, "Constructors ", 13); + VAL v53 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v52), MKSTR(v51)); + uint64_t v54 = mw_mirth_data_Tag_name(VU64(v50)); + VAL v55 = mw_mirth_name_Name_ZToStr(v54); + VAL v56 = mw_std_str_ZPlusStr_pushZ_strZBang(v55, v53); + STR* v57; + STRLIT(v57, " and ", 5); + VAL v58 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v57), v56); + uint64_t v59 = mw_mirth_data_Tag_name(x2); + VAL v60 = mw_mirth_name_Name_ZToStr(v59); + VAL v61 = mw_std_str_ZPlusStr_pushZ_strZBang(v60, v58); + STR* v62; + STRLIT(v62, " have the same tag value.", 25); + VAL v63 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v62), v61); + VAL v64 = mw_mirth_data_Data_headZAsk(x6); + VAL x65; + switch (get_data_tag(v64)) { case 1LL: { // Some - VAL v115 = mtp_std_maybe_Maybe_1_Some(v110); - VAL v116 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(VU64(v115), v109, v51)); - x114 = v116; - x113 = v54; - x112 = v52; - x111 = v53; + VAL v66 = mtp_std_maybe_Maybe_1_Some(v64); + VAL v67 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(VU64(v66), v63, x1); + x65 = v67; } break; case 0LL: { // None - VAL v117 = (mw_mirth_mirth_ZPlusMirth_errorZBang(v109, v51)); - x114 = v117; - x113 = v54; - x112 = v52; - x111 = v53; + VAL v68 = mw_mirth_mirth_ZPlusMirth_errorZBang(v63, x1); + x65 = v68; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x95 = x113; - x94 = x111; - x93 = x112; - x92 = x114; + x49 = x65; + x48 = x6; + x47 = x2; } break; case 0LL: { // None - x95 = v54; - x94 = v53; - x93 = v52; - x92 = v51; + x49 = x1; + x48 = x6; + x47 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - void* v118 = mfld_mirth_data_Data_ZTildelastZ_tagZ_value(x95); - mut_set(MKI64(x94), v118); - void* v119 = mfld_mirth_data_Data_ZTildetags(x95); - VAL v120 = mut_get(v119); - VAL v121 = mw_std_list_List_1_reverse(v120); - VAL v122 = mtw_std_list_List_1_Cons(MKU64(x93), v121); - VAL v123 = mw_std_list_List_1_reverse(v122); - mut_set(v123, v119); - return x92; + void* v69 = mfld_mirth_data_Data_ZTildelastZ_tagZ_value(x48); + mut_set(MKI64(v19), v69); + void* v70 = mfld_mirth_data_Data_ZTildetags(x48); + VAL v71 = mut_get(v70); + VAL v72 = mw_std_list_List_1_reverse(v71); + VAL v73 = mtw_std_list_List_1_Cons(MKU64(x47), v72); + VAL v74 = mw_std_list_List_1_reverse(v73); + mut_set(v74, v70); + return x49; } static int64_t mw_mirth_data_Data_isZ_enumZ_orZ_unitZAsk (uint64_t x1) { int64_t v2 = mw_mirth_data_Data_isZ_enumZAsk(x1); @@ -15051,29 +13195,26 @@ static int64_t mw_mirth_data_Data_isZ_unitZAsk (uint64_t x1) { } else { VAL v7 = mw_mirth_data_Data_tags(x1); VAL v8 = mw_std_list_List_1_ZDivL1(v7); - uint64_t x9; - int64_t x10; + int64_t x9; switch (get_data_tag(v8)) { case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v8); - int64_t v12 = mw_mirth_data_Tag_numZ_totalZ_inputs(VU64(v11)); - int64_t v13 = 0LL; - bool v14 = (v12 == v13); - x10 = ((int64_t)v14); - x9 = x1; + VAL v10 = mtp_std_maybe_Maybe_1_Some(v8); + int64_t v11 = mw_mirth_data_Tag_numZ_totalZ_inputs(VU64(v10)); + int64_t v12 = 0LL; + bool v13 = (v11 == v12); + x9 = ((int64_t)v13); } break; case 0LL: { // None - int64_t v15 = 0LL /* False */; - x10 = v15; - x9 = x1; + int64_t v14 = 0LL /* False */; + x9 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - mut_set(MKI64(x10), v2); - x5 = x10; - x4 = x9; + mut_set(MKI64(x9), v2); + x5 = x9; + x4 = x1; } return x5; } @@ -15094,150 +13235,83 @@ static int64_t mw_mirth_data_Data_isZ_enumZAsk (uint64_t x1) { if (v8) { VAL v11 = mw_mirth_data_Data_tags(x1); VAL v12 = MKI64(0LL /* None */); - VAL v13; - VAL v14; - mw_std_list_List_1_uncons(v11, &v13, &v14); - uint64_t x15; - VAL x16; - VAL x17; - int64_t x18; - switch (get_data_tag(v13)) { - case 1LL: { // Some - VAL v19 = mtp_std_maybe_Maybe_1_Some(v13); - incref(v19); - int64_t v20 = mw_mirth_data_Tag_numZ_totalZ_inputs(VU64(v19)); - int64_t v21 = 0LL; - bool v22 = (v20 == v21); - bool v23 = !v22; - uint64_t x24; - VAL x25; - if (v23) { - VAL v26 = mtw_std_maybe_Maybe_1_Some(v19); - x25 = v26; - x24 = x1; - } else { - decref(v19); - VAL v27 = MKI64(0LL /* None */); - x25 = v27; - x24 = x1; - } - uint64_t x28; - VAL x29; - VAL x30; - switch (get_data_tag(x25)) { - case 0LL: { // None - x30 = v14; - x29 = v12; - x28 = x24; - } break; - default: { - decref(v14); - decref(v12); - VAL v31 = MKI64(0LL /* Nil */); - x30 = v31; - x29 = x25; - x28 = x24; - } break; - } - int64_t v32 = 1LL /* True */; - x18 = v32; - x17 = x30; - x16 = x29; - x15 = x28; - } break; - case 0LL: { // None - int64_t v33 = 0LL /* False */; - x18 = v33; - x17 = v14; - x16 = v12; - x15 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v34 = x15; - VAL v35 = x16; - VAL v36 = x17; - int64_t v37 = x18; - while (((bool)v37)) { - uint64_t v38 = v34; - VAL v39 = v35; - VAL v40 = v36; - VAL v41; - VAL v42; - mw_std_list_List_1_uncons(v40, &v41, &v42); - uint64_t x43; - VAL x44; - VAL x45; - int64_t x46; - switch (get_data_tag(v41)) { + int64_t v13 = 1LL /* True */; + VAL v14 = v12; + VAL v15 = v11; + int64_t v16 = v13; + int64_t v17 = v13; + while (((bool)v17)) { + VAL v18 = v14; + VAL v19 = v15; + int64_t v20 = v16; + VAL v21; + VAL v22; + mw_std_list_List_1_uncons(v19, &v21, &v22); + VAL x23; + VAL x24; + int64_t x25; + switch (get_data_tag(v21)) { case 1LL: { // Some - VAL v47 = mtp_std_maybe_Maybe_1_Some(v41); - incref(v47); - int64_t v48 = mw_mirth_data_Tag_numZ_totalZ_inputs(VU64(v47)); - int64_t v49 = 0LL; - bool v50 = (v48 == v49); - bool v51 = !v50; - uint64_t x52; - VAL x53; - if (v51) { - VAL v54 = mtw_std_maybe_Maybe_1_Some(v47); - x53 = v54; - x52 = v38; + VAL v26 = mtp_std_maybe_Maybe_1_Some(v21); + incref(v26); + int64_t v27 = mw_mirth_data_Tag_numZ_totalZ_inputs(VU64(v26)); + int64_t v28 = 0LL; + bool v29 = (v27 == v28); + bool v30 = !v29; + VAL x31; + if (v30) { + VAL v32 = mtw_std_maybe_Maybe_1_Some(v26); + x31 = v32; } else { - decref(v47); - VAL v55 = MKI64(0LL /* None */); - x53 = v55; - x52 = v38; + decref(v26); + VAL v33 = MKI64(0LL /* None */); + x31 = v33; } - uint64_t x56; - VAL x57; - VAL x58; - switch (get_data_tag(x53)) { + VAL x34; + VAL x35; + switch (get_data_tag(x31)) { case 0LL: { // None - x58 = v42; - x57 = v39; - x56 = x52; + x35 = v22; + x34 = v18; } break; default: { - decref(v42); - decref(v39); - VAL v59 = MKI64(0LL /* Nil */); - x58 = v59; - x57 = x53; - x56 = x52; + decref(v22); + decref(v18); + VAL v36 = MKI64(0LL /* Nil */); + x35 = v36; + x34 = x31; } break; } - int64_t v60 = 1LL /* True */; - x46 = v60; - x45 = x58; - x44 = x57; - x43 = x56; + int64_t v37 = 1LL /* True */; + x25 = v37; + x24 = x35; + x23 = x34; } break; case 0LL: { // None - int64_t v61 = 0LL /* False */; - x46 = v61; - x45 = v42; - x44 = v39; - x43 = v38; + int64_t v38 = 0LL /* False */; + x25 = v38; + x24 = v22; + x23 = v18; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v37 = x46; - v36 = x45; - v35 = x44; - v34 = x43; + v17 = x25; + v16 = x25; + v15 = x24; + v14 = x23; } - decref(v36); - int64_t v62 = mw_std_maybe_Maybe_1_noneZAsk(v35); - x10 = v62; - x9 = v34; + decref(v15); + int64_t v39 = get_data_tag(v14); + decref(v14); + int64_t v40 = 0LL; + bool v41 = (v39 == v40); + x10 = ((int64_t)v41); + x9 = x1; } else { - int64_t v63 = 0LL /* False */; - x10 = v63; + int64_t v42 = 0LL /* False */; + x10 = v42; x9 = x1; } mut_set(MKI64(x10), v2); @@ -15261,60 +13335,51 @@ static void mw_mirth_data_Data_semiZ_transparentZAsk (VAL x1, uint64_t x2, VAL * VAL v11 = mw_mirth_data_Data_tags(x2); VAL v12 = mw_std_list_List_1_ZDivL1(v11); VAL x13; - uint64_t x14; - VAL x15; + VAL x14; switch (get_data_tag(v12)) { case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(v12); - incref(v16); + VAL v15 = mtp_std_maybe_Maybe_1_Some(v12); + incref(v15); + VAL v16; VAL v17; - VAL v18; - mw_mirth_data_Tag_inputs(x1, VU64(v16), &v17, &v18); - VAL v19 = mw_std_list_List_1_ZDivL1(v18); - uint64_t x20; - uint64_t x21; - VAL x22; - VAL x23; - switch (get_data_tag(v19)) { + mw_mirth_data_Tag_inputs(x1, VU64(v15), &v16, &v17); + VAL v18 = mw_std_list_List_1_ZDivL1(v17); + uint64_t x19; + VAL x20; + switch (get_data_tag(v18)) { case 1LL: { // Some - VAL v24 = mtp_std_maybe_Maybe_1_Some(v19); - incref(v16); - VAL v25 = mtw_mirth_data_SemiTransparentData_SemiTransparentData(VU64(v16), v24); - VAL v26 = mtw_std_maybe_Maybe_1_Some(v25); - x23 = v26; - x22 = v17; - x21 = VU64(v16); - x20 = x2; + VAL v21 = mtp_std_maybe_Maybe_1_Some(v18); + incref(v15); + VAL v22 = mtw_mirth_data_SemiTransparentData_SemiTransparentData(VU64(v15), v21); + VAL v23 = mtw_std_maybe_Maybe_1_Some(v22); + x20 = v23; + x19 = VU64(v15); } break; case 0LL: { // None - VAL v27 = MKI64(0LL /* None */); - x23 = v27; - x22 = v17; - x21 = VU64(v16); - x20 = x2; + VAL v24 = MKI64(0LL /* None */); + x20 = v24; + x19 = VU64(v15); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x15 = x23; x14 = x20; - x13 = x22; + x13 = v16; } break; case 0LL: { // None - VAL v28 = MKI64(0LL /* None */); - x15 = v28; - x14 = x2; + VAL v25 = MKI64(0LL /* None */); + x14 = v25; x13 = x1; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - incref(x15); - mut_set(x15, v5); - x9 = x15; - x8 = x14; + incref(x14); + mut_set(x14, v5); + x9 = x14; + x8 = x2; x7 = x13; } *x4 = x9; @@ -15348,101 +13413,61 @@ static void mw_mirth_data_Data_fullZ_type (VAL x1, uint64_t x2, VAL *x3, VAL *x4 VAL v6; VAL v7; mw_mirth_data_Data_params(x1, x2, &v6, &v7); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v7, &v8, &v9); - uint64_t x10; - VAL x11; - VAL x12; - VAL x13; - int64_t x14; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v15 = mtp_std_maybe_Maybe_1_Some(v8); - VAL v16 = mtw_mirth_type_Type_TVar(VU64(v15)); - VAL v17 = mtw_mirth_type_Type_TApp(v5, v16); - int64_t v18 = 1LL /* True */; - x14 = v18; - x13 = v9; - x12 = v6; - x11 = v17; - x10 = x2; - } break; - case 0LL: { // None - int64_t v19 = 0LL /* False */; - x14 = v19; - x13 = v9; - x12 = v6; - x11 = v5; - x10 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v20 = x10; - VAL v21 = x11; - VAL v22 = (x12); - VAL v23 = x13; - int64_t v24 = x14; - while (((bool)v24)) { - uint64_t v25 = v20; - VAL v26 = v21; - VAL v27 = (v22); - VAL v28 = v23; - VAL v29; - VAL v30; - mw_std_list_List_1_uncons(v28, &v29, &v30); - uint64_t x31; - VAL x32; - VAL x33; - VAL x34; - int64_t x35; - switch (get_data_tag(v29)) { - case 1LL: { // Some - VAL v36 = mtp_std_maybe_Maybe_1_Some(v29); - VAL v37 = mtw_mirth_type_Type_TVar(VU64(v36)); - VAL v38 = mtw_mirth_type_Type_TApp(v26, v37); - int64_t v39 = 1LL /* True */; - x35 = v39; - x34 = v30; - x33 = v27; - x32 = v38; - x31 = v25; + int64_t v8 = 1LL /* True */; + VAL v9 = v5; + VAL v10 = v7; + int64_t v11 = v8; + int64_t v12 = v8; + while (((bool)v12)) { + VAL v13 = v9; + VAL v14 = v10; + int64_t v15 = v11; + VAL x16; + VAL x17; + int64_t x18; + switch (get_data_tag(v14)) { + case 1LL: { // Cons + VAL v19; + VAL v20; + mtp_std_list_List_1_Cons(v14, &v19, &v20); + VAL v21 = mtw_mirth_type_Type_TVar(VU64(v19)); + VAL v22 = mtw_mirth_type_Type_TApp(v13, v21); + int64_t v23 = 1LL /* True */; + x18 = v23; + x17 = v20; + x16 = v22; } break; - case 0LL: { // None - int64_t v40 = 0LL /* False */; - x35 = v40; - x34 = v30; - x33 = v27; - x32 = v26; - x31 = v25; + case 0LL: { // Nil + VAL v24 = MKI64(0LL /* Nil */); + int64_t v25 = 0LL /* False */; + x18 = v25; + x17 = v24; + x16 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v24 = x35; - v23 = x34; - v22 = x33; - v21 = x32; - v20 = x31; + v12 = x18; + v11 = x18; + v10 = x17; + v9 = x16; } - decref(v23); - int64_t v41 = mw_mirth_data_Data_isZ_valueZ_typeZAsk(v20); - VAL x42; - VAL x43; - if (((bool)v41)) { - VAL v44 = mtw_std_either_Either_2_Left(v21); - x43 = v44; - x42 = v22; + decref(v10); + int64_t v26 = mw_mirth_data_Data_isZ_valueZ_typeZAsk(x2); + VAL x27; + VAL x28; + if (((bool)v26)) { + VAL v29 = mtw_std_either_Either_2_Left(v9); + x28 = v29; + x27 = v6; } else { - VAL v45 = mtw_std_either_Either_2_Right(v21); - x43 = v45; - x42 = v22; + VAL v30 = mtw_std_either_Either_2_Right(v9); + x28 = v30; + x27 = v6; } - *x4 = x43; - *x3 = x42; + *x4 = x28; + *x3 = x27; } static int64_t mw_mirth_data_Tag_index (uint64_t x1) { return ((int64_t)x1); @@ -15540,101 +13565,53 @@ static VAL mw_mirth_data_Tag_labelZ_inputsZ_fromZ_sig (uint64_t x1) { VAL v5 = mw_mirth_token_Token_runZ_tokens(VU64(v4)); VAL v6 = MKI64(0LL /* Nil */); VAL v7 = mw_std_list_List_1_reverse(v6); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v5, &v8, &v9); - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v8); - VAL v14 = mw_mirth_token_Token_sigZ_labelZAsk(VU64(v13)); - VAL x15; - switch (get_data_tag(v14)) { - case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(v14); - VAL v17 = mtw_std_list_List_1_Cons(v16, v7); - x15 = v17; - } break; - case 0LL: { // None - x15 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v18 = 1LL /* True */; - x12 = v18; - x11 = v9; - x10 = x15; - } break; - case 0LL: { // None - int64_t v19 = 0LL /* False */; - x12 = v19; - x11 = v9; - x10 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v20 = (x10); - VAL v21 = x11; - int64_t v22 = x12; - while (((bool)v22)) { - VAL v23 = (v20); - VAL v24 = v21; - VAL v25; - VAL v26; - mw_std_list_List_1_uncons(v24, &v25, &v26); - VAL x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v25)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v25); - VAL v31 = mw_mirth_token_Token_sigZ_labelZAsk(VU64(v30)); - VAL x32; - switch (get_data_tag(v31)) { - case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v31); - VAL v34 = mtw_std_list_List_1_Cons(v33, v23); - x32 = v34; - } break; - case 0LL: { // None - x32 = v23; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v35 = 1LL /* True */; - x29 = v35; - x28 = v26; - x27 = x32; + int64_t v8 = 1LL /* True */; + VAL v9 = v7; + VAL v10 = v5; + int64_t v11 = v8; + int64_t v12 = v8; + while (((bool)v12)) { + VAL v13 = v9; + VAL v14 = v10; + int64_t v15 = v11; + VAL x16; + VAL x17; + int64_t x18; + switch (get_data_tag(v14)) { + case 1LL: { // Cons + VAL v19; + VAL v20; + mtp_std_list_List_1_Cons(v14, &v19, &v20); + VAL v21 = mw_mirth_token_Token_sigZ_labelZAsk(VU64(v19)); + VAL v22 = mw_std_maybe_Maybe_1_for_1_sp5(v13, v21); + int64_t v23 = 1LL /* True */; + x18 = v23; + x17 = v20; + x16 = v22; } break; - case 0LL: { // None - int64_t v36 = 0LL /* False */; - x29 = v36; - x28 = v26; - x27 = v23; + case 0LL: { // Nil + VAL v24 = MKI64(0LL /* Nil */); + int64_t v25 = 0LL /* False */; + x18 = v25; + x17 = v24; + x16 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v22 = x29; - v21 = x28; - v20 = x27; + v12 = x18; + v11 = x18; + v10 = x17; + v9 = x16; } - decref(v21); - VAL v37 = mw_std_list_List_1_reverse(v20); - x3 = v37; + decref(v10); + VAL v26 = mw_std_list_List_1_reverse(v9); + x3 = v26; } break; case 0LL: { // None - VAL v38 = MKI64(0LL /* Nil */); - x3 = v38; + VAL v27 = MKI64(0LL /* Nil */); + x3 = v27; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -15652,32 +13629,17 @@ static int64_t mw_mirth_data_Tag_numZ_typeZ_inputsZ_fromZ_sig (uint64_t x1) { int64_t v6 = mw_mirth_data_Tag_numZ_resourceZ_inputsZ_fromZ_sig(x1); int64_t v7 = i64_sub(v5, v6); int64_t v8 = 0LL; - bool v9 = (v7 < v8); - int64_t x10; - if (v9) { - x10 = v8; - push_u64(x1); - } else { - x10 = v7; - push_u64(x1); - } - uint64_t v11 = pop_u64(); - VAL v12 = mw_mirth_data_Tag_labelZ_inputsZ_fromZ_sig(v11); - int64_t v13 = mw_std_list_List_1_len(v12); - int64_t v14 = i64_sub(x10, v13); - int64_t v15 = 0LL; - bool v16 = (v14 < v15); - int64_t x17; - if (v16) { - x17 = v15; - } else { - x17 = v14; - } - x3 = x17; + int64_t v9 = mw_std_prim_Int_max(v7, v8); + VAL v10 = mw_mirth_data_Tag_labelZ_inputsZ_fromZ_sig(x1); + int64_t v11 = mw_std_list_List_1_len(v10); + int64_t v12 = i64_sub(v9, v11); + int64_t v13 = 0LL; + int64_t v14 = mw_std_prim_Int_max(v12, v13); + x3 = v14; } break; case 0LL: { // None - int64_t v18 = 0LL; - x3 = v18; + int64_t v15 = 0LL; + x3 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -15694,348 +13656,169 @@ static int64_t mw_mirth_data_Tag_numZ_resourceZ_inputsZ_fromZ_sig (uint64_t x1) VAL v5 = mw_mirth_token_Token_runZ_tokens(VU64(v4)); VAL v6 = MKI64(0LL /* Nil */); VAL v7 = mw_std_list_List_1_reverse(v6); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v5, &v8, &v9); - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v8); - incref(v13); - int64_t v14 = mw_mirth_token_Token_couldZ_beZ_sigZ_labelZAsk(VU64(v13)); - bool v15 = !((bool)v14); - VAL x16; - if (v15) { - VAL v17 = mtw_std_maybe_Maybe_1_Some(v13); - x16 = v17; - } else { - decref(v13); - VAL v18 = MKI64(0LL /* None */); - x16 = v18; - } - VAL x19; - switch (get_data_tag(x16)) { - case 1LL: { // Some - VAL v20 = mtp_std_maybe_Maybe_1_Some(x16); - VAL v21 = mtw_std_list_List_1_Cons(v20, v7); - x19 = v21; - } break; - case 0LL: { // None - x19 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v22 = 1LL /* True */; - x12 = v22; - x11 = v9; - x10 = x19; - } break; - case 0LL: { // None - int64_t v23 = 0LL /* False */; - x12 = v23; - x11 = v9; - x10 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v24 = (x10); - VAL v25 = x11; - int64_t v26 = x12; - while (((bool)v26)) { - VAL v27 = (v24); - VAL v28 = v25; - VAL v29; - VAL v30; - mw_std_list_List_1_uncons(v28, &v29, &v30); - VAL x31; - VAL x32; - int64_t x33; - switch (get_data_tag(v29)) { - case 1LL: { // Some - VAL v34 = mtp_std_maybe_Maybe_1_Some(v29); - incref(v34); - int64_t v35 = mw_mirth_token_Token_couldZ_beZ_sigZ_labelZAsk(VU64(v34)); - bool v36 = !((bool)v35); - VAL x37; - if (v36) { - VAL v38 = mtw_std_maybe_Maybe_1_Some(v34); - x37 = v38; + int64_t v8 = 1LL /* True */; + VAL v9 = v7; + VAL v10 = v5; + int64_t v11 = v8; + int64_t v12 = v8; + while (((bool)v12)) { + VAL v13 = v9; + VAL v14 = v10; + int64_t v15 = v11; + VAL x16; + VAL x17; + int64_t x18; + switch (get_data_tag(v14)) { + case 1LL: { // Cons + VAL v19; + VAL v20; + mtp_std_list_List_1_Cons(v14, &v19, &v20); + incref(v19); + int64_t v21 = mw_mirth_token_Token_couldZ_beZ_sigZ_labelZAsk(VU64(v19)); + bool v22 = !((bool)v21); + VAL x23; + if (v22) { + VAL v24 = mtw_std_list_List_1_Cons(v19, v13); + x23 = v24; } else { - decref(v34); - VAL v39 = MKI64(0LL /* None */); - x37 = v39; - } - VAL x40; - switch (get_data_tag(x37)) { - case 1LL: { // Some - VAL v41 = mtp_std_maybe_Maybe_1_Some(x37); - VAL v42 = mtw_std_list_List_1_Cons(v41, v27); - x40 = v42; - } break; - case 0LL: { // None - x40 = v27; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + decref(v19); + x23 = v13; } - int64_t v43 = 1LL /* True */; - x33 = v43; - x32 = v30; - x31 = x40; + int64_t v25 = 1LL /* True */; + x18 = v25; + x17 = v20; + x16 = x23; } break; - case 0LL: { // None - int64_t v44 = 0LL /* False */; - x33 = v44; - x32 = v30; - x31 = v27; + case 0LL: { // Nil + VAL v26 = MKI64(0LL /* Nil */); + int64_t v27 = 0LL /* False */; + x18 = v27; + x17 = v26; + x16 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v26 = x33; - v25 = x32; - v24 = x31; - } - decref(v25); - VAL v45 = mw_std_list_List_1_reverse(v24); - VAL v46 = MKI64(0LL /* Nil */); - VAL v47 = mw_std_list_List_1_reverse(v46); - VAL v48; - VAL v49; - mw_std_list_List_1_uncons(v45, &v48, &v49); - VAL x50; - VAL x51; - int64_t x52; - switch (get_data_tag(v48)) { - case 1LL: { // Some - VAL v53 = mtp_std_maybe_Maybe_1_Some(v48); - VAL v54 = mw_mirth_token_Token_nameZAsk(VU64(v53)); - VAL x55; - switch (get_data_tag(v54)) { - case 1LL: { // Some - VAL v56 = mtp_std_maybe_Maybe_1_Some(v54); - VAL v57 = mtw_std_list_List_1_Cons(v56, v47); - x55 = v57; - } break; - case 0LL: { // None - x55 = v47; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v58 = 1LL /* True */; - x52 = v58; - x51 = v49; - x50 = x55; - } break; - case 0LL: { // None - int64_t v59 = 0LL /* False */; - x52 = v59; - x51 = v49; - x50 = v47; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v12 = x18; + v11 = x18; + v10 = x17; + v9 = x16; } - VAL v60 = (x50); - VAL v61 = x51; - int64_t v62 = x52; - while (((bool)v62)) { - VAL v63 = (v60); - VAL v64 = v61; - VAL v65; - VAL v66; - mw_std_list_List_1_uncons(v64, &v65, &v66); - VAL x67; - VAL x68; - int64_t x69; - switch (get_data_tag(v65)) { - case 1LL: { // Some - VAL v70 = mtp_std_maybe_Maybe_1_Some(v65); - VAL v71 = mw_mirth_token_Token_nameZAsk(VU64(v70)); - VAL x72; - switch (get_data_tag(v71)) { - case 1LL: { // Some - VAL v73 = mtp_std_maybe_Maybe_1_Some(v71); - VAL v74 = mtw_std_list_List_1_Cons(v73, v63); - x72 = v74; - } break; - case 0LL: { // None - x72 = v63; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v75 = 1LL /* True */; - x69 = v75; - x68 = v66; - x67 = x72; + decref(v10); + VAL v28 = mw_std_list_List_1_reverse(v9); + VAL v29 = MKI64(0LL /* Nil */); + VAL v30 = mw_std_list_List_1_reverse(v29); + int64_t v31 = 1LL /* True */; + VAL v32 = v30; + VAL v33 = v28; + int64_t v34 = v31; + int64_t v35 = v31; + while (((bool)v35)) { + VAL v36 = v32; + VAL v37 = v33; + int64_t v38 = v34; + VAL x39; + VAL x40; + int64_t x41; + switch (get_data_tag(v37)) { + case 1LL: { // Cons + VAL v42; + VAL v43; + mtp_std_list_List_1_Cons(v37, &v42, &v43); + VAL v44 = mw_mirth_token_Token_nameZAsk(VU64(v42)); + VAL v45 = mw_std_maybe_Maybe_1_for_1_sp5(v36, v44); + int64_t v46 = 1LL /* True */; + x41 = v46; + x40 = v43; + x39 = v45; } break; - case 0LL: { // None - int64_t v76 = 0LL /* False */; - x69 = v76; - x68 = v66; - x67 = v63; + case 0LL: { // Nil + VAL v47 = MKI64(0LL /* Nil */); + int64_t v48 = 0LL /* False */; + x41 = v48; + x40 = v47; + x39 = v36; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v62 = x69; - v61 = x68; - v60 = x67; - } - decref(v61); - VAL v77 = mw_std_list_List_1_reverse(v60); - VAL v78 = MKI64(0LL /* Nil */); - VAL v79 = mw_std_list_List_1_reverse(v78); - VAL v80; - VAL v81; - mw_std_list_List_1_uncons(v77, &v80, &v81); - VAL x82; - VAL x83; - int64_t x84; - switch (get_data_tag(v80)) { - case 1LL: { // Some - VAL v85 = mtp_std_maybe_Maybe_1_Some(v80); - incref(v85); - incref(v85); - int64_t v86 = mw_mirth_name_Name_couldZ_beZ_resourceZ_var(VU64(v85)); - int64_t x87; - if (((bool)v86)) { - decref(v85); - int64_t v88 = 1LL /* True */; - x87 = v88; - } else { - int64_t v89 = mw_mirth_name_Name_couldZ_beZ_resourceZ_con(VU64(v85)); - x87 = v89; - } - VAL x90; - if (((bool)x87)) { - VAL v91 = mtw_std_maybe_Maybe_1_Some(v85); - x90 = v91; - } else { - decref(v85); - VAL v92 = MKI64(0LL /* None */); - x90 = v92; - } - VAL x93; - switch (get_data_tag(x90)) { - case 1LL: { // Some - VAL v94 = mtp_std_maybe_Maybe_1_Some(x90); - VAL v95 = mtw_std_list_List_1_Cons(v94, v79); - x93 = v95; - } break; - case 0LL: { // None - x93 = v79; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v96 = 1LL /* True */; - x84 = v96; - x83 = v81; - x82 = x93; - } break; - case 0LL: { // None - int64_t v97 = 0LL /* False */; - x84 = v97; - x83 = v81; - x82 = v79; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v35 = x41; + v34 = x41; + v33 = x40; + v32 = x39; } - VAL v98 = (x82); - VAL v99 = x83; - int64_t v100 = x84; - while (((bool)v100)) { - VAL v101 = (v98); - VAL v102 = v99; - VAL v103; - VAL v104; - mw_std_list_List_1_uncons(v102, &v103, &v104); - VAL x105; - VAL x106; - int64_t x107; - switch (get_data_tag(v103)) { - case 1LL: { // Some - VAL v108 = mtp_std_maybe_Maybe_1_Some(v103); - incref(v108); - incref(v108); - int64_t v109 = mw_mirth_name_Name_couldZ_beZ_resourceZ_var(VU64(v108)); - int64_t x110; - if (((bool)v109)) { - decref(v108); - int64_t v111 = 1LL /* True */; - x110 = v111; + decref(v33); + VAL v49 = mw_std_list_List_1_reverse(v32); + VAL v50 = MKI64(0LL /* Nil */); + VAL v51 = mw_std_list_List_1_reverse(v50); + int64_t v52 = 1LL /* True */; + VAL v53 = v51; + VAL v54 = v49; + int64_t v55 = v52; + int64_t v56 = v52; + while (((bool)v56)) { + VAL v57 = v53; + VAL v58 = v54; + int64_t v59 = v55; + VAL x60; + VAL x61; + int64_t x62; + switch (get_data_tag(v58)) { + case 1LL: { // Cons + VAL v63; + VAL v64; + mtp_std_list_List_1_Cons(v58, &v63, &v64); + incref(v63); + incref(v63); + int64_t v65 = mw_mirth_name_Name_couldZ_beZ_resourceZ_var(VU64(v63)); + int64_t x66; + if (((bool)v65)) { + decref(v63); + int64_t v67 = 1LL /* True */; + x66 = v67; } else { - int64_t v112 = mw_mirth_name_Name_couldZ_beZ_resourceZ_con(VU64(v108)); - x110 = v112; + int64_t v68 = mw_mirth_name_Name_couldZ_beZ_resourceZ_con(VU64(v63)); + x66 = v68; } - VAL x113; - if (((bool)x110)) { - VAL v114 = mtw_std_maybe_Maybe_1_Some(v108); - x113 = v114; + VAL x69; + if (((bool)x66)) { + VAL v70 = mtw_std_list_List_1_Cons(v63, v57); + x69 = v70; } else { - decref(v108); - VAL v115 = MKI64(0LL /* None */); - x113 = v115; - } - VAL x116; - switch (get_data_tag(x113)) { - case 1LL: { // Some - VAL v117 = mtp_std_maybe_Maybe_1_Some(x113); - VAL v118 = mtw_std_list_List_1_Cons(v117, v101); - x116 = v118; - } break; - case 0LL: { // None - x116 = v101; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + decref(v63); + x69 = v57; } - int64_t v119 = 1LL /* True */; - x107 = v119; - x106 = v104; - x105 = x116; + int64_t v71 = 1LL /* True */; + x62 = v71; + x61 = v64; + x60 = x69; } break; - case 0LL: { // None - int64_t v120 = 0LL /* False */; - x107 = v120; - x106 = v104; - x105 = v101; + case 0LL: { // Nil + VAL v72 = MKI64(0LL /* Nil */); + int64_t v73 = 0LL /* False */; + x62 = v73; + x61 = v72; + x60 = v57; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v100 = x107; - v99 = x106; - v98 = x105; + v56 = x62; + v55 = x62; + v54 = x61; + v53 = x60; } - decref(v99); - VAL v121 = mw_std_list_List_1_reverse(v98); - int64_t v122 = mw_std_list_List_1_len(v121); - x3 = v122; + decref(v54); + VAL v74 = mw_std_list_List_1_reverse(v53); + int64_t v75 = mw_std_list_List_1_len(v74); + x3 = v75; } break; case 0LL: { // None - int64_t v123 = 0LL; - x3 = v123; + int64_t v76 = 0LL; + x3 = v76; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -16122,32 +13905,25 @@ static void mw_mirth_data_Tag_preferZ_inlineZAsk (VAL x1, uint64_t x2, VAL *x3, VAL v6; VAL v7; mw_mirth_data_Data_semiZ_transparentZAsk(x1, v5, &v6, &v7); - uint64_t x8; - VAL x9; - int64_t x10; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v7); - decref(v11); - int64_t v12 = 1LL /* True */; - x10 = v12; - x9 = v6; - x8 = x2; - } break; - case 0LL: { // None - int64_t v13 = mw_mirth_data_Tag_numZ_totalZ_inputs(x2); - int64_t v14 = 0LL; - bool v15 = (v13 == v14); - x10 = ((int64_t)v15); - x9 = v6; - x8 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v8 = get_data_tag(v7); + decref(v7); + int64_t v9 = 1LL; + bool v10 = (v8 == v9); + uint64_t x11; + int64_t x12; + if (v10) { + int64_t v13 = 1LL /* True */; + x12 = v13; + x11 = x2; + } else { + int64_t v14 = mw_mirth_data_Tag_numZ_totalZ_inputs(x2); + int64_t v15 = 0LL; + bool v16 = (v14 == v15); + x12 = ((int64_t)v16); + x11 = x2; } - *x4 = x10; - *x3 = x9; + *x4 = x12; + *x3 = v6; } static int64_t mw_mirth_data_DataPartial_ZEqualZEqual (VAL x1, VAL x2) { uint64_t v3; @@ -16170,7 +13946,7 @@ static VAL mw_mirth_match_Match_thaw (VAL x1) { VAL v7; VAL v8; mtp_mirth_match_Match_Match(x1, &v2, &v3, &v4, &v5, &v6, &v7, &v8); - VAL v9 = (mtw_mirth_match_ZPlusMatch_ZPlusMatch(v2, v3, v4, v5, v6, v7, v8)); + VAL v9 = mtw_mirth_match_ZPlusMatch_ZPlusMatch(v2, v3, v4, v5, v6, v7, v8); return v9; } static VAL mw_mirth_match_ZPlusMatch_freezze (VAL x1) { @@ -16238,119 +14014,76 @@ static int64_t mw_mirth_match_Match_hasZ_defaultZ_caseZAsk (VAL x1) { incref(v2); decref(x1); VAL v3 = MKI64(0LL /* None */); - VAL v4; - VAL v5; - mw_std_list_List_1_uncons(v2, &v4, &v5); - VAL x6; - VAL x7; - int64_t x8; - switch (get_data_tag(v4)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v4); - incref(v9); - int64_t v10 = mw_mirth_match_Case_isZ_defaultZ_caseZAsk(v9); - VAL x11; - if (((bool)v10)) { - VAL v12 = mtw_std_maybe_Maybe_1_Some(v9); - x11 = v12; - } else { - decref(v9); - VAL v13 = MKI64(0LL /* None */); - x11 = v13; - } - VAL x14; - VAL x15; - switch (get_data_tag(x11)) { - case 0LL: { // None - x15 = v5; - x14 = v3; - } break; - default: { - decref(v5); - decref(v3); - VAL v16 = MKI64(0LL /* Nil */); - x15 = v16; - x14 = x11; - } break; - } - int64_t v17 = 1LL /* True */; - x8 = v17; - x7 = x15; - x6 = x14; - } break; - case 0LL: { // None - int64_t v18 = 0LL /* False */; - x8 = v18; - x7 = v5; - x6 = v3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v19 = x6; - VAL v20 = x7; - int64_t v21 = x8; - while (((bool)v21)) { - VAL v22 = v19; - VAL v23 = v20; - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v23, &v24, &v25); - VAL x26; - VAL x27; - int64_t x28; - switch (get_data_tag(v24)) { + int64_t v4 = 1LL /* True */; + VAL v5 = v3; + VAL v6 = v2; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL v12; + VAL v13; + mw_std_list_List_1_uncons(v10, &v12, &v13); + VAL x14; + VAL x15; + int64_t x16; + switch (get_data_tag(v12)) { case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v24); - incref(v29); - int64_t v30 = mw_mirth_match_Case_isZ_defaultZ_caseZAsk(v29); - VAL x31; - if (((bool)v30)) { - VAL v32 = mtw_std_maybe_Maybe_1_Some(v29); - x31 = v32; + VAL v17 = mtp_std_maybe_Maybe_1_Some(v12); + incref(v17); + int64_t v18 = mw_mirth_match_Case_isZ_defaultZ_caseZAsk(v17); + VAL x19; + if (((bool)v18)) { + VAL v20 = mtw_std_maybe_Maybe_1_Some(v17); + x19 = v20; } else { - decref(v29); - VAL v33 = MKI64(0LL /* None */); - x31 = v33; + decref(v17); + VAL v21 = MKI64(0LL /* None */); + x19 = v21; } - VAL x34; - VAL x35; - switch (get_data_tag(x31)) { + VAL x22; + VAL x23; + switch (get_data_tag(x19)) { case 0LL: { // None - x35 = v25; - x34 = v22; + x23 = v13; + x22 = v9; } break; default: { - decref(v25); - decref(v22); - VAL v36 = MKI64(0LL /* Nil */); - x35 = v36; - x34 = x31; + decref(v13); + decref(v9); + VAL v24 = MKI64(0LL /* Nil */); + x23 = v24; + x22 = x19; } break; } - int64_t v37 = 1LL /* True */; - x28 = v37; - x27 = x35; - x26 = x34; + int64_t v25 = 1LL /* True */; + x16 = v25; + x15 = x23; + x14 = x22; } break; case 0LL: { // None - int64_t v38 = 0LL /* False */; - x28 = v38; - x27 = v25; - x26 = v22; + int64_t v26 = 0LL /* False */; + x16 = v26; + x15 = v13; + x14 = v9; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v21 = x28; - v20 = x27; - v19 = x26; + v8 = x16; + v7 = x16; + v6 = x15; + v5 = x14; } - decref(v20); - int64_t v39 = mw_std_maybe_Maybe_1_someZAsk(v19); - return v39; + decref(v6); + int64_t v27 = get_data_tag(v5); + decref(v5); + int64_t v28 = 1LL; + bool v29 = (v27 == v28); + return ((int64_t)v29); } static VAL mw_mirth_match_Match_scrutineeZ_dataZAsk (VAL x1) { VAL v2 = VVAL(VTUP(x1)->cells[7]); @@ -16358,365 +14091,224 @@ static VAL mw_mirth_match_Match_scrutineeZ_dataZAsk (VAL x1) { decref(x1); VAL v3 = MKI64(0LL /* Nil */); VAL v4 = mw_std_list_List_1_reverse(v3); - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(v2, &v5, &v6); - VAL x7; - VAL x8; - int64_t x9; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v10 = mtp_std_maybe_Maybe_1_Some(v5); - incref(v10); - int64_t v11 = mw_mirth_match_Case_isZ_defaultZ_caseZAsk(v10); - bool v12 = !((bool)v11); - VAL x13; - if (v12) { - VAL v14 = mtw_std_maybe_Maybe_1_Some(v10); - x13 = v14; - } else { - decref(v10); - VAL v15 = MKI64(0LL /* None */); - x13 = v15; - } - VAL x16; - switch (get_data_tag(x13)) { - case 1LL: { // Some - VAL v17 = mtp_std_maybe_Maybe_1_Some(x13); - VAL v18 = mtw_std_list_List_1_Cons(v17, v4); - x16 = v18; - } break; - case 0LL: { // None - x16 = v4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + int64_t v5 = 1LL /* True */; + VAL v6 = v4; + VAL v7 = v2; + int64_t v8 = v5; + int64_t v9 = v5; + while (((bool)v9)) { + VAL v10 = v6; + VAL v11 = v7; + int64_t v12 = v8; + VAL x13; + VAL x14; + int64_t x15; + switch (get_data_tag(v11)) { + case 1LL: { // Cons + VAL v16; + VAL v17; + mtp_std_list_List_1_Cons(v11, &v16, &v17); + incref(v16); + int64_t v18 = mw_mirth_match_Case_isZ_defaultZ_caseZAsk(v16); + bool v19 = !((bool)v18); + VAL x20; + if (v19) { + VAL v21 = mtw_std_list_List_1_Cons(v16, v10); + x20 = v21; + } else { + decref(v16); + x20 = v10; } + int64_t v22 = 1LL /* True */; + x15 = v22; + x14 = v17; + x13 = x20; + } break; + case 0LL: { // Nil + VAL v23 = MKI64(0LL /* Nil */); + int64_t v24 = 0LL /* False */; + x15 = v24; + x14 = v23; + x13 = v10; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); } - int64_t v19 = 1LL /* True */; - x9 = v19; - x8 = v6; - x7 = x16; + } + v9 = x15; + v8 = x15; + v7 = x14; + v6 = x13; + } + decref(v7); + VAL v25 = mw_std_list_List_1_reverse(v6); + incref(v25); + VAL v26 = mw_std_list_List_1_first(v25); + VAL x27; + switch (get_data_tag(v26)) { + case 1LL: { // Some + VAL v28 = mtp_std_maybe_Maybe_1_Some(v26); + VAL v29 = VVAL(VTUP(v28)->cells[1]); + incref(v29); + decref(v28); + VAL v30 = mw_mirth_match_Pattern_singleZ_tagZAsk(v29); + x27 = v30; } break; case 0LL: { // None - int64_t v20 = 0LL /* False */; - x9 = v20; - x8 = v6; - x7 = v4; + VAL v31 = MKI64(0LL /* None */); + x27 = v31; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v21 = (x7); - VAL v22 = x8; - int64_t v23 = x9; - while (((bool)v23)) { - VAL v24 = (v21); - VAL v25 = v22; - VAL v26; - VAL v27; - mw_std_list_List_1_uncons(v25, &v26, &v27); - VAL x28; - VAL x29; - int64_t x30; - switch (get_data_tag(v26)) { - case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v26); - incref(v31); - int64_t v32 = mw_mirth_match_Case_isZ_defaultZ_caseZAsk(v31); - bool v33 = !((bool)v32); - VAL x34; - if (v33) { - VAL v35 = mtw_std_maybe_Maybe_1_Some(v31); - x34 = v35; - } else { - decref(v31); - VAL v36 = MKI64(0LL /* None */); - x34 = v36; - } - VAL x37; - switch (get_data_tag(x34)) { - case 1LL: { // Some - VAL v38 = mtp_std_maybe_Maybe_1_Some(x34); - VAL v39 = mtw_std_list_List_1_Cons(v38, v24); - x37 = v39; - } break; - case 0LL: { // None - x37 = v24; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v40 = 1LL /* True */; - x30 = v40; - x29 = v27; - x28 = x37; - } break; - case 0LL: { // None - int64_t v41 = 0LL /* False */; - x30 = v41; - x29 = v27; - x28 = v24; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v23 = x30; - v22 = x29; - v21 = x28; - } - decref(v22); - VAL v42 = mw_std_list_List_1_reverse(v21); - incref(v42); - VAL v43 = mw_std_list_List_1_first(v42); - VAL x44; - VAL x45; - switch (get_data_tag(v43)) { - case 1LL: { // Some - VAL v46 = mtp_std_maybe_Maybe_1_Some(v43); - VAL v47 = VVAL(VTUP(v46)->cells[1]); - incref(v47); - decref(v46); - VAL v48 = mw_mirth_match_Pattern_singleZ_tagZAsk(v47); - x45 = v48; - x44 = v42; - } break; - case 0LL: { // None - VAL v49 = MKI64(0LL /* None */); - x45 = v49; - x44 = v42; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x50; - VAL x51; - switch (get_data_tag(x45)) { + VAL x32; + switch (get_data_tag(x27)) { case 1LL: { // Some - VAL v52 = mtp_std_maybe_Maybe_1_Some(x45); - uint64_t v53 = mw_mirth_data_Tag_data(VU64(v52)); - VAL v54 = mtw_std_maybe_Maybe_1_Some(MKU64(v53)); - x51 = v54; - x50 = x44; + VAL v33 = mtp_std_maybe_Maybe_1_Some(x27); + uint64_t v34 = mw_mirth_data_Tag_data(VU64(v33)); + VAL v35 = mtw_std_maybe_Maybe_1_Some(MKU64(v34)); + x32 = v35; } break; case 0LL: { // None - VAL v55 = MKI64(0LL /* None */); - x51 = v55; - x50 = x44; + VAL v36 = MKI64(0LL /* None */); + x32 = v36; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x56; - switch (get_data_tag(x51)) { + VAL x37; + switch (get_data_tag(x32)) { case 1LL: { // Some - VAL v57 = mtp_std_maybe_Maybe_1_Some(x51); - VAL v58 = MKI64(0LL /* None */); - VAL v59; - VAL v60; - mw_std_list_List_1_uncons(x50, &v59, &v60); - uint64_t x61; - VAL x62; - VAL x63; - int64_t x64; - switch (get_data_tag(v59)) { - case 1LL: { // Some - VAL v65 = mtp_std_maybe_Maybe_1_Some(v59); - incref(v65); - VAL v66 = VVAL(VTUP(v65)->cells[1]); - incref(v66); - decref(v65); - VAL v67 = mw_mirth_match_Pattern_singleZ_tagZAsk(v66); - uint64_t x68; - int64_t x69; - switch (get_data_tag(v67)) { - case 1LL: { // Some - VAL v70 = mtp_std_maybe_Maybe_1_Some(v67); - incref(v57); - uint64_t v71 = mw_mirth_data_Tag_data(VU64(v70)); - int64_t v72 = mw_mirth_data_Data_ZEqualZEqual(VU64(v57), v71); - x69 = v72; - x68 = VU64(v57); - } break; - case 0LL: { // None - int64_t v73 = 0LL /* False */; - x69 = v73; - x68 = VU64(v57); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - bool v74 = !((bool)x69); - uint64_t x75; - VAL x76; - if (v74) { - VAL v77 = mtw_std_maybe_Maybe_1_Some(v65); - x76 = v77; - x75 = x68; - } else { - decref(v65); - VAL v78 = MKI64(0LL /* None */); - x76 = v78; - x75 = x68; - } - uint64_t x79; - VAL x80; - VAL x81; - switch (get_data_tag(x76)) { - case 0LL: { // None - x81 = v60; - x80 = v58; - x79 = x75; - } break; - default: { - decref(v60); - decref(v58); - VAL v82 = MKI64(0LL /* Nil */); - x81 = v82; - x80 = x76; - x79 = x75; - } break; - } - int64_t v83 = 1LL /* True */; - x64 = v83; - x63 = x81; - x62 = x80; - x61 = x79; - } break; - case 0LL: { // None - int64_t v84 = 0LL /* False */; - x64 = v84; - x63 = v60; - x62 = v58; - x61 = VU64(v57); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v85 = x61; - VAL v86 = x62; - VAL v87 = x63; - int64_t v88 = x64; - while (((bool)v88)) { - uint64_t v89 = v85; - VAL v90 = v86; - VAL v91 = v87; - VAL v92; - VAL v93; - mw_std_list_List_1_uncons(v91, &v92, &v93); - uint64_t x94; - VAL x95; - VAL x96; - int64_t x97; - switch (get_data_tag(v92)) { + VAL v38 = mtp_std_maybe_Maybe_1_Some(x32); + VAL v39 = MKI64(0LL /* None */); + int64_t v40 = 1LL /* True */; + VAL v41 = v38; + VAL v42 = v39; + VAL v43 = v25; + int64_t v44 = v40; + int64_t v45 = v40; + while (((bool)v45)) { + VAL v46 = v41; + VAL v47 = v42; + VAL v48 = v43; + int64_t v49 = v44; + VAL v50; + VAL v51; + mw_std_list_List_1_uncons(v48, &v50, &v51); + uint64_t x52; + VAL x53; + VAL x54; + int64_t x55; + switch (get_data_tag(v50)) { case 1LL: { // Some - VAL v98 = mtp_std_maybe_Maybe_1_Some(v92); - incref(v98); - VAL v99 = VVAL(VTUP(v98)->cells[1]); - incref(v99); - decref(v98); - VAL v100 = mw_mirth_match_Pattern_singleZ_tagZAsk(v99); - uint64_t x101; - int64_t x102; - switch (get_data_tag(v100)) { + VAL v56 = mtp_std_maybe_Maybe_1_Some(v50); + incref(v56); + VAL v57 = VVAL(VTUP(v56)->cells[1]); + incref(v57); + decref(v56); + VAL v58 = mw_mirth_match_Pattern_singleZ_tagZAsk(v57); + uint64_t x59; + int64_t x60; + switch (get_data_tag(v58)) { case 1LL: { // Some - VAL v103 = mtp_std_maybe_Maybe_1_Some(v100); - uint64_t v104 = mw_mirth_data_Tag_data(VU64(v103)); - int64_t v105 = mw_mirth_data_Data_ZEqualZEqual(v89, v104); - x102 = v105; - x101 = v89; + VAL v61 = mtp_std_maybe_Maybe_1_Some(v58); + incref(v46); + uint64_t v62 = mw_mirth_data_Tag_data(VU64(v61)); + int64_t v63 = mw_mirth_data_Data_ZEqualZEqual(VU64(v46), v62); + x60 = v63; + x59 = VU64(v46); } break; case 0LL: { // None - int64_t v106 = 0LL /* False */; - x102 = v106; - x101 = v89; + int64_t v64 = 0LL /* False */; + x60 = v64; + x59 = VU64(v46); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - bool v107 = !((bool)x102); - uint64_t x108; - VAL x109; - if (v107) { - VAL v110 = mtw_std_maybe_Maybe_1_Some(v98); - x109 = v110; - x108 = x101; + bool v65 = !((bool)x60); + uint64_t x66; + VAL x67; + if (v65) { + VAL v68 = mtw_std_maybe_Maybe_1_Some(v56); + x67 = v68; + x66 = x59; } else { - decref(v98); - VAL v111 = MKI64(0LL /* None */); - x109 = v111; - x108 = x101; + decref(v56); + VAL v69 = MKI64(0LL /* None */); + x67 = v69; + x66 = x59; } - uint64_t x112; - VAL x113; - VAL x114; - switch (get_data_tag(x109)) { + uint64_t x70; + VAL x71; + VAL x72; + switch (get_data_tag(x67)) { case 0LL: { // None - x114 = v93; - x113 = v90; - x112 = x108; + x72 = v51; + x71 = v47; + x70 = x66; } break; default: { - decref(v93); - decref(v90); - VAL v115 = MKI64(0LL /* Nil */); - x114 = v115; - x113 = x109; - x112 = x108; + decref(v51); + decref(v47); + VAL v73 = MKI64(0LL /* Nil */); + x72 = v73; + x71 = x67; + x70 = x66; } break; } - int64_t v116 = 1LL /* True */; - x97 = v116; - x96 = x114; - x95 = x113; - x94 = x112; + int64_t v74 = 1LL /* True */; + x55 = v74; + x54 = x72; + x53 = x71; + x52 = x70; } break; case 0LL: { // None - int64_t v117 = 0LL /* False */; - x97 = v117; - x96 = v93; - x95 = v90; - x94 = v89; + int64_t v75 = 0LL /* False */; + x55 = v75; + x54 = v51; + x53 = v47; + x52 = VU64(v46); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v88 = x97; - v87 = x96; - v86 = x95; - v85 = x94; + v45 = x55; + v44 = x55; + v43 = x54; + v42 = x53; + v41 = MKU64(x52); } - decref(v87); - int64_t v118 = mw_std_maybe_Maybe_1_noneZAsk(v86); - VAL x119; - if (((bool)v118)) { - VAL v120 = mtw_std_maybe_Maybe_1_Some(MKU64(v85)); - x119 = v120; + decref(v43); + int64_t v76 = get_data_tag(v42); + decref(v42); + int64_t v77 = 0LL; + bool v78 = (v76 == v77); + VAL x79; + if (v78) { + VAL v80 = mtw_std_maybe_Maybe_1_Some(v41); + x79 = v80; } else { - VAL v121 = MKI64(0LL /* None */); - x119 = v121; + decref(v41); + VAL v81 = MKI64(0LL /* None */); + x79 = v81; } - x56 = x119; + x37 = x79; } break; case 0LL: { // None - decref(x50); - VAL v122 = MKI64(0LL /* None */); - x56 = v122; + decref(v25); + VAL v82 = MKI64(0LL /* None */); + x37 = v82; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - return x56; + return x37; } static void mw_mirth_match_ZPlusMatch_addZ_case (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { incref(x3); @@ -16733,7 +14325,7 @@ static void mw_mirth_match_ZPlusMatch_addZ_case (VAL x1, VAL x2, VAL x3, VAL *x4 decref(v10); STR* v12; STRLIT(v12, "Case is unreachable.", 20); - VAL v13 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v11, MKSTR(v12), x1)); + VAL v13 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v11, MKSTR(v12), x1); x9 = v7; x8 = v13; } else { @@ -16755,165 +14347,91 @@ static void mw_mirth_match_ZPlusMatch_caseZ_redundantZAsk (VAL x1, VAL x2, int64 VAL v5 = VVAL(VTUP(x2)->cells[7]); incref(v5); VAL v6 = MKI64(0LL /* None */); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v5, &v7, &v8); - VAL x9; - VAL x10; - VAL x11; - VAL x12; - int64_t x13; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v7); - incref(v14); - incref(x1); - int64_t v15 = mw_mirth_match_Case_coversZAsk(x1, v14); - VAL x16; - VAL x17; - VAL x18; - if (((bool)v15)) { - VAL v19 = mtw_std_maybe_Maybe_1_Some(v14); - x18 = v19; - x17 = x1; - x16 = x2; - } else { - decref(v14); - VAL v20 = MKI64(0LL /* None */); - x18 = v20; - x17 = x1; - x16 = x2; - } - VAL x21; - VAL x22; - VAL x23; - VAL x24; - switch (get_data_tag(x18)) { - case 0LL: { // None - x24 = v8; - x23 = v6; - x22 = x17; - x21 = x16; - } break; - default: { - decref(v8); - decref(v6); - VAL v25 = MKI64(0LL /* Nil */); - x24 = v25; - x23 = x18; - x22 = x17; - x21 = x16; - } break; - } - int64_t v26 = 1LL /* True */; - x13 = v26; - x12 = x24; - x11 = x23; - x10 = x22; - x9 = x21; - } break; - case 0LL: { // None - int64_t v27 = 0LL /* False */; - x13 = v27; - x12 = v8; - x11 = v6; - x10 = x1; - x9 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v28 = (x9); - VAL v29 = x10; - VAL v30 = x11; - VAL v31 = x12; - int64_t v32 = x13; - while (((bool)v32)) { - VAL v33 = (v28); - VAL v34 = v29; - VAL v35 = v30; - VAL v36 = v31; - VAL v37; - VAL v38; - mw_std_list_List_1_uncons(v36, &v37, &v38); - VAL x39; - VAL x40; - VAL x41; - VAL x42; - int64_t x43; - switch (get_data_tag(v37)) { + int64_t v7 = 1LL /* True */; + VAL v8 = x1; + VAL v9 = v6; + VAL v10 = v5; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + VAL v13 = v8; + VAL v14 = v9; + VAL v15 = v10; + int64_t v16 = v11; + VAL v17; + VAL v18; + mw_std_list_List_1_uncons(v15, &v17, &v18); + VAL x19; + VAL x20; + VAL x21; + int64_t x22; + switch (get_data_tag(v17)) { case 1LL: { // Some - VAL v44 = mtp_std_maybe_Maybe_1_Some(v37); - incref(v44); - incref(v34); - int64_t v45 = mw_mirth_match_Case_coversZAsk(v34, v44); - VAL x46; - VAL x47; - VAL x48; - if (((bool)v45)) { - VAL v49 = mtw_std_maybe_Maybe_1_Some(v44); - x48 = v49; - x47 = v34; - x46 = v33; + VAL v23 = mtp_std_maybe_Maybe_1_Some(v17); + incref(v23); + incref(v13); + int64_t v24 = mw_mirth_match_Case_coversZAsk(v13, v23); + VAL x25; + VAL x26; + if (((bool)v24)) { + VAL v27 = mtw_std_maybe_Maybe_1_Some(v23); + x26 = v27; + x25 = v13; } else { - decref(v44); - VAL v50 = MKI64(0LL /* None */); - x48 = v50; - x47 = v34; - x46 = v33; + decref(v23); + VAL v28 = MKI64(0LL /* None */); + x26 = v28; + x25 = v13; } - VAL x51; - VAL x52; - VAL x53; - VAL x54; - switch (get_data_tag(x48)) { + VAL x29; + VAL x30; + VAL x31; + switch (get_data_tag(x26)) { case 0LL: { // None - x54 = v38; - x53 = v35; - x52 = x47; - x51 = x46; + x31 = v18; + x30 = v14; + x29 = x25; } break; default: { - decref(v38); - decref(v35); - VAL v55 = MKI64(0LL /* Nil */); - x54 = v55; - x53 = x48; - x52 = x47; - x51 = x46; + decref(v18); + decref(v14); + VAL v32 = MKI64(0LL /* Nil */); + x31 = v32; + x30 = x26; + x29 = x25; } break; } - int64_t v56 = 1LL /* True */; - x43 = v56; - x42 = x54; - x41 = x53; - x40 = x52; - x39 = x51; + int64_t v33 = 1LL /* True */; + x22 = v33; + x21 = x31; + x20 = x30; + x19 = x29; } break; case 0LL: { // None - int64_t v57 = 0LL /* False */; - x43 = v57; - x42 = v38; - x41 = v35; - x40 = v34; - x39 = v33; + int64_t v34 = 0LL /* False */; + x22 = v34; + x21 = v18; + x20 = v14; + x19 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v32 = x43; - v31 = x42; - v30 = x41; - v29 = x40; - v28 = x39; + v12 = x22; + v11 = x22; + v10 = x21; + v9 = x20; + v8 = x19; } - decref(v31); - decref(v29); - int64_t v58 = mw_std_maybe_Maybe_1_someZAsk(v30); - *x4 = v28; - *x3 = v58; + decref(v10); + decref(v8); + int64_t v35 = get_data_tag(v9); + decref(v9); + int64_t v36 = 1LL; + bool v37 = (v35 == v36); + *x4 = x2; + *x3 = ((int64_t)v37); } static int64_t mw_mirth_match_Case_coversZAsk (VAL x1, VAL x2) { VAL v3 = VVAL(VTUP(x1)->cells[1]); @@ -16940,68 +14458,47 @@ static VAL mw_mirth_match_Pattern_dom (VAL x1) { VAL v3 = VVAL(VTUP(x1)->cells[6]); incref(v3); decref(x1); - VAL v4; - VAL v5; - mw_std_list_List_1_uncons(v3, &v4, &v5); - VAL x6; - VAL x7; - int64_t x8; - switch (get_data_tag(v4)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v4); - VAL v10 = mtw_mirth_type_StackType_STCons(v2, v9); - int64_t v11 = 1LL /* True */; - x8 = v11; - x7 = v5; - x6 = v10; - } break; - case 0LL: { // None - int64_t v12 = 0LL /* False */; - x8 = v12; - x7 = v5; - x6 = v2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v13 = x6; - VAL v14 = x7; - int64_t v15 = x8; - while (((bool)v15)) { - VAL v16 = v13; - VAL v17 = v14; - VAL v18; - VAL v19; - mw_std_list_List_1_uncons(v17, &v18, &v19); - VAL x20; - VAL x21; - int64_t x22; - switch (get_data_tag(v18)) { - case 1LL: { // Some - VAL v23 = mtp_std_maybe_Maybe_1_Some(v18); - VAL v24 = mtw_mirth_type_StackType_STCons(v16, v23); - int64_t v25 = 1LL /* True */; - x22 = v25; - x21 = v19; - x20 = v24; + int64_t v4 = 1LL /* True */; + VAL v5 = v2; + VAL v6 = v3; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL x12; + VAL x13; + int64_t x14; + switch (get_data_tag(v10)) { + case 1LL: { // Cons + VAL v15; + VAL v16; + mtp_std_list_List_1_Cons(v10, &v15, &v16); + VAL v17 = mtw_mirth_type_StackType_STCons(v9, v15); + int64_t v18 = 1LL /* True */; + x14 = v18; + x13 = v16; + x12 = v17; } break; - case 0LL: { // None - int64_t v26 = 0LL /* False */; - x22 = v26; - x21 = v19; - x20 = v16; + case 0LL: { // Nil + VAL v19 = MKI64(0LL /* Nil */); + int64_t v20 = 0LL /* False */; + x14 = v20; + x13 = v19; + x12 = v9; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v15 = x22; - v14 = x21; - v13 = x20; + v8 = x14; + v7 = x14; + v6 = x13; + v5 = x12; } - decref(v14); - return v13; + decref(v6); + return v5; } static VAL mw_mirth_match_Pattern_thaw (VAL x1) { return x1; @@ -17036,127 +14533,80 @@ static int64_t mw_mirth_match_Pattern_isZ_defaultZAsk (VAL x1) { incref(v2); decref(x1); VAL v3 = MKI64(0LL /* None */); - VAL v4; - VAL v5; - mw_std_list_List_1_uncons(v2, &v4, &v5); - VAL x6; - VAL x7; - int64_t x8; - switch (get_data_tag(v4)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v4); - incref(v9); - VAL v10 = VVAL(VTUP(v9)->cells[7]); - incref(v10); - decref(v9); - int64_t v11 = mw_mirth_match_PatternOp_ZDivPatOpUnderscore(v10); - bool v12 = !((bool)v11); - VAL x13; - if (v12) { - VAL v14 = mtw_std_maybe_Maybe_1_Some(v9); - x13 = v14; - } else { - decref(v9); - VAL v15 = MKI64(0LL /* None */); - x13 = v15; - } - VAL x16; - VAL x17; - switch (get_data_tag(x13)) { - case 0LL: { // None - x17 = v5; - x16 = v3; - } break; - default: { - decref(v5); - decref(v3); - VAL v18 = MKI64(0LL /* Nil */); - x17 = v18; - x16 = x13; - } break; - } - int64_t v19 = 1LL /* True */; - x8 = v19; - x7 = x17; - x6 = x16; - } break; - case 0LL: { // None - int64_t v20 = 0LL /* False */; - x8 = v20; - x7 = v5; - x6 = v3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v21 = x6; - VAL v22 = x7; - int64_t v23 = x8; - while (((bool)v23)) { - VAL v24 = v21; - VAL v25 = v22; - VAL v26; - VAL v27; - mw_std_list_List_1_uncons(v25, &v26, &v27); - VAL x28; - VAL x29; - int64_t x30; - switch (get_data_tag(v26)) { + int64_t v4 = 1LL /* True */; + VAL v5 = v3; + VAL v6 = v2; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL v12; + VAL v13; + mw_std_list_List_1_uncons(v10, &v12, &v13); + VAL x14; + VAL x15; + int64_t x16; + switch (get_data_tag(v12)) { case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v26); - incref(v31); - VAL v32 = VVAL(VTUP(v31)->cells[7]); - incref(v32); - decref(v31); - int64_t v33 = mw_mirth_match_PatternOp_ZDivPatOpUnderscore(v32); - bool v34 = !((bool)v33); - VAL x35; - if (v34) { - VAL v36 = mtw_std_maybe_Maybe_1_Some(v31); - x35 = v36; + VAL v17 = mtp_std_maybe_Maybe_1_Some(v12); + incref(v17); + VAL v18 = VVAL(VTUP(v17)->cells[7]); + incref(v18); + decref(v17); + int64_t v19 = mw_mirth_match_PatternOp_ZDivPatOpUnderscore(v18); + bool v20 = !((bool)v19); + VAL x21; + if (v20) { + VAL v22 = mtw_std_maybe_Maybe_1_Some(v17); + x21 = v22; } else { - decref(v31); - VAL v37 = MKI64(0LL /* None */); - x35 = v37; + decref(v17); + VAL v23 = MKI64(0LL /* None */); + x21 = v23; } - VAL x38; - VAL x39; - switch (get_data_tag(x35)) { + VAL x24; + VAL x25; + switch (get_data_tag(x21)) { case 0LL: { // None - x39 = v27; - x38 = v24; + x25 = v13; + x24 = v9; } break; default: { - decref(v27); - decref(v24); - VAL v40 = MKI64(0LL /* Nil */); - x39 = v40; - x38 = x35; + decref(v13); + decref(v9); + VAL v26 = MKI64(0LL /* Nil */); + x25 = v26; + x24 = x21; } break; } - int64_t v41 = 1LL /* True */; - x30 = v41; - x29 = x39; - x28 = x38; + int64_t v27 = 1LL /* True */; + x16 = v27; + x15 = x25; + x14 = x24; } break; case 0LL: { // None - int64_t v42 = 0LL /* False */; - x30 = v42; - x29 = v27; - x28 = v24; + int64_t v28 = 0LL /* False */; + x16 = v28; + x15 = v13; + x14 = v9; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v23 = x30; - v22 = x29; - v21 = x28; + v8 = x16; + v7 = x16; + v6 = x15; + v5 = x14; } - decref(v22); - int64_t v43 = mw_std_maybe_Maybe_1_noneZAsk(v21); - return v43; + decref(v6); + int64_t v29 = get_data_tag(v5); + decref(v5); + int64_t v30 = 0LL; + bool v31 = (v29 == v30); + return ((int64_t)v31); } static VAL mw_mirth_match_ZPlusPattern_freezze (VAL x1) { return x1; @@ -17222,7 +14672,7 @@ static void mw_mirth_match_ZPlusPattern_underscoreZBang (VAL x1, VAL x2, VAL *x3 decref(x2); STR* v22; STRLIT(v22, "pattern expects something on stack", 34); - VAL v23 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v21, MKSTR(v22), x1)); + VAL v23 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v21, MKSTR(v22), x1); VAL v24 = MKI64(0LL /* STACK_TYPE_ERROR */); VAL v25 = MKI64(0LL /* TYPE_ERROR */); x20 = v25; @@ -17448,22 +14898,8 @@ static uint64_t mw_mirth_external_External_allocZBang (void) { static VAL mw_mirth_external_External_qnameZ_soft (uint64_t x1) { void* v2 = mfld_mirth_external_External_ZTildeqname(x1); VAL v3 = mw_std_prelude_ZAtZAsk(v2); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v6 = mw_mirth_mirth_Prop_1_readyZAsk(v5); - x4 = v6; - } break; - case 0LL: { // None - VAL v7 = MKI64(0LL /* None */); - x4 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x4; + VAL v4 = mw_std_maybe_Maybe_1_bind_1_sp5(v3); + return v4; } static void mw_mirth_external_External_qnameZ_hard (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { void* v5 = mfld_mirth_external_External_ZTildeqname(x2); @@ -17595,7 +15031,7 @@ static void mw_mirth_variable_Variable_newZBang (VAL x1, uint64_t x2, VAL x3, VA void* v8 = mfld_mirth_variable_Variable_ZTildehead(v6); mut_set(MKU64(x2), v8); VAL v9 = mtw_mirth_def_Def_DefVariable(v6); - VAL v10 = (mw_mirth_def_Def_register(x1, v9)); + VAL v10 = mw_mirth_def_Def_register(x1, v9); *x5 = v6; *x4 = v10; } @@ -17679,79 +15115,6 @@ static void mw_mirth_arrow_Block_arrow (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { *x4 = v6; *x3 = v7; } -static void mw_mirth_arrow_Block_qname (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { - void* v5 = mfld_mirth_arrow_Block_ZTildeqname(x2); - bool v6 = mut_is_set(v5); - VAL x7; - uint64_t x8; - VAL x9; - if (v6) { - VAL v10 = mut_get(v5); - x9 = v10; - x8 = x2; - x7 = x1; - } else { - VAL v11 = mw_mirth_arrow_Block_home(x2); - uint64_t x12; - VAL x13; - VAL x14; - switch (get_data_tag(v11)) { - case 0LL: { // HomeMain - uint64_t v15 = mtp_mirth_arrow_Home_HomeMain(v11); - uint64_t v16 = mw_mirth_token_Token_module(v15); - VAL v17 = mtw_mirth_name_Namespace_NAMESPACEz_MODULE(v16); - VAL v18; - VAL v19; - mw_mirth_arrow_Block_arrow(x1, x2, &v18, &v19); - uint64_t v20 = VU64(VTUP(v19)->cells[2]); - decref(v19); - int64_t v21 = mw_mirth_token_Token_index(v20); - STR* v22 = i64_show(v21); - STR* v23; - STRLIT(v23, "entry@", 6); - STR* v24 = str_cat(v23, v22); - uint64_t v25 = mw_std_prim_Str_ZToName(MKSTR(v24)); - VAL v26 = mw_mirth_name_QNAME0(v17, v25); - x14 = v26; - x13 = v18; - x12 = x2; - } break; - case 1LL: { // HomeWord - uint64_t v27 = mtp_mirth_arrow_Home_HomeWord(v11); - VAL v28 = mtw_mirth_name_Namespace_NAMESPACEz_WORD(v27); - VAL v29; - VAL v30; - mw_mirth_arrow_Block_arrow(x1, x2, &v29, &v30); - VAL v31; - VAL v32; - mw_mirth_word_Word_arrow(v27, v29, &v31, &v32); - uint64_t v33 = VU64(VTUP(v30)->cells[2]); - decref(v30); - int64_t v34 = mw_mirth_token_Token_index(v33); - uint64_t v35 = VU64(VTUP(v31)->cells[2]); - decref(v31); - int64_t v36 = mw_mirth_token_Token_index(v35); - int64_t v37 = i64_sub(v34, v36); - STR* v38 = i64_show(v37); - uint64_t v39 = mw_std_prim_Str_ZToName(MKSTR(v38)); - VAL v40 = mw_mirth_name_QNAME0(v28, v39); - x14 = v40; - x13 = v32; - x12 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - incref(x14); - mut_set(x14, v5); - x9 = x14; - x8 = x12; - x7 = x13; - } - *x4 = x9; - *x3 = x7; -} static int64_t mw_mirth_arrow_Block_ZEqualZEqual (uint64_t x1, uint64_t x2) { int64_t v3 = mw_mirth_arrow_Block_index(x1); int64_t v4 = mw_mirth_arrow_Block_index(x2); @@ -17804,15 +15167,15 @@ static void mw_mirth_arrow_Block_cname (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { STRLIT(v20, "", 0); STR* v21; STRLIT(v21, "mb_", 3); - VAL v22 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v21), MKSTR(v20))); - VAL v23 = (mw_std_str_ZPlusStr_pushZ_strZBang(v19, v22)); + VAL v22 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v21), MKSTR(v20)); + VAL v23 = mw_std_str_ZPlusStr_pushZ_strZBang(v19, v22); STR* v24; STRLIT(v24, "_", 1); - VAL v25 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v24), v23)); + VAL v25 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v24), v23); void* v26 = mfld_mirth_arrow_Block_ZTildehomeZ_index(x2); VAL v27 = mut_get(v26); STR* v28 = i64_show(VI64(v27)); - VAL v29 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v28), v25)); + VAL v29 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v28), v25); x14 = v29; x13 = x2; x12 = v18; @@ -17823,10 +15186,10 @@ static void mw_mirth_arrow_Block_cname (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { STRLIT(v31, "", 0); STR* v32; STRLIT(v32, "mb_", 3); - VAL v33 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v32), MKSTR(v31))); + VAL v33 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v32), MKSTR(v31)); int64_t v34 = mw_mirth_arrow_Block_index(x2); STR* v35 = i64_show(v34); - VAL v36 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v35), v33)); + VAL v36 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v35), v33); x14 = v36; x13 = x2; x12 = x1; @@ -17885,52 +15248,6 @@ static void mw_mirth_arrow_Block_newZBang (VAL x1, VAL x2, VAL *x3, uint64_t *x4 *x4 = v5; *x3 = v18; } -static void mw_mirth_arrow_Block_newZ_deferredZBang_1 (VAL x1, VAL x2, uint64_t x3, VAL x4, VAL x5, VAL *x6, uint64_t *x7) { - push_resource(x1); - push_value(x2); - push_u64(x3); - push_value(x4); - push_value(x5); - { - VAL v8 = pop_value(); - VAL var_f = v8; - uint64_t v9 = mw_mirth_arrow_Block_allocZBang(); - VAL v10 = pop_value(); - void* v11 = mfld_mirth_arrow_Block_ZTildehome(v9); - mut_set(v10, v11); - mw_mirth_arrow_Block_registerZ_homeZBang(v9); - VAL v12 = pop_value(); - void* v13 = mfld_mirth_arrow_Block_ZTildetoken(v9); - mut_set(v12, v13); - VAL v14 = pop_value(); - void* v15 = mfld_mirth_arrow_Block_ZTildectx(v9); - mut_set(v14, v15); - uint64_t v16 = mw_mirth_type_MetaVar_newZBang(); - VAL v17 = mtw_mirth_type_StackType_STMeta(v16); - void* v18 = mfld_mirth_arrow_Block_ZTildedom(v9); - mut_set(v17, v18); - uint64_t v19 = mw_mirth_type_MetaVar_newZBang(); - VAL v20 = mtw_mirth_type_StackType_STMeta(v19); - void* v21 = mfld_mirth_arrow_Block_ZTildecod(v9); - mut_set(v20, v21); - VAL v22 = mtw_mirth_mirth_PropLabel_BlockArrow(v9); - incref(var_f); - VAL v23 = var_f; - VAL r24 = pop_resource(); - VAL v25; - VAL v26; - mw_mirth_mirth_PropLabel_prop_1(MKU64(v9), v22, r24, v23, &v25, &v26); - void* v27 = mfld_mirth_arrow_Block_ZTildearrow(v9); - mut_set(v25, v27); - decref(var_f); - push_resource(v26); - push_u64(v9); - } - uint64_t v28 = pop_u64(); - *x7 = v28; - VAL r29 = pop_resource(); - *x6 = r29; -} static VAL mw_mirth_arrow_Block_typecheckZBang (VAL x1, uint64_t x2) { VAL v3; VAL v4; @@ -17992,46 +15309,28 @@ static VAL mw_mirth_arrow_Atom_toZ_runZ_var (VAL x1) { case 13LL: { // OpVar uint64_t v4 = mtp_mirth_arrow_Op_OpVar(v2); VAL v5 = mw_mirth_var_Var_autoZ_runZAsk(v4); - VAL x6; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v7 = mtp_std_maybe_Maybe_1_Some(v5); - decref(v7); - VAL v8 = mtw_std_maybe_Maybe_1_Some(MKU64(v4)); - x6 = v8; - } break; - case 0LL: { // None - VAL v9 = MKI64(0LL /* None */); - x6 = v9; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v6 = get_data_tag(v5); + decref(v5); + int64_t v7 = 1LL; + bool v8 = (v6 == v7); + VAL x9; + if (v8) { + VAL v10 = mtw_std_maybe_Maybe_1_Some(MKU64(v4)); + x9 = v10; + } else { + VAL v11 = MKI64(0LL /* None */); + x9 = v11; } - x3 = x6; + x3 = x9; } break; default: { decref(v2); - VAL v10 = MKI64(0LL /* None */); - x3 = v10; + VAL v12 = MKI64(0LL /* None */); + x3 = v12; } break; } return x3; } -static void mw_mirth_arrow_Arg_ZToStr (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { - VAL v5; - VAL v6; - mw_mirth_arrow_Block_qname(x1, x2, &v5, &v6); - VAL v7; - VAL v8; - mw_mirth_name_QName_ZToStr(v5, v6, &v7, &v8); - *x4 = v8; - *x3 = v7; -} -static int64_t mw_mirth_arrow_Arg_ZEqualZEqual (uint64_t x1, uint64_t x2) { - int64_t v3 = mw_mirth_arrow_Block_ZEqualZEqual(x1, x2); - return v3; -} static void mw_mirth_arrow_Block_freeZ_vars (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { void* v5 = mfld_mirth_arrow_Block_ZTildefreeZ_vars(x2); bool v6 = mut_is_set(v5); @@ -18065,1134 +15364,59 @@ static void mw_mirth_arrow_Arrow_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4) { decref(x2); VAL v6 = MKI64(0LL /* Nil */); VAL v7 = mw_std_list_List_1_reverse(v6); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v5, &v8, &v9); - VAL x10; - VAL x11; - VAL x12; - int64_t x13; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v8); - VAL v15; - VAL v16; - mw_mirth_arrow_Atom_freeZ_vars(x1, v14, &v15, &v16); - VAL v17 = mtw_std_list_List_1_Cons(v16, v7); - int64_t v18 = 1LL /* True */; - x13 = v18; - x12 = v9; - x11 = v17; - x10 = v15; - } break; - case 0LL: { // None - int64_t v19 = 0LL /* False */; - x13 = v19; - x12 = v9; - x11 = v7; - x10 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v20 = (x10); - VAL v21 = (x11); - VAL v22 = x12; - int64_t v23 = x13; - while (((bool)v23)) { - VAL v24 = (v20); - VAL v25 = (v21); - VAL v26 = v22; - VAL v27; - VAL v28; - mw_std_list_List_1_uncons(v26, &v27, &v28); - VAL x29; - VAL x30; - VAL x31; - int64_t x32; - switch (get_data_tag(v27)) { - case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v27); - VAL v34; - VAL v35; - mw_mirth_arrow_Atom_freeZ_vars(v24, v33, &v34, &v35); - VAL v36 = mtw_std_list_List_1_Cons(v35, v25); - int64_t v37 = 1LL /* True */; - x32 = v37; - x31 = v28; - x30 = v36; - x29 = v34; + int64_t v8 = 1LL /* True */; + VAL v9 = x1; + VAL v10 = v7; + VAL v11 = v5; + int64_t v12 = v8; + int64_t v13 = v8; + while (((bool)v13)) { + VAL v14 = v9; + VAL v15 = v10; + VAL v16 = v11; + int64_t v17 = v12; + VAL x18; + VAL x19; + VAL x20; + int64_t x21; + switch (get_data_tag(v16)) { + case 1LL: { // Cons + VAL v22; + VAL v23; + mtp_std_list_List_1_Cons(v16, &v22, &v23); + VAL v24; + VAL v25; + mw_mirth_arrow_Atom_freeZ_vars(v14, v22, &v24, &v25); + VAL v26 = mtw_std_list_List_1_Cons(v25, v15); + int64_t v27 = 1LL /* True */; + x21 = v27; + x20 = v23; + x19 = v26; + x18 = v24; } break; - case 0LL: { // None - int64_t v38 = 0LL /* False */; - x32 = v38; - x31 = v28; - x30 = v25; - x29 = v24; + case 0LL: { // Nil + VAL v28 = MKI64(0LL /* Nil */); + int64_t v29 = 0LL /* False */; + x21 = v29; + x20 = v28; + x19 = v15; + x18 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v23 = x32; - v22 = x31; - v21 = x30; - v20 = x29; - } - decref(v22); - VAL v39 = mw_std_list_List_1_reverse(v21); - VAL v40 = mw_std_list_List_1_ZToListZPlus(v39); - VAL x41; - VAL x42; - switch (get_data_tag(v40)) { - case 1LL: { // Some - VAL v43 = mtp_std_maybe_Maybe_1_Some(v40); - VAL v44; - VAL v45; - mw_std_list_ListZPlus_1_uncons(v43, &v44, &v45); - VAL v46; - VAL v47; - mw_std_list_List_1_uncons(v45, &v46, &v47); - VAL x48; - VAL x49; - VAL x50; - int64_t x51; - switch (get_data_tag(v46)) { - case 1LL: { // Some - VAL v52 = mtp_std_maybe_Maybe_1_Some(v46); - incref(v44); - VAL v53 = MKI64(0LL /* Nil */); - VAL v54 = mw_std_list_List_1_reverse(v53); - VAL v55; - VAL v56; - mw_std_list_List_1_uncons(v52, &v55, &v56); - VAL x57; - VAL x58; - VAL x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v55)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v55); - incref(v62); - incref(v44); - VAL v63 = MKI64(0LL /* None */); - VAL v64; - VAL v65; - mw_std_list_List_1_uncons(v44, &v64, &v65); - VAL x66; - uint64_t x67; - VAL x68; - VAL x69; - int64_t x70; - switch (get_data_tag(v64)) { - case 1LL: { // Some - VAL v71 = mtp_std_maybe_Maybe_1_Some(v64); - incref(v71); - incref(v62); - int64_t v72 = mw_mirth_var_Var_ZEqualZEqual(VU64(v62), VU64(v71)); - VAL x73; - uint64_t x74; - VAL x75; - if (((bool)v72)) { - VAL v76 = mtw_std_maybe_Maybe_1_Some(v71); - x75 = v76; - x74 = VU64(v62); - x73 = v20; - } else { - decref(v71); - VAL v77 = MKI64(0LL /* None */); - x75 = v77; - x74 = VU64(v62); - x73 = v20; - } - VAL x78; - uint64_t x79; - VAL x80; - VAL x81; - switch (get_data_tag(x75)) { - case 0LL: { // None - x81 = v65; - x80 = v63; - x79 = x74; - x78 = x73; - } break; - default: { - decref(v65); - decref(v63); - VAL v82 = MKI64(0LL /* Nil */); - x81 = v82; - x80 = x75; - x79 = x74; - x78 = x73; - } break; - } - int64_t v83 = 1LL /* True */; - x70 = v83; - x69 = x81; - x68 = x80; - x67 = x79; - x66 = x78; - } break; - case 0LL: { // None - int64_t v84 = 0LL /* False */; - x70 = v84; - x69 = v65; - x68 = v63; - x67 = VU64(v62); - x66 = v20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v85 = (x66); - uint64_t v86 = x67; - VAL v87 = x68; - VAL v88 = x69; - int64_t v89 = x70; - while (((bool)v89)) { - VAL v90 = (v85); - uint64_t v91 = v86; - VAL v92 = v87; - VAL v93 = v88; - VAL v94; - VAL v95; - mw_std_list_List_1_uncons(v93, &v94, &v95); - VAL x96; - uint64_t x97; - VAL x98; - VAL x99; - int64_t x100; - switch (get_data_tag(v94)) { - case 1LL: { // Some - VAL v101 = mtp_std_maybe_Maybe_1_Some(v94); - incref(v101); - int64_t v102 = mw_mirth_var_Var_ZEqualZEqual(v91, VU64(v101)); - VAL x103; - uint64_t x104; - VAL x105; - if (((bool)v102)) { - VAL v106 = mtw_std_maybe_Maybe_1_Some(v101); - x105 = v106; - x104 = v91; - x103 = v90; - } else { - decref(v101); - VAL v107 = MKI64(0LL /* None */); - x105 = v107; - x104 = v91; - x103 = v90; - } - VAL x108; - uint64_t x109; - VAL x110; - VAL x111; - switch (get_data_tag(x105)) { - case 0LL: { // None - x111 = v95; - x110 = v92; - x109 = x104; - x108 = x103; - } break; - default: { - decref(v95); - decref(v92); - VAL v112 = MKI64(0LL /* Nil */); - x111 = v112; - x110 = x105; - x109 = x104; - x108 = x103; - } break; - } - int64_t v113 = 1LL /* True */; - x100 = v113; - x99 = x111; - x98 = x110; - x97 = x109; - x96 = x108; - } break; - case 0LL: { // None - int64_t v114 = 0LL /* False */; - x100 = v114; - x99 = v95; - x98 = v92; - x97 = v91; - x96 = v90; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v89 = x100; - v88 = x99; - v87 = x98; - v86 = x97; - v85 = x96; - } - decref(v88); - int64_t v115 = mw_std_maybe_Maybe_1_someZAsk(v87); - bool v116 = !((bool)v115); - VAL x117; - VAL x118; - VAL x119; - if (v116) { - VAL v120 = mtw_std_maybe_Maybe_1_Some(v62); - x119 = v120; - x118 = v44; - x117 = v85; - } else { - decref(v62); - VAL v121 = MKI64(0LL /* None */); - x119 = v121; - x118 = v44; - x117 = v85; - } - VAL x122; - switch (get_data_tag(x119)) { - case 1LL: { // Some - VAL v123 = mtp_std_maybe_Maybe_1_Some(x119); - VAL v124 = mtw_std_list_List_1_Cons(v123, v54); - x122 = v124; - push_resource(x117); - push_value(x118); - } break; - case 0LL: { // None - x122 = v54; - push_resource(x117); - push_value(x118); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v125 = 1LL /* True */; - x61 = v125; - x60 = v56; - x59 = x122; - VAL v126 = pop_value(); - x58 = v126; - VAL r127 = pop_resource(); - x57 = r127; - } break; - case 0LL: { // None - int64_t v128 = 0LL /* False */; - x61 = v128; - x60 = v56; - x59 = v54; - x58 = v44; - x57 = v20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v129 = (x57); - VAL v130 = x58; - VAL v131 = (x59); - VAL v132 = x60; - int64_t v133 = x61; - while (((bool)v133)) { - VAL v134 = (v129); - VAL v135 = v130; - VAL v136 = (v131); - VAL v137 = v132; - VAL v138; - VAL v139; - mw_std_list_List_1_uncons(v137, &v138, &v139); - VAL x140; - VAL x141; - VAL x142; - VAL x143; - int64_t x144; - switch (get_data_tag(v138)) { - case 1LL: { // Some - VAL v145 = mtp_std_maybe_Maybe_1_Some(v138); - incref(v145); - incref(v135); - VAL v146 = MKI64(0LL /* None */); - VAL v147; - VAL v148; - mw_std_list_List_1_uncons(v135, &v147, &v148); - VAL x149; - uint64_t x150; - VAL x151; - VAL x152; - int64_t x153; - switch (get_data_tag(v147)) { - case 1LL: { // Some - VAL v154 = mtp_std_maybe_Maybe_1_Some(v147); - incref(v154); - incref(v145); - int64_t v155 = mw_mirth_var_Var_ZEqualZEqual(VU64(v145), VU64(v154)); - VAL x156; - uint64_t x157; - VAL x158; - if (((bool)v155)) { - VAL v159 = mtw_std_maybe_Maybe_1_Some(v154); - x158 = v159; - x157 = VU64(v145); - x156 = v134; - } else { - decref(v154); - VAL v160 = MKI64(0LL /* None */); - x158 = v160; - x157 = VU64(v145); - x156 = v134; - } - VAL x161; - uint64_t x162; - VAL x163; - VAL x164; - switch (get_data_tag(x158)) { - case 0LL: { // None - x164 = v148; - x163 = v146; - x162 = x157; - x161 = x156; - } break; - default: { - decref(v148); - decref(v146); - VAL v165 = MKI64(0LL /* Nil */); - x164 = v165; - x163 = x158; - x162 = x157; - x161 = x156; - } break; - } - int64_t v166 = 1LL /* True */; - x153 = v166; - x152 = x164; - x151 = x163; - x150 = x162; - x149 = x161; - } break; - case 0LL: { // None - int64_t v167 = 0LL /* False */; - x153 = v167; - x152 = v148; - x151 = v146; - x150 = VU64(v145); - x149 = v134; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v168 = (x149); - uint64_t v169 = x150; - VAL v170 = x151; - VAL v171 = x152; - int64_t v172 = x153; - while (((bool)v172)) { - VAL v173 = (v168); - uint64_t v174 = v169; - VAL v175 = v170; - VAL v176 = v171; - VAL v177; - VAL v178; - mw_std_list_List_1_uncons(v176, &v177, &v178); - VAL x179; - uint64_t x180; - VAL x181; - VAL x182; - int64_t x183; - switch (get_data_tag(v177)) { - case 1LL: { // Some - VAL v184 = mtp_std_maybe_Maybe_1_Some(v177); - incref(v184); - int64_t v185 = mw_mirth_var_Var_ZEqualZEqual(v174, VU64(v184)); - VAL x186; - uint64_t x187; - VAL x188; - if (((bool)v185)) { - VAL v189 = mtw_std_maybe_Maybe_1_Some(v184); - x188 = v189; - x187 = v174; - x186 = v173; - } else { - decref(v184); - VAL v190 = MKI64(0LL /* None */); - x188 = v190; - x187 = v174; - x186 = v173; - } - VAL x191; - uint64_t x192; - VAL x193; - VAL x194; - switch (get_data_tag(x188)) { - case 0LL: { // None - x194 = v178; - x193 = v175; - x192 = x187; - x191 = x186; - } break; - default: { - decref(v178); - decref(v175); - VAL v195 = MKI64(0LL /* Nil */); - x194 = v195; - x193 = x188; - x192 = x187; - x191 = x186; - } break; - } - int64_t v196 = 1LL /* True */; - x183 = v196; - x182 = x194; - x181 = x193; - x180 = x192; - x179 = x191; - } break; - case 0LL: { // None - int64_t v197 = 0LL /* False */; - x183 = v197; - x182 = v178; - x181 = v175; - x180 = v174; - x179 = v173; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v172 = x183; - v171 = x182; - v170 = x181; - v169 = x180; - v168 = x179; - } - decref(v171); - int64_t v198 = mw_std_maybe_Maybe_1_someZAsk(v170); - bool v199 = !((bool)v198); - VAL x200; - VAL x201; - VAL x202; - if (v199) { - VAL v203 = mtw_std_maybe_Maybe_1_Some(v145); - x202 = v203; - x201 = v135; - x200 = v168; - } else { - decref(v145); - VAL v204 = MKI64(0LL /* None */); - x202 = v204; - x201 = v135; - x200 = v168; - } - VAL x205; - switch (get_data_tag(x202)) { - case 1LL: { // Some - VAL v206 = mtp_std_maybe_Maybe_1_Some(x202); - VAL v207 = mtw_std_list_List_1_Cons(v206, v136); - x205 = v207; - push_resource(x200); - push_value(x201); - } break; - case 0LL: { // None - x205 = v136; - push_resource(x200); - push_value(x201); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v208 = 1LL /* True */; - x144 = v208; - x143 = v139; - x142 = x205; - VAL v209 = pop_value(); - x141 = v209; - VAL r210 = pop_resource(); - x140 = r210; - } break; - case 0LL: { // None - int64_t v211 = 0LL /* False */; - x144 = v211; - x143 = v139; - x142 = v136; - x141 = v135; - x140 = v134; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v133 = x144; - v132 = x143; - v131 = x142; - v130 = x141; - v129 = x140; - } - decref(v132); - VAL v212 = mw_std_list_List_1_reverse(v131); - decref(v130); - VAL v213 = mw_std_list_List_1_cat(v44, v212); - int64_t v214 = 1LL /* True */; - x51 = v214; - x50 = v47; - x49 = v213; - x48 = v129; - } break; - case 0LL: { // None - int64_t v215 = 0LL /* False */; - x51 = v215; - x50 = v47; - x49 = v44; - x48 = v20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v216 = (x48); - VAL v217 = x49; - VAL v218 = x50; - int64_t v219 = x51; - while (((bool)v219)) { - VAL v220 = (v216); - VAL v221 = v217; - VAL v222 = v218; - VAL v223; - VAL v224; - mw_std_list_List_1_uncons(v222, &v223, &v224); - VAL x225; - VAL x226; - VAL x227; - int64_t x228; - switch (get_data_tag(v223)) { - case 1LL: { // Some - VAL v229 = mtp_std_maybe_Maybe_1_Some(v223); - incref(v221); - VAL v230 = MKI64(0LL /* Nil */); - VAL v231 = mw_std_list_List_1_reverse(v230); - VAL v232; - VAL v233; - mw_std_list_List_1_uncons(v229, &v232, &v233); - VAL x234; - VAL x235; - VAL x236; - VAL x237; - int64_t x238; - switch (get_data_tag(v232)) { - case 1LL: { // Some - VAL v239 = mtp_std_maybe_Maybe_1_Some(v232); - incref(v239); - incref(v221); - VAL v240 = MKI64(0LL /* None */); - VAL v241; - VAL v242; - mw_std_list_List_1_uncons(v221, &v241, &v242); - VAL x243; - uint64_t x244; - VAL x245; - VAL x246; - int64_t x247; - switch (get_data_tag(v241)) { - case 1LL: { // Some - VAL v248 = mtp_std_maybe_Maybe_1_Some(v241); - incref(v248); - incref(v239); - int64_t v249 = mw_mirth_var_Var_ZEqualZEqual(VU64(v239), VU64(v248)); - VAL x250; - uint64_t x251; - VAL x252; - if (((bool)v249)) { - VAL v253 = mtw_std_maybe_Maybe_1_Some(v248); - x252 = v253; - x251 = VU64(v239); - x250 = v220; - } else { - decref(v248); - VAL v254 = MKI64(0LL /* None */); - x252 = v254; - x251 = VU64(v239); - x250 = v220; - } - VAL x255; - uint64_t x256; - VAL x257; - VAL x258; - switch (get_data_tag(x252)) { - case 0LL: { // None - x258 = v242; - x257 = v240; - x256 = x251; - x255 = x250; - } break; - default: { - decref(v242); - decref(v240); - VAL v259 = MKI64(0LL /* Nil */); - x258 = v259; - x257 = x252; - x256 = x251; - x255 = x250; - } break; - } - int64_t v260 = 1LL /* True */; - x247 = v260; - x246 = x258; - x245 = x257; - x244 = x256; - x243 = x255; - } break; - case 0LL: { // None - int64_t v261 = 0LL /* False */; - x247 = v261; - x246 = v242; - x245 = v240; - x244 = VU64(v239); - x243 = v220; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v262 = (x243); - uint64_t v263 = x244; - VAL v264 = x245; - VAL v265 = x246; - int64_t v266 = x247; - while (((bool)v266)) { - VAL v267 = (v262); - uint64_t v268 = v263; - VAL v269 = v264; - VAL v270 = v265; - VAL v271; - VAL v272; - mw_std_list_List_1_uncons(v270, &v271, &v272); - VAL x273; - uint64_t x274; - VAL x275; - VAL x276; - int64_t x277; - switch (get_data_tag(v271)) { - case 1LL: { // Some - VAL v278 = mtp_std_maybe_Maybe_1_Some(v271); - incref(v278); - int64_t v279 = mw_mirth_var_Var_ZEqualZEqual(v268, VU64(v278)); - VAL x280; - uint64_t x281; - VAL x282; - if (((bool)v279)) { - VAL v283 = mtw_std_maybe_Maybe_1_Some(v278); - x282 = v283; - x281 = v268; - x280 = v267; - } else { - decref(v278); - VAL v284 = MKI64(0LL /* None */); - x282 = v284; - x281 = v268; - x280 = v267; - } - VAL x285; - uint64_t x286; - VAL x287; - VAL x288; - switch (get_data_tag(x282)) { - case 0LL: { // None - x288 = v272; - x287 = v269; - x286 = x281; - x285 = x280; - } break; - default: { - decref(v272); - decref(v269); - VAL v289 = MKI64(0LL /* Nil */); - x288 = v289; - x287 = x282; - x286 = x281; - x285 = x280; - } break; - } - int64_t v290 = 1LL /* True */; - x277 = v290; - x276 = x288; - x275 = x287; - x274 = x286; - x273 = x285; - } break; - case 0LL: { // None - int64_t v291 = 0LL /* False */; - x277 = v291; - x276 = v272; - x275 = v269; - x274 = v268; - x273 = v267; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v266 = x277; - v265 = x276; - v264 = x275; - v263 = x274; - v262 = x273; - } - decref(v265); - int64_t v292 = mw_std_maybe_Maybe_1_someZAsk(v264); - bool v293 = !((bool)v292); - VAL x294; - VAL x295; - VAL x296; - if (v293) { - VAL v297 = mtw_std_maybe_Maybe_1_Some(v239); - x296 = v297; - x295 = v221; - x294 = v262; - } else { - decref(v239); - VAL v298 = MKI64(0LL /* None */); - x296 = v298; - x295 = v221; - x294 = v262; - } - VAL x299; - switch (get_data_tag(x296)) { - case 1LL: { // Some - VAL v300 = mtp_std_maybe_Maybe_1_Some(x296); - VAL v301 = mtw_std_list_List_1_Cons(v300, v231); - x299 = v301; - push_resource(x294); - push_value(x295); - } break; - case 0LL: { // None - x299 = v231; - push_resource(x294); - push_value(x295); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v302 = 1LL /* True */; - x238 = v302; - x237 = v233; - x236 = x299; - VAL v303 = pop_value(); - x235 = v303; - VAL r304 = pop_resource(); - x234 = r304; - } break; - case 0LL: { // None - int64_t v305 = 0LL /* False */; - x238 = v305; - x237 = v233; - x236 = v231; - x235 = v221; - x234 = v220; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v306 = (x234); - VAL v307 = x235; - VAL v308 = (x236); - VAL v309 = x237; - int64_t v310 = x238; - while (((bool)v310)) { - VAL v311 = (v306); - VAL v312 = v307; - VAL v313 = (v308); - VAL v314 = v309; - VAL v315; - VAL v316; - mw_std_list_List_1_uncons(v314, &v315, &v316); - VAL x317; - VAL x318; - VAL x319; - VAL x320; - int64_t x321; - switch (get_data_tag(v315)) { - case 1LL: { // Some - VAL v322 = mtp_std_maybe_Maybe_1_Some(v315); - incref(v322); - incref(v312); - VAL v323 = MKI64(0LL /* None */); - VAL v324; - VAL v325; - mw_std_list_List_1_uncons(v312, &v324, &v325); - VAL x326; - uint64_t x327; - VAL x328; - VAL x329; - int64_t x330; - switch (get_data_tag(v324)) { - case 1LL: { // Some - VAL v331 = mtp_std_maybe_Maybe_1_Some(v324); - incref(v331); - incref(v322); - int64_t v332 = mw_mirth_var_Var_ZEqualZEqual(VU64(v322), VU64(v331)); - VAL x333; - uint64_t x334; - VAL x335; - if (((bool)v332)) { - VAL v336 = mtw_std_maybe_Maybe_1_Some(v331); - x335 = v336; - x334 = VU64(v322); - x333 = v311; - } else { - decref(v331); - VAL v337 = MKI64(0LL /* None */); - x335 = v337; - x334 = VU64(v322); - x333 = v311; - } - VAL x338; - uint64_t x339; - VAL x340; - VAL x341; - switch (get_data_tag(x335)) { - case 0LL: { // None - x341 = v325; - x340 = v323; - x339 = x334; - x338 = x333; - } break; - default: { - decref(v325); - decref(v323); - VAL v342 = MKI64(0LL /* Nil */); - x341 = v342; - x340 = x335; - x339 = x334; - x338 = x333; - } break; - } - int64_t v343 = 1LL /* True */; - x330 = v343; - x329 = x341; - x328 = x340; - x327 = x339; - x326 = x338; - } break; - case 0LL: { // None - int64_t v344 = 0LL /* False */; - x330 = v344; - x329 = v325; - x328 = v323; - x327 = VU64(v322); - x326 = v311; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v345 = (x326); - uint64_t v346 = x327; - VAL v347 = x328; - VAL v348 = x329; - int64_t v349 = x330; - while (((bool)v349)) { - VAL v350 = (v345); - uint64_t v351 = v346; - VAL v352 = v347; - VAL v353 = v348; - VAL v354; - VAL v355; - mw_std_list_List_1_uncons(v353, &v354, &v355); - VAL x356; - uint64_t x357; - VAL x358; - VAL x359; - int64_t x360; - switch (get_data_tag(v354)) { - case 1LL: { // Some - VAL v361 = mtp_std_maybe_Maybe_1_Some(v354); - incref(v361); - int64_t v362 = mw_mirth_var_Var_ZEqualZEqual(v351, VU64(v361)); - VAL x363; - uint64_t x364; - VAL x365; - if (((bool)v362)) { - VAL v366 = mtw_std_maybe_Maybe_1_Some(v361); - x365 = v366; - x364 = v351; - x363 = v350; - } else { - decref(v361); - VAL v367 = MKI64(0LL /* None */); - x365 = v367; - x364 = v351; - x363 = v350; - } - VAL x368; - uint64_t x369; - VAL x370; - VAL x371; - switch (get_data_tag(x365)) { - case 0LL: { // None - x371 = v355; - x370 = v352; - x369 = x364; - x368 = x363; - } break; - default: { - decref(v355); - decref(v352); - VAL v372 = MKI64(0LL /* Nil */); - x371 = v372; - x370 = x365; - x369 = x364; - x368 = x363; - } break; - } - int64_t v373 = 1LL /* True */; - x360 = v373; - x359 = x371; - x358 = x370; - x357 = x369; - x356 = x368; - } break; - case 0LL: { // None - int64_t v374 = 0LL /* False */; - x360 = v374; - x359 = v355; - x358 = v352; - x357 = v351; - x356 = v350; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v349 = x360; - v348 = x359; - v347 = x358; - v346 = x357; - v345 = x356; - } - decref(v348); - int64_t v375 = mw_std_maybe_Maybe_1_someZAsk(v347); - bool v376 = !((bool)v375); - VAL x377; - VAL x378; - VAL x379; - if (v376) { - VAL v380 = mtw_std_maybe_Maybe_1_Some(v322); - x379 = v380; - x378 = v312; - x377 = v345; - } else { - decref(v322); - VAL v381 = MKI64(0LL /* None */); - x379 = v381; - x378 = v312; - x377 = v345; - } - VAL x382; - switch (get_data_tag(x379)) { - case 1LL: { // Some - VAL v383 = mtp_std_maybe_Maybe_1_Some(x379); - VAL v384 = mtw_std_list_List_1_Cons(v383, v313); - x382 = v384; - push_resource(x377); - push_value(x378); - } break; - case 0LL: { // None - x382 = v313; - push_resource(x377); - push_value(x378); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v385 = 1LL /* True */; - x321 = v385; - x320 = v316; - x319 = x382; - VAL v386 = pop_value(); - x318 = v386; - VAL r387 = pop_resource(); - x317 = r387; - } break; - case 0LL: { // None - int64_t v388 = 0LL /* False */; - x321 = v388; - x320 = v316; - x319 = v313; - x318 = v312; - x317 = v311; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v310 = x321; - v309 = x320; - v308 = x319; - v307 = x318; - v306 = x317; - } - decref(v309); - VAL v389 = mw_std_list_List_1_reverse(v308); - decref(v307); - VAL v390 = mw_std_list_List_1_cat(v221, v389); - int64_t v391 = 1LL /* True */; - x228 = v391; - x227 = v224; - x226 = v390; - x225 = v306; - } break; - case 0LL: { // None - int64_t v392 = 0LL /* False */; - x228 = v392; - x227 = v224; - x226 = v221; - x225 = v220; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v219 = x228; - v218 = x227; - v217 = x226; - v216 = x225; - } - decref(v218); - VAL v393 = mtw_std_maybe_Maybe_1_Some(v217); - x42 = v393; - x41 = v216; - } break; - case 0LL: { // None - VAL v394 = MKI64(0LL /* None */); - x42 = v394; - x41 = v20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x395; - VAL x396; - switch (get_data_tag(x42)) { - case 1LL: { // Some - VAL v397 = mtp_std_maybe_Maybe_1_Some(x42); - x396 = v397; - x395 = x41; - } break; - case 0LL: { // None - VAL v398 = MKI64(0LL /* Nil */); - x396 = v398; - x395 = x41; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v13 = x21; + v12 = x21; + v11 = x20; + v10 = x19; + v9 = x18; } - *x4 = x396; - *x3 = x395; + decref(v11); + VAL v30 = mw_std_list_List_1_reverse(v10); + VAL v31 = mw_std_list_List_1_unions_1_sp1(v30); + *x4 = v31; + *x3 = v9; } static void mw_mirth_arrow_Atom_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4) { incref(x2); @@ -19201,1761 +15425,66 @@ static void mw_mirth_arrow_Atom_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4) { decref(x2); VAL v6 = MKI64(0LL /* Nil */); VAL v7 = mw_std_list_List_1_reverse(v6); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v5, &v8, &v9); - VAL x10; - VAL x11; - VAL x12; - VAL x13; - int64_t x14; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v15 = mtp_std_maybe_Maybe_1_Some(v8); - VAL v16; - VAL v17; - mw_mirth_arrow_Arg_freeZ_vars(x1, VU64(v15), &v16, &v17); - VAL v18 = mtw_std_list_List_1_Cons(v17, v7); - int64_t v19 = 1LL /* True */; - x14 = v19; - x13 = v9; - x12 = v18; - x11 = x2; - x10 = v16; - } break; - case 0LL: { // None - int64_t v20 = 0LL /* False */; - x14 = v20; - x13 = v9; - x12 = v7; - x11 = x2; - x10 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v21 = (x10); - VAL v22 = x11; - VAL v23 = (x12); - VAL v24 = x13; - int64_t v25 = x14; - while (((bool)v25)) { - VAL v26 = (v21); - VAL v27 = v22; - VAL v28 = (v23); - VAL v29 = v24; - VAL v30; - VAL v31; - mw_std_list_List_1_uncons(v29, &v30, &v31); - VAL x32; - VAL x33; - VAL x34; - VAL x35; - int64_t x36; - switch (get_data_tag(v30)) { - case 1LL: { // Some - VAL v37 = mtp_std_maybe_Maybe_1_Some(v30); - VAL v38; - VAL v39; - mw_mirth_arrow_Arg_freeZ_vars(v26, VU64(v37), &v38, &v39); - VAL v40 = mtw_std_list_List_1_Cons(v39, v28); - int64_t v41 = 1LL /* True */; - x36 = v41; - x35 = v31; - x34 = v40; - x33 = v27; - x32 = v38; + int64_t v8 = 1LL /* True */; + VAL v9 = x1; + VAL v10 = v7; + VAL v11 = v5; + int64_t v12 = v8; + int64_t v13 = v8; + while (((bool)v13)) { + VAL v14 = v9; + VAL v15 = v10; + VAL v16 = v11; + int64_t v17 = v12; + VAL x18; + VAL x19; + VAL x20; + int64_t x21; + switch (get_data_tag(v16)) { + case 1LL: { // Cons + VAL v22; + VAL v23; + mtp_std_list_List_1_Cons(v16, &v22, &v23); + VAL v24; + VAL v25; + mw_mirth_arrow_Arg_freeZ_vars(v14, VU64(v22), &v24, &v25); + VAL v26 = mtw_std_list_List_1_Cons(v25, v15); + int64_t v27 = 1LL /* True */; + x21 = v27; + x20 = v23; + x19 = v26; + x18 = v24; } break; - case 0LL: { // None - int64_t v42 = 0LL /* False */; - x36 = v42; - x35 = v31; - x34 = v28; - x33 = v27; - x32 = v26; + case 0LL: { // Nil + VAL v28 = MKI64(0LL /* Nil */); + int64_t v29 = 0LL /* False */; + x21 = v29; + x20 = v28; + x19 = v15; + x18 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v25 = x36; - v24 = x35; - v23 = x34; - v22 = x33; - v21 = x32; + v13 = x21; + v12 = x21; + v11 = x20; + v10 = x19; + v9 = x18; } - decref(v24); - VAL v43 = mw_std_list_List_1_reverse(v23); - VAL v44 = mw_std_list_List_1_ZToListZPlus(v43); - VAL x45; - VAL x46; - VAL x47; - switch (get_data_tag(v44)) { - case 1LL: { // Some - VAL v48 = mtp_std_maybe_Maybe_1_Some(v44); - VAL v49; - VAL v50; - mw_std_list_ListZPlus_1_uncons(v48, &v49, &v50); - VAL v51; - VAL v52; - mw_std_list_List_1_uncons(v50, &v51, &v52); - VAL x53; - VAL x54; - VAL x55; - VAL x56; - int64_t x57; - switch (get_data_tag(v51)) { - case 1LL: { // Some - VAL v58 = mtp_std_maybe_Maybe_1_Some(v51); - incref(v49); - VAL v59 = MKI64(0LL /* Nil */); - VAL v60 = mw_std_list_List_1_reverse(v59); - VAL v61; - VAL v62; - mw_std_list_List_1_uncons(v58, &v61, &v62); - VAL x63; - VAL x64; - VAL x65; - VAL x66; - VAL x67; - int64_t x68; - switch (get_data_tag(v61)) { - case 1LL: { // Some - VAL v69 = mtp_std_maybe_Maybe_1_Some(v61); - incref(v69); - incref(v49); - VAL v70 = MKI64(0LL /* None */); - VAL v71; - VAL v72; - mw_std_list_List_1_uncons(v49, &v71, &v72); - VAL x73; - VAL x74; - uint64_t x75; - VAL x76; - VAL x77; - int64_t x78; - switch (get_data_tag(v71)) { - case 1LL: { // Some - VAL v79 = mtp_std_maybe_Maybe_1_Some(v71); - incref(v79); - incref(v69); - int64_t v80 = mw_mirth_var_Var_ZEqualZEqual(VU64(v69), VU64(v79)); - VAL x81; - VAL x82; - uint64_t x83; - VAL x84; - if (((bool)v80)) { - VAL v85 = mtw_std_maybe_Maybe_1_Some(v79); - x84 = v85; - x83 = VU64(v69); - x82 = v22; - x81 = v21; - } else { - decref(v79); - VAL v86 = MKI64(0LL /* None */); - x84 = v86; - x83 = VU64(v69); - x82 = v22; - x81 = v21; - } - VAL x87; - VAL x88; - uint64_t x89; - VAL x90; - VAL x91; - switch (get_data_tag(x84)) { - case 0LL: { // None - x91 = v72; - x90 = v70; - x89 = x83; - x88 = x82; - x87 = x81; - } break; - default: { - decref(v72); - decref(v70); - VAL v92 = MKI64(0LL /* Nil */); - x91 = v92; - x90 = x84; - x89 = x83; - x88 = x82; - x87 = x81; - } break; - } - int64_t v93 = 1LL /* True */; - x78 = v93; - x77 = x91; - x76 = x90; - x75 = x89; - x74 = x88; - x73 = x87; - } break; - case 0LL: { // None - int64_t v94 = 0LL /* False */; - x78 = v94; - x77 = v72; - x76 = v70; - x75 = VU64(v69); - x74 = v22; - x73 = v21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v95 = (x73); - VAL v96 = x74; - uint64_t v97 = x75; - VAL v98 = x76; - VAL v99 = x77; - int64_t v100 = x78; - while (((bool)v100)) { - VAL v101 = (v95); - VAL v102 = v96; - uint64_t v103 = v97; - VAL v104 = v98; - VAL v105 = v99; - VAL v106; - VAL v107; - mw_std_list_List_1_uncons(v105, &v106, &v107); - VAL x108; - VAL x109; - uint64_t x110; - VAL x111; - VAL x112; - int64_t x113; - switch (get_data_tag(v106)) { - case 1LL: { // Some - VAL v114 = mtp_std_maybe_Maybe_1_Some(v106); - incref(v114); - int64_t v115 = mw_mirth_var_Var_ZEqualZEqual(v103, VU64(v114)); - VAL x116; - VAL x117; - uint64_t x118; - VAL x119; - if (((bool)v115)) { - VAL v120 = mtw_std_maybe_Maybe_1_Some(v114); - x119 = v120; - x118 = v103; - x117 = v102; - x116 = v101; - } else { - decref(v114); - VAL v121 = MKI64(0LL /* None */); - x119 = v121; - x118 = v103; - x117 = v102; - x116 = v101; - } - VAL x122; - VAL x123; - uint64_t x124; - VAL x125; - VAL x126; - switch (get_data_tag(x119)) { - case 0LL: { // None - x126 = v107; - x125 = v104; - x124 = x118; - x123 = x117; - x122 = x116; - } break; - default: { - decref(v107); - decref(v104); - VAL v127 = MKI64(0LL /* Nil */); - x126 = v127; - x125 = x119; - x124 = x118; - x123 = x117; - x122 = x116; - } break; - } - int64_t v128 = 1LL /* True */; - x113 = v128; - x112 = x126; - x111 = x125; - x110 = x124; - x109 = x123; - x108 = x122; - } break; - case 0LL: { // None - int64_t v129 = 0LL /* False */; - x113 = v129; - x112 = v107; - x111 = v104; - x110 = v103; - x109 = v102; - x108 = v101; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v100 = x113; - v99 = x112; - v98 = x111; - v97 = x110; - v96 = x109; - v95 = x108; - } - decref(v99); - int64_t v130 = mw_std_maybe_Maybe_1_someZAsk(v98); - bool v131 = !((bool)v130); - VAL x132; - VAL x133; - VAL x134; - VAL x135; - if (v131) { - VAL v136 = mtw_std_maybe_Maybe_1_Some(v69); - x135 = v136; - x134 = v49; - x133 = v96; - x132 = v95; - } else { - decref(v69); - VAL v137 = MKI64(0LL /* None */); - x135 = v137; - x134 = v49; - x133 = v96; - x132 = v95; - } - VAL x138; - switch (get_data_tag(x135)) { - case 1LL: { // Some - VAL v139 = mtp_std_maybe_Maybe_1_Some(x135); - VAL v140 = mtw_std_list_List_1_Cons(v139, v60); - x138 = v140; - push_resource(x132); - push_value(x133); - push_value(x134); - } break; - case 0LL: { // None - x138 = v60; - push_resource(x132); - push_value(x133); - push_value(x134); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v141 = 1LL /* True */; - x68 = v141; - x67 = v62; - x66 = x138; - VAL v142 = pop_value(); - x65 = v142; - VAL v143 = pop_value(); - x64 = v143; - VAL r144 = pop_resource(); - x63 = r144; - } break; - case 0LL: { // None - int64_t v145 = 0LL /* False */; - x68 = v145; - x67 = v62; - x66 = v60; - x65 = v49; - x64 = v22; - x63 = v21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v146 = (x63); - VAL v147 = x64; - VAL v148 = x65; - VAL v149 = (x66); - VAL v150 = x67; - int64_t v151 = x68; - while (((bool)v151)) { - VAL v152 = (v146); - VAL v153 = v147; - VAL v154 = v148; - VAL v155 = (v149); - VAL v156 = v150; - VAL v157; - VAL v158; - mw_std_list_List_1_uncons(v156, &v157, &v158); - VAL x159; - VAL x160; - VAL x161; - VAL x162; - VAL x163; - int64_t x164; - switch (get_data_tag(v157)) { - case 1LL: { // Some - VAL v165 = mtp_std_maybe_Maybe_1_Some(v157); - incref(v165); - incref(v154); - VAL v166 = MKI64(0LL /* None */); - VAL v167; - VAL v168; - mw_std_list_List_1_uncons(v154, &v167, &v168); - VAL x169; - VAL x170; - uint64_t x171; - VAL x172; - VAL x173; - int64_t x174; - switch (get_data_tag(v167)) { - case 1LL: { // Some - VAL v175 = mtp_std_maybe_Maybe_1_Some(v167); - incref(v175); - incref(v165); - int64_t v176 = mw_mirth_var_Var_ZEqualZEqual(VU64(v165), VU64(v175)); - VAL x177; - VAL x178; - uint64_t x179; - VAL x180; - if (((bool)v176)) { - VAL v181 = mtw_std_maybe_Maybe_1_Some(v175); - x180 = v181; - x179 = VU64(v165); - x178 = v153; - x177 = v152; - } else { - decref(v175); - VAL v182 = MKI64(0LL /* None */); - x180 = v182; - x179 = VU64(v165); - x178 = v153; - x177 = v152; - } - VAL x183; - VAL x184; - uint64_t x185; - VAL x186; - VAL x187; - switch (get_data_tag(x180)) { - case 0LL: { // None - x187 = v168; - x186 = v166; - x185 = x179; - x184 = x178; - x183 = x177; - } break; - default: { - decref(v168); - decref(v166); - VAL v188 = MKI64(0LL /* Nil */); - x187 = v188; - x186 = x180; - x185 = x179; - x184 = x178; - x183 = x177; - } break; - } - int64_t v189 = 1LL /* True */; - x174 = v189; - x173 = x187; - x172 = x186; - x171 = x185; - x170 = x184; - x169 = x183; - } break; - case 0LL: { // None - int64_t v190 = 0LL /* False */; - x174 = v190; - x173 = v168; - x172 = v166; - x171 = VU64(v165); - x170 = v153; - x169 = v152; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v191 = (x169); - VAL v192 = x170; - uint64_t v193 = x171; - VAL v194 = x172; - VAL v195 = x173; - int64_t v196 = x174; - while (((bool)v196)) { - VAL v197 = (v191); - VAL v198 = v192; - uint64_t v199 = v193; - VAL v200 = v194; - VAL v201 = v195; - VAL v202; - VAL v203; - mw_std_list_List_1_uncons(v201, &v202, &v203); - VAL x204; - VAL x205; - uint64_t x206; - VAL x207; - VAL x208; - int64_t x209; - switch (get_data_tag(v202)) { - case 1LL: { // Some - VAL v210 = mtp_std_maybe_Maybe_1_Some(v202); - incref(v210); - int64_t v211 = mw_mirth_var_Var_ZEqualZEqual(v199, VU64(v210)); - VAL x212; - VAL x213; - uint64_t x214; - VAL x215; - if (((bool)v211)) { - VAL v216 = mtw_std_maybe_Maybe_1_Some(v210); - x215 = v216; - x214 = v199; - x213 = v198; - x212 = v197; - } else { - decref(v210); - VAL v217 = MKI64(0LL /* None */); - x215 = v217; - x214 = v199; - x213 = v198; - x212 = v197; - } - VAL x218; - VAL x219; - uint64_t x220; - VAL x221; - VAL x222; - switch (get_data_tag(x215)) { - case 0LL: { // None - x222 = v203; - x221 = v200; - x220 = x214; - x219 = x213; - x218 = x212; - } break; - default: { - decref(v203); - decref(v200); - VAL v223 = MKI64(0LL /* Nil */); - x222 = v223; - x221 = x215; - x220 = x214; - x219 = x213; - x218 = x212; - } break; - } - int64_t v224 = 1LL /* True */; - x209 = v224; - x208 = x222; - x207 = x221; - x206 = x220; - x205 = x219; - x204 = x218; - } break; - case 0LL: { // None - int64_t v225 = 0LL /* False */; - x209 = v225; - x208 = v203; - x207 = v200; - x206 = v199; - x205 = v198; - x204 = v197; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v196 = x209; - v195 = x208; - v194 = x207; - v193 = x206; - v192 = x205; - v191 = x204; - } - decref(v195); - int64_t v226 = mw_std_maybe_Maybe_1_someZAsk(v194); - bool v227 = !((bool)v226); - VAL x228; - VAL x229; - VAL x230; - VAL x231; - if (v227) { - VAL v232 = mtw_std_maybe_Maybe_1_Some(v165); - x231 = v232; - x230 = v154; - x229 = v192; - x228 = v191; - } else { - decref(v165); - VAL v233 = MKI64(0LL /* None */); - x231 = v233; - x230 = v154; - x229 = v192; - x228 = v191; - } - VAL x234; - switch (get_data_tag(x231)) { - case 1LL: { // Some - VAL v235 = mtp_std_maybe_Maybe_1_Some(x231); - VAL v236 = mtw_std_list_List_1_Cons(v235, v155); - x234 = v236; - push_resource(x228); - push_value(x229); - push_value(x230); - } break; - case 0LL: { // None - x234 = v155; - push_resource(x228); - push_value(x229); - push_value(x230); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v237 = 1LL /* True */; - x164 = v237; - x163 = v158; - x162 = x234; - VAL v238 = pop_value(); - x161 = v238; - VAL v239 = pop_value(); - x160 = v239; - VAL r240 = pop_resource(); - x159 = r240; - } break; - case 0LL: { // None - int64_t v241 = 0LL /* False */; - x164 = v241; - x163 = v158; - x162 = v155; - x161 = v154; - x160 = v153; - x159 = v152; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v151 = x164; - v150 = x163; - v149 = x162; - v148 = x161; - v147 = x160; - v146 = x159; - } - decref(v150); - VAL v242 = mw_std_list_List_1_reverse(v149); - decref(v148); - VAL v243 = mw_std_list_List_1_cat(v49, v242); - int64_t v244 = 1LL /* True */; - x57 = v244; - x56 = v52; - x55 = v243; - x54 = v147; - x53 = v146; - } break; - case 0LL: { // None - int64_t v245 = 0LL /* False */; - x57 = v245; - x56 = v52; - x55 = v49; - x54 = v22; - x53 = v21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v246 = (x53); - VAL v247 = x54; - VAL v248 = x55; - VAL v249 = x56; - int64_t v250 = x57; - while (((bool)v250)) { - VAL v251 = (v246); - VAL v252 = v247; - VAL v253 = v248; - VAL v254 = v249; - VAL v255; - VAL v256; - mw_std_list_List_1_uncons(v254, &v255, &v256); - VAL x257; - VAL x258; - VAL x259; - VAL x260; - int64_t x261; - switch (get_data_tag(v255)) { - case 1LL: { // Some - VAL v262 = mtp_std_maybe_Maybe_1_Some(v255); - incref(v253); - VAL v263 = MKI64(0LL /* Nil */); - VAL v264 = mw_std_list_List_1_reverse(v263); - VAL v265; - VAL v266; - mw_std_list_List_1_uncons(v262, &v265, &v266); - VAL x267; - VAL x268; - VAL x269; - VAL x270; - VAL x271; - int64_t x272; - switch (get_data_tag(v265)) { - case 1LL: { // Some - VAL v273 = mtp_std_maybe_Maybe_1_Some(v265); - incref(v273); - incref(v253); - VAL v274 = MKI64(0LL /* None */); - VAL v275; - VAL v276; - mw_std_list_List_1_uncons(v253, &v275, &v276); - VAL x277; - VAL x278; - uint64_t x279; - VAL x280; - VAL x281; - int64_t x282; - switch (get_data_tag(v275)) { - case 1LL: { // Some - VAL v283 = mtp_std_maybe_Maybe_1_Some(v275); - incref(v283); - incref(v273); - int64_t v284 = mw_mirth_var_Var_ZEqualZEqual(VU64(v273), VU64(v283)); - VAL x285; - VAL x286; - uint64_t x287; - VAL x288; - if (((bool)v284)) { - VAL v289 = mtw_std_maybe_Maybe_1_Some(v283); - x288 = v289; - x287 = VU64(v273); - x286 = v252; - x285 = v251; - } else { - decref(v283); - VAL v290 = MKI64(0LL /* None */); - x288 = v290; - x287 = VU64(v273); - x286 = v252; - x285 = v251; - } - VAL x291; - VAL x292; - uint64_t x293; - VAL x294; - VAL x295; - switch (get_data_tag(x288)) { - case 0LL: { // None - x295 = v276; - x294 = v274; - x293 = x287; - x292 = x286; - x291 = x285; - } break; - default: { - decref(v276); - decref(v274); - VAL v296 = MKI64(0LL /* Nil */); - x295 = v296; - x294 = x288; - x293 = x287; - x292 = x286; - x291 = x285; - } break; - } - int64_t v297 = 1LL /* True */; - x282 = v297; - x281 = x295; - x280 = x294; - x279 = x293; - x278 = x292; - x277 = x291; - } break; - case 0LL: { // None - int64_t v298 = 0LL /* False */; - x282 = v298; - x281 = v276; - x280 = v274; - x279 = VU64(v273); - x278 = v252; - x277 = v251; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v299 = (x277); - VAL v300 = x278; - uint64_t v301 = x279; - VAL v302 = x280; - VAL v303 = x281; - int64_t v304 = x282; - while (((bool)v304)) { - VAL v305 = (v299); - VAL v306 = v300; - uint64_t v307 = v301; - VAL v308 = v302; - VAL v309 = v303; - VAL v310; - VAL v311; - mw_std_list_List_1_uncons(v309, &v310, &v311); - VAL x312; - VAL x313; - uint64_t x314; - VAL x315; - VAL x316; - int64_t x317; - switch (get_data_tag(v310)) { - case 1LL: { // Some - VAL v318 = mtp_std_maybe_Maybe_1_Some(v310); - incref(v318); - int64_t v319 = mw_mirth_var_Var_ZEqualZEqual(v307, VU64(v318)); - VAL x320; - VAL x321; - uint64_t x322; - VAL x323; - if (((bool)v319)) { - VAL v324 = mtw_std_maybe_Maybe_1_Some(v318); - x323 = v324; - x322 = v307; - x321 = v306; - x320 = v305; - } else { - decref(v318); - VAL v325 = MKI64(0LL /* None */); - x323 = v325; - x322 = v307; - x321 = v306; - x320 = v305; - } - VAL x326; - VAL x327; - uint64_t x328; - VAL x329; - VAL x330; - switch (get_data_tag(x323)) { - case 0LL: { // None - x330 = v311; - x329 = v308; - x328 = x322; - x327 = x321; - x326 = x320; - } break; - default: { - decref(v311); - decref(v308); - VAL v331 = MKI64(0LL /* Nil */); - x330 = v331; - x329 = x323; - x328 = x322; - x327 = x321; - x326 = x320; - } break; - } - int64_t v332 = 1LL /* True */; - x317 = v332; - x316 = x330; - x315 = x329; - x314 = x328; - x313 = x327; - x312 = x326; - } break; - case 0LL: { // None - int64_t v333 = 0LL /* False */; - x317 = v333; - x316 = v311; - x315 = v308; - x314 = v307; - x313 = v306; - x312 = v305; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v304 = x317; - v303 = x316; - v302 = x315; - v301 = x314; - v300 = x313; - v299 = x312; - } - decref(v303); - int64_t v334 = mw_std_maybe_Maybe_1_someZAsk(v302); - bool v335 = !((bool)v334); - VAL x336; - VAL x337; - VAL x338; - VAL x339; - if (v335) { - VAL v340 = mtw_std_maybe_Maybe_1_Some(v273); - x339 = v340; - x338 = v253; - x337 = v300; - x336 = v299; - } else { - decref(v273); - VAL v341 = MKI64(0LL /* None */); - x339 = v341; - x338 = v253; - x337 = v300; - x336 = v299; - } - VAL x342; - switch (get_data_tag(x339)) { - case 1LL: { // Some - VAL v343 = mtp_std_maybe_Maybe_1_Some(x339); - VAL v344 = mtw_std_list_List_1_Cons(v343, v264); - x342 = v344; - push_resource(x336); - push_value(x337); - push_value(x338); - } break; - case 0LL: { // None - x342 = v264; - push_resource(x336); - push_value(x337); - push_value(x338); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v345 = 1LL /* True */; - x272 = v345; - x271 = v266; - x270 = x342; - VAL v346 = pop_value(); - x269 = v346; - VAL v347 = pop_value(); - x268 = v347; - VAL r348 = pop_resource(); - x267 = r348; - } break; - case 0LL: { // None - int64_t v349 = 0LL /* False */; - x272 = v349; - x271 = v266; - x270 = v264; - x269 = v253; - x268 = v252; - x267 = v251; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v350 = (x267); - VAL v351 = x268; - VAL v352 = x269; - VAL v353 = (x270); - VAL v354 = x271; - int64_t v355 = x272; - while (((bool)v355)) { - VAL v356 = (v350); - VAL v357 = v351; - VAL v358 = v352; - VAL v359 = (v353); - VAL v360 = v354; - VAL v361; - VAL v362; - mw_std_list_List_1_uncons(v360, &v361, &v362); - VAL x363; - VAL x364; - VAL x365; - VAL x366; - VAL x367; - int64_t x368; - switch (get_data_tag(v361)) { - case 1LL: { // Some - VAL v369 = mtp_std_maybe_Maybe_1_Some(v361); - incref(v369); - incref(v358); - VAL v370 = MKI64(0LL /* None */); - VAL v371; - VAL v372; - mw_std_list_List_1_uncons(v358, &v371, &v372); - VAL x373; - VAL x374; - uint64_t x375; - VAL x376; - VAL x377; - int64_t x378; - switch (get_data_tag(v371)) { - case 1LL: { // Some - VAL v379 = mtp_std_maybe_Maybe_1_Some(v371); - incref(v379); - incref(v369); - int64_t v380 = mw_mirth_var_Var_ZEqualZEqual(VU64(v369), VU64(v379)); - VAL x381; - VAL x382; - uint64_t x383; - VAL x384; - if (((bool)v380)) { - VAL v385 = mtw_std_maybe_Maybe_1_Some(v379); - x384 = v385; - x383 = VU64(v369); - x382 = v357; - x381 = v356; - } else { - decref(v379); - VAL v386 = MKI64(0LL /* None */); - x384 = v386; - x383 = VU64(v369); - x382 = v357; - x381 = v356; - } - VAL x387; - VAL x388; - uint64_t x389; - VAL x390; - VAL x391; - switch (get_data_tag(x384)) { - case 0LL: { // None - x391 = v372; - x390 = v370; - x389 = x383; - x388 = x382; - x387 = x381; - } break; - default: { - decref(v372); - decref(v370); - VAL v392 = MKI64(0LL /* Nil */); - x391 = v392; - x390 = x384; - x389 = x383; - x388 = x382; - x387 = x381; - } break; - } - int64_t v393 = 1LL /* True */; - x378 = v393; - x377 = x391; - x376 = x390; - x375 = x389; - x374 = x388; - x373 = x387; - } break; - case 0LL: { // None - int64_t v394 = 0LL /* False */; - x378 = v394; - x377 = v372; - x376 = v370; - x375 = VU64(v369); - x374 = v357; - x373 = v356; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v395 = (x373); - VAL v396 = x374; - uint64_t v397 = x375; - VAL v398 = x376; - VAL v399 = x377; - int64_t v400 = x378; - while (((bool)v400)) { - VAL v401 = (v395); - VAL v402 = v396; - uint64_t v403 = v397; - VAL v404 = v398; - VAL v405 = v399; - VAL v406; - VAL v407; - mw_std_list_List_1_uncons(v405, &v406, &v407); - VAL x408; - VAL x409; - uint64_t x410; - VAL x411; - VAL x412; - int64_t x413; - switch (get_data_tag(v406)) { - case 1LL: { // Some - VAL v414 = mtp_std_maybe_Maybe_1_Some(v406); - incref(v414); - int64_t v415 = mw_mirth_var_Var_ZEqualZEqual(v403, VU64(v414)); - VAL x416; - VAL x417; - uint64_t x418; - VAL x419; - if (((bool)v415)) { - VAL v420 = mtw_std_maybe_Maybe_1_Some(v414); - x419 = v420; - x418 = v403; - x417 = v402; - x416 = v401; - } else { - decref(v414); - VAL v421 = MKI64(0LL /* None */); - x419 = v421; - x418 = v403; - x417 = v402; - x416 = v401; - } - VAL x422; - VAL x423; - uint64_t x424; - VAL x425; - VAL x426; - switch (get_data_tag(x419)) { - case 0LL: { // None - x426 = v407; - x425 = v404; - x424 = x418; - x423 = x417; - x422 = x416; - } break; - default: { - decref(v407); - decref(v404); - VAL v427 = MKI64(0LL /* Nil */); - x426 = v427; - x425 = x419; - x424 = x418; - x423 = x417; - x422 = x416; - } break; - } - int64_t v428 = 1LL /* True */; - x413 = v428; - x412 = x426; - x411 = x425; - x410 = x424; - x409 = x423; - x408 = x422; - } break; - case 0LL: { // None - int64_t v429 = 0LL /* False */; - x413 = v429; - x412 = v407; - x411 = v404; - x410 = v403; - x409 = v402; - x408 = v401; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v400 = x413; - v399 = x412; - v398 = x411; - v397 = x410; - v396 = x409; - v395 = x408; - } - decref(v399); - int64_t v430 = mw_std_maybe_Maybe_1_someZAsk(v398); - bool v431 = !((bool)v430); - VAL x432; - VAL x433; - VAL x434; - VAL x435; - if (v431) { - VAL v436 = mtw_std_maybe_Maybe_1_Some(v369); - x435 = v436; - x434 = v358; - x433 = v396; - x432 = v395; - } else { - decref(v369); - VAL v437 = MKI64(0LL /* None */); - x435 = v437; - x434 = v358; - x433 = v396; - x432 = v395; - } - VAL x438; - switch (get_data_tag(x435)) { - case 1LL: { // Some - VAL v439 = mtp_std_maybe_Maybe_1_Some(x435); - VAL v440 = mtw_std_list_List_1_Cons(v439, v359); - x438 = v440; - push_resource(x432); - push_value(x433); - push_value(x434); - } break; - case 0LL: { // None - x438 = v359; - push_resource(x432); - push_value(x433); - push_value(x434); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v441 = 1LL /* True */; - x368 = v441; - x367 = v362; - x366 = x438; - VAL v442 = pop_value(); - x365 = v442; - VAL v443 = pop_value(); - x364 = v443; - VAL r444 = pop_resource(); - x363 = r444; - } break; - case 0LL: { // None - int64_t v445 = 0LL /* False */; - x368 = v445; - x367 = v362; - x366 = v359; - x365 = v358; - x364 = v357; - x363 = v356; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v355 = x368; - v354 = x367; - v353 = x366; - v352 = x365; - v351 = x364; - v350 = x363; - } - decref(v354); - VAL v446 = mw_std_list_List_1_reverse(v353); - decref(v352); - VAL v447 = mw_std_list_List_1_cat(v253, v446); - int64_t v448 = 1LL /* True */; - x261 = v448; - x260 = v256; - x259 = v447; - x258 = v351; - x257 = v350; - } break; - case 0LL: { // None - int64_t v449 = 0LL /* False */; - x261 = v449; - x260 = v256; - x259 = v253; - x258 = v252; - x257 = v251; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v250 = x261; - v249 = x260; - v248 = x259; - v247 = x258; - v246 = x257; - } - decref(v249); - VAL v450 = mtw_std_maybe_Maybe_1_Some(v248); - x47 = v450; - x46 = v247; - x45 = v246; - } break; - case 0LL: { // None - VAL v451 = MKI64(0LL /* None */); - x47 = v451; - x46 = v22; - x45 = v21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x452; - switch (get_data_tag(x47)) { - case 1LL: { // Some - VAL v453 = mtp_std_maybe_Maybe_1_Some(x47); - x452 = v453; - push_resource(x45); - push_value(x46); - } break; - case 0LL: { // None - VAL v454 = MKI64(0LL /* Nil */); - x452 = v454; - push_resource(x45); - push_value(x46); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v455 = pop_value(); - VAL v456 = VVAL(VTUP(v455)->cells[4]); - incref(v456); - decref(v455); - VAL r457 = pop_resource(); - VAL v458; - VAL v459; - mw_mirth_arrow_Op_freeZ_vars(r457, v456, &v458, &v459); - incref(x452); - VAL v460 = MKI64(0LL /* Nil */); - VAL v461 = mw_std_list_List_1_reverse(v460); - VAL v462; - VAL v463; - mw_std_list_List_1_uncons(v459, &v462, &v463); - VAL x464; - VAL x465; - VAL x466; - VAL x467; - int64_t x468; - switch (get_data_tag(v462)) { - case 1LL: { // Some - VAL v469 = mtp_std_maybe_Maybe_1_Some(v462); - incref(v469); - incref(x452); - VAL v470 = MKI64(0LL /* None */); - VAL v471; - VAL v472; - mw_std_list_List_1_uncons(x452, &v471, &v472); - VAL x473; - uint64_t x474; - VAL x475; - VAL x476; - int64_t x477; - switch (get_data_tag(v471)) { - case 1LL: { // Some - VAL v478 = mtp_std_maybe_Maybe_1_Some(v471); - incref(v478); - incref(v469); - int64_t v479 = mw_mirth_var_Var_ZEqualZEqual(VU64(v469), VU64(v478)); - VAL x480; - uint64_t x481; - VAL x482; - if (((bool)v479)) { - VAL v483 = mtw_std_maybe_Maybe_1_Some(v478); - x482 = v483; - x481 = VU64(v469); - x480 = v458; - } else { - decref(v478); - VAL v484 = MKI64(0LL /* None */); - x482 = v484; - x481 = VU64(v469); - x480 = v458; - } - VAL x485; - uint64_t x486; - VAL x487; - VAL x488; - switch (get_data_tag(x482)) { - case 0LL: { // None - x488 = v472; - x487 = v470; - x486 = x481; - x485 = x480; - } break; - default: { - decref(v472); - decref(v470); - VAL v489 = MKI64(0LL /* Nil */); - x488 = v489; - x487 = x482; - x486 = x481; - x485 = x480; - } break; - } - int64_t v490 = 1LL /* True */; - x477 = v490; - x476 = x488; - x475 = x487; - x474 = x486; - x473 = x485; - } break; - case 0LL: { // None - int64_t v491 = 0LL /* False */; - x477 = v491; - x476 = v472; - x475 = v470; - x474 = VU64(v469); - x473 = v458; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v492 = (x473); - uint64_t v493 = x474; - VAL v494 = x475; - VAL v495 = x476; - int64_t v496 = x477; - while (((bool)v496)) { - VAL v497 = (v492); - uint64_t v498 = v493; - VAL v499 = v494; - VAL v500 = v495; - VAL v501; - VAL v502; - mw_std_list_List_1_uncons(v500, &v501, &v502); - VAL x503; - uint64_t x504; - VAL x505; - VAL x506; - int64_t x507; - switch (get_data_tag(v501)) { - case 1LL: { // Some - VAL v508 = mtp_std_maybe_Maybe_1_Some(v501); - incref(v508); - int64_t v509 = mw_mirth_var_Var_ZEqualZEqual(v498, VU64(v508)); - VAL x510; - uint64_t x511; - VAL x512; - if (((bool)v509)) { - VAL v513 = mtw_std_maybe_Maybe_1_Some(v508); - x512 = v513; - x511 = v498; - x510 = v497; - } else { - decref(v508); - VAL v514 = MKI64(0LL /* None */); - x512 = v514; - x511 = v498; - x510 = v497; - } - VAL x515; - uint64_t x516; - VAL x517; - VAL x518; - switch (get_data_tag(x512)) { - case 0LL: { // None - x518 = v502; - x517 = v499; - x516 = x511; - x515 = x510; - } break; - default: { - decref(v502); - decref(v499); - VAL v519 = MKI64(0LL /* Nil */); - x518 = v519; - x517 = x512; - x516 = x511; - x515 = x510; - } break; - } - int64_t v520 = 1LL /* True */; - x507 = v520; - x506 = x518; - x505 = x517; - x504 = x516; - x503 = x515; - } break; - case 0LL: { // None - int64_t v521 = 0LL /* False */; - x507 = v521; - x506 = v502; - x505 = v499; - x504 = v498; - x503 = v497; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v496 = x507; - v495 = x506; - v494 = x505; - v493 = x504; - v492 = x503; - } - decref(v495); - int64_t v522 = mw_std_maybe_Maybe_1_someZAsk(v494); - bool v523 = !((bool)v522); - VAL x524; - VAL x525; - VAL x526; - if (v523) { - VAL v527 = mtw_std_maybe_Maybe_1_Some(v469); - x526 = v527; - x525 = x452; - x524 = v492; - } else { - decref(v469); - VAL v528 = MKI64(0LL /* None */); - x526 = v528; - x525 = x452; - x524 = v492; - } - VAL x529; - switch (get_data_tag(x526)) { - case 1LL: { // Some - VAL v530 = mtp_std_maybe_Maybe_1_Some(x526); - VAL v531 = mtw_std_list_List_1_Cons(v530, v461); - x529 = v531; - push_resource(x524); - push_value(x525); - } break; - case 0LL: { // None - x529 = v461; - push_resource(x524); - push_value(x525); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v532 = 1LL /* True */; - x468 = v532; - x467 = v463; - x466 = x529; - VAL v533 = pop_value(); - x465 = v533; - VAL r534 = pop_resource(); - x464 = r534; - } break; - case 0LL: { // None - int64_t v535 = 0LL /* False */; - x468 = v535; - x467 = v463; - x466 = v461; - x465 = x452; - x464 = v458; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v536 = (x464); - VAL v537 = x465; - VAL v538 = (x466); - VAL v539 = x467; - int64_t v540 = x468; - while (((bool)v540)) { - VAL v541 = (v536); - VAL v542 = v537; - VAL v543 = (v538); - VAL v544 = v539; - VAL v545; - VAL v546; - mw_std_list_List_1_uncons(v544, &v545, &v546); - VAL x547; - VAL x548; - VAL x549; - VAL x550; - int64_t x551; - switch (get_data_tag(v545)) { - case 1LL: { // Some - VAL v552 = mtp_std_maybe_Maybe_1_Some(v545); - incref(v552); - incref(v542); - VAL v553 = MKI64(0LL /* None */); - VAL v554; - VAL v555; - mw_std_list_List_1_uncons(v542, &v554, &v555); - VAL x556; - uint64_t x557; - VAL x558; - VAL x559; - int64_t x560; - switch (get_data_tag(v554)) { - case 1LL: { // Some - VAL v561 = mtp_std_maybe_Maybe_1_Some(v554); - incref(v561); - incref(v552); - int64_t v562 = mw_mirth_var_Var_ZEqualZEqual(VU64(v552), VU64(v561)); - VAL x563; - uint64_t x564; - VAL x565; - if (((bool)v562)) { - VAL v566 = mtw_std_maybe_Maybe_1_Some(v561); - x565 = v566; - x564 = VU64(v552); - x563 = v541; - } else { - decref(v561); - VAL v567 = MKI64(0LL /* None */); - x565 = v567; - x564 = VU64(v552); - x563 = v541; - } - VAL x568; - uint64_t x569; - VAL x570; - VAL x571; - switch (get_data_tag(x565)) { - case 0LL: { // None - x571 = v555; - x570 = v553; - x569 = x564; - x568 = x563; - } break; - default: { - decref(v555); - decref(v553); - VAL v572 = MKI64(0LL /* Nil */); - x571 = v572; - x570 = x565; - x569 = x564; - x568 = x563; - } break; - } - int64_t v573 = 1LL /* True */; - x560 = v573; - x559 = x571; - x558 = x570; - x557 = x569; - x556 = x568; - } break; - case 0LL: { // None - int64_t v574 = 0LL /* False */; - x560 = v574; - x559 = v555; - x558 = v553; - x557 = VU64(v552); - x556 = v541; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v575 = (x556); - uint64_t v576 = x557; - VAL v577 = x558; - VAL v578 = x559; - int64_t v579 = x560; - while (((bool)v579)) { - VAL v580 = (v575); - uint64_t v581 = v576; - VAL v582 = v577; - VAL v583 = v578; - VAL v584; - VAL v585; - mw_std_list_List_1_uncons(v583, &v584, &v585); - VAL x586; - uint64_t x587; - VAL x588; - VAL x589; - int64_t x590; - switch (get_data_tag(v584)) { - case 1LL: { // Some - VAL v591 = mtp_std_maybe_Maybe_1_Some(v584); - incref(v591); - int64_t v592 = mw_mirth_var_Var_ZEqualZEqual(v581, VU64(v591)); - VAL x593; - uint64_t x594; - VAL x595; - if (((bool)v592)) { - VAL v596 = mtw_std_maybe_Maybe_1_Some(v591); - x595 = v596; - x594 = v581; - x593 = v580; - } else { - decref(v591); - VAL v597 = MKI64(0LL /* None */); - x595 = v597; - x594 = v581; - x593 = v580; - } - VAL x598; - uint64_t x599; - VAL x600; - VAL x601; - switch (get_data_tag(x595)) { - case 0LL: { // None - x601 = v585; - x600 = v582; - x599 = x594; - x598 = x593; - } break; - default: { - decref(v585); - decref(v582); - VAL v602 = MKI64(0LL /* Nil */); - x601 = v602; - x600 = x595; - x599 = x594; - x598 = x593; - } break; - } - int64_t v603 = 1LL /* True */; - x590 = v603; - x589 = x601; - x588 = x600; - x587 = x599; - x586 = x598; - } break; - case 0LL: { // None - int64_t v604 = 0LL /* False */; - x590 = v604; - x589 = v585; - x588 = v582; - x587 = v581; - x586 = v580; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v579 = x590; - v578 = x589; - v577 = x588; - v576 = x587; - v575 = x586; - } - decref(v578); - int64_t v605 = mw_std_maybe_Maybe_1_someZAsk(v577); - bool v606 = !((bool)v605); - VAL x607; - VAL x608; - VAL x609; - if (v606) { - VAL v610 = mtw_std_maybe_Maybe_1_Some(v552); - x609 = v610; - x608 = v542; - x607 = v575; - } else { - decref(v552); - VAL v611 = MKI64(0LL /* None */); - x609 = v611; - x608 = v542; - x607 = v575; - } - VAL x612; - switch (get_data_tag(x609)) { - case 1LL: { // Some - VAL v613 = mtp_std_maybe_Maybe_1_Some(x609); - VAL v614 = mtw_std_list_List_1_Cons(v613, v543); - x612 = v614; - push_resource(x607); - push_value(x608); - } break; - case 0LL: { // None - x612 = v543; - push_resource(x607); - push_value(x608); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v615 = 1LL /* True */; - x551 = v615; - x550 = v546; - x549 = x612; - VAL v616 = pop_value(); - x548 = v616; - VAL r617 = pop_resource(); - x547 = r617; - } break; - case 0LL: { // None - int64_t v618 = 0LL /* False */; - x551 = v618; - x550 = v546; - x549 = v543; - x548 = v542; - x547 = v541; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v540 = x551; - v539 = x550; - v538 = x549; - v537 = x548; - v536 = x547; - } - decref(v539); - VAL v619 = mw_std_list_List_1_reverse(v538); - decref(v537); - VAL v620 = mw_std_list_List_1_cat(x452, v619); - *x4 = v620; - *x3 = v536; + decref(v11); + VAL v30 = mw_std_list_List_1_reverse(v10); + VAL v31 = mw_std_list_List_1_unions_1_sp1(v30); + VAL v32 = VVAL(VTUP(x2)->cells[4]); + incref(v32); + decref(x2); + VAL v33; + VAL v34; + mw_mirth_arrow_Op_freeZ_vars(v9, v32, &v33, &v34); + VAL v35 = mw_std_list_List_1_union_1_sp1(v31, v34); + *x4 = v35; + *x3 = v33; } static void mw_mirth_arrow_Arg_freeZ_vars (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { VAL v5; @@ -21136,1134 +15665,59 @@ static void mw_mirth_match_Match_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4) { decref(x2); VAL v6 = MKI64(0LL /* Nil */); VAL v7 = mw_std_list_List_1_reverse(v6); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v5, &v8, &v9); - VAL x10; - VAL x11; - VAL x12; - int64_t x13; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v8); - VAL v15; - VAL v16; - mw_mirth_match_Case_freeZ_vars(x1, v14, &v15, &v16); - VAL v17 = mtw_std_list_List_1_Cons(v16, v7); - int64_t v18 = 1LL /* True */; - x13 = v18; - x12 = v9; - x11 = v17; - x10 = v15; - } break; - case 0LL: { // None - int64_t v19 = 0LL /* False */; - x13 = v19; - x12 = v9; - x11 = v7; - x10 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v20 = (x10); - VAL v21 = (x11); - VAL v22 = x12; - int64_t v23 = x13; - while (((bool)v23)) { - VAL v24 = (v20); - VAL v25 = (v21); - VAL v26 = v22; - VAL v27; - VAL v28; - mw_std_list_List_1_uncons(v26, &v27, &v28); - VAL x29; - VAL x30; - VAL x31; - int64_t x32; - switch (get_data_tag(v27)) { - case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v27); - VAL v34; - VAL v35; - mw_mirth_match_Case_freeZ_vars(v24, v33, &v34, &v35); - VAL v36 = mtw_std_list_List_1_Cons(v35, v25); - int64_t v37 = 1LL /* True */; - x32 = v37; - x31 = v28; - x30 = v36; - x29 = v34; + int64_t v8 = 1LL /* True */; + VAL v9 = x1; + VAL v10 = v7; + VAL v11 = v5; + int64_t v12 = v8; + int64_t v13 = v8; + while (((bool)v13)) { + VAL v14 = v9; + VAL v15 = v10; + VAL v16 = v11; + int64_t v17 = v12; + VAL x18; + VAL x19; + VAL x20; + int64_t x21; + switch (get_data_tag(v16)) { + case 1LL: { // Cons + VAL v22; + VAL v23; + mtp_std_list_List_1_Cons(v16, &v22, &v23); + VAL v24; + VAL v25; + mw_mirth_match_Case_freeZ_vars(v14, v22, &v24, &v25); + VAL v26 = mtw_std_list_List_1_Cons(v25, v15); + int64_t v27 = 1LL /* True */; + x21 = v27; + x20 = v23; + x19 = v26; + x18 = v24; } break; - case 0LL: { // None - int64_t v38 = 0LL /* False */; - x32 = v38; - x31 = v28; - x30 = v25; - x29 = v24; + case 0LL: { // Nil + VAL v28 = MKI64(0LL /* Nil */); + int64_t v29 = 0LL /* False */; + x21 = v29; + x20 = v28; + x19 = v15; + x18 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v23 = x32; - v22 = x31; - v21 = x30; - v20 = x29; + v13 = x21; + v12 = x21; + v11 = x20; + v10 = x19; + v9 = x18; } - decref(v22); - VAL v39 = mw_std_list_List_1_reverse(v21); - VAL v40 = mw_std_list_List_1_ZToListZPlus(v39); - VAL x41; - VAL x42; - switch (get_data_tag(v40)) { - case 1LL: { // Some - VAL v43 = mtp_std_maybe_Maybe_1_Some(v40); - VAL v44; - VAL v45; - mw_std_list_ListZPlus_1_uncons(v43, &v44, &v45); - VAL v46; - VAL v47; - mw_std_list_List_1_uncons(v45, &v46, &v47); - VAL x48; - VAL x49; - VAL x50; - int64_t x51; - switch (get_data_tag(v46)) { - case 1LL: { // Some - VAL v52 = mtp_std_maybe_Maybe_1_Some(v46); - incref(v44); - VAL v53 = MKI64(0LL /* Nil */); - VAL v54 = mw_std_list_List_1_reverse(v53); - VAL v55; - VAL v56; - mw_std_list_List_1_uncons(v52, &v55, &v56); - VAL x57; - VAL x58; - VAL x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v55)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v55); - incref(v62); - incref(v44); - VAL v63 = MKI64(0LL /* None */); - VAL v64; - VAL v65; - mw_std_list_List_1_uncons(v44, &v64, &v65); - VAL x66; - uint64_t x67; - VAL x68; - VAL x69; - int64_t x70; - switch (get_data_tag(v64)) { - case 1LL: { // Some - VAL v71 = mtp_std_maybe_Maybe_1_Some(v64); - incref(v71); - incref(v62); - int64_t v72 = mw_mirth_var_Var_ZEqualZEqual(VU64(v62), VU64(v71)); - VAL x73; - uint64_t x74; - VAL x75; - if (((bool)v72)) { - VAL v76 = mtw_std_maybe_Maybe_1_Some(v71); - x75 = v76; - x74 = VU64(v62); - x73 = v20; - } else { - decref(v71); - VAL v77 = MKI64(0LL /* None */); - x75 = v77; - x74 = VU64(v62); - x73 = v20; - } - VAL x78; - uint64_t x79; - VAL x80; - VAL x81; - switch (get_data_tag(x75)) { - case 0LL: { // None - x81 = v65; - x80 = v63; - x79 = x74; - x78 = x73; - } break; - default: { - decref(v65); - decref(v63); - VAL v82 = MKI64(0LL /* Nil */); - x81 = v82; - x80 = x75; - x79 = x74; - x78 = x73; - } break; - } - int64_t v83 = 1LL /* True */; - x70 = v83; - x69 = x81; - x68 = x80; - x67 = x79; - x66 = x78; - } break; - case 0LL: { // None - int64_t v84 = 0LL /* False */; - x70 = v84; - x69 = v65; - x68 = v63; - x67 = VU64(v62); - x66 = v20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v85 = (x66); - uint64_t v86 = x67; - VAL v87 = x68; - VAL v88 = x69; - int64_t v89 = x70; - while (((bool)v89)) { - VAL v90 = (v85); - uint64_t v91 = v86; - VAL v92 = v87; - VAL v93 = v88; - VAL v94; - VAL v95; - mw_std_list_List_1_uncons(v93, &v94, &v95); - VAL x96; - uint64_t x97; - VAL x98; - VAL x99; - int64_t x100; - switch (get_data_tag(v94)) { - case 1LL: { // Some - VAL v101 = mtp_std_maybe_Maybe_1_Some(v94); - incref(v101); - int64_t v102 = mw_mirth_var_Var_ZEqualZEqual(v91, VU64(v101)); - VAL x103; - uint64_t x104; - VAL x105; - if (((bool)v102)) { - VAL v106 = mtw_std_maybe_Maybe_1_Some(v101); - x105 = v106; - x104 = v91; - x103 = v90; - } else { - decref(v101); - VAL v107 = MKI64(0LL /* None */); - x105 = v107; - x104 = v91; - x103 = v90; - } - VAL x108; - uint64_t x109; - VAL x110; - VAL x111; - switch (get_data_tag(x105)) { - case 0LL: { // None - x111 = v95; - x110 = v92; - x109 = x104; - x108 = x103; - } break; - default: { - decref(v95); - decref(v92); - VAL v112 = MKI64(0LL /* Nil */); - x111 = v112; - x110 = x105; - x109 = x104; - x108 = x103; - } break; - } - int64_t v113 = 1LL /* True */; - x100 = v113; - x99 = x111; - x98 = x110; - x97 = x109; - x96 = x108; - } break; - case 0LL: { // None - int64_t v114 = 0LL /* False */; - x100 = v114; - x99 = v95; - x98 = v92; - x97 = v91; - x96 = v90; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v89 = x100; - v88 = x99; - v87 = x98; - v86 = x97; - v85 = x96; - } - decref(v88); - int64_t v115 = mw_std_maybe_Maybe_1_someZAsk(v87); - bool v116 = !((bool)v115); - VAL x117; - VAL x118; - VAL x119; - if (v116) { - VAL v120 = mtw_std_maybe_Maybe_1_Some(v62); - x119 = v120; - x118 = v44; - x117 = v85; - } else { - decref(v62); - VAL v121 = MKI64(0LL /* None */); - x119 = v121; - x118 = v44; - x117 = v85; - } - VAL x122; - switch (get_data_tag(x119)) { - case 1LL: { // Some - VAL v123 = mtp_std_maybe_Maybe_1_Some(x119); - VAL v124 = mtw_std_list_List_1_Cons(v123, v54); - x122 = v124; - push_resource(x117); - push_value(x118); - } break; - case 0LL: { // None - x122 = v54; - push_resource(x117); - push_value(x118); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v125 = 1LL /* True */; - x61 = v125; - x60 = v56; - x59 = x122; - VAL v126 = pop_value(); - x58 = v126; - VAL r127 = pop_resource(); - x57 = r127; - } break; - case 0LL: { // None - int64_t v128 = 0LL /* False */; - x61 = v128; - x60 = v56; - x59 = v54; - x58 = v44; - x57 = v20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v129 = (x57); - VAL v130 = x58; - VAL v131 = (x59); - VAL v132 = x60; - int64_t v133 = x61; - while (((bool)v133)) { - VAL v134 = (v129); - VAL v135 = v130; - VAL v136 = (v131); - VAL v137 = v132; - VAL v138; - VAL v139; - mw_std_list_List_1_uncons(v137, &v138, &v139); - VAL x140; - VAL x141; - VAL x142; - VAL x143; - int64_t x144; - switch (get_data_tag(v138)) { - case 1LL: { // Some - VAL v145 = mtp_std_maybe_Maybe_1_Some(v138); - incref(v145); - incref(v135); - VAL v146 = MKI64(0LL /* None */); - VAL v147; - VAL v148; - mw_std_list_List_1_uncons(v135, &v147, &v148); - VAL x149; - uint64_t x150; - VAL x151; - VAL x152; - int64_t x153; - switch (get_data_tag(v147)) { - case 1LL: { // Some - VAL v154 = mtp_std_maybe_Maybe_1_Some(v147); - incref(v154); - incref(v145); - int64_t v155 = mw_mirth_var_Var_ZEqualZEqual(VU64(v145), VU64(v154)); - VAL x156; - uint64_t x157; - VAL x158; - if (((bool)v155)) { - VAL v159 = mtw_std_maybe_Maybe_1_Some(v154); - x158 = v159; - x157 = VU64(v145); - x156 = v134; - } else { - decref(v154); - VAL v160 = MKI64(0LL /* None */); - x158 = v160; - x157 = VU64(v145); - x156 = v134; - } - VAL x161; - uint64_t x162; - VAL x163; - VAL x164; - switch (get_data_tag(x158)) { - case 0LL: { // None - x164 = v148; - x163 = v146; - x162 = x157; - x161 = x156; - } break; - default: { - decref(v148); - decref(v146); - VAL v165 = MKI64(0LL /* Nil */); - x164 = v165; - x163 = x158; - x162 = x157; - x161 = x156; - } break; - } - int64_t v166 = 1LL /* True */; - x153 = v166; - x152 = x164; - x151 = x163; - x150 = x162; - x149 = x161; - } break; - case 0LL: { // None - int64_t v167 = 0LL /* False */; - x153 = v167; - x152 = v148; - x151 = v146; - x150 = VU64(v145); - x149 = v134; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v168 = (x149); - uint64_t v169 = x150; - VAL v170 = x151; - VAL v171 = x152; - int64_t v172 = x153; - while (((bool)v172)) { - VAL v173 = (v168); - uint64_t v174 = v169; - VAL v175 = v170; - VAL v176 = v171; - VAL v177; - VAL v178; - mw_std_list_List_1_uncons(v176, &v177, &v178); - VAL x179; - uint64_t x180; - VAL x181; - VAL x182; - int64_t x183; - switch (get_data_tag(v177)) { - case 1LL: { // Some - VAL v184 = mtp_std_maybe_Maybe_1_Some(v177); - incref(v184); - int64_t v185 = mw_mirth_var_Var_ZEqualZEqual(v174, VU64(v184)); - VAL x186; - uint64_t x187; - VAL x188; - if (((bool)v185)) { - VAL v189 = mtw_std_maybe_Maybe_1_Some(v184); - x188 = v189; - x187 = v174; - x186 = v173; - } else { - decref(v184); - VAL v190 = MKI64(0LL /* None */); - x188 = v190; - x187 = v174; - x186 = v173; - } - VAL x191; - uint64_t x192; - VAL x193; - VAL x194; - switch (get_data_tag(x188)) { - case 0LL: { // None - x194 = v178; - x193 = v175; - x192 = x187; - x191 = x186; - } break; - default: { - decref(v178); - decref(v175); - VAL v195 = MKI64(0LL /* Nil */); - x194 = v195; - x193 = x188; - x192 = x187; - x191 = x186; - } break; - } - int64_t v196 = 1LL /* True */; - x183 = v196; - x182 = x194; - x181 = x193; - x180 = x192; - x179 = x191; - } break; - case 0LL: { // None - int64_t v197 = 0LL /* False */; - x183 = v197; - x182 = v178; - x181 = v175; - x180 = v174; - x179 = v173; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v172 = x183; - v171 = x182; - v170 = x181; - v169 = x180; - v168 = x179; - } - decref(v171); - int64_t v198 = mw_std_maybe_Maybe_1_someZAsk(v170); - bool v199 = !((bool)v198); - VAL x200; - VAL x201; - VAL x202; - if (v199) { - VAL v203 = mtw_std_maybe_Maybe_1_Some(v145); - x202 = v203; - x201 = v135; - x200 = v168; - } else { - decref(v145); - VAL v204 = MKI64(0LL /* None */); - x202 = v204; - x201 = v135; - x200 = v168; - } - VAL x205; - switch (get_data_tag(x202)) { - case 1LL: { // Some - VAL v206 = mtp_std_maybe_Maybe_1_Some(x202); - VAL v207 = mtw_std_list_List_1_Cons(v206, v136); - x205 = v207; - push_resource(x200); - push_value(x201); - } break; - case 0LL: { // None - x205 = v136; - push_resource(x200); - push_value(x201); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v208 = 1LL /* True */; - x144 = v208; - x143 = v139; - x142 = x205; - VAL v209 = pop_value(); - x141 = v209; - VAL r210 = pop_resource(); - x140 = r210; - } break; - case 0LL: { // None - int64_t v211 = 0LL /* False */; - x144 = v211; - x143 = v139; - x142 = v136; - x141 = v135; - x140 = v134; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v133 = x144; - v132 = x143; - v131 = x142; - v130 = x141; - v129 = x140; - } - decref(v132); - VAL v212 = mw_std_list_List_1_reverse(v131); - decref(v130); - VAL v213 = mw_std_list_List_1_cat(v44, v212); - int64_t v214 = 1LL /* True */; - x51 = v214; - x50 = v47; - x49 = v213; - x48 = v129; - } break; - case 0LL: { // None - int64_t v215 = 0LL /* False */; - x51 = v215; - x50 = v47; - x49 = v44; - x48 = v20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v216 = (x48); - VAL v217 = x49; - VAL v218 = x50; - int64_t v219 = x51; - while (((bool)v219)) { - VAL v220 = (v216); - VAL v221 = v217; - VAL v222 = v218; - VAL v223; - VAL v224; - mw_std_list_List_1_uncons(v222, &v223, &v224); - VAL x225; - VAL x226; - VAL x227; - int64_t x228; - switch (get_data_tag(v223)) { - case 1LL: { // Some - VAL v229 = mtp_std_maybe_Maybe_1_Some(v223); - incref(v221); - VAL v230 = MKI64(0LL /* Nil */); - VAL v231 = mw_std_list_List_1_reverse(v230); - VAL v232; - VAL v233; - mw_std_list_List_1_uncons(v229, &v232, &v233); - VAL x234; - VAL x235; - VAL x236; - VAL x237; - int64_t x238; - switch (get_data_tag(v232)) { - case 1LL: { // Some - VAL v239 = mtp_std_maybe_Maybe_1_Some(v232); - incref(v239); - incref(v221); - VAL v240 = MKI64(0LL /* None */); - VAL v241; - VAL v242; - mw_std_list_List_1_uncons(v221, &v241, &v242); - VAL x243; - uint64_t x244; - VAL x245; - VAL x246; - int64_t x247; - switch (get_data_tag(v241)) { - case 1LL: { // Some - VAL v248 = mtp_std_maybe_Maybe_1_Some(v241); - incref(v248); - incref(v239); - int64_t v249 = mw_mirth_var_Var_ZEqualZEqual(VU64(v239), VU64(v248)); - VAL x250; - uint64_t x251; - VAL x252; - if (((bool)v249)) { - VAL v253 = mtw_std_maybe_Maybe_1_Some(v248); - x252 = v253; - x251 = VU64(v239); - x250 = v220; - } else { - decref(v248); - VAL v254 = MKI64(0LL /* None */); - x252 = v254; - x251 = VU64(v239); - x250 = v220; - } - VAL x255; - uint64_t x256; - VAL x257; - VAL x258; - switch (get_data_tag(x252)) { - case 0LL: { // None - x258 = v242; - x257 = v240; - x256 = x251; - x255 = x250; - } break; - default: { - decref(v242); - decref(v240); - VAL v259 = MKI64(0LL /* Nil */); - x258 = v259; - x257 = x252; - x256 = x251; - x255 = x250; - } break; - } - int64_t v260 = 1LL /* True */; - x247 = v260; - x246 = x258; - x245 = x257; - x244 = x256; - x243 = x255; - } break; - case 0LL: { // None - int64_t v261 = 0LL /* False */; - x247 = v261; - x246 = v242; - x245 = v240; - x244 = VU64(v239); - x243 = v220; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v262 = (x243); - uint64_t v263 = x244; - VAL v264 = x245; - VAL v265 = x246; - int64_t v266 = x247; - while (((bool)v266)) { - VAL v267 = (v262); - uint64_t v268 = v263; - VAL v269 = v264; - VAL v270 = v265; - VAL v271; - VAL v272; - mw_std_list_List_1_uncons(v270, &v271, &v272); - VAL x273; - uint64_t x274; - VAL x275; - VAL x276; - int64_t x277; - switch (get_data_tag(v271)) { - case 1LL: { // Some - VAL v278 = mtp_std_maybe_Maybe_1_Some(v271); - incref(v278); - int64_t v279 = mw_mirth_var_Var_ZEqualZEqual(v268, VU64(v278)); - VAL x280; - uint64_t x281; - VAL x282; - if (((bool)v279)) { - VAL v283 = mtw_std_maybe_Maybe_1_Some(v278); - x282 = v283; - x281 = v268; - x280 = v267; - } else { - decref(v278); - VAL v284 = MKI64(0LL /* None */); - x282 = v284; - x281 = v268; - x280 = v267; - } - VAL x285; - uint64_t x286; - VAL x287; - VAL x288; - switch (get_data_tag(x282)) { - case 0LL: { // None - x288 = v272; - x287 = v269; - x286 = x281; - x285 = x280; - } break; - default: { - decref(v272); - decref(v269); - VAL v289 = MKI64(0LL /* Nil */); - x288 = v289; - x287 = x282; - x286 = x281; - x285 = x280; - } break; - } - int64_t v290 = 1LL /* True */; - x277 = v290; - x276 = x288; - x275 = x287; - x274 = x286; - x273 = x285; - } break; - case 0LL: { // None - int64_t v291 = 0LL /* False */; - x277 = v291; - x276 = v272; - x275 = v269; - x274 = v268; - x273 = v267; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v266 = x277; - v265 = x276; - v264 = x275; - v263 = x274; - v262 = x273; - } - decref(v265); - int64_t v292 = mw_std_maybe_Maybe_1_someZAsk(v264); - bool v293 = !((bool)v292); - VAL x294; - VAL x295; - VAL x296; - if (v293) { - VAL v297 = mtw_std_maybe_Maybe_1_Some(v239); - x296 = v297; - x295 = v221; - x294 = v262; - } else { - decref(v239); - VAL v298 = MKI64(0LL /* None */); - x296 = v298; - x295 = v221; - x294 = v262; - } - VAL x299; - switch (get_data_tag(x296)) { - case 1LL: { // Some - VAL v300 = mtp_std_maybe_Maybe_1_Some(x296); - VAL v301 = mtw_std_list_List_1_Cons(v300, v231); - x299 = v301; - push_resource(x294); - push_value(x295); - } break; - case 0LL: { // None - x299 = v231; - push_resource(x294); - push_value(x295); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v302 = 1LL /* True */; - x238 = v302; - x237 = v233; - x236 = x299; - VAL v303 = pop_value(); - x235 = v303; - VAL r304 = pop_resource(); - x234 = r304; - } break; - case 0LL: { // None - int64_t v305 = 0LL /* False */; - x238 = v305; - x237 = v233; - x236 = v231; - x235 = v221; - x234 = v220; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v306 = (x234); - VAL v307 = x235; - VAL v308 = (x236); - VAL v309 = x237; - int64_t v310 = x238; - while (((bool)v310)) { - VAL v311 = (v306); - VAL v312 = v307; - VAL v313 = (v308); - VAL v314 = v309; - VAL v315; - VAL v316; - mw_std_list_List_1_uncons(v314, &v315, &v316); - VAL x317; - VAL x318; - VAL x319; - VAL x320; - int64_t x321; - switch (get_data_tag(v315)) { - case 1LL: { // Some - VAL v322 = mtp_std_maybe_Maybe_1_Some(v315); - incref(v322); - incref(v312); - VAL v323 = MKI64(0LL /* None */); - VAL v324; - VAL v325; - mw_std_list_List_1_uncons(v312, &v324, &v325); - VAL x326; - uint64_t x327; - VAL x328; - VAL x329; - int64_t x330; - switch (get_data_tag(v324)) { - case 1LL: { // Some - VAL v331 = mtp_std_maybe_Maybe_1_Some(v324); - incref(v331); - incref(v322); - int64_t v332 = mw_mirth_var_Var_ZEqualZEqual(VU64(v322), VU64(v331)); - VAL x333; - uint64_t x334; - VAL x335; - if (((bool)v332)) { - VAL v336 = mtw_std_maybe_Maybe_1_Some(v331); - x335 = v336; - x334 = VU64(v322); - x333 = v311; - } else { - decref(v331); - VAL v337 = MKI64(0LL /* None */); - x335 = v337; - x334 = VU64(v322); - x333 = v311; - } - VAL x338; - uint64_t x339; - VAL x340; - VAL x341; - switch (get_data_tag(x335)) { - case 0LL: { // None - x341 = v325; - x340 = v323; - x339 = x334; - x338 = x333; - } break; - default: { - decref(v325); - decref(v323); - VAL v342 = MKI64(0LL /* Nil */); - x341 = v342; - x340 = x335; - x339 = x334; - x338 = x333; - } break; - } - int64_t v343 = 1LL /* True */; - x330 = v343; - x329 = x341; - x328 = x340; - x327 = x339; - x326 = x338; - } break; - case 0LL: { // None - int64_t v344 = 0LL /* False */; - x330 = v344; - x329 = v325; - x328 = v323; - x327 = VU64(v322); - x326 = v311; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v345 = (x326); - uint64_t v346 = x327; - VAL v347 = x328; - VAL v348 = x329; - int64_t v349 = x330; - while (((bool)v349)) { - VAL v350 = (v345); - uint64_t v351 = v346; - VAL v352 = v347; - VAL v353 = v348; - VAL v354; - VAL v355; - mw_std_list_List_1_uncons(v353, &v354, &v355); - VAL x356; - uint64_t x357; - VAL x358; - VAL x359; - int64_t x360; - switch (get_data_tag(v354)) { - case 1LL: { // Some - VAL v361 = mtp_std_maybe_Maybe_1_Some(v354); - incref(v361); - int64_t v362 = mw_mirth_var_Var_ZEqualZEqual(v351, VU64(v361)); - VAL x363; - uint64_t x364; - VAL x365; - if (((bool)v362)) { - VAL v366 = mtw_std_maybe_Maybe_1_Some(v361); - x365 = v366; - x364 = v351; - x363 = v350; - } else { - decref(v361); - VAL v367 = MKI64(0LL /* None */); - x365 = v367; - x364 = v351; - x363 = v350; - } - VAL x368; - uint64_t x369; - VAL x370; - VAL x371; - switch (get_data_tag(x365)) { - case 0LL: { // None - x371 = v355; - x370 = v352; - x369 = x364; - x368 = x363; - } break; - default: { - decref(v355); - decref(v352); - VAL v372 = MKI64(0LL /* Nil */); - x371 = v372; - x370 = x365; - x369 = x364; - x368 = x363; - } break; - } - int64_t v373 = 1LL /* True */; - x360 = v373; - x359 = x371; - x358 = x370; - x357 = x369; - x356 = x368; - } break; - case 0LL: { // None - int64_t v374 = 0LL /* False */; - x360 = v374; - x359 = v355; - x358 = v352; - x357 = v351; - x356 = v350; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v349 = x360; - v348 = x359; - v347 = x358; - v346 = x357; - v345 = x356; - } - decref(v348); - int64_t v375 = mw_std_maybe_Maybe_1_someZAsk(v347); - bool v376 = !((bool)v375); - VAL x377; - VAL x378; - VAL x379; - if (v376) { - VAL v380 = mtw_std_maybe_Maybe_1_Some(v322); - x379 = v380; - x378 = v312; - x377 = v345; - } else { - decref(v322); - VAL v381 = MKI64(0LL /* None */); - x379 = v381; - x378 = v312; - x377 = v345; - } - VAL x382; - switch (get_data_tag(x379)) { - case 1LL: { // Some - VAL v383 = mtp_std_maybe_Maybe_1_Some(x379); - VAL v384 = mtw_std_list_List_1_Cons(v383, v313); - x382 = v384; - push_resource(x377); - push_value(x378); - } break; - case 0LL: { // None - x382 = v313; - push_resource(x377); - push_value(x378); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v385 = 1LL /* True */; - x321 = v385; - x320 = v316; - x319 = x382; - VAL v386 = pop_value(); - x318 = v386; - VAL r387 = pop_resource(); - x317 = r387; - } break; - case 0LL: { // None - int64_t v388 = 0LL /* False */; - x321 = v388; - x320 = v316; - x319 = v313; - x318 = v312; - x317 = v311; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v310 = x321; - v309 = x320; - v308 = x319; - v307 = x318; - v306 = x317; - } - decref(v309); - VAL v389 = mw_std_list_List_1_reverse(v308); - decref(v307); - VAL v390 = mw_std_list_List_1_cat(v221, v389); - int64_t v391 = 1LL /* True */; - x228 = v391; - x227 = v224; - x226 = v390; - x225 = v306; - } break; - case 0LL: { // None - int64_t v392 = 0LL /* False */; - x228 = v392; - x227 = v224; - x226 = v221; - x225 = v220; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v219 = x228; - v218 = x227; - v217 = x226; - v216 = x225; - } - decref(v218); - VAL v393 = mtw_std_maybe_Maybe_1_Some(v217); - x42 = v393; - x41 = v216; - } break; - case 0LL: { // None - VAL v394 = MKI64(0LL /* None */); - x42 = v394; - x41 = v20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x395; - switch (get_data_tag(x42)) { - case 1LL: { // Some - VAL v396 = mtp_std_maybe_Maybe_1_Some(x42); - x395 = v396; - push_resource(x41); - } break; - case 0LL: { // None - VAL v397 = MKI64(0LL /* Nil */); - x395 = v397; - push_resource(x41); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - *x4 = x395; - VAL r398 = pop_resource(); - *x3 = r398; + decref(v11); + VAL v30 = mw_std_list_List_1_reverse(v10); + VAL v31 = mw_std_list_List_1_unions_1_sp1(v30); + *x4 = v31; + *x3 = v9; } static void mw_mirth_match_Case_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5 = VVAL(VTUP(x2)->cells[2]); @@ -22286,481 +15740,9 @@ static void mw_mirth_arrow_Lambda_freeZ_vars (VAL x1, VAL x2, VAL *x3, VAL *x4) VAL v8 = VVAL(VTUP(x2)->cells[4]); incref(v8); decref(x2); - VAL v9 = MKI64(0LL /* Nil */); - VAL v10 = mw_std_list_List_1_reverse(v9); - VAL v11; - VAL v12; - mw_std_list_List_1_uncons(v7, &v11, &v12); - VAL x13; - VAL x14; - VAL x15; - VAL x16; - int64_t x17; - switch (get_data_tag(v11)) { - case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(v11); - incref(v18); - incref(v8); - VAL v19 = MKI64(0LL /* None */); - VAL v20; - VAL v21; - mw_std_list_List_1_uncons(v8, &v20, &v21); - VAL x22; - uint64_t x23; - VAL x24; - VAL x25; - int64_t x26; - switch (get_data_tag(v20)) { - case 1LL: { // Some - VAL v27 = mtp_std_maybe_Maybe_1_Some(v20); - incref(v27); - incref(v18); - int64_t v28 = mw_mirth_var_Var_ZEqualZEqual(VU64(v18), VU64(v27)); - VAL x29; - uint64_t x30; - VAL x31; - if (((bool)v28)) { - VAL v32 = mtw_std_maybe_Maybe_1_Some(v27); - x31 = v32; - x30 = VU64(v18); - x29 = v6; - } else { - decref(v27); - VAL v33 = MKI64(0LL /* None */); - x31 = v33; - x30 = VU64(v18); - x29 = v6; - } - VAL x34; - uint64_t x35; - VAL x36; - VAL x37; - switch (get_data_tag(x31)) { - case 0LL: { // None - x37 = v21; - x36 = v19; - x35 = x30; - x34 = x29; - } break; - default: { - decref(v21); - decref(v19); - VAL v38 = MKI64(0LL /* Nil */); - x37 = v38; - x36 = x31; - x35 = x30; - x34 = x29; - } break; - } - int64_t v39 = 1LL /* True */; - x26 = v39; - x25 = x37; - x24 = x36; - x23 = x35; - x22 = x34; - } break; - case 0LL: { // None - int64_t v40 = 0LL /* False */; - x26 = v40; - x25 = v21; - x24 = v19; - x23 = VU64(v18); - x22 = v6; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v41 = (x22); - uint64_t v42 = x23; - VAL v43 = x24; - VAL v44 = x25; - int64_t v45 = x26; - while (((bool)v45)) { - VAL v46 = (v41); - uint64_t v47 = v42; - VAL v48 = v43; - VAL v49 = v44; - VAL v50; - VAL v51; - mw_std_list_List_1_uncons(v49, &v50, &v51); - VAL x52; - uint64_t x53; - VAL x54; - VAL x55; - int64_t x56; - switch (get_data_tag(v50)) { - case 1LL: { // Some - VAL v57 = mtp_std_maybe_Maybe_1_Some(v50); - incref(v57); - int64_t v58 = mw_mirth_var_Var_ZEqualZEqual(v47, VU64(v57)); - VAL x59; - uint64_t x60; - VAL x61; - if (((bool)v58)) { - VAL v62 = mtw_std_maybe_Maybe_1_Some(v57); - x61 = v62; - x60 = v47; - x59 = v46; - } else { - decref(v57); - VAL v63 = MKI64(0LL /* None */); - x61 = v63; - x60 = v47; - x59 = v46; - } - VAL x64; - uint64_t x65; - VAL x66; - VAL x67; - switch (get_data_tag(x61)) { - case 0LL: { // None - x67 = v51; - x66 = v48; - x65 = x60; - x64 = x59; - } break; - default: { - decref(v51); - decref(v48); - VAL v68 = MKI64(0LL /* Nil */); - x67 = v68; - x66 = x61; - x65 = x60; - x64 = x59; - } break; - } - int64_t v69 = 1LL /* True */; - x56 = v69; - x55 = x67; - x54 = x66; - x53 = x65; - x52 = x64; - } break; - case 0LL: { // None - int64_t v70 = 0LL /* False */; - x56 = v70; - x55 = v51; - x54 = v48; - x53 = v47; - x52 = v46; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v45 = x56; - v44 = x55; - v43 = x54; - v42 = x53; - v41 = x52; - } - decref(v44); - int64_t v71 = mw_std_maybe_Maybe_1_someZAsk(v43); - bool v72 = !((bool)v71); - VAL x73; - VAL x74; - VAL x75; - if (v72) { - VAL v76 = mtw_std_maybe_Maybe_1_Some(v18); - x75 = v76; - x74 = v8; - x73 = v41; - } else { - decref(v18); - VAL v77 = MKI64(0LL /* None */); - x75 = v77; - x74 = v8; - x73 = v41; - } - VAL x78; - switch (get_data_tag(x75)) { - case 1LL: { // Some - VAL v79 = mtp_std_maybe_Maybe_1_Some(x75); - VAL v80 = mtw_std_list_List_1_Cons(v79, v10); - x78 = v80; - push_resource(x73); - push_value(x74); - } break; - case 0LL: { // None - x78 = v10; - push_resource(x73); - push_value(x74); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v81 = 1LL /* True */; - x17 = v81; - x16 = v12; - x15 = x78; - VAL v82 = pop_value(); - x14 = v82; - VAL r83 = pop_resource(); - x13 = r83; - } break; - case 0LL: { // None - int64_t v84 = 0LL /* False */; - x17 = v84; - x16 = v12; - x15 = v10; - x14 = v8; - x13 = v6; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v85 = (x13); - VAL v86 = x14; - VAL v87 = (x15); - VAL v88 = x16; - int64_t v89 = x17; - while (((bool)v89)) { - VAL v90 = (v85); - VAL v91 = v86; - VAL v92 = (v87); - VAL v93 = v88; - VAL v94; - VAL v95; - mw_std_list_List_1_uncons(v93, &v94, &v95); - VAL x96; - VAL x97; - VAL x98; - VAL x99; - int64_t x100; - switch (get_data_tag(v94)) { - case 1LL: { // Some - VAL v101 = mtp_std_maybe_Maybe_1_Some(v94); - incref(v101); - incref(v91); - VAL v102 = MKI64(0LL /* None */); - VAL v103; - VAL v104; - mw_std_list_List_1_uncons(v91, &v103, &v104); - VAL x105; - uint64_t x106; - VAL x107; - VAL x108; - int64_t x109; - switch (get_data_tag(v103)) { - case 1LL: { // Some - VAL v110 = mtp_std_maybe_Maybe_1_Some(v103); - incref(v110); - incref(v101); - int64_t v111 = mw_mirth_var_Var_ZEqualZEqual(VU64(v101), VU64(v110)); - VAL x112; - uint64_t x113; - VAL x114; - if (((bool)v111)) { - VAL v115 = mtw_std_maybe_Maybe_1_Some(v110); - x114 = v115; - x113 = VU64(v101); - x112 = v90; - } else { - decref(v110); - VAL v116 = MKI64(0LL /* None */); - x114 = v116; - x113 = VU64(v101); - x112 = v90; - } - VAL x117; - uint64_t x118; - VAL x119; - VAL x120; - switch (get_data_tag(x114)) { - case 0LL: { // None - x120 = v104; - x119 = v102; - x118 = x113; - x117 = x112; - } break; - default: { - decref(v104); - decref(v102); - VAL v121 = MKI64(0LL /* Nil */); - x120 = v121; - x119 = x114; - x118 = x113; - x117 = x112; - } break; - } - int64_t v122 = 1LL /* True */; - x109 = v122; - x108 = x120; - x107 = x119; - x106 = x118; - x105 = x117; - } break; - case 0LL: { // None - int64_t v123 = 0LL /* False */; - x109 = v123; - x108 = v104; - x107 = v102; - x106 = VU64(v101); - x105 = v90; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v124 = (x105); - uint64_t v125 = x106; - VAL v126 = x107; - VAL v127 = x108; - int64_t v128 = x109; - while (((bool)v128)) { - VAL v129 = (v124); - uint64_t v130 = v125; - VAL v131 = v126; - VAL v132 = v127; - VAL v133; - VAL v134; - mw_std_list_List_1_uncons(v132, &v133, &v134); - VAL x135; - uint64_t x136; - VAL x137; - VAL x138; - int64_t x139; - switch (get_data_tag(v133)) { - case 1LL: { // Some - VAL v140 = mtp_std_maybe_Maybe_1_Some(v133); - incref(v140); - int64_t v141 = mw_mirth_var_Var_ZEqualZEqual(v130, VU64(v140)); - VAL x142; - uint64_t x143; - VAL x144; - if (((bool)v141)) { - VAL v145 = mtw_std_maybe_Maybe_1_Some(v140); - x144 = v145; - x143 = v130; - x142 = v129; - } else { - decref(v140); - VAL v146 = MKI64(0LL /* None */); - x144 = v146; - x143 = v130; - x142 = v129; - } - VAL x147; - uint64_t x148; - VAL x149; - VAL x150; - switch (get_data_tag(x144)) { - case 0LL: { // None - x150 = v134; - x149 = v131; - x148 = x143; - x147 = x142; - } break; - default: { - decref(v134); - decref(v131); - VAL v151 = MKI64(0LL /* Nil */); - x150 = v151; - x149 = x144; - x148 = x143; - x147 = x142; - } break; - } - int64_t v152 = 1LL /* True */; - x139 = v152; - x138 = x150; - x137 = x149; - x136 = x148; - x135 = x147; - } break; - case 0LL: { // None - int64_t v153 = 0LL /* False */; - x139 = v153; - x138 = v134; - x137 = v131; - x136 = v130; - x135 = v129; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v128 = x139; - v127 = x138; - v126 = x137; - v125 = x136; - v124 = x135; - } - decref(v127); - int64_t v154 = mw_std_maybe_Maybe_1_someZAsk(v126); - bool v155 = !((bool)v154); - VAL x156; - VAL x157; - VAL x158; - if (v155) { - VAL v159 = mtw_std_maybe_Maybe_1_Some(v101); - x158 = v159; - x157 = v91; - x156 = v124; - } else { - decref(v101); - VAL v160 = MKI64(0LL /* None */); - x158 = v160; - x157 = v91; - x156 = v124; - } - VAL x161; - switch (get_data_tag(x158)) { - case 1LL: { // Some - VAL v162 = mtp_std_maybe_Maybe_1_Some(x158); - VAL v163 = mtw_std_list_List_1_Cons(v162, v92); - x161 = v163; - push_resource(x156); - push_value(x157); - } break; - case 0LL: { // None - x161 = v92; - push_resource(x156); - push_value(x157); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v164 = 1LL /* True */; - x100 = v164; - x99 = v95; - x98 = x161; - VAL v165 = pop_value(); - x97 = v165; - VAL r166 = pop_resource(); - x96 = r166; - } break; - case 0LL: { // None - int64_t v167 = 0LL /* False */; - x100 = v167; - x99 = v95; - x98 = v92; - x97 = v91; - x96 = v90; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v89 = x100; - v88 = x99; - v87 = x98; - v86 = x97; - v85 = x96; - } - decref(v88); - VAL v168 = mw_std_list_List_1_reverse(v87); - decref(v86); - *x4 = v168; - *x3 = v85; -} -static uint64_t mw_mirth_arrow_Arg_token (uint64_t x1) { - uint64_t v2 = mw_mirth_arrow_Block_token(x1); - return v2; + VAL v9 = mw_std_list_List_1_difference_1_sp1(v7, v8); + *x4 = v9; + *x3 = v6; } static int64_t mw_mirth_typedef_TypeDef_index (uint64_t x1) { return ((int64_t)x1); @@ -22777,22 +15759,8 @@ static uint64_t mw_mirth_typedef_TypeDef_allocZBang (void) { static VAL mw_mirth_typedef_TypeDef_qnameZ_soft (uint64_t x1) { void* v2 = mfld_mirth_typedef_TypeDef_ZTildeqname(x1); VAL v3 = mw_std_prelude_ZAtZAsk(v2); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v6 = mw_mirth_mirth_Prop_1_readyZAsk(v5); - x4 = v6; - } break; - case 0LL: { // None - VAL v7 = MKI64(0LL /* None */); - x4 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x4; + VAL v4 = mw_std_maybe_Maybe_1_bind_1_sp5(v3); + return v4; } static void mw_mirth_typedef_TypeDef_qnameZ_hard (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { void* v5 = mfld_mirth_typedef_TypeDef_ZTildeqname(x2); @@ -22842,7 +15810,7 @@ static void mw_mirth_typedef_TypeDef_newZBang (VAL x1, VAL x2, uint64_t x3, VAL void* v12 = mfld_mirth_typedef_TypeDef_ZTildeqname(v7); mut_set(v11, v12); VAL v13 = mtw_mirth_def_Def_DefType(v7); - VAL v14 = (mw_mirth_def_Def_register(x1, v13)); + VAL v14 = mw_mirth_def_Def_register(x1, v13); *x6 = v7; *x5 = v14; } @@ -23158,7 +16126,7 @@ static VAL mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang (VAL x1, int64_t x2) { VAL v4; mw_mirth_type_PrimType_tyconZ_qname(x1, x2, &v3, &v4); VAL v5 = mtw_mirth_type_Type_TPrim(x2); - VAL v6 = (mw_mirth_mirth_ZPlusMirth_defZ_typeZBang(v3, v4, v5)); + VAL v6 = mw_mirth_mirth_ZPlusMirth_defZ_typeZBang(v3, v4, v5); return v6; } static VAL mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZ_aliasZBang (VAL x1, int64_t x2, VAL x3) { @@ -23168,31 +16136,31 @@ static VAL mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZ_aliasZBang (VAL x1, int64_ mw_mirth_type_PrimType_tyconZ_qname(x1, x2, &v5, &v6); VAL v7 = tup_replace(v6, 2, MKU64(v4)); VAL v8 = mtw_mirth_type_Type_TPrim(x2); - VAL v9 = (mw_mirth_mirth_ZPlusMirth_defZ_typeZBang(v5, v7, v8)); + VAL v9 = mw_mirth_mirth_ZPlusMirth_defZ_typeZBang(v5, v7, v8); return v9; } static VAL mw_mirth_mirth_ZPlusMirth_initZ_typesZBang (VAL x1) { int64_t v2 = 3LL /* PRIM_TYPE_INT */; - VAL v3 = (mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(x1, v2)); + VAL v3 = mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(x1, v2); int64_t v4 = 4LL /* PRIM_TYPE_F32 */; - VAL v5 = (mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v3, v4)); + VAL v5 = mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v3, v4); int64_t v6 = 4LL /* PRIM_TYPE_F32 */; STR* v7; STRLIT(v7, "Float32", 7); - VAL v8 = (mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZ_aliasZBang(v5, v6, MKSTR(v7))); + VAL v8 = mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZ_aliasZBang(v5, v6, MKSTR(v7)); int64_t v9 = 5LL /* PRIM_TYPE_F64 */; - VAL v10 = (mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v8, v9)); + VAL v10 = mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v8, v9); int64_t v11 = 5LL /* PRIM_TYPE_F64 */; STR* v12; STRLIT(v12, "Float64", 7); - VAL v13 = (mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZ_aliasZBang(v10, v11, MKSTR(v12))); + VAL v13 = mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZ_aliasZBang(v10, v11, MKSTR(v12)); int64_t v14 = 6LL /* PRIM_TYPE_PTR */; - VAL v15 = (mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v13, v14)); + VAL v15 = mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v13, v14); int64_t v16 = 7LL /* PRIM_TYPE_STR */; - VAL v17 = (mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v15, v16)); + VAL v17 = mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v15, v16); int64_t v18 = 8LL /* PRIM_TYPE_WORLD */; - VAL v19 = (mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v17, v18)); - VAL v20 = (mw_mirth_data_initZ_dataZBang(v19)); + VAL v19 = mw_mirth_mirth_ZPlusMirth_defZ_primZ_typeZBang(v17, v18); + VAL v20 = mw_mirth_data_initZ_dataZBang(v19); return v20; } static VAL mw_mirth_type_TZPlus (VAL x1, VAL x2) { @@ -23228,68 +16196,8 @@ static VAL mw_mirth_type_TZ_ZTo (VAL x1, VAL x2) { } static VAL mw_mirth_type_TT (VAL x1) { VAL v2 = mw_mirth_type_T0(); - VAL v3; - VAL v4; - mw_std_list_List_1_uncons(x1, &v3, &v4); - VAL x5; - VAL x6; - int64_t x7; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v9 = mw_mirth_type_TZMul(v2, v8); - int64_t v10 = 1LL /* True */; - x7 = v10; - x6 = v4; - x5 = v9; - } break; - case 0LL: { // None - int64_t v11 = 0LL /* False */; - x7 = v11; - x6 = v4; - x5 = v2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v12 = x5; - VAL v13 = x6; - int64_t v14 = x7; - while (((bool)v14)) { - VAL v15 = v12; - VAL v16 = v13; - VAL v17; - VAL v18; - mw_std_list_List_1_uncons(v16, &v17, &v18); - VAL x19; - VAL x20; - int64_t x21; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v17); - VAL v23 = mw_mirth_type_TZMul(v15, v22); - int64_t v24 = 1LL /* True */; - x21 = v24; - x20 = v18; - x19 = v23; - } break; - case 0LL: { // None - int64_t v25 = 0LL /* False */; - x21 = v25; - x20 = v18; - x19 = v15; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v14 = x21; - v13 = x20; - v12 = x19; - } - decref(v13); - return v12; + VAL v3 = mw_std_list_List_1_for_1_sp80(v2, x1); + return v3; } static VAL mw_mirth_type_T0 (void) { VAL v1 = MKI64(2LL /* STACK_TYPE_UNIT */); @@ -23387,10 +16295,7 @@ static int64_t mw_mirth_type_Type_isZ_physicalZAsk (VAL x1) { case 0LL: { // None STR* v6; STRLIT(v6, "unbound meta at Type.is-physical?", 33); - push_u64(v3); do_panic(v6); - int64_t v7 = pop_i64(); - x5 = v7; } break; case 1LL: { // Some VAL v8 = mtp_std_maybe_Maybe_1_Some(v4); @@ -23421,6 +16326,11 @@ static int64_t mw_mirth_type_Type_isZ_physicalZAsk (VAL x1) { } return x2; } +static VAL mw_mirth_type_TYPEz_UNIT (void) { + VAL v1 = MKI64(2LL /* STACK_TYPE_UNIT */); + VAL v2 = mtw_mirth_type_Type_TTensor(v1); + return v2; +} static VAL mw_mirth_type_TYPEz_TYPE (void) { int64_t v1 = 0LL /* PRIM_TYPE_TYPE */; VAL v2 = mtw_mirth_type_Type_TPrim(v1); @@ -23491,13 +16401,13 @@ static void mw_mirth_type_Type_unifyZ_failedZBang (VAL x1, uint64_t x2, VAL x3, STRLIT(v8, "", 0); STR* v9; STRLIT(v9, "Failed to unify ", 16); - VAL v10 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v9), MKSTR(v8))); - VAL v11 = (mw_mirth_type_Type_typeZThen(x3, v10)); + VAL v10 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v9), MKSTR(v8)); + VAL v11 = mw_mirth_type_Type_typeZThen(x3, v10); STR* v12; STRLIT(v12, " with ", 6); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11)); - VAL v14 = (mw_mirth_type_Type_typeZThen(x4, v13)); - VAL v15 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, v14, x1)); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11); + VAL v14 = mw_mirth_type_Type_typeZThen(x4, v13); + VAL v15 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, v14, x1); VAL v16 = MKI64(0LL /* TYPE_ERROR */); *x7 = v16; *x6 = x2; @@ -24239,7 +17149,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, decref(v23); STR* v24; STRLIT(v24, "Can't unify int value with string value.", 40); - VAL v25 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v24), x1)); + VAL v25 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v24), x1); VAL v26 = MKI64(0LL /* TYPE_ERROR */); x14 = v26; x13 = x2; @@ -24249,7 +17159,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, double v27 = mtp_mirth_type_Value_VALUEz_F64(x4); STR* v28; STRLIT(v28, "Can't unify int value with float value.", 39); - VAL v29 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v28), x1)); + VAL v29 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v28), x1); VAL v30 = MKI64(0LL /* TYPE_ERROR */); x14 = v30; x13 = x2; @@ -24259,7 +17169,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, uint64_t v31 = mtp_mirth_type_Value_VALUEz_BLOCK(x4); STR* v32; STRLIT(v32, "Can't unify int value with block.", 33); - VAL v33 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v32), x1)); + VAL v33 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v32), x1); VAL v34 = MKI64(0LL /* TYPE_ERROR */); x14 = v34; x13 = x2; @@ -24311,7 +17221,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, decref(v35); STR* v48; STRLIT(v48, "Can't unify string value with int value.", 40); - VAL v49 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v48), x1)); + VAL v49 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v48), x1); VAL v50 = MKI64(0LL /* TYPE_ERROR */); x38 = v50; x37 = x2; @@ -24322,7 +17232,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, decref(v35); STR* v52; STRLIT(v52, "Can't unify string value with float value.", 42); - VAL v53 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v52), x1)); + VAL v53 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v52), x1); VAL v54 = MKI64(0LL /* TYPE_ERROR */); x38 = v54; x37 = x2; @@ -24333,7 +17243,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, decref(v35); STR* v56; STRLIT(v56, "Can't unify string value with block.", 36); - VAL v57 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v56), x1)); + VAL v57 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v56), x1); VAL v58 = MKI64(0LL /* TYPE_ERROR */); x38 = v58; x37 = x2; @@ -24387,7 +17297,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, int64_t v77 = mtp_mirth_type_Value_VALUEz_INT(x4); STR* v78; STRLIT(v78, "Can't unify block with int value.", 33); - VAL v79 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v78), x1)); + VAL v79 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v78), x1); VAL v80 = MKI64(0LL /* TYPE_ERROR */); x62 = v80; x61 = x2; @@ -24397,7 +17307,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, double v81 = mtp_mirth_type_Value_VALUEz_F64(x4); STR* v82; STRLIT(v82, "Can't unify block with float value.", 35); - VAL v83 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v82), x1)); + VAL v83 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v82), x1); VAL v84 = MKI64(0LL /* TYPE_ERROR */); x62 = v84; x61 = x2; @@ -24408,7 +17318,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, decref(v85); STR* v86; STRLIT(v86, "Can't unify block with string value.", 36); - VAL v87 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v86), x1)); + VAL v87 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v86), x1); VAL v88 = MKI64(0LL /* TYPE_ERROR */); x62 = v88; x61 = x2; @@ -24454,7 +17364,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, int64_t v101 = mtp_mirth_type_Value_VALUEz_INT(x4); STR* v102; STRLIT(v102, "Can't unify float value with int value.", 39); - VAL v103 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v102), x1)); + VAL v103 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v102), x1); VAL v104 = MKI64(0LL /* TYPE_ERROR */); x92 = v104; x91 = x2; @@ -24464,7 +17374,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, uint64_t v105 = mtp_mirth_type_Value_VALUEz_BLOCK(x4); STR* v106; STRLIT(v106, "Can't unify float value with block.", 35); - VAL v107 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v106), x1)); + VAL v107 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v106), x1); VAL v108 = MKI64(0LL /* TYPE_ERROR */); x92 = v108; x91 = x2; @@ -24475,7 +17385,7 @@ static void mw_mirth_type_Value_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, decref(v109); STR* v110; STRLIT(v110, "Can't unify float value with string value.", 42); - VAL v111 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v110), x1)); + VAL v111 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x2, MKSTR(v110), x1); VAL v112 = MKI64(0LL /* TYPE_ERROR */); x92 = v112; x91 = x2; @@ -24880,63 +17790,163 @@ static int64_t mw_mirth_type_Value_hasZ_metaZAsk (uint64_t x1, VAL x2) { int64_t v4 = mw_mirth_type_Type_hasZ_metaZAsk(x1, v3); return v4; } +static int64_t mw_mirth_type_Type_hasZ_varZAsk (uint64_t x1, VAL x2) { + int64_t x3; + switch (get_data_tag(x2)) { + case 0LL: { // TYPE_ERROR + int64_t v4 = 1LL /* True */; + x3 = v4; + } break; + case 1LL: { // TYPE_DONT_CARE + int64_t v5 = 1LL /* True */; + x3 = v5; + } break; + case 5LL: { // TVar + uint64_t v6 = mtp_mirth_type_Type_TVar(x2); + int64_t v7 = mw_mirth_var_Var_index(x1); + int64_t v8 = mw_mirth_var_Var_index(v6); + bool v9 = (v7 == v8); + x3 = ((int64_t)v9); + } break; + case 3LL: { // TMeta + uint64_t v10 = mtp_mirth_type_Type_TMeta(x2); + int64_t v11 = mw_mirth_type_MetaVar_hasZ_varZAsk(x1, v10); + x3 = v11; + } break; + case 2LL: { // TPrim + int64_t v12 = mtp_mirth_type_Type_TPrim(x2); + int64_t v13 = 0LL /* False */; + x3 = v13; + } break; + case 4LL: { // THole + uint64_t v14 = mtp_mirth_type_Type_THole(x2); + int64_t v15 = 0LL /* False */; + x3 = v15; + } break; + case 9LL: { // TTensor + VAL v16 = mtp_mirth_type_Type_TTensor(x2); + int64_t v17 = mw_mirth_type_StackType_hasZ_varZAsk(x1, v16); + x3 = v17; + } break; + case 10LL: { // TMorphism + VAL v18 = mtp_mirth_type_Type_TMorphism(x2); + int64_t v19 = mw_mirth_type_ArrowType_hasZ_varZAsk(x1, v18); + x3 = v19; + } break; + case 11LL: { // TApp + VAL v20; + VAL v21; + mtp_mirth_type_Type_TApp(x2, &v20, &v21); + int64_t v22 = mw_mirth_type_Type_hasZ_var2ZAsk(x1, v20, v21); + x3 = v22; + } break; + case 7LL: { // TData + uint64_t v23 = mtp_mirth_type_Type_TData(x2); + int64_t v24 = 0LL /* False */; + x3 = v24; + } break; + case 8LL: { // TDataPartial + VAL v25 = mtp_mirth_type_Type_TDataPartial(x2); + decref(v25); + int64_t v26 = 0LL /* False */; + x3 = v26; + } break; + case 6LL: { // TTable + uint64_t v27 = mtp_mirth_type_Type_TTable(x2); + int64_t v28 = 0LL /* False */; + x3 = v28; + } break; + case 13LL: { // TValue + VAL v29 = mtp_mirth_type_Type_TValue(x2); + int64_t v30 = mw_mirth_type_Value_hasZ_varZAsk(x1, v29); + x3 = v30; + } break; + case 12LL: { // TMut + VAL v31 = mtp_mirth_type_Type_TMut(x2); + int64_t v32 = mw_mirth_type_Type_hasZ_varZAsk(x1, v31); + x3 = v32; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x3; +} +static int64_t mw_mirth_type_Type_hasZ_var2ZAsk (uint64_t x1, VAL x2, VAL x3) { + int64_t v4 = mw_mirth_type_Type_hasZ_varZAsk(x1, x3); + int64_t x5; + if (((bool)v4)) { + decref(x2); + int64_t v6 = 1LL /* True */; + x5 = v6; + } else { + int64_t v7 = mw_mirth_type_Type_hasZ_varZAsk(x1, x2); + x5 = v7; + } + return x5; +} +static int64_t mw_mirth_type_Value_hasZ_varZAsk (uint64_t x1, VAL x2) { + VAL v3 = mw_mirth_type_Value_type(x2); + int64_t v4 = mw_mirth_type_Type_hasZ_varZAsk(x1, v3); + return v4; +} static VAL mw_mirth_type_Type_typeZThen (VAL x1, VAL x2) { VAL x3; switch (get_data_tag(x1)) { case 0LL: { // TYPE_ERROR STR* v4; STRLIT(v4, "", 7); - VAL v5 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v4), x2)); + VAL v5 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v4), x2); x3 = v5; } break; case 1LL: { // TYPE_DONT_CARE STR* v6; STRLIT(v6, "_", 1); - VAL v7 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), x2)); + VAL v7 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), x2); x3 = v7; } break; case 2LL: { // TPrim int64_t v8 = mtp_mirth_type_Type_TPrim(x1); - VAL v9 = (mw_mirth_type_PrimType_typeZThen(x2, v8)); + VAL v9 = mw_mirth_type_PrimType_typeZThen(x2, v8); x3 = v9; } break; case 5LL: { // TVar uint64_t v10 = mtp_mirth_type_Type_TVar(x1); - VAL v11 = (mw_mirth_var_Var_typeZThen(x2, v10)); + VAL v11 = mw_mirth_var_Var_typeZThen(x2, v10); x3 = v11; } break; case 3LL: { // TMeta uint64_t v12 = mtp_mirth_type_Type_TMeta(x1); - VAL v13 = (mw_mirth_type_MetaVar_typeZThen(x2, v12)); + VAL v13 = mw_mirth_type_MetaVar_typeZThen(x2, v12); x3 = v13; } break; case 9LL: { // TTensor VAL v14 = mtp_mirth_type_Type_TTensor(x1); STR* v15; STRLIT(v15, "[", 1); - VAL v16 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v15), x2)); - VAL v17 = (mw_mirth_type_StackType_stackZThen(v16, v14)); + VAL v16 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v15), x2); + VAL v17 = mw_mirth_type_StackType_stackZThen(v16, v14); STR* v18; STRLIT(v18, "]", 1); - VAL v19 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), v17)); + VAL v19 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), v17); x3 = v19; } break; case 10LL: { // TMorphism VAL v20 = mtp_mirth_type_Type_TMorphism(x1); STR* v21; STRLIT(v21, "[", 1); - VAL v22 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v21), x2)); - VAL v23 = (mw_mirth_type_ArrowType_sigZThen(v22, v20)); + VAL v22 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v21), x2); + VAL v23 = mw_mirth_type_ArrowType_sigZThen(v22, v20); STR* v24; STRLIT(v24, "]", 1); - VAL v25 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v24), v23)); + VAL v25 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v24), v23); x3 = v25; } break; case 7LL: { // TData uint64_t v26 = mtp_mirth_type_Type_TData(x1); uint64_t v27 = mw_mirth_data_Data_name(v26); VAL v28 = mw_mirth_name_Name_ZToStr(v27); - VAL v29 = (mw_std_str_ZPlusStr_pushZ_strZBang(v28, x2)); + VAL v29 = mw_std_str_ZPlusStr_pushZ_strZBang(v28, x2); x3 = v29; } break; case 8LL: { // TDataPartial @@ -24946,52 +17956,52 @@ static VAL mw_mirth_type_Type_typeZThen (VAL x1, VAL x2) { decref(v30); uint64_t v32 = mw_mirth_data_Data_name(v31); VAL v33 = mw_mirth_name_Name_ZToStr(v32); - VAL v34 = (mw_std_str_ZPlusStr_pushZ_strZBang(v33, x2)); + VAL v34 = mw_std_str_ZPlusStr_pushZ_strZBang(v33, x2); STR* v35; STRLIT(v35, "/", 1); - VAL v36 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v35), v34)); + VAL v36 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v35), v34); uint64_t v37 = VU64(VTUP(v30)->cells[2]); decref(v30); uint64_t v38 = mw_mirth_label_Label_name(v37); VAL v39 = mw_mirth_name_Name_ZToStr(v38); - VAL v40 = (mw_std_str_ZPlusStr_pushZ_strZBang(v39, v36)); + VAL v40 = mw_std_str_ZPlusStr_pushZ_strZBang(v39, v36); x3 = v40; } break; case 6LL: { // TTable uint64_t v41 = mtp_mirth_type_Type_TTable(x1); uint64_t v42 = mw_mirth_table_Table_name(v41); VAL v43 = mw_mirth_name_Name_ZToStr(v42); - VAL v44 = (mw_std_str_ZPlusStr_pushZ_strZBang(v43, x2)); + VAL v44 = mw_std_str_ZPlusStr_pushZ_strZBang(v43, x2); x3 = v44; } break; case 4LL: { // THole uint64_t v45 = mtp_mirth_type_Type_THole(x1); VAL v46 = mw_mirth_name_Name_ZToStr(v45); - VAL v47 = (mw_std_str_ZPlusStr_pushZ_strZBang(v46, x2)); + VAL v47 = mw_std_str_ZPlusStr_pushZ_strZBang(v46, x2); x3 = v47; } break; case 11LL: { // TApp VAL v48; VAL v49; mtp_mirth_type_Type_TApp(x1, &v48, &v49); - VAL v50 = (mw_mirth_type_Type_appZ_typeZThenZThen(x2, v48, v49)); + VAL v50 = mw_mirth_type_Type_appZ_typeZThenZThen(x2, v48, v49); x3 = v50; } break; case 13LL: { // TValue VAL v51 = mtp_mirth_type_Type_TValue(x1); VAL v52 = mw_mirth_type_Value_type(v51); - VAL v53 = (mw_mirth_type_Type_typeZThen(v52, x2)); + VAL v53 = mw_mirth_type_Type_typeZThen(v52, x2); x3 = v53; } break; case 12LL: { // TMut VAL v54 = mtp_mirth_type_Type_TMut(x1); STR* v55; STRLIT(v55, "Mut(", 4); - VAL v56 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v55), x2)); - VAL v57 = (mw_mirth_type_Type_typeZThen(v54, v56)); + VAL v56 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v55), x2); + VAL v57 = mw_mirth_type_Type_typeZThen(v54, v56); STR* v58; STRLIT(v58, ")", 1); - VAL v59 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v58), v57)); + VAL v59 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v58), v57); x3 = v59; } break; default: { @@ -25096,7 +18106,7 @@ static VAL mw_mirth_type_PrimType_typeZThen (VAL x1, int64_t x2) { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v14 = (mw_std_str_ZPlusStr_pushZ_strZBang(x4, x3)); + VAL v14 = mw_std_str_ZPlusStr_pushZ_strZBang(x4, x3); return v14; } static void mw_mirth_type_Type_freshen (VAL x1, VAL x2, VAL *x3, VAL *x4) { @@ -25232,152 +18242,149 @@ static void mw_mirth_type_Type_rigidifyZBang (VAL x1, VAL x2, VAL x3, VAL *x4, V VAL v11 = mw_mirth_type_MetaVar_typeZAsk(v10); VAL x12; VAL x13; - VAL x14; switch (get_data_tag(v11)) { case 0LL: { // None - VAL v15; - uint64_t v16; - mw_mirth_var_Ctx_freshZ_typeZ_varZBang(x2, &v15, &v16); - VAL v17 = mtw_mirth_type_Type_TVar(v16); - incref(v17); - VAL v18 = mtw_std_maybe_Maybe_1_Some(v17); - void* v19 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v10); - mut_set(v18, v19); - x14 = v17; - x13 = v15; - x12 = x1; + VAL v14; + uint64_t v15; + mw_mirth_var_Ctx_freshZ_typeZ_varZBang(x2, &v14, &v15); + VAL v16 = mtw_mirth_type_Type_TVar(v15); + incref(v16); + VAL v17 = mtw_std_maybe_Maybe_1_Some(v16); + void* v18 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v10); + mut_set(v17, v18); + x13 = v16; + x12 = v14; } break; case 1LL: { // Some - VAL v20 = mtp_std_maybe_Maybe_1_Some(v11); - x14 = v20; - x13 = x2; - x12 = x1; + VAL v19 = mtp_std_maybe_Maybe_1_Some(v11); + x13 = v19; + x12 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } + VAL v20; VAL v21; VAL v22; - VAL v23; - mw_mirth_type_Type_rigidifyZBang(x12, x13, x14, &v21, &v22, &v23); - x9 = v23; - x8 = v22; - x7 = v21; + mw_mirth_type_Type_rigidifyZBang(x1, x12, x13, &v20, &v21, &v22); + x9 = v22; + x8 = v21; + x7 = v20; } break; case 0LL: { // TYPE_ERROR - VAL v24 = MKI64(0LL /* TYPE_ERROR */); - x9 = v24; + VAL v23 = MKI64(0LL /* TYPE_ERROR */); + x9 = v23; x8 = x2; x7 = x1; } break; case 1LL: { // TYPE_DONT_CARE - VAL v25 = MKI64(1LL /* TYPE_DONT_CARE */); - x9 = v25; + VAL v24 = MKI64(1LL /* TYPE_DONT_CARE */); + x9 = v24; x8 = x2; x7 = x1; } break; case 2LL: { // TPrim - int64_t v26 = mtp_mirth_type_Type_TPrim(x3); - VAL v27 = mtw_mirth_type_Type_TPrim(v26); - x9 = v27; + int64_t v25 = mtp_mirth_type_Type_TPrim(x3); + VAL v26 = mtw_mirth_type_Type_TPrim(v25); + x9 = v26; x8 = x2; x7 = x1; } break; case 4LL: { // THole - uint64_t v28 = mtp_mirth_type_Type_THole(x3); - VAL v29 = mtw_mirth_type_Type_THole(v28); - x9 = v29; + uint64_t v27 = mtp_mirth_type_Type_THole(x3); + VAL v28 = mtw_mirth_type_Type_THole(v27); + x9 = v28; x8 = x2; x7 = x1; } break; case 5LL: { // TVar - uint64_t v30 = mtp_mirth_type_Type_TVar(x3); - VAL v31 = mtw_mirth_type_Type_TVar(v30); - x9 = v31; + uint64_t v29 = mtp_mirth_type_Type_TVar(x3); + VAL v30 = mtw_mirth_type_Type_TVar(v29); + x9 = v30; x8 = x2; x7 = x1; } break; case 6LL: { // TTable - uint64_t v32 = mtp_mirth_type_Type_TTable(x3); - VAL v33 = mtw_mirth_type_Type_TTable(v32); - x9 = v33; + uint64_t v31 = mtp_mirth_type_Type_TTable(x3); + VAL v32 = mtw_mirth_type_Type_TTable(v31); + x9 = v32; x8 = x2; x7 = x1; } break; case 7LL: { // TData - uint64_t v34 = mtp_mirth_type_Type_TData(x3); - VAL v35 = mtw_mirth_type_Type_TData(v34); - x9 = v35; + uint64_t v33 = mtp_mirth_type_Type_TData(x3); + VAL v34 = mtw_mirth_type_Type_TData(v33); + x9 = v34; x8 = x2; x7 = x1; } break; case 8LL: { // TDataPartial - VAL v36 = mtp_mirth_type_Type_TDataPartial(x3); - VAL v37 = mtw_mirth_type_Type_TDataPartial(v36); - x9 = v37; + VAL v35 = mtp_mirth_type_Type_TDataPartial(x3); + VAL v36 = mtw_mirth_type_Type_TDataPartial(v35); + x9 = v36; x8 = x2; x7 = x1; } break; case 11LL: { // TApp + VAL v37; VAL v38; + mtp_mirth_type_Type_TApp(x3, &v37, &v38); VAL v39; - mtp_mirth_type_Type_TApp(x3, &v38, &v39); VAL v40; VAL v41; + mw_mirth_type_Type_rigidifyZBang(x1, x2, v37, &v39, &v40, &v41); VAL v42; - mw_mirth_type_Type_rigidifyZBang(x1, x2, v38, &v40, &v41, &v42); VAL v43; VAL v44; - VAL v45; - mw_mirth_type_Type_rigidifyZBang(v40, v41, v39, &v43, &v44, &v45); - VAL v46 = mtw_mirth_type_Type_TApp(v42, v45); - x9 = v46; - x8 = v44; - x7 = v43; + mw_mirth_type_Type_rigidifyZBang(v39, v40, v38, &v42, &v43, &v44); + VAL v45 = mtw_mirth_type_Type_TApp(v41, v44); + x9 = v45; + x8 = v43; + x7 = v42; } break; case 9LL: { // TTensor - VAL v47 = mtp_mirth_type_Type_TTensor(x3); + VAL v46 = mtp_mirth_type_Type_TTensor(x3); + VAL v47; VAL v48; VAL v49; - VAL v50; - mw_mirth_type_StackType_rigidifyZBang(x1, x2, v47, &v48, &v49, &v50); - VAL v51 = mtw_mirth_type_Type_TTensor(v50); - x9 = v51; - x8 = v49; - x7 = v48; + mw_mirth_type_StackType_rigidifyZBang(x1, x2, v46, &v47, &v48, &v49); + VAL v50 = mtw_mirth_type_Type_TTensor(v49); + x9 = v50; + x8 = v48; + x7 = v47; } break; case 10LL: { // TMorphism - VAL v52 = mtp_mirth_type_Type_TMorphism(x3); + VAL v51 = mtp_mirth_type_Type_TMorphism(x3); + VAL v52; VAL v53; VAL v54; - VAL v55; - mw_mirth_type_ArrowType_rigidifyZBang(x1, x2, v52, &v53, &v54, &v55); - VAL v56 = mtw_mirth_type_Type_TMorphism(v55); - x9 = v56; - x8 = v54; - x7 = v53; + mw_mirth_type_ArrowType_rigidifyZBang(x1, x2, v51, &v52, &v53, &v54); + VAL v55 = mtw_mirth_type_Type_TMorphism(v54); + x9 = v55; + x8 = v53; + x7 = v52; } break; case 13LL: { // TValue - VAL v57 = mtp_mirth_type_Type_TValue(x3); + VAL v56 = mtp_mirth_type_Type_TValue(x3); + VAL v57; VAL v58; VAL v59; - VAL v60; - mw_mirth_type_Value_rigidifyZBang(x1, x2, v57, &v58, &v59, &v60); - x9 = v60; - x8 = v59; - x7 = v58; + mw_mirth_type_Value_rigidifyZBang(x1, x2, v56, &v57, &v58, &v59); + x9 = v59; + x8 = v58; + x7 = v57; } break; case 12LL: { // TMut - VAL v61 = mtp_mirth_type_Type_TMut(x3); + VAL v60 = mtp_mirth_type_Type_TMut(x3); + VAL v61; VAL v62; VAL v63; - VAL v64; - mw_mirth_type_Type_rigidifyZBang(x1, x2, v61, &v62, &v63, &v64); - VAL v65 = mtw_mirth_type_Type_TMut(v64); - x9 = v65; - x8 = v63; - x7 = v62; + mw_mirth_type_Type_rigidifyZBang(x1, x2, v60, &v61, &v62, &v63); + VAL v64 = mtw_mirth_type_Type_TMut(v63); + x9 = v64; + x8 = v62; + x7 = v61; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -25450,12 +18457,7 @@ static VAL mw_mirth_type_Type_exceptZ_field (uint64_t x1, uint64_t x2, VAL x3) { case 0LL: { // None STR* v8; STRLIT(v8, "Type.except-field on metavar", 28); - push_u64(x1); - push_u64(x2); - push_u64(v5); do_panic(v8); - VAL v9 = pop_value(); - x7 = v9; } break; case 1LL: { // Some VAL v10 = mtp_std_maybe_Maybe_1_Some(v6); @@ -25490,12 +18492,7 @@ static VAL mw_mirth_type_Type_exceptZ_field (uint64_t x1, uint64_t x2, VAL x3) { default: { STR* v22; STRLIT(v22, "Type.except-field on unexpected type", 36); - push_u64(x1); - push_u64(x2); - push_value(x3); do_panic(v22); - VAL v23 = pop_value(); - x4 = v23; } break; } return x4; @@ -25536,6 +18533,25 @@ static int64_t mw_mirth_type_MetaVar_hasZ_metaZAsk (uint64_t x1, uint64_t x2) { } return x4; } +static int64_t mw_mirth_type_MetaVar_hasZ_varZAsk (uint64_t x1, uint64_t x2) { + VAL v3 = mw_mirth_type_MetaVar_typeZAsk(x2); + int64_t x4; + switch (get_data_tag(v3)) { + case 1LL: { // Some + VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); + int64_t v6 = mw_mirth_type_Type_hasZ_varZAsk(x1, v5); + x4 = v6; + } break; + case 0LL: { // None + int64_t v7 = 0LL /* False */; + x4 = v7; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x4; +} static VAL mw_mirth_type_MetaVar_typeZThen (VAL x1, uint64_t x2) { VAL v3 = mw_mirth_type_MetaVar_typeZAsk(x2); VAL x4; @@ -25543,15 +18559,15 @@ static VAL mw_mirth_type_MetaVar_typeZThen (VAL x1, uint64_t x2) { case 0LL: { // None STR* v5; STRLIT(v5, "?", 1); - VAL v6 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v5), x1)); + VAL v6 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v5), x1); int64_t v7 = mw_mirth_type_MetaVar_index(x2); STR* v8 = i64_show(v7); - VAL v9 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), v6)); + VAL v9 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), v6); x4 = v9; } break; case 1LL: { // Some VAL v10 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v11 = (mw_mirth_type_Type_typeZThen(v10, x1)); + VAL v11 = mw_mirth_type_Type_typeZThen(v10, x1); x4 = v11; } break; default: { @@ -25731,25 +18747,25 @@ static void mw_mirth_type_typeZ_holeZ_unifyZBang (VAL x1, uint64_t x2, VAL x3, u STR* v8; STRLIT(v8, "", 0); VAL v9 = mtw_mirth_type_Type_THole(x4); - VAL v10 = (mw_mirth_type_Type_typeZThen(v9, MKSTR(v8))); + VAL v10 = mw_mirth_type_Type_typeZThen(v9, MKSTR(v8)); STR* v11; STRLIT(v11, " ~ ", 3); - VAL v12 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10)); + VAL v12 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10); incref(x3); - VAL v13 = (mw_mirth_type_Type_typeZThen(x3, v12)); + VAL v13 = mw_mirth_type_Type_typeZThen(x3, v12); STR* v14; STRLIT(v14, "\n", 1); - VAL v15 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), v13)); - VAL v16 = (mw_mirth_mirth_ZPlusMirth_emitZ_infoZBang(x2, v15, x1)); + VAL v15 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), v13); + VAL v16 = mw_mirth_mirth_ZPlusMirth_emitZ_infoZBang(x2, v15, x1); *x7 = x3; *x6 = x2; *x5 = v16; } static VAL mw_mirth_type_Type_appZ_typeZThenZThen (VAL x1, VAL x2, VAL x3) { - VAL v4 = (mw_mirth_type_Type_appZ_typeZ_openZThenZThen(x1, x2, x3)); + VAL v4 = mw_mirth_type_Type_appZ_typeZ_openZThenZThen(x1, x2, x3); STR* v5; STRLIT(v5, ")", 1); - VAL v6 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v5), v4)); + VAL v6 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v5), v4); return v6; } static VAL mw_mirth_type_Type_appZ_typeZ_openZThenZThen (VAL x1, VAL x2, VAL x3) { @@ -25760,19 +18776,19 @@ static VAL mw_mirth_type_Type_appZ_typeZ_openZThenZThen (VAL x1, VAL x2, VAL x3) VAL v6; VAL v7; mtp_mirth_type_Type_TApp(v4, &v6, &v7); - VAL v8 = (mw_mirth_type_Type_appZ_typeZ_openZThenZThen(x1, v6, v7)); + VAL v8 = mw_mirth_type_Type_appZ_typeZ_openZThenZThen(x1, v6, v7); STR* v9; STRLIT(v9, ", ", 2); - VAL v10 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v9), v8)); - VAL v11 = (mw_mirth_type_Type_typeZThen(x3, v10)); + VAL v10 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v9), v8); + VAL v11 = mw_mirth_type_Type_typeZThen(x3, v10); x5 = v11; } break; default: { - VAL v12 = (mw_mirth_type_Type_typeZThen(v4, x1)); + VAL v12 = mw_mirth_type_Type_typeZThen(v4, x1); STR* v13; STRLIT(v13, "(", 1); - VAL v14 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v13), v12)); - VAL v15 = (mw_mirth_type_Type_typeZThen(x3, v14)); + VAL v14 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v13), v12); + VAL v15 = mw_mirth_type_Type_typeZThen(x3, v14); x5 = v15; } break; } @@ -25789,6 +18805,11 @@ static int64_t mw_mirth_type_Resource_hasZ_metaZAsk (uint64_t x1, VAL x2) { int64_t v4 = mw_mirth_type_Type_hasZ_metaZAsk(x1, v3); return v4; } +static int64_t mw_mirth_type_Resource_hasZ_varZAsk (uint64_t x1, VAL x2) { + VAL v3 = mw_mirth_type_Resource_ZToType(x2); + int64_t v4 = mw_mirth_type_Type_hasZ_varZAsk(x1, v3); + return v4; +} static void mw_mirth_type_Resource_unifyZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, VAL *x5, uint64_t *x6, VAL *x7) { VAL v8 = mw_mirth_type_Resource_ZToType(x3); VAL v9 = mw_mirth_type_Resource_ZToType(x4); @@ -25814,7 +18835,7 @@ static void mw_mirth_type_Resource_unifyZ_errorZBang (VAL x1, uint64_t x2, VAL x } static VAL mw_mirth_type_Resource_typeZThen (VAL x1, VAL x2) { VAL v3 = mw_mirth_type_Resource_ZToType(x2); - VAL v4 = (mw_mirth_type_Type_typeZThen(v3, x1)); + VAL v4 = mw_mirth_type_Type_typeZThen(v3, x1); return v4; } static void mw_mirth_type_Resource_freshen (VAL x1, VAL x2, VAL *x3, VAL *x4) { @@ -25869,10 +18890,7 @@ static VAL mw_mirth_type_Type_ZToStackType (VAL x1) { default: { STR* v10; STRLIT(v10, "kind error! expected stack type, got regular type.", 50); - push_value(x1); do_panic(v10); - VAL v11 = pop_value(); - x2 = v11; } break; } return x2; @@ -26322,42 +19340,11 @@ static VAL mw_mirth_type_StackType_topZ_namespaces (VAL x1) { VAL v3 = mw_std_list_List_1_reverse(v2); incref(x1); VAL v4 = mw_mirth_type_StackType_topZ_tyconZAsk(x1); - VAL x5; - VAL x6; - switch (get_data_tag(v4)) { - case 1LL: { // Some - VAL v7 = mtp_std_maybe_Maybe_1_Some(v4); - VAL v8 = mtw_mirth_name_Namespace_NAMESPACEz_TYCON(v7); - VAL v9 = mtw_std_list_List_1_Cons(v8, v3); - x6 = x1; - x5 = v9; - } break; - case 0LL: { // None - x6 = x1; - x5 = v3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v10 = mw_mirth_type_StackType_topZ_resourceZ_tyconZAsk(x6); - VAL x11; - switch (get_data_tag(v10)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v10); - VAL v13 = mtw_mirth_name_Namespace_NAMESPACEz_TYCON(v12); - VAL v14 = mtw_std_list_List_1_Cons(v13, x5); - x11 = v14; - } break; - case 0LL: { // None - x11 = x5; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v15 = mw_std_list_List_1_reverse(x11); - return v15; + VAL v5 = mw_std_maybe_Maybe_1_for_1_sp17(v3, v4); + VAL v6 = mw_mirth_type_StackType_topZ_resourceZ_tyconZAsk(x1); + VAL v7 = mw_std_maybe_Maybe_1_for_1_sp17(v5, v6); + VAL v8 = mw_std_list_List_1_reverse(v7); + return v8; } static int64_t mw_mirth_type_StackType_topZ_typesZ_areZ_fineZAsk (VAL x1) { incref(x1); @@ -26609,6 +19596,105 @@ static int64_t mw_mirth_type_StackType_hasZ_metaZAsk (uint64_t x1, VAL x2) { } return x4; } +static int64_t mw_mirth_type_StackType_hasZ_varZAsk (uint64_t x1, VAL x2) { + int64_t x3; + switch (get_data_tag(x2)) { + case 0LL: { // STACK_TYPE_ERROR + int64_t v4 = 0LL /* False */; + x3 = v4; + } break; + case 1LL: { // STACK_TYPE_DONT_CARE + int64_t v5 = 0LL /* False */; + x3 = v5; + } break; + case 2LL: { // STACK_TYPE_UNIT + int64_t v6 = 0LL /* False */; + x3 = v6; + } break; + case 4LL: { // STMeta + uint64_t v7 = mtp_mirth_type_StackType_STMeta(x2); + int64_t v8 = mw_mirth_type_MetaVar_hasZ_varZAsk(x1, v7); + x3 = v8; + } break; + case 3LL: { // STVar + uint64_t v9 = mtp_mirth_type_StackType_STVar(x2); + int64_t v10 = mw_mirth_var_Var_index(x1); + int64_t v11 = mw_mirth_var_Var_index(v9); + bool v12 = (v10 == v11); + x3 = ((int64_t)v12); + } break; + case 5LL: { // STCons + VAL v13; + VAL v14; + mtp_mirth_type_StackType_STCons(x2, &v13, &v14); + int64_t v15 = mw_mirth_type_Type_hasZ_varZAsk(x1, v14); + int64_t x16; + if (((bool)v15)) { + decref(v13); + int64_t v17 = 1LL /* True */; + x16 = v17; + } else { + int64_t v18 = mw_mirth_type_StackType_hasZ_varZAsk(x1, v13); + x16 = v18; + } + x3 = x16; + } break; + case 7LL: { // STWith + VAL v19; + VAL v20; + mtp_mirth_type_StackType_STWith(x2, &v19, &v20); + int64_t v21 = mw_mirth_type_Resource_hasZ_varZAsk(x1, v20); + int64_t x22; + if (((bool)v21)) { + decref(v19); + int64_t v23 = 1LL /* True */; + x22 = v23; + } else { + int64_t v24 = mw_mirth_type_StackType_hasZ_varZAsk(x1, v19); + x22 = v24; + } + x3 = x22; + } break; + case 6LL: { // STConsLabel + VAL v25; + VAL v26; + uint64_t v27; + mtp_mirth_type_StackType_STConsLabel(x2, &v25, &v26, &v27); + int64_t v28 = mw_mirth_type_Type_hasZ_varZAsk(x1, v26); + int64_t x29; + if (((bool)v28)) { + decref(v25); + int64_t v30 = 1LL /* True */; + x29 = v30; + } else { + int64_t v31 = mw_mirth_type_StackType_hasZ_varZAsk(x1, v25); + x29 = v31; + } + x3 = x29; + } break; + case 8LL: { // STWithLabel + VAL v32; + VAL v33; + uint64_t v34; + mtp_mirth_type_StackType_STWithLabel(x2, &v32, &v33, &v34); + int64_t v35 = mw_mirth_type_Resource_hasZ_varZAsk(x1, v33); + int64_t x36; + if (((bool)v35)) { + decref(v32); + int64_t v37 = 1LL /* True */; + x36 = v37; + } else { + int64_t v38 = mw_mirth_type_StackType_hasZ_varZAsk(x1, v32); + x36 = v38; + } + x3 = x36; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x3; +} static void mw_mirth_type_StackType_unifyZ_failedZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, VAL *x5, uint64_t *x6, VAL *x7) { VAL v8 = mw_mirth_type_StackType_ZToType(x3); VAL v9 = mw_mirth_type_StackType_ZToType(x4); @@ -27339,186 +20425,132 @@ static VAL mw_mirth_type_StackType_forceZ_consZ_labelZAskZBang (uint64_t x1, VAL VAL v21; mtp_mirth_type_StackType_STWith(v3, &v20, &v21); VAL v22 = mw_mirth_type_StackType_forceZ_consZ_labelZAskZBang(x1, v20); - VAL x23; - VAL x24; - switch (get_data_tag(v22)) { - case 1LL: { // Some - VAL v25 = mtp_std_maybe_Maybe_1_Some(v22); - VAL v26; - VAL v27; - value_uncons(v25, &v26, &v27); - VAL v28; - VAL v29; - value_uncons(v26, &v28, &v29); - decref(v28); - incref(v21); - VAL v30 = mtw_mirth_type_StackType_STWith(v29, v21); - VAL v31 = MKNIL; - VAL v32 = mkcons(v31, v30); - VAL v33 = mkcons(v32, v27); - VAL v34 = mtw_std_maybe_Maybe_1_Some(v33); - x24 = v34; - x23 = v21; - } break; - case 0LL: { // None - VAL v35 = MKI64(0LL /* None */); - x24 = v35; - x23 = v21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - decref(x23); - x4 = x24; + VAL v23; + VAL v24; + mw_std_maybe_Maybe_1_map_1_sp3(v21, v22, &v23, &v24); + decref(v23); + x4 = v24; } break; case 5LL: { // STCons - VAL v36; - VAL v37; - mtp_mirth_type_StackType_STCons(v3, &v36, &v37); - VAL v38 = mw_mirth_type_StackType_forceZ_consZ_labelZAskZBang(x1, v36); - VAL x39; - VAL x40; - switch (get_data_tag(v38)) { - case 1LL: { // Some - VAL v41 = mtp_std_maybe_Maybe_1_Some(v38); - VAL v42; - VAL v43; - value_uncons(v41, &v42, &v43); - VAL v44; - VAL v45; - value_uncons(v42, &v44, &v45); - decref(v44); - incref(v37); - VAL v46 = mtw_mirth_type_StackType_STCons(v45, v37); - VAL v47 = MKNIL; - VAL v48 = mkcons(v47, v46); - VAL v49 = mkcons(v48, v43); - VAL v50 = mtw_std_maybe_Maybe_1_Some(v49); - x40 = v50; - x39 = v37; - } break; - case 0LL: { // None - VAL v51 = MKI64(0LL /* None */); - x40 = v51; - x39 = v37; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - decref(x39); - x4 = x40; + VAL v25; + VAL v26; + mtp_mirth_type_StackType_STCons(v3, &v25, &v26); + VAL v27 = mw_mirth_type_StackType_forceZ_consZ_labelZAskZBang(x1, v25); + VAL v28; + VAL v29; + mw_std_maybe_Maybe_1_map_1_sp4(v26, v27, &v28, &v29); + decref(v28); + x4 = v29; } break; case 6LL: { // STConsLabel - VAL v52; - VAL v53; - uint64_t v54; - mtp_mirth_type_StackType_STConsLabel(v3, &v52, &v53, &v54); - int64_t v55 = mw_mirth_label_Label_ZEqualZEqual(x1, v54); - VAL x56; - if (((bool)v55)) { - VAL v57 = MKNIL; - VAL v58 = mkcons(v57, v52); - VAL v59 = mkcons(v58, v53); - VAL v60 = mtw_std_maybe_Maybe_1_Some(v59); - x56 = v60; + VAL v30; + VAL v31; + uint64_t v32; + mtp_mirth_type_StackType_STConsLabel(v3, &v30, &v31, &v32); + int64_t v33 = mw_mirth_label_Label_ZEqualZEqual(x1, v32); + VAL x34; + if (((bool)v33)) { + VAL v35 = MKNIL; + VAL v36 = mkcons(v35, v30); + VAL v37 = mkcons(v36, v31); + VAL v38 = mtw_std_maybe_Maybe_1_Some(v37); + x34 = v38; } else { - VAL v61 = mw_mirth_type_StackType_forceZ_consZ_labelZAskZBang(x1, v52); - VAL x62; - switch (get_data_tag(v61)) { + VAL v39 = mw_mirth_type_StackType_forceZ_consZ_labelZAskZBang(x1, v30); + VAL x40; + switch (get_data_tag(v39)) { case 1LL: { // Some - VAL v63 = mtp_std_maybe_Maybe_1_Some(v61); - VAL v64; - VAL v65; - value_uncons(v63, &v64, &v65); - VAL v66; - VAL v67; - value_uncons(v64, &v66, &v67); - decref(v66); - VAL v68 = mtw_mirth_type_StackType_STConsLabel(v67, v53, v54); - VAL v69 = MKNIL; - VAL v70 = mkcons(v69, v68); - VAL v71 = mkcons(v70, v65); - VAL v72 = mtw_std_maybe_Maybe_1_Some(v71); - x62 = v72; + VAL v41 = mtp_std_maybe_Maybe_1_Some(v39); + VAL v42; + VAL v43; + value_uncons(v41, &v42, &v43); + VAL v44; + VAL v45; + value_uncons(v42, &v44, &v45); + decref(v44); + VAL v46 = mtw_mirth_type_StackType_STConsLabel(v45, v31, v32); + VAL v47 = MKNIL; + VAL v48 = mkcons(v47, v46); + VAL v49 = mkcons(v48, v43); + VAL v50 = mtw_std_maybe_Maybe_1_Some(v49); + x40 = v50; } break; case 0LL: { // None - decref(v53); - VAL v73 = MKI64(0LL /* None */); - x62 = v73; + decref(v31); + VAL v51 = MKI64(0LL /* None */); + x40 = v51; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x56 = x62; + x34 = x40; } - x4 = x56; + x4 = x34; } break; case 8LL: { // STWithLabel - VAL v74; - VAL v75; - uint64_t v76; - mtp_mirth_type_StackType_STWithLabel(v3, &v74, &v75, &v76); - int64_t v77 = mw_mirth_label_Label_ZEqualZEqual(x1, v76); - VAL x78; - if (((bool)v77)) { - decref(v75); - decref(v74); - VAL v79 = MKI64(0LL /* None */); - x78 = v79; + VAL v52; + VAL v53; + uint64_t v54; + mtp_mirth_type_StackType_STWithLabel(v3, &v52, &v53, &v54); + int64_t v55 = mw_mirth_label_Label_ZEqualZEqual(x1, v54); + VAL x56; + if (((bool)v55)) { + decref(v53); + decref(v52); + VAL v57 = MKI64(0LL /* None */); + x56 = v57; } else { - VAL v80 = mw_mirth_type_StackType_forceZ_consZ_labelZAskZBang(x1, v74); - VAL x81; - switch (get_data_tag(v80)) { + VAL v58 = mw_mirth_type_StackType_forceZ_consZ_labelZAskZBang(x1, v52); + VAL x59; + switch (get_data_tag(v58)) { case 1LL: { // Some - VAL v82 = mtp_std_maybe_Maybe_1_Some(v80); - VAL v83; - VAL v84; - value_uncons(v82, &v83, &v84); - VAL v85; - VAL v86; - value_uncons(v83, &v85, &v86); - decref(v85); - VAL v87 = mtw_mirth_type_StackType_STWithLabel(v86, v75, v76); - VAL v88 = MKNIL; - VAL v89 = mkcons(v88, v87); - VAL v90 = mkcons(v89, v84); - VAL v91 = mtw_std_maybe_Maybe_1_Some(v90); - x81 = v91; + VAL v60 = mtp_std_maybe_Maybe_1_Some(v58); + VAL v61; + VAL v62; + value_uncons(v60, &v61, &v62); + VAL v63; + VAL v64; + value_uncons(v61, &v63, &v64); + decref(v63); + VAL v65 = mtw_mirth_type_StackType_STWithLabel(v64, v53, v54); + VAL v66 = MKNIL; + VAL v67 = mkcons(v66, v65); + VAL v68 = mkcons(v67, v62); + VAL v69 = mtw_std_maybe_Maybe_1_Some(v68); + x59 = v69; } break; case 0LL: { // None - decref(v75); - VAL v92 = MKI64(0LL /* None */); - x81 = v92; + decref(v53); + VAL v70 = MKI64(0LL /* None */); + x59 = v70; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x78 = x81; + x56 = x59; } - x4 = x78; + x4 = x56; } break; case 4LL: { // STMeta - uint64_t v93 = mtp_mirth_type_StackType_STMeta(v3); - uint64_t v94 = mw_mirth_type_MetaVar_newZBang(); - VAL v95 = mtw_mirth_type_StackType_STMeta(v94); - uint64_t v96 = mw_mirth_type_MetaVar_newZBang(); - VAL v97 = mtw_mirth_type_Type_TMeta(v96); - incref(v95); - incref(v97); - VAL v98 = mtw_mirth_type_StackType_STConsLabel(v95, v97, x1); - VAL v99 = mw_mirth_type_StackType_ZToType(v98); - VAL v100 = mtw_std_maybe_Maybe_1_Some(v99); - void* v101 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v93); - mut_set(v100, v101); - VAL v102 = MKNIL; - VAL v103 = mkcons(v102, v95); - VAL v104 = mkcons(v103, v97); - VAL v105 = mtw_std_maybe_Maybe_1_Some(v104); - x4 = v105; + uint64_t v71 = mtp_mirth_type_StackType_STMeta(v3); + uint64_t v72 = mw_mirth_type_MetaVar_newZBang(); + VAL v73 = mtw_mirth_type_StackType_STMeta(v72); + uint64_t v74 = mw_mirth_type_MetaVar_newZBang(); + VAL v75 = mtw_mirth_type_Type_TMeta(v74); + incref(v73); + incref(v75); + VAL v76 = mtw_mirth_type_StackType_STConsLabel(v73, v75, x1); + VAL v77 = mw_mirth_type_StackType_ZToType(v76); + VAL v78 = mtw_std_maybe_Maybe_1_Some(v77); + void* v79 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v71); + mut_set(v78, v79); + VAL v80 = MKNIL; + VAL v81 = mkcons(v80, v73); + VAL v82 = mkcons(v81, v75); + VAL v83 = mtw_std_maybe_Maybe_1_Some(v82); + x4 = v83; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -27562,91 +20594,83 @@ static VAL mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang (uint64_t x1, VAL VAL v21; mtp_mirth_type_StackType_STWith(v3, &v20, &v21); VAL v22 = mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang(x1, v20); - VAL x23; - VAL x24; - switch (get_data_tag(v22)) { - case 1LL: { // Some - VAL v25 = mtp_std_maybe_Maybe_1_Some(v22); - VAL v26; - VAL v27; - value_uncons(v25, &v26, &v27); - VAL v28; - VAL v29; - value_uncons(v26, &v28, &v29); - decref(v28); - incref(v21); - VAL v30 = mtw_mirth_type_StackType_STWith(v29, v21); - VAL v31 = MKNIL; - VAL v32 = mkcons(v31, v30); - VAL v33 = mkcons(v32, v27); - VAL v34 = mtw_std_maybe_Maybe_1_Some(v33); - x24 = v34; - x23 = v21; - } break; - case 0LL: { // None - VAL v35 = MKI64(0LL /* None */); - x24 = v35; - x23 = v21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - decref(x23); - x4 = x24; + VAL v23; + VAL v24; + mw_std_maybe_Maybe_1_map_1_sp3(v21, v22, &v23, &v24); + decref(v23); + x4 = v24; } break; case 5LL: { // STCons - VAL v36; - VAL v37; - mtp_mirth_type_StackType_STCons(v3, &v36, &v37); - VAL v38 = mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang(x1, v36); - VAL x39; - VAL x40; - switch (get_data_tag(v38)) { - case 1LL: { // Some - VAL v41 = mtp_std_maybe_Maybe_1_Some(v38); - VAL v42; - VAL v43; - value_uncons(v41, &v42, &v43); - VAL v44; - VAL v45; - value_uncons(v42, &v44, &v45); - decref(v44); - incref(v37); - VAL v46 = mtw_mirth_type_StackType_STCons(v45, v37); - VAL v47 = MKNIL; - VAL v48 = mkcons(v47, v46); - VAL v49 = mkcons(v48, v43); - VAL v50 = mtw_std_maybe_Maybe_1_Some(v49); - x40 = v50; - x39 = v37; - } break; - case 0LL: { // None - VAL v51 = MKI64(0LL /* None */); - x40 = v51; - x39 = v37; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + VAL v25; + VAL v26; + mtp_mirth_type_StackType_STCons(v3, &v25, &v26); + VAL v27 = mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang(x1, v25); + VAL v28; + VAL v29; + mw_std_maybe_Maybe_1_map_1_sp4(v26, v27, &v28, &v29); + decref(v28); + x4 = v29; + } break; + case 6LL: { // STConsLabel + VAL v30; + VAL v31; + uint64_t v32; + mtp_mirth_type_StackType_STConsLabel(v3, &v30, &v31, &v32); + int64_t v33 = mw_mirth_label_Label_ZEqualZEqual(x1, v32); + VAL x34; + if (((bool)v33)) { + decref(v31); + decref(v30); + VAL v35 = MKI64(0LL /* None */); + x34 = v35; + } else { + VAL v36 = mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang(x1, v30); + VAL x37; + switch (get_data_tag(v36)) { + case 1LL: { // Some + VAL v38 = mtp_std_maybe_Maybe_1_Some(v36); + VAL v39; + VAL v40; + value_uncons(v38, &v39, &v40); + VAL v41; + VAL v42; + value_uncons(v39, &v41, &v42); + decref(v41); + VAL v43 = mtw_mirth_type_StackType_STConsLabel(v42, v31, v32); + VAL v44 = MKNIL; + VAL v45 = mkcons(v44, v43); + VAL v46 = mkcons(v45, v40); + VAL v47 = mtw_std_maybe_Maybe_1_Some(v46); + x37 = v47; + } break; + case 0LL: { // None + decref(v31); + VAL v48 = MKI64(0LL /* None */); + x37 = v48; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } } + x34 = x37; } - decref(x39); - x4 = x40; + x4 = x34; } break; - case 6LL: { // STConsLabel - VAL v52; - VAL v53; - uint64_t v54; - mtp_mirth_type_StackType_STConsLabel(v3, &v52, &v53, &v54); - int64_t v55 = mw_mirth_label_Label_ZEqualZEqual(x1, v54); - VAL x56; - if (((bool)v55)) { - decref(v53); - decref(v52); - VAL v57 = MKI64(0LL /* None */); - x56 = v57; + case 8LL: { // STWithLabel + VAL v49; + VAL v50; + uint64_t v51; + mtp_mirth_type_StackType_STWithLabel(v3, &v49, &v50, &v51); + int64_t v52 = mw_mirth_label_Label_ZEqualZEqual(x1, v51); + VAL x53; + if (((bool)v52)) { + VAL v54 = MKNIL; + VAL v55 = mkcons(v54, v49); + VAL v56 = mkcons(v55, v50); + VAL v57 = mtw_std_maybe_Maybe_1_Some(v56); + x53 = v57; } else { - VAL v58 = mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang(x1, v52); + VAL v58 = mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang(x1, v49); VAL x59; switch (get_data_tag(v58)) { case 1LL: { // Some @@ -27658,7 +20682,7 @@ static VAL mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang (uint64_t x1, VAL VAL v64; value_uncons(v61, &v63, &v64); decref(v63); - VAL v65 = mtw_mirth_type_StackType_STConsLabel(v64, v53, v54); + VAL v65 = mtw_mirth_type_StackType_STWithLabel(v64, v50, v51); VAL v66 = MKNIL; VAL v67 = mkcons(v66, v65); VAL v68 = mkcons(v67, v62); @@ -27666,7 +20690,7 @@ static VAL mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang (uint64_t x1, VAL x59 = v69; } break; case 0LL: { // None - decref(v53); + decref(v50); VAL v70 = MKI64(0LL /* None */); x59 = v70; } break; @@ -27674,74 +20698,28 @@ static VAL mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang (uint64_t x1, VAL do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x56 = x59; - } - x4 = x56; - } break; - case 8LL: { // STWithLabel - VAL v71; - VAL v72; - uint64_t v73; - mtp_mirth_type_StackType_STWithLabel(v3, &v71, &v72, &v73); - int64_t v74 = mw_mirth_label_Label_ZEqualZEqual(x1, v73); - VAL x75; - if (((bool)v74)) { - VAL v76 = MKNIL; - VAL v77 = mkcons(v76, v71); - VAL v78 = mkcons(v77, v72); - VAL v79 = mtw_std_maybe_Maybe_1_Some(v78); - x75 = v79; - } else { - VAL v80 = mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang(x1, v71); - VAL x81; - switch (get_data_tag(v80)) { - case 1LL: { // Some - VAL v82 = mtp_std_maybe_Maybe_1_Some(v80); - VAL v83; - VAL v84; - value_uncons(v82, &v83, &v84); - VAL v85; - VAL v86; - value_uncons(v83, &v85, &v86); - decref(v85); - VAL v87 = mtw_mirth_type_StackType_STWithLabel(v86, v72, v73); - VAL v88 = MKNIL; - VAL v89 = mkcons(v88, v87); - VAL v90 = mkcons(v89, v84); - VAL v91 = mtw_std_maybe_Maybe_1_Some(v90); - x81 = v91; - } break; - case 0LL: { // None - decref(v72); - VAL v92 = MKI64(0LL /* None */); - x81 = v92; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x75 = x81; + x53 = x59; } - x4 = x75; + x4 = x53; } break; case 4LL: { // STMeta - uint64_t v93 = mtp_mirth_type_StackType_STMeta(v3); - uint64_t v94 = mw_mirth_type_MetaVar_newZBang(); - VAL v95 = mtw_mirth_type_StackType_STMeta(v94); - uint64_t v96 = mw_mirth_type_MetaVar_newZBang(); - VAL v97 = mtw_mirth_type_Type_TMeta(v96); - incref(v95); - incref(v97); - VAL v98 = mtw_mirth_type_StackType_STWithLabel(v95, v97, x1); - VAL v99 = mw_mirth_type_StackType_ZToType(v98); - VAL v100 = mtw_std_maybe_Maybe_1_Some(v99); - void* v101 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v93); - mut_set(v100, v101); - VAL v102 = MKNIL; - VAL v103 = mkcons(v102, v95); - VAL v104 = mkcons(v103, v97); - VAL v105 = mtw_std_maybe_Maybe_1_Some(v104); - x4 = v105; + uint64_t v71 = mtp_mirth_type_StackType_STMeta(v3); + uint64_t v72 = mw_mirth_type_MetaVar_newZBang(); + VAL v73 = mtw_mirth_type_StackType_STMeta(v72); + uint64_t v74 = mw_mirth_type_MetaVar_newZBang(); + VAL v75 = mtw_mirth_type_Type_TMeta(v74); + incref(v73); + incref(v75); + VAL v76 = mtw_mirth_type_StackType_STWithLabel(v73, v75, x1); + VAL v77 = mw_mirth_type_StackType_ZToType(v76); + VAL v78 = mtw_std_maybe_Maybe_1_Some(v77); + void* v79 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v71); + mut_set(v78, v79); + VAL v80 = MKNIL; + VAL v81 = mkcons(v80, v73); + VAL v82 = mkcons(v81, v75); + VAL v83 = mtw_std_maybe_Maybe_1_Some(v82); + x4 = v83; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -27795,127 +20773,100 @@ static VAL mw_mirth_type_StackType_forceZ_consZAskZBang (VAL x1) { VAL v26; mtp_mirth_type_StackType_STWith(v2, &v25, &v26); VAL v27 = mw_mirth_type_StackType_forceZ_consZAskZBang(v25); - VAL x28; - VAL x29; - switch (get_data_tag(v27)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v27); - VAL v31; - VAL v32; - value_uncons(v30, &v31, &v32); - VAL v33; - VAL v34; - value_uncons(v31, &v33, &v34); - decref(v33); - incref(v26); - VAL v35 = mtw_mirth_type_StackType_STWith(v34, v26); - VAL v36 = MKNIL; - VAL v37 = mkcons(v36, v35); - VAL v38 = mkcons(v37, v32); - VAL v39 = mtw_std_maybe_Maybe_1_Some(v38); - x29 = v39; - x28 = v26; - } break; - case 0LL: { // None - VAL v40 = MKI64(0LL /* None */); - x29 = v40; - x28 = v26; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - decref(x28); - x3 = x29; + VAL v28; + VAL v29; + mw_std_maybe_Maybe_1_map_1_sp3(v26, v27, &v28, &v29); + decref(v28); + x3 = v29; } break; case 6LL: { // STConsLabel - VAL v41; - VAL v42; - uint64_t v43; - mtp_mirth_type_StackType_STConsLabel(v2, &v41, &v42, &v43); - VAL v44 = mw_mirth_type_StackType_forceZ_consZAskZBang(v41); - VAL x45; - switch (get_data_tag(v44)) { + VAL v30; + VAL v31; + uint64_t v32; + mtp_mirth_type_StackType_STConsLabel(v2, &v30, &v31, &v32); + VAL v33 = mw_mirth_type_StackType_forceZ_consZAskZBang(v30); + VAL x34; + switch (get_data_tag(v33)) { case 1LL: { // Some - VAL v46 = mtp_std_maybe_Maybe_1_Some(v44); - VAL v47; - VAL v48; - value_uncons(v46, &v47, &v48); - VAL v49; - VAL v50; - value_uncons(v47, &v49, &v50); - decref(v49); - VAL v51 = mtw_mirth_type_StackType_STConsLabel(v50, v42, v43); - VAL v52 = MKNIL; - VAL v53 = mkcons(v52, v51); - VAL v54 = mkcons(v53, v48); - VAL v55 = mtw_std_maybe_Maybe_1_Some(v54); - x45 = v55; + VAL v35 = mtp_std_maybe_Maybe_1_Some(v33); + VAL v36; + VAL v37; + value_uncons(v35, &v36, &v37); + VAL v38; + VAL v39; + value_uncons(v36, &v38, &v39); + decref(v38); + VAL v40 = mtw_mirth_type_StackType_STConsLabel(v39, v31, v32); + VAL v41 = MKNIL; + VAL v42 = mkcons(v41, v40); + VAL v43 = mkcons(v42, v37); + VAL v44 = mtw_std_maybe_Maybe_1_Some(v43); + x34 = v44; } break; case 0LL: { // None - decref(v42); - VAL v56 = MKI64(0LL /* None */); - x45 = v56; + decref(v31); + VAL v45 = MKI64(0LL /* None */); + x34 = v45; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x45; + x3 = x34; } break; case 8LL: { // STWithLabel - VAL v57; - VAL v58; - uint64_t v59; - mtp_mirth_type_StackType_STWithLabel(v2, &v57, &v58, &v59); - VAL v60 = mw_mirth_type_StackType_forceZ_consZAskZBang(v57); - VAL x61; - switch (get_data_tag(v60)) { + VAL v46; + VAL v47; + uint64_t v48; + mtp_mirth_type_StackType_STWithLabel(v2, &v46, &v47, &v48); + VAL v49 = mw_mirth_type_StackType_forceZ_consZAskZBang(v46); + VAL x50; + switch (get_data_tag(v49)) { case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v60); - VAL v63; - VAL v64; - value_uncons(v62, &v63, &v64); - VAL v65; - VAL v66; - value_uncons(v63, &v65, &v66); - decref(v65); - VAL v67 = mtw_mirth_type_StackType_STWithLabel(v66, v58, v59); - VAL v68 = MKNIL; - VAL v69 = mkcons(v68, v67); - VAL v70 = mkcons(v69, v64); - VAL v71 = mtw_std_maybe_Maybe_1_Some(v70); - x61 = v71; + VAL v51 = mtp_std_maybe_Maybe_1_Some(v49); + VAL v52; + VAL v53; + value_uncons(v51, &v52, &v53); + VAL v54; + VAL v55; + value_uncons(v52, &v54, &v55); + decref(v54); + VAL v56 = mtw_mirth_type_StackType_STWithLabel(v55, v47, v48); + VAL v57 = MKNIL; + VAL v58 = mkcons(v57, v56); + VAL v59 = mkcons(v58, v53); + VAL v60 = mtw_std_maybe_Maybe_1_Some(v59); + x50 = v60; } break; case 0LL: { // None - decref(v58); - VAL v72 = MKI64(0LL /* None */); - x61 = v72; + decref(v47); + VAL v61 = MKI64(0LL /* None */); + x50 = v61; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x61; + x3 = x50; } break; case 4LL: { // STMeta - uint64_t v73 = mtp_mirth_type_StackType_STMeta(v2); - uint64_t v74 = mw_mirth_type_MetaVar_newZBang(); - VAL v75 = mtw_mirth_type_StackType_STMeta(v74); - uint64_t v76 = mw_mirth_type_MetaVar_newZBang(); - VAL v77 = mtw_mirth_type_Type_TMeta(v76); - incref(v75); - incref(v77); - VAL v78 = mtw_mirth_type_StackType_STCons(v75, v77); - VAL v79 = mw_mirth_type_StackType_ZToType(v78); - VAL v80 = mtw_std_maybe_Maybe_1_Some(v79); - void* v81 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v73); - mut_set(v80, v81); - VAL v82 = MKNIL; - VAL v83 = mkcons(v82, v75); - VAL v84 = mkcons(v83, v77); - VAL v85 = mtw_std_maybe_Maybe_1_Some(v84); - x3 = v85; + uint64_t v62 = mtp_mirth_type_StackType_STMeta(v2); + uint64_t v63 = mw_mirth_type_MetaVar_newZBang(); + VAL v64 = mtw_mirth_type_StackType_STMeta(v63); + uint64_t v65 = mw_mirth_type_MetaVar_newZBang(); + VAL v66 = mtw_mirth_type_Type_TMeta(v65); + incref(v64); + incref(v66); + VAL v67 = mtw_mirth_type_StackType_STCons(v64, v66); + VAL v68 = mw_mirth_type_StackType_ZToType(v67); + VAL v69 = mtw_std_maybe_Maybe_1_Some(v68); + void* v70 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v62); + mut_set(v69, v70); + VAL v71 = MKNIL; + VAL v72 = mkcons(v71, v64); + VAL v73 = mkcons(v72, v66); + VAL v74 = mtw_std_maybe_Maybe_1_Some(v73); + x3 = v74; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -27969,127 +20920,100 @@ static VAL mw_mirth_type_StackType_forceZ_withZAskZBang (VAL x1) { VAL v26; mtp_mirth_type_StackType_STCons(v2, &v25, &v26); VAL v27 = mw_mirth_type_StackType_forceZ_withZAskZBang(v25); - VAL x28; - VAL x29; - switch (get_data_tag(v27)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v27); - VAL v31; - VAL v32; - value_uncons(v30, &v31, &v32); - VAL v33; - VAL v34; - value_uncons(v31, &v33, &v34); - decref(v33); - incref(v26); - VAL v35 = mtw_mirth_type_StackType_STCons(v34, v26); - VAL v36 = MKNIL; - VAL v37 = mkcons(v36, v35); - VAL v38 = mkcons(v37, v32); - VAL v39 = mtw_std_maybe_Maybe_1_Some(v38); - x29 = v39; - x28 = v26; - } break; - case 0LL: { // None - VAL v40 = MKI64(0LL /* None */); - x29 = v40; - x28 = v26; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - decref(x28); - x3 = x29; + VAL v28; + VAL v29; + mw_std_maybe_Maybe_1_map_1_sp4(v26, v27, &v28, &v29); + decref(v28); + x3 = v29; } break; case 6LL: { // STConsLabel - VAL v41; - VAL v42; - uint64_t v43; - mtp_mirth_type_StackType_STConsLabel(v2, &v41, &v42, &v43); - VAL v44 = mw_mirth_type_StackType_forceZ_withZAskZBang(v41); - VAL x45; - switch (get_data_tag(v44)) { + VAL v30; + VAL v31; + uint64_t v32; + mtp_mirth_type_StackType_STConsLabel(v2, &v30, &v31, &v32); + VAL v33 = mw_mirth_type_StackType_forceZ_withZAskZBang(v30); + VAL x34; + switch (get_data_tag(v33)) { case 1LL: { // Some - VAL v46 = mtp_std_maybe_Maybe_1_Some(v44); - VAL v47; - VAL v48; - value_uncons(v46, &v47, &v48); - VAL v49; - VAL v50; - value_uncons(v47, &v49, &v50); - decref(v49); - VAL v51 = mtw_mirth_type_StackType_STConsLabel(v50, v42, v43); - VAL v52 = MKNIL; - VAL v53 = mkcons(v52, v51); - VAL v54 = mkcons(v53, v48); - VAL v55 = mtw_std_maybe_Maybe_1_Some(v54); - x45 = v55; + VAL v35 = mtp_std_maybe_Maybe_1_Some(v33); + VAL v36; + VAL v37; + value_uncons(v35, &v36, &v37); + VAL v38; + VAL v39; + value_uncons(v36, &v38, &v39); + decref(v38); + VAL v40 = mtw_mirth_type_StackType_STConsLabel(v39, v31, v32); + VAL v41 = MKNIL; + VAL v42 = mkcons(v41, v40); + VAL v43 = mkcons(v42, v37); + VAL v44 = mtw_std_maybe_Maybe_1_Some(v43); + x34 = v44; } break; case 0LL: { // None - decref(v42); - VAL v56 = MKI64(0LL /* None */); - x45 = v56; + decref(v31); + VAL v45 = MKI64(0LL /* None */); + x34 = v45; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x45; + x3 = x34; } break; case 8LL: { // STWithLabel - VAL v57; - VAL v58; - uint64_t v59; - mtp_mirth_type_StackType_STWithLabel(v2, &v57, &v58, &v59); - VAL v60 = mw_mirth_type_StackType_forceZ_withZAskZBang(v57); - VAL x61; - switch (get_data_tag(v60)) { + VAL v46; + VAL v47; + uint64_t v48; + mtp_mirth_type_StackType_STWithLabel(v2, &v46, &v47, &v48); + VAL v49 = mw_mirth_type_StackType_forceZ_withZAskZBang(v46); + VAL x50; + switch (get_data_tag(v49)) { case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v60); - VAL v63; - VAL v64; - value_uncons(v62, &v63, &v64); - VAL v65; - VAL v66; - value_uncons(v63, &v65, &v66); - decref(v65); - VAL v67 = mtw_mirth_type_StackType_STWithLabel(v66, v58, v59); - VAL v68 = MKNIL; - VAL v69 = mkcons(v68, v67); - VAL v70 = mkcons(v69, v64); - VAL v71 = mtw_std_maybe_Maybe_1_Some(v70); - x61 = v71; + VAL v51 = mtp_std_maybe_Maybe_1_Some(v49); + VAL v52; + VAL v53; + value_uncons(v51, &v52, &v53); + VAL v54; + VAL v55; + value_uncons(v52, &v54, &v55); + decref(v54); + VAL v56 = mtw_mirth_type_StackType_STWithLabel(v55, v47, v48); + VAL v57 = MKNIL; + VAL v58 = mkcons(v57, v56); + VAL v59 = mkcons(v58, v53); + VAL v60 = mtw_std_maybe_Maybe_1_Some(v59); + x50 = v60; } break; case 0LL: { // None - decref(v58); - VAL v72 = MKI64(0LL /* None */); - x61 = v72; + decref(v47); + VAL v61 = MKI64(0LL /* None */); + x50 = v61; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x61; + x3 = x50; } break; case 4LL: { // STMeta - uint64_t v73 = mtp_mirth_type_StackType_STMeta(v2); - uint64_t v74 = mw_mirth_type_MetaVar_newZBang(); - VAL v75 = mtw_mirth_type_StackType_STMeta(v74); - uint64_t v76 = mw_mirth_type_MetaVar_newZBang(); - VAL v77 = mtw_mirth_type_Type_TMeta(v76); - incref(v75); - incref(v77); - VAL v78 = mtw_mirth_type_StackType_STWith(v75, v77); - VAL v79 = mw_mirth_type_StackType_ZToType(v78); - VAL v80 = mtw_std_maybe_Maybe_1_Some(v79); - void* v81 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v73); - mut_set(v80, v81); - VAL v82 = MKNIL; - VAL v83 = mkcons(v82, v75); - VAL v84 = mkcons(v83, v77); - VAL v85 = mtw_std_maybe_Maybe_1_Some(v84); - x3 = v85; + uint64_t v62 = mtp_mirth_type_StackType_STMeta(v2); + uint64_t v63 = mw_mirth_type_MetaVar_newZBang(); + VAL v64 = mtw_mirth_type_StackType_STMeta(v63); + uint64_t v65 = mw_mirth_type_MetaVar_newZBang(); + VAL v66 = mtw_mirth_type_Type_TMeta(v65); + incref(v64); + incref(v66); + VAL v67 = mtw_mirth_type_StackType_STWith(v64, v66); + VAL v68 = mw_mirth_type_StackType_ZToType(v67); + VAL v69 = mtw_std_maybe_Maybe_1_Some(v68); + void* v70 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v62); + mut_set(v69, v70); + VAL v71 = MKNIL; + VAL v72 = mkcons(v71, v64); + VAL v73 = mkcons(v72, v66); + VAL v74 = mtw_std_maybe_Maybe_1_Some(v73); + x3 = v74; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -28106,10 +21030,10 @@ static VAL mw_mirth_type_StackType_domZThen (VAL x1, VAL x2) { decref(v3); x5 = x1; } else { - VAL v6 = (mw_mirth_type_StackType_stackZThen(x1, v3)); + VAL v6 = mw_mirth_type_StackType_stackZThen(x1, v3); STR* v7; STRLIT(v7, " ", 1); - VAL v8 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6)); + VAL v8 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6); x5 = v8; } return x5; @@ -28125,8 +21049,8 @@ static VAL mw_mirth_type_StackType_codZThen (VAL x1, VAL x2) { } else { STR* v6; STRLIT(v6, " ", 1); - VAL v7 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), x1)); - VAL v8 = (mw_mirth_type_StackType_stackZThen(v7, v3)); + VAL v7 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), x1); + VAL v8 = mw_mirth_type_StackType_stackZThen(v7, v3); x5 = v8; } return x5; @@ -28144,8 +21068,8 @@ static void mw_mirth_type_StackType_baseZThen (VAL x1, VAL x2, VAL *x3, int64_t uint64_t v8 = mtp_mirth_type_StackType_STMeta(x2); STR* v9; STRLIT(v9, "*", 1); - VAL v10 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v9), x1)); - VAL v11 = (mw_mirth_type_MetaVar_typeZThen(v10, v8)); + VAL v10 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v9), x1); + VAL v11 = mw_mirth_type_MetaVar_typeZThen(v10, v8); int64_t v12 = 1LL /* True */; x6 = v12; x5 = v11; @@ -28154,31 +21078,28 @@ static void mw_mirth_type_StackType_baseZThen (VAL x1, VAL x2, VAL *x3, int64_t uint64_t v13 = mtp_mirth_type_StackType_STVar(x2); int64_t v14 = mw_mirth_var_Var_isZ_stackZAsk(v13); VAL x15; - uint64_t x16; if (((bool)v14)) { - x16 = v13; x15 = x1; } else { - STR* v17; - STRLIT(v17, "* ", 2); - VAL v18 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v17), x1)); - x16 = v13; - x15 = v18; + STR* v16; + STRLIT(v16, "* ", 2); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), x1); + x15 = v17; } - VAL v19 = (mw_mirth_var_Var_typeZThen(x15, x16)); - int64_t v20 = 1LL /* True */; - x6 = v20; - x5 = v19; + VAL v18 = mw_mirth_var_Var_typeZThen(x15, v13); + int64_t v19 = 1LL /* True */; + x6 = v19; + x5 = v18; } break; default: { - VAL v21 = mw_mirth_type_StackType_ZToType(x2); - STR* v22; - STRLIT(v22, "* ", 2); - VAL v23 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v22), x1)); - VAL v24 = (mw_mirth_type_Type_typeZThen(v21, v23)); - int64_t v25 = 1LL /* True */; - x6 = v25; - x5 = v24; + VAL v20 = mw_mirth_type_StackType_ZToType(x2); + STR* v21; + STRLIT(v21, "* ", 2); + VAL v22 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v21), x1); + VAL v23 = mw_mirth_type_Type_typeZThen(v20, v22); + int64_t v24 = 1LL /* True */; + x6 = v24; + x5 = v23; } break; } *x4 = x6; @@ -28193,349 +21114,202 @@ static VAL mw_mirth_type_StackType_stackZThen (VAL x1, VAL x2) { VAL v7; int64_t v8; mw_mirth_type_StackType_baseZThen(x1, v3, &v7, &v8); - VAL v9; - VAL v10; - mw_std_list_List_1_uncons(v4, &v9, &v10); - VAL x11; - int64_t x12; - VAL x13; - int64_t x14; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v15 = mtp_std_maybe_Maybe_1_Some(v9); - VAL x16; - VAL x17; - if (((bool)v8)) { - STR* v18; - STRLIT(v18, " ", 1); - VAL v19 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), v7)); - x17 = v15; - x16 = v19; - } else { - x17 = v15; - x16 = v7; - } - VAL v20; - VAL v21; - value_uncons(x17, &v20, &v21); - VAL v22; - VAL v23; - value_uncons(v20, &v22, &v23); - decref(v22); - VAL v24 = mw_mirth_label_Label_ZToStr(VU64(v21)); - VAL v25 = (mw_std_str_ZPlusStr_pushZ_strZBang(v24, x16)); - STR* v26; - STRLIT(v26, ":", 1); - VAL v27 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v26), v25)); - VAL x28; - switch (get_data_tag(v23)) { - case 0LL: { // Left - VAL v29 = mtp_std_either_Either_2_Left(v23); - VAL v30 = (mw_mirth_type_Type_typeZThen(v29, v27)); - x28 = v30; - } break; - case 1LL: { // Right - VAL v31 = mtp_std_either_Either_2_Right(v23); - VAL v32 = (mw_mirth_type_Resource_typeZThen(v27, v31)); - x28 = v32; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v33 = 1LL /* True */; - int64_t v34 = 1LL /* True */; - x14 = v34; - x13 = v10; - x12 = v33; - x11 = x28; - } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x14 = v35; - x13 = v10; - x12 = v8; - x11 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v36 = (x11); - int64_t v37 = x12; - VAL v38 = x13; - int64_t v39 = x14; - while (((bool)v39)) { - VAL v40 = (v36); - int64_t v41 = v37; - VAL v42 = v38; - VAL v43; - VAL v44; - mw_std_list_List_1_uncons(v42, &v43, &v44); - VAL x45; - int64_t x46; - VAL x47; - int64_t x48; - switch (get_data_tag(v43)) { - case 1LL: { // Some - VAL v49 = mtp_std_maybe_Maybe_1_Some(v43); - VAL x50; - VAL x51; - if (((bool)v41)) { - STR* v52; - STRLIT(v52, " ", 1); - VAL v53 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v52), v40)); - x51 = v49; - x50 = v53; + int64_t v9 = 1LL /* True */; + VAL v10 = v7; + int64_t v11 = v8; + VAL v12 = v4; + int64_t v13 = v9; + int64_t v14 = v9; + while (((bool)v14)) { + VAL v15 = v10; + int64_t v16 = v11; + VAL v17 = v12; + int64_t v18 = v13; + VAL x19; + int64_t x20; + VAL x21; + int64_t x22; + switch (get_data_tag(v17)) { + case 1LL: { // Cons + VAL v23; + VAL v24; + mtp_std_list_List_1_Cons(v17, &v23, &v24); + VAL x25; + if (((bool)v16)) { + STR* v26; + STRLIT(v26, " ", 1); + VAL v27 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v26), v15); + x25 = v27; } else { - x51 = v49; - x50 = v40; + x25 = v15; } - VAL v54; - VAL v55; - value_uncons(x51, &v54, &v55); - VAL v56; - VAL v57; - value_uncons(v54, &v56, &v57); - decref(v56); - VAL v58 = mw_mirth_label_Label_ZToStr(VU64(v55)); - VAL v59 = (mw_std_str_ZPlusStr_pushZ_strZBang(v58, x50)); - STR* v60; - STRLIT(v60, ":", 1); - VAL v61 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v60), v59)); - VAL x62; - switch (get_data_tag(v57)) { + VAL v28; + VAL v29; + value_uncons(v23, &v28, &v29); + VAL v30; + VAL v31; + value_uncons(v28, &v30, &v31); + decref(v30); + VAL v32 = mw_mirth_label_Label_ZToStr(VU64(v29)); + VAL v33 = mw_std_str_ZPlusStr_pushZ_strZBang(v32, x25); + STR* v34; + STRLIT(v34, ":", 1); + VAL v35 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v34), v33); + VAL x36; + switch (get_data_tag(v31)) { case 0LL: { // Left - VAL v63 = mtp_std_either_Either_2_Left(v57); - VAL v64 = (mw_mirth_type_Type_typeZThen(v63, v61)); - x62 = v64; + VAL v37 = mtp_std_either_Either_2_Left(v31); + VAL v38 = mw_mirth_type_Type_typeZThen(v37, v35); + x36 = v38; } break; case 1LL: { // Right - VAL v65 = mtp_std_either_Either_2_Right(v57); - VAL v66 = (mw_mirth_type_Resource_typeZThen(v61, v65)); - x62 = v66; + VAL v39 = mtp_std_either_Either_2_Right(v31); + VAL v40 = mw_mirth_type_Resource_typeZThen(v35, v39); + x36 = v40; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v67 = 1LL /* True */; - int64_t v68 = 1LL /* True */; - x48 = v68; - x47 = v44; - x46 = v67; - x45 = x62; + int64_t v41 = 1LL /* True */; + int64_t v42 = 1LL /* True */; + x22 = v42; + x21 = v24; + x20 = v41; + x19 = x36; } break; - case 0LL: { // None - int64_t v69 = 0LL /* False */; - x48 = v69; - x47 = v44; - x46 = v41; - x45 = v40; + case 0LL: { // Nil + VAL v43 = MKI64(0LL /* Nil */); + int64_t v44 = 0LL /* False */; + x22 = v44; + x21 = v43; + x20 = v16; + x19 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v39 = x48; - v38 = x47; - v37 = x46; - v36 = x45; - } - decref(v38); - VAL v70; - VAL v71; - mw_std_list_List_1_uncons(v5, &v70, &v71); - VAL x72; - int64_t x73; - VAL x74; - int64_t x75; - switch (get_data_tag(v70)) { - case 1LL: { // Some - VAL v76 = mtp_std_maybe_Maybe_1_Some(v70); - VAL x77; - VAL x78; - if (((bool)v37)) { - STR* v79; - STRLIT(v79, " ", 1); - VAL v80 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v79), v36)); - x78 = v76; - x77 = v80; - } else { - x78 = v76; - x77 = v36; - } - VAL v81 = (mw_mirth_type_Type_typeZThen(x78, x77)); - int64_t v82 = 1LL /* True */; - int64_t v83 = 1LL /* True */; - x75 = v83; - x74 = v71; - x73 = v82; - x72 = v81; - } break; - case 0LL: { // None - int64_t v84 = 0LL /* False */; - x75 = v84; - x74 = v71; - x73 = v37; - x72 = v36; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v14 = x22; + v13 = x22; + v12 = x21; + v11 = x20; + v10 = x19; } - VAL v85 = (x72); - int64_t v86 = x73; - VAL v87 = x74; - int64_t v88 = x75; - while (((bool)v88)) { - VAL v89 = (v85); - int64_t v90 = v86; - VAL v91 = v87; - VAL v92; - VAL v93; - mw_std_list_List_1_uncons(v91, &v92, &v93); - VAL x94; - int64_t x95; - VAL x96; - int64_t x97; - switch (get_data_tag(v92)) { - case 1LL: { // Some - VAL v98 = mtp_std_maybe_Maybe_1_Some(v92); - VAL x99; - VAL x100; - if (((bool)v90)) { - STR* v101; - STRLIT(v101, " ", 1); - VAL v102 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v101), v89)); - x100 = v98; - x99 = v102; + decref(v12); + int64_t v45 = 1LL /* True */; + VAL v46 = v10; + int64_t v47 = v11; + VAL v48 = v5; + int64_t v49 = v45; + int64_t v50 = v45; + while (((bool)v50)) { + VAL v51 = v46; + int64_t v52 = v47; + VAL v53 = v48; + int64_t v54 = v49; + VAL x55; + int64_t x56; + VAL x57; + int64_t x58; + switch (get_data_tag(v53)) { + case 1LL: { // Cons + VAL v59; + VAL v60; + mtp_std_list_List_1_Cons(v53, &v59, &v60); + VAL x61; + if (((bool)v52)) { + STR* v62; + STRLIT(v62, " ", 1); + VAL v63 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v62), v51); + x61 = v63; } else { - x100 = v98; - x99 = v89; + x61 = v51; } - VAL v103 = (mw_mirth_type_Type_typeZThen(x100, x99)); - int64_t v104 = 1LL /* True */; - int64_t v105 = 1LL /* True */; - x97 = v105; - x96 = v93; - x95 = v104; - x94 = v103; + VAL v64 = mw_mirth_type_Type_typeZThen(v59, x61); + int64_t v65 = 1LL /* True */; + int64_t v66 = 1LL /* True */; + x58 = v66; + x57 = v60; + x56 = v65; + x55 = v64; } break; - case 0LL: { // None - int64_t v106 = 0LL /* False */; - x97 = v106; - x96 = v93; - x95 = v90; - x94 = v89; + case 0LL: { // Nil + VAL v67 = MKI64(0LL /* Nil */); + int64_t v68 = 0LL /* False */; + x58 = v68; + x57 = v67; + x56 = v52; + x55 = v51; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v88 = x97; - v87 = x96; - v86 = x95; - v85 = x94; - } - decref(v87); - VAL v107; - VAL v108; - mw_std_list_List_1_uncons(v6, &v107, &v108); - VAL x109; - int64_t x110; - VAL x111; - int64_t x112; - switch (get_data_tag(v107)) { - case 1LL: { // Some - VAL v113 = mtp_std_maybe_Maybe_1_Some(v107); - VAL x114; - VAL x115; - if (((bool)v86)) { - STR* v116; - STRLIT(v116, " ", 1); - VAL v117 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v116), v85)); - x115 = v113; - x114 = v117; - } else { - x115 = v113; - x114 = v85; - } - VAL v118 = (mw_mirth_type_Resource_typeZThen(x114, x115)); - int64_t v119 = 1LL /* True */; - int64_t v120 = 1LL /* True */; - x112 = v120; - x111 = v108; - x110 = v119; - x109 = v118; - } break; - case 0LL: { // None - int64_t v121 = 0LL /* False */; - x112 = v121; - x111 = v108; - x110 = v86; - x109 = v85; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v50 = x58; + v49 = x58; + v48 = x57; + v47 = x56; + v46 = x55; } - VAL v122 = (x109); - int64_t v123 = x110; - VAL v124 = x111; - int64_t v125 = x112; - while (((bool)v125)) { - VAL v126 = (v122); - int64_t v127 = v123; - VAL v128 = v124; - VAL v129; - VAL v130; - mw_std_list_List_1_uncons(v128, &v129, &v130); - VAL x131; - int64_t x132; - VAL x133; - int64_t x134; - switch (get_data_tag(v129)) { - case 1LL: { // Some - VAL v135 = mtp_std_maybe_Maybe_1_Some(v129); - VAL x136; - VAL x137; - if (((bool)v127)) { - STR* v138; - STRLIT(v138, " ", 1); - VAL v139 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v138), v126)); - x137 = v135; - x136 = v139; + decref(v48); + int64_t v69 = 1LL /* True */; + VAL v70 = v46; + int64_t v71 = v47; + VAL v72 = v6; + int64_t v73 = v69; + int64_t v74 = v69; + while (((bool)v74)) { + VAL v75 = v70; + int64_t v76 = v71; + VAL v77 = v72; + int64_t v78 = v73; + VAL x79; + int64_t x80; + VAL x81; + int64_t x82; + switch (get_data_tag(v77)) { + case 1LL: { // Cons + VAL v83; + VAL v84; + mtp_std_list_List_1_Cons(v77, &v83, &v84); + VAL x85; + if (((bool)v76)) { + STR* v86; + STRLIT(v86, " ", 1); + VAL v87 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v86), v75); + x85 = v87; } else { - x137 = v135; - x136 = v126; + x85 = v75; } - VAL v140 = (mw_mirth_type_Resource_typeZThen(x136, x137)); - int64_t v141 = 1LL /* True */; - int64_t v142 = 1LL /* True */; - x134 = v142; - x133 = v130; - x132 = v141; - x131 = v140; + VAL v88 = mw_mirth_type_Resource_typeZThen(x85, v83); + int64_t v89 = 1LL /* True */; + int64_t v90 = 1LL /* True */; + x82 = v90; + x81 = v84; + x80 = v89; + x79 = v88; } break; - case 0LL: { // None - int64_t v143 = 0LL /* False */; - x134 = v143; - x133 = v130; - x132 = v127; - x131 = v126; + case 0LL: { // Nil + VAL v91 = MKI64(0LL /* Nil */); + int64_t v92 = 0LL /* False */; + x82 = v92; + x81 = v91; + x80 = v76; + x79 = v75; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v125 = x134; - v124 = x133; - v123 = x132; - v122 = x131; + v74 = x82; + v73 = x82; + v72 = x81; + v71 = x80; + v70 = x79; } - decref(v124); - return v122; + decref(v72); + return v70; } static void mw_mirth_type_StackType_semifreshen (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5 = mw_mirth_type_StackType_expand(x2); @@ -28596,13 +21370,7 @@ static void mw_mirth_type_StackType_semifreshen (VAL x1, VAL x2, VAL *x3, VAL *x default: { STR* v30; STRLIT(v30, "expected unit-based stack in semifreshen!", 41); - push_value(x1); - push_value(v5); do_panic(v30); - VAL v31 = pop_value(); - x7 = v31; - VAL v32 = pop_value(); - x6 = v32; } break; } *x4 = x7; @@ -28810,116 +21578,113 @@ static void mw_mirth_type_StackType_rigidifyZBang (VAL x1, VAL x2, VAL x3, VAL * VAL v14 = mw_mirth_type_MetaVar_typeZAsk(v13); VAL x15; VAL x16; - VAL x17; switch (get_data_tag(v14)) { case 0LL: { // None - VAL v18; - uint64_t v19; - mw_mirth_var_Ctx_freshZ_stackZ_typeZ_varZBang(x2, &v18, &v19); - VAL v20 = mtw_mirth_type_Type_TVar(v19); - incref(v20); - VAL v21 = mtw_std_maybe_Maybe_1_Some(v20); - void* v22 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v13); - mut_set(v21, v22); - x17 = v20; - x16 = v18; - x15 = x1; + VAL v17; + uint64_t v18; + mw_mirth_var_Ctx_freshZ_stackZ_typeZ_varZBang(x2, &v17, &v18); + VAL v19 = mtw_mirth_type_Type_TVar(v18); + incref(v19); + VAL v20 = mtw_std_maybe_Maybe_1_Some(v19); + void* v21 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v13); + mut_set(v20, v21); + x16 = v19; + x15 = v17; } break; case 1LL: { // Some - VAL v23 = mtp_std_maybe_Maybe_1_Some(v14); - x17 = v23; - x16 = x2; - x15 = x1; + VAL v22 = mtp_std_maybe_Maybe_1_Some(v14); + x16 = v22; + x15 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v24 = mw_mirth_type_Type_ZToStackType(x17); + VAL v23 = mw_mirth_type_Type_ZToStackType(x16); + VAL v24; VAL v25; VAL v26; - VAL v27; - mw_mirth_type_StackType_rigidifyZBang(x15, x16, v24, &v25, &v26, &v27); - x9 = v27; - x8 = v26; - x7 = v25; + mw_mirth_type_StackType_rigidifyZBang(x1, x15, v23, &v24, &v25, &v26); + x9 = v26; + x8 = v25; + x7 = v24; } break; case 3LL: { // STVar - uint64_t v28 = mtp_mirth_type_StackType_STVar(x3); - VAL v29 = mtw_mirth_type_StackType_STVar(v28); - x9 = v29; + uint64_t v27 = mtp_mirth_type_StackType_STVar(x3); + VAL v28 = mtw_mirth_type_StackType_STVar(v27); + x9 = v28; x8 = x2; x7 = x1; } break; case 5LL: { // STCons + VAL v29; VAL v30; + mtp_mirth_type_StackType_STCons(x3, &v29, &v30); VAL v31; - mtp_mirth_type_StackType_STCons(x3, &v30, &v31); VAL v32; VAL v33; + mw_mirth_type_StackType_rigidifyZBang(x1, x2, v29, &v31, &v32, &v33); VAL v34; - mw_mirth_type_StackType_rigidifyZBang(x1, x2, v30, &v32, &v33, &v34); VAL v35; VAL v36; - VAL v37; - mw_mirth_type_Type_rigidifyZBang(v32, v33, v31, &v35, &v36, &v37); - VAL v38 = mtw_mirth_type_StackType_STCons(v34, v37); - x9 = v38; - x8 = v36; - x7 = v35; + mw_mirth_type_Type_rigidifyZBang(v31, v32, v30, &v34, &v35, &v36); + VAL v37 = mtw_mirth_type_StackType_STCons(v33, v36); + x9 = v37; + x8 = v35; + x7 = v34; } break; case 6LL: { // STConsLabel + VAL v38; VAL v39; - VAL v40; - uint64_t v41; - mtp_mirth_type_StackType_STConsLabel(x3, &v39, &v40, &v41); + uint64_t v40; + mtp_mirth_type_StackType_STConsLabel(x3, &v38, &v39, &v40); + VAL v41; VAL v42; VAL v43; + mw_mirth_type_StackType_rigidifyZBang(x1, x2, v38, &v41, &v42, &v43); VAL v44; - mw_mirth_type_StackType_rigidifyZBang(x1, x2, v39, &v42, &v43, &v44); VAL v45; VAL v46; - VAL v47; - mw_mirth_type_Type_rigidifyZBang(v42, v43, v40, &v45, &v46, &v47); - VAL v48 = mtw_mirth_type_StackType_STConsLabel(v44, v47, v41); - x9 = v48; - x8 = v46; - x7 = v45; + mw_mirth_type_Type_rigidifyZBang(v41, v42, v39, &v44, &v45, &v46); + VAL v47 = mtw_mirth_type_StackType_STConsLabel(v43, v46, v40); + x9 = v47; + x8 = v45; + x7 = v44; } break; case 7LL: { // STWith + VAL v48; VAL v49; + mtp_mirth_type_StackType_STWith(x3, &v48, &v49); VAL v50; - mtp_mirth_type_StackType_STWith(x3, &v49, &v50); VAL v51; VAL v52; + mw_mirth_type_StackType_rigidifyZBang(x1, x2, v48, &v50, &v51, &v52); VAL v53; - mw_mirth_type_StackType_rigidifyZBang(x1, x2, v49, &v51, &v52, &v53); VAL v54; VAL v55; - VAL v56; - mw_mirth_type_Resource_rigidifyZBang(v51, v52, v50, &v54, &v55, &v56); - VAL v57 = mtw_mirth_type_StackType_STWith(v53, v56); - x9 = v57; - x8 = v55; - x7 = v54; + mw_mirth_type_Resource_rigidifyZBang(v50, v51, v49, &v53, &v54, &v55); + VAL v56 = mtw_mirth_type_StackType_STWith(v52, v55); + x9 = v56; + x8 = v54; + x7 = v53; } break; case 8LL: { // STWithLabel + VAL v57; VAL v58; - VAL v59; - uint64_t v60; - mtp_mirth_type_StackType_STWithLabel(x3, &v58, &v59, &v60); + uint64_t v59; + mtp_mirth_type_StackType_STWithLabel(x3, &v57, &v58, &v59); + VAL v60; VAL v61; VAL v62; + mw_mirth_type_StackType_rigidifyZBang(x1, x2, v57, &v60, &v61, &v62); VAL v63; - mw_mirth_type_StackType_rigidifyZBang(x1, x2, v58, &v61, &v62, &v63); VAL v64; VAL v65; - VAL v66; - mw_mirth_type_Resource_rigidifyZBang(v61, v62, v59, &v64, &v65, &v66); - VAL v67 = mtw_mirth_type_StackType_STWithLabel(v63, v66, v60); - x9 = v67; - x8 = v65; - x7 = v64; + mw_mirth_type_Resource_rigidifyZBang(v60, v61, v58, &v63, &v64, &v65); + VAL v66 = mtw_mirth_type_StackType_STWithLabel(v62, v65, v59); + x9 = v66; + x8 = v64; + x7 = v63; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -28929,6 +21694,202 @@ static void mw_mirth_type_StackType_rigidifyZBang (VAL x1, VAL x2, VAL x3, VAL * *x5 = x8; *x4 = x7; } +static VAL mw_mirth_type_StackType_linearZ_baseZ_metaZAsk (VAL x1) { + VAL x2; + switch (get_data_tag(x1)) { + case 0LL: { // STACK_TYPE_ERROR + VAL v3 = MKI64(0LL /* None */); + x2 = v3; + } break; + case 1LL: { // STACK_TYPE_DONT_CARE + VAL v4 = MKI64(0LL /* None */); + x2 = v4; + } break; + case 2LL: { // STACK_TYPE_UNIT + VAL v5 = MKI64(0LL /* None */); + x2 = v5; + } break; + case 4LL: { // STMeta + uint64_t v6 = mtp_mirth_type_StackType_STMeta(x1); + VAL v7 = mw_mirth_type_MetaVar_typeZAsk(v6); + VAL x8; + switch (get_data_tag(v7)) { + case 0LL: { // None + VAL v9 = mtw_std_maybe_Maybe_1_Some(MKU64(v6)); + x8 = v9; + } break; + case 1LL: { // Some + VAL v10 = mtp_std_maybe_Maybe_1_Some(v7); + VAL v11 = mw_mirth_type_Type_expand(v10); + incref(v11); + VAL v12 = mtw_std_maybe_Maybe_1_Some(v11); + void* v13 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v6); + mut_set(v12, v13); + VAL v14 = mw_mirth_type_Type_ZToStackType(v11); + VAL v15 = mw_mirth_type_StackType_linearZ_baseZ_metaZAsk(v14); + x8 = v15; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + x2 = x8; + } break; + case 3LL: { // STVar + uint64_t v16 = mtp_mirth_type_StackType_STVar(x1); + VAL v17 = MKI64(0LL /* None */); + x2 = v17; + } break; + case 5LL: { // STCons + VAL v18; + VAL v19; + mtp_mirth_type_StackType_STCons(x1, &v18, &v19); + VAL v20 = mw_mirth_type_StackType_linearZ_baseZ_metaZAsk(v18); + VAL v21; + VAL v22; + mw_std_maybe_Maybe_1_filter_1_sp3(v19, v20, &v21, &v22); + decref(v21); + x2 = v22; + } break; + case 7LL: { // STWith + VAL v23; + VAL v24; + mtp_mirth_type_StackType_STWith(x1, &v23, &v24); + VAL v25 = mw_mirth_type_StackType_linearZ_baseZ_metaZAsk(v23); + VAL v26; + VAL v27; + mw_std_maybe_Maybe_1_filter_1_sp4(v24, v25, &v26, &v27); + decref(v26); + x2 = v27; + } break; + case 6LL: { // STConsLabel + VAL v28; + VAL v29; + uint64_t v30; + mtp_mirth_type_StackType_STConsLabel(x1, &v28, &v29, &v30); + VAL v31 = mw_mirth_type_StackType_linearZ_baseZ_metaZAsk(v28); + VAL v32; + VAL v33; + mw_std_maybe_Maybe_1_filter_1_sp3(v29, v31, &v32, &v33); + decref(v32); + x2 = v33; + } break; + case 8LL: { // STWithLabel + VAL v34; + VAL v35; + uint64_t v36; + mtp_mirth_type_StackType_STWithLabel(x1, &v34, &v35, &v36); + VAL v37 = mw_mirth_type_StackType_linearZ_baseZ_metaZAsk(v34); + VAL v38; + VAL v39; + mw_std_maybe_Maybe_1_filter_1_sp4(v35, v37, &v38, &v39); + decref(v38); + x2 = v39; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x2; +} +static VAL mw_mirth_type_StackType_linearZ_baseZ_varZAsk (VAL x1) { + VAL x2; + switch (get_data_tag(x1)) { + case 0LL: { // STACK_TYPE_ERROR + VAL v3 = MKI64(0LL /* None */); + x2 = v3; + } break; + case 1LL: { // STACK_TYPE_DONT_CARE + VAL v4 = MKI64(0LL /* None */); + x2 = v4; + } break; + case 2LL: { // STACK_TYPE_UNIT + VAL v5 = MKI64(0LL /* None */); + x2 = v5; + } break; + case 4LL: { // STMeta + uint64_t v6 = mtp_mirth_type_StackType_STMeta(x1); + VAL v7 = mw_mirth_type_MetaVar_typeZAsk(v6); + VAL x8; + switch (get_data_tag(v7)) { + case 0LL: { // None + VAL v9 = MKI64(0LL /* None */); + x8 = v9; + } break; + case 1LL: { // Some + VAL v10 = mtp_std_maybe_Maybe_1_Some(v7); + VAL v11 = mw_mirth_type_Type_expand(v10); + incref(v11); + VAL v12 = mtw_std_maybe_Maybe_1_Some(v11); + void* v13 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v6); + mut_set(v12, v13); + VAL v14 = mw_mirth_type_Type_ZToStackType(v11); + VAL v15 = mw_mirth_type_StackType_linearZ_baseZ_varZAsk(v14); + x8 = v15; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + x2 = x8; + } break; + case 3LL: { // STVar + uint64_t v16 = mtp_mirth_type_StackType_STVar(x1); + VAL v17 = mtw_std_maybe_Maybe_1_Some(MKU64(v16)); + x2 = v17; + } break; + case 5LL: { // STCons + VAL v18; + VAL v19; + mtp_mirth_type_StackType_STCons(x1, &v18, &v19); + VAL v20 = mw_mirth_type_StackType_linearZ_baseZ_varZAsk(v18); + VAL v21; + VAL v22; + mw_std_maybe_Maybe_1_filter_1_sp1(v19, v20, &v21, &v22); + decref(v21); + x2 = v22; + } break; + case 7LL: { // STWith + VAL v23; + VAL v24; + mtp_mirth_type_StackType_STWith(x1, &v23, &v24); + VAL v25 = mw_mirth_type_StackType_linearZ_baseZ_varZAsk(v23); + VAL v26; + VAL v27; + mw_std_maybe_Maybe_1_filter_1_sp2(v24, v25, &v26, &v27); + decref(v26); + x2 = v27; + } break; + case 6LL: { // STConsLabel + VAL v28; + VAL v29; + uint64_t v30; + mtp_mirth_type_StackType_STConsLabel(x1, &v28, &v29, &v30); + VAL v31 = mw_mirth_type_StackType_linearZ_baseZ_varZAsk(v28); + VAL v32; + VAL v33; + mw_std_maybe_Maybe_1_filter_1_sp1(v29, v31, &v32, &v33); + decref(v32); + x2 = v33; + } break; + case 8LL: { // STWithLabel + VAL v34; + VAL v35; + uint64_t v36; + mtp_mirth_type_StackType_STWithLabel(x1, &v34, &v35, &v36); + VAL v37 = mw_mirth_type_StackType_linearZ_baseZ_varZAsk(v34); + VAL v38; + VAL v39; + mw_std_maybe_Maybe_1_filter_1_sp2(v35, v37, &v38, &v39); + decref(v38); + x2 = v39; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x2; +} static VAL mw_mirth_type_ArrowType_ZToType (VAL x1) { VAL v2 = mtw_mirth_type_Type_TMorphism(x1); return v2; @@ -29014,15 +21975,31 @@ static int64_t mw_mirth_type_ArrowType_hasZ_metaZAsk (uint64_t x1, VAL x2) { } return x6; } +static int64_t mw_mirth_type_ArrowType_hasZ_varZAsk (uint64_t x1, VAL x2) { + VAL v3; + VAL v4; + mw_mirth_type_ArrowType_unpack(x2, &v3, &v4); + int64_t v5 = mw_mirth_type_StackType_hasZ_varZAsk(x1, v4); + int64_t x6; + if (((bool)v5)) { + decref(v3); + int64_t v7 = 1LL /* True */; + x6 = v7; + } else { + int64_t v8 = mw_mirth_type_StackType_hasZ_varZAsk(x1, v3); + x6 = v8; + } + return x6; +} static VAL mw_mirth_type_ArrowType_sigZThen (VAL x1, VAL x2) { VAL v3; VAL v4; mw_mirth_type_ArrowType_unpack(x2, &v3, &v4); - VAL v5 = (mw_mirth_type_StackType_domZThen(x1, v3)); + VAL v5 = mw_mirth_type_StackType_domZThen(x1, v3); STR* v6; STRLIT(v6, "--", 2); - VAL v7 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), v5)); - VAL v8 = (mw_mirth_type_StackType_codZThen(v7, v4)); + VAL v7 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), v5); + VAL v8 = mw_mirth_type_StackType_codZThen(v7, v4); return v8; } static VAL mw_mirth_type_ArrowType_semifreshenZ_sig (VAL x1) { @@ -29143,13 +22120,51 @@ static void mw_mirth_type_ArrowType_rigidifyZBang (VAL x1, VAL x2, VAL x3, VAL * *x4 = v12; } static void mw_mirth_type_ArrowType_rigidifyZ_sigZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { + incref(x3); VAL v7; VAL v8; - VAL v9; - mw_mirth_type_ArrowType_rigidifyZBang(x1, x2, x3, &v7, &v8, &v9); - *x6 = v9; - *x5 = v8; - *x4 = v7; + mw_mirth_type_ArrowType_unpack(x3, &v7, &v8); + VAL v9 = mw_mirth_type_StackType_linearZ_baseZ_metaZAsk(v8); + switch (get_data_tag(v9)) { + case 1LL: { // Some + VAL v10 = mtp_std_maybe_Maybe_1_Some(v9); + VAL v11 = mw_mirth_type_StackType_linearZ_baseZ_metaZAsk(v7); + switch (get_data_tag(v11)) { + case 1LL: { // Some + VAL v12 = mtp_std_maybe_Maybe_1_Some(v11); + incref(v10); + int64_t v13 = mw_mirth_type_MetaVar_ZEqualZEqual(VU64(v12), VU64(v10)); + if (((bool)v13)) { + VAL v14 = mw_mirth_type_TYPEz_UNIT(); + VAL v15 = mtw_std_maybe_Maybe_1_Some(v14); + void* v16 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(VU64(v10)); + mut_set(v15, v16); + } else { + decref(v10); + } + } break; + case 0LL: { // None + decref(v10); + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + } break; + case 0LL: { // None + decref(v7); + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + VAL v17; + VAL v18; + VAL v19; + mw_mirth_type_ArrowType_rigidifyZBang(x1, x2, x3, &v17, &v18, &v19); + *x6 = v19; + *x5 = v18; + *x4 = v17; } static VAL mw_mirth_type_Subst_nil (void) { VAL v1 = MKI64(0LL /* SUBST_NIL */); @@ -29172,17 +22187,19 @@ static int64_t mw_mirth_type_Subst_hasZ_varZAsk (uint64_t x1, VAL x2) { uint64_t v7; mtp_mirth_type_Subst_SUBSTz_CON(x2, &v5, &v6, &v7); decref(v6); - int64_t v8 = mw_mirth_var_Var_ZEqualZEqual(v7, x1); - int64_t x9; - if (((bool)v8)) { + int64_t v8 = mw_mirth_var_Var_index(v7); + int64_t v9 = mw_mirth_var_Var_index(x1); + bool v10 = (v8 == v9); + int64_t x11; + if (v10) { decref(v5); - int64_t v10 = 1LL /* True */; - x9 = v10; + int64_t v12 = 1LL /* True */; + x11 = v12; } else { - int64_t v11 = mw_mirth_type_Subst_hasZ_varZAsk(x1, v5); - x9 = v11; + int64_t v13 = mw_mirth_type_Subst_hasZ_varZAsk(x1, v5); + x11 = v13; } - x3 = x9; + x3 = x11; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -29202,17 +22219,19 @@ static VAL mw_mirth_type_Subst_getZ_var (uint64_t x1, VAL x2) { VAL v6; uint64_t v7; mtp_mirth_type_Subst_SUBSTz_CON(x2, &v5, &v6, &v7); - int64_t v8 = mw_mirth_var_Var_ZEqualZEqual(v7, x1); - VAL x9; - if (((bool)v8)) { + int64_t v8 = mw_mirth_var_Var_index(v7); + int64_t v9 = mw_mirth_var_Var_index(x1); + bool v10 = (v8 == v9); + VAL x11; + if (v10) { decref(v5); - x9 = v6; + x11 = v6; } else { decref(v6); - VAL v10 = mw_mirth_type_Subst_getZ_var(x1, v5); - x9 = v10; + VAL v12 = mw_mirth_type_Subst_getZ_var(x1, v5); + x11 = v12; } - x3 = x9; + x3 = x11; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -29220,6 +22239,21 @@ static VAL mw_mirth_type_Subst_getZ_var (uint64_t x1, VAL x2) { } return x3; } +static int64_t mw_mirth_type_StackTypeBase_unitZAsk (VAL x1) { + int64_t x2; + switch (get_data_tag(x1)) { + case 2LL: { // STB_UNIT + int64_t v3 = 1LL /* True */; + x2 = v3; + } break; + default: { + decref(x1); + int64_t v4 = 0LL /* False */; + x2 = v4; + } break; + } + return x2; +} static VAL mw_mirth_type_StackTypePart_cons (VAL x1, VAL x2) { VAL x3; switch (get_data_tag(x2)) { @@ -29255,404 +22289,163 @@ static VAL mw_mirth_type_StackTypePart_cons (VAL x1, VAL x2) { } static void mw_mirth_type_StackType_splitZ_parts (VAL x1, VAL *x2, VAL *x3) { VAL v4 = MKI64(0LL /* Nil */); - VAL x5; - VAL x6; - switch (get_data_tag(x1)) { - case 0LL: { // STACK_TYPE_ERROR - VAL v7 = MKI64(0LL /* STB_ERROR */); - VAL v8 = mtw_std_either_Either_2_Left(v7); - x6 = v8; - x5 = v4; - } break; - case 1LL: { // STACK_TYPE_DONT_CARE - VAL v9 = MKI64(1LL /* STB_DONT_CARE */); - VAL v10 = mtw_std_either_Either_2_Left(v9); - x6 = v10; - x5 = v4; - } break; - case 2LL: { // STACK_TYPE_UNIT - VAL v11 = MKI64(2LL /* STB_UNIT */); - VAL v12 = mtw_std_either_Either_2_Left(v11); - x6 = v12; - x5 = v4; - } break; - case 3LL: { // STVar - uint64_t v13 = mtp_mirth_type_StackType_STVar(x1); - VAL v14 = mtw_mirth_type_StackTypeBase_STBVar(v13); - VAL v15 = mtw_std_either_Either_2_Left(v14); - x6 = v15; - x5 = v4; - } break; - case 4LL: { // STMeta - uint64_t v16 = mtp_mirth_type_StackType_STMeta(x1); - VAL v17 = mw_mirth_type_MetaVar_typeZAsk(v16); - VAL x18; - VAL x19; - switch (get_data_tag(v17)) { - case 0LL: { // None - VAL v20 = mtw_mirth_type_StackTypeBase_STBMeta(v16); - VAL v21 = mtw_std_either_Either_2_Left(v20); - x19 = v21; - x18 = v4; - } break; - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v17); - VAL v23 = mw_mirth_type_Type_expand(v22); - incref(v23); - VAL v24 = mtw_std_maybe_Maybe_1_Some(v23); - void* v25 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v16); - mut_set(v24, v25); - VAL v26 = mw_mirth_type_Type_ZToStackType(v23); - VAL v27 = mtw_std_either_Either_2_Right(v26); - x19 = v27; - x18 = v4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x6 = x19; - x5 = x18; - } break; - case 5LL: { // STCons - VAL v28; - VAL v29; - mtp_mirth_type_StackType_STCons(x1, &v28, &v29); - VAL v30 = mtw_mirth_type_StackTypePart_STPCons(v29); - VAL v31 = mtw_std_list_List_1_Cons(v30, v4); - VAL v32 = mtw_std_either_Either_2_Right(v28); - x6 = v32; - x5 = v31; - } break; - case 6LL: { // STConsLabel - VAL v33; - VAL v34; - uint64_t v35; - mtp_mirth_type_StackType_STConsLabel(x1, &v33, &v34, &v35); - VAL v36 = mtw_mirth_type_StackTypePart_STPConsLabel(v34, v35); - VAL v37 = mtw_std_list_List_1_Cons(v36, v4); - VAL v38 = mtw_std_either_Either_2_Right(v33); - x6 = v38; - x5 = v37; - } break; - case 7LL: { // STWith - VAL v39; - VAL v40; - mtp_mirth_type_StackType_STWith(x1, &v39, &v40); - VAL v41 = mtw_mirth_type_StackTypePart_STPWith(v40); - VAL v42 = mtw_std_list_List_1_Cons(v41, v4); - VAL v43 = mtw_std_either_Either_2_Right(v39); - x6 = v43; - x5 = v42; - } break; - case 8LL: { // STWithLabel - VAL v44; - VAL v45; - uint64_t v46; - mtp_mirth_type_StackType_STWithLabel(x1, &v44, &v45, &v46); - VAL v47 = mtw_mirth_type_StackTypePart_STPWithLabel(v45, v46); - VAL v48 = mtw_std_list_List_1_Cons(v47, v4); - VAL v49 = mtw_std_either_Either_2_Right(v44); - x6 = v49; - x5 = v48; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - incref(x6); - VAL v50 = mw_std_either_Either_2_rightZAsk(x6); - VAL x51; - VAL x52; - int64_t x53; - switch (get_data_tag(v50)) { - case 1LL: { // Some - VAL v54 = mtp_std_maybe_Maybe_1_Some(v50); - decref(x6); - VAL x55; - VAL x56; - switch (get_data_tag(v54)) { - case 0LL: { // STACK_TYPE_ERROR - VAL v57 = MKI64(0LL /* STB_ERROR */); - VAL v58 = mtw_std_either_Either_2_Left(v57); - x56 = v58; - x55 = x5; - } break; - case 1LL: { // STACK_TYPE_DONT_CARE - VAL v59 = MKI64(1LL /* STB_DONT_CARE */); - VAL v60 = mtw_std_either_Either_2_Left(v59); - x56 = v60; - x55 = x5; - } break; - case 2LL: { // STACK_TYPE_UNIT - VAL v61 = MKI64(2LL /* STB_UNIT */); - VAL v62 = mtw_std_either_Either_2_Left(v61); - x56 = v62; - x55 = x5; - } break; - case 3LL: { // STVar - uint64_t v63 = mtp_mirth_type_StackType_STVar(v54); - VAL v64 = mtw_mirth_type_StackTypeBase_STBVar(v63); - VAL v65 = mtw_std_either_Either_2_Left(v64); - x56 = v65; - x55 = x5; - } break; - case 4LL: { // STMeta - uint64_t v66 = mtp_mirth_type_StackType_STMeta(v54); - VAL v67 = mw_mirth_type_MetaVar_typeZAsk(v66); - VAL x68; - VAL x69; - switch (get_data_tag(v67)) { - case 0LL: { // None - VAL v70 = mtw_mirth_type_StackTypeBase_STBMeta(v66); - VAL v71 = mtw_std_either_Either_2_Left(v70); - x69 = v71; - x68 = x5; - } break; - case 1LL: { // Some - VAL v72 = mtp_std_maybe_Maybe_1_Some(v67); - VAL v73 = mw_mirth_type_Type_expand(v72); - incref(v73); - VAL v74 = mtw_std_maybe_Maybe_1_Some(v73); - void* v75 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v66); - mut_set(v74, v75); - VAL v76 = mw_mirth_type_Type_ZToStackType(v73); - VAL v77 = mtw_std_either_Either_2_Right(v76); - x69 = v77; - x68 = x5; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x56 = x69; - x55 = x68; - } break; - case 5LL: { // STCons - VAL v78; - VAL v79; - mtp_mirth_type_StackType_STCons(v54, &v78, &v79); - VAL v80 = mtw_mirth_type_StackTypePart_STPCons(v79); - VAL v81 = mtw_std_list_List_1_Cons(v80, x5); - VAL v82 = mtw_std_either_Either_2_Right(v78); - x56 = v82; - x55 = v81; - } break; - case 6LL: { // STConsLabel - VAL v83; - VAL v84; - uint64_t v85; - mtp_mirth_type_StackType_STConsLabel(v54, &v83, &v84, &v85); - VAL v86 = mtw_mirth_type_StackTypePart_STPConsLabel(v84, v85); - VAL v87 = mtw_std_list_List_1_Cons(v86, x5); - VAL v88 = mtw_std_either_Either_2_Right(v83); - x56 = v88; - x55 = v87; - } break; - case 7LL: { // STWith - VAL v89; - VAL v90; - mtp_mirth_type_StackType_STWith(v54, &v89, &v90); - VAL v91 = mtw_mirth_type_StackTypePart_STPWith(v90); - VAL v92 = mtw_std_list_List_1_Cons(v91, x5); - VAL v93 = mtw_std_either_Either_2_Right(v89); - x56 = v93; - x55 = v92; - } break; - case 8LL: { // STWithLabel - VAL v94; - VAL v95; - uint64_t v96; - mtp_mirth_type_StackType_STWithLabel(v54, &v94, &v95, &v96); - VAL v97 = mtw_mirth_type_StackTypePart_STPWithLabel(v95, v96); - VAL v98 = mtw_std_list_List_1_Cons(v97, x5); - VAL v99 = mtw_std_either_Either_2_Right(v94); - x56 = v99; - x55 = v98; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v100 = 1LL /* True */; - x53 = v100; - x52 = x56; - x51 = x55; - } break; - case 0LL: { // None - int64_t v101 = 0LL /* False */; - x53 = v101; - x52 = x6; - x51 = x5; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v102 = x51; - VAL v103 = x52; - int64_t v104 = x53; - while (((bool)v104)) { - VAL v105 = v102; - VAL v106 = v103; - incref(v106); - VAL v107 = mw_std_either_Either_2_rightZAsk(v106); - VAL x108; - VAL x109; - int64_t x110; - switch (get_data_tag(v107)) { + VAL v5 = mtw_std_either_Either_2_Right(x1); + int64_t v6 = 1LL /* True */; + VAL v7 = v4; + VAL v8 = v5; + int64_t v9 = v6; + int64_t v10 = v6; + while (((bool)v10)) { + VAL v11 = v7; + VAL v12 = v8; + int64_t v13 = v9; + incref(v12); + VAL v14 = mw_std_either_Either_2_rightZAsk(v12); + VAL x15; + VAL x16; + int64_t x17; + switch (get_data_tag(v14)) { case 1LL: { // Some - VAL v111 = mtp_std_maybe_Maybe_1_Some(v107); - decref(v106); - VAL x112; - VAL x113; - switch (get_data_tag(v111)) { + VAL v18 = mtp_std_maybe_Maybe_1_Some(v14); + decref(v12); + VAL x19; + VAL x20; + switch (get_data_tag(v18)) { case 0LL: { // STACK_TYPE_ERROR - VAL v114 = MKI64(0LL /* STB_ERROR */); - VAL v115 = mtw_std_either_Either_2_Left(v114); - x113 = v115; - x112 = v105; + VAL v21 = MKI64(0LL /* STB_ERROR */); + VAL v22 = mtw_std_either_Either_2_Left(v21); + x20 = v22; + x19 = v11; } break; case 1LL: { // STACK_TYPE_DONT_CARE - VAL v116 = MKI64(1LL /* STB_DONT_CARE */); - VAL v117 = mtw_std_either_Either_2_Left(v116); - x113 = v117; - x112 = v105; + VAL v23 = MKI64(1LL /* STB_DONT_CARE */); + VAL v24 = mtw_std_either_Either_2_Left(v23); + x20 = v24; + x19 = v11; } break; case 2LL: { // STACK_TYPE_UNIT - VAL v118 = MKI64(2LL /* STB_UNIT */); - VAL v119 = mtw_std_either_Either_2_Left(v118); - x113 = v119; - x112 = v105; + VAL v25 = MKI64(2LL /* STB_UNIT */); + VAL v26 = mtw_std_either_Either_2_Left(v25); + x20 = v26; + x19 = v11; } break; case 3LL: { // STVar - uint64_t v120 = mtp_mirth_type_StackType_STVar(v111); - VAL v121 = mtw_mirth_type_StackTypeBase_STBVar(v120); - VAL v122 = mtw_std_either_Either_2_Left(v121); - x113 = v122; - x112 = v105; + uint64_t v27 = mtp_mirth_type_StackType_STVar(v18); + VAL v28 = mtw_mirth_type_StackTypeBase_STBVar(v27); + VAL v29 = mtw_std_either_Either_2_Left(v28); + x20 = v29; + x19 = v11; } break; case 4LL: { // STMeta - uint64_t v123 = mtp_mirth_type_StackType_STMeta(v111); - VAL v124 = mw_mirth_type_MetaVar_typeZAsk(v123); - VAL x125; - VAL x126; - switch (get_data_tag(v124)) { + uint64_t v30 = mtp_mirth_type_StackType_STMeta(v18); + VAL v31 = mw_mirth_type_MetaVar_typeZAsk(v30); + VAL x32; + switch (get_data_tag(v31)) { case 0LL: { // None - VAL v127 = mtw_mirth_type_StackTypeBase_STBMeta(v123); - VAL v128 = mtw_std_either_Either_2_Left(v127); - x126 = v128; - x125 = v105; + VAL v33 = mtw_mirth_type_StackTypeBase_STBMeta(v30); + VAL v34 = mtw_std_either_Either_2_Left(v33); + x32 = v34; } break; case 1LL: { // Some - VAL v129 = mtp_std_maybe_Maybe_1_Some(v124); - VAL v130 = mw_mirth_type_Type_expand(v129); - incref(v130); - VAL v131 = mtw_std_maybe_Maybe_1_Some(v130); - void* v132 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v123); - mut_set(v131, v132); - VAL v133 = mw_mirth_type_Type_ZToStackType(v130); - VAL v134 = mtw_std_either_Either_2_Right(v133); - x126 = v134; - x125 = v105; + VAL v35 = mtp_std_maybe_Maybe_1_Some(v31); + VAL v36 = mw_mirth_type_Type_expand(v35); + incref(v36); + VAL v37 = mtw_std_maybe_Maybe_1_Some(v36); + void* v38 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v30); + mut_set(v37, v38); + VAL v39 = mw_mirth_type_Type_ZToStackType(v36); + VAL v40 = mtw_std_either_Either_2_Right(v39); + x32 = v40; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x113 = x126; - x112 = x125; + x20 = x32; + x19 = v11; } break; case 5LL: { // STCons - VAL v135; - VAL v136; - mtp_mirth_type_StackType_STCons(v111, &v135, &v136); - VAL v137 = mtw_mirth_type_StackTypePart_STPCons(v136); - VAL v138 = mtw_std_list_List_1_Cons(v137, v105); - VAL v139 = mtw_std_either_Either_2_Right(v135); - x113 = v139; - x112 = v138; + VAL v41; + VAL v42; + mtp_mirth_type_StackType_STCons(v18, &v41, &v42); + VAL v43 = mtw_mirth_type_StackTypePart_STPCons(v42); + VAL v44 = mtw_std_list_List_1_Cons(v43, v11); + VAL v45 = mtw_std_either_Either_2_Right(v41); + x20 = v45; + x19 = v44; } break; case 6LL: { // STConsLabel - VAL v140; - VAL v141; - uint64_t v142; - mtp_mirth_type_StackType_STConsLabel(v111, &v140, &v141, &v142); - VAL v143 = mtw_mirth_type_StackTypePart_STPConsLabel(v141, v142); - VAL v144 = mtw_std_list_List_1_Cons(v143, v105); - VAL v145 = mtw_std_either_Either_2_Right(v140); - x113 = v145; - x112 = v144; + VAL v46; + VAL v47; + uint64_t v48; + mtp_mirth_type_StackType_STConsLabel(v18, &v46, &v47, &v48); + VAL v49 = mtw_mirth_type_StackTypePart_STPConsLabel(v47, v48); + VAL v50 = mtw_std_list_List_1_Cons(v49, v11); + VAL v51 = mtw_std_either_Either_2_Right(v46); + x20 = v51; + x19 = v50; } break; case 7LL: { // STWith - VAL v146; - VAL v147; - mtp_mirth_type_StackType_STWith(v111, &v146, &v147); - VAL v148 = mtw_mirth_type_StackTypePart_STPWith(v147); - VAL v149 = mtw_std_list_List_1_Cons(v148, v105); - VAL v150 = mtw_std_either_Either_2_Right(v146); - x113 = v150; - x112 = v149; + VAL v52; + VAL v53; + mtp_mirth_type_StackType_STWith(v18, &v52, &v53); + VAL v54 = mtw_mirth_type_StackTypePart_STPWith(v53); + VAL v55 = mtw_std_list_List_1_Cons(v54, v11); + VAL v56 = mtw_std_either_Either_2_Right(v52); + x20 = v56; + x19 = v55; } break; case 8LL: { // STWithLabel - VAL v151; - VAL v152; - uint64_t v153; - mtp_mirth_type_StackType_STWithLabel(v111, &v151, &v152, &v153); - VAL v154 = mtw_mirth_type_StackTypePart_STPWithLabel(v152, v153); - VAL v155 = mtw_std_list_List_1_Cons(v154, v105); - VAL v156 = mtw_std_either_Either_2_Right(v151); - x113 = v156; - x112 = v155; + VAL v57; + VAL v58; + uint64_t v59; + mtp_mirth_type_StackType_STWithLabel(v18, &v57, &v58, &v59); + VAL v60 = mtw_mirth_type_StackTypePart_STPWithLabel(v58, v59); + VAL v61 = mtw_std_list_List_1_Cons(v60, v11); + VAL v62 = mtw_std_either_Either_2_Right(v57); + x20 = v62; + x19 = v61; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v157 = 1LL /* True */; - x110 = v157; - x109 = x113; - x108 = x112; + int64_t v63 = 1LL /* True */; + x17 = v63; + x16 = x20; + x15 = x19; } break; case 0LL: { // None - int64_t v158 = 0LL /* False */; - x110 = v158; - x109 = v106; - x108 = v105; + int64_t v64 = 0LL /* False */; + x17 = v64; + x16 = v12; + x15 = v11; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v104 = x110; - v103 = x109; - v102 = x108; + v10 = x17; + v9 = x17; + v8 = x16; + v7 = x15; } - VAL v159 = mw_std_either_Either_2_leftZAsk(v103); - VAL x160; - VAL x161; - switch (get_data_tag(v159)) { + VAL v65 = mw_std_either_Either_2_leftZAsk(v8); + VAL x66; + switch (get_data_tag(v65)) { case 1LL: { // Some - VAL v162 = mtp_std_maybe_Maybe_1_Some(v159); - x161 = v162; - x160 = v102; + VAL v67 = mtp_std_maybe_Maybe_1_Some(v65); + x66 = v67; } break; case 0LL: { // None - STR* v163; - STRLIT(v163, "Impossible! The impossible has occured!", 39); - lpush(&lbl_parts, v102); - do_panic(v163); - VAL v164 = pop_value(); - x161 = v164; - VAL v165 = lpop(&lbl_parts); - x160 = v165; + mw_std_prelude_impossibleZBang(); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x3 = x160; - *x2 = x161; + *x3 = v7; + *x2 = x66; } static VAL mw_mirth_type_StackTypePart_typeZDivresource (VAL x1) { VAL x2; @@ -29760,11 +22553,11 @@ static void mw_mirth_type_Type_ctype (VAL x1, VAL x2, VAL *x3, VAL *x4) { case 0LL: { // None STR* v10; STRLIT(v10, "", 0); - VAL v11 = (mw_mirth_type_Type_typeZThen(x2, MKSTR(v10))); + VAL v11 = mw_mirth_type_Type_typeZThen(x2, MKSTR(v10)); STR* v12; STRLIT(v12, " doesn't have a C representation.", 33); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11)); - VAL v14 = (mw_mirth_mirth_ZPlusMirth_errorZBang(v13, v5)); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11); + VAL v14 = mw_mirth_mirth_ZPlusMirth_errorZBang(v13, v5); VAL v15 = MKI64(5LL /* Phantom */); x8 = v15; x7 = v14; @@ -30344,98 +23137,62 @@ static void mw_mirth_type_StackType_ctype (VAL x1, VAL x2, VAL *x3, VAL *x4) { mw_mirth_type_StackType_splitZ_parts(x1, &v5, &v6); VAL v7 = MKI64(0LL /* Nil */); VAL v8 = mw_std_list_List_1_reverse(v7); - VAL v9; - VAL v10; - mw_std_list_List_1_uncons(v6, &v9, &v10); - VAL x11; - VAL x12; - VAL x13; - VAL x14; - int64_t x15; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(v9); - VAL v17; - VAL v18; - mw_mirth_type_StackTypePart_ctype(v16, x2, &v17, &v18); - VAL v19 = mtw_std_list_List_1_Cons(v17, v8); - int64_t v20 = 1LL /* True */; - x15 = v20; - x14 = v10; - x13 = v19; - x12 = v5; - x11 = v18; - } break; - case 0LL: { // None - int64_t v21 = 0LL /* False */; - x15 = v21; - x14 = v10; - x13 = v8; - x12 = v5; - x11 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v22 = (x11); - VAL v23 = x12; - VAL v24 = (x13); - VAL v25 = x14; - int64_t v26 = x15; - while (((bool)v26)) { - VAL v27 = (v22); - VAL v28 = v23; - VAL v29 = (v24); - VAL v30 = v25; - VAL v31; - VAL v32; - mw_std_list_List_1_uncons(v30, &v31, &v32); - VAL x33; - VAL x34; - VAL x35; - VAL x36; - int64_t x37; - switch (get_data_tag(v31)) { - case 1LL: { // Some - VAL v38 = mtp_std_maybe_Maybe_1_Some(v31); - VAL v39; - VAL v40; - mw_mirth_type_StackTypePart_ctype(v38, v27, &v39, &v40); - VAL v41 = mtw_std_list_List_1_Cons(v39, v29); - int64_t v42 = 1LL /* True */; - x37 = v42; - x36 = v32; - x35 = v41; - x34 = v28; - x33 = v40; + int64_t v9 = 1LL /* True */; + VAL v10 = x2; + VAL v11 = v8; + VAL v12 = v6; + int64_t v13 = v9; + int64_t v14 = v9; + while (((bool)v14)) { + VAL v15 = v10; + VAL v16 = v11; + VAL v17 = v12; + int64_t v18 = v13; + VAL x19; + VAL x20; + VAL x21; + int64_t x22; + switch (get_data_tag(v17)) { + case 1LL: { // Cons + VAL v23; + VAL v24; + mtp_std_list_List_1_Cons(v17, &v23, &v24); + VAL v25; + VAL v26; + mw_mirth_type_StackTypePart_ctype(v23, v15, &v25, &v26); + VAL v27 = mtw_std_list_List_1_Cons(v25, v16); + int64_t v28 = 1LL /* True */; + x22 = v28; + x21 = v24; + x20 = v27; + x19 = v26; } break; - case 0LL: { // None - int64_t v43 = 0LL /* False */; - x37 = v43; - x36 = v32; - x35 = v29; - x34 = v28; - x33 = v27; + case 0LL: { // Nil + VAL v29 = MKI64(0LL /* Nil */); + int64_t v30 = 0LL /* False */; + x22 = v30; + x21 = v29; + x20 = v16; + x19 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v26 = x37; - v25 = x36; - v24 = x35; - v23 = x34; - v22 = x33; + v14 = x22; + v13 = x22; + v12 = x21; + v11 = x20; + v10 = x19; } - decref(v25); - VAL v44 = mw_std_list_List_1_reverse(v24); - VAL v45; - VAL v46; - mw_mirth_type_StackTypeBase_ctypeZAsk(v23, v22, &v45, &v46); - VAL v47 = mtw_mirth_type_CTypeStack_CTypeStack(v45, v44); - *x4 = v46; - *x3 = v47; + decref(v12); + VAL v31 = mw_std_list_List_1_reverse(v11); + VAL v32; + VAL v33; + mw_mirth_type_StackTypeBase_ctypeZAsk(v5, v10, &v32, &v33); + VAL v34 = mtw_mirth_type_CTypeStack_CTypeStack(v32, v31); + *x4 = v33; + *x3 = v34; } static void mw_mirth_type_ArrowType_ctype (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5; @@ -30492,7 +23249,7 @@ static VAL mw_mirth_prim_defZ_primZBang (VAL x1, int64_t x2, VAL x3, int64_t x4) void* v7 = mfld_mirth_prim_Prim_ZTildearity(((uint64_t)x2)); mut_set(MKI64(x4), v7); VAL v8 = mtw_mirth_def_Def_DefPrim(x2); - VAL v9 = (mw_mirth_def_Def_register(x1, v8)); + VAL v9 = mw_mirth_def_Def_register(x1, v8); return v9; } static void mw_mirth_prim_Prim_ctxZ_typeZBang (VAL x1, VAL x2, int64_t x3) { @@ -30506,632 +23263,632 @@ static VAL mw_mirth_prim_initZ_primsZBang (VAL x1) { STR* v3; STRLIT(v3, "module", 6); int64_t v4 = -1LL; - VAL v5 = (mw_mirth_prim_defZ_primZBang(x1, v2, MKSTR(v3), v4)); + VAL v5 = mw_mirth_prim_defZ_primZBang(x1, v2, MKSTR(v3), v4); int64_t v6 = 103LL /* PRIM_SYNTAX_IMPORT */; STR* v7; STRLIT(v7, "import", 6); int64_t v8 = -1LL; - VAL v9 = (mw_mirth_prim_defZ_primZBang(v5, v6, MKSTR(v7), v8)); + VAL v9 = mw_mirth_prim_defZ_primZBang(v5, v6, MKSTR(v7), v8); int64_t v10 = 105LL /* PRIM_SYNTAX_INLINE */; STR* v11; STRLIT(v11, "inline", 6); int64_t v12 = -1LL; - VAL v13 = (mw_mirth_prim_defZ_primZBang(v9, v10, MKSTR(v11), v12)); + VAL v13 = mw_mirth_prim_defZ_primZBang(v9, v10, MKSTR(v11), v12); int64_t v14 = 104LL /* PRIM_SYNTAX_ALIAS */; STR* v15; STRLIT(v15, "alias", 5); int64_t v16 = -1LL; - VAL v17 = (mw_mirth_prim_defZ_primZBang(v13, v14, MKSTR(v15), v16)); + VAL v17 = mw_mirth_prim_defZ_primZBang(v13, v14, MKSTR(v15), v16); int64_t v18 = 106LL /* PRIM_SYNTAX_DEF */; STR* v19; STRLIT(v19, "def", 3); int64_t v20 = -1LL; - VAL v21 = (mw_mirth_prim_defZ_primZBang(v17, v18, MKSTR(v19), v20)); + VAL v21 = mw_mirth_prim_defZ_primZBang(v17, v18, MKSTR(v19), v20); int64_t v22 = 108LL /* PRIM_SYNTAX_DEF_TYPE */; STR* v23; STRLIT(v23, "def-type", 8); int64_t v24 = -1LL; - VAL v25 = (mw_mirth_prim_defZ_primZBang(v21, v22, MKSTR(v23), v24)); + VAL v25 = mw_mirth_prim_defZ_primZBang(v21, v22, MKSTR(v23), v24); int64_t v26 = 107LL /* PRIM_SYNTAX_DEF_MISSING */; STR* v27; STRLIT(v27, "def-missing", 11); int64_t v28 = -1LL; - VAL v29 = (mw_mirth_prim_defZ_primZBang(v25, v26, MKSTR(v27), v28)); + VAL v29 = mw_mirth_prim_defZ_primZBang(v25, v26, MKSTR(v27), v28); int64_t v30 = 109LL /* PRIM_SYNTAX_BUFFER */; STR* v31; STRLIT(v31, "buffer", 6); int64_t v32 = -1LL; - VAL v33 = (mw_mirth_prim_defZ_primZBang(v29, v30, MKSTR(v31), v32)); + VAL v33 = mw_mirth_prim_defZ_primZBang(v29, v30, MKSTR(v31), v32); int64_t v34 = 112LL /* PRIM_SYNTAX_DEF_EXTERNAL */; STR* v35; STRLIT(v35, "def-external", 12); int64_t v36 = -1LL; - VAL v37 = (mw_mirth_prim_defZ_primZBang(v33, v34, MKSTR(v35), v36)); + VAL v37 = mw_mirth_prim_defZ_primZBang(v33, v34, MKSTR(v35), v36); int64_t v38 = 111LL /* PRIM_SYNTAX_EXTERNAL */; STR* v39; STRLIT(v39, "external", 8); int64_t v40 = -1LL; - VAL v41 = (mw_mirth_prim_defZ_primZBang(v37, v38, MKSTR(v39), v40)); + VAL v41 = mw_mirth_prim_defZ_primZBang(v37, v38, MKSTR(v39), v40); int64_t v42 = 114LL /* PRIM_SYNTAX_TABLE */; STR* v43; STRLIT(v43, "table", 5); int64_t v44 = -1LL; - VAL v45 = (mw_mirth_prim_defZ_primZBang(v41, v42, MKSTR(v43), v44)); + VAL v45 = mw_mirth_prim_defZ_primZBang(v41, v42, MKSTR(v43), v44); int64_t v46 = 115LL /* PRIM_SYNTAX_FIELD */; STR* v47; STRLIT(v47, "field", 5); int64_t v48 = -1LL; - VAL v49 = (mw_mirth_prim_defZ_primZBang(v45, v46, MKSTR(v47), v48)); + VAL v49 = mw_mirth_prim_defZ_primZBang(v45, v46, MKSTR(v47), v48); int64_t v50 = 113LL /* PRIM_SYNTAX_EMBED_STR */; STR* v51; STRLIT(v51, "embed-str", 9); int64_t v52 = -1LL; - VAL v53 = (mw_mirth_prim_defZ_primZBang(v49, v50, MKSTR(v51), v52)); + VAL v53 = mw_mirth_prim_defZ_primZBang(v49, v50, MKSTR(v51), v52); int64_t v54 = 116LL /* PRIM_SYNTAX_DATA */; STR* v55; STRLIT(v55, "data", 4); int64_t v56 = -1LL; - VAL v57 = (mw_mirth_prim_defZ_primZBang(v53, v54, MKSTR(v55), v56)); + VAL v57 = mw_mirth_prim_defZ_primZBang(v53, v54, MKSTR(v55), v56); int64_t v58 = 117LL /* PRIM_SYNTAX_STRUCT */; STR* v59; STRLIT(v59, "struct", 6); int64_t v60 = -1LL; - VAL v61 = (mw_mirth_prim_defZ_primZBang(v57, v58, MKSTR(v59), v60)); + VAL v61 = mw_mirth_prim_defZ_primZBang(v57, v58, MKSTR(v59), v60); int64_t v62 = 110LL /* PRIM_SYNTAX_VARIABLE */; STR* v63; STRLIT(v63, "var", 3); int64_t v64 = -1LL; - VAL v65 = (mw_mirth_prim_defZ_primZBang(v61, v62, MKSTR(v63), v64)); + VAL v65 = mw_mirth_prim_defZ_primZBang(v61, v62, MKSTR(v63), v64); int64_t v66 = 119LL /* PRIM_SYNTAX_ARROW */; STR* v67; STRLIT(v67, "->", 2); int64_t v68 = -1LL; - VAL v69 = (mw_mirth_prim_defZ_primZBang(v65, v66, MKSTR(v67), v68)); + VAL v69 = mw_mirth_prim_defZ_primZBang(v65, v66, MKSTR(v67), v68); int64_t v70 = 118LL /* PRIM_SYNTAX_DASHES */; STR* v71; STRLIT(v71, "--", 2); int64_t v72 = -1LL; - VAL v73 = (mw_mirth_prim_defZ_primZBang(v69, v70, MKSTR(v71), v72)); + VAL v73 = mw_mirth_prim_defZ_primZBang(v69, v70, MKSTR(v71), v72); int64_t v74 = 5LL /* PRIM_CORE_DIP */; STR* v75; STRLIT(v75, "dip", 3); int64_t v76 = 1LL; - VAL v77 = (mw_mirth_prim_defZ_primZBang(v73, v74, MKSTR(v75), v76)); + VAL v77 = mw_mirth_prim_defZ_primZBang(v73, v74, MKSTR(v75), v76); int64_t v78 = 8LL /* PRIM_CORE_WHILE */; STR* v79; STRLIT(v79, "while", 5); int64_t v80 = 2LL; - VAL v81 = (mw_mirth_prim_defZ_primZBang(v77, v78, MKSTR(v79), v80)); + VAL v81 = mw_mirth_prim_defZ_primZBang(v77, v78, MKSTR(v79), v80); int64_t v82 = 12LL /* PRIM_CORE_MATCH */; STR* v83; STRLIT(v83, "match", 5); int64_t v84 = -1LL; - VAL v85 = (mw_mirth_prim_defZ_primZBang(v81, v82, MKSTR(v83), v84)); + VAL v85 = mw_mirth_prim_defZ_primZBang(v81, v82, MKSTR(v83), v84); int64_t v86 = 13LL /* PRIM_CORE_LAMBDA */; STR* v87; STRLIT(v87, "\\", 1); int64_t v88 = -1LL; - VAL v89 = (mw_mirth_prim_defZ_primZBang(v85, v86, MKSTR(v87), v88)); + VAL v89 = mw_mirth_prim_defZ_primZBang(v85, v86, MKSTR(v87), v88); int64_t v90 = 0LL /* PRIM_CORE_ID */; STR* v91; STRLIT(v91, "prim-id", 7); int64_t v92 = 0LL; - VAL v93 = (mw_mirth_prim_defZ_primZBang(v89, v90, MKSTR(v91), v92)); + VAL v93 = mw_mirth_prim_defZ_primZBang(v89, v90, MKSTR(v91), v92); int64_t v94 = 1LL /* PRIM_CORE_DUP */; STR* v95; STRLIT(v95, "prim-dup", 8); int64_t v96 = 0LL; - VAL v97 = (mw_mirth_prim_defZ_primZBang(v93, v94, MKSTR(v95), v96)); + VAL v97 = mw_mirth_prim_defZ_primZBang(v93, v94, MKSTR(v95), v96); int64_t v98 = 2LL /* PRIM_CORE_DROP */; STR* v99; STRLIT(v99, "prim-drop", 9); int64_t v100 = 0LL; - VAL v101 = (mw_mirth_prim_defZ_primZBang(v97, v98, MKSTR(v99), v100)); + VAL v101 = mw_mirth_prim_defZ_primZBang(v97, v98, MKSTR(v99), v100); int64_t v102 = 3LL /* PRIM_CORE_SWAP */; STR* v103; STRLIT(v103, "prim-swap", 9); int64_t v104 = 0LL; - VAL v105 = (mw_mirth_prim_defZ_primZBang(v101, v102, MKSTR(v103), v104)); + VAL v105 = mw_mirth_prim_defZ_primZBang(v101, v102, MKSTR(v103), v104); int64_t v106 = 5LL /* PRIM_CORE_DIP */; STR* v107; STRLIT(v107, "prim-dip", 8); int64_t v108 = 1LL; - VAL v109 = (mw_mirth_prim_defZ_primZBang(v105, v106, MKSTR(v107), v108)); + VAL v109 = mw_mirth_prim_defZ_primZBang(v105, v106, MKSTR(v107), v108); int64_t v110 = 7LL /* PRIM_CORE_IF */; STR* v111; STRLIT(v111, "prim-if", 7); int64_t v112 = 2LL; - VAL v113 = (mw_mirth_prim_defZ_primZBang(v109, v110, MKSTR(v111), v112)); + VAL v113 = mw_mirth_prim_defZ_primZBang(v109, v110, MKSTR(v111), v112); int64_t v114 = 8LL /* PRIM_CORE_WHILE */; STR* v115; STRLIT(v115, "prim-while", 10); int64_t v116 = 2LL; - VAL v117 = (mw_mirth_prim_defZ_primZBang(v113, v114, MKSTR(v115), v116)); + VAL v117 = mw_mirth_prim_defZ_primZBang(v113, v114, MKSTR(v115), v116); int64_t v118 = 9LL /* PRIM_CORE_DEBUG */; STR* v119; STRLIT(v119, "prim-debug", 10); int64_t v120 = 0LL; - VAL v121 = (mw_mirth_prim_defZ_primZBang(v117, v118, MKSTR(v119), v120)); + VAL v121 = mw_mirth_prim_defZ_primZBang(v117, v118, MKSTR(v119), v120); int64_t v122 = 10LL /* PRIM_CORE_PANIC */; STR* v123; STRLIT(v123, "prim-panic", 10); int64_t v124 = 0LL; - VAL v125 = (mw_mirth_prim_defZ_primZBang(v121, v122, MKSTR(v123), v124)); + VAL v125 = mw_mirth_prim_defZ_primZBang(v121, v122, MKSTR(v123), v124); int64_t v126 = 11LL /* PRIM_CORE_RUN */; STR* v127; STRLIT(v127, "prim-run", 8); int64_t v128 = 0LL; - VAL v129 = (mw_mirth_prim_defZ_primZBang(v125, v126, MKSTR(v127), v128)); + VAL v129 = mw_mirth_prim_defZ_primZBang(v125, v126, MKSTR(v127), v128); int64_t v130 = 12LL /* PRIM_CORE_MATCH */; STR* v131; STRLIT(v131, "prim-match", 10); int64_t v132 = -1LL; - VAL v133 = (mw_mirth_prim_defZ_primZBang(v129, v130, MKSTR(v131), v132)); + VAL v133 = mw_mirth_prim_defZ_primZBang(v129, v130, MKSTR(v131), v132); int64_t v134 = 13LL /* PRIM_CORE_LAMBDA */; STR* v135; STRLIT(v135, "prim-lambda", 11); int64_t v136 = -1LL; - VAL v137 = (mw_mirth_prim_defZ_primZBang(v133, v134, MKSTR(v135), v136)); + VAL v137 = mw_mirth_prim_defZ_primZBang(v133, v134, MKSTR(v135), v136); int64_t v138 = 4LL /* PRIM_CORE_RSWAP */; STR* v139; STRLIT(v139, "prim-rswap", 10); int64_t v140 = 0LL; - VAL v141 = (mw_mirth_prim_defZ_primZBang(v137, v138, MKSTR(v139), v140)); + VAL v141 = mw_mirth_prim_defZ_primZBang(v137, v138, MKSTR(v139), v140); int64_t v142 = 6LL /* PRIM_CORE_RDIP */; STR* v143; STRLIT(v143, "prim-rdip", 9); int64_t v144 = 1LL; - VAL v145 = (mw_mirth_prim_defZ_primZBang(v141, v142, MKSTR(v143), v144)); + VAL v145 = mw_mirth_prim_defZ_primZBang(v141, v142, MKSTR(v143), v144); int64_t v146 = 20LL /* PRIM_INT_ADD */; STR* v147; STRLIT(v147, "prim-int-add", 12); int64_t v148 = 0LL; - VAL v149 = (mw_mirth_prim_defZ_primZBang(v145, v146, MKSTR(v147), v148)); + VAL v149 = mw_mirth_prim_defZ_primZBang(v145, v146, MKSTR(v147), v148); int64_t v150 = 21LL /* PRIM_INT_SUB */; STR* v151; STRLIT(v151, "prim-int-sub", 12); int64_t v152 = 0LL; - VAL v153 = (mw_mirth_prim_defZ_primZBang(v149, v150, MKSTR(v151), v152)); + VAL v153 = mw_mirth_prim_defZ_primZBang(v149, v150, MKSTR(v151), v152); int64_t v154 = 22LL /* PRIM_INT_MUL */; STR* v155; STRLIT(v155, "prim-int-mul", 12); int64_t v156 = 0LL; - VAL v157 = (mw_mirth_prim_defZ_primZBang(v153, v154, MKSTR(v155), v156)); + VAL v157 = mw_mirth_prim_defZ_primZBang(v153, v154, MKSTR(v155), v156); int64_t v158 = 23LL /* PRIM_INT_DIV */; STR* v159; STRLIT(v159, "prim-int-div", 12); int64_t v160 = 0LL; - VAL v161 = (mw_mirth_prim_defZ_primZBang(v157, v158, MKSTR(v159), v160)); + VAL v161 = mw_mirth_prim_defZ_primZBang(v157, v158, MKSTR(v159), v160); int64_t v162 = 24LL /* PRIM_INT_MOD */; STR* v163; STRLIT(v163, "prim-int-mod", 12); int64_t v164 = 0LL; - VAL v165 = (mw_mirth_prim_defZ_primZBang(v161, v162, MKSTR(v163), v164)); + VAL v165 = mw_mirth_prim_defZ_primZBang(v161, v162, MKSTR(v163), v164); int64_t v166 = 25LL /* PRIM_INT_AND */; STR* v167; STRLIT(v167, "prim-int-and", 12); int64_t v168 = 0LL; - VAL v169 = (mw_mirth_prim_defZ_primZBang(v165, v166, MKSTR(v167), v168)); + VAL v169 = mw_mirth_prim_defZ_primZBang(v165, v166, MKSTR(v167), v168); int64_t v170 = 26LL /* PRIM_INT_OR */; STR* v171; STRLIT(v171, "prim-int-or", 11); int64_t v172 = 0LL; - VAL v173 = (mw_mirth_prim_defZ_primZBang(v169, v170, MKSTR(v171), v172)); + VAL v173 = mw_mirth_prim_defZ_primZBang(v169, v170, MKSTR(v171), v172); int64_t v174 = 27LL /* PRIM_INT_XOR */; STR* v175; STRLIT(v175, "prim-int-xor", 12); int64_t v176 = 0LL; - VAL v177 = (mw_mirth_prim_defZ_primZBang(v173, v174, MKSTR(v175), v176)); + VAL v177 = mw_mirth_prim_defZ_primZBang(v173, v174, MKSTR(v175), v176); int64_t v178 = 28LL /* PRIM_INT_SHL */; STR* v179; STRLIT(v179, "prim-int-shl", 12); int64_t v180 = 0LL; - VAL v181 = (mw_mirth_prim_defZ_primZBang(v177, v178, MKSTR(v179), v180)); + VAL v181 = mw_mirth_prim_defZ_primZBang(v177, v178, MKSTR(v179), v180); int64_t v182 = 29LL /* PRIM_INT_SHR */; STR* v183; STRLIT(v183, "prim-int-shr", 12); int64_t v184 = 0LL; - VAL v185 = (mw_mirth_prim_defZ_primZBang(v181, v182, MKSTR(v183), v184)); + VAL v185 = mw_mirth_prim_defZ_primZBang(v181, v182, MKSTR(v183), v184); int64_t v186 = 14LL /* PRIM_INT_EQ */; STR* v187; STRLIT(v187, "prim-int-eq", 11); int64_t v188 = 0LL; - VAL v189 = (mw_mirth_prim_defZ_primZBang(v185, v186, MKSTR(v187), v188)); + VAL v189 = mw_mirth_prim_defZ_primZBang(v185, v186, MKSTR(v187), v188); int64_t v190 = 15LL /* PRIM_INT_LT */; STR* v191; STRLIT(v191, "prim-int-lt", 11); int64_t v192 = 0LL; - VAL v193 = (mw_mirth_prim_defZ_primZBang(v189, v190, MKSTR(v191), v192)); + VAL v193 = mw_mirth_prim_defZ_primZBang(v189, v190, MKSTR(v191), v192); int64_t v194 = 16LL /* PRIM_INT_LE */; STR* v195; STRLIT(v195, "prim-int-le", 11); int64_t v196 = 0LL; - VAL v197 = (mw_mirth_prim_defZ_primZBang(v193, v194, MKSTR(v195), v196)); + VAL v197 = mw_mirth_prim_defZ_primZBang(v193, v194, MKSTR(v195), v196); int64_t v198 = 17LL /* PRIM_INT_GT */; STR* v199; STRLIT(v199, "prim-int-gt", 11); int64_t v200 = 0LL; - VAL v201 = (mw_mirth_prim_defZ_primZBang(v197, v198, MKSTR(v199), v200)); + VAL v201 = mw_mirth_prim_defZ_primZBang(v197, v198, MKSTR(v199), v200); int64_t v202 = 18LL /* PRIM_INT_GE */; STR* v203; STRLIT(v203, "prim-int-ge", 11); int64_t v204 = 0LL; - VAL v205 = (mw_mirth_prim_defZ_primZBang(v201, v202, MKSTR(v203), v204)); + VAL v205 = mw_mirth_prim_defZ_primZBang(v201, v202, MKSTR(v203), v204); int64_t v206 = 19LL /* PRIM_INT_NE */; STR* v207; STRLIT(v207, "prim-int-ne", 11); int64_t v208 = 0LL; - VAL v209 = (mw_mirth_prim_defZ_primZBang(v205, v206, MKSTR(v207), v208)); + VAL v209 = mw_mirth_prim_defZ_primZBang(v205, v206, MKSTR(v207), v208); int64_t v210 = 30LL /* PRIM_INT_TO_STR */; STR* v211; STRLIT(v211, "prim-int-to-str", 15); int64_t v212 = 0LL; - VAL v213 = (mw_mirth_prim_defZ_primZBang(v209, v210, MKSTR(v211), v212)); + VAL v213 = mw_mirth_prim_defZ_primZBang(v209, v210, MKSTR(v211), v212); int64_t v214 = 31LL /* PRIM_INT_TO_F32 */; STR* v215; STRLIT(v215, "prim-int-to-float32", 19); int64_t v216 = 0LL; - VAL v217 = (mw_mirth_prim_defZ_primZBang(v213, v214, MKSTR(v215), v216)); + VAL v217 = mw_mirth_prim_defZ_primZBang(v213, v214, MKSTR(v215), v216); int64_t v218 = 32LL /* PRIM_INT_TO_F64 */; STR* v219; STRLIT(v219, "prim-int-to-float64", 19); int64_t v220 = 0LL; - VAL v221 = (mw_mirth_prim_defZ_primZBang(v217, v218, MKSTR(v219), v220)); + VAL v221 = mw_mirth_prim_defZ_primZBang(v217, v218, MKSTR(v219), v220); int64_t v222 = 31LL /* PRIM_INT_TO_F32 */; STR* v223; STRLIT(v223, "prim-int-to-f32", 15); int64_t v224 = 0LL; - VAL v225 = (mw_mirth_prim_defZ_primZBang(v221, v222, MKSTR(v223), v224)); + VAL v225 = mw_mirth_prim_defZ_primZBang(v221, v222, MKSTR(v223), v224); int64_t v226 = 32LL /* PRIM_INT_TO_F64 */; STR* v227; STRLIT(v227, "prim-int-to-f64", 15); int64_t v228 = 0LL; - VAL v229 = (mw_mirth_prim_defZ_primZBang(v225, v226, MKSTR(v227), v228)); + VAL v229 = mw_mirth_prim_defZ_primZBang(v225, v226, MKSTR(v227), v228); int64_t v230 = 33LL /* PRIM_F32_EQ */; STR* v231; STRLIT(v231, "prim-f32-eq", 11); int64_t v232 = 0LL; - VAL v233 = (mw_mirth_prim_defZ_primZBang(v229, v230, MKSTR(v231), v232)); + VAL v233 = mw_mirth_prim_defZ_primZBang(v229, v230, MKSTR(v231), v232); int64_t v234 = 34LL /* PRIM_F32_LT */; STR* v235; STRLIT(v235, "prim-f32-lt", 11); int64_t v236 = 0LL; - VAL v237 = (mw_mirth_prim_defZ_primZBang(v233, v234, MKSTR(v235), v236)); + VAL v237 = mw_mirth_prim_defZ_primZBang(v233, v234, MKSTR(v235), v236); int64_t v238 = 35LL /* PRIM_F32_ADD */; STR* v239; STRLIT(v239, "prim-f32-add", 12); int64_t v240 = 0LL; - VAL v241 = (mw_mirth_prim_defZ_primZBang(v237, v238, MKSTR(v239), v240)); + VAL v241 = mw_mirth_prim_defZ_primZBang(v237, v238, MKSTR(v239), v240); int64_t v242 = 36LL /* PRIM_F32_SUB */; STR* v243; STRLIT(v243, "prim-f32-sub", 12); int64_t v244 = 0LL; - VAL v245 = (mw_mirth_prim_defZ_primZBang(v241, v242, MKSTR(v243), v244)); + VAL v245 = mw_mirth_prim_defZ_primZBang(v241, v242, MKSTR(v243), v244); int64_t v246 = 37LL /* PRIM_F32_MUL */; STR* v247; STRLIT(v247, "prim-f32-mul", 12); int64_t v248 = 0LL; - VAL v249 = (mw_mirth_prim_defZ_primZBang(v245, v246, MKSTR(v247), v248)); + VAL v249 = mw_mirth_prim_defZ_primZBang(v245, v246, MKSTR(v247), v248); int64_t v250 = 38LL /* PRIM_F32_DIV */; STR* v251; STRLIT(v251, "prim-f32-div", 12); int64_t v252 = 0LL; - VAL v253 = (mw_mirth_prim_defZ_primZBang(v249, v250, MKSTR(v251), v252)); + VAL v253 = mw_mirth_prim_defZ_primZBang(v249, v250, MKSTR(v251), v252); int64_t v254 = 39LL /* PRIM_F32_TO_INT */; STR* v255; STRLIT(v255, "prim-f32-to-int", 15); int64_t v256 = 0LL; - VAL v257 = (mw_mirth_prim_defZ_primZBang(v253, v254, MKSTR(v255), v256)); + VAL v257 = mw_mirth_prim_defZ_primZBang(v253, v254, MKSTR(v255), v256); int64_t v258 = 40LL /* PRIM_F32_TO_STR */; STR* v259; STRLIT(v259, "prim-f32-to-str", 15); int64_t v260 = 0LL; - VAL v261 = (mw_mirth_prim_defZ_primZBang(v257, v258, MKSTR(v259), v260)); + VAL v261 = mw_mirth_prim_defZ_primZBang(v257, v258, MKSTR(v259), v260); int64_t v262 = 41LL /* PRIM_F32_TO_F64 */; STR* v263; STRLIT(v263, "prim-f32-to-f64", 15); int64_t v264 = 0LL; - VAL v265 = (mw_mirth_prim_defZ_primZBang(v261, v262, MKSTR(v263), v264)); + VAL v265 = mw_mirth_prim_defZ_primZBang(v261, v262, MKSTR(v263), v264); int64_t v266 = 42LL /* PRIM_F64_EQ */; STR* v267; STRLIT(v267, "prim-f64-eq", 11); int64_t v268 = 0LL; - VAL v269 = (mw_mirth_prim_defZ_primZBang(v265, v266, MKSTR(v267), v268)); + VAL v269 = mw_mirth_prim_defZ_primZBang(v265, v266, MKSTR(v267), v268); int64_t v270 = 43LL /* PRIM_F64_LT */; STR* v271; STRLIT(v271, "prim-f64-lt", 11); int64_t v272 = 0LL; - VAL v273 = (mw_mirth_prim_defZ_primZBang(v269, v270, MKSTR(v271), v272)); + VAL v273 = mw_mirth_prim_defZ_primZBang(v269, v270, MKSTR(v271), v272); int64_t v274 = 44LL /* PRIM_F64_ADD */; STR* v275; STRLIT(v275, "prim-f64-add", 12); int64_t v276 = 0LL; - VAL v277 = (mw_mirth_prim_defZ_primZBang(v273, v274, MKSTR(v275), v276)); + VAL v277 = mw_mirth_prim_defZ_primZBang(v273, v274, MKSTR(v275), v276); int64_t v278 = 45LL /* PRIM_F64_SUB */; STR* v279; STRLIT(v279, "prim-f64-sub", 12); int64_t v280 = 0LL; - VAL v281 = (mw_mirth_prim_defZ_primZBang(v277, v278, MKSTR(v279), v280)); + VAL v281 = mw_mirth_prim_defZ_primZBang(v277, v278, MKSTR(v279), v280); int64_t v282 = 46LL /* PRIM_F64_MUL */; STR* v283; STRLIT(v283, "prim-f64-mul", 12); int64_t v284 = 0LL; - VAL v285 = (mw_mirth_prim_defZ_primZBang(v281, v282, MKSTR(v283), v284)); + VAL v285 = mw_mirth_prim_defZ_primZBang(v281, v282, MKSTR(v283), v284); int64_t v286 = 47LL /* PRIM_F64_DIV */; STR* v287; STRLIT(v287, "prim-f64-div", 12); int64_t v288 = 0LL; - VAL v289 = (mw_mirth_prim_defZ_primZBang(v285, v286, MKSTR(v287), v288)); + VAL v289 = mw_mirth_prim_defZ_primZBang(v285, v286, MKSTR(v287), v288); int64_t v290 = 48LL /* PRIM_F64_TO_INT */; STR* v291; STRLIT(v291, "prim-f64-to-int", 15); int64_t v292 = 0LL; - VAL v293 = (mw_mirth_prim_defZ_primZBang(v289, v290, MKSTR(v291), v292)); + VAL v293 = mw_mirth_prim_defZ_primZBang(v289, v290, MKSTR(v291), v292); int64_t v294 = 49LL /* PRIM_F64_TO_STR */; STR* v295; STRLIT(v295, "prim-f64-to-str", 15); int64_t v296 = 0LL; - VAL v297 = (mw_mirth_prim_defZ_primZBang(v293, v294, MKSTR(v295), v296)); + VAL v297 = mw_mirth_prim_defZ_primZBang(v293, v294, MKSTR(v295), v296); int64_t v298 = 50LL /* PRIM_F64_TO_F32 */; STR* v299; STRLIT(v299, "prim-f64-to-f32", 15); int64_t v300 = 0LL; - VAL v301 = (mw_mirth_prim_defZ_primZBang(v297, v298, MKSTR(v299), v300)); + VAL v301 = mw_mirth_prim_defZ_primZBang(v297, v298, MKSTR(v299), v300); int64_t v302 = 51LL /* PRIM_BOOL_AND */; STR* v303; STRLIT(v303, "prim-bool-and", 13); int64_t v304 = 0LL; - VAL v305 = (mw_mirth_prim_defZ_primZBang(v301, v302, MKSTR(v303), v304)); + VAL v305 = mw_mirth_prim_defZ_primZBang(v301, v302, MKSTR(v303), v304); int64_t v306 = 52LL /* PRIM_BOOL_OR */; STR* v307; STRLIT(v307, "prim-bool-or", 12); int64_t v308 = 0LL; - VAL v309 = (mw_mirth_prim_defZ_primZBang(v305, v306, MKSTR(v307), v308)); + VAL v309 = mw_mirth_prim_defZ_primZBang(v305, v306, MKSTR(v307), v308); int64_t v310 = 53LL /* PRIM_BOOL_NOT */; STR* v311; STRLIT(v311, "prim-bool-not", 13); int64_t v312 = 0LL; - VAL v313 = (mw_mirth_prim_defZ_primZBang(v309, v310, MKSTR(v311), v312)); + VAL v313 = mw_mirth_prim_defZ_primZBang(v309, v310, MKSTR(v311), v312); int64_t v314 = 54LL /* PRIM_PACK_NIL */; STR* v315; STRLIT(v315, "prim-pack-nil", 13); int64_t v316 = 0LL; - VAL v317 = (mw_mirth_prim_defZ_primZBang(v313, v314, MKSTR(v315), v316)); + VAL v317 = mw_mirth_prim_defZ_primZBang(v313, v314, MKSTR(v315), v316); int64_t v318 = 55LL /* PRIM_PACK_CONS */; STR* v319; STRLIT(v319, "prim-pack-cons", 14); int64_t v320 = 0LL; - VAL v321 = (mw_mirth_prim_defZ_primZBang(v317, v318, MKSTR(v319), v320)); + VAL v321 = mw_mirth_prim_defZ_primZBang(v317, v318, MKSTR(v319), v320); int64_t v322 = 56LL /* PRIM_PACK_UNCONS */; STR* v323; STRLIT(v323, "prim-pack-uncons", 16); int64_t v324 = 0LL; - VAL v325 = (mw_mirth_prim_defZ_primZBang(v321, v322, MKSTR(v323), v324)); + VAL v325 = mw_mirth_prim_defZ_primZBang(v321, v322, MKSTR(v323), v324); int64_t v326 = 57LL /* PRIM_MUT_GET */; STR* v327; STRLIT(v327, "prim-mut-get", 12); int64_t v328 = 0LL; - VAL v329 = (mw_mirth_prim_defZ_primZBang(v325, v326, MKSTR(v327), v328)); + VAL v329 = mw_mirth_prim_defZ_primZBang(v325, v326, MKSTR(v327), v328); int64_t v330 = 58LL /* PRIM_MUT_SET */; STR* v331; STRLIT(v331, "prim-mut-set", 12); int64_t v332 = 0LL; - VAL v333 = (mw_mirth_prim_defZ_primZBang(v329, v330, MKSTR(v331), v332)); + VAL v333 = mw_mirth_prim_defZ_primZBang(v329, v330, MKSTR(v331), v332); int64_t v334 = 59LL /* PRIM_MUT_IS_SET */; STR* v335; STRLIT(v335, "prim-mut-is-set", 15); int64_t v336 = 0LL; - VAL v337 = (mw_mirth_prim_defZ_primZBang(v333, v334, MKSTR(v335), v336)); + VAL v337 = mw_mirth_prim_defZ_primZBang(v333, v334, MKSTR(v335), v336); int64_t v338 = 60LL /* PRIM_PTR_NIL */; STR* v339; STRLIT(v339, "prim-ptr-nil", 12); int64_t v340 = 0LL; - VAL v341 = (mw_mirth_prim_defZ_primZBang(v337, v338, MKSTR(v339), v340)); + VAL v341 = mw_mirth_prim_defZ_primZBang(v337, v338, MKSTR(v339), v340); int64_t v342 = 61LL /* PRIM_PTR_EQ */; STR* v343; STRLIT(v343, "prim-ptr-eq", 11); int64_t v344 = 0LL; - VAL v345 = (mw_mirth_prim_defZ_primZBang(v341, v342, MKSTR(v343), v344)); + VAL v345 = mw_mirth_prim_defZ_primZBang(v341, v342, MKSTR(v343), v344); int64_t v346 = 62LL /* PRIM_PTR_ADD */; STR* v347; STRLIT(v347, "prim-ptr-add", 12); int64_t v348 = 0LL; - VAL v349 = (mw_mirth_prim_defZ_primZBang(v345, v346, MKSTR(v347), v348)); + VAL v349 = mw_mirth_prim_defZ_primZBang(v345, v346, MKSTR(v347), v348); int64_t v350 = 63LL /* PRIM_PTR_SIZE */; STR* v351; STRLIT(v351, "prim-ptr-size", 13); int64_t v352 = 0LL; - VAL v353 = (mw_mirth_prim_defZ_primZBang(v349, v350, MKSTR(v351), v352)); + VAL v353 = mw_mirth_prim_defZ_primZBang(v349, v350, MKSTR(v351), v352); int64_t v354 = 88LL /* PRIM_PTR_GET */; STR* v355; STRLIT(v355, "prim-ptr-get", 12); int64_t v356 = 0LL; - VAL v357 = (mw_mirth_prim_defZ_primZBang(v353, v354, MKSTR(v355), v356)); + VAL v357 = mw_mirth_prim_defZ_primZBang(v353, v354, MKSTR(v355), v356); int64_t v358 = 97LL /* PRIM_PTR_SET */; STR* v359; STRLIT(v359, "prim-ptr-set", 12); int64_t v360 = 0LL; - VAL v361 = (mw_mirth_prim_defZ_primZBang(v357, v358, MKSTR(v359), v360)); + VAL v361 = mw_mirth_prim_defZ_primZBang(v357, v358, MKSTR(v359), v360); int64_t v362 = 64LL /* PRIM_PTR_ALLOC */; STR* v363; STRLIT(v363, "prim-ptr-alloc", 14); int64_t v364 = 0LL; - VAL v365 = (mw_mirth_prim_defZ_primZBang(v361, v362, MKSTR(v363), v364)); + VAL v365 = mw_mirth_prim_defZ_primZBang(v361, v362, MKSTR(v363), v364); int64_t v366 = 65LL /* PRIM_PTR_REALLOC */; STR* v367; STRLIT(v367, "prim-ptr-realloc", 16); int64_t v368 = 0LL; - VAL v369 = (mw_mirth_prim_defZ_primZBang(v365, v366, MKSTR(v367), v368)); + VAL v369 = mw_mirth_prim_defZ_primZBang(v365, v366, MKSTR(v367), v368); int64_t v370 = 66LL /* PRIM_PTR_FREE */; STR* v371; STRLIT(v371, "prim-ptr-free", 13); int64_t v372 = 0LL; - VAL v373 = (mw_mirth_prim_defZ_primZBang(v369, v370, MKSTR(v371), v372)); + VAL v373 = mw_mirth_prim_defZ_primZBang(v369, v370, MKSTR(v371), v372); int64_t v374 = 68LL /* PRIM_PTR_FILL */; STR* v375; STRLIT(v375, "prim-ptr-fill", 13); int64_t v376 = 0LL; - VAL v377 = (mw_mirth_prim_defZ_primZBang(v373, v374, MKSTR(v375), v376)); + VAL v377 = mw_mirth_prim_defZ_primZBang(v373, v374, MKSTR(v375), v376); int64_t v378 = 67LL /* PRIM_PTR_COPY */; STR* v379; STRLIT(v379, "prim-ptr-copy", 13); int64_t v380 = 0LL; - VAL v381 = (mw_mirth_prim_defZ_primZBang(v377, v378, MKSTR(v379), v380)); + VAL v381 = mw_mirth_prim_defZ_primZBang(v377, v378, MKSTR(v379), v380); int64_t v382 = 69LL /* PRIM_STR_COPY */; STR* v383; STRLIT(v383, "prim-str-copy", 13); int64_t v384 = 0LL; - VAL v385 = (mw_mirth_prim_defZ_primZBang(v381, v382, MKSTR(v383), v384)); + VAL v385 = mw_mirth_prim_defZ_primZBang(v381, v382, MKSTR(v383), v384); int64_t v386 = 70LL /* PRIM_STR_NUM_BYTES */; STR* v387; STRLIT(v387, "prim-str-num-bytes", 18); int64_t v388 = 0LL; - VAL v389 = (mw_mirth_prim_defZ_primZBang(v385, v386, MKSTR(v387), v388)); + VAL v389 = mw_mirth_prim_defZ_primZBang(v385, v386, MKSTR(v387), v388); int64_t v390 = 71LL /* PRIM_STR_BASE */; STR* v391; STRLIT(v391, "prim-str-base", 13); int64_t v392 = 0LL; - VAL v393 = (mw_mirth_prim_defZ_primZBang(v389, v390, MKSTR(v391), v392)); + VAL v393 = mw_mirth_prim_defZ_primZBang(v389, v390, MKSTR(v391), v392); int64_t v394 = 72LL /* PRIM_STR_CAT */; STR* v395; STRLIT(v395, "prim-str-cat", 12); int64_t v396 = 0LL; - VAL v397 = (mw_mirth_prim_defZ_primZBang(v393, v394, MKSTR(v395), v396)); + VAL v397 = mw_mirth_prim_defZ_primZBang(v393, v394, MKSTR(v395), v396); int64_t v398 = 73LL /* PRIM_STR_CMP */; STR* v399; STRLIT(v399, "prim-str-cmp", 12); int64_t v400 = 0LL; - VAL v401 = (mw_mirth_prim_defZ_primZBang(v397, v398, MKSTR(v399), v400)); + VAL v401 = mw_mirth_prim_defZ_primZBang(v397, v398, MKSTR(v399), v400); int64_t v402 = 74LL /* PRIM_STR_EQ */; STR* v403; STRLIT(v403, "prim-str-eq", 11); int64_t v404 = 0LL; - VAL v405 = (mw_mirth_prim_defZ_primZBang(v401, v402, MKSTR(v403), v404)); + VAL v405 = mw_mirth_prim_defZ_primZBang(v401, v402, MKSTR(v403), v404); int64_t v406 = 75LL /* PRIM_STR_LT */; STR* v407; STRLIT(v407, "prim-str-lt", 11); int64_t v408 = 0LL; - VAL v409 = (mw_mirth_prim_defZ_primZBang(v405, v406, MKSTR(v407), v408)); + VAL v409 = mw_mirth_prim_defZ_primZBang(v405, v406, MKSTR(v407), v408); int64_t v410 = 76LL /* PRIM_STR_LE */; STR* v411; STRLIT(v411, "prim-str-le", 11); int64_t v412 = 0LL; - VAL v413 = (mw_mirth_prim_defZ_primZBang(v409, v410, MKSTR(v411), v412)); + VAL v413 = mw_mirth_prim_defZ_primZBang(v409, v410, MKSTR(v411), v412); int64_t v414 = 77LL /* PRIM_STR_GT */; STR* v415; STRLIT(v415, "prim-str-gt", 11); int64_t v416 = 0LL; - VAL v417 = (mw_mirth_prim_defZ_primZBang(v413, v414, MKSTR(v415), v416)); + VAL v417 = mw_mirth_prim_defZ_primZBang(v413, v414, MKSTR(v415), v416); int64_t v418 = 78LL /* PRIM_STR_GE */; STR* v419; STRLIT(v419, "prim-str-ge", 11); int64_t v420 = 0LL; - VAL v421 = (mw_mirth_prim_defZ_primZBang(v417, v418, MKSTR(v419), v420)); + VAL v421 = mw_mirth_prim_defZ_primZBang(v417, v418, MKSTR(v419), v420); int64_t v422 = 79LL /* PRIM_STR_NE */; STR* v423; STRLIT(v423, "prim-str-ne", 11); int64_t v424 = 0LL; - VAL v425 = (mw_mirth_prim_defZ_primZBang(v421, v422, MKSTR(v423), v424)); + VAL v425 = mw_mirth_prim_defZ_primZBang(v421, v422, MKSTR(v423), v424); int64_t v426 = 80LL /* PRIM_U8_GET */; STR* v427; STRLIT(v427, "prim-u8-get", 11); int64_t v428 = 0LL; - VAL v429 = (mw_mirth_prim_defZ_primZBang(v425, v426, MKSTR(v427), v428)); + VAL v429 = mw_mirth_prim_defZ_primZBang(v425, v426, MKSTR(v427), v428); int64_t v430 = 89LL /* PRIM_U8_SET */; STR* v431; STRLIT(v431, "prim-u8-set", 11); int64_t v432 = 0LL; - VAL v433 = (mw_mirth_prim_defZ_primZBang(v429, v430, MKSTR(v431), v432)); + VAL v433 = mw_mirth_prim_defZ_primZBang(v429, v430, MKSTR(v431), v432); int64_t v434 = 81LL /* PRIM_U16_GET */; STR* v435; STRLIT(v435, "prim-u16-get", 12); int64_t v436 = 0LL; - VAL v437 = (mw_mirth_prim_defZ_primZBang(v433, v434, MKSTR(v435), v436)); + VAL v437 = mw_mirth_prim_defZ_primZBang(v433, v434, MKSTR(v435), v436); int64_t v438 = 90LL /* PRIM_U16_SET */; STR* v439; STRLIT(v439, "prim-u16-set", 12); int64_t v440 = 0LL; - VAL v441 = (mw_mirth_prim_defZ_primZBang(v437, v438, MKSTR(v439), v440)); + VAL v441 = mw_mirth_prim_defZ_primZBang(v437, v438, MKSTR(v439), v440); int64_t v442 = 82LL /* PRIM_U32_GET */; STR* v443; STRLIT(v443, "prim-u32-get", 12); int64_t v444 = 0LL; - VAL v445 = (mw_mirth_prim_defZ_primZBang(v441, v442, MKSTR(v443), v444)); + VAL v445 = mw_mirth_prim_defZ_primZBang(v441, v442, MKSTR(v443), v444); int64_t v446 = 91LL /* PRIM_U32_SET */; STR* v447; STRLIT(v447, "prim-u32-set", 12); int64_t v448 = 0LL; - VAL v449 = (mw_mirth_prim_defZ_primZBang(v445, v446, MKSTR(v447), v448)); + VAL v449 = mw_mirth_prim_defZ_primZBang(v445, v446, MKSTR(v447), v448); int64_t v450 = 83LL /* PRIM_U64_GET */; STR* v451; STRLIT(v451, "prim-u64-get", 12); int64_t v452 = 0LL; - VAL v453 = (mw_mirth_prim_defZ_primZBang(v449, v450, MKSTR(v451), v452)); + VAL v453 = mw_mirth_prim_defZ_primZBang(v449, v450, MKSTR(v451), v452); int64_t v454 = 92LL /* PRIM_U64_SET */; STR* v455; STRLIT(v455, "prim-u64-set", 12); int64_t v456 = 0LL; - VAL v457 = (mw_mirth_prim_defZ_primZBang(v453, v454, MKSTR(v455), v456)); + VAL v457 = mw_mirth_prim_defZ_primZBang(v453, v454, MKSTR(v455), v456); int64_t v458 = 84LL /* PRIM_I8_GET */; STR* v459; STRLIT(v459, "prim-i8-get", 11); int64_t v460 = 0LL; - VAL v461 = (mw_mirth_prim_defZ_primZBang(v457, v458, MKSTR(v459), v460)); + VAL v461 = mw_mirth_prim_defZ_primZBang(v457, v458, MKSTR(v459), v460); int64_t v462 = 93LL /* PRIM_I8_SET */; STR* v463; STRLIT(v463, "prim-i8-set", 11); int64_t v464 = 0LL; - VAL v465 = (mw_mirth_prim_defZ_primZBang(v461, v462, MKSTR(v463), v464)); + VAL v465 = mw_mirth_prim_defZ_primZBang(v461, v462, MKSTR(v463), v464); int64_t v466 = 85LL /* PRIM_I16_GET */; STR* v467; STRLIT(v467, "prim-i16-get", 12); int64_t v468 = 0LL; - VAL v469 = (mw_mirth_prim_defZ_primZBang(v465, v466, MKSTR(v467), v468)); + VAL v469 = mw_mirth_prim_defZ_primZBang(v465, v466, MKSTR(v467), v468); int64_t v470 = 94LL /* PRIM_I16_SET */; STR* v471; STRLIT(v471, "prim-i16-set", 12); int64_t v472 = 0LL; - VAL v473 = (mw_mirth_prim_defZ_primZBang(v469, v470, MKSTR(v471), v472)); + VAL v473 = mw_mirth_prim_defZ_primZBang(v469, v470, MKSTR(v471), v472); int64_t v474 = 86LL /* PRIM_I32_GET */; STR* v475; STRLIT(v475, "prim-i32-get", 12); int64_t v476 = 0LL; - VAL v477 = (mw_mirth_prim_defZ_primZBang(v473, v474, MKSTR(v475), v476)); + VAL v477 = mw_mirth_prim_defZ_primZBang(v473, v474, MKSTR(v475), v476); int64_t v478 = 95LL /* PRIM_I32_SET */; STR* v479; STRLIT(v479, "prim-i32-set", 12); int64_t v480 = 0LL; - VAL v481 = (mw_mirth_prim_defZ_primZBang(v477, v478, MKSTR(v479), v480)); + VAL v481 = mw_mirth_prim_defZ_primZBang(v477, v478, MKSTR(v479), v480); int64_t v482 = 87LL /* PRIM_I64_GET */; STR* v483; STRLIT(v483, "prim-i64-get", 12); int64_t v484 = 0LL; - VAL v485 = (mw_mirth_prim_defZ_primZBang(v481, v482, MKSTR(v483), v484)); + VAL v485 = mw_mirth_prim_defZ_primZBang(v481, v482, MKSTR(v483), v484); int64_t v486 = 96LL /* PRIM_I64_SET */; STR* v487; STRLIT(v487, "prim-i64-set", 12); int64_t v488 = 0LL; - VAL v489 = (mw_mirth_prim_defZ_primZBang(v485, v486, MKSTR(v487), v488)); + VAL v489 = mw_mirth_prim_defZ_primZBang(v485, v486, MKSTR(v487), v488); int64_t v490 = 98LL /* PRIM_SYS_OS */; STR* v491; STRLIT(v491, "prim-sys-os", 11); int64_t v492 = 0LL; - VAL v493 = (mw_mirth_prim_defZ_primZBang(v489, v490, MKSTR(v491), v492)); + VAL v493 = mw_mirth_prim_defZ_primZBang(v489, v490, MKSTR(v491), v492); int64_t v494 = 99LL /* PRIM_SYS_ARCH */; STR* v495; STRLIT(v495, "prim-sys-arch", 13); int64_t v496 = 0LL; - VAL v497 = (mw_mirth_prim_defZ_primZBang(v493, v494, MKSTR(v495), v496)); + VAL v497 = mw_mirth_prim_defZ_primZBang(v493, v494, MKSTR(v495), v496); int64_t v498 = 100LL /* PRIM_SYS_ARGC */; STR* v499; STRLIT(v499, "prim-sys-argc", 13); int64_t v500 = 0LL; - VAL v501 = (mw_mirth_prim_defZ_primZBang(v497, v498, MKSTR(v499), v500)); + VAL v501 = mw_mirth_prim_defZ_primZBang(v497, v498, MKSTR(v499), v500); int64_t v502 = 101LL /* PRIM_SYS_ARGV */; STR* v503; STRLIT(v503, "prim-sys-argv", 13); int64_t v504 = 0LL; - VAL v505 = (mw_mirth_prim_defZ_primZBang(v501, v502, MKSTR(v503), v504)); + VAL v505 = mw_mirth_prim_defZ_primZBang(v501, v502, MKSTR(v503), v504); VAL v506 = mw_mirth_var_Ctx0(); VAL v507 = mw_mirth_type_T0(); VAL v508 = mw_mirth_type_T0(); @@ -33139,8 +25896,11 @@ static int64_t mw_mirth_token_Token_hasZ_argsZAsk (uint64_t x1) { x3 = x1; } VAL v5 = mw_mirth_token_Token_lparenZ_orZ_lcolonZAsk(x3); - int64_t v6 = mw_std_maybe_Maybe_1_ZToBool(v5); - return v6; + int64_t v6 = get_data_tag(v5); + decref(v5); + int64_t v7 = 1LL; + bool v8 = (v6 == v7); + return ((int64_t)v8); } static uint64_t mw_mirth_token_Token_argsZ_start (uint64_t x1) { int64_t v2 = mw_mirth_token_Token_canZ_takeZ_argsZAsk(x1); @@ -33149,57 +25909,60 @@ static uint64_t mw_mirth_token_Token_argsZ_start (uint64_t x1) { if (((bool)v2)) { uint64_t v5 = mw_mirth_token_Token_succ(x1); VAL v6 = mw_mirth_token_Token_lparenZ_orZ_lcolonZAsk(v5); - int64_t v7 = mw_std_maybe_Maybe_1_ZToBool(v6); - x4 = v7; + int64_t v7 = get_data_tag(v6); + decref(v6); + int64_t v8 = 1LL; + bool v9 = (v7 == v8); + x4 = ((int64_t)v9); x3 = x1; } else { - int64_t v8 = 0LL /* False */; - x4 = v8; + int64_t v10 = 0LL /* False */; + x4 = v10; x3 = x1; } - uint64_t x9; + uint64_t x11; if (((bool)x4)) { - uint64_t v10 = mw_mirth_token_Token_succ(x3); - x9 = v10; + uint64_t v12 = mw_mirth_token_Token_succ(x3); + x11 = v12; } else { - x9 = x3; + x11 = x3; } - return x9; + return x11; } static int64_t mw_mirth_token_Token_couldZ_beZ_sigZ_labelZAsk (uint64_t x1) { VAL v2 = mw_mirth_token_Token_nameZAsk(x1); - uint64_t x3; - int64_t x4; + int64_t x3; switch (get_data_tag(v2)) { case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v2); - int64_t v6 = mw_mirth_name_Name_couldZ_beZ_labelZ_nameZAsk(VU64(v5)); - x4 = v6; - x3 = x1; + VAL v4 = mtp_std_maybe_Maybe_1_Some(v2); + int64_t v5 = mw_mirth_name_Name_couldZ_beZ_labelZ_nameZAsk(VU64(v4)); + x3 = v5; } break; case 0LL: { // None - int64_t v7 = 0LL /* False */; - x4 = v7; - x3 = x1; + int64_t v6 = 0LL /* False */; + x3 = v6; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t x8; - int64_t x9; - if (((bool)x4)) { - uint64_t v10 = mw_mirth_token_Token_succ(x3); - VAL v11 = mw_mirth_token_Token_lcolonZAsk(v10); - int64_t v12 = mw_std_maybe_Maybe_1_ZToBool(v11); - x9 = v12; - x8 = x3; + uint64_t x7; + int64_t x8; + if (((bool)x3)) { + uint64_t v9 = mw_mirth_token_Token_succ(x1); + VAL v10 = mw_mirth_token_Token_lcolonZAsk(v9); + int64_t v11 = get_data_tag(v10); + decref(v10); + int64_t v12 = 1LL; + bool v13 = (v11 == v12); + x8 = ((int64_t)v13); + x7 = x1; } else { - int64_t v13 = 0LL /* False */; - x9 = v13; - x8 = x3; + int64_t v14 = 0LL /* False */; + x8 = v14; + x7 = x1; } - return x9; + return x8; } static VAL mw_mirth_token_Token_sigZ_labelZAsk (uint64_t x1) { VAL v2 = mw_mirth_token_Token_nameZAsk(x1); @@ -33215,58 +25978,58 @@ static VAL mw_mirth_token_Token_sigZ_labelZAsk (uint64_t x1) { if (((bool)v6)) { uint64_t v9 = mw_mirth_token_Token_succ(x1); VAL v10 = mw_mirth_token_Token_lcolonZAsk(v9); - int64_t v11 = mw_std_maybe_Maybe_1_ZToBool(v10); - x8 = v11; + int64_t v11 = get_data_tag(v10); + decref(v10); + int64_t v12 = 1LL; + bool v13 = (v11 == v12); + x8 = ((int64_t)v13); x7 = x1; } else { - int64_t v12 = 0LL /* False */; - x8 = v12; + int64_t v14 = 0LL /* False */; + x8 = v14; x7 = x1; } - uint64_t x13; - VAL x14; + uint64_t x15; + VAL x16; if (((bool)x8)) { - VAL v15 = mtw_std_maybe_Maybe_1_Some(v5); - x14 = v15; - x13 = x7; + VAL v17 = mtw_std_maybe_Maybe_1_Some(v5); + x16 = v17; + x15 = x7; } else { decref(v5); - VAL v16 = MKI64(0LL /* None */); - x14 = v16; - x13 = x7; + VAL v18 = MKI64(0LL /* None */); + x16 = v18; + x15 = x7; } - x4 = x14; - x3 = x13; + x4 = x16; + x3 = x15; } break; case 0LL: { // None - VAL v17 = MKI64(0LL /* None */); - x4 = v17; + VAL v19 = MKI64(0LL /* None */); + x4 = v19; x3 = x1; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t x18; - VAL x19; + VAL x20; switch (get_data_tag(x4)) { case 1LL: { // Some - VAL v20 = mtp_std_maybe_Maybe_1_Some(x4); - uint64_t v21 = mw_mirth_label_Label_newZBang(VU64(v20)); - VAL v22 = mtw_std_maybe_Maybe_1_Some(MKU64(v21)); - x19 = v22; - x18 = x3; + VAL v21 = mtp_std_maybe_Maybe_1_Some(x4); + uint64_t v22 = mw_mirth_label_Label_newZBang(VU64(v21)); + VAL v23 = mtw_std_maybe_Maybe_1_Some(MKU64(v22)); + x20 = v23; } break; case 0LL: { // None - VAL v23 = MKI64(0LL /* None */); - x19 = v23; - x18 = x3; + VAL v24 = MKI64(0LL /* None */); + x20 = v24; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - return x19; + return x20; } static VAL mw_mirth_token_Token_patternZ_varZAsk (uint64_t x1) { VAL v2 = mw_mirth_token_Token_nameZAsk(x1); @@ -33299,22 +26062,28 @@ static VAL mw_mirth_token_Token_patternZ_varZAsk (uint64_t x1) { } static VAL mw_mirth_token_Token_patternZ_autoZ_runZ_varZAsk (uint64_t x1) { VAL v2 = mw_mirth_token_Token_lsquareZAsk(x1); - int64_t v3 = mw_std_maybe_Maybe_1_ZToBool(v2); - uint64_t v4 = mw_mirth_token_Token_succ(x1); - uint64_t v5 = mw_mirth_token_Token_succ(v4); - VAL v6 = mw_mirth_token_Token_rsquareZAsk(v5); - int64_t v7 = mw_std_maybe_Maybe_1_ZToBool(v6); - bool v8 = (((bool)v3) && ((bool)v7)); - VAL x9; - if (v8) { - uint64_t v10 = mw_mirth_token_Token_succ(x1); - VAL v11 = mw_mirth_token_Token_patternZ_varZAsk(v10); - x9 = v11; + int64_t v3 = get_data_tag(v2); + decref(v2); + int64_t v4 = 1LL; + bool v5 = (v3 == v4); + uint64_t v6 = mw_mirth_token_Token_succ(x1); + uint64_t v7 = mw_mirth_token_Token_succ(v6); + VAL v8 = mw_mirth_token_Token_rsquareZAsk(v7); + int64_t v9 = get_data_tag(v8); + decref(v8); + int64_t v10 = 1LL; + bool v11 = (v9 == v10); + bool v12 = (v5 && v11); + VAL x13; + if (v12) { + uint64_t v14 = mw_mirth_token_Token_succ(x1); + VAL v15 = mw_mirth_token_Token_patternZ_varZAsk(v14); + x13 = v15; } else { - VAL v12 = MKI64(0LL /* None */); - x9 = v12; + VAL v16 = MKI64(0LL /* None */); + x13 = v16; } - return x9; + return x13; } static VAL mw_mirth_token_Token_argsZ_0 (uint64_t x1, VAL x2) { int64_t v3 = mw_mirth_token_Token_numZ_args(x1); @@ -33327,8 +26096,6 @@ static VAL mw_mirth_token_Token_argsZ_0 (uint64_t x1, VAL x2) { STR* v7; STRLIT(v7, "expected no args", 16); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v7), x2); - VAL r8 = pop_resource(); - x6 = r8; } return x6; } @@ -33353,21 +26120,11 @@ static void mw_mirth_token_Token_argsZ_1 (uint64_t x1, VAL x2, uint64_t *x3, VAL STR* v17; STRLIT(v17, "expected 1 arg, got none", 24); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v17), x2); - uint64_t v18 = pop_u64(); - x16 = v18; - VAL r19 = pop_resource(); - x15 = r19; } else { STR* v20; STRLIT(v20, "expected 1 arg, got too many", 28); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v20), x2); - uint64_t v21 = pop_u64(); - x16 = v21; - VAL r22 = pop_resource(); - x15 = r22; } - x9 = x16; - x8 = x15; } *x4 = x8; *x3 = x9; @@ -33398,26 +26155,11 @@ static void mw_mirth_token_Token_argsZ_2 (uint64_t x1, VAL x2, uint64_t *x3, uin STR* v22; STRLIT(v22, "expected 2 args, got too few", 28); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v22), x2); - uint64_t v23 = pop_u64(); - x21 = v23; - uint64_t v24 = pop_u64(); - x20 = v24; - VAL r25 = pop_resource(); - x19 = r25; } else { STR* v26; STRLIT(v26, "expected 2 args, got too many", 29); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v26), x2); - uint64_t v27 = pop_u64(); - x21 = v27; - uint64_t v28 = pop_u64(); - x20 = v28; - VAL r29 = pop_resource(); - x19 = r29; } - x11 = x21; - x10 = x20; - x9 = x19; } *x5 = x9; *x4 = x11; @@ -33454,31 +26196,11 @@ static void mw_mirth_token_Token_argsZ_3 (uint64_t x1, VAL x2, uint64_t *x3, uin STR* v27; STRLIT(v27, "expected 3 args, got too few", 28); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v27), x2); - uint64_t v28 = pop_u64(); - x26 = v28; - uint64_t v29 = pop_u64(); - x25 = v29; - uint64_t v30 = pop_u64(); - x24 = v30; - VAL r31 = pop_resource(); - x23 = r31; } else { STR* v32; STRLIT(v32, "expected 3 args, got too many", 29); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v32), x2); - uint64_t v33 = pop_u64(); - x26 = v33; - uint64_t v34 = pop_u64(); - x25 = v34; - uint64_t v35 = pop_u64(); - x24 = v35; - VAL r36 = pop_resource(); - x23 = r36; - } - x13 = x26; - x12 = x25; - x11 = x24; - x10 = x23; + } } *x6 = x10; *x5 = x13; @@ -33526,11 +26248,11 @@ static VAL mw_mirth_token_Token_args (uint64_t x1) { int64_t v7 = mw_mirth_token_Token_argsZ_endZAsk(v2); bool v8 = !((bool)v7); uint64_t v9 = v2; - VAL v10 = (v6); + VAL v10 = v6; bool v11 = v8; while (v11) { uint64_t v12 = v9; - VAL v13 = (v10); + VAL v13 = v10; uint64_t v14 = mw_mirth_token_Token_succ(v12); uint64_t v15 = mw_mirth_token_Token_nextZ_argZ_end(v14); VAL v16 = mtw_std_list_List_1_Cons(MKU64(v14), v13); @@ -33563,32 +26285,26 @@ static int64_t mw_mirth_token_Token_argsZ_endZAsk (uint64_t x1) { static void mw_mirth_token_Token_argsZPlus (uint64_t x1, VAL x2, VAL *x3, VAL *x4) { VAL v5 = mw_mirth_token_Token_args(x1); VAL v6 = mw_std_list_List_1_ZToListZPlus(v5); - VAL x7; - uint64_t x8; + uint64_t x7; + VAL x8; VAL x9; switch (get_data_tag(v6)) { case 1LL: { // Some VAL v10 = mtp_std_maybe_Maybe_1_Some(v6); x9 = v10; - x8 = x1; - x7 = x2; + x8 = x2; + x7 = x1; } break; case 0LL: { // None STR* v11; STRLIT(v11, "expected 1 or more args, got none", 33); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v11), x2); - VAL v12 = pop_value(); - x9 = v12; - uint64_t v13 = pop_u64(); - x8 = v13; - VAL r14 = pop_resource(); - x7 = r14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x4 = x7; + *x4 = x8; *x3 = x9; } static int64_t mw_mirth_token_Token_moduleZ_endZAsk (uint64_t x1) { @@ -33641,11 +26357,11 @@ static VAL mw_mirth_token_Token_runZ_tokens (uint64_t x1) { int64_t v4 = mw_mirth_token_Token_runZ_endZAsk(x1); bool v5 = !((bool)v4); uint64_t v6 = x1; - VAL v7 = (v3); + VAL v7 = v3; bool v8 = v5; while (v8) { uint64_t v9 = v6; - VAL v10 = (v7); + VAL v10 = v7; uint64_t v11 = mw_mirth_token_Token_next(v9); VAL v12 = mtw_std_list_List_1_Cons(MKU64(v9), v10); int64_t v13 = mw_mirth_token_Token_runZ_endZAsk(v11); @@ -33681,118 +26397,72 @@ static int64_t mw_mirth_token_Token_runZ_length (uint64_t x1) { static VAL mw_mirth_token_Token_runZ_arrowZAsk (uint64_t x1) { VAL v2 = mw_mirth_token_Token_runZ_tokens(x1); VAL v3 = MKI64(0LL /* None */); - VAL v4; - VAL v5; - mw_std_list_List_1_uncons(v2, &v4, &v5); - VAL x6; - VAL x7; - int64_t x8; - switch (get_data_tag(v4)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v4); - incref(v9); - int64_t v10 = mw_mirth_token_Token_arrowZAsk(VU64(v9)); - VAL x11; - if (((bool)v10)) { - VAL v12 = mtw_std_maybe_Maybe_1_Some(v9); - x11 = v12; - } else { - decref(v9); - VAL v13 = MKI64(0LL /* None */); - x11 = v13; - } - VAL x14; - VAL x15; - switch (get_data_tag(x11)) { - case 0LL: { // None - x15 = v5; - x14 = v3; - } break; - default: { - decref(v5); - decref(v3); - VAL v16 = MKI64(0LL /* Nil */); - x15 = v16; - x14 = x11; - } break; - } - int64_t v17 = 1LL /* True */; - x8 = v17; - x7 = x15; - x6 = x14; - } break; - case 0LL: { // None - int64_t v18 = 0LL /* False */; - x8 = v18; - x7 = v5; - x6 = v3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v19 = x6; - VAL v20 = x7; - int64_t v21 = x8; - while (((bool)v21)) { - VAL v22 = v19; - VAL v23 = v20; - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v23, &v24, &v25); - VAL x26; - VAL x27; - int64_t x28; - switch (get_data_tag(v24)) { + int64_t v4 = 1LL /* True */; + VAL v5 = v3; + VAL v6 = v2; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL v12; + VAL v13; + mw_std_list_List_1_uncons(v10, &v12, &v13); + VAL x14; + VAL x15; + int64_t x16; + switch (get_data_tag(v12)) { case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v24); - incref(v29); - int64_t v30 = mw_mirth_token_Token_arrowZAsk(VU64(v29)); - VAL x31; - if (((bool)v30)) { - VAL v32 = mtw_std_maybe_Maybe_1_Some(v29); - x31 = v32; + VAL v17 = mtp_std_maybe_Maybe_1_Some(v12); + incref(v17); + int64_t v18 = mw_mirth_token_Token_arrowZAsk(VU64(v17)); + VAL x19; + if (((bool)v18)) { + VAL v20 = mtw_std_maybe_Maybe_1_Some(v17); + x19 = v20; } else { - decref(v29); - VAL v33 = MKI64(0LL /* None */); - x31 = v33; + decref(v17); + VAL v21 = MKI64(0LL /* None */); + x19 = v21; } - VAL x34; - VAL x35; - switch (get_data_tag(x31)) { + VAL x22; + VAL x23; + switch (get_data_tag(x19)) { case 0LL: { // None - x35 = v25; - x34 = v22; + x23 = v13; + x22 = v9; } break; default: { - decref(v25); - decref(v22); - VAL v36 = MKI64(0LL /* Nil */); - x35 = v36; - x34 = x31; + decref(v13); + decref(v9); + VAL v24 = MKI64(0LL /* Nil */); + x23 = v24; + x22 = x19; } break; } - int64_t v37 = 1LL /* True */; - x28 = v37; - x27 = x35; - x26 = x34; + int64_t v25 = 1LL /* True */; + x16 = v25; + x15 = x23; + x14 = x22; } break; case 0LL: { // None - int64_t v38 = 0LL /* False */; - x28 = v38; - x27 = v25; - x26 = v22; + int64_t v26 = 0LL /* False */; + x16 = v26; + x15 = v13; + x14 = v9; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v21 = x28; - v20 = x27; - v19 = x26; + v8 = x16; + v7 = x16; + v6 = x15; + v5 = x14; } - decref(v20); - return v19; + decref(v6); + return v5; } static int64_t mw_mirth_token_Token_sigZ_stackZ_endZAsk (uint64_t x1) { int64_t v2 = mw_mirth_token_Token_sigZ_dashesZAsk(x1); @@ -33833,121 +26503,71 @@ static VAL mw_mirth_token_Token_patZ_tokens (uint64_t x1) { VAL v2 = mw_mirth_token_Token_runZ_tokens(x1); VAL v3 = MKI64(0LL /* Nil */); VAL v4 = mw_std_list_List_1_reverse(v3); - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(v2, &v5, &v6); - VAL x7; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v5); - incref(v8); - int64_t v9 = mw_mirth_token_Token_arrowZAsk(VU64(v8)); - bool v10 = !((bool)v9); - VAL x11; - if (v10) { - VAL v12 = mtw_std_maybe_Maybe_1_Some(v8); - x11 = v12; - } else { - decref(v8); - VAL v13 = MKI64(0LL /* None */); - x11 = v13; - } - x7 = x11; - } break; - case 0LL: { // None - VAL v14 = MKI64(0LL /* None */); - x7 = v14; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x15; - VAL x16; - int64_t x17; - switch (get_data_tag(x7)) { - case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(x7); - VAL v19 = mtw_std_list_List_1_Cons(v18, v4); - int64_t v20 = 1LL /* True */; - x17 = v20; - x16 = v19; - x15 = v6; - } break; - case 0LL: { // None - int64_t v21 = 0LL /* False */; - x17 = v21; - x16 = v4; - x15 = v6; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v22 = x15; - VAL v23 = (x16); - int64_t v24 = x17; - while (((bool)v24)) { - VAL v25 = v22; - VAL v26 = (v23); - VAL v27; - VAL v28; - mw_std_list_List_1_uncons(v25, &v27, &v28); - VAL x29; - switch (get_data_tag(v27)) { + int64_t v5 = 1LL /* True */; + VAL v6 = v2; + VAL v7 = v4; + int64_t v8 = v5; + int64_t v9 = v5; + while (((bool)v9)) { + VAL v10 = v6; + VAL v11 = v7; + int64_t v12 = v8; + VAL v13; + VAL v14; + mw_std_list_List_1_uncons(v10, &v13, &v14); + VAL x15; + switch (get_data_tag(v13)) { case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v27); - incref(v30); - int64_t v31 = mw_mirth_token_Token_arrowZAsk(VU64(v30)); - bool v32 = !((bool)v31); - VAL x33; - if (v32) { - VAL v34 = mtw_std_maybe_Maybe_1_Some(v30); - x33 = v34; + VAL v16 = mtp_std_maybe_Maybe_1_Some(v13); + incref(v16); + int64_t v17 = mw_mirth_token_Token_arrowZAsk(VU64(v16)); + bool v18 = !((bool)v17); + VAL x19; + if (v18) { + VAL v20 = mtw_std_maybe_Maybe_1_Some(v16); + x19 = v20; } else { - decref(v30); - VAL v35 = MKI64(0LL /* None */); - x33 = v35; + decref(v16); + VAL v21 = MKI64(0LL /* None */); + x19 = v21; } - x29 = x33; + x15 = x19; } break; case 0LL: { // None - VAL v36 = MKI64(0LL /* None */); - x29 = v36; + VAL v22 = MKI64(0LL /* None */); + x15 = v22; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x37; - VAL x38; - int64_t x39; - switch (get_data_tag(x29)) { + VAL x23; + int64_t x24; + switch (get_data_tag(x15)) { case 1LL: { // Some - VAL v40 = mtp_std_maybe_Maybe_1_Some(x29); - VAL v41 = mtw_std_list_List_1_Cons(v40, v26); - int64_t v42 = 1LL /* True */; - x39 = v42; - x38 = v41; - x37 = v28; + VAL v25 = mtp_std_maybe_Maybe_1_Some(x15); + VAL v26 = mtw_std_list_List_1_Cons(v25, v11); + int64_t v27 = 1LL /* True */; + x24 = v27; + x23 = v26; } break; case 0LL: { // None - int64_t v43 = 0LL /* False */; - x39 = v43; - x38 = v26; - x37 = v28; + int64_t v28 = 0LL /* False */; + x24 = v28; + x23 = v11; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v24 = x39; - v23 = x38; - v22 = x37; + v9 = x24; + v8 = x24; + v7 = x23; + v6 = v14; } - VAL v44 = mw_std_list_List_1_reverse(v23); - decref(v22); - return v44; + VAL v29 = mw_std_list_List_1_reverse(v7); + decref(v6); + return v29; } static int64_t mw_mirth_module_Module_index (uint64_t x1) { return ((int64_t)x1); @@ -34064,140 +26684,88 @@ static int64_t mw_mirth_module_Module_visible (uint64_t x1, uint64_t x2) { } else { VAL v6 = mw_mirth_module_Module_imports(x2); VAL v7 = MKI64(0LL /* None */); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v6, &v8, &v9); - uint64_t x10; - VAL x11; - VAL x12; - int64_t x13; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v8); - incref(v14); - int64_t v15 = mw_mirth_module_Module_ZEqualZEqual(x1, VU64(v14)); - uint64_t x16; - VAL x17; - if (((bool)v15)) { - VAL v18 = mtw_std_maybe_Maybe_1_Some(v14); - x17 = v18; - x16 = x1; - } else { - decref(v14); - VAL v19 = MKI64(0LL /* None */); - x17 = v19; - x16 = x1; - } - uint64_t x20; - VAL x21; - VAL x22; - switch (get_data_tag(x17)) { - case 0LL: { // None - x22 = v9; - x21 = v7; - x20 = x16; - } break; - default: { - decref(v9); - decref(v7); - VAL v23 = MKI64(0LL /* Nil */); - x22 = v23; - x21 = x17; - x20 = x16; - } break; - } - int64_t v24 = 1LL /* True */; - x13 = v24; - x12 = x22; - x11 = x21; - x10 = x20; - } break; - case 0LL: { // None - int64_t v25 = 0LL /* False */; - x13 = v25; - x12 = v9; - x11 = v7; - x10 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v26 = x10; - VAL v27 = x11; - VAL v28 = x12; - int64_t v29 = x13; - while (((bool)v29)) { - uint64_t v30 = v26; - VAL v31 = v27; - VAL v32 = v28; - VAL v33; - VAL v34; - mw_std_list_List_1_uncons(v32, &v33, &v34); - uint64_t x35; - VAL x36; - VAL x37; - int64_t x38; - switch (get_data_tag(v33)) { + int64_t v8 = 1LL /* True */; + uint64_t v9 = x1; + VAL v10 = v7; + VAL v11 = v6; + int64_t v12 = v8; + int64_t v13 = v8; + while (((bool)v13)) { + uint64_t v14 = v9; + VAL v15 = v10; + VAL v16 = v11; + int64_t v17 = v12; + VAL v18; + VAL v19; + mw_std_list_List_1_uncons(v16, &v18, &v19); + uint64_t x20; + VAL x21; + VAL x22; + int64_t x23; + switch (get_data_tag(v18)) { case 1LL: { // Some - VAL v39 = mtp_std_maybe_Maybe_1_Some(v33); - incref(v39); - int64_t v40 = mw_mirth_module_Module_ZEqualZEqual(v30, VU64(v39)); - uint64_t x41; - VAL x42; - if (((bool)v40)) { - VAL v43 = mtw_std_maybe_Maybe_1_Some(v39); - x42 = v43; - x41 = v30; + VAL v24 = mtp_std_maybe_Maybe_1_Some(v18); + incref(v24); + int64_t v25 = mw_mirth_module_Module_ZEqualZEqual(v14, VU64(v24)); + uint64_t x26; + VAL x27; + if (((bool)v25)) { + VAL v28 = mtw_std_maybe_Maybe_1_Some(v24); + x27 = v28; + x26 = v14; } else { - decref(v39); - VAL v44 = MKI64(0LL /* None */); - x42 = v44; - x41 = v30; + decref(v24); + VAL v29 = MKI64(0LL /* None */); + x27 = v29; + x26 = v14; } - uint64_t x45; - VAL x46; - VAL x47; - switch (get_data_tag(x42)) { + uint64_t x30; + VAL x31; + VAL x32; + switch (get_data_tag(x27)) { case 0LL: { // None - x47 = v34; - x46 = v31; - x45 = x41; + x32 = v19; + x31 = v15; + x30 = x26; } break; default: { - decref(v34); - decref(v31); - VAL v48 = MKI64(0LL /* Nil */); - x47 = v48; - x46 = x42; - x45 = x41; + decref(v19); + decref(v15); + VAL v33 = MKI64(0LL /* Nil */); + x32 = v33; + x31 = x27; + x30 = x26; } break; } - int64_t v49 = 1LL /* True */; - x38 = v49; - x37 = x47; - x36 = x46; - x35 = x45; + int64_t v34 = 1LL /* True */; + x23 = v34; + x22 = x32; + x21 = x31; + x20 = x30; } break; case 0LL: { // None - int64_t v50 = 0LL /* False */; - x38 = v50; - x37 = v34; - x36 = v31; - x35 = v30; + int64_t v35 = 0LL /* False */; + x23 = v35; + x22 = v19; + x21 = v15; + x20 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v29 = x38; - v28 = x37; - v27 = x36; - v26 = x35; + v13 = x23; + v12 = x23; + v11 = x22; + v10 = x21; + v9 = x20; } - decref(v28); - int64_t v51 = mw_std_maybe_Maybe_1_someZAsk(v27); - x4 = v51; + decref(v11); + int64_t v36 = get_data_tag(v10); + decref(v10); + int64_t v37 = 1LL; + bool v38 = (v36 == v37); + x4 = ((int64_t)v38); } return x4; } @@ -34209,7 +26777,7 @@ static int64_t mw_mirth_location_Row_ZToInt (int64_t x1) { } static VAL mw_mirth_location_Row_showZThen (VAL x1, int64_t x2) { STR* v3 = i64_show(x2); - VAL v4 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v3), x1)); + VAL v4 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v3), x1); return v4; } static int64_t mw_std_prim_Int_ZToCol (int64_t x1) { @@ -34220,7 +26788,7 @@ static int64_t mw_mirth_location_Col_ZToInt (int64_t x1) { } static VAL mw_mirth_location_Col_showZThen (VAL x1, int64_t x2) { STR* v3 = i64_show(x2); - VAL v4 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v3), x1)); + VAL v4 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v3), x1); return v4; } static VAL mw_mirth_location_Location_emitZThen (VAL x1, VAL x2) { @@ -34229,15 +26797,15 @@ static VAL mw_mirth_location_Location_emitZThen (VAL x1, VAL x2) { int64_t v5; mtp_mirth_location_Location_Location(x2, &v3, &v4, &v5); VAL v6 = mw_mirth_module_Module_sourceZ_path(v3); - VAL v7 = (mw_std_str_ZPlusStr_pushZ_strZBang(v6, x1)); + VAL v7 = mw_std_str_ZPlusStr_pushZ_strZBang(v6, x1); STR* v8; STRLIT(v8, ":", 1); - VAL v9 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), v7)); - VAL v10 = (mw_mirth_location_Row_showZThen(v9, v4)); + VAL v9 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), v7); + VAL v10 = mw_mirth_location_Row_showZThen(v9, v4); STR* v11; STRLIT(v11, ":", 1); - VAL v12 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10)); - VAL v13 = (mw_mirth_location_Col_showZThen(v12, v5)); + VAL v12 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10); + VAL v13 = mw_mirth_location_Col_showZThen(v12, v5); return v13; } static int64_t mw_mirth_alias_Alias_index (uint64_t x1) { @@ -34255,22 +26823,8 @@ static uint64_t mw_mirth_alias_Alias_allocZBang (void) { static VAL mw_mirth_alias_Alias_qnameZ_soft (uint64_t x1) { void* v2 = mfld_mirth_alias_Alias_ZTildeqname(x1); VAL v3 = mw_std_prelude_ZAtZAsk(v2); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v6 = mw_mirth_mirth_Prop_1_readyZAsk(v5); - x4 = v6; - } break; - case 0LL: { // None - VAL v7 = MKI64(0LL /* None */); - x4 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x4; + VAL v4 = mw_std_maybe_Maybe_1_bind_1_sp5(v3); + return v4; } static void mw_mirth_alias_Alias_qnameZ_hard (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { void* v5 = mfld_mirth_alias_Alias_ZTildeqname(x2); @@ -34323,7 +26877,7 @@ static void mw_mirth_alias_Alias_newZBang (VAL x1, uint64_t x2, uint64_t x3, int void* v10 = mfld_mirth_alias_Alias_ZTildearity(v7); mut_set(MKI64(x4), v10); VAL v11 = mtw_mirth_def_Def_DefAlias(v7); - VAL v12 = (mw_mirth_def_Def_register(x1, v11)); + VAL v12 = mw_mirth_def_Def_register(x1, v11); *x6 = v7; *x5 = v12; } @@ -34402,11 +26956,11 @@ static VAL mw_mirth_mirth_ZPlusMirth_InitZBang (void) { VAL v7 = MKI64(0LL /* Nil */); VAL v8 = MKI64(0LL /* Nil */); VAL v9 = MKI64(0LL /* None */); - VAL v10 = (mtw_mirth_mirth_ZPlusMirth_ZPlusMirth(v1, v2, v3, v4, v9, v5, v6, v7, v8)); - VAL v11 = (mw_mirth_package_initZ_packagesZBang(v10)); - VAL v12 = (mw_mirth_module_initZ_modulesZBang(v11)); - VAL v13 = (mw_mirth_mirth_ZPlusMirth_initZ_typesZBang(v12)); - VAL v14 = (mw_mirth_prim_initZ_primsZBang(v13)); + VAL v10 = mtw_mirth_mirth_ZPlusMirth_ZPlusMirth(v1, v2, v3, v4, v9, v5, v6, v7, v8); + VAL v11 = mw_mirth_package_initZ_packagesZBang(v10); + VAL v12 = mw_mirth_module_initZ_modulesZBang(v11); + VAL v13 = mw_mirth_mirth_ZPlusMirth_initZ_typesZBang(v12); + VAL v14 = mw_mirth_prim_initZ_primsZBang(v13); return v14; } static void mw_mirth_mirth_ZPlusMirth_rdrop (VAL x1) { @@ -34433,28 +26987,25 @@ static void mw_mirth_mirth_ZPlusMirth_mirthZ_baseZ_libZ_path (VAL x1, VAL *x2, V VAL v4 = VVAL(VTUP(x1)->cells[6]); incref(v4); VAL x5; - VAL x6; switch (get_data_tag(v4)) { case 1LL: { // Some - VAL v7 = mtp_std_maybe_Maybe_1_Some(v4); - STR* v8; - STRLIT(v8, "lib", 3); - VAL v9 = mw_std_path_Path_join(v7, MKSTR(v8)); - VAL v10 = mtw_std_maybe_Maybe_1_Some(v9); - x6 = v10; - x5 = x1; + VAL v6 = mtp_std_maybe_Maybe_1_Some(v4); + STR* v7; + STRLIT(v7, "lib", 3); + VAL v8 = mw_std_path_Path_join(v6, MKSTR(v7)); + VAL v9 = mtw_std_maybe_Maybe_1_Some(v8); + x5 = v9; } break; case 0LL: { // None - VAL v11 = MKI64(0LL /* None */); - x6 = v11; - x5 = x1; + VAL v10 = MKI64(0LL /* None */); + x5 = v10; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x3 = x6; - *x2 = x5; + *x3 = x5; + *x2 = x1; } static VAL mw_mirth_mirth_Severity_ZToStr (int64_t x1) { VAL x2; @@ -34517,43 +27068,43 @@ static VAL mw_mirth_mirth_ZPlusMirth_emitZ_diagnosticZ_atZBang (VAL x1, VAL x2, } } VAL v15 = mtw_mirth_mirth_Diagnostic_Diagnostic(x8, x7, x6); - VAL v16 = (VVAL(VTUP(x5)->cells[8])); + VAL v16 = VVAL(VTUP(x5)->cells[8]); VAL v17 = mtw_std_list_List_1_Cons(v15, v16); VTUP(x5)->cells[8] = v17; return x5; } static VAL mw_mirth_mirth_ZPlusMirth_emitZ_infoZ_atZBang (VAL x1, VAL x2, VAL x3) { int64_t v4 = 0LL /* Info */; - VAL v5 = (mw_mirth_mirth_ZPlusMirth_emitZ_diagnosticZ_atZBang(x1, x2, v4, x3)); + VAL v5 = mw_mirth_mirth_ZPlusMirth_emitZ_diagnosticZ_atZBang(x1, x2, v4, x3); return v5; } static VAL mw_mirth_mirth_ZPlusMirth_emitZ_warningZ_atZBang (VAL x1, VAL x2, VAL x3) { int64_t v4 = 1LL /* Warning */; - VAL v5 = (mw_mirth_mirth_ZPlusMirth_emitZ_diagnosticZ_atZBang(x1, x2, v4, x3)); + VAL v5 = mw_mirth_mirth_ZPlusMirth_emitZ_diagnosticZ_atZBang(x1, x2, v4, x3); return v5; } static VAL mw_mirth_mirth_ZPlusMirth_emitZ_errorZ_atZBang (VAL x1, VAL x2, VAL x3) { int64_t v4 = 2LL /* Error */; - VAL v5 = (mw_mirth_mirth_ZPlusMirth_emitZ_diagnosticZ_atZBang(x1, x2, v4, x3)); + VAL v5 = mw_mirth_mirth_ZPlusMirth_emitZ_diagnosticZ_atZBang(x1, x2, v4, x3); return v5; } static void mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZ_atZBang (VAL x1, VAL x2, VAL x3) { - VAL v4 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZ_atZBang(x1, x2, x3)); + VAL v4 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZ_atZBang(x1, x2, x3); mw_mirth_mirth_ZPlusMirth_panicZ_diagnosticsZBang(v4); } static VAL mw_mirth_mirth_ZPlusMirth_emitZ_infoZBang (uint64_t x1, VAL x2, VAL x3) { VAL v4 = mw_mirth_token_Token_location(x1); - VAL v5 = (mw_mirth_mirth_ZPlusMirth_emitZ_infoZ_atZBang(v4, x2, x3)); + VAL v5 = mw_mirth_mirth_ZPlusMirth_emitZ_infoZ_atZBang(v4, x2, x3); return v5; } static VAL mw_mirth_mirth_ZPlusMirth_emitZ_warningZBang (uint64_t x1, VAL x2, VAL x3) { VAL v4 = mw_mirth_token_Token_location(x1); - VAL v5 = (mw_mirth_mirth_ZPlusMirth_emitZ_warningZ_atZBang(v4, x2, x3)); + VAL v5 = mw_mirth_mirth_ZPlusMirth_emitZ_warningZ_atZBang(v4, x2, x3); return v5; } static VAL mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang (uint64_t x1, VAL x2, VAL x3) { VAL v4 = mw_mirth_token_Token_location(x1); - VAL v5 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZ_atZBang(v4, x2, x3)); + VAL v5 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZ_atZBang(v4, x2, x3); return v5; } static void mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang (uint64_t x1, VAL x2, VAL x3) { @@ -34564,22 +27115,22 @@ static VAL mw_mirth_mirth_ZPlusMirth_emitZ_deprecatedZBang (uint64_t x1, VAL x2, STR* v5; STRLIT(v5, "", 0); VAL v6 = MKI64(36LL /* FGCyan */); - VAL v7 = (mw_std_terminal_Sgr_emitZThen(v6, MKSTR(v5))); - VAL v8 = (mw_std_str_ZPlusStr_pushZ_strZBang(x2, v7)); + VAL v7 = mw_std_terminal_Sgr_emitZThen(v6, MKSTR(v5)); + VAL v8 = mw_std_str_ZPlusStr_pushZ_strZBang(x2, v7); VAL v9 = MKI64(0LL /* Reset */); - VAL v10 = (mw_std_terminal_Sgr_emitZThen(v9, v8)); + VAL v10 = mw_std_terminal_Sgr_emitZThen(v9, v8); STR* v11; STRLIT(v11, " is deprecated, please use ", 27); - VAL v12 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10)); + VAL v12 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10); VAL v13 = MKI64(36LL /* FGCyan */); - VAL v14 = (mw_std_terminal_Sgr_emitZThen(v13, v12)); - VAL v15 = (mw_std_str_ZPlusStr_pushZ_strZBang(x3, v14)); + VAL v14 = mw_std_terminal_Sgr_emitZThen(v13, v12); + VAL v15 = mw_std_str_ZPlusStr_pushZ_strZBang(x3, v14); VAL v16 = MKI64(0LL /* Reset */); - VAL v17 = (mw_std_terminal_Sgr_emitZThen(v16, v15)); + VAL v17 = mw_std_terminal_Sgr_emitZThen(v16, v15); STR* v18; STRLIT(v18, " instead.", 9); - VAL v19 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), v17)); - VAL v20 = (mw_mirth_mirth_ZPlusMirth_emitZ_warningZBang(x1, v19, x4)); + VAL v19 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), v17); + VAL v20 = mw_mirth_mirth_ZPlusMirth_emitZ_warningZBang(x1, v19, x4); return v20; } static void mw_mirth_mirth_ZPlusMirth_defaultZ_errorZ_location (VAL x1, VAL *x2, VAL *x3) { @@ -34623,7 +27174,7 @@ static VAL mw_mirth_mirth_ZPlusMirth_errorZBang (VAL x1, VAL x2) { VAL v3; VAL v4; mw_mirth_mirth_ZPlusMirth_errorZ_location(x2, &v3, &v4); - VAL v5 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZ_atZBang(v4, x1, v3)); + VAL v5 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZ_atZBang(v4, x1, v3); return v5; } static void mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang (VAL x1, VAL x2) { @@ -34638,183 +27189,116 @@ static void mw_mirth_mirth_ZPlusMirth_panicZ_diagnosticsZBang (VAL x1) { mw_mirth_mirth_ZPlusMirth_popZ_diagnostics(x1, &v2, &v3); STR* v4; STRLIT(v4, "", 0); - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(v3, &v5, &v6); - VAL x7; - VAL x8; - VAL x9; - int64_t x10; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v5); - VAL v12 = (mw_mirth_mirth_Diagnostic_diagnosticZThen(MKSTR(v4), v11)); - STR* v13; - STRLIT(v13, "\n", 1); - VAL v14 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v13), v12)); - int64_t v15 = 1LL /* True */; - x10 = v15; - x9 = v6; - x8 = v14; - x7 = v2; - } break; - case 0LL: { // None - int64_t v16 = 0LL /* False */; - x10 = v16; - x9 = v6; - x8 = MKSTR(v4); - x7 = v2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v17 = (x7); - VAL v18 = (x8); - VAL v19 = x9; - int64_t v20 = x10; - while (((bool)v20)) { - VAL v21 = (v17); - VAL v22 = (v18); - VAL v23 = v19; - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v23, &v24, &v25); - VAL x26; - VAL x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v24)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v24); - VAL v31 = (mw_mirth_mirth_Diagnostic_diagnosticZThen(v22, v30)); - STR* v32; - STRLIT(v32, "\n", 1); - VAL v33 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v32), v31)); - int64_t v34 = 1LL /* True */; - x29 = v34; - x28 = v25; - x27 = v33; - x26 = v21; + int64_t v5 = 1LL /* True */; + STR* v6 = v4; + VAL v7 = v3; + int64_t v8 = v5; + int64_t v9 = v5; + while (((bool)v9)) { + STR* v10 = v6; + VAL v11 = v7; + int64_t v12 = v8; + VAL x13; + VAL x14; + int64_t x15; + switch (get_data_tag(v11)) { + case 1LL: { // Cons + VAL v16; + VAL v17; + mtp_std_list_List_1_Cons(v11, &v16, &v17); + VAL v18 = mw_mirth_mirth_Diagnostic_diagnosticZThen(MKSTR(v10), v16); + STR* v19; + STRLIT(v19, "\n", 1); + VAL v20 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v19), v18); + int64_t v21 = 1LL /* True */; + x15 = v21; + x14 = v17; + x13 = v20; } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x29 = v35; - x28 = v25; - x27 = v22; - x26 = v21; + case 0LL: { // Nil + VAL v22 = MKI64(0LL /* Nil */); + int64_t v23 = 0LL /* False */; + x15 = v23; + x14 = v22; + x13 = MKSTR(v10); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v20 = x29; - v19 = x28; - v18 = x27; - v17 = x26; + v9 = x15; + v8 = x15; + v7 = x14; + v6 = VSTR(x13); } - decref(v19); - VAL v36 = MKI64(31LL /* FGRed */); - VAL v37 = (mw_std_terminal_Sgr_emitZThen(v36, v18)); - STR* v38; - STRLIT(v38, "Fatal error. Stopping early.", 28); - VAL v39 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v38), v37)); - VAL v40 = MKI64(0LL /* Reset */); - VAL v41 = (mw_std_terminal_Sgr_emitZThen(v40, v39)); - push_resource(v17); - do_panic(VSTR(v41)); + decref(v7); + VAL v24 = MKI64(31LL /* FGRed */); + VAL v25 = mw_std_terminal_Sgr_emitZThen(v24, MKSTR(v6)); + STR* v26; + STRLIT(v26, "Fatal error. Stopping early.", 28); + VAL v27 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v26), v25); + VAL v28 = MKI64(0LL /* Reset */); + VAL v29 = mw_std_terminal_Sgr_emitZThen(v28, v27); + do_panic(VSTR(v29)); } static void mw_mirth_mirth_ZPlusMirth_traceZ_diagnosticsZBang (int64_t x1, VAL x2, int64_t *x3, VAL *x4) { VAL v5; VAL v6; mw_mirth_mirth_ZPlusMirth_popZ_diagnostics(x2, &v5, &v6); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v6, &v7, &v8); - int64_t x9; - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v7); - STR* v14; - STRLIT(v14, "", 0); - VAL v15 = (mw_mirth_mirth_Diagnostic_diagnosticZThen(MKSTR(v14), v13)); - STR* v16; - STRLIT(v16, "\n", 1); - STR* v17 = str_cat(VSTR(v15), v16); - int64_t v18 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v17), x1)); - int64_t v19 = 1LL /* True */; - x12 = v19; - x11 = v8; - x10 = v5; - x9 = v18; - } break; - case 0LL: { // None - int64_t v20 = 0LL /* False */; - x12 = v20; - x11 = v8; - x10 = v5; - x9 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v21 = (x9); - VAL v22 = (x10); - VAL v23 = x11; - int64_t v24 = x12; - while (((bool)v24)) { - int64_t v25 = (v21); - VAL v26 = (v22); - VAL v27 = v23; - VAL v28; - VAL v29; - mw_std_list_List_1_uncons(v27, &v28, &v29); - int64_t x30; - VAL x31; - VAL x32; - int64_t x33; - switch (get_data_tag(v28)) { - case 1LL: { // Some - VAL v34 = mtp_std_maybe_Maybe_1_Some(v28); - STR* v35; - STRLIT(v35, "", 0); - VAL v36 = (mw_mirth_mirth_Diagnostic_diagnosticZThen(MKSTR(v35), v34)); - STR* v37; - STRLIT(v37, "\n", 1); - STR* v38 = str_cat(VSTR(v36), v37); - int64_t v39 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v38), v25)); - int64_t v40 = 1LL /* True */; - x33 = v40; - x32 = v29; - x31 = v26; - x30 = v39; + int64_t v7 = 1LL /* True */; + int64_t v8 = x1; + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + int64_t v13 = v8; + VAL v14 = v9; + VAL v15 = v10; + int64_t v16 = v11; + int64_t x17; + VAL x18; + VAL x19; + int64_t x20; + switch (get_data_tag(v15)) { + case 1LL: { // Cons + VAL v21; + VAL v22; + mtp_std_list_List_1_Cons(v15, &v21, &v22); + STR* v23; + STRLIT(v23, "", 0); + VAL v24 = mw_mirth_mirth_Diagnostic_diagnosticZThen(MKSTR(v23), v21); + int64_t v25 = mw_std_prim_ZPlusWorld_trace(v24, v13); + int64_t v26 = 1LL /* True */; + x20 = v26; + x19 = v22; + x18 = v14; + x17 = v25; } break; - case 0LL: { // None - int64_t v41 = 0LL /* False */; - x33 = v41; - x32 = v29; - x31 = v26; - x30 = v25; + case 0LL: { // Nil + VAL v27 = MKI64(0LL /* Nil */); + int64_t v28 = 0LL /* False */; + x20 = v28; + x19 = v27; + x18 = v14; + x17 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v24 = x33; - v23 = x32; - v22 = x31; - v21 = x30; + v12 = x20; + v11 = x20; + v10 = x19; + v9 = x18; + v8 = x17; } - decref(v23); - *x4 = v22; - *x3 = v21; + decref(v10); + *x4 = v9; + *x3 = v8; } static void mw_mirth_mirth_ZPlusMirth_popZ_diagnostics (VAL x1, VAL *x2, VAL *x3) { - VAL v4 = (VVAL(VTUP(x1)->cells[8])); + VAL v4 = VVAL(VTUP(x1)->cells[8]); VAL v5 = mw_std_list_List_1_reverse(v4); VAL v6 = MKI64(0LL /* Nil */); VAL v7 = mw_std_list_List_1_reverse(v6); @@ -34827,21 +27311,17 @@ static VAL mw_mirth_mirth_Diagnostic_diagnosticZThen (VAL x1, VAL x2) { VAL v4; VAL v5; mtp_mirth_mirth_Diagnostic_Diagnostic(x2, &v3, &v4, &v5); - VAL v6 = (mw_mirth_location_Location_emitZThen(x1, v4)); + VAL v6 = mw_mirth_location_Location_emitZThen(x1, v4); STR* v7; STRLIT(v7, ": ", 2); - VAL v8 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6)); - lpush(&lbl_message, v5); - push_resource(v8); + VAL v8 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v7), v6); VAL v9 = mw_mirth_mirth_Severity_ZToStr(v3); - VAL r10 = pop_resource(); - VAL v11 = (mw_std_str_ZPlusStr_pushZ_strZBang(v9, r10)); - STR* v12; - STRLIT(v12, ": ", 2); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11)); - VAL v14 = lpop(&lbl_message); - VAL v15 = (mw_std_str_ZPlusStr_pushZ_strZBang(v14, v13)); - return v15; + VAL v10 = mw_std_str_ZPlusStr_pushZ_strZBang(v9, v8); + STR* v11; + STRLIT(v11, ": ", 2); + VAL v12 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(v5, v12); + return v13; } static void mw_mirth_mirth_PropLabel_prop (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { VAL v6 = mtw_mirth_mirth_PropState_1_PSReady(x1); @@ -34859,28 +27339,6 @@ static void mw_mirth_mirth_PropLabel_prop2 (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x6 = v11; *x5 = v10; } -static void mw_mirth_mirth_PropLabel_prop_1 (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6) { - push_value(x1); - push_value(x2); - push_resource(x3); - push_value(x4); - { - VAL v7 = pop_value(); - VAL var_f = v7; - VAL v8 = pop_value(); - incref(var_f); - VAL v9 = var_f; - VAL v10 = pop_value(); - VAL v11 = mtw_mirth_mirth_PropState_1_PSDelay(v10, v9); - VAL v12 = mtw_mirth_mirth_Prop_1_Prop(v8, v11); - decref(var_f); - push_value(v12); - } - VAL r13 = pop_resource(); - *x6 = r13; - VAL v14 = pop_value(); - *x5 = v14; -} static VAL mw_mirth_mirth_Prop_1_readyZAsk (VAL x1) { VAL v2 = VVAL(VTUP(x1)->cells[2]); incref(v2); @@ -34928,13 +27386,13 @@ static void mw_mirth_mirth_Prop_1_tryZ_forceZBang (void* x1, VAL x2, VAL *x3, VA VAL v16 = pop_value(); incref(v16); VAL v17 = mtw_mirth_mirth_PropState_1_PSReady(v16); - VAL v18 = mut_get(x1); - VAL v19 = tup_replace(v18, 2, v17); - mut_set(v19, x1); - VAL v20 = mtw_std_maybe_Maybe_1_Some(v16); - x8 = v20; - VAL r21 = pop_resource(); - x7 = r21; + VAL r18 = pop_resource(); + VAL v19 = mut_get(x1); + VAL v20 = tup_replace(v19, 2, v17); + mut_set(v20, x1); + VAL v21 = mtw_std_maybe_Maybe_1_Some(v16); + x8 = v21; + x7 = r18; } break; case 2LL: { // PSComputing VAL v22 = MKI64(0LL /* None */); @@ -34964,10 +27422,6 @@ static void mw_mirth_mirth_Prop_1_forceZBang (void* x1, VAL x2, VAL *x3, VAL *x4 STR* v10; STRLIT(v10, "Recursive prop detected!", 24); mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v10), v6); - VAL v11 = pop_value(); - x8 = v11; - VAL r12 = pop_resource(); - x7 = r12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -35194,28 +27648,31 @@ static int64_t mw_mirth_def_Def_ZEqualZEqual (VAL x1, VAL x2) { int64_t x7; switch (get_data_tag(v6)) { case 0LL: { // None - int64_t v8 = mw_std_maybe_Maybe_1_noneZAsk(v5); - x7 = v8; + int64_t v8 = get_data_tag(v5); + decref(v5); + int64_t v9 = 0LL; + bool v10 = (v8 == v9); + x7 = ((int64_t)v10); } break; case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v6); - int64_t x10; + VAL v11 = mtp_std_maybe_Maybe_1_Some(v6); + int64_t x12; switch (get_data_tag(v5)) { case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v5); - int64_t v12 = mw_mirth_alias_Alias_ZEqualZEqual(VU64(v11), VU64(v9)); - x10 = v12; + VAL v13 = mtp_std_maybe_Maybe_1_Some(v5); + int64_t v14 = mw_mirth_alias_Alias_ZEqualZEqual(VU64(v13), VU64(v11)); + x12 = v14; } break; case 0LL: { // None - decref(v9); - int64_t v13 = 0LL /* False */; - x10 = v13; + decref(v11); + int64_t v15 = 0LL /* False */; + x12 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x7 = x10; + x7 = x12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -35224,436 +27681,472 @@ static int64_t mw_mirth_def_Def_ZEqualZEqual (VAL x1, VAL x2) { x3 = x7; } break; case 2LL: { // DefPackage - uint64_t v14 = mtp_mirth_def_Def_DefPackage(x2); - VAL v15 = mtw_std_maybe_Maybe_1_Some(MKU64(v14)); - VAL v16 = mw_mirth_def_Def_packageZAsk(x1); - int64_t x17; - switch (get_data_tag(v16)) { + uint64_t v16 = mtp_mirth_def_Def_DefPackage(x2); + VAL v17 = mtw_std_maybe_Maybe_1_Some(MKU64(v16)); + VAL v18 = mw_mirth_def_Def_packageZAsk(x1); + int64_t x19; + switch (get_data_tag(v18)) { case 0LL: { // None - int64_t v18 = mw_std_maybe_Maybe_1_noneZAsk(v15); - x17 = v18; + int64_t v20 = get_data_tag(v17); + decref(v17); + int64_t v21 = 0LL; + bool v22 = (v20 == v21); + x19 = ((int64_t)v22); } break; case 1LL: { // Some - VAL v19 = mtp_std_maybe_Maybe_1_Some(v16); - int64_t x20; - switch (get_data_tag(v15)) { + VAL v23 = mtp_std_maybe_Maybe_1_Some(v18); + int64_t x24; + switch (get_data_tag(v17)) { case 1LL: { // Some - VAL v21 = mtp_std_maybe_Maybe_1_Some(v15); - int64_t v22 = mw_mirth_package_Package_ZEqualZEqual(VU64(v21), VU64(v19)); - x20 = v22; + VAL v25 = mtp_std_maybe_Maybe_1_Some(v17); + int64_t v26 = mw_mirth_package_Package_ZEqualZEqual(VU64(v25), VU64(v23)); + x24 = v26; } break; case 0LL: { // None - decref(v19); - int64_t v23 = 0LL /* False */; - x20 = v23; + decref(v23); + int64_t v27 = 0LL /* False */; + x24 = v27; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x17 = x20; + x19 = x24; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x17; + x3 = x19; } break; case 1LL: { // DefModule - uint64_t v24 = mtp_mirth_def_Def_DefModule(x2); - VAL v25 = mtw_std_maybe_Maybe_1_Some(MKU64(v24)); - VAL v26 = mw_mirth_def_Def_moduleZAsk(x1); - int64_t x27; - switch (get_data_tag(v26)) { + uint64_t v28 = mtp_mirth_def_Def_DefModule(x2); + VAL v29 = mtw_std_maybe_Maybe_1_Some(MKU64(v28)); + VAL v30 = mw_mirth_def_Def_moduleZAsk(x1); + int64_t x31; + switch (get_data_tag(v30)) { case 0LL: { // None - int64_t v28 = mw_std_maybe_Maybe_1_noneZAsk(v25); - x27 = v28; + int64_t v32 = get_data_tag(v29); + decref(v29); + int64_t v33 = 0LL; + bool v34 = (v32 == v33); + x31 = ((int64_t)v34); } break; case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v26); - int64_t x30; - switch (get_data_tag(v25)) { + VAL v35 = mtp_std_maybe_Maybe_1_Some(v30); + int64_t x36; + switch (get_data_tag(v29)) { case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v25); - int64_t v32 = mw_mirth_module_Module_ZEqualZEqual(VU64(v31), VU64(v29)); - x30 = v32; + VAL v37 = mtp_std_maybe_Maybe_1_Some(v29); + int64_t v38 = mw_mirth_module_Module_ZEqualZEqual(VU64(v37), VU64(v35)); + x36 = v38; } break; case 0LL: { // None - decref(v29); - int64_t v33 = 0LL /* False */; - x30 = v33; + decref(v35); + int64_t v39 = 0LL /* False */; + x36 = v39; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x27 = x30; + x31 = x36; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x27; + x3 = x31; } break; case 9LL: { // DefBuffer - uint64_t v34 = mtp_mirth_def_Def_DefBuffer(x2); - VAL v35 = mtw_std_maybe_Maybe_1_Some(MKU64(v34)); - VAL v36 = mw_mirth_def_Def_bufferZAsk(x1); - int64_t x37; - switch (get_data_tag(v36)) { + uint64_t v40 = mtp_mirth_def_Def_DefBuffer(x2); + VAL v41 = mtw_std_maybe_Maybe_1_Some(MKU64(v40)); + VAL v42 = mw_mirth_def_Def_bufferZAsk(x1); + int64_t x43; + switch (get_data_tag(v42)) { case 0LL: { // None - int64_t v38 = mw_std_maybe_Maybe_1_noneZAsk(v35); - x37 = v38; + int64_t v44 = get_data_tag(v41); + decref(v41); + int64_t v45 = 0LL; + bool v46 = (v44 == v45); + x43 = ((int64_t)v46); } break; case 1LL: { // Some - VAL v39 = mtp_std_maybe_Maybe_1_Some(v36); - int64_t x40; - switch (get_data_tag(v35)) { + VAL v47 = mtp_std_maybe_Maybe_1_Some(v42); + int64_t x48; + switch (get_data_tag(v41)) { case 1LL: { // Some - VAL v41 = mtp_std_maybe_Maybe_1_Some(v35); - int64_t v42 = mw_mirth_buffer_Buffer_ZEqualZEqual(VU64(v41), VU64(v39)); - x40 = v42; + VAL v49 = mtp_std_maybe_Maybe_1_Some(v41); + int64_t v50 = mw_mirth_buffer_Buffer_ZEqualZEqual(VU64(v49), VU64(v47)); + x48 = v50; } break; case 0LL: { // None - decref(v39); - int64_t v43 = 0LL /* False */; - x40 = v43; + decref(v47); + int64_t v51 = 0LL /* False */; + x48 = v51; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x37 = x40; + x43 = x48; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x37; + x3 = x43; } break; case 7LL: { // DefPrim - int64_t v44 = mtp_mirth_def_Def_DefPrim(x2); - VAL v45 = mtw_std_maybe_Maybe_1_Some(MKI64(v44)); - VAL v46 = mw_mirth_def_Def_primZAsk(x1); - int64_t x47; - switch (get_data_tag(v46)) { + int64_t v52 = mtp_mirth_def_Def_DefPrim(x2); + VAL v53 = mtw_std_maybe_Maybe_1_Some(MKI64(v52)); + VAL v54 = mw_mirth_def_Def_primZAsk(x1); + int64_t x55; + switch (get_data_tag(v54)) { case 0LL: { // None - int64_t v48 = mw_std_maybe_Maybe_1_noneZAsk(v45); - x47 = v48; + int64_t v56 = get_data_tag(v53); + decref(v53); + int64_t v57 = 0LL; + bool v58 = (v56 == v57); + x55 = ((int64_t)v58); } break; case 1LL: { // Some - VAL v49 = mtp_std_maybe_Maybe_1_Some(v46); - int64_t x50; - switch (get_data_tag(v45)) { + VAL v59 = mtp_std_maybe_Maybe_1_Some(v54); + int64_t x60; + switch (get_data_tag(v53)) { case 1LL: { // Some - VAL v51 = mtp_std_maybe_Maybe_1_Some(v45); - int64_t v52 = mw_mirth_prim_Prim_ZEqualZEqual(VI64(v51), VI64(v49)); - x50 = v52; + VAL v61 = mtp_std_maybe_Maybe_1_Some(v53); + int64_t v62 = mw_mirth_prim_Prim_ZEqualZEqual(VI64(v61), VI64(v59)); + x60 = v62; } break; case 0LL: { // None - decref(v49); - int64_t v53 = 0LL /* False */; - x50 = v53; + decref(v59); + int64_t v63 = 0LL /* False */; + x60 = v63; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x47 = x50; + x55 = x60; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x47; + x3 = x55; } break; case 3LL: { // DefData - uint64_t v54 = mtp_mirth_def_Def_DefData(x2); - VAL v55 = mtw_std_maybe_Maybe_1_Some(MKU64(v54)); - VAL v56 = mw_mirth_def_Def_dataZAsk(x1); - int64_t x57; - switch (get_data_tag(v56)) { + uint64_t v64 = mtp_mirth_def_Def_DefData(x2); + VAL v65 = mtw_std_maybe_Maybe_1_Some(MKU64(v64)); + VAL v66 = mw_mirth_def_Def_dataZAsk(x1); + int64_t x67; + switch (get_data_tag(v66)) { case 0LL: { // None - int64_t v58 = mw_std_maybe_Maybe_1_noneZAsk(v55); - x57 = v58; + int64_t v68 = get_data_tag(v65); + decref(v65); + int64_t v69 = 0LL; + bool v70 = (v68 == v69); + x67 = ((int64_t)v70); } break; case 1LL: { // Some - VAL v59 = mtp_std_maybe_Maybe_1_Some(v56); - int64_t x60; - switch (get_data_tag(v55)) { + VAL v71 = mtp_std_maybe_Maybe_1_Some(v66); + int64_t x72; + switch (get_data_tag(v65)) { case 1LL: { // Some - VAL v61 = mtp_std_maybe_Maybe_1_Some(v55); - int64_t v62 = mw_mirth_data_Data_ZEqualZEqual(VU64(v61), VU64(v59)); - x60 = v62; + VAL v73 = mtp_std_maybe_Maybe_1_Some(v65); + int64_t v74 = mw_mirth_data_Data_ZEqualZEqual(VU64(v73), VU64(v71)); + x72 = v74; } break; case 0LL: { // None - decref(v59); - int64_t v63 = 0LL /* False */; - x60 = v63; + decref(v71); + int64_t v75 = 0LL /* False */; + x72 = v75; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x57 = x60; + x67 = x72; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x57; + x3 = x67; } break; case 4LL: { // DefTable - uint64_t v64 = mtp_mirth_def_Def_DefTable(x2); - VAL v65 = mtw_std_maybe_Maybe_1_Some(MKU64(v64)); - VAL v66 = mw_mirth_def_Def_tableZAsk(x1); - int64_t x67; - switch (get_data_tag(v66)) { + uint64_t v76 = mtp_mirth_def_Def_DefTable(x2); + VAL v77 = mtw_std_maybe_Maybe_1_Some(MKU64(v76)); + VAL v78 = mw_mirth_def_Def_tableZAsk(x1); + int64_t x79; + switch (get_data_tag(v78)) { case 0LL: { // None - int64_t v68 = mw_std_maybe_Maybe_1_noneZAsk(v65); - x67 = v68; + int64_t v80 = get_data_tag(v77); + decref(v77); + int64_t v81 = 0LL; + bool v82 = (v80 == v81); + x79 = ((int64_t)v82); } break; case 1LL: { // Some - VAL v69 = mtp_std_maybe_Maybe_1_Some(v66); - int64_t x70; - switch (get_data_tag(v65)) { + VAL v83 = mtp_std_maybe_Maybe_1_Some(v78); + int64_t x84; + switch (get_data_tag(v77)) { case 1LL: { // Some - VAL v71 = mtp_std_maybe_Maybe_1_Some(v65); - int64_t v72 = mw_mirth_table_Table_ZEqualZEqual(VU64(v71), VU64(v69)); - x70 = v72; + VAL v85 = mtp_std_maybe_Maybe_1_Some(v77); + int64_t v86 = mw_mirth_table_Table_ZEqualZEqual(VU64(v85), VU64(v83)); + x84 = v86; } break; case 0LL: { // None - decref(v69); - int64_t v73 = 0LL /* False */; - x70 = v73; + decref(v83); + int64_t v87 = 0LL /* False */; + x84 = v87; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x67 = x70; + x79 = x84; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x67; + x3 = x79; } break; case 5LL: { // DefType - uint64_t v74 = mtp_mirth_def_Def_DefType(x2); - VAL v75 = mtw_std_maybe_Maybe_1_Some(MKU64(v74)); - VAL v76 = mw_mirth_def_Def_typedefZAsk(x1); - int64_t x77; - switch (get_data_tag(v76)) { + uint64_t v88 = mtp_mirth_def_Def_DefType(x2); + VAL v89 = mtw_std_maybe_Maybe_1_Some(MKU64(v88)); + VAL v90 = mw_mirth_def_Def_typedefZAsk(x1); + int64_t x91; + switch (get_data_tag(v90)) { case 0LL: { // None - int64_t v78 = mw_std_maybe_Maybe_1_noneZAsk(v75); - x77 = v78; + int64_t v92 = get_data_tag(v89); + decref(v89); + int64_t v93 = 0LL; + bool v94 = (v92 == v93); + x91 = ((int64_t)v94); } break; case 1LL: { // Some - VAL v79 = mtp_std_maybe_Maybe_1_Some(v76); - int64_t x80; - switch (get_data_tag(v75)) { + VAL v95 = mtp_std_maybe_Maybe_1_Some(v90); + int64_t x96; + switch (get_data_tag(v89)) { case 1LL: { // Some - VAL v81 = mtp_std_maybe_Maybe_1_Some(v75); - int64_t v82 = mw_mirth_typedef_TypeDef_ZEqualZEqual(VU64(v81), VU64(v79)); - x80 = v82; + VAL v97 = mtp_std_maybe_Maybe_1_Some(v89); + int64_t v98 = mw_mirth_typedef_TypeDef_ZEqualZEqual(VU64(v97), VU64(v95)); + x96 = v98; } break; case 0LL: { // None - decref(v79); - int64_t v83 = 0LL /* False */; - x80 = v83; + decref(v95); + int64_t v99 = 0LL /* False */; + x96 = v99; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x77 = x80; + x91 = x96; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x77; + x3 = x91; } break; case 11LL: { // DefExternal - uint64_t v84 = mtp_mirth_def_Def_DefExternal(x2); - VAL v85 = mtw_std_maybe_Maybe_1_Some(MKU64(v84)); - VAL v86 = mw_mirth_def_Def_externalZAsk(x1); - int64_t x87; - switch (get_data_tag(v86)) { + uint64_t v100 = mtp_mirth_def_Def_DefExternal(x2); + VAL v101 = mtw_std_maybe_Maybe_1_Some(MKU64(v100)); + VAL v102 = mw_mirth_def_Def_externalZAsk(x1); + int64_t x103; + switch (get_data_tag(v102)) { case 0LL: { // None - int64_t v88 = mw_std_maybe_Maybe_1_noneZAsk(v85); - x87 = v88; + int64_t v104 = get_data_tag(v101); + decref(v101); + int64_t v105 = 0LL; + bool v106 = (v104 == v105); + x103 = ((int64_t)v106); } break; case 1LL: { // Some - VAL v89 = mtp_std_maybe_Maybe_1_Some(v86); - int64_t x90; - switch (get_data_tag(v85)) { + VAL v107 = mtp_std_maybe_Maybe_1_Some(v102); + int64_t x108; + switch (get_data_tag(v101)) { case 1LL: { // Some - VAL v91 = mtp_std_maybe_Maybe_1_Some(v85); - int64_t v92 = mw_mirth_external_External_ZEqualZEqual(VU64(v91), VU64(v89)); - x90 = v92; + VAL v109 = mtp_std_maybe_Maybe_1_Some(v101); + int64_t v110 = mw_mirth_external_External_ZEqualZEqual(VU64(v109), VU64(v107)); + x108 = v110; } break; case 0LL: { // None - decref(v89); - int64_t v93 = 0LL /* False */; - x90 = v93; + decref(v107); + int64_t v111 = 0LL /* False */; + x108 = v111; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x87 = x90; + x103 = x108; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x87; + x3 = x103; } break; case 8LL: { // DefWord - uint64_t v94 = mtp_mirth_def_Def_DefWord(x2); - VAL v95 = mtw_std_maybe_Maybe_1_Some(MKU64(v94)); - VAL v96 = mw_mirth_def_Def_wordZAsk(x1); - int64_t x97; - switch (get_data_tag(v96)) { + uint64_t v112 = mtp_mirth_def_Def_DefWord(x2); + VAL v113 = mtw_std_maybe_Maybe_1_Some(MKU64(v112)); + VAL v114 = mw_mirth_def_Def_wordZAsk(x1); + int64_t x115; + switch (get_data_tag(v114)) { case 0LL: { // None - int64_t v98 = mw_std_maybe_Maybe_1_noneZAsk(v95); - x97 = v98; + int64_t v116 = get_data_tag(v113); + decref(v113); + int64_t v117 = 0LL; + bool v118 = (v116 == v117); + x115 = ((int64_t)v118); } break; case 1LL: { // Some - VAL v99 = mtp_std_maybe_Maybe_1_Some(v96); - int64_t x100; - switch (get_data_tag(v95)) { + VAL v119 = mtp_std_maybe_Maybe_1_Some(v114); + int64_t x120; + switch (get_data_tag(v113)) { case 1LL: { // Some - VAL v101 = mtp_std_maybe_Maybe_1_Some(v95); - int64_t v102 = mw_mirth_word_Word_ZEqualZEqual(VU64(v101), VU64(v99)); - x100 = v102; + VAL v121 = mtp_std_maybe_Maybe_1_Some(v113); + int64_t v122 = mw_mirth_word_Word_ZEqualZEqual(VU64(v121), VU64(v119)); + x120 = v122; } break; case 0LL: { // None - decref(v99); - int64_t v103 = 0LL /* False */; - x100 = v103; + decref(v119); + int64_t v123 = 0LL /* False */; + x120 = v123; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x97 = x100; + x115 = x120; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x97; + x3 = x115; } break; case 12LL: { // DefField - uint64_t v104 = mtp_mirth_def_Def_DefField(x2); - VAL v105 = mtw_std_maybe_Maybe_1_Some(MKU64(v104)); - VAL v106 = mw_mirth_def_Def_fieldZAsk(x1); - int64_t x107; - switch (get_data_tag(v106)) { + uint64_t v124 = mtp_mirth_def_Def_DefField(x2); + VAL v125 = mtw_std_maybe_Maybe_1_Some(MKU64(v124)); + VAL v126 = mw_mirth_def_Def_fieldZAsk(x1); + int64_t x127; + switch (get_data_tag(v126)) { case 0LL: { // None - int64_t v108 = mw_std_maybe_Maybe_1_noneZAsk(v105); - x107 = v108; + int64_t v128 = get_data_tag(v125); + decref(v125); + int64_t v129 = 0LL; + bool v130 = (v128 == v129); + x127 = ((int64_t)v130); } break; case 1LL: { // Some - VAL v109 = mtp_std_maybe_Maybe_1_Some(v106); - int64_t x110; - switch (get_data_tag(v105)) { + VAL v131 = mtp_std_maybe_Maybe_1_Some(v126); + int64_t x132; + switch (get_data_tag(v125)) { case 1LL: { // Some - VAL v111 = mtp_std_maybe_Maybe_1_Some(v105); - int64_t v112 = mw_mirth_table_Field_ZEqualZEqual(VU64(v111), VU64(v109)); - x110 = v112; + VAL v133 = mtp_std_maybe_Maybe_1_Some(v125); + int64_t v134 = mw_mirth_table_Field_ZEqualZEqual(VU64(v133), VU64(v131)); + x132 = v134; } break; case 0LL: { // None - decref(v109); - int64_t v113 = 0LL /* False */; - x110 = v113; + decref(v131); + int64_t v135 = 0LL /* False */; + x132 = v135; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x107 = x110; + x127 = x132; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x107; + x3 = x127; } break; case 6LL: { // DefTag - uint64_t v114 = mtp_mirth_def_Def_DefTag(x2); - VAL v115 = mtw_std_maybe_Maybe_1_Some(MKU64(v114)); - VAL v116 = mw_mirth_def_Def_tagZAsk(x1); - int64_t x117; - switch (get_data_tag(v116)) { + uint64_t v136 = mtp_mirth_def_Def_DefTag(x2); + VAL v137 = mtw_std_maybe_Maybe_1_Some(MKU64(v136)); + VAL v138 = mw_mirth_def_Def_tagZAsk(x1); + int64_t x139; + switch (get_data_tag(v138)) { case 0LL: { // None - int64_t v118 = mw_std_maybe_Maybe_1_noneZAsk(v115); - x117 = v118; + int64_t v140 = get_data_tag(v137); + decref(v137); + int64_t v141 = 0LL; + bool v142 = (v140 == v141); + x139 = ((int64_t)v142); } break; case 1LL: { // Some - VAL v119 = mtp_std_maybe_Maybe_1_Some(v116); - int64_t x120; - switch (get_data_tag(v115)) { + VAL v143 = mtp_std_maybe_Maybe_1_Some(v138); + int64_t x144; + switch (get_data_tag(v137)) { case 1LL: { // Some - VAL v121 = mtp_std_maybe_Maybe_1_Some(v115); - int64_t v122 = mw_mirth_data_Tag_ZEqualZEqual(VU64(v121), VU64(v119)); - x120 = v122; + VAL v145 = mtp_std_maybe_Maybe_1_Some(v137); + int64_t v146 = mw_mirth_data_Tag_ZEqualZEqual(VU64(v145), VU64(v143)); + x144 = v146; } break; case 0LL: { // None - decref(v119); - int64_t v123 = 0LL /* False */; - x120 = v123; + decref(v143); + int64_t v147 = 0LL /* False */; + x144 = v147; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x117 = x120; + x139 = x144; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x117; + x3 = x139; } break; case 10LL: { // DefVariable - uint64_t v124 = mtp_mirth_def_Def_DefVariable(x2); - VAL v125 = mtw_std_maybe_Maybe_1_Some(MKU64(v124)); - VAL v126 = mw_mirth_def_Def_variableZAsk(x1); - int64_t x127; - switch (get_data_tag(v126)) { + uint64_t v148 = mtp_mirth_def_Def_DefVariable(x2); + VAL v149 = mtw_std_maybe_Maybe_1_Some(MKU64(v148)); + VAL v150 = mw_mirth_def_Def_variableZAsk(x1); + int64_t x151; + switch (get_data_tag(v150)) { case 0LL: { // None - int64_t v128 = mw_std_maybe_Maybe_1_noneZAsk(v125); - x127 = v128; + int64_t v152 = get_data_tag(v149); + decref(v149); + int64_t v153 = 0LL; + bool v154 = (v152 == v153); + x151 = ((int64_t)v154); } break; case 1LL: { // Some - VAL v129 = mtp_std_maybe_Maybe_1_Some(v126); - int64_t x130; - switch (get_data_tag(v125)) { + VAL v155 = mtp_std_maybe_Maybe_1_Some(v150); + int64_t x156; + switch (get_data_tag(v149)) { case 1LL: { // Some - VAL v131 = mtp_std_maybe_Maybe_1_Some(v125); - int64_t v132 = mw_mirth_variable_Variable_ZEqualZEqual(VU64(v131), VU64(v129)); - x130 = v132; + VAL v157 = mtp_std_maybe_Maybe_1_Some(v149); + int64_t v158 = mw_mirth_variable_Variable_ZEqualZEqual(VU64(v157), VU64(v155)); + x156 = v158; } break; case 0LL: { // None - decref(v129); - int64_t v133 = 0LL /* False */; - x130 = v133; + decref(v155); + int64_t v159 = 0LL /* False */; + x156 = v159; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x127 = x130; + x151 = x156; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x3 = x127; + x3 = x151; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -35669,7 +28162,7 @@ static VAL mw_mirth_def_Def_typecheckZBang (VAL x1, VAL x2) { VAL v5; VAL v6; mw_mirth_alias_Alias_target(x1, v4, &v5, &v6); - VAL v7 = (mw_mirth_def_Def_typecheckZBang(v5, v6)); + VAL v7 = mw_mirth_def_Def_typecheckZBang(v5, v6); x3 = v7; } break; case 2LL: { // DefPackage @@ -36107,72 +28600,49 @@ static void mw_mirth_def_Def_sameZ_resolvedZAsk (VAL x1, VAL x2, VAL x3, VAL *x4 *x4 = v8; } static void mw_mirth_def_Def_resolve (VAL x1, VAL x2, VAL *x3, VAL *x4) { - incref(x2); - VAL v5 = mw_mirth_def_Def_aliasZAsk(x2); - VAL x6; - VAL x7; - int64_t x8; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v5); - decref(x2); - VAL v10; - VAL v11; - mw_mirth_alias_Alias_target(x1, VU64(v9), &v10, &v11); - int64_t v12 = 1LL /* True */; - x8 = v12; - x7 = v11; - x6 = v10; - } break; - case 0LL: { // None - int64_t v13 = 0LL /* False */; - x8 = v13; - x7 = x2; - x6 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v14 = (x6); - VAL v15 = x7; - int64_t v16 = x8; - while (((bool)v16)) { - VAL v17 = (v14); - VAL v18 = v15; - incref(v18); - VAL v19 = mw_mirth_def_Def_aliasZAsk(v18); - VAL x20; - VAL x21; - int64_t x22; - switch (get_data_tag(v19)) { + int64_t v5 = 1LL /* True */; + VAL v6 = x1; + VAL v7 = x2; + int64_t v8 = v5; + int64_t v9 = v5; + while (((bool)v9)) { + VAL v10 = v6; + VAL v11 = v7; + int64_t v12 = v8; + incref(v11); + VAL v13 = mw_mirth_def_Def_aliasZAsk(v11); + VAL x14; + VAL x15; + int64_t x16; + switch (get_data_tag(v13)) { case 1LL: { // Some - VAL v23 = mtp_std_maybe_Maybe_1_Some(v19); - decref(v18); - VAL v24; - VAL v25; - mw_mirth_alias_Alias_target(v17, VU64(v23), &v24, &v25); - int64_t v26 = 1LL /* True */; - x22 = v26; - x21 = v25; - x20 = v24; + VAL v17 = mtp_std_maybe_Maybe_1_Some(v13); + decref(v11); + VAL v18; + VAL v19; + mw_mirth_alias_Alias_target(v10, VU64(v17), &v18, &v19); + int64_t v20 = 1LL /* True */; + x16 = v20; + x15 = v19; + x14 = v18; } break; case 0LL: { // None - int64_t v27 = 0LL /* False */; - x22 = v27; - x21 = v18; - x20 = v17; + int64_t v21 = 0LL /* False */; + x16 = v21; + x15 = v11; + x14 = v10; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v16 = x22; - v15 = x21; - v14 = x20; + v9 = x16; + v8 = x16; + v7 = x15; + v6 = x14; } - *x4 = v15; - *x3 = v14; + *x4 = v7; + *x3 = v6; } static uint64_t mw_mirth_def_Def_name (VAL x1) { uint64_t x2; @@ -36534,98 +29004,78 @@ static void mw_mirth_def_Def_asZ_namespaceZAsk (VAL x1, VAL x2, VAL *x3, VAL *x4 VAL v9; VAL v10; mw_mirth_mirth_Prop_1_tryZ_forceZBang(v8, x1, &v9, &v10); - VAL x11; - VAL x12; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v9); - VAL v14; - VAL v15; - mw_mirth_def_Def_asZ_namespaceZAsk(v10, v13, &v14, &v15); - x12 = v15; - x11 = v14; - } break; - case 0LL: { // None - VAL v16 = MKI64(0LL /* None */); - x12 = v16; - x11 = v10; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x6 = x12; - x5 = x11; + VAL v11; + VAL v12; + mw_std_maybe_Maybe_1_bind_1_sp7(v10, v9, &v11, &v12); + x6 = v12; + x5 = v11; } break; case 2LL: { // DefPackage - uint64_t v17 = mtp_mirth_def_Def_DefPackage(x2); - VAL v18 = mtw_mirth_name_Namespace_NAMESPACEz_PACKAGE(v17); - VAL v19 = mtw_std_maybe_Maybe_1_Some(v18); - x6 = v19; + uint64_t v13 = mtp_mirth_def_Def_DefPackage(x2); + VAL v14 = mtw_mirth_name_Namespace_NAMESPACEz_PACKAGE(v13); + VAL v15 = mtw_std_maybe_Maybe_1_Some(v14); + x6 = v15; x5 = x1; } break; case 1LL: { // DefModule - uint64_t v20 = mtp_mirth_def_Def_DefModule(x2); - VAL v21 = mtw_mirth_name_Namespace_NAMESPACEz_MODULE(v20); + uint64_t v16 = mtp_mirth_def_Def_DefModule(x2); + VAL v17 = mtw_mirth_name_Namespace_NAMESPACEz_MODULE(v16); + VAL v18 = mtw_std_maybe_Maybe_1_Some(v17); + x6 = v18; + x5 = x1; + } break; + case 3LL: { // DefData + uint64_t v19 = mtp_mirth_def_Def_DefData(x2); + VAL v20 = mtw_mirth_tycon_Tycon_TYCONz_DATA(v19); + VAL v21 = mtw_mirth_name_Namespace_NAMESPACEz_TYCON(v20); VAL v22 = mtw_std_maybe_Maybe_1_Some(v21); x6 = v22; x5 = x1; } break; - case 3LL: { // DefData - uint64_t v23 = mtp_mirth_def_Def_DefData(x2); - VAL v24 = mtw_mirth_tycon_Tycon_TYCONz_DATA(v23); + case 4LL: { // DefTable + uint64_t v23 = mtp_mirth_def_Def_DefTable(x2); + VAL v24 = mtw_mirth_tycon_Tycon_TYCONz_TABLE(v23); VAL v25 = mtw_mirth_name_Namespace_NAMESPACEz_TYCON(v24); VAL v26 = mtw_std_maybe_Maybe_1_Some(v25); x6 = v26; x5 = x1; } break; - case 4LL: { // DefTable - uint64_t v27 = mtp_mirth_def_Def_DefTable(x2); - VAL v28 = mtw_mirth_tycon_Tycon_TYCONz_TABLE(v27); - VAL v29 = mtw_mirth_name_Namespace_NAMESPACEz_TYCON(v28); - VAL v30 = mtw_std_maybe_Maybe_1_Some(v29); - x6 = v30; - x5 = x1; - } break; case 5LL: { // DefType - uint64_t v31 = mtp_mirth_def_Def_DefType(x2); - VAL v32; - VAL v33; - mw_mirth_typedef_TypeDef_target(x1, v31, &v32, &v33); - VAL v34 = mw_mirth_type_Type_tyconZAsk(v33); - VAL x35; - VAL x36; - switch (get_data_tag(v34)) { + uint64_t v27 = mtp_mirth_def_Def_DefType(x2); + VAL v28; + VAL v29; + mw_mirth_typedef_TypeDef_target(x1, v27, &v28, &v29); + VAL v30 = mw_mirth_type_Type_tyconZAsk(v29); + VAL x31; + switch (get_data_tag(v30)) { case 1LL: { // Some - VAL v37 = mtp_std_maybe_Maybe_1_Some(v34); - VAL v38 = mtw_mirth_name_Namespace_NAMESPACEz_TYCON(v37); - VAL v39 = mtw_std_maybe_Maybe_1_Some(v38); - x36 = v39; - x35 = v32; + VAL v32 = mtp_std_maybe_Maybe_1_Some(v30); + VAL v33 = mtw_mirth_name_Namespace_NAMESPACEz_TYCON(v32); + VAL v34 = mtw_std_maybe_Maybe_1_Some(v33); + x31 = v34; } break; case 0LL: { // None - VAL v40 = MKI64(0LL /* None */); - x36 = v40; - x35 = v32; + VAL v35 = MKI64(0LL /* None */); + x31 = v35; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x6 = x36; - x5 = x35; + x6 = x31; + x5 = v28; } break; case 8LL: { // DefWord - uint64_t v41 = mtp_mirth_def_Def_DefWord(x2); - VAL v42 = mtw_mirth_name_Namespace_NAMESPACEz_WORD(v41); - VAL v43 = mtw_std_maybe_Maybe_1_Some(v42); - x6 = v43; + uint64_t v36 = mtp_mirth_def_Def_DefWord(x2); + VAL v37 = mtw_mirth_name_Namespace_NAMESPACEz_WORD(v36); + VAL v38 = mtw_std_maybe_Maybe_1_Some(v37); + x6 = v38; x5 = x1; } break; default: { decref(x2); - VAL v44 = MKI64(0LL /* None */); - x6 = v44; + VAL v39 = MKI64(0LL /* None */); + x6 = v39; x5 = x1; } break; } @@ -36638,56 +29088,44 @@ static VAL mw_mirth_def_Def_register (VAL x1, VAL x2) { VAL v4; mw_mirth_def_Def_qnameZ_soft(x1, x2, &v3, &v4); VAL x5; - VAL x6; switch (get_data_tag(v4)) { case 1LL: { // Some - VAL v7 = mtp_std_maybe_Maybe_1_Some(v4); - incref(v7); - VAL v8; - int64_t v9; - mw_mirth_name_QName_undefinedZ_softZAsk(v3, v7, &v8, &v9); + VAL v6 = mtp_std_maybe_Maybe_1_Some(v4); + incref(v6); + VAL v7; + int64_t v8; + mw_mirth_name_QName_undefinedZ_softZAsk(v3, v6, &v7, &v8); + VAL x9; VAL x10; - VAL x11; - VAL x12; - if (((bool)v9)) { - x12 = v8; - x11 = v7; - x10 = x2; + if (((bool)v8)) { + x10 = v6; + x9 = v7; } else { - VAL v13; - VAL v14; - mw_mirth_name_QName_ZToStr(v8, v7, &v13, &v14); - STR* v15; - STRLIT(v15, "qualified name already has definition: ", 39); - STR* v16 = str_cat(v15, VSTR(v14)); - push_value(x2); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v16), v13); - VAL r17 = pop_resource(); - x12 = r17; - VAL v18 = pop_value(); - x11 = v18; - VAL v19 = pop_value(); - x10 = v19; + VAL v11; + VAL v12; + mw_mirth_name_QName_ZToStr(v7, v6, &v11, &v12); + STR* v13; + STRLIT(v13, "qualified name already has definition: ", 39); + STR* v14 = str_cat(v13, VSTR(v12)); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v14), v11); } - decref(x11); - x6 = x12; - x5 = x10; + decref(x10); + x5 = x9; } break; case 0LL: { // None - x6 = v3; - x5 = x2; + x5 = v3; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - incref(x5); - uint64_t v20 = mw_mirth_def_Def_name(x5); - void* v21 = mfld_mirth_name_Name_ZTildedefs(v20); - VAL v22 = mut_get(v21); - VAL v23 = mtw_std_list_List_1_Cons(x5, v22); - mut_set(v23, v21); - return x6; + incref(x2); + uint64_t v17 = mw_mirth_def_Def_name(x2); + void* v18 = mfld_mirth_name_Name_ZTildedefs(v17); + VAL v19 = mut_get(v18); + VAL v20 = mtw_std_list_List_1_Cons(x2, v19); + mut_set(v20, v18); + return x5; } static int64_t mw_mirth_name_Name_index (uint64_t x1) { return ((int64_t)x1); @@ -36745,14 +29183,8 @@ static int64_t mw_std_prim_Int_ZToHash (int64_t x1) { int64_t v2 = mw_mirth_name_HASHz_MAX(); uint64_t v3 = (((uint64_t)x1) & ((uint64_t)v2)); int64_t v4 = 0LL; - bool v5 = (((int64_t)v3) < v4); - int64_t x6; - if (v5) { - x6 = v4; - } else { - x6 = ((int64_t)v3); - } - return x6; + int64_t v5 = mw_std_prim_Int_max(((int64_t)v3), v4); + return v5; } static int64_t mw_mirth_name_Hash_offset (int64_t x1) { int64_t v2 = 8LL; @@ -36766,7 +29198,7 @@ static int64_t mw_mirth_name_HASHz_MAX (void) { static VAL mw_mirth_name_hashZ_nameZAt (int64_t x1) { int64_t v2 = mw_mirth_name_Hash_offset(x1); void* v3 = mbuf_mirth_name_HASHz_BUF; - int64_t v4 = (0LL /* +Unsafe */); + int64_t v4 = 0LL /* +Unsafe */; void* v5 = (void*)(v2 + (char*)v3); int64_t v6 = *(int64_t*)v5; int64_t v7 = 0LL; @@ -36786,7 +29218,7 @@ static void mw_mirth_name_hashZ_nameZBang (uint64_t x1, int64_t x2) { int64_t v3 = mw_mirth_name_Name_index(x1); int64_t v4 = mw_mirth_name_Hash_offset(x2); void* v5 = mbuf_mirth_name_HASHz_BUF; - int64_t v6 = (0LL /* +Unsafe */); + int64_t v6 = 0LL /* +Unsafe */; void* v7 = (void*)(v4 + (char*)v5); *(int64_t*)v7 = v3; } @@ -36797,66 +29229,49 @@ static int64_t mw_std_prim_Str_hash (VAL x1) { void* v3 = str_base(VSTR(x1)); uint64_t v4 = str_size(VSTR(x1)); int64_t v5 = 0LL; - bool v6 = (((int64_t)v4) < v5); - int64_t x7; - if (v6) { - x7 = v5; - push_i64(v2); - push_ptr(v3); - } else { - x7 = ((int64_t)v4); - push_i64(v2); - push_ptr(v3); - } - int64_t v8 = 0LL; - bool v9 = (x7 > v8); - int64_t v10 = x7; - bool v11 = v9; - while (v11) { - int64_t v12 = v10; - void* v13 = pop_ptr(); - int64_t v14 = (0LL /* +Unsafe */); - int64_t v15; - int64_t v16; - mw_std_prim_Ptr_ZAtByte(v13, v14, &v15, &v16); - int64_t v17 = 17LL; - int64_t v18 = i64_mul(v15, v17); - VAL v19 = pop_value(); - incref(v19); - int64_t v20 = 7LL; - uint64_t v21 = u64_shl(VU64(v19), ((uint64_t)v20)); - uint64_t v22 = (((uint64_t)v18) ^ v21); - int64_t v23 = 27LL; - uint64_t v24 = u64_shr(VU64(v19), ((uint64_t)v23)); - uint64_t v25 = (v22 ^ v24); - int64_t v26 = 1LL; - int64_t v27 = (0LL /* +Unsafe */); - void* v28 = (void*)(v26 + (char*)v13); - int64_t v29 = 1LL; - int64_t v30 = i64_sub(v12, v29); - int64_t v31 = 0LL; - bool v32 = (v30 < v31); - int64_t x33; - if (v32) { - int64_t v34 = 0LL; - x33 = v34; - push_u64(v25); - push_ptr(v28); + bool v6 = (((int64_t)v4) > v5); + int64_t v7 = v2; + void* v8 = v3; + uint64_t v9 = v4; + bool v10 = v6; + while (v10) { + int64_t v11 = v7; + void* v12 = v8; + uint64_t v13 = v9; + int64_t v14 = 0LL /* +Unsafe */; + uint8_t v15 = *(uint8_t*)v12; + int64_t v16 = 17LL; + int64_t v17 = i64_mul(((int64_t)v15), v16); + int64_t v18 = 7LL; + uint64_t v19 = u64_shl(((uint64_t)v11), ((uint64_t)v18)); + uint64_t v20 = (((uint64_t)v17) ^ v19); + int64_t v21 = 27LL; + uint64_t v22 = u64_shr(((uint64_t)v11), ((uint64_t)v21)); + uint64_t v23 = (v20 ^ v22); + int64_t v24 = 1LL; + int64_t v25 = 0LL /* +Unsafe */; + void* v26 = (void*)(v24 + (char*)v12); + int64_t v27 = 1LL; + int64_t v28 = i64_sub(((int64_t)v13), v27); + int64_t v29 = 0LL; + bool v30 = (v28 < v29); + int64_t x31; + if (v30) { + int64_t v32 = 0LL; + x31 = v32; } else { - x33 = v30; - push_u64(v25); - push_ptr(v28); + x31 = v28; } - int64_t v35 = 0LL; - bool v36 = (x33 > v35); - v11 = v36; - v10 = x33; + int64_t v33 = 0LL; + bool v34 = (x31 > v33); + v10 = v34; + v9 = ((uint64_t)x31); + v8 = v26; + v7 = ((int64_t)v23); } - void* v37 = pop_ptr(); decref(x1); - int64_t v38 = pop_i64(); - int64_t v39 = mw_std_prim_Int_ZToHash(v38); - return v39; + int64_t v35 = mw_std_prim_Int_ZToHash(v7); + return v35; } static int64_t mw_mirth_name_Hash_next (int64_t x1) { int64_t v2 = mw_mirth_name_Hash_ZToInt(x1); @@ -36954,54 +29369,78 @@ static int64_t mw_mirth_name_Name_tailZ_head (uint64_t x1) { } static int64_t mw_mirth_name_Name_canZ_beZ_relativeZAsk (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); - int64_t v3 = mw_std_byte_Byte_isZ_upper(v2); - bool v4 = !((bool)v3); - return ((int64_t)v4); + int64_t v3 = 65LL /* B'A' */; + int64_t v4 = 90LL /* B'Z' */; + bool v5 = (v2 >= v3); + bool v6 = (v2 <= v4); + bool v7 = (v5 && v6); + bool v8 = !v7; + return ((int64_t)v8); } static int64_t mw_mirth_name_Name_couldZ_beZ_labelZ_nameZAsk (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); - int64_t v3 = mw_std_byte_Byte_isZ_lower(v2); - uint64_t x4; - int64_t x5; - if (((bool)v3)) { - int64_t v6 = 1LL /* True */; - x5 = v6; - x4 = x1; + int64_t v3 = 97LL /* B'a' */; + int64_t v4 = 122LL /* B'z' */; + bool v5 = (v2 >= v3); + bool v6 = (v2 <= v4); + bool v7 = (v5 && v6); + uint64_t x8; + int64_t x9; + if (v7) { + int64_t v10 = 1LL /* True */; + x9 = v10; + x8 = x1; } else { - int64_t v7 = mw_mirth_name_Name_head(x1); - int64_t v8 = 43LL /* B'+' */; - bool v9 = (v7 == v8); - uint64_t x10; - int64_t x11; - if (v9) { - int64_t v12 = mw_mirth_name_Name_tailZ_head(x1); - int64_t v13 = mw_std_byte_Byte_isZ_lower(v12); - x11 = v13; - x10 = x1; + int64_t v11 = mw_mirth_name_Name_head(x1); + int64_t v12 = 43LL /* B'+' */; + bool v13 = (v11 == v12); + uint64_t x14; + int64_t x15; + if (v13) { + int64_t v16 = mw_mirth_name_Name_tailZ_head(x1); + int64_t v17 = 97LL /* B'a' */; + int64_t v18 = 122LL /* B'z' */; + bool v19 = (v16 >= v17); + bool v20 = (v16 <= v18); + bool v21 = (v19 && v20); + x15 = ((int64_t)v21); + x14 = x1; } else { - int64_t v14 = 0LL /* False */; - x11 = v14; - x10 = x1; + int64_t v22 = 0LL /* False */; + x15 = v22; + x14 = x1; } - x5 = x11; - x4 = x10; + x9 = x15; + x8 = x14; } - return x5; + return x9; } static int64_t mw_mirth_name_Name_couldZ_beZ_patternZ_varZAsk (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); - int64_t v3 = mw_std_byte_Byte_isZ_lower(v2); - return v3; + int64_t v3 = 97LL /* B'a' */; + int64_t v4 = 122LL /* B'z' */; + bool v5 = (v2 >= v3); + bool v6 = (v2 <= v4); + bool v7 = (v5 && v6); + return ((int64_t)v7); } static int64_t mw_mirth_name_Name_couldZ_beZ_typeZ_var (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); - int64_t v3 = mw_std_byte_Byte_isZ_lower(v2); - return v3; + int64_t v3 = 97LL /* B'a' */; + int64_t v4 = 122LL /* B'z' */; + bool v5 = (v2 >= v3); + bool v6 = (v2 <= v4); + bool v7 = (v5 && v6); + return ((int64_t)v7); } static int64_t mw_mirth_name_Name_couldZ_beZ_typeZ_con (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); - int64_t v3 = mw_std_byte_Byte_isZ_upper(v2); - return v3; + int64_t v3 = 65LL /* B'A' */; + int64_t v4 = 90LL /* B'Z' */; + bool v5 = (v2 >= v3); + bool v6 = (v2 <= v4); + bool v7 = (v5 && v6); + return ((int64_t)v7); } static int64_t mw_mirth_name_Name_isZ_typeZ_hole (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); @@ -37010,10 +29449,14 @@ static int64_t mw_mirth_name_Name_isZ_typeZ_hole (uint64_t x1) { int64_t v5 = mw_mirth_name_Name_tailZ_head(x1); int64_t v6 = 0LL /* BNUL */; bool v7 = (v5 == v6); - int64_t v8 = mw_std_byte_Byte_isZ_lower(v5); - bool v9 = (v7 || ((bool)v8)); - bool v10 = (v4 && v9); - return ((int64_t)v10); + int64_t v8 = 97LL /* B'a' */; + int64_t v9 = 122LL /* B'z' */; + bool v10 = (v5 >= v8); + bool v11 = (v5 <= v9); + bool v12 = (v10 && v11); + bool v13 = (v7 || v12); + bool v14 = (v4 && v13); + return ((int64_t)v14); } static int64_t mw_mirth_name_Name_isZ_underscore (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); @@ -37030,27 +29473,39 @@ static int64_t mw_mirth_name_Name_couldZ_beZ_stackZ_var (uint64_t x1) { int64_t v3 = 42LL /* B'*' */; bool v4 = (v2 == v3); int64_t v5 = mw_mirth_name_Name_tailZ_head(x1); - int64_t v6 = mw_std_byte_Byte_isZ_lower(v5); - bool v7 = (v4 && ((bool)v6)); - return ((int64_t)v7); + int64_t v6 = 97LL /* B'a' */; + int64_t v7 = 122LL /* B'z' */; + bool v8 = (v5 >= v6); + bool v9 = (v5 <= v7); + bool v10 = (v8 && v9); + bool v11 = (v4 && v10); + return ((int64_t)v11); } static int64_t mw_mirth_name_Name_couldZ_beZ_resourceZ_var (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); int64_t v3 = 43LL /* B'+' */; bool v4 = (v2 == v3); int64_t v5 = mw_mirth_name_Name_tailZ_head(x1); - int64_t v6 = mw_std_byte_Byte_isZ_lower(v5); - bool v7 = (v4 && ((bool)v6)); - return ((int64_t)v7); + int64_t v6 = 97LL /* B'a' */; + int64_t v7 = 122LL /* B'z' */; + bool v8 = (v5 >= v6); + bool v9 = (v5 <= v7); + bool v10 = (v8 && v9); + bool v11 = (v4 && v10); + return ((int64_t)v11); } static int64_t mw_mirth_name_Name_couldZ_beZ_resourceZ_con (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); int64_t v3 = 43LL /* B'+' */; bool v4 = (v2 == v3); int64_t v5 = mw_mirth_name_Name_tailZ_head(x1); - int64_t v6 = mw_std_byte_Byte_isZ_upper(v5); - bool v7 = (v4 && ((bool)v6)); - return ((int64_t)v7); + int64_t v6 = 65LL /* B'A' */; + int64_t v7 = 90LL /* B'Z' */; + bool v8 = (v5 >= v6); + bool v9 = (v5 <= v7); + bool v10 = (v8 && v9); + bool v11 = (v4 && v10); + return ((int64_t)v11); } static int64_t mw_mirth_name_Name_couldZ_beZ_constructor (uint64_t x1) { int64_t v2 = mw_mirth_name_Name_head(x1); @@ -37058,12 +29513,20 @@ static int64_t mw_mirth_name_Name_couldZ_beZ_constructor (uint64_t x1) { switch (v2) { case 43LL: { // B'+' int64_t v4 = mw_mirth_name_Name_tailZ_head(x1); - int64_t v5 = mw_std_byte_Byte_isZ_upper(v4); - x3 = v5; - } break; - default: { - int64_t v6 = mw_std_byte_Byte_isZ_upper(v2); - x3 = v6; + int64_t v5 = 65LL /* B'A' */; + int64_t v6 = 90LL /* B'Z' */; + bool v7 = (v4 >= v5); + bool v8 = (v4 <= v6); + bool v9 = (v7 && v8); + x3 = ((int64_t)v9); + } break; + default: { + int64_t v10 = 65LL /* B'A' */; + int64_t v11 = 90LL /* B'Z' */; + bool v12 = (v2 >= v10); + bool v13 = (v2 <= v11); + bool v14 = (v12 && v13); + x3 = ((int64_t)v14); } break; } return x3; @@ -37077,58 +29540,42 @@ static VAL mw_mirth_name_Name_mangleZ_computeZBang (uint64_t x1) { void* v4 = str_base(VSTR(v3)); uint64_t v5 = str_size(VSTR(v3)); int64_t v6 = 0LL; - bool v7 = (((int64_t)v5) < v6); - int64_t x8; - if (v7) { - x8 = v6; - push_resource(MKSTR(v2)); - push_ptr(v4); - } else { - x8 = ((int64_t)v5); - push_resource(MKSTR(v2)); - push_ptr(v4); - } - int64_t v9 = 0LL; - bool v10 = (x8 > v9); - int64_t v11 = x8; - bool v12 = v10; - while (v12) { - int64_t v13 = v11; - void* v14 = pop_ptr(); - int64_t v15 = (0LL /* +Unsafe */); - int64_t v16; - int64_t v17; - mw_std_prim_Ptr_ZAtByte(v14, v15, &v16, &v17); - VAL v18 = mw_std_byte_Byte_zzencode(v16); - VAL r19 = pop_resource(); - VAL v20 = (mw_std_str_ZPlusStr_pushZ_strZBang(v18, r19)); - int64_t v21 = 1LL; - int64_t v22 = (0LL /* +Unsafe */); - void* v23 = (void*)(v21 + (char*)v14); - int64_t v24 = 1LL; - int64_t v25 = i64_sub(v13, v24); - int64_t v26 = 0LL; - bool v27 = (v25 < v26); - int64_t x28; - if (v27) { - int64_t v29 = 0LL; - x28 = v29; - push_resource(v20); - push_ptr(v23); + bool v7 = (((int64_t)v5) > v6); + STR* v8 = v2; + void* v9 = v4; + uint64_t v10 = v5; + bool v11 = v7; + while (v11) { + STR* v12 = v8; + void* v13 = v9; + uint64_t v14 = v10; + int64_t v15 = 0LL /* +Unsafe */; + uint8_t v16 = *(uint8_t*)v13; + VAL v17 = mw_std_byte_Byte_zzencode(((int64_t)v16)); + VAL v18 = mw_std_str_ZPlusStr_pushZ_strZBang(v17, MKSTR(v12)); + int64_t v19 = 1LL; + int64_t v20 = 0LL /* +Unsafe */; + void* v21 = (void*)(v19 + (char*)v13); + int64_t v22 = 1LL; + int64_t v23 = i64_sub(((int64_t)v14), v22); + int64_t v24 = 0LL; + bool v25 = (v23 < v24); + int64_t x26; + if (v25) { + int64_t v27 = 0LL; + x26 = v27; } else { - x28 = v25; - push_resource(v20); - push_ptr(v23); + x26 = v23; } - int64_t v30 = 0LL; - bool v31 = (x28 > v30); - v12 = v31; - v11 = x28; + int64_t v28 = 0LL; + bool v29 = (x26 > v28); + v11 = v29; + v10 = ((uint64_t)x26); + v9 = v21; + v8 = VSTR(v18); } - void* v32 = pop_ptr(); decref(v3); - VAL r33 = pop_resource(); - return r33; + return MKSTR(v8); } static int64_t mw_mirth_name_Namespace_ZEqualZEqual (VAL x1, VAL x2) { int64_t x3; @@ -37464,177 +29911,112 @@ static void mw_mirth_name_QName_defZ_hardZAsk (VAL x1, VAL x2, VAL *x3, VAL *x4) decref(x2); VAL v6 = mw_mirth_name_Name_defs(v5); VAL v7 = MKI64(0LL /* None */); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v6, &v8, &v9); - VAL x10; - VAL x11; - VAL x12; - VAL x13; - int64_t x14; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v15 = mtp_std_maybe_Maybe_1_Some(v8); - incref(v15); - incref(x2); - VAL v16; - VAL v17; - mw_mirth_def_Def_qnameZ_hard(x1, v15, &v16, &v17); - int64_t v18 = mw_mirth_name_QName_ZEqualZEqual(x2, v17); - VAL x19; - VAL x20; - VAL x21; - if (((bool)v18)) { - VAL v22 = mtw_std_maybe_Maybe_1_Some(v15); - x21 = v22; - x20 = x2; - x19 = v16; - } else { - decref(v15); - VAL v23 = MKI64(0LL /* None */); - x21 = v23; - x20 = x2; - x19 = v16; - } - VAL x24; - VAL x25; - VAL x26; - VAL x27; - switch (get_data_tag(x21)) { - case 0LL: { // None - x27 = v9; - x26 = v7; - x25 = x20; - x24 = x19; - } break; - default: { - decref(v9); - decref(v7); - VAL v28 = MKI64(0LL /* Nil */); - x27 = v28; - x26 = x21; - x25 = x20; - x24 = x19; - } break; - } - int64_t v29 = 1LL /* True */; - x14 = v29; - x13 = x27; - x12 = x26; - x11 = x25; - x10 = x24; - } break; - case 0LL: { // None - int64_t v30 = 0LL /* False */; - x14 = v30; - x13 = v9; - x12 = v7; - x11 = x2; - x10 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v31 = (x10); - VAL v32 = x11; - VAL v33 = x12; - VAL v34 = x13; - int64_t v35 = x14; - while (((bool)v35)) { - VAL v36 = (v31); - VAL v37 = v32; - VAL v38 = v33; - VAL v39 = v34; - VAL v40; - VAL v41; - mw_std_list_List_1_uncons(v39, &v40, &v41); - VAL x42; - VAL x43; - VAL x44; - VAL x45; - int64_t x46; - switch (get_data_tag(v40)) { + int64_t v8 = 1LL /* True */; + VAL v9 = x1; + VAL v10 = x2; + VAL v11 = v7; + VAL v12 = v6; + int64_t v13 = v8; + int64_t v14 = v8; + while (((bool)v14)) { + VAL v15 = v9; + VAL v16 = v10; + VAL v17 = v11; + VAL v18 = v12; + int64_t v19 = v13; + VAL v20; + VAL v21; + mw_std_list_List_1_uncons(v18, &v20, &v21); + VAL x22; + VAL x23; + VAL x24; + VAL x25; + int64_t x26; + switch (get_data_tag(v20)) { case 1LL: { // Some - VAL v47 = mtp_std_maybe_Maybe_1_Some(v40); - incref(v47); - incref(v37); - VAL v48; - VAL v49; - mw_mirth_def_Def_qnameZ_hard(v36, v47, &v48, &v49); - int64_t v50 = mw_mirth_name_QName_ZEqualZEqual(v37, v49); - VAL x51; - VAL x52; - VAL x53; - if (((bool)v50)) { - VAL v54 = mtw_std_maybe_Maybe_1_Some(v47); - x53 = v54; - x52 = v37; - x51 = v48; + VAL v27 = mtp_std_maybe_Maybe_1_Some(v20); + incref(v27); + incref(v16); + VAL v28; + VAL v29; + mw_mirth_def_Def_qnameZ_hard(v15, v27, &v28, &v29); + int64_t v30 = mw_mirth_name_QName_ZEqualZEqual(v16, v29); + VAL x31; + VAL x32; + VAL x33; + if (((bool)v30)) { + VAL v34 = mtw_std_maybe_Maybe_1_Some(v27); + x33 = v34; + x32 = v16; + x31 = v28; } else { - decref(v47); - VAL v55 = MKI64(0LL /* None */); - x53 = v55; - x52 = v37; - x51 = v48; + decref(v27); + VAL v35 = MKI64(0LL /* None */); + x33 = v35; + x32 = v16; + x31 = v28; } - VAL x56; - VAL x57; - VAL x58; - VAL x59; - switch (get_data_tag(x53)) { + VAL x36; + VAL x37; + VAL x38; + VAL x39; + switch (get_data_tag(x33)) { case 0LL: { // None - x59 = v41; - x58 = v38; - x57 = x52; - x56 = x51; + x39 = v21; + x38 = v17; + x37 = x32; + x36 = x31; } break; default: { - decref(v41); - decref(v38); - VAL v60 = MKI64(0LL /* Nil */); - x59 = v60; - x58 = x53; - x57 = x52; - x56 = x51; + decref(v21); + decref(v17); + VAL v40 = MKI64(0LL /* Nil */); + x39 = v40; + x38 = x33; + x37 = x32; + x36 = x31; } break; } - int64_t v61 = 1LL /* True */; - x46 = v61; - x45 = x59; - x44 = x58; - x43 = x57; - x42 = x56; + int64_t v41 = 1LL /* True */; + x26 = v41; + x25 = x39; + x24 = x38; + x23 = x37; + x22 = x36; } break; case 0LL: { // None - int64_t v62 = 0LL /* False */; - x46 = v62; - x45 = v41; - x44 = v38; - x43 = v37; - x42 = v36; + int64_t v42 = 0LL /* False */; + x26 = v42; + x25 = v21; + x24 = v17; + x23 = v16; + x22 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v35 = x46; - v34 = x45; - v33 = x44; - v32 = x43; - v31 = x42; + v14 = x26; + v13 = x26; + v12 = x25; + v11 = x24; + v10 = x23; + v9 = x22; } - decref(v34); - decref(v32); - *x4 = v33; - *x3 = v31; + decref(v12); + decref(v10); + *x4 = v11; + *x3 = v9; } static void mw_mirth_name_QName_definedZ_hardZAsk (VAL x1, VAL x2, VAL *x3, int64_t *x4) { VAL v5; VAL v6; mw_mirth_name_QName_defZ_hardZAsk(x1, x2, &v5, &v6); - int64_t v7 = mw_std_maybe_Maybe_1_someZAsk(v6); - *x4 = v7; + int64_t v7 = get_data_tag(v6); + decref(v6); + int64_t v8 = 1LL; + bool v9 = (v7 == v8); + *x4 = ((int64_t)v9); *x3 = v5; } static void mw_mirth_name_QName_defZ_softZAsk (VAL x1, VAL x2, VAL *x3, VAL *x4) { @@ -37644,255 +30026,155 @@ static void mw_mirth_name_QName_defZ_softZAsk (VAL x1, VAL x2, VAL *x3, VAL *x4) VAL v6 = mw_mirth_name_Name_defs(v5); VAL v7 = mtw_std_maybe_Maybe_1_Some(x2); VAL v8 = MKI64(0LL /* None */); - VAL v9; - VAL v10; - mw_std_list_List_1_uncons(v6, &v9, &v10); - VAL x11; - VAL x12; - VAL x13; - VAL x14; - int64_t x15; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(v9); - incref(v16); - incref(v7); - VAL v17; - VAL v18; - mw_mirth_def_Def_qnameZ_soft(x1, v16, &v17, &v18); - VAL x19; - int64_t x20; - switch (get_data_tag(v18)) { - case 0LL: { // None - int64_t v21 = mw_std_maybe_Maybe_1_noneZAsk(v7); - x20 = v21; - x19 = v17; - } break; - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v18); - VAL x23; - int64_t x24; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v25 = mtp_std_maybe_Maybe_1_Some(v7); - int64_t v26 = mw_mirth_name_QName_ZEqualZEqual(v25, v22); - x24 = v26; - x23 = v17; - } break; - case 0LL: { // None - decref(v22); - int64_t v27 = 0LL /* False */; - x24 = v27; - x23 = v17; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x20 = x24; - x19 = x23; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x28; - VAL x29; - VAL x30; - if (((bool)x20)) { - VAL v31 = mtw_std_maybe_Maybe_1_Some(v16); - x30 = v31; - x29 = v7; - x28 = x19; - } else { - decref(v16); - VAL v32 = MKI64(0LL /* None */); - x30 = v32; - x29 = v7; - x28 = x19; - } - VAL x33; - VAL x34; - VAL x35; - VAL x36; - switch (get_data_tag(x30)) { - case 0LL: { // None - x36 = v10; - x35 = v8; - x34 = x29; - x33 = x28; - } break; - default: { - decref(v10); - decref(v8); - VAL v37 = MKI64(0LL /* Nil */); - x36 = v37; - x35 = x30; - x34 = x29; - x33 = x28; - } break; - } - int64_t v38 = 1LL /* True */; - x15 = v38; - x14 = x36; - x13 = x35; - x12 = x34; - x11 = x33; - } break; - case 0LL: { // None - int64_t v39 = 0LL /* False */; - x15 = v39; - x14 = v10; - x13 = v8; - x12 = v7; - x11 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v40 = (x11); - VAL v41 = x12; - VAL v42 = x13; - VAL v43 = x14; - int64_t v44 = x15; - while (((bool)v44)) { - VAL v45 = (v40); - VAL v46 = v41; - VAL v47 = v42; - VAL v48 = v43; - VAL v49; - VAL v50; - mw_std_list_List_1_uncons(v48, &v49, &v50); - VAL x51; - VAL x52; - VAL x53; - VAL x54; - int64_t x55; - switch (get_data_tag(v49)) { + int64_t v9 = 1LL /* True */; + VAL v10 = x1; + VAL v11 = v7; + VAL v12 = v8; + VAL v13 = v6; + int64_t v14 = v9; + int64_t v15 = v9; + while (((bool)v15)) { + VAL v16 = v10; + VAL v17 = v11; + VAL v18 = v12; + VAL v19 = v13; + int64_t v20 = v14; + VAL v21; + VAL v22; + mw_std_list_List_1_uncons(v19, &v21, &v22); + VAL x23; + VAL x24; + VAL x25; + VAL x26; + int64_t x27; + switch (get_data_tag(v21)) { case 1LL: { // Some - VAL v56 = mtp_std_maybe_Maybe_1_Some(v49); - incref(v56); - incref(v46); - VAL v57; - VAL v58; - mw_mirth_def_Def_qnameZ_soft(v45, v56, &v57, &v58); - VAL x59; - int64_t x60; - switch (get_data_tag(v58)) { + VAL v28 = mtp_std_maybe_Maybe_1_Some(v21); + incref(v28); + incref(v17); + VAL v29; + VAL v30; + mw_mirth_def_Def_qnameZ_soft(v16, v28, &v29, &v30); + int64_t x31; + switch (get_data_tag(v30)) { case 0LL: { // None - int64_t v61 = mw_std_maybe_Maybe_1_noneZAsk(v46); - x60 = v61; - x59 = v57; + int64_t v32 = get_data_tag(v17); + decref(v17); + int64_t v33 = 0LL; + bool v34 = (v32 == v33); + x31 = ((int64_t)v34); } break; case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v58); - VAL x63; - int64_t x64; - switch (get_data_tag(v46)) { + VAL v35 = mtp_std_maybe_Maybe_1_Some(v30); + int64_t x36; + switch (get_data_tag(v17)) { case 1LL: { // Some - VAL v65 = mtp_std_maybe_Maybe_1_Some(v46); - int64_t v66 = mw_mirth_name_QName_ZEqualZEqual(v65, v62); - x64 = v66; - x63 = v57; + VAL v37 = mtp_std_maybe_Maybe_1_Some(v17); + int64_t v38 = mw_mirth_name_QName_ZEqualZEqual(v37, v35); + x36 = v38; } break; case 0LL: { // None - decref(v62); - int64_t v67 = 0LL /* False */; - x64 = v67; - x63 = v57; + decref(v35); + int64_t v39 = 0LL /* False */; + x36 = v39; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x60 = x64; - x59 = x63; + x31 = x36; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x68; - VAL x69; - VAL x70; - if (((bool)x60)) { - VAL v71 = mtw_std_maybe_Maybe_1_Some(v56); - x70 = v71; - x69 = v46; - x68 = x59; + VAL x40; + VAL x41; + VAL x42; + if (((bool)x31)) { + VAL v43 = mtw_std_maybe_Maybe_1_Some(v28); + x42 = v43; + x41 = v17; + x40 = v29; } else { - decref(v56); - VAL v72 = MKI64(0LL /* None */); - x70 = v72; - x69 = v46; - x68 = x59; + decref(v28); + VAL v44 = MKI64(0LL /* None */); + x42 = v44; + x41 = v17; + x40 = v29; } - VAL x73; - VAL x74; - VAL x75; - VAL x76; - switch (get_data_tag(x70)) { + VAL x45; + VAL x46; + VAL x47; + VAL x48; + switch (get_data_tag(x42)) { case 0LL: { // None - x76 = v50; - x75 = v47; - x74 = x69; - x73 = x68; + x48 = v22; + x47 = v18; + x46 = x41; + x45 = x40; } break; default: { - decref(v50); - decref(v47); - VAL v77 = MKI64(0LL /* Nil */); - x76 = v77; - x75 = x70; - x74 = x69; - x73 = x68; + decref(v22); + decref(v18); + VAL v49 = MKI64(0LL /* Nil */); + x48 = v49; + x47 = x42; + x46 = x41; + x45 = x40; } break; } - int64_t v78 = 1LL /* True */; - x55 = v78; - x54 = x76; - x53 = x75; - x52 = x74; - x51 = x73; + int64_t v50 = 1LL /* True */; + x27 = v50; + x26 = x48; + x25 = x47; + x24 = x46; + x23 = x45; } break; case 0LL: { // None - int64_t v79 = 0LL /* False */; - x55 = v79; - x54 = v50; - x53 = v47; - x52 = v46; - x51 = v45; + int64_t v51 = 0LL /* False */; + x27 = v51; + x26 = v22; + x25 = v18; + x24 = v17; + x23 = v16; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v44 = x55; - v43 = x54; - v42 = x53; - v41 = x52; - v40 = x51; + v15 = x27; + v14 = x27; + v13 = x26; + v12 = x25; + v11 = x24; + v10 = x23; } - decref(v43); - decref(v41); - *x4 = v42; - *x3 = v40; + decref(v13); + decref(v11); + *x4 = v12; + *x3 = v10; } static void mw_mirth_name_QName_definedZ_softZAsk (VAL x1, VAL x2, VAL *x3, int64_t *x4) { VAL v5; VAL v6; mw_mirth_name_QName_defZ_softZAsk(x1, x2, &v5, &v6); - int64_t v7 = mw_std_maybe_Maybe_1_someZAsk(v6); - *x4 = v7; + int64_t v7 = get_data_tag(v6); + decref(v6); + int64_t v8 = 1LL; + bool v9 = (v7 == v8); + *x4 = ((int64_t)v9); *x3 = v5; } static void mw_mirth_name_QName_undefinedZ_softZAsk (VAL x1, VAL x2, VAL *x3, int64_t *x4) { VAL v5; VAL v6; mw_mirth_name_QName_defZ_softZAsk(x1, x2, &v5, &v6); - int64_t v7 = mw_std_maybe_Maybe_1_noneZAsk(v6); - *x4 = v7; + int64_t v7 = get_data_tag(v6); + decref(v6); + int64_t v8 = 0LL; + bool v9 = (v7 == v8); + *x4 = ((int64_t)v9); *x3 = v5; } static void mw_mirth_name_QName_prim (VAL x1, VAL x2, int64_t x3, VAL *x4, VAL *x5) { @@ -37953,66 +30235,41 @@ static void mw_mirth_name_QName_toZ_moduleZ_path (VAL x1, int64_t x2, VAL x3, VA mw_mirth_package_Package_pathZ_orZ_search(x2, x3, v11, &v12, &v13, &v14); VAL x15; uint64_t x16; - int64_t x17; - VAL x18; - VAL x19; + VAL x17; switch (get_data_tag(v14)) { case 1LL: { // Some - VAL v20 = mtp_std_maybe_Maybe_1_Some(v14); - x19 = v20; - x18 = v13; - x17 = v12; + VAL v18 = mtp_std_maybe_Maybe_1_Some(v14); + x17 = v18; x16 = v11; - x15 = x1; + x15 = v13; } break; case 0LL: { // None - STR* v21; - STRLIT(v21, "No path defined for package ", 28); - uint64_t v22 = mw_mirth_package_Package_name(v11); - VAL v23 = mw_mirth_name_Name_ZToStr(v22); - push_value(x1); - push_resource(MKI64(v12)); - push_str(v21); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(v23, v13); - VAL v24 = pop_value(); - x19 = v24; - VAL r25 = pop_resource(); - x18 = r25; - int64_t r26 = VI64(pop_resource()); - x17 = r26; - uint64_t v27 = pop_u64(); - x16 = v27; - VAL v28 = pop_value(); - x15 = v28; + STR* v19; + STRLIT(v19, "No path defined for package ", 28); + uint64_t v20 = mw_mirth_package_Package_name(v11); + VAL v21 = mw_mirth_name_Name_ZToStr(v20); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(v21, v13); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t v29 = VU64(VTUP(x15)->cells[2]); - decref(x15); - VAL v30 = mw_mirth_name_Name_ZToStr(v29); - STR* v31; - STRLIT(v31, ".mth", 4); - STR* v32 = str_cat(VSTR(v30), v31); - VAL v33 = mw_std_path_Path_join(x19, MKSTR(v32)); - x10 = v33; - x9 = x18; - x8 = x17; + uint64_t v24 = VU64(VTUP(x1)->cells[2]); + decref(x1); + VAL v25 = mw_mirth_name_Name_ZToStr(v24); + STR* v26; + STRLIT(v26, ".mth", 4); + STR* v27 = str_cat(VSTR(v25), v26); + VAL v28 = mw_std_path_Path_join(x17, MKSTR(v27)); + x10 = v28; + x9 = x15; + x8 = v12; } break; default: { decref(v7); - STR* v34; - STRLIT(v34, "expected module name in QName.to-module-path", 44); - push_resource(MKI64(x2)); - push_value(x1); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v34), x3); - VAL v35 = pop_value(); - x10 = v35; - VAL r36 = pop_resource(); - x9 = r36; - int64_t r37 = VI64(pop_resource()); - x8 = r37; + STR* v29; + STRLIT(v29, "expected module name in QName.to-module-path", 44); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v29), x3); } break; } *x6 = x9; @@ -38098,8 +30355,11 @@ static VAL mw_mirth_name_DName_penultimateZ_nameZAsk (VAL x1) { } static int64_t mw_mirth_name_DName_isZ_relativeZAsk (VAL x1) { VAL v2 = mw_mirth_name_DName_rootZAsk(x1); - int64_t v3 = mw_std_maybe_Maybe_1_noneZAsk(v2); - return v3; + int64_t v3 = get_data_tag(v2); + decref(v2); + int64_t v4 = 0LL; + bool v5 = (v3 == v4); + return ((int64_t)v5); } static int64_t mw_mirth_package_Package_index (uint64_t x1) { return ((int64_t)x1); @@ -38170,286 +30430,154 @@ static void mw_mirth_package_Package_pathZ_orZ_search (int64_t x1, VAL x2, uint6 incref(v13); VAL v14 = MKI64(0LL /* Nil */); VAL v15 = mw_std_list_List_1_reverse(v14); - VAL v16; - VAL v17; - mw_std_list_List_1_uncons(v13, &v16, &v17); - int64_t x18; - uint64_t x19; - VAL x20; - VAL x21; - VAL x22; - int64_t x23; - switch (get_data_tag(v16)) { - case 1LL: { // Some - VAL v24 = mtp_std_maybe_Maybe_1_Some(v16); - uint64_t v25 = mw_mirth_package_Package_name(x3); - VAL v26 = mw_mirth_name_Name_ZToStr(v25); - VAL v27 = mw_std_path_Path_join(v24, v26); - VAL v28 = mtw_std_list_List_1_Cons(v27, v15); - int64_t v29 = 1LL /* True */; - x23 = v29; - x22 = v17; - x21 = v28; - x20 = x2; - x19 = x3; - x18 = x1; - } break; - case 0LL: { // None - int64_t v30 = 0LL /* False */; - x23 = v30; - x22 = v17; - x21 = v15; - x20 = x2; - x19 = x3; - x18 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v31 = (x18); - uint64_t v32 = x19; - VAL v33 = (x20); - VAL v34 = (x21); - VAL v35 = x22; - int64_t v36 = x23; - while (((bool)v36)) { - int64_t v37 = (v31); - uint64_t v38 = v32; - VAL v39 = (v33); - VAL v40 = (v34); - VAL v41 = v35; - VAL v42; - VAL v43; - mw_std_list_List_1_uncons(v41, &v42, &v43); - int64_t x44; - uint64_t x45; - VAL x46; - VAL x47; - VAL x48; - int64_t x49; - switch (get_data_tag(v42)) { - case 1LL: { // Some - VAL v50 = mtp_std_maybe_Maybe_1_Some(v42); - uint64_t v51 = mw_mirth_package_Package_name(v38); - VAL v52 = mw_mirth_name_Name_ZToStr(v51); - VAL v53 = mw_std_path_Path_join(v50, v52); - VAL v54 = mtw_std_list_List_1_Cons(v53, v40); - int64_t v55 = 1LL /* True */; - x49 = v55; - x48 = v43; - x47 = v54; - x46 = v39; - x45 = v38; - x44 = v37; + int64_t v16 = 1LL /* True */; + uint64_t v17 = x3; + VAL v18 = v15; + VAL v19 = v13; + int64_t v20 = v16; + int64_t v21 = v16; + while (((bool)v21)) { + uint64_t v22 = v17; + VAL v23 = v18; + VAL v24 = v19; + int64_t v25 = v20; + uint64_t x26; + VAL x27; + VAL x28; + int64_t x29; + switch (get_data_tag(v24)) { + case 1LL: { // Cons + VAL v30; + VAL v31; + mtp_std_list_List_1_Cons(v24, &v30, &v31); + uint64_t v32 = mw_mirth_package_Package_name(v22); + VAL v33 = mw_mirth_name_Name_ZToStr(v32); + VAL v34 = mw_std_path_Path_join(v30, v33); + VAL v35 = mtw_std_list_List_1_Cons(v34, v23); + int64_t v36 = 1LL /* True */; + x29 = v36; + x28 = v31; + x27 = v35; + x26 = v22; } break; - case 0LL: { // None - int64_t v56 = 0LL /* False */; - x49 = v56; - x48 = v43; - x47 = v40; - x46 = v39; - x45 = v38; - x44 = v37; + case 0LL: { // Nil + VAL v37 = MKI64(0LL /* Nil */); + int64_t v38 = 0LL /* False */; + x29 = v38; + x28 = v37; + x27 = v23; + x26 = v22; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v36 = x49; - v35 = x48; - v34 = x47; - v33 = x46; - v32 = x45; - v31 = x44; + v21 = x29; + v20 = x29; + v19 = x28; + v18 = x27; + v17 = x26; } - decref(v35); - VAL v57 = mw_std_list_List_1_reverse(v34); - VAL v58 = MKI64(0LL /* None */); - VAL v59; - VAL v60; - mw_std_list_List_1_uncons(v57, &v59, &v60); - int64_t x61; - uint64_t x62; - VAL x63; - VAL x64; - VAL x65; - int64_t x66; - switch (get_data_tag(v59)) { - case 1LL: { // Some - VAL v67 = mtp_std_maybe_Maybe_1_Some(v59); - incref(v67); - int64_t v68; - int64_t v69; - mw_std_prim_ZPlusWorld_isZ_directoryZAsk(v31, v67, &v68, &v69); - int64_t x70; - uint64_t x71; - VAL x72; - VAL x73; - if (((bool)v69)) { - VAL v74 = mtw_std_maybe_Maybe_1_Some(v67); - x73 = v74; - x72 = v33; - x71 = v32; - x70 = v68; - } else { - decref(v67); - VAL v75 = MKI64(0LL /* None */); - x73 = v75; - x72 = v33; - x71 = v32; - x70 = v68; - } - int64_t x76; - uint64_t x77; - VAL x78; - VAL x79; - VAL x80; - switch (get_data_tag(x73)) { - case 0LL: { // None - x80 = v60; - x79 = v58; - x78 = x72; - x77 = x71; - x76 = x70; - } break; - default: { - decref(v60); - decref(v58); - VAL v81 = MKI64(0LL /* Nil */); - x80 = v81; - x79 = x73; - x78 = x72; - x77 = x71; - x76 = x70; - } break; - } - int64_t v82 = 1LL /* True */; - x66 = v82; - x65 = x80; - x64 = x79; - x63 = x78; - x62 = x77; - x61 = x76; - } break; - case 0LL: { // None - int64_t v83 = 0LL /* False */; - x66 = v83; - x65 = v60; - x64 = v58; - x63 = v33; - x62 = v32; - x61 = v31; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v84 = (x61); - uint64_t v85 = x62; - VAL v86 = (x63); - VAL v87 = x64; - VAL v88 = x65; - int64_t v89 = x66; - while (((bool)v89)) { - int64_t v90 = (v84); - uint64_t v91 = v85; - VAL v92 = (v86); - VAL v93 = v87; - VAL v94 = v88; - VAL v95; - VAL v96; - mw_std_list_List_1_uncons(v94, &v95, &v96); - int64_t x97; - uint64_t x98; - VAL x99; - VAL x100; - VAL x101; - int64_t x102; - switch (get_data_tag(v95)) { + decref(v19); + VAL v39 = mw_std_list_List_1_reverse(v18); + VAL v40 = MKI64(0LL /* None */); + int64_t v41 = 1LL /* True */; + int64_t v42 = x1; + VAL v43 = x2; + VAL v44 = v40; + VAL v45 = v39; + int64_t v46 = v41; + int64_t v47 = v41; + while (((bool)v47)) { + int64_t v48 = v42; + VAL v49 = v43; + VAL v50 = v44; + VAL v51 = v45; + int64_t v52 = v46; + VAL v53; + VAL v54; + mw_std_list_List_1_uncons(v51, &v53, &v54); + int64_t x55; + VAL x56; + VAL x57; + VAL x58; + int64_t x59; + switch (get_data_tag(v53)) { case 1LL: { // Some - VAL v103 = mtp_std_maybe_Maybe_1_Some(v95); - incref(v103); - int64_t v104; - int64_t v105; - mw_std_prim_ZPlusWorld_isZ_directoryZAsk(v90, v103, &v104, &v105); - int64_t x106; - uint64_t x107; - VAL x108; - VAL x109; - if (((bool)v105)) { - VAL v110 = mtw_std_maybe_Maybe_1_Some(v103); - x109 = v110; - x108 = v92; - x107 = v91; - x106 = v104; + VAL v60 = mtp_std_maybe_Maybe_1_Some(v53); + incref(v60); + int64_t v61; + int64_t v62; + mw_std_prim_ZPlusWorld_isZ_directoryZAsk(v48, v60, &v61, &v62); + int64_t x63; + VAL x64; + VAL x65; + if (((bool)v62)) { + VAL v66 = mtw_std_maybe_Maybe_1_Some(v60); + x65 = v66; + x64 = v49; + x63 = v61; } else { - decref(v103); - VAL v111 = MKI64(0LL /* None */); - x109 = v111; - x108 = v92; - x107 = v91; - x106 = v104; + decref(v60); + VAL v67 = MKI64(0LL /* None */); + x65 = v67; + x64 = v49; + x63 = v61; } - int64_t x112; - uint64_t x113; - VAL x114; - VAL x115; - VAL x116; - switch (get_data_tag(x109)) { + int64_t x68; + VAL x69; + VAL x70; + VAL x71; + switch (get_data_tag(x65)) { case 0LL: { // None - x116 = v96; - x115 = v93; - x114 = x108; - x113 = x107; - x112 = x106; + x71 = v54; + x70 = v50; + x69 = x64; + x68 = x63; } break; default: { - decref(v96); - decref(v93); - VAL v117 = MKI64(0LL /* Nil */); - x116 = v117; - x115 = x109; - x114 = x108; - x113 = x107; - x112 = x106; + decref(v54); + decref(v50); + VAL v72 = MKI64(0LL /* Nil */); + x71 = v72; + x70 = x65; + x69 = x64; + x68 = x63; } break; } - int64_t v118 = 1LL /* True */; - x102 = v118; - x101 = x116; - x100 = x115; - x99 = x114; - x98 = x113; - x97 = x112; + int64_t v73 = 1LL /* True */; + x59 = v73; + x58 = x71; + x57 = x70; + x56 = x69; + x55 = x68; } break; case 0LL: { // None - int64_t v119 = 0LL /* False */; - x102 = v119; - x101 = v96; - x100 = v93; - x99 = v92; - x98 = v91; - x97 = v90; + int64_t v74 = 0LL /* False */; + x59 = v74; + x58 = v54; + x57 = v50; + x56 = v49; + x55 = v48; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v89 = x102; - v88 = x101; - v87 = x100; - v86 = x99; - v85 = x98; - v84 = x97; + v47 = x59; + v46 = x59; + v45 = x58; + v44 = x57; + v43 = x56; + v42 = x55; } - decref(v88); - incref(v87); - void* v120 = mfld_mirth_package_Package_ZTildepath(v85); - mut_set(v87, v120); - x10 = v87; - x9 = v86; - x8 = v84; + decref(v45); + incref(v44); + void* v75 = mfld_mirth_package_Package_ZTildepath(v17); + mut_set(v44, v75); + x10 = v44; + x9 = v43; + x8 = v42; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -38478,27 +30606,25 @@ static VAL mw_mirth_package_Package_pathZBang (VAL x1, VAL x2, uint64_t x3) { STRLIT(v9, "", 0); STR* v10; STRLIT(v10, "Tried to set different path for the same package ", 49); - VAL v11 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v10), MKSTR(v9))); + VAL v11 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v10), MKSTR(v9)); STR* v12; STRLIT(v12, "(package = ", 11); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11)); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11); uint64_t v14 = mw_mirth_package_Package_name(x3); VAL v15 = mw_mirth_name_Name_ZToStr(v14); - VAL v16 = (mw_std_str_ZPlusStr_pushZ_strZBang(v15, v13)); + VAL v16 = mw_std_str_ZPlusStr_pushZ_strZBang(v15, v13); STR* v17; STRLIT(v17, ", path 1 = ", 11); - VAL v18 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v17), v16)); - VAL v19 = (mw_std_prim_Str_showZThen(x2, v18)); + VAL v18 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v17), v16); + VAL v19 = mw_std_prim_Str_showZThen(x2, v18); STR* v20; STRLIT(v20, ", path 2 = ", 11); - VAL v21 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v20), v19)); - VAL v22 = (mw_std_prim_Str_showZThen(v6, v21)); + VAL v21 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v20), v19); + VAL v22 = mw_std_prim_Str_showZThen(v6, v21); STR* v23; STRLIT(v23, ").", 2); - VAL v24 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v23), v22)); + VAL v24 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v23), v22); mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(v24, x1); - VAL r25 = pop_resource(); - x8 = r25; } x5 = x8; } break; @@ -38521,7 +30647,7 @@ static void mw_mirth_package_Package_newZBang (VAL x1, VAL x2, uint64_t x3, VAL void* v8 = mfld_mirth_package_Package_ZTildepath(v6); mut_set(x2, v8); VAL v9 = mtw_mirth_def_Def_DefPackage(v6); - VAL v10 = (mw_mirth_def_Def_register(x1, v9)); + VAL v10 = mw_mirth_def_Def_register(x1, v9); *x5 = v6; *x4 = v10; } @@ -38535,7 +30661,7 @@ static void mw_mirth_package_Package_newZ_orZ_pathZBang (VAL x1, VAL x2, uint64_ case 1LL: { // Some VAL v10 = mtp_std_maybe_Maybe_1_Some(v7); incref(v10); - VAL v11 = (mw_mirth_package_Package_pathZBang(v6, x2, VU64(v10))); + VAL v11 = mw_mirth_package_Package_pathZBang(v6, x2, VU64(v10)); x9 = v11; x8 = VU64(v10); } break; @@ -38561,39 +30687,36 @@ static void mw_mirth_package_Package_find (VAL x1, uint64_t x2, VAL *x3, VAL *x4 VAL v8; mw_mirth_name_QName_defZ_softZAsk(x1, v6, &v7, &v8); VAL x9; - VAL x10; switch (get_data_tag(v8)) { case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v8); - VAL v12 = mw_mirth_def_Def_packageZAsk(v11); - x10 = v12; - x9 = v7; + VAL v10 = mtp_std_maybe_Maybe_1_Some(v8); + VAL v11 = mw_mirth_def_Def_packageZAsk(v10); + x9 = v11; } break; case 0LL: { // None - VAL v13 = MKI64(0LL /* None */); - x10 = v13; - x9 = v7; + VAL v12 = MKI64(0LL /* None */); + x9 = v12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x4 = x10; - *x3 = x9; + *x4 = x9; + *x3 = v7; } static void mw_mirth_package_Package_findZ_orZ_newZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { VAL v5; VAL v6; mw_mirth_package_Package_find(x1, x2, &v5, &v6); - uint64_t x7; - VAL x8; + VAL x7; + uint64_t x8; uint64_t x9; switch (get_data_tag(v6)) { case 1LL: { // Some VAL v10 = mtp_std_maybe_Maybe_1_Some(v6); x9 = VU64(v10); - x8 = v5; - x7 = x2; + x8 = x2; + x7 = v5; } break; case 0LL: { // None VAL v11 = MKI64(0LL /* None */); @@ -38601,15 +30724,15 @@ static void mw_mirth_package_Package_findZ_orZ_newZBang (VAL x1, uint64_t x2, VA uint64_t v13; mw_mirth_package_Package_newZBang(v5, v11, x2, &v12, &v13); x9 = v13; - x8 = v12; - x7 = x2; + x8 = x2; + x7 = v12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } *x4 = x9; - *x3 = x8; + *x3 = x7; } static int64_t mw_mirth_package_Package_ZEqualZEqual (uint64_t x1, uint64_t x2) { int64_t v3 = mw_mirth_package_Package_index(x1); @@ -38660,145 +30783,101 @@ static void mw_mirth_lexer_runZ_lexerZBang (VAL x1, int64_t x2, VAL x3, uint64_t int64_t v10; VAL v11; mw_std_prim_ZPlusWorld_openZ_fileZBang(v9, x2, &v10, &v11); - uint64_t x12; + VAL x12; VAL x13; - int64_t x14; - VAL x15; + VAL x14; switch (get_data_tag(v11)) { case 0LL: { // +FileOk - VAL v16 = (mtp_std_file_ZPlusFileZAsk_ZPlusFileOk(v11)); - x15 = v16; - x14 = v10; - x13 = v7; - x12 = v8; + VAL v15 = mtp_std_file_ZPlusFileZAsk_ZPlusFileOk(v11); + x14 = v15; + x13 = MKI64(v10); + x12 = v7; } break; case 1LL: { // +FileErr - VAL v17 = mtp_std_file_ZPlusFileZAsk_ZPlusFileErr(v11); - lpush(&lbl_lexerZ_module, MKU64(v8)); - push_resource(MKI64(v10)); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(v17, v7); - VAL r18 = pop_resource(); - x15 = r18; - int64_t r19 = VI64(pop_resource()); - x14 = r19; - VAL r20 = pop_resource(); - x13 = r20; - uint64_t v21 = VU64(lpop(&lbl_lexerZ_module)); - x12 = v21; + VAL v16 = mtp_std_file_ZPlusFileZAsk_ZPlusFileErr(v11); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(v16, v7); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v22 = (mw_std_input_ZPlusInput_startZBang(x15)); - int64_t v23 = 1LL; - int64_t v24 = mw_std_prim_Int_ZToRow(v23); - int64_t v25 = 1LL; - int64_t v26 = mw_std_prim_Int_ZToCol(v25); - VAL v27 = MKI64(0LL /* Nil */); - uint64_t v28 = mw_mirth_token_Token_allocZ_noneZBang(); - VAL v29 = (mtw_mirth_lexer_ZPlusLexer_ZPlusLexer(x12, v24, v26, v27, v28, v22)); - int64_t v30; - VAL v31; - mw_mirth_lexer_ZPlusLexer_doneZAsk(v29, &v30, &v31); - bool v32 = !((bool)v30); - int64_t v33 = (x14); - VAL v34 = (x13); - uint64_t v35 = v28; - VAL v36 = (v31); - bool v37 = v32; - while (v37) { - int64_t v38 = (v33); - VAL v39 = (v34); - uint64_t v40 = v35; - VAL v41 = (v36); + VAL v19 = mw_std_input_ZPlusInput_startZBang(x14); + int64_t v20 = 1LL; + int64_t v21 = mw_std_prim_Int_ZToRow(v20); + int64_t v22 = 1LL; + int64_t v23 = mw_std_prim_Int_ZToCol(v22); + VAL v24 = MKI64(0LL /* Nil */); + uint64_t v25 = mw_mirth_token_Token_allocZ_noneZBang(); + VAL v26 = mtw_mirth_lexer_ZPlusLexer_ZPlusLexer(v8, v21, v23, v24, v25, v19); + int64_t v27; + VAL v28; + mw_mirth_lexer_ZPlusLexer_doneZAsk(v26, &v27, &v28); + bool v29 = !((bool)v27); + VAL v30 = x13; + VAL v31 = x12; + uint64_t v32 = v25; + VAL v33 = v28; + bool v34 = v29; + while (v34) { + VAL v35 = v30; + VAL v36 = v31; + uint64_t v37 = v32; + VAL v38 = v33; + VAL v39; + VAL v40; + mw_mirth_lexer_lexerZ_nextZBang(v36, v38, &v39, &v40); + int64_t v41; VAL v42; - VAL v43; - mw_mirth_lexer_lexerZ_nextZBang(v39, v41, &v42, &v43); - int64_t v44; - VAL v45; - mw_mirth_lexer_ZPlusLexer_doneZAsk(v43, &v44, &v45); - bool v46 = !((bool)v44); - v37 = v46; - v36 = v45; - v35 = v40; - v34 = v42; - v33 = v38; - } - VAL v47 = MKI64(0LL /* TokenNone */); - VAL v48 = (mw_mirth_lexer_lexerZ_emitZBang(v47, v36)); - uint64_t v49; - int64_t v50; - int64_t v51; - VAL v52; - uint64_t v53; + mw_mirth_lexer_ZPlusLexer_doneZAsk(v40, &v41, &v42); + bool v43 = !((bool)v41); + v34 = v43; + v33 = v42; + v32 = v37; + v31 = v39; + v30 = v35; + } + VAL v44 = MKI64(0LL /* TokenNone */); + VAL v45 = mw_mirth_lexer_lexerZ_emitZBang(v44, v33); + uint64_t v46; + int64_t v47; + int64_t v48; + VAL v49; + uint64_t v50; + VAL v51; + mtp_mirth_lexer_ZPlusLexer_ZPlusLexer(v45, &v46, &v47, &v48, &v49, &v50, &v51); + VAL v52 = mw_std_input_ZPlusInput_endZBang(v51); + int64_t v53 = mw_std_file_ZPlusFile_closeZ_fileZBang(VI64(v30), v52); VAL v54; - mtp_mirth_lexer_ZPlusLexer_ZPlusLexer(v48, &v49, &v50, &v51, &v52, &v53, &v54); - VAL v55 = (mw_std_input_ZPlusInput_endZBang(v54)); - int64_t v56 = (mw_std_file_ZPlusFile_closeZ_fileZBang(v33, v55)); - VAL v57; - VAL v58; - mw_std_list_List_1_uncons(v52, &v57, &v58); - decref(v58); - uint64_t x59; - uint64_t x60; - int64_t x61; - int64_t x62; - uint64_t x63; - int64_t x64; - VAL x65; - switch (get_data_tag(v57)) { + VAL v55; + mw_std_list_List_1_uncons(v49, &v54, &v55); + decref(v55); + VAL x56; + switch (get_data_tag(v54)) { case 1LL: { // Some - VAL v66 = mtp_std_maybe_Maybe_1_Some(v57); - STR* v67; - STRLIT(v67, "Mismatched left parenthesis.", 28); - push_u64(v35); - lpush(&lbl_lexerZ_module, MKU64(v49)); - lpush(&lbl_lexerZ_row, MKI64(v50)); - lpush(&lbl_lexerZ_col, MKI64(v51)); - lpush(&lbl_lexerZ_lastZ_token, MKU64(v53)); - push_resource(MKI64(v56)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v66), MKSTR(v67), v34); - VAL r68 = pop_resource(); - x65 = r68; - int64_t r69 = VI64(pop_resource()); - x64 = r69; - uint64_t v70 = VU64(lpop(&lbl_lexerZ_lastZ_token)); - x63 = v70; - int64_t v71 = VI64(lpop(&lbl_lexerZ_col)); - x62 = v71; - int64_t v72 = VI64(lpop(&lbl_lexerZ_row)); - x61 = v72; - uint64_t v73 = VU64(lpop(&lbl_lexerZ_module)); - x60 = v73; - uint64_t v74 = pop_u64(); - x59 = v74; + VAL v57 = mtp_std_maybe_Maybe_1_Some(v54); + STR* v58; + STRLIT(v58, "Mismatched left parenthesis.", 28); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v57), MKSTR(v58), v31); } break; case 0LL: { // None - x65 = v34; - x64 = v56; - x63 = v53; - x62 = v51; - x61 = v50; - x60 = v49; - x59 = v35; + x56 = v31; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t v75 = mw_mirth_token_Token_allocZ_noneZBang(); - void* v76 = mfld_mirth_module_Module_ZTildeend(x60); - mut_set(MKU64(v75), v76); - uint64_t v77 = mw_mirth_token_Token_succ(x59); - void* v78 = mfld_mirth_module_Module_ZTildestart(x60); - mut_set(MKU64(v77), v78); - *x6 = x65; - *x5 = x64; - *x4 = x60; + uint64_t v60 = mw_mirth_token_Token_allocZ_noneZBang(); + void* v61 = mfld_mirth_module_Module_ZTildeend(v46); + mut_set(MKU64(v60), v61); + uint64_t v62 = mw_mirth_token_Token_succ(v32); + void* v63 = mfld_mirth_module_Module_ZTildestart(v46); + mut_set(MKU64(v62), v63); + *x6 = x56; + *x5 = v53; + *x4 = v46; } static void mw_mirth_lexer_ZPlusLexer_doneZAsk (VAL x1, int64_t *x2, VAL *x3) { - VAL v4 = (VVAL(VTUP(x1)->cells[6])); + VAL v4 = VVAL(VTUP(x1)->cells[6]); int64_t v5; VAL v6; mw_std_input_ZPlusInput_doneZAsk(v4, &v5, &v6); @@ -38837,106 +30916,106 @@ static void mw_mirth_lexer_lexerZ_nextZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL x8; switch (v5) { case 10LL: { // BLF - VAL v9 = (mw_mirth_lexer_lexerZ_newlineZBang(v6)); - VAL v10 = (mw_mirth_lexer_lexerZ_moveZBang(v9)); + VAL v9 = mw_mirth_lexer_lexerZ_newlineZBang(v6); + VAL v10 = mw_mirth_lexer_lexerZ_moveZBang(v9); x8 = v10; x7 = x1; } break; case 32LL: { // BSPACE - VAL v11 = (mw_mirth_lexer_lexerZ_moveZBang(v6)); + VAL v11 = mw_mirth_lexer_lexerZ_moveZBang(v6); x8 = v11; x7 = x1; } break; case 9LL: { // BHT - VAL v12 = (mw_mirth_lexer_lexerZ_moveZBang(v6)); + VAL v12 = mw_mirth_lexer_lexerZ_moveZBang(v6); x8 = v12; x7 = x1; } break; case 11LL: { // BVT - VAL v13 = (mw_mirth_lexer_lexerZ_moveZBang(v6)); + VAL v13 = mw_mirth_lexer_lexerZ_moveZBang(v6); x8 = v13; x7 = x1; } break; case 13LL: { // BCR - VAL v14 = (mw_mirth_lexer_lexerZ_moveZBang(v6)); + VAL v14 = mw_mirth_lexer_lexerZ_moveZBang(v6); x8 = v14; x7 = x1; } break; case 35LL: { // BHASH - VAL v15 = (mw_mirth_lexer_lexerZ_skipZ_commentZBang(v6)); - VAL v16 = (mw_mirth_lexer_lexerZ_moveZBang(v15)); + VAL v15 = mw_mirth_lexer_lexerZ_skipZ_commentZBang(v6); + VAL v16 = mw_mirth_lexer_lexerZ_moveZBang(v15); x8 = v16; x7 = x1; } break; case 44LL: { // BCOMMA - VAL v17 = (mw_mirth_lexer_lexerZ_closeZ_colonsZBang(v6)); + VAL v17 = mw_mirth_lexer_lexerZ_closeZ_colonsZBang(v6); VAL v18 = MKI64(1LL /* TokenComma */); - VAL v19 = (mw_mirth_lexer_lexerZ_emitZBang(v18, v17)); - VAL v20 = (mw_mirth_lexer_lexerZ_moveZBang(v19)); + VAL v19 = mw_mirth_lexer_lexerZ_emitZBang(v18, v17); + VAL v20 = mw_mirth_lexer_lexerZ_moveZBang(v19); x8 = v20; x7 = x1; } break; case 41LL: { // BRPAREN - VAL v21 = (mw_mirth_lexer_lexerZ_closeZ_colonsZBang(v6)); + VAL v21 = mw_mirth_lexer_lexerZ_closeZ_colonsZBang(v6); VAL v22; VAL v23; mw_mirth_lexer_lexerZ_emitZ_rparenZBang(x1, v21, &v22, &v23); - VAL v24 = (mw_mirth_lexer_lexerZ_moveZBang(v23)); + VAL v24 = mw_mirth_lexer_lexerZ_moveZBang(v23); x8 = v24; x7 = v22; } break; case 93LL: { // BRSQUARE - VAL v25 = (mw_mirth_lexer_lexerZ_closeZ_colonsZBang(v6)); + VAL v25 = mw_mirth_lexer_lexerZ_closeZ_colonsZBang(v6); VAL v26; VAL v27; mw_mirth_lexer_lexerZ_emitZ_rsquareZBang(x1, v25, &v26, &v27); - VAL v28 = (mw_mirth_lexer_lexerZ_moveZBang(v27)); + VAL v28 = mw_mirth_lexer_lexerZ_moveZBang(v27); x8 = v28; x7 = v26; } break; case 125LL: { // BRCURLY - VAL v29 = (mw_mirth_lexer_lexerZ_closeZ_colonsZBang(v6)); + VAL v29 = mw_mirth_lexer_lexerZ_closeZ_colonsZBang(v6); VAL v30; VAL v31; mw_mirth_lexer_lexerZ_emitZ_rcurlyZBang(x1, v29, &v30, &v31); - VAL v32 = (mw_mirth_lexer_lexerZ_moveZBang(v31)); + VAL v32 = mw_mirth_lexer_lexerZ_moveZBang(v31); x8 = v32; x7 = v30; } break; case 58LL: { // BCOLON - VAL v33 = (mw_mirth_lexer_lexerZ_prepareZ_forZ_argsZBang(v6)); - VAL v34 = (mw_mirth_lexer_lexerZ_emitZ_lcolonZBang(v33)); - VAL v35 = (mw_mirth_lexer_lexerZ_moveZBang(v34)); + VAL v33 = mw_mirth_lexer_lexerZ_prepareZ_forZ_argsZBang(v6); + VAL v34 = mw_mirth_lexer_lexerZ_emitZ_lcolonZBang(v33); + VAL v35 = mw_mirth_lexer_lexerZ_moveZBang(v34); x8 = v35; x7 = x1; } break; case 40LL: { // BLPAREN - VAL v36 = (mw_mirth_lexer_lexerZ_prepareZ_forZ_argsZBang(v6)); - VAL v37 = (mw_mirth_lexer_lexerZ_emitZ_lparenZBang(v36)); - VAL v38 = (mw_mirth_lexer_lexerZ_moveZBang(v37)); + VAL v36 = mw_mirth_lexer_lexerZ_prepareZ_forZ_argsZBang(v6); + VAL v37 = mw_mirth_lexer_lexerZ_emitZ_lparenZBang(v36); + VAL v38 = mw_mirth_lexer_lexerZ_moveZBang(v37); x8 = v38; x7 = x1; } break; case 91LL: { // BLSQUARE - VAL v39 = (mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang(v6)); - VAL v40 = (mw_mirth_lexer_lexerZ_emitZ_lsquareZBang(v39)); - VAL v41 = (mw_mirth_lexer_lexerZ_moveZBang(v40)); + VAL v39 = mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang(v6); + VAL v40 = mw_mirth_lexer_lexerZ_emitZ_lsquareZBang(v39); + VAL v41 = mw_mirth_lexer_lexerZ_moveZBang(v40); x8 = v41; x7 = x1; } break; case 123LL: { // BLCURLY - VAL v42 = (mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang(v6)); - VAL v43 = (mw_mirth_lexer_lexerZ_emitZ_lcurlyZBang(v42)); - VAL v44 = (mw_mirth_lexer_lexerZ_moveZBang(v43)); + VAL v42 = mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang(v6); + VAL v43 = mw_mirth_lexer_lexerZ_emitZ_lcurlyZBang(v42); + VAL v44 = mw_mirth_lexer_lexerZ_moveZBang(v43); x8 = v44; x7 = x1; } break; case 34LL: { // BQUOTE - VAL v45 = (mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang(v6)); + VAL v45 = mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang(v6); VAL v46; VAL v47; mw_mirth_lexer_lexerZ_emitZ_stringZBang(x1, v45, &v46, &v47); - VAL v48 = (mw_mirth_lexer_lexerZ_moveZBang(v47)); + VAL v48 = mw_mirth_lexer_lexerZ_moveZBang(v47); x8 = v48; x7 = v46; } break; @@ -38945,18 +31024,14 @@ static void mw_mirth_lexer_lexerZ_nextZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL x50; VAL x51; if (((bool)v49)) { - VAL v52 = (mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang(v6)); - VAL v53 = (mw_mirth_lexer_lexerZ_emitZ_nameZBang(v52)); + VAL v52 = mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang(v6); + VAL v53 = mw_mirth_lexer_lexerZ_emitZ_nameZBang(v52); x51 = v53; x50 = x1; } else { STR* v54; STRLIT(v54, "Unrecognized byte.", 18); mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang(MKSTR(v54), x1, v6); - VAL r55 = pop_resource(); - x51 = r55; - VAL r56 = pop_resource(); - x50 = r56; } x8 = x51; x7 = x50; @@ -38982,140 +31057,77 @@ static VAL mw_mirth_lexer_lexerZ_emitZ_lcolonZBang (VAL x1) { uint64_t v3; VAL v4; mw_mirth_lexer_lexerZ_makeZBang(v2, x1, &v3, &v4); - VAL v5 = (mw_mirth_lexer_lexerZ_stackZ_pushZBang(v3, v4)); + VAL v5 = mw_mirth_lexer_lexerZ_stackZ_pushZBang(v3, v4); return v5; } static VAL mw_mirth_lexer_lexerZ_closeZ_colonsZBang (VAL x1) { - VAL v2; - VAL v3; - mw_mirth_lexer_lexerZ_stackZ_peek(x1, &v2, &v3); - VAL x4; - VAL x5; - switch (get_data_tag(v2)) { - case 1LL: { // Some - VAL v6 = mtp_std_maybe_Maybe_1_Some(v2); - incref(v6); - int64_t v7 = mw_mirth_token_Token_lcolonZ_openZAsk(VU64(v6)); - VAL x8; - VAL x9; - if (((bool)v7)) { - VAL v10 = mtw_std_maybe_Maybe_1_Some(v6); - x9 = v10; - x8 = v3; - } else { - decref(v6); - VAL v11 = MKI64(0LL /* None */); - x9 = v11; - x8 = v3; - } - x5 = x9; - x4 = x8; - } break; - case 0LL: { // None - VAL v12 = MKI64(0LL /* None */); - x5 = v12; - x4 = v3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x13; - int64_t x14; - switch (get_data_tag(x5)) { - case 1LL: { // Some - VAL v15 = mtp_std_maybe_Maybe_1_Some(x5); - VAL v16 = (mw_mirth_lexer_lexerZ_stackZ_drop(x4)); - incref(v15); - VAL v17 = mtw_mirth_token_TokenValue_TokenRColon(VU64(v15)); - uint64_t v18; - VAL v19; - mw_mirth_lexer_lexerZ_makeZBang(v17, v16, &v18, &v19); - VAL v20 = mtw_mirth_token_TokenValue_TokenLColon(v18); - void* v21 = mfld_mirth_token_Token_ZTildevalue(VU64(v15)); - mut_set(v20, v21); - int64_t v22 = 1LL /* True */; - x14 = v22; - x13 = v19; - } break; - case 0LL: { // None - int64_t v23 = 0LL /* False */; - x14 = v23; - x13 = x4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v24 = (x13); - int64_t v25 = x14; - while (((bool)v25)) { - VAL v26 = (v24); - VAL v27; - VAL v28; - mw_mirth_lexer_lexerZ_stackZ_peek(v26, &v27, &v28); - VAL x29; - VAL x30; - switch (get_data_tag(v27)) { + int64_t v2 = 1LL /* True */; + VAL v3 = x1; + int64_t v4 = v2; + int64_t v5 = v2; + while (((bool)v5)) { + VAL v6 = v3; + int64_t v7 = v4; + VAL v8; + VAL v9; + mw_mirth_lexer_lexerZ_stackZ_peek(v6, &v8, &v9); + VAL x10; + switch (get_data_tag(v8)) { case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v27); - incref(v31); - int64_t v32 = mw_mirth_token_Token_lcolonZ_openZAsk(VU64(v31)); - VAL x33; - VAL x34; - if (((bool)v32)) { - VAL v35 = mtw_std_maybe_Maybe_1_Some(v31); - x34 = v35; - x33 = v28; + VAL v11 = mtp_std_maybe_Maybe_1_Some(v8); + incref(v11); + int64_t v12 = mw_mirth_token_Token_lcolonZ_openZAsk(VU64(v11)); + VAL x13; + if (((bool)v12)) { + VAL v14 = mtw_std_maybe_Maybe_1_Some(v11); + x13 = v14; } else { - decref(v31); - VAL v36 = MKI64(0LL /* None */); - x34 = v36; - x33 = v28; + decref(v11); + VAL v15 = MKI64(0LL /* None */); + x13 = v15; } - x30 = x34; - x29 = x33; + x10 = x13; } break; case 0LL: { // None - VAL v37 = MKI64(0LL /* None */); - x30 = v37; - x29 = v28; + VAL v16 = MKI64(0LL /* None */); + x10 = v16; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x38; - int64_t x39; - switch (get_data_tag(x30)) { + VAL x17; + int64_t x18; + switch (get_data_tag(x10)) { case 1LL: { // Some - VAL v40 = mtp_std_maybe_Maybe_1_Some(x30); - VAL v41 = (mw_mirth_lexer_lexerZ_stackZ_drop(x29)); - incref(v40); - VAL v42 = mtw_mirth_token_TokenValue_TokenRColon(VU64(v40)); - uint64_t v43; - VAL v44; - mw_mirth_lexer_lexerZ_makeZBang(v42, v41, &v43, &v44); - VAL v45 = mtw_mirth_token_TokenValue_TokenLColon(v43); - void* v46 = mfld_mirth_token_Token_ZTildevalue(VU64(v40)); - mut_set(v45, v46); - int64_t v47 = 1LL /* True */; - x39 = v47; - x38 = v44; + VAL v19 = mtp_std_maybe_Maybe_1_Some(x10); + VAL v20 = mw_mirth_lexer_lexerZ_stackZ_drop(v9); + incref(v19); + VAL v21 = mtw_mirth_token_TokenValue_TokenRColon(VU64(v19)); + uint64_t v22; + VAL v23; + mw_mirth_lexer_lexerZ_makeZBang(v21, v20, &v22, &v23); + VAL v24 = mtw_mirth_token_TokenValue_TokenLColon(v22); + void* v25 = mfld_mirth_token_Token_ZTildevalue(VU64(v19)); + mut_set(v24, v25); + int64_t v26 = 1LL /* True */; + x18 = v26; + x17 = v23; } break; case 0LL: { // None - int64_t v48 = 0LL /* False */; - x39 = v48; - x38 = x29; + int64_t v27 = 0LL /* False */; + x18 = v27; + x17 = v9; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v25 = x39; - v24 = x38; + v5 = x18; + v4 = x18; + v3 = x17; } - return v24; + return v3; } static VAL mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang (VAL x1) { uint64_t v2 = VU64(VTUP(x1)->cells[5]); @@ -39124,7 +31136,7 @@ static VAL mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang (VAL x1) { if (((bool)v3)) { x4 = x1; } else { - VAL v5 = (mw_mirth_lexer_lexerZ_closeZ_colonsZBang(x1)); + VAL v5 = mw_mirth_lexer_lexerZ_closeZ_colonsZBang(x1); x4 = v5; } return x4; @@ -39132,29 +31144,25 @@ static VAL mw_mirth_lexer_lexerZ_prepareZ_forZ_atomZBang (VAL x1) { static VAL mw_mirth_lexer_lexerZ_prepareZ_forZ_argsZBang (VAL x1) { uint64_t v2 = VU64(VTUP(x1)->cells[5]); VAL v3 = mw_mirth_token_Token_nameZDivdnameZAsk(v2); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - decref(v5); - x4 = x1; - } break; - case 0LL: { // None - VAL v6 = (mw_mirth_lexer_lexerZ_closeZ_colonsZBang(x1)); - x4 = v6; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v4 = get_data_tag(v3); + decref(v3); + int64_t v5 = 0LL; + bool v6 = (v4 == v5); + VAL x7; + if (v6) { + VAL v8 = mw_mirth_lexer_lexerZ_closeZ_colonsZBang(x1); + x7 = v8; + } else { + x7 = x1; } - return x4; + return x7; } static VAL mw_mirth_lexer_lexerZ_emitZ_lparenZBang (VAL x1) { VAL v2 = MKI64(2LL /* TokenLParenOpen */); uint64_t v3; VAL v4; mw_mirth_lexer_lexerZ_makeZBang(v2, x1, &v3, &v4); - VAL v5 = (mw_mirth_lexer_lexerZ_stackZ_pushZBang(v3, v4)); + VAL v5 = mw_mirth_lexer_lexerZ_stackZ_pushZBang(v3, v4); return v5; } static void mw_mirth_lexer_lexerZ_emitZ_rparenZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { @@ -39168,10 +31176,6 @@ static void mw_mirth_lexer_lexerZ_emitZ_rparenZBang (VAL x1, VAL x2, VAL *x3, VA STR* v9; STRLIT(v9, "Mismatched right parenthesis.", 29); mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang(MKSTR(v9), x1, v6); - VAL r10 = pop_resource(); - x8 = r10; - VAL r11 = pop_resource(); - x7 = r11; } break; case 1LL: { // Some VAL v12 = mtp_std_maybe_Maybe_1_Some(v5); @@ -39193,12 +31197,7 @@ static void mw_mirth_lexer_lexerZ_emitZ_rparenZBang (VAL x1, VAL x2, VAL *x3, VA } else { STR* v21; STRLIT(v21, "Mismatched right parenthesis.", 29); - push_value(v12); mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang(MKSTR(v21), x1, v6); - VAL r22 = pop_resource(); - x15 = r22; - VAL r23 = pop_resource(); - x14 = r23; } x8 = x15; x7 = x14; @@ -39215,7 +31214,7 @@ static VAL mw_mirth_lexer_lexerZ_emitZ_lsquareZBang (VAL x1) { uint64_t v3; VAL v4; mw_mirth_lexer_lexerZ_makeZBang(v2, x1, &v3, &v4); - VAL v5 = (mw_mirth_lexer_lexerZ_stackZ_pushZBang(v3, v4)); + VAL v5 = mw_mirth_lexer_lexerZ_stackZ_pushZBang(v3, v4); return v5; } static void mw_mirth_lexer_lexerZ_emitZ_rsquareZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { @@ -39229,10 +31228,6 @@ static void mw_mirth_lexer_lexerZ_emitZ_rsquareZBang (VAL x1, VAL x2, VAL *x3, V STR* v9; STRLIT(v9, "Mismatched right square bracket.", 32); mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang(MKSTR(v9), x1, v6); - VAL r10 = pop_resource(); - x8 = r10; - VAL r11 = pop_resource(); - x7 = r11; } break; case 1LL: { // Some VAL v12 = mtp_std_maybe_Maybe_1_Some(v5); @@ -39254,12 +31249,7 @@ static void mw_mirth_lexer_lexerZ_emitZ_rsquareZBang (VAL x1, VAL x2, VAL *x3, V } else { STR* v21; STRLIT(v21, "Mismatched right square bracket.", 32); - push_value(v12); mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang(MKSTR(v21), x1, v6); - VAL r22 = pop_resource(); - x15 = r22; - VAL r23 = pop_resource(); - x14 = r23; } x8 = x15; x7 = x14; @@ -39276,7 +31266,7 @@ static VAL mw_mirth_lexer_lexerZ_emitZ_lcurlyZBang (VAL x1) { uint64_t v3; VAL v4; mw_mirth_lexer_lexerZ_makeZBang(v2, x1, &v3, &v4); - VAL v5 = (mw_mirth_lexer_lexerZ_stackZ_pushZBang(v3, v4)); + VAL v5 = mw_mirth_lexer_lexerZ_stackZ_pushZBang(v3, v4); return v5; } static void mw_mirth_lexer_lexerZ_emitZ_rcurlyZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { @@ -39290,10 +31280,6 @@ static void mw_mirth_lexer_lexerZ_emitZ_rcurlyZBang (VAL x1, VAL x2, VAL *x3, VA STR* v9; STRLIT(v9, "Mismatched right curly brace.", 29); mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang(MKSTR(v9), x1, v6); - VAL r10 = pop_resource(); - x8 = r10; - VAL r11 = pop_resource(); - x7 = r11; } break; case 1LL: { // Some VAL v12 = mtp_std_maybe_Maybe_1_Some(v5); @@ -39315,12 +31301,7 @@ static void mw_mirth_lexer_lexerZ_emitZ_rcurlyZBang (VAL x1, VAL x2, VAL *x3, VA } else { STR* v21; STRLIT(v21, "Mismatched right curly brace.", 29); - push_value(v12); mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang(MKSTR(v21), x1, v6); - VAL r22 = pop_resource(); - x15 = r22; - VAL r23 = pop_resource(); - x14 = r23; } x8 = x15; x7 = x14; @@ -39342,22 +31323,22 @@ static VAL mw_mirth_lexer_lexerZ_emitZ_nameZBang (VAL x1) { VAL v7; mw_mirth_lexer_lexerZ_peek(x1, &v6, &v7); int64_t v8 = mw_std_byte_Byte_isZ_nameZ_byte(v6); - STR* v9 = (v2); + STR* v9 = v2; uint64_t v10 = v3; int64_t v11 = v4; int64_t v12 = v5; - VAL v13 = (v7); + VAL v13 = v7; int64_t v14 = v6; int64_t v15 = v8; while (((bool)v15)) { - STR* v16 = (v9); + STR* v16 = v9; uint64_t v17 = v10; int64_t v18 = v11; int64_t v19 = v12; - VAL v20 = (v13); + VAL v20 = v13; int64_t v21 = v14; - VAL v22 = (mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(v21, MKSTR(v16))); - VAL v23 = (mw_mirth_lexer_lexerZ_moveZBang(v20)); + VAL v22 = mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(v21, MKSTR(v16)); + VAL v23 = mw_mirth_lexer_lexerZ_moveZBang(v20); int64_t v24; VAL v25; mw_mirth_lexer_lexerZ_peek(v23, &v24, &v25); @@ -39376,7 +31357,7 @@ static VAL mw_mirth_lexer_lexerZ_emitZ_nameZBang (VAL x1) { VAL x29; VAL x30; if (((bool)v27)) { - VAL v31 = (mw_mirth_lexer_lexerZ_skipZ_docZBang(v13)); + VAL v31 = mw_mirth_lexer_lexerZ_skipZ_docZBang(v13); x30 = v31; x29 = v28; } else { @@ -39508,12 +31489,10 @@ static VAL mw_mirth_lexer_lexerZ_emitZ_nameZBang (VAL x1) { return x30; } static void mw_std_str_ZPlusStr_nameZAsk (VAL x1, uint64_t *x2, VAL *x3) { - VAL v4; - VAL v5; - mw_std_str_ZPlusStr_dupZBang(x1, &v4, &v5); - uint64_t v6 = mw_std_prim_Str_ZToName(v4); - *x3 = v5; - *x2 = v6; + incref(x1); + uint64_t v4 = mw_std_prim_Str_ZToName(x1); + *x3 = x1; + *x2 = v4; } static void mw_std_str_ZPlusStr_firstZ_byte (VAL x1, int64_t *x2, VAL *x3) { int64_t v4 = 0LL; @@ -39560,33 +31539,26 @@ static void mw_std_str_ZPlusStr_dropZ_firstZ_byte (VAL x1, int64_t x2, VAL *x3, *x3 = v7; } static void mw_std_str_ZPlusStr_dropZ_lastZ_byte (VAL x1, int64_t x2, VAL *x3, VAL *x4, int64_t *x5) { - int64_t v6; - VAL v7; - mw_std_str_ZPlusStr_numZ_bytesZAsk(x1, &v6, &v7); - int64_t v8 = 1LL; - int64_t v9 = i64_sub(v6, v8); - int64_t v10 = 0LL; - bool v11 = (v9 < v10); - int64_t x12; - if (v11) { - int64_t v13 = 0LL; - x12 = v13; - push_resource(v7); - push_resource(MKI64(x2)); + incref(x1); + uint64_t v6 = str_size(VSTR(x1)); + int64_t v7 = 1LL; + int64_t v8 = i64_sub(((int64_t)v6), v7); + int64_t v9 = 0LL; + bool v10 = (v8 < v9); + int64_t x11; + if (v10) { + int64_t v12 = 0LL; + x11 = v12; } else { - x12 = v9; - push_resource(v7); - push_resource(MKI64(x2)); + x11 = v8; } - int64_t r14 = VI64(pop_resource()); - VAL r15 = pop_resource(); - VAL v16; - VAL v17; - int64_t v18; - mw_std_str_ZPlusStr_takeZ_slice(x12, r15, r14, &v16, &v17, &v18); - *x5 = v18; - *x4 = v17; - *x3 = v16; + VAL v13; + VAL v14; + int64_t v15; + mw_std_str_ZPlusStr_takeZ_slice(x11, x1, x2, &v13, &v14, &v15); + *x5 = v15; + *x4 = v14; + *x3 = v13; } static void mw_std_str_ZPlusStr_labelZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3) { VAL v4; @@ -39699,43 +31671,47 @@ static void mw_std_str_ZPlusStr_labelZ_popZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3) int64_t v4; VAL v5; mw_std_str_ZPlusStr_firstZ_byte(x1, &v4, &v5); - int64_t v6 = mw_std_byte_Byte_isZ_lower(v4); - VAL x7; - int64_t x8; - if (((bool)v6)) { - int64_t v9; - VAL v10; - mw_std_str_ZPlusStr_lastZ_byte(v5, &v9, &v10); - int64_t v11 = 62LL /* B'>' */; - bool v12 = (v9 == v11); - x8 = ((int64_t)v12); - x7 = v10; + int64_t v6 = 97LL /* B'a' */; + int64_t v7 = 122LL /* B'z' */; + bool v8 = (v4 >= v6); + bool v9 = (v4 <= v7); + bool v10 = (v8 && v9); + VAL x11; + int64_t x12; + if (v10) { + int64_t v13; + VAL v14; + mw_std_str_ZPlusStr_lastZ_byte(v5, &v13, &v14); + int64_t v15 = 62LL /* B'>' */; + bool v16 = (v13 == v15); + x12 = ((int64_t)v16); + x11 = v14; } else { - int64_t v13 = 0LL /* False */; - x8 = v13; - x7 = v5; + int64_t v17 = 0LL /* False */; + x12 = v17; + x11 = v5; } - VAL x14; - VAL x15; - if (((bool)x8)) { - int64_t v16 = (0LL /* +Unsafe */); - VAL v17; - VAL v18; - int64_t v19; - mw_std_str_ZPlusStr_dropZ_lastZ_byte(x7, v16, &v17, &v18, &v19); - uint64_t v20 = mw_std_prim_Str_ZToName(v17); - uint64_t v21 = mw_mirth_label_Label_newZBang(v20); - VAL v22 = mtw_mirth_token_TokenValue_TokenLabelPop(v21); - VAL v23 = mtw_std_maybe_Maybe_1_Some(v22); - x15 = v23; - x14 = v18; + VAL x18; + VAL x19; + if (((bool)x12)) { + int64_t v20 = 0LL /* +Unsafe */; + VAL v21; + VAL v22; + int64_t v23; + mw_std_str_ZPlusStr_dropZ_lastZ_byte(x11, v20, &v21, &v22, &v23); + uint64_t v24 = mw_std_prim_Str_ZToName(v21); + uint64_t v25 = mw_mirth_label_Label_newZBang(v24); + VAL v26 = mtw_mirth_token_TokenValue_TokenLabelPop(v25); + VAL v27 = mtw_std_maybe_Maybe_1_Some(v26); + x19 = v27; + x18 = v22; } else { - VAL v24 = MKI64(0LL /* None */); - x15 = v24; - x14 = x7; + VAL v28 = MKI64(0LL /* None */); + x19 = v28; + x18 = x11; } - *x3 = x14; - *x2 = x15; + *x3 = x18; + *x2 = x19; } static void mw_std_str_ZPlusStr_labelZ_popZ_rZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3) { int64_t v4; @@ -39749,50 +31725,54 @@ static void mw_std_str_ZPlusStr_labelZ_popZ_rZ_tokenZAsk (VAL x1, VAL *x2, VAL * int64_t v10; VAL v11; mw_std_str_ZPlusStr_secondZ_byte(v5, &v10, &v11); - int64_t v12 = mw_std_byte_Byte_isZ_lower(v10); - VAL x13; - int64_t x14; - if (((bool)v12)) { - int64_t v15; - VAL v16; - mw_std_str_ZPlusStr_lastZ_byte(v11, &v15, &v16); - int64_t v17 = 62LL /* B'>' */; - bool v18 = (v15 == v17); - x14 = ((int64_t)v18); - x13 = v16; + int64_t v12 = 97LL /* B'a' */; + int64_t v13 = 122LL /* B'z' */; + bool v14 = (v10 >= v12); + bool v15 = (v10 <= v13); + bool v16 = (v14 && v15); + VAL x17; + int64_t x18; + if (v16) { + int64_t v19; + VAL v20; + mw_std_str_ZPlusStr_lastZ_byte(v11, &v19, &v20); + int64_t v21 = 62LL /* B'>' */; + bool v22 = (v19 == v21); + x18 = ((int64_t)v22); + x17 = v20; } else { - int64_t v19 = 0LL /* False */; - x14 = v19; - x13 = v11; + int64_t v23 = 0LL /* False */; + x18 = v23; + x17 = v11; } - x9 = x14; - x8 = x13; + x9 = x18; + x8 = x17; } else { - int64_t v20 = 0LL /* False */; - x9 = v20; + int64_t v24 = 0LL /* False */; + x9 = v24; x8 = v5; } - VAL x21; - VAL x22; + VAL x25; + VAL x26; if (((bool)x9)) { - int64_t v23 = (0LL /* +Unsafe */); - VAL v24; - VAL v25; - int64_t v26; - mw_std_str_ZPlusStr_dropZ_lastZ_byte(x8, v23, &v24, &v25, &v26); - uint64_t v27 = mw_std_prim_Str_ZToName(v24); - uint64_t v28 = mw_mirth_label_Label_newZBang(v27); - VAL v29 = mtw_mirth_token_TokenValue_TokenLabelPopR(v28); - VAL v30 = mtw_std_maybe_Maybe_1_Some(v29); - x22 = v30; - x21 = v25; + int64_t v27 = 0LL /* +Unsafe */; + VAL v28; + VAL v29; + int64_t v30; + mw_std_str_ZPlusStr_dropZ_lastZ_byte(x8, v27, &v28, &v29, &v30); + uint64_t v31 = mw_std_prim_Str_ZToName(v28); + uint64_t v32 = mw_mirth_label_Label_newZBang(v31); + VAL v33 = mtw_mirth_token_TokenValue_TokenLabelPopR(v32); + VAL v34 = mtw_std_maybe_Maybe_1_Some(v33); + x26 = v34; + x25 = v29; } else { - VAL v31 = MKI64(0LL /* None */); - x22 = v31; - x21 = x8; + VAL v35 = MKI64(0LL /* None */); + x26 = v35; + x25 = x8; } - *x3 = x21; - *x2 = x22; + *x3 = x25; + *x2 = x26; } static void mw_std_str_ZPlusStr_labelZ_pushZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3) { int64_t v4; @@ -39806,38 +31786,42 @@ static void mw_std_str_ZPlusStr_labelZ_pushZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3 int64_t v10; VAL v11; mw_std_str_ZPlusStr_secondZ_byte(v5, &v10, &v11); - int64_t v12 = mw_std_byte_Byte_isZ_lower(v10); - x9 = v12; + int64_t v12 = 97LL /* B'a' */; + int64_t v13 = 122LL /* B'z' */; + bool v14 = (v10 >= v12); + bool v15 = (v10 <= v13); + bool v16 = (v14 && v15); + x9 = ((int64_t)v16); x8 = v11; } else { - int64_t v13 = 0LL /* False */; - x9 = v13; + int64_t v17 = 0LL /* False */; + x9 = v17; x8 = v5; } - VAL x14; - VAL x15; + VAL x18; + VAL x19; if (((bool)x9)) { - int64_t v16 = (0LL /* +Unsafe */); - VAL v17; - VAL v18; - int64_t v19; - mw_std_str_ZPlusStr_dropZ_firstZ_byte(x8, v16, &v17, &v18, &v19); - uint64_t v20 = mw_std_prim_Str_ZToName(v17); - uint64_t v21 = mw_mirth_label_Label_newZBang(v20); - VAL v22 = mtw_mirth_token_TokenValue_TokenLabelPush(v21); - VAL v23 = mtw_std_maybe_Maybe_1_Some(v22); - x15 = v23; - x14 = v18; + int64_t v20 = 0LL /* +Unsafe */; + VAL v21; + VAL v22; + int64_t v23; + mw_std_str_ZPlusStr_dropZ_firstZ_byte(x8, v20, &v21, &v22, &v23); + uint64_t v24 = mw_std_prim_Str_ZToName(v21); + uint64_t v25 = mw_mirth_label_Label_newZBang(v24); + VAL v26 = mtw_mirth_token_TokenValue_TokenLabelPush(v25); + VAL v27 = mtw_std_maybe_Maybe_1_Some(v26); + x19 = v27; + x18 = v22; } else { - VAL v24 = MKI64(0LL /* None */); - x15 = v24; - x14 = x8; + VAL v28 = MKI64(0LL /* None */); + x19 = v28; + x18 = x8; } - *x3 = x14; - *x2 = x15; + *x3 = x18; + *x2 = x19; } static void mw_std_str_ZPlusStr_labelZ_pushZ_rZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3) { - int64_t v4 = (0LL /* +Unsafe */); + int64_t v4 = 0LL /* +Unsafe */; VAL v5; VAL v6; int64_t v7; @@ -39851,35 +31835,39 @@ static void mw_std_str_ZPlusStr_labelZ_pushZ_rZ_tokenZAsk (VAL x1, VAL *x2, VAL int64_t v12; VAL v13; mw_std_str_ZPlusStr_thirdZ_byte(v6, &v12, &v13); - int64_t v14 = mw_std_byte_Byte_isZ_lower(v12); - x11 = v14; + int64_t v14 = 97LL /* B'a' */; + int64_t v15 = 122LL /* B'z' */; + bool v16 = (v12 >= v14); + bool v17 = (v12 <= v15); + bool v18 = (v16 && v17); + x11 = ((int64_t)v18); x10 = v13; } else { - int64_t v15 = 0LL /* False */; - x11 = v15; + int64_t v19 = 0LL /* False */; + x11 = v19; x10 = v6; } - VAL x16; - VAL x17; + VAL x20; + VAL x21; if (((bool)x11)) { - int64_t v18 = (0LL /* +Unsafe */); - VAL v19; - VAL v20; - int64_t v21; - mw_std_str_ZPlusStr_dropZ_firstZ_byte(x10, v18, &v19, &v20, &v21); - uint64_t v22 = mw_std_prim_Str_ZToName(v19); - uint64_t v23 = mw_mirth_label_Label_newZBang(v22); - VAL v24 = mtw_mirth_token_TokenValue_TokenLabelPushR(v23); - VAL v25 = mtw_std_maybe_Maybe_1_Some(v24); - x17 = v25; - x16 = v20; + int64_t v22 = 0LL /* +Unsafe */; + VAL v23; + VAL v24; + int64_t v25; + mw_std_str_ZPlusStr_dropZ_firstZ_byte(x10, v22, &v23, &v24, &v25); + uint64_t v26 = mw_std_prim_Str_ZToName(v23); + uint64_t v27 = mw_mirth_label_Label_newZBang(v26); + VAL v28 = mtw_mirth_token_TokenValue_TokenLabelPushR(v27); + VAL v29 = mtw_std_maybe_Maybe_1_Some(v28); + x21 = v29; + x20 = v24; } else { - VAL v26 = MKI64(0LL /* None */); - x17 = v26; - x16 = x10; + VAL v30 = MKI64(0LL /* None */); + x21 = v30; + x20 = x10; } - *x3 = x16; - *x2 = x17; + *x3 = x20; + *x2 = x21; } static void mw_std_str_ZPlusStr_labelZ_getZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3) { int64_t v4; @@ -39893,64 +31881,72 @@ static void mw_std_str_ZPlusStr_labelZ_getZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3) int64_t v10; VAL v11; mw_std_str_ZPlusStr_secondZ_byte(v5, &v10, &v11); - int64_t v12 = mw_std_byte_Byte_isZ_lower(v10); - VAL x13; - int64_t x14; - if (((bool)v12)) { - int64_t v15 = 1LL /* True */; - x14 = v15; - x13 = v11; + int64_t v12 = 97LL /* B'a' */; + int64_t v13 = 122LL /* B'z' */; + bool v14 = (v10 >= v12); + bool v15 = (v10 <= v13); + bool v16 = (v14 && v15); + VAL x17; + int64_t x18; + if (v16) { + int64_t v19 = 1LL /* True */; + x18 = v19; + x17 = v11; } else { - int64_t v16; - VAL v17; - mw_std_str_ZPlusStr_secondZ_byte(v11, &v16, &v17); - int64_t v18 = 43LL /* B'+' */; - bool v19 = (v16 == v18); - VAL x20; - int64_t x21; - if (v19) { - int64_t v22; - VAL v23; - mw_std_str_ZPlusStr_thirdZ_byte(v17, &v22, &v23); - int64_t v24 = mw_std_byte_Byte_isZ_lower(v22); - x21 = v24; - x20 = v23; + int64_t v20; + VAL v21; + mw_std_str_ZPlusStr_secondZ_byte(v11, &v20, &v21); + int64_t v22 = 43LL /* B'+' */; + bool v23 = (v20 == v22); + VAL x24; + int64_t x25; + if (v23) { + int64_t v26; + VAL v27; + mw_std_str_ZPlusStr_thirdZ_byte(v21, &v26, &v27); + int64_t v28 = 97LL /* B'a' */; + int64_t v29 = 122LL /* B'z' */; + bool v30 = (v26 >= v28); + bool v31 = (v26 <= v29); + bool v32 = (v30 && v31); + x25 = ((int64_t)v32); + x24 = v27; } else { - int64_t v25 = 0LL /* False */; - x21 = v25; - x20 = v17; + int64_t v33 = 0LL /* False */; + x25 = v33; + x24 = v21; } - x14 = x21; - x13 = x20; + x18 = x25; + x17 = x24; } - x9 = x14; - x8 = x13; + x9 = x18; + x8 = x17; } else { - int64_t v26 = 0LL /* False */; - x9 = v26; + int64_t v34 = 0LL /* False */; + x9 = v34; x8 = v5; } - VAL x27; - VAL x28; + VAL x35; + VAL x36; if (((bool)x9)) { - int64_t v29 = (0LL /* +Unsafe */); - VAL v30; - VAL v31; - int64_t v32; - mw_std_str_ZPlusStr_dropZ_firstZ_byte(x8, v29, &v30, &v31, &v32); - uint64_t v33 = mw_std_prim_Str_ZToName(v30); - uint64_t v34 = mw_mirth_label_Label_newZBang(v33); - VAL v35 = mtw_mirth_token_TokenValue_TokenLabelGet(v34); - VAL v36 = mtw_std_maybe_Maybe_1_Some(v35); - x28 = v36; - x27 = v31; + int64_t v37 = 0LL /* +Unsafe */; + VAL v38; + VAL v39; + int64_t v40; + mw_std_str_ZPlusStr_dropZ_firstZ_byte(x8, v37, &v38, &v39, &v40); + uint64_t v41 = mw_std_prim_Str_ZToName(v38); + uint64_t v42 = mw_mirth_label_Label_newZBang(v41); + VAL v43 = mtw_mirth_token_TokenValue_TokenLabelGet(v42); + VAL v44 = mtw_std_maybe_Maybe_1_Some(v43); + x36 = v44; + x35 = v39; } else { - VAL v37 = MKI64(0LL /* None */); - x28 = v37; - x27 = x8; + VAL v45 = MKI64(0LL /* None */); + x36 = v45; + x35 = x8; } - *x3 = x27; - *x2 = x28; + *x3 = x35; + *x2 = x36; } static void mw_std_str_ZPlusStr_labelZ_setZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3) { int64_t v4; @@ -39964,35 +31960,39 @@ static void mw_std_str_ZPlusStr_labelZ_setZ_tokenZAsk (VAL x1, VAL *x2, VAL *x3) int64_t v10; VAL v11; mw_std_str_ZPlusStr_secondZ_byte(v5, &v10, &v11); - int64_t v12 = mw_std_byte_Byte_isZ_lower(v10); - x9 = v12; + int64_t v12 = 97LL /* B'a' */; + int64_t v13 = 122LL /* B'z' */; + bool v14 = (v10 >= v12); + bool v15 = (v10 <= v13); + bool v16 = (v14 && v15); + x9 = ((int64_t)v16); x8 = v11; } else { - int64_t v13 = 0LL /* False */; - x9 = v13; + int64_t v17 = 0LL /* False */; + x9 = v17; x8 = v5; } - VAL x14; - VAL x15; + VAL x18; + VAL x19; if (((bool)x9)) { - int64_t v16 = (0LL /* +Unsafe */); - VAL v17; - VAL v18; - int64_t v19; - mw_std_str_ZPlusStr_dropZ_firstZ_byte(x8, v16, &v17, &v18, &v19); - uint64_t v20 = mw_std_prim_Str_ZToName(v17); - uint64_t v21 = mw_mirth_label_Label_newZBang(v20); - VAL v22 = mtw_mirth_token_TokenValue_TokenLabelSet(v21); - VAL v23 = mtw_std_maybe_Maybe_1_Some(v22); - x15 = v23; - x14 = v18; + int64_t v20 = 0LL /* +Unsafe */; + VAL v21; + VAL v22; + int64_t v23; + mw_std_str_ZPlusStr_dropZ_firstZ_byte(x8, v20, &v21, &v22, &v23); + uint64_t v24 = mw_std_prim_Str_ZToName(v21); + uint64_t v25 = mw_mirth_label_Label_newZBang(v24); + VAL v26 = mtw_mirth_token_TokenValue_TokenLabelSet(v25); + VAL v27 = mtw_std_maybe_Maybe_1_Some(v26); + x19 = v27; + x18 = v22; } else { - VAL v24 = MKI64(0LL /* None */); - x15 = v24; - x14 = x8; + VAL v28 = MKI64(0LL /* None */); + x19 = v28; + x18 = x8; } - *x3 = x14; - *x2 = x15; + *x3 = x18; + *x2 = x19; } static void mw_std_str_ZPlusStr_dnameZAsk (VAL x1, VAL *x2, VAL *x3) { int64_t v4 = 46LL /* BDOT */; @@ -40017,129 +32017,73 @@ static void mw_std_str_ZPlusStr_dnameZAsk (VAL x1, VAL *x2, VAL *x3) { incref(v7); uint64_t v14 = str_size(VSTR(v7)); int64_t v15 = 0LL; - bool v16 = (((int64_t)v14) < v15); - int64_t x17; + bool v16 = (((int64_t)v14) == v15); + VAL x17; + VAL x18; if (v16) { - x17 = v15; - push_resource(v6); - push_value(v7); - } else { - x17 = ((int64_t)v14); - push_resource(v6); - push_value(v7); - } - int64_t v18 = 0LL; - bool v19 = (x17 == v18); - VAL x20; - VAL x21; - if (v19) { - VAL v22 = pop_value(); - decref(v22); - VAL v23 = MKI64(0LL /* None */); - x21 = v23; - VAL r24 = pop_resource(); - x20 = r24; + decref(v7); + VAL v19 = MKI64(0LL /* None */); + x18 = v19; + x17 = v6; } else { - VAL v25 = pop_value(); - uint64_t v26 = mw_std_prim_Str_ZToName(v25); - VAL v27 = mtw_std_maybe_Maybe_1_Some(MKU64(v26)); - x21 = v27; - VAL r28 = pop_resource(); - x20 = r28; - } - VAL v29; - VAL v30; - mw_std_list_ListZPlus_1_uncons(v13, &v29, &v30); - uint64_t v31 = mw_std_prim_Str_ZToName(v29); - VAL v32 = MKI64(0LL /* Nil */); - VAL v33 = mw_std_list_List_1_reverse(v32); - VAL v34; - VAL v35; - mw_std_list_List_1_uncons(v30, &v34, &v35); - VAL x36; - VAL x37; - VAL x38; - VAL x39; - int64_t x40; - switch (get_data_tag(v34)) { - case 1LL: { // Some - VAL v41 = mtp_std_maybe_Maybe_1_Some(v34); - uint64_t v42 = mw_std_prim_Str_ZToName(v41); - VAL v43 = mtw_std_list_List_1_Cons(MKU64(v42), v33); - int64_t v44 = 1LL /* True */; - x40 = v44; - x39 = v35; - x38 = v43; - x37 = x21; - x36 = x20; - } break; - case 0LL: { // None - int64_t v45 = 0LL /* False */; - x40 = v45; - x39 = v35; - x38 = v33; - x37 = x21; - x36 = x20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + uint64_t v20 = mw_std_prim_Str_ZToName(v7); + VAL v21 = mtw_std_maybe_Maybe_1_Some(MKU64(v20)); + x18 = v21; + x17 = v6; } - VAL v46 = (x36); - VAL v47 = x37; - VAL v48 = (x38); - VAL v49 = x39; - int64_t v50 = x40; - while (((bool)v50)) { - VAL v51 = (v46); - VAL v52 = v47; - VAL v53 = (v48); - VAL v54 = v49; - VAL v55; - VAL v56; - mw_std_list_List_1_uncons(v54, &v55, &v56); - VAL x57; - VAL x58; - VAL x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v55)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v55); - uint64_t v63 = mw_std_prim_Str_ZToName(v62); - VAL v64 = mtw_std_list_List_1_Cons(MKU64(v63), v53); - int64_t v65 = 1LL /* True */; - x61 = v65; - x60 = v56; - x59 = v64; - x58 = v52; - x57 = v51; + VAL v22; + VAL v23; + mw_std_list_ListZPlus_1_uncons(v13, &v22, &v23); + uint64_t v24 = mw_std_prim_Str_ZToName(v22); + VAL v25 = MKI64(0LL /* Nil */); + VAL v26 = mw_std_list_List_1_reverse(v25); + int64_t v27 = 1LL /* True */; + VAL v28 = v26; + VAL v29 = v23; + int64_t v30 = v27; + int64_t v31 = v27; + while (((bool)v31)) { + VAL v32 = v28; + VAL v33 = v29; + int64_t v34 = v30; + VAL x35; + VAL x36; + int64_t x37; + switch (get_data_tag(v33)) { + case 1LL: { // Cons + VAL v38; + VAL v39; + mtp_std_list_List_1_Cons(v33, &v38, &v39); + uint64_t v40 = mw_std_prim_Str_ZToName(v38); + VAL v41 = mtw_std_list_List_1_Cons(MKU64(v40), v32); + int64_t v42 = 1LL /* True */; + x37 = v42; + x36 = v39; + x35 = v41; } break; - case 0LL: { // None - int64_t v66 = 0LL /* False */; - x61 = v66; - x60 = v56; - x59 = v53; - x58 = v52; - x57 = v51; + case 0LL: { // Nil + VAL v43 = MKI64(0LL /* Nil */); + int64_t v44 = 0LL /* False */; + x37 = v44; + x36 = v43; + x35 = v32; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v50 = x61; - v49 = x60; - v48 = x59; - v47 = x58; - v46 = x57; + v31 = x37; + v30 = x37; + v29 = x36; + v28 = x35; } - decref(v49); - VAL v67 = mw_std_list_List_1_reverse(v48); - VAL v68 = mtw_std_list_ListZPlus_1_ListZPlus(MKU64(v31), v67); - VAL v69 = mtw_mirth_name_DName_DName(v47, v68); - VAL v70 = mtw_std_maybe_Maybe_1_Some(v69); - x11 = v70; - x10 = v46; + decref(v29); + VAL v45 = mw_std_list_List_1_reverse(v28); + VAL v46 = mtw_std_list_ListZPlus_1_ListZPlus(MKU64(v24), v45); + VAL v47 = mtw_mirth_name_DName_DName(x18, v46); + VAL v48 = mtw_std_maybe_Maybe_1_Some(v47); + x11 = v48; + x10 = x17; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -40149,14 +32093,12 @@ static void mw_std_str_ZPlusStr_dnameZAsk (VAL x1, VAL *x2, VAL *x3) { *x2 = x11; } static void mw_std_str_ZPlusStr_isZ_docZ_startZAsk (VAL x1, int64_t *x2, VAL *x3) { - VAL v4; - VAL v5; - mw_std_str_ZPlusStr_dupZBang(x1, &v4, &v5); - STR* v6; - STRLIT(v6, "|||", 3); - bool v7 = (str_cmp(VSTR(v4), v6) == 0); - *x3 = v5; - *x2 = ((int64_t)v7); + incref(x1); + STR* v4; + STRLIT(v4, "|||", 3); + bool v5 = (str_cmp(VSTR(x1), v4) == 0); + *x3 = x1; + *x2 = ((int64_t)v5); } static void mw_std_str_ZPlusStr_isZ_floatZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v4 = 0LL; @@ -40164,108 +32106,127 @@ static void mw_std_str_ZPlusStr_isZ_floatZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v6; VAL v7; mw_std_str_ZPlusStr_byteZAt(v5, x1, &v6, &v7); - int64_t v8 = mw_std_byte_Byte_isZ_sign(v6); - int64_t x9; - VAL x10; - int64_t x11; - if (((bool)v8)) { - int64_t v12 = 1LL; - int64_t v13 = i64_add(v5, v12); - x11 = v13; - x10 = v7; - x9 = v4; + int64_t v8 = 45LL /* B'-' */; + bool v9 = (v6 == v8); + int64_t v10 = 43LL /* B'+' */; + bool v11 = (v6 == v10); + bool v12 = (v9 || v11); + int64_t x13; + VAL x14; + int64_t x15; + if (v12) { + int64_t v16 = 1LL; + int64_t v17 = i64_add(v5, v16); + x15 = v17; + x14 = v7; + x13 = v4; } else { - x11 = v5; - x10 = v7; - x9 = v4; - } - int64_t v14; - VAL v15; - mw_std_str_ZPlusStr_byteZAt(x11, x10, &v14, &v15); - int64_t v16 = mw_std_byte_Byte_isZ_digit(v14); - int64_t v17 = x9; - int64_t v18 = x11; - VAL v19 = (v15); - int64_t v20 = v16; - while (((bool)v20)) { - int64_t v21 = v17; - int64_t v22 = v18; - VAL v23 = (v19); - int64_t v24 = 1LL; - int64_t v25 = i64_add(v21, v24); - int64_t v26 = 1LL; - int64_t v27 = i64_add(v22, v26); - int64_t v28; - VAL v29; - mw_std_str_ZPlusStr_byteZAt(v27, v23, &v28, &v29); - int64_t v30 = mw_std_byte_Byte_isZ_digit(v28); - v20 = v30; - v19 = v29; - v18 = v27; - v17 = v25; + x15 = v5; + x14 = v7; + x13 = v4; } - int64_t v31; - VAL v32; - mw_std_str_ZPlusStr_byteZAt(v18, v19, &v31, &v32); - int64_t v33 = 46LL /* BDOT */; - bool v34 = (v31 == v33); - VAL x35; - int64_t x36; - if (v34) { - int64_t v37 = 1LL; - int64_t v38 = i64_add(v17, v37); - int64_t v39 = 1LL; - int64_t v40 = i64_add(v18, v39); - int64_t v41; - VAL v42; - mw_std_str_ZPlusStr_byteZAt(v40, v32, &v41, &v42); - int64_t v43 = mw_std_byte_Byte_isZ_digit(v41); - int64_t v44 = v38; - int64_t v45 = v40; - VAL v46 = (v42); - int64_t v47 = v43; - while (((bool)v47)) { - int64_t v48 = v44; - int64_t v49 = v45; - VAL v50 = (v46); - int64_t v51 = 1LL; - int64_t v52 = i64_add(v48, v51); - int64_t v53 = 1LL; - int64_t v54 = i64_add(v49, v53); - int64_t v55; - VAL v56; - mw_std_str_ZPlusStr_byteZAt(v54, v50, &v55, &v56); - int64_t v57 = mw_std_byte_Byte_isZ_digit(v55); - v47 = v57; - v46 = v56; - v45 = v54; - v44 = v52; - } - int64_t v58 = 3LL; - bool v59 = (v44 >= v58); - VAL x60; - int64_t x61; - if (v59) { - int64_t v62; - VAL v63; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v46, &v62, &v63); - bool v64 = (v45 == v62); - x61 = ((int64_t)v64); - x60 = v63; + int64_t v18; + VAL v19; + mw_std_str_ZPlusStr_byteZAt(x15, x14, &v18, &v19); + int64_t v20 = 48LL /* B'0' */; + int64_t v21 = 57LL /* B'9' */; + bool v22 = (v18 >= v20); + bool v23 = (v18 <= v21); + bool v24 = (v22 && v23); + int64_t v25 = x13; + int64_t v26 = x15; + VAL v27 = v19; + bool v28 = v24; + while (v28) { + int64_t v29 = v25; + int64_t v30 = v26; + VAL v31 = v27; + int64_t v32 = 1LL; + int64_t v33 = i64_add(v29, v32); + int64_t v34 = 1LL; + int64_t v35 = i64_add(v30, v34); + int64_t v36; + VAL v37; + mw_std_str_ZPlusStr_byteZAt(v35, v31, &v36, &v37); + int64_t v38 = 48LL /* B'0' */; + int64_t v39 = 57LL /* B'9' */; + bool v40 = (v36 >= v38); + bool v41 = (v36 <= v39); + bool v42 = (v40 && v41); + v28 = v42; + v27 = v37; + v26 = v35; + v25 = v33; + } + int64_t v43; + VAL v44; + mw_std_str_ZPlusStr_byteZAt(v26, v27, &v43, &v44); + int64_t v45 = 46LL /* BDOT */; + bool v46 = (v43 == v45); + VAL x47; + int64_t x48; + if (v46) { + int64_t v49 = 1LL; + int64_t v50 = i64_add(v25, v49); + int64_t v51 = 1LL; + int64_t v52 = i64_add(v26, v51); + int64_t v53; + VAL v54; + mw_std_str_ZPlusStr_byteZAt(v52, v44, &v53, &v54); + int64_t v55 = 48LL /* B'0' */; + int64_t v56 = 57LL /* B'9' */; + bool v57 = (v53 >= v55); + bool v58 = (v53 <= v56); + bool v59 = (v57 && v58); + int64_t v60 = v50; + int64_t v61 = v52; + VAL v62 = v54; + bool v63 = v59; + while (v63) { + int64_t v64 = v60; + int64_t v65 = v61; + VAL v66 = v62; + int64_t v67 = 1LL; + int64_t v68 = i64_add(v64, v67); + int64_t v69 = 1LL; + int64_t v70 = i64_add(v65, v69); + int64_t v71; + VAL v72; + mw_std_str_ZPlusStr_byteZAt(v70, v66, &v71, &v72); + int64_t v73 = 48LL /* B'0' */; + int64_t v74 = 57LL /* B'9' */; + bool v75 = (v71 >= v73); + bool v76 = (v71 <= v74); + bool v77 = (v75 && v76); + v63 = v77; + v62 = v72; + v61 = v70; + v60 = v68; + } + int64_t v78 = 3LL; + bool v79 = (v60 >= v78); + VAL x80; + int64_t x81; + if (v79) { + incref(v62); + uint64_t v82 = str_size(VSTR(v62)); + bool v83 = (v61 == ((int64_t)v82)); + x81 = ((int64_t)v83); + x80 = v62; } else { - int64_t v65 = 0LL /* False */; - x61 = v65; - x60 = v46; + int64_t v84 = 0LL /* False */; + x81 = v84; + x80 = v62; } - x36 = x61; - x35 = x60; + x48 = x81; + x47 = x80; } else { - int64_t v66 = 0LL /* False */; - x36 = v66; - x35 = v32; + int64_t v85 = 0LL /* False */; + x48 = v85; + x47 = v44; } - *x3 = x35; - *x2 = x36; + *x3 = x47; + *x2 = x48; } static void mw_std_str_ZPlusStr_floatZ_sign (VAL x1, int64_t *x2, int64_t *x3, VAL *x4) { int64_t v5 = 0LL; @@ -40313,74 +32274,52 @@ static void mw_std_str_ZPlusStr_floatZAsk (VAL x1, double *x2, VAL *x3) { int64_t v7; VAL v8; mw_std_str_ZPlusStr_floatZ_sign(x1, &v6, &v7, &v8); - VAL v9 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v6, MKSTR(v4))); + VAL v9 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v6, MKSTR(v4)); int64_t v10 = i64_add(v5, v7); - int64_t v11; - VAL v12; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v8, &v11, &v12); - bool v13 = (v10 < v11); - VAL v14 = (v9); - int64_t v15 = v10; - VAL v16 = (v12); - bool v17 = v13; - while (v17) { - VAL v18 = (v14); - int64_t v19 = v15; - VAL v20 = (v16); - int64_t v21; - VAL v22; - mw_std_str_ZPlusStr_byteZAt(v19, v20, &v21, &v22); - VAL v23 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v21, v18)); - int64_t v24 = 1LL; - int64_t v25 = i64_add(v19, v24); - int64_t v26; - VAL v27; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v22, &v26, &v27); - bool v28 = (v25 < v26); - v17 = v28; - v16 = v27; - v15 = v25; - v14 = v23; - } - incref(v14); - incref(v14); - void* v29 = str_base(VSTR(v14)); - uint64_t v30 = str_size(VSTR(v14)); - int64_t v31 = 0LL; - bool v32 = (((int64_t)v30) < v31); - int64_t x33; - if (v32) { - x33 = v31; - push_resource(v16); - push_ptr(v29); - } else { - x33 = ((int64_t)v30); - push_resource(v16); - push_ptr(v29); + incref(v8); + uint64_t v11 = str_size(VSTR(v8)); + bool v12 = (v10 < ((int64_t)v11)); + VAL v13 = v9; + int64_t v14 = v10; + VAL v15 = v8; + bool v16 = v12; + while (v16) { + VAL v17 = v13; + int64_t v18 = v14; + VAL v19 = v15; + int64_t v20; + VAL v21; + mw_std_str_ZPlusStr_byteZAt(v18, v19, &v20, &v21); + VAL v22 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v20, v17); + int64_t v23 = 1LL; + int64_t v24 = i64_add(v18, v23); + incref(v21); + uint64_t v25 = str_size(VSTR(v21)); + bool v26 = (v24 < ((int64_t)v25)); + v16 = v26; + v15 = v21; + v14 = v24; + v13 = v22; } - VAL v34 = pop_value(); - incref(v34); - int64_t v35 = (0LL /* +Unsafe */); - void* v36 = (void*)(x33 + (char*)VPTR(v34)); - uint8_t v37 = *(uint8_t*)v36; - int64_t v38 = 0LL; - bool v39 = (((int64_t)v37) == v38); - void* x40; - if (v39) { - x40 = VPTR(v34); + incref(v13); + incref(v13); + void* v27 = str_base(VSTR(v13)); + uint64_t v28 = str_size(VSTR(v13)); + int64_t v29 = 0LL /* +Unsafe */; + void* v30 = (void*)(((int64_t)v28) + (char*)v27); + uint8_t v31 = *(uint8_t*)v30; + int64_t v32 = 0LL; + bool v33 = (((int64_t)v31) == v32); + if (v33) { } else { - STR* v41; - STRLIT(v41, "tried to use Str as CStr, but Str is not zero terminated", 56); - push_value(v34); - do_panic(v41); - void* v42 = pop_ptr(); - x40 = v42; + STR* v34; + STRLIT(v34, "tried to use Str as CStr, but Str is not zero terminated", 56); + do_panic(v34); } - double v43 = mext_mirth_lexer_stringz_toz_float64(x40); - decref(v14); - VAL r44 = pop_resource(); - *x3 = r44; - *x2 = v43; + double v35 = mext_mirth_lexer_stringz_toz_float64(v27); + decref(v13); + *x3 = v15; + *x2 = v35; } static void mw_std_str_ZPlusStr_isZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v4; @@ -40421,64 +32360,75 @@ static void mw_std_str_ZPlusStr_isZ_decZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) int64_t v6; VAL v7; mw_std_str_ZPlusStr_byteZAt(v5, x1, &v6, &v7); - int64_t v8 = mw_std_byte_Byte_isZ_sign(v6); - int64_t x9; - VAL x10; - int64_t x11; - if (((bool)v8)) { - int64_t v12 = 1LL; - int64_t v13 = i64_add(v5, v12); - x11 = v13; - x10 = v7; - x9 = v4; + int64_t v8 = 45LL /* B'-' */; + bool v9 = (v6 == v8); + int64_t v10 = 43LL /* B'+' */; + bool v11 = (v6 == v10); + bool v12 = (v9 || v11); + int64_t x13; + VAL x14; + int64_t x15; + if (v12) { + int64_t v16 = 1LL; + int64_t v17 = i64_add(v5, v16); + x15 = v17; + x14 = v7; + x13 = v4; } else { - x11 = v5; - x10 = v7; - x9 = v4; + x15 = v5; + x14 = v7; + x13 = v4; } - int64_t v14; - VAL v15; - mw_std_str_ZPlusStr_byteZAt(x11, x10, &v14, &v15); - int64_t v16 = mw_std_byte_Byte_isZ_digit(v14); - int64_t v17 = x9; - int64_t v18 = x11; - VAL v19 = (v15); - int64_t v20 = v16; - while (((bool)v20)) { - int64_t v21 = v17; - int64_t v22 = v18; - VAL v23 = (v19); - int64_t v24 = 1LL; - int64_t v25 = i64_add(v21, v24); - int64_t v26 = 1LL; - int64_t v27 = i64_add(v22, v26); - int64_t v28; - VAL v29; - mw_std_str_ZPlusStr_byteZAt(v27, v23, &v28, &v29); - int64_t v30 = mw_std_byte_Byte_isZ_digit(v28); - v20 = v30; - v19 = v29; - v18 = v27; - v17 = v25; - } - int64_t v31 = 0LL; - bool v32 = (v17 > v31); - VAL x33; - int64_t x34; - if (v32) { - int64_t v35; - VAL v36; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v19, &v35, &v36); - bool v37 = (v18 == v35); - x34 = ((int64_t)v37); - x33 = v36; + int64_t v18; + VAL v19; + mw_std_str_ZPlusStr_byteZAt(x15, x14, &v18, &v19); + int64_t v20 = 48LL /* B'0' */; + int64_t v21 = 57LL /* B'9' */; + bool v22 = (v18 >= v20); + bool v23 = (v18 <= v21); + bool v24 = (v22 && v23); + int64_t v25 = x13; + int64_t v26 = x15; + VAL v27 = v19; + bool v28 = v24; + while (v28) { + int64_t v29 = v25; + int64_t v30 = v26; + VAL v31 = v27; + int64_t v32 = 1LL; + int64_t v33 = i64_add(v29, v32); + int64_t v34 = 1LL; + int64_t v35 = i64_add(v30, v34); + int64_t v36; + VAL v37; + mw_std_str_ZPlusStr_byteZAt(v35, v31, &v36, &v37); + int64_t v38 = 48LL /* B'0' */; + int64_t v39 = 57LL /* B'9' */; + bool v40 = (v36 >= v38); + bool v41 = (v36 <= v39); + bool v42 = (v40 && v41); + v28 = v42; + v27 = v37; + v26 = v35; + v25 = v33; + } + int64_t v43 = 0LL; + bool v44 = (v25 > v43); + VAL x45; + int64_t x46; + if (v44) { + incref(v27); + uint64_t v47 = str_size(VSTR(v27)); + bool v48 = (v26 == ((int64_t)v47)); + x46 = ((int64_t)v48); + x45 = v27; } else { - int64_t v38 = 0LL /* False */; - x34 = v38; - x33 = v19; + int64_t v49 = 0LL /* False */; + x46 = v49; + x45 = v27; } - *x3 = x33; - *x2 = x34; + *x3 = x45; + *x2 = x46; } static void mw_std_str_ZPlusStr_isZ_hexZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v4 = 0LL; @@ -40486,98 +32436,133 @@ static void mw_std_str_ZPlusStr_isZ_hexZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) int64_t v6; VAL v7; mw_std_str_ZPlusStr_byteZAt(v5, x1, &v6, &v7); - int64_t v8 = mw_std_byte_Byte_isZ_sign(v6); - int64_t x9; - VAL x10; - int64_t x11; - if (((bool)v8)) { - int64_t v12 = 1LL; - int64_t v13 = i64_add(v5, v12); - x11 = v13; - x10 = v7; - x9 = v4; + int64_t v8 = 45LL /* B'-' */; + bool v9 = (v6 == v8); + int64_t v10 = 43LL /* B'+' */; + bool v11 = (v6 == v10); + bool v12 = (v9 || v11); + int64_t x13; + VAL x14; + int64_t x15; + if (v12) { + int64_t v16 = 1LL; + int64_t v17 = i64_add(v5, v16); + x15 = v17; + x14 = v7; + x13 = v4; } else { - x11 = v5; - x10 = v7; - x9 = v4; + x15 = v5; + x14 = v7; + x13 = v4; } - int64_t v14; - VAL v15; - mw_std_str_ZPlusStr_byteZAt(x11, x10, &v14, &v15); - int64_t v16 = 48LL /* B'0' */; - bool v17 = (v14 == v16); - VAL x18; - int64_t x19; - if (v17) { - int64_t v20 = 1LL; - int64_t v21 = i64_add(x11, v20); - int64_t v22; - VAL v23; - mw_std_str_ZPlusStr_byteZAt(v21, v15, &v22, &v23); - int64_t v24 = 120LL /* B'x' */; - bool v25 = (v22 == v24); - VAL x26; - int64_t x27; - if (v25) { - int64_t v28 = 1LL; - int64_t v29 = i64_add(v21, v28); - int64_t v30; - VAL v31; - mw_std_str_ZPlusStr_byteZAt(v29, v23, &v30, &v31); - int64_t v32 = mw_std_byte_Byte_isZ_hexdigit(v30); - int64_t v33 = x9; - int64_t v34 = v29; - VAL v35 = (v31); - int64_t v36 = v32; - while (((bool)v36)) { - int64_t v37 = v33; - int64_t v38 = v34; - VAL v39 = (v35); - int64_t v40 = 1LL; - int64_t v41 = i64_add(v37, v40); - int64_t v42 = 1LL; - int64_t v43 = i64_add(v38, v42); - int64_t v44; - VAL v45; - mw_std_str_ZPlusStr_byteZAt(v43, v39, &v44, &v45); - int64_t v46 = mw_std_byte_Byte_isZ_hexdigit(v44); - v36 = v46; - v35 = v45; - v34 = v43; - v33 = v41; - } - int64_t v47 = 0LL; - bool v48 = (v33 > v47); - VAL x49; - int64_t x50; - if (v48) { - int64_t v51; - VAL v52; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v35, &v51, &v52); - bool v53 = (v34 == v51); - x50 = ((int64_t)v53); - x49 = v52; + int64_t v18; + VAL v19; + mw_std_str_ZPlusStr_byteZAt(x15, x14, &v18, &v19); + int64_t v20 = 48LL /* B'0' */; + bool v21 = (v18 == v20); + VAL x22; + int64_t x23; + if (v21) { + int64_t v24 = 1LL; + int64_t v25 = i64_add(x15, v24); + int64_t v26; + VAL v27; + mw_std_str_ZPlusStr_byteZAt(v25, v19, &v26, &v27); + int64_t v28 = 120LL /* B'x' */; + bool v29 = (v26 == v28); + VAL x30; + int64_t x31; + if (v29) { + int64_t v32 = 1LL; + int64_t v33 = i64_add(v25, v32); + int64_t v34; + VAL v35; + mw_std_str_ZPlusStr_byteZAt(v33, v27, &v34, &v35); + int64_t v36 = 48LL /* B'0' */; + int64_t v37 = 57LL /* B'9' */; + bool v38 = (v34 >= v36); + bool v39 = (v34 <= v37); + bool v40 = (v38 && v39); + int64_t v41 = 65LL /* B'A' */; + int64_t v42 = 70LL /* B'F' */; + bool v43 = (v34 >= v41); + bool v44 = (v34 <= v42); + bool v45 = (v43 && v44); + int64_t v46 = 97LL /* B'a' */; + int64_t v47 = 102LL /* B'f' */; + bool v48 = (v34 >= v46); + bool v49 = (v34 <= v47); + bool v50 = (v48 && v49); + bool v51 = (v45 || v50); + bool v52 = (v40 || v51); + int64_t v53 = x13; + int64_t v54 = v33; + VAL v55 = v35; + bool v56 = v52; + while (v56) { + int64_t v57 = v53; + int64_t v58 = v54; + VAL v59 = v55; + int64_t v60 = 1LL; + int64_t v61 = i64_add(v57, v60); + int64_t v62 = 1LL; + int64_t v63 = i64_add(v58, v62); + int64_t v64; + VAL v65; + mw_std_str_ZPlusStr_byteZAt(v63, v59, &v64, &v65); + int64_t v66 = 48LL /* B'0' */; + int64_t v67 = 57LL /* B'9' */; + bool v68 = (v64 >= v66); + bool v69 = (v64 <= v67); + bool v70 = (v68 && v69); + int64_t v71 = 65LL /* B'A' */; + int64_t v72 = 70LL /* B'F' */; + bool v73 = (v64 >= v71); + bool v74 = (v64 <= v72); + bool v75 = (v73 && v74); + int64_t v76 = 97LL /* B'a' */; + int64_t v77 = 102LL /* B'f' */; + bool v78 = (v64 >= v76); + bool v79 = (v64 <= v77); + bool v80 = (v78 && v79); + bool v81 = (v75 || v80); + bool v82 = (v70 || v81); + v56 = v82; + v55 = v65; + v54 = v63; + v53 = v61; + } + int64_t v83 = 0LL; + bool v84 = (v53 > v83); + VAL x85; + int64_t x86; + if (v84) { + incref(v55); + uint64_t v87 = str_size(VSTR(v55)); + bool v88 = (v54 == ((int64_t)v87)); + x86 = ((int64_t)v88); + x85 = v55; } else { - int64_t v54 = 0LL /* False */; - x50 = v54; - x49 = v35; + int64_t v89 = 0LL /* False */; + x86 = v89; + x85 = v55; } - x27 = x50; - x26 = x49; + x31 = x86; + x30 = x85; } else { - int64_t v55 = 0LL /* False */; - x27 = v55; - x26 = v23; + int64_t v90 = 0LL /* False */; + x31 = v90; + x30 = v27; } - x19 = x27; - x18 = x26; + x23 = x31; + x22 = x30; } else { - int64_t v56 = 0LL /* False */; - x19 = v56; - x18 = v15; + int64_t v91 = 0LL /* False */; + x23 = v91; + x22 = v19; } - *x3 = x18; - *x2 = x19; + *x3 = x22; + *x2 = x23; } static void mw_std_str_ZPlusStr_isZ_octZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v4 = 0LL; @@ -40585,106 +32570,109 @@ static void mw_std_str_ZPlusStr_isZ_octZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) int64_t v6; VAL v7; mw_std_str_ZPlusStr_byteZAt(v5, x1, &v6, &v7); - int64_t v8 = mw_std_byte_Byte_isZ_sign(v6); - int64_t x9; - VAL x10; - int64_t x11; - if (((bool)v8)) { - int64_t v12 = 1LL; - int64_t v13 = i64_add(v5, v12); - x11 = v13; - x10 = v7; - x9 = v4; + int64_t v8 = 45LL /* B'-' */; + bool v9 = (v6 == v8); + int64_t v10 = 43LL /* B'+' */; + bool v11 = (v6 == v10); + bool v12 = (v9 || v11); + int64_t x13; + VAL x14; + int64_t x15; + if (v12) { + int64_t v16 = 1LL; + int64_t v17 = i64_add(v5, v16); + x15 = v17; + x14 = v7; + x13 = v4; } else { - x11 = v5; - x10 = v7; - x9 = v4; + x15 = v5; + x14 = v7; + x13 = v4; } - int64_t v14; - VAL v15; - mw_std_str_ZPlusStr_byteZAt(x11, x10, &v14, &v15); - int64_t v16 = 48LL /* B'0' */; - bool v17 = (v14 == v16); - VAL x18; - int64_t x19; - if (v17) { - int64_t v20 = 1LL; - int64_t v21 = i64_add(x11, v20); - int64_t v22; - VAL v23; - mw_std_str_ZPlusStr_byteZAt(v21, v15, &v22, &v23); - int64_t v24 = 111LL /* B'o' */; - bool v25 = (v22 == v24); - VAL x26; - int64_t x27; - if (v25) { - int64_t v28 = 1LL; - int64_t v29 = i64_add(v21, v28); - int64_t v30; - VAL v31; - mw_std_str_ZPlusStr_byteZAt(v29, v23, &v30, &v31); - int64_t v32 = 48LL /* B'0' */; - int64_t v33 = 55LL /* B'7' */; - bool v34 = (v30 >= v32); - bool v35 = (v30 <= v33); - bool v36 = (v34 && v35); - int64_t v37 = x9; - int64_t v38 = v29; - VAL v39 = (v31); - bool v40 = v36; - while (v40) { - int64_t v41 = v37; - int64_t v42 = v38; - VAL v43 = (v39); - int64_t v44 = 1LL; - int64_t v45 = i64_add(v41, v44); - int64_t v46 = 1LL; - int64_t v47 = i64_add(v42, v46); - int64_t v48; - VAL v49; - mw_std_str_ZPlusStr_byteZAt(v47, v43, &v48, &v49); - int64_t v50 = 48LL /* B'0' */; - int64_t v51 = 55LL /* B'7' */; - bool v52 = (v48 >= v50); - bool v53 = (v48 <= v51); - bool v54 = (v52 && v53); - v40 = v54; - v39 = v49; - v38 = v47; - v37 = v45; + int64_t v18; + VAL v19; + mw_std_str_ZPlusStr_byteZAt(x15, x14, &v18, &v19); + int64_t v20 = 48LL /* B'0' */; + bool v21 = (v18 == v20); + VAL x22; + int64_t x23; + if (v21) { + int64_t v24 = 1LL; + int64_t v25 = i64_add(x15, v24); + int64_t v26; + VAL v27; + mw_std_str_ZPlusStr_byteZAt(v25, v19, &v26, &v27); + int64_t v28 = 111LL /* B'o' */; + bool v29 = (v26 == v28); + VAL x30; + int64_t x31; + if (v29) { + int64_t v32 = 1LL; + int64_t v33 = i64_add(v25, v32); + int64_t v34; + VAL v35; + mw_std_str_ZPlusStr_byteZAt(v33, v27, &v34, &v35); + int64_t v36 = 48LL /* B'0' */; + int64_t v37 = 55LL /* B'7' */; + bool v38 = (v34 >= v36); + bool v39 = (v34 <= v37); + bool v40 = (v38 && v39); + int64_t v41 = x13; + int64_t v42 = v33; + VAL v43 = v35; + bool v44 = v40; + while (v44) { + int64_t v45 = v41; + int64_t v46 = v42; + VAL v47 = v43; + int64_t v48 = 1LL; + int64_t v49 = i64_add(v45, v48); + int64_t v50 = 1LL; + int64_t v51 = i64_add(v46, v50); + int64_t v52; + VAL v53; + mw_std_str_ZPlusStr_byteZAt(v51, v47, &v52, &v53); + int64_t v54 = 48LL /* B'0' */; + int64_t v55 = 55LL /* B'7' */; + bool v56 = (v52 >= v54); + bool v57 = (v52 <= v55); + bool v58 = (v56 && v57); + v44 = v58; + v43 = v53; + v42 = v51; + v41 = v49; } - int64_t v55 = 0LL; - bool v56 = (v37 > v55); - VAL x57; - int64_t x58; - if (v56) { - int64_t v59; - VAL v60; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v39, &v59, &v60); - bool v61 = (v38 == v59); - x58 = ((int64_t)v61); - x57 = v60; + int64_t v59 = 0LL; + bool v60 = (v41 > v59); + VAL x61; + int64_t x62; + if (v60) { + incref(v43); + uint64_t v63 = str_size(VSTR(v43)); + bool v64 = (v42 == ((int64_t)v63)); + x62 = ((int64_t)v64); + x61 = v43; } else { - int64_t v62 = 0LL /* False */; - x58 = v62; - x57 = v39; + int64_t v65 = 0LL /* False */; + x62 = v65; + x61 = v43; } - x27 = x58; - x26 = x57; + x31 = x62; + x30 = x61; } else { - int64_t v63 = 0LL /* False */; - x27 = v63; - x26 = v23; + int64_t v66 = 0LL /* False */; + x31 = v66; + x30 = v27; } - x19 = x27; - x18 = x26; + x23 = x31; + x22 = x30; } else { - int64_t v64 = 0LL /* False */; - x19 = v64; - x18 = v15; + int64_t v67 = 0LL /* False */; + x23 = v67; + x22 = v19; } - *x3 = x18; - *x2 = x19; + *x3 = x22; + *x2 = x23; } static void mw_std_str_ZPlusStr_intZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v4; @@ -40777,43 +32765,41 @@ static void mw_std_str_ZPlusStr_decZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v6; VAL v7; mw_std_str_ZPlusStr_intZ_sign(x1, &v4, &v5, &v6, &v7); - int64_t v8; - VAL v9; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v7, &v8, &v9); - bool v10 = (v6 < v8); - int64_t v11 = v4; - int64_t v12 = v5; - int64_t v13 = v6; - VAL v14 = (v9); - bool v15 = v10; - while (v15) { + incref(v7); + uint64_t v8 = str_size(VSTR(v7)); + bool v9 = (v6 < ((int64_t)v8)); + int64_t v10 = v4; + int64_t v11 = v5; + int64_t v12 = v6; + VAL v13 = v7; + bool v14 = v9; + while (v14) { + int64_t v15 = v10; int64_t v16 = v11; int64_t v17 = v12; - int64_t v18 = v13; - VAL v19 = (v14); - int64_t v20; - VAL v21; - mw_std_str_ZPlusStr_byteZAt(v18, v19, &v20, &v21); - int64_t v22 = 10LL; - int64_t v23 = i64_mul(v17, v22); - int64_t v24 = 48LL; - int64_t v25 = i64_sub(v20, v24); - int64_t v26 = i64_add(v23, v25); - int64_t v27 = 1LL; - int64_t v28 = i64_add(v18, v27); - int64_t v29; - VAL v30; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v21, &v29, &v30); - bool v31 = (v28 < v29); - v15 = v31; - v14 = v30; - v13 = v28; - v12 = v26; - v11 = v16; - } - int64_t v32 = i64_mul(v11, v12); - *x3 = v14; - *x2 = v32; + VAL v18 = v13; + int64_t v19; + VAL v20; + mw_std_str_ZPlusStr_byteZAt(v17, v18, &v19, &v20); + int64_t v21 = 10LL; + int64_t v22 = i64_mul(v16, v21); + int64_t v23 = 48LL; + int64_t v24 = i64_sub(v19, v23); + int64_t v25 = i64_add(v22, v24); + int64_t v26 = 1LL; + int64_t v27 = i64_add(v17, v26); + incref(v20); + uint64_t v28 = str_size(VSTR(v20)); + bool v29 = (v27 < ((int64_t)v28)); + v14 = v29; + v13 = v20; + v12 = v27; + v11 = v25; + v10 = v15; + } + int64_t v30 = i64_mul(v10, v11); + *x3 = v13; + *x2 = v30; } static void mw_std_str_ZPlusStr_hexZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v4; @@ -40825,43 +32811,41 @@ static void mw_std_str_ZPlusStr_hexZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v9 = i64_add(v6, v8); int64_t v10 = 1LL; int64_t v11 = i64_add(v9, v10); - int64_t v12; - VAL v13; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v7, &v12, &v13); - bool v14 = (v11 < v12); - int64_t v15 = v4; - int64_t v16 = v5; - int64_t v17 = v11; - VAL v18 = (v13); - bool v19 = v14; - while (v19) { + incref(v7); + uint64_t v12 = str_size(VSTR(v7)); + bool v13 = (v11 < ((int64_t)v12)); + int64_t v14 = v4; + int64_t v15 = v5; + int64_t v16 = v11; + VAL v17 = v7; + bool v18 = v13; + while (v18) { + int64_t v19 = v14; int64_t v20 = v15; int64_t v21 = v16; - int64_t v22 = v17; - VAL v23 = (v18); - int64_t v24; - VAL v25; - mw_std_str_ZPlusStr_byteZAt(v22, v23, &v24, &v25); - int64_t v26 = 16LL; - int64_t v27 = i64_mul(v21, v26); - int64_t v28 = mw_mirth_lexer_hexdigitZ_value(v24); - int64_t v29 = i64_add(v27, v28); - int64_t v30 = 1LL; - int64_t v31 = i64_add(v22, v30); - int64_t v32; - VAL v33; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v25, &v32, &v33); - bool v34 = (v31 < v32); - v19 = v34; - v18 = v33; - v17 = v31; - v16 = v29; - v15 = v20; - } - int64_t v35 = i64_mul(v15, v16); - *x3 = v18; - *x2 = v35; -} + VAL v22 = v17; + int64_t v23; + VAL v24; + mw_std_str_ZPlusStr_byteZAt(v21, v22, &v23, &v24); + int64_t v25 = 16LL; + int64_t v26 = i64_mul(v20, v25); + int64_t v27 = mw_mirth_lexer_hexdigitZ_value(v23); + int64_t v28 = i64_add(v26, v27); + int64_t v29 = 1LL; + int64_t v30 = i64_add(v21, v29); + incref(v24); + uint64_t v31 = str_size(VSTR(v24)); + bool v32 = (v30 < ((int64_t)v31)); + v18 = v32; + v17 = v24; + v16 = v30; + v15 = v28; + v14 = v19; + } + int64_t v33 = i64_mul(v14, v15); + *x3 = v17; + *x2 = v33; +} static void mw_std_str_ZPlusStr_octZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v4; int64_t v5; @@ -40872,57 +32856,59 @@ static void mw_std_str_ZPlusStr_octZ_intZAsk (VAL x1, int64_t *x2, VAL *x3) { int64_t v9 = i64_add(v6, v8); int64_t v10 = 1LL; int64_t v11 = i64_add(v9, v10); - int64_t v12; - VAL v13; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v7, &v12, &v13); - bool v14 = (v11 < v12); - int64_t v15 = v4; - int64_t v16 = v5; - int64_t v17 = v11; - VAL v18 = (v13); - bool v19 = v14; - while (v19) { + incref(v7); + uint64_t v12 = str_size(VSTR(v7)); + bool v13 = (v11 < ((int64_t)v12)); + int64_t v14 = v4; + int64_t v15 = v5; + int64_t v16 = v11; + VAL v17 = v7; + bool v18 = v13; + while (v18) { + int64_t v19 = v14; int64_t v20 = v15; int64_t v21 = v16; - int64_t v22 = v17; - VAL v23 = (v18); - int64_t v24; - VAL v25; - mw_std_str_ZPlusStr_byteZAt(v22, v23, &v24, &v25); - int64_t v26 = 8LL; - int64_t v27 = i64_mul(v21, v26); - int64_t v28 = 48LL; - int64_t v29 = i64_sub(v24, v28); - int64_t v30 = i64_add(v27, v29); - int64_t v31 = 1LL; - int64_t v32 = i64_add(v22, v31); - int64_t v33; - VAL v34; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v25, &v33, &v34); - bool v35 = (v32 < v33); - v19 = v35; - v18 = v34; - v17 = v32; - v16 = v30; - v15 = v20; + VAL v22 = v17; + int64_t v23; + VAL v24; + mw_std_str_ZPlusStr_byteZAt(v21, v22, &v23, &v24); + int64_t v25 = 8LL; + int64_t v26 = i64_mul(v20, v25); + int64_t v27 = 48LL; + int64_t v28 = i64_sub(v23, v27); + int64_t v29 = i64_add(v26, v28); + int64_t v30 = 1LL; + int64_t v31 = i64_add(v21, v30); + incref(v24); + uint64_t v32 = str_size(VSTR(v24)); + bool v33 = (v31 < ((int64_t)v32)); + v18 = v33; + v17 = v24; + v16 = v31; + v15 = v29; + v14 = v19; } - int64_t v36 = i64_mul(v15, v16); - *x3 = v18; - *x2 = v36; + int64_t v34 = i64_mul(v14, v15); + *x3 = v17; + *x2 = v34; } static int64_t mw_mirth_lexer_hexdigitZ_value (int64_t x1) { - int64_t v2 = mw_std_byte_Byte_isZ_digit(x1); - int64_t x3; - if (((bool)v2)) { - int64_t v4 = 48LL; - int64_t v5 = i64_sub(x1, v4); - x3 = v5; + int64_t v2 = 48LL /* B'0' */; + int64_t v3 = 57LL /* B'9' */; + bool v4 = (x1 >= v2); + bool v5 = (x1 <= v3); + bool v6 = (v4 && v5); + int64_t x7; + if (v6) { + int64_t v8 = 48LL; + int64_t v9 = i64_sub(x1, v8); + x7 = v9; } else { - int64_t v6 = 55LL; - int64_t v7 = i64_sub(x1, v6); - x3 = v7; + int64_t v10 = 55LL; + int64_t v11 = i64_sub(x1, v10); + x7 = v11; } - return x3; + return x7; } static void mw_mirth_lexer_lexerZ_emitZ_stringZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { STR* v5; @@ -40931,29 +32917,29 @@ static void mw_mirth_lexer_lexerZ_emitZ_stringZBang (VAL x1, VAL x2, VAL *x3, VA uint64_t v7; VAL v8; mw_mirth_lexer_lexerZ_makeZBang(v6, x2, &v7, &v8); - VAL v9 = (mw_mirth_lexer_lexerZ_moveZBang(v8)); + VAL v9 = mw_mirth_lexer_lexerZ_moveZBang(v8); int64_t v10; VAL v11; mw_mirth_lexer_lexerZ_peek(v9, &v10, &v11); int64_t v12 = mw_std_byte_Byte_isZ_stringZ_end(v10); bool v13 = !((bool)v12); - VAL v14 = (x1); - STR* v15 = (v5); + VAL v14 = x1; + STR* v15 = v5; uint64_t v16 = v7; - VAL v17 = (v11); + VAL v17 = v11; int64_t v18 = v10; bool v19 = v13; while (v19) { - VAL v20 = (v14); - STR* v21 = (v15); + VAL v20 = v14; + STR* v21 = v15; uint64_t v22 = v16; - VAL v23 = (v17); + VAL v23 = v17; int64_t v24 = v18; VAL v25; VAL v26; VAL v27; mw_mirth_lexer_lexerZ_pushZ_stringZ_byteZBang(v20, MKSTR(v21), v23, v24, &v25, &v26, &v27); - VAL v28 = (mw_mirth_lexer_lexerZ_moveZBang(v27)); + VAL v28 = mw_mirth_lexer_lexerZ_moveZBang(v27); int64_t v29; VAL v30; mw_mirth_lexer_lexerZ_peek(v28, &v29, &v30); @@ -40970,30 +32956,20 @@ static void mw_mirth_lexer_lexerZ_emitZ_stringZBang (VAL x1, VAL x2, VAL *x3, VA bool v34 = (v18 == v33); VAL x35; VAL x36; - uint64_t x37; - VAL x38; + VAL x37; if (v34) { - x38 = v17; - x37 = v16; + x37 = v17; x36 = MKSTR(v15); x35 = v14; } else { - STR* v39; - STRLIT(v39, "String literal is missing end quote (\").", 40); - push_u64(v16); - mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang(MKSTR(v39), v14, v17); - VAL r40 = pop_resource(); - x38 = r40; - uint64_t v41 = pop_u64(); - x37 = v41; - x36 = MKSTR(v15); - VAL r42 = pop_resource(); - x35 = r42; + STR* v38; + STRLIT(v38, "String literal is missing end quote (\").", 40); + mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang(MKSTR(v38), v14, v17); } - VAL v43 = mtw_mirth_token_TokenValue_TokenStr(x36); - void* v44 = mfld_mirth_token_Token_ZTildevalue(x37); - mut_set(v43, v44); - *x4 = x38; + VAL v41 = mtw_mirth_token_TokenValue_TokenStr(x36); + void* v42 = mfld_mirth_token_Token_ZTildevalue(v16); + mut_set(v41, v42); + *x4 = x37; *x3 = x35; } static void mw_mirth_lexer_lexerZ_pushZ_stringZ_byteZBang (VAL x1, VAL x2, VAL x3, int64_t x4, VAL *x5, VAL *x6, VAL *x7) { @@ -41002,7 +32978,7 @@ static void mw_mirth_lexer_lexerZ_pushZ_stringZ_byteZBang (VAL x1, VAL x2, VAL x VAL x10; switch (x4) { case 92LL: { // B'\' - VAL v11 = (mw_mirth_lexer_lexerZ_moveZBang(x3)); + VAL v11 = mw_mirth_lexer_lexerZ_moveZBang(x3); int64_t v12; VAL v13; mw_mirth_lexer_lexerZ_peek(v11, &v12, &v13); @@ -41015,7 +32991,7 @@ static void mw_mirth_lexer_lexerZ_pushZ_stringZ_byteZBang (VAL x1, VAL x2, VAL x x8 = v14; } break; default: { - VAL v17 = (mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(x4, x2)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(x4, x2); x10 = x3; x9 = v17; x8 = x1; @@ -41031,48 +33007,48 @@ static void mw_mirth_lexer_lexerZ_pushZ_stringZ_escapeZ_byteZBang (VAL x1, VAL x VAL x10; switch (x4) { case 10LL: { // BLF - VAL v11 = (mw_mirth_lexer_lexerZ_newlineZBang(x3)); + VAL v11 = mw_mirth_lexer_lexerZ_newlineZBang(x3); x10 = v11; x9 = x2; x8 = x1; } break; case 110LL: { // B'n' int64_t v12 = 10LL /* BLF */; - VAL v13 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v12, x2)); + VAL v13 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v12, x2); x10 = x3; x9 = v13; x8 = x1; } break; case 114LL: { // B'r' int64_t v14 = 13LL /* BCR */; - VAL v15 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v14, x2)); + VAL v15 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v14, x2); x10 = x3; x9 = v15; x8 = x1; } break; case 116LL: { // B't' int64_t v16 = 9LL /* BHT */; - VAL v17 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v16, x2)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v16, x2); x10 = x3; x9 = v17; x8 = x1; } break; case 92LL: { // B'\' int64_t v18 = 92LL /* B'\' */; - VAL v19 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v18, x2)); + VAL v19 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v18, x2); x10 = x3; x9 = v19; x8 = x1; } break; case 34LL: { // BQUOTE int64_t v20 = 34LL /* BQUOTE */; - VAL v21 = (mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v20, x2)); + VAL v21 = mw_std_str_ZPlusStr_pushZ_byteZ_asciiZBang(v20, x2); x10 = x3; x9 = v21; x8 = x1; } break; default: { - VAL v22 = (mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(x4, x2)); + VAL v22 = mw_std_str_ZPlusStr_pushZ_byteZ_unsafeZBang(x4, x2); STR* v23; STRLIT(v23, "Unknown character escape sequence.", 34); VAL v24; @@ -41092,11 +33068,11 @@ static VAL mw_mirth_lexer_lexerZ_skipZ_commentZBang (VAL x1) { VAL v3; mw_mirth_lexer_lexerZ_commentZ_endZAsk(x1, &v2, &v3); bool v4 = !((bool)v2); - VAL v5 = (v3); + VAL v5 = v3; bool v6 = v4; while (v6) { - VAL v7 = (v5); - VAL v8 = (mw_mirth_lexer_lexerZ_moveZBang(v7)); + VAL v7 = v5; + VAL v8 = mw_mirth_lexer_lexerZ_moveZBang(v7); int64_t v9; VAL v10; mw_mirth_lexer_lexerZ_commentZ_endZAsk(v8, &v9, &v10); @@ -41111,7 +33087,7 @@ static VAL mw_mirth_lexer_lexerZ_skipZ_commentZBang (VAL x1) { bool v15 = (v12 == v14); VAL x16; if (v15) { - VAL v17 = (mw_mirth_lexer_lexerZ_newlineZBang(v13)); + VAL v17 = mw_mirth_lexer_lexerZ_newlineZBang(v13); x16 = v17; } else { x16 = v13; @@ -41123,11 +33099,11 @@ static VAL mw_mirth_lexer_lexerZ_skipZ_docZBang (VAL x1) { VAL v3; mw_mirth_lexer_lexerZ_commentZ_endZAsk(x1, &v2, &v3); bool v4 = !((bool)v2); - VAL v5 = (v3); + VAL v5 = v3; bool v6 = v4; while (v6) { - VAL v7 = (v5); - VAL v8 = (mw_mirth_lexer_lexerZ_moveZBang(v7)); + VAL v7 = v5; + VAL v8 = mw_mirth_lexer_lexerZ_moveZBang(v7); int64_t v9; VAL v10; mw_mirth_lexer_lexerZ_commentZ_endZAsk(v8, &v9, &v10); @@ -41160,7 +33136,7 @@ static void mw_mirth_lexer_lexerZ_commentZ_endZAsk (VAL x1, int64_t *x2, VAL *x3 *x2 = x7; } static void mw_mirth_lexer_lexerZ_peek (VAL x1, int64_t *x2, VAL *x3) { - VAL v4 = (VVAL(VTUP(x1)->cells[6])); + VAL v4 = VVAL(VTUP(x1)->cells[6]); int64_t v5; VAL v6; mw_std_input_ZPlusInput_peek(v4, &v5, &v6); @@ -41169,8 +33145,8 @@ static void mw_mirth_lexer_lexerZ_peek (VAL x1, int64_t *x2, VAL *x3) { *x2 = v5; } static VAL mw_mirth_lexer_lexerZ_moveZBang (VAL x1) { - VAL v2 = (VVAL(VTUP(x1)->cells[6])); - VAL v3 = (mw_std_input_ZPlusInput_moveZBang(v2)); + VAL v2 = VVAL(VTUP(x1)->cells[6]); + VAL v3 = mw_std_input_ZPlusInput_moveZBang(v2); VTUP(x1)->cells[6] = v3; int64_t v4 = VI64(VTUP(x1)->cells[3]); int64_t v5 = mw_mirth_location_Col_ZToInt(v4); @@ -41192,7 +33168,7 @@ static void mw_mirth_lexer_lexerZ_emitZ_warningZBang (VAL x1, VAL x2, VAL x3, VA VAL v6; VAL v7; mw_mirth_lexer_lexerZ_location(x3, &v6, &v7); - VAL v8 = (mw_mirth_mirth_ZPlusMirth_emitZ_warningZ_atZBang(v6, x1, x2)); + VAL v8 = mw_mirth_mirth_ZPlusMirth_emitZ_warningZ_atZBang(v6, x1, x2); *x5 = v7; *x4 = v8; } @@ -41200,14 +33176,13 @@ static void mw_mirth_lexer_lexerZ_emitZ_fatalZ_errorZBang (VAL x1, VAL x2, VAL x VAL v4; VAL v5; mw_mirth_lexer_lexerZ_location(x3, &v4, &v5); - push_resource(v5); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZ_atZBang(v4, x1, x2); } static VAL mw_mirth_elab_ZPlusTypeElab_typeZ_sigZ_startZBang (uint64_t x1) { VAL v2 = mw_mirth_var_Ctx0(); int64_t v3 = 0LL /* False */; int64_t v4 = 1LL /* True */; - VAL v5 = (mtw_mirth_elab_ZPlusTypeElab_ZPlusTypeElab(v2, x1, v3, v4)); + VAL v5 = mtw_mirth_elab_ZPlusTypeElab_ZPlusTypeElab(v2, x1, v3, v4); return v5; } static void mw_mirth_elab_ZPlusTypeElab_rdrop (VAL x1) { @@ -41227,7 +33202,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZBang (VAL x1, VAL x2, VA uint64_t v10 = VU64(VTUP(x2)->cells[2]); STR* v11; STRLIT(v11, "expected type signature", 23); - VAL v12 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v10, MKSTR(v11), x1)); + VAL v12 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v10, MKSTR(v11), x1); x9 = x2; x8 = v12; } else { @@ -41274,245 +33249,112 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZBang (VAL x1, VAL x2, VA int64_t v33 = mw_mirth_token_Token_runZ_endZAsk(v32); VAL x34; VAL x35; - VAL x36; - VAL x37; - VAL x38; if (((bool)v33)) { - x38 = x24; - x37 = x25; - x36 = x23; - x35 = x22; - x34 = x21; + x35 = x24; + x34 = x23; } else { - uint64_t v39 = VU64(VTUP(x24)->cells[2]); - STR* v40; - STRLIT(v40, "expected right paren or comma", 29); - VAL v41 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v39, MKSTR(v40), x23)); - x38 = x24; - x37 = x25; - x36 = v41; - x35 = x22; - x34 = x21; - } - VAL v42; - VAL v43; - mw_std_list_List_1_uncons(x34, &v42, &v43); - VAL x44; - VAL x45; - VAL x46; - VAL x47; - int64_t x48; - switch (get_data_tag(v42)) { - case 1LL: { // Some - VAL v49 = mtp_std_maybe_Maybe_1_Some(v42); - VAL v50 = mw_mirth_type_TZMul(x35, v49); - int64_t v51 = 1LL /* True */; - x48 = v51; - x47 = v43; - x46 = v50; - x45 = x38; - x44 = x36; - } break; - case 0LL: { // None - int64_t v52 = 0LL /* False */; - x48 = v52; - x47 = v43; - x46 = x35; - x45 = x38; - x44 = x36; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v53 = (x44); - VAL v54 = (x45); - VAL v55 = x46; - VAL v56 = x47; - int64_t v57 = x48; - while (((bool)v57)) { - VAL v58 = (v53); - VAL v59 = (v54); - VAL v60 = v55; - VAL v61 = v56; - VAL v62; - VAL v63; - mw_std_list_List_1_uncons(v61, &v62, &v63); - VAL x64; - VAL x65; - VAL x66; - VAL x67; - int64_t x68; - switch (get_data_tag(v62)) { - case 1LL: { // Some - VAL v69 = mtp_std_maybe_Maybe_1_Some(v62); - VAL v70 = mw_mirth_type_TZMul(v60, v69); - int64_t v71 = 1LL /* True */; - x68 = v71; - x67 = v63; - x66 = v70; - x65 = v59; - x64 = v58; - } break; - case 0LL: { // None - int64_t v72 = 0LL /* False */; - x68 = v72; - x67 = v63; - x66 = v60; - x65 = v59; - x64 = v58; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v57 = x68; - v56 = x67; - v55 = x66; - v54 = x65; - v53 = x64; + uint64_t v36 = VU64(VTUP(x24)->cells[2]); + STR* v37; + STRLIT(v37, "expected right paren or comma", 29); + VAL v38 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v36, MKSTR(v37), x23); + x35 = x24; + x34 = v38; } - decref(v56); - VAL v73 = mw_mirth_type_TZ_ZTo(v55, x37); - *x5 = v73; - *x4 = v54; - *x3 = v53; + VAL v39 = mw_std_list_List_1_for_1_sp80(x22, x21); + VAL v40 = mw_mirth_type_TZ_ZTo(v39, x25); + *x5 = v40; + *x4 = x35; + *x3 = x34; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZ_paramsZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { uint64_t v6 = VU64(VTUP(x2)->cells[2]); VAL v7 = mw_mirth_token_Token_lparenZAsk(v6); - VAL x8; - VAL x9; - VAL x10; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v7); - decref(v11); - uint64_t v12 = VU64(VTUP(x2)->cells[2]); - uint64_t v13 = mw_mirth_token_Token_next(v12); - uint64_t v14 = VU64(VTUP(x2)->cells[2]); - VAL v15 = mw_mirth_token_Token_args(v14); - VAL v16 = MKI64(0LL /* Nil */); - VAL v17 = mw_std_list_List_1_reverse(v16); - VAL v18; - VAL v19; - mw_std_list_List_1_uncons(v15, &v18, &v19); - VAL x20; - uint64_t x21; - VAL x22; - VAL x23; - VAL x24; - int64_t x25; - switch (get_data_tag(v18)) { - case 1LL: { // Some - VAL v26 = mtp_std_maybe_Maybe_1_Some(v18); - VTUP(x2)->cells[2] = v26; - VAL v27; - VAL v28; - VAL v29; - mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZBang(x1, x2, &v27, &v28, &v29); - VAL v30 = mtw_mirth_type_Type_TMorphism(v29); - VAL v31 = mtw_std_list_List_1_Cons(v30, v17); - int64_t v32 = 1LL /* True */; - x25 = v32; - x24 = v19; - x23 = v31; - x22 = v28; - x21 = v13; - x20 = v27; + int64_t v8 = get_data_tag(v7); + decref(v7); + int64_t v9 = 1LL; + bool v10 = (v8 == v9); + VAL x11; + VAL x12; + VAL x13; + if (v10) { + uint64_t v14 = VU64(VTUP(x2)->cells[2]); + uint64_t v15 = mw_mirth_token_Token_next(v14); + uint64_t v16 = VU64(VTUP(x2)->cells[2]); + VAL v17 = mw_mirth_token_Token_args(v16); + VAL v18 = MKI64(0LL /* Nil */); + VAL v19 = mw_std_list_List_1_reverse(v18); + int64_t v20 = 1LL /* True */; + VAL v21 = x1; + VAL v22 = x2; + VAL v23 = v19; + VAL v24 = v17; + int64_t v25 = v20; + int64_t v26 = v20; + while (((bool)v26)) { + VAL v27 = v21; + VAL v28 = v22; + VAL v29 = v23; + VAL v30 = v24; + int64_t v31 = v25; + VAL x32; + VAL x33; + VAL x34; + VAL x35; + int64_t x36; + switch (get_data_tag(v30)) { + case 1LL: { // Cons + VAL v37; + VAL v38; + mtp_std_list_List_1_Cons(v30, &v37, &v38); + VTUP(v28)->cells[2] = v37; + VAL v39; + VAL v40; + VAL v41; + mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZBang(v27, v28, &v39, &v40, &v41); + VAL v42 = mtw_mirth_type_Type_TMorphism(v41); + VAL v43 = mtw_std_list_List_1_Cons(v42, v29); + int64_t v44 = 1LL /* True */; + x36 = v44; + x35 = v38; + x34 = v43; + x33 = v40; + x32 = v39; } break; - case 0LL: { // None - int64_t v33 = 0LL /* False */; - x25 = v33; - x24 = v19; - x23 = v17; - x22 = x2; - x21 = v13; - x20 = x1; + case 0LL: { // Nil + VAL v45 = MKI64(0LL /* Nil */); + int64_t v46 = 0LL /* False */; + x36 = v46; + x35 = v45; + x34 = v29; + x33 = v28; + x32 = v27; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v34 = (x20); - uint64_t v35 = x21; - VAL v36 = (x22); - VAL v37 = (x23); - VAL v38 = x24; - int64_t v39 = x25; - while (((bool)v39)) { - VAL v40 = (v34); - uint64_t v41 = v35; - VAL v42 = (v36); - VAL v43 = (v37); - VAL v44 = v38; - VAL v45; - VAL v46; - mw_std_list_List_1_uncons(v44, &v45, &v46); - VAL x47; - uint64_t x48; - VAL x49; - VAL x50; - VAL x51; - int64_t x52; - switch (get_data_tag(v45)) { - case 1LL: { // Some - VAL v53 = mtp_std_maybe_Maybe_1_Some(v45); - VTUP(v42)->cells[2] = v53; - VAL v54; - VAL v55; - VAL v56; - mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZBang(v40, v42, &v54, &v55, &v56); - VAL v57 = mtw_mirth_type_Type_TMorphism(v56); - VAL v58 = mtw_std_list_List_1_Cons(v57, v43); - int64_t v59 = 1LL /* True */; - x52 = v59; - x51 = v46; - x50 = v58; - x49 = v55; - x48 = v41; - x47 = v54; - } break; - case 0LL: { // None - int64_t v60 = 0LL /* False */; - x52 = v60; - x51 = v46; - x50 = v43; - x49 = v42; - x48 = v41; - x47 = v40; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v39 = x52; - v38 = x51; - v37 = x50; - v36 = x49; - v35 = x48; - v34 = x47; - } - decref(v38); - VAL v61 = mw_std_list_List_1_reverse(v37); - VTUP(v36)->cells[2] = MKU64(v35); - x10 = v61; - x9 = v36; - x8 = v34; - } break; - case 0LL: { // None - VAL v62 = MKI64(0LL /* Nil */); - x10 = v62; - x9 = x2; - x8 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + v26 = x36; + v25 = x36; + v24 = x35; + v23 = x34; + v22 = x33; + v21 = x32; } + decref(v24); + VAL v47 = mw_std_list_List_1_reverse(v23); + VTUP(v22)->cells[2] = MKU64(v15); + x13 = v47; + x12 = v22; + x11 = v21; + } else { + VAL v48 = MKI64(0LL /* Nil */); + x13 = v48; + x12 = x2; + x11 = x1; } - *x5 = x10; - *x4 = x9; - *x3 = x8; + *x5 = x13; + *x4 = x12; + *x3 = x11; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_stackZ_typeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { uint64_t v6 = VU64(VTUP(x2)->cells[2]); @@ -41553,14 +33395,14 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_stackZ_typeZ_partsZBang (VAL x1, V uint64_t v7 = VU64(VTUP(x2)->cells[2]); int64_t v8 = mw_mirth_token_Token_sigZ_stackZ_endZAsk(v7); bool v9 = !((bool)v8); - VAL v10 = (x1); + VAL v10 = x1; VAL v11 = x3; - VAL v12 = (x2); + VAL v12 = x2; bool v13 = v9; while (v13) { - VAL v14 = (v10); + VAL v14 = v10; VAL v15 = v11; - VAL v16 = (v12); + VAL v16 = v12; VAL v17; VAL v18; VAL v19; @@ -41601,7 +33443,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argZBang (VAL x1, VAL x2, VA decref(v14); STR* v16; STRLIT(v16, "Expected type, not label.", 25); - VAL v17 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v16), v7)); + VAL v17 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v16), v7); VAL v18 = MKI64(0LL /* TYPE_ERROR */); x12 = v18; x11 = v8; @@ -41612,7 +33454,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argZBang (VAL x1, VAL x2, VA decref(v19); STR* v20; STRLIT(v20, "Expected type, not resource.", 28); - VAL v21 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v20), v7)); + VAL v21 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v20), v7); VAL v22 = MKI64(0LL /* TYPE_ERROR */); x12 = v22; x11 = v8; @@ -41625,7 +33467,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argZBang (VAL x1, VAL x2, VA decref(v23); STR* v25; STRLIT(v25, "Expected type, not labelled resource.", 37); - VAL v26 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v25), v7)); + VAL v26 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v25), v7); VAL v27 = MKI64(0LL /* TYPE_ERROR */); x12 = v27; x11 = v8; @@ -41639,22 +33481,19 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argZBang (VAL x1, VAL x2, VA int64_t v29 = mw_mirth_token_Token_argZ_endZAsk(v28); VAL x30; VAL x31; - VAL x32; if (((bool)v29)) { - x32 = x11; - x31 = x12; + x31 = x11; x30 = x10; } else { - uint64_t v33 = VU64(VTUP(x11)->cells[2]); - STR* v34; - STRLIT(v34, "Unexpected token after type.", 28); - VAL v35 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v33, MKSTR(v34), x10)); - x32 = x11; - x31 = x12; - x30 = v35; - } - *x5 = x31; - *x4 = x32; + uint64_t v32 = VU64(VTUP(x11)->cells[2]); + STR* v33; + STRLIT(v33, "Unexpected token after type.", 28); + VAL v34 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v32, MKSTR(v33), x10); + x31 = x11; + x30 = v34; + } + *x5 = x12; + *x4 = x31; *x3 = x30; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_resourceZ_argZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { @@ -41672,7 +33511,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_resourceZ_argZBang (VAL x1, VAL x2 decref(v13); STR* v14; STRLIT(v14, "Expected resource, not type.", 28); - VAL v15 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v14), v7)); + VAL v15 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v14), v7); VAL v16 = MKI64(0LL /* TYPE_ERROR */); x12 = v16; x11 = v8; @@ -41685,7 +33524,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_resourceZ_argZBang (VAL x1, VAL x2 decref(v17); STR* v19; STRLIT(v19, "Expected resource, not label.", 29); - VAL v20 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v19), v7)); + VAL v20 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v19), v7); VAL v21 = MKI64(0LL /* TYPE_ERROR */); x12 = v21; x11 = v8; @@ -41704,7 +33543,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_resourceZ_argZBang (VAL x1, VAL x2 decref(v23); STR* v25; STRLIT(v25, "Expected resource, not label.", 29); - VAL v26 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v25), v7)); + VAL v26 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v6, MKSTR(v25), v7); VAL v27 = MKI64(0LL /* TYPE_ERROR */); x12 = v27; x11 = v8; @@ -41718,22 +33557,19 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_resourceZ_argZBang (VAL x1, VAL x2 int64_t v29 = mw_mirth_token_Token_argZ_endZAsk(v28); VAL x30; VAL x31; - VAL x32; if (((bool)v29)) { - x32 = x11; - x31 = x12; + x31 = x11; x30 = x10; } else { - uint64_t v33 = VU64(VTUP(x11)->cells[2]); - STR* v34; - STRLIT(v34, "Unexpected token after resource.", 32); - VAL v35 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v33, MKSTR(v34), x10)); - x32 = x11; - x31 = x12; - x30 = v35; - } - *x5 = x31; - *x4 = x32; + uint64_t v32 = VU64(VTUP(x11)->cells[2]); + STR* v33; + STRLIT(v33, "Unexpected token after resource.", 32); + VAL v34 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v32, MKSTR(v33), x10); + x31 = x11; + x30 = v34; + } + *x5 = x12; + *x4 = x31; *x3 = x30; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_stackZ_typeZ_partZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { @@ -41861,43 +33697,39 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_stackZ_typeZ_partZBang (VAL x1, VA case 0LL: { // None uint64_t v74 = VU64(VTUP(x2)->cells[2]); VAL v75 = mw_mirth_token_Token_lsquareZAsk(v74); - VAL x76; - VAL x77; - VAL x78; - switch (get_data_tag(v75)) { - case 1LL: { // Some - VAL v79 = mtp_std_maybe_Maybe_1_Some(v75); - decref(v79); - VAL v80; - VAL v81; - VAL v82; - mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_quoteZBang(x1, x2, &v80, &v81, &v82); - VAL v83 = mtw_mirth_type_StackTypePart_STPCons(v82); - x78 = v83; - x77 = v81; - x76 = v80; - } break; - case 0LL: { // None - uint64_t v84 = VU64(VTUP(x2)->cells[2]); - STR* v85; - STRLIT(v85, "Expected type, got unknown token.", 33); - VAL v86 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v84, MKSTR(v85), x1)); - uint64_t v87 = VU64(VTUP(x2)->cells[2]); - uint64_t v88 = mw_mirth_token_Token_next(v87); - VTUP(x2)->cells[2] = MKU64(v88); - VAL v89 = MKI64(0LL /* TYPE_ERROR */); - VAL v90 = mtw_mirth_type_StackTypePart_STPCons(v89); - x78 = v90; - x77 = x2; - x76 = v86; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v76 = get_data_tag(v75); + decref(v75); + int64_t v77 = 1LL; + bool v78 = (v76 == v77); + VAL x79; + VAL x80; + VAL x81; + if (v78) { + VAL v82; + VAL v83; + VAL v84; + mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_quoteZBang(x1, x2, &v82, &v83, &v84); + VAL v85 = mtw_mirth_type_StackTypePart_STPCons(v84); + x81 = v85; + x80 = v83; + x79 = v82; + } else { + uint64_t v86 = VU64(VTUP(x2)->cells[2]); + STR* v87; + STRLIT(v87, "Expected type, got unknown token.", 33); + VAL v88 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v86, MKSTR(v87), x1); + uint64_t v89 = VU64(VTUP(x2)->cells[2]); + uint64_t v90 = mw_mirth_token_Token_next(v89); + VTUP(x2)->cells[2] = MKU64(v90); + VAL v91 = MKI64(0LL /* TYPE_ERROR */); + VAL v92 = mtw_mirth_type_StackTypePart_STPCons(v91); + x81 = v92; + x80 = x2; + x79 = v88; } - x68 = x78; - x67 = x77; - x66 = x76; + x68 = x81; + x67 = x80; + x66 = x79; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -41994,29 +33826,23 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_stackZ_typeZ_varZBang (VAL x1, VAL VAL v10; mw_mirth_elab_ZPlusTypeElab_elabZ_implicitZ_varZBang(x1, x2, x3, v7, &v8, &v9, &v10); VAL x11; - VAL x12; - VAL x13; switch (get_data_tag(v10)) { case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v10); - VAL v15 = mtw_mirth_type_StackType_STVar(VU64(v14)); - x13 = v15; - x12 = v9; - x11 = v8; + VAL v12 = mtp_std_maybe_Maybe_1_Some(v10); + VAL v13 = mtw_mirth_type_StackType_STVar(VU64(v12)); + x11 = v13; } break; case 0LL: { // None - VAL v16 = MKI64(0LL /* STACK_TYPE_ERROR */); - x13 = v16; - x12 = v9; - x11 = v8; + VAL v14 = MKI64(0LL /* STACK_TYPE_ERROR */); + x11 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x6 = x13; - *x5 = x12; - *x4 = x11; + *x6 = x11; + *x5 = v9; + *x4 = v8; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_varZBang (VAL x1, VAL x2, uint64_t x3, VAL *x4, VAL *x5, VAL *x6) { VAL v7 = mw_mirth_type_TYPEz_TYPE(); @@ -42025,29 +33851,23 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_varZBang (VAL x1, VAL x2, ui VAL v10; mw_mirth_elab_ZPlusTypeElab_elabZ_implicitZ_varZBang(x1, x2, x3, v7, &v8, &v9, &v10); VAL x11; - VAL x12; - VAL x13; switch (get_data_tag(v10)) { case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v10); - VAL v15 = mtw_mirth_type_Type_TVar(VU64(v14)); - x13 = v15; - x12 = v9; - x11 = v8; + VAL v12 = mtp_std_maybe_Maybe_1_Some(v10); + VAL v13 = mtw_mirth_type_Type_TVar(VU64(v12)); + x11 = v13; } break; case 0LL: { // None - VAL v16 = MKI64(0LL /* TYPE_ERROR */); - x13 = v16; - x12 = v9; - x11 = v8; + VAL v14 = MKI64(0LL /* TYPE_ERROR */); + x11 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x6 = x13; - *x5 = x12; - *x4 = x11; + *x6 = x11; + *x5 = v9; + *x4 = v8; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_resourceZ_varZBang (VAL x1, VAL x2, uint64_t x3, VAL *x4, VAL *x5, VAL *x6) { VAL v7 = mw_mirth_type_TYPEz_RESOURCE(); @@ -42056,29 +33876,23 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_resourceZ_varZBang (VAL x1, VAL x2 VAL v10; mw_mirth_elab_ZPlusTypeElab_elabZ_implicitZ_varZBang(x1, x2, x3, v7, &v8, &v9, &v10); VAL x11; - VAL x12; - VAL x13; switch (get_data_tag(v10)) { case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v10); - VAL v15 = mtw_mirth_type_Type_TVar(VU64(v14)); - x13 = v15; - x12 = v9; - x11 = v8; + VAL v12 = mtp_std_maybe_Maybe_1_Some(v10); + VAL v13 = mtw_mirth_type_Type_TVar(VU64(v12)); + x11 = v13; } break; case 0LL: { // None - VAL v16 = MKI64(0LL /* TYPE_ERROR */); - x13 = v16; - x12 = v9; - x11 = v8; + VAL v14 = MKI64(0LL /* TYPE_ERROR */); + x11 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x6 = x13; - *x5 = x12; - *x4 = x11; + *x6 = x11; + *x5 = v9; + *x4 = v8; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_implicitZ_varZBang (VAL x1, VAL x2, uint64_t x3, VAL x4, VAL *x5, VAL *x6, VAL *x7) { VAL v8 = VVAL(VTUP(x2)->cells[1]); @@ -42125,7 +33939,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_implicitZ_varZBang (VAL x1, VAL x2 uint64_t v29 = VU64(VTUP(x2)->cells[2]); STR* v30; STRLIT(v30, "Implicit type variable not allowed here.", 40); - VAL v31 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v29, MKSTR(v30), x1)); + VAL v31 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v29, MKSTR(v30), x1); decref(x4); VAL v32 = MKI64(0LL /* None */); x23 = v32; @@ -42141,7 +33955,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_implicitZ_varZBang (VAL x1, VAL x2 } } uint64_t v33 = VU64(VTUP(x11)->cells[2]); - VAL v34 = (mw_mirth_token_Token_argsZ_0(v33, x10)); + VAL v34 = mw_mirth_token_Token_argsZ_0(v33, x10); uint64_t v35 = VU64(VTUP(x11)->cells[2]); uint64_t v36 = mw_mirth_token_Token_succ(v35); VTUP(x11)->cells[2] = MKU64(v36); @@ -42162,61 +33976,34 @@ static void mw_mirth_elab_resolveZ_defZ_beginZBang (VAL x1, uint64_t x2, VAL x3, VAL v16 = mw_mirth_token_nameZDivdnameZ_penultimateZ_nameZAsk(x3); VAL x17; uint64_t x18; - int64_t x19; - VAL x20; - int64_t x21; - VAL x22; - uint64_t x23; + VAL x19; switch (get_data_tag(v16)) { case 1LL: { // Some - VAL v24 = mtp_std_maybe_Maybe_1_Some(v16); - x23 = VU64(v24); - x22 = x3; - x21 = x4; - x20 = x6; - x19 = x5; + VAL v20 = mtp_std_maybe_Maybe_1_Some(v16); + x19 = v20; x18 = x2; - x17 = x1; + x17 = x6; } break; case 0LL: { // None - STR* v25; - STRLIT(v25, "Expected a namespace.", 21); - lpush(&lbl_sort, x1); - lpush(&lbl_reportZ_ambiguousZ_asZ_warning, MKI64(x5)); - lpush(&lbl_ignoreZ_lastZ_name, MKI64(x4)); - lpush(&lbl_nameZDivdname, x3); - lpush(&lbl_token, MKU64(x2)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v25), x6); - uint64_t v26 = pop_u64(); - x23 = v26; - VAL v27 = lpop(&lbl_nameZDivdname); - x22 = v27; - int64_t v28 = VI64(lpop(&lbl_ignoreZ_lastZ_name)); - x21 = v28; - VAL r29 = pop_resource(); - x20 = r29; - int64_t v30 = VI64(lpop(&lbl_reportZ_ambiguousZ_asZ_warning)); - x19 = v30; - uint64_t v31 = VU64(lpop(&lbl_token)); - x18 = v31; - VAL v32 = lpop(&lbl_sort); - x17 = v32; + STR* v21; + STRLIT(v21, "Expected a namespace.", 21); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v21), x6); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x15 = x23; - x14 = x22; - x13 = x21; - x12 = x20; - x11 = x19; + x15 = VU64(x19); + x14 = x3; + x13 = x4; + x12 = x17; + x11 = x5; x10 = x18; - x9 = x17; + x9 = x1; } else { incref(x3); - uint64_t v33 = mw_mirth_token_nameZDivdnameZ_lastZ_name(x3); - x15 = v33; + uint64_t v24 = mw_mirth_token_nameZDivdnameZ_lastZ_name(x3); + x15 = v24; x14 = x3; x13 = x4; x12 = x6; @@ -42224,10 +34011,10 @@ static void mw_mirth_elab_resolveZ_defZ_beginZBang (VAL x1, uint64_t x2, VAL x3, x10 = x2; x9 = x1; } - VAL v34 = mw_mirth_name_Name_defs(x15); - VAL v35 = MKI64(0LL /* Nil */); - VAL v36 = (mtw_mirth_elab_ZPlusResolveDef_ZPlusResolveDef(x9, x10, x14, v34, v35, x13, x11)); - *x8 = v36; + VAL v25 = mw_mirth_name_Name_defs(x15); + VAL v26 = MKI64(0LL /* Nil */); + VAL v27 = mtw_mirth_elab_ZPlusResolveDef_ZPlusResolveDef(x9, x10, x14, v25, v26, x13, x11); + *x8 = v27; *x7 = x12; } static void mw_mirth_elab_resolveZ_defZ_endZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { @@ -42237,7 +34024,7 @@ static void mw_mirth_elab_resolveZ_defZ_endZBang (VAL x1, VAL x2, VAL *x3, VAL * VAL x7; switch (get_data_tag(v5)) { case 0LL: { // Nil - VAL v8 = (mw_mirth_elab_ZPlusResolveDef_resolveZ_defZ_unknown(x1, x2)); + VAL v8 = mw_mirth_elab_ZPlusResolveDef_resolveZ_defZ_unknown(x1, x2); VAL v9 = MKI64(0LL /* None */); x7 = v9; x6 = v8; @@ -42258,207 +34045,107 @@ static void mw_mirth_elab_resolveZ_defZ_endZBang (VAL x1, VAL x2, VAL *x3, VAL * default: { VAL v15 = MKI64(0LL /* Nil */); VAL v16 = mw_std_list_List_1_reverse(v15); - VAL v17; - VAL v18; - mw_std_list_List_1_uncons(v11, &v17, &v18); - VAL x19; - VAL x20; - VAL x21; - VAL x22; - VAL x23; - int64_t x24; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v25 = mtp_std_maybe_Maybe_1_Some(v17); - incref(v25); - incref(v10); - VAL v26; - int64_t v27; - mw_mirth_def_Def_sameZ_resolvedZAsk(x1, v25, v10, &v26, &v27); - bool v28 = !((bool)v27); - VAL x29; - VAL x30; - VAL x31; - VAL x32; - if (v28) { - VAL v33 = mtw_std_maybe_Maybe_1_Some(v25); - x32 = v33; - x31 = v10; - x30 = x2; - x29 = v26; - } else { - decref(v25); - VAL v34 = MKI64(0LL /* None */); - x32 = v34; - x31 = v10; - x30 = x2; - x29 = v26; - } - VAL x35; - switch (get_data_tag(x32)) { - case 1LL: { // Some - VAL v36 = mtp_std_maybe_Maybe_1_Some(x32); - VAL v37 = mtw_std_list_List_1_Cons(v36, v16); - x35 = v37; - push_resource(x29); - push_resource(x30); - push_value(x31); - } break; - case 0LL: { // None - x35 = v16; - push_resource(x29); - push_resource(x30); - push_value(x31); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v38 = 1LL /* True */; - x24 = v38; - x23 = v18; - x22 = x35; - VAL v39 = pop_value(); - x21 = v39; - VAL r40 = pop_resource(); - x20 = r40; - VAL r41 = pop_resource(); - x19 = r41; - } break; - case 0LL: { // None - int64_t v42 = 0LL /* False */; - x24 = v42; - x23 = v18; - x22 = v16; - x21 = v10; - x20 = x2; - x19 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v43 = (x19); - VAL v44 = (x20); - VAL v45 = x21; - VAL v46 = (x22); - VAL v47 = x23; - int64_t v48 = x24; - while (((bool)v48)) { - VAL v49 = (v43); - VAL v50 = (v44); - VAL v51 = v45; - VAL v52 = (v46); - VAL v53 = v47; - VAL v54; - VAL v55; - mw_std_list_List_1_uncons(v53, &v54, &v55); - VAL x56; - VAL x57; - VAL x58; - VAL x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v54)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v54); - incref(v62); - incref(v51); - VAL v63; - int64_t v64; - mw_mirth_def_Def_sameZ_resolvedZAsk(v49, v62, v51, &v63, &v64); - bool v65 = !((bool)v64); - VAL x66; - VAL x67; - VAL x68; - VAL x69; - if (v65) { - VAL v70 = mtw_std_maybe_Maybe_1_Some(v62); - x69 = v70; - x68 = v51; - x67 = v50; - x66 = v63; + int64_t v17 = 1LL /* True */; + VAL v18 = x1; + VAL v19 = x2; + VAL v20 = v10; + VAL v21 = v16; + VAL v22 = v11; + int64_t v23 = v17; + int64_t v24 = v17; + while (((bool)v24)) { + VAL v25 = v18; + VAL v26 = v19; + VAL v27 = v20; + VAL v28 = v21; + VAL v29 = v22; + int64_t v30 = v23; + VAL x31; + VAL x32; + VAL x33; + VAL x34; + VAL x35; + int64_t x36; + switch (get_data_tag(v29)) { + case 1LL: { // Cons + VAL v37; + VAL v38; + mtp_std_list_List_1_Cons(v29, &v37, &v38); + incref(v37); + incref(v27); + VAL v39; + int64_t v40; + mw_mirth_def_Def_sameZ_resolvedZAsk(v25, v37, v27, &v39, &v40); + bool v41 = !((bool)v40); + VAL x42; + VAL x43; + VAL x44; + VAL x45; + if (v41) { + VAL v46 = mtw_std_list_List_1_Cons(v37, v28); + x45 = v46; + x44 = v26; + x43 = v39; + x42 = v27; } else { - decref(v62); - VAL v71 = MKI64(0LL /* None */); - x69 = v71; - x68 = v51; - x67 = v50; - x66 = v63; - } - VAL x72; - switch (get_data_tag(x69)) { - case 1LL: { // Some - VAL v73 = mtp_std_maybe_Maybe_1_Some(x69); - VAL v74 = mtw_std_list_List_1_Cons(v73, v52); - x72 = v74; - push_resource(x66); - push_resource(x67); - push_value(x68); - } break; - case 0LL: { // None - x72 = v52; - push_resource(x66); - push_resource(x67); - push_value(x68); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + decref(v37); + x45 = v28; + x44 = v26; + x43 = v39; + x42 = v27; } - int64_t v75 = 1LL /* True */; - x61 = v75; - x60 = v55; - x59 = x72; - VAL v76 = pop_value(); - x58 = v76; - VAL r77 = pop_resource(); - x57 = r77; - VAL r78 = pop_resource(); - x56 = r78; + int64_t v47 = 1LL /* True */; + x36 = v47; + x35 = v38; + x34 = x45; + x33 = x44; + x32 = x43; + x31 = x42; } break; - case 0LL: { // None - int64_t v79 = 0LL /* False */; - x61 = v79; - x60 = v55; - x59 = v52; - x58 = v51; - x57 = v50; - x56 = v49; + case 0LL: { // Nil + VAL v48 = MKI64(0LL /* Nil */); + int64_t v49 = 0LL /* False */; + x36 = v49; + x35 = v48; + x34 = v28; + x33 = v26; + x32 = v25; + x31 = v27; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v48 = x61; - v47 = x60; - v46 = x59; - v45 = x58; - v44 = x57; - v43 = x56; + v24 = x36; + v23 = x36; + v22 = x35; + v21 = x34; + v20 = x31; + v19 = x33; + v18 = x32; } - decref(v47); - VAL v80 = mw_std_list_List_1_reverse(v46); - VAL x81; - VAL x82; - switch (get_data_tag(v80)) { + decref(v22); + VAL v50 = mw_std_list_List_1_reverse(v21); + VAL x51; + VAL x52; + switch (get_data_tag(v50)) { case 0LL: { // Nil - mw_mirth_elab_ZPlusResolveDef_rdrop(v44); - VAL v83 = mtw_std_maybe_Maybe_1_Some(v45); - x82 = v83; - x81 = v43; + mw_mirth_elab_ZPlusResolveDef_rdrop(v19); + VAL v53 = mtw_std_maybe_Maybe_1_Some(v20); + x52 = v53; + x51 = v18; } break; default: { - decref(v80); - decref(v45); - VAL v84 = (mw_mirth_elab_ZPlusResolveDef_resolveZ_defZ_ambiguous(v43, v44)); - VAL v85 = MKI64(0LL /* None */); - x82 = v85; - x81 = v84; + decref(v50); + decref(v20); + VAL v54 = mw_mirth_elab_ZPlusResolveDef_resolveZ_defZ_ambiguous(v18, v19); + VAL v55 = MKI64(0LL /* None */); + x52 = v55; + x51 = v54; } break; } - x13 = x82; - x12 = x81; + x13 = x52; + x12 = x51; } break; } x7 = x13; @@ -42495,272 +34182,52 @@ static VAL mw_mirth_elab_ZPlusResolveDef_resolveZ_defZ_ambiguous (VAL x1, VAL x2 STRLIT(v7, "", 0); STR* v8; STRLIT(v8, "Can't resolve ", 14); - VAL v9 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), MKSTR(v7))); + VAL v9 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), MKSTR(v7)); VAL v10 = VVAL(VTUP(x2)->cells[1]); incref(v10); - VAL v11 = (mw_std_str_ZPlusStr_pushZ_strZBang(v10, v9)); + VAL v11 = mw_std_str_ZPlusStr_pushZ_strZBang(v10, v9); STR* v12; STRLIT(v12, " due to previous errors. Candidates are:", 40); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11)); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11); STR* v14; STRLIT(v14, " ", 1); VAL v15 = VVAL(VTUP(x2)->cells[4]); incref(v15); VAL v16; VAL v17; - mw_std_list_List_1_uncons(v15, &v16, &v17); - VAL x18; - uint64_t x19; - VAL x20; - VAL x21; - VAL x22; - VAL x23; - int64_t x24; - switch (get_data_tag(v16)) { - case 1LL: { // Some - VAL v25 = mtp_std_maybe_Maybe_1_Some(v16); - VAL v26 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), v13)); - VAL v27; - VAL v28; - mw_mirth_def_Def_qnameZ_hard(x1, v25, &v27, &v28); - VAL v29; - VAL v30; - mw_mirth_name_QName_ZToStr(v27, v28, &v29, &v30); - VAL v31 = (mw_std_str_ZPlusStr_pushZ_strZBang(v30, v26)); - STR* v32; - STRLIT(v32, ", ", 2); - int64_t v33 = 1LL /* True */; - x24 = v33; - x23 = v17; - x22 = v31; - x21 = x2; - x20 = MKSTR(v32); - x19 = v6; - x18 = v29; - } break; - case 0LL: { // None - int64_t v34 = 0LL /* False */; - x24 = v34; - x23 = v17; - x22 = v13; - x21 = x2; - x20 = MKSTR(v14); - x19 = v6; - x18 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v35 = (x18); - uint64_t v36 = x19; - VAL v37 = x20; - VAL v38 = (x21); - VAL v39 = (x22); - VAL v40 = x23; - int64_t v41 = x24; - while (((bool)v41)) { - VAL v42 = (v35); - uint64_t v43 = v36; - VAL v44 = v37; - VAL v45 = (v38); - VAL v46 = (v39); - VAL v47 = v40; - VAL v48; - VAL v49; - mw_std_list_List_1_uncons(v47, &v48, &v49); - VAL x50; - uint64_t x51; - VAL x52; - VAL x53; - VAL x54; - VAL x55; - int64_t x56; - switch (get_data_tag(v48)) { - case 1LL: { // Some - VAL v57 = mtp_std_maybe_Maybe_1_Some(v48); - VAL v58 = (mw_std_str_ZPlusStr_pushZ_strZBang(v44, v46)); - VAL v59; - VAL v60; - mw_mirth_def_Def_qnameZ_hard(v42, v57, &v59, &v60); - VAL v61; - VAL v62; - mw_mirth_name_QName_ZToStr(v59, v60, &v61, &v62); - VAL v63 = (mw_std_str_ZPlusStr_pushZ_strZBang(v62, v58)); - STR* v64; - STRLIT(v64, ", ", 2); - int64_t v65 = 1LL /* True */; - x56 = v65; - x55 = v49; - x54 = v63; - x53 = v45; - x52 = MKSTR(v64); - x51 = v43; - x50 = v61; - } break; - case 0LL: { // None - int64_t v66 = 0LL /* False */; - x56 = v66; - x55 = v49; - x54 = v46; - x53 = v45; - x52 = v44; - x51 = v43; - x50 = v42; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v41 = x56; - v40 = x55; - v39 = x54; - v38 = x53; - v37 = x52; - v36 = x51; - v35 = x50; - } - decref(v40); - decref(v37); - VAL v67 = (mw_mirth_mirth_ZPlusMirth_emitZ_warningZBang(v36, v39, v35)); - x5 = v38; - x4 = v67; + VAL v18; + VAL v19; + mw_std_list_List_1_for_1_sp63(x1, x2, v13, MKSTR(v14), v15, &v16, &v17, &v18, &v19); + decref(v19); + VAL v20 = mw_mirth_mirth_ZPlusMirth_emitZ_warningZBang(v6, v18, v16); + x5 = v17; + x4 = v20; } else { - uint64_t v68 = VU64(VTUP(x2)->cells[2]); - STR* v69; - STRLIT(v69, "", 0); - STR* v70; - STRLIT(v70, "Ambiguous ", 10); - VAL v71 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v70), MKSTR(v69))); - VAL v72 = VVAL(VTUP(x2)->cells[1]); - incref(v72); - VAL v73 = (mw_std_str_ZPlusStr_pushZ_strZBang(v72, v71)); - STR* v74; - STRLIT(v74, ". Can't decide between:", 23); - VAL v75 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v74), v73)); - STR* v76; - STRLIT(v76, " ", 1); - VAL v77 = VVAL(VTUP(x2)->cells[4]); - incref(v77); - VAL v78; - VAL v79; - mw_std_list_List_1_uncons(v77, &v78, &v79); - VAL x80; - uint64_t x81; - VAL x82; - VAL x83; - VAL x84; - VAL x85; - int64_t x86; - switch (get_data_tag(v78)) { - case 1LL: { // Some - VAL v87 = mtp_std_maybe_Maybe_1_Some(v78); - VAL v88 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v76), v75)); - VAL v89; - VAL v90; - mw_mirth_def_Def_qnameZ_hard(x1, v87, &v89, &v90); - VAL v91; - VAL v92; - mw_mirth_name_QName_ZToStr(v89, v90, &v91, &v92); - VAL v93 = (mw_std_str_ZPlusStr_pushZ_strZBang(v92, v88)); - STR* v94; - STRLIT(v94, ", ", 2); - int64_t v95 = 1LL /* True */; - x86 = v95; - x85 = v79; - x84 = v93; - x83 = x2; - x82 = MKSTR(v94); - x81 = v68; - x80 = v91; - } break; - case 0LL: { // None - int64_t v96 = 0LL /* False */; - x86 = v96; - x85 = v79; - x84 = v75; - x83 = x2; - x82 = MKSTR(v76); - x81 = v68; - x80 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v97 = (x80); - uint64_t v98 = x81; - VAL v99 = x82; - VAL v100 = (x83); - VAL v101 = (x84); - VAL v102 = x85; - int64_t v103 = x86; - while (((bool)v103)) { - VAL v104 = (v97); - uint64_t v105 = v98; - VAL v106 = v99; - VAL v107 = (v100); - VAL v108 = (v101); - VAL v109 = v102; - VAL v110; - VAL v111; - mw_std_list_List_1_uncons(v109, &v110, &v111); - VAL x112; - uint64_t x113; - VAL x114; - VAL x115; - VAL x116; - VAL x117; - int64_t x118; - switch (get_data_tag(v110)) { - case 1LL: { // Some - VAL v119 = mtp_std_maybe_Maybe_1_Some(v110); - VAL v120 = (mw_std_str_ZPlusStr_pushZ_strZBang(v106, v108)); - VAL v121; - VAL v122; - mw_mirth_def_Def_qnameZ_hard(v104, v119, &v121, &v122); - VAL v123; - VAL v124; - mw_mirth_name_QName_ZToStr(v121, v122, &v123, &v124); - VAL v125 = (mw_std_str_ZPlusStr_pushZ_strZBang(v124, v120)); - STR* v126; - STRLIT(v126, ", ", 2); - int64_t v127 = 1LL /* True */; - x118 = v127; - x117 = v111; - x116 = v125; - x115 = v107; - x114 = MKSTR(v126); - x113 = v105; - x112 = v123; - } break; - case 0LL: { // None - int64_t v128 = 0LL /* False */; - x118 = v128; - x117 = v111; - x116 = v108; - x115 = v107; - x114 = v106; - x113 = v105; - x112 = v104; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v103 = x118; - v102 = x117; - v101 = x116; - v100 = x115; - v99 = x114; - v98 = x113; - v97 = x112; - } - decref(v102); - decref(v99); - VAL v129 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v98, v101, v97)); - x5 = v100; - x4 = v129; + uint64_t v21 = VU64(VTUP(x2)->cells[2]); + STR* v22; + STRLIT(v22, "", 0); + STR* v23; + STRLIT(v23, "Ambiguous ", 10); + VAL v24 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v23), MKSTR(v22)); + VAL v25 = VVAL(VTUP(x2)->cells[1]); + incref(v25); + VAL v26 = mw_std_str_ZPlusStr_pushZ_strZBang(v25, v24); + STR* v27; + STRLIT(v27, ". Can't decide between:", 23); + VAL v28 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v27), v26); + STR* v29; + STRLIT(v29, " ", 1); + VAL v30 = VVAL(VTUP(x2)->cells[4]); + incref(v30); + VAL v31; + VAL v32; + VAL v33; + VAL v34; + mw_std_list_List_1_for_1_sp63(x1, x2, v28, MKSTR(v29), v30, &v31, &v32, &v33, &v34); + decref(v34); + VAL v35 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v21, v33, v31); + x5 = v32; + x4 = v35; } mw_mirth_elab_ZPlusResolveDef_rdrop(x5); return x4; @@ -42772,654 +34239,433 @@ static VAL mw_mirth_elab_ZPlusResolveDef_resolveZ_defZ_unknown (VAL x1, VAL x2) VAL v5 = VVAL(VTUP(x2)->cells[5]); incref(v5); VAL x6; - uint64_t x7; + VAL x7; VAL x8; - VAL x9; switch (get_data_tag(v5)) { case 0LL: { // Nil - STR* v10; - STRLIT(v10, "Unknown ", 8); - VAL v11 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v10), MKSTR(v4))); - VAL v12 = VVAL(VTUP(x2)->cells[1]); - incref(v12); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(v12, v11)); - STR* v14; - STRLIT(v14, " name, possibly a misspelling.", 30); - VAL v15 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), v13)); - x9 = v15; - x8 = x2; - x7 = v3; + STR* v9; + STRLIT(v9, "Unknown ", 8); + VAL v10 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v9), MKSTR(v4)); + VAL v11 = VVAL(VTUP(x2)->cells[1]); + incref(v11); + VAL v12 = mw_std_str_ZPlusStr_pushZ_strZBang(v11, v10); + STR* v13; + STRLIT(v13, " name, possibly a misspelling.", 30); + VAL v14 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v13), v12); + x8 = v14; + x7 = x2; x6 = x1; } break; case 1LL: { // Cons + VAL v15; VAL v16; - VAL v17; - mtp_std_list_List_1_Cons(v5, &v16, &v17); - uint64_t x18; + mtp_std_list_List_1_Cons(v5, &v15, &v16); + VAL x17; + VAL x18; VAL x19; - VAL x20; - VAL x21; - switch (get_data_tag(v17)) { + switch (get_data_tag(v16)) { case 0LL: { // Nil - uint64_t x22; - VAL x23; - VAL x24; - VAL x25; - switch (get_data_tag(v16)) { + VAL x20; + VAL x21; + VAL x22; + switch (get_data_tag(v15)) { case 0LL: { // RD_WRONG_SORT - VAL v26 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v16); - STR* v27; - STRLIT(v27, "Expected a ", 11); - VAL v28 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v27), MKSTR(v4))); - VAL v29 = VVAL(VTUP(x2)->cells[1]); - incref(v29); - VAL v30 = (mw_std_str_ZPlusStr_pushZ_strZBang(v29, v28)); - STR* v31; - STRLIT(v31, ", but ", 6); - VAL v32 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v31), v30)); + VAL v23 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v15); + STR* v24; + STRLIT(v24, "Expected a ", 11); + VAL v25 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v24), MKSTR(v4)); + VAL v26 = VVAL(VTUP(x2)->cells[1]); + incref(v26); + VAL v27 = mw_std_str_ZPlusStr_pushZ_strZBang(v26, v25); + STR* v28; + STRLIT(v28, ", but ", 6); + VAL v29 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v28), v27); + VAL v30; + VAL v31; + mw_mirth_def_Def_qnameZ_hard(x1, v23, &v30, &v31); + VAL v32; VAL v33; - VAL v34; - mw_mirth_def_Def_qnameZ_hard(x1, v26, &v33, &v34); - VAL v35; - VAL v36; - mw_mirth_name_QName_ZToStr(v33, v34, &v35, &v36); - VAL v37 = (mw_std_str_ZPlusStr_pushZ_strZBang(v36, v32)); - STR* v38; - STRLIT(v38, " is not a ", 10); - VAL v39 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v38), v37)); - VAL v40 = VVAL(VTUP(x2)->cells[1]); - incref(v40); - VAL v41 = (mw_std_str_ZPlusStr_pushZ_strZBang(v40, v39)); - STR* v42; - STRLIT(v42, ".", 1); - VAL v43 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v42), v41)); - x25 = v43; - x24 = x2; - x23 = v35; - x22 = v3; + mw_mirth_name_QName_ZToStr(v30, v31, &v32, &v33); + VAL v34 = mw_std_str_ZPlusStr_pushZ_strZBang(v33, v29); + STR* v35; + STRLIT(v35, " is not a ", 10); + VAL v36 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v35), v34); + VAL v37 = VVAL(VTUP(x2)->cells[1]); + incref(v37); + VAL v38 = mw_std_str_ZPlusStr_pushZ_strZBang(v37, v36); + STR* v39; + STRLIT(v39, ".", 1); + VAL v40 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v39), v38); + x22 = v40; + x21 = x2; + x20 = v32; } break; case 2LL: { // RD_NOT_VISIBLE - VAL v44 = mtp_mirth_elab_RejectedDef_RDz_NOTz_VISIBLE(v16); - STR* v45; - STRLIT(v45, "Not visible in current scope: ", 30); - VAL v46 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v45), MKSTR(v4))); + VAL v41 = mtp_mirth_elab_RejectedDef_RDz_NOTz_VISIBLE(v15); + STR* v42; + STRLIT(v42, "Not visible in current scope: ", 30); + VAL v43 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v42), MKSTR(v4)); + VAL v44; + VAL v45; + mw_mirth_def_Def_qnameZ_hard(x1, v41, &v44, &v45); + VAL v46; VAL v47; - VAL v48; - mw_mirth_def_Def_qnameZ_hard(x1, v44, &v47, &v48); - VAL v49; - VAL v50; - mw_mirth_name_QName_ZToStr(v47, v48, &v49, &v50); - VAL v51 = (mw_std_str_ZPlusStr_pushZ_strZBang(v50, v46)); - x25 = v51; - x24 = x2; - x23 = v49; - x22 = v3; + mw_mirth_name_QName_ZToStr(v44, v45, &v46, &v47); + VAL v48 = mw_std_str_ZPlusStr_pushZ_strZBang(v47, v43); + x22 = v48; + x21 = x2; + x20 = v46; } break; case 3LL: { // RD_NOT_IMPORTED - VAL v52 = mtp_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(v16); - STR* v53; - STRLIT(v53, "Not imported in current scope: ", 31); - VAL v54 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v53), MKSTR(v4))); + VAL v49 = mtp_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(v15); + STR* v50; + STRLIT(v50, "Not imported in current scope: ", 31); + VAL v51 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v50), MKSTR(v4)); + VAL v52; + VAL v53; + mw_mirth_def_Def_qnameZ_hard(x1, v49, &v52, &v53); + VAL v54; VAL v55; - VAL v56; - mw_mirth_def_Def_qnameZ_hard(x1, v52, &v55, &v56); - VAL v57; - VAL v58; - mw_mirth_name_QName_ZToStr(v55, v56, &v57, &v58); - VAL v59 = (mw_std_str_ZPlusStr_pushZ_strZBang(v58, v54)); - x25 = v59; - x24 = x2; - x23 = v57; - x22 = v3; + mw_mirth_name_QName_ZToStr(v52, v53, &v54, &v55); + VAL v56 = mw_std_str_ZPlusStr_pushZ_strZBang(v55, v51); + x22 = v56; + x21 = x2; + x20 = v54; } break; case 1LL: { // RD_WRONG_ARITY - VAL v60 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v16); + VAL v57 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v15); + VAL v58; + VAL v59; + mw_mirth_def_Def_qnameZ_hard(x1, v57, &v58, &v59); + incref(v59); + VAL v60; VAL v61; - VAL v62; - mw_mirth_def_Def_qnameZ_hard(x1, v60, &v61, &v62); - incref(v62); - VAL v63; - VAL v64; - mw_mirth_name_QName_ZToStr(v61, v62, &v63, &v64); - VAL v65 = (mw_std_str_ZPlusStr_pushZ_strZBang(v64, MKSTR(v4))); - STR* v66; - STRLIT(v66, " expects ", 9); - VAL v67 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v66), v65)); - int64_t v68 = VI64(VTUP(v62)->cells[3]); - decref(v62); - STR* v69 = i64_show(v68); - VAL v70 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v69), v67)); - STR* v71; - STRLIT(v71, " arguments, but got ", 20); - VAL v72 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v71), v70)); - uint64_t v73 = VU64(VTUP(x2)->cells[2]); - int64_t v74 = mw_mirth_token_Token_numZ_args(v73); - STR* v75 = i64_show(v74); - VAL v76 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v75), v72)); - STR* v77; - STRLIT(v77, ".", 1); - VAL v78 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v77), v76)); - x25 = v78; - x24 = x2; - x23 = v63; - x22 = v3; + mw_mirth_name_QName_ZToStr(v58, v59, &v60, &v61); + VAL v62 = mw_std_str_ZPlusStr_pushZ_strZBang(v61, MKSTR(v4)); + STR* v63; + STRLIT(v63, " expects ", 9); + VAL v64 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v63), v62); + int64_t v65 = VI64(VTUP(v59)->cells[3]); + decref(v59); + STR* v66 = i64_show(v65); + VAL v67 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v66), v64); + STR* v68; + STRLIT(v68, " arguments, but got ", 20); + VAL v69 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v68), v67); + uint64_t v70 = VU64(VTUP(x2)->cells[2]); + int64_t v71 = mw_mirth_token_Token_numZ_args(v70); + STR* v72 = i64_show(v71); + VAL v73 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v72), v69); + STR* v74; + STRLIT(v74, ".", 1); + VAL v75 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v74), v73); + x22 = v75; + x21 = x2; + x20 = v60; } break; case 4LL: { // RD_WRONG_QUALIFIER - VAL v79 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_QUALIFIER(v16); - STR* v80; - STRLIT(v80, "Qualified name not found. Perhaps you meant: ", 45); - VAL v81 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v80), MKSTR(v4))); + VAL v76 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_QUALIFIER(v15); + STR* v77; + STRLIT(v77, "Qualified name not found. Perhaps you meant: ", 45); + VAL v78 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v77), MKSTR(v4)); + VAL v79; + VAL v80; + mw_mirth_def_Def_qnameZ_hard(x1, v76, &v79, &v80); + VAL v81; VAL v82; - VAL v83; - mw_mirth_def_Def_qnameZ_hard(x1, v79, &v82, &v83); - VAL v84; - VAL v85; - mw_mirth_name_QName_ZToStr(v82, v83, &v84, &v85); - VAL v86 = (mw_std_str_ZPlusStr_pushZ_strZBang(v85, v81)); - x25 = v86; - x24 = x2; - x23 = v84; - x22 = v3; + mw_mirth_name_QName_ZToStr(v79, v80, &v81, &v82); + VAL v83 = mw_std_str_ZPlusStr_pushZ_strZBang(v82, v78); + x22 = v83; + x21 = x2; + x20 = v81; } break; case 5LL: { // RD_WRONG_CONSTRUCTOR - VAL v87 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_CONSTRUCTOR(v16); - STR* v88; - STRLIT(v88, "Constructor is for a different type: ", 37); - VAL v89 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v88), MKSTR(v4))); + VAL v84 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_CONSTRUCTOR(v15); + STR* v85; + STRLIT(v85, "Constructor is for a different type: ", 37); + VAL v86 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v85), MKSTR(v4)); + VAL v87; + VAL v88; + mw_mirth_def_Def_qnameZ_hard(x1, v84, &v87, &v88); + VAL v89; VAL v90; - VAL v91; - mw_mirth_def_Def_qnameZ_hard(x1, v87, &v90, &v91); - VAL v92; - VAL v93; - mw_mirth_name_QName_ZToStr(v90, v91, &v92, &v93); - VAL v94 = (mw_std_str_ZPlusStr_pushZ_strZBang(v93, v89)); - x25 = v94; - x24 = x2; - x23 = v92; - x22 = v3; + mw_mirth_name_QName_ZToStr(v87, v88, &v89, &v90); + VAL v91 = mw_std_str_ZPlusStr_pushZ_strZBang(v90, v86); + x22 = v91; + x21 = x2; + x20 = v89; } break; case 7LL: { // RD_METHOD_WRONG_TYPE - VAL v95 = mtp_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(v16); - STR* v96; - STRLIT(v96, "Method is for a different type: ", 32); - VAL v97 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v96), MKSTR(v4))); + VAL v92 = mtp_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(v15); + STR* v93; + STRLIT(v93, "Method is for a different type: ", 32); + VAL v94 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v93), MKSTR(v4)); + VAL v95; + VAL v96; + mw_mirth_def_Def_qnameZ_hard(x1, v92, &v95, &v96); + VAL v97; VAL v98; - VAL v99; - mw_mirth_def_Def_qnameZ_hard(x1, v95, &v98, &v99); - VAL v100; - VAL v101; - mw_mirth_name_QName_ZToStr(v98, v99, &v100, &v101); - VAL v102 = (mw_std_str_ZPlusStr_pushZ_strZBang(v101, v97)); - x25 = v102; - x24 = x2; - x23 = v100; - x22 = v3; + mw_mirth_name_QName_ZToStr(v95, v96, &v97, &v98); + VAL v99 = mw_std_str_ZPlusStr_pushZ_strZBang(v98, v94); + x22 = v99; + x21 = x2; + x20 = v97; } break; case 6LL: { // RD_METHOD_NOT_AVAILABLE - VAL v103 = mtp_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(v16); - STR* v104; - STRLIT(v104, "Method is not available for current stack: ", 43); - VAL v105 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v104), MKSTR(v4))); + VAL v100 = mtp_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(v15); + STR* v101; + STRLIT(v101, "Method is not available for current stack: ", 43); + VAL v102 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v101), MKSTR(v4)); + VAL v103; + VAL v104; + mw_mirth_def_Def_qnameZ_hard(x1, v100, &v103, &v104); + VAL v105; VAL v106; - VAL v107; - mw_mirth_def_Def_qnameZ_hard(x1, v103, &v106, &v107); - VAL v108; - VAL v109; - mw_mirth_name_QName_ZToStr(v106, v107, &v108, &v109); - VAL v110 = (mw_std_str_ZPlusStr_pushZ_strZBang(v109, v105)); - x25 = v110; - x24 = x2; - x23 = v108; - x22 = v3; + mw_mirth_name_QName_ZToStr(v103, v104, &v105, &v106); + VAL v107 = mw_std_str_ZPlusStr_pushZ_strZBang(v106, v102); + x22 = v107; + x21 = x2; + x20 = v105; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x21 = x25; - x20 = x24; - x19 = x23; - x18 = x22; + x19 = x22; + x18 = x21; + x17 = x20; } break; default: { - VAL v111 = mtw_std_list_List_1_Cons(v16, v17); - STR* v112; - STRLIT(v112, "Multiple definitions for name, but none are suitable:", 53); - VAL v113 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v112), MKSTR(v4))); - STR* v114; - STRLIT(v114, " ", 1); - VAL v115; - VAL v116; - mw_std_list_List_1_uncons(v111, &v115, &v116); - VAL x117; - uint64_t x118; - VAL x119; - VAL x120; - VAL x121; - VAL x122; - int64_t x123; - switch (get_data_tag(v115)) { - case 1LL: { // Some - VAL v124 = mtp_std_maybe_Maybe_1_Some(v115); - VAL v125 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v114), v113)); - uint64_t x126; - VAL x127; - VAL x128; - VAL x129; - switch (get_data_tag(v124)) { - case 0LL: { // RD_WRONG_SORT - VAL v130 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v124); - VAL v131; - VAL v132; - mw_mirth_def_Def_qnameZ_hard(x1, v130, &v131, &v132); - VAL v133; - VAL v134; - mw_mirth_name_QName_ZToStr(v131, v132, &v133, &v134); - VAL v135 = (mw_std_str_ZPlusStr_pushZ_strZBang(v134, v125)); - STR* v136; - STRLIT(v136, " is not a ", 10); - VAL v137 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v136), v135)); - VAL v138 = VVAL(VTUP(x2)->cells[1]); - incref(v138); - VAL v139 = (mw_std_str_ZPlusStr_pushZ_strZBang(v138, v137)); - x129 = v139; - x128 = x2; - x127 = v133; - x126 = v3; - } break; - case 2LL: { // RD_NOT_VISIBLE - VAL v140 = mtp_mirth_elab_RejectedDef_RDz_NOTz_VISIBLE(v124); - VAL v141; - VAL v142; - mw_mirth_def_Def_qnameZ_hard(x1, v140, &v141, &v142); - VAL v143; - VAL v144; - mw_mirth_name_QName_ZToStr(v141, v142, &v143, &v144); - VAL v145 = (mw_std_str_ZPlusStr_pushZ_strZBang(v144, v125)); - STR* v146; - STRLIT(v146, " is not visible in current scope", 32); - VAL v147 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v146), v145)); - x129 = v147; - x128 = x2; - x127 = v143; - x126 = v3; - } break; - case 3LL: { // RD_NOT_IMPORTED - VAL v148 = mtp_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(v124); - VAL v149; - VAL v150; - mw_mirth_def_Def_qnameZ_hard(x1, v148, &v149, &v150); - VAL v151; - VAL v152; - mw_mirth_name_QName_ZToStr(v149, v150, &v151, &v152); - VAL v153 = (mw_std_str_ZPlusStr_pushZ_strZBang(v152, v125)); - STR* v154; - STRLIT(v154, " is not imported in current scope", 33); - VAL v155 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v154), v153)); - x129 = v155; - x128 = x2; - x127 = v151; - x126 = v3; - } break; - case 1LL: { // RD_WRONG_ARITY - VAL v156 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v124); - VAL v157; - VAL v158; - mw_mirth_def_Def_qnameZ_hard(x1, v156, &v157, &v158); - incref(v158); - VAL v159; - VAL v160; - mw_mirth_name_QName_ZToStr(v157, v158, &v159, &v160); - VAL v161 = (mw_std_str_ZPlusStr_pushZ_strZBang(v160, v125)); - STR* v162; - STRLIT(v162, " expects ", 9); - VAL v163 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v162), v161)); - int64_t v164 = VI64(VTUP(v158)->cells[3]); - decref(v158); - STR* v165 = i64_show(v164); - VAL v166 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v165), v163)); - STR* v167; - STRLIT(v167, " arguments", 10); - VAL v168 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v167), v166)); - x129 = v168; - x128 = x2; - x127 = v159; - x126 = v3; - } break; - case 4LL: { // RD_WRONG_QUALIFIER - VAL v169 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_QUALIFIER(v124); - VAL v170; - VAL v171; - mw_mirth_def_Def_qnameZ_hard(x1, v169, &v170, &v171); - VAL v172; - VAL v173; - mw_mirth_name_QName_ZToStr(v170, v171, &v172, &v173); - VAL v174 = (mw_std_str_ZPlusStr_pushZ_strZBang(v173, v125)); - STR* v175; - STRLIT(v175, " doesn't match the given qualified name", 39); - VAL v176 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v175), v174)); - x129 = v176; - x128 = x2; - x127 = v172; - x126 = v3; - } break; - case 5LL: { // RD_WRONG_CONSTRUCTOR - VAL v177 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_CONSTRUCTOR(v124); - VAL v178; - VAL v179; - mw_mirth_def_Def_qnameZ_hard(x1, v177, &v178, &v179); - VAL v180; - VAL v181; - mw_mirth_name_QName_ZToStr(v178, v179, &v180, &v181); - VAL v182 = (mw_std_str_ZPlusStr_pushZ_strZBang(v181, v125)); - STR* v183; - STRLIT(v183, " is constructor for a different type", 36); - VAL v184 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v183), v182)); - x129 = v184; - x128 = x2; - x127 = v180; - x126 = v3; - } break; - case 7LL: { // RD_METHOD_WRONG_TYPE - VAL v185 = mtp_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(v124); - VAL v186; - VAL v187; - mw_mirth_def_Def_qnameZ_hard(x1, v185, &v186, &v187); - VAL v188; - VAL v189; - mw_mirth_name_QName_ZToStr(v186, v187, &v188, &v189); - VAL v190 = (mw_std_str_ZPlusStr_pushZ_strZBang(v189, v125)); - STR* v191; - STRLIT(v191, " is method for a different type", 31); - VAL v192 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v191), v190)); - x129 = v192; - x128 = x2; - x127 = v188; - x126 = v3; - } break; - case 6LL: { // RD_METHOD_NOT_AVAILABLE - VAL v193 = mtp_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(v124); - VAL v194; - VAL v195; - mw_mirth_def_Def_qnameZ_hard(x1, v193, &v194, &v195); - VAL v196; - VAL v197; - mw_mirth_name_QName_ZToStr(v194, v195, &v196, &v197); - VAL v198 = (mw_std_str_ZPlusStr_pushZ_strZBang(v197, v125)); - STR* v199; - STRLIT(v199, " is not avaliable for current stack", 35); - VAL v200 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v199), v198)); - x129 = v200; - x128 = x2; - x127 = v196; - x126 = v3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - STR* v201; - STRLIT(v201, ", ", 2); - int64_t v202 = 1LL /* True */; - x123 = v202; - x122 = v116; - x121 = MKSTR(v201); - x120 = x129; - x119 = x128; - x118 = x126; - x117 = x127; - } break; - case 0LL: { // None - int64_t v203 = 0LL /* False */; - x123 = v203; - x122 = v116; - x121 = MKSTR(v114); - x120 = v113; - x119 = x2; - x118 = v3; - x117 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v204 = (x117); - uint64_t v205 = x118; - VAL v206 = (x119); - VAL v207 = (x120); - VAL v208 = x121; - VAL v209 = x122; - int64_t v210 = x123; - while (((bool)v210)) { - VAL v211 = (v204); - uint64_t v212 = v205; - VAL v213 = (v206); - VAL v214 = (v207); - VAL v215 = v208; - VAL v216 = v209; - VAL v217; - VAL v218; - mw_std_list_List_1_uncons(v216, &v217, &v218); - VAL x219; - uint64_t x220; - VAL x221; - VAL x222; - VAL x223; - VAL x224; - int64_t x225; - switch (get_data_tag(v217)) { - case 1LL: { // Some - VAL v226 = mtp_std_maybe_Maybe_1_Some(v217); - VAL v227 = (mw_std_str_ZPlusStr_pushZ_strZBang(v215, v214)); - uint64_t x228; - VAL x229; - VAL x230; - VAL x231; - switch (get_data_tag(v226)) { + VAL v108 = mtw_std_list_List_1_Cons(v15, v16); + STR* v109; + STRLIT(v109, "Multiple definitions for name, but none are suitable:", 53); + VAL v110 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v109), MKSTR(v4)); + STR* v111; + STRLIT(v111, " ", 1); + int64_t v112 = 1LL /* True */; + VAL v113 = x1; + VAL v114 = x2; + VAL v115 = v110; + STR* v116 = v111; + VAL v117 = v108; + int64_t v118 = v112; + int64_t v119 = v112; + while (((bool)v119)) { + VAL v120 = v113; + VAL v121 = v114; + VAL v122 = v115; + STR* v123 = v116; + VAL v124 = v117; + int64_t v125 = v118; + VAL x126; + VAL x127; + VAL x128; + VAL x129; + VAL x130; + int64_t x131; + switch (get_data_tag(v124)) { + case 1LL: { // Cons + VAL v132; + VAL v133; + mtp_std_list_List_1_Cons(v124, &v132, &v133); + VAL v134 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v123), v122); + VAL x135; + VAL x136; + VAL x137; + switch (get_data_tag(v132)) { case 0LL: { // RD_WRONG_SORT - VAL v232 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v226); - VAL v233; - VAL v234; - mw_mirth_def_Def_qnameZ_hard(v211, v232, &v233, &v234); - VAL v235; - VAL v236; - mw_mirth_name_QName_ZToStr(v233, v234, &v235, &v236); - VAL v237 = (mw_std_str_ZPlusStr_pushZ_strZBang(v236, v227)); - STR* v238; - STRLIT(v238, " is not a ", 10); - VAL v239 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v238), v237)); - VAL v240 = VVAL(VTUP(v213)->cells[1]); - incref(v240); - VAL v241 = (mw_std_str_ZPlusStr_pushZ_strZBang(v240, v239)); - x231 = v241; - x230 = v213; - x229 = v235; - x228 = v212; + VAL v138 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v132); + VAL v139; + VAL v140; + mw_mirth_def_Def_qnameZ_hard(v120, v138, &v139, &v140); + VAL v141; + VAL v142; + mw_mirth_name_QName_ZToStr(v139, v140, &v141, &v142); + VAL v143 = mw_std_str_ZPlusStr_pushZ_strZBang(v142, v134); + STR* v144; + STRLIT(v144, " is not a ", 10); + VAL v145 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v144), v143); + VAL v146 = VVAL(VTUP(v121)->cells[1]); + incref(v146); + VAL v147 = mw_std_str_ZPlusStr_pushZ_strZBang(v146, v145); + x137 = v147; + x136 = v121; + x135 = v141; } break; case 2LL: { // RD_NOT_VISIBLE - VAL v242 = mtp_mirth_elab_RejectedDef_RDz_NOTz_VISIBLE(v226); - VAL v243; - VAL v244; - mw_mirth_def_Def_qnameZ_hard(v211, v242, &v243, &v244); - VAL v245; - VAL v246; - mw_mirth_name_QName_ZToStr(v243, v244, &v245, &v246); - VAL v247 = (mw_std_str_ZPlusStr_pushZ_strZBang(v246, v227)); - STR* v248; - STRLIT(v248, " is not visible in current scope", 32); - VAL v249 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v248), v247)); - x231 = v249; - x230 = v213; - x229 = v245; - x228 = v212; + VAL v148 = mtp_mirth_elab_RejectedDef_RDz_NOTz_VISIBLE(v132); + VAL v149; + VAL v150; + mw_mirth_def_Def_qnameZ_hard(v120, v148, &v149, &v150); + VAL v151; + VAL v152; + mw_mirth_name_QName_ZToStr(v149, v150, &v151, &v152); + VAL v153 = mw_std_str_ZPlusStr_pushZ_strZBang(v152, v134); + STR* v154; + STRLIT(v154, " is not visible in current scope", 32); + VAL v155 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v154), v153); + x137 = v155; + x136 = v121; + x135 = v151; } break; case 3LL: { // RD_NOT_IMPORTED - VAL v250 = mtp_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(v226); - VAL v251; - VAL v252; - mw_mirth_def_Def_qnameZ_hard(v211, v250, &v251, &v252); - VAL v253; - VAL v254; - mw_mirth_name_QName_ZToStr(v251, v252, &v253, &v254); - VAL v255 = (mw_std_str_ZPlusStr_pushZ_strZBang(v254, v227)); - STR* v256; - STRLIT(v256, " is not imported in current scope", 33); - VAL v257 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v256), v255)); - x231 = v257; - x230 = v213; - x229 = v253; - x228 = v212; + VAL v156 = mtp_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(v132); + VAL v157; + VAL v158; + mw_mirth_def_Def_qnameZ_hard(v120, v156, &v157, &v158); + VAL v159; + VAL v160; + mw_mirth_name_QName_ZToStr(v157, v158, &v159, &v160); + VAL v161 = mw_std_str_ZPlusStr_pushZ_strZBang(v160, v134); + STR* v162; + STRLIT(v162, " is not imported in current scope", 33); + VAL v163 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v162), v161); + x137 = v163; + x136 = v121; + x135 = v159; } break; case 1LL: { // RD_WRONG_ARITY - VAL v258 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v226); - VAL v259; - VAL v260; - mw_mirth_def_Def_qnameZ_hard(v211, v258, &v259, &v260); - incref(v260); - VAL v261; - VAL v262; - mw_mirth_name_QName_ZToStr(v259, v260, &v261, &v262); - VAL v263 = (mw_std_str_ZPlusStr_pushZ_strZBang(v262, v227)); - STR* v264; - STRLIT(v264, " expects ", 9); - VAL v265 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v264), v263)); - int64_t v266 = VI64(VTUP(v260)->cells[3]); - decref(v260); - STR* v267 = i64_show(v266); - VAL v268 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v267), v265)); - STR* v269; - STRLIT(v269, " arguments", 10); - VAL v270 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v269), v268)); - x231 = v270; - x230 = v213; - x229 = v261; - x228 = v212; + VAL v164 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v132); + VAL v165; + VAL v166; + mw_mirth_def_Def_qnameZ_hard(v120, v164, &v165, &v166); + incref(v166); + VAL v167; + VAL v168; + mw_mirth_name_QName_ZToStr(v165, v166, &v167, &v168); + VAL v169 = mw_std_str_ZPlusStr_pushZ_strZBang(v168, v134); + STR* v170; + STRLIT(v170, " expects ", 9); + VAL v171 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v170), v169); + int64_t v172 = VI64(VTUP(v166)->cells[3]); + decref(v166); + STR* v173 = i64_show(v172); + VAL v174 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v173), v171); + STR* v175; + STRLIT(v175, " arguments", 10); + VAL v176 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v175), v174); + x137 = v176; + x136 = v121; + x135 = v167; } break; case 4LL: { // RD_WRONG_QUALIFIER - VAL v271 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_QUALIFIER(v226); - VAL v272; - VAL v273; - mw_mirth_def_Def_qnameZ_hard(v211, v271, &v272, &v273); - VAL v274; - VAL v275; - mw_mirth_name_QName_ZToStr(v272, v273, &v274, &v275); - VAL v276 = (mw_std_str_ZPlusStr_pushZ_strZBang(v275, v227)); - STR* v277; - STRLIT(v277, " doesn't match the given qualified name", 39); - VAL v278 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v277), v276)); - x231 = v278; - x230 = v213; - x229 = v274; - x228 = v212; + VAL v177 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_QUALIFIER(v132); + VAL v178; + VAL v179; + mw_mirth_def_Def_qnameZ_hard(v120, v177, &v178, &v179); + VAL v180; + VAL v181; + mw_mirth_name_QName_ZToStr(v178, v179, &v180, &v181); + VAL v182 = mw_std_str_ZPlusStr_pushZ_strZBang(v181, v134); + STR* v183; + STRLIT(v183, " doesn't match the given qualified name", 39); + VAL v184 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v183), v182); + x137 = v184; + x136 = v121; + x135 = v180; } break; case 5LL: { // RD_WRONG_CONSTRUCTOR - VAL v279 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_CONSTRUCTOR(v226); - VAL v280; - VAL v281; - mw_mirth_def_Def_qnameZ_hard(v211, v279, &v280, &v281); - VAL v282; - VAL v283; - mw_mirth_name_QName_ZToStr(v280, v281, &v282, &v283); - VAL v284 = (mw_std_str_ZPlusStr_pushZ_strZBang(v283, v227)); - STR* v285; - STRLIT(v285, " is constructor for a different type", 36); - VAL v286 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v285), v284)); - x231 = v286; - x230 = v213; - x229 = v282; - x228 = v212; + VAL v185 = mtp_mirth_elab_RejectedDef_RDz_WRONGz_CONSTRUCTOR(v132); + VAL v186; + VAL v187; + mw_mirth_def_Def_qnameZ_hard(v120, v185, &v186, &v187); + VAL v188; + VAL v189; + mw_mirth_name_QName_ZToStr(v186, v187, &v188, &v189); + VAL v190 = mw_std_str_ZPlusStr_pushZ_strZBang(v189, v134); + STR* v191; + STRLIT(v191, " is constructor for a different type", 36); + VAL v192 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v191), v190); + x137 = v192; + x136 = v121; + x135 = v188; } break; case 7LL: { // RD_METHOD_WRONG_TYPE - VAL v287 = mtp_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(v226); - VAL v288; - VAL v289; - mw_mirth_def_Def_qnameZ_hard(v211, v287, &v288, &v289); - VAL v290; - VAL v291; - mw_mirth_name_QName_ZToStr(v288, v289, &v290, &v291); - VAL v292 = (mw_std_str_ZPlusStr_pushZ_strZBang(v291, v227)); - STR* v293; - STRLIT(v293, " is method for a different type", 31); - VAL v294 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v293), v292)); - x231 = v294; - x230 = v213; - x229 = v290; - x228 = v212; + VAL v193 = mtp_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(v132); + VAL v194; + VAL v195; + mw_mirth_def_Def_qnameZ_hard(v120, v193, &v194, &v195); + VAL v196; + VAL v197; + mw_mirth_name_QName_ZToStr(v194, v195, &v196, &v197); + VAL v198 = mw_std_str_ZPlusStr_pushZ_strZBang(v197, v134); + STR* v199; + STRLIT(v199, " is method for a different type", 31); + VAL v200 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v199), v198); + x137 = v200; + x136 = v121; + x135 = v196; } break; case 6LL: { // RD_METHOD_NOT_AVAILABLE - VAL v295 = mtp_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(v226); - VAL v296; - VAL v297; - mw_mirth_def_Def_qnameZ_hard(v211, v295, &v296, &v297); - VAL v298; - VAL v299; - mw_mirth_name_QName_ZToStr(v296, v297, &v298, &v299); - VAL v300 = (mw_std_str_ZPlusStr_pushZ_strZBang(v299, v227)); - STR* v301; - STRLIT(v301, " is not avaliable for current stack", 35); - VAL v302 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v301), v300)); - x231 = v302; - x230 = v213; - x229 = v298; - x228 = v212; + VAL v201 = mtp_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(v132); + VAL v202; + VAL v203; + mw_mirth_def_Def_qnameZ_hard(v120, v201, &v202, &v203); + VAL v204; + VAL v205; + mw_mirth_name_QName_ZToStr(v202, v203, &v204, &v205); + VAL v206 = mw_std_str_ZPlusStr_pushZ_strZBang(v205, v134); + STR* v207; + STRLIT(v207, " is not avaliable for current stack", 35); + VAL v208 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v207), v206); + x137 = v208; + x136 = v121; + x135 = v204; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - STR* v303; - STRLIT(v303, ", ", 2); - int64_t v304 = 1LL /* True */; - x225 = v304; - x224 = v218; - x223 = MKSTR(v303); - x222 = x231; - x221 = x230; - x220 = x228; - x219 = x229; + STR* v209; + STRLIT(v209, ", ", 2); + int64_t v210 = 1LL /* True */; + x131 = v210; + x130 = v133; + x129 = MKSTR(v209); + x128 = x137; + x127 = x136; + x126 = x135; } break; - case 0LL: { // None - int64_t v305 = 0LL /* False */; - x225 = v305; - x224 = v218; - x223 = v215; - x222 = v214; - x221 = v213; - x220 = v212; - x219 = v211; + case 0LL: { // Nil + VAL v211 = MKI64(0LL /* Nil */); + int64_t v212 = 0LL /* False */; + x131 = v212; + x130 = v211; + x129 = MKSTR(v123); + x128 = v122; + x127 = v121; + x126 = v120; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v210 = x225; - v209 = x224; - v208 = x223; - v207 = x222; - v206 = x221; - v205 = x220; - v204 = x219; + v119 = x131; + v118 = x131; + v117 = x130; + v116 = VSTR(x129); + v115 = x128; + v114 = x127; + v113 = x126; } - decref(v209); - decref(v208); - x21 = v207; - x20 = v206; - x19 = v204; - x18 = v205; + decref(v117); + decref(MKSTR(v116)); + x19 = v115; + x18 = v114; + x17 = v113; } break; } - x9 = x21; - x8 = x20; + x8 = x19; x7 = x18; - x6 = x19; + x6 = x17; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v306 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x7, x9, x6)); - mw_mirth_elab_ZPlusResolveDef_rdrop(x8); - return v306; + VAL v213 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v3, x8, x6); + mw_mirth_elab_ZPlusResolveDef_rdrop(x7); + return v213; } static void mw_mirth_elab_ZPlusResolveDef_filterZ_arity (VAL x1, VAL x2, VAL *x3, VAL *x4) { uint64_t v5 = VU64(VTUP(x2)->cells[2]); @@ -43428,212 +34674,119 @@ static void mw_mirth_elab_ZPlusResolveDef_filterZ_arity (VAL x1, VAL x2, VAL *x3 incref(v7); VAL v8 = MKI64(0LL /* Nil */); VAL v9 = MKI64(0LL /* Nil */); - VAL v10; - VAL v11; - mw_std_list_List_1_uncons(v7, &v10, &v11); - VAL x12; - int64_t x13; - VAL x14; - VAL x15; - VAL x16; - VAL x17; - int64_t x18; - switch (get_data_tag(v10)) { - case 1LL: { // Some - VAL v19 = mtp_std_maybe_Maybe_1_Some(v10); - incref(v19); - int64_t v20 = mw_mirth_def_Def_arity(v19); - int64_t v21 = mw_mirth_elab_arityZ_compatibleZAsk(v6, v20); - VAL x22; - int64_t x23; - VAL x24; - VAL x25; - if (((bool)v21)) { - VAL v26 = mtw_std_either_Either_2_Right(v19); - x25 = v26; - x24 = x2; - x23 = v6; - x22 = x1; - } else { - VAL v27 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v19); - VAL v28 = mtw_std_either_Either_2_Left(v27); - x25 = v28; - x24 = x2; - x23 = v6; - x22 = x1; - } - VAL x29; - int64_t x30; - VAL x31; - VAL x32; - VAL x33; - switch (get_data_tag(x25)) { - case 0LL: { // Left - VAL v34 = mtp_std_either_Either_2_Left(x25); - VAL v35 = mtw_std_list_List_1_Cons(v34, v8); - x33 = v9; - x32 = v35; - x31 = x24; - x30 = x23; - x29 = x22; - } break; - case 1LL: { // Right - VAL v36 = mtp_std_either_Either_2_Right(x25); - VAL v37 = mtw_std_list_List_1_Cons(v36, v9); - x33 = v37; - x32 = v8; - x31 = x24; - x30 = x23; - x29 = x22; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v38 = 1LL /* True */; - x18 = v38; - x17 = v11; - x16 = x33; - x15 = x32; - x14 = x31; - x13 = x30; - x12 = x29; - } break; - case 0LL: { // None - int64_t v39 = 0LL /* False */; - x18 = v39; - x17 = v11; - x16 = v9; - x15 = v8; - x14 = x2; - x13 = v6; - x12 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v40 = (x12); - int64_t v41 = x13; - VAL v42 = (x14); - VAL v43 = x15; - VAL v44 = x16; - VAL v45 = x17; - int64_t v46 = x18; - while (((bool)v46)) { - VAL v47 = (v40); - int64_t v48 = v41; - VAL v49 = (v42); - VAL v50 = v43; - VAL v51 = v44; - VAL v52 = v45; - VAL v53; - VAL v54; - mw_std_list_List_1_uncons(v52, &v53, &v54); - VAL x55; - int64_t x56; - VAL x57; - VAL x58; - VAL x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v53)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v53); - incref(v62); - int64_t v63 = mw_mirth_def_Def_arity(v62); - int64_t v64 = mw_mirth_elab_arityZ_compatibleZAsk(v48, v63); - VAL x65; - int64_t x66; - VAL x67; - VAL x68; - if (((bool)v64)) { - VAL v69 = mtw_std_either_Either_2_Right(v62); - x68 = v69; - x67 = v49; - x66 = v48; - x65 = v47; + int64_t v10 = 1LL /* True */; + VAL v11 = x2; + int64_t v12 = v6; + VAL v13 = v8; + VAL v14 = v9; + VAL v15 = v7; + int64_t v16 = v10; + int64_t v17 = v10; + while (((bool)v17)) { + VAL v18 = v11; + int64_t v19 = v12; + VAL v20 = v13; + VAL v21 = v14; + VAL v22 = v15; + int64_t v23 = v16; + int64_t x24; + VAL x25; + VAL x26; + VAL x27; + VAL x28; + int64_t x29; + switch (get_data_tag(v22)) { + case 1LL: { // Cons + VAL v30; + VAL v31; + mtp_std_list_List_1_Cons(v22, &v30, &v31); + incref(v30); + int64_t v32 = mw_mirth_def_Def_arity(v30); + int64_t v33 = mw_mirth_elab_arityZ_compatibleZAsk(v19, v32); + int64_t x34; + VAL x35; + VAL x36; + if (((bool)v33)) { + VAL v37 = mtw_std_either_Either_2_Right(v30); + x36 = v37; + x35 = v18; + x34 = v19; } else { - VAL v70 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v62); - VAL v71 = mtw_std_either_Either_2_Left(v70); - x68 = v71; - x67 = v49; - x66 = v48; - x65 = v47; + VAL v38 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v30); + VAL v39 = mtw_std_either_Either_2_Left(v38); + x36 = v39; + x35 = v18; + x34 = v19; } - VAL x72; - int64_t x73; - VAL x74; - VAL x75; - VAL x76; - switch (get_data_tag(x68)) { + int64_t x40; + VAL x41; + VAL x42; + VAL x43; + switch (get_data_tag(x36)) { case 0LL: { // Left - VAL v77 = mtp_std_either_Either_2_Left(x68); - VAL v78 = mtw_std_list_List_1_Cons(v77, v50); - x76 = v51; - x75 = v78; - x74 = x67; - x73 = x66; - x72 = x65; + VAL v44 = mtp_std_either_Either_2_Left(x36); + VAL v45 = mtw_std_list_List_1_Cons(v44, v20); + x43 = v21; + x42 = v45; + x41 = x35; + x40 = x34; } break; case 1LL: { // Right - VAL v79 = mtp_std_either_Either_2_Right(x68); - VAL v80 = mtw_std_list_List_1_Cons(v79, v51); - x76 = v80; - x75 = v50; - x74 = x67; - x73 = x66; - x72 = x65; + VAL v46 = mtp_std_either_Either_2_Right(x36); + VAL v47 = mtw_std_list_List_1_Cons(v46, v21); + x43 = v47; + x42 = v20; + x41 = x35; + x40 = x34; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v81 = 1LL /* True */; - x61 = v81; - x60 = v54; - x59 = x76; - x58 = x75; - x57 = x74; - x56 = x73; - x55 = x72; + int64_t v48 = 1LL /* True */; + x29 = v48; + x28 = v31; + x27 = x43; + x26 = x42; + x25 = x41; + x24 = x40; } break; - case 0LL: { // None - int64_t v82 = 0LL /* False */; - x61 = v82; - x60 = v54; - x59 = v51; - x58 = v50; - x57 = v49; - x56 = v48; - x55 = v47; + case 0LL: { // Nil + VAL v49 = MKI64(0LL /* Nil */); + int64_t v50 = 0LL /* False */; + x29 = v50; + x28 = v49; + x27 = v21; + x26 = v20; + x25 = v18; + x24 = v19; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v46 = x61; - v45 = x60; - v44 = x59; - v43 = x58; - v42 = x57; - v41 = x56; - v40 = x55; - } - decref(v45); - VAL v83 = mw_std_list_List_1_reverse(v43); - VAL v84 = mw_std_list_List_1_reverse(v44); - VAL v85 = VVAL(VTUP(v42)->cells[5]); - incref(v85); - VAL v86 = mw_std_list_List_1_cat(v83, v85); - VAL v87 = VTUP(v42)->cells[5]; - decref(v87); - VTUP(v42)->cells[5] = v86; - VAL v88 = VTUP(v42)->cells[4]; - decref(v88); - VTUP(v42)->cells[4] = v84; - *x4 = v42; - *x3 = v40; + v17 = x29; + v16 = x29; + v15 = x28; + v14 = x27; + v13 = x26; + v12 = x24; + v11 = x25; + } + decref(v15); + VAL v51 = mw_std_list_List_1_reverse(v13); + VAL v52 = mw_std_list_List_1_reverse(v14); + VAL v53 = VVAL(VTUP(v11)->cells[5]); + incref(v53); + VAL v54 = mw_std_list_List_1_cat(v51, v53); + VAL v55 = VTUP(v11)->cells[5]; + decref(v55); + VTUP(v11)->cells[5] = v54; + VAL v56 = VTUP(v11)->cells[4]; + decref(v56); + VTUP(v11)->cells[4] = v52; + *x4 = v11; + *x3 = x1; } static void mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers (VAL x1, VAL x2, VAL *x3, VAL *x4) { uint64_t v5 = VU64(VTUP(x2)->cells[2]); @@ -43647,229 +34800,140 @@ static void mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers (VAL x1, VAL x2, VA incref(v10); VAL v11 = MKI64(0LL /* Nil */); VAL v12 = MKI64(0LL /* Nil */); - VAL v13; - VAL v14; - mw_std_list_List_1_uncons(v10, &v13, &v14); - VAL x15; - VAL x16; - VAL x17; - VAL x18; - VAL x19; - VAL x20; - int64_t x21; - switch (get_data_tag(v13)) { - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v13); - incref(v9); - incref(v22); - VAL v23; - VAL v24; - mw_mirth_def_Def_qnameZ_hard(x1, v22, &v23, &v24); - VAL v25; - VAL v26; - VAL v27; - mw_mirth_name_QName_climbZ_upZ_dnameZAsk(v23, x2, v9, v24, &v25, &v26, &v27); - int64_t v28 = mw_std_list_List_1_emptyZAsk(v27); - bool v29 = !((bool)v28); - VAL x30; - VAL x31; - VAL x32; - VAL x33; - if (v29) { - VAL v34 = mtw_std_either_Either_2_Right(v22); - x33 = v34; - x32 = v26; - x31 = v9; - x30 = v25; - } else { - VAL v35 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_QUALIFIER(v22); - VAL v36 = mtw_std_either_Either_2_Left(v35); - x33 = v36; - x32 = v26; - x31 = v9; - x30 = v25; - } - VAL x37; - VAL x38; - VAL x39; - VAL x40; - VAL x41; - switch (get_data_tag(x33)) { - case 0LL: { // Left - VAL v42 = mtp_std_either_Either_2_Left(x33); - VAL v43 = mtw_std_list_List_1_Cons(v42, v11); - x41 = v12; - x40 = v43; - x39 = x32; - x38 = x31; - x37 = x30; - } break; - case 1LL: { // Right - VAL v44 = mtp_std_either_Either_2_Right(x33); - VAL v45 = mtw_std_list_List_1_Cons(v44, v12); - x41 = v45; - x40 = v11; - x39 = x32; - x38 = x31; - x37 = x30; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v46 = 1LL /* True */; - x21 = v46; - x20 = v14; - x19 = x41; - x18 = x40; - x17 = x39; - x16 = x38; - x15 = x37; - } break; - case 0LL: { // None - int64_t v47 = 0LL /* False */; - x21 = v47; - x20 = v14; - x19 = v12; - x18 = v11; - x17 = x2; - x16 = v9; - x15 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v48 = (x15); - VAL v49 = x16; - VAL v50 = (x17); - VAL v51 = x18; - VAL v52 = x19; - VAL v53 = x20; - int64_t v54 = x21; - while (((bool)v54)) { - VAL v55 = (v48); - VAL v56 = v49; - VAL v57 = (v50); - VAL v58 = v51; - VAL v59 = v52; - VAL v60 = v53; - VAL v61; - VAL v62; - mw_std_list_List_1_uncons(v60, &v61, &v62); - VAL x63; - VAL x64; - VAL x65; - VAL x66; - VAL x67; - VAL x68; - int64_t x69; - switch (get_data_tag(v61)) { - case 1LL: { // Some - VAL v70 = mtp_std_maybe_Maybe_1_Some(v61); - incref(v56); - incref(v70); - VAL v71; - VAL v72; - mw_mirth_def_Def_qnameZ_hard(v55, v70, &v71, &v72); - VAL v73; - VAL v74; - VAL v75; - mw_mirth_name_QName_climbZ_upZ_dnameZAsk(v71, v57, v56, v72, &v73, &v74, &v75); - int64_t v76 = mw_std_list_List_1_emptyZAsk(v75); - bool v77 = !((bool)v76); - VAL x78; - VAL x79; - VAL x80; - VAL x81; - if (v77) { - VAL v82 = mtw_std_either_Either_2_Right(v70); - x81 = v82; - x80 = v74; - x79 = v56; - x78 = v73; + int64_t v13 = 1LL /* True */; + VAL v14 = x1; + VAL v15 = x2; + VAL v16 = v9; + VAL v17 = v11; + VAL v18 = v12; + VAL v19 = v10; + int64_t v20 = v13; + int64_t v21 = v13; + while (((bool)v21)) { + VAL v22 = v14; + VAL v23 = v15; + VAL v24 = v16; + VAL v25 = v17; + VAL v26 = v18; + VAL v27 = v19; + int64_t v28 = v20; + VAL x29; + VAL x30; + VAL x31; + VAL x32; + VAL x33; + VAL x34; + int64_t x35; + switch (get_data_tag(v27)) { + case 1LL: { // Cons + VAL v36; + VAL v37; + mtp_std_list_List_1_Cons(v27, &v36, &v37); + incref(v24); + incref(v36); + VAL v38; + VAL v39; + mw_mirth_def_Def_qnameZ_hard(v22, v36, &v38, &v39); + VAL v40; + VAL v41; + VAL v42; + mw_mirth_name_QName_climbZ_upZ_dnameZAsk(v38, v23, v24, v39, &v40, &v41, &v42); + int64_t v43 = mw_std_list_List_1_emptyZAsk(v42); + bool v44 = !((bool)v43); + VAL x45; + VAL x46; + VAL x47; + VAL x48; + if (v44) { + VAL v49 = mtw_std_either_Either_2_Right(v36); + x48 = v49; + x47 = v41; + x46 = v40; + x45 = v24; } else { - VAL v83 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_QUALIFIER(v70); - VAL v84 = mtw_std_either_Either_2_Left(v83); - x81 = v84; - x80 = v74; - x79 = v56; - x78 = v73; + VAL v50 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_QUALIFIER(v36); + VAL v51 = mtw_std_either_Either_2_Left(v50); + x48 = v51; + x47 = v41; + x46 = v40; + x45 = v24; } - VAL x85; - VAL x86; - VAL x87; - VAL x88; - VAL x89; - switch (get_data_tag(x81)) { + VAL x52; + VAL x53; + VAL x54; + VAL x55; + VAL x56; + switch (get_data_tag(x48)) { case 0LL: { // Left - VAL v90 = mtp_std_either_Either_2_Left(x81); - VAL v91 = mtw_std_list_List_1_Cons(v90, v58); - x89 = v59; - x88 = v91; - x87 = x80; - x86 = x79; - x85 = x78; + VAL v57 = mtp_std_either_Either_2_Left(x48); + VAL v58 = mtw_std_list_List_1_Cons(v57, v25); + x56 = v26; + x55 = v58; + x54 = x47; + x53 = x46; + x52 = x45; } break; case 1LL: { // Right - VAL v92 = mtp_std_either_Either_2_Right(x81); - VAL v93 = mtw_std_list_List_1_Cons(v92, v59); - x89 = v93; - x88 = v58; - x87 = x80; - x86 = x79; - x85 = x78; + VAL v59 = mtp_std_either_Either_2_Right(x48); + VAL v60 = mtw_std_list_List_1_Cons(v59, v26); + x56 = v60; + x55 = v25; + x54 = x47; + x53 = x46; + x52 = x45; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v94 = 1LL /* True */; - x69 = v94; - x68 = v62; - x67 = x89; - x66 = x88; - x65 = x87; - x64 = x86; - x63 = x85; + int64_t v61 = 1LL /* True */; + x35 = v61; + x34 = v37; + x33 = x56; + x32 = x55; + x31 = x54; + x30 = x53; + x29 = x52; } break; - case 0LL: { // None - int64_t v95 = 0LL /* False */; - x69 = v95; - x68 = v62; - x67 = v59; - x66 = v58; - x65 = v57; - x64 = v56; - x63 = v55; + case 0LL: { // Nil + VAL v62 = MKI64(0LL /* Nil */); + int64_t v63 = 0LL /* False */; + x35 = v63; + x34 = v62; + x33 = v26; + x32 = v25; + x31 = v23; + x30 = v22; + x29 = v24; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v54 = x69; - v53 = x68; - v52 = x67; - v51 = x66; - v50 = x65; - v49 = x64; - v48 = x63; + v21 = x35; + v20 = x35; + v19 = x34; + v18 = x33; + v17 = x32; + v16 = x29; + v15 = x31; + v14 = x30; } - decref(v53); - VAL v96 = mw_std_list_List_1_reverse(v51); - VAL v97 = mw_std_list_List_1_reverse(v52); - VAL v98 = VVAL(VTUP(v50)->cells[5]); - incref(v98); - VAL v99 = mw_std_list_List_1_cat(v96, v98); - VAL v100 = VTUP(v50)->cells[5]; - decref(v100); - VTUP(v50)->cells[5] = v99; - VAL v101 = VTUP(v50)->cells[4]; - decref(v101); - VTUP(v50)->cells[4] = v97; - decref(v49); - x8 = v50; - x7 = v48; + decref(v19); + VAL v64 = mw_std_list_List_1_reverse(v17); + VAL v65 = mw_std_list_List_1_reverse(v18); + VAL v66 = VVAL(VTUP(v15)->cells[5]); + incref(v66); + VAL v67 = mw_std_list_List_1_cat(v64, v66); + VAL v68 = VTUP(v15)->cells[5]; + decref(v68); + VTUP(v15)->cells[5] = v67; + VAL v69 = VTUP(v15)->cells[4]; + decref(v69); + VTUP(v15)->cells[4] = v65; + decref(v16); + x8 = v15; + x7 = v14; } break; case 0LL: { // None x8 = x2; @@ -43895,3349 +34959,785 @@ static void mw_mirth_elab_ZPlusResolveDef_filterZ_roots (VAL x1, VAL x2, VAL x3, incref(v11); VAL v12 = MKI64(0LL /* Nil */); VAL v13 = MKI64(0LL /* Nil */); - VAL v14; - VAL v15; - mw_std_list_List_1_uncons(v11, &v14, &v15); - VAL x16; - VAL x17; - uint64_t x18; - VAL x19; - VAL x20; - VAL x21; - VAL x22; - int64_t x23; - switch (get_data_tag(v14)) { - case 1LL: { // Some - VAL v24 = mtp_std_maybe_Maybe_1_Some(v14); - incref(x1); - incref(v24); - VAL v25; - VAL v26; - mw_mirth_def_Def_qnameZ_hard(x2, v24, &v25, &v26); - VAL v27 = VVAL(VTUP(v26)->cells[1]); - incref(v27); - decref(v26); - VAL v28 = MKI64(0LL /* None */); - VAL v29; - VAL v30; - mw_std_list_List_1_uncons(x1, &v29, &v30); - uint64_t x31; - VAL x32; - VAL x33; - VAL x34; - VAL x35; - VAL x36; - VAL x37; - VAL x38; - int64_t x39; - switch (get_data_tag(v29)) { - case 1LL: { // Some - VAL v40 = mtp_std_maybe_Maybe_1_Some(v29); + int64_t v14 = 1LL /* True */; + VAL v15 = v10; + VAL v16 = x2; + VAL v17 = x3; + VAL v18 = x1; + VAL v19 = v12; + VAL v20 = v13; + VAL v21 = v11; + int64_t v22 = v14; + int64_t v23 = v14; + while (((bool)v23)) { + VAL v24 = v15; + VAL v25 = v16; + VAL v26 = v17; + VAL v27 = v18; + VAL v28 = v19; + VAL v29 = v20; + VAL v30 = v21; + int64_t v31 = v22; + uint64_t x32; + VAL x33; + VAL x34; + VAL x35; + VAL x36; + VAL x37; + VAL x38; + int64_t x39; + switch (get_data_tag(v30)) { + case 1LL: { // Cons + VAL v40; + VAL v41; + mtp_std_list_List_1_Cons(v30, &v40, &v41); + incref(v27); + incref(v40); + VAL v42; + VAL v43; + mw_mirth_def_Def_qnameZ_hard(v25, v40, &v42, &v43); + VAL v44 = VVAL(VTUP(v43)->cells[1]); + incref(v44); + decref(v43); + int64_t v45 = mw_std_list_List_1_member_1_sp4(v44, v27); + VAL x46; + VAL x47; + VAL x48; + int64_t x49; + if (((bool)v45)) { + int64_t v50 = 1LL /* True */; + x49 = v50; + x48 = v26; + x47 = v40; + x46 = v42; + } else { + uint64_t v51 = VU64(VTUP(v26)->cells[2]); incref(v40); - incref(v27); - int64_t v41 = mw_mirth_name_Namespace_ZEqualZEqual(v27, v40); - uint64_t x42; - VAL x43; - VAL x44; - VAL x45; - VAL x46; - VAL x47; - VAL x48; - if (((bool)v41)) { - VAL v49 = mtw_std_maybe_Maybe_1_Some(v40); - x48 = v49; - x47 = v27; - x46 = x3; - x45 = v25; - x44 = v24; - x43 = x1; - x42 = VU64(v10); - } else { - decref(v40); - VAL v50 = MKI64(0LL /* None */); - x48 = v50; - x47 = v27; - x46 = x3; - x45 = v25; - x44 = v24; - x43 = x1; - x42 = VU64(v10); - } - uint64_t x51; - VAL x52; - VAL x53; - VAL x54; - VAL x55; - VAL x56; - VAL x57; - VAL x58; - switch (get_data_tag(x48)) { - case 0LL: { // None - x58 = v30; - x57 = v28; - x56 = x47; - x55 = x46; - x54 = x45; - x53 = x44; - x52 = x43; - x51 = x42; + VAL v52; + int64_t v53; + mw_mirth_elab_defZ_isZ_importedZ_atZ_tokenZAsk(v42, v51, v40, &v52, &v53); + x49 = v53; + x48 = v26; + x47 = v40; + x46 = v52; + } + uint64_t x54; + VAL x55; + VAL x56; + VAL x57; + VAL x58; + if (((bool)x49)) { + VAL v59 = mtw_std_either_Either_2_Right(x47); + x58 = v59; + x57 = x48; + x56 = x46; + x55 = v27; + x54 = VU64(v24); + } else { + incref(x47); + VAL v60; + VAL v61; + mw_mirth_def_Def_qnameZ_hard(x46, x47, &v60, &v61); + VAL v62 = VVAL(VTUP(v61)->cells[1]); + incref(v62); + decref(v61); + VAL x63; + VAL x64; + uint64_t x65; + VAL x66; + VAL x67; + switch (get_data_tag(v62)) { + case 3LL: { // NAMESPACE_TYCON + VAL v68 = mtp_mirth_name_Namespace_NAMESPACEz_TYCON(v62); + decref(v68); + incref(v24); + int64_t v69 = mw_mirth_name_Name_canZ_beZ_relativeZAsk(VU64(v24)); + VAL x70; + VAL x71; + uint64_t x72; + VAL x73; + VAL x74; + if (((bool)v69)) { + incref(v27); + int64_t v75 = mw_std_list_List_1_emptyZAsk(v27); + VAL x76; + VAL x77; + uint64_t x78; + VAL x79; + VAL x80; + if (((bool)v75)) { + VAL v81 = mtw_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(x47); + x80 = v81; + x79 = v27; + x78 = VU64(v24); + x77 = x48; + x76 = v60; + } else { + VAL v82 = mtw_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(x47); + x80 = v82; + x79 = v27; + x78 = VU64(v24); + x77 = x48; + x76 = v60; + } + x74 = x80; + x73 = x79; + x72 = x78; + x71 = x77; + x70 = x76; + } else { + VAL v83 = mtw_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(x47); + x74 = v83; + x73 = v27; + x72 = VU64(v24); + x71 = x48; + x70 = v60; + } + x67 = x74; + x66 = x73; + x65 = x72; + x64 = x71; + x63 = x70; } break; default: { - decref(v30); - decref(v28); - VAL v59 = MKI64(0LL /* Nil */); - x58 = v59; - x57 = x48; - x56 = x47; - x55 = x46; - x54 = x45; - x53 = x44; - x52 = x43; - x51 = x42; + decref(v62); + VAL v84 = mtw_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(x47); + x67 = v84; + x66 = v27; + x65 = VU64(v24); + x64 = x48; + x63 = v60; } break; } - int64_t v60 = 1LL /* True */; - x39 = v60; - x38 = x58; - x37 = x57; - x36 = x56; - x35 = x55; - x34 = x54; - x33 = x53; - x32 = x52; - x31 = x51; - } break; - case 0LL: { // None - int64_t v61 = 0LL /* False */; - x39 = v61; - x38 = v30; - x37 = v28; - x36 = v27; - x35 = x3; - x34 = v25; - x33 = v24; - x32 = x1; - x31 = VU64(v10); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + VAL v85 = mtw_std_either_Either_2_Left(x67); + x58 = v85; + x57 = x64; + x56 = x63; + x55 = x66; + x54 = x65; } - } - uint64_t v62 = x31; - VAL v63 = x32; - VAL v64 = x33; - VAL v65 = (x34); - VAL v66 = (x35); - VAL v67 = x36; - VAL v68 = x37; - VAL v69 = x38; - int64_t v70 = x39; - while (((bool)v70)) { - uint64_t v71 = v62; - VAL v72 = v63; - VAL v73 = v64; - VAL v74 = (v65); - VAL v75 = (v66); - VAL v76 = v67; - VAL v77 = v68; - VAL v78 = v69; - VAL v79; - VAL v80; - mw_std_list_List_1_uncons(v78, &v79, &v80); - uint64_t x81; - VAL x82; - VAL x83; - VAL x84; - VAL x85; - VAL x86; + uint64_t x86; VAL x87; VAL x88; - int64_t x89; - switch (get_data_tag(v79)) { - case 1LL: { // Some - VAL v90 = mtp_std_maybe_Maybe_1_Some(v79); - incref(v90); - incref(v76); - int64_t v91 = mw_mirth_name_Namespace_ZEqualZEqual(v76, v90); - uint64_t x92; - VAL x93; - VAL x94; - VAL x95; - VAL x96; - VAL x97; - VAL x98; - if (((bool)v91)) { - VAL v99 = mtw_std_maybe_Maybe_1_Some(v90); - x98 = v99; - x97 = v76; - x96 = v75; - x95 = v74; - x94 = v73; - x93 = v72; - x92 = v71; - } else { - decref(v90); - VAL v100 = MKI64(0LL /* None */); - x98 = v100; - x97 = v76; - x96 = v75; - x95 = v74; - x94 = v73; - x93 = v72; - x92 = v71; - } - uint64_t x101; - VAL x102; - VAL x103; - VAL x104; - VAL x105; - VAL x106; - VAL x107; - VAL x108; - switch (get_data_tag(x98)) { - case 0LL: { // None - x108 = v80; - x107 = v77; - x106 = x97; - x105 = x96; - x104 = x95; - x103 = x94; - x102 = x93; - x101 = x92; - } break; - default: { - decref(v80); - decref(v77); - VAL v109 = MKI64(0LL /* Nil */); - x108 = v109; - x107 = x98; - x106 = x97; - x105 = x96; - x104 = x95; - x103 = x94; - x102 = x93; - x101 = x92; - } break; - } - int64_t v110 = 1LL /* True */; - x89 = v110; - x88 = x108; - x87 = x107; - x86 = x106; - x85 = x105; - x84 = x104; - x83 = x103; - x82 = x102; - x81 = x101; - } break; - case 0LL: { // None - int64_t v111 = 0LL /* False */; - x89 = v111; - x88 = v80; - x87 = v77; - x86 = v76; - x85 = v75; - x84 = v74; - x83 = v73; - x82 = v72; - x81 = v71; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v70 = x89; - v69 = x88; - v68 = x87; - v67 = x86; - v66 = x85; - v65 = x84; - v64 = x83; - v63 = x82; - v62 = x81; - } - decref(v69); - decref(v67); - int64_t v112 = mw_std_maybe_Maybe_1_someZAsk(v68); - uint64_t x113; - VAL x114; - VAL x115; - VAL x116; - VAL x117; - int64_t x118; - if (((bool)v112)) { - int64_t v119 = 1LL /* True */; - x118 = v119; - x117 = v66; - x116 = v65; - x115 = v64; - x114 = v63; - x113 = v62; - } else { - uint64_t v120 = VU64(VTUP(v66)->cells[2]); - incref(v64); - VAL v121; - int64_t v122; - mw_mirth_elab_defZ_isZ_importedZ_atZ_tokenZAsk(v65, v120, v64, &v121, &v122); - x118 = v122; - x117 = v66; - x116 = v121; - x115 = v64; - x114 = v63; - x113 = v62; - } - VAL x123; - VAL x124; - uint64_t x125; - VAL x126; - VAL x127; - if (((bool)x118)) { - VAL v128 = mtw_std_either_Either_2_Right(x115); - x127 = v128; - x126 = x117; - x125 = x113; - x124 = x116; - x123 = x114; - } else { - incref(x115); - VAL v129; - VAL v130; - mw_mirth_def_Def_qnameZ_hard(x116, x115, &v129, &v130); - VAL v131 = VVAL(VTUP(v130)->cells[1]); - incref(v131); - decref(v130); - VAL x132; - VAL x133; - uint64_t x134; - VAL x135; - VAL x136; - switch (get_data_tag(v131)) { - case 3LL: { // NAMESPACE_TYCON - VAL v137 = mtp_mirth_name_Namespace_NAMESPACEz_TYCON(v131); - decref(v137); - int64_t v138 = mw_mirth_name_Name_canZ_beZ_relativeZAsk(x113); - VAL x139; - VAL x140; - uint64_t x141; - VAL x142; - VAL x143; - if (((bool)v138)) { - incref(x114); - int64_t v144 = mw_std_list_List_1_emptyZAsk(x114); - VAL x145; - VAL x146; - uint64_t x147; - VAL x148; - VAL x149; - if (((bool)v144)) { - VAL v150 = mtw_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(x115); - x149 = v150; - x148 = x114; - x147 = x113; - x146 = x117; - x145 = v129; - } else { - VAL v151 = mtw_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(x115); - x149 = v151; - x148 = x114; - x147 = x113; - x146 = x117; - x145 = v129; - } - x143 = x149; - x142 = x148; - x141 = x147; - x140 = x146; - x139 = x145; - } else { - VAL v152 = mtw_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(x115); - x143 = v152; - x142 = x114; - x141 = x113; - x140 = x117; - x139 = v129; - } - x136 = x143; - x135 = x142; - x134 = x141; - x133 = x140; - x132 = x139; - } break; - default: { - decref(v131); - VAL v153 = mtw_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(x115); - x136 = v153; - x135 = x114; - x134 = x113; - x133 = x117; - x132 = v129; - } break; - } - VAL v154 = mtw_std_either_Either_2_Left(x136); - x127 = v154; - x126 = x133; - x125 = x134; - x124 = x132; - x123 = x135; - } - VAL x155; - VAL x156; - uint64_t x157; - VAL x158; - VAL x159; - VAL x160; - switch (get_data_tag(x127)) { - case 0LL: { // Left - VAL v161 = mtp_std_either_Either_2_Left(x127); - VAL v162 = mtw_std_list_List_1_Cons(v161, v12); - x160 = v13; - x159 = v162; - x158 = x126; - x157 = x125; - x156 = x124; - x155 = x123; - } break; - case 1LL: { // Right - VAL v163 = mtp_std_either_Either_2_Right(x127); - VAL v164 = mtw_std_list_List_1_Cons(v163, v13); - x160 = v164; - x159 = v12; - x158 = x126; - x157 = x125; - x156 = x124; - x155 = x123; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v165 = 1LL /* True */; - x23 = v165; - x22 = v15; - x21 = x160; - x20 = x159; - x19 = x158; - x18 = x157; - x17 = x156; - x16 = x155; - } break; - case 0LL: { // None - int64_t v166 = 0LL /* False */; - x23 = v166; - x22 = v15; - x21 = v13; - x20 = v12; - x19 = x3; - x18 = VU64(v10); - x17 = x2; - x16 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v167 = x16; - VAL v168 = (x17); - uint64_t v169 = x18; - VAL v170 = (x19); - VAL v171 = x20; - VAL v172 = x21; - VAL v173 = x22; - int64_t v174 = x23; - while (((bool)v174)) { - VAL v175 = v167; - VAL v176 = (v168); - uint64_t v177 = v169; - VAL v178 = (v170); - VAL v179 = v171; - VAL v180 = v172; - VAL v181 = v173; - VAL v182; - VAL v183; - mw_std_list_List_1_uncons(v181, &v182, &v183); - VAL x184; - VAL x185; - uint64_t x186; - VAL x187; - VAL x188; - VAL x189; - VAL x190; - int64_t x191; - switch (get_data_tag(v182)) { - case 1LL: { // Some - VAL v192 = mtp_std_maybe_Maybe_1_Some(v182); - incref(v175); - incref(v192); - VAL v193; - VAL v194; - mw_mirth_def_Def_qnameZ_hard(v176, v192, &v193, &v194); - VAL v195 = VVAL(VTUP(v194)->cells[1]); - incref(v195); - decref(v194); - VAL v196 = MKI64(0LL /* None */); - VAL v197; - VAL v198; - mw_std_list_List_1_uncons(v175, &v197, &v198); - uint64_t x199; - VAL x200; - VAL x201; - VAL x202; - VAL x203; - VAL x204; - VAL x205; - VAL x206; - int64_t x207; - switch (get_data_tag(v197)) { - case 1LL: { // Some - VAL v208 = mtp_std_maybe_Maybe_1_Some(v197); - incref(v208); - incref(v195); - int64_t v209 = mw_mirth_name_Namespace_ZEqualZEqual(v195, v208); - uint64_t x210; - VAL x211; - VAL x212; - VAL x213; - VAL x214; - VAL x215; - VAL x216; - if (((bool)v209)) { - VAL v217 = mtw_std_maybe_Maybe_1_Some(v208); - x216 = v217; - x215 = v195; - x214 = v178; - x213 = v193; - x212 = v192; - x211 = v175; - x210 = v177; - } else { - decref(v208); - VAL v218 = MKI64(0LL /* None */); - x216 = v218; - x215 = v195; - x214 = v178; - x213 = v193; - x212 = v192; - x211 = v175; - x210 = v177; - } - uint64_t x219; - VAL x220; - VAL x221; - VAL x222; - VAL x223; - VAL x224; - VAL x225; - VAL x226; - switch (get_data_tag(x216)) { - case 0LL: { // None - x226 = v198; - x225 = v196; - x224 = x215; - x223 = x214; - x222 = x213; - x221 = x212; - x220 = x211; - x219 = x210; - } break; - default: { - decref(v198); - decref(v196); - VAL v227 = MKI64(0LL /* Nil */); - x226 = v227; - x225 = x216; - x224 = x215; - x223 = x214; - x222 = x213; - x221 = x212; - x220 = x211; - x219 = x210; - } break; - } - int64_t v228 = 1LL /* True */; - x207 = v228; - x206 = x226; - x205 = x225; - x204 = x224; - x203 = x223; - x202 = x222; - x201 = x221; - x200 = x220; - x199 = x219; - } break; - case 0LL: { // None - int64_t v229 = 0LL /* False */; - x207 = v229; - x206 = v198; - x205 = v196; - x204 = v195; - x203 = v178; - x202 = v193; - x201 = v192; - x200 = v175; - x199 = v177; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v230 = x199; - VAL v231 = x200; - VAL v232 = x201; - VAL v233 = (x202); - VAL v234 = (x203); - VAL v235 = x204; - VAL v236 = x205; - VAL v237 = x206; - int64_t v238 = x207; - while (((bool)v238)) { - uint64_t v239 = v230; - VAL v240 = v231; - VAL v241 = v232; - VAL v242 = (v233); - VAL v243 = (v234); - VAL v244 = v235; - VAL v245 = v236; - VAL v246 = v237; - VAL v247; - VAL v248; - mw_std_list_List_1_uncons(v246, &v247, &v248); - uint64_t x249; - VAL x250; - VAL x251; - VAL x252; - VAL x253; - VAL x254; - VAL x255; - VAL x256; - int64_t x257; - switch (get_data_tag(v247)) { - case 1LL: { // Some - VAL v258 = mtp_std_maybe_Maybe_1_Some(v247); - incref(v258); - incref(v244); - int64_t v259 = mw_mirth_name_Namespace_ZEqualZEqual(v244, v258); - uint64_t x260; - VAL x261; - VAL x262; - VAL x263; - VAL x264; - VAL x265; - VAL x266; - if (((bool)v259)) { - VAL v267 = mtw_std_maybe_Maybe_1_Some(v258); - x266 = v267; - x265 = v244; - x264 = v243; - x263 = v242; - x262 = v241; - x261 = v240; - x260 = v239; - } else { - decref(v258); - VAL v268 = MKI64(0LL /* None */); - x266 = v268; - x265 = v244; - x264 = v243; - x263 = v242; - x262 = v241; - x261 = v240; - x260 = v239; - } - uint64_t x269; - VAL x270; - VAL x271; - VAL x272; - VAL x273; - VAL x274; - VAL x275; - VAL x276; - switch (get_data_tag(x266)) { - case 0LL: { // None - x276 = v248; - x275 = v245; - x274 = x265; - x273 = x264; - x272 = x263; - x271 = x262; - x270 = x261; - x269 = x260; - } break; - default: { - decref(v248); - decref(v245); - VAL v277 = MKI64(0LL /* Nil */); - x276 = v277; - x275 = x266; - x274 = x265; - x273 = x264; - x272 = x263; - x271 = x262; - x270 = x261; - x269 = x260; - } break; - } - int64_t v278 = 1LL /* True */; - x257 = v278; - x256 = x276; - x255 = x275; - x254 = x274; - x253 = x273; - x252 = x272; - x251 = x271; - x250 = x270; - x249 = x269; - } break; - case 0LL: { // None - int64_t v279 = 0LL /* False */; - x257 = v279; - x256 = v248; - x255 = v245; - x254 = v244; - x253 = v243; - x252 = v242; - x251 = v241; - x250 = v240; - x249 = v239; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v238 = x257; - v237 = x256; - v236 = x255; - v235 = x254; - v234 = x253; - v233 = x252; - v232 = x251; - v231 = x250; - v230 = x249; - } - decref(v237); - decref(v235); - int64_t v280 = mw_std_maybe_Maybe_1_someZAsk(v236); - uint64_t x281; - VAL x282; - VAL x283; - VAL x284; - VAL x285; - int64_t x286; - if (((bool)v280)) { - int64_t v287 = 1LL /* True */; - x286 = v287; - x285 = v234; - x284 = v233; - x283 = v232; - x282 = v231; - x281 = v230; - } else { - uint64_t v288 = VU64(VTUP(v234)->cells[2]); - incref(v232); - VAL v289; - int64_t v290; - mw_mirth_elab_defZ_isZ_importedZ_atZ_tokenZAsk(v233, v288, v232, &v289, &v290); - x286 = v290; - x285 = v234; - x284 = v289; - x283 = v232; - x282 = v231; - x281 = v230; - } - VAL x291; - VAL x292; - uint64_t x293; - VAL x294; - VAL x295; - if (((bool)x286)) { - VAL v296 = mtw_std_either_Either_2_Right(x283); - x295 = v296; - x294 = x285; - x293 = x281; - x292 = x284; - x291 = x282; - } else { - incref(x283); - VAL v297; - VAL v298; - mw_mirth_def_Def_qnameZ_hard(x284, x283, &v297, &v298); - VAL v299 = VVAL(VTUP(v298)->cells[1]); - incref(v299); - decref(v298); - VAL x300; - VAL x301; - uint64_t x302; - VAL x303; - VAL x304; - switch (get_data_tag(v299)) { - case 3LL: { // NAMESPACE_TYCON - VAL v305 = mtp_mirth_name_Namespace_NAMESPACEz_TYCON(v299); - decref(v305); - int64_t v306 = mw_mirth_name_Name_canZ_beZ_relativeZAsk(x281); - VAL x307; - VAL x308; - uint64_t x309; - VAL x310; - VAL x311; - if (((bool)v306)) { - incref(x282); - int64_t v312 = mw_std_list_List_1_emptyZAsk(x282); - VAL x313; - VAL x314; - uint64_t x315; - VAL x316; - VAL x317; - if (((bool)v312)) { - VAL v318 = mtw_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(x283); - x317 = v318; - x316 = x282; - x315 = x281; - x314 = x285; - x313 = v297; - } else { - VAL v319 = mtw_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(x283); - x317 = v319; - x316 = x282; - x315 = x281; - x314 = x285; - x313 = v297; - } - x311 = x317; - x310 = x316; - x309 = x315; - x308 = x314; - x307 = x313; - } else { - VAL v320 = mtw_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(x283); - x311 = v320; - x310 = x282; - x309 = x281; - x308 = x285; - x307 = v297; - } - x304 = x311; - x303 = x310; - x302 = x309; - x301 = x308; - x300 = x307; - } break; - default: { - decref(v299); - VAL v321 = mtw_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(x283); - x304 = v321; - x303 = x282; - x302 = x281; - x301 = x285; - x300 = v297; - } break; - } - VAL v322 = mtw_std_either_Either_2_Left(x304); - x295 = v322; - x294 = x301; - x293 = x302; - x292 = x300; - x291 = x303; - } - VAL x323; - VAL x324; - uint64_t x325; - VAL x326; - VAL x327; - VAL x328; - switch (get_data_tag(x295)) { + VAL x89; + VAL x90; + VAL x91; + switch (get_data_tag(x58)) { case 0LL: { // Left - VAL v329 = mtp_std_either_Either_2_Left(x295); - VAL v330 = mtw_std_list_List_1_Cons(v329, v179); - x328 = v180; - x327 = v330; - x326 = x294; - x325 = x293; - x324 = x292; - x323 = x291; + VAL v92 = mtp_std_either_Either_2_Left(x58); + VAL v93 = mtw_std_list_List_1_Cons(v92, v28); + x91 = v29; + x90 = v93; + x89 = x57; + x88 = x56; + x87 = x55; + x86 = x54; } break; case 1LL: { // Right - VAL v331 = mtp_std_either_Either_2_Right(x295); - VAL v332 = mtw_std_list_List_1_Cons(v331, v180); - x328 = v332; - x327 = v179; - x326 = x294; - x325 = x293; - x324 = x292; - x323 = x291; + VAL v94 = mtp_std_either_Either_2_Right(x58); + VAL v95 = mtw_std_list_List_1_Cons(v94, v29); + x91 = v95; + x90 = v28; + x89 = x57; + x88 = x56; + x87 = x55; + x86 = x54; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v333 = 1LL /* True */; - x191 = v333; - x190 = v183; - x189 = x328; - x188 = x327; - x187 = x326; - x186 = x325; - x185 = x324; - x184 = x323; + int64_t v96 = 1LL /* True */; + x39 = v96; + x38 = v41; + x37 = x91; + x36 = x90; + x35 = x89; + x34 = x88; + x33 = x87; + x32 = x86; } break; - case 0LL: { // None - int64_t v334 = 0LL /* False */; - x191 = v334; - x190 = v183; - x189 = v180; - x188 = v179; - x187 = v178; - x186 = v177; - x185 = v176; - x184 = v175; + case 0LL: { // Nil + VAL v97 = MKI64(0LL /* Nil */); + int64_t v98 = 0LL /* False */; + x39 = v98; + x38 = v97; + x37 = v29; + x36 = v28; + x35 = v26; + x34 = v25; + x33 = v27; + x32 = VU64(v24); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v174 = x191; - v173 = x190; - v172 = x189; - v171 = x188; - v170 = x187; - v169 = x186; - v168 = x185; - v167 = x184; + v23 = x39; + v22 = x39; + v21 = x38; + v20 = x37; + v19 = x36; + v18 = x33; + v17 = x35; + v16 = x34; + v15 = MKU64(x32); } - decref(v173); - VAL v335 = mw_std_list_List_1_reverse(v171); - VAL v336 = mw_std_list_List_1_reverse(v172); - VAL v337 = VVAL(VTUP(v170)->cells[5]); - incref(v337); - VAL v338 = mw_std_list_List_1_cat(v335, v337); - VAL v339 = VTUP(v170)->cells[5]; - decref(v339); - VTUP(v170)->cells[5] = v338; - VAL v340 = VTUP(v170)->cells[4]; - decref(v340); - VTUP(v170)->cells[4] = v336; - x9 = v170; - x8 = v168; - x7 = v167; + decref(v21); + VAL v99 = mw_std_list_List_1_reverse(v19); + VAL v100 = mw_std_list_List_1_reverse(v20); + VAL v101 = VVAL(VTUP(v17)->cells[5]); + incref(v101); + VAL v102 = mw_std_list_List_1_cat(v99, v101); + VAL v103 = VTUP(v17)->cells[5]; + decref(v103); + VTUP(v17)->cells[5] = v102; + VAL v104 = VTUP(v17)->cells[4]; + decref(v104); + VTUP(v17)->cells[4] = v100; + decref(v15); + x9 = v17; + x8 = v16; + x7 = v18; } break; case 1LL: { // Right - VAL v341 = mtp_std_either_Either_2_Right(v6); - incref(v341); - int64_t v342 = mw_mirth_name_DName_isZ_relativeZAsk(v341); - VAL x343; - VAL x344; - VAL x345; - VAL x346; - int64_t x347; - if (((bool)v342)) { - int64_t v348 = VI64(VTUP(x3)->cells[6]); - bool v349 = !((bool)v348); - x347 = ((int64_t)v349); - x346 = v341; - x345 = x3; - x344 = x2; - x343 = x1; + VAL v105 = mtp_std_either_Either_2_Right(v6); + incref(v105); + int64_t v106 = mw_mirth_name_DName_isZ_relativeZAsk(v105); + VAL x107; + int64_t x108; + if (((bool)v106)) { + int64_t v109 = VI64(VTUP(x3)->cells[6]); + bool v110 = !((bool)v109); + x108 = ((int64_t)v110); + x107 = x3; } else { - int64_t v350 = 0LL /* False */; - x347 = v350; - x346 = v341; - x345 = x3; - x344 = x2; - x343 = x1; + int64_t v111 = 0LL /* False */; + x108 = v111; + x107 = x3; } - VAL x351; - VAL x352; - VAL x353; - VAL x354; - if (((bool)x347)) { - VAL v355 = VVAL(VTUP(x345)->cells[4]); - incref(v355); - VAL v356 = MKI64(0LL /* Nil */); - VAL v357 = MKI64(0LL /* Nil */); - VAL v358; - VAL v359; - mw_std_list_List_1_uncons(v355, &v358, &v359); - VAL x360; - VAL x361; - VAL x362; - VAL x363; - VAL x364; - VAL x365; - VAL x366; - int64_t x367; - switch (get_data_tag(v358)) { - case 1LL: { // Some - VAL v368 = mtp_std_maybe_Maybe_1_Some(v358); - incref(x346); - incref(v368); - VAL v369; - VAL v370; - mw_mirth_def_Def_qnameZ_hard(x344, v368, &v369, &v370); - VAL v371; - VAL v372; - VAL v373; - mw_mirth_name_QName_climbZ_upZ_dnameZAsk(v369, x345, x346, v370, &v371, &v372, &v373); - VAL v374 = MKI64(0LL /* None */); - VAL v375; - VAL v376; - mw_std_list_List_1_uncons(v373, &v375, &v376); - VAL x377; - VAL x378; - VAL x379; - VAL x380; - VAL x381; - VAL x382; - VAL x383; - int64_t x384; - switch (get_data_tag(v375)) { - case 1LL: { // Some - VAL v385 = mtp_std_maybe_Maybe_1_Some(v375); - incref(v385); - incref(x343); - VAL v386 = MKI64(0LL /* None */); - VAL v387; - VAL v388; - mw_std_list_List_1_uncons(x343, &v387, &v388); - VAL x389; - VAL x390; - VAL x391; - VAL x392; - VAL x393; - VAL x394; - VAL x395; - VAL x396; - int64_t x397; - switch (get_data_tag(v387)) { - case 1LL: { // Some - VAL v398 = mtp_std_maybe_Maybe_1_Some(v387); - incref(v398); - incref(v385); - int64_t v399 = mw_mirth_name_Namespace_ZEqualZEqual(v385, v398); - VAL x400; - VAL x401; - VAL x402; - VAL x403; - VAL x404; - VAL x405; - VAL x406; - if (((bool)v399)) { - VAL v407 = mtw_std_maybe_Maybe_1_Some(v398); - x406 = v407; - x405 = v385; - x404 = v368; - x403 = x346; - x402 = x343; - x401 = v372; - x400 = v371; - } else { - decref(v398); - VAL v408 = MKI64(0LL /* None */); - x406 = v408; - x405 = v385; - x404 = v368; - x403 = x346; - x402 = x343; - x401 = v372; - x400 = v371; - } - VAL x409; - VAL x410; - VAL x411; - VAL x412; - VAL x413; - VAL x414; - VAL x415; - VAL x416; - switch (get_data_tag(x406)) { - case 0LL: { // None - x416 = v388; - x415 = v386; - x414 = x405; - x413 = x404; - x412 = x403; - x411 = x402; - x410 = x401; - x409 = x400; - } break; - default: { - decref(v388); - decref(v386); - VAL v417 = MKI64(0LL /* Nil */); - x416 = v417; - x415 = x406; - x414 = x405; - x413 = x404; - x412 = x403; - x411 = x402; - x410 = x401; - x409 = x400; - } break; - } - int64_t v418 = 1LL /* True */; - x397 = v418; - x396 = x416; - x395 = x415; - x394 = x414; - x393 = x413; - x392 = x412; - x391 = x411; - x390 = x410; - x389 = x409; - } break; - case 0LL: { // None - int64_t v419 = 0LL /* False */; - x397 = v419; - x396 = v388; - x395 = v386; - x394 = v385; - x393 = v368; - x392 = x346; - x391 = x343; - x390 = v372; - x389 = v371; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v420 = (x389); - VAL v421 = (x390); - VAL v422 = x391; - VAL v423 = x392; - VAL v424 = x393; - VAL v425 = x394; - VAL v426 = x395; - VAL v427 = x396; - int64_t v428 = x397; - while (((bool)v428)) { - VAL v429 = (v420); - VAL v430 = (v421); - VAL v431 = v422; - VAL v432 = v423; - VAL v433 = v424; - VAL v434 = v425; - VAL v435 = v426; - VAL v436 = v427; - VAL v437; - VAL v438; - mw_std_list_List_1_uncons(v436, &v437, &v438); - VAL x439; - VAL x440; - VAL x441; - VAL x442; - VAL x443; - VAL x444; - VAL x445; - VAL x446; - int64_t x447; - switch (get_data_tag(v437)) { - case 1LL: { // Some - VAL v448 = mtp_std_maybe_Maybe_1_Some(v437); - incref(v448); - incref(v434); - int64_t v449 = mw_mirth_name_Namespace_ZEqualZEqual(v434, v448); - VAL x450; - VAL x451; - VAL x452; - VAL x453; - VAL x454; - VAL x455; - VAL x456; - if (((bool)v449)) { - VAL v457 = mtw_std_maybe_Maybe_1_Some(v448); - x456 = v457; - x455 = v434; - x454 = v433; - x453 = v432; - x452 = v431; - x451 = v430; - x450 = v429; - } else { - decref(v448); - VAL v458 = MKI64(0LL /* None */); - x456 = v458; - x455 = v434; - x454 = v433; - x453 = v432; - x452 = v431; - x451 = v430; - x450 = v429; - } - VAL x459; - VAL x460; - VAL x461; - VAL x462; - VAL x463; - VAL x464; - VAL x465; - VAL x466; - switch (get_data_tag(x456)) { - case 0LL: { // None - x466 = v438; - x465 = v435; - x464 = x455; - x463 = x454; - x462 = x453; - x461 = x452; - x460 = x451; - x459 = x450; - } break; - default: { - decref(v438); - decref(v435); - VAL v467 = MKI64(0LL /* Nil */); - x466 = v467; - x465 = x456; - x464 = x455; - x463 = x454; - x462 = x453; - x461 = x452; - x460 = x451; - x459 = x450; - } break; - } - int64_t v468 = 1LL /* True */; - x447 = v468; - x446 = x466; - x445 = x465; - x444 = x464; - x443 = x463; - x442 = x462; - x441 = x461; - x440 = x460; - x439 = x459; - } break; - case 0LL: { // None - int64_t v469 = 0LL /* False */; - x447 = v469; - x446 = v438; - x445 = v435; - x444 = v434; - x443 = v433; - x442 = v432; - x441 = v431; - x440 = v430; - x439 = v429; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v428 = x447; - v427 = x446; - v426 = x445; - v425 = x444; - v424 = x443; - v423 = x442; - v422 = x441; - v421 = x440; - v420 = x439; - } - decref(v427); - decref(v425); - int64_t v470 = mw_std_maybe_Maybe_1_someZAsk(v426); - VAL x471; - VAL x472; - VAL x473; - VAL x474; - VAL x475; - VAL x476; - if (((bool)v470)) { - VAL v477 = mtw_std_maybe_Maybe_1_Some(v385); - x476 = v477; - x475 = v421; - x474 = v420; - x473 = v424; - x472 = v423; - x471 = v422; - } else { - decref(v385); - VAL v478 = MKI64(0LL /* None */); - x476 = v478; - x475 = v421; - x474 = v420; - x473 = v424; - x472 = v423; - x471 = v422; - } - VAL x479; - VAL x480; - VAL x481; - VAL x482; - VAL x483; - VAL x484; - VAL x485; - switch (get_data_tag(x476)) { - case 0LL: { // None - x485 = v376; - x484 = v374; - x483 = x475; - x482 = x474; - x481 = x473; - x480 = x472; - x479 = x471; - } break; - default: { - decref(v376); - decref(v374); - VAL v486 = MKI64(0LL /* Nil */); - x485 = v486; - x484 = x476; - x483 = x475; - x482 = x474; - x481 = x473; - x480 = x472; - x479 = x471; - } break; - } - int64_t v487 = 1LL /* True */; - x384 = v487; - x383 = x485; - x382 = x484; - x381 = x483; - x380 = x482; - x379 = x481; - x378 = x480; - x377 = x479; - } break; - case 0LL: { // None - int64_t v488 = 0LL /* False */; - x384 = v488; - x383 = v376; - x382 = v374; - x381 = v372; - x380 = v371; - x379 = v368; - x378 = x346; - x377 = x343; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v489 = x377; - VAL v490 = x378; - VAL v491 = x379; - VAL v492 = (x380); - VAL v493 = (x381); - VAL v494 = x382; - VAL v495 = x383; - int64_t v496 = x384; - while (((bool)v496)) { - VAL v497 = v489; - VAL v498 = v490; - VAL v499 = v491; - VAL v500 = (v492); - VAL v501 = (v493); - VAL v502 = v494; - VAL v503 = v495; - VAL v504; - VAL v505; - mw_std_list_List_1_uncons(v503, &v504, &v505); - VAL x506; - VAL x507; - VAL x508; - VAL x509; - VAL x510; - VAL x511; - VAL x512; - int64_t x513; - switch (get_data_tag(v504)) { - case 1LL: { // Some - VAL v514 = mtp_std_maybe_Maybe_1_Some(v504); - incref(v514); - incref(v497); - VAL v515 = MKI64(0LL /* None */); - VAL v516; - VAL v517; - mw_std_list_List_1_uncons(v497, &v516, &v517); - VAL x518; - VAL x519; - VAL x520; - VAL x521; - VAL x522; - VAL x523; - VAL x524; - VAL x525; - int64_t x526; - switch (get_data_tag(v516)) { - case 1LL: { // Some - VAL v527 = mtp_std_maybe_Maybe_1_Some(v516); - incref(v527); - incref(v514); - int64_t v528 = mw_mirth_name_Namespace_ZEqualZEqual(v514, v527); - VAL x529; - VAL x530; - VAL x531; - VAL x532; - VAL x533; - VAL x534; - VAL x535; - if (((bool)v528)) { - VAL v536 = mtw_std_maybe_Maybe_1_Some(v527); - x535 = v536; - x534 = v514; - x533 = v499; - x532 = v498; - x531 = v497; - x530 = v501; - x529 = v500; - } else { - decref(v527); - VAL v537 = MKI64(0LL /* None */); - x535 = v537; - x534 = v514; - x533 = v499; - x532 = v498; - x531 = v497; - x530 = v501; - x529 = v500; - } - VAL x538; - VAL x539; - VAL x540; - VAL x541; - VAL x542; - VAL x543; - VAL x544; - VAL x545; - switch (get_data_tag(x535)) { - case 0LL: { // None - x545 = v517; - x544 = v515; - x543 = x534; - x542 = x533; - x541 = x532; - x540 = x531; - x539 = x530; - x538 = x529; - } break; - default: { - decref(v517); - decref(v515); - VAL v546 = MKI64(0LL /* Nil */); - x545 = v546; - x544 = x535; - x543 = x534; - x542 = x533; - x541 = x532; - x540 = x531; - x539 = x530; - x538 = x529; - } break; - } - int64_t v547 = 1LL /* True */; - x526 = v547; - x525 = x545; - x524 = x544; - x523 = x543; - x522 = x542; - x521 = x541; - x520 = x540; - x519 = x539; - x518 = x538; - } break; - case 0LL: { // None - int64_t v548 = 0LL /* False */; - x526 = v548; - x525 = v517; - x524 = v515; - x523 = v514; - x522 = v499; - x521 = v498; - x520 = v497; - x519 = v501; - x518 = v500; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v549 = (x518); - VAL v550 = (x519); - VAL v551 = x520; - VAL v552 = x521; - VAL v553 = x522; - VAL v554 = x523; - VAL v555 = x524; - VAL v556 = x525; - int64_t v557 = x526; - while (((bool)v557)) { - VAL v558 = (v549); - VAL v559 = (v550); - VAL v560 = v551; - VAL v561 = v552; - VAL v562 = v553; - VAL v563 = v554; - VAL v564 = v555; - VAL v565 = v556; - VAL v566; - VAL v567; - mw_std_list_List_1_uncons(v565, &v566, &v567); - VAL x568; - VAL x569; - VAL x570; - VAL x571; - VAL x572; - VAL x573; - VAL x574; - VAL x575; - int64_t x576; - switch (get_data_tag(v566)) { - case 1LL: { // Some - VAL v577 = mtp_std_maybe_Maybe_1_Some(v566); - incref(v577); - incref(v563); - int64_t v578 = mw_mirth_name_Namespace_ZEqualZEqual(v563, v577); - VAL x579; - VAL x580; - VAL x581; - VAL x582; - VAL x583; - VAL x584; - VAL x585; - if (((bool)v578)) { - VAL v586 = mtw_std_maybe_Maybe_1_Some(v577); - x585 = v586; - x584 = v563; - x583 = v562; - x582 = v561; - x581 = v560; - x580 = v559; - x579 = v558; - } else { - decref(v577); - VAL v587 = MKI64(0LL /* None */); - x585 = v587; - x584 = v563; - x583 = v562; - x582 = v561; - x581 = v560; - x580 = v559; - x579 = v558; - } - VAL x588; - VAL x589; - VAL x590; - VAL x591; - VAL x592; - VAL x593; - VAL x594; - VAL x595; - switch (get_data_tag(x585)) { - case 0LL: { // None - x595 = v567; - x594 = v564; - x593 = x584; - x592 = x583; - x591 = x582; - x590 = x581; - x589 = x580; - x588 = x579; - } break; - default: { - decref(v567); - decref(v564); - VAL v596 = MKI64(0LL /* Nil */); - x595 = v596; - x594 = x585; - x593 = x584; - x592 = x583; - x591 = x582; - x590 = x581; - x589 = x580; - x588 = x579; - } break; - } - int64_t v597 = 1LL /* True */; - x576 = v597; - x575 = x595; - x574 = x594; - x573 = x593; - x572 = x592; - x571 = x591; - x570 = x590; - x569 = x589; - x568 = x588; - } break; - case 0LL: { // None - int64_t v598 = 0LL /* False */; - x576 = v598; - x575 = v567; - x574 = v564; - x573 = v563; - x572 = v562; - x571 = v561; - x570 = v560; - x569 = v559; - x568 = v558; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v557 = x576; - v556 = x575; - v555 = x574; - v554 = x573; - v553 = x572; - v552 = x571; - v551 = x570; - v550 = x569; - v549 = x568; - } - decref(v556); - decref(v554); - int64_t v599 = mw_std_maybe_Maybe_1_someZAsk(v555); - VAL x600; - VAL x601; - VAL x602; - VAL x603; - VAL x604; - VAL x605; - if (((bool)v599)) { - VAL v606 = mtw_std_maybe_Maybe_1_Some(v514); - x605 = v606; - x604 = v550; - x603 = v549; - x602 = v553; - x601 = v552; - x600 = v551; - } else { - decref(v514); - VAL v607 = MKI64(0LL /* None */); - x605 = v607; - x604 = v550; - x603 = v549; - x602 = v553; - x601 = v552; - x600 = v551; - } - VAL x608; - VAL x609; - VAL x610; - VAL x611; - VAL x612; - VAL x613; - VAL x614; - switch (get_data_tag(x605)) { - case 0LL: { // None - x614 = v505; - x613 = v502; - x612 = x604; - x611 = x603; - x610 = x602; - x609 = x601; - x608 = x600; - } break; - default: { - decref(v505); - decref(v502); - VAL v615 = MKI64(0LL /* Nil */); - x614 = v615; - x613 = x605; - x612 = x604; - x611 = x603; - x610 = x602; - x609 = x601; - x608 = x600; - } break; - } - int64_t v616 = 1LL /* True */; - x513 = v616; - x512 = x614; - x511 = x613; - x510 = x612; - x509 = x611; - x508 = x610; - x507 = x609; - x506 = x608; - } break; - case 0LL: { // None - int64_t v617 = 0LL /* False */; - x513 = v617; - x512 = v505; - x511 = v502; - x510 = v501; - x509 = v500; - x508 = v499; - x507 = v498; - x506 = v497; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v496 = x513; - v495 = x512; - v494 = x511; - v493 = x510; - v492 = x509; - v491 = x508; - v490 = x507; - v489 = x506; - } - decref(v495); - int64_t v618 = mw_std_maybe_Maybe_1_someZAsk(v494); - VAL x619; - VAL x620; - VAL x621; - VAL x622; - VAL x623; - if (((bool)v618)) { - VAL v624 = mtw_std_either_Either_2_Right(v491); - x623 = v624; - x622 = v493; - x621 = v490; - x620 = v492; - x619 = v489; - } else { - incref(v489); - int64_t v625 = mw_std_list_List_1_emptyZAsk(v489); - VAL x626; - VAL x627; - VAL x628; - VAL x629; - VAL x630; - if (((bool)v625)) { - VAL v631 = mtw_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(v491); - x630 = v631; - x629 = v490; - x628 = v489; - x627 = v493; - x626 = v492; - } else { - VAL v632 = mtw_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(v491); - x630 = v632; - x629 = v490; - x628 = v489; - x627 = v493; - x626 = v492; - } - VAL v633 = mtw_std_either_Either_2_Left(x630); - x623 = v633; - x622 = x627; - x621 = x629; - x620 = x626; - x619 = x628; - } - VAL x634; - VAL x635; - VAL x636; - VAL x637; - VAL x638; - VAL x639; - switch (get_data_tag(x623)) { - case 0LL: { // Left - VAL v640 = mtp_std_either_Either_2_Left(x623); - VAL v641 = mtw_std_list_List_1_Cons(v640, v356); - x639 = v357; - x638 = v641; - x637 = x622; - x636 = x621; - x635 = x620; - x634 = x619; - } break; - case 1LL: { // Right - VAL v642 = mtp_std_either_Either_2_Right(x623); - VAL v643 = mtw_std_list_List_1_Cons(v642, v357); - x639 = v643; - x638 = v356; - x637 = x622; - x636 = x621; - x635 = x620; - x634 = x619; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v644 = 1LL /* True */; - x367 = v644; - x366 = v359; - x365 = x639; - x364 = x638; - x363 = x637; - x362 = x636; - x361 = x635; - x360 = x634; - } break; - case 0LL: { // None - int64_t v645 = 0LL /* False */; - x367 = v645; - x366 = v359; - x365 = v357; - x364 = v356; - x363 = x345; - x362 = x346; - x361 = x344; - x360 = x343; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v646 = x360; - VAL v647 = (x361); - VAL v648 = x362; - VAL v649 = (x363); - VAL v650 = x364; - VAL v651 = x365; - VAL v652 = x366; - int64_t v653 = x367; - while (((bool)v653)) { - VAL v654 = v646; - VAL v655 = (v647); - VAL v656 = v648; - VAL v657 = (v649); - VAL v658 = v650; - VAL v659 = v651; - VAL v660 = v652; - VAL v661; - VAL v662; - mw_std_list_List_1_uncons(v660, &v661, &v662); - VAL x663; - VAL x664; - VAL x665; - VAL x666; - VAL x667; - VAL x668; - VAL x669; - int64_t x670; - switch (get_data_tag(v661)) { - case 1LL: { // Some - VAL v671 = mtp_std_maybe_Maybe_1_Some(v661); - incref(v656); - incref(v671); - VAL v672; - VAL v673; - mw_mirth_def_Def_qnameZ_hard(v655, v671, &v672, &v673); - VAL v674; - VAL v675; - VAL v676; - mw_mirth_name_QName_climbZ_upZ_dnameZAsk(v672, v657, v656, v673, &v674, &v675, &v676); - VAL v677 = MKI64(0LL /* None */); - VAL v678; - VAL v679; - mw_std_list_List_1_uncons(v676, &v678, &v679); - VAL x680; - VAL x681; - VAL x682; - VAL x683; - VAL x684; - VAL x685; - VAL x686; - int64_t x687; - switch (get_data_tag(v678)) { - case 1LL: { // Some - VAL v688 = mtp_std_maybe_Maybe_1_Some(v678); - incref(v688); - incref(v654); - VAL v689 = MKI64(0LL /* None */); - VAL v690; - VAL v691; - mw_std_list_List_1_uncons(v654, &v690, &v691); - VAL x692; - VAL x693; - VAL x694; - VAL x695; - VAL x696; - VAL x697; - VAL x698; - VAL x699; - int64_t x700; - switch (get_data_tag(v690)) { - case 1LL: { // Some - VAL v701 = mtp_std_maybe_Maybe_1_Some(v690); - incref(v701); - incref(v688); - int64_t v702 = mw_mirth_name_Namespace_ZEqualZEqual(v688, v701); - VAL x703; - VAL x704; - VAL x705; - VAL x706; - VAL x707; - VAL x708; - VAL x709; - if (((bool)v702)) { - VAL v710 = mtw_std_maybe_Maybe_1_Some(v701); - x709 = v710; - x708 = v688; - x707 = v671; - x706 = v656; - x705 = v654; - x704 = v675; - x703 = v674; - } else { - decref(v701); - VAL v711 = MKI64(0LL /* None */); - x709 = v711; - x708 = v688; - x707 = v671; - x706 = v656; - x705 = v654; - x704 = v675; - x703 = v674; - } - VAL x712; - VAL x713; - VAL x714; - VAL x715; - VAL x716; - VAL x717; - VAL x718; - VAL x719; - switch (get_data_tag(x709)) { - case 0LL: { // None - x719 = v691; - x718 = v689; - x717 = x708; - x716 = x707; - x715 = x706; - x714 = x705; - x713 = x704; - x712 = x703; - } break; - default: { - decref(v691); - decref(v689); - VAL v720 = MKI64(0LL /* Nil */); - x719 = v720; - x718 = x709; - x717 = x708; - x716 = x707; - x715 = x706; - x714 = x705; - x713 = x704; - x712 = x703; - } break; - } - int64_t v721 = 1LL /* True */; - x700 = v721; - x699 = x719; - x698 = x718; - x697 = x717; - x696 = x716; - x695 = x715; - x694 = x714; - x693 = x713; - x692 = x712; - } break; - case 0LL: { // None - int64_t v722 = 0LL /* False */; - x700 = v722; - x699 = v691; - x698 = v689; - x697 = v688; - x696 = v671; - x695 = v656; - x694 = v654; - x693 = v675; - x692 = v674; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v723 = (x692); - VAL v724 = (x693); - VAL v725 = x694; - VAL v726 = x695; - VAL v727 = x696; - VAL v728 = x697; - VAL v729 = x698; - VAL v730 = x699; - int64_t v731 = x700; - while (((bool)v731)) { - VAL v732 = (v723); - VAL v733 = (v724); - VAL v734 = v725; - VAL v735 = v726; - VAL v736 = v727; - VAL v737 = v728; - VAL v738 = v729; - VAL v739 = v730; - VAL v740; - VAL v741; - mw_std_list_List_1_uncons(v739, &v740, &v741); - VAL x742; - VAL x743; - VAL x744; - VAL x745; - VAL x746; - VAL x747; - VAL x748; - VAL x749; - int64_t x750; - switch (get_data_tag(v740)) { - case 1LL: { // Some - VAL v751 = mtp_std_maybe_Maybe_1_Some(v740); - incref(v751); - incref(v737); - int64_t v752 = mw_mirth_name_Namespace_ZEqualZEqual(v737, v751); - VAL x753; - VAL x754; - VAL x755; - VAL x756; - VAL x757; - VAL x758; - VAL x759; - if (((bool)v752)) { - VAL v760 = mtw_std_maybe_Maybe_1_Some(v751); - x759 = v760; - x758 = v737; - x757 = v736; - x756 = v735; - x755 = v734; - x754 = v733; - x753 = v732; - } else { - decref(v751); - VAL v761 = MKI64(0LL /* None */); - x759 = v761; - x758 = v737; - x757 = v736; - x756 = v735; - x755 = v734; - x754 = v733; - x753 = v732; - } - VAL x762; - VAL x763; - VAL x764; - VAL x765; - VAL x766; - VAL x767; - VAL x768; - VAL x769; - switch (get_data_tag(x759)) { - case 0LL: { // None - x769 = v741; - x768 = v738; - x767 = x758; - x766 = x757; - x765 = x756; - x764 = x755; - x763 = x754; - x762 = x753; - } break; - default: { - decref(v741); - decref(v738); - VAL v770 = MKI64(0LL /* Nil */); - x769 = v770; - x768 = x759; - x767 = x758; - x766 = x757; - x765 = x756; - x764 = x755; - x763 = x754; - x762 = x753; - } break; - } - int64_t v771 = 1LL /* True */; - x750 = v771; - x749 = x769; - x748 = x768; - x747 = x767; - x746 = x766; - x745 = x765; - x744 = x764; - x743 = x763; - x742 = x762; - } break; - case 0LL: { // None - int64_t v772 = 0LL /* False */; - x750 = v772; - x749 = v741; - x748 = v738; - x747 = v737; - x746 = v736; - x745 = v735; - x744 = v734; - x743 = v733; - x742 = v732; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v731 = x750; - v730 = x749; - v729 = x748; - v728 = x747; - v727 = x746; - v726 = x745; - v725 = x744; - v724 = x743; - v723 = x742; - } - decref(v730); - decref(v728); - int64_t v773 = mw_std_maybe_Maybe_1_someZAsk(v729); - VAL x774; - VAL x775; - VAL x776; - VAL x777; - VAL x778; - VAL x779; - if (((bool)v773)) { - VAL v780 = mtw_std_maybe_Maybe_1_Some(v688); - x779 = v780; - x778 = v724; - x777 = v723; - x776 = v727; - x775 = v726; - x774 = v725; - } else { - decref(v688); - VAL v781 = MKI64(0LL /* None */); - x779 = v781; - x778 = v724; - x777 = v723; - x776 = v727; - x775 = v726; - x774 = v725; - } - VAL x782; - VAL x783; - VAL x784; - VAL x785; - VAL x786; - VAL x787; - VAL x788; - switch (get_data_tag(x779)) { - case 0LL: { // None - x788 = v679; - x787 = v677; - x786 = x778; - x785 = x777; - x784 = x776; - x783 = x775; - x782 = x774; - } break; - default: { - decref(v679); - decref(v677); - VAL v789 = MKI64(0LL /* Nil */); - x788 = v789; - x787 = x779; - x786 = x778; - x785 = x777; - x784 = x776; - x783 = x775; - x782 = x774; - } break; - } - int64_t v790 = 1LL /* True */; - x687 = v790; - x686 = x788; - x685 = x787; - x684 = x786; - x683 = x785; - x682 = x784; - x681 = x783; - x680 = x782; - } break; - case 0LL: { // None - int64_t v791 = 0LL /* False */; - x687 = v791; - x686 = v679; - x685 = v677; - x684 = v675; - x683 = v674; - x682 = v671; - x681 = v656; - x680 = v654; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v792 = x680; - VAL v793 = x681; - VAL v794 = x682; - VAL v795 = (x683); - VAL v796 = (x684); - VAL v797 = x685; - VAL v798 = x686; - int64_t v799 = x687; - while (((bool)v799)) { - VAL v800 = v792; - VAL v801 = v793; - VAL v802 = v794; - VAL v803 = (v795); - VAL v804 = (v796); - VAL v805 = v797; - VAL v806 = v798; - VAL v807; - VAL v808; - mw_std_list_List_1_uncons(v806, &v807, &v808); - VAL x809; - VAL x810; - VAL x811; - VAL x812; - VAL x813; - VAL x814; - VAL x815; - int64_t x816; - switch (get_data_tag(v807)) { + VAL x112; + VAL x113; + VAL x114; + VAL x115; + if (((bool)x108)) { + VAL v116 = VVAL(VTUP(x107)->cells[4]); + incref(v116); + VAL v117 = MKI64(0LL /* Nil */); + VAL v118 = MKI64(0LL /* Nil */); + int64_t v119 = 1LL /* True */; + VAL v120 = x1; + VAL v121 = x2; + VAL v122 = x107; + VAL v123 = v105; + VAL v124 = v117; + VAL v125 = v118; + VAL v126 = v116; + int64_t v127 = v119; + int64_t v128 = v119; + while (((bool)v128)) { + VAL v129 = v120; + VAL v130 = v121; + VAL v131 = v122; + VAL v132 = v123; + VAL v133 = v124; + VAL v134 = v125; + VAL v135 = v126; + int64_t v136 = v127; + VAL x137; + VAL x138; + VAL x139; + VAL x140; + VAL x141; + VAL x142; + VAL x143; + int64_t x144; + switch (get_data_tag(v135)) { + case 1LL: { // Cons + VAL v145; + VAL v146; + mtp_std_list_List_1_Cons(v135, &v145, &v146); + incref(v132); + incref(v145); + VAL v147; + VAL v148; + mw_mirth_def_Def_qnameZ_hard(v130, v145, &v147, &v148); + VAL v149; + VAL v150; + VAL v151; + mw_mirth_name_QName_climbZ_upZ_dnameZAsk(v147, v131, v132, v148, &v149, &v150, &v151); + VAL v152 = MKI64(0LL /* None */); + int64_t v153 = 1LL /* True */; + VAL v154 = v129; + VAL v155 = v132; + VAL v156 = v145; + VAL v157 = v152; + VAL v158 = v151; + int64_t v159 = v153; + int64_t v160 = v153; + while (((bool)v160)) { + VAL v161 = v154; + VAL v162 = v155; + VAL v163 = v156; + VAL v164 = v157; + VAL v165 = v158; + int64_t v166 = v159; + VAL v167; + VAL v168; + mw_std_list_List_1_uncons(v165, &v167, &v168); + VAL x169; + VAL x170; + VAL x171; + VAL x172; + VAL x173; + int64_t x174; + switch (get_data_tag(v167)) { case 1LL: { // Some - VAL v817 = mtp_std_maybe_Maybe_1_Some(v807); - incref(v817); - incref(v800); - VAL v818 = MKI64(0LL /* None */); - VAL v819; - VAL v820; - mw_std_list_List_1_uncons(v800, &v819, &v820); - VAL x821; - VAL x822; - VAL x823; - VAL x824; - VAL x825; - VAL x826; - VAL x827; - VAL x828; - int64_t x829; - switch (get_data_tag(v819)) { - case 1LL: { // Some - VAL v830 = mtp_std_maybe_Maybe_1_Some(v819); - incref(v830); - incref(v817); - int64_t v831 = mw_mirth_name_Namespace_ZEqualZEqual(v817, v830); - VAL x832; - VAL x833; - VAL x834; - VAL x835; - VAL x836; - VAL x837; - VAL x838; - if (((bool)v831)) { - VAL v839 = mtw_std_maybe_Maybe_1_Some(v830); - x838 = v839; - x837 = v817; - x836 = v802; - x835 = v801; - x834 = v800; - x833 = v804; - x832 = v803; - } else { - decref(v830); - VAL v840 = MKI64(0LL /* None */); - x838 = v840; - x837 = v817; - x836 = v802; - x835 = v801; - x834 = v800; - x833 = v804; - x832 = v803; - } - VAL x841; - VAL x842; - VAL x843; - VAL x844; - VAL x845; - VAL x846; - VAL x847; - VAL x848; - switch (get_data_tag(x838)) { - case 0LL: { // None - x848 = v820; - x847 = v818; - x846 = x837; - x845 = x836; - x844 = x835; - x843 = x834; - x842 = x833; - x841 = x832; - } break; - default: { - decref(v820); - decref(v818); - VAL v849 = MKI64(0LL /* Nil */); - x848 = v849; - x847 = x838; - x846 = x837; - x845 = x836; - x844 = x835; - x843 = x834; - x842 = x833; - x841 = x832; - } break; - } - int64_t v850 = 1LL /* True */; - x829 = v850; - x828 = x848; - x827 = x847; - x826 = x846; - x825 = x845; - x824 = x844; - x823 = x843; - x822 = x842; - x821 = x841; - } break; - case 0LL: { // None - int64_t v851 = 0LL /* False */; - x829 = v851; - x828 = v820; - x827 = v818; - x826 = v817; - x825 = v802; - x824 = v801; - x823 = v800; - x822 = v804; - x821 = v803; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v852 = (x821); - VAL v853 = (x822); - VAL v854 = x823; - VAL v855 = x824; - VAL v856 = x825; - VAL v857 = x826; - VAL v858 = x827; - VAL v859 = x828; - int64_t v860 = x829; - while (((bool)v860)) { - VAL v861 = (v852); - VAL v862 = (v853); - VAL v863 = v854; - VAL v864 = v855; - VAL v865 = v856; - VAL v866 = v857; - VAL v867 = v858; - VAL v868 = v859; - VAL v869; - VAL v870; - mw_std_list_List_1_uncons(v868, &v869, &v870); - VAL x871; - VAL x872; - VAL x873; - VAL x874; - VAL x875; - VAL x876; - VAL x877; - VAL x878; - int64_t x879; - switch (get_data_tag(v869)) { - case 1LL: { // Some - VAL v880 = mtp_std_maybe_Maybe_1_Some(v869); - incref(v880); - incref(v866); - int64_t v881 = mw_mirth_name_Namespace_ZEqualZEqual(v866, v880); - VAL x882; - VAL x883; - VAL x884; - VAL x885; - VAL x886; - VAL x887; - VAL x888; - if (((bool)v881)) { - VAL v889 = mtw_std_maybe_Maybe_1_Some(v880); - x888 = v889; - x887 = v866; - x886 = v865; - x885 = v864; - x884 = v863; - x883 = v862; - x882 = v861; - } else { - decref(v880); - VAL v890 = MKI64(0LL /* None */); - x888 = v890; - x887 = v866; - x886 = v865; - x885 = v864; - x884 = v863; - x883 = v862; - x882 = v861; - } - VAL x891; - VAL x892; - VAL x893; - VAL x894; - VAL x895; - VAL x896; - VAL x897; - VAL x898; - switch (get_data_tag(x888)) { - case 0LL: { // None - x898 = v870; - x897 = v867; - x896 = x887; - x895 = x886; - x894 = x885; - x893 = x884; - x892 = x883; - x891 = x882; - } break; - default: { - decref(v870); - decref(v867); - VAL v899 = MKI64(0LL /* Nil */); - x898 = v899; - x897 = x888; - x896 = x887; - x895 = x886; - x894 = x885; - x893 = x884; - x892 = x883; - x891 = x882; - } break; - } - int64_t v900 = 1LL /* True */; - x879 = v900; - x878 = x898; - x877 = x897; - x876 = x896; - x875 = x895; - x874 = x894; - x873 = x893; - x872 = x892; - x871 = x891; - } break; - case 0LL: { // None - int64_t v901 = 0LL /* False */; - x879 = v901; - x878 = v870; - x877 = v867; - x876 = v866; - x875 = v865; - x874 = v864; - x873 = v863; - x872 = v862; - x871 = v861; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v860 = x879; - v859 = x878; - v858 = x877; - v857 = x876; - v856 = x875; - v855 = x874; - v854 = x873; - v853 = x872; - v852 = x871; - } - decref(v859); - decref(v857); - int64_t v902 = mw_std_maybe_Maybe_1_someZAsk(v858); - VAL x903; - VAL x904; - VAL x905; - VAL x906; - VAL x907; - VAL x908; - if (((bool)v902)) { - VAL v909 = mtw_std_maybe_Maybe_1_Some(v817); - x908 = v909; - x907 = v853; - x906 = v852; - x905 = v856; - x904 = v855; - x903 = v854; + VAL v175 = mtp_std_maybe_Maybe_1_Some(v167); + incref(v175); + incref(v161); + int64_t v176 = mw_std_list_List_1_member_1_sp4(v175, v161); + VAL x177; + VAL x178; + VAL x179; + VAL x180; + if (((bool)v176)) { + VAL v181 = mtw_std_maybe_Maybe_1_Some(v175); + x180 = v181; + x179 = v163; + x178 = v162; + x177 = v161; } else { - decref(v817); - VAL v910 = MKI64(0LL /* None */); - x908 = v910; - x907 = v853; - x906 = v852; - x905 = v856; - x904 = v855; - x903 = v854; + decref(v175); + VAL v182 = MKI64(0LL /* None */); + x180 = v182; + x179 = v163; + x178 = v162; + x177 = v161; } - VAL x911; - VAL x912; - VAL x913; - VAL x914; - VAL x915; - VAL x916; - VAL x917; - switch (get_data_tag(x908)) { + VAL x183; + VAL x184; + VAL x185; + VAL x186; + VAL x187; + switch (get_data_tag(x180)) { case 0LL: { // None - x917 = v808; - x916 = v805; - x915 = x907; - x914 = x906; - x913 = x905; - x912 = x904; - x911 = x903; + x187 = v168; + x186 = v164; + x185 = x179; + x184 = x178; + x183 = x177; } break; default: { - decref(v808); - decref(v805); - VAL v918 = MKI64(0LL /* Nil */); - x917 = v918; - x916 = x908; - x915 = x907; - x914 = x906; - x913 = x905; - x912 = x904; - x911 = x903; + decref(v168); + decref(v164); + VAL v188 = MKI64(0LL /* Nil */); + x187 = v188; + x186 = x180; + x185 = x179; + x184 = x178; + x183 = x177; } break; } - int64_t v919 = 1LL /* True */; - x816 = v919; - x815 = x917; - x814 = x916; - x813 = x915; - x812 = x914; - x811 = x913; - x810 = x912; - x809 = x911; + int64_t v189 = 1LL /* True */; + x174 = v189; + x173 = x187; + x172 = x186; + x171 = x185; + x170 = x184; + x169 = x183; } break; case 0LL: { // None - int64_t v920 = 0LL /* False */; - x816 = v920; - x815 = v808; - x814 = v805; - x813 = v804; - x812 = v803; - x811 = v802; - x810 = v801; - x809 = v800; + int64_t v190 = 0LL /* False */; + x174 = v190; + x173 = v168; + x172 = v164; + x171 = v163; + x170 = v162; + x169 = v161; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v799 = x816; - v798 = x815; - v797 = x814; - v796 = x813; - v795 = x812; - v794 = x811; - v793 = x810; - v792 = x809; + v160 = x174; + v159 = x174; + v158 = x173; + v157 = x172; + v156 = x171; + v155 = x170; + v154 = x169; } - decref(v798); - int64_t v921 = mw_std_maybe_Maybe_1_someZAsk(v797); - VAL x922; - VAL x923; - VAL x924; - VAL x925; - VAL x926; - if (((bool)v921)) { - VAL v927 = mtw_std_either_Either_2_Right(v794); - x926 = v927; - x925 = v796; - x924 = v793; - x923 = v795; - x922 = v792; + decref(v158); + int64_t v191 = get_data_tag(v157); + decref(v157); + int64_t v192 = 1LL; + bool v193 = (v191 == v192); + VAL x194; + VAL x195; + VAL x196; + VAL x197; + VAL x198; + if (v193) { + VAL v199 = mtw_std_either_Either_2_Right(v156); + x198 = v199; + x197 = v150; + x196 = v149; + x195 = v155; + x194 = v154; } else { - incref(v792); - int64_t v928 = mw_std_list_List_1_emptyZAsk(v792); - VAL x929; - VAL x930; - VAL x931; - VAL x932; - VAL x933; - if (((bool)v928)) { - VAL v934 = mtw_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(v794); - x933 = v934; - x932 = v793; - x931 = v792; - x930 = v796; - x929 = v795; + incref(v154); + int64_t v200 = mw_std_list_List_1_emptyZAsk(v154); + VAL x201; + VAL x202; + VAL x203; + VAL x204; + VAL x205; + if (((bool)v200)) { + VAL v206 = mtw_mirth_elab_RejectedDef_RDz_METHODz_NOTz_AVAILABLE(v156); + x205 = v206; + x204 = v155; + x203 = v154; + x202 = v150; + x201 = v149; } else { - VAL v935 = mtw_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(v794); - x933 = v935; - x932 = v793; - x931 = v792; - x930 = v796; - x929 = v795; + VAL v207 = mtw_mirth_elab_RejectedDef_RDz_METHODz_WRONGz_TYPE(v156); + x205 = v207; + x204 = v155; + x203 = v154; + x202 = v150; + x201 = v149; } - VAL v936 = mtw_std_either_Either_2_Left(x933); - x926 = v936; - x925 = x930; - x924 = x932; - x923 = x929; - x922 = x931; + VAL v208 = mtw_std_either_Either_2_Left(x205); + x198 = v208; + x197 = x202; + x196 = x201; + x195 = x204; + x194 = x203; } - VAL x937; - VAL x938; - VAL x939; - VAL x940; - VAL x941; - VAL x942; - switch (get_data_tag(x926)) { + VAL x209; + VAL x210; + VAL x211; + VAL x212; + VAL x213; + VAL x214; + switch (get_data_tag(x198)) { case 0LL: { // Left - VAL v943 = mtp_std_either_Either_2_Left(x926); - VAL v944 = mtw_std_list_List_1_Cons(v943, v658); - x942 = v659; - x941 = v944; - x940 = x925; - x939 = x924; - x938 = x923; - x937 = x922; + VAL v215 = mtp_std_either_Either_2_Left(x198); + VAL v216 = mtw_std_list_List_1_Cons(v215, v133); + x214 = v134; + x213 = v216; + x212 = x197; + x211 = x196; + x210 = x195; + x209 = x194; } break; case 1LL: { // Right - VAL v945 = mtp_std_either_Either_2_Right(x926); - VAL v946 = mtw_std_list_List_1_Cons(v945, v659); - x942 = v946; - x941 = v658; - x940 = x925; - x939 = x924; - x938 = x923; - x937 = x922; + VAL v217 = mtp_std_either_Either_2_Right(x198); + VAL v218 = mtw_std_list_List_1_Cons(v217, v134); + x214 = v218; + x213 = v133; + x212 = x197; + x211 = x196; + x210 = x195; + x209 = x194; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v947 = 1LL /* True */; - x670 = v947; - x669 = v662; - x668 = x942; - x667 = x941; - x666 = x940; - x665 = x939; - x664 = x938; - x663 = x937; + int64_t v219 = 1LL /* True */; + x144 = v219; + x143 = v146; + x142 = x214; + x141 = x213; + x140 = x212; + x139 = x211; + x138 = x210; + x137 = x209; } break; - case 0LL: { // None - int64_t v948 = 0LL /* False */; - x670 = v948; - x669 = v662; - x668 = v659; - x667 = v658; - x666 = v657; - x665 = v656; - x664 = v655; - x663 = v654; + case 0LL: { // Nil + VAL v220 = MKI64(0LL /* Nil */); + int64_t v221 = 0LL /* False */; + x144 = v221; + x143 = v220; + x142 = v134; + x141 = v133; + x140 = v131; + x139 = v130; + x138 = v132; + x137 = v129; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v653 = x670; - v652 = x669; - v651 = x668; - v650 = x667; - v649 = x666; - v648 = x665; - v647 = x664; - v646 = x663; + v128 = x144; + v127 = x144; + v126 = x143; + v125 = x142; + v124 = x141; + v123 = x138; + v122 = x140; + v121 = x139; + v120 = x137; } - decref(v652); - VAL v949 = mw_std_list_List_1_reverse(v650); - VAL v950 = mw_std_list_List_1_reverse(v651); - VAL v951 = VVAL(VTUP(v649)->cells[5]); - incref(v951); - VAL v952 = mw_std_list_List_1_cat(v949, v951); - VAL v953 = VTUP(v649)->cells[5]; - decref(v953); - VTUP(v649)->cells[5] = v952; - VAL v954 = VTUP(v649)->cells[4]; - decref(v954); - VTUP(v649)->cells[4] = v950; - x354 = v649; - x353 = v648; - x352 = v647; - x351 = v646; + decref(v126); + VAL v222 = mw_std_list_List_1_reverse(v124); + VAL v223 = mw_std_list_List_1_reverse(v125); + VAL v224 = VVAL(VTUP(v122)->cells[5]); + incref(v224); + VAL v225 = mw_std_list_List_1_cat(v222, v224); + VAL v226 = VTUP(v122)->cells[5]; + decref(v226); + VTUP(v122)->cells[5] = v225; + VAL v227 = VTUP(v122)->cells[4]; + decref(v227); + VTUP(v122)->cells[4] = v223; + x115 = v122; + x114 = v123; + x113 = v121; + x112 = v120; } else { - VAL v955 = VVAL(VTUP(x345)->cells[4]); - incref(v955); - VAL v956 = MKI64(0LL /* Nil */); - VAL v957 = MKI64(0LL /* Nil */); - VAL v958; - VAL v959; - mw_std_list_List_1_uncons(v955, &v958, &v959); - VAL x960; - VAL x961; - VAL x962; - VAL x963; - VAL x964; - VAL x965; - VAL x966; - int64_t x967; - switch (get_data_tag(v958)) { - case 1LL: { // Some - VAL v968 = mtp_std_maybe_Maybe_1_Some(v958); - incref(x346); - incref(v968); - VAL v969; - VAL v970; - mw_mirth_def_Def_qnameZ_hard(x344, v968, &v969, &v970); - VAL v971; - VAL v972; - VAL v973; - mw_mirth_name_QName_climbZ_upZ_dnameZAsk(v969, x345, x346, v970, &v971, &v972, &v973); - VAL v974 = MKI64(0LL /* None */); - VAL v975; - VAL v976; - mw_std_list_List_1_uncons(v973, &v975, &v976); - VAL x977; - VAL x978; - VAL x979; - VAL x980; - VAL x981; - VAL x982; - VAL x983; - int64_t x984; - switch (get_data_tag(v975)) { - case 1LL: { // Some - VAL v985 = mtp_std_maybe_Maybe_1_Some(v975); - incref(v985); - uint64_t v986 = VU64(VTUP(v972)->cells[2]); - VAL v987; - int64_t v988; - mw_mirth_elab_namespaceZ_isZ_importedZ_atZ_tokenZAsk(v971, v986, v985, &v987, &v988); - VAL x989; - VAL x990; - VAL x991; - VAL x992; - VAL x993; - VAL x994; - if (((bool)v988)) { - VAL v995 = mtw_std_maybe_Maybe_1_Some(v985); - x994 = v995; - x993 = v972; - x992 = v987; - x991 = v968; - x990 = x346; - x989 = x343; - } else { - decref(v985); - VAL v996 = MKI64(0LL /* None */); - x994 = v996; - x993 = v972; - x992 = v987; - x991 = v968; - x990 = x346; - x989 = x343; - } - VAL x997; - VAL x998; - VAL x999; - VAL x1000; - VAL x1001; - VAL x1002; - VAL x1003; - switch (get_data_tag(x994)) { - case 0LL: { // None - x1003 = v976; - x1002 = v974; - x1001 = x993; - x1000 = x992; - x999 = x991; - x998 = x990; - x997 = x989; - } break; - default: { - decref(v976); - decref(v974); - VAL v1004 = MKI64(0LL /* Nil */); - x1003 = v1004; - x1002 = x994; - x1001 = x993; - x1000 = x992; - x999 = x991; - x998 = x990; - x997 = x989; - } break; - } - int64_t v1005 = 1LL /* True */; - x984 = v1005; - x983 = x1003; - x982 = x1002; - x981 = x1001; - x980 = x1000; - x979 = x999; - x978 = x998; - x977 = x997; - } break; - case 0LL: { // None - int64_t v1006 = 0LL /* False */; - x984 = v1006; - x983 = v976; - x982 = v974; - x981 = v972; - x980 = v971; - x979 = v968; - x978 = x346; - x977 = x343; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v1007 = x977; - VAL v1008 = x978; - VAL v1009 = x979; - VAL v1010 = (x980); - VAL v1011 = (x981); - VAL v1012 = x982; - VAL v1013 = x983; - int64_t v1014 = x984; - while (((bool)v1014)) { - VAL v1015 = v1007; - VAL v1016 = v1008; - VAL v1017 = v1009; - VAL v1018 = (v1010); - VAL v1019 = (v1011); - VAL v1020 = v1012; - VAL v1021 = v1013; - VAL v1022; - VAL v1023; - mw_std_list_List_1_uncons(v1021, &v1022, &v1023); - VAL x1024; - VAL x1025; - VAL x1026; - VAL x1027; - VAL x1028; - VAL x1029; - VAL x1030; - int64_t x1031; - switch (get_data_tag(v1022)) { - case 1LL: { // Some - VAL v1032 = mtp_std_maybe_Maybe_1_Some(v1022); - incref(v1032); - uint64_t v1033 = VU64(VTUP(v1019)->cells[2]); - VAL v1034; - int64_t v1035; - mw_mirth_elab_namespaceZ_isZ_importedZ_atZ_tokenZAsk(v1018, v1033, v1032, &v1034, &v1035); - VAL x1036; - VAL x1037; - VAL x1038; - VAL x1039; - VAL x1040; - VAL x1041; - if (((bool)v1035)) { - VAL v1042 = mtw_std_maybe_Maybe_1_Some(v1032); - x1041 = v1042; - x1040 = v1019; - x1039 = v1034; - x1038 = v1017; - x1037 = v1016; - x1036 = v1015; - } else { - decref(v1032); - VAL v1043 = MKI64(0LL /* None */); - x1041 = v1043; - x1040 = v1019; - x1039 = v1034; - x1038 = v1017; - x1037 = v1016; - x1036 = v1015; - } - VAL x1044; - VAL x1045; - VAL x1046; - VAL x1047; - VAL x1048; - VAL x1049; - VAL x1050; - switch (get_data_tag(x1041)) { - case 0LL: { // None - x1050 = v1023; - x1049 = v1020; - x1048 = x1040; - x1047 = x1039; - x1046 = x1038; - x1045 = x1037; - x1044 = x1036; - } break; - default: { - decref(v1023); - decref(v1020); - VAL v1051 = MKI64(0LL /* Nil */); - x1050 = v1051; - x1049 = x1041; - x1048 = x1040; - x1047 = x1039; - x1046 = x1038; - x1045 = x1037; - x1044 = x1036; - } break; - } - int64_t v1052 = 1LL /* True */; - x1031 = v1052; - x1030 = x1050; - x1029 = x1049; - x1028 = x1048; - x1027 = x1047; - x1026 = x1046; - x1025 = x1045; - x1024 = x1044; - } break; - case 0LL: { // None - int64_t v1053 = 0LL /* False */; - x1031 = v1053; - x1030 = v1023; - x1029 = v1020; - x1028 = v1019; - x1027 = v1018; - x1026 = v1017; - x1025 = v1016; - x1024 = v1015; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v1014 = x1031; - v1013 = x1030; - v1012 = x1029; - v1011 = x1028; - v1010 = x1027; - v1009 = x1026; - v1008 = x1025; - v1007 = x1024; - } - decref(v1013); - int64_t v1054 = mw_std_maybe_Maybe_1_someZAsk(v1012); - VAL x1055; - VAL x1056; - VAL x1057; - VAL x1058; - VAL x1059; - if (((bool)v1054)) { - VAL v1060 = mtw_std_either_Either_2_Right(v1009); - x1059 = v1060; - x1058 = v1011; - x1057 = v1008; - x1056 = v1010; - x1055 = v1007; - } else { - VAL v1061 = mtw_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(v1009); - VAL v1062 = mtw_std_either_Either_2_Left(v1061); - x1059 = v1062; - x1058 = v1011; - x1057 = v1008; - x1056 = v1010; - x1055 = v1007; - } - VAL x1063; - VAL x1064; - VAL x1065; - VAL x1066; - VAL x1067; - VAL x1068; - switch (get_data_tag(x1059)) { - case 0LL: { // Left - VAL v1069 = mtp_std_either_Either_2_Left(x1059); - VAL v1070 = mtw_std_list_List_1_Cons(v1069, v956); - x1068 = v957; - x1067 = v1070; - x1066 = x1058; - x1065 = x1057; - x1064 = x1056; - x1063 = x1055; - } break; - case 1LL: { // Right - VAL v1071 = mtp_std_either_Either_2_Right(x1059); - VAL v1072 = mtw_std_list_List_1_Cons(v1071, v957); - x1068 = v1072; - x1067 = v956; - x1066 = x1058; - x1065 = x1057; - x1064 = x1056; - x1063 = x1055; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v1073 = 1LL /* True */; - x967 = v1073; - x966 = v959; - x965 = x1068; - x964 = x1067; - x963 = x1066; - x962 = x1065; - x961 = x1064; - x960 = x1063; - } break; - case 0LL: { // None - int64_t v1074 = 0LL /* False */; - x967 = v1074; - x966 = v959; - x965 = v957; - x964 = v956; - x963 = x345; - x962 = x346; - x961 = x344; - x960 = x343; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v1075 = x960; - VAL v1076 = (x961); - VAL v1077 = x962; - VAL v1078 = (x963); - VAL v1079 = x964; - VAL v1080 = x965; - VAL v1081 = x966; - int64_t v1082 = x967; - while (((bool)v1082)) { - VAL v1083 = v1075; - VAL v1084 = (v1076); - VAL v1085 = v1077; - VAL v1086 = (v1078); - VAL v1087 = v1079; - VAL v1088 = v1080; - VAL v1089 = v1081; - VAL v1090; - VAL v1091; - mw_std_list_List_1_uncons(v1089, &v1090, &v1091); - VAL x1092; - VAL x1093; - VAL x1094; - VAL x1095; - VAL x1096; - VAL x1097; - VAL x1098; - int64_t x1099; - switch (get_data_tag(v1090)) { - case 1LL: { // Some - VAL v1100 = mtp_std_maybe_Maybe_1_Some(v1090); - incref(v1085); - incref(v1100); - VAL v1101; - VAL v1102; - mw_mirth_def_Def_qnameZ_hard(v1084, v1100, &v1101, &v1102); - VAL v1103; - VAL v1104; - VAL v1105; - mw_mirth_name_QName_climbZ_upZ_dnameZAsk(v1101, v1086, v1085, v1102, &v1103, &v1104, &v1105); - VAL v1106 = MKI64(0LL /* None */); - VAL v1107; - VAL v1108; - mw_std_list_List_1_uncons(v1105, &v1107, &v1108); - VAL x1109; - VAL x1110; - VAL x1111; - VAL x1112; - VAL x1113; - VAL x1114; - VAL x1115; - int64_t x1116; - switch (get_data_tag(v1107)) { - case 1LL: { // Some - VAL v1117 = mtp_std_maybe_Maybe_1_Some(v1107); - incref(v1117); - uint64_t v1118 = VU64(VTUP(v1104)->cells[2]); - VAL v1119; - int64_t v1120; - mw_mirth_elab_namespaceZ_isZ_importedZ_atZ_tokenZAsk(v1103, v1118, v1117, &v1119, &v1120); - VAL x1121; - VAL x1122; - VAL x1123; - VAL x1124; - VAL x1125; - VAL x1126; - if (((bool)v1120)) { - VAL v1127 = mtw_std_maybe_Maybe_1_Some(v1117); - x1126 = v1127; - x1125 = v1104; - x1124 = v1119; - x1123 = v1100; - x1122 = v1085; - x1121 = v1083; - } else { - decref(v1117); - VAL v1128 = MKI64(0LL /* None */); - x1126 = v1128; - x1125 = v1104; - x1124 = v1119; - x1123 = v1100; - x1122 = v1085; - x1121 = v1083; - } - VAL x1129; - VAL x1130; - VAL x1131; - VAL x1132; - VAL x1133; - VAL x1134; - VAL x1135; - switch (get_data_tag(x1126)) { - case 0LL: { // None - x1135 = v1108; - x1134 = v1106; - x1133 = x1125; - x1132 = x1124; - x1131 = x1123; - x1130 = x1122; - x1129 = x1121; - } break; - default: { - decref(v1108); - decref(v1106); - VAL v1136 = MKI64(0LL /* Nil */); - x1135 = v1136; - x1134 = x1126; - x1133 = x1125; - x1132 = x1124; - x1131 = x1123; - x1130 = x1122; - x1129 = x1121; - } break; - } - int64_t v1137 = 1LL /* True */; - x1116 = v1137; - x1115 = x1135; - x1114 = x1134; - x1113 = x1133; - x1112 = x1132; - x1111 = x1131; - x1110 = x1130; - x1109 = x1129; - } break; - case 0LL: { // None - int64_t v1138 = 0LL /* False */; - x1116 = v1138; - x1115 = v1108; - x1114 = v1106; - x1113 = v1104; - x1112 = v1103; - x1111 = v1100; - x1110 = v1085; - x1109 = v1083; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v1139 = x1109; - VAL v1140 = x1110; - VAL v1141 = x1111; - VAL v1142 = (x1112); - VAL v1143 = (x1113); - VAL v1144 = x1114; - VAL v1145 = x1115; - int64_t v1146 = x1116; - while (((bool)v1146)) { - VAL v1147 = v1139; - VAL v1148 = v1140; - VAL v1149 = v1141; - VAL v1150 = (v1142); - VAL v1151 = (v1143); - VAL v1152 = v1144; - VAL v1153 = v1145; - VAL v1154; - VAL v1155; - mw_std_list_List_1_uncons(v1153, &v1154, &v1155); - VAL x1156; - VAL x1157; - VAL x1158; - VAL x1159; - VAL x1160; - VAL x1161; - VAL x1162; - int64_t x1163; - switch (get_data_tag(v1154)) { + VAL v228 = VVAL(VTUP(x107)->cells[4]); + incref(v228); + VAL v229 = MKI64(0LL /* Nil */); + VAL v230 = MKI64(0LL /* Nil */); + int64_t v231 = 1LL /* True */; + VAL v232 = x2; + VAL v233 = x107; + VAL v234 = v105; + VAL v235 = v229; + VAL v236 = v230; + VAL v237 = v228; + int64_t v238 = v231; + int64_t v239 = v231; + while (((bool)v239)) { + VAL v240 = v232; + VAL v241 = v233; + VAL v242 = v234; + VAL v243 = v235; + VAL v244 = v236; + VAL v245 = v237; + int64_t v246 = v238; + VAL x247; + VAL x248; + VAL x249; + VAL x250; + VAL x251; + VAL x252; + int64_t x253; + switch (get_data_tag(v245)) { + case 1LL: { // Cons + VAL v254; + VAL v255; + mtp_std_list_List_1_Cons(v245, &v254, &v255); + incref(v242); + incref(v254); + VAL v256; + VAL v257; + mw_mirth_def_Def_qnameZ_hard(v240, v254, &v256, &v257); + VAL v258; + VAL v259; + VAL v260; + mw_mirth_name_QName_climbZ_upZ_dnameZAsk(v256, v241, v242, v257, &v258, &v259, &v260); + VAL v261 = MKI64(0LL /* None */); + int64_t v262 = 1LL /* True */; + VAL v263 = v258; + VAL v264 = v259; + VAL v265 = v261; + VAL v266 = v260; + int64_t v267 = v262; + int64_t v268 = v262; + while (((bool)v268)) { + VAL v269 = v263; + VAL v270 = v264; + VAL v271 = v265; + VAL v272 = v266; + int64_t v273 = v267; + VAL v274; + VAL v275; + mw_std_list_List_1_uncons(v272, &v274, &v275); + VAL x276; + VAL x277; + VAL x278; + VAL x279; + int64_t x280; + switch (get_data_tag(v274)) { case 1LL: { // Some - VAL v1164 = mtp_std_maybe_Maybe_1_Some(v1154); - incref(v1164); - uint64_t v1165 = VU64(VTUP(v1151)->cells[2]); - VAL v1166; - int64_t v1167; - mw_mirth_elab_namespaceZ_isZ_importedZ_atZ_tokenZAsk(v1150, v1165, v1164, &v1166, &v1167); - VAL x1168; - VAL x1169; - VAL x1170; - VAL x1171; - VAL x1172; - VAL x1173; - if (((bool)v1167)) { - VAL v1174 = mtw_std_maybe_Maybe_1_Some(v1164); - x1173 = v1174; - x1172 = v1151; - x1171 = v1166; - x1170 = v1149; - x1169 = v1148; - x1168 = v1147; + VAL v281 = mtp_std_maybe_Maybe_1_Some(v274); + incref(v281); + uint64_t v282 = VU64(VTUP(v270)->cells[2]); + VAL v283; + int64_t v284; + mw_mirth_elab_namespaceZ_isZ_importedZ_atZ_tokenZAsk(v269, v282, v281, &v283, &v284); + VAL x285; + VAL x286; + VAL x287; + if (((bool)v284)) { + VAL v288 = mtw_std_maybe_Maybe_1_Some(v281); + x287 = v288; + x286 = v270; + x285 = v283; } else { - decref(v1164); - VAL v1175 = MKI64(0LL /* None */); - x1173 = v1175; - x1172 = v1151; - x1171 = v1166; - x1170 = v1149; - x1169 = v1148; - x1168 = v1147; + decref(v281); + VAL v289 = MKI64(0LL /* None */); + x287 = v289; + x286 = v270; + x285 = v283; } - VAL x1176; - VAL x1177; - VAL x1178; - VAL x1179; - VAL x1180; - VAL x1181; - VAL x1182; - switch (get_data_tag(x1173)) { + VAL x290; + VAL x291; + VAL x292; + VAL x293; + switch (get_data_tag(x287)) { case 0LL: { // None - x1182 = v1155; - x1181 = v1152; - x1180 = x1172; - x1179 = x1171; - x1178 = x1170; - x1177 = x1169; - x1176 = x1168; + x293 = v275; + x292 = v271; + x291 = x286; + x290 = x285; } break; default: { - decref(v1155); - decref(v1152); - VAL v1183 = MKI64(0LL /* Nil */); - x1182 = v1183; - x1181 = x1173; - x1180 = x1172; - x1179 = x1171; - x1178 = x1170; - x1177 = x1169; - x1176 = x1168; + decref(v275); + decref(v271); + VAL v294 = MKI64(0LL /* Nil */); + x293 = v294; + x292 = x287; + x291 = x286; + x290 = x285; } break; } - int64_t v1184 = 1LL /* True */; - x1163 = v1184; - x1162 = x1182; - x1161 = x1181; - x1160 = x1180; - x1159 = x1179; - x1158 = x1178; - x1157 = x1177; - x1156 = x1176; + int64_t v295 = 1LL /* True */; + x280 = v295; + x279 = x293; + x278 = x292; + x277 = x291; + x276 = x290; } break; case 0LL: { // None - int64_t v1185 = 0LL /* False */; - x1163 = v1185; - x1162 = v1155; - x1161 = v1152; - x1160 = v1151; - x1159 = v1150; - x1158 = v1149; - x1157 = v1148; - x1156 = v1147; + int64_t v296 = 0LL /* False */; + x280 = v296; + x279 = v275; + x278 = v271; + x277 = v270; + x276 = v269; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v1146 = x1163; - v1145 = x1162; - v1144 = x1161; - v1143 = x1160; - v1142 = x1159; - v1141 = x1158; - v1140 = x1157; - v1139 = x1156; + v268 = x280; + v267 = x280; + v266 = x279; + v265 = x278; + v264 = x277; + v263 = x276; } - decref(v1145); - int64_t v1186 = mw_std_maybe_Maybe_1_someZAsk(v1144); - VAL x1187; - VAL x1188; - VAL x1189; - VAL x1190; - VAL x1191; - if (((bool)v1186)) { - VAL v1192 = mtw_std_either_Either_2_Right(v1141); - x1191 = v1192; - x1190 = v1143; - x1189 = v1140; - x1188 = v1142; - x1187 = v1139; + decref(v266); + int64_t v297 = get_data_tag(v265); + decref(v265); + int64_t v298 = 1LL; + bool v299 = (v297 == v298); + VAL x300; + VAL x301; + VAL x302; + VAL x303; + if (v299) { + VAL v304 = mtw_std_either_Either_2_Right(v254); + x303 = v304; + x302 = v264; + x301 = v263; + x300 = v242; } else { - VAL v1193 = mtw_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(v1141); - VAL v1194 = mtw_std_either_Either_2_Left(v1193); - x1191 = v1194; - x1190 = v1143; - x1189 = v1140; - x1188 = v1142; - x1187 = v1139; + VAL v305 = mtw_mirth_elab_RejectedDef_RDz_NOTz_IMPORTED(v254); + VAL v306 = mtw_std_either_Either_2_Left(v305); + x303 = v306; + x302 = v264; + x301 = v263; + x300 = v242; } - VAL x1195; - VAL x1196; - VAL x1197; - VAL x1198; - VAL x1199; - VAL x1200; - switch (get_data_tag(x1191)) { + VAL x307; + VAL x308; + VAL x309; + VAL x310; + VAL x311; + switch (get_data_tag(x303)) { case 0LL: { // Left - VAL v1201 = mtp_std_either_Either_2_Left(x1191); - VAL v1202 = mtw_std_list_List_1_Cons(v1201, v1087); - x1200 = v1088; - x1199 = v1202; - x1198 = x1190; - x1197 = x1189; - x1196 = x1188; - x1195 = x1187; + VAL v312 = mtp_std_either_Either_2_Left(x303); + VAL v313 = mtw_std_list_List_1_Cons(v312, v243); + x311 = v244; + x310 = v313; + x309 = x302; + x308 = x301; + x307 = x300; } break; case 1LL: { // Right - VAL v1203 = mtp_std_either_Either_2_Right(x1191); - VAL v1204 = mtw_std_list_List_1_Cons(v1203, v1088); - x1200 = v1204; - x1199 = v1087; - x1198 = x1190; - x1197 = x1189; - x1196 = x1188; - x1195 = x1187; + VAL v314 = mtp_std_either_Either_2_Right(x303); + VAL v315 = mtw_std_list_List_1_Cons(v314, v244); + x311 = v315; + x310 = v243; + x309 = x302; + x308 = x301; + x307 = x300; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v1205 = 1LL /* True */; - x1099 = v1205; - x1098 = v1091; - x1097 = x1200; - x1096 = x1199; - x1095 = x1198; - x1094 = x1197; - x1093 = x1196; - x1092 = x1195; + int64_t v316 = 1LL /* True */; + x253 = v316; + x252 = v255; + x251 = x311; + x250 = x310; + x249 = x309; + x248 = x308; + x247 = x307; } break; - case 0LL: { // None - int64_t v1206 = 0LL /* False */; - x1099 = v1206; - x1098 = v1091; - x1097 = v1088; - x1096 = v1087; - x1095 = v1086; - x1094 = v1085; - x1093 = v1084; - x1092 = v1083; + case 0LL: { // Nil + VAL v317 = MKI64(0LL /* Nil */); + int64_t v318 = 0LL /* False */; + x253 = v318; + x252 = v317; + x251 = v244; + x250 = v243; + x249 = v241; + x248 = v240; + x247 = v242; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v1082 = x1099; - v1081 = x1098; - v1080 = x1097; - v1079 = x1096; - v1078 = x1095; - v1077 = x1094; - v1076 = x1093; - v1075 = x1092; + v239 = x253; + v238 = x253; + v237 = x252; + v236 = x251; + v235 = x250; + v234 = x247; + v233 = x249; + v232 = x248; } - decref(v1081); - VAL v1207 = mw_std_list_List_1_reverse(v1079); - VAL v1208 = mw_std_list_List_1_reverse(v1080); - VAL v1209 = VVAL(VTUP(v1078)->cells[5]); - incref(v1209); - VAL v1210 = mw_std_list_List_1_cat(v1207, v1209); - VAL v1211 = VTUP(v1078)->cells[5]; - decref(v1211); - VTUP(v1078)->cells[5] = v1210; - VAL v1212 = VTUP(v1078)->cells[4]; - decref(v1212); - VTUP(v1078)->cells[4] = v1208; - x354 = v1078; - x353 = v1077; - x352 = v1076; - x351 = v1075; - } - decref(x353); - x9 = x354; - x8 = x352; - x7 = x351; + decref(v237); + VAL v319 = mw_std_list_List_1_reverse(v235); + VAL v320 = mw_std_list_List_1_reverse(v236); + VAL v321 = VVAL(VTUP(v233)->cells[5]); + incref(v321); + VAL v322 = mw_std_list_List_1_cat(v319, v321); + VAL v323 = VTUP(v233)->cells[5]; + decref(v323); + VTUP(v233)->cells[5] = v322; + VAL v324 = VTUP(v233)->cells[4]; + decref(v324); + VTUP(v233)->cells[4] = v320; + x115 = v233; + x114 = v234; + x113 = v232; + x112 = x1; + } + decref(x114); + x9 = x115; + x8 = x113; + x7 = x112; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -47285,23 +35785,26 @@ static void mw_mirth_elab_defZ_isZ_importedZ_atZ_tokenZAsk (VAL x1, uint64_t x2, int64_t x19; if (((bool)v17)) { VAL v20 = mw_mirth_def_Def_tagZAsk(x3); - int64_t v21 = mw_std_maybe_Maybe_1_ZToBool(v20); - x19 = v21; + int64_t v21 = get_data_tag(v20); + decref(v20); + int64_t v22 = 1LL; + bool v23 = (v21 == v22); + x19 = ((int64_t)v23); x18 = v6; } else { decref(x3); - int64_t v22 = 0LL /* False */; - x19 = v22; + int64_t v24 = 0LL /* False */; + x19 = v24; x18 = v6; } x10 = x19; x9 = x18; } break; case 4LL: { // NAMESPACE_WORD - uint64_t v23 = mtp_mirth_name_Namespace_NAMESPACEz_WORD(v8); + uint64_t v25 = mtp_mirth_name_Namespace_NAMESPACEz_WORD(v8); decref(x3); - int64_t v24 = 0LL /* False */; - x10 = v24; + int64_t v26 = 0LL /* False */; + x10 = v26; x9 = v6; } break; default: { @@ -47429,282 +35932,152 @@ static void mw_mirth_name_QName_climbZ_upZ_nameZAsk (VAL x1, uint64_t x2, VAL x3 x8 = x1; } VAL v16 = mw_mirth_name_Name_defs(x9); - VAL v17; - VAL v18; - mw_std_list_List_1_uncons(v16, &v17, &v18); - VAL x19; - VAL x20; - VAL x21; - VAL x22; - int64_t x23; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v24 = mtp_std_maybe_Maybe_1_Some(v17); - VAL x25; - VAL x26; - VAL x27; - switch (get_data_tag(v24)) { - case 0LL: { // DefAlias - uint64_t v28 = mtp_mirth_def_Def_DefAlias(v24); - VAL v29; - VAL v30; - mw_mirth_alias_Alias_target(x8, v28, &v29, &v30); - VAL v31; - VAL v32; - mw_mirth_def_Def_qnameZ_hard(v29, v30, &v31, &v32); - incref(x10); - int64_t v33 = mw_mirth_name_QName_ZEqualZEqual(v32, x10); - VAL x34; - VAL x35; - VAL x36; - if (((bool)v33)) { - VAL v37; - VAL v38; - mw_mirth_alias_Alias_namespaceZ_hard(v31, v28, &v37, &v38); - VAL v39 = mtw_std_list_List_1_Cons(v38, x11); - x36 = v39; - x35 = v37; - x34 = x10; - } else { - x36 = x11; - x35 = v31; - x34 = x10; - } - x27 = x36; - x26 = x35; - x25 = x34; - } break; - case 5LL: { // DefType - uint64_t v40 = mtp_mirth_def_Def_DefType(v24); - VAL v41; - VAL v42; - mw_mirth_typedef_TypeDef_target(x8, v40, &v41, &v42); - VAL v43 = mw_mirth_type_Type_tyconZAsk(v42); - VAL x44; - VAL x45; - uint64_t x46; - VAL x47; - int64_t x48; - switch (get_data_tag(v43)) { - case 1LL: { // Some - VAL v49 = mtp_std_maybe_Maybe_1_Some(v43); - VAL v50; - VAL v51; - mw_mirth_tycon_Tycon_qnameZ_hard(v41, v49, &v50, &v51); - incref(x10); - int64_t v52 = mw_mirth_name_QName_ZEqualZEqual(v51, x10); - x48 = v52; + int64_t v17 = 1LL /* True */; + VAL v18 = x11; + VAL v19 = x10; + VAL v20 = x8; + VAL v21 = v16; + int64_t v22 = v17; + int64_t v23 = v17; + while (((bool)v23)) { + VAL v24 = v18; + VAL v25 = v19; + VAL v26 = v20; + VAL v27 = v21; + int64_t v28 = v22; + VAL x29; + VAL x30; + VAL x31; + VAL x32; + int64_t x33; + switch (get_data_tag(v27)) { + case 1LL: { // Cons + VAL v34; + VAL v35; + mtp_std_list_List_1_Cons(v27, &v34, &v35); + VAL x36; + VAL x37; + VAL x38; + switch (get_data_tag(v34)) { + case 0LL: { // DefAlias + uint64_t v39 = mtp_mirth_def_Def_DefAlias(v34); + VAL v40; + VAL v41; + mw_mirth_alias_Alias_target(v26, v39, &v40, &v41); + VAL v42; + VAL v43; + mw_mirth_def_Def_qnameZ_hard(v40, v41, &v42, &v43); + incref(v25); + int64_t v44 = mw_mirth_name_QName_ZEqualZEqual(v43, v25); + VAL x45; + VAL x46; + VAL x47; + if (((bool)v44)) { + VAL v48; + VAL v49; + mw_mirth_alias_Alias_namespaceZ_hard(v42, v39, &v48, &v49); + VAL v50 = mtw_std_list_List_1_Cons(v49, v24); x47 = v50; - x46 = v40; - x45 = x11; - x44 = x10; - } break; - case 0LL: { // None - int64_t v53 = 0LL /* False */; - x48 = v53; - x47 = v41; - x46 = v40; - x45 = x11; - x44 = x10; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + x46 = v48; + x45 = v25; + } else { + x47 = v24; + x46 = v42; + x45 = v25; } - } - VAL x54; - VAL x55; - VAL x56; - if (((bool)x48)) { - VAL v57; - VAL v58; - mw_mirth_typedef_TypeDef_namespace(x47, x46, &v57, &v58); - VAL v59 = mtw_std_list_List_1_Cons(v58, x45); - x56 = v59; - x55 = v57; - x54 = x44; - } else { - x56 = x45; - x55 = x47; - x54 = x44; - } - x27 = x56; - x26 = x55; - x25 = x54; - } break; - default: { - decref(v24); - x27 = x11; - x26 = x8; - x25 = x10; - } break; - } - int64_t v60 = 1LL /* True */; - x23 = v60; - x22 = v18; - x21 = x27; - x20 = x25; - x19 = x26; - } break; - case 0LL: { // None - int64_t v61 = 0LL /* False */; - x23 = v61; - x22 = v18; - x21 = x11; - x20 = x10; - x19 = x8; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v62 = (x19); - VAL v63 = x20; - VAL v64 = x21; - VAL v65 = x22; - int64_t v66 = x23; - while (((bool)v66)) { - VAL v67 = (v62); - VAL v68 = v63; - VAL v69 = v64; - VAL v70 = v65; - VAL v71; - VAL v72; - mw_std_list_List_1_uncons(v70, &v71, &v72); - VAL x73; - VAL x74; - VAL x75; - VAL x76; - int64_t x77; - switch (get_data_tag(v71)) { - case 1LL: { // Some - VAL v78 = mtp_std_maybe_Maybe_1_Some(v71); - VAL x79; - VAL x80; - VAL x81; - switch (get_data_tag(v78)) { - case 0LL: { // DefAlias - uint64_t v82 = mtp_mirth_def_Def_DefAlias(v78); - VAL v83; - VAL v84; - mw_mirth_alias_Alias_target(v67, v82, &v83, &v84); - VAL v85; - VAL v86; - mw_mirth_def_Def_qnameZ_hard(v83, v84, &v85, &v86); - incref(v68); - int64_t v87 = mw_mirth_name_QName_ZEqualZEqual(v86, v68); - VAL x88; - VAL x89; - VAL x90; - if (((bool)v87)) { - VAL v91; - VAL v92; - mw_mirth_alias_Alias_namespaceZ_hard(v85, v82, &v91, &v92); - VAL v93 = mtw_std_list_List_1_Cons(v92, v69); - x90 = v93; - x89 = v91; - x88 = v68; - } else { - x90 = v69; - x89 = v85; - x88 = v68; - } - x81 = x90; - x80 = x89; - x79 = x88; + x38 = x47; + x37 = x46; + x36 = x45; } break; case 5LL: { // DefType - uint64_t v94 = mtp_mirth_def_Def_DefType(v78); - VAL v95; - VAL v96; - mw_mirth_typedef_TypeDef_target(v67, v94, &v95, &v96); - VAL v97 = mw_mirth_type_Type_tyconZAsk(v96); - VAL x98; - VAL x99; - uint64_t x100; - VAL x101; - int64_t x102; - switch (get_data_tag(v97)) { + uint64_t v51 = mtp_mirth_def_Def_DefType(v34); + VAL v52; + VAL v53; + mw_mirth_typedef_TypeDef_target(v26, v51, &v52, &v53); + VAL v54 = mw_mirth_type_Type_tyconZAsk(v53); + VAL x55; + VAL x56; + int64_t x57; + switch (get_data_tag(v54)) { case 1LL: { // Some - VAL v103 = mtp_std_maybe_Maybe_1_Some(v97); - VAL v104; - VAL v105; - mw_mirth_tycon_Tycon_qnameZ_hard(v95, v103, &v104, &v105); - incref(v68); - int64_t v106 = mw_mirth_name_QName_ZEqualZEqual(v105, v68); - x102 = v106; - x101 = v104; - x100 = v94; - x99 = v69; - x98 = v68; + VAL v58 = mtp_std_maybe_Maybe_1_Some(v54); + VAL v59; + VAL v60; + mw_mirth_tycon_Tycon_qnameZ_hard(v52, v58, &v59, &v60); + incref(v25); + int64_t v61 = mw_mirth_name_QName_ZEqualZEqual(v60, v25); + x57 = v61; + x56 = v25; + x55 = v59; } break; case 0LL: { // None - int64_t v107 = 0LL /* False */; - x102 = v107; - x101 = v95; - x100 = v94; - x99 = v69; - x98 = v68; + int64_t v62 = 0LL /* False */; + x57 = v62; + x56 = v25; + x55 = v52; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x108; - VAL x109; - VAL x110; - if (((bool)x102)) { - VAL v111; - VAL v112; - mw_mirth_typedef_TypeDef_namespace(x101, x100, &v111, &v112); - VAL v113 = mtw_std_list_List_1_Cons(v112, x99); - x110 = v113; - x109 = v111; - x108 = x98; + VAL x63; + VAL x64; + VAL x65; + if (((bool)x57)) { + VAL v66; + VAL v67; + mw_mirth_typedef_TypeDef_namespace(x55, v51, &v66, &v67); + VAL v68 = mtw_std_list_List_1_Cons(v67, v24); + x65 = v68; + x64 = v66; + x63 = x56; } else { - x110 = x99; - x109 = x101; - x108 = x98; + x65 = v24; + x64 = x55; + x63 = x56; } - x81 = x110; - x80 = x109; - x79 = x108; + x38 = x65; + x37 = x64; + x36 = x63; } break; default: { - decref(v78); - x81 = v69; - x80 = v67; - x79 = v68; + decref(v34); + x38 = v24; + x37 = v26; + x36 = v25; } break; } - int64_t v114 = 1LL /* True */; - x77 = v114; - x76 = v72; - x75 = x81; - x74 = x79; - x73 = x80; + int64_t v69 = 1LL /* True */; + x33 = v69; + x32 = v35; + x31 = x38; + x30 = x37; + x29 = x36; } break; - case 0LL: { // None - int64_t v115 = 0LL /* False */; - x77 = v115; - x76 = v72; - x75 = v69; - x74 = v68; - x73 = v67; + case 0LL: { // Nil + VAL v70 = MKI64(0LL /* Nil */); + int64_t v71 = 0LL /* False */; + x33 = v71; + x32 = v70; + x31 = v24; + x30 = v26; + x29 = v25; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v66 = x77; - v65 = x76; - v64 = x75; - v63 = x74; - v62 = x73; + v23 = x33; + v22 = x33; + v21 = x32; + v20 = x30; + v19 = x29; + v18 = x31; } - decref(v65); - decref(v63); - *x5 = v64; - *x4 = v62; + decref(v21); + decref(v19); + *x5 = v18; + *x4 = v20; } static void mw_mirth_name_QName_climbZ_upZ_dnameZAsk (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6, VAL *x7) { incref(x3); @@ -47718,7 +36091,7 @@ static void mw_mirth_name_QName_climbZ_upZ_dnameZAsk (VAL x1, VAL x2, VAL x3, VA int64_t v14 = VI64(VTUP(x2)->cells[6]); VAL x15; VAL x16; - uint64_t x17; + VAL x17; VAL x18; if (((bool)v14)) { decref(v12); @@ -47728,703 +36101,183 @@ static void mw_mirth_name_QName_climbZ_upZ_dnameZAsk (VAL x1, VAL x2, VAL x3, VA VAL x21; VAL x22; VAL x23; - uint64_t x24; switch (get_data_tag(v20)) { case 1LL: { // Some - VAL v25 = mtp_std_maybe_Maybe_1_Some(v20); - x24 = VU64(v25); - x23 = v19; + VAL v24 = mtp_std_maybe_Maybe_1_Some(v20); + x23 = v24; x22 = x2; x21 = x1; } break; case 0LL: { // None - uint64_t v26 = VU64(VTUP(x2)->cells[2]); - STR* v27; - STRLIT(v27, "Error, expected a namespace in QName.climb-up-dname?", 52); - push_value(v19); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v26, MKSTR(v27), x1); - uint64_t v28 = pop_u64(); - x24 = v28; - VAL v29 = pop_value(); - x23 = v29; - x22 = x2; - VAL r30 = pop_resource(); - x21 = r30; + uint64_t v25 = VU64(VTUP(x2)->cells[2]); + STR* v26; + STRLIT(v26, "Error, expected a namespace in QName.climb-up-dname?", 52); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v25, MKSTR(v26), x1); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x18 = x22; - x17 = x24; - x16 = x23; + x18 = x23; + x17 = v19; + x16 = x22; x15 = x21; } else { - x18 = x2; - x17 = VU64(v12); - x16 = v13; + x18 = v12; + x17 = v13; + x16 = x2; x15 = x1; } - VAL v31; - VAL v32; - mw_mirth_name_QName_climbZ_upZ_nameZAsk(x15, x17, x4, &v31, &v32); - VAL v33 = mw_std_list_List_1_reverse(x16); - VAL v34; - VAL v35; - mw_std_list_List_1_uncons(v33, &v34, &v35); - VAL x36; - VAL x37; - VAL x38; - VAL x39; - int64_t x40; - switch (get_data_tag(v34)) { - case 1LL: { // Some - VAL v41 = mtp_std_maybe_Maybe_1_Some(v34); - VAL v42 = MKI64(0LL /* Nil */); - VAL v43 = mw_std_list_List_1_reverse(v42); - VAL v44; - VAL v45; - mw_std_list_List_1_uncons(v32, &v44, &v45); - VAL x46; - VAL x47; - uint64_t x48; - VAL x49; - VAL x50; - int64_t x51; - switch (get_data_tag(v44)) { - case 1LL: { // Some - VAL v52 = mtp_std_maybe_Maybe_1_Some(v44); - VAL v53; - VAL v54; - mw_mirth_name_Namespace_qname(v31, v52, &v53, &v54); - uint64_t x55; - VAL x56; - VAL x57; - VAL x58; - switch (get_data_tag(v54)) { - case 1LL: { // Some - VAL v59 = mtp_std_maybe_Maybe_1_Some(v54); - incref(v41); - VAL v60; - VAL v61; - mw_mirth_name_QName_climbZ_upZ_nameZAsk(v53, VU64(v41), v59, &v60, &v61); - x58 = x18; - x57 = v61; - x56 = v60; - x55 = VU64(v41); - } break; - case 0LL: { // None - VAL v62 = MKI64(0LL /* Nil */); - x58 = x18; - x57 = v62; - x56 = v53; - x55 = VU64(v41); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v63; - VAL v64; - mw_std_list_List_1_uncons(x57, &v63, &v64); - VAL x65; - VAL x66; - int64_t x67; - switch (get_data_tag(v63)) { - case 1LL: { // Some - VAL v68 = mtp_std_maybe_Maybe_1_Some(v63); - VAL v69 = mtw_std_list_List_1_Cons(v68, v43); - int64_t v70 = 1LL /* True */; - x67 = v70; - x66 = v64; - x65 = v69; - push_u64(x55); - push_resource(x56); - push_resource(x58); - } break; - case 0LL: { // None - int64_t v71 = 0LL /* False */; - x67 = v71; - x66 = v64; - x65 = v43; - push_u64(x55); - push_resource(x56); - push_resource(x58); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v72 = (x65); - VAL v73 = x66; - int64_t v74 = x67; - while (((bool)v74)) { - VAL v75 = (v72); - VAL v76 = v73; - VAL v77; - VAL v78; - mw_std_list_List_1_uncons(v76, &v77, &v78); - VAL x79; - VAL x80; - int64_t x81; - switch (get_data_tag(v77)) { - case 1LL: { // Some - VAL v82 = mtp_std_maybe_Maybe_1_Some(v77); - VAL v83 = mtw_std_list_List_1_Cons(v82, v75); - int64_t v84 = 1LL /* True */; - x81 = v84; - x80 = v78; - x79 = v83; - } break; - case 0LL: { // None - int64_t v85 = 0LL /* False */; - x81 = v85; - x80 = v78; - x79 = v75; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v74 = x81; - v73 = x80; - v72 = x79; - } - decref(v73); - int64_t v86 = 1LL /* True */; - x51 = v86; - x50 = v45; - x49 = v72; - uint64_t v87 = pop_u64(); - x48 = v87; - VAL r88 = pop_resource(); - x47 = r88; - VAL r89 = pop_resource(); - x46 = r89; - } break; - case 0LL: { // None - int64_t v90 = 0LL /* False */; - x51 = v90; - x50 = v45; - x49 = v43; - x48 = VU64(v41); - x47 = x18; - x46 = v31; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v91 = (x46); - VAL v92 = (x47); - uint64_t v93 = x48; - VAL v94 = (x49); - VAL v95 = x50; - int64_t v96 = x51; - while (((bool)v96)) { - VAL v97 = (v91); - VAL v98 = (v92); - uint64_t v99 = v93; - VAL v100 = (v94); - VAL v101 = v95; - VAL v102; - VAL v103; - mw_std_list_List_1_uncons(v101, &v102, &v103); - VAL x104; - VAL x105; - uint64_t x106; - VAL x107; - VAL x108; - int64_t x109; - switch (get_data_tag(v102)) { - case 1LL: { // Some - VAL v110 = mtp_std_maybe_Maybe_1_Some(v102); - VAL v111; - VAL v112; - mw_mirth_name_Namespace_qname(v97, v110, &v111, &v112); - uint64_t x113; - VAL x114; - VAL x115; - VAL x116; - switch (get_data_tag(v112)) { - case 1LL: { // Some - VAL v117 = mtp_std_maybe_Maybe_1_Some(v112); - VAL v118; - VAL v119; - mw_mirth_name_QName_climbZ_upZ_nameZAsk(v111, v99, v117, &v118, &v119); - x116 = v98; - x115 = v119; - x114 = v118; - x113 = v99; - } break; - case 0LL: { // None - VAL v120 = MKI64(0LL /* Nil */); - x116 = v98; - x115 = v120; - x114 = v111; - x113 = v99; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v121; - VAL v122; - mw_std_list_List_1_uncons(x115, &v121, &v122); - VAL x123; - VAL x124; - int64_t x125; - switch (get_data_tag(v121)) { - case 1LL: { // Some - VAL v126 = mtp_std_maybe_Maybe_1_Some(v121); - VAL v127 = mtw_std_list_List_1_Cons(v126, v100); - int64_t v128 = 1LL /* True */; - x125 = v128; - x124 = v122; - x123 = v127; - push_u64(x113); - push_resource(x114); - push_resource(x116); - } break; - case 0LL: { // None - int64_t v129 = 0LL /* False */; - x125 = v129; - x124 = v122; - x123 = v100; - push_u64(x113); - push_resource(x114); - push_resource(x116); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v130 = (x123); - VAL v131 = x124; - int64_t v132 = x125; - while (((bool)v132)) { - VAL v133 = (v130); - VAL v134 = v131; - VAL v135; - VAL v136; - mw_std_list_List_1_uncons(v134, &v135, &v136); - VAL x137; - VAL x138; - int64_t x139; - switch (get_data_tag(v135)) { - case 1LL: { // Some - VAL v140 = mtp_std_maybe_Maybe_1_Some(v135); - VAL v141 = mtw_std_list_List_1_Cons(v140, v133); - int64_t v142 = 1LL /* True */; - x139 = v142; - x138 = v136; - x137 = v141; - } break; - case 0LL: { // None - int64_t v143 = 0LL /* False */; - x139 = v143; - x138 = v136; - x137 = v133; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v132 = x139; - v131 = x138; - v130 = x137; - } - decref(v131); - int64_t v144 = 1LL /* True */; - x109 = v144; - x108 = v103; - x107 = v130; - uint64_t v145 = pop_u64(); - x106 = v145; - VAL r146 = pop_resource(); - x105 = r146; - VAL r147 = pop_resource(); - x104 = r147; - } break; - case 0LL: { // None - int64_t v148 = 0LL /* False */; - x109 = v148; - x108 = v103; - x107 = v100; - x106 = v99; - x105 = v98; - x104 = v97; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v96 = x109; - v95 = x108; - v94 = x107; - v93 = x106; - v92 = x105; - v91 = x104; - } - decref(v95); - VAL v149 = mw_std_list_List_1_reverse(v94); - int64_t v150 = 1LL /* True */; - x40 = v150; - x39 = v35; - x38 = v149; - x37 = v92; - x36 = v91; - } break; - case 0LL: { // None - int64_t v151 = 0LL /* False */; - x40 = v151; - x39 = v35; - x38 = v32; - x37 = x18; - x36 = v31; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v152 = (x36); - VAL v153 = (x37); - VAL v154 = x38; - VAL v155 = x39; - int64_t v156 = x40; - while (((bool)v156)) { - VAL v157 = (v152); - VAL v158 = (v153); - VAL v159 = v154; - VAL v160 = v155; - VAL v161; - VAL v162; - mw_std_list_List_1_uncons(v160, &v161, &v162); - VAL x163; - VAL x164; - VAL x165; - VAL x166; - int64_t x167; - switch (get_data_tag(v161)) { - case 1LL: { // Some - VAL v168 = mtp_std_maybe_Maybe_1_Some(v161); - VAL v169 = MKI64(0LL /* Nil */); - VAL v170 = mw_std_list_List_1_reverse(v169); - VAL v171; - VAL v172; - mw_std_list_List_1_uncons(v159, &v171, &v172); - VAL x173; - VAL x174; - uint64_t x175; - VAL x176; - VAL x177; - int64_t x178; - switch (get_data_tag(v171)) { - case 1LL: { // Some - VAL v179 = mtp_std_maybe_Maybe_1_Some(v171); - VAL v180; - VAL v181; - mw_mirth_name_Namespace_qname(v157, v179, &v180, &v181); - uint64_t x182; - VAL x183; - VAL x184; - VAL x185; - switch (get_data_tag(v181)) { - case 1LL: { // Some - VAL v186 = mtp_std_maybe_Maybe_1_Some(v181); - incref(v168); - VAL v187; - VAL v188; - mw_mirth_name_QName_climbZ_upZ_nameZAsk(v180, VU64(v168), v186, &v187, &v188); - x185 = v158; - x184 = v188; - x183 = v187; - x182 = VU64(v168); - } break; - case 0LL: { // None - VAL v189 = MKI64(0LL /* Nil */); - x185 = v158; - x184 = v189; - x183 = v180; - x182 = VU64(v168); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v190; - VAL v191; - mw_std_list_List_1_uncons(x184, &v190, &v191); - VAL x192; - VAL x193; - int64_t x194; - switch (get_data_tag(v190)) { - case 1LL: { // Some - VAL v195 = mtp_std_maybe_Maybe_1_Some(v190); - VAL v196 = mtw_std_list_List_1_Cons(v195, v170); - int64_t v197 = 1LL /* True */; - x194 = v197; - x193 = v191; - x192 = v196; - push_u64(x182); - push_resource(x183); - push_resource(x185); - } break; - case 0LL: { // None - int64_t v198 = 0LL /* False */; - x194 = v198; - x193 = v191; - x192 = v170; - push_u64(x182); - push_resource(x183); - push_resource(x185); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v199 = (x192); - VAL v200 = x193; - int64_t v201 = x194; - while (((bool)v201)) { - VAL v202 = (v199); - VAL v203 = v200; - VAL v204; - VAL v205; - mw_std_list_List_1_uncons(v203, &v204, &v205); - VAL x206; - VAL x207; - int64_t x208; - switch (get_data_tag(v204)) { - case 1LL: { // Some - VAL v209 = mtp_std_maybe_Maybe_1_Some(v204); - VAL v210 = mtw_std_list_List_1_Cons(v209, v202); - int64_t v211 = 1LL /* True */; - x208 = v211; - x207 = v205; - x206 = v210; - } break; - case 0LL: { // None - int64_t v212 = 0LL /* False */; - x208 = v212; - x207 = v205; - x206 = v202; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v201 = x208; - v200 = x207; - v199 = x206; - } - decref(v200); - int64_t v213 = 1LL /* True */; - x178 = v213; - x177 = v172; - x176 = v199; - uint64_t v214 = pop_u64(); - x175 = v214; - VAL r215 = pop_resource(); - x174 = r215; - VAL r216 = pop_resource(); - x173 = r216; - } break; - case 0LL: { // None - int64_t v217 = 0LL /* False */; - x178 = v217; - x177 = v172; - x176 = v170; - x175 = VU64(v168); - x174 = v158; - x173 = v157; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v218 = (x173); - VAL v219 = (x174); - uint64_t v220 = x175; - VAL v221 = (x176); - VAL v222 = x177; - int64_t v223 = x178; - while (((bool)v223)) { - VAL v224 = (v218); - VAL v225 = (v219); - uint64_t v226 = v220; - VAL v227 = (v221); - VAL v228 = v222; - VAL v229; - VAL v230; - mw_std_list_List_1_uncons(v228, &v229, &v230); - VAL x231; - VAL x232; - uint64_t x233; - VAL x234; - VAL x235; - int64_t x236; - switch (get_data_tag(v229)) { - case 1LL: { // Some - VAL v237 = mtp_std_maybe_Maybe_1_Some(v229); - VAL v238; - VAL v239; - mw_mirth_name_Namespace_qname(v224, v237, &v238, &v239); - uint64_t x240; - VAL x241; - VAL x242; - VAL x243; - switch (get_data_tag(v239)) { - case 1LL: { // Some - VAL v244 = mtp_std_maybe_Maybe_1_Some(v239); - VAL v245; - VAL v246; - mw_mirth_name_QName_climbZ_upZ_nameZAsk(v238, v226, v244, &v245, &v246); - x243 = v225; - x242 = v246; - x241 = v245; - x240 = v226; - } break; - case 0LL: { // None - VAL v247 = MKI64(0LL /* Nil */); - x243 = v225; - x242 = v247; - x241 = v238; - x240 = v226; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v248; - VAL v249; - mw_std_list_List_1_uncons(x242, &v248, &v249); - VAL x250; - VAL x251; - int64_t x252; - switch (get_data_tag(v248)) { + VAL v29; + VAL v30; + mw_mirth_name_QName_climbZ_upZ_nameZAsk(x15, VU64(x18), x4, &v29, &v30); + VAL v31 = mw_std_list_List_1_reverse(x17); + int64_t v32 = 1LL /* True */; + VAL v33 = v29; + VAL v34 = x16; + VAL v35 = v30; + VAL v36 = v31; + int64_t v37 = v32; + int64_t v38 = v32; + while (((bool)v38)) { + VAL v39 = v33; + VAL v40 = v34; + VAL v41 = v35; + VAL v42 = v36; + int64_t v43 = v37; + VAL x44; + VAL x45; + VAL x46; + VAL x47; + int64_t x48; + switch (get_data_tag(v42)) { + case 1LL: { // Cons + VAL v49; + VAL v50; + mtp_std_list_List_1_Cons(v42, &v49, &v50); + VAL v51 = MKI64(0LL /* Nil */); + VAL v52 = mw_std_list_List_1_reverse(v51); + int64_t v53 = 1LL /* True */; + VAL v54 = v49; + VAL v55 = v39; + VAL v56 = v40; + VAL v57 = v52; + VAL v58 = v41; + int64_t v59 = v53; + int64_t v60 = v53; + while (((bool)v60)) { + VAL v61 = v54; + VAL v62 = v55; + VAL v63 = v56; + VAL v64 = v57; + VAL v65 = v58; + int64_t v66 = v59; + uint64_t x67; + VAL x68; + VAL x69; + VAL x70; + VAL x71; + int64_t x72; + switch (get_data_tag(v65)) { + case 1LL: { // Cons + VAL v73; + VAL v74; + mtp_std_list_List_1_Cons(v65, &v73, &v74); + VAL v75; + VAL v76; + mw_mirth_name_Namespace_qname(v62, v73, &v75, &v76); + uint64_t x77; + VAL x78; + VAL x79; + VAL x80; + switch (get_data_tag(v76)) { case 1LL: { // Some - VAL v253 = mtp_std_maybe_Maybe_1_Some(v248); - VAL v254 = mtw_std_list_List_1_Cons(v253, v227); - int64_t v255 = 1LL /* True */; - x252 = v255; - x251 = v249; - x250 = v254; - push_u64(x240); - push_resource(x241); - push_resource(x243); + VAL v81 = mtp_std_maybe_Maybe_1_Some(v76); + incref(v61); + VAL v82; + VAL v83; + mw_mirth_name_QName_climbZ_upZ_nameZAsk(v75, VU64(v61), v81, &v82, &v83); + x80 = v63; + x79 = v83; + x78 = v82; + x77 = VU64(v61); } break; case 0LL: { // None - int64_t v256 = 0LL /* False */; - x252 = v256; - x251 = v249; - x250 = v227; - push_u64(x240); - push_resource(x241); - push_resource(x243); + VAL v84 = MKI64(0LL /* Nil */); + x80 = v63; + x79 = v84; + x78 = v75; + x77 = VU64(v61); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v257 = (x250); - VAL v258 = x251; - int64_t v259 = x252; - while (((bool)v259)) { - VAL v260 = (v257); - VAL v261 = v258; - VAL v262; - VAL v263; - mw_std_list_List_1_uncons(v261, &v262, &v263); - VAL x264; - VAL x265; - int64_t x266; - switch (get_data_tag(v262)) { - case 1LL: { // Some - VAL v267 = mtp_std_maybe_Maybe_1_Some(v262); - VAL v268 = mtw_std_list_List_1_Cons(v267, v260); - int64_t v269 = 1LL /* True */; - x266 = v269; - x265 = v263; - x264 = v268; - } break; - case 0LL: { // None - int64_t v270 = 0LL /* False */; - x266 = v270; - x265 = v263; - x264 = v260; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v259 = x266; - v258 = x265; - v257 = x264; - } - decref(v258); - int64_t v271 = 1LL /* True */; - x236 = v271; - x235 = v230; - x234 = v257; - uint64_t v272 = pop_u64(); - x233 = v272; - VAL r273 = pop_resource(); - x232 = r273; - VAL r274 = pop_resource(); - x231 = r274; + VAL v85 = mw_std_list_List_1_for_1_sp46(v64, x79); + int64_t v86 = 1LL /* True */; + x72 = v86; + x71 = v74; + x70 = v85; + x69 = x80; + x68 = x78; + x67 = x77; } break; - case 0LL: { // None - int64_t v275 = 0LL /* False */; - x236 = v275; - x235 = v230; - x234 = v227; - x233 = v226; - x232 = v225; - x231 = v224; + case 0LL: { // Nil + VAL v87 = MKI64(0LL /* Nil */); + int64_t v88 = 0LL /* False */; + x72 = v88; + x71 = v87; + x70 = v64; + x69 = v63; + x68 = v62; + x67 = VU64(v61); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v223 = x236; - v222 = x235; - v221 = x234; - v220 = x233; - v219 = x232; - v218 = x231; + v60 = x72; + v59 = x72; + v58 = x71; + v57 = x70; + v56 = x69; + v55 = x68; + v54 = MKU64(x67); } - decref(v222); - VAL v276 = mw_std_list_List_1_reverse(v221); - int64_t v277 = 1LL /* True */; - x167 = v277; - x166 = v162; - x165 = v276; - x164 = v219; - x163 = v218; + decref(v58); + VAL v89 = mw_std_list_List_1_reverse(v57); + decref(v54); + int64_t v90 = 1LL /* True */; + x48 = v90; + x47 = v50; + x46 = v89; + x45 = v56; + x44 = v55; } break; - case 0LL: { // None - int64_t v278 = 0LL /* False */; - x167 = v278; - x166 = v162; - x165 = v159; - x164 = v158; - x163 = v157; + case 0LL: { // Nil + VAL v91 = MKI64(0LL /* Nil */); + int64_t v92 = 0LL /* False */; + x48 = v92; + x47 = v91; + x46 = v41; + x45 = v40; + x44 = v39; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v156 = x167; - v155 = x166; - v154 = x165; - v153 = x164; - v152 = x163; + v38 = x48; + v37 = x48; + v36 = x47; + v35 = x46; + v34 = x45; + v33 = x44; } - decref(v155); - *x7 = v154; - *x6 = v153; - *x5 = v152; + decref(v36); + *x7 = v35; + *x6 = v34; + *x5 = v33; } static void mw_mirth_elab_ZPlusTypeElab_resolveZ_typeZ_conZ_nameZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { int64_t v7 = 0LL /* False */; @@ -48439,358 +36292,270 @@ static void mw_mirth_elab_ZPlusTypeElab_resolveZ_typeZ_conZ_nameZBang (VAL x1, V incref(v13); VAL v14 = MKI64(0LL /* Nil */); VAL v15 = MKI64(0LL /* Nil */); - VAL v16; - VAL v17; - mw_std_list_List_1_uncons(v13, &v16, &v17); - VAL x18; - VAL x19; - VAL x20; - VAL x21; - VAL x22; - int64_t x23; - switch (get_data_tag(v16)) { - case 1LL: { // Some - VAL v24 = mtp_std_maybe_Maybe_1_Some(v16); - incref(v24); - VAL v25; - int64_t v26; - mw_mirth_def_Def_definesZ_aZ_typeZAsk(v11, v24, &v25, &v26); - VAL x27; - VAL x28; - VAL x29; - if (((bool)v26)) { - VAL v30 = mtw_std_either_Either_2_Right(v24); - x29 = v30; - x28 = v12; - x27 = v25; - } else { - VAL v31 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v24); - VAL v32 = mtw_std_either_Either_2_Left(v31); - x29 = v32; - x28 = v12; - x27 = v25; - } - VAL x33; - VAL x34; - VAL x35; - VAL x36; - switch (get_data_tag(x29)) { - case 0LL: { // Left - VAL v37 = mtp_std_either_Either_2_Left(x29); - VAL v38 = mtw_std_list_List_1_Cons(v37, v14); - x36 = v15; - x35 = v38; - x34 = x28; - x33 = x27; - } break; - case 1LL: { // Right - VAL v39 = mtp_std_either_Either_2_Right(x29); - VAL v40 = mtw_std_list_List_1_Cons(v39, v15); - x36 = v40; - x35 = v14; - x34 = x28; - x33 = x27; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v41 = 1LL /* True */; - x23 = v41; - x22 = v17; - x21 = x36; - x20 = x35; - x19 = x34; - x18 = x33; - } break; - case 0LL: { // None - int64_t v42 = 0LL /* False */; - x23 = v42; - x22 = v17; - x21 = v15; - x20 = v14; - x19 = v12; - x18 = v11; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v43 = (x18); - VAL v44 = (x19); - VAL v45 = x20; - VAL v46 = x21; - VAL v47 = x22; - int64_t v48 = x23; - while (((bool)v48)) { - VAL v49 = (v43); - VAL v50 = (v44); - VAL v51 = v45; - VAL v52 = v46; - VAL v53 = v47; - VAL v54; - VAL v55; - mw_std_list_List_1_uncons(v53, &v54, &v55); - VAL x56; - VAL x57; - VAL x58; - VAL x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v54)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v54); - incref(v62); - VAL v63; - int64_t v64; - mw_mirth_def_Def_definesZ_aZ_typeZAsk(v49, v62, &v63, &v64); - VAL x65; - VAL x66; - VAL x67; - if (((bool)v64)) { - VAL v68 = mtw_std_either_Either_2_Right(v62); - x67 = v68; - x66 = v50; - x65 = v63; + int64_t v16 = 1LL /* True */; + VAL v17 = v11; + VAL v18 = v12; + VAL v19 = v14; + VAL v20 = v15; + VAL v21 = v13; + int64_t v22 = v16; + int64_t v23 = v16; + while (((bool)v23)) { + VAL v24 = v17; + VAL v25 = v18; + VAL v26 = v19; + VAL v27 = v20; + VAL v28 = v21; + int64_t v29 = v22; + VAL x30; + VAL x31; + VAL x32; + VAL x33; + VAL x34; + int64_t x35; + switch (get_data_tag(v28)) { + case 1LL: { // Cons + VAL v36; + VAL v37; + mtp_std_list_List_1_Cons(v28, &v36, &v37); + incref(v36); + VAL v38; + int64_t v39; + mw_mirth_def_Def_definesZ_aZ_typeZAsk(v24, v36, &v38, &v39); + VAL x40; + VAL x41; + VAL x42; + if (((bool)v39)) { + VAL v43 = mtw_std_either_Either_2_Right(v36); + x42 = v43; + x41 = v25; + x40 = v38; } else { - VAL v69 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v62); - VAL v70 = mtw_std_either_Either_2_Left(v69); - x67 = v70; - x66 = v50; - x65 = v63; + VAL v44 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v36); + VAL v45 = mtw_std_either_Either_2_Left(v44); + x42 = v45; + x41 = v25; + x40 = v38; } - VAL x71; - VAL x72; - VAL x73; - VAL x74; - switch (get_data_tag(x67)) { + VAL x46; + VAL x47; + VAL x48; + VAL x49; + switch (get_data_tag(x42)) { case 0LL: { // Left - VAL v75 = mtp_std_either_Either_2_Left(x67); - VAL v76 = mtw_std_list_List_1_Cons(v75, v51); - x74 = v52; - x73 = v76; - x72 = x66; - x71 = x65; + VAL v50 = mtp_std_either_Either_2_Left(x42); + VAL v51 = mtw_std_list_List_1_Cons(v50, v26); + x49 = v27; + x48 = v51; + x47 = x41; + x46 = x40; } break; case 1LL: { // Right - VAL v77 = mtp_std_either_Either_2_Right(x67); - VAL v78 = mtw_std_list_List_1_Cons(v77, v52); - x74 = v78; - x73 = v51; - x72 = x66; - x71 = x65; + VAL v52 = mtp_std_either_Either_2_Right(x42); + VAL v53 = mtw_std_list_List_1_Cons(v52, v27); + x49 = v53; + x48 = v26; + x47 = x41; + x46 = x40; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v79 = 1LL /* True */; - x61 = v79; - x60 = v55; - x59 = x74; - x58 = x73; - x57 = x72; - x56 = x71; + int64_t v54 = 1LL /* True */; + x35 = v54; + x34 = v37; + x33 = x49; + x32 = x48; + x31 = x47; + x30 = x46; } break; - case 0LL: { // None - int64_t v80 = 0LL /* False */; - x61 = v80; - x60 = v55; - x59 = v52; - x58 = v51; - x57 = v50; - x56 = v49; + case 0LL: { // Nil + VAL v55 = MKI64(0LL /* Nil */); + int64_t v56 = 0LL /* False */; + x35 = v56; + x34 = v55; + x33 = v27; + x32 = v26; + x31 = v25; + x30 = v24; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v48 = x61; - v47 = x60; - v46 = x59; - v45 = x58; - v44 = x57; - v43 = x56; + v23 = x35; + v22 = x35; + v21 = x34; + v20 = x33; + v19 = x32; + v18 = x31; + v17 = x30; } - decref(v47); - VAL v81 = mw_std_list_List_1_reverse(v45); - VAL v82 = mw_std_list_List_1_reverse(v46); - VAL v83 = VVAL(VTUP(v44)->cells[5]); - incref(v83); - VAL v84 = mw_std_list_List_1_cat(v81, v83); - VAL v85 = VTUP(v44)->cells[5]; - decref(v85); - VTUP(v44)->cells[5] = v84; - VAL v86 = VTUP(v44)->cells[4]; - decref(v86); - VTUP(v44)->cells[4] = v82; - VAL v87; - VAL v88; - mw_mirth_elab_ZPlusResolveDef_filterZ_arity(v43, v44, &v87, &v88); - VAL v89; - VAL v90; - mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v87, v88, &v89, &v90); - VAL v91 = MKI64(0LL /* Nil */); - VAL v92; - VAL v93; - mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v91, v89, v90, &v92, &v93); - VAL v94; - VAL v95; - mw_mirth_elab_resolveZ_defZ_endZBang(v92, v93, &v94, &v95); - VAL x96; - VAL x97; - VAL x98; - switch (get_data_tag(v95)) { + decref(v21); + VAL v57 = mw_std_list_List_1_reverse(v19); + VAL v58 = mw_std_list_List_1_reverse(v20); + VAL v59 = VVAL(VTUP(v18)->cells[5]); + incref(v59); + VAL v60 = mw_std_list_List_1_cat(v57, v59); + VAL v61 = VTUP(v18)->cells[5]; + decref(v61); + VTUP(v18)->cells[5] = v60; + VAL v62 = VTUP(v18)->cells[4]; + decref(v62); + VTUP(v18)->cells[4] = v58; + VAL v63; + VAL v64; + mw_mirth_elab_ZPlusResolveDef_filterZ_arity(v17, v18, &v63, &v64); + VAL v65; + VAL v66; + mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v63, v64, &v65, &v66); + VAL v67 = MKI64(0LL /* Nil */); + VAL v68; + VAL v69; + mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v67, v65, v66, &v68, &v69); + VAL v70; + VAL v71; + mw_mirth_elab_resolveZ_defZ_endZBang(v68, v69, &v70, &v71); + VAL x72; + VAL x73; + VAL x74; + switch (get_data_tag(v71)) { case 1LL: { // Some - VAL v99 = mtp_std_maybe_Maybe_1_Some(v95); - VAL x100; - VAL x101; - VAL x102; - switch (get_data_tag(v99)) { + VAL v75 = mtp_std_maybe_Maybe_1_Some(v71); + VAL x76; + VAL x77; + VAL x78; + switch (get_data_tag(v75)) { case 3LL: { // DefData - uint64_t v103 = mtp_mirth_def_Def_DefData(v99); - VAL v104 = mtw_mirth_type_Type_TData(v103); - x102 = v104; - x101 = x2; - x100 = v94; + uint64_t v79 = mtp_mirth_def_Def_DefData(v75); + VAL v80 = mtw_mirth_type_Type_TData(v79); + x78 = v80; + x77 = x2; + x76 = v70; } break; case 4LL: { // DefTable - uint64_t v105 = mtp_mirth_def_Def_DefTable(v99); - VAL v106 = mtw_mirth_type_Type_TTable(v105); - x102 = v106; - x101 = x2; - x100 = v94; + uint64_t v81 = mtp_mirth_def_Def_DefTable(v75); + VAL v82 = mtw_mirth_type_Type_TTable(v81); + x78 = v82; + x77 = x2; + x76 = v70; } break; case 5LL: { // DefType - uint64_t v107 = mtp_mirth_def_Def_DefType(v99); - VAL v108; - VAL v109; - mw_mirth_typedef_TypeDef_target(v94, v107, &v108, &v109); - x102 = v109; - x101 = x2; - x100 = v108; + uint64_t v83 = mtp_mirth_def_Def_DefType(v75); + VAL v84; + VAL v85; + mw_mirth_typedef_TypeDef_target(v70, v83, &v84, &v85); + x78 = v85; + x77 = x2; + x76 = v84; } break; default: { - decref(v99); - uint64_t v110 = VU64(VTUP(x2)->cells[2]); - STR* v111; - STRLIT(v111, "compiler bug: resolve-type-con-name! doesn't understand type", 60); - VAL v112 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v110, MKSTR(v111), v94)); - VAL v113 = MKI64(0LL /* TYPE_ERROR */); - x102 = v113; - x101 = x2; - x100 = v112; + decref(v75); + uint64_t v86 = VU64(VTUP(x2)->cells[2]); + STR* v87; + STRLIT(v87, "compiler bug: resolve-type-con-name! doesn't understand type", 60); + VAL v88 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v86, MKSTR(v87), v70); + VAL v89 = MKI64(0LL /* TYPE_ERROR */); + x78 = v89; + x77 = x2; + x76 = v88; } break; } - VAL v114 = mtw_std_maybe_Maybe_1_Some(x102); - x98 = v114; - x97 = x101; - x96 = x100; + VAL v90 = mtw_std_maybe_Maybe_1_Some(x78); + x74 = v90; + x73 = x77; + x72 = x76; } break; case 0LL: { // None - VAL v115 = MKI64(0LL /* None */); - x98 = v115; - x97 = x2; - x96 = v94; + VAL v91 = MKI64(0LL /* None */); + x74 = v91; + x73 = x2; + x72 = v70; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x116; - VAL x117; - VAL x118; - switch (get_data_tag(x98)) { + VAL x92; + switch (get_data_tag(x74)) { case 1LL: { // Some - VAL v119 = mtp_std_maybe_Maybe_1_Some(x98); - x118 = v119; - x117 = x97; - x116 = x96; + VAL v93 = mtp_std_maybe_Maybe_1_Some(x74); + x92 = v93; } break; case 0LL: { // None - VAL v120 = MKI64(0LL /* TYPE_ERROR */); - x118 = v120; - x117 = x97; - x116 = x96; + VAL v94 = MKI64(0LL /* TYPE_ERROR */); + x92 = v94; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x6 = x118; - *x5 = x117; - *x4 = x116; + *x6 = x92; + *x5 = x73; + *x4 = x72; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_conZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { incref(x3); VAL v7 = mw_std_either_Either_2_leftZAsk(x3); - VAL x8; - VAL x9; - VAL x10; - int64_t x11; + int64_t x8; switch (get_data_tag(v7)) { case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v13 = mw_mirth_name_Name_ZToStr(VU64(v12)); - STR* v14; - STRLIT(v14, "Mut", 3); - bool v15 = (str_cmp(VSTR(v13), v14) == 0); - x11 = ((int64_t)v15); - x10 = x3; - x9 = x2; - x8 = x1; + VAL v9 = mtp_std_maybe_Maybe_1_Some(v7); + VAL v10 = mw_mirth_name_Name_ZToStr(VU64(v9)); + STR* v11; + STRLIT(v11, "Mut", 3); + bool v12 = (str_cmp(VSTR(v10), v11) == 0); + x8 = ((int64_t)v12); } break; case 0LL: { // None - int64_t v16 = 0LL /* False */; - x11 = v16; - x10 = x3; - x9 = x2; - x8 = x1; + int64_t v13 = 0LL /* False */; + x8 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x17; - VAL x18; - VAL x19; - if (((bool)x11)) { - decref(x10); - uint64_t v20 = VU64(VTUP(x9)->cells[2]); - uint64_t v21 = mw_mirth_token_Token_next(v20); - uint64_t v22 = VU64(VTUP(x9)->cells[2]); - uint64_t v23; + VAL x14; + VAL x15; + VAL x16; + if (((bool)x8)) { + decref(x3); + uint64_t v17 = VU64(VTUP(x2)->cells[2]); + uint64_t v18 = mw_mirth_token_Token_next(v17); + uint64_t v19 = VU64(VTUP(x2)->cells[2]); + uint64_t v20; + VAL v21; + mw_mirth_token_Token_argsZ_1(v19, x1, &v20, &v21); + VTUP(x2)->cells[2] = MKU64(v20); + VAL v22; + VAL v23; VAL v24; - mw_mirth_token_Token_argsZ_1(v22, x8, &v23, &v24); - VTUP(x9)->cells[2] = MKU64(v23); - VAL v25; + mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argZBang(v21, x2, &v22, &v23, &v24); + VAL v25 = mtw_mirth_type_Type_TMut(v24); + VTUP(v23)->cells[2] = MKU64(v18); + x16 = v23; + x15 = v25; + x14 = v22; + } else { VAL v26; VAL v27; - mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argZBang(v24, x9, &v25, &v26, &v27); - VAL v28 = mtw_mirth_type_Type_TMut(v27); - VTUP(v26)->cells[2] = MKU64(v21); - x19 = v26; - x18 = v28; - x17 = v25; - } else { + VAL v28; + mw_mirth_elab_ZPlusTypeElab_resolveZ_typeZ_conZ_nameZBang(x1, x2, x3, &v26, &v27, &v28); VAL v29; VAL v30; VAL v31; - mw_mirth_elab_ZPlusTypeElab_resolveZ_typeZ_conZ_nameZBang(x8, x9, x10, &v29, &v30, &v31); - VAL v32; - VAL v33; - VAL v34; - mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argsZBang(v29, v30, v31, &v32, &v33, &v34); - uint64_t v35 = VU64(VTUP(v33)->cells[2]); - uint64_t v36 = mw_mirth_token_Token_next(v35); - VTUP(v33)->cells[2] = MKU64(v36); - x19 = v33; - x18 = v34; - x17 = v32; - } - *x6 = x18; - *x5 = x19; - *x4 = x17; + mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argsZBang(v26, v27, v28, &v29, &v30, &v31); + uint64_t v32 = VU64(VTUP(v30)->cells[2]); + uint64_t v33 = mw_mirth_token_Token_next(v32); + VTUP(v30)->cells[2] = MKU64(v33); + x16 = v30; + x15 = v31; + x14 = v29; + } + *x6 = x15; + *x5 = x16; + *x4 = x14; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_resourceZ_conZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { VAL v7; @@ -48811,107 +36576,75 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argsZBang (VAL x1, VAL x2, V uint64_t v12 = VU64(VTUP(x2)->cells[2]); uint64_t v13 = VU64(VTUP(x2)->cells[2]); VAL v14 = mw_mirth_token_Token_args(v13); - VAL v15; - VAL v16; - mw_std_list_List_1_uncons(v14, &v15, &v16); - VAL x17; - VAL x18; - VAL x19; - VAL x20; - int64_t x21; - switch (get_data_tag(v15)) { - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v15); - VTUP(x2)->cells[2] = v22; - VAL v23; - VAL v24; - VAL v25; - mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argZBang(x1, x2, &v23, &v24, &v25); - VAL v26 = mtw_mirth_type_Type_TApp(x3, v25); - int64_t v27 = 1LL /* True */; - x21 = v27; - x20 = v16; - x19 = v24; - x18 = v26; - x17 = v23; - } break; - case 0LL: { // None - int64_t v28 = 0LL /* False */; - x21 = v28; - x20 = v16; - x19 = x2; - x18 = x3; - x17 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v29 = (x17); - VAL v30 = x18; - VAL v31 = (x19); - VAL v32 = x20; - int64_t v33 = x21; - while (((bool)v33)) { - VAL v34 = (v29); - VAL v35 = v30; - VAL v36 = (v31); - VAL v37 = v32; - VAL v38; - VAL v39; - mw_std_list_List_1_uncons(v37, &v38, &v39); - VAL x40; - VAL x41; - VAL x42; - VAL x43; - int64_t x44; - switch (get_data_tag(v38)) { - case 1LL: { // Some - VAL v45 = mtp_std_maybe_Maybe_1_Some(v38); - VTUP(v36)->cells[2] = v45; - VAL v46; - VAL v47; - VAL v48; - mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argZBang(v34, v36, &v46, &v47, &v48); - VAL v49 = mtw_mirth_type_Type_TApp(v35, v48); - int64_t v50 = 1LL /* True */; - x44 = v50; - x43 = v39; - x42 = v47; - x41 = v49; - x40 = v46; + int64_t v15 = 1LL /* True */; + VAL v16 = x3; + VAL v17 = x1; + VAL v18 = x2; + VAL v19 = v14; + int64_t v20 = v15; + int64_t v21 = v15; + while (((bool)v21)) { + VAL v22 = v16; + VAL v23 = v17; + VAL v24 = v18; + VAL v25 = v19; + int64_t v26 = v20; + VAL x27; + VAL x28; + VAL x29; + VAL x30; + int64_t x31; + switch (get_data_tag(v25)) { + case 1LL: { // Cons + VAL v32; + VAL v33; + mtp_std_list_List_1_Cons(v25, &v32, &v33); + VTUP(v24)->cells[2] = v32; + VAL v34; + VAL v35; + VAL v36; + mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_argZBang(v23, v24, &v34, &v35, &v36); + VAL v37 = mtw_mirth_type_Type_TApp(v22, v36); + int64_t v38 = 1LL /* True */; + x31 = v38; + x30 = v33; + x29 = v37; + x28 = v35; + x27 = v34; } break; - case 0LL: { // None - int64_t v51 = 0LL /* False */; - x44 = v51; - x43 = v39; - x42 = v36; - x41 = v35; - x40 = v34; + case 0LL: { // Nil + VAL v39 = MKI64(0LL /* Nil */); + int64_t v40 = 0LL /* False */; + x31 = v40; + x30 = v39; + x29 = v22; + x28 = v24; + x27 = v23; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v33 = x44; - v32 = x43; - v31 = x42; - v30 = x41; - v29 = x40; + v21 = x31; + v20 = x31; + v19 = x30; + v18 = x28; + v17 = x27; + v16 = x29; } - decref(v32); - VTUP(v31)->cells[2] = MKU64(v12); - x11 = v31; - x10 = v30; - x9 = v29; + decref(v19); + VTUP(v18)->cells[2] = MKU64(v12); + x11 = v18; + x10 = v17; + x9 = v16; } else { x11 = x2; - x10 = x3; - x9 = x1; + x10 = x1; + x9 = x3; } - *x6 = x10; + *x6 = x9; *x5 = x11; - *x4 = x9; + *x4 = x10; } static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_holeZBang (VAL x1, VAL x2, uint64_t x3, VAL *x4, VAL *x5, VAL *x6) { int64_t v7 = VI64(VTUP(x2)->cells[3]); @@ -48920,7 +36653,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_holeZBang (VAL x1, VAL x2, u VAL x10; if (((bool)v7)) { uint64_t v11 = VU64(VTUP(x2)->cells[2]); - VAL v12 = (mw_mirth_token_Token_argsZ_0(v11, x1)); + VAL v12 = mw_mirth_token_Token_argsZ_0(v11, x1); VAL v13 = mtw_mirth_type_Type_THole(x3); x10 = v13; x9 = x2; @@ -48929,7 +36662,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_holeZBang (VAL x1, VAL x2, u uint64_t v14 = VU64(VTUP(x2)->cells[2]); STR* v15; STRLIT(v15, "type holes are not allowed here", 31); - VAL v16 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v14, MKSTR(v15), x1)); + VAL v16 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v14, MKSTR(v15), x1); VAL v17 = MKI64(0LL /* TYPE_ERROR */); x10 = v17; x9 = x2; @@ -48949,7 +36682,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_dontZ_careZBang (VAL x1, VAL VAL x9; if (((bool)v6)) { uint64_t v10 = VU64(VTUP(x2)->cells[2]); - VAL v11 = (mw_mirth_token_Token_argsZ_0(v10, x1)); + VAL v11 = mw_mirth_token_Token_argsZ_0(v10, x1); VAL v12 = MKI64(1LL /* TYPE_DONT_CARE */); x9 = v12; x8 = x2; @@ -48958,7 +36691,7 @@ static void mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_dontZ_careZBang (VAL x1, VAL uint64_t v13 = VU64(VTUP(x2)->cells[2]); STR* v14; STRLIT(v14, "underscore is not allowed here", 30); - VAL v15 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v13, MKSTR(v14), x1)); + VAL v15 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v13, MKSTR(v14), x1); VAL v16 = MKI64(0LL /* TYPE_ERROR */); x9 = v16; x8 = x2; @@ -49030,7 +36763,7 @@ static void mw_mirth_elab_elabZ_simpleZ_typeZ_argZBang (VAL x1, uint64_t x2, VAL VAL v5 = mw_mirth_var_Ctx0(); int64_t v6 = 0LL /* False */; int64_t v7 = 0LL /* False */; - VAL v8 = (mtw_mirth_elab_ZPlusTypeElab_ZPlusTypeElab(v5, x2, v6, v7)); + VAL v8 = mtw_mirth_elab_ZPlusTypeElab_ZPlusTypeElab(v5, x2, v6, v7); VAL v9; VAL v10; VAL v11; @@ -49232,35 +36965,26 @@ static void mw_mirth_elab_guessZ_initialZ_ctxZ_type (VAL x1, uint64_t x2, VAL *x bool v35 = (str_cmp(VSTR(v33), v34) == 0); VAL x36; VAL x37; - VAL x38; - VAL x39; - uint64_t x40; if (v35) { + VAL v38 = mw_mirth_type_T0(); + VAL v39 = mw_mirth_type_RESOURCEz_WORLD(); + VAL v40 = mw_mirth_type_TZPlus(v38, v39); + decref(v9); VAL v41 = mw_mirth_type_T0(); VAL v42 = mw_mirth_type_RESOURCEz_WORLD(); VAL v43 = mw_mirth_type_TZPlus(v41, v42); - decref(v9); - VAL v44 = mw_mirth_type_T0(); - VAL v45 = mw_mirth_type_RESOURCEz_WORLD(); - VAL v46 = mw_mirth_type_TZPlus(v44, v45); decref(v11); - x40 = x2; - x39 = v13; - x38 = v46; x37 = v43; - x36 = v7; + x36 = v40; } else { - x40 = x2; - x39 = v13; - x38 = v11; - x37 = v9; - x36 = v7; + x37 = v11; + x36 = v9; } - x18 = x37; - x17 = x40; - x16 = x39; - x15 = x38; - x14 = x36; + x18 = x36; + x17 = x2; + x16 = v13; + x15 = x37; + x14 = v7; } break; default: { decref(v12); @@ -49271,112 +36995,81 @@ static void mw_mirth_elab_guessZ_initialZ_ctxZ_type (VAL x1, uint64_t x2, VAL *x x14 = v7; } break; } - int64_t v47 = mw_mirth_word_Word_arity(x17); - int64_t v48 = 0LL; - bool v49 = (v47 > v48); - VAL v50 = x14; - VAL v51 = x15; - VAL v52 = (x16); - VAL v53 = x18; - uint64_t v54 = x17; - int64_t v55 = v47; - bool v56 = v49; - while (v56) { - VAL v57 = v50; - VAL v58 = v51; - VAL v59 = (v52); - VAL v60 = v53; - uint64_t v61 = v54; - int64_t v62 = v55; - uint64_t v63 = mw_mirth_type_MetaVar_newZBang(); - VAL v64 = mtw_mirth_type_StackType_STMeta(v63); - uint64_t v65 = mw_mirth_type_MetaVar_newZBang(); - VAL v66 = mtw_mirth_type_StackType_STMeta(v65); - VAL v67 = mw_mirth_type_TZ_ZTo(v64, v66); - VAL v68 = mw_mirth_type_ArrowType_ZToType(v67); - VAL v69 = mw_mirth_type_TZMul(v60, v68); - int64_t v70 = 1LL; - int64_t v71 = i64_sub(v62, v70); - int64_t v72 = 0LL; - bool v73 = (v71 < v72); - int64_t x74; - if (v73) { - int64_t v75 = 0LL; - x74 = v75; - lpush(&lbl_ctx, v57); - lpush(&lbl_cod, v58); - push_resource(v59); - lpush(&lbl_word, MKU64(v61)); - lpush(&lbl_dom, v69); + int64_t v44 = mw_mirth_word_Word_arity(x17); + int64_t v45 = 0LL; + bool v46 = (v44 > v45); + VAL v47 = x18; + int64_t v48 = v44; + bool v49 = v46; + while (v49) { + VAL v50 = v47; + int64_t v51 = v48; + uint64_t v52 = mw_mirth_type_MetaVar_newZBang(); + VAL v53 = mtw_mirth_type_StackType_STMeta(v52); + uint64_t v54 = mw_mirth_type_MetaVar_newZBang(); + VAL v55 = mtw_mirth_type_StackType_STMeta(v54); + VAL v56 = mw_mirth_type_TZ_ZTo(v53, v55); + VAL v57 = mw_mirth_type_ArrowType_ZToType(v56); + VAL v58 = mw_mirth_type_TZMul(v50, v57); + int64_t v59 = 1LL; + int64_t v60 = i64_sub(v51, v59); + int64_t v61 = 0LL; + bool v62 = (v60 < v61); + int64_t x63; + if (v62) { + int64_t v64 = 0LL; + x63 = v64; } else { - x74 = v71; - lpush(&lbl_ctx, v57); - lpush(&lbl_cod, v58); - push_resource(v59); - lpush(&lbl_word, MKU64(v61)); - lpush(&lbl_dom, v69); - } - int64_t v76 = 0LL; - bool v77 = (x74 > v76); - v56 = v77; - v55 = x74; - uint64_t v78 = VU64(lpop(&lbl_word)); - v54 = v78; - VAL v79 = lpop(&lbl_dom); - v53 = v79; - VAL r80 = pop_resource(); - v52 = r80; - VAL v81 = lpop(&lbl_cod); - v51 = v81; - VAL v82 = lpop(&lbl_ctx); - v50 = v82; - } - VAL v83 = mw_mirth_type_TZ_ZTo(v53, v51); - incref(v50); - incref(v83); - VAL v84 = MKNIL; - VAL v85 = mkcons(v84, v50); - VAL v86 = mkcons(v85, v83); - VAL v87 = mtw_mirth_mirth_PropLabel_WordType(v54); - VAL v88; - VAL v89; - mw_mirth_mirth_PropLabel_prop(v86, v87, v52, &v88, &v89); - void* v90 = mfld_mirth_word_Word_ZTildectxZ_type(v54); - mut_set(v88, v90); - int64_t v91 = 1LL /* True */; - void* v92 = mfld_mirth_word_Word_ZTildeinferringZ_typeZAsk(v54); - mut_set(MKI64(v91), v92); - *x6 = v54; - *x5 = v83; - *x4 = v50; - *x3 = v89; + x63 = v60; + } + int64_t v65 = 0LL; + bool v66 = (x63 > v65); + v49 = v66; + v48 = x63; + v47 = v58; + } + VAL v67 = mw_mirth_type_TZ_ZTo(v47, x15); + incref(x14); + incref(v67); + VAL v68 = MKNIL; + VAL v69 = mkcons(v68, x14); + VAL v70 = mkcons(v69, v67); + VAL v71 = mtw_mirth_mirth_PropLabel_WordType(x17); + VAL v72; + VAL v73; + mw_mirth_mirth_PropLabel_prop(v70, v71, x16, &v72, &v73); + void* v74 = mfld_mirth_word_Word_ZTildectxZ_type(x17); + mut_set(v72, v74); + int64_t v75 = 1LL /* True */; + void* v76 = mfld_mirth_word_Word_ZTildeinferringZ_typeZAsk(x17); + mut_set(MKI64(v75), v76); + *x6 = x17; + *x5 = v67; + *x4 = x14; + *x3 = v73; } static void mw_mirth_elab_abZ_unifyZ_typeZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { VAL v6; VAL v7; mw_mirth_elab_abZ_typeZAt(x3, &v6, &v7); VAL v8; - uint64_t v9; - mw_mirth_elab_abZ_tokenZAt(v6, &v8, &v9); + VAL v9; VAL v10; - uint64_t v11; - VAL v12; - mw_mirth_type_StackType_unifyZBang(x2, v9, v7, x1, &v10, &v11, &v12); - mw_mirth_type_ZPlusGamma_rdrop(v11); - VAL v13 = (mw_mirth_elab_abZ_typeZBang(v8, v12)); - *x5 = v13; - *x4 = v10; + mw_mirth_elab_ZPlusAB_gamma_1_sp1(x2, v7, x1, v6, &v8, &v9, &v10); + VAL v11 = mw_mirth_elab_abZ_typeZBang(v10, v9); + *x5 = v11; + *x4 = v8; } static VAL mw_mirth_elab_abZ_atomZBang (VAL x1, VAL x2) { incref(x1); uint64_t v3 = VU64(VTUP(x1)->cells[2]); decref(x1); - VAL v4 = (mw_mirth_elab_abZ_tokenZBang(x2, v3)); + VAL v4 = mw_mirth_elab_abZ_tokenZBang(x2, v3); incref(x1); VAL v5 = VVAL(VTUP(x1)->cells[7]); incref(v5); decref(x1); - VAL v6 = (mw_mirth_elab_abZ_typeZBang(v4, v5)); + VAL v6 = mw_mirth_elab_abZ_typeZBang(v4, v5); incref(v6); incref(v6); VAL v7 = VVAL(VTUP(v6)->cells[7]); @@ -49391,56 +37084,50 @@ static VAL mw_mirth_elab_abZ_optimizzedZ_snocZBang (VAL x1, VAL x2) { incref(x1); int64_t v3 = mw_mirth_elab_atomsZ_hasZ_lastZ_blockZAsk(x1); VAL x4; - VAL x5; - int64_t x6; + int64_t x5; if (((bool)v3)) { - VAL v7; - int64_t v8; - mw_mirth_elab_atomZ_acceptsZ_argsZAsk(x2, &v7, &v8); - x6 = v8; + VAL v6; + int64_t v7; + mw_mirth_elab_atomZ_acceptsZ_argsZAsk(x2, &v6, &v7); x5 = v7; - x4 = x1; + x4 = v6; } else { - int64_t v9 = 0LL /* False */; - x6 = v9; - x5 = x2; - x4 = x1; + int64_t v8 = 0LL /* False */; + x5 = v8; + x4 = x2; } + VAL v9 = x1; VAL v10 = x4; - VAL v11 = x5; - int64_t v12 = x6; - while (((bool)v12)) { + int64_t v11 = x5; + while (((bool)v11)) { + VAL v12 = v9; VAL v13 = v10; - VAL v14 = v11; + VAL v14; VAL v15; - VAL v16; - mw_mirth_elab_atomsZ_turnZ_lastZ_blockZ_toZ_arg(v14, v13, &v15, &v16); - incref(v16); - int64_t v17 = mw_mirth_elab_atomsZ_hasZ_lastZ_blockZAsk(v16); - VAL x18; - VAL x19; - int64_t x20; - if (((bool)v17)) { - VAL v21; - int64_t v22; - mw_mirth_elab_atomZ_acceptsZ_argsZAsk(v15, &v21, &v22); - x20 = v22; - x19 = v21; - x18 = v16; + mw_mirth_elab_atomsZ_turnZ_lastZ_blockZ_toZ_arg(v13, v12, &v14, &v15); + incref(v15); + int64_t v16 = mw_mirth_elab_atomsZ_hasZ_lastZ_blockZAsk(v15); + VAL x17; + int64_t x18; + if (((bool)v16)) { + VAL v19; + int64_t v20; + mw_mirth_elab_atomZ_acceptsZ_argsZAsk(v14, &v19, &v20); + x18 = v20; + x17 = v19; } else { - int64_t v23 = 0LL /* False */; - x20 = v23; - x19 = v15; - x18 = v16; + int64_t v21 = 0LL /* False */; + x18 = v21; + x17 = v14; } - v12 = x20; - v11 = x19; - v10 = x18; + v11 = x18; + v10 = x17; + v9 = v15; } - VAL v24 = mw_std_list_List_1_reverse(v10); - VAL v25 = mtw_std_list_List_1_Cons(v11, v24); - VAL v26 = mw_std_list_List_1_reverse(v25); - return v26; + VAL v22 = mw_std_list_List_1_reverse(v9); + VAL v23 = mtw_std_list_List_1_Cons(v10, v22); + VAL v24 = mw_std_list_List_1_reverse(v23); + return v24; } static void mw_mirth_elab_atomZ_acceptsZ_argsZAsk (VAL x1, VAL *x2, int64_t *x3) { incref(x1); @@ -49642,7 +37329,7 @@ static void mw_mirth_elab_abZ_opZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) mw_mirth_elab_abZ_expandZ_opsigZBang(v14, v12, v10, &v15, &v16, &v17, &v18); VAL v19 = MKI64(0LL /* Nil */); VAL v20 = mtw_mirth_arrow_Atom_Atom(v11, v9, v7, x1, v19, v15, v16, v13); - VAL v21 = (mw_mirth_elab_abZ_atomZBang(v20, v18)); + VAL v21 = mw_mirth_elab_abZ_atomZBang(v20, v18); *x5 = v21; *x4 = v17; } @@ -49785,11 +37472,7 @@ static void mw_mirth_elab_abZ_primZBang (int64_t x1, VAL x2, VAL x3, VAL *x4, VA mw_mirth_elab_abZ_tokenZAt(x3, &v13, &v14); STR* v15; STRLIT(v15, "prim does not have type", 23); - push_i64(x1); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v14, MKSTR(v15), x2); - x9 = v13; - VAL r16 = pop_resource(); - x8 = r16; } *x5 = x9; *x4 = x8; @@ -50277,14 +37960,11 @@ static void mw_mirth_elab_elabZ_arrowZ_homZBang (VAL x1, VAL x2, VAL x3, VAL x4, *x7 = v13; } static void mw_mirth_elab_elabZ_arrowZ_fwdZBang (VAL x1, VAL x2, VAL x3, uint64_t x4, VAL x5, VAL *x6, VAL *x7) { - incref(x3); - VAL v8 = MKI64(0LL /* Nil */); - VAL v9 = mtw_mirth_arrow_Arrow_Arrow(x5, x4, x4, x2, x3, x3, v8); - VAL v10; - VAL v11; - mw_mirth_elab_elabZ_atomsZBang(x1, v9, &v10, &v11); - *x7 = v11; - *x6 = v10; + VAL v8; + VAL v9; + mw_mirth_elab_abZ_buildZBang_1_sp32(x1, x2, x3, x4, x5, &v8, &v9); + *x7 = v9; + *x6 = v8; } static void mw_mirth_elab_elabZ_atomsZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5; @@ -50292,12 +37972,12 @@ static void mw_mirth_elab_elabZ_atomsZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { mw_mirth_elab_abZ_tokenZAt(x2, &v5, &v6); int64_t v7 = mw_mirth_token_Token_runZ_endZAsk(v6); bool v8 = !((bool)v7); - VAL v9 = (x1); - VAL v10 = (v5); + VAL v9 = x1; + VAL v10 = v5; bool v11 = v8; while (v11) { - VAL v12 = (v9); - VAL v13 = (v10); + VAL v12 = v9; + VAL v13 = v10; VAL v14; VAL v15; mw_mirth_elab_elabZ_atomZBang(v12, v13, &v14, &v15); @@ -50305,7 +37985,7 @@ static void mw_mirth_elab_elabZ_atomsZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { uint64_t v17; mw_mirth_elab_abZ_tokenZAt(v15, &v16, &v17); uint64_t v18 = mw_mirth_token_Token_next(v17); - VAL v19 = (mw_mirth_elab_abZ_tokenZBang(v16, v18)); + VAL v19 = mw_mirth_elab_abZ_tokenZBang(v16, v18); VAL v20; uint64_t v21; mw_mirth_elab_abZ_tokenZAt(v19, &v20, &v21); @@ -50387,7 +38067,7 @@ static void mw_mirth_elab_elabZ_atomZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v32; uint64_t v33; mw_mirth_elab_abZ_tokenZAt(v5, &v32, &v33); - VAL v34 = (mw_mirth_token_Token_argsZ_0(v33, x1)); + VAL v34 = mw_mirth_token_Token_argsZ_0(v33, x1); VAL v35; VAL v36; mw_mirth_elab_abZ_labelZ_pushZBang(v31, v34, v32, &v35, &v36); @@ -50399,7 +38079,7 @@ static void mw_mirth_elab_elabZ_atomZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v38; uint64_t v39; mw_mirth_elab_abZ_tokenZAt(v5, &v38, &v39); - VAL v40 = (mw_mirth_token_Token_argsZ_0(v39, x1)); + VAL v40 = mw_mirth_token_Token_argsZ_0(v39, x1); VAL v41; VAL v42; mw_mirth_elab_abZ_labelZ_popZBang(v37, v40, v38, &v41, &v42); @@ -50411,7 +38091,7 @@ static void mw_mirth_elab_elabZ_atomZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v44; uint64_t v45; mw_mirth_elab_abZ_tokenZAt(v5, &v44, &v45); - VAL v46 = (mw_mirth_token_Token_argsZ_0(v45, x1)); + VAL v46 = mw_mirth_token_Token_argsZ_0(v45, x1); VAL v47; VAL v48; mw_mirth_elab_abZ_labelZ_pushZ_rZBang(v43, v46, v44, &v47, &v48); @@ -50423,7 +38103,7 @@ static void mw_mirth_elab_elabZ_atomZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v50; uint64_t v51; mw_mirth_elab_abZ_tokenZAt(v5, &v50, &v51); - VAL v52 = (mw_mirth_token_Token_argsZ_0(v51, x1)); + VAL v52 = mw_mirth_token_Token_argsZ_0(v51, x1); VAL v53; VAL v54; mw_mirth_elab_abZ_labelZ_popZ_rZBang(v49, v52, v50, &v53, &v54); @@ -50452,11 +38132,7 @@ static void mw_mirth_elab_elabZ_atomZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { mw_mirth_elab_abZ_tokenZAt(v5, &v61, &v62); STR* v63; STRLIT(v63, "Unexpected token in elab-atom!", 30); - push_value(v7); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v62, MKSTR(v63), x1); - x9 = v61; - VAL r64 = pop_resource(); - x8 = r64; } break; } *x4 = x9; @@ -50476,11 +38152,11 @@ static void mw_mirth_elab_elabZ_labelZ_getZBang (uint64_t x1, VAL x2, VAL x3, VA uint64_t v13; VAL v14; mw_mirth_token_Token_argsZ_1(v12, v9, &v13, &v14); - VAL v15 = (mw_mirth_elab_abZ_tokenZBang(v11, v13)); + VAL v15 = mw_mirth_elab_abZ_tokenZBang(v11, v13); VAL v16; VAL v17; mw_mirth_elab_elabZ_atomsZBang(v14, v15, &v16, &v17); - VAL v18 = (mw_mirth_elab_abZ_tokenZBang(v17, v12)); + VAL v18 = mw_mirth_elab_abZ_tokenZBang(v17, v12); VAL v19; VAL v20; mw_mirth_elab_abZ_labelZ_pushZ_rZBang(x1, v16, v18, &v19, &v20); @@ -50514,11 +38190,11 @@ static void mw_mirth_elab_elabZ_labelZ_getZBang (uint64_t x1, VAL x2, VAL x3, VA uint64_t v36; VAL v37; mw_mirth_token_Token_argsZ_1(v35, v21, &v36, &v37); - VAL v38 = (mw_mirth_elab_abZ_tokenZBang(v34, v36)); + VAL v38 = mw_mirth_elab_abZ_tokenZBang(v34, v36); VAL v39; VAL v40; mw_mirth_elab_elabZ_atomsZBang(v37, v38, &v39, &v40); - VAL v41 = (mw_mirth_elab_abZ_tokenZBang(v40, v35)); + VAL v41 = mw_mirth_elab_abZ_tokenZBang(v40, v35); x30 = v41; x29 = v39; x28 = x1; @@ -50536,7 +38212,7 @@ static void mw_mirth_elab_elabZ_labelZ_setZBang (uint64_t x1, VAL x2, VAL x3, VA VAL v6; uint64_t v7; mw_mirth_elab_abZ_tokenZAt(x3, &v6, &v7); - VAL v8 = (mw_mirth_token_Token_argsZ_0(v7, x2)); + VAL v8 = mw_mirth_token_Token_argsZ_0(v7, x2); VAL v9; VAL v10; mw_mirth_elab_abZ_labelZ_popZBang(x1, v8, v6, &v9, &v10); @@ -50570,104 +38246,96 @@ static void mw_mirth_elab_elabZ_blockZ_atZBang (uint64_t x1, VAL x2, VAL x3, VAL VAL v8; VAL v9; mw_mirth_elab_abZ_homeZAt(v6, &v8, &v9); - FNPTR v10 = &mb_mirth_elab_elabZ_blockZ_atZBang_1; - VAL v11; - uint64_t v12; - mw_mirth_arrow_Block_newZ_deferredZBang_1(x2, v7, x1, v9, MKFNPTR(v10), &v11, &v12); - VAL v13 = mtw_mirth_arrow_Op_OpBlockPush(v12); - VAL v14; - VAL v15; - mw_mirth_elab_abZ_opZBang(v13, v11, v8, &v14, &v15); - *x5 = v15; - *x4 = v14; + uint64_t v10 = mw_mirth_arrow_Block_allocZBang(); + void* v11 = mfld_mirth_arrow_Block_ZTildehome(v10); + mut_set(v9, v11); + mw_mirth_arrow_Block_registerZ_homeZBang(v10); + void* v12 = mfld_mirth_arrow_Block_ZTildetoken(v10); + mut_set(MKU64(x1), v12); + void* v13 = mfld_mirth_arrow_Block_ZTildectx(v10); + mut_set(v7, v13); + uint64_t v14 = mw_mirth_type_MetaVar_newZBang(); + VAL v15 = mtw_mirth_type_StackType_STMeta(v14); + void* v16 = mfld_mirth_arrow_Block_ZTildedom(v10); + mut_set(v15, v16); + uint64_t v17 = mw_mirth_type_MetaVar_newZBang(); + VAL v18 = mtw_mirth_type_StackType_STMeta(v17); + void* v19 = mfld_mirth_arrow_Block_ZTildecod(v10); + mut_set(v18, v19); + VAL v20 = mtw_mirth_mirth_PropLabel_BlockArrow(v10); + FNPTR v21 = &mb_mirth_mirth_PropLabel_prop_1_sp21_0; + VAL v22 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(v10), MKFNPTR(v21)); + VAL v23 = mtw_mirth_mirth_Prop_1_Prop(v20, v22); + void* v24 = mfld_mirth_arrow_Block_ZTildearrow(v10); + mut_set(v23, v24); + VAL v25 = mtw_mirth_arrow_Op_OpBlockPush(v10); + VAL v26; + VAL v27; + mw_mirth_elab_abZ_opZBang(v25, x2, v8, &v26, &v27); + *x5 = v27; + *x4 = v26; } static void mw_mirth_elab_elabZ_argsZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5; uint64_t v6; mw_mirth_elab_abZ_tokenZAt(x2, &v5, &v6); VAL v7 = mw_mirth_token_Token_args(v6); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v7, &v8, &v9); - VAL x10; - VAL x11; - VAL x12; - int64_t x13; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v8); - VAL v15; - VAL v16; - mw_mirth_elab_elabZ_blockZ_atZBang(VU64(v14), x1, v5, &v15, &v16); - int64_t v17 = 1LL /* True */; - x13 = v17; - x12 = v9; - x11 = v16; - x10 = v15; - } break; - case 0LL: { // None - int64_t v18 = 0LL /* False */; - x13 = v18; - x12 = v9; - x11 = v5; - x10 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v19 = (x10); - VAL v20 = (x11); - VAL v21 = x12; - int64_t v22 = x13; - while (((bool)v22)) { - VAL v23 = (v19); - VAL v24 = (v20); - VAL v25 = v21; - VAL v26; - VAL v27; - mw_std_list_List_1_uncons(v25, &v26, &v27); - VAL x28; - VAL x29; - VAL x30; - int64_t x31; - switch (get_data_tag(v26)) { - case 1LL: { // Some - VAL v32 = mtp_std_maybe_Maybe_1_Some(v26); - VAL v33; - VAL v34; - mw_mirth_elab_elabZ_blockZ_atZBang(VU64(v32), v23, v24, &v33, &v34); - int64_t v35 = 1LL /* True */; - x31 = v35; - x30 = v27; - x29 = v34; - x28 = v33; + int64_t v8 = 1LL /* True */; + VAL v9 = x1; + VAL v10 = v5; + VAL v11 = v7; + int64_t v12 = v8; + int64_t v13 = v8; + while (((bool)v13)) { + VAL v14 = v9; + VAL v15 = v10; + VAL v16 = v11; + int64_t v17 = v12; + VAL x18; + VAL x19; + VAL x20; + int64_t x21; + switch (get_data_tag(v16)) { + case 1LL: { // Cons + VAL v22; + VAL v23; + mtp_std_list_List_1_Cons(v16, &v22, &v23); + VAL v24; + VAL v25; + mw_mirth_elab_elabZ_blockZ_atZBang(VU64(v22), v14, v15, &v24, &v25); + int64_t v26 = 1LL /* True */; + x21 = v26; + x20 = v23; + x19 = v25; + x18 = v24; } break; - case 0LL: { // None - int64_t v36 = 0LL /* False */; - x31 = v36; - x30 = v27; - x29 = v24; - x28 = v23; + case 0LL: { // Nil + VAL v27 = MKI64(0LL /* Nil */); + int64_t v28 = 0LL /* False */; + x21 = v28; + x20 = v27; + x19 = v15; + x18 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v22 = x31; - v21 = x30; - v20 = x29; - v19 = x28; + v13 = x21; + v12 = x21; + v11 = x20; + v10 = x19; + v9 = x18; } - decref(v21); - *x4 = v20; - *x3 = v19; + decref(v11); + *x4 = v10; + *x3 = v9; } static void mw_mirth_elab_elabZ_noZ_argsZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5; uint64_t v6; mw_mirth_elab_abZ_tokenZAt(x2, &v5, &v6); - VAL v7 = (mw_mirth_token_Token_argsZ_0(v6, x1)); + VAL v7 = mw_mirth_token_Token_argsZ_0(v6, x1); *x4 = v5; *x3 = v7; } @@ -50761,290 +38429,196 @@ static void mw_mirth_elab_elabZ_atomZ_resolveZ_defZBang (VAL x1, VAL x2, VAL x3, incref(v16); VAL v17 = MKI64(0LL /* Nil */); VAL v18 = MKI64(0LL /* Nil */); - VAL v19; - VAL v20; - mw_std_list_List_1_uncons(v16, &v19, &v20); - VAL x21; - VAL x22; - VAL x23; - VAL x24; - VAL x25; - VAL x26; - int64_t x27; - switch (get_data_tag(v19)) { - case 1LL: { // Some - VAL v28 = mtp_std_maybe_Maybe_1_Some(v19); - incref(v28); - VAL v29; - int64_t v30; - mw_mirth_def_Def_callableZAsk(v14, v28, &v29, &v30); - VAL x31; - VAL x32; - VAL x33; - VAL x34; - if (((bool)v30)) { - VAL v35 = mtw_std_either_Either_2_Right(v28); - x34 = v35; - x33 = v15; - x32 = v29; - x31 = v10; - } else { - VAL v36 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v28); - VAL v37 = mtw_std_either_Either_2_Left(v36); - x34 = v37; - x33 = v15; - x32 = v29; - x31 = v10; - } - VAL x38; - VAL x39; - VAL x40; - VAL x41; - VAL x42; - switch (get_data_tag(x34)) { - case 0LL: { // Left - VAL v43 = mtp_std_either_Either_2_Left(x34); - VAL v44 = mtw_std_list_List_1_Cons(v43, v17); - x42 = v18; - x41 = v44; - x40 = x33; - x39 = x32; - x38 = x31; - } break; - case 1LL: { // Right - VAL v45 = mtp_std_either_Either_2_Right(x34); - VAL v46 = mtw_std_list_List_1_Cons(v45, v18); - x42 = v46; - x41 = v17; - x40 = x33; - x39 = x32; - x38 = x31; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v47 = 1LL /* True */; - x27 = v47; - x26 = v20; - x25 = x42; - x24 = x41; - x23 = x40; - x22 = x39; - x21 = x38; - } break; - case 0LL: { // None - int64_t v48 = 0LL /* False */; - x27 = v48; - x26 = v20; - x25 = v18; - x24 = v17; - x23 = v15; - x22 = v14; - x21 = v10; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v49 = x21; - VAL v50 = (x22); - VAL v51 = (x23); - VAL v52 = x24; - VAL v53 = x25; - VAL v54 = x26; - int64_t v55 = x27; - while (((bool)v55)) { - VAL v56 = v49; - VAL v57 = (v50); - VAL v58 = (v51); - VAL v59 = v52; - VAL v60 = v53; - VAL v61 = v54; - VAL v62; - VAL v63; - mw_std_list_List_1_uncons(v61, &v62, &v63); - VAL x64; - VAL x65; - VAL x66; - VAL x67; - VAL x68; - VAL x69; - int64_t x70; - switch (get_data_tag(v62)) { - case 1LL: { // Some - VAL v71 = mtp_std_maybe_Maybe_1_Some(v62); - incref(v71); - VAL v72; - int64_t v73; - mw_mirth_def_Def_callableZAsk(v57, v71, &v72, &v73); - VAL x74; - VAL x75; - VAL x76; - VAL x77; - if (((bool)v73)) { - VAL v78 = mtw_std_either_Either_2_Right(v71); - x77 = v78; - x76 = v58; - x75 = v72; - x74 = v56; + int64_t v19 = 1LL /* True */; + VAL v20 = v14; + VAL v21 = v15; + VAL v22 = v17; + VAL v23 = v18; + VAL v24 = v16; + int64_t v25 = v19; + int64_t v26 = v19; + while (((bool)v26)) { + VAL v27 = v20; + VAL v28 = v21; + VAL v29 = v22; + VAL v30 = v23; + VAL v31 = v24; + int64_t v32 = v25; + VAL x33; + VAL x34; + VAL x35; + VAL x36; + VAL x37; + int64_t x38; + switch (get_data_tag(v31)) { + case 1LL: { // Cons + VAL v39; + VAL v40; + mtp_std_list_List_1_Cons(v31, &v39, &v40); + incref(v39); + VAL v41; + int64_t v42; + mw_mirth_def_Def_callableZAsk(v27, v39, &v41, &v42); + VAL x43; + VAL x44; + VAL x45; + if (((bool)v42)) { + VAL v46 = mtw_std_either_Either_2_Right(v39); + x45 = v46; + x44 = v28; + x43 = v41; } else { - VAL v79 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v71); - VAL v80 = mtw_std_either_Either_2_Left(v79); - x77 = v80; - x76 = v58; - x75 = v72; - x74 = v56; + VAL v47 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v39); + VAL v48 = mtw_std_either_Either_2_Left(v47); + x45 = v48; + x44 = v28; + x43 = v41; } - VAL x81; - VAL x82; - VAL x83; - VAL x84; - VAL x85; - switch (get_data_tag(x77)) { + VAL x49; + VAL x50; + VAL x51; + VAL x52; + switch (get_data_tag(x45)) { case 0LL: { // Left - VAL v86 = mtp_std_either_Either_2_Left(x77); - VAL v87 = mtw_std_list_List_1_Cons(v86, v59); - x85 = v60; - x84 = v87; - x83 = x76; - x82 = x75; - x81 = x74; + VAL v53 = mtp_std_either_Either_2_Left(x45); + VAL v54 = mtw_std_list_List_1_Cons(v53, v29); + x52 = v30; + x51 = v54; + x50 = x44; + x49 = x43; } break; case 1LL: { // Right - VAL v88 = mtp_std_either_Either_2_Right(x77); - VAL v89 = mtw_std_list_List_1_Cons(v88, v60); - x85 = v89; - x84 = v59; - x83 = x76; - x82 = x75; - x81 = x74; + VAL v55 = mtp_std_either_Either_2_Right(x45); + VAL v56 = mtw_std_list_List_1_Cons(v55, v30); + x52 = v56; + x51 = v29; + x50 = x44; + x49 = x43; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v90 = 1LL /* True */; - x70 = v90; - x69 = v63; - x68 = x85; - x67 = x84; - x66 = x83; - x65 = x82; - x64 = x81; + int64_t v57 = 1LL /* True */; + x38 = v57; + x37 = v40; + x36 = x52; + x35 = x51; + x34 = x50; + x33 = x49; } break; - case 0LL: { // None - int64_t v91 = 0LL /* False */; - x70 = v91; - x69 = v63; - x68 = v60; - x67 = v59; - x66 = v58; - x65 = v57; - x64 = v56; + case 0LL: { // Nil + VAL v58 = MKI64(0LL /* Nil */); + int64_t v59 = 0LL /* False */; + x38 = v59; + x37 = v58; + x36 = v30; + x35 = v29; + x34 = v28; + x33 = v27; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v55 = x70; - v54 = x69; - v53 = x68; - v52 = x67; - v51 = x66; - v50 = x65; - v49 = x64; - } - decref(v54); - VAL v92 = mw_std_list_List_1_reverse(v52); - VAL v93 = mw_std_list_List_1_reverse(v53); - VAL v94 = VVAL(VTUP(v51)->cells[5]); - incref(v94); - VAL v95 = mw_std_list_List_1_cat(v92, v94); - VAL v96 = VTUP(v51)->cells[5]; - decref(v96); - VTUP(v51)->cells[5] = v95; - VAL v97 = VTUP(v51)->cells[4]; - decref(v97); - VTUP(v51)->cells[4] = v93; - VAL v98; - VAL v99; - mw_mirth_elab_ZPlusResolveDef_filterZ_arity(v50, v51, &v98, &v99); - VAL v100; - VAL v101; - mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v98, v99, &v100, &v101); - uint64_t v102 = VU64(VTUP(v101)->cells[2]); - int64_t v103 = mw_mirth_token_Token_canZ_beZ_relativeZ_nameZ_orZ_dnameZAsk(v102); - VAL x104; - VAL x105; - VAL x106; - if (((bool)v103)) { - VAL v107; - VAL v108; - mw_mirth_elab_abZ_typeZAt(v49, &v107, &v108); - int64_t v109 = mw_mirth_type_StackType_topZ_typesZ_areZ_fineZAsk(v108); - VAL x110; - VAL x111; - VAL x112; - if (((bool)v109)) { - VAL v113; - VAL v114; - mw_mirth_elab_abZ_typeZAt(v107, &v113, &v114); - VAL v115 = mw_mirth_type_StackType_topZ_namespaces(v114); - VAL v116; - VAL v117; - mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v115, v100, v101, &v116, &v117); - x112 = v113; - x111 = v117; - x110 = v116; + v26 = x38; + v25 = x38; + v24 = x37; + v23 = x36; + v22 = x35; + v21 = x34; + v20 = x33; + } + decref(v24); + VAL v60 = mw_std_list_List_1_reverse(v22); + VAL v61 = mw_std_list_List_1_reverse(v23); + VAL v62 = VVAL(VTUP(v21)->cells[5]); + incref(v62); + VAL v63 = mw_std_list_List_1_cat(v60, v62); + VAL v64 = VTUP(v21)->cells[5]; + decref(v64); + VTUP(v21)->cells[5] = v63; + VAL v65 = VTUP(v21)->cells[4]; + decref(v65); + VTUP(v21)->cells[4] = v61; + VAL v66; + VAL v67; + mw_mirth_elab_ZPlusResolveDef_filterZ_arity(v20, v21, &v66, &v67); + VAL v68; + VAL v69; + mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v66, v67, &v68, &v69); + uint64_t v70 = VU64(VTUP(v69)->cells[2]); + int64_t v71 = mw_mirth_token_Token_canZ_beZ_relativeZ_nameZ_orZ_dnameZAsk(v70); + VAL x72; + VAL x73; + VAL x74; + if (((bool)v71)) { + VAL v75; + VAL v76; + mw_mirth_elab_abZ_typeZAt(v10, &v75, &v76); + int64_t v77 = mw_mirth_type_StackType_topZ_typesZ_areZ_fineZAsk(v76); + VAL x78; + VAL x79; + VAL x80; + if (((bool)v77)) { + VAL v81; + VAL v82; + mw_mirth_elab_abZ_typeZAt(v75, &v81, &v82); + VAL v83 = mw_mirth_type_StackType_topZ_namespaces(v82); + VAL v84; + VAL v85; + mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v83, v68, v69, &v84, &v85); + x80 = v85; + x79 = v84; + x78 = v81; } else { - x112 = v107; - x111 = v101; - x110 = v100; + x80 = v69; + x79 = v68; + x78 = v75; } - x106 = x112; - x105 = x111; - x104 = x110; + x74 = x78; + x73 = x80; + x72 = x79; } else { - VAL v118 = MKI64(0LL /* Nil */); - VAL v119; - VAL v120; - mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v118, v100, v101, &v119, &v120); - x106 = v49; - x105 = v120; - x104 = v119; - } - VAL v121; - VAL v122; - mw_mirth_elab_resolveZ_defZ_endZBang(x104, x105, &v121, &v122); - VAL x123; - VAL x124; - switch (get_data_tag(v122)) { + VAL v86 = MKI64(0LL /* Nil */); + VAL v87; + VAL v88; + mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v86, v68, v69, &v87, &v88); + x74 = v10; + x73 = v88; + x72 = v87; + } + VAL v89; + VAL v90; + mw_mirth_elab_resolveZ_defZ_endZBang(x72, x73, &v89, &v90); + VAL x91; + VAL x92; + switch (get_data_tag(v90)) { case 0LL: { // None - VAL v125; - VAL v126; - mw_mirth_elab_elabZ_atomZ_failedZBang(v121, x106, &v125, &v126); - x124 = v126; - x123 = v125; + VAL v93; + VAL v94; + mw_mirth_elab_elabZ_atomZ_failedZBang(v89, x74, &v93, &v94); + x92 = v94; + x91 = v93; } break; case 1LL: { // Some - VAL v127 = mtp_std_maybe_Maybe_1_Some(v122); - VAL v128; - VAL v129; - mw_mirth_elab_elabZ_atomZ_defZBang(v127, v121, x106, &v128, &v129); - x124 = v129; - x123 = v128; + VAL v95 = mtp_std_maybe_Maybe_1_Some(v90); + VAL v96; + VAL v97; + mw_mirth_elab_elabZ_atomZ_defZBang(v95, v89, x74, &v96, &v97); + x92 = v97; + x91 = v96; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x5 = x124; - *x4 = x123; + *x5 = x92; + *x4 = x91; } static void mw_mirth_elab_elabZ_atomZ_failedZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5 = MKI64(0LL /* STACK_TYPE_ERROR */); - VAL v6 = (mw_mirth_elab_abZ_typeZBang(x2, v5)); + VAL v6 = mw_mirth_elab_abZ_typeZBang(x2, v5); *x4 = v6; *x3 = x1; } @@ -51168,7 +38742,7 @@ static void mw_mirth_elab_elabZ_atomZ_notZ_aZ_wordZBang (VAL x1, VAL x2, VAL x3, VAL v15; mw_mirth_name_QName_ZToStr(x2, x1, &v14, &v15); STR* v16 = str_cat(v13, VSTR(v15)); - VAL v17 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v12, MKSTR(v16), v14)); + VAL v17 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v12, MKSTR(v16), v14); x10 = v11; x9 = v17; } else { @@ -51226,7 +38800,7 @@ static void mw_mirth_elab_elabZ_atomZ_assertZBang (VAL x1, VAL x2, VAL *x3, VAL mw_mirth_elab_abZ_ctxZAt(v5, &v9, &v10); int64_t v11 = 1LL /* True */; int64_t v12 = 0LL /* False */; - VAL v13 = (mtw_mirth_elab_ZPlusTypeElab_ZPlusTypeElab(v10, v7, v11, v12)); + VAL v13 = mtw_mirth_elab_ZPlusTypeElab_ZPlusTypeElab(v10, v7, v11, v12); VAL v14; VAL v15; VAL v16; @@ -51236,16 +38810,12 @@ static void mw_mirth_elab_elabZ_atomZ_assertZBang (VAL x1, VAL x2, VAL *x3, VAL VAL v18; mw_mirth_elab_abZ_typeZAt(v9, &v17, &v18); VAL v19; - uint64_t v20; - mw_mirth_elab_abZ_tokenZAt(v17, &v19, &v20); + VAL v20; VAL v21; - uint64_t v22; - VAL v23; - mw_mirth_type_StackType_unifyZBang(v14, v20, v18, v16, &v21, &v22, &v23); - mw_mirth_type_ZPlusGamma_rdrop(v22); - decref(v23); - *x4 = v19; - *x3 = v21; + mw_mirth_elab_ZPlusAB_gamma_1_sp1(v14, v18, v16, v17, &v19, &v20, &v21); + decref(v20); + *x4 = v21; + *x3 = v19; } static void mw_mirth_elab_elabZ_atomZ_matchZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { uint64_t v5 = mw_mirth_type_MetaVar_newZBang(); @@ -51255,51 +38825,44 @@ static void mw_mirth_elab_elabZ_atomZ_matchZBang (VAL x1, VAL x2, VAL *x3, VAL * mw_mirth_elab_abZ_tokenZAt(x2, &v7, &v8); uint64_t v9 = mw_mirth_token_Token_succ(v8); VAL v10 = mw_mirth_token_Token_lcurlyZAsk(v9); - VAL x11; - VAL x12; - uint64_t x13; + int64_t v11 = get_data_tag(v10); + decref(v10); + int64_t v12 = 1LL; + bool v13 = (v11 == v12); VAL x14; - switch (get_data_tag(v10)) { - case 1LL: { // Some - VAL v15 = mtp_std_maybe_Maybe_1_Some(v10); - decref(v15); - VAL v16; - uint64_t v17; - mw_mirth_elab_abZ_tokenZAt(v7, &v16, &v17); - uint64_t v18 = mw_mirth_token_Token_succ(v17); - uint64_t v19 = mw_mirth_token_Token_succ(v18); - VAL v20; - uint64_t v21; - mw_mirth_elab_abZ_tokenZAt(v16, &v20, &v21); - uint64_t v22 = mw_mirth_token_Token_succ(v21); - VAL v23 = (mw_mirth_elab_abZ_tokenZBang(v20, v22)); - x14 = v23; - x13 = v19; - x12 = v6; - x11 = x1; - } break; - case 0LL: { // None - VAL v24; - uint64_t v25; - mw_mirth_elab_abZ_tokenZAt(v7, &v24, &v25); - VAL v26; - VAL v27; - mw_mirth_token_Token_argsZPlus(v25, x1, &v26, &v27); - VAL v28 = mw_std_list_ListZPlus_1_first(v26); - x14 = v24; - x13 = VU64(v28); - x12 = v6; - x11 = v27; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + uint64_t x15; + VAL x16; + if (v13) { + VAL v17; + uint64_t v18; + mw_mirth_elab_abZ_tokenZAt(v7, &v17, &v18); + uint64_t v19 = mw_mirth_token_Token_succ(v18); + uint64_t v20 = mw_mirth_token_Token_succ(v19); + VAL v21; + uint64_t v22; + mw_mirth_elab_abZ_tokenZAt(v17, &v21, &v22); + uint64_t v23 = mw_mirth_token_Token_succ(v22); + VAL v24 = mw_mirth_elab_abZ_tokenZBang(v21, v23); + x16 = v24; + x15 = v20; + x14 = x1; + } else { + VAL v25; + uint64_t v26; + mw_mirth_elab_abZ_tokenZAt(v7, &v25, &v26); + VAL v27; + VAL v28; + mw_mirth_token_Token_argsZPlus(v26, x1, &v27, &v28); + VAL v29 = mw_std_list_ListZPlus_1_first(v27); + x16 = v25; + x15 = VU64(v29); + x14 = v28; } - VAL v29; VAL v30; - mw_mirth_elab_elabZ_matchZ_atZBang(x12, x13, x11, x14, &v29, &v30); - *x4 = v30; - *x3 = v29; + VAL v31; + mw_mirth_elab_elabZ_matchZ_atZBang(v6, x15, x14, x16, &v30, &v31); + *x4 = v31; + *x3 = v30; } static void mw_mirth_elab_elabZ_matchZ_atZBang (VAL x1, uint64_t x2, VAL x3, VAL x4, VAL *x5, VAL *x6) { VAL v7; @@ -51315,7 +38878,7 @@ static void mw_mirth_elab_elabZ_matchZ_atZBang (VAL x1, uint64_t x2, VAL x3, VAL VAL v14; mw_mirth_elab_abZ_homeZAt(v11, &v13, &v14); VAL v15 = MKI64(0LL /* Nil */); - VAL v16 = (mtw_mirth_match_ZPlusMatch_ZPlusMatch(v14, v12, x2, v8, v10, x1, v15)); + VAL v16 = mtw_mirth_match_ZPlusMatch_ZPlusMatch(v14, v12, x2, v8, v10, x1, v15); VAL v17; VAL v18; mw_mirth_elab_elabZ_matchZ_casesZBang(x3, v16, &v17, &v18); @@ -51333,185 +38896,115 @@ static void mw_mirth_elab_elabZ_matchZ_atZBang (VAL x1, uint64_t x2, VAL x3, VAL static void mw_mirth_elab_elabZ_matchZ_casesZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { uint64_t v5 = VU64(VTUP(x2)->cells[3]); VAL v6 = mw_mirth_token_Token_lcurlyZAsk(v5); - VAL x7; - VAL x8; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v6); - decref(v9); - VAL v10; - VAL v11; - mw_mirth_elab_elabZ_matchZ_casesZ_curlyZBang(x1, x2, &v10, &v11); - x8 = v11; - x7 = v10; - } break; - case 0LL: { // None - VAL v12; - VAL v13; - mw_mirth_elab_elabZ_matchZ_casesZ_argsZBang(x1, x2, &v12, &v13); - x8 = v13; - x7 = v12; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v7 = get_data_tag(v6); + decref(v6); + int64_t v8 = 1LL; + bool v9 = (v7 == v8); + VAL x10; + VAL x11; + if (v9) { + VAL v12; + VAL v13; + mw_mirth_elab_elabZ_matchZ_casesZ_curlyZBang(x1, x2, &v12, &v13); + x11 = v13; + x10 = v12; + } else { + VAL v14; + VAL v15; + mw_mirth_elab_elabZ_matchZ_casesZ_argsZBang(x1, x2, &v14, &v15); + x11 = v15; + x10 = v14; } - *x4 = x8; - *x3 = x7; + *x4 = x11; + *x3 = x10; } static void mw_mirth_elab_elabZ_matchZ_casesZ_curlyZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { uint64_t v5 = VU64(VTUP(x2)->cells[3]); VAL v6 = mw_mirth_token_Token_runZ_tokens(v5); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v6, &v7, &v8); - VAL x9; - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v7); - incref(v13); - VAL v14 = mw_mirth_token_Token_lcurlyZAsk(VU64(v13)); - VAL x15; - VAL x16; - uint64_t x17; - switch (get_data_tag(v14)) { - case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(v14); - decref(v18); - x17 = VU64(v13); - x16 = x2; - x15 = x1; - } break; - case 0LL: { // None - STR* v19; - STRLIT(v19, "Expected a pattern match case of the form { ... -> ... }", 56); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v13), MKSTR(v19), x1); - uint64_t v20 = pop_u64(); - x17 = v20; - x16 = x2; - VAL r21 = pop_resource(); - x15 = r21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v22; - VAL v23; - mw_mirth_token_Token_argsZ_1(x17, x15, &v22, &v23); - uint64_t v24; - VAL v25; - VAL v26; - mw_mirth_elab_elabZ_matchZ_caseZBang(v22, v23, x16, &v24, &v25, &v26); - int64_t v27 = 1LL /* True */; - x12 = v27; - x11 = v8; - x10 = v26; - x9 = v25; - } break; - case 0LL: { // None - int64_t v28 = 0LL /* False */; - x12 = v28; - x11 = v8; - x10 = x2; - x9 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v29 = (x9); - VAL v30 = (x10); - VAL v31 = x11; - int64_t v32 = x12; - while (((bool)v32)) { - VAL v33 = (v29); - VAL v34 = (v30); - VAL v35 = v31; - VAL v36; - VAL v37; - mw_std_list_List_1_uncons(v35, &v36, &v37); - VAL x38; - VAL x39; - VAL x40; - int64_t x41; - switch (get_data_tag(v36)) { - case 1LL: { // Some - VAL v42 = mtp_std_maybe_Maybe_1_Some(v36); - incref(v42); - VAL v43 = mw_mirth_token_Token_lcurlyZAsk(VU64(v42)); - VAL x44; - VAL x45; - uint64_t x46; - switch (get_data_tag(v43)) { - case 1LL: { // Some - VAL v47 = mtp_std_maybe_Maybe_1_Some(v43); - decref(v47); - x46 = VU64(v42); - x45 = v34; - x44 = v33; - } break; - case 0LL: { // None - STR* v48; - STRLIT(v48, "Expected a pattern match case of the form { ... -> ... }", 56); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v42), MKSTR(v48), v33); - uint64_t v49 = pop_u64(); - x46 = v49; - x45 = v34; - VAL r50 = pop_resource(); - x44 = r50; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v7 = 1LL /* True */; + VAL v8 = x1; + VAL v9 = x2; + VAL v10 = v6; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + VAL v13 = v8; + VAL v14 = v9; + VAL v15 = v10; + int64_t v16 = v11; + VAL x17; + VAL x18; + VAL x19; + int64_t x20; + switch (get_data_tag(v15)) { + case 1LL: { // Cons + VAL v21; + VAL v22; + mtp_std_list_List_1_Cons(v15, &v21, &v22); + incref(v21); + VAL v23 = mw_mirth_token_Token_lcurlyZAsk(VU64(v21)); + int64_t v24 = get_data_tag(v23); + decref(v23); + int64_t v25 = 0LL; + bool v26 = (v24 == v25); + uint64_t x27; + VAL x28; + VAL x29; + if (v26) { + STR* v30; + STRLIT(v30, "Expected a pattern match case of the form { ... -> ... }", 56); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v21), MKSTR(v30), v13); + } else { + x29 = v14; + x28 = v13; + x27 = VU64(v21); } - uint64_t v51; - VAL v52; - mw_mirth_token_Token_argsZ_1(x46, x44, &v51, &v52); - uint64_t v53; - VAL v54; - VAL v55; - mw_mirth_elab_elabZ_matchZ_caseZBang(v51, v52, x45, &v53, &v54, &v55); - int64_t v56 = 1LL /* True */; - x41 = v56; - x40 = v37; - x39 = v55; - x38 = v54; + uint64_t v33; + VAL v34; + mw_mirth_token_Token_argsZ_1(x27, x28, &v33, &v34); + uint64_t v35; + VAL v36; + VAL v37; + mw_mirth_elab_elabZ_matchZ_caseZBang(v33, v34, x29, &v35, &v36, &v37); + int64_t v38 = 1LL /* True */; + x20 = v38; + x19 = v22; + x18 = v37; + x17 = v36; } break; - case 0LL: { // None - int64_t v57 = 0LL /* False */; - x41 = v57; - x40 = v37; - x39 = v34; - x38 = v33; + case 0LL: { // Nil + VAL v39 = MKI64(0LL /* Nil */); + int64_t v40 = 0LL /* False */; + x20 = v40; + x19 = v39; + x18 = v14; + x17 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v32 = x41; - v31 = x40; - v30 = x39; - v29 = x38; + v12 = x20; + v11 = x20; + v10 = x19; + v9 = x18; + v8 = x17; } - decref(v31); - *x4 = v30; - *x3 = v29; + decref(v10); + *x4 = v9; + *x3 = v8; } static void mw_mirth_elab_elabZ_matchZ_casesZ_argsZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { uint64_t v5 = VU64(VTUP(x2)->cells[3]); int64_t v6 = mw_mirth_token_Token_argsZ_endZAsk(v5); bool v7 = !((bool)v6); - VAL v8 = (x1); - VAL v9 = (x2); + VAL v8 = x1; + VAL v9 = x2; uint64_t v10 = v5; bool v11 = v7; while (v11) { - VAL v12 = (v8); - VAL v13 = (v9); + VAL v12 = v8; + VAL v13 = v9; uint64_t v14 = v10; uint64_t v15; VAL v16; @@ -51529,226 +39022,168 @@ static void mw_mirth_elab_elabZ_matchZ_casesZ_argsZBang (VAL x1, VAL x2, VAL *x3 } static void mw_mirth_elab_elabZ_matchZ_caseZBang (uint64_t x1, VAL x2, VAL x3, uint64_t *x4, VAL *x5, VAL *x6) { VAL v7 = mw_mirth_token_Token_runZ_arrowZAsk(x1); - VAL x8; + uint64_t x8; VAL x9; - uint64_t x10; - uint64_t x11; + VAL x10; + VAL x11; switch (get_data_tag(v7)) { case 1LL: { // Some VAL v12 = mtp_std_maybe_Maybe_1_Some(v7); - x11 = VU64(v12); - x10 = x1; - x9 = x3; - x8 = x2; + x11 = v12; + x10 = x3; + x9 = x2; + x8 = x1; } break; case 0LL: { // None STR* v13; STRLIT(v13, "Expected pattern match case ... -> ...", 38); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v13), x2); - uint64_t v14 = pop_u64(); - x11 = v14; - uint64_t v15 = pop_u64(); - x10 = v15; - x9 = x3; - VAL r16 = pop_resource(); - x8 = r16; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v17 = mw_mirth_token_Token_ZEqualZEqual(x10, x11); - VAL x18; + incref(x11); + int64_t v17 = mw_mirth_token_Token_ZEqualZEqual(x8, VU64(x11)); + uint64_t x18; VAL x19; - uint64_t x20; - uint64_t x21; + VAL x20; if (((bool)v17)) { - STR* v22; - STRLIT(v22, "expected pattern", 16); - push_u64(x10); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x11, MKSTR(v22), x8); - uint64_t v23 = pop_u64(); - x21 = v23; - uint64_t v24 = pop_u64(); - x20 = v24; - x19 = x9; - VAL r25 = pop_resource(); - x18 = r25; + STR* v21; + STRLIT(v21, "expected pattern", 16); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(x11), MKSTR(v21), x9); } else { - x21 = x11; x20 = x10; x19 = x9; - x18 = x8; + x18 = VU64(x11); } - uint64_t v26 = mw_mirth_token_Token_prev(x21); - int64_t v27 = mw_mirth_token_Token_ZEqualZEqual(x20, v26); + uint64_t v24 = mw_mirth_token_Token_prev(x18); + int64_t v25 = mw_mirth_token_Token_ZEqualZEqual(x8, v24); + uint64_t x26; + VAL x27; VAL x28; - VAL x29; - uint64_t x30; - uint64_t x31; - if (((bool)v27)) { - x31 = x21; - x30 = x20; - x29 = x19; - x28 = x18; + if (((bool)v25)) { + x28 = x20; + x27 = x19; + x26 = x18; } else { - STR* v32; - STRLIT(v32, "multi-part pattern not supported", 32); - push_u64(x20); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x21, MKSTR(v32), x18); - uint64_t v33 = pop_u64(); - x31 = v33; - uint64_t v34 = pop_u64(); - x30 = v34; - x29 = x19; - VAL r35 = pop_resource(); - x28 = r35; - } - VAL v36 = mw_mirth_token_Token_patZ_tokens(x30); - uint64_t v37 = mw_mirth_token_Token_prev(x31); - uint64_t v38 = mw_mirth_token_Token_succ(x31); - VAL v39 = VVAL(VTUP(x29)->cells[1]); - incref(v39); - VAL v40 = VVAL(VTUP(x29)->cells[4]); - incref(v40); - incref(v40); - VAL v41 = MKI64(0LL /* Nil */); - VAL v42 = VVAL(VTUP(x29)->cells[5]); - incref(v42); - incref(v42); - VAL v43 = MKI64(0LL /* Nil */); - VAL v44 = mtw_mirth_match_Pattern_Pattern(v39, v37, v37, v40, v40, v41, v42, v42, v43); - VAL v45 = (mw_mirth_match_Pattern_thaw(v44)); - VAL v46; - VAL v47; - mw_mirth_elab_elabZ_patternZBang(v36, x28, v45, &v46, &v47); - VAL v48 = mw_mirth_match_ZPlusPattern_freezze(v47); - incref(v48); - VAL v49 = VVAL(VTUP(v48)->cells[5]); + STR* v29; + STRLIT(v29, "multi-part pattern not supported", 32); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x18, MKSTR(v29), x19); + } + VAL v32 = mw_mirth_token_Token_patZ_tokens(x8); + uint64_t v33 = mw_mirth_token_Token_prev(x26); + uint64_t v34 = mw_mirth_token_Token_succ(x26); + VAL v35 = VVAL(VTUP(x28)->cells[1]); + incref(v35); + VAL v36 = VVAL(VTUP(x28)->cells[4]); + incref(v36); + incref(v36); + VAL v37 = MKI64(0LL /* Nil */); + VAL v38 = VVAL(VTUP(x28)->cells[5]); + incref(v38); + incref(v38); + VAL v39 = MKI64(0LL /* Nil */); + VAL v40 = mtw_mirth_match_Pattern_Pattern(v35, v33, v33, v36, v36, v37, v38, v38, v39); + VAL v41 = mw_mirth_match_Pattern_thaw(v40); + VAL v42; + VAL v43; + mw_mirth_elab_elabZ_patternZBang(v32, x27, v41, &v42, &v43); + VAL v44 = mw_mirth_match_ZPlusPattern_freezze(v43); + incref(v44); + VAL v45 = VVAL(VTUP(v44)->cells[5]); + incref(v45); + decref(v44); + incref(v44); + VAL v46 = mw_mirth_match_Pattern_dom(v44); + VAL v47 = VVAL(VTUP(x28)->cells[6]); + incref(v47); + VAL v48 = mw_mirth_type_TZ_ZTo(v46, v47); + VAL v49 = VVAL(VTUP(x28)->cells[1]); incref(v49); - decref(v48); - incref(v48); - VAL v50 = mw_mirth_match_Pattern_dom(v48); - VAL v51 = VVAL(VTUP(x29)->cells[6]); - incref(v51); - VAL v52 = mw_mirth_type_TZ_ZTo(v50, v51); - VAL v53 = VVAL(VTUP(x29)->cells[1]); - incref(v53); + VAL v50; + VAL v51; + mw_mirth_type_ArrowType_unpack(v48, &v50, &v51); + incref(v50); + VAL v52 = MKI64(0LL /* Nil */); + VAL v53 = mtw_mirth_arrow_Arrow_Arrow(v49, v34, v34, v45, v50, v50, v52); VAL v54; VAL v55; - mw_mirth_type_ArrowType_unpack(v52, &v54, &v55); - incref(v54); - VAL v56 = MKI64(0LL /* Nil */); - VAL v57 = mtw_mirth_arrow_Arrow_Arrow(v53, v38, v38, v49, v54, v54, v56); - VAL v58; - VAL v59; - mw_mirth_elab_elabZ_atomsZBang(v46, v57, &v58, &v59); - VAL v60; - uint64_t v61; - mw_mirth_elab_abZ_tokenZAt(v59, &v60, &v61); - int64_t v62 = mw_mirth_token_Token_commaZAsk(v61); - VAL x63; - VAL x64; - uint64_t x65; - if (((bool)v62)) { - uint64_t v66 = mw_mirth_token_Token_succ(v61); - x65 = v66; - x64 = v60; - x63 = v58; + mw_mirth_elab_elabZ_atomsZBang(v42, v53, &v54, &v55); + VAL v56; + uint64_t v57; + mw_mirth_elab_abZ_tokenZAt(v55, &v56, &v57); + int64_t v58 = mw_mirth_token_Token_commaZAsk(v57); + uint64_t x59; + if (((bool)v58)) { + uint64_t v60 = mw_mirth_token_Token_succ(v57); + x59 = v60; } else { - x65 = v61; - x64 = v60; - x63 = v58; + x59 = v57; } - VAL v67; - VAL v68; - mw_mirth_elab_abZ_unifyZ_typeZBang(v55, x63, x64, &v67, &v68); - VAL v69 = mtw_mirth_match_Case_CASE(v48, v68); - VAL v70; - VAL v71; - mw_mirth_match_ZPlusMatch_addZ_case(v67, x29, v69, &v70, &v71); - *x6 = v71; - *x5 = v70; - *x4 = x65; + VAL v61; + VAL v62; + mw_mirth_elab_abZ_unifyZ_typeZBang(v51, v54, v56, &v61, &v62); + VAL v63 = mtw_mirth_match_Case_CASE(v44, v62); + VAL v64; + VAL v65; + mw_mirth_match_ZPlusMatch_addZ_case(v61, x28, v63, &v64, &v65); + *x6 = v65; + *x5 = v64; + *x4 = x59; } static void mw_mirth_elab_elabZ_patternZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { VAL v6 = mw_std_list_List_1_reverse(x1); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v6, &v7, &v8); - VAL x9; - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v14; - VAL v15; - mw_mirth_elab_elabZ_patternZ_atomZBang(VU64(v13), x2, x3, &v14, &v15); - int64_t v16 = 1LL /* True */; - x12 = v16; - x11 = v8; - x10 = v15; - x9 = v14; - } break; - case 0LL: { // None - int64_t v17 = 0LL /* False */; - x12 = v17; - x11 = v8; - x10 = x3; - x9 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v18 = (x9); - VAL v19 = (x10); - VAL v20 = x11; - int64_t v21 = x12; - while (((bool)v21)) { - VAL v22 = (v18); - VAL v23 = (v19); - VAL v24 = v20; - VAL v25; - VAL v26; - mw_std_list_List_1_uncons(v24, &v25, &v26); - VAL x27; - VAL x28; - VAL x29; - int64_t x30; - switch (get_data_tag(v25)) { - case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v25); - VAL v32; - VAL v33; - mw_mirth_elab_elabZ_patternZ_atomZBang(VU64(v31), v22, v23, &v32, &v33); - int64_t v34 = 1LL /* True */; - x30 = v34; - x29 = v26; - x28 = v33; - x27 = v32; + int64_t v7 = 1LL /* True */; + VAL v8 = x2; + VAL v9 = x3; + VAL v10 = v6; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + VAL v13 = v8; + VAL v14 = v9; + VAL v15 = v10; + int64_t v16 = v11; + VAL x17; + VAL x18; + VAL x19; + int64_t x20; + switch (get_data_tag(v15)) { + case 1LL: { // Cons + VAL v21; + VAL v22; + mtp_std_list_List_1_Cons(v15, &v21, &v22); + VAL v23; + VAL v24; + mw_mirth_elab_elabZ_patternZ_atomZBang(VU64(v21), v13, v14, &v23, &v24); + int64_t v25 = 1LL /* True */; + x20 = v25; + x19 = v22; + x18 = v24; + x17 = v23; } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x30 = v35; - x29 = v26; - x28 = v23; - x27 = v22; + case 0LL: { // Nil + VAL v26 = MKI64(0LL /* Nil */); + int64_t v27 = 0LL /* False */; + x20 = v27; + x19 = v26; + x18 = v14; + x17 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v21 = x30; - v20 = x29; - v19 = x28; - v18 = x27; + v12 = x20; + v11 = x20; + v10 = x19; + v9 = x18; + v8 = x17; } - decref(v20); - *x5 = v19; - *x4 = v18; + decref(v10); + *x5 = v9; + *x4 = v8; } static void mw_mirth_elab_elabZ_patternZ_atomZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { incref(x3); @@ -51786,1044 +39221,324 @@ static void mw_mirth_elab_elabZ_patternZ_atomZBang (uint64_t x1, VAL x2, VAL x3, incref(v23); VAL v24 = MKI64(0LL /* Nil */); VAL v25 = MKI64(0LL /* Nil */); - VAL v26; - VAL v27; - mw_std_list_List_1_uncons(v23, &v26, &v27); - VAL x28; - VAL x29; - VAL x30; - VAL x31; - VAL x32; - VAL x33; - int64_t x34; - switch (get_data_tag(v26)) { - case 1LL: { // Some - VAL v35 = mtp_std_maybe_Maybe_1_Some(v26); - incref(v35); - VAL v36 = mw_mirth_def_Def_tagZAsk(v35); - int64_t v37 = mw_std_maybe_Maybe_1_someZAsk(v36); - VAL x38; - VAL x39; - VAL x40; - VAL x41; - if (((bool)v37)) { - VAL v42 = mtw_std_either_Either_2_Right(v35); - x41 = v42; - x40 = v22; - x39 = v21; - x38 = v6; - } else { - VAL v43 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v35); - VAL v44 = mtw_std_either_Either_2_Left(v43); - x41 = v44; - x40 = v22; - x39 = v21; - x38 = v6; - } - VAL x45; - VAL x46; - VAL x47; - VAL x48; - VAL x49; - switch (get_data_tag(x41)) { - case 0LL: { // Left - VAL v50 = mtp_std_either_Either_2_Left(x41); - VAL v51 = mtw_std_list_List_1_Cons(v50, v24); - x49 = v25; - x48 = v51; - x47 = x40; - x46 = x39; - x45 = x38; - } break; - case 1LL: { // Right - VAL v52 = mtp_std_either_Either_2_Right(x41); - VAL v53 = mtw_std_list_List_1_Cons(v52, v25); - x49 = v53; - x48 = v24; - x47 = x40; - x46 = x39; - x45 = x38; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v54 = 1LL /* True */; - x34 = v54; - x33 = v27; - x32 = x49; - x31 = x48; - x30 = x47; - x29 = x46; - x28 = x45; - } break; - case 0LL: { // None - int64_t v55 = 0LL /* False */; - x34 = v55; - x33 = v27; - x32 = v25; - x31 = v24; - x30 = v22; - x29 = v21; - x28 = v6; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v56 = x28; - VAL v57 = (x29); - VAL v58 = (x30); - VAL v59 = x31; - VAL v60 = x32; - VAL v61 = x33; - int64_t v62 = x34; - while (((bool)v62)) { - VAL v63 = v56; - VAL v64 = (v57); - VAL v65 = (v58); - VAL v66 = v59; - VAL v67 = v60; - VAL v68 = v61; - VAL v69; - VAL v70; - mw_std_list_List_1_uncons(v68, &v69, &v70); - VAL x71; - VAL x72; - VAL x73; - VAL x74; - VAL x75; - VAL x76; - int64_t x77; - switch (get_data_tag(v69)) { - case 1LL: { // Some - VAL v78 = mtp_std_maybe_Maybe_1_Some(v69); - incref(v78); - VAL v79 = mw_mirth_def_Def_tagZAsk(v78); - int64_t v80 = mw_std_maybe_Maybe_1_someZAsk(v79); - VAL x81; - VAL x82; - VAL x83; - VAL x84; - if (((bool)v80)) { - VAL v85 = mtw_std_either_Either_2_Right(v78); - x84 = v85; - x83 = v65; - x82 = v64; - x81 = v63; + int64_t v26 = 1LL /* True */; + VAL v27 = v24; + VAL v28 = v25; + VAL v29 = v23; + int64_t v30 = v26; + int64_t v31 = v26; + while (((bool)v31)) { + VAL v32 = v27; + VAL v33 = v28; + VAL v34 = v29; + int64_t v35 = v30; + VAL x36; + VAL x37; + VAL x38; + int64_t x39; + switch (get_data_tag(v34)) { + case 1LL: { // Cons + VAL v40; + VAL v41; + mtp_std_list_List_1_Cons(v34, &v40, &v41); + incref(v40); + VAL v42 = mw_mirth_def_Def_tagZAsk(v40); + int64_t v43 = get_data_tag(v42); + decref(v42); + int64_t v44 = 1LL; + bool v45 = (v43 == v44); + VAL x46; + if (v45) { + VAL v47 = mtw_std_either_Either_2_Right(v40); + x46 = v47; } else { - VAL v86 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v78); - VAL v87 = mtw_std_either_Either_2_Left(v86); - x84 = v87; - x83 = v65; - x82 = v64; - x81 = v63; + VAL v48 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v40); + VAL v49 = mtw_std_either_Either_2_Left(v48); + x46 = v49; } - VAL x88; - VAL x89; - VAL x90; - VAL x91; - VAL x92; - switch (get_data_tag(x84)) { + VAL x50; + VAL x51; + switch (get_data_tag(x46)) { case 0LL: { // Left - VAL v93 = mtp_std_either_Either_2_Left(x84); - VAL v94 = mtw_std_list_List_1_Cons(v93, v66); - x92 = v67; - x91 = v94; - x90 = x83; - x89 = x82; - x88 = x81; + VAL v52 = mtp_std_either_Either_2_Left(x46); + VAL v53 = mtw_std_list_List_1_Cons(v52, v32); + x51 = v33; + x50 = v53; } break; case 1LL: { // Right - VAL v95 = mtp_std_either_Either_2_Right(x84); - VAL v96 = mtw_std_list_List_1_Cons(v95, v67); - x92 = v96; - x91 = v66; - x90 = x83; - x89 = x82; - x88 = x81; + VAL v54 = mtp_std_either_Either_2_Right(x46); + VAL v55 = mtw_std_list_List_1_Cons(v54, v33); + x51 = v55; + x50 = v32; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v97 = 1LL /* True */; - x77 = v97; - x76 = v70; - x75 = x92; - x74 = x91; - x73 = x90; - x72 = x89; - x71 = x88; + int64_t v56 = 1LL /* True */; + x39 = v56; + x38 = v41; + x37 = x51; + x36 = x50; } break; - case 0LL: { // None - int64_t v98 = 0LL /* False */; - x77 = v98; - x76 = v70; - x75 = v67; - x74 = v66; - x73 = v65; - x72 = v64; - x71 = v63; + case 0LL: { // Nil + VAL v57 = MKI64(0LL /* Nil */); + int64_t v58 = 0LL /* False */; + x39 = v58; + x38 = v57; + x37 = v33; + x36 = v32; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v62 = x77; - v61 = x76; - v60 = x75; - v59 = x74; - v58 = x73; - v57 = x72; - v56 = x71; + v31 = x39; + v30 = x39; + v29 = x38; + v28 = x37; + v27 = x36; } - decref(v61); - VAL v99 = mw_std_list_List_1_reverse(v59); - VAL v100 = mw_std_list_List_1_reverse(v60); - VAL v101 = VVAL(VTUP(v58)->cells[5]); - incref(v101); - VAL v102 = mw_std_list_List_1_cat(v99, v101); - VAL v103 = VTUP(v58)->cells[5]; - decref(v103); - VTUP(v58)->cells[5] = v102; - VAL v104 = VTUP(v58)->cells[4]; - decref(v104); - VTUP(v58)->cells[4] = v100; - VAL v105; - VAL v106; - mw_mirth_elab_ZPlusResolveDef_filterZ_arity(v57, v58, &v105, &v106); - VAL v107; - VAL v108; - mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v105, v106, &v107, &v108); - incref(v56); - VAL v109 = VVAL(VTUP(v56)->cells[7]); - incref(v109); - decref(v56); - int64_t v110 = mw_mirth_type_StackType_topZ_typesZ_areZ_fineZAsk(v109); - VAL x111; - VAL x112; - VAL x113; - if (((bool)v110)) { - incref(v56); - VAL v114 = VVAL(VTUP(v56)->cells[7]); - incref(v114); - decref(v56); - VAL v115 = mw_mirth_type_StackType_topZ_namespaces(v114); - uint64_t v116 = VU64(VTUP(v108)->cells[2]); - VAL v117 = mw_mirth_token_Token_nameZAsk(v116); - VAL x118; - VAL x119; - VAL x120; - switch (get_data_tag(v117)) { - case 1LL: { // Some - VAL v121 = mtp_std_maybe_Maybe_1_Some(v117); - decref(v121); - VAL v122 = VVAL(VTUP(v108)->cells[4]); - incref(v122); - VAL v123 = MKI64(0LL /* Nil */); - VAL v124 = MKI64(0LL /* Nil */); - VAL v125; - VAL v126; - mw_std_list_List_1_uncons(v122, &v125, &v126); - VAL x127; - VAL x128; - VAL x129; - VAL x130; - VAL x131; - VAL x132; - VAL x133; - int64_t x134; - switch (get_data_tag(v125)) { - case 1LL: { // Some - VAL v135 = mtp_std_maybe_Maybe_1_Some(v125); - incref(v115); - incref(v135); - VAL v136; - VAL v137; - mw_mirth_def_Def_qnameZ_hard(v107, v135, &v136, &v137); - VAL v138 = VVAL(VTUP(v137)->cells[1]); - incref(v138); - decref(v137); - VAL v139 = MKI64(0LL /* None */); - VAL v140; - VAL v141; - mw_std_list_List_1_uncons(v115, &v140, &v141); - VAL x142; - VAL x143; - VAL x144; - VAL x145; - VAL x146; - VAL x147; - VAL x148; - VAL x149; - int64_t x150; - switch (get_data_tag(v140)) { - case 1LL: { // Some - VAL v151 = mtp_std_maybe_Maybe_1_Some(v140); - incref(v151); - incref(v138); - int64_t v152 = mw_mirth_name_Namespace_ZEqualZEqual(v138, v151); - VAL x153; - VAL x154; - VAL x155; - VAL x156; - VAL x157; - VAL x158; - VAL x159; - if (((bool)v152)) { - VAL v160 = mtw_std_maybe_Maybe_1_Some(v151); - x159 = v160; - x158 = v138; - x157 = v108; - x156 = v136; - x155 = v135; - x154 = v115; - x153 = v56; - } else { - decref(v151); - VAL v161 = MKI64(0LL /* None */); - x159 = v161; - x158 = v138; - x157 = v108; - x156 = v136; - x155 = v135; - x154 = v115; - x153 = v56; - } - VAL x162; - VAL x163; - VAL x164; - VAL x165; - VAL x166; - VAL x167; - VAL x168; - VAL x169; - switch (get_data_tag(x159)) { - case 0LL: { // None - x169 = v141; - x168 = v139; - x167 = x158; - x166 = x157; - x165 = x156; - x164 = x155; - x163 = x154; - x162 = x153; - } break; - default: { - decref(v141); - decref(v139); - VAL v170 = MKI64(0LL /* Nil */); - x169 = v170; - x168 = x159; - x167 = x158; - x166 = x157; - x165 = x156; - x164 = x155; - x163 = x154; - x162 = x153; - } break; - } - int64_t v171 = 1LL /* True */; - x150 = v171; - x149 = x169; - x148 = x168; - x147 = x167; - x146 = x166; - x145 = x165; - x144 = x164; - x143 = x163; - x142 = x162; - } break; - case 0LL: { // None - int64_t v172 = 0LL /* False */; - x150 = v172; - x149 = v141; - x148 = v139; - x147 = v138; - x146 = v108; - x145 = v136; - x144 = v135; - x143 = v115; - x142 = v56; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v173 = x142; - VAL v174 = x143; - VAL v175 = x144; - VAL v176 = (x145); - VAL v177 = (x146); - VAL v178 = x147; - VAL v179 = x148; - VAL v180 = x149; - int64_t v181 = x150; - while (((bool)v181)) { - VAL v182 = v173; - VAL v183 = v174; - VAL v184 = v175; - VAL v185 = (v176); - VAL v186 = (v177); - VAL v187 = v178; - VAL v188 = v179; - VAL v189 = v180; - VAL v190; - VAL v191; - mw_std_list_List_1_uncons(v189, &v190, &v191); - VAL x192; - VAL x193; - VAL x194; - VAL x195; - VAL x196; - VAL x197; - VAL x198; - VAL x199; - int64_t x200; - switch (get_data_tag(v190)) { - case 1LL: { // Some - VAL v201 = mtp_std_maybe_Maybe_1_Some(v190); - incref(v201); - incref(v187); - int64_t v202 = mw_mirth_name_Namespace_ZEqualZEqual(v187, v201); - VAL x203; - VAL x204; - VAL x205; - VAL x206; - VAL x207; - VAL x208; - VAL x209; - if (((bool)v202)) { - VAL v210 = mtw_std_maybe_Maybe_1_Some(v201); - x209 = v210; - x208 = v187; - x207 = v186; - x206 = v185; - x205 = v184; - x204 = v183; - x203 = v182; - } else { - decref(v201); - VAL v211 = MKI64(0LL /* None */); - x209 = v211; - x208 = v187; - x207 = v186; - x206 = v185; - x205 = v184; - x204 = v183; - x203 = v182; - } - VAL x212; - VAL x213; - VAL x214; - VAL x215; - VAL x216; - VAL x217; - VAL x218; - VAL x219; - switch (get_data_tag(x209)) { - case 0LL: { // None - x219 = v191; - x218 = v188; - x217 = x208; - x216 = x207; - x215 = x206; - x214 = x205; - x213 = x204; - x212 = x203; - } break; - default: { - decref(v191); - decref(v188); - VAL v220 = MKI64(0LL /* Nil */); - x219 = v220; - x218 = x209; - x217 = x208; - x216 = x207; - x215 = x206; - x214 = x205; - x213 = x204; - x212 = x203; - } break; - } - int64_t v221 = 1LL /* True */; - x200 = v221; - x199 = x219; - x198 = x218; - x197 = x217; - x196 = x216; - x195 = x215; - x194 = x214; - x193 = x213; - x192 = x212; - } break; - case 0LL: { // None - int64_t v222 = 0LL /* False */; - x200 = v222; - x199 = v191; - x198 = v188; - x197 = v187; - x196 = v186; - x195 = v185; - x194 = v184; - x193 = v183; - x192 = v182; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v181 = x200; - v180 = x199; - v179 = x198; - v178 = x197; - v177 = x196; - v176 = x195; - v175 = x194; - v174 = x193; - v173 = x192; - } - decref(v180); - decref(v178); - int64_t v223 = mw_std_maybe_Maybe_1_someZAsk(v179); - VAL x224; - VAL x225; - VAL x226; - VAL x227; - VAL x228; - if (((bool)v223)) { - VAL v229 = mtw_std_either_Either_2_Right(v175); - x228 = v229; - x227 = v177; - x226 = v174; - x225 = v173; - x224 = v176; + decref(v29); + VAL v59 = mw_std_list_List_1_reverse(v27); + VAL v60 = mw_std_list_List_1_reverse(v28); + VAL v61 = VVAL(VTUP(v22)->cells[5]); + incref(v61); + VAL v62 = mw_std_list_List_1_cat(v59, v61); + VAL v63 = VTUP(v22)->cells[5]; + decref(v63); + VTUP(v22)->cells[5] = v62; + VAL v64 = VTUP(v22)->cells[4]; + decref(v64); + VTUP(v22)->cells[4] = v60; + VAL v65; + VAL v66; + mw_mirth_elab_ZPlusResolveDef_filterZ_arity(v21, v22, &v65, &v66); + VAL v67; + VAL v68; + mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v65, v66, &v67, &v68); + incref(v6); + VAL v69 = VVAL(VTUP(v6)->cells[7]); + incref(v69); + decref(v6); + int64_t v70 = mw_mirth_type_StackType_topZ_typesZ_areZ_fineZAsk(v69); + VAL x71; + VAL x72; + VAL x73; + if (((bool)v70)) { + incref(v6); + VAL v74 = VVAL(VTUP(v6)->cells[7]); + incref(v74); + decref(v6); + VAL v75 = mw_mirth_type_StackType_topZ_namespaces(v74); + uint64_t v76 = VU64(VTUP(v68)->cells[2]); + VAL v77 = mw_mirth_token_Token_nameZAsk(v76); + int64_t v78 = get_data_tag(v77); + decref(v77); + int64_t v79 = 1LL; + bool v80 = (v78 == v79); + VAL x81; + VAL x82; + if (v80) { + VAL v83 = VVAL(VTUP(v68)->cells[4]); + incref(v83); + VAL v84 = MKI64(0LL /* Nil */); + VAL v85 = MKI64(0LL /* Nil */); + int64_t v86 = 1LL /* True */; + VAL v87 = v67; + VAL v88 = v68; + VAL v89 = v75; + VAL v90 = v84; + VAL v91 = v85; + VAL v92 = v83; + int64_t v93 = v86; + int64_t v94 = v86; + while (((bool)v94)) { + VAL v95 = v87; + VAL v96 = v88; + VAL v97 = v89; + VAL v98 = v90; + VAL v99 = v91; + VAL v100 = v92; + int64_t v101 = v93; + VAL x102; + VAL x103; + VAL x104; + VAL x105; + VAL x106; + VAL x107; + int64_t x108; + switch (get_data_tag(v100)) { + case 1LL: { // Cons + VAL v109; + VAL v110; + mtp_std_list_List_1_Cons(v100, &v109, &v110); + incref(v97); + incref(v109); + VAL v111; + VAL v112; + mw_mirth_def_Def_qnameZ_hard(v95, v109, &v111, &v112); + VAL v113 = VVAL(VTUP(v112)->cells[1]); + incref(v113); + decref(v112); + int64_t v114 = mw_std_list_List_1_member_1_sp4(v113, v97); + VAL x115; + VAL x116; + VAL x117; + VAL x118; + if (((bool)v114)) { + VAL v119 = mtw_std_either_Either_2_Right(v109); + x118 = v119; + x117 = v96; + x116 = v111; + x115 = v97; } else { - VAL v230 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_CONSTRUCTOR(v175); - VAL v231 = mtw_std_either_Either_2_Left(v230); - x228 = v231; - x227 = v177; - x226 = v174; - x225 = v173; - x224 = v176; + VAL v120 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_CONSTRUCTOR(v109); + VAL v121 = mtw_std_either_Either_2_Left(v120); + x118 = v121; + x117 = v96; + x116 = v111; + x115 = v97; } - VAL x232; - VAL x233; - VAL x234; - VAL x235; - VAL x236; - VAL x237; - switch (get_data_tag(x228)) { + VAL x122; + VAL x123; + VAL x124; + VAL x125; + VAL x126; + switch (get_data_tag(x118)) { case 0LL: { // Left - VAL v238 = mtp_std_either_Either_2_Left(x228); - VAL v239 = mtw_std_list_List_1_Cons(v238, v123); - x237 = v124; - x236 = v239; - x235 = x227; - x234 = x226; - x233 = x225; - x232 = x224; + VAL v127 = mtp_std_either_Either_2_Left(x118); + VAL v128 = mtw_std_list_List_1_Cons(v127, v98); + x126 = v99; + x125 = v128; + x124 = x117; + x123 = x116; + x122 = x115; } break; case 1LL: { // Right - VAL v240 = mtp_std_either_Either_2_Right(x228); - VAL v241 = mtw_std_list_List_1_Cons(v240, v124); - x237 = v241; - x236 = v123; - x235 = x227; - x234 = x226; - x233 = x225; - x232 = x224; + VAL v129 = mtp_std_either_Either_2_Right(x118); + VAL v130 = mtw_std_list_List_1_Cons(v129, v99); + x126 = v130; + x125 = v98; + x124 = x117; + x123 = x116; + x122 = x115; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v242 = 1LL /* True */; - x134 = v242; - x133 = v126; - x132 = x237; - x131 = x236; - x130 = x235; - x129 = x234; - x128 = x233; - x127 = x232; + int64_t v131 = 1LL /* True */; + x108 = v131; + x107 = v110; + x106 = x126; + x105 = x125; + x104 = x124; + x103 = x123; + x102 = x122; } break; - case 0LL: { // None - int64_t v243 = 0LL /* False */; - x134 = v243; - x133 = v126; - x132 = v124; - x131 = v123; - x130 = v108; - x129 = v115; - x128 = v56; - x127 = v107; + case 0LL: { // Nil + VAL v132 = MKI64(0LL /* Nil */); + int64_t v133 = 0LL /* False */; + x108 = v133; + x107 = v132; + x106 = v99; + x105 = v98; + x104 = v96; + x103 = v95; + x102 = v97; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v244 = (x127); - VAL v245 = x128; - VAL v246 = x129; - VAL v247 = (x130); - VAL v248 = x131; - VAL v249 = x132; - VAL v250 = x133; - int64_t v251 = x134; - while (((bool)v251)) { - VAL v252 = (v244); - VAL v253 = v245; - VAL v254 = v246; - VAL v255 = (v247); - VAL v256 = v248; - VAL v257 = v249; - VAL v258 = v250; - VAL v259; - VAL v260; - mw_std_list_List_1_uncons(v258, &v259, &v260); - VAL x261; - VAL x262; - VAL x263; - VAL x264; - VAL x265; - VAL x266; - VAL x267; - int64_t x268; - switch (get_data_tag(v259)) { - case 1LL: { // Some - VAL v269 = mtp_std_maybe_Maybe_1_Some(v259); - incref(v254); - incref(v269); - VAL v270; - VAL v271; - mw_mirth_def_Def_qnameZ_hard(v252, v269, &v270, &v271); - VAL v272 = VVAL(VTUP(v271)->cells[1]); - incref(v272); - decref(v271); - VAL v273 = MKI64(0LL /* None */); - VAL v274; - VAL v275; - mw_std_list_List_1_uncons(v254, &v274, &v275); - VAL x276; - VAL x277; - VAL x278; - VAL x279; - VAL x280; - VAL x281; - VAL x282; - VAL x283; - int64_t x284; - switch (get_data_tag(v274)) { - case 1LL: { // Some - VAL v285 = mtp_std_maybe_Maybe_1_Some(v274); - incref(v285); - incref(v272); - int64_t v286 = mw_mirth_name_Namespace_ZEqualZEqual(v272, v285); - VAL x287; - VAL x288; - VAL x289; - VAL x290; - VAL x291; - VAL x292; - VAL x293; - if (((bool)v286)) { - VAL v294 = mtw_std_maybe_Maybe_1_Some(v285); - x293 = v294; - x292 = v272; - x291 = v255; - x290 = v270; - x289 = v269; - x288 = v254; - x287 = v253; - } else { - decref(v285); - VAL v295 = MKI64(0LL /* None */); - x293 = v295; - x292 = v272; - x291 = v255; - x290 = v270; - x289 = v269; - x288 = v254; - x287 = v253; - } - VAL x296; - VAL x297; - VAL x298; - VAL x299; - VAL x300; - VAL x301; - VAL x302; - VAL x303; - switch (get_data_tag(x293)) { - case 0LL: { // None - x303 = v275; - x302 = v273; - x301 = x292; - x300 = x291; - x299 = x290; - x298 = x289; - x297 = x288; - x296 = x287; - } break; - default: { - decref(v275); - decref(v273); - VAL v304 = MKI64(0LL /* Nil */); - x303 = v304; - x302 = x293; - x301 = x292; - x300 = x291; - x299 = x290; - x298 = x289; - x297 = x288; - x296 = x287; - } break; - } - int64_t v305 = 1LL /* True */; - x284 = v305; - x283 = x303; - x282 = x302; - x281 = x301; - x280 = x300; - x279 = x299; - x278 = x298; - x277 = x297; - x276 = x296; - } break; - case 0LL: { // None - int64_t v306 = 0LL /* False */; - x284 = v306; - x283 = v275; - x282 = v273; - x281 = v272; - x280 = v255; - x279 = v270; - x278 = v269; - x277 = v254; - x276 = v253; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v307 = x276; - VAL v308 = x277; - VAL v309 = x278; - VAL v310 = (x279); - VAL v311 = (x280); - VAL v312 = x281; - VAL v313 = x282; - VAL v314 = x283; - int64_t v315 = x284; - while (((bool)v315)) { - VAL v316 = v307; - VAL v317 = v308; - VAL v318 = v309; - VAL v319 = (v310); - VAL v320 = (v311); - VAL v321 = v312; - VAL v322 = v313; - VAL v323 = v314; - VAL v324; - VAL v325; - mw_std_list_List_1_uncons(v323, &v324, &v325); - VAL x326; - VAL x327; - VAL x328; - VAL x329; - VAL x330; - VAL x331; - VAL x332; - VAL x333; - int64_t x334; - switch (get_data_tag(v324)) { - case 1LL: { // Some - VAL v335 = mtp_std_maybe_Maybe_1_Some(v324); - incref(v335); - incref(v321); - int64_t v336 = mw_mirth_name_Namespace_ZEqualZEqual(v321, v335); - VAL x337; - VAL x338; - VAL x339; - VAL x340; - VAL x341; - VAL x342; - VAL x343; - if (((bool)v336)) { - VAL v344 = mtw_std_maybe_Maybe_1_Some(v335); - x343 = v344; - x342 = v321; - x341 = v320; - x340 = v319; - x339 = v318; - x338 = v317; - x337 = v316; - } else { - decref(v335); - VAL v345 = MKI64(0LL /* None */); - x343 = v345; - x342 = v321; - x341 = v320; - x340 = v319; - x339 = v318; - x338 = v317; - x337 = v316; - } - VAL x346; - VAL x347; - VAL x348; - VAL x349; - VAL x350; - VAL x351; - VAL x352; - VAL x353; - switch (get_data_tag(x343)) { - case 0LL: { // None - x353 = v325; - x352 = v322; - x351 = x342; - x350 = x341; - x349 = x340; - x348 = x339; - x347 = x338; - x346 = x337; - } break; - default: { - decref(v325); - decref(v322); - VAL v354 = MKI64(0LL /* Nil */); - x353 = v354; - x352 = x343; - x351 = x342; - x350 = x341; - x349 = x340; - x348 = x339; - x347 = x338; - x346 = x337; - } break; - } - int64_t v355 = 1LL /* True */; - x334 = v355; - x333 = x353; - x332 = x352; - x331 = x351; - x330 = x350; - x329 = x349; - x328 = x348; - x327 = x347; - x326 = x346; - } break; - case 0LL: { // None - int64_t v356 = 0LL /* False */; - x334 = v356; - x333 = v325; - x332 = v322; - x331 = v321; - x330 = v320; - x329 = v319; - x328 = v318; - x327 = v317; - x326 = v316; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v315 = x334; - v314 = x333; - v313 = x332; - v312 = x331; - v311 = x330; - v310 = x329; - v309 = x328; - v308 = x327; - v307 = x326; - } - decref(v314); - decref(v312); - int64_t v357 = mw_std_maybe_Maybe_1_someZAsk(v313); - VAL x358; - VAL x359; - VAL x360; - VAL x361; - VAL x362; - if (((bool)v357)) { - VAL v363 = mtw_std_either_Either_2_Right(v309); - x362 = v363; - x361 = v311; - x360 = v308; - x359 = v307; - x358 = v310; - } else { - VAL v364 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_CONSTRUCTOR(v309); - VAL v365 = mtw_std_either_Either_2_Left(v364); - x362 = v365; - x361 = v311; - x360 = v308; - x359 = v307; - x358 = v310; - } - VAL x366; - VAL x367; - VAL x368; - VAL x369; - VAL x370; - VAL x371; - switch (get_data_tag(x362)) { - case 0LL: { // Left - VAL v372 = mtp_std_either_Either_2_Left(x362); - VAL v373 = mtw_std_list_List_1_Cons(v372, v256); - x371 = v257; - x370 = v373; - x369 = x361; - x368 = x360; - x367 = x359; - x366 = x358; - } break; - case 1LL: { // Right - VAL v374 = mtp_std_either_Either_2_Right(x362); - VAL v375 = mtw_std_list_List_1_Cons(v374, v257); - x371 = v375; - x370 = v256; - x369 = x361; - x368 = x360; - x367 = x359; - x366 = x358; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v376 = 1LL /* True */; - x268 = v376; - x267 = v260; - x266 = x371; - x265 = x370; - x264 = x369; - x263 = x368; - x262 = x367; - x261 = x366; - } break; - case 0LL: { // None - int64_t v377 = 0LL /* False */; - x268 = v377; - x267 = v260; - x266 = v257; - x265 = v256; - x264 = v255; - x263 = v254; - x262 = v253; - x261 = v252; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v251 = x268; - v250 = x267; - v249 = x266; - v248 = x265; - v247 = x264; - v246 = x263; - v245 = x262; - v244 = x261; - } - decref(v250); - VAL v378 = mw_std_list_List_1_reverse(v248); - VAL v379 = mw_std_list_List_1_reverse(v249); - VAL v380 = VVAL(VTUP(v247)->cells[5]); - incref(v380); - VAL v381 = mw_std_list_List_1_cat(v378, v380); - VAL v382 = VTUP(v247)->cells[5]; - decref(v382); - VTUP(v247)->cells[5] = v381; - VAL v383 = VTUP(v247)->cells[4]; - decref(v383); - VTUP(v247)->cells[4] = v379; - decref(v246); - x120 = v247; - x119 = v245; - x118 = v244; - } break; - case 0LL: { // None - VAL v384; - VAL v385; - mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v115, v107, v108, &v384, &v385); - x120 = v385; - x119 = v56; - x118 = v384; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + v94 = x108; + v93 = x108; + v92 = x107; + v91 = x106; + v90 = x105; + v89 = x102; + v88 = x104; + v87 = x103; } + decref(v92); + VAL v134 = mw_std_list_List_1_reverse(v90); + VAL v135 = mw_std_list_List_1_reverse(v91); + VAL v136 = VVAL(VTUP(v88)->cells[5]); + incref(v136); + VAL v137 = mw_std_list_List_1_cat(v134, v136); + VAL v138 = VTUP(v88)->cells[5]; + decref(v138); + VTUP(v88)->cells[5] = v137; + VAL v139 = VTUP(v88)->cells[4]; + decref(v139); + VTUP(v88)->cells[4] = v135; + decref(v89); + x82 = v88; + x81 = v87; + } else { + VAL v140; + VAL v141; + mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v75, v67, v68, &v140, &v141); + x82 = v141; + x81 = v140; } - x113 = x119; - x112 = x120; - x111 = x118; + x73 = x82; + x72 = x81; + x71 = v6; } else { - x113 = v56; - x112 = v108; - x111 = v107; + x73 = v68; + x72 = v67; + x71 = v6; } - VAL v386; - VAL v387; - mw_mirth_elab_resolveZ_defZ_endZBang(x111, x112, &v386, &v387); - VAL x388; - VAL x389; - VAL x390; - switch (get_data_tag(v387)) { + VAL v142; + VAL v143; + mw_mirth_elab_resolveZ_defZ_endZBang(x72, x73, &v142, &v143); + VAL x144; + switch (get_data_tag(v143)) { case 1LL: { // Some - VAL v391 = mtp_std_maybe_Maybe_1_Some(v387); - VAL v392 = mw_mirth_def_Def_tagZAsk(v391); - x390 = v392; - x389 = x113; - x388 = v386; + VAL v145 = mtp_std_maybe_Maybe_1_Some(v143); + VAL v146 = mw_mirth_def_Def_tagZAsk(v145); + x144 = v146; } break; case 0LL: { // None - VAL v393 = MKI64(0LL /* None */); - x390 = v393; - x389 = x113; - x388 = v386; + VAL v147 = MKI64(0LL /* None */); + x144 = v147; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x394; - VAL x395; - switch (get_data_tag(x390)) { + VAL x148; + VAL x149; + switch (get_data_tag(x144)) { case 1LL: { // Some - VAL v396 = mtp_std_maybe_Maybe_1_Some(x390); - VAL v397; - VAL v398; - mw_mirth_match_ZPlusPattern_tagZBang(x388, x389, VU64(v396), &v397, &v398); - x395 = v398; - x394 = v397; + VAL v150 = mtp_std_maybe_Maybe_1_Some(x144); + VAL v151; + VAL v152; + mw_mirth_match_ZPlusPattern_tagZBang(v142, x71, VU64(v150), &v151, &v152); + x149 = v152; + x148 = v151; } break; case 0LL: { // None - VAL v399 = MKI64(0LL /* STACK_TYPE_ERROR */); - incref(x389); - VAL v400 = tup_replace(x389, 7, v399); - decref(x389); - x395 = v400; - x394 = x388; + VAL v153 = MKI64(0LL /* STACK_TYPE_ERROR */); + incref(x71); + VAL v154 = tup_replace(x71, 7, v153); + decref(x71); + x149 = v154; + x148 = v142; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x14 = x395; - x13 = x394; + x14 = x149; + x13 = x148; } break; case 0LL: { // None - STR* v401; - STRLIT(v401, "Expected constructor name.", 26); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v401), x2); - x14 = v6; - VAL r402 = pop_resource(); - x13 = r402; + STR* v155; + STRLIT(v155, "Expected constructor name.", 26); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v155), x2); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -52861,7 +39576,7 @@ static void mw_mirth_elab_elabZ_expandZ_tensorZBang (VAL x1, VAL x2, uint64_t x3 VAL v19 = MKI64(0LL /* TYPE_ERROR */); STR* v20; STRLIT(v20, "expected tuple type", 19); - VAL v21 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x3, MKSTR(v20), x1)); + VAL v21 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x3, MKSTR(v20), x1); x12 = x3; x11 = v19; x10 = v18; @@ -52884,7 +39599,7 @@ static void mw_mirth_elab_elabZ_lambdaZ_paramZAsk (VAL x1, uint64_t x2, VAL *x3, switch (get_data_tag(v6)) { case 1LL: { // Some VAL v10 = mtp_std_maybe_Maybe_1_Some(v6); - VAL v11 = (mw_mirth_token_Token_argsZ_0(x2, x1)); + VAL v11 = mw_mirth_token_Token_argsZ_0(x2, x1); uint64_t v12 = mw_mirth_token_Token_next(x2); uint64_t v13 = mw_mirth_type_MetaVar_newZBang(); VAL v14 = mtw_mirth_type_Type_TMeta(v13); @@ -52903,7 +39618,7 @@ static void mw_mirth_elab_elabZ_lambdaZ_paramZAsk (VAL x1, uint64_t x2, VAL *x3, case 1LL: { // Some VAL v21 = mtp_std_maybe_Maybe_1_Some(v17); uint64_t v22 = mw_mirth_token_Token_succ(x2); - VAL v23 = (mw_mirth_token_Token_argsZ_0(v22, x1)); + VAL v23 = mw_mirth_token_Token_argsZ_0(v22, x1); uint64_t v24 = mw_mirth_token_Token_next(x2); uint64_t v25 = mw_mirth_type_MetaVar_newZBang(); VAL v26 = mtw_mirth_type_StackType_STMeta(v25); @@ -52947,251 +39662,88 @@ static void mw_mirth_elab_elabZ_atomZ_lambdaZBang (VAL x1, VAL x2, VAL *x3, VAL mw_mirth_token_Token_argsZ_1(v6, x1, &v7, &v8); VAL v9 = MKI64(0LL /* Nil */); VAL v10 = mw_std_list_List_1_reverse(v9); - VAL v11; - uint64_t v12; - VAL v13; - mw_mirth_elab_elabZ_lambdaZ_paramZAsk(v8, v7, &v11, &v12, &v13); - uint64_t x14; - VAL x15; - VAL x16; - VAL x17; - int64_t x18; - switch (get_data_tag(v13)) { - case 1LL: { // Some - VAL v19 = mtp_std_maybe_Maybe_1_Some(v13); - VAL v20 = mtw_std_list_List_1_Cons(v19, v10); - int64_t v21 = 1LL /* True */; - x18 = v21; - x17 = v20; - x16 = v5; - x15 = v11; - x14 = v12; - } break; - case 0LL: { // None - int64_t v22 = 0LL /* False */; - x18 = v22; - x17 = v10; - x16 = v5; - x15 = v11; - x14 = v12; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v23 = x14; - VAL v24 = (x15); - VAL v25 = (x16); - VAL v26 = (x17); - int64_t v27 = x18; - while (((bool)v27)) { - uint64_t v28 = v23; - VAL v29 = (v24); - VAL v30 = (v25); - VAL v31 = (v26); - VAL v32; - uint64_t v33; - VAL v34; - mw_mirth_elab_elabZ_lambdaZ_paramZAsk(v29, v28, &v32, &v33, &v34); - uint64_t x35; - VAL x36; - VAL x37; - VAL x38; - int64_t x39; - switch (get_data_tag(v34)) { + int64_t v11 = 1LL /* True */; + VAL v12 = v8; + uint64_t v13 = v7; + VAL v14 = v5; + VAL v15 = v10; + int64_t v16 = v11; + int64_t v17 = v11; + while (((bool)v17)) { + VAL v18 = v12; + uint64_t v19 = v13; + VAL v20 = v14; + VAL v21 = v15; + int64_t v22 = v16; + VAL v23; + uint64_t v24; + VAL v25; + mw_mirth_elab_elabZ_lambdaZ_paramZAsk(v18, v19, &v23, &v24, &v25); + VAL x26; + int64_t x27; + switch (get_data_tag(v25)) { case 1LL: { // Some - VAL v40 = mtp_std_maybe_Maybe_1_Some(v34); - VAL v41 = mtw_std_list_List_1_Cons(v40, v31); - int64_t v42 = 1LL /* True */; - x39 = v42; - x38 = v41; - x37 = v30; - x36 = v32; - x35 = v33; + VAL v28 = mtp_std_maybe_Maybe_1_Some(v25); + VAL v29 = mtw_std_list_List_1_Cons(v28, v21); + int64_t v30 = 1LL /* True */; + x27 = v30; + x26 = v29; } break; case 0LL: { // None - int64_t v43 = 0LL /* False */; - x39 = v43; - x38 = v31; - x37 = v30; - x36 = v32; - x35 = v33; + int64_t v31 = 0LL /* False */; + x27 = v31; + x26 = v21; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v27 = x39; - v26 = x38; - v25 = x37; - v24 = x36; - v23 = x35; + v17 = x27; + v16 = x27; + v15 = x26; + v14 = v20; + v13 = v24; + v12 = v23; } - VAL v44 = mw_std_list_List_1_reverse(v26); + VAL v32 = mw_std_list_List_1_reverse(v15); + VAL v33; + uint64_t v34; + mw_mirth_elab_expectZ_tokenZ_arrow(v12, v13, &v33, &v34); + uint64_t v35 = mw_mirth_token_Token_succ(v34); + incref(v32); + VAL v36; + VAL v37; + mw_mirth_elab_abZ_ctxZAt(v14, &v36, &v37); + VAL v38; + VAL v39; + mw_mirth_elab_abZ_typeZAt(v36, &v38, &v39); + VAL v40; + VAL v41; + VAL v42; + VAL v43; + mw_std_list_List_1_reverseZ_for_1_sp9(v33, v38, v37, v39, v32, &v40, &v41, &v42, &v43); + VAL v44; VAL v45; - uint64_t v46; - mw_mirth_elab_expectZ_tokenZ_arrow(v24, v23, &v45, &v46); - uint64_t v47 = mw_mirth_token_Token_succ(v46); - incref(v44); + mw_mirth_elab_abZ_homeZAt(v41, &v44, &v45); + VAL v46; + VAL v47; + mw_mirth_elab_abZ_buildZBang_1_sp32(v40, v42, v43, v35, v45, &v46, &v47); VAL v48; VAL v49; - mw_mirth_elab_abZ_ctxZAt(v25, &v48, &v49); + mw_mirth_elab_abZ_ctxZAt(v44, &v48, &v49); VAL v50; VAL v51; mw_mirth_elab_abZ_typeZAt(v48, &v50, &v51); - VAL v52 = mw_std_list_List_1_reverse(v44); - VAL v53; - VAL v54; - mw_std_list_List_1_uncons(v52, &v53, &v54); - uint64_t x55; - VAL x56; - VAL x57; - VAL x58; - VAL x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v53)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v53); - incref(v62); - VAL v63 = mw_mirth_var_Ctx_new(v49, VU64(v62)); - VAL v64; - uint64_t v65; - mw_mirth_elab_abZ_tokenZAt(v50, &v64, &v65); - VAL v66; - VAL v67; - VAL v68; - uint64_t v69; - mw_mirth_elab_elabZ_expandZ_tensorZBang(v45, v51, v65, &v66, &v67, &v68, &v69); - VAL v70 = mw_mirth_var_Var_type(VU64(v62)); - VAL v71; - VAL v72; - uint64_t v73; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v66, v68, v70, v69, &v71, &v72, &v73); - decref(v72); - int64_t v74 = 1LL /* True */; - x61 = v74; - x60 = v54; - x59 = v67; - x58 = v64; - x57 = v63; - x56 = v71; - x55 = v47; - } break; - case 0LL: { // None - int64_t v75 = 0LL /* False */; - x61 = v75; - x60 = v54; - x59 = v51; - x58 = v50; - x57 = v49; - x56 = v45; - x55 = v47; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v76 = x55; - VAL v77 = (x56); - VAL v78 = x57; - VAL v79 = (x58); - VAL v80 = x59; - VAL v81 = x60; - int64_t v82 = x61; - while (((bool)v82)) { - uint64_t v83 = v76; - VAL v84 = (v77); - VAL v85 = v78; - VAL v86 = (v79); - VAL v87 = v80; - VAL v88 = v81; - VAL v89; - VAL v90; - mw_std_list_List_1_uncons(v88, &v89, &v90); - uint64_t x91; - VAL x92; - VAL x93; - VAL x94; - VAL x95; - VAL x96; - int64_t x97; - switch (get_data_tag(v89)) { - case 1LL: { // Some - VAL v98 = mtp_std_maybe_Maybe_1_Some(v89); - incref(v98); - VAL v99 = mw_mirth_var_Ctx_new(v85, VU64(v98)); - VAL v100; - uint64_t v101; - mw_mirth_elab_abZ_tokenZAt(v86, &v100, &v101); - VAL v102; - VAL v103; - VAL v104; - uint64_t v105; - mw_mirth_elab_elabZ_expandZ_tensorZBang(v84, v87, v101, &v102, &v103, &v104, &v105); - VAL v106 = mw_mirth_var_Var_type(VU64(v98)); - VAL v107; - VAL v108; - uint64_t v109; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v102, v104, v106, v105, &v107, &v108, &v109); - decref(v108); - int64_t v110 = 1LL /* True */; - x97 = v110; - x96 = v90; - x95 = v103; - x94 = v100; - x93 = v99; - x92 = v107; - x91 = v83; - } break; - case 0LL: { // None - int64_t v111 = 0LL /* False */; - x97 = v111; - x96 = v90; - x95 = v87; - x94 = v86; - x93 = v85; - x92 = v84; - x91 = v83; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v82 = x97; - v81 = x96; - v80 = x95; - v79 = x94; - v78 = x93; - v77 = x92; - v76 = x91; - } - decref(v81); - VAL v112; - VAL v113; - mw_mirth_elab_abZ_homeZAt(v79, &v112, &v113); - incref(v80); - VAL v114 = MKI64(0LL /* Nil */); - VAL v115 = mtw_mirth_arrow_Arrow_Arrow(v113, v76, v76, v78, v80, v80, v114); - VAL v116; - VAL v117; - mw_mirth_elab_elabZ_atomsZBang(v77, v115, &v116, &v117); - VAL v118; - VAL v119; - mw_mirth_elab_abZ_ctxZAt(v112, &v118, &v119); - VAL v120; - VAL v121; - mw_mirth_elab_abZ_typeZAt(v118, &v120, &v121); - VAL v122; - uint64_t v123; - mw_mirth_elab_abZ_tokenZAt(v120, &v122, &v123); - VAL v124 = mtw_mirth_arrow_Lambda_Lambda(v123, v119, v121, v44, v117); - VAL v125 = mtw_mirth_arrow_Op_OpLambda(v124); - VAL v126; - VAL v127; - mw_mirth_elab_abZ_opZBang(v125, v116, v122, &v126, &v127); - *x4 = v127; - *x3 = v126; + VAL v52; + uint64_t v53; + mw_mirth_elab_abZ_tokenZAt(v50, &v52, &v53); + VAL v54 = mtw_mirth_arrow_Lambda_Lambda(v53, v49, v51, v32, v47); + VAL v55 = mtw_mirth_arrow_Op_OpLambda(v54); + VAL v56; + VAL v57; + mw_mirth_elab_abZ_opZBang(v55, v46, v52, &v56, &v57); + *x4 = v57; + *x3 = v56; } static void mw_mirth_elab_elabZ_matchZ_exhaustiveZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5 = mw_mirth_match_ZPlusMatch_freezze(x2); @@ -53208,11 +39760,11 @@ static void mw_mirth_elab_elabZ_matchZ_exhaustiveZBang (VAL x1, VAL x2, VAL *x3, decref(v5); STR* v10; STRLIT(v10, "Pattern match not exhaustive.", 29); - VAL v11 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v9, MKSTR(v10), x1)); + VAL v11 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v9, MKSTR(v10), x1); x8 = v5; x7 = v11; } - VAL v12 = (mw_mirth_match_Match_thaw(x8)); + VAL v12 = mw_mirth_match_Match_thaw(x8); *x4 = v12; *x3 = x7; } @@ -53225,14 +39777,14 @@ static void mw_mirth_elab_elabZ_moduleZBang (uint64_t x1, int64_t x2, VAL x3, ui int64_t v11 = mw_mirth_token_Token_moduleZ_endZAsk(v10); bool v12 = !((bool)v11); uint64_t v13 = x1; - int64_t v14 = (v8); - VAL v15 = (v9); + int64_t v14 = v8; + VAL v15 = v9; uint64_t v16 = v10; bool v17 = v12; while (v17) { uint64_t v18 = v13; - int64_t v19 = (v14); - VAL v20 = (v15); + int64_t v19 = v14; + VAL v20 = v15; uint64_t v21 = v16; uint64_t v22; int64_t v23; @@ -53252,125 +39804,80 @@ static void mw_mirth_elab_elabZ_moduleZBang (uint64_t x1, int64_t x2, VAL x3, ui } static void mw_mirth_elab_elabZ_moduleZ_packageZ_name (uint64_t x1, VAL x2, uint64_t *x3, uint64_t *x4, VAL *x5) { VAL v6 = mw_mirth_token_Token_dnameZAsk(x1); - VAL x7; - uint64_t x8; + uint64_t x7; + VAL x8; VAL x9; switch (get_data_tag(v6)) { case 1LL: { // Some VAL v10 = mtp_std_maybe_Maybe_1_Some(v6); x9 = v10; - x8 = x1; - x7 = x2; + x8 = x2; + x7 = x1; } break; case 0LL: { // None STR* v11; STRLIT(v11, "Expected module name. (1)", 25); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v11), x2); - VAL v12 = pop_value(); - x9 = v12; - uint64_t v13 = pop_u64(); - x8 = v13; - VAL r14 = pop_resource(); - x7 = r14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v15 = (mw_mirth_token_Token_argsZ_0(x8, x7)); + VAL v15 = mw_mirth_token_Token_argsZ_0(x7, x8); incref(x9); VAL v16 = mw_mirth_name_DName_rootZAsk(x9); uint64_t x17; VAL x18; VAL x19; - uint64_t x20; + VAL x20; switch (get_data_tag(v16)) { case 1LL: { // Some VAL v21 = mtp_std_maybe_Maybe_1_Some(v16); - x20 = VU64(v21); + x20 = v21; x19 = x9; x18 = v15; - x17 = x8; + x17 = x7; } break; case 0LL: { // None decref(x9); STR* v22; STRLIT(v22, "Expected module name. (2)", 25); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x8, MKSTR(v22), v15); - uint64_t v23 = pop_u64(); - x20 = v23; - VAL v24 = pop_value(); - x19 = v24; - VAL r25 = pop_resource(); - x18 = r25; - uint64_t v26 = pop_u64(); - x17 = v26; + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x7, MKSTR(v22), v15); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } VAL v27 = mw_mirth_name_DName_parts(x19); - VAL v28; - VAL v29; - mtp_std_list_ListZPlus_1_ListZPlus(v27, &v28, &v29); - int64_t v30 = mw_std_list_List_1_ZDivL0(v29); + VAL v28 = mw_std_list_ListZPlus_1_ZDivL1ZPlus(v27); + uint64_t x29; + VAL x30; VAL x31; - if (((bool)v30)) { - VAL v32 = mtw_std_maybe_Maybe_1_Some(v28); - x31 = v32; - push_u64(x17); - push_resource(x18); - push_u64(x20); - } else { - decref(v28); - VAL v33 = MKI64(0LL /* None */); - x31 = v33; - push_u64(x17); - push_resource(x18); - push_u64(x20); - } - uint64_t x34; - VAL x35; - uint64_t x36; - uint64_t x37; - switch (get_data_tag(x31)) { + VAL x32; + switch (get_data_tag(v28)) { case 1LL: { // Some - VAL v38 = mtp_std_maybe_Maybe_1_Some(x31); - x37 = VU64(v38); - uint64_t v39 = pop_u64(); - x36 = v39; - VAL r40 = pop_resource(); - x35 = r40; - uint64_t v41 = pop_u64(); - x34 = v41; + VAL v33 = mtp_std_maybe_Maybe_1_Some(v28); + x32 = v33; + x31 = x20; + x30 = x18; + x29 = x17; } break; case 0LL: { // None - uint64_t v42 = pop_u64(); - STR* v43; - STRLIT(v43, "Expected module name. (3)", 25); - VAL r44 = pop_resource(); - uint64_t v45 = pop_u64(); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v45, MKSTR(v43), r44); - uint64_t v46 = pop_u64(); - x37 = v46; - uint64_t v47 = pop_u64(); - x36 = v47; - VAL r48 = pop_resource(); - x35 = r48; - uint64_t v49 = pop_u64(); - x34 = v49; + decref(x20); + STR* v34; + STRLIT(v34, "Expected module name. (3)", 25); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x17, MKSTR(v34), x18); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v50; - uint64_t v51; - mw_mirth_package_Package_findZ_orZ_newZBang(x35, x36, &v50, &v51); - *x5 = v50; - *x4 = x37; - *x3 = v51; + VAL v39; + uint64_t v40; + mw_mirth_package_Package_findZ_orZ_newZBang(x30, VU64(x31), &v39, &v40); + *x5 = v39; + *x4 = VU64(x32); + *x3 = v40; } static void mw_mirth_elab_elabZ_moduleZ_qname (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { uint64_t v5; @@ -53409,54 +39916,31 @@ static void mw_mirth_elab_elabZ_moduleZ_headerZBang (int64_t x1, VAL x2, uint64_ VAL v23; int64_t v24; mw_mirth_name_QName_definedZ_softZAsk(v18, v22, &v23, &v24); - int64_t x25; - uint64_t x26; - uint64_t x27; - uint64_t x28; - VAL x29; + uint64_t x25; + VAL x26; + VAL x27; if (((bool)v24)) { - STR* v30; - STRLIT(v30, "Module name already taken.", 26); - push_resource(MKI64(x1)); - push_u64(v13); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v14, MKSTR(v30), v23); - VAL r31 = pop_resource(); - x29 = r31; - uint64_t v32 = pop_u64(); - x28 = v32; - uint64_t v33 = pop_u64(); - x27 = v33; - uint64_t v34 = pop_u64(); - x26 = v34; - int64_t r35 = VI64(pop_resource()); - x25 = r35; + STR* v28; + STRLIT(v28, "Module name already taken.", 26); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v14, MKSTR(v28), v23); } else { - x29 = v23; - x28 = v19; - x27 = v14; - x26 = v13; - x25 = x1; - } - VAL v36 = mtw_mirth_def_Def_DefModule(x28); - VAL v37 = (mw_mirth_def_Def_register(x29, v36)); - int64_t v38; - VAL v39; - mw_mirth_elab_checkZ_moduleZ_path(x27, x28, x25, v37, &v38, &v39); - x12 = v39; - x11 = v38; - x10 = x26; + x27 = MKU64(v19); + x26 = v23; + x25 = v14; + } + incref(x27); + VAL v32 = mtw_mirth_def_Def_DefModule(VU64(x27)); + VAL v33 = mw_mirth_def_Def_register(x26, v32); + int64_t v34; + VAL v35; + mw_mirth_elab_checkZ_moduleZ_path(x25, VU64(x27), x1, v33, &v34, &v35); + x12 = v35; + x11 = v34; + x10 = v13; } else { - STR* v40; - STRLIT(v40, "Expected module header.", 23); - push_resource(MKI64(x1)); - push_u64(x3); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x3, MKSTR(v40), x2); - VAL r41 = pop_resource(); - x12 = r41; - int64_t r42 = VI64(pop_resource()); - x11 = r42; - uint64_t v43 = pop_u64(); - x10 = v43; + STR* v36; + STRLIT(v36, "Expected module header.", 23); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x3, MKSTR(v36), x2); } *x6 = x10; *x5 = x12; @@ -53480,389 +39964,202 @@ static void mw_mirth_elab_checkZ_moduleZ_path (uint64_t x1, uint64_t x2, int64_t incref(v13); bool v16 = (str_cmp(VSTR(v8), VSTR(v13)) == 0); uint64_t x17; - int64_t x18; + VAL x18; VAL x19; VAL x20; - VAL x21; if (v16) { - x21 = v13; - x20 = v8; - x19 = v15; - x18 = v14; + x20 = v13; + x19 = v8; + x18 = v15; x17 = x1; } else { - STR* v22; - STRLIT(v22, "expected module name to match path\n", 35); - STR* v23 = str_cat(v22, VSTR(v13)); - STR* v24; - STRLIT(v24, "\n", 1); - STR* v25 = str_cat(v23, v24); - STR* v26 = str_cat(v25, VSTR(v8)); - push_resource(MKI64(v14)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v26), v15); - VAL v27 = pop_value(); - x21 = v27; - VAL v28 = pop_value(); - x20 = v28; - VAL r29 = pop_resource(); - x19 = r29; - int64_t r30 = VI64(pop_resource()); - x18 = r30; - uint64_t v31 = pop_u64(); - x17 = v31; + STR* v21; + STRLIT(v21, "expected module name to match path\n", 35); + STR* v22 = str_cat(v21, VSTR(v13)); + STR* v23; + STRLIT(v23, "\n", 1); + STR* v24 = str_cat(v22, v23); + STR* v25 = str_cat(v24, VSTR(v8)); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v25), v15); } - decref(x21); decref(x20); - x11 = x19; - x10 = x18; + decref(x19); + x11 = x18; + x10 = v14; } break; case 1LL: { // Some - VAL v32 = mtp_std_maybe_Maybe_1_Some(v9); - int64_t v33; - VAL v34; - mw_std_str_ZPlusStr_numZ_bytesZAsk(v32, &v33, &v34); - VAL v35 = MKI64(0LL /* None */); - incref(v35); - int64_t v36 = mw_std_maybe_Maybe_1_noneZAsk(v35); - uint64_t x37; + VAL v30 = mtp_std_maybe_Maybe_1_Some(v9); + incref(v30); + uint64_t v31 = str_size(VSTR(v30)); + VAL v32 = MKI64(0LL /* None */); + incref(v32); + int64_t v33 = get_data_tag(v32); + decref(v32); + int64_t v34 = 0LL; + bool v35 = (v33 == v34); + int64_t x36; + VAL x37; int64_t x38; - VAL x39; - uint64_t x40; - VAL x41; - VAL x42; - int64_t x43; - VAL x44; - int64_t x45; - if (((bool)v36)) { - int64_t v46 = 0LL; - bool v47 = (v33 > v46); - x45 = ((int64_t)v47); - x44 = v35; - x43 = v33; - x42 = v34; - x41 = v8; - x40 = x2; - x39 = x4; - x38 = x3; - x37 = x1; + if (v35) { + int64_t v39 = 0LL; + bool v40 = (((int64_t)v31) > v39); + x38 = ((int64_t)v40); + x37 = v32; + x36 = ((int64_t)v31); } else { - int64_t v48 = 0LL /* False */; - x45 = v48; - x44 = v35; - x43 = v33; - x42 = v34; - x41 = v8; - x40 = x2; - x39 = x4; - x38 = x3; - x37 = x1; + int64_t v41 = 0LL /* False */; + x38 = v41; + x37 = v32; + x36 = ((int64_t)v31); } - uint64_t v49 = x37; - int64_t v50 = (x38); - VAL v51 = (x39); - uint64_t v52 = x40; - VAL v53 = x41; - VAL v54 = (x42); - int64_t v55 = x43; - VAL v56 = x44; - int64_t v57 = x45; - while (((bool)v57)) { - uint64_t v58 = v49; - int64_t v59 = (v50); - VAL v60 = (v51); - uint64_t v61 = v52; - VAL v62 = v53; - VAL v63 = (v54); - int64_t v64 = v55; - VAL v65 = v56; - decref(v65); - int64_t v66 = 1LL; - int64_t v67 = i64_sub(v64, v66); - int64_t v68 = 0LL; - bool v69 = (v67 < v68); - int64_t x70; - if (v69) { - int64_t v71 = 0LL; - x70 = v71; - push_u64(v58); - push_resource(MKI64(v59)); - push_resource(v60); - push_u64(v61); - push_value(v62); - push_resource(v63); + VAL v42 = v30; + int64_t v43 = x36; + VAL v44 = x37; + int64_t v45 = x38; + while (((bool)v45)) { + VAL v46 = v42; + int64_t v47 = v43; + VAL v48 = v44; + decref(v48); + int64_t v49 = 1LL; + int64_t v50 = i64_sub(v47, v49); + int64_t v51 = 0LL; + bool v52 = (v50 < v51); + int64_t x53; + if (v52) { + int64_t v54 = 0LL; + x53 = v54; } else { - x70 = v67; - push_u64(v58); - push_resource(MKI64(v59)); - push_resource(v60); - push_u64(v61); - push_value(v62); - push_resource(v63); + x53 = v50; } - VAL r72 = pop_resource(); - int64_t v73; - VAL v74; - mw_std_str_ZPlusStr_byteZAt(x70, r72, &v73, &v74); - int64_t v75 = 46LL /* BDOT */; - bool v76 = (v73 == v75); - uint64_t x77; - int64_t x78; - VAL x79; - uint64_t x80; - VAL x81; - VAL x82; - int64_t x83; - VAL x84; - if (v76) { - VAL v85 = mtw_std_maybe_Maybe_1_Some(MKI64(x70)); - x84 = v85; - x83 = x70; - x82 = v74; - VAL v86 = pop_value(); - x81 = v86; - uint64_t v87 = pop_u64(); - x80 = v87; - VAL r88 = pop_resource(); - x79 = r88; - int64_t r89 = VI64(pop_resource()); - x78 = r89; - uint64_t v90 = pop_u64(); - x77 = v90; + int64_t v55; + VAL v56; + mw_std_str_ZPlusStr_byteZAt(x53, v46, &v55, &v56); + int64_t v57 = 46LL /* BDOT */; + bool v58 = (v55 == v57); + VAL x59; + int64_t x60; + VAL x61; + if (v58) { + VAL v62 = mtw_std_maybe_Maybe_1_Some(MKI64(x53)); + x61 = v62; + x60 = x53; + x59 = v56; } else { - VAL v91 = MKI64(0LL /* None */); - x84 = v91; - x83 = x70; - x82 = v74; - VAL v92 = pop_value(); - x81 = v92; - uint64_t v93 = pop_u64(); - x80 = v93; - VAL r94 = pop_resource(); - x79 = r94; - int64_t r95 = VI64(pop_resource()); - x78 = r95; - uint64_t v96 = pop_u64(); - x77 = v96; + VAL v63 = MKI64(0LL /* None */); + x61 = v63; + x60 = x53; + x59 = v56; } - incref(x84); - int64_t v97 = mw_std_maybe_Maybe_1_noneZAsk(x84); - uint64_t x98; - int64_t x99; - VAL x100; - uint64_t x101; - VAL x102; - VAL x103; - int64_t x104; - VAL x105; - int64_t x106; - if (((bool)v97)) { - int64_t v107 = 0LL; - bool v108 = (x83 > v107); - x106 = ((int64_t)v108); - x105 = x84; - x104 = x83; - x103 = x82; - x102 = x81; - x101 = x80; - x100 = x79; - x99 = x78; - x98 = x77; + incref(x61); + int64_t v64 = get_data_tag(x61); + decref(x61); + int64_t v65 = 0LL; + bool v66 = (v64 == v65); + int64_t x67; + VAL x68; + int64_t x69; + if (v66) { + int64_t v70 = 0LL; + bool v71 = (x60 > v70); + x69 = ((int64_t)v71); + x68 = x61; + x67 = x60; } else { - int64_t v109 = 0LL /* False */; - x106 = v109; - x105 = x84; - x104 = x83; - x103 = x82; - x102 = x81; - x101 = x80; - x100 = x79; - x99 = x78; - x98 = x77; - } - v57 = x106; - v56 = x105; - v55 = x104; - v54 = x103; - v53 = x102; - v52 = x101; - v51 = x100; - v50 = x99; - v49 = x98; - } - uint64_t x110; - int64_t x111; - VAL x112; - uint64_t x113; - VAL x114; - VAL x115; - VAL x116; - switch (get_data_tag(v56)) { - case 1LL: { // Some - VAL v117 = mtp_std_maybe_Maybe_1_Some(v56); - int64_t v118 = (0LL /* +Unsafe */); - incref(v117); - incref(v54); - int64_t v119 = 1LL; - int64_t v120 = i64_add(VI64(v117), v119); - VAL v121; - int64_t v122; - mw_std_prim_Str_dropZ_slice(v120, v54, v118, &v121, &v122); - VAL v123; - int64_t v124; - mw_std_prim_Str_takeZ_slice(VI64(v117), v54, v122, &v123, &v124); - VAL v125 = mtw_std_maybe_Maybe_1_Some(v121); - x116 = v125; - x115 = v123; - x114 = v53; - x113 = v52; - x112 = v51; - x111 = v50; - x110 = v49; - } break; - case 0LL: { // None - VAL v126 = MKI64(0LL /* None */); - x116 = v126; - x115 = v54; - x114 = v53; - x113 = v52; - x112 = v51; - x111 = v50; - x110 = v49; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + int64_t v72 = 0LL /* False */; + x69 = v72; + x68 = x61; + x67 = x60; } + v45 = x69; + v44 = x68; + v43 = x67; + v42 = x59; } - STR* v127; - STRLIT(v127, "mth", 3); - VAL v128 = mtw_std_maybe_Maybe_1_Some(MKSTR(v127)); - uint64_t x129; - int64_t x130; - VAL x131; - uint64_t x132; - VAL x133; - VAL x134; - int64_t x135; - switch (get_data_tag(v128)) { + VAL v73; + VAL v74; + mw_std_maybe_Maybe_1_map_1_sp14(v42, v44, &v73, &v74); + STR* v75; + STRLIT(v75, "mth", 3); + VAL v76 = mtw_std_maybe_Maybe_1_Some(MKSTR(v75)); + int64_t x77; + switch (get_data_tag(v76)) { case 0LL: { // None - int64_t v136 = mw_std_maybe_Maybe_1_noneZAsk(x116); - x135 = v136; - x134 = x115; - x133 = x114; - x132 = x113; - x131 = x112; - x130 = x111; - x129 = x110; + int64_t v78 = get_data_tag(v74); + decref(v74); + int64_t v79 = 0LL; + bool v80 = (v78 == v79); + x77 = ((int64_t)v80); } break; case 1LL: { // Some - VAL v137 = mtp_std_maybe_Maybe_1_Some(v128); - uint64_t x138; - int64_t x139; - VAL x140; - uint64_t x141; - VAL x142; - VAL x143; - int64_t x144; - switch (get_data_tag(x116)) { + VAL v81 = mtp_std_maybe_Maybe_1_Some(v76); + int64_t x82; + switch (get_data_tag(v74)) { case 1LL: { // Some - VAL v145 = mtp_std_maybe_Maybe_1_Some(x116); - bool v146 = (str_cmp(VSTR(v145), VSTR(v137)) == 0); - x144 = ((int64_t)v146); - x143 = x115; - x142 = x114; - x141 = x113; - x140 = x112; - x139 = x111; - x138 = x110; + VAL v83 = mtp_std_maybe_Maybe_1_Some(v74); + bool v84 = (str_cmp(VSTR(v83), VSTR(v81)) == 0); + x82 = ((int64_t)v84); } break; case 0LL: { // None - decref(v137); - int64_t v147 = 0LL /* False */; - x144 = v147; - x143 = x115; - x142 = x114; - x141 = x113; - x140 = x112; - x139 = x111; - x138 = x110; + decref(v81); + int64_t v85 = 0LL /* False */; + x82 = v85; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x135 = x144; - x134 = x143; - x133 = x142; - x132 = x141; - x131 = x140; - x130 = x139; - x129 = x138; + x77 = x82; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t x148; - int64_t x149; - VAL x150; - uint64_t x151; - VAL x152; - VAL x153; - if (((bool)x135)) { - x153 = x134; - x152 = x133; - x151 = x132; - x150 = x131; - x149 = x130; - x148 = x129; + VAL x86; + uint64_t x87; + VAL x88; + VAL x89; + VAL x90; + if (((bool)x77)) { + x90 = v73; + x89 = v8; + x88 = MKU64(x2); + x87 = x1; + x86 = x4; } else { - STR* v154; - STRLIT(v154, "expected .mth extension for mirth file", 38); - VAL v155 = (mw_mirth_mirth_ZPlusMirth_emitZ_warningZBang(x129, MKSTR(v154), x131)); - x153 = x134; - x152 = x133; - x151 = x132; - x150 = v155; - x149 = x130; - x148 = x129; + STR* v91; + STRLIT(v91, "expected .mth extension for mirth file", 38); + VAL v92 = mw_mirth_mirth_ZPlusMirth_emitZ_warningZBang(x1, MKSTR(v91), x4); + x90 = v73; + x89 = v8; + x88 = MKU64(x2); + x87 = x1; + x86 = v92; } - uint64_t v156 = mw_mirth_module_Module_name(x151); - VAL v157 = mw_mirth_name_Name_ZToStr(v156); - bool v158 = (str_cmp(VSTR(x153), VSTR(v157)) == 0); - uint64_t x159; - int64_t x160; - VAL x161; - uint64_t x162; - VAL x163; - if (v158) { - x163 = x152; - x162 = x151; - x161 = x150; - x160 = x149; - x159 = x148; + incref(x88); + uint64_t v93 = mw_mirth_module_Module_name(VU64(x88)); + VAL v94 = mw_mirth_name_Name_ZToStr(v93); + bool v95 = (str_cmp(VSTR(x90), VSTR(v94)) == 0); + VAL x96; + uint64_t x97; + VAL x98; + VAL x99; + if (v95) { + x99 = x89; + x98 = x88; + x97 = x87; + x96 = x86; } else { - STR* v164; - STRLIT(v164, "expected module name to match file name", 39); - push_resource(MKI64(x149)); - push_u64(x148); - push_u64(x151); - push_value(x152); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x148, MKSTR(v164), x150); - VAL v165 = pop_value(); - x163 = v165; - uint64_t v166 = pop_u64(); - x162 = v166; - VAL r167 = pop_resource(); - x161 = r167; - int64_t r168 = VI64(pop_resource()); - x160 = r168; - uint64_t v169 = pop_u64(); - x159 = v169; - } - uint64_t v170 = mw_mirth_module_Module_package(x162); - VAL v171 = (mw_mirth_package_Package_pathZBang(x161, x163, v170)); - x11 = v171; - x10 = x160; + STR* v100; + STRLIT(v100, "expected module name to match file name", 39); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x87, MKSTR(v100), x86); + } + incref(x98); + uint64_t v102 = mw_mirth_module_Module_package(VU64(x98)); + VAL v103 = mw_mirth_package_Package_pathZBang(x96, x99, v102); + decref(x98); + x11 = v103; + x10 = x3; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -53877,356 +40174,243 @@ static void mw_mirth_elab_elabZ_moduleZ_declZBang (uint64_t x1, int64_t x2, VAL decref(v8); VTUP(x3)->cells[5] = v7; VAL v9 = mw_mirth_token_Token_nameZAsk(x1); - int64_t x10; + uint64_t x10; VAL x11; - uint64_t x12; - uint64_t x13; + VAL x12; switch (get_data_tag(v9)) { case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v9); - x13 = VU64(v14); - x12 = x1; + VAL v13 = mtp_std_maybe_Maybe_1_Some(v9); + x12 = v13; x11 = x3; - x10 = x2; - } break; - case 0LL: { // None - STR* v15; - STRLIT(v15, "unknown declaration", 19); - push_resource(MKI64(x2)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v15), x3); - uint64_t v16 = pop_u64(); - x13 = v16; - uint64_t v17 = pop_u64(); - x12 = v17; - VAL r18 = pop_resource(); - x11 = r18; - int64_t r19 = VI64(pop_resource()); - x10 = r19; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v20 = mw_mirth_name_Name_defs(x13); - VAL v21 = MKI64(0LL /* None */); - VAL v22; - VAL v23; - mw_std_list_List_1_uncons(v20, &v22, &v23); - int64_t x24; - VAL x25; - uint64_t x26; - VAL x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v22)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v22); - VAL v31 = mw_mirth_def_Def_primZAsk(v30); - int64_t x32; - VAL x33; - uint64_t x34; - VAL x35; - VAL x36; - switch (get_data_tag(v31)) { - case 0LL: { // None - x36 = v23; - x35 = v21; - x34 = x12; - x33 = x11; - x32 = x10; - } break; - default: { - decref(v23); - decref(v21); - VAL v37 = MKI64(0LL /* Nil */); - x36 = v37; - x35 = v31; - x34 = x12; - x33 = x11; - x32 = x10; - } break; - } - int64_t v38 = 1LL /* True */; - x29 = v38; - x28 = x36; - x27 = x35; - x26 = x34; - x25 = x33; - x24 = x32; + x10 = x1; } break; case 0LL: { // None - int64_t v39 = 0LL /* False */; - x29 = v39; - x28 = v23; - x27 = v21; - x26 = x12; - x25 = x11; - x24 = x10; + STR* v14; + STRLIT(v14, "unknown declaration", 19); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v14), x3); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v40 = (x24); - VAL v41 = (x25); - uint64_t v42 = x26; - VAL v43 = x27; - VAL v44 = x28; - int64_t v45 = x29; - while (((bool)v45)) { - int64_t v46 = (v40); - VAL v47 = (v41); - uint64_t v48 = v42; - VAL v49 = v43; - VAL v50 = v44; - VAL v51; - VAL v52; - mw_std_list_List_1_uncons(v50, &v51, &v52); - int64_t x53; - VAL x54; - uint64_t x55; - VAL x56; - VAL x57; - int64_t x58; - switch (get_data_tag(v51)) { + VAL v18 = mw_mirth_name_Name_defs(VU64(x12)); + VAL v19 = MKI64(0LL /* None */); + int64_t v20 = 1LL /* True */; + VAL v21 = v19; + VAL v22 = v18; + int64_t v23 = v20; + int64_t v24 = v20; + while (((bool)v24)) { + VAL v25 = v21; + VAL v26 = v22; + int64_t v27 = v23; + VAL v28; + VAL v29; + mw_std_list_List_1_uncons(v26, &v28, &v29); + VAL x30; + VAL x31; + int64_t x32; + switch (get_data_tag(v28)) { case 1LL: { // Some - VAL v59 = mtp_std_maybe_Maybe_1_Some(v51); - VAL v60 = mw_mirth_def_Def_primZAsk(v59); - int64_t x61; - VAL x62; - uint64_t x63; - VAL x64; - VAL x65; - switch (get_data_tag(v60)) { + VAL v33 = mtp_std_maybe_Maybe_1_Some(v28); + VAL v34 = mw_mirth_def_Def_primZAsk(v33); + VAL x35; + VAL x36; + switch (get_data_tag(v34)) { case 0LL: { // None - x65 = v52; - x64 = v49; - x63 = v48; - x62 = v47; - x61 = v46; + x36 = v29; + x35 = v25; } break; default: { - decref(v52); - decref(v49); - VAL v66 = MKI64(0LL /* Nil */); - x65 = v66; - x64 = v60; - x63 = v48; - x62 = v47; - x61 = v46; + decref(v29); + decref(v25); + VAL v37 = MKI64(0LL /* Nil */); + x36 = v37; + x35 = v34; } break; } - int64_t v67 = 1LL /* True */; - x58 = v67; - x57 = x65; - x56 = x64; - x55 = x63; - x54 = x62; - x53 = x61; + int64_t v38 = 1LL /* True */; + x32 = v38; + x31 = x36; + x30 = x35; } break; case 0LL: { // None - int64_t v68 = 0LL /* False */; - x58 = v68; - x57 = v52; - x56 = v49; - x55 = v48; - x54 = v47; - x53 = v46; + int64_t v39 = 0LL /* False */; + x32 = v39; + x31 = v29; + x30 = v25; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v45 = x58; - v44 = x57; - v43 = x56; - v42 = x55; - v41 = x54; - v40 = x53; + v24 = x32; + v23 = x32; + v22 = x31; + v21 = x30; } - decref(v44); - int64_t x69; - VAL x70; - uint64_t x71; - int64_t x72; - switch (get_data_tag(v43)) { + decref(v22); + uint64_t x40; + VAL x41; + VAL x42; + switch (get_data_tag(v21)) { case 1LL: { // Some - VAL v73 = mtp_std_maybe_Maybe_1_Some(v43); - x72 = VI64(v73); - x71 = v42; - x70 = v41; - x69 = v40; + VAL v43 = mtp_std_maybe_Maybe_1_Some(v21); + x42 = v43; + x41 = x11; + x40 = x10; } break; case 0LL: { // None - STR* v74; - STRLIT(v74, "unknown declaration", 19); - push_resource(MKI64(v40)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v42, MKSTR(v74), v41); - int64_t v75 = pop_i64(); - x72 = v75; - uint64_t v76 = pop_u64(); - x71 = v76; - VAL r77 = pop_resource(); - x70 = r77; - int64_t r78 = VI64(pop_resource()); - x69 = r78; + STR* v44; + STRLIT(v44, "unknown declaration", 19); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x10, MKSTR(v44), x11); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t x79; - int64_t x80; - VAL x81; - switch (x72) { + uint64_t x48; + int64_t x49; + VAL x50; + switch (get_data_tag(x42)) { case 103LL: { // PRIM_SYNTAX_IMPORT - uint64_t v82; - int64_t v83; - VAL v84; - mw_mirth_elab_elabZ_moduleZ_importZBang(x71, x69, x70, &v82, &v83, &v84); - x81 = v84; - x80 = v83; - x79 = v82; + uint64_t v51; + int64_t v52; + VAL v53; + mw_mirth_elab_elabZ_moduleZ_importZBang(x40, x2, x41, &v51, &v52, &v53); + x50 = v53; + x49 = v52; + x48 = v51; } break; case 104LL: { // PRIM_SYNTAX_ALIAS - VAL v85; - uint64_t v86; - mw_mirth_elab_elabZ_aliasZBang(x70, x71, &v85, &v86); - x81 = v85; - x80 = x69; - x79 = v86; + VAL v54; + uint64_t v55; + mw_mirth_elab_elabZ_aliasZBang(x41, x40, &v54, &v55); + x50 = v54; + x49 = x2; + x48 = v55; } break; case 105LL: { // PRIM_SYNTAX_INLINE - uint64_t v87; - int64_t v88; - VAL v89; - mw_mirth_elab_elabZ_inlineZBang(x71, x69, x70, &v87, &v88, &v89); - x81 = v89; - x80 = v88; - x79 = v87; + uint64_t v56; + int64_t v57; + VAL v58; + mw_mirth_elab_elabZ_inlineZBang(x40, x2, x41, &v56, &v57, &v58); + x50 = v58; + x49 = v57; + x48 = v56; } break; case 106LL: { // PRIM_SYNTAX_DEF - VAL v90; - uint64_t v91; - mw_mirth_elab_elabZ_defZBang(x70, x71, &v90, &v91); - x81 = v90; - x80 = x69; - x79 = v91; + VAL v59; + uint64_t v60; + mw_mirth_elab_elabZ_defZBang(x41, x40, &v59, &v60); + x50 = v59; + x49 = x2; + x48 = v60; } break; case 107LL: { // PRIM_SYNTAX_DEF_MISSING - VAL v92; - uint64_t v93; - mw_mirth_elab_elabZ_defZ_missingZBang(x70, x71, &v92, &v93); - x81 = v92; - x80 = x69; - x79 = v93; + VAL v61; + uint64_t v62; + mw_mirth_elab_elabZ_defZ_missingZBang(x41, x40, &v61, &v62); + x50 = v61; + x49 = x2; + x48 = v62; } break; case 108LL: { // PRIM_SYNTAX_DEF_TYPE - VAL v94; - uint64_t v95; - mw_mirth_elab_elabZ_defZ_typeZBang(x70, x71, &v94, &v95); - x81 = v94; - x80 = x69; - x79 = v95; + VAL v63; + uint64_t v64; + mw_mirth_elab_elabZ_defZ_typeZBang(x41, x40, &v63, &v64); + x50 = v63; + x49 = x2; + x48 = v64; } break; case 112LL: { // PRIM_SYNTAX_DEF_EXTERNAL - STR* v96; - STRLIT(v96, "def-external", 12); - STR* v97; - STRLIT(v97, "external", 8); - VAL v98 = (mw_mirth_mirth_ZPlusMirth_emitZ_deprecatedZBang(x71, MKSTR(v96), MKSTR(v97), x70)); - VAL v99; - uint64_t v100; - mw_mirth_elab_elabZ_externalZBang(v98, x71, &v99, &v100); - x81 = v99; - x80 = x69; - x79 = v100; + STR* v65; + STRLIT(v65, "def-external", 12); + STR* v66; + STRLIT(v66, "external", 8); + VAL v67 = mw_mirth_mirth_ZPlusMirth_emitZ_deprecatedZBang(x40, MKSTR(v65), MKSTR(v66), x41); + VAL v68; + uint64_t v69; + mw_mirth_elab_elabZ_externalZBang(v67, x40, &v68, &v69); + x50 = v68; + x49 = x2; + x48 = v69; } break; case 111LL: { // PRIM_SYNTAX_EXTERNAL - VAL v101; - uint64_t v102; - mw_mirth_elab_elabZ_externalZBang(x70, x71, &v101, &v102); - x81 = v101; - x80 = x69; - x79 = v102; + VAL v70; + uint64_t v71; + mw_mirth_elab_elabZ_externalZBang(x41, x40, &v70, &v71); + x50 = v70; + x49 = x2; + x48 = v71; } break; case 109LL: { // PRIM_SYNTAX_BUFFER - VAL v103; - uint64_t v104; - mw_mirth_elab_elabZ_bufferZBang(x70, x71, &v103, &v104); - x81 = v103; - x80 = x69; - x79 = v104; + VAL v72; + uint64_t v73; + mw_mirth_elab_elabZ_bufferZBang(x41, x40, &v72, &v73); + x50 = v72; + x49 = x2; + x48 = v73; } break; case 110LL: { // PRIM_SYNTAX_VARIABLE - VAL v105; - uint64_t v106; - mw_mirth_elab_elabZ_variableZBang(x70, x71, &v105, &v106); - x81 = v105; - x80 = x69; - x79 = v106; + VAL v74; + uint64_t v75; + mw_mirth_elab_elabZ_variableZBang(x41, x40, &v74, &v75); + x50 = v74; + x49 = x2; + x48 = v75; } break; case 114LL: { // PRIM_SYNTAX_TABLE - VAL v107; - uint64_t v108; - mw_mirth_elab_elabZ_tableZBang(x70, x71, &v107, &v108); - x81 = v107; - x80 = x69; - x79 = v108; + VAL v76; + uint64_t v77; + mw_mirth_elab_elabZ_tableZBang(x41, x40, &v76, &v77); + x50 = v76; + x49 = x2; + x48 = v77; } break; case 115LL: { // PRIM_SYNTAX_FIELD - VAL v109; - uint64_t v110; - mw_mirth_elab_elabZ_fieldZBang(x70, x71, &v109, &v110); - x81 = v109; - x80 = x69; - x79 = v110; + VAL v78; + uint64_t v79; + mw_mirth_elab_elabZ_fieldZBang(x41, x40, &v78, &v79); + x50 = v78; + x49 = x2; + x48 = v79; } break; case 116LL: { // PRIM_SYNTAX_DATA - push_resource(MKI64(x69)); - uint64_t v111; - VAL v112; - mw_mirth_elab_elabZ_dataZBang(x70, x71, &v111, &v112); - x81 = v112; - int64_t r113 = VI64(pop_resource()); - x80 = r113; - x79 = v111; + uint64_t v80; + VAL v81; + mw_mirth_elab_elabZ_dataZBang(x41, x40, &v80, &v81); + x50 = v81; + x49 = x2; + x48 = v80; } break; case 117LL: { // PRIM_SYNTAX_STRUCT - push_resource(MKI64(x69)); - uint64_t v114; - VAL v115; - mw_mirth_elab_elabZ_structZBang(x70, x71, &v114, &v115); - x81 = v115; - int64_t r116 = VI64(pop_resource()); - x80 = r116; - x79 = v114; + uint64_t v82; + VAL v83; + mw_mirth_elab_elabZ_structZBang(x41, x40, &v82, &v83); + x50 = v83; + x49 = x2; + x48 = v82; } break; case 113LL: { // PRIM_SYNTAX_EMBED_STR - uint64_t v117; - int64_t v118; - VAL v119; - mw_mirth_elab_elabZ_embedZ_strZBang(x71, x69, x70, &v117, &v118, &v119); - x81 = v119; - x80 = v118; - x79 = v117; + uint64_t v84; + int64_t v85; + VAL v86; + mw_mirth_elab_elabZ_embedZ_strZBang(x40, x2, x41, &v84, &v85, &v86); + x50 = v86; + x49 = v85; + x48 = v84; } break; default: { - STR* v120; - STRLIT(v120, "unknown declaration", 19); - push_resource(MKI64(x69)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x71, MKSTR(v120), x70); - VAL r121 = pop_resource(); - x81 = r121; - int64_t r122 = VI64(pop_resource()); - x80 = r122; - uint64_t v123 = pop_u64(); - x79 = v123; - } break; - } - *x6 = x81; - *x5 = x80; - *x4 = x79; + decref(x42); + STR* v87; + STRLIT(v87, "unknown declaration", 19); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x40, MKSTR(v87), x41); + } break; + } + *x6 = x50; + *x5 = x49; + *x4 = x48; } static void mw_mirth_elab_loadZ_module (uint64_t x1, VAL x2, int64_t x3, VAL x4, uint64_t *x5, uint64_t *x6, int64_t *x7, VAL *x8) { incref(x2); @@ -54242,62 +40426,49 @@ static void mw_mirth_elab_loadZ_module (uint64_t x1, VAL x2, int64_t x3, VAL x4, VAL v15 = mtp_std_maybe_Maybe_1_Some(v10); VAL v16 = mw_mirth_def_Def_moduleZAsk(v15); uint64_t x17; - int64_t x18; + VAL x18; VAL x19; VAL x20; - uint64_t x21; switch (get_data_tag(v16)) { case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v16); - x21 = VU64(v22); - x20 = v9; + VAL v21 = mtp_std_maybe_Maybe_1_Some(v16); + x20 = v21; x19 = x2; - x18 = x3; + x18 = v9; x17 = x1; } break; case 0LL: { // None decref(x2); - STR* v23; - STRLIT(v23, "module name already taken", 25); - push_resource(MKI64(x3)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v23), v9); - uint64_t v24 = pop_u64(); - x21 = v24; - VAL r25 = pop_resource(); - x20 = r25; - VAL v26 = pop_value(); - x19 = v26; - int64_t r27 = VI64(pop_resource()); - x18 = r27; - uint64_t v28 = pop_u64(); - x17 = v28; + STR* v22; + STRLIT(v22, "module name already taken", 25); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, MKSTR(v22), v9); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } decref(x19); - x14 = x21; - x13 = x20; - x12 = x18; + x14 = VU64(x20); + x13 = x18; + x12 = x3; x11 = x17; } break; case 0LL: { // None + VAL v27; + int64_t v28; VAL v29; - int64_t v30; - VAL v31; - mw_mirth_name_QName_toZ_moduleZ_path(x2, x3, v9, &v29, &v30, &v31); - uint64_t v32; - int64_t v33; - VAL v34; - mw_mirth_lexer_runZ_lexerZBang(v29, v30, v31, &v32, &v33, &v34); - uint64_t v35; - int64_t v36; - VAL v37; - mw_mirth_elab_elabZ_moduleZBang(v32, v33, v34, &v35, &v36, &v37); - x14 = v35; - x13 = v37; - x12 = v36; + mw_mirth_name_QName_toZ_moduleZ_path(x2, x3, v9, &v27, &v28, &v29); + uint64_t v30; + int64_t v31; + VAL v32; + mw_mirth_lexer_runZ_lexerZBang(v27, v28, v29, &v30, &v31, &v32); + uint64_t v33; + int64_t v34; + VAL v35; + mw_mirth_elab_elabZ_moduleZBang(v30, v31, v32, &v33, &v34, &v35); + x14 = v33; + x13 = v35; + x12 = v34; x11 = x1; } break; default: { @@ -54339,236 +40510,140 @@ static void mw_mirth_elab_parseZ_data (VAL x1, uint64_t x2, VAL *x3, uint64_t *x if (v8) { uint64_t v13 = mw_mirth_token_Token_succ(x2); VAL v14 = mw_mirth_token_Token_lparenZAsk(v13); - VAL x15; - uint64_t x16; - switch (get_data_tag(v14)) { - case 1LL: { // Some - VAL v17 = mtp_std_maybe_Maybe_1_Some(v14); - decref(v17); - x16 = v13; - x15 = x1; - } break; - case 0LL: { // None - STR* v18; - STRLIT(v18, "expected left parenthesis '('", 29); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v13, MKSTR(v18), x1); - uint64_t v19 = pop_u64(); - x16 = v19; - VAL r20 = pop_resource(); - x15 = r20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v15 = get_data_tag(v14); + decref(v14); + int64_t v16 = 0LL; + bool v17 = (v15 == v16); + uint64_t x18; + VAL x19; + if (v17) { + STR* v20; + STRLIT(v20, "expected left parenthesis '('", 29); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v13, MKSTR(v20), x1); + } else { + x19 = x1; + x18 = v13; } - uint64_t v21 = mw_mirth_token_Token_succ(x16); - VAL v22; - uint64_t v23; - uint64_t v24; - mw_mirth_elab_parseZ_dataZ_header(x15, v21, &v22, &v23, &v24); - int64_t v25 = mw_mirth_token_Token_commaZAsk(v23); - VAL x26; - uint64_t x27; + uint64_t v23 = mw_mirth_token_Token_succ(x18); + VAL v24; + uint64_t v25; + uint64_t v26; + mw_mirth_elab_parseZ_dataZ_header(x19, v23, &v24, &v25, &v26); + int64_t v27 = mw_mirth_token_Token_commaZAsk(v25); uint64_t x28; - if (((bool)v25)) { - uint64_t v29 = mw_mirth_token_Token_succ(v23); + if (((bool)v27)) { + uint64_t v29 = mw_mirth_token_Token_succ(v25); x28 = v29; - x27 = v24; - x26 = v22; } else { - x28 = v23; - x27 = v24; - x26 = v22; + x28 = v25; } VAL v30; uint64_t v31; VAL v32; - mw_mirth_elab_parseZ_dataZ_tags(x26, x28, &v30, &v31, &v32); + mw_mirth_elab_parseZ_dataZ_tags(v24, x28, &v30, &v31, &v32); VAL v33 = mw_mirth_token_Token_rparenZAsk(v31); - uint64_t x34; - VAL x35; - VAL x36; + int64_t v34 = get_data_tag(v33); + decref(v33); + int64_t v35 = 0LL; + bool v36 = (v34 == v35); uint64_t x37; - switch (get_data_tag(v33)) { - case 1LL: { // Some - VAL v38 = mtp_std_maybe_Maybe_1_Some(v33); - decref(v38); - x37 = v31; - x36 = v32; - x35 = v30; - x34 = x27; - } break; - case 0LL: { // None - STR* v39; - STRLIT(v39, "expected right parenthesis ')'", 30); - lpush(&lbl_header, MKU64(x27)); - lpush(&lbl_tags, v32); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v31, MKSTR(v39), v30); - uint64_t v40 = pop_u64(); - x37 = v40; - VAL v41 = lpop(&lbl_tags); - x36 = v41; - VAL r42 = pop_resource(); - x35 = r42; - uint64_t v43 = VU64(lpop(&lbl_header)); - x34 = v43; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + VAL x38; + if (v36) { + STR* v39; + STRLIT(v39, "expected right parenthesis ')'", 30); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v31, MKSTR(v39), v30); + } else { + x38 = v30; + x37 = v31; } - uint64_t v44 = mw_mirth_token_Token_succ(x37); - x12 = v44; - x11 = x36; - x10 = x35; - x9 = x34; + uint64_t v42 = mw_mirth_token_Token_succ(x37); + x12 = v42; + x11 = v32; + x10 = x38; + x9 = v26; } else { - uint64_t v45 = mw_mirth_token_Token_succ(x2); - VAL v46; - uint64_t v47; - uint64_t v48; - mw_mirth_elab_parseZ_dataZ_header(x1, v45, &v46, &v47, &v48); - VAL v49 = mw_mirth_token_Token_lcurlyZAsk(v47); - VAL x50; + uint64_t v43 = mw_mirth_token_Token_succ(x2); + VAL v44; + uint64_t v45; + uint64_t v46; + mw_mirth_elab_parseZ_dataZ_header(x1, v43, &v44, &v45, &v46); + VAL v47 = mw_mirth_token_Token_lcurlyZAsk(v45); + int64_t v48 = get_data_tag(v47); + decref(v47); + int64_t v49 = 0LL; + bool v50 = (v48 == v49); uint64_t x51; - uint64_t x52; - switch (get_data_tag(v49)) { - case 1LL: { // Some - VAL v53 = mtp_std_maybe_Maybe_1_Some(v49); - decref(v53); - x52 = v47; - x51 = v48; - x50 = v46; - } break; - case 0LL: { // None - STR* v54; - STRLIT(v54, "expected left curly brace '{'", 29); - lpush(&lbl_header, MKU64(v48)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v47, MKSTR(v54), v46); - uint64_t v55 = pop_u64(); - x52 = v55; - uint64_t v56 = VU64(lpop(&lbl_header)); - x51 = v56; - VAL r57 = pop_resource(); - x50 = r57; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + VAL x52; + if (v50) { + STR* v53; + STRLIT(v53, "expected left curly brace '{'", 29); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v45, MKSTR(v53), v44); + } else { + x52 = v44; + x51 = v45; } - uint64_t v58 = mw_mirth_token_Token_succ(x52); + uint64_t v56 = mw_mirth_token_Token_succ(x51); + VAL v57; + uint64_t v58; VAL v59; - uint64_t v60; - VAL v61; - mw_mirth_elab_parseZ_dataZ_tags(x50, v58, &v59, &v60, &v61); - VAL v62 = mw_mirth_token_Token_rcurlyZAsk(v60); - uint64_t x63; - VAL x64; + mw_mirth_elab_parseZ_dataZ_tags(x52, v56, &v57, &v58, &v59); + VAL v60 = mw_mirth_token_Token_rcurlyZAsk(v58); + int64_t v61 = get_data_tag(v60); + decref(v60); + int64_t v62 = 0LL; + bool v63 = (v61 == v62); + uint64_t x64; VAL x65; - uint64_t x66; - switch (get_data_tag(v62)) { - case 1LL: { // Some - VAL v67 = mtp_std_maybe_Maybe_1_Some(v62); - decref(v67); - x66 = v60; - x65 = v61; - x64 = v59; - x63 = x51; - } break; - case 0LL: { // None - STR* v68; - STRLIT(v68, "expected right curly brace '}'", 30); - lpush(&lbl_header, MKU64(x51)); - lpush(&lbl_tags, v61); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v60, MKSTR(v68), v59); - uint64_t v69 = pop_u64(); - x66 = v69; - VAL v70 = lpop(&lbl_tags); - x65 = v70; - VAL r71 = pop_resource(); - x64 = r71; - uint64_t v72 = VU64(lpop(&lbl_header)); - x63 = v72; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + if (v63) { + STR* v66; + STRLIT(v66, "expected right curly brace '}'", 30); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v58, MKSTR(v66), v57); + } else { + x65 = v57; + x64 = v58; } - uint64_t v73 = mw_mirth_token_Token_succ(x66); - x12 = v73; - x11 = x65; - x10 = x64; - x9 = x63; + uint64_t v69 = mw_mirth_token_Token_succ(x64); + x12 = v69; + x11 = v59; + x10 = x65; + x9 = v46; } - VAL v74 = mtw_mirth_elab_SyntaxData_SyntaxData(x9, x11); - *x5 = v74; + VAL v70 = mtw_mirth_elab_SyntaxData_SyntaxData(x9, x11); + *x5 = v70; *x4 = x12; *x3 = x10; } static void mw_mirth_elab_parseZ_dataZ_header (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, uint64_t *x5) { uint64_t v6 = mw_mirth_token_Token_next(x2); VAL v7 = mw_mirth_token_Token_lastZ_nameZAsk(x2); - VAL x8; - uint64_t x9; + int64_t v8 = mw_std_maybe_Maybe_1_has_1_sp8(v7); + VAL x9; uint64_t x10; - int64_t x11; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v7); - int64_t v13 = mw_mirth_name_Name_couldZ_beZ_constructor(VU64(v12)); - x11 = v13; - x10 = x2; - x9 = v6; - x8 = x1; - } break; - case 0LL: { // None - int64_t v14 = 0LL /* False */; - x11 = v14; - x10 = x2; - x9 = v6; - x8 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x15; - uint64_t x16; - uint64_t x17; - if (((bool)x11)) { - x17 = x10; - x16 = x9; - x15 = x8; + if (((bool)v8)) { + x10 = x2; + x9 = x1; } else { - STR* v18; - STRLIT(v18, "Expected type name.", 19); - push_u64(x9); - lpush(&lbl_head, MKU64(x10)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x10, MKSTR(v18), x8); - uint64_t v19 = VU64(lpop(&lbl_head)); - x17 = v19; - uint64_t v20 = pop_u64(); - x16 = v20; - VAL r21 = pop_resource(); - x15 = r21; + STR* v11; + STRLIT(v11, "Expected type name.", 19); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v11), x1); } - *x5 = x17; - *x4 = x16; - *x3 = x15; + *x5 = x10; + *x4 = v6; + *x3 = x9; } static void mw_mirth_elab_parseZ_dataZ_tags (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, VAL *x5) { VAL v6 = MKI64(0LL /* Nil */); VAL v7 = mw_std_list_List_1_reverse(v6); int64_t v8 = mw_mirth_token_Token_argZ_endZAsk(x2); bool v9 = !((bool)v8); - VAL v10 = (x1); + VAL v10 = x1; uint64_t v11 = x2; - VAL v12 = (v7); + VAL v12 = v7; bool v13 = v9; while (v13) { - VAL v14 = (v10); + VAL v14 = v10; uint64_t v15 = v11; - VAL v16 = (v12); + VAL v16 = v12; VAL v17; uint64_t v18; VAL v19; @@ -54589,281 +40664,124 @@ static void mw_mirth_elab_parseZ_dataZ_tags (VAL x1, uint64_t x2, VAL *x3, uint6 static void mw_mirth_elab_parseZ_dataZ_tag (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, VAL *x5) { VAL v6 = mw_mirth_token_Token_intZAsk(x2); incref(v6); - VAL x7; - uint64_t x8; - uint64_t x9; - VAL x10; - switch (get_data_tag(v6)) { + int64_t v7 = get_data_tag(v6); + decref(v6); + int64_t v8 = 1LL; + bool v9 = (v7 == v8); + uint64_t x10; + if (v9) { + uint64_t v11 = mw_mirth_token_Token_succ(x2); + x10 = v11; + } else { + x10 = x2; + } + VAL v12 = mw_mirth_token_Token_nameZAsk(x10); + VAL v13 = mw_std_maybe_Maybe_1_filter_1_sp12(v12); + uint64_t x14; + VAL x15; + VAL x16; + switch (get_data_tag(v13)) { case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v6); - decref(v11); - uint64_t v12 = mw_mirth_token_Token_succ(x2); - x10 = v6; - x9 = v12; - x8 = x2; - x7 = x1; + VAL v17 = mtp_std_maybe_Maybe_1_Some(v13); + x16 = v17; + x15 = x1; + x14 = x10; } break; case 0LL: { // None - x10 = v6; - x9 = x2; - x8 = x2; - x7 = x1; + STR* v18; + STRLIT(v18, "Expected constructor name.", 26); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x10, MKSTR(v18), x1); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v13 = mw_mirth_token_Token_nameZAsk(x9); - VAL x14; - uint64_t x15; - VAL x16; - uint64_t x17; - VAL x18; - switch (get_data_tag(v13)) { - case 1LL: { // Some - VAL v19 = mtp_std_maybe_Maybe_1_Some(v13); - incref(v19); - int64_t v20 = mw_mirth_name_Name_couldZ_beZ_constructor(VU64(v19)); - VAL x21; - uint64_t x22; - VAL x23; - uint64_t x24; - VAL x25; - if (((bool)v20)) { - VAL v26 = mtw_std_maybe_Maybe_1_Some(v19); - x25 = v26; - x24 = x9; - x23 = x10; - x22 = x8; - x21 = x7; + uint64_t v22 = mw_mirth_token_Token_succ(x14); + int64_t v23 = mw_mirth_token_Token_arrowZAsk(v22); + VAL x24; + uint64_t x25; + VAL x26; + uint64_t x27; + VAL x28; + uint64_t x29; + if (((bool)v23)) { + uint64_t v30 = mw_mirth_token_Token_succ(v22); + VAL v31 = mtw_std_maybe_Maybe_1_Some(MKU64(v30)); + uint64_t v32 = mw_mirth_token_Token_sigZ_nextZ_stackZ_end(v30); + int64_t v33 = mw_mirth_token_Token_argZ_endZAsk(v32); + uint64_t x34; + VAL x35; + if (((bool)v33)) { + x35 = x15; + x34 = v32; + } else { + STR* v36; + STRLIT(v36, "Expected comma.", 15); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v32, MKSTR(v36), x15); + } + x29 = x34; + x28 = v31; + x27 = VU64(x16); + x26 = v6; + x25 = x2; + x24 = x35; + } else { + VAL v39 = mw_mirth_token_Token_lsquareZAsk(v22); + int64_t v40 = get_data_tag(v39); + decref(v39); + int64_t v41 = 1LL; + bool v42 = (v40 == v41); + VAL x43; + VAL x44; + uint64_t x45; + if (v42) { + uint64_t v46 = mw_mirth_token_Token_succ(v22); + VAL v47 = mtw_std_maybe_Maybe_1_Some(MKU64(v46)); + uint64_t v48 = mw_mirth_token_Token_sigZ_nextZ_stackZ_end(v46); + VAL v49 = mw_mirth_token_Token_rsquareZAsk(v48); + int64_t v50 = get_data_tag(v49); + decref(v49); + int64_t v51 = 0LL; + bool v52 = (v50 == v51); + uint64_t x53; + VAL x54; + if (v52) { + STR* v55; + STRLIT(v55, "Expected right square bracket ']'", 33); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v48, MKSTR(v55), x15); } else { - decref(v19); - VAL v27 = MKI64(0LL /* None */); - x25 = v27; - x24 = x9; - x23 = x10; - x22 = x8; - x21 = x7; + x54 = x15; + x53 = v48; } - x18 = x25; - x17 = x24; - x16 = x23; - x15 = x22; - x14 = x21; - } break; - case 0LL: { // None - VAL v28 = MKI64(0LL /* None */); - x18 = v28; - x17 = x9; - x16 = x10; - x15 = x8; - x14 = x7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x29; - uint64_t x30; - VAL x31; - uint64_t x32; - uint64_t x33; - switch (get_data_tag(x18)) { - case 1LL: { // Some - VAL v34 = mtp_std_maybe_Maybe_1_Some(x18); - x33 = VU64(v34); - x32 = x17; - x31 = x16; - x30 = x15; - x29 = x14; - } break; - case 0LL: { // None - STR* v35; - STRLIT(v35, "Expected constructor name.", 26); - lpush(&lbl_head, MKU64(x15)); - lpush(&lbl_valueZAsk, x16); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x17, MKSTR(v35), x14); - uint64_t v36 = pop_u64(); - x33 = v36; - uint64_t v37 = pop_u64(); - x32 = v37; - VAL v38 = lpop(&lbl_valueZAsk); - x31 = v38; - uint64_t v39 = VU64(lpop(&lbl_head)); - x30 = v39; - VAL r40 = pop_resource(); - x29 = r40; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v41 = mw_mirth_token_Token_succ(x32); - int64_t v42 = mw_mirth_token_Token_arrowZAsk(v41); - VAL x43; - uint64_t x44; - VAL x45; - uint64_t x46; - VAL x47; - uint64_t x48; - if (((bool)v42)) { - uint64_t v49 = mw_mirth_token_Token_succ(v41); - VAL v50 = mtw_std_maybe_Maybe_1_Some(MKU64(v49)); - uint64_t v51 = mw_mirth_token_Token_sigZ_nextZ_stackZ_end(v49); - int64_t v52 = mw_mirth_token_Token_argZ_endZAsk(v51); - VAL x53; - uint64_t x54; - VAL x55; - uint64_t x56; - VAL x57; - uint64_t x58; - if (((bool)v52)) { - x58 = v51; - x57 = v50; - x56 = x33; - x55 = x31; - x54 = x30; - x53 = x29; + uint64_t v58 = mw_mirth_token_Token_succ(x53); + x45 = v58; + x44 = v47; + x43 = x54; } else { - STR* v59; - STRLIT(v59, "Expected comma.", 15); - lpush(&lbl_head, MKU64(x30)); - lpush(&lbl_valueZAsk, x31); - lpush(&lbl_name, MKU64(x33)); - lpush(&lbl_sigZAsk, v50); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v51, MKSTR(v59), x29); - uint64_t v60 = pop_u64(); - x58 = v60; - VAL v61 = lpop(&lbl_sigZAsk); - x57 = v61; - uint64_t v62 = VU64(lpop(&lbl_name)); - x56 = v62; - VAL v63 = lpop(&lbl_valueZAsk); - x55 = v63; - uint64_t v64 = VU64(lpop(&lbl_head)); - x54 = v64; - VAL r65 = pop_resource(); - x53 = r65; - } - x48 = x58; - x47 = x57; - x46 = x56; - x45 = x55; - x44 = x54; - x43 = x53; + VAL v59 = MKI64(0LL /* None */); + x45 = v22; + x44 = v59; + x43 = x15; + } + x29 = x45; + x28 = x44; + x27 = VU64(x16); + x26 = v6; + x25 = x2; + x24 = x43; + } + int64_t v60 = mw_mirth_token_Token_commaZAsk(x29); + uint64_t x61; + if (((bool)v60)) { + uint64_t v62 = mw_mirth_token_Token_succ(x29); + x61 = v62; } else { - VAL v66 = mw_mirth_token_Token_lsquareZAsk(v41); - VAL x67; - uint64_t x68; - VAL x69; - uint64_t x70; - VAL x71; - uint64_t x72; - switch (get_data_tag(v66)) { - case 1LL: { // Some - VAL v73 = mtp_std_maybe_Maybe_1_Some(v66); - decref(v73); - uint64_t v74 = mw_mirth_token_Token_succ(v41); - VAL v75 = mtw_std_maybe_Maybe_1_Some(MKU64(v74)); - uint64_t v76 = mw_mirth_token_Token_sigZ_nextZ_stackZ_end(v74); - VAL v77 = mw_mirth_token_Token_rsquareZAsk(v76); - VAL x78; - uint64_t x79; - VAL x80; - uint64_t x81; - VAL x82; - uint64_t x83; - switch (get_data_tag(v77)) { - case 1LL: { // Some - VAL v84 = mtp_std_maybe_Maybe_1_Some(v77); - decref(v84); - x83 = v76; - x82 = v75; - x81 = x33; - x80 = x31; - x79 = x30; - x78 = x29; - } break; - case 0LL: { // None - STR* v85; - STRLIT(v85, "Expected right square bracket ']'", 33); - lpush(&lbl_head, MKU64(x30)); - lpush(&lbl_valueZAsk, x31); - lpush(&lbl_name, MKU64(x33)); - lpush(&lbl_sigZAsk, v75); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v76, MKSTR(v85), x29); - uint64_t v86 = pop_u64(); - x83 = v86; - VAL v87 = lpop(&lbl_sigZAsk); - x82 = v87; - uint64_t v88 = VU64(lpop(&lbl_name)); - x81 = v88; - VAL v89 = lpop(&lbl_valueZAsk); - x80 = v89; - uint64_t v90 = VU64(lpop(&lbl_head)); - x79 = v90; - VAL r91 = pop_resource(); - x78 = r91; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v92 = mw_mirth_token_Token_succ(x83); - x72 = v92; - x71 = x82; - x70 = x81; - x69 = x80; - x68 = x79; - x67 = x78; - } break; - case 0LL: { // None - VAL v93 = MKI64(0LL /* None */); - x72 = v41; - x71 = v93; - x70 = x33; - x69 = x31; - x68 = x30; - x67 = x29; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x48 = x72; - x47 = x71; - x46 = x70; - x45 = x69; - x44 = x68; - x43 = x67; + x61 = x29; } - int64_t v94 = mw_mirth_token_Token_commaZAsk(x48); - VAL x95; - uint64_t x96; - VAL x97; - uint64_t x98; - VAL x99; - uint64_t x100; - if (((bool)v94)) { - uint64_t v101 = mw_mirth_token_Token_succ(x48); - x100 = v101; - x99 = x47; - x98 = x46; - x97 = x45; - x96 = x44; - x95 = x43; - } else { - x100 = x48; - x99 = x47; - x98 = x46; - x97 = x45; - x96 = x44; - x95 = x43; - } - VAL v102 = mtw_mirth_elab_SyntaxDataTag_SyntaxDataTag(x96, x97, x98, x99); - *x5 = v102; - *x4 = x100; - *x3 = x95; + VAL v63 = mtw_mirth_elab_SyntaxDataTag_SyntaxDataTag(x25, x26, x27, x28); + *x5 = v63; + *x4 = x61; + *x3 = x24; } static void mw_mirth_elab_parseZ_struct (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, VAL *x5) { int64_t v6 = mw_mirth_token_Token_numZ_args(x2); @@ -54876,280 +40794,152 @@ static void mw_mirth_elab_parseZ_struct (VAL x1, uint64_t x2, VAL *x3, uint64_t if (v8) { uint64_t v13 = mw_mirth_token_Token_succ(x2); VAL v14 = mw_mirth_token_Token_lparenZAsk(v13); - VAL x15; - uint64_t x16; - switch (get_data_tag(v14)) { - case 1LL: { // Some - VAL v17 = mtp_std_maybe_Maybe_1_Some(v14); - decref(v17); - STR* v18; - STRLIT(v18, "Expected left parenthesis '('", 29); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v13, MKSTR(v18), x1); - uint64_t v19 = pop_u64(); - x16 = v19; - VAL r20 = pop_resource(); - x15 = r20; - } break; - case 0LL: { // None - x16 = v13; - x15 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v15 = get_data_tag(v14); + decref(v14); + int64_t v16 = 1LL; + bool v17 = (v15 == v16); + uint64_t x18; + VAL x19; + if (v17) { + STR* v20; + STRLIT(v20, "Expected left parenthesis '('", 29); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v13, MKSTR(v20), x1); + } else { + x19 = x1; + x18 = v13; } - uint64_t v21 = mw_mirth_token_Token_succ(x16); - VAL v22; - uint64_t v23; - uint64_t v24; - mw_mirth_elab_parseZ_dataZ_header(x15, v21, &v22, &v23, &v24); - int64_t v25 = mw_mirth_token_Token_commaZAsk(v23); - VAL x26; - uint64_t x27; + uint64_t v23 = mw_mirth_token_Token_succ(x18); + VAL v24; + uint64_t v25; + uint64_t v26; + mw_mirth_elab_parseZ_dataZ_header(x19, v23, &v24, &v25, &v26); + int64_t v27 = mw_mirth_token_Token_commaZAsk(v25); uint64_t x28; - if (((bool)v25)) { - uint64_t v29 = mw_mirth_token_Token_succ(v23); + if (((bool)v27)) { + uint64_t v29 = mw_mirth_token_Token_succ(v25); x28 = v29; - x27 = v24; - x26 = v22; } else { - x28 = v23; - x27 = v24; - x26 = v22; + x28 = v25; } VAL v30; uint64_t v31; uint64_t v32; VAL v33; - mw_mirth_elab_parseZ_structZ_tag(x26, x28, x27, &v30, &v31, &v32, &v33); + mw_mirth_elab_parseZ_structZ_tag(v24, x28, v26, &v30, &v31, &v32, &v33); VAL v34 = MKI64(0LL /* Nil */); VAL v35 = mtw_std_list_List_1_Cons(v33, v34); VAL v36 = mw_mirth_token_Token_rparenZAsk(v31); - VAL x37; - uint64_t x38; - VAL x39; + int64_t v37 = get_data_tag(v36); + decref(v36); + int64_t v38 = 1LL; + bool v39 = (v37 == v38); uint64_t x40; - switch (get_data_tag(v36)) { - case 1LL: { // Some - VAL v41 = mtp_std_maybe_Maybe_1_Some(v36); - decref(v41); - STR* v42; - STRLIT(v42, "Expected right parenthesis ')'", 30); - lpush(&lbl_header, MKU64(v32)); - lpush(&lbl_tags, v35); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v31, MKSTR(v42), v30); - uint64_t v43 = pop_u64(); - x40 = v43; - VAL v44 = lpop(&lbl_tags); - x39 = v44; - uint64_t v45 = VU64(lpop(&lbl_header)); - x38 = v45; - VAL r46 = pop_resource(); - x37 = r46; - } break; - case 0LL: { // None - x40 = v31; - x39 = v35; - x38 = v32; - x37 = v30; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v47 = mw_mirth_token_Token_succ(x40); - x12 = v47; - x11 = x39; - x10 = x38; - x9 = x37; + VAL x41; + if (v39) { + STR* v42; + STRLIT(v42, "Expected right parenthesis ')'", 30); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v31, MKSTR(v42), v30); + } else { + x41 = v30; + x40 = v31; + } + uint64_t v45 = mw_mirth_token_Token_succ(x40); + x12 = v45; + x11 = v35; + x10 = v32; + x9 = x41; } else { - uint64_t v48 = mw_mirth_token_Token_succ(x2); - VAL v49; - uint64_t v50; - uint64_t v51; - mw_mirth_elab_parseZ_dataZ_header(x1, v48, &v49, &v50, &v51); - VAL v52 = mw_mirth_token_Token_lcurlyZAsk(v50); - VAL x53; + uint64_t v46 = mw_mirth_token_Token_succ(x2); + VAL v47; + uint64_t v48; + uint64_t v49; + mw_mirth_elab_parseZ_dataZ_header(x1, v46, &v47, &v48, &v49); + VAL v50 = mw_mirth_token_Token_lcurlyZAsk(v48); + int64_t v51 = get_data_tag(v50); + decref(v50); + int64_t v52 = 0LL; + bool v53 = (v51 == v52); uint64_t x54; - uint64_t x55; - switch (get_data_tag(v52)) { - case 1LL: { // Some - VAL v56 = mtp_std_maybe_Maybe_1_Some(v52); - decref(v56); - x55 = v50; - x54 = v51; - x53 = v49; - } break; - case 0LL: { // None - STR* v57; - STRLIT(v57, "expected left curly brace '{'", 29); - lpush(&lbl_header, MKU64(v51)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v50, MKSTR(v57), v49); - uint64_t v58 = pop_u64(); - x55 = v58; - uint64_t v59 = VU64(lpop(&lbl_header)); - x54 = v59; - VAL r60 = pop_resource(); - x53 = r60; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + VAL x55; + if (v53) { + STR* v56; + STRLIT(v56, "expected left curly brace '{'", 29); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v48, MKSTR(v56), v47); + } else { + x55 = v47; + x54 = v48; } - uint64_t v61 = mw_mirth_token_Token_succ(x55); - VAL v62; - uint64_t v63; - uint64_t v64; - VAL v65; - mw_mirth_elab_parseZ_structZ_tag(x53, v61, x54, &v62, &v63, &v64, &v65); - VAL v66 = MKI64(0LL /* Nil */); - VAL v67 = mtw_std_list_List_1_Cons(v65, v66); - VAL v68 = mw_mirth_token_Token_rcurlyZAsk(v63); - VAL x69; + uint64_t v59 = mw_mirth_token_Token_succ(x54); + VAL v60; + uint64_t v61; + uint64_t v62; + VAL v63; + mw_mirth_elab_parseZ_structZ_tag(x55, v59, v49, &v60, &v61, &v62, &v63); + VAL v64 = MKI64(0LL /* Nil */); + VAL v65 = mtw_std_list_List_1_Cons(v63, v64); + VAL v66 = mw_mirth_token_Token_rcurlyZAsk(v61); + int64_t v67 = get_data_tag(v66); + decref(v66); + int64_t v68 = 0LL; + bool v69 = (v67 == v68); uint64_t x70; VAL x71; - uint64_t x72; - switch (get_data_tag(v68)) { - case 1LL: { // Some - VAL v73 = mtp_std_maybe_Maybe_1_Some(v68); - decref(v73); - x72 = v63; - x71 = v67; - x70 = v64; - x69 = v62; - } break; - case 0LL: { // None - STR* v74; - STRLIT(v74, "expected right curly brace '}'", 30); - lpush(&lbl_header, MKU64(v64)); - lpush(&lbl_tags, v67); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v63, MKSTR(v74), v62); - uint64_t v75 = pop_u64(); - x72 = v75; - VAL v76 = lpop(&lbl_tags); - x71 = v76; - uint64_t v77 = VU64(lpop(&lbl_header)); - x70 = v77; - VAL r78 = pop_resource(); - x69 = r78; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + if (v69) { + STR* v72; + STRLIT(v72, "expected right curly brace '}'", 30); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v61, MKSTR(v72), v60); + } else { + x71 = v60; + x70 = v61; } - uint64_t v79 = mw_mirth_token_Token_succ(x72); - x12 = v79; - x11 = x71; - x10 = x70; - x9 = x69; + uint64_t v75 = mw_mirth_token_Token_succ(x70); + x12 = v75; + x11 = v65; + x10 = v62; + x9 = x71; } - VAL v80 = mtw_mirth_elab_SyntaxData_SyntaxData(x10, x11); - *x5 = v80; + VAL v76 = mtw_mirth_elab_SyntaxData_SyntaxData(x10, x11); + *x5 = v76; *x4 = x12; *x3 = x9; } static void mw_mirth_elab_parseZ_structZ_tag (VAL x1, uint64_t x2, uint64_t x3, VAL *x4, uint64_t *x5, uint64_t *x6, VAL *x7) { VAL v8 = mw_mirth_token_Token_lastZ_nameZAsk(x3); - VAL x9; - uint64_t x10; + VAL v9 = mw_std_maybe_Maybe_1_filter_1_sp12(v8); + VAL x10; uint64_t x11; - uint64_t x12; - VAL x13; - switch (get_data_tag(v8)) { + VAL x12; + switch (get_data_tag(v9)) { case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v8); - incref(v14); - int64_t v15 = mw_mirth_name_Name_couldZ_beZ_constructor(VU64(v14)); - VAL x16; - uint64_t x17; - uint64_t x18; - uint64_t x19; - VAL x20; - if (((bool)v15)) { - VAL v21 = mtw_std_maybe_Maybe_1_Some(v14); - x20 = v21; - x19 = x3; - x18 = x3; - x17 = x2; - x16 = x1; - } else { - decref(v14); - VAL v22 = MKI64(0LL /* None */); - x20 = v22; - x19 = x3; - x18 = x3; - x17 = x2; - x16 = x1; - } - x13 = x20; - x12 = x19; - x11 = x18; - x10 = x17; - x9 = x16; - } break; - case 0LL: { // None - VAL v23 = MKI64(0LL /* None */); - x13 = v23; - x12 = x3; + VAL v13 = mtp_std_maybe_Maybe_1_Some(v9); + x12 = v13; x11 = x3; - x10 = x2; - x9 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x24; - uint64_t x25; - uint64_t x26; - uint64_t x27; - uint64_t x28; - switch (get_data_tag(x13)) { - case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(x13); - x28 = VU64(v29); - x27 = x12; - x26 = x11; - x25 = x10; - x24 = x9; + x10 = x1; } break; case 0LL: { // None - STR* v30; - STRLIT(v30, "Expected constructor name.", 26); - push_u64(x10); - lpush(&lbl_head, MKU64(x12)); - lpush(&lbl_header, MKU64(x11)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x11, MKSTR(v30), x9); - uint64_t v31 = pop_u64(); - x28 = v31; - uint64_t v32 = VU64(lpop(&lbl_head)); - x27 = v32; - uint64_t v33 = VU64(lpop(&lbl_header)); - x26 = v33; - uint64_t v34 = pop_u64(); - x25 = v34; - VAL r35 = pop_resource(); - x24 = r35; + STR* v14; + STRLIT(v14, "Expected constructor name.", 26); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x3, MKSTR(v14), x1); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v36 = MKI64(0LL /* None */); - VAL v37 = mtw_std_maybe_Maybe_1_Some(MKU64(x25)); - uint64_t v38 = mw_mirth_token_Token_sigZ_nextZ_stackZ_end(x25); - VAL v39 = mtw_mirth_elab_SyntaxDataTag_SyntaxDataTag(x27, v36, x28, v37); - *x7 = v39; - *x6 = x26; - *x5 = v38; - *x4 = x24; + VAL v17 = MKI64(0LL /* None */); + VAL v18 = mtw_std_maybe_Maybe_1_Some(MKU64(x2)); + uint64_t v19 = mw_mirth_token_Token_sigZ_nextZ_stackZ_end(x2); + VAL v20 = mtw_mirth_elab_SyntaxDataTag_SyntaxDataTag(x3, v17, VU64(x12), v18); + *x7 = v20; + *x6 = x11; + *x5 = v19; + *x4 = x10; } static void mw_mirth_elab_elabZ_dataZBang (VAL x1, uint64_t x2, uint64_t *x3, VAL *x4) { VAL v5; uint64_t v6; VAL v7; mw_mirth_elab_parseZ_data(x1, x2, &v5, &v6, &v7); - VAL v8 = (mw_mirth_elab_elabZ_dataZ_auxZBang(v7, v5)); + VAL v8 = mw_mirth_elab_elabZ_dataZ_auxZBang(v7, v5); *x4 = v8; *x3 = v6; } @@ -55158,7 +40948,7 @@ static void mw_mirth_elab_elabZ_structZBang (VAL x1, uint64_t x2, uint64_t *x3, uint64_t v6; VAL v7; mw_mirth_elab_parseZ_struct(x1, x2, &v5, &v6, &v7); - VAL v8 = (mw_mirth_elab_elabZ_dataZ_auxZBang(v7, v5)); + VAL v8 = mw_mirth_elab_elabZ_dataZ_auxZBang(v7, v5); *x4 = v8; *x3 = v6; } @@ -55173,370 +40963,192 @@ static VAL mw_mirth_elab_elabZ_dataZ_auxZBang (VAL x1, VAL x2) { uint64_t v8; VAL v9; mw_mirth_elab_elabZ_dataZ_headerZBang(v5, v3, x2, &v8, &v9); - VAL v10; - VAL v11; - mw_std_list_List_1_uncons(v4, &v10, &v11); - uint64_t x12; - VAL x13; - VAL x14; - int64_t x15; - switch (get_data_tag(v10)) { - case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(v10); - uint64_t v17; - VAL v18; - mw_mirth_elab_elabZ_dataZ_tagZBang(v8, v16, v9, &v17, &v18); - int64_t v19 = 1LL /* True */; - x15 = v19; - x14 = v11; - x13 = v18; - x12 = v17; - } break; - case 0LL: { // None - int64_t v20 = 0LL /* False */; - x15 = v20; - x14 = v11; - x13 = v9; - x12 = v8; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v21 = x12; - VAL v22 = (x13); - VAL v23 = x14; - int64_t v24 = x15; - while (((bool)v24)) { - uint64_t v25 = v21; - VAL v26 = (v22); - VAL v27 = v23; - VAL v28; - VAL v29; - mw_std_list_List_1_uncons(v27, &v28, &v29); - uint64_t x30; - VAL x31; - VAL x32; - int64_t x33; - switch (get_data_tag(v28)) { - case 1LL: { // Some - VAL v34 = mtp_std_maybe_Maybe_1_Some(v28); - uint64_t v35; - VAL v36; - mw_mirth_elab_elabZ_dataZ_tagZBang(v25, v34, v26, &v35, &v36); - int64_t v37 = 1LL /* True */; - x33 = v37; - x32 = v29; - x31 = v36; - x30 = v35; + int64_t v10 = 1LL /* True */; + uint64_t v11 = v8; + VAL v12 = v9; + VAL v13 = v4; + int64_t v14 = v10; + int64_t v15 = v10; + while (((bool)v15)) { + uint64_t v16 = v11; + VAL v17 = v12; + VAL v18 = v13; + int64_t v19 = v14; + uint64_t x20; + VAL x21; + VAL x22; + int64_t x23; + switch (get_data_tag(v18)) { + case 1LL: { // Cons + VAL v24; + VAL v25; + mtp_std_list_List_1_Cons(v18, &v24, &v25); + uint64_t v26; + VAL v27; + mw_mirth_elab_elabZ_dataZ_tagZBang(v16, v24, v17, &v26, &v27); + int64_t v28 = 1LL /* True */; + x23 = v28; + x22 = v25; + x21 = v27; + x20 = v26; } break; - case 0LL: { // None - int64_t v38 = 0LL /* False */; - x33 = v38; - x32 = v29; - x31 = v26; - x30 = v25; + case 0LL: { // Nil + VAL v29 = MKI64(0LL /* Nil */); + int64_t v30 = 0LL /* False */; + x23 = v30; + x22 = v29; + x21 = v17; + x20 = v16; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v24 = x33; - v23 = x32; - v22 = x31; - v21 = x30; + v15 = x23; + v14 = x23; + v13 = x22; + v12 = x21; + v11 = x20; } - decref(v23); - VAL v39 = (mw_mirth_elab_elabZ_dataZ_doneZBang(v22, v21)); - return v39; + decref(v13); + VAL v31 = mw_mirth_elab_elabZ_dataZ_doneZBang(v12, v11); + return v31; } static void mw_mirth_elab_elabZ_dataZ_headerZBang (uint64_t x1, uint64_t x2, VAL x3, uint64_t *x4, VAL *x5) { VAL v6 = mw_mirth_token_Token_lastZ_nameZAsk(x2); - VAL x7; - uint64_t x8; + int64_t v7 = mw_std_maybe_Maybe_1_has_1_sp8(v6); + VAL x8; uint64_t x9; - int64_t x10; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v6); - int64_t v12 = mw_mirth_name_Name_couldZ_beZ_constructor(VU64(v11)); - x10 = v12; - x9 = x2; - x8 = x1; - x7 = x3; - } break; - case 0LL: { // None - int64_t v13 = 0LL /* False */; - x10 = v13; - x9 = x2; - x8 = x1; - x7 = x3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x14; - uint64_t x15; - uint64_t x16; - if (((bool)x10)) { - x16 = x9; - x15 = x8; - x14 = x7; + if (((bool)v7)) { + x9 = x2; + x8 = x3; } else { - STR* v17; - STRLIT(v17, "Expected type name.", 19); - lpush(&lbl_data, MKU64(x8)); - lpush(&lbl_head, MKU64(x9)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x9, MKSTR(v17), x7); - uint64_t v18 = VU64(lpop(&lbl_head)); - x16 = v18; - uint64_t v19 = VU64(lpop(&lbl_data)); - x15 = v19; - VAL r20 = pop_resource(); - x14 = r20; + STR* v10; + STRLIT(v10, "Expected type name.", 19); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v10), x3); } - VAL v21; - uint64_t v22; - uint64_t v23; - int64_t v24; - VAL v25; - mw_mirth_elab_elabZ_defZ_head(x14, x16, &v21, &v22, &v23, &v24, &v25); - VAL v26 = mtw_std_maybe_Maybe_1_Some(MKU64(v22)); - void* v27 = mfld_mirth_data_Data_ZTildeheadZAsk(x15); - mut_set(v26, v27); - void* v28 = mfld_mirth_data_Data_ZTildearity(x15); - mut_set(MKI64(v24), v28); - void* v29 = mfld_mirth_data_Data_ZTildename(x15); - mut_set(MKU64(v23), v29); - VAL v30 = mtw_mirth_mirth_PropLabel_DataQName(x15); - VAL v31 = mtw_mirth_mirth_Prop_1_Prop(v30, v25); - void* v32 = mfld_mirth_data_Data_ZTildeqname(x15); - mut_set(v31, v32); - VAL v33 = mw_mirth_token_Token_args(v22); - VAL v34 = mtw_mirth_mirth_PropLabel_DataParams(x15); - FNPTR v35 = &mb_mirth_elab_elabZ_dataZ_headerZBang_2; - VAL v36; - VAL v37; - mw_mirth_mirth_PropLabel_prop_1(v33, v34, v21, MKFNPTR(v35), &v36, &v37); - void* v38 = mfld_mirth_data_Data_ZTildeparams(x15); - mut_set(v36, v38); - VAL v39 = mtw_mirth_def_Def_DefData(x15); - VAL v40 = (mw_mirth_def_Def_register(v37, v39)); - *x5 = v40; - *x4 = x15; + VAL v12; + uint64_t v13; + uint64_t v14; + int64_t v15; + VAL v16; + mw_mirth_elab_elabZ_defZ_head(x8, x9, &v12, &v13, &v14, &v15, &v16); + VAL v17 = mtw_std_maybe_Maybe_1_Some(MKU64(v13)); + void* v18 = mfld_mirth_data_Data_ZTildeheadZAsk(x1); + mut_set(v17, v18); + void* v19 = mfld_mirth_data_Data_ZTildearity(x1); + mut_set(MKI64(v15), v19); + void* v20 = mfld_mirth_data_Data_ZTildename(x1); + mut_set(MKU64(v14), v20); + VAL v21 = mtw_mirth_mirth_PropLabel_DataQName(x1); + VAL v22 = mtw_mirth_mirth_Prop_1_Prop(v21, v16); + void* v23 = mfld_mirth_data_Data_ZTildeqname(x1); + mut_set(v22, v23); + VAL v24 = mw_mirth_token_Token_args(v13); + VAL v25 = mtw_mirth_mirth_PropLabel_DataParams(x1); + FNPTR v26 = &mb_mirth_mirth_PropLabel_prop_1_sp14_0; + VAL v27 = mtw_mirth_mirth_PropState_1_PSDelay(v24, MKFNPTR(v26)); + VAL v28 = mtw_mirth_mirth_Prop_1_Prop(v25, v27); + void* v29 = mfld_mirth_data_Data_ZTildeparams(x1); + mut_set(v28, v29); + VAL v30 = mtw_mirth_def_Def_DefData(x1); + VAL v31 = mw_mirth_def_Def_register(v12, v30); + *x5 = v31; + *x4 = x1; } static void mw_mirth_elab_elabZ_dataZ_paramsZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL v5 = mw_mirth_var_Ctx0(); - VAL v6; - VAL v7; - mw_std_list_List_1_uncons(x1, &v6, &v7); - VAL x8; - VAL x9; - VAL x10; - int64_t x11; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v6); - incref(v12); - VAL v13 = mw_mirth_token_Token_sigZ_typeZ_varZAsk(VU64(v12)); - VAL x14; - VAL x15; - uint64_t x16; - uint64_t x17; - switch (get_data_tag(v13)) { - case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(v13); - x17 = VU64(v18); - x16 = VU64(v12); - x15 = v5; - x14 = x2; - } break; - case 0LL: { // None - STR* v19; - STRLIT(v19, "Expected a type variable.", 25); - push_value(v5); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v12), MKSTR(v19), x2); - uint64_t v20 = pop_u64(); - x17 = v20; - uint64_t v21 = pop_u64(); - x16 = v21; - VAL v22 = pop_value(); - x15 = v22; - VAL r23 = pop_resource(); - x14 = r23; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - incref(x15); - VAL v24 = mw_mirth_var_Ctx_lookup(x17, x15); - VAL x25; - VAL x26; - uint64_t x27; - uint64_t x28; - switch (get_data_tag(v24)) { - case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v24); - decref(v29); - STR* v30; - STRLIT(v30, "Duplicate parameter name.", 25); - push_value(x15); - push_u64(x17); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x16, MKSTR(v30), x14); - uint64_t v31 = pop_u64(); - x28 = v31; - uint64_t v32 = pop_u64(); - x27 = v32; - VAL v33 = pop_value(); - x26 = v33; - VAL r34 = pop_resource(); - x25 = r34; - } break; - case 0LL: { // None - x28 = x17; - x27 = x16; - x26 = x15; - x25 = x14; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v35 = mw_mirth_type_TYPEz_TYPE(); - uint64_t v36 = mw_mirth_var_Var_newZBang(v35, x28); - VAL v37 = mw_mirth_var_Ctx_new(x26, v36); - int64_t v38 = 1LL /* True */; - x11 = v38; - x10 = v7; - x9 = v37; - x8 = x25; - } break; - case 0LL: { // None - int64_t v39 = 0LL /* False */; - x11 = v39; - x10 = v7; - x9 = v5; - x8 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v40 = (x8); - VAL v41 = x9; - VAL v42 = x10; - int64_t v43 = x11; - while (((bool)v43)) { - VAL v44 = (v40); - VAL v45 = v41; - VAL v46 = v42; - VAL v47; - VAL v48; - mw_std_list_List_1_uncons(v46, &v47, &v48); - VAL x49; - VAL x50; - VAL x51; - int64_t x52; - switch (get_data_tag(v47)) { - case 1LL: { // Some - VAL v53 = mtp_std_maybe_Maybe_1_Some(v47); - incref(v53); - VAL v54 = mw_mirth_token_Token_sigZ_typeZ_varZAsk(VU64(v53)); - VAL x55; - VAL x56; - uint64_t x57; - uint64_t x58; - switch (get_data_tag(v54)) { + int64_t v6 = 1LL /* True */; + VAL v7 = v5; + VAL v8 = x2; + VAL v9 = x1; + int64_t v10 = v6; + int64_t v11 = v6; + while (((bool)v11)) { + VAL v12 = v7; + VAL v13 = v8; + VAL v14 = v9; + int64_t v15 = v10; + VAL x16; + VAL x17; + VAL x18; + int64_t x19; + switch (get_data_tag(v14)) { + case 1LL: { // Cons + VAL v20; + VAL v21; + mtp_std_list_List_1_Cons(v14, &v20, &v21); + incref(v20); + VAL v22 = mw_mirth_token_Token_sigZ_typeZ_varZAsk(VU64(v20)); + uint64_t x23; + VAL x24; + VAL x25; + switch (get_data_tag(v22)) { case 1LL: { // Some - VAL v59 = mtp_std_maybe_Maybe_1_Some(v54); - x58 = VU64(v59); - x57 = VU64(v53); - x56 = v45; - x55 = v44; + VAL v26 = mtp_std_maybe_Maybe_1_Some(v22); + x25 = v26; + x24 = v13; + x23 = VU64(v20); } break; case 0LL: { // None - STR* v60; - STRLIT(v60, "Expected a type variable.", 25); - push_value(v45); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v53), MKSTR(v60), v44); - uint64_t v61 = pop_u64(); - x58 = v61; - uint64_t v62 = pop_u64(); - x57 = v62; - VAL v63 = pop_value(); - x56 = v63; - VAL r64 = pop_resource(); - x55 = r64; + STR* v27; + STRLIT(v27, "Expected a type variable.", 25); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v20), MKSTR(v27), v13); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - incref(x56); - VAL v65 = mw_mirth_var_Ctx_lookup(x58, x56); - VAL x66; - VAL x67; - uint64_t x68; - uint64_t x69; - switch (get_data_tag(v65)) { - case 1LL: { // Some - VAL v70 = mtp_std_maybe_Maybe_1_Some(v65); - decref(v70); - STR* v71; - STRLIT(v71, "Duplicate parameter name.", 25); - push_value(x56); - push_u64(x58); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x57, MKSTR(v71), x55); - uint64_t v72 = pop_u64(); - x69 = v72; - uint64_t v73 = pop_u64(); - x68 = v73; - VAL v74 = pop_value(); - x67 = v74; - VAL r75 = pop_resource(); - x66 = r75; - } break; - case 0LL: { // None - x69 = x58; - x68 = x57; - x67 = x56; - x66 = x55; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + incref(x25); + incref(v12); + VAL v31 = mw_mirth_var_Ctx_lookup(VU64(x25), v12); + int64_t v32 = get_data_tag(v31); + decref(v31); + int64_t v33 = 1LL; + bool v34 = (v32 == v33); + VAL x35; + uint64_t x36; + VAL x37; + if (v34) { + STR* v38; + STRLIT(v38, "Duplicate parameter name.", 25); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x23, MKSTR(v38), x24); + } else { + x37 = x25; + x36 = x23; + x35 = x24; } - VAL v76 = mw_mirth_type_TYPEz_TYPE(); - uint64_t v77 = mw_mirth_var_Var_newZBang(v76, x69); - VAL v78 = mw_mirth_var_Ctx_new(x67, v77); - int64_t v79 = 1LL /* True */; - x52 = v79; - x51 = v48; - x50 = v78; - x49 = x66; + VAL v41 = mw_mirth_type_TYPEz_TYPE(); + uint64_t v42 = mw_mirth_var_Var_newZBang(v41, VU64(x37)); + VAL v43 = mw_mirth_var_Ctx_new(v12, v42); + int64_t v44 = 1LL /* True */; + x19 = v44; + x18 = v21; + x17 = v43; + x16 = x35; } break; - case 0LL: { // None - int64_t v80 = 0LL /* False */; - x52 = v80; - x51 = v48; - x50 = v45; - x49 = v44; + case 0LL: { // Nil + VAL v45 = MKI64(0LL /* Nil */); + int64_t v46 = 0LL /* False */; + x19 = v46; + x18 = v45; + x17 = v12; + x16 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v43 = x52; - v42 = x51; - v41 = x50; - v40 = x49; + v11 = x19; + v10 = x19; + v9 = x18; + v8 = x16; + v7 = x17; } - decref(v42); - VAL v81 = mw_mirth_var_Ctx_ZToList(v41); - *x4 = v40; - *x3 = v81; + decref(v9); + VAL v47 = mw_mirth_var_Ctx_ZToList(v7); + *x4 = v8; + *x3 = v47; } static void mw_mirth_elab_elabZ_dataZ_tagZBang (uint64_t x1, VAL x2, VAL x3, uint64_t *x4, VAL *x5) { uint64_t v6 = mw_mirth_data_Tag_allocZBang(); @@ -55557,429 +41169,217 @@ static void mw_mirth_elab_elabZ_dataZ_tagZBang (uint64_t x1, VAL x2, VAL x3, uin VAL v13 = VVAL(VTUP(x2)->cells[2]); incref(v13); decref(x2); - VAL x14; - uint64_t x15; - uint64_t x16; - VAL x17; + uint64_t x14; switch (get_data_tag(v13)) { case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(v13); - void* v19 = mfld_mirth_data_Tag_ZTildevalue(v6); - mut_set(v18, v19); - x17 = x2; - x16 = v6; - x15 = x1; - x14 = x3; + VAL v15 = mtp_std_maybe_Maybe_1_Some(v13); + void* v16 = mfld_mirth_data_Tag_ZTildevalue(v6); + mut_set(v15, v16); + x14 = v6; } break; case 0LL: { // None - x17 = x2; - x16 = v6; - x15 = x1; - x14 = x3; + x14 = v6; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - void* v20 = mfld_mirth_data_Tag_ZTildedata(x16); - mut_set(MKU64(x15), v20); - VAL v21 = (mw_mirth_data_Data_addZ_tagZBang(x14, x16, x15)); - VAL v22 = mtw_mirth_def_Def_DefTag(x16); - VAL v23 = (mw_mirth_def_Def_register(v21, v22)); - incref(x17); - uint64_t v24 = VU64(VTUP(x17)->cells[1]); - decref(x17); - VAL v25 = mtw_mirth_mirth_PropLabel_TagType(x16); - VAL v26 = MKNIL; - VAL v27 = mkcons(v26, MKU64(v24)); - VAL v28 = mkcons(v27, MKU64(x16)); - FNPTR v29 = &mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotelabZ_dataZ_tagZBangZDot42ZRParen_1; - VAL v30; - VAL v31; - mw_mirth_mirth_PropLabel_prop_1(v28, v25, v23, MKFNPTR(v29), &v30, &v31); - void* v32 = mfld_mirth_data_Tag_ZTildectxZ_type(x16); - mut_set(v30, v32); - int64_t v33 = mw_mirth_data_Tag_numZ_typeZ_inputsZ_fromZ_sig(x16); - void* v34 = mfld_mirth_data_Tag_ZTildenumZ_typeZ_inputs(x16); - mut_set(MKI64(v33), v34); - int64_t v35 = mw_mirth_data_Tag_numZ_resourceZ_inputsZ_fromZ_sig(x16); - void* v36 = mfld_mirth_data_Tag_ZTildenumZ_resourceZ_inputs(x16); - mut_set(MKI64(v35), v36); - VAL v37 = mw_mirth_data_Tag_labelZ_inputsZ_fromZ_sig(x16); - void* v38 = mfld_mirth_data_Tag_ZTildelabelZ_inputs(x16); - mut_set(v37, v38); - int64_t v39 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x16); - bool v40 = !((bool)v39); - uint64_t x41; - VAL x42; - VAL x43; - uint64_t x44; - if (v40) { - VAL v45 = mw_mirth_data_Tag_sigZAsk(x16); - uint64_t x46; - VAL x47; - VAL x48; - uint64_t x49; - switch (get_data_tag(v45)) { + void* v17 = mfld_mirth_data_Tag_ZTildedata(x14); + mut_set(MKU64(x1), v17); + VAL v18 = mw_mirth_data_Data_addZ_tagZBang(x3, x14, x1); + VAL v19 = mtw_mirth_def_Def_DefTag(x14); + VAL v20 = mw_mirth_def_Def_register(v18, v19); + incref(x2); + uint64_t v21 = VU64(VTUP(x2)->cells[1]); + decref(x2); + VAL v22 = mtw_mirth_mirth_PropLabel_TagType(x14); + VAL v23 = MKNIL; + VAL v24 = mkcons(v23, MKU64(v21)); + VAL v25 = mkcons(v24, MKU64(x14)); + FNPTR v26 = &mb_mirth_mirth_PropLabel_prop_1_sp13_2; + VAL v27 = mtw_mirth_mirth_PropState_1_PSDelay(v25, MKFNPTR(v26)); + VAL v28 = mtw_mirth_mirth_Prop_1_Prop(v22, v27); + void* v29 = mfld_mirth_data_Tag_ZTildectxZ_type(x14); + mut_set(v28, v29); + int64_t v30 = mw_mirth_data_Tag_numZ_typeZ_inputsZ_fromZ_sig(x14); + void* v31 = mfld_mirth_data_Tag_ZTildenumZ_typeZ_inputs(x14); + mut_set(MKI64(v30), v31); + int64_t v32 = mw_mirth_data_Tag_numZ_resourceZ_inputsZ_fromZ_sig(x14); + void* v33 = mfld_mirth_data_Tag_ZTildenumZ_resourceZ_inputs(x14); + mut_set(MKI64(v32), v33); + VAL v34 = mw_mirth_data_Tag_labelZ_inputsZ_fromZ_sig(x14); + void* v35 = mfld_mirth_data_Tag_ZTildelabelZ_inputs(x14); + mut_set(v34, v35); + int64_t v36 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x14); + bool v37 = !((bool)v36); + VAL x38; + uint64_t x39; + if (v37) { + VAL v40 = mw_mirth_data_Tag_sigZAsk(x14); + VAL x41; + switch (get_data_tag(v40)) { case 1LL: { // Some - VAL v50 = mtp_std_maybe_Maybe_1_Some(v45); - VAL v51 = mw_mirth_token_Token_runZ_tokens(VU64(v50)); - VAL v52 = MKI64(0LL /* None */); - VAL v53; - VAL v54; - mw_std_list_List_1_uncons(v51, &v53, &v54); - uint64_t x55; - VAL x56; - VAL x57; - uint64_t x58; - VAL x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v53)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v53); - incref(v62); - incref(v62); - VAL v63 = mw_mirth_token_Token_sigZ_resourceZ_conZAsk(VU64(v62)); - int64_t v64 = mw_std_maybe_Maybe_1_ZToBool(v63); - uint64_t x65; - VAL x66; - VAL x67; - uint64_t x68; - int64_t x69; - if (((bool)v64)) { - decref(v62); - int64_t v70 = 1LL /* True */; - x69 = v70; - x68 = x16; - x67 = v31; - x66 = x17; - x65 = x15; - } else { - VAL v71 = mw_mirth_token_Token_sigZ_resourceZ_varZAsk(VU64(v62)); - int64_t v72 = mw_std_maybe_Maybe_1_ZToBool(v71); - x69 = v72; - x68 = x16; - x67 = v31; - x66 = x17; - x65 = x15; - } - uint64_t x73; - VAL x74; - VAL x75; - uint64_t x76; - VAL x77; - if (((bool)x69)) { - VAL v78 = mtw_std_maybe_Maybe_1_Some(v62); - x77 = v78; - x76 = x68; - x75 = x67; - x74 = x66; - x73 = x65; - } else { - decref(v62); - VAL v79 = MKI64(0LL /* None */); - x77 = v79; - x76 = x68; - x75 = x67; - x74 = x66; - x73 = x65; - } - uint64_t x80; - VAL x81; - VAL x82; - uint64_t x83; - VAL x84; - VAL x85; - switch (get_data_tag(x77)) { - case 0LL: { // None - x85 = v54; - x84 = v52; - x83 = x76; - x82 = x75; - x81 = x74; - x80 = x73; - } break; - default: { - decref(v54); - decref(v52); - VAL v86 = MKI64(0LL /* Nil */); - x85 = v86; - x84 = x77; - x83 = x76; - x82 = x75; - x81 = x74; - x80 = x73; - } break; - } - int64_t v87 = 1LL /* True */; - x61 = v87; - x60 = x85; - x59 = x84; - x58 = x83; - x57 = x82; - x56 = x81; - x55 = x80; - } break; - case 0LL: { // None - int64_t v88 = 0LL /* False */; - x61 = v88; - x60 = v54; - x59 = v52; - x58 = x16; - x57 = v31; - x56 = x17; - x55 = x15; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v89 = x55; - VAL v90 = x56; - VAL v91 = (x57); - uint64_t v92 = x58; - VAL v93 = x59; - VAL v94 = x60; - int64_t v95 = x61; - while (((bool)v95)) { - uint64_t v96 = v89; - VAL v97 = v90; - VAL v98 = (v91); - uint64_t v99 = v92; - VAL v100 = v93; - VAL v101 = v94; - VAL v102; - VAL v103; - mw_std_list_List_1_uncons(v101, &v102, &v103); - uint64_t x104; - VAL x105; - VAL x106; - uint64_t x107; - VAL x108; - VAL x109; - int64_t x110; - switch (get_data_tag(v102)) { + VAL v42 = mtp_std_maybe_Maybe_1_Some(v40); + VAL v43 = mw_mirth_token_Token_runZ_tokens(VU64(v42)); + VAL v44 = MKI64(0LL /* None */); + int64_t v45 = 1LL /* True */; + VAL v46 = v44; + VAL v47 = v43; + int64_t v48 = v45; + int64_t v49 = v45; + while (((bool)v49)) { + VAL v50 = v46; + VAL v51 = v47; + int64_t v52 = v48; + VAL v53; + VAL v54; + mw_std_list_List_1_uncons(v51, &v53, &v54); + VAL x55; + VAL x56; + int64_t x57; + switch (get_data_tag(v53)) { case 1LL: { // Some - VAL v111 = mtp_std_maybe_Maybe_1_Some(v102); - incref(v111); - incref(v111); - VAL v112 = mw_mirth_token_Token_sigZ_resourceZ_conZAsk(VU64(v111)); - int64_t v113 = mw_std_maybe_Maybe_1_ZToBool(v112); - uint64_t x114; - VAL x115; - VAL x116; - uint64_t x117; - int64_t x118; - if (((bool)v113)) { - decref(v111); - int64_t v119 = 1LL /* True */; - x118 = v119; - x117 = v99; - x116 = v98; - x115 = v97; - x114 = v96; + VAL v58 = mtp_std_maybe_Maybe_1_Some(v53); + incref(v58); + incref(v58); + VAL v59 = mw_mirth_token_Token_sigZ_resourceZ_conZAsk(VU64(v58)); + int64_t v60 = get_data_tag(v59); + decref(v59); + int64_t v61 = 1LL; + bool v62 = (v60 == v61); + int64_t x63; + if (v62) { + decref(v58); + int64_t v64 = 1LL /* True */; + x63 = v64; } else { - VAL v120 = mw_mirth_token_Token_sigZ_resourceZ_varZAsk(VU64(v111)); - int64_t v121 = mw_std_maybe_Maybe_1_ZToBool(v120); - x118 = v121; - x117 = v99; - x116 = v98; - x115 = v97; - x114 = v96; + VAL v65 = mw_mirth_token_Token_sigZ_resourceZ_varZAsk(VU64(v58)); + int64_t v66 = get_data_tag(v65); + decref(v65); + int64_t v67 = 1LL; + bool v68 = (v66 == v67); + x63 = ((int64_t)v68); } - uint64_t x122; - VAL x123; - VAL x124; - uint64_t x125; - VAL x126; - if (((bool)x118)) { - VAL v127 = mtw_std_maybe_Maybe_1_Some(v111); - x126 = v127; - x125 = x117; - x124 = x116; - x123 = x115; - x122 = x114; + VAL x69; + if (((bool)x63)) { + VAL v70 = mtw_std_maybe_Maybe_1_Some(v58); + x69 = v70; } else { - decref(v111); - VAL v128 = MKI64(0LL /* None */); - x126 = v128; - x125 = x117; - x124 = x116; - x123 = x115; - x122 = x114; + decref(v58); + VAL v71 = MKI64(0LL /* None */); + x69 = v71; } - uint64_t x129; - VAL x130; - VAL x131; - uint64_t x132; - VAL x133; - VAL x134; - switch (get_data_tag(x126)) { + VAL x72; + VAL x73; + switch (get_data_tag(x69)) { case 0LL: { // None - x134 = v103; - x133 = v100; - x132 = x125; - x131 = x124; - x130 = x123; - x129 = x122; + x73 = v54; + x72 = v50; } break; default: { - decref(v103); - decref(v100); - VAL v135 = MKI64(0LL /* Nil */); - x134 = v135; - x133 = x126; - x132 = x125; - x131 = x124; - x130 = x123; - x129 = x122; + decref(v54); + decref(v50); + VAL v74 = MKI64(0LL /* Nil */); + x73 = v74; + x72 = x69; } break; } - int64_t v136 = 1LL /* True */; - x110 = v136; - x109 = x134; - x108 = x133; - x107 = x132; - x106 = x131; - x105 = x130; - x104 = x129; + int64_t v75 = 1LL /* True */; + x57 = v75; + x56 = x73; + x55 = x72; } break; case 0LL: { // None - int64_t v137 = 0LL /* False */; - x110 = v137; - x109 = v103; - x108 = v100; - x107 = v99; - x106 = v98; - x105 = v97; - x104 = v96; + int64_t v76 = 0LL /* False */; + x57 = v76; + x56 = v54; + x55 = v50; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v95 = x110; - v94 = x109; - v93 = x108; - v92 = x107; - v91 = x106; - v90 = x105; - v89 = x104; + v49 = x57; + v48 = x57; + v47 = x56; + v46 = x55; } - decref(v94); - uint64_t x138; - VAL x139; - VAL x140; - uint64_t x141; - switch (get_data_tag(v93)) { + decref(v47); + VAL x77; + switch (get_data_tag(v46)) { case 1LL: { // Some - VAL v142 = mtp_std_maybe_Maybe_1_Some(v93); - STR* v143; - STRLIT(v143, "Value type cannot contain resource.", 35); - VAL v144 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(VU64(v142), MKSTR(v143), v91)); - x141 = v92; - x140 = v144; - x139 = v90; - x138 = v89; + VAL v78 = mtp_std_maybe_Maybe_1_Some(v46); + STR* v79; + STRLIT(v79, "Value type cannot contain resource.", 35); + VAL v80 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(VU64(v78), MKSTR(v79), v20); + x77 = v80; } break; case 0LL: { // None - x141 = v92; - x140 = v91; - x139 = v90; - x138 = v89; + x77 = v20; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x49 = x141; - x48 = x140; - x47 = x139; - x46 = x138; + x41 = x77; } break; case 0LL: { // None - x49 = x16; - x48 = v31; - x47 = x17; - x46 = x15; + x41 = v20; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x44 = x49; - x43 = x48; - x42 = x47; - x41 = x46; + x39 = x14; + x38 = x41; } else { - x44 = x16; - x43 = v31; - x42 = x17; - x41 = x15; + x39 = x14; + x38 = v20; } - decref(x42); - *x5 = x43; - *x4 = x41; + decref(x2); + *x5 = x38; + *x4 = x1; } static void mw_mirth_elab_dataZ_wordZ_newZBang (VAL x1, uint64_t x2, VAL x3, int64_t x4, VAL *x5, uint64_t *x6) { incref(x3); uint64_t v7 = mw_std_prim_Str_ZToName(x3); VAL v8 = mw_mirth_data_Data_headZAsk(x2); VAL x9; - int64_t x10; - uint64_t x11; - uint64_t x12; - uint64_t x13; + VAL x10; switch (get_data_tag(v8)) { case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v8); - x13 = VU64(v14); - x12 = x2; - x11 = v7; - x10 = x4; + VAL v11 = mtp_std_maybe_Maybe_1_Some(v8); + x10 = v11; x9 = x1; } break; case 0LL: { // None - STR* v15; - STRLIT(v15, "Missing data token information.", 31); - lpush(&lbl_arity, MKI64(x4)); - lpush(&lbl_name, MKU64(v7)); - push_u64(x2); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v15), x1); - uint64_t v16 = pop_u64(); - x13 = v16; - uint64_t v17 = pop_u64(); - x12 = v17; - uint64_t v18 = VU64(lpop(&lbl_name)); - x11 = v18; - int64_t v19 = VI64(lpop(&lbl_arity)); - x10 = v19; - VAL r20 = pop_resource(); - x9 = r20; + STR* v12; + STRLIT(v12, "Missing data token information.", 31); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v12), x1); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v21 = mw_mirth_data_dataZ_wordZ_qname(x12, x3, x4); - VAL v22 = MKI64(0LL /* None */); - uint64_t v23; - VAL v24; - mw_mirth_word_Word_newZBang(x13, v22, x13, x11, x10, x9, &v23, &v24); - VAL v25 = mtw_mirth_mirth_PropLabel_WordQName(v23); - VAL v26; - VAL v27; - mw_mirth_mirth_PropLabel_prop(v21, v25, v24, &v26, &v27); - void* v28 = mfld_mirth_word_Word_ZTildeqname(v23); - mut_set(v26, v28); - *x6 = v23; - *x5 = v27; + incref(x10); + VAL v15 = mw_mirth_data_dataZ_wordZ_qname(x2, x3, x4); + VAL v16 = MKI64(0LL /* None */); + uint64_t v17; + VAL v18; + mw_mirth_word_Word_newZBang(VU64(x10), v16, VU64(x10), v7, x4, x9, &v17, &v18); + VAL v19 = mtw_mirth_mirth_PropLabel_WordQName(v17); + VAL v20; + VAL v21; + mw_mirth_mirth_PropLabel_prop(v15, v19, v18, &v20, &v21); + void* v22 = mfld_mirth_word_Word_ZTildeqname(v17); + mut_set(v20, v22); + *x6 = v17; + *x5 = v21; } static VAL mw_mirth_elab_elabZ_dataZ_doneZBang (VAL x1, uint64_t x2) { int64_t v3 = mw_mirth_data_Data_isZ_valueZ_typeZAsk(x2); - VAL x4; - uint64_t x5; + uint64_t x4; + VAL x5; if (((bool)v3)) { STR* v6; STRLIT(v6, "cons-value", 10); @@ -56030,26 +41430,26 @@ static VAL mw_mirth_elab_elabZ_dataZ_doneZBang (VAL x1, uint64_t x2) { void* v39 = mfld_mirth_word_Word_ZTildearrow(v9); mut_set(v37, v39); mw_mirth_word_Word_makeZ_inlineZBang(v9); - x5 = x2; - x4 = v38; + x5 = v38; + x4 = x2; } else { - x5 = x2; - x4 = x1; + x5 = x1; + x4 = x2; } - int64_t v40 = mw_mirth_data_Data_isZ_enumZAsk(x5); - VAL x41; - uint64_t x42; + int64_t v40 = mw_mirth_data_Data_isZ_enumZAsk(x4); + uint64_t x41; + VAL x42; if (((bool)v40)) { STR* v43; STRLIT(v43, "from-cons-value-unsafe", 22); int64_t v44 = 0LL; VAL v45; uint64_t v46; - mw_mirth_elab_dataZ_wordZ_newZBang(x4, x5, MKSTR(v43), v44, &v45, &v46); + mw_mirth_elab_dataZ_wordZ_newZBang(x5, x4, MKSTR(v43), v44, &v45, &v46); VAL v47 = mw_mirth_var_Ctx0(); VAL v48 = mw_mirth_type_TYPEz_INT(); VAL v49 = mw_mirth_type_T1(v48); - VAL v50 = mtw_mirth_type_Type_TData(x5); + VAL v50 = mtw_mirth_type_Type_TData(x4); VAL v51 = mw_mirth_type_T1(v50); VAL v52 = mw_mirth_type_TZ_ZTo(v49, v51); VAL v53 = mtw_mirth_mirth_PropLabel_WordType(v46); @@ -56088,16 +41488,16 @@ static VAL mw_mirth_elab_elabZ_dataZ_doneZBang (VAL x1, uint64_t x2) { void* v77 = mfld_mirth_word_Word_ZTildearrow(v46); mut_set(v75, v77); mw_mirth_word_Word_makeZ_inlineZBang(v46); - x42 = x5; - x41 = v76; + x42 = v76; + x41 = x4; } else { x42 = x5; x41 = x4; } - VAL v78 = mw_mirth_data_Data_tags(x42); + VAL v78 = mw_mirth_data_Data_tags(x41); VAL v79 = mw_std_list_List_1_ZDivL1(v78); - VAL x80; - uint64_t x81; + uint64_t x80; + VAL x81; switch (get_data_tag(v79)) { case 1LL: { // Some VAL v82 = mtp_std_maybe_Maybe_1_Some(v79); @@ -56110,36 +41510,34 @@ static VAL mw_mirth_elab_elabZ_dataZ_doneZBang (VAL x1, uint64_t x2) { int64_t v87 = 0LL; VAL v88; uint64_t v89; - mw_mirth_elab_dataZ_wordZ_newZBang(x41, x42, MKSTR(v86), v87, &v88, &v89); + mw_mirth_elab_dataZ_wordZ_newZBang(x42, x41, MKSTR(v86), v87, &v88, &v89); VAL v90 = mtw_std_maybe_Maybe_1_Some(MKU64(v89)); incref(v82); void* v91 = mfld_mirth_data_Tag_ZTildeuntag(VU64(v82)); mut_set(v90, v91); incref(v82); VAL v92 = mtw_mirth_mirth_PropLabel_WordType(v89); - FNPTR v93 = &mb_mirth_elab_elabZ_dataZ_doneZBang_5; - VAL v94; - VAL v95; - mw_mirth_mirth_PropLabel_prop_1(v82, v92, v88, MKFNPTR(v93), &v94, &v95); + FNPTR v93 = &mb_mirth_mirth_PropLabel_prop_1_sp4_0; + VAL v94 = mtw_mirth_mirth_PropState_1_PSDelay(v82, MKFNPTR(v93)); + VAL v95 = mtw_mirth_mirth_Prop_1_Prop(v92, v94); void* v96 = mfld_mirth_word_Word_ZTildectxZ_type(v89); - mut_set(v94, v96); + mut_set(v95, v96); incref(v82); VAL v97 = mtw_mirth_mirth_PropLabel_WordArrow(v89); VAL v98 = MKNIL; VAL v99 = mkcons(v98, v82); VAL v100 = mkcons(v99, MKU64(v89)); - FNPTR v101 = &mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotelabZ_dataZ_doneZBangZDot104ZRParen_1; - VAL v102; - VAL v103; - mw_mirth_mirth_PropLabel_prop_1(v100, v97, v95, MKFNPTR(v101), &v102, &v103); + FNPTR v101 = &mb_mirth_mirth_PropLabel_prop_1_sp12_7; + VAL v102 = mtw_mirth_mirth_PropState_1_PSDelay(v100, MKFNPTR(v101)); + VAL v103 = mtw_mirth_mirth_Prop_1_Prop(v97, v102); void* v104 = mfld_mirth_word_Word_ZTildearrow(v89); - mut_set(v102, v104); + mut_set(v103, v104); mw_mirth_word_Word_makeZ_inlineZBang(v89); incref(v82); - VAL v105 = (mw_mirth_elab_createZ_projectorsZBang(v103, VU64(v82))); + VAL v105 = mw_mirth_elab_createZ_projectorsZBang(v88, VU64(v82)); decref(v82); - x81 = x42; - x80 = v105; + x81 = v105; + x80 = x41; } break; case 0LL: { // None x81 = x42; @@ -56149,14 +41547,13 @@ static VAL mw_mirth_elab_elabZ_dataZ_doneZBang (VAL x1, uint64_t x2) { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v106 = mtw_mirth_mirth_PropLabel_DataCType(x81); - FNPTR v107 = &mb_mirth_elab_elabZ_dataZ_doneZBang_14; - VAL v108; - VAL v109; - mw_mirth_mirth_PropLabel_prop_1(MKU64(x81), v106, x80, MKFNPTR(v107), &v108, &v109); - void* v110 = mfld_mirth_data_Data_ZTildectypeZAsk(x81); - mut_set(v108, v110); - return v109; + VAL v106 = mtw_mirth_mirth_PropLabel_DataCType(x80); + FNPTR v107 = &mb_mirth_mirth_PropLabel_prop_1_sp3_6; + VAL v108 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(x80), MKFNPTR(v107)); + VAL v109 = mtw_mirth_mirth_Prop_1_Prop(v106, v108); + void* v110 = mfld_mirth_data_Data_ZTildectypeZAsk(x80); + mut_set(v109, v110); + return x81; } static void mw_mirth_data_Tag_outputZ_type (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { void* v5 = mfld_mirth_data_Tag_ZTildeoutputZ_type(x2); @@ -56210,44 +41607,41 @@ static void mw_mirth_data_Tag_outputZ_type (VAL x1, uint64_t x2, VAL *x3, VAL *x STR* v28 = str_cat(v24, VSTR(v27)); uint64_t v29 = mw_mirth_data_Tag_data(x2); VAL v30 = mw_mirth_data_Data_headZAsk(v29); - uint64_t x31; - VAL x32; + VAL x31; switch (get_data_tag(v30)) { case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v30); - VAL v34 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(VU64(v33), MKSTR(v28), v26)); - x32 = v34; - x31 = x2; + VAL v32 = mtp_std_maybe_Maybe_1_Some(v30); + VAL v33 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(VU64(v32), MKSTR(v28), v26); + x31 = v33; } break; case 0LL: { // None - VAL v35 = (mw_mirth_mirth_ZPlusMirth_errorZBang(MKSTR(v28), v26)); - x32 = v35; - x31 = x2; + VAL v34 = mw_mirth_mirth_ZPlusMirth_errorZBang(MKSTR(v28), v26); + x31 = v34; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v36 = MKI64(0LL /* TYPE_ERROR */); - uint64_t v37 = mw_mirth_data_Tag_data(x31); - int64_t v38 = mw_mirth_data_Data_isZ_resourceZAsk(v37); - VAL x39; - uint64_t x40; - VAL x41; - if (((bool)v38)) { - VAL v42 = mtw_std_either_Either_2_Right(v36); - x41 = v42; - x40 = x31; - x39 = x32; + VAL v35 = MKI64(0LL /* TYPE_ERROR */); + uint64_t v36 = mw_mirth_data_Tag_data(x2); + int64_t v37 = mw_mirth_data_Data_isZ_resourceZAsk(v36); + VAL x38; + uint64_t x39; + VAL x40; + if (((bool)v37)) { + VAL v41 = mtw_std_either_Either_2_Right(v35); + x40 = v41; + x39 = x2; + x38 = x31; } else { - VAL v43 = mtw_std_either_Either_2_Left(v36); - x41 = v43; - x40 = x31; - x39 = x32; + VAL v42 = mtw_std_either_Either_2_Left(v35); + x40 = v42; + x39 = x2; + x38 = x31; } - x17 = x41; - x16 = x39; - x15 = x40; + x17 = x40; + x16 = x38; + x15 = x39; } break; } incref(x17); @@ -56264,28 +41658,25 @@ static void mw_mirth_data_Tag_outputZ_typeZ_exceptZ_field (VAL x1, uint64_t x2, VAL v7; mw_mirth_data_Tag_outputZ_type(x1, x3, &v6, &v7); VAL x8; - VAL x9; switch (get_data_tag(v7)) { case 0LL: { // Left - VAL v10 = mtp_std_either_Either_2_Left(v7); - VAL v11 = mw_mirth_type_Type_exceptZ_field(x2, x3, v10); - VAL v12 = mtw_std_either_Either_2_Left(v11); - x9 = v12; - x8 = v6; + VAL v9 = mtp_std_either_Either_2_Left(v7); + VAL v10 = mw_mirth_type_Type_exceptZ_field(x2, x3, v9); + VAL v11 = mtw_std_either_Either_2_Left(v10); + x8 = v11; } break; case 1LL: { // Right - VAL v13 = mtp_std_either_Either_2_Right(v7); - VAL v14 = mw_mirth_type_Resource_exceptZ_field(x2, x3, v13); - VAL v15 = mtw_std_either_Either_2_Right(v14); - x9 = v15; - x8 = v6; + VAL v12 = mtp_std_either_Either_2_Right(v7); + VAL v13 = mw_mirth_type_Resource_exceptZ_field(x2, x3, v12); + VAL v14 = mtw_std_either_Either_2_Right(v13); + x8 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x5 = x9; - *x4 = x8; + *x5 = x8; + *x4 = v6; } static void mw_mirth_data_Tag_projectZ_inputZ_label (VAL x1, uint64_t x2, uint64_t x3, VAL *x4, VAL *x5) { VAL v6; @@ -56301,26 +41692,23 @@ static void mw_mirth_data_Tag_projectZ_tagZ_field (VAL x1, uint64_t x2, uint64_t VAL v7; mw_mirth_data_Tag_projectZ_inputZ_label(x1, x2, x3, &v6, &v7); VAL x8; - VAL x9; switch (get_data_tag(v7)) { case 1LL: { // Some - VAL v10 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v11 = mtw_mirth_data_TagField_TagField(x3, x2, v10); - VAL v12 = mtw_std_maybe_Maybe_1_Some(v11); - x9 = v12; - x8 = v6; + VAL v9 = mtp_std_maybe_Maybe_1_Some(v7); + VAL v10 = mtw_mirth_data_TagField_TagField(x3, x2, v9); + VAL v11 = mtw_std_maybe_Maybe_1_Some(v10); + x8 = v11; } break; case 0LL: { // None - VAL v13 = MKI64(0LL /* None */); - x9 = v13; - x8 = v6; + VAL v12 = MKI64(0LL /* None */); + x8 = v12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x5 = x9; - *x4 = x8; + *x5 = x8; + *x4 = v6; } static void mw_mirth_elab_dataZ_getZ_labelZ_type (VAL x1, VAL x2, VAL *x3, VAL *x4) { uint64_t v5; @@ -56345,48 +41733,42 @@ static void mw_mirth_elab_dataZ_getZ_labelZ_type (VAL x1, VAL x2, VAL *x3, VAL * uint64_t x20; VAL x21; VAL x22; - VAL x23; - uint64_t x24; if (((bool)v19)) { - VAL v25; - VAL v26; - mw_mirth_data_Tag_outputZ_type(v14, v5, &v25, &v26); - VAL v27 = mw_mirth_type_TZMulZPlus(v17, v26); - x24 = v5; - x23 = v27; - x22 = v16; - x21 = v25; - x20 = v6; + VAL v23; + VAL v24; + mw_mirth_data_Tag_outputZ_type(v14, v5, &v23, &v24); + VAL v25 = mw_mirth_type_TZMulZPlus(v17, v24); + x22 = v25; + x21 = v23; + x20 = v5; } else { - x24 = v5; - x23 = v17; - x22 = v16; + x22 = v17; x21 = v14; - x20 = v6; + x20 = v5; } - VAL v28 = mw_mirth_type_TZ_ZTo(x22, x23); - x11 = v28; - x10 = x24; + VAL v26 = mw_mirth_type_TZ_ZTo(v16, x22); + x11 = v26; + x10 = x20; x9 = x21; - x8 = x20; + x8 = v6; } break; case 1LL: { // Right - VAL v29 = mtp_std_either_Either_2_Right(v7); - VAL v30 = mw_mirth_type_T0(); - VAL v31; - VAL v32; - mw_mirth_data_Tag_outputZ_type(x1, v5, &v31, &v32); - VAL v33 = mw_mirth_type_TZMulZPlus(v30, v32); - VAL v34 = mw_mirth_type_T0(); - VAL v35 = mw_mirth_type_TZPlus(v34, v29); - VAL v36; - VAL v37; - mw_mirth_data_Tag_outputZ_typeZ_exceptZ_field(v31, v6, v5, &v36, &v37); - VAL v38 = mw_mirth_type_TZMulZPlus(v35, v37); - VAL v39 = mw_mirth_type_TZ_ZTo(v33, v38); - x11 = v39; + VAL v27 = mtp_std_either_Either_2_Right(v7); + VAL v28 = mw_mirth_type_T0(); + VAL v29; + VAL v30; + mw_mirth_data_Tag_outputZ_type(x1, v5, &v29, &v30); + VAL v31 = mw_mirth_type_TZMulZPlus(v28, v30); + VAL v32 = mw_mirth_type_T0(); + VAL v33 = mw_mirth_type_TZPlus(v32, v27); + VAL v34; + VAL v35; + mw_mirth_data_Tag_outputZ_typeZ_exceptZ_field(v29, v6, v5, &v34, &v35); + VAL v36 = mw_mirth_type_TZMulZPlus(v33, v35); + VAL v37 = mw_mirth_type_TZ_ZTo(v31, v36); + x11 = v37; x10 = v5; - x9 = v36; + x9 = v34; x8 = v6; } break; default: { @@ -56454,560 +41836,299 @@ static VAL mw_mirth_elab_createZ_projectorsZBang (VAL x1, uint64_t x2) { uint64_t v3 = mw_mirth_data_Tag_data(x2); VAL v4 = mw_mirth_data_Tag_labelZ_inputs(x2); VAL v5 = mw_std_list_List_1_reverse(v4); - VAL v6; - VAL v7; - mw_std_list_List_1_uncons(v5, &v6, &v7); - VAL x8; - uint64_t x9; - uint64_t x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v6); - incref(v13); - uint64_t v14 = mw_mirth_label_Label_name(VU64(v13)); - int64_t v15 = 0LL; - VAL v16 = mw_mirth_data_dataZ_qname(v3, v14, v15); - VAL v17; - int64_t v18; - mw_mirth_name_QName_undefinedZ_softZAsk(x1, v16, &v17, &v18); - uint64_t x19; - uint64_t x20; - uint64_t x21; - VAL x22; - if (((bool)v18)) { - incref(v13); - VAL v23 = mw_mirth_label_Label_ZToStr(VU64(v13)); - int64_t v24 = 0LL; - VAL v25; - uint64_t v26; - mw_mirth_elab_dataZ_wordZ_newZBang(v17, v3, v23, v24, &v25, &v26); - incref(v13); - VAL v27 = mw_mirth_label_Label_ZToStr(VU64(v13)); - STR* v28; - STRLIT(v28, "!", 1); - STR* v29 = str_cat(VSTR(v27), v28); - int64_t v30 = 0LL; - VAL v31; - uint64_t v32; - mw_mirth_elab_dataZ_wordZ_newZBang(v25, v3, MKSTR(v29), v30, &v31, &v32); - incref(v13); - VAL v33 = mw_mirth_label_Label_ZToStr(VU64(v13)); - int64_t v34 = 1LL; - VAL v35; - uint64_t v36; - mw_mirth_elab_dataZ_wordZ_newZBang(v31, v3, v33, v34, &v35, &v36); - mw_mirth_word_Word_makeZ_inlineZBang(v26); - incref(v13); - VAL v37 = mtw_mirth_mirth_PropLabel_WordType(v26); - VAL v38 = MKNIL; - VAL v39 = mkcons(v38, MKU64(x2)); - VAL v40 = mkcons(v39, v13); - FNPTR v41 = &mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot45ZRParen_1; - VAL v42; - VAL v43; - mw_mirth_mirth_PropLabel_prop_1(v40, v37, v35, MKFNPTR(v41), &v42, &v43); - void* v44 = mfld_mirth_word_Word_ZTildectxZ_type(v26); - mut_set(v42, v44); - incref(v13); - VAL v45 = mtw_mirth_mirth_PropLabel_WordArrow(v26); - VAL v46 = MKNIL; - VAL v47 = mkcons(v46, MKU64(x2)); - VAL v48 = mkcons(v47, v13); - VAL v49 = mkcons(v48, MKU64(v26)); - FNPTR v50 = &mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot73ZRParen_1; - VAL v51; - VAL v52; - mw_mirth_mirth_PropLabel_prop_1(v49, v45, v43, MKFNPTR(v50), &v51, &v52); - void* v53 = mfld_mirth_word_Word_ZTildearrow(v26); - mut_set(v51, v53); - mw_mirth_word_Word_makeZ_inlineZBang(v32); - incref(v13); - VAL v54 = mtw_mirth_mirth_PropLabel_WordType(v32); - VAL v55 = MKNIL; - VAL v56 = mkcons(v55, MKU64(x2)); - VAL v57 = mkcons(v56, v13); - FNPTR v58 = &mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot106ZRParen_1; - VAL v59; - VAL v60; - mw_mirth_mirth_PropLabel_prop_1(v57, v54, v52, MKFNPTR(v58), &v59, &v60); - void* v61 = mfld_mirth_word_Word_ZTildectxZ_type(v32); - mut_set(v59, v61); - incref(v13); - VAL v62 = mtw_mirth_mirth_PropLabel_WordArrow(v32); - VAL v63 = MKNIL; - VAL v64 = mkcons(v63, MKU64(x2)); - VAL v65 = mkcons(v64, v13); - VAL v66 = mkcons(v65, MKU64(v32)); - FNPTR v67 = &mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot134ZRParen_1; - VAL v68; - VAL v69; - mw_mirth_mirth_PropLabel_prop_1(v66, v62, v60, MKFNPTR(v67), &v68, &v69); - void* v70 = mfld_mirth_word_Word_ZTildearrow(v32); - mut_set(v68, v70); - mw_mirth_word_Word_makeZ_inlineZBang(v36); - incref(v13); - VAL v71 = mtw_mirth_mirth_PropLabel_WordType(v36); - VAL v72 = MKNIL; - VAL v73 = mkcons(v72, MKU64(x2)); - VAL v74 = mkcons(v73, v13); - FNPTR v75 = &mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot167ZRParen_1; - VAL v76; - VAL v77; - mw_mirth_mirth_PropLabel_prop_1(v74, v71, v69, MKFNPTR(v75), &v76, &v77); - void* v78 = mfld_mirth_word_Word_ZTildectxZ_type(v36); - mut_set(v76, v78); - VAL v79 = mtw_mirth_mirth_PropLabel_WordParams(v36); - FNPTR v80 = &mb_mirth_elab_createZ_projectorsZBang_24; - VAL v81; - VAL v82; - mw_mirth_mirth_PropLabel_prop_1(MKU64(v36), v79, v77, MKFNPTR(v80), &v81, &v82); - void* v83 = mfld_mirth_word_Word_ZTildeparams(v36); - mut_set(v81, v83); - VAL v84 = mtw_mirth_mirth_PropLabel_WordArrow(v36); - VAL v85 = MKNIL; - VAL v86 = mkcons(v85, MKU64(v3)); - VAL v87 = mkcons(v86, MKU64(v26)); - VAL v88 = mkcons(v87, MKU64(v32)); - VAL v89 = mkcons(v88, MKU64(v36)); - FNPTR v90 = &mb_mirth_mirth_PropLabel_prop4_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot267ZRParen_1; - VAL v91; - VAL v92; - mw_mirth_mirth_PropLabel_prop_1(v89, v84, v82, MKFNPTR(v90), &v91, &v92); - void* v93 = mfld_mirth_word_Word_ZTildearrow(v36); - mut_set(v91, v93); - x22 = v92; - x21 = VU64(v13); - x20 = v3; - x19 = x2; - } else { - x22 = v17; - x21 = VU64(v13); - x20 = v3; - x19 = x2; - } - int64_t v94 = 1LL /* True */; - x12 = v94; - x11 = v7; - x10 = x19; - x9 = x20; - x8 = x22; - } break; - case 0LL: { // None - int64_t v95 = 0LL /* False */; - x12 = v95; - x11 = v7; - x10 = x2; - x9 = v3; - x8 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v96 = (x8); - uint64_t v97 = x9; - uint64_t v98 = x10; - VAL v99 = x11; - int64_t v100 = x12; - while (((bool)v100)) { - VAL v101 = (v96); - uint64_t v102 = v97; - uint64_t v103 = v98; - VAL v104 = v99; - VAL v105; - VAL v106; - mw_std_list_List_1_uncons(v104, &v105, &v106); - VAL x107; - uint64_t x108; - uint64_t x109; - VAL x110; - int64_t x111; - switch (get_data_tag(v105)) { - case 1LL: { // Some - VAL v112 = mtp_std_maybe_Maybe_1_Some(v105); - incref(v112); - uint64_t v113 = mw_mirth_label_Label_name(VU64(v112)); - int64_t v114 = 0LL; - VAL v115 = mw_mirth_data_dataZ_qname(v102, v113, v114); - VAL v116; - int64_t v117; - mw_mirth_name_QName_undefinedZ_softZAsk(v101, v115, &v116, &v117); - uint64_t x118; - uint64_t x119; - uint64_t x120; - VAL x121; - if (((bool)v117)) { - incref(v112); - VAL v122 = mw_mirth_label_Label_ZToStr(VU64(v112)); - int64_t v123 = 0LL; - VAL v124; - uint64_t v125; - mw_mirth_elab_dataZ_wordZ_newZBang(v116, v102, v122, v123, &v124, &v125); - incref(v112); - VAL v126 = mw_mirth_label_Label_ZToStr(VU64(v112)); - STR* v127; - STRLIT(v127, "!", 1); - STR* v128 = str_cat(VSTR(v126), v127); - int64_t v129 = 0LL; - VAL v130; - uint64_t v131; - mw_mirth_elab_dataZ_wordZ_newZBang(v124, v102, MKSTR(v128), v129, &v130, &v131); - incref(v112); - VAL v132 = mw_mirth_label_Label_ZToStr(VU64(v112)); - int64_t v133 = 1LL; - VAL v134; - uint64_t v135; - mw_mirth_elab_dataZ_wordZ_newZBang(v130, v102, v132, v133, &v134, &v135); - mw_mirth_word_Word_makeZ_inlineZBang(v125); - incref(v112); - VAL v136 = mtw_mirth_mirth_PropLabel_WordType(v125); - VAL v137 = MKNIL; - VAL v138 = mkcons(v137, MKU64(v103)); - VAL v139 = mkcons(v138, v112); - FNPTR v140 = &mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot45ZRParen_1; - VAL v141; - VAL v142; - mw_mirth_mirth_PropLabel_prop_1(v139, v136, v134, MKFNPTR(v140), &v141, &v142); - void* v143 = mfld_mirth_word_Word_ZTildectxZ_type(v125); - mut_set(v141, v143); - incref(v112); - VAL v144 = mtw_mirth_mirth_PropLabel_WordArrow(v125); - VAL v145 = MKNIL; - VAL v146 = mkcons(v145, MKU64(v103)); - VAL v147 = mkcons(v146, v112); - VAL v148 = mkcons(v147, MKU64(v125)); - FNPTR v149 = &mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot73ZRParen_1; - VAL v150; - VAL v151; - mw_mirth_mirth_PropLabel_prop_1(v148, v144, v142, MKFNPTR(v149), &v150, &v151); - void* v152 = mfld_mirth_word_Word_ZTildearrow(v125); - mut_set(v150, v152); - mw_mirth_word_Word_makeZ_inlineZBang(v131); - incref(v112); - VAL v153 = mtw_mirth_mirth_PropLabel_WordType(v131); - VAL v154 = MKNIL; - VAL v155 = mkcons(v154, MKU64(v103)); - VAL v156 = mkcons(v155, v112); - FNPTR v157 = &mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot106ZRParen_1; - VAL v158; - VAL v159; - mw_mirth_mirth_PropLabel_prop_1(v156, v153, v151, MKFNPTR(v157), &v158, &v159); - void* v160 = mfld_mirth_word_Word_ZTildectxZ_type(v131); - mut_set(v158, v160); - incref(v112); - VAL v161 = mtw_mirth_mirth_PropLabel_WordArrow(v131); - VAL v162 = MKNIL; - VAL v163 = mkcons(v162, MKU64(v103)); - VAL v164 = mkcons(v163, v112); - VAL v165 = mkcons(v164, MKU64(v131)); - FNPTR v166 = &mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot134ZRParen_1; - VAL v167; - VAL v168; - mw_mirth_mirth_PropLabel_prop_1(v165, v161, v159, MKFNPTR(v166), &v167, &v168); - void* v169 = mfld_mirth_word_Word_ZTildearrow(v131); - mut_set(v167, v169); - mw_mirth_word_Word_makeZ_inlineZBang(v135); - incref(v112); - VAL v170 = mtw_mirth_mirth_PropLabel_WordType(v135); - VAL v171 = MKNIL; - VAL v172 = mkcons(v171, MKU64(v103)); - VAL v173 = mkcons(v172, v112); - FNPTR v174 = &mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot167ZRParen_1; - VAL v175; - VAL v176; - mw_mirth_mirth_PropLabel_prop_1(v173, v170, v168, MKFNPTR(v174), &v175, &v176); - void* v177 = mfld_mirth_word_Word_ZTildectxZ_type(v135); - mut_set(v175, v177); - VAL v178 = mtw_mirth_mirth_PropLabel_WordParams(v135); - FNPTR v179 = &mb_mirth_elab_createZ_projectorsZBang_24; - VAL v180; - VAL v181; - mw_mirth_mirth_PropLabel_prop_1(MKU64(v135), v178, v176, MKFNPTR(v179), &v180, &v181); - void* v182 = mfld_mirth_word_Word_ZTildeparams(v135); - mut_set(v180, v182); - VAL v183 = mtw_mirth_mirth_PropLabel_WordArrow(v135); - VAL v184 = MKNIL; - VAL v185 = mkcons(v184, MKU64(v102)); - VAL v186 = mkcons(v185, MKU64(v125)); - VAL v187 = mkcons(v186, MKU64(v131)); - VAL v188 = mkcons(v187, MKU64(v135)); - FNPTR v189 = &mb_mirth_mirth_PropLabel_prop4_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot267ZRParen_1; - VAL v190; - VAL v191; - mw_mirth_mirth_PropLabel_prop_1(v188, v183, v181, MKFNPTR(v189), &v190, &v191); - void* v192 = mfld_mirth_word_Word_ZTildearrow(v135); - mut_set(v190, v192); - x121 = v191; - x120 = VU64(v112); - x119 = v102; - x118 = v103; + int64_t v6 = 1LL /* True */; + uint64_t v7 = x2; + VAL v8 = x1; + uint64_t v9 = v3; + VAL v10 = v5; + int64_t v11 = v6; + int64_t v12 = v6; + while (((bool)v12)) { + uint64_t v13 = v7; + VAL v14 = v8; + uint64_t v15 = v9; + VAL v16 = v10; + int64_t v17 = v11; + uint64_t x18; + uint64_t x19; + VAL x20; + VAL x21; + int64_t x22; + switch (get_data_tag(v16)) { + case 1LL: { // Cons + VAL v23; + VAL v24; + mtp_std_list_List_1_Cons(v16, &v23, &v24); + incref(v23); + uint64_t v25 = mw_mirth_label_Label_name(VU64(v23)); + int64_t v26 = 0LL; + VAL v27 = mw_mirth_data_dataZ_qname(v15, v25, v26); + VAL v28; + int64_t v29; + mw_mirth_name_QName_undefinedZ_softZAsk(v14, v27, &v28, &v29); + uint64_t x30; + uint64_t x31; + uint64_t x32; + VAL x33; + if (((bool)v29)) { + incref(v23); + VAL v34 = mw_mirth_label_Label_ZToStr(VU64(v23)); + int64_t v35 = 0LL; + VAL v36; + uint64_t v37; + mw_mirth_elab_dataZ_wordZ_newZBang(v28, v15, v34, v35, &v36, &v37); + incref(v23); + VAL v38 = mw_mirth_label_Label_ZToStr(VU64(v23)); + STR* v39; + STRLIT(v39, "!", 1); + STR* v40 = str_cat(VSTR(v38), v39); + int64_t v41 = 0LL; + VAL v42; + uint64_t v43; + mw_mirth_elab_dataZ_wordZ_newZBang(v36, v15, MKSTR(v40), v41, &v42, &v43); + incref(v23); + VAL v44 = mw_mirth_label_Label_ZToStr(VU64(v23)); + int64_t v45 = 1LL; + VAL v46; + uint64_t v47; + mw_mirth_elab_dataZ_wordZ_newZBang(v42, v15, v44, v45, &v46, &v47); + mw_mirth_word_Word_makeZ_inlineZBang(v37); + incref(v23); + VAL v48 = mtw_mirth_mirth_PropLabel_WordType(v37); + VAL v49 = MKNIL; + VAL v50 = mkcons(v49, MKU64(v13)); + VAL v51 = mkcons(v50, v23); + FNPTR v52 = &mb_mirth_mirth_PropLabel_prop_1_sp11_3; + VAL v53 = mtw_mirth_mirth_PropState_1_PSDelay(v51, MKFNPTR(v52)); + VAL v54 = mtw_mirth_mirth_Prop_1_Prop(v48, v53); + void* v55 = mfld_mirth_word_Word_ZTildectxZ_type(v37); + mut_set(v54, v55); + incref(v23); + VAL v56 = mtw_mirth_mirth_PropLabel_WordArrow(v37); + VAL v57 = MKNIL; + VAL v58 = mkcons(v57, MKU64(v13)); + VAL v59 = mkcons(v58, v23); + VAL v60 = mkcons(v59, MKU64(v37)); + FNPTR v61 = &mb_mirth_mirth_PropLabel_prop_1_sp10_5; + VAL v62 = mtw_mirth_mirth_PropState_1_PSDelay(v60, MKFNPTR(v61)); + VAL v63 = mtw_mirth_mirth_Prop_1_Prop(v56, v62); + void* v64 = mfld_mirth_word_Word_ZTildearrow(v37); + mut_set(v63, v64); + mw_mirth_word_Word_makeZ_inlineZBang(v43); + incref(v23); + VAL v65 = mtw_mirth_mirth_PropLabel_WordType(v43); + VAL v66 = MKNIL; + VAL v67 = mkcons(v66, MKU64(v13)); + VAL v68 = mkcons(v67, v23); + FNPTR v69 = &mb_mirth_mirth_PropLabel_prop_1_sp9_3; + VAL v70 = mtw_mirth_mirth_PropState_1_PSDelay(v68, MKFNPTR(v69)); + VAL v71 = mtw_mirth_mirth_Prop_1_Prop(v65, v70); + void* v72 = mfld_mirth_word_Word_ZTildectxZ_type(v43); + mut_set(v71, v72); + incref(v23); + VAL v73 = mtw_mirth_mirth_PropLabel_WordArrow(v43); + VAL v74 = MKNIL; + VAL v75 = mkcons(v74, MKU64(v13)); + VAL v76 = mkcons(v75, v23); + VAL v77 = mkcons(v76, MKU64(v43)); + FNPTR v78 = &mb_mirth_mirth_PropLabel_prop_1_sp8_5; + VAL v79 = mtw_mirth_mirth_PropState_1_PSDelay(v77, MKFNPTR(v78)); + VAL v80 = mtw_mirth_mirth_Prop_1_Prop(v73, v79); + void* v81 = mfld_mirth_word_Word_ZTildearrow(v43); + mut_set(v80, v81); + mw_mirth_word_Word_makeZ_inlineZBang(v47); + incref(v23); + VAL v82 = mtw_mirth_mirth_PropLabel_WordType(v47); + VAL v83 = MKNIL; + VAL v84 = mkcons(v83, MKU64(v13)); + VAL v85 = mkcons(v84, v23); + FNPTR v86 = &mb_mirth_mirth_PropLabel_prop_1_sp7_1; + VAL v87 = mtw_mirth_mirth_PropState_1_PSDelay(v85, MKFNPTR(v86)); + VAL v88 = mtw_mirth_mirth_Prop_1_Prop(v82, v87); + void* v89 = mfld_mirth_word_Word_ZTildectxZ_type(v47); + mut_set(v88, v89); + VAL v90 = mtw_mirth_mirth_PropLabel_WordParams(v47); + FNPTR v91 = &mb_mirth_mirth_PropLabel_prop_1_sp5_2; + VAL v92 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(v47), MKFNPTR(v91)); + VAL v93 = mtw_mirth_mirth_Prop_1_Prop(v90, v92); + void* v94 = mfld_mirth_word_Word_ZTildeparams(v47); + mut_set(v93, v94); + VAL v95 = mtw_mirth_mirth_PropLabel_WordArrow(v47); + VAL v96 = MKNIL; + VAL v97 = mkcons(v96, MKU64(v15)); + VAL v98 = mkcons(v97, MKU64(v37)); + VAL v99 = mkcons(v98, MKU64(v43)); + VAL v100 = mkcons(v99, MKU64(v47)); + FNPTR v101 = &mb_mirth_mirth_PropLabel_prop_1_sp6_9; + VAL v102 = mtw_mirth_mirth_PropState_1_PSDelay(v100, MKFNPTR(v101)); + VAL v103 = mtw_mirth_mirth_Prop_1_Prop(v95, v102); + void* v104 = mfld_mirth_word_Word_ZTildearrow(v47); + mut_set(v103, v104); + x33 = v46; + x32 = v15; + x31 = VU64(v23); + x30 = v13; } else { - x121 = v116; - x120 = VU64(v112); - x119 = v102; - x118 = v103; + x33 = v28; + x32 = v15; + x31 = VU64(v23); + x30 = v13; } - int64_t v193 = 1LL /* True */; - x111 = v193; - x110 = v106; - x109 = x118; - x108 = x119; - x107 = x121; + int64_t v105 = 1LL /* True */; + x22 = v105; + x21 = v24; + x20 = x33; + x19 = x32; + x18 = x30; } break; - case 0LL: { // None - int64_t v194 = 0LL /* False */; - x111 = v194; - x110 = v106; - x109 = v103; - x108 = v102; - x107 = v101; + case 0LL: { // Nil + VAL v106 = MKI64(0LL /* Nil */); + int64_t v107 = 0LL /* False */; + x22 = v107; + x21 = v106; + x20 = v14; + x19 = v15; + x18 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v100 = x111; - v99 = x110; - v98 = x109; - v97 = x108; - v96 = x107; + v12 = x22; + v11 = x22; + v10 = x21; + v9 = x19; + v8 = x20; + v7 = x18; } - decref(v99); - return v96; + decref(v10); + return v8; } static void mw_mirth_elab_expectZ_tokenZ_arrow (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { int64_t v5 = mw_mirth_token_Token_arrowZAsk(x2); - VAL x6; - uint64_t x7; + uint64_t x6; + VAL x7; if (((bool)v5)) { - x7 = x2; - x6 = x1; + x7 = x1; + x6 = x2; } else { STR* v8; STRLIT(v8, "Expected arrow.", 15); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v8), x1); - uint64_t v9 = pop_u64(); - x7 = v9; - VAL r10 = pop_resource(); - x6 = r10; } - *x4 = x7; - *x3 = x6; + *x4 = x6; + *x3 = x7; } static void mw_mirth_elab_parseZ_alias (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, uint64_t *x5, uint64_t *x6, VAL *x7) { uint64_t v8 = mw_mirth_token_Token_succ(x2); VAL v9 = mw_mirth_token_Token_lparenZAsk(v8); - int64_t v10 = mw_std_maybe_Maybe_1_ZToBool(v9); - int64_t x11; - uint64_t x12; - VAL x13; + int64_t v10 = get_data_tag(v9); + decref(v9); + int64_t v11 = 1LL; + bool v12 = (v10 == v11); + int64_t x13; uint64_t x14; - uint64_t x15; - if (((bool)v10)) { - uint64_t v16 = mw_mirth_token_Token_next(x2); - uint64_t v17; - uint64_t v18; - VAL v19; - mw_mirth_token_Token_argsZ_2(x2, x1, &v17, &v18, &v19); - x15 = v17; + VAL x15; + uint64_t x16; + uint64_t x17; + if (v12) { + uint64_t v18 = mw_mirth_token_Token_next(x2); + uint64_t v19; + uint64_t v20; + VAL v21; + mw_mirth_token_Token_argsZ_2(x2, x1, &v19, &v20, &v21); + x17 = v19; + x16 = v20; + x15 = v21; x14 = v18; - x13 = v19; - x12 = v16; - x11 = v10; + x13 = ((int64_t)v12); } else { - uint64_t v20 = mw_mirth_token_Token_next(x2); - uint64_t v21 = mw_mirth_token_Token_next(v20); - uint64_t v22 = mw_mirth_token_Token_next(v21); - x15 = v20; - x14 = v21; - x13 = x1; - x12 = v22; - x11 = v10; + uint64_t v22 = mw_mirth_token_Token_next(x2); + uint64_t v23 = mw_mirth_token_Token_next(v22); + uint64_t v24 = mw_mirth_token_Token_next(v23); + x17 = v22; + x16 = v23; + x15 = x1; + x14 = v24; + x13 = ((int64_t)v12); } - VAL v23 = mw_mirth_token_Token_nameZDivdnameZAsk(x15); - int64_t x24; - uint64_t x25; - VAL x26; - uint64_t x27; - uint64_t x28; - switch (get_data_tag(v23)) { - case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v23); - decref(v29); - x28 = x15; - x27 = x14; - x26 = x13; - x25 = x12; - x24 = x11; - } break; - case 0LL: { // None - STR* v30; - STRLIT(v30, "expected alias name", 19); - lpush(&lbl_hasZ_paren, MKI64(x11)); - push_u64(x12); - lpush(&lbl_target, MKU64(x14)); - lpush(&lbl_head, MKU64(x15)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x15, MKSTR(v30), x13); - uint64_t v31 = VU64(lpop(&lbl_head)); - x28 = v31; - uint64_t v32 = VU64(lpop(&lbl_target)); - x27 = v32; - VAL r33 = pop_resource(); - x26 = r33; - uint64_t v34 = pop_u64(); - x25 = v34; - int64_t v35 = VI64(lpop(&lbl_hasZ_paren)); - x24 = v35; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + VAL v25 = mw_mirth_token_Token_nameZDivdnameZAsk(x17); + int64_t v26 = get_data_tag(v25); + decref(v25); + int64_t v27 = 0LL; + bool v28 = (v26 == v27); + VAL x29; + uint64_t x30; + if (v28) { + STR* v31; + STRLIT(v31, "expected alias name", 19); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x17, MKSTR(v31), x15); + } else { + x30 = x17; + x29 = x15; } - VAL v36 = mw_mirth_token_Token_nameZDivdnameZAsk(x27); - int64_t x37; - uint64_t x38; - VAL x39; - uint64_t x40; - uint64_t x41; - VAL x42; - switch (get_data_tag(v36)) { + VAL v33 = mw_mirth_token_Token_nameZDivdnameZAsk(x16); + VAL x34; + uint64_t x35; + VAL x36; + switch (get_data_tag(v33)) { case 1LL: { // Some - VAL v43 = mtp_std_maybe_Maybe_1_Some(v36); - x42 = v43; - x41 = x27; - x40 = x28; - x39 = x26; - x38 = x25; - x37 = x24; + VAL v37 = mtp_std_maybe_Maybe_1_Some(v33); + x36 = v37; + x35 = x16; + x34 = x29; } break; case 0LL: { // None - STR* v44; - STRLIT(v44, "expected alias target, which must be a name", 43); - lpush(&lbl_hasZ_paren, MKI64(x24)); - push_u64(x25); - lpush(&lbl_head, MKU64(x28)); - lpush(&lbl_target, MKU64(x27)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x27, MKSTR(v44), x26); - VAL v45 = pop_value(); - x42 = v45; - uint64_t v46 = VU64(lpop(&lbl_target)); - x41 = v46; - uint64_t v47 = VU64(lpop(&lbl_head)); - x40 = v47; - VAL r48 = pop_resource(); - x39 = r48; - uint64_t v49 = pop_u64(); - x38 = v49; - int64_t v50 = VI64(lpop(&lbl_hasZ_paren)); - x37 = v50; + STR* v38; + STRLIT(v38, "expected alias target, which must be a name", 43); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x16, MKSTR(v38), x29); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v51 = (mw_mirth_token_Token_argsZ_0(x41, x39)); - uint64_t x52; - uint64_t x53; - VAL x54; - uint64_t x55; - VAL x56; - int64_t x57; - if (((bool)x37)) { - uint64_t v58 = mw_mirth_token_Token_next(x40); - int64_t v59 = mw_mirth_token_Token_argZ_endZAsk(v58); - uint64_t x60; - VAL x61; - uint64_t x62; - VAL x63; - int64_t x64; - uint64_t x65; - if (((bool)v59)) { - x65 = x40; - x64 = x37; - x63 = v51; - x62 = x41; - x61 = x42; - x60 = x38; + VAL v41 = mw_mirth_token_Token_argsZ_0(x35, x34); + VAL x42; + uint64_t x43; + uint64_t x44; + if (((bool)x13)) { + uint64_t v45 = mw_mirth_token_Token_next(x30); + int64_t v46 = mw_mirth_token_Token_argZ_endZAsk(v45); + VAL x47; + uint64_t x48; + if (((bool)v46)) { + x48 = x30; + x47 = v41; } else { - STR* v66; - STRLIT(v66, "expected comma after alias name", 31); - push_u64(x38); - lpush(&lbl_nameZDivdname, x42); - lpush(&lbl_target, MKU64(x41)); - lpush(&lbl_hasZ_paren, MKI64(x37)); - lpush(&lbl_head, MKU64(x40)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x40, MKSTR(v66), v51); - uint64_t v67 = VU64(lpop(&lbl_head)); - x65 = v67; - int64_t v68 = VI64(lpop(&lbl_hasZ_paren)); - x64 = v68; - VAL r69 = pop_resource(); - x63 = r69; - uint64_t v70 = VU64(lpop(&lbl_target)); - x62 = v70; - VAL v71 = lpop(&lbl_nameZDivdname); - x61 = v71; - uint64_t v72 = pop_u64(); - x60 = v72; - } - uint64_t v73 = mw_mirth_token_Token_succ(x62); - int64_t v74 = mw_mirth_token_Token_argZ_endZAsk(v73); - uint64_t x75; - VAL x76; - VAL x77; - int64_t x78; - uint64_t x79; - uint64_t x80; - if (((bool)v74)) { - x80 = x62; - x79 = x65; - x78 = x64; - x77 = x63; - x76 = x61; - x75 = x60; + STR* v49; + STRLIT(v49, "expected comma after alias name", 31); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x30, MKSTR(v49), v41); + } + uint64_t v51 = mw_mirth_token_Token_succ(x35); + int64_t v52 = mw_mirth_token_Token_argZ_endZAsk(v51); + VAL x53; + uint64_t x54; + if (((bool)v52)) { + x54 = x48; + x53 = x47; } else { - STR* v81; - STRLIT(v81, "expected end of arguments after alias target", 44); - push_u64(x60); - lpush(&lbl_nameZDivdname, x61); - lpush(&lbl_hasZ_paren, MKI64(x64)); - lpush(&lbl_target, MKU64(x62)); - lpush(&lbl_head, MKU64(x65)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x65, MKSTR(v81), x63); - uint64_t v82 = VU64(lpop(&lbl_target)); - x80 = v82; - uint64_t v83 = VU64(lpop(&lbl_head)); - x79 = v83; - int64_t v84 = VI64(lpop(&lbl_hasZ_paren)); - x78 = v84; - VAL r85 = pop_resource(); - x77 = r85; - VAL v86 = lpop(&lbl_nameZDivdname); - x76 = v86; - uint64_t v87 = pop_u64(); - x75 = v87; - } - x57 = x78; - x56 = x77; - x55 = x80; - x54 = x76; - x53 = x79; - x52 = x75; + STR* v55; + STRLIT(v55, "expected end of arguments after alias target", 44); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x48, MKSTR(v55), x47); + } + x44 = x35; + x43 = x54; + x42 = x53; } else { - x57 = x37; - x56 = v51; - x55 = x41; - x54 = x42; - x53 = x40; - x52 = x38; - } - *x7 = x54; - *x6 = x55; - *x5 = x53; - *x4 = x52; - *x3 = x56; + x44 = x35; + x43 = x30; + x42 = v41; + } + *x7 = x36; + *x6 = x44; + *x5 = x43; + *x4 = x14; + *x3 = x42; } static void mw_mirth_elab_elabZ_aliasZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { VAL v5; @@ -57034,52 +42155,47 @@ static void mw_mirth_elab_elabZ_aliasZBang (VAL x1, uint64_t x2, VAL *x3, uint64 VAL v22 = mkcons(v21, v9); VAL v23 = mkcons(v22, MKU64(v8)); VAL v24 = mkcons(v23, MKU64(v16)); - FNPTR v25 = &mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotelabZ_aliasZBangZDot21ZRParen_1; - VAL v26; - VAL v27; - mw_mirth_mirth_PropLabel_prop_1(v24, v20, v15, MKFNPTR(v25), &v26, &v27); + FNPTR v25 = &mb_mirth_mirth_PropLabel_prop_1_sp22_6; + VAL v26 = mtw_mirth_mirth_PropState_1_PSDelay(v24, MKFNPTR(v25)); + VAL v27 = mtw_mirth_mirth_Prop_1_Prop(v20, v26); void* v28 = mfld_mirth_alias_Alias_ZTildetarget(v16); - mut_set(v26, v28); + mut_set(v27, v28); *x4 = v6; - *x3 = v27; + *x3 = v15; } static void mw_mirth_elab_elabZ_defZ_missingZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { VAL v5 = mw_mirth_token_Token_args(x2); int64_t v6 = mw_std_list_List_1_len(v5); int64_t v7 = 3LL; bool v8 = (v6 < v7); - VAL x9; - uint64_t x10; + uint64_t x9; + VAL x10; if (v8) { STR* v11; STRLIT(v11, "def-missing expects at least three arguments", 44); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v11), x1); - uint64_t v12 = pop_u64(); - x10 = v12; - VAL r13 = pop_resource(); - x9 = r13; } else { - x10 = x2; - x9 = x1; + x10 = x1; + x9 = x2; } - uint64_t v14 = mw_mirth_token_Token_succ(x10); + uint64_t v14 = mw_mirth_token_Token_succ(x9); uint64_t v15 = mw_mirth_token_Token_succ(v14); VAL v16; VAL v17; - mw_mirth_elab_elabZ_defZ_qname(x9, v15, &v16, &v17); + mw_mirth_elab_elabZ_defZ_qname(x10, v15, &v16, &v17); VAL v18; int64_t v19; mw_mirth_name_QName_definedZ_hardZAsk(v16, v17, &v18, &v19); VAL x20; uint64_t x21; if (((bool)v19)) { - uint64_t v22 = mw_mirth_token_Token_next(x10); + uint64_t v22 = mw_mirth_token_Token_next(x9); x21 = v22; x20 = v18; } else { VAL v23; uint64_t v24; - mw_mirth_elab_elabZ_defZBang(v18, x10, &v23, &v24); + mw_mirth_elab_elabZ_defZBang(v18, x9, &v23, &v24); x21 = v24; x20 = v23; } @@ -57096,17 +42212,17 @@ static void mw_mirth_elab_elabZ_inlineZBang (uint64_t x1, int64_t x2, VAL x3, ui VTUP(v9)->cells[3] = MKI64(v11); int64_t v12 = mw_mirth_token_Token_argZ_endZAsk(v8); bool v13 = !((bool)v12); - int64_t v14 = (x2); + int64_t v14 = x2; uint64_t v15 = v7; int64_t v16 = v10; - VAL v17 = (v9); + VAL v17 = v9; uint64_t v18 = v8; bool v19 = v13; while (v19) { - int64_t v20 = (v14); + int64_t v20 = v14; uint64_t v21 = v15; int64_t v22 = v16; - VAL v23 = (v17); + VAL v23 = v17; uint64_t v24 = v18; uint64_t v25; int64_t v26; @@ -57142,315 +42258,176 @@ static void mw_mirth_elab_parseZ_def (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4 uint64_t v15 = mw_mirth_token_Token_next(x2); uint64_t v16 = mw_mirth_token_Token_next(v15); VAL v17 = mw_mirth_token_Token_lsquareZAsk(v16); - uint64_t x18; - VAL x19; - VAL x20; - uint64_t x21; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v17); - decref(v22); - uint64_t v23; - VAL v24; - mw_mirth_token_Token_argsZ_1(v16, x1, &v23, &v24); - VAL v25 = mtw_std_maybe_Maybe_1_Some(MKU64(v23)); - uint64_t v26 = mw_mirth_token_Token_next(v16); - x21 = v26; - x20 = v25; - x19 = v24; - x18 = v15; - } break; - case 0LL: { // None - VAL v27 = MKI64(0LL /* None */); - x21 = v16; - x20 = v27; - x19 = x1; - x18 = v15; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v18 = get_data_tag(v17); + decref(v17); + int64_t v19 = 1LL; + bool v20 = (v18 == v19); + VAL x21; + VAL x22; + uint64_t x23; + if (v20) { + uint64_t v24; + VAL v25; + mw_mirth_token_Token_argsZ_1(v16, x1, &v24, &v25); + VAL v26 = mtw_std_maybe_Maybe_1_Some(MKU64(v24)); + uint64_t v27 = mw_mirth_token_Token_next(v16); + x23 = v27; + x22 = v26; + x21 = v25; + } else { + VAL v28 = MKI64(0LL /* None */); + x23 = v16; + x22 = v28; + x21 = x1; } - VAL v28 = mw_mirth_token_Token_lcurlyZAsk(x21); - uint64_t x29; - VAL x30; - VAL x31; - uint64_t x32; - switch (get_data_tag(v28)) { - case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v28); - decref(v33); - x32 = x21; - x31 = x20; - x30 = x19; - x29 = x18; - } break; - case 0LL: { // None - STR* v34; - STRLIT(v34, "expected { ... }", 16); - lpush(&lbl_head, MKU64(x18)); - lpush(&lbl_sigZAsk, x20); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x21, MKSTR(v34), x19); - uint64_t v35 = pop_u64(); - x32 = v35; - VAL v36 = lpop(&lbl_sigZAsk); - x31 = v36; - VAL r37 = pop_resource(); - x30 = r37; - uint64_t v38 = VU64(lpop(&lbl_head)); - x29 = v38; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + VAL v29 = mw_mirth_token_Token_lcurlyZAsk(x23); + int64_t v30 = get_data_tag(v29); + decref(v29); + int64_t v31 = 0LL; + bool v32 = (v30 == v31); + uint64_t x33; + VAL x34; + if (v32) { + STR* v35; + STRLIT(v35, "expected { ... }", 16); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x23, MKSTR(v35), x21); + } else { + x34 = x21; + x33 = x23; } + VAL v38; VAL v39; - VAL v40; - mw_mirth_token_Token_argsZPlus(x32, x30, &v39, &v40); - uint64_t v41 = mw_mirth_token_Token_next(x32); - x14 = v41; - x13 = v39; - x12 = v40; - x11 = x31; - x10 = x29; + mw_mirth_token_Token_argsZPlus(x33, x34, &v38, &v39); + uint64_t v40 = mw_mirth_token_Token_next(x33); + x14 = v40; + x13 = v38; + x12 = v39; + x11 = x22; + x10 = v15; } else { - uint64_t v42 = mw_mirth_token_Token_next(x2); - VAL v43 = mw_mirth_token_Token_args(x2); - incref(v43); - int64_t v44 = mw_std_list_List_1_len(v43); - int64_t v45 = 3LL; - bool v46 = (v44 < v45); + uint64_t v41 = mw_mirth_token_Token_next(x2); + VAL v42 = mw_mirth_token_Token_args(x2); + incref(v42); + int64_t v43 = mw_std_list_List_1_len(v42); + int64_t v44 = 3LL; + bool v45 = (v43 < v44); + uint64_t x46; VAL x47; - uint64_t x48; - uint64_t x49; - VAL x50; - if (v46) { - decref(v43); - STR* v51; - STRLIT(v51, "def(...) expects at least three arguments", 41); - push_u64(v42); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v51), x1); - VAL v52 = pop_value(); - x50 = v52; - uint64_t v53 = pop_u64(); - x49 = v53; - uint64_t v54 = pop_u64(); - x48 = v54; - VAL r55 = pop_resource(); - x47 = r55; + VAL x48; + if (v45) { + decref(v42); + STR* v49; + STRLIT(v49, "def(...) expects at least three arguments", 41); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v49), x1); } else { - x50 = v43; - x49 = x2; x48 = v42; x47 = x1; + x46 = x2; } - VAL v56 = mw_std_list_List_1_ZToListZPlus(x50); - VAL x57; - uint64_t x58; - VAL x59; - switch (get_data_tag(v56)) { + VAL v53 = mw_std_list_List_1_ZToListZPlus(x48); + VAL x54; + switch (get_data_tag(v53)) { case 1LL: { // Some - VAL v60 = mtp_std_maybe_Maybe_1_Some(v56); - x59 = v60; - x58 = x48; - x57 = x47; + VAL v55 = mtp_std_maybe_Maybe_1_Some(v53); + x54 = v55; } break; case 0LL: { // None - STR* v61; - STRLIT(v61, "Impossible! The impossible has occured!", 39); - push_resource(x47); - push_u64(x48); - do_panic(v61); - VAL v62 = pop_value(); - x59 = v62; - uint64_t v63 = pop_u64(); - x58 = v63; - VAL r64 = pop_resource(); - x57 = r64; + mw_std_prelude_impossibleZBang(); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v65; - VAL v66; - mw_std_list_ListZPlus_1_uncons(x59, &v65, &v66); - VAL v67 = mw_std_list_List_1_ZToListZPlus(v66); - VAL x68; - uint64_t x69; - uint64_t x70; - VAL x71; - switch (get_data_tag(v67)) { + VAL v57; + VAL v58; + mw_std_list_ListZPlus_1_uncons(x54, &v57, &v58); + VAL v59 = mw_std_list_List_1_ZToListZPlus(v58); + VAL x60; + switch (get_data_tag(v59)) { case 1LL: { // Some - VAL v72 = mtp_std_maybe_Maybe_1_Some(v67); - x71 = v72; - x70 = VU64(v65); - x69 = x58; - x68 = x57; + VAL v61 = mtp_std_maybe_Maybe_1_Some(v59); + x60 = v61; } break; case 0LL: { // None - STR* v73; - STRLIT(v73, "Impossible! The impossible has occured!", 39); - push_resource(x57); - push_u64(x58); - lpush(&lbl_head, v65); - do_panic(v73); - VAL v74 = pop_value(); - x71 = v74; - uint64_t v75 = VU64(lpop(&lbl_head)); - x70 = v75; - uint64_t v76 = pop_u64(); - x69 = v76; - VAL r77 = pop_resource(); - x68 = r77; + mw_std_prelude_impossibleZBang(); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v78; - VAL v79; - mw_std_list_ListZPlus_1_uncons(x71, &v78, &v79); - VAL v80 = mtw_std_maybe_Maybe_1_Some(v78); - VAL v81 = mw_std_list_List_1_ZToListZPlus(v79); - VAL x82; - uint64_t x83; - uint64_t x84; - VAL x85; - VAL x86; - switch (get_data_tag(v81)) { + VAL v63; + VAL v64; + mw_std_list_ListZPlus_1_uncons(x60, &v63, &v64); + VAL v65 = mtw_std_maybe_Maybe_1_Some(v63); + VAL v66 = mw_std_list_List_1_ZToListZPlus(v64); + VAL x67; + switch (get_data_tag(v66)) { case 1LL: { // Some - VAL v87 = mtp_std_maybe_Maybe_1_Some(v81); - x86 = v87; - x85 = v80; - x84 = x70; - x83 = x69; - x82 = x68; + VAL v68 = mtp_std_maybe_Maybe_1_Some(v66); + x67 = v68; } break; case 0LL: { // None - STR* v88; - STRLIT(v88, "Impossible! The impossible has occured!", 39); - push_resource(x68); - push_u64(x69); - lpush(&lbl_head, MKU64(x70)); - lpush(&lbl_sigZAsk, v80); - do_panic(v88); - VAL v89 = pop_value(); - x86 = v89; - VAL v90 = lpop(&lbl_sigZAsk); - x85 = v90; - uint64_t v91 = VU64(lpop(&lbl_head)); - x84 = v91; - uint64_t v92 = pop_u64(); - x83 = v92; - VAL r93 = pop_resource(); - x82 = r93; + mw_std_prelude_impossibleZBang(); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t v94 = mw_mirth_token_Token_next(x84); - int64_t v95 = mw_mirth_token_Token_argZ_endZAsk(v94); - VAL x96; - uint64_t x97; - VAL x98; - VAL x99; - uint64_t x100; - if (((bool)v95)) { - x100 = x84; - x99 = x86; - x98 = x85; - x97 = x83; - x96 = x82; + incref(v57); + uint64_t v70 = mw_mirth_token_Token_next(VU64(v57)); + int64_t v71 = mw_mirth_token_Token_argZ_endZAsk(v70); + VAL x72; + uint64_t x73; + if (((bool)v71)) { + x73 = VU64(v57); + x72 = x47; } else { - uint64_t v101 = mw_mirth_token_Token_next(x84); - STR* v102; - STRLIT(v102, "expected comma after word name", 30); - push_u64(x83); - lpush(&lbl_sigZAsk, x85); - lpush(&lbl_body, x86); - lpush(&lbl_head, MKU64(x84)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v101, MKSTR(v102), x82); - uint64_t v103 = VU64(lpop(&lbl_head)); - x100 = v103; - VAL v104 = lpop(&lbl_body); - x99 = v104; - VAL v105 = lpop(&lbl_sigZAsk); - x98 = v105; - uint64_t v106 = pop_u64(); - x97 = v106; - VAL r107 = pop_resource(); - x96 = r107; - } - x14 = x97; - x13 = x99; - x12 = x96; - x11 = x98; - x10 = x100; + incref(v57); + uint64_t v74 = mw_mirth_token_Token_next(VU64(v57)); + STR* v75; + STRLIT(v75, "expected comma after word name", 30); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v74, MKSTR(v75), x47); + } + x14 = v41; + x13 = x67; + x12 = x72; + x11 = v65; + x10 = x73; } - VAL v108; - VAL v109; - mw_std_list_ListZPlus_1_uncons(x13, &v108, &v109); - int64_t v110 = mw_std_list_List_1_emptyZAsk(v109); - uint64_t x111; - VAL x112; - VAL x113; - uint64_t x114; - uint64_t x115; - int64_t x116; - if (((bool)v110)) { - int64_t v117 = 1LL /* True */; - x116 = v117; - x115 = VU64(v108); - x114 = x14; - x113 = x12; - x112 = x11; - x111 = x10; + VAL v77; + VAL v78; + mw_std_list_ListZPlus_1_uncons(x13, &v77, &v78); + int64_t v79 = mw_std_list_List_1_emptyZAsk(v78); + uint64_t x80; + int64_t x81; + if (((bool)v79)) { + int64_t v82 = 1LL /* True */; + x81 = v82; + x80 = VU64(v77); } else { - incref(v108); - VAL v118 = mw_mirth_token_Token_runZ_arrowZAsk(VU64(v108)); - int64_t v119 = mw_std_maybe_Maybe_1_ZToBool(v118); - x116 = v119; - x115 = VU64(v108); - x114 = x14; - x113 = x12; - x112 = x11; - x111 = x10; - } - uint64_t x120; - VAL x121; - VAL x122; - uint64_t x123; - uint64_t x124; - if (((bool)x116)) { - x124 = x115; - x123 = x114; - x122 = x113; - x121 = x112; - x120 = x111; + incref(v77); + VAL v83 = mw_mirth_token_Token_runZ_arrowZAsk(VU64(v77)); + int64_t v84 = get_data_tag(v83); + decref(v83); + int64_t v85 = 1LL; + bool v86 = (v84 == v85); + x81 = ((int64_t)v86); + x80 = VU64(v77); + } + uint64_t x87; + VAL x88; + if (((bool)x81)) { + x88 = x12; + x87 = x80; } else { - STR* v125; - STRLIT(v125, "expected match case", 19); - lpush(&lbl_head, MKU64(x111)); - lpush(&lbl_sigZAsk, x112); - push_u64(x114); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x115, MKSTR(v125), x113); - uint64_t v126 = pop_u64(); - x124 = v126; - uint64_t v127 = pop_u64(); - x123 = v127; - VAL r128 = pop_resource(); - x122 = r128; - VAL v129 = lpop(&lbl_sigZAsk); - x121 = v129; - uint64_t v130 = VU64(lpop(&lbl_head)); - x120 = v130; - } - VAL v131 = mtw_mirth_elab_SyntaxDef_SyntaxDef(x120, x121, x124); - *x5 = v131; - *x4 = x123; - *x3 = x122; + STR* v89; + STRLIT(v89, "expected match case", 19); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x80, MKSTR(v89), x12); + } + VAL v92 = mtw_mirth_elab_SyntaxDef_SyntaxDef(x10, x11, x87); + *x5 = v92; + *x4 = x14; + *x3 = x88; } static void mw_mirth_elab_elabZ_defZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { VAL v5; @@ -57478,104 +42455,77 @@ static void mw_mirth_elab_elabZ_defZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t void* v22 = mfld_mirth_word_Word_ZTildepreferZ_inlineZAsk(v16); mut_set(MKI64(v21), v22); VAL v23 = mtw_mirth_mirth_PropLabel_WordType(v16); - FNPTR v24 = &mb_mirth_elab_elabZ_defZBang_0; - VAL v25; - VAL v26; - mw_mirth_mirth_PropLabel_prop_1(MKU64(v16), v23, v17, MKFNPTR(v24), &v25, &v26); + FNPTR v24 = &mb_mirth_mirth_PropLabel_prop_1_sp18_1; + VAL v25 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(v16), MKFNPTR(v24)); + VAL v26 = mtw_mirth_mirth_Prop_1_Prop(v23, v25); void* v27 = mfld_mirth_word_Word_ZTildectxZ_type(v16); - mut_set(v25, v27); + mut_set(v26, v27); VAL v28 = mtw_mirth_mirth_PropLabel_WordParams(v16); - FNPTR v29 = &mb_mirth_elab_elabZ_defZBang_2; - VAL v30; - VAL v31; - mw_mirth_mirth_PropLabel_prop_1(MKU64(v16), v28, v26, MKFNPTR(v29), &v30, &v31); + FNPTR v29 = &mb_mirth_mirth_PropLabel_prop_1_sp19_0; + VAL v30 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(v16), MKFNPTR(v29)); + VAL v31 = mtw_mirth_mirth_Prop_1_Prop(v28, v30); void* v32 = mfld_mirth_word_Word_ZTildeparams(v16); - mut_set(v30, v32); + mut_set(v31, v32); VAL v33 = mtw_mirth_mirth_PropLabel_WordArrow(v16); - FNPTR v34 = &mb_mirth_elab_elabZ_defZBang_3; - VAL v35; - VAL v36; - mw_mirth_mirth_PropLabel_prop_1(MKU64(v16), v33, v31, MKFNPTR(v34), &v35, &v36); + FNPTR v34 = &mb_mirth_mirth_PropLabel_prop_1_sp20_5; + VAL v35 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(v16), MKFNPTR(v34)); + VAL v36 = mtw_mirth_mirth_Prop_1_Prop(v33, v35); void* v37 = mfld_mirth_word_Word_ZTildearrow(v16); - mut_set(v35, v37); + mut_set(v36, v37); *x4 = v6; - *x3 = v36; + *x3 = v17; } static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang (VAL x1, uint64_t x2, VAL x3) { VAL v4 = VVAL(VTUP(x3)->cells[7]); incref(v4); decref(x3); - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(v4, &v5, &v6); - VAL x7; - uint64_t x8; - VAL x9; - int64_t x10; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v5); - VAL v12 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_atomZBang(x1, x2, v11)); - int64_t v13 = 1LL /* True */; - x10 = v13; - x9 = v6; - x8 = x2; - x7 = v12; - } break; - case 0LL: { // None - int64_t v14 = 0LL /* False */; - x10 = v14; - x9 = v6; - x8 = x2; - x7 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v15 = (x7); - uint64_t v16 = x8; - VAL v17 = x9; - int64_t v18 = x10; - while (((bool)v18)) { - VAL v19 = (v15); - uint64_t v20 = v16; - VAL v21 = v17; - VAL v22; - VAL v23; - mw_std_list_List_1_uncons(v21, &v22, &v23); - VAL x24; - uint64_t x25; - VAL x26; - int64_t x27; - switch (get_data_tag(v22)) { - case 1LL: { // Some - VAL v28 = mtp_std_maybe_Maybe_1_Some(v22); - VAL v29 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_atomZBang(v19, v20, v28)); - int64_t v30 = 1LL /* True */; - x27 = v30; - x26 = v23; - x25 = v20; - x24 = v29; + int64_t v5 = 1LL /* True */; + VAL v6 = x1; + uint64_t v7 = x2; + VAL v8 = v4; + int64_t v9 = v5; + int64_t v10 = v5; + while (((bool)v10)) { + VAL v11 = v6; + uint64_t v12 = v7; + VAL v13 = v8; + int64_t v14 = v9; + uint64_t x15; + VAL x16; + VAL x17; + int64_t x18; + switch (get_data_tag(v13)) { + case 1LL: { // Cons + VAL v19; + VAL v20; + mtp_std_list_List_1_Cons(v13, &v19, &v20); + VAL v21 = mw_mirth_elab_checkZ_inlineZ_recursionZ_atomZBang(v11, v12, v19); + int64_t v22 = 1LL /* True */; + x18 = v22; + x17 = v20; + x16 = v21; + x15 = v12; } break; - case 0LL: { // None - int64_t v31 = 0LL /* False */; - x27 = v31; - x26 = v23; - x25 = v20; - x24 = v19; + case 0LL: { // Nil + VAL v23 = MKI64(0LL /* Nil */); + int64_t v24 = 0LL /* False */; + x18 = v24; + x17 = v23; + x16 = v11; + x15 = v12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v18 = x27; - v17 = x26; - v16 = x25; - v15 = x24; + v10 = x18; + v9 = x18; + v8 = x17; + v7 = x15; + v6 = x16; } - decref(v17); - return v15; + decref(v8); + return v6; } static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_atomZBang (VAL x1, uint64_t x2, VAL x3) { int64_t v4 = mw_mirth_word_Word_preferZ_inlineZAsk(x2); @@ -57585,81 +42535,57 @@ static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_atomZBang (VAL x1, uint64_t x VAL v6 = VVAL(VTUP(x3)->cells[4]); incref(v6); decref(x3); - VAL v7 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_opZBang(x1, x2, v6)); + VAL v7 = mw_mirth_elab_checkZ_inlineZ_recursionZ_opZBang(x1, x2, v6); VAL v8 = VVAL(VTUP(x3)->cells[5]); incref(v8); decref(x3); - VAL v9; - VAL v10; - mw_std_list_List_1_uncons(v8, &v9, &v10); - uint64_t x11; - VAL x12; - VAL x13; - int64_t x14; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v15 = mtp_std_maybe_Maybe_1_Some(v9); - VAL v16 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_argZBang(v7, x2, VU64(v15))); - int64_t v17 = 1LL /* True */; - x14 = v17; - x13 = v10; - x12 = v16; - x11 = x2; - } break; - case 0LL: { // None - int64_t v18 = 0LL /* False */; - x14 = v18; - x13 = v10; - x12 = v7; - x11 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v19 = x11; - VAL v20 = (x12); - VAL v21 = x13; - int64_t v22 = x14; - while (((bool)v22)) { - uint64_t v23 = v19; - VAL v24 = (v20); - VAL v25 = v21; - VAL v26; - VAL v27; - mw_std_list_List_1_uncons(v25, &v26, &v27); - uint64_t x28; - VAL x29; - VAL x30; - int64_t x31; - switch (get_data_tag(v26)) { - case 1LL: { // Some - VAL v32 = mtp_std_maybe_Maybe_1_Some(v26); - VAL v33 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_argZBang(v24, v23, VU64(v32))); - int64_t v34 = 1LL /* True */; - x31 = v34; - x30 = v27; - x29 = v33; - x28 = v23; + int64_t v9 = 1LL /* True */; + VAL v10 = v7; + uint64_t v11 = x2; + VAL v12 = v8; + int64_t v13 = v9; + int64_t v14 = v9; + while (((bool)v14)) { + VAL v15 = v10; + uint64_t v16 = v11; + VAL v17 = v12; + int64_t v18 = v13; + uint64_t x19; + VAL x20; + VAL x21; + int64_t x22; + switch (get_data_tag(v17)) { + case 1LL: { // Cons + VAL v23; + VAL v24; + mtp_std_list_List_1_Cons(v17, &v23, &v24); + VAL v25 = mw_mirth_elab_checkZ_inlineZ_recursionZ_argZBang(v15, v16, VU64(v23)); + int64_t v26 = 1LL /* True */; + x22 = v26; + x21 = v24; + x20 = v25; + x19 = v16; } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x31 = v35; - x30 = v27; - x29 = v24; - x28 = v23; + case 0LL: { // Nil + VAL v27 = MKI64(0LL /* Nil */); + int64_t v28 = 0LL /* False */; + x22 = v28; + x21 = v27; + x20 = v15; + x19 = v16; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v22 = x31; - v21 = x30; - v20 = x29; - v19 = x28; + v14 = x22; + v13 = x22; + v12 = x21; + v11 = x19; + v10 = x20; } - decref(v21); - x5 = v20; + decref(v12); + x5 = v10; } else { decref(x3); x5 = x1; @@ -57670,7 +42596,7 @@ static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_argZBang (VAL x1, uint64_t x2 VAL v4; VAL v5; mw_mirth_arrow_Block_arrow(x1, x3, &v4, &v5); - VAL v6 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v4, x2, v5)); + VAL v6 = mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v4, x2, v5); return v6; } static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_opZBang (VAL x1, uint64_t x2, VAL x3) { @@ -57681,7 +42607,7 @@ static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_opZBang (VAL x1, uint64_t x2, VAL v6; VAL v7; mw_mirth_arrow_Block_arrow(x1, v5, &v6, &v7); - VAL v8 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v6, x2, v7)); + VAL v8 = mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v6, x2, v7); x4 = v8; } break; case 2LL: { // OpWord @@ -57689,7 +42615,7 @@ static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_opZBang (VAL x1, uint64_t x2, int64_t v10 = mw_mirth_word_Word_ZEqualZEqual(x2, v9); VAL x11; if (((bool)v10)) { - VAL v12 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_failedZBang(x1, x2)); + VAL v12 = mw_mirth_elab_checkZ_inlineZ_recursionZ_failedZBang(x1, x2); x11 = v12; } else { int64_t v13 = mw_mirth_word_Word_preferZ_inlineZAsk(v9); @@ -57703,11 +42629,11 @@ static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_opZBang (VAL x1, uint64_t x2, switch (get_data_tag(v16)) { case 1LL: { // Some VAL v19 = mtp_std_maybe_Maybe_1_Some(v16); - VAL v20 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v17, x2, v19)); + VAL v20 = mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v17, x2, v19); x18 = v20; } break; case 0LL: { // None - VAL v21 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_failedZBang(v17, x2)); + VAL v21 = mw_mirth_elab_checkZ_inlineZ_recursionZ_failedZBang(v17, x2); x18 = v21; } break; default: { @@ -57727,91 +42653,64 @@ static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_opZBang (VAL x1, uint64_t x2, VAL v23 = VVAL(VTUP(v22)->cells[7]); incref(v23); decref(v22); - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v23, &v24, &v25); - VAL x26; - uint64_t x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v24)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v24); - VAL v31 = VVAL(VTUP(v30)->cells[2]); - incref(v31); - decref(v30); - VAL v32 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(x1, x2, v31)); - int64_t v33 = 1LL /* True */; - x29 = v33; - x28 = v25; - x27 = x2; - x26 = v32; - } break; - case 0LL: { // None - int64_t v34 = 0LL /* False */; - x29 = v34; - x28 = v25; - x27 = x2; - x26 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v35 = (x26); - uint64_t v36 = x27; - VAL v37 = x28; - int64_t v38 = x29; - while (((bool)v38)) { - VAL v39 = (v35); - uint64_t v40 = v36; - VAL v41 = v37; - VAL v42; - VAL v43; - mw_std_list_List_1_uncons(v41, &v42, &v43); - VAL x44; - uint64_t x45; - VAL x46; - int64_t x47; - switch (get_data_tag(v42)) { - case 1LL: { // Some - VAL v48 = mtp_std_maybe_Maybe_1_Some(v42); - VAL v49 = VVAL(VTUP(v48)->cells[2]); - incref(v49); - decref(v48); - VAL v50 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v39, v40, v49)); - int64_t v51 = 1LL /* True */; - x47 = v51; - x46 = v43; - x45 = v40; - x44 = v50; + int64_t v24 = 1LL /* True */; + VAL v25 = x1; + uint64_t v26 = x2; + VAL v27 = v23; + int64_t v28 = v24; + int64_t v29 = v24; + while (((bool)v29)) { + VAL v30 = v25; + uint64_t v31 = v26; + VAL v32 = v27; + int64_t v33 = v28; + uint64_t x34; + VAL x35; + VAL x36; + int64_t x37; + switch (get_data_tag(v32)) { + case 1LL: { // Cons + VAL v38; + VAL v39; + mtp_std_list_List_1_Cons(v32, &v38, &v39); + VAL v40 = VVAL(VTUP(v38)->cells[2]); + incref(v40); + decref(v38); + VAL v41 = mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v30, v31, v40); + int64_t v42 = 1LL /* True */; + x37 = v42; + x36 = v39; + x35 = v41; + x34 = v31; } break; - case 0LL: { // None - int64_t v52 = 0LL /* False */; - x47 = v52; - x46 = v43; - x45 = v40; - x44 = v39; + case 0LL: { // Nil + VAL v43 = MKI64(0LL /* Nil */); + int64_t v44 = 0LL /* False */; + x37 = v44; + x36 = v43; + x35 = v30; + x34 = v31; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v38 = x47; - v37 = x46; - v36 = x45; - v35 = x44; + v29 = x37; + v28 = x37; + v27 = x36; + v26 = x34; + v25 = x35; } - decref(v37); - x4 = v35; + decref(v27); + x4 = v25; } break; case 12LL: { // OpLambda - VAL v53 = mtp_mirth_arrow_Op_OpLambda(x3); - VAL v54 = VVAL(VTUP(v53)->cells[5]); - incref(v54); - decref(v53); - VAL v55 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(x1, x2, v54)); - x4 = v55; + VAL v45 = mtp_mirth_arrow_Op_OpLambda(x3); + VAL v46 = VVAL(VTUP(v45)->cells[5]); + incref(v46); + decref(v45); + VAL v47 = mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(x1, x2, v46); + x4 = v47; } break; default: { decref(x3); @@ -57830,7 +42729,7 @@ static VAL mw_mirth_elab_checkZ_inlineZ_recursionZ_failedZBang (VAL x1, uint64_t uint64_t v7 = mw_mirth_word_Word_head(x2); STR* v8; STRLIT(v8, "recursive word cannot be inlined", 32); - VAL v9 = (mw_mirth_mirth_ZPlusMirth_emitZ_warningZBang(v7, MKSTR(v8), x1)); + VAL v9 = mw_mirth_mirth_ZPlusMirth_emitZ_warningZBang(v7, MKSTR(v8), x1); x4 = v9; } else { x4 = x1; @@ -57849,454 +42748,237 @@ static void mw_mirth_elab_elabZ_defZ_paramsZBang (VAL x1, uint64_t x2, VAL *x3, decref(v10); VAL v11 = mw_mirth_token_Token_args(v8); VAL v12 = mw_std_list_List_1_reverse(v11); - VAL v13; - VAL v14; - mw_std_list_List_1_uncons(v12, &v13, &v14); - VAL x15; - VAL x16; - VAL x17; - VAL x18; - int64_t x19; - switch (get_data_tag(v13)) { - case 1LL: { // Some - VAL v20 = mtp_std_maybe_Maybe_1_Some(v13); - incref(v20); - VAL v21 = mw_mirth_token_Token_sigZ_paramZ_nameZAsk(VU64(v20)); - VAL x22; - VAL x23; - VAL x24; - uint64_t x25; - uint64_t x26; - switch (get_data_tag(v21)) { - case 1LL: { // Some - VAL v27 = mtp_std_maybe_Maybe_1_Some(v21); - x26 = VU64(v27); - x25 = VU64(v20); - x24 = v9; - x23 = v5; - x22 = v7; - } break; - case 0LL: { // None - STR* v28; - STRLIT(v28, "expected parameter name", 23); - push_value(v5); - push_value(v9); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v20), MKSTR(v28), v7); - uint64_t v29 = pop_u64(); - x26 = v29; - uint64_t v30 = pop_u64(); - x25 = v30; - VAL v31 = pop_value(); - x24 = v31; - VAL v32 = pop_value(); - x23 = v32; - VAL r33 = pop_resource(); - x22 = r33; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v34 = mw_mirth_token_Token_succ(x25); - int64_t v35 = mw_mirth_token_Token_runZ_endZAsk(v34); - VAL x36; - VAL x37; - VAL x38; - uint64_t x39; - uint64_t x40; - if (((bool)v35)) { - x40 = x25; - x39 = x26; - x38 = x24; - x37 = x23; - x36 = x22; - } else { - STR* v41; - STRLIT(v41, "expected right paren or comma", 29); - push_value(x23); - push_value(x24); - lpush(&lbl_name, MKU64(x26)); - push_u64(x25); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v34, MKSTR(v41), x22); - uint64_t v42 = pop_u64(); - x40 = v42; - uint64_t v43 = VU64(lpop(&lbl_name)); - x39 = v43; - VAL v44 = pop_value(); - x38 = v44; - VAL v45 = pop_value(); - x37 = v45; - VAL r46 = pop_resource(); - x36 = r46; - } - VAL v47; - VAL v48; - VAL v49; - uint64_t v50; - mw_mirth_elab_elabZ_expandZ_tensorZBang(x36, x38, x40, &v47, &v48, &v49, &v50); - VAL v51 = mw_mirth_type_Type_morphismZAsk(v49); - VAL x52; - uint64_t x53; - VAL x54; - VAL x55; - uint64_t x56; - VAL x57; - switch (get_data_tag(v51)) { - case 1LL: { // Some - VAL v58 = mtp_std_maybe_Maybe_1_Some(v51); - x57 = v58; - x56 = v50; - x55 = v48; - x54 = v47; - x53 = x39; - x52 = x37; - } break; - case 0LL: { // None - STR* v59; - STRLIT(v59, "need function type for param", 28); - push_value(x37); - lpush(&lbl_name, MKU64(x39)); - push_value(v48); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v50, MKSTR(v59), v47); - VAL v60 = pop_value(); - x57 = v60; - uint64_t v61 = pop_u64(); - x56 = v61; - VAL v62 = pop_value(); - x55 = v62; - VAL r63 = pop_resource(); - x54 = r63; - uint64_t v64 = VU64(lpop(&lbl_name)); - x53 = v64; - VAL v65 = pop_value(); - x52 = v65; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v66 = mw_mirth_var_Var_newZ_autoZ_runZBang(x57, x53); - VAL v67 = mtw_std_list_List_1_Cons(MKU64(v66), x52); - int64_t v68 = 1LL /* True */; - x19 = v68; - x18 = v14; - x17 = x55; - x16 = v67; - x15 = x54; - } break; - case 0LL: { // None - int64_t v69 = 0LL /* False */; - x19 = v69; - x18 = v14; - x17 = v9; - x16 = v5; - x15 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v70 = (x15); - VAL v71 = x16; - VAL v72 = x17; - VAL v73 = x18; - int64_t v74 = x19; - while (((bool)v74)) { - VAL v75 = (v70); - VAL v76 = v71; - VAL v77 = v72; - VAL v78 = v73; - VAL v79; - VAL v80; - mw_std_list_List_1_uncons(v78, &v79, &v80); - VAL x81; - VAL x82; - VAL x83; - VAL x84; - int64_t x85; - switch (get_data_tag(v79)) { - case 1LL: { // Some - VAL v86 = mtp_std_maybe_Maybe_1_Some(v79); - incref(v86); - VAL v87 = mw_mirth_token_Token_sigZ_paramZ_nameZAsk(VU64(v86)); - VAL x88; - VAL x89; - VAL x90; - uint64_t x91; - uint64_t x92; - switch (get_data_tag(v87)) { + int64_t v13 = 1LL /* True */; + VAL v14 = v5; + VAL v15 = v9; + VAL v16 = v7; + VAL v17 = v12; + int64_t v18 = v13; + int64_t v19 = v13; + while (((bool)v19)) { + VAL v20 = v14; + VAL v21 = v15; + VAL v22 = v16; + VAL v23 = v17; + int64_t v24 = v18; + VAL x25; + VAL x26; + VAL x27; + VAL x28; + int64_t x29; + switch (get_data_tag(v23)) { + case 1LL: { // Cons + VAL v30; + VAL v31; + mtp_std_list_List_1_Cons(v23, &v30, &v31); + incref(v30); + VAL v32 = mw_mirth_token_Token_sigZ_paramZ_nameZAsk(VU64(v30)); + uint64_t x33; + VAL x34; + VAL x35; + switch (get_data_tag(v32)) { case 1LL: { // Some - VAL v93 = mtp_std_maybe_Maybe_1_Some(v87); - x92 = VU64(v93); - x91 = VU64(v86); - x90 = v77; - x89 = v76; - x88 = v75; + VAL v36 = mtp_std_maybe_Maybe_1_Some(v32); + x35 = v36; + x34 = v22; + x33 = VU64(v30); } break; case 0LL: { // None - STR* v94; - STRLIT(v94, "expected parameter name", 23); - push_value(v76); - push_value(v77); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v86), MKSTR(v94), v75); - uint64_t v95 = pop_u64(); - x92 = v95; - uint64_t v96 = pop_u64(); - x91 = v96; - VAL v97 = pop_value(); - x90 = v97; - VAL v98 = pop_value(); - x89 = v98; - VAL r99 = pop_resource(); - x88 = r99; + STR* v37; + STRLIT(v37, "expected parameter name", 23); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v30), MKSTR(v37), v22); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t v100 = mw_mirth_token_Token_succ(x91); - int64_t v101 = mw_mirth_token_Token_runZ_endZAsk(v100); - VAL x102; - VAL x103; - VAL x104; - uint64_t x105; - uint64_t x106; - if (((bool)v101)) { - x106 = x91; - x105 = x92; - x104 = x90; - x103 = x89; - x102 = x88; + uint64_t v41 = mw_mirth_token_Token_succ(x33); + int64_t v42 = mw_mirth_token_Token_runZ_endZAsk(v41); + VAL x43; + VAL x44; + VAL x45; + uint64_t x46; + uint64_t x47; + if (((bool)v42)) { + x47 = x33; + x46 = VU64(x35); + x45 = x34; + x44 = v21; + x43 = v20; } else { - STR* v107; - STRLIT(v107, "expected right paren or comma", 29); - push_value(x89); - push_value(x90); - lpush(&lbl_name, MKU64(x92)); - push_u64(x91); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v100, MKSTR(v107), x88); - uint64_t v108 = pop_u64(); - x106 = v108; - uint64_t v109 = VU64(lpop(&lbl_name)); - x105 = v109; - VAL v110 = pop_value(); - x104 = v110; - VAL v111 = pop_value(); - x103 = v111; - VAL r112 = pop_resource(); - x102 = r112; + STR* v48; + STRLIT(v48, "expected right paren or comma", 29); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v41, MKSTR(v48), x34); } - VAL v113; - VAL v114; - VAL v115; - uint64_t v116; - mw_mirth_elab_elabZ_expandZ_tensorZBang(x102, x104, x106, &v113, &v114, &v115, &v116); - VAL v117 = mw_mirth_type_Type_morphismZAsk(v115); - VAL x118; - uint64_t x119; - VAL x120; - VAL x121; - uint64_t x122; - VAL x123; - switch (get_data_tag(v117)) { + VAL v50; + VAL v51; + VAL v52; + uint64_t v53; + mw_mirth_elab_elabZ_expandZ_tensorZBang(x45, x44, x47, &v50, &v51, &v52, &v53); + VAL v54 = mw_mirth_type_Type_morphismZAsk(v52); + uint64_t x55; + VAL x56; + VAL x57; + switch (get_data_tag(v54)) { case 1LL: { // Some - VAL v124 = mtp_std_maybe_Maybe_1_Some(v117); - x123 = v124; - x122 = v116; - x121 = v114; - x120 = v113; - x119 = x105; - x118 = x103; + VAL v58 = mtp_std_maybe_Maybe_1_Some(v54); + x57 = v58; + x56 = v50; + x55 = v53; } break; case 0LL: { // None - STR* v125; - STRLIT(v125, "need function type for param", 28); - push_value(x103); - lpush(&lbl_name, MKU64(x105)); - push_value(v114); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v116, MKSTR(v125), v113); - VAL v126 = pop_value(); - x123 = v126; - uint64_t v127 = pop_u64(); - x122 = v127; - VAL v128 = pop_value(); - x121 = v128; - VAL r129 = pop_resource(); - x120 = r129; - uint64_t v130 = VU64(lpop(&lbl_name)); - x119 = v130; - VAL v131 = pop_value(); - x118 = v131; + STR* v59; + STRLIT(v59, "need function type for param", 28); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v53, MKSTR(v59), v50); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t v132 = mw_mirth_var_Var_newZ_autoZ_runZBang(x123, x119); - VAL v133 = mtw_std_list_List_1_Cons(MKU64(v132), x118); - int64_t v134 = 1LL /* True */; - x85 = v134; - x84 = v80; - x83 = x121; - x82 = v133; - x81 = x120; + uint64_t v63 = mw_mirth_var_Var_newZ_autoZ_runZBang(x57, x46); + VAL v64 = mtw_std_list_List_1_Cons(MKU64(v63), x43); + int64_t v65 = 1LL /* True */; + x29 = v65; + x28 = v31; + x27 = v51; + x26 = v64; + x25 = x56; } break; - case 0LL: { // None - int64_t v135 = 0LL /* False */; - x85 = v135; - x84 = v80; - x83 = v77; - x82 = v76; - x81 = v75; + case 0LL: { // Nil + VAL v66 = MKI64(0LL /* Nil */); + int64_t v67 = 0LL /* False */; + x29 = v67; + x28 = v66; + x27 = v21; + x26 = v20; + x25 = v22; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v74 = x85; - v73 = x84; - v72 = x83; - v71 = x82; - v70 = x81; + v19 = x29; + v18 = x29; + v17 = x28; + v16 = x25; + v15 = x27; + v14 = x26; } - decref(v73); - decref(v72); - *x4 = v71; - *x3 = v70; + decref(v17); + decref(v15); + *x4 = v14; + *x3 = v16; } static void mw_mirth_elab_elabZ_defZ_bodyZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { VAL v7; uint64_t v8; mw_mirth_elab_abZ_tokenZAt(x3, &v7, &v8); VAL v9 = mw_mirth_token_Token_runZ_arrowZAsk(v8); - VAL x10; - VAL x11; - VAL x12; - int64_t x13; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v9); - decref(v14); - int64_t v15 = 1LL /* True */; - x13 = v15; - x12 = v7; - x11 = x2; - x10 = x1; - } break; - case 0LL: { // None - VAL v16; - uint64_t v17; - mw_mirth_elab_abZ_tokenZAt(v7, &v16, &v17); - VAL v18 = mw_mirth_token_Token_lcurlyZAsk(v17); - int64_t v19 = mw_std_maybe_Maybe_1_someZAsk(v18); - x13 = v19; - x12 = v16; - x11 = x2; - x10 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v10 = get_data_tag(v9); + decref(v9); + int64_t v11 = 1LL; + bool v12 = (v10 == v11); + VAL x13; + int64_t x14; + if (v12) { + int64_t v15 = 1LL /* True */; + x14 = v15; + x13 = v7; + } else { + VAL v16; + uint64_t v17; + mw_mirth_elab_abZ_tokenZAt(v7, &v16, &v17); + VAL v18 = mw_mirth_token_Token_lcurlyZAsk(v17); + int64_t v19 = get_data_tag(v18); + decref(v18); + int64_t v20 = 1LL; + bool v21 = (v19 == v20); + x14 = ((int64_t)v21); + x13 = v16; } - VAL x20; - VAL x21; VAL x22; - if (((bool)x13)) { - incref(x10); - VAL v23; - uint64_t v24; - mw_mirth_elab_abZ_tokenZAt(x12, &v23, &v24); + VAL x23; + VAL x24; + if (((bool)x14)) { + incref(x1); VAL v25; - VAL v26; - mw_mirth_elab_elabZ_matchZ_atZBang(x10, v24, x11, v23, &v25, &v26); - x22 = v26; - x21 = v25; - x20 = x10; - } else { + uint64_t v26; + mw_mirth_elab_abZ_tokenZAt(x13, &v25, &v26); VAL v27; VAL v28; - mw_mirth_elab_elabZ_atomsZBang(x11, x12, &v27, &v28); - x22 = v28; - x21 = v27; - x20 = x10; + mw_mirth_elab_elabZ_matchZ_atZBang(x1, v26, x2, v25, &v27, &v28); + x24 = v28; + x23 = v27; + x22 = x1; + } else { + VAL v29; + VAL v30; + mw_mirth_elab_elabZ_atomsZBang(x2, x13, &v29, &v30); + x24 = v30; + x23 = v29; + x22 = x1; } - *x6 = x22; - *x5 = x21; - *x4 = x20; + *x6 = x24; + *x5 = x23; + *x4 = x22; } static void mw_mirth_elab_parseZ_externalZ_decl (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, VAL *x5) { uint64_t v6 = mw_mirth_token_Token_next(x2); uint64_t v7 = mw_mirth_token_Token_succ(x2); VAL v8 = mw_mirth_token_Token_lparenZ_orZ_lcolonZAsk(v7); - VAL x9; - uint64_t x10; - uint64_t x11; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v8); - decref(v12); - x11 = v7; - x10 = v6; - x9 = x1; - } break; - case 0LL: { // None - uint64_t v13 = mw_mirth_token_Token_pred(v7); - STR* v14; - STRLIT(v14, "", 0); - VAL v15 = MKI64(36LL /* FGCyan */); - VAL v16 = (mw_std_terminal_Sgr_emitZThen(v15, MKSTR(v14))); - STR* v17; - STRLIT(v17, "external", 8); - VAL v18 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v17), v16)); - VAL v19 = MKI64(0LL /* Reset */); - VAL v20 = (mw_std_terminal_Sgr_emitZThen(v19, v18)); - STR* v21; - STRLIT(v21, " requires arguments", 19); - VAL v22 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v21), v20)); - push_u64(v6); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v13, v22, x1); - uint64_t v23 = pop_u64(); - x11 = v23; - uint64_t v24 = pop_u64(); - x10 = v24; - VAL r25 = pop_resource(); - x9 = r25; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v9 = get_data_tag(v8); + decref(v8); + int64_t v10 = 0LL; + bool v11 = (v9 == v10); + VAL x12; + uint64_t x13; + if (v11) { + uint64_t v14 = mw_mirth_token_Token_pred(v7); + STR* v15; + STRLIT(v15, "", 0); + VAL v16 = MKI64(36LL /* FGCyan */); + VAL v17 = mw_std_terminal_Sgr_emitZThen(v16, MKSTR(v15)); + STR* v18; + STRLIT(v18, "external", 8); + VAL v19 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v18), v17); + VAL v20 = MKI64(0LL /* Reset */); + VAL v21 = mw_std_terminal_Sgr_emitZThen(v20, v19); + STR* v22; + STRLIT(v22, " requires arguments", 19); + VAL v23 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v22), v21); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v14, v23, x1); + } else { + x13 = v7; + x12 = x1; } VAL v26 = MKI64(0LL /* Nil */); VAL v27 = mw_std_list_List_1_reverse(v26); - uint64_t v28 = mw_mirth_token_Token_succ(x11); + uint64_t v28 = mw_mirth_token_Token_succ(x13); int64_t v29 = mw_mirth_token_Token_argsZ_endZAsk(v28); bool v30 = !((bool)v29); - VAL v31 = (x9); - uint64_t v32 = x10; - VAL v33 = (v27); - uint64_t v34 = v28; - bool v35 = v30; - while (v35) { - VAL v36 = (v31); - uint64_t v37 = v32; - VAL v38 = (v33); - uint64_t v39 = v34; + VAL v31 = x12; + VAL v32 = v27; + uint64_t v33 = v28; + bool v34 = v30; + while (v34) { + VAL v35 = v31; + VAL v36 = v32; + uint64_t v37 = v33; + VAL v38; + uint64_t v39; VAL v40; - uint64_t v41; - VAL v42; - mw_mirth_elab_parseZ_externalZ_declZ_part(v36, v39, &v40, &v41, &v42); - VAL v43 = mtw_std_list_List_1_Cons(v42, v38); - int64_t v44 = mw_mirth_token_Token_argsZ_endZAsk(v41); - bool v45 = !((bool)v44); - v35 = v45; - v34 = v41; - v33 = v43; - v32 = v37; - v31 = v40; - } - VAL v46 = mw_std_list_List_1_reverse(v33); - *x5 = v46; - *x4 = v32; + mw_mirth_elab_parseZ_externalZ_declZ_part(v35, v37, &v38, &v39, &v40); + VAL v41 = mtw_std_list_List_1_Cons(v40, v36); + int64_t v42 = mw_mirth_token_Token_argsZ_endZAsk(v39); + bool v43 = !((bool)v42); + v34 = v43; + v33 = v39; + v32 = v41; + v31 = v38; + } + VAL v44 = mw_std_list_List_1_reverse(v32); + *x5 = v44; + *x4 = v6; *x3 = v31; } static void mw_mirth_elab_parseZ_externalZ_declZ_part (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, VAL *x5) { @@ -58315,188 +42997,121 @@ static void mw_mirth_elab_parseZ_externalZ_declZ_part (VAL x1, uint64_t x2, VAL } break; case 0LL: { // None VAL v13 = mw_mirth_token_Token_nameZDivdnameZAsk(x2); - VAL x14; - uint64_t x15; - uint64_t x16; - switch (get_data_tag(v13)) { - case 1LL: { // Some - VAL v17 = mtp_std_maybe_Maybe_1_Some(v13); - decref(v17); - x16 = x2; - x15 = x2; - x14 = x1; - } break; - case 0LL: { // None - STR* v18; - STRLIT(v18, "expected external word name", 27); - lpush(&lbl_head, MKU64(x2)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v18), x1); - uint64_t v19 = pop_u64(); - x16 = v19; - uint64_t v20 = VU64(lpop(&lbl_head)); - x15 = v20; - VAL r21 = pop_resource(); - x14 = r21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v14 = get_data_tag(v13); + decref(v13); + int64_t v15 = 0LL; + bool v16 = (v14 == v15); + uint64_t x17; + VAL x18; + if (v16) { + STR* v19; + STRLIT(v19, "expected external word name", 27); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v19), x1); + } else { + x18 = x1; + x17 = x2; } - uint64_t v22 = mw_mirth_token_Token_succ(x16); + uint64_t v22 = mw_mirth_token_Token_succ(x17); int64_t v23 = mw_mirth_token_Token_arrowZAsk(v22); - VAL x24; - uint64_t x25; + uint64_t x24; + VAL x25; VAL x26; uint64_t x27; if (((bool)v23)) { uint64_t v28 = mw_mirth_token_Token_succ(v22); VAL v29 = mw_mirth_token_Token_nameZAsk(v28); - VAL x30; - uint64_t x31; - uint64_t x32; - switch (get_data_tag(v29)) { - case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v29); - decref(v33); - x32 = v28; - x31 = x15; - x30 = x14; - } break; - case 0LL: { // None - STR* v34; - STRLIT(v34, "expected external symbol name", 29); - lpush(&lbl_head, MKU64(x15)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v28, MKSTR(v34), x14); - uint64_t v35 = pop_u64(); - x32 = v35; - uint64_t v36 = VU64(lpop(&lbl_head)); - x31 = v36; - VAL r37 = pop_resource(); - x30 = r37; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v30 = get_data_tag(v29); + decref(v29); + int64_t v31 = 0LL; + bool v32 = (v30 == v31); + uint64_t x33; + VAL x34; + if (v32) { + STR* v35; + STRLIT(v35, "expected external symbol name", 29); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v28, MKSTR(v35), x18); + } else { + x34 = x18; + x33 = v28; } - VAL v38 = mtw_std_maybe_Maybe_1_Some(MKU64(x32)); - uint64_t v39 = mw_mirth_token_Token_succ(x32); + VAL v38 = mtw_std_maybe_Maybe_1_Some(MKU64(x33)); + uint64_t v39 = mw_mirth_token_Token_succ(x33); x27 = v39; x26 = v38; - x25 = x31; - x24 = x30; + x25 = x34; + x24 = x2; } else { VAL v40 = MKI64(0LL /* None */); x27 = v22; x26 = v40; - x25 = x15; - x24 = x14; + x25 = x18; + x24 = x2; } VAL v41 = mw_mirth_token_Token_lsquareZAsk(x27); - uint64_t x42; - VAL x43; - VAL x44; - uint64_t x45; + int64_t v42 = get_data_tag(v41); + decref(v41); + int64_t v43 = 1LL; + bool v44 = (v42 == v43); + VAL x45; uint64_t x46; - switch (get_data_tag(v41)) { - case 1LL: { // Some - VAL v47 = mtp_std_maybe_Maybe_1_Some(v41); - decref(v47); - uint64_t v48; - VAL v49; - mw_mirth_token_Token_argsZ_1(x27, x24, &v48, &v49); - uint64_t v50 = mw_mirth_token_Token_next(x27); - x46 = v50; - x45 = v48; - x44 = v49; - x43 = x26; - x42 = x25; - } break; - case 0LL: { // None - int64_t v51 = mw_mirth_token_Token_commaZAsk(x27); - VAL x52; - uint64_t x53; - VAL x54; - uint64_t x55; - if (((bool)v51)) { - x55 = x27; - x54 = x26; - x53 = x25; - x52 = x24; - } else { - STR* v56; - STRLIT(v56, "expected type signature", 23); - lpush(&lbl_head, MKU64(x25)); - lpush(&lbl_symbol, x26); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x27, MKSTR(v56), x24); - uint64_t v57 = pop_u64(); - x55 = v57; - VAL v58 = lpop(&lbl_symbol); - x54 = v58; - uint64_t v59 = VU64(lpop(&lbl_head)); - x53 = v59; - VAL r60 = pop_resource(); - x52 = r60; - } - uint64_t v61 = mw_mirth_token_Token_succ(x55); - int64_t v62 = mw_mirth_token_Token_argZ_endZAsk(v61); - VAL x63; - uint64_t x64; - VAL x65; - uint64_t x66; - if (((bool)v62)) { - STR* v67; - STRLIT(v67, "expected type signature", 23); - lpush(&lbl_head, MKU64(x53)); - lpush(&lbl_symbol, x54); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v61, MKSTR(v67), x52); - uint64_t v68 = pop_u64(); - x66 = v68; - VAL v69 = lpop(&lbl_symbol); - x65 = v69; - uint64_t v70 = VU64(lpop(&lbl_head)); - x64 = v70; - VAL r71 = pop_resource(); - x63 = r71; - } else { - x66 = v61; - x65 = x54; - x64 = x53; - x63 = x52; - } - uint64_t v72 = mw_mirth_token_Token_nextZ_argZ_end(x66); - x46 = v72; - x45 = x66; - x44 = x63; - x43 = x65; - x42 = x64; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + uint64_t x47; + if (v44) { + uint64_t v48; + VAL v49; + mw_mirth_token_Token_argsZ_1(x27, x25, &v48, &v49); + uint64_t v50 = mw_mirth_token_Token_next(x27); + x47 = v50; + x46 = v48; + x45 = v49; + } else { + int64_t v51 = mw_mirth_token_Token_commaZAsk(x27); + uint64_t x52; + VAL x53; + if (((bool)v51)) { + x53 = x25; + x52 = x27; + } else { + STR* v54; + STRLIT(v54, "expected type signature", 23); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x27, MKSTR(v54), x25); + } + uint64_t v57 = mw_mirth_token_Token_succ(x52); + int64_t v58 = mw_mirth_token_Token_argZ_endZAsk(v57); + uint64_t x59; + VAL x60; + if (((bool)v58)) { + STR* v61; + STRLIT(v61, "expected type signature", 23); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v57, MKSTR(v61), x53); + } else { + x60 = x53; + x59 = v57; } + uint64_t v64 = mw_mirth_token_Token_nextZ_argZ_end(x59); + x47 = v64; + x46 = x59; + x45 = x60; } - VAL v73 = mtw_mirth_elab_ExternalDeclPart_EDPDef(x42, x43, x45); - x9 = v73; - x8 = x46; - x7 = x44; + VAL v65 = mtw_mirth_elab_ExternalDeclPart_EDPDef(x24, x26, x46); + x9 = v65; + x8 = x47; + x7 = x45; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v74 = mw_mirth_token_Token_commaZAsk(x8); - VAL x75; - uint64_t x76; - if (((bool)v74)) { - uint64_t v77 = mw_mirth_token_Token_succ(x8); - x76 = v77; - x75 = x7; + int64_t v66 = mw_mirth_token_Token_commaZAsk(x8); + uint64_t x67; + if (((bool)v66)) { + uint64_t v68 = mw_mirth_token_Token_succ(x8); + x67 = v68; } else { - x76 = x8; - x75 = x7; + x67 = x8; } *x5 = x9; - *x4 = x76; - *x3 = x75; + *x4 = x67; + *x3 = x7; } static void mw_mirth_elab_elabZ_externalZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { VAL v5; @@ -58505,108 +43120,63 @@ static void mw_mirth_elab_elabZ_externalZBang (VAL x1, uint64_t x2, VAL *x3, uin mw_mirth_elab_parseZ_externalZ_decl(x1, x2, &v5, &v6, &v7); VAL v8 = MKI64(0LL /* Nil */); VAL v9 = mw_std_list_List_1_reverse(v8); - VAL v10; - VAL v11; - mw_std_list_List_1_uncons(v7, &v10, &v11); - uint64_t x12; - VAL x13; - uint64_t x14; - VAL x15; - VAL x16; - int64_t x17; - switch (get_data_tag(v10)) { - case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(v10); - VAL v19; - VAL v20; - mw_mirth_elab_elabZ_externalZ_blockZ_partZBang(v5, v18, &v19, &v20); - VAL v21 = mtw_std_list_List_1_Cons(v20, v9); - int64_t v22 = 1LL /* True */; - x17 = v22; - x16 = v11; - x15 = v21; - x14 = v6; - x13 = v19; - x12 = x2; - } break; - case 0LL: { // None - int64_t v23 = 0LL /* False */; - x17 = v23; - x16 = v11; - x15 = v9; - x14 = v6; - x13 = v5; - x12 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v24 = x12; - VAL v25 = (x13); - uint64_t v26 = x14; - VAL v27 = (x15); - VAL v28 = x16; - int64_t v29 = x17; - while (((bool)v29)) { - uint64_t v30 = v24; - VAL v31 = (v25); - uint64_t v32 = v26; - VAL v33 = (v27); - VAL v34 = v28; - VAL v35; - VAL v36; - mw_std_list_List_1_uncons(v34, &v35, &v36); - uint64_t x37; - VAL x38; - uint64_t x39; - VAL x40; - VAL x41; - int64_t x42; - switch (get_data_tag(v35)) { - case 1LL: { // Some - VAL v43 = mtp_std_maybe_Maybe_1_Some(v35); - VAL v44; - VAL v45; - mw_mirth_elab_elabZ_externalZ_blockZ_partZBang(v31, v43, &v44, &v45); - VAL v46 = mtw_std_list_List_1_Cons(v45, v33); - int64_t v47 = 1LL /* True */; - x42 = v47; - x41 = v36; - x40 = v46; - x39 = v32; - x38 = v44; - x37 = v30; + int64_t v10 = 1LL /* True */; + VAL v11 = v5; + VAL v12 = v9; + VAL v13 = v7; + int64_t v14 = v10; + int64_t v15 = v10; + while (((bool)v15)) { + VAL v16 = v11; + VAL v17 = v12; + VAL v18 = v13; + int64_t v19 = v14; + VAL x20; + VAL x21; + VAL x22; + int64_t x23; + switch (get_data_tag(v18)) { + case 1LL: { // Cons + VAL v24; + VAL v25; + mtp_std_list_List_1_Cons(v18, &v24, &v25); + VAL v26; + VAL v27; + mw_mirth_elab_elabZ_externalZ_blockZ_partZBang(v16, v24, &v26, &v27); + VAL v28 = mtw_std_list_List_1_Cons(v27, v17); + int64_t v29 = 1LL /* True */; + x23 = v29; + x22 = v25; + x21 = v28; + x20 = v26; } break; - case 0LL: { // None - int64_t v48 = 0LL /* False */; - x42 = v48; - x41 = v36; - x40 = v33; - x39 = v32; - x38 = v31; - x37 = v30; + case 0LL: { // Nil + VAL v30 = MKI64(0LL /* Nil */); + int64_t v31 = 0LL /* False */; + x23 = v31; + x22 = v30; + x21 = v17; + x20 = v16; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v29 = x42; - v28 = x41; - v27 = x40; - v26 = x39; - v25 = x38; - v24 = x37; + v15 = x23; + v14 = x23; + v13 = x22; + v12 = x21; + v11 = x20; } - decref(v28); - VAL v49 = mw_std_list_List_1_reverse(v27); - uint64_t v50 = mw_mirth_external_ExternalBlock_allocZBang(); - void* v51 = mfld_mirth_external_ExternalBlock_ZTildetoken(v50); - mut_set(MKU64(v24), v51); - void* v52 = mfld_mirth_external_ExternalBlock_ZTildeparts(v50); - mut_set(v49, v52); - *x4 = v26; - *x3 = v25; + decref(v13); + VAL v32 = mw_std_list_List_1_reverse(v12); + uint64_t v33 = mw_mirth_external_ExternalBlock_allocZBang(); + void* v34 = mfld_mirth_external_ExternalBlock_ZTildetoken(v33); + mut_set(MKU64(x2), v34); + void* v35 = mfld_mirth_external_ExternalBlock_ZTildeparts(v33); + mut_set(v32, v35); + *x4 = v6; + *x3 = v11; } static void mw_mirth_elab_elabZ_externalZ_blockZ_partZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { VAL x5; @@ -58646,104 +43216,69 @@ static void mw_mirth_elab_elabZ_externalZ_defZBang (VAL x1, uint64_t x2, VAL x3, int64_t v10; VAL v11; mw_mirth_elab_elabZ_defZ_head(x1, x2, &v7, &v8, &v9, &v10, &v11); - uint64_t x12; - VAL x13; - uint64_t x14; - uint64_t x15; - int64_t x16; - VAL x17; - VAL x18; + VAL x12; switch (get_data_tag(x3)) { case 1LL: { // Some - VAL v19 = mtp_std_maybe_Maybe_1_Some(x3); - VAL v20 = mw_mirth_token_Token_nameZAsk(VU64(v19)); - x18 = v20; - x17 = v11; - x16 = v10; - x15 = v9; - x14 = v8; - x13 = v7; - x12 = x4; + VAL v13 = mtp_std_maybe_Maybe_1_Some(x3); + VAL v14 = mw_mirth_token_Token_nameZAsk(VU64(v13)); + x12 = v14; } break; case 0LL: { // None - VAL v21 = MKI64(0LL /* None */); - x18 = v21; - x17 = v11; - x16 = v10; - x15 = v9; - x14 = v8; - x13 = v7; - x12 = x4; + VAL v15 = MKI64(0LL /* None */); + x12 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t x22; - VAL x23; - uint64_t x24; - uint64_t x25; - int64_t x26; - VAL x27; - uint64_t x28; - switch (get_data_tag(x18)) { + VAL x16; + VAL x17; + switch (get_data_tag(x12)) { case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(x18); - x28 = VU64(v29); - x27 = x17; - x26 = x16; - x25 = x15; - x24 = x14; - x23 = x13; - x22 = x12; + VAL v18 = mtp_std_maybe_Maybe_1_Some(x12); + x17 = v18; + x16 = MKU64(v9); } break; case 0LL: { // None - x28 = x15; - x27 = x17; - x26 = x16; - x25 = x15; - x24 = x14; - x23 = x13; - x22 = x12; + x17 = MKU64(v9); + x16 = MKU64(v9); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v30 = mw_mirth_name_Name_ZToStr(x28); - uint64_t v31 = mw_mirth_external_External_allocZBang(); - void* v32 = mfld_mirth_external_External_ZTildename(v31); - mut_set(MKU64(x25), v32); - void* v33 = mfld_mirth_external_External_ZTildearity(v31); - mut_set(MKI64(x26), v33); - VAL v34 = mtw_mirth_mirth_PropLabel_ExternalQName(v31); - VAL v35 = mtw_mirth_mirth_Prop_1_Prop(v34, x27); - void* v36 = mfld_mirth_external_External_ZTildeqname(v31); - mut_set(v35, v36); - void* v37 = mfld_mirth_external_External_ZTildesymbol(v31); - mut_set(v30, v37); - void* v38 = mfld_mirth_external_External_ZTildesig(v31); - mut_set(MKU64(x22), v38); - void* v39 = mfld_mirth_external_External_ZTildehead(v31); - mut_set(MKU64(x24), v39); - VAL v40 = mtw_mirth_mirth_PropLabel_ExternalType(v31); - FNPTR v41 = &mb_mirth_elab_elabZ_externalZ_defZBang_2; - VAL v42; - VAL v43; - mw_mirth_mirth_PropLabel_prop_1(MKU64(v31), v40, x23, MKFNPTR(v41), &v42, &v43); - void* v44 = mfld_mirth_external_External_ZTildectxZ_type(v31); - mut_set(v42, v44); - VAL v45 = mtw_mirth_mirth_PropLabel_ExternalCType(v31); - FNPTR v46 = &mb_mirth_elab_elabZ_externalZ_defZBang_4; - VAL v47; - VAL v48; - mw_mirth_mirth_PropLabel_prop_1(MKU64(v31), v45, v43, MKFNPTR(v46), &v47, &v48); - void* v49 = mfld_mirth_external_External_ZTildectype(v31); - mut_set(v47, v49); - VAL v50 = mtw_mirth_def_Def_DefExternal(v31); - VAL v51 = (mw_mirth_def_Def_register(v48, v50)); - *x6 = v31; - *x5 = v51; + VAL v19 = mw_mirth_name_Name_ZToStr(VU64(x17)); + uint64_t v20 = mw_mirth_external_External_allocZBang(); + void* v21 = mfld_mirth_external_External_ZTildename(v20); + mut_set(x16, v21); + void* v22 = mfld_mirth_external_External_ZTildearity(v20); + mut_set(MKI64(v10), v22); + VAL v23 = mtw_mirth_mirth_PropLabel_ExternalQName(v20); + VAL v24 = mtw_mirth_mirth_Prop_1_Prop(v23, v11); + void* v25 = mfld_mirth_external_External_ZTildeqname(v20); + mut_set(v24, v25); + void* v26 = mfld_mirth_external_External_ZTildesymbol(v20); + mut_set(v19, v26); + void* v27 = mfld_mirth_external_External_ZTildesig(v20); + mut_set(MKU64(x4), v27); + void* v28 = mfld_mirth_external_External_ZTildehead(v20); + mut_set(MKU64(v8), v28); + VAL v29 = mtw_mirth_mirth_PropLabel_ExternalType(v20); + FNPTR v30 = &mb_mirth_mirth_PropLabel_prop_1_sp16_1; + VAL v31 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(v20), MKFNPTR(v30)); + VAL v32 = mtw_mirth_mirth_Prop_1_Prop(v29, v31); + void* v33 = mfld_mirth_external_External_ZTildectxZ_type(v20); + mut_set(v32, v33); + VAL v34 = mtw_mirth_mirth_PropLabel_ExternalCType(v20); + FNPTR v35 = &mb_mirth_mirth_PropLabel_prop_1_sp17_0; + VAL v36 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(v20), MKFNPTR(v35)); + VAL v37 = mtw_mirth_mirth_Prop_1_Prop(v34, v36); + void* v38 = mfld_mirth_external_External_ZTildectype(v20); + mut_set(v37, v38); + VAL v39 = mtw_mirth_def_Def_DefExternal(v20); + VAL v40 = mw_mirth_def_Def_register(v7, v39); + *x6 = v20; + *x5 = v40; } static void mw_mirth_elab_elabZ_defZ_externalZ_ctype (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { uint64_t v5 = mw_mirth_external_External_head(x2); @@ -58768,1235 +43303,296 @@ static void mw_mirth_elab_elabZ_defZ_externalZ_ctype (VAL x1, uint64_t x2, VAL * decref(v13); VAL v15 = MKI64(0LL /* Nil */); VAL v16 = mw_std_list_List_1_reverse(v15); - VAL v17; - VAL v18; - mw_std_list_List_1_uncons(v14, &v17, &v18); - VAL x19; - VAL x20; - VAL x21; - VAL x22; - int64_t x23; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v24 = mtp_std_maybe_Maybe_1_Some(v17); - incref(v24); - VAL v25 = mw_mirth_type_CTypeStackPart_labelZAsk(v24); - int64_t v26 = mw_std_maybe_Maybe_1_noneZAsk(v25); - VAL x27; - VAL x28; - VAL x29; - if (((bool)v26)) { - VAL v30 = mtw_std_maybe_Maybe_1_Some(v24); - x29 = v30; - x28 = v11; - x27 = v12; - } else { - decref(v24); - VAL v31 = MKI64(0LL /* None */); - x29 = v31; - x28 = v11; - x27 = v12; - } - VAL x32; - switch (get_data_tag(x29)) { - case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(x29); - VAL v34 = mtw_std_list_List_1_Cons(v33, v16); - x32 = v34; - push_resource(x27); - push_value(x28); - } break; - case 0LL: { // None - x32 = v16; - push_resource(x27); - push_value(x28); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v35 = 1LL /* True */; - x23 = v35; - x22 = v18; - x21 = x32; - VAL v36 = pop_value(); - x20 = v36; - VAL r37 = pop_resource(); - x19 = r37; - } break; - case 0LL: { // None - int64_t v38 = 0LL /* False */; - x23 = v38; - x22 = v18; - x21 = v16; - x20 = v11; - x19 = v12; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v39 = (x19); - VAL v40 = x20; - VAL v41 = (x21); - VAL v42 = x22; - int64_t v43 = x23; - while (((bool)v43)) { - VAL v44 = (v39); - VAL v45 = v40; - VAL v46 = (v41); - VAL v47 = v42; - VAL v48; - VAL v49; - mw_std_list_List_1_uncons(v47, &v48, &v49); - VAL x50; - VAL x51; - VAL x52; - VAL x53; - int64_t x54; - switch (get_data_tag(v48)) { - case 1LL: { // Some - VAL v55 = mtp_std_maybe_Maybe_1_Some(v48); - incref(v55); - VAL v56 = mw_mirth_type_CTypeStackPart_labelZAsk(v55); - int64_t v57 = mw_std_maybe_Maybe_1_noneZAsk(v56); - VAL x58; - VAL x59; - VAL x60; - if (((bool)v57)) { - VAL v61 = mtw_std_maybe_Maybe_1_Some(v55); - x60 = v61; - x59 = v45; - x58 = v44; + int64_t v17 = 1LL /* True */; + VAL v18 = v16; + VAL v19 = v14; + int64_t v20 = v17; + int64_t v21 = v17; + while (((bool)v21)) { + VAL v22 = v18; + VAL v23 = v19; + int64_t v24 = v20; + VAL x25; + VAL x26; + int64_t x27; + switch (get_data_tag(v23)) { + case 1LL: { // Cons + VAL v28; + VAL v29; + mtp_std_list_List_1_Cons(v23, &v28, &v29); + incref(v28); + incref(v28); + VAL v30 = mw_mirth_type_CTypeStackPart_labelZAsk(v28); + int64_t v31 = get_data_tag(v30); + decref(v30); + int64_t v32 = 0LL; + bool v33 = (v31 == v32); + VAL v34 = mw_mirth_type_CTypeStackPart_ctype(v28); + int64_t v35 = mw_mirth_type_CType_phantomZAsk(v34); + bool v36 = !((bool)v35); + bool v37 = (v33 && v36); + VAL x38; + if (v37) { + VAL v39 = mtw_std_list_List_1_Cons(v28, v22); + x38 = v39; } else { - decref(v55); - VAL v62 = MKI64(0LL /* None */); - x60 = v62; - x59 = v45; - x58 = v44; - } - VAL x63; - switch (get_data_tag(x60)) { - case 1LL: { // Some - VAL v64 = mtp_std_maybe_Maybe_1_Some(x60); - VAL v65 = mtw_std_list_List_1_Cons(v64, v46); - x63 = v65; - push_resource(x58); - push_value(x59); - } break; - case 0LL: { // None - x63 = v46; - push_resource(x58); - push_value(x59); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + decref(v28); + x38 = v22; } - int64_t v66 = 1LL /* True */; - x54 = v66; - x53 = v49; - x52 = x63; - VAL v67 = pop_value(); - x51 = v67; - VAL r68 = pop_resource(); - x50 = r68; + int64_t v40 = 1LL /* True */; + x27 = v40; + x26 = v29; + x25 = x38; } break; - case 0LL: { // None - int64_t v69 = 0LL /* False */; - x54 = v69; - x53 = v49; - x52 = v46; - x51 = v45; - x50 = v44; + case 0LL: { // Nil + VAL v41 = MKI64(0LL /* Nil */); + int64_t v42 = 0LL /* False */; + x27 = v42; + x26 = v41; + x25 = v22; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v43 = x54; - v42 = x53; - v41 = x52; - v40 = x51; - v39 = x50; - } - decref(v42); - VAL v70 = mw_std_list_List_1_reverse(v41); - VAL v71 = MKI64(0LL /* Nil */); - VAL v72 = mw_std_list_List_1_reverse(v71); - VAL v73; - VAL v74; - mw_std_list_List_1_uncons(v70, &v73, &v74); - VAL x75; - VAL x76; - VAL x77; - VAL x78; - int64_t x79; - switch (get_data_tag(v73)) { - case 1LL: { // Some - VAL v80 = mtp_std_maybe_Maybe_1_Some(v73); - incref(v80); - VAL v81 = mw_mirth_type_CTypeStackPart_ctype(v80); - int64_t v82 = mw_mirth_type_CType_phantomZAsk(v81); - bool v83 = !((bool)v82); - VAL x84; - VAL x85; - VAL x86; - if (v83) { - VAL v87 = mtw_std_maybe_Maybe_1_Some(v80); - x86 = v87; - x85 = v40; - x84 = v39; - } else { - decref(v80); - VAL v88 = MKI64(0LL /* None */); - x86 = v88; - x85 = v40; - x84 = v39; - } - VAL x89; - switch (get_data_tag(x86)) { - case 1LL: { // Some - VAL v90 = mtp_std_maybe_Maybe_1_Some(x86); - VAL v91 = mtw_std_list_List_1_Cons(v90, v72); - x89 = v91; - push_resource(x84); - push_value(x85); - } break; - case 0LL: { // None - x89 = v72; - push_resource(x84); - push_value(x85); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v92 = 1LL /* True */; - x79 = v92; - x78 = v74; - x77 = x89; - VAL v93 = pop_value(); - x76 = v93; - VAL r94 = pop_resource(); - x75 = r94; - } break; - case 0LL: { // None - int64_t v95 = 0LL /* False */; - x79 = v95; - x78 = v74; - x77 = v72; - x76 = v40; - x75 = v39; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v21 = x27; + v20 = x27; + v19 = x26; + v18 = x25; } - VAL v96 = (x75); - VAL v97 = x76; - VAL v98 = (x77); - VAL v99 = x78; - int64_t v100 = x79; - while (((bool)v100)) { - VAL v101 = (v96); - VAL v102 = v97; - VAL v103 = (v98); - VAL v104 = v99; - VAL v105; - VAL v106; - mw_std_list_List_1_uncons(v104, &v105, &v106); - VAL x107; - VAL x108; - VAL x109; - VAL x110; - int64_t x111; - switch (get_data_tag(v105)) { - case 1LL: { // Some - VAL v112 = mtp_std_maybe_Maybe_1_Some(v105); - incref(v112); - VAL v113 = mw_mirth_type_CTypeStackPart_ctype(v112); - int64_t v114 = mw_mirth_type_CType_phantomZAsk(v113); - bool v115 = !((bool)v114); - VAL x116; - VAL x117; - VAL x118; - if (v115) { - VAL v119 = mtw_std_maybe_Maybe_1_Some(v112); - x118 = v119; - x117 = v102; - x116 = v101; - } else { - decref(v112); - VAL v120 = MKI64(0LL /* None */); - x118 = v120; - x117 = v102; - x116 = v101; - } - VAL x121; - switch (get_data_tag(x118)) { - case 1LL: { // Some - VAL v122 = mtp_std_maybe_Maybe_1_Some(x118); - VAL v123 = mtw_std_list_List_1_Cons(v122, v103); - x121 = v123; - push_resource(x116); - push_value(x117); - } break; - case 0LL: { // None - x121 = v103; - push_resource(x116); - push_value(x117); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v124 = 1LL /* True */; - x111 = v124; - x110 = v106; - x109 = x121; - VAL v125 = pop_value(); - x108 = v125; - VAL r126 = pop_resource(); - x107 = r126; - } break; - case 0LL: { // None - int64_t v127 = 0LL /* False */; - x111 = v127; - x110 = v106; - x109 = v103; - x108 = v102; - x107 = v101; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v100 = x111; - v99 = x110; - v98 = x109; - v97 = x108; - v96 = x107; - } - decref(v99); - VAL v128 = mw_std_list_List_1_reverse(v98); - int64_t v129 = mw_std_list_List_1_len(v128); - int64_t v130 = 1LL; - bool v131 = (v129 > v130); - VAL x132; - VAL x133; - if (v131) { - STR* v134; - STRLIT(v134, "External has too many outputs.", 30); - VAL v135 = (mw_mirth_mirth_ZPlusMirth_errorZBang(MKSTR(v134), v96)); - x133 = v97; - x132 = v135; + decref(v19); + VAL v43 = mw_std_list_List_1_reverse(v18); + int64_t v44 = mw_std_list_List_1_len(v43); + int64_t v45 = 1LL; + bool v46 = (v44 > v45); + VAL x47; + if (v46) { + STR* v48; + STRLIT(v48, "External has too many outputs.", 30); + VAL v49 = mw_mirth_mirth_ZPlusMirth_errorZBang(MKSTR(v48), v12); + x47 = v49; } else { - x133 = v97; - x132 = v96; - } - incref(x133); - VAL v136 = VVAL(VTUP(x133)->cells[1]); - incref(v136); - decref(x133); - VAL v137 = VVAL(VTUP(v136)->cells[2]); - incref(v137); - decref(v136); - VAL v138 = MKI64(0LL /* Nil */); - VAL v139 = mw_std_list_List_1_reverse(v138); - VAL v140; - VAL v141; - mw_std_list_List_1_uncons(v137, &v140, &v141); - VAL x142; - VAL x143; - VAL x144; - VAL x145; - int64_t x146; - switch (get_data_tag(v140)) { - case 1LL: { // Some - VAL v147 = mtp_std_maybe_Maybe_1_Some(v140); - VAL v148 = mw_mirth_type_CTypeStackPart_labelZAsk(v147); - VAL x149; - switch (get_data_tag(v148)) { - case 1LL: { // Some - VAL v150 = mtp_std_maybe_Maybe_1_Some(v148); - VAL v151 = mtw_std_list_List_1_Cons(v150, v139); - x149 = v151; - push_resource(x132); - push_value(x133); - } break; - case 0LL: { // None - x149 = v139; - push_resource(x132); - push_value(x133); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v152 = 1LL /* True */; - x146 = v152; - x145 = v141; - x144 = x149; - VAL v153 = pop_value(); - x143 = v153; - VAL r154 = pop_resource(); - x142 = r154; - } break; - case 0LL: { // None - int64_t v155 = 0LL /* False */; - x146 = v155; - x145 = v141; - x144 = v139; - x143 = x133; - x142 = x132; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v156 = (x142); - VAL v157 = x143; - VAL v158 = (x144); - VAL v159 = x145; - int64_t v160 = x146; - while (((bool)v160)) { - VAL v161 = (v156); - VAL v162 = v157; - VAL v163 = (v158); - VAL v164 = v159; - VAL v165; - VAL v166; - mw_std_list_List_1_uncons(v164, &v165, &v166); - VAL x167; - VAL x168; - VAL x169; - VAL x170; - int64_t x171; - switch (get_data_tag(v165)) { - case 1LL: { // Some - VAL v172 = mtp_std_maybe_Maybe_1_Some(v165); - VAL v173 = mw_mirth_type_CTypeStackPart_labelZAsk(v172); - VAL x174; - switch (get_data_tag(v173)) { - case 1LL: { // Some - VAL v175 = mtp_std_maybe_Maybe_1_Some(v173); - VAL v176 = mtw_std_list_List_1_Cons(v175, v163); - x174 = v176; - push_resource(v161); - push_value(v162); - } break; - case 0LL: { // None - x174 = v163; - push_resource(v161); - push_value(v162); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v177 = 1LL /* True */; - x171 = v177; - x170 = v166; - x169 = x174; - VAL v178 = pop_value(); - x168 = v178; - VAL r179 = pop_resource(); - x167 = r179; - } break; - case 0LL: { // None - int64_t v180 = 0LL /* False */; - x171 = v180; - x170 = v166; - x169 = v163; - x168 = v162; - x167 = v161; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v160 = x171; - v159 = x170; - v158 = x169; - v157 = x168; - v156 = x167; - } - decref(v159); - VAL v181 = mw_std_list_List_1_reverse(v158); - incref(v157); - VAL v182 = VVAL(VTUP(v157)->cells[2]); - incref(v182); - decref(v157); - VAL v183 = VVAL(VTUP(v182)->cells[2]); - incref(v183); - decref(v182); - VAL v184 = MKI64(0LL /* Nil */); - VAL v185 = mw_std_list_List_1_reverse(v184); - VAL v186; - VAL v187; - mw_std_list_List_1_uncons(v183, &v186, &v187); - VAL x188; - VAL x189; - VAL x190; - VAL x191; - VAL x192; - int64_t x193; - switch (get_data_tag(v186)) { - case 1LL: { // Some - VAL v194 = mtp_std_maybe_Maybe_1_Some(v186); - VAL v195 = mw_mirth_type_CTypeStackPart_labelZAsk(v194); - VAL x196; - switch (get_data_tag(v195)) { - case 1LL: { // Some - VAL v197 = mtp_std_maybe_Maybe_1_Some(v195); - VAL v198 = mtw_std_list_List_1_Cons(v197, v185); - x196 = v198; - push_resource(v156); - push_value(v157); - push_value(v181); - } break; - case 0LL: { // None - x196 = v185; - push_resource(v156); - push_value(v157); - push_value(v181); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v199 = 1LL /* True */; - x193 = v199; - x192 = v187; - x191 = x196; - VAL v200 = pop_value(); - x190 = v200; - VAL v201 = pop_value(); - x189 = v201; - VAL r202 = pop_resource(); - x188 = r202; - } break; - case 0LL: { // None - int64_t v203 = 0LL /* False */; - x193 = v203; - x192 = v187; - x191 = v185; - x190 = v181; - x189 = v157; - x188 = v156; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v204 = (x188); - VAL v205 = x189; - VAL v206 = x190; - VAL v207 = (x191); - VAL v208 = x192; - int64_t v209 = x193; - while (((bool)v209)) { - VAL v210 = (v204); - VAL v211 = v205; - VAL v212 = v206; - VAL v213 = (v207); - VAL v214 = v208; - VAL v215; - VAL v216; - mw_std_list_List_1_uncons(v214, &v215, &v216); - VAL x217; - VAL x218; - VAL x219; - VAL x220; - VAL x221; - int64_t x222; - switch (get_data_tag(v215)) { - case 1LL: { // Some - VAL v223 = mtp_std_maybe_Maybe_1_Some(v215); - VAL v224 = mw_mirth_type_CTypeStackPart_labelZAsk(v223); - VAL x225; - switch (get_data_tag(v224)) { - case 1LL: { // Some - VAL v226 = mtp_std_maybe_Maybe_1_Some(v224); - VAL v227 = mtw_std_list_List_1_Cons(v226, v213); - x225 = v227; - push_resource(v210); - push_value(v211); - push_value(v212); - } break; - case 0LL: { // None - x225 = v213; - push_resource(v210); - push_value(v211); - push_value(v212); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v228 = 1LL /* True */; - x222 = v228; - x221 = v216; - x220 = x225; - VAL v229 = pop_value(); - x219 = v229; - VAL v230 = pop_value(); - x218 = v230; - VAL r231 = pop_resource(); - x217 = r231; - } break; - case 0LL: { // None - int64_t v232 = 0LL /* False */; - x222 = v232; - x221 = v216; - x220 = v213; - x219 = v212; - x218 = v211; - x217 = v210; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v209 = x222; - v208 = x221; - v207 = x220; - v206 = x219; - v205 = x218; - v204 = x217; - } - decref(v208); - VAL v233 = mw_std_list_List_1_reverse(v207); - VAL v234 = MKI64(0LL /* Nil */); - VAL v235 = mw_std_list_List_1_reverse(v234); - VAL v236; - VAL v237; - mw_std_list_List_1_uncons(v233, &v236, &v237); - VAL x238; - VAL x239; - VAL x240; - VAL x241; - VAL x242; - int64_t x243; - switch (get_data_tag(v236)) { - case 1LL: { // Some - VAL v244 = mtp_std_maybe_Maybe_1_Some(v236); - incref(v244); - incref(v206); - VAL v245 = MKI64(0LL /* None */); - VAL v246; - VAL v247; - mw_std_list_List_1_uncons(v206, &v246, &v247); - VAL x248; - VAL x249; - uint64_t x250; - VAL x251; - VAL x252; - int64_t x253; - switch (get_data_tag(v246)) { - case 1LL: { // Some - VAL v254 = mtp_std_maybe_Maybe_1_Some(v246); - incref(v254); - incref(v244); - int64_t v255 = mw_mirth_label_Label_ZEqualZEqual(VU64(v244), VU64(v254)); - VAL x256; - VAL x257; - uint64_t x258; - VAL x259; - if (((bool)v255)) { - VAL v260 = mtw_std_maybe_Maybe_1_Some(v254); - x259 = v260; - x258 = VU64(v244); - x257 = v205; - x256 = v204; - } else { - decref(v254); - VAL v261 = MKI64(0LL /* None */); - x259 = v261; - x258 = VU64(v244); - x257 = v205; - x256 = v204; - } - VAL x262; - VAL x263; - uint64_t x264; - VAL x265; - VAL x266; - switch (get_data_tag(x259)) { - case 0LL: { // None - x266 = v247; - x265 = v245; - x264 = x258; - x263 = x257; - x262 = x256; - } break; - default: { - decref(v247); - decref(v245); - VAL v267 = MKI64(0LL /* Nil */); - x266 = v267; - x265 = x259; - x264 = x258; - x263 = x257; - x262 = x256; - } break; - } - int64_t v268 = 1LL /* True */; - x253 = v268; - x252 = x266; - x251 = x265; - x250 = x264; - x249 = x263; - x248 = x262; - } break; - case 0LL: { // None - int64_t v269 = 0LL /* False */; - x253 = v269; - x252 = v247; - x251 = v245; - x250 = VU64(v244); - x249 = v205; - x248 = v204; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v270 = (x248); - VAL v271 = x249; - uint64_t v272 = x250; - VAL v273 = x251; - VAL v274 = x252; - int64_t v275 = x253; - while (((bool)v275)) { - VAL v276 = (v270); - VAL v277 = v271; - uint64_t v278 = v272; - VAL v279 = v273; - VAL v280 = v274; - VAL v281; - VAL v282; - mw_std_list_List_1_uncons(v280, &v281, &v282); - VAL x283; - VAL x284; - uint64_t x285; - VAL x286; - VAL x287; - int64_t x288; - switch (get_data_tag(v281)) { - case 1LL: { // Some - VAL v289 = mtp_std_maybe_Maybe_1_Some(v281); - incref(v289); - int64_t v290 = mw_mirth_label_Label_ZEqualZEqual(v278, VU64(v289)); - VAL x291; - VAL x292; - uint64_t x293; - VAL x294; - if (((bool)v290)) { - VAL v295 = mtw_std_maybe_Maybe_1_Some(v289); - x294 = v295; - x293 = v278; - x292 = v277; - x291 = v276; - } else { - decref(v289); - VAL v296 = MKI64(0LL /* None */); - x294 = v296; - x293 = v278; - x292 = v277; - x291 = v276; - } - VAL x297; - VAL x298; - uint64_t x299; - VAL x300; - VAL x301; - switch (get_data_tag(x294)) { - case 0LL: { // None - x301 = v282; - x300 = v279; - x299 = x293; - x298 = x292; - x297 = x291; - } break; - default: { - decref(v282); - decref(v279); - VAL v302 = MKI64(0LL /* Nil */); - x301 = v302; - x300 = x294; - x299 = x293; - x298 = x292; - x297 = x291; - } break; - } - int64_t v303 = 1LL /* True */; - x288 = v303; - x287 = x301; - x286 = x300; - x285 = x299; - x284 = x298; - x283 = x297; - } break; - case 0LL: { // None - int64_t v304 = 0LL /* False */; - x288 = v304; - x287 = v282; - x286 = v279; - x285 = v278; - x284 = v277; - x283 = v276; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v275 = x288; - v274 = x287; - v273 = x286; - v272 = x285; - v271 = x284; - v270 = x283; - } - decref(v274); - int64_t v305 = mw_std_maybe_Maybe_1_someZAsk(v273); - bool v306 = !((bool)v305); - VAL x307; - VAL x308; - VAL x309; - VAL x310; - if (v306) { - VAL v311 = mtw_std_maybe_Maybe_1_Some(v244); - x310 = v311; - x309 = v206; - x308 = v271; - x307 = v270; - } else { - decref(v244); - VAL v312 = MKI64(0LL /* None */); - x310 = v312; - x309 = v206; - x308 = v271; - x307 = v270; - } - VAL x313; - switch (get_data_tag(x310)) { - case 1LL: { // Some - VAL v314 = mtp_std_maybe_Maybe_1_Some(x310); - VAL v315 = mtw_std_list_List_1_Cons(v314, v235); - x313 = v315; - push_resource(x307); - push_value(x308); - push_value(x309); - } break; - case 0LL: { // None - x313 = v235; - push_resource(x307); - push_value(x308); - push_value(x309); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v316 = 1LL /* True */; - x243 = v316; - x242 = v237; - x241 = x313; - VAL v317 = pop_value(); - x240 = v317; - VAL v318 = pop_value(); - x239 = v318; - VAL r319 = pop_resource(); - x238 = r319; - } break; - case 0LL: { // None - int64_t v320 = 0LL /* False */; - x243 = v320; - x242 = v237; - x241 = v235; - x240 = v206; - x239 = v205; - x238 = v204; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + x47 = v12; } - VAL v321 = (x238); - VAL v322 = x239; - VAL v323 = x240; - VAL v324 = (x241); - VAL v325 = x242; - int64_t v326 = x243; - while (((bool)v326)) { - VAL v327 = (v321); - VAL v328 = v322; - VAL v329 = v323; - VAL v330 = (v324); - VAL v331 = v325; - VAL v332; - VAL v333; - mw_std_list_List_1_uncons(v331, &v332, &v333); - VAL x334; - VAL x335; - VAL x336; - VAL x337; - VAL x338; - int64_t x339; - switch (get_data_tag(v332)) { - case 1LL: { // Some - VAL v340 = mtp_std_maybe_Maybe_1_Some(v332); - incref(v340); - incref(v329); - VAL v341 = MKI64(0LL /* None */); - VAL v342; - VAL v343; - mw_std_list_List_1_uncons(v329, &v342, &v343); - VAL x344; - VAL x345; - uint64_t x346; - VAL x347; - VAL x348; - int64_t x349; - switch (get_data_tag(v342)) { - case 1LL: { // Some - VAL v350 = mtp_std_maybe_Maybe_1_Some(v342); - incref(v350); - incref(v340); - int64_t v351 = mw_mirth_label_Label_ZEqualZEqual(VU64(v340), VU64(v350)); - VAL x352; - VAL x353; - uint64_t x354; - VAL x355; - if (((bool)v351)) { - VAL v356 = mtw_std_maybe_Maybe_1_Some(v350); - x355 = v356; - x354 = VU64(v340); - x353 = v328; - x352 = v327; - } else { - decref(v350); - VAL v357 = MKI64(0LL /* None */); - x355 = v357; - x354 = VU64(v340); - x353 = v328; - x352 = v327; - } - VAL x358; - VAL x359; - uint64_t x360; - VAL x361; - VAL x362; - switch (get_data_tag(x355)) { - case 0LL: { // None - x362 = v343; - x361 = v341; - x360 = x354; - x359 = x353; - x358 = x352; - } break; - default: { - decref(v343); - decref(v341); - VAL v363 = MKI64(0LL /* Nil */); - x362 = v363; - x361 = x355; - x360 = x354; - x359 = x353; - x358 = x352; - } break; - } - int64_t v364 = 1LL /* True */; - x349 = v364; - x348 = x362; - x347 = x361; - x346 = x360; - x345 = x359; - x344 = x358; - } break; - case 0LL: { // None - int64_t v365 = 0LL /* False */; - x349 = v365; - x348 = v343; - x347 = v341; - x346 = VU64(v340); - x345 = v328; - x344 = v327; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v366 = (x344); - VAL v367 = x345; - uint64_t v368 = x346; - VAL v369 = x347; - VAL v370 = x348; - int64_t v371 = x349; - while (((bool)v371)) { - VAL v372 = (v366); - VAL v373 = v367; - uint64_t v374 = v368; - VAL v375 = v369; - VAL v376 = v370; - VAL v377; - VAL v378; - mw_std_list_List_1_uncons(v376, &v377, &v378); - VAL x379; - VAL x380; - uint64_t x381; - VAL x382; - VAL x383; - int64_t x384; - switch (get_data_tag(v377)) { + incref(v11); + VAL v50 = VVAL(VTUP(v11)->cells[1]); + incref(v50); + decref(v11); + VAL v51 = VVAL(VTUP(v50)->cells[2]); + incref(v51); + decref(v50); + VAL v52 = mw_std_list_List_1_filterZ_some_1_sp4(v51); + incref(v11); + VAL v53 = VVAL(VTUP(v11)->cells[2]); + incref(v53); + decref(v11); + VAL v54 = VVAL(VTUP(v53)->cells[2]); + incref(v54); + decref(v53); + VAL v55 = mw_std_list_List_1_filterZ_some_1_sp4(v54); + VAL v56 = MKI64(0LL /* Nil */); + VAL v57 = mw_std_list_List_1_reverse(v56); + int64_t v58 = 1LL /* True */; + VAL v59 = v52; + VAL v60 = v57; + VAL v61 = v55; + int64_t v62 = v58; + int64_t v63 = v58; + while (((bool)v63)) { + VAL v64 = v59; + VAL v65 = v60; + VAL v66 = v61; + int64_t v67 = v62; + VAL x68; + VAL x69; + VAL x70; + int64_t x71; + switch (get_data_tag(v66)) { + case 1LL: { // Cons + VAL v72; + VAL v73; + mtp_std_list_List_1_Cons(v66, &v72, &v73); + incref(v72); + incref(v64); + VAL v74 = MKI64(0LL /* None */); + int64_t v75 = 1LL /* True */; + VAL v76 = v72; + VAL v77 = v74; + VAL v78 = v64; + int64_t v79 = v75; + int64_t v80 = v75; + while (((bool)v80)) { + VAL v81 = v76; + VAL v82 = v77; + VAL v83 = v78; + int64_t v84 = v79; + VAL v85; + VAL v86; + mw_std_list_List_1_uncons(v83, &v85, &v86); + uint64_t x87; + VAL x88; + VAL x89; + int64_t x90; + switch (get_data_tag(v85)) { case 1LL: { // Some - VAL v385 = mtp_std_maybe_Maybe_1_Some(v377); - incref(v385); - int64_t v386 = mw_mirth_label_Label_ZEqualZEqual(v374, VU64(v385)); - VAL x387; - VAL x388; - uint64_t x389; - VAL x390; - if (((bool)v386)) { - VAL v391 = mtw_std_maybe_Maybe_1_Some(v385); - x390 = v391; - x389 = v374; - x388 = v373; - x387 = v372; + VAL v91 = mtp_std_maybe_Maybe_1_Some(v85); + incref(v91); + incref(v81); + int64_t v92 = mw_mirth_label_Label_ZEqualZEqual(VU64(v81), VU64(v91)); + uint64_t x93; + VAL x94; + if (((bool)v92)) { + VAL v95 = mtw_std_maybe_Maybe_1_Some(v91); + x94 = v95; + x93 = VU64(v81); } else { - decref(v385); - VAL v392 = MKI64(0LL /* None */); - x390 = v392; - x389 = v374; - x388 = v373; - x387 = v372; + decref(v91); + VAL v96 = MKI64(0LL /* None */); + x94 = v96; + x93 = VU64(v81); } - VAL x393; - VAL x394; - uint64_t x395; - VAL x396; - VAL x397; - switch (get_data_tag(x390)) { + uint64_t x97; + VAL x98; + VAL x99; + switch (get_data_tag(x94)) { case 0LL: { // None - x397 = v378; - x396 = v375; - x395 = x389; - x394 = x388; - x393 = x387; + x99 = v86; + x98 = v82; + x97 = x93; } break; default: { - decref(v378); - decref(v375); - VAL v398 = MKI64(0LL /* Nil */); - x397 = v398; - x396 = x390; - x395 = x389; - x394 = x388; - x393 = x387; + decref(v86); + decref(v82); + VAL v100 = MKI64(0LL /* Nil */); + x99 = v100; + x98 = x94; + x97 = x93; } break; } - int64_t v399 = 1LL /* True */; - x384 = v399; - x383 = x397; - x382 = x396; - x381 = x395; - x380 = x394; - x379 = x393; + int64_t v101 = 1LL /* True */; + x90 = v101; + x89 = x99; + x88 = x98; + x87 = x97; } break; case 0LL: { // None - int64_t v400 = 0LL /* False */; - x384 = v400; - x383 = v378; - x382 = v375; - x381 = v374; - x380 = v373; - x379 = v372; + int64_t v102 = 0LL /* False */; + x90 = v102; + x89 = v86; + x88 = v82; + x87 = VU64(v81); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v371 = x384; - v370 = x383; - v369 = x382; - v368 = x381; - v367 = x380; - v366 = x379; + v80 = x90; + v79 = x90; + v78 = x89; + v77 = x88; + v76 = MKU64(x87); } - decref(v370); - int64_t v401 = mw_std_maybe_Maybe_1_someZAsk(v369); - bool v402 = !((bool)v401); - VAL x403; - VAL x404; - VAL x405; - VAL x406; - if (v402) { - VAL v407 = mtw_std_maybe_Maybe_1_Some(v340); - x406 = v407; - x405 = v329; - x404 = v367; - x403 = v366; + decref(v78); + decref(v76); + int64_t v103 = get_data_tag(v77); + decref(v77); + int64_t v104 = 1LL; + bool v105 = (v103 == v104); + bool v106 = !v105; + VAL x107; + VAL x108; + if (v106) { + VAL v109 = mtw_std_list_List_1_Cons(v72, v65); + x108 = v109; + x107 = v64; } else { - decref(v340); - VAL v408 = MKI64(0LL /* None */); - x406 = v408; - x405 = v329; - x404 = v367; - x403 = v366; - } - VAL x409; - switch (get_data_tag(x406)) { - case 1LL: { // Some - VAL v410 = mtp_std_maybe_Maybe_1_Some(x406); - VAL v411 = mtw_std_list_List_1_Cons(v410, v330); - x409 = v411; - push_resource(x403); - push_value(x404); - push_value(x405); - } break; - case 0LL: { // None - x409 = v330; - push_resource(x403); - push_value(x404); - push_value(x405); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + decref(v72); + x108 = v65; + x107 = v64; } - int64_t v412 = 1LL /* True */; - x339 = v412; - x338 = v333; - x337 = x409; - VAL v413 = pop_value(); - x336 = v413; - VAL v414 = pop_value(); - x335 = v414; - VAL r415 = pop_resource(); - x334 = r415; + int64_t v110 = 1LL /* True */; + x71 = v110; + x70 = v73; + x69 = x108; + x68 = x107; } break; - case 0LL: { // None - int64_t v416 = 0LL /* False */; - x339 = v416; - x338 = v333; - x337 = v330; - x336 = v329; - x335 = v328; - x334 = v327; + case 0LL: { // Nil + VAL v111 = MKI64(0LL /* Nil */); + int64_t v112 = 0LL /* False */; + x71 = v112; + x70 = v111; + x69 = v65; + x68 = v64; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v326 = x339; - v325 = x338; - v324 = x337; - v323 = x336; - v322 = x335; - v321 = x334; - } - decref(v325); - VAL v417 = mw_std_list_List_1_reverse(v324); - decref(v323); - VAL v418; - VAL v419; - mw_std_list_List_1_uncons(v417, &v418, &v419); - VAL x420; - VAL x421; - VAL x422; - int64_t x423; - switch (get_data_tag(v418)) { - case 1LL: { // Some - VAL v424 = mtp_std_maybe_Maybe_1_Some(v418); - STR* v425; - STRLIT(v425, "", 0); - STR* v426; - STRLIT(v426, "Output label ", 13); - VAL v427 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v426), MKSTR(v425))); - uint64_t v428 = mw_mirth_label_Label_name(VU64(v424)); - VAL v429 = mw_mirth_name_Name_ZToStr(v428); - VAL v430 = (mw_std_str_ZPlusStr_pushZ_strZBang(v429, v427)); - STR* v431; - STRLIT(v431, " not present in input", 21); - VAL v432 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v431), v430)); - VAL v433 = (mw_mirth_mirth_ZPlusMirth_errorZBang(v432, v321)); - int64_t v434 = 1LL /* True */; - x423 = v434; - x422 = v419; - x421 = v322; - x420 = v433; - } break; - case 0LL: { // None - int64_t v435 = 0LL /* False */; - x423 = v435; - x422 = v419; - x421 = v322; - x420 = v321; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v63 = x71; + v62 = x71; + v61 = x70; + v60 = x69; + v59 = x68; } - VAL v436 = (x420); - VAL v437 = x421; - VAL v438 = x422; - int64_t v439 = x423; - while (((bool)v439)) { - VAL v440 = (v436); - VAL v441 = v437; - VAL v442 = v438; - VAL v443; - VAL v444; - mw_std_list_List_1_uncons(v442, &v443, &v444); - VAL x445; - VAL x446; - VAL x447; - int64_t x448; - switch (get_data_tag(v443)) { - case 1LL: { // Some - VAL v449 = mtp_std_maybe_Maybe_1_Some(v443); - STR* v450; - STRLIT(v450, "", 0); - STR* v451; - STRLIT(v451, "Output label ", 13); - VAL v452 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v451), MKSTR(v450))); - uint64_t v453 = mw_mirth_label_Label_name(VU64(v449)); - VAL v454 = mw_mirth_name_Name_ZToStr(v453); - VAL v455 = (mw_std_str_ZPlusStr_pushZ_strZBang(v454, v452)); - STR* v456; - STRLIT(v456, " not present in input", 21); - VAL v457 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v456), v455)); - VAL v458 = (mw_mirth_mirth_ZPlusMirth_errorZBang(v457, v440)); - int64_t v459 = 1LL /* True */; - x448 = v459; - x447 = v444; - x446 = v441; - x445 = v458; + decref(v61); + VAL v113 = mw_std_list_List_1_reverse(v60); + decref(v59); + int64_t v114 = 1LL /* True */; + VAL v115 = x47; + VAL v116 = v113; + int64_t v117 = v114; + int64_t v118 = v114; + while (((bool)v118)) { + VAL v119 = v115; + VAL v120 = v116; + int64_t v121 = v117; + VAL x122; + VAL x123; + int64_t x124; + switch (get_data_tag(v120)) { + case 1LL: { // Cons + VAL v125; + VAL v126; + mtp_std_list_List_1_Cons(v120, &v125, &v126); + STR* v127; + STRLIT(v127, "", 0); + STR* v128; + STRLIT(v128, "Output label ", 13); + VAL v129 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v128), MKSTR(v127)); + uint64_t v130 = mw_mirth_label_Label_name(VU64(v125)); + VAL v131 = mw_mirth_name_Name_ZToStr(v130); + VAL v132 = mw_std_str_ZPlusStr_pushZ_strZBang(v131, v129); + STR* v133; + STRLIT(v133, " not present in input", 21); + VAL v134 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v133), v132); + VAL v135 = mw_mirth_mirth_ZPlusMirth_errorZBang(v134, v119); + int64_t v136 = 1LL /* True */; + x124 = v136; + x123 = v126; + x122 = v135; } break; - case 0LL: { // None - int64_t v460 = 0LL /* False */; - x448 = v460; - x447 = v444; - x446 = v441; - x445 = v440; + case 0LL: { // Nil + VAL v137 = MKI64(0LL /* Nil */); + int64_t v138 = 0LL /* False */; + x124 = v138; + x123 = v137; + x122 = v119; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v439 = x448; - v438 = x447; - v437 = x446; - v436 = x445; + v118 = x124; + v117 = x124; + v116 = x123; + v115 = x122; } - decref(v438); - VAL v461 = VTUP(v436)->cells[5]; - decref(v461); - VTUP(v436)->cells[5] = v6; - *x4 = v437; - *x3 = v436; + decref(v116); + VAL v139 = VTUP(v115)->cells[5]; + decref(v139); + VTUP(v115)->cells[5] = v6; + *x4 = v11; + *x3 = v115; } static void mw_mirth_elab_elabZ_defZ_typeZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { uint64_t v5 = mw_mirth_token_Token_next(x2); @@ -60004,59 +43600,38 @@ static void mw_mirth_elab_elabZ_defZ_typeZBang (VAL x1, uint64_t x2, VAL *x3, ui uint64_t v7; VAL v8; mw_mirth_token_Token_argsZ_2(x2, x1, &v6, &v7, &v8); - VAL v9 = (mw_mirth_token_Token_argsZ_0(v6, v8)); + VAL v9 = mw_mirth_token_Token_argsZ_0(v6, v8); VAL v10 = mw_mirth_token_Token_sigZ_typeZ_conZAsk(v6); - uint64_t x11; - uint64_t x12; - VAL x13; + int64_t v11 = get_data_tag(v10); + decref(v10); + int64_t v12 = 0LL; + bool v13 = (v11 == v12); uint64_t x14; - switch (get_data_tag(v10)) { - case 1LL: { // Some - VAL v15 = mtp_std_maybe_Maybe_1_Some(v10); - decref(v15); - x14 = v6; - x13 = v9; - x12 = v7; - x11 = v5; - } break; - case 0LL: { // None - STR* v16; - STRLIT(v16, "expected type constructor", 25); - lpush(&lbl_target, MKU64(v7)); - lpush(&lbl_head, MKU64(v6)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v5, MKSTR(v16), v9); - uint64_t v17 = VU64(lpop(&lbl_head)); - x14 = v17; - VAL r18 = pop_resource(); - x13 = r18; - uint64_t v19 = VU64(lpop(&lbl_target)); - x12 = v19; - uint64_t v20 = pop_u64(); - x11 = v20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + VAL x15; + if (v13) { + STR* v16; + STRLIT(v16, "expected type constructor", 25); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v5, MKSTR(v16), v9); + } else { + x15 = v9; + x14 = v5; } - VAL v21; - uint64_t v22; - uint64_t v23; - int64_t v24; + VAL v19; + uint64_t v20; + uint64_t v21; + int64_t v22; + VAL v23; + mw_mirth_elab_elabZ_defZ_head(x15, v6, &v19, &v20, &v21, &v22, &v23); + VAL v24 = mtw_std_maybe_Maybe_1_Some(MKU64(v20)); VAL v25; - mw_mirth_elab_elabZ_defZ_head(x13, x14, &v21, &v22, &v23, &v24, &v25); - VAL v26 = mtw_std_maybe_Maybe_1_Some(MKU64(v22)); - VAL v27; - uint64_t v28; - mw_mirth_typedef_TypeDef_newZBang(v21, v26, v23, v25, &v27, &v28); - VAL v29 = mtw_mirth_mirth_PropLabel_TypeDefTarget(v28); - FNPTR v30 = &mb_mirth_elab_elabZ_defZ_typeZBang_2; - VAL v31; - VAL v32; - mw_mirth_mirth_PropLabel_prop_1(MKU64(x12), v29, v27, MKFNPTR(v30), &v31, &v32); - void* v33 = mfld_mirth_typedef_TypeDef_ZTildetarget(v28); - mut_set(v31, v33); - *x4 = x11; - *x3 = v32; + uint64_t v26; + mw_mirth_typedef_TypeDef_newZBang(v19, v24, v21, v23, &v25, &v26); + VAL v27 = mtw_mirth_mirth_PropLabel_TypeDefTarget(v26); + VAL v28 = mw_mirth_mirth_PropLabel_prop_1_sp15(v7, v27); + void* v29 = mfld_mirth_typedef_TypeDef_ZTildetarget(v26); + mut_set(v28, v29); + *x4 = x14; + *x3 = v25; } static void mw_mirth_elab_elabZ_bufferZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { uint64_t v5 = mw_mirth_token_Token_next(x2); @@ -60070,73 +43645,45 @@ static void mw_mirth_elab_elabZ_bufferZBang (VAL x1, uint64_t x2, VAL *x3, uint6 VAL v11 = mw_mirth_token_Token_intZAsk(v7); uint64_t x12; VAL x13; - uint64_t x14; - VAL x15; - uint64_t x16; - int64_t x17; + VAL x14; switch (get_data_tag(v11)) { case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(v11); - x17 = VI64(v18); - x16 = v7; - x15 = v10; - x14 = v6; + VAL v15 = mtp_std_maybe_Maybe_1_Some(v11); + x14 = v15; x13 = v9; - x12 = v5; + x12 = v7; } break; case 0LL: { // None - STR* v19; - STRLIT(v19, "expected buffer size", 20); - push_u64(v5); - push_u64(v6); - push_value(v10); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v7, MKSTR(v19), v9); - int64_t v20 = pop_i64(); - x17 = v20; - uint64_t v21 = pop_u64(); - x16 = v21; - VAL v22 = pop_value(); - x15 = v22; - uint64_t v23 = pop_u64(); - x14 = v23; - VAL r24 = pop_resource(); - x13 = r24; - uint64_t v25 = pop_u64(); - x12 = v25; + STR* v16; + STRLIT(v16, "expected buffer size", 20); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v7, MKSTR(v16), v9); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v26 = 0LL; - bool v27 = (x17 < v26); - uint64_t x28; - VAL x29; - uint64_t x30; - VAL x31; - int64_t x32; - if (v27) { - STR* v33; - STRLIT(v33, "buffer size must not be negative", 32); - VAL v34 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x16, MKSTR(v33), x13)); - int64_t v35 = 0LL; - x32 = v35; - x31 = x15; - x30 = x14; - x29 = v34; - x28 = x12; - } else { - x32 = x17; - x31 = x15; - x30 = x14; - x29 = x13; - x28 = x12; - } - VAL v36; - uint64_t v37; - mw_mirth_buffer_Buffer_newZBang(x29, x30, x31, x32, &v36, &v37); - *x4 = x28; - *x3 = v36; + incref(x14); + int64_t v20 = 0LL; + bool v21 = (VI64(x14) < v20); + VAL x22; + int64_t x23; + if (v21) { + decref(x14); + STR* v24; + STRLIT(v24, "buffer size must not be negative", 32); + VAL v25 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(x12, MKSTR(v24), x13); + int64_t v26 = 0LL; + x23 = v26; + x22 = v25; + } else { + x23 = VI64(x14); + x22 = x13; + } + VAL v27; + uint64_t v28; + mw_mirth_buffer_Buffer_newZBang(x22, v6, v10, x23, &v27, &v28); + *x4 = v5; + *x3 = v27; } static void mw_mirth_elab_elabZ_variableZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { uint64_t v5 = mw_mirth_token_Token_next(x2); @@ -60151,14 +43698,11 @@ static void mw_mirth_elab_elabZ_variableZBang (VAL x1, uint64_t x2, VAL *x3, uin uint64_t v12; mw_mirth_variable_Variable_newZBang(v9, v6, v10, &v11, &v12); VAL v13 = mtw_mirth_mirth_PropLabel_VariableType(v12); - FNPTR v14 = &mb_mirth_elab_elabZ_variableZBang_1; - VAL v15; - VAL v16; - mw_mirth_mirth_PropLabel_prop_1(MKU64(v7), v13, v11, MKFNPTR(v14), &v15, &v16); - void* v17 = mfld_mirth_variable_Variable_ZTildetype(v12); - mut_set(v15, v17); + VAL v14 = mw_mirth_mirth_PropLabel_prop_1_sp15(v7, v13); + void* v15 = mfld_mirth_variable_Variable_ZTildetype(v12); + mut_set(v14, v15); *x4 = v5; - *x3 = v16; + *x3 = v11; } static void mw_mirth_elab_elabZ_tableZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { uint64_t v5 = mw_mirth_token_Token_next(x2); @@ -60166,69 +43710,45 @@ static void mw_mirth_elab_elabZ_tableZBang (VAL x1, uint64_t x2, VAL *x3, uint64 VAL v7; mw_mirth_token_Token_argsZ_1(x2, x1, &v6, &v7); VAL v8 = mw_mirth_token_Token_sigZ_typeZ_conZAsk(v6); - uint64_t x9; - VAL x10; - uint64_t x11; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v8); - decref(v12); - x11 = v6; - x10 = v7; - x9 = v5; - } break; - case 0LL: { // None - STR* v13; - STRLIT(v13, "expected type name", 18); - push_u64(v5); - lpush(&lbl_head, MKU64(v6)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v6, MKSTR(v13), v7); - uint64_t v14 = VU64(lpop(&lbl_head)); - x11 = v14; - VAL r15 = pop_resource(); - x10 = r15; - uint64_t v16 = pop_u64(); - x9 = v16; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v9 = get_data_tag(v8); + decref(v8); + int64_t v10 = 0LL; + bool v11 = (v9 == v10); + VAL x12; + uint64_t x13; + if (v11) { + STR* v14; + STRLIT(v14, "expected type name", 18); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v6, MKSTR(v14), v7); + } else { + x13 = v6; + x12 = v7; } - VAL v17 = (mw_mirth_token_Token_argsZ_0(x11, x10)); - uint64_t v18 = mw_mirth_token_Token_succ(x11); - int64_t v19 = mw_mirth_token_Token_argZ_endZAsk(v18); + VAL v16 = mw_mirth_token_Token_argsZ_0(x13, x12); + uint64_t v17 = mw_mirth_token_Token_succ(x13); + int64_t v18 = mw_mirth_token_Token_argZ_endZAsk(v17); + VAL x19; uint64_t x20; - VAL x21; - uint64_t x22; - if (((bool)v19)) { - x22 = x11; - x21 = v17; - x20 = x9; + if (((bool)v18)) { + x20 = x13; + x19 = v16; } else { - uint64_t v23 = mw_mirth_token_Token_succ(x11); - STR* v24; - STRLIT(v24, "expected end of argument after table name", 41); - push_u64(x9); - lpush(&lbl_head, MKU64(x11)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v23, MKSTR(v24), v17); - uint64_t v25 = VU64(lpop(&lbl_head)); - x22 = v25; - VAL r26 = pop_resource(); - x21 = r26; - uint64_t v27 = pop_u64(); - x20 = v27; + uint64_t v21 = mw_mirth_token_Token_succ(x13); + STR* v22; + STRLIT(v22, "expected end of argument after table name", 41); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v21, MKSTR(v22), v16); } + VAL v24; + uint64_t v25; + uint64_t v26; + int64_t v27; VAL v28; - uint64_t v29; + mw_mirth_elab_elabZ_defZ_head(x19, x20, &v24, &v25, &v26, &v27, &v28); + VAL v29; uint64_t v30; - int64_t v31; - VAL v32; - mw_mirth_elab_elabZ_defZ_head(x21, x22, &v28, &v29, &v30, &v31, &v32); - VAL v33; - uint64_t v34; - mw_mirth_elab_tableZ_newZBang(v28, v29, v30, v32, &v33, &v34); - *x4 = x20; - *x3 = v33; + mw_mirth_elab_tableZ_newZBang(v24, v25, v26, v28, &v29, &v30); + *x4 = v5; + *x3 = v29; } static void mw_mirth_elab_elabZ_entryZ_point (VAL x1, VAL x2, VAL *x3, VAL *x4) { incref(x1); @@ -60236,105 +43756,85 @@ static void mw_mirth_elab_elabZ_entryZ_point (VAL x1, VAL x2, VAL *x3, VAL *x4) VAL v6; mw_mirth_name_QName_defZ_hardZAsk(x2, x1, &v5, &v6); VAL x7; - VAL x8; - VAL x9; switch (get_data_tag(v6)) { case 1LL: { // Some - VAL v10 = mtp_std_maybe_Maybe_1_Some(v6); - VAL v11 = mw_mirth_def_Def_wordZAsk(v10); - x9 = v11; - x8 = v5; - x7 = x1; + VAL v8 = mtp_std_maybe_Maybe_1_Some(v6); + VAL v9 = mw_mirth_def_Def_wordZAsk(v8); + x7 = v9; } break; case 0LL: { // None - VAL v12 = MKI64(0LL /* None */); - x9 = v12; - x8 = v5; - x7 = x1; + VAL v10 = MKI64(0LL /* None */); + x7 = v10; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } + VAL x11; + VAL x12; VAL x13; - VAL x14; - uint64_t x15; - switch (get_data_tag(x9)) { + switch (get_data_tag(x7)) { case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(x9); - x15 = VU64(v16); - x14 = x8; - x13 = x7; + VAL v14 = mtp_std_maybe_Maybe_1_Some(x7); + x13 = v14; + x12 = x1; + x11 = v5; } break; case 0LL: { // None - incref(x7); - VAL v17 = VVAL(VTUP(x7)->cells[1]); - incref(v17); - decref(x7); - VAL v18; - VAL v19; - mw_mirth_name_Namespace_moduleZAsk(x8, v17, &v18, &v19); - VAL x20; - switch (get_data_tag(v19)) { + incref(x1); + VAL v15 = VVAL(VTUP(x1)->cells[1]); + incref(v15); + decref(x1); + VAL v16; + VAL v17; + mw_mirth_name_Namespace_moduleZAsk(v5, v15, &v16, &v17); + VAL x18; + switch (get_data_tag(v17)) { case 1LL: { // Some - VAL v21 = mtp_std_maybe_Maybe_1_Some(v19); - uint64_t v22 = mw_mirth_module_Module_start(VU64(v21)); - VAL v23 = mtw_std_maybe_Maybe_1_Some(MKU64(v22)); - VAL v24 = VTUP(v18)->cells[5]; - decref(v24); - VTUP(v18)->cells[5] = v23; - x20 = v18; + VAL v19 = mtp_std_maybe_Maybe_1_Some(v17); + uint64_t v20 = mw_mirth_module_Module_start(VU64(v19)); + VAL v21 = mtw_std_maybe_Maybe_1_Some(MKU64(v20)); + VAL v22 = VTUP(v16)->cells[5]; + decref(v22); + VTUP(v16)->cells[5] = v21; + x18 = v16; } break; case 0LL: { // None - x20 = v18; + x18 = v16; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - STR* v25; - STRLIT(v25, "can't find entry point ", 23); - VAL v26; - VAL v27; - mw_mirth_name_QName_ZToStr(x20, x7, &v26, &v27); - STR* v28 = str_cat(v25, VSTR(v27)); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v28), v26); - uint64_t v29 = pop_u64(); - x15 = v29; - VAL r30 = pop_resource(); - x14 = r30; - VAL v31 = pop_value(); - x13 = v31; + STR* v23; + STRLIT(v23, "can't find entry point ", 23); + VAL v24; + VAL v25; + mw_mirth_name_QName_ZToStr(x18, x1, &v24, &v25); + STR* v26 = str_cat(v23, VSTR(v25)); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v26), v24); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - decref(x13); - VAL v32 = mw_mirth_var_Ctx0(); - VAL v33 = mw_mirth_type_T0(); - VAL v34 = mw_mirth_type_RESOURCEz_WORLD(); - VAL v35 = mw_mirth_type_TZPlus(v33, v34); - VAL v36 = mw_mirth_type_T0(); - VAL v37 = mw_mirth_type_RESOURCEz_WORLD(); - VAL v38 = mw_mirth_type_TZPlus(v36, v37); - VAL v39 = mw_mirth_type_TZ_ZTo(v35, v38); - uint64_t v40 = mw_mirth_word_Word_head(x15); - VAL v41 = mtw_mirth_arrow_Home_HomeMain(v40); - VAL v42; - VAL v43; - mw_mirth_type_ArrowType_unpack(v39, &v42, &v43); - incref(v42); - VAL v44 = MKI64(0LL /* Nil */); - VAL v45 = mtw_mirth_arrow_Arrow_Arrow(v41, v40, v40, v32, v42, v42, v44); - VAL v46; - VAL v47; - mw_mirth_elab_abZ_wordZBang(x15, x14, v45, &v46, &v47); - VAL v48; - VAL v49; - mw_mirth_elab_abZ_unifyZ_typeZBang(v43, v46, v47, &v48, &v49); - *x4 = v48; - *x3 = v49; + decref(x12); + incref(x13); + VAL v30 = mw_mirth_var_Ctx0(); + VAL v31 = mw_mirth_type_T0(); + VAL v32 = mw_mirth_type_RESOURCEz_WORLD(); + VAL v33 = mw_mirth_type_TZPlus(v31, v32); + VAL v34 = mw_mirth_type_T0(); + VAL v35 = mw_mirth_type_RESOURCEz_WORLD(); + VAL v36 = mw_mirth_type_TZPlus(v34, v35); + VAL v37 = mw_mirth_type_TZ_ZTo(v33, v36); + uint64_t v38 = mw_mirth_word_Word_head(VU64(x13)); + VAL v39 = mtw_mirth_arrow_Home_HomeMain(v38); + VAL v40; + VAL v41; + mw_mirth_elab_abZ_buildZ_homZBang_1_sp1(VU64(x13), x11, v30, v37, v38, v39, &v40, &v41); + *x4 = v40; + *x3 = v41; } static void mw_mirth_elab_elabZ_embedZ_strZBang (uint64_t x1, int64_t x2, VAL x3, uint64_t *x4, int64_t *x5, VAL *x6) { uint64_t v7 = mw_mirth_token_Token_next(x1); @@ -60350,388 +43850,213 @@ static void mw_mirth_elab_elabZ_embedZ_strZBang (uint64_t x1, int64_t x2, VAL x3 mw_mirth_elab_elabZ_defZ_head(v10, v8, &v11, &v12, &v13, &v14, &v15); int64_t v16 = 0LL; bool v17 = (v14 == v16); - int64_t x18; + VAL x18; uint64_t x19; - uint64_t x20; - VAL x21; - uint64_t x22; - uint64_t x23; - VAL x24; - int64_t x25; if (v17) { - x25 = v14; - x24 = v15; - x23 = v13; - x22 = v12; - x21 = v11; - x20 = v9; - x19 = v7; - x18 = x2; + x19 = v12; + x18 = v11; } else { - STR* v26; - STRLIT(v26, "expected no arguments", 21); - push_resource(MKI64(x2)); - push_u64(v7); - push_u64(v9); - lpush(&lbl_name, MKU64(v13)); - lpush(&lbl_state, v15); - lpush(&lbl_arity, MKI64(v14)); - lpush(&lbl_head, MKU64(v12)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v12, MKSTR(v26), v11); - int64_t v27 = VI64(lpop(&lbl_arity)); - x25 = v27; - VAL v28 = lpop(&lbl_state); - x24 = v28; - uint64_t v29 = VU64(lpop(&lbl_name)); - x23 = v29; - uint64_t v30 = VU64(lpop(&lbl_head)); - x22 = v30; - VAL r31 = pop_resource(); - x21 = r31; - uint64_t v32 = pop_u64(); - x20 = v32; - uint64_t v33 = pop_u64(); - x19 = v33; - int64_t r34 = VI64(pop_resource()); - x18 = r34; + STR* v20; + STRLIT(v20, "expected no arguments", 21); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v12, MKSTR(v20), v11); } - VAL v35 = MKI64(0LL /* None */); - VAL v36 = mw_mirth_token_Token_strZAsk(x20); - int64_t x37; - uint64_t x38; - VAL x39; - uint64_t x40; - uint64_t x41; - VAL x42; - int64_t x43; - uint64_t x44; - VAL x45; - uint64_t x46; - VAL x47; - switch (get_data_tag(v36)) { + VAL v22 = MKI64(0LL /* None */); + VAL v23 = mw_mirth_token_Token_strZAsk(v9); + uint64_t x24; + VAL x25; + VAL x26; + switch (get_data_tag(v23)) { case 1LL: { // Some - VAL v48 = mtp_std_maybe_Maybe_1_Some(v36); - x47 = v48; - x46 = x20; - x45 = v35; - x44 = x20; - x43 = x25; - x42 = x24; - x41 = x23; - x40 = x22; - x39 = x21; - x38 = x19; - x37 = x18; + VAL v27 = mtp_std_maybe_Maybe_1_Some(v23); + x26 = v27; + x25 = x18; + x24 = v9; } break; case 0LL: { // None - STR* v49; - STRLIT(v49, "expected source path", 20); - push_resource(MKI64(x18)); - push_u64(x19); - lpush(&lbl_head, MKU64(x22)); - lpush(&lbl_name, MKU64(x23)); - lpush(&lbl_state, x24); - lpush(&lbl_arity, MKI64(x25)); - lpush(&lbl_body, MKU64(x20)); - lpush(&lbl_sigZAsk, v35); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x20, MKSTR(v49), x21); - VAL v50 = pop_value(); - x47 = v50; - uint64_t v51 = pop_u64(); - x46 = v51; - VAL v52 = lpop(&lbl_sigZAsk); - x45 = v52; - uint64_t v53 = VU64(lpop(&lbl_body)); - x44 = v53; - int64_t v54 = VI64(lpop(&lbl_arity)); - x43 = v54; - VAL v55 = lpop(&lbl_state); - x42 = v55; - uint64_t v56 = VU64(lpop(&lbl_name)); - x41 = v56; - uint64_t v57 = VU64(lpop(&lbl_head)); - x40 = v57; - VAL r58 = pop_resource(); - x39 = r58; - uint64_t v59 = pop_u64(); - x38 = v59; - int64_t r60 = VI64(pop_resource()); - x37 = r60; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v61; - VAL v62; - mw_std_prim_ZPlusWorld_openZ_fileZBang(x47, x37, &v61, &v62); - uint64_t x63; - uint64_t x64; - uint64_t x65; - VAL x66; - int64_t x67; - uint64_t x68; - VAL x69; - uint64_t x70; - VAL x71; - int64_t x72; - VAL x73; - switch (get_data_tag(v62)) { - case 0LL: { // +FileOk - VAL v74 = (mtp_std_file_ZPlusFileZAsk_ZPlusFileOk(v62)); - x73 = v74; - x72 = v61; - x71 = x39; - x70 = x46; - x69 = x45; - x68 = x44; - x67 = x43; - x66 = x42; - x65 = x41; - x64 = x40; - x63 = x38; - } break; - case 1LL: { // +FileErr - VAL v75 = mtp_std_file_ZPlusFileZAsk_ZPlusFileErr(v62); - push_u64(x38); - lpush(&lbl_head, MKU64(x40)); - lpush(&lbl_name, MKU64(x41)); - lpush(&lbl_state, x42); - lpush(&lbl_arity, MKI64(x43)); - lpush(&lbl_body, MKU64(x44)); - lpush(&lbl_sigZAsk, x45); - push_u64(x46); - push_resource(MKI64(v61)); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(v75, x39); - VAL r76 = pop_resource(); - x73 = r76; - int64_t r77 = VI64(pop_resource()); - x72 = r77; - VAL v78 = (lpop(&lbl_ZPlusmirth)); - x71 = v78; - uint64_t v79 = pop_u64(); - x70 = v79; - VAL v80 = lpop(&lbl_sigZAsk); - x69 = v80; - uint64_t v81 = VU64(lpop(&lbl_body)); - x68 = v81; - int64_t v82 = VI64(lpop(&lbl_arity)); - x67 = v82; - VAL v83 = lpop(&lbl_state); - x66 = v83; - uint64_t v84 = VU64(lpop(&lbl_name)); - x65 = v84; - uint64_t v85 = VU64(lpop(&lbl_head)); - x64 = v85; - uint64_t v86 = pop_u64(); - x63 = v86; + STR* v28; + STRLIT(v28, "expected source path", 20); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v9, MKSTR(v28), x18); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v87; - VAL v88; - mw_std_file_ZPlusFile_readZ_fileZBang(x73, &v87, &v88); - int64_t v89 = (mw_std_file_ZPlusFile_closeZ_fileZBang(x72, v88)); - uint64_t v90; - VAL v91; - mw_mirth_word_Word_newZBang(x64, x69, x68, x65, x67, x71, &v90, &v91); - VAL v92 = mtw_mirth_mirth_PropLabel_WordQName(v90); - VAL v93 = mtw_mirth_mirth_Prop_1_Prop(v92, x66); - void* v94 = mfld_mirth_word_Word_ZTildeqname(v90); - mut_set(v93, v94); - VAL v95 = mw_mirth_var_Ctx0(); - VAL v96 = mw_mirth_type_T0(); - VAL v97 = mw_mirth_type_TYPEz_STR(); - VAL v98 = mw_mirth_type_T1(v97); - VAL v99 = mw_mirth_type_TZ_ZTo(v96, v98); - VAL v100 = mtw_mirth_mirth_PropLabel_WordType(v90); - VAL v101; - VAL v102; - mw_mirth_mirth_PropLabel_prop2(v95, v99, v100, v91, &v101, &v102); - void* v103 = mfld_mirth_word_Word_ZTildectxZ_type(v90); - mut_set(v101, v103); - VAL v104; - VAL v105; - VAL v106; - uint64_t v107; - VAL v108; - uint64_t v109; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v102, v90, &v104, &v105, &v106, &v107, &v108, &v109); - VAL v110; - VAL v111; - mw_mirth_type_ArrowType_unpack(v106, &v110, &v111); - incref(v110); - VAL v112 = MKI64(0LL /* Nil */); - VAL v113 = mtw_mirth_arrow_Arrow_Arrow(v108, v107, v107, v105, v110, v110, v112); - VAL v114; - VAL v115; - mw_mirth_elab_abZ_strZBang(v87, v104, v113, &v114, &v115); - VAL v116; - VAL v117; - mw_mirth_elab_abZ_unifyZ_typeZBang(v111, v114, v115, &v116, &v117); - VAL v118; - VAL v119; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v116, v117, v109, &v118, &v119); - VAL v120 = mtw_mirth_mirth_PropLabel_WordArrow(v90); - VAL v121; - VAL v122; - mw_mirth_mirth_PropLabel_prop(v119, v120, v118, &v121, &v122); - void* v123 = mfld_mirth_word_Word_ZTildearrow(v90); - mut_set(v121, v123); - *x6 = v122; - *x5 = v89; - *x4 = x63; + int64_t v32; + VAL v33; + mw_std_prim_ZPlusWorld_openZ_fileZBang(x26, x2, &v32, &v33); + VAL v34; + VAL v35; + mw_std_file_ZPlusFileZAsk_unwrapZBang_1_sp1(x25, v33, &v34, &v35); + VAL v36; + VAL v37; + mw_std_file_ZPlusFile_readZ_fileZBang(v35, &v36, &v37); + int64_t v38 = mw_std_file_ZPlusFile_closeZ_fileZBang(v32, v37); + uint64_t v39; + VAL v40; + mw_mirth_word_Word_newZBang(x19, v22, v9, v13, v14, v34, &v39, &v40); + VAL v41 = mtw_mirth_mirth_PropLabel_WordQName(v39); + VAL v42 = mtw_mirth_mirth_Prop_1_Prop(v41, v15); + void* v43 = mfld_mirth_word_Word_ZTildeqname(v39); + mut_set(v42, v43); + VAL v44 = mw_mirth_var_Ctx0(); + VAL v45 = mw_mirth_type_T0(); + VAL v46 = mw_mirth_type_TYPEz_STR(); + VAL v47 = mw_mirth_type_T1(v46); + VAL v48 = mw_mirth_type_TZ_ZTo(v45, v47); + VAL v49 = mtw_mirth_mirth_PropLabel_WordType(v39); + VAL v50; + VAL v51; + mw_mirth_mirth_PropLabel_prop2(v44, v48, v49, v40, &v50, &v51); + void* v52 = mfld_mirth_word_Word_ZTildectxZ_type(v39); + mut_set(v50, v52); + VAL v53; + VAL v54; + VAL v55; + uint64_t v56; + VAL v57; + uint64_t v58; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v51, v39, &v53, &v54, &v55, &v56, &v57, &v58); + VAL v59; + VAL v60; + mw_mirth_type_ArrowType_unpack(v55, &v59, &v60); + incref(v59); + VAL v61 = MKI64(0LL /* Nil */); + VAL v62 = mtw_mirth_arrow_Arrow_Arrow(v57, v56, v56, v54, v59, v59, v61); + VAL v63; + VAL v64; + mw_mirth_elab_abZ_strZBang(v36, v53, v62, &v63, &v64); + VAL v65; + VAL v66; + mw_mirth_elab_abZ_unifyZ_typeZBang(v60, v63, v64, &v65, &v66); + VAL v67; + VAL v68; + mw_mirth_elab_finalizzeZ_wordZ_arrow(v65, v66, v58, &v67, &v68); + VAL v69 = mtw_mirth_mirth_PropLabel_WordArrow(v39); + VAL v70; + VAL v71; + mw_mirth_mirth_PropLabel_prop(v68, v69, v67, &v70, &v71); + void* v72 = mfld_mirth_word_Word_ZTildearrow(v39); + mut_set(v70, v72); + *x6 = v71; + *x5 = v38; + *x4 = v7; } static VAL mw_mirth_elab_typecheckZ_everythingZBang (VAL x1) { int64_t v2 = 1LL; void* v3 = mbuf_mirth_name_Name_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; VAL v11 = mw_mirth_name_Name_defs(((uint64_t)v10)); - VAL v12; - VAL v13; - mw_std_list_List_1_uncons(v11, &v12, &v13); - VAL x14; - VAL x15; - int64_t x16; - switch (get_data_tag(v12)) { - case 1LL: { // Some - VAL v17 = mtp_std_maybe_Maybe_1_Some(v12); - incref(v17); - VAL v18; - VAL v19; - mw_mirth_def_Def_qnameZ_hard(v9, v17, &v18, &v19); - decref(v19); - VAL v20 = (mw_mirth_def_Def_typecheckZBang(v18, v17)); - int64_t v21 = 1LL /* True */; - x16 = v21; - x15 = v13; - x14 = v20; - } break; - case 0LL: { // None - int64_t v22 = 0LL /* False */; - x16 = v22; - x15 = v13; - x14 = v9; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v23 = (x14); - VAL v24 = x15; - int64_t v25 = x16; - while (((bool)v25)) { - VAL v26 = (v23); - VAL v27 = v24; - VAL v28; - VAL v29; - mw_std_list_List_1_uncons(v27, &v28, &v29); - VAL x30; - VAL x31; - int64_t x32; - switch (get_data_tag(v28)) { - case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v28); - incref(v33); - VAL v34; - VAL v35; - mw_mirth_def_Def_qnameZ_hard(v26, v33, &v34, &v35); - decref(v35); - VAL v36 = (mw_mirth_def_Def_typecheckZBang(v34, v33)); - int64_t v37 = 1LL /* True */; - x32 = v37; - x31 = v29; - x30 = v36; + int64_t v12 = 1LL /* True */; + VAL v13 = v9; + VAL v14 = v11; + int64_t v15 = v12; + int64_t v16 = v12; + while (((bool)v16)) { + VAL v17 = v13; + VAL v18 = v14; + int64_t v19 = v15; + VAL x20; + VAL x21; + int64_t x22; + switch (get_data_tag(v18)) { + case 1LL: { // Cons + VAL v23; + VAL v24; + mtp_std_list_List_1_Cons(v18, &v23, &v24); + incref(v23); + VAL v25; + VAL v26; + mw_mirth_def_Def_qnameZ_hard(v17, v23, &v25, &v26); + decref(v26); + VAL v27 = mw_mirth_def_Def_typecheckZBang(v25, v23); + int64_t v28 = 1LL /* True */; + x22 = v28; + x21 = v24; + x20 = v27; } break; - case 0LL: { // None - int64_t v38 = 0LL /* False */; - x32 = v38; - x31 = v29; - x30 = v26; + case 0LL: { // Nil + VAL v29 = MKI64(0LL /* Nil */); + int64_t v30 = 0LL /* False */; + x22 = v30; + x21 = v29; + x20 = v17; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v25 = x32; - v24 = x31; - v23 = x30; + v16 = x22; + v15 = x22; + v14 = x21; + v13 = x20; } - decref(v24); - int64_t v39 = 1LL; - int64_t v40 = i64_add(v10, v39); - void* v41 = mbuf_mirth_name_Name_NUM; - int64_t v42 = *(int64_t*)v41; - bool v43 = (v40 <= v42); - v8 = v43; - v7 = v40; - v6 = v23; - } - int64_t v44 = 1LL; - void* v45 = mbuf_mirth_arrow_Block_NUM; - int64_t v46 = *(int64_t*)v45; - bool v47 = (v44 <= v46); - VAL v48 = (v6); - int64_t v49 = v44; - bool v50 = v47; - while (v50) { - VAL v51 = (v48); - int64_t v52 = v49; - VAL v53 = (mw_mirth_arrow_Block_typecheckZBang(v51, ((uint64_t)v52))); - int64_t v54 = 1LL; - int64_t v55 = i64_add(v52, v54); - void* v56 = mbuf_mirth_arrow_Block_NUM; - int64_t v57 = *(int64_t*)v56; - bool v58 = (v55 <= v57); - v50 = v58; - v49 = v55; - v48 = v53; - } - int64_t v59 = 1LL; - void* v60 = mbuf_mirth_external_External_NUM; - int64_t v61 = *(int64_t*)v60; - bool v62 = (v59 <= v61); - VAL v63 = (v48); - int64_t v64 = v59; - bool v65 = v62; - while (v65) { - VAL v66 = (v63); - int64_t v67 = v64; - VAL v68; - VAL v69; - mw_mirth_external_External_ctype(v66, ((uint64_t)v67), &v68, &v69); - decref(v69); - int64_t v70 = 1LL; - int64_t v71 = i64_add(v67, v70); - void* v72 = mbuf_mirth_external_External_NUM; - int64_t v73 = *(int64_t*)v72; - bool v74 = (v71 <= v73); - v65 = v74; - v64 = v71; - v63 = v68; - } - return v63; + decref(v14); + int64_t v31 = 1LL; + int64_t v32 = i64_add(v10, v31); + void* v33 = mbuf_mirth_name_Name_NUM; + int64_t v34 = *(int64_t*)v33; + bool v35 = (v32 <= v34); + v8 = v35; + v7 = v32; + v6 = v13; + } + int64_t v36 = 1LL; + void* v37 = mbuf_mirth_arrow_Block_NUM; + int64_t v38 = *(int64_t*)v37; + bool v39 = (v36 <= v38); + VAL v40 = v6; + int64_t v41 = v36; + bool v42 = v39; + while (v42) { + VAL v43 = v40; + int64_t v44 = v41; + VAL v45 = mw_mirth_arrow_Block_typecheckZBang(v43, ((uint64_t)v44)); + int64_t v46 = 1LL; + int64_t v47 = i64_add(v44, v46); + void* v48 = mbuf_mirth_arrow_Block_NUM; + int64_t v49 = *(int64_t*)v48; + bool v50 = (v47 <= v49); + v42 = v50; + v41 = v47; + v40 = v45; + } + int64_t v51 = 1LL; + void* v52 = mbuf_mirth_external_External_NUM; + int64_t v53 = *(int64_t*)v52; + bool v54 = (v51 <= v53); + VAL v55 = v40; + int64_t v56 = v51; + bool v57 = v54; + while (v57) { + VAL v58 = v55; + int64_t v59 = v56; + VAL v60; + VAL v61; + mw_mirth_external_External_ctype(v58, ((uint64_t)v59), &v60, &v61); + decref(v61); + int64_t v62 = 1LL; + int64_t v63 = i64_add(v59, v62); + void* v64 = mbuf_mirth_external_External_NUM; + int64_t v65 = *(int64_t*)v64; + bool v66 = (v63 <= v65); + v57 = v66; + v56 = v63; + v55 = v60; + } + return v55; } static int64_t mw_mirth_elab_TABLEz_MAXz_COUNT (void) { int64_t v1 = 524288LL; int64_t v2 = 0LL; - bool v3 = (v1 < v2); - int64_t x4; - if (v3) { - x4 = v2; - } else { - x4 = v1; - } - return x4; + int64_t v3 = mw_std_prim_Int_max(v1, v2); + return v3; } static VAL mw_mirth_elab_tableZ_qname (uint64_t x1, VAL x2, int64_t x3) { uint64_t v4 = mw_std_prim_Str_ZToName(x2); @@ -60768,873 +44093,677 @@ static void mw_mirth_elab_tableZ_newZBang (VAL x1, uint64_t x2, uint64_t x3, VAL mut_set(MKU64(x2), v11); void* v12 = mfld_mirth_table_Table_ZTildename(v7); mut_set(MKU64(x3), v12); - push_resource(x1); - lpush(&lbl_tbl, MKU64(v7)); int64_t v13 = mw_mirth_elab_TABLEz_MAXz_COUNT(); - uint64_t v14 = VU64(lpop(&lbl_tbl)); - void* v15 = mfld_mirth_table_Table_ZTildemaxZ_count(v14); - mut_set(MKI64(v13), v15); - VAL v16 = mtw_mirth_def_Def_DefTable(v14); - VAL r17 = pop_resource(); - VAL v18 = (mw_mirth_def_Def_register(r17, v16)); - STR* v19; - STRLIT(v19, "MAX", 3); - int64_t v20 = 0LL; - VAL v21; - uint64_t v22; - mw_mirth_elab_tableZ_wordZ_newZBang(v18, v14, MKSTR(v19), v20, &v21, &v22); - VAL v23 = MKI64(0LL /* Nil */); - VAL v24 = mw_mirth_type_T0(); - VAL v25 = mw_mirth_type_TYPEz_INT(); - VAL v26 = mw_mirth_type_T1(v25); - VAL v27 = mw_mirth_type_TZ_ZTo(v24, v26); - VAL v28 = mtw_mirth_mirth_PropLabel_WordType(v22); - VAL v29; + void* v14 = mfld_mirth_table_Table_ZTildemaxZ_count(v7); + mut_set(MKI64(v13), v14); + VAL v15 = mtw_mirth_def_Def_DefTable(v7); + VAL v16 = mw_mirth_def_Def_register(x1, v15); + STR* v17; + STRLIT(v17, "MAX", 3); + int64_t v18 = 0LL; + VAL v19; + uint64_t v20; + mw_mirth_elab_tableZ_wordZ_newZBang(v16, v7, MKSTR(v17), v18, &v19, &v20); + VAL v21 = MKI64(0LL /* Nil */); + VAL v22 = mw_mirth_type_T0(); + VAL v23 = mw_mirth_type_TYPEz_INT(); + VAL v24 = mw_mirth_type_T1(v23); + VAL v25 = mw_mirth_type_TZ_ZTo(v22, v24); + VAL v26 = mtw_mirth_mirth_PropLabel_WordType(v20); + VAL v27; + VAL v28; + mw_mirth_mirth_PropLabel_prop2(v21, v25, v26, v19, &v27, &v28); + void* v29 = mfld_mirth_word_Word_ZTildectxZ_type(v20); + mut_set(v27, v29); VAL v30; - mw_mirth_mirth_PropLabel_prop2(v23, v27, v28, v21, &v29, &v30); - void* v31 = mfld_mirth_word_Word_ZTildectxZ_type(v22); - mut_set(v29, v31); + VAL v31; VAL v32; - VAL v33; + uint64_t v33; VAL v34; uint64_t v35; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v28, v20, &v30, &v31, &v32, &v33, &v34, &v35); VAL v36; - uint64_t v37; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v30, v22, &v32, &v33, &v34, &v35, &v36, &v37); - VAL v38; - VAL v39; - mw_mirth_type_ArrowType_unpack(v34, &v38, &v39); - incref(v38); - VAL v40 = MKI64(0LL /* Nil */); - VAL v41 = mtw_mirth_arrow_Arrow_Arrow(v36, v35, v35, v33, v38, v38, v40); - uint64_t v42 = mw_mirth_table_Table_head(v14); - VAL v43 = (mw_mirth_elab_abZ_tokenZBang(v41, v42)); - push_resource(v32); - lpush(&lbl_tbl, MKU64(v14)); - push_resource(v43); - int64_t v44 = mw_mirth_elab_TABLEz_MAXz_COUNT(); - VAL r45 = pop_resource(); - VAL r46 = pop_resource(); + VAL v37; + mw_mirth_type_ArrowType_unpack(v32, &v36, &v37); + incref(v36); + VAL v38 = MKI64(0LL /* Nil */); + VAL v39 = mtw_mirth_arrow_Arrow_Arrow(v34, v33, v33, v31, v36, v36, v38); + uint64_t v40 = mw_mirth_table_Table_head(v7); + VAL v41 = mw_mirth_elab_abZ_tokenZBang(v39, v40); + int64_t v42 = mw_mirth_elab_TABLEz_MAXz_COUNT(); + VAL v43; + VAL v44; + mw_mirth_elab_abZ_intZBang(v42, v30, v41, &v43, &v44); + VAL v45; + VAL v46; + mw_mirth_elab_abZ_unifyZ_typeZBang(v37, v43, v44, &v45, &v46); VAL v47; VAL v48; - mw_mirth_elab_abZ_intZBang(v44, r46, r45, &v47, &v48); - VAL v49; + mw_mirth_elab_finalizzeZ_wordZ_arrow(v45, v46, v35, &v47, &v48); + VAL v49 = mtw_mirth_mirth_PropLabel_WordArrow(v20); VAL v50; - mw_mirth_elab_abZ_unifyZ_typeZBang(v39, v47, v48, &v49, &v50); VAL v51; - VAL v52; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v49, v50, v37, &v51, &v52); - VAL v53 = mtw_mirth_mirth_PropLabel_WordArrow(v22); - VAL v54; + mw_mirth_mirth_PropLabel_prop(v48, v49, v47, &v50, &v51); + void* v52 = mfld_mirth_word_Word_ZTildearrow(v20); + mut_set(v50, v52); + STR* v53; + STRLIT(v53, "nil", 3); + int64_t v54 = 0LL; VAL v55; - mw_mirth_mirth_PropLabel_prop(v52, v53, v51, &v54, &v55); - void* v56 = mfld_mirth_word_Word_ZTildearrow(v22); - mut_set(v54, v56); - uint64_t v57 = VU64(lpop(&lbl_tbl)); - STR* v58; - STRLIT(v58, "nil", 3); - int64_t v59 = 0LL; - VAL v60; - uint64_t v61; - mw_mirth_elab_tableZ_wordZ_newZBang(v55, v57, MKSTR(v58), v59, &v60, &v61); - VAL v62 = MKI64(0LL /* Nil */); - VAL v63 = mw_mirth_type_T0(); - VAL v64 = mtw_mirth_type_Type_TTable(v57); - VAL v65 = mw_mirth_type_T1(v64); - VAL v66 = mw_mirth_type_TZ_ZTo(v63, v65); - VAL v67 = mtw_mirth_mirth_PropLabel_WordType(v61); + uint64_t v56; + mw_mirth_elab_tableZ_wordZ_newZBang(v51, v7, MKSTR(v53), v54, &v55, &v56); + VAL v57 = MKI64(0LL /* Nil */); + VAL v58 = mw_mirth_type_T0(); + VAL v59 = mtw_mirth_type_Type_TTable(v7); + VAL v60 = mw_mirth_type_T1(v59); + VAL v61 = mw_mirth_type_TZ_ZTo(v58, v60); + VAL v62 = mtw_mirth_mirth_PropLabel_WordType(v56); + VAL v63; + VAL v64; + mw_mirth_mirth_PropLabel_prop2(v57, v61, v62, v55, &v63, &v64); + void* v65 = mfld_mirth_word_Word_ZTildectxZ_type(v56); + mut_set(v63, v65); + VAL v66; + VAL v67; VAL v68; - VAL v69; - mw_mirth_mirth_PropLabel_prop2(v62, v66, v67, v60, &v68, &v69); - void* v70 = mfld_mirth_word_Word_ZTildectxZ_type(v61); - mut_set(v68, v70); - VAL v71; + uint64_t v69; + VAL v70; + uint64_t v71; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v64, v56, &v66, &v67, &v68, &v69, &v70, &v71); VAL v72; VAL v73; - uint64_t v74; - VAL v75; - uint64_t v76; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v69, v61, &v71, &v72, &v73, &v74, &v75, &v76); - VAL v77; - VAL v78; - mw_mirth_type_ArrowType_unpack(v73, &v77, &v78); - incref(v77); - VAL v79 = MKI64(0LL /* Nil */); - VAL v80 = mtw_mirth_arrow_Arrow_Arrow(v75, v74, v74, v72, v77, v77, v79); - uint64_t v81 = mw_mirth_table_Table_head(v57); - VAL v82 = (mw_mirth_elab_abZ_tokenZBang(v80, v81)); - int64_t v83 = 0LL; + mw_mirth_type_ArrowType_unpack(v68, &v72, &v73); + incref(v72); + VAL v74 = MKI64(0LL /* Nil */); + VAL v75 = mtw_mirth_arrow_Arrow_Arrow(v70, v69, v69, v67, v72, v72, v74); + uint64_t v76 = mw_mirth_table_Table_head(v7); + VAL v77 = mw_mirth_elab_abZ_tokenZBang(v75, v76); + int64_t v78 = 0LL; + VAL v79; + VAL v80; + mw_mirth_elab_abZ_intZBang(v78, v66, v77, &v79, &v80); + int64_t v81 = 0LL /* CoerceUnsafe */; + VAL v82; + VAL v83; + mw_mirth_elab_abZ_coerceZBang(v81, v79, v80, &v82, &v83); VAL v84; VAL v85; - mw_mirth_elab_abZ_intZBang(v83, v71, v82, &v84, &v85); - int64_t v86 = 0LL /* CoerceUnsafe */; + mw_mirth_elab_abZ_unifyZ_typeZBang(v73, v82, v83, &v84, &v85); + VAL v86; VAL v87; - VAL v88; - mw_mirth_elab_abZ_coerceZBang(v86, v84, v85, &v87, &v88); + mw_mirth_elab_finalizzeZ_wordZ_arrow(v84, v85, v71, &v86, &v87); + VAL v88 = mtw_mirth_mirth_PropLabel_WordArrow(v56); VAL v89; VAL v90; - mw_mirth_elab_abZ_unifyZ_typeZBang(v78, v87, v88, &v89, &v90); - VAL v91; - VAL v92; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v89, v90, v76, &v91, &v92); - VAL v93 = mtw_mirth_mirth_PropLabel_WordArrow(v61); - VAL v94; - VAL v95; - mw_mirth_mirth_PropLabel_prop(v92, v93, v91, &v94, &v95); - void* v96 = mfld_mirth_word_Word_ZTildearrow(v61); - mut_set(v94, v96); - uint64_t v97 = mw_mirth_table_Table_head(v57); - STR* v98; - STRLIT(v98, "NUM", 3); - int64_t v99 = 0LL; - VAL v100 = mw_mirth_elab_tableZ_qname(v57, MKSTR(v98), v99); - int64_t v101 = 8LL; + mw_mirth_mirth_PropLabel_prop(v87, v88, v86, &v89, &v90); + void* v91 = mfld_mirth_word_Word_ZTildearrow(v56); + mut_set(v89, v91); + uint64_t v92 = mw_mirth_table_Table_head(v7); + STR* v93; + STRLIT(v93, "NUM", 3); + int64_t v94 = 0LL; + VAL v95 = mw_mirth_elab_tableZ_qname(v7, MKSTR(v93), v94); + int64_t v96 = 8LL; + VAL v97; + uint64_t v98; + mw_mirth_buffer_Buffer_newZBang(v90, v92, v95, v96, &v97, &v98); + void* v99 = mfld_mirth_table_Table_ZTildenumZ_buffer(v7); + mut_set(MKU64(v98), v99); + STR* v100; + STRLIT(v100, "index", 5); + int64_t v101 = 0LL; VAL v102; uint64_t v103; - mw_mirth_buffer_Buffer_newZBang(v95, v97, v100, v101, &v102, &v103); - void* v104 = mfld_mirth_table_Table_ZTildenumZ_buffer(v57); - mut_set(MKU64(v103), v104); - STR* v105; - STRLIT(v105, "index", 5); - int64_t v106 = 0LL; - VAL v107; - uint64_t v108; - mw_mirth_elab_tableZ_wordZ_newZBang(v102, v57, MKSTR(v105), v106, &v107, &v108); - VAL v109 = MKI64(0LL /* Nil */); - VAL v110 = mtw_mirth_type_Type_TTable(v57); - VAL v111 = mw_mirth_type_T1(v110); - VAL v112 = mw_mirth_type_TYPEz_INT(); - VAL v113 = mw_mirth_type_T1(v112); - VAL v114 = mw_mirth_type_TZ_ZTo(v111, v113); - VAL v115 = mtw_mirth_mirth_PropLabel_WordType(v108); - VAL v116; - VAL v117; - mw_mirth_mirth_PropLabel_prop2(v109, v114, v115, v107, &v116, &v117); - void* v118 = mfld_mirth_word_Word_ZTildectxZ_type(v108); - mut_set(v116, v118); + mw_mirth_elab_tableZ_wordZ_newZBang(v97, v7, MKSTR(v100), v101, &v102, &v103); + VAL v104 = MKI64(0LL /* Nil */); + VAL v105 = mtw_mirth_type_Type_TTable(v7); + VAL v106 = mw_mirth_type_T1(v105); + VAL v107 = mw_mirth_type_TYPEz_INT(); + VAL v108 = mw_mirth_type_T1(v107); + VAL v109 = mw_mirth_type_TZ_ZTo(v106, v108); + VAL v110 = mtw_mirth_mirth_PropLabel_WordType(v103); + VAL v111; + VAL v112; + mw_mirth_mirth_PropLabel_prop2(v104, v109, v110, v102, &v111, &v112); + void* v113 = mfld_mirth_word_Word_ZTildectxZ_type(v103); + mut_set(v111, v113); + uint64_t v114; + VAL v115; + uint64_t v116; + mw_mirth_elab_abZ_buildZ_wordZBang_1_sp6(v7, v112, v103, &v114, &v115, &v116); + STR* v117; + STRLIT(v117, "from-index", 10); + int64_t v118 = 0LL; VAL v119; - VAL v120; - VAL v121; - uint64_t v122; - VAL v123; - uint64_t v124; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v117, v108, &v119, &v120, &v121, &v122, &v123, &v124); - VAL v125; - VAL v126; - mw_mirth_type_ArrowType_unpack(v121, &v125, &v126); - incref(v125); - VAL v127 = MKI64(0LL /* Nil */); - VAL v128 = mtw_mirth_arrow_Arrow_Arrow(v123, v122, v122, v120, v125, v125, v127); - uint64_t v129 = mw_mirth_table_Table_head(v57); - VAL v130 = (mw_mirth_elab_abZ_tokenZBang(v128, v129)); - int64_t v131 = 0LL /* CoerceUnsafe */; + uint64_t v120; + mw_mirth_elab_tableZ_wordZ_newZBang(v115, v114, MKSTR(v117), v118, &v119, &v120); + VAL v121 = MKI64(0LL /* Nil */); + VAL v122 = mtw_mirth_type_Type_TTable(v114); + VAL v123 = mw_mirth_type_T1(v122); + VAL v124 = mw_mirth_type_TYPEz_INT(); + VAL v125 = mw_mirth_type_T1(v124); + VAL v126 = mw_mirth_type_TZ_ZTo(v125, v123); + VAL v127 = mtw_mirth_mirth_PropLabel_WordType(v120); + VAL v128; + VAL v129; + mw_mirth_mirth_PropLabel_prop2(v121, v126, v127, v119, &v128, &v129); + void* v130 = mfld_mirth_word_Word_ZTildectxZ_type(v120); + mut_set(v128, v130); + uint64_t v131; VAL v132; - VAL v133; - mw_mirth_elab_abZ_coerceZBang(v131, v119, v130, &v132, &v133); - VAL v134; - VAL v135; - mw_mirth_elab_abZ_unifyZ_typeZBang(v126, v132, v133, &v134, &v135); + uint64_t v133; + mw_mirth_elab_abZ_buildZ_wordZBang_1_sp6(v114, v129, v120, &v131, &v132, &v133); + STR* v134; + STRLIT(v134, "succ", 4); + int64_t v135 = 0LL; VAL v136; - VAL v137; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v134, v135, v124, &v136, &v137); - VAL v138 = mtw_mirth_mirth_PropLabel_WordArrow(v108); - VAL v139; - VAL v140; - mw_mirth_mirth_PropLabel_prop(v137, v138, v136, &v139, &v140); - void* v141 = mfld_mirth_word_Word_ZTildearrow(v108); - mut_set(v139, v141); - STR* v142; - STRLIT(v142, "from-index", 10); - int64_t v143 = 0LL; + uint64_t v137; + mw_mirth_elab_tableZ_wordZ_newZBang(v132, v131, MKSTR(v134), v135, &v136, &v137); + VAL v138 = MKI64(0LL /* Nil */); + VAL v139 = mtw_mirth_type_Type_TTable(v131); + VAL v140 = mw_mirth_type_T1(v139); + incref(v140); + VAL v141 = mw_mirth_type_TZ_ZTo(v140, v140); + VAL v142 = mtw_mirth_mirth_PropLabel_WordType(v137); + VAL v143; VAL v144; - uint64_t v145; - mw_mirth_elab_tableZ_wordZ_newZBang(v140, v57, MKSTR(v142), v143, &v144, &v145); - VAL v146 = MKI64(0LL /* Nil */); - VAL v147 = mtw_mirth_type_Type_TTable(v57); - VAL v148 = mw_mirth_type_T1(v147); - VAL v149 = mw_mirth_type_TYPEz_INT(); - VAL v150 = mw_mirth_type_T1(v149); - VAL v151 = mw_mirth_type_TZ_ZTo(v150, v148); - VAL v152 = mtw_mirth_mirth_PropLabel_WordType(v145); + mw_mirth_mirth_PropLabel_prop2(v138, v141, v142, v136, &v143, &v144); + void* v145 = mfld_mirth_word_Word_ZTildectxZ_type(v137); + mut_set(v143, v145); + VAL v146; + VAL v147; + VAL v148; + uint64_t v149; + VAL v150; + uint64_t v151; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v144, v137, &v146, &v147, &v148, &v149, &v150, &v151); + VAL v152; VAL v153; - VAL v154; - mw_mirth_mirth_PropLabel_prop2(v146, v151, v152, v144, &v153, &v154); - void* v155 = mfld_mirth_word_Word_ZTildectxZ_type(v145); - mut_set(v153, v155); - VAL v156; - VAL v157; - VAL v158; - uint64_t v159; + mw_mirth_type_ArrowType_unpack(v148, &v152, &v153); + incref(v152); + VAL v154 = MKI64(0LL /* Nil */); + VAL v155 = mtw_mirth_arrow_Arrow_Arrow(v150, v149, v149, v147, v152, v152, v154); + uint64_t v156 = mw_mirth_table_Table_head(v131); + VAL v157 = mw_mirth_elab_abZ_tokenZBang(v155, v156); + int64_t v158 = 0LL /* CoerceUnsafe */; + VAL v159; VAL v160; - uint64_t v161; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v154, v145, &v156, &v157, &v158, &v159, &v160, &v161); + mw_mirth_elab_abZ_coerceZBang(v158, v146, v157, &v159, &v160); + int64_t v161 = 1LL; VAL v162; VAL v163; - mw_mirth_type_ArrowType_unpack(v158, &v162, &v163); - incref(v162); - VAL v164 = MKI64(0LL /* Nil */); - VAL v165 = mtw_mirth_arrow_Arrow_Arrow(v160, v159, v159, v157, v162, v162, v164); - uint64_t v166 = mw_mirth_table_Table_head(v57); - VAL v167 = (mw_mirth_elab_abZ_tokenZBang(v165, v166)); - int64_t v168 = 0LL /* CoerceUnsafe */; + mw_mirth_elab_abZ_intZBang(v161, v159, v160, &v162, &v163); + int64_t v164 = 20LL /* PRIM_INT_ADD */; + VAL v165; + VAL v166; + mw_mirth_elab_abZ_primZBang(v164, v162, v163, &v165, &v166); + uint64_t v167 = mw_mirth_table_Table_numZ_buffer(v131); + VAL v168; VAL v169; - VAL v170; - mw_mirth_elab_abZ_coerceZBang(v168, v156, v167, &v169, &v170); + mw_mirth_elab_abZ_bufferZBang(v167, v165, v166, &v168, &v169); + int64_t v170 = 83LL /* PRIM_U64_GET */; VAL v171; VAL v172; - mw_mirth_elab_abZ_unifyZ_typeZBang(v163, v169, v170, &v171, &v172); - VAL v173; + mw_mirth_elab_abZ_primZBang(v170, v168, v169, &v171, &v172); + int64_t v173 = 0LL /* CoerceUnsafe */; VAL v174; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v171, v172, v161, &v173, &v174); - VAL v175 = mtw_mirth_mirth_PropLabel_WordArrow(v145); - VAL v176; + VAL v175; + mw_mirth_elab_abZ_coerceZBang(v173, v171, v172, &v174, &v175); + int64_t v176 = 1LL; VAL v177; - mw_mirth_mirth_PropLabel_prop(v174, v175, v173, &v176, &v177); - void* v178 = mfld_mirth_word_Word_ZTildearrow(v145); - mut_set(v176, v178); - STR* v179; - STRLIT(v179, "succ", 4); - int64_t v180 = 0LL; + VAL v178; + mw_mirth_elab_abZ_intZBang(v176, v174, v175, &v177, &v178); + int64_t v179 = 20LL /* PRIM_INT_ADD */; + VAL v180; VAL v181; - uint64_t v182; - mw_mirth_elab_tableZ_wordZ_newZBang(v177, v57, MKSTR(v179), v180, &v181, &v182); - VAL v183 = MKI64(0LL /* Nil */); - VAL v184 = mtw_mirth_type_Type_TTable(v57); - VAL v185 = mw_mirth_type_T1(v184); - incref(v185); - VAL v186 = mw_mirth_type_TZ_ZTo(v185, v185); - VAL v187 = mtw_mirth_mirth_PropLabel_WordType(v182); + mw_mirth_elab_abZ_primZBang(v179, v177, v178, &v180, &v181); + int64_t v182 = 24LL /* PRIM_INT_MOD */; + VAL v183; + VAL v184; + mw_mirth_elab_abZ_primZBang(v182, v180, v181, &v183, &v184); + int64_t v185 = 0LL /* CoerceUnsafe */; + VAL v186; + VAL v187; + mw_mirth_elab_abZ_coerceZBang(v185, v183, v184, &v186, &v187); VAL v188; VAL v189; - mw_mirth_mirth_PropLabel_prop2(v183, v186, v187, v181, &v188, &v189); - void* v190 = mfld_mirth_word_Word_ZTildectxZ_type(v182); - mut_set(v188, v190); + mw_mirth_elab_abZ_unifyZ_typeZBang(v153, v186, v187, &v188, &v189); + VAL v190; VAL v191; - VAL v192; + mw_mirth_elab_finalizzeZ_wordZ_arrow(v188, v189, v151, &v190, &v191); + VAL v192 = mtw_mirth_mirth_PropLabel_WordArrow(v137); VAL v193; - uint64_t v194; - VAL v195; - uint64_t v196; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v189, v182, &v191, &v192, &v193, &v194, &v195, &v196); - VAL v197; + VAL v194; + mw_mirth_mirth_PropLabel_prop(v191, v192, v190, &v193, &v194); + void* v195 = mfld_mirth_word_Word_ZTildearrow(v137); + mut_set(v193, v195); + STR* v196; + STRLIT(v196, "pred", 4); + int64_t v197 = 0LL; VAL v198; - mw_mirth_type_ArrowType_unpack(v193, &v197, &v198); - incref(v197); - VAL v199 = MKI64(0LL /* Nil */); - VAL v200 = mtw_mirth_arrow_Arrow_Arrow(v195, v194, v194, v192, v197, v197, v199); - uint64_t v201 = mw_mirth_table_Table_head(v57); - VAL v202 = (mw_mirth_elab_abZ_tokenZBang(v200, v201)); - int64_t v203 = 0LL /* CoerceUnsafe */; - VAL v204; + uint64_t v199; + mw_mirth_elab_tableZ_wordZ_newZBang(v194, v131, MKSTR(v196), v197, &v198, &v199); + VAL v200 = MKI64(0LL /* Nil */); + VAL v201 = mtw_mirth_type_Type_TTable(v131); + VAL v202 = mw_mirth_type_T1(v201); + incref(v202); + VAL v203 = mw_mirth_type_TZ_ZTo(v202, v202); + VAL v204 = mtw_mirth_mirth_PropLabel_WordType(v199); VAL v205; - mw_mirth_elab_abZ_coerceZBang(v203, v191, v202, &v204, &v205); - int64_t v206 = 1LL; - VAL v207; + VAL v206; + mw_mirth_mirth_PropLabel_prop2(v200, v203, v204, v198, &v205, &v206); + void* v207 = mfld_mirth_word_Word_ZTildectxZ_type(v199); + mut_set(v205, v207); VAL v208; - mw_mirth_elab_abZ_intZBang(v206, v204, v205, &v207, &v208); - int64_t v209 = 20LL /* PRIM_INT_ADD */; + VAL v209; VAL v210; - VAL v211; - mw_mirth_elab_abZ_primZBang(v209, v207, v208, &v210, &v211); - uint64_t v212 = mw_mirth_table_Table_numZ_buffer(v57); - VAL v213; + uint64_t v211; + VAL v212; + uint64_t v213; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v206, v199, &v208, &v209, &v210, &v211, &v212, &v213); VAL v214; - mw_mirth_elab_abZ_bufferZBang(v212, v210, v211, &v213, &v214); - int64_t v215 = 83LL /* PRIM_U64_GET */; - VAL v216; - VAL v217; - mw_mirth_elab_abZ_primZBang(v215, v213, v214, &v216, &v217); - int64_t v218 = 0LL /* CoerceUnsafe */; - VAL v219; - VAL v220; - mw_mirth_elab_abZ_coerceZBang(v218, v216, v217, &v219, &v220); - int64_t v221 = 1LL; + VAL v215; + mw_mirth_type_ArrowType_unpack(v210, &v214, &v215); + incref(v214); + VAL v216 = MKI64(0LL /* Nil */); + VAL v217 = mtw_mirth_arrow_Arrow_Arrow(v212, v211, v211, v209, v214, v214, v216); + uint64_t v218 = mw_mirth_table_Table_head(v131); + VAL v219 = mw_mirth_elab_abZ_tokenZBang(v217, v218); + int64_t v220 = 0LL /* CoerceUnsafe */; + VAL v221; VAL v222; - VAL v223; - mw_mirth_elab_abZ_intZBang(v221, v219, v220, &v222, &v223); - int64_t v224 = 20LL /* PRIM_INT_ADD */; + mw_mirth_elab_abZ_coerceZBang(v220, v208, v219, &v221, &v222); + int64_t v223 = 1LL /* PRIM_CORE_DUP */; + VAL v224; VAL v225; - VAL v226; - mw_mirth_elab_abZ_primZBang(v224, v222, v223, &v225, &v226); - int64_t v227 = 24LL /* PRIM_INT_MOD */; + mw_mirth_elab_abZ_primZBang(v223, v221, v222, &v224, &v225); + int64_t v226 = 0LL; + VAL v227; VAL v228; - VAL v229; - mw_mirth_elab_abZ_primZBang(v227, v225, v226, &v228, &v229); - int64_t v230 = 0LL /* CoerceUnsafe */; + mw_mirth_elab_abZ_intZBang(v226, v224, v225, &v227, &v228); + int64_t v229 = 14LL /* PRIM_INT_EQ */; + VAL v230; VAL v231; + mw_mirth_elab_abZ_primZBang(v229, v227, v228, &v230, &v231); VAL v232; - mw_mirth_elab_abZ_coerceZBang(v230, v228, v229, &v231, &v232); - VAL v233; + uint64_t v233; + mw_mirth_elab_abZ_tokenZAt(v231, &v232, &v233); VAL v234; - mw_mirth_elab_abZ_unifyZ_typeZBang(v198, v231, v232, &v233, &v234); VAL v235; - VAL v236; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v233, v234, v196, &v235, &v236); - VAL v237 = mtw_mirth_mirth_PropLabel_WordArrow(v182); + mw_mirth_elab_abZ_ctxZAt(v232, &v234, &v235); + uint64_t v236 = mw_mirth_type_MetaVar_newZBang(); + VAL v237 = mtw_mirth_type_StackType_STMeta(v236); VAL v238; VAL v239; - mw_mirth_mirth_PropLabel_prop(v236, v237, v235, &v238, &v239); - void* v240 = mfld_mirth_word_Word_ZTildearrow(v182); - mut_set(v238, v240); - STR* v241; - STRLIT(v241, "pred", 4); - int64_t v242 = 0LL; - VAL v243; - uint64_t v244; - mw_mirth_elab_tableZ_wordZ_newZBang(v239, v57, MKSTR(v241), v242, &v243, &v244); - VAL v245 = MKI64(0LL /* Nil */); - VAL v246 = mtw_mirth_type_Type_TTable(v57); - VAL v247 = mw_mirth_type_T1(v246); - incref(v247); - VAL v248 = mw_mirth_type_TZ_ZTo(v247, v247); - VAL v249 = mtw_mirth_mirth_PropLabel_WordType(v244); + mw_mirth_elab_abZ_homeZAt(v234, &v238, &v239); + incref(v237); + VAL v240 = MKI64(0LL /* Nil */); + VAL v241 = mtw_mirth_arrow_Arrow_Arrow(v239, v233, v233, v235, v237, v237, v240); + VAL v242; + uint64_t v243; + mw_mirth_arrow_Block_newZBang(v230, v241, &v242, &v243); + VAL v244 = mtw_mirth_arrow_Op_OpBlockPush(v243); + VAL v245; + VAL v246; + mw_mirth_elab_abZ_opZBang(v244, v242, v238, &v245, &v246); + VAL v247; + uint64_t v248; + mw_mirth_elab_abZ_tokenZAt(v246, &v247, &v248); + VAL v249; VAL v250; - VAL v251; - mw_mirth_mirth_PropLabel_prop2(v245, v248, v249, v243, &v250, &v251); - void* v252 = mfld_mirth_word_Word_ZTildectxZ_type(v244); - mut_set(v250, v252); + mw_mirth_elab_abZ_ctxZAt(v247, &v249, &v250); + uint64_t v251 = mw_mirth_type_MetaVar_newZBang(); + VAL v252 = mtw_mirth_type_StackType_STMeta(v251); VAL v253; VAL v254; - VAL v255; - uint64_t v256; - VAL v257; - uint64_t v258; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v251, v244, &v253, &v254, &v255, &v256, &v257, &v258); + mw_mirth_elab_abZ_homeZAt(v249, &v253, &v254); + incref(v252); + VAL v255 = MKI64(0LL /* Nil */); + VAL v256 = mtw_mirth_arrow_Arrow_Arrow(v254, v248, v248, v250, v252, v252, v255); + int64_t v257 = 1LL; + VAL v258; VAL v259; - VAL v260; - mw_mirth_type_ArrowType_unpack(v255, &v259, &v260); - incref(v259); - VAL v261 = MKI64(0LL /* Nil */); - VAL v262 = mtw_mirth_arrow_Arrow_Arrow(v257, v256, v256, v254, v259, v259, v261); - uint64_t v263 = mw_mirth_table_Table_head(v57); - VAL v264 = (mw_mirth_elab_abZ_tokenZBang(v262, v263)); - int64_t v265 = 0LL /* CoerceUnsafe */; + mw_mirth_elab_abZ_intZBang(v257, v245, v256, &v258, &v259); + int64_t v260 = 21LL /* PRIM_INT_SUB */; + VAL v261; + VAL v262; + mw_mirth_elab_abZ_primZBang(v260, v258, v259, &v261, &v262); + VAL v263; + uint64_t v264; + mw_mirth_arrow_Block_newZBang(v261, v262, &v263, &v264); + VAL v265 = mtw_mirth_arrow_Op_OpBlockPush(v264); VAL v266; VAL v267; - mw_mirth_elab_abZ_coerceZBang(v265, v253, v264, &v266, &v267); - int64_t v268 = 1LL /* PRIM_CORE_DUP */; + mw_mirth_elab_abZ_opZBang(v265, v263, v253, &v266, &v267); + int64_t v268 = 7LL /* PRIM_CORE_IF */; VAL v269; VAL v270; mw_mirth_elab_abZ_primZBang(v268, v266, v267, &v269, &v270); - int64_t v271 = 0LL; + int64_t v271 = 0LL /* CoerceUnsafe */; VAL v272; VAL v273; - mw_mirth_elab_abZ_intZBang(v271, v269, v270, &v272, &v273); - int64_t v274 = 14LL /* PRIM_INT_EQ */; + mw_mirth_elab_abZ_coerceZBang(v271, v269, v270, &v272, &v273); + VAL v274; VAL v275; + mw_mirth_elab_abZ_unifyZ_typeZBang(v215, v272, v273, &v274, &v275); VAL v276; - mw_mirth_elab_abZ_primZBang(v274, v272, v273, &v275, &v276); VAL v277; - uint64_t v278; - mw_mirth_elab_abZ_tokenZAt(v276, &v277, &v278); + mw_mirth_elab_finalizzeZ_wordZ_arrow(v274, v275, v213, &v276, &v277); + VAL v278 = mtw_mirth_mirth_PropLabel_WordArrow(v199); VAL v279; VAL v280; - mw_mirth_elab_abZ_ctxZAt(v277, &v279, &v280); - uint64_t v281 = mw_mirth_type_MetaVar_newZBang(); - VAL v282 = mtw_mirth_type_StackType_STMeta(v281); - VAL v283; + mw_mirth_mirth_PropLabel_prop(v277, v278, v276, &v279, &v280); + void* v281 = mfld_mirth_word_Word_ZTildearrow(v199); + mut_set(v279, v281); + STR* v282; + STRLIT(v282, "for", 3); + int64_t v283 = 1LL; VAL v284; - mw_mirth_elab_abZ_homeZAt(v279, &v283, &v284); - incref(v282); - VAL v285 = MKI64(0LL /* Nil */); - VAL v286 = mtw_mirth_arrow_Arrow_Arrow(v284, v278, v278, v280, v282, v282, v285); - VAL v287; - uint64_t v288; - mw_mirth_arrow_Block_newZBang(v275, v286, &v287, &v288); - VAL v289 = mtw_mirth_arrow_Op_OpBlockPush(v288); - VAL v290; - VAL v291; - mw_mirth_elab_abZ_opZBang(v289, v287, v283, &v290, &v291); - VAL v292; - uint64_t v293; - mw_mirth_elab_abZ_tokenZAt(v291, &v292, &v293); - VAL v294; - VAL v295; - mw_mirth_elab_abZ_ctxZAt(v292, &v294, &v295); - uint64_t v296 = mw_mirth_type_MetaVar_newZBang(); - VAL v297 = mtw_mirth_type_StackType_STMeta(v296); - VAL v298; - VAL v299; - mw_mirth_elab_abZ_homeZAt(v294, &v298, &v299); - incref(v297); - VAL v300 = MKI64(0LL /* Nil */); - VAL v301 = mtw_mirth_arrow_Arrow_Arrow(v299, v293, v293, v295, v297, v297, v300); - int64_t v302 = 1LL; - VAL v303; - VAL v304; - mw_mirth_elab_abZ_intZBang(v302, v290, v301, &v303, &v304); - int64_t v305 = 21LL /* PRIM_INT_SUB */; + uint64_t v285; + mw_mirth_elab_tableZ_wordZ_newZBang(v280, v131, MKSTR(v282), v283, &v284, &v285); + VAL v286 = mw_mirth_type_TYPEz_STACK(); + STR* v287; + STRLIT(v287, "*a", 2); + uint64_t v288 = mw_std_prim_Str_ZToName(MKSTR(v287)); + uint64_t v289 = mw_mirth_var_Var_newZBang(v286, v288); + VAL v290 = mtw_mirth_type_StackType_STVar(v289); + VAL v291 = mtw_mirth_type_Type_TTable(v131); + VAL v292 = mw_mirth_type_TZMul(v290, v291); + VAL v293 = mtw_mirth_type_StackType_STVar(v289); + VAL v294 = mw_mirth_type_TZ_ZTo(v292, v293); + STR* v295; + STRLIT(v295, "f", 1); + uint64_t v296 = mw_std_prim_Str_ZToName(MKSTR(v295)); + uint64_t v297 = mw_mirth_var_Var_newZ_autoZ_runZBang(v294, v296); + VAL v298 = mw_mirth_var_Ctx1(v289); + VAL v299 = mtw_mirth_type_StackType_STVar(v289); + VAL v300 = mw_mirth_var_Var_type(v297); + VAL v301 = mw_mirth_type_TZMul(v299, v300); + VAL v302 = mtw_mirth_type_StackType_STVar(v289); + VAL v303 = mw_mirth_type_TZ_ZTo(v301, v302); + VAL v304 = mtw_mirth_mirth_PropLabel_WordType(v285); + VAL v305; VAL v306; - VAL v307; - mw_mirth_elab_abZ_primZBang(v305, v303, v304, &v306, &v307); - VAL v308; - uint64_t v309; - mw_mirth_arrow_Block_newZBang(v306, v307, &v308, &v309); - VAL v310 = mtw_mirth_arrow_Op_OpBlockPush(v309); + mw_mirth_mirth_PropLabel_prop2(v298, v303, v304, v284, &v305, &v306); + void* v307 = mfld_mirth_word_Word_ZTildectxZ_type(v285); + mut_set(v305, v307); + VAL v308 = MKI64(0LL /* Nil */); + VAL v309 = mtw_std_list_List_1_Cons(MKU64(v297), v308); + VAL v310 = mtw_mirth_mirth_PropLabel_WordParams(v285); VAL v311; VAL v312; - mw_mirth_elab_abZ_opZBang(v310, v308, v298, &v311, &v312); - int64_t v313 = 7LL /* PRIM_CORE_IF */; + mw_mirth_mirth_PropLabel_prop(v309, v310, v306, &v311, &v312); + void* v313 = mfld_mirth_word_Word_ZTildeparams(v285); + mut_set(v311, v313); + mw_mirth_word_Word_makeZ_inlineZBang(v285); VAL v314; VAL v315; - mw_mirth_elab_abZ_primZBang(v313, v311, v312, &v314, &v315); - int64_t v316 = 0LL /* CoerceUnsafe */; - VAL v317; + VAL v316; + uint64_t v317; VAL v318; - mw_mirth_elab_abZ_coerceZBang(v316, v314, v315, &v317, &v318); - VAL v319; + uint64_t v319; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v312, v285, &v314, &v315, &v316, &v317, &v318, &v319); VAL v320; - mw_mirth_elab_abZ_unifyZ_typeZBang(v260, v317, v318, &v319, &v320); VAL v321; - VAL v322; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v319, v320, v258, &v321, &v322); - VAL v323 = mtw_mirth_mirth_PropLabel_WordArrow(v244); - VAL v324; - VAL v325; - mw_mirth_mirth_PropLabel_prop(v322, v323, v321, &v324, &v325); - void* v326 = mfld_mirth_word_Word_ZTildearrow(v244); - mut_set(v324, v326); - STR* v327; - STRLIT(v327, "for", 3); - int64_t v328 = 1LL; - VAL v329; - uint64_t v330; - mw_mirth_elab_tableZ_wordZ_newZBang(v325, v57, MKSTR(v327), v328, &v329, &v330); - VAL v331 = mw_mirth_type_TYPEz_STACK(); - STR* v332; - STRLIT(v332, "*a", 2); - uint64_t v333 = mw_std_prim_Str_ZToName(MKSTR(v332)); - uint64_t v334 = mw_mirth_var_Var_newZBang(v331, v333); - VAL v335 = mtw_mirth_type_StackType_STVar(v334); - VAL v336 = mtw_mirth_type_Type_TTable(v57); - VAL v337 = mw_mirth_type_TZMul(v335, v336); - VAL v338 = mtw_mirth_type_StackType_STVar(v334); - VAL v339 = mw_mirth_type_TZ_ZTo(v337, v338); - STR* v340; - STRLIT(v340, "f", 1); - uint64_t v341 = mw_std_prim_Str_ZToName(MKSTR(v340)); - uint64_t v342 = mw_mirth_var_Var_newZ_autoZ_runZBang(v339, v341); - VAL v343 = mw_mirth_var_Ctx1(v334); - VAL v344 = mtw_mirth_type_StackType_STVar(v334); - VAL v345 = mw_mirth_var_Var_type(v342); - VAL v346 = mw_mirth_type_TZMul(v344, v345); - VAL v347 = mtw_mirth_type_StackType_STVar(v334); - VAL v348 = mw_mirth_type_TZ_ZTo(v346, v347); - VAL v349 = mtw_mirth_mirth_PropLabel_WordType(v330); - VAL v350; + mw_mirth_type_ArrowType_unpack(v316, &v320, &v321); + incref(v320); + VAL v322 = MKI64(0LL /* Nil */); + VAL v323 = mtw_mirth_arrow_Arrow_Arrow(v318, v317, v317, v315, v320, v320, v322); + uint64_t v324 = mw_mirth_table_Table_head(v131); + VAL v325 = mw_mirth_elab_abZ_tokenZBang(v323, v324); + VAL v326 = MKI64(0LL /* Nil */); + VAL v327 = mtw_std_list_List_1_Cons(MKU64(v297), v326); + VAL v328; + uint64_t v329; + mw_mirth_elab_abZ_tokenZAt(v325, &v328, &v329); + incref(v327); + VAL v330; + VAL v331; + mw_mirth_elab_abZ_ctxZAt(v328, &v330, &v331); + VAL v332; + VAL v333; + mw_mirth_elab_abZ_typeZAt(v330, &v332, &v333); + VAL v334; + VAL v335; + VAL v336; + VAL v337; + mw_std_list_List_1_reverseZ_for_1_sp9(v314, v332, v331, v333, v327, &v334, &v335, &v336, &v337); + VAL v338; + VAL v339; + mw_mirth_elab_abZ_homeZAt(v335, &v338, &v339); + incref(v337); + VAL v340 = MKI64(0LL /* Nil */); + VAL v341 = mtw_mirth_arrow_Arrow_Arrow(v339, v329, v329, v336, v337, v337, v340); + int64_t v342 = 1LL; + VAL v343; + VAL v344; + mw_mirth_elab_abZ_intZBang(v342, v334, v341, &v343, &v344); + VAL v345; + uint64_t v346; + mw_mirth_elab_abZ_tokenZAt(v344, &v345, &v346); + VAL v347; + VAL v348; + mw_mirth_elab_abZ_ctxZAt(v345, &v347, &v348); + uint64_t v349 = mw_mirth_type_MetaVar_newZBang(); + VAL v350 = mtw_mirth_type_StackType_STMeta(v349); VAL v351; - mw_mirth_mirth_PropLabel_prop2(v343, v348, v349, v329, &v350, &v351); - void* v352 = mfld_mirth_word_Word_ZTildectxZ_type(v330); - mut_set(v350, v352); + VAL v352; + mw_mirth_elab_abZ_homeZAt(v347, &v351, &v352); + incref(v350); VAL v353 = MKI64(0LL /* Nil */); - VAL v354 = mtw_std_list_List_1_Cons(MKU64(v342), v353); - VAL v355 = mtw_mirth_mirth_PropLabel_WordParams(v330); + VAL v354 = mtw_mirth_arrow_Arrow_Arrow(v352, v346, v346, v348, v350, v350, v353); + int64_t v355 = 1LL /* PRIM_CORE_DUP */; VAL v356; VAL v357; - mw_mirth_mirth_PropLabel_prop(v354, v355, v351, &v356, &v357); - void* v358 = mfld_mirth_word_Word_ZTildeparams(v330); - mut_set(v356, v358); - mw_mirth_word_Word_makeZ_inlineZBang(v330); + mw_mirth_elab_abZ_primZBang(v355, v343, v354, &v356, &v357); + uint64_t v358 = mw_mirth_table_Table_numZ_buffer(v131); VAL v359; VAL v360; - VAL v361; - uint64_t v362; + mw_mirth_elab_abZ_bufferZBang(v358, v356, v357, &v359, &v360); + int64_t v361 = 87LL /* PRIM_I64_GET */; + VAL v362; VAL v363; - uint64_t v364; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v357, v330, &v359, &v360, &v361, &v362, &v363, &v364); + mw_mirth_elab_abZ_primZBang(v361, v359, v360, &v362, &v363); + int64_t v364 = 0LL /* CoerceUnsafe */; VAL v365; VAL v366; - mw_mirth_type_ArrowType_unpack(v361, &v365, &v366); - incref(v365); - VAL v367 = MKI64(0LL /* Nil */); - VAL v368 = mtw_mirth_arrow_Arrow_Arrow(v363, v362, v362, v360, v365, v365, v367); - uint64_t v369 = mw_mirth_table_Table_head(v57); - VAL v370 = (mw_mirth_elab_abZ_tokenZBang(v368, v369)); - VAL v371 = MKI64(0LL /* Nil */); - VAL v372 = mtw_std_list_List_1_Cons(MKU64(v342), v371); + mw_mirth_elab_abZ_coerceZBang(v364, v362, v363, &v365, &v366); + int64_t v367 = 16LL /* PRIM_INT_LE */; + VAL v368; + VAL v369; + mw_mirth_elab_abZ_primZBang(v367, v365, v366, &v368, &v369); + VAL v370; + uint64_t v371; + mw_mirth_arrow_Block_newZBang(v368, v369, &v370, &v371); + VAL v372 = mtw_mirth_arrow_Op_OpBlockPush(v371); VAL v373; - uint64_t v374; - mw_mirth_elab_abZ_tokenZAt(v370, &v373, &v374); - incref(v372); + VAL v374; + mw_mirth_elab_abZ_opZBang(v372, v370, v351, &v373, &v374); VAL v375; - VAL v376; - mw_mirth_elab_abZ_ctxZAt(v373, &v375, &v376); + uint64_t v376; + mw_mirth_elab_abZ_tokenZAt(v374, &v375, &v376); VAL v377; VAL v378; - mw_mirth_elab_abZ_typeZAt(v375, &v377, &v378); - VAL v379 = mw_std_list_List_1_reverse(v372); - VAL v380; + mw_mirth_elab_abZ_ctxZAt(v375, &v377, &v378); + uint64_t v379 = mw_mirth_type_MetaVar_newZBang(); + VAL v380 = mtw_mirth_type_StackType_STMeta(v379); VAL v381; - mw_std_list_List_1_uncons(v379, &v380, &v381); - uint64_t x382; - VAL x383; - VAL x384; - VAL x385; - VAL x386; - VAL x387; - int64_t x388; - switch (get_data_tag(v380)) { - case 1LL: { // Some - VAL v389 = mtp_std_maybe_Maybe_1_Some(v380); - incref(v389); - VAL v390 = mw_mirth_var_Ctx_new(v376, VU64(v389)); - VAL v391; - uint64_t v392; - mw_mirth_elab_abZ_tokenZAt(v377, &v391, &v392); - VAL v393; - VAL v394; - VAL v395; - uint64_t v396; - mw_mirth_elab_elabZ_expandZ_tensorZBang(v359, v378, v392, &v393, &v394, &v395, &v396); - VAL v397 = mw_mirth_var_Var_type(VU64(v389)); - VAL v398; - VAL v399; - uint64_t v400; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v393, v395, v397, v396, &v398, &v399, &v400); - decref(v399); - int64_t v401 = 1LL /* True */; - x388 = v401; - x387 = v381; - x386 = v394; - x385 = v391; - x384 = v390; - x383 = v398; - x382 = v374; - lpush(&lbl_va, MKU64(v334)); - lpush(&lbl_tbl, MKU64(v57)); - lpush(&lbl_vx, MKU64(v342)); - } break; - case 0LL: { // None - int64_t v402 = 0LL /* False */; - x388 = v402; - x387 = v381; - x386 = v378; - x385 = v377; - x384 = v376; - x383 = v359; - x382 = v374; - lpush(&lbl_va, MKU64(v334)); - lpush(&lbl_tbl, MKU64(v57)); - lpush(&lbl_vx, MKU64(v342)); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v403 = x382; - VAL v404 = (x383); - VAL v405 = x384; - VAL v406 = (x385); - VAL v407 = x386; - VAL v408 = x387; - int64_t v409 = x388; - while (((bool)v409)) { - uint64_t v410 = v403; - VAL v411 = (v404); - VAL v412 = v405; - VAL v413 = (v406); - VAL v414 = v407; - VAL v415 = v408; - VAL v416; - VAL v417; - mw_std_list_List_1_uncons(v415, &v416, &v417); - uint64_t x418; - VAL x419; - VAL x420; - VAL x421; - VAL x422; - VAL x423; - int64_t x424; - switch (get_data_tag(v416)) { - case 1LL: { // Some - VAL v425 = mtp_std_maybe_Maybe_1_Some(v416); - incref(v425); - VAL v426 = mw_mirth_var_Ctx_new(v412, VU64(v425)); - VAL v427; - uint64_t v428; - mw_mirth_elab_abZ_tokenZAt(v413, &v427, &v428); - VAL v429; - VAL v430; - VAL v431; - uint64_t v432; - mw_mirth_elab_elabZ_expandZ_tensorZBang(v411, v414, v428, &v429, &v430, &v431, &v432); - VAL v433 = mw_mirth_var_Var_type(VU64(v425)); - VAL v434; - VAL v435; - uint64_t v436; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v429, v431, v433, v432, &v434, &v435, &v436); - decref(v435); - int64_t v437 = 1LL /* True */; - x424 = v437; - x423 = v417; - x422 = v430; - x421 = v427; - x420 = v426; - x419 = v434; - x418 = v410; - } break; - case 0LL: { // None - int64_t v438 = 0LL /* False */; - x424 = v438; - x423 = v417; - x422 = v414; - x421 = v413; - x420 = v412; - x419 = v411; - x418 = v410; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v409 = x424; - v408 = x423; - v407 = x422; - v406 = x421; - v405 = x420; - v404 = x419; - v403 = x418; - } - decref(v408); + VAL v382; + mw_mirth_elab_abZ_homeZAt(v377, &v381, &v382); + incref(v380); + VAL v383 = MKI64(0LL /* Nil */); + VAL v384 = mtw_mirth_arrow_Arrow_Arrow(v382, v376, v376, v378, v380, v380, v383); + int64_t v385 = 1LL /* PRIM_CORE_DUP */; + VAL v386; + VAL v387; + mw_mirth_elab_abZ_primZBang(v385, v373, v384, &v386, &v387); + VAL v388; + uint64_t v389; + mw_mirth_elab_abZ_tokenZAt(v387, &v388, &v389); + VAL v390; + VAL v391; + mw_mirth_elab_abZ_ctxZAt(v388, &v390, &v391); + uint64_t v392 = mw_mirth_type_MetaVar_newZBang(); + VAL v393 = mtw_mirth_type_StackType_STMeta(v392); + VAL v394; + VAL v395; + mw_mirth_elab_abZ_homeZAt(v390, &v394, &v395); + incref(v393); + VAL v396 = MKI64(0LL /* Nil */); + VAL v397 = mtw_mirth_arrow_Arrow_Arrow(v395, v389, v389, v391, v393, v393, v396); + int64_t v398 = 0LL /* CoerceUnsafe */; + VAL v399; + VAL v400; + mw_mirth_elab_abZ_coerceZBang(v398, v386, v397, &v399, &v400); + VAL v401; + VAL v402; + mw_mirth_elab_abZ_varZBang(v297, v399, v400, &v401, &v402); + VAL v403; + uint64_t v404; + mw_mirth_arrow_Block_newZBang(v401, v402, &v403, &v404); + VAL v405 = mtw_mirth_arrow_Op_OpBlockPush(v404); + VAL v406; + VAL v407; + mw_mirth_elab_abZ_opZBang(v405, v403, v394, &v406, &v407); + int64_t v408 = 5LL /* PRIM_CORE_DIP */; + VAL v409; + VAL v410; + mw_mirth_elab_abZ_primZBang(v408, v406, v407, &v409, &v410); + int64_t v411 = 1LL; + VAL v412; + VAL v413; + mw_mirth_elab_abZ_intZBang(v411, v409, v410, &v412, &v413); + int64_t v414 = 20LL /* PRIM_INT_ADD */; + VAL v415; + VAL v416; + mw_mirth_elab_abZ_primZBang(v414, v412, v413, &v415, &v416); + VAL v417; + uint64_t v418; + mw_mirth_arrow_Block_newZBang(v415, v416, &v417, &v418); + VAL v419 = mtw_mirth_arrow_Op_OpBlockPush(v418); + VAL v420; + VAL v421; + mw_mirth_elab_abZ_opZBang(v419, v417, v381, &v420, &v421); + int64_t v422 = 8LL /* PRIM_CORE_WHILE */; + VAL v423; + VAL v424; + mw_mirth_elab_abZ_primZBang(v422, v420, v421, &v423, &v424); + int64_t v425 = 2LL /* PRIM_CORE_DROP */; + VAL v426; + VAL v427; + mw_mirth_elab_abZ_primZBang(v425, v423, v424, &v426, &v427); + VAL v428; + VAL v429; + mw_mirth_elab_abZ_ctxZAt(v338, &v428, &v429); + VAL v430; + VAL v431; + mw_mirth_elab_abZ_typeZAt(v428, &v430, &v431); + VAL v432; + uint64_t v433; + mw_mirth_elab_abZ_tokenZAt(v430, &v432, &v433); + VAL v434 = mtw_mirth_arrow_Lambda_Lambda(v433, v429, v431, v327, v427); + VAL v435 = mtw_mirth_arrow_Op_OpLambda(v434); + VAL v436; + VAL v437; + mw_mirth_elab_abZ_opZBang(v435, v426, v432, &v436, &v437); + VAL v438; VAL v439; + mw_mirth_elab_abZ_unifyZ_typeZBang(v321, v436, v437, &v438, &v439); VAL v440; - mw_mirth_elab_abZ_homeZAt(v406, &v439, &v440); - incref(v407); - VAL v441 = MKI64(0LL /* Nil */); - VAL v442 = mtw_mirth_arrow_Arrow_Arrow(v440, v403, v403, v405, v407, v407, v441); - int64_t v443 = 1LL; + VAL v441; + mw_mirth_elab_finalizzeZ_wordZ_arrow(v438, v439, v319, &v440, &v441); + VAL v442 = mtw_mirth_mirth_PropLabel_WordArrow(v285); + VAL v443; VAL v444; - VAL v445; - mw_mirth_elab_abZ_intZBang(v443, v404, v442, &v444, &v445); - VAL v446; - uint64_t v447; - mw_mirth_elab_abZ_tokenZAt(v445, &v446, &v447); + mw_mirth_mirth_PropLabel_prop(v441, v442, v440, &v443, &v444); + void* v445 = mfld_mirth_word_Word_ZTildearrow(v285); + mut_set(v443, v445); + STR* v446; + STRLIT(v446, "alloc!", 6); + int64_t v447 = 0LL; VAL v448; - VAL v449; - mw_mirth_elab_abZ_ctxZAt(v446, &v448, &v449); - uint64_t v450 = mw_mirth_type_MetaVar_newZBang(); - VAL v451 = mtw_mirth_type_StackType_STMeta(v450); - VAL v452; - VAL v453; - mw_mirth_elab_abZ_homeZAt(v448, &v452, &v453); - incref(v451); - VAL v454 = MKI64(0LL /* Nil */); - VAL v455 = mtw_mirth_arrow_Arrow_Arrow(v453, v447, v447, v449, v451, v451, v454); - int64_t v456 = 1LL /* PRIM_CORE_DUP */; + uint64_t v449; + mw_mirth_elab_tableZ_wordZ_newZBang(v444, v131, MKSTR(v446), v447, &v448, &v449); + VAL v450 = MKI64(0LL /* Nil */); + VAL v451 = mw_mirth_type_T0(); + VAL v452 = mtw_mirth_type_Type_TTable(v131); + VAL v453 = mw_mirth_type_T1(v452); + VAL v454 = mw_mirth_type_TZ_ZTo(v451, v453); + VAL v455 = mtw_mirth_mirth_PropLabel_WordType(v449); + VAL v456; VAL v457; - VAL v458; - mw_mirth_elab_abZ_primZBang(v456, v444, v455, &v457, &v458); - uint64_t v459 = VU64(lpop(&lbl_tbl)); - uint64_t v460 = mw_mirth_table_Table_numZ_buffer(v459); + mw_mirth_mirth_PropLabel_prop2(v450, v454, v455, v448, &v456, &v457); + void* v458 = mfld_mirth_word_Word_ZTildectxZ_type(v449); + mut_set(v456, v458); + VAL v459; + VAL v460; VAL v461; - VAL v462; - mw_mirth_elab_abZ_bufferZBang(v460, v457, v458, &v461, &v462); - int64_t v463 = 87LL /* PRIM_I64_GET */; - VAL v464; + uint64_t v462; + VAL v463; + uint64_t v464; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v457, v449, &v459, &v460, &v461, &v462, &v463, &v464); VAL v465; - mw_mirth_elab_abZ_primZBang(v463, v461, v462, &v464, &v465); - int64_t v466 = 0LL /* CoerceUnsafe */; - VAL v467; - VAL v468; - mw_mirth_elab_abZ_coerceZBang(v466, v464, v465, &v467, &v468); - int64_t v469 = 16LL /* PRIM_INT_LE */; - VAL v470; - VAL v471; - mw_mirth_elab_abZ_primZBang(v469, v467, v468, &v470, &v471); + VAL v466; + mw_mirth_type_ArrowType_unpack(v461, &v465, &v466); + incref(v465); + VAL v467 = MKI64(0LL /* Nil */); + VAL v468 = mtw_mirth_arrow_Arrow_Arrow(v463, v462, v462, v460, v465, v465, v467); + uint64_t v469 = mw_mirth_table_Table_head(v131); + VAL v470 = mw_mirth_elab_abZ_tokenZBang(v468, v469); + uint64_t v471 = mw_mirth_table_Table_numZ_buffer(v131); VAL v472; - uint64_t v473; - mw_mirth_arrow_Block_newZBang(v470, v471, &v472, &v473); - VAL v474 = mtw_mirth_arrow_Op_OpBlockPush(v473); + VAL v473; + mw_mirth_elab_abZ_bufferZBang(v471, v459, v470, &v472, &v473); + int64_t v474 = 83LL /* PRIM_U64_GET */; VAL v475; VAL v476; - mw_mirth_elab_abZ_opZBang(v474, v472, v452, &v475, &v476); - VAL v477; - uint64_t v478; - mw_mirth_elab_abZ_tokenZAt(v476, &v477, &v478); + mw_mirth_elab_abZ_primZBang(v474, v472, v473, &v475, &v476); + int64_t v477 = 0LL /* CoerceUnsafe */; + VAL v478; VAL v479; - VAL v480; - mw_mirth_elab_abZ_ctxZAt(v477, &v479, &v480); - uint64_t v481 = mw_mirth_type_MetaVar_newZBang(); - VAL v482 = mtw_mirth_type_StackType_STMeta(v481); - VAL v483; + mw_mirth_elab_abZ_coerceZBang(v477, v475, v476, &v478, &v479); + int64_t v480 = 1LL; + VAL v481; + VAL v482; + mw_mirth_elab_abZ_intZBang(v480, v478, v479, &v481, &v482); + int64_t v483 = 20LL /* PRIM_INT_ADD */; VAL v484; - mw_mirth_elab_abZ_homeZAt(v479, &v483, &v484); - incref(v482); - VAL v485 = MKI64(0LL /* Nil */); - VAL v486 = mtw_mirth_arrow_Arrow_Arrow(v484, v478, v478, v480, v482, v482, v485); - int64_t v487 = 1LL /* PRIM_CORE_DUP */; + VAL v485; + mw_mirth_elab_abZ_primZBang(v483, v481, v482, &v484, &v485); + int64_t v486 = 1LL /* PRIM_CORE_DUP */; + VAL v487; VAL v488; - VAL v489; - mw_mirth_elab_abZ_primZBang(v487, v475, v486, &v488, &v489); + mw_mirth_elab_abZ_primZBang(v486, v484, v485, &v487, &v488); + int64_t v489 = 0LL /* CoerceUnsafe */; VAL v490; - uint64_t v491; - mw_mirth_elab_abZ_tokenZAt(v489, &v490, &v491); - VAL v492; + VAL v491; + mw_mirth_elab_abZ_coerceZBang(v489, v487, v488, &v490, &v491); + uint64_t v492 = mw_mirth_table_Table_numZ_buffer(v131); VAL v493; - mw_mirth_elab_abZ_ctxZAt(v490, &v492, &v493); - uint64_t v494 = mw_mirth_type_MetaVar_newZBang(); - VAL v495 = mtw_mirth_type_StackType_STMeta(v494); + VAL v494; + mw_mirth_elab_abZ_bufferZBang(v492, v490, v491, &v493, &v494); + int64_t v495 = 92LL /* PRIM_U64_SET */; VAL v496; VAL v497; - mw_mirth_elab_abZ_homeZAt(v492, &v496, &v497); - incref(v495); - VAL v498 = MKI64(0LL /* Nil */); - VAL v499 = mtw_mirth_arrow_Arrow_Arrow(v497, v491, v491, v493, v495, v495, v498); - int64_t v500 = 0LL /* CoerceUnsafe */; + mw_mirth_elab_abZ_primZBang(v495, v493, v494, &v496, &v497); + int64_t v498 = 0LL /* CoerceUnsafe */; + VAL v499; + VAL v500; + mw_mirth_elab_abZ_coerceZBang(v498, v496, v497, &v499, &v500); VAL v501; VAL v502; - mw_mirth_elab_abZ_coerceZBang(v500, v488, v499, &v501, &v502); - uint64_t v503 = VU64(lpop(&lbl_vx)); + mw_mirth_elab_abZ_unifyZ_typeZBang(v466, v499, v500, &v501, &v502); + VAL v503; VAL v504; - VAL v505; - mw_mirth_elab_abZ_varZBang(v503, v501, v502, &v504, &v505); + mw_mirth_elab_finalizzeZ_wordZ_arrow(v501, v502, v464, &v503, &v504); + VAL v505 = mtw_mirth_mirth_PropLabel_WordArrow(v449); VAL v506; - uint64_t v507; - mw_mirth_arrow_Block_newZBang(v504, v505, &v506, &v507); - VAL v508 = mtw_mirth_arrow_Op_OpBlockPush(v507); - VAL v509; - VAL v510; - mw_mirth_elab_abZ_opZBang(v508, v506, v496, &v509, &v510); - int64_t v511 = 5LL /* PRIM_CORE_DIP */; - VAL v512; - VAL v513; - mw_mirth_elab_abZ_primZBang(v511, v509, v510, &v512, &v513); - int64_t v514 = 1LL; - VAL v515; - VAL v516; - mw_mirth_elab_abZ_intZBang(v514, v512, v513, &v515, &v516); - int64_t v517 = 20LL /* PRIM_INT_ADD */; - VAL v518; - VAL v519; - mw_mirth_elab_abZ_primZBang(v517, v515, v516, &v518, &v519); - VAL v520; - uint64_t v521; - mw_mirth_arrow_Block_newZBang(v518, v519, &v520, &v521); - VAL v522 = mtw_mirth_arrow_Op_OpBlockPush(v521); - VAL v523; - VAL v524; - mw_mirth_elab_abZ_opZBang(v522, v520, v483, &v523, &v524); - int64_t v525 = 8LL /* PRIM_CORE_WHILE */; - VAL v526; - VAL v527; - mw_mirth_elab_abZ_primZBang(v525, v523, v524, &v526, &v527); - int64_t v528 = 2LL /* PRIM_CORE_DROP */; - VAL v529; - VAL v530; - mw_mirth_elab_abZ_primZBang(v528, v526, v527, &v529, &v530); - VAL v531; - VAL v532; - mw_mirth_elab_abZ_ctxZAt(v439, &v531, &v532); - VAL v533; - VAL v534; - mw_mirth_elab_abZ_typeZAt(v531, &v533, &v534); - VAL v535; - uint64_t v536; - mw_mirth_elab_abZ_tokenZAt(v533, &v535, &v536); - VAL v537 = mtw_mirth_arrow_Lambda_Lambda(v536, v532, v534, v372, v530); - VAL v538 = mtw_mirth_arrow_Op_OpLambda(v537); - VAL v539; - VAL v540; - mw_mirth_elab_abZ_opZBang(v538, v529, v535, &v539, &v540); - VAL v541; - VAL v542; - mw_mirth_elab_abZ_unifyZ_typeZBang(v366, v539, v540, &v541, &v542); - VAL v543; - VAL v544; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v541, v542, v364, &v543, &v544); - VAL v545 = mtw_mirth_mirth_PropLabel_WordArrow(v330); - VAL v546; - VAL v547; - mw_mirth_mirth_PropLabel_prop(v544, v545, v543, &v546, &v547); - void* v548 = mfld_mirth_word_Word_ZTildearrow(v330); - mut_set(v546, v548); - uint64_t v549 = VU64(lpop(&lbl_va)); - STR* v550; - STRLIT(v550, "alloc!", 6); - int64_t v551 = 0LL; - VAL v552; - uint64_t v553; - mw_mirth_elab_tableZ_wordZ_newZBang(v547, v459, MKSTR(v550), v551, &v552, &v553); - VAL v554 = MKI64(0LL /* Nil */); - VAL v555 = mw_mirth_type_T0(); - VAL v556 = mtw_mirth_type_Type_TTable(v459); - VAL v557 = mw_mirth_type_T1(v556); - VAL v558 = mw_mirth_type_TZ_ZTo(v555, v557); - VAL v559 = mtw_mirth_mirth_PropLabel_WordType(v553); - VAL v560; - VAL v561; - mw_mirth_mirth_PropLabel_prop2(v554, v558, v559, v552, &v560, &v561); - void* v562 = mfld_mirth_word_Word_ZTildectxZ_type(v553); - mut_set(v560, v562); - VAL v563; - VAL v564; - VAL v565; - uint64_t v566; - VAL v567; - uint64_t v568; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(v561, v553, &v563, &v564, &v565, &v566, &v567, &v568); - VAL v569; - VAL v570; - mw_mirth_type_ArrowType_unpack(v565, &v569, &v570); - incref(v569); - VAL v571 = MKI64(0LL /* Nil */); - VAL v572 = mtw_mirth_arrow_Arrow_Arrow(v567, v566, v566, v564, v569, v569, v571); - uint64_t v573 = mw_mirth_table_Table_head(v459); - VAL v574 = (mw_mirth_elab_abZ_tokenZBang(v572, v573)); - uint64_t v575 = mw_mirth_table_Table_numZ_buffer(v459); - VAL v576; - VAL v577; - mw_mirth_elab_abZ_bufferZBang(v575, v563, v574, &v576, &v577); - int64_t v578 = 83LL /* PRIM_U64_GET */; - VAL v579; - VAL v580; - mw_mirth_elab_abZ_primZBang(v578, v576, v577, &v579, &v580); - int64_t v581 = 0LL /* CoerceUnsafe */; - VAL v582; - VAL v583; - mw_mirth_elab_abZ_coerceZBang(v581, v579, v580, &v582, &v583); - int64_t v584 = 1LL; - VAL v585; - VAL v586; - mw_mirth_elab_abZ_intZBang(v584, v582, v583, &v585, &v586); - int64_t v587 = 20LL /* PRIM_INT_ADD */; - VAL v588; - VAL v589; - mw_mirth_elab_abZ_primZBang(v587, v585, v586, &v588, &v589); - int64_t v590 = 1LL /* PRIM_CORE_DUP */; - VAL v591; - VAL v592; - mw_mirth_elab_abZ_primZBang(v590, v588, v589, &v591, &v592); - int64_t v593 = 0LL /* CoerceUnsafe */; - VAL v594; - VAL v595; - mw_mirth_elab_abZ_coerceZBang(v593, v591, v592, &v594, &v595); - uint64_t v596 = mw_mirth_table_Table_numZ_buffer(v459); - VAL v597; - VAL v598; - mw_mirth_elab_abZ_bufferZBang(v596, v594, v595, &v597, &v598); - int64_t v599 = 92LL /* PRIM_U64_SET */; - VAL v600; - VAL v601; - mw_mirth_elab_abZ_primZBang(v599, v597, v598, &v600, &v601); - int64_t v602 = 0LL /* CoerceUnsafe */; - VAL v603; - VAL v604; - mw_mirth_elab_abZ_coerceZBang(v602, v600, v601, &v603, &v604); - VAL v605; - VAL v606; - mw_mirth_elab_abZ_unifyZ_typeZBang(v570, v603, v604, &v605, &v606); - VAL v607; - VAL v608; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v605, v606, v568, &v607, &v608); - VAL v609 = mtw_mirth_mirth_PropLabel_WordArrow(v553); - VAL v610; - VAL v611; - mw_mirth_mirth_PropLabel_prop(v608, v609, v607, &v610, &v611); - void* v612 = mfld_mirth_word_Word_ZTildearrow(v553); - mut_set(v610, v612); - *x6 = v459; - *x5 = v611; + VAL v507; + mw_mirth_mirth_PropLabel_prop(v504, v505, v503, &v506, &v507); + void* v508 = mfld_mirth_word_Word_ZTildearrow(v449); + mut_set(v506, v508); + *x6 = v131; + *x5 = v507; } static void mw_mirth_elab_resolveZ_defZ_namespace (VAL x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5) { STR* v6; @@ -61648,309 +44777,182 @@ static void mw_mirth_elab_resolveZ_defZ_namespace (VAL x1, uint64_t x2, VAL x3, incref(v11); VAL v12 = MKI64(0LL /* Nil */); VAL v13 = MKI64(0LL /* Nil */); - VAL v14; - VAL v15; - mw_std_list_List_1_uncons(v11, &v14, &v15); - VAL x16; - VAL x17; - VAL x18; - VAL x19; - VAL x20; - int64_t x21; - switch (get_data_tag(v14)) { - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v14); - incref(v22); - VAL v23; - VAL v24; - mw_mirth_def_Def_exposedZ_tyconZAsk(v9, v22, &v23, &v24); - int64_t v25 = mw_std_maybe_Maybe_1_ZToBool(v24); - VAL x26; - VAL x27; - VAL x28; - if (((bool)v25)) { - VAL v29 = mtw_std_either_Either_2_Right(v22); - x28 = v29; - x27 = v10; - x26 = v23; - } else { - VAL v30 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v22); - VAL v31 = mtw_std_either_Either_2_Left(v30); - x28 = v31; - x27 = v10; - x26 = v23; - } - VAL x32; - VAL x33; - VAL x34; - VAL x35; - switch (get_data_tag(x28)) { - case 0LL: { // Left - VAL v36 = mtp_std_either_Either_2_Left(x28); - VAL v37 = mtw_std_list_List_1_Cons(v36, v12); - x35 = v13; - x34 = v37; - x33 = x27; - x32 = x26; - } break; - case 1LL: { // Right - VAL v38 = mtp_std_either_Either_2_Right(x28); - VAL v39 = mtw_std_list_List_1_Cons(v38, v13); - x35 = v39; - x34 = v12; - x33 = x27; - x32 = x26; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v40 = 1LL /* True */; - x21 = v40; - x20 = v15; - x19 = x35; - x18 = x34; - x17 = x33; - x16 = x32; - } break; - case 0LL: { // None - int64_t v41 = 0LL /* False */; - x21 = v41; - x20 = v15; - x19 = v13; - x18 = v12; - x17 = v10; - x16 = v9; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v42 = (x16); - VAL v43 = (x17); - VAL v44 = x18; - VAL v45 = x19; - VAL v46 = x20; - int64_t v47 = x21; - while (((bool)v47)) { - VAL v48 = (v42); - VAL v49 = (v43); - VAL v50 = v44; - VAL v51 = v45; - VAL v52 = v46; - VAL v53; - VAL v54; - mw_std_list_List_1_uncons(v52, &v53, &v54); - VAL x55; - VAL x56; - VAL x57; - VAL x58; - VAL x59; - int64_t x60; - switch (get_data_tag(v53)) { - case 1LL: { // Some - VAL v61 = mtp_std_maybe_Maybe_1_Some(v53); - incref(v61); - VAL v62; - VAL v63; - mw_mirth_def_Def_exposedZ_tyconZAsk(v48, v61, &v62, &v63); - int64_t v64 = mw_std_maybe_Maybe_1_ZToBool(v63); - VAL x65; - VAL x66; - VAL x67; - if (((bool)v64)) { - VAL v68 = mtw_std_either_Either_2_Right(v61); - x67 = v68; - x66 = v49; - x65 = v62; + int64_t v14 = 1LL /* True */; + VAL v15 = v9; + VAL v16 = v10; + VAL v17 = v12; + VAL v18 = v13; + VAL v19 = v11; + int64_t v20 = v14; + int64_t v21 = v14; + while (((bool)v21)) { + VAL v22 = v15; + VAL v23 = v16; + VAL v24 = v17; + VAL v25 = v18; + VAL v26 = v19; + int64_t v27 = v20; + VAL x28; + VAL x29; + VAL x30; + VAL x31; + VAL x32; + int64_t x33; + switch (get_data_tag(v26)) { + case 1LL: { // Cons + VAL v34; + VAL v35; + mtp_std_list_List_1_Cons(v26, &v34, &v35); + incref(v34); + VAL v36; + VAL v37; + mw_mirth_def_Def_exposedZ_tyconZAsk(v22, v34, &v36, &v37); + int64_t v38 = get_data_tag(v37); + decref(v37); + int64_t v39 = 1LL; + bool v40 = (v38 == v39); + VAL x41; + VAL x42; + VAL x43; + if (v40) { + VAL v44 = mtw_std_either_Either_2_Right(v34); + x43 = v44; + x42 = v23; + x41 = v36; } else { - VAL v69 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v61); - VAL v70 = mtw_std_either_Either_2_Left(v69); - x67 = v70; - x66 = v49; - x65 = v62; + VAL v45 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_SORT(v34); + VAL v46 = mtw_std_either_Either_2_Left(v45); + x43 = v46; + x42 = v23; + x41 = v36; } - VAL x71; - VAL x72; - VAL x73; - VAL x74; - switch (get_data_tag(x67)) { + VAL x47; + VAL x48; + VAL x49; + VAL x50; + switch (get_data_tag(x43)) { case 0LL: { // Left - VAL v75 = mtp_std_either_Either_2_Left(x67); - VAL v76 = mtw_std_list_List_1_Cons(v75, v50); - x74 = v51; - x73 = v76; - x72 = x66; - x71 = x65; + VAL v51 = mtp_std_either_Either_2_Left(x43); + VAL v52 = mtw_std_list_List_1_Cons(v51, v24); + x50 = v25; + x49 = v52; + x48 = x42; + x47 = x41; } break; case 1LL: { // Right - VAL v77 = mtp_std_either_Either_2_Right(x67); - VAL v78 = mtw_std_list_List_1_Cons(v77, v51); - x74 = v78; - x73 = v50; - x72 = x66; - x71 = x65; + VAL v53 = mtp_std_either_Either_2_Right(x43); + VAL v54 = mtw_std_list_List_1_Cons(v53, v25); + x50 = v54; + x49 = v24; + x48 = x42; + x47 = x41; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v79 = 1LL /* True */; - x60 = v79; - x59 = v54; - x58 = x74; - x57 = x73; - x56 = x72; - x55 = x71; + int64_t v55 = 1LL /* True */; + x33 = v55; + x32 = v35; + x31 = x50; + x30 = x49; + x29 = x48; + x28 = x47; } break; - case 0LL: { // None - int64_t v80 = 0LL /* False */; - x60 = v80; - x59 = v54; - x58 = v51; - x57 = v50; - x56 = v49; - x55 = v48; + case 0LL: { // Nil + VAL v56 = MKI64(0LL /* Nil */); + int64_t v57 = 0LL /* False */; + x33 = v57; + x32 = v56; + x31 = v25; + x30 = v24; + x29 = v23; + x28 = v22; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v47 = x60; - v46 = x59; - v45 = x58; - v44 = x57; - v43 = x56; - v42 = x55; - } - decref(v46); - VAL v81 = mw_std_list_List_1_reverse(v44); - VAL v82 = mw_std_list_List_1_reverse(v45); - VAL v83 = VVAL(VTUP(v43)->cells[5]); - incref(v83); - VAL v84 = mw_std_list_List_1_cat(v81, v83); - VAL v85 = VTUP(v43)->cells[5]; - decref(v85); - VTUP(v43)->cells[5] = v84; - VAL v86 = VTUP(v43)->cells[4]; - decref(v86); - VTUP(v43)->cells[4] = v82; - VAL v87; - VAL v88; - mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v42, v43, &v87, &v88); - VAL v89 = MKI64(0LL /* Nil */); - VAL v90; - VAL v91; - mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v89, v87, v88, &v90, &v91); - VAL v92; - VAL v93; - mw_mirth_elab_resolveZ_defZ_endZBang(v90, v91, &v92, &v93); - VAL x94; - VAL x95; - switch (get_data_tag(v93)) { - case 1LL: { // Some - VAL v96 = mtp_std_maybe_Maybe_1_Some(v93); - VAL v97; - VAL v98; - mw_mirth_def_Def_asZ_namespaceZAsk(v92, v96, &v97, &v98); - x95 = v98; - x94 = v97; - } break; - case 0LL: { // None - VAL v99 = MKI64(0LL /* None */); - x95 = v99; - x94 = v92; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v21 = x33; + v20 = x33; + v19 = x32; + v18 = x31; + v17 = x30; + v16 = x29; + v15 = x28; } - *x5 = x95; - *x4 = x94; + decref(v19); + VAL v58 = mw_std_list_List_1_reverse(v17); + VAL v59 = mw_std_list_List_1_reverse(v18); + VAL v60 = VVAL(VTUP(v16)->cells[5]); + incref(v60); + VAL v61 = mw_std_list_List_1_cat(v58, v60); + VAL v62 = VTUP(v16)->cells[5]; + decref(v62); + VTUP(v16)->cells[5] = v61; + VAL v63 = VTUP(v16)->cells[4]; + decref(v63); + VTUP(v16)->cells[4] = v59; + VAL v64; + VAL v65; + mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v15, v16, &v64, &v65); + VAL v66 = MKI64(0LL /* Nil */); + VAL v67; + VAL v68; + mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v66, v64, v65, &v67, &v68); + VAL v69; + VAL v70; + mw_mirth_elab_resolveZ_defZ_endZBang(v67, v68, &v69, &v70); + VAL v71; + VAL v72; + mw_std_maybe_Maybe_1_bind_1_sp7(v69, v70, &v71, &v72); + *x5 = v72; + *x4 = v71; } static void mw_mirth_elab_elabZ_qnameZ_fromZ_nonrelativeZ_dname (VAL x1, uint64_t x2, VAL x3, int64_t x4, VAL *x5, VAL *x6) { incref(x3); VAL v7 = mtw_std_either_Either_2_Right(x3); incref(x3); VAL v8 = mw_mirth_name_DName_rootZAsk(x3); - VAL x9; - uint64_t x10; - int64_t x11; - VAL x12; + int64_t v9 = get_data_tag(v8); + decref(v8); + int64_t v10 = 0LL; + bool v11 = (v9 == v10); + uint64_t x12; VAL x13; - switch (get_data_tag(v8)) { + VAL x14; + if (v11) { + decref(x3); + STR* v15; + STRLIT(v15, "relative name not allowed", 25); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v15), x1); + } else { + x14 = x3; + x13 = x1; + x12 = x2; + } + uint64_t v19 = mw_mirth_name_DName_lastZ_name(x14); + VAL v20; + VAL v21; + mw_mirth_elab_resolveZ_defZ_namespace(x13, x12, v7, &v20, &v21); + VAL x22; + VAL x23; + switch (get_data_tag(v21)) { case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v8); - decref(v14); - x13 = x3; - x12 = v7; - x11 = x4; - x10 = x2; - x9 = x1; + VAL v24 = mtp_std_maybe_Maybe_1_Some(v21); + x23 = v24; + x22 = v20; } break; case 0LL: { // None - decref(x3); - STR* v15; - STRLIT(v15, "relative name not allowed", 25); - lpush(&lbl_arity, MKI64(x4)); - lpush(&lbl_nameZDivdname, v7); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v15), x1); - VAL v16 = pop_value(); - x13 = v16; - VAL v17 = lpop(&lbl_nameZDivdname); - x12 = v17; - int64_t v18 = VI64(lpop(&lbl_arity)); - x11 = v18; - uint64_t v19 = pop_u64(); - x10 = v19; - VAL r20 = pop_resource(); - x9 = r20; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v21 = mw_mirth_name_DName_lastZ_name(x13); - VAL v22; - VAL v23; - mw_mirth_elab_resolveZ_defZ_namespace(x9, x10, x12, &v22, &v23); - int64_t x24; - uint64_t x25; - uint64_t x26; - VAL x27; - VAL x28; - switch (get_data_tag(v23)) { - case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v23); - x28 = v29; - x27 = v22; - x26 = x10; - x25 = v21; - x24 = x11; - } break; - case 0LL: { // None - lpush(&lbl_arity, MKI64(x11)); - lpush(&lbl_name, MKU64(v21)); - push_u64(x10); - mw_mirth_mirth_ZPlusMirth_panicZ_diagnosticsZBang(v22); - VAL v30 = pop_value(); - x28 = v30; - VAL r31 = pop_resource(); - x27 = r31; - uint64_t v32 = pop_u64(); - x26 = v32; - uint64_t v33 = VU64(lpop(&lbl_name)); - x25 = v33; - int64_t v34 = VI64(lpop(&lbl_arity)); - x24 = v34; + mw_mirth_mirth_ZPlusMirth_panicZ_diagnosticsZBang(v20); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v35 = mtw_mirth_name_QName_MKQNAME(x28, x25, x24); - *x6 = v35; - *x5 = x27; + VAL v27 = mtw_mirth_name_QName_MKQNAME(x23, v19, x4); + *x6 = v27; + *x5 = x22; } static int64_t mw_mirth_elab_moduleZ_visibleZ_fromZ_tokenZAsk (uint64_t x1, uint64_t x2) { uint64_t v3 = mw_mirth_token_Token_module(x1); @@ -61959,26 +44961,20 @@ static int64_t mw_mirth_elab_moduleZ_visibleZ_fromZ_tokenZAsk (uint64_t x1, uint } static void mw_mirth_elab_elabZ_defZ_qname (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { VAL v5 = mw_mirth_token_Token_nameZDivdnameZAsk(x2); - VAL x6; - uint64_t x7; + uint64_t x6; + VAL x7; VAL x8; switch (get_data_tag(v5)) { case 1LL: { // Some VAL v9 = mtp_std_maybe_Maybe_1_Some(v5); x8 = v9; - x7 = x2; - x6 = x1; + x7 = x1; + x6 = x2; } break; case 0LL: { // None STR* v10; STRLIT(v10, "expected name", 13); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v10), x1); - VAL v11 = pop_value(); - x8 = v11; - uint64_t v12 = pop_u64(); - x7 = v12; - VAL r13 = pop_resource(); - x6 = r13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -61989,19 +44985,19 @@ static void mw_mirth_elab_elabZ_defZ_qname (VAL x1, uint64_t x2, VAL *x3, VAL *x switch (get_data_tag(x8)) { case 0LL: { // Left VAL v16 = mtp_std_either_Either_2_Left(x8); - uint64_t v17 = mw_mirth_token_Token_module(x7); + uint64_t v17 = mw_mirth_token_Token_module(x6); VAL v18 = mtw_mirth_name_Namespace_NAMESPACEz_MODULE(v17); - int64_t v19 = mw_mirth_token_Token_numZ_args(x7); + int64_t v19 = mw_mirth_token_Token_numZ_args(x6); VAL v20 = mtw_mirth_name_QName_MKQNAME(v18, VU64(v16), v19); x15 = v20; - x14 = x6; + x14 = x7; } break; case 1LL: { // Right VAL v21 = mtp_std_either_Either_2_Right(x8); - int64_t v22 = mw_mirth_token_Token_numZ_args(x7); + int64_t v22 = mw_mirth_token_Token_numZ_args(x6); VAL v23; VAL v24; - mw_mirth_elab_elabZ_qnameZ_fromZ_nonrelativeZ_dname(x6, x7, v21, v22, &v23, &v24); + mw_mirth_elab_elabZ_qnameZ_fromZ_nonrelativeZ_dname(x7, x6, v21, v22, &v23, &v24); x15 = v24; x14 = v23; } break; @@ -62028,19 +45024,13 @@ static void mw_mirth_elab_elabZ_defZ_qnameZ_undefined (VAL x1, uint64_t x2, VAL STR* v12; STRLIT(v12, "name already defined", 20); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v12), v7); - VAL r13 = pop_resource(); - x11 = r13; - VAL v14 = pop_value(); - x10 = v14; - uint64_t v15 = pop_u64(); - x9 = v15; } else { - x11 = v7; - x10 = v6; + x11 = v6; + x10 = v7; x9 = x2; } - *x4 = x10; - *x3 = x11; + *x4 = x11; + *x3 = x10; } static void mw_mirth_elab_elabZ_defZ_head (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, uint64_t *x5, int64_t *x6, VAL *x7) { VAL v8 = mw_mirth_token_Token_nameZDivdnameZAsk(x2); @@ -62057,49 +45047,36 @@ static void mw_mirth_elab_elabZ_defZ_head (VAL x1, uint64_t x2, VAL *x3, uint64_ case 0LL: { // None STR* v13; STRLIT(v13, "expected name", 13); - lpush(&lbl_head, MKU64(x2)); mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x2, MKSTR(v13), x1); - VAL v14 = pop_value(); - x11 = v14; - uint64_t v15 = VU64(lpop(&lbl_head)); - x10 = v15; - VAL r16 = pop_resource(); - x9 = r16; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x17; - uint64_t x18; - uint64_t x19; + uint64_t x16; switch (get_data_tag(x11)) { case 0LL: { // Left - VAL v20 = mtp_std_either_Either_2_Left(x11); - x19 = VU64(v20); - x18 = x10; - x17 = x9; + VAL v17 = mtp_std_either_Either_2_Left(x11); + x16 = VU64(v17); } break; case 1LL: { // Right - VAL v21 = mtp_std_either_Either_2_Right(x11); - VAL v22 = mw_mirth_name_DName_parts(v21); - VAL v23 = mw_std_list_ListZPlus_1_last(v22); - x19 = VU64(v23); - x18 = x10; - x17 = x9; + VAL v18 = mtp_std_either_Either_2_Right(x11); + VAL v19 = mw_mirth_name_DName_parts(v18); + VAL v20 = mw_std_list_ListZPlus_1_last(v19); + x16 = VU64(v20); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v24 = mw_mirth_token_Token_numZ_args(x18); - FNPTR v25 = &mb_mirth_elab_elabZ_defZ_head_3; - VAL v26 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(x18), MKFNPTR(v25)); - *x7 = v26; - *x6 = v24; - *x5 = x19; - *x4 = x18; - *x3 = x17; + int64_t v21 = mw_mirth_token_Token_numZ_args(x10); + FNPTR v22 = &mb_mirth_elab_elabZ_defZ_head_3; + VAL v23 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(x10), MKFNPTR(v22)); + *x7 = v23; + *x6 = v21; + *x5 = x16; + *x4 = x10; + *x3 = x9; } static void mw_mirth_elab_parseZ_field (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4, uint64_t *x5, uint64_t *x6, uint64_t *x7) { uint64_t v8 = mw_mirth_token_Token_next(x2); @@ -62109,50 +45086,26 @@ static void mw_mirth_elab_parseZ_field (VAL x1, uint64_t x2, VAL *x3, uint64_t * VAL v12; mw_mirth_token_Token_argsZ_3(x2, x1, &v9, &v10, &v11, &v12); VAL v13 = mw_mirth_token_Token_nameZDivdnameZAsk(v9); - uint64_t x14; - VAL x15; - uint64_t x16; - uint64_t x17; + int64_t v14 = get_data_tag(v13); + decref(v13); + int64_t v15 = 0LL; + bool v16 = (v14 == v15); + VAL x17; uint64_t x18; - switch (get_data_tag(v13)) { - case 1LL: { // Some - VAL v19 = mtp_std_maybe_Maybe_1_Some(v13); - decref(v19); - x18 = v9; - x17 = v10; - x16 = v11; - x15 = v12; - x14 = v8; - } break; - case 0LL: { // None - STR* v20; - STRLIT(v20, "expected field name", 19); - push_u64(v8); - lpush(&lbl_valueZ_type, MKU64(v11)); - lpush(&lbl_indexZ_type, MKU64(v10)); - lpush(&lbl_head, MKU64(v9)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v9, MKSTR(v20), v12); - uint64_t v21 = VU64(lpop(&lbl_head)); - x18 = v21; - uint64_t v22 = VU64(lpop(&lbl_indexZ_type)); - x17 = v22; - uint64_t v23 = VU64(lpop(&lbl_valueZ_type)); - x16 = v23; - VAL r24 = pop_resource(); - x15 = r24; - uint64_t v25 = pop_u64(); - x14 = v25; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + if (v16) { + STR* v19; + STRLIT(v19, "expected field name", 19); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v9, MKSTR(v19), v12); + } else { + x18 = v9; + x17 = v12; } - VAL v26 = (mw_mirth_token_Token_argsZ_0(x18, x15)); - *x7 = x16; - *x6 = x17; + VAL v21 = mw_mirth_token_Token_argsZ_0(x18, x17); + *x7 = v11; + *x6 = v10; *x5 = x18; - *x4 = x14; - *x3 = v26; + *x4 = v8; + *x3 = v21; } static void mw_mirth_elab_elabZ_fieldZBang (VAL x1, uint64_t x2, VAL *x3, uint64_t *x4) { VAL v5; @@ -62174,53 +45127,39 @@ static void mw_mirth_elab_elabZ_fieldZBang (VAL x1, uint64_t x2, VAL *x3, uint64 mut_set(MKU64(v11), v17); int64_t v18 = 0LL; bool v19 = (v13 == v18); - uint64_t x20; + VAL x20; uint64_t x21; - uint64_t x22; - VAL x23; - VAL x24; - uint64_t x25; if (v19) { - x25 = v15; - x24 = v14; - x23 = v10; - x22 = v9; - x21 = v8; - x20 = v6; + x21 = v15; + x20 = v10; } else { - uint64_t v26 = mw_mirth_table_Field_head(v15); - STR* v27; - STRLIT(v27, "Field cannot take arguments.", 28); - VAL v28 = (mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v26, MKSTR(v27), v10)); - x25 = v15; - x24 = v14; - x23 = v28; - x22 = v9; - x21 = v8; - x20 = v6; - } - VAL v29 = mtw_mirth_mirth_PropLabel_FieldQName(x25); - VAL v30 = mtw_mirth_mirth_Prop_1_Prop(v29, x24); - void* v31 = mfld_mirth_table_Field_ZTildeqname(x25); - mut_set(v30, v31); - VAL v32 = mtw_mirth_mirth_PropLabel_FieldIndexType(x25); - FNPTR v33 = &mb_mirth_elab_elabZ_fieldZBang_1; - VAL v34; - VAL v35; - mw_mirth_mirth_PropLabel_prop_1(MKU64(x21), v32, x23, MKFNPTR(v33), &v34, &v35); - void* v36 = mfld_mirth_table_Field_ZTildeindexZ_type(x25); - mut_set(v34, v36); - VAL v37 = mtw_mirth_mirth_PropLabel_FieldValueType(x25); - FNPTR v38 = &mb_mirth_elab_elabZ_fieldZBang_2; - VAL v39; - VAL v40; - mw_mirth_mirth_PropLabel_prop_1(MKU64(x22), v37, v35, MKFNPTR(v38), &v39, &v40); - void* v41 = mfld_mirth_table_Field_ZTildevalueZ_type(x25); - mut_set(v39, v41); - VAL v42 = mtw_mirth_def_Def_DefField(x25); - VAL v43 = (mw_mirth_def_Def_register(v40, v42)); - *x4 = x20; - *x3 = v43; + uint64_t v22 = mw_mirth_table_Field_head(v15); + STR* v23; + STRLIT(v23, "Field cannot take arguments.", 28); + VAL v24 = mw_mirth_mirth_ZPlusMirth_emitZ_errorZBang(v22, MKSTR(v23), v10); + x21 = v15; + x20 = v24; + } + VAL v25 = mtw_mirth_mirth_PropLabel_FieldQName(x21); + VAL v26 = mtw_mirth_mirth_Prop_1_Prop(v25, v14); + void* v27 = mfld_mirth_table_Field_ZTildeqname(x21); + mut_set(v26, v27); + VAL v28 = mtw_mirth_mirth_PropLabel_FieldIndexType(x21); + VAL v29 = mw_mirth_mirth_PropLabel_prop_1_sp15(v8, v28); + void* v30 = mfld_mirth_table_Field_ZTildeindexZ_type(x21); + mut_set(v29, v30); + VAL v31 = mtw_mirth_mirth_PropLabel_FieldValueType(x21); + VAL v32 = mw_mirth_mirth_PropLabel_prop_1_sp15(v9, v31); + void* v33 = mfld_mirth_table_Field_ZTildevalueZ_type(x21); + mut_set(v32, v33); + VAL v34 = mtw_mirth_def_Def_DefField(x21); + VAL v35 = mw_mirth_def_Def_register(x20, v34); + *x4 = v6; + *x3 = v35; +} +static int64_t mw_std_map_Map_2_len (VAL x1) { + int64_t v2 = mw_std_list_List_1_len(x1); + return v2; } static VAL mw_std_map_Map_2_empty (void) { VAL v1 = MKI64(0LL /* Nil */); @@ -62231,7 +45170,7 @@ static VAL mw_std_map_Map_2_insert (VAL x1, VAL x2) { return v3; } static void mw_mirth_specializzer_runZ_specializzerZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { - VAL v5 = (mw_mirth_specializzer_ZPlusSPCheck_beginZBang()); + VAL v5 = mw_mirth_specializzer_ZPlusSPCheck_beginZBang(); VAL v6; VAL v7; VAL v8; @@ -62251,76 +45190,51 @@ static void mw_mirth_specializzer_ZPlusSPCheck_endZBang (VAL x1) { decref(x1); } static void mw_mirth_specializzer_ZPlusSPCheck_loopZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { - incref(x2); - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(x2, &v5, &v6); - decref(x2); - VAL x7; - VAL x8; - int64_t x9; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v10 = mtp_std_maybe_Maybe_1_Some(v5); - VAL v11; - VAL v12; - mw_mirth_specializzer_ZPlusSPCheck_doZ_itemZ_checkZBang(v10, x1, v6, &v11, &v12); - int64_t v13 = 1LL /* True */; - x9 = v13; - x8 = v12; - x7 = v11; - } break; - case 0LL: { // None - int64_t v14 = 0LL /* False */; - x9 = v14; - x8 = v6; - x7 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v15 = (x7); - VAL v16 = (x8); - int64_t v17 = x9; - while (((bool)v17)) { - VAL v18 = (v15); - VAL v19 = (v16); - incref(v19); - VAL v20; - VAL v21; - mw_std_list_List_1_uncons(v19, &v20, &v21); - decref(v19); - VAL x22; - VAL x23; - int64_t x24; - switch (get_data_tag(v20)) { + int64_t v5 = 1LL /* True */; + VAL v6 = x1; + VAL v7 = x2; + int64_t v8 = v5; + int64_t v9 = v5; + while (((bool)v9)) { + VAL v10 = v6; + VAL v11 = v7; + int64_t v12 = v8; + incref(v11); + VAL v13; + VAL v14; + mw_std_list_List_1_uncons(v11, &v13, &v14); + decref(v11); + VAL x15; + VAL x16; + int64_t x17; + switch (get_data_tag(v13)) { case 1LL: { // Some - VAL v25 = mtp_std_maybe_Maybe_1_Some(v20); - VAL v26; - VAL v27; - mw_mirth_specializzer_ZPlusSPCheck_doZ_itemZ_checkZBang(v25, v18, v21, &v26, &v27); - int64_t v28 = 1LL /* True */; - x24 = v28; - x23 = v27; - x22 = v26; + VAL v18 = mtp_std_maybe_Maybe_1_Some(v13); + VAL v19; + VAL v20; + mw_mirth_specializzer_ZPlusSPCheck_doZ_itemZ_checkZBang(v18, v10, v14, &v19, &v20); + int64_t v21 = 1LL /* True */; + x17 = v21; + x16 = v20; + x15 = v19; } break; case 0LL: { // None - int64_t v29 = 0LL /* False */; - x24 = v29; - x23 = v21; - x22 = v18; + int64_t v22 = 0LL /* False */; + x17 = v22; + x16 = v14; + x15 = v10; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v17 = x24; - v16 = x23; - v15 = x22; + v9 = x17; + v8 = x17; + v7 = x16; + v6 = x15; } - *x4 = v16; - *x3 = v15; + *x4 = v7; + *x3 = v6; } static void mw_mirth_specializzer_ZPlusSPCheck_doZ_itemZ_checkZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { VAL x6; @@ -62376,254 +45290,67 @@ static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_arrowZBang (VAL x1, VAL x2 decref(x1); VAL v8 = MKI64(0LL /* Nil */); VAL v9 = mw_std_list_List_1_reverse(v8); - VAL v10; - VAL v11; - mw_std_list_List_1_uncons(v7, &v10, &v11); - VAL x12; - VAL x13; - VAL x14; - VAL x15; - int64_t x16; - switch (get_data_tag(v10)) { - case 1LL: { // Some - VAL v17 = mtp_std_maybe_Maybe_1_Some(v10); - VAL v18; - VAL v19; - VAL v20; - mw_mirth_specializzer_ZPlusSPCheck_checkZ_atomZBang(v17, x2, x3, &v18, &v19, &v20); - VAL v21; - VAL v22; - mw_std_list_List_1_uncons(v18, &v21, &v22); - VAL x23; - VAL x24; - VAL x25; - VAL x26; - int64_t x27; - switch (get_data_tag(v21)) { - case 1LL: { // Some - VAL v28 = mtp_std_maybe_Maybe_1_Some(v21); - VAL v29 = mtw_std_list_List_1_Cons(v28, v9); - int64_t v30 = 1LL /* True */; - x27 = v30; - x26 = v22; - x25 = v29; - x24 = v20; - x23 = v19; - } break; - case 0LL: { // None - int64_t v31 = 0LL /* False */; - x27 = v31; - x26 = v22; - x25 = v9; - x24 = v20; - x23 = v19; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v32 = (x23); - VAL v33 = (x24); - VAL v34 = (x25); - VAL v35 = x26; - int64_t v36 = x27; - while (((bool)v36)) { - VAL v37 = (v32); - VAL v38 = (v33); - VAL v39 = (v34); - VAL v40 = v35; - VAL v41; - VAL v42; - mw_std_list_List_1_uncons(v40, &v41, &v42); - VAL x43; - VAL x44; - VAL x45; - VAL x46; - int64_t x47; - switch (get_data_tag(v41)) { - case 1LL: { // Some - VAL v48 = mtp_std_maybe_Maybe_1_Some(v41); - VAL v49 = mtw_std_list_List_1_Cons(v48, v39); - int64_t v50 = 1LL /* True */; - x47 = v50; - x46 = v42; - x45 = v49; - x44 = v38; - x43 = v37; - } break; - case 0LL: { // None - int64_t v51 = 0LL /* False */; - x47 = v51; - x46 = v42; - x45 = v39; - x44 = v38; - x43 = v37; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v36 = x47; - v35 = x46; - v34 = x45; - v33 = x44; - v32 = x43; - } - decref(v35); - int64_t v52 = 1LL /* True */; - x16 = v52; - x15 = v11; - x14 = v34; - x13 = v33; - x12 = v32; - } break; - case 0LL: { // None - int64_t v53 = 0LL /* False */; - x16 = v53; - x15 = v11; - x14 = v9; - x13 = x3; - x12 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v54 = (x12); - VAL v55 = (x13); - VAL v56 = (x14); - VAL v57 = x15; - int64_t v58 = x16; - while (((bool)v58)) { - VAL v59 = (v54); - VAL v60 = (v55); - VAL v61 = (v56); - VAL v62 = v57; - VAL v63; - VAL v64; - mw_std_list_List_1_uncons(v62, &v63, &v64); - VAL x65; - VAL x66; - VAL x67; - VAL x68; - int64_t x69; - switch (get_data_tag(v63)) { - case 1LL: { // Some - VAL v70 = mtp_std_maybe_Maybe_1_Some(v63); - VAL v71; - VAL v72; - VAL v73; - mw_mirth_specializzer_ZPlusSPCheck_checkZ_atomZBang(v70, v59, v60, &v71, &v72, &v73); - VAL v74; - VAL v75; - mw_std_list_List_1_uncons(v71, &v74, &v75); - VAL x76; - VAL x77; - VAL x78; - VAL x79; - int64_t x80; - switch (get_data_tag(v74)) { - case 1LL: { // Some - VAL v81 = mtp_std_maybe_Maybe_1_Some(v74); - VAL v82 = mtw_std_list_List_1_Cons(v81, v61); - int64_t v83 = 1LL /* True */; - x80 = v83; - x79 = v75; - x78 = v82; - x77 = v73; - x76 = v72; - } break; - case 0LL: { // None - int64_t v84 = 0LL /* False */; - x80 = v84; - x79 = v75; - x78 = v61; - x77 = v73; - x76 = v72; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v85 = (x76); - VAL v86 = (x77); - VAL v87 = (x78); - VAL v88 = x79; - int64_t v89 = x80; - while (((bool)v89)) { - VAL v90 = (v85); - VAL v91 = (v86); - VAL v92 = (v87); - VAL v93 = v88; - VAL v94; - VAL v95; - mw_std_list_List_1_uncons(v93, &v94, &v95); - VAL x96; - VAL x97; - VAL x98; - VAL x99; - int64_t x100; - switch (get_data_tag(v94)) { - case 1LL: { // Some - VAL v101 = mtp_std_maybe_Maybe_1_Some(v94); - VAL v102 = mtw_std_list_List_1_Cons(v101, v92); - int64_t v103 = 1LL /* True */; - x100 = v103; - x99 = v95; - x98 = v102; - x97 = v91; - x96 = v90; - } break; - case 0LL: { // None - int64_t v104 = 0LL /* False */; - x100 = v104; - x99 = v95; - x98 = v92; - x97 = v91; - x96 = v90; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v89 = x100; - v88 = x99; - v87 = x98; - v86 = x97; - v85 = x96; - } - decref(v88); - int64_t v105 = 1LL /* True */; - x69 = v105; - x68 = v64; - x67 = v87; - x66 = v86; - x65 = v85; + int64_t v10 = 1LL /* True */; + VAL v11 = x2; + VAL v12 = x3; + VAL v13 = v9; + VAL v14 = v7; + int64_t v15 = v10; + int64_t v16 = v10; + while (((bool)v16)) { + VAL v17 = v11; + VAL v18 = v12; + VAL v19 = v13; + VAL v20 = v14; + int64_t v21 = v15; + VAL x22; + VAL x23; + VAL x24; + VAL x25; + int64_t x26; + switch (get_data_tag(v20)) { + case 1LL: { // Cons + VAL v27; + VAL v28; + mtp_std_list_List_1_Cons(v20, &v27, &v28); + VAL v29; + VAL v30; + VAL v31; + mw_mirth_specializzer_ZPlusSPCheck_checkZ_atomZBang(v27, v17, v18, &v29, &v30, &v31); + VAL v32 = mw_std_list_List_1_for_1_sp46(v19, v29); + int64_t v33 = 1LL /* True */; + x26 = v33; + x25 = v28; + x24 = v32; + x23 = v31; + x22 = v30; } break; - case 0LL: { // None - int64_t v106 = 0LL /* False */; - x69 = v106; - x68 = v64; - x67 = v61; - x66 = v60; - x65 = v59; + case 0LL: { // Nil + VAL v34 = MKI64(0LL /* Nil */); + int64_t v35 = 0LL /* False */; + x26 = v35; + x25 = v34; + x24 = v19; + x23 = v18; + x22 = v17; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v58 = x69; - v57 = x68; - v56 = x67; - v55 = x66; - v54 = x65; + v16 = x26; + v15 = x26; + v14 = x25; + v13 = x24; + v12 = x23; + v11 = x22; } - decref(v57); - VAL v107 = mw_std_list_List_1_reverse(v56); - VAL v108 = tup_replace(x1, 7, v107); - *x6 = v55; - *x5 = v54; - *x4 = v108; + decref(v14); + VAL v36 = mw_std_list_List_1_reverse(v13); + VAL v37 = tup_replace(x1, 7, v36); + *x6 = v12; + *x5 = v11; + *x4 = v37; } static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_atomZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { incref(x1); @@ -62763,7 +45490,7 @@ static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_atomZBang (VAL x1, VAL x2, } break; case 14LL: { // OpBlockPush uint64_t v63 = mtp_mirth_arrow_Op_OpBlockPush(v7); - VAL v64 = (mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_blockZBang(v63, x3)); + VAL v64 = mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_blockZBang(v63, x3); VAL v65 = MKI64(0LL /* Nil */); VAL v66 = mtw_std_list_List_1_Cons(x1, v65); x10 = v66; @@ -62772,7 +45499,7 @@ static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_atomZBang (VAL x1, VAL x2, } break; case 15LL: { // OpBlockRun uint64_t v67 = mtp_mirth_arrow_Op_OpBlockRun(v7); - VAL v68 = (mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_blockZBang(v67, x3)); + VAL v68 = mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_blockZBang(v67, x3); VAL v69 = MKI64(0LL /* Nil */); VAL v70 = mtw_std_list_List_1_Cons(x1, v69); x10 = v70; @@ -62854,7 +45581,7 @@ static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_atomZBang (VAL x1, VAL x2, *x4 = x10; } static VAL mw_mirth_specializzer_ZPlusSPCheck_checkZ_argZBang (uint64_t x1, VAL x2) { - VAL v3 = (mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_blockZBang(x1, x2)); + VAL v3 = mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_blockZBang(x1, x2); return v3; } static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_primZ_atomZBang (VAL x1, int64_t x2, VAL x3, VAL *x4, VAL *x5) { @@ -62862,83 +45589,14 @@ static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_primZ_atomZBang (VAL x1, i VAL v6 = VVAL(VTUP(x1)->cells[5]); incref(v6); decref(x1); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v6, &v7, &v8); - VAL x9; - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v14 = (mw_mirth_specializzer_ZPlusSPCheck_checkZ_argZBang(VU64(v13), x3)); - int64_t v15 = 1LL /* True */; - x12 = v15; - x11 = v8; - x10 = x1; - x9 = v14; - } break; - case 0LL: { // None - int64_t v16 = 0LL /* False */; - x12 = v16; - x11 = v8; - x10 = x1; - x9 = x3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v17 = (x9); - VAL v18 = x10; - VAL v19 = x11; - int64_t v20 = x12; - while (((bool)v20)) { - VAL v21 = (v17); - VAL v22 = v18; - VAL v23 = v19; - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v23, &v24, &v25); - VAL x26; - VAL x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v24)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v24); - VAL v31 = (mw_mirth_specializzer_ZPlusSPCheck_checkZ_argZBang(VU64(v30), v21)); - int64_t v32 = 1LL /* True */; - x29 = v32; - x28 = v25; - x27 = v22; - x26 = v31; - } break; - case 0LL: { // None - int64_t v33 = 0LL /* False */; - x29 = v33; - x28 = v25; - x27 = v22; - x26 = v21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v20 = x29; - v19 = x28; - v18 = x27; - v17 = x26; - } - decref(v19); - VAL v34 = MKI64(0LL /* Nil */); - VAL v35 = mtw_std_list_List_1_Cons(v18, v34); - *x5 = v17; - *x4 = v35; + VAL v7 = mw_std_list_List_1_for_1_sp60(x3, v6); + VAL v8 = MKI64(0LL /* Nil */); + VAL v9 = mtw_std_list_List_1_Cons(x1, v8); + *x5 = v7; + *x4 = v9; } static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_wordZ_atomZBang (VAL x1, VAL x2, VAL x3, uint64_t x4, VAL *x5, VAL *x6, VAL *x7) { - VAL v8 = (mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_wordZBang(x4, x2)); + VAL v8 = mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_wordZBang(x4, x2); incref(x3); VAL v9 = VVAL(VTUP(x3)->cells[5]); incref(v9); @@ -62960,842 +45618,221 @@ static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_wordZ_atomZBang (VAL x1, V incref(v16); VAL v17; VAL v18; - mw_std_list_ListZPlus_1_uncons(v16, &v17, &v18); - VAL v19 = (mw_mirth_specializzer_ZPlusSPCheck_checkZ_argZBang(VU64(v17), v8)); - VAL v20; - VAL v21; - mw_std_list_List_1_uncons(v18, &v20, &v21); - VAL x22; - VAL x23; - VAL x24; - uint64_t x25; - VAL x26; - VAL x27; - int64_t x28; - switch (get_data_tag(v20)) { - case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v20); - VAL v30 = (mw_mirth_specializzer_ZPlusSPCheck_checkZ_argZBang(VU64(v29), v19)); - int64_t v31 = 1LL /* True */; - x28 = v31; - x27 = v21; - x26 = v16; - x25 = x4; - x24 = x3; - x23 = v30; - x22 = x1; - } break; - case 0LL: { // None - int64_t v32 = 0LL /* False */; - x28 = v32; - x27 = v21; - x26 = v16; - x25 = x4; - x24 = x3; - x23 = v19; - x22 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v33 = (x22); - VAL v34 = (x23); - VAL v35 = x24; - uint64_t v36 = x25; - VAL v37 = x26; - VAL v38 = x27; - int64_t v39 = x28; - while (((bool)v39)) { - VAL v40 = (v33); - VAL v41 = (v34); - VAL v42 = v35; - uint64_t v43 = v36; - VAL v44 = v37; - VAL v45 = v38; - VAL v46; - VAL v47; - mw_std_list_List_1_uncons(v45, &v46, &v47); - VAL x48; - VAL x49; - VAL x50; - uint64_t x51; - VAL x52; - VAL x53; - int64_t x54; - switch (get_data_tag(v46)) { - case 1LL: { // Some - VAL v55 = mtp_std_maybe_Maybe_1_Some(v46); - VAL v56 = (mw_mirth_specializzer_ZPlusSPCheck_checkZ_argZBang(VU64(v55), v41)); - int64_t v57 = 1LL /* True */; - x54 = v57; - x53 = v47; - x52 = v44; - x51 = v43; - x50 = v42; - x49 = v56; - x48 = v40; - } break; - case 0LL: { // None - int64_t v58 = 0LL /* False */; - x54 = v58; - x53 = v47; - x52 = v44; - x51 = v43; - x50 = v42; - x49 = v41; - x48 = v40; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v39 = x54; - v38 = x53; - v37 = x52; - v36 = x51; - v35 = x50; - v34 = x49; - v33 = x48; - } - decref(v38); - int64_t v59 = mw_mirth_word_Word_preferZ_inlineZAsk(v36); - bool v60 = !((bool)v59); - VAL x61; - VAL x62; - VAL x63; - uint64_t x64; - VAL x65; - int64_t x66; - if (v60) { - int64_t v67 = 1LL /* True */; - x66 = v67; - x65 = v37; - x64 = v36; - x63 = v35; - x62 = v34; - x61 = v33; - } else { - incref(v37); - VAL v68; - VAL v69; - mtp_std_list_ListZPlus_1_ListZPlus(v37, &v68, &v69); - VAL v70 = mtw_std_list_List_1_Cons(v68, v69); - VAL v71 = MKI64(0LL /* None */); - VAL v72; - VAL v73; - mw_std_list_List_1_uncons(v70, &v72, &v73); - VAL x74; - VAL x75; - VAL x76; - uint64_t x77; - VAL x78; - VAL x79; - VAL x80; - int64_t x81; - switch (get_data_tag(v72)) { + mtp_std_list_ListZPlus_1_ListZPlus(v16, &v17, &v18); + VAL v19 = mtw_std_list_List_1_Cons(v17, v18); + VAL v20 = MKI64(0LL /* None */); + int64_t v21 = 1LL /* True */; + VAL v22 = x1; + VAL v23 = v8; + VAL v24 = v20; + VAL v25 = v19; + int64_t v26 = v21; + int64_t v27 = v21; + while (((bool)v27)) { + VAL v28 = v22; + VAL v29 = v23; + VAL v30 = v24; + VAL v31 = v25; + int64_t v32 = v26; + VAL v33; + VAL v34; + mw_std_list_List_1_uncons(v31, &v33, &v34); + VAL x35; + VAL x36; + VAL x37; + VAL x38; + int64_t x39; + switch (get_data_tag(v33)) { case 1LL: { // Some - VAL v82 = mtp_std_maybe_Maybe_1_Some(v72); - incref(v82); - VAL v83; - VAL v84; - mw_mirth_arrow_Arg_freeZ_vars(v33, VU64(v82), &v83, &v84); - VAL v85 = MKI64(0LL /* None */); - VAL v86; - VAL v87; - mw_std_list_List_1_uncons(v84, &v86, &v87); - VAL x88; - uint64_t x89; - VAL x90; - VAL x91; - VAL x92; - VAL x93; - VAL x94; - int64_t x95; - switch (get_data_tag(v86)) { - case 1LL: { // Some - VAL v96 = mtp_std_maybe_Maybe_1_Some(v86); - incref(v96); - int64_t v97 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v96)); - VAL x98; - uint64_t x99; - VAL x100; - VAL x101; - VAL x102; - VAL x103; - if (((bool)v97)) { - VAL v104 = mtw_std_maybe_Maybe_1_Some(v96); - x103 = v104; - x102 = v34; - x101 = v83; - x100 = v37; - x99 = v36; - x98 = v35; - } else { - decref(v96); - VAL v105 = MKI64(0LL /* None */); - x103 = v105; - x102 = v34; - x101 = v83; - x100 = v37; - x99 = v36; - x98 = v35; - } - VAL x106; - uint64_t x107; - VAL x108; - VAL x109; - VAL x110; - VAL x111; - VAL x112; - switch (get_data_tag(x103)) { - case 0LL: { // None - x112 = v87; - x111 = v85; - x110 = x102; - x109 = x101; - x108 = x100; - x107 = x99; - x106 = x98; - } break; - default: { - decref(v87); - decref(v85); - VAL v113 = MKI64(0LL /* Nil */); - x112 = v113; - x111 = x103; - x110 = x102; - x109 = x101; - x108 = x100; - x107 = x99; - x106 = x98; - } break; - } - int64_t v114 = 1LL /* True */; - x95 = v114; - x94 = x112; - x93 = x111; - x92 = x110; - x91 = x109; - x90 = x108; - x89 = x107; - x88 = x106; - } break; - case 0LL: { // None - int64_t v115 = 0LL /* False */; - x95 = v115; - x94 = v87; - x93 = v85; - x92 = v34; - x91 = v83; - x90 = v37; - x89 = v36; - x88 = v35; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v116 = x88; - uint64_t v117 = x89; - VAL v118 = x90; - VAL v119 = (x91); - VAL v120 = (x92); - VAL v121 = x93; - VAL v122 = x94; - int64_t v123 = x95; - while (((bool)v123)) { - VAL v124 = v116; - uint64_t v125 = v117; - VAL v126 = v118; - VAL v127 = (v119); - VAL v128 = (v120); - VAL v129 = v121; - VAL v130 = v122; - VAL v131; - VAL v132; - mw_std_list_List_1_uncons(v130, &v131, &v132); - VAL x133; - uint64_t x134; - VAL x135; - VAL x136; - VAL x137; - VAL x138; - VAL x139; - int64_t x140; - switch (get_data_tag(v131)) { + VAL v40 = mtp_std_maybe_Maybe_1_Some(v33); + incref(v40); + VAL v41; + VAL v42; + mw_mirth_arrow_Arg_freeZ_vars(v28, VU64(v40), &v41, &v42); + VAL v43 = MKI64(0LL /* None */); + int64_t v44 = 1LL /* True */; + VAL v45 = v43; + VAL v46 = v42; + int64_t v47 = v44; + int64_t v48 = v44; + while (((bool)v48)) { + VAL v49 = v45; + VAL v50 = v46; + int64_t v51 = v47; + VAL v52; + VAL v53; + mw_std_list_List_1_uncons(v50, &v52, &v53); + VAL x54; + VAL x55; + int64_t x56; + switch (get_data_tag(v52)) { case 1LL: { // Some - VAL v141 = mtp_std_maybe_Maybe_1_Some(v131); - incref(v141); - int64_t v142 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v141)); - VAL x143; - uint64_t x144; - VAL x145; - VAL x146; - VAL x147; - VAL x148; - if (((bool)v142)) { - VAL v149 = mtw_std_maybe_Maybe_1_Some(v141); - x148 = v149; - x147 = v128; - x146 = v127; - x145 = v126; - x144 = v125; - x143 = v124; + VAL v57 = mtp_std_maybe_Maybe_1_Some(v52); + incref(v57); + int64_t v58 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v57)); + VAL x59; + if (((bool)v58)) { + VAL v60 = mtw_std_maybe_Maybe_1_Some(v57); + x59 = v60; } else { - decref(v141); - VAL v150 = MKI64(0LL /* None */); - x148 = v150; - x147 = v128; - x146 = v127; - x145 = v126; - x144 = v125; - x143 = v124; + decref(v57); + VAL v61 = MKI64(0LL /* None */); + x59 = v61; } - VAL x151; - uint64_t x152; - VAL x153; - VAL x154; - VAL x155; - VAL x156; - VAL x157; - switch (get_data_tag(x148)) { + VAL x62; + VAL x63; + switch (get_data_tag(x59)) { case 0LL: { // None - x157 = v132; - x156 = v129; - x155 = x147; - x154 = x146; - x153 = x145; - x152 = x144; - x151 = x143; + x63 = v53; + x62 = v49; } break; default: { - decref(v132); - decref(v129); - VAL v158 = MKI64(0LL /* Nil */); - x157 = v158; - x156 = x148; - x155 = x147; - x154 = x146; - x153 = x145; - x152 = x144; - x151 = x143; + decref(v53); + decref(v49); + VAL v64 = MKI64(0LL /* Nil */); + x63 = v64; + x62 = x59; } break; } - int64_t v159 = 1LL /* True */; - x140 = v159; - x139 = x157; - x138 = x156; - x137 = x155; - x136 = x154; - x135 = x153; - x134 = x152; - x133 = x151; + int64_t v65 = 1LL /* True */; + x56 = v65; + x55 = x63; + x54 = x62; } break; case 0LL: { // None - int64_t v160 = 0LL /* False */; - x140 = v160; - x139 = v132; - x138 = v129; - x137 = v128; - x136 = v127; - x135 = v126; - x134 = v125; - x133 = v124; + int64_t v66 = 0LL /* False */; + x56 = v66; + x55 = v53; + x54 = v49; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v123 = x140; - v122 = x139; - v121 = x138; - v120 = x137; - v119 = x136; - v118 = x135; - v117 = x134; - v116 = x133; + v48 = x56; + v47 = x56; + v46 = x55; + v45 = x54; } - decref(v122); - int64_t v161 = mw_std_maybe_Maybe_1_someZAsk(v121); - VAL x162; - VAL x163; - VAL x164; - uint64_t x165; - VAL x166; - VAL x167; - if (((bool)v161)) { - VAL v168 = mtw_std_maybe_Maybe_1_Some(v82); - x167 = v168; - x166 = v118; - x165 = v117; - x164 = v116; - x163 = v120; - x162 = v119; + decref(v46); + int64_t v67 = get_data_tag(v45); + decref(v45); + int64_t v68 = 1LL; + bool v69 = (v67 == v68); + VAL x70; + VAL x71; + VAL x72; + if (v69) { + VAL v73 = mtw_std_maybe_Maybe_1_Some(v40); + x72 = v73; + x71 = v29; + x70 = v41; } else { - decref(v82); - VAL v169 = MKI64(0LL /* None */); - x167 = v169; - x166 = v118; - x165 = v117; - x164 = v116; - x163 = v120; - x162 = v119; + decref(v40); + VAL v74 = MKI64(0LL /* None */); + x72 = v74; + x71 = v29; + x70 = v41; } - VAL x170; - VAL x171; - VAL x172; - uint64_t x173; - VAL x174; - VAL x175; - VAL x176; - switch (get_data_tag(x167)) { + VAL x75; + VAL x76; + VAL x77; + VAL x78; + switch (get_data_tag(x72)) { case 0LL: { // None - x176 = v73; - x175 = v71; - x174 = x166; - x173 = x165; - x172 = x164; - x171 = x163; - x170 = x162; + x78 = v34; + x77 = v30; + x76 = x71; + x75 = x70; } break; default: { - decref(v73); - decref(v71); - VAL v177 = MKI64(0LL /* Nil */); - x176 = v177; - x175 = x167; - x174 = x166; - x173 = x165; - x172 = x164; - x171 = x163; - x170 = x162; + decref(v34); + decref(v30); + VAL v79 = MKI64(0LL /* Nil */); + x78 = v79; + x77 = x72; + x76 = x71; + x75 = x70; } break; } - int64_t v178 = 1LL /* True */; - x81 = v178; - x80 = x176; - x79 = x175; - x78 = x174; - x77 = x173; - x76 = x172; - x75 = x171; - x74 = x170; + int64_t v80 = 1LL /* True */; + x39 = v80; + x38 = x78; + x37 = x77; + x36 = x76; + x35 = x75; } break; case 0LL: { // None - int64_t v179 = 0LL /* False */; - x81 = v179; - x80 = v73; - x79 = v71; - x78 = v37; - x77 = v36; - x76 = v35; - x75 = v34; - x74 = v33; + int64_t v81 = 0LL /* False */; + x39 = v81; + x38 = v34; + x37 = v30; + x36 = v29; + x35 = v28; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v180 = (x74); - VAL v181 = (x75); - VAL v182 = x76; - uint64_t v183 = x77; - VAL v184 = x78; - VAL v185 = x79; - VAL v186 = x80; - int64_t v187 = x81; - while (((bool)v187)) { - VAL v188 = (v180); - VAL v189 = (v181); - VAL v190 = v182; - uint64_t v191 = v183; - VAL v192 = v184; - VAL v193 = v185; - VAL v194 = v186; - VAL v195; - VAL v196; - mw_std_list_List_1_uncons(v194, &v195, &v196); - VAL x197; - VAL x198; - VAL x199; - uint64_t x200; - VAL x201; - VAL x202; - VAL x203; - int64_t x204; - switch (get_data_tag(v195)) { - case 1LL: { // Some - VAL v205 = mtp_std_maybe_Maybe_1_Some(v195); - incref(v205); - VAL v206; - VAL v207; - mw_mirth_arrow_Arg_freeZ_vars(v188, VU64(v205), &v206, &v207); - VAL v208 = MKI64(0LL /* None */); - VAL v209; - VAL v210; - mw_std_list_List_1_uncons(v207, &v209, &v210); - VAL x211; - uint64_t x212; - VAL x213; - VAL x214; - VAL x215; - VAL x216; - VAL x217; - int64_t x218; - switch (get_data_tag(v209)) { - case 1LL: { // Some - VAL v219 = mtp_std_maybe_Maybe_1_Some(v209); - incref(v219); - int64_t v220 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v219)); - VAL x221; - uint64_t x222; - VAL x223; - VAL x224; - VAL x225; - VAL x226; - if (((bool)v220)) { - VAL v227 = mtw_std_maybe_Maybe_1_Some(v219); - x226 = v227; - x225 = v189; - x224 = v206; - x223 = v192; - x222 = v191; - x221 = v190; - } else { - decref(v219); - VAL v228 = MKI64(0LL /* None */); - x226 = v228; - x225 = v189; - x224 = v206; - x223 = v192; - x222 = v191; - x221 = v190; - } - VAL x229; - uint64_t x230; - VAL x231; - VAL x232; - VAL x233; - VAL x234; - VAL x235; - switch (get_data_tag(x226)) { - case 0LL: { // None - x235 = v210; - x234 = v208; - x233 = x225; - x232 = x224; - x231 = x223; - x230 = x222; - x229 = x221; - } break; - default: { - decref(v210); - decref(v208); - VAL v236 = MKI64(0LL /* Nil */); - x235 = v236; - x234 = x226; - x233 = x225; - x232 = x224; - x231 = x223; - x230 = x222; - x229 = x221; - } break; - } - int64_t v237 = 1LL /* True */; - x218 = v237; - x217 = x235; - x216 = x234; - x215 = x233; - x214 = x232; - x213 = x231; - x212 = x230; - x211 = x229; - } break; - case 0LL: { // None - int64_t v238 = 0LL /* False */; - x218 = v238; - x217 = v210; - x216 = v208; - x215 = v189; - x214 = v206; - x213 = v192; - x212 = v191; - x211 = v190; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v239 = x211; - uint64_t v240 = x212; - VAL v241 = x213; - VAL v242 = (x214); - VAL v243 = (x215); - VAL v244 = x216; - VAL v245 = x217; - int64_t v246 = x218; - while (((bool)v246)) { - VAL v247 = v239; - uint64_t v248 = v240; - VAL v249 = v241; - VAL v250 = (v242); - VAL v251 = (v243); - VAL v252 = v244; - VAL v253 = v245; - VAL v254; - VAL v255; - mw_std_list_List_1_uncons(v253, &v254, &v255); - VAL x256; - uint64_t x257; - VAL x258; - VAL x259; - VAL x260; - VAL x261; - VAL x262; - int64_t x263; - switch (get_data_tag(v254)) { - case 1LL: { // Some - VAL v264 = mtp_std_maybe_Maybe_1_Some(v254); - incref(v264); - int64_t v265 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v264)); - VAL x266; - uint64_t x267; - VAL x268; - VAL x269; - VAL x270; - VAL x271; - if (((bool)v265)) { - VAL v272 = mtw_std_maybe_Maybe_1_Some(v264); - x271 = v272; - x270 = v251; - x269 = v250; - x268 = v249; - x267 = v248; - x266 = v247; - } else { - decref(v264); - VAL v273 = MKI64(0LL /* None */); - x271 = v273; - x270 = v251; - x269 = v250; - x268 = v249; - x267 = v248; - x266 = v247; - } - VAL x274; - uint64_t x275; - VAL x276; - VAL x277; - VAL x278; - VAL x279; - VAL x280; - switch (get_data_tag(x271)) { - case 0LL: { // None - x280 = v255; - x279 = v252; - x278 = x270; - x277 = x269; - x276 = x268; - x275 = x267; - x274 = x266; - } break; - default: { - decref(v255); - decref(v252); - VAL v281 = MKI64(0LL /* Nil */); - x280 = v281; - x279 = x271; - x278 = x270; - x277 = x269; - x276 = x268; - x275 = x267; - x274 = x266; - } break; - } - int64_t v282 = 1LL /* True */; - x263 = v282; - x262 = x280; - x261 = x279; - x260 = x278; - x259 = x277; - x258 = x276; - x257 = x275; - x256 = x274; - } break; - case 0LL: { // None - int64_t v283 = 0LL /* False */; - x263 = v283; - x262 = v255; - x261 = v252; - x260 = v251; - x259 = v250; - x258 = v249; - x257 = v248; - x256 = v247; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v246 = x263; - v245 = x262; - v244 = x261; - v243 = x260; - v242 = x259; - v241 = x258; - v240 = x257; - v239 = x256; - } - decref(v245); - int64_t v284 = mw_std_maybe_Maybe_1_someZAsk(v244); - VAL x285; - VAL x286; - VAL x287; - uint64_t x288; - VAL x289; - VAL x290; - if (((bool)v284)) { - VAL v291 = mtw_std_maybe_Maybe_1_Some(v205); - x290 = v291; - x289 = v241; - x288 = v240; - x287 = v239; - x286 = v243; - x285 = v242; - } else { - decref(v205); - VAL v292 = MKI64(0LL /* None */); - x290 = v292; - x289 = v241; - x288 = v240; - x287 = v239; - x286 = v243; - x285 = v242; - } - VAL x293; - VAL x294; - VAL x295; - uint64_t x296; - VAL x297; - VAL x298; - VAL x299; - switch (get_data_tag(x290)) { - case 0LL: { // None - x299 = v196; - x298 = v193; - x297 = x289; - x296 = x288; - x295 = x287; - x294 = x286; - x293 = x285; - } break; - default: { - decref(v196); - decref(v193); - VAL v300 = MKI64(0LL /* Nil */); - x299 = v300; - x298 = x290; - x297 = x289; - x296 = x288; - x295 = x287; - x294 = x286; - x293 = x285; - } break; - } - int64_t v301 = 1LL /* True */; - x204 = v301; - x203 = x299; - x202 = x298; - x201 = x297; - x200 = x296; - x199 = x295; - x198 = x294; - x197 = x293; - } break; - case 0LL: { // None - int64_t v302 = 0LL /* False */; - x204 = v302; - x203 = v196; - x202 = v193; - x201 = v192; - x200 = v191; - x199 = v190; - x198 = v189; - x197 = v188; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v187 = x204; - v186 = x203; - v185 = x202; - v184 = x201; - v183 = x200; - v182 = x199; - v181 = x198; - v180 = x197; - } - decref(v186); - int64_t v303 = mw_std_maybe_Maybe_1_someZAsk(v185); - x66 = v303; - x65 = v184; - x64 = v183; - x63 = v182; - x62 = v181; - x61 = v180; + v27 = x39; + v26 = x39; + v25 = x38; + v24 = x37; + v23 = x36; + v22 = x35; } - VAL x304; - VAL x305; - VAL x306; - if (((bool)x66)) { - decref(x65); - VAL v307 = MKI64(0LL /* Nil */); - VAL v308 = mtw_std_list_List_1_Cons(x63, v307); - x306 = v308; - x305 = x62; - x304 = x61; + decref(v25); + int64_t v82 = get_data_tag(v24); + decref(v24); + int64_t v83 = 1LL; + bool v84 = (v82 == v83); + VAL x85; + VAL x86; + VAL x87; + if (v84) { + incref(v16); + VAL v88; + VAL v89; + mw_std_list_ListZPlus_1_uncons(v16, &v88, &v89); + VAL v90 = mw_mirth_specializzer_ZPlusSPCheck_checkZ_argZBang(VU64(v88), v23); + VAL v91 = mw_std_list_List_1_for_1_sp60(v90, v89); + decref(v16); + VAL v92 = MKI64(0LL /* Nil */); + VAL v93 = mtw_std_list_List_1_Cons(x3, v92); + x87 = v93; + x86 = v91; + x85 = v22; } else { - VAL v309; - uint64_t v310; - mw_mirth_specializzer_specializzeZ_wordZBang(x61, x65, x64, &v309, &v310); - VAL v311 = (mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_wordZBang(v310, x62)); - VAL v312; - uint64_t v313; - VAL v314; - VAL v315; - VAL v316; - VAL v317; - VAL v318; - VAL v319; - mtp_mirth_arrow_Atom_Atom(x63, &v312, &v313, &v314, &v315, &v316, &v317, &v318, &v319); - VAL v320 = mw_mirth_type_TZ_ZTo(v317, v318); - decref(v316); - decref(v315); - decref(v319); - VAL v321; - VAL v322; - mw_mirth_type_ArrowType_unpack(v320, &v321, &v322); - incref(v321); - VAL v323 = MKI64(0LL /* Nil */); - VAL v324 = mtw_mirth_arrow_Arrow_Arrow(v312, v313, v313, v314, v321, v321, v323); - VAL v325; - VAL v326; - mw_mirth_elab_abZ_wordZBang(v310, v309, v324, &v325, &v326); - VAL v327; - VAL v328; - mw_mirth_elab_abZ_unifyZ_typeZBang(v322, v325, v326, &v327, &v328); - VAL v329 = VVAL(VTUP(v328)->cells[7]); - incref(v329); - decref(v328); - x306 = v329; - x305 = v311; - x304 = v327; + VAL v94; + uint64_t v95; + mw_mirth_specializzer_specializzeZ_wordZBang(v22, v16, x4, &v94, &v95); + VAL v96 = mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_wordZBang(v95, v23); + VAL v97; + uint64_t v98; + VAL v99; + VAL v100; + VAL v101; + VAL v102; + VAL v103; + VAL v104; + mtp_mirth_arrow_Atom_Atom(x3, &v97, &v98, &v99, &v100, &v101, &v102, &v103, &v104); + VAL v105 = mw_mirth_type_TZ_ZTo(v102, v103); + decref(v101); + decref(v100); + decref(v104); + VAL v106; + VAL v107; + mw_mirth_elab_abZ_buildZ_homZBang_1_sp1(v95, v94, v99, v105, v98, v97, &v106, &v107); + VAL v108 = VVAL(VTUP(v107)->cells[7]); + incref(v108); + decref(v107); + x87 = v108; + x86 = v96; + x85 = v106; } - x13 = x306; - x12 = x305; - x11 = x304; + x13 = x87; + x12 = x86; + x11 = x85; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -63812,98 +45849,67 @@ static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_matchZBang (VAL x1, VAL x2 decref(x1); VAL v8 = MKI64(0LL /* Nil */); VAL v9 = mw_std_list_List_1_reverse(v8); - VAL v10; - VAL v11; - mw_std_list_List_1_uncons(v7, &v10, &v11); - VAL x12; - VAL x13; - VAL x14; - VAL x15; - int64_t x16; - switch (get_data_tag(v10)) { - case 1LL: { // Some - VAL v17 = mtp_std_maybe_Maybe_1_Some(v10); - VAL v18; - VAL v19; - VAL v20; - mw_mirth_specializzer_ZPlusSPCheck_checkZ_caseZBang(v17, x2, x3, &v18, &v19, &v20); - VAL v21 = mtw_std_list_List_1_Cons(v18, v9); - int64_t v22 = 1LL /* True */; - x16 = v22; - x15 = v11; - x14 = v21; - x13 = v20; - x12 = v19; - } break; - case 0LL: { // None - int64_t v23 = 0LL /* False */; - x16 = v23; - x15 = v11; - x14 = v9; - x13 = x3; - x12 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v24 = (x12); - VAL v25 = (x13); - VAL v26 = (x14); - VAL v27 = x15; - int64_t v28 = x16; - while (((bool)v28)) { - VAL v29 = (v24); - VAL v30 = (v25); - VAL v31 = (v26); - VAL v32 = v27; - VAL v33; - VAL v34; - mw_std_list_List_1_uncons(v32, &v33, &v34); - VAL x35; - VAL x36; - VAL x37; - VAL x38; - int64_t x39; - switch (get_data_tag(v33)) { - case 1LL: { // Some - VAL v40 = mtp_std_maybe_Maybe_1_Some(v33); - VAL v41; - VAL v42; - VAL v43; - mw_mirth_specializzer_ZPlusSPCheck_checkZ_caseZBang(v40, v29, v30, &v41, &v42, &v43); - VAL v44 = mtw_std_list_List_1_Cons(v41, v31); - int64_t v45 = 1LL /* True */; - x39 = v45; - x38 = v34; - x37 = v44; - x36 = v43; - x35 = v42; + int64_t v10 = 1LL /* True */; + VAL v11 = x2; + VAL v12 = x3; + VAL v13 = v9; + VAL v14 = v7; + int64_t v15 = v10; + int64_t v16 = v10; + while (((bool)v16)) { + VAL v17 = v11; + VAL v18 = v12; + VAL v19 = v13; + VAL v20 = v14; + int64_t v21 = v15; + VAL x22; + VAL x23; + VAL x24; + VAL x25; + int64_t x26; + switch (get_data_tag(v20)) { + case 1LL: { // Cons + VAL v27; + VAL v28; + mtp_std_list_List_1_Cons(v20, &v27, &v28); + VAL v29; + VAL v30; + VAL v31; + mw_mirth_specializzer_ZPlusSPCheck_checkZ_caseZBang(v27, v17, v18, &v29, &v30, &v31); + VAL v32 = mtw_std_list_List_1_Cons(v29, v19); + int64_t v33 = 1LL /* True */; + x26 = v33; + x25 = v28; + x24 = v32; + x23 = v31; + x22 = v30; } break; - case 0LL: { // None - int64_t v46 = 0LL /* False */; - x39 = v46; - x38 = v34; - x37 = v31; - x36 = v30; - x35 = v29; + case 0LL: { // Nil + VAL v34 = MKI64(0LL /* Nil */); + int64_t v35 = 0LL /* False */; + x26 = v35; + x25 = v34; + x24 = v19; + x23 = v18; + x22 = v17; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v28 = x39; - v27 = x38; - v26 = x37; - v25 = x36; - v24 = x35; + v16 = x26; + v15 = x26; + v14 = x25; + v13 = x24; + v12 = x23; + v11 = x22; } - decref(v27); - VAL v47 = mw_std_list_List_1_reverse(v26); - VAL v48 = tup_replace(x1, 7, v47); - *x6 = v25; - *x5 = v24; - *x4 = v48; + decref(v14); + VAL v36 = mw_std_list_List_1_reverse(v13); + VAL v37 = tup_replace(x1, 7, v36); + *x6 = v12; + *x5 = v11; + *x4 = v37; } static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_caseZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { incref(x1); @@ -63936,847 +45942,1009 @@ static void mw_mirth_specializzer_ZPlusSPCheck_checkZ_lambdaZBang (VAL x1, VAL x static VAL mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_wordZBang (uint64_t x1, VAL x2) { void* v3 = mfld_mirth_word_Word_ZTildespZ_checked(x1); VAL v4 = mw_std_prelude_ZAtZAsk(v3); - VAL x5; - uint64_t x6; - int64_t x7; + int64_t x5; switch (get_data_tag(v4)) { case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v4); - x7 = VI64(v8); - x6 = x1; - x5 = x2; + VAL v6 = mtp_std_maybe_Maybe_1_Some(v4); + x5 = VI64(v6); } break; case 0LL: { // None - int64_t v9 = 0LL /* False */; - x7 = v9; - x6 = x1; - x5 = x2; + int64_t v7 = 0LL /* False */; + x5 = v7; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x10; - if (((bool)x7)) { - x10 = x5; + VAL x8; + if (((bool)x5)) { + x8 = x2; } else { - int64_t v11 = 1LL /* True */; - void* v12 = mfld_mirth_word_Word_ZTildespZ_checked(x6); - mut_set(MKI64(v11), v12); - VAL v13 = mtw_mirth_specializzer_SPCheckItem_SPCHECKz_WORD(x6); - incref(x5); - VAL v14 = mtw_std_list_List_1_Cons(v13, x5); - decref(x5); - x10 = v14; + int64_t v9 = 1LL /* True */; + void* v10 = mfld_mirth_word_Word_ZTildespZ_checked(x1); + mut_set(MKI64(v9), v10); + VAL v11 = mtw_mirth_specializzer_SPCheckItem_SPCHECKz_WORD(x1); + incref(x2); + VAL v12 = mtw_std_list_List_1_Cons(v11, x2); + decref(x2); + x8 = v12; } - return x10; + return x8; } static VAL mw_mirth_specializzer_ZPlusSPCheck_pushZ_checkZ_blockZBang (uint64_t x1, VAL x2) { void* v3 = mfld_mirth_arrow_Block_ZTildespZ_checked(x1); VAL v4 = mw_std_prelude_ZAtZAsk(v3); - VAL x5; - uint64_t x6; - int64_t x7; + int64_t x5; switch (get_data_tag(v4)) { case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v4); - x7 = VI64(v8); - x6 = x1; - x5 = x2; + VAL v6 = mtp_std_maybe_Maybe_1_Some(v4); + x5 = VI64(v6); } break; case 0LL: { // None - int64_t v9 = 0LL /* False */; - x7 = v9; - x6 = x1; - x5 = x2; + int64_t v7 = 0LL /* False */; + x5 = v7; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL x10; - if (((bool)x7)) { - x10 = x5; + VAL x8; + if (((bool)x5)) { + x8 = x2; } else { - int64_t v11 = 1LL /* True */; - void* v12 = mfld_mirth_arrow_Block_ZTildespZ_checked(x6); - mut_set(MKI64(v11), v12); - VAL v13 = mtw_mirth_specializzer_SPCheckItem_SPCHECKz_BLOCK(x6); - incref(x5); - VAL v14 = mtw_std_list_List_1_Cons(v13, x5); - decref(x5); - x10 = v14; + int64_t v9 = 1LL /* True */; + void* v10 = mfld_mirth_arrow_Block_ZTildespZ_checked(x1); + mut_set(MKI64(v9), v10); + VAL v11 = mtw_mirth_specializzer_SPCheckItem_SPCHECKz_BLOCK(x1); + incref(x2); + VAL v12 = mtw_std_list_List_1_Cons(v11, x2); + decref(x2); + x8 = v12; } - return x10; + return x8; } -static int64_t mw_mirth_specializzer_SPKey_ZEqualZEqual (VAL x1, VAL x2) { - VAL v3; - VAL v4; - mtp_std_list_ListZPlus_1_ListZPlus(x1, &v3, &v4); - VAL v5 = mtw_std_list_List_1_Cons(v3, v4); +static void mw_mirth_arrow_Arg_similar (VAL x1, uint64_t x2, uint64_t x3, VAL *x4, int64_t *x5) { VAL v6; - VAL v7; - mtp_std_list_ListZPlus_1_ListZPlus(x2, &v6, &v7); - VAL v8 = mtw_std_list_List_1_Cons(v6, v7); - int64_t v9 = 1LL /* True */; + int64_t v7; + mw_mirth_arrow_Block_similar(x1, x2, x3, &v6, &v7); + *x5 = v7; + *x4 = v6; +} +static void mw_mirth_arrow_Block_similar (VAL x1, uint64_t x2, uint64_t x3, VAL *x4, int64_t *x5) { + int64_t v6 = mw_mirth_arrow_Block_ZEqualZEqual(x2, x3); + VAL x7; + uint64_t x8; + uint64_t x9; + int64_t x10; + if (((bool)v6)) { + int64_t v11 = 1LL /* True */; + x10 = v11; + x9 = x3; + x8 = x2; + x7 = x1; + } else { + VAL v12; + VAL v13; + mw_mirth_arrow_Block_arrow(x1, x2, &v12, &v13); + VAL v14; + VAL v15; + mw_mirth_arrow_Block_arrow(v12, x3, &v14, &v15); + VAL v16; + int64_t v17; + mw_mirth_arrow_Arrow_similar(v14, v13, v15, &v16, &v17); + x10 = v17; + x9 = x3; + x8 = x2; + x7 = v16; + } + *x5 = x10; + *x4 = x7; +} +static void mw_mirth_arrow_Arrow_similar (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5) { + VAL v6 = VVAL(VTUP(x2)->cells[7]); + incref(v6); + decref(x2); + VAL v7 = VVAL(VTUP(x3)->cells[7]); + incref(v7); + decref(x3); + int64_t v8 = 1LL /* True */; + VAL v9; VAL v10; + mw_std_list_List_1_uncons(v6, &v9, &v10); VAL v11; - mw_std_list_List_1_uncons(v5, &v10, &v11); VAL v12; - VAL v13; - mw_std_list_List_1_uncons(v8, &v12, &v13); + mw_std_list_List_1_uncons(v7, &v11, &v12); + VAL x13; int64_t x14; - switch (get_data_tag(v12)) { + switch (get_data_tag(v11)) { case 0LL: { // None - int64_t v15 = mw_std_maybe_Maybe_1_noneZAsk(v10); - x14 = v15; + int64_t v15 = get_data_tag(v9); + decref(v9); + int64_t v16 = 0LL; + bool v17 = (v15 == v16); + x14 = ((int64_t)v17); + x13 = x1; } break; case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(v12); - int64_t x17; - switch (get_data_tag(v10)) { + VAL v18 = mtp_std_maybe_Maybe_1_Some(v11); + VAL x19; + int64_t x20; + switch (get_data_tag(v9)) { case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(v10); - int64_t v19 = mw_mirth_arrow_Arg_ZEqualZEqual(VU64(v18), VU64(v16)); - x17 = v19; + VAL v21 = mtp_std_maybe_Maybe_1_Some(v9); + VAL v22; + int64_t v23; + mw_mirth_arrow_Atom_similar(x1, v21, v18, &v22, &v23); + x20 = v23; + x19 = v22; } break; case 0LL: { // None - decref(v16); - int64_t v20 = 0LL /* False */; - x17 = v20; + decref(v18); + int64_t v24 = 0LL /* False */; + x20 = v24; + x19 = x1; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x14 = x17; + x14 = x20; + x13 = x19; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - bool v21 = (((bool)x14) && ((bool)v9)); - incref(v11); - int64_t v22 = mw_std_list_List_1_emptyZAsk(v11); - incref(v13); - int64_t v23 = mw_std_list_List_1_emptyZAsk(v13); - bool v24 = (((bool)v22) && ((bool)v23)); - bool v25 = !v24; - bool v26 = (v25 && v21); - VAL v27 = v11; - VAL v28 = v13; - bool v29 = v21; - bool v30 = v26; - while (v30) { - VAL v31 = v27; - VAL v32 = v28; - bool v33 = v29; - VAL v34; - VAL v35; - mw_std_list_List_1_uncons(v31, &v34, &v35); - VAL v36; - VAL v37; - mw_std_list_List_1_uncons(v32, &v36, &v37); - int64_t x38; - switch (get_data_tag(v36)) { + bool v25 = (((bool)x14) && ((bool)v8)); + incref(v10); + int64_t v26 = mw_std_list_List_1_emptyZAsk(v10); + incref(v12); + int64_t v27 = mw_std_list_List_1_emptyZAsk(v12); + bool v28 = (((bool)v26) && ((bool)v27)); + bool v29 = !v28; + bool v30 = (v29 && v25); + VAL v31 = x13; + VAL v32 = v10; + VAL v33 = v12; + bool v34 = v25; + bool v35 = v30; + while (v35) { + VAL v36 = v31; + VAL v37 = v32; + VAL v38 = v33; + bool v39 = v34; + VAL v40; + VAL v41; + mw_std_list_List_1_uncons(v37, &v40, &v41); + VAL v42; + VAL v43; + mw_std_list_List_1_uncons(v38, &v42, &v43); + VAL x44; + int64_t x45; + switch (get_data_tag(v42)) { case 0LL: { // None - int64_t v39 = mw_std_maybe_Maybe_1_noneZAsk(v34); - x38 = v39; + int64_t v46 = get_data_tag(v40); + decref(v40); + int64_t v47 = 0LL; + bool v48 = (v46 == v47); + x45 = ((int64_t)v48); + x44 = v36; } break; case 1LL: { // Some - VAL v40 = mtp_std_maybe_Maybe_1_Some(v36); - int64_t x41; - switch (get_data_tag(v34)) { + VAL v49 = mtp_std_maybe_Maybe_1_Some(v42); + VAL x50; + int64_t x51; + switch (get_data_tag(v40)) { case 1LL: { // Some - VAL v42 = mtp_std_maybe_Maybe_1_Some(v34); - int64_t v43 = mw_mirth_arrow_Arg_ZEqualZEqual(VU64(v42), VU64(v40)); - x41 = v43; + VAL v52 = mtp_std_maybe_Maybe_1_Some(v40); + VAL v53; + int64_t v54; + mw_mirth_arrow_Atom_similar(v36, v52, v49, &v53, &v54); + x51 = v54; + x50 = v53; } break; case 0LL: { // None - decref(v40); - int64_t v44 = 0LL /* False */; - x41 = v44; + decref(v49); + int64_t v55 = 0LL /* False */; + x51 = v55; + x50 = v36; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x38 = x41; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - bool v45 = (((bool)x38) && v33); - incref(v35); - int64_t v46 = mw_std_list_List_1_emptyZAsk(v35); - incref(v37); - int64_t v47 = mw_std_list_List_1_emptyZAsk(v37); - bool v48 = (((bool)v46) && ((bool)v47)); - bool v49 = !v48; - bool v50 = (v49 && v45); - v30 = v50; - v29 = v45; - v28 = v37; - v27 = v35; - } - decref(v28); - decref(v27); - return ((int64_t)v29); -} -static void mw_mirth_specializzer_SPKey_ZToStr (VAL x1, VAL x2, VAL *x3, VAL *x4) { - STR* v5; - STRLIT(v5, "", 0); - STR* v6; - STRLIT(v6, "(", 1); - VAL v7 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), MKSTR(v5))); - STR* v8; - STRLIT(v8, "", 0); - VAL v9; - VAL v10; - mw_std_list_ListZPlus_1_uncons(x2, &v9, &v10); - VAL v11 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), v7)); - VAL v12; - VAL v13; - mw_mirth_arrow_Arg_ZToStr(x1, VU64(v9), &v12, &v13); - VAL v14 = (mw_std_str_ZPlusStr_pushZ_strZBang(v13, v11)); - STR* v15; - STRLIT(v15, ",", 1); - VAL v16; - VAL v17; - mw_std_list_List_1_uncons(v10, &v16, &v17); - VAL x18; - VAL x19; - VAL x20; - VAL x21; - int64_t x22; - switch (get_data_tag(v16)) { - case 1LL: { // Some - VAL v23 = mtp_std_maybe_Maybe_1_Some(v16); - VAL v24 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v15), v14)); - VAL v25; - VAL v26; - mw_mirth_arrow_Arg_ZToStr(v12, VU64(v23), &v25, &v26); - VAL v27 = (mw_std_str_ZPlusStr_pushZ_strZBang(v26, v24)); - STR* v28; - STRLIT(v28, ",", 1); - int64_t v29 = 1LL /* True */; - x22 = v29; - x21 = v17; - x20 = MKSTR(v28); - x19 = v27; - x18 = v25; - } break; - case 0LL: { // None - int64_t v30 = 0LL /* False */; - x22 = v30; - x21 = v17; - x20 = MKSTR(v15); - x19 = v14; - x18 = v12; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v31 = (x18); - VAL v32 = (x19); - VAL v33 = x20; - VAL v34 = x21; - int64_t v35 = x22; - while (((bool)v35)) { - VAL v36 = (v31); - VAL v37 = (v32); - VAL v38 = v33; - VAL v39 = v34; - VAL v40; - VAL v41; - mw_std_list_List_1_uncons(v39, &v40, &v41); - VAL x42; - VAL x43; - VAL x44; - VAL x45; - int64_t x46; - switch (get_data_tag(v40)) { - case 1LL: { // Some - VAL v47 = mtp_std_maybe_Maybe_1_Some(v40); - VAL v48 = (mw_std_str_ZPlusStr_pushZ_strZBang(v38, v37)); - VAL v49; - VAL v50; - mw_mirth_arrow_Arg_ZToStr(v36, VU64(v47), &v49, &v50); - VAL v51 = (mw_std_str_ZPlusStr_pushZ_strZBang(v50, v48)); - STR* v52; - STRLIT(v52, ",", 1); - int64_t v53 = 1LL /* True */; - x46 = v53; - x45 = v41; - x44 = MKSTR(v52); - x43 = v51; - x42 = v49; - } break; - case 0LL: { // None - int64_t v54 = 0LL /* False */; - x46 = v54; - x45 = v41; - x44 = v38; - x43 = v37; - x42 = v36; + x45 = x51; + x44 = x50; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v35 = x46; - v34 = x45; - v33 = x44; - v32 = x43; - v31 = x42; + bool v56 = (((bool)x45) && v39); + incref(v41); + int64_t v57 = mw_std_list_List_1_emptyZAsk(v41); + incref(v43); + int64_t v58 = mw_std_list_List_1_emptyZAsk(v43); + bool v59 = (((bool)v57) && ((bool)v58)); + bool v60 = !v59; + bool v61 = (v60 && v56); + v35 = v61; + v34 = v56; + v33 = v43; + v32 = v41; + v31 = x44; } - decref(v34); decref(v33); - STR* v55; - STRLIT(v55, ")", 1); - VAL v56 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v55), v32)); - *x4 = v56; - *x3 = v31; -} -static void mw_mirth_specializzer_SPKey_ZToName (VAL x1, VAL x2, VAL *x3, uint64_t *x4) { - VAL v5; - VAL v6; - mw_mirth_specializzer_SPKey_ZToStr(x1, x2, &v5, &v6); - uint64_t v7 = mw_std_prim_Str_ZToName(v6); - *x4 = v7; - *x3 = v5; -} -static VAL mw_mirth_word_Word_spZ_synthed (uint64_t x1) { - void* v2 = mfld_mirth_word_Word_ZTildespZ_synthed(x1); - VAL v3 = mw_std_prelude_ZAtZAsk(v2); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - x4 = v5; - } break; - case 0LL: { // None - VAL v6 = mw_std_map_Map_2_empty(); - x4 = v6; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x4; + decref(v32); + *x5 = ((int64_t)v34); + *x4 = v31; } -static void mw_mirth_specializzer_specializzeZ_wordZBang (VAL x1, VAL x2, uint64_t x3, VAL *x4, uint64_t *x5) { +static void mw_mirth_arrow_Atom_similar (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5) { incref(x2); - VAL v6 = mw_mirth_word_Word_spZ_synthed(x3); - VAL v7 = MKI64(0LL /* None */); + incref(x3); + VAL v6 = VVAL(VTUP(x2)->cells[4]); + incref(v6); + decref(x2); + VAL v7 = VVAL(VTUP(x3)->cells[4]); + incref(v7); + decref(x3); VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v6, &v8, &v9); + int64_t v9; + mw_mirth_arrow_Op_similar(x1, v6, v7, &v8, &v9); VAL x10; VAL x11; VAL x12; int64_t x13; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v8); - incref(v14); - incref(x2); - VAL v15 = VVAL(VTUP(v14)->cells[1]); - incref(v15); - decref(v14); - int64_t v16 = mw_mirth_specializzer_SPKey_ZEqualZEqual(x2, v15); - VAL x17; - VAL x18; - if (((bool)v16)) { - VAL v19 = mtw_std_maybe_Maybe_1_Some(v14); - x18 = v19; - x17 = x2; - push_resource(x1); - lpush(&lbl_key, x2); - lpush(&lbl_word, MKU64(x3)); - } else { - decref(v14); - VAL v20 = MKI64(0LL /* None */); - x18 = v20; - x17 = x2; - push_resource(x1); - lpush(&lbl_key, x2); - lpush(&lbl_word, MKU64(x3)); - } - VAL x21; - VAL x22; - VAL x23; - switch (get_data_tag(x18)) { - case 0LL: { // None - x23 = v9; - x22 = v7; - x21 = x17; + if (((bool)v9)) { + incref(x2); + incref(x3); + VAL v14 = VVAL(VTUP(x2)->cells[5]); + incref(v14); + decref(x2); + VAL v15 = VVAL(VTUP(x3)->cells[5]); + incref(v15); + decref(x3); + VAL v16; + int64_t v17; + mw_std_list_List_1_ZEqualZEqual_1_sp1(v8, v14, v15, &v16, &v17); + x13 = v17; + x12 = x3; + x11 = x2; + x10 = v16; + } else { + int64_t v18 = 0LL /* False */; + x13 = v18; + x12 = x3; + x11 = x2; + x10 = v8; + } + decref(x12); + decref(x11); + *x5 = x13; + *x4 = x10; +} +static void mw_mirth_arrow_Op_similar (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5) { + VAL x6; + int64_t x7; + switch (get_data_tag(x3)) { + case 0LL: { // OpNone + VAL x8; + int64_t x9; + switch (get_data_tag(x2)) { + case 0LL: { // OpNone + int64_t v10 = 1LL /* True */; + x9 = v10; + x8 = x1; } break; default: { - decref(v9); - decref(v7); - VAL v24 = MKI64(0LL /* Nil */); - x23 = v24; - x22 = x18; - x21 = x17; + decref(x2); + int64_t v11 = 0LL /* False */; + x9 = v11; + x8 = x1; } break; } - int64_t v25 = 1LL /* True */; - x13 = v25; - x12 = x23; - x11 = x22; - x10 = x21; - } break; - case 0LL: { // None - int64_t v26 = 0LL /* False */; - x13 = v26; - x12 = v9; - x11 = v7; - x10 = x2; - push_resource(x1); - lpush(&lbl_key, x2); - lpush(&lbl_word, MKU64(x3)); + x7 = x9; + x6 = x8; } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v27 = x10; - VAL v28 = x11; - VAL v29 = x12; - int64_t v30 = x13; - while (((bool)v30)) { - VAL v31 = v27; - VAL v32 = v28; - VAL v33 = v29; - VAL v34; - VAL v35; - mw_std_list_List_1_uncons(v33, &v34, &v35); - VAL x36; - VAL x37; - VAL x38; - int64_t x39; - switch (get_data_tag(v34)) { - case 1LL: { // Some - VAL v40 = mtp_std_maybe_Maybe_1_Some(v34); - incref(v40); - incref(v31); - VAL v41 = VVAL(VTUP(v40)->cells[1]); - incref(v41); - decref(v40); - int64_t v42 = mw_mirth_specializzer_SPKey_ZEqualZEqual(v31, v41); - VAL x43; - VAL x44; - if (((bool)v42)) { - VAL v45 = mtw_std_maybe_Maybe_1_Some(v40); - x44 = v45; - x43 = v31; - } else { - decref(v40); - VAL v46 = MKI64(0LL /* None */); - x44 = v46; - x43 = v31; - } - VAL x47; - VAL x48; - VAL x49; - switch (get_data_tag(x44)) { - case 0LL: { // None - x49 = v35; - x48 = v32; - x47 = x43; - } break; - default: { - decref(v35); - decref(v32); - VAL v50 = MKI64(0LL /* Nil */); - x49 = v50; - x48 = x44; - x47 = x43; - } break; - } - int64_t v51 = 1LL /* True */; - x39 = v51; - x38 = x49; - x37 = x48; - x36 = x47; - } break; - case 0LL: { // None - int64_t v52 = 0LL /* False */; - x39 = v52; - x38 = v35; - x37 = v32; - x36 = v31; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + case 1LL: { // OpPrim + int64_t v12 = mtp_mirth_arrow_Op_OpPrim(x3); + VAL x13; + int64_t x14; + switch (get_data_tag(x2)) { + case 1LL: { // OpPrim + int64_t v15 = mtp_mirth_arrow_Op_OpPrim(x2); + int64_t v16 = mw_mirth_prim_Prim_ZEqualZEqual(v12, v15); + x14 = v16; + x13 = x1; + } break; + default: { + decref(x2); + int64_t v17 = 0LL /* False */; + x14 = v17; + x13 = x1; + } break; } - } - v30 = x39; - v29 = x38; - v28 = x37; - v27 = x36; - } - decref(v29); - decref(v27); - VAL x53; - switch (get_data_tag(v28)) { - case 1LL: { // Some - VAL v54 = mtp_std_maybe_Maybe_1_Some(v28); - VAL v55 = VVAL(VTUP(v54)->cells[2]); - incref(v55); - decref(v54); - VAL v56 = mtw_std_maybe_Maybe_1_Some(v55); - x53 = v56; - } break; - case 0LL: { // None - VAL v57 = MKI64(0LL /* None */); - x53 = v57; + x7 = x14; + x6 = x13; } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x58; - VAL x59; - uint64_t x60; - uint64_t x61; - switch (get_data_tag(x53)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(x53); - int64_t v63 = 0LL /* False */; - incref(v62); - void* v64 = mfld_mirth_word_Word_ZTildepreferZ_inlineZAsk(VU64(v62)); - mut_set(MKI64(v63), v64); - x61 = VU64(v62); - uint64_t v65 = VU64(lpop(&lbl_word)); - x60 = v65; - VAL v66 = lpop(&lbl_key); - x59 = v66; - VAL r67 = pop_resource(); - x58 = r67; + case 2LL: { // OpWord + uint64_t v18 = mtp_mirth_arrow_Op_OpWord(x3); + VAL x19; + int64_t x20; + switch (get_data_tag(x2)) { + case 2LL: { // OpWord + uint64_t v21 = mtp_mirth_arrow_Op_OpWord(x2); + int64_t v22 = mw_mirth_word_Word_ZEqualZEqual(v18, v21); + x20 = v22; + x19 = x1; + } break; + default: { + decref(x2); + int64_t v23 = 0LL /* False */; + x20 = v23; + x19 = x1; + } break; + } + x7 = x20; + x6 = x19; } break; - case 0LL: { // None - uint64_t v68 = VU64(lpop(&lbl_word)); - uint64_t v69 = mw_mirth_word_Word_head(v68); - VAL v70 = MKI64(0LL /* None */); - uint64_t v71 = mw_mirth_word_Word_body(v68); - VAL v72 = lpop(&lbl_key); - incref(v72); - VAL r73 = pop_resource(); - VAL v74; - uint64_t v75; - mw_mirth_specializzer_SPKey_ZToName(r73, v72, &v74, &v75); - int64_t v76 = 0LL; - uint64_t v77; - VAL v78; - mw_mirth_word_Word_newZBang(v69, v70, v71, v75, v76, v74, &v77, &v78); - VAL v79 = mtw_mirth_name_Namespace_NAMESPACEz_WORD(v68); - incref(v72); - VAL v80; - uint64_t v81; - mw_mirth_specializzer_SPKey_ZToName(v78, v72, &v80, &v81); - VAL v82 = mw_mirth_name_QNAME0(v79, v81); - VAL v83 = mtw_mirth_mirth_PropLabel_WordQName(v77); - VAL v84; - VAL v85; - mw_mirth_mirth_PropLabel_prop(v82, v83, v80, &v84, &v85); - void* v86 = mfld_mirth_word_Word_ZTildeqname(v77); - mut_set(v84, v86); - incref(v72); - VAL v87 = mtw_std_map_KVPair_2_KVPair(v72, MKU64(v77)); - VAL v88 = mw_mirth_word_Word_spZ_synthed(v68); - VAL v89 = mw_std_map_Map_2_insert(v87, v88); - void* v90 = mfld_mirth_word_Word_ZTildespZ_synthed(v68); - mut_set(v89, v90); - incref(v72); - VAL v91 = mtw_mirth_mirth_PropLabel_WordType(v77); - VAL v92 = MKNIL; - VAL v93 = mkcons(v92, v72); - VAL v94 = mkcons(v93, MKU64(v68)); - FNPTR v95 = &mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotspecializzerZDotspecializzeZ_wordZBangZDot63ZRParen_1; - VAL v96; - VAL v97; - mw_mirth_mirth_PropLabel_prop_1(v94, v91, v85, MKFNPTR(v95), &v96, &v97); - void* v98 = mfld_mirth_word_Word_ZTildectxZ_type(v77); - mut_set(v96, v98); - int64_t v99 = 1LL /* True */; - void* v100 = mfld_mirth_word_Word_ZTildepreferZ_inlineZAsk(v77); - mut_set(MKI64(v99), v100); - incref(v72); - VAL v101 = mtw_mirth_mirth_PropLabel_WordArrow(v77); - VAL v102 = MKNIL; - VAL v103 = mkcons(v102, v72); - VAL v104 = mkcons(v103, MKU64(v68)); - VAL v105 = mkcons(v104, MKU64(v77)); - FNPTR v106 = &mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotspecializzerZDotspecializzeZ_wordZBangZDot81ZRParen_1; - VAL v107; - VAL v108; - mw_mirth_mirth_PropLabel_prop_1(v105, v101, v97, MKFNPTR(v106), &v107, &v108); - void* v109 = mfld_mirth_word_Word_ZTildearrow(v77); - mut_set(v107, v109); - x61 = v77; - x60 = v68; - x59 = v72; - x58 = v108; + case 3LL: { // OpExternal + uint64_t v24 = mtp_mirth_arrow_Op_OpExternal(x3); + VAL x25; + int64_t x26; + switch (get_data_tag(x2)) { + case 3LL: { // OpExternal + uint64_t v27 = mtp_mirth_arrow_Op_OpExternal(x2); + int64_t v28 = mw_mirth_external_External_ZEqualZEqual(v24, v27); + x26 = v28; + x25 = x1; + } break; + default: { + decref(x2); + int64_t v29 = 0LL /* False */; + x26 = v29; + x25 = x1; + } break; + } + x7 = x26; + x6 = x25; } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - decref(x59); - *x5 = x61; - *x4 = x58; -} -static void mw_mirth_specializzer_specializzeZ_ctxZ_type (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6, VAL *x7) { - decref(x3); - VAL v8 = MKI64(0LL /* SUBST_NIL */); - VAL v9; - VAL v10; - mw_mirth_type_ArrowType_freshen(v8, x4, &v9, &v10); - decref(v9); - incref(x2); - VAL v11 = mw_std_list_ListZPlus_1_first(x2); - uint64_t v12 = mw_mirth_arrow_Arg_token(VU64(v11)); - VAL v13 = MKI64(0LL /* SUBST_NIL */); - decref(v13); - VAL v14; - VAL v15; - mw_mirth_type_ArrowType_unpack(v10, &v14, &v15); - VAL v16; - VAL v17; - mw_std_list_ListZPlus_1_uncons(x2, &v16, &v17); - VAL v18 = mw_std_list_List_1_reverse(v17); - VAL v19; - VAL v20; - mw_std_list_List_1_uncons(v18, &v19, &v20); - VAL x21; - uint64_t x22; - VAL x23; - VAL x24; - VAL x25; - int64_t x26; - switch (get_data_tag(v19)) { - case 1LL: { // Some - VAL v27 = mtp_std_maybe_Maybe_1_Some(v19); - VAL v28 = mw_mirth_type_StackType_forceZ_consZAskZBang(v14); - VAL x29; - uint64_t x30; + case 4LL: { // OpBuffer + uint64_t v30 = mtp_mirth_arrow_Op_OpBuffer(x3); VAL x31; - VAL x32; - switch (get_data_tag(v28)) { - case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v28); - x32 = v33; - x31 = v15; - x30 = v12; - x29 = x1; + int64_t x32; + switch (get_data_tag(x2)) { + case 4LL: { // OpBuffer + uint64_t v33 = mtp_mirth_arrow_Op_OpBuffer(x2); + int64_t v34 = mw_mirth_buffer_Buffer_ZEqualZEqual(v30, v33); + x32 = v34; + x31 = x1; } break; - case 0LL: { // None - STR* v34; - STRLIT(v34, "unexpected domain in specialize-ctx-type", 40); - push_value(v15); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v34), x1); - VAL v35 = pop_value(); + default: { + decref(x2); + int64_t v35 = 0LL /* False */; x32 = v35; - VAL v36 = pop_value(); - x31 = v36; - x30 = v12; - VAL r37 = pop_resource(); - x29 = r37; + x31 = x1; + } break; + } + x7 = x32; + x6 = x31; + } break; + case 5LL: { // OpVariable + uint64_t v36 = mtp_mirth_arrow_Op_OpVariable(x3); + VAL x37; + int64_t x38; + switch (get_data_tag(x2)) { + case 5LL: { // OpVariable + uint64_t v39 = mtp_mirth_arrow_Op_OpVariable(x2); + int64_t v40 = mw_mirth_variable_Variable_ZEqualZEqual(v36, v39); + x38 = v40; + x37 = x1; } break; default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + decref(x2); + int64_t v41 = 0LL /* False */; + x38 = v41; + x37 = x1; + } break; } - VAL v38; - VAL v39; - value_uncons(x32, &v38, &v39); - VAL v40; - VAL v41; - value_uncons(v38, &v40, &v41); - decref(v40); - VAL v42 = mw_mirth_arrow_Block_type(VU64(v27)); - VAL v43 = mtw_mirth_type_Type_TMorphism(v42); - VAL v44; - uint64_t v45; - VAL v46; - mw_mirth_type_Type_unifyZBang(x29, x30, v39, v43, &v44, &v45, &v46); - decref(v46); - int64_t v47 = 1LL /* True */; - x26 = v47; - x25 = v20; - x24 = v41; - x23 = x31; - x22 = v45; - x21 = v44; + x7 = x38; + x6 = x37; + } break; + case 6LL: { // OpField + uint64_t v42 = mtp_mirth_arrow_Op_OpField(x3); + VAL x43; + int64_t x44; + switch (get_data_tag(x2)) { + case 6LL: { // OpField + uint64_t v45 = mtp_mirth_arrow_Op_OpField(x2); + int64_t v46 = mw_mirth_table_Field_ZEqualZEqual(v42, v45); + x44 = v46; + x43 = x1; + } break; + default: { + decref(x2); + int64_t v47 = 0LL /* False */; + x44 = v47; + x43 = x1; + } break; + } + x7 = x44; + x6 = x43; + } break; + case 7LL: { // OpInt + int64_t v48 = mtp_mirth_arrow_Op_OpInt(x3); + VAL x49; + int64_t x50; + switch (get_data_tag(x2)) { + case 7LL: { // OpInt + int64_t v51 = mtp_mirth_arrow_Op_OpInt(x2); + bool v52 = (v48 == v51); + x50 = ((int64_t)v52); + x49 = x1; + } break; + default: { + decref(x2); + int64_t v53 = 0LL /* False */; + x50 = v53; + x49 = x1; + } break; + } + x7 = x50; + x6 = x49; + } break; + case 8LL: { // OpF64 + double v54 = mtp_mirth_arrow_Op_OpF64(x3); + VAL x55; + int64_t x56; + switch (get_data_tag(x2)) { + case 8LL: { // OpF64 + double v57 = mtp_mirth_arrow_Op_OpF64(x2); + bool v58 = (v54 == v57); + x56 = ((int64_t)v58); + x55 = x1; + } break; + default: { + decref(x2); + int64_t v59 = 0LL /* False */; + x56 = v59; + x55 = x1; + } break; + } + x7 = x56; + x6 = x55; + } break; + case 9LL: { // OpStr + VAL v60 = mtp_mirth_arrow_Op_OpStr(x3); + VAL x61; + int64_t x62; + switch (get_data_tag(x2)) { + case 9LL: { // OpStr + VAL v63 = mtp_mirth_arrow_Op_OpStr(x2); + bool v64 = (str_cmp(VSTR(v60), VSTR(v63)) == 0); + x62 = ((int64_t)v64); + x61 = x1; + } break; + default: { + decref(x2); + decref(v60); + int64_t v65 = 0LL /* False */; + x62 = v65; + x61 = x1; + } break; + } + x7 = x62; + x6 = x61; + } break; + case 10LL: { // OpTag + uint64_t v66 = mtp_mirth_arrow_Op_OpTag(x3); + VAL x67; + int64_t x68; + switch (get_data_tag(x2)) { + case 10LL: { // OpTag + uint64_t v69 = mtp_mirth_arrow_Op_OpTag(x2); + int64_t v70 = mw_mirth_data_Tag_ZEqualZEqual(v66, v69); + x68 = v70; + x67 = x1; + } break; + default: { + decref(x2); + int64_t v71 = 0LL /* False */; + x68 = v71; + x67 = x1; + } break; + } + x7 = x68; + x6 = x67; + } break; + case 11LL: { // OpMatch + VAL v72 = mtp_mirth_arrow_Op_OpMatch(x3); + decref(v72); + decref(x2); + int64_t v73 = 0LL /* False */; + x7 = v73; + x6 = x1; + } break; + case 12LL: { // OpLambda + VAL v74 = mtp_mirth_arrow_Op_OpLambda(x3); + decref(v74); + decref(x2); + int64_t v75 = 0LL /* False */; + x7 = v75; + x6 = x1; + } break; + case 13LL: { // OpVar + uint64_t v76 = mtp_mirth_arrow_Op_OpVar(x3); + decref(x2); + int64_t v77 = 0LL /* False */; + x7 = v77; + x6 = x1; + } break; + case 14LL: { // OpBlockPush + uint64_t v78 = mtp_mirth_arrow_Op_OpBlockPush(x3); + VAL x79; + int64_t x80; + switch (get_data_tag(x2)) { + case 14LL: { // OpBlockPush + uint64_t v81 = mtp_mirth_arrow_Op_OpBlockPush(x2); + VAL v82; + int64_t v83; + mw_mirth_arrow_Block_similar(x1, v78, v81, &v82, &v83); + x80 = v83; + x79 = v82; + } break; + default: { + decref(x2); + int64_t v84 = 0LL /* False */; + x80 = v84; + x79 = x1; + } break; + } + x7 = x80; + x6 = x79; + } break; + case 15LL: { // OpBlockRun + uint64_t v85 = mtp_mirth_arrow_Op_OpBlockRun(x3); + VAL x86; + int64_t x87; + switch (get_data_tag(x2)) { + case 15LL: { // OpBlockRun + uint64_t v88 = mtp_mirth_arrow_Op_OpBlockRun(x2); + VAL v89; + int64_t v90; + mw_mirth_arrow_Block_similar(x1, v85, v88, &v89, &v90); + x87 = v90; + x86 = v89; + } break; + default: { + decref(x2); + int64_t v91 = 0LL /* False */; + x87 = v91; + x86 = x1; + } break; + } + x7 = x87; + x6 = x86; + } break; + case 16LL: { // OpCoerce + int64_t v92 = mtp_mirth_arrow_Op_OpCoerce(x3); + VAL x93; + int64_t x94; + switch (get_data_tag(x2)) { + case 16LL: { // OpCoerce + int64_t v95 = mtp_mirth_arrow_Op_OpCoerce(x2); + int64_t v96 = mw_mirth_arrow_Coerce_similar(v92, v95); + x94 = v96; + x93 = x1; + } break; + default: { + decref(x2); + int64_t v97 = 0LL /* False */; + x94 = v97; + x93 = x1; + } break; + } + x7 = x94; + x6 = x93; + } break; + case 17LL: { // OpLabelPush + uint64_t v98 = mtp_mirth_arrow_Op_OpLabelPush(x3); + VAL x99; + int64_t x100; + switch (get_data_tag(x2)) { + case 17LL: { // OpLabelPush + uint64_t v101 = mtp_mirth_arrow_Op_OpLabelPush(x2); + int64_t v102 = mw_mirth_label_Label_ZEqualZEqual(v98, v101); + x100 = v102; + x99 = x1; + } break; + default: { + decref(x2); + int64_t v103 = 0LL /* False */; + x100 = v103; + x99 = x1; + } break; + } + x7 = x100; + x6 = x99; + } break; + case 18LL: { // OpLabelPop + uint64_t v104 = mtp_mirth_arrow_Op_OpLabelPop(x3); + VAL x105; + int64_t x106; + switch (get_data_tag(x2)) { + case 18LL: { // OpLabelPop + uint64_t v107 = mtp_mirth_arrow_Op_OpLabelPop(x2); + int64_t v108 = mw_mirth_label_Label_ZEqualZEqual(v104, v107); + x106 = v108; + x105 = x1; + } break; + default: { + decref(x2); + int64_t v109 = 0LL /* False */; + x106 = v109; + x105 = x1; + } break; + } + x7 = x106; + x6 = x105; + } break; + case 19LL: { // OpLabelPushR + uint64_t v110 = mtp_mirth_arrow_Op_OpLabelPushR(x3); + VAL x111; + int64_t x112; + switch (get_data_tag(x2)) { + case 19LL: { // OpLabelPushR + uint64_t v113 = mtp_mirth_arrow_Op_OpLabelPushR(x2); + int64_t v114 = mw_mirth_label_Label_ZEqualZEqual(v110, v113); + x112 = v114; + x111 = x1; + } break; + default: { + decref(x2); + int64_t v115 = 0LL /* False */; + x112 = v115; + x111 = x1; + } break; + } + x7 = x112; + x6 = x111; + } break; + case 20LL: { // OpLabelPopR + uint64_t v116 = mtp_mirth_arrow_Op_OpLabelPopR(x3); + VAL x117; + int64_t x118; + switch (get_data_tag(x2)) { + case 20LL: { // OpLabelPopR + uint64_t v119 = mtp_mirth_arrow_Op_OpLabelPopR(x2); + int64_t v120 = mw_mirth_label_Label_ZEqualZEqual(v116, v119); + x118 = v120; + x117 = x1; + } break; + default: { + decref(x2); + int64_t v121 = 0LL /* False */; + x118 = v121; + x117 = x1; + } break; + } + x7 = x118; + x6 = x117; + } break; + case 21LL: { // OpDataGetTag + uint64_t v122 = mtp_mirth_arrow_Op_OpDataGetTag(x3); + VAL x123; + int64_t x124; + switch (get_data_tag(x2)) { + case 21LL: { // OpDataGetTag + uint64_t v125 = mtp_mirth_arrow_Op_OpDataGetTag(x2); + int64_t v126 = mw_mirth_data_Data_ZEqualZEqual(v122, v125); + x124 = v126; + x123 = x1; + } break; + default: { + decref(x2); + int64_t v127 = 0LL /* False */; + x124 = v127; + x123 = x1; + } break; + } + x7 = x124; + x6 = x123; + } break; + case 22LL: { // OpDataGetLabel + VAL v128 = mtp_mirth_arrow_Op_OpDataGetLabel(x3); + VAL x129; + int64_t x130; + switch (get_data_tag(x2)) { + case 22LL: { // OpDataGetLabel + VAL v131 = mtp_mirth_arrow_Op_OpDataGetLabel(x2); + int64_t v132 = mw_mirth_data_TagField_similar(v128, v131); + x130 = v132; + x129 = x1; + } break; + default: { + decref(x2); + decref(v128); + int64_t v133 = 0LL /* False */; + x130 = v133; + x129 = x1; + } break; + } + x7 = x130; + x6 = x129; + } break; + case 23LL: { // OpDataSetLabel + VAL v134 = mtp_mirth_arrow_Op_OpDataSetLabel(x3); + VAL x135; + int64_t x136; + switch (get_data_tag(x2)) { + case 23LL: { // OpDataSetLabel + VAL v137 = mtp_mirth_arrow_Op_OpDataSetLabel(x2); + int64_t v138 = mw_mirth_data_TagField_similar(v134, v137); + x136 = v138; + x135 = x1; + } break; + default: { + decref(x2); + decref(v134); + int64_t v139 = 0LL /* False */; + x136 = v139; + x135 = x1; + } break; + } + x7 = x136; + x6 = x135; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x5 = x7; + *x4 = x6; +} +static int64_t mw_mirth_arrow_Coerce_similar (int64_t x1, int64_t x2) { + int64_t v3 = 1LL /* True */; + return v3; +} +static int64_t mw_mirth_data_TagField_similar (VAL x1, VAL x2) { + uint64_t v3; + uint64_t v4; + VAL v5; + mtp_mirth_data_TagField_TagField(x2, &v3, &v4, &v5); + uint64_t v6; + uint64_t v7; + VAL v8; + mtp_mirth_data_TagField_TagField(x1, &v6, &v7, &v8); + int64_t v9 = mw_mirth_label_Label_ZEqualZEqual(v7, v4); + int64_t v10 = mw_mirth_data_Tag_ZEqualZEqual(v6, v3); + bool v11 = (((bool)v9) && ((bool)v10)); + decref(v5); + decref(v8); + return ((int64_t)v11); +} +static void mw_mirth_specializzer_SPKey_similar (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5) { + VAL v6; + VAL v7; + mtp_std_list_ListZPlus_1_ListZPlus(x2, &v6, &v7); + VAL v8 = mtw_std_list_List_1_Cons(v6, v7); + VAL v9; + VAL v10; + mtp_std_list_ListZPlus_1_ListZPlus(x3, &v9, &v10); + VAL v11 = mtw_std_list_List_1_Cons(v9, v10); + VAL v12; + int64_t v13; + mw_std_list_List_1_ZEqualZEqual_1_sp1(x1, v8, v11, &v12, &v13); + *x5 = v13; + *x4 = v12; +} +static VAL mw_mirth_word_Word_spZ_synthed (uint64_t x1) { + void* v2 = mfld_mirth_word_Word_ZTildespZ_synthed(x1); + VAL v3 = mw_std_prelude_ZAtZAsk(v2); + VAL x4; + switch (get_data_tag(v3)) { + case 1LL: { // Some + VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); + x4 = v5; } break; case 0LL: { // None - int64_t v48 = 0LL /* False */; - x26 = v48; - x25 = v20; - x24 = v14; - x23 = v15; - x22 = v12; - x21 = x1; + VAL v6 = mw_std_map_Map_2_empty(); + x4 = v6; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v49 = (x21); - uint64_t v50 = (x22); - VAL v51 = x23; - VAL v52 = x24; - VAL v53 = x25; - int64_t v54 = x26; - while (((bool)v54)) { - VAL v55 = (v49); - uint64_t v56 = (v50); - VAL v57 = v51; - VAL v58 = v52; - VAL v59 = v53; - VAL v60; - VAL v61; - mw_std_list_List_1_uncons(v59, &v60, &v61); - VAL x62; - uint64_t x63; - VAL x64; - VAL x65; - VAL x66; - int64_t x67; - switch (get_data_tag(v60)) { + return x4; +} +static void mw_mirth_specializzer_specializzeZ_wordZBang (VAL x1, VAL x2, uint64_t x3, VAL *x4, uint64_t *x5) { + incref(x2); + VAL v6 = mw_mirth_word_Word_spZ_synthed(x3); + VAL v7 = MKI64(0LL /* None */); + int64_t v8 = 1LL /* True */; + VAL v9 = x1; + VAL v10 = x2; + VAL v11 = v7; + VAL v12 = v6; + int64_t v13 = v8; + int64_t v14 = v8; + while (((bool)v14)) { + VAL v15 = v9; + VAL v16 = v10; + VAL v17 = v11; + VAL v18 = v12; + int64_t v19 = v13; + VAL v20; + VAL v21; + mw_std_list_List_1_uncons(v18, &v20, &v21); + VAL x22; + VAL x23; + VAL x24; + VAL x25; + int64_t x26; + switch (get_data_tag(v20)) { case 1LL: { // Some - VAL v68 = mtp_std_maybe_Maybe_1_Some(v60); - VAL v69 = mw_mirth_type_StackType_forceZ_consZAskZBang(v58); - VAL x70; - uint64_t x71; - VAL x72; - VAL x73; - switch (get_data_tag(v69)) { - case 1LL: { // Some - VAL v74 = mtp_std_maybe_Maybe_1_Some(v69); - x73 = v74; - x72 = v57; - x71 = v56; - x70 = v55; - } break; + VAL v27 = mtp_std_maybe_Maybe_1_Some(v20); + incref(v27); + incref(v16); + VAL v28 = VVAL(VTUP(v27)->cells[1]); + incref(v28); + decref(v27); + VAL v29; + int64_t v30; + mw_mirth_specializzer_SPKey_similar(v15, v16, v28, &v29, &v30); + VAL x31; + VAL x32; + VAL x33; + if (((bool)v30)) { + VAL v34 = mtw_std_maybe_Maybe_1_Some(v27); + x33 = v34; + x32 = v16; + x31 = v29; + } else { + decref(v27); + VAL v35 = MKI64(0LL /* None */); + x33 = v35; + x32 = v16; + x31 = v29; + } + VAL x36; + VAL x37; + VAL x38; + VAL x39; + switch (get_data_tag(x33)) { case 0LL: { // None - STR* v75; - STRLIT(v75, "unexpected domain in specialize-ctx-type", 40); - push_value(v57); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v75), v55); - VAL v76 = pop_value(); - x73 = v76; - VAL v77 = pop_value(); - x72 = v77; - x71 = v56; - VAL r78 = pop_resource(); - x70 = r78; + x39 = v21; + x38 = v17; + x37 = x32; + x36 = x31; } break; default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + decref(v21); + decref(v17); + VAL v40 = MKI64(0LL /* Nil */); + x39 = v40; + x38 = x33; + x37 = x32; + x36 = x31; + } break; } - VAL v79; - VAL v80; - value_uncons(x73, &v79, &v80); - VAL v81; - VAL v82; - value_uncons(v79, &v81, &v82); - decref(v81); - VAL v83 = mw_mirth_arrow_Block_type(VU64(v68)); - VAL v84 = mtw_mirth_type_Type_TMorphism(v83); - VAL v85; - uint64_t v86; - VAL v87; - mw_mirth_type_Type_unifyZBang(x70, x71, v80, v84, &v85, &v86, &v87); - decref(v87); - int64_t v88 = 1LL /* True */; - x67 = v88; - x66 = v61; - x65 = v82; - x64 = x72; - x63 = v86; - x62 = v85; + int64_t v41 = 1LL /* True */; + x26 = v41; + x25 = x39; + x24 = x38; + x23 = x37; + x22 = x36; } break; case 0LL: { // None - int64_t v89 = 0LL /* False */; - x67 = v89; - x66 = v61; - x65 = v58; - x64 = v57; - x63 = v56; - x62 = v55; + int64_t v42 = 0LL /* False */; + x26 = v42; + x25 = v21; + x24 = v17; + x23 = v16; + x22 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v54 = x67; - v53 = x66; - v52 = x65; - v51 = x64; - v50 = x63; - v49 = x62; + v14 = x26; + v13 = x26; + v12 = x25; + v11 = x24; + v10 = x23; + v9 = x22; } - decref(v53); - VAL v90 = mw_mirth_type_StackType_forceZ_consZAskZBang(v52); - VAL x91; - uint64_t x92; - VAL x93; - VAL x94; - switch (get_data_tag(v90)) { + decref(v12); + decref(v10); + VAL v43 = mw_std_maybe_Maybe_1_map_1_sp10(v11); + VAL x44; + VAL x45; + uint64_t x46; + uint64_t x47; + switch (get_data_tag(v43)) { case 1LL: { // Some - VAL v95 = mtp_std_maybe_Maybe_1_Some(v90); - x94 = v95; - x93 = v51; - x92 = v50; - x91 = v49; + VAL v48 = mtp_std_maybe_Maybe_1_Some(v43); + int64_t v49 = mw_mirth_word_Word_preferZ_inlineZAsk(x3); + incref(v48); + void* v50 = mfld_mirth_word_Word_ZTildepreferZ_inlineZAsk(VU64(v48)); + mut_set(MKI64(v49), v50); + x47 = VU64(v48); + x46 = x3; + x45 = x2; + x44 = v9; } break; case 0LL: { // None - STR* v96; - STRLIT(v96, "unexpected domain in specialize-ctx-type", 40); - push_value(v51); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v96), v49); - VAL v97 = pop_value(); - x94 = v97; - VAL v98 = pop_value(); - x93 = v98; - x92 = v50; - VAL r99 = pop_resource(); - x91 = r99; + uint64_t v51 = mw_mirth_word_Word_head(x3); + VAL v52 = MKI64(0LL /* None */); + uint64_t v53 = mw_mirth_word_Word_body(x3); + STR* v54; + STRLIT(v54, "", 0); + STR* v55; + STRLIT(v55, "sp", 2); + VAL v56 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v55), MKSTR(v54)); + VAL v57 = mw_mirth_word_Word_spZ_synthed(x3); + int64_t v58 = mw_std_map_Map_2_len(v57); + int64_t v59 = 1LL; + int64_t v60 = i64_add(v58, v59); + STR* v61 = i64_show(v60); + VAL v62 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v61), v56); + uint64_t v63 = mw_std_prim_Str_ZToName(v62); + int64_t v64 = 0LL; + uint64_t v65; + VAL v66; + mw_mirth_word_Word_newZBang(v51, v52, v53, v63, v64, v9, &v65, &v66); + VAL v67 = mtw_mirth_name_Namespace_NAMESPACEz_WORD(x3); + uint64_t v68 = mw_mirth_word_Word_name(v65); + VAL v69 = mw_mirth_name_QNAME0(v67, v68); + VAL v70 = mtw_mirth_mirth_PropLabel_WordQName(v65); + VAL v71; + VAL v72; + mw_mirth_mirth_PropLabel_prop(v69, v70, v66, &v71, &v72); + void* v73 = mfld_mirth_word_Word_ZTildeqname(v65); + mut_set(v71, v73); + incref(x2); + VAL v74 = mtw_std_map_KVPair_2_KVPair(x2, MKU64(v65)); + VAL v75 = mw_mirth_word_Word_spZ_synthed(x3); + VAL v76 = mw_std_map_Map_2_insert(v74, v75); + void* v77 = mfld_mirth_word_Word_ZTildespZ_synthed(x3); + mut_set(v76, v77); + VAL v78 = mtw_mirth_mirth_PropLabel_WordType(v65); + FNPTR v79 = &mb_mirth_mirth_PropLabel_prop_1_sp1_0; + VAL v80 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(v65), MKFNPTR(v79)); + VAL v81 = mtw_mirth_mirth_Prop_1_Prop(v78, v80); + void* v82 = mfld_mirth_word_Word_ZTildectxZ_type(v65); + mut_set(v81, v82); + int64_t v83 = 1LL /* True */; + void* v84 = mfld_mirth_word_Word_ZTildepreferZ_inlineZAsk(v65); + mut_set(MKI64(v83), v84); + incref(x2); + VAL v85 = mtw_mirth_mirth_PropLabel_WordArrow(v65); + VAL v86 = MKNIL; + VAL v87 = mkcons(v86, x2); + VAL v88 = mkcons(v87, MKU64(x3)); + VAL v89 = mkcons(v88, MKU64(v65)); + FNPTR v90 = &mb_mirth_mirth_PropLabel_prop_1_sp2_2; + VAL v91 = mtw_mirth_mirth_PropState_1_PSDelay(v89, MKFNPTR(v90)); + VAL v92 = mtw_mirth_mirth_Prop_1_Prop(v85, v91); + void* v93 = mfld_mirth_word_Word_ZTildearrow(v65); + mut_set(v92, v93); + VAL v94; + VAL v95; + mw_mirth_word_Word_type(v65, v72, &v94, &v95); + decref(v94); + x47 = v65; + x46 = x3; + x45 = x2; + x44 = v95; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v100; - VAL v101; - value_uncons(x94, &v100, &v101); - VAL v102; - VAL v103; - value_uncons(v100, &v102, &v103); - decref(v102); - VAL v104 = mw_mirth_arrow_Block_type(VU64(v16)); - VAL v105 = mtw_mirth_type_Type_TMorphism(v104); - VAL v106; - uint64_t v107; - VAL v108; - mw_mirth_type_Type_unifyZBang(x91, x92, v101, v105, &v106, &v107, &v108); - decref(v108); - mw_mirth_type_ZPlusGamma_rdrop(v107); - VAL v109 = mw_mirth_type_TZ_ZTo(v103, x93); - VAL v110 = mw_mirth_var_Ctx0(); - VAL v111; - VAL v112; - VAL v113; - mw_mirth_type_ArrowType_rigidifyZ_sigZBang(v106, v110, v109, &v111, &v112, &v113); - *x7 = v113; - *x6 = v112; - *x5 = v111; + decref(x45); + *x5 = x47; + *x4 = x44; } static void mw_mirth_specializzer_synthZ_specializzedZ_wordZBang (VAL x1, VAL x2, VAL x3, uint64_t x4, VAL *x5, VAL *x6) { VAL v7; @@ -64786,461 +46954,216 @@ static void mw_mirth_specializzer_synthZ_specializzedZ_wordZBang (VAL x1, VAL x2 incref(v9); decref(v7); VAL v10 = mw_std_list_List_1_ZDivL1(v9); - uint64_t x11; + VAL x11; VAL x12; VAL x13; - VAL x14; - VAL x15; switch (get_data_tag(v10)) { case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(v10); - x15 = v16; - x14 = x2; - x13 = v8; - x12 = x3; - x11 = x4; + VAL v14 = mtp_std_maybe_Maybe_1_Some(v10); + x13 = v14; + x12 = x2; + x11 = v8; } break; case 0LL: { // None - STR* v17; - STRLIT(v17, "unexpected shape for synth-specialized-word!", 44); - lpush(&lbl_spword, MKU64(x4)); - lpush(&lbl_spkey, x3); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v17), v8); - VAL v18 = pop_value(); - x15 = v18; - x14 = x2; - VAL r19 = pop_resource(); - x13 = r19; - VAL v20 = lpop(&lbl_spkey); - x12 = v20; - uint64_t v21 = VU64(lpop(&lbl_spword)); - x11 = v21; + STR* v15; + STRLIT(v15, "unexpected shape for synth-specialized-word!", 44); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v15), v8); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v22 = VVAL(VTUP(x15)->cells[4]); - incref(v22); - decref(x15); - VAL x23; - VAL x24; - switch (get_data_tag(v22)) { + VAL v18 = VVAL(VTUP(x13)->cells[4]); + incref(v18); + decref(x13); + VAL x19; + VAL x20; + switch (get_data_tag(v18)) { case 12LL: { // OpLambda - VAL v25 = mtp_mirth_arrow_Op_OpLambda(v22); + VAL v21 = mtp_mirth_arrow_Op_OpLambda(v18); + incref(v21); + VAL v22 = VVAL(VTUP(v21)->cells[4]); + incref(v22); + decref(v21); + incref(x3); + VAL v23; + VAL v24; + mtp_std_list_ListZPlus_1_ListZPlus(x3, &v23, &v24); + VAL v25 = mtw_std_list_List_1_Cons(v23, v24); + incref(v22); incref(v25); - VAL v26 = VVAL(VTUP(v25)->cells[4]); - incref(v26); - decref(v25); - incref(x12); - VAL v27; - VAL v28; - mtp_std_list_ListZPlus_1_ListZPlus(x12, &v27, &v28); - VAL v29 = mtw_std_list_List_1_Cons(v27, v28); - incref(v26); - incref(v29); - int64_t v30 = mw_std_list_List_1_len(v26); - int64_t v31 = mw_std_list_List_1_len(v29); - bool v32 = (v30 == v31); - uint64_t x33; - VAL x34; - VAL x35; - VAL x36; - VAL x37; - VAL x38; - VAL x39; - if (v32) { - x39 = v29; - x38 = v26; - x37 = x12; - x36 = v25; - x35 = x14; - x34 = x13; - x33 = x11; + int64_t v26 = mw_std_list_List_1_len(v22); + int64_t v27 = mw_std_list_List_1_len(v25); + bool v28 = (v26 == v27); + VAL x29; + VAL x30; + if (v28) { + x30 = x12; + x29 = x11; } else { - STR* v40; - STRLIT(v40, "wrong number of lambda params in synth-specialized-word!", 56); - lpush(&lbl_spword, MKU64(x11)); - push_value(v25); - lpush(&lbl_spkey, x12); - push_value(v26); - push_value(v29); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v40), x13); - VAL v41 = pop_value(); - x39 = v41; - VAL v42 = pop_value(); - x38 = v42; - VAL v43 = lpop(&lbl_spkey); - x37 = v43; - VAL v44 = pop_value(); - x36 = v44; - x35 = x14; - VAL r45 = pop_resource(); - x34 = r45; - uint64_t v46 = VU64(lpop(&lbl_spword)); - x33 = v46; - } - VAL v47 = MKI64(0LL /* Nil */); - VAL v48 = mw_std_list_List_1_reverse(v47); - VAL v49; - VAL v50; - mw_std_list_List_1_uncons(x39, &v49, &v50); - VAL v51; - VAL v52; - mw_std_list_List_1_uncons(x38, &v51, &v52); - uint64_t x53; - VAL x54; - VAL x55; - VAL x56; - VAL x57; - VAL x58; - switch (get_data_tag(v49)) { - case 0LL: { // None - decref(v51); - VAL v59 = MKI64(0LL /* None */); - x58 = v59; - x57 = x37; - x56 = x36; - x55 = x35; - x54 = x34; - x53 = x33; - } break; - case 1LL: { // Some - VAL v60 = mtp_std_maybe_Maybe_1_Some(v49); - uint64_t x61; - VAL x62; - VAL x63; - VAL x64; - VAL x65; - VAL x66; - switch (get_data_tag(v51)) { - case 0LL: { // None - decref(v60); - VAL v67 = MKI64(0LL /* None */); - x66 = v67; - x65 = x37; - x64 = x36; - x63 = x35; - x62 = x34; - x61 = x33; - } break; - case 1LL: { // Some - VAL v68 = mtp_std_maybe_Maybe_1_Some(v51); - VAL v69 = mtw_std_map_KVPair_2_KVPair(v68, v60); - VAL v70 = mtw_std_maybe_Maybe_1_Some(v69); - x66 = v70; - x65 = x37; - x64 = x36; - x63 = x35; - x62 = x34; - x61 = x33; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x58 = x66; - x57 = x65; - x56 = x64; - x55 = x63; - x54 = x62; - x53 = x61; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t x71; - VAL x72; - VAL x73; - VAL x74; - VAL x75; - VAL x76; - VAL x77; - VAL x78; - int64_t x79; - switch (get_data_tag(x58)) { - case 1LL: { // Some - VAL v80 = mtp_std_maybe_Maybe_1_Some(x58); - VAL v81 = mtw_std_list_List_1_Cons(v80, v48); - int64_t v82 = 1LL /* True */; - x79 = v82; - x78 = v81; - x77 = v50; - x76 = v52; - x75 = x57; - x74 = x56; - x73 = x55; - x72 = x54; - x71 = x53; - } break; - case 0LL: { // None - int64_t v83 = 0LL /* False */; - x79 = v83; - x78 = v48; - x77 = v50; - x76 = v52; - x75 = x57; - x74 = x56; - x73 = x55; - x72 = x54; - x71 = x53; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + STR* v31; + STRLIT(v31, "wrong number of lambda params in synth-specialized-word!", 56); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v31), x11); } - uint64_t v84 = x71; - VAL v85 = (x72); - VAL v86 = (x73); - VAL v87 = x74; - VAL v88 = x75; - VAL v89 = x76; - VAL v90 = x77; - VAL v91 = (x78); - int64_t v92 = x79; - while (((bool)v92)) { - uint64_t v93 = v84; - VAL v94 = (v85); - VAL v95 = (v86); - VAL v96 = v87; - VAL v97 = v88; - VAL v98 = v89; - VAL v99 = v90; - VAL v100 = (v91); - VAL v101; - VAL v102; - mw_std_list_List_1_uncons(v99, &v101, &v102); - VAL v103; - VAL v104; - mw_std_list_List_1_uncons(v98, &v103, &v104); - uint64_t x105; - VAL x106; - VAL x107; - VAL x108; - VAL x109; - VAL x110; - switch (get_data_tag(v101)) { + VAL v33 = MKI64(0LL /* Nil */); + VAL v34 = mw_std_list_List_1_reverse(v33); + int64_t v35 = 1LL /* True */; + VAL v36 = v22; + VAL v37 = v25; + VAL v38 = v34; + int64_t v39 = v35; + int64_t v40 = v35; + while (((bool)v40)) { + VAL v41 = v36; + VAL v42 = v37; + VAL v43 = v38; + int64_t v44 = v39; + VAL v45; + VAL v46; + mw_std_list_List_1_uncons(v42, &v45, &v46); + VAL v47; + VAL v48; + mw_std_list_List_1_uncons(v41, &v47, &v48); + VAL x49; + switch (get_data_tag(v45)) { case 0LL: { // None - decref(v103); - VAL v111 = MKI64(0LL /* None */); - x110 = v111; - x109 = v97; - x108 = v96; - x107 = v95; - x106 = v94; - x105 = v93; + decref(v47); + VAL v50 = MKI64(0LL /* None */); + x49 = v50; } break; case 1LL: { // Some - VAL v112 = mtp_std_maybe_Maybe_1_Some(v101); - uint64_t x113; - VAL x114; - VAL x115; - VAL x116; - VAL x117; - VAL x118; - switch (get_data_tag(v103)) { + VAL v51 = mtp_std_maybe_Maybe_1_Some(v45); + VAL x52; + switch (get_data_tag(v47)) { case 0LL: { // None - decref(v112); - VAL v119 = MKI64(0LL /* None */); - x118 = v119; - x117 = v97; - x116 = v96; - x115 = v95; - x114 = v94; - x113 = v93; + decref(v51); + VAL v53 = MKI64(0LL /* None */); + x52 = v53; } break; case 1LL: { // Some - VAL v120 = mtp_std_maybe_Maybe_1_Some(v103); - VAL v121 = mtw_std_map_KVPair_2_KVPair(v120, v112); - VAL v122 = mtw_std_maybe_Maybe_1_Some(v121); - x118 = v122; - x117 = v97; - x116 = v96; - x115 = v95; - x114 = v94; - x113 = v93; + VAL v54 = mtp_std_maybe_Maybe_1_Some(v47); + VAL v55 = mtw_std_map_KVPair_2_KVPair(v54, v51); + VAL v56 = mtw_std_maybe_Maybe_1_Some(v55); + x52 = v56; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x110 = x118; - x109 = x117; - x108 = x116; - x107 = x115; - x106 = x114; - x105 = x113; + x49 = x52; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t x123; - VAL x124; - VAL x125; - VAL x126; - VAL x127; - VAL x128; - VAL x129; - VAL x130; - int64_t x131; - switch (get_data_tag(x110)) { + VAL x57; + int64_t x58; + switch (get_data_tag(x49)) { case 1LL: { // Some - VAL v132 = mtp_std_maybe_Maybe_1_Some(x110); - VAL v133 = mtw_std_list_List_1_Cons(v132, v100); - int64_t v134 = 1LL /* True */; - x131 = v134; - x130 = v133; - x129 = v102; - x128 = v104; - x127 = x109; - x126 = x108; - x125 = x107; - x124 = x106; - x123 = x105; + VAL v59 = mtp_std_maybe_Maybe_1_Some(x49); + VAL v60 = mtw_std_list_List_1_Cons(v59, v43); + int64_t v61 = 1LL /* True */; + x58 = v61; + x57 = v60; } break; case 0LL: { // None - int64_t v135 = 0LL /* False */; - x131 = v135; - x130 = v100; - x129 = v102; - x128 = v104; - x127 = x109; - x126 = x108; - x125 = x107; - x124 = x106; - x123 = x105; + int64_t v62 = 0LL /* False */; + x58 = v62; + x57 = v43; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v92 = x131; - v91 = x130; - v90 = x129; - v89 = x128; - v88 = x127; - v87 = x126; - v86 = x125; - v85 = x124; - v84 = x123; + v40 = x58; + v39 = x58; + v38 = x57; + v37 = v46; + v36 = v48; } - VAL v136 = mw_std_list_List_1_reverse(v91); - decref(v90); - decref(v89); - VAL v137 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v88, v84, v136, v86)); - VAL v138 = VVAL(VTUP(v87)->cells[5]); - incref(v138); - decref(v87); - VAL v139; - VAL v140; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_arrowZBang(v85, v137, v138, &v139, &v140); - VAL v141; - uint64_t v142; - VAL v143; - VAL v144; - mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v140, &v141, &v142, &v143, &v144); - decref(v143); - decref(v141); - x24 = v144; - x23 = v139; + VAL v63 = mw_std_list_List_1_reverse(v38); + decref(v37); + decref(v36); + VAL v64 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(x3, x4, v63, x30); + VAL v65 = VVAL(VTUP(v21)->cells[5]); + incref(v65); + decref(v21); + VAL v66; + VAL v67; + mw_mirth_specializzer_ZPlusSPSynth_synthZ_arrowZBang(x29, v64, v65, &v66, &v67); + VAL v68; + uint64_t v69; + VAL v70; + VAL v71; + mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v67, &v68, &v69, &v70, &v71); + decref(v70); + decref(v68); + x20 = v71; + x19 = v66; } break; default: { - STR* v145; - STRLIT(v145, "unexpected shape", 16); - lpush(&lbl_spword, MKU64(x11)); - lpush(&lbl_spkey, x12); - push_value(v22); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v145), x13); - x24 = x14; - VAL r146 = pop_resource(); - x23 = r146; + STR* v72; + STRLIT(v72, "unexpected shape", 16); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v72), x11); } break; } - *x6 = x24; - *x5 = x23; + *x6 = x20; + *x5 = x19; } static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_arrowZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { VAL v6 = VVAL(VTUP(x3)->cells[7]); incref(v6); decref(x3); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v6, &v7, &v8); - VAL x9; - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v14; - VAL v15; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_atomZBang(x1, x2, v13, &v14, &v15); - int64_t v16 = 1LL /* True */; - x12 = v16; - x11 = v8; - x10 = v15; - x9 = v14; - } break; - case 0LL: { // None - int64_t v17 = 0LL /* False */; - x12 = v17; - x11 = v8; - x10 = x2; - x9 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + int64_t v7 = 1LL /* True */; + VAL v8 = x1; + VAL v9 = x2; + VAL v10 = v6; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + VAL v13 = v8; + VAL v14 = v9; + VAL v15 = v10; + int64_t v16 = v11; + VAL x17; + VAL x18; + VAL x19; + int64_t x20; + switch (get_data_tag(v15)) { + case 1LL: { // Cons + VAL v21; + VAL v22; + mtp_std_list_List_1_Cons(v15, &v21, &v22); + VAL v23; + VAL v24; + mw_mirth_specializzer_ZPlusSPSynth_synthZ_atomZBang(v13, v14, v21, &v23, &v24); + int64_t v25 = 1LL /* True */; + x20 = v25; + x19 = v22; + x18 = v24; + x17 = v23; + } break; + case 0LL: { // Nil + VAL v26 = MKI64(0LL /* Nil */); + int64_t v27 = 0LL /* False */; + x20 = v27; + x19 = v26; + x18 = v14; + x17 = v13; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } } + v12 = x20; + v11 = x20; + v10 = x19; + v9 = x18; + v8 = x17; } - VAL v18 = (x9); - VAL v19 = (x10); - VAL v20 = x11; - int64_t v21 = x12; - while (((bool)v21)) { - VAL v22 = (v18); - VAL v23 = (v19); - VAL v24 = v20; - VAL v25; - VAL v26; - mw_std_list_List_1_uncons(v24, &v25, &v26); - VAL x27; - VAL x28; - VAL x29; - int64_t x30; - switch (get_data_tag(v25)) { - case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v25); - VAL v32; - VAL v33; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_atomZBang(v22, v23, v31, &v32, &v33); - int64_t v34 = 1LL /* True */; - x30 = v34; - x29 = v26; - x28 = v33; - x27 = v32; - } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x30 = v35; - x29 = v26; - x28 = v23; - x27 = v22; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v21 = x30; - v20 = x29; - v19 = x28; - v18 = x27; - } - decref(v20); - *x5 = v19; - *x4 = v18; + decref(v10); + *x5 = v9; + *x4 = v8; } static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_atomZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { incref(x3); @@ -65251,103 +47174,68 @@ static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_atomZBang (VAL x1, VAL x2, VAL v9; VAL v10; mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(x2, &v7, &v8, &v9, &v10); - VAL v11 = (mw_mirth_elab_abZ_tokenZBang(v10, v6)); - VAL v12 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v7, v8, v9, v11)); + VAL v11 = mw_mirth_elab_abZ_tokenZBang(v10, v6); + VAL v12 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v7, v8, v9, v11); incref(x3); VAL v13 = VVAL(VTUP(x3)->cells[5]); incref(v13); decref(x3); - VAL v14; - VAL v15; - mw_std_list_List_1_uncons(v13, &v14, &v15); - VAL x16; - VAL x17; - VAL x18; - VAL x19; - int64_t x20; - switch (get_data_tag(v14)) { - case 1LL: { // Some - VAL v21 = mtp_std_maybe_Maybe_1_Some(v14); - VAL v22; - VAL v23; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_argZBang(x1, v12, VU64(v21), &v22, &v23); - int64_t v24 = 1LL /* True */; - x20 = v24; - x19 = v15; - x18 = x3; - x17 = v23; - x16 = v22; - } break; - case 0LL: { // None - int64_t v25 = 0LL /* False */; - x20 = v25; - x19 = v15; - x18 = x3; - x17 = v12; - x16 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v26 = (x16); - VAL v27 = (x17); - VAL v28 = x18; - VAL v29 = x19; - int64_t v30 = x20; - while (((bool)v30)) { - VAL v31 = (v26); - VAL v32 = (v27); - VAL v33 = v28; - VAL v34 = v29; - VAL v35; - VAL v36; - mw_std_list_List_1_uncons(v34, &v35, &v36); - VAL x37; - VAL x38; - VAL x39; - VAL x40; - int64_t x41; - switch (get_data_tag(v35)) { - case 1LL: { // Some - VAL v42 = mtp_std_maybe_Maybe_1_Some(v35); - VAL v43; - VAL v44; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_argZBang(v31, v32, VU64(v42), &v43, &v44); - int64_t v45 = 1LL /* True */; - x41 = v45; - x40 = v36; - x39 = v33; - x38 = v44; - x37 = v43; + int64_t v14 = 1LL /* True */; + VAL v15 = x1; + VAL v16 = v12; + VAL v17 = v13; + int64_t v18 = v14; + int64_t v19 = v14; + while (((bool)v19)) { + VAL v20 = v15; + VAL v21 = v16; + VAL v22 = v17; + int64_t v23 = v18; + VAL x24; + VAL x25; + VAL x26; + int64_t x27; + switch (get_data_tag(v22)) { + case 1LL: { // Cons + VAL v28; + VAL v29; + mtp_std_list_List_1_Cons(v22, &v28, &v29); + VAL v30; + VAL v31; + mw_mirth_specializzer_ZPlusSPSynth_synthZ_argZBang(v20, v21, VU64(v28), &v30, &v31); + int64_t v32 = 1LL /* True */; + x27 = v32; + x26 = v29; + x25 = v31; + x24 = v30; } break; - case 0LL: { // None - int64_t v46 = 0LL /* False */; - x41 = v46; - x40 = v36; - x39 = v33; - x38 = v32; - x37 = v31; + case 0LL: { // Nil + VAL v33 = MKI64(0LL /* Nil */); + int64_t v34 = 0LL /* False */; + x27 = v34; + x26 = v33; + x25 = v21; + x24 = v20; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v30 = x41; - v29 = x40; - v28 = x39; - v27 = x38; - v26 = x37; + v19 = x27; + v18 = x27; + v17 = x26; + v16 = x25; + v15 = x24; } - decref(v29); - VAL v47 = VVAL(VTUP(v28)->cells[4]); - incref(v47); - decref(v28); - VAL v48; - VAL v49; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_opZBang(v26, v27, v47, &v48, &v49); - *x5 = v49; - *x4 = v48; + decref(v17); + VAL v35 = VVAL(VTUP(x3)->cells[4]); + incref(v35); + decref(x3); + VAL v36; + VAL v37; + mw_mirth_specializzer_ZPlusSPSynth_synthZ_opZBang(v15, v16, v35, &v36, &v37); + *x5 = v37; + *x4 = v36; } static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_argZBang (VAL x1, VAL x2, uint64_t x3, VAL *x4, VAL *x5) { VAL v6; @@ -65409,7 +47297,7 @@ static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_opZBang (VAL x1, VAL x2, V VAL v27; VAL v28; mw_mirth_elab_abZ_opZBang(x3, x1, v26, &v27, &v28); - VAL v29 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v23, v24, v25, v28)); + VAL v29 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v23, v24, v25, v28); x7 = v29; x6 = v27; } break; @@ -65419,267 +47307,43 @@ static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_opZBang (VAL x1, VAL x2, V } static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_blockZBang (VAL x1, VAL x2, uint64_t x3, VAL *x4, VAL *x5) { VAL v6; - VAL v7; - mw_mirth_arrow_Block_toZ_runZ_var(x1, x3, &v6, &v7); - uint64_t x8; - VAL x9; - VAL x10; - VAL x11; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v13 = VVAL(VTUP(x2)->cells[4]); - incref(v13); - VAL v14 = MKI64(0LL /* None */); - VAL v15; - VAL v16; - mw_std_list_List_1_uncons(v13, &v15, &v16); - uint64_t x17; - VAL x18; - VAL x19; - int64_t x20; - switch (get_data_tag(v15)) { - case 1LL: { // Some - VAL v21 = mtp_std_maybe_Maybe_1_Some(v15); - incref(v21); - incref(v12); - VAL v22 = VVAL(VTUP(v21)->cells[1]); - incref(v22); - decref(v21); - int64_t v23 = mw_mirth_var_Var_ZEqualZEqual(VU64(v12), VU64(v22)); - uint64_t x24; - VAL x25; - if (((bool)v23)) { - VAL v26 = mtw_std_maybe_Maybe_1_Some(v21); - x25 = v26; - x24 = VU64(v12); - push_u64(x3); - push_resource(v6); - push_resource(x2); - } else { - decref(v21); - VAL v27 = MKI64(0LL /* None */); - x25 = v27; - x24 = VU64(v12); - push_u64(x3); - push_resource(v6); - push_resource(x2); - } - uint64_t x28; - VAL x29; - VAL x30; - switch (get_data_tag(x25)) { - case 0LL: { // None - x30 = v16; - x29 = v14; - x28 = x24; - } break; - default: { - decref(v16); - decref(v14); - VAL v31 = MKI64(0LL /* Nil */); - x30 = v31; - x29 = x25; - x28 = x24; - } break; - } - int64_t v32 = 1LL /* True */; - x20 = v32; - x19 = x30; - x18 = x29; - x17 = x28; - } break; - case 0LL: { // None - int64_t v33 = 0LL /* False */; - x20 = v33; - x19 = v16; - x18 = v14; - x17 = VU64(v12); - push_u64(x3); - push_resource(v6); - push_resource(x2); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v34 = x17; - VAL v35 = x18; - VAL v36 = x19; - int64_t v37 = x20; - while (((bool)v37)) { - uint64_t v38 = v34; - VAL v39 = v35; - VAL v40 = v36; - VAL v41; - VAL v42; - mw_std_list_List_1_uncons(v40, &v41, &v42); - uint64_t x43; - VAL x44; - VAL x45; - int64_t x46; - switch (get_data_tag(v41)) { - case 1LL: { // Some - VAL v47 = mtp_std_maybe_Maybe_1_Some(v41); - incref(v47); - VAL v48 = VVAL(VTUP(v47)->cells[1]); - incref(v48); - decref(v47); - int64_t v49 = mw_mirth_var_Var_ZEqualZEqual(v38, VU64(v48)); - uint64_t x50; - VAL x51; - if (((bool)v49)) { - VAL v52 = mtw_std_maybe_Maybe_1_Some(v47); - x51 = v52; - x50 = v38; - } else { - decref(v47); - VAL v53 = MKI64(0LL /* None */); - x51 = v53; - x50 = v38; - } - uint64_t x54; - VAL x55; - VAL x56; - switch (get_data_tag(x51)) { - case 0LL: { // None - x56 = v42; - x55 = v39; - x54 = x50; - } break; - default: { - decref(v42); - decref(v39); - VAL v57 = MKI64(0LL /* Nil */); - x56 = v57; - x55 = x51; - x54 = x50; - } break; - } - int64_t v58 = 1LL /* True */; - x46 = v58; - x45 = x56; - x44 = x55; - x43 = x54; - } break; - case 0LL: { // None - int64_t v59 = 0LL /* False */; - x46 = v59; - x45 = v42; - x44 = v39; - x43 = v38; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v37 = x46; - v36 = x45; - v35 = x44; - v34 = x43; - } - decref(v36); - VAL x60; - switch (get_data_tag(v35)) { - case 1LL: { // Some - VAL v61 = mtp_std_maybe_Maybe_1_Some(v35); - VAL v62 = VVAL(VTUP(v61)->cells[2]); - incref(v62); - decref(v61); - VAL v63 = mtw_std_maybe_Maybe_1_Some(v62); - x60 = v63; - } break; - case 0LL: { // None - VAL v64 = MKI64(0LL /* None */); - x60 = v64; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x11 = x60; - VAL r65 = pop_resource(); - x10 = r65; - VAL r66 = pop_resource(); - x9 = r66; - uint64_t v67 = pop_u64(); - x8 = v67; - } break; - case 0LL: { // None - VAL v68 = MKI64(0LL /* None */); - x11 = v68; - x10 = x2; - x9 = v6; - x8 = x3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL x69; - VAL x70; - switch (get_data_tag(x11)) { - case 0LL: { // None - VAL v71; - uint64_t v72; - VAL v73; - VAL v74; - mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(x10, &v71, &v72, &v73, &v74); - VAL v75; - uint64_t v76; - mw_mirth_elab_abZ_tokenZAt(v74, &v75, &v76); - VAL v77; - VAL v78; - mw_mirth_elab_abZ_ctxZAt(v75, &v77, &v78); - uint64_t v79 = mw_mirth_type_MetaVar_newZBang(); - VAL v80 = mtw_mirth_type_StackType_STMeta(v79); - VAL v81; - VAL v82; - mw_mirth_elab_abZ_homeZAt(v77, &v81, &v82); - incref(v80); - VAL v83 = MKI64(0LL /* Nil */); - VAL v84 = mtw_mirth_arrow_Arrow_Arrow(v82, v76, v76, v78, v80, v80, v83); - VAL v85 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v71, v72, v73, v84)); - VAL v86; - VAL v87; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_runZBang(x9, v85, x8, &v86, &v87); - VAL v88; - uint64_t v89; - VAL v90; - VAL v91; - mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v87, &v88, &v89, &v90, &v91); - VAL v92; - uint64_t v93; - mw_mirth_arrow_Block_newZBang(v86, v91, &v92, &v93); - VAL v94 = mtw_mirth_arrow_Op_OpBlockPush(v93); - VAL v95; - VAL v96; - mw_mirth_elab_abZ_opZBang(v94, v92, v81, &v95, &v96); - VAL v97 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v88, v89, v90, v96)); - x70 = v97; - x69 = v95; - } break; - case 1LL: { // Some - VAL v98 = mtp_std_maybe_Maybe_1_Some(x11); - VAL v99 = mtw_mirth_arrow_Op_OpBlockPush(VU64(v98)); - VAL v100; - uint64_t v101; - VAL v102; - VAL v103; - mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(x10, &v100, &v101, &v102, &v103); - VAL v104; - VAL v105; - mw_mirth_elab_abZ_opZBang(v99, x9, v103, &v104, &v105); - VAL v106 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v100, v101, v102, v105)); - x70 = v106; - x69 = v104; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - *x5 = x70; - *x4 = x69; + uint64_t v7; + VAL v8; + VAL v9; + mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(x2, &v6, &v7, &v8, &v9); + VAL v10; + uint64_t v11; + mw_mirth_elab_abZ_tokenZAt(v9, &v10, &v11); + VAL v12; + VAL v13; + mw_mirth_elab_abZ_ctxZAt(v10, &v12, &v13); + uint64_t v14 = mw_mirth_type_MetaVar_newZBang(); + VAL v15 = mtw_mirth_type_StackType_STMeta(v14); + VAL v16; + VAL v17; + mw_mirth_elab_abZ_homeZAt(v12, &v16, &v17); + incref(v15); + VAL v18 = MKI64(0LL /* Nil */); + VAL v19 = mtw_mirth_arrow_Arrow_Arrow(v17, v11, v11, v13, v15, v15, v18); + VAL v20 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v6, v7, v8, v19); + VAL v21; + VAL v22; + mw_mirth_specializzer_ZPlusSPSynth_synthZ_runZBang(x1, v20, x3, &v21, &v22); + VAL v23; + uint64_t v24; + VAL v25; + VAL v26; + mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v22, &v23, &v24, &v25, &v26); + VAL v27; + uint64_t v28; + mw_mirth_arrow_Block_newZBang(v21, v26, &v27, &v28); + VAL v29 = mtw_mirth_arrow_Op_OpBlockPush(v28); + VAL v30; + VAL v31; + mw_mirth_elab_abZ_opZBang(v29, v27, v16, &v30, &v31); + VAL v32 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v23, v24, v25, v31); + *x5 = v32; + *x4 = v30; } static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_runZBang (VAL x1, VAL x2, uint64_t x3, VAL *x4, VAL *x5) { VAL v6; @@ -65695,215 +47359,119 @@ static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_varZBang (VAL x1, VAL x2, VAL v6 = VVAL(VTUP(x2)->cells[4]); incref(v6); VAL v7 = MKI64(0LL /* None */); - VAL v8; - VAL v9; - mw_std_list_List_1_uncons(v6, &v8, &v9); - uint64_t x10; - VAL x11; - VAL x12; - int64_t x13; - switch (get_data_tag(v8)) { - case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v8); - incref(v14); - VAL v15 = VVAL(VTUP(v14)->cells[1]); - incref(v15); - decref(v14); - int64_t v16 = mw_mirth_var_Var_ZEqualZEqual(x3, VU64(v15)); - uint64_t x17; - VAL x18; - if (((bool)v16)) { - VAL v19 = mtw_std_maybe_Maybe_1_Some(v14); - x18 = v19; - x17 = x3; - push_resource(x1); - push_u64(x3); - push_resource(x2); - } else { - decref(v14); - VAL v20 = MKI64(0LL /* None */); - x18 = v20; - x17 = x3; - push_resource(x1); - push_u64(x3); - push_resource(x2); - } - uint64_t x21; - VAL x22; - VAL x23; - switch (get_data_tag(x18)) { - case 0LL: { // None - x23 = v9; - x22 = v7; - x21 = x17; - } break; - default: { - decref(v9); - decref(v7); - VAL v24 = MKI64(0LL /* Nil */); - x23 = v24; - x22 = x18; - x21 = x17; - } break; - } - int64_t v25 = 1LL /* True */; - x13 = v25; - x12 = x23; - x11 = x22; - x10 = x21; - } break; - case 0LL: { // None - int64_t v26 = 0LL /* False */; - x13 = v26; - x12 = v9; - x11 = v7; - x10 = x3; - push_resource(x1); - push_u64(x3); - push_resource(x2); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v27 = x10; - VAL v28 = x11; - VAL v29 = x12; - int64_t v30 = x13; - while (((bool)v30)) { - uint64_t v31 = v27; - VAL v32 = v28; - VAL v33 = v29; - VAL v34; - VAL v35; - mw_std_list_List_1_uncons(v33, &v34, &v35); - uint64_t x36; - VAL x37; - VAL x38; - int64_t x39; - switch (get_data_tag(v34)) { + int64_t v8 = 1LL /* True */; + uint64_t v9 = x3; + VAL v10 = v7; + VAL v11 = v6; + int64_t v12 = v8; + int64_t v13 = v8; + while (((bool)v13)) { + uint64_t v14 = v9; + VAL v15 = v10; + VAL v16 = v11; + int64_t v17 = v12; + VAL v18; + VAL v19; + mw_std_list_List_1_uncons(v16, &v18, &v19); + uint64_t x20; + VAL x21; + VAL x22; + int64_t x23; + switch (get_data_tag(v18)) { case 1LL: { // Some - VAL v40 = mtp_std_maybe_Maybe_1_Some(v34); - incref(v40); - VAL v41 = VVAL(VTUP(v40)->cells[1]); - incref(v41); - decref(v40); - int64_t v42 = mw_mirth_var_Var_ZEqualZEqual(v31, VU64(v41)); - uint64_t x43; - VAL x44; - if (((bool)v42)) { - VAL v45 = mtw_std_maybe_Maybe_1_Some(v40); - x44 = v45; - x43 = v31; + VAL v24 = mtp_std_maybe_Maybe_1_Some(v18); + incref(v24); + VAL v25 = VVAL(VTUP(v24)->cells[1]); + incref(v25); + decref(v24); + int64_t v26 = mw_mirth_var_Var_index(v14); + int64_t v27 = mw_mirth_var_Var_index(VU64(v25)); + bool v28 = (v26 == v27); + uint64_t x29; + VAL x30; + if (v28) { + VAL v31 = mtw_std_maybe_Maybe_1_Some(v24); + x30 = v31; + x29 = v14; } else { - decref(v40); - VAL v46 = MKI64(0LL /* None */); - x44 = v46; - x43 = v31; + decref(v24); + VAL v32 = MKI64(0LL /* None */); + x30 = v32; + x29 = v14; } - uint64_t x47; - VAL x48; - VAL x49; - switch (get_data_tag(x44)) { + uint64_t x33; + VAL x34; + VAL x35; + switch (get_data_tag(x30)) { case 0LL: { // None - x49 = v35; - x48 = v32; - x47 = x43; + x35 = v19; + x34 = v15; + x33 = x29; } break; default: { - decref(v35); - decref(v32); - VAL v50 = MKI64(0LL /* Nil */); - x49 = v50; - x48 = x44; - x47 = x43; + decref(v19); + decref(v15); + VAL v36 = MKI64(0LL /* Nil */); + x35 = v36; + x34 = x30; + x33 = x29; } break; } - int64_t v51 = 1LL /* True */; - x39 = v51; - x38 = x49; - x37 = x48; - x36 = x47; + int64_t v37 = 1LL /* True */; + x23 = v37; + x22 = x35; + x21 = x34; + x20 = x33; } break; case 0LL: { // None - int64_t v52 = 0LL /* False */; - x39 = v52; - x38 = v35; - x37 = v32; - x36 = v31; + int64_t v38 = 0LL /* False */; + x23 = v38; + x22 = v19; + x21 = v15; + x20 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v30 = x39; - v29 = x38; - v28 = x37; - v27 = x36; - } - decref(v29); - VAL x53; - switch (get_data_tag(v28)) { - case 1LL: { // Some - VAL v54 = mtp_std_maybe_Maybe_1_Some(v28); - VAL v55 = VVAL(VTUP(v54)->cells[2]); - incref(v55); - decref(v54); - VAL v56 = mtw_std_maybe_Maybe_1_Some(v55); - x53 = v56; - } break; - case 0LL: { // None - VAL v57 = MKI64(0LL /* None */); - x53 = v57; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v13 = x23; + v12 = x23; + v11 = x22; + v10 = x21; + v9 = x20; } - VAL x58; - VAL x59; - switch (get_data_tag(x53)) { + decref(v11); + VAL v39 = mw_std_maybe_Maybe_1_map_1_sp10(v10); + VAL x40; + VAL x41; + switch (get_data_tag(v39)) { case 1LL: { // Some - VAL v60 = mtp_std_maybe_Maybe_1_Some(x53); - VAL v61 = pop_value(); - decref(v61); - VAL v62 = mtw_mirth_arrow_Op_OpBlockRun(VU64(v60)); - VAL r63 = pop_resource(); - VAL v64; - uint64_t v65; - VAL v66; - VAL v67; - mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(r63, &v64, &v65, &v66, &v67); - VAL r68 = pop_resource(); - VAL v69; - VAL v70; - mw_mirth_elab_abZ_opZBang(v62, r68, v67, &v69, &v70); - VAL v71 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v64, v65, v66, v70)); - x59 = v71; - x58 = v69; + VAL v42 = mtp_std_maybe_Maybe_1_Some(v39); + VAL v43; + VAL v44; + mw_mirth_specializzer_ZPlusSPSynth_synthZ_runZBang(x1, x2, VU64(v42), &v43, &v44); + x41 = v44; + x40 = v43; } break; case 0LL: { // None - VAL r72 = pop_resource(); - VAL v73; - uint64_t v74; - VAL v75; - VAL v76; - mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(r72, &v73, &v74, &v75, &v76); - VAL r77 = pop_resource(); - uint64_t v78 = pop_u64(); - VAL v79; - VAL v80; - mw_mirth_elab_abZ_varZBang(v78, r77, v76, &v79, &v80); - VAL v81 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v73, v74, v75, v80)); - x59 = v81; - x58 = v79; + VAL v45; + uint64_t v46; + VAL v47; + VAL v48; + mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(x2, &v45, &v46, &v47, &v48); + VAL v49; + VAL v50; + mw_mirth_elab_abZ_varZBang(x3, x1, v48, &v49, &v50); + VAL v51 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v45, v46, v47, v50); + x41 = v51; + x40 = v49; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x5 = x59; - *x4 = x58; + *x5 = x41; + *x4 = x40; } static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_matchZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { uint64_t v6 = mw_mirth_type_MetaVar_newZBang(); @@ -65932,480 +47500,198 @@ static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_matchZBang (VAL x1, VAL x2 VAL v21; mw_mirth_elab_abZ_homeZAt(v18, &v20, &v21); VAL v22 = MKI64(0LL /* Nil */); - VAL v23 = (mtw_mirth_match_ZPlusMatch_ZPlusMatch(v21, v19, v8, v15, v17, v7, v22)); - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v9, &v24, &v25); - VAL x26; - uint64_t x27; - VAL x28; - VAL x29; - VAL x30; - VAL x31; - int64_t x32; - switch (get_data_tag(v24)) { - case 1LL: { // Some - VAL v33 = mtp_std_maybe_Maybe_1_Some(v24); - incref(v33); - VAL v34 = VVAL(VTUP(v33)->cells[1]); - incref(v34); - decref(v33); - uint64_t v35 = VU64(VTUP(v34)->cells[2]); - decref(v34); - incref(v33); - VAL v36 = VVAL(VTUP(v33)->cells[2]); - incref(v36); - decref(v33); - uint64_t v37 = VU64(VTUP(v36)->cells[2]); - decref(v36); - VAL v38 = VVAL(VTUP(v23)->cells[1]); - incref(v38); - VAL v39 = VVAL(VTUP(v23)->cells[4]); - incref(v39); - incref(v39); - VAL v40 = MKI64(0LL /* Nil */); - VAL v41 = VVAL(VTUP(v23)->cells[5]); - incref(v41); - incref(v41); - VAL v42 = MKI64(0LL /* Nil */); - VAL v43 = mtw_mirth_match_Pattern_Pattern(v38, v35, v35, v39, v39, v40, v41, v41, v42); - VAL v44 = (mw_mirth_match_Pattern_thaw(v43)); - incref(v33); - VAL v45 = VVAL(VTUP(v33)->cells[1]); - incref(v45); - decref(v33); - VAL v46 = VVAL(VTUP(v45)->cells[9]); - incref(v46); - decref(v45); - VAL v47 = mw_std_list_List_1_reverse(v46); - VAL v48; - VAL v49; - mw_std_list_List_1_uncons(v47, &v48, &v49); - VAL x50; - uint64_t x51; - VAL x52; - VAL x53; - VAL x54; - VAL x55; - VAL x56; - int64_t x57; - switch (get_data_tag(v48)) { - case 1LL: { // Some - VAL v58 = mtp_std_maybe_Maybe_1_Some(v48); - VAL v59 = VVAL(VTUP(v58)->cells[7]); - incref(v59); - decref(v58); - VAL v60; - VAL v61; - mw_mirth_match_ZPlusPattern_opZBang(v59, x1, v44, &v60, &v61); - int64_t v62 = 1LL /* True */; - x57 = v62; - x56 = v49; - x55 = v33; - x54 = v61; - x53 = v60; - x52 = v12; - x51 = v11; - x50 = v10; - } break; - case 0LL: { // None - int64_t v63 = 0LL /* False */; - x57 = v63; - x56 = v49; - x55 = v33; - x54 = v44; - x53 = x1; - x52 = v12; - x51 = v11; - x50 = v10; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v64 = x50; - uint64_t v65 = x51; - VAL v66 = x52; - VAL v67 = (x53); - VAL v68 = (x54); - VAL v69 = x55; - VAL v70 = x56; - int64_t v71 = x57; - while (((bool)v71)) { - VAL v72 = v64; - uint64_t v73 = v65; - VAL v74 = v66; - VAL v75 = (v67); - VAL v76 = (v68); - VAL v77 = v69; - VAL v78 = v70; - VAL v79; - VAL v80; - mw_std_list_List_1_uncons(v78, &v79, &v80); - VAL x81; - uint64_t x82; - VAL x83; - VAL x84; - VAL x85; - VAL x86; - VAL x87; - int64_t x88; - switch (get_data_tag(v79)) { - case 1LL: { // Some - VAL v89 = mtp_std_maybe_Maybe_1_Some(v79); - VAL v90 = VVAL(VTUP(v89)->cells[7]); - incref(v90); - decref(v89); - VAL v91; - VAL v92; - mw_mirth_match_ZPlusPattern_opZBang(v90, v75, v76, &v91, &v92); - int64_t v93 = 1LL /* True */; - x88 = v93; - x87 = v80; - x86 = v77; - x85 = v92; - x84 = v91; - x83 = v74; - x82 = v73; - x81 = v72; - } break; - case 0LL: { // None - int64_t v94 = 0LL /* False */; - x88 = v94; - x87 = v80; - x86 = v77; - x85 = v76; - x84 = v75; - x83 = v74; - x82 = v73; - x81 = v72; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v71 = x88; - v70 = x87; - v69 = x86; - v68 = x85; - v67 = x84; - v66 = x83; - v65 = x82; - v64 = x81; - } - decref(v70); - VAL v95 = mw_mirth_match_ZPlusPattern_freezze(v68); - incref(v95); - VAL v96 = VVAL(VTUP(v95)->cells[5]); - incref(v96); - decref(v95); - incref(v95); - VAL v97 = mw_mirth_match_Pattern_dom(v95); - VAL v98 = VVAL(VTUP(v23)->cells[6]); - incref(v98); - VAL v99 = mw_mirth_type_TZ_ZTo(v97, v98); - VAL v100 = VVAL(VTUP(v23)->cells[1]); - incref(v100); - VAL v101; - VAL v102; - mw_mirth_type_ArrowType_unpack(v99, &v101, &v102); - incref(v101); - VAL v103 = MKI64(0LL /* Nil */); - VAL v104 = mtw_mirth_arrow_Arrow_Arrow(v100, v37, v37, v96, v101, v101, v103); - VAL v105 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v64, v65, v66, v104)); - VAL v106 = VVAL(VTUP(v69)->cells[2]); - incref(v106); - decref(v69); - VAL v107; - VAL v108; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_arrowZBang(v67, v105, v106, &v107, &v108); - VAL v109; - uint64_t v110; - VAL v111; - VAL v112; - mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v108, &v109, &v110, &v111, &v112); - VAL v113; - VAL v114; - mw_mirth_elab_abZ_unifyZ_typeZBang(v102, v107, v112, &v113, &v114); - VAL v115 = mtw_mirth_match_Case_CASE(v95, v114); - VAL v116; - VAL v117; - mw_mirth_match_ZPlusMatch_addZ_case(v113, v23, v115, &v116, &v117); - int64_t v118 = 1LL /* True */; - x32 = v118; - x31 = v25; - x30 = v117; - x29 = v116; - x28 = v111; - x27 = v110; - x26 = v109; - } break; - case 0LL: { // None - int64_t v119 = 0LL /* False */; - x32 = v119; - x31 = v25; - x30 = v23; - x29 = x1; - x28 = v12; - x27 = v11; - x26 = v10; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v120 = x26; - uint64_t v121 = x27; - VAL v122 = x28; - VAL v123 = (x29); - VAL v124 = (x30); - VAL v125 = x31; - int64_t v126 = x32; - while (((bool)v126)) { - VAL v127 = v120; - uint64_t v128 = v121; - VAL v129 = v122; - VAL v130 = (v123); - VAL v131 = (v124); - VAL v132 = v125; - VAL v133; - VAL v134; - mw_std_list_List_1_uncons(v132, &v133, &v134); - VAL x135; - uint64_t x136; - VAL x137; - VAL x138; - VAL x139; - VAL x140; - int64_t x141; - switch (get_data_tag(v133)) { - case 1LL: { // Some - VAL v142 = mtp_std_maybe_Maybe_1_Some(v133); - incref(v142); - VAL v143 = VVAL(VTUP(v142)->cells[1]); - incref(v143); - decref(v142); - uint64_t v144 = VU64(VTUP(v143)->cells[2]); - decref(v143); - incref(v142); - VAL v145 = VVAL(VTUP(v142)->cells[2]); - incref(v145); - decref(v142); - uint64_t v146 = VU64(VTUP(v145)->cells[2]); - decref(v145); - VAL v147 = VVAL(VTUP(v131)->cells[1]); - incref(v147); - VAL v148 = VVAL(VTUP(v131)->cells[4]); - incref(v148); - incref(v148); - VAL v149 = MKI64(0LL /* Nil */); - VAL v150 = VVAL(VTUP(v131)->cells[5]); - incref(v150); - incref(v150); - VAL v151 = MKI64(0LL /* Nil */); - VAL v152 = mtw_mirth_match_Pattern_Pattern(v147, v144, v144, v148, v148, v149, v150, v150, v151); - VAL v153 = (mw_mirth_match_Pattern_thaw(v152)); - incref(v142); - VAL v154 = VVAL(VTUP(v142)->cells[1]); - incref(v154); - decref(v142); - VAL v155 = VVAL(VTUP(v154)->cells[9]); - incref(v155); - decref(v154); - VAL v156 = mw_std_list_List_1_reverse(v155); - VAL v157; - VAL v158; - mw_std_list_List_1_uncons(v156, &v157, &v158); - VAL x159; - uint64_t x160; - VAL x161; - VAL x162; - VAL x163; - VAL x164; - VAL x165; - int64_t x166; - switch (get_data_tag(v157)) { - case 1LL: { // Some - VAL v167 = mtp_std_maybe_Maybe_1_Some(v157); - VAL v168 = VVAL(VTUP(v167)->cells[7]); - incref(v168); - decref(v167); - VAL v169; - VAL v170; - mw_mirth_match_ZPlusPattern_opZBang(v168, v130, v153, &v169, &v170); - int64_t v171 = 1LL /* True */; - x166 = v171; - x165 = v158; - x164 = v142; - x163 = v170; - x162 = v169; - x161 = v129; - x160 = v128; - x159 = v127; - } break; - case 0LL: { // None - int64_t v172 = 0LL /* False */; - x166 = v172; - x165 = v158; - x164 = v142; - x163 = v153; - x162 = v130; - x161 = v129; - x160 = v128; - x159 = v127; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v173 = x159; - uint64_t v174 = x160; - VAL v175 = x161; - VAL v176 = (x162); - VAL v177 = (x163); - VAL v178 = x164; - VAL v179 = x165; - int64_t v180 = x166; - while (((bool)v180)) { - VAL v181 = v173; - uint64_t v182 = v174; - VAL v183 = v175; - VAL v184 = (v176); - VAL v185 = (v177); - VAL v186 = v178; - VAL v187 = v179; - VAL v188; - VAL v189; - mw_std_list_List_1_uncons(v187, &v188, &v189); - VAL x190; - uint64_t x191; - VAL x192; - VAL x193; - VAL x194; - VAL x195; - VAL x196; - int64_t x197; - switch (get_data_tag(v188)) { - case 1LL: { // Some - VAL v198 = mtp_std_maybe_Maybe_1_Some(v188); - VAL v199 = VVAL(VTUP(v198)->cells[7]); - incref(v199); - decref(v198); - VAL v200; - VAL v201; - mw_mirth_match_ZPlusPattern_opZBang(v199, v184, v185, &v200, &v201); - int64_t v202 = 1LL /* True */; - x197 = v202; - x196 = v189; - x195 = v186; - x194 = v201; - x193 = v200; - x192 = v183; - x191 = v182; - x190 = v181; + VAL v23 = mtw_mirth_match_ZPlusMatch_ZPlusMatch(v21, v19, v8, v15, v17, v7, v22); + int64_t v24 = 1LL /* True */; + VAL v25 = v10; + uint64_t v26 = v11; + VAL v27 = v12; + VAL v28 = x1; + VAL v29 = v23; + VAL v30 = v9; + int64_t v31 = v24; + int64_t v32 = v24; + while (((bool)v32)) { + VAL v33 = v25; + uint64_t v34 = v26; + VAL v35 = v27; + VAL v36 = v28; + VAL v37 = v29; + VAL v38 = v30; + int64_t v39 = v31; + VAL x40; + uint64_t x41; + VAL x42; + VAL x43; + VAL x44; + VAL x45; + int64_t x46; + switch (get_data_tag(v38)) { + case 1LL: { // Cons + VAL v47; + VAL v48; + mtp_std_list_List_1_Cons(v38, &v47, &v48); + incref(v47); + VAL v49 = VVAL(VTUP(v47)->cells[1]); + incref(v49); + decref(v47); + uint64_t v50 = VU64(VTUP(v49)->cells[2]); + decref(v49); + incref(v47); + VAL v51 = VVAL(VTUP(v47)->cells[2]); + incref(v51); + decref(v47); + uint64_t v52 = VU64(VTUP(v51)->cells[2]); + decref(v51); + VAL v53 = VVAL(VTUP(v37)->cells[1]); + incref(v53); + VAL v54 = VVAL(VTUP(v37)->cells[4]); + incref(v54); + incref(v54); + VAL v55 = MKI64(0LL /* Nil */); + VAL v56 = VVAL(VTUP(v37)->cells[5]); + incref(v56); + incref(v56); + VAL v57 = MKI64(0LL /* Nil */); + VAL v58 = mtw_mirth_match_Pattern_Pattern(v53, v50, v50, v54, v54, v55, v56, v56, v57); + VAL v59 = mw_mirth_match_Pattern_thaw(v58); + incref(v47); + VAL v60 = VVAL(VTUP(v47)->cells[1]); + incref(v60); + decref(v47); + VAL v61 = VVAL(VTUP(v60)->cells[9]); + incref(v61); + decref(v60); + VAL v62 = mw_std_list_List_1_reverse(v61); + int64_t v63 = 1LL /* True */; + VAL v64 = v36; + VAL v65 = v59; + VAL v66 = v62; + int64_t v67 = v63; + int64_t v68 = v63; + while (((bool)v68)) { + VAL v69 = v64; + VAL v70 = v65; + VAL v71 = v66; + int64_t v72 = v67; + VAL x73; + VAL x74; + VAL x75; + int64_t x76; + switch (get_data_tag(v71)) { + case 1LL: { // Cons + VAL v77; + VAL v78; + mtp_std_list_List_1_Cons(v71, &v77, &v78); + VAL v79 = VVAL(VTUP(v77)->cells[7]); + incref(v79); + decref(v77); + VAL v80; + VAL v81; + mw_mirth_match_ZPlusPattern_opZBang(v79, v69, v70, &v80, &v81); + int64_t v82 = 1LL /* True */; + x76 = v82; + x75 = v78; + x74 = v81; + x73 = v80; } break; - case 0LL: { // None - int64_t v203 = 0LL /* False */; - x197 = v203; - x196 = v189; - x195 = v186; - x194 = v185; - x193 = v184; - x192 = v183; - x191 = v182; - x190 = v181; + case 0LL: { // Nil + VAL v83 = MKI64(0LL /* Nil */); + int64_t v84 = 0LL /* False */; + x76 = v84; + x75 = v83; + x74 = v70; + x73 = v69; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v180 = x197; - v179 = x196; - v178 = x195; - v177 = x194; - v176 = x193; - v175 = x192; - v174 = x191; - v173 = x190; + v68 = x76; + v67 = x76; + v66 = x75; + v65 = x74; + v64 = x73; } - decref(v179); - VAL v204 = mw_mirth_match_ZPlusPattern_freezze(v177); - incref(v204); - VAL v205 = VVAL(VTUP(v204)->cells[5]); - incref(v205); - decref(v204); - incref(v204); - VAL v206 = mw_mirth_match_Pattern_dom(v204); - VAL v207 = VVAL(VTUP(v131)->cells[6]); - incref(v207); - VAL v208 = mw_mirth_type_TZ_ZTo(v206, v207); - VAL v209 = VVAL(VTUP(v131)->cells[1]); - incref(v209); - VAL v210; - VAL v211; - mw_mirth_type_ArrowType_unpack(v208, &v210, &v211); - incref(v210); - VAL v212 = MKI64(0LL /* Nil */); - VAL v213 = mtw_mirth_arrow_Arrow_Arrow(v209, v146, v146, v205, v210, v210, v212); - VAL v214 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v173, v174, v175, v213)); - VAL v215 = VVAL(VTUP(v178)->cells[2]); - incref(v215); - decref(v178); - VAL v216; - VAL v217; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_arrowZBang(v176, v214, v215, &v216, &v217); - VAL v218; - uint64_t v219; - VAL v220; - VAL v221; - mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v217, &v218, &v219, &v220, &v221); - VAL v222; - VAL v223; - mw_mirth_elab_abZ_unifyZ_typeZBang(v211, v216, v221, &v222, &v223); - VAL v224 = mtw_mirth_match_Case_CASE(v204, v223); - VAL v225; - VAL v226; - mw_mirth_match_ZPlusMatch_addZ_case(v222, v131, v224, &v225, &v226); - int64_t v227 = 1LL /* True */; - x141 = v227; - x140 = v134; - x139 = v226; - x138 = v225; - x137 = v220; - x136 = v219; - x135 = v218; + decref(v66); + VAL v85 = mw_mirth_match_ZPlusPattern_freezze(v65); + incref(v85); + VAL v86 = VVAL(VTUP(v85)->cells[5]); + incref(v86); + decref(v85); + incref(v85); + VAL v87 = mw_mirth_match_Pattern_dom(v85); + VAL v88 = VVAL(VTUP(v37)->cells[6]); + incref(v88); + VAL v89 = mw_mirth_type_TZ_ZTo(v87, v88); + VAL v90 = VVAL(VTUP(v37)->cells[1]); + incref(v90); + VAL v91; + VAL v92; + mw_mirth_type_ArrowType_unpack(v89, &v91, &v92); + incref(v91); + VAL v93 = MKI64(0LL /* Nil */); + VAL v94 = mtw_mirth_arrow_Arrow_Arrow(v90, v52, v52, v86, v91, v91, v93); + VAL v95 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v33, v34, v35, v94); + VAL v96 = VVAL(VTUP(v47)->cells[2]); + incref(v96); + decref(v47); + VAL v97; + VAL v98; + mw_mirth_specializzer_ZPlusSPSynth_synthZ_arrowZBang(v64, v95, v96, &v97, &v98); + VAL v99; + uint64_t v100; + VAL v101; + VAL v102; + mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v98, &v99, &v100, &v101, &v102); + VAL v103; + VAL v104; + mw_mirth_elab_abZ_unifyZ_typeZBang(v92, v97, v102, &v103, &v104); + VAL v105 = mtw_mirth_match_Case_CASE(v85, v104); + VAL v106; + VAL v107; + mw_mirth_match_ZPlusMatch_addZ_case(v103, v37, v105, &v106, &v107); + int64_t v108 = 1LL /* True */; + x46 = v108; + x45 = v48; + x44 = v107; + x43 = v106; + x42 = v101; + x41 = v100; + x40 = v99; } break; - case 0LL: { // None - int64_t v228 = 0LL /* False */; - x141 = v228; - x140 = v134; - x139 = v131; - x138 = v130; - x137 = v129; - x136 = v128; - x135 = v127; + case 0LL: { // Nil + VAL v109 = MKI64(0LL /* Nil */); + int64_t v110 = 0LL /* False */; + x46 = v110; + x45 = v109; + x44 = v37; + x43 = v36; + x42 = v35; + x41 = v34; + x40 = v33; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v126 = x141; - v125 = x140; - v124 = x139; - v123 = x138; - v122 = x137; - v121 = x136; - v120 = x135; - } - decref(v125); - VAL v229 = mw_mirth_match_ZPlusMatch_freezze(v124); - VAL v230 = mtw_mirth_arrow_Op_OpMatch(v229); - VAL v231; - VAL v232; - mw_mirth_elab_abZ_opZBang(v230, v123, v20, &v231, &v232); - VAL v233 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v120, v121, v122, v232)); - *x5 = v233; - *x4 = v231; + v32 = x46; + v31 = x46; + v30 = x45; + v29 = x44; + v28 = x43; + v27 = x42; + v26 = x41; + v25 = x40; + } + decref(v30); + VAL v111 = mw_mirth_match_ZPlusMatch_freezze(v29); + VAL v112 = mtw_mirth_arrow_Op_OpMatch(v111); + VAL v113; + VAL v114; + mw_mirth_elab_abZ_opZBang(v112, v28, v20, &v113, &v114); + VAL v115 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v25, v26, v27, v114); + *x5 = v115; + *x4 = v113; } static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_lambdaZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { incref(x3); @@ -66427,205 +47713,46 @@ static void mw_mirth_specializzer_ZPlusSPSynth_synthZ_lambdaZBang (VAL x1, VAL x VAL v15; VAL v16; mw_mirth_elab_abZ_typeZAt(v13, &v15, &v16); - VAL v17 = mw_std_list_List_1_reverse(v6); + VAL v17; VAL v18; VAL v19; - mw_std_list_List_1_uncons(v17, &v18, &v19); - VAL x20; - VAL x21; - uint64_t x22; - VAL x23; - uint64_t x24; - VAL x25; - VAL x26; - VAL x27; - VAL x28; - VAL x29; - int64_t x30; - switch (get_data_tag(v18)) { - case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v18); - incref(v31); - VAL v32 = mw_mirth_var_Ctx_new(v14, VU64(v31)); - VAL v33; - uint64_t v34; - mw_mirth_elab_abZ_tokenZAt(v15, &v33, &v34); - VAL v35; - VAL v36; - VAL v37; - uint64_t v38; - mw_mirth_elab_elabZ_expandZ_tensorZBang(x1, v16, v34, &v35, &v36, &v37, &v38); - VAL v39 = mw_mirth_var_Var_type(VU64(v31)); - VAL v40; - VAL v41; - uint64_t v42; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v35, v37, v39, v38, &v40, &v41, &v42); - decref(v41); - int64_t v43 = 1LL /* True */; - x30 = v43; - x29 = v19; - x28 = v33; - x27 = v40; - x26 = v36; - x25 = v32; - x24 = v12; - x23 = v9; - x22 = v8; - x21 = v7; - x20 = x3; - } break; - case 0LL: { // None - int64_t v44 = 0LL /* False */; - x30 = v44; - x29 = v19; - x28 = v15; - x27 = x1; - x26 = v16; - x25 = v14; - x24 = v12; - x23 = v9; - x22 = v8; - x21 = v7; - x20 = x3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v45 = x20; - VAL v46 = x21; - uint64_t v47 = x22; - VAL v48 = x23; - uint64_t v49 = x24; - VAL v50 = x25; - VAL v51 = x26; - VAL v52 = (x27); - VAL v53 = (x28); - VAL v54 = x29; - int64_t v55 = x30; - while (((bool)v55)) { - VAL v56 = v45; - VAL v57 = v46; - uint64_t v58 = v47; - VAL v59 = v48; - uint64_t v60 = v49; - VAL v61 = v50; - VAL v62 = v51; - VAL v63 = (v52); - VAL v64 = (v53); - VAL v65 = v54; - VAL v66; - VAL v67; - mw_std_list_List_1_uncons(v65, &v66, &v67); - VAL x68; - VAL x69; - uint64_t x70; - VAL x71; - uint64_t x72; - VAL x73; - VAL x74; - VAL x75; - VAL x76; - VAL x77; - int64_t x78; - switch (get_data_tag(v66)) { - case 1LL: { // Some - VAL v79 = mtp_std_maybe_Maybe_1_Some(v66); - incref(v79); - VAL v80 = mw_mirth_var_Ctx_new(v61, VU64(v79)); - VAL v81; - uint64_t v82; - mw_mirth_elab_abZ_tokenZAt(v64, &v81, &v82); - VAL v83; - VAL v84; - VAL v85; - uint64_t v86; - mw_mirth_elab_elabZ_expandZ_tensorZBang(v63, v62, v82, &v83, &v84, &v85, &v86); - VAL v87 = mw_mirth_var_Var_type(VU64(v79)); - VAL v88; - VAL v89; - uint64_t v90; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v83, v85, v87, v86, &v88, &v89, &v90); - decref(v89); - int64_t v91 = 1LL /* True */; - x78 = v91; - x77 = v67; - x76 = v81; - x75 = v88; - x74 = v84; - x73 = v80; - x72 = v60; - x71 = v59; - x70 = v58; - x69 = v57; - x68 = v56; - } break; - case 0LL: { // None - int64_t v92 = 0LL /* False */; - x78 = v92; - x77 = v67; - x76 = v64; - x75 = v63; - x74 = v62; - x73 = v61; - x72 = v60; - x71 = v59; - x70 = v58; - x69 = v57; - x68 = v56; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v55 = x78; - v54 = x77; - v53 = x76; - v52 = x75; - v51 = x74; - v50 = x73; - v49 = x72; - v48 = x71; - v47 = x70; - v46 = x69; - v45 = x68; - } - decref(v54); - VAL v93; - VAL v94; - mw_mirth_elab_abZ_homeZAt(v53, &v93, &v94); - incref(v51); - VAL v95 = MKI64(0LL /* Nil */); - VAL v96 = mtw_mirth_arrow_Arrow_Arrow(v94, v49, v49, v50, v51, v51, v95); - VAL v97 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v46, v47, v48, v96)); - VAL v98 = VVAL(VTUP(v45)->cells[5]); - incref(v98); - decref(v45); - VAL v99; - VAL v100; - mw_mirth_specializzer_ZPlusSPSynth_synthZ_arrowZBang(v52, v97, v98, &v99, &v100); - VAL v101; - uint64_t v102; - VAL v103; - VAL v104; - mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v100, &v101, &v102, &v103, &v104); - VAL v105; - VAL v106; - mw_mirth_elab_abZ_ctxZAt(v93, &v105, &v106); - VAL v107; - VAL v108; - mw_mirth_elab_abZ_typeZAt(v105, &v107, &v108); - VAL v109; - uint64_t v110; - mw_mirth_elab_abZ_tokenZAt(v107, &v109, &v110); - VAL v111 = mtw_mirth_arrow_Lambda_Lambda(v110, v106, v108, v6, v104); - VAL v112 = mtw_mirth_arrow_Op_OpLambda(v111); - VAL v113; - VAL v114; - mw_mirth_elab_abZ_opZBang(v112, v99, v109, &v113, &v114); - VAL v115 = (mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v101, v102, v103, v114)); - *x5 = v115; - *x4 = v113; + VAL v20; + mw_std_list_List_1_reverseZ_for_1_sp9(x1, v15, v14, v16, v6, &v17, &v18, &v19, &v20); + VAL v21; + VAL v22; + mw_mirth_elab_abZ_homeZAt(v18, &v21, &v22); + incref(v20); + VAL v23 = MKI64(0LL /* Nil */); + VAL v24 = mtw_mirth_arrow_Arrow_Arrow(v22, v12, v12, v19, v20, v20, v23); + VAL v25 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v7, v8, v9, v24); + VAL v26 = VVAL(VTUP(x3)->cells[5]); + incref(v26); + decref(x3); + VAL v27; + VAL v28; + mw_mirth_specializzer_ZPlusSPSynth_synthZ_arrowZBang(v17, v25, v26, &v27, &v28); + VAL v29; + uint64_t v30; + VAL v31; + VAL v32; + mtp_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v28, &v29, &v30, &v31, &v32); + VAL v33; + VAL v34; + mw_mirth_elab_abZ_ctxZAt(v21, &v33, &v34); + VAL v35; + VAL v36; + mw_mirth_elab_abZ_typeZAt(v33, &v35, &v36); + VAL v37; + uint64_t v38; + mw_mirth_elab_abZ_tokenZAt(v35, &v37, &v38); + VAL v39 = mtw_mirth_arrow_Lambda_Lambda(v38, v34, v36, v6, v32); + VAL v40 = mtw_mirth_arrow_Op_OpLambda(v39); + VAL v41; + VAL v42; + mw_mirth_elab_abZ_opZBang(v40, v27, v37, &v41, &v42); + VAL v43 = mtw_mirth_specializzer_ZPlusSPSynth_ZPlusSPSYNTH(v29, v30, v31, v42); + *x5 = v43; + *x4 = v41; } static int64_t mw_std_set_SETz_INITIALz_SIZZE (void) { int64_t v1 = 256LL; @@ -66633,7 +47760,7 @@ static int64_t mw_std_set_SETz_INITIALz_SIZZE (void) { } static VAL mw_std_set_ZPlusSet_new (void) { int64_t v1 = mw_std_set_SETz_INITIALz_SIZZE(); - VAL v2 = (mw_std_buffer_ZPlusBuffer_new(v1)); + VAL v2 = mw_std_buffer_ZPlusBuffer_new(v1); return v2; } static void mw_std_set_ZPlusSet_rdrop (VAL x1) { @@ -66656,7 +47783,7 @@ static void mw_std_set_ZPlusSet_memberZAsk (int64_t x1, VAL x2, int64_t *x3, VAL int64_t v6; VAL v7; mw_std_set_ZPlusSet_offsetZ_mask(x1, x2, &v5, &v6, &v7); - int64_t v8 = (0); + int64_t v8 = 0; int64_t v9; VAL v10; mw_std_buffer_ZPlusBuffer_ZAtU8(v5, v7, &v9, &v10); @@ -66671,12 +47798,12 @@ static VAL mw_std_set_ZPlusSet_insertZBang (int64_t x1, VAL x2) { int64_t v4; VAL v5; mw_std_set_ZPlusSet_offsetZ_mask(x1, x2, &v3, &v4, &v5); - int64_t v6 = (0); + int64_t v6 = 0; int64_t v7; VAL v8; mw_std_buffer_ZPlusBuffer_ZAtU8(v3, v5, &v7, &v8); uint64_t v9 = (((uint64_t)v4) | ((uint64_t)v7)); - VAL v10 = (mw_std_buffer_ZPlusBuffer_ZBangU8(((int64_t)v9), v3, v8)); + VAL v10 = mw_std_buffer_ZPlusBuffer_ZBangU8(((int64_t)v9), v3, v8); return v10; } static int64_t mw_mirth_need_Need_ZToNat (VAL x1) { @@ -66686,67 +47813,43 @@ static int64_t mw_mirth_need_Need_ZToNat (VAL x1) { uint64_t v3 = mtp_mirth_need_Need_NEEDz_WORD(x1); int64_t v4 = mw_mirth_word_Word_index(v3); int64_t v5 = 0LL; - bool v6 = (v4 < v5); - int64_t x7; - if (v6) { - x7 = v5; - } else { - x7 = v4; - } - int64_t v8 = 4LL; - int64_t v9 = i64_mul(x7, v8); - x2 = v9; + int64_t v6 = mw_std_prim_Int_max(v4, v5); + int64_t v7 = 4LL; + int64_t v8 = i64_mul(v6, v7); + x2 = v8; } break; case 1LL: { // NEED_BLOCK - uint64_t v10 = mtp_mirth_need_Need_NEEDz_BLOCK(x1); - int64_t v11 = mw_mirth_arrow_Block_index(v10); - int64_t v12 = 0LL; - bool v13 = (v11 < v12); - int64_t x14; - if (v13) { - x14 = v12; - } else { - x14 = v11; - } - int64_t v15 = 4LL; - int64_t v16 = i64_mul(x14, v15); - int64_t v17 = 1LL; - int64_t v18 = i64_add(v16, v17); - x2 = v18; + uint64_t v9 = mtp_mirth_need_Need_NEEDz_BLOCK(x1); + int64_t v10 = mw_mirth_arrow_Block_index(v9); + int64_t v11 = 0LL; + int64_t v12 = mw_std_prim_Int_max(v10, v11); + int64_t v13 = 4LL; + int64_t v14 = i64_mul(v12, v13); + int64_t v15 = 1LL; + int64_t v16 = i64_add(v14, v15); + x2 = v16; } break; case 2LL: { // NEED_TAGW - uint64_t v19 = mtp_mirth_need_Need_NEEDz_TAGW(x1); - int64_t v20 = mw_mirth_data_Tag_index(v19); - int64_t v21 = 0LL; - bool v22 = (v20 < v21); - int64_t x23; - if (v22) { - x23 = v21; - } else { - x23 = v20; - } - int64_t v24 = 4LL; - int64_t v25 = i64_mul(x23, v24); - int64_t v26 = 2LL; - int64_t v27 = i64_add(v25, v26); - x2 = v27; + uint64_t v17 = mtp_mirth_need_Need_NEEDz_TAGW(x1); + int64_t v18 = mw_mirth_data_Tag_index(v17); + int64_t v19 = 0LL; + int64_t v20 = mw_std_prim_Int_max(v18, v19); + int64_t v21 = 4LL; + int64_t v22 = i64_mul(v20, v21); + int64_t v23 = 2LL; + int64_t v24 = i64_add(v22, v23); + x2 = v24; } break; case 3LL: { // NEED_TAGP - uint64_t v28 = mtp_mirth_need_Need_NEEDz_TAGP(x1); - int64_t v29 = mw_mirth_data_Tag_index(v28); - int64_t v30 = 0LL; - bool v31 = (v29 < v30); - int64_t x32; - if (v31) { - x32 = v30; - } else { - x32 = v29; - } - int64_t v33 = 4LL; - int64_t v34 = i64_mul(x32, v33); - int64_t v35 = 3LL; - int64_t v36 = i64_add(v34, v35); - x2 = v36; + uint64_t v25 = mtp_mirth_need_Need_NEEDz_TAGP(x1); + int64_t v26 = mw_mirth_data_Tag_index(v25); + int64_t v27 = 0LL; + int64_t v28 = mw_std_prim_Int_max(v26, v27); + int64_t v29 = 4LL; + int64_t v30 = i64_mul(v28, v29); + int64_t v31 = 3LL; + int64_t v32 = i64_add(v30, v31); + x2 = v32; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -66756,8 +47859,8 @@ static int64_t mw_mirth_need_Need_ZToNat (VAL x1) { } static VAL mw_mirth_need_ZPlusNeeds_new (void) { VAL v1 = MKI64(0LL /* Nil */); - VAL v2 = (mw_std_set_ZPlusSet_new()); - VAL v3 = (mtw_mirth_need_ZPlusNeeds_ZPlusNeeds(v1, v2)); + VAL v2 = mw_std_set_ZPlusSet_new(); + VAL v3 = mtw_mirth_need_ZPlusNeeds_ZPlusNeeds(v1, v2); return v3; } static void mw_mirth_need_ZPlusNeeds_rdrop (VAL x1) { @@ -66769,7 +47872,7 @@ static void mw_mirth_need_ZPlusNeeds_rdrop (VAL x1) { } static void mw_mirth_need_Need_neededZAsk (VAL x1, VAL x2, int64_t *x3, VAL *x4) { int64_t v5 = mw_mirth_need_Need_ZToNat(x1); - VAL v6 = (VVAL(VTUP(x2)->cells[2])); + VAL v6 = VVAL(VTUP(x2)->cells[2]); int64_t v7; VAL v8; mw_std_set_ZPlusSet_memberZAsk(v5, v6, &v7, &v8); @@ -66821,8 +47924,8 @@ static VAL mw_mirth_need_ZPlusNeeds_needZBang (VAL x1, VAL x2) { } else { incref(x1); int64_t v6 = mw_mirth_need_Need_ZToNat(x1); - VAL v7 = (VVAL(VTUP(v4)->cells[2])); - VAL v8 = (mw_std_set_ZPlusSet_insertZBang(v6, v7)); + VAL v7 = VVAL(VTUP(v4)->cells[2]); + VAL v8 = mw_std_set_ZPlusSet_insertZBang(v6, v7); VTUP(v4)->cells[2] = v8; VAL v9 = VVAL(VTUP(v4)->cells[1]); incref(v9); @@ -66836,22 +47939,22 @@ static VAL mw_mirth_need_ZPlusNeeds_needZBang (VAL x1, VAL x2) { } static VAL mw_mirth_need_ZPlusNeeds_needZ_wordZBang (uint64_t x1, VAL x2) { VAL v3 = mtw_mirth_need_Need_NEEDz_WORD(x1); - VAL v4 = (mw_mirth_need_ZPlusNeeds_needZBang(v3, x2)); + VAL v4 = mw_mirth_need_ZPlusNeeds_needZBang(v3, x2); return v4; } static VAL mw_mirth_need_ZPlusNeeds_needZ_blockZBang (uint64_t x1, VAL x2) { VAL v3 = mtw_mirth_need_Need_NEEDz_BLOCK(x1); - VAL v4 = (mw_mirth_need_ZPlusNeeds_needZBang(v3, x2)); + VAL v4 = mw_mirth_need_ZPlusNeeds_needZBang(v3, x2); return v4; } static VAL mw_mirth_need_ZPlusNeeds_needZ_tagZ_wordZBang (uint64_t x1, VAL x2) { VAL v3 = mtw_mirth_need_Need_NEEDz_TAGW(x1); - VAL v4 = (mw_mirth_need_ZPlusNeeds_needZBang(v3, x2)); + VAL v4 = mw_mirth_need_ZPlusNeeds_needZBang(v3, x2); return v4; } static VAL mw_mirth_need_ZPlusNeeds_needZ_tagZ_patZBang (uint64_t x1, VAL x2) { VAL v3 = mtw_mirth_need_Need_NEEDz_TAGP(x1); - VAL v4 = (mw_mirth_need_ZPlusNeeds_needZBang(v3, x2)); + VAL v4 = mw_mirth_need_ZPlusNeeds_needZBang(v3, x2); return v4; } static void mw_mirth_need_ZPlusNeeds_determineZ_arrowZ_needsZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { @@ -66865,82 +47968,54 @@ static void mw_mirth_need_ZPlusNeeds_determineZ_arrowZ_needsZBang (VAL x1, VAL x *x4 = v8; } static void mw_mirth_need_ZPlusNeeds_determineZ_transitiveZ_needsZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { - VAL v5 = VVAL(VTUP(x2)->cells[1]); - incref(v5); - VAL v6; - VAL v7; - mw_std_list_List_1_uncons(v5, &v6, &v7); - VAL v8 = VTUP(x2)->cells[1]; - decref(v8); - VTUP(x2)->cells[1] = v7; - VAL x9; - VAL x10; - int64_t x11; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v6); - VAL v13; - VAL v14; - mw_mirth_need_ZPlusNeeds_runZ_needZBang(v12, x1, x2, &v13, &v14); - int64_t v15 = 1LL /* True */; - x11 = v15; - x10 = v14; - x9 = v13; - } break; - case 0LL: { // None - int64_t v16 = 0LL /* False */; - x11 = v16; - x10 = x2; - x9 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v17 = (x9); - VAL v18 = (x10); - int64_t v19 = x11; - while (((bool)v19)) { - VAL v20 = (v17); - VAL v21 = (v18); - VAL v22 = VVAL(VTUP(v21)->cells[1]); - incref(v22); - VAL v23; - VAL v24; - mw_std_list_List_1_uncons(v22, &v23, &v24); - VAL v25 = VTUP(v21)->cells[1]; - decref(v25); - VTUP(v21)->cells[1] = v24; - VAL x26; - VAL x27; - int64_t x28; - switch (get_data_tag(v23)) { + int64_t v5 = 1LL /* True */; + VAL v6 = x1; + VAL v7 = x2; + int64_t v8 = v5; + int64_t v9 = v5; + while (((bool)v9)) { + VAL v10 = v6; + VAL v11 = v7; + int64_t v12 = v8; + VAL v13 = VVAL(VTUP(v11)->cells[1]); + incref(v13); + VAL v14; + VAL v15; + mw_std_list_List_1_uncons(v13, &v14, &v15); + VAL v16 = VTUP(v11)->cells[1]; + decref(v16); + VTUP(v11)->cells[1] = v15; + VAL x17; + VAL x18; + int64_t x19; + switch (get_data_tag(v14)) { case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v23); - VAL v30; - VAL v31; - mw_mirth_need_ZPlusNeeds_runZ_needZBang(v29, v20, v21, &v30, &v31); - int64_t v32 = 1LL /* True */; - x28 = v32; - x27 = v31; - x26 = v30; + VAL v20 = mtp_std_maybe_Maybe_1_Some(v14); + VAL v21; + VAL v22; + mw_mirth_need_ZPlusNeeds_runZ_needZBang(v20, v10, v11, &v21, &v22); + int64_t v23 = 1LL /* True */; + x19 = v23; + x18 = v22; + x17 = v21; } break; case 0LL: { // None - int64_t v33 = 0LL /* False */; - x28 = v33; - x27 = v21; - x26 = v20; + int64_t v24 = 0LL /* False */; + x19 = v24; + x18 = v11; + x17 = v10; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v19 = x28; - v18 = x27; - v17 = x26; + v9 = x19; + v8 = x19; + v7 = x18; + v6 = x17; } - *x4 = v18; - *x3 = v17; + *x4 = v7; + *x3 = v6; } static void mw_mirth_need_ZPlusNeeds_runZ_needZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { VAL x6; @@ -66980,82 +48055,56 @@ static void mw_mirth_need_ZPlusNeeds_runZ_needZBang (VAL x1, VAL x2, VAL x3, VAL *x4 = x6; } static void mw_mirth_need_ZPlusNeeds_runZ_argsZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { - VAL v6; - VAL v7; - mw_std_list_List_1_uncons(x1, &v6, &v7); - VAL x8; - VAL x9; - VAL x10; - int64_t x11; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v6); - VAL v13; - VAL v14; - mw_mirth_need_ZPlusNeeds_runZ_argZBang(VU64(v12), x2, x3, &v13, &v14); - int64_t v15 = 1LL /* True */; - x11 = v15; - x10 = v7; - x9 = v14; - x8 = v13; - } break; - case 0LL: { // None - int64_t v16 = 0LL /* False */; - x11 = v16; - x10 = v7; - x9 = x3; - x8 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v17 = (x8); - VAL v18 = (x9); - VAL v19 = x10; - int64_t v20 = x11; - while (((bool)v20)) { - VAL v21 = (v17); - VAL v22 = (v18); - VAL v23 = v19; - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v23, &v24, &v25); - VAL x26; - VAL x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v24)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v24); - VAL v31; - VAL v32; - mw_mirth_need_ZPlusNeeds_runZ_argZBang(VU64(v30), v21, v22, &v31, &v32); - int64_t v33 = 1LL /* True */; - x29 = v33; - x28 = v25; - x27 = v32; - x26 = v31; + int64_t v6 = 1LL /* True */; + VAL v7 = x2; + VAL v8 = x3; + VAL v9 = x1; + int64_t v10 = v6; + int64_t v11 = v6; + while (((bool)v11)) { + VAL v12 = v7; + VAL v13 = v8; + VAL v14 = v9; + int64_t v15 = v10; + VAL x16; + VAL x17; + VAL x18; + int64_t x19; + switch (get_data_tag(v14)) { + case 1LL: { // Cons + VAL v20; + VAL v21; + mtp_std_list_List_1_Cons(v14, &v20, &v21); + VAL v22; + VAL v23; + mw_mirth_need_ZPlusNeeds_runZ_argZBang(VU64(v20), v12, v13, &v22, &v23); + int64_t v24 = 1LL /* True */; + x19 = v24; + x18 = v21; + x17 = v23; + x16 = v22; } break; - case 0LL: { // None - int64_t v34 = 0LL /* False */; - x29 = v34; - x28 = v25; - x27 = v22; - x26 = v21; + case 0LL: { // Nil + VAL v25 = MKI64(0LL /* Nil */); + int64_t v26 = 0LL /* False */; + x19 = v26; + x18 = v25; + x17 = v13; + x16 = v12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v20 = x29; - v19 = x28; - v18 = x27; - v17 = x26; + v11 = x19; + v10 = x19; + v9 = x18; + v8 = x17; + v7 = x16; } - decref(v19); - *x5 = v18; - *x4 = v17; + decref(v9); + *x5 = v8; + *x4 = v7; } static void mw_mirth_need_ZPlusNeeds_runZ_argZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { VAL v6; @@ -67088,82 +48137,56 @@ static void mw_mirth_need_ZPlusNeeds_runZ_arrowZBang (VAL x1, VAL x2, VAL x3, VA VAL v6 = VVAL(VTUP(x1)->cells[7]); incref(v6); decref(x1); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v6, &v7, &v8); - VAL x9; - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v14; - VAL v15; - mw_mirth_need_ZPlusNeeds_runZ_atomZBang(v13, x2, x3, &v14, &v15); - int64_t v16 = 1LL /* True */; - x12 = v16; - x11 = v8; - x10 = v15; - x9 = v14; - } break; - case 0LL: { // None - int64_t v17 = 0LL /* False */; - x12 = v17; - x11 = v8; - x10 = x3; - x9 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v18 = (x9); - VAL v19 = (x10); - VAL v20 = x11; - int64_t v21 = x12; - while (((bool)v21)) { - VAL v22 = (v18); - VAL v23 = (v19); - VAL v24 = v20; - VAL v25; - VAL v26; - mw_std_list_List_1_uncons(v24, &v25, &v26); - VAL x27; - VAL x28; - VAL x29; - int64_t x30; - switch (get_data_tag(v25)) { - case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v25); - VAL v32; - VAL v33; - mw_mirth_need_ZPlusNeeds_runZ_atomZBang(v31, v22, v23, &v32, &v33); - int64_t v34 = 1LL /* True */; - x30 = v34; - x29 = v26; - x28 = v33; - x27 = v32; + int64_t v7 = 1LL /* True */; + VAL v8 = x2; + VAL v9 = x3; + VAL v10 = v6; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + VAL v13 = v8; + VAL v14 = v9; + VAL v15 = v10; + int64_t v16 = v11; + VAL x17; + VAL x18; + VAL x19; + int64_t x20; + switch (get_data_tag(v15)) { + case 1LL: { // Cons + VAL v21; + VAL v22; + mtp_std_list_List_1_Cons(v15, &v21, &v22); + VAL v23; + VAL v24; + mw_mirth_need_ZPlusNeeds_runZ_atomZBang(v21, v13, v14, &v23, &v24); + int64_t v25 = 1LL /* True */; + x20 = v25; + x19 = v22; + x18 = v24; + x17 = v23; } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x30 = v35; - x29 = v26; - x28 = v23; - x27 = v22; + case 0LL: { // Nil + VAL v26 = MKI64(0LL /* Nil */); + int64_t v27 = 0LL /* False */; + x20 = v27; + x19 = v26; + x18 = v14; + x17 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v21 = x30; - v20 = x29; - v19 = x28; - v18 = x27; + v12 = x20; + v11 = x20; + v10 = x19; + v9 = x18; + v8 = x17; } - decref(v20); - *x5 = v19; - *x4 = v18; + decref(v10); + *x5 = v9; + *x4 = v8; } static void mw_mirth_need_ZPlusNeeds_runZ_atomZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { incref(x1); @@ -67221,7 +48244,7 @@ static void mw_mirth_need_ZPlusNeeds_runZ_opZBang (VAL x1, VAL x2, VAL x3, VAL x x15 = v17; x14 = x1; } else { - VAL v19 = (mw_mirth_need_ZPlusNeeds_needZ_wordZBang(v12, x4)); + VAL v19 = mw_mirth_need_ZPlusNeeds_needZ_wordZBang(v12, x4); x16 = v19; x15 = x3; x14 = x1; @@ -67266,7 +48289,7 @@ static void mw_mirth_need_ZPlusNeeds_runZ_opZBang (VAL x1, VAL x2, VAL x3, VAL x } break; case 10LL: { // OpTag uint64_t v34 = mtp_mirth_arrow_Op_OpTag(x2); - VAL v35 = (mw_mirth_need_ZPlusNeeds_needZ_tagZ_wordZBang(v34, x4)); + VAL v35 = mw_mirth_need_ZPlusNeeds_needZ_tagZ_wordZBang(v34, x4); VAL v36; VAL v37; mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, v35, &v36, &v37); @@ -67387,125 +48410,109 @@ static void mw_mirth_need_ZPlusNeeds_runZ_primZBang (VAL x1, int64_t x2, VAL x3, case 5LL: { // PRIM_CORE_DIP incref(x1); VAL v9 = mw_std_list_List_1_ZDivL1(x1); - VAL x10; - VAL x11; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v9); - decref(v12); - VAL v13; - VAL v14; - mw_mirth_need_ZPlusNeeds_runZ_argsZBang(x1, x3, x4, &v13, &v14); - x11 = v14; - x10 = v13; - } break; - case 0LL: { // None - VAL v15; - VAL v16; - mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v15, &v16); - x11 = v16; - x10 = v15; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v10 = get_data_tag(v9); + decref(v9); + int64_t v11 = 1LL; + bool v12 = (v10 == v11); + VAL x13; + VAL x14; + if (v12) { + VAL v15; + VAL v16; + mw_mirth_need_ZPlusNeeds_runZ_argsZBang(x1, x3, x4, &v15, &v16); + x14 = v16; + x13 = v15; + } else { + VAL v17; + VAL v18; + mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v17, &v18); + x14 = v18; + x13 = v17; } - x8 = x11; - x7 = x10; + x8 = x14; + x7 = x13; } break; case 6LL: { // PRIM_CORE_RDIP incref(x1); - VAL v17 = mw_std_list_List_1_ZDivL1(x1); - VAL x18; - VAL x19; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v20 = mtp_std_maybe_Maybe_1_Some(v17); - decref(v20); - VAL v21; - VAL v22; - mw_mirth_need_ZPlusNeeds_runZ_argsZBang(x1, x3, x4, &v21, &v22); - x19 = v22; - x18 = v21; - } break; - case 0LL: { // None - VAL v23; - VAL v24; - mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v23, &v24); - x19 = v24; - x18 = v23; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + VAL v19 = mw_std_list_List_1_ZDivL1(x1); + int64_t v20 = get_data_tag(v19); + decref(v19); + int64_t v21 = 1LL; + bool v22 = (v20 == v21); + VAL x23; + VAL x24; + if (v22) { + VAL v25; + VAL v26; + mw_mirth_need_ZPlusNeeds_runZ_argsZBang(x1, x3, x4, &v25, &v26); + x24 = v26; + x23 = v25; + } else { + VAL v27; + VAL v28; + mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v27, &v28); + x24 = v28; + x23 = v27; } - x8 = x19; - x7 = x18; + x8 = x24; + x7 = x23; } break; case 7LL: { // PRIM_CORE_IF incref(x1); - VAL v25 = mw_std_list_List_1_ZDivL2(x1); - VAL x26; - VAL x27; - switch (get_data_tag(v25)) { - case 1LL: { // Some - VAL v28 = mtp_std_maybe_Maybe_1_Some(v25); - decref(v28); - VAL v29; - VAL v30; - mw_mirth_need_ZPlusNeeds_runZ_argsZBang(x1, x3, x4, &v29, &v30); - x27 = v30; - x26 = v29; - } break; - case 0LL: { // None - VAL v31; - VAL v32; - mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v31, &v32); - x27 = v32; - x26 = v31; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + VAL v29 = mw_std_list_List_1_ZDivL2(x1); + int64_t v30 = get_data_tag(v29); + decref(v29); + int64_t v31 = 1LL; + bool v32 = (v30 == v31); + VAL x33; + VAL x34; + if (v32) { + VAL v35; + VAL v36; + mw_mirth_need_ZPlusNeeds_runZ_argsZBang(x1, x3, x4, &v35, &v36); + x34 = v36; + x33 = v35; + } else { + VAL v37; + VAL v38; + mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v37, &v38); + x34 = v38; + x33 = v37; } - x8 = x27; - x7 = x26; + x8 = x34; + x7 = x33; } break; case 8LL: { // PRIM_CORE_WHILE incref(x1); - VAL v33 = mw_std_list_List_1_ZDivL2(x1); - VAL x34; - VAL x35; - switch (get_data_tag(v33)) { - case 1LL: { // Some - VAL v36 = mtp_std_maybe_Maybe_1_Some(v33); - decref(v36); - VAL v37; - VAL v38; - mw_mirth_need_ZPlusNeeds_runZ_argsZBang(x1, x3, x4, &v37, &v38); - x35 = v38; - x34 = v37; - } break; - case 0LL: { // None - VAL v39; - VAL v40; - mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v39, &v40); - x35 = v40; - x34 = v39; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + VAL v39 = mw_std_list_List_1_ZDivL2(x1); + int64_t v40 = get_data_tag(v39); + decref(v39); + int64_t v41 = 1LL; + bool v42 = (v40 == v41); + VAL x43; + VAL x44; + if (v42) { + VAL v45; + VAL v46; + mw_mirth_need_ZPlusNeeds_runZ_argsZBang(x1, x3, x4, &v45, &v46); + x44 = v46; + x43 = v45; + } else { + VAL v47; + VAL v48; + mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v47, &v48); + x44 = v48; + x43 = v47; } - x8 = x35; - x7 = x34; + x8 = x44; + x7 = x43; } break; default: { - VAL v41; - VAL v42; - mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v41, &v42); - x8 = v42; - x7 = v41; + VAL v49; + VAL v50; + mw_mirth_need_ZPlusNeeds_pushZ_argsZBang(x1, x3, x4, &v49, &v50); + x8 = v50; + x7 = v49; } break; } *x6 = x8; @@ -67515,82 +48522,56 @@ static void mw_mirth_need_ZPlusNeeds_runZ_matchZBang (VAL x1, VAL x2, VAL x3, VA VAL v6 = VVAL(VTUP(x1)->cells[7]); incref(v6); decref(x1); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v6, &v7, &v8); - VAL x9; - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v14; - VAL v15; - mw_mirth_need_ZPlusNeeds_runZ_caseZBang(v13, x2, x3, &v14, &v15); - int64_t v16 = 1LL /* True */; - x12 = v16; - x11 = v8; - x10 = v15; - x9 = v14; - } break; - case 0LL: { // None - int64_t v17 = 0LL /* False */; - x12 = v17; - x11 = v8; - x10 = x3; - x9 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v18 = (x9); - VAL v19 = (x10); - VAL v20 = x11; - int64_t v21 = x12; - while (((bool)v21)) { - VAL v22 = (v18); - VAL v23 = (v19); - VAL v24 = v20; - VAL v25; - VAL v26; - mw_std_list_List_1_uncons(v24, &v25, &v26); - VAL x27; - VAL x28; - VAL x29; - int64_t x30; - switch (get_data_tag(v25)) { - case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v25); - VAL v32; - VAL v33; - mw_mirth_need_ZPlusNeeds_runZ_caseZBang(v31, v22, v23, &v32, &v33); - int64_t v34 = 1LL /* True */; - x30 = v34; - x29 = v26; - x28 = v33; - x27 = v32; + int64_t v7 = 1LL /* True */; + VAL v8 = x2; + VAL v9 = x3; + VAL v10 = v6; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + VAL v13 = v8; + VAL v14 = v9; + VAL v15 = v10; + int64_t v16 = v11; + VAL x17; + VAL x18; + VAL x19; + int64_t x20; + switch (get_data_tag(v15)) { + case 1LL: { // Cons + VAL v21; + VAL v22; + mtp_std_list_List_1_Cons(v15, &v21, &v22); + VAL v23; + VAL v24; + mw_mirth_need_ZPlusNeeds_runZ_caseZBang(v21, v13, v14, &v23, &v24); + int64_t v25 = 1LL /* True */; + x20 = v25; + x19 = v22; + x18 = v24; + x17 = v23; } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x30 = v35; - x29 = v26; - x28 = v23; - x27 = v22; + case 0LL: { // Nil + VAL v26 = MKI64(0LL /* Nil */); + int64_t v27 = 0LL /* False */; + x20 = v27; + x19 = v26; + x18 = v14; + x17 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v21 = x30; - v20 = x29; - v19 = x28; - v18 = x27; + v12 = x20; + v11 = x20; + v10 = x19; + v9 = x18; + v8 = x17; } - decref(v20); - *x5 = v19; - *x4 = v18; + decref(v10); + *x5 = v9; + *x4 = v8; } static void mw_mirth_need_ZPlusNeeds_runZ_caseZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { incref(x1); @@ -67623,82 +48604,56 @@ static void mw_mirth_need_ZPlusNeeds_runZ_patternZBang (VAL x1, VAL x2, VAL x3, VAL v6 = VVAL(VTUP(x1)->cells[9]); incref(v6); decref(x1); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v6, &v7, &v8); - VAL x9; - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v14; - VAL v15; - mw_mirth_need_ZPlusNeeds_runZ_patatomZBang(v13, x2, x3, &v14, &v15); - int64_t v16 = 1LL /* True */; - x12 = v16; - x11 = v8; - x10 = v15; - x9 = v14; - } break; - case 0LL: { // None - int64_t v17 = 0LL /* False */; - x12 = v17; - x11 = v8; - x10 = x3; - x9 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v18 = (x9); - VAL v19 = (x10); - VAL v20 = x11; - int64_t v21 = x12; - while (((bool)v21)) { - VAL v22 = (v18); - VAL v23 = (v19); - VAL v24 = v20; - VAL v25; - VAL v26; - mw_std_list_List_1_uncons(v24, &v25, &v26); - VAL x27; - VAL x28; - VAL x29; - int64_t x30; - switch (get_data_tag(v25)) { - case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v25); - VAL v32; - VAL v33; - mw_mirth_need_ZPlusNeeds_runZ_patatomZBang(v31, v22, v23, &v32, &v33); - int64_t v34 = 1LL /* True */; - x30 = v34; - x29 = v26; - x28 = v33; - x27 = v32; + int64_t v7 = 1LL /* True */; + VAL v8 = x2; + VAL v9 = x3; + VAL v10 = v6; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + VAL v13 = v8; + VAL v14 = v9; + VAL v15 = v10; + int64_t v16 = v11; + VAL x17; + VAL x18; + VAL x19; + int64_t x20; + switch (get_data_tag(v15)) { + case 1LL: { // Cons + VAL v21; + VAL v22; + mtp_std_list_List_1_Cons(v15, &v21, &v22); + VAL v23; + VAL v24; + mw_mirth_need_ZPlusNeeds_runZ_patatomZBang(v21, v13, v14, &v23, &v24); + int64_t v25 = 1LL /* True */; + x20 = v25; + x19 = v22; + x18 = v24; + x17 = v23; } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x30 = v35; - x29 = v26; - x28 = v23; - x27 = v22; + case 0LL: { // Nil + VAL v26 = MKI64(0LL /* Nil */); + int64_t v27 = 0LL /* False */; + x20 = v27; + x19 = v26; + x18 = v14; + x17 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v21 = x30; - v20 = x29; - v19 = x28; - v18 = x27; + v12 = x20; + v11 = x20; + v10 = x19; + v9 = x18; + v8 = x17; } - decref(v20); - *x5 = v19; - *x4 = v18; + decref(v10); + *x5 = v9; + *x4 = v8; } static void mw_mirth_need_ZPlusNeeds_runZ_patatomZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { VAL v6 = VVAL(VTUP(x1)->cells[7]); @@ -67713,7 +48668,7 @@ static void mw_mirth_need_ZPlusNeeds_runZ_patatomZBang (VAL x1, VAL x2, VAL x3, } break; case 1LL: { // PatOpTag uint64_t v9 = mtp_mirth_match_PatternOp_PatOpTag(v6); - VAL v10 = (mw_mirth_need_ZPlusNeeds_needZ_tagZ_patZBang(v9, x3)); + VAL v10 = mw_mirth_need_ZPlusNeeds_needZ_tagZ_patZBang(v9, x3); x8 = v10; x7 = x2; } break; @@ -67725,82 +48680,56 @@ static void mw_mirth_need_ZPlusNeeds_runZ_patatomZBang (VAL x1, VAL x2, VAL x3, *x4 = x7; } static void mw_mirth_need_ZPlusNeeds_pushZ_argsZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { - VAL v6; - VAL v7; - mw_std_list_List_1_uncons(x1, &v6, &v7); - VAL x8; - VAL x9; - VAL x10; - int64_t x11; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v12 = mtp_std_maybe_Maybe_1_Some(v6); - VAL v13; - VAL v14; - mw_mirth_need_ZPlusNeeds_pushZ_argZBang(VU64(v12), x2, x3, &v13, &v14); - int64_t v15 = 1LL /* True */; - x11 = v15; - x10 = v7; - x9 = v14; - x8 = v13; - } break; - case 0LL: { // None - int64_t v16 = 0LL /* False */; - x11 = v16; - x10 = v7; - x9 = x3; - x8 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v17 = (x8); - VAL v18 = (x9); - VAL v19 = x10; - int64_t v20 = x11; - while (((bool)v20)) { - VAL v21 = (v17); - VAL v22 = (v18); - VAL v23 = v19; - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v23, &v24, &v25); - VAL x26; - VAL x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v24)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v24); - VAL v31; - VAL v32; - mw_mirth_need_ZPlusNeeds_pushZ_argZBang(VU64(v30), v21, v22, &v31, &v32); - int64_t v33 = 1LL /* True */; - x29 = v33; - x28 = v25; - x27 = v32; - x26 = v31; + int64_t v6 = 1LL /* True */; + VAL v7 = x2; + VAL v8 = x3; + VAL v9 = x1; + int64_t v10 = v6; + int64_t v11 = v6; + while (((bool)v11)) { + VAL v12 = v7; + VAL v13 = v8; + VAL v14 = v9; + int64_t v15 = v10; + VAL x16; + VAL x17; + VAL x18; + int64_t x19; + switch (get_data_tag(v14)) { + case 1LL: { // Cons + VAL v20; + VAL v21; + mtp_std_list_List_1_Cons(v14, &v20, &v21); + VAL v22; + VAL v23; + mw_mirth_need_ZPlusNeeds_pushZ_argZBang(VU64(v20), v12, v13, &v22, &v23); + int64_t v24 = 1LL /* True */; + x19 = v24; + x18 = v21; + x17 = v23; + x16 = v22; } break; - case 0LL: { // None - int64_t v34 = 0LL /* False */; - x29 = v34; - x28 = v25; - x27 = v22; - x26 = v21; + case 0LL: { // Nil + VAL v25 = MKI64(0LL /* Nil */); + int64_t v26 = 0LL /* False */; + x19 = v26; + x18 = v25; + x17 = v13; + x16 = v12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v20 = x29; - v19 = x28; - v18 = x27; - v17 = x26; + v11 = x19; + v10 = x19; + v9 = x18; + v8 = x17; + v7 = x16; } - decref(v19); - *x5 = v18; - *x4 = v17; + decref(v9); + *x5 = v8; + *x4 = v7; } static void mw_mirth_need_ZPlusNeeds_pushZ_argZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { VAL v6; @@ -67823,7 +48752,7 @@ static void mw_mirth_need_ZPlusNeeds_pushZ_blockZBang (uint64_t x1, VAL x2, VAL x8 = v6; } break; case 0LL: { // None - VAL v11 = (mw_mirth_need_ZPlusNeeds_needZ_blockZBang(x1, x3)); + VAL v11 = mw_mirth_need_ZPlusNeeds_needZ_blockZBang(x1, x3); x9 = v11; x8 = v6; } break; @@ -67835,108 +48764,85 @@ static void mw_mirth_need_ZPlusNeeds_pushZ_blockZBang (uint64_t x1, VAL x2, VAL *x4 = x8; } static VAL mw_mirth_c99_ZPlusC99_put (VAL x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[5])); - VAL v4 = (mw_std_output_ZPlusOutput_put(x1, v3)); - VTUP(x2)->cells[5] = v4; - return x2; + int64_t v3 = VI64(VTUP(x2)->cells[4]); + VAL x4; + if (((bool)v3)) { + VAL v5 = VVAL(VTUP(x2)->cells[6]); + VAL v6 = mw_std_output_ZPlusOutput_put(x1, v5); + VTUP(x2)->cells[6] = v6; + x4 = x2; + } else { + decref(x1); + x4 = x2; + } + return x4; } static VAL mw_mirth_c99_ZPlusC99_putZ_byte (int64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[5])); - VAL v4 = (mw_std_output_ZPlusOutput_putZ_byte(x1, v3)); - VTUP(x2)->cells[5] = v4; - return x2; + int64_t v3 = VI64(VTUP(x2)->cells[4]); + VAL x4; + if (((bool)v3)) { + VAL v5 = VVAL(VTUP(x2)->cells[6]); + VAL v6 = mw_std_output_ZPlusOutput_putZ_byte(x1, v5); + VTUP(x2)->cells[6] = v6; + x4 = x2; + } else { + x4 = x2; + } + return x4; } static VAL mw_mirth_c99_ZPlusC99_line (VAL x1) { - VAL v2 = (VVAL(VTUP(x1)->cells[5])); - VAL v3 = (mw_std_output_ZPlusOutput_line(v2)); - VTUP(x1)->cells[5] = v3; - return x1; + int64_t v2 = VI64(VTUP(x1)->cells[4]); + VAL x3; + if (((bool)v2)) { + VAL v4 = VVAL(VTUP(x1)->cells[6]); + VAL v5 = mw_std_output_ZPlusOutput_line(v4); + VTUP(x1)->cells[6] = v5; + x3 = x1; + } else { + x3 = x1; + } + return x3; } static void mw_mirth_c99_c99Z_startZBang (VAL x1, VAL x2, int64_t x3, VAL x4, VAL *x5, int64_t *x6, VAL *x7) { int64_t v8 = 0LL; int64_t v9 = 0LL; - VAL v10 = (mw_mirth_need_ZPlusNeeds_new()); + int64_t v10 = 1LL /* True */; + VAL v11 = mw_mirth_need_ZPlusNeeds_new(); incref(x1); - VAL v11; VAL v12; - mw_mirth_need_ZPlusNeeds_determineZ_arrowZ_needsZBang(x1, x4, v10, &v11, &v12); + VAL v13; + mw_mirth_need_ZPlusNeeds_determineZ_arrowZ_needsZBang(x1, x4, v11, &v12, &v13); incref(x2); - VAL v13 = VVAL(VTUP(x2)->cells[1]); - incref(v13); + VAL v14 = VVAL(VTUP(x2)->cells[1]); + incref(v14); decref(x2); - int64_t v14; - VAL v15; - mw_std_prim_ZPlusWorld_createZ_fileZBang(v13, x3, &v14, &v15); - int64_t x16; - int64_t x17; - VAL x18; - VAL x19; - VAL x20; - VAL x21; - int64_t x22; - VAL x23; - switch (get_data_tag(v15)) { - case 0LL: { // +FileOk - VAL v24 = (mtp_std_file_ZPlusFileZAsk_ZPlusFileOk(v15)); - x23 = v24; - x22 = v14; - x21 = x2; - x20 = v11; - x19 = v12; - x18 = x1; - x17 = v9; - x16 = v8; - } break; - case 1LL: { // +FileErr - VAL v25 = mtp_std_file_ZPlusFileZAsk_ZPlusFileErr(v15); - lpush(&lbl_depth, MKI64(v8)); - lpush(&lbl_freshZ_counter, MKI64(v9)); - push_value(x1); - lpush(&lbl_ZPlusneeds, v12); - lpush(&lbl_options, x2); - push_resource(MKI64(v14)); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(v25, v11); - VAL r26 = pop_resource(); - x23 = r26; - int64_t r27 = VI64(pop_resource()); - x22 = r27; - VAL v28 = lpop(&lbl_options); - x21 = v28; - VAL v29 = (lpop(&lbl_ZPlusmirth)); - x20 = v29; - VAL v30 = (lpop(&lbl_ZPlusneeds)); - x19 = v30; - VAL v31 = pop_value(); - x18 = v31; - int64_t v32 = VI64(lpop(&lbl_freshZ_counter)); - x17 = v32; - int64_t v33 = VI64(lpop(&lbl_depth)); - x16 = v33; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v34 = (mw_std_output_ZPlusOutput_startZBang(x23)); - VAL v35 = (mtw_mirth_c99_ZPlusC99_ZPlusC99(x21, x16, x17, x19, v34, x20)); - *x7 = v35; - *x6 = x22; - *x5 = x18; + int64_t v15; + VAL v16; + mw_std_prim_ZPlusWorld_createZ_fileZBang(v14, x3, &v15, &v16); + VAL v17; + VAL v18; + mw_std_file_ZPlusFileZAsk_unwrapZBang_1_sp1(v12, v16, &v17, &v18); + VAL v19 = mw_std_output_ZPlusOutput_startZBang(v18); + VAL v20 = mtw_mirth_c99_ZPlusC99_ZPlusC99(x2, v8, v9, v10, v13, v19, v17); + *x7 = v20; + *x6 = v15; + *x5 = x1; } static void mw_mirth_c99_c99Z_endZBang (int64_t x1, VAL x2, int64_t *x3, VAL *x4) { VAL v5; int64_t v6; int64_t v7; - VAL v8; + int64_t v8; VAL v9; VAL v10; - mtp_mirth_c99_ZPlusC99_ZPlusC99(x2, &v5, &v6, &v7, &v8, &v9, &v10); + VAL v11; + mtp_mirth_c99_ZPlusC99_ZPlusC99(x2, &v5, &v6, &v7, &v8, &v9, &v10, &v11); decref(v5); - mw_mirth_need_ZPlusNeeds_rdrop(v8); - VAL v11 = (mw_std_output_ZPlusOutput_endZBang(v9)); - int64_t v12 = (mw_std_file_ZPlusFile_closeZ_fileZBang(x1, v11)); - *x4 = v10; - *x3 = v12; + mw_mirth_need_ZPlusNeeds_rdrop(v9); + VAL v12 = mw_std_output_ZPlusOutput_endZBang(v10); + int64_t v13 = mw_std_file_ZPlusFile_closeZ_fileZBang(x1, v12); + *x4 = v11; + *x3 = v13; } static VAL mw_mirth_c99_ZPlusC99_resetZ_freshZ_counterZBang (VAL x1) { int64_t v2 = 0LL; @@ -67994,33 +48900,35 @@ static void mw_mirth_c99_runZ_outputZ_c99ZBang (VAL x1, VAL x2, int64_t x3, VAL int64_t x10; VAL x11; if (v9) { + STR* v12; + STRLIT(v12, "There were errors, so codegen stopped.", 38); + int64_t v13 = mw_std_prim_ZPlusWorld_trace(MKSTR(v12), x3); + mw_mirth_mirth_ZPlusMirth_panicZ_diagnosticsZBang(x4); decref(x2); decref(x1); - x11 = x4; - x10 = x3; } else { - VAL v12; - int64_t v13; - VAL v14; - mw_mirth_c99_c99Z_startZBang(x1, x2, x3, x4, &v12, &v13, &v14); - VAL v15 = (mw_mirth_c99_c99Z_headerZBang(v14)); - VAL v16 = (mw_mirth_c99_c99Z_labelZ_defsZBang(v15)); - VAL v17 = (mw_mirth_c99_c99Z_tagZ_defsZBang(v16)); - VAL v18 = (mw_mirth_c99_c99Z_buffersZBang(v17)); - VAL v19 = (mw_mirth_c99_c99Z_variablesZBang(v18)); - VAL v20 = (mw_mirth_c99_c99Z_externalZ_blocksZBang(v19)); - VAL v21 = (mw_mirth_c99_c99Z_wordZ_sigsZBang(v20)); - VAL v22 = (mw_mirth_c99_c99Z_blockZ_sigsZBang(v21)); - VAL v23 = (mw_mirth_c99_c99Z_fieldZ_sigsZBang(v22)); - VAL v24 = (mw_mirth_c99_c99Z_mainZBang(v12, v23)); - VAL v25 = (mw_mirth_c99_c99Z_fieldZ_defsZBang(v24)); - VAL v26 = (mw_mirth_c99_c99Z_wordZ_defsZBang(v25)); - VAL v27 = (mw_mirth_c99_c99Z_blockZ_defsZBang(v26)); - int64_t v28; - VAL v29; - mw_mirth_c99_c99Z_endZBang(v13, v27, &v28, &v29); - x11 = v29; - x10 = v28; + VAL v15; + int64_t v16; + VAL v17; + mw_mirth_c99_c99Z_startZBang(x1, x2, x3, x4, &v15, &v16, &v17); + VAL v18 = mw_mirth_c99_c99Z_headerZBang(v17); + VAL v19 = mw_mirth_c99_c99Z_labelZ_defsZBang(v18); + VAL v20 = mw_mirth_c99_c99Z_tagZ_defsZBang(v19); + VAL v21 = mw_mirth_c99_c99Z_buffersZBang(v20); + VAL v22 = mw_mirth_c99_c99Z_variablesZBang(v21); + VAL v23 = mw_mirth_c99_c99Z_externalZ_blocksZBang(v22); + VAL v24 = mw_mirth_c99_c99Z_wordZ_sigsZBang(v23); + VAL v25 = mw_mirth_c99_c99Z_blockZ_sigsZBang(v24); + VAL v26 = mw_mirth_c99_c99Z_fieldZ_sigsZBang(v25); + VAL v27 = mw_mirth_c99_c99Z_mainZBang(v15, v26); + VAL v28 = mw_mirth_c99_c99Z_fieldZ_defsZBang(v27); + VAL v29 = mw_mirth_c99_c99Z_wordZ_defsZBang(v28); + VAL v30 = mw_mirth_c99_c99Z_blockZ_defsZBang(v29); + int64_t v31; + VAL v32; + mw_mirth_c99_c99Z_endZBang(v16, v30, &v31, &v32); + x11 = v32; + x10 = v31; } *x6 = x11; *x5 = x10; @@ -68041,12 +48949,12 @@ static void mw_mirth_data_Tag_wordZ_cname (VAL x1, uint64_t x2, VAL *x3, VAL *x4 STRLIT(v11, "", 0); STR* v12; STRLIT(v12, "mtw_", 4); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), MKSTR(v11))); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), MKSTR(v11)); VAL v14 = mw_mirth_data_Tag_qname(x2); VAL v15; VAL v16; mw_mirth_name_QName_mangled(x1, v14, &v15, &v16); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(v16, v13)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(v16, v13); incref(v17); mut_set(v17, v5); x9 = v17; @@ -68072,12 +48980,12 @@ static void mw_mirth_data_Tag_patZ_cname (VAL x1, uint64_t x2, VAL *x3, VAL *x4) STRLIT(v11, "", 0); STR* v12; STRLIT(v12, "mtp_", 4); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), MKSTR(v11))); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), MKSTR(v11)); VAL v14 = mw_mirth_data_Tag_qname(x2); VAL v15; VAL v16; mw_mirth_name_QName_mangled(x1, v14, &v15, &v16); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(v16, v13)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(v16, v13); incref(v17); mut_set(v17, v5); x9 = v17; @@ -68103,12 +49011,12 @@ static void mw_mirth_buffer_Buffer_cname (VAL x1, uint64_t x2, VAL *x3, VAL *x4) STRLIT(v11, "", 0); STR* v12; STRLIT(v12, "mbuf_", 5); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), MKSTR(v11))); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), MKSTR(v11)); VAL v14 = mw_mirth_buffer_Buffer_qname(x2); VAL v15; VAL v16; mw_mirth_name_QName_mangled(x1, v14, &v15, &v16); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(v16, v13)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(v16, v13); incref(v17); mut_set(v17, v5); x9 = v17; @@ -68134,12 +49042,12 @@ static void mw_mirth_variable_Variable_cname (VAL x1, uint64_t x2, VAL *x3, VAL STRLIT(v11, "", 0); STR* v12; STRLIT(v12, "mvar_", 5); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), MKSTR(v11))); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), MKSTR(v11)); VAL v14 = mw_mirth_variable_Variable_qname(x2); VAL v15; VAL v16; mw_mirth_name_QName_mangled(x1, v14, &v15, &v16); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(v16, v13)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(v16, v13); incref(v17); mut_set(v17, v5); x9 = v17; @@ -68171,8 +49079,8 @@ static void mw_mirth_table_Field_cname (VAL x1, uint64_t x2, VAL *x3, VAL *x4) { STRLIT(v15, "", 0); STR* v16; STRLIT(v16, "mfld_", 5); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), MKSTR(v15))); - VAL v18 = (mw_std_str_ZPlusStr_pushZ_strZBang(v14, v17)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), MKSTR(v15)); + VAL v18 = mw_std_str_ZPlusStr_pushZ_strZBang(v14, v17); incref(v18); mut_set(v18, v5); x9 = v18; @@ -68204,8 +49112,8 @@ static void mw_mirth_external_External_cname (VAL x1, uint64_t x2, VAL *x3, VAL STRLIT(v15, "", 0); STR* v16; STRLIT(v16, "mext_", 5); - VAL v17 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), MKSTR(v15))); - VAL v18 = (mw_std_str_ZPlusStr_pushZ_strZBang(v14, v17)); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), MKSTR(v15)); + VAL v18 = mw_std_str_ZPlusStr_pushZ_strZBang(v14, v17); incref(v18); mut_set(v18, v5); x9 = v18; @@ -68218,11 +49126,11 @@ static void mw_mirth_external_External_cname (VAL x1, uint64_t x2, VAL *x3, VAL static VAL mw_mirth_c99_ZPlusC99_sigZ_put (VAL x1, VAL x2) { STR* v3; STRLIT(v3, "static void ", 12); - VAL v4 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2)); - VAL v5 = (mw_mirth_c99_ZPlusC99_put(x1, v4)); + VAL v4 = mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2); + VAL v5 = mw_mirth_c99_ZPlusC99_put(x1, v4); STR* v6; STRLIT(v6, " (void)", 7); - VAL v7 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5)); + VAL v7 = mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5); return v7; } static VAL mw_mirth_c99_c99Z_headerZ_str (void) { @@ -69206,7 +50114,7 @@ static VAL mw_mirth_c99_c99Z_headerZ_str (void) { static VAL mw_mirth_c99_c99Z_headerZBang (VAL x1) { STR* v2; STRLIT(v2, "#define MIRTH_DEBUG ", 20); - VAL v3 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v2), x1)); + VAL v3 = mw_mirth_c99_ZPlusC99_put(MKSTR(v2), x1); VAL v4 = VVAL(VTUP(v3)->cells[1]); incref(v4); int64_t v5 = VI64(VTUP(v4)->cells[2]); @@ -69224,11 +50132,11 @@ static VAL mw_mirth_c99_c99Z_headerZBang (VAL x1) { x7 = MKSTR(v9); x6 = v3; } - VAL v10 = (mw_mirth_c99_ZPlusC99_put(x7, x6)); - VAL v11 = (mw_mirth_c99_ZPlusC99_line(v10)); + VAL v10 = mw_mirth_c99_ZPlusC99_put(x7, x6); + VAL v11 = mw_mirth_c99_ZPlusC99_line(v10); VAL v12 = mw_mirth_c99_c99Z_headerZ_str(); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(v12, v11)); - VAL v14 = (mw_mirth_c99_ZPlusC99_line(v13)); + VAL v13 = mw_mirth_c99_ZPlusC99_put(v12, v11); + VAL v14 = mw_mirth_c99_ZPlusC99_line(v13); return v14; } static VAL mw_mirth_c99_c99Z_buffersZBang (VAL x1) { @@ -69236,13 +50144,13 @@ static VAL mw_mirth_c99_c99Z_buffersZBang (VAL x1) { void* v3 = mbuf_mirth_buffer_Buffer_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (mw_mirth_c99_c99Z_bufferZBang(((uint64_t)v10), v9)); + VAL v11 = mw_mirth_c99_c99Z_bufferZBang(((uint64_t)v10), v9); int64_t v12 = 1LL; int64_t v13 = i64_add(v10, v12); void* v14 = mbuf_mirth_buffer_Buffer_NUM; @@ -69257,71 +50165,75 @@ static VAL mw_mirth_c99_c99Z_buffersZBang (VAL x1) { static VAL mw_mirth_c99_c99Z_bufferZBang (uint64_t x1, VAL x2) { STR* v3; STRLIT(v3, "static char ", 12); - VAL v4 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2)); - VAL v5 = (VVAL(VTUP(v4)->cells[6])); + VAL v4 = mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2); + VAL v5 = VVAL(VTUP(v4)->cells[7]); VAL v6; VAL v7; mw_mirth_buffer_Buffer_cname(v5, x1, &v6, &v7); - VTUP(v4)->cells[6] = v6; - VAL v8 = (mw_mirth_c99_ZPlusC99_put(v7, v4)); + VTUP(v4)->cells[7] = v6; + VAL v8 = mw_mirth_c99_ZPlusC99_put(v7, v4); STR* v9; STRLIT(v9, "[", 1); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8)); + VAL v10 = mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8); int64_t v11 = mw_mirth_buffer_Buffer_sizze(x1); STR* v12 = i64_show(v11); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v10)); + VAL v13 = mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v10); STR* v14; STRLIT(v14, "] = {0};", 8); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13)); - VAL v16 = (mw_mirth_c99_ZPlusC99_line(v15)); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13); + VAL v16 = mw_mirth_c99_ZPlusC99_line(v15); return v16; } static VAL mw_mirth_c99_c99Z_bufferZ_callZBang (uint64_t x1, VAL x2) { int64_t v3 = 13LL /* C99RT_PTR */; - VAL v4 = (VVAL(VTUP(x2)->cells[1])); + VAL v4 = VVAL(VTUP(x2)->cells[1]); VAL v5; VAL v6; mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v4, &v5, &v6); - VAL v7 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v3, v5)); - VAL v8 = (mw_mirth_c99_ZPlusC99_indent(v6)); - int64_t v9 = VI64(VTUP(v7)->cells[1]); - VAL v10 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v9); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(v10, v8)); - STR* v12; - STRLIT(v12, " ", 1); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11)); - VAL v14 = VVAL(VTUP(v7)->cells[2]); - incref(v14); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(v14, v13)); + VTUP(x2)->cells[1] = v6; + int64_t v7 = VI64(VTUP(x2)->cells[3]); + VAL v8 = VVAL(VTUP(x2)->cells[1]); + int64_t v9 = VI64(VTUP(v8)->cells[4]); + VTUP(v8)->cells[4] = MKI64(v7); + VAL v10 = mw_mirth_c99_ZPlusC99_indent(v8); + VAL v11 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v3); + VAL v12 = mw_mirth_c99_ZPlusC99_put(v11, v10); + STR* v13; + STRLIT(v13, " ", 1); + VAL v14 = mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12); + incref(v5); + VAL v15 = mw_mirth_c99_ZPlusC99_put(v5, v14); STR* v16; STRLIT(v16, " = ", 3); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15)); - VAL v18 = (VVAL(VTUP(v17)->cells[6])); - VAL v19; + VAL v17 = mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15); + VAL v18 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v3, v5); + VAL v19 = VVAL(VTUP(v17)->cells[7]); VAL v20; - mw_mirth_buffer_Buffer_cname(v18, x1, &v19, &v20); - VTUP(v17)->cells[6] = v19; - VAL v21 = (mw_mirth_c99_ZPlusC99_put(v20, v17)); - STR* v22; - STRLIT(v22, ";", 1); - VAL v23 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v21)); - VAL v24 = (mw_mirth_c99_ZPlusC99_line(v23)); - VTUP(x2)->cells[1] = v24; - VAL v25 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x2, v7)); - return v25; + VAL v21; + mw_mirth_buffer_Buffer_cname(v19, x1, &v20, &v21); + VTUP(v17)->cells[7] = v20; + VAL v22 = mw_mirth_c99_ZPlusC99_put(v21, v17); + STR* v23; + STRLIT(v23, ";", 1); + VAL v24 = mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22); + VAL v25 = mw_mirth_c99_ZPlusC99_line(v24); + VTUP(v25)->cells[4] = MKI64(v9); + VTUP(x2)->cells[1] = v25; + VAL v26 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x2, v18); + return v26; } static VAL mw_mirth_c99_c99Z_variablesZBang (VAL x1) { int64_t v2 = 1LL; void* v3 = mbuf_mirth_variable_Variable_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (mw_mirth_c99_c99Z_variableZBang(((uint64_t)v10), v9)); + VAL v11 = mw_mirth_c99_c99Z_variableZBang(((uint64_t)v10), v9); int64_t v12 = 1LL; int64_t v13 = i64_add(v10, v12); void* v14 = mbuf_mirth_variable_Variable_NUM; @@ -69336,68 +50248,72 @@ static VAL mw_mirth_c99_c99Z_variablesZBang (VAL x1) { static VAL mw_mirth_c99_c99Z_variableZBang (uint64_t x1, VAL x2) { STR* v3; STRLIT(v3, "static VAL ", 11); - VAL v4 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2)); - VAL v5 = (VVAL(VTUP(v4)->cells[6])); + VAL v4 = mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2); + VAL v5 = VVAL(VTUP(v4)->cells[7]); VAL v6; VAL v7; mw_mirth_variable_Variable_cname(v5, x1, &v6, &v7); - VTUP(v4)->cells[6] = v6; - VAL v8 = (mw_mirth_c99_ZPlusC99_put(v7, v4)); + VTUP(v4)->cells[7] = v6; + VAL v8 = mw_mirth_c99_ZPlusC99_put(v7, v4); STR* v9; STRLIT(v9, " = {0};", 7); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8)); - VAL v11 = (mw_mirth_c99_ZPlusC99_line(v10)); + VAL v10 = mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8); + VAL v11 = mw_mirth_c99_ZPlusC99_line(v10); return v11; } static VAL mw_mirth_c99_c99Z_variableZ_callZBang (uint64_t x1, VAL x2) { int64_t v3 = 13LL /* C99RT_PTR */; - VAL v4 = (VVAL(VTUP(x2)->cells[1])); + VAL v4 = VVAL(VTUP(x2)->cells[1]); VAL v5; VAL v6; mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v4, &v5, &v6); - VAL v7 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v3, v5)); - VAL v8 = (mw_mirth_c99_ZPlusC99_indent(v6)); - int64_t v9 = VI64(VTUP(v7)->cells[1]); - VAL v10 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v9); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(v10, v8)); - STR* v12; - STRLIT(v12, " ", 1); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11)); - VAL v14 = VVAL(VTUP(v7)->cells[2]); - incref(v14); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(v14, v13)); + VTUP(x2)->cells[1] = v6; + int64_t v7 = VI64(VTUP(x2)->cells[3]); + VAL v8 = VVAL(VTUP(x2)->cells[1]); + int64_t v9 = VI64(VTUP(v8)->cells[4]); + VTUP(v8)->cells[4] = MKI64(v7); + VAL v10 = mw_mirth_c99_ZPlusC99_indent(v8); + VAL v11 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v3); + VAL v12 = mw_mirth_c99_ZPlusC99_put(v11, v10); + STR* v13; + STRLIT(v13, " ", 1); + VAL v14 = mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12); + incref(v5); + VAL v15 = mw_mirth_c99_ZPlusC99_put(v5, v14); STR* v16; STRLIT(v16, " = ", 3); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15)); - STR* v18; - STRLIT(v18, "&", 1); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17)); - VAL v20 = (VVAL(VTUP(v19)->cells[6])); - VAL v21; + VAL v17 = mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15); + VAL v18 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v3, v5); + STR* v19; + STRLIT(v19, "&", 1); + VAL v20 = mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v17); + VAL v21 = VVAL(VTUP(v20)->cells[7]); VAL v22; - mw_mirth_variable_Variable_cname(v20, x1, &v21, &v22); - VTUP(v19)->cells[6] = v21; - VAL v23 = (mw_mirth_c99_ZPlusC99_put(v22, v19)); - STR* v24; - STRLIT(v24, ";", 1); - VAL v25 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v24), v23)); - VAL v26 = (mw_mirth_c99_ZPlusC99_line(v25)); - VTUP(x2)->cells[1] = v26; - VAL v27 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x2, v7)); - return v27; + VAL v23; + mw_mirth_variable_Variable_cname(v21, x1, &v22, &v23); + VTUP(v20)->cells[7] = v22; + VAL v24 = mw_mirth_c99_ZPlusC99_put(v23, v20); + STR* v25; + STRLIT(v25, ";", 1); + VAL v26 = mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v24); + VAL v27 = mw_mirth_c99_ZPlusC99_line(v26); + VTUP(v27)->cells[4] = MKI64(v9); + VTUP(x2)->cells[1] = v27; + VAL v28 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x2, v18); + return v28; } static VAL mw_mirth_c99_c99Z_tagZ_defsZBang (VAL x1) { int64_t v2 = 1LL; void* v3 = mbuf_mirth_data_Tag_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (mw_mirth_c99_c99Z_tagZ_defZBang(((uint64_t)v10), v9)); + VAL v11 = mw_mirth_c99_c99Z_tagZ_defZBang(((uint64_t)v10), v9); int64_t v12 = 1LL; int64_t v13 = i64_add(v10, v12); void* v14 = mbuf_mirth_data_Tag_NUM; @@ -69410,1442 +50326,1081 @@ static VAL mw_mirth_c99_c99Z_tagZ_defsZBang (VAL x1) { return v6; } static VAL mw_mirth_c99_c99Z_tagZ_bodyZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); - VAL v4 = (VVAL(VTUP(v3)->cells[6])); - VAL v5; - VAL v6; - mw_mirth_data_Tag_semiZ_transparentZAsk(v4, x1, &v5, &v6); - VTUP(v3)->cells[6] = v5; - VTUP(x2)->cells[1] = v3; - uint64_t x7; - VAL x8; - switch (get_data_tag(v6)) { + VAL v3; + VAL v4; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp4(x1, x2, &v3, &v4); + uint64_t x5; + VAL x6; + switch (get_data_tag(v3)) { case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v6); - VAL v10 = VVAL(VTUP(v9)->cells[2]); - incref(v10); - decref(v9); - uint64_t x11; - VAL x12; - switch (get_data_tag(v10)) { + VAL v7 = mtp_std_maybe_Maybe_1_Some(v3); + VAL v8 = VVAL(VTUP(v7)->cells[2]); + incref(v8); + decref(v7); + uint64_t x9; + VAL x10; + switch (get_data_tag(v8)) { case 1LL: { // STPConsLabel - VAL v13; - uint64_t v14; - mtp_mirth_type_StackTypePart_STPConsLabel(v10, &v13, &v14); - int64_t v15; + VAL v11; + uint64_t v12; + mtp_mirth_type_StackTypePart_STPConsLabel(v8, &v11, &v12); + int64_t v13; + VAL v14; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v11, v4, &v13, &v14); + VAL v15; VAL v16; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v13, x2, &v15, &v16); - VAL v17; - VAL v18; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang(v15, v14, v16, &v17, &v18); - int64_t v19 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x1); - uint64_t x20; - VAL x21; - if (((bool)v19)) { - VAL v22 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v18)); - VAL v23 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v17, v22)); - x21 = v23; - x20 = x1; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang(v13, v12, v14, &v15, &v16); + int64_t v17 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x1); + uint64_t x18; + VAL x19; + if (((bool)v17)) { + VAL v20 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v16); + VAL v21 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v15, v20); + x19 = v21; + x18 = x1; } else { - VAL v24 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v17, v18)); - x21 = v24; - x20 = x1; + VAL v22 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v15, v16); + x19 = v22; + x18 = x1; } - x12 = x21; - x11 = x20; + x10 = x19; + x9 = x18; } break; case 3LL: { // STPWithLabel - VAL v25; - uint64_t v26; - mtp_mirth_type_StackTypePart_STPWithLabel(v10, &v25, &v26); - int64_t v27; + VAL v23; + uint64_t v24; + mtp_mirth_type_StackTypePart_STPWithLabel(v8, &v23, &v24); + int64_t v25; + VAL v26; + mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v23, v4, &v25, &v26); + VAL v27; VAL v28; - mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v25, x2, &v27, &v28); - VAL v29; - VAL v30; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang(v27, v26, v28, &v29, &v30); - VAL v31 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v29, v30)); - x12 = v31; - x11 = x1; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang(v25, v24, v26, &v27, &v28); + VAL v29 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v27, v28); + x10 = v29; + x9 = x1; } break; case 0LL: { // STPCons - VAL v32 = mtp_mirth_type_StackTypePart_STPCons(v10); - int64_t v33; + VAL v30 = mtp_mirth_type_StackTypePart_STPCons(v8); + int64_t v31; + VAL v32; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v30, v4, &v31, &v32); + VAL v33; VAL v34; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v32, x2, &v33, &v34); - VAL v35; - VAL v36; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v34, v33, &v35, &v36); - int64_t v37 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x1); - uint64_t x38; - VAL x39; - if (((bool)v37)) { - VAL v40 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v36)); - VAL v41 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v35, v40)); - x39 = v41; - x38 = x1; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v32, v31, &v33, &v34); + int64_t v35 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x1); + uint64_t x36; + VAL x37; + if (((bool)v35)) { + VAL v38 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v34); + VAL v39 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v33, v38); + x37 = v39; + x36 = x1; } else { - VAL v42 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v35, v36)); - x39 = v42; - x38 = x1; + VAL v40 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v33, v34); + x37 = v40; + x36 = x1; } - x12 = x39; - x11 = x38; + x10 = x37; + x9 = x36; } break; case 2LL: { // STPWith - VAL v43 = mtp_mirth_type_StackTypePart_STPWith(v10); - int64_t v44; + VAL v41 = mtp_mirth_type_StackTypePart_STPWith(v8); + int64_t v42; + VAL v43; + mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v41, v4, &v42, &v43); + VAL v44; VAL v45; - mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v43, x2, &v44, &v45); - VAL v46; - VAL v47; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v45, v44, &v46, &v47); - VAL v48 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v46, v47)); - x12 = v48; - x11 = x1; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v43, v42, &v44, &v45); + VAL v46 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v44, v45); + x10 = v46; + x9 = x1; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x8 = x12; - x7 = x11; + x6 = x10; + x5 = x9; } break; case 0LL: { // None - int64_t v49 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); - int64_t v50 = 0LL; - bool v51 = (v49 == v50); - uint64_t x52; - VAL x53; - if (v51) { - uint64_t v54 = mw_mirth_data_Tag_data(x1); - int64_t v55 = mw_mirth_data_Data_isZ_enumZ_orZ_unitZAsk(v54); - VAL x56; - uint64_t x57; - int64_t x58; - VAL x59; - VAL x60; - if (((bool)v55)) { - int64_t v61 = 2LL /* C99RT_I64 */; - STR* v62; - STRLIT(v62, "", 0); - STR* v63; - STRLIT(v63, "", 0); - x60 = MKSTR(v63); - x59 = MKSTR(v62); - x58 = v61; - x57 = x1; - x56 = x2; + int64_t v47 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); + int64_t v48 = 0LL; + bool v49 = (v47 == v48); + uint64_t x50; + VAL x51; + if (v49) { + uint64_t v52 = mw_mirth_data_Tag_data(x1); + int64_t v53 = mw_mirth_data_Data_isZ_enumZ_orZ_unitZAsk(v52); + VAL x54; + uint64_t x55; + int64_t x56; + VAL x57; + VAL x58; + if (((bool)v53)) { + int64_t v59 = 2LL /* C99RT_I64 */; + STR* v60; + STRLIT(v60, "", 0); + STR* v61; + STRLIT(v61, "", 0); + x58 = MKSTR(v61); + x57 = MKSTR(v60); + x56 = v59; + x55 = x1; + x54 = v4; } else { - int64_t v64 = 0LL /* C99RT_VAL */; - STR* v65; - STRLIT(v65, "MKI64(", 6); - STR* v66; - STRLIT(v66, ")", 1); - x60 = MKSTR(v66); - x59 = MKSTR(v65); - x58 = v64; - x57 = x1; - x56 = x2; + int64_t v62 = 0LL /* C99RT_VAL */; + STR* v63; + STRLIT(v63, "MKI64(", 6); + STR* v64; + STRLIT(v64, ")", 1); + x58 = MKSTR(v64); + x57 = MKSTR(v63); + x56 = v62; + x55 = x1; + x54 = v4; } - int64_t v67 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x57); - uint64_t x68; - VAL x69; - if (((bool)v67)) { - VAL v70 = (VVAL(VTUP(x56)->cells[1])); - VAL v71; - VAL v72; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v70, &v71, &v72); - VAL v73 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(x58, v71)); - VAL v74 = (mw_mirth_c99_ZPlusC99_indent(v72)); - int64_t v75 = VI64(VTUP(v73)->cells[1]); - VAL v76 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v75); - VAL v77 = (mw_mirth_c99_ZPlusC99_put(v76, v74)); - STR* v78; - STRLIT(v78, " ", 1); - VAL v79 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v78), v77)); - VAL v80 = VVAL(VTUP(v73)->cells[2]); - incref(v80); - VAL v81 = (mw_mirth_c99_ZPlusC99_put(v80, v79)); - STR* v82; - STRLIT(v82, " = (", 4); - VAL v83 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v82), v81)); - VAL v84 = (mw_mirth_c99_ZPlusC99_put(x59, v83)); - VAL v85 = mw_mirth_data_Tag_valueZ_show(x57); - VAL v86 = (mw_mirth_c99_ZPlusC99_put(v85, v84)); - STR* v87; - STRLIT(v87, "LL /* ", 6); - VAL v88 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v87), v86)); - uint64_t v89 = mw_mirth_data_Tag_name(x57); - VAL v90 = mw_mirth_name_Name_ZToStr(v89); - VAL v91 = (mw_mirth_c99_ZPlusC99_put(v90, v88)); - STR* v92; - STRLIT(v92, " */", 3); - VAL v93 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v92), v91)); - VAL v94 = (mw_mirth_c99_ZPlusC99_put(x60, v93)); - STR* v95; - STRLIT(v95, ");", 2); - VAL v96 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v95), v94)); - VAL v97 = (mw_mirth_c99_ZPlusC99_line(v96)); - VTUP(x56)->cells[1] = v97; - VAL v98 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(x56, v73)); - x69 = v98; - x68 = x57; + int64_t v65 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x55); + uint64_t x66; + VAL x67; + if (((bool)v65)) { + VAL v68 = VVAL(VTUP(x54)->cells[1]); + VAL v69; + VAL v70; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v68, &v69, &v70); + VTUP(x54)->cells[1] = v70; + int64_t v71 = VI64(VTUP(x54)->cells[3]); + VAL v72 = VVAL(VTUP(x54)->cells[1]); + int64_t v73 = VI64(VTUP(v72)->cells[4]); + VTUP(v72)->cells[4] = MKI64(v71); + VAL v74 = mw_mirth_c99_ZPlusC99_indent(v72); + VAL v75 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x56); + VAL v76 = mw_mirth_c99_ZPlusC99_put(v75, v74); + STR* v77; + STRLIT(v77, " ", 1); + VAL v78 = mw_mirth_c99_ZPlusC99_put(MKSTR(v77), v76); + incref(v69); + VAL v79 = mw_mirth_c99_ZPlusC99_put(v69, v78); + STR* v80; + STRLIT(v80, " = ", 3); + VAL v81 = mw_mirth_c99_ZPlusC99_put(MKSTR(v80), v79); + VAL v82 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(x56, v69); + VAL v83 = mw_mirth_c99_ZPlusC99_put(x57, v81); + VAL v84 = mw_mirth_data_Tag_valueZ_show(x55); + VAL v85 = mw_mirth_c99_ZPlusC99_put(v84, v83); + STR* v86; + STRLIT(v86, "LL /* ", 6); + VAL v87 = mw_mirth_c99_ZPlusC99_put(MKSTR(v86), v85); + uint64_t v88 = mw_mirth_data_Tag_name(x55); + VAL v89 = mw_mirth_name_Name_ZToStr(v88); + VAL v90 = mw_mirth_c99_ZPlusC99_put(v89, v87); + STR* v91; + STRLIT(v91, " */", 3); + VAL v92 = mw_mirth_c99_ZPlusC99_put(MKSTR(v91), v90); + VAL v93 = mw_mirth_c99_ZPlusC99_put(x58, v92); + STR* v94; + STRLIT(v94, ";", 1); + VAL v95 = mw_mirth_c99_ZPlusC99_put(MKSTR(v94), v93); + VAL v96 = mw_mirth_c99_ZPlusC99_line(v95); + VTUP(v96)->cells[4] = MKI64(v73); + VTUP(x54)->cells[1] = v96; + VAL v97 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(x54, v82); + x67 = v97; + x66 = x55; } else { - VAL v99 = (VVAL(VTUP(x56)->cells[1])); + VAL v98 = VVAL(VTUP(x54)->cells[1]); + VAL v99; VAL v100; - VAL v101; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v99, &v100, &v101); - VAL v102 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(x58, v100)); - VAL v103 = (mw_mirth_c99_ZPlusC99_indent(v101)); - int64_t v104 = VI64(VTUP(v102)->cells[1]); - VAL v105 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v104); - VAL v106 = (mw_mirth_c99_ZPlusC99_put(v105, v103)); + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v98, &v99, &v100); + VTUP(x54)->cells[1] = v100; + int64_t v101 = VI64(VTUP(x54)->cells[3]); + VAL v102 = VVAL(VTUP(x54)->cells[1]); + int64_t v103 = VI64(VTUP(v102)->cells[4]); + VTUP(v102)->cells[4] = MKI64(v101); + VAL v104 = mw_mirth_c99_ZPlusC99_indent(v102); + VAL v105 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x56); + VAL v106 = mw_mirth_c99_ZPlusC99_put(v105, v104); STR* v107; STRLIT(v107, " ", 1); - VAL v108 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v107), v106)); - VAL v109 = VVAL(VTUP(v102)->cells[2]); - incref(v109); - VAL v110 = (mw_mirth_c99_ZPlusC99_put(v109, v108)); - STR* v111; - STRLIT(v111, " = ", 3); - VAL v112 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v111), v110)); - VAL v113 = (mw_mirth_c99_ZPlusC99_put(x59, v112)); - VAL v114 = mw_mirth_data_Tag_valueZ_show(x57); - VAL v115 = (mw_mirth_c99_ZPlusC99_put(v114, v113)); + VAL v108 = mw_mirth_c99_ZPlusC99_put(MKSTR(v107), v106); + incref(v99); + VAL v109 = mw_mirth_c99_ZPlusC99_put(v99, v108); + STR* v110; + STRLIT(v110, " = ", 3); + VAL v111 = mw_mirth_c99_ZPlusC99_put(MKSTR(v110), v109); + VAL v112 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(x56, v99); + VAL v113 = mw_mirth_c99_ZPlusC99_put(x57, v111); + VAL v114 = mw_mirth_data_Tag_valueZ_show(x55); + VAL v115 = mw_mirth_c99_ZPlusC99_put(v114, v113); STR* v116; STRLIT(v116, "LL /* ", 6); - VAL v117 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v116), v115)); - uint64_t v118 = mw_mirth_data_Tag_name(x57); + VAL v117 = mw_mirth_c99_ZPlusC99_put(MKSTR(v116), v115); + uint64_t v118 = mw_mirth_data_Tag_name(x55); VAL v119 = mw_mirth_name_Name_ZToStr(v118); - VAL v120 = (mw_mirth_c99_ZPlusC99_put(v119, v117)); + VAL v120 = mw_mirth_c99_ZPlusC99_put(v119, v117); STR* v121; STRLIT(v121, " */", 3); - VAL v122 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v121), v120)); - VAL v123 = (mw_mirth_c99_ZPlusC99_put(x60, v122)); + VAL v122 = mw_mirth_c99_ZPlusC99_put(MKSTR(v121), v120); + VAL v123 = mw_mirth_c99_ZPlusC99_put(x58, v122); STR* v124; STRLIT(v124, ";", 1); - VAL v125 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v124), v123)); - VAL v126 = (mw_mirth_c99_ZPlusC99_line(v125)); - VTUP(x56)->cells[1] = v126; - VAL v127 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x56, v102)); - x69 = v127; - x68 = x57; + VAL v125 = mw_mirth_c99_ZPlusC99_put(MKSTR(v124), v123); + VAL v126 = mw_mirth_c99_ZPlusC99_line(v125); + VTUP(v126)->cells[4] = MKI64(v103); + VTUP(x54)->cells[1] = v126; + VAL v127 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x54, v112); + x67 = v127; + x66 = x55; } - x53 = x69; - x52 = x68; + x51 = x67; + x50 = x66; } else { - VAL v128 = (VVAL(VTUP(x2)->cells[1])); - VAL v129 = (mw_mirth_c99_ZPlusC99_indent(v128)); - VAL v130; - VAL v131; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v129, &v130, &v131); - STR* v132; - STRLIT(v132, "TUP* ", 5); - VAL v133 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v132), v131)); - incref(v130); - VAL v134 = (mw_mirth_c99_ZPlusC99_put(v130, v133)); - STR* v135; - STRLIT(v135, " = tup_new(", 11); - VAL v136 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v135), v134)); - int64_t v137 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); - int64_t v138 = 1LL; - int64_t v139 = i64_add(v137, v138); - STR* v140 = i64_show(v139); - VAL v141 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v140), v136)); - STR* v142; - STRLIT(v142, ");", 2); - VAL v143 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v142), v141)); - VAL v144 = (mw_mirth_c99_ZPlusC99_line(v143)); - VTUP(x2)->cells[1] = v144; - VAL v145 = (VVAL(VTUP(x2)->cells[1])); - VAL v146 = (mw_mirth_c99_ZPlusC99_indent(v145)); - incref(v130); - VAL v147 = (mw_mirth_c99_ZPlusC99_put(v130, v146)); - STR* v148; - STRLIT(v148, "->size = ", 9); - VAL v149 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v148), v147)); - int64_t v150 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); - int64_t v151 = 1LL; - int64_t v152 = i64_add(v150, v151); - STR* v153 = i64_show(v152); - VAL v154 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v153), v149)); - STR* v155; - STRLIT(v155, ";", 1); - VAL v156 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v155), v154)); - VAL v157 = (mw_mirth_c99_ZPlusC99_line(v156)); - VTUP(x2)->cells[1] = v157; - VAL v158 = (VVAL(VTUP(x2)->cells[1])); - VAL v159 = (mw_mirth_c99_ZPlusC99_indent(v158)); - incref(v130); - VAL v160 = (mw_mirth_c99_ZPlusC99_put(v130, v159)); - STR* v161; - STRLIT(v161, "->cells[0] = MKI64(", 19); - VAL v162 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v161), v160)); - VAL v163 = mw_mirth_data_Tag_valueZ_show(x1); - VAL v164 = (mw_mirth_c99_ZPlusC99_put(v163, v162)); - STR* v165; - STRLIT(v165, "LL /* ", 6); - VAL v166 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v165), v164)); - uint64_t v167 = mw_mirth_data_Tag_name(x1); - VAL v168 = mw_mirth_name_Name_ZToStr(v167); - VAL v169 = (mw_mirth_c99_ZPlusC99_put(v168, v166)); - STR* v170; - STRLIT(v170, " */);", 5); - VAL v171 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v170), v169)); - VAL v172 = (mw_mirth_c99_ZPlusC99_line(v171)); - VTUP(x2)->cells[1] = v172; - int64_t v173 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); - VAL v174 = mw_mirth_data_Tag_labelZ_inputs(x1); - VAL v175 = mw_std_list_List_1_reverse(v174); - VAL v176; - VAL v177; - mw_std_list_List_1_uncons(v175, &v176, &v177); - VAL x178; - VAL x179; - int64_t x180; - uint64_t x181; - VAL x182; - int64_t x183; - switch (get_data_tag(v176)) { - case 1LL: { // Some - VAL v184 = mtp_std_maybe_Maybe_1_Some(v176); - incref(v184); - int64_t v185 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(VU64(v184)); - VAL x186; - int64_t x187; - uint64_t x188; - VAL x189; - VAL x190; - if (((bool)v185)) { - int64_t v191 = 0LL /* C99RT_VAL */; - VAL v192; - VAL v193; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang(v191, VU64(v184), x2, &v192, &v193); - VAL v194 = mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL(v193); - x190 = v194; - x189 = v192; - x188 = x1; - x187 = v173; - x186 = v130; - } else { - int64_t v195 = 0LL /* C99RT_VAL */; - VAL v196; - VAL v197; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang(v195, VU64(v184), x2, &v196, &v197); - VAL v198 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v197); - x190 = v198; - x189 = v196; - x188 = x1; - x187 = v173; - x186 = v130; - } - VAL v199 = (VVAL(VTUP(x189)->cells[1])); - VAL v200 = (mw_mirth_c99_ZPlusC99_indent(v199)); - incref(x186); - VAL v201 = (mw_mirth_c99_ZPlusC99_put(x186, v200)); - STR* v202; - STRLIT(v202, "->cells[", 8); - VAL v203 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v202), v201)); - STR* v204 = i64_show(x187); - VAL v205 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v204), v203)); - STR* v206; - STRLIT(v206, "] = ", 4); - VAL v207 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v206), v205)); - VAL v208 = (mw_mirth_c99_ZPlusC99_put(x190, v207)); - STR* v209; - STRLIT(v209, ";", 1); - VAL v210 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v209), v208)); - VAL v211 = (mw_mirth_c99_ZPlusC99_line(v210)); - VTUP(x189)->cells[1] = v211; - int64_t v212 = 1LL; - int64_t v213 = i64_sub(x187, v212); - int64_t v214 = 0LL; - bool v215 = (v213 < v214); - int64_t x216; - if (v215) { - int64_t v217 = 0LL; - x216 = v217; - lpush(&lbl_tag, MKU64(x188)); - lpush(&lbl_tup, x186); - push_resource(x189); - } else { - x216 = v213; - lpush(&lbl_tag, MKU64(x188)); - lpush(&lbl_tup, x186); - push_resource(x189); - } - int64_t v218 = 1LL /* True */; - x183 = v218; - x182 = v177; - uint64_t v219 = VU64(lpop(&lbl_tag)); - x181 = v219; - x180 = x216; - VAL r220 = pop_resource(); - x179 = r220; - VAL v221 = lpop(&lbl_tup); - x178 = v221; - } break; - case 0LL: { // None - int64_t v222 = 0LL /* False */; - x183 = v222; - x182 = v177; - x181 = x1; - x180 = v173; - x179 = x2; - x178 = v130; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v223 = x178; - VAL v224 = (x179); - int64_t v225 = x180; - uint64_t v226 = x181; - VAL v227 = x182; - int64_t v228 = x183; - while (((bool)v228)) { - VAL v229 = v223; - VAL v230 = (v224); - int64_t v231 = v225; - uint64_t v232 = v226; - VAL v233 = v227; - VAL v234; - VAL v235; - mw_std_list_List_1_uncons(v233, &v234, &v235); - VAL x236; - VAL x237; - int64_t x238; - uint64_t x239; - VAL x240; - int64_t x241; - switch (get_data_tag(v234)) { - case 1LL: { // Some - VAL v242 = mtp_std_maybe_Maybe_1_Some(v234); - incref(v242); - int64_t v243 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(VU64(v242)); - VAL x244; - int64_t x245; - uint64_t x246; - VAL x247; - VAL x248; - if (((bool)v243)) { - int64_t v249 = 0LL /* C99RT_VAL */; - VAL v250; - VAL v251; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang(v249, VU64(v242), v230, &v250, &v251); - VAL v252 = mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL(v251); - x248 = v252; - x247 = v250; - x246 = v232; - x245 = v231; - x244 = v229; + int64_t v128 = VI64(VTUP(v4)->cells[3]); + VAL v129 = VVAL(VTUP(v4)->cells[1]); + int64_t v130 = VI64(VTUP(v129)->cells[4]); + VTUP(v129)->cells[4] = MKI64(v128); + VAL v131 = mw_mirth_c99_ZPlusC99_indent(v129); + VAL v132; + VAL v133; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v131, &v132, &v133); + STR* v134; + STRLIT(v134, "TUP* ", 5); + VAL v135 = mw_mirth_c99_ZPlusC99_put(MKSTR(v134), v133); + incref(v132); + VAL v136 = mw_mirth_c99_ZPlusC99_put(v132, v135); + STR* v137; + STRLIT(v137, " = tup_new(", 11); + VAL v138 = mw_mirth_c99_ZPlusC99_put(MKSTR(v137), v136); + int64_t v139 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); + int64_t v140 = 1LL; + int64_t v141 = i64_add(v139, v140); + STR* v142 = i64_show(v141); + VAL v143 = mw_mirth_c99_ZPlusC99_put(MKSTR(v142), v138); + STR* v144; + STRLIT(v144, ");", 2); + VAL v145 = mw_mirth_c99_ZPlusC99_put(MKSTR(v144), v143); + VAL v146 = mw_mirth_c99_ZPlusC99_line(v145); + VTUP(v146)->cells[4] = MKI64(v130); + VTUP(v4)->cells[1] = v146; + int64_t v147 = VI64(VTUP(v4)->cells[3]); + VAL v148 = VVAL(VTUP(v4)->cells[1]); + int64_t v149 = VI64(VTUP(v148)->cells[4]); + VTUP(v148)->cells[4] = MKI64(v147); + VAL v150 = mw_mirth_c99_ZPlusC99_indent(v148); + incref(v132); + VAL v151 = mw_mirth_c99_ZPlusC99_put(v132, v150); + STR* v152; + STRLIT(v152, "->size = ", 9); + VAL v153 = mw_mirth_c99_ZPlusC99_put(MKSTR(v152), v151); + int64_t v154 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); + int64_t v155 = 1LL; + int64_t v156 = i64_add(v154, v155); + STR* v157 = i64_show(v156); + VAL v158 = mw_mirth_c99_ZPlusC99_put(MKSTR(v157), v153); + STR* v159; + STRLIT(v159, ";", 1); + VAL v160 = mw_mirth_c99_ZPlusC99_put(MKSTR(v159), v158); + VAL v161 = mw_mirth_c99_ZPlusC99_line(v160); + VTUP(v161)->cells[4] = MKI64(v149); + VTUP(v4)->cells[1] = v161; + int64_t v162 = VI64(VTUP(v4)->cells[3]); + VAL v163 = VVAL(VTUP(v4)->cells[1]); + int64_t v164 = VI64(VTUP(v163)->cells[4]); + VTUP(v163)->cells[4] = MKI64(v162); + VAL v165 = mw_mirth_c99_ZPlusC99_indent(v163); + incref(v132); + VAL v166 = mw_mirth_c99_ZPlusC99_put(v132, v165); + STR* v167; + STRLIT(v167, "->cells[0] = MKI64(", 19); + VAL v168 = mw_mirth_c99_ZPlusC99_put(MKSTR(v167), v166); + VAL v169 = mw_mirth_data_Tag_valueZ_show(x1); + VAL v170 = mw_mirth_c99_ZPlusC99_put(v169, v168); + STR* v171; + STRLIT(v171, "LL /* ", 6); + VAL v172 = mw_mirth_c99_ZPlusC99_put(MKSTR(v171), v170); + uint64_t v173 = mw_mirth_data_Tag_name(x1); + VAL v174 = mw_mirth_name_Name_ZToStr(v173); + VAL v175 = mw_mirth_c99_ZPlusC99_put(v174, v172); + STR* v176; + STRLIT(v176, " */);", 5); + VAL v177 = mw_mirth_c99_ZPlusC99_put(MKSTR(v176), v175); + VAL v178 = mw_mirth_c99_ZPlusC99_line(v177); + VTUP(v178)->cells[4] = MKI64(v164); + VTUP(v4)->cells[1] = v178; + int64_t v179 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); + VAL v180 = mw_mirth_data_Tag_labelZ_inputs(x1); + VAL v181 = mw_std_list_List_1_reverse(v180); + int64_t v182 = 1LL /* True */; + int64_t v183 = v179; + VAL v184 = v132; + VAL v185 = v4; + VAL v186 = v181; + int64_t v187 = v182; + int64_t v188 = v182; + while (((bool)v188)) { + int64_t v189 = v183; + VAL v190 = v184; + VAL v191 = v185; + VAL v192 = v186; + int64_t v193 = v187; + VAL x194; + VAL x195; + int64_t x196; + VAL x197; + int64_t x198; + switch (get_data_tag(v192)) { + case 1LL: { // Cons + VAL v199; + VAL v200; + mtp_std_list_List_1_Cons(v192, &v199, &v200); + incref(v199); + int64_t v201 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(VU64(v199)); + int64_t x202; + VAL x203; + VAL x204; + VAL x205; + if (((bool)v201)) { + int64_t v206 = 0LL /* C99RT_VAL */; + VAL v207; + VAL v208; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang(v206, VU64(v199), v191, &v207, &v208); + VAL v209 = mw_mirth_c99_ZPlusC99Resource_consumeZ_asZ_VAL(v208); + x205 = v209; + x204 = v207; + x203 = v190; + x202 = v189; } else { - int64_t v253 = 0LL /* C99RT_VAL */; - VAL v254; - VAL v255; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang(v253, VU64(v242), v230, &v254, &v255); - VAL v256 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v255); - x248 = v256; - x247 = v254; - x246 = v232; - x245 = v231; - x244 = v229; + int64_t v210 = 0LL /* C99RT_VAL */; + VAL v211; + VAL v212; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang(v210, VU64(v199), v191, &v211, &v212); + VAL v213 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v212); + x205 = v213; + x204 = v211; + x203 = v190; + x202 = v189; } - VAL v257 = (VVAL(VTUP(x247)->cells[1])); - VAL v258 = (mw_mirth_c99_ZPlusC99_indent(v257)); - incref(x244); - VAL v259 = (mw_mirth_c99_ZPlusC99_put(x244, v258)); - STR* v260; - STRLIT(v260, "->cells[", 8); - VAL v261 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v260), v259)); - STR* v262 = i64_show(x245); - VAL v263 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v262), v261)); - STR* v264; - STRLIT(v264, "] = ", 4); - VAL v265 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v264), v263)); - VAL v266 = (mw_mirth_c99_ZPlusC99_put(x248, v265)); - STR* v267; - STRLIT(v267, ";", 1); - VAL v268 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v267), v266)); - VAL v269 = (mw_mirth_c99_ZPlusC99_line(v268)); - VTUP(x247)->cells[1] = v269; - int64_t v270 = 1LL; - int64_t v271 = i64_sub(x245, v270); - int64_t v272 = 0LL; - bool v273 = (v271 < v272); - int64_t x274; - if (v273) { - int64_t v275 = 0LL; - x274 = v275; - lpush(&lbl_tag, MKU64(x246)); - lpush(&lbl_tup, x244); - push_resource(x247); + VAL v214; + int64_t v215; + VAL v216; + mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp58(x205, x202, x203, x204, &v214, &v215, &v216); + int64_t v217 = 1LL; + int64_t v218 = i64_sub(v215, v217); + int64_t v219 = 0LL; + bool v220 = (v218 < v219); + int64_t x221; + if (v220) { + int64_t v222 = 0LL; + x221 = v222; } else { - x274 = v271; - lpush(&lbl_tag, MKU64(x246)); - lpush(&lbl_tup, x244); - push_resource(x247); + x221 = v218; } - int64_t v276 = 1LL /* True */; - x241 = v276; - x240 = v235; - uint64_t v277 = VU64(lpop(&lbl_tag)); - x239 = v277; - x238 = x274; - VAL r278 = pop_resource(); - x237 = r278; - VAL v279 = lpop(&lbl_tup); - x236 = v279; + int64_t v223 = 1LL /* True */; + x198 = v223; + x197 = v200; + x196 = x221; + x195 = v216; + x194 = v214; } break; - case 0LL: { // None - int64_t v280 = 0LL /* False */; - x241 = v280; - x240 = v235; - x239 = v232; - x238 = v231; - x237 = v230; - x236 = v229; + case 0LL: { // Nil + VAL v224 = MKI64(0LL /* Nil */); + int64_t v225 = 0LL /* False */; + x198 = v225; + x197 = v224; + x196 = v189; + x195 = v191; + x194 = v190; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v228 = x241; - v227 = x240; - v226 = x239; - v225 = x238; - v224 = x237; - v223 = x236; + v188 = x198; + v187 = x198; + v186 = x197; + v185 = x195; + v184 = x194; + v183 = x196; } - decref(v227); - int64_t v281 = mw_mirth_data_Tag_numZ_resourceZ_inputs(v226); - int64_t v282 = 0LL; - bool v283 = (v281 > v282); - VAL v284 = v223; - VAL v285 = (v224); - int64_t v286 = v225; - uint64_t v287 = v226; - int64_t v288 = v281; - bool v289 = v283; - while (v289) { - VAL v290 = v284; - VAL v291 = (v285); - int64_t v292 = v286; - uint64_t v293 = v287; - int64_t v294 = v288; - int64_t v295 = 0LL /* C99RT_VAL */; - VAL v296; - VAL v297; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v291, v295, &v296, &v297); - VAL v298 = mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL(v297); - VAL v299 = (VVAL(VTUP(v296)->cells[1])); - VAL v300 = (mw_mirth_c99_ZPlusC99_indent(v299)); - incref(v290); - VAL v301 = (mw_mirth_c99_ZPlusC99_put(v290, v300)); - STR* v302; - STRLIT(v302, "->cells[", 8); - VAL v303 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v302), v301)); - STR* v304 = i64_show(v292); - VAL v305 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v304), v303)); - STR* v306; - STRLIT(v306, "] = ", 4); - VAL v307 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v306), v305)); - VAL v308 = (mw_mirth_c99_ZPlusC99_put(v298, v307)); - STR* v309; - STRLIT(v309, ";", 1); - VAL v310 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v309), v308)); - VAL v311 = (mw_mirth_c99_ZPlusC99_line(v310)); - VTUP(v296)->cells[1] = v311; - int64_t v312 = 1LL; - int64_t v313 = i64_sub(v292, v312); - int64_t v314 = 0LL; - bool v315 = (v313 < v314); - int64_t x316; - if (v315) { - int64_t v317 = 0LL; - x316 = v317; - lpush(&lbl_tag, MKU64(v293)); - lpush(&lbl_tup, v290); - push_resource(v296); + decref(v186); + int64_t v226 = mw_mirth_data_Tag_numZ_resourceZ_inputs(x1); + int64_t v227 = 0LL; + bool v228 = (v226 > v227); + int64_t v229 = v183; + VAL v230 = v184; + VAL v231 = v185; + int64_t v232 = v226; + bool v233 = v228; + while (v233) { + int64_t v234 = v229; + VAL v235 = v230; + VAL v236 = v231; + int64_t v237 = v232; + int64_t v238 = 0LL /* C99RT_VAL */; + VAL v239; + VAL v240; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v236, v238, &v239, &v240); + VAL v241 = mw_mirth_c99_ZPlusC99Resource_consumeZ_asZ_VAL(v240); + VAL v242; + int64_t v243; + VAL v244; + mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp58(v241, v234, v235, v239, &v242, &v243, &v244); + int64_t v245 = 1LL; + int64_t v246 = i64_sub(v243, v245); + int64_t v247 = 0LL; + bool v248 = (v246 < v247); + int64_t x249; + if (v248) { + int64_t v250 = 0LL; + x249 = v250; } else { - x316 = v313; - lpush(&lbl_tag, MKU64(v293)); - lpush(&lbl_tup, v290); - push_resource(v296); + x249 = v246; } - int64_t v318 = 1LL; - int64_t v319 = i64_sub(v294, v318); - int64_t v320 = 0LL; - bool v321 = (v319 < v320); - int64_t x322; - if (v321) { - int64_t v323 = 0LL; - x322 = v323; - lpush(&lbl_i, MKI64(x316)); + int64_t v251 = 1LL; + int64_t v252 = i64_sub(v237, v251); + int64_t v253 = 0LL; + bool v254 = (v252 < v253); + int64_t x255; + if (v254) { + int64_t v256 = 0LL; + x255 = v256; } else { - x322 = v319; - lpush(&lbl_i, MKI64(x316)); + x255 = v252; } - int64_t v324 = 0LL; - bool v325 = (x322 > v324); - v289 = v325; - v288 = x322; - uint64_t v326 = VU64(lpop(&lbl_tag)); - v287 = v326; - int64_t v327 = VI64(lpop(&lbl_i)); - v286 = v327; - VAL r328 = pop_resource(); - v285 = r328; - VAL v329 = lpop(&lbl_tup); - v284 = v329; + int64_t v257 = 0LL; + bool v258 = (x255 > v257); + v233 = v258; + v232 = x255; + v231 = v244; + v230 = v242; + v229 = x249; } - int64_t v330 = mw_mirth_data_Tag_numZ_typeZ_inputs(v287); - int64_t v331 = 0LL; - bool v332 = (v330 > v331); - VAL v333 = v284; - VAL v334 = (v285); - int64_t v335 = v286; - uint64_t v336 = v287; - int64_t v337 = v330; - bool v338 = v332; - while (v338) { - VAL v339 = v333; - VAL v340 = (v334); - int64_t v341 = v335; - uint64_t v342 = v336; - int64_t v343 = v337; - int64_t v344 = 0LL /* C99RT_VAL */; - VAL v345; - VAL v346; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v340, v344, &v345, &v346); - VAL v347 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v346); - VAL v348 = (VVAL(VTUP(v345)->cells[1])); - VAL v349 = (mw_mirth_c99_ZPlusC99_indent(v348)); - incref(v339); - VAL v350 = (mw_mirth_c99_ZPlusC99_put(v339, v349)); - STR* v351; - STRLIT(v351, "->cells[", 8); - VAL v352 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v351), v350)); - STR* v353 = i64_show(v341); - VAL v354 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v353), v352)); - STR* v355; - STRLIT(v355, "] = ", 4); - VAL v356 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v355), v354)); - VAL v357 = (mw_mirth_c99_ZPlusC99_put(v347, v356)); - STR* v358; - STRLIT(v358, ";", 1); - VAL v359 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v358), v357)); - VAL v360 = (mw_mirth_c99_ZPlusC99_line(v359)); - VTUP(v345)->cells[1] = v360; - int64_t v361 = 1LL; - int64_t v362 = i64_sub(v341, v361); - int64_t v363 = 0LL; - bool v364 = (v362 < v363); - int64_t x365; - if (v364) { - int64_t v366 = 0LL; - x365 = v366; - lpush(&lbl_tag, MKU64(v342)); - lpush(&lbl_tup, v339); - push_resource(v345); + int64_t v259 = mw_mirth_data_Tag_numZ_typeZ_inputs(x1); + int64_t v260 = 0LL; + bool v261 = (v259 > v260); + int64_t v262 = v229; + VAL v263 = v230; + VAL v264 = v231; + int64_t v265 = v259; + bool v266 = v261; + while (v266) { + int64_t v267 = v262; + VAL v268 = v263; + VAL v269 = v264; + int64_t v270 = v265; + int64_t v271 = 0LL /* C99RT_VAL */; + VAL v272; + VAL v273; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v269, v271, &v272, &v273); + VAL v274 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v273); + VAL v275; + int64_t v276; + VAL v277; + mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp58(v274, v267, v268, v272, &v275, &v276, &v277); + int64_t v278 = 1LL; + int64_t v279 = i64_sub(v276, v278); + int64_t v280 = 0LL; + bool v281 = (v279 < v280); + int64_t x282; + if (v281) { + int64_t v283 = 0LL; + x282 = v283; } else { - x365 = v362; - lpush(&lbl_tag, MKU64(v342)); - lpush(&lbl_tup, v339); - push_resource(v345); + x282 = v279; } - int64_t v367 = 1LL; - int64_t v368 = i64_sub(v343, v367); - int64_t v369 = 0LL; - bool v370 = (v368 < v369); - int64_t x371; - if (v370) { - int64_t v372 = 0LL; - x371 = v372; - lpush(&lbl_i, MKI64(x365)); + int64_t v284 = 1LL; + int64_t v285 = i64_sub(v270, v284); + int64_t v286 = 0LL; + bool v287 = (v285 < v286); + int64_t x288; + if (v287) { + int64_t v289 = 0LL; + x288 = v289; } else { - x371 = v368; - lpush(&lbl_i, MKI64(x365)); + x288 = v285; } - int64_t v373 = 0LL; - bool v374 = (x371 > v373); - v338 = v374; - v337 = x371; - uint64_t v375 = VU64(lpop(&lbl_tag)); - v336 = v375; - int64_t v376 = VI64(lpop(&lbl_i)); - v335 = v376; - VAL r377 = pop_resource(); - v334 = r377; - VAL v378 = lpop(&lbl_tup); - v333 = v378; + int64_t v290 = 0LL; + bool v291 = (x288 > v290); + v266 = v291; + v265 = x288; + v264 = v277; + v263 = v275; + v262 = x282; } - int64_t v379 = mw_mirth_data_Tag_outputsZ_resourceZAsk(v336); - uint64_t x380; - VAL x381; - if (((bool)v379)) { - int64_t v382 = 0LL /* C99RT_VAL */; - VAL v383 = (VVAL(VTUP(v334)->cells[1])); - VAL v384; - VAL v385; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v383, &v384, &v385); - VAL v386 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v382, v384)); - VAL v387 = (mw_mirth_c99_ZPlusC99_indent(v385)); - int64_t v388 = VI64(VTUP(v386)->cells[1]); - VAL v389 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v388); - VAL v390 = (mw_mirth_c99_ZPlusC99_put(v389, v387)); - STR* v391; - STRLIT(v391, " ", 1); - VAL v392 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v391), v390)); - VAL v393 = VVAL(VTUP(v386)->cells[2]); - incref(v393); - VAL v394 = (mw_mirth_c99_ZPlusC99_put(v393, v392)); - STR* v395; - STRLIT(v395, " = (", 4); - VAL v396 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v395), v394)); - STR* v397; - STRLIT(v397, "MKTUP(", 6); - VAL v398 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v397), v396)); - VAL v399 = (mw_mirth_c99_ZPlusC99_put(v333, v398)); - STR* v400; - STRLIT(v400, ", ", 2); - VAL v401 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v400), v399)); - int64_t v402 = mw_mirth_data_Tag_numZ_totalZ_inputs(v336); - int64_t v403 = 1LL; - int64_t v404 = i64_add(v402, v403); - STR* v405 = i64_show(v404); - VAL v406 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v405), v401)); - STR* v407; - STRLIT(v407, ")", 1); - VAL v408 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v407), v406)); - STR* v409; - STRLIT(v409, ");", 2); - VAL v410 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v409), v408)); - VAL v411 = (mw_mirth_c99_ZPlusC99_line(v410)); - VTUP(v334)->cells[1] = v411; - VAL v412 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v334, v386)); - x381 = v412; - x380 = v336; + int64_t v292 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x1); + uint64_t x293; + VAL x294; + if (((bool)v292)) { + int64_t v295 = 0LL /* C99RT_VAL */; + VAL v296 = VVAL(VTUP(v264)->cells[1]); + VAL v297; + VAL v298; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v296, &v297, &v298); + VTUP(v264)->cells[1] = v298; + int64_t v299 = VI64(VTUP(v264)->cells[3]); + VAL v300 = VVAL(VTUP(v264)->cells[1]); + int64_t v301 = VI64(VTUP(v300)->cells[4]); + VTUP(v300)->cells[4] = MKI64(v299); + VAL v302 = mw_mirth_c99_ZPlusC99_indent(v300); + VAL v303 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v295); + VAL v304 = mw_mirth_c99_ZPlusC99_put(v303, v302); + STR* v305; + STRLIT(v305, " ", 1); + VAL v306 = mw_mirth_c99_ZPlusC99_put(MKSTR(v305), v304); + incref(v297); + VAL v307 = mw_mirth_c99_ZPlusC99_put(v297, v306); + STR* v308; + STRLIT(v308, " = ", 3); + VAL v309 = mw_mirth_c99_ZPlusC99_put(MKSTR(v308), v307); + VAL v310 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v295, v297); + STR* v311; + STRLIT(v311, "MKTUP(", 6); + VAL v312 = mw_mirth_c99_ZPlusC99_put(MKSTR(v311), v309); + VAL v313 = mw_mirth_c99_ZPlusC99_put(v263, v312); + STR* v314; + STRLIT(v314, ", ", 2); + VAL v315 = mw_mirth_c99_ZPlusC99_put(MKSTR(v314), v313); + int64_t v316 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); + int64_t v317 = 1LL; + int64_t v318 = i64_add(v316, v317); + STR* v319 = i64_show(v318); + VAL v320 = mw_mirth_c99_ZPlusC99_put(MKSTR(v319), v315); + STR* v321; + STRLIT(v321, ")", 1); + VAL v322 = mw_mirth_c99_ZPlusC99_put(MKSTR(v321), v320); + STR* v323; + STRLIT(v323, ";", 1); + VAL v324 = mw_mirth_c99_ZPlusC99_put(MKSTR(v323), v322); + VAL v325 = mw_mirth_c99_ZPlusC99_line(v324); + VTUP(v325)->cells[4] = MKI64(v301); + VTUP(v264)->cells[1] = v325; + VAL v326 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v264, v310); + x294 = v326; + x293 = x1; } else { - int64_t v413 = 0LL /* C99RT_VAL */; - VAL v414 = (VVAL(VTUP(v334)->cells[1])); - VAL v415; - VAL v416; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v414, &v415, &v416); - VAL v417 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v413, v415)); - VAL v418 = (mw_mirth_c99_ZPlusC99_indent(v416)); - int64_t v419 = VI64(VTUP(v417)->cells[1]); - VAL v420 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v419); - VAL v421 = (mw_mirth_c99_ZPlusC99_put(v420, v418)); - STR* v422; - STRLIT(v422, " ", 1); - VAL v423 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v422), v421)); - VAL v424 = VVAL(VTUP(v417)->cells[2]); - incref(v424); - VAL v425 = (mw_mirth_c99_ZPlusC99_put(v424, v423)); - STR* v426; - STRLIT(v426, " = ", 3); - VAL v427 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v426), v425)); - STR* v428; - STRLIT(v428, "MKTUP(", 6); - VAL v429 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v428), v427)); - VAL v430 = (mw_mirth_c99_ZPlusC99_put(v333, v429)); - STR* v431; - STRLIT(v431, ", ", 2); - VAL v432 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v431), v430)); - int64_t v433 = mw_mirth_data_Tag_numZ_totalZ_inputs(v336); - int64_t v434 = 1LL; - int64_t v435 = i64_add(v433, v434); - STR* v436 = i64_show(v435); - VAL v437 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v436), v432)); - STR* v438; - STRLIT(v438, ")", 1); - VAL v439 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v438), v437)); - STR* v440; - STRLIT(v440, ";", 1); - VAL v441 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v440), v439)); - VAL v442 = (mw_mirth_c99_ZPlusC99_line(v441)); - VTUP(v334)->cells[1] = v442; - VAL v443 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v334, v417)); - x381 = v443; - x380 = v336; + int64_t v327 = 0LL /* C99RT_VAL */; + VAL v328 = VVAL(VTUP(v264)->cells[1]); + VAL v329; + VAL v330; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v328, &v329, &v330); + VTUP(v264)->cells[1] = v330; + int64_t v331 = VI64(VTUP(v264)->cells[3]); + VAL v332 = VVAL(VTUP(v264)->cells[1]); + int64_t v333 = VI64(VTUP(v332)->cells[4]); + VTUP(v332)->cells[4] = MKI64(v331); + VAL v334 = mw_mirth_c99_ZPlusC99_indent(v332); + VAL v335 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v327); + VAL v336 = mw_mirth_c99_ZPlusC99_put(v335, v334); + STR* v337; + STRLIT(v337, " ", 1); + VAL v338 = mw_mirth_c99_ZPlusC99_put(MKSTR(v337), v336); + incref(v329); + VAL v339 = mw_mirth_c99_ZPlusC99_put(v329, v338); + STR* v340; + STRLIT(v340, " = ", 3); + VAL v341 = mw_mirth_c99_ZPlusC99_put(MKSTR(v340), v339); + VAL v342 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v327, v329); + STR* v343; + STRLIT(v343, "MKTUP(", 6); + VAL v344 = mw_mirth_c99_ZPlusC99_put(MKSTR(v343), v341); + VAL v345 = mw_mirth_c99_ZPlusC99_put(v263, v344); + STR* v346; + STRLIT(v346, ", ", 2); + VAL v347 = mw_mirth_c99_ZPlusC99_put(MKSTR(v346), v345); + int64_t v348 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); + int64_t v349 = 1LL; + int64_t v350 = i64_add(v348, v349); + STR* v351 = i64_show(v350); + VAL v352 = mw_mirth_c99_ZPlusC99_put(MKSTR(v351), v347); + STR* v353; + STRLIT(v353, ")", 1); + VAL v354 = mw_mirth_c99_ZPlusC99_put(MKSTR(v353), v352); + STR* v355; + STRLIT(v355, ";", 1); + VAL v356 = mw_mirth_c99_ZPlusC99_put(MKSTR(v355), v354); + VAL v357 = mw_mirth_c99_ZPlusC99_line(v356); + VTUP(v357)->cells[4] = MKI64(v333); + VTUP(v264)->cells[1] = v357; + VAL v358 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v264, v342); + x294 = v358; + x293 = x1; } - x53 = x381; - x52 = x380; + x51 = x294; + x50 = x293; } - x8 = x53; - x7 = x52; + x6 = x51; + x5 = x50; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - return x8; + return x6; } static VAL mw_mirth_c99_c99Z_reverseZ_tagZ_bodyZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); - VAL v4 = (VVAL(VTUP(v3)->cells[6])); - VAL v5; - VAL v6; - mw_mirth_data_Tag_semiZ_transparentZAsk(v4, x1, &v5, &v6); - VTUP(v3)->cells[6] = v5; - VTUP(x2)->cells[1] = v3; - uint64_t x7; - VAL x8; - switch (get_data_tag(v6)) { + VAL v3; + VAL v4; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp4(x1, x2, &v3, &v4); + uint64_t x5; + VAL x6; + switch (get_data_tag(v3)) { case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v6); - VAL v10 = VVAL(VTUP(v9)->cells[2]); - incref(v10); - decref(v9); - uint64_t x11; - VAL x12; - switch (get_data_tag(v10)) { + VAL v7 = mtp_std_maybe_Maybe_1_Some(v3); + VAL v8 = VVAL(VTUP(v7)->cells[2]); + incref(v8); + decref(v7); + uint64_t x9; + VAL x10; + switch (get_data_tag(v8)) { case 1LL: { // STPConsLabel - VAL v13; - uint64_t v14; - mtp_mirth_type_StackTypePart_STPConsLabel(v10, &v13, &v14); - int64_t v15; - VAL v16; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v13, x2, &v15, &v16); - int64_t v17 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x1); - uint64_t x18; - uint64_t x19; - VAL x20; - VAL x21; - if (((bool)v17)) { - VAL v22; - VAL v23; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v16, v15, &v22, &v23); - VAL v24 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(v23)); - x21 = v24; - x20 = v22; - x19 = x1; - x18 = v14; + VAL v11; + uint64_t v12; + mtp_mirth_type_StackTypePart_STPConsLabel(v8, &v11, &v12); + int64_t v13; + VAL v14; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v11, v4, &v13, &v14); + int64_t v15 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x1); + uint64_t x16; + uint64_t x17; + VAL x18; + VAL x19; + if (((bool)v15)) { + VAL v20; + VAL v21; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v14, v13, &v20, &v21); + VAL v22 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(v21); + x19 = v22; + x18 = v20; + x17 = x1; + x16 = v12; } else { - VAL v25; - VAL v26; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v16, v15, &v25, &v26); - x21 = v26; - x20 = v25; - x19 = x1; - x18 = v14; + VAL v23; + VAL v24; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v14, v13, &v23, &v24); + x19 = v24; + x18 = v23; + x17 = x1; + x16 = v12; } - VAL v27 = (mw_mirth_c99_pushZ_localZ_labelZBang(x18, x20, x21)); - x12 = v27; - x11 = x19; + VAL v25 = mw_mirth_c99_pushZ_valueZ_labelZBang(x16, x18, x19); + x10 = v25; + x9 = x17; } break; case 3LL: { // STPWithLabel - VAL v28; - uint64_t v29; - mtp_mirth_type_StackTypePart_STPWithLabel(v10, &v28, &v29); - int64_t v30; + VAL v26; + uint64_t v27; + mtp_mirth_type_StackTypePart_STPWithLabel(v8, &v26, &v27); + int64_t v28; + VAL v29; + mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v26, v4, &v28, &v29); + VAL v30; VAL v31; - mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v28, x2, &v30, &v31); - VAL v32; - VAL v33; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v31, v30, &v32, &v33); - VAL v34 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v29, v32, v33)); - x12 = v34; - x11 = x1; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v29, v28, &v30, &v31); + VAL v32 = mw_mirth_c99_pushZ_resourceZ_labelZBang(v27, v30, v31); + x10 = v32; + x9 = x1; } break; case 0LL: { // STPCons - VAL v35 = mtp_mirth_type_StackTypePart_STPCons(v10); - int64_t v36; - VAL v37; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v35, x2, &v36, &v37); - int64_t v38 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x1); - uint64_t x39; - VAL x40; - VAL x41; - if (((bool)v38)) { - VAL v42; - VAL v43; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v37, v36, &v42, &v43); - VAL v44 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(v43)); - x41 = v44; - x40 = v42; - x39 = x1; + VAL v33 = mtp_mirth_type_StackTypePart_STPCons(v8); + int64_t v34; + VAL v35; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v33, v4, &v34, &v35); + int64_t v36 = mw_mirth_data_Tag_outputsZ_resourceZAsk(x1); + uint64_t x37; + VAL x38; + VAL x39; + if (((bool)v36)) { + VAL v40; + VAL v41; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v35, v34, &v40, &v41); + VAL v42 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(v41); + x39 = v42; + x38 = v40; + x37 = x1; } else { - VAL v45; - VAL v46; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v37, v36, &v45, &v46); - x41 = v46; - x40 = v45; - x39 = x1; + VAL v43; + VAL v44; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v35, v34, &v43, &v44); + x39 = v44; + x38 = v43; + x37 = x1; } - VAL v47 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x40, x41)); - x12 = v47; - x11 = x39; + VAL v45 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x38, x39); + x10 = v45; + x9 = x37; } break; case 2LL: { // STPWith - VAL v48 = mtp_mirth_type_StackTypePart_STPWith(v10); - int64_t v49; + VAL v46 = mtp_mirth_type_StackTypePart_STPWith(v8); + int64_t v47; + VAL v48; + mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v46, v4, &v47, &v48); + VAL v49; VAL v50; - mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v48, x2, &v49, &v50); - VAL v51; - VAL v52; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v50, v49, &v51, &v52); - VAL v53 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v51, v52)); - x12 = v53; - x11 = x1; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v48, v47, &v49, &v50); + VAL v51 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v49, v50); + x10 = v51; + x9 = x1; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x8 = x12; - x7 = x11; + x6 = x10; + x5 = x9; } break; case 0LL: { // None - int64_t v54 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); - int64_t v55 = 0LL; - bool v56 = (v54 == v55); - uint64_t x57; - VAL x58; - if (v56) { - uint64_t v59 = mw_mirth_data_Tag_data(x1); - VAL v60; - VAL v61; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_valueZDivresourceZ_dataZBang(v59, x2, &v60, &v61); - mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdrop(v61); - x58 = v60; - x57 = x1; + int64_t v52 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); + int64_t v53 = 0LL; + bool v54 = (v52 == v53); + uint64_t x55; + VAL x56; + if (v54) { + uint64_t v57 = mw_mirth_data_Tag_data(x1); + VAL v58; + VAL v59; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_valueZDivresourceZ_dataZBang(v57, v4, &v58, &v59); + mw_mirth_c99_ZPlusC99ValueZDivResource_rdrop(v59); + x56 = v58; + x55 = x1; } else { - uint64_t v62 = mw_mirth_data_Tag_data(x1); - VAL v63; - VAL v64; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_valueZDivresourceZ_dataZBang(v62, x2, &v63, &v64); - VAL v65 = mw_mirth_c99_ZPlusC99LocalValueZDivResource_consumeZ_asZ_VAL(v64); - STR* v66; - STRLIT(v66, "", 0); - STR* v67; - STRLIT(v67, "VTUP(", 5); - VAL v68 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v67), MKSTR(v66))); - VAL v69 = (mw_std_str_ZPlusStr_pushZ_strZBang(v65, v68)); - STR* v70; - STRLIT(v70, ")", 1); - VAL v71 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v70), v69)); - int64_t v72 = 1LL; - int64_t v73 = mw_mirth_data_Tag_numZ_typeZ_inputs(x1); - int64_t v74 = 0LL; - bool v75 = (v73 > v74); - VAL v76 = (v63); - VAL v77 = v71; - int64_t v78 = v72; - uint64_t v79 = x1; - int64_t v80 = v73; - bool v81 = v75; - while (v81) { - VAL v82 = (v76); - VAL v83 = v77; - int64_t v84 = v78; - uint64_t v85 = v79; - int64_t v86 = v80; - int64_t v87 = 0LL /* C99RT_VAL */; - VAL v88 = (VVAL(VTUP(v82)->cells[1])); - VAL v89; - VAL v90; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v88, &v89, &v90); - VAL v91 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v87, v89)); - VAL v92 = (mw_mirth_c99_ZPlusC99_indent(v90)); - int64_t v93 = VI64(VTUP(v91)->cells[1]); - VAL v94 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v93); - VAL v95 = (mw_mirth_c99_ZPlusC99_put(v94, v92)); - STR* v96; - STRLIT(v96, " ", 1); - VAL v97 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v96), v95)); - VAL v98 = VVAL(VTUP(v91)->cells[2]); - incref(v98); - VAL v99 = (mw_mirth_c99_ZPlusC99_put(v98, v97)); - STR* v100; - STRLIT(v100, " = ", 3); - VAL v101 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v100), v99)); - incref(v83); - VAL v102 = (mw_mirth_c99_ZPlusC99_put(v83, v101)); - STR* v103; - STRLIT(v103, "->cells[", 8); - VAL v104 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v103), v102)); - STR* v105 = i64_show(v84); - VAL v106 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v105), v104)); - STR* v107; - STRLIT(v107, "]", 1); - VAL v108 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v107), v106)); - STR* v109; - STRLIT(v109, ";", 1); - VAL v110 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v109), v108)); - VAL v111 = (mw_mirth_c99_ZPlusC99_line(v110)); - VTUP(v82)->cells[1] = v111; - VAL v112 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v82, v91)); - int64_t v113 = 1LL; - int64_t v114 = i64_add(v84, v113); - int64_t v115 = 1LL; - int64_t v116 = i64_sub(v86, v115); - int64_t v117 = 0LL; - bool v118 = (v116 < v117); - int64_t x119; - if (v118) { - int64_t v120 = 0LL; - x119 = v120; - lpush(&lbl_tag, MKU64(v85)); - lpush(&lbl_tup, v83); - push_resource(v112); - lpush(&lbl_i, MKI64(v114)); + uint64_t v60 = mw_mirth_data_Tag_data(x1); + VAL v61; + VAL v62; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_valueZDivresourceZ_dataZBang(v60, v4, &v61, &v62); + VAL v63 = mw_mirth_c99_ZPlusC99ValueZDivResource_consumeZ_asZ_VAL(v62); + STR* v64; + STRLIT(v64, "", 0); + STR* v65; + STRLIT(v65, "VTUP(", 5); + VAL v66 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v65), MKSTR(v64)); + VAL v67 = mw_std_str_ZPlusStr_pushZ_strZBang(v63, v66); + STR* v68; + STRLIT(v68, ")", 1); + VAL v69 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v68), v67); + int64_t v70 = 1LL; + int64_t v71 = mw_mirth_data_Tag_numZ_typeZ_inputs(x1); + int64_t v72 = 0LL; + bool v73 = (v71 > v72); + int64_t v74 = v70; + VAL v75 = v69; + VAL v76 = v61; + int64_t v77 = v71; + bool v78 = v73; + while (v78) { + int64_t v79 = v74; + VAL v80 = v75; + VAL v81 = v76; + int64_t v82 = v77; + int64_t v83 = 0LL /* C99RT_VAL */; + VAL v84; + int64_t v85; + VAL v86; + VAL v87; + mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp11(v79, v80, v81, v83, &v84, &v85, &v86, &v87); + VAL v88 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v86, v87); + int64_t v89 = 1LL; + int64_t v90 = i64_add(v85, v89); + int64_t v91 = 1LL; + int64_t v92 = i64_sub(v82, v91); + int64_t v93 = 0LL; + bool v94 = (v92 < v93); + int64_t x95; + if (v94) { + int64_t v96 = 0LL; + x95 = v96; } else { - x119 = v116; - lpush(&lbl_tag, MKU64(v85)); - lpush(&lbl_tup, v83); - push_resource(v112); - lpush(&lbl_i, MKI64(v114)); + x95 = v92; } - int64_t v121 = 0LL; - bool v122 = (x119 > v121); - v81 = v122; - v80 = x119; - uint64_t v123 = VU64(lpop(&lbl_tag)); - v79 = v123; - int64_t v124 = VI64(lpop(&lbl_i)); - v78 = v124; - VAL v125 = lpop(&lbl_tup); - v77 = v125; - VAL r126 = pop_resource(); - v76 = r126; + int64_t v97 = 0LL; + bool v98 = (x95 > v97); + v78 = v98; + v77 = x95; + v76 = v88; + v75 = v84; + v74 = v90; } - int64_t v127 = mw_mirth_data_Tag_numZ_resourceZ_inputs(v79); - int64_t v128 = 0LL; - bool v129 = (v127 > v128); - VAL v130 = (v76); - VAL v131 = v77; - int64_t v132 = v78; - uint64_t v133 = v79; - int64_t v134 = v127; - bool v135 = v129; - while (v135) { - VAL v136 = (v130); - VAL v137 = v131; - int64_t v138 = v132; - uint64_t v139 = v133; - int64_t v140 = v134; - int64_t v141 = 0LL /* C99RT_VAL */; - VAL v142 = (VVAL(VTUP(v136)->cells[1])); - VAL v143; - VAL v144; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v142, &v143, &v144); - VAL v145 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v141, v143)); - VAL v146 = (mw_mirth_c99_ZPlusC99_indent(v144)); - int64_t v147 = VI64(VTUP(v145)->cells[1]); - VAL v148 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v147); - VAL v149 = (mw_mirth_c99_ZPlusC99_put(v148, v146)); - STR* v150; - STRLIT(v150, " ", 1); - VAL v151 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v150), v149)); - VAL v152 = VVAL(VTUP(v145)->cells[2]); - incref(v152); - VAL v153 = (mw_mirth_c99_ZPlusC99_put(v152, v151)); - STR* v154; - STRLIT(v154, " = (", 4); - VAL v155 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v154), v153)); - incref(v137); - VAL v156 = (mw_mirth_c99_ZPlusC99_put(v137, v155)); - STR* v157; - STRLIT(v157, "->cells[", 8); - VAL v158 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v157), v156)); - STR* v159 = i64_show(v138); - VAL v160 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v159), v158)); - STR* v161; - STRLIT(v161, "]", 1); - VAL v162 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v161), v160)); - STR* v163; - STRLIT(v163, ");", 2); - VAL v164 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v163), v162)); - VAL v165 = (mw_mirth_c99_ZPlusC99_line(v164)); - VTUP(v136)->cells[1] = v165; - VAL v166 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v136, v145)); - int64_t v167 = 1LL; - int64_t v168 = i64_add(v138, v167); - int64_t v169 = 1LL; - int64_t v170 = i64_sub(v140, v169); - int64_t v171 = 0LL; - bool v172 = (v170 < v171); - int64_t x173; - if (v172) { - int64_t v174 = 0LL; - x173 = v174; - lpush(&lbl_tag, MKU64(v139)); - lpush(&lbl_tup, v137); - push_resource(v166); - lpush(&lbl_i, MKI64(v168)); + int64_t v99 = mw_mirth_data_Tag_numZ_resourceZ_inputs(x1); + int64_t v100 = 0LL; + bool v101 = (v99 > v100); + int64_t v102 = v74; + VAL v103 = v75; + VAL v104 = v76; + int64_t v105 = v99; + bool v106 = v101; + while (v106) { + int64_t v107 = v102; + VAL v108 = v103; + VAL v109 = v104; + int64_t v110 = v105; + int64_t v111 = 0LL /* C99RT_VAL */; + VAL v112 = VVAL(VTUP(v109)->cells[1]); + VAL v113; + VAL v114; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v112, &v113, &v114); + VTUP(v109)->cells[1] = v114; + int64_t v115 = VI64(VTUP(v109)->cells[3]); + VAL v116 = VVAL(VTUP(v109)->cells[1]); + int64_t v117 = VI64(VTUP(v116)->cells[4]); + VTUP(v116)->cells[4] = MKI64(v115); + VAL v118 = mw_mirth_c99_ZPlusC99_indent(v116); + VAL v119 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v111); + VAL v120 = mw_mirth_c99_ZPlusC99_put(v119, v118); + STR* v121; + STRLIT(v121, " ", 1); + VAL v122 = mw_mirth_c99_ZPlusC99_put(MKSTR(v121), v120); + incref(v113); + VAL v123 = mw_mirth_c99_ZPlusC99_put(v113, v122); + STR* v124; + STRLIT(v124, " = ", 3); + VAL v125 = mw_mirth_c99_ZPlusC99_put(MKSTR(v124), v123); + VAL v126 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v111, v113); + incref(v108); + VAL v127 = mw_mirth_c99_ZPlusC99_put(v108, v125); + STR* v128; + STRLIT(v128, "->cells[", 8); + VAL v129 = mw_mirth_c99_ZPlusC99_put(MKSTR(v128), v127); + STR* v130 = i64_show(v107); + VAL v131 = mw_mirth_c99_ZPlusC99_put(MKSTR(v130), v129); + STR* v132; + STRLIT(v132, "]", 1); + VAL v133 = mw_mirth_c99_ZPlusC99_put(MKSTR(v132), v131); + STR* v134; + STRLIT(v134, ";", 1); + VAL v135 = mw_mirth_c99_ZPlusC99_put(MKSTR(v134), v133); + VAL v136 = mw_mirth_c99_ZPlusC99_line(v135); + VTUP(v136)->cells[4] = MKI64(v117); + VTUP(v109)->cells[1] = v136; + VAL v137 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v109, v126); + int64_t v138 = 1LL; + int64_t v139 = i64_add(v107, v138); + int64_t v140 = 1LL; + int64_t v141 = i64_sub(v110, v140); + int64_t v142 = 0LL; + bool v143 = (v141 < v142); + int64_t x144; + if (v143) { + int64_t v145 = 0LL; + x144 = v145; } else { - x173 = v170; - lpush(&lbl_tag, MKU64(v139)); - lpush(&lbl_tup, v137); - push_resource(v166); - lpush(&lbl_i, MKI64(v168)); - } - int64_t v175 = 0LL; - bool v176 = (x173 > v175); - v135 = v176; - v134 = x173; - uint64_t v177 = VU64(lpop(&lbl_tag)); - v133 = v177; - int64_t v178 = VI64(lpop(&lbl_i)); - v132 = v178; - VAL v179 = lpop(&lbl_tup); - v131 = v179; - VAL r180 = pop_resource(); - v130 = r180; - } - VAL v181 = mw_mirth_data_Tag_labelZ_inputs(v133); - VAL v182; - VAL v183; - mw_std_list_List_1_uncons(v181, &v182, &v183); - VAL x184; - VAL x185; - int64_t x186; - uint64_t x187; - VAL x188; - int64_t x189; - switch (get_data_tag(v182)) { - case 1LL: { // Some - VAL v190 = mtp_std_maybe_Maybe_1_Some(v182); - int64_t v191 = 0LL /* C99RT_VAL */; - VAL v192 = (VVAL(VTUP(v130)->cells[1])); - VAL v193; - VAL v194; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v192, &v193, &v194); - VAL v195 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v191, v193)); - VAL v196 = (mw_mirth_c99_ZPlusC99_indent(v194)); - int64_t v197 = VI64(VTUP(v195)->cells[1]); - VAL v198 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v197); - VAL v199 = (mw_mirth_c99_ZPlusC99_put(v198, v196)); - STR* v200; - STRLIT(v200, " ", 1); - VAL v201 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v200), v199)); - VAL v202 = VVAL(VTUP(v195)->cells[2]); - incref(v202); - VAL v203 = (mw_mirth_c99_ZPlusC99_put(v202, v201)); - STR* v204; - STRLIT(v204, " = ", 3); - VAL v205 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v204), v203)); - incref(v131); - VAL v206 = (mw_mirth_c99_ZPlusC99_put(v131, v205)); - STR* v207; - STRLIT(v207, "->cells[", 8); - VAL v208 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v207), v206)); - STR* v209 = i64_show(v132); - VAL v210 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v209), v208)); - STR* v211; - STRLIT(v211, "]", 1); - VAL v212 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v211), v210)); - STR* v213; - STRLIT(v213, ";", 1); - VAL v214 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v213), v212)); - VAL v215 = (mw_mirth_c99_ZPlusC99_line(v214)); - VTUP(v130)->cells[1] = v215; - incref(v190); - int64_t v216 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(VU64(v190)); - uint64_t x217; - VAL x218; - int64_t x219; - VAL x220; - if (((bool)v216)) { - VAL v221 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v195)); - VAL v222 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(VU64(v190), v130, v221)); - x220 = v222; - x219 = v132; - x218 = v131; - x217 = v133; - } else { - VAL v223 = (mw_mirth_c99_pushZ_localZ_labelZBang(VU64(v190), v130, v195)); - x220 = v223; - x219 = v132; - x218 = v131; - x217 = v133; - } - int64_t v224 = 1LL; - int64_t v225 = i64_add(x219, v224); - int64_t v226 = 1LL /* True */; - x189 = v226; - x188 = v183; - x187 = x217; - x186 = v225; - x185 = x218; - x184 = x220; - } break; - case 0LL: { // None - int64_t v227 = 0LL /* False */; - x189 = v227; - x188 = v183; - x187 = v133; - x186 = v132; - x185 = v131; - x184 = v130; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + x144 = v141; } + int64_t v146 = 0LL; + bool v147 = (x144 > v146); + v106 = v147; + v105 = x144; + v104 = v137; + v103 = v108; + v102 = v139; } - VAL v228 = (x184); - VAL v229 = x185; - int64_t v230 = x186; - uint64_t v231 = x187; - VAL v232 = x188; - int64_t v233 = x189; - while (((bool)v233)) { - VAL v234 = (v228); - VAL v235 = v229; - int64_t v236 = v230; - uint64_t v237 = v231; - VAL v238 = v232; - VAL v239; - VAL v240; - mw_std_list_List_1_uncons(v238, &v239, &v240); - VAL x241; - VAL x242; - int64_t x243; - uint64_t x244; - VAL x245; - int64_t x246; - switch (get_data_tag(v239)) { - case 1LL: { // Some - VAL v247 = mtp_std_maybe_Maybe_1_Some(v239); - int64_t v248 = 0LL /* C99RT_VAL */; - VAL v249 = (VVAL(VTUP(v234)->cells[1])); - VAL v250; - VAL v251; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v249, &v250, &v251); - VAL v252 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v248, v250)); - VAL v253 = (mw_mirth_c99_ZPlusC99_indent(v251)); - int64_t v254 = VI64(VTUP(v252)->cells[1]); - VAL v255 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v254); - VAL v256 = (mw_mirth_c99_ZPlusC99_put(v255, v253)); - STR* v257; - STRLIT(v257, " ", 1); - VAL v258 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v257), v256)); - VAL v259 = VVAL(VTUP(v252)->cells[2]); - incref(v259); - VAL v260 = (mw_mirth_c99_ZPlusC99_put(v259, v258)); - STR* v261; - STRLIT(v261, " = ", 3); - VAL v262 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v261), v260)); - incref(v235); - VAL v263 = (mw_mirth_c99_ZPlusC99_put(v235, v262)); - STR* v264; - STRLIT(v264, "->cells[", 8); - VAL v265 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v264), v263)); - STR* v266 = i64_show(v236); - VAL v267 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v266), v265)); - STR* v268; - STRLIT(v268, "]", 1); - VAL v269 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v268), v267)); - STR* v270; - STRLIT(v270, ";", 1); - VAL v271 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v270), v269)); - VAL v272 = (mw_mirth_c99_ZPlusC99_line(v271)); - VTUP(v234)->cells[1] = v272; - incref(v247); - int64_t v273 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(VU64(v247)); - uint64_t x274; - VAL x275; - int64_t x276; - VAL x277; - if (((bool)v273)) { - VAL v278 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v252)); - VAL v279 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(VU64(v247), v234, v278)); - x277 = v279; - x276 = v236; - x275 = v235; - x274 = v237; + VAL v148 = mw_mirth_data_Tag_labelZ_inputs(x1); + int64_t v149 = 1LL /* True */; + int64_t v150 = v102; + VAL v151 = v103; + VAL v152 = v104; + VAL v153 = v148; + int64_t v154 = v149; + int64_t v155 = v149; + while (((bool)v155)) { + int64_t v156 = v150; + VAL v157 = v151; + VAL v158 = v152; + VAL v159 = v153; + int64_t v160 = v154; + VAL x161; + VAL x162; + int64_t x163; + VAL x164; + int64_t x165; + switch (get_data_tag(v159)) { + case 1LL: { // Cons + VAL v166; + VAL v167; + mtp_std_list_List_1_Cons(v159, &v166, &v167); + int64_t v168 = 0LL /* C99RT_VAL */; + VAL v169; + int64_t v170; + VAL v171; + VAL v172; + mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp11(v156, v157, v158, v168, &v169, &v170, &v171, &v172); + incref(v166); + int64_t v173 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(VU64(v166)); + VAL x174; + int64_t x175; + VAL x176; + if (((bool)v173)) { + VAL v177 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v172); + VAL v178 = mw_mirth_c99_pushZ_resourceZ_labelZBang(VU64(v166), v171, v177); + x176 = v178; + x175 = v170; + x174 = v169; } else { - VAL v280 = (mw_mirth_c99_pushZ_localZ_labelZBang(VU64(v247), v234, v252)); - x277 = v280; - x276 = v236; - x275 = v235; - x274 = v237; + VAL v179 = mw_mirth_c99_pushZ_valueZ_labelZBang(VU64(v166), v171, v172); + x176 = v179; + x175 = v170; + x174 = v169; } - int64_t v281 = 1LL; - int64_t v282 = i64_add(x276, v281); - int64_t v283 = 1LL /* True */; - x246 = v283; - x245 = v240; - x244 = x274; - x243 = v282; - x242 = x275; - x241 = x277; + int64_t v180 = 1LL; + int64_t v181 = i64_add(x175, v180); + int64_t v182 = 1LL /* True */; + x165 = v182; + x164 = v167; + x163 = v181; + x162 = x176; + x161 = x174; } break; - case 0LL: { // None - int64_t v284 = 0LL /* False */; - x246 = v284; - x245 = v240; - x244 = v237; - x243 = v236; - x242 = v235; - x241 = v234; + case 0LL: { // Nil + VAL v183 = MKI64(0LL /* Nil */); + int64_t v184 = 0LL /* False */; + x165 = v184; + x164 = v183; + x163 = v156; + x162 = v158; + x161 = v157; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v233 = x246; - v232 = x245; - v231 = x244; - v230 = x243; - v229 = x242; - v228 = x241; + v155 = x165; + v154 = x165; + v153 = x164; + v152 = x162; + v151 = x161; + v150 = x163; } - decref(v232); - VAL v285 = (VVAL(VTUP(v228)->cells[1])); - VAL v286 = (mw_mirth_c99_ZPlusC99_indent(v285)); - STR* v287; - STRLIT(v287, "tup_decref_outer(", 17); - VAL v288 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v287), v286)); - VAL v289 = (mw_mirth_c99_ZPlusC99_put(v229, v288)); - STR* v290; - STRLIT(v290, ",", 1); - VAL v291 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v290), v289)); - STR* v292 = i64_show(v230); - VAL v293 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v292), v291)); - STR* v294; - STRLIT(v294, ");", 2); - VAL v295 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v294), v293)); - VAL v296 = (mw_mirth_c99_ZPlusC99_line(v295)); - VTUP(v228)->cells[1] = v296; - x58 = v228; - x57 = v231; - } - x8 = x58; - x7 = x57; + decref(v153); + int64_t v185 = VI64(VTUP(v152)->cells[3]); + VAL v186 = VVAL(VTUP(v152)->cells[1]); + int64_t v187 = VI64(VTUP(v186)->cells[4]); + VTUP(v186)->cells[4] = MKI64(v185); + VAL v188 = mw_mirth_c99_ZPlusC99_indent(v186); + STR* v189; + STRLIT(v189, "tup_decref_outer(", 17); + VAL v190 = mw_mirth_c99_ZPlusC99_put(MKSTR(v189), v188); + VAL v191 = mw_mirth_c99_ZPlusC99_put(v151, v190); + STR* v192; + STRLIT(v192, ",", 1); + VAL v193 = mw_mirth_c99_ZPlusC99_put(MKSTR(v192), v191); + STR* v194 = i64_show(v150); + VAL v195 = mw_mirth_c99_ZPlusC99_put(MKSTR(v194), v193); + STR* v196; + STRLIT(v196, ");", 2); + VAL v197 = mw_mirth_c99_ZPlusC99_put(MKSTR(v196), v195); + VAL v198 = mw_mirth_c99_ZPlusC99_line(v197); + VTUP(v198)->cells[4] = MKI64(v187); + VTUP(v152)->cells[1] = v198; + x56 = v152; + x55 = x1; + } + x6 = x56; + x5 = x55; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - return x8; + return x6; } static VAL mw_mirth_c99_c99Z_tagZ_defZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[6])); + VAL v3 = VVAL(VTUP(x2)->cells[7]); VAL v4; int64_t v5; mw_mirth_data_Tag_preferZ_inlineZAsk(v3, x1, &v4, &v5); - VTUP(x2)->cells[6] = v4; - uint64_t x6; - VAL x7; + VTUP(x2)->cells[7] = v4; + VAL x6; + uint64_t x7; if (((bool)v5)) { - x7 = x2; - x6 = x1; + x7 = x1; + x6 = x2; } else { - VAL v8 = (VVAL(VTUP(x2)->cells[4])); + VAL v8 = VVAL(VTUP(x2)->cells[5]); int64_t v9; VAL v10; mw_mirth_data_Tag_wordZ_neededZAsk(x1, v8, &v9, &v10); - VTUP(x2)->cells[4] = v10; + VTUP(x2)->cells[5] = v10; uint64_t x11; VAL x12; if (((bool)v9)) { VAL v13; VAL v14; mw_mirth_data_Tag_wordZ_c99Z_api(x1, x2, &v13, &v14); - VAL v15 = (mw_mirth_c99_ZPlusC99_indent(v14)); - incref(v13); - VAL v16 = (mw_mirth_c99_ZPlusC99_smartZ_sigZ_put(v13, v15)); - STR* v17; - STRLIT(v17, " {", 2); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16)); - VAL v19 = (mw_mirth_c99_ZPlusC99_line(v18)); - int64_t v20 = VI64(VTUP(v19)->cells[2]); - int64_t v21 = 1LL; - int64_t v22 = i64_add(v20, v21); - VTUP(v19)->cells[2] = MKI64(v22); - incref(v13); - VAL v23 = (mw_mirth_c99_c99Z_apiZ_enterZBang(v13, v19)); - VAL v24 = (mw_mirth_c99_c99Z_tagZ_bodyZBang(x1, v23)); - VAL v25 = (mw_mirth_c99_c99Z_apiZ_exitZBang(v13, v24)); - int64_t v26 = VI64(VTUP(v25)->cells[2]); - int64_t v27 = 1LL; - int64_t v28 = i64_sub(v26, v27); - int64_t v29 = 0LL; - bool v30 = (v28 < v29); - int64_t x31; - if (v30) { - int64_t v32 = 0LL; - x31 = v32; - lpush(&lbl_tag, MKU64(x1)); + VAL v15; + VAL v16; + mw_mirth_c99_ZPlusC99_c99Z_line_1_sp90(v13, v14, &v15, &v16); + int64_t v17 = VI64(VTUP(v16)->cells[2]); + int64_t v18 = 1LL; + int64_t v19 = i64_add(v17, v18); + VTUP(v16)->cells[2] = MKI64(v19); + incref(v15); + VAL v20 = mw_mirth_c99_c99Z_apiZ_enterZBang(v15, v16); + VAL v21 = mw_mirth_c99_c99Z_tagZ_bodyZBang(x1, v20); + VAL v22 = mw_mirth_c99_c99Z_apiZ_exitZBang(v15, v21); + int64_t v23 = VI64(VTUP(v22)->cells[2]); + int64_t v24 = 1LL; + int64_t v25 = i64_sub(v23, v24); + int64_t v26 = 0LL; + bool v27 = (v25 < v26); + int64_t x28; + if (v27) { + int64_t v29 = 0LL; + x28 = v29; } else { - x31 = v28; - lpush(&lbl_tag, MKU64(x1)); + x28 = v25; } - VTUP(v25)->cells[2] = MKI64(x31); - VAL v33 = (mw_mirth_c99_ZPlusC99_indent(v25)); - STR* v34; - STRLIT(v34, "}", 1); - VAL v35 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v34), v33)); - VAL v36 = (mw_mirth_c99_ZPlusC99_line(v35)); - x12 = v36; - uint64_t v37 = VU64(lpop(&lbl_tag)); - x11 = v37; + VTUP(v22)->cells[2] = MKI64(x28); + VAL v30 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2(v22); + x12 = v30; + x11 = x1; } else { x12 = x2; x11 = x1; } - VAL v38 = (VVAL(VTUP(x12)->cells[4])); - int64_t v39; - VAL v40; - mw_mirth_data_Tag_patZ_neededZAsk(x11, v38, &v39, &v40); - VTUP(x12)->cells[4] = v40; - uint64_t x41; - VAL x42; - if (((bool)v39)) { - VAL v43; - VAL v44; - mw_mirth_data_Tag_patZ_c99Z_api(x11, x12, &v43, &v44); - VAL v45 = (mw_mirth_c99_ZPlusC99_indent(v44)); - incref(v43); - VAL v46 = (mw_mirth_c99_ZPlusC99_smartZ_sigZ_put(v43, v45)); - STR* v47; - STRLIT(v47, " {", 2); - VAL v48 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v47), v46)); - VAL v49 = (mw_mirth_c99_ZPlusC99_line(v48)); - int64_t v50 = VI64(VTUP(v49)->cells[2]); - int64_t v51 = 1LL; - int64_t v52 = i64_add(v50, v51); - VTUP(v49)->cells[2] = MKI64(v52); - incref(v43); - VAL v53 = (mw_mirth_c99_c99Z_apiZ_enterZBang(v43, v49)); - VAL v54 = (mw_mirth_c99_c99Z_reverseZ_tagZ_bodyZBang(x11, v53)); - VAL v55 = (mw_mirth_c99_c99Z_apiZ_exitZBang(v43, v54)); - int64_t v56 = VI64(VTUP(v55)->cells[2]); - int64_t v57 = 1LL; - int64_t v58 = i64_sub(v56, v57); - int64_t v59 = 0LL; - bool v60 = (v58 < v59); - int64_t x61; - if (v60) { - int64_t v62 = 0LL; - x61 = v62; - lpush(&lbl_tag, MKU64(x11)); + VAL v31 = VVAL(VTUP(x12)->cells[5]); + int64_t v32; + VAL v33; + mw_mirth_data_Tag_patZ_neededZAsk(x11, v31, &v32, &v33); + VTUP(x12)->cells[5] = v33; + uint64_t x34; + VAL x35; + if (((bool)v32)) { + VAL v36; + VAL v37; + mw_mirth_data_Tag_patZ_c99Z_api(x11, x12, &v36, &v37); + VAL v38; + VAL v39; + mw_mirth_c99_ZPlusC99_c99Z_line_1_sp90(v36, v37, &v38, &v39); + int64_t v40 = VI64(VTUP(v39)->cells[2]); + int64_t v41 = 1LL; + int64_t v42 = i64_add(v40, v41); + VTUP(v39)->cells[2] = MKI64(v42); + incref(v38); + VAL v43 = mw_mirth_c99_c99Z_apiZ_enterZBang(v38, v39); + VAL v44 = mw_mirth_c99_c99Z_reverseZ_tagZ_bodyZBang(x11, v43); + VAL v45 = mw_mirth_c99_c99Z_apiZ_exitZBang(v38, v44); + int64_t v46 = VI64(VTUP(v45)->cells[2]); + int64_t v47 = 1LL; + int64_t v48 = i64_sub(v46, v47); + int64_t v49 = 0LL; + bool v50 = (v48 < v49); + int64_t x51; + if (v50) { + int64_t v52 = 0LL; + x51 = v52; } else { - x61 = v58; - lpush(&lbl_tag, MKU64(x11)); + x51 = v48; } - VTUP(v55)->cells[2] = MKI64(x61); - VAL v63 = (mw_mirth_c99_ZPlusC99_indent(v55)); - STR* v64; - STRLIT(v64, "}", 1); - VAL v65 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v64), v63)); - VAL v66 = (mw_mirth_c99_ZPlusC99_line(v65)); - x42 = v66; - uint64_t v67 = VU64(lpop(&lbl_tag)); - x41 = v67; + VTUP(v45)->cells[2] = MKI64(x51); + VAL v53 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2(v45); + x35 = v53; + x34 = x11; } else { - x42 = x12; - x41 = x11; + x35 = x12; + x34 = x11; } - x7 = x42; - x6 = x41; + x7 = x34; + x6 = x35; } - return x7; + return x6; } static void mw_mirth_c99_c99Z_tagZ_labelZ_index (uint64_t x1, uint64_t x2, VAL x3, int64_t *x4, VAL *x5) { int64_t v6 = mw_mirth_data_Tag_numZ_totalZ_inputs(x1); @@ -70854,856 +51409,716 @@ static void mw_mirth_c99_c99Z_tagZ_labelZ_index (uint64_t x1, uint64_t x2, VAL x VAL v9 = mw_mirth_data_Tag_labelZ_inputs(x1); VAL v10 = mw_std_list_List_1_reverse(v9); VAL v11 = MKI64(0LL /* None */); - VAL v12; - VAL v13; - mw_std_list_List_1_uncons(v10, &v12, &v13); - VAL x14; - uint64_t x15; - uint64_t x16; - int64_t x17; - VAL x18; - VAL x19; - int64_t x20; - switch (get_data_tag(v12)) { - case 1LL: { // Some - VAL v21 = mtp_std_maybe_Maybe_1_Some(v12); - incref(v21); - int64_t v22 = 1LL; - int64_t v23 = i64_sub(v8, v22); - int64_t v24 = 0LL; - bool v25 = (v23 < v24); - int64_t x26; - if (v25) { - int64_t v27 = 0LL; - x26 = v27; - push_resource(x3); - push_u64(x1); - push_u64(x2); - } else { - x26 = v23; - push_resource(x3); - push_u64(x1); - push_u64(x2); - } - VAL v28 = pop_value(); - incref(v28); - int64_t v29 = mw_mirth_label_Label_ZEqualZEqual(VU64(v28), VU64(v21)); - VAL x30; - uint64_t x31; - uint64_t x32; - int64_t x33; - VAL x34; - if (((bool)v29)) { - VAL v35 = mtw_std_maybe_Maybe_1_Some(v21); - x34 = v35; - x33 = x26; - x32 = VU64(v28); - uint64_t v36 = pop_u64(); - x31 = v36; - VAL r37 = pop_resource(); - x30 = r37; - } else { - decref(v21); - VAL v38 = MKI64(0LL /* None */); - x34 = v38; - x33 = x26; - x32 = VU64(v28); - uint64_t v39 = pop_u64(); - x31 = v39; - VAL r40 = pop_resource(); - x30 = r40; - } - VAL x41; - uint64_t x42; - uint64_t x43; - int64_t x44; - VAL x45; - VAL x46; - switch (get_data_tag(x34)) { - case 0LL: { // None - x46 = v13; - x45 = v11; - x44 = x33; - x43 = x32; - x42 = x31; - x41 = x30; - } break; - default: { - decref(v13); - decref(v11); - VAL v47 = MKI64(0LL /* Nil */); - x46 = v47; - x45 = x34; - x44 = x33; - x43 = x32; - x42 = x31; - x41 = x30; - } break; - } - int64_t v48 = 1LL /* True */; - x20 = v48; - x19 = x46; - x18 = x45; - x17 = x44; - x16 = x43; - x15 = x42; - x14 = x41; - } break; - case 0LL: { // None - int64_t v49 = 0LL /* False */; - x20 = v49; - x19 = v13; - x18 = v11; - x17 = v8; - x16 = x2; - x15 = x1; - x14 = x3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v50 = (x14); - uint64_t v51 = x15; - uint64_t v52 = x16; - int64_t v53 = x17; - VAL v54 = x18; - VAL v55 = x19; - int64_t v56 = x20; - while (((bool)v56)) { - VAL v57 = (v50); - uint64_t v58 = v51; - uint64_t v59 = v52; - int64_t v60 = v53; - VAL v61 = v54; - VAL v62 = v55; - VAL v63; - VAL v64; - mw_std_list_List_1_uncons(v62, &v63, &v64); - VAL x65; - uint64_t x66; - uint64_t x67; - int64_t x68; - VAL x69; - VAL x70; - int64_t x71; - switch (get_data_tag(v63)) { + int64_t v12 = 1LL /* True */; + uint64_t v13 = x2; + int64_t v14 = v8; + VAL v15 = v11; + VAL v16 = v10; + int64_t v17 = v12; + int64_t v18 = v12; + while (((bool)v18)) { + uint64_t v19 = v13; + int64_t v20 = v14; + VAL v21 = v15; + VAL v22 = v16; + int64_t v23 = v17; + VAL v24; + VAL v25; + mw_std_list_List_1_uncons(v22, &v24, &v25); + uint64_t x26; + int64_t x27; + VAL x28; + VAL x29; + int64_t x30; + switch (get_data_tag(v24)) { case 1LL: { // Some - VAL v72 = mtp_std_maybe_Maybe_1_Some(v63); - incref(v72); - int64_t v73 = 1LL; - int64_t v74 = i64_sub(v60, v73); - int64_t v75 = 0LL; - bool v76 = (v74 < v75); - int64_t x77; - if (v76) { - int64_t v78 = 0LL; - x77 = v78; - push_resource(v57); - push_u64(v58); - push_u64(v59); + VAL v31 = mtp_std_maybe_Maybe_1_Some(v24); + incref(v31); + int64_t v32 = 1LL; + int64_t v33 = i64_sub(v20, v32); + int64_t v34 = 0LL; + bool v35 = (v33 < v34); + int64_t x36; + if (v35) { + int64_t v37 = 0LL; + x36 = v37; } else { - x77 = v74; - push_resource(v57); - push_u64(v58); - push_u64(v59); + x36 = v33; } - VAL v79 = pop_value(); - incref(v79); - int64_t v80 = mw_mirth_label_Label_ZEqualZEqual(VU64(v79), VU64(v72)); - VAL x81; - uint64_t x82; - uint64_t x83; - int64_t x84; - VAL x85; - if (((bool)v80)) { - VAL v86 = mtw_std_maybe_Maybe_1_Some(v72); - x85 = v86; - x84 = x77; - x83 = VU64(v79); - uint64_t v87 = pop_u64(); - x82 = v87; - VAL r88 = pop_resource(); - x81 = r88; + int64_t v38 = mw_mirth_label_Label_ZEqualZEqual(v19, VU64(v31)); + uint64_t x39; + int64_t x40; + VAL x41; + if (((bool)v38)) { + VAL v42 = mtw_std_maybe_Maybe_1_Some(v31); + x41 = v42; + x40 = x36; + x39 = v19; } else { - decref(v72); - VAL v89 = MKI64(0LL /* None */); - x85 = v89; - x84 = x77; - x83 = VU64(v79); - uint64_t v90 = pop_u64(); - x82 = v90; - VAL r91 = pop_resource(); - x81 = r91; + decref(v31); + VAL v43 = MKI64(0LL /* None */); + x41 = v43; + x40 = x36; + x39 = v19; } - VAL x92; - uint64_t x93; - uint64_t x94; - int64_t x95; - VAL x96; - VAL x97; - switch (get_data_tag(x85)) { + uint64_t x44; + int64_t x45; + VAL x46; + VAL x47; + switch (get_data_tag(x41)) { case 0LL: { // None - x97 = v64; - x96 = v61; - x95 = x84; - x94 = x83; - x93 = x82; - x92 = x81; + x47 = v25; + x46 = v21; + x45 = x40; + x44 = x39; } break; default: { - decref(v64); - decref(v61); - VAL v98 = MKI64(0LL /* Nil */); - x97 = v98; - x96 = x85; - x95 = x84; - x94 = x83; - x93 = x82; - x92 = x81; + decref(v25); + decref(v21); + VAL v48 = MKI64(0LL /* Nil */); + x47 = v48; + x46 = x41; + x45 = x40; + x44 = x39; } break; } - int64_t v99 = 1LL /* True */; - x71 = v99; - x70 = x97; - x69 = x96; - x68 = x95; - x67 = x94; - x66 = x93; - x65 = x92; + int64_t v49 = 1LL /* True */; + x30 = v49; + x29 = x47; + x28 = x46; + x27 = x45; + x26 = x44; } break; case 0LL: { // None - int64_t v100 = 0LL /* False */; - x71 = v100; - x70 = v64; - x69 = v61; - x68 = v60; - x67 = v59; - x66 = v58; - x65 = v57; + int64_t v50 = 0LL /* False */; + x30 = v50; + x29 = v25; + x28 = v21; + x27 = v20; + x26 = v19; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v56 = x71; - v55 = x70; - v54 = x69; - v53 = x68; - v52 = x67; - v51 = x66; - v50 = x65; + v18 = x30; + v17 = x30; + v16 = x29; + v15 = x28; + v14 = x27; + v13 = x26; } - decref(v55); - decref(v54); - *x5 = v50; - *x4 = v53; + decref(v16); + decref(v15); + *x5 = x3; + *x4 = v14; } static VAL mw_mirth_c99_c99Z_tagZ_getZ_labelZBang (VAL x1, VAL x2) { uint64_t v3; uint64_t v4; VAL v5; mtp_mirth_data_TagField_TagField(x1, &v3, &v4, &v5); - VAL v6 = (VVAL(VTUP(x2)->cells[1])); - VAL v7 = (VVAL(VTUP(v6)->cells[6])); - VAL v8; - VAL v9; - mw_mirth_data_Tag_semiZ_transparentZAsk(v7, v3, &v8, &v9); - VTUP(v6)->cells[6] = v8; - VTUP(x2)->cells[1] = v6; - uint64_t x10; + VAL v6; + VAL v7; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp4(v3, x2, &v6, &v7); + int64_t v8 = get_data_tag(v6); + decref(v6); + int64_t v9 = 1LL; + bool v10 = (v8 == v9); uint64_t x11; - VAL x12; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v9); - decref(v13); - uint64_t x14; - uint64_t x15; - VAL x16; - switch (get_data_tag(v5)) { - case 0LL: { // Left - VAL v17 = mtp_std_either_Either_2_Left(v5); - int64_t v18 = mw_mirth_data_Tag_outputsZ_resourceZAsk(v3); - uint64_t x19; - uint64_t x20; - VAL x21; - if (((bool)v18)) { - int64_t v22; - VAL v23; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v17, x2, &v22, &v23); - VAL v24; - VAL v25; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v23, v22, &v24, &v25); - VAL v26; - VAL v27; - VAL v28; - mw_mirth_c99_ZPlusC99LocalResource_dupZ_localZ_resourceZ_asZ_valueZBang(v24, v25, &v26, &v27, &v28); - VAL v29 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v26, v27)); - VAL v30 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v29, v28)); - x21 = v30; - x20 = v3; - x19 = v4; - } else { - decref(v17); - x21 = x2; - x20 = v3; - x19 = v4; - } - x16 = x21; - x15 = x20; - x14 = x19; - } break; - case 1LL: { // Right - VAL v31 = mtp_std_either_Either_2_Right(v5); - decref(v31); - int64_t v32 = 2LL /* C99RT_I64 */; - VAL v33 = (VVAL(VTUP(x2)->cells[1])); - VAL v34; - VAL v35; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v33, &v34, &v35); - VAL v36 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v32, v34)); - VAL v37 = (mw_mirth_c99_ZPlusC99_indent(v35)); - int64_t v38 = VI64(VTUP(v36)->cells[1]); - VAL v39 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v38); - VAL v40 = (mw_mirth_c99_ZPlusC99_put(v39, v37)); - STR* v41; - STRLIT(v41, " ", 1); - VAL v42 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v41), v40)); - VAL v43 = VVAL(VTUP(v36)->cells[2]); - incref(v43); - VAL v44 = (mw_mirth_c99_ZPlusC99_put(v43, v42)); - STR* v45; - STRLIT(v45, " = (", 4); - VAL v46 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v45), v44)); - STR* v47; - STRLIT(v47, "0", 1); - VAL v48 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v47), v46)); - STR* v49; - STRLIT(v49, ");", 2); - VAL v50 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v49), v48)); - VAL v51 = (mw_mirth_c99_ZPlusC99_line(v50)); - VTUP(x2)->cells[1] = v51; - VAL v52 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(x2, v36)); - x16 = v52; - x15 = v3; - x14 = v4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + uint64_t x12; + VAL x13; + if (v10) { + uint64_t x14; + uint64_t x15; + VAL x16; + switch (get_data_tag(v5)) { + case 0LL: { // Left + VAL v17 = mtp_std_either_Either_2_Left(v5); + int64_t v18 = mw_mirth_data_Tag_outputsZ_resourceZAsk(v3); + uint64_t x19; + uint64_t x20; + VAL x21; + if (((bool)v18)) { + int64_t v22; + VAL v23; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v17, v7, &v22, &v23); + VAL v24; + VAL v25; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v23, v22, &v24, &v25); + VAL v26; + VAL v27; + VAL v28; + mw_mirth_c99_ZPlusC99Resource_dupZ_resourceZ_asZ_valueZBang(v24, v25, &v26, &v27, &v28); + VAL v29 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v26, v27); + VAL v30 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v29, v28); + x21 = v30; + x20 = v3; + x19 = v4; + } else { + decref(v17); + x21 = v7; + x20 = v3; + x19 = v4; } + x16 = x21; + x15 = x20; + x14 = x19; + } break; + case 1LL: { // Right + VAL v31 = mtp_std_either_Either_2_Right(v5); + decref(v31); + int64_t v32 = 2LL /* C99RT_I64 */; + VAL v33 = VVAL(VTUP(v7)->cells[1]); + VAL v34; + VAL v35; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v33, &v34, &v35); + VTUP(v7)->cells[1] = v35; + int64_t v36 = VI64(VTUP(v7)->cells[3]); + VAL v37 = VVAL(VTUP(v7)->cells[1]); + int64_t v38 = VI64(VTUP(v37)->cells[4]); + VTUP(v37)->cells[4] = MKI64(v36); + VAL v39 = mw_mirth_c99_ZPlusC99_indent(v37); + VAL v40 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v32); + VAL v41 = mw_mirth_c99_ZPlusC99_put(v40, v39); + STR* v42; + STRLIT(v42, " ", 1); + VAL v43 = mw_mirth_c99_ZPlusC99_put(MKSTR(v42), v41); + incref(v34); + VAL v44 = mw_mirth_c99_ZPlusC99_put(v34, v43); + STR* v45; + STRLIT(v45, " = ", 3); + VAL v46 = mw_mirth_c99_ZPlusC99_put(MKSTR(v45), v44); + VAL v47 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v32, v34); + STR* v48; + STRLIT(v48, "0", 1); + VAL v49 = mw_mirth_c99_ZPlusC99_put(MKSTR(v48), v46); + STR* v50; + STRLIT(v50, ";", 1); + VAL v51 = mw_mirth_c99_ZPlusC99_put(MKSTR(v50), v49); + VAL v52 = mw_mirth_c99_ZPlusC99_line(v51); + VTUP(v52)->cells[4] = MKI64(v38); + VTUP(v7)->cells[1] = v52; + VAL v53 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v7, v47); + x16 = v53; + x15 = v3; + x14 = v4; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); } - x12 = x16; - x11 = x15; - x10 = x14; - } break; - case 0LL: { // None - uint64_t v53 = mw_mirth_data_Tag_data(v3); - VAL v54; - VAL v55; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_valueZDivresourceZ_dataZBang(v53, x2, &v54, &v55); - uint64_t x56; - uint64_t x57; - VAL x58; - switch (get_data_tag(v5)) { - case 0LL: { // Left - VAL v59 = mtp_std_either_Either_2_Left(v5); - int64_t v60; - VAL v61; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v59, v54, &v60, &v61); - VAL v62 = (VVAL(VTUP(v61)->cells[1])); - VAL v63; - VAL v64; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v62, &v63, &v64); - VAL v65 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v60, v63)); - VAL v66 = (mw_mirth_c99_ZPlusC99_indent(v64)); - int64_t v67 = VI64(VTUP(v65)->cells[1]); - VAL v68 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v67); - VAL v69 = (mw_mirth_c99_ZPlusC99_put(v68, v66)); - STR* v70; - STRLIT(v70, " ", 1); - VAL v71 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v70), v69)); - VAL v72 = VVAL(VTUP(v65)->cells[2]); - incref(v72); - VAL v73 = (mw_mirth_c99_ZPlusC99_put(v72, v71)); - STR* v74; - STRLIT(v74, " = ", 3); - VAL v75 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v73)); - VAL v76 = mw_mirth_c99_C99ReprType_vZ_macro(v60); - VAL v77 = (mw_mirth_c99_ZPlusC99_put(v76, v75)); - STR* v78; - STRLIT(v78, "(VTUP(", 6); - VAL v79 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v78), v77)); - VAL v80; - VAL v81; - mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdup(v55, &v80, &v81); - VAL v82 = mw_mirth_c99_ZPlusC99LocalValueZDivResource_consumeZ_asZ_VAL(v80); - VAL v83 = (mw_mirth_c99_ZPlusC99_put(v82, v79)); - STR* v84; - STRLIT(v84, ")->cells[", 9); - VAL v85 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v84), v83)); - int64_t v86; - VAL v87; - mw_mirth_c99_c99Z_tagZ_labelZ_index(v3, v4, v85, &v86, &v87); - STR* v88 = i64_show(v86); - VAL v89 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v88), v87)); - STR* v90; - STRLIT(v90, "])", 2); - VAL v91 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v90), v89)); - STR* v92; - STRLIT(v92, ";", 1); - VAL v93 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v92), v91)); - VAL v94 = (mw_mirth_c99_ZPlusC99_line(v93)); - VTUP(v61)->cells[1] = v94; - VAL v95; - VAL v96; - VAL v97; - mw_mirth_c99_ZPlusC99Local_dupZ_localZBang(v61, v65, &v95, &v96, &v97); - mw_mirth_c99_ZPlusC99Local_rdrop(v97); - VAL v98 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v95, v96)); - uint64_t x99; - uint64_t x100; - VAL x101; - switch (get_data_tag(v81)) { - case 0LL: { // +Left - VAL v102 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(v81)); - VAL v103 = (mw_mirth_c99_ZPlusC99Local_dropZ_localZBang(v98, v102)); - x101 = v103; - x100 = v4; - x99 = v3; - } break; - case 1LL: { // +Right - VAL v104 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(v81)); - VAL v105 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v98, v104)); - x101 = v105; - x100 = v4; - x99 = v3; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + } + x13 = x16; + x12 = x15; + x11 = x14; + } else { + uint64_t v54 = mw_mirth_data_Tag_data(v3); + VAL v55; + VAL v56; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_valueZDivresourceZ_dataZBang(v54, v7, &v55, &v56); + uint64_t x57; + uint64_t x58; + VAL x59; + switch (get_data_tag(v5)) { + case 0LL: { // Left + VAL v60 = mtp_std_either_Either_2_Left(v5); + int64_t v61; + VAL v62; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v60, v55, &v61, &v62); + VAL v63 = VVAL(VTUP(v62)->cells[1]); + VAL v64; + VAL v65; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v63, &v64, &v65); + VTUP(v62)->cells[1] = v65; + int64_t v66 = VI64(VTUP(v62)->cells[3]); + VAL v67 = VVAL(VTUP(v62)->cells[1]); + int64_t v68 = VI64(VTUP(v67)->cells[4]); + VTUP(v67)->cells[4] = MKI64(v66); + VAL v69 = mw_mirth_c99_ZPlusC99_indent(v67); + VAL v70 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v61); + VAL v71 = mw_mirth_c99_ZPlusC99_put(v70, v69); + STR* v72; + STRLIT(v72, " ", 1); + VAL v73 = mw_mirth_c99_ZPlusC99_put(MKSTR(v72), v71); + incref(v64); + VAL v74 = mw_mirth_c99_ZPlusC99_put(v64, v73); + STR* v75; + STRLIT(v75, " = ", 3); + VAL v76 = mw_mirth_c99_ZPlusC99_put(MKSTR(v75), v74); + VAL v77 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v61, v64); + VAL v78 = mw_mirth_c99_C99ReprType_vZ_macro(v61); + VAL v79 = mw_mirth_c99_ZPlusC99_put(v78, v76); + STR* v80; + STRLIT(v80, "(VTUP(", 6); + VAL v81 = mw_mirth_c99_ZPlusC99_put(MKSTR(v80), v79); + VAL v82; + VAL v83; + mw_mirth_c99_ZPlusC99ValueZDivResource_rdup(v56, &v82, &v83); + VAL v84 = mw_mirth_c99_ZPlusC99ValueZDivResource_consumeZ_asZ_VAL(v82); + VAL v85 = mw_mirth_c99_ZPlusC99_put(v84, v81); + STR* v86; + STRLIT(v86, ")->cells[", 9); + VAL v87 = mw_mirth_c99_ZPlusC99_put(MKSTR(v86), v85); + int64_t v88; + VAL v89; + mw_mirth_c99_c99Z_tagZ_labelZ_index(v3, v4, v87, &v88, &v89); + STR* v90 = i64_show(v88); + VAL v91 = mw_mirth_c99_ZPlusC99_put(MKSTR(v90), v89); + STR* v92; + STRLIT(v92, "])", 2); + VAL v93 = mw_mirth_c99_ZPlusC99_put(MKSTR(v92), v91); + STR* v94; + STRLIT(v94, ";", 1); + VAL v95 = mw_mirth_c99_ZPlusC99_put(MKSTR(v94), v93); + VAL v96 = mw_mirth_c99_ZPlusC99_line(v95); + VTUP(v96)->cells[4] = MKI64(v68); + VTUP(v62)->cells[1] = v96; + VAL v97; + VAL v98; + VAL v99; + mw_mirth_c99_ZPlusC99Value_dupZ_valueZBang(v62, v77, &v97, &v98, &v99); + mw_mirth_c99_ZPlusC99Value_rdrop(v99); + VAL v100 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v97, v98); + uint64_t x101; + uint64_t x102; + VAL x103; + switch (get_data_tag(v83)) { + case 0LL: { // +Left + VAL v104 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(v83); + VAL v105 = mw_mirth_c99_ZPlusC99Value_dropZ_valueZBang(v100, v104); + x103 = v105; + x102 = v4; + x101 = v3; + } break; + case 1LL: { // +Right + VAL v106 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(v83); + VAL v107 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v100, v106); + x103 = v107; + x102 = v4; + x101 = v3; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); } - x58 = x101; - x57 = x100; - x56 = x99; - } break; - case 1LL: { // Right - VAL v106 = mtp_std_either_Either_2_Right(v5); - int64_t v107; - VAL v108; - mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v106, v54, &v107, &v108); - VAL v109 = (VVAL(VTUP(v108)->cells[1])); - VAL v110; - VAL v111; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v109, &v110, &v111); - VAL v112 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v107, v110)); - VAL v113 = (mw_mirth_c99_ZPlusC99_indent(v111)); - int64_t v114 = VI64(VTUP(v112)->cells[1]); - VAL v115 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v114); - VAL v116 = (mw_mirth_c99_ZPlusC99_put(v115, v113)); - STR* v117; - STRLIT(v117, " ", 1); - VAL v118 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v117), v116)); - VAL v119 = VVAL(VTUP(v112)->cells[2]); - incref(v119); - VAL v120 = (mw_mirth_c99_ZPlusC99_put(v119, v118)); - STR* v121; - STRLIT(v121, " = (", 4); - VAL v122 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v121), v120)); - VAL v123 = mw_mirth_c99_C99ReprType_vZ_macro(v107); - VAL v124 = (mw_mirth_c99_ZPlusC99_put(v123, v122)); - STR* v125; - STRLIT(v125, "(VTUP(", 6); - VAL v126 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v125), v124)); - VAL v127; - VAL v128; - mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdup(v55, &v127, &v128); - VAL v129 = mw_mirth_c99_ZPlusC99LocalValueZDivResource_consumeZ_asZ_VAL(v127); - VAL v130 = (mw_mirth_c99_ZPlusC99_put(v129, v126)); - STR* v131; - STRLIT(v131, ")->cells[", 9); - VAL v132 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v131), v130)); - int64_t v133; - VAL v134; - mw_mirth_c99_c99Z_tagZ_labelZ_index(v3, v4, v132, &v133, &v134); - STR* v135 = i64_show(v133); - VAL v136 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v135), v134)); - STR* v137; - STRLIT(v137, "])", 2); - VAL v138 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v137), v136)); - STR* v139; - STRLIT(v139, ");", 2); - VAL v140 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v139), v138)); - VAL v141 = (mw_mirth_c99_ZPlusC99_line(v140)); - VTUP(v108)->cells[1] = v141; - VAL v142 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v108, v112)); - lpush(&lbl_tag, MKU64(v3)); - lpush(&lbl_label, MKU64(v4)); - VAL v143 = (mw_mirth_c99_ZPlusC99LocalValueZDivResource_pushZ_localZ_valueZDivresourceZBang(v142, v128)); - x58 = v143; - uint64_t v144 = VU64(lpop(&lbl_label)); - x57 = v144; - uint64_t v145 = VU64(lpop(&lbl_tag)); - x56 = v145; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); } + x59 = x103; + x58 = x102; + x57 = x101; + } break; + case 1LL: { // Right + VAL v108 = mtp_std_either_Either_2_Right(v5); + int64_t v109; + VAL v110; + mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v108, v55, &v109, &v110); + VAL v111 = VVAL(VTUP(v110)->cells[1]); + VAL v112; + VAL v113; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v111, &v112, &v113); + VTUP(v110)->cells[1] = v113; + int64_t v114 = VI64(VTUP(v110)->cells[3]); + VAL v115 = VVAL(VTUP(v110)->cells[1]); + int64_t v116 = VI64(VTUP(v115)->cells[4]); + VTUP(v115)->cells[4] = MKI64(v114); + VAL v117 = mw_mirth_c99_ZPlusC99_indent(v115); + VAL v118 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v109); + VAL v119 = mw_mirth_c99_ZPlusC99_put(v118, v117); + STR* v120; + STRLIT(v120, " ", 1); + VAL v121 = mw_mirth_c99_ZPlusC99_put(MKSTR(v120), v119); + incref(v112); + VAL v122 = mw_mirth_c99_ZPlusC99_put(v112, v121); + STR* v123; + STRLIT(v123, " = ", 3); + VAL v124 = mw_mirth_c99_ZPlusC99_put(MKSTR(v123), v122); + VAL v125 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v109, v112); + VAL v126 = mw_mirth_c99_C99ReprType_vZ_macro(v109); + VAL v127 = mw_mirth_c99_ZPlusC99_put(v126, v124); + STR* v128; + STRLIT(v128, "(VTUP(", 6); + VAL v129 = mw_mirth_c99_ZPlusC99_put(MKSTR(v128), v127); + VAL v130; + VAL v131; + mw_mirth_c99_ZPlusC99ValueZDivResource_rdup(v56, &v130, &v131); + VAL v132 = mw_mirth_c99_ZPlusC99ValueZDivResource_consumeZ_asZ_VAL(v130); + VAL v133 = mw_mirth_c99_ZPlusC99_put(v132, v129); + STR* v134; + STRLIT(v134, ")->cells[", 9); + VAL v135 = mw_mirth_c99_ZPlusC99_put(MKSTR(v134), v133); + int64_t v136; + VAL v137; + mw_mirth_c99_c99Z_tagZ_labelZ_index(v3, v4, v135, &v136, &v137); + STR* v138 = i64_show(v136); + VAL v139 = mw_mirth_c99_ZPlusC99_put(MKSTR(v138), v137); + STR* v140; + STRLIT(v140, "])", 2); + VAL v141 = mw_mirth_c99_ZPlusC99_put(MKSTR(v140), v139); + STR* v142; + STRLIT(v142, ";", 1); + VAL v143 = mw_mirth_c99_ZPlusC99_put(MKSTR(v142), v141); + VAL v144 = mw_mirth_c99_ZPlusC99_line(v143); + VTUP(v144)->cells[4] = MKI64(v116); + VTUP(v110)->cells[1] = v144; + VAL v145 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v110, v125); + VAL v146 = mw_mirth_c99_ZPlusC99ValueZDivResource_pushZ_valueZ_valueZDivresourceZBang(v145, v131); + x59 = v146; + x58 = v4; + x57 = v3; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); } - x12 = x58; - x11 = x56; - x10 = x57; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); } + x13 = x59; + x12 = x57; + x11 = x58; } - return x12; + return x13; } static VAL mw_mirth_c99_c99Z_tagZ_setZ_labelZBang (VAL x1, VAL x2) { uint64_t v3; uint64_t v4; VAL v5; mtp_mirth_data_TagField_TagField(x1, &v3, &v4, &v5); - VAL v6 = (VVAL(VTUP(x2)->cells[1])); - VAL v7 = (VVAL(VTUP(v6)->cells[6])); - VAL v8; - VAL v9; - mw_mirth_data_Tag_semiZ_transparentZAsk(v7, v3, &v8, &v9); - VTUP(v6)->cells[6] = v8; - VTUP(x2)->cells[1] = v6; - uint64_t x10; + VAL v6; + VAL v7; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp4(v3, x2, &v6, &v7); + int64_t v8 = get_data_tag(v6); + decref(v6); + int64_t v9 = 1LL; + bool v10 = (v8 == v9); uint64_t x11; - VAL x12; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v9); - decref(v13); - uint64_t x14; - uint64_t x15; - VAL x16; - switch (get_data_tag(v5)) { - case 0LL: { // Left - VAL v17 = mtp_std_either_Either_2_Left(v5); - uint64_t v18 = mw_mirth_data_Tag_data(v3); - VAL v19; - VAL v20; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_valueZDivresourceZ_dataZBang(v18, x2, &v19, &v20); - uint64_t x21; - uint64_t x22; - VAL x23; - switch (get_data_tag(v20)) { - case 1LL: { // +Right - VAL v24 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(v20)); - VAL v25 = (mw_mirth_c99_ZPlusC99LocalResource_dropZ_localZ_resourceZ_asZ_valueZBang(v19, v24)); - int64_t v26; - VAL v27; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v17, v25, &v26, &v27); - VAL v28; - VAL v29; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v27, v26, &v28, &v29); - VAL v30 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v29)); - VAL v31 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v28, v30)); - x23 = v31; - x22 = v3; - x21 = v4; - } break; - case 0LL: { // +Left - VAL v32 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(v20)); - decref(v17); - VAL v33 = (mw_mirth_c99_ZPlusC99Local_dropZ_localZBang(v19, v32)); - x23 = v33; - x22 = v3; - x21 = v4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + uint64_t x12; + VAL x13; + if (v10) { + uint64_t x14; + uint64_t x15; + VAL x16; + switch (get_data_tag(v5)) { + case 0LL: { // Left + VAL v17 = mtp_std_either_Either_2_Left(v5); + uint64_t v18 = mw_mirth_data_Tag_data(v3); + VAL v19; + VAL v20; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_valueZDivresourceZ_dataZBang(v18, v7, &v19, &v20); + uint64_t x21; + uint64_t x22; + VAL x23; + switch (get_data_tag(v20)) { + case 1LL: { // +Right + VAL v24 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(v20); + VAL v25 = mw_mirth_c99_ZPlusC99Resource_dropZ_resourceZ_asZ_valueZBang(v19, v24); + int64_t v26; + VAL v27; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v17, v25, &v26, &v27); + VAL v28; + VAL v29; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v27, v26, &v28, &v29); + VAL v30 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v29); + VAL v31 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v28, v30); + x23 = v31; + x22 = v3; + x21 = v4; + } break; + case 0LL: { // +Left + VAL v32 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(v20); + decref(v17); + VAL v33 = mw_mirth_c99_ZPlusC99Value_dropZ_valueZBang(v19, v32); + x23 = v33; + x22 = v3; + x21 = v4; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); } - x16 = x23; - x15 = x22; - x14 = x21; - } break; - case 1LL: { // Right - VAL v34 = mtp_std_either_Either_2_Right(v5); - int64_t v35 = 2LL /* C99RT_I64 */; - VAL v36; - VAL v37; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(x2, v35, &v36, &v37); - mw_mirth_c99_ZPlusC99LocalResource_rdrop(v37); - decref(v34); - x16 = v36; - x15 = v3; - x14 = v4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); } + x16 = x23; + x15 = x22; + x14 = x21; + } break; + case 1LL: { // Right + VAL v34 = mtp_std_either_Either_2_Right(v5); + int64_t v35 = 2LL /* C99RT_I64 */; + VAL v36; + VAL v37; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v7, v35, &v36, &v37); + mw_mirth_c99_ZPlusC99Resource_rdrop(v37); + decref(v34); + x16 = v36; + x15 = v3; + x14 = v4; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); } - x12 = x16; - x11 = x15; - x10 = x14; - } break; - case 0LL: { // None - uint64_t v38 = mw_mirth_data_Tag_data(v3); - VAL v39; - VAL v40; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_valueZDivresourceZ_dataZBang(v38, x2, &v39, &v40); - incref(v5); - uint64_t x41; - uint64_t x42; - VAL x43; - VAL x44; - VAL x45; - VAL x46; - switch (get_data_tag(v5)) { - case 0LL: { // Left - VAL v47 = mtp_std_either_Either_2_Left(v5); - int64_t v48; - VAL v49; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v47, v39, &v48, &v49); - VAL v50; - VAL v51; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v49, v48, &v50, &v51); - VAL v52 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v51); - x46 = v52; - x45 = v50; - x44 = v5; - x43 = v40; - x42 = v3; - x41 = v4; - } break; - case 1LL: { // Right - VAL v53 = mtp_std_either_Either_2_Right(v5); - int64_t v54; - VAL v55; - mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v53, v39, &v54, &v55); - VAL v56; - VAL v57; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v55, v54, &v56, &v57); - VAL v58 = mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL(v57); - x46 = v58; - x45 = v56; - x44 = v5; - x43 = v40; - x42 = v3; - x41 = v4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + } + x13 = x16; + x12 = x15; + x11 = x14; + } else { + uint64_t v38 = mw_mirth_data_Tag_data(v3); + VAL v39; + VAL v40; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_valueZDivresourceZ_dataZBang(v38, v7, &v39, &v40); + incref(v5); + uint64_t x41; + uint64_t x42; + VAL x43; + VAL x44; + VAL x45; + VAL x46; + switch (get_data_tag(v5)) { + case 0LL: { // Left + VAL v47 = mtp_std_either_Either_2_Left(v5); + int64_t v48; + VAL v49; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v47, v39, &v48, &v49); + VAL v50; + VAL v51; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v49, v48, &v50, &v51); + VAL v52 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v51); + x46 = v52; + x45 = v50; + x44 = v5; + x43 = v40; + x42 = v3; + x41 = v4; + } break; + case 1LL: { // Right + VAL v53 = mtp_std_either_Either_2_Right(v5); + int64_t v54; + VAL v55; + mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v53, v39, &v54, &v55); + VAL v56; + VAL v57; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v55, v54, &v56, &v57); + VAL v58 = mw_mirth_c99_ZPlusC99Resource_consumeZ_asZ_VAL(v57); + x46 = v58; + x45 = v56; + x44 = v5; + x43 = v40; + x42 = v3; + x41 = v4; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); } - uint64_t x59; - uint64_t x60; - VAL x61; - switch (get_data_tag(x43)) { - case 0LL: { // +Left - VAL v62 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(x43)); - VAL v63 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v62); - int64_t v64 = 0LL /* C99RT_VAL */; - VAL v65 = (VVAL(VTUP(x45)->cells[1])); - VAL v66; - VAL v67; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v65, &v66, &v67); - VAL v68 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v64, v66)); - VAL v69 = (mw_mirth_c99_ZPlusC99_indent(v67)); - int64_t v70 = VI64(VTUP(v68)->cells[1]); - VAL v71 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v70); - VAL v72 = (mw_mirth_c99_ZPlusC99_put(v71, v69)); - STR* v73; - STRLIT(v73, " ", 1); - VAL v74 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v73), v72)); - VAL v75 = VVAL(VTUP(v68)->cells[2]); - incref(v75); - VAL v76 = (mw_mirth_c99_ZPlusC99_put(v75, v74)); - STR* v77; - STRLIT(v77, " = ", 3); - VAL v78 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v77), v76)); - STR* v79; - STRLIT(v79, "tup_replace(", 12); - VAL v80 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v79), v78)); - VAL v81 = (mw_mirth_c99_ZPlusC99_put(v63, v80)); - STR* v82; - STRLIT(v82, ", ", 2); - VAL v83 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v82), v81)); - int64_t v84; - VAL v85; - mw_mirth_c99_c99Z_tagZ_labelZ_index(x42, x41, v83, &v84, &v85); - STR* v86 = i64_show(v84); - VAL v87 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v86), v85)); - STR* v88; - STRLIT(v88, ", ", 2); - VAL v89 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v88), v87)); - VAL v90 = (mw_mirth_c99_ZPlusC99_put(x46, v89)); - STR* v91; - STRLIT(v91, ")", 1); - VAL v92 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v91), v90)); - STR* v93; - STRLIT(v93, ";", 1); - VAL v94 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v93), v92)); - VAL v95 = (mw_mirth_c99_ZPlusC99_line(v94)); - VTUP(x45)->cells[1] = v95; - VAL v96 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x45, v68)); - decref(x44); - x61 = v96; - x60 = x41; - x59 = x42; - } break; - case 1LL: { // +Right - VAL v97 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(x43)); - uint64_t x98; - uint64_t x99; - VAL x100; - VAL x101; - VAL x102; - switch (get_data_tag(x44)) { - case 0LL: { // Left - VAL v103 = mtp_std_either_Either_2_Left(x44); - int64_t v104; - VAL v105; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v103, x45, &v104, &v105); - int64_t v106 = mw_mirth_c99_C99ReprType_needsZ_refcountingZAsk(v104); - uint64_t x107; - uint64_t x108; - VAL x109; - VAL x110; - VAL x111; - int64_t x112; - if (((bool)v106)) { - VAL v113 = (VVAL(VTUP(v105)->cells[1])); - VAL v114; - VAL v115; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v113, &v114, &v115); - VAL v116 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v104, v114)); - VAL v117 = (mw_mirth_c99_ZPlusC99_indent(v115)); - int64_t v118 = VI64(VTUP(v116)->cells[1]); - VAL v119 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v118); - VAL v120 = (mw_mirth_c99_ZPlusC99_put(v119, v117)); - STR* v121; - STRLIT(v121, " ", 1); - VAL v122 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v121), v120)); - VAL v123 = VVAL(VTUP(v116)->cells[2]); - incref(v123); - VAL v124 = (mw_mirth_c99_ZPlusC99_put(v123, v122)); - STR* v125; - STRLIT(v125, " = ", 3); - VAL v126 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v125), v124)); - STR* v127; - STRLIT(v127, "VTUP(", 5); - VAL v128 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v127), v126)); - VAL v129; - VAL v130; - mw_mirth_c99_ZPlusC99LocalResource_rdup(v97, &v129, &v130); - VAL v131 = mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL(v129); - VAL v132 = (mw_mirth_c99_ZPlusC99_put(v131, v128)); - STR* v133; - STRLIT(v133, ")->cells[", 9); - VAL v134 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v133), v132)); - int64_t v135; - VAL v136; - mw_mirth_c99_c99Z_tagZ_labelZ_index(x42, x41, v134, &v135, &v136); - STR* v137 = i64_show(v135); - VAL v138 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v137), v136)); - STR* v139; - STRLIT(v139, "]", 1); - VAL v140 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v139), v138)); - STR* v141; - STRLIT(v141, ";", 1); - VAL v142 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v141), v140)); - VAL v143 = (mw_mirth_c99_ZPlusC99_line(v142)); - VTUP(v105)->cells[1] = v143; - VAL v144 = (mw_mirth_c99_ZPlusC99Local_dropZ_localZBang(v105, v116)); - x112 = v104; - x111 = v144; - x110 = v130; - x109 = x46; - x108 = x42; - x107 = x41; - } else { - x112 = v104; - x111 = v105; - x110 = v97; - x109 = x46; - x108 = x42; - x107 = x41; - } - x102 = x111; - x101 = x110; - x100 = x109; - x99 = x108; - x98 = x107; - } break; - case 1LL: { // Right - VAL v145 = mtp_std_either_Either_2_Right(x44); - decref(v145); - x102 = x45; - x101 = v97; - x100 = x46; - x99 = x42; - x98 = x41; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + uint64_t x59; + uint64_t x60; + VAL x61; + switch (get_data_tag(x43)) { + case 0LL: { // +Left + VAL v62 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(x43); + VAL v63 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v62); + int64_t v64 = 0LL /* C99RT_VAL */; + VAL v65 = VVAL(VTUP(x45)->cells[1]); + VAL v66; + VAL v67; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v65, &v66, &v67); + VTUP(x45)->cells[1] = v67; + int64_t v68 = VI64(VTUP(x45)->cells[3]); + VAL v69 = VVAL(VTUP(x45)->cells[1]); + int64_t v70 = VI64(VTUP(v69)->cells[4]); + VTUP(v69)->cells[4] = MKI64(v68); + VAL v71 = mw_mirth_c99_ZPlusC99_indent(v69); + VAL v72 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v64); + VAL v73 = mw_mirth_c99_ZPlusC99_put(v72, v71); + STR* v74; + STRLIT(v74, " ", 1); + VAL v75 = mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v73); + incref(v66); + VAL v76 = mw_mirth_c99_ZPlusC99_put(v66, v75); + STR* v77; + STRLIT(v77, " = ", 3); + VAL v78 = mw_mirth_c99_ZPlusC99_put(MKSTR(v77), v76); + VAL v79 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v64, v66); + STR* v80; + STRLIT(v80, "tup_replace(", 12); + VAL v81 = mw_mirth_c99_ZPlusC99_put(MKSTR(v80), v78); + VAL v82 = mw_mirth_c99_ZPlusC99_put(v63, v81); + STR* v83; + STRLIT(v83, ", ", 2); + VAL v84 = mw_mirth_c99_ZPlusC99_put(MKSTR(v83), v82); + int64_t v85; + VAL v86; + mw_mirth_c99_c99Z_tagZ_labelZ_index(x42, x41, v84, &v85, &v86); + STR* v87 = i64_show(v85); + VAL v88 = mw_mirth_c99_ZPlusC99_put(MKSTR(v87), v86); + STR* v89; + STRLIT(v89, ", ", 2); + VAL v90 = mw_mirth_c99_ZPlusC99_put(MKSTR(v89), v88); + VAL v91 = mw_mirth_c99_ZPlusC99_put(x46, v90); + STR* v92; + STRLIT(v92, ")", 1); + VAL v93 = mw_mirth_c99_ZPlusC99_put(MKSTR(v92), v91); + STR* v94; + STRLIT(v94, ";", 1); + VAL v95 = mw_mirth_c99_ZPlusC99_put(MKSTR(v94), v93); + VAL v96 = mw_mirth_c99_ZPlusC99_line(v95); + VTUP(v96)->cells[4] = MKI64(v70); + VTUP(x45)->cells[1] = v96; + VAL v97 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x45, v79); + decref(x44); + x61 = v97; + x60 = x41; + x59 = x42; + } break; + case 1LL: { // +Right + VAL v98 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(x43); + uint64_t x99; + uint64_t x100; + VAL x101; + VAL x102; + VAL x103; + switch (get_data_tag(x44)) { + case 0LL: { // Left + VAL v104 = mtp_std_either_Either_2_Left(x44); + int64_t v105; + VAL v106; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v104, x45, &v105, &v106); + int64_t v107 = mw_mirth_c99_C99ReprType_needsZ_refcountingZAsk(v105); + int64_t x108; + VAL x109; + uint64_t x110; + uint64_t x111; + VAL x112; + if (((bool)v107)) { + VAL v113 = VVAL(VTUP(v106)->cells[1]); + VAL v114; + VAL v115; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v113, &v114, &v115); + VTUP(v106)->cells[1] = v115; + int64_t v116 = VI64(VTUP(v106)->cells[3]); + VAL v117 = VVAL(VTUP(v106)->cells[1]); + int64_t v118 = VI64(VTUP(v117)->cells[4]); + VTUP(v117)->cells[4] = MKI64(v116); + VAL v119 = mw_mirth_c99_ZPlusC99_indent(v117); + VAL v120 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v105); + VAL v121 = mw_mirth_c99_ZPlusC99_put(v120, v119); + STR* v122; + STRLIT(v122, " ", 1); + VAL v123 = mw_mirth_c99_ZPlusC99_put(MKSTR(v122), v121); + incref(v114); + VAL v124 = mw_mirth_c99_ZPlusC99_put(v114, v123); + STR* v125; + STRLIT(v125, " = ", 3); + VAL v126 = mw_mirth_c99_ZPlusC99_put(MKSTR(v125), v124); + VAL v127 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v105, v114); + STR* v128; + STRLIT(v128, "VTUP(", 5); + VAL v129 = mw_mirth_c99_ZPlusC99_put(MKSTR(v128), v126); + VAL v130; + VAL v131; + mw_mirth_c99_ZPlusC99Resource_rdup(v98, &v130, &v131); + VAL v132 = mw_mirth_c99_ZPlusC99Resource_consumeZ_asZ_VAL(v130); + VAL v133 = mw_mirth_c99_ZPlusC99_put(v132, v129); + STR* v134; + STRLIT(v134, ")->cells[", 9); + VAL v135 = mw_mirth_c99_ZPlusC99_put(MKSTR(v134), v133); + int64_t v136; + VAL v137; + mw_mirth_c99_c99Z_tagZ_labelZ_index(x42, x41, v135, &v136, &v137); + STR* v138 = i64_show(v136); + VAL v139 = mw_mirth_c99_ZPlusC99_put(MKSTR(v138), v137); + STR* v140; + STRLIT(v140, "]", 1); + VAL v141 = mw_mirth_c99_ZPlusC99_put(MKSTR(v140), v139); + STR* v142; + STRLIT(v142, ";", 1); + VAL v143 = mw_mirth_c99_ZPlusC99_put(MKSTR(v142), v141); + VAL v144 = mw_mirth_c99_ZPlusC99_line(v143); + VTUP(v144)->cells[4] = MKI64(v118); + VTUP(v106)->cells[1] = v144; + VAL v145 = mw_mirth_c99_ZPlusC99Value_dropZ_valueZBang(v106, v127); + x112 = v145; + x111 = x41; + x110 = x42; + x109 = v131; + x108 = v105; + } else { + x112 = v106; + x111 = x41; + x110 = x42; + x109 = v98; + x108 = v105; } + x103 = x112; + x102 = x109; + x101 = x46; + x100 = x110; + x99 = x111; + } break; + case 1LL: { // Right + VAL v146 = mtp_std_either_Either_2_Right(x44); + decref(v146); + x103 = x45; + x102 = v98; + x101 = x46; + x100 = x42; + x99 = x41; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); } - VAL v146 = (VVAL(VTUP(x102)->cells[1])); - VAL v147 = (mw_mirth_c99_ZPlusC99_indent(v146)); - STR* v148; - STRLIT(v148, "VTUP(", 5); - VAL v149 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v148), v147)); - VAL v150; - VAL v151; - mw_mirth_c99_ZPlusC99LocalResource_rdup(x101, &v150, &v151); - VAL v152 = mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL(v150); - VAL v153 = (mw_mirth_c99_ZPlusC99_put(v152, v149)); - STR* v154; - STRLIT(v154, ")->cells[", 9); - VAL v155 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v154), v153)); - int64_t v156; - VAL v157; - mw_mirth_c99_c99Z_tagZ_labelZ_index(x99, x98, v155, &v156, &v157); - STR* v158 = i64_show(v156); - VAL v159 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v158), v157)); - STR* v160; - STRLIT(v160, "] = ", 4); - VAL v161 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v160), v159)); - VAL v162 = (mw_mirth_c99_ZPlusC99_put(x100, v161)); - STR* v163; - STRLIT(v163, ";", 1); - VAL v164 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v163), v162)); - VAL v165 = (mw_mirth_c99_ZPlusC99_line(v164)); - VTUP(x102)->cells[1] = v165; - VAL v166 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(x102, v151)); - x61 = v166; - x60 = x98; - x59 = x99; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); } + int64_t v147 = VI64(VTUP(x103)->cells[3]); + VAL v148 = VVAL(VTUP(x103)->cells[1]); + int64_t v149 = VI64(VTUP(v148)->cells[4]); + VTUP(v148)->cells[4] = MKI64(v147); + VAL v150 = mw_mirth_c99_ZPlusC99_indent(v148); + STR* v151; + STRLIT(v151, "VTUP(", 5); + VAL v152 = mw_mirth_c99_ZPlusC99_put(MKSTR(v151), v150); + VAL v153; + VAL v154; + mw_mirth_c99_ZPlusC99Resource_rdup(x102, &v153, &v154); + VAL v155 = mw_mirth_c99_ZPlusC99Resource_consumeZ_asZ_VAL(v153); + VAL v156 = mw_mirth_c99_ZPlusC99_put(v155, v152); + STR* v157; + STRLIT(v157, ")->cells[", 9); + VAL v158 = mw_mirth_c99_ZPlusC99_put(MKSTR(v157), v156); + int64_t v159; + VAL v160; + mw_mirth_c99_c99Z_tagZ_labelZ_index(x100, x99, v158, &v159, &v160); + STR* v161 = i64_show(v159); + VAL v162 = mw_mirth_c99_ZPlusC99_put(MKSTR(v161), v160); + STR* v163; + STRLIT(v163, "] = ", 4); + VAL v164 = mw_mirth_c99_ZPlusC99_put(MKSTR(v163), v162); + VAL v165 = mw_mirth_c99_ZPlusC99_put(x101, v164); + STR* v166; + STRLIT(v166, ";", 1); + VAL v167 = mw_mirth_c99_ZPlusC99_put(MKSTR(v166), v165); + VAL v168 = mw_mirth_c99_ZPlusC99_line(v167); + VTUP(v168)->cells[4] = MKI64(v149); + VTUP(x103)->cells[1] = v168; + VAL v169 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(x103, v154); + x61 = v169; + x60 = x99; + x59 = x100; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); } - x12 = x61; - x11 = x59; - x10 = x60; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); } + x13 = x61; + x12 = x59; + x11 = x60; } - return x12; + return x13; } static VAL mw_mirth_c99_c99Z_externalZ_blocksZBang (VAL x1) { int64_t v2 = 1LL; void* v3 = mbuf_mirth_external_ExternalBlock_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (mw_mirth_c99_c99Z_externalZ_blockZBang(((uint64_t)v10), v9)); + VAL v11 = mw_mirth_c99_c99Z_externalZ_blockZBang(((uint64_t)v10), v9); int64_t v12 = 1LL; int64_t v13 = i64_add(v10, v12); void* v14 = mbuf_mirth_external_ExternalBlock_NUM; @@ -71717,100 +52132,63 @@ static VAL mw_mirth_c99_c99Z_externalZ_blocksZBang (VAL x1) { } static VAL mw_mirth_c99_c99Z_externalZ_blockZBang (uint64_t x1, VAL x2) { VAL v3 = mw_mirth_external_ExternalBlock_parts(x1); - VAL v4; - VAL v5; - mw_std_list_List_1_uncons(v3, &v4, &v5); - VAL x6; - VAL x7; - int64_t x8; - switch (get_data_tag(v4)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v4); - VAL x10; - switch (get_data_tag(v9)) { - case 0LL: { // EBPCode - VAL v11 = mtp_mirth_external_ExternalBlockPart_EBPCode(v9); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(v11, x2)); - VAL v13 = (mw_mirth_c99_ZPlusC99_line(v12)); - x10 = v13; - } break; - case 1LL: { // EBPDef - uint64_t v14 = mtp_mirth_external_ExternalBlockPart_EBPDef(v9); - VAL v15 = (mw_mirth_c99_c99Z_externalZ_defZBang(v14, x2)); - x10 = v15; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v16 = 1LL /* True */; - x8 = v16; - x7 = v5; - x6 = x10; - } break; - case 0LL: { // None - int64_t v17 = 0LL /* False */; - x8 = v17; - x7 = v5; - x6 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v18 = (x6); - VAL v19 = x7; - int64_t v20 = x8; - while (((bool)v20)) { - VAL v21 = (v18); - VAL v22 = v19; - VAL v23; - VAL v24; - mw_std_list_List_1_uncons(v22, &v23, &v24); - VAL x25; - VAL x26; - int64_t x27; - switch (get_data_tag(v23)) { - case 1LL: { // Some - VAL v28 = mtp_std_maybe_Maybe_1_Some(v23); - VAL x29; - switch (get_data_tag(v28)) { + int64_t v4 = 1LL /* True */; + VAL v5 = x2; + VAL v6 = v3; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL x12; + VAL x13; + int64_t x14; + switch (get_data_tag(v10)) { + case 1LL: { // Cons + VAL v15; + VAL v16; + mtp_std_list_List_1_Cons(v10, &v15, &v16); + VAL x17; + switch (get_data_tag(v15)) { case 0LL: { // EBPCode - VAL v30 = mtp_mirth_external_ExternalBlockPart_EBPCode(v28); - VAL v31 = (mw_mirth_c99_ZPlusC99_put(v30, v21)); - VAL v32 = (mw_mirth_c99_ZPlusC99_line(v31)); - x29 = v32; + VAL v18 = mtp_mirth_external_ExternalBlockPart_EBPCode(v15); + VAL v19 = mw_mirth_c99_ZPlusC99_put(v18, v9); + VAL v20 = mw_mirth_c99_ZPlusC99_line(v19); + x17 = v20; } break; case 1LL: { // EBPDef - uint64_t v33 = mtp_mirth_external_ExternalBlockPart_EBPDef(v28); - VAL v34 = (mw_mirth_c99_c99Z_externalZ_defZBang(v33, v21)); - x29 = v34; + uint64_t v21 = mtp_mirth_external_ExternalBlockPart_EBPDef(v15); + VAL v22 = mw_mirth_c99_c99Z_externalZ_defZBang(v21, v9); + x17 = v22; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v35 = 1LL /* True */; - x27 = v35; - x26 = v24; - x25 = x29; + int64_t v23 = 1LL /* True */; + x14 = v23; + x13 = v16; + x12 = x17; } break; - case 0LL: { // None - int64_t v36 = 0LL /* False */; - x27 = v36; - x26 = v24; - x25 = v21; + case 0LL: { // Nil + VAL v24 = MKI64(0LL /* Nil */); + int64_t v25 = 0LL /* False */; + x14 = v25; + x13 = v24; + x12 = v9; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v20 = x27; - v19 = x26; - v18 = x25; + v8 = x14; + v7 = x14; + v6 = x13; + v5 = x12; } - decref(v19); - return v18; + decref(v6); + return v5; } static void mw_mirth_external_External_cnameZ_type (uint64_t x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { VAL v6; @@ -71835,12 +52213,12 @@ static void mw_mirth_external_External_c99Z_api (uint64_t x1, VAL x2, VAL *x3, V x8 = x1; x7 = x2; } else { - VAL v11 = (VVAL(VTUP(x2)->cells[6])); + VAL v11 = VVAL(VTUP(x2)->cells[7]); VAL v12; VAL v13; VAL v14; mw_mirth_external_External_cnameZ_type(x1, v11, &v12, &v13, &v14); - VTUP(x2)->cells[6] = v14; + VTUP(x2)->cells[7] = v14; VAL v15; VAL v16; mw_mirth_c99_ZPlusC99_cnameZ_typeZ_toZ_c99Z_api(v12, v13, x2, &v15, &v16); @@ -71854,20 +52232,20 @@ static void mw_mirth_external_External_c99Z_api (uint64_t x1, VAL x2, VAL *x3, V *x3 = x9; } static VAL mw_mirth_c99_c99Z_externalZ_callZBang (VAL x1, uint64_t x2, VAL x3) { - VAL v4 = (VVAL(VTUP(x3)->cells[1])); + VAL v4 = VVAL(VTUP(x3)->cells[1]); VAL v5; VAL v6; mw_mirth_external_External_c99Z_api(x2, v4, &v5, &v6); VTUP(x3)->cells[1] = v6; - VAL v7 = (mw_mirth_c99_c99Z_smartZ_callZBang(x1, v5, x3)); + VAL v7 = mw_mirth_c99_c99Z_smartZ_callZBang(x1, v5, x3); return v7; } static VAL mw_mirth_c99_c99Z_externalZ_defZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[6])); + VAL v3 = VVAL(VTUP(x2)->cells[7]); VAL v4; VAL v5; mw_mirth_external_External_ctype(v3, x1, &v4, &v5); - VTUP(x2)->cells[6] = v4; + VTUP(x2)->cells[7] = v4; incref(v5); VAL v6 = VVAL(VTUP(v5)->cells[2]); incref(v6); @@ -71876,1617 +52254,706 @@ static VAL mw_mirth_c99_c99Z_externalZ_defZBang (uint64_t x1, VAL x2) { incref(v7); decref(v6); VAL v8 = MKI64(0LL /* None */); - VAL v9; - VAL v10; - mw_std_list_List_1_uncons(v7, &v9, &v10); - uint64_t x11; - VAL x12; - VAL x13; - VAL x14; - VAL x15; - int64_t x16; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v17 = mtp_std_maybe_Maybe_1_Some(v9); - incref(v17); - incref(v17); - VAL v18 = mw_mirth_type_CTypeStackPart_labelZAsk(v17); - int64_t v19 = mw_std_maybe_Maybe_1_noneZAsk(v18); - uint64_t x20; - VAL x21; - VAL x22; - int64_t x23; - if (((bool)v19)) { - VAL v24 = mw_mirth_type_CTypeStackPart_ctype(v17); - int64_t v25 = mw_mirth_type_CType_phantomZAsk(v24); - bool v26 = !((bool)v25); - x23 = ((int64_t)v26); - x22 = v5; - x21 = x2; - x20 = x1; - } else { - decref(v17); - int64_t v27 = 0LL /* False */; - x23 = v27; - x22 = v5; - x21 = x2; - x20 = x1; - } - uint64_t x28; - VAL x29; - VAL x30; - VAL x31; - if (((bool)x23)) { - VAL v32 = mtw_std_maybe_Maybe_1_Some(v17); - x31 = v32; - x30 = x22; - x29 = x21; - x28 = x20; - } else { - decref(v17); - VAL v33 = MKI64(0LL /* None */); - x31 = v33; - x30 = x22; - x29 = x21; - x28 = x20; - } - uint64_t x34; - VAL x35; - VAL x36; - VAL x37; - VAL x38; - switch (get_data_tag(x31)) { - case 0LL: { // None - x38 = v10; - x37 = v8; - x36 = x30; - x35 = x29; - x34 = x28; - } break; - default: { - decref(v10); - decref(v8); - VAL v39 = MKI64(0LL /* Nil */); - x38 = v39; - x37 = x31; - x36 = x30; - x35 = x29; - x34 = x28; - } break; - } - int64_t v40 = 1LL /* True */; - x16 = v40; - x15 = x38; - x14 = x37; - x13 = x36; - x12 = x35; - x11 = x34; - } break; - case 0LL: { // None - int64_t v41 = 0LL /* False */; - x16 = v41; - x15 = v10; - x14 = v8; - x13 = v5; - x12 = x2; - x11 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v42 = x11; - VAL v43 = (x12); - VAL v44 = x13; - VAL v45 = x14; - VAL v46 = x15; - int64_t v47 = x16; - while (((bool)v47)) { - uint64_t v48 = v42; - VAL v49 = (v43); - VAL v50 = v44; - VAL v51 = v45; - VAL v52 = v46; - VAL v53; - VAL v54; - mw_std_list_List_1_uncons(v52, &v53, &v54); - uint64_t x55; - VAL x56; - VAL x57; - VAL x58; - VAL x59; - int64_t x60; - switch (get_data_tag(v53)) { + int64_t v9 = 1LL /* True */; + VAL v10 = v8; + VAL v11 = v7; + int64_t v12 = v9; + int64_t v13 = v9; + while (((bool)v13)) { + VAL v14 = v10; + VAL v15 = v11; + int64_t v16 = v12; + VAL v17; + VAL v18; + mw_std_list_List_1_uncons(v15, &v17, &v18); + VAL x19; + VAL x20; + int64_t x21; + switch (get_data_tag(v17)) { case 1LL: { // Some - VAL v61 = mtp_std_maybe_Maybe_1_Some(v53); - incref(v61); - incref(v61); - VAL v62 = mw_mirth_type_CTypeStackPart_labelZAsk(v61); - int64_t v63 = mw_std_maybe_Maybe_1_noneZAsk(v62); - uint64_t x64; - VAL x65; - VAL x66; - int64_t x67; - if (((bool)v63)) { - VAL v68 = mw_mirth_type_CTypeStackPart_ctype(v61); - int64_t v69 = mw_mirth_type_CType_phantomZAsk(v68); - bool v70 = !((bool)v69); - x67 = ((int64_t)v70); - x66 = v50; - x65 = v49; - x64 = v48; + VAL v22 = mtp_std_maybe_Maybe_1_Some(v17); + incref(v22); + incref(v22); + VAL v23 = mw_mirth_type_CTypeStackPart_labelZAsk(v22); + int64_t v24 = get_data_tag(v23); + decref(v23); + int64_t v25 = 0LL; + bool v26 = (v24 == v25); + int64_t x27; + if (v26) { + VAL v28 = mw_mirth_type_CTypeStackPart_ctype(v22); + int64_t v29 = mw_mirth_type_CType_phantomZAsk(v28); + bool v30 = !((bool)v29); + x27 = ((int64_t)v30); } else { - decref(v61); - int64_t v71 = 0LL /* False */; - x67 = v71; - x66 = v50; - x65 = v49; - x64 = v48; + decref(v22); + int64_t v31 = 0LL /* False */; + x27 = v31; } - uint64_t x72; - VAL x73; - VAL x74; - VAL x75; - if (((bool)x67)) { - VAL v76 = mtw_std_maybe_Maybe_1_Some(v61); - x75 = v76; - x74 = x66; - x73 = x65; - x72 = x64; + VAL x32; + if (((bool)x27)) { + VAL v33 = mtw_std_maybe_Maybe_1_Some(v22); + x32 = v33; } else { - decref(v61); - VAL v77 = MKI64(0LL /* None */); - x75 = v77; - x74 = x66; - x73 = x65; - x72 = x64; + decref(v22); + VAL v34 = MKI64(0LL /* None */); + x32 = v34; } - uint64_t x78; - VAL x79; - VAL x80; - VAL x81; - VAL x82; - switch (get_data_tag(x75)) { + VAL x35; + VAL x36; + switch (get_data_tag(x32)) { case 0LL: { // None - x82 = v54; - x81 = v51; - x80 = x74; - x79 = x73; - x78 = x72; + x36 = v18; + x35 = v14; } break; default: { - decref(v54); - decref(v51); - VAL v83 = MKI64(0LL /* Nil */); - x82 = v83; - x81 = x75; - x80 = x74; - x79 = x73; - x78 = x72; + decref(v18); + decref(v14); + VAL v37 = MKI64(0LL /* Nil */); + x36 = v37; + x35 = x32; } break; } - int64_t v84 = 1LL /* True */; - x60 = v84; - x59 = x82; - x58 = x81; - x57 = x80; - x56 = x79; - x55 = x78; + int64_t v38 = 1LL /* True */; + x21 = v38; + x20 = x36; + x19 = x35; } break; case 0LL: { // None - int64_t v85 = 0LL /* False */; - x60 = v85; - x59 = v54; - x58 = v51; - x57 = v50; - x56 = v49; - x55 = v48; + int64_t v39 = 0LL /* False */; + x21 = v39; + x20 = v18; + x19 = v14; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v47 = x60; - v46 = x59; - v45 = x58; - v44 = x57; - v43 = x56; - v42 = x55; - } - decref(v46); - incref(v45); - uint64_t x86; - VAL x87; - VAL x88; - VAL x89; - VAL x90; - switch (get_data_tag(v45)) { - case 1LL: { // Some - VAL v91 = mtp_std_maybe_Maybe_1_Some(v45); - VAL v92 = mw_mirth_type_CTypeStackPart_ctype(v91); - x90 = v92; - x89 = v45; - x88 = v44; - x87 = v43; - x86 = v42; - } break; - case 0LL: { // None - VAL v93 = MKI64(5LL /* Phantom */); - x90 = v93; - x89 = v45; - x88 = v44; - x87 = v43; - x86 = v42; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v13 = x21; + v12 = x21; + v11 = x20; + v10 = x19; } - VAL v94 = mw_mirth_type_CType_cname(x90); - VAL v95 = (mw_mirth_c99_ZPlusC99_put(v94, x87)); - STR* v96; - STRLIT(v96, " ", 1); - VAL v97 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v96), v95)); - VAL v98 = mw_mirth_external_External_symbol(x86); - VAL v99 = (mw_mirth_c99_ZPlusC99_put(v98, v97)); - STR* v100; - STRLIT(v100, " (", 2); - VAL v101 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v100), v99)); - incref(x88); - VAL v102 = VVAL(VTUP(x88)->cells[1]); - incref(v102); - decref(x88); - VAL v103 = VVAL(VTUP(v102)->cells[2]); - incref(v103); - decref(v102); - VAL v104 = MKI64(0LL /* Nil */); - VAL v105 = mw_std_list_List_1_reverse(v104); - VAL v106; - VAL v107; - mw_std_list_List_1_uncons(v103, &v106, &v107); - VAL x108; - uint64_t x109; - VAL x110; - VAL x111; - VAL x112; - VAL x113; - int64_t x114; - switch (get_data_tag(v106)) { + decref(v11); + incref(v10); + VAL x40; + switch (get_data_tag(v10)) { case 1LL: { // Some - VAL v115 = mtp_std_maybe_Maybe_1_Some(v106); - incref(v115); - VAL v116 = mw_mirth_type_CTypeStackPart_ctype(v115); - int64_t v117 = mw_mirth_type_CType_phantomZAsk(v116); - bool v118 = !((bool)v117); - VAL x119; - uint64_t x120; - VAL x121; - VAL x122; - VAL x123; - if (v118) { - VAL v124 = mtw_std_maybe_Maybe_1_Some(v115); - x123 = v124; - x122 = x88; - x121 = v101; - x120 = x86; - x119 = x89; - } else { - decref(v115); - VAL v125 = MKI64(0LL /* None */); - x123 = v125; - x122 = x88; - x121 = v101; - x120 = x86; - x119 = x89; - } - VAL x126; - switch (get_data_tag(x123)) { - case 1LL: { // Some - VAL v127 = mtp_std_maybe_Maybe_1_Some(x123); - VAL v128 = mtw_std_list_List_1_Cons(v127, v105); - x126 = v128; - lpush(&lbl_outty, x119); - lpush(&lbl_ext, MKU64(x120)); - push_resource(x121); - lpush(&lbl_cty, x122); - } break; - case 0LL: { // None - x126 = v105; - lpush(&lbl_outty, x119); - lpush(&lbl_ext, MKU64(x120)); - push_resource(x121); - lpush(&lbl_cty, x122); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v129 = 1LL /* True */; - x114 = v129; - x113 = v107; - x112 = x126; - VAL v130 = lpop(&lbl_cty); - x111 = v130; - VAL r131 = pop_resource(); - x110 = r131; - uint64_t v132 = VU64(lpop(&lbl_ext)); - x109 = v132; - VAL v133 = lpop(&lbl_outty); - x108 = v133; + VAL v41 = mtp_std_maybe_Maybe_1_Some(v10); + VAL v42 = mw_mirth_type_CTypeStackPart_ctype(v41); + x40 = v42; } break; case 0LL: { // None - int64_t v134 = 0LL /* False */; - x114 = v134; - x113 = v107; - x112 = v105; - x111 = x88; - x110 = v101; - x109 = x86; - x108 = x89; + VAL v43 = MKI64(5LL /* Phantom */); + x40 = v43; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v135 = x108; - uint64_t v136 = x109; - VAL v137 = (x110); - VAL v138 = x111; - VAL v139 = (x112); - VAL v140 = x113; - int64_t v141 = x114; - while (((bool)v141)) { - VAL v142 = v135; - uint64_t v143 = v136; - VAL v144 = (v137); - VAL v145 = v138; - VAL v146 = (v139); - VAL v147 = v140; - VAL v148; - VAL v149; - mw_std_list_List_1_uncons(v147, &v148, &v149); - VAL x150; - uint64_t x151; - VAL x152; - VAL x153; - VAL x154; - VAL x155; - int64_t x156; - switch (get_data_tag(v148)) { - case 1LL: { // Some - VAL v157 = mtp_std_maybe_Maybe_1_Some(v148); - incref(v157); - VAL v158 = mw_mirth_type_CTypeStackPart_ctype(v157); - int64_t v159 = mw_mirth_type_CType_phantomZAsk(v158); - bool v160 = !((bool)v159); - VAL x161; - uint64_t x162; - VAL x163; - VAL x164; - VAL x165; - if (v160) { - VAL v166 = mtw_std_maybe_Maybe_1_Some(v157); - x165 = v166; - x164 = v145; - x163 = v144; - x162 = v143; - x161 = v142; + VAL v44 = mw_mirth_type_CType_cname(x40); + VAL v45 = mw_mirth_c99_ZPlusC99_put(v44, x2); + STR* v46; + STRLIT(v46, " ", 1); + VAL v47 = mw_mirth_c99_ZPlusC99_put(MKSTR(v46), v45); + VAL v48 = mw_mirth_external_External_symbol(x1); + VAL v49 = mw_mirth_c99_ZPlusC99_put(v48, v47); + STR* v50; + STRLIT(v50, " (", 2); + VAL v51 = mw_mirth_c99_ZPlusC99_put(MKSTR(v50), v49); + incref(v5); + VAL v52 = VVAL(VTUP(v5)->cells[1]); + incref(v52); + decref(v5); + VAL v53 = VVAL(VTUP(v52)->cells[2]); + incref(v53); + decref(v52); + VAL v54 = MKI64(0LL /* Nil */); + VAL v55 = mw_std_list_List_1_reverse(v54); + int64_t v56 = 1LL /* True */; + VAL v57 = v55; + VAL v58 = v53; + int64_t v59 = v56; + int64_t v60 = v56; + while (((bool)v60)) { + VAL v61 = v57; + VAL v62 = v58; + int64_t v63 = v59; + VAL x64; + VAL x65; + int64_t x66; + switch (get_data_tag(v62)) { + case 1LL: { // Cons + VAL v67; + VAL v68; + mtp_std_list_List_1_Cons(v62, &v67, &v68); + incref(v67); + VAL v69 = mw_mirth_type_CTypeStackPart_ctype(v67); + int64_t v70 = mw_mirth_type_CType_phantomZAsk(v69); + bool v71 = !((bool)v70); + VAL x72; + if (v71) { + VAL v73 = mtw_std_list_List_1_Cons(v67, v61); + x72 = v73; } else { - decref(v157); - VAL v167 = MKI64(0LL /* None */); - x165 = v167; - x164 = v145; - x163 = v144; - x162 = v143; - x161 = v142; - } - VAL x168; - switch (get_data_tag(x165)) { - case 1LL: { // Some - VAL v169 = mtp_std_maybe_Maybe_1_Some(x165); - VAL v170 = mtw_std_list_List_1_Cons(v169, v146); - x168 = v170; - lpush(&lbl_outty, x161); - lpush(&lbl_ext, MKU64(x162)); - push_resource(x163); - lpush(&lbl_cty, x164); - } break; - case 0LL: { // None - x168 = v146; - lpush(&lbl_outty, x161); - lpush(&lbl_ext, MKU64(x162)); - push_resource(x163); - lpush(&lbl_cty, x164); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + decref(v67); + x72 = v61; } - int64_t v171 = 1LL /* True */; - x156 = v171; - x155 = v149; - x154 = x168; - VAL v172 = lpop(&lbl_cty); - x153 = v172; - VAL r173 = pop_resource(); - x152 = r173; - uint64_t v174 = VU64(lpop(&lbl_ext)); - x151 = v174; - VAL v175 = lpop(&lbl_outty); - x150 = v175; + int64_t v74 = 1LL /* True */; + x66 = v74; + x65 = v68; + x64 = x72; } break; - case 0LL: { // None - int64_t v176 = 0LL /* False */; - x156 = v176; - x155 = v149; - x154 = v146; - x153 = v145; - x152 = v144; - x151 = v143; - x150 = v142; + case 0LL: { // Nil + VAL v75 = MKI64(0LL /* Nil */); + int64_t v76 = 0LL /* False */; + x66 = v76; + x65 = v75; + x64 = v61; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v141 = x156; - v140 = x155; - v139 = x154; - v138 = x153; - v137 = x152; - v136 = x151; - v135 = x150; - } - decref(v140); - VAL v177 = mw_std_list_List_1_reverse(v139); - VAL x178; - uint64_t x179; - VAL x180; - VAL x181; - switch (get_data_tag(v177)) { + v60 = x66; + v59 = x66; + v58 = x65; + v57 = x64; + } + decref(v58); + VAL v77 = mw_std_list_List_1_reverse(v57); + VAL x78; + uint64_t x79; + VAL x80; + VAL x81; + switch (get_data_tag(v77)) { case 0LL: { // Nil - STR* v182; - STRLIT(v182, "void", 4); - VAL v183 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v182), v137)); - x181 = v183; - x180 = v138; - x179 = v136; - x178 = v135; + STR* v82; + STRLIT(v82, "void", 4); + VAL v83 = mw_mirth_c99_ZPlusC99_put(MKSTR(v82), v51); + x81 = v83; + x80 = v5; + x79 = x1; + x78 = v10; } break; default: { - VAL v184; - VAL v185; - mw_std_list_List_1_uncons(v177, &v184, &v185); - VAL x186; - uint64_t x187; - VAL x188; - VAL x189; - switch (get_data_tag(v184)) { - case 1LL: { // Some - VAL v190 = mtp_std_maybe_Maybe_1_Some(v184); - VAL v191 = mw_mirth_type_CTypeStackPart_ctype(v190); - VAL v192 = mw_mirth_type_CType_cname(v191); - VAL v193 = (mw_mirth_c99_ZPlusC99_put(v192, v137)); - x189 = v138; - x188 = v193; - x187 = v136; - x186 = v135; - } break; - case 0LL: { // None - x189 = v138; - x188 = v137; - x187 = v136; - x186 = v135; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v194; - VAL v195; - mw_std_list_List_1_uncons(v185, &v194, &v195); - VAL x196; - uint64_t x197; - VAL x198; - VAL x199; - VAL x200; - int64_t x201; - switch (get_data_tag(v194)) { + VAL v84; + VAL v85; + mw_std_list_List_1_uncons(v77, &v84, &v85); + VAL x86; + switch (get_data_tag(v84)) { case 1LL: { // Some - VAL v202 = mtp_std_maybe_Maybe_1_Some(v194); - STR* v203; - STRLIT(v203, ", ", 2); - VAL v204 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v203), x188)); - VAL v205 = mw_mirth_type_CTypeStackPart_ctype(v202); - VAL v206 = mw_mirth_type_CType_cname(v205); - VAL v207 = (mw_mirth_c99_ZPlusC99_put(v206, v204)); - int64_t v208 = 1LL /* True */; - x201 = v208; - x200 = v195; - x199 = x189; - x198 = v207; - x197 = x187; - x196 = x186; + VAL v87 = mtp_std_maybe_Maybe_1_Some(v84); + VAL v88 = mw_mirth_type_CTypeStackPart_ctype(v87); + VAL v89 = mw_mirth_type_CType_cname(v88); + VAL v90 = mw_mirth_c99_ZPlusC99_put(v89, v51); + x86 = v90; } break; case 0LL: { // None - int64_t v209 = 0LL /* False */; - x201 = v209; - x200 = v195; - x199 = x189; - x198 = x188; - x197 = x187; - x196 = x186; + x86 = v51; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v210 = x196; - uint64_t v211 = x197; - VAL v212 = (x198); - VAL v213 = x199; - VAL v214 = x200; - int64_t v215 = x201; - while (((bool)v215)) { - VAL v216 = v210; - uint64_t v217 = v211; - VAL v218 = (v212); - VAL v219 = v213; - VAL v220 = v214; - VAL v221; - VAL v222; - mw_std_list_List_1_uncons(v220, &v221, &v222); - VAL x223; - uint64_t x224; - VAL x225; - VAL x226; - VAL x227; - int64_t x228; - switch (get_data_tag(v221)) { - case 1LL: { // Some - VAL v229 = mtp_std_maybe_Maybe_1_Some(v221); - STR* v230; - STRLIT(v230, ", ", 2); - VAL v231 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v230), v218)); - VAL v232 = mw_mirth_type_CTypeStackPart_ctype(v229); - VAL v233 = mw_mirth_type_CType_cname(v232); - VAL v234 = (mw_mirth_c99_ZPlusC99_put(v233, v231)); - int64_t v235 = 1LL /* True */; - x228 = v235; - x227 = v222; - x226 = v219; - x225 = v234; - x224 = v217; - x223 = v216; + int64_t v91 = 1LL /* True */; + VAL v92 = x86; + VAL v93 = v85; + int64_t v94 = v91; + int64_t v95 = v91; + while (((bool)v95)) { + VAL v96 = v92; + VAL v97 = v93; + int64_t v98 = v94; + VAL x99; + VAL x100; + int64_t x101; + switch (get_data_tag(v97)) { + case 1LL: { // Cons + VAL v102; + VAL v103; + mtp_std_list_List_1_Cons(v97, &v102, &v103); + STR* v104; + STRLIT(v104, ", ", 2); + VAL v105 = mw_mirth_c99_ZPlusC99_put(MKSTR(v104), v96); + VAL v106 = mw_mirth_type_CTypeStackPart_ctype(v102); + VAL v107 = mw_mirth_type_CType_cname(v106); + VAL v108 = mw_mirth_c99_ZPlusC99_put(v107, v105); + int64_t v109 = 1LL /* True */; + x101 = v109; + x100 = v103; + x99 = v108; } break; - case 0LL: { // None - int64_t v236 = 0LL /* False */; - x228 = v236; - x227 = v222; - x226 = v219; - x225 = v218; - x224 = v217; - x223 = v216; + case 0LL: { // Nil + VAL v110 = MKI64(0LL /* Nil */); + int64_t v111 = 0LL /* False */; + x101 = v111; + x100 = v110; + x99 = v96; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v215 = x228; - v214 = x227; - v213 = x226; - v212 = x225; - v211 = x224; - v210 = x223; - } - decref(v214); - x181 = v212; - x180 = v213; - x179 = v211; - x178 = v210; - } break; - } - STR* v237; - STRLIT(v237, ");", 2); - VAL v238 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v237), x181)); - VAL v239 = (mw_mirth_c99_ZPlusC99_line(v238)); - VAL v240; - VAL v241; - mw_mirth_external_External_c99Z_api(x179, v239, &v240, &v241); - VAL v242 = (mw_mirth_c99_ZPlusC99_indent(v241)); - incref(v240); - VAL v243 = (mw_mirth_c99_ZPlusC99_smartZ_sigZ_put(v240, v242)); - STR* v244; - STRLIT(v244, " {", 2); - VAL v245 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v244), v243)); - VAL v246 = (mw_mirth_c99_ZPlusC99_line(v245)); - int64_t v247 = VI64(VTUP(v246)->cells[2]); - int64_t v248 = 1LL; - int64_t v249 = i64_add(v247, v248); - VTUP(v246)->cells[2] = MKI64(v249); - incref(v240); - VAL v250 = (mw_mirth_c99_c99Z_apiZ_enterZBang(v240, v246)); - incref(x180); - VAL v251 = VVAL(VTUP(x180)->cells[1]); - incref(v251); - decref(x180); - VAL v252 = VVAL(VTUP(v251)->cells[2]); - incref(v252); - decref(v251); - incref(v252); - int64_t v253 = mw_std_list_List_1_len(v252); - VAL v254 = mw_std_list_List_1_reverse(v252); - VAL v255; - VAL v256; - mw_std_list_List_1_uncons(v254, &v255, &v256); - VAL x257; - uint64_t x258; - VAL x259; - VAL x260; - int64_t x261; - VAL x262; - int64_t x263; - switch (get_data_tag(v255)) { - case 1LL: { // Some - VAL v264 = mtp_std_maybe_Maybe_1_Some(v255); - incref(v264); - VAL v265; - VAL v266; - mw_mirth_type_CTypeStackPart_c99Z_pop(v264, v250, &v265, &v266); - incref(v264); - VAL v267 = mw_mirth_type_CTypeStackPart_ctype(v264); - int64_t v268 = mw_mirth_type_CType_phantomZAsk(v267); - VAL x269; - uint64_t x270; - VAL x271; - int64_t x272; - VAL x273; - VAL x274; - if (((bool)v268)) { - decref(v265); - x274 = v264; - x273 = v266; - x272 = v253; - x271 = x180; - x270 = x179; - x269 = x178; - } else { - VAL v275 = (VVAL(VTUP(v266)->cells[1])); - VAL v276 = (mw_mirth_c99_ZPlusC99_indent(v275)); - incref(v264); - VAL v277 = mw_mirth_type_CTypeStackPart_ctype(v264); - VAL v278 = mw_mirth_type_CType_cname(v277); - VAL v279 = (mw_mirth_c99_ZPlusC99_put(v278, v276)); - STR* v280; - STRLIT(v280, " ", 1); - VAL v281 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v280), v279)); - incref(v264); - int64_t v282; - VAL v283; - VAL v284; - mw_mirth_type_CTypeStackPart_c99Z_argZ_name(v253, v264, v281, &v282, &v283, &v284); - VAL v285 = (mw_mirth_c99_ZPlusC99_put(v283, v284)); - STR* v286; - STRLIT(v286, " = (", 4); - VAL v287 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v286), v285)); - incref(v264); - VAL v288 = mw_mirth_type_CTypeStackPart_ctype(v264); - VAL v289 = mw_mirth_type_CType_cname(v288); - VAL v290 = (mw_mirth_c99_ZPlusC99_put(v289, v287)); - STR* v291; - STRLIT(v291, ")(", 2); - VAL v292 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v291), v290)); - VAL v293 = (mw_mirth_c99_ZPlusC99_put(v265, v292)); - STR* v294; - STRLIT(v294, ");", 2); - VAL v295 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v294), v293)); - VAL v296 = (mw_mirth_c99_ZPlusC99_line(v295)); - VTUP(v266)->cells[1] = v296; - x274 = v264; - x273 = v266; - x272 = v282; - x271 = x180; - x270 = x179; - x269 = x178; - } - decref(x274); - int64_t v297 = 1LL; - int64_t v298 = i64_sub(x272, v297); - int64_t v299 = 0LL; - bool v300 = (v298 < v299); - int64_t x301; - if (v300) { - int64_t v302 = 0LL; - x301 = v302; - lpush(&lbl_outty, x269); - lpush(&lbl_ext, MKU64(x270)); - lpush(&lbl_cty, x271); - push_resource(x273); - } else { - x301 = v298; - lpush(&lbl_outty, x269); - lpush(&lbl_ext, MKU64(x270)); - lpush(&lbl_cty, x271); - push_resource(x273); + v95 = x101; + v94 = x101; + v93 = x100; + v92 = x99; } - int64_t v303 = 1LL /* True */; - x263 = v303; - x262 = v256; - x261 = x301; - VAL v304 = lpop(&lbl_cty); - x260 = v304; - VAL r305 = pop_resource(); - x259 = r305; - uint64_t v306 = VU64(lpop(&lbl_ext)); - x258 = v306; - VAL v307 = lpop(&lbl_outty); - x257 = v307; - } break; - case 0LL: { // None - int64_t v308 = 0LL /* False */; - x263 = v308; - x262 = v256; - x261 = v253; - x260 = x180; - x259 = v250; - x258 = x179; - x257 = x178; + decref(v93); + x81 = v92; + x80 = v5; + x79 = x1; + x78 = v10; } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } } - VAL v309 = x257; - uint64_t v310 = x258; - VAL v311 = (x259); - VAL v312 = x260; - int64_t v313 = x261; - VAL v314 = x262; - int64_t v315 = x263; - while (((bool)v315)) { - VAL v316 = v309; - uint64_t v317 = v310; - VAL v318 = (v311); - VAL v319 = v312; - int64_t v320 = v313; - VAL v321 = v314; - VAL v322; - VAL v323; - mw_std_list_List_1_uncons(v321, &v322, &v323); - VAL x324; - uint64_t x325; - VAL x326; - VAL x327; - int64_t x328; - VAL x329; - int64_t x330; - switch (get_data_tag(v322)) { - case 1LL: { // Some - VAL v331 = mtp_std_maybe_Maybe_1_Some(v322); - incref(v331); - VAL v332; - VAL v333; - mw_mirth_type_CTypeStackPart_c99Z_pop(v331, v318, &v332, &v333); - incref(v331); - VAL v334 = mw_mirth_type_CTypeStackPart_ctype(v331); - int64_t v335 = mw_mirth_type_CType_phantomZAsk(v334); - VAL x336; - uint64_t x337; - VAL x338; - int64_t x339; - VAL x340; - VAL x341; - if (((bool)v335)) { - decref(v332); - x341 = v331; - x340 = v333; - x339 = v320; - x338 = v319; - x337 = v317; - x336 = v316; + STR* v112; + STRLIT(v112, ");", 2); + VAL v113 = mw_mirth_c99_ZPlusC99_put(MKSTR(v112), x81); + VAL v114 = mw_mirth_c99_ZPlusC99_line(v113); + VAL v115; + VAL v116; + mw_mirth_external_External_c99Z_api(x79, v114, &v115, &v116); + VAL v117; + VAL v118; + mw_mirth_c99_ZPlusC99_c99Z_line_1_sp90(v115, v116, &v117, &v118); + int64_t v119 = VI64(VTUP(v118)->cells[2]); + int64_t v120 = 1LL; + int64_t v121 = i64_add(v119, v120); + VTUP(v118)->cells[2] = MKI64(v121); + incref(v117); + VAL v122 = mw_mirth_c99_c99Z_apiZ_enterZBang(v117, v118); + incref(x80); + VAL v123 = VVAL(VTUP(x80)->cells[1]); + incref(v123); + decref(x80); + VAL v124 = VVAL(VTUP(v123)->cells[2]); + incref(v124); + decref(v123); + incref(v124); + int64_t v125 = mw_std_list_List_1_len(v124); + VAL v126 = mw_std_list_List_1_reverse(v124); + int64_t v127 = 1LL /* True */; + int64_t v128 = v125; + VAL v129 = v122; + VAL v130 = v126; + int64_t v131 = v127; + int64_t v132 = v127; + while (((bool)v132)) { + int64_t v133 = v128; + VAL v134 = v129; + VAL v135 = v130; + int64_t v136 = v131; + VAL x137; + int64_t x138; + VAL x139; + int64_t x140; + switch (get_data_tag(v135)) { + case 1LL: { // Cons + VAL v141; + VAL v142; + mtp_std_list_List_1_Cons(v135, &v141, &v142); + incref(v141); + VAL v143; + VAL v144; + mw_mirth_type_CTypeStackPart_c99Z_pop(v141, v134, &v143, &v144); + incref(v141); + VAL v145 = mw_mirth_type_CTypeStackPart_ctype(v141); + int64_t v146 = mw_mirth_type_CType_phantomZAsk(v145); + int64_t x147; + VAL x148; + VAL x149; + if (((bool)v146)) { + decref(v143); + x149 = v141; + x148 = v144; + x147 = v133; } else { - VAL v342 = (VVAL(VTUP(v333)->cells[1])); - VAL v343 = (mw_mirth_c99_ZPlusC99_indent(v342)); - incref(v331); - VAL v344 = mw_mirth_type_CTypeStackPart_ctype(v331); - VAL v345 = mw_mirth_type_CType_cname(v344); - VAL v346 = (mw_mirth_c99_ZPlusC99_put(v345, v343)); - STR* v347; - STRLIT(v347, " ", 1); - VAL v348 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v347), v346)); - incref(v331); - int64_t v349; - VAL v350; - VAL v351; - mw_mirth_type_CTypeStackPart_c99Z_argZ_name(v320, v331, v348, &v349, &v350, &v351); - VAL v352 = (mw_mirth_c99_ZPlusC99_put(v350, v351)); - STR* v353; - STRLIT(v353, " = (", 4); - VAL v354 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v353), v352)); - incref(v331); - VAL v355 = mw_mirth_type_CTypeStackPart_ctype(v331); - VAL v356 = mw_mirth_type_CType_cname(v355); - VAL v357 = (mw_mirth_c99_ZPlusC99_put(v356, v354)); - STR* v358; - STRLIT(v358, ")(", 2); - VAL v359 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v358), v357)); - VAL v360 = (mw_mirth_c99_ZPlusC99_put(v332, v359)); - STR* v361; - STRLIT(v361, ");", 2); - VAL v362 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v361), v360)); - VAL v363 = (mw_mirth_c99_ZPlusC99_line(v362)); - VTUP(v333)->cells[1] = v363; - x341 = v331; - x340 = v333; - x339 = v349; - x338 = v319; - x337 = v317; - x336 = v316; + int64_t v150 = VI64(VTUP(v144)->cells[3]); + VAL v151 = VVAL(VTUP(v144)->cells[1]); + int64_t v152 = VI64(VTUP(v151)->cells[4]); + VTUP(v151)->cells[4] = MKI64(v150); + VAL v153 = mw_mirth_c99_ZPlusC99_indent(v151); + incref(v141); + VAL v154 = mw_mirth_type_CTypeStackPart_ctype(v141); + VAL v155 = mw_mirth_type_CType_cname(v154); + VAL v156 = mw_mirth_c99_ZPlusC99_put(v155, v153); + STR* v157; + STRLIT(v157, " ", 1); + VAL v158 = mw_mirth_c99_ZPlusC99_put(MKSTR(v157), v156); + incref(v141); + int64_t v159; + VAL v160; + VAL v161; + mw_mirth_type_CTypeStackPart_c99Z_argZ_name(v133, v141, v158, &v159, &v160, &v161); + VAL v162 = mw_mirth_c99_ZPlusC99_put(v160, v161); + STR* v163; + STRLIT(v163, " = (", 4); + VAL v164 = mw_mirth_c99_ZPlusC99_put(MKSTR(v163), v162); + incref(v141); + VAL v165 = mw_mirth_type_CTypeStackPart_ctype(v141); + VAL v166 = mw_mirth_type_CType_cname(v165); + VAL v167 = mw_mirth_c99_ZPlusC99_put(v166, v164); + STR* v168; + STRLIT(v168, ")(", 2); + VAL v169 = mw_mirth_c99_ZPlusC99_put(MKSTR(v168), v167); + VAL v170 = mw_mirth_c99_ZPlusC99_put(v143, v169); + STR* v171; + STRLIT(v171, ");", 2); + VAL v172 = mw_mirth_c99_ZPlusC99_put(MKSTR(v171), v170); + VAL v173 = mw_mirth_c99_ZPlusC99_line(v172); + VTUP(v173)->cells[4] = MKI64(v152); + VTUP(v144)->cells[1] = v173; + x149 = v141; + x148 = v144; + x147 = v159; } - decref(x341); - int64_t v364 = 1LL; - int64_t v365 = i64_sub(x339, v364); - int64_t v366 = 0LL; - bool v367 = (v365 < v366); - int64_t x368; - if (v367) { - int64_t v369 = 0LL; - x368 = v369; - lpush(&lbl_outty, x336); - lpush(&lbl_ext, MKU64(x337)); - lpush(&lbl_cty, x338); - push_resource(x340); + decref(x149); + int64_t v174 = 1LL; + int64_t v175 = i64_sub(x147, v174); + int64_t v176 = 0LL; + bool v177 = (v175 < v176); + int64_t x178; + if (v177) { + int64_t v179 = 0LL; + x178 = v179; } else { - x368 = v365; - lpush(&lbl_outty, x336); - lpush(&lbl_ext, MKU64(x337)); - lpush(&lbl_cty, x338); - push_resource(x340); + x178 = v175; } - int64_t v370 = 1LL /* True */; - x330 = v370; - x329 = v323; - x328 = x368; - VAL v371 = lpop(&lbl_cty); - x327 = v371; - VAL r372 = pop_resource(); - x326 = r372; - uint64_t v373 = VU64(lpop(&lbl_ext)); - x325 = v373; - VAL v374 = lpop(&lbl_outty); - x324 = v374; + int64_t v180 = 1LL /* True */; + x140 = v180; + x139 = v142; + x138 = x178; + x137 = x148; } break; - case 0LL: { // None - int64_t v375 = 0LL /* False */; - x330 = v375; - x329 = v323; - x328 = v320; - x327 = v319; - x326 = v318; - x325 = v317; - x324 = v316; + case 0LL: { // Nil + VAL v181 = MKI64(0LL /* Nil */); + int64_t v182 = 0LL /* False */; + x140 = v182; + x139 = v181; + x138 = v133; + x137 = v134; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v315 = x330; - v314 = x329; - v313 = x328; - v312 = x327; - v311 = x326; - v310 = x325; - v309 = x324; - } - decref(v314); - VAL v376 = (VVAL(VTUP(v311)->cells[1])); - VAL v377 = (mw_mirth_c99_ZPlusC99_indent(v376)); - incref(v309); - uint64_t x378; - VAL x379; - int64_t x380; - VAL x381; - VAL x382; - switch (get_data_tag(v309)) { - case 1LL: { // Some - VAL v383 = mtp_std_maybe_Maybe_1_Some(v309); - VAL v384 = mw_mirth_type_CTypeStackPart_ctype(v383); - VAL v385 = mw_mirth_type_CType_cname(v384); - VAL v386 = (mw_mirth_c99_ZPlusC99_put(v385, v377)); - STR* v387; - STRLIT(v387, " Y = ", 5); - VAL v388 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v387), v386)); - x382 = v309; - x381 = v388; - x380 = v313; - x379 = v312; - x378 = v310; - } break; - case 0LL: { // None - x382 = v309; - x381 = v377; - x380 = v313; - x379 = v312; - x378 = v310; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v132 = x140; + v131 = x140; + v130 = x139; + v129 = x137; + v128 = x138; } - VAL v389 = mw_mirth_external_External_symbol(x378); - VAL v390 = (mw_mirth_c99_ZPlusC99_put(v389, x381)); - STR* v391; - STRLIT(v391, "(", 1); - VAL v392 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v391), v390)); - int64_t v393 = 1LL; - incref(x379); - VAL v394 = VVAL(VTUP(x379)->cells[1]); - incref(v394); - decref(x379); - VAL v395 = VVAL(VTUP(v394)->cells[2]); - incref(v395); - decref(v394); - VAL v396 = MKI64(0LL /* Nil */); - VAL v397 = mw_std_list_List_1_reverse(v396); - VAL v398; - VAL v399; - mw_std_list_List_1_uncons(v395, &v398, &v399); - VAL x400; - uint64_t x401; - VAL x402; - int64_t x403; - VAL x404; - VAL x405; - VAL x406; - int64_t x407; - switch (get_data_tag(v398)) { + decref(v130); + int64_t v183 = VI64(VTUP(v129)->cells[3]); + VAL v184 = VVAL(VTUP(v129)->cells[1]); + int64_t v185 = VI64(VTUP(v184)->cells[4]); + VTUP(v184)->cells[4] = MKI64(v183); + VAL v186 = mw_mirth_c99_ZPlusC99_indent(v184); + incref(x78); + VAL x187; + switch (get_data_tag(x78)) { case 1LL: { // Some - VAL v408 = mtp_std_maybe_Maybe_1_Some(v398); - incref(v408); - VAL v409 = mw_mirth_type_CTypeStackPart_ctype(v408); - int64_t v410 = mw_mirth_type_CType_phantomZAsk(v409); - VAL x411; - uint64_t x412; - VAL x413; - int64_t x414; - VAL x415; - VAL x416; - if (((bool)v410)) { - decref(v408); - VAL v417 = MKI64(0LL /* None */); - x416 = v417; - x415 = x379; - x414 = v393; - x413 = v392; - x412 = x378; - x411 = x382; - } else { - int64_t v418; - VAL v419; - VAL v420; - mw_mirth_type_CTypeStackPart_c99Z_argZ_name(v393, v408, v392, &v418, &v419, &v420); - VAL v421 = mtw_std_maybe_Maybe_1_Some(v419); - x416 = v421; - x415 = x379; - x414 = v418; - x413 = v420; - x412 = x378; - x411 = x382; - } - int64_t v422 = 1LL; - int64_t v423 = i64_add(x414, v422); - VAL x424; - switch (get_data_tag(x416)) { - case 1LL: { // Some - VAL v425 = mtp_std_maybe_Maybe_1_Some(x416); - VAL v426 = mtw_std_list_List_1_Cons(v425, v397); - x424 = v426; - lpush(&lbl_outty, x411); - lpush(&lbl_ext, MKU64(x412)); - push_resource(x413); - lpush(&lbl_cty, x415); - lpush(&lbl_argZ_index, MKI64(v423)); - } break; - case 0LL: { // None - x424 = v397; - lpush(&lbl_outty, x411); - lpush(&lbl_ext, MKU64(x412)); - push_resource(x413); - lpush(&lbl_cty, x415); - lpush(&lbl_argZ_index, MKI64(v423)); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v427 = 1LL /* True */; - x407 = v427; - x406 = v399; - x405 = x424; - VAL v428 = lpop(&lbl_cty); - x404 = v428; - int64_t v429 = VI64(lpop(&lbl_argZ_index)); - x403 = v429; - VAL r430 = pop_resource(); - x402 = r430; - uint64_t v431 = VU64(lpop(&lbl_ext)); - x401 = v431; - VAL v432 = lpop(&lbl_outty); - x400 = v432; + VAL v188 = mtp_std_maybe_Maybe_1_Some(x78); + VAL v189 = mw_mirth_type_CTypeStackPart_ctype(v188); + VAL v190 = mw_mirth_type_CType_cname(v189); + VAL v191 = mw_mirth_c99_ZPlusC99_put(v190, v186); + STR* v192; + STRLIT(v192, " Y = ", 5); + VAL v193 = mw_mirth_c99_ZPlusC99_put(MKSTR(v192), v191); + x187 = v193; } break; case 0LL: { // None - int64_t v433 = 0LL /* False */; - x407 = v433; - x406 = v399; - x405 = v397; - x404 = x379; - x403 = v393; - x402 = v392; - x401 = x378; - x400 = x382; + x187 = v186; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v434 = x400; - uint64_t v435 = x401; - VAL v436 = (x402); - int64_t v437 = x403; - VAL v438 = x404; - VAL v439 = (x405); - VAL v440 = x406; - int64_t v441 = x407; - while (((bool)v441)) { - VAL v442 = v434; - uint64_t v443 = v435; - VAL v444 = (v436); - int64_t v445 = v437; - VAL v446 = v438; - VAL v447 = (v439); - VAL v448 = v440; - VAL v449; - VAL v450; - mw_std_list_List_1_uncons(v448, &v449, &v450); - VAL x451; - uint64_t x452; - VAL x453; - int64_t x454; - VAL x455; - VAL x456; - VAL x457; - int64_t x458; - switch (get_data_tag(v449)) { - case 1LL: { // Some - VAL v459 = mtp_std_maybe_Maybe_1_Some(v449); - incref(v459); - VAL v460 = mw_mirth_type_CTypeStackPart_ctype(v459); - int64_t v461 = mw_mirth_type_CType_phantomZAsk(v460); - VAL x462; - uint64_t x463; - VAL x464; - int64_t x465; - VAL x466; - VAL x467; - if (((bool)v461)) { - decref(v459); - VAL v468 = MKI64(0LL /* None */); - x467 = v468; - x466 = v446; - x465 = v445; - x464 = v444; - x463 = v443; - x462 = v442; + VAL v194 = mw_mirth_external_External_symbol(x79); + VAL v195 = mw_mirth_c99_ZPlusC99_put(v194, x187); + STR* v196; + STRLIT(v196, "(", 1); + VAL v197 = mw_mirth_c99_ZPlusC99_put(MKSTR(v196), v195); + int64_t v198 = 1LL; + incref(x80); + VAL v199 = VVAL(VTUP(x80)->cells[1]); + incref(v199); + decref(x80); + VAL v200 = VVAL(VTUP(v199)->cells[2]); + incref(v200); + decref(v199); + VAL v201 = MKI64(0LL /* Nil */); + VAL v202 = mw_std_list_List_1_reverse(v201); + int64_t v203 = 1LL /* True */; + int64_t v204 = v198; + VAL v205 = v197; + VAL v206 = v202; + VAL v207 = v200; + int64_t v208 = v203; + int64_t v209 = v203; + while (((bool)v209)) { + int64_t v210 = v204; + VAL v211 = v205; + VAL v212 = v206; + VAL v213 = v207; + int64_t v214 = v208; + VAL x215; + int64_t x216; + VAL x217; + VAL x218; + int64_t x219; + switch (get_data_tag(v213)) { + case 1LL: { // Cons + VAL v220; + VAL v221; + mtp_std_list_List_1_Cons(v213, &v220, &v221); + incref(v220); + VAL v222 = mw_mirth_type_CTypeStackPart_ctype(v220); + int64_t v223 = mw_mirth_type_CType_phantomZAsk(v222); + int64_t x224; + VAL x225; + VAL x226; + if (((bool)v223)) { + decref(v220); + VAL v227 = MKI64(0LL /* None */); + x226 = v227; + x225 = v211; + x224 = v210; } else { - int64_t v469; - VAL v470; - VAL v471; - mw_mirth_type_CTypeStackPart_c99Z_argZ_name(v445, v459, v444, &v469, &v470, &v471); - VAL v472 = mtw_std_maybe_Maybe_1_Some(v470); - x467 = v472; - x466 = v446; - x465 = v469; - x464 = v471; - x463 = v443; - x462 = v442; - } - int64_t v473 = 1LL; - int64_t v474 = i64_add(x465, v473); - VAL x475; - switch (get_data_tag(x467)) { - case 1LL: { // Some - VAL v476 = mtp_std_maybe_Maybe_1_Some(x467); - VAL v477 = mtw_std_list_List_1_Cons(v476, v447); - x475 = v477; - lpush(&lbl_outty, x462); - lpush(&lbl_ext, MKU64(x463)); - push_resource(x464); - lpush(&lbl_cty, x466); - lpush(&lbl_argZ_index, MKI64(v474)); - } break; - case 0LL: { // None - x475 = v447; - lpush(&lbl_outty, x462); - lpush(&lbl_ext, MKU64(x463)); - push_resource(x464); - lpush(&lbl_cty, x466); - lpush(&lbl_argZ_index, MKI64(v474)); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + int64_t v228; + VAL v229; + VAL v230; + mw_mirth_type_CTypeStackPart_c99Z_argZ_name(v210, v220, v211, &v228, &v229, &v230); + VAL v231 = mtw_std_maybe_Maybe_1_Some(v229); + x226 = v231; + x225 = v230; + x224 = v228; } - int64_t v478 = 1LL /* True */; - x458 = v478; - x457 = v450; - x456 = x475; - VAL v479 = lpop(&lbl_cty); - x455 = v479; - int64_t v480 = VI64(lpop(&lbl_argZ_index)); - x454 = v480; - VAL r481 = pop_resource(); - x453 = r481; - uint64_t v482 = VU64(lpop(&lbl_ext)); - x452 = v482; - VAL v483 = lpop(&lbl_outty); - x451 = v483; + int64_t v232 = 1LL; + int64_t v233 = i64_add(x224, v232); + VAL v234 = mw_std_maybe_Maybe_1_for_1_sp5(v212, x226); + int64_t v235 = 1LL /* True */; + x219 = v235; + x218 = v221; + x217 = v234; + x216 = v233; + x215 = x225; } break; - case 0LL: { // None - int64_t v484 = 0LL /* False */; - x458 = v484; - x457 = v450; - x456 = v447; - x455 = v446; - x454 = v445; - x453 = v444; - x452 = v443; - x451 = v442; + case 0LL: { // Nil + VAL v236 = MKI64(0LL /* Nil */); + int64_t v237 = 0LL /* False */; + x219 = v237; + x218 = v236; + x217 = v212; + x216 = v210; + x215 = v211; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v441 = x458; - v440 = x457; - v439 = x456; - v438 = x455; - v437 = x454; - v436 = x453; - v435 = x452; - v434 = x451; - } - decref(v440); - VAL v485 = mw_std_list_List_1_reverse(v439); - VAL v486; - VAL v487; - mw_std_list_List_1_uncons(v485, &v486, &v487); - VAL x488; - uint64_t x489; - VAL x490; - int64_t x491; - VAL x492; - switch (get_data_tag(v486)) { - case 1LL: { // Some - VAL v493 = mtp_std_maybe_Maybe_1_Some(v486); - VAL v494 = (mw_mirth_c99_ZPlusC99_put(v493, v436)); - x492 = v438; - x491 = v437; - x490 = v494; - x489 = v435; - x488 = v434; - } break; - case 0LL: { // None - x492 = v438; - x491 = v437; - x490 = v436; - x489 = v435; - x488 = v434; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v209 = x219; + v208 = x219; + v207 = x218; + v206 = x217; + v205 = x215; + v204 = x216; } - VAL v495; - VAL v496; - mw_std_list_List_1_uncons(v487, &v495, &v496); - VAL x497; - uint64_t x498; - VAL x499; - int64_t x500; - VAL x501; - VAL x502; - int64_t x503; - switch (get_data_tag(v495)) { + decref(v207); + VAL v238 = mw_std_list_List_1_reverse(v206); + VAL v239; + VAL v240; + mw_std_list_List_1_uncons(v238, &v239, &v240); + VAL x241; + switch (get_data_tag(v239)) { case 1LL: { // Some - VAL v504 = mtp_std_maybe_Maybe_1_Some(v495); - STR* v505; - STRLIT(v505, ", ", 2); - VAL v506 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v505), x490)); - VAL v507 = (mw_mirth_c99_ZPlusC99_put(v504, v506)); - int64_t v508 = 1LL /* True */; - x503 = v508; - x502 = v496; - x501 = x492; - x500 = x491; - x499 = v507; - x498 = x489; - x497 = x488; + VAL v242 = mtp_std_maybe_Maybe_1_Some(v239); + VAL v243 = mw_mirth_c99_ZPlusC99_put(v242, v205); + x241 = v243; } break; case 0LL: { // None - int64_t v509 = 0LL /* False */; - x503 = v509; - x502 = v496; - x501 = x492; - x500 = x491; - x499 = x490; - x498 = x489; - x497 = x488; + x241 = v205; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v510 = x497; - uint64_t v511 = x498; - VAL v512 = (x499); - int64_t v513 = x500; - VAL v514 = x501; - VAL v515 = x502; - int64_t v516 = x503; - while (((bool)v516)) { - VAL v517 = v510; - uint64_t v518 = v511; - VAL v519 = (v512); - int64_t v520 = v513; - VAL v521 = v514; - VAL v522 = v515; - VAL v523; - VAL v524; - mw_std_list_List_1_uncons(v522, &v523, &v524); - VAL x525; - uint64_t x526; - VAL x527; - int64_t x528; - VAL x529; - VAL x530; - int64_t x531; - switch (get_data_tag(v523)) { - case 1LL: { // Some - VAL v532 = mtp_std_maybe_Maybe_1_Some(v523); - STR* v533; - STRLIT(v533, ", ", 2); - VAL v534 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v533), v519)); - VAL v535 = (mw_mirth_c99_ZPlusC99_put(v532, v534)); - int64_t v536 = 1LL /* True */; - x531 = v536; - x530 = v524; - x529 = v521; - x528 = v520; - x527 = v535; - x526 = v518; - x525 = v517; + int64_t v244 = 1LL /* True */; + VAL v245 = x241; + VAL v246 = v240; + int64_t v247 = v244; + int64_t v248 = v244; + while (((bool)v248)) { + VAL v249 = v245; + VAL v250 = v246; + int64_t v251 = v247; + VAL x252; + VAL x253; + int64_t x254; + switch (get_data_tag(v250)) { + case 1LL: { // Cons + VAL v255; + VAL v256; + mtp_std_list_List_1_Cons(v250, &v255, &v256); + STR* v257; + STRLIT(v257, ", ", 2); + VAL v258 = mw_mirth_c99_ZPlusC99_put(MKSTR(v257), v249); + VAL v259 = mw_mirth_c99_ZPlusC99_put(v255, v258); + int64_t v260 = 1LL /* True */; + x254 = v260; + x253 = v256; + x252 = v259; } break; - case 0LL: { // None - int64_t v537 = 0LL /* False */; - x531 = v537; - x530 = v524; - x529 = v521; - x528 = v520; - x527 = v519; - x526 = v518; - x525 = v517; + case 0LL: { // Nil + VAL v261 = MKI64(0LL /* Nil */); + int64_t v262 = 0LL /* False */; + x254 = v262; + x253 = v261; + x252 = v249; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v516 = x531; - v515 = x530; - v514 = x529; - v513 = x528; - v512 = x527; - v511 = x526; - v510 = x525; - } - decref(v515); - STR* v538; - STRLIT(v538, ");", 2); - VAL v539 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v538), v512)); - VAL v540 = (mw_mirth_c99_ZPlusC99_line(v539)); - VTUP(v311)->cells[1] = v540; - incref(v514); - VAL v541 = VVAL(VTUP(v514)->cells[2]); - incref(v541); - decref(v514); - VAL v542 = VVAL(VTUP(v541)->cells[2]); - incref(v542); - decref(v541); - VAL v543; - VAL v544; - mw_std_list_List_1_uncons(v542, &v543, &v544); - VAL x545; - uint64_t x546; - int64_t x547; - VAL x548; - VAL x549; - VAL x550; - int64_t x551; - switch (get_data_tag(v543)) { - case 1LL: { // Some - VAL v552 = mtp_std_maybe_Maybe_1_Some(v543); - incref(v552); - incref(v552); - VAL v553 = mw_mirth_type_CTypeStackPart_ctype(v552); - int64_t v554 = mw_mirth_type_CType_phantomZAsk(v553); - VAL x555; - uint64_t x556; - int64_t x557; - VAL x558; - VAL x559; - VAL x560; - if (((bool)v554)) { - decref(v552); - STR* v561; - STRLIT(v561, "0", 1); - x560 = MKSTR(v561); - x559 = v514; - x558 = v311; - x557 = v513; - x556 = v511; - x555 = v510; - } else { - VAL v562 = mw_mirth_type_CTypeStackPart_labelZAsk(v552); - VAL x563; - uint64_t x564; - int64_t x565; - VAL x566; - VAL x567; - VAL x568; - switch (get_data_tag(v562)) { - case 1LL: { // Some - VAL v569 = mtp_std_maybe_Maybe_1_Some(v562); - uint64_t v570 = mw_mirth_label_Label_name(VU64(v569)); - VAL v571 = mw_mirth_name_Name_mangled(v570); - x568 = v571; - x567 = v514; - x566 = v311; - x565 = v513; - x564 = v511; - x563 = v510; - } break; - case 0LL: { // None - STR* v572; - STRLIT(v572, "Y", 1); - x568 = MKSTR(v572); - x567 = v514; - x566 = v311; - x565 = v513; - x564 = v511; - x563 = v510; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x560 = x568; - x559 = x567; - x558 = x566; - x557 = x565; - x556 = x564; - x555 = x563; - } - VAL v573 = (mw_mirth_type_CTypeStackPart_c99Z_push(x560, v552, x558)); - int64_t v574 = 1LL /* True */; - x551 = v574; - x550 = v544; - x549 = x559; - x548 = v573; - x547 = x557; - x546 = x556; - x545 = x555; - } break; - case 0LL: { // None - int64_t v575 = 0LL /* False */; - x551 = v575; - x550 = v544; - x549 = v514; - x548 = v311; - x547 = v513; - x546 = v511; - x545 = v510; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v248 = x254; + v247 = x254; + v246 = x253; + v245 = x252; } - VAL v576 = x545; - uint64_t v577 = x546; - int64_t v578 = x547; - VAL v579 = (x548); - VAL v580 = x549; - VAL v581 = x550; - int64_t v582 = x551; - while (((bool)v582)) { - VAL v583 = v576; - uint64_t v584 = v577; - int64_t v585 = v578; - VAL v586 = (v579); - VAL v587 = v580; - VAL v588 = v581; - VAL v589; - VAL v590; - mw_std_list_List_1_uncons(v588, &v589, &v590); - VAL x591; - uint64_t x592; - int64_t x593; - VAL x594; - VAL x595; - VAL x596; - int64_t x597; - switch (get_data_tag(v589)) { - case 1LL: { // Some - VAL v598 = mtp_std_maybe_Maybe_1_Some(v589); - incref(v598); - incref(v598); - VAL v599 = mw_mirth_type_CTypeStackPart_ctype(v598); - int64_t v600 = mw_mirth_type_CType_phantomZAsk(v599); - VAL x601; - uint64_t x602; - int64_t x603; - VAL x604; - VAL x605; - VAL x606; - if (((bool)v600)) { - decref(v598); - STR* v607; - STRLIT(v607, "0", 1); - x606 = MKSTR(v607); - x605 = v587; - x604 = v586; - x603 = v585; - x602 = v584; - x601 = v583; + decref(v246); + STR* v263; + STRLIT(v263, ");", 2); + VAL v264 = mw_mirth_c99_ZPlusC99_put(MKSTR(v263), v245); + VAL v265 = mw_mirth_c99_ZPlusC99_line(v264); + VTUP(v265)->cells[4] = MKI64(v185); + VTUP(v129)->cells[1] = v265; + incref(x80); + VAL v266 = VVAL(VTUP(x80)->cells[2]); + incref(v266); + decref(x80); + VAL v267 = VVAL(VTUP(v266)->cells[2]); + incref(v267); + decref(v266); + int64_t v268 = 1LL /* True */; + VAL v269 = v129; + VAL v270 = v267; + int64_t v271 = v268; + int64_t v272 = v268; + while (((bool)v272)) { + VAL v273 = v269; + VAL v274 = v270; + int64_t v275 = v271; + VAL x276; + VAL x277; + int64_t x278; + switch (get_data_tag(v274)) { + case 1LL: { // Cons + VAL v279; + VAL v280; + mtp_std_list_List_1_Cons(v274, &v279, &v280); + incref(v279); + incref(v279); + VAL v281 = mw_mirth_type_CTypeStackPart_ctype(v279); + int64_t v282 = mw_mirth_type_CType_phantomZAsk(v281); + VAL x283; + if (((bool)v282)) { + decref(v279); + STR* v284; + STRLIT(v284, "0", 1); + x283 = MKSTR(v284); } else { - VAL v608 = mw_mirth_type_CTypeStackPart_labelZAsk(v598); - VAL x609; - uint64_t x610; - int64_t x611; - VAL x612; - VAL x613; - VAL x614; - switch (get_data_tag(v608)) { + VAL v285 = mw_mirth_type_CTypeStackPart_labelZAsk(v279); + VAL x286; + switch (get_data_tag(v285)) { case 1LL: { // Some - VAL v615 = mtp_std_maybe_Maybe_1_Some(v608); - uint64_t v616 = mw_mirth_label_Label_name(VU64(v615)); - VAL v617 = mw_mirth_name_Name_mangled(v616); - x614 = v617; - x613 = v587; - x612 = v586; - x611 = v585; - x610 = v584; - x609 = v583; + VAL v287 = mtp_std_maybe_Maybe_1_Some(v285); + uint64_t v288 = mw_mirth_label_Label_name(VU64(v287)); + VAL v289 = mw_mirth_name_Name_mangled(v288); + x286 = v289; } break; case 0LL: { // None - STR* v618; - STRLIT(v618, "Y", 1); - x614 = MKSTR(v618); - x613 = v587; - x612 = v586; - x611 = v585; - x610 = v584; - x609 = v583; + STR* v290; + STRLIT(v290, "Y", 1); + x286 = MKSTR(v290); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x606 = x614; - x605 = x613; - x604 = x612; - x603 = x611; - x602 = x610; - x601 = x609; + x283 = x286; } - VAL v619 = (mw_mirth_type_CTypeStackPart_c99Z_push(x606, v598, x604)); - int64_t v620 = 1LL /* True */; - x597 = v620; - x596 = v590; - x595 = x605; - x594 = v619; - x593 = x603; - x592 = x602; - x591 = x601; + VAL v291 = mw_mirth_type_CTypeStackPart_c99Z_push(x283, v279, v273); + int64_t v292 = 1LL /* True */; + x278 = v292; + x277 = v280; + x276 = v291; } break; - case 0LL: { // None - int64_t v621 = 0LL /* False */; - x597 = v621; - x596 = v590; - x595 = v587; - x594 = v586; - x593 = v585; - x592 = v584; - x591 = v583; + case 0LL: { // Nil + VAL v293 = MKI64(0LL /* Nil */); + int64_t v294 = 0LL /* False */; + x278 = v294; + x277 = v293; + x276 = v273; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v582 = x597; - v581 = x596; - v580 = x595; - v579 = x594; - v578 = x593; - v577 = x592; - v576 = x591; - } - decref(v581); - VAL v622 = (mw_mirth_c99_c99Z_apiZ_exitZBang(v240, v579)); - int64_t v623 = VI64(VTUP(v622)->cells[2]); - int64_t v624 = 1LL; - int64_t v625 = i64_sub(v623, v624); - int64_t v626 = 0LL; - bool v627 = (v625 < v626); - int64_t x628; - if (v627) { - int64_t v629 = 0LL; - x628 = v629; - lpush(&lbl_outty, v576); - lpush(&lbl_ext, MKU64(v577)); - lpush(&lbl_argZ_index, MKI64(v578)); - lpush(&lbl_cty, v580); + v272 = x278; + v271 = x278; + v270 = x277; + v269 = x276; + } + decref(v270); + VAL v295 = mw_mirth_c99_c99Z_apiZ_exitZBang(v117, v269); + int64_t v296 = VI64(VTUP(v295)->cells[2]); + int64_t v297 = 1LL; + int64_t v298 = i64_sub(v296, v297); + int64_t v299 = 0LL; + bool v300 = (v298 < v299); + int64_t x301; + if (v300) { + int64_t v302 = 0LL; + x301 = v302; } else { - x628 = v625; - lpush(&lbl_outty, v576); - lpush(&lbl_ext, MKU64(v577)); - lpush(&lbl_argZ_index, MKI64(v578)); - lpush(&lbl_cty, v580); - } - VTUP(v622)->cells[2] = MKI64(x628); - VAL v630 = (mw_mirth_c99_ZPlusC99_indent(v622)); - STR* v631; - STRLIT(v631, "}", 1); - VAL v632 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v631), v630)); - VAL v633 = (mw_mirth_c99_ZPlusC99_line(v632)); - int64_t v634 = VI64(lpop(&lbl_argZ_index)); - uint64_t v635 = VU64(lpop(&lbl_ext)); - VAL v636 = lpop(&lbl_cty); - VAL v637 = lpop(&lbl_outty); - decref(v637); - decref(v636); - return v633; + x301 = v298; + } + VTUP(v295)->cells[2] = MKI64(x301); + VAL v303 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2(v295); + decref(x78); + decref(x80); + return v303; } static void mw_mirth_type_CTypeStackPart_c99Z_argZ_name (int64_t x1, VAL x2, VAL x3, int64_t *x4, VAL *x5, VAL *x6) { VAL v7 = mw_mirth_type_CTypeStackPart_labelZAsk(x2); int64_t x8; VAL x9; - VAL x10; switch (get_data_tag(v7)) { case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v7); - uint64_t v12 = mw_mirth_label_Label_name(VU64(v11)); - VAL v13 = mw_mirth_name_Name_mangled(v12); - x10 = v13; - x9 = x3; + VAL v10 = mtp_std_maybe_Maybe_1_Some(v7); + uint64_t v11 = mw_mirth_label_Label_name(VU64(v10)); + VAL v12 = mw_mirth_name_Name_mangled(v11); + x9 = v12; x8 = x1; } break; case 0LL: { // None + STR* v13; + STRLIT(v13, "", 0); STR* v14; - STRLIT(v14, "", 0); - STR* v15; - STRLIT(v15, "X", 1); - VAL v16 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v15), MKSTR(v14))); - STR* v17 = i64_show(x1); - VAL v18 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v17), v16)); - x10 = v18; - x9 = x3; + STRLIT(v14, "X", 1); + VAL v15 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v14), MKSTR(v13)); + STR* v16 = i64_show(x1); + VAL v17 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v16), v15); + x9 = v17; x8 = x1; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x6 = x9; - *x5 = x10; + *x6 = x3; + *x5 = x9; *x4 = x8; } static int64_t mw_mirth_type_CType_ZToC99ReprType (VAL x1) { @@ -73541,8 +53008,8 @@ static void mw_mirth_type_CTypeStackPart_c99Z_pop (VAL x1, VAL x2, VAL *x3, VAL int64_t v8 = mw_mirth_type_CType_ZToC99ReprType(v7); VAL v9; VAL v10; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x2, v8, &v9, &v10); - VAL v11 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v8, v10); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x2, v8, &v9, &v10); + VAL v11 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v8, v10); x6 = v9; x5 = v11; } break; @@ -73551,9 +53018,9 @@ static void mw_mirth_type_CTypeStackPart_c99Z_pop (VAL x1, VAL x2, VAL *x3, VAL int64_t v13 = mw_mirth_type_CType_ZToC99ReprType(v12); VAL v14; VAL v15; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(x2, v13, &v14, &v15); - VAL v16 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(v15)); - VAL v17 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v13, v16); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(x2, v13, &v14, &v15); + VAL v16 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(v15); + VAL v17 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v13, v16); x6 = v14; x5 = v17; } break; @@ -73564,8 +53031,8 @@ static void mw_mirth_type_CTypeStackPart_c99Z_pop (VAL x1, VAL x2, VAL *x3, VAL int64_t v20 = mw_mirth_type_CType_ZToC99ReprType(v18); VAL v21; VAL v22; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang(v20, v19, x2, &v21, &v22); - VAL v23 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v20, v22); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang(v20, v19, x2, &v21, &v22); + VAL v23 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v20, v22); x6 = v21; x5 = v23; } break; @@ -73576,9 +53043,9 @@ static void mw_mirth_type_CTypeStackPart_c99Z_pop (VAL x1, VAL x2, VAL *x3, VAL int64_t v26 = mw_mirth_type_CType_ZToC99ReprType(v24); VAL v27; VAL v28; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang(v26, v25, x2, &v27, &v28); - VAL v29 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(v28)); - VAL v30 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v26, v29); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang(v26, v25, x2, &v27, &v28); + VAL v29 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(v28); + VAL v30 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v26, v29); x6 = v27; x5 = v30; } break; @@ -73595,188 +53062,72 @@ static VAL mw_mirth_type_CTypeStackPart_c99Z_push (VAL x1, VAL x2, VAL x3) { case 0LL: { // CTSPCons VAL v5 = mtp_mirth_type_CTypeStackPart_CTSPCons(x2); int64_t v6 = mw_mirth_type_CType_ZToC99ReprType(v5); - VAL v7 = (VVAL(VTUP(x3)->cells[1])); + VAL v7; VAL v8; - VAL v9; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v7, &v8, &v9); - VAL v10 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v6, v8)); - VAL v11 = (mw_mirth_c99_ZPlusC99_indent(v9)); - int64_t v12 = VI64(VTUP(v10)->cells[1]); - VAL v13 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v12); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(v13, v11)); - STR* v15; - STRLIT(v15, " ", 1); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14)); - VAL v17 = VVAL(VTUP(v10)->cells[2]); - incref(v17); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(v17, v16)); - STR* v19; - STRLIT(v19, " = ", 3); - VAL v20 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18)); - STR* v21; - STRLIT(v21, "(", 1); - VAL v22 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20)); - VAL v23 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v6); - VAL v24 = (mw_mirth_c99_ZPlusC99_put(v23, v22)); - STR* v25; - STRLIT(v25, ")(", 2); - VAL v26 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v24)); - VAL v27 = (mw_mirth_c99_ZPlusC99_put(x1, v26)); - STR* v28; - STRLIT(v28, ")", 1); - VAL v29 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v28), v27)); - STR* v30; - STRLIT(v30, ";", 1); - VAL v31 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v30), v29)); - VAL v32 = (mw_mirth_c99_ZPlusC99_line(v31)); - VTUP(x3)->cells[1] = v32; - VAL v33 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x3, v10)); - x4 = v33; + mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp30(x1, v6, x3, v6, &v7, &v8); + VAL v9 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v7, v8); + x4 = v9; } break; case 2LL: { // CTSPWith - VAL v34 = mtp_mirth_type_CTypeStackPart_CTSPWith(x2); - int64_t v35 = mw_mirth_type_CType_ZToC99ReprType(v34); - VAL v36 = (VVAL(VTUP(x3)->cells[1])); - VAL v37; - VAL v38; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v36, &v37, &v38); - VAL v39 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v35, v37)); - VAL v40 = (mw_mirth_c99_ZPlusC99_indent(v38)); - int64_t v41 = VI64(VTUP(v39)->cells[1]); - VAL v42 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v41); - VAL v43 = (mw_mirth_c99_ZPlusC99_put(v42, v40)); - STR* v44; - STRLIT(v44, " ", 1); - VAL v45 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v44), v43)); - VAL v46 = VVAL(VTUP(v39)->cells[2]); - incref(v46); - VAL v47 = (mw_mirth_c99_ZPlusC99_put(v46, v45)); - STR* v48; - STRLIT(v48, " = (", 4); - VAL v49 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v48), v47)); - STR* v50; - STRLIT(v50, "(", 1); - VAL v51 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v50), v49)); - VAL v52 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v35); - VAL v53 = (mw_mirth_c99_ZPlusC99_put(v52, v51)); - STR* v54; - STRLIT(v54, ")(", 2); - VAL v55 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v54), v53)); - VAL v56 = (mw_mirth_c99_ZPlusC99_put(x1, v55)); - STR* v57; - STRLIT(v57, ")", 1); - VAL v58 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v57), v56)); - STR* v59; - STRLIT(v59, ");", 2); - VAL v60 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v59), v58)); - VAL v61 = (mw_mirth_c99_ZPlusC99_line(v60)); - VTUP(x3)->cells[1] = v61; - VAL v62 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(x3, v39)); - x4 = v62; + VAL v10 = mtp_mirth_type_CTypeStackPart_CTSPWith(x2); + int64_t v11 = mw_mirth_type_CType_ZToC99ReprType(v10); + VAL v12 = VVAL(VTUP(x3)->cells[1]); + VAL v13; + VAL v14; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v12, &v13, &v14); + VTUP(x3)->cells[1] = v14; + int64_t v15 = VI64(VTUP(x3)->cells[3]); + VAL v16 = VVAL(VTUP(x3)->cells[1]); + int64_t v17 = VI64(VTUP(v16)->cells[4]); + VTUP(v16)->cells[4] = MKI64(v15); + VAL v18 = mw_mirth_c99_ZPlusC99_indent(v16); + VAL v19 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v11); + VAL v20 = mw_mirth_c99_ZPlusC99_put(v19, v18); + STR* v21; + STRLIT(v21, " ", 1); + VAL v22 = mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20); + incref(v13); + VAL v23 = mw_mirth_c99_ZPlusC99_put(v13, v22); + STR* v24; + STRLIT(v24, " = ", 3); + VAL v25 = mw_mirth_c99_ZPlusC99_put(MKSTR(v24), v23); + VAL v26 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v11, v13); + STR* v27; + STRLIT(v27, "(", 1); + VAL v28 = mw_mirth_c99_ZPlusC99_put(MKSTR(v27), v25); + VAL v29 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v11); + VAL v30 = mw_mirth_c99_ZPlusC99_put(v29, v28); + STR* v31; + STRLIT(v31, ")(", 2); + VAL v32 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + VAL v33 = mw_mirth_c99_ZPlusC99_put(x1, v32); + STR* v34; + STRLIT(v34, ")", 1); + VAL v35 = mw_mirth_c99_ZPlusC99_put(MKSTR(v34), v33); + STR* v36; + STRLIT(v36, ";", 1); + VAL v37 = mw_mirth_c99_ZPlusC99_put(MKSTR(v36), v35); + VAL v38 = mw_mirth_c99_ZPlusC99_line(v37); + VTUP(v38)->cells[4] = MKI64(v17); + VTUP(x3)->cells[1] = v38; + VAL v39 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(x3, v26); + x4 = v39; } break; case 1LL: { // CTSPConsLabel - VAL v63; - uint64_t v64; - mtp_mirth_type_CTypeStackPart_CTSPConsLabel(x2, &v63, &v64); - int64_t v65 = mw_mirth_type_CType_ZToC99ReprType(v63); - VAL v66 = (VVAL(VTUP(x3)->cells[1])); - VAL v67; - VAL v68; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v66, &v67, &v68); - VAL v69 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v65, v67)); - VAL v70 = (mw_mirth_c99_ZPlusC99_indent(v68)); - int64_t v71 = VI64(VTUP(v69)->cells[1]); - VAL v72 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v71); - VAL v73 = (mw_mirth_c99_ZPlusC99_put(v72, v70)); - STR* v74; - STRLIT(v74, " ", 1); - VAL v75 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v73)); - VAL v76 = VVAL(VTUP(v69)->cells[2]); - incref(v76); - VAL v77 = (mw_mirth_c99_ZPlusC99_put(v76, v75)); - STR* v78; - STRLIT(v78, " = ", 3); - VAL v79 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v78), v77)); - STR* v80; - STRLIT(v80, "(", 1); - VAL v81 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v80), v79)); - VAL v82 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v65); - VAL v83 = (mw_mirth_c99_ZPlusC99_put(v82, v81)); - STR* v84; - STRLIT(v84, ")(", 2); - VAL v85 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v84), v83)); - VAL v86 = (mw_mirth_c99_ZPlusC99_put(x1, v85)); - STR* v87; - STRLIT(v87, ")", 1); - VAL v88 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v87), v86)); - STR* v89; - STRLIT(v89, ";", 1); - VAL v90 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v89), v88)); - VAL v91 = (mw_mirth_c99_ZPlusC99_line(v90)); - VTUP(x3)->cells[1] = v91; - int64_t v92 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(v64); - VAL x93; - if (((bool)v92)) { - VAL v94 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v69)); - VAL v95 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v64, x3, v94)); - x93 = v95; - } else { - VAL v96 = (mw_mirth_c99_pushZ_localZ_labelZBang(v64, x3, v69)); - x93 = v96; - } - x4 = x93; + VAL v40; + uint64_t v41; + mtp_mirth_type_CTypeStackPart_CTSPConsLabel(x2, &v40, &v41); + int64_t v42 = mw_mirth_type_CType_ZToC99ReprType(v40); + VAL v43 = mw_mirth_c99_pushZ_labelZ_expressionZBang_1_sp5(x1, v42, v42, x3, v41); + x4 = v43; } break; case 3LL: { // CTSPWithLabel - VAL v97; - uint64_t v98; - mtp_mirth_type_CTypeStackPart_CTSPWithLabel(x2, &v97, &v98); - int64_t v99 = mw_mirth_type_CType_ZToC99ReprType(v97); - VAL v100 = (VVAL(VTUP(x3)->cells[1])); - VAL v101; - VAL v102; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v100, &v101, &v102); - VAL v103 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v99, v101)); - VAL v104 = (mw_mirth_c99_ZPlusC99_indent(v102)); - int64_t v105 = VI64(VTUP(v103)->cells[1]); - VAL v106 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v105); - VAL v107 = (mw_mirth_c99_ZPlusC99_put(v106, v104)); - STR* v108; - STRLIT(v108, " ", 1); - VAL v109 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v108), v107)); - VAL v110 = VVAL(VTUP(v103)->cells[2]); - incref(v110); - VAL v111 = (mw_mirth_c99_ZPlusC99_put(v110, v109)); - STR* v112; - STRLIT(v112, " = ", 3); - VAL v113 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v112), v111)); - STR* v114; - STRLIT(v114, "(", 1); - VAL v115 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v114), v113)); - VAL v116 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v99); - VAL v117 = (mw_mirth_c99_ZPlusC99_put(v116, v115)); - STR* v118; - STRLIT(v118, ")(", 2); - VAL v119 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v118), v117)); - VAL v120 = (mw_mirth_c99_ZPlusC99_put(x1, v119)); - STR* v121; - STRLIT(v121, ")", 1); - VAL v122 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v121), v120)); - STR* v123; - STRLIT(v123, ";", 1); - VAL v124 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v123), v122)); - VAL v125 = (mw_mirth_c99_ZPlusC99_line(v124)); - VTUP(x3)->cells[1] = v125; - int64_t v126 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(v98); - VAL x127; - if (((bool)v126)) { - VAL v128 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v103)); - VAL v129 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v98, x3, v128)); - x127 = v129; - } else { - VAL v130 = (mw_mirth_c99_pushZ_localZ_labelZBang(v98, x3, v103)); - x127 = v130; - } - x4 = x127; + VAL v44; + uint64_t v45; + mtp_mirth_type_CTypeStackPart_CTSPWithLabel(x2, &v44, &v45); + int64_t v46 = mw_mirth_type_CType_ZToC99ReprType(v44); + VAL v47 = mw_mirth_c99_pushZ_labelZ_expressionZBang_1_sp5(x1, v46, v46, x3, v45); + x4 = v47; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -73788,15 +53139,15 @@ static VAL mw_mirth_c99_ZPlusC99_indent (VAL x1) { int64_t v2 = VI64(VTUP(x1)->cells[2]); int64_t v3 = 0LL; bool v4 = (v2 > v3); - VAL v5 = (x1); + VAL v5 = x1; int64_t v6 = v2; bool v7 = v4; while (v7) { - VAL v8 = (v5); + VAL v8 = v5; int64_t v9 = v6; STR* v10; STRLIT(v10, "\t", 1); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v10), v8)); + VAL v11 = mw_mirth_c99_ZPlusC99_put(MKSTR(v10), v8); int64_t v12 = 1LL; int64_t v13 = i64_sub(v9, v12); int64_t v14 = 0LL; @@ -73805,17 +53156,14 @@ static VAL mw_mirth_c99_ZPlusC99_indent (VAL x1) { if (v15) { int64_t v17 = 0LL; x16 = v17; - push_resource(v11); } else { x16 = v13; - push_resource(v11); } int64_t v18 = 0LL; bool v19 = (x16 > v18); v7 = v19; v6 = x16; - VAL r20 = pop_resource(); - v5 = r20; + v5 = v11; } return v5; } @@ -73831,17 +53179,17 @@ static void mw_mirth_c99_C99APIArg_popZ_consumeZBang (VAL x1, VAL x2, VAL *x3, V case 0LL: { // C99AAS_Value VAL v10; VAL v11; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x2, v6, &v10, &v11); - VAL v12 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v6, v11); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x2, v6, &v10, &v11); + VAL v12 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v6, v11); x9 = v12; x8 = v10; } break; case 2LL: { // C99AAS_Resource VAL v13; VAL v14; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(x2, v6, &v13, &v14); - VAL v15 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(v14)); - VAL v16 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v6, v15); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(x2, v6, &v13, &v14); + VAL v15 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(v14); + VAL v16 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v6, v15); x9 = v16; x8 = v13; } break; @@ -73849,8 +53197,8 @@ static void mw_mirth_c99_C99APIArg_popZ_consumeZBang (VAL x1, VAL x2, VAL *x3, V uint64_t v17 = mtp_mirth_c99_C99APIArgSource_C99AASz_ValueLabel(v5); VAL v18; VAL v19; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang(v6, v17, x2, &v18, &v19); - VAL v20 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v6, v19); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang(v6, v17, x2, &v18, &v19); + VAL v20 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v6, v19); x9 = v20; x8 = v18; } break; @@ -73858,9 +53206,9 @@ static void mw_mirth_c99_C99APIArg_popZ_consumeZBang (VAL x1, VAL x2, VAL *x3, V uint64_t v21 = mtp_mirth_c99_C99APIArgSource_C99AASz_ResourceLabel(v5); VAL v22; VAL v23; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang(v6, v21, x2, &v22, &v23); - VAL v24 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(v23)); - VAL v25 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v6, v24); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang(v6, v21, x2, &v22, &v23); + VAL v24 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(v23); + VAL v25 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v6, v24); x9 = v25; x8 = v22; } break; @@ -73876,21 +53224,25 @@ static VAL mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang (VAL x1, VAL x2) { VAL v3; VAL v4; mw_mirth_c99_C99APIArg_popZ_consumeZBang(x1, x2, &v3, &v4); - VAL v5 = (VVAL(VTUP(v3)->cells[1])); - VAL v6 = (mw_mirth_c99_ZPlusC99_indent(v5)); - VAL v7 = VVAL(VTUP(x1)->cells[3]); - incref(v7); + int64_t v5 = VI64(VTUP(v3)->cells[3]); + VAL v6 = VVAL(VTUP(v3)->cells[1]); + int64_t v7 = VI64(VTUP(v6)->cells[4]); + VTUP(v6)->cells[4] = MKI64(v5); + VAL v8 = mw_mirth_c99_ZPlusC99_indent(v6); + VAL v9 = VVAL(VTUP(x1)->cells[3]); + incref(v9); decref(x1); - VAL v8 = (mw_mirth_c99_ZPlusC99_put(v7, v6)); - STR* v9; - STRLIT(v9, " = ", 3); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8)); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(v4, v10)); - STR* v12; - STRLIT(v12, ";", 1); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11)); - VAL v14 = (mw_mirth_c99_ZPlusC99_line(v13)); - VTUP(v3)->cells[1] = v14; + VAL v10 = mw_mirth_c99_ZPlusC99_put(v9, v8); + STR* v11; + STRLIT(v11, " = ", 3); + VAL v12 = mw_mirth_c99_ZPlusC99_put(MKSTR(v11), v10); + VAL v13 = mw_mirth_c99_ZPlusC99_put(v4, v12); + STR* v14; + STRLIT(v14, ";", 1); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13); + VAL v16 = mw_mirth_c99_ZPlusC99_line(v15); + VTUP(v16)->cells[4] = MKI64(v7); + VTUP(v3)->cells[1] = v16; return v3; } static VAL mw_mirth_c99_C99APIArg_pushZ_toZBang (VAL x1, VAL x2, VAL x3) { @@ -73902,136 +53254,53 @@ static VAL mw_mirth_c99_C99APIArg_pushZ_toZBang (VAL x1, VAL x2, VAL x3) { VAL x7; switch (get_data_tag(v4)) { case 0LL: { // C99AAS_Value - VAL v8 = (VVAL(VTUP(x3)->cells[1])); + VAL v8; VAL v9; - VAL v10; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v8, &v9, &v10); - VAL v11 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v5, v9)); - VAL v12 = (mw_mirth_c99_ZPlusC99_indent(v10)); - int64_t v13 = VI64(VTUP(v11)->cells[1]); - VAL v14 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v13); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(v14, v12)); - STR* v16; - STRLIT(v16, " ", 1); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15)); - VAL v18 = VVAL(VTUP(v11)->cells[2]); - incref(v18); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(v18, v17)); - STR* v20; - STRLIT(v20, " = ", 3); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19)); - VAL v22 = (mw_mirth_c99_ZPlusC99_put(x1, v21)); - STR* v23; - STRLIT(v23, ";", 1); - VAL v24 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22)); - VAL v25 = (mw_mirth_c99_ZPlusC99_line(v24)); - VTUP(x3)->cells[1] = v25; - VAL v26 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x3, v11)); - x7 = v26; + mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp10(x1, x3, v5, &v8, &v9); + VAL v10 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v8, v9); + x7 = v10; } break; case 2LL: { // C99AAS_Resource - VAL v27 = (VVAL(VTUP(x3)->cells[1])); - VAL v28; - VAL v29; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v27, &v28, &v29); - VAL v30 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v5, v28)); - VAL v31 = (mw_mirth_c99_ZPlusC99_indent(v29)); - int64_t v32 = VI64(VTUP(v30)->cells[1]); - VAL v33 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v32); - VAL v34 = (mw_mirth_c99_ZPlusC99_put(v33, v31)); - STR* v35; - STRLIT(v35, " ", 1); - VAL v36 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v35), v34)); - VAL v37 = VVAL(VTUP(v30)->cells[2]); - incref(v37); - VAL v38 = (mw_mirth_c99_ZPlusC99_put(v37, v36)); - STR* v39; - STRLIT(v39, " = (", 4); - VAL v40 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v39), v38)); - VAL v41 = (mw_mirth_c99_ZPlusC99_put(x1, v40)); - STR* v42; - STRLIT(v42, ");", 2); - VAL v43 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v42), v41)); - VAL v44 = (mw_mirth_c99_ZPlusC99_line(v43)); - VTUP(x3)->cells[1] = v44; - VAL v45 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(x3, v30)); - x7 = v45; + VAL v11 = VVAL(VTUP(x3)->cells[1]); + VAL v12; + VAL v13; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v11, &v12, &v13); + VTUP(x3)->cells[1] = v13; + int64_t v14 = VI64(VTUP(x3)->cells[3]); + VAL v15 = VVAL(VTUP(x3)->cells[1]); + int64_t v16 = VI64(VTUP(v15)->cells[4]); + VTUP(v15)->cells[4] = MKI64(v14); + VAL v17 = mw_mirth_c99_ZPlusC99_indent(v15); + VAL v18 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v5); + VAL v19 = mw_mirth_c99_ZPlusC99_put(v18, v17); + STR* v20; + STRLIT(v20, " ", 1); + VAL v21 = mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19); + incref(v12); + VAL v22 = mw_mirth_c99_ZPlusC99_put(v12, v21); + STR* v23; + STRLIT(v23, " = ", 3); + VAL v24 = mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22); + VAL v25 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v5, v12); + VAL v26 = mw_mirth_c99_ZPlusC99_put(x1, v24); + STR* v27; + STRLIT(v27, ";", 1); + VAL v28 = mw_mirth_c99_ZPlusC99_put(MKSTR(v27), v26); + VAL v29 = mw_mirth_c99_ZPlusC99_line(v28); + VTUP(v29)->cells[4] = MKI64(v16); + VTUP(x3)->cells[1] = v29; + VAL v30 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(x3, v25); + x7 = v30; } break; case 1LL: { // C99AAS_ValueLabel - uint64_t v46 = mtp_mirth_c99_C99APIArgSource_C99AASz_ValueLabel(v4); - VAL v47 = (VVAL(VTUP(x3)->cells[1])); - VAL v48; - VAL v49; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v47, &v48, &v49); - VAL v50 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v5, v48)); - VAL v51 = (mw_mirth_c99_ZPlusC99_indent(v49)); - int64_t v52 = VI64(VTUP(v50)->cells[1]); - VAL v53 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v52); - VAL v54 = (mw_mirth_c99_ZPlusC99_put(v53, v51)); - STR* v55; - STRLIT(v55, " ", 1); - VAL v56 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v55), v54)); - VAL v57 = VVAL(VTUP(v50)->cells[2]); - incref(v57); - VAL v58 = (mw_mirth_c99_ZPlusC99_put(v57, v56)); - STR* v59; - STRLIT(v59, " = ", 3); - VAL v60 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v59), v58)); - VAL v61 = (mw_mirth_c99_ZPlusC99_put(x1, v60)); - STR* v62; - STRLIT(v62, ";", 1); - VAL v63 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v62), v61)); - VAL v64 = (mw_mirth_c99_ZPlusC99_line(v63)); - VTUP(x3)->cells[1] = v64; - int64_t v65 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(v46); - VAL x66; - if (((bool)v65)) { - VAL v67 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v50)); - VAL v68 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v46, x3, v67)); - x66 = v68; - } else { - VAL v69 = (mw_mirth_c99_pushZ_localZ_labelZBang(v46, x3, v50)); - x66 = v69; - } - x7 = x66; + uint64_t v31 = mtp_mirth_c99_C99APIArgSource_C99AASz_ValueLabel(v4); + VAL v32 = mw_mirth_c99_pushZ_labelZ_expressionZBang_1_sp1(x1, v5, x3, v31); + x7 = v32; } break; case 3LL: { // C99AAS_ResourceLabel - uint64_t v70 = mtp_mirth_c99_C99APIArgSource_C99AASz_ResourceLabel(v4); - VAL v71 = (VVAL(VTUP(x3)->cells[1])); - VAL v72; - VAL v73; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v71, &v72, &v73); - VAL v74 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v5, v72)); - VAL v75 = (mw_mirth_c99_ZPlusC99_indent(v73)); - int64_t v76 = VI64(VTUP(v74)->cells[1]); - VAL v77 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v76); - VAL v78 = (mw_mirth_c99_ZPlusC99_put(v77, v75)); - STR* v79; - STRLIT(v79, " ", 1); - VAL v80 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v79), v78)); - VAL v81 = VVAL(VTUP(v74)->cells[2]); - incref(v81); - VAL v82 = (mw_mirth_c99_ZPlusC99_put(v81, v80)); - STR* v83; - STRLIT(v83, " = ", 3); - VAL v84 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v83), v82)); - VAL v85 = (mw_mirth_c99_ZPlusC99_put(x1, v84)); - STR* v86; - STRLIT(v86, ";", 1); - VAL v87 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v86), v85)); - VAL v88 = (mw_mirth_c99_ZPlusC99_line(v87)); - VTUP(x3)->cells[1] = v88; - int64_t v89 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(v70); - VAL x90; - if (((bool)v89)) { - VAL v91 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v74)); - VAL v92 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v70, x3, v91)); - x90 = v92; - } else { - VAL v93 = (mw_mirth_c99_pushZ_localZ_labelZBang(v70, x3, v74)); - x90 = v93; - } - x7 = x90; + uint64_t v33 = mtp_mirth_c99_C99APIArgSource_C99AASz_ResourceLabel(v4); + VAL v34 = mw_mirth_c99_pushZ_labelZ_expressionZBang_1_sp1(x1, v5, x3, v33); + x7 = v34; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -74039,32 +53308,32 @@ static VAL mw_mirth_c99_C99APIArg_pushZ_toZBang (VAL x1, VAL x2, VAL x3) { } return x7; } -static VAL mw_mirth_c99_C99APIArg_pushZ_asZ_localZBang (VAL x1, VAL x2) { +static VAL mw_mirth_c99_C99APIArg_pushZ_apiZ_argZBang (VAL x1, VAL x2) { VAL v3; int64_t v4; VAL v5; mtp_mirth_c99_C99APIArg_C99APIArg(x1, &v3, &v4, &v5); - VAL v6 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v4, v5)); + VAL v6 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v4, v5); VAL x7; switch (get_data_tag(v3)) { case 0LL: { // C99AAS_Value - VAL v8 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x2, v6)); + VAL v8 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x2, v6); x7 = v8; } break; case 1LL: { // C99AAS_ValueLabel uint64_t v9 = mtp_mirth_c99_C99APIArgSource_C99AASz_ValueLabel(v3); - VAL v10 = (mw_mirth_c99_pushZ_localZ_labelZBang(v9, x2, v6)); + VAL v10 = mw_mirth_c99_pushZ_valueZ_labelZBang(v9, x2, v6); x7 = v10; } break; case 2LL: { // C99AAS_Resource - VAL v11 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v6)); - VAL v12 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(x2, v11)); + VAL v11 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v6); + VAL v12 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(x2, v11); x7 = v12; } break; case 3LL: { // C99AAS_ResourceLabel uint64_t v13 = mtp_mirth_c99_C99APIArgSource_C99AASz_ResourceLabel(v3); - VAL v14 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v6)); - VAL v15 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v13, x2, v14)); + VAL v14 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v6); + VAL v15 = mw_mirth_c99_pushZ_resourceZ_labelZBang(v13, x2, v14); x7 = v15; } break; default: { @@ -74102,16 +53371,16 @@ static void mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_paramsZ_aux (VAL x1 case 4LL: { // STMeta uint64_t v15 = mtp_mirth_type_StackType_STMeta(x1); VAL v16 = mw_mirth_type_MetaVar_typeZAsk(v15); - int64_t x17; - VAL x18; + VAL x17; + int64_t x18; VAL x19; switch (get_data_tag(v16)) { case 0LL: { // None int64_t v20 = 1LL /* True */; VAL v21 = MKI64(0LL /* Nil */); - x19 = x2; - x18 = v21; - x17 = v20; + x19 = v21; + x18 = v20; + x17 = x2; } break; case 1LL: { // Some VAL v22 = mtp_std_maybe_Maybe_1_Some(v16); @@ -74125,17 +53394,17 @@ static void mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_paramsZ_aux (VAL x1 VAL v28; VAL v29; mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_paramsZ_aux(v26, x2, &v27, &v28, &v29); - x19 = v29; - x18 = v28; - x17 = v27; + x19 = v28; + x18 = v27; + x17 = v29; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x8 = x19; - x7 = x18; - x6 = x17; + x8 = x17; + x7 = x19; + x6 = x18; } break; case 3LL: { // STVar uint64_t v30 = mtp_mirth_type_StackType_STVar(x1); @@ -74150,11 +53419,11 @@ static void mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_paramsZ_aux (VAL x1 VAL v34; mtp_mirth_type_StackType_STCons(x1, &v33, &v34); VAL v35 = MKI64(0LL /* C99AAS_Value */); - VAL v36 = (VVAL(VTUP(x2)->cells[6])); + VAL v36 = VVAL(VTUP(x2)->cells[7]); int64_t v37; VAL v38; mw_mirth_type_Type_c99Z_repr(v34, v36, &v37, &v38); - VTUP(x2)->cells[6] = v38; + VTUP(x2)->cells[7] = v38; int64_t v39; VAL v40; VAL v41; @@ -74173,11 +53442,11 @@ static void mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_paramsZ_aux (VAL x1 VAL v47; mtp_mirth_type_StackType_STWith(x1, &v46, &v47); VAL v48 = MKI64(2LL /* C99AAS_Resource */); - VAL v49 = (VVAL(VTUP(x2)->cells[6])); + VAL v49 = VVAL(VTUP(x2)->cells[7]); int64_t v50; VAL v51; mw_mirth_type_Resource_c99Z_repr(v47, v49, &v50, &v51); - VTUP(x2)->cells[6] = v51; + VTUP(x2)->cells[7] = v51; int64_t v52; VAL v53; VAL v54; @@ -74197,11 +53466,11 @@ static void mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_paramsZ_aux (VAL x1 uint64_t v61; mtp_mirth_type_StackType_STConsLabel(x1, &v59, &v60, &v61); VAL v62 = mtw_mirth_c99_C99APIArgSource_C99AASz_ValueLabel(v61); - VAL v63 = (VVAL(VTUP(x2)->cells[6])); + VAL v63 = VVAL(VTUP(x2)->cells[7]); int64_t v64; VAL v65; mw_mirth_type_Type_c99Z_repr(v60, v63, &v64, &v65); - VTUP(x2)->cells[6] = v65; + VTUP(x2)->cells[7] = v65; int64_t v66; VAL v67; VAL v68; @@ -74221,11 +53490,11 @@ static void mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_paramsZ_aux (VAL x1 uint64_t v75; mtp_mirth_type_StackType_STWithLabel(x1, &v73, &v74, &v75); VAL v76 = mtw_mirth_c99_C99APIArgSource_C99AASz_ResourceLabel(v75); - VAL v77 = (VVAL(VTUP(x2)->cells[6])); + VAL v77 = VVAL(VTUP(x2)->cells[7]); int64_t v78; VAL v79; mw_mirth_type_Resource_c99Z_repr(v74, v77, &v78, &v79); - VTUP(x2)->cells[6] = v79; + VTUP(x2)->cells[7] = v79; int64_t v80; VAL v81; VAL v82; @@ -74276,58 +53545,77 @@ static void mw_mirth_c99_ZPlusC99_cnameZ_typeZ_toZ_c99Z_api (VAL x1, VAL x2, VAL incref(v14); VAL v16 = mw_std_list_List_1_ZDivL1(v14); incref(v16); - VAL x17; - int64_t x18; - VAL x19; + int64_t v17 = get_data_tag(v16); + decref(v16); + int64_t v18 = 1LL; + bool v19 = (v17 == v18); VAL x20; - int64_t x21; - VAL x22; - VAL x23; - VAL x24; - switch (get_data_tag(v16)) { + if (v19) { + decref(v14); + VAL v21 = MKI64(0LL /* Nil */); + x20 = v21; + } else { + x20 = v14; + } + int64_t v22 = VI64(VTUP(v15)->cells[3]); + VTUP(v15)->cells[3] = MKI64(v7); + bool v23 = (((bool)v13) || ((bool)v9)); + incref(x2); + VAL v24 = mw_mirth_type_ArrowType_cod(x2); + VAL v25 = mw_mirth_type_StackType_linearZ_baseZ_varZAsk(v24); + VAL x26; + int64_t x27; + switch (get_data_tag(v25)) { case 1LL: { // Some - VAL v25 = mtp_std_maybe_Maybe_1_Some(v16); - decref(v25); - decref(v14); - VAL v26 = MKI64(0LL /* Nil */); - x24 = v16; - x23 = v26; - x22 = v15; - x21 = v13; - x20 = x2; - x19 = v10; - x18 = v9; - x17 = x1; + VAL v28 = mtp_std_maybe_Maybe_1_Some(v25); + incref(x2); + VAL v29 = mw_mirth_type_ArrowType_dom(x2); + VAL v30 = mw_mirth_type_StackType_linearZ_baseZ_varZAsk(v29); + int64_t x31; + switch (get_data_tag(v30)) { + case 1LL: { // Some + VAL v32 = mtp_std_maybe_Maybe_1_Some(v30); + int64_t v33 = mw_mirth_var_Var_index(VU64(v28)); + int64_t v34 = mw_mirth_var_Var_index(VU64(v32)); + bool v35 = (v33 == v34); + bool v36 = !v35; + x31 = ((int64_t)v36); + } break; + case 0LL: { // None + decref(v28); + int64_t v37 = 0LL /* False */; + x31 = v37; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + x27 = x31; + x26 = x2; } break; case 0LL: { // None - x24 = v16; - x23 = v14; - x22 = v15; - x21 = v13; - x20 = x2; - x19 = v10; - x18 = v9; - x17 = x1; + int64_t v38 = 0LL /* False */; + x27 = v38; + x26 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v27 = VI64(VTUP(x22)->cells[3]); - VTUP(x22)->cells[3] = MKI64(v7); - bool v28 = (((bool)x18) || ((bool)x21)); - VAL v29 = mtw_mirth_c99_C99API_C99API(x17, x20, x19, x23, x24, ((int64_t)v28)); - *x5 = x22; - *x4 = v29; + bool v39 = !((bool)x27); + bool v40 = (v39 && v23); + VAL v41 = mtw_mirth_c99_C99API_C99API(x1, x26, v10, x20, v16, ((int64_t)v40), x27); + *x5 = v15; + *x4 = v41; } -static void mw_mirth_c99_C99APIArg_reserveZ_asZ_newZ_localZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { +static void mw_mirth_c99_C99APIArg_reserveZ_asZ_newZ_valueZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { incref(x1); int64_t v5 = VI64(VTUP(x1)->cells[2]); decref(x1); VAL v6; VAL v7; - mw_mirth_c99_C99ReprType_newZ_localZBang(v5, x2, &v6, &v7); - VAL v8 = mw_mirth_c99_ZPlusC99Local_consume(v7); + mw_mirth_c99_C99ReprType_newZ_valueZBang(v5, x2, &v6, &v7); + VAL v8 = mw_mirth_c99_ZPlusC99Value_consume(v7); VAL v9 = tup_replace(x1, 3, v8); *x4 = v6; *x3 = v9; @@ -74337,24 +53625,28 @@ static VAL mw_mirth_c99_C99APIArg_reserveZ_asZ_isZBang (VAL x1, VAL x2) { int64_t v4; VAL v5; mtp_mirth_c99_C99APIArg_C99APIArg(x1, &v3, &v4, &v5); - VAL v6 = (VVAL(VTUP(x2)->cells[1])); - VAL v7 = (mw_mirth_c99_ZPlusC99_indent(v6)); - VAL v8 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v4); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(v8, v7)); - STR* v10; - STRLIT(v10, " ", 1); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v10), v9)); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(v5, v11)); - STR* v13; - STRLIT(v13, ";", 1); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12)); - VAL v15 = (mw_mirth_c99_ZPlusC99_line(v14)); - VTUP(x2)->cells[1] = v15; + int64_t v6 = VI64(VTUP(x2)->cells[3]); + VAL v7 = VVAL(VTUP(x2)->cells[1]); + int64_t v8 = VI64(VTUP(v7)->cells[4]); + VTUP(v7)->cells[4] = MKI64(v6); + VAL v9 = mw_mirth_c99_ZPlusC99_indent(v7); + VAL v10 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v4); + VAL v11 = mw_mirth_c99_ZPlusC99_put(v10, v9); + STR* v12; + STRLIT(v12, " ", 1); + VAL v13 = mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11); + VAL v14 = mw_mirth_c99_ZPlusC99_put(v5, v13); + STR* v15; + STRLIT(v15, ";", 1); + VAL v16 = mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14); + VAL v17 = mw_mirth_c99_ZPlusC99_line(v16); + VTUP(v17)->cells[4] = MKI64(v8); + VTUP(x2)->cells[1] = v17; decref(v3); return x2; } static VAL mw_mirth_c99_c99Z_smartZ_callZBang (VAL x1, VAL x2, VAL x3) { - VAL v4 = (mw_mirth_c99_c99Z_argsZ_pushZBang(x1, x3)); + VAL v4 = mw_mirth_c99_c99Z_argsZ_pushZBang(x1, x3); incref(x2); VAL v5 = VVAL(VTUP(x2)->cells[3]); incref(v5); @@ -74362,860 +53654,500 @@ static VAL mw_mirth_c99_c99Z_smartZ_callZBang (VAL x1, VAL x2, VAL x3) { VAL v6 = mw_std_list_List_1_reverse(v5); VAL v7 = MKI64(0LL /* Nil */); VAL v8 = mw_std_list_List_1_reverse(v7); - VAL v9; - VAL v10; - mw_std_list_List_1_uncons(v6, &v9, &v10); - VAL x11; - VAL x12; - VAL x13; - VAL x14; - int64_t x15; - switch (get_data_tag(v9)) { - case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(v9); - VAL v17; - VAL v18; - mw_mirth_c99_C99APIArg_popZ_consumeZBang(v16, v4, &v17, &v18); - VAL v19 = mtw_std_list_List_1_Cons(v18, v8); - int64_t v20 = 1LL /* True */; - x15 = v20; - x14 = v10; - x13 = v19; - x12 = x2; - x11 = v17; - } break; - case 0LL: { // None - int64_t v21 = 0LL /* False */; - x15 = v21; - x14 = v10; - x13 = v8; - x12 = x2; - x11 = v4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v22 = (x11); - VAL v23 = x12; - VAL v24 = (x13); - VAL v25 = x14; - int64_t v26 = x15; - while (((bool)v26)) { - VAL v27 = (v22); - VAL v28 = v23; - VAL v29 = (v24); - VAL v30 = v25; - VAL v31; - VAL v32; - mw_std_list_List_1_uncons(v30, &v31, &v32); - VAL x33; - VAL x34; - VAL x35; - VAL x36; - int64_t x37; - switch (get_data_tag(v31)) { - case 1LL: { // Some - VAL v38 = mtp_std_maybe_Maybe_1_Some(v31); - VAL v39; - VAL v40; - mw_mirth_c99_C99APIArg_popZ_consumeZBang(v38, v27, &v39, &v40); - VAL v41 = mtw_std_list_List_1_Cons(v40, v29); - int64_t v42 = 1LL /* True */; - x37 = v42; - x36 = v32; - x35 = v41; - x34 = v28; - x33 = v39; + int64_t v9 = 1LL /* True */; + VAL v10 = v4; + VAL v11 = v8; + VAL v12 = v6; + int64_t v13 = v9; + int64_t v14 = v9; + while (((bool)v14)) { + VAL v15 = v10; + VAL v16 = v11; + VAL v17 = v12; + int64_t v18 = v13; + VAL x19; + VAL x20; + VAL x21; + int64_t x22; + switch (get_data_tag(v17)) { + case 1LL: { // Cons + VAL v23; + VAL v24; + mtp_std_list_List_1_Cons(v17, &v23, &v24); + VAL v25; + VAL v26; + mw_mirth_c99_C99APIArg_popZ_consumeZBang(v23, v15, &v25, &v26); + VAL v27 = mtw_std_list_List_1_Cons(v26, v16); + int64_t v28 = 1LL /* True */; + x22 = v28; + x21 = v24; + x20 = v27; + x19 = v25; } break; - case 0LL: { // None - int64_t v43 = 0LL /* False */; - x37 = v43; - x36 = v32; - x35 = v29; - x34 = v28; - x33 = v27; + case 0LL: { // Nil + VAL v29 = MKI64(0LL /* Nil */); + int64_t v30 = 0LL /* False */; + x22 = v30; + x21 = v29; + x20 = v16; + x19 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v26 = x37; - v25 = x36; - v24 = x35; - v23 = x34; - v22 = x33; + v14 = x22; + v13 = x22; + v12 = x21; + v11 = x20; + v10 = x19; } - decref(v25); - VAL v44 = mw_std_list_List_1_reverse(v24); - VAL v45 = mw_std_list_List_1_reverse(v44); - incref(v23); - int64_t v46 = VI64(VTUP(v23)->cells[6]); - decref(v23); - VAL x47; - VAL x48; - VAL x49; - if (((bool)v46)) { - VAL v50 = (mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(v22)); - x49 = v23; - x48 = v45; - x47 = v50; + decref(v12); + VAL v31 = mw_std_list_List_1_reverse(v11); + VAL v32 = mw_std_list_List_1_reverse(v31); + incref(x2); + int64_t v33 = VI64(VTUP(x2)->cells[6]); + decref(x2); + VAL x34; + if (((bool)v33)) { + VAL v35 = mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(v10); + x34 = v35; } else { - x49 = v23; - x48 = v45; - x47 = v22; - } - incref(x49); - VAL v51 = VVAL(VTUP(x49)->cells[4]); - incref(v51); - decref(x49); - VAL v52 = MKI64(0LL /* Nil */); - VAL v53 = mw_std_list_List_1_reverse(v52); - VAL v54; - VAL v55; - mw_std_list_List_1_uncons(v51, &v54, &v55); - VAL x56; - VAL x57; - VAL x58; - VAL x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v54)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v54); - VAL v63; - VAL v64; - mw_mirth_c99_C99APIArg_reserveZ_asZ_newZ_localZBang(v62, x47, &v63, &v64); - VAL v65 = mtw_std_list_List_1_Cons(v63, v53); - int64_t v66 = 1LL /* True */; - x61 = v66; - x60 = v55; - x59 = v65; - x58 = x49; - x57 = x48; - x56 = v64; - } break; - case 0LL: { // None - int64_t v67 = 0LL /* False */; - x61 = v67; - x60 = v55; - x59 = v53; - x58 = x49; - x57 = x48; - x56 = x47; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + x34 = v10; } - VAL v68 = (x56); - VAL v69 = x57; - VAL v70 = x58; - VAL v71 = (x59); - VAL v72 = x60; - int64_t v73 = x61; - while (((bool)v73)) { - VAL v74 = (v68); - VAL v75 = v69; - VAL v76 = v70; - VAL v77 = (v71); - VAL v78 = v72; - VAL v79; - VAL v80; - mw_std_list_List_1_uncons(v78, &v79, &v80); - VAL x81; - VAL x82; - VAL x83; - VAL x84; - VAL x85; - int64_t x86; - switch (get_data_tag(v79)) { - case 1LL: { // Some - VAL v87 = mtp_std_maybe_Maybe_1_Some(v79); - VAL v88; - VAL v89; - mw_mirth_c99_C99APIArg_reserveZ_asZ_newZ_localZBang(v87, v74, &v88, &v89); - VAL v90 = mtw_std_list_List_1_Cons(v88, v77); - int64_t v91 = 1LL /* True */; - x86 = v91; - x85 = v80; - x84 = v90; - x83 = v76; - x82 = v75; - x81 = v89; + incref(x2); + VAL v36 = VVAL(VTUP(x2)->cells[4]); + incref(v36); + decref(x2); + VAL v37 = MKI64(0LL /* Nil */); + VAL v38 = mw_std_list_List_1_reverse(v37); + int64_t v39 = 1LL /* True */; + VAL v40 = x34; + VAL v41 = v38; + VAL v42 = v36; + int64_t v43 = v39; + int64_t v44 = v39; + while (((bool)v44)) { + VAL v45 = v40; + VAL v46 = v41; + VAL v47 = v42; + int64_t v48 = v43; + VAL x49; + VAL x50; + VAL x51; + int64_t x52; + switch (get_data_tag(v47)) { + case 1LL: { // Cons + VAL v53; + VAL v54; + mtp_std_list_List_1_Cons(v47, &v53, &v54); + VAL v55; + VAL v56; + mw_mirth_c99_C99APIArg_reserveZ_asZ_newZ_valueZBang(v53, v45, &v55, &v56); + VAL v57 = mtw_std_list_List_1_Cons(v55, v46); + int64_t v58 = 1LL /* True */; + x52 = v58; + x51 = v54; + x50 = v57; + x49 = v56; } break; - case 0LL: { // None - int64_t v92 = 0LL /* False */; - x86 = v92; - x85 = v80; - x84 = v77; - x83 = v76; - x82 = v75; - x81 = v74; + case 0LL: { // Nil + VAL v59 = MKI64(0LL /* Nil */); + int64_t v60 = 0LL /* False */; + x52 = v60; + x51 = v59; + x50 = v46; + x49 = v45; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v73 = x86; - v72 = x85; - v71 = x84; - v70 = x83; - v69 = x82; - v68 = x81; - } - decref(v72); - VAL v93 = mw_std_list_List_1_reverse(v71); - STR* v94; - STRLIT(v94, "", 0); - incref(v70); - VAL v95 = VVAL(VTUP(v70)->cells[1]); - incref(v95); - decref(v70); - VAL v96 = (mw_std_str_ZPlusStr_pushZ_strZBang(v95, MKSTR(v94))); - STR* v97; - STRLIT(v97, "(", 1); - VAL v98 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v97), v96)); - STR* v99; - STRLIT(v99, "", 0); - VAL v100; - VAL v101; - mw_std_list_List_1_uncons(v69, &v100, &v101); - VAL x102; - VAL x103; - VAL x104; - VAL x105; - VAL x106; - VAL x107; - int64_t x108; - switch (get_data_tag(v100)) { - case 1LL: { // Some - VAL v109 = mtp_std_maybe_Maybe_1_Some(v100); - VAL v110 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v99), v98)); - STR* v111; - STRLIT(v111, ", ", 2); - VAL v112 = (mw_std_str_ZPlusStr_pushZ_strZBang(v109, v110)); - int64_t v113 = 1LL /* True */; - x108 = v113; - x107 = v101; - x106 = MKSTR(v111); - x105 = v112; - x104 = v70; - x103 = v93; - x102 = v68; - } break; - case 0LL: { // None - int64_t v114 = 0LL /* False */; - x108 = v114; - x107 = v101; - x106 = MKSTR(v99); - x105 = v98; - x104 = v70; - x103 = v93; - x102 = v68; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v44 = x52; + v43 = x52; + v42 = x51; + v41 = x50; + v40 = x49; } - VAL v115 = (x102); - VAL v116 = x103; - VAL v117 = x104; - VAL v118 = (x105); - VAL v119 = x106; - VAL v120 = x107; - int64_t v121 = x108; - while (((bool)v121)) { - VAL v122 = (v115); - VAL v123 = v116; - VAL v124 = v117; - VAL v125 = (v118); - VAL v126 = v119; - VAL v127 = v120; - VAL v128; - VAL v129; - mw_std_list_List_1_uncons(v127, &v128, &v129); - VAL x130; - VAL x131; - VAL x132; - VAL x133; - VAL x134; - VAL x135; - int64_t x136; - switch (get_data_tag(v128)) { - case 1LL: { // Some - VAL v137 = mtp_std_maybe_Maybe_1_Some(v128); - VAL v138 = (mw_std_str_ZPlusStr_pushZ_strZBang(v126, v125)); - STR* v139; - STRLIT(v139, ", ", 2); - VAL v140 = (mw_std_str_ZPlusStr_pushZ_strZBang(v137, v138)); - int64_t v141 = 1LL /* True */; - x136 = v141; - x135 = v129; - x134 = MKSTR(v139); - x133 = v140; - x132 = v124; - x131 = v123; - x130 = v122; + decref(v42); + VAL v61 = mw_std_list_List_1_reverse(v41); + STR* v62; + STRLIT(v62, "", 0); + incref(x2); + VAL v63 = VVAL(VTUP(x2)->cells[1]); + incref(v63); + decref(x2); + VAL v64 = mw_std_str_ZPlusStr_pushZ_strZBang(v63, MKSTR(v62)); + STR* v65; + STRLIT(v65, "(", 1); + VAL v66 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v65), v64); + STR* v67; + STRLIT(v67, "", 0); + int64_t v68 = 1LL /* True */; + VAL v69 = v66; + STR* v70 = v67; + VAL v71 = v32; + int64_t v72 = v68; + int64_t v73 = v68; + while (((bool)v73)) { + VAL v74 = v69; + STR* v75 = v70; + VAL v76 = v71; + int64_t v77 = v72; + VAL x78; + VAL x79; + VAL x80; + int64_t x81; + switch (get_data_tag(v76)) { + case 1LL: { // Cons + VAL v82; + VAL v83; + mtp_std_list_List_1_Cons(v76, &v82, &v83); + VAL v84 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v75), v74); + STR* v85; + STRLIT(v85, ", ", 2); + VAL v86 = mw_std_str_ZPlusStr_pushZ_strZBang(v82, v84); + int64_t v87 = 1LL /* True */; + x81 = v87; + x80 = v83; + x79 = v86; + x78 = MKSTR(v85); } break; - case 0LL: { // None - int64_t v142 = 0LL /* False */; - x136 = v142; - x135 = v129; - x134 = v126; - x133 = v125; - x132 = v124; - x131 = v123; - x130 = v122; + case 0LL: { // Nil + VAL v88 = MKI64(0LL /* Nil */); + int64_t v89 = 0LL /* False */; + x81 = v89; + x80 = v88; + x79 = v74; + x78 = MKSTR(v75); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v121 = x136; - v120 = x135; - v119 = x134; - v118 = x133; - v117 = x132; - v116 = x131; - v115 = x130; - } - decref(v120); - incref(v116); - VAL v143; - VAL v144; - mw_std_list_List_1_uncons(v116, &v143, &v144); - VAL x145; - VAL x146; - VAL x147; - VAL x148; - VAL x149; - VAL x150; - int64_t x151; - switch (get_data_tag(v143)) { - case 1LL: { // Some - VAL v152 = mtp_std_maybe_Maybe_1_Some(v143); - VAL v153 = (mw_std_str_ZPlusStr_pushZ_strZBang(v119, v118)); - STR* v154; - STRLIT(v154, ", ", 2); - STR* v155; - STRLIT(v155, "&", 1); - VAL v156 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v155), v153)); - VAL v157 = VVAL(VTUP(v152)->cells[3]); - incref(v157); - decref(v152); - VAL v158 = (mw_std_str_ZPlusStr_pushZ_strZBang(v157, v156)); - int64_t v159 = 1LL /* True */; - x151 = v159; - x150 = v144; - x149 = v116; - x148 = MKSTR(v154); - x147 = v158; - x146 = v117; - x145 = v115; - } break; - case 0LL: { // None - int64_t v160 = 0LL /* False */; - x151 = v160; - x150 = v144; - x149 = v116; - x148 = v119; - x147 = v118; - x146 = v117; - x145 = v115; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v73 = x81; + v72 = x81; + v71 = x80; + v70 = VSTR(x78); + v69 = x79; } - VAL v161 = (x145); - VAL v162 = x146; - VAL v163 = (x147); - VAL v164 = x148; - VAL v165 = x149; - VAL v166 = x150; - int64_t v167 = x151; - while (((bool)v167)) { - VAL v168 = (v161); - VAL v169 = v162; - VAL v170 = (v163); - VAL v171 = v164; - VAL v172 = v165; - VAL v173 = v166; - VAL v174; - VAL v175; - mw_std_list_List_1_uncons(v173, &v174, &v175); - VAL x176; - VAL x177; - VAL x178; - VAL x179; - VAL x180; - VAL x181; - int64_t x182; - switch (get_data_tag(v174)) { - case 1LL: { // Some - VAL v183 = mtp_std_maybe_Maybe_1_Some(v174); - VAL v184 = (mw_std_str_ZPlusStr_pushZ_strZBang(v171, v170)); - STR* v185; - STRLIT(v185, ", ", 2); - STR* v186; - STRLIT(v186, "&", 1); - VAL v187 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v186), v184)); - VAL v188 = VVAL(VTUP(v183)->cells[3]); - incref(v188); - decref(v183); - VAL v189 = (mw_std_str_ZPlusStr_pushZ_strZBang(v188, v187)); - int64_t v190 = 1LL /* True */; - x182 = v190; - x181 = v175; - x180 = v172; - x179 = MKSTR(v185); - x178 = v189; - x177 = v169; - x176 = v168; + decref(v71); + incref(v61); + int64_t v90 = 1LL /* True */; + VAL v91 = v69; + STR* v92 = v70; + VAL v93 = v61; + int64_t v94 = v90; + int64_t v95 = v90; + while (((bool)v95)) { + VAL v96 = v91; + STR* v97 = v92; + VAL v98 = v93; + int64_t v99 = v94; + VAL x100; + VAL x101; + VAL x102; + int64_t x103; + switch (get_data_tag(v98)) { + case 1LL: { // Cons + VAL v104; + VAL v105; + mtp_std_list_List_1_Cons(v98, &v104, &v105); + VAL v106 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v97), v96); + STR* v107; + STRLIT(v107, ", ", 2); + STR* v108; + STRLIT(v108, "&", 1); + VAL v109 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v108), v106); + VAL v110 = VVAL(VTUP(v104)->cells[3]); + incref(v110); + decref(v104); + VAL v111 = mw_std_str_ZPlusStr_pushZ_strZBang(v110, v109); + int64_t v112 = 1LL /* True */; + x103 = v112; + x102 = v105; + x101 = v111; + x100 = MKSTR(v107); } break; - case 0LL: { // None - int64_t v191 = 0LL /* False */; - x182 = v191; - x181 = v175; - x180 = v172; - x179 = v171; - x178 = v170; - x177 = v169; - x176 = v168; + case 0LL: { // Nil + VAL v113 = MKI64(0LL /* Nil */); + int64_t v114 = 0LL /* False */; + x103 = v114; + x102 = v113; + x101 = v96; + x100 = MKSTR(v97); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v167 = x182; - v166 = x181; - v165 = x180; - v164 = x179; - v163 = x178; - v162 = x177; - v161 = x176; - } - decref(v166); - decref(v164); - STR* v192; - STRLIT(v192, ")", 1); - VAL v193 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v192), v163)); - incref(v162); - VAL v194 = VVAL(VTUP(v162)->cells[5]); - incref(v194); - decref(v162); - VAL x195; - VAL x196; - VAL x197; - switch (get_data_tag(v194)) { - case 1LL: { // Some - VAL v198 = mtp_std_maybe_Maybe_1_Some(v194); - VAL v199 = (mw_mirth_c99_C99APIArg_pushZ_toZBang(v193, v198, v161)); - x197 = v199; - x196 = v162; - x195 = v165; - } break; - case 0LL: { // None - VAL v200 = (VVAL(VTUP(v161)->cells[1])); - VAL v201 = (mw_mirth_c99_ZPlusC99_indent(v200)); - VAL v202 = (mw_mirth_c99_ZPlusC99_put(v193, v201)); - STR* v203; - STRLIT(v203, ";", 1); - VAL v204 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v203), v202)); - VAL v205 = (mw_mirth_c99_ZPlusC99_line(v204)); - VTUP(v161)->cells[1] = v205; - x197 = v161; - x196 = v162; - x195 = v165; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v95 = x103; + v94 = x103; + v93 = x102; + v92 = VSTR(x100); + v91 = x101; } - VAL v206; - VAL v207; - mw_std_list_List_1_uncons(x195, &v206, &v207); - VAL x208; - VAL x209; - VAL x210; - int64_t x211; - switch (get_data_tag(v206)) { + decref(v93); + decref(MKSTR(v92)); + STR* v115; + STRLIT(v115, ")", 1); + VAL v116 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v115), v91); + incref(x2); + VAL v117 = VVAL(VTUP(x2)->cells[5]); + incref(v117); + decref(x2); + VAL x118; + VAL x119; + switch (get_data_tag(v117)) { case 1LL: { // Some - VAL v212 = mtp_std_maybe_Maybe_1_Some(v206); - VAL v213 = (mw_mirth_c99_C99APIArg_pushZ_asZ_localZBang(v212, x197)); - int64_t v214 = 1LL /* True */; - x211 = v214; - x210 = v207; - x209 = v213; - x208 = x196; + VAL v120 = mtp_std_maybe_Maybe_1_Some(v117); + incref(x2); + int64_t v121 = VI64(VTUP(x2)->cells[7]); + decref(x2); + VAL x122; + VAL x123; + if (((bool)v121)) { + VAL v124 = mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp22(v116, v40); + int64_t v125 = 0LL /* False */; + VTUP(v124)->cells[3] = MKI64(v125); + STR* v126; + STRLIT(v126, "", 0); + VAL v127 = mw_mirth_c99_C99APIArg_pushZ_toZBang(MKSTR(v126), v120, v124); + x123 = v127; + x122 = x2; + } else { + VAL v128 = mw_mirth_c99_C99APIArg_pushZ_toZBang(v116, v120, v40); + x123 = v128; + x122 = x2; + } + x119 = x123; + x118 = x122; } break; case 0LL: { // None - int64_t v215 = 0LL /* False */; - x211 = v215; - x210 = v207; - x209 = x197; - x208 = x196; + VAL v129 = mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp22(v116, v40); + x119 = v129; + x118 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v216 = x208; - VAL v217 = (x209); - VAL v218 = x210; - int64_t v219 = x211; - while (((bool)v219)) { - VAL v220 = v216; - VAL v221 = (v217); - VAL v222 = v218; - VAL v223; - VAL v224; - mw_std_list_List_1_uncons(v222, &v223, &v224); - VAL x225; - VAL x226; - VAL x227; - int64_t x228; - switch (get_data_tag(v223)) { - case 1LL: { // Some - VAL v229 = mtp_std_maybe_Maybe_1_Some(v223); - VAL v230 = (mw_mirth_c99_C99APIArg_pushZ_asZ_localZBang(v229, v221)); - int64_t v231 = 1LL /* True */; - x228 = v231; - x227 = v224; - x226 = v230; - x225 = v220; - } break; - case 0LL: { // None - int64_t v232 = 0LL /* False */; - x228 = v232; - x227 = v224; - x226 = v221; - x225 = v220; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v219 = x228; - v218 = x227; - v217 = x226; - v216 = x225; - } - decref(v218); - decref(v216); - return v217; + incref(x118); + int64_t v130 = VI64(VTUP(x118)->cells[7]); + decref(x118); + bool v131 = !((bool)v130); + int64_t v132 = VI64(VTUP(x119)->cells[3]); + bool v133 = (v131 && ((bool)v132)); + VTUP(x119)->cells[3] = MKBOOL(v133); + VAL v134 = mw_std_list_List_1_for_1_sp17(x119, v61); + decref(x118); + return v134; } static VAL mw_mirth_c99_ZPlusC99_smartZ_sigZ_put (VAL x1, VAL x2) { STR* v3; STRLIT(v3, "static ", 7); - VAL v4 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2)); + VAL v4 = mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2); incref(x1); VAL v5 = VVAL(VTUP(x1)->cells[5]); incref(v5); decref(x1); - VAL x6; + incref(x1); + int64_t v6 = VI64(VTUP(x1)->cells[7]); + decref(x1); VAL x7; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v5); - int64_t v9 = VI64(VTUP(v8)->cells[2]); - decref(v8); - VAL v10 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v9); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(v10, v4)); - x7 = v11; - x6 = x1; - } break; - case 0LL: { // None - STR* v12; - STRLIT(v12, "void", 4); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v4)); - x7 = v13; - x6 = x1; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + if (((bool)v6)) { + decref(v5); + VAL v8 = MKI64(0LL /* None */); + x7 = v8; + } else { + x7 = v5; } - STR* v14; - STRLIT(v14, " ", 1); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v14), x7)); - incref(x6); - VAL v16 = VVAL(VTUP(x6)->cells[1]); - incref(v16); - decref(x6); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(v16, v15)); - STR* v18; - STRLIT(v18, " (", 2); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17)); - STR* v20; - STRLIT(v20, "", 0); - incref(x6); - VAL v21 = VVAL(VTUP(x6)->cells[3]); - incref(v21); - decref(x6); - VAL v22; - VAL v23; - mw_std_list_List_1_uncons(v21, &v22, &v23); - VAL x24; - VAL x25; - VAL x26; - VAL x27; - int64_t x28; - switch (get_data_tag(v22)) { + VAL x9; + switch (get_data_tag(x7)) { case 1LL: { // Some - VAL v29 = mtp_std_maybe_Maybe_1_Some(v22); - VAL v30 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19)); - STR* v31; - STRLIT(v31, ", ", 2); - incref(v29); - int64_t v32 = VI64(VTUP(v29)->cells[2]); - decref(v29); - VAL v33 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v32); - VAL v34 = (mw_mirth_c99_ZPlusC99_put(v33, v30)); - STR* v35; - STRLIT(v35, " ", 1); - VAL v36 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v35), v34)); - VAL v37 = VVAL(VTUP(v29)->cells[3]); - incref(v37); - decref(v29); - VAL v38 = (mw_mirth_c99_ZPlusC99_put(v37, v36)); - int64_t v39 = 1LL /* True */; - x28 = v39; - x27 = v23; - x26 = x6; - x25 = MKSTR(v31); - x24 = v38; + VAL v10 = mtp_std_maybe_Maybe_1_Some(x7); + int64_t v11 = VI64(VTUP(v10)->cells[2]); + decref(v10); + VAL v12 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v11); + VAL v13 = mw_mirth_c99_ZPlusC99_put(v12, v4); + x9 = v13; } break; case 0LL: { // None - int64_t v40 = 0LL /* False */; - x28 = v40; - x27 = v23; - x26 = x6; - x25 = MKSTR(v20); - x24 = v19; + STR* v14; + STRLIT(v14, "void", 4); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v4); + x9 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v41 = (x24); - VAL v42 = x25; - VAL v43 = x26; - VAL v44 = x27; - int64_t v45 = x28; - while (((bool)v45)) { - VAL v46 = (v41); - VAL v47 = v42; - VAL v48 = v43; - VAL v49 = v44; - VAL v50; - VAL v51; - mw_std_list_List_1_uncons(v49, &v50, &v51); - VAL x52; - VAL x53; - VAL x54; - VAL x55; - int64_t x56; - switch (get_data_tag(v50)) { - case 1LL: { // Some - VAL v57 = mtp_std_maybe_Maybe_1_Some(v50); - VAL v58 = (mw_mirth_c99_ZPlusC99_put(v47, v46)); - STR* v59; - STRLIT(v59, ", ", 2); - incref(v57); - int64_t v60 = VI64(VTUP(v57)->cells[2]); - decref(v57); - VAL v61 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v60); - VAL v62 = (mw_mirth_c99_ZPlusC99_put(v61, v58)); - STR* v63; - STRLIT(v63, " ", 1); - VAL v64 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v63), v62)); - VAL v65 = VVAL(VTUP(v57)->cells[3]); - incref(v65); - decref(v57); - VAL v66 = (mw_mirth_c99_ZPlusC99_put(v65, v64)); - int64_t v67 = 1LL /* True */; - x56 = v67; - x55 = v51; - x54 = v48; - x53 = MKSTR(v59); - x52 = v66; + STR* v16; + STRLIT(v16, " ", 1); + VAL v17 = mw_mirth_c99_ZPlusC99_put(MKSTR(v16), x9); + incref(x1); + VAL v18 = VVAL(VTUP(x1)->cells[1]); + incref(v18); + decref(x1); + VAL v19 = mw_mirth_c99_ZPlusC99_put(v18, v17); + STR* v20; + STRLIT(v20, " (", 2); + VAL v21 = mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19); + STR* v22; + STRLIT(v22, "", 0); + incref(x1); + VAL v23 = VVAL(VTUP(x1)->cells[3]); + incref(v23); + decref(x1); + int64_t v24 = 1LL /* True */; + VAL v25 = v21; + STR* v26 = v22; + VAL v27 = v23; + int64_t v28 = v24; + int64_t v29 = v24; + while (((bool)v29)) { + VAL v30 = v25; + STR* v31 = v26; + VAL v32 = v27; + int64_t v33 = v28; + VAL x34; + VAL x35; + VAL x36; + int64_t x37; + switch (get_data_tag(v32)) { + case 1LL: { // Cons + VAL v38; + VAL v39; + mtp_std_list_List_1_Cons(v32, &v38, &v39); + VAL v40 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + STR* v41; + STRLIT(v41, ", ", 2); + incref(v38); + int64_t v42 = VI64(VTUP(v38)->cells[2]); + decref(v38); + VAL v43 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v42); + VAL v44 = mw_mirth_c99_ZPlusC99_put(v43, v40); + STR* v45; + STRLIT(v45, " ", 1); + VAL v46 = mw_mirth_c99_ZPlusC99_put(MKSTR(v45), v44); + VAL v47 = VVAL(VTUP(v38)->cells[3]); + incref(v47); + decref(v38); + VAL v48 = mw_mirth_c99_ZPlusC99_put(v47, v46); + int64_t v49 = 1LL /* True */; + x37 = v49; + x36 = v39; + x35 = v48; + x34 = MKSTR(v41); } break; - case 0LL: { // None - int64_t v68 = 0LL /* False */; - x56 = v68; - x55 = v51; - x54 = v48; - x53 = v47; - x52 = v46; + case 0LL: { // Nil + VAL v50 = MKI64(0LL /* Nil */); + int64_t v51 = 0LL /* False */; + x37 = v51; + x36 = v50; + x35 = v30; + x34 = MKSTR(v31); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v45 = x56; - v44 = x55; - v43 = x54; - v42 = x53; - v41 = x52; - } - decref(v44); - incref(v43); - VAL v69 = VVAL(VTUP(v43)->cells[4]); - incref(v69); - decref(v43); - VAL v70; - VAL v71; - mw_std_list_List_1_uncons(v69, &v70, &v71); - VAL x72; - VAL x73; - VAL x74; - VAL x75; - int64_t x76; - switch (get_data_tag(v70)) { - case 1LL: { // Some - VAL v77 = mtp_std_maybe_Maybe_1_Some(v70); - VAL v78 = (mw_mirth_c99_ZPlusC99_put(v42, v41)); - STR* v79; - STRLIT(v79, ", ", 2); - incref(v77); - int64_t v80 = VI64(VTUP(v77)->cells[2]); - decref(v77); - VAL v81 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v80); - VAL v82 = (mw_mirth_c99_ZPlusC99_put(v81, v78)); - STR* v83; - STRLIT(v83, " *", 2); - VAL v84 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v83), v82)); - VAL v85 = VVAL(VTUP(v77)->cells[3]); - incref(v85); - decref(v77); - VAL v86 = (mw_mirth_c99_ZPlusC99_put(v85, v84)); - int64_t v87 = 1LL /* True */; - x76 = v87; - x75 = v71; - x74 = v43; - x73 = MKSTR(v79); - x72 = v86; - } break; - case 0LL: { // None - int64_t v88 = 0LL /* False */; - x76 = v88; - x75 = v71; - x74 = v43; - x73 = v42; - x72 = v41; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v29 = x37; + v28 = x37; + v27 = x36; + v26 = VSTR(x34); + v25 = x35; } - VAL v89 = (x72); - VAL v90 = x73; - VAL v91 = x74; - VAL v92 = x75; - int64_t v93 = x76; - while (((bool)v93)) { - VAL v94 = (v89); - VAL v95 = v90; - VAL v96 = v91; - VAL v97 = v92; - VAL v98; - VAL v99; - mw_std_list_List_1_uncons(v97, &v98, &v99); - VAL x100; - VAL x101; - VAL x102; - VAL x103; - int64_t x104; - switch (get_data_tag(v98)) { - case 1LL: { // Some - VAL v105 = mtp_std_maybe_Maybe_1_Some(v98); - VAL v106 = (mw_mirth_c99_ZPlusC99_put(v95, v94)); - STR* v107; - STRLIT(v107, ", ", 2); - incref(v105); - int64_t v108 = VI64(VTUP(v105)->cells[2]); - decref(v105); - VAL v109 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v108); - VAL v110 = (mw_mirth_c99_ZPlusC99_put(v109, v106)); - STR* v111; - STRLIT(v111, " *", 2); - VAL v112 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v111), v110)); - VAL v113 = VVAL(VTUP(v105)->cells[3]); - incref(v113); - decref(v105); - VAL v114 = (mw_mirth_c99_ZPlusC99_put(v113, v112)); - int64_t v115 = 1LL /* True */; - x104 = v115; - x103 = v99; - x102 = v96; - x101 = MKSTR(v107); - x100 = v114; + decref(v27); + incref(x1); + VAL v52 = VVAL(VTUP(x1)->cells[4]); + incref(v52); + decref(x1); + int64_t v53 = 1LL /* True */; + VAL v54 = v25; + STR* v55 = v26; + VAL v56 = v52; + int64_t v57 = v53; + int64_t v58 = v53; + while (((bool)v58)) { + VAL v59 = v54; + STR* v60 = v55; + VAL v61 = v56; + int64_t v62 = v57; + VAL x63; + VAL x64; + VAL x65; + int64_t x66; + switch (get_data_tag(v61)) { + case 1LL: { // Cons + VAL v67; + VAL v68; + mtp_std_list_List_1_Cons(v61, &v67, &v68); + VAL v69 = mw_mirth_c99_ZPlusC99_put(MKSTR(v60), v59); + STR* v70; + STRLIT(v70, ", ", 2); + incref(v67); + int64_t v71 = VI64(VTUP(v67)->cells[2]); + decref(v67); + VAL v72 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v71); + VAL v73 = mw_mirth_c99_ZPlusC99_put(v72, v69); + STR* v74; + STRLIT(v74, " *", 2); + VAL v75 = mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v73); + VAL v76 = VVAL(VTUP(v67)->cells[3]); + incref(v76); + decref(v67); + VAL v77 = mw_mirth_c99_ZPlusC99_put(v76, v75); + int64_t v78 = 1LL /* True */; + x66 = v78; + x65 = v68; + x64 = v77; + x63 = MKSTR(v70); } break; - case 0LL: { // None - int64_t v116 = 0LL /* False */; - x104 = v116; - x103 = v99; - x102 = v96; - x101 = v95; - x100 = v94; + case 0LL: { // Nil + VAL v79 = MKI64(0LL /* Nil */); + int64_t v80 = 0LL /* False */; + x66 = v80; + x65 = v79; + x64 = v59; + x63 = MKSTR(v60); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v93 = x104; - v92 = x103; - v91 = x102; - v90 = x101; - v89 = x100; + v58 = x66; + v57 = x66; + v56 = x65; + v55 = VSTR(x63); + v54 = x64; } - decref(v92); - uint64_t v117 = str_size(VSTR(v90)); - int64_t v118 = 0LL; - bool v119 = (((int64_t)v117) < v118); - int64_t x120; - if (v119) { - x120 = v118; - push_resource(v89); - lpush(&lbl_api, v91); - } else { - x120 = ((int64_t)v117); - push_resource(v89); - lpush(&lbl_api, v91); - } - int64_t v121 = 0LL; - bool v122 = (x120 == v121); - VAL x123; - VAL x124; - if (v122) { - STR* v125; - STRLIT(v125, "void", 4); - VAL r126 = pop_resource(); - VAL v127 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v125), r126)); - VAL v128 = lpop(&lbl_api); - x124 = v128; - x123 = v127; + decref(v56); + uint64_t v81 = str_size(v55); + int64_t v82 = 0LL; + bool v83 = (((int64_t)v81) == v82); + VAL x84; + if (v83) { + STR* v85; + STRLIT(v85, "void", 4); + VAL v86 = mw_mirth_c99_ZPlusC99_put(MKSTR(v85), v54); + x84 = v86; } else { - VAL v129 = lpop(&lbl_api); - x124 = v129; - VAL r130 = pop_resource(); - x123 = r130; + x84 = v54; } - STR* v131; - STRLIT(v131, ")", 1); - VAL v132 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v131), x123)); - decref(x124); - return v132; + STR* v87; + STRLIT(v87, ")", 1); + VAL v88 = mw_mirth_c99_ZPlusC99_put(MKSTR(v87), x84); + decref(x1); + return v88; } static VAL mw_mirth_c99_c99Z_smartZ_sigZBang (VAL x1, VAL x2) { - VAL v3 = (mw_mirth_c99_ZPlusC99_indent(x2)); - VAL v4 = (mw_mirth_c99_ZPlusC99_smartZ_sigZ_put(x1, v3)); + VAL v3 = mw_mirth_c99_ZPlusC99_indent(x2); + VAL v4 = mw_mirth_c99_ZPlusC99_smartZ_sigZ_put(x1, v3); STR* v5; STRLIT(v5, ";", 1); - VAL v6 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v5), v4)); - VAL v7 = (mw_mirth_c99_ZPlusC99_line(v6)); + VAL v6 = mw_mirth_c99_ZPlusC99_put(MKSTR(v5), v4); + VAL v7 = mw_mirth_c99_ZPlusC99_line(v6); return v7; } static VAL mw_mirth_c99_c99Z_apiZ_enterZBang (VAL x1, VAL x2) { @@ -75233,420 +54165,562 @@ static VAL mw_mirth_c99_c99Z_apiZ_enterZBang (VAL x1, VAL x2) { int64_t v8 = 1LL; int64_t v9 = i64_add(v7, v8); VTUP(x2)->cells[3] = MKI64(v9); - VAL v10 = (mw_mirth_c99_ZPlusC99_startZ_branchZBang(x2)); + int64_t v10 = 1LL /* True */; + VAL v11 = mw_mirth_c99_ZPlusC99_startZ_branchZBang(x2, v10); incref(x1); - VAL v11 = VVAL(VTUP(x1)->cells[3]); - incref(v11); + VAL v12 = VVAL(VTUP(x1)->cells[3]); + incref(v12); decref(x1); - VAL v12; - VAL v13; - mw_std_list_List_1_uncons(v11, &v12, &v13); - VAL x14; - VAL x15; - VAL x16; - int64_t x17; - switch (get_data_tag(v12)) { - case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(v12); - VAL v19 = (mw_mirth_c99_C99APIArg_pushZ_asZ_localZBang(v18, v10)); - int64_t v20 = 1LL /* True */; - x17 = v20; - x16 = v13; - x15 = x1; - x14 = v19; - } break; - case 0LL: { // None - int64_t v21 = 0LL /* False */; - x17 = v21; - x16 = v13; - x15 = x1; - x14 = v10; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v22 = (x14); - VAL v23 = x15; - VAL v24 = x16; - int64_t v25 = x17; - while (((bool)v25)) { - VAL v26 = (v22); - VAL v27 = v23; - VAL v28 = v24; - VAL v29; - VAL v30; - mw_std_list_List_1_uncons(v28, &v29, &v30); - VAL x31; - VAL x32; - VAL x33; - int64_t x34; - switch (get_data_tag(v29)) { - case 1LL: { // Some - VAL v35 = mtp_std_maybe_Maybe_1_Some(v29); - VAL v36 = (mw_mirth_c99_C99APIArg_pushZ_asZ_localZBang(v35, v26)); - int64_t v37 = 1LL /* True */; - x34 = v37; - x33 = v30; - x32 = v27; - x31 = v36; + VAL v13 = mw_std_list_List_1_for_1_sp17(v11, v12); + decref(x1); + return v13; +} +static VAL mw_mirth_c99_c99Z_apiZ_exitZBang (VAL x1, VAL x2) { + incref(x1); + VAL v3 = VVAL(VTUP(x1)->cells[4]); + incref(v3); + decref(x1); + VAL v4 = mw_std_list_List_1_reverse(v3); + int64_t v5 = 1LL /* True */; + VAL v6 = x2; + VAL v7 = v4; + int64_t v8 = v5; + int64_t v9 = v5; + while (((bool)v9)) { + VAL v10 = v6; + VAL v11 = v7; + int64_t v12 = v8; + VAL x13; + VAL x14; + int64_t x15; + switch (get_data_tag(v11)) { + case 1LL: { // Cons + VAL v16; + VAL v17; + mtp_std_list_List_1_Cons(v11, &v16, &v17); + incref(v16); + VAL v18; + VAL v19; + mw_mirth_c99_C99APIArg_popZ_consumeZBang(v16, v10, &v18, &v19); + VAL v20 = VVAL(VTUP(v16)->cells[3]); + incref(v20); + decref(v16); + int64_t v21 = VI64(VTUP(v18)->cells[3]); + VAL v22 = VVAL(VTUP(v18)->cells[1]); + int64_t v23 = VI64(VTUP(v22)->cells[4]); + VTUP(v22)->cells[4] = MKI64(v21); + VAL v24 = mw_mirth_c99_ZPlusC99_indent(v22); + STR* v25; + STRLIT(v25, "*", 1); + VAL v26 = mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v24); + VAL v27 = mw_mirth_c99_ZPlusC99_put(v20, v26); + STR* v28; + STRLIT(v28, " = ", 3); + VAL v29 = mw_mirth_c99_ZPlusC99_put(MKSTR(v28), v27); + VAL v30 = mw_mirth_c99_ZPlusC99_put(v19, v29); + STR* v31; + STRLIT(v31, ";", 1); + VAL v32 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + VAL v33 = mw_mirth_c99_ZPlusC99_line(v32); + VTUP(v33)->cells[4] = MKI64(v23); + VTUP(v18)->cells[1] = v33; + int64_t v34 = 1LL /* True */; + x15 = v34; + x14 = v17; + x13 = v18; } break; - case 0LL: { // None - int64_t v38 = 0LL /* False */; - x34 = v38; - x33 = v30; - x32 = v27; - x31 = v26; + case 0LL: { // Nil + VAL v35 = MKI64(0LL /* Nil */); + int64_t v36 = 0LL /* False */; + x15 = v36; + x14 = v35; + x13 = v10; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v25 = x34; - v24 = x33; - v23 = x32; - v22 = x31; + v9 = x15; + v8 = x15; + v7 = x14; + v6 = x13; } - decref(v24); - decref(v23); - return v22; -} -static VAL mw_mirth_c99_c99Z_apiZ_exitZBang (VAL x1, VAL x2) { + decref(v7); incref(x1); - VAL v3 = VVAL(VTUP(x1)->cells[4]); - incref(v3); + VAL v37 = VVAL(VTUP(x1)->cells[5]); + incref(v37); decref(x1); - VAL v4 = mw_std_list_List_1_reverse(v3); - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(v4, &v5, &v6); - VAL x7; - VAL x8; - VAL x9; - int64_t x10; - switch (get_data_tag(v5)) { + VAL x38; + VAL x39; + switch (get_data_tag(v37)) { case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v5); - incref(v11); - VAL v12; - VAL v13; - mw_mirth_c99_C99APIArg_popZ_consumeZBang(v11, x2, &v12, &v13); - VAL v14 = VVAL(VTUP(v11)->cells[3]); - incref(v14); - decref(v11); - VAL v15 = (VVAL(VTUP(v12)->cells[1])); - VAL v16 = (mw_mirth_c99_ZPlusC99_indent(v15)); - STR* v17; - STRLIT(v17, "*", 1); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16)); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(v14, v18)); - STR* v20; - STRLIT(v20, " = ", 3); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19)); - VAL v22 = (mw_mirth_c99_ZPlusC99_put(v13, v21)); - STR* v23; - STRLIT(v23, ";", 1); - VAL v24 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22)); - VAL v25 = (mw_mirth_c99_ZPlusC99_line(v24)); - VTUP(v12)->cells[1] = v25; - int64_t v26 = 1LL /* True */; - x10 = v26; - x9 = v6; - x8 = x1; - x7 = v12; + VAL v40 = mtp_std_maybe_Maybe_1_Some(v37); + VAL v41; + VAL v42; + mw_mirth_c99_C99APIArg_popZ_consumeZBang(v40, v6, &v41, &v42); + VAL v43 = mtw_std_maybe_Maybe_1_Some(v42); + x39 = v43; + x38 = v41; } break; case 0LL: { // None - int64_t v27 = 0LL /* False */; - x10 = v27; - x9 = v6; - x8 = x1; - x7 = x2; + VAL v44 = MKI64(0LL /* None */); + x39 = v44; + x38 = v6; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v28 = (x7); - VAL v29 = x8; - VAL v30 = x9; - int64_t v31 = x10; - while (((bool)v31)) { - VAL v32 = (v28); - VAL v33 = v29; - VAL v34 = v30; - VAL v35; - VAL v36; - mw_std_list_List_1_uncons(v34, &v35, &v36); - VAL x37; - VAL x38; - VAL x39; - int64_t x40; - switch (get_data_tag(v35)) { + VAL v45; + int64_t v46; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(x38, &v45, &v46); + VAL x47; + VAL x48; + if (((bool)v46)) { + VAL x49; + switch (get_data_tag(x39)) { case 1LL: { // Some - VAL v41 = mtp_std_maybe_Maybe_1_Some(v35); - incref(v41); - VAL v42; - VAL v43; - mw_mirth_c99_C99APIArg_popZ_consumeZBang(v41, v32, &v42, &v43); - VAL v44 = VVAL(VTUP(v41)->cells[3]); - incref(v44); - decref(v41); - VAL v45 = (VVAL(VTUP(v42)->cells[1])); - VAL v46 = (mw_mirth_c99_ZPlusC99_indent(v45)); - STR* v47; - STRLIT(v47, "*", 1); - VAL v48 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v47), v46)); - VAL v49 = (mw_mirth_c99_ZPlusC99_put(v44, v48)); - STR* v50; - STRLIT(v50, " = ", 3); - VAL v51 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v50), v49)); - VAL v52 = (mw_mirth_c99_ZPlusC99_put(v43, v51)); - STR* v53; - STRLIT(v53, ";", 1); - VAL v54 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v53), v52)); - VAL v55 = (mw_mirth_c99_ZPlusC99_line(v54)); - VTUP(v42)->cells[1] = v55; - int64_t v56 = 1LL /* True */; - x40 = v56; - x39 = v36; - x38 = v33; - x37 = v42; + VAL v50 = mtp_std_maybe_Maybe_1_Some(x39); + VAL v51 = mw_mirth_c99_ZPlusC99_indent(v45); + STR* v52; + STRLIT(v52, "return ", 7); + VAL v53 = mw_mirth_c99_ZPlusC99_put(MKSTR(v52), v51); + VAL v54 = mw_mirth_c99_ZPlusC99_put(v50, v53); + STR* v55; + STRLIT(v55, ";", 1); + VAL v56 = mw_mirth_c99_ZPlusC99_put(MKSTR(v55), v54); + VAL v57 = mw_mirth_c99_ZPlusC99_line(v56); + x49 = v57; } break; case 0LL: { // None - int64_t v57 = 0LL /* False */; - x40 = v57; - x39 = v36; - x38 = v33; - x37 = v32; + x49 = v45; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v31 = x40; - v30 = x39; - v29 = x38; - v28 = x37; - } - decref(v30); - incref(v29); - VAL v58 = VVAL(VTUP(v29)->cells[5]); - incref(v58); - decref(v29); - VAL x59; - VAL x60; - VAL x61; - switch (get_data_tag(v58)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v58); - VAL v63; - VAL v64; - mw_mirth_c99_C99APIArg_popZ_consumeZBang(v62, v28, &v63, &v64); - VAL v65 = mtw_std_maybe_Maybe_1_Some(v64); - x61 = v65; - x60 = v29; - x59 = v63; - } break; - case 0LL: { // None - VAL v66 = MKI64(0LL /* None */); - x61 = v66; - x60 = v29; - x59 = v28; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v67 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(x59)); - VAL x68; - VAL x69; - switch (get_data_tag(x61)) { - case 1LL: { // Some - VAL v70 = mtp_std_maybe_Maybe_1_Some(x61); - VAL v71 = (mw_mirth_c99_ZPlusC99_indent(v67)); - STR* v72; - STRLIT(v72, "return ", 7); - VAL v73 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v72), v71)); - VAL v74 = (mw_mirth_c99_ZPlusC99_put(v70, v73)); - STR* v75; - STRLIT(v75, ";", 1); - VAL v76 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v75), v74)); - VAL v77 = (mw_mirth_c99_ZPlusC99_line(v76)); - x69 = v77; - x68 = x60; - } break; - case 0LL: { // None - x69 = v67; - x68 = x60; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - decref(x68); - return x69; -} -static VAL mw_mirth_c99_c99Z_arrowZBang (VAL x1, VAL x2) { - VAL v3 = VVAL(VTUP(x1)->cells[7]); - incref(v3); - decref(x1); - VAL v4; - VAL v5; - mw_std_list_List_1_uncons(v3, &v4, &v5); - VAL x6; - VAL x7; - int64_t x8; - switch (get_data_tag(v4)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v4); - VAL v10 = (mw_mirth_c99_c99Z_atomZBang(v9, x2)); - int64_t v11 = 1LL /* True */; - x8 = v11; - x7 = v5; - x6 = v10; - } break; - case 0LL: { // None - int64_t v12 = 0LL /* False */; - x8 = v12; - x7 = v5; - x6 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + x48 = x49; + x47 = x1; + } else { + decref(x39); + incref(x1); + VAL v58 = VVAL(VTUP(x1)->cells[5]); + incref(v58); + decref(x1); + incref(x1); + int64_t v59 = VI64(VTUP(x1)->cells[7]); + decref(x1); + VAL x60; + if (((bool)v59)) { + decref(v58); + VAL v61 = MKI64(0LL /* None */); + x60 = v61; + } else { + x60 = v58; } - } - VAL v13 = (x6); - VAL v14 = x7; - int64_t v15 = x8; - while (((bool)v15)) { - VAL v16 = (v13); - VAL v17 = v14; - VAL v18; - VAL v19; - mw_std_list_List_1_uncons(v17, &v18, &v19); - VAL x20; - VAL x21; - int64_t x22; - switch (get_data_tag(v18)) { + VAL x62; + switch (get_data_tag(x60)) { case 1LL: { // Some - VAL v23 = mtp_std_maybe_Maybe_1_Some(v18); - VAL v24 = (mw_mirth_c99_c99Z_atomZBang(v23, v16)); - int64_t v25 = 1LL /* True */; - x22 = v25; - x21 = v19; - x20 = v24; + VAL v63 = mtp_std_maybe_Maybe_1_Some(x60); + int64_t v64 = VI64(VTUP(v63)->cells[2]); + decref(v63); + VAL v65 = mw_mirth_c99_C99ReprType_dummyZ_value(v64); + VAL v66 = mw_mirth_c99_ZPlusC99_indent(v45); + STR* v67; + STRLIT(v67, "return ", 7); + VAL v68 = mw_mirth_c99_ZPlusC99_put(MKSTR(v67), v66); + VAL v69 = mw_mirth_c99_ZPlusC99_put(v65, v68); + STR* v70; + STRLIT(v70, "; /* unreachable */", 19); + VAL v71 = mw_mirth_c99_ZPlusC99_put(MKSTR(v70), v69); + VAL v72 = mw_mirth_c99_ZPlusC99_line(v71); + x62 = v72; } break; case 0LL: { // None - int64_t v26 = 0LL /* False */; - x22 = v26; - x21 = v19; - x20 = v16; + x62 = v45; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v15 = x22; - v14 = x21; - v13 = x20; + x48 = x62; + x47 = x1; } - decref(v14); - return v13; + decref(x47); + return x48; } -static VAL mw_mirth_c99_c99Z_atomZBang (VAL x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); - VAL v4 = VVAL(VTUP(v3)->cells[1]); - incref(v4); - VTUP(x2)->cells[1] = v3; - int64_t v5 = VI64(VTUP(v4)->cells[2]); - decref(v4); - VAL x6; - VAL x7; - int64_t x8; - if (((bool)v5)) { - incref(x1); - int64_t v9 = mw_mirth_arrow_Atom_showZ_inZ_stackZ_traceZAsk(x1); - x8 = v9; - x7 = x2; - x6 = x1; +static VAL mw_mirth_c99_c99Z_codipZ_arrowZBang (VAL x1, VAL x2) { + incref(x1); + VAL v3; + VAL v4; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp3(x1, x2, &v3, &v4); + VAL v5; + VAL v6; + mw_mirth_type_ArrowType_unpack(v3, &v5, &v6); + VAL v7; + VAL v8; + mw_mirth_type_StackType_splitZ_parts(v6, &v7, &v8); + VAL v9; + VAL v10; + mw_mirth_type_StackType_splitZ_parts(v5, &v9, &v10); + int64_t v11 = mw_mirth_type_StackTypeBase_unitZAsk(v7); + int64_t v12 = mw_mirth_type_StackTypeBase_unitZAsk(v9); + bool v13 = (((bool)v11) && ((bool)v12)); + VAL x14; + if (v13) { + VAL v15; + VAL v16; + mw_mirth_c99_ZPlusC99Branch_popZ_stackZBang(v10, v4, &v15, &v16); + VAL v17 = VVAL(VTUP(v15)->cells[2]); + VAL v18 = MKI64(0LL /* +SNil */); + VTUP(v15)->cells[2] = v18; + VAL v19 = mw_mirth_c99_ZPlusC99Stack_pushZ_stackZBang(v15, v16); + VAL v20 = mw_mirth_c99_c99Z_arrowZBang(x1, v19); + VAL v21; + VAL v22; + mw_mirth_c99_ZPlusC99Branch_popZ_stackZBang(v8, v20, &v21, &v22); + VAL v23 = VVAL(VTUP(v21)->cells[2]); + mw_mirth_c99_ZPlusC99Stack_rdrop(v23); + VTUP(v21)->cells[2] = v17; + VAL v24 = mw_mirth_c99_ZPlusC99Stack_pushZ_stackZBang(v21, v22); + x14 = v24; } else { - int64_t v10 = 0LL /* False */; - x8 = v10; - x7 = x2; + decref(v10); + decref(v8); + VAL v25 = mw_mirth_c99_c99Z_arrowZBang(x1, v4); + x14 = v25; + } + return x14; +} +static void mw_mirth_c99_ZPlusC99Branch_popZ_stackZBang (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL v5 = MKI64(0LL /* +SNil */); + VAL v6 = mw_std_list_List_1_reverse(x1); + int64_t v7 = 1LL /* True */; + VAL v8 = x2; + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + int64_t v12 = v7; + while (((bool)v12)) { + VAL v13 = v8; + VAL v14 = v9; + VAL v15 = v10; + int64_t v16 = v11; + VAL x17; + VAL x18; + VAL x19; + int64_t x20; + switch (get_data_tag(v15)) { + case 1LL: { // Cons + VAL v21; + VAL v22; + mtp_std_list_List_1_Cons(v15, &v21, &v22); + VAL v23; + VAL v24; + mw_mirth_c99_ZPlusC99Stack_popZ_stackZ_partZBang(v21, v13, v14, &v23, &v24); + int64_t v25 = 1LL /* True */; + x20 = v25; + x19 = v22; + x18 = v24; + x17 = v23; + } break; + case 0LL: { // Nil + VAL v26 = MKI64(0LL /* Nil */); + int64_t v27 = 0LL /* False */; + x20 = v27; + x19 = v26; + x18 = v14; + x17 = v13; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v12 = x20; + v11 = x20; + v10 = x19; + v9 = x18; + v8 = x17; + } + decref(v10); + *x4 = v9; + *x3 = v8; +} +static void mw_mirth_c99_ZPlusC99Stack_popZ_stackZ_partZBang (VAL x1, VAL x2, VAL x3, VAL *x4, VAL *x5) { + VAL x6; + VAL x7; + switch (get_data_tag(x1)) { + case 0LL: { // STPCons + VAL v8 = mtp_mirth_type_StackTypePart_STPCons(x1); + int64_t v9; + VAL v10; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v8, x2, &v9, &v10); + VAL v11; + VAL v12; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v10, v9, &v11, &v12); + VAL v13 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSCons(x3, v12); + x7 = v13; + x6 = v11; + } break; + case 2LL: { // STPWith + VAL v14 = mtp_mirth_type_StackTypePart_STPWith(x1); + int64_t v15; + VAL v16; + mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v14, x2, &v15, &v16); + VAL v17; + VAL v18; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v16, v15, &v17, &v18); + VAL v19 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWith(x3, v18); + x7 = v19; + x6 = v17; + } break; + case 1LL: { // STPConsLabel + VAL v20; + uint64_t v21; + mtp_mirth_type_StackTypePart_STPConsLabel(x1, &v20, &v21); + int64_t v22; + VAL v23; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v20, x2, &v22, &v23); + VAL v24; + VAL v25; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang(v22, v21, v23, &v24, &v25); + VAL v26 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x3, v25, v21); + x7 = v26; + x6 = v24; + } break; + case 3LL: { // STPWithLabel + VAL v27; + uint64_t v28; + mtp_mirth_type_StackTypePart_STPWithLabel(x1, &v27, &v28); + int64_t v29; + VAL v30; + mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v27, x2, &v29, &v30); + VAL v31; + VAL v32; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang(v29, v28, v30, &v31, &v32); + VAL v33 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x3, v32, v28); + x7 = v33; + x6 = v31; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x5 = x7; + *x4 = x6; +} +static VAL mw_mirth_c99_ZPlusC99Stack_reverseZ_catZBang (VAL x1, VAL x2) { + int64_t v3 = 1LL /* True */; + VAL v4 = x1; + VAL v5 = x2; + int64_t v6 = v3; + int64_t v7 = v3; + while (((bool)v7)) { + VAL v8 = v4; + VAL v9 = v5; + int64_t v10 = v6; + VAL x11; + VAL x12; + int64_t x13; + switch (get_data_tag(v9)) { + case 0LL: { // +SNil + VAL v14 = MKI64(0LL /* +SNil */); + int64_t v15 = 0LL /* False */; + x13 = v15; + x12 = v14; + x11 = v8; + } break; + case 1LL: { // +SCons + VAL v16; + VAL v17; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(v9, &v16, &v17); + VAL v18 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSCons(v8, v17); + int64_t v19 = 1LL /* True */; + x13 = v19; + x12 = v16; + x11 = v18; + } break; + case 2LL: { // +SWith + VAL v20; + VAL v21; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(v9, &v20, &v21); + VAL v22 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWith(v8, v21); + int64_t v23 = 1LL /* True */; + x13 = v23; + x12 = v20; + x11 = v22; + } break; + case 3LL: { // +SConsLabel + VAL v24; + VAL v25; + uint64_t v26; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(v9, &v24, &v25, &v26); + VAL v27 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(v8, v25, v26); + int64_t v28 = 1LL /* True */; + x13 = v28; + x12 = v24; + x11 = v27; + } break; + case 4LL: { // +SWithLabel + VAL v29; + VAL v30; + uint64_t v31; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(v9, &v29, &v30, &v31); + VAL v32 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(v8, v30, v31); + int64_t v33 = 1LL /* True */; + x13 = v33; + x12 = v29; + x11 = v32; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v7 = x13; + v6 = x13; + v5 = x12; + v4 = x11; + } + mw_mirth_c99_ZPlusC99Stack_rdrop(v5); + return v4; +} +static VAL mw_mirth_c99_ZPlusC99Stack_pushZ_stackZBang (VAL x1, VAL x2) { + VAL v3 = VVAL(VTUP(x1)->cells[2]); + VAL v4 = mw_mirth_c99_ZPlusC99Stack_reverseZ_catZBang(v3, x2); + VTUP(x1)->cells[2] = v4; + return x1; +} +static VAL mw_mirth_c99_c99Z_arrowZBang (VAL x1, VAL x2) { + VAL v3 = VVAL(VTUP(x1)->cells[7]); + incref(v3); + decref(x1); + int64_t v4 = 1LL /* True */; + VAL v5 = x2; + VAL v6 = v3; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL x12; + VAL x13; + int64_t x14; + switch (get_data_tag(v10)) { + case 1LL: { // Cons + VAL v15; + VAL v16; + mtp_std_list_List_1_Cons(v10, &v15, &v16); + VAL v17 = mw_mirth_c99_c99Z_atomZBang(v15, v9); + int64_t v18 = 1LL /* True */; + x14 = v18; + x13 = v16; + x12 = v17; + } break; + case 0LL: { // Nil + VAL v19 = MKI64(0LL /* Nil */); + int64_t v20 = 0LL /* False */; + x14 = v20; + x13 = v19; + x12 = v9; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v8 = x14; + v7 = x14; + v6 = x13; + v5 = x12; + } + decref(v6); + return v5; +} +static VAL mw_mirth_c99_c99Z_atomZBang (VAL x1, VAL x2) { + VAL v3 = VVAL(VTUP(x2)->cells[1]); + VAL v4 = VVAL(VTUP(v3)->cells[1]); + incref(v4); + VTUP(x2)->cells[1] = v3; + int64_t v5 = VI64(VTUP(v4)->cells[2]); + decref(v4); + VAL x6; + int64_t x7; + if (((bool)v5)) { + incref(x1); + int64_t v8 = mw_mirth_arrow_Atom_showZ_inZ_stackZ_traceZAsk(x1); + x7 = v8; + x6 = x1; + } else { + int64_t v9 = 0LL /* False */; + x7 = v9; x6 = x1; } + VAL x10; VAL x11; - VAL x12; - if (((bool)x8)) { - VAL v13 = (VVAL(VTUP(x7)->cells[1])); - VAL v14 = (mw_mirth_c99_ZPlusC99_indent(v13)); - STR* v15; - STRLIT(v15, "WORD_ATOM(", 10); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14)); + if (((bool)x7)) { + VAL v12 = VVAL(VTUP(x2)->cells[1]); + VAL v13 = mw_mirth_c99_ZPlusC99_indent(v12); + STR* v14; + STRLIT(v14, "WORD_ATOM(", 10); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13); incref(x6); - uint64_t v17 = VU64(VTUP(x6)->cells[2]); + uint64_t v16 = VU64(VTUP(x6)->cells[2]); decref(x6); - int64_t v18 = mw_mirth_token_Token_row(v17); - int64_t v19 = mw_mirth_location_Row_ZToInt(v18); - STR* v20 = i64_show(v19); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v16)); - STR* v22; - STRLIT(v22, ", ", 2); - VAL v23 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v21)); + int64_t v17 = mw_mirth_token_Token_row(v16); + int64_t v18 = mw_mirth_location_Row_ZToInt(v17); + STR* v19 = i64_show(v18); + VAL v20 = mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v15); + STR* v21; + STRLIT(v21, ", ", 2); + VAL v22 = mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20); incref(x6); - uint64_t v24 = VU64(VTUP(x6)->cells[2]); + uint64_t v23 = VU64(VTUP(x6)->cells[2]); decref(x6); - int64_t v25 = mw_mirth_token_Token_col(v24); - int64_t v26 = mw_mirth_location_Col_ZToInt(v25); - STR* v27 = i64_show(v26); - VAL v28 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v27), v23)); - STR* v29; - STRLIT(v29, ", ", 2); - VAL v30 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v29), v28)); + int64_t v24 = mw_mirth_token_Token_col(v23); + int64_t v25 = mw_mirth_location_Col_ZToInt(v24); + STR* v26 = i64_show(v25); + VAL v27 = mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v22); + STR* v28; + STRLIT(v28, ", ", 2); + VAL v29 = mw_mirth_c99_ZPlusC99_put(MKSTR(v28), v27); incref(x6); - uint64_t v31 = VU64(VTUP(x6)->cells[2]); + uint64_t v30 = VU64(VTUP(x6)->cells[2]); decref(x6); - VAL v32 = mw_mirth_token_Token_nameZAsk(v31); - VAL x33; - VAL x34; - VAL x35; - switch (get_data_tag(v32)) { + VAL v31 = mw_mirth_token_Token_nameZAsk(v30); + VAL x32; + switch (get_data_tag(v31)) { case 1LL: { // Some - VAL v36 = mtp_std_maybe_Maybe_1_Some(v32); - VAL v37 = mw_mirth_name_Name_ZToStr(VU64(v36)); - x35 = v37; - x34 = x6; - x33 = v30; + VAL v33 = mtp_std_maybe_Maybe_1_Some(v31); + VAL v34 = mw_mirth_name_Name_ZToStr(VU64(v33)); + x32 = v34; } break; case 0LL: { // None - STR* v38; - STRLIT(v38, "", 0); - x35 = MKSTR(v38); - x34 = x6; - x33 = v30; + STR* v35; + STRLIT(v35, "", 0); + x32 = MKSTR(v35); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v39 = (mw_mirth_c99_ZPlusC99_putZ_cstr(x35, x33)); - STR* v40; - STRLIT(v40, ");", 2); - VAL v41 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v40), v39)); - VAL v42 = (mw_mirth_c99_ZPlusC99_line(v41)); - VTUP(x7)->cells[1] = v42; - x12 = x7; - x11 = x34; + VAL v36 = mw_mirth_c99_ZPlusC99_putZ_cstr(x32, v29); + STR* v37; + STRLIT(v37, ");", 2); + VAL v38 = mw_mirth_c99_ZPlusC99_put(MKSTR(v37), v36); + VAL v39 = mw_mirth_c99_ZPlusC99_line(v38); + VTUP(x2)->cells[1] = v39; + x11 = x2; + x10 = x6; } else { - x12 = x7; - x11 = x6; + x11 = x2; + x10 = x6; } - incref(x11); - VAL v43 = VVAL(VTUP(x11)->cells[4]); - incref(v43); - decref(x11); - VAL v44 = (mw_mirth_c99_c99Z_atomZ_opZBang(x11, v43, x12)); - return v44; + incref(x10); + VAL v40 = VVAL(VTUP(x10)->cells[4]); + incref(v40); + decref(x10); + VAL v41 = mw_mirth_c99_c99Z_atomZ_opZBang(x10, v40, x11); + return v41; } static int64_t mw_mirth_arrow_Atom_showZ_inZ_stackZ_traceZAsk (VAL x1) { VAL v2 = VVAL(VTUP(x1)->cells[4]); @@ -75795,19 +54869,19 @@ static VAL mw_mirth_c99_c99Z_atomZ_opZBang (VAL x1, VAL x2, VAL x3) { case 7LL: { // OpInt int64_t v5 = mtp_mirth_arrow_Op_OpInt(x2); decref(x1); - VAL v6 = (mw_mirth_c99_c99Z_intZBang(v5, x3)); + VAL v6 = mw_mirth_c99_c99Z_intZBang(v5, x3); x4 = v6; } break; case 8LL: { // OpF64 double v7 = mtp_mirth_arrow_Op_OpF64(x2); decref(x1); - VAL v8 = (mw_mirth_c99_c99Z_f64ZBang(v7, x3)); + VAL v8 = mw_mirth_c99_c99Z_f64ZBang(v7, x3); x4 = v8; } break; case 9LL: { // OpStr VAL v9 = mtp_mirth_arrow_Op_OpStr(x2); decref(x1); - VAL v10 = (mw_mirth_c99_c99Z_strZBang(v9, x3)); + VAL v10 = mw_mirth_c99_c99Z_strZBang(v9, x3); x4 = v10; } break; case 2LL: { // OpWord @@ -75815,7 +54889,7 @@ static VAL mw_mirth_c99_c99Z_atomZ_opZBang (VAL x1, VAL x2, VAL x3) { VAL v12 = VVAL(VTUP(x1)->cells[5]); incref(v12); decref(x1); - VAL v13 = (mw_mirth_c99_c99Z_wordZBang(v12, v11, x3)); + VAL v13 = mw_mirth_c99_c99Z_wordZBang(v12, v11, x3); x4 = v13; } break; case 3LL: { // OpExternal @@ -75823,25 +54897,25 @@ static VAL mw_mirth_c99_c99Z_atomZ_opZBang (VAL x1, VAL x2, VAL x3) { VAL v15 = VVAL(VTUP(x1)->cells[5]); incref(v15); decref(x1); - VAL v16 = (mw_mirth_c99_c99Z_externalZ_callZBang(v15, v14, x3)); + VAL v16 = mw_mirth_c99_c99Z_externalZ_callZBang(v15, v14, x3); x4 = v16; } break; case 4LL: { // OpBuffer uint64_t v17 = mtp_mirth_arrow_Op_OpBuffer(x2); decref(x1); - VAL v18 = (mw_mirth_c99_c99Z_bufferZ_callZBang(v17, x3)); + VAL v18 = mw_mirth_c99_c99Z_bufferZ_callZBang(v17, x3); x4 = v18; } break; case 5LL: { // OpVariable uint64_t v19 = mtp_mirth_arrow_Op_OpVariable(x2); decref(x1); - VAL v20 = (mw_mirth_c99_c99Z_variableZ_callZBang(v19, x3)); + VAL v20 = mw_mirth_c99_c99Z_variableZ_callZBang(v19, x3); x4 = v20; } break; case 6LL: { // OpField uint64_t v21 = mtp_mirth_arrow_Op_OpField(x2); decref(x1); - VAL v22 = (mw_mirth_c99_c99Z_fieldZ_callZBang(v21, x3)); + VAL v22 = mw_mirth_c99_c99Z_fieldZ_callZBang(v21, x3); x4 = v22; } break; case 10LL: { // OpTag @@ -75849,42 +54923,42 @@ static VAL mw_mirth_c99_c99Z_atomZ_opZBang (VAL x1, VAL x2, VAL x3) { VAL v24 = VVAL(VTUP(x1)->cells[5]); incref(v24); decref(x1); - VAL v25 = (mw_mirth_c99_c99Z_tagZ_callZBang(v24, v23, x3)); + VAL v25 = mw_mirth_c99_c99Z_tagZ_callZBang(v24, v23, x3); x4 = v25; } break; case 1LL: { // OpPrim int64_t v26 = mtp_mirth_arrow_Op_OpPrim(x2); - VAL v27 = (mw_mirth_c99_c99Z_primZBang(x1, v26, x3)); + VAL v27 = mw_mirth_c99_c99Z_primZBang(x1, v26, x3); x4 = v27; } break; case 11LL: { // OpMatch VAL v28 = mtp_mirth_arrow_Op_OpMatch(x2); decref(x1); - VAL v29 = (mw_mirth_c99_c99Z_matchZBang(v28, x3)); + VAL v29 = mw_mirth_c99_c99Z_matchZBang(v28, x3); x4 = v29; } break; case 12LL: { // OpLambda VAL v30 = mtp_mirth_arrow_Op_OpLambda(x2); decref(x1); - VAL v31 = (mw_mirth_c99_c99Z_lambdaZBang(v30, x3)); + VAL v31 = mw_mirth_c99_c99Z_lambdaZBang(v30, x3); x4 = v31; } break; case 13LL: { // OpVar uint64_t v32 = mtp_mirth_arrow_Op_OpVar(x2); decref(x1); - VAL v33 = (mw_mirth_c99_c99Z_varZBang(v32, x3)); + VAL v33 = mw_mirth_c99_c99Z_varZBang(v32, x3); x4 = v33; } break; case 14LL: { // OpBlockPush uint64_t v34 = mtp_mirth_arrow_Op_OpBlockPush(x2); decref(x1); - VAL v35 = (mw_mirth_c99_c99Z_blockZ_pushZBang(v34, x3)); + VAL v35 = mw_mirth_c99_c99Z_blockZ_pushZBang(v34, x3); x4 = v35; } break; case 15LL: { // OpBlockRun uint64_t v36 = mtp_mirth_arrow_Op_OpBlockRun(x2); decref(x1); - VAL v37 = (mw_mirth_c99_c99Z_blockZ_runZBang(v36, x3)); + VAL v37 = mw_mirth_c99_c99Z_blockZ_runZBang(v36, x3); x4 = v37; } break; case 16LL: { // OpCoerce @@ -75894,39 +54968,39 @@ static VAL mw_mirth_c99_c99Z_atomZ_opZBang (VAL x1, VAL x2, VAL x3) { } break; case 17LL: { // OpLabelPush uint64_t v39 = mtp_mirth_arrow_Op_OpLabelPush(x2); - VAL v40 = (mw_mirth_c99_c99Z_labelZ_pushZBang(x1, v39, x3)); + VAL v40 = mw_mirth_c99_c99Z_labelZ_pushZBang(x1, v39, x3); x4 = v40; } break; case 18LL: { // OpLabelPop uint64_t v41 = mtp_mirth_arrow_Op_OpLabelPop(x2); - VAL v42 = (mw_mirth_c99_c99Z_labelZ_popZBang(x1, v41, x3)); + VAL v42 = mw_mirth_c99_c99Z_labelZ_popZBang(x1, v41, x3); x4 = v42; } break; case 19LL: { // OpLabelPushR uint64_t v43 = mtp_mirth_arrow_Op_OpLabelPushR(x2); - VAL v44 = (mw_mirth_c99_c99Z_labelZ_pushZ_rZBang(x1, v43, x3)); + VAL v44 = mw_mirth_c99_c99Z_labelZ_pushZ_rZBang(x1, v43, x3); x4 = v44; } break; case 20LL: { // OpLabelPopR uint64_t v45 = mtp_mirth_arrow_Op_OpLabelPopR(x2); - VAL v46 = (mw_mirth_c99_c99Z_labelZ_popZ_rZBang(x1, v45, x3)); + VAL v46 = mw_mirth_c99_c99Z_labelZ_popZ_rZBang(x1, v45, x3); x4 = v46; } break; case 21LL: { // OpDataGetTag uint64_t v47 = mtp_mirth_arrow_Op_OpDataGetTag(x2); decref(x1); - VAL v48 = (mw_mirth_c99_c99Z_getZ_dataZ_tagZBang(v47, x3)); + VAL v48 = mw_mirth_c99_c99Z_getZ_dataZ_tagZBang(v47, x3); x4 = v48; } break; case 22LL: { // OpDataGetLabel VAL v49 = mtp_mirth_arrow_Op_OpDataGetLabel(x2); - VAL v50 = (mw_mirth_c99_c99Z_tagZ_getZ_labelZBang(v49, x3)); + VAL v50 = mw_mirth_c99_c99Z_tagZ_getZ_labelZBang(v49, x3); decref(x1); x4 = v50; } break; case 23LL: { // OpDataSetLabel VAL v51 = mtp_mirth_arrow_Op_OpDataSetLabel(x2); - VAL v52 = (mw_mirth_c99_c99Z_tagZ_setZ_labelZBang(v51, x3)); + VAL v52 = mw_mirth_c99_c99Z_tagZ_setZ_labelZBang(v51, x3); decref(x1); x4 = v52; } break; @@ -75950,105 +55024,110 @@ static VAL mw_mirth_c99_c99Z_getZ_dataZ_tagZBang (uint64_t x1, VAL x2) { mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v6, x2, &v7, &v8); VAL v9; VAL v10; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v8, v7, &v9, &v10); - VAL v11 = (VVAL(VTUP(v9)->cells[1])); - VAL v12 = (VVAL(VTUP(v11)->cells[6])); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v8, v7, &v9, &v10); + VAL v11 = VVAL(VTUP(v9)->cells[1]); + VAL v12 = VVAL(VTUP(v11)->cells[7]); VAL v13; VAL v14; mw_mirth_data_Data_semiZ_transparentZAsk(v12, x1, &v13, &v14); - VTUP(v11)->cells[6] = v13; + VTUP(v11)->cells[7] = v13; VTUP(v9)->cells[1] = v11; VAL x15; - uint64_t x16; - VAL x17; + VAL x16; switch (get_data_tag(v14)) { case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(v14); - int64_t v19 = 2LL /* C99RT_I64 */; - VAL v20 = (VVAL(VTUP(v9)->cells[1])); + VAL v17 = mtp_std_maybe_Maybe_1_Some(v14); + int64_t v18 = 2LL /* C99RT_I64 */; + VAL v19 = VVAL(VTUP(v9)->cells[1]); + VAL v20; VAL v21; - VAL v22; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v20, &v21, &v22); - VAL v23 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v19, v21)); - VAL v24 = (mw_mirth_c99_ZPlusC99_indent(v22)); - int64_t v25 = VI64(VTUP(v23)->cells[1]); - VAL v26 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v25); - VAL v27 = (mw_mirth_c99_ZPlusC99_put(v26, v24)); + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v19, &v20, &v21); + VTUP(v9)->cells[1] = v21; + int64_t v22 = VI64(VTUP(v9)->cells[3]); + VAL v23 = VVAL(VTUP(v9)->cells[1]); + int64_t v24 = VI64(VTUP(v23)->cells[4]); + VTUP(v23)->cells[4] = MKI64(v22); + VAL v25 = mw_mirth_c99_ZPlusC99_indent(v23); + VAL v26 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v18); + VAL v27 = mw_mirth_c99_ZPlusC99_put(v26, v25); STR* v28; STRLIT(v28, " ", 1); - VAL v29 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v28), v27)); - VAL v30 = VVAL(VTUP(v23)->cells[2]); - incref(v30); - VAL v31 = (mw_mirth_c99_ZPlusC99_put(v30, v29)); - STR* v32; - STRLIT(v32, " = ", 3); - VAL v33 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v32), v31)); - uint64_t v34 = VU64(VTUP(v18)->cells[1]); - decref(v18); + VAL v29 = mw_mirth_c99_ZPlusC99_put(MKSTR(v28), v27); + incref(v20); + VAL v30 = mw_mirth_c99_ZPlusC99_put(v20, v29); + STR* v31; + STRLIT(v31, " = ", 3); + VAL v32 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + VAL v33 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v18, v20); + uint64_t v34 = VU64(VTUP(v17)->cells[1]); + decref(v17); int64_t v35 = mw_mirth_data_Tag_value(v34); STR* v36 = i64_show(v35); - VAL v37 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v36), v33)); + VAL v37 = mw_mirth_c99_ZPlusC99_put(MKSTR(v36), v32); STR* v38; STRLIT(v38, "LL", 2); - VAL v39 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v38), v37)); + VAL v39 = mw_mirth_c99_ZPlusC99_put(MKSTR(v38), v37); STR* v40; STRLIT(v40, ";", 1); - VAL v41 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v40), v39)); - VAL v42 = (mw_mirth_c99_ZPlusC99_line(v41)); + VAL v41 = mw_mirth_c99_ZPlusC99_put(MKSTR(v40), v39); + VAL v42 = mw_mirth_c99_ZPlusC99_line(v41); + VTUP(v42)->cells[4] = MKI64(v24); VTUP(v9)->cells[1] = v42; - VAL v43 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v9, v23)); - x17 = v43; - x16 = x1; + VAL v43 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v9, v33); + x16 = v43; x15 = v10; } break; case 0LL: { // None int64_t v44 = 2LL /* C99RT_I64 */; - VAL v45 = (VVAL(VTUP(v9)->cells[1])); + VAL v45 = VVAL(VTUP(v9)->cells[1]); VAL v46; VAL v47; mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v45, &v46, &v47); - VAL v48 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v44, v46)); - VAL v49 = (mw_mirth_c99_ZPlusC99_indent(v47)); - int64_t v50 = VI64(VTUP(v48)->cells[1]); - VAL v51 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v50); - VAL v52 = (mw_mirth_c99_ZPlusC99_put(v51, v49)); - STR* v53; - STRLIT(v53, " ", 1); - VAL v54 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v53), v52)); - VAL v55 = VVAL(VTUP(v48)->cells[2]); - incref(v55); - VAL v56 = (mw_mirth_c99_ZPlusC99_put(v55, v54)); + VTUP(v9)->cells[1] = v47; + int64_t v48 = VI64(VTUP(v9)->cells[3]); + VAL v49 = VVAL(VTUP(v9)->cells[1]); + int64_t v50 = VI64(VTUP(v49)->cells[4]); + VTUP(v49)->cells[4] = MKI64(v48); + VAL v51 = mw_mirth_c99_ZPlusC99_indent(v49); + VAL v52 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v44); + VAL v53 = mw_mirth_c99_ZPlusC99_put(v52, v51); + STR* v54; + STRLIT(v54, " ", 1); + VAL v55 = mw_mirth_c99_ZPlusC99_put(MKSTR(v54), v53); + incref(v46); + VAL v56 = mw_mirth_c99_ZPlusC99_put(v46, v55); STR* v57; STRLIT(v57, " = ", 3); - VAL v58 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v57), v56)); - STR* v59; - STRLIT(v59, "get_data_tag(", 13); - VAL v60 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v59), v58)); - VAL v61; + VAL v58 = mw_mirth_c99_ZPlusC99_put(MKSTR(v57), v56); + VAL v59 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v44, v46); + STR* v60; + STRLIT(v60, "get_data_tag(", 13); + VAL v61 = mw_mirth_c99_ZPlusC99_put(MKSTR(v60), v58); VAL v62; - mw_mirth_c99_ZPlusC99Local_rdup(v10, &v61, &v62); - VAL v63 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v61); - VAL v64 = (mw_mirth_c99_ZPlusC99_put(v63, v60)); - STR* v65; - STRLIT(v65, ")", 1); - VAL v66 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v65), v64)); - STR* v67; - STRLIT(v67, ";", 1); - VAL v68 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v67), v66)); - VAL v69 = (mw_mirth_c99_ZPlusC99_line(v68)); - VTUP(v9)->cells[1] = v69; - VAL v70 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v9, v48)); - x17 = v70; - x16 = x1; - x15 = v62; + VAL v63; + mw_mirth_c99_ZPlusC99Value_rdup(v10, &v62, &v63); + VAL v64 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v62); + VAL v65 = mw_mirth_c99_ZPlusC99_put(v64, v61); + STR* v66; + STRLIT(v66, ")", 1); + VAL v67 = mw_mirth_c99_ZPlusC99_put(MKSTR(v66), v65); + STR* v68; + STRLIT(v68, ";", 1); + VAL v69 = mw_mirth_c99_ZPlusC99_put(MKSTR(v68), v67); + VAL v70 = mw_mirth_c99_ZPlusC99_line(v69); + VTUP(v70)->cells[4] = MKI64(v50); + VTUP(v9)->cells[1] = v70; + VAL v71 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v9, v59); + x16 = v71; + x15 = v63; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v71 = (mw_mirth_c99_ZPlusC99Local_dropZ_localZBang(x17, x15)); - x5 = x16; - x4 = v71; + VAL v72 = mw_mirth_c99_ZPlusC99Value_dropZ_valueZBang(x16, x15); + x5 = x1; + x4 = v72; } return x4; } @@ -76056,24 +55135,20 @@ static VAL mw_mirth_c99_c99Z_wordZBang (VAL x1, uint64_t x2, VAL x3) { int64_t v4 = mw_mirth_word_Word_preferZ_inlineZAsk(x2); VAL x5; if (((bool)v4)) { - VAL v6 = (mw_mirth_c99_c99Z_argsZ_pushZBang(x1, x3)); - VAL v7 = (VVAL(VTUP(v6)->cells[1])); - VAL v8 = (VVAL(VTUP(v7)->cells[6])); - VAL v9; - VAL v10; - mw_mirth_word_Word_arrow(x2, v8, &v9, &v10); - VTUP(v7)->cells[6] = v10; - VTUP(v6)->cells[1] = v7; - VAL v11 = (mw_mirth_c99_c99Z_arrowZBang(v9, v6)); - x5 = v11; + VAL v6 = mw_mirth_c99_c99Z_argsZ_pushZBang(x1, x3); + VAL v7; + VAL v8; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp15(x2, v6, &v7, &v8); + VAL v9 = mw_mirth_c99_c99Z_codipZ_arrowZBang(v7, v8); + x5 = v9; } else { - VAL v12 = (VVAL(VTUP(x3)->cells[1])); - VAL v13; - VAL v14; - mw_mirth_word_Word_c99Z_api(x2, v12, &v13, &v14); - VTUP(x3)->cells[1] = v14; - VAL v15 = (mw_mirth_c99_c99Z_smartZ_callZBang(x1, v13, x3)); - x5 = v15; + VAL v10 = VVAL(VTUP(x3)->cells[1]); + VAL v11; + VAL v12; + mw_mirth_word_Word_c99Z_api(x2, v10, &v11, &v12); + VTUP(x3)->cells[1] = v12; + VAL v13 = mw_mirth_c99_c99Z_smartZ_callZBang(x1, v11, x3); + x5 = v13; } return x5; } @@ -76097,65 +55172,57 @@ static VAL mw_mirth_data_Tag_valueZ_show (uint64_t x1) { return x5; } static VAL mw_mirth_c99_c99Z_tagZ_callZBang (VAL x1, uint64_t x2, VAL x3) { - VAL v4 = (VVAL(VTUP(x3)->cells[1])); - VAL v5 = (VVAL(VTUP(v4)->cells[6])); - VAL v6; - int64_t v7; - mw_mirth_data_Tag_preferZ_inlineZAsk(v5, x2, &v6, &v7); - VTUP(v4)->cells[6] = v6; - VTUP(x3)->cells[1] = v4; - VAL x8; - if (((bool)v7)) { + int64_t v4; + VAL v5; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp12(x2, x3, &v4, &v5); + VAL x6; + if (((bool)v4)) { decref(x1); - VAL v9 = (mw_mirth_c99_c99Z_tagZ_bodyZBang(x2, x3)); - x8 = v9; + VAL v7 = mw_mirth_c99_c99Z_tagZ_bodyZBang(x2, v5); + x6 = v7; } else { - VAL v10 = (VVAL(VTUP(x3)->cells[1])); - VAL v11; - VAL v12; - mw_mirth_data_Tag_wordZ_c99Z_api(x2, v10, &v11, &v12); - VTUP(x3)->cells[1] = v12; - VAL v13 = (mw_mirth_c99_c99Z_smartZ_callZBang(x1, v11, x3)); - x8 = v13; + VAL v8 = VVAL(VTUP(v5)->cells[1]); + VAL v9; + VAL v10; + mw_mirth_data_Tag_wordZ_c99Z_api(x2, v8, &v9, &v10); + VTUP(v5)->cells[1] = v10; + VAL v11 = mw_mirth_c99_c99Z_smartZ_callZBang(x1, v9, v5); + x6 = v11; } - return x8; + return x6; } static VAL mw_mirth_c99_c99Z_reverseZ_tagZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); - VAL v4 = (VVAL(VTUP(v3)->cells[6])); - VAL v5; - int64_t v6; - mw_mirth_data_Tag_preferZ_inlineZAsk(v4, x1, &v5, &v6); - VTUP(v3)->cells[6] = v5; - VTUP(x2)->cells[1] = v3; - VAL x7; - if (((bool)v6)) { - VAL v8 = (mw_mirth_c99_c99Z_reverseZ_tagZ_bodyZBang(x1, x2)); - x7 = v8; + int64_t v3; + VAL v4; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp12(x1, x2, &v3, &v4); + VAL x5; + if (((bool)v3)) { + VAL v6 = mw_mirth_c99_c99Z_reverseZ_tagZ_bodyZBang(x1, v4); + x5 = v6; } else { - VAL v9 = MKI64(0LL /* Nil */); - VAL v10 = (VVAL(VTUP(x2)->cells[1])); - VAL v11; - VAL v12; - mw_mirth_data_Tag_patZ_c99Z_api(x1, v10, &v11, &v12); - VTUP(x2)->cells[1] = v12; - VAL v13 = (mw_mirth_c99_c99Z_smartZ_callZBang(v9, v11, x2)); - x7 = v13; + VAL v7 = MKI64(0LL /* Nil */); + VAL v8 = VVAL(VTUP(v4)->cells[1]); + VAL v9; + VAL v10; + mw_mirth_data_Tag_patZ_c99Z_api(x1, v8, &v9, &v10); + VTUP(v4)->cells[1] = v10; + VAL v11 = mw_mirth_c99_c99Z_smartZ_callZBang(v7, v9, v4); + x5 = v11; } - return x7; + return x5; } static VAL mw_mirth_c99_c99Z_labelZ_defsZBang (VAL x1) { int64_t v2 = 1LL; void* v3 = mbuf_mirth_label_Label_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (mw_mirth_c99_c99Z_labelZ_defZBang(((uint64_t)v10), v9)); + VAL v11 = mw_mirth_c99_c99Z_labelZ_defZBang(((uint64_t)v10), v9); int64_t v12 = 1LL; int64_t v13 = i64_add(v10, v12); void* v14 = mbuf_mirth_label_Label_NUM; @@ -76170,173 +55237,157 @@ static VAL mw_mirth_c99_c99Z_labelZ_defsZBang (VAL x1) { static VAL mw_mirth_c99_c99Z_labelZ_defZBang (uint64_t x1, VAL x2) { STR* v3; STRLIT(v3, "static VAL lbl_", 15); - VAL v4 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2)); + VAL v4 = mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2); uint64_t v5 = mw_mirth_label_Label_name(x1); VAL v6 = mw_mirth_name_Name_mangled(v5); - VAL v7 = (mw_mirth_c99_ZPlusC99_put(v6, v4)); + VAL v7 = mw_mirth_c99_ZPlusC99_put(v6, v4); STR* v8; STRLIT(v8, " = MKNIL_C;", 11); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7)); - VAL v10 = (mw_mirth_c99_ZPlusC99_line(v9)); + VAL v9 = mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7); + VAL v10 = mw_mirth_c99_ZPlusC99_line(v9); return v10; } -static VAL mw_mirth_c99_pushZ_localZ_labelZ_directZBang (uint64_t x1, VAL x2, VAL x3) { - VAL v4 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(x3); - VAL v5 = (mw_mirth_c99_ZPlusC99_indent(x2)); - STR* v6; - STRLIT(v6, "lpush(&lbl_", 11); - VAL v7 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5)); - uint64_t v8 = mw_mirth_label_Label_name(x1); - VAL v9 = mw_mirth_name_Name_mangled(v8); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(v9, v7)); - STR* v11; - STRLIT(v11, ", ", 2); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v11), v10)); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(v4, v12)); - STR* v14; - STRLIT(v14, ");", 2); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13)); - VAL v16 = (mw_mirth_c99_ZPlusC99_line(v15)); - return v16; +static VAL mw_mirth_c99_pushZ_valueZ_labelZ_directZBang (uint64_t x1, VAL x2, VAL x3) { + VAL v4 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(x3); + VAL v5 = mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp1(v4, x1, x2); + return v5; } -static VAL mw_mirth_c99_pushZ_localZ_labelZBang (uint64_t x1, VAL x2, VAL x3) { - VAL v4 = (VVAL(VTUP(x2)->cells[2])); - VAL v5 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(v4, x3, x1)); +static VAL mw_mirth_c99_pushZ_valueZ_labelZBang (uint64_t x1, VAL x2, VAL x3) { + VAL v4 = VVAL(VTUP(x2)->cells[2]); + VAL v5 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(v4, x3, x1); VTUP(x2)->cells[2] = v5; return x2; } -static VAL mw_mirth_c99_pushZ_localZ_resourceZ_labelZ_directZBang (uint64_t x1, VAL x2, VAL x3) { - VAL v4 = mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL(x3); - VAL v5 = (mw_mirth_c99_ZPlusC99_indent(x2)); - STR* v6; - STRLIT(v6, "lpush(&lbl_", 11); - VAL v7 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5)); - uint64_t v8 = mw_mirth_label_Label_name(x1); - VAL v9 = mw_mirth_name_Name_mangled(v8); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(v9, v7)); - STR* v11; - STRLIT(v11, ", ", 2); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v11), v10)); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(v4, v12)); - STR* v14; - STRLIT(v14, ");", 2); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13)); - VAL v16 = (mw_mirth_c99_ZPlusC99_line(v15)); - return v16; +static VAL mw_mirth_c99_pushZ_resourceZ_labelZ_directZBang (uint64_t x1, VAL x2, VAL x3) { + VAL v4 = mw_mirth_c99_ZPlusC99Resource_consumeZ_asZ_VAL(x3); + VAL v5 = mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp1(v4, x1, x2); + return v5; } -static VAL mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang (uint64_t x1, VAL x2, VAL x3) { - VAL v4 = (VVAL(VTUP(x2)->cells[2])); - VAL v5 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(v4, x3, x1)); +static VAL mw_mirth_c99_pushZ_resourceZ_labelZBang (uint64_t x1, VAL x2, VAL x3) { + VAL v4 = VVAL(VTUP(x2)->cells[2]); + VAL v5 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(v4, x3, x1); VTUP(x2)->cells[2] = v5; return x2; } -static void mw_mirth_c99_popZ_localZ_labelZ_directZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5) { - VAL v6; +static void mw_mirth_c99_popZ_valueZ_labelZ_directZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5) { + VAL v6 = VVAL(VTUP(x3)->cells[1]); VAL v7; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(x3, &v6, &v7); - VAL v8 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(x1, v6)); - VAL v9 = (mw_mirth_c99_ZPlusC99_indent(v7)); - int64_t v10 = VI64(VTUP(v8)->cells[1]); - VAL v11 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v10); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(v11, v9)); - STR* v13; - STRLIT(v13, " ", 1); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12)); - VAL v15 = VVAL(VTUP(v8)->cells[2]); - incref(v15); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(v15, v14)); - STR* v17; - STRLIT(v17, " = ", 3); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16)); - VAL x19; + VAL v8; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v6, &v7, &v8); + VTUP(x3)->cells[1] = v8; + int64_t v9 = VI64(VTUP(x3)->cells[3]); + VAL v10 = VVAL(VTUP(x3)->cells[1]); + int64_t v11 = VI64(VTUP(v10)->cells[4]); + VTUP(v10)->cells[4] = MKI64(v9); + VAL v12 = mw_mirth_c99_ZPlusC99_indent(v10); + VAL v13 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x1); + VAL v14 = mw_mirth_c99_ZPlusC99_put(v13, v12); + STR* v15; + STRLIT(v15, " ", 1); + VAL v16 = mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14); + incref(v7); + VAL v17 = mw_mirth_c99_ZPlusC99_put(v7, v16); + STR* v18; + STRLIT(v18, " = ", 3); + VAL v19 = mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17); + VAL v20 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(x1, v7); + VAL x21; switch (x1) { case 0LL: { // C99RT_VAL - STR* v20; - STRLIT(v20, "lpop(&lbl_", 10); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v18)); - uint64_t v22 = mw_mirth_label_Label_name(x2); - VAL v23 = mw_mirth_name_Name_mangled(v22); - VAL v24 = (mw_mirth_c99_ZPlusC99_put(v23, v21)); - STR* v25; - STRLIT(v25, ")", 1); - VAL v26 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v24)); - x19 = v26; + STR* v22; + STRLIT(v22, "lpop(&lbl_", 10); + VAL v23 = mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v19); + uint64_t v24 = mw_mirth_label_Label_name(x2); + VAL v25 = mw_mirth_name_Name_mangled(v24); + VAL v26 = mw_mirth_c99_ZPlusC99_put(v25, v23); + STR* v27; + STRLIT(v27, ")", 1); + VAL v28 = mw_mirth_c99_ZPlusC99_put(MKSTR(v27), v26); + x21 = v28; } break; default: { - VAL v27 = mw_mirth_c99_C99ReprType_vZ_macro(x1); - VAL v28 = (mw_mirth_c99_ZPlusC99_put(v27, v18)); - STR* v29; - STRLIT(v29, "(lpop(&lbl_", 11); - VAL v30 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v29), v28)); - uint64_t v31 = mw_mirth_label_Label_name(x2); - VAL v32 = mw_mirth_name_Name_mangled(v31); - VAL v33 = (mw_mirth_c99_ZPlusC99_put(v32, v30)); - STR* v34; - STRLIT(v34, "))", 2); - VAL v35 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v34), v33)); - x19 = v35; + VAL v29 = mw_mirth_c99_C99ReprType_vZ_macro(x1); + VAL v30 = mw_mirth_c99_ZPlusC99_put(v29, v19); + STR* v31; + STRLIT(v31, "(lpop(&lbl_", 11); + VAL v32 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + uint64_t v33 = mw_mirth_label_Label_name(x2); + VAL v34 = mw_mirth_name_Name_mangled(v33); + VAL v35 = mw_mirth_c99_ZPlusC99_put(v34, v32); + STR* v36; + STRLIT(v36, "))", 2); + VAL v37 = mw_mirth_c99_ZPlusC99_put(MKSTR(v36), v35); + x21 = v37; } break; } - STR* v36; - STRLIT(v36, ";", 1); - VAL v37 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v36), x19)); - VAL v38 = (mw_mirth_c99_ZPlusC99_line(v37)); - *x5 = v8; - *x4 = v38; -} -static void mw_mirth_c99_popZ_localZ_resourceZ_labelZ_directZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5) { - VAL v6; + STR* v38; + STRLIT(v38, ";", 1); + VAL v39 = mw_mirth_c99_ZPlusC99_put(MKSTR(v38), x21); + VAL v40 = mw_mirth_c99_ZPlusC99_line(v39); + VTUP(v40)->cells[4] = MKI64(v11); + VTUP(x3)->cells[1] = v40; + *x5 = v20; + *x4 = x3; +} +static void mw_mirth_c99_popZ_resourceZ_labelZ_directZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5) { + VAL v6 = VVAL(VTUP(x3)->cells[1]); VAL v7; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(x3, &v6, &v7); - VAL v8 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(x1, v6)); - VAL v9 = (mw_mirth_c99_ZPlusC99_indent(v7)); - int64_t v10 = VI64(VTUP(v8)->cells[1]); - VAL v11 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v10); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(v11, v9)); - STR* v13; - STRLIT(v13, " ", 1); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12)); - VAL v15 = VVAL(VTUP(v8)->cells[2]); - incref(v15); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(v15, v14)); - STR* v17; - STRLIT(v17, " = (", 4); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16)); - VAL x19; + VAL v8; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v6, &v7, &v8); + VTUP(x3)->cells[1] = v8; + int64_t v9 = VI64(VTUP(x3)->cells[3]); + VAL v10 = VVAL(VTUP(x3)->cells[1]); + int64_t v11 = VI64(VTUP(v10)->cells[4]); + VTUP(v10)->cells[4] = MKI64(v9); + VAL v12 = mw_mirth_c99_ZPlusC99_indent(v10); + VAL v13 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x1); + VAL v14 = mw_mirth_c99_ZPlusC99_put(v13, v12); + STR* v15; + STRLIT(v15, " ", 1); + VAL v16 = mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14); + incref(v7); + VAL v17 = mw_mirth_c99_ZPlusC99_put(v7, v16); + STR* v18; + STRLIT(v18, " = ", 3); + VAL v19 = mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17); + VAL v20 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(x1, v7); + VAL x21; switch (x1) { case 0LL: { // C99RT_VAL - STR* v20; - STRLIT(v20, "lpop(&lbl_", 10); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v18)); - uint64_t v22 = mw_mirth_label_Label_name(x2); - VAL v23 = mw_mirth_name_Name_mangled(v22); - VAL v24 = (mw_mirth_c99_ZPlusC99_put(v23, v21)); - STR* v25; - STRLIT(v25, ")", 1); - VAL v26 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v24)); - x19 = v26; + STR* v22; + STRLIT(v22, "lpop(&lbl_", 10); + VAL v23 = mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v19); + uint64_t v24 = mw_mirth_label_Label_name(x2); + VAL v25 = mw_mirth_name_Name_mangled(v24); + VAL v26 = mw_mirth_c99_ZPlusC99_put(v25, v23); + STR* v27; + STRLIT(v27, ")", 1); + VAL v28 = mw_mirth_c99_ZPlusC99_put(MKSTR(v27), v26); + x21 = v28; } break; default: { - VAL v27 = mw_mirth_c99_C99ReprType_vZ_macro(x1); - VAL v28 = (mw_mirth_c99_ZPlusC99_put(v27, v18)); - STR* v29; - STRLIT(v29, "(lpop(&lbl_", 11); - VAL v30 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v29), v28)); - uint64_t v31 = mw_mirth_label_Label_name(x2); - VAL v32 = mw_mirth_name_Name_mangled(v31); - VAL v33 = (mw_mirth_c99_ZPlusC99_put(v32, v30)); - STR* v34; - STRLIT(v34, "))", 2); - VAL v35 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v34), v33)); - x19 = v35; + VAL v29 = mw_mirth_c99_C99ReprType_vZ_macro(x1); + VAL v30 = mw_mirth_c99_ZPlusC99_put(v29, v19); + STR* v31; + STRLIT(v31, "(lpop(&lbl_", 11); + VAL v32 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + uint64_t v33 = mw_mirth_label_Label_name(x2); + VAL v34 = mw_mirth_name_Name_mangled(v33); + VAL v35 = mw_mirth_c99_ZPlusC99_put(v34, v32); + STR* v36; + STRLIT(v36, "))", 2); + VAL v37 = mw_mirth_c99_ZPlusC99_put(MKSTR(v36), v35); + x21 = v37; } break; } - STR* v36; - STRLIT(v36, ");", 2); - VAL v37 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v36), x19)); - VAL v38 = (mw_mirth_c99_ZPlusC99_line(v37)); - *x5 = v8; - *x4 = v38; + STR* v38; + STRLIT(v38, ";", 1); + VAL v39 = mw_mirth_c99_ZPlusC99_put(MKSTR(v38), x21); + VAL v40 = mw_mirth_c99_ZPlusC99_line(v39); + VTUP(v40)->cells[4] = MKI64(v11); + VTUP(x3)->cells[1] = v40; + *x5 = v20; + *x4 = x3; } static VAL mw_mirth_c99_c99Z_labelZ_pushZBang (VAL x1, uint64_t x2, VAL x3) { VAL v4 = VVAL(VTUP(x1)->cells[6]); @@ -76345,9 +55396,9 @@ static VAL mw_mirth_c99_c99Z_labelZ_pushZBang (VAL x1, uint64_t x2, VAL x3) { VAL v5; VAL v6; VAL v7; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang(v4, x3, &v5, &v6, &v7); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_fromZ_stackZ_typeZBang(v4, x3, &v5, &v6, &v7); decref(v5); - VAL v8 = (mw_mirth_c99_pushZ_localZ_labelZBang(x2, v6, v7)); + VAL v8 = mw_mirth_c99_pushZ_valueZ_labelZBang(x2, v6, v7); return v8; } static VAL mw_mirth_c99_c99Z_labelZ_pushZ_rZBang (VAL x1, uint64_t x2, VAL x3) { @@ -76357,9 +55408,9 @@ static VAL mw_mirth_c99_c99Z_labelZ_pushZ_rZBang (VAL x1, uint64_t x2, VAL x3) { VAL v5; VAL v6; VAL v7; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_fromZ_stackZ_typeZBang(v4, x3, &v5, &v6, &v7); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_fromZ_stackZ_typeZBang(v4, x3, &v5, &v6, &v7); decref(v5); - VAL v8 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(x2, v6, v7)); + VAL v8 = mw_mirth_c99_pushZ_resourceZ_labelZBang(x2, v6, v7); return v8; } static VAL mw_mirth_c99_c99Z_labelZ_popZBang (VAL x1, uint64_t x2, VAL x3) { @@ -76369,9 +55420,9 @@ static VAL mw_mirth_c99_c99Z_labelZ_popZBang (VAL x1, uint64_t x2, VAL x3) { VAL v5; VAL v6; VAL v7; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_labelZ_fromZ_stackZ_typeZBang(x2, v4, x3, &v5, &v6, &v7); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZ_fromZ_stackZ_typeZBang(x2, v4, x3, &v5, &v6, &v7); decref(v5); - VAL v8 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v6, v7)); + VAL v8 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v6, v7); return v8; } static VAL mw_mirth_c99_c99Z_labelZ_popZ_rZBang (VAL x1, uint64_t x2, VAL x3) { @@ -76381,422 +55432,337 @@ static VAL mw_mirth_c99_c99Z_labelZ_popZ_rZBang (VAL x1, uint64_t x2, VAL x3) { VAL v5; VAL v6; VAL v7; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_labelZ_fromZ_stackZ_typeZBang(x2, v4, x3, &v5, &v6, &v7); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZ_fromZ_stackZ_typeZBang(x2, v4, x3, &v5, &v6, &v7); decref(v5); - VAL v8 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v6, v7)); + VAL v8 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v6, v7); return v8; } static VAL mw_mirth_c99_c99Z_intZBang (int64_t x1, VAL x2) { int64_t v3 = 2LL /* C99RT_I64 */; - VAL v4 = (VVAL(VTUP(x2)->cells[1])); + VAL v4 = VVAL(VTUP(x2)->cells[1]); VAL v5; VAL v6; mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v4, &v5, &v6); - VAL v7 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v3, v5)); - VAL v8 = (mw_mirth_c99_ZPlusC99_indent(v6)); - int64_t v9 = VI64(VTUP(v7)->cells[1]); - VAL v10 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v9); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(v10, v8)); - STR* v12; - STRLIT(v12, " ", 1); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11)); - VAL v14 = VVAL(VTUP(v7)->cells[2]); - incref(v14); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(v14, v13)); + VTUP(x2)->cells[1] = v6; + int64_t v7 = VI64(VTUP(x2)->cells[3]); + VAL v8 = VVAL(VTUP(x2)->cells[1]); + int64_t v9 = VI64(VTUP(v8)->cells[4]); + VTUP(v8)->cells[4] = MKI64(v7); + VAL v10 = mw_mirth_c99_ZPlusC99_indent(v8); + VAL v11 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v3); + VAL v12 = mw_mirth_c99_ZPlusC99_put(v11, v10); + STR* v13; + STRLIT(v13, " ", 1); + VAL v14 = mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12); + incref(v5); + VAL v15 = mw_mirth_c99_ZPlusC99_put(v5, v14); STR* v16; STRLIT(v16, " = ", 3); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15)); - STR* v18 = i64_show(x1); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17)); - STR* v20; - STRLIT(v20, "LL", 2); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19)); - STR* v22; - STRLIT(v22, ";", 1); - VAL v23 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v21)); - VAL v24 = (mw_mirth_c99_ZPlusC99_line(v23)); - VTUP(x2)->cells[1] = v24; - VAL v25 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x2, v7)); - return v25; + VAL v17 = mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15); + VAL v18 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v3, v5); + STR* v19 = i64_show(x1); + VAL v20 = mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v17); + STR* v21; + STRLIT(v21, "LL", 2); + VAL v22 = mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20); + STR* v23; + STRLIT(v23, ";", 1); + VAL v24 = mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22); + VAL v25 = mw_mirth_c99_ZPlusC99_line(v24); + VTUP(v25)->cells[4] = MKI64(v9); + VTUP(x2)->cells[1] = v25; + VAL v26 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x2, v18); + return v26; } static VAL mw_mirth_c99_c99Z_f64ZBang (double x1, VAL x2) { int64_t v3 = 10LL /* C99RT_F64 */; - VAL v4 = (VVAL(VTUP(x2)->cells[1])); + VAL v4 = VVAL(VTUP(x2)->cells[1]); VAL v5; VAL v6; mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v4, &v5, &v6); - VAL v7 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v3, v5)); - VAL v8 = (mw_mirth_c99_ZPlusC99_indent(v6)); - int64_t v9 = VI64(VTUP(v7)->cells[1]); - VAL v10 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v9); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(v10, v8)); - STR* v12; - STRLIT(v12, " ", 1); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11)); - VAL v14 = VVAL(VTUP(v7)->cells[2]); - incref(v14); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(v14, v13)); + VTUP(x2)->cells[1] = v6; + int64_t v7 = VI64(VTUP(x2)->cells[3]); + VAL v8 = VVAL(VTUP(x2)->cells[1]); + int64_t v9 = VI64(VTUP(v8)->cells[4]); + VTUP(v8)->cells[4] = MKI64(v7); + VAL v10 = mw_mirth_c99_ZPlusC99_indent(v8); + VAL v11 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v3); + VAL v12 = mw_mirth_c99_ZPlusC99_put(v11, v10); + STR* v13; + STRLIT(v13, " ", 1); + VAL v14 = mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12); + incref(v5); + VAL v15 = mw_mirth_c99_ZPlusC99_put(v5, v14); STR* v16; STRLIT(v16, " = ", 3); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15)); - STR* v18 = f64_show(x1); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17)); - STR* v20; - STRLIT(v20, ";", 1); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19)); - VAL v22 = (mw_mirth_c99_ZPlusC99_line(v21)); - VTUP(x2)->cells[1] = v22; - VAL v23 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x2, v7)); - return v23; + VAL v17 = mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15); + VAL v18 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v3, v5); + STR* v19 = f64_show(x1); + VAL v20 = mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v17); + STR* v21; + STRLIT(v21, ";", 1); + VAL v22 = mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20); + VAL v23 = mw_mirth_c99_ZPlusC99_line(v22); + VTUP(v23)->cells[4] = MKI64(v9); + VTUP(x2)->cells[1] = v23; + VAL v24 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x2, v18); + return v24; } static VAL mw_mirth_c99_c99Z_strZBang (VAL x1, VAL x2) { int64_t v3 = 1LL /* C99RT_STR */; VAL v4; VAL v5; - mw_mirth_c99_C99ReprType_newZ_localZBang(v3, x2, &v4, &v5); + mw_mirth_c99_C99ReprType_newZ_valueZBang(v3, x2, &v4, &v5); incref(x1); uint64_t v6 = str_size(VSTR(x1)); - int64_t v7 = 0LL; - bool v8 = (((int64_t)v6) < v7); - int64_t x9; - if (v8) { - x9 = v7; - push_resource(v4); - lpush(&lbl_ZPlusstr, v5); - push_value(x1); - } else { - x9 = ((int64_t)v6); - push_resource(v4); - lpush(&lbl_ZPlusstr, v5); - push_value(x1); - } - int64_t v10 = 4090LL; - int64_t v11 = 0LL; - bool v12 = (v10 < v11); - int64_t x13; - if (v12) { - x13 = v11; - push_i64(x9); - } else { - x13 = v10; - push_i64(x9); - } - int64_t v14 = pop_i64(); - bool v15 = (v14 > x13); - VAL x16; - VAL x17; - VAL x18; - if (v15) { - VAL r19 = pop_resource(); - VAL v20 = (VVAL(VTUP(r19)->cells[1])); - VAL v21 = (mw_mirth_c99_ZPlusC99_indent(v20)); - STR* v22; - STRLIT(v22, "STRLIT(", 7); - VAL v23 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v21)); - VAL v24 = (lpop(&lbl_ZPlusstr)); - VAL v25; - VAL v26; - mw_mirth_c99_ZPlusC99Local_rdup(v24, &v25, &v26); - VAL v27 = mw_mirth_c99_ZPlusC99Local_consume(v25); - VAL v28 = (mw_mirth_c99_ZPlusC99_put(v27, v23)); - STR* v29; - STRLIT(v29, ",", 1); - VAL v30 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v29), v28)); - VAL v31 = (mw_mirth_c99_ZPlusC99_line(v30)); - VTUP(r19)->cells[1] = v31; - VAL v32 = (VVAL(VTUP(r19)->cells[1])); - int64_t v33 = VI64(VTUP(v32)->cells[2]); - int64_t v34 = 1LL; - int64_t v35 = i64_add(v33, v34); - VTUP(v32)->cells[2] = MKI64(v35); - VTUP(r19)->cells[1] = v32; - VAL v36 = (VVAL(VTUP(r19)->cells[1])); - VAL v37 = (mw_mirth_c99_ZPlusC99_indent(v36)); - VAL v38 = pop_value(); - incref(v38); - VAL v39 = (mw_mirth_c99_ZPlusC99_putZ_cstrZ_long(v38, v37)); - STR* v40; - STRLIT(v40, ",", 1); - VAL v41 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v40), v39)); - VAL v42 = (mw_mirth_c99_ZPlusC99_line(v41)); - VTUP(r19)->cells[1] = v42; - VAL v43 = (VVAL(VTUP(r19)->cells[1])); - VAL v44 = (mw_mirth_c99_ZPlusC99_indent(v43)); - incref(v38); - uint64_t v45 = str_size(VSTR(v38)); - int64_t v46 = 0LL; - bool v47 = (((int64_t)v45) < v46); - int64_t x48; - if (v47) { - x48 = v46; - lpush(&lbl_ZPlusstr, v26); - push_resource(v44); - push_value(v38); - } else { - x48 = ((int64_t)v45); - lpush(&lbl_ZPlusstr, v26); - push_resource(v44); - push_value(v38); - } - STR* v49 = i64_show(x48); - VAL r50 = pop_resource(); - VAL v51 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v49), r50)); - VAL v52 = (mw_mirth_c99_ZPlusC99_line(v51)); - VTUP(r19)->cells[1] = v52; - VAL v53 = (VVAL(VTUP(r19)->cells[1])); - int64_t v54 = VI64(VTUP(v53)->cells[2]); - int64_t v55 = 1LL; - int64_t v56 = i64_sub(v54, v55); - int64_t v57 = 0LL; - bool v58 = (v56 < v57); - int64_t x59; - if (v58) { - int64_t v60 = 0LL; - x59 = v60; + int64_t v7 = 4090LL; + int64_t v8 = 0LL; + int64_t v9 = mw_std_prim_Int_max(v7, v8); + bool v10 = (((int64_t)v6) > v9); + VAL x11; + VAL x12; + VAL x13; + if (v10) { + int64_t v14 = VI64(VTUP(v4)->cells[3]); + VAL v15 = VVAL(VTUP(v4)->cells[1]); + int64_t v16 = VI64(VTUP(v15)->cells[4]); + VTUP(v15)->cells[4] = MKI64(v14); + VAL v17 = mw_mirth_c99_ZPlusC99_indent(v15); + STR* v18; + STRLIT(v18, "STRLIT(", 7); + VAL v19 = mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17); + VAL v20; + VAL v21; + mw_mirth_c99_ZPlusC99Value_rdup(v5, &v20, &v21); + VAL v22 = mw_mirth_c99_ZPlusC99Value_consume(v20); + VAL v23 = mw_mirth_c99_ZPlusC99_put(v22, v19); + STR* v24; + STRLIT(v24, ",", 1); + VAL v25 = mw_mirth_c99_ZPlusC99_put(MKSTR(v24), v23); + VAL v26 = mw_mirth_c99_ZPlusC99_line(v25); + VTUP(v26)->cells[4] = MKI64(v16); + VTUP(v4)->cells[1] = v26; + VAL v27 = VVAL(VTUP(v4)->cells[1]); + int64_t v28 = VI64(VTUP(v27)->cells[2]); + int64_t v29 = 1LL; + int64_t v30 = i64_add(v28, v29); + VTUP(v27)->cells[2] = MKI64(v30); + VTUP(v4)->cells[1] = v27; + int64_t v31 = VI64(VTUP(v4)->cells[3]); + VAL v32 = VVAL(VTUP(v4)->cells[1]); + int64_t v33 = VI64(VTUP(v32)->cells[4]); + VTUP(v32)->cells[4] = MKI64(v31); + VAL v34 = mw_mirth_c99_ZPlusC99_indent(v32); + incref(x1); + VAL v35 = mw_mirth_c99_ZPlusC99_putZ_cstrZ_long(x1, v34); + STR* v36; + STRLIT(v36, ",", 1); + VAL v37 = mw_mirth_c99_ZPlusC99_put(MKSTR(v36), v35); + VAL v38 = mw_mirth_c99_ZPlusC99_line(v37); + VTUP(v38)->cells[4] = MKI64(v33); + VTUP(v4)->cells[1] = v38; + int64_t v39 = VI64(VTUP(v4)->cells[3]); + VAL v40 = VVAL(VTUP(v4)->cells[1]); + int64_t v41 = VI64(VTUP(v40)->cells[4]); + VTUP(v40)->cells[4] = MKI64(v39); + VAL v42 = mw_mirth_c99_ZPlusC99_indent(v40); + incref(x1); + uint64_t v43 = str_size(VSTR(x1)); + STR* v44 = i64_show(((int64_t)v43)); + VAL v45 = mw_mirth_c99_ZPlusC99_put(MKSTR(v44), v42); + VAL v46 = mw_mirth_c99_ZPlusC99_line(v45); + VTUP(v46)->cells[4] = MKI64(v41); + VTUP(v4)->cells[1] = v46; + VAL v47 = VVAL(VTUP(v4)->cells[1]); + int64_t v48 = VI64(VTUP(v47)->cells[2]); + int64_t v49 = 1LL; + int64_t v50 = i64_sub(v48, v49); + int64_t v51 = 0LL; + bool v52 = (v50 < v51); + int64_t x53; + if (v52) { + int64_t v54 = 0LL; + x53 = v54; } else { - x59 = v56; - } - VTUP(v53)->cells[2] = MKI64(x59); - VTUP(r19)->cells[1] = v53; - VAL v61 = (VVAL(VTUP(r19)->cells[1])); - VAL v62 = (mw_mirth_c99_ZPlusC99_indent(v61)); - STR* v63; - STRLIT(v63, ");", 2); - VAL v64 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v63), v62)); - VAL v65 = (mw_mirth_c99_ZPlusC99_line(v64)); - VTUP(r19)->cells[1] = v65; - x18 = r19; - VAL v66 = pop_value(); - x17 = v66; - VAL v67 = (lpop(&lbl_ZPlusstr)); - x16 = v67; + x53 = v50; + } + VTUP(v47)->cells[2] = MKI64(x53); + VTUP(v4)->cells[1] = v47; + int64_t v55 = VI64(VTUP(v4)->cells[3]); + VAL v56 = VVAL(VTUP(v4)->cells[1]); + int64_t v57 = VI64(VTUP(v56)->cells[4]); + VTUP(v56)->cells[4] = MKI64(v55); + VAL v58 = mw_mirth_c99_ZPlusC99_indent(v56); + STR* v59; + STRLIT(v59, ");", 2); + VAL v60 = mw_mirth_c99_ZPlusC99_put(MKSTR(v59), v58); + VAL v61 = mw_mirth_c99_ZPlusC99_line(v60); + VTUP(v61)->cells[4] = MKI64(v57); + VTUP(v4)->cells[1] = v61; + x13 = v4; + x12 = x1; + x11 = v21; } else { - VAL r68 = pop_resource(); - VAL v69 = (VVAL(VTUP(r68)->cells[1])); - VAL v70 = (mw_mirth_c99_ZPlusC99_indent(v69)); - STR* v71; - STRLIT(v71, "STRLIT(", 7); - VAL v72 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v71), v70)); - VAL v73 = (lpop(&lbl_ZPlusstr)); - VAL v74; - VAL v75; - mw_mirth_c99_ZPlusC99Local_rdup(v73, &v74, &v75); - VAL v76 = mw_mirth_c99_ZPlusC99Local_consume(v74); - VAL v77 = (mw_mirth_c99_ZPlusC99_put(v76, v72)); - STR* v78; - STRLIT(v78, ", ", 2); - VAL v79 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v78), v77)); - VAL v80 = pop_value(); - incref(v80); - VAL v81 = (mw_mirth_c99_ZPlusC99_putZ_cstr(v80, v79)); - STR* v82; - STRLIT(v82, ", ", 2); - VAL v83 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v82), v81)); - incref(v80); - uint64_t v84 = str_size(VSTR(v80)); - int64_t v85 = 0LL; - bool v86 = (((int64_t)v84) < v85); - int64_t x87; - if (v86) { - x87 = v85; - lpush(&lbl_ZPlusstr, v75); - push_resource(v83); - push_value(v80); - } else { - x87 = ((int64_t)v84); - lpush(&lbl_ZPlusstr, v75); - push_resource(v83); - push_value(v80); - } - STR* v88 = i64_show(x87); - VAL r89 = pop_resource(); - VAL v90 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v88), r89)); - STR* v91; - STRLIT(v91, ");", 2); - VAL v92 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v91), v90)); - VAL v93 = (mw_mirth_c99_ZPlusC99_line(v92)); - VTUP(r68)->cells[1] = v93; - x18 = r68; - VAL v94 = pop_value(); - x17 = v94; - VAL v95 = (lpop(&lbl_ZPlusstr)); - x16 = v95; + int64_t v62 = VI64(VTUP(v4)->cells[3]); + VAL v63 = VVAL(VTUP(v4)->cells[1]); + int64_t v64 = VI64(VTUP(v63)->cells[4]); + VTUP(v63)->cells[4] = MKI64(v62); + VAL v65 = mw_mirth_c99_ZPlusC99_indent(v63); + STR* v66; + STRLIT(v66, "STRLIT(", 7); + VAL v67 = mw_mirth_c99_ZPlusC99_put(MKSTR(v66), v65); + VAL v68; + VAL v69; + mw_mirth_c99_ZPlusC99Value_rdup(v5, &v68, &v69); + VAL v70 = mw_mirth_c99_ZPlusC99Value_consume(v68); + VAL v71 = mw_mirth_c99_ZPlusC99_put(v70, v67); + STR* v72; + STRLIT(v72, ", ", 2); + VAL v73 = mw_mirth_c99_ZPlusC99_put(MKSTR(v72), v71); + incref(x1); + VAL v74 = mw_mirth_c99_ZPlusC99_putZ_cstr(x1, v73); + STR* v75; + STRLIT(v75, ", ", 2); + VAL v76 = mw_mirth_c99_ZPlusC99_put(MKSTR(v75), v74); + incref(x1); + uint64_t v77 = str_size(VSTR(x1)); + STR* v78 = i64_show(((int64_t)v77)); + VAL v79 = mw_mirth_c99_ZPlusC99_put(MKSTR(v78), v76); + STR* v80; + STRLIT(v80, ");", 2); + VAL v81 = mw_mirth_c99_ZPlusC99_put(MKSTR(v80), v79); + VAL v82 = mw_mirth_c99_ZPlusC99_line(v81); + VTUP(v82)->cells[4] = MKI64(v64); + VTUP(v4)->cells[1] = v82; + x13 = v4; + x12 = x1; + x11 = v69; } - decref(x17); - VAL v96 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x18, x16)); - return v96; + decref(x12); + VAL v83 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x13, x11); + return v83; } static VAL mw_mirth_c99_ZPlusC99_putZ_cstrZ_long (VAL x1, VAL x2) { int64_t v3 = 0LL /* False */; int64_t v4 = 34LL /* BQUOTE */; - VAL v5 = (mw_mirth_c99_ZPlusC99_putZ_byte(v4, x2)); + VAL v5 = mw_mirth_c99_ZPlusC99_putZ_byte(v4, x2); int64_t v6 = 0LL /* BNUL */; incref(x1); incref(x1); void* v7 = str_base(VSTR(x1)); uint64_t v8 = str_size(VSTR(x1)); int64_t v9 = 0LL; - bool v10 = (((int64_t)v8) < v9); - int64_t x11; - if (v10) { - x11 = v9; - lpush(&lbl_avoidZ_hexdigit, MKI64(v3)); - push_resource(v5); - push_i64(v6); - push_ptr(v7); - } else { - x11 = ((int64_t)v8); - lpush(&lbl_avoidZ_hexdigit, MKI64(v3)); - push_resource(v5); - push_i64(v6); - push_ptr(v7); - } - int64_t v12 = 0LL; - bool v13 = (x11 > v12); - int64_t v14 = x11; - bool v15 = v13; - while (v15) { - int64_t v16 = v14; - void* v17 = pop_ptr(); - int64_t v18 = (0LL /* +Unsafe */); - int64_t v19; - int64_t v20; - mw_std_prim_Ptr_ZAtByte(v17, v18, &v19, &v20); - int64_t v21 = pop_i64(); - int64_t v22 = 10LL /* BLF */; - bool v23 = (v21 == v22); - int64_t x24; - VAL x25; - int64_t x26; - if (v23) { + bool v10 = (((int64_t)v8) > v9); + int64_t v11 = v3; + VAL v12 = v5; + int64_t v13 = v6; + void* v14 = v7; + uint64_t v15 = v8; + bool v16 = v10; + while (v16) { + int64_t v17 = v11; + VAL v18 = v12; + int64_t v19 = v13; + void* v20 = v14; + uint64_t v21 = v15; + int64_t v22 = 0LL /* +Unsafe */; + uint8_t v23 = *(uint8_t*)v20; + int64_t v24 = 10LL /* BLF */; + bool v25 = (v19 == v24); + VAL x26; + if (v25) { int64_t v27 = 34LL /* BQUOTE */; - VAL r28 = pop_resource(); - VAL v29 = (mw_mirth_c99_ZPlusC99_putZ_byte(v27, r28)); - VAL v30 = (mw_mirth_c99_ZPlusC99_line(v29)); - VAL v31 = (mw_mirth_c99_ZPlusC99_indent(v30)); - int64_t v32 = 34LL /* BQUOTE */; - VAL v33 = (mw_mirth_c99_ZPlusC99_putZ_byte(v32, v31)); - x26 = v19; - x25 = v33; - int64_t v34 = VI64(lpop(&lbl_avoidZ_hexdigit)); - x24 = v34; + VAL v28 = mw_mirth_c99_ZPlusC99_putZ_byte(v27, v18); + VAL v29 = mw_mirth_c99_ZPlusC99_line(v28); + VAL v30 = mw_mirth_c99_ZPlusC99_indent(v29); + int64_t v31 = 34LL /* BQUOTE */; + VAL v32 = mw_mirth_c99_ZPlusC99_putZ_byte(v31, v30); + x26 = v32; } else { - x26 = v19; - VAL r35 = pop_resource(); - x25 = r35; - int64_t v36 = VI64(lpop(&lbl_avoidZ_hexdigit)); - x24 = v36; + x26 = v18; } - int64_t v37; - VAL v38; - mw_mirth_c99_c99Z_stringZ_byteZBang(x26, x24, x25, &v37, &v38); - int64_t v39 = 1LL; - int64_t v40 = (0LL /* +Unsafe */); - void* v41 = (void*)(v39 + (char*)v17); - int64_t v42 = 1LL; - int64_t v43 = i64_sub(v16, v42); - int64_t v44 = 0LL; - bool v45 = (v43 < v44); - int64_t x46; - if (v45) { - int64_t v47 = 0LL; - x46 = v47; - push_i64(x26); - lpush(&lbl_avoidZ_hexdigit, MKI64(v37)); - push_resource(v38); - push_ptr(v41); + int64_t v33; + VAL v34; + mw_mirth_c99_c99Z_stringZ_byteZBang(((int64_t)v23), v17, x26, &v33, &v34); + int64_t v35 = 1LL; + int64_t v36 = 0LL /* +Unsafe */; + void* v37 = (void*)(v35 + (char*)v20); + int64_t v38 = 1LL; + int64_t v39 = i64_sub(((int64_t)v21), v38); + int64_t v40 = 0LL; + bool v41 = (v39 < v40); + int64_t x42; + if (v41) { + int64_t v43 = 0LL; + x42 = v43; } else { - x46 = v43; - push_i64(x26); - lpush(&lbl_avoidZ_hexdigit, MKI64(v37)); - push_resource(v38); - push_ptr(v41); - } - int64_t v48 = 0LL; - bool v49 = (x46 > v48); - v15 = v49; - v14 = x46; - } - void* v50 = pop_ptr(); + x42 = v39; + } + int64_t v44 = 0LL; + bool v45 = (x42 > v44); + v16 = v45; + v15 = ((uint64_t)x42); + v14 = v37; + v13 = ((int64_t)v23); + v12 = v34; + v11 = v33; + } decref(x1); - int64_t v51 = 34LL /* BQUOTE */; - VAL r52 = pop_resource(); - VAL v53 = (mw_mirth_c99_ZPlusC99_putZ_byte(v51, r52)); - int64_t v54 = VI64(lpop(&lbl_avoidZ_hexdigit)); - VAL v55 = pop_value(); - decref(v55); - return v53; + int64_t v46 = 34LL /* BQUOTE */; + VAL v47 = mw_mirth_c99_ZPlusC99_putZ_byte(v46, v12); + return v47; } static VAL mw_mirth_c99_ZPlusC99_putZ_cstr (VAL x1, VAL x2) { int64_t v3 = 0LL /* False */; int64_t v4 = 34LL /* BQUOTE */; - VAL v5 = (mw_mirth_c99_ZPlusC99_putZ_byte(v4, x2)); + VAL v5 = mw_mirth_c99_ZPlusC99_putZ_byte(v4, x2); incref(x1); incref(x1); void* v6 = str_base(VSTR(x1)); uint64_t v7 = str_size(VSTR(x1)); int64_t v8 = 0LL; - bool v9 = (((int64_t)v7) < v8); - int64_t x10; - if (v9) { - x10 = v8; - lpush(&lbl_avoidZ_hexdigit, MKI64(v3)); - push_resource(v5); - push_ptr(v6); - } else { - x10 = ((int64_t)v7); - lpush(&lbl_avoidZ_hexdigit, MKI64(v3)); - push_resource(v5); - push_ptr(v6); - } - int64_t v11 = 0LL; - bool v12 = (x10 > v11); - int64_t v13 = x10; - bool v14 = v12; + bool v9 = (((int64_t)v7) > v8); + int64_t v10 = v3; + VAL v11 = v5; + void* v12 = v6; + uint64_t v13 = v7; + bool v14 = v9; while (v14) { - int64_t v15 = v13; - void* v16 = pop_ptr(); - int64_t v17 = (0LL /* +Unsafe */); - int64_t v18; - int64_t v19; - mw_std_prim_Ptr_ZAtByte(v16, v17, &v18, &v19); - VAL r20 = pop_resource(); - int64_t v21 = VI64(lpop(&lbl_avoidZ_hexdigit)); - int64_t v22; - VAL v23; - mw_mirth_c99_c99Z_stringZ_byteZBang(v18, v21, r20, &v22, &v23); - int64_t v24 = 1LL; - int64_t v25 = (0LL /* +Unsafe */); - void* v26 = (void*)(v24 + (char*)v16); - int64_t v27 = 1LL; - int64_t v28 = i64_sub(v15, v27); - int64_t v29 = 0LL; - bool v30 = (v28 < v29); - int64_t x31; - if (v30) { - int64_t v32 = 0LL; - x31 = v32; - lpush(&lbl_avoidZ_hexdigit, MKI64(v22)); - push_resource(v23); - push_ptr(v26); + int64_t v15 = v10; + VAL v16 = v11; + void* v17 = v12; + uint64_t v18 = v13; + int64_t v19 = 0LL /* +Unsafe */; + uint8_t v20 = *(uint8_t*)v17; + int64_t v21; + VAL v22; + mw_mirth_c99_c99Z_stringZ_byteZBang(((int64_t)v20), v15, v16, &v21, &v22); + int64_t v23 = 1LL; + int64_t v24 = 0LL /* +Unsafe */; + void* v25 = (void*)(v23 + (char*)v17); + int64_t v26 = 1LL; + int64_t v27 = i64_sub(((int64_t)v18), v26); + int64_t v28 = 0LL; + bool v29 = (v27 < v28); + int64_t x30; + if (v29) { + int64_t v31 = 0LL; + x30 = v31; } else { - x31 = v28; - lpush(&lbl_avoidZ_hexdigit, MKI64(v22)); - push_resource(v23); - push_ptr(v26); + x30 = v27; } - int64_t v33 = 0LL; - bool v34 = (x31 > v33); - v14 = v34; - v13 = x31; + int64_t v32 = 0LL; + bool v33 = (x30 > v32); + v14 = v33; + v13 = ((uint64_t)x30); + v12 = v25; + v11 = v22; + v10 = v21; } - void* v35 = pop_ptr(); decref(x1); - int64_t v36 = 34LL /* BQUOTE */; - VAL r37 = pop_resource(); - VAL v38 = (mw_mirth_c99_ZPlusC99_putZ_byte(v36, r37)); - int64_t v39 = VI64(lpop(&lbl_avoidZ_hexdigit)); - return v38; + int64_t v34 = 34LL /* BQUOTE */; + VAL v35 = mw_mirth_c99_ZPlusC99_putZ_byte(v34, v11); + return v35; } static void mw_mirth_c99_c99Z_stringZ_byteZBang (int64_t x1, int64_t x2, VAL x3, int64_t *x4, VAL *x5) { int64_t x6; @@ -76805,7 +55771,7 @@ static void mw_mirth_c99_c99Z_stringZ_byteZBang (int64_t x1, int64_t x2, VAL x3, case 92LL: { // B'\' STR* v8; STRLIT(v8, "\\\\", 2); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v8), x3)); + VAL v9 = mw_mirth_c99_ZPlusC99_put(MKSTR(v8), x3); int64_t v10 = 0LL /* False */; x7 = v9; x6 = v10; @@ -76813,7 +55779,7 @@ static void mw_mirth_c99_c99Z_stringZ_byteZBang (int64_t x1, int64_t x2, VAL x3, case 34LL: { // BQUOTE STR* v11; STRLIT(v11, "\\\"", 2); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v11), x3)); + VAL v12 = mw_mirth_c99_ZPlusC99_put(MKSTR(v11), x3); int64_t v13 = 0LL /* False */; x7 = v12; x6 = v13; @@ -76821,7 +55787,7 @@ static void mw_mirth_c99_c99Z_stringZ_byteZBang (int64_t x1, int64_t x2, VAL x3, case 9LL: { // BHT STR* v14; STRLIT(v14, "\\t", 2); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v14), x3)); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), x3); int64_t v16 = 0LL /* False */; x7 = v15; x6 = v16; @@ -76829,7 +55795,7 @@ static void mw_mirth_c99_c99Z_stringZ_byteZBang (int64_t x1, int64_t x2, VAL x3, case 10LL: { // BLF STR* v17; STRLIT(v17, "\\n", 2); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v17), x3)); + VAL v18 = mw_mirth_c99_ZPlusC99_put(MKSTR(v17), x3); int64_t v19 = 0LL /* False */; x7 = v18; x6 = v19; @@ -76837,7 +55803,7 @@ static void mw_mirth_c99_c99Z_stringZ_byteZBang (int64_t x1, int64_t x2, VAL x3, case 13LL: { // BCR STR* v20; STRLIT(v20, "\\r", 2); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), x3)); + VAL v21 = mw_mirth_c99_ZPlusC99_put(MKSTR(v20), x3); int64_t v22 = 0LL /* False */; x7 = v21; x6 = v22; @@ -76849,46 +55815,59 @@ static void mw_mirth_c99_c99Z_stringZ_byteZBang (int64_t x1, int64_t x2, VAL x3, bool v26 = (x1 <= v24); bool v27 = (v25 && v26); int64_t x28; - VAL x29; + int64_t x29; int64_t x30; - int64_t x31; if (v27) { - int64_t v32 = mw_std_byte_Byte_isZ_hexdigit(x1); - bool v33 = (((bool)v32) && ((bool)x2)); - bool v34 = !v33; - x31 = ((int64_t)v34); - x30 = x1; - x29 = x3; - x28 = x2; + int64_t v31 = 48LL /* B'0' */; + int64_t v32 = 57LL /* B'9' */; + bool v33 = (x1 >= v31); + bool v34 = (x1 <= v32); + bool v35 = (v33 && v34); + int64_t v36 = 65LL /* B'A' */; + int64_t v37 = 70LL /* B'F' */; + bool v38 = (x1 >= v36); + bool v39 = (x1 <= v37); + bool v40 = (v38 && v39); + int64_t v41 = 97LL /* B'a' */; + int64_t v42 = 102LL /* B'f' */; + bool v43 = (x1 >= v41); + bool v44 = (x1 <= v42); + bool v45 = (v43 && v44); + bool v46 = (v40 || v45); + bool v47 = (v35 || v46); + bool v48 = (v47 && ((bool)x2)); + bool v49 = !v48; + x30 = ((int64_t)v49); + x29 = x2; + x28 = x1; } else { - int64_t v35 = 0LL /* False */; - x31 = v35; - x30 = x1; - x29 = x3; - x28 = x2; + int64_t v50 = 0LL /* False */; + x30 = v50; + x29 = x2; + x28 = x1; } - VAL x36; - int64_t x37; - if (((bool)x31)) { - VAL v38 = (mw_mirth_c99_ZPlusC99_putZ_byte(x30, x29)); - int64_t v39 = 0LL /* False */; - x37 = v39; - x36 = v38; + VAL x51; + int64_t x52; + if (((bool)x30)) { + VAL v53 = mw_mirth_c99_ZPlusC99_putZ_byte(x28, x3); + int64_t v54 = 0LL /* False */; + x52 = v54; + x51 = v53; } else { - STR* v40; - STRLIT(v40, "\\x", 2); - VAL v41 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v40), x29)); - int64_t v42; - int64_t v43; - mw_std_byte_Byte_toZ_hexdigits(x30, &v42, &v43); - VAL v44 = (mw_mirth_c99_ZPlusC99_putZ_byte(v42, v41)); - VAL v45 = (mw_mirth_c99_ZPlusC99_putZ_byte(v43, v44)); - int64_t v46 = 1LL /* True */; - x37 = v46; - x36 = v45; + STR* v55; + STRLIT(v55, "\\x", 2); + VAL v56 = mw_mirth_c99_ZPlusC99_put(MKSTR(v55), x3); + int64_t v57; + int64_t v58; + mw_std_byte_Byte_toZ_hexdigits(x28, &v57, &v58); + VAL v59 = mw_mirth_c99_ZPlusC99_putZ_byte(v57, v56); + VAL v60 = mw_mirth_c99_ZPlusC99_putZ_byte(v58, v59); + int64_t v61 = 1LL /* True */; + x52 = v61; + x51 = v60; } - x7 = x36; - x6 = x37; + x7 = x51; + x6 = x52; } break; } *x5 = x7; @@ -76962,82 +55941,82 @@ static int64_t mw_mirth_c99_C99ReprType_isZ_intZ_likeZAsk (int64_t x1) { } return x2; } -static VAL mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type (int64_t x1) { +static VAL mw_mirth_c99_C99ReprType_dummyZ_value (int64_t x1) { VAL x2; switch (x1) { case 0LL: { // C99RT_VAL STR* v3; - STRLIT(v3, "VAL", 3); + STRLIT(v3, "(VAL){0}", 8); x2 = MKSTR(v3); } break; case 1LL: { // C99RT_STR STR* v4; - STRLIT(v4, "STR*", 4); + STRLIT(v4, "NULL", 4); x2 = MKSTR(v4); } break; case 2LL: { // C99RT_I64 STR* v5; - STRLIT(v5, "int64_t", 7); + STRLIT(v5, "0", 1); x2 = MKSTR(v5); } break; case 3LL: { // C99RT_I32 STR* v6; - STRLIT(v6, "int32_t", 7); + STRLIT(v6, "0", 1); x2 = MKSTR(v6); } break; case 4LL: { // C99RT_I16 STR* v7; - STRLIT(v7, "int16_t", 7); + STRLIT(v7, "0", 1); x2 = MKSTR(v7); } break; case 5LL: { // C99RT_I8 STR* v8; - STRLIT(v8, "int8_t", 6); + STRLIT(v8, "0", 1); x2 = MKSTR(v8); } break; case 6LL: { // C99RT_U64 STR* v9; - STRLIT(v9, "uint64_t", 8); + STRLIT(v9, "0", 1); x2 = MKSTR(v9); } break; case 7LL: { // C99RT_U32 STR* v10; - STRLIT(v10, "uint32_t", 8); + STRLIT(v10, "0", 1); x2 = MKSTR(v10); } break; case 8LL: { // C99RT_U16 STR* v11; - STRLIT(v11, "uint16_t", 8); + STRLIT(v11, "0", 1); x2 = MKSTR(v11); } break; case 9LL: { // C99RT_U8 STR* v12; - STRLIT(v12, "uint8_t", 7); + STRLIT(v12, "0", 1); x2 = MKSTR(v12); } break; case 10LL: { // C99RT_F64 STR* v13; - STRLIT(v13, "double", 6); + STRLIT(v13, "0.0", 3); x2 = MKSTR(v13); } break; case 11LL: { // C99RT_F32 STR* v14; - STRLIT(v14, "float", 5); + STRLIT(v14, "0.0", 3); x2 = MKSTR(v14); } break; case 12LL: { // C99RT_BOOL STR* v15; - STRLIT(v15, "bool", 4); + STRLIT(v15, "0", 1); x2 = MKSTR(v15); } break; case 13LL: { // C99RT_PTR STR* v16; - STRLIT(v16, "void*", 5); + STRLIT(v16, "NULL", 4); x2 = MKSTR(v16); } break; case 14LL: { // C99RT_FNPTR STR* v17; - STRLIT(v17, "FNPTR", 5); + STRLIT(v17, "NULL", 4); x2 = MKSTR(v17); } break; default: { @@ -77046,7 +56025,91 @@ static VAL mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type (int64_t x1) { } return x2; } -static VAL mw_mirth_c99_C99ReprType_vZ_macro (int64_t x1) { +static VAL mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type (int64_t x1) { + VAL x2; + switch (x1) { + case 0LL: { // C99RT_VAL + STR* v3; + STRLIT(v3, "VAL", 3); + x2 = MKSTR(v3); + } break; + case 1LL: { // C99RT_STR + STR* v4; + STRLIT(v4, "STR*", 4); + x2 = MKSTR(v4); + } break; + case 2LL: { // C99RT_I64 + STR* v5; + STRLIT(v5, "int64_t", 7); + x2 = MKSTR(v5); + } break; + case 3LL: { // C99RT_I32 + STR* v6; + STRLIT(v6, "int32_t", 7); + x2 = MKSTR(v6); + } break; + case 4LL: { // C99RT_I16 + STR* v7; + STRLIT(v7, "int16_t", 7); + x2 = MKSTR(v7); + } break; + case 5LL: { // C99RT_I8 + STR* v8; + STRLIT(v8, "int8_t", 6); + x2 = MKSTR(v8); + } break; + case 6LL: { // C99RT_U64 + STR* v9; + STRLIT(v9, "uint64_t", 8); + x2 = MKSTR(v9); + } break; + case 7LL: { // C99RT_U32 + STR* v10; + STRLIT(v10, "uint32_t", 8); + x2 = MKSTR(v10); + } break; + case 8LL: { // C99RT_U16 + STR* v11; + STRLIT(v11, "uint16_t", 8); + x2 = MKSTR(v11); + } break; + case 9LL: { // C99RT_U8 + STR* v12; + STRLIT(v12, "uint8_t", 7); + x2 = MKSTR(v12); + } break; + case 10LL: { // C99RT_F64 + STR* v13; + STRLIT(v13, "double", 6); + x2 = MKSTR(v13); + } break; + case 11LL: { // C99RT_F32 + STR* v14; + STRLIT(v14, "float", 5); + x2 = MKSTR(v14); + } break; + case 12LL: { // C99RT_BOOL + STR* v15; + STRLIT(v15, "bool", 4); + x2 = MKSTR(v15); + } break; + case 13LL: { // C99RT_PTR + STR* v16; + STRLIT(v16, "void*", 5); + x2 = MKSTR(v16); + } break; + case 14LL: { // C99RT_FNPTR + STR* v17; + STRLIT(v17, "FNPTR", 5); + x2 = MKSTR(v17); + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x2; +} +static VAL mw_mirth_c99_C99ReprType_vZ_macro (int64_t x1) { VAL x2; switch (x1) { case 0LL: { // C99RT_VAL @@ -77413,13 +56476,13 @@ static void mw_mirth_type_Type_c99Z_repr (VAL x1, VAL x2, int64_t *x3, VAL *x4) case 3LL: { // TMeta uint64_t v11 = mtp_mirth_type_Type_TMeta(x1); VAL v12 = mw_mirth_type_MetaVar_typeZAsk(v11); - int64_t x13; - VAL x14; + VAL x13; + int64_t x14; switch (get_data_tag(v12)) { case 0LL: { // None int64_t v15 = 0LL /* C99RT_VAL */; - x14 = x2; - x13 = v15; + x14 = v15; + x13 = x2; } break; case 1LL: { // Some VAL v16 = mtp_std_maybe_Maybe_1_Some(v12); @@ -77431,15 +56494,15 @@ static void mw_mirth_type_Type_c99Z_repr (VAL x1, VAL x2, int64_t *x3, VAL *x4) int64_t v20; VAL v21; mw_mirth_type_Type_c99Z_repr(v17, x2, &v20, &v21); - x14 = v21; - x13 = v20; + x14 = v20; + x13 = v21; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x6 = x14; - x5 = x13; + x6 = x13; + x5 = x14; } break; case 4LL: { // THole uint64_t v22 = mtp_mirth_type_Type_THole(x1); @@ -77630,96 +56693,114 @@ static void mw_mirth_data_Data_c99Z_repr (uint64_t x1, VAL x2, int64_t *x3, VAL *x4 = x6; *x3 = x7; } -static void mw_mirth_c99_ZPlusC99Local_rdup (VAL x1, VAL *x2, VAL *x3) { +static void mw_mirth_c99_ZPlusC99Value_rdup (VAL x1, VAL *x2, VAL *x3) { int64_t v4 = VI64(VTUP(x1)->cells[1]); VAL v5 = VVAL(VTUP(x1)->cells[2]); incref(v5); - VAL v6 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v4, v5)); + VAL v6 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v4, v5); *x3 = v6; *x2 = x1; } -static void mw_mirth_c99_ZPlusC99Local_rdrop (VAL x1) { +static void mw_mirth_c99_ZPlusC99Value_rdrop (VAL x1) { int64_t v2; VAL v3; - mtp_mirth_c99_ZPlusC99Local_ZPlusC99Local(x1, &v2, &v3); + mtp_mirth_c99_ZPlusC99Value_ZPlusC99Value(x1, &v2, &v3); decref(v3); } -static void mw_mirth_c99_C99ReprType_newZ_localZBang (int64_t x1, VAL x2, VAL *x3, VAL *x4) { - VAL v5 = (VVAL(VTUP(x2)->cells[1])); +static void mw_mirth_c99_C99ReprType_newZ_valueZBang (int64_t x1, VAL x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); VAL v6; VAL v7; mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v5, &v6, &v7); VTUP(x2)->cells[1] = v7; - VAL v8 = (VVAL(VTUP(x2)->cells[1])); - VAL v9 = (mw_mirth_c99_ZPlusC99_indent(v8)); - VAL v10 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x1); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(v10, v9)); - STR* v12; - STRLIT(v12, " ", 1); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11)); + int64_t v8 = VI64(VTUP(x2)->cells[3]); + VAL v9 = VVAL(VTUP(x2)->cells[1]); + int64_t v10 = VI64(VTUP(v9)->cells[4]); + VTUP(v9)->cells[4] = MKI64(v8); + VAL v11 = mw_mirth_c99_ZPlusC99_indent(v9); + VAL v12 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x1); + VAL v13 = mw_mirth_c99_ZPlusC99_put(v12, v11); + STR* v14; + STRLIT(v14, " ", 1); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13); incref(v6); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(v6, v13)); - STR* v15; - STRLIT(v15, ";", 1); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14)); - VAL v17 = (mw_mirth_c99_ZPlusC99_line(v16)); - VTUP(x2)->cells[1] = v17; - VAL v18 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(x1, v6)); - *x4 = v18; + VAL v16 = mw_mirth_c99_ZPlusC99_put(v6, v15); + STR* v17; + STRLIT(v17, ";", 1); + VAL v18 = mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16); + VAL v19 = mw_mirth_c99_ZPlusC99_line(v18); + VTUP(v19)->cells[4] = MKI64(v10); + VTUP(x2)->cells[1] = v19; + VAL v20 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(x1, v6); + *x4 = v20; *x3 = x2; } -static void mw_mirth_c99_C99ReprType_popZ_toZ_localZ_directZBang (int64_t x1, VAL x2, VAL *x3, VAL *x4) { - VAL v5; +static void mw_mirth_c99_C99ReprType_popZ_valueZ_directZBang (int64_t x1, VAL x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); VAL v6; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(x2, &v5, &v6); - VAL v7 = (mw_mirth_c99_ZPlusC99_indent(v6)); - VAL v8 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x1); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(v8, v7)); - STR* v10; - STRLIT(v10, " ", 1); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v10), v9)); - incref(v5); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(v5, v11)); - STR* v13; - STRLIT(v13, " = ", 3); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12)); - VAL v15 = mw_mirth_c99_C99ReprType_popZ_macro(x1); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(v15, v14)); + VAL v7; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v5, &v6, &v7); + VTUP(x2)->cells[1] = v7; + int64_t v8 = VI64(VTUP(x2)->cells[3]); + VAL v9 = VVAL(VTUP(x2)->cells[1]); + int64_t v10 = VI64(VTUP(v9)->cells[4]); + VTUP(v9)->cells[4] = MKI64(v8); + VAL v11 = mw_mirth_c99_ZPlusC99_indent(v9); + VAL v12 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x1); + VAL v13 = mw_mirth_c99_ZPlusC99_put(v12, v11); + STR* v14; + STRLIT(v14, " ", 1); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13); + incref(v6); + VAL v16 = mw_mirth_c99_ZPlusC99_put(v6, v15); STR* v17; - STRLIT(v17, "();", 3); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16)); - VAL v19 = (mw_mirth_c99_ZPlusC99_line(v18)); - VAL v20 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(x1, v5)); - *x4 = v20; - *x3 = v19; + STRLIT(v17, " = ", 3); + VAL v18 = mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16); + VAL v19 = mw_mirth_c99_C99ReprType_popZ_macro(x1); + VAL v20 = mw_mirth_c99_ZPlusC99_put(v19, v18); + STR* v21; + STRLIT(v21, "();", 3); + VAL v22 = mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20); + VAL v23 = mw_mirth_c99_ZPlusC99_line(v22); + VTUP(v23)->cells[4] = MKI64(v10); + VTUP(x2)->cells[1] = v23; + VAL v24 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(x1, v6); + *x4 = v24; + *x3 = x2; } -static VAL mw_mirth_c99_ZPlusC99Local_pushZ_localZ_directZBang (VAL x1, VAL x2) { +static VAL mw_mirth_c99_ZPlusC99Value_pushZ_valueZ_directZBang (VAL x1, VAL x2) { int64_t v3; VAL v4; - mtp_mirth_c99_ZPlusC99Local_ZPlusC99Local(x2, &v3, &v4); - VAL v5 = (mw_mirth_c99_ZPlusC99_indent(x1)); - VAL v6 = mw_mirth_c99_C99ReprType_pushZ_macro(v3); - VAL v7 = (mw_mirth_c99_ZPlusC99_put(v6, v5)); - STR* v8; - STRLIT(v8, "(", 1); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7)); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(v4, v9)); + mtp_mirth_c99_ZPlusC99Value_ZPlusC99Value(x2, &v3, &v4); + int64_t v5 = VI64(VTUP(x1)->cells[3]); + VAL v6 = VVAL(VTUP(x1)->cells[1]); + int64_t v7 = VI64(VTUP(v6)->cells[4]); + VTUP(v6)->cells[4] = MKI64(v5); + VAL v8 = mw_mirth_c99_ZPlusC99_indent(v6); + VAL v9 = mw_mirth_c99_C99ReprType_pushZ_macro(v3); + VAL v10 = mw_mirth_c99_ZPlusC99_put(v9, v8); STR* v11; - STRLIT(v11, ");", 2); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v11), v10)); - VAL v13 = (mw_mirth_c99_ZPlusC99_line(v12)); - return v13; + STRLIT(v11, "(", 1); + VAL v12 = mw_mirth_c99_ZPlusC99_put(MKSTR(v11), v10); + VAL v13 = mw_mirth_c99_ZPlusC99_put(v4, v12); + STR* v14; + STRLIT(v14, ");", 2); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13); + VAL v16 = mw_mirth_c99_ZPlusC99_line(v15); + VTUP(v16)->cells[4] = MKI64(v7); + VTUP(x1)->cells[1] = v16; + return x1; } -static VAL mw_mirth_c99_ZPlusC99Local_consume (VAL x1) { +static VAL mw_mirth_c99_ZPlusC99Value_consume (VAL x1) { int64_t v2; VAL v3; - mtp_mirth_c99_ZPlusC99Local_ZPlusC99Local(x1, &v2, &v3); + mtp_mirth_c99_ZPlusC99Value_ZPlusC99Value(x1, &v2, &v3); return v3; } -static VAL mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL (VAL x1) { +static VAL mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL (VAL x1) { int64_t v2; VAL v3; - mtp_mirth_c99_ZPlusC99Local_ZPlusC99Local(x1, &v2, &v3); + mtp_mirth_c99_ZPlusC99Value_ZPlusC99Value(x1, &v2, &v3); VAL x4; switch (v2) { case 0LL: { // C99RT_VAL @@ -77729,30 +56810,30 @@ static VAL mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL (VAL x1) { STR* v5; STRLIT(v5, "", 0); VAL v6 = mw_mirth_c99_C99ReprType_mkZ_macro(v2); - VAL v7 = (mw_std_str_ZPlusStr_pushZ_strZBang(v6, MKSTR(v5))); + VAL v7 = mw_std_str_ZPlusStr_pushZ_strZBang(v6, MKSTR(v5)); STR* v8; STRLIT(v8, "(", 1); - VAL v9 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), v7)); - VAL v10 = (mw_std_str_ZPlusStr_pushZ_strZBang(v3, v9)); + VAL v9 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), v7); + VAL v10 = mw_std_str_ZPlusStr_pushZ_strZBang(v3, v9); STR* v11; STRLIT(v11, ")", 1); - VAL v12 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10)); + VAL v12 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10); x4 = v12; } break; } return x4; } -static VAL mw_mirth_c99_ZPlusC99Local_consumeZ_as (int64_t x1, VAL x2) { +static VAL mw_mirth_c99_ZPlusC99Value_consumeZ_as (int64_t x1, VAL x2) { VAL x3; switch (x1) { case 0LL: { // C99RT_VAL - VAL v4 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(x2); + VAL v4 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(x2); x3 = v4; } break; default: { int64_t v5; VAL v6; - mtp_mirth_c99_ZPlusC99Local_ZPlusC99Local(x2, &v5, &v6); + mtp_mirth_c99_ZPlusC99Value_ZPlusC99Value(x2, &v5, &v6); int64_t x7; VAL x8; switch (v5) { @@ -77760,14 +56841,14 @@ static VAL mw_mirth_c99_ZPlusC99Local_consumeZ_as (int64_t x1, VAL x2) { STR* v9; STRLIT(v9, "", 0); VAL v10 = mw_mirth_c99_C99ReprType_vZ_macro(x1); - VAL v11 = (mw_std_str_ZPlusStr_pushZ_strZBang(v10, MKSTR(v9))); + VAL v11 = mw_std_str_ZPlusStr_pushZ_strZBang(v10, MKSTR(v9)); STR* v12; STRLIT(v12, "(", 1); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11)); - VAL v14 = (mw_std_str_ZPlusStr_pushZ_strZBang(v6, v13)); + VAL v13 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11); + VAL v14 = mw_std_str_ZPlusStr_pushZ_strZBang(v6, v13); STR* v15; STRLIT(v15, ")", 1); - VAL v16 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v15), v14)); + VAL v16 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v15), v14); x8 = v16; x7 = v5; } break; @@ -77789,16 +56870,16 @@ static VAL mw_mirth_c99_ZPlusC99Local_consumeZ_as (int64_t x1, VAL x2) { STRLIT(v25, "", 0); STR* v26; STRLIT(v26, "((", 2); - VAL v27 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v26), MKSTR(v25))); + VAL v27 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v26), MKSTR(v25)); VAL v28 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x1); - VAL v29 = (mw_std_str_ZPlusStr_pushZ_strZBang(v28, v27)); + VAL v29 = mw_std_str_ZPlusStr_pushZ_strZBang(v28, v27); STR* v30; STRLIT(v30, ")", 1); - VAL v31 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v30), v29)); - VAL v32 = (mw_std_str_ZPlusStr_pushZ_strZBang(v6, v31)); + VAL v31 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v30), v29); + VAL v32 = mw_std_str_ZPlusStr_pushZ_strZBang(v6, v31); STR* v33; STRLIT(v33, ")", 1); - VAL v34 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v33), v32)); + VAL v34 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v33), v32); x24 = v34; x23 = v5; } else { @@ -77806,16 +56887,16 @@ static VAL mw_mirth_c99_ZPlusC99Local_consumeZ_as (int64_t x1, VAL x2) { STRLIT(v35, "", 0); STR* v36; STRLIT(v36, "(\n#error \"attempted to cast ", 28); - VAL v37 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v36), MKSTR(v35))); - VAL v38 = (mw_std_str_ZPlusStr_pushZ_strZBang(v6, v37)); + VAL v37 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v36), MKSTR(v35)); + VAL v38 = mw_std_str_ZPlusStr_pushZ_strZBang(v6, v37); STR* v39; STRLIT(v39, " to incompatible C99 repr type ", 31); - VAL v40 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v39), v38)); + VAL v40 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v39), v38); VAL v41 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x1); - VAL v42 = (mw_std_str_ZPlusStr_pushZ_strZBang(v41, v40)); + VAL v42 = mw_std_str_ZPlusStr_pushZ_strZBang(v41, v40); STR* v43; STRLIT(v43, "\"\n", 2); - VAL v44 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v43), v42)); + VAL v44 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v43), v42); x24 = v44; x23 = v5; } @@ -77831,31 +56912,31 @@ static VAL mw_mirth_c99_ZPlusC99Local_consumeZ_as (int64_t x1, VAL x2) { } return x3; } -static VAL mw_mirth_c99_ZPlusC99Local_dropZ_localZBang (VAL x1, VAL x2) { +static VAL mw_mirth_c99_ZPlusC99Value_dropZ_valueZBang (VAL x1, VAL x2) { int64_t v3 = VI64(VTUP(x2)->cells[1]); int64_t v4 = mw_mirth_c99_C99ReprType_needsZ_refcountingZAsk(v3); VAL x5; if (((bool)v4)) { - VAL v6 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(x2); - VAL v7 = (VVAL(VTUP(x1)->cells[1])); - VAL v8 = (mw_mirth_c99_ZPlusC99_indent(v7)); + VAL v6 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(x2); + VAL v7 = VVAL(VTUP(x1)->cells[1]); + VAL v8 = mw_mirth_c99_ZPlusC99_indent(v7); STR* v9; STRLIT(v9, "decref(", 7); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8)); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(v6, v10)); + VAL v10 = mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8); + VAL v11 = mw_mirth_c99_ZPlusC99_put(v6, v10); STR* v12; STRLIT(v12, ");", 2); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11)); - VAL v14 = (mw_mirth_c99_ZPlusC99_line(v13)); + VAL v13 = mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11); + VAL v14 = mw_mirth_c99_ZPlusC99_line(v13); VTUP(x1)->cells[1] = v14; x5 = x1; } else { - mw_mirth_c99_ZPlusC99Local_rdrop(x2); + mw_mirth_c99_ZPlusC99Value_rdrop(x2); x5 = x1; } return x5; } -static void mw_mirth_c99_ZPlusC99Local_dupZ_localZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { +static void mw_mirth_c99_ZPlusC99Value_dupZ_valueZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { int64_t v6 = VI64(VTUP(x2)->cells[1]); int64_t v7 = mw_mirth_c99_C99ReprType_needsZ_refcountingZAsk(v6); VAL x8; @@ -77863,18 +56944,18 @@ static void mw_mirth_c99_ZPlusC99Local_dupZ_localZBang (VAL x1, VAL x2, VAL *x3, if (((bool)v7)) { VAL v10; VAL v11; - mw_mirth_c99_ZPlusC99Local_rdup(x2, &v10, &v11); - VAL v12 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v11); - VAL v13 = (VVAL(VTUP(x1)->cells[1])); - VAL v14 = (mw_mirth_c99_ZPlusC99_indent(v13)); + mw_mirth_c99_ZPlusC99Value_rdup(x2, &v10, &v11); + VAL v12 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v11); + VAL v13 = VVAL(VTUP(x1)->cells[1]); + VAL v14 = mw_mirth_c99_ZPlusC99_indent(v13); STR* v15; STRLIT(v15, "incref(", 7); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14)); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(v12, v16)); + VAL v16 = mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14); + VAL v17 = mw_mirth_c99_ZPlusC99_put(v12, v16); STR* v18; STRLIT(v18, ");", 2); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17)); - VAL v20 = (mw_mirth_c99_ZPlusC99_line(v19)); + VAL v19 = mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17); + VAL v20 = mw_mirth_c99_ZPlusC99_line(v19); VTUP(x1)->cells[1] = v20; x9 = v10; x8 = x1; @@ -77884,12 +56965,12 @@ static void mw_mirth_c99_ZPlusC99Local_dupZ_localZBang (VAL x1, VAL x2, VAL *x3, } VAL v21; VAL v22; - mw_mirth_c99_ZPlusC99Local_rdup(x9, &v21, &v22); + mw_mirth_c99_ZPlusC99Value_rdup(x9, &v21, &v22); *x5 = v22; *x4 = v21; *x3 = x8; } -static void mw_mirth_c99_ZPlusC99Local_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3) { +static void mw_mirth_c99_ZPlusC99Value_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3) { int64_t v4 = VI64(VTUP(x1)->cells[1]); VAL x5; VAL x6; @@ -77897,83 +56978,75 @@ static void mw_mirth_c99_ZPlusC99Local_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3 case 0LL: { // C99RT_VAL VAL v7 = VVAL(VTUP(x1)->cells[2]); incref(v7); - STR* v8; - STRLIT(v8, "", 0); - STR* v9; - STRLIT(v9, "get_data_tag(", 13); - VAL v10 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v9), MKSTR(v8))); - VAL v11 = (mw_std_str_ZPlusStr_pushZ_strZBang(v7, v10)); - STR* v12; - STRLIT(v12, ")", 1); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11)); - x6 = v13; + VAL v8 = mw_std_str_Str_1_sp14(v7); + x6 = v8; x5 = x1; } break; default: { - VAL v14 = VVAL(VTUP(x1)->cells[2]); - incref(v14); - x6 = v14; + VAL v9 = VVAL(VTUP(x1)->cells[2]); + incref(v9); + x6 = v9; x5 = x1; } break; } *x3 = x6; *x2 = x5; } -static void mw_mirth_c99_ZPlusC99LocalResource_rdup (VAL x1, VAL *x2, VAL *x3) { +static void mw_mirth_c99_ZPlusC99Resource_rdup (VAL x1, VAL *x2, VAL *x3) { int64_t v4 = VI64(VTUP(x1)->cells[1]); VAL v5 = VVAL(VTUP(x1)->cells[2]); incref(v5); - VAL v6 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v4, v5)); + VAL v6 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v4, v5); *x3 = v6; *x2 = x1; } -static void mw_mirth_c99_ZPlusC99LocalResource_rdrop (VAL x1) { - VAL v2 = mw_mirth_c99_ZPlusC99LocalResource_consume(x1); +static void mw_mirth_c99_ZPlusC99Resource_rdrop (VAL x1) { + VAL v2 = mw_mirth_c99_ZPlusC99Resource_consume(x1); decref(v2); } -static VAL mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang (VAL x1) { +static VAL mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang (VAL x1) { int64_t v2; VAL v3; - mtp_mirth_c99_ZPlusC99Local_ZPlusC99Local(x1, &v2, &v3); - VAL v4 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v2, v3)); + mtp_mirth_c99_ZPlusC99Value_ZPlusC99Value(x1, &v2, &v3); + VAL v4 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v2, v3); return v4; } -static VAL mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang (VAL x1) { +static VAL mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang (VAL x1) { int64_t v2; VAL v3; - mtp_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(x1, &v2, &v3); - VAL v4 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v2, v3)); + mtp_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(x1, &v2, &v3); + VAL v4 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v2, v3); return v4; } -static VAL mw_mirth_c99_ZPlusC99LocalResource_dropZ_localZ_resourceZ_asZ_valueZBang (VAL x1, VAL x2) { - VAL v3 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(x2)); - VAL v4 = (mw_mirth_c99_ZPlusC99Local_dropZ_localZBang(x1, v3)); +static VAL mw_mirth_c99_ZPlusC99Resource_dropZ_resourceZ_asZ_valueZBang (VAL x1, VAL x2) { + VAL v3 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(x2); + VAL v4 = mw_mirth_c99_ZPlusC99Value_dropZ_valueZBang(x1, v3); return v4; } -static void mw_mirth_c99_ZPlusC99LocalResource_dupZ_localZ_resourceZ_asZ_valueZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { +static void mw_mirth_c99_ZPlusC99Resource_dupZ_resourceZ_asZ_valueZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { VAL v6; VAL v7; - mw_mirth_c99_ZPlusC99LocalResource_rdup(x2, &v6, &v7); - VAL v8 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(v7)); + mw_mirth_c99_ZPlusC99Resource_rdup(x2, &v6, &v7); + VAL v8 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(v7); VAL v9; VAL v10; VAL v11; - mw_mirth_c99_ZPlusC99Local_dupZ_localZBang(x1, v8, &v9, &v10, &v11); - mw_mirth_c99_ZPlusC99Local_rdrop(v11); + mw_mirth_c99_ZPlusC99Value_dupZ_valueZBang(x1, v8, &v9, &v10, &v11); + mw_mirth_c99_ZPlusC99Value_rdrop(v11); *x5 = v10; *x4 = v6; *x3 = v9; } -static VAL mw_mirth_c99_ZPlusC99LocalResource_consume (VAL x1) { +static VAL mw_mirth_c99_ZPlusC99Resource_consume (VAL x1) { int64_t v2; VAL v3; - mtp_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(x1, &v2, &v3); + mtp_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(x1, &v2, &v3); return v3; } -static VAL mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL (VAL x1) { +static VAL mw_mirth_c99_ZPlusC99Resource_consumeZ_asZ_VAL (VAL x1) { int64_t v2; VAL v3; - mtp_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(x1, &v2, &v3); + mtp_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(x1, &v2, &v3); VAL x4; switch (v2) { case 0LL: { // C99RT_VAL @@ -77983,99 +57056,113 @@ static VAL mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL (VAL x1) { STR* v5; STRLIT(v5, "", 0); VAL v6 = mw_mirth_c99_C99ReprType_mkZ_macro(v2); - VAL v7 = (mw_std_str_ZPlusStr_pushZ_strZBang(v6, MKSTR(v5))); + VAL v7 = mw_std_str_ZPlusStr_pushZ_strZBang(v6, MKSTR(v5)); STR* v8; STRLIT(v8, "(", 1); - VAL v9 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), v7)); - VAL v10 = (mw_std_str_ZPlusStr_pushZ_strZBang(v3, v9)); + VAL v9 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v8), v7); + VAL v10 = mw_std_str_ZPlusStr_pushZ_strZBang(v3, v9); STR* v11; STRLIT(v11, ")", 1); - VAL v12 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10)); + VAL v12 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v11), v10); x4 = v12; } break; } return x4; } -static void mw_mirth_c99_ZPlusC99_popZ_localZ_resourceZ_directZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4) { - VAL v5; +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_directZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x1)->cells[1]); VAL v6; - mw_mirth_c99_ZPlusC99_freshZ_resourceZ_nameZBang(x1, &v5, &v6); - VAL v7 = (mw_mirth_c99_ZPlusC99_indent(v6)); - VAL v8 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x2); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(v8, v7)); - STR* v10; - STRLIT(v10, " ", 1); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v10), v9)); - incref(v5); - VAL v12 = (mw_mirth_c99_ZPlusC99_put(v5, v11)); - STR* v13; - STRLIT(v13, " = ", 3); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12)); - VAL x15; - int64_t x16; - VAL x17; + VAL v7; + mw_mirth_c99_ZPlusC99_freshZ_resourceZ_nameZBang(v5, &v6, &v7); + VTUP(x1)->cells[1] = v7; + int64_t v8 = VI64(VTUP(x1)->cells[3]); + VAL v9 = VVAL(VTUP(x1)->cells[1]); + int64_t v10 = VI64(VTUP(v9)->cells[4]); + VTUP(v9)->cells[4] = MKI64(v8); + VAL v11 = mw_mirth_c99_ZPlusC99_indent(v9); + VAL v12 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x2); + VAL v13 = mw_mirth_c99_ZPlusC99_put(v12, v11); + STR* v14; + STRLIT(v14, " ", 1); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13); + incref(v6); + VAL v16 = mw_mirth_c99_ZPlusC99_put(v6, v15); + STR* v17; + STRLIT(v17, " = ", 3); + VAL v18 = mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16); + VAL x19; + int64_t x20; + VAL x21; switch (x2) { case 0LL: { // C99RT_VAL - STR* v18; - STRLIT(v18, "pop_resource()", 14); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v14)); - x17 = v19; - x16 = x2; - x15 = v5; + STR* v22; + STRLIT(v22, "pop_resource()", 14); + VAL v23 = mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v18); + x21 = v23; + x20 = x2; + x19 = v6; } break; default: { - VAL v20 = mw_mirth_c99_C99ReprType_vZ_macro(x2); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(v20, v14)); - STR* v22; - STRLIT(v22, "(pop_resource())", 16); - VAL v23 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v21)); - x17 = v23; - x16 = x2; - x15 = v5; + VAL v24 = mw_mirth_c99_C99ReprType_vZ_macro(x2); + VAL v25 = mw_mirth_c99_ZPlusC99_put(v24, v18); + STR* v26; + STRLIT(v26, "(pop_resource())", 16); + VAL v27 = mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v25); + x21 = v27; + x20 = x2; + x19 = v6; } break; } - STR* v24; - STRLIT(v24, ";", 1); - VAL v25 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v24), x17)); - VAL v26 = (mw_mirth_c99_ZPlusC99_line(v25)); - VAL v27 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(x16, x15)); - *x4 = v27; - *x3 = v26; -} -static VAL mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZ_directZBang (VAL x1, VAL x2) { + STR* v28; + STRLIT(v28, ";", 1); + VAL v29 = mw_mirth_c99_ZPlusC99_put(MKSTR(v28), x21); + VAL v30 = mw_mirth_c99_ZPlusC99_line(v29); + VTUP(v30)->cells[4] = MKI64(v10); + VTUP(x1)->cells[1] = v30; + VAL v31 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(x20, x19); + *x4 = v31; + *x3 = x1; +} +static VAL mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZ_directZBang (VAL x1, VAL x2) { int64_t v3; VAL v4; - mtp_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(x2, &v3, &v4); - VAL v5 = (mw_mirth_c99_ZPlusC99_indent(x1)); - STR* v6; - STRLIT(v6, "push_resource(", 14); - VAL v7 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5)); - VAL x8; + mtp_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(x2, &v3, &v4); + int64_t v5 = VI64(VTUP(x1)->cells[3]); + VAL v6 = VVAL(VTUP(x1)->cells[1]); + int64_t v7 = VI64(VTUP(v6)->cells[4]); + VTUP(v6)->cells[4] = MKI64(v5); + VAL v8 = mw_mirth_c99_ZPlusC99_indent(v6); + STR* v9; + STRLIT(v9, "push_resource(", 14); + VAL v10 = mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8); + VAL x11; switch (v3) { case 0LL: { // C99RT_VAL - VAL v9 = (mw_mirth_c99_ZPlusC99_put(v4, v7)); - x8 = v9; + VAL v12 = mw_mirth_c99_ZPlusC99_put(v4, v10); + x11 = v12; } break; default: { - VAL v10 = mw_mirth_c99_C99ReprType_mkZ_macro(v3); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(v10, v7)); - STR* v12; - STRLIT(v12, "(", 1); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11)); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(v4, v13)); + VAL v13 = mw_mirth_c99_C99ReprType_mkZ_macro(v3); + VAL v14 = mw_mirth_c99_ZPlusC99_put(v13, v10); STR* v15; - STRLIT(v15, ")", 1); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14)); - x8 = v16; + STRLIT(v15, "(", 1); + VAL v16 = mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14); + VAL v17 = mw_mirth_c99_ZPlusC99_put(v4, v16); + STR* v18; + STRLIT(v18, ")", 1); + VAL v19 = mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17); + x11 = v19; } break; } - STR* v17; - STRLIT(v17, ");", 2); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v17), x8)); - VAL v19 = (mw_mirth_c99_ZPlusC99_line(v18)); - return v19; + STR* v20; + STRLIT(v20, ");", 2); + VAL v21 = mw_mirth_c99_ZPlusC99_put(MKSTR(v20), x11); + VAL v22 = mw_mirth_c99_ZPlusC99_line(v21); + VTUP(v22)->cells[4] = MKI64(v7); + VTUP(x1)->cells[1] = v22; + return x1; } -static void mw_mirth_c99_ZPlusC99LocalResource_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3) { +static void mw_mirth_c99_ZPlusC99Resource_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3) { int64_t v4 = VI64(VTUP(x1)->cells[1]); VAL x5; VAL x6; @@ -78083,39 +57170,31 @@ static void mw_mirth_c99_ZPlusC99LocalResource_peekZ_dataZ_tag (VAL x1, VAL *x2, case 0LL: { // C99RT_VAL VAL v7 = VVAL(VTUP(x1)->cells[2]); incref(v7); - STR* v8; - STRLIT(v8, "", 0); - STR* v9; - STRLIT(v9, "get_data_tag(", 13); - VAL v10 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v9), MKSTR(v8))); - VAL v11 = (mw_std_str_ZPlusStr_pushZ_strZBang(v7, v10)); - STR* v12; - STRLIT(v12, ")", 1); - VAL v13 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v12), v11)); - x6 = v13; + VAL v8 = mw_std_str_Str_1_sp14(v7); + x6 = v8; x5 = x1; } break; default: { - VAL v14 = VVAL(VTUP(x1)->cells[2]); - incref(v14); - x6 = v14; + VAL v9 = VVAL(VTUP(x1)->cells[2]); + incref(v9); + x6 = v9; x5 = x1; } break; } *x3 = x6; *x2 = x5; } -static VAL mw_mirth_c99_ZPlusC99LocalValueZDivResource_pushZ_localZ_valueZDivresourceZBang (VAL x1, VAL x2) { +static VAL mw_mirth_c99_ZPlusC99ValueZDivResource_pushZ_valueZ_valueZDivresourceZBang (VAL x1, VAL x2) { VAL x3; switch (get_data_tag(x2)) { case 0LL: { // +Left - VAL v4 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(x2)); - VAL v5 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x1, v4)); + VAL v4 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(x2); + VAL v5 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x1, v4); x3 = v5; } break; case 1LL: { // +Right - VAL v6 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(x2)); - VAL v7 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(x1, v6)); + VAL v6 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(x2); + VAL v7 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(x1, v6); x3 = v7; } break; default: { @@ -78124,25 +57203,25 @@ static VAL mw_mirth_c99_ZPlusC99LocalValueZDivResource_pushZ_localZ_valueZDivres } return x3; } -static void mw_mirth_c99_ZPlusC99LocalValueZDivResource_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3) { +static void mw_mirth_c99_ZPlusC99ValueZDivResource_peekZ_dataZ_tag (VAL x1, VAL *x2, VAL *x3) { VAL x4; VAL x5; switch (get_data_tag(x1)) { case 0LL: { // +Left - VAL v6 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(x1)); + VAL v6 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(x1); VAL v7; VAL v8; - mw_mirth_c99_ZPlusC99Local_peekZ_dataZ_tag(v6, &v7, &v8); - VAL v9 = (mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(v7)); + mw_mirth_c99_ZPlusC99Value_peekZ_dataZ_tag(v6, &v7, &v8); + VAL v9 = mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(v7); x5 = v8; x4 = v9; } break; case 1LL: { // +Right - VAL v10 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(x1)); + VAL v10 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(x1); VAL v11; VAL v12; - mw_mirth_c99_ZPlusC99LocalResource_peekZ_dataZ_tag(v10, &v11, &v12); - VAL v13 = (mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(v11)); + mw_mirth_c99_ZPlusC99Resource_peekZ_dataZ_tag(v10, &v11, &v12); + VAL v13 = mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(v11); x5 = v12; x4 = v13; } break; @@ -78153,27 +57232,27 @@ static void mw_mirth_c99_ZPlusC99LocalValueZDivResource_peekZ_dataZ_tag (VAL x1, *x3 = x5; *x2 = x4; } -static void mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdup (VAL x1, VAL *x2, VAL *x3) { +static void mw_mirth_c99_ZPlusC99ValueZDivResource_rdup (VAL x1, VAL *x2, VAL *x3) { VAL x4; VAL x5; switch (get_data_tag(x1)) { case 0LL: { // +Left - VAL v6 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(x1)); + VAL v6 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(x1); VAL v7; VAL v8; - mw_mirth_c99_ZPlusC99Local_rdup(v6, &v7, &v8); - VAL v9 = (mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(v8)); - VAL v10 = (mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(v7)); + mw_mirth_c99_ZPlusC99Value_rdup(v6, &v7, &v8); + VAL v9 = mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(v8); + VAL v10 = mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(v7); x5 = v9; x4 = v10; } break; case 1LL: { // +Right - VAL v11 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(x1)); + VAL v11 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(x1); VAL v12; VAL v13; - mw_mirth_c99_ZPlusC99LocalResource_rdup(v11, &v12, &v13); - VAL v14 = (mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(v13)); - VAL v15 = (mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(v12)); + mw_mirth_c99_ZPlusC99Resource_rdup(v11, &v12, &v13); + VAL v14 = mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(v13); + VAL v15 = mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(v12); x5 = v14; x4 = v15; } break; @@ -78184,32 +57263,32 @@ static void mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdup (VAL x1, VAL *x2, V *x3 = x5; *x2 = x4; } -static void mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdrop (VAL x1) { +static void mw_mirth_c99_ZPlusC99ValueZDivResource_rdrop (VAL x1) { switch (get_data_tag(x1)) { case 0LL: { // +Left - VAL v2 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(x1)); - mw_mirth_c99_ZPlusC99Local_rdrop(v2); + VAL v2 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(x1); + mw_mirth_c99_ZPlusC99Value_rdrop(v2); } break; case 1LL: { // +Right - VAL v3 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(x1)); - mw_mirth_c99_ZPlusC99LocalResource_rdrop(v3); + VAL v3 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(x1); + mw_mirth_c99_ZPlusC99Resource_rdrop(v3); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } } -static VAL mw_mirth_c99_ZPlusC99LocalValueZDivResource_consumeZ_asZ_VAL (VAL x1) { +static VAL mw_mirth_c99_ZPlusC99ValueZDivResource_consumeZ_asZ_VAL (VAL x1) { VAL x2; switch (get_data_tag(x1)) { case 0LL: { // +Left - VAL v3 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(x1)); - VAL v4 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v3); + VAL v3 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(x1); + VAL v4 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v3); x2 = v4; } break; case 1LL: { // +Right - VAL v5 = (mtp_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(x1)); - VAL v6 = mw_mirth_c99_ZPlusC99LocalResource_consumeZ_asZ_VAL(v5); + VAL v5 = mtp_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(x1); + VAL v6 = mw_mirth_c99_ZPlusC99Resource_consumeZ_asZ_VAL(v5); x2 = v6; } break; default: { @@ -78218,38 +57297,30 @@ static VAL mw_mirth_c99_ZPlusC99LocalValueZDivResource_consumeZ_asZ_VAL (VAL x1) } return x2; } -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_valueZDivresourceZ_dataZBang (uint64_t x1, VAL x2, VAL *x3, VAL *x4) { +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_valueZDivresourceZ_dataZBang (uint64_t x1, VAL x2, VAL *x3, VAL *x4) { int64_t v5 = mw_mirth_data_Data_isZ_resourceZAsk(x1); VAL x6; VAL x7; if (((bool)v5)) { - VAL v8 = (VVAL(VTUP(x2)->cells[1])); - VAL v9 = (VVAL(VTUP(v8)->cells[6])); - int64_t v10; + int64_t v8; + VAL v9; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp7(x1, x2, &v8, &v9); + VAL v10; VAL v11; - mw_mirth_data_Data_c99Z_repr(x1, v9, &v10, &v11); - VTUP(v8)->cells[6] = v11; - VTUP(x2)->cells[1] = v8; - VAL v12; - VAL v13; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(x2, v10, &v12, &v13); - VAL v14 = (mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusRight(v13)); - x7 = v14; - x6 = v12; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v9, v8, &v10, &v11); + VAL v12 = mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusRight(v11); + x7 = v12; + x6 = v10; } else { - VAL v15 = (VVAL(VTUP(x2)->cells[1])); - VAL v16 = (VVAL(VTUP(v15)->cells[6])); - int64_t v17; - VAL v18; - mw_mirth_data_Data_c99Z_repr(x1, v16, &v17, &v18); - VTUP(v15)->cells[6] = v18; - VTUP(x2)->cells[1] = v15; - VAL v19; - VAL v20; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x2, v17, &v19, &v20); - VAL v21 = (mtw_mirth_c99_ZPlusC99LocalValueZDivResource_ZPlusLeft(v20)); - x7 = v21; - x6 = v19; + int64_t v13; + VAL v14; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp7(x1, x2, &v13, &v14); + VAL v15; + VAL v16; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v14, v13, &v15, &v16); + VAL v17 = mtw_mirth_c99_ZPlusC99ValueZDivResource_ZPlusLeft(v16); + x7 = v17; + x6 = v15; } *x4 = x7; *x3 = x6; @@ -78257,297 +57328,278 @@ static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_valueZDivresourceZ_dataZBang static VAL mw_mirth_c99_ZPlusC99Branch_refreshZ_branchZBang (VAL x1) { VAL v2; VAL v3; - mtp_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(x1, &v2, &v3); - VAL v4 = (mw_mirth_c99_ZPlusC99StackCache_refreshZ_allZBang(v2, v3)); - return v4; + int64_t v4; + mtp_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(x1, &v2, &v3, &v4); + VAL v5 = mw_mirth_c99_ZPlusC99Stack_refreshZ_allZBang(v2, v3, v4); + return v5; } -static VAL mw_mirth_c99_ZPlusC99StackCache_refreshZ_allZBang (VAL x1, VAL x2) { - VAL x3; +static VAL mw_mirth_c99_ZPlusC99Stack_refreshZ_allZBang (VAL x1, VAL x2, int64_t x3) { + VAL x4; switch (get_data_tag(x2)) { - case 0LL: { // +SCNil - VAL v4 = (mw_mirth_c99_ZPlusC99_startZ_branchZBang(x1)); - x3 = v4; + case 0LL: { // +SNil + VAL v5 = mw_mirth_c99_ZPlusC99_startZ_branchZBang(x1, x3); + x4 = v5; } break; - case 1LL: { // +SCCons - VAL v5; + case 1LL: { // +SCons VAL v6; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(x2, &v5, &v6); - VAL v7 = (mw_mirth_c99_ZPlusC99StackCache_refreshZ_allZBang(x1, v5)); - int64_t v8 = VI64(VTUP(v6)->cells[1]); - VAL v9 = (VVAL(VTUP(v7)->cells[1])); + VAL v7; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(x2, &v6, &v7); + VAL v8 = mw_mirth_c99_ZPlusC99Stack_refreshZ_allZBang(x1, v6, x3); + int64_t v9 = VI64(VTUP(v7)->cells[1]); VAL v10; VAL v11; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v9, &v10, &v11); - VAL v12 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v8, v10)); - VAL v13 = (mw_mirth_c99_ZPlusC99_indent(v11)); - int64_t v14 = VI64(VTUP(v12)->cells[1]); - VAL v15 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v14); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(v15, v13)); - STR* v17; - STRLIT(v17, " ", 1); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16)); - VAL v19 = VVAL(VTUP(v12)->cells[2]); - incref(v19); - VAL v20 = (mw_mirth_c99_ZPlusC99_put(v19, v18)); - STR* v21; - STRLIT(v21, " = ", 3); - VAL v22 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20)); - VAL v23 = mw_mirth_c99_ZPlusC99Local_consume(v6); - VAL v24 = (mw_mirth_c99_ZPlusC99_put(v23, v22)); - STR* v25; - STRLIT(v25, ";", 1); - VAL v26 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v24)); - VAL v27 = (mw_mirth_c99_ZPlusC99_line(v26)); - VTUP(v7)->cells[1] = v27; - VAL v28 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v7, v12)); - x3 = v28; + mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp22(v7, v8, v9, &v10, &v11); + VAL v12 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v10, v11); + x4 = v12; } break; - case 2LL: { // +SCWith - VAL v29; - VAL v30; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(x2, &v29, &v30); - VAL v31 = (mw_mirth_c99_ZPlusC99StackCache_refreshZ_allZBang(x1, v29)); - int64_t v32 = VI64(VTUP(v30)->cells[1]); - VAL v33 = (VVAL(VTUP(v31)->cells[1])); - VAL v34; - VAL v35; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v33, &v34, &v35); - VAL v36 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v32, v34)); - VAL v37 = (mw_mirth_c99_ZPlusC99_indent(v35)); - int64_t v38 = VI64(VTUP(v36)->cells[1]); - VAL v39 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v38); - VAL v40 = (mw_mirth_c99_ZPlusC99_put(v39, v37)); - STR* v41; - STRLIT(v41, " ", 1); - VAL v42 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v41), v40)); - VAL v43 = VVAL(VTUP(v36)->cells[2]); - incref(v43); - VAL v44 = (mw_mirth_c99_ZPlusC99_put(v43, v42)); - STR* v45; - STRLIT(v45, " = (", 4); - VAL v46 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v45), v44)); - VAL v47 = mw_mirth_c99_ZPlusC99LocalResource_consume(v30); - VAL v48 = (mw_mirth_c99_ZPlusC99_put(v47, v46)); - STR* v49; - STRLIT(v49, ");", 2); - VAL v50 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v49), v48)); - VAL v51 = (mw_mirth_c99_ZPlusC99_line(v50)); - VTUP(v31)->cells[1] = v51; - VAL v52 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v31, v36)); - x3 = v52; - } break; - case 3LL: { // +SCConsLabel - VAL v53; - VAL v54; - uint64_t v55; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(x2, &v53, &v54, &v55); - VAL v56 = (mw_mirth_c99_ZPlusC99StackCache_refreshZ_allZBang(x1, v53)); - int64_t v57 = VI64(VTUP(v54)->cells[1]); - VAL v58 = (VVAL(VTUP(v56)->cells[1])); - VAL v59; - VAL v60; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v58, &v59, &v60); - VAL v61 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v57, v59)); - VAL v62 = (mw_mirth_c99_ZPlusC99_indent(v60)); - int64_t v63 = VI64(VTUP(v61)->cells[1]); - VAL v64 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v63); - VAL v65 = (mw_mirth_c99_ZPlusC99_put(v64, v62)); - STR* v66; - STRLIT(v66, " ", 1); - VAL v67 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v66), v65)); - VAL v68 = VVAL(VTUP(v61)->cells[2]); - incref(v68); - VAL v69 = (mw_mirth_c99_ZPlusC99_put(v68, v67)); - STR* v70; - STRLIT(v70, " = ", 3); - VAL v71 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v70), v69)); - VAL v72 = mw_mirth_c99_ZPlusC99Local_consume(v54); - VAL v73 = (mw_mirth_c99_ZPlusC99_put(v72, v71)); - STR* v74; - STRLIT(v74, ";", 1); - VAL v75 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v73)); - VAL v76 = (mw_mirth_c99_ZPlusC99_line(v75)); - VTUP(v56)->cells[1] = v76; - int64_t v77 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(v55); - VAL x78; - if (((bool)v77)) { - VAL v79 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v61)); - VAL v80 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v55, v56, v79)); - x78 = v80; + case 2LL: { // +SWith + VAL v13; + VAL v14; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(x2, &v13, &v14); + VAL v15 = mw_mirth_c99_ZPlusC99Stack_refreshZ_allZBang(x1, v13, x3); + int64_t v16 = VI64(VTUP(v14)->cells[1]); + VAL v17 = VVAL(VTUP(v15)->cells[1]); + VAL v18; + VAL v19; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v17, &v18, &v19); + VTUP(v15)->cells[1] = v19; + int64_t v20 = VI64(VTUP(v15)->cells[3]); + VAL v21 = VVAL(VTUP(v15)->cells[1]); + int64_t v22 = VI64(VTUP(v21)->cells[4]); + VTUP(v21)->cells[4] = MKI64(v20); + VAL v23 = mw_mirth_c99_ZPlusC99_indent(v21); + VAL v24 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v16); + VAL v25 = mw_mirth_c99_ZPlusC99_put(v24, v23); + STR* v26; + STRLIT(v26, " ", 1); + VAL v27 = mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v25); + incref(v18); + VAL v28 = mw_mirth_c99_ZPlusC99_put(v18, v27); + STR* v29; + STRLIT(v29, " = ", 3); + VAL v30 = mw_mirth_c99_ZPlusC99_put(MKSTR(v29), v28); + VAL v31 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v16, v18); + VAL v32 = mw_mirth_c99_ZPlusC99Resource_consume(v14); + VAL v33 = mw_mirth_c99_ZPlusC99_put(v32, v30); + STR* v34; + STRLIT(v34, ";", 1); + VAL v35 = mw_mirth_c99_ZPlusC99_put(MKSTR(v34), v33); + VAL v36 = mw_mirth_c99_ZPlusC99_line(v35); + VTUP(v36)->cells[4] = MKI64(v22); + VTUP(v15)->cells[1] = v36; + VAL v37 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v15, v31); + x4 = v37; + } break; + case 3LL: { // +SConsLabel + VAL v38; + VAL v39; + uint64_t v40; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x2, &v38, &v39, &v40); + VAL v41 = mw_mirth_c99_ZPlusC99Stack_refreshZ_allZBang(x1, v38, x3); + int64_t v42 = VI64(VTUP(v39)->cells[1]); + VAL v43; + VAL v44; + mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp22(v39, v41, v42, &v43, &v44); + int64_t v45 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(v40); + VAL x46; + if (((bool)v45)) { + VAL v47 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v44); + VAL v48 = mw_mirth_c99_pushZ_resourceZ_labelZBang(v40, v43, v47); + x46 = v48; } else { - VAL v81 = (mw_mirth_c99_pushZ_localZ_labelZBang(v55, v56, v61)); - x78 = v81; + VAL v49 = mw_mirth_c99_pushZ_valueZ_labelZBang(v40, v43, v44); + x46 = v49; } - x3 = x78; + x4 = x46; } break; - case 4LL: { // +SCWithLabel - VAL v82; - VAL v83; - uint64_t v84; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(x2, &v82, &v83, &v84); - VAL v85 = (mw_mirth_c99_ZPlusC99StackCache_refreshZ_allZBang(x1, v82)); - int64_t v86 = VI64(VTUP(v83)->cells[1]); - VAL v87 = (VVAL(VTUP(v85)->cells[1])); - VAL v88; - VAL v89; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v87, &v88, &v89); - VAL v90 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v86, v88)); - VAL v91 = (mw_mirth_c99_ZPlusC99_indent(v89)); - int64_t v92 = VI64(VTUP(v90)->cells[1]); - VAL v93 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v92); - VAL v94 = (mw_mirth_c99_ZPlusC99_put(v93, v91)); - STR* v95; - STRLIT(v95, " ", 1); - VAL v96 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v95), v94)); - VAL v97 = VVAL(VTUP(v90)->cells[2]); - incref(v97); - VAL v98 = (mw_mirth_c99_ZPlusC99_put(v97, v96)); - STR* v99; - STRLIT(v99, " = ", 3); - VAL v100 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v99), v98)); - VAL v101 = mw_mirth_c99_ZPlusC99LocalResource_consume(v83); - VAL v102 = (mw_mirth_c99_ZPlusC99_put(v101, v100)); - STR* v103; - STRLIT(v103, ";", 1); - VAL v104 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v103), v102)); - VAL v105 = (mw_mirth_c99_ZPlusC99_line(v104)); - VTUP(v85)->cells[1] = v105; - int64_t v106 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(v84); - VAL x107; - if (((bool)v106)) { - VAL v108 = (mw_mirth_c99_ZPlusC99Local_turnZ_intoZ_resourceZBang(v90)); - VAL v109 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v84, v85, v108)); - x107 = v109; + case 4LL: { // +SWithLabel + VAL v50; + VAL v51; + uint64_t v52; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x2, &v50, &v51, &v52); + VAL v53 = mw_mirth_c99_ZPlusC99Stack_refreshZ_allZBang(x1, v50, x3); + int64_t v54 = VI64(VTUP(v51)->cells[1]); + VAL v55 = VVAL(VTUP(v53)->cells[1]); + VAL v56; + VAL v57; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v55, &v56, &v57); + VTUP(v53)->cells[1] = v57; + int64_t v58 = VI64(VTUP(v53)->cells[3]); + VAL v59 = VVAL(VTUP(v53)->cells[1]); + int64_t v60 = VI64(VTUP(v59)->cells[4]); + VTUP(v59)->cells[4] = MKI64(v58); + VAL v61 = mw_mirth_c99_ZPlusC99_indent(v59); + VAL v62 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v54); + VAL v63 = mw_mirth_c99_ZPlusC99_put(v62, v61); + STR* v64; + STRLIT(v64, " ", 1); + VAL v65 = mw_mirth_c99_ZPlusC99_put(MKSTR(v64), v63); + incref(v56); + VAL v66 = mw_mirth_c99_ZPlusC99_put(v56, v65); + STR* v67; + STRLIT(v67, " = ", 3); + VAL v68 = mw_mirth_c99_ZPlusC99_put(MKSTR(v67), v66); + VAL v69 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v54, v56); + VAL v70 = mw_mirth_c99_ZPlusC99Resource_consume(v51); + VAL v71 = mw_mirth_c99_ZPlusC99_put(v70, v68); + STR* v72; + STRLIT(v72, ";", 1); + VAL v73 = mw_mirth_c99_ZPlusC99_put(MKSTR(v72), v71); + VAL v74 = mw_mirth_c99_ZPlusC99_line(v73); + VTUP(v74)->cells[4] = MKI64(v60); + VTUP(v53)->cells[1] = v74; + int64_t v75 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(v52); + VAL x76; + if (((bool)v75)) { + VAL v77 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v69); + VAL v78 = mw_mirth_c99_pushZ_resourceZ_labelZBang(v52, v53, v77); + x76 = v78; } else { - VAL v110 = (mw_mirth_c99_pushZ_localZ_labelZBang(v84, v85, v90)); - x107 = v110; + VAL v79 = mw_mirth_c99_pushZ_valueZ_labelZBang(v52, v53, v69); + x76 = v79; } - x3 = x107; + x4 = x76; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - return x3; + return x4; } -static VAL mw_mirth_c99_ZPlusC99StackCache_tieZ_knotZBang (VAL x1, VAL x2) { +static VAL mw_mirth_c99_ZPlusC99Stack_tieZ_knotZBang (VAL x1, VAL x2) { VAL x3; switch (get_data_tag(x2)) { - case 0LL: { // +SCNil - VAL v4 = (mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(x1)); + case 0LL: { // +SNil + VAL v4 = mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(x1); x3 = v4; } break; - case 1LL: { // +SCCons + case 1LL: { // +SCons VAL v5; VAL v6; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(x2, &v5, &v6); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(x2, &v5, &v6); int64_t v7 = VI64(VTUP(v6)->cells[1]); VAL v8; VAL v9; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x1, v7, &v8, &v9); - VAL v10 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v7, v9); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x1, v7, &v8, &v9); + VAL v10 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v7, v9); VAL v11 = VVAL(VTUP(v6)->cells[2]); incref(v11); - VAL v12 = (VVAL(VTUP(v8)->cells[1])); - VAL v13 = (mw_mirth_c99_ZPlusC99_indent(v12)); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(v11, v13)); - STR* v15; - STRLIT(v15, " = ", 3); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14)); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(v10, v16)); - STR* v18; - STRLIT(v18, ";", 1); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17)); - VAL v20 = (mw_mirth_c99_ZPlusC99_line(v19)); - VTUP(v8)->cells[1] = v20; - VAL v21 = (mw_mirth_c99_ZPlusC99StackCache_tieZ_knotZBang(v8, v5)); - VAL v22 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v21, v6)); - x3 = v22; + int64_t v12 = VI64(VTUP(v8)->cells[3]); + VAL v13 = VVAL(VTUP(v8)->cells[1]); + int64_t v14 = VI64(VTUP(v13)->cells[4]); + VTUP(v13)->cells[4] = MKI64(v12); + VAL v15 = mw_mirth_c99_ZPlusC99_indent(v13); + VAL v16 = mw_mirth_c99_ZPlusC99_put(v11, v15); + STR* v17; + STRLIT(v17, " = ", 3); + VAL v18 = mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16); + VAL v19 = mw_mirth_c99_ZPlusC99_put(v10, v18); + STR* v20; + STRLIT(v20, ";", 1); + VAL v21 = mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19); + VAL v22 = mw_mirth_c99_ZPlusC99_line(v21); + VTUP(v22)->cells[4] = MKI64(v14); + VTUP(v8)->cells[1] = v22; + VAL v23 = mw_mirth_c99_ZPlusC99Stack_tieZ_knotZBang(v8, v5); + VAL v24 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v23, v6); + x3 = v24; } break; - case 2LL: { // +SCWith - VAL v23; - VAL v24; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(x2, &v23, &v24); - int64_t v25 = VI64(VTUP(v24)->cells[1]); + case 2LL: { // +SWith + VAL v25; VAL v26; - VAL v27; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(x1, v25, &v26, &v27); - VAL v28 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(v27)); - VAL v29 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v25, v28); - VAL v30 = VVAL(VTUP(v24)->cells[2]); - incref(v30); - VAL v31 = (VVAL(VTUP(v26)->cells[1])); - VAL v32 = (mw_mirth_c99_ZPlusC99_indent(v31)); - VAL v33 = (mw_mirth_c99_ZPlusC99_put(v30, v32)); - STR* v34; - STRLIT(v34, " = ", 3); - VAL v35 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v34), v33)); - VAL v36 = (mw_mirth_c99_ZPlusC99_put(v29, v35)); - STR* v37; - STRLIT(v37, ";", 1); - VAL v38 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v37), v36)); - VAL v39 = (mw_mirth_c99_ZPlusC99_line(v38)); - VTUP(v26)->cells[1] = v39; - VAL v40 = (mw_mirth_c99_ZPlusC99StackCache_tieZ_knotZBang(v26, v23)); - VAL v41 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v40, v24)); - x3 = v41; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(x2, &v25, &v26); + int64_t v27 = VI64(VTUP(v26)->cells[1]); + VAL v28; + VAL v29; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(x1, v27, &v28, &v29); + VAL v30 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(v29); + VAL v31 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v27, v30); + VAL v32 = VVAL(VTUP(v26)->cells[2]); + incref(v32); + int64_t v33 = VI64(VTUP(v28)->cells[3]); + VAL v34 = VVAL(VTUP(v28)->cells[1]); + int64_t v35 = VI64(VTUP(v34)->cells[4]); + VTUP(v34)->cells[4] = MKI64(v33); + VAL v36 = mw_mirth_c99_ZPlusC99_indent(v34); + VAL v37 = mw_mirth_c99_ZPlusC99_put(v32, v36); + STR* v38; + STRLIT(v38, " = ", 3); + VAL v39 = mw_mirth_c99_ZPlusC99_put(MKSTR(v38), v37); + VAL v40 = mw_mirth_c99_ZPlusC99_put(v31, v39); + STR* v41; + STRLIT(v41, ";", 1); + VAL v42 = mw_mirth_c99_ZPlusC99_put(MKSTR(v41), v40); + VAL v43 = mw_mirth_c99_ZPlusC99_line(v42); + VTUP(v43)->cells[4] = MKI64(v35); + VTUP(v28)->cells[1] = v43; + VAL v44 = mw_mirth_c99_ZPlusC99Stack_tieZ_knotZBang(v28, v25); + VAL v45 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v44, v26); + x3 = v45; } break; - case 3LL: { // +SCConsLabel - VAL v42; - VAL v43; - uint64_t v44; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(x2, &v42, &v43, &v44); - int64_t v45 = VI64(VTUP(v43)->cells[1]); + case 3LL: { // +SConsLabel VAL v46; VAL v47; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang(v45, v44, x1, &v46, &v47); - VAL v48 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v45, v47); - VAL v49 = VVAL(VTUP(v43)->cells[2]); - incref(v49); - VAL v50 = (VVAL(VTUP(v46)->cells[1])); - VAL v51 = (mw_mirth_c99_ZPlusC99_indent(v50)); - VAL v52 = (mw_mirth_c99_ZPlusC99_put(v49, v51)); - STR* v53; - STRLIT(v53, " = ", 3); - VAL v54 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v53), v52)); - VAL v55 = (mw_mirth_c99_ZPlusC99_put(v48, v54)); - STR* v56; - STRLIT(v56, ";", 1); - VAL v57 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v56), v55)); - VAL v58 = (mw_mirth_c99_ZPlusC99_line(v57)); - VTUP(v46)->cells[1] = v58; - VAL v59 = (mw_mirth_c99_ZPlusC99StackCache_tieZ_knotZBang(v46, v42)); - VAL v60 = (mw_mirth_c99_pushZ_localZ_labelZBang(v44, v59, v43)); - x3 = v60; - } break; - case 4LL: { // +SCWithLabel - VAL v61; - VAL v62; - uint64_t v63; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(x2, &v61, &v62, &v63); - int64_t v64 = VI64(VTUP(v62)->cells[1]); - VAL v65; - VAL v66; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang(v64, v63, x1, &v65, &v66); - VAL v67 = (mw_mirth_c99_ZPlusC99LocalResource_turnZ_intoZ_valueZBang(v66)); - VAL v68 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v64, v67); - VAL v69 = VVAL(VTUP(v62)->cells[2]); - incref(v69); - VAL v70 = (VVAL(VTUP(v65)->cells[1])); - VAL v71 = (mw_mirth_c99_ZPlusC99_indent(v70)); - VAL v72 = (mw_mirth_c99_ZPlusC99_put(v69, v71)); - STR* v73; - STRLIT(v73, " = ", 3); - VAL v74 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v73), v72)); - VAL v75 = (mw_mirth_c99_ZPlusC99_put(v68, v74)); - STR* v76; - STRLIT(v76, ";", 1); - VAL v77 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v76), v75)); - VAL v78 = (mw_mirth_c99_ZPlusC99_line(v77)); - VTUP(v65)->cells[1] = v78; - VAL v79 = (mw_mirth_c99_ZPlusC99StackCache_tieZ_knotZBang(v65, v61)); - VAL v80 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v63, v79, v62)); - x3 = v80; + uint64_t v48; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x2, &v46, &v47, &v48); + int64_t v49 = VI64(VTUP(v47)->cells[1]); + VAL v50; + VAL v51; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang(v49, v48, x1, &v50, &v51); + VAL v52 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v49, v51); + VAL v53 = VVAL(VTUP(v47)->cells[2]); + incref(v53); + int64_t v54 = VI64(VTUP(v50)->cells[3]); + VAL v55 = VVAL(VTUP(v50)->cells[1]); + int64_t v56 = VI64(VTUP(v55)->cells[4]); + VTUP(v55)->cells[4] = MKI64(v54); + VAL v57 = mw_mirth_c99_ZPlusC99_indent(v55); + VAL v58 = mw_mirth_c99_ZPlusC99_put(v53, v57); + STR* v59; + STRLIT(v59, " = ", 3); + VAL v60 = mw_mirth_c99_ZPlusC99_put(MKSTR(v59), v58); + VAL v61 = mw_mirth_c99_ZPlusC99_put(v52, v60); + STR* v62; + STRLIT(v62, ";", 1); + VAL v63 = mw_mirth_c99_ZPlusC99_put(MKSTR(v62), v61); + VAL v64 = mw_mirth_c99_ZPlusC99_line(v63); + VTUP(v64)->cells[4] = MKI64(v56); + VTUP(v50)->cells[1] = v64; + VAL v65 = mw_mirth_c99_ZPlusC99Stack_tieZ_knotZBang(v50, v46); + VAL v66 = mw_mirth_c99_pushZ_valueZ_labelZBang(v48, v65, v47); + x3 = v66; + } break; + case 4LL: { // +SWithLabel + VAL v67; + VAL v68; + uint64_t v69; + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x2, &v67, &v68, &v69); + int64_t v70 = VI64(VTUP(v68)->cells[1]); + VAL v71; + VAL v72; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang(v70, v69, x1, &v71, &v72); + VAL v73 = mw_mirth_c99_ZPlusC99Resource_turnZ_intoZ_valueZBang(v72); + VAL v74 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v70, v73); + VAL v75 = VVAL(VTUP(v68)->cells[2]); + incref(v75); + int64_t v76 = VI64(VTUP(v71)->cells[3]); + VAL v77 = VVAL(VTUP(v71)->cells[1]); + int64_t v78 = VI64(VTUP(v77)->cells[4]); + VTUP(v77)->cells[4] = MKI64(v76); + VAL v79 = mw_mirth_c99_ZPlusC99_indent(v77); + VAL v80 = mw_mirth_c99_ZPlusC99_put(v75, v79); + STR* v81; + STRLIT(v81, " = ", 3); + VAL v82 = mw_mirth_c99_ZPlusC99_put(MKSTR(v81), v80); + VAL v83 = mw_mirth_c99_ZPlusC99_put(v74, v82); + STR* v84; + STRLIT(v84, ";", 1); + VAL v85 = mw_mirth_c99_ZPlusC99_put(MKSTR(v84), v83); + VAL v86 = mw_mirth_c99_ZPlusC99_line(v85); + VTUP(v86)->cells[4] = MKI64(v78); + VTUP(v71)->cells[1] = v86; + VAL v87 = mw_mirth_c99_ZPlusC99Stack_tieZ_knotZBang(v71, v67); + VAL v88 = mw_mirth_c99_pushZ_resourceZ_labelZBang(v69, v87, v68); + x3 = v88; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -78555,56 +57607,56 @@ static VAL mw_mirth_c99_ZPlusC99StackCache_tieZ_knotZBang (VAL x1, VAL x2) { } return x3; } -static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZAsk (VAL x1, VAL *x2, VAL *x3) { +static void mw_mirth_c99_ZPlusC99Stack_popZ_valueZAsk (VAL x1, VAL *x2, VAL *x3) { VAL x4; VAL x5; switch (get_data_tag(x1)) { - case 0LL: { // +SCNil - VAL v6 = (MKI64(0LL /* +C99LocalNone */)); - VAL v7 = (MKI64(0LL /* +SCNil */)); + case 0LL: { // +SNil + VAL v6 = MKI64(0LL /* +C99ValueNone */); + VAL v7 = MKI64(0LL /* +SNil */); x5 = v7; x4 = v6; } break; - case 1LL: { // +SCCons + case 1LL: { // +SCons VAL v8; VAL v9; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(x1, &v8, &v9); - VAL v10 = (mtw_mirth_c99_ZPlusC99LocalZAsk_ZPlusC99LocalSome(v9)); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(x1, &v8, &v9); + VAL v10 = mtw_mirth_c99_ZPlusC99ValueZAsk_ZPlusC99ValueSome(v9); x5 = v8; x4 = v10; } break; - case 2LL: { // +SCWith + case 2LL: { // +SWith VAL v11; VAL v12; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(x1, &v11, &v12); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(x1, &v11, &v12); VAL v13; VAL v14; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZAsk(v11, &v13, &v14); - VAL v15 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(v14, v12)); + mw_mirth_c99_ZPlusC99Stack_popZ_valueZAsk(v11, &v13, &v14); + VAL v15 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWith(v14, v12); x5 = v15; x4 = v13; } break; - case 3LL: { // +SCConsLabel + case 3LL: { // +SConsLabel VAL v16; VAL v17; uint64_t v18; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(x1, &v16, &v17, &v18); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x1, &v16, &v17, &v18); VAL v19; VAL v20; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZAsk(v16, &v19, &v20); - VAL v21 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(v20, v17, v18)); + mw_mirth_c99_ZPlusC99Stack_popZ_valueZAsk(v16, &v19, &v20); + VAL v21 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(v20, v17, v18); x5 = v21; x4 = v19; } break; - case 4LL: { // +SCWithLabel + case 4LL: { // +SWithLabel VAL v22; VAL v23; uint64_t v24; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(x1, &v22, &v23, &v24); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x1, &v22, &v23, &v24); VAL v25; VAL v26; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZAsk(v22, &v25, &v26); - VAL v27 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(v26, v23, v24)); + mw_mirth_c99_ZPlusC99Stack_popZ_valueZAsk(v22, &v25, &v26); + VAL v27 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(v26, v23, v24); x5 = v27; x4 = v25; } break; @@ -78615,56 +57667,56 @@ static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZAsk (VAL x1, VAL *x2, VAL *x3 = x5; *x2 = x4; } -static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZAsk (VAL x1, VAL *x2, VAL *x3) { +static void mw_mirth_c99_ZPlusC99Stack_popZ_resourceZAsk (VAL x1, VAL *x2, VAL *x3) { VAL x4; VAL x5; switch (get_data_tag(x1)) { - case 0LL: { // +SCNil - VAL v6 = (MKI64(0LL /* +C99LocalResourceNone */)); - VAL v7 = (MKI64(0LL /* +SCNil */)); + case 0LL: { // +SNil + VAL v6 = MKI64(0LL /* +C99ResourceNone */); + VAL v7 = MKI64(0LL /* +SNil */); x5 = v7; x4 = v6; } break; - case 2LL: { // +SCWith + case 2LL: { // +SWith VAL v8; VAL v9; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(x1, &v8, &v9); - VAL v10 = (mtw_mirth_c99_ZPlusC99LocalResourceZAsk_ZPlusC99LocalResourceSome(v9)); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(x1, &v8, &v9); + VAL v10 = mtw_mirth_c99_ZPlusC99ResourceZAsk_ZPlusC99ResourceSome(v9); x5 = v8; x4 = v10; } break; - case 1LL: { // +SCCons + case 1LL: { // +SCons VAL v11; VAL v12; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(x1, &v11, &v12); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(x1, &v11, &v12); VAL v13; VAL v14; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZAsk(v11, &v13, &v14); - VAL v15 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(v14, v12)); + mw_mirth_c99_ZPlusC99Stack_popZ_resourceZAsk(v11, &v13, &v14); + VAL v15 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSCons(v14, v12); x5 = v15; x4 = v13; } break; - case 3LL: { // +SCConsLabel + case 3LL: { // +SConsLabel VAL v16; VAL v17; uint64_t v18; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(x1, &v16, &v17, &v18); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x1, &v16, &v17, &v18); VAL v19; VAL v20; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZAsk(v16, &v19, &v20); - VAL v21 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(v20, v17, v18)); + mw_mirth_c99_ZPlusC99Stack_popZ_resourceZAsk(v16, &v19, &v20); + VAL v21 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(v20, v17, v18); x5 = v21; x4 = v19; } break; - case 4LL: { // +SCWithLabel + case 4LL: { // +SWithLabel VAL v22; VAL v23; uint64_t v24; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(x1, &v22, &v23, &v24); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x1, &v22, &v23, &v24); VAL v25; VAL v26; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZAsk(v22, &v25, &v26); - VAL v27 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(v26, v23, v24)); + mw_mirth_c99_ZPlusC99Stack_popZ_resourceZAsk(v22, &v25, &v26); + VAL v27 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(v26, v23, v24); x5 = v27; x4 = v25; } break; @@ -78675,69 +57727,69 @@ static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZAsk (VAL x1, VA *x3 = x5; *x2 = x4; } -static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_labelZAsk (uint64_t x1, VAL x2, uint64_t *x3, VAL *x4, VAL *x5) { +static void mw_mirth_c99_ZPlusC99Stack_popZ_valueZ_labelZAsk (uint64_t x1, VAL x2, uint64_t *x3, VAL *x4, VAL *x5) { uint64_t x6; VAL x7; VAL x8; switch (get_data_tag(x2)) { - case 0LL: { // +SCNil - VAL v9 = (MKI64(0LL /* +C99LocalNone */)); - VAL v10 = (MKI64(0LL /* +SCNil */)); + case 0LL: { // +SNil + VAL v9 = MKI64(0LL /* +C99ValueNone */); + VAL v10 = MKI64(0LL /* +SNil */); x8 = v10; x7 = v9; x6 = x1; } break; - case 1LL: { // +SCCons + case 1LL: { // +SCons VAL v11; VAL v12; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(x2, &v11, &v12); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(x2, &v11, &v12); uint64_t v13; VAL v14; VAL v15; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_labelZAsk(x1, v11, &v13, &v14, &v15); - VAL v16 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(v15, v12)); + mw_mirth_c99_ZPlusC99Stack_popZ_valueZ_labelZAsk(x1, v11, &v13, &v14, &v15); + VAL v16 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSCons(v15, v12); x8 = v16; x7 = v14; x6 = v13; } break; - case 2LL: { // +SCWith + case 2LL: { // +SWith VAL v17; VAL v18; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(x2, &v17, &v18); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(x2, &v17, &v18); uint64_t v19; VAL v20; VAL v21; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_labelZAsk(x1, v17, &v19, &v20, &v21); - VAL v22 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(v21, v18)); + mw_mirth_c99_ZPlusC99Stack_popZ_valueZ_labelZAsk(x1, v17, &v19, &v20, &v21); + VAL v22 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWith(v21, v18); x8 = v22; x7 = v20; x6 = v19; } break; - case 4LL: { // +SCWithLabel + case 4LL: { // +SWithLabel VAL v23; VAL v24; uint64_t v25; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(x2, &v23, &v24, &v25); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x2, &v23, &v24, &v25); uint64_t v26; VAL v27; VAL v28; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_labelZAsk(x1, v23, &v26, &v27, &v28); - VAL v29 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(v28, v24, v25)); + mw_mirth_c99_ZPlusC99Stack_popZ_valueZ_labelZAsk(x1, v23, &v26, &v27, &v28); + VAL v29 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(v28, v24, v25); x8 = v29; x7 = v27; x6 = v26; } break; - case 3LL: { // +SCConsLabel + case 3LL: { // +SConsLabel VAL v30; VAL v31; uint64_t v32; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(x2, &v30, &v31, &v32); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x2, &v30, &v31, &v32); int64_t v33 = mw_mirth_label_Label_ZEqualZEqual(x1, v32); uint64_t x34; VAL x35; VAL x36; if (((bool)v33)) { - VAL v37 = (mtw_mirth_c99_ZPlusC99LocalZAsk_ZPlusC99LocalSome(v31)); + VAL v37 = mtw_mirth_c99_ZPlusC99ValueZAsk_ZPlusC99ValueSome(v31); x36 = v30; x35 = v37; x34 = x1; @@ -78745,8 +57797,8 @@ static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_labelZAsk (uint64_t x1, uint64_t v38; VAL v39; VAL v40; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_labelZAsk(x1, v30, &v38, &v39, &v40); - VAL v41 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(v40, v31, v32)); + mw_mirth_c99_ZPlusC99Stack_popZ_valueZ_labelZAsk(x1, v30, &v38, &v39, &v40); + VAL v41 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(v40, v31, v32); x36 = v41; x35 = v39; x34 = v38; @@ -78763,69 +57815,69 @@ static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_labelZAsk (uint64_t x1, *x4 = x7; *x3 = x6; } -static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZ_labelZAsk (uint64_t x1, VAL x2, uint64_t *x3, VAL *x4, VAL *x5) { +static void mw_mirth_c99_ZPlusC99Stack_popZ_resourceZ_labelZAsk (uint64_t x1, VAL x2, uint64_t *x3, VAL *x4, VAL *x5) { uint64_t x6; VAL x7; VAL x8; switch (get_data_tag(x2)) { - case 0LL: { // +SCNil - VAL v9 = (MKI64(0LL /* +C99LocalResourceNone */)); - VAL v10 = (MKI64(0LL /* +SCNil */)); + case 0LL: { // +SNil + VAL v9 = MKI64(0LL /* +C99ResourceNone */); + VAL v10 = MKI64(0LL /* +SNil */); x8 = v10; x7 = v9; x6 = x1; } break; - case 1LL: { // +SCCons + case 1LL: { // +SCons VAL v11; VAL v12; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(x2, &v11, &v12); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(x2, &v11, &v12); uint64_t v13; VAL v14; VAL v15; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZ_labelZAsk(x1, v11, &v13, &v14, &v15); - VAL v16 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(v15, v12)); + mw_mirth_c99_ZPlusC99Stack_popZ_resourceZ_labelZAsk(x1, v11, &v13, &v14, &v15); + VAL v16 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSCons(v15, v12); x8 = v16; x7 = v14; x6 = v13; } break; - case 2LL: { // +SCWith + case 2LL: { // +SWith VAL v17; VAL v18; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(x2, &v17, &v18); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(x2, &v17, &v18); uint64_t v19; VAL v20; VAL v21; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZ_labelZAsk(x1, v17, &v19, &v20, &v21); - VAL v22 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(v21, v18)); + mw_mirth_c99_ZPlusC99Stack_popZ_resourceZ_labelZAsk(x1, v17, &v19, &v20, &v21); + VAL v22 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWith(v21, v18); x8 = v22; x7 = v20; x6 = v19; } break; - case 3LL: { // +SCConsLabel + case 3LL: { // +SConsLabel VAL v23; VAL v24; uint64_t v25; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(x2, &v23, &v24, &v25); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x2, &v23, &v24, &v25); uint64_t v26; VAL v27; VAL v28; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZ_labelZAsk(x1, v23, &v26, &v27, &v28); - VAL v29 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(v28, v24, v25)); + mw_mirth_c99_ZPlusC99Stack_popZ_resourceZ_labelZAsk(x1, v23, &v26, &v27, &v28); + VAL v29 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(v28, v24, v25); x8 = v29; x7 = v27; x6 = v26; } break; - case 4LL: { // +SCWithLabel + case 4LL: { // +SWithLabel VAL v30; VAL v31; uint64_t v32; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(x2, &v30, &v31, &v32); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x2, &v30, &v31, &v32); int64_t v33 = mw_mirth_label_Label_ZEqualZEqual(x1, v32); uint64_t x34; VAL x35; VAL x36; if (((bool)v33)) { - VAL v37 = (mtw_mirth_c99_ZPlusC99LocalResourceZAsk_ZPlusC99LocalResourceSome(v31)); + VAL v37 = mtw_mirth_c99_ZPlusC99ResourceZAsk_ZPlusC99ResourceSome(v31); x36 = v30; x35 = v37; x34 = x1; @@ -78833,8 +57885,8 @@ static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZ_labelZAsk (uin uint64_t v38; VAL v39; VAL v40; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZ_labelZAsk(x1, v30, &v38, &v39, &v40); - VAL v41 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(v40, v31, v32)); + mw_mirth_c99_ZPlusC99Stack_popZ_resourceZ_labelZAsk(x1, v30, &v38, &v39, &v40); + VAL v41 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(v40, v31, v32); x36 = v41; x35 = v39; x34 = v38; @@ -78851,44 +57903,44 @@ static void mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZ_labelZAsk (uin *x4 = x7; *x3 = x6; } -static VAL mw_mirth_c99_ZPlusC99StackCache_flushZ_allZBang (VAL x1, VAL x2) { +static VAL mw_mirth_c99_ZPlusC99Stack_pushZ_stackZ_directZBang (VAL x1, VAL x2) { VAL x3; switch (get_data_tag(x2)) { - case 0LL: { // +SCNil + case 0LL: { // +SNil x3 = x1; } break; - case 1LL: { // +SCCons + case 1LL: { // +SCons VAL v4; VAL v5; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(x2, &v4, &v5); - VAL v6 = (mw_mirth_c99_ZPlusC99StackCache_flushZ_allZBang(x1, v4)); - VAL v7 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZ_directZBang(v6, v5)); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(x2, &v4, &v5); + VAL v6 = mw_mirth_c99_ZPlusC99Stack_pushZ_stackZ_directZBang(x1, v4); + VAL v7 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZ_directZBang(v6, v5); x3 = v7; } break; - case 2LL: { // +SCWith + case 2LL: { // +SWith VAL v8; VAL v9; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(x2, &v8, &v9); - VAL v10 = (mw_mirth_c99_ZPlusC99StackCache_flushZ_allZBang(x1, v8)); - VAL v11 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZ_directZBang(v10, v9)); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(x2, &v8, &v9); + VAL v10 = mw_mirth_c99_ZPlusC99Stack_pushZ_stackZ_directZBang(x1, v8); + VAL v11 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZ_directZBang(v10, v9); x3 = v11; } break; - case 3LL: { // +SCConsLabel + case 3LL: { // +SConsLabel VAL v12; VAL v13; uint64_t v14; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(x2, &v12, &v13, &v14); - VAL v15 = (mw_mirth_c99_ZPlusC99StackCache_flushZ_allZBang(x1, v12)); - VAL v16 = (mw_mirth_c99_pushZ_localZ_labelZ_directZBang(v14, v15, v13)); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x2, &v12, &v13, &v14); + VAL v15 = mw_mirth_c99_ZPlusC99Stack_pushZ_stackZ_directZBang(x1, v12); + VAL v16 = mw_mirth_c99_pushZ_valueZ_labelZ_directZBang(v14, v15, v13); x3 = v16; } break; - case 4LL: { // +SCWithLabel + case 4LL: { // +SWithLabel VAL v17; VAL v18; uint64_t v19; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(x2, &v17, &v18, &v19); - VAL v20 = (mw_mirth_c99_ZPlusC99StackCache_flushZ_allZBang(x1, v17)); - VAL v21 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZ_directZBang(v19, v20, v18)); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x2, &v17, &v18, &v19); + VAL v20 = mw_mirth_c99_ZPlusC99Stack_pushZ_stackZ_directZBang(x1, v17); + VAL v21 = mw_mirth_c99_pushZ_resourceZ_labelZ_directZBang(v19, v20, v18); x3 = v21; } break; default: { @@ -78897,75 +57949,75 @@ static VAL mw_mirth_c99_ZPlusC99StackCache_flushZ_allZBang (VAL x1, VAL x2) { } return x3; } -static void mw_mirth_c99_ZPlusC99StackCache_rdup (VAL x1, VAL *x2, VAL *x3) { +static void mw_mirth_c99_ZPlusC99Stack_rdup (VAL x1, VAL *x2, VAL *x3) { VAL x4; VAL x5; switch (get_data_tag(x1)) { - case 0LL: { // +SCNil - VAL v6 = (MKI64(0LL /* +SCNil */)); - VAL v7 = (MKI64(0LL /* +SCNil */)); + case 0LL: { // +SNil + VAL v6 = MKI64(0LL /* +SNil */); + VAL v7 = MKI64(0LL /* +SNil */); x5 = v7; x4 = v6; } break; - case 1LL: { // +SCCons + case 1LL: { // +SCons VAL v8; VAL v9; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(x1, &v8, &v9); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(x1, &v8, &v9); VAL v10; VAL v11; - mw_mirth_c99_ZPlusC99StackCache_rdup(v8, &v10, &v11); + mw_mirth_c99_ZPlusC99Stack_rdup(v8, &v10, &v11); VAL v12; VAL v13; - mw_mirth_c99_ZPlusC99Local_rdup(v9, &v12, &v13); - VAL v14 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(v11, v13)); - VAL v15 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(v10, v12)); + mw_mirth_c99_ZPlusC99Value_rdup(v9, &v12, &v13); + VAL v14 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSCons(v11, v13); + VAL v15 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSCons(v10, v12); x5 = v14; x4 = v15; } break; - case 2LL: { // +SCWith + case 2LL: { // +SWith VAL v16; VAL v17; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(x1, &v16, &v17); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(x1, &v16, &v17); VAL v18; VAL v19; - mw_mirth_c99_ZPlusC99StackCache_rdup(v16, &v18, &v19); + mw_mirth_c99_ZPlusC99Stack_rdup(v16, &v18, &v19); VAL v20; VAL v21; - mw_mirth_c99_ZPlusC99LocalResource_rdup(v17, &v20, &v21); - VAL v22 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(v19, v21)); - VAL v23 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(v18, v20)); + mw_mirth_c99_ZPlusC99Resource_rdup(v17, &v20, &v21); + VAL v22 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWith(v19, v21); + VAL v23 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWith(v18, v20); x5 = v22; x4 = v23; } break; - case 3LL: { // +SCConsLabel + case 3LL: { // +SConsLabel VAL v24; VAL v25; uint64_t v26; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(x1, &v24, &v25, &v26); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x1, &v24, &v25, &v26); VAL v27; VAL v28; - mw_mirth_c99_ZPlusC99StackCache_rdup(v24, &v27, &v28); + mw_mirth_c99_ZPlusC99Stack_rdup(v24, &v27, &v28); VAL v29; VAL v30; - mw_mirth_c99_ZPlusC99Local_rdup(v25, &v29, &v30); - VAL v31 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(v28, v30, v26)); - VAL v32 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(v27, v29, v26)); + mw_mirth_c99_ZPlusC99Value_rdup(v25, &v29, &v30); + VAL v31 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(v28, v30, v26); + VAL v32 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(v27, v29, v26); x5 = v31; x4 = v32; } break; - case 4LL: { // +SCWithLabel + case 4LL: { // +SWithLabel VAL v33; VAL v34; uint64_t v35; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(x1, &v33, &v34, &v35); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x1, &v33, &v34, &v35); VAL v36; VAL v37; - mw_mirth_c99_ZPlusC99StackCache_rdup(v33, &v36, &v37); + mw_mirth_c99_ZPlusC99Stack_rdup(v33, &v36, &v37); VAL v38; VAL v39; - mw_mirth_c99_ZPlusC99LocalResource_rdup(v34, &v38, &v39); - VAL v40 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(v37, v39, v35)); - VAL v41 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(v36, v38, v35)); + mw_mirth_c99_ZPlusC99Resource_rdup(v34, &v38, &v39); + VAL v40 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(v37, v39, v35); + VAL v41 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(v36, v38, v35); x5 = v40; x4 = v41; } break; @@ -78976,39 +58028,39 @@ static void mw_mirth_c99_ZPlusC99StackCache_rdup (VAL x1, VAL *x2, VAL *x3) { *x3 = x5; *x2 = x4; } -static void mw_mirth_c99_ZPlusC99StackCache_rdrop (VAL x1) { +static void mw_mirth_c99_ZPlusC99Stack_rdrop (VAL x1) { switch (get_data_tag(x1)) { - case 0LL: { // +SCNil + case 0LL: { // +SNil } break; - case 1LL: { // +SCCons + case 1LL: { // +SCons VAL v2; VAL v3; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(x1, &v2, &v3); - mw_mirth_c99_ZPlusC99Local_rdrop(v3); - mw_mirth_c99_ZPlusC99StackCache_rdrop(v2); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSCons(x1, &v2, &v3); + mw_mirth_c99_ZPlusC99Value_rdrop(v3); + mw_mirth_c99_ZPlusC99Stack_rdrop(v2); } break; - case 2LL: { // +SCWith + case 2LL: { // +SWith VAL v4; VAL v5; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(x1, &v4, &v5); - mw_mirth_c99_ZPlusC99LocalResource_rdrop(v5); - mw_mirth_c99_ZPlusC99StackCache_rdrop(v4); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWith(x1, &v4, &v5); + mw_mirth_c99_ZPlusC99Resource_rdrop(v5); + mw_mirth_c99_ZPlusC99Stack_rdrop(v4); } break; - case 3LL: { // +SCConsLabel + case 3LL: { // +SConsLabel VAL v6; VAL v7; uint64_t v8; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCConsLabel(x1, &v6, &v7, &v8); - mw_mirth_c99_ZPlusC99Local_rdrop(v7); - mw_mirth_c99_ZPlusC99StackCache_rdrop(v6); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSConsLabel(x1, &v6, &v7, &v8); + mw_mirth_c99_ZPlusC99Value_rdrop(v7); + mw_mirth_c99_ZPlusC99Stack_rdrop(v6); } break; - case 4LL: { // +SCWithLabel + case 4LL: { // +SWithLabel VAL v9; VAL v10; uint64_t v11; - mtp_mirth_c99_ZPlusC99StackCache_ZPlusSCWithLabel(x1, &v9, &v10, &v11); - mw_mirth_c99_ZPlusC99LocalResource_rdrop(v10); - mw_mirth_c99_ZPlusC99StackCache_rdrop(v9); + mtp_mirth_c99_ZPlusC99Stack_ZPlusSWithLabel(x1, &v9, &v10, &v11); + mw_mirth_c99_ZPlusC99Resource_rdrop(v10); + mw_mirth_c99_ZPlusC99Stack_rdrop(v9); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -79016,217 +58068,118 @@ static void mw_mirth_c99_ZPlusC99StackCache_rdrop (VAL x1) { } } static VAL mw_mirth_c99_ZPlusC99Branch_beginZ_branchZ_splitZBang (VAL x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); + VAL v3 = VVAL(VTUP(x2)->cells[1]); int64_t v4; VAL v5; VAL v6; mw_mirth_c99_ZPlusC99_stackZ_typeZ_toZ_c99Z_apiZ_params(x1, v3, &v4, &v5, &v6); VTUP(x2)->cells[1] = v6; incref(v5); - VAL v7; - VAL v8; - mw_std_list_List_1_uncons(v5, &v7, &v8); - VAL x9; - int64_t x10; - VAL x11; - VAL x12; - int64_t x13; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v15 = (mw_mirth_c99_C99APIArg_reserveZ_asZ_isZBang(v14, x2)); - int64_t v16 = 1LL /* True */; - x13 = v16; - x12 = v8; - x11 = v5; - x10 = v4; - x9 = v15; - } break; - case 0LL: { // None - int64_t v17 = 0LL /* False */; - x13 = v17; - x12 = v8; - x11 = v5; - x10 = v4; - x9 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v18 = (x9); - int64_t v19 = x10; - VAL v20 = x11; - VAL v21 = x12; - int64_t v22 = x13; - while (((bool)v22)) { - VAL v23 = (v18); - int64_t v24 = v19; - VAL v25 = v20; - VAL v26 = v21; - VAL v27; - VAL v28; - mw_std_list_List_1_uncons(v26, &v27, &v28); - VAL x29; - int64_t x30; - VAL x31; - VAL x32; - int64_t x33; - switch (get_data_tag(v27)) { - case 1LL: { // Some - VAL v34 = mtp_std_maybe_Maybe_1_Some(v27); - VAL v35 = (mw_mirth_c99_C99APIArg_reserveZ_asZ_isZBang(v34, v23)); - int64_t v36 = 1LL /* True */; - x33 = v36; - x32 = v28; - x31 = v25; - x30 = v24; - x29 = v35; + int64_t v7 = 1LL /* True */; + VAL v8 = x2; + VAL v9 = v5; + int64_t v10 = v7; + int64_t v11 = v7; + while (((bool)v11)) { + VAL v12 = v8; + VAL v13 = v9; + int64_t v14 = v10; + VAL x15; + VAL x16; + int64_t x17; + switch (get_data_tag(v13)) { + case 1LL: { // Cons + VAL v18; + VAL v19; + mtp_std_list_List_1_Cons(v13, &v18, &v19); + VAL v20 = mw_mirth_c99_C99APIArg_reserveZ_asZ_isZBang(v18, v12); + int64_t v21 = 1LL /* True */; + x17 = v21; + x16 = v19; + x15 = v20; } break; - case 0LL: { // None - int64_t v37 = 0LL /* False */; - x33 = v37; - x32 = v28; - x31 = v25; - x30 = v24; - x29 = v23; + case 0LL: { // Nil + VAL v22 = MKI64(0LL /* Nil */); + int64_t v23 = 0LL /* False */; + x17 = v23; + x16 = v22; + x15 = v12; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v22 = x33; - v21 = x32; - v20 = x31; - v19 = x30; - v18 = x29; + v11 = x17; + v10 = x17; + v9 = x16; + v8 = x15; } - decref(v21); - VAL v38; - VAL v39; - mtp_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v18, &v38, &v39); - VAL v40 = (mtw_mirth_c99_ZPlusC99BranchSplit_ZPlusC99BranchSplit(v38, v39, v20, v19)); - return v40; + decref(v9); + VAL v24; + VAL v25; + int64_t v26; + mtp_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v8, &v24, &v25, &v26); + int64_t v27 = 0LL /* False */; + VAL v28 = mtw_mirth_c99_ZPlusC99BranchSplit_ZPlusC99BranchSplit(v24, v25, v5, v26, v27); + return v28; } static VAL mw_mirth_c99_ZPlusC99BranchSplit_endZ_branchZ_splitZBang (VAL x1) { VAL v2; VAL v3; VAL v4; int64_t v5; - mtp_mirth_c99_ZPlusC99BranchSplit_ZPlusC99BranchSplit(x1, &v2, &v3, &v4, &v5); - mw_mirth_c99_ZPlusC99StackCache_rdrop(v3); - VAL v6 = (mw_mirth_c99_ZPlusC99_startZ_branchZBang(v2)); + int64_t v6; + mtp_mirth_c99_ZPlusC99BranchSplit_ZPlusC99BranchSplit(x1, &v2, &v3, &v4, &v5, &v6); + mw_mirth_c99_ZPlusC99Stack_rdrop(v3); + VAL v7 = mw_mirth_c99_ZPlusC99_startZ_branchZBang(v2, v6); + VAL v8 = mw_std_list_List_1_for_1_sp17(v7, v4); + return v8; +} +static VAL mw_mirth_c99_ZPlusC99_startZ_branchZBang (VAL x1, int64_t x2) { + VAL v3 = MKI64(0LL /* +SNil */); + VAL v4 = mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(x1, v3, x2); + return v4; +} +static void mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang (VAL x1, VAL *x2, int64_t *x3) { + VAL v4 = VVAL(VTUP(x1)->cells[2]); + VAL v5 = MKI64(0LL /* +SNil */); + VTUP(x1)->cells[2] = v5; + VAL v6 = mw_mirth_c99_ZPlusC99Stack_pushZ_stackZ_directZBang(x1, v4); VAL v7; VAL v8; - mw_std_list_List_1_uncons(v4, &v7, &v8); - int64_t x9; - VAL x10; - VAL x11; - int64_t x12; - switch (get_data_tag(v7)) { - case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v7); - VAL v14 = (mw_mirth_c99_C99APIArg_pushZ_asZ_localZBang(v13, v6)); - int64_t v15 = 1LL /* True */; - x12 = v15; - x11 = v8; - x10 = v14; - x9 = v5; - } break; - case 0LL: { // None - int64_t v16 = 0LL /* False */; - x12 = v16; - x11 = v8; - x10 = v6; - x9 = v5; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v17 = x9; - VAL v18 = (x10); - VAL v19 = x11; - int64_t v20 = x12; - while (((bool)v20)) { - int64_t v21 = v17; - VAL v22 = (v18); - VAL v23 = v19; - VAL v24; - VAL v25; - mw_std_list_List_1_uncons(v23, &v24, &v25); - int64_t x26; - VAL x27; - VAL x28; - int64_t x29; - switch (get_data_tag(v24)) { - case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(v24); - VAL v31 = (mw_mirth_c99_C99APIArg_pushZ_asZ_localZBang(v30, v22)); - int64_t v32 = 1LL /* True */; - x29 = v32; - x28 = v25; - x27 = v31; - x26 = v21; - } break; - case 0LL: { // None - int64_t v33 = 0LL /* False */; - x29 = v33; - x28 = v25; - x27 = v22; - x26 = v21; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v20 = x29; - v19 = x28; - v18 = x27; - v17 = x26; - } - decref(v19); - return v18; -} -static VAL mw_mirth_c99_ZPlusC99_startZ_branchZBang (VAL x1) { - VAL v2 = (MKI64(0LL /* +SCNil */)); - VAL v3 = (mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(x1, v2)); - return v3; + int64_t v9; + mtp_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v6, &v7, &v8, &v9); + mw_mirth_c99_ZPlusC99Stack_rdrop(v8); + *x3 = v9; + *x2 = v7; } -static VAL mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang (VAL x1) { +static VAL mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang (VAL x1) { VAL v2; - VAL v3; - mtp_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(x1, &v2, &v3); - VAL v4 = (mw_mirth_c99_ZPlusC99StackCache_flushZ_allZBang(v2, v3)); + int64_t v3; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(x1, &v2, &v3); + VAL v4 = mw_mirth_c99_ZPlusC99_startZ_branchZBang(v2, v3); return v4; } -static VAL mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang (VAL x1) { - VAL v2 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(x1)); - VAL v3 = (mw_mirth_c99_ZPlusC99_startZ_branchZBang(v2)); - return v3; -} -static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4) { - VAL v5 = (VVAL(VTUP(x1)->cells[2])); +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x1)->cells[2]); VAL v6; VAL v7; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZAsk(v5, &v6, &v7); + mw_mirth_c99_ZPlusC99Stack_popZ_valueZAsk(v5, &v6, &v7); VTUP(x1)->cells[2] = v7; VAL x8; VAL x9; switch (get_data_tag(v6)) { - case 1LL: { // +C99LocalSome - VAL v10 = (mtp_mirth_c99_ZPlusC99LocalZAsk_ZPlusC99LocalSome(v6)); + case 1LL: { // +C99ValueSome + VAL v10 = mtp_mirth_c99_ZPlusC99ValueZAsk_ZPlusC99ValueSome(v6); x9 = v10; x8 = x1; } break; - case 0LL: { // +C99LocalNone - VAL v11 = (VVAL(VTUP(x1)->cells[1])); + case 0LL: { // +C99ValueNone + VAL v11; VAL v12; - VAL v13; - mw_mirth_c99_C99ReprType_popZ_toZ_localZ_directZBang(x2, v11, &v12, &v13); - VTUP(x1)->cells[1] = v12; - x9 = v13; - x8 = x1; + mw_mirth_c99_C99ReprType_popZ_valueZ_directZBang(x2, x1, &v11, &v12); + x9 = v12; + x8 = v11; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -79235,29 +58188,27 @@ static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang (VAL x1, int64_t x2, *x4 = x9; *x3 = x8; } -static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5) { - VAL v6 = (VVAL(VTUP(x3)->cells[2])); +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5) { + VAL v6 = VVAL(VTUP(x3)->cells[2]); uint64_t v7; VAL v8; VAL v9; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_labelZAsk(x2, v6, &v7, &v8, &v9); + mw_mirth_c99_ZPlusC99Stack_popZ_valueZ_labelZAsk(x2, v6, &v7, &v8, &v9); VTUP(x3)->cells[2] = v9; VAL x10; VAL x11; switch (get_data_tag(v8)) { - case 1LL: { // +C99LocalSome - VAL v12 = (mtp_mirth_c99_ZPlusC99LocalZAsk_ZPlusC99LocalSome(v8)); + case 1LL: { // +C99ValueSome + VAL v12 = mtp_mirth_c99_ZPlusC99ValueZAsk_ZPlusC99ValueSome(v8); x11 = v12; x10 = x3; } break; - case 0LL: { // +C99LocalNone - VAL v13 = (VVAL(VTUP(x3)->cells[1])); + case 0LL: { // +C99ValueNone + VAL v13; VAL v14; - VAL v15; - mw_mirth_c99_popZ_localZ_labelZ_directZBang(x1, v7, v13, &v14, &v15); - VTUP(x3)->cells[1] = v14; - x11 = v15; - x10 = x3; + mw_mirth_c99_popZ_valueZ_labelZ_directZBang(x1, v7, x3, &v13, &v14); + x11 = v14; + x10 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -79266,28 +58217,26 @@ static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang (int64_t x1, *x5 = x11; *x4 = x10; } -static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4) { - VAL v5 = (VVAL(VTUP(x1)->cells[2])); +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang (VAL x1, int64_t x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x1)->cells[2]); VAL v6; VAL v7; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZAsk(v5, &v6, &v7); + mw_mirth_c99_ZPlusC99Stack_popZ_resourceZAsk(v5, &v6, &v7); VTUP(x1)->cells[2] = v7; VAL x8; VAL x9; switch (get_data_tag(v6)) { - case 1LL: { // +C99LocalResourceSome - VAL v10 = (mtp_mirth_c99_ZPlusC99LocalResourceZAsk_ZPlusC99LocalResourceSome(v6)); + case 1LL: { // +C99ResourceSome + VAL v10 = mtp_mirth_c99_ZPlusC99ResourceZAsk_ZPlusC99ResourceSome(v6); x9 = v10; x8 = x1; } break; - case 0LL: { // +C99LocalResourceNone - VAL v11 = (VVAL(VTUP(x1)->cells[1])); + case 0LL: { // +C99ResourceNone + VAL v11; VAL v12; - VAL v13; - mw_mirth_c99_ZPlusC99_popZ_localZ_resourceZ_directZBang(v11, x2, &v12, &v13); - VTUP(x1)->cells[1] = v12; - x9 = v13; - x8 = x1; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_directZBang(x1, x2, &v11, &v12); + x9 = v12; + x8 = v11; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -79296,29 +58245,27 @@ static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang (VAL x1, i *x4 = x9; *x3 = x8; } -static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5) { - VAL v6 = (VVAL(VTUP(x3)->cells[2])); +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang (int64_t x1, uint64_t x2, VAL x3, VAL *x4, VAL *x5) { + VAL v6 = VVAL(VTUP(x3)->cells[2]); uint64_t v7; VAL v8; VAL v9; - mw_mirth_c99_ZPlusC99StackCache_popZ_localZ_resourceZ_labelZAsk(x2, v6, &v7, &v8, &v9); + mw_mirth_c99_ZPlusC99Stack_popZ_resourceZ_labelZAsk(x2, v6, &v7, &v8, &v9); VTUP(x3)->cells[2] = v9; VAL x10; VAL x11; switch (get_data_tag(v8)) { - case 1LL: { // +C99LocalResourceSome - VAL v12 = (mtp_mirth_c99_ZPlusC99LocalResourceZAsk_ZPlusC99LocalResourceSome(v8)); + case 1LL: { // +C99ResourceSome + VAL v12 = mtp_mirth_c99_ZPlusC99ResourceZAsk_ZPlusC99ResourceSome(v8); x11 = v12; x10 = x3; } break; - case 0LL: { // +C99LocalResourceNone - VAL v13 = (VVAL(VTUP(x3)->cells[1])); + case 0LL: { // +C99ResourceNone + VAL v13; VAL v14; - VAL v15; - mw_mirth_c99_popZ_localZ_resourceZ_labelZ_directZBang(x1, v7, v13, &v14, &v15); - VTUP(x3)->cells[1] = v14; - x11 = v15; - x10 = x3; + mw_mirth_c99_popZ_resourceZ_labelZ_directZBang(x1, v7, x3, &v13, &v14); + x11 = v14; + x10 = v13; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -79327,41 +58274,37 @@ static void mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang (in *x5 = x11; *x4 = x10; } -static VAL mw_mirth_c99_ZPlusC99Local_pushZ_localZBang (VAL x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x1)->cells[2])); - VAL v4 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCCons(v3, x2)); +static VAL mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang (VAL x1, VAL x2) { + VAL v3 = VVAL(VTUP(x1)->cells[2]); + VAL v4 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSCons(v3, x2); VTUP(x1)->cells[2] = v4; return x1; } -static VAL mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang (VAL x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x1)->cells[2])); - VAL v4 = (mtw_mirth_c99_ZPlusC99StackCache_ZPlusSCWith(v3, x2)); +static VAL mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang (VAL x1, VAL x2) { + VAL v3 = VVAL(VTUP(x1)->cells[2]); + VAL v4 = mtw_mirth_c99_ZPlusC99Stack_ZPlusSWith(v3, x2); VTUP(x1)->cells[2] = v4; return x1; } static void mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr (VAL x1, VAL x2, int64_t *x3, VAL *x4) { - VAL v5 = (VVAL(VTUP(x2)->cells[1])); - VAL v6 = (VVAL(VTUP(v5)->cells[6])); - int64_t v7; - VAL v8; - mw_mirth_type_Type_c99Z_repr(x1, v6, &v7, &v8); - VTUP(v5)->cells[6] = v8; - VTUP(x2)->cells[1] = v5; - *x4 = x2; - *x3 = v7; + int64_t v5; + VAL v6; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp6(x1, x2, &v5, &v6); + *x4 = v6; + *x3 = v5; } static void mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr (VAL x1, VAL x2, int64_t *x3, VAL *x4) { - VAL v5 = (VVAL(VTUP(x2)->cells[1])); - VAL v6 = (VVAL(VTUP(v5)->cells[6])); + VAL v5 = VVAL(VTUP(x2)->cells[1]); + VAL v6 = VVAL(VTUP(v5)->cells[7]); int64_t v7; VAL v8; mw_mirth_type_Resource_c99Z_repr(x1, v6, &v7, &v8); - VTUP(v5)->cells[6] = v8; + VTUP(v5)->cells[7] = v8; VTUP(x2)->cells[1] = v5; *x4 = x2; *x3 = v7; } -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_fromZ_stackZ_typeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { VAL v6 = mw_mirth_type_StackType_forceZ_consZAskZBang(x1); VAL x7; VAL x8; @@ -79374,15 +58317,9 @@ static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang (VAL case 0LL: { // None STR* v10; STRLIT(v10, "c99 error: tried to pop from invalid stack type", 47); - VAL v11 = (VVAL(VTUP(x2)->cells[1])); - VAL v12 = (VVAL(VTUP(v11)->cells[6])); + VAL v11 = VVAL(VTUP(x2)->cells[1]); + VAL v12 = VVAL(VTUP(v11)->cells[7]); mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v10), v12); - VAL r13 = pop_resource(); - VTUP(v11)->cells[6] = r13; - VTUP(x2)->cells[1] = v11; - VAL v14 = pop_value(); - x8 = v14; - x7 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -79400,12 +58337,12 @@ static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang (VAL mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v16, x7, &v19, &v20); VAL v21; VAL v22; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v20, v19, &v21, &v22); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v20, v19, &v21, &v22); *x5 = v22; *x4 = v21; *x3 = v18; } -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_fromZ_stackZ_typeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_fromZ_stackZ_typeZBang (VAL x1, VAL x2, VAL *x3, VAL *x4, VAL *x5) { VAL v6 = mw_mirth_type_StackType_forceZ_withZAskZBang(x1); VAL x7; VAL x8; @@ -79418,15 +58355,9 @@ static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_fromZ_stackZ_typeZ case 0LL: { // None STR* v10; STRLIT(v10, "c99 error: tried to pop from invalid stack type", 47); - VAL v11 = (VVAL(VTUP(x2)->cells[1])); - VAL v12 = (VVAL(VTUP(v11)->cells[6])); + VAL v11 = VVAL(VTUP(x2)->cells[1]); + VAL v12 = VVAL(VTUP(v11)->cells[7]); mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v10), v12); - VAL r13 = pop_resource(); - VTUP(v11)->cells[6] = r13; - VTUP(x2)->cells[1] = v11; - VAL v14 = pop_value(); - x8 = v14; - x7 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -79444,108 +58375,86 @@ static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_fromZ_stackZ_typeZ mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v16, x7, &v19, &v20); VAL v21; VAL v22; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v20, v19, &v21, &v22); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v20, v19, &v21, &v22); *x5 = v22; *x4 = v21; *x3 = v18; } -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_labelZ_fromZ_stackZ_typeZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { +static void mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZ_fromZ_stackZ_typeZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { VAL v7 = mw_mirth_type_StackType_forceZ_consZ_labelZAskZBang(x1, x2); VAL x8; - uint64_t x9; - VAL x10; + VAL x9; switch (get_data_tag(v7)) { case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v7); - x10 = v11; - x9 = x1; + VAL v10 = mtp_std_maybe_Maybe_1_Some(v7); + x9 = v10; x8 = x3; } break; case 0LL: { // None - STR* v12; - STRLIT(v12, "c99 error: tried to pop from invalid stack type", 47); - VAL v13 = (VVAL(VTUP(x3)->cells[1])); - VAL v14 = (VVAL(VTUP(v13)->cells[6])); - push_u64(x1); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v12), v14); - VAL r15 = pop_resource(); - VTUP(v13)->cells[6] = r15; - VTUP(x3)->cells[1] = v13; - VAL v16 = pop_value(); - x10 = v16; - uint64_t v17 = pop_u64(); - x9 = v17; - x8 = x3; + STR* v11; + STRLIT(v11, "c99 error: tried to pop from invalid stack type", 47); + VAL v12 = VVAL(VTUP(x3)->cells[1]); + VAL v13 = VVAL(VTUP(v12)->cells[7]); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v11), v13); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } + VAL v16; + VAL v17; + value_uncons(x9, &v16, &v17); VAL v18; VAL v19; - value_uncons(x10, &v18, &v19); - VAL v20; + value_uncons(v16, &v18, &v19); + decref(v18); + int64_t v20; VAL v21; - value_uncons(v18, &v20, &v21); - decref(v20); - int64_t v22; + mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v17, x8, &v20, &v21); + VAL v22; VAL v23; - mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v19, x8, &v22, &v23); - VAL v24; - VAL v25; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang(v22, x9, v23, &v24, &v25); - *x6 = v25; - *x5 = v24; - *x4 = v21; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang(v20, x1, v21, &v22, &v23); + *x6 = v23; + *x5 = v22; + *x4 = v19; } -static void mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_labelZ_fromZ_stackZ_typeZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { +static void mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZ_fromZ_stackZ_typeZBang (uint64_t x1, VAL x2, VAL x3, VAL *x4, VAL *x5, VAL *x6) { VAL v7 = mw_mirth_type_StackType_forceZ_withZ_labelZAskZBang(x1, x2); VAL x8; - uint64_t x9; - VAL x10; + VAL x9; switch (get_data_tag(v7)) { case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v7); - x10 = v11; - x9 = x1; + VAL v10 = mtp_std_maybe_Maybe_1_Some(v7); + x9 = v10; x8 = x3; } break; case 0LL: { // None - STR* v12; - STRLIT(v12, "c99 error: tried to pop from invalid stack type", 47); - VAL v13 = (VVAL(VTUP(x3)->cells[1])); - VAL v14 = (VVAL(VTUP(v13)->cells[6])); - push_u64(x1); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v12), v14); - VAL r15 = pop_resource(); - VTUP(v13)->cells[6] = r15; - VTUP(x3)->cells[1] = v13; - VAL v16 = pop_value(); - x10 = v16; - uint64_t v17 = pop_u64(); - x9 = v17; - x8 = x3; + STR* v11; + STRLIT(v11, "c99 error: tried to pop from invalid stack type", 47); + VAL v12 = VVAL(VTUP(x3)->cells[1]); + VAL v13 = VVAL(VTUP(v12)->cells[7]); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v11), v13); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } + VAL v16; + VAL v17; + value_uncons(x9, &v16, &v17); VAL v18; VAL v19; - value_uncons(x10, &v18, &v19); - VAL v20; + value_uncons(v16, &v18, &v19); + decref(v18); + int64_t v20; VAL v21; - value_uncons(v18, &v20, &v21); - decref(v20); - int64_t v22; + mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v17, x8, &v20, &v21); + VAL v22; VAL v23; - mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v19, x8, &v22, &v23); - VAL v24; - VAL v25; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang(v22, x9, v23, &v24, &v25); - *x6 = v25; - *x5 = v24; - *x4 = v21; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang(v20, x1, v21, &v22, &v23); + *x6 = v23; + *x5 = v22; + *x4 = v19; } static VAL mw_mirth_c99_c99Z_primZBang (VAL x1, int64_t x2, VAL x3) { VAL x4; @@ -79561,9 +58470,9 @@ static VAL mw_mirth_c99_c99Z_primZBang (VAL x1, int64_t x2, VAL x3) { VAL v6; VAL v7; VAL v8; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang(v5, x3, &v6, &v7, &v8); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_fromZ_stackZ_typeZBang(v5, x3, &v6, &v7, &v8); decref(v6); - VAL v9 = (mw_mirth_c99_ZPlusC99Local_dropZ_localZBang(v7, v8)); + VAL v9 = mw_mirth_c99_ZPlusC99Value_dropZ_valueZBang(v7, v8); x4 = v9; } break; case 1LL: { // PRIM_CORE_DUP @@ -79573,14 +58482,14 @@ static VAL mw_mirth_c99_c99Z_primZBang (VAL x1, int64_t x2, VAL x3) { VAL v11; VAL v12; VAL v13; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang(v10, x3, &v11, &v12, &v13); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_fromZ_stackZ_typeZBang(v10, x3, &v11, &v12, &v13); decref(v11); VAL v14; VAL v15; VAL v16; - mw_mirth_c99_ZPlusC99Local_dupZ_localZBang(v12, v13, &v14, &v15, &v16); - VAL v17 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v14, v15)); - VAL v18 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v17, v16)); + mw_mirth_c99_ZPlusC99Value_dupZ_valueZBang(v12, v13, &v14, &v15, &v16); + VAL v17 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v14, v15); + VAL v18 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v17, v16); x4 = v18; } break; case 3LL: { // PRIM_CORE_SWAP @@ -79590,14 +58499,14 @@ static VAL mw_mirth_c99_c99Z_primZBang (VAL x1, int64_t x2, VAL x3) { VAL v20; VAL v21; VAL v22; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang(v19, x3, &v20, &v21, &v22); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_fromZ_stackZ_typeZBang(v19, x3, &v20, &v21, &v22); VAL v23; VAL v24; VAL v25; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang(v20, v21, &v23, &v24, &v25); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_fromZ_stackZ_typeZBang(v20, v21, &v23, &v24, &v25); decref(v23); - VAL v26 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v24, v22)); - VAL v27 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v26, v25)); + VAL v26 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v24, v22); + VAL v27 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v26, v25); x4 = v27; } break; case 4LL: { // PRIM_CORE_RSWAP @@ -79607,14 +58516,14 @@ static VAL mw_mirth_c99_c99Z_primZBang (VAL x1, int64_t x2, VAL x3) { VAL v29; VAL v30; VAL v31; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_fromZ_stackZ_typeZBang(v28, x3, &v29, &v30, &v31); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_fromZ_stackZ_typeZBang(v28, x3, &v29, &v30, &v31); VAL v32; VAL v33; VAL v34; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_fromZ_stackZ_typeZBang(v29, v30, &v32, &v33, &v34); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_fromZ_stackZ_typeZBang(v29, v30, &v32, &v33, &v34); decref(v32); - VAL v35 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v33, v31)); - VAL v36 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v35, v34)); + VAL v35 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v33, v31); + VAL v36 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v35, v34); x4 = v36; } break; case 5LL: { // PRIM_CORE_DIP @@ -79625,11 +58534,11 @@ static VAL mw_mirth_c99_c99Z_primZBang (VAL x1, int64_t x2, VAL x3) { VAL v38 = mw_std_list_List_1_ZDivL1(v37); VAL x39; VAL x40; - uint64_t x41; + VAL x41; switch (get_data_tag(v38)) { case 1LL: { // Some VAL v42 = mtp_std_maybe_Maybe_1_Some(v38); - x41 = VU64(v42); + x41 = v42; x40 = x1; x39 = x3; } break; @@ -79638,2118 +58547,2017 @@ static VAL mw_mirth_c99_c99Z_primZBang (VAL x1, int64_t x2, VAL x3) { decref(x1); STR* v44; STRLIT(v44, "unexpected number of arguments to PRIM_CORE_DIP", 47); - VAL v45 = (VVAL(VTUP(x3)->cells[1])); - VAL v46 = (VVAL(VTUP(v45)->cells[6])); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v43, MKSTR(v44), v46); - VAL r47 = pop_resource(); - VTUP(v45)->cells[6] = r47; - VTUP(x3)->cells[1] = v45; - uint64_t v48 = pop_u64(); - x41 = v48; - VAL v49 = pop_value(); - x40 = v49; - x39 = x3; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13(v43, MKSTR(v44), x3); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v50 = VVAL(VTUP(x40)->cells[6]); - incref(v50); + VAL v48 = VVAL(VTUP(x40)->cells[6]); + incref(v48); decref(x40); + VAL v49; + VAL v50; VAL v51; - VAL v52; - VAL v53; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_fromZ_stackZ_typeZBang(v50, x39, &v51, &v52, &v53); - decref(v51); - VAL v54 = (mw_mirth_c99_c99Z_argZ_runZBang(x41, v52)); - VAL v55 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v54, v53)); - x4 = v55; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_fromZ_stackZ_typeZBang(v48, x39, &v49, &v50, &v51); + decref(v49); + VAL v52 = mw_mirth_c99_c99Z_argZ_runZBang(VU64(x41), v50); + VAL v53 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v52, v51); + x4 = v53; } break; case 6LL: { // PRIM_CORE_RDIP incref(x1); - VAL v56 = VVAL(VTUP(x1)->cells[5]); - incref(v56); + VAL v54 = VVAL(VTUP(x1)->cells[5]); + incref(v54); decref(x1); - VAL v57 = mw_std_list_List_1_ZDivL1(v56); + VAL v55 = mw_std_list_List_1_ZDivL1(v54); + VAL x56; + VAL x57; VAL x58; - VAL x59; - uint64_t x60; - switch (get_data_tag(v57)) { + switch (get_data_tag(v55)) { case 1LL: { // Some - VAL v61 = mtp_std_maybe_Maybe_1_Some(v57); - x60 = VU64(v61); - x59 = x1; - x58 = x3; + VAL v59 = mtp_std_maybe_Maybe_1_Some(v55); + x58 = v59; + x57 = x1; + x56 = x3; } break; case 0LL: { // None - uint64_t v62 = VU64(VTUP(x1)->cells[2]); + uint64_t v60 = VU64(VTUP(x1)->cells[2]); decref(x1); - STR* v63; - STRLIT(v63, "unexpected number of arguments to PRIM_CORE_RDIP", 48); - VAL v64 = (VVAL(VTUP(x3)->cells[1])); - VAL v65 = (VVAL(VTUP(v64)->cells[6])); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v62, MKSTR(v63), v65); - VAL r66 = pop_resource(); - VTUP(v64)->cells[6] = r66; - VTUP(x3)->cells[1] = v64; - uint64_t v67 = pop_u64(); - x60 = v67; - VAL v68 = pop_value(); - x59 = v68; - x58 = x3; + STR* v61; + STRLIT(v61, "unexpected number of arguments to PRIM_CORE_RDIP", 48); + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13(v60, MKSTR(v61), x3); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v69 = VVAL(VTUP(x59)->cells[6]); - incref(v69); - decref(x59); - VAL v70; - VAL v71; - VAL v72; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_resourceZ_fromZ_stackZ_typeZBang(v69, x58, &v70, &v71, &v72); - decref(v70); - VAL v73 = (mw_mirth_c99_c99Z_argZ_runZBang(x60, v71)); - VAL v74 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v73, v72)); - x4 = v74; + VAL v65 = VVAL(VTUP(x57)->cells[6]); + incref(v65); + decref(x57); + VAL v66; + VAL v67; + VAL v68; + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_fromZ_stackZ_typeZBang(v65, x56, &v66, &v67, &v68); + decref(v66); + VAL v69 = mw_mirth_c99_c99Z_argZ_runZBang(VU64(x58), v67); + VAL v70 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v69, v68); + x4 = v70; } break; case 7LL: { // PRIM_CORE_IF incref(x1); - VAL v75 = VVAL(VTUP(x1)->cells[5]); - incref(v75); + VAL v71 = VVAL(VTUP(x1)->cells[5]); + incref(v71); decref(x1); - VAL v76 = mw_std_list_List_1_ZDivL2(v75); - VAL x77; - VAL x78; - VAL x79; - switch (get_data_tag(v76)) { + VAL v72 = mw_std_list_List_1_ZDivL2(v71); + VAL x73; + VAL x74; + VAL x75; + switch (get_data_tag(v72)) { case 1LL: { // Some - VAL v80 = mtp_std_maybe_Maybe_1_Some(v76); - x79 = v80; - x78 = x1; - x77 = x3; + VAL v76 = mtp_std_maybe_Maybe_1_Some(v72); + x75 = v76; + x74 = x1; + x73 = x3; } break; case 0LL: { // None - uint64_t v81 = VU64(VTUP(x1)->cells[2]); + uint64_t v77 = VU64(VTUP(x1)->cells[2]); decref(x1); - STR* v82; - STRLIT(v82, "unexpected number of arguments to PRIM_CORE_IF", 46); - VAL v83 = (VVAL(VTUP(x3)->cells[1])); - VAL v84 = (VVAL(VTUP(v83)->cells[6])); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v81, MKSTR(v82), v84); - VAL r85 = pop_resource(); - VTUP(v83)->cells[6] = r85; - VTUP(x3)->cells[1] = v83; - VAL v86 = pop_value(); - x79 = v86; - VAL v87 = pop_value(); - x78 = v87; - x77 = x3; + STR* v78; + STRLIT(v78, "unexpected number of arguments to PRIM_CORE_IF", 46); + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13(v77, MKSTR(v78), x3); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } + VAL v82; + VAL v83; + value_uncons(x75, &v82, &v83); + VAL v84; + VAL v85; + value_uncons(v82, &v84, &v85); + decref(v84); + int64_t v86 = 12LL /* C99RT_BOOL */; + VAL v87; VAL v88; - VAL v89; - value_uncons(x79, &v88, &v89); - VAL v90; - VAL v91; - value_uncons(v88, &v90, &v91); - decref(v90); - int64_t v92 = 12LL /* C99RT_BOOL */; - VAL v93; - VAL v94; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x77, v92, &v93, &v94); - VAL v95 = (VVAL(VTUP(v93)->cells[1])); - VAL v96 = (VVAL(VTUP(v95)->cells[6])); - VAL v97 = VVAL(VTUP(x78)->cells[7]); - incref(v97); - decref(x78); - VTUP(v95)->cells[6] = v96; - VTUP(v93)->cells[1] = v95; - VAL v98 = (mw_mirth_c99_ZPlusC99Branch_beginZ_branchZ_splitZBang(v97, v93)); - VAL v99 = (VVAL(VTUP(v98)->cells[1])); - VAL v100 = (mw_mirth_c99_ZPlusC99_indent(v99)); - STR* v101; - STRLIT(v101, "if (", 4); - VAL v102 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v101), v100)); - int64_t v103 = 12LL /* C99RT_BOOL */; - VAL v104 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v103, v94); - VAL v105 = (mw_mirth_c99_ZPlusC99_put(v104, v102)); - STR* v106; - STRLIT(v106, ") {", 3); - VAL v107 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v106), v105)); - VAL v108 = (mw_mirth_c99_ZPlusC99_line(v107)); - VTUP(v98)->cells[1] = v108; - VAL v109 = (VVAL(VTUP(v98)->cells[1])); - int64_t v110 = VI64(VTUP(v109)->cells[2]); - int64_t v111 = 1LL; - int64_t v112 = i64_add(v110, v111); - VTUP(v109)->cells[2] = MKI64(v112); - VTUP(v98)->cells[1] = v109; - VAL v113 = (VVAL(VTUP(v98)->cells[2])); - VAL v114; - VAL v115; - mw_mirth_c99_ZPlusC99StackCache_rdup(v113, &v114, &v115); - VTUP(v98)->cells[2] = v114; - VAL v116 = VVAL(VTUP(v98)->cells[3]); - incref(v116); - VAL v117 = (VVAL(VTUP(v98)->cells[1])); - VAL v118 = (mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v117, v115)); - VAL v119 = (mw_mirth_c99_c99Z_argZ_runZBang(VU64(v91), v118)); - VAL v120 = mw_std_list_List_1_reverse(v116); - VAL v121; - VAL v122; - mw_std_list_List_1_uncons(v120, &v121, &v122); - VAL x123; - VAL x124; - int64_t x125; - switch (get_data_tag(v121)) { - case 1LL: { // Some - VAL v126 = mtp_std_maybe_Maybe_1_Some(v121); - VAL v127 = (mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang(v126, v119)); - int64_t v128 = 1LL /* True */; - x125 = v128; - x124 = v122; - x123 = v127; - push_value(v89); - } break; - case 0LL: { // None - int64_t v129 = 0LL /* False */; - x125 = v129; - x124 = v122; - x123 = v119; - push_value(v89); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v130 = (x123); - VAL v131 = x124; - int64_t v132 = x125; - while (((bool)v132)) { - VAL v133 = (v130); - VAL v134 = v131; - VAL v135; - VAL v136; - mw_std_list_List_1_uncons(v134, &v135, &v136); - VAL x137; - VAL x138; - int64_t x139; - switch (get_data_tag(v135)) { - case 1LL: { // Some - VAL v140 = mtp_std_maybe_Maybe_1_Some(v135); - VAL v141 = (mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang(v140, v133)); - int64_t v142 = 1LL /* True */; - x139 = v142; - x138 = v136; - x137 = v141; - } break; - case 0LL: { // None - int64_t v143 = 0LL /* False */; - x139 = v143; - x138 = v136; - x137 = v133; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v132 = x139; - v131 = x138; - v130 = x137; - } - decref(v131); - VAL v144 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v130)); - VTUP(v98)->cells[1] = v144; - VAL v145 = (VVAL(VTUP(v98)->cells[1])); - int64_t v146 = VI64(VTUP(v145)->cells[2]); - int64_t v147 = 1LL; - int64_t v148 = i64_sub(v146, v147); - int64_t v149 = 0LL; - bool v150 = (v148 < v149); - int64_t x151; - if (v150) { - int64_t v152 = 0LL; - x151 = v152; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x73, v86, &v87, &v88); + VAL v89 = VVAL(VTUP(v87)->cells[1]); + VAL v90 = VVAL(VTUP(v89)->cells[7]); + VAL v91 = VVAL(VTUP(x74)->cells[7]); + incref(v91); + decref(x74); + VTUP(v89)->cells[7] = v90; + VTUP(v87)->cells[1] = v89; + VAL v92 = mw_mirth_c99_ZPlusC99Branch_beginZ_branchZ_splitZBang(v91, v87); + int64_t v93 = VI64(VTUP(v92)->cells[4]); + VAL v94 = VVAL(VTUP(v92)->cells[1]); + int64_t v95 = VI64(VTUP(v94)->cells[4]); + VTUP(v94)->cells[4] = MKI64(v93); + VAL v96 = mw_mirth_c99_ZPlusC99_indent(v94); + STR* v97; + STRLIT(v97, "if (", 4); + VAL v98 = mw_mirth_c99_ZPlusC99_put(MKSTR(v97), v96); + int64_t v99 = 12LL /* C99RT_BOOL */; + VAL v100 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v99, v88); + VAL v101 = mw_mirth_c99_ZPlusC99_put(v100, v98); + STR* v102; + STRLIT(v102, ") {", 3); + VAL v103 = mw_mirth_c99_ZPlusC99_put(MKSTR(v102), v101); + VAL v104 = mw_mirth_c99_ZPlusC99_line(v103); + VTUP(v104)->cells[4] = MKI64(v95); + VTUP(v92)->cells[1] = v104; + VAL v105 = VVAL(VTUP(v92)->cells[1]); + int64_t v106 = VI64(VTUP(v105)->cells[2]); + int64_t v107 = 1LL; + int64_t v108 = i64_add(v106, v107); + VTUP(v105)->cells[2] = MKI64(v108); + VTUP(v92)->cells[1] = v105; + VAL v109 = VVAL(VTUP(v92)->cells[2]); + VAL v110; + VAL v111; + mw_mirth_c99_ZPlusC99Stack_rdup(v109, &v110, &v111); + VTUP(v92)->cells[2] = v110; + VAL v112 = VVAL(VTUP(v92)->cells[3]); + incref(v112); + int64_t v113 = VI64(VTUP(v92)->cells[4]); + VAL v114 = VVAL(VTUP(v92)->cells[1]); + VAL v115 = mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v114, v111, v113); + VAL v116 = mw_mirth_c99_c99Z_argZ_runZBang(VU64(v85), v115); + VAL v117 = mw_std_list_List_1_reverseZ_for_1_sp5(v116, v112); + VAL v118; + int64_t v119; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v117, &v118, &v119); + VTUP(v92)->cells[1] = v118; + int64_t v120 = VI64(VTUP(v92)->cells[5]); + bool v121 = (((bool)v119) || ((bool)v120)); + VTUP(v92)->cells[5] = MKBOOL(v121); + VAL v122 = VVAL(VTUP(v92)->cells[1]); + int64_t v123 = VI64(VTUP(v122)->cells[2]); + int64_t v124 = 1LL; + int64_t v125 = i64_sub(v123, v124); + int64_t v126 = 0LL; + bool v127 = (v125 < v126); + int64_t x128; + if (v127) { + int64_t v129 = 0LL; + x128 = v129; } else { - x151 = v148; - } - VTUP(v145)->cells[2] = MKI64(x151); - VTUP(v98)->cells[1] = v145; - VAL v153 = (VVAL(VTUP(v98)->cells[1])); - VAL v154 = (mw_mirth_c99_ZPlusC99_indent(v153)); - STR* v155; - STRLIT(v155, "} else {", 8); - VAL v156 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v155), v154)); - VAL v157 = (mw_mirth_c99_ZPlusC99_line(v156)); - VTUP(v98)->cells[1] = v157; - VAL v158 = (VVAL(VTUP(v98)->cells[1])); - int64_t v159 = VI64(VTUP(v158)->cells[2]); - int64_t v160 = 1LL; - int64_t v161 = i64_add(v159, v160); - VTUP(v158)->cells[2] = MKI64(v161); - VTUP(v98)->cells[1] = v158; - VAL v162 = (VVAL(VTUP(v98)->cells[2])); - VAL v163; - VAL v164; - mw_mirth_c99_ZPlusC99StackCache_rdup(v162, &v163, &v164); - VTUP(v98)->cells[2] = v163; - VAL v165 = VVAL(VTUP(v98)->cells[3]); - incref(v165); - VAL v166 = (VVAL(VTUP(v98)->cells[1])); - VAL v167 = (mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v166, v164)); - uint64_t v168 = pop_u64(); - VAL v169 = (mw_mirth_c99_c99Z_argZ_runZBang(v168, v167)); - VAL v170 = mw_std_list_List_1_reverse(v165); - VAL v171; - VAL v172; - mw_std_list_List_1_uncons(v170, &v171, &v172); - VAL x173; - VAL x174; - int64_t x175; - switch (get_data_tag(v171)) { - case 1LL: { // Some - VAL v176 = mtp_std_maybe_Maybe_1_Some(v171); - VAL v177 = (mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang(v176, v169)); - int64_t v178 = 1LL /* True */; - x175 = v178; - x174 = v172; - x173 = v177; - } break; - case 0LL: { // None - int64_t v179 = 0LL /* False */; - x175 = v179; - x174 = v172; - x173 = v169; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v180 = (x173); - VAL v181 = x174; - int64_t v182 = x175; - while (((bool)v182)) { - VAL v183 = (v180); - VAL v184 = v181; - VAL v185; - VAL v186; - mw_std_list_List_1_uncons(v184, &v185, &v186); - VAL x187; - VAL x188; - int64_t x189; - switch (get_data_tag(v185)) { - case 1LL: { // Some - VAL v190 = mtp_std_maybe_Maybe_1_Some(v185); - VAL v191 = (mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang(v190, v183)); - int64_t v192 = 1LL /* True */; - x189 = v192; - x188 = v186; - x187 = v191; - } break; - case 0LL: { // None - int64_t v193 = 0LL /* False */; - x189 = v193; - x188 = v186; - x187 = v183; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v182 = x189; - v181 = x188; - v180 = x187; - } - decref(v181); - VAL v194 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v180)); - VTUP(v98)->cells[1] = v194; - VAL v195 = (VVAL(VTUP(v98)->cells[1])); - int64_t v196 = VI64(VTUP(v195)->cells[2]); - int64_t v197 = 1LL; - int64_t v198 = i64_sub(v196, v197); - int64_t v199 = 0LL; - bool v200 = (v198 < v199); - int64_t x201; - if (v200) { - int64_t v202 = 0LL; - x201 = v202; + x128 = v125; + } + VTUP(v122)->cells[2] = MKI64(x128); + VTUP(v92)->cells[1] = v122; + int64_t v130 = VI64(VTUP(v92)->cells[4]); + VAL v131 = VVAL(VTUP(v92)->cells[1]); + int64_t v132 = VI64(VTUP(v131)->cells[4]); + VTUP(v131)->cells[4] = MKI64(v130); + VAL v133 = mw_mirth_c99_ZPlusC99_indent(v131); + STR* v134; + STRLIT(v134, "} else {", 8); + VAL v135 = mw_mirth_c99_ZPlusC99_put(MKSTR(v134), v133); + VAL v136 = mw_mirth_c99_ZPlusC99_line(v135); + VTUP(v136)->cells[4] = MKI64(v132); + VTUP(v92)->cells[1] = v136; + VAL v137 = VVAL(VTUP(v92)->cells[1]); + int64_t v138 = VI64(VTUP(v137)->cells[2]); + int64_t v139 = 1LL; + int64_t v140 = i64_add(v138, v139); + VTUP(v137)->cells[2] = MKI64(v140); + VTUP(v92)->cells[1] = v137; + VAL v141 = VVAL(VTUP(v92)->cells[2]); + VAL v142; + VAL v143; + mw_mirth_c99_ZPlusC99Stack_rdup(v141, &v142, &v143); + VTUP(v92)->cells[2] = v142; + VAL v144 = VVAL(VTUP(v92)->cells[3]); + incref(v144); + int64_t v145 = VI64(VTUP(v92)->cells[4]); + VAL v146 = VVAL(VTUP(v92)->cells[1]); + VAL v147 = mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v146, v143, v145); + VAL v148 = mw_mirth_c99_c99Z_argZ_runZBang(VU64(v83), v147); + VAL v149 = mw_std_list_List_1_reverseZ_for_1_sp5(v148, v144); + VAL v150; + int64_t v151; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v149, &v150, &v151); + VTUP(v92)->cells[1] = v150; + int64_t v152 = VI64(VTUP(v92)->cells[5]); + bool v153 = (((bool)v151) || ((bool)v152)); + VTUP(v92)->cells[5] = MKBOOL(v153); + VAL v154 = VVAL(VTUP(v92)->cells[1]); + int64_t v155 = VI64(VTUP(v154)->cells[2]); + int64_t v156 = 1LL; + int64_t v157 = i64_sub(v155, v156); + int64_t v158 = 0LL; + bool v159 = (v157 < v158); + int64_t x160; + if (v159) { + int64_t v161 = 0LL; + x160 = v161; } else { - x201 = v198; + x160 = v157; } - VTUP(v195)->cells[2] = MKI64(x201); - VTUP(v98)->cells[1] = v195; - VAL v203 = (VVAL(VTUP(v98)->cells[1])); - VAL v204 = (mw_mirth_c99_ZPlusC99_indent(v203)); - STR* v205; - STRLIT(v205, "}", 1); - VAL v206 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v205), v204)); - VAL v207 = (mw_mirth_c99_ZPlusC99_line(v206)); - VTUP(v98)->cells[1] = v207; - VAL v208 = (mw_mirth_c99_ZPlusC99BranchSplit_endZ_branchZ_splitZBang(v98)); - x4 = v208; + VTUP(v154)->cells[2] = MKI64(x160); + VTUP(v92)->cells[1] = v154; + VAL v162 = mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp2(v92); + VAL v163 = mw_mirth_c99_ZPlusC99BranchSplit_endZ_branchZ_splitZBang(v162); + x4 = v163; } break; case 8LL: { // PRIM_CORE_WHILE incref(x1); - VAL v209 = VVAL(VTUP(x1)->cells[5]); - incref(v209); + VAL v164 = VVAL(VTUP(x1)->cells[5]); + incref(v164); decref(x1); - VAL v210 = mw_std_list_List_1_ZDivL2(v209); - VAL x211; - VAL x212; - VAL x213; - switch (get_data_tag(v210)) { + VAL v165 = mw_std_list_List_1_ZDivL2(v164); + VAL x166; + VAL x167; + VAL x168; + switch (get_data_tag(v165)) { case 1LL: { // Some - VAL v214 = mtp_std_maybe_Maybe_1_Some(v210); - x213 = v214; - x212 = x1; - x211 = x3; + VAL v169 = mtp_std_maybe_Maybe_1_Some(v165); + x168 = v169; + x167 = x1; + x166 = x3; } break; case 0LL: { // None - uint64_t v215 = VU64(VTUP(x1)->cells[2]); + uint64_t v170 = VU64(VTUP(x1)->cells[2]); decref(x1); - STR* v216; - STRLIT(v216, "unexpected number of arguments to PRIM_CORE_WHILE", 49); - VAL v217 = (VVAL(VTUP(x3)->cells[1])); - VAL v218 = (VVAL(VTUP(v217)->cells[6])); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v215, MKSTR(v216), v218); - VAL r219 = pop_resource(); - VTUP(v217)->cells[6] = r219; - VTUP(x3)->cells[1] = v217; - VAL v220 = pop_value(); - x213 = v220; - VAL v221 = pop_value(); - x212 = v221; - x211 = x3; + STR* v171; + STRLIT(v171, "unexpected number of arguments to PRIM_CORE_WHILE", 49); + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13(v170, MKSTR(v171), x3); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - decref(x212); + decref(x167); + VAL v175; + VAL v176; + value_uncons(x168, &v175, &v176); + VAL v177; + VAL v178; + value_uncons(v175, &v177, &v178); + decref(v177); + incref(v178); + VAL v179 = mw_mirth_c99_c99Z_argZ_runZBang(VU64(v178), x166); + int64_t v180 = 12LL /* C99RT_BOOL */; + VAL v181; + VAL v182; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v179, v180, &v181, &v182); + VAL v183 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v181, v182); + VAL v184 = mw_mirth_c99_ZPlusC99Branch_refreshZ_branchZBang(v183); + VAL v185 = VVAL(VTUP(v184)->cells[2]); + VAL v186; + VAL v187; + mw_mirth_c99_ZPlusC99Stack_rdup(v185, &v186, &v187); + VTUP(v184)->cells[2] = v186; + int64_t v188 = 12LL /* C99RT_BOOL */; + VAL v189; + VAL v190; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v184, v188, &v189, &v190); + VAL v191 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v188, v190); + int64_t v192 = VI64(VTUP(v189)->cells[3]); + VAL v193 = VVAL(VTUP(v189)->cells[1]); + int64_t v194 = VI64(VTUP(v193)->cells[4]); + VTUP(v193)->cells[4] = MKI64(v192); + VAL v195 = mw_mirth_c99_ZPlusC99_indent(v193); + STR* v196; + STRLIT(v196, "while (", 7); + VAL v197 = mw_mirth_c99_ZPlusC99_put(MKSTR(v196), v195); + VAL v198 = mw_mirth_c99_ZPlusC99_put(v191, v197); + STR* v199; + STRLIT(v199, ") {", 3); + VAL v200 = mw_mirth_c99_ZPlusC99_put(MKSTR(v199), v198); + VAL v201 = mw_mirth_c99_ZPlusC99_line(v200); + VTUP(v201)->cells[4] = MKI64(v194); + VTUP(v189)->cells[1] = v201; + VAL v202 = VVAL(VTUP(v189)->cells[1]); + int64_t v203 = VI64(VTUP(v202)->cells[2]); + int64_t v204 = 1LL; + int64_t v205 = i64_add(v203, v204); + VTUP(v202)->cells[2] = MKI64(v205); + VTUP(v189)->cells[1] = v202; + VAL v206 = mw_mirth_c99_ZPlusC99Branch_refreshZ_branchZBang(v189); + VAL v207 = mw_mirth_c99_c99Z_argZ_runZBang(VU64(v176), v206); + VAL v208 = mw_mirth_c99_c99Z_argZ_runZBang(VU64(v178), v207); + VAL v209 = mw_mirth_c99_ZPlusC99Stack_tieZ_knotZBang(v208, v187); + VAL v210 = VVAL(VTUP(v209)->cells[1]); + int64_t v211 = VI64(VTUP(v210)->cells[2]); + int64_t v212 = 1LL; + int64_t v213 = i64_sub(v211, v212); + int64_t v214 = 0LL; + bool v215 = (v213 < v214); + int64_t x216; + if (v215) { + int64_t v217 = 0LL; + x216 = v217; + } else { + x216 = v213; + } + VTUP(v210)->cells[2] = MKI64(x216); + VTUP(v209)->cells[1] = v210; + int64_t v218 = VI64(VTUP(v209)->cells[3]); + VAL v219 = VVAL(VTUP(v209)->cells[1]); + VAL v220 = mw_mirth_c99_ZPlusC99_c99Z_lineZ_if_1_sp21(v218, v219); + VTUP(v209)->cells[1] = v220; + int64_t v221 = 12LL /* C99RT_BOOL */; VAL v222; VAL v223; - value_uncons(x213, &v222, &v223); - VAL v224; - VAL v225; - value_uncons(v222, &v224, &v225); - decref(v224); - incref(v225); - VAL v226 = (mw_mirth_c99_c99Z_argZ_runZBang(VU64(v225), x211)); - int64_t v227 = 12LL /* C99RT_BOOL */; - VAL v228; - VAL v229; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v226, v227, &v228, &v229); - VAL v230 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v228, v229)); - VAL v231 = (mw_mirth_c99_ZPlusC99Branch_refreshZ_branchZBang(v230)); - VAL v232 = (VVAL(VTUP(v231)->cells[2])); - VAL v233; - VAL v234; - mw_mirth_c99_ZPlusC99StackCache_rdup(v232, &v233, &v234); - VTUP(v231)->cells[2] = v233; - int64_t v235 = 12LL /* C99RT_BOOL */; - VAL v236; - VAL v237; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v231, v235, &v236, &v237); - VAL v238 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v235, v237); - VAL v239 = (VVAL(VTUP(v236)->cells[1])); - VAL v240 = (mw_mirth_c99_ZPlusC99_indent(v239)); - STR* v241; - STRLIT(v241, "while (", 7); - VAL v242 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v241), v240)); - VAL v243 = (mw_mirth_c99_ZPlusC99_put(v238, v242)); - STR* v244; - STRLIT(v244, ") {", 3); - VAL v245 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v244), v243)); - VAL v246 = (mw_mirth_c99_ZPlusC99_line(v245)); - VTUP(v236)->cells[1] = v246; - VAL v247 = (VVAL(VTUP(v236)->cells[1])); - int64_t v248 = VI64(VTUP(v247)->cells[2]); - int64_t v249 = 1LL; - int64_t v250 = i64_add(v248, v249); - VTUP(v247)->cells[2] = MKI64(v250); - VTUP(v236)->cells[1] = v247; - VAL v251 = (mw_mirth_c99_ZPlusC99Branch_refreshZ_branchZBang(v236)); - VAL v252 = (mw_mirth_c99_c99Z_argZ_runZBang(VU64(v223), v251)); - VAL v253 = (mw_mirth_c99_c99Z_argZ_runZBang(VU64(v225), v252)); - VAL v254 = (mw_mirth_c99_ZPlusC99StackCache_tieZ_knotZBang(v253, v234)); - VAL v255 = (VVAL(VTUP(v254)->cells[1])); - int64_t v256 = VI64(VTUP(v255)->cells[2]); - int64_t v257 = 1LL; - int64_t v258 = i64_sub(v256, v257); - int64_t v259 = 0LL; - bool v260 = (v258 < v259); - int64_t x261; - if (v260) { - int64_t v262 = 0LL; - x261 = v262; - } else { - x261 = v258; - } - VTUP(v255)->cells[2] = MKI64(x261); - VTUP(v254)->cells[1] = v255; - VAL v263 = (VVAL(VTUP(v254)->cells[1])); - VAL v264 = (mw_mirth_c99_ZPlusC99_indent(v263)); - STR* v265; - STRLIT(v265, "}", 1); - VAL v266 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v265), v264)); - VAL v267 = (mw_mirth_c99_ZPlusC99_line(v266)); - VTUP(v254)->cells[1] = v267; - int64_t v268 = 12LL /* C99RT_BOOL */; - VAL v269; - VAL v270; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v254, v268, &v269, &v270); - mw_mirth_c99_ZPlusC99Local_rdrop(v270); - x4 = v269; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v209, v221, &v222, &v223); + mw_mirth_c99_ZPlusC99Value_rdrop(v223); + x4 = v222; } break; case 9LL: { // PRIM_CORE_DEBUG decref(x1); - VAL v271 = (mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(x3)); - VAL v272 = (VVAL(VTUP(v271)->cells[1])); - VAL v273 = (mw_mirth_c99_ZPlusC99_indent(v272)); - STR* v274; - STRLIT(v274, "trace_stack();", 14); - VAL v275 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v274), v273)); - VAL v276 = (mw_mirth_c99_ZPlusC99_line(v275)); - VTUP(v271)->cells[1] = v276; - x4 = v271; + VAL v224 = mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(x3); + int64_t v225 = VI64(VTUP(v224)->cells[3]); + VAL v226 = VVAL(VTUP(v224)->cells[1]); + int64_t v227 = VI64(VTUP(v226)->cells[4]); + VTUP(v226)->cells[4] = MKI64(v225); + VAL v228 = mw_mirth_c99_ZPlusC99_indent(v226); + STR* v229; + STRLIT(v229, "trace_stack();", 14); + VAL v230 = mw_mirth_c99_ZPlusC99_put(MKSTR(v229), v228); + VAL v231 = mw_mirth_c99_ZPlusC99_line(v230); + VTUP(v231)->cells[4] = MKI64(v227); + VTUP(v224)->cells[1] = v231; + x4 = v224; } break; case 10LL: { // PRIM_CORE_PANIC decref(x1); - int64_t v277 = 1LL /* C99RT_STR */; - VAL v278; - VAL v279; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x3, v277, &v278, &v279); - VAL v280 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v277, v279); - VAL v281 = (mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(v278)); - VAL v282 = (VVAL(VTUP(v281)->cells[1])); - VAL v283 = (mw_mirth_c99_ZPlusC99_indent(v282)); - STR* v284; - STRLIT(v284, "do_panic(", 9); - VAL v285 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v284), v283)); - VAL v286 = (mw_mirth_c99_ZPlusC99_put(v280, v285)); - STR* v287; - STRLIT(v287, ");", 2); - VAL v288 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v287), v286)); - VAL v289 = (mw_mirth_c99_ZPlusC99_line(v288)); - VTUP(v281)->cells[1] = v289; - x4 = v281; + int64_t v232 = 1LL /* C99RT_STR */; + VAL v233; + VAL v234; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x3, v232, &v233, &v234); + VAL v235 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v232, v234); + int64_t v236 = VI64(VTUP(v233)->cells[3]); + VAL v237 = VVAL(VTUP(v233)->cells[1]); + int64_t v238 = VI64(VTUP(v237)->cells[4]); + VTUP(v237)->cells[4] = MKI64(v236); + VAL v239 = mw_mirth_c99_ZPlusC99_indent(v237); + STR* v240; + STRLIT(v240, "do_panic(", 9); + VAL v241 = mw_mirth_c99_ZPlusC99_put(MKSTR(v240), v239); + VAL v242 = mw_mirth_c99_ZPlusC99_put(v235, v241); + STR* v243; + STRLIT(v243, ");", 2); + VAL v244 = mw_mirth_c99_ZPlusC99_put(MKSTR(v243), v242); + VAL v245 = mw_mirth_c99_ZPlusC99_line(v244); + VTUP(v245)->cells[4] = MKI64(v238); + VTUP(v233)->cells[1] = v245; + VAL v246 = VVAL(VTUP(v233)->cells[2]); + mw_mirth_c99_ZPlusC99Stack_rdrop(v246); + VAL v247 = MKI64(0LL /* +SNil */); + VTUP(v233)->cells[2] = v247; + int64_t v248 = 0LL /* False */; + VTUP(v233)->cells[3] = MKI64(v248); + x4 = v233; } break; case 11LL: { // PRIM_CORE_RUN incref(x1); - VAL v290 = VVAL(VTUP(x1)->cells[5]); - incref(v290); + VAL v249 = VVAL(VTUP(x1)->cells[5]); + incref(v249); decref(x1); - int64_t v291 = mw_std_list_List_1_emptyZAsk(v290); - VAL x292; - VAL x293; - if (((bool)v291)) { - x293 = x1; - x292 = x3; + int64_t v250 = mw_std_list_List_1_emptyZAsk(v249); + VAL x251; + VAL x252; + if (((bool)v250)) { + x252 = x1; + x251 = x3; } else { - uint64_t v294 = VU64(VTUP(x1)->cells[2]); + uint64_t v253 = VU64(VTUP(x1)->cells[2]); decref(x1); - STR* v295; - STRLIT(v295, "expected no arguments to prim-core-run", 38); - VAL v296 = (VVAL(VTUP(x3)->cells[1])); - VAL v297 = (VVAL(VTUP(v296)->cells[6])); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v294, MKSTR(v295), v297); - VAL r298 = pop_resource(); - VTUP(v296)->cells[6] = r298; - VTUP(x3)->cells[1] = v296; - VAL v299 = pop_value(); - x293 = v299; - x292 = x3; - } - decref(x293); - int64_t v300 = 0LL /* C99RT_VAL */; - VAL v301; - VAL v302; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x292, v300, &v301, &v302); - VAL v303 = (mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(v301)); - VAL v304 = (VVAL(VTUP(v303)->cells[1])); - VAL v305 = (mw_mirth_c99_ZPlusC99_indent(v304)); - STR* v306; - STRLIT(v306, "run_value(", 10); - VAL v307 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v306), v305)); - VAL v308 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v302); - VAL v309 = (mw_mirth_c99_ZPlusC99_put(v308, v307)); - STR* v310; - STRLIT(v310, ");", 2); - VAL v311 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v310), v309)); - VAL v312 = (mw_mirth_c99_ZPlusC99_line(v311)); - VTUP(v303)->cells[1] = v312; - x4 = v303; + STR* v254; + STRLIT(v254, "expected no arguments to prim-core-run", 38); + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13(v253, MKSTR(v254), x3); + } + decref(x252); + int64_t v257 = 0LL /* C99RT_VAL */; + VAL v258; + VAL v259; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x251, v257, &v258, &v259); + VAL v260 = mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(v258); + int64_t v261 = VI64(VTUP(v260)->cells[3]); + VAL v262 = VVAL(VTUP(v260)->cells[1]); + int64_t v263 = VI64(VTUP(v262)->cells[4]); + VTUP(v262)->cells[4] = MKI64(v261); + VAL v264 = mw_mirth_c99_ZPlusC99_indent(v262); + STR* v265; + STRLIT(v265, "run_value(", 10); + VAL v266 = mw_mirth_c99_ZPlusC99_put(MKSTR(v265), v264); + VAL v267 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v259); + VAL v268 = mw_mirth_c99_ZPlusC99_put(v267, v266); + STR* v269; + STRLIT(v269, ");", 2); + VAL v270 = mw_mirth_c99_ZPlusC99_put(MKSTR(v269), v268); + VAL v271 = mw_mirth_c99_ZPlusC99_line(v270); + VTUP(v271)->cells[4] = MKI64(v263); + VTUP(v260)->cells[1] = v271; + x4 = v260; } break; case 14LL: { // PRIM_INT_EQ decref(x1); - STR* v313; - STRLIT(v313, "(", 1); - int64_t v314 = 2LL /* C99RT_I64 */; - STR* v315; - STRLIT(v315, " == ", 4); - int64_t v316 = 2LL /* C99RT_I64 */; - STR* v317; - STRLIT(v317, ")", 1); - int64_t v318 = 0LL /* False */; - int64_t v319 = 12LL /* C99RT_BOOL */; - VAL v320 = mtw_std_maybe_Maybe_1_Some(MKI64(v319)); - VAL v321 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v313), v314, MKSTR(v315), v316, MKSTR(v317), v318, v320, x3)); - x4 = v321; + STR* v272; + STRLIT(v272, "(", 1); + int64_t v273 = 2LL /* C99RT_I64 */; + STR* v274; + STRLIT(v274, " == ", 4); + int64_t v275 = 2LL /* C99RT_I64 */; + STR* v276; + STRLIT(v276, ")", 1); + int64_t v277 = 0LL /* False */; + int64_t v278 = 12LL /* C99RT_BOOL */; + VAL v279 = mtw_std_maybe_Maybe_1_Some(MKI64(v278)); + VAL v280 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v272), v273, MKSTR(v274), v275, MKSTR(v276), v277, v279, x3); + x4 = v280; } break; case 15LL: { // PRIM_INT_LT decref(x1); - STR* v322; - STRLIT(v322, "(", 1); - int64_t v323 = 2LL /* C99RT_I64 */; - STR* v324; - STRLIT(v324, " < ", 3); - int64_t v325 = 2LL /* C99RT_I64 */; - STR* v326; - STRLIT(v326, ")", 1); - int64_t v327 = 0LL /* False */; - int64_t v328 = 12LL /* C99RT_BOOL */; - VAL v329 = mtw_std_maybe_Maybe_1_Some(MKI64(v328)); - VAL v330 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v322), v323, MKSTR(v324), v325, MKSTR(v326), v327, v329, x3)); - x4 = v330; + STR* v281; + STRLIT(v281, "(", 1); + int64_t v282 = 2LL /* C99RT_I64 */; + STR* v283; + STRLIT(v283, " < ", 3); + int64_t v284 = 2LL /* C99RT_I64 */; + STR* v285; + STRLIT(v285, ")", 1); + int64_t v286 = 0LL /* False */; + int64_t v287 = 12LL /* C99RT_BOOL */; + VAL v288 = mtw_std_maybe_Maybe_1_Some(MKI64(v287)); + VAL v289 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v281), v282, MKSTR(v283), v284, MKSTR(v285), v286, v288, x3); + x4 = v289; } break; case 16LL: { // PRIM_INT_LE decref(x1); - STR* v331; - STRLIT(v331, "(", 1); - int64_t v332 = 2LL /* C99RT_I64 */; - STR* v333; - STRLIT(v333, " <= ", 4); - int64_t v334 = 2LL /* C99RT_I64 */; - STR* v335; - STRLIT(v335, ")", 1); - int64_t v336 = 0LL /* False */; - int64_t v337 = 12LL /* C99RT_BOOL */; - VAL v338 = mtw_std_maybe_Maybe_1_Some(MKI64(v337)); - VAL v339 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v331), v332, MKSTR(v333), v334, MKSTR(v335), v336, v338, x3)); - x4 = v339; + STR* v290; + STRLIT(v290, "(", 1); + int64_t v291 = 2LL /* C99RT_I64 */; + STR* v292; + STRLIT(v292, " <= ", 4); + int64_t v293 = 2LL /* C99RT_I64 */; + STR* v294; + STRLIT(v294, ")", 1); + int64_t v295 = 0LL /* False */; + int64_t v296 = 12LL /* C99RT_BOOL */; + VAL v297 = mtw_std_maybe_Maybe_1_Some(MKI64(v296)); + VAL v298 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v290), v291, MKSTR(v292), v293, MKSTR(v294), v295, v297, x3); + x4 = v298; } break; case 17LL: { // PRIM_INT_GT decref(x1); - STR* v340; - STRLIT(v340, "(", 1); - int64_t v341 = 2LL /* C99RT_I64 */; - STR* v342; - STRLIT(v342, " > ", 3); - int64_t v343 = 2LL /* C99RT_I64 */; - STR* v344; - STRLIT(v344, ")", 1); - int64_t v345 = 0LL /* False */; - int64_t v346 = 12LL /* C99RT_BOOL */; - VAL v347 = mtw_std_maybe_Maybe_1_Some(MKI64(v346)); - VAL v348 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v340), v341, MKSTR(v342), v343, MKSTR(v344), v345, v347, x3)); - x4 = v348; + STR* v299; + STRLIT(v299, "(", 1); + int64_t v300 = 2LL /* C99RT_I64 */; + STR* v301; + STRLIT(v301, " > ", 3); + int64_t v302 = 2LL /* C99RT_I64 */; + STR* v303; + STRLIT(v303, ")", 1); + int64_t v304 = 0LL /* False */; + int64_t v305 = 12LL /* C99RT_BOOL */; + VAL v306 = mtw_std_maybe_Maybe_1_Some(MKI64(v305)); + VAL v307 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v299), v300, MKSTR(v301), v302, MKSTR(v303), v304, v306, x3); + x4 = v307; } break; case 18LL: { // PRIM_INT_GE decref(x1); - STR* v349; - STRLIT(v349, "(", 1); - int64_t v350 = 2LL /* C99RT_I64 */; - STR* v351; - STRLIT(v351, " >= ", 4); - int64_t v352 = 2LL /* C99RT_I64 */; - STR* v353; - STRLIT(v353, ")", 1); - int64_t v354 = 0LL /* False */; - int64_t v355 = 12LL /* C99RT_BOOL */; - VAL v356 = mtw_std_maybe_Maybe_1_Some(MKI64(v355)); - VAL v357 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v349), v350, MKSTR(v351), v352, MKSTR(v353), v354, v356, x3)); - x4 = v357; + STR* v308; + STRLIT(v308, "(", 1); + int64_t v309 = 2LL /* C99RT_I64 */; + STR* v310; + STRLIT(v310, " >= ", 4); + int64_t v311 = 2LL /* C99RT_I64 */; + STR* v312; + STRLIT(v312, ")", 1); + int64_t v313 = 0LL /* False */; + int64_t v314 = 12LL /* C99RT_BOOL */; + VAL v315 = mtw_std_maybe_Maybe_1_Some(MKI64(v314)); + VAL v316 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v308), v309, MKSTR(v310), v311, MKSTR(v312), v313, v315, x3); + x4 = v316; } break; case 19LL: { // PRIM_INT_NE decref(x1); - STR* v358; - STRLIT(v358, "(", 1); - int64_t v359 = 2LL /* C99RT_I64 */; - STR* v360; - STRLIT(v360, " != ", 4); - int64_t v361 = 2LL /* C99RT_I64 */; - STR* v362; - STRLIT(v362, ")", 1); - int64_t v363 = 0LL /* False */; - int64_t v364 = 12LL /* C99RT_BOOL */; - VAL v365 = mtw_std_maybe_Maybe_1_Some(MKI64(v364)); - VAL v366 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v358), v359, MKSTR(v360), v361, MKSTR(v362), v363, v365, x3)); - x4 = v366; + STR* v317; + STRLIT(v317, "(", 1); + int64_t v318 = 2LL /* C99RT_I64 */; + STR* v319; + STRLIT(v319, " != ", 4); + int64_t v320 = 2LL /* C99RT_I64 */; + STR* v321; + STRLIT(v321, ")", 1); + int64_t v322 = 0LL /* False */; + int64_t v323 = 12LL /* C99RT_BOOL */; + VAL v324 = mtw_std_maybe_Maybe_1_Some(MKI64(v323)); + VAL v325 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v317), v318, MKSTR(v319), v320, MKSTR(v321), v322, v324, x3); + x4 = v325; } break; case 20LL: { // PRIM_INT_ADD decref(x1); - STR* v367; - STRLIT(v367, "i64_add(", 8); - int64_t v368 = 2LL /* C99RT_I64 */; - STR* v369; - STRLIT(v369, ", ", 2); - int64_t v370 = 2LL /* C99RT_I64 */; - STR* v371; - STRLIT(v371, ")", 1); - int64_t v372 = 0LL /* False */; - int64_t v373 = 2LL /* C99RT_I64 */; - VAL v374 = mtw_std_maybe_Maybe_1_Some(MKI64(v373)); - VAL v375 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v367), v368, MKSTR(v369), v370, MKSTR(v371), v372, v374, x3)); - x4 = v375; + STR* v326; + STRLIT(v326, "i64_add(", 8); + int64_t v327 = 2LL /* C99RT_I64 */; + STR* v328; + STRLIT(v328, ", ", 2); + int64_t v329 = 2LL /* C99RT_I64 */; + STR* v330; + STRLIT(v330, ")", 1); + int64_t v331 = 0LL /* False */; + int64_t v332 = 2LL /* C99RT_I64 */; + VAL v333 = mtw_std_maybe_Maybe_1_Some(MKI64(v332)); + VAL v334 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v326), v327, MKSTR(v328), v329, MKSTR(v330), v331, v333, x3); + x4 = v334; } break; case 21LL: { // PRIM_INT_SUB decref(x1); - STR* v376; - STRLIT(v376, "i64_sub(", 8); - int64_t v377 = 2LL /* C99RT_I64 */; - STR* v378; - STRLIT(v378, ", ", 2); - int64_t v379 = 2LL /* C99RT_I64 */; - STR* v380; - STRLIT(v380, ")", 1); - int64_t v381 = 0LL /* False */; - int64_t v382 = 2LL /* C99RT_I64 */; - VAL v383 = mtw_std_maybe_Maybe_1_Some(MKI64(v382)); - VAL v384 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v376), v377, MKSTR(v378), v379, MKSTR(v380), v381, v383, x3)); - x4 = v384; + STR* v335; + STRLIT(v335, "i64_sub(", 8); + int64_t v336 = 2LL /* C99RT_I64 */; + STR* v337; + STRLIT(v337, ", ", 2); + int64_t v338 = 2LL /* C99RT_I64 */; + STR* v339; + STRLIT(v339, ")", 1); + int64_t v340 = 0LL /* False */; + int64_t v341 = 2LL /* C99RT_I64 */; + VAL v342 = mtw_std_maybe_Maybe_1_Some(MKI64(v341)); + VAL v343 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v335), v336, MKSTR(v337), v338, MKSTR(v339), v340, v342, x3); + x4 = v343; } break; case 22LL: { // PRIM_INT_MUL decref(x1); - STR* v385; - STRLIT(v385, "i64_mul(", 8); - int64_t v386 = 2LL /* C99RT_I64 */; - STR* v387; - STRLIT(v387, ", ", 2); - int64_t v388 = 2LL /* C99RT_I64 */; - STR* v389; - STRLIT(v389, ")", 1); - int64_t v390 = 0LL /* False */; - int64_t v391 = 2LL /* C99RT_I64 */; - VAL v392 = mtw_std_maybe_Maybe_1_Some(MKI64(v391)); - VAL v393 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v385), v386, MKSTR(v387), v388, MKSTR(v389), v390, v392, x3)); - x4 = v393; + STR* v344; + STRLIT(v344, "i64_mul(", 8); + int64_t v345 = 2LL /* C99RT_I64 */; + STR* v346; + STRLIT(v346, ", ", 2); + int64_t v347 = 2LL /* C99RT_I64 */; + STR* v348; + STRLIT(v348, ")", 1); + int64_t v349 = 0LL /* False */; + int64_t v350 = 2LL /* C99RT_I64 */; + VAL v351 = mtw_std_maybe_Maybe_1_Some(MKI64(v350)); + VAL v352 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v344), v345, MKSTR(v346), v347, MKSTR(v348), v349, v351, x3); + x4 = v352; } break; case 23LL: { // PRIM_INT_DIV decref(x1); - STR* v394; - STRLIT(v394, "i64_div(", 8); - int64_t v395 = 2LL /* C99RT_I64 */; - STR* v396; - STRLIT(v396, ", ", 2); - int64_t v397 = 2LL /* C99RT_I64 */; - STR* v398; - STRLIT(v398, ")", 1); - int64_t v399 = 0LL /* False */; - int64_t v400 = 2LL /* C99RT_I64 */; - VAL v401 = mtw_std_maybe_Maybe_1_Some(MKI64(v400)); - VAL v402 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v394), v395, MKSTR(v396), v397, MKSTR(v398), v399, v401, x3)); - x4 = v402; + STR* v353; + STRLIT(v353, "i64_div(", 8); + int64_t v354 = 2LL /* C99RT_I64 */; + STR* v355; + STRLIT(v355, ", ", 2); + int64_t v356 = 2LL /* C99RT_I64 */; + STR* v357; + STRLIT(v357, ")", 1); + int64_t v358 = 0LL /* False */; + int64_t v359 = 2LL /* C99RT_I64 */; + VAL v360 = mtw_std_maybe_Maybe_1_Some(MKI64(v359)); + VAL v361 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v353), v354, MKSTR(v355), v356, MKSTR(v357), v358, v360, x3); + x4 = v361; } break; case 24LL: { // PRIM_INT_MOD decref(x1); - STR* v403; - STRLIT(v403, "i64_mod(", 8); - int64_t v404 = 2LL /* C99RT_I64 */; - STR* v405; - STRLIT(v405, ", ", 2); - int64_t v406 = 2LL /* C99RT_I64 */; - STR* v407; - STRLIT(v407, ")", 1); - int64_t v408 = 0LL /* False */; - int64_t v409 = 2LL /* C99RT_I64 */; - VAL v410 = mtw_std_maybe_Maybe_1_Some(MKI64(v409)); - VAL v411 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v403), v404, MKSTR(v405), v406, MKSTR(v407), v408, v410, x3)); - x4 = v411; + STR* v362; + STRLIT(v362, "i64_mod(", 8); + int64_t v363 = 2LL /* C99RT_I64 */; + STR* v364; + STRLIT(v364, ", ", 2); + int64_t v365 = 2LL /* C99RT_I64 */; + STR* v366; + STRLIT(v366, ")", 1); + int64_t v367 = 0LL /* False */; + int64_t v368 = 2LL /* C99RT_I64 */; + VAL v369 = mtw_std_maybe_Maybe_1_Some(MKI64(v368)); + VAL v370 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v362), v363, MKSTR(v364), v365, MKSTR(v366), v367, v369, x3); + x4 = v370; } break; case 25LL: { // PRIM_INT_AND decref(x1); - STR* v412; - STRLIT(v412, "(", 1); - int64_t v413 = 6LL /* C99RT_U64 */; - STR* v414; - STRLIT(v414, " & ", 3); - int64_t v415 = 6LL /* C99RT_U64 */; - STR* v416; - STRLIT(v416, ")", 1); - int64_t v417 = 0LL /* False */; - int64_t v418 = 6LL /* C99RT_U64 */; - VAL v419 = mtw_std_maybe_Maybe_1_Some(MKI64(v418)); - VAL v420 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v412), v413, MKSTR(v414), v415, MKSTR(v416), v417, v419, x3)); - x4 = v420; + STR* v371; + STRLIT(v371, "(", 1); + int64_t v372 = 6LL /* C99RT_U64 */; + STR* v373; + STRLIT(v373, " & ", 3); + int64_t v374 = 6LL /* C99RT_U64 */; + STR* v375; + STRLIT(v375, ")", 1); + int64_t v376 = 0LL /* False */; + int64_t v377 = 6LL /* C99RT_U64 */; + VAL v378 = mtw_std_maybe_Maybe_1_Some(MKI64(v377)); + VAL v379 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v371), v372, MKSTR(v373), v374, MKSTR(v375), v376, v378, x3); + x4 = v379; } break; case 27LL: { // PRIM_INT_XOR decref(x1); - STR* v421; - STRLIT(v421, "(", 1); - int64_t v422 = 6LL /* C99RT_U64 */; - STR* v423; - STRLIT(v423, " ^ ", 3); - int64_t v424 = 6LL /* C99RT_U64 */; - STR* v425; - STRLIT(v425, ")", 1); - int64_t v426 = 0LL /* False */; - int64_t v427 = 6LL /* C99RT_U64 */; - VAL v428 = mtw_std_maybe_Maybe_1_Some(MKI64(v427)); - VAL v429 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v421), v422, MKSTR(v423), v424, MKSTR(v425), v426, v428, x3)); - x4 = v429; + STR* v380; + STRLIT(v380, "(", 1); + int64_t v381 = 6LL /* C99RT_U64 */; + STR* v382; + STRLIT(v382, " ^ ", 3); + int64_t v383 = 6LL /* C99RT_U64 */; + STR* v384; + STRLIT(v384, ")", 1); + int64_t v385 = 0LL /* False */; + int64_t v386 = 6LL /* C99RT_U64 */; + VAL v387 = mtw_std_maybe_Maybe_1_Some(MKI64(v386)); + VAL v388 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v380), v381, MKSTR(v382), v383, MKSTR(v384), v385, v387, x3); + x4 = v388; } break; case 26LL: { // PRIM_INT_OR decref(x1); - STR* v430; - STRLIT(v430, "(", 1); - int64_t v431 = 6LL /* C99RT_U64 */; - STR* v432; - STRLIT(v432, " | ", 3); - int64_t v433 = 6LL /* C99RT_U64 */; - STR* v434; - STRLIT(v434, ")", 1); - int64_t v435 = 0LL /* False */; - int64_t v436 = 6LL /* C99RT_U64 */; - VAL v437 = mtw_std_maybe_Maybe_1_Some(MKI64(v436)); - VAL v438 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v430), v431, MKSTR(v432), v433, MKSTR(v434), v435, v437, x3)); - x4 = v438; + STR* v389; + STRLIT(v389, "(", 1); + int64_t v390 = 6LL /* C99RT_U64 */; + STR* v391; + STRLIT(v391, " | ", 3); + int64_t v392 = 6LL /* C99RT_U64 */; + STR* v393; + STRLIT(v393, ")", 1); + int64_t v394 = 0LL /* False */; + int64_t v395 = 6LL /* C99RT_U64 */; + VAL v396 = mtw_std_maybe_Maybe_1_Some(MKI64(v395)); + VAL v397 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v389), v390, MKSTR(v391), v392, MKSTR(v393), v394, v396, x3); + x4 = v397; } break; case 28LL: { // PRIM_INT_SHL decref(x1); - STR* v439; - STRLIT(v439, "u64_shl(", 8); - int64_t v440 = 6LL /* C99RT_U64 */; - STR* v441; - STRLIT(v441, ", ", 2); - int64_t v442 = 6LL /* C99RT_U64 */; - STR* v443; - STRLIT(v443, ")", 1); - int64_t v444 = 0LL /* False */; - int64_t v445 = 6LL /* C99RT_U64 */; - VAL v446 = mtw_std_maybe_Maybe_1_Some(MKI64(v445)); - VAL v447 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v439), v440, MKSTR(v441), v442, MKSTR(v443), v444, v446, x3)); - x4 = v447; + STR* v398; + STRLIT(v398, "u64_shl(", 8); + int64_t v399 = 6LL /* C99RT_U64 */; + STR* v400; + STRLIT(v400, ", ", 2); + int64_t v401 = 6LL /* C99RT_U64 */; + STR* v402; + STRLIT(v402, ")", 1); + int64_t v403 = 0LL /* False */; + int64_t v404 = 6LL /* C99RT_U64 */; + VAL v405 = mtw_std_maybe_Maybe_1_Some(MKI64(v404)); + VAL v406 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v398), v399, MKSTR(v400), v401, MKSTR(v402), v403, v405, x3); + x4 = v406; } break; case 29LL: { // PRIM_INT_SHR decref(x1); - STR* v448; - STRLIT(v448, "u64_shr(", 8); - int64_t v449 = 6LL /* C99RT_U64 */; - STR* v450; - STRLIT(v450, ", ", 2); - int64_t v451 = 6LL /* C99RT_U64 */; - STR* v452; - STRLIT(v452, ")", 1); - int64_t v453 = 0LL /* False */; - int64_t v454 = 6LL /* C99RT_U64 */; - VAL v455 = mtw_std_maybe_Maybe_1_Some(MKI64(v454)); - VAL v456 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v448), v449, MKSTR(v450), v451, MKSTR(v452), v453, v455, x3)); - x4 = v456; + STR* v407; + STRLIT(v407, "u64_shr(", 8); + int64_t v408 = 6LL /* C99RT_U64 */; + STR* v409; + STRLIT(v409, ", ", 2); + int64_t v410 = 6LL /* C99RT_U64 */; + STR* v411; + STRLIT(v411, ")", 1); + int64_t v412 = 0LL /* False */; + int64_t v413 = 6LL /* C99RT_U64 */; + VAL v414 = mtw_std_maybe_Maybe_1_Some(MKI64(v413)); + VAL v415 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v407), v408, MKSTR(v409), v410, MKSTR(v411), v412, v414, x3); + x4 = v415; } break; case 31LL: { // PRIM_INT_TO_F32 decref(x1); - STR* v457; - STRLIT(v457, "(float)", 7); - int64_t v458 = 2LL /* C99RT_I64 */; - STR* v459; - STRLIT(v459, "", 0); - int64_t v460 = 11LL /* C99RT_F32 */; - VAL v461 = mtw_std_maybe_Maybe_1_Some(MKI64(v460)); - VAL v462 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v457), v458, MKSTR(v459), v461, x3)); - x4 = v462; + STR* v416; + STRLIT(v416, "(float)", 7); + int64_t v417 = 2LL /* C99RT_I64 */; + STR* v418; + STRLIT(v418, "", 0); + int64_t v419 = 11LL /* C99RT_F32 */; + VAL v420 = mtw_std_maybe_Maybe_1_Some(MKI64(v419)); + VAL v421 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v416), v417, MKSTR(v418), v420, x3); + x4 = v421; } break; case 32LL: { // PRIM_INT_TO_F64 decref(x1); - STR* v463; - STRLIT(v463, "(double)", 8); - int64_t v464 = 2LL /* C99RT_I64 */; - STR* v465; - STRLIT(v465, "", 0); - int64_t v466 = 10LL /* C99RT_F64 */; - VAL v467 = mtw_std_maybe_Maybe_1_Some(MKI64(v466)); - VAL v468 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v463), v464, MKSTR(v465), v467, x3)); - x4 = v468; + STR* v422; + STRLIT(v422, "(double)", 8); + int64_t v423 = 2LL /* C99RT_I64 */; + STR* v424; + STRLIT(v424, "", 0); + int64_t v425 = 10LL /* C99RT_F64 */; + VAL v426 = mtw_std_maybe_Maybe_1_Some(MKI64(v425)); + VAL v427 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v422), v423, MKSTR(v424), v426, x3); + x4 = v427; } break; case 30LL: { // PRIM_INT_TO_STR decref(x1); - STR* v469; - STRLIT(v469, "i64_show(", 9); - int64_t v470 = 2LL /* C99RT_I64 */; - STR* v471; - STRLIT(v471, ")", 1); - int64_t v472 = 1LL /* C99RT_STR */; - VAL v473 = mtw_std_maybe_Maybe_1_Some(MKI64(v472)); - VAL v474 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v469), v470, MKSTR(v471), v473, x3)); - x4 = v474; + STR* v428; + STRLIT(v428, "i64_show(", 9); + int64_t v429 = 2LL /* C99RT_I64 */; + STR* v430; + STRLIT(v430, ")", 1); + int64_t v431 = 1LL /* C99RT_STR */; + VAL v432 = mtw_std_maybe_Maybe_1_Some(MKI64(v431)); + VAL v433 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v428), v429, MKSTR(v430), v432, x3); + x4 = v433; } break; case 34LL: { // PRIM_F32_LT decref(x1); - STR* v475; - STRLIT(v475, "(", 1); - int64_t v476 = 11LL /* C99RT_F32 */; - STR* v477; - STRLIT(v477, " < ", 3); - int64_t v478 = 11LL /* C99RT_F32 */; - STR* v479; - STRLIT(v479, ")", 1); - int64_t v480 = 0LL /* False */; - int64_t v481 = 12LL /* C99RT_BOOL */; - VAL v482 = mtw_std_maybe_Maybe_1_Some(MKI64(v481)); - VAL v483 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v475), v476, MKSTR(v477), v478, MKSTR(v479), v480, v482, x3)); - x4 = v483; + STR* v434; + STRLIT(v434, "(", 1); + int64_t v435 = 11LL /* C99RT_F32 */; + STR* v436; + STRLIT(v436, " < ", 3); + int64_t v437 = 11LL /* C99RT_F32 */; + STR* v438; + STRLIT(v438, ")", 1); + int64_t v439 = 0LL /* False */; + int64_t v440 = 12LL /* C99RT_BOOL */; + VAL v441 = mtw_std_maybe_Maybe_1_Some(MKI64(v440)); + VAL v442 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v434), v435, MKSTR(v436), v437, MKSTR(v438), v439, v441, x3); + x4 = v442; } break; case 33LL: { // PRIM_F32_EQ decref(x1); - STR* v484; - STRLIT(v484, "(", 1); - int64_t v485 = 11LL /* C99RT_F32 */; - STR* v486; - STRLIT(v486, " == ", 4); - int64_t v487 = 11LL /* C99RT_F32 */; - STR* v488; - STRLIT(v488, ")", 1); - int64_t v489 = 0LL /* False */; - int64_t v490 = 12LL /* C99RT_BOOL */; - VAL v491 = mtw_std_maybe_Maybe_1_Some(MKI64(v490)); - VAL v492 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v484), v485, MKSTR(v486), v487, MKSTR(v488), v489, v491, x3)); - x4 = v492; + STR* v443; + STRLIT(v443, "(", 1); + int64_t v444 = 11LL /* C99RT_F32 */; + STR* v445; + STRLIT(v445, " == ", 4); + int64_t v446 = 11LL /* C99RT_F32 */; + STR* v447; + STRLIT(v447, ")", 1); + int64_t v448 = 0LL /* False */; + int64_t v449 = 12LL /* C99RT_BOOL */; + VAL v450 = mtw_std_maybe_Maybe_1_Some(MKI64(v449)); + VAL v451 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v443), v444, MKSTR(v445), v446, MKSTR(v447), v448, v450, x3); + x4 = v451; } break; case 35LL: { // PRIM_F32_ADD decref(x1); - STR* v493; - STRLIT(v493, "(", 1); - int64_t v494 = 11LL /* C99RT_F32 */; - STR* v495; - STRLIT(v495, " + ", 3); - int64_t v496 = 11LL /* C99RT_F32 */; - STR* v497; - STRLIT(v497, ")", 1); - int64_t v498 = 0LL /* False */; - int64_t v499 = 11LL /* C99RT_F32 */; - VAL v500 = mtw_std_maybe_Maybe_1_Some(MKI64(v499)); - VAL v501 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v493), v494, MKSTR(v495), v496, MKSTR(v497), v498, v500, x3)); - x4 = v501; + STR* v452; + STRLIT(v452, "(", 1); + int64_t v453 = 11LL /* C99RT_F32 */; + STR* v454; + STRLIT(v454, " + ", 3); + int64_t v455 = 11LL /* C99RT_F32 */; + STR* v456; + STRLIT(v456, ")", 1); + int64_t v457 = 0LL /* False */; + int64_t v458 = 11LL /* C99RT_F32 */; + VAL v459 = mtw_std_maybe_Maybe_1_Some(MKI64(v458)); + VAL v460 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v452), v453, MKSTR(v454), v455, MKSTR(v456), v457, v459, x3); + x4 = v460; } break; case 36LL: { // PRIM_F32_SUB decref(x1); - STR* v502; - STRLIT(v502, "(", 1); - int64_t v503 = 11LL /* C99RT_F32 */; - STR* v504; - STRLIT(v504, " - ", 3); - int64_t v505 = 11LL /* C99RT_F32 */; - STR* v506; - STRLIT(v506, ")", 1); - int64_t v507 = 0LL /* False */; - int64_t v508 = 11LL /* C99RT_F32 */; - VAL v509 = mtw_std_maybe_Maybe_1_Some(MKI64(v508)); - VAL v510 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v502), v503, MKSTR(v504), v505, MKSTR(v506), v507, v509, x3)); - x4 = v510; + STR* v461; + STRLIT(v461, "(", 1); + int64_t v462 = 11LL /* C99RT_F32 */; + STR* v463; + STRLIT(v463, " - ", 3); + int64_t v464 = 11LL /* C99RT_F32 */; + STR* v465; + STRLIT(v465, ")", 1); + int64_t v466 = 0LL /* False */; + int64_t v467 = 11LL /* C99RT_F32 */; + VAL v468 = mtw_std_maybe_Maybe_1_Some(MKI64(v467)); + VAL v469 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v461), v462, MKSTR(v463), v464, MKSTR(v465), v466, v468, x3); + x4 = v469; } break; case 37LL: { // PRIM_F32_MUL decref(x1); - STR* v511; - STRLIT(v511, "(", 1); - int64_t v512 = 11LL /* C99RT_F32 */; - STR* v513; - STRLIT(v513, " * ", 3); - int64_t v514 = 11LL /* C99RT_F32 */; - STR* v515; - STRLIT(v515, ")", 1); - int64_t v516 = 0LL /* False */; - int64_t v517 = 11LL /* C99RT_F32 */; - VAL v518 = mtw_std_maybe_Maybe_1_Some(MKI64(v517)); - VAL v519 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v511), v512, MKSTR(v513), v514, MKSTR(v515), v516, v518, x3)); - x4 = v519; + STR* v470; + STRLIT(v470, "(", 1); + int64_t v471 = 11LL /* C99RT_F32 */; + STR* v472; + STRLIT(v472, " * ", 3); + int64_t v473 = 11LL /* C99RT_F32 */; + STR* v474; + STRLIT(v474, ")", 1); + int64_t v475 = 0LL /* False */; + int64_t v476 = 11LL /* C99RT_F32 */; + VAL v477 = mtw_std_maybe_Maybe_1_Some(MKI64(v476)); + VAL v478 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v470), v471, MKSTR(v472), v473, MKSTR(v474), v475, v477, x3); + x4 = v478; } break; case 38LL: { // PRIM_F32_DIV decref(x1); - STR* v520; - STRLIT(v520, "(", 1); - int64_t v521 = 11LL /* C99RT_F32 */; - STR* v522; - STRLIT(v522, " / ", 3); - int64_t v523 = 11LL /* C99RT_F32 */; - STR* v524; - STRLIT(v524, ")", 1); - int64_t v525 = 0LL /* False */; - int64_t v526 = 11LL /* C99RT_F32 */; - VAL v527 = mtw_std_maybe_Maybe_1_Some(MKI64(v526)); - VAL v528 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v520), v521, MKSTR(v522), v523, MKSTR(v524), v525, v527, x3)); - x4 = v528; + STR* v479; + STRLIT(v479, "(", 1); + int64_t v480 = 11LL /* C99RT_F32 */; + STR* v481; + STRLIT(v481, " / ", 3); + int64_t v482 = 11LL /* C99RT_F32 */; + STR* v483; + STRLIT(v483, ")", 1); + int64_t v484 = 0LL /* False */; + int64_t v485 = 11LL /* C99RT_F32 */; + VAL v486 = mtw_std_maybe_Maybe_1_Some(MKI64(v485)); + VAL v487 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v479), v480, MKSTR(v481), v482, MKSTR(v483), v484, v486, x3); + x4 = v487; } break; case 39LL: { // PRIM_F32_TO_INT decref(x1); - STR* v529; - STRLIT(v529, "(int64_t)", 9); - int64_t v530 = 11LL /* C99RT_F32 */; - STR* v531; - STRLIT(v531, "", 0); - int64_t v532 = 2LL /* C99RT_I64 */; - VAL v533 = mtw_std_maybe_Maybe_1_Some(MKI64(v532)); - VAL v534 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v529), v530, MKSTR(v531), v533, x3)); - x4 = v534; + STR* v488; + STRLIT(v488, "(int64_t)", 9); + int64_t v489 = 11LL /* C99RT_F32 */; + STR* v490; + STRLIT(v490, "", 0); + int64_t v491 = 2LL /* C99RT_I64 */; + VAL v492 = mtw_std_maybe_Maybe_1_Some(MKI64(v491)); + VAL v493 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v488), v489, MKSTR(v490), v492, x3); + x4 = v493; } break; case 41LL: { // PRIM_F32_TO_F64 decref(x1); - STR* v535; - STRLIT(v535, "(double)", 8); - int64_t v536 = 11LL /* C99RT_F32 */; - STR* v537; - STRLIT(v537, "", 0); - int64_t v538 = 10LL /* C99RT_F64 */; - VAL v539 = mtw_std_maybe_Maybe_1_Some(MKI64(v538)); - VAL v540 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v535), v536, MKSTR(v537), v539, x3)); - x4 = v540; + STR* v494; + STRLIT(v494, "(double)", 8); + int64_t v495 = 11LL /* C99RT_F32 */; + STR* v496; + STRLIT(v496, "", 0); + int64_t v497 = 10LL /* C99RT_F64 */; + VAL v498 = mtw_std_maybe_Maybe_1_Some(MKI64(v497)); + VAL v499 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v494), v495, MKSTR(v496), v498, x3); + x4 = v499; } break; case 40LL: { // PRIM_F32_TO_STR decref(x1); - STR* v541; - STRLIT(v541, "f32_show(", 9); - int64_t v542 = 11LL /* C99RT_F32 */; - STR* v543; - STRLIT(v543, ")", 1); - int64_t v544 = 1LL /* C99RT_STR */; - VAL v545 = mtw_std_maybe_Maybe_1_Some(MKI64(v544)); - VAL v546 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v541), v542, MKSTR(v543), v545, x3)); - x4 = v546; + STR* v500; + STRLIT(v500, "f32_show(", 9); + int64_t v501 = 11LL /* C99RT_F32 */; + STR* v502; + STRLIT(v502, ")", 1); + int64_t v503 = 1LL /* C99RT_STR */; + VAL v504 = mtw_std_maybe_Maybe_1_Some(MKI64(v503)); + VAL v505 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v500), v501, MKSTR(v502), v504, x3); + x4 = v505; } break; case 42LL: { // PRIM_F64_EQ decref(x1); - STR* v547; - STRLIT(v547, "(", 1); - int64_t v548 = 10LL /* C99RT_F64 */; - STR* v549; - STRLIT(v549, " == ", 4); - int64_t v550 = 10LL /* C99RT_F64 */; - STR* v551; - STRLIT(v551, ")", 1); - int64_t v552 = 0LL /* False */; - int64_t v553 = 12LL /* C99RT_BOOL */; - VAL v554 = mtw_std_maybe_Maybe_1_Some(MKI64(v553)); - VAL v555 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v547), v548, MKSTR(v549), v550, MKSTR(v551), v552, v554, x3)); - x4 = v555; + STR* v506; + STRLIT(v506, "(", 1); + int64_t v507 = 10LL /* C99RT_F64 */; + STR* v508; + STRLIT(v508, " == ", 4); + int64_t v509 = 10LL /* C99RT_F64 */; + STR* v510; + STRLIT(v510, ")", 1); + int64_t v511 = 0LL /* False */; + int64_t v512 = 12LL /* C99RT_BOOL */; + VAL v513 = mtw_std_maybe_Maybe_1_Some(MKI64(v512)); + VAL v514 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v506), v507, MKSTR(v508), v509, MKSTR(v510), v511, v513, x3); + x4 = v514; } break; case 43LL: { // PRIM_F64_LT decref(x1); - STR* v556; - STRLIT(v556, "(", 1); - int64_t v557 = 10LL /* C99RT_F64 */; - STR* v558; - STRLIT(v558, " < ", 3); - int64_t v559 = 10LL /* C99RT_F64 */; - STR* v560; - STRLIT(v560, ")", 1); - int64_t v561 = 0LL /* False */; - int64_t v562 = 12LL /* C99RT_BOOL */; - VAL v563 = mtw_std_maybe_Maybe_1_Some(MKI64(v562)); - VAL v564 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v556), v557, MKSTR(v558), v559, MKSTR(v560), v561, v563, x3)); - x4 = v564; + STR* v515; + STRLIT(v515, "(", 1); + int64_t v516 = 10LL /* C99RT_F64 */; + STR* v517; + STRLIT(v517, " < ", 3); + int64_t v518 = 10LL /* C99RT_F64 */; + STR* v519; + STRLIT(v519, ")", 1); + int64_t v520 = 0LL /* False */; + int64_t v521 = 12LL /* C99RT_BOOL */; + VAL v522 = mtw_std_maybe_Maybe_1_Some(MKI64(v521)); + VAL v523 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v515), v516, MKSTR(v517), v518, MKSTR(v519), v520, v522, x3); + x4 = v523; } break; case 44LL: { // PRIM_F64_ADD decref(x1); - STR* v565; - STRLIT(v565, "(", 1); - int64_t v566 = 10LL /* C99RT_F64 */; - STR* v567; - STRLIT(v567, " + ", 3); - int64_t v568 = 10LL /* C99RT_F64 */; - STR* v569; - STRLIT(v569, ")", 1); - int64_t v570 = 0LL /* False */; - int64_t v571 = 10LL /* C99RT_F64 */; - VAL v572 = mtw_std_maybe_Maybe_1_Some(MKI64(v571)); - VAL v573 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v565), v566, MKSTR(v567), v568, MKSTR(v569), v570, v572, x3)); - x4 = v573; + STR* v524; + STRLIT(v524, "(", 1); + int64_t v525 = 10LL /* C99RT_F64 */; + STR* v526; + STRLIT(v526, " + ", 3); + int64_t v527 = 10LL /* C99RT_F64 */; + STR* v528; + STRLIT(v528, ")", 1); + int64_t v529 = 0LL /* False */; + int64_t v530 = 10LL /* C99RT_F64 */; + VAL v531 = mtw_std_maybe_Maybe_1_Some(MKI64(v530)); + VAL v532 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v524), v525, MKSTR(v526), v527, MKSTR(v528), v529, v531, x3); + x4 = v532; } break; case 45LL: { // PRIM_F64_SUB decref(x1); - STR* v574; - STRLIT(v574, "(", 1); - int64_t v575 = 10LL /* C99RT_F64 */; - STR* v576; - STRLIT(v576, " - ", 3); - int64_t v577 = 10LL /* C99RT_F64 */; - STR* v578; - STRLIT(v578, ")", 1); - int64_t v579 = 0LL /* False */; - int64_t v580 = 10LL /* C99RT_F64 */; - VAL v581 = mtw_std_maybe_Maybe_1_Some(MKI64(v580)); - VAL v582 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v574), v575, MKSTR(v576), v577, MKSTR(v578), v579, v581, x3)); - x4 = v582; + STR* v533; + STRLIT(v533, "(", 1); + int64_t v534 = 10LL /* C99RT_F64 */; + STR* v535; + STRLIT(v535, " - ", 3); + int64_t v536 = 10LL /* C99RT_F64 */; + STR* v537; + STRLIT(v537, ")", 1); + int64_t v538 = 0LL /* False */; + int64_t v539 = 10LL /* C99RT_F64 */; + VAL v540 = mtw_std_maybe_Maybe_1_Some(MKI64(v539)); + VAL v541 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v533), v534, MKSTR(v535), v536, MKSTR(v537), v538, v540, x3); + x4 = v541; } break; case 46LL: { // PRIM_F64_MUL decref(x1); - STR* v583; - STRLIT(v583, "(", 1); - int64_t v584 = 10LL /* C99RT_F64 */; - STR* v585; - STRLIT(v585, " * ", 3); - int64_t v586 = 10LL /* C99RT_F64 */; - STR* v587; - STRLIT(v587, ")", 1); - int64_t v588 = 0LL /* False */; - int64_t v589 = 10LL /* C99RT_F64 */; - VAL v590 = mtw_std_maybe_Maybe_1_Some(MKI64(v589)); - VAL v591 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v583), v584, MKSTR(v585), v586, MKSTR(v587), v588, v590, x3)); - x4 = v591; + STR* v542; + STRLIT(v542, "(", 1); + int64_t v543 = 10LL /* C99RT_F64 */; + STR* v544; + STRLIT(v544, " * ", 3); + int64_t v545 = 10LL /* C99RT_F64 */; + STR* v546; + STRLIT(v546, ")", 1); + int64_t v547 = 0LL /* False */; + int64_t v548 = 10LL /* C99RT_F64 */; + VAL v549 = mtw_std_maybe_Maybe_1_Some(MKI64(v548)); + VAL v550 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v542), v543, MKSTR(v544), v545, MKSTR(v546), v547, v549, x3); + x4 = v550; } break; case 47LL: { // PRIM_F64_DIV decref(x1); - STR* v592; - STRLIT(v592, "(", 1); - int64_t v593 = 10LL /* C99RT_F64 */; - STR* v594; - STRLIT(v594, " / ", 3); - int64_t v595 = 10LL /* C99RT_F64 */; - STR* v596; - STRLIT(v596, ")", 1); - int64_t v597 = 0LL /* False */; - int64_t v598 = 10LL /* C99RT_F64 */; - VAL v599 = mtw_std_maybe_Maybe_1_Some(MKI64(v598)); - VAL v600 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v592), v593, MKSTR(v594), v595, MKSTR(v596), v597, v599, x3)); - x4 = v600; + STR* v551; + STRLIT(v551, "(", 1); + int64_t v552 = 10LL /* C99RT_F64 */; + STR* v553; + STRLIT(v553, " / ", 3); + int64_t v554 = 10LL /* C99RT_F64 */; + STR* v555; + STRLIT(v555, ")", 1); + int64_t v556 = 0LL /* False */; + int64_t v557 = 10LL /* C99RT_F64 */; + VAL v558 = mtw_std_maybe_Maybe_1_Some(MKI64(v557)); + VAL v559 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v551), v552, MKSTR(v553), v554, MKSTR(v555), v556, v558, x3); + x4 = v559; } break; case 48LL: { // PRIM_F64_TO_INT decref(x1); - STR* v601; - STRLIT(v601, "(int64_t)", 9); - int64_t v602 = 10LL /* C99RT_F64 */; - STR* v603; - STRLIT(v603, "", 0); - int64_t v604 = 2LL /* C99RT_I64 */; - VAL v605 = mtw_std_maybe_Maybe_1_Some(MKI64(v604)); - VAL v606 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v601), v602, MKSTR(v603), v605, x3)); - x4 = v606; + STR* v560; + STRLIT(v560, "(int64_t)", 9); + int64_t v561 = 10LL /* C99RT_F64 */; + STR* v562; + STRLIT(v562, "", 0); + int64_t v563 = 2LL /* C99RT_I64 */; + VAL v564 = mtw_std_maybe_Maybe_1_Some(MKI64(v563)); + VAL v565 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v560), v561, MKSTR(v562), v564, x3); + x4 = v565; } break; case 50LL: { // PRIM_F64_TO_F32 decref(x1); - STR* v607; - STRLIT(v607, "(float)", 7); - int64_t v608 = 10LL /* C99RT_F64 */; - STR* v609; - STRLIT(v609, "", 0); - int64_t v610 = 11LL /* C99RT_F32 */; - VAL v611 = mtw_std_maybe_Maybe_1_Some(MKI64(v610)); - VAL v612 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v607), v608, MKSTR(v609), v611, x3)); - x4 = v612; + STR* v566; + STRLIT(v566, "(float)", 7); + int64_t v567 = 10LL /* C99RT_F64 */; + STR* v568; + STRLIT(v568, "", 0); + int64_t v569 = 11LL /* C99RT_F32 */; + VAL v570 = mtw_std_maybe_Maybe_1_Some(MKI64(v569)); + VAL v571 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v566), v567, MKSTR(v568), v570, x3); + x4 = v571; } break; case 49LL: { // PRIM_F64_TO_STR decref(x1); - STR* v613; - STRLIT(v613, "f64_show(", 9); - int64_t v614 = 10LL /* C99RT_F64 */; - STR* v615; - STRLIT(v615, ")", 1); - int64_t v616 = 1LL /* C99RT_STR */; - VAL v617 = mtw_std_maybe_Maybe_1_Some(MKI64(v616)); - VAL v618 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v613), v614, MKSTR(v615), v617, x3)); - x4 = v618; + STR* v572; + STRLIT(v572, "f64_show(", 9); + int64_t v573 = 10LL /* C99RT_F64 */; + STR* v574; + STRLIT(v574, ")", 1); + int64_t v575 = 1LL /* C99RT_STR */; + VAL v576 = mtw_std_maybe_Maybe_1_Some(MKI64(v575)); + VAL v577 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v572), v573, MKSTR(v574), v576, x3); + x4 = v577; } break; case 51LL: { // PRIM_BOOL_AND decref(x1); - STR* v619; - STRLIT(v619, "(", 1); - int64_t v620 = 12LL /* C99RT_BOOL */; - STR* v621; - STRLIT(v621, " && ", 4); - int64_t v622 = 12LL /* C99RT_BOOL */; - STR* v623; - STRLIT(v623, ")", 1); - int64_t v624 = 0LL /* False */; - int64_t v625 = 12LL /* C99RT_BOOL */; - VAL v626 = mtw_std_maybe_Maybe_1_Some(MKI64(v625)); - VAL v627 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v619), v620, MKSTR(v621), v622, MKSTR(v623), v624, v626, x3)); - x4 = v627; + STR* v578; + STRLIT(v578, "(", 1); + int64_t v579 = 12LL /* C99RT_BOOL */; + STR* v580; + STRLIT(v580, " && ", 4); + int64_t v581 = 12LL /* C99RT_BOOL */; + STR* v582; + STRLIT(v582, ")", 1); + int64_t v583 = 0LL /* False */; + int64_t v584 = 12LL /* C99RT_BOOL */; + VAL v585 = mtw_std_maybe_Maybe_1_Some(MKI64(v584)); + VAL v586 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v578), v579, MKSTR(v580), v581, MKSTR(v582), v583, v585, x3); + x4 = v586; } break; case 52LL: { // PRIM_BOOL_OR decref(x1); - STR* v628; - STRLIT(v628, "(", 1); - int64_t v629 = 12LL /* C99RT_BOOL */; - STR* v630; - STRLIT(v630, " || ", 4); - int64_t v631 = 12LL /* C99RT_BOOL */; - STR* v632; - STRLIT(v632, ")", 1); - int64_t v633 = 0LL /* False */; - int64_t v634 = 12LL /* C99RT_BOOL */; - VAL v635 = mtw_std_maybe_Maybe_1_Some(MKI64(v634)); - VAL v636 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v628), v629, MKSTR(v630), v631, MKSTR(v632), v633, v635, x3)); - x4 = v636; + STR* v587; + STRLIT(v587, "(", 1); + int64_t v588 = 12LL /* C99RT_BOOL */; + STR* v589; + STRLIT(v589, " || ", 4); + int64_t v590 = 12LL /* C99RT_BOOL */; + STR* v591; + STRLIT(v591, ")", 1); + int64_t v592 = 0LL /* False */; + int64_t v593 = 12LL /* C99RT_BOOL */; + VAL v594 = mtw_std_maybe_Maybe_1_Some(MKI64(v593)); + VAL v595 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v587), v588, MKSTR(v589), v590, MKSTR(v591), v592, v594, x3); + x4 = v595; } break; case 53LL: { // PRIM_BOOL_NOT decref(x1); - STR* v637; - STRLIT(v637, "!", 1); - int64_t v638 = 12LL /* C99RT_BOOL */; - STR* v639; - STRLIT(v639, "", 0); - int64_t v640 = 12LL /* C99RT_BOOL */; - VAL v641 = mtw_std_maybe_Maybe_1_Some(MKI64(v640)); - VAL v642 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v637), v638, MKSTR(v639), v641, x3)); - x4 = v642; + STR* v596; + STRLIT(v596, "!", 1); + int64_t v597 = 12LL /* C99RT_BOOL */; + STR* v598; + STRLIT(v598, "", 0); + int64_t v599 = 12LL /* C99RT_BOOL */; + VAL v600 = mtw_std_maybe_Maybe_1_Some(MKI64(v599)); + VAL v601 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v596), v597, MKSTR(v598), v600, x3); + x4 = v601; } break; case 54LL: { // PRIM_PACK_NIL decref(x1); - int64_t v643 = 0LL /* C99RT_VAL */; - VAL v644 = (VVAL(VTUP(x3)->cells[1])); - VAL v645; - VAL v646; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v644, &v645, &v646); - VAL v647 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v643, v645)); - VAL v648 = (mw_mirth_c99_ZPlusC99_indent(v646)); - int64_t v649 = VI64(VTUP(v647)->cells[1]); - VAL v650 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v649); - VAL v651 = (mw_mirth_c99_ZPlusC99_put(v650, v648)); - STR* v652; - STRLIT(v652, " ", 1); - VAL v653 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v652), v651)); - VAL v654 = VVAL(VTUP(v647)->cells[2]); - incref(v654); - VAL v655 = (mw_mirth_c99_ZPlusC99_put(v654, v653)); - STR* v656; - STRLIT(v656, " = ", 3); - VAL v657 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v656), v655)); - STR* v658; - STRLIT(v658, "MKNIL", 5); - VAL v659 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v658), v657)); - STR* v660; - STRLIT(v660, ";", 1); - VAL v661 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v660), v659)); - VAL v662 = (mw_mirth_c99_ZPlusC99_line(v661)); - VTUP(x3)->cells[1] = v662; - VAL v663 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x3, v647)); - x4 = v663; + int64_t v602 = 0LL /* C99RT_VAL */; + VAL v603 = VVAL(VTUP(x3)->cells[1]); + VAL v604; + VAL v605; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v603, &v604, &v605); + VTUP(x3)->cells[1] = v605; + int64_t v606 = VI64(VTUP(x3)->cells[3]); + VAL v607 = VVAL(VTUP(x3)->cells[1]); + int64_t v608 = VI64(VTUP(v607)->cells[4]); + VTUP(v607)->cells[4] = MKI64(v606); + VAL v609 = mw_mirth_c99_ZPlusC99_indent(v607); + VAL v610 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v602); + VAL v611 = mw_mirth_c99_ZPlusC99_put(v610, v609); + STR* v612; + STRLIT(v612, " ", 1); + VAL v613 = mw_mirth_c99_ZPlusC99_put(MKSTR(v612), v611); + incref(v604); + VAL v614 = mw_mirth_c99_ZPlusC99_put(v604, v613); + STR* v615; + STRLIT(v615, " = ", 3); + VAL v616 = mw_mirth_c99_ZPlusC99_put(MKSTR(v615), v614); + VAL v617 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v602, v604); + STR* v618; + STRLIT(v618, "MKNIL", 5); + VAL v619 = mw_mirth_c99_ZPlusC99_put(MKSTR(v618), v616); + STR* v620; + STRLIT(v620, ";", 1); + VAL v621 = mw_mirth_c99_ZPlusC99_put(MKSTR(v620), v619); + VAL v622 = mw_mirth_c99_ZPlusC99_line(v621); + VTUP(v622)->cells[4] = MKI64(v608); + VTUP(x3)->cells[1] = v622; + VAL v623 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x3, v617); + x4 = v623; } break; case 55LL: { // PRIM_PACK_CONS decref(x1); - STR* v664; - STRLIT(v664, "mkcons(", 7); - int64_t v665 = 0LL /* C99RT_VAL */; - STR* v666; - STRLIT(v666, ", ", 2); - int64_t v667 = 0LL /* C99RT_VAL */; - STR* v668; - STRLIT(v668, ")", 1); - int64_t v669 = 0LL /* False */; - int64_t v670 = 0LL /* C99RT_VAL */; - VAL v671 = mtw_std_maybe_Maybe_1_Some(MKI64(v670)); - VAL v672 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v664), v665, MKSTR(v666), v667, MKSTR(v668), v669, v671, x3)); - x4 = v672; + STR* v624; + STRLIT(v624, "mkcons(", 7); + int64_t v625 = 0LL /* C99RT_VAL */; + STR* v626; + STRLIT(v626, ", ", 2); + int64_t v627 = 0LL /* C99RT_VAL */; + STR* v628; + STRLIT(v628, ")", 1); + int64_t v629 = 0LL /* False */; + int64_t v630 = 0LL /* C99RT_VAL */; + VAL v631 = mtw_std_maybe_Maybe_1_Some(MKI64(v630)); + VAL v632 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v624), v625, MKSTR(v626), v627, MKSTR(v628), v629, v631, x3); + x4 = v632; } break; case 56LL: { // PRIM_PACK_UNCONS decref(x1); - int64_t v673 = 0LL /* C99RT_VAL */; - VAL v674; - VAL v675; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x3, v673, &v674, &v675); - int64_t v676 = 0LL /* C99RT_VAL */; - VAL v677; - VAL v678; - mw_mirth_c99_C99ReprType_newZ_localZBang(v676, v674, &v677, &v678); - int64_t v679 = 0LL /* C99RT_VAL */; - VAL v680; - VAL v681; - mw_mirth_c99_C99ReprType_newZ_localZBang(v679, v677, &v680, &v681); - VAL v682 = (VVAL(VTUP(v680)->cells[1])); - VAL v683 = (mw_mirth_c99_ZPlusC99_indent(v682)); - STR* v684; - STRLIT(v684, "value_uncons(", 13); - VAL v685 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v684), v683)); - VAL v686 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v675); - VAL v687 = (mw_mirth_c99_ZPlusC99_put(v686, v685)); - STR* v688; - STRLIT(v688, ", &", 3); - VAL v689 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v688), v687)); - VAL v690 = VVAL(VTUP(v678)->cells[2]); - incref(v690); - VAL v691 = (mw_mirth_c99_ZPlusC99_put(v690, v689)); - STR* v692; - STRLIT(v692, ", &", 3); - VAL v693 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v692), v691)); - VAL v694 = VVAL(VTUP(v681)->cells[2]); - incref(v694); - VAL v695 = (mw_mirth_c99_ZPlusC99_put(v694, v693)); - STR* v696; - STRLIT(v696, ");", 2); - VAL v697 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v696), v695)); - VAL v698 = (mw_mirth_c99_ZPlusC99_line(v697)); - VTUP(v680)->cells[1] = v698; - VAL v699 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v680, v678)); - VAL v700 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v699, v681)); - x4 = v700; + int64_t v633 = 0LL /* C99RT_VAL */; + VAL v634; + VAL v635; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x3, v633, &v634, &v635); + int64_t v636 = 0LL /* C99RT_VAL */; + VAL v637; + VAL v638; + mw_mirth_c99_C99ReprType_newZ_valueZBang(v636, v634, &v637, &v638); + int64_t v639 = 0LL /* C99RT_VAL */; + VAL v640; + VAL v641; + mw_mirth_c99_C99ReprType_newZ_valueZBang(v639, v637, &v640, &v641); + int64_t v642 = VI64(VTUP(v640)->cells[3]); + VAL v643 = VVAL(VTUP(v640)->cells[1]); + int64_t v644 = VI64(VTUP(v643)->cells[4]); + VTUP(v643)->cells[4] = MKI64(v642); + VAL v645 = mw_mirth_c99_ZPlusC99_indent(v643); + STR* v646; + STRLIT(v646, "value_uncons(", 13); + VAL v647 = mw_mirth_c99_ZPlusC99_put(MKSTR(v646), v645); + VAL v648 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v635); + VAL v649 = mw_mirth_c99_ZPlusC99_put(v648, v647); + STR* v650; + STRLIT(v650, ", &", 3); + VAL v651 = mw_mirth_c99_ZPlusC99_put(MKSTR(v650), v649); + VAL v652 = VVAL(VTUP(v638)->cells[2]); + incref(v652); + VAL v653 = mw_mirth_c99_ZPlusC99_put(v652, v651); + STR* v654; + STRLIT(v654, ", &", 3); + VAL v655 = mw_mirth_c99_ZPlusC99_put(MKSTR(v654), v653); + VAL v656 = VVAL(VTUP(v641)->cells[2]); + incref(v656); + VAL v657 = mw_mirth_c99_ZPlusC99_put(v656, v655); + STR* v658; + STRLIT(v658, ");", 2); + VAL v659 = mw_mirth_c99_ZPlusC99_put(MKSTR(v658), v657); + VAL v660 = mw_mirth_c99_ZPlusC99_line(v659); + VTUP(v660)->cells[4] = MKI64(v644); + VTUP(v640)->cells[1] = v660; + VAL v661 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v640, v638); + VAL v662 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v661, v641); + x4 = v662; } break; case 57LL: { // PRIM_MUT_GET decref(x1); - STR* v701; - STRLIT(v701, "mut_get(", 8); - int64_t v702 = 13LL /* C99RT_PTR */; - STR* v703; - STRLIT(v703, ")", 1); - int64_t v704 = 0LL /* C99RT_VAL */; - VAL v705 = mtw_std_maybe_Maybe_1_Some(MKI64(v704)); - VAL v706 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v701), v702, MKSTR(v703), v705, x3)); - x4 = v706; + STR* v663; + STRLIT(v663, "mut_get(", 8); + int64_t v664 = 13LL /* C99RT_PTR */; + STR* v665; + STRLIT(v665, ")", 1); + int64_t v666 = 0LL /* C99RT_VAL */; + VAL v667 = mtw_std_maybe_Maybe_1_Some(MKI64(v666)); + VAL v668 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v663), v664, MKSTR(v665), v667, x3); + x4 = v668; } break; case 58LL: { // PRIM_MUT_SET decref(x1); - STR* v707; - STRLIT(v707, "mut_set(", 8); - int64_t v708 = 0LL /* C99RT_VAL */; - STR* v709; - STRLIT(v709, ", ", 2); - int64_t v710 = 13LL /* C99RT_PTR */; - STR* v711; - STRLIT(v711, ");", 2); - int64_t v712 = 0LL /* False */; - VAL v713 = MKI64(0LL /* None */); - VAL v714 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v707), v708, MKSTR(v709), v710, MKSTR(v711), v712, v713, x3)); - x4 = v714; + STR* v669; + STRLIT(v669, "mut_set(", 8); + int64_t v670 = 0LL /* C99RT_VAL */; + STR* v671; + STRLIT(v671, ", ", 2); + int64_t v672 = 13LL /* C99RT_PTR */; + STR* v673; + STRLIT(v673, ");", 2); + int64_t v674 = 0LL /* False */; + VAL v675 = MKI64(0LL /* None */); + VAL v676 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v669), v670, MKSTR(v671), v672, MKSTR(v673), v674, v675, x3); + x4 = v676; } break; case 59LL: { // PRIM_MUT_IS_SET decref(x1); - STR* v715; - STRLIT(v715, "mut_is_set(", 11); - int64_t v716 = 13LL /* C99RT_PTR */; - STR* v717; - STRLIT(v717, ")", 1); - int64_t v718 = 12LL /* C99RT_BOOL */; - VAL v719 = mtw_std_maybe_Maybe_1_Some(MKI64(v718)); - VAL v720 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v715), v716, MKSTR(v717), v719, x3)); - x4 = v720; + STR* v677; + STRLIT(v677, "mut_is_set(", 11); + int64_t v678 = 13LL /* C99RT_PTR */; + STR* v679; + STRLIT(v679, ")", 1); + int64_t v680 = 12LL /* C99RT_BOOL */; + VAL v681 = mtw_std_maybe_Maybe_1_Some(MKI64(v680)); + VAL v682 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v677), v678, MKSTR(v679), v681, x3); + x4 = v682; } break; case 60LL: { // PRIM_PTR_NIL decref(x1); - int64_t v721 = 13LL /* C99RT_PTR */; - VAL v722 = (VVAL(VTUP(x3)->cells[1])); - VAL v723; - VAL v724; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v722, &v723, &v724); - VAL v725 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v721, v723)); - VAL v726 = (mw_mirth_c99_ZPlusC99_indent(v724)); - int64_t v727 = VI64(VTUP(v725)->cells[1]); - VAL v728 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v727); - VAL v729 = (mw_mirth_c99_ZPlusC99_put(v728, v726)); - STR* v730; - STRLIT(v730, " ", 1); - VAL v731 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v730), v729)); - VAL v732 = VVAL(VTUP(v725)->cells[2]); - incref(v732); - VAL v733 = (mw_mirth_c99_ZPlusC99_put(v732, v731)); - STR* v734; - STRLIT(v734, " = ", 3); - VAL v735 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v734), v733)); - STR* v736; - STRLIT(v736, "(void*)0", 8); - VAL v737 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v736), v735)); - STR* v738; - STRLIT(v738, ";", 1); - VAL v739 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v738), v737)); - VAL v740 = (mw_mirth_c99_ZPlusC99_line(v739)); - VTUP(x3)->cells[1] = v740; - VAL v741 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x3, v725)); - x4 = v741; + int64_t v683 = 13LL /* C99RT_PTR */; + VAL v684 = VVAL(VTUP(x3)->cells[1]); + VAL v685; + VAL v686; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v684, &v685, &v686); + VTUP(x3)->cells[1] = v686; + int64_t v687 = VI64(VTUP(x3)->cells[3]); + VAL v688 = VVAL(VTUP(x3)->cells[1]); + int64_t v689 = VI64(VTUP(v688)->cells[4]); + VTUP(v688)->cells[4] = MKI64(v687); + VAL v690 = mw_mirth_c99_ZPlusC99_indent(v688); + VAL v691 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v683); + VAL v692 = mw_mirth_c99_ZPlusC99_put(v691, v690); + STR* v693; + STRLIT(v693, " ", 1); + VAL v694 = mw_mirth_c99_ZPlusC99_put(MKSTR(v693), v692); + incref(v685); + VAL v695 = mw_mirth_c99_ZPlusC99_put(v685, v694); + STR* v696; + STRLIT(v696, " = ", 3); + VAL v697 = mw_mirth_c99_ZPlusC99_put(MKSTR(v696), v695); + VAL v698 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v683, v685); + STR* v699; + STRLIT(v699, "(void*)0", 8); + VAL v700 = mw_mirth_c99_ZPlusC99_put(MKSTR(v699), v697); + STR* v701; + STRLIT(v701, ";", 1); + VAL v702 = mw_mirth_c99_ZPlusC99_put(MKSTR(v701), v700); + VAL v703 = mw_mirth_c99_ZPlusC99_line(v702); + VTUP(v703)->cells[4] = MKI64(v689); + VTUP(x3)->cells[1] = v703; + VAL v704 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x3, v698); + x4 = v704; } break; case 61LL: { // PRIM_PTR_EQ decref(x1); - STR* v742; - STRLIT(v742, "(", 1); - int64_t v743 = 13LL /* C99RT_PTR */; - STR* v744; - STRLIT(v744, " == ", 4); - int64_t v745 = 13LL /* C99RT_PTR */; - STR* v746; - STRLIT(v746, ")", 1); - int64_t v747 = 0LL /* False */; - int64_t v748 = 12LL /* C99RT_BOOL */; - VAL v749 = mtw_std_maybe_Maybe_1_Some(MKI64(v748)); - VAL v750 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v742), v743, MKSTR(v744), v745, MKSTR(v746), v747, v749, x3)); - x4 = v750; + STR* v705; + STRLIT(v705, "(", 1); + int64_t v706 = 13LL /* C99RT_PTR */; + STR* v707; + STRLIT(v707, " == ", 4); + int64_t v708 = 13LL /* C99RT_PTR */; + STR* v709; + STRLIT(v709, ")", 1); + int64_t v710 = 0LL /* False */; + int64_t v711 = 12LL /* C99RT_BOOL */; + VAL v712 = mtw_std_maybe_Maybe_1_Some(MKI64(v711)); + VAL v713 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v705), v706, MKSTR(v707), v708, MKSTR(v709), v710, v712, x3); + x4 = v713; } break; case 62LL: { // PRIM_PTR_ADD decref(x1); - STR* v751; - STRLIT(v751, "(void*)(", 8); - int64_t v752 = 2LL /* C99RT_I64 */; - STR* v753; - STRLIT(v753, " + (char*)", 10); - int64_t v754 = 13LL /* C99RT_PTR */; - STR* v755; - STRLIT(v755, ")", 1); - int64_t v756 = 0LL /* False */; - int64_t v757 = 13LL /* C99RT_PTR */; - VAL v758 = mtw_std_maybe_Maybe_1_Some(MKI64(v757)); - VAL v759 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v751), v752, MKSTR(v753), v754, MKSTR(v755), v756, v758, x3)); - x4 = v759; + STR* v714; + STRLIT(v714, "(void*)(", 8); + int64_t v715 = 2LL /* C99RT_I64 */; + STR* v716; + STRLIT(v716, " + (char*)", 10); + int64_t v717 = 13LL /* C99RT_PTR */; + STR* v718; + STRLIT(v718, ")", 1); + int64_t v719 = 0LL /* False */; + int64_t v720 = 13LL /* C99RT_PTR */; + VAL v721 = mtw_std_maybe_Maybe_1_Some(MKI64(v720)); + VAL v722 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v714), v715, MKSTR(v716), v717, MKSTR(v718), v719, v721, x3); + x4 = v722; } break; case 63LL: { // PRIM_PTR_SIZE decref(x1); - int64_t v760 = 6LL /* C99RT_U64 */; - VAL v761 = (VVAL(VTUP(x3)->cells[1])); - VAL v762; - VAL v763; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v761, &v762, &v763); - VAL v764 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v760, v762)); - VAL v765 = (mw_mirth_c99_ZPlusC99_indent(v763)); - int64_t v766 = VI64(VTUP(v764)->cells[1]); - VAL v767 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v766); - VAL v768 = (mw_mirth_c99_ZPlusC99_put(v767, v765)); - STR* v769; - STRLIT(v769, " ", 1); - VAL v770 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v769), v768)); - VAL v771 = VVAL(VTUP(v764)->cells[2]); - incref(v771); - VAL v772 = (mw_mirth_c99_ZPlusC99_put(v771, v770)); - STR* v773; - STRLIT(v773, " = ", 3); - VAL v774 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v773), v772)); - STR* v775; - STRLIT(v775, "sizeof(void*)", 13); - VAL v776 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v775), v774)); - STR* v777; - STRLIT(v777, ";", 1); - VAL v778 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v777), v776)); - VAL v779 = (mw_mirth_c99_ZPlusC99_line(v778)); - VTUP(x3)->cells[1] = v779; - VAL v780 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x3, v764)); - x4 = v780; + int64_t v723 = 6LL /* C99RT_U64 */; + VAL v724 = VVAL(VTUP(x3)->cells[1]); + VAL v725; + VAL v726; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v724, &v725, &v726); + VTUP(x3)->cells[1] = v726; + int64_t v727 = VI64(VTUP(x3)->cells[3]); + VAL v728 = VVAL(VTUP(x3)->cells[1]); + int64_t v729 = VI64(VTUP(v728)->cells[4]); + VTUP(v728)->cells[4] = MKI64(v727); + VAL v730 = mw_mirth_c99_ZPlusC99_indent(v728); + VAL v731 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v723); + VAL v732 = mw_mirth_c99_ZPlusC99_put(v731, v730); + STR* v733; + STRLIT(v733, " ", 1); + VAL v734 = mw_mirth_c99_ZPlusC99_put(MKSTR(v733), v732); + incref(v725); + VAL v735 = mw_mirth_c99_ZPlusC99_put(v725, v734); + STR* v736; + STRLIT(v736, " = ", 3); + VAL v737 = mw_mirth_c99_ZPlusC99_put(MKSTR(v736), v735); + VAL v738 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v723, v725); + STR* v739; + STRLIT(v739, "sizeof(void*)", 13); + VAL v740 = mw_mirth_c99_ZPlusC99_put(MKSTR(v739), v737); + STR* v741; + STRLIT(v741, ";", 1); + VAL v742 = mw_mirth_c99_ZPlusC99_put(MKSTR(v741), v740); + VAL v743 = mw_mirth_c99_ZPlusC99_line(v742); + VTUP(v743)->cells[4] = MKI64(v729); + VTUP(x3)->cells[1] = v743; + VAL v744 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x3, v738); + x4 = v744; } break; case 64LL: { // PRIM_PTR_ALLOC decref(x1); - STR* v781; - STRLIT(v781, "ptr_alloc(", 10); - int64_t v782 = 6LL /* C99RT_U64 */; - STR* v783; - STRLIT(v783, ");", 2); - int64_t v784 = 13LL /* C99RT_PTR */; - VAL v785 = mtw_std_maybe_Maybe_1_Some(MKI64(v784)); - VAL v786 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v781), v782, MKSTR(v783), v785, x3)); - x4 = v786; + STR* v745; + STRLIT(v745, "ptr_alloc(", 10); + int64_t v746 = 6LL /* C99RT_U64 */; + STR* v747; + STRLIT(v747, ");", 2); + int64_t v748 = 13LL /* C99RT_PTR */; + VAL v749 = mtw_std_maybe_Maybe_1_Some(MKI64(v748)); + VAL v750 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v745), v746, MKSTR(v747), v749, x3); + x4 = v750; } break; case 65LL: { // PRIM_PTR_REALLOC decref(x1); - STR* v787; - STRLIT(v787, "ptr_realloc(", 12); - int64_t v788 = 13LL /* C99RT_PTR */; - STR* v789; - STRLIT(v789, ",", 1); - int64_t v790 = 6LL /* C99RT_U64 */; - STR* v791; - STRLIT(v791, ")", 1); - int64_t v792 = 0LL /* False */; - int64_t v793 = 13LL /* C99RT_PTR */; - VAL v794 = mtw_std_maybe_Maybe_1_Some(MKI64(v793)); - VAL v795 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v787), v788, MKSTR(v789), v790, MKSTR(v791), v792, v794, x3)); - x4 = v795; + STR* v751; + STRLIT(v751, "ptr_realloc(", 12); + int64_t v752 = 13LL /* C99RT_PTR */; + STR* v753; + STRLIT(v753, ",", 1); + int64_t v754 = 6LL /* C99RT_U64 */; + STR* v755; + STRLIT(v755, ")", 1); + int64_t v756 = 0LL /* False */; + int64_t v757 = 13LL /* C99RT_PTR */; + VAL v758 = mtw_std_maybe_Maybe_1_Some(MKI64(v757)); + VAL v759 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v751), v752, MKSTR(v753), v754, MKSTR(v755), v756, v758, x3); + x4 = v759; } break; case 66LL: { // PRIM_PTR_FREE decref(x1); - STR* v796; - STRLIT(v796, "free(", 5); - int64_t v797 = 13LL /* C99RT_PTR */; - STR* v798; - STRLIT(v798, ");", 2); - VAL v799 = MKI64(0LL /* None */); - VAL v800 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v796), v797, MKSTR(v798), v799, x3)); - x4 = v800; + STR* v760; + STRLIT(v760, "free(", 5); + int64_t v761 = 13LL /* C99RT_PTR */; + STR* v762; + STRLIT(v762, ");", 2); + VAL v763 = MKI64(0LL /* None */); + VAL v764 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v760), v761, MKSTR(v762), v763, x3); + x4 = v764; } break; case 67LL: { // PRIM_PTR_COPY decref(x1); - int64_t v801 = 13LL /* C99RT_PTR */; - VAL v802; - VAL v803; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x3, v801, &v802, &v803); - int64_t v804 = 6LL /* C99RT_U64 */; - VAL v805; - VAL v806; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v802, v804, &v805, &v806); - int64_t v807 = 13LL /* C99RT_PTR */; - VAL v808; - VAL v809; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v805, v807, &v808, &v809); - VAL v810 = (VVAL(VTUP(v808)->cells[1])); - VAL v811 = (mw_mirth_c99_ZPlusC99_indent(v810)); - STR* v812; - STRLIT(v812, "ptr_copy(", 9); - VAL v813 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v812), v811)); - int64_t v814 = 13LL /* C99RT_PTR */; - VAL v815 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v814, v809); - VAL v816 = (mw_mirth_c99_ZPlusC99_put(v815, v813)); - STR* v817; - STRLIT(v817, ", ", 2); - VAL v818 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v817), v816)); - int64_t v819 = 6LL /* C99RT_U64 */; - VAL v820 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v819, v806); - VAL v821 = (mw_mirth_c99_ZPlusC99_put(v820, v818)); - STR* v822; - STRLIT(v822, ", ", 2); - VAL v823 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v822), v821)); - int64_t v824 = 13LL /* C99RT_PTR */; - VAL v825 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v824, v803); - VAL v826 = (mw_mirth_c99_ZPlusC99_put(v825, v823)); - STR* v827; - STRLIT(v827, ");", 2); - VAL v828 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v827), v826)); - VAL v829 = (mw_mirth_c99_ZPlusC99_line(v828)); - VTUP(v808)->cells[1] = v829; - x4 = v808; + int64_t v765 = 13LL /* C99RT_PTR */; + VAL v766; + VAL v767; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x3, v765, &v766, &v767); + int64_t v768 = 6LL /* C99RT_U64 */; + VAL v769; + VAL v770; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v766, v768, &v769, &v770); + int64_t v771 = 13LL /* C99RT_PTR */; + VAL v772; + VAL v773; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v769, v771, &v772, &v773); + int64_t v774 = VI64(VTUP(v772)->cells[3]); + VAL v775 = VVAL(VTUP(v772)->cells[1]); + int64_t v776 = VI64(VTUP(v775)->cells[4]); + VTUP(v775)->cells[4] = MKI64(v774); + VAL v777 = mw_mirth_c99_ZPlusC99_indent(v775); + STR* v778; + STRLIT(v778, "ptr_copy(", 9); + VAL v779 = mw_mirth_c99_ZPlusC99_put(MKSTR(v778), v777); + int64_t v780 = 13LL /* C99RT_PTR */; + VAL v781 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v780, v773); + VAL v782 = mw_mirth_c99_ZPlusC99_put(v781, v779); + STR* v783; + STRLIT(v783, ", ", 2); + VAL v784 = mw_mirth_c99_ZPlusC99_put(MKSTR(v783), v782); + int64_t v785 = 6LL /* C99RT_U64 */; + VAL v786 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v785, v770); + VAL v787 = mw_mirth_c99_ZPlusC99_put(v786, v784); + STR* v788; + STRLIT(v788, ", ", 2); + VAL v789 = mw_mirth_c99_ZPlusC99_put(MKSTR(v788), v787); + int64_t v790 = 13LL /* C99RT_PTR */; + VAL v791 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v790, v767); + VAL v792 = mw_mirth_c99_ZPlusC99_put(v791, v789); + STR* v793; + STRLIT(v793, ");", 2); + VAL v794 = mw_mirth_c99_ZPlusC99_put(MKSTR(v793), v792); + VAL v795 = mw_mirth_c99_ZPlusC99_line(v794); + VTUP(v795)->cells[4] = MKI64(v776); + VTUP(v772)->cells[1] = v795; + x4 = v772; } break; case 68LL: { // PRIM_PTR_FILL decref(x1); - int64_t v830 = 13LL /* C99RT_PTR */; - VAL v831; - VAL v832; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x3, v830, &v831, &v832); - int64_t v833 = 6LL /* C99RT_U64 */; - VAL v834; - VAL v835; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v831, v833, &v834, &v835); - int64_t v836 = 9LL /* C99RT_U8 */; - VAL v837; - VAL v838; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v834, v836, &v837, &v838); - VAL v839 = (VVAL(VTUP(v837)->cells[1])); - VAL v840 = (mw_mirth_c99_ZPlusC99_indent(v839)); - STR* v841; - STRLIT(v841, "ptr_fill(", 9); - VAL v842 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v841), v840)); - int64_t v843 = 9LL /* C99RT_U8 */; - VAL v844 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v843, v838); - VAL v845 = (mw_mirth_c99_ZPlusC99_put(v844, v842)); - STR* v846; - STRLIT(v846, ", ", 2); - VAL v847 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v846), v845)); - int64_t v848 = 6LL /* C99RT_U64 */; - VAL v849 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v848, v835); - VAL v850 = (mw_mirth_c99_ZPlusC99_put(v849, v847)); - STR* v851; - STRLIT(v851, ", ", 2); - VAL v852 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v851), v850)); - int64_t v853 = 13LL /* C99RT_PTR */; - VAL v854 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v853, v832); - VAL v855 = (mw_mirth_c99_ZPlusC99_put(v854, v852)); - STR* v856; - STRLIT(v856, ");", 2); - VAL v857 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v856), v855)); - VAL v858 = (mw_mirth_c99_ZPlusC99_line(v857)); - VTUP(v837)->cells[1] = v858; - x4 = v837; + int64_t v796 = 13LL /* C99RT_PTR */; + VAL v797; + VAL v798; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x3, v796, &v797, &v798); + int64_t v799 = 6LL /* C99RT_U64 */; + VAL v800; + VAL v801; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v797, v799, &v800, &v801); + int64_t v802 = 9LL /* C99RT_U8 */; + VAL v803; + VAL v804; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v800, v802, &v803, &v804); + int64_t v805 = VI64(VTUP(v803)->cells[3]); + VAL v806 = VVAL(VTUP(v803)->cells[1]); + int64_t v807 = VI64(VTUP(v806)->cells[4]); + VTUP(v806)->cells[4] = MKI64(v805); + VAL v808 = mw_mirth_c99_ZPlusC99_indent(v806); + STR* v809; + STRLIT(v809, "ptr_fill(", 9); + VAL v810 = mw_mirth_c99_ZPlusC99_put(MKSTR(v809), v808); + int64_t v811 = 9LL /* C99RT_U8 */; + VAL v812 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v811, v804); + VAL v813 = mw_mirth_c99_ZPlusC99_put(v812, v810); + STR* v814; + STRLIT(v814, ", ", 2); + VAL v815 = mw_mirth_c99_ZPlusC99_put(MKSTR(v814), v813); + int64_t v816 = 6LL /* C99RT_U64 */; + VAL v817 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v816, v801); + VAL v818 = mw_mirth_c99_ZPlusC99_put(v817, v815); + STR* v819; + STRLIT(v819, ", ", 2); + VAL v820 = mw_mirth_c99_ZPlusC99_put(MKSTR(v819), v818); + int64_t v821 = 13LL /* C99RT_PTR */; + VAL v822 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v821, v798); + VAL v823 = mw_mirth_c99_ZPlusC99_put(v822, v820); + STR* v824; + STRLIT(v824, ");", 2); + VAL v825 = mw_mirth_c99_ZPlusC99_put(MKSTR(v824), v823); + VAL v826 = mw_mirth_c99_ZPlusC99_line(v825); + VTUP(v826)->cells[4] = MKI64(v807); + VTUP(v803)->cells[1] = v826; + x4 = v803; } break; case 69LL: { // PRIM_STR_COPY decref(x1); - STR* v859; - STRLIT(v859, "str_make(", 9); - int64_t v860 = 13LL /* C99RT_PTR */; - STR* v861; - STRLIT(v861, ", ", 2); - int64_t v862 = 6LL /* C99RT_U64 */; - STR* v863; - STRLIT(v863, ")", 1); - int64_t v864 = 0LL /* False */; - int64_t v865 = 1LL /* C99RT_STR */; - VAL v866 = mtw_std_maybe_Maybe_1_Some(MKI64(v865)); - VAL v867 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v859), v860, MKSTR(v861), v862, MKSTR(v863), v864, v866, x3)); - x4 = v867; + STR* v827; + STRLIT(v827, "str_make(", 9); + int64_t v828 = 13LL /* C99RT_PTR */; + STR* v829; + STRLIT(v829, ", ", 2); + int64_t v830 = 6LL /* C99RT_U64 */; + STR* v831; + STRLIT(v831, ")", 1); + int64_t v832 = 0LL /* False */; + int64_t v833 = 1LL /* C99RT_STR */; + VAL v834 = mtw_std_maybe_Maybe_1_Some(MKI64(v833)); + VAL v835 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v827), v828, MKSTR(v829), v830, MKSTR(v831), v832, v834, x3); + x4 = v835; } break; case 70LL: { // PRIM_STR_NUM_BYTES decref(x1); - STR* v868; - STRLIT(v868, "str_size(", 9); - int64_t v869 = 1LL /* C99RT_STR */; - STR* v870; - STRLIT(v870, ")", 1); - int64_t v871 = 6LL /* C99RT_U64 */; - VAL v872 = mtw_std_maybe_Maybe_1_Some(MKI64(v871)); - VAL v873 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v868), v869, MKSTR(v870), v872, x3)); - x4 = v873; + STR* v836; + STRLIT(v836, "str_size(", 9); + int64_t v837 = 1LL /* C99RT_STR */; + STR* v838; + STRLIT(v838, ")", 1); + int64_t v839 = 6LL /* C99RT_U64 */; + VAL v840 = mtw_std_maybe_Maybe_1_Some(MKI64(v839)); + VAL v841 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v836), v837, MKSTR(v838), v840, x3); + x4 = v841; } break; case 71LL: { // PRIM_STR_BASE decref(x1); - STR* v874; - STRLIT(v874, "str_base(", 9); - int64_t v875 = 1LL /* C99RT_STR */; - STR* v876; - STRLIT(v876, ")", 1); - int64_t v877 = 13LL /* C99RT_PTR */; - VAL v878 = mtw_std_maybe_Maybe_1_Some(MKI64(v877)); - VAL v879 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v874), v875, MKSTR(v876), v878, x3)); - x4 = v879; + STR* v842; + STRLIT(v842, "str_base(", 9); + int64_t v843 = 1LL /* C99RT_STR */; + STR* v844; + STRLIT(v844, ")", 1); + int64_t v845 = 13LL /* C99RT_PTR */; + VAL v846 = mtw_std_maybe_Maybe_1_Some(MKI64(v845)); + VAL v847 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v842), v843, MKSTR(v844), v846, x3); + x4 = v847; } break; case 72LL: { // PRIM_STR_CAT decref(x1); - STR* v880; - STRLIT(v880, "str_cat(", 8); - int64_t v881 = 1LL /* C99RT_STR */; - STR* v882; - STRLIT(v882, ", ", 2); - int64_t v883 = 1LL /* C99RT_STR */; - STR* v884; - STRLIT(v884, ")", 1); - int64_t v885 = 0LL /* False */; - int64_t v886 = 1LL /* C99RT_STR */; - VAL v887 = mtw_std_maybe_Maybe_1_Some(MKI64(v886)); - VAL v888 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v880), v881, MKSTR(v882), v883, MKSTR(v884), v885, v887, x3)); - x4 = v888; + STR* v848; + STRLIT(v848, "str_cat(", 8); + int64_t v849 = 1LL /* C99RT_STR */; + STR* v850; + STRLIT(v850, ", ", 2); + int64_t v851 = 1LL /* C99RT_STR */; + STR* v852; + STRLIT(v852, ")", 1); + int64_t v853 = 0LL /* False */; + int64_t v854 = 1LL /* C99RT_STR */; + VAL v855 = mtw_std_maybe_Maybe_1_Some(MKI64(v854)); + VAL v856 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v848), v849, MKSTR(v850), v851, MKSTR(v852), v853, v855, x3); + x4 = v856; } break; case 73LL: { // PRIM_STR_CMP decref(x1); - STR* v889; - STRLIT(v889, "str_cmp(", 8); - int64_t v890 = 1LL /* C99RT_STR */; - STR* v891; - STRLIT(v891, ", ", 2); - int64_t v892 = 1LL /* C99RT_STR */; - STR* v893; - STRLIT(v893, ")", 1); - int64_t v894 = 0LL /* False */; - int64_t v895 = 2LL /* C99RT_I64 */; - VAL v896 = mtw_std_maybe_Maybe_1_Some(MKI64(v895)); - VAL v897 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v889), v890, MKSTR(v891), v892, MKSTR(v893), v894, v896, x3)); - x4 = v897; + STR* v857; + STRLIT(v857, "str_cmp(", 8); + int64_t v858 = 1LL /* C99RT_STR */; + STR* v859; + STRLIT(v859, ", ", 2); + int64_t v860 = 1LL /* C99RT_STR */; + STR* v861; + STRLIT(v861, ")", 1); + int64_t v862 = 0LL /* False */; + int64_t v863 = 2LL /* C99RT_I64 */; + VAL v864 = mtw_std_maybe_Maybe_1_Some(MKI64(v863)); + VAL v865 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v857), v858, MKSTR(v859), v860, MKSTR(v861), v862, v864, x3); + x4 = v865; } break; case 74LL: { // PRIM_STR_EQ decref(x1); - STR* v898; - STRLIT(v898, "(str_cmp(", 9); - int64_t v899 = 1LL /* C99RT_STR */; - STR* v900; - STRLIT(v900, ", ", 2); - int64_t v901 = 1LL /* C99RT_STR */; - STR* v902; - STRLIT(v902, ") == 0)", 7); - int64_t v903 = 0LL /* False */; - int64_t v904 = 12LL /* C99RT_BOOL */; - VAL v905 = mtw_std_maybe_Maybe_1_Some(MKI64(v904)); - VAL v906 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v898), v899, MKSTR(v900), v901, MKSTR(v902), v903, v905, x3)); - x4 = v906; + STR* v866; + STRLIT(v866, "(str_cmp(", 9); + int64_t v867 = 1LL /* C99RT_STR */; + STR* v868; + STRLIT(v868, ", ", 2); + int64_t v869 = 1LL /* C99RT_STR */; + STR* v870; + STRLIT(v870, ") == 0)", 7); + int64_t v871 = 0LL /* False */; + int64_t v872 = 12LL /* C99RT_BOOL */; + VAL v873 = mtw_std_maybe_Maybe_1_Some(MKI64(v872)); + VAL v874 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v866), v867, MKSTR(v868), v869, MKSTR(v870), v871, v873, x3); + x4 = v874; } break; case 75LL: { // PRIM_STR_LT decref(x1); - STR* v907; - STRLIT(v907, "(str_cmp(", 9); - int64_t v908 = 1LL /* C99RT_STR */; - STR* v909; - STRLIT(v909, ", ", 2); - int64_t v910 = 1LL /* C99RT_STR */; - STR* v911; - STRLIT(v911, ") < 0)", 6); - int64_t v912 = 0LL /* False */; - int64_t v913 = 12LL /* C99RT_BOOL */; - VAL v914 = mtw_std_maybe_Maybe_1_Some(MKI64(v913)); - VAL v915 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v907), v908, MKSTR(v909), v910, MKSTR(v911), v912, v914, x3)); - x4 = v915; + STR* v875; + STRLIT(v875, "(str_cmp(", 9); + int64_t v876 = 1LL /* C99RT_STR */; + STR* v877; + STRLIT(v877, ", ", 2); + int64_t v878 = 1LL /* C99RT_STR */; + STR* v879; + STRLIT(v879, ") < 0)", 6); + int64_t v880 = 0LL /* False */; + int64_t v881 = 12LL /* C99RT_BOOL */; + VAL v882 = mtw_std_maybe_Maybe_1_Some(MKI64(v881)); + VAL v883 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v875), v876, MKSTR(v877), v878, MKSTR(v879), v880, v882, x3); + x4 = v883; } break; case 76LL: { // PRIM_STR_LE decref(x1); - STR* v916; - STRLIT(v916, "(str_cmp(", 9); - int64_t v917 = 1LL /* C99RT_STR */; - STR* v918; - STRLIT(v918, ", ", 2); - int64_t v919 = 1LL /* C99RT_STR */; - STR* v920; - STRLIT(v920, ") <= 0)", 7); - int64_t v921 = 0LL /* False */; - int64_t v922 = 12LL /* C99RT_BOOL */; - VAL v923 = mtw_std_maybe_Maybe_1_Some(MKI64(v922)); - VAL v924 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v916), v917, MKSTR(v918), v919, MKSTR(v920), v921, v923, x3)); - x4 = v924; + STR* v884; + STRLIT(v884, "(str_cmp(", 9); + int64_t v885 = 1LL /* C99RT_STR */; + STR* v886; + STRLIT(v886, ", ", 2); + int64_t v887 = 1LL /* C99RT_STR */; + STR* v888; + STRLIT(v888, ") <= 0)", 7); + int64_t v889 = 0LL /* False */; + int64_t v890 = 12LL /* C99RT_BOOL */; + VAL v891 = mtw_std_maybe_Maybe_1_Some(MKI64(v890)); + VAL v892 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v884), v885, MKSTR(v886), v887, MKSTR(v888), v889, v891, x3); + x4 = v892; } break; case 77LL: { // PRIM_STR_GT decref(x1); - STR* v925; - STRLIT(v925, "(str_cmp(", 9); - int64_t v926 = 1LL /* C99RT_STR */; - STR* v927; - STRLIT(v927, ", ", 2); - int64_t v928 = 1LL /* C99RT_STR */; - STR* v929; - STRLIT(v929, ") > 0)", 6); - int64_t v930 = 0LL /* False */; - int64_t v931 = 12LL /* C99RT_BOOL */; - VAL v932 = mtw_std_maybe_Maybe_1_Some(MKI64(v931)); - VAL v933 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v925), v926, MKSTR(v927), v928, MKSTR(v929), v930, v932, x3)); - x4 = v933; + STR* v893; + STRLIT(v893, "(str_cmp(", 9); + int64_t v894 = 1LL /* C99RT_STR */; + STR* v895; + STRLIT(v895, ", ", 2); + int64_t v896 = 1LL /* C99RT_STR */; + STR* v897; + STRLIT(v897, ") > 0)", 6); + int64_t v898 = 0LL /* False */; + int64_t v899 = 12LL /* C99RT_BOOL */; + VAL v900 = mtw_std_maybe_Maybe_1_Some(MKI64(v899)); + VAL v901 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v893), v894, MKSTR(v895), v896, MKSTR(v897), v898, v900, x3); + x4 = v901; } break; case 78LL: { // PRIM_STR_GE decref(x1); - STR* v934; - STRLIT(v934, "(str_cmp(", 9); - int64_t v935 = 1LL /* C99RT_STR */; - STR* v936; - STRLIT(v936, ", ", 2); - int64_t v937 = 1LL /* C99RT_STR */; - STR* v938; - STRLIT(v938, ") >= 0)", 7); - int64_t v939 = 0LL /* False */; - int64_t v940 = 12LL /* C99RT_BOOL */; - VAL v941 = mtw_std_maybe_Maybe_1_Some(MKI64(v940)); - VAL v942 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v934), v935, MKSTR(v936), v937, MKSTR(v938), v939, v941, x3)); - x4 = v942; + STR* v902; + STRLIT(v902, "(str_cmp(", 9); + int64_t v903 = 1LL /* C99RT_STR */; + STR* v904; + STRLIT(v904, ", ", 2); + int64_t v905 = 1LL /* C99RT_STR */; + STR* v906; + STRLIT(v906, ") >= 0)", 7); + int64_t v907 = 0LL /* False */; + int64_t v908 = 12LL /* C99RT_BOOL */; + VAL v909 = mtw_std_maybe_Maybe_1_Some(MKI64(v908)); + VAL v910 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v902), v903, MKSTR(v904), v905, MKSTR(v906), v907, v909, x3); + x4 = v910; } break; case 79LL: { // PRIM_STR_NE decref(x1); - STR* v943; - STRLIT(v943, "(str_cmp(", 9); - int64_t v944 = 1LL /* C99RT_STR */; - STR* v945; - STRLIT(v945, ", ", 2); - int64_t v946 = 1LL /* C99RT_STR */; - STR* v947; - STRLIT(v947, ") != 0)", 7); - int64_t v948 = 0LL /* False */; - int64_t v949 = 12LL /* C99RT_BOOL */; - VAL v950 = mtw_std_maybe_Maybe_1_Some(MKI64(v949)); - VAL v951 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v943), v944, MKSTR(v945), v946, MKSTR(v947), v948, v950, x3)); - x4 = v951; + STR* v911; + STRLIT(v911, "(str_cmp(", 9); + int64_t v912 = 1LL /* C99RT_STR */; + STR* v913; + STRLIT(v913, ", ", 2); + int64_t v914 = 1LL /* C99RT_STR */; + STR* v915; + STRLIT(v915, ") != 0)", 7); + int64_t v916 = 0LL /* False */; + int64_t v917 = 12LL /* C99RT_BOOL */; + VAL v918 = mtw_std_maybe_Maybe_1_Some(MKI64(v917)); + VAL v919 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v911), v912, MKSTR(v913), v914, MKSTR(v915), v916, v918, x3); + x4 = v919; } break; case 80LL: { // PRIM_U8_GET decref(x1); - STR* v952; - STRLIT(v952, "*(uint8_t*)", 11); - int64_t v953 = 13LL /* C99RT_PTR */; - STR* v954; - STRLIT(v954, "", 0); - int64_t v955 = 9LL /* C99RT_U8 */; - VAL v956 = mtw_std_maybe_Maybe_1_Some(MKI64(v955)); - VAL v957 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v952), v953, MKSTR(v954), v956, x3)); - x4 = v957; + STR* v920; + STRLIT(v920, "*(uint8_t*)", 11); + int64_t v921 = 13LL /* C99RT_PTR */; + STR* v922; + STRLIT(v922, "", 0); + int64_t v923 = 9LL /* C99RT_U8 */; + VAL v924 = mtw_std_maybe_Maybe_1_Some(MKI64(v923)); + VAL v925 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v920), v921, MKSTR(v922), v924, x3); + x4 = v925; } break; case 81LL: { // PRIM_U16_GET decref(x1); - STR* v958; - STRLIT(v958, "*(uint16_t*)", 12); - int64_t v959 = 13LL /* C99RT_PTR */; - STR* v960; - STRLIT(v960, "", 0); - int64_t v961 = 8LL /* C99RT_U16 */; - VAL v962 = mtw_std_maybe_Maybe_1_Some(MKI64(v961)); - VAL v963 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v958), v959, MKSTR(v960), v962, x3)); - x4 = v963; + STR* v926; + STRLIT(v926, "*(uint16_t*)", 12); + int64_t v927 = 13LL /* C99RT_PTR */; + STR* v928; + STRLIT(v928, "", 0); + int64_t v929 = 8LL /* C99RT_U16 */; + VAL v930 = mtw_std_maybe_Maybe_1_Some(MKI64(v929)); + VAL v931 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v926), v927, MKSTR(v928), v930, x3); + x4 = v931; } break; case 82LL: { // PRIM_U32_GET decref(x1); - STR* v964; - STRLIT(v964, "*(uint32_t*)", 12); - int64_t v965 = 13LL /* C99RT_PTR */; - STR* v966; - STRLIT(v966, "", 0); - int64_t v967 = 7LL /* C99RT_U32 */; - VAL v968 = mtw_std_maybe_Maybe_1_Some(MKI64(v967)); - VAL v969 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v964), v965, MKSTR(v966), v968, x3)); - x4 = v969; + STR* v932; + STRLIT(v932, "*(uint32_t*)", 12); + int64_t v933 = 13LL /* C99RT_PTR */; + STR* v934; + STRLIT(v934, "", 0); + int64_t v935 = 7LL /* C99RT_U32 */; + VAL v936 = mtw_std_maybe_Maybe_1_Some(MKI64(v935)); + VAL v937 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v932), v933, MKSTR(v934), v936, x3); + x4 = v937; } break; case 83LL: { // PRIM_U64_GET decref(x1); + STR* v938; + STRLIT(v938, "*(uint64_t*)", 12); + int64_t v939 = 13LL /* C99RT_PTR */; + STR* v940; + STRLIT(v940, "", 0); + int64_t v941 = 6LL /* C99RT_U64 */; + VAL v942 = mtw_std_maybe_Maybe_1_Some(MKI64(v941)); + VAL v943 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v938), v939, MKSTR(v940), v942, x3); + x4 = v943; + } break; + case 84LL: { // PRIM_I8_GET + decref(x1); + STR* v944; + STRLIT(v944, "*(int8_t*)", 10); + int64_t v945 = 13LL /* C99RT_PTR */; + STR* v946; + STRLIT(v946, "", 0); + int64_t v947 = 5LL /* C99RT_I8 */; + VAL v948 = mtw_std_maybe_Maybe_1_Some(MKI64(v947)); + VAL v949 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v944), v945, MKSTR(v946), v948, x3); + x4 = v949; + } break; + case 85LL: { // PRIM_I16_GET + decref(x1); + STR* v950; + STRLIT(v950, "*(int16_t*)", 11); + int64_t v951 = 13LL /* C99RT_PTR */; + STR* v952; + STRLIT(v952, "", 0); + int64_t v953 = 4LL /* C99RT_I16 */; + VAL v954 = mtw_std_maybe_Maybe_1_Some(MKI64(v953)); + VAL v955 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v950), v951, MKSTR(v952), v954, x3); + x4 = v955; + } break; + case 86LL: { // PRIM_I32_GET + decref(x1); + STR* v956; + STRLIT(v956, "*(int32_t*)", 11); + int64_t v957 = 13LL /* C99RT_PTR */; + STR* v958; + STRLIT(v958, "", 0); + int64_t v959 = 3LL /* C99RT_I32 */; + VAL v960 = mtw_std_maybe_Maybe_1_Some(MKI64(v959)); + VAL v961 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v956), v957, MKSTR(v958), v960, x3); + x4 = v961; + } break; + case 87LL: { // PRIM_I64_GET + decref(x1); + STR* v962; + STRLIT(v962, "*(int64_t*)", 11); + int64_t v963 = 13LL /* C99RT_PTR */; + STR* v964; + STRLIT(v964, "", 0); + int64_t v965 = 2LL /* C99RT_I64 */; + VAL v966 = mtw_std_maybe_Maybe_1_Some(MKI64(v965)); + VAL v967 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v962), v963, MKSTR(v964), v966, x3); + x4 = v967; + } break; + case 88LL: { // PRIM_PTR_GET + decref(x1); + STR* v968; + STRLIT(v968, "*(void**)", 9); + int64_t v969 = 13LL /* C99RT_PTR */; STR* v970; - STRLIT(v970, "*(uint64_t*)", 12); + STRLIT(v970, "", 0); int64_t v971 = 13LL /* C99RT_PTR */; - STR* v972; - STRLIT(v972, "", 0); - int64_t v973 = 6LL /* C99RT_U64 */; - VAL v974 = mtw_std_maybe_Maybe_1_Some(MKI64(v973)); - VAL v975 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v970), v971, MKSTR(v972), v974, x3)); - x4 = v975; + VAL v972 = mtw_std_maybe_Maybe_1_Some(MKI64(v971)); + VAL v973 = mw_mirth_c99_c99Z_unopZBang(MKSTR(v968), v969, MKSTR(v970), v972, x3); + x4 = v973; } break; - case 84LL: { // PRIM_I8_GET + case 89LL: { // PRIM_U8_SET decref(x1); + STR* v974; + STRLIT(v974, "*(uint8_t*)", 11); + int64_t v975 = 13LL /* C99RT_PTR */; STR* v976; - STRLIT(v976, "*(int8_t*)", 10); - int64_t v977 = 13LL /* C99RT_PTR */; + STRLIT(v976, " = ", 3); + int64_t v977 = 9LL /* C99RT_U8 */; STR* v978; - STRLIT(v978, "", 0); - int64_t v979 = 5LL /* C99RT_I8 */; - VAL v980 = mtw_std_maybe_Maybe_1_Some(MKI64(v979)); - VAL v981 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v976), v977, MKSTR(v978), v980, x3)); + STRLIT(v978, ";", 1); + int64_t v979 = 1LL /* True */; + VAL v980 = MKI64(0LL /* None */); + VAL v981 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v974), v975, MKSTR(v976), v977, MKSTR(v978), v979, v980, x3); x4 = v981; } break; - case 85LL: { // PRIM_I16_GET + case 90LL: { // PRIM_U16_SET decref(x1); STR* v982; - STRLIT(v982, "*(int16_t*)", 11); + STRLIT(v982, "*(uint16_t*)", 12); int64_t v983 = 13LL /* C99RT_PTR */; STR* v984; - STRLIT(v984, "", 0); - int64_t v985 = 4LL /* C99RT_I16 */; - VAL v986 = mtw_std_maybe_Maybe_1_Some(MKI64(v985)); - VAL v987 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v982), v983, MKSTR(v984), v986, x3)); - x4 = v987; + STRLIT(v984, " = ", 3); + int64_t v985 = 8LL /* C99RT_U16 */; + STR* v986; + STRLIT(v986, ";", 1); + int64_t v987 = 1LL /* True */; + VAL v988 = MKI64(0LL /* None */); + VAL v989 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v982), v983, MKSTR(v984), v985, MKSTR(v986), v987, v988, x3); + x4 = v989; } break; - case 86LL: { // PRIM_I32_GET + case 91LL: { // PRIM_U32_SET decref(x1); - STR* v988; - STRLIT(v988, "*(int32_t*)", 11); - int64_t v989 = 13LL /* C99RT_PTR */; STR* v990; - STRLIT(v990, "", 0); - int64_t v991 = 3LL /* C99RT_I32 */; - VAL v992 = mtw_std_maybe_Maybe_1_Some(MKI64(v991)); - VAL v993 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v988), v989, MKSTR(v990), v992, x3)); - x4 = v993; - } break; - case 87LL: { // PRIM_I64_GET - decref(x1); + STRLIT(v990, "*(uint32_t*)", 12); + int64_t v991 = 13LL /* C99RT_PTR */; + STR* v992; + STRLIT(v992, " = ", 3); + int64_t v993 = 7LL /* C99RT_U32 */; STR* v994; - STRLIT(v994, "*(int64_t*)", 11); - int64_t v995 = 13LL /* C99RT_PTR */; - STR* v996; - STRLIT(v996, "", 0); - int64_t v997 = 2LL /* C99RT_I64 */; - VAL v998 = mtw_std_maybe_Maybe_1_Some(MKI64(v997)); - VAL v999 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v994), v995, MKSTR(v996), v998, x3)); - x4 = v999; + STRLIT(v994, ";", 1); + int64_t v995 = 1LL /* True */; + VAL v996 = MKI64(0LL /* None */); + VAL v997 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v990), v991, MKSTR(v992), v993, MKSTR(v994), v995, v996, x3); + x4 = v997; } break; - case 88LL: { // PRIM_PTR_GET + case 92LL: { // PRIM_U64_SET decref(x1); + STR* v998; + STRLIT(v998, "*(uint64_t*)", 12); + int64_t v999 = 13LL /* C99RT_PTR */; STR* v1000; - STRLIT(v1000, "*(void**)", 9); - int64_t v1001 = 13LL /* C99RT_PTR */; + STRLIT(v1000, " = ", 3); + int64_t v1001 = 6LL /* C99RT_U64 */; STR* v1002; - STRLIT(v1002, "", 0); - int64_t v1003 = 13LL /* C99RT_PTR */; - VAL v1004 = mtw_std_maybe_Maybe_1_Some(MKI64(v1003)); - VAL v1005 = (mw_mirth_c99_c99Z_unopZBang(MKSTR(v1000), v1001, MKSTR(v1002), v1004, x3)); + STRLIT(v1002, ";", 1); + int64_t v1003 = 1LL /* True */; + VAL v1004 = MKI64(0LL /* None */); + VAL v1005 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v998), v999, MKSTR(v1000), v1001, MKSTR(v1002), v1003, v1004, x3); x4 = v1005; } break; - case 89LL: { // PRIM_U8_SET + case 93LL: { // PRIM_I8_SET decref(x1); STR* v1006; - STRLIT(v1006, "*(uint8_t*)", 11); + STRLIT(v1006, "*(int8_t*)", 10); int64_t v1007 = 13LL /* C99RT_PTR */; STR* v1008; STRLIT(v1008, " = ", 3); - int64_t v1009 = 9LL /* C99RT_U8 */; + int64_t v1009 = 5LL /* C99RT_I8 */; STR* v1010; STRLIT(v1010, ";", 1); int64_t v1011 = 1LL /* True */; VAL v1012 = MKI64(0LL /* None */); - VAL v1013 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v1006), v1007, MKSTR(v1008), v1009, MKSTR(v1010), v1011, v1012, x3)); + VAL v1013 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v1006), v1007, MKSTR(v1008), v1009, MKSTR(v1010), v1011, v1012, x3); x4 = v1013; } break; - case 90LL: { // PRIM_U16_SET + case 94LL: { // PRIM_I16_SET decref(x1); STR* v1014; - STRLIT(v1014, "*(uint16_t*)", 12); + STRLIT(v1014, "*(int16_t*)", 11); int64_t v1015 = 13LL /* C99RT_PTR */; STR* v1016; STRLIT(v1016, " = ", 3); - int64_t v1017 = 8LL /* C99RT_U16 */; + int64_t v1017 = 4LL /* C99RT_I16 */; STR* v1018; STRLIT(v1018, ";", 1); int64_t v1019 = 1LL /* True */; VAL v1020 = MKI64(0LL /* None */); - VAL v1021 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v1014), v1015, MKSTR(v1016), v1017, MKSTR(v1018), v1019, v1020, x3)); + VAL v1021 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v1014), v1015, MKSTR(v1016), v1017, MKSTR(v1018), v1019, v1020, x3); x4 = v1021; } break; - case 91LL: { // PRIM_U32_SET + case 95LL: { // PRIM_I32_SET decref(x1); STR* v1022; - STRLIT(v1022, "*(uint32_t*)", 12); + STRLIT(v1022, "*(int32_t*)", 11); int64_t v1023 = 13LL /* C99RT_PTR */; STR* v1024; STRLIT(v1024, " = ", 3); - int64_t v1025 = 7LL /* C99RT_U32 */; + int64_t v1025 = 3LL /* C99RT_I32 */; STR* v1026; STRLIT(v1026, ";", 1); int64_t v1027 = 1LL /* True */; VAL v1028 = MKI64(0LL /* None */); - VAL v1029 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v1022), v1023, MKSTR(v1024), v1025, MKSTR(v1026), v1027, v1028, x3)); + VAL v1029 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v1022), v1023, MKSTR(v1024), v1025, MKSTR(v1026), v1027, v1028, x3); x4 = v1029; } break; - case 92LL: { // PRIM_U64_SET + case 96LL: { // PRIM_I64_SET decref(x1); STR* v1030; - STRLIT(v1030, "*(uint64_t*)", 12); + STRLIT(v1030, "*(int64_t*)", 11); int64_t v1031 = 13LL /* C99RT_PTR */; STR* v1032; STRLIT(v1032, " = ", 3); - int64_t v1033 = 6LL /* C99RT_U64 */; + int64_t v1033 = 2LL /* C99RT_I64 */; STR* v1034; STRLIT(v1034, ";", 1); int64_t v1035 = 1LL /* True */; VAL v1036 = MKI64(0LL /* None */); - VAL v1037 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v1030), v1031, MKSTR(v1032), v1033, MKSTR(v1034), v1035, v1036, x3)); + VAL v1037 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v1030), v1031, MKSTR(v1032), v1033, MKSTR(v1034), v1035, v1036, x3); x4 = v1037; } break; - case 93LL: { // PRIM_I8_SET + case 97LL: { // PRIM_PTR_SET decref(x1); STR* v1038; - STRLIT(v1038, "*(int8_t*)", 10); + STRLIT(v1038, "*(void**)", 9); int64_t v1039 = 13LL /* C99RT_PTR */; STR* v1040; STRLIT(v1040, " = ", 3); - int64_t v1041 = 5LL /* C99RT_I8 */; + int64_t v1041 = 13LL /* C99RT_PTR */; STR* v1042; STRLIT(v1042, ";", 1); int64_t v1043 = 1LL /* True */; VAL v1044 = MKI64(0LL /* None */); - VAL v1045 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v1038), v1039, MKSTR(v1040), v1041, MKSTR(v1042), v1043, v1044, x3)); + VAL v1045 = mw_mirth_c99_c99Z_binopZBang(MKSTR(v1038), v1039, MKSTR(v1040), v1041, MKSTR(v1042), v1043, v1044, x3); x4 = v1045; } break; - case 94LL: { // PRIM_I16_SET - decref(x1); - STR* v1046; - STRLIT(v1046, "*(int16_t*)", 11); - int64_t v1047 = 13LL /* C99RT_PTR */; - STR* v1048; - STRLIT(v1048, " = ", 3); - int64_t v1049 = 4LL /* C99RT_I16 */; - STR* v1050; - STRLIT(v1050, ";", 1); - int64_t v1051 = 1LL /* True */; - VAL v1052 = MKI64(0LL /* None */); - VAL v1053 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v1046), v1047, MKSTR(v1048), v1049, MKSTR(v1050), v1051, v1052, x3)); - x4 = v1053; - } break; - case 95LL: { // PRIM_I32_SET + case 98LL: { // PRIM_SYS_OS decref(x1); - STR* v1054; - STRLIT(v1054, "*(int32_t*)", 11); - int64_t v1055 = 13LL /* C99RT_PTR */; + int64_t v1046 = 2LL /* C99RT_I64 */; + VAL v1047 = VVAL(VTUP(x3)->cells[1]); + VAL v1048; + VAL v1049; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v1047, &v1048, &v1049); + VTUP(x3)->cells[1] = v1049; + int64_t v1050 = VI64(VTUP(x3)->cells[3]); + VAL v1051 = VVAL(VTUP(x3)->cells[1]); + int64_t v1052 = VI64(VTUP(v1051)->cells[4]); + VTUP(v1051)->cells[4] = MKI64(v1050); + VAL v1053 = mw_mirth_c99_ZPlusC99_indent(v1051); + VAL v1054 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v1046); + VAL v1055 = mw_mirth_c99_ZPlusC99_put(v1054, v1053); STR* v1056; - STRLIT(v1056, " = ", 3); - int64_t v1057 = 3LL /* C99RT_I32 */; - STR* v1058; - STRLIT(v1058, ";", 1); - int64_t v1059 = 1LL /* True */; - VAL v1060 = MKI64(0LL /* None */); - VAL v1061 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v1054), v1055, MKSTR(v1056), v1057, MKSTR(v1058), v1059, v1060, x3)); - x4 = v1061; - } break; - case 96LL: { // PRIM_I64_SET - decref(x1); + STRLIT(v1056, " ", 1); + VAL v1057 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1056), v1055); + incref(v1048); + VAL v1058 = mw_mirth_c99_ZPlusC99_put(v1048, v1057); + STR* v1059; + STRLIT(v1059, " = ", 3); + VAL v1060 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1059), v1058); + VAL v1061 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v1046, v1048); STR* v1062; - STRLIT(v1062, "*(int64_t*)", 11); - int64_t v1063 = 13LL /* C99RT_PTR */; + STRLIT(v1062, "RUNNING_OS", 10); + VAL v1063 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1062), v1060); STR* v1064; - STRLIT(v1064, " = ", 3); - int64_t v1065 = 2LL /* C99RT_I64 */; - STR* v1066; - STRLIT(v1066, ";", 1); - int64_t v1067 = 1LL /* True */; - VAL v1068 = MKI64(0LL /* None */); - VAL v1069 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v1062), v1063, MKSTR(v1064), v1065, MKSTR(v1066), v1067, v1068, x3)); - x4 = v1069; - } break; - case 97LL: { // PRIM_PTR_SET - decref(x1); - STR* v1070; - STRLIT(v1070, "*(void**)", 9); - int64_t v1071 = 13LL /* C99RT_PTR */; - STR* v1072; - STRLIT(v1072, " = ", 3); - int64_t v1073 = 13LL /* C99RT_PTR */; - STR* v1074; - STRLIT(v1074, ";", 1); - int64_t v1075 = 1LL /* True */; - VAL v1076 = MKI64(0LL /* None */); - VAL v1077 = (mw_mirth_c99_c99Z_binopZBang(MKSTR(v1070), v1071, MKSTR(v1072), v1073, MKSTR(v1074), v1075, v1076, x3)); - x4 = v1077; - } break; - case 98LL: { // PRIM_SYS_OS - decref(x1); - int64_t v1078 = 2LL /* C99RT_I64 */; - VAL v1079 = (VVAL(VTUP(x3)->cells[1])); - VAL v1080; - VAL v1081; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v1079, &v1080, &v1081); - VAL v1082 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v1078, v1080)); - VAL v1083 = (mw_mirth_c99_ZPlusC99_indent(v1081)); - int64_t v1084 = VI64(VTUP(v1082)->cells[1]); - VAL v1085 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v1084); - VAL v1086 = (mw_mirth_c99_ZPlusC99_put(v1085, v1083)); - STR* v1087; - STRLIT(v1087, " ", 1); - VAL v1088 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1087), v1086)); - VAL v1089 = VVAL(VTUP(v1082)->cells[2]); - incref(v1089); - VAL v1090 = (mw_mirth_c99_ZPlusC99_put(v1089, v1088)); - STR* v1091; - STRLIT(v1091, " = ", 3); - VAL v1092 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1091), v1090)); - STR* v1093; - STRLIT(v1093, "RUNNING_OS", 10); - VAL v1094 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1093), v1092)); - STR* v1095; - STRLIT(v1095, ";", 1); - VAL v1096 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1095), v1094)); - VAL v1097 = (mw_mirth_c99_ZPlusC99_line(v1096)); - VTUP(x3)->cells[1] = v1097; - VAL v1098 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x3, v1082)); - x4 = v1098; + STRLIT(v1064, ";", 1); + VAL v1065 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1064), v1063); + VAL v1066 = mw_mirth_c99_ZPlusC99_line(v1065); + VTUP(v1066)->cells[4] = MKI64(v1052); + VTUP(x3)->cells[1] = v1066; + VAL v1067 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x3, v1061); + x4 = v1067; } break; case 99LL: { // PRIM_SYS_ARCH decref(x1); - int64_t v1099 = 2LL /* C99RT_I64 */; - VAL v1100 = (VVAL(VTUP(x3)->cells[1])); - VAL v1101; - VAL v1102; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v1100, &v1101, &v1102); - VAL v1103 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v1099, v1101)); - VAL v1104 = (mw_mirth_c99_ZPlusC99_indent(v1102)); - int64_t v1105 = VI64(VTUP(v1103)->cells[1]); - VAL v1106 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v1105); - VAL v1107 = (mw_mirth_c99_ZPlusC99_put(v1106, v1104)); - STR* v1108; - STRLIT(v1108, " ", 1); - VAL v1109 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1108), v1107)); - VAL v1110 = VVAL(VTUP(v1103)->cells[2]); - incref(v1110); - VAL v1111 = (mw_mirth_c99_ZPlusC99_put(v1110, v1109)); - STR* v1112; - STRLIT(v1112, " = ", 3); - VAL v1113 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1112), v1111)); - STR* v1114; - STRLIT(v1114, "RUNNING_ARCH", 12); - VAL v1115 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1114), v1113)); - STR* v1116; - STRLIT(v1116, ";", 1); - VAL v1117 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1116), v1115)); - VAL v1118 = (mw_mirth_c99_ZPlusC99_line(v1117)); - VTUP(x3)->cells[1] = v1118; - VAL v1119 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x3, v1103)); - x4 = v1119; + int64_t v1068 = 2LL /* C99RT_I64 */; + VAL v1069 = VVAL(VTUP(x3)->cells[1]); + VAL v1070; + VAL v1071; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v1069, &v1070, &v1071); + VTUP(x3)->cells[1] = v1071; + int64_t v1072 = VI64(VTUP(x3)->cells[3]); + VAL v1073 = VVAL(VTUP(x3)->cells[1]); + int64_t v1074 = VI64(VTUP(v1073)->cells[4]); + VTUP(v1073)->cells[4] = MKI64(v1072); + VAL v1075 = mw_mirth_c99_ZPlusC99_indent(v1073); + VAL v1076 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v1068); + VAL v1077 = mw_mirth_c99_ZPlusC99_put(v1076, v1075); + STR* v1078; + STRLIT(v1078, " ", 1); + VAL v1079 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1078), v1077); + incref(v1070); + VAL v1080 = mw_mirth_c99_ZPlusC99_put(v1070, v1079); + STR* v1081; + STRLIT(v1081, " = ", 3); + VAL v1082 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1081), v1080); + VAL v1083 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v1068, v1070); + STR* v1084; + STRLIT(v1084, "RUNNING_ARCH", 12); + VAL v1085 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1084), v1082); + STR* v1086; + STRLIT(v1086, ";", 1); + VAL v1087 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1086), v1085); + VAL v1088 = mw_mirth_c99_ZPlusC99_line(v1087); + VTUP(v1088)->cells[4] = MKI64(v1074); + VTUP(x3)->cells[1] = v1088; + VAL v1089 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x3, v1083); + x4 = v1089; } break; case 100LL: { // PRIM_SYS_ARGC decref(x1); - int64_t v1120 = 2LL /* C99RT_I64 */; - VAL v1121 = (VVAL(VTUP(x3)->cells[1])); - VAL v1122; - VAL v1123; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v1121, &v1122, &v1123); - VAL v1124 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v1120, v1122)); - VAL v1125 = (mw_mirth_c99_ZPlusC99_indent(v1123)); - int64_t v1126 = VI64(VTUP(v1124)->cells[1]); - VAL v1127 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v1126); - VAL v1128 = (mw_mirth_c99_ZPlusC99_put(v1127, v1125)); - STR* v1129; - STRLIT(v1129, " ", 1); - VAL v1130 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1129), v1128)); - VAL v1131 = VVAL(VTUP(v1124)->cells[2]); - incref(v1131); - VAL v1132 = (mw_mirth_c99_ZPlusC99_put(v1131, v1130)); - STR* v1133; - STRLIT(v1133, " = ", 3); - VAL v1134 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1133), v1132)); - STR* v1135; - STRLIT(v1135, "global_argc", 11); - VAL v1136 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1135), v1134)); - STR* v1137; - STRLIT(v1137, ";", 1); - VAL v1138 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1137), v1136)); - VAL v1139 = (mw_mirth_c99_ZPlusC99_line(v1138)); - VTUP(x3)->cells[1] = v1139; - VAL v1140 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x3, v1124)); - x4 = v1140; + int64_t v1090 = 2LL /* C99RT_I64 */; + VAL v1091 = VVAL(VTUP(x3)->cells[1]); + VAL v1092; + VAL v1093; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v1091, &v1092, &v1093); + VTUP(x3)->cells[1] = v1093; + int64_t v1094 = VI64(VTUP(x3)->cells[3]); + VAL v1095 = VVAL(VTUP(x3)->cells[1]); + int64_t v1096 = VI64(VTUP(v1095)->cells[4]); + VTUP(v1095)->cells[4] = MKI64(v1094); + VAL v1097 = mw_mirth_c99_ZPlusC99_indent(v1095); + VAL v1098 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v1090); + VAL v1099 = mw_mirth_c99_ZPlusC99_put(v1098, v1097); + STR* v1100; + STRLIT(v1100, " ", 1); + VAL v1101 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1100), v1099); + incref(v1092); + VAL v1102 = mw_mirth_c99_ZPlusC99_put(v1092, v1101); + STR* v1103; + STRLIT(v1103, " = ", 3); + VAL v1104 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1103), v1102); + VAL v1105 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v1090, v1092); + STR* v1106; + STRLIT(v1106, "global_argc", 11); + VAL v1107 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1106), v1104); + STR* v1108; + STRLIT(v1108, ";", 1); + VAL v1109 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1108), v1107); + VAL v1110 = mw_mirth_c99_ZPlusC99_line(v1109); + VTUP(v1110)->cells[4] = MKI64(v1096); + VTUP(x3)->cells[1] = v1110; + VAL v1111 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x3, v1105); + x4 = v1111; } break; case 101LL: { // PRIM_SYS_ARGV decref(x1); - int64_t v1141 = 13LL /* C99RT_PTR */; - VAL v1142 = (VVAL(VTUP(x3)->cells[1])); - VAL v1143; - VAL v1144; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v1142, &v1143, &v1144); - VAL v1145 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v1141, v1143)); - VAL v1146 = (mw_mirth_c99_ZPlusC99_indent(v1144)); - int64_t v1147 = VI64(VTUP(v1145)->cells[1]); - VAL v1148 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v1147); - VAL v1149 = (mw_mirth_c99_ZPlusC99_put(v1148, v1146)); - STR* v1150; - STRLIT(v1150, " ", 1); - VAL v1151 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1150), v1149)); - VAL v1152 = VVAL(VTUP(v1145)->cells[2]); - incref(v1152); - VAL v1153 = (mw_mirth_c99_ZPlusC99_put(v1152, v1151)); - STR* v1154; - STRLIT(v1154, " = ", 3); - VAL v1155 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1154), v1153)); - STR* v1156; - STRLIT(v1156, "global_argv", 11); - VAL v1157 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1156), v1155)); - STR* v1158; - STRLIT(v1158, ";", 1); - VAL v1159 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v1158), v1157)); - VAL v1160 = (mw_mirth_c99_ZPlusC99_line(v1159)); - VTUP(x3)->cells[1] = v1160; - VAL v1161 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x3, v1145)); - x4 = v1161; + int64_t v1112 = 13LL /* C99RT_PTR */; + VAL v1113 = VVAL(VTUP(x3)->cells[1]); + VAL v1114; + VAL v1115; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v1113, &v1114, &v1115); + VTUP(x3)->cells[1] = v1115; + int64_t v1116 = VI64(VTUP(x3)->cells[3]); + VAL v1117 = VVAL(VTUP(x3)->cells[1]); + int64_t v1118 = VI64(VTUP(v1117)->cells[4]); + VTUP(v1117)->cells[4] = MKI64(v1116); + VAL v1119 = mw_mirth_c99_ZPlusC99_indent(v1117); + VAL v1120 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v1112); + VAL v1121 = mw_mirth_c99_ZPlusC99_put(v1120, v1119); + STR* v1122; + STRLIT(v1122, " ", 1); + VAL v1123 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1122), v1121); + incref(v1114); + VAL v1124 = mw_mirth_c99_ZPlusC99_put(v1114, v1123); + STR* v1125; + STRLIT(v1125, " = ", 3); + VAL v1126 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1125), v1124); + VAL v1127 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v1112, v1114); + STR* v1128; + STRLIT(v1128, "global_argv", 11); + VAL v1129 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1128), v1126); + STR* v1130; + STRLIT(v1130, ";", 1); + VAL v1131 = mw_mirth_c99_ZPlusC99_put(MKSTR(v1130), v1129); + VAL v1132 = mw_mirth_c99_ZPlusC99_line(v1131); + VTUP(v1132)->cells[4] = MKI64(v1118); + VTUP(x3)->cells[1] = v1132; + VAL v1133 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x3, v1127); + x4 = v1133; } break; case 12LL: { // PRIM_CORE_MATCH - VAL v1162 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1162; + VAL v1134 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1134; } break; case 13LL: { // PRIM_CORE_LAMBDA - VAL v1163 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1163; + VAL v1135 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1135; } break; case 102LL: { // PRIM_SYNTAX_MODULE - VAL v1164 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1164; + VAL v1136 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1136; } break; case 103LL: { // PRIM_SYNTAX_IMPORT - VAL v1165 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1165; + VAL v1137 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1137; } break; case 104LL: { // PRIM_SYNTAX_ALIAS - VAL v1166 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1166; + VAL v1138 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1138; } break; case 105LL: { // PRIM_SYNTAX_INLINE - VAL v1167 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1167; + VAL v1139 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1139; } break; case 106LL: { // PRIM_SYNTAX_DEF - VAL v1168 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1168; + VAL v1140 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1140; } break; case 107LL: { // PRIM_SYNTAX_DEF_MISSING - VAL v1169 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1169; + VAL v1141 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1141; } break; case 108LL: { // PRIM_SYNTAX_DEF_TYPE - VAL v1170 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1170; + VAL v1142 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1142; } break; case 109LL: { // PRIM_SYNTAX_BUFFER - VAL v1171 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1171; + VAL v1143 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1143; } break; case 110LL: { // PRIM_SYNTAX_VARIABLE - VAL v1172 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1172; + VAL v1144 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1144; } break; case 111LL: { // PRIM_SYNTAX_EXTERNAL - VAL v1173 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1173; + VAL v1145 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1145; } break; case 112LL: { // PRIM_SYNTAX_DEF_EXTERNAL - VAL v1174 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1174; + VAL v1146 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1146; } break; case 113LL: { // PRIM_SYNTAX_EMBED_STR - VAL v1175 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1175; + VAL v1147 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1147; } break; case 114LL: { // PRIM_SYNTAX_TABLE - VAL v1176 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1176; + VAL v1148 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1148; } break; case 115LL: { // PRIM_SYNTAX_FIELD - VAL v1177 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1177; + VAL v1149 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1149; } break; case 116LL: { // PRIM_SYNTAX_DATA - VAL v1178 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1178; + VAL v1150 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1150; } break; case 117LL: { // PRIM_SYNTAX_STRUCT - VAL v1179 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1179; + VAL v1151 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1151; } break; case 118LL: { // PRIM_SYNTAX_DASHES - VAL v1180 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1180; + VAL v1152 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1152; } break; case 119LL: { // PRIM_SYNTAX_ARROW - VAL v1181 = (mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3)); - x4 = v1181; + VAL v1153 = mw_mirth_c99_c99Z_primZ_syntaxZBang(x1, x3); + x4 = v1153; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -81762,13 +60570,8 @@ static VAL mw_mirth_c99_c99Z_primZ_syntaxZBang (VAL x1, VAL x2) { decref(x1); STR* v4; STRLIT(v4, "unexpected syntax primitive", 27); - VAL v5 = (VVAL(VTUP(x2)->cells[1])); - VAL v6 = (VVAL(VTUP(v5)->cells[6])); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v3, MKSTR(v4), v6); - VAL r7 = pop_resource(); - VTUP(v5)->cells[6] = r7; - VTUP(x2)->cells[1] = v5; - return x2; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13(v3, MKSTR(v4), x2); + return (VAL){0}; /* unreachable */ } static VAL mw_mirth_c99_c99Z_binopZBang (VAL x1, int64_t x2, VAL x3, int64_t x4, VAL x5, int64_t x6, VAL x7, VAL x8) { VAL x9; @@ -81781,12 +60584,12 @@ static VAL mw_mirth_c99_c99Z_binopZBang (VAL x1, int64_t x2, VAL x3, int64_t x4, if (((bool)x6)) { VAL v16; VAL v17; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x8, x2, &v16, &v17); - VAL v18 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(x2, v17); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x8, x2, &v16, &v17); + VAL v18 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(x2, v17); VAL v19; VAL v20; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v16, x4, &v19, &v20); - VAL v21 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(x4, v20); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v16, x4, &v19, &v20); + VAL v21 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(x4, v20); x15 = v21; x14 = v19; x13 = v18; @@ -81797,12 +60600,12 @@ static VAL mw_mirth_c99_c99Z_binopZBang (VAL x1, int64_t x2, VAL x3, int64_t x4, } else { VAL v22; VAL v23; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x8, x4, &v22, &v23); - VAL v24 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(x4, v23); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x8, x4, &v22, &v23); + VAL v24 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(x4, v23); VAL v25; VAL v26; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v22, x2, &v25, &v26); - VAL v27 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(x2, v26); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v22, x2, &v25, &v26); + VAL v27 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(x2, v26); x15 = v24; x14 = v25; x13 = v27; @@ -81815,47 +60618,56 @@ static VAL mw_mirth_c99_c99Z_binopZBang (VAL x1, int64_t x2, VAL x3, int64_t x4, switch (get_data_tag(x9)) { case 1LL: { // Some VAL v29 = mtp_std_maybe_Maybe_1_Some(x9); - VAL v30 = (VVAL(VTUP(x14)->cells[1])); + VAL v30 = VVAL(VTUP(x14)->cells[1]); VAL v31; VAL v32; mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v30, &v31, &v32); - VAL v33 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(VI64(v29), v31)); - VAL v34 = (mw_mirth_c99_ZPlusC99_indent(v32)); - int64_t v35 = VI64(VTUP(v33)->cells[1]); - VAL v36 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v35); - VAL v37 = (mw_mirth_c99_ZPlusC99_put(v36, v34)); - STR* v38; - STRLIT(v38, " ", 1); - VAL v39 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v38), v37)); - VAL v40 = VVAL(VTUP(v33)->cells[2]); - incref(v40); - VAL v41 = (mw_mirth_c99_ZPlusC99_put(v40, v39)); + VTUP(x14)->cells[1] = v32; + int64_t v33 = VI64(VTUP(x14)->cells[3]); + VAL v34 = VVAL(VTUP(x14)->cells[1]); + int64_t v35 = VI64(VTUP(v34)->cells[4]); + VTUP(v34)->cells[4] = MKI64(v33); + VAL v36 = mw_mirth_c99_ZPlusC99_indent(v34); + incref(v29); + VAL v37 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(VI64(v29)); + VAL v38 = mw_mirth_c99_ZPlusC99_put(v37, v36); + STR* v39; + STRLIT(v39, " ", 1); + VAL v40 = mw_mirth_c99_ZPlusC99_put(MKSTR(v39), v38); + incref(v31); + VAL v41 = mw_mirth_c99_ZPlusC99_put(v31, v40); STR* v42; STRLIT(v42, " = ", 3); - VAL v43 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v42), v41)); - VAL v44 = (mw_mirth_c99_ZPlusC99_put(x12, v43)); - VAL v45 = (mw_mirth_c99_ZPlusC99_put(x13, v44)); - VAL v46 = (mw_mirth_c99_ZPlusC99_put(x11, v45)); - VAL v47 = (mw_mirth_c99_ZPlusC99_put(x15, v46)); - VAL v48 = (mw_mirth_c99_ZPlusC99_put(x10, v47)); - STR* v49; - STRLIT(v49, ";", 1); - VAL v50 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v49), v48)); - VAL v51 = (mw_mirth_c99_ZPlusC99_line(v50)); - VTUP(x14)->cells[1] = v51; - VAL v52 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x14, v33)); - x28 = v52; + VAL v43 = mw_mirth_c99_ZPlusC99_put(MKSTR(v42), v41); + VAL v44 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(VI64(v29), v31); + VAL v45 = mw_mirth_c99_ZPlusC99_put(x12, v43); + VAL v46 = mw_mirth_c99_ZPlusC99_put(x13, v45); + VAL v47 = mw_mirth_c99_ZPlusC99_put(x11, v46); + VAL v48 = mw_mirth_c99_ZPlusC99_put(x15, v47); + VAL v49 = mw_mirth_c99_ZPlusC99_put(x10, v48); + STR* v50; + STRLIT(v50, ";", 1); + VAL v51 = mw_mirth_c99_ZPlusC99_put(MKSTR(v50), v49); + VAL v52 = mw_mirth_c99_ZPlusC99_line(v51); + VTUP(v52)->cells[4] = MKI64(v35); + VTUP(x14)->cells[1] = v52; + VAL v53 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x14, v44); + x28 = v53; } break; case 0LL: { // None - VAL v53 = (VVAL(VTUP(x14)->cells[1])); - VAL v54 = (mw_mirth_c99_ZPlusC99_indent(v53)); - VAL v55 = (mw_mirth_c99_ZPlusC99_put(x12, v54)); - VAL v56 = (mw_mirth_c99_ZPlusC99_put(x13, v55)); - VAL v57 = (mw_mirth_c99_ZPlusC99_put(x11, v56)); - VAL v58 = (mw_mirth_c99_ZPlusC99_put(x15, v57)); - VAL v59 = (mw_mirth_c99_ZPlusC99_put(x10, v58)); - VAL v60 = (mw_mirth_c99_ZPlusC99_line(v59)); - VTUP(x14)->cells[1] = v60; + int64_t v54 = VI64(VTUP(x14)->cells[3]); + VAL v55 = VVAL(VTUP(x14)->cells[1]); + int64_t v56 = VI64(VTUP(v55)->cells[4]); + VTUP(v55)->cells[4] = MKI64(v54); + VAL v57 = mw_mirth_c99_ZPlusC99_indent(v55); + VAL v58 = mw_mirth_c99_ZPlusC99_put(x12, v57); + VAL v59 = mw_mirth_c99_ZPlusC99_put(x13, v58); + VAL v60 = mw_mirth_c99_ZPlusC99_put(x11, v59); + VAL v61 = mw_mirth_c99_ZPlusC99_put(x15, v60); + VAL v62 = mw_mirth_c99_ZPlusC99_put(x10, v61); + VAL v63 = mw_mirth_c99_ZPlusC99_line(v62); + VTUP(v63)->cells[4] = MKI64(v56); + VTUP(x14)->cells[1] = v63; x28 = x14; } break; default: { @@ -81867,49 +60679,58 @@ static VAL mw_mirth_c99_c99Z_binopZBang (VAL x1, int64_t x2, VAL x3, int64_t x4, static VAL mw_mirth_c99_c99Z_unopZBang (VAL x1, int64_t x2, VAL x3, VAL x4, VAL x5) { VAL v6; VAL v7; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x5, x2, &v6, &v7); - VAL v8 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(x2, v7); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x5, x2, &v6, &v7); + VAL v8 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(x2, v7); VAL x9; switch (get_data_tag(x4)) { case 1LL: { // Some VAL v10 = mtp_std_maybe_Maybe_1_Some(x4); - VAL v11 = (VVAL(VTUP(v6)->cells[1])); + VAL v11 = VVAL(VTUP(v6)->cells[1]); VAL v12; VAL v13; mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v11, &v12, &v13); - VAL v14 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(VI64(v10), v12)); - VAL v15 = (mw_mirth_c99_ZPlusC99_indent(v13)); - int64_t v16 = VI64(VTUP(v14)->cells[1]); - VAL v17 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v16); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(v17, v15)); - STR* v19; - STRLIT(v19, " ", 1); - VAL v20 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18)); - VAL v21 = VVAL(VTUP(v14)->cells[2]); - incref(v21); - VAL v22 = (mw_mirth_c99_ZPlusC99_put(v21, v20)); + VTUP(v6)->cells[1] = v13; + int64_t v14 = VI64(VTUP(v6)->cells[3]); + VAL v15 = VVAL(VTUP(v6)->cells[1]); + int64_t v16 = VI64(VTUP(v15)->cells[4]); + VTUP(v15)->cells[4] = MKI64(v14); + VAL v17 = mw_mirth_c99_ZPlusC99_indent(v15); + incref(v10); + VAL v18 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(VI64(v10)); + VAL v19 = mw_mirth_c99_ZPlusC99_put(v18, v17); + STR* v20; + STRLIT(v20, " ", 1); + VAL v21 = mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19); + incref(v12); + VAL v22 = mw_mirth_c99_ZPlusC99_put(v12, v21); STR* v23; STRLIT(v23, " = ", 3); - VAL v24 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22)); - VAL v25 = (mw_mirth_c99_ZPlusC99_put(x1, v24)); - VAL v26 = (mw_mirth_c99_ZPlusC99_put(v8, v25)); - VAL v27 = (mw_mirth_c99_ZPlusC99_put(x3, v26)); - STR* v28; - STRLIT(v28, ";", 1); - VAL v29 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v28), v27)); - VAL v30 = (mw_mirth_c99_ZPlusC99_line(v29)); - VTUP(v6)->cells[1] = v30; - VAL v31 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v6, v14)); - x9 = v31; + VAL v24 = mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22); + VAL v25 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(VI64(v10), v12); + VAL v26 = mw_mirth_c99_ZPlusC99_put(x1, v24); + VAL v27 = mw_mirth_c99_ZPlusC99_put(v8, v26); + VAL v28 = mw_mirth_c99_ZPlusC99_put(x3, v27); + STR* v29; + STRLIT(v29, ";", 1); + VAL v30 = mw_mirth_c99_ZPlusC99_put(MKSTR(v29), v28); + VAL v31 = mw_mirth_c99_ZPlusC99_line(v30); + VTUP(v31)->cells[4] = MKI64(v16); + VTUP(v6)->cells[1] = v31; + VAL v32 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v6, v25); + x9 = v32; } break; case 0LL: { // None - VAL v32 = (VVAL(VTUP(v6)->cells[1])); - VAL v33 = (mw_mirth_c99_ZPlusC99_indent(v32)); - VAL v34 = (mw_mirth_c99_ZPlusC99_put(x1, v33)); - VAL v35 = (mw_mirth_c99_ZPlusC99_put(v8, v34)); - VAL v36 = (mw_mirth_c99_ZPlusC99_put(x3, v35)); - VAL v37 = (mw_mirth_c99_ZPlusC99_line(v36)); - VTUP(v6)->cells[1] = v37; + int64_t v33 = VI64(VTUP(v6)->cells[3]); + VAL v34 = VVAL(VTUP(v6)->cells[1]); + int64_t v35 = VI64(VTUP(v34)->cells[4]); + VTUP(v34)->cells[4] = MKI64(v33); + VAL v36 = mw_mirth_c99_ZPlusC99_indent(v34); + VAL v37 = mw_mirth_c99_ZPlusC99_put(x1, v36); + VAL v38 = mw_mirth_c99_ZPlusC99_put(v8, v37); + VAL v39 = mw_mirth_c99_ZPlusC99_put(x3, v38); + VAL v40 = mw_mirth_c99_ZPlusC99_line(v39); + VTUP(v40)->cells[4] = MKI64(v35); + VTUP(v6)->cells[1] = v40; x9 = v6; } break; default: { @@ -81919,1336 +60740,625 @@ static VAL mw_mirth_c99_c99Z_unopZBang (VAL x1, int64_t x2, VAL x3, VAL x4, VAL return x9; } static VAL mw_mirth_c99_c99Z_argsZ_pushZBang (VAL x1, VAL x2) { - VAL v3; - VAL v4; - mw_std_list_List_1_uncons(x1, &v3, &v4); - VAL x5; - VAL x6; - int64_t x7; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v3); - VAL v9 = (mw_mirth_c99_c99Z_argZ_pushZBang(VU64(v8), x2)); - int64_t v10 = 1LL /* True */; - x7 = v10; - x6 = v4; - x5 = v9; - } break; - case 0LL: { // None - int64_t v11 = 0LL /* False */; - x7 = v11; - x6 = v4; - x5 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v12 = (x5); - VAL v13 = x6; - int64_t v14 = x7; - while (((bool)v14)) { - VAL v15 = (v12); - VAL v16 = v13; - VAL v17; - VAL v18; - mw_std_list_List_1_uncons(v16, &v17, &v18); - VAL x19; - VAL x20; - int64_t x21; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v22 = mtp_std_maybe_Maybe_1_Some(v17); - VAL v23 = (mw_mirth_c99_c99Z_argZ_pushZBang(VU64(v22), v15)); - int64_t v24 = 1LL /* True */; - x21 = v24; - x20 = v18; - x19 = v23; + int64_t v3 = 1LL /* True */; + VAL v4 = x2; + VAL v5 = x1; + int64_t v6 = v3; + int64_t v7 = v3; + while (((bool)v7)) { + VAL v8 = v4; + VAL v9 = v5; + int64_t v10 = v6; + VAL x11; + VAL x12; + int64_t x13; + switch (get_data_tag(v9)) { + case 1LL: { // Cons + VAL v14; + VAL v15; + mtp_std_list_List_1_Cons(v9, &v14, &v15); + VAL v16 = mw_mirth_c99_c99Z_argZ_pushZBang(VU64(v14), v8); + int64_t v17 = 1LL /* True */; + x13 = v17; + x12 = v15; + x11 = v16; } break; - case 0LL: { // None - int64_t v25 = 0LL /* False */; - x21 = v25; - x20 = v18; - x19 = v15; + case 0LL: { // Nil + VAL v18 = MKI64(0LL /* Nil */); + int64_t v19 = 0LL /* False */; + x13 = v19; + x12 = v18; + x11 = v8; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v14 = x21; - v13 = x20; - v12 = x19; + v7 = x13; + v6 = x13; + v5 = x12; + v4 = x11; } - decref(v13); - return v12; + decref(v5); + return v4; } static VAL mw_mirth_c99_c99Z_argZ_pushZBang (uint64_t x1, VAL x2) { - VAL v3 = (mw_mirth_c99_c99Z_blockZ_pushZBang(x1, x2)); + VAL v3 = mw_mirth_c99_c99Z_blockZ_pushZBang(x1, x2); return v3; } static VAL mw_mirth_c99_c99Z_argZ_runZBang (uint64_t x1, VAL x2) { - VAL v3 = (mw_mirth_c99_c99Z_blockZ_runZBang(x1, x2)); + VAL v3 = mw_mirth_c99_c99Z_blockZ_runZBang(x1, x2); return v3; } static VAL mw_mirth_c99_c99Z_blockZ_runZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); - VAL v4 = (VVAL(VTUP(v3)->cells[6])); - VAL v5; - VAL v6; - mw_mirth_arrow_Block_arrow(v4, x1, &v5, &v6); - VTUP(v3)->cells[6] = v5; - VTUP(x2)->cells[1] = v3; - VAL v7 = (mw_mirth_c99_c99Z_arrowZBang(v6, x2)); - return v7; + VAL v3; + VAL v4; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp1(x1, x2, &v3, &v4); + VAL v5 = mw_mirth_c99_c99Z_codipZ_arrowZBang(v3, v4); + return v5; } static VAL mw_mirth_c99_ZPlusC99_varZ_put (uint64_t x1, VAL x2) { STR* v3; STRLIT(v3, "var_", 4); - VAL v4 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2)); + VAL v4 = mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2); uint64_t v5 = mw_mirth_var_Var_name(x1); VAL v6 = mw_mirth_name_Name_mangled(v5); - VAL v7 = (mw_mirth_c99_ZPlusC99_put(v6, v4)); + VAL v7 = mw_mirth_c99_ZPlusC99_put(v6, v4); return v7; } static VAL mw_mirth_c99_c99Z_packZ_closureZ_varsZBang (VAL x1, VAL x2) { - VAL v3 = MKI64(0LL /* Nil */); - VAL v4 = mw_std_list_List_1_reverse(v3); - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(x1, &v5, &v6); - VAL x7; - VAL x8; - VAL x9; - int64_t x10; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v5); - incref(v11); - int64_t v12 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v11)); - VAL x13; - VAL x14; - if (((bool)v12)) { - VAL v15 = mtw_std_maybe_Maybe_1_Some(v11); - x14 = v15; - x13 = x2; - } else { - decref(v11); - VAL v16 = MKI64(0LL /* None */); - x14 = v16; - x13 = x2; - } - VAL x17; - switch (get_data_tag(x14)) { - case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(x14); - VAL v19 = mtw_std_list_List_1_Cons(v18, v4); - x17 = v19; - push_resource(x13); + VAL v3 = mw_std_list_List_1_filter_1_sp1(x1); + incref(v3); + int64_t v4 = mw_std_list_List_1_emptyZAsk(v3); + VAL x5; + if (((bool)v4)) { + decref(v3); + x5 = x2; + } else { + int64_t v6 = 14LL /* C99RT_FNPTR */; + VAL v7; + VAL v8; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x2, v6, &v7, &v8); + int64_t v9 = 0LL /* C99RT_VAL */; + VAL v10 = VVAL(VTUP(v7)->cells[1]); + VAL v11; + VAL v12; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v10, &v11, &v12); + VTUP(v7)->cells[1] = v12; + int64_t v13 = VI64(VTUP(v7)->cells[3]); + VAL v14 = VVAL(VTUP(v7)->cells[1]); + int64_t v15 = VI64(VTUP(v14)->cells[4]); + VTUP(v14)->cells[4] = MKI64(v13); + VAL v16 = mw_mirth_c99_ZPlusC99_indent(v14); + VAL v17 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v9); + VAL v18 = mw_mirth_c99_ZPlusC99_put(v17, v16); + STR* v19; + STRLIT(v19, " ", 1); + VAL v20 = mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18); + incref(v11); + VAL v21 = mw_mirth_c99_ZPlusC99_put(v11, v20); + STR* v22; + STRLIT(v22, " = ", 3); + VAL v23 = mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v21); + VAL v24 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v9, v11); + STR* v25; + STRLIT(v25, "MKTUP(tup_new(", 14); + VAL v26 = mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v23); + incref(v3); + int64_t v27 = mw_std_list_List_1_len(v3); + int64_t v28 = 1LL; + int64_t v29 = i64_add(v27, v28); + STR* v30 = i64_show(v29); + incref(MKSTR(v30)); + VAL v31 = mw_mirth_c99_ZPlusC99_put(MKSTR(v30), v26); + STR* v32; + STRLIT(v32, "), ", 3); + VAL v33 = mw_mirth_c99_ZPlusC99_put(MKSTR(v32), v31); + VAL v34 = mw_mirth_c99_ZPlusC99_put(MKSTR(v30), v33); + STR* v35; + STRLIT(v35, ")", 1); + VAL v36 = mw_mirth_c99_ZPlusC99_put(MKSTR(v35), v34); + STR* v37; + STRLIT(v37, ";", 1); + VAL v38 = mw_mirth_c99_ZPlusC99_put(MKSTR(v37), v36); + VAL v39 = mw_mirth_c99_ZPlusC99_line(v38); + VTUP(v39)->cells[4] = MKI64(v15); + VTUP(v7)->cells[1] = v39; + int64_t v40 = VI64(VTUP(v7)->cells[3]); + VAL v41 = VVAL(VTUP(v7)->cells[1]); + int64_t v42 = VI64(VTUP(v41)->cells[4]); + VTUP(v41)->cells[4] = MKI64(v40); + VAL v43 = mw_mirth_c99_ZPlusC99_indent(v41); + STR* v44; + STRLIT(v44, "VTUP(", 5); + VAL v45 = mw_mirth_c99_ZPlusC99_put(MKSTR(v44), v43); + VAL v46; + VAL v47; + mw_mirth_c99_ZPlusC99Value_rdup(v24, &v46, &v47); + VAL v48 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v46); + VAL v49 = mw_mirth_c99_ZPlusC99_put(v48, v45); + STR* v50; + STRLIT(v50, ")->cells[0] = ", 14); + VAL v51 = mw_mirth_c99_ZPlusC99_put(MKSTR(v50), v49); + VAL v52 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v8); + VAL v53 = mw_mirth_c99_ZPlusC99_put(v52, v51); + STR* v54; + STRLIT(v54, ";", 1); + VAL v55 = mw_mirth_c99_ZPlusC99_put(MKSTR(v54), v53); + VAL v56 = mw_mirth_c99_ZPlusC99_line(v55); + VTUP(v56)->cells[4] = MKI64(v42); + VTUP(v7)->cells[1] = v56; + int64_t v57 = 1LL; + int64_t v58 = 1LL /* True */; + int64_t v59 = v57; + VAL v60 = v47; + VAL v61 = v7; + VAL v62 = v3; + int64_t v63 = v58; + int64_t v64 = v58; + while (((bool)v64)) { + int64_t v65 = v59; + VAL v66 = v60; + VAL v67 = v61; + VAL v68 = v62; + int64_t v69 = v63; + VAL x70; + VAL x71; + int64_t x72; + VAL x73; + int64_t x74; + switch (get_data_tag(v68)) { + case 1LL: { // Cons + VAL v75; + VAL v76; + mtp_std_list_List_1_Cons(v68, &v75, &v76); + int64_t v77 = VI64(VTUP(v67)->cells[3]); + VAL v78 = VVAL(VTUP(v67)->cells[1]); + int64_t v79 = VI64(VTUP(v78)->cells[4]); + VTUP(v78)->cells[4] = MKI64(v77); + VAL v80 = mw_mirth_c99_ZPlusC99_indent(v78); + STR* v81; + STRLIT(v81, "VTUP(", 5); + VAL v82 = mw_mirth_c99_ZPlusC99_put(MKSTR(v81), v80); + VAL v83; + VAL v84; + mw_mirth_c99_ZPlusC99Value_rdup(v66, &v83, &v84); + VAL v85 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v83); + VAL v86 = mw_mirth_c99_ZPlusC99_put(v85, v82); + STR* v87; + STRLIT(v87, ")->cells[", 9); + VAL v88 = mw_mirth_c99_ZPlusC99_put(MKSTR(v87), v86); + STR* v89 = i64_show(v65); + VAL v90 = mw_mirth_c99_ZPlusC99_put(MKSTR(v89), v88); + STR* v91; + STRLIT(v91, "] = ", 4); + VAL v92 = mw_mirth_c99_ZPlusC99_put(MKSTR(v91), v90); + incref(v75); + VAL v93 = mw_mirth_c99_ZPlusC99_varZ_put(VU64(v75), v92); + STR* v94; + STRLIT(v94, "; incref(", 9); + VAL v95 = mw_mirth_c99_ZPlusC99_put(MKSTR(v94), v93); + VAL v96 = mw_mirth_c99_ZPlusC99_varZ_put(VU64(v75), v95); + STR* v97; + STRLIT(v97, ");", 2); + VAL v98 = mw_mirth_c99_ZPlusC99_put(MKSTR(v97), v96); + VAL v99 = mw_mirth_c99_ZPlusC99_line(v98); + VTUP(v99)->cells[4] = MKI64(v79); + VTUP(v67)->cells[1] = v99; + int64_t v100 = 1LL; + int64_t v101 = i64_add(v65, v100); + int64_t v102 = 1LL /* True */; + x74 = v102; + x73 = v76; + x72 = v101; + x71 = v67; + x70 = v84; } break; - case 0LL: { // None - x17 = v4; - push_resource(x13); + case 0LL: { // Nil + VAL v103 = MKI64(0LL /* Nil */); + int64_t v104 = 0LL /* False */; + x74 = v104; + x73 = v103; + x72 = v65; + x71 = v67; + x70 = v66; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v20 = 1LL /* True */; - x10 = v20; - x9 = v6; - x8 = x17; - VAL r21 = pop_resource(); - x7 = r21; - } break; - case 0LL: { // None - int64_t v22 = 0LL /* False */; - x10 = v22; - x9 = v6; - x8 = v4; - x7 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v23 = (x7); - VAL v24 = (x8); - VAL v25 = x9; - int64_t v26 = x10; - while (((bool)v26)) { - VAL v27 = (v23); - VAL v28 = (v24); - VAL v29 = v25; - VAL v30; - VAL v31; - mw_std_list_List_1_uncons(v29, &v30, &v31); - VAL x32; - VAL x33; - VAL x34; - int64_t x35; - switch (get_data_tag(v30)) { - case 1LL: { // Some - VAL v36 = mtp_std_maybe_Maybe_1_Some(v30); - incref(v36); - int64_t v37 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v36)); - VAL x38; - VAL x39; - if (((bool)v37)) { - VAL v40 = mtw_std_maybe_Maybe_1_Some(v36); - x39 = v40; - x38 = v27; - } else { - decref(v36); - VAL v41 = MKI64(0LL /* None */); - x39 = v41; - x38 = v27; - } - VAL x42; - switch (get_data_tag(x39)) { - case 1LL: { // Some - VAL v43 = mtp_std_maybe_Maybe_1_Some(x39); - VAL v44 = mtw_std_list_List_1_Cons(v43, v28); - x42 = v44; - push_resource(x38); - } break; - case 0LL: { // None - x42 = v28; - push_resource(x38); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v45 = 1LL /* True */; - x35 = v45; - x34 = v31; - x33 = x42; - VAL r46 = pop_resource(); - x32 = r46; - } break; - case 0LL: { // None - int64_t v47 = 0LL /* False */; - x35 = v47; - x34 = v31; - x33 = v28; - x32 = v27; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } + v64 = x74; + v63 = x74; + v62 = x73; + v61 = x71; + v60 = x70; + v59 = x72; } - v26 = x35; - v25 = x34; - v24 = x33; - v23 = x32; + decref(v62); + VAL v105 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v61, v60); + x5 = v105; } - decref(v25); - VAL v48 = mw_std_list_List_1_reverse(v24); - incref(v48); - int64_t v49 = mw_std_list_List_1_emptyZAsk(v48); - VAL x50; - if (((bool)v49)) { - decref(v48); - x50 = v23; + return x5; +} +static VAL mw_mirth_c99_c99Z_popZ_toZ_varZBang (uint64_t x1, VAL x2) { + VAL v3 = mw_mirth_var_Var_type(x1); + int64_t v4; + VAL v5; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp6(v3, x2, &v4, &v5); + VAL v6; + VAL v7; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v5, v4, &v6, &v7); + VAL v8 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v7); + VAL v9 = VVAL(VTUP(v6)->cells[1]); + VAL v10 = mw_mirth_c99_ZPlusC99_indent(v9); + STR* v11; + STRLIT(v11, "VAL ", 4); + VAL v12 = mw_mirth_c99_ZPlusC99_put(MKSTR(v11), v10); + VAL v13 = mw_mirth_c99_ZPlusC99_varZ_put(x1, v12); + STR* v14; + STRLIT(v14, " = ", 3); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13); + VAL v16 = mw_mirth_c99_ZPlusC99_put(v8, v15); + STR* v17; + STRLIT(v17, ";", 1); + VAL v18 = mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16); + VAL v19 = mw_mirth_c99_ZPlusC99_line(v18); + VTUP(v6)->cells[1] = v19; + return v6; +} +static VAL mw_mirth_c99_c99Z_unpackZ_closureZ_varsZBang (VAL x1, VAL x2) { + VAL v3 = mw_std_list_List_1_filter_1_sp1(x1); + incref(v3); + int64_t v4 = mw_std_list_List_1_emptyZAsk(v3); + VAL x5; + if (((bool)v4)) { + decref(v3); + x5 = x2; } else { - int64_t v51 = 14LL /* C99RT_FNPTR */; - VAL v52; - VAL v53; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v23, v51, &v52, &v53); - int64_t v54 = 0LL /* C99RT_VAL */; - VAL v55 = (VVAL(VTUP(v52)->cells[1])); - VAL v56; - VAL v57; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v55, &v56, &v57); - VAL v58 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v54, v56)); - VAL v59 = (mw_mirth_c99_ZPlusC99_indent(v57)); - int64_t v60 = VI64(VTUP(v58)->cells[1]); - VAL v61 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v60); - VAL v62 = (mw_mirth_c99_ZPlusC99_put(v61, v59)); - STR* v63; - STRLIT(v63, " ", 1); - VAL v64 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v63), v62)); - VAL v65 = VVAL(VTUP(v58)->cells[2]); - incref(v65); - VAL v66 = (mw_mirth_c99_ZPlusC99_put(v65, v64)); - STR* v67; - STRLIT(v67, " = ", 3); - VAL v68 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v67), v66)); - STR* v69; - STRLIT(v69, "MKTUP(tup_new(", 14); - VAL v70 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v69), v68)); - incref(v48); - int64_t v71 = mw_std_list_List_1_len(v48); - int64_t v72 = 1LL; - int64_t v73 = i64_add(v71, v72); - STR* v74 = i64_show(v73); - incref(MKSTR(v74)); - VAL v75 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v70)); - STR* v76; - STRLIT(v76, "), ", 3); - VAL v77 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v76), v75)); - VAL v78 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v77)); - STR* v79; - STRLIT(v79, ")", 1); - VAL v80 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v79), v78)); - STR* v81; - STRLIT(v81, ";", 1); - VAL v82 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v81), v80)); - VAL v83 = (mw_mirth_c99_ZPlusC99_line(v82)); - VTUP(v52)->cells[1] = v83; - VAL v84 = (VVAL(VTUP(v52)->cells[1])); - VAL v85 = (mw_mirth_c99_ZPlusC99_indent(v84)); - STR* v86; - STRLIT(v86, "VTUP(", 5); - VAL v87 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v86), v85)); - VAL v88; - VAL v89; - mw_mirth_c99_ZPlusC99Local_rdup(v58, &v88, &v89); - VAL v90 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v88); - VAL v91 = (mw_mirth_c99_ZPlusC99_put(v90, v87)); - STR* v92; - STRLIT(v92, ")->cells[0] = ", 14); - VAL v93 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v92), v91)); - VAL v94 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v53); - VAL v95 = (mw_mirth_c99_ZPlusC99_put(v94, v93)); - STR* v96; - STRLIT(v96, ";", 1); - VAL v97 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v96), v95)); - VAL v98 = (mw_mirth_c99_ZPlusC99_line(v97)); - VTUP(v52)->cells[1] = v98; - int64_t v99 = 1LL; - VAL v100; - VAL v101; - mw_std_list_List_1_uncons(v48, &v100, &v101); - VAL x102; - VAL x103; - int64_t x104; - VAL x105; - int64_t x106; - switch (get_data_tag(v100)) { - case 1LL: { // Some - VAL v107 = mtp_std_maybe_Maybe_1_Some(v100); - VAL v108 = (VVAL(VTUP(v52)->cells[1])); - VAL v109 = (mw_mirth_c99_ZPlusC99_indent(v108)); - STR* v110; - STRLIT(v110, "VTUP(", 5); - VAL v111 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v110), v109)); - VAL v112; - VAL v113; - mw_mirth_c99_ZPlusC99Local_rdup(v89, &v112, &v113); - VAL v114 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v112); - VAL v115 = (mw_mirth_c99_ZPlusC99_put(v114, v111)); - STR* v116; - STRLIT(v116, ")->cells[", 9); - VAL v117 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v116), v115)); - STR* v118 = i64_show(v99); - VAL v119 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v118), v117)); - STR* v120; - STRLIT(v120, "] = ", 4); - VAL v121 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v120), v119)); - incref(v107); - VAL v122 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v107), v121)); - STR* v123; - STRLIT(v123, "; incref(", 9); - VAL v124 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v123), v122)); - VAL v125 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v107), v124)); - STR* v126; - STRLIT(v126, ");", 2); - VAL v127 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v126), v125)); - VAL v128 = (mw_mirth_c99_ZPlusC99_line(v127)); - VTUP(v52)->cells[1] = v128; - int64_t v129 = 1LL; - int64_t v130 = i64_add(v99, v129); - int64_t v131 = 1LL /* True */; - x106 = v131; - x105 = v101; - x104 = v130; - x103 = v52; - x102 = v113; - } break; - case 0LL: { // None - int64_t v132 = 0LL /* False */; - x106 = v132; - x105 = v101; - x104 = v99; - x103 = v52; - x102 = v89; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v133 = x102; - VAL v134 = (x103); - int64_t v135 = x104; - VAL v136 = x105; - int64_t v137 = x106; - while (((bool)v137)) { - VAL v138 = v133; - VAL v139 = (v134); - int64_t v140 = v135; - VAL v141 = v136; - VAL v142; - VAL v143; - mw_std_list_List_1_uncons(v141, &v142, &v143); - VAL x144; - VAL x145; - int64_t x146; - VAL x147; - int64_t x148; - switch (get_data_tag(v142)) { - case 1LL: { // Some - VAL v149 = mtp_std_maybe_Maybe_1_Some(v142); - VAL v150 = (VVAL(VTUP(v139)->cells[1])); - VAL v151 = (mw_mirth_c99_ZPlusC99_indent(v150)); - STR* v152; - STRLIT(v152, "VTUP(", 5); - VAL v153 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v152), v151)); - VAL v154; - VAL v155; - mw_mirth_c99_ZPlusC99Local_rdup(v138, &v154, &v155); - VAL v156 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v154); - VAL v157 = (mw_mirth_c99_ZPlusC99_put(v156, v153)); - STR* v158; - STRLIT(v158, ")->cells[", 9); - VAL v159 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v158), v157)); - STR* v160 = i64_show(v140); - VAL v161 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v160), v159)); - STR* v162; - STRLIT(v162, "] = ", 4); - VAL v163 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v162), v161)); - incref(v149); - VAL v164 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v149), v163)); - STR* v165; - STRLIT(v165, "; incref(", 9); - VAL v166 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v165), v164)); - VAL v167 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v149), v166)); - STR* v168; - STRLIT(v168, ");", 2); - VAL v169 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v168), v167)); - VAL v170 = (mw_mirth_c99_ZPlusC99_line(v169)); - VTUP(v139)->cells[1] = v170; - int64_t v171 = 1LL; - int64_t v172 = i64_add(v140, v171); - int64_t v173 = 1LL /* True */; - x148 = v173; - x147 = v143; - x146 = v172; - x145 = v139; - x144 = v155; + int64_t v6 = 0LL /* C99RT_VAL */; + VAL v7; + VAL v8; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(x2, v6, &v7, &v8); + int64_t v9 = 1LL; + int64_t v10 = 1LL /* True */; + int64_t v11 = v9; + VAL v12 = v8; + VAL v13 = v7; + VAL v14 = v3; + int64_t v15 = v10; + int64_t v16 = v10; + while (((bool)v16)) { + int64_t v17 = v11; + VAL v18 = v12; + VAL v19 = v13; + VAL v20 = v14; + int64_t v21 = v15; + VAL x22; + VAL x23; + int64_t x24; + VAL x25; + int64_t x26; + switch (get_data_tag(v20)) { + case 1LL: { // Cons + VAL v27; + VAL v28; + mtp_std_list_List_1_Cons(v20, &v27, &v28); + int64_t v29 = VI64(VTUP(v19)->cells[3]); + VAL v30 = VVAL(VTUP(v19)->cells[1]); + int64_t v31 = VI64(VTUP(v30)->cells[4]); + VTUP(v30)->cells[4] = MKI64(v29); + VAL v32 = mw_mirth_c99_ZPlusC99_indent(v30); + STR* v33; + STRLIT(v33, "VAL ", 4); + VAL v34 = mw_mirth_c99_ZPlusC99_put(MKSTR(v33), v32); + incref(v27); + VAL v35 = mw_mirth_c99_ZPlusC99_varZ_put(VU64(v27), v34); + STR* v36; + STRLIT(v36, " = VTUP(", 8); + VAL v37 = mw_mirth_c99_ZPlusC99_put(MKSTR(v36), v35); + VAL v38; + VAL v39; + mw_mirth_c99_ZPlusC99Value_rdup(v18, &v38, &v39); + VAL v40 = mw_mirth_c99_ZPlusC99Value_consumeZ_asZ_VAL(v38); + VAL v41 = mw_mirth_c99_ZPlusC99_put(v40, v37); + STR* v42; + STRLIT(v42, ")->cells[", 9); + VAL v43 = mw_mirth_c99_ZPlusC99_put(MKSTR(v42), v41); + STR* v44 = i64_show(v17); + VAL v45 = mw_mirth_c99_ZPlusC99_put(MKSTR(v44), v43); + STR* v46; + STRLIT(v46, "]; incref(", 10); + VAL v47 = mw_mirth_c99_ZPlusC99_put(MKSTR(v46), v45); + VAL v48 = mw_mirth_c99_ZPlusC99_varZ_put(VU64(v27), v47); + STR* v49; + STRLIT(v49, ");", 2); + VAL v50 = mw_mirth_c99_ZPlusC99_put(MKSTR(v49), v48); + VAL v51 = mw_mirth_c99_ZPlusC99_line(v50); + VTUP(v51)->cells[4] = MKI64(v31); + VTUP(v19)->cells[1] = v51; + int64_t v52 = 1LL; + int64_t v53 = i64_add(v17, v52); + int64_t v54 = 1LL /* True */; + x26 = v54; + x25 = v28; + x24 = v53; + x23 = v19; + x22 = v39; } break; - case 0LL: { // None - int64_t v174 = 0LL /* False */; - x148 = v174; - x147 = v143; - x146 = v140; - x145 = v139; - x144 = v138; + case 0LL: { // Nil + VAL v55 = MKI64(0LL /* Nil */); + int64_t v56 = 0LL /* False */; + x26 = v56; + x25 = v55; + x24 = v17; + x23 = v19; + x22 = v18; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v137 = x148; - v136 = x147; - v135 = x146; - v134 = x145; - v133 = x144; + v16 = x26; + v15 = x26; + v14 = x25; + v13 = x23; + v12 = x22; + v11 = x24; } - decref(v136); - VAL v175 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v134, v133)); - x50 = v175; + decref(v14); + VAL v57 = mw_mirth_c99_ZPlusC99Value_dropZ_valueZBang(v13, v12); + x5 = v57; } - return x50; + return x5; } -static VAL mw_mirth_c99_c99Z_popZ_toZ_varZBang (uint64_t x1, VAL x2) { - VAL v3 = mw_mirth_var_Var_type(x1); - VAL v4 = (VVAL(VTUP(x2)->cells[1])); - VAL v5 = (VVAL(VTUP(v4)->cells[6])); - int64_t v6; - VAL v7; - mw_mirth_type_Type_c99Z_repr(v3, v5, &v6, &v7); - VTUP(v4)->cells[6] = v7; - VTUP(x2)->cells[1] = v4; - VAL v8; - VAL v9; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(x2, v6, &v8, &v9); - VAL v10 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v9); - VAL v11 = (VVAL(VTUP(v8)->cells[1])); - VAL v12 = (mw_mirth_c99_ZPlusC99_indent(v11)); - STR* v13; - STRLIT(v13, "VAL ", 4); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12)); - VAL v15 = (mw_mirth_c99_ZPlusC99_varZ_put(x1, v14)); - STR* v16; - STRLIT(v16, " = ", 3); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15)); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(v10, v17)); - STR* v19; - STRLIT(v19, ";", 1); - VAL v20 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18)); - VAL v21 = (mw_mirth_c99_ZPlusC99_line(v20)); - VTUP(v8)->cells[1] = v21; - return v8; +static VAL mw_mirth_c99_c99Z_decrefZ_closureZ_varsZBang (VAL x1, VAL x2) { + VAL v3 = mw_std_list_List_1_filter_1_sp1(x1); + VAL v4 = mw_std_list_List_1_reverseZ_for_1_sp1(x2, v3); + return v4; } -static VAL mw_mirth_c99_c99Z_unpackZ_closureZ_varsZBang (VAL x1, VAL x2) { - VAL v3 = MKI64(0LL /* Nil */); - VAL v4 = mw_std_list_List_1_reverse(v3); +static VAL mw_mirth_c99_c99Z_blockZ_pushZBang (uint64_t x1, VAL x2) { + VAL v3 = VVAL(VTUP(x2)->cells[1]); + VAL v4 = VVAL(VTUP(v3)->cells[7]); VAL v5; VAL v6; - mw_std_list_List_1_uncons(x1, &v5, &v6); + mw_mirth_arrow_Block_toZ_runZ_var(v4, x1, &v5, &v6); + VTUP(v3)->cells[7] = v5; + VTUP(x2)->cells[1] = v3; VAL x7; - VAL x8; - VAL x9; - int64_t x10; - switch (get_data_tag(v5)) { + switch (get_data_tag(v6)) { case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v5); - incref(v11); - int64_t v12 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v11)); - VAL x13; - VAL x14; - if (((bool)v12)) { - VAL v15 = mtw_std_maybe_Maybe_1_Some(v11); - x14 = v15; - x13 = x2; - } else { - decref(v11); - VAL v16 = MKI64(0LL /* None */); - x14 = v16; - x13 = x2; - } - VAL x17; - switch (get_data_tag(x14)) { - case 1LL: { // Some - VAL v18 = mtp_std_maybe_Maybe_1_Some(x14); - VAL v19 = mtw_std_list_List_1_Cons(v18, v4); - x17 = v19; - push_resource(x13); - } break; - case 0LL: { // None - x17 = v4; - push_resource(x13); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v20 = 1LL /* True */; - x10 = v20; - x9 = v6; - x8 = x17; - VAL r21 = pop_resource(); - x7 = r21; + VAL v8 = mtp_std_maybe_Maybe_1_Some(v6); + VAL v9 = mw_mirth_c99_c99Z_varZ_pushZBang(VU64(v8), x2); + x7 = v9; } break; case 0LL: { // None - int64_t v22 = 0LL /* False */; - x10 = v22; - x9 = v6; - x8 = v4; - x7 = x2; + int64_t v10 = 14LL /* C99RT_FNPTR */; + VAL v11 = VVAL(VTUP(x2)->cells[1]); + VAL v12; + VAL v13; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v11, &v12, &v13); + VTUP(x2)->cells[1] = v13; + int64_t v14 = VI64(VTUP(x2)->cells[3]); + VAL v15 = VVAL(VTUP(x2)->cells[1]); + int64_t v16 = VI64(VTUP(v15)->cells[4]); + VTUP(v15)->cells[4] = MKI64(v14); + VAL v17 = mw_mirth_c99_ZPlusC99_indent(v15); + VAL v18 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v10); + VAL v19 = mw_mirth_c99_ZPlusC99_put(v18, v17); + STR* v20; + STRLIT(v20, " ", 1); + VAL v21 = mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19); + incref(v12); + VAL v22 = mw_mirth_c99_ZPlusC99_put(v12, v21); + STR* v23; + STRLIT(v23, " = ", 3); + VAL v24 = mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22); + VAL v25 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v10, v12); + STR* v26; + STRLIT(v26, "&", 1); + VAL v27 = mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v24); + VAL v28 = VVAL(VTUP(v27)->cells[7]); + VAL v29; + VAL v30; + mw_mirth_arrow_Block_cname(v28, x1, &v29, &v30); + VTUP(v27)->cells[7] = v29; + VAL v31 = mw_mirth_c99_ZPlusC99_put(v30, v27); + STR* v32; + STRLIT(v32, ";", 1); + VAL v33 = mw_mirth_c99_ZPlusC99_put(MKSTR(v32), v31); + VAL v34 = mw_mirth_c99_ZPlusC99_line(v33); + VTUP(v34)->cells[4] = MKI64(v16); + VTUP(x2)->cells[1] = v34; + VAL v35 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x2, v25); + VAL v36 = VVAL(VTUP(v35)->cells[1]); + VAL v37 = VVAL(VTUP(v36)->cells[7]); + VAL v38; + VAL v39; + mw_mirth_arrow_Block_freeZ_vars(v37, x1, &v38, &v39); + VTUP(v36)->cells[7] = v38; + VTUP(v35)->cells[1] = v36; + VAL v40 = mw_mirth_c99_c99Z_packZ_closureZ_varsZBang(v39, v35); + x7 = v40; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v23 = (x7); - VAL v24 = (x8); - VAL v25 = x9; - int64_t v26 = x10; - while (((bool)v26)) { - VAL v27 = (v23); - VAL v28 = (v24); - VAL v29 = v25; - VAL v30; - VAL v31; - mw_std_list_List_1_uncons(v29, &v30, &v31); - VAL x32; - VAL x33; - VAL x34; - int64_t x35; - switch (get_data_tag(v30)) { - case 1LL: { // Some - VAL v36 = mtp_std_maybe_Maybe_1_Some(v30); - incref(v36); - int64_t v37 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v36)); - VAL x38; - VAL x39; - if (((bool)v37)) { - VAL v40 = mtw_std_maybe_Maybe_1_Some(v36); - x39 = v40; - x38 = v27; - } else { - decref(v36); - VAL v41 = MKI64(0LL /* None */); - x39 = v41; - x38 = v27; - } - VAL x42; - switch (get_data_tag(x39)) { - case 1LL: { // Some - VAL v43 = mtp_std_maybe_Maybe_1_Some(x39); - VAL v44 = mtw_std_list_List_1_Cons(v43, v28); - x42 = v44; - push_resource(x38); - } break; - case 0LL: { // None - x42 = v28; - push_resource(x38); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v45 = 1LL /* True */; - x35 = v45; - x34 = v31; - x33 = x42; - VAL r46 = pop_resource(); - x32 = r46; - } break; - case 0LL: { // None - int64_t v47 = 0LL /* False */; - x35 = v47; - x34 = v31; - x33 = v28; - x32 = v27; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v26 = x35; - v25 = x34; - v24 = x33; - v23 = x32; - } - decref(v25); - VAL v48 = mw_std_list_List_1_reverse(v24); - incref(v48); - int64_t v49 = mw_std_list_List_1_emptyZAsk(v48); - VAL x50; - if (((bool)v49)) { - decref(v48); - x50 = v23; + return x7; +} +static VAL mw_mirth_c99_c99Z_varZBang (uint64_t x1, VAL x2) { + VAL v3 = mw_mirth_var_Var_autoZ_runZAsk(x1); + int64_t v4 = get_data_tag(v3); + decref(v3); + int64_t v5 = 1LL; + bool v6 = (v4 == v5); + VAL x7; + if (v6) { + VAL v8 = mw_mirth_c99_c99Z_varZ_runZBang(x1, x2); + x7 = v8; } else { - int64_t v51 = 0LL /* C99RT_VAL */; - VAL v52; - VAL v53; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v23, v51, &v52, &v53); - int64_t v54 = 1LL; - VAL v55; - VAL v56; - mw_std_list_List_1_uncons(v48, &v55, &v56); - VAL x57; - VAL x58; - int64_t x59; - VAL x60; - int64_t x61; - switch (get_data_tag(v55)) { - case 1LL: { // Some - VAL v62 = mtp_std_maybe_Maybe_1_Some(v55); - VAL v63 = (VVAL(VTUP(v52)->cells[1])); - VAL v64 = (mw_mirth_c99_ZPlusC99_indent(v63)); - STR* v65; - STRLIT(v65, "VAL ", 4); - VAL v66 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v65), v64)); - incref(v62); - VAL v67 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v62), v66)); - STR* v68; - STRLIT(v68, " = VTUP(", 8); - VAL v69 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v68), v67)); - VAL v70; - VAL v71; - mw_mirth_c99_ZPlusC99Local_rdup(v53, &v70, &v71); - VAL v72 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v70); - VAL v73 = (mw_mirth_c99_ZPlusC99_put(v72, v69)); - STR* v74; - STRLIT(v74, ")->cells[", 9); - VAL v75 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v73)); - STR* v76 = i64_show(v54); - VAL v77 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v76), v75)); - STR* v78; - STRLIT(v78, "]; incref(", 10); - VAL v79 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v78), v77)); - VAL v80 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v62), v79)); - STR* v81; - STRLIT(v81, ");", 2); - VAL v82 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v81), v80)); - VAL v83 = (mw_mirth_c99_ZPlusC99_line(v82)); - VTUP(v52)->cells[1] = v83; - int64_t v84 = 1LL; - int64_t v85 = i64_add(v54, v84); - int64_t v86 = 1LL /* True */; - x61 = v86; - x60 = v56; - x59 = v85; - x58 = v71; - x57 = v52; + VAL v9 = mw_mirth_c99_c99Z_varZ_pushZBang(x1, x2); + x7 = v9; + } + return x7; +} +static VAL mw_mirth_c99_c99Z_varZ_runZBang (uint64_t x1, VAL x2) { + VAL v3 = mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(x2); + VAL v4 = VVAL(VTUP(v3)->cells[1]); + VAL v5 = mw_mirth_c99_ZPlusC99_indent(v4); + STR* v6; + STRLIT(v6, "incref(", 7); + VAL v7 = mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5); + VAL v8 = mw_mirth_c99_ZPlusC99_varZ_put(x1, v7); + STR* v9; + STRLIT(v9, ");", 2); + VAL v10 = mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8); + VAL v11 = mw_mirth_c99_ZPlusC99_line(v10); + VTUP(v3)->cells[1] = v11; + VAL v12 = VVAL(VTUP(v3)->cells[1]); + VAL v13 = mw_mirth_c99_ZPlusC99_indent(v12); + STR* v14; + STRLIT(v14, "run_value(", 10); + VAL v15 = mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13); + VAL v16 = mw_mirth_c99_ZPlusC99_varZ_put(x1, v15); + STR* v17; + STRLIT(v17, ");", 2); + VAL v18 = mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16); + VAL v19 = mw_mirth_c99_ZPlusC99_line(v18); + VTUP(v3)->cells[1] = v19; + return v3; +} +static VAL mw_mirth_c99_c99Z_varZ_pushZBang (uint64_t x1, VAL x2) { + VAL v3 = VVAL(VTUP(x2)->cells[1]); + VAL v4 = mw_mirth_c99_ZPlusC99_indent(v3); + STR* v5; + STRLIT(v5, "incref(", 7); + VAL v6 = mw_mirth_c99_ZPlusC99_put(MKSTR(v5), v4); + VAL v7 = mw_mirth_c99_ZPlusC99_varZ_put(x1, v6); + STR* v8; + STRLIT(v8, ");", 2); + VAL v9 = mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7); + VAL v10 = mw_mirth_c99_ZPlusC99_line(v9); + VTUP(x2)->cells[1] = v10; + int64_t v11 = 0LL /* C99RT_VAL */; + VAL v12 = VVAL(VTUP(x2)->cells[1]); + VAL v13; + VAL v14; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v12, &v13, &v14); + VTUP(x2)->cells[1] = v14; + int64_t v15 = VI64(VTUP(x2)->cells[3]); + VAL v16 = VVAL(VTUP(x2)->cells[1]); + int64_t v17 = VI64(VTUP(v16)->cells[4]); + VTUP(v16)->cells[4] = MKI64(v15); + VAL v18 = mw_mirth_c99_ZPlusC99_indent(v16); + VAL v19 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v11); + VAL v20 = mw_mirth_c99_ZPlusC99_put(v19, v18); + STR* v21; + STRLIT(v21, " ", 1); + VAL v22 = mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20); + incref(v13); + VAL v23 = mw_mirth_c99_ZPlusC99_put(v13, v22); + STR* v24; + STRLIT(v24, " = ", 3); + VAL v25 = mw_mirth_c99_ZPlusC99_put(MKSTR(v24), v23); + VAL v26 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v11, v13); + VAL v27 = mw_mirth_c99_ZPlusC99_varZ_put(x1, v25); + STR* v28; + STRLIT(v28, ";", 1); + VAL v29 = mw_mirth_c99_ZPlusC99_put(MKSTR(v28), v27); + VAL v30 = mw_mirth_c99_ZPlusC99_line(v29); + VTUP(v30)->cells[4] = MKI64(v17); + VTUP(x2)->cells[1] = v30; + VAL v31 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(x2, v26); + return v31; +} +static VAL mw_mirth_c99_c99Z_lambdaZBang (VAL x1, VAL x2) { + VAL v3; + int64_t v4; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(x2, &v3, &v4); + VAL v5 = mw_mirth_c99_ZPlusC99_indent(v3); + STR* v6; + STRLIT(v6, "{", 1); + VAL v7 = mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5); + VAL v8 = mw_mirth_c99_ZPlusC99_line(v7); + int64_t v9 = VI64(VTUP(v8)->cells[2]); + int64_t v10 = 1LL; + int64_t v11 = i64_add(v9, v10); + VTUP(v8)->cells[2] = MKI64(v11); + VAL v12 = mw_mirth_c99_ZPlusC99_startZ_branchZBang(v8, v4); + incref(x1); + VAL v13 = VVAL(VTUP(x1)->cells[4]); + incref(v13); + decref(x1); + VAL v14 = mw_std_list_List_1_reverse(v13); + int64_t v15 = 1LL /* True */; + VAL v16 = v12; + VAL v17 = v14; + int64_t v18 = v15; + int64_t v19 = v15; + while (((bool)v19)) { + VAL v20 = v16; + VAL v21 = v17; + int64_t v22 = v18; + VAL x23; + VAL x24; + int64_t x25; + switch (get_data_tag(v21)) { + case 1LL: { // Cons + VAL v26; + VAL v27; + mtp_std_list_List_1_Cons(v21, &v26, &v27); + VAL v28 = mw_mirth_c99_c99Z_popZ_toZ_varZBang(VU64(v26), v20); + int64_t v29 = 1LL /* True */; + x25 = v29; + x24 = v27; + x23 = v28; } break; - case 0LL: { // None - int64_t v87 = 0LL /* False */; - x61 = v87; - x60 = v56; - x59 = v54; - x58 = v53; - x57 = v52; + case 0LL: { // Nil + VAL v30 = MKI64(0LL /* Nil */); + int64_t v31 = 0LL /* False */; + x25 = v31; + x24 = v30; + x23 = v20; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v88 = (x57); - VAL v89 = x58; - int64_t v90 = x59; - VAL v91 = x60; - int64_t v92 = x61; - while (((bool)v92)) { - VAL v93 = (v88); - VAL v94 = v89; - int64_t v95 = v90; - VAL v96 = v91; - VAL v97; - VAL v98; - mw_std_list_List_1_uncons(v96, &v97, &v98); - VAL x99; - VAL x100; - int64_t x101; - VAL x102; - int64_t x103; - switch (get_data_tag(v97)) { - case 1LL: { // Some - VAL v104 = mtp_std_maybe_Maybe_1_Some(v97); - VAL v105 = (VVAL(VTUP(v93)->cells[1])); - VAL v106 = (mw_mirth_c99_ZPlusC99_indent(v105)); - STR* v107; - STRLIT(v107, "VAL ", 4); - VAL v108 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v107), v106)); - incref(v104); - VAL v109 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v104), v108)); - STR* v110; - STRLIT(v110, " = VTUP(", 8); - VAL v111 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v110), v109)); - VAL v112; - VAL v113; - mw_mirth_c99_ZPlusC99Local_rdup(v94, &v112, &v113); - VAL v114 = mw_mirth_c99_ZPlusC99Local_consumeZ_asZ_VAL(v112); - VAL v115 = (mw_mirth_c99_ZPlusC99_put(v114, v111)); - STR* v116; - STRLIT(v116, ")->cells[", 9); - VAL v117 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v116), v115)); - STR* v118 = i64_show(v95); - VAL v119 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v118), v117)); - STR* v120; - STRLIT(v120, "]; incref(", 10); - VAL v121 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v120), v119)); - VAL v122 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v104), v121)); - STR* v123; - STRLIT(v123, ");", 2); - VAL v124 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v123), v122)); - VAL v125 = (mw_mirth_c99_ZPlusC99_line(v124)); - VTUP(v93)->cells[1] = v125; - int64_t v126 = 1LL; - int64_t v127 = i64_add(v95, v126); - int64_t v128 = 1LL /* True */; - x103 = v128; - x102 = v98; - x101 = v127; - x100 = v113; - x99 = v93; - } break; - case 0LL: { // None - int64_t v129 = 0LL /* False */; - x103 = v129; - x102 = v98; - x101 = v95; - x100 = v94; - x99 = v93; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v92 = x103; - v91 = x102; - v90 = x101; - v89 = x100; - v88 = x99; - } - decref(v91); - VAL v130 = (mw_mirth_c99_ZPlusC99Local_dropZ_localZBang(v88, v89)); - x50 = v130; + v19 = x25; + v18 = x25; + v17 = x24; + v16 = x23; } - return x50; -} -static VAL mw_mirth_c99_c99Z_decrefZ_closureZ_varsZBang (VAL x1, VAL x2) { - VAL v3 = MKI64(0LL /* Nil */); - VAL v4 = mw_std_list_List_1_reverse(v3); - VAL v5; - VAL v6; - mw_std_list_List_1_uncons(x1, &v5, &v6); - VAL x7; - VAL x8; - VAL x9; - int64_t x10; - switch (get_data_tag(v5)) { - case 1LL: { // Some - VAL v11 = mtp_std_maybe_Maybe_1_Some(v5); - incref(v11); - int64_t v12 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v11)); - VAL x13; - VAL x14; - if (((bool)v12)) { - VAL v15 = mtw_std_maybe_Maybe_1_Some(v11); - x14 = v15; - x13 = x2; - } else { - decref(v11); - VAL v16 = MKI64(0LL /* None */); - x14 = v16; - x13 = x2; - } - VAL x17; - VAL x18; - switch (get_data_tag(x14)) { - case 1LL: { // Some - VAL v19 = mtp_std_maybe_Maybe_1_Some(x14); - VAL v20 = mtw_std_list_List_1_Cons(v19, v4); - x18 = v20; - x17 = x13; - } break; - case 0LL: { // None - x18 = v4; - x17 = x13; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v21 = 1LL /* True */; - x10 = v21; - x9 = v6; - x8 = x18; - x7 = x17; - } break; - case 0LL: { // None - int64_t v22 = 0LL /* False */; - x10 = v22; - x9 = v6; - x8 = v4; - x7 = x2; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v23 = (x7); - VAL v24 = (x8); - VAL v25 = x9; - int64_t v26 = x10; - while (((bool)v26)) { - VAL v27 = (v23); - VAL v28 = (v24); - VAL v29 = v25; - VAL v30; - VAL v31; - mw_std_list_List_1_uncons(v29, &v30, &v31); - VAL x32; - VAL x33; - VAL x34; - int64_t x35; - switch (get_data_tag(v30)) { - case 1LL: { // Some - VAL v36 = mtp_std_maybe_Maybe_1_Some(v30); - incref(v36); - int64_t v37 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v36)); - VAL x38; - VAL x39; - if (((bool)v37)) { - VAL v40 = mtw_std_maybe_Maybe_1_Some(v36); - x39 = v40; - x38 = v27; - } else { - decref(v36); - VAL v41 = MKI64(0LL /* None */); - x39 = v41; - x38 = v27; - } - VAL x42; - VAL x43; - switch (get_data_tag(x39)) { - case 1LL: { // Some - VAL v44 = mtp_std_maybe_Maybe_1_Some(x39); - VAL v45 = mtw_std_list_List_1_Cons(v44, v28); - x43 = v45; - x42 = x38; - } break; - case 0LL: { // None - x43 = v28; - x42 = x38; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v46 = 1LL /* True */; - x35 = v46; - x34 = v31; - x33 = x43; - x32 = x42; - } break; - case 0LL: { // None - int64_t v47 = 0LL /* False */; - x35 = v47; - x34 = v31; - x33 = v28; - x32 = v27; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v26 = x35; - v25 = x34; - v24 = x33; - v23 = x32; - } - decref(v25); - VAL v48 = mw_std_list_List_1_reverse(v24); - VAL v49 = mw_std_list_List_1_reverse(v48); - VAL v50; - VAL v51; - mw_std_list_List_1_uncons(v49, &v50, &v51); - VAL x52; - VAL x53; - int64_t x54; - switch (get_data_tag(v50)) { - case 1LL: { // Some - VAL v55 = mtp_std_maybe_Maybe_1_Some(v50); - VAL v56 = (VVAL(VTUP(v23)->cells[1])); - VAL v57 = (mw_mirth_c99_ZPlusC99_indent(v56)); - STR* v58; - STRLIT(v58, "decref(", 7); - VAL v59 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v58), v57)); - VAL v60 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v55), v59)); - STR* v61; - STRLIT(v61, ");", 2); - VAL v62 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v61), v60)); - VAL v63 = (mw_mirth_c99_ZPlusC99_line(v62)); - VTUP(v23)->cells[1] = v63; - int64_t v64 = 1LL /* True */; - x54 = v64; - x53 = v51; - x52 = v23; - } break; - case 0LL: { // None - int64_t v65 = 0LL /* False */; - x54 = v65; - x53 = v51; - x52 = v23; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v66 = (x52); - VAL v67 = x53; - int64_t v68 = x54; - while (((bool)v68)) { - VAL v69 = (v66); - VAL v70 = v67; - VAL v71; - VAL v72; - mw_std_list_List_1_uncons(v70, &v71, &v72); - VAL x73; - VAL x74; - int64_t x75; - switch (get_data_tag(v71)) { - case 1LL: { // Some - VAL v76 = mtp_std_maybe_Maybe_1_Some(v71); - VAL v77 = (VVAL(VTUP(v69)->cells[1])); - VAL v78 = (mw_mirth_c99_ZPlusC99_indent(v77)); - STR* v79; - STRLIT(v79, "decref(", 7); - VAL v80 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v79), v78)); - VAL v81 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v76), v80)); - STR* v82; - STRLIT(v82, ");", 2); - VAL v83 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v82), v81)); - VAL v84 = (mw_mirth_c99_ZPlusC99_line(v83)); - VTUP(v69)->cells[1] = v84; - int64_t v85 = 1LL /* True */; - x75 = v85; - x74 = v72; - x73 = v69; - } break; - case 0LL: { // None - int64_t v86 = 0LL /* False */; - x75 = v86; - x74 = v72; - x73 = v69; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v68 = x75; - v67 = x74; - v66 = x73; - } - decref(v67); - return v66; -} -static VAL mw_mirth_c99_c99Z_blockZ_pushZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); - VAL v4 = (VVAL(VTUP(v3)->cells[6])); - VAL v5; - VAL v6; - mw_mirth_arrow_Block_toZ_runZ_var(v4, x1, &v5, &v6); - VTUP(v3)->cells[6] = v5; - VTUP(x2)->cells[1] = v3; - VAL x7; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v8 = mtp_std_maybe_Maybe_1_Some(v6); - VAL v9 = (mw_mirth_c99_c99Z_varZ_pushZBang(VU64(v8), x2)); - x7 = v9; - } break; - case 0LL: { // None - int64_t v10 = 14LL /* C99RT_FNPTR */; - VAL v11 = (VVAL(VTUP(x2)->cells[1])); - VAL v12; - VAL v13; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v11, &v12, &v13); - VAL v14 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v10, v12)); - VAL v15 = (mw_mirth_c99_ZPlusC99_indent(v13)); - int64_t v16 = VI64(VTUP(v14)->cells[1]); - VAL v17 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v16); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(v17, v15)); - STR* v19; - STRLIT(v19, " ", 1); - VAL v20 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18)); - VAL v21 = VVAL(VTUP(v14)->cells[2]); - incref(v21); - VAL v22 = (mw_mirth_c99_ZPlusC99_put(v21, v20)); - STR* v23; - STRLIT(v23, " = ", 3); - VAL v24 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22)); - STR* v25; - STRLIT(v25, "&", 1); - VAL v26 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v24)); - VAL v27 = (VVAL(VTUP(v26)->cells[6])); - VAL v28; - VAL v29; - mw_mirth_arrow_Block_cname(v27, x1, &v28, &v29); - VTUP(v26)->cells[6] = v28; - VAL v30 = (mw_mirth_c99_ZPlusC99_put(v29, v26)); - STR* v31; - STRLIT(v31, ";", 1); - VAL v32 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30)); - VAL v33 = (mw_mirth_c99_ZPlusC99_line(v32)); - VTUP(x2)->cells[1] = v33; - VAL v34 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x2, v14)); - VAL v35 = (VVAL(VTUP(v34)->cells[1])); - VAL v36 = (VVAL(VTUP(v35)->cells[6])); - VAL v37; - VAL v38; - mw_mirth_arrow_Block_freeZ_vars(v36, x1, &v37, &v38); - VTUP(v35)->cells[6] = v37; - VTUP(v34)->cells[1] = v35; - VAL v39 = (mw_mirth_c99_c99Z_packZ_closureZ_varsZBang(v38, v34)); - x7 = v39; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x7; -} -static VAL mw_mirth_c99_c99Z_varZBang (uint64_t x1, VAL x2) { - VAL v3 = mw_mirth_var_Var_autoZ_runZAsk(x1); - VAL x4; - switch (get_data_tag(v3)) { - case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v3); - decref(v5); - VAL v6 = (mw_mirth_c99_c99Z_varZ_runZBang(x1, x2)); - x4 = v6; - } break; - case 0LL: { // None - VAL v7 = (mw_mirth_c99_c99Z_varZ_pushZBang(x1, x2)); - x4 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - return x4; -} -static VAL mw_mirth_c99_c99Z_varZ_runZBang (uint64_t x1, VAL x2) { - VAL v3 = (mw_mirth_c99_ZPlusC99Branch_flushZ_cacheZBang(x2)); - VAL v4 = (VVAL(VTUP(v3)->cells[1])); - VAL v5 = (mw_mirth_c99_ZPlusC99_indent(v4)); - STR* v6; - STRLIT(v6, "incref(", 7); - VAL v7 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5)); - VAL v8 = (mw_mirth_c99_ZPlusC99_varZ_put(x1, v7)); - STR* v9; - STRLIT(v9, ");", 2); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8)); - VAL v11 = (mw_mirth_c99_ZPlusC99_line(v10)); - VTUP(v3)->cells[1] = v11; - VAL v12 = (VVAL(VTUP(v3)->cells[1])); - VAL v13 = (mw_mirth_c99_ZPlusC99_indent(v12)); - STR* v14; - STRLIT(v14, "run_value(", 10); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v14), v13)); - VAL v16 = (mw_mirth_c99_ZPlusC99_varZ_put(x1, v15)); - STR* v17; - STRLIT(v17, ");", 2); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16)); - VAL v19 = (mw_mirth_c99_ZPlusC99_line(v18)); - VTUP(v3)->cells[1] = v19; - return v3; -} -static VAL mw_mirth_c99_c99Z_varZ_pushZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); - VAL v4 = (mw_mirth_c99_ZPlusC99_indent(v3)); - STR* v5; - STRLIT(v5, "incref(", 7); - VAL v6 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v5), v4)); - VAL v7 = (mw_mirth_c99_ZPlusC99_varZ_put(x1, v6)); - STR* v8; - STRLIT(v8, ");", 2); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7)); - VAL v10 = (mw_mirth_c99_ZPlusC99_line(v9)); - VTUP(x2)->cells[1] = v10; - int64_t v11 = 0LL /* C99RT_VAL */; - VAL v12 = (VVAL(VTUP(x2)->cells[1])); - VAL v13; - VAL v14; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v12, &v13, &v14); - VAL v15 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v11, v13)); - VAL v16 = (mw_mirth_c99_ZPlusC99_indent(v14)); - int64_t v17 = VI64(VTUP(v15)->cells[1]); - VAL v18 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v17); - VAL v19 = (mw_mirth_c99_ZPlusC99_put(v18, v16)); - STR* v20; - STRLIT(v20, " ", 1); - VAL v21 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19)); - VAL v22 = VVAL(VTUP(v15)->cells[2]); - incref(v22); - VAL v23 = (mw_mirth_c99_ZPlusC99_put(v22, v21)); - STR* v24; - STRLIT(v24, " = ", 3); - VAL v25 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v24), v23)); - VAL v26 = (mw_mirth_c99_ZPlusC99_varZ_put(x1, v25)); - STR* v27; - STRLIT(v27, ";", 1); - VAL v28 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v27), v26)); - VAL v29 = (mw_mirth_c99_ZPlusC99_line(v28)); - VTUP(x2)->cells[1] = v29; - VAL v30 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(x2, v15)); - return v30; -} -static VAL mw_mirth_c99_c99Z_lambdaZBang (VAL x1, VAL x2) { - VAL v3 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(x2)); - VAL v4 = (mw_mirth_c99_ZPlusC99_indent(v3)); - STR* v5; - STRLIT(v5, "{", 1); - VAL v6 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v5), v4)); - VAL v7 = (mw_mirth_c99_ZPlusC99_line(v6)); - int64_t v8 = VI64(VTUP(v7)->cells[2]); - int64_t v9 = 1LL; - int64_t v10 = i64_add(v8, v9); - VTUP(v7)->cells[2] = MKI64(v10); - VAL v11 = (mw_mirth_c99_ZPlusC99_startZ_branchZBang(v7)); + decref(v17); incref(x1); - VAL v12 = VVAL(VTUP(x1)->cells[4]); - incref(v12); + VAL v32 = VVAL(VTUP(x1)->cells[5]); + incref(v32); decref(x1); - VAL v13 = mw_std_list_List_1_reverse(v12); - VAL v14; - VAL v15; - mw_std_list_List_1_uncons(v13, &v14, &v15); - VAL x16; - VAL x17; - VAL x18; - int64_t x19; - switch (get_data_tag(v14)) { - case 1LL: { // Some - VAL v20 = mtp_std_maybe_Maybe_1_Some(v14); - VAL v21 = (mw_mirth_c99_c99Z_popZ_toZ_varZBang(VU64(v20), v11)); - int64_t v22 = 1LL /* True */; - x19 = v22; - x18 = v15; - x17 = x1; - x16 = v21; - } break; - case 0LL: { // None - int64_t v23 = 0LL /* False */; - x19 = v23; - x18 = v15; - x17 = x1; - x16 = v11; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v24 = (x16); - VAL v25 = x17; - VAL v26 = x18; - int64_t v27 = x19; - while (((bool)v27)) { - VAL v28 = (v24); - VAL v29 = v25; - VAL v30 = v26; - VAL v31; - VAL v32; - mw_std_list_List_1_uncons(v30, &v31, &v32); - VAL x33; - VAL x34; - VAL x35; - int64_t x36; - switch (get_data_tag(v31)) { - case 1LL: { // Some - VAL v37 = mtp_std_maybe_Maybe_1_Some(v31); - VAL v38 = (mw_mirth_c99_c99Z_popZ_toZ_varZBang(VU64(v37), v28)); - int64_t v39 = 1LL /* True */; - x36 = v39; - x35 = v32; - x34 = v29; - x33 = v38; - } break; - case 0LL: { // None - int64_t v40 = 0LL /* False */; - x36 = v40; - x35 = v32; - x34 = v29; - x33 = v28; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v27 = x36; - v26 = x35; - v25 = x34; - v24 = x33; - } - decref(v26); - incref(v25); - VAL v41 = VVAL(VTUP(v25)->cells[5]); - incref(v41); - decref(v25); - VAL v42 = (mw_mirth_c99_c99Z_arrowZBang(v41, v24)); - VAL v43 = VVAL(VTUP(v25)->cells[4]); - incref(v43); - decref(v25); - VAL v44 = mw_std_list_List_1_reverse(v43); - VAL v45; - VAL v46; - mw_std_list_List_1_uncons(v44, &v45, &v46); - VAL x47; - VAL x48; - int64_t x49; - switch (get_data_tag(v45)) { - case 1LL: { // Some - VAL v50 = mtp_std_maybe_Maybe_1_Some(v45); - VAL v51 = (VVAL(VTUP(v42)->cells[1])); - VAL v52 = (mw_mirth_c99_ZPlusC99_indent(v51)); - STR* v53; - STRLIT(v53, "decref(", 7); - VAL v54 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v53), v52)); - VAL v55 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v50), v54)); - STR* v56; - STRLIT(v56, ");", 2); - VAL v57 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v56), v55)); - VAL v58 = (mw_mirth_c99_ZPlusC99_line(v57)); - VTUP(v42)->cells[1] = v58; - int64_t v59 = 1LL /* True */; - x49 = v59; - x48 = v46; - x47 = v42; - } break; - case 0LL: { // None - int64_t v60 = 0LL /* False */; - x49 = v60; - x48 = v46; - x47 = v42; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v61 = (x47); - VAL v62 = x48; - int64_t v63 = x49; - while (((bool)v63)) { - VAL v64 = (v61); - VAL v65 = v62; - VAL v66; - VAL v67; - mw_std_list_List_1_uncons(v65, &v66, &v67); - VAL x68; - VAL x69; - int64_t x70; - switch (get_data_tag(v66)) { - case 1LL: { // Some - VAL v71 = mtp_std_maybe_Maybe_1_Some(v66); - VAL v72 = (VVAL(VTUP(v64)->cells[1])); - VAL v73 = (mw_mirth_c99_ZPlusC99_indent(v72)); - STR* v74; - STRLIT(v74, "decref(", 7); - VAL v75 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v73)); - VAL v76 = (mw_mirth_c99_ZPlusC99_varZ_put(VU64(v71), v75)); - STR* v77; - STRLIT(v77, ");", 2); - VAL v78 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v77), v76)); - VAL v79 = (mw_mirth_c99_ZPlusC99_line(v78)); - VTUP(v64)->cells[1] = v79; - int64_t v80 = 1LL /* True */; - x70 = v80; - x69 = v67; - x68 = v64; - } break; - case 0LL: { // None - int64_t v81 = 0LL /* False */; - x70 = v81; - x69 = v67; - x68 = v64; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v63 = x70; - v62 = x69; - v61 = x68; - } - decref(v62); - VAL v82 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v61)); - int64_t v83 = VI64(VTUP(v82)->cells[2]); - int64_t v84 = 1LL; - int64_t v85 = i64_sub(v83, v84); - int64_t v86 = 0LL; - bool v87 = (v85 < v86); - int64_t x88; - if (v87) { - int64_t v89 = 0LL; - x88 = v89; + VAL v33 = mw_mirth_c99_c99Z_arrowZBang(v32, v16); + VAL v34 = VVAL(VTUP(x1)->cells[4]); + incref(v34); + decref(x1); + VAL v35 = mw_std_list_List_1_reverseZ_for_1_sp1(v33, v34); + VAL v36; + int64_t v37; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v35, &v36, &v37); + int64_t v38 = VI64(VTUP(v36)->cells[2]); + int64_t v39 = 1LL; + int64_t v40 = i64_sub(v38, v39); + int64_t v41 = 0LL; + bool v42 = (v40 < v41); + int64_t x43; + if (v42) { + int64_t v44 = 0LL; + x43 = v44; } else { - x88 = v85; + x43 = v40; } - VTUP(v82)->cells[2] = MKI64(x88); - VAL v90 = (mw_mirth_c99_ZPlusC99_indent(v82)); - STR* v91; - STRLIT(v91, "}", 1); - VAL v92 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v91), v90)); - VAL v93 = (mw_mirth_c99_ZPlusC99_line(v92)); - VAL v94 = (mw_mirth_c99_ZPlusC99_startZ_branchZBang(v93)); - return v94; + VTUP(v36)->cells[2] = MKI64(x43); + VAL v45 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2(v36); + VAL v46 = mw_mirth_c99_ZPlusC99_startZ_branchZBang(v45, v37); + return v46; } static VAL mw_mirth_c99_c99Z_matchZBang (VAL x1, VAL x2) { incref(x1); @@ -83261,7 +61371,7 @@ static VAL mw_mirth_c99_c99Z_matchZBang (VAL x1, VAL x2) { case 1LL: { // Some VAL v6 = mtp_std_maybe_Maybe_1_Some(v4); decref(x1); - VAL v7 = (mw_mirth_c99_c99Z_singleZ_caseZBang(v6, x2)); + VAL v7 = mw_mirth_c99_c99Z_singleZ_caseZBang(v6, x2); x5 = v7; } break; case 0LL: { // None @@ -83269,11 +61379,11 @@ static VAL mw_mirth_c99_c99Z_matchZBang (VAL x1, VAL x2) { VAL v8 = mw_mirth_match_Match_scrutineeZ_dataZAsk(x1); VAL x9; VAL x10; - uint64_t x11; + VAL x11; switch (get_data_tag(v8)) { case 1LL: { // Some VAL v12 = mtp_std_maybe_Maybe_1_Some(v8); - x11 = VU64(v12); + x11 = v12; x10 = x1; x9 = x2; } break; @@ -83282,219 +61392,157 @@ static VAL mw_mirth_c99_c99Z_matchZBang (VAL x1, VAL x2) { decref(x1); STR* v14; STRLIT(v14, "non-uniform match, not supported at present", 43); - VAL v15 = (VVAL(VTUP(x2)->cells[1])); - VAL v16 = (VVAL(VTUP(v15)->cells[6])); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v13, MKSTR(v14), v16); - VAL r17 = pop_resource(); - VTUP(v15)->cells[6] = r17; - VTUP(x2)->cells[1] = v15; - uint64_t v18 = pop_u64(); - x11 = v18; - VAL v19 = pop_value(); - x10 = v19; - x9 = x2; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13(v13, MKSTR(v14), x2); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v20; - VAL v21; - mw_mirth_c99_ZPlusC99Branch_popZ_localZ_valueZDivresourceZ_dataZBang(x11, x9, &v20, &v21); + VAL v18; + VAL v19; + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_valueZDivresourceZ_dataZBang(VU64(x11), x9, &v18, &v19); incref(x10); - VAL v22 = VVAL(VTUP(x10)->cells[6]); - incref(v22); + VAL v20 = VVAL(VTUP(x10)->cells[6]); + incref(v20); decref(x10); - VAL v23 = (mw_mirth_c99_ZPlusC99Branch_beginZ_branchZ_splitZBang(v22, v20)); - VAL v24 = (VVAL(VTUP(v23)->cells[1])); - VAL v25 = (mw_mirth_c99_ZPlusC99_indent(v24)); + VAL v21 = mw_mirth_c99_ZPlusC99Branch_beginZ_branchZ_splitZBang(v20, v18); + int64_t v22 = VI64(VTUP(v21)->cells[4]); + VAL v23 = VVAL(VTUP(v21)->cells[1]); + int64_t v24 = VI64(VTUP(v23)->cells[4]); + VTUP(v23)->cells[4] = MKI64(v22); + VAL v25 = mw_mirth_c99_ZPlusC99_indent(v23); STR* v26; STRLIT(v26, "switch (", 8); - VAL v27 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v25)); + VAL v27 = mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v25); VAL v28; VAL v29; - mw_mirth_c99_ZPlusC99LocalValueZDivResource_peekZ_dataZ_tag(v21, &v28, &v29); - VAL v30 = (mw_mirth_c99_ZPlusC99_put(v29, v27)); + mw_mirth_c99_ZPlusC99ValueZDivResource_peekZ_dataZ_tag(v19, &v28, &v29); + VAL v30 = mw_mirth_c99_ZPlusC99_put(v29, v27); STR* v31; STRLIT(v31, ") {", 3); - VAL v32 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30)); - VAL v33 = (mw_mirth_c99_ZPlusC99_line(v32)); - VTUP(v23)->cells[1] = v33; - VAL v34 = (VVAL(VTUP(v23)->cells[1])); + VAL v32 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + VAL v33 = mw_mirth_c99_ZPlusC99_line(v32); + VTUP(v33)->cells[4] = MKI64(v24); + VTUP(v21)->cells[1] = v33; + VAL v34 = VVAL(VTUP(v21)->cells[1]); int64_t v35 = VI64(VTUP(v34)->cells[2]); int64_t v36 = 1LL; int64_t v37 = i64_add(v35, v36); VTUP(v34)->cells[2] = MKI64(v37); - VTUP(v23)->cells[1] = v34; + VTUP(v21)->cells[1] = v34; incref(x10); VAL v38 = VVAL(VTUP(x10)->cells[7]); incref(v38); decref(x10); - VAL v39; - VAL v40; - mw_std_list_List_1_uncons(v38, &v39, &v40); - VAL x41; - VAL x42; - VAL x43; - VAL x44; - int64_t x45; - switch (get_data_tag(v39)) { - case 1LL: { // Some - VAL v46 = mtp_std_maybe_Maybe_1_Some(v39); - VAL v47; - VAL v48; - mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdup(v28, &v47, &v48); - VAL v49 = (mw_mirth_c99_c99Z_caseZBang(v46, v23, v47)); - int64_t v50 = 1LL /* True */; - x45 = v50; - x44 = v40; - x43 = x10; - x42 = v49; - x41 = v48; - } break; - case 0LL: { // None - int64_t v51 = 0LL /* False */; - x45 = v51; - x44 = v40; - x43 = x10; - x42 = v23; - x41 = v28; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v52 = x41; - VAL v53 = (x42); - VAL v54 = x43; - VAL v55 = x44; - int64_t v56 = x45; - while (((bool)v56)) { - VAL v57 = v52; - VAL v58 = (v53); - VAL v59 = v54; - VAL v60 = v55; - VAL v61; - VAL v62; - mw_std_list_List_1_uncons(v60, &v61, &v62); - VAL x63; - VAL x64; - VAL x65; - VAL x66; - int64_t x67; - switch (get_data_tag(v61)) { - case 1LL: { // Some - VAL v68 = mtp_std_maybe_Maybe_1_Some(v61); - VAL v69; - VAL v70; - mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdup(v57, &v69, &v70); - VAL v71 = (mw_mirth_c99_c99Z_caseZBang(v68, v58, v69)); - int64_t v72 = 1LL /* True */; - x67 = v72; - x66 = v62; - x65 = v59; - x64 = v71; - x63 = v70; + int64_t v39 = 1LL /* True */; + VAL v40 = v21; + VAL v41 = v28; + VAL v42 = v38; + int64_t v43 = v39; + int64_t v44 = v39; + while (((bool)v44)) { + VAL v45 = v40; + VAL v46 = v41; + VAL v47 = v42; + int64_t v48 = v43; + VAL x49; + VAL x50; + VAL x51; + int64_t x52; + switch (get_data_tag(v47)) { + case 1LL: { // Cons + VAL v53; + VAL v54; + mtp_std_list_List_1_Cons(v47, &v53, &v54); + VAL v55; + VAL v56; + mw_mirth_c99_ZPlusC99ValueZDivResource_rdup(v46, &v55, &v56); + VAL v57 = mw_mirth_c99_c99Z_caseZBang(v53, v45, v55); + int64_t v58 = 1LL /* True */; + x52 = v58; + x51 = v54; + x50 = v57; + x49 = v56; } break; - case 0LL: { // None - int64_t v73 = 0LL /* False */; - x67 = v73; - x66 = v62; - x65 = v59; - x64 = v58; - x63 = v57; + case 0LL: { // Nil + VAL v59 = MKI64(0LL /* Nil */); + int64_t v60 = 0LL /* False */; + x52 = v60; + x51 = v59; + x50 = v45; + x49 = v46; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v56 = x67; - v55 = x66; - v54 = x65; - v53 = x64; - v52 = x63; - } - decref(v55); - int64_t v74 = mw_mirth_match_Match_hasZ_defaultZ_caseZAsk(v54); - VAL x75; - VAL x76; - if (((bool)v74)) { - x76 = v53; - x75 = v52; + v44 = x52; + v43 = x52; + v42 = x51; + v41 = x49; + v40 = x50; + } + decref(v42); + int64_t v61 = mw_mirth_match_Match_hasZ_defaultZ_caseZAsk(x10); + VAL x62; + if (((bool)v61)) { + x62 = v40; } else { - VAL v77 = (VVAL(VTUP(v53)->cells[1])); - VAL v78 = (mw_mirth_c99_ZPlusC99_indent(v77)); - STR* v79; - STRLIT(v79, "default: {", 10); - VAL v80 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v79), v78)); - VAL v81 = (mw_mirth_c99_ZPlusC99_line(v80)); - VTUP(v53)->cells[1] = v81; - VAL v82 = (VVAL(VTUP(v53)->cells[1])); - int64_t v83 = VI64(VTUP(v82)->cells[2]); - int64_t v84 = 1LL; - int64_t v85 = i64_add(v83, v84); - VTUP(v82)->cells[2] = MKI64(v85); - VTUP(v53)->cells[1] = v82; - VAL v86 = (VVAL(VTUP(v53)->cells[1])); - VAL v87 = (mw_mirth_c99_ZPlusC99_indent(v86)); - STR* v88; - STRLIT(v88, "do_panic(str_make(\"unexpected fallthrough in match\\n\", 32));", 60); - VAL v89 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v88), v87)); - VAL v90 = (mw_mirth_c99_ZPlusC99_line(v89)); - VTUP(v53)->cells[1] = v90; - VAL v91 = (VVAL(VTUP(v53)->cells[1])); - int64_t v92 = VI64(VTUP(v91)->cells[2]); - int64_t v93 = 1LL; - int64_t v94 = i64_sub(v92, v93); - int64_t v95 = 0LL; - bool v96 = (v94 < v95); - int64_t x97; - if (v96) { - int64_t v98 = 0LL; - x97 = v98; - lpush(&lbl_ZPlusscrutinee, v52); + VAL v63 = mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp3(v40); + VAL v64 = VVAL(VTUP(v63)->cells[1]); + int64_t v65 = VI64(VTUP(v64)->cells[2]); + int64_t v66 = 1LL; + int64_t v67 = i64_add(v65, v66); + VTUP(v64)->cells[2] = MKI64(v67); + VTUP(v63)->cells[1] = v64; + int64_t v68 = VI64(VTUP(v63)->cells[4]); + VAL v69 = VVAL(VTUP(v63)->cells[1]); + int64_t v70 = VI64(VTUP(v69)->cells[4]); + VTUP(v69)->cells[4] = MKI64(v68); + VAL v71 = mw_mirth_c99_ZPlusC99_indent(v69); + STR* v72; + STRLIT(v72, "do_panic(str_make(\"unexpected fallthrough in match\\n\", 32));", 60); + VAL v73 = mw_mirth_c99_ZPlusC99_put(MKSTR(v72), v71); + VAL v74 = mw_mirth_c99_ZPlusC99_line(v73); + VTUP(v74)->cells[4] = MKI64(v70); + VTUP(v63)->cells[1] = v74; + VAL v75 = VVAL(VTUP(v63)->cells[1]); + int64_t v76 = VI64(VTUP(v75)->cells[2]); + int64_t v77 = 1LL; + int64_t v78 = i64_sub(v76, v77); + int64_t v79 = 0LL; + bool v80 = (v78 < v79); + int64_t x81; + if (v80) { + int64_t v82 = 0LL; + x81 = v82; } else { - x97 = v94; - lpush(&lbl_ZPlusscrutinee, v52); + x81 = v78; } - VTUP(v91)->cells[2] = MKI64(x97); - VTUP(v53)->cells[1] = v91; - VAL v99 = (VVAL(VTUP(v53)->cells[1])); - VAL v100 = (mw_mirth_c99_ZPlusC99_indent(v99)); - STR* v101; - STRLIT(v101, "}", 1); - VAL v102 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v101), v100)); - VAL v103 = (mw_mirth_c99_ZPlusC99_line(v102)); - VTUP(v53)->cells[1] = v103; - x76 = v53; - VAL v104 = (lpop(&lbl_ZPlusscrutinee)); - x75 = v104; - } - mw_mirth_c99_ZPlusC99LocalValueZDivResource_rdrop(x75); - VAL v105 = (VVAL(VTUP(x76)->cells[1])); - int64_t v106 = VI64(VTUP(v105)->cells[2]); - int64_t v107 = 1LL; - int64_t v108 = i64_sub(v106, v107); - int64_t v109 = 0LL; - bool v110 = (v108 < v109); - int64_t x111; - if (v110) { - int64_t v112 = 0LL; - x111 = v112; + VTUP(v75)->cells[2] = MKI64(x81); + VTUP(v63)->cells[1] = v75; + VAL v83 = mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp2(v63); + x62 = v83; + } + mw_mirth_c99_ZPlusC99ValueZDivResource_rdrop(v41); + VAL v84 = VVAL(VTUP(x62)->cells[1]); + int64_t v85 = VI64(VTUP(v84)->cells[2]); + int64_t v86 = 1LL; + int64_t v87 = i64_sub(v85, v86); + int64_t v88 = 0LL; + bool v89 = (v87 < v88); + int64_t x90; + if (v89) { + int64_t v91 = 0LL; + x90 = v91; } else { - x111 = v108; + x90 = v87; } - VTUP(v105)->cells[2] = MKI64(x111); - VTUP(x76)->cells[1] = v105; - VAL v113 = (VVAL(VTUP(x76)->cells[1])); - VAL v114 = (mw_mirth_c99_ZPlusC99_indent(v113)); - STR* v115; - STRLIT(v115, "}", 1); - VAL v116 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v115), v114)); - VAL v117 = (mw_mirth_c99_ZPlusC99_line(v116)); - VTUP(x76)->cells[1] = v117; - VAL v118 = (mw_mirth_c99_ZPlusC99BranchSplit_endZ_branchZ_splitZBang(x76)); - x5 = v118; + VTUP(v84)->cells[2] = MKI64(x90); + VTUP(x62)->cells[1] = v84; + VAL v92 = mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp2(x62); + VAL v93 = mw_mirth_c99_ZPlusC99BranchSplit_endZ_branchZ_splitZBang(v92); + x5 = v93; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -83513,7 +61561,7 @@ static VAL mw_mirth_c99_c99Z_singleZ_caseZBang (VAL x1, VAL x2) { VAL v6 = VVAL(VTUP(x1)->cells[2]); incref(v6); decref(x1); - VAL v7 = (mw_mirth_c99_c99Z_arrowZBang(v6, x2)); + VAL v7 = mw_mirth_c99_c99Z_arrowZBang(v6, x2); x5 = v7; } else { incref(x1); @@ -83525,11 +61573,11 @@ static VAL mw_mirth_c99_c99Z_singleZ_caseZBang (VAL x1, VAL x2) { switch (get_data_tag(v9)) { case 1LL: { // Some VAL v11 = mtp_std_maybe_Maybe_1_Some(v9); - VAL v12 = (mw_mirth_c99_c99Z_reverseZ_tagZBang(VU64(v11), x2)); + VAL v12 = mw_mirth_c99_c99Z_reverseZ_tagZBang(VU64(v11), x2); VAL v13 = VVAL(VTUP(x1)->cells[2]); incref(v13); decref(x1); - VAL v14 = (mw_mirth_c99_c99Z_arrowZBang(v13, v12)); + VAL v14 = mw_mirth_c99_c99Z_arrowZBang(v13, v12); x10 = v14; } break; case 0LL: { // None @@ -83540,13 +61588,7 @@ static VAL mw_mirth_c99_c99Z_singleZ_caseZBang (VAL x1, VAL x2) { decref(v15); STR* v17; STRLIT(v17, "c99 target -- don't know how to compile this pattern", 52); - VAL v18 = (VVAL(VTUP(x2)->cells[1])); - VAL v19 = (VVAL(VTUP(v18)->cells[6])); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v16, MKSTR(v17), v19); - VAL r20 = pop_resource(); - VTUP(v18)->cells[6] = r20; - VTUP(x2)->cells[1] = v18; - x10 = x2; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13(v16, MKSTR(v17), x2); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -83564,284 +61606,149 @@ static VAL mw_mirth_c99_c99Z_caseZBang (VAL x1, VAL x2, VAL x3) { int64_t v5 = mw_mirth_match_Pattern_isZ_defaultZAsk(v4); VAL x6; if (((bool)v5)) { - VAL v7 = (VVAL(VTUP(x2)->cells[1])); - VAL v8 = (mw_mirth_c99_ZPlusC99_indent(v7)); - STR* v9; - STRLIT(v9, "default: {", 10); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8)); - VAL v11 = (mw_mirth_c99_ZPlusC99_line(v10)); - VTUP(x2)->cells[1] = v11; - VAL v12 = (VVAL(VTUP(x2)->cells[1])); - int64_t v13 = VI64(VTUP(v12)->cells[2]); - int64_t v14 = 1LL; - int64_t v15 = i64_add(v13, v14); - VTUP(v12)->cells[2] = MKI64(v15); - VTUP(x2)->cells[1] = v12; - VAL v16 = (VVAL(VTUP(x2)->cells[2])); - VAL v17; - VAL v18; - mw_mirth_c99_ZPlusC99StackCache_rdup(v16, &v17, &v18); - VTUP(x2)->cells[2] = v17; - VAL v19 = VVAL(VTUP(x2)->cells[3]); - incref(v19); - VAL v20 = (VVAL(VTUP(x2)->cells[1])); - VAL v21 = (mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v20, v18)); - push_value(x1); - VAL v22 = (mw_mirth_c99_ZPlusC99LocalValueZDivResource_pushZ_localZ_valueZDivresourceZBang(v21, x3)); - VAL v23 = pop_value(); - VAL v24 = VVAL(VTUP(v23)->cells[2]); - incref(v24); - decref(v23); - VAL v25 = (mw_mirth_c99_c99Z_arrowZBang(v24, v22)); - VAL v26 = mw_std_list_List_1_reverse(v19); - VAL v27; - VAL v28; - mw_std_list_List_1_uncons(v26, &v27, &v28); - VAL x29; - VAL x30; - int64_t x31; - switch (get_data_tag(v27)) { - case 1LL: { // Some - VAL v32 = mtp_std_maybe_Maybe_1_Some(v27); - VAL v33 = (mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang(v32, v25)); - int64_t v34 = 1LL /* True */; - x31 = v34; - x30 = v28; - x29 = v33; - } break; - case 0LL: { // None - int64_t v35 = 0LL /* False */; - x31 = v35; - x30 = v28; - x29 = v25; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v36 = (x29); - VAL v37 = x30; - int64_t v38 = x31; - while (((bool)v38)) { - VAL v39 = (v36); - VAL v40 = v37; - VAL v41; - VAL v42; - mw_std_list_List_1_uncons(v40, &v41, &v42); - VAL x43; - VAL x44; - int64_t x45; - switch (get_data_tag(v41)) { - case 1LL: { // Some - VAL v46 = mtp_std_maybe_Maybe_1_Some(v41); - VAL v47 = (mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang(v46, v39)); - int64_t v48 = 1LL /* True */; - x45 = v48; - x44 = v42; - x43 = v47; - } break; - case 0LL: { // None - int64_t v49 = 0LL /* False */; - x45 = v49; - x44 = v42; - x43 = v39; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v38 = x45; - v37 = x44; - v36 = x43; - } - decref(v37); - VAL v50 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v36)); - VTUP(x2)->cells[1] = v50; - VAL v51 = (VVAL(VTUP(x2)->cells[1])); - int64_t v52 = VI64(VTUP(v51)->cells[2]); - int64_t v53 = 1LL; - int64_t v54 = i64_sub(v52, v53); - int64_t v55 = 0LL; - bool v56 = (v54 < v55); - int64_t x57; - if (v56) { - int64_t v58 = 0LL; - x57 = v58; + VAL v7 = mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp3(x2); + VAL v8 = VVAL(VTUP(v7)->cells[1]); + int64_t v9 = VI64(VTUP(v8)->cells[2]); + int64_t v10 = 1LL; + int64_t v11 = i64_add(v9, v10); + VTUP(v8)->cells[2] = MKI64(v11); + VTUP(v7)->cells[1] = v8; + VAL v12 = VVAL(VTUP(v7)->cells[2]); + VAL v13; + VAL v14; + mw_mirth_c99_ZPlusC99Stack_rdup(v12, &v13, &v14); + VTUP(v7)->cells[2] = v13; + VAL v15 = VVAL(VTUP(v7)->cells[3]); + incref(v15); + int64_t v16 = VI64(VTUP(v7)->cells[4]); + VAL v17 = VVAL(VTUP(v7)->cells[1]); + VAL v18 = mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v17, v14, v16); + VAL v19 = mw_mirth_c99_ZPlusC99ValueZDivResource_pushZ_valueZ_valueZDivresourceZBang(v18, x3); + VAL v20 = VVAL(VTUP(x1)->cells[2]); + incref(v20); + decref(x1); + VAL v21 = mw_mirth_c99_c99Z_arrowZBang(v20, v19); + VAL v22 = mw_std_list_List_1_reverseZ_for_1_sp5(v21, v15); + VAL v23; + int64_t v24; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v22, &v23, &v24); + VTUP(v7)->cells[1] = v23; + int64_t v25 = VI64(VTUP(v7)->cells[5]); + bool v26 = (((bool)v24) || ((bool)v25)); + VTUP(v7)->cells[5] = MKBOOL(v26); + VAL v27 = VVAL(VTUP(v7)->cells[1]); + int64_t v28 = VI64(VTUP(v27)->cells[2]); + int64_t v29 = 1LL; + int64_t v30 = i64_sub(v28, v29); + int64_t v31 = 0LL; + bool v32 = (v30 < v31); + int64_t x33; + if (v32) { + int64_t v34 = 0LL; + x33 = v34; } else { - x57 = v54; - } - VTUP(v51)->cells[2] = MKI64(x57); - VTUP(x2)->cells[1] = v51; - VAL v59 = (VVAL(VTUP(x2)->cells[1])); - VAL v60 = (mw_mirth_c99_ZPlusC99_indent(v59)); - STR* v61; - STRLIT(v61, "} break;", 8); - VAL v62 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v61), v60)); - VAL v63 = (mw_mirth_c99_ZPlusC99_line(v62)); - VTUP(x2)->cells[1] = v63; - x6 = x2; + x33 = v30; + } + VTUP(v27)->cells[2] = MKI64(x33); + VTUP(v7)->cells[1] = v27; + VAL v35 = mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp6(v7); + x6 = v35; } else { incref(x1); - VAL v64 = VVAL(VTUP(x1)->cells[1]); - incref(v64); + VAL v36 = VVAL(VTUP(x1)->cells[1]); + incref(v36); decref(x1); - VAL v65 = mw_mirth_match_Pattern_singleZ_tagZAsk(v64); - VAL x66; - switch (get_data_tag(v65)) { + VAL v37 = mw_mirth_match_Pattern_singleZ_tagZAsk(v36); + VAL x38; + switch (get_data_tag(v37)) { case 1LL: { // Some - VAL v67 = mtp_std_maybe_Maybe_1_Some(v65); - VAL v68 = (VVAL(VTUP(x2)->cells[1])); - VAL v69 = (mw_mirth_c99_ZPlusC99_indent(v68)); - STR* v70; - STRLIT(v70, "case ", 5); - VAL v71 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v70), v69)); - incref(v67); - VAL v72 = mw_mirth_data_Tag_valueZ_show(VU64(v67)); - VAL v73 = (mw_mirth_c99_ZPlusC99_put(v72, v71)); - STR* v74; - STRLIT(v74, "LL: { // ", 9); - VAL v75 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v74), v73)); + VAL v39 = mtp_std_maybe_Maybe_1_Some(v37); + int64_t v40 = VI64(VTUP(x2)->cells[4]); + VAL v41 = VVAL(VTUP(x2)->cells[1]); + int64_t v42 = VI64(VTUP(v41)->cells[4]); + VTUP(v41)->cells[4] = MKI64(v40); + VAL v43 = mw_mirth_c99_ZPlusC99_indent(v41); + STR* v44; + STRLIT(v44, "case ", 5); + VAL v45 = mw_mirth_c99_ZPlusC99_put(MKSTR(v44), v43); + incref(v39); + VAL v46 = mw_mirth_data_Tag_valueZ_show(VU64(v39)); + VAL v47 = mw_mirth_c99_ZPlusC99_put(v46, v45); + STR* v48; + STRLIT(v48, "LL: { // ", 9); + VAL v49 = mw_mirth_c99_ZPlusC99_put(MKSTR(v48), v47); + incref(v39); + uint64_t v50 = mw_mirth_data_Tag_name(VU64(v39)); + VAL v51 = mw_mirth_name_Name_ZToStr(v50); + VAL v52 = mw_mirth_c99_ZPlusC99_put(v51, v49); + VAL v53 = mw_mirth_c99_ZPlusC99_line(v52); + VTUP(v53)->cells[4] = MKI64(v42); + VTUP(x2)->cells[1] = v53; + VAL v54 = VVAL(VTUP(x2)->cells[1]); + int64_t v55 = VI64(VTUP(v54)->cells[2]); + int64_t v56 = 1LL; + int64_t v57 = i64_add(v55, v56); + VTUP(v54)->cells[2] = MKI64(v57); + VTUP(x2)->cells[1] = v54; + VAL v58 = VVAL(VTUP(x2)->cells[2]); + VAL v59; + VAL v60; + mw_mirth_c99_ZPlusC99Stack_rdup(v58, &v59, &v60); + VTUP(x2)->cells[2] = v59; + VAL v61 = VVAL(VTUP(x2)->cells[3]); + incref(v61); + int64_t v62 = VI64(VTUP(x2)->cells[4]); + VAL v63 = VVAL(VTUP(x2)->cells[1]); + VAL v64 = mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v63, v60, v62); + VAL v65 = mw_mirth_c99_ZPlusC99ValueZDivResource_pushZ_valueZ_valueZDivresourceZBang(v64, x3); + VAL v66 = mw_mirth_c99_c99Z_reverseZ_tagZBang(VU64(v39), v65); + VAL v67 = VVAL(VTUP(x1)->cells[2]); incref(v67); - uint64_t v76 = mw_mirth_data_Tag_name(VU64(v67)); - VAL v77 = mw_mirth_name_Name_ZToStr(v76); - VAL v78 = (mw_mirth_c99_ZPlusC99_put(v77, v75)); - VAL v79 = (mw_mirth_c99_ZPlusC99_line(v78)); - VTUP(x2)->cells[1] = v79; - VAL v80 = (VVAL(VTUP(x2)->cells[1])); - int64_t v81 = VI64(VTUP(v80)->cells[2]); - int64_t v82 = 1LL; - int64_t v83 = i64_add(v81, v82); - VTUP(v80)->cells[2] = MKI64(v83); - VTUP(x2)->cells[1] = v80; - VAL v84 = (VVAL(VTUP(x2)->cells[2])); - VAL v85; - VAL v86; - mw_mirth_c99_ZPlusC99StackCache_rdup(v84, &v85, &v86); - VTUP(x2)->cells[2] = v85; - VAL v87 = VVAL(VTUP(x2)->cells[3]); - incref(v87); - VAL v88 = (VVAL(VTUP(x2)->cells[1])); - VAL v89 = (mtw_mirth_c99_ZPlusC99Branch_ZPlusC99Branch(v88, v86)); - push_value(x1); - push_value(v67); - VAL v90 = (mw_mirth_c99_ZPlusC99LocalValueZDivResource_pushZ_localZ_valueZDivresourceZBang(v89, x3)); - uint64_t v91 = pop_u64(); - VAL v92 = (mw_mirth_c99_c99Z_reverseZ_tagZBang(v91, v90)); - VAL v93 = pop_value(); - VAL v94 = VVAL(VTUP(v93)->cells[2]); - incref(v94); - decref(v93); - VAL v95 = (mw_mirth_c99_c99Z_arrowZBang(v94, v92)); - VAL v96 = mw_std_list_List_1_reverse(v87); - VAL v97; - VAL v98; - mw_std_list_List_1_uncons(v96, &v97, &v98); - VAL x99; - VAL x100; - int64_t x101; - switch (get_data_tag(v97)) { - case 1LL: { // Some - VAL v102 = mtp_std_maybe_Maybe_1_Some(v97); - VAL v103 = (mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang(v102, v95)); - int64_t v104 = 1LL /* True */; - x101 = v104; - x100 = v98; - x99 = v103; - } break; - case 0LL: { // None - int64_t v105 = 0LL /* False */; - x101 = v105; - x100 = v98; - x99 = v95; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v106 = (x99); - VAL v107 = x100; - int64_t v108 = x101; - while (((bool)v108)) { - VAL v109 = (v106); - VAL v110 = v107; - VAL v111; - VAL v112; - mw_std_list_List_1_uncons(v110, &v111, &v112); - VAL x113; - VAL x114; - int64_t x115; - switch (get_data_tag(v111)) { - case 1LL: { // Some - VAL v116 = mtp_std_maybe_Maybe_1_Some(v111); - VAL v117 = (mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang(v116, v109)); - int64_t v118 = 1LL /* True */; - x115 = v118; - x114 = v112; - x113 = v117; - } break; - case 0LL: { // None - int64_t v119 = 0LL /* False */; - x115 = v119; - x114 = v112; - x113 = v109; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v108 = x115; - v107 = x114; - v106 = x113; - } - decref(v107); - VAL v120 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v106)); - VTUP(x2)->cells[1] = v120; - VAL v121 = (VVAL(VTUP(x2)->cells[1])); - int64_t v122 = VI64(VTUP(v121)->cells[2]); - int64_t v123 = 1LL; - int64_t v124 = i64_sub(v122, v123); - int64_t v125 = 0LL; - bool v126 = (v124 < v125); - int64_t x127; - if (v126) { - int64_t v128 = 0LL; - x127 = v128; + decref(x1); + VAL v68 = mw_mirth_c99_c99Z_arrowZBang(v67, v66); + VAL v69 = mw_std_list_List_1_reverseZ_for_1_sp5(v68, v61); + VAL v70; + int64_t v71; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v69, &v70, &v71); + VTUP(x2)->cells[1] = v70; + int64_t v72 = VI64(VTUP(x2)->cells[5]); + bool v73 = (((bool)v71) || ((bool)v72)); + VTUP(x2)->cells[5] = MKBOOL(v73); + VAL v74 = VVAL(VTUP(x2)->cells[1]); + int64_t v75 = VI64(VTUP(v74)->cells[2]); + int64_t v76 = 1LL; + int64_t v77 = i64_sub(v75, v76); + int64_t v78 = 0LL; + bool v79 = (v77 < v78); + int64_t x80; + if (v79) { + int64_t v81 = 0LL; + x80 = v81; } else { - x127 = v124; + x80 = v77; } - VTUP(v121)->cells[2] = MKI64(x127); - VTUP(x2)->cells[1] = v121; - VAL v129 = (VVAL(VTUP(x2)->cells[1])); - VAL v130 = (mw_mirth_c99_ZPlusC99_indent(v129)); - STR* v131; - STRLIT(v131, "} break;", 8); - VAL v132 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v131), v130)); - VAL v133 = (mw_mirth_c99_ZPlusC99_line(v132)); - VTUP(x2)->cells[1] = v133; - x66 = x2; + VTUP(v74)->cells[2] = MKI64(x80); + VTUP(x2)->cells[1] = v74; + VAL v82 = mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp6(x2); + x38 = v82; } break; case 0LL: { // None - VAL v134 = VVAL(VTUP(x1)->cells[1]); - incref(v134); + VAL v83 = VVAL(VTUP(x1)->cells[1]); + incref(v83); decref(x1); - uint64_t v135 = VU64(VTUP(v134)->cells[2]); - decref(v134); - STR* v136; - STRLIT(v136, "c99 target -- don't know how to compile this pattern", 52); - VAL v137 = (VVAL(VTUP(x2)->cells[1])); - VAL v138 = (VVAL(VTUP(v137)->cells[6])); - lpush(&lbl_ZPlusscrutinee, x3); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v135, MKSTR(v136), v138); - VAL r139 = pop_resource(); - VTUP(v137)->cells[6] = r139; - VTUP(x2)->cells[1] = v137; - x66 = x2; + uint64_t v84 = VU64(VTUP(v83)->cells[2]); + decref(v83); + STR* v85; + STRLIT(v85, "c99 target -- don't know how to compile this pattern", 52); + VAL v86 = VVAL(VTUP(x2)->cells[1]); + VAL v87 = VVAL(VTUP(v86)->cells[7]); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(v84, MKSTR(v85), v87); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x6 = x66; + x6 = x38; } return x6; } @@ -83891,12 +61798,12 @@ static void mw_mirth_data_Tag_wordZ_c99Z_api (uint64_t x1, VAL x2, VAL *x3, VAL x8 = x1; x7 = x2; } else { - VAL v11 = (VVAL(VTUP(x2)->cells[6])); + VAL v11 = VVAL(VTUP(x2)->cells[7]); VAL v12; VAL v13; VAL v14; mw_mirth_data_Tag_wordZ_cnameZ_type(x1, v11, &v12, &v13, &v14); - VTUP(x2)->cells[6] = v14; + VTUP(x2)->cells[7] = v14; VAL v15; VAL v16; mw_mirth_c99_ZPlusC99_cnameZ_typeZ_toZ_c99Z_api(v12, v13, x2, &v15, &v16); @@ -83921,12 +61828,12 @@ static void mw_mirth_data_Tag_patZ_c99Z_api (uint64_t x1, VAL x2, VAL *x3, VAL * x8 = x1; x7 = x2; } else { - VAL v11 = (VVAL(VTUP(x2)->cells[6])); + VAL v11 = VVAL(VTUP(x2)->cells[7]); VAL v12; VAL v13; VAL v14; mw_mirth_data_Tag_patZ_cnameZ_type(x1, v11, &v12, &v13, &v14); - VTUP(x2)->cells[6] = v14; + VTUP(x2)->cells[7] = v14; VAL v15; VAL v16; mw_mirth_c99_ZPlusC99_cnameZ_typeZ_toZ_c99Z_api(v12, v13, x2, &v15, &v16); @@ -83951,12 +61858,12 @@ static void mw_mirth_word_Word_c99Z_api (uint64_t x1, VAL x2, VAL *x3, VAL *x4) x8 = x1; x7 = x2; } else { - VAL v11 = (VVAL(VTUP(x2)->cells[6])); + VAL v11 = VVAL(VTUP(x2)->cells[7]); VAL v12; VAL v13; VAL v14; mw_mirth_word_Word_cnameZ_type(x1, v11, &v12, &v13, &v14); - VTUP(x2)->cells[6] = v14; + VTUP(x2)->cells[7] = v14; VAL v15; VAL v16; mw_mirth_c99_ZPlusC99_cnameZ_typeZ_toZ_c99Z_api(v12, v13, x2, &v15, &v16); @@ -83974,20 +61881,20 @@ static VAL mw_mirth_c99_c99Z_wordZ_sigsZBang (VAL x1) { void* v3 = mbuf_mirth_word_Word_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (VVAL(VTUP(v9)->cells[4])); + VAL v11 = VVAL(VTUP(v9)->cells[5]); int64_t v12; VAL v13; mw_mirth_word_Word_neededZAsk(((uint64_t)v10), v11, &v12, &v13); - VTUP(v9)->cells[4] = v13; + VTUP(v9)->cells[5] = v13; VAL x14; if (((bool)v12)) { - VAL v15 = (mw_mirth_c99_c99Z_wordZ_sigZBang(((uint64_t)v10), v9)); + VAL v15 = mw_mirth_c99_c99Z_wordZ_sigZBang(((uint64_t)v10), v9); x14 = v15; } else { x14 = v9; @@ -84007,7 +61914,7 @@ static VAL mw_mirth_c99_c99Z_wordZ_sigZBang (uint64_t x1, VAL x2) { VAL v3; VAL v4; mw_mirth_word_Word_c99Z_api(x1, x2, &v3, &v4); - VAL v5 = (mw_mirth_c99_c99Z_smartZ_sigZBang(v3, v4)); + VAL v5 = mw_mirth_c99_c99Z_smartZ_sigZBang(v3, v4); return v5; } static VAL mw_mirth_c99_c99Z_blockZ_sigsZBang (VAL x1) { @@ -84015,20 +61922,20 @@ static VAL mw_mirth_c99_c99Z_blockZ_sigsZBang (VAL x1) { void* v3 = mbuf_mirth_arrow_Block_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (VVAL(VTUP(v9)->cells[4])); + VAL v11 = VVAL(VTUP(v9)->cells[5]); int64_t v12; VAL v13; mw_mirth_arrow_Block_neededZAsk(((uint64_t)v10), v11, &v12, &v13); - VTUP(v9)->cells[4] = v13; + VTUP(v9)->cells[5] = v13; VAL x14; if (((bool)v12)) { - VAL v15 = (mw_mirth_c99_c99Z_blockZ_sigZBang(((uint64_t)v10), v9)); + VAL v15 = mw_mirth_c99_c99Z_blockZ_sigZBang(((uint64_t)v10), v9); x14 = v15; } else { x14 = v9; @@ -84045,17 +61952,17 @@ static VAL mw_mirth_c99_c99Z_blockZ_sigsZBang (VAL x1) { return v6; } static VAL mw_mirth_c99_c99Z_blockZ_sigZBang (uint64_t x1, VAL x2) { - VAL v3 = (mw_mirth_c99_ZPlusC99_indent(x2)); - VAL v4 = (VVAL(VTUP(v3)->cells[6])); + VAL v3 = mw_mirth_c99_ZPlusC99_indent(x2); + VAL v4 = VVAL(VTUP(v3)->cells[7]); VAL v5; VAL v6; mw_mirth_arrow_Block_cname(v4, x1, &v5, &v6); - VTUP(v3)->cells[6] = v5; - VAL v7 = (mw_mirth_c99_ZPlusC99_sigZ_put(v6, v3)); + VTUP(v3)->cells[7] = v5; + VAL v7 = mw_mirth_c99_ZPlusC99_sigZ_put(v6, v3); STR* v8; STRLIT(v8, ";", 1); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7)); - VAL v10 = (mw_mirth_c99_ZPlusC99_line(v9)); + VAL v9 = mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7); + VAL v10 = mw_mirth_c99_ZPlusC99_line(v9); return v10; } static VAL mw_mirth_c99_c99Z_blockZ_enterZBang (uint64_t x1, VAL x2) { @@ -84065,10 +61972,10 @@ static VAL mw_mirth_c99_c99Z_blockZ_enterZBang (uint64_t x1, VAL x2) { decref(v3); VAL x5; if (((bool)v4)) { - VAL v6 = (mw_mirth_c99_ZPlusC99_indent(x2)); + VAL v6 = mw_mirth_c99_ZPlusC99_indent(x2); STR* v7; STRLIT(v7, "WORD_ENTER(", 11); - VAL v8 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v7), v6)); + VAL v8 = mw_mirth_c99_ZPlusC99_put(MKSTR(v7), v6); VAL v9 = mw_mirth_arrow_Block_home(x1); VAL x10; uint64_t x11; @@ -84097,79 +62004,78 @@ static VAL mw_mirth_c99_c99Z_blockZ_enterZBang (uint64_t x1, VAL x2) { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v20 = (mw_mirth_c99_ZPlusC99_putZ_cstr(x12, x10)); + VAL v20 = mw_mirth_c99_ZPlusC99_putZ_cstr(x12, x10); STR* v21; STRLIT(v21, ", ", 2); - VAL v22 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20)); + VAL v22 = mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20); uint64_t v23 = mw_mirth_arrow_Block_token(x11); uint64_t v24 = mw_mirth_token_Token_module(v23); VAL v25 = mw_mirth_module_Module_sourceZ_path(v24); - VAL v26 = (mw_mirth_c99_ZPlusC99_putZ_cstr(v25, v22)); + VAL v26 = mw_mirth_c99_ZPlusC99_putZ_cstr(v25, v22); STR* v27; STRLIT(v27, ", ", 2); - VAL v28 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v27), v26)); + VAL v28 = mw_mirth_c99_ZPlusC99_put(MKSTR(v27), v26); uint64_t v29 = mw_mirth_arrow_Block_token(x11); int64_t v30 = mw_mirth_token_Token_row(v29); int64_t v31 = mw_mirth_location_Row_ZToInt(v30); STR* v32 = i64_show(v31); - VAL v33 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v32), v28)); + VAL v33 = mw_mirth_c99_ZPlusC99_put(MKSTR(v32), v28); STR* v34; STRLIT(v34, ", ", 2); - VAL v35 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v34), v33)); + VAL v35 = mw_mirth_c99_ZPlusC99_put(MKSTR(v34), v33); uint64_t v36 = mw_mirth_arrow_Block_token(x11); int64_t v37 = mw_mirth_token_Token_col(v36); int64_t v38 = mw_mirth_location_Col_ZToInt(v37); STR* v39 = i64_show(v38); - VAL v40 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v39), v35)); + VAL v40 = mw_mirth_c99_ZPlusC99_put(MKSTR(v39), v35); STR* v41; STRLIT(v41, ");", 2); - VAL v42 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v41), v40)); - VAL v43 = (mw_mirth_c99_ZPlusC99_line(v42)); + VAL v42 = mw_mirth_c99_ZPlusC99_put(MKSTR(v41), v40); + VAL v43 = mw_mirth_c99_ZPlusC99_line(v42); x5 = v43; } else { x5 = x2; } - VAL v44 = (mw_mirth_c99_ZPlusC99_startZ_branchZBang(x5)); - return v44; + int64_t v44 = 1LL /* True */; + VAL v45 = mw_mirth_c99_ZPlusC99_startZ_branchZBang(x5, v44); + return v45; } static VAL mw_mirth_c99_c99Z_blockZ_exitZBang (uint64_t x1, VAL x2) { - VAL v3 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(x2)); - VAL v4 = VVAL(VTUP(v3)->cells[1]); - incref(v4); - int64_t v5 = VI64(VTUP(v4)->cells[2]); - decref(v4); - VAL x6; - if (((bool)v5)) { - VAL v7 = (mw_mirth_c99_ZPlusC99_indent(v3)); - STR* v8; - STRLIT(v8, "WORD_EXIT;", 10); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7)); - VAL v10 = (mw_mirth_c99_ZPlusC99_line(v9)); - x6 = v10; + VAL v3; + int64_t v4; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(x2, &v3, &v4); + VAL v5 = VVAL(VTUP(v3)->cells[1]); + incref(v5); + int64_t v6 = VI64(VTUP(v5)->cells[2]); + decref(v5); + VAL x7; + if (((bool)v6)) { + VAL v8 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp3(v3); + x7 = v8; } else { - x6 = v3; + x7 = v3; } - return x6; + return x7; } static VAL mw_mirth_c99_c99Z_blockZ_defsZBang (VAL x1) { int64_t v2 = 1LL; void* v3 = mbuf_mirth_arrow_Block_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (VVAL(VTUP(v9)->cells[4])); + VAL v11 = VVAL(VTUP(v9)->cells[5]); int64_t v12; VAL v13; mw_mirth_arrow_Block_neededZAsk(((uint64_t)v10), v11, &v12, &v13); - VTUP(v9)->cells[4] = v13; + VTUP(v9)->cells[5] = v13; VAL x14; if (((bool)v12)) { - VAL v15 = (mw_mirth_c99_c99Z_blockZ_defZBang(((uint64_t)v10), v9)); + VAL v15 = mw_mirth_c99_c99Z_blockZ_defZBang(((uint64_t)v10), v9); x14 = v15; } else { x14 = v9; @@ -84186,77 +62092,59 @@ static VAL mw_mirth_c99_c99Z_blockZ_defsZBang (VAL x1) { return v6; } static VAL mw_mirth_c99_c99Z_blockZ_defZBang (uint64_t x1, VAL x2) { - VAL v3 = (mw_mirth_c99_ZPlusC99_indent(x2)); - VAL v4 = (VVAL(VTUP(v3)->cells[6])); + VAL v3 = mw_mirth_c99_ZPlusC99_indent(x2); + VAL v4 = VVAL(VTUP(v3)->cells[7]); VAL v5; VAL v6; mw_mirth_arrow_Block_cname(v4, x1, &v5, &v6); - VTUP(v3)->cells[6] = v5; - VAL v7 = (mw_mirth_c99_ZPlusC99_sigZ_put(v6, v3)); + VTUP(v3)->cells[7] = v5; + VAL v7 = mw_mirth_c99_ZPlusC99_sigZ_put(v6, v3); STR* v8; STRLIT(v8, " {", 2); - VAL v9 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7)); - VAL v10 = (mw_mirth_c99_ZPlusC99_line(v9)); - VAL v11 = (mw_mirth_c99_ZPlusC99_resetZ_freshZ_counterZBang(v10)); + VAL v9 = mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7); + VAL v10 = mw_mirth_c99_ZPlusC99_line(v9); + VAL v11 = mw_mirth_c99_ZPlusC99_resetZ_freshZ_counterZBang(v10); int64_t v12 = VI64(VTUP(v11)->cells[2]); int64_t v13 = 1LL; int64_t v14 = i64_add(v12, v13); VTUP(v11)->cells[2] = MKI64(v14); - VAL v15 = (mw_mirth_c99_c99Z_blockZ_enterZBang(x1, v11)); - VAL v16 = (VVAL(VTUP(v15)->cells[1])); - VAL v17 = (VVAL(VTUP(v16)->cells[6])); + VAL v15 = mw_mirth_c99_c99Z_blockZ_enterZBang(x1, v11); + VAL v16; + VAL v17; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp1(x1, v15, &v16, &v17); + incref(v16); VAL v18; VAL v19; - mw_mirth_arrow_Block_arrow(v17, x1, &v18, &v19); - VTUP(v16)->cells[6] = v18; - VTUP(v15)->cells[1] = v16; - incref(v19); - VAL v20 = (VVAL(VTUP(v15)->cells[1])); - VAL v21 = (VVAL(VTUP(v20)->cells[6])); + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp2(v16, v17, &v18, &v19); + VAL v20 = mw_mirth_c99_c99Z_unpackZ_closureZ_varsZBang(v18, v19); + incref(v16); + VAL v21; VAL v22; - VAL v23; - mw_mirth_arrow_Arrow_freeZ_vars(v21, v19, &v22, &v23); - VTUP(v20)->cells[6] = v22; - VTUP(v15)->cells[1] = v20; - VAL v24 = (mw_mirth_c99_c99Z_unpackZ_closureZ_varsZBang(v23, v15)); - incref(v19); - VAL v25 = (VVAL(VTUP(v24)->cells[1])); - VAL v26 = (VVAL(VTUP(v25)->cells[6])); - VAL v27 = mw_mirth_arrow_Arrow_type(v19); - VTUP(v25)->cells[6] = v26; - VTUP(v24)->cells[1] = v25; - VAL v28 = mw_mirth_type_ArrowType_dom(v27); - VAL v29 = (mw_mirth_c99_exposeZ_stackZ_typeZBang(v28, v24)); - incref(v19); - VAL v30 = (mw_mirth_c99_c99Z_arrowZBang(v19, v29)); - VAL v31 = (VVAL(VTUP(v30)->cells[1])); - VAL v32 = (VVAL(VTUP(v31)->cells[6])); - VAL v33; - VAL v34; - mw_mirth_arrow_Arrow_freeZ_vars(v32, v19, &v33, &v34); - VTUP(v31)->cells[6] = v33; - VTUP(v30)->cells[1] = v31; - VAL v35 = (mw_mirth_c99_c99Z_decrefZ_closureZ_varsZBang(v34, v30)); - VAL v36 = (mw_mirth_c99_c99Z_blockZ_exitZBang(x1, v35)); - int64_t v37 = VI64(VTUP(v36)->cells[2]); - int64_t v38 = 1LL; - int64_t v39 = i64_sub(v37, v38); - int64_t v40 = 0LL; - bool v41 = (v39 < v40); - int64_t x42; - if (v41) { - int64_t v43 = 0LL; - x42 = v43; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp3(v16, v20, &v21, &v22); + VAL v23 = mw_mirth_type_ArrowType_dom(v21); + VAL v24 = mw_mirth_c99_exposeZ_stackZ_typeZBang(v23, v22); + incref(v16); + VAL v25 = mw_mirth_c99_c99Z_arrowZBang(v16, v24); + VAL v26; + VAL v27; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp2(v16, v25, &v26, &v27); + VAL v28 = mw_mirth_c99_c99Z_decrefZ_closureZ_varsZBang(v26, v27); + VAL v29 = mw_mirth_c99_c99Z_blockZ_exitZBang(x1, v28); + int64_t v30 = VI64(VTUP(v29)->cells[2]); + int64_t v31 = 1LL; + int64_t v32 = i64_sub(v30, v31); + int64_t v33 = 0LL; + bool v34 = (v32 < v33); + int64_t x35; + if (v34) { + int64_t v36 = 0LL; + x35 = v36; } else { - x42 = v39; + x35 = v32; } - VTUP(v36)->cells[2] = MKI64(x42); - VAL v44 = (mw_mirth_c99_ZPlusC99_indent(v36)); - STR* v45; - STRLIT(v45, "}", 1); - VAL v46 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v45), v44)); - VAL v47 = (mw_mirth_c99_ZPlusC99_line(v46)); - return v47; + VTUP(v29)->cells[2] = MKI64(x35); + VAL v37 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2(v29); + return v37; } static VAL mw_mirth_c99_exposeZ_stackZ_typeZBang (VAL x1, VAL x2) { VAL x3; @@ -84277,7 +62165,7 @@ static VAL mw_mirth_c99_exposeZ_stackZ_typeZBang (VAL x1, VAL x2) { void* v10 = mfld_mirth_type_MetaVar_ZTildetypeZAsk(v4); mut_set(v9, v10); VAL v11 = mw_mirth_type_Type_ZToStackType(v8); - VAL v12 = (mw_mirth_c99_exposeZ_stackZ_typeZBang(v11, x2)); + VAL v12 = mw_mirth_c99_exposeZ_stackZ_typeZBang(v11, x2); x6 = v12; } break; default: { @@ -84295,9 +62183,9 @@ static VAL mw_mirth_c99_exposeZ_stackZ_typeZBang (VAL x1, VAL x2) { mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v14, x2, &v15, &v16); VAL v17; VAL v18; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZBang(v16, v15, &v17, &v18); - VAL v19 = (mw_mirth_c99_exposeZ_stackZ_typeZBang(v13, v17)); - VAL v20 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v19, v18)); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZBang(v16, v15, &v17, &v18); + VAL v19 = mw_mirth_c99_exposeZ_stackZ_typeZBang(v13, v17); + VAL v20 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v19, v18); x3 = v20; } break; case 7LL: { // STWith @@ -84309,9 +62197,9 @@ static VAL mw_mirth_c99_exposeZ_stackZ_typeZBang (VAL x1, VAL x2) { mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v22, x2, &v23, &v24); VAL v25; VAL v26; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZBang(v24, v23, &v25, &v26); - VAL v27 = (mw_mirth_c99_exposeZ_stackZ_typeZBang(v21, v25)); - VAL v28 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v27, v26)); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZBang(v24, v23, &v25, &v26); + VAL v27 = mw_mirth_c99_exposeZ_stackZ_typeZBang(v21, v25); + VAL v28 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v27, v26); x3 = v28; } break; case 6LL: { // STConsLabel @@ -84324,9 +62212,9 @@ static VAL mw_mirth_c99_exposeZ_stackZ_typeZBang (VAL x1, VAL x2) { mw_mirth_c99_ZPlusC99Branch_typeZ_toZ_c99Z_repr(v30, x2, &v32, &v33); VAL v34; VAL v35; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_labelZBang(v32, v31, v33, &v34, &v35); - VAL v36 = (mw_mirth_c99_exposeZ_stackZ_typeZBang(v29, v34)); - VAL v37 = (mw_mirth_c99_pushZ_localZ_labelZBang(v31, v36, v35)); + mw_mirth_c99_ZPlusC99Branch_popZ_valueZ_labelZBang(v32, v31, v33, &v34, &v35); + VAL v36 = mw_mirth_c99_exposeZ_stackZ_typeZBang(v29, v34); + VAL v37 = mw_mirth_c99_pushZ_valueZ_labelZBang(v31, v36, v35); x3 = v37; } break; case 8LL: { // STWithLabel @@ -84339,9 +62227,9 @@ static VAL mw_mirth_c99_exposeZ_stackZ_typeZBang (VAL x1, VAL x2) { mw_mirth_c99_ZPlusC99Branch_resourceZ_toZ_c99Z_repr(v39, x2, &v41, &v42); VAL v43; VAL v44; - mw_mirth_c99_ZPlusC99Branch_popZ_toZ_localZ_resourceZ_labelZBang(v41, v40, v42, &v43, &v44); - VAL v45 = (mw_mirth_c99_exposeZ_stackZ_typeZBang(v38, v43)); - VAL v46 = (mw_mirth_c99_pushZ_localZ_resourceZ_labelZBang(v40, v45, v44)); + mw_mirth_c99_ZPlusC99Branch_popZ_resourceZ_labelZBang(v41, v40, v42, &v43, &v44); + VAL v45 = mw_mirth_c99_exposeZ_stackZ_typeZBang(v38, v43); + VAL v46 = mw_mirth_c99_pushZ_resourceZ_labelZBang(v40, v45, v44); x3 = v46; } break; default: { @@ -84352,7 +62240,7 @@ static VAL mw_mirth_c99_exposeZ_stackZ_typeZBang (VAL x1, VAL x2) { return x3; } static VAL mw_mirth_c99_c99Z_wordZ_enterZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); + VAL v3 = VVAL(VTUP(x2)->cells[1]); VAL v4 = VVAL(VTUP(v3)->cells[1]); incref(v4); VTUP(x2)->cells[1] = v3; @@ -84361,42 +62249,46 @@ static VAL mw_mirth_c99_c99Z_wordZ_enterZBang (uint64_t x1, VAL x2) { uint64_t x6; VAL x7; if (((bool)v5)) { - VAL v8 = (VVAL(VTUP(x2)->cells[1])); - VAL v9 = (mw_mirth_c99_ZPlusC99_indent(v8)); - STR* v10; - STRLIT(v10, "WORD_ENTER(", 11); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v10), v9)); - uint64_t v12 = mw_mirth_word_Word_name(x1); - VAL v13 = mw_mirth_name_Name_ZToStr(v12); - VAL v14 = (mw_mirth_c99_ZPlusC99_putZ_cstr(v13, v11)); - STR* v15; - STRLIT(v15, ", ", 2); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14)); - uint64_t v17 = mw_mirth_word_Word_body(x1); - uint64_t v18 = mw_mirth_token_Token_module(v17); - VAL v19 = mw_mirth_module_Module_sourceZ_path(v18); - VAL v20 = (mw_mirth_c99_ZPlusC99_putZ_cstr(v19, v16)); - STR* v21; - STRLIT(v21, ", ", 2); - VAL v22 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20)); - uint64_t v23 = mw_mirth_word_Word_body(x1); - int64_t v24 = mw_mirth_token_Token_row(v23); - int64_t v25 = mw_mirth_location_Row_ZToInt(v24); - STR* v26 = i64_show(v25); - VAL v27 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v22)); - STR* v28; - STRLIT(v28, ", ", 2); - VAL v29 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v28), v27)); - uint64_t v30 = mw_mirth_word_Word_body(x1); - int64_t v31 = mw_mirth_token_Token_col(v30); - int64_t v32 = mw_mirth_location_Col_ZToInt(v31); - STR* v33 = i64_show(v32); - VAL v34 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v33), v29)); - STR* v35; - STRLIT(v35, ");", 2); - VAL v36 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v35), v34)); - VAL v37 = (mw_mirth_c99_ZPlusC99_line(v36)); - VTUP(x2)->cells[1] = v37; + int64_t v8 = VI64(VTUP(x2)->cells[3]); + VAL v9 = VVAL(VTUP(x2)->cells[1]); + int64_t v10 = VI64(VTUP(v9)->cells[4]); + VTUP(v9)->cells[4] = MKI64(v8); + VAL v11 = mw_mirth_c99_ZPlusC99_indent(v9); + STR* v12; + STRLIT(v12, "WORD_ENTER(", 11); + VAL v13 = mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11); + uint64_t v14 = mw_mirth_word_Word_name(x1); + VAL v15 = mw_mirth_name_Name_ZToStr(v14); + VAL v16 = mw_mirth_c99_ZPlusC99_putZ_cstr(v15, v13); + STR* v17; + STRLIT(v17, ", ", 2); + VAL v18 = mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16); + uint64_t v19 = mw_mirth_word_Word_body(x1); + uint64_t v20 = mw_mirth_token_Token_module(v19); + VAL v21 = mw_mirth_module_Module_sourceZ_path(v20); + VAL v22 = mw_mirth_c99_ZPlusC99_putZ_cstr(v21, v18); + STR* v23; + STRLIT(v23, ", ", 2); + VAL v24 = mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22); + uint64_t v25 = mw_mirth_word_Word_body(x1); + int64_t v26 = mw_mirth_token_Token_row(v25); + int64_t v27 = mw_mirth_location_Row_ZToInt(v26); + STR* v28 = i64_show(v27); + VAL v29 = mw_mirth_c99_ZPlusC99_put(MKSTR(v28), v24); + STR* v30; + STRLIT(v30, ", ", 2); + VAL v31 = mw_mirth_c99_ZPlusC99_put(MKSTR(v30), v29); + uint64_t v32 = mw_mirth_word_Word_body(x1); + int64_t v33 = mw_mirth_token_Token_col(v32); + int64_t v34 = mw_mirth_location_Col_ZToInt(v33); + STR* v35 = i64_show(v34); + VAL v36 = mw_mirth_c99_ZPlusC99_put(MKSTR(v35), v31); + STR* v37; + STRLIT(v37, ");", 2); + VAL v38 = mw_mirth_c99_ZPlusC99_put(MKSTR(v37), v36); + VAL v39 = mw_mirth_c99_ZPlusC99_line(v38); + VTUP(v39)->cells[4] = MKI64(v10); + VTUP(x2)->cells[1] = v39; x7 = x2; x6 = x1; } else { @@ -84406,7 +62298,7 @@ static VAL mw_mirth_c99_c99Z_wordZ_enterZBang (uint64_t x1, VAL x2) { return x7; } static VAL mw_mirth_c99_c99Z_wordZ_exitZBang (uint64_t x1, VAL x2) { - VAL v3 = (VVAL(VTUP(x2)->cells[1])); + VAL v3 = VVAL(VTUP(x2)->cells[1]); VAL v4 = VVAL(VTUP(v3)->cells[1]); incref(v4); VTUP(x2)->cells[1] = v3; @@ -84414,13 +62306,13 @@ static VAL mw_mirth_c99_c99Z_wordZ_exitZBang (uint64_t x1, VAL x2) { decref(v4); VAL x6; if (((bool)v5)) { - VAL v7 = (VVAL(VTUP(x2)->cells[1])); - VAL v8 = (mw_mirth_c99_ZPlusC99_indent(v7)); - STR* v9; - STRLIT(v9, "WORD_EXIT;", 10); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8)); - VAL v11 = (mw_mirth_c99_ZPlusC99_line(v10)); - VTUP(x2)->cells[1] = v11; + int64_t v7 = VI64(VTUP(x2)->cells[3]); + VAL v8 = VVAL(VTUP(x2)->cells[1]); + int64_t v9 = VI64(VTUP(v8)->cells[4]); + VTUP(v8)->cells[4] = MKI64(v7); + VAL v10 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp3(v8); + VTUP(v10)->cells[4] = MKI64(v9); + VTUP(x2)->cells[1] = v10; x6 = x2; } else { x6 = x2; @@ -84432,20 +62324,20 @@ static VAL mw_mirth_c99_c99Z_wordZ_defsZBang (VAL x1) { void* v3 = mbuf_mirth_word_Word_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (VVAL(VTUP(v9)->cells[4])); + VAL v11 = VVAL(VTUP(v9)->cells[5]); int64_t v12; VAL v13; mw_mirth_word_Word_neededZAsk(((uint64_t)v10), v11, &v12, &v13); - VTUP(v9)->cells[4] = v13; + VTUP(v9)->cells[5] = v13; VAL x14; if (((bool)v12)) { - VAL v15 = (mw_mirth_c99_c99Z_wordZ_defZBang(((uint64_t)v10), v9)); + VAL v15 = mw_mirth_c99_c99Z_wordZ_defZBang(((uint64_t)v10), v9); x14 = v15; } else { x14 = v9; @@ -84465,66 +62357,51 @@ static VAL mw_mirth_c99_c99Z_wordZ_defZBang (uint64_t x1, VAL x2) { VAL v3; VAL v4; mw_mirth_word_Word_c99Z_api(x1, x2, &v3, &v4); - VAL v5 = (mw_mirth_c99_ZPlusC99_indent(v4)); - incref(v3); - VAL v6 = (mw_mirth_c99_ZPlusC99_smartZ_sigZ_put(v3, v5)); - STR* v7; - STRLIT(v7, " {", 2); - VAL v8 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v7), v6)); - VAL v9 = (mw_mirth_c99_ZPlusC99_line(v8)); - int64_t v10 = VI64(VTUP(v9)->cells[2]); - int64_t v11 = 1LL; - int64_t v12 = i64_add(v10, v11); - VTUP(v9)->cells[2] = MKI64(v12); - incref(v3); - VAL v13 = (mw_mirth_c99_c99Z_apiZ_enterZBang(v3, v9)); - VAL v14 = (mw_mirth_c99_c99Z_wordZ_enterZBang(x1, v13)); - VAL v15 = (VVAL(VTUP(v14)->cells[1])); - VAL v16 = (VVAL(VTUP(v15)->cells[6])); - VAL v17; - VAL v18; - mw_mirth_word_Word_arrow(x1, v16, &v17, &v18); - VTUP(v15)->cells[6] = v18; - VTUP(v14)->cells[1] = v15; - VAL v19 = (mw_mirth_c99_c99Z_arrowZBang(v17, v14)); - VAL v20 = (mw_mirth_c99_c99Z_wordZ_exitZBang(x1, v19)); - VAL v21 = (mw_mirth_c99_c99Z_apiZ_exitZBang(v3, v20)); - int64_t v22 = VI64(VTUP(v21)->cells[2]); - int64_t v23 = 1LL; - int64_t v24 = i64_sub(v22, v23); - int64_t v25 = 0LL; - bool v26 = (v24 < v25); - int64_t x27; - if (v26) { - int64_t v28 = 0LL; - x27 = v28; - push_u64(x1); + VAL v5; + VAL v6; + mw_mirth_c99_ZPlusC99_c99Z_line_1_sp90(v3, v4, &v5, &v6); + int64_t v7 = VI64(VTUP(v6)->cells[2]); + int64_t v8 = 1LL; + int64_t v9 = i64_add(v7, v8); + VTUP(v6)->cells[2] = MKI64(v9); + incref(v5); + VAL v10 = mw_mirth_c99_c99Z_apiZ_enterZBang(v5, v6); + VAL v11 = mw_mirth_c99_c99Z_wordZ_enterZBang(x1, v10); + VAL v12; + VAL v13; + mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp15(x1, v11, &v12, &v13); + VAL v14 = mw_mirth_c99_c99Z_arrowZBang(v12, v13); + VAL v15 = mw_mirth_c99_c99Z_wordZ_exitZBang(x1, v14); + VAL v16 = mw_mirth_c99_c99Z_apiZ_exitZBang(v5, v15); + int64_t v17 = VI64(VTUP(v16)->cells[2]); + int64_t v18 = 1LL; + int64_t v19 = i64_sub(v17, v18); + int64_t v20 = 0LL; + bool v21 = (v19 < v20); + int64_t x22; + if (v21) { + int64_t v23 = 0LL; + x22 = v23; } else { - x27 = v24; - push_u64(x1); + x22 = v19; } - VTUP(v21)->cells[2] = MKI64(x27); - VAL v29 = (mw_mirth_c99_ZPlusC99_indent(v21)); - STR* v30; - STRLIT(v30, "}", 1); - VAL v31 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v30), v29)); - VAL v32 = (mw_mirth_c99_ZPlusC99_line(v31)); - uint64_t v33 = pop_u64(); - return v32; + VTUP(v16)->cells[2] = MKI64(x22); + VAL v24 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2(v16); + return v24; } static VAL mw_mirth_c99_fieldZ_sigZ_put (uint64_t x1, VAL x2) { STR* v3; STRLIT(v3, "static void* ", 13); - VAL v4 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2)); - VAL v5 = (VVAL(VTUP(v4)->cells[6])); + VAL v4 = mw_mirth_c99_ZPlusC99_put(MKSTR(v3), x2); + VAL v5 = VVAL(VTUP(v4)->cells[7]); VAL v6; VAL v7; mw_mirth_table_Field_cname(v5, x1, &v6, &v7); - VTUP(v4)->cells[6] = v6; - VAL v8 = (mw_mirth_c99_ZPlusC99_put(v7, v4)); + VTUP(v4)->cells[7] = v6; + VAL v8 = mw_mirth_c99_ZPlusC99_put(v7, v4); STR* v9; STRLIT(v9, " (uint64_t i)", 13); - VAL v10 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8)); + VAL v10 = mw_mirth_c99_ZPlusC99_put(MKSTR(v9), v8); return v10; } static VAL mw_mirth_c99_c99Z_fieldZ_sigsZBang (VAL x1) { @@ -84532,13 +62409,13 @@ static VAL mw_mirth_c99_c99Z_fieldZ_sigsZBang (VAL x1) { void* v3 = mbuf_mirth_table_Field_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (mw_mirth_c99_c99Z_fieldZ_sigZBang(((uint64_t)v10), v9)); + VAL v11 = mw_mirth_c99_c99Z_fieldZ_sigZBang(((uint64_t)v10), v9); int64_t v12 = 1LL; int64_t v13 = i64_add(v10, v12); void* v14 = mbuf_mirth_table_Field_NUM; @@ -84551,12 +62428,12 @@ static VAL mw_mirth_c99_c99Z_fieldZ_sigsZBang (VAL x1) { return v6; } static VAL mw_mirth_c99_c99Z_fieldZ_sigZBang (uint64_t x1, VAL x2) { - VAL v3 = (mw_mirth_c99_ZPlusC99_indent(x2)); - VAL v4 = (mw_mirth_c99_fieldZ_sigZ_put(x1, v3)); + VAL v3 = mw_mirth_c99_ZPlusC99_indent(x2); + VAL v4 = mw_mirth_c99_fieldZ_sigZ_put(x1, v3); STR* v5; STRLIT(v5, ";", 1); - VAL v6 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v5), v4)); - VAL v7 = (mw_mirth_c99_ZPlusC99_line(v6)); + VAL v6 = mw_mirth_c99_ZPlusC99_put(MKSTR(v5), v4); + VAL v7 = mw_mirth_c99_ZPlusC99_line(v6); return v7; } static VAL mw_mirth_c99_c99Z_fieldZ_defsZBang (VAL x1) { @@ -84564,13 +62441,13 @@ static VAL mw_mirth_c99_c99Z_fieldZ_defsZBang (VAL x1) { void* v3 = mbuf_mirth_table_Field_NUM; int64_t v4 = *(int64_t*)v3; bool v5 = (v2 <= v4); - VAL v6 = (x1); + VAL v6 = x1; int64_t v7 = v2; bool v8 = v5; while (v8) { - VAL v9 = (v6); + VAL v9 = v6; int64_t v10 = v7; - VAL v11 = (mw_mirth_c99_c99Z_fieldZ_defZBang(((uint64_t)v10), v9)); + VAL v11 = mw_mirth_c99_c99Z_fieldZ_defZBang(((uint64_t)v10), v9); int64_t v12 = 1LL; int64_t v13 = i64_add(v10, v12); void* v14 = mbuf_mirth_table_Field_NUM; @@ -84583,116 +62460,116 @@ static VAL mw_mirth_c99_c99Z_fieldZ_defsZBang (VAL x1) { return v6; } static VAL mw_mirth_c99_c99Z_fieldZ_defZBang (uint64_t x1, VAL x2) { - VAL v3 = (mw_mirth_c99_fieldZ_sigZ_put(x1, x2)); + VAL v3 = mw_mirth_c99_fieldZ_sigZ_put(x1, x2); STR* v4; STRLIT(v4, " {", 2); - VAL v5 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v4), v3)); - VAL v6 = (mw_mirth_c99_ZPlusC99_line(v5)); + VAL v5 = mw_mirth_c99_ZPlusC99_put(MKSTR(v4), v3); + VAL v6 = mw_mirth_c99_ZPlusC99_line(v5); STR* v7; STRLIT(v7, "\tstatic struct VAL * p = 0;", 27); - VAL v8 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v7), v6)); - VAL v9 = (mw_mirth_c99_ZPlusC99_line(v8)); + VAL v8 = mw_mirth_c99_ZPlusC99_put(MKSTR(v7), v6); + VAL v9 = mw_mirth_c99_ZPlusC99_line(v8); STR* v10; STRLIT(v10, "\tsize_t m = ", 12); - VAL v11 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v10), v9)); - push_u64(x1); - push_resource(v11); + VAL v11 = mw_mirth_c99_ZPlusC99_put(MKSTR(v10), v9); int64_t v12 = mw_mirth_elab_TABLEz_MAXz_COUNT(); STR* v13 = i64_show(v12); - VAL r14 = pop_resource(); - VAL v15 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v13), r14)); - STR* v16; - STRLIT(v16, ";", 1); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15)); - VAL v18 = (mw_mirth_c99_ZPlusC99_line(v17)); - STR* v19; - STRLIT(v19, "\tif (! p) { p = calloc(m, sizeof *p); }", 39); - VAL v20 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18)); - VAL v21 = (mw_mirth_c99_ZPlusC99_line(v20)); - STR* v22; - STRLIT(v22, "\tEXPECT(icells[1])); + VAL v7 = VVAL(VTUP(v4)->cells[1]); VAL v8; VAL v9; mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v7, &v8, &v9); - VAL v10 = (mtw_mirth_c99_ZPlusC99Local_ZPlusC99Local(v6, v8)); - VAL v11 = (mw_mirth_c99_ZPlusC99_indent(v9)); - int64_t v12 = VI64(VTUP(v10)->cells[1]); - VAL v13 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v12); - VAL v14 = (mw_mirth_c99_ZPlusC99_put(v13, v11)); - STR* v15; - STRLIT(v15, " ", 1); - VAL v16 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14)); - VAL v17 = VVAL(VTUP(v10)->cells[2]); - incref(v17); - VAL v18 = (mw_mirth_c99_ZPlusC99_put(v17, v16)); + VTUP(v4)->cells[1] = v9; + int64_t v10 = VI64(VTUP(v4)->cells[3]); + VAL v11 = VVAL(VTUP(v4)->cells[1]); + int64_t v12 = VI64(VTUP(v11)->cells[4]); + VTUP(v11)->cells[4] = MKI64(v10); + VAL v13 = mw_mirth_c99_ZPlusC99_indent(v11); + VAL v14 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v6); + VAL v15 = mw_mirth_c99_ZPlusC99_put(v14, v13); + STR* v16; + STRLIT(v16, " ", 1); + VAL v17 = mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15); + incref(v8); + VAL v18 = mw_mirth_c99_ZPlusC99_put(v8, v17); STR* v19; STRLIT(v19, " = ", 3); - VAL v20 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18)); - VAL v21 = (VVAL(VTUP(v20)->cells[6])); - VAL v22; + VAL v20 = mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18); + VAL v21 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(v6, v8); + VAL v22 = VVAL(VTUP(v20)->cells[7]); VAL v23; - mw_mirth_table_Field_cname(v21, x1, &v22, &v23); - VTUP(v20)->cells[6] = v22; - VAL v24 = (mw_mirth_c99_ZPlusC99_put(v23, v20)); - STR* v25; - STRLIT(v25, "(", 1); - VAL v26 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v24)); - int64_t v27 = 6LL /* C99RT_U64 */; - VAL v28 = mw_mirth_c99_ZPlusC99Local_consumeZ_as(v27, v5); - VAL v29 = (mw_mirth_c99_ZPlusC99_put(v28, v26)); - STR* v30; - STRLIT(v30, ")", 1); - VAL v31 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v30), v29)); - STR* v32; - STRLIT(v32, ";", 1); - VAL v33 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v32), v31)); - VAL v34 = (mw_mirth_c99_ZPlusC99_line(v33)); - VTUP(v4)->cells[1] = v34; - VAL v35 = (mw_mirth_c99_ZPlusC99Local_pushZ_localZBang(v4, v10)); - return v35; + VAL v24; + mw_mirth_table_Field_cname(v22, x1, &v23, &v24); + VTUP(v20)->cells[7] = v23; + VAL v25 = mw_mirth_c99_ZPlusC99_put(v24, v20); + STR* v26; + STRLIT(v26, "(", 1); + VAL v27 = mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v25); + int64_t v28 = 6LL /* C99RT_U64 */; + VAL v29 = mw_mirth_c99_ZPlusC99Value_consumeZ_as(v28, v5); + VAL v30 = mw_mirth_c99_ZPlusC99_put(v29, v27); + STR* v31; + STRLIT(v31, ")", 1); + VAL v32 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + STR* v33; + STRLIT(v33, ";", 1); + VAL v34 = mw_mirth_c99_ZPlusC99_put(MKSTR(v33), v32); + VAL v35 = mw_mirth_c99_ZPlusC99_line(v34); + VTUP(v35)->cells[4] = MKI64(v12); + VTUP(v4)->cells[1] = v35; + VAL v36 = mw_mirth_c99_ZPlusC99Value_pushZ_valueZBang(v4, v21); + return v36; } static VAL mw_mirth_c99_c99Z_mainZBang (VAL x1, VAL x2) { - VAL v3 = (mw_mirth_c99_ZPlusC99_indent(x2)); + VAL v3 = mw_mirth_c99_ZPlusC99_indent(x2); STR* v4; STRLIT(v4, "int main (int argc, char** argv) {", 34); - VAL v5 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v4), v3)); - VAL v6 = (mw_mirth_c99_ZPlusC99_line(v5)); - VAL v7 = (mw_mirth_c99_ZPlusC99_resetZ_freshZ_counterZBang(v6)); + VAL v5 = mw_mirth_c99_ZPlusC99_put(MKSTR(v4), v3); + VAL v6 = mw_mirth_c99_ZPlusC99_line(v5); + VAL v7 = mw_mirth_c99_ZPlusC99_resetZ_freshZ_counterZBang(v6); int64_t v8 = VI64(VTUP(v7)->cells[2]); int64_t v9 = 1LL; int64_t v10 = i64_add(v8, v9); VTUP(v7)->cells[2] = MKI64(v10); - VAL v11 = (mw_mirth_c99_ZPlusC99_indent(v7)); + VAL v11 = mw_mirth_c99_ZPlusC99_indent(v7); STR* v12; STRLIT(v12, "global_argc = argc;", 19); - VAL v13 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11)); - VAL v14 = (mw_mirth_c99_ZPlusC99_line(v13)); - VAL v15 = (mw_mirth_c99_ZPlusC99_indent(v14)); + VAL v13 = mw_mirth_c99_ZPlusC99_put(MKSTR(v12), v11); + VAL v14 = mw_mirth_c99_ZPlusC99_line(v13); + VAL v15 = mw_mirth_c99_ZPlusC99_indent(v14); STR* v16; STRLIT(v16, "global_argv = argv;", 19); - VAL v17 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15)); - VAL v18 = (mw_mirth_c99_ZPlusC99_line(v17)); + VAL v17 = mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15); + VAL v18 = mw_mirth_c99_ZPlusC99_line(v17); VAL v19 = VVAL(VTUP(v18)->cells[1]); incref(v19); int64_t v20 = VI64(VTUP(v19)->cells[2]); @@ -84700,100 +62577,103 @@ static VAL mw_mirth_c99_c99Z_mainZBang (VAL x1, VAL x2) { VAL x21; VAL x22; if (((bool)v20)) { - VAL v23 = (mw_mirth_c99_ZPlusC99_indent(v18)); + VAL v23 = mw_mirth_c99_ZPlusC99_indent(v18); STR* v24; STRLIT(v24, "WORD_ENTER(", 11); - VAL v25 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v24), v23)); + VAL v25 = mw_mirth_c99_ZPlusC99_put(MKSTR(v24), v23); STR* v26; STRLIT(v26, "\"
\", ", 10); - VAL v27 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v25)); + VAL v27 = mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v25); incref(x1); uint64_t v28 = VU64(VTUP(x1)->cells[2]); decref(x1); uint64_t v29 = mw_mirth_token_Token_module(v28); VAL v30 = mw_mirth_module_Module_sourceZ_path(v29); - VAL v31 = (mw_mirth_c99_ZPlusC99_putZ_cstr(v30, v27)); + VAL v31 = mw_mirth_c99_ZPlusC99_putZ_cstr(v30, v27); STR* v32; STRLIT(v32, ", ", 2); - VAL v33 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v32), v31)); + VAL v33 = mw_mirth_c99_ZPlusC99_put(MKSTR(v32), v31); incref(x1); uint64_t v34 = VU64(VTUP(x1)->cells[2]); decref(x1); int64_t v35 = mw_mirth_token_Token_row(v34); int64_t v36 = mw_mirth_location_Row_ZToInt(v35); STR* v37 = i64_show(v36); - VAL v38 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v37), v33)); + VAL v38 = mw_mirth_c99_ZPlusC99_put(MKSTR(v37), v33); STR* v39; STRLIT(v39, ", ", 2); - VAL v40 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v39), v38)); + VAL v40 = mw_mirth_c99_ZPlusC99_put(MKSTR(v39), v38); incref(x1); uint64_t v41 = VU64(VTUP(x1)->cells[2]); decref(x1); int64_t v42 = mw_mirth_token_Token_col(v41); int64_t v43 = mw_mirth_location_Col_ZToInt(v42); STR* v44 = i64_show(v43); - VAL v45 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v44), v40)); + VAL v45 = mw_mirth_c99_ZPlusC99_put(MKSTR(v44), v40); STR* v46; STRLIT(v46, ");", 2); - VAL v47 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v46), v45)); - VAL v48 = (mw_mirth_c99_ZPlusC99_line(v47)); + VAL v47 = mw_mirth_c99_ZPlusC99_put(MKSTR(v46), v45); + VAL v48 = mw_mirth_c99_ZPlusC99_line(v47); x22 = v48; x21 = x1; } else { x22 = v18; x21 = x1; } - VAL v49 = (mw_mirth_c99_ZPlusC99_startZ_branchZBang(x22)); - int64_t v50 = 2LL /* C99RT_I64 */; - VAL v51 = (VVAL(VTUP(v49)->cells[1])); - VAL v52; + int64_t v49 = 1LL /* True */; + VAL v50 = mw_mirth_c99_ZPlusC99_startZ_branchZBang(x22, v49); + int64_t v51 = 2LL /* C99RT_I64 */; + VAL v52 = VVAL(VTUP(v50)->cells[1]); VAL v53; - mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v51, &v52, &v53); - VAL v54 = (mtw_mirth_c99_ZPlusC99LocalResource_ZPlusC99LocalResource(v50, v52)); - VAL v55 = (mw_mirth_c99_ZPlusC99_indent(v53)); - int64_t v56 = VI64(VTUP(v54)->cells[1]); - VAL v57 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v56); - VAL v58 = (mw_mirth_c99_ZPlusC99_put(v57, v55)); - STR* v59; - STRLIT(v59, " ", 1); - VAL v60 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v59), v58)); - VAL v61 = VVAL(VTUP(v54)->cells[2]); - incref(v61); - VAL v62 = (mw_mirth_c99_ZPlusC99_put(v61, v60)); - STR* v63; - STRLIT(v63, " = (", 4); - VAL v64 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v63), v62)); - STR* v65; - STRLIT(v65, "0 /* The World! */", 18); - VAL v66 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v65), v64)); + VAL v54; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v52, &v53, &v54); + VTUP(v50)->cells[1] = v54; + int64_t v55 = VI64(VTUP(v50)->cells[3]); + VAL v56 = VVAL(VTUP(v50)->cells[1]); + int64_t v57 = VI64(VTUP(v56)->cells[4]); + VTUP(v56)->cells[4] = MKI64(v55); + VAL v58 = mw_mirth_c99_ZPlusC99_indent(v56); + VAL v59 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(v51); + VAL v60 = mw_mirth_c99_ZPlusC99_put(v59, v58); + STR* v61; + STRLIT(v61, " ", 1); + VAL v62 = mw_mirth_c99_ZPlusC99_put(MKSTR(v61), v60); + incref(v53); + VAL v63 = mw_mirth_c99_ZPlusC99_put(v53, v62); + STR* v64; + STRLIT(v64, " = ", 3); + VAL v65 = mw_mirth_c99_ZPlusC99_put(MKSTR(v64), v63); + VAL v66 = mtw_mirth_c99_ZPlusC99Resource_ZPlusC99Resource(v51, v53); STR* v67; - STRLIT(v67, ");", 2); - VAL v68 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v67), v66)); - VAL v69 = (mw_mirth_c99_ZPlusC99_line(v68)); - VTUP(v49)->cells[1] = v69; - VAL v70 = (mw_mirth_c99_ZPlusC99LocalResource_pushZ_localZ_resourceZBang(v49, v54)); - VAL v71 = (mw_mirth_c99_c99Z_arrowZBang(x21, v70)); - VAL v72 = (mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v71)); - VAL v73 = VVAL(VTUP(v72)->cells[1]); - incref(v73); - int64_t v74 = VI64(VTUP(v73)->cells[2]); - decref(v73); - VAL x75; - if (((bool)v74)) { - VAL v76 = (mw_mirth_c99_ZPlusC99_indent(v72)); - STR* v77; - STRLIT(v77, "WORD_EXIT;", 10); - VAL v78 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v77), v76)); - VAL v79 = (mw_mirth_c99_ZPlusC99_line(v78)); - x75 = v79; + STRLIT(v67, "0 /* The World! */", 18); + VAL v68 = mw_mirth_c99_ZPlusC99_put(MKSTR(v67), v65); + STR* v69; + STRLIT(v69, ";", 1); + VAL v70 = mw_mirth_c99_ZPlusC99_put(MKSTR(v69), v68); + VAL v71 = mw_mirth_c99_ZPlusC99_line(v70); + VTUP(v71)->cells[4] = MKI64(v57); + VTUP(v50)->cells[1] = v71; + VAL v72 = mw_mirth_c99_ZPlusC99Resource_pushZ_resourceZBang(v50, v66); + VAL v73 = mw_mirth_c99_c99Z_arrowZBang(x21, v72); + VAL v74; + int64_t v75; + mw_mirth_c99_ZPlusC99Branch_endZ_branchZBang(v73, &v74, &v75); + VAL v76 = VVAL(VTUP(v74)->cells[1]); + incref(v76); + int64_t v77 = VI64(VTUP(v76)->cells[2]); + decref(v76); + VAL x78; + if (((bool)v77)) { + VAL v79 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp3(v74); + x78 = v79; } else { - x75 = v72; + x78 = v74; } - VAL v80 = (mw_mirth_c99_ZPlusC99_indent(x75)); + VAL v80 = mw_mirth_c99_ZPlusC99_indent(x78); STR* v81; STRLIT(v81, "return 0;", 9); - VAL v82 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v81), v80)); - VAL v83 = (mw_mirth_c99_ZPlusC99_line(v82)); + VAL v82 = mw_mirth_c99_ZPlusC99_put(MKSTR(v81), v80); + VAL v83 = mw_mirth_c99_ZPlusC99_line(v82); int64_t v84 = VI64(VTUP(v83)->cells[2]); int64_t v85 = 1LL; int64_t v86 = i64_sub(v84, v85); @@ -84807,12 +62687,8 @@ static VAL mw_mirth_c99_c99Z_mainZBang (VAL x1, VAL x2) { x89 = v86; } VTUP(v83)->cells[2] = MKI64(x89); - VAL v91 = (mw_mirth_c99_ZPlusC99_indent(v83)); - STR* v92; - STRLIT(v92, "}", 1); - VAL v93 = (mw_mirth_c99_ZPlusC99_put(MKSTR(v92), v91)); - VAL v94 = (mw_mirth_c99_ZPlusC99_line(v93)); - return v94; + VAL v91 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2(v83); + return v91; } static VAL mw_mirth_main_Arguments_default (void) { int64_t v1 = 0LL /* False */; @@ -84845,378 +62721,257 @@ static void mw_mirth_main_compileZBang (VAL x1, int64_t x2, VAL x3, int64_t *x4, STRLIT(v14, "", 0); STR* v15; STRLIT(v15, "Compiling ", 10); - VAL v16 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v15), MKSTR(v14))); + VAL v16 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v15), MKSTR(v14)); incref(v6); - VAL v17 = (mw_std_path_Path_pathZThen(v6, v16)); - STR* v18; - STRLIT(v18, "\n", 1); - STR* v19 = str_cat(VSTR(v17), v18); - int64_t v20 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v19), x2)); - VAL v21; - VAL v22; - mw_std_list_List_1_uncons(v9, &v21, &v22); - VAL x23; - VAL x24; - int64_t x25; - VAL x26; - int64_t x27; - VAL x28; - VAL x29; - int64_t x30; - switch (get_data_tag(v21)) { - case 1LL: { // Some - VAL v31 = mtp_std_maybe_Maybe_1_Some(v21); - VAL v32; - VAL v33; - value_uncons(v31, &v32, &v33); - VAL v34; - VAL v35; - value_uncons(v32, &v34, &v35); - decref(v34); - uint64_t v36 = mw_std_prim_Str_ZToName(v35); - VAL v37; - uint64_t v38; - mw_mirth_package_Package_newZ_orZ_pathZBang(x3, v33, v36, &v37, &v38); - int64_t v39 = 1LL /* True */; - x30 = v39; - x29 = v22; - x28 = v37; - x27 = v20; - x26 = v6; - x25 = v11; - x24 = v8; - x23 = v7; - } break; - case 0LL: { // None - int64_t v40 = 0LL /* False */; - x30 = v40; - x29 = v22; - x28 = x3; - x27 = v20; - x26 = v6; - x25 = v11; - x24 = v8; - x23 = v7; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - VAL v41 = x23; - VAL v42 = x24; - int64_t v43 = x25; - VAL v44 = x26; - int64_t v45 = (x27); - VAL v46 = (x28); - VAL v47 = x29; - int64_t v48 = x30; - while (((bool)v48)) { - VAL v49 = v41; - VAL v50 = v42; - int64_t v51 = v43; - VAL v52 = v44; - int64_t v53 = (v45); - VAL v54 = (v46); - VAL v55 = v47; - VAL v56; - VAL v57; - mw_std_list_List_1_uncons(v55, &v56, &v57); - VAL x58; - VAL x59; - int64_t x60; - VAL x61; - int64_t x62; - VAL x63; - VAL x64; - int64_t x65; - switch (get_data_tag(v56)) { - case 1LL: { // Some - VAL v66 = mtp_std_maybe_Maybe_1_Some(v56); - VAL v67; - VAL v68; - value_uncons(v66, &v67, &v68); - VAL v69; - VAL v70; - value_uncons(v67, &v69, &v70); - decref(v69); - uint64_t v71 = mw_std_prim_Str_ZToName(v70); - VAL v72; - uint64_t v73; - mw_mirth_package_Package_newZ_orZ_pathZBang(v54, v68, v71, &v72, &v73); - int64_t v74 = 1LL /* True */; - x65 = v74; - x64 = v57; - x63 = v72; - x62 = v53; - x61 = v52; - x60 = v51; - x59 = v50; - x58 = v49; + VAL v17 = mw_std_path_Path_pathZThen(v6, v16); + int64_t v18 = mw_std_prim_ZPlusWorld_trace(v17, x2); + int64_t v19 = 1LL /* True */; + VAL v20 = x3; + VAL v21 = v9; + int64_t v22 = v19; + int64_t v23 = v19; + while (((bool)v23)) { + VAL v24 = v20; + VAL v25 = v21; + int64_t v26 = v22; + VAL x27; + VAL x28; + int64_t x29; + switch (get_data_tag(v25)) { + case 1LL: { // Cons + VAL v30; + VAL v31; + mtp_std_list_List_1_Cons(v25, &v30, &v31); + VAL v32; + VAL v33; + value_uncons(v30, &v32, &v33); + VAL v34; + VAL v35; + value_uncons(v32, &v34, &v35); + decref(v34); + uint64_t v36 = mw_std_prim_Str_ZToName(v35); + VAL v37; + uint64_t v38; + mw_mirth_package_Package_newZ_orZ_pathZBang(v24, v33, v36, &v37, &v38); + int64_t v39 = 1LL /* True */; + x29 = v39; + x28 = v31; + x27 = v37; } break; - case 0LL: { // None - int64_t v75 = 0LL /* False */; - x65 = v75; - x64 = v57; - x63 = v54; - x62 = v53; - x61 = v52; - x60 = v51; - x59 = v50; - x58 = v49; + case 0LL: { // Nil + VAL v40 = MKI64(0LL /* Nil */); + int64_t v41 = 0LL /* False */; + x29 = v41; + x28 = v40; + x27 = v24; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v48 = x65; - v47 = x64; - v46 = x63; - v45 = x62; - v44 = x61; - v43 = x60; - v42 = x59; - v41 = x58; + v23 = x29; + v22 = x29; + v21 = x28; + v20 = x27; } - decref(v47); - uint64_t v76; - int64_t v77; - VAL v78; - mw_mirth_lexer_runZ_lexerZBang(v44, v45, v46, &v76, &v77, &v78); - STR* v79; - STRLIT(v79, "", 0); - STR* v80; - STRLIT(v80, "Building.", 9); - VAL v81 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v80), MKSTR(v79))); - STR* v82; - STRLIT(v82, "\n", 1); - STR* v83 = str_cat(VSTR(v81), v82); - int64_t v84 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v83), v77)); - uint64_t v85; - int64_t v86; - VAL v87; - mw_mirth_elab_elabZ_moduleZBang(v76, v84, v78, &v85, &v86, &v87); - VAL v88 = (mw_mirth_elab_typecheckZ_everythingZBang(v87)); - VAL x89; - int64_t x90; - uint64_t x91; - int64_t x92; - VAL x93; - VAL x94; - switch (get_data_tag(v42)) { + decref(v21); + uint64_t v42; + int64_t v43; + VAL v44; + mw_mirth_lexer_runZ_lexerZBang(v6, v18, v20, &v42, &v43, &v44); + STR* v45; + STRLIT(v45, "", 0); + STR* v46; + STRLIT(v46, "Building.", 9); + VAL v47 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v46), MKSTR(v45)); + int64_t v48 = mw_std_prim_ZPlusWorld_trace(v47, v43); + uint64_t v49; + int64_t v50; + VAL v51; + mw_mirth_elab_elabZ_moduleZBang(v42, v48, v44, &v49, &v50, &v51); + VAL v52 = mw_mirth_elab_typecheckZ_everythingZBang(v51); + uint64_t x53; + VAL x54; + VAL x55; + switch (get_data_tag(v8)) { case 1LL: { // Some - VAL v95 = mtp_std_maybe_Maybe_1_Some(v42); - VAL v96 = mtw_mirth_name_Namespace_NAMESPACEz_MODULE(v85); - uint64_t v97 = mw_std_prim_Str_ZToName(v95); - VAL v98 = mw_mirth_name_QNAME0(v96, v97); - VAL v99; - VAL v100; - mw_mirth_elab_elabZ_entryZ_point(v98, v88, &v99, &v100); - VAL v101 = mtw_std_maybe_Maybe_1_Some(v99); - x94 = v101; - x93 = v100; - x92 = v86; - x91 = v85; - x90 = v43; - x89 = v41; + VAL v56 = mtp_std_maybe_Maybe_1_Some(v8); + VAL v57 = mtw_mirth_name_Namespace_NAMESPACEz_MODULE(v49); + uint64_t v58 = mw_std_prim_Str_ZToName(v56); + VAL v59 = mw_mirth_name_QNAME0(v57, v58); + VAL v60; + VAL v61; + mw_mirth_elab_elabZ_entryZ_point(v59, v52, &v60, &v61); + VAL v62 = mtw_std_maybe_Maybe_1_Some(v60); + x55 = v62; + x54 = v61; + x53 = v49; } break; case 0LL: { // None - VAL v102 = MKI64(0LL /* None */); - x94 = v102; - x93 = v88; - x92 = v86; - x91 = v85; - x90 = v43; - x89 = v41; + VAL v63 = MKI64(0LL /* None */); + x55 = v63; + x54 = v52; + x53 = v49; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v103; - VAL v104; - mw_mirth_mirth_ZPlusMirth_traceZ_diagnosticsZBang(x92, x93, &v103, &v104); - int64_t v105 = VI64(VTUP(v104)->cells[1]); - int64_t v106 = 0LL; - bool v107 = (v105 > v106); - VAL x108; - int64_t x109; - VAL x110; - int64_t x111; - VAL x112; - if (v107) { - int64_t v113 = VI64(VTUP(v104)->cells[1]); - STR* v114; - STRLIT(v114, "", 0); - VAL v115 = MKI64(31LL /* FGRed */); - VAL v116 = (mw_std_terminal_Sgr_emitZThen(v115, MKSTR(v114))); - STR* v117 = i64_show(v113); - VAL v118 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v117), v116)); - STR* v119; - STRLIT(v119, " errors.", 8); - VAL v120 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v119), v118)); - VAL v121 = MKI64(0LL /* Reset */); - VAL v122 = (mw_std_terminal_Sgr_emitZThen(v121, v120)); - STR* v123; - STRLIT(v123, "\n", 1); - STR* v124 = str_cat(VSTR(v122), v123); - int64_t v125 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v124), v103)); - int64_t v126 = 1LL; - lpush(&lbl_outputZ_file, x89); - lpush(&lbl_emitZ_debugZ_info, MKI64(x90)); - push_value(x94); - push_resource(MKI64(v125)); - push_resource(v104); - mext_std_posix_externalZ_posixZ_exit(v126); - VAL r127 = pop_resource(); - x112 = r127; - int64_t r128 = VI64(pop_resource()); - x111 = r128; - VAL v129 = pop_value(); - x110 = v129; - int64_t v130 = VI64(lpop(&lbl_emitZ_debugZ_info)); - x109 = v130; - VAL v131 = lpop(&lbl_outputZ_file); - x108 = v131; + int64_t v64; + VAL v65; + mw_mirth_mirth_ZPlusMirth_traceZ_diagnosticsZBang(v50, x54, &v64, &v65); + int64_t v66 = VI64(VTUP(v65)->cells[1]); + int64_t v67 = 0LL; + bool v68 = (v66 > v67); + VAL x69; + int64_t x70; + VAL x71; + int64_t x72; + VAL x73; + if (v68) { + int64_t v74 = VI64(VTUP(v65)->cells[1]); + STR* v75; + STRLIT(v75, "", 0); + VAL v76 = MKI64(31LL /* FGRed */); + VAL v77 = mw_std_terminal_Sgr_emitZThen(v76, MKSTR(v75)); + STR* v78 = i64_show(v74); + VAL v79 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v78), v77); + STR* v80; + STRLIT(v80, " errors.", 8); + VAL v81 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v80), v79); + VAL v82 = MKI64(0LL /* Reset */); + VAL v83 = mw_std_terminal_Sgr_emitZThen(v82, v81); + int64_t v84 = mw_std_prim_ZPlusWorld_trace(v83, v64); + int64_t v85 = 1LL; + mext_std_posix_externalZ_posixZ_exit(v85); } else { - STR* v132; - STRLIT(v132, "", 0); - VAL v133 = MKI64(32LL /* FGGreen */); - VAL v134 = (mw_std_terminal_Sgr_emitZThen(v133, MKSTR(v132))); - STR* v135; - STRLIT(v135, "No errors.", 10); - VAL v136 = (mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v135), v134)); - VAL v137 = MKI64(0LL /* Reset */); - VAL v138 = (mw_std_terminal_Sgr_emitZThen(v137, v136)); - STR* v139; - STRLIT(v139, "\n", 1); - STR* v140 = str_cat(VSTR(v138), v139); - int64_t v141 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v140), v103)); - x112 = v104; - x111 = v141; - x110 = x94; - x109 = x90; - x108 = x89; - } - int64_t x142; - VAL x143; - switch (get_data_tag(x110)) { + STR* v86; + STRLIT(v86, "", 0); + VAL v87 = MKI64(32LL /* FGGreen */); + VAL v88 = mw_std_terminal_Sgr_emitZThen(v87, MKSTR(v86)); + STR* v89; + STRLIT(v89, "No errors.", 10); + VAL v90 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v89), v88); + VAL v91 = MKI64(0LL /* Reset */); + VAL v92 = mw_std_terminal_Sgr_emitZThen(v91, v90); + int64_t v93 = mw_std_prim_ZPlusWorld_trace(v92, v64); + x73 = v65; + x72 = v93; + x71 = x55; + x70 = v11; + x69 = v7; + } + int64_t x94; + VAL x95; + switch (get_data_tag(x71)) { case 1LL: { // Some - VAL v144 = mtp_std_maybe_Maybe_1_Some(x110); - STR* v145; - STRLIT(v145, "Specializer.", 12); - STR* v146; - STRLIT(v146, "\n", 1); - STR* v147 = str_cat(v145, v146); - int64_t v148 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v147), x111)); - VAL v149; - VAL v150; - mw_mirth_specializzer_runZ_specializzerZBang(x112, v144, &v149, &v150); - STR* v151; - STRLIT(v151, "Codegen.", 8); - STR* v152; - STRLIT(v152, "\n", 1); - STR* v153 = str_cat(v151, v152); - int64_t v154 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v153), v148)); - int64_t x155; - VAL x156; - switch (get_data_tag(x108)) { - case 1LL: { // Some - VAL v157 = mtp_std_maybe_Maybe_1_Some(x108); - VAL v158 = mtw_mirth_c99_C99z_Options_C99z_Options(v157, x109); - int64_t v159; - VAL v160; - mw_mirth_c99_runZ_outputZ_c99ZBang(v150, v158, v154, v149, &v159, &v160); - x156 = v160; - x155 = v159; - } break; - case 0LL: { // None - decref(v150); - x156 = v149; - x155 = v154; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + VAL v96 = mtp_std_maybe_Maybe_1_Some(x71); + STR* v97; + STRLIT(v97, "Specializer.", 12); + int64_t v98 = mw_std_prim_ZPlusWorld_trace(MKSTR(v97), x72); + VAL v99; + VAL v100; + mw_mirth_specializzer_runZ_specializzerZBang(x73, v96, &v99, &v100); + int64_t v101 = VI64(VTUP(v99)->cells[1]); + int64_t v102 = 0LL; + bool v103 = (v101 > v102); + int64_t x104; + VAL x105; + if (v103) { + int64_t v106; + VAL v107; + mw_mirth_mirth_ZPlusMirth_traceZ_diagnosticsZBang(v98, v99, &v106, &v107); + int64_t v108 = VI64(VTUP(v107)->cells[1]); + STR* v109; + STRLIT(v109, "", 0); + VAL v110 = MKI64(31LL /* FGRed */); + VAL v111 = mw_std_terminal_Sgr_emitZThen(v110, MKSTR(v109)); + STR* v112 = i64_show(v108); + VAL v113 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v112), v111); + STR* v114; + STRLIT(v114, " errors during specializer.", 27); + VAL v115 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v114), v113); + VAL v116 = MKI64(0LL /* Reset */); + VAL v117 = mw_std_terminal_Sgr_emitZThen(v116, v115); + int64_t v118 = mw_std_prim_ZPlusWorld_trace(v117, v106); + int64_t v119 = 1LL; + mext_std_posix_externalZ_posixZ_exit(v119); + } else { + STR* v120; + STRLIT(v120, "Codegen.", 8); + int64_t v121 = mw_std_prim_ZPlusWorld_trace(MKSTR(v120), v98); + int64_t x122; + VAL x123; + switch (get_data_tag(x69)) { + case 1LL: { // Some + VAL v124 = mtp_std_maybe_Maybe_1_Some(x69); + VAL v125 = mtw_mirth_c99_C99z_Options_C99z_Options(v124, x70); + int64_t v126; + VAL v127; + mw_mirth_c99_runZ_outputZ_c99ZBang(v100, v125, v121, v99, &v126, &v127); + x123 = v127; + x122 = v126; + } break; + case 0LL: { // None + decref(v100); + x123 = v99; + x122 = v121; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } } + x105 = x123; + x104 = x122; } - x143 = x156; - x142 = x155; + x95 = x105; + x94 = x104; } break; case 0LL: { // None - STR* v161; - STRLIT(v161, "Skipping Codegen.", 17); - STR* v162; - STRLIT(v162, "\n", 1); - STR* v163 = str_cat(v161, v162); - int64_t v164 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v163), x111)); - decref(x108); - x143 = x112; - x142 = v164; + STR* v128; + STRLIT(v128, "Skipping Codegen.", 17); + int64_t v129 = mw_std_prim_ZPlusWorld_trace(MKSTR(v128), x72); + decref(x69); + x95 = x73; + x94 = v129; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - *x5 = x143; - *x4 = x142; + *x5 = x95; + *x4 = x94; } static VAL mw_mirth_main_parseZ_packageZ_def (VAL x1) { int64_t v2 = 58LL /* BCOLON */; VAL v3 = mw_std_prim_Str_splitZ_byte(v2, x1); - VAL v4; - VAL v5; - mtp_std_list_ListZPlus_1_ListZPlus(v3, &v4, &v5); - VAL v6 = mw_std_list_List_1_ZDivL1(v5); - VAL x7; - VAL x8; - switch (get_data_tag(v6)) { - case 1LL: { // Some - VAL v9 = mtp_std_maybe_Maybe_1_Some(v6); - incref(v4); - VAL v10 = MKNIL; - VAL v11 = mkcons(v10, v4); - VAL v12 = mkcons(v11, v9); - VAL v13 = mtw_std_maybe_Maybe_1_Some(v12); - x8 = v13; - x7 = v4; - } break; - case 0LL: { // None - VAL v14 = MKI64(0LL /* None */); - x8 = v14; - x7 = v4; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - decref(x7); - VAL x15; - switch (get_data_tag(x8)) { + VAL v4 = mw_std_list_ListZPlus_1_ZDivL2ZPlus(v3); + VAL x5; + switch (get_data_tag(v4)) { case 1LL: { // Some - VAL v16 = mtp_std_maybe_Maybe_1_Some(x8); - x15 = v16; + VAL v6 = mtp_std_maybe_Maybe_1_Some(v4); + x5 = v6; } break; case 0LL: { // None - STR* v17; - STRLIT(v17, "Invalid package path definition", 31); - do_panic(v17); - VAL v18 = pop_value(); - x15 = v18; + STR* v7; + STRLIT(v7, "Invalid package path definition", 31); + do_panic(v7); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v19; - VAL v20; - value_uncons(x15, &v19, &v20); - VAL v21; - VAL v22; - value_uncons(v19, &v21, &v22); - decref(v21); - VAL v23 = MKNIL; - VAL v24 = mkcons(v23, v22); - VAL v25 = mkcons(v24, v20); - return v25; + VAL v9; + VAL v10; + value_uncons(x5, &v9, &v10); + VAL v11; + VAL v12; + value_uncons(v9, &v11, &v12); + decref(v11); + VAL v13 = MKNIL; + VAL v14 = mkcons(v13, v12); + VAL v15 = mkcons(v14, v10); + return v15; } static void mw_mirth_main_compilerZ_parseZ_args (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6) { VAL x7; @@ -85229,102 +62984,93 @@ static void mw_mirth_main_compilerZ_parseZ_args (VAL x1, VAL x2, VAL x3, VAL x4, switch (v9) { case 111LL: { // B'o' VAL x12; - VAL x13; switch (get_data_tag(x3)) { case 1LL: { // Some - VAL v14 = mtp_std_maybe_Maybe_1_Some(x3); - VAL v15 = mtw_std_maybe_Maybe_1_Some(v14); - x13 = v15; - x12 = x1; + VAL v13 = mtp_std_maybe_Maybe_1_Some(x3); + VAL v14 = mtw_std_maybe_Maybe_1_Some(v13); + x12 = v14; } break; case 0LL: { // None - VAL v16 = MKI64(0LL /* None */); - x13 = v16; - x12 = x1; + VAL v15 = MKI64(0LL /* None */); + x12 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v17 = tup_replace(x2, 2, x13); - x11 = v17; - x10 = x12; + VAL v16 = tup_replace(x2, 2, x12); + x11 = v16; + x10 = x1; } break; case 101LL: { // B'e' - VAL v18 = tup_replace(x2, 3, x3); - x11 = v18; + VAL v17 = tup_replace(x2, 3, x3); + x11 = v17; x10 = x1; } break; case 99LL: { // B'c' decref(x3); - VAL v19 = MKI64(0LL /* None */); - VAL v20 = tup_replace(x2, 3, v19); - x11 = v20; + VAL v18 = MKI64(0LL /* None */); + VAL v19 = tup_replace(x2, 3, v18); + x11 = v19; x10 = x1; } break; case 112LL: { // B'p' - VAL x21; - VAL x22; + VAL x20; switch (get_data_tag(x3)) { case 1LL: { // Some - VAL v23 = mtp_std_maybe_Maybe_1_Some(x3); - VAL v24 = mw_mirth_main_parseZ_packageZ_def(v23); + VAL v21 = mtp_std_maybe_Maybe_1_Some(x3); + VAL v22 = mw_mirth_main_parseZ_packageZ_def(v21); incref(x2); - VAL v25 = VVAL(VTUP(x2)->cells[4]); - incref(v25); + VAL v23 = VVAL(VTUP(x2)->cells[4]); + incref(v23); decref(x2); - VAL v26 = mtw_std_list_List_1_Cons(v24, v25); - VAL v27 = tup_replace(x2, 4, v26); - x22 = v27; - x21 = x1; + VAL v24 = mtw_std_list_List_1_Cons(v22, v23); + VAL v25 = tup_replace(x2, 4, v24); + x20 = v25; } break; case 0LL: { // None - x22 = x2; - x21 = x1; + x20 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x11 = x22; - x10 = x21; + x11 = x20; + x10 = x1; } break; case 80LL: { // B'P' - VAL x28; - VAL x29; + VAL x26; switch (get_data_tag(x3)) { case 1LL: { // Some - VAL v30 = mtp_std_maybe_Maybe_1_Some(x3); + VAL v27 = mtp_std_maybe_Maybe_1_Some(x3); incref(x2); - VAL v31 = VVAL(VTUP(x2)->cells[5]); - incref(v31); + VAL v28 = VVAL(VTUP(x2)->cells[5]); + incref(v28); decref(x2); - VAL v32 = mtw_std_list_List_1_Cons(v30, v31); - VAL v33 = tup_replace(x2, 5, v32); - x29 = v33; - x28 = x1; + VAL v29 = mtw_std_list_List_1_Cons(v27, v28); + VAL v30 = tup_replace(x2, 5, v29); + x26 = v30; } break; case 0LL: { // None - x29 = x2; - x28 = x1; + x26 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x11 = x29; - x10 = x28; + x11 = x26; + x10 = x1; } break; default: { decref(x3); - VAL v34 = MKI64(4LL /* UnknownArg */); - VAL v35 = mtw_std_maybe_Maybe_1_Some(v34); - VAL v36 = VVAL(VTUP(x1)->cells[2]); - incref(v36); - VAL v37 = tup_replace(v36, 6, v35); - VAL v38 = VTUP(x1)->cells[2]; - decref(v38); - VTUP(x1)->cells[2] = v37; + VAL v31 = MKI64(4LL /* UnknownArg */); + VAL v32 = mtw_std_maybe_Maybe_1_Some(v31); + VAL v33 = VVAL(VTUP(x1)->cells[2]); + incref(v33); + VAL v34 = tup_replace(v33, 6, v32); + VAL v35 = VTUP(x1)->cells[2]; + decref(v35); + VTUP(x1)->cells[2] = v34; x11 = x2; x10 = x1; } break; @@ -85333,190 +63079,161 @@ static void mw_mirth_main_compilerZ_parseZ_args (VAL x1, VAL x2, VAL x3, VAL x4, x7 = x10; } break; case 2LL: { // Positional - VAL v39 = VVAL(VTUP(x1)->cells[2]); - incref(v39); - int64_t v40 = VI64(VTUP(v39)->cells[4]); - decref(v39); - int64_t v41 = 0LL; - bool v42 = (v40 == v41); - VAL x43; - VAL x44; - if (v42) { - VAL x45; - VAL x46; + VAL v36 = VVAL(VTUP(x1)->cells[2]); + incref(v36); + int64_t v37 = VI64(VTUP(v36)->cells[4]); + decref(v36); + int64_t v38 = 0LL; + bool v39 = (v37 == v38); + VAL x40; + VAL x41; + if (v39) { + VAL x42; switch (get_data_tag(x3)) { case 1LL: { // Some - VAL v47 = mtp_std_maybe_Maybe_1_Some(x3); - VAL v48 = tup_replace(x2, 1, v47); - x46 = v48; - x45 = x1; + VAL v43 = mtp_std_maybe_Maybe_1_Some(x3); + VAL v44 = tup_replace(x2, 1, v43); + x42 = v44; } break; case 0LL: { // None - x46 = x2; - x45 = x1; + x42 = x2; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x44 = x46; - x43 = x45; + x41 = x42; + x40 = x1; } else { decref(x3); - VAL v49 = MKI64(2LL /* TooManyArgs */); - VAL v50 = mtw_std_maybe_Maybe_1_Some(v49); - VAL v51 = VVAL(VTUP(x1)->cells[2]); - incref(v51); - VAL v52 = tup_replace(v51, 6, v50); - VAL v53 = VTUP(x1)->cells[2]; - decref(v53); - VTUP(x1)->cells[2] = v52; - x44 = x2; - x43 = x1; - } - x8 = x44; - x7 = x43; + VAL v45 = MKI64(2LL /* TooManyArgs */); + VAL v46 = mtw_std_maybe_Maybe_1_Some(v45); + VAL v47 = VVAL(VTUP(x1)->cells[2]); + incref(v47); + VAL v48 = tup_replace(v47, 6, v46); + VAL v49 = VTUP(x1)->cells[2]; + decref(v49); + VTUP(x1)->cells[2] = v48; + x41 = x2; + x40 = x1; + } + x8 = x41; + x7 = x40; } break; case 1LL: { // LongOnly - VAL v54 = mtp_argZ_parser_types_ArgpOptionType_LongOnly(x4); - incref(v54); - STR* v55; - STRLIT(v55, "debug", 5); - bool v56 = (str_cmp(VSTR(v54), v55) == 0); - VAL x57; - VAL x58; - if (v56) { - decref(v54); + VAL v50 = mtp_argZ_parser_types_ArgpOptionType_LongOnly(x4); + incref(v50); + STR* v51; + STRLIT(v51, "debug", 5); + bool v52 = (str_cmp(VSTR(v50), v51) == 0); + VAL x53; + VAL x54; + if (v52) { + decref(v50); decref(x3); - int64_t v59 = 1LL /* True */; - VAL v60 = tup_replace(x2, 6, MKI64(v59)); - x58 = v60; - x57 = x1; + int64_t v55 = 1LL /* True */; + VAL v56 = tup_replace(x2, 6, MKI64(v55)); + x54 = v56; + x53 = x1; } else { - decref(v54); + decref(v50); decref(x3); - VAL v61 = MKI64(4LL /* UnknownArg */); - VAL v62 = mtw_std_maybe_Maybe_1_Some(v61); - VAL v63 = VVAL(VTUP(x1)->cells[2]); - incref(v63); - VAL v64 = tup_replace(v63, 6, v62); - VAL v65 = VTUP(x1)->cells[2]; - decref(v65); - VTUP(x1)->cells[2] = v64; - x58 = x2; - x57 = x1; + VAL v57 = MKI64(4LL /* UnknownArg */); + VAL v58 = mtw_std_maybe_Maybe_1_Some(v57); + VAL v59 = VVAL(VTUP(x1)->cells[2]); + incref(v59); + VAL v60 = tup_replace(v59, 6, v58); + VAL v61 = VTUP(x1)->cells[2]; + decref(v61); + VTUP(x1)->cells[2] = v60; + x54 = x2; + x53 = x1; } - x8 = x58; - x7 = x57; + x8 = x54; + x7 = x53; } break; case 3LL: { // End - VAL v66 = VVAL(VTUP(x1)->cells[2]); - incref(v66); - int64_t v67 = VI64(VTUP(v66)->cells[4]); - decref(v66); - int64_t v68 = 1LL; - bool v69 = (v67 < v68); - VAL x70; - VAL x71; - VAL x72; - if (v69) { - VAL v73 = MKI64(3LL /* TooFewArgs */); - VAL v74 = mtw_std_maybe_Maybe_1_Some(v73); - VAL v75 = VVAL(VTUP(x1)->cells[2]); - incref(v75); - VAL v76 = tup_replace(v75, 6, v74); - VAL v77 = VTUP(x1)->cells[2]; - decref(v77); - VTUP(x1)->cells[2] = v76; - x72 = x1; - x71 = x3; - x70 = x2; + VAL v62 = VVAL(VTUP(x1)->cells[2]); + incref(v62); + int64_t v63 = VI64(VTUP(v62)->cells[4]); + decref(v62); + int64_t v64 = 1LL; + bool v65 = (v63 < v64); + VAL x66; + if (v65) { + VAL v67 = MKI64(3LL /* TooFewArgs */); + VAL v68 = mtw_std_maybe_Maybe_1_Some(v67); + VAL v69 = VVAL(VTUP(x1)->cells[2]); + incref(v69); + VAL v70 = tup_replace(v69, 6, v68); + VAL v71 = VTUP(x1)->cells[2]; + decref(v71); + VTUP(x1)->cells[2] = v70; + x66 = x1; } else { - x72 = x1; - x71 = x3; - x70 = x2; + x66 = x1; } - VAL v78 = VVAL(VTUP(x72)->cells[2]); - incref(v78); - VAL v79 = VVAL(VTUP(v78)->cells[1]); - incref(v79); - decref(v78); - VAL v80 = VVAL(VTUP(v79)->cells[2]); - incref(v80); - decref(v79); - VAL x81; - VAL x82; - VAL x83; - switch (get_data_tag(v80)) { - case 1LL: { // Some - VAL v84 = mtp_std_maybe_Maybe_1_Some(v80); - decref(v84); - x83 = x72; - x82 = x71; - x81 = x70; - } break; - case 0LL: { // None - VAL v85 = VVAL(VTUP(x72)->cells[2]); - incref(v85); - VAL v86 = VVAL(VTUP(v85)->cells[1]); - incref(v86); - decref(v85); - VAL v87 = VVAL(VTUP(v86)->cells[3]); - incref(v87); - decref(v86); - VAL x88; - VAL x89; - VAL x90; - switch (get_data_tag(v87)) { - case 1LL: { // Some - VAL v91 = mtp_std_maybe_Maybe_1_Some(v87); - decref(v91); - STR* v92; - STRLIT(v92, "output-file", 11); - VAL v93 = mtw_argZ_parser_types_ArgumentParsingError_MissingArg(MKSTR(v92)); - VAL v94 = mtw_std_maybe_Maybe_1_Some(v93); - VAL v95 = VVAL(VTUP(x72)->cells[2]); - incref(v95); - VAL v96 = tup_replace(v95, 6, v94); - VAL v97 = VTUP(x72)->cells[2]; - decref(v97); - VTUP(x72)->cells[2] = v96; - x90 = x72; - x89 = x71; - x88 = x70; - } break; - case 0LL: { // None - x90 = x72; - x89 = x71; - x88 = x70; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - x83 = x90; - x82 = x89; - x81 = x88; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); + VAL v72 = VVAL(VTUP(x66)->cells[2]); + incref(v72); + VAL v73 = VVAL(VTUP(v72)->cells[1]); + incref(v73); + decref(v72); + VAL v74 = VVAL(VTUP(v73)->cells[2]); + incref(v74); + decref(v73); + int64_t v75 = get_data_tag(v74); + decref(v74); + int64_t v76 = 0LL; + bool v77 = (v75 == v76); + VAL x78; + if (v77) { + VAL v79 = VVAL(VTUP(x66)->cells[2]); + incref(v79); + VAL v80 = VVAL(VTUP(v79)->cells[1]); + incref(v80); + decref(v79); + VAL v81 = VVAL(VTUP(v80)->cells[3]); + incref(v81); + decref(v80); + int64_t v82 = get_data_tag(v81); + decref(v81); + int64_t v83 = 1LL; + bool v84 = (v82 == v83); + VAL x85; + if (v84) { + STR* v86; + STRLIT(v86, "output-file", 11); + VAL v87 = mtw_argZ_parser_types_ArgumentParsingError_MissingArg(MKSTR(v86)); + VAL v88 = mtw_std_maybe_Maybe_1_Some(v87); + VAL v89 = VVAL(VTUP(x66)->cells[2]); + incref(v89); + VAL v90 = tup_replace(v89, 6, v88); + VAL v91 = VTUP(x66)->cells[2]; + decref(v91); + VTUP(x66)->cells[2] = v90; + x85 = x66; + } else { + x85 = x66; } + x78 = x85; + } else { + x78 = x66; } - decref(x82); - x8 = x81; - x7 = x83; + decref(x3); + x8 = x2; + x7 = x78; } break; default: { decref(x4); decref(x3); - VAL v98 = MKI64(4LL /* UnknownArg */); - VAL v99 = mtw_std_maybe_Maybe_1_Some(v98); - VAL v100 = VVAL(VTUP(x1)->cells[2]); - incref(v100); - VAL v101 = tup_replace(v100, 6, v99); - VAL v102 = VTUP(x1)->cells[2]; - decref(v102); - VTUP(x1)->cells[2] = v101; + VAL v92 = MKI64(4LL /* UnknownArg */); + VAL v93 = mtw_std_maybe_Maybe_1_Some(v92); + VAL v94 = VVAL(VTUP(x1)->cells[2]); + incref(v94); + VAL v95 = tup_replace(v94, 6, v93); + VAL v96 = VTUP(x1)->cells[2]; + decref(v96); + VTUP(x1)->cells[2] = v95; x8 = x2; x7 = x1; } break; @@ -85525,8 +63242,7 @@ static void mw_mirth_main_compilerZ_parseZ_args (VAL x1, VAL x2, VAL x3, VAL x4, *x5 = x7; } static int64_t mw_mirth_main_main (int64_t x1) { - push_resource(MKI64(x1)); - VAL v2 = (mw_mirth_mirth_ZPlusMirth_InitZBang()); + VAL v2 = mw_mirth_mirth_ZPlusMirth_InitZBang(); VAL v3 = mw_mirth_main_Arguments_default(); VAL v4 = MKI64(0LL /* Nil */); VAL v5 = mw_std_list_List_1_reverse(v4); @@ -85628,461 +63344,2074 @@ static int64_t mw_mirth_main_main (int64_t x1) { VAL v80 = mtp_std_either_Either_2_Right(v76); x79 = v80; x78 = v2; - int64_t r81 = VI64(pop_resource()); - x77 = r81; + x77 = x1; } break; case 0LL: { // Left - VAL v82 = mtp_std_either_Either_2_Left(v76); - STR* v83; - STRLIT(v83, "", 0); + VAL v81 = mtp_std_either_Either_2_Left(v76); + STR* v82; + STRLIT(v82, "", 0); + VAL v83; VAL v84; + value_uncons(v81, &v83, &v84); VAL v85; - value_uncons(v82, &v84, &v85); VAL v86; - VAL v87; - value_uncons(v84, &v86, &v87); - decref(v86); - VAL v88 = (mw_std_str_ZPlusStr_pushZ_strZBang(v85, MKSTR(v83))); - VAL v89 = (mw_argZ_parser_types_ArgumentParsingError_emitZThen(v87, v88)); - STR* v90; - STRLIT(v90, "\n", 1); - STR* v91 = str_cat(VSTR(v89), v90); - int64_t r92 = VI64(pop_resource()); - int64_t v93 = (mw_std_prim_ZPlusWorld_traceZ_(MKSTR(v91), r92)); - int64_t v94 = 1LL; - push_resource(MKI64(v93)); - push_resource(v2); - mext_std_posix_externalZ_posixZ_exit(v94); - VAL v95 = pop_value(); - x79 = v95; - VAL r96 = pop_resource(); - x78 = r96; - int64_t r97 = VI64(pop_resource()); - x77 = r97; + value_uncons(v83, &v85, &v86); + decref(v85); + VAL v87 = mw_std_str_ZPlusStr_pushZ_strZBang(v84, MKSTR(v82)); + VAL v88 = mw_argZ_parser_types_ArgumentParsingError_emitZThen(v86, v87); + int64_t v89 = mw_std_prim_ZPlusWorld_trace(v88, x1); + int64_t v90 = 1LL; + mext_std_posix_externalZ_posixZ_exit(v90); + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + incref(x79); + VAL v92 = VVAL(VTUP(x79)->cells[5]); + incref(v92); + decref(x79); + int64_t v93 = mw_std_list_List_1_emptyZAsk(v92); + VAL x94; + VAL x95; + if (((bool)v93)) { + VAL v96 = MKI64(0LL /* Nil */); + VAL v97 = mw_std_list_List_1_reverse(v96); + STR* v98; + STRLIT(v98, "lib", 3); + VAL v99 = mtw_std_list_List_1_Cons(MKSTR(v98), v97); + VAL v100; + VAL v101; + mw_mirth_mirth_ZPlusMirth_mirthZ_baseZ_libZ_path(x78, &v100, &v101); + VAL v102 = mw_std_maybe_Maybe_1_for_1_sp5(v99, v101); + VAL v103 = mw_std_list_List_1_reverse(v102); + VAL v104 = tup_replace(x79, 5, v103); + x95 = v104; + x94 = v100; + } else { + x95 = x79; + x94 = x78; + } + int64_t v105; + VAL v106; + mw_mirth_main_compileZBang(x95, x77, x94, &v105, &v106); + mw_mirth_mirth_ZPlusMirth_rdrop(v106); + return v105; +} +static VAL mw_std_list_List_1_for_1_sp1 (VAL x1, VAL x2) { + int64_t v3 = 1LL /* True */; + VAL v4 = x1; + VAL v5 = x2; + int64_t v6 = v3; + int64_t v7 = v3; + while (((bool)v7)) { + VAL v8 = v4; + VAL v9 = v5; + int64_t v10 = v6; + VAL x11; + VAL x12; + int64_t x13; + switch (get_data_tag(v9)) { + case 1LL: { // Cons + VAL v14; + VAL v15; + mtp_std_list_List_1_Cons(v9, &v14, &v15); + VAL v16 = mtw_std_list_List_1_Cons(v14, v8); + int64_t v17 = 1LL /* True */; + x13 = v17; + x12 = v15; + x11 = v16; + } break; + case 0LL: { // Nil + VAL v18 = MKI64(0LL /* Nil */); + int64_t v19 = 0LL /* False */; + x13 = v19; + x12 = v18; + x11 = v8; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v7 = x13; + v6 = x13; + v5 = x12; + v4 = x11; + } + decref(v5); + return v4; +} +static VAL mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2 (VAL x1) { + VAL v2 = mw_mirth_c99_ZPlusC99_indent(x1); + STR* v3; + STRLIT(v3, "}", 1); + VAL v4 = mw_mirth_c99_ZPlusC99_put(MKSTR(v3), v2); + VAL v5 = mw_mirth_c99_ZPlusC99_line(v4); + return v5; +} +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp1 (uint64_t x1, VAL x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); + VAL v6 = VVAL(VTUP(v5)->cells[7]); + VAL v7; + VAL v8; + mw_mirth_arrow_Block_arrow(v6, x1, &v7, &v8); + VTUP(v5)->cells[7] = v7; + VTUP(x2)->cells[1] = v5; + *x4 = x2; + *x3 = v8; +} +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp2 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); + VAL v6 = VVAL(VTUP(v5)->cells[7]); + VAL v7; + VAL v8; + mw_mirth_arrow_Arrow_freeZ_vars(v6, x1, &v7, &v8); + VTUP(v5)->cells[7] = v7; + VTUP(x2)->cells[1] = v5; + *x4 = x2; + *x3 = v8; +} +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp3 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); + VAL v6 = VVAL(VTUP(v5)->cells[7]); + VAL v7 = mw_mirth_arrow_Arrow_type(x1); + VTUP(v5)->cells[7] = v6; + VTUP(x2)->cells[1] = v5; + *x4 = x2; + *x3 = v7; +} +static VAL mw_mirth_c99_ZPlusC99_c99Z_line_1_sp3 (VAL x1) { + VAL v2 = mw_mirth_c99_ZPlusC99_indent(x1); + STR* v3; + STRLIT(v3, "WORD_EXIT;", 10); + VAL v4 = mw_mirth_c99_ZPlusC99_put(MKSTR(v3), v2); + VAL v5 = mw_mirth_c99_ZPlusC99_line(v4); + return v5; +} +static VAL mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp1 (VAL x1, uint64_t x2, VAL x3) { + int64_t v4 = VI64(VTUP(x3)->cells[3]); + VAL v5 = VVAL(VTUP(x3)->cells[1]); + int64_t v6 = VI64(VTUP(v5)->cells[4]); + VTUP(v5)->cells[4] = MKI64(v4); + VAL v7 = mw_mirth_c99_ZPlusC99_indent(v5); + STR* v8; + STRLIT(v8, "lpush(&lbl_", 11); + VAL v9 = mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7); + uint64_t v10 = mw_mirth_label_Label_name(x2); + VAL v11 = mw_mirth_name_Name_mangled(v10); + VAL v12 = mw_mirth_c99_ZPlusC99_put(v11, v9); + STR* v13; + STRLIT(v13, ", ", 2); + VAL v14 = mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12); + VAL v15 = mw_mirth_c99_ZPlusC99_put(x1, v14); + STR* v16; + STRLIT(v16, ");", 2); + VAL v17 = mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15); + VAL v18 = mw_mirth_c99_ZPlusC99_line(v17); + VTUP(v18)->cells[4] = MKI64(v6); + VTUP(x3)->cells[1] = v18; + return x3; +} +static VAL mw_std_list_List_1_filter_1_sp1 (VAL x1) { + VAL v2 = MKI64(0LL /* Nil */); + VAL v3 = mw_std_list_List_1_reverse(v2); + int64_t v4 = 1LL /* True */; + VAL v5 = v3; + VAL v6 = x1; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL x12; + VAL x13; + int64_t x14; + switch (get_data_tag(v10)) { + case 1LL: { // Cons + VAL v15; + VAL v16; + mtp_std_list_List_1_Cons(v10, &v15, &v16); + incref(v15); + int64_t v17 = mw_mirth_var_Var_isZ_physicalZAsk(VU64(v15)); + VAL x18; + if (((bool)v17)) { + VAL v19 = mtw_std_list_List_1_Cons(v15, v9); + x18 = v19; + } else { + decref(v15); + x18 = v9; + } + int64_t v20 = 1LL /* True */; + x14 = v20; + x13 = v16; + x12 = x18; + } break; + case 0LL: { // Nil + VAL v21 = MKI64(0LL /* Nil */); + int64_t v22 = 0LL /* False */; + x14 = v22; + x13 = v21; + x12 = v9; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v8 = x14; + v7 = x14; + v6 = x13; + v5 = x12; + } + decref(v6); + VAL v23 = mw_std_list_List_1_reverse(v5); + return v23; +} +static VAL mw_std_list_List_1_reverseZ_for_1_sp1 (VAL x1, VAL x2) { + VAL v3 = mw_std_list_List_1_reverse(x2); + int64_t v4 = 1LL /* True */; + VAL v5 = x1; + VAL v6 = v3; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL x12; + VAL x13; + int64_t x14; + switch (get_data_tag(v10)) { + case 1LL: { // Cons + VAL v15; + VAL v16; + mtp_std_list_List_1_Cons(v10, &v15, &v16); + VAL v17 = VVAL(VTUP(v9)->cells[1]); + VAL v18 = mw_mirth_c99_ZPlusC99_indent(v17); + STR* v19; + STRLIT(v19, "decref(", 7); + VAL v20 = mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18); + VAL v21 = mw_mirth_c99_ZPlusC99_varZ_put(VU64(v15), v20); + STR* v22; + STRLIT(v22, ");", 2); + VAL v23 = mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v21); + VAL v24 = mw_mirth_c99_ZPlusC99_line(v23); + VTUP(v9)->cells[1] = v24; + int64_t v25 = 1LL /* True */; + x14 = v25; + x13 = v16; + x12 = v9; + } break; + case 0LL: { // Nil + VAL v26 = MKI64(0LL /* Nil */); + int64_t v27 = 0LL /* False */; + x14 = v27; + x13 = v26; + x12 = v9; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v8 = x14; + v7 = x14; + v6 = x13; + v5 = x12; + } + decref(v6); + return v5; +} +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp4 (uint64_t x1, VAL x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); + VAL v6 = VVAL(VTUP(v5)->cells[7]); + VAL v7; + VAL v8; + mw_mirth_data_Tag_semiZ_transparentZAsk(v6, x1, &v7, &v8); + VTUP(v5)->cells[7] = v7; + VTUP(x2)->cells[1] = v5; + *x4 = x2; + *x3 = v8; +} +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp6 (VAL x1, VAL x2, int64_t *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); + VAL v6 = VVAL(VTUP(v5)->cells[7]); + int64_t v7; + VAL v8; + mw_mirth_type_Type_c99Z_repr(x1, v6, &v7, &v8); + VTUP(v5)->cells[7] = v8; + VTUP(x2)->cells[1] = v5; + *x4 = x2; + *x3 = v7; +} +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp7 (uint64_t x1, VAL x2, int64_t *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); + VAL v6 = VVAL(VTUP(v5)->cells[7]); + int64_t v7; + VAL v8; + mw_mirth_data_Data_c99Z_repr(x1, v6, &v7, &v8); + VTUP(v5)->cells[7] = v8; + VTUP(x2)->cells[1] = v5; + *x4 = x2; + *x3 = v7; +} +static void mw_std_maybe_Maybe_1_map_1_sp3 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL x5; + VAL x6; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v7 = mtp_std_maybe_Maybe_1_Some(x2); + VAL v8; + VAL v9; + value_uncons(v7, &v8, &v9); + VAL v10; + VAL v11; + value_uncons(v8, &v10, &v11); + decref(v10); + incref(x1); + VAL v12 = mtw_mirth_type_StackType_STWith(v11, x1); + VAL v13 = MKNIL; + VAL v14 = mkcons(v13, v12); + VAL v15 = mkcons(v14, v9); + VAL v16 = mtw_std_maybe_Maybe_1_Some(v15); + x6 = v16; + x5 = x1; + } break; + case 0LL: { // None + VAL v17 = MKI64(0LL /* None */); + x6 = v17; + x5 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x4 = x6; + *x3 = x5; +} +static void mw_std_maybe_Maybe_1_map_1_sp4 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL x5; + VAL x6; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v7 = mtp_std_maybe_Maybe_1_Some(x2); + VAL v8; + VAL v9; + value_uncons(v7, &v8, &v9); + VAL v10; + VAL v11; + value_uncons(v8, &v10, &v11); + decref(v10); + incref(x1); + VAL v12 = mtw_mirth_type_StackType_STCons(v11, x1); + VAL v13 = MKNIL; + VAL v14 = mkcons(v13, v12); + VAL v15 = mkcons(v14, v9); + VAL v16 = mtw_std_maybe_Maybe_1_Some(v15); + x6 = v16; + x5 = x1; + } break; + case 0LL: { // None + VAL v17 = MKI64(0LL /* None */); + x6 = v17; + x5 = x1; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - incref(x79); - VAL v98 = VVAL(VTUP(x79)->cells[5]); - incref(v98); - decref(x79); - int64_t v99 = mw_std_list_List_1_emptyZAsk(v98); - int64_t x100; - VAL x101; - VAL x102; - if (((bool)v99)) { - VAL v103 = MKI64(0LL /* Nil */); - VAL v104 = mw_std_list_List_1_reverse(v103); - STR* v105; - STRLIT(v105, "lib", 3); - VAL v106 = mtw_std_list_List_1_Cons(MKSTR(v105), v104); - VAL v107; - VAL v108; - mw_mirth_mirth_ZPlusMirth_mirthZ_baseZ_libZ_path(x78, &v107, &v108); - int64_t x109; - VAL x110; - VAL x111; - VAL x112; - switch (get_data_tag(v108)) { + *x4 = x6; + *x3 = x5; +} +static VAL mw_std_list_List_1_unions_1_sp1 (VAL x1) { + VAL v2 = mw_std_list_List_1_ZToListZPlus(x1); + VAL x3; + switch (get_data_tag(v2)) { + case 1LL: { // Some + VAL v4 = mtp_std_maybe_Maybe_1_Some(v2); + VAL v5; + VAL v6; + mw_std_list_ListZPlus_1_uncons(v4, &v5, &v6); + int64_t v7 = 1LL /* True */; + VAL v8 = v5; + VAL v9 = v6; + int64_t v10 = v7; + int64_t v11 = v7; + while (((bool)v11)) { + VAL v12 = v8; + VAL v13 = v9; + int64_t v14 = v10; + VAL x15; + VAL x16; + int64_t x17; + switch (get_data_tag(v13)) { + case 1LL: { // Cons + VAL v18; + VAL v19; + mtp_std_list_List_1_Cons(v13, &v18, &v19); + VAL v20 = mw_std_list_List_1_union_1_sp1(v12, v18); + int64_t v21 = 1LL /* True */; + x17 = v21; + x16 = v19; + x15 = v20; + } break; + case 0LL: { // Nil + VAL v22 = MKI64(0LL /* Nil */); + int64_t v23 = 0LL /* False */; + x17 = v23; + x16 = v22; + x15 = v12; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v11 = x17; + v10 = x17; + v9 = x16; + v8 = x15; + } + decref(v9); + VAL v24 = mtw_std_maybe_Maybe_1_Some(v8); + x3 = v24; + } break; + case 0LL: { // None + VAL v25 = MKI64(0LL /* None */); + x3 = v25; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + VAL x26; + switch (get_data_tag(x3)) { + case 1LL: { // Some + VAL v27 = mtp_std_maybe_Maybe_1_Some(x3); + x26 = v27; + } break; + case 0LL: { // None + VAL v28 = MKI64(0LL /* Nil */); + x26 = v28; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x26; +} +static VAL mw_std_list_List_1_union_1_sp1 (VAL x1, VAL x2) { + incref(x1); + VAL v3 = mw_std_list_List_1_difference_1_sp1(x2, x1); + VAL v4 = mw_std_list_List_1_cat(x1, v3); + return v4; +} +static VAL mw_std_list_List_1_difference_1_sp1 (VAL x1, VAL x2) { + VAL v3 = MKI64(0LL /* Nil */); + VAL v4 = mw_std_list_List_1_reverse(v3); + int64_t v5 = 1LL /* True */; + VAL v6 = x2; + VAL v7 = v4; + VAL v8 = x1; + int64_t v9 = v5; + int64_t v10 = v5; + while (((bool)v10)) { + VAL v11 = v6; + VAL v12 = v7; + VAL v13 = v8; + int64_t v14 = v9; + VAL x15; + VAL x16; + VAL x17; + int64_t x18; + switch (get_data_tag(v13)) { + case 1LL: { // Cons + VAL v19; + VAL v20; + mtp_std_list_List_1_Cons(v13, &v19, &v20); + incref(v19); + incref(v11); + VAL v21 = MKI64(0LL /* None */); + int64_t v22 = 1LL /* True */; + VAL v23 = v19; + VAL v24 = v21; + VAL v25 = v11; + int64_t v26 = v22; + int64_t v27 = v22; + while (((bool)v27)) { + VAL v28 = v23; + VAL v29 = v24; + VAL v30 = v25; + int64_t v31 = v26; + VAL v32; + VAL v33; + mw_std_list_List_1_uncons(v30, &v32, &v33); + uint64_t x34; + VAL x35; + VAL x36; + int64_t x37; + switch (get_data_tag(v32)) { + case 1LL: { // Some + VAL v38 = mtp_std_maybe_Maybe_1_Some(v32); + incref(v38); + incref(v28); + int64_t v39 = mw_mirth_var_Var_index(VU64(v28)); + int64_t v40 = mw_mirth_var_Var_index(VU64(v38)); + bool v41 = (v39 == v40); + uint64_t x42; + VAL x43; + if (v41) { + VAL v44 = mtw_std_maybe_Maybe_1_Some(v38); + x43 = v44; + x42 = VU64(v28); + } else { + decref(v38); + VAL v45 = MKI64(0LL /* None */); + x43 = v45; + x42 = VU64(v28); + } + uint64_t x46; + VAL x47; + VAL x48; + switch (get_data_tag(x43)) { + case 0LL: { // None + x48 = v33; + x47 = v29; + x46 = x42; + } break; + default: { + decref(v33); + decref(v29); + VAL v49 = MKI64(0LL /* Nil */); + x48 = v49; + x47 = x43; + x46 = x42; + } break; + } + int64_t v50 = 1LL /* True */; + x37 = v50; + x36 = x48; + x35 = x47; + x34 = x46; + } break; + case 0LL: { // None + int64_t v51 = 0LL /* False */; + x37 = v51; + x36 = v33; + x35 = v29; + x34 = VU64(v28); + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v27 = x37; + v26 = x37; + v25 = x36; + v24 = x35; + v23 = MKU64(x34); + } + decref(v25); + decref(v23); + int64_t v52 = get_data_tag(v24); + decref(v24); + int64_t v53 = 1LL; + bool v54 = (v52 == v53); + bool v55 = !v54; + VAL x56; + VAL x57; + if (v55) { + VAL v58 = mtw_std_list_List_1_Cons(v19, v12); + x57 = v58; + x56 = v11; + } else { + decref(v19); + x57 = v12; + x56 = v11; + } + int64_t v59 = 1LL /* True */; + x18 = v59; + x17 = v20; + x16 = x57; + x15 = x56; + } break; + case 0LL: { // Nil + VAL v60 = MKI64(0LL /* Nil */); + int64_t v61 = 0LL /* False */; + x18 = v61; + x17 = v60; + x16 = v12; + x15 = v11; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v10 = x18; + v9 = x18; + v8 = x17; + v7 = x16; + v6 = x15; + } + decref(v8); + VAL v62 = mw_std_list_List_1_reverse(v7); + decref(v6); + return v62; +} +static VAL mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp2 (VAL x1) { + int64_t v2 = VI64(VTUP(x1)->cells[4]); + VAL v3 = VVAL(VTUP(x1)->cells[1]); + VAL v4 = mw_mirth_c99_ZPlusC99_c99Z_lineZ_if_1_sp21(v2, v3); + VTUP(x1)->cells[1] = v4; + return x1; +} +static VAL mw_std_list_List_1_for_1_sp17 (VAL x1, VAL x2) { + int64_t v3 = 1LL /* True */; + VAL v4 = x1; + VAL v5 = x2; + int64_t v6 = v3; + int64_t v7 = v3; + while (((bool)v7)) { + VAL v8 = v4; + VAL v9 = v5; + int64_t v10 = v6; + VAL x11; + VAL x12; + int64_t x13; + switch (get_data_tag(v9)) { + case 1LL: { // Cons + VAL v14; + VAL v15; + mtp_std_list_List_1_Cons(v9, &v14, &v15); + VAL v16 = mw_mirth_c99_C99APIArg_pushZ_apiZ_argZBang(v14, v8); + int64_t v17 = 1LL /* True */; + x13 = v17; + x12 = v15; + x11 = v16; + } break; + case 0LL: { // Nil + VAL v18 = MKI64(0LL /* Nil */); + int64_t v19 = 0LL /* False */; + x13 = v19; + x12 = v18; + x11 = v8; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v7 = x13; + v6 = x13; + v5 = x12; + v4 = x11; + } + decref(v5); + return v4; +} +static VAL mw_mirth_c99_ZPlusC99_c99Z_lineZ_if_1_sp21 (int64_t x1, VAL x2) { + int64_t v3 = VI64(VTUP(x2)->cells[4]); + VTUP(x2)->cells[4] = MKI64(x1); + VAL v4 = mw_mirth_c99_ZPlusC99_c99Z_line_1_sp2(x2); + VTUP(v4)->cells[4] = MKI64(v3); + return v4; +} +static VAL mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp3 (VAL x1) { + int64_t v2 = VI64(VTUP(x1)->cells[4]); + VAL v3 = VVAL(VTUP(x1)->cells[1]); + int64_t v4 = VI64(VTUP(v3)->cells[4]); + VTUP(v3)->cells[4] = MKI64(v2); + VAL v5 = mw_mirth_c99_ZPlusC99_indent(v3); + STR* v6; + STRLIT(v6, "default: {", 10); + VAL v7 = mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5); + VAL v8 = mw_mirth_c99_ZPlusC99_line(v7); + VTUP(v8)->cells[4] = MKI64(v4); + VTUP(x1)->cells[1] = v8; + return x1; +} +static VAL mw_mirth_c99_ZPlusC99BranchSplit_c99Z_line_1_sp6 (VAL x1) { + int64_t v2 = VI64(VTUP(x1)->cells[4]); + VAL v3 = VVAL(VTUP(x1)->cells[1]); + int64_t v4 = VI64(VTUP(v3)->cells[4]); + VTUP(v3)->cells[4] = MKI64(v2); + VAL v5 = mw_mirth_c99_ZPlusC99_indent(v3); + STR* v6; + STRLIT(v6, "} break;", 8); + VAL v7 = mw_mirth_c99_ZPlusC99_put(MKSTR(v6), v5); + VAL v8 = mw_mirth_c99_ZPlusC99_line(v7); + VTUP(v8)->cells[4] = MKI64(v4); + VTUP(x1)->cells[1] = v8; + return x1; +} +static VAL mw_std_list_List_1_reverseZ_for_1_sp5 (VAL x1, VAL x2) { + VAL v3 = mw_std_list_List_1_reverse(x2); + int64_t v4 = 1LL /* True */; + VAL v5 = x1; + VAL v6 = v3; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL x12; + VAL x13; + int64_t x14; + switch (get_data_tag(v10)) { + case 1LL: { // Cons + VAL v15; + VAL v16; + mtp_std_list_List_1_Cons(v10, &v15, &v16); + VAL v17 = mw_mirth_c99_C99APIArg_popZ_toZ_reservedZBang(v15, v9); + int64_t v18 = 1LL /* True */; + x14 = v18; + x13 = v16; + x12 = v17; + } break; + case 0LL: { // Nil + VAL v19 = MKI64(0LL /* Nil */); + int64_t v20 = 0LL /* False */; + x14 = v20; + x13 = v19; + x12 = v9; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v8 = x14; + v7 = x14; + v6 = x13; + v5 = x12; + } + decref(v6); + return v5; +} +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp12 (uint64_t x1, VAL x2, int64_t *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); + VAL v6 = VVAL(VTUP(v5)->cells[7]); + VAL v7; + int64_t v8; + mw_mirth_data_Tag_preferZ_inlineZAsk(v6, x1, &v7, &v8); + VTUP(v5)->cells[7] = v7; + VTUP(x2)->cells[1] = v5; + *x4 = x2; + *x3 = v8; +} +static VAL mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp22 (VAL x1, VAL x2) { + int64_t v3 = VI64(VTUP(x2)->cells[3]); + VAL v4 = VVAL(VTUP(x2)->cells[1]); + int64_t v5 = VI64(VTUP(v4)->cells[4]); + VTUP(v4)->cells[4] = MKI64(v3); + VAL v6 = mw_mirth_c99_ZPlusC99_indent(v4); + VAL v7 = mw_mirth_c99_ZPlusC99_put(x1, v6); + STR* v8; + STRLIT(v8, ";", 1); + VAL v9 = mw_mirth_c99_ZPlusC99_put(MKSTR(v8), v7); + VAL v10 = mw_mirth_c99_ZPlusC99_line(v9); + VTUP(v10)->cells[4] = MKI64(v5); + VTUP(x2)->cells[1] = v10; + return x2; +} +static VAL mw_mirth_c99_pushZ_labelZ_expressionZBang_1_sp1 (VAL x1, int64_t x2, VAL x3, uint64_t x4) { + VAL v5; + VAL v6; + mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp10(x1, x3, x2, &v5, &v6); + int64_t v7 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(x4); + VAL x8; + if (((bool)v7)) { + VAL v9 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v6); + VAL v10 = mw_mirth_c99_pushZ_resourceZ_labelZBang(x4, v5, v9); + x8 = v10; + } else { + VAL v11 = mw_mirth_c99_pushZ_valueZ_labelZBang(x4, v5, v6); + x8 = v11; + } + return x8; +} +static void mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp10 (VAL x1, VAL x2, int64_t x3, VAL *x4, VAL *x5) { + VAL v6 = VVAL(VTUP(x2)->cells[1]); + VAL v7; + VAL v8; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v6, &v7, &v8); + VTUP(x2)->cells[1] = v8; + int64_t v9 = VI64(VTUP(x2)->cells[3]); + VAL v10 = VVAL(VTUP(x2)->cells[1]); + int64_t v11 = VI64(VTUP(v10)->cells[4]); + VTUP(v10)->cells[4] = MKI64(v9); + VAL v12 = mw_mirth_c99_ZPlusC99_indent(v10); + VAL v13 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x3); + VAL v14 = mw_mirth_c99_ZPlusC99_put(v13, v12); + STR* v15; + STRLIT(v15, " ", 1); + VAL v16 = mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14); + incref(v7); + VAL v17 = mw_mirth_c99_ZPlusC99_put(v7, v16); + STR* v18; + STRLIT(v18, " = ", 3); + VAL v19 = mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17); + VAL v20 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(x3, v7); + VAL v21 = mw_mirth_c99_ZPlusC99_put(x1, v19); + STR* v22; + STRLIT(v22, ";", 1); + VAL v23 = mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v21); + VAL v24 = mw_mirth_c99_ZPlusC99_line(v23); + VTUP(v24)->cells[4] = MKI64(v11); + VTUP(x2)->cells[1] = v24; + *x5 = v20; + *x4 = x2; +} +static void mw_std_maybe_Maybe_1_filter_1_sp1 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL x5; + VAL x6; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v7 = mtp_std_maybe_Maybe_1_Some(x2); + incref(v7); + incref(x1); + int64_t v8 = mw_mirth_type_Type_hasZ_varZAsk(VU64(v7), x1); + bool v9 = !((bool)v8); + VAL x10; + VAL x11; + if (v9) { + VAL v12 = mtw_std_maybe_Maybe_1_Some(v7); + x11 = v12; + x10 = x1; + } else { + decref(v7); + VAL v13 = MKI64(0LL /* None */); + x11 = v13; + x10 = x1; + } + x6 = x11; + x5 = x10; + } break; + case 0LL: { // None + VAL v14 = MKI64(0LL /* None */); + x6 = v14; + x5 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x4 = x6; + *x3 = x5; +} +static void mw_std_maybe_Maybe_1_filter_1_sp2 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL x5; + VAL x6; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v7 = mtp_std_maybe_Maybe_1_Some(x2); + incref(v7); + incref(x1); + int64_t v8 = mw_mirth_type_Resource_hasZ_varZAsk(VU64(v7), x1); + bool v9 = !((bool)v8); + VAL x10; + VAL x11; + if (v9) { + VAL v12 = mtw_std_maybe_Maybe_1_Some(v7); + x11 = v12; + x10 = x1; + } else { + decref(v7); + VAL v13 = MKI64(0LL /* None */); + x11 = v13; + x10 = x1; + } + x6 = x11; + x5 = x10; + } break; + case 0LL: { // None + VAL v14 = MKI64(0LL /* None */); + x6 = v14; + x5 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x4 = x6; + *x3 = x5; +} +static void mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp11 (int64_t x1, VAL x2, VAL x3, int64_t x4, VAL *x5, int64_t *x6, VAL *x7, VAL *x8) { + VAL v9 = VVAL(VTUP(x3)->cells[1]); + VAL v10; + VAL v11; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v9, &v10, &v11); + VTUP(x3)->cells[1] = v11; + int64_t v12 = VI64(VTUP(x3)->cells[3]); + VAL v13 = VVAL(VTUP(x3)->cells[1]); + int64_t v14 = VI64(VTUP(v13)->cells[4]); + VTUP(v13)->cells[4] = MKI64(v12); + VAL v15 = mw_mirth_c99_ZPlusC99_indent(v13); + VAL v16 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x4); + VAL v17 = mw_mirth_c99_ZPlusC99_put(v16, v15); + STR* v18; + STRLIT(v18, " ", 1); + VAL v19 = mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17); + incref(v10); + VAL v20 = mw_mirth_c99_ZPlusC99_put(v10, v19); + STR* v21; + STRLIT(v21, " = ", 3); + VAL v22 = mw_mirth_c99_ZPlusC99_put(MKSTR(v21), v20); + VAL v23 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(x4, v10); + incref(x2); + VAL v24 = mw_mirth_c99_ZPlusC99_put(x2, v22); + STR* v25; + STRLIT(v25, "->cells[", 8); + VAL v26 = mw_mirth_c99_ZPlusC99_put(MKSTR(v25), v24); + STR* v27 = i64_show(x1); + VAL v28 = mw_mirth_c99_ZPlusC99_put(MKSTR(v27), v26); + STR* v29; + STRLIT(v29, "]", 1); + VAL v30 = mw_mirth_c99_ZPlusC99_put(MKSTR(v29), v28); + STR* v31; + STRLIT(v31, ";", 1); + VAL v32 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + VAL v33 = mw_mirth_c99_ZPlusC99_line(v32); + VTUP(v33)->cells[4] = MKI64(v14); + VTUP(x3)->cells[1] = v33; + *x8 = v23; + *x7 = x3; + *x6 = x1; + *x5 = x2; +} +static VAL mw_std_str_Str_1_sp14 (VAL x1) { + STR* v2; + STRLIT(v2, "", 0); + STR* v3; + STRLIT(v3, "get_data_tag(", 13); + VAL v4 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v3), MKSTR(v2)); + VAL v5 = mw_std_str_ZPlusStr_pushZ_strZBang(x1, v4); + STR* v6; + STRLIT(v6, ")", 1); + VAL v7 = mw_std_str_ZPlusStr_pushZ_strZBang(MKSTR(v6), v5); + return v7; +} +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp13 (uint64_t x1, VAL x2, VAL x3) { + VAL v4 = VVAL(VTUP(x3)->cells[1]); + VAL v5 = VVAL(VTUP(v4)->cells[7]); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x1, x2, v5); +} +static void mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp22 (VAL x1, VAL x2, int64_t x3, VAL *x4, VAL *x5) { + VAL v6 = VVAL(VTUP(x2)->cells[1]); + VAL v7; + VAL v8; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v6, &v7, &v8); + VTUP(x2)->cells[1] = v8; + int64_t v9 = VI64(VTUP(x2)->cells[3]); + VAL v10 = VVAL(VTUP(x2)->cells[1]); + int64_t v11 = VI64(VTUP(v10)->cells[4]); + VTUP(v10)->cells[4] = MKI64(v9); + VAL v12 = mw_mirth_c99_ZPlusC99_indent(v10); + VAL v13 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x3); + VAL v14 = mw_mirth_c99_ZPlusC99_put(v13, v12); + STR* v15; + STRLIT(v15, " ", 1); + VAL v16 = mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14); + incref(v7); + VAL v17 = mw_mirth_c99_ZPlusC99_put(v7, v16); + STR* v18; + STRLIT(v18, " = ", 3); + VAL v19 = mw_mirth_c99_ZPlusC99_put(MKSTR(v18), v17); + VAL v20 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(x3, v7); + VAL v21 = mw_mirth_c99_ZPlusC99Value_consume(x1); + VAL v22 = mw_mirth_c99_ZPlusC99_put(v21, v19); + STR* v23; + STRLIT(v23, ";", 1); + VAL v24 = mw_mirth_c99_ZPlusC99_put(MKSTR(v23), v22); + VAL v25 = mw_mirth_c99_ZPlusC99_line(v24); + VTUP(v25)->cells[4] = MKI64(v11); + VTUP(x2)->cells[1] = v25; + *x5 = v20; + *x4 = x2; +} +static void mw_mirth_c99_ZPlusC99Branch_c99Z_line_1_sp58 (VAL x1, int64_t x2, VAL x3, VAL x4, VAL *x5, int64_t *x6, VAL *x7) { + int64_t v8 = VI64(VTUP(x4)->cells[3]); + VAL v9 = VVAL(VTUP(x4)->cells[1]); + int64_t v10 = VI64(VTUP(v9)->cells[4]); + VTUP(v9)->cells[4] = MKI64(v8); + VAL v11 = mw_mirth_c99_ZPlusC99_indent(v9); + incref(x3); + VAL v12 = mw_mirth_c99_ZPlusC99_put(x3, v11); + STR* v13; + STRLIT(v13, "->cells[", 8); + VAL v14 = mw_mirth_c99_ZPlusC99_put(MKSTR(v13), v12); + STR* v15 = i64_show(x2); + VAL v16 = mw_mirth_c99_ZPlusC99_put(MKSTR(v15), v14); + STR* v17; + STRLIT(v17, "] = ", 4); + VAL v18 = mw_mirth_c99_ZPlusC99_put(MKSTR(v17), v16); + VAL v19 = mw_mirth_c99_ZPlusC99_put(x1, v18); + STR* v20; + STRLIT(v20, ";", 1); + VAL v21 = mw_mirth_c99_ZPlusC99_put(MKSTR(v20), v19); + VAL v22 = mw_mirth_c99_ZPlusC99_line(v21); + VTUP(v22)->cells[4] = MKI64(v10); + VTUP(x4)->cells[1] = v22; + *x7 = x4; + *x6 = x2; + *x5 = x3; +} +static void mw_mirth_c99_ZPlusC99Branch_ZPlusmirth_1_sp15 (uint64_t x1, VAL x2, VAL *x3, VAL *x4) { + VAL v5 = VVAL(VTUP(x2)->cells[1]); + VAL v6 = VVAL(VTUP(v5)->cells[7]); + VAL v7; + VAL v8; + mw_mirth_word_Word_arrow(x1, v6, &v7, &v8); + VTUP(v5)->cells[7] = v8; + VTUP(x2)->cells[1] = v5; + *x4 = x2; + *x3 = v7; +} +static void mw_mirth_c99_ZPlusC99_c99Z_line_1_sp90 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL v5 = mw_mirth_c99_ZPlusC99_indent(x2); + incref(x1); + VAL v6 = mw_mirth_c99_ZPlusC99_smartZ_sigZ_put(x1, v5); + STR* v7; + STRLIT(v7, " {", 2); + VAL v8 = mw_mirth_c99_ZPlusC99_put(MKSTR(v7), v6); + VAL v9 = mw_mirth_c99_ZPlusC99_line(v8); + *x4 = v9; + *x3 = x1; +} +static VAL mw_mirth_c99_pushZ_labelZ_expressionZBang_1_sp5 (VAL x1, int64_t x2, int64_t x3, VAL x4, uint64_t x5) { + VAL v6; + VAL v7; + mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp30(x1, x2, x4, x3, &v6, &v7); + int64_t v8 = mw_mirth_label_Label_isZ_resourceZ_labelZAsk(x5); + VAL x9; + if (((bool)v8)) { + VAL v10 = mw_mirth_c99_ZPlusC99Value_turnZ_intoZ_resourceZBang(v7); + VAL v11 = mw_mirth_c99_pushZ_resourceZ_labelZBang(x5, v6, v10); + x9 = v11; + } else { + VAL v12 = mw_mirth_c99_pushZ_valueZ_labelZBang(x5, v6, v7); + x9 = v12; + } + return x9; +} +static void mw_mirth_c99_C99ReprType_valueZ_expressionZBang_1_sp30 (VAL x1, int64_t x2, VAL x3, int64_t x4, VAL *x5, VAL *x6) { + VAL v7 = VVAL(VTUP(x3)->cells[1]); + VAL v8; + VAL v9; + mw_mirth_c99_ZPlusC99_freshZ_nameZBang(v7, &v8, &v9); + VTUP(x3)->cells[1] = v9; + int64_t v10 = VI64(VTUP(x3)->cells[3]); + VAL v11 = VVAL(VTUP(x3)->cells[1]); + int64_t v12 = VI64(VTUP(v11)->cells[4]); + VTUP(v11)->cells[4] = MKI64(v10); + VAL v13 = mw_mirth_c99_ZPlusC99_indent(v11); + VAL v14 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x4); + VAL v15 = mw_mirth_c99_ZPlusC99_put(v14, v13); + STR* v16; + STRLIT(v16, " ", 1); + VAL v17 = mw_mirth_c99_ZPlusC99_put(MKSTR(v16), v15); + incref(v8); + VAL v18 = mw_mirth_c99_ZPlusC99_put(v8, v17); + STR* v19; + STRLIT(v19, " = ", 3); + VAL v20 = mw_mirth_c99_ZPlusC99_put(MKSTR(v19), v18); + VAL v21 = mtw_mirth_c99_ZPlusC99Value_ZPlusC99Value(x4, v8); + STR* v22; + STRLIT(v22, "(", 1); + VAL v23 = mw_mirth_c99_ZPlusC99_put(MKSTR(v22), v20); + VAL v24 = mw_mirth_c99_C99ReprType_underlyingZ_c99Z_type(x2); + VAL v25 = mw_mirth_c99_ZPlusC99_put(v24, v23); + STR* v26; + STRLIT(v26, ")(", 2); + VAL v27 = mw_mirth_c99_ZPlusC99_put(MKSTR(v26), v25); + VAL v28 = mw_mirth_c99_ZPlusC99_put(x1, v27); + STR* v29; + STRLIT(v29, ")", 1); + VAL v30 = mw_mirth_c99_ZPlusC99_put(MKSTR(v29), v28); + STR* v31; + STRLIT(v31, ";", 1); + VAL v32 = mw_mirth_c99_ZPlusC99_put(MKSTR(v31), v30); + VAL v33 = mw_mirth_c99_ZPlusC99_line(v32); + VTUP(v33)->cells[4] = MKI64(v12); + VTUP(x3)->cells[1] = v33; + *x6 = v21; + *x5 = x3; +} +static VAL mw_std_maybe_Maybe_1_for_1_sp5 (VAL x1, VAL x2) { + VAL x3; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v4 = mtp_std_maybe_Maybe_1_Some(x2); + VAL v5 = mtw_std_list_List_1_Cons(v4, x1); + x3 = v5; + } break; + case 0LL: { // None + x3 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x3; +} +static void mw_std_file_ZPlusFileZAsk_unwrapZBang_1_sp1 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL x5; + VAL x6; + switch (get_data_tag(x2)) { + case 0LL: { // +FileOk + VAL v7 = mtp_std_file_ZPlusFileZAsk_ZPlusFileOk(x2); + x6 = v7; + x5 = x1; + } break; + case 1LL: { // +FileErr + VAL v8 = mtp_std_file_ZPlusFileZAsk_ZPlusFileErr(x2); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(v8, x1); + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x4 = x6; + *x3 = x5; +} +static VAL mw_std_list_List_1_for_1_sp46 (VAL x1, VAL x2) { + int64_t v3 = 1LL /* True */; + VAL v4 = x1; + VAL v5 = x2; + int64_t v6 = v3; + int64_t v7 = v3; + while (((bool)v7)) { + VAL v8 = v4; + VAL v9 = v5; + int64_t v10 = v6; + VAL x11; + VAL x12; + int64_t x13; + switch (get_data_tag(v9)) { + case 1LL: { // Cons + VAL v14; + VAL v15; + mtp_std_list_List_1_Cons(v9, &v14, &v15); + VAL v16 = mtw_std_list_List_1_Cons(v14, v8); + int64_t v17 = 1LL /* True */; + x13 = v17; + x12 = v15; + x11 = v16; + } break; + case 0LL: { // Nil + VAL v18 = MKI64(0LL /* Nil */); + int64_t v19 = 0LL /* False */; + x13 = v19; + x12 = v18; + x11 = v8; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v7 = x13; + v6 = x13; + v5 = x12; + v4 = x11; + } + decref(v5); + return v4; +} +static void mw_mirth_elab_abZ_buildZ_homZBang_1_sp1 (uint64_t x1, VAL x2, VAL x3, VAL x4, uint64_t x5, VAL x6, VAL *x7, VAL *x8) { + VAL v9; + VAL v10; + mw_mirth_type_ArrowType_unpack(x4, &v9, &v10); + incref(v9); + VAL v11 = MKI64(0LL /* Nil */); + VAL v12 = mtw_mirth_arrow_Arrow_Arrow(x6, x5, x5, x3, v9, v9, v11); + VAL v13; + VAL v14; + mw_mirth_elab_abZ_wordZBang(x1, x2, v12, &v13, &v14); + VAL v15; + VAL v16; + mw_mirth_elab_abZ_unifyZ_typeZBang(v10, v13, v14, &v15, &v16); + *x8 = v16; + *x7 = v15; +} +static void mw_mirth_elab_ZPlusAB_gamma_1_sp1 (VAL x1, VAL x2, VAL x3, VAL x4, VAL *x5, VAL *x6, VAL *x7) { + VAL v8; + uint64_t v9; + mw_mirth_elab_abZ_tokenZAt(x4, &v8, &v9); + VAL v10; + uint64_t v11; + VAL v12; + mw_mirth_type_StackType_unifyZBang(x1, v9, x2, x3, &v10, &v11, &v12); + mw_mirth_type_ZPlusGamma_rdrop(v11); + *x7 = v8; + *x6 = v12; + *x5 = v10; +} +static void mw_std_maybe_Maybe_1_filter_1_sp3 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL x5; + VAL x6; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v7 = mtp_std_maybe_Maybe_1_Some(x2); + incref(v7); + incref(x1); + int64_t v8 = mw_mirth_type_Type_hasZ_metaZAsk(VU64(v7), x1); + bool v9 = !((bool)v8); + VAL x10; + VAL x11; + if (v9) { + VAL v12 = mtw_std_maybe_Maybe_1_Some(v7); + x11 = v12; + x10 = x1; + } else { + decref(v7); + VAL v13 = MKI64(0LL /* None */); + x11 = v13; + x10 = x1; + } + x6 = x11; + x5 = x10; + } break; + case 0LL: { // None + VAL v14 = MKI64(0LL /* None */); + x6 = v14; + x5 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x4 = x6; + *x3 = x5; +} +static void mw_std_maybe_Maybe_1_filter_1_sp4 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL x5; + VAL x6; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v7 = mtp_std_maybe_Maybe_1_Some(x2); + incref(v7); + incref(x1); + int64_t v8 = mw_mirth_type_Resource_hasZ_metaZAsk(VU64(v7), x1); + bool v9 = !((bool)v8); + VAL x10; + VAL x11; + if (v9) { + VAL v12 = mtw_std_maybe_Maybe_1_Some(v7); + x11 = v12; + x10 = x1; + } else { + decref(v7); + VAL v13 = MKI64(0LL /* None */); + x11 = v13; + x10 = x1; + } + x6 = x11; + x5 = x10; + } break; + case 0LL: { // None + VAL v14 = MKI64(0LL /* None */); + x6 = v14; + x5 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x4 = x6; + *x3 = x5; +} +static VAL mw_std_maybe_Maybe_1_map_1_sp10 (VAL x1) { + VAL x2; + switch (get_data_tag(x1)) { + case 1LL: { // Some + VAL v3 = mtp_std_maybe_Maybe_1_Some(x1); + VAL v4 = VVAL(VTUP(v3)->cells[2]); + incref(v4); + decref(v3); + VAL v5 = mtw_std_maybe_Maybe_1_Some(v4); + x2 = v5; + } break; + case 0LL: { // None + VAL v6 = MKI64(0LL /* None */); + x2 = v6; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x2; +} +static void mw_std_list_List_1_reverseZ_for_1_sp9 (VAL x1, VAL x2, VAL x3, VAL x4, VAL x5, VAL *x6, VAL *x7, VAL *x8, VAL *x9) { + VAL v10 = mw_std_list_List_1_reverse(x5); + int64_t v11 = 1LL /* True */; + VAL v12 = x1; + VAL v13 = x2; + VAL v14 = x3; + VAL v15 = x4; + VAL v16 = v10; + int64_t v17 = v11; + int64_t v18 = v11; + while (((bool)v18)) { + VAL v19 = v12; + VAL v20 = v13; + VAL v21 = v14; + VAL v22 = v15; + VAL v23 = v16; + int64_t v24 = v17; + VAL x25; + VAL x26; + VAL x27; + VAL x28; + VAL x29; + int64_t x30; + switch (get_data_tag(v23)) { + case 1LL: { // Cons + VAL v31; + VAL v32; + mtp_std_list_List_1_Cons(v23, &v31, &v32); + incref(v31); + VAL v33 = mw_mirth_var_Ctx_new(v21, VU64(v31)); + VAL v34; + uint64_t v35; + mw_mirth_elab_abZ_tokenZAt(v20, &v34, &v35); + VAL v36; + VAL v37; + VAL v38; + uint64_t v39; + mw_mirth_elab_elabZ_expandZ_tensorZBang(v19, v22, v35, &v36, &v37, &v38, &v39); + VAL v40 = mw_mirth_var_Var_type(VU64(v31)); + VAL v41; + VAL v42; + uint64_t v43; + mw_mirth_elab_elabZ_typeZ_unifyZBang(v36, v38, v40, v39, &v41, &v42, &v43); + decref(v42); + int64_t v44 = 1LL /* True */; + x30 = v44; + x29 = v32; + x28 = v34; + x27 = v41; + x26 = v37; + x25 = v33; + } break; + case 0LL: { // Nil + VAL v45 = MKI64(0LL /* Nil */); + int64_t v46 = 0LL /* False */; + x30 = v46; + x29 = v45; + x28 = v20; + x27 = v19; + x26 = v22; + x25 = v21; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v18 = x30; + v17 = x30; + v16 = x29; + v15 = x26; + v14 = x25; + v13 = x28; + v12 = x27; + } + decref(v16); + *x9 = v15; + *x8 = v14; + *x7 = v13; + *x6 = v12; +} +static VAL mw_std_maybe_Maybe_1_bind_1_sp5 (VAL x1) { + VAL x2; + switch (get_data_tag(x1)) { + case 1LL: { // Some + VAL v3 = mtp_std_maybe_Maybe_1_Some(x1); + VAL v4 = mw_mirth_mirth_Prop_1_readyZAsk(v3); + x2 = v4; + } break; + case 0LL: { // None + VAL v5 = MKI64(0LL /* None */); + x2 = v5; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x2; +} +static void mw_std_list_List_1_ZEqualZEqual_1_sp1 (VAL x1, VAL x2, VAL x3, VAL *x4, int64_t *x5) { + int64_t v6 = 1LL /* True */; + VAL v7; + VAL v8; + mw_std_list_List_1_uncons(x2, &v7, &v8); + VAL v9; + VAL v10; + mw_std_list_List_1_uncons(x3, &v9, &v10); + VAL x11; + int64_t x12; + switch (get_data_tag(v9)) { + case 0LL: { // None + int64_t v13 = get_data_tag(v7); + decref(v7); + int64_t v14 = 0LL; + bool v15 = (v13 == v14); + x12 = ((int64_t)v15); + x11 = x1; + } break; + case 1LL: { // Some + VAL v16 = mtp_std_maybe_Maybe_1_Some(v9); + VAL x17; + int64_t x18; + switch (get_data_tag(v7)) { + case 1LL: { // Some + VAL v19 = mtp_std_maybe_Maybe_1_Some(v7); + VAL v20; + int64_t v21; + mw_mirth_arrow_Arg_similar(x1, VU64(v19), VU64(v16), &v20, &v21); + x18 = v21; + x17 = v20; + } break; + case 0LL: { // None + decref(v16); + int64_t v22 = 0LL /* False */; + x18 = v22; + x17 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + x12 = x18; + x11 = x17; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + bool v23 = (((bool)x12) && ((bool)v6)); + incref(v8); + int64_t v24 = mw_std_list_List_1_emptyZAsk(v8); + incref(v10); + int64_t v25 = mw_std_list_List_1_emptyZAsk(v10); + bool v26 = (((bool)v24) && ((bool)v25)); + bool v27 = !v26; + bool v28 = (v27 && v23); + VAL v29 = x11; + VAL v30 = v8; + VAL v31 = v10; + bool v32 = v23; + bool v33 = v28; + while (v33) { + VAL v34 = v29; + VAL v35 = v30; + VAL v36 = v31; + bool v37 = v32; + VAL v38; + VAL v39; + mw_std_list_List_1_uncons(v35, &v38, &v39); + VAL v40; + VAL v41; + mw_std_list_List_1_uncons(v36, &v40, &v41); + VAL x42; + int64_t x43; + switch (get_data_tag(v40)) { + case 0LL: { // None + int64_t v44 = get_data_tag(v38); + decref(v38); + int64_t v45 = 0LL; + bool v46 = (v44 == v45); + x43 = ((int64_t)v46); + x42 = v34; + } break; + case 1LL: { // Some + VAL v47 = mtp_std_maybe_Maybe_1_Some(v40); + VAL x48; + int64_t x49; + switch (get_data_tag(v38)) { + case 1LL: { // Some + VAL v50 = mtp_std_maybe_Maybe_1_Some(v38); + VAL v51; + int64_t v52; + mw_mirth_arrow_Arg_similar(v34, VU64(v50), VU64(v47), &v51, &v52); + x49 = v52; + x48 = v51; + } break; + case 0LL: { // None + decref(v47); + int64_t v53 = 0LL /* False */; + x49 = v53; + x48 = v34; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + x43 = x49; + x42 = x48; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + bool v54 = (((bool)x43) && v37); + incref(v39); + int64_t v55 = mw_std_list_List_1_emptyZAsk(v39); + incref(v41); + int64_t v56 = mw_std_list_List_1_emptyZAsk(v41); + bool v57 = (((bool)v55) && ((bool)v56)); + bool v58 = !v57; + bool v59 = (v58 && v54); + v33 = v59; + v32 = v54; + v31 = v41; + v30 = v39; + v29 = x42; + } + decref(v31); + decref(v30); + *x5 = ((int64_t)v32); + *x4 = v29; +} +static VAL mw_std_list_List_1_for_1_sp60 (VAL x1, VAL x2) { + int64_t v3 = 1LL /* True */; + VAL v4 = x1; + VAL v5 = x2; + int64_t v6 = v3; + int64_t v7 = v3; + while (((bool)v7)) { + VAL v8 = v4; + VAL v9 = v5; + int64_t v10 = v6; + VAL x11; + VAL x12; + int64_t x13; + switch (get_data_tag(v9)) { + case 1LL: { // Cons + VAL v14; + VAL v15; + mtp_std_list_List_1_Cons(v9, &v14, &v15); + VAL v16 = mw_mirth_specializzer_ZPlusSPCheck_checkZ_argZBang(VU64(v14), v8); + int64_t v17 = 1LL /* True */; + x13 = v17; + x12 = v15; + x11 = v16; + } break; + case 0LL: { // Nil + VAL v18 = MKI64(0LL /* Nil */); + int64_t v19 = 0LL /* False */; + x13 = v19; + x12 = v18; + x11 = v8; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v7 = x13; + v6 = x13; + v5 = x12; + v4 = x11; + } + decref(v5); + return v4; +} +static void mw_std_maybe_Maybe_1_bind_1_sp7 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL x5; + VAL x6; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v7 = mtp_std_maybe_Maybe_1_Some(x2); + VAL v8; + VAL v9; + mw_mirth_def_Def_asZ_namespaceZAsk(x1, v7, &v8, &v9); + x6 = v9; + x5 = v8; + } break; + case 0LL: { // None + VAL v10 = MKI64(0LL /* None */); + x6 = v10; + x5 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x4 = x6; + *x3 = x5; +} +static void mw_std_list_List_1_for_1_sp63 (VAL x1, VAL x2, VAL x3, VAL x4, VAL x5, VAL *x6, VAL *x7, VAL *x8, VAL *x9) { + int64_t v10 = 1LL /* True */; + VAL v11 = x1; + VAL v12 = x2; + VAL v13 = x3; + VAL v14 = x4; + VAL v15 = x5; + int64_t v16 = v10; + int64_t v17 = v10; + while (((bool)v17)) { + VAL v18 = v11; + VAL v19 = v12; + VAL v20 = v13; + VAL v21 = v14; + VAL v22 = v15; + int64_t v23 = v16; + VAL x24; + VAL x25; + VAL x26; + VAL x27; + VAL x28; + int64_t x29; + switch (get_data_tag(v22)) { + case 1LL: { // Cons + VAL v30; + VAL v31; + mtp_std_list_List_1_Cons(v22, &v30, &v31); + VAL v32 = mw_std_str_ZPlusStr_pushZ_strZBang(v21, v20); + VAL v33; + VAL v34; + mw_mirth_def_Def_qnameZ_hard(v18, v30, &v33, &v34); + VAL v35; + VAL v36; + mw_mirth_name_QName_ZToStr(v33, v34, &v35, &v36); + VAL v37 = mw_std_str_ZPlusStr_pushZ_strZBang(v36, v32); + STR* v38; + STRLIT(v38, ", ", 2); + int64_t v39 = 1LL /* True */; + x29 = v39; + x28 = v31; + x27 = MKSTR(v38); + x26 = v37; + x25 = v19; + x24 = v35; + } break; + case 0LL: { // Nil + VAL v40 = MKI64(0LL /* Nil */); + int64_t v41 = 0LL /* False */; + x29 = v41; + x28 = v40; + x27 = v21; + x26 = v20; + x25 = v19; + x24 = v18; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v17 = x29; + v16 = x29; + v15 = x28; + v14 = x27; + v13 = x26; + v12 = x25; + v11 = x24; + } + decref(v15); + *x9 = v14; + *x8 = v13; + *x7 = v12; + *x6 = v11; +} +static int64_t mw_std_list_List_1_member_1_sp4 (VAL x1, VAL x2) { + VAL v3 = MKI64(0LL /* None */); + int64_t v4 = 1LL /* True */; + VAL v5 = x1; + VAL v6 = v3; + VAL v7 = x2; + int64_t v8 = v4; + int64_t v9 = v4; + while (((bool)v9)) { + VAL v10 = v5; + VAL v11 = v6; + VAL v12 = v7; + int64_t v13 = v8; + VAL v14; + VAL v15; + mw_std_list_List_1_uncons(v12, &v14, &v15); + VAL x16; + VAL x17; + VAL x18; + int64_t x19; + switch (get_data_tag(v14)) { case 1LL: { // Some - VAL v113 = mtp_std_maybe_Maybe_1_Some(v108); - VAL v114 = mtw_std_list_List_1_Cons(v113, v106); - x112 = v114; - x111 = v107; - x110 = x79; - x109 = x77; + VAL v20 = mtp_std_maybe_Maybe_1_Some(v14); + incref(v20); + incref(v10); + int64_t v21 = mw_mirth_name_Namespace_ZEqualZEqual(v10, v20); + VAL x22; + VAL x23; + if (((bool)v21)) { + VAL v24 = mtw_std_maybe_Maybe_1_Some(v20); + x23 = v24; + x22 = v10; + } else { + decref(v20); + VAL v25 = MKI64(0LL /* None */); + x23 = v25; + x22 = v10; + } + VAL x26; + VAL x27; + VAL x28; + switch (get_data_tag(x23)) { + case 0LL: { // None + x28 = v15; + x27 = v11; + x26 = x22; + } break; + default: { + decref(v15); + decref(v11); + VAL v29 = MKI64(0LL /* Nil */); + x28 = v29; + x27 = x23; + x26 = x22; + } break; + } + int64_t v30 = 1LL /* True */; + x19 = v30; + x18 = x28; + x17 = x27; + x16 = x26; } break; case 0LL: { // None - x112 = v106; - x111 = v107; - x110 = x79; - x109 = x77; + int64_t v31 = 0LL /* False */; + x19 = v31; + x18 = v15; + x17 = v11; + x16 = v10; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v115 = mw_std_list_List_1_reverse(x112); - VAL v116 = tup_replace(x110, 5, v115); - x102 = v116; - x101 = x111; - x100 = x109; - } else { - x102 = x79; - x101 = x78; - x100 = x77; + v9 = x19; + v8 = x19; + v7 = x18; + v6 = x17; + v5 = x16; } - int64_t v117; - VAL v118; - mw_mirth_main_compileZBang(x102, x100, x101, &v117, &v118); - mw_mirth_mirth_ZPlusMirth_rdrop(v118); - return v117; -} -static void mb_mirth_main_main_1 (void) { - VAL v0 = pop_value(); - VAL v1 = pop_value(); - VAL v2 = pop_value(); - VAL r3 = pop_resource(); - VAL v4; - VAL v5; - mw_mirth_main_compilerZ_parseZ_args(r3, v2, v1, v0, &v4, &v5); - push_resource(v4); - push_value(v5); + decref(v7); + decref(v5); + int64_t v32 = get_data_tag(v6); + decref(v6); + int64_t v33 = 1LL; + bool v34 = (v32 == v33); + return ((int64_t)v34); +} +static VAL mw_std_list_List_1_for_1_sp80 (VAL x1, VAL x2) { + int64_t v3 = 1LL /* True */; + VAL v4 = x1; + VAL v5 = x2; + int64_t v6 = v3; + int64_t v7 = v3; + while (((bool)v7)) { + VAL v8 = v4; + VAL v9 = v5; + int64_t v10 = v6; + VAL x11; + VAL x12; + int64_t x13; + switch (get_data_tag(v9)) { + case 1LL: { // Cons + VAL v14; + VAL v15; + mtp_std_list_List_1_Cons(v9, &v14, &v15); + VAL v16 = mw_mirth_type_TZMul(v8, v14); + int64_t v17 = 1LL /* True */; + x13 = v17; + x12 = v15; + x11 = v16; + } break; + case 0LL: { // Nil + VAL v18 = MKI64(0LL /* Nil */); + int64_t v19 = 0LL /* False */; + x13 = v19; + x12 = v18; + x11 = v8; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + v7 = x13; + v6 = x13; + v5 = x12; + v4 = x11; + } + decref(v5); + return v4; } -static void mb_mirth_elab_elabZ_blockZ_atZBang_1 (void) { - uint64_t v0 = pop_u64(); - VAL r1 = pop_resource(); - VAL v2 = mw_mirth_arrow_Block_ctx(v0); - VAL v3 = mw_mirth_arrow_Block_dom(v0); - VAL v4 = mw_mirth_arrow_Block_cod(v0); - uint64_t v5 = mw_mirth_arrow_Block_token(v0); - VAL v6 = mw_mirth_arrow_Block_home(v0); - VAL v7; - VAL v8; - mw_mirth_elab_elabZ_arrowZ_homZBang(r1, v2, v3, v4, v5, v6, &v7, &v8); - push_resource(v7); - push_value(v8); +static int64_t mw_std_maybe_Maybe_1_has_1_sp8 (VAL x1) { + int64_t x2; + switch (get_data_tag(x1)) { + case 1LL: { // Some + VAL v3 = mtp_std_maybe_Maybe_1_Some(x1); + int64_t v4 = mw_mirth_name_Name_couldZ_beZ_constructor(VU64(v3)); + x2 = v4; + } break; + case 0LL: { // None + int64_t v5 = 0LL /* False */; + x2 = v5; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x2; } -static void mb_mirth_elab_elabZ_defZBang_0 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); - VAL v2 = mw_mirth_word_Word_sigZAsk(v1); - VAL x3; - VAL x4; - switch (get_data_tag(v2)) { +static VAL mw_std_maybe_Maybe_1_filter_1_sp12 (VAL x1) { + VAL x2; + switch (get_data_tag(x1)) { case 1LL: { // Some - VAL v5 = mtp_std_maybe_Maybe_1_Some(v2); - VAL v6 = (mw_mirth_elab_ZPlusTypeElab_typeZ_sigZ_startZBang(VU64(v5))); - VAL v7; - VAL v8; - VAL v9; - mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZBang(r0, v6, &v7, &v8, &v9); - VAL v10 = VVAL(VTUP(v8)->cells[1]); - incref(v10); - VAL v11 = MKNIL; - VAL v12 = mkcons(v11, v10); - VAL v13 = mkcons(v12, v9); - mw_mirth_elab_ZPlusTypeElab_rdrop(v8); - x4 = v13; - x3 = v7; + VAL v3 = mtp_std_maybe_Maybe_1_Some(x1); + incref(v3); + int64_t v4 = mw_mirth_name_Name_couldZ_beZ_constructor(VU64(v3)); + VAL x5; + if (((bool)v4)) { + VAL v6 = mtw_std_maybe_Maybe_1_Some(v3); + x5 = v6; + } else { + decref(v3); + VAL v7 = MKI64(0LL /* None */); + x5 = v7; + } + x2 = x5; } break; case 0LL: { // None - VAL v14; - VAL v15; - mw_mirth_word_Word_arrow(v1, r0, &v14, &v15); - VAL v16; - VAL v17; - mw_mirth_arrow_Arrow_ctxZ_type(v14, &v16, &v17); - VAL v18 = MKNIL; - VAL v19 = mkcons(v18, v16); - VAL v20 = mkcons(v19, v17); - x4 = v20; - x3 = v15; + VAL v8 = MKI64(0LL /* None */); + x2 = v8; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - push_resource(x3); - push_value(x4); + return x2; } -static void mb_mirth_elab_elabZ_defZBang_2 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); - VAL v2; - VAL v3; - mw_mirth_elab_elabZ_defZ_paramsZBang(r0, v1, &v2, &v3); - push_resource(v2); - push_value(v3); +static VAL mw_mirth_mirth_PropLabel_prop_1_sp15 (uint64_t x1, VAL x2) { + FNPTR v3 = &mb_mirth_mirth_PropLabel_prop_1_sp15_0; + VAL v4 = mtw_mirth_mirth_PropState_1_PSDelay(MKU64(x1), MKFNPTR(v3)); + VAL v5 = mtw_mirth_mirth_Prop_1_Prop(x2, v4); + return v5; } -static void mb_mirth_elab_elabZ_defZBang_3 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); - VAL v2; - VAL v3; - VAL v4; - uint64_t v5; - VAL v6; - uint64_t v7; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(r0, v1, &v2, &v3, &v4, &v5, &v6, &v7); +static void mw_mirth_elab_abZ_buildZ_wordZBang_1_sp6 (uint64_t x1, VAL x2, uint64_t x3, uint64_t *x4, VAL *x5, uint64_t *x6) { + VAL v7; VAL v8; VAL v9; - mw_mirth_type_ArrowType_unpack(v4, &v8, &v9); - incref(v8); - VAL v10 = MKI64(0LL /* Nil */); - VAL v11 = mtw_mirth_arrow_Arrow_Arrow(v6, v5, v5, v3, v8, v8, v10); - VAL v12; + uint64_t v10; + VAL v11; + uint64_t v12; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(x2, x3, &v7, &v8, &v9, &v10, &v11, &v12); VAL v13; - mw_mirth_word_Word_params(v1, v2, &v12, &v13); - incref(v12); - int64_t v14 = mw_std_list_List_1_emptyZAsk(v12); - uint64_t x15; - VAL x16; - VAL x17; - VAL x18; - if (((bool)v14)) { - decref(v12); - VAL v19; - VAL v20; - VAL v21; - mw_mirth_elab_elabZ_defZ_bodyZBang(v9, v13, v11, &v19, &v20, &v21); - x18 = v21; - x17 = v20; - x16 = v19; - x15 = v1; - } else { - VAL v22; - uint64_t v23; - mw_mirth_elab_abZ_tokenZAt(v11, &v22, &v23); - incref(v12); - VAL v24; - VAL v25; - mw_mirth_elab_abZ_ctxZAt(v22, &v24, &v25); - VAL v26; - VAL v27; - mw_mirth_elab_abZ_typeZAt(v24, &v26, &v27); - VAL v28 = mw_std_list_List_1_reverse(v12); - VAL v29; - VAL v30; - mw_std_list_List_1_uncons(v28, &v29, &v30); - uint64_t x31; - VAL x32; - VAL x33; - VAL x34; - VAL x35; - VAL x36; - int64_t x37; - switch (get_data_tag(v29)) { - case 1LL: { // Some - VAL v38 = mtp_std_maybe_Maybe_1_Some(v29); - incref(v38); - VAL v39 = mw_mirth_var_Ctx_new(v25, VU64(v38)); - VAL v40; - uint64_t v41; - mw_mirth_elab_abZ_tokenZAt(v26, &v40, &v41); - VAL v42; - VAL v43; - VAL v44; - uint64_t v45; - mw_mirth_elab_elabZ_expandZ_tensorZBang(v13, v27, v41, &v42, &v43, &v44, &v45); - VAL v46 = mw_mirth_var_Var_type(VU64(v38)); - VAL v47; - VAL v48; - uint64_t v49; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v42, v44, v46, v45, &v47, &v48, &v49); - decref(v48); - int64_t v50 = 1LL /* True */; - x37 = v50; - x36 = v30; - x35 = v43; - x34 = v40; - x33 = v39; - x32 = v47; - x31 = v23; - push_u64(v1); - push_value(v9); + VAL v14; + mw_mirth_type_ArrowType_unpack(v9, &v13, &v14); + incref(v13); + VAL v15 = MKI64(0LL /* Nil */); + VAL v16 = mtw_mirth_arrow_Arrow_Arrow(v11, v10, v10, v8, v13, v13, v15); + uint64_t v17 = mw_mirth_table_Table_head(x1); + VAL v18 = mw_mirth_elab_abZ_tokenZBang(v16, v17); + int64_t v19 = 0LL /* CoerceUnsafe */; + VAL v20; + VAL v21; + mw_mirth_elab_abZ_coerceZBang(v19, v7, v18, &v20, &v21); + VAL v22; + VAL v23; + mw_mirth_elab_abZ_unifyZ_typeZBang(v14, v20, v21, &v22, &v23); + VAL v24; + VAL v25; + mw_mirth_elab_finalizzeZ_wordZ_arrow(v22, v23, v12, &v24, &v25); + VAL v26 = mtw_mirth_mirth_PropLabel_WordArrow(x3); + VAL v27; + VAL v28; + mw_mirth_mirth_PropLabel_prop(v25, v26, v24, &v27, &v28); + void* v29 = mfld_mirth_word_Word_ZTildearrow(x3); + mut_set(v27, v29); + *x6 = x3; + *x5 = v28; + *x4 = x1; +} +static VAL mw_std_list_List_1_filterZ_some_1_sp4 (VAL x1) { + VAL v2 = MKI64(0LL /* Nil */); + VAL v3 = mw_std_list_List_1_reverse(v2); + int64_t v4 = 1LL /* True */; + VAL v5 = v3; + VAL v6 = x1; + int64_t v7 = v4; + int64_t v8 = v4; + while (((bool)v8)) { + VAL v9 = v5; + VAL v10 = v6; + int64_t v11 = v7; + VAL x12; + VAL x13; + int64_t x14; + switch (get_data_tag(v10)) { + case 1LL: { // Cons + VAL v15; + VAL v16; + mtp_std_list_List_1_Cons(v10, &v15, &v16); + VAL v17 = mw_mirth_type_CTypeStackPart_labelZAsk(v15); + VAL v18 = mw_std_maybe_Maybe_1_for_1_sp5(v9, v17); + int64_t v19 = 1LL /* True */; + x14 = v19; + x13 = v16; + x12 = v18; } break; - case 0LL: { // None - int64_t v51 = 0LL /* False */; - x37 = v51; - x36 = v30; - x35 = v27; - x34 = v26; - x33 = v25; - x32 = v13; - x31 = v23; - push_u64(v1); - push_value(v9); + case 0LL: { // Nil + VAL v20 = MKI64(0LL /* Nil */); + int64_t v21 = 0LL /* False */; + x14 = v21; + x13 = v20; + x12 = v9; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t v52 = x31; - VAL v53 = (x32); - VAL v54 = x33; - VAL v55 = (x34); - VAL v56 = x35; - VAL v57 = x36; - int64_t v58 = x37; - while (((bool)v58)) { - uint64_t v59 = v52; - VAL v60 = (v53); - VAL v61 = v54; - VAL v62 = (v55); - VAL v63 = v56; - VAL v64 = v57; - VAL v65; - VAL v66; - mw_std_list_List_1_uncons(v64, &v65, &v66); - uint64_t x67; - VAL x68; - VAL x69; - VAL x70; - VAL x71; - VAL x72; - int64_t x73; - switch (get_data_tag(v65)) { - case 1LL: { // Some - VAL v74 = mtp_std_maybe_Maybe_1_Some(v65); - incref(v74); - VAL v75 = mw_mirth_var_Ctx_new(v61, VU64(v74)); - VAL v76; - uint64_t v77; - mw_mirth_elab_abZ_tokenZAt(v62, &v76, &v77); - VAL v78; - VAL v79; - VAL v80; - uint64_t v81; - mw_mirth_elab_elabZ_expandZ_tensorZBang(v60, v63, v77, &v78, &v79, &v80, &v81); - VAL v82 = mw_mirth_var_Var_type(VU64(v74)); - VAL v83; - VAL v84; - uint64_t v85; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v78, v80, v82, v81, &v83, &v84, &v85); - decref(v84); - int64_t v86 = 1LL /* True */; - x73 = v86; - x72 = v66; - x71 = v79; - x70 = v76; - x69 = v75; - x68 = v83; - x67 = v59; - } break; - case 0LL: { // None - int64_t v87 = 0LL /* False */; - x73 = v87; - x72 = v66; - x71 = v63; - x70 = v62; - x69 = v61; - x68 = v60; - x67 = v59; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v58 = x73; - v57 = x72; - v56 = x71; - v55 = x70; - v54 = x69; - v53 = x68; - v52 = x67; - } - decref(v57); - VAL v88; - VAL v89; - mw_mirth_elab_abZ_homeZAt(v55, &v88, &v89); - incref(v56); - VAL v90 = MKI64(0LL /* Nil */); - VAL v91 = mtw_mirth_arrow_Arrow_Arrow(v89, v52, v52, v54, v56, v56, v90); - VAL v92 = pop_value(); - VAL v93; - VAL v94; - VAL v95; - mw_mirth_elab_elabZ_defZ_bodyZBang(v92, v53, v91, &v93, &v94, &v95); - VAL v96; - VAL v97; - mw_mirth_elab_abZ_ctxZAt(v88, &v96, &v97); - VAL v98; - VAL v99; - mw_mirth_elab_abZ_typeZAt(v96, &v98, &v99); - VAL v100; - uint64_t v101; - mw_mirth_elab_abZ_tokenZAt(v98, &v100, &v101); - VAL v102 = mtw_mirth_arrow_Lambda_Lambda(v101, v97, v99, v12, v95); - VAL v103 = mtw_mirth_arrow_Op_OpLambda(v102); - VAL v104; - VAL v105; - mw_mirth_elab_abZ_opZBang(v103, v94, v100, &v104, &v105); - x18 = v105; - x17 = v104; - x16 = v93; - uint64_t v106 = pop_u64(); - x15 = v106; + v8 = x14; + v7 = x14; + v6 = x13; + v5 = x12; } - VAL v107; - VAL v108; - mw_mirth_elab_abZ_unifyZ_typeZBang(x16, x17, x18, &v107, &v108); - VAL v109; - VAL v110; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v107, v108, v7, &v109, &v110); - incref(v110); - VAL v111 = (mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v109, x15, v110)); - push_value(v110); - push_resource(v111); + decref(v6); + VAL v22 = mw_std_list_List_1_reverse(v5); + return v22; } -static void mb_mirth_elab_elabZ_defZ_typeZBang_2 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); - VAL v2; - VAL v3; - mw_mirth_elab_elabZ_simpleZ_typeZ_argZBang(r0, v1, &v2, &v3); - push_resource(v2); - push_value(v3); +static void mw_mirth_elab_abZ_buildZBang_1_sp32 (VAL x1, VAL x2, VAL x3, uint64_t x4, VAL x5, VAL *x6, VAL *x7) { + incref(x3); + VAL v8 = MKI64(0LL /* Nil */); + VAL v9 = mtw_mirth_arrow_Arrow_Arrow(x5, x4, x4, x2, x3, x3, v8); + VAL v10; + VAL v11; + mw_mirth_elab_elabZ_atomsZBang(x1, v9, &v10, &v11); + *x7 = v11; + *x6 = v10; } -static void mb_mirth_elab_elabZ_variableZBang_1 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); - VAL v2; - VAL v3; - mw_mirth_elab_elabZ_simpleZ_typeZ_argZBang(r0, v1, &v2, &v3); - push_resource(v2); - push_value(v3); +static VAL mw_std_maybe_Maybe_1_for_1_sp17 (VAL x1, VAL x2) { + VAL x3; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v4 = mtp_std_maybe_Maybe_1_Some(x2); + VAL v5 = mtw_mirth_name_Namespace_NAMESPACEz_TYCON(v4); + VAL v6 = mtw_std_list_List_1_Cons(v5, x1); + x3 = v6; + } break; + case 0LL: { // None + x3 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + return x3; } -static void mb_mirth_elab_elabZ_fieldZBang_1 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); - VAL v2; - VAL v3; - mw_mirth_elab_elabZ_simpleZ_typeZ_argZBang(r0, v1, &v2, &v3); - push_resource(v2); - push_value(v3); +static void mw_std_maybe_Maybe_1_map_1_sp14 (VAL x1, VAL x2, VAL *x3, VAL *x4) { + VAL x5; + VAL x6; + switch (get_data_tag(x2)) { + case 1LL: { // Some + VAL v7 = mtp_std_maybe_Maybe_1_Some(x2); + int64_t v8 = 0LL /* +Unsafe */; + incref(v7); + incref(x1); + int64_t v9 = 1LL; + int64_t v10 = i64_add(VI64(v7), v9); + VAL v11; + int64_t v12; + mw_std_prim_Str_dropZ_slice(v10, x1, v8, &v11, &v12); + VAL v13; + int64_t v14; + mw_std_prim_Str_takeZ_slice(VI64(v7), x1, v12, &v13, &v14); + VAL v15 = mtw_std_maybe_Maybe_1_Some(v11); + x6 = v15; + x5 = v13; + } break; + case 0LL: { // None + VAL v16 = MKI64(0LL /* None */); + x6 = v16; + x5 = x1; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + *x4 = x6; + *x3 = x5; +} +static void mb_mirth_main_main_1 (void) { + VAL v0 = pop_value(); + VAL v1 = pop_value(); + VAL v2 = pop_value(); + VAL r3 = pop_resource(); + VAL v4; + VAL v5; + mw_mirth_main_compilerZ_parseZ_args(r3, v2, v1, v0, &v4, &v5); + push_resource(v4); + push_value(v5); } -static void mb_mirth_elab_elabZ_fieldZBang_2 (void) { +static void mb_mirth_elab_elabZ_defZ_head_3 (void) { VAL r0 = pop_resource(); uint64_t v1 = pop_u64(); VAL v2; VAL v3; - mw_mirth_elab_elabZ_simpleZ_typeZ_argZBang(r0, v1, &v2, &v3); + mw_mirth_elab_elabZ_defZ_qnameZ_undefined(r0, v1, &v2, &v3); push_resource(v2); push_value(v3); } -static void mb_mirth_elab_elabZ_dataZ_headerZBang_2 (void) { +static void mb_mirth_mirth_PropLabel_prop_1_sp1_0 (void) { VAL r0 = pop_resource(); - VAL v1 = pop_value(); + uint64_t v1 = pop_u64(); VAL v2; VAL v3; - mw_mirth_elab_elabZ_dataZ_paramsZBang(v1, r0, &v2, &v3); - push_value(v2); + mw_mirth_word_Word_arrow(v1, r0, &v2, &v3); + VAL v4; + VAL v5; + mw_mirth_arrow_Arrow_ctxZ_type(v2, &v4, &v5); + VAL v6 = MKNIL; + VAL v7 = mkcons(v6, v4); + VAL v8 = mkcons(v7, v5); push_resource(v3); + push_value(v8); } -static void mb_mirth_elab_elabZ_dataZ_doneZBang_5 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); +static void mb_mirth_mirth_PropLabel_prop_1_sp2_2 (void) { + VAL v0 = pop_value(); + VAL r1 = pop_resource(); VAL v2; VAL v3; + value_uncons(v0, &v2, &v3); VAL v4; - mw_mirth_data_Tag_ctxZ_type(r0, v1, &v2, &v3, &v4); VAL v5; + value_uncons(v2, &v4, &v5); VAL v6; - mw_mirth_type_ArrowType_unpack(v4, &v5, &v6); - VAL v7 = mw_mirth_type_TZ_ZTo(v6, v5); - VAL v8 = MKNIL; - VAL v9 = mkcons(v8, v3); - VAL v10 = mkcons(v9, v7); - push_resource(v2); - push_value(v10); + VAL v7; + value_uncons(v4, &v6, &v7); + decref(v6); + VAL v8; + VAL v9; + VAL v10; + uint64_t v11; + VAL v12; + uint64_t v13; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(r1, VU64(v3), &v8, &v9, &v10, &v11, &v12, &v13); + VAL v14; + VAL v15; + mw_mirth_type_ArrowType_unpack(v10, &v14, &v15); + incref(v14); + VAL v16 = MKI64(0LL /* Nil */); + VAL v17 = mtw_mirth_arrow_Arrow_Arrow(v12, v11, v11, v9, v14, v14, v16); + VAL v18; + VAL v19; + mw_mirth_specializzer_synthZ_specializzedZ_wordZBang(v8, v17, v7, VU64(v5), &v18, &v19); + VAL v20; + VAL v21; + mw_mirth_elab_abZ_unifyZ_typeZBang(v15, v18, v19, &v20, &v21); + VAL v22; + VAL v23; + mw_mirth_elab_finalizzeZ_wordZ_arrow(v20, v21, v13, &v22, &v23); + push_resource(v22); + push_value(v23); } -static void mb_mirth_elab_elabZ_dataZ_doneZBang_14 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); - int64_t v2 = mw_mirth_data_Data_isZ_unitZAsk(v1); +static void mb_mirth_mirth_PropLabel_prop_1_sp3_6 (void) { + uint64_t v0 = pop_u64(); + VAL r1 = pop_resource(); + int64_t v2 = mw_mirth_data_Data_isZ_unitZAsk(v0); VAL x3; uint64_t x4; VAL x5; @@ -86090,10 +65419,10 @@ static void mb_mirth_elab_elabZ_dataZ_doneZBang_14 (void) { VAL v6 = MKI64(5LL /* Phantom */); VAL v7 = mtw_std_maybe_Maybe_1_Some(v6); x5 = v7; - x4 = v1; - x3 = r0; + x4 = v0; + x3 = r1; } else { - int64_t v8 = mw_mirth_data_Data_isZ_enumZAsk(v1); + int64_t v8 = mw_mirth_data_Data_isZ_enumZAsk(v0); VAL x9; uint64_t x10; VAL x11; @@ -86103,86 +65432,78 @@ static void mb_mirth_elab_elabZ_dataZ_doneZBang_14 (void) { VAL v13 = mtw_mirth_type_CType_IntLike(MKSTR(v12)); VAL v14 = mtw_std_maybe_Maybe_1_Some(v13); x11 = v14; - x10 = v1; - x9 = r0; + x10 = v0; + x9 = r1; } else { VAL v15; VAL v16; - mw_mirth_data_Data_semiZ_transparentZAsk(r0, v1, &v15, &v16); - uint64_t x17; + mw_mirth_data_Data_semiZ_transparentZAsk(r1, v0, &v15, &v16); + VAL x17; VAL x18; - VAL x19; switch (get_data_tag(v16)) { case 1LL: { // Some - VAL v20 = mtp_std_maybe_Maybe_1_Some(v16); - VAL v21 = VVAL(VTUP(v20)->cells[2]); - incref(v21); - decref(v20); - uint64_t x22; - VAL x23; - VAL x24; - switch (get_data_tag(v21)) { + VAL v19 = mtp_std_maybe_Maybe_1_Some(v16); + VAL v20 = VVAL(VTUP(v19)->cells[2]); + incref(v20); + decref(v19); + VAL x21; + VAL x22; + switch (get_data_tag(v20)) { case 0LL: { // STPCons - VAL v25 = mtp_mirth_type_StackTypePart_STPCons(v21); - VAL v26; - VAL v27; - mw_mirth_type_Type_ctypeZAsk(v15, v25, &v26, &v27); - x24 = v27; - x23 = v26; - x22 = v1; + VAL v23 = mtp_mirth_type_StackTypePart_STPCons(v20); + VAL v24; + VAL v25; + mw_mirth_type_Type_ctypeZAsk(v15, v23, &v24, &v25); + x22 = v25; + x21 = v24; } break; case 1LL: { // STPConsLabel + VAL v26; + uint64_t v27; + mtp_mirth_type_StackTypePart_STPConsLabel(v20, &v26, &v27); VAL v28; - uint64_t v29; - mtp_mirth_type_StackTypePart_STPConsLabel(v21, &v28, &v29); - VAL v30; - VAL v31; - mw_mirth_type_Type_ctypeZAsk(v15, v28, &v30, &v31); - x24 = v31; - x23 = v30; - x22 = v1; + VAL v29; + mw_mirth_type_Type_ctypeZAsk(v15, v26, &v28, &v29); + x22 = v29; + x21 = v28; } break; case 2LL: { // STPWith - VAL v32 = mtp_mirth_type_StackTypePart_STPWith(v21); - VAL v33; - VAL v34; - mw_mirth_type_Resource_ctypeZAsk(v15, v32, &v33, &v34); - x24 = v34; - x23 = v33; - x22 = v1; + VAL v30 = mtp_mirth_type_StackTypePart_STPWith(v20); + VAL v31; + VAL v32; + mw_mirth_type_Resource_ctypeZAsk(v15, v30, &v31, &v32); + x22 = v32; + x21 = v31; } break; case 3LL: { // STPWithLabel + VAL v33; + uint64_t v34; + mtp_mirth_type_StackTypePart_STPWithLabel(v20, &v33, &v34); VAL v35; - uint64_t v36; - mtp_mirth_type_StackTypePart_STPWithLabel(v21, &v35, &v36); - VAL v37; - VAL v38; - mw_mirth_type_Resource_ctypeZAsk(v15, v35, &v37, &v38); - x24 = v38; - x23 = v37; - x22 = v1; + VAL v36; + mw_mirth_type_Resource_ctypeZAsk(v15, v33, &v35, &v36); + x22 = v36; + x21 = v35; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x19 = x24; - x18 = x23; - x17 = x22; + x18 = x22; + x17 = x21; } break; case 0LL: { // None - VAL v39 = MKI64(0LL /* None */); - x19 = v39; - x18 = v15; - x17 = v1; + VAL v37 = MKI64(0LL /* None */); + x18 = v37; + x17 = v15; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x11 = x19; - x10 = x17; - x9 = x18; + x11 = x18; + x10 = v0; + x9 = x17; } x5 = x11; x4 = x10; @@ -86191,16 +65512,24 @@ static void mb_mirth_elab_elabZ_dataZ_doneZBang_14 (void) { push_resource(x3); push_value(x5); } -static void mb_mirth_elab_elabZ_defZ_head_3 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); +static void mb_mirth_mirth_PropLabel_prop_1_sp4_0 (void) { + uint64_t v0 = pop_u64(); + VAL r1 = pop_resource(); VAL v2; VAL v3; - mw_mirth_elab_elabZ_defZ_qnameZ_undefined(r0, v1, &v2, &v3); + VAL v4; + mw_mirth_data_Tag_ctxZ_type(r1, v0, &v2, &v3, &v4); + VAL v5; + VAL v6; + mw_mirth_type_ArrowType_unpack(v4, &v5, &v6); + VAL v7 = mw_mirth_type_TZ_ZTo(v6, v5); + VAL v8 = MKNIL; + VAL v9 = mkcons(v8, v3); + VAL v10 = mkcons(v9, v7); push_resource(v2); - push_value(v3); + push_value(v10); } -static void mb_mirth_elab_createZ_projectorsZBang_24 (void) { +static void mb_mirth_mirth_PropLabel_prop_1_sp5_2 (void) { VAL r0 = pop_resource(); uint64_t v1 = pop_u64(); VAL v2; @@ -86220,10 +65549,6 @@ static void mb_mirth_elab_createZ_projectorsZBang_24 (void) { STR* v9; STRLIT(v9, "logic error: expected parameter", 31); mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v9), v3); - VAL v10 = pop_value(); - x7 = v10; - VAL r11 = pop_resource(); - x6 = r11; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -86241,115 +65566,22 @@ static void mb_mirth_elab_createZ_projectorsZBang_24 (void) { case 0LL: { // None STR* v16; STRLIT(v16, "logic error: expected morphism", 30); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v16), x6); - VAL v17 = pop_value(); - x14 = v17; - VAL r18 = pop_resource(); - x13 = r18; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - STR* v19; - STRLIT(v19, "f", 1); - uint64_t v20 = mw_std_prim_Str_ZToName(MKSTR(v19)); - uint64_t v21 = mw_mirth_var_Var_newZ_autoZ_runZBang(x14, v20); - VAL v22 = MKI64(0LL /* Nil */); - VAL v23 = mtw_std_list_List_1_Cons(MKU64(v21), v22); - push_resource(x13); - push_value(v23); -} -static void mb_mirth_elab_elabZ_externalZ_defZBang_2 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); - uint64_t v2 = mw_mirth_external_External_sig(v1); - VAL v3 = (mw_mirth_elab_ZPlusTypeElab_typeZ_sigZ_startZBang(v2)); - VAL v4; - VAL v5; - VAL v6; - mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZBang(r0, v3, &v4, &v5, &v6); - VAL v7 = VVAL(VTUP(v5)->cells[1]); - incref(v7); - VAL v8 = MKNIL; - VAL v9 = mkcons(v8, v7); - VAL v10 = mkcons(v9, v6); - mw_mirth_elab_ZPlusTypeElab_rdrop(v5); - push_resource(v4); - push_value(v10); -} -static void mb_mirth_elab_elabZ_externalZ_defZBang_4 (void) { - VAL r0 = pop_resource(); - uint64_t v1 = pop_u64(); - VAL v2; - VAL v3; - mw_mirth_elab_elabZ_defZ_externalZ_ctype(r0, v1, &v2, &v3); - push_resource(v2); - push_value(v3); -} -static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotspecializzerZDotspecializzeZ_wordZBangZDot81ZRParen_1 (void) { - VAL v0 = pop_value(); - VAL r1 = pop_resource(); - VAL v2; - VAL v3; - value_uncons(v0, &v2, &v3); - VAL v4; - VAL v5; - value_uncons(v2, &v4, &v5); - VAL v6; - VAL v7; - value_uncons(v4, &v6, &v7); - decref(v6); - VAL v8; - VAL v9; - VAL v10; - uint64_t v11; - VAL v12; - uint64_t v13; - mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(r1, VU64(v3), &v8, &v9, &v10, &v11, &v12, &v13); - VAL v14; - VAL v15; - mw_mirth_type_ArrowType_unpack(v10, &v14, &v15); - incref(v14); - VAL v16 = MKI64(0LL /* Nil */); - VAL v17 = mtw_mirth_arrow_Arrow_Arrow(v12, v11, v11, v9, v14, v14, v16); - VAL v18; - VAL v19; - mw_mirth_specializzer_synthZ_specializzedZ_wordZBang(v8, v17, v7, VU64(v5), &v18, &v19); - VAL v20; - VAL v21; - mw_mirth_elab_abZ_unifyZ_typeZBang(v15, v18, v19, &v20, &v21); - VAL v22; - VAL v23; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v20, v21, v13, &v22, &v23); - push_resource(v22); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v16), x6); + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + STR* v19; + STRLIT(v19, "f", 1); + uint64_t v20 = mw_std_prim_Str_ZToName(MKSTR(v19)); + uint64_t v21 = mw_mirth_var_Var_newZ_autoZ_runZBang(x14, v20); + VAL v22 = MKI64(0LL /* Nil */); + VAL v23 = mtw_std_list_List_1_Cons(MKU64(v21), v22); + push_resource(x13); push_value(v23); } -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotspecializzerZDotspecializzeZ_wordZBangZDot63ZRParen_1 (void) { - VAL v0 = pop_value(); - VAL r1 = pop_resource(); - VAL v2; - VAL v3; - value_uncons(v0, &v2, &v3); - VAL v4; - VAL v5; - value_uncons(v2, &v4, &v5); - decref(v4); - VAL v6; - VAL v7; - VAL v8; - mw_mirth_word_Word_ctxZ_type(VU64(v3), r1, &v6, &v7, &v8); - VAL v9; - VAL v10; - VAL v11; - mw_mirth_specializzer_specializzeZ_ctxZ_type(v8, v5, v6, v7, &v9, &v10, &v11); - VAL v12 = MKNIL; - VAL v13 = mkcons(v12, v10); - VAL v14 = mkcons(v13, v11); - push_resource(v9); - push_value(v14); -} -static void mb_mirth_mirth_PropLabel_prop4_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot267ZRParen_1 (void) { +static void mb_mirth_mirth_PropLabel_prop_1_sp6_9 (void) { VAL v0 = pop_value(); VAL r1 = pop_resource(); VAL v2; @@ -86393,305 +65625,143 @@ static void mb_mirth_mirth_PropLabel_prop4_1_ZLParenmirthZDotelabZDotcreateZ_pro VAL v26; VAL v27; mw_mirth_elab_abZ_typeZAt(v24, &v26, &v27); - VAL v28 = mw_std_list_List_1_reverse(v20); + VAL v28; VAL v29; VAL v30; - mw_std_list_List_1_uncons(v28, &v29, &v30); - uint64_t x31; - VAL x32; - VAL x33; - VAL x34; - VAL x35; - VAL x36; - int64_t x37; - switch (get_data_tag(v29)) { + VAL v31; + mw_std_list_List_1_reverseZ_for_1_sp9(v21, v26, v25, v27, v20, &v28, &v29, &v30, &v31); + VAL v32; + VAL v33; + mw_mirth_elab_abZ_homeZAt(v29, &v32, &v33); + incref(v31); + VAL v34 = MKI64(0LL /* Nil */); + VAL v35 = mtw_mirth_arrow_Arrow_Arrow(v33, v23, v23, v30, v31, v31, v34); + VAL v36 = mw_std_list_List_1_ZDivL1(v20); + VAL x37; + VAL x38; + VAL x39; + switch (get_data_tag(v36)) { case 1LL: { // Some - VAL v38 = mtp_std_maybe_Maybe_1_Some(v29); - incref(v38); - VAL v39 = mw_mirth_var_Ctx_new(v25, VU64(v38)); - VAL v40; - uint64_t v41; - mw_mirth_elab_abZ_tokenZAt(v26, &v40, &v41); - VAL v42; - VAL v43; - VAL v44; - uint64_t v45; - mw_mirth_elab_elabZ_expandZ_tensorZBang(v21, v27, v41, &v42, &v43, &v44, &v45); - VAL v46 = mw_mirth_var_Var_type(VU64(v38)); - VAL v47; - VAL v48; - uint64_t v49; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v42, v44, v46, v45, &v47, &v48, &v49); - decref(v48); - int64_t v50 = 1LL /* True */; - x37 = v50; - x36 = v30; - x35 = v43; - x34 = v40; - x33 = v39; - x32 = v47; - x31 = v23; - lpush(&lbl_lblz_set, v5); - lpush(&lbl_lblz_get, v7); - lpush(&lbl_dat, v9); - push_value(v17); - push_value(v20); + VAL v40 = mtp_std_maybe_Maybe_1_Some(v36); + x39 = v40; + x38 = v35; + x37 = v28; } break; case 0LL: { // None - int64_t v51 = 0LL /* False */; - x37 = v51; - x36 = v30; - x35 = v27; - x34 = v26; - x33 = v25; - x32 = v21; - x31 = v23; - lpush(&lbl_lblz_set, v5); - lpush(&lbl_lblz_get, v7); - lpush(&lbl_dat, v9); - push_value(v17); - push_value(v20); + STR* v41; + STRLIT(v41, "Expected one parameter.", 23); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v41), v28); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t v52 = x31; - VAL v53 = (x32); - VAL v54 = x33; - VAL v55 = (x34); - VAL v56 = x35; - VAL v57 = x36; - int64_t v58 = x37; - while (((bool)v58)) { - uint64_t v59 = v52; - VAL v60 = (v53); - VAL v61 = v54; - VAL v62 = (v55); - VAL v63 = v56; - VAL v64 = v57; + int64_t v44 = mw_mirth_data_Data_isZ_resourceZAsk(VU64(v9)); + VAL x45; + VAL x46; + if (((bool)v44)) { + VAL v47; + VAL v48; + mw_mirth_elab_abZ_wordZBang(VU64(v7), x37, x38, &v47, &v48); + VAL v49; + uint64_t v50; + mw_mirth_elab_abZ_tokenZAt(v48, &v49, &v50); + VAL v51; + VAL v52; + mw_mirth_elab_abZ_ctxZAt(v49, &v51, &v52); + uint64_t v53 = mw_mirth_type_MetaVar_newZBang(); + VAL v54 = mtw_mirth_type_StackType_STMeta(v53); + VAL v55; + VAL v56; + mw_mirth_elab_abZ_homeZAt(v51, &v55, &v56); + incref(v54); + VAL v57 = MKI64(0LL /* Nil */); + VAL v58 = mtw_mirth_arrow_Arrow_Arrow(v56, v50, v50, v52, v54, v54, v57); + VAL v59; + VAL v60; + mw_mirth_elab_abZ_varZBang(VU64(x39), v47, v58, &v59, &v60); + VAL v61; + uint64_t v62; + mw_mirth_arrow_Block_newZBang(v59, v60, &v61, &v62); + VAL v63 = mtw_mirth_arrow_Op_OpBlockPush(v62); + VAL v64; VAL v65; - VAL v66; - mw_std_list_List_1_uncons(v64, &v65, &v66); - uint64_t x67; - VAL x68; - VAL x69; - VAL x70; - VAL x71; - VAL x72; - int64_t x73; - switch (get_data_tag(v65)) { - case 1LL: { // Some - VAL v74 = mtp_std_maybe_Maybe_1_Some(v65); - incref(v74); - VAL v75 = mw_mirth_var_Ctx_new(v61, VU64(v74)); - VAL v76; - uint64_t v77; - mw_mirth_elab_abZ_tokenZAt(v62, &v76, &v77); - VAL v78; - VAL v79; - VAL v80; - uint64_t v81; - mw_mirth_elab_elabZ_expandZ_tensorZBang(v60, v63, v77, &v78, &v79, &v80, &v81); - VAL v82 = mw_mirth_var_Var_type(VU64(v74)); - VAL v83; - VAL v84; - uint64_t v85; - mw_mirth_elab_elabZ_typeZ_unifyZBang(v78, v80, v82, v81, &v83, &v84, &v85); - decref(v84); - int64_t v86 = 1LL /* True */; - x73 = v86; - x72 = v66; - x71 = v79; - x70 = v76; - x69 = v75; - x68 = v83; - x67 = v59; - } break; - case 0LL: { // None - int64_t v87 = 0LL /* False */; - x73 = v87; - x72 = v66; - x71 = v63; - x70 = v62; - x69 = v61; - x68 = v60; - x67 = v59; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - v58 = x73; - v57 = x72; - v56 = x71; - v55 = x70; - v54 = x69; - v53 = x68; - v52 = x67; - } - decref(v57); - VAL v88; - VAL v89; - mw_mirth_elab_abZ_homeZAt(v55, &v88, &v89); - incref(v56); - VAL v90 = MKI64(0LL /* Nil */); - VAL v91 = mtw_mirth_arrow_Arrow_Arrow(v89, v52, v52, v54, v56, v56, v90); - VAL v92 = pop_value(); - VAL v93 = mw_std_list_List_1_ZDivL1(v92); - uint64_t x94; - uint64_t x95; - uint64_t x96; - VAL x97; - VAL x98; - VAL x99; - uint64_t x100; - switch (get_data_tag(v93)) { - case 1LL: { // Some - VAL v101 = mtp_std_maybe_Maybe_1_Some(v93); - x100 = VU64(v101); - x99 = v91; - x98 = v53; - VAL v102 = pop_value(); - x97 = v102; - uint64_t v103 = VU64(lpop(&lbl_dat)); - x96 = v103; - uint64_t v104 = VU64(lpop(&lbl_lblz_get)); - x95 = v104; - uint64_t v105 = VU64(lpop(&lbl_lblz_set)); - x94 = v105; - } break; - case 0LL: { // None - STR* v106; - STRLIT(v106, "Expected one parameter.", 23); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v106), v53); - uint64_t v107 = pop_u64(); - x100 = v107; - x99 = v91; - VAL r108 = pop_resource(); - x98 = r108; - VAL v109 = pop_value(); - x97 = v109; - uint64_t v110 = VU64(lpop(&lbl_dat)); - x96 = v110; - uint64_t v111 = VU64(lpop(&lbl_lblz_get)); - x95 = v111; - uint64_t v112 = VU64(lpop(&lbl_lblz_set)); - x94 = v112; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v113 = mw_mirth_data_Data_isZ_resourceZAsk(x96); - VAL x114; - VAL x115; - VAL x116; - if (((bool)v113)) { - VAL v117; - VAL v118; - mw_mirth_elab_abZ_wordZBang(x95, x98, x99, &v117, &v118); - VAL v119; - uint64_t v120; - mw_mirth_elab_abZ_tokenZAt(v118, &v119, &v120); - VAL v121; - VAL v122; - mw_mirth_elab_abZ_ctxZAt(v119, &v121, &v122); - uint64_t v123 = mw_mirth_type_MetaVar_newZBang(); - VAL v124 = mtw_mirth_type_StackType_STMeta(v123); - VAL v125; - VAL v126; - mw_mirth_elab_abZ_homeZAt(v121, &v125, &v126); - incref(v124); - VAL v127 = MKI64(0LL /* Nil */); - VAL v128 = mtw_mirth_arrow_Arrow_Arrow(v126, v120, v120, v122, v124, v124, v127); - VAL v129; - VAL v130; - mw_mirth_elab_abZ_varZBang(x100, v117, v128, &v129, &v130); - VAL v131; - uint64_t v132; - mw_mirth_arrow_Block_newZBang(v129, v130, &v131, &v132); - VAL v133 = mtw_mirth_arrow_Op_OpBlockPush(v132); - VAL v134; - VAL v135; - mw_mirth_elab_abZ_opZBang(v133, v131, v125, &v134, &v135); - int64_t v136 = 6LL /* PRIM_CORE_RDIP */; - VAL v137; - VAL v138; - mw_mirth_elab_abZ_primZBang(v136, v134, v135, &v137, &v138); - VAL v139; - VAL v140; - mw_mirth_elab_abZ_wordZBang(x94, v137, v138, &v139, &v140); - x116 = v140; - x115 = v139; - x114 = x97; + mw_mirth_elab_abZ_opZBang(v63, v61, v55, &v64, &v65); + int64_t v66 = 6LL /* PRIM_CORE_RDIP */; + VAL v67; + VAL v68; + mw_mirth_elab_abZ_primZBang(v66, v64, v65, &v67, &v68); + VAL v69; + VAL v70; + mw_mirth_elab_abZ_wordZBang(VU64(v5), v67, v68, &v69, &v70); + x46 = v70; + x45 = v69; } else { - int64_t v141 = 1LL /* PRIM_CORE_DUP */; - VAL v142; - VAL v143; - mw_mirth_elab_abZ_primZBang(v141, x98, x99, &v142, &v143); - VAL v144; - uint64_t v145; - mw_mirth_elab_abZ_tokenZAt(v143, &v144, &v145); - VAL v146; - VAL v147; - mw_mirth_elab_abZ_ctxZAt(v144, &v146, &v147); - uint64_t v148 = mw_mirth_type_MetaVar_newZBang(); - VAL v149 = mtw_mirth_type_StackType_STMeta(v148); - VAL v150; - VAL v151; - mw_mirth_elab_abZ_homeZAt(v146, &v150, &v151); - incref(v149); - VAL v152 = MKI64(0LL /* Nil */); - VAL v153 = mtw_mirth_arrow_Arrow_Arrow(v151, v145, v145, v147, v149, v149, v152); - VAL v154; - VAL v155; - mw_mirth_elab_abZ_wordZBang(x95, v142, v153, &v154, &v155); - VAL v156; - VAL v157; - mw_mirth_elab_abZ_varZBang(x100, v154, v155, &v156, &v157); - VAL v158; - uint64_t v159; - mw_mirth_arrow_Block_newZBang(v156, v157, &v158, &v159); - VAL v160 = mtw_mirth_arrow_Op_OpBlockPush(v159); - VAL v161; - VAL v162; - mw_mirth_elab_abZ_opZBang(v160, v158, v150, &v161, &v162); - int64_t v163 = 5LL /* PRIM_CORE_DIP */; - VAL v164; - VAL v165; - mw_mirth_elab_abZ_primZBang(v163, v161, v162, &v164, &v165); - VAL v166; - VAL v167; - mw_mirth_elab_abZ_wordZBang(x94, v164, v165, &v166, &v167); - x116 = v167; - x115 = v166; - x114 = x97; + int64_t v71 = 1LL /* PRIM_CORE_DUP */; + VAL v72; + VAL v73; + mw_mirth_elab_abZ_primZBang(v71, x37, x38, &v72, &v73); + VAL v74; + uint64_t v75; + mw_mirth_elab_abZ_tokenZAt(v73, &v74, &v75); + VAL v76; + VAL v77; + mw_mirth_elab_abZ_ctxZAt(v74, &v76, &v77); + uint64_t v78 = mw_mirth_type_MetaVar_newZBang(); + VAL v79 = mtw_mirth_type_StackType_STMeta(v78); + VAL v80; + VAL v81; + mw_mirth_elab_abZ_homeZAt(v76, &v80, &v81); + incref(v79); + VAL v82 = MKI64(0LL /* Nil */); + VAL v83 = mtw_mirth_arrow_Arrow_Arrow(v81, v75, v75, v77, v79, v79, v82); + VAL v84; + VAL v85; + mw_mirth_elab_abZ_wordZBang(VU64(v7), v72, v83, &v84, &v85); + VAL v86; + VAL v87; + mw_mirth_elab_abZ_varZBang(VU64(x39), v84, v85, &v86, &v87); + VAL v88; + uint64_t v89; + mw_mirth_arrow_Block_newZBang(v86, v87, &v88, &v89); + VAL v90 = mtw_mirth_arrow_Op_OpBlockPush(v89); + VAL v91; + VAL v92; + mw_mirth_elab_abZ_opZBang(v90, v88, v80, &v91, &v92); + int64_t v93 = 5LL /* PRIM_CORE_DIP */; + VAL v94; + VAL v95; + mw_mirth_elab_abZ_primZBang(v93, v91, v92, &v94, &v95); + VAL v96; + VAL v97; + mw_mirth_elab_abZ_wordZBang(VU64(v5), v94, v95, &v96, &v97); + x46 = v97; + x45 = v96; } - VAL v168; - VAL v169; - mw_mirth_elab_abZ_ctxZAt(v88, &v168, &v169); - VAL v170; - VAL v171; - mw_mirth_elab_abZ_typeZAt(v168, &v170, &v171); - VAL v172; - uint64_t v173; - mw_mirth_elab_abZ_tokenZAt(v170, &v172, &v173); - VAL v174 = mtw_mirth_arrow_Lambda_Lambda(v173, v169, v171, v20, x116); - VAL v175 = mtw_mirth_arrow_Op_OpLambda(v174); - VAL v176; - VAL v177; - mw_mirth_elab_abZ_opZBang(v175, x115, v172, &v176, &v177); - VAL v178; - VAL v179; - mw_mirth_elab_abZ_unifyZ_typeZBang(x114, v176, v177, &v178, &v179); - VAL v180; - VAL v181; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v178, v179, v15, &v180, &v181); - push_resource(v180); - push_value(v181); + VAL v98; + VAL v99; + mw_mirth_elab_abZ_ctxZAt(v32, &v98, &v99); + VAL v100; + VAL v101; + mw_mirth_elab_abZ_typeZAt(v98, &v100, &v101); + VAL v102; + uint64_t v103; + mw_mirth_elab_abZ_tokenZAt(v100, &v102, &v103); + VAL v104 = mtw_mirth_arrow_Lambda_Lambda(v103, v99, v101, v20, x46); + VAL v105 = mtw_mirth_arrow_Op_OpLambda(v104); + VAL v106; + VAL v107; + mw_mirth_elab_abZ_opZBang(v105, x45, v102, &v106, &v107); + VAL v108; + VAL v109; + mw_mirth_elab_abZ_unifyZ_typeZBang(v17, v106, v107, &v108, &v109); + VAL v110; + VAL v111; + mw_mirth_elab_finalizzeZ_wordZ_arrow(v108, v109, v15, &v110, &v111); + push_resource(v110); + push_value(v111); } -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot167ZRParen_1 (void) { +static void mb_mirth_mirth_PropLabel_prop_1_sp7_1 (void) { VAL v0 = pop_value(); VAL r1 = pop_resource(); VAL v2; @@ -86715,77 +65785,61 @@ static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_pro VAL v14; VAL v15; mw_mirth_data_Tag_projectZ_inputZ_label(r1, VU64(v3), VU64(v5), &v14, &v15); - uint64_t x16; - uint64_t x17; - uint64_t x18; - VAL x19; - VAL x20; + VAL x16; + VAL x17; switch (get_data_tag(v15)) { case 1LL: { // Some - VAL v21 = mtp_std_maybe_Maybe_1_Some(v15); - x20 = v21; - x19 = v14; - x18 = VU64(v5); - x17 = v13; - x16 = v9; + VAL v18 = mtp_std_maybe_Maybe_1_Some(v15); + x17 = v18; + x16 = v14; } break; case 0LL: { // None - STR* v22; - STRLIT(v22, "logic error: expeted field in tag.", 34); - lpush(&lbl_sx, MKU64(v9)); - lpush(&lbl_sy, MKU64(v13)); - lpush(&lbl_tag, v5); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v22), v14); - VAL v23 = pop_value(); - x20 = v23; - VAL r24 = pop_resource(); - x19 = r24; - uint64_t v25 = VU64(lpop(&lbl_tag)); - x18 = v25; - uint64_t v26 = VU64(lpop(&lbl_sy)); - x17 = v26; - uint64_t v27 = VU64(lpop(&lbl_sx)); - x16 = v27; + STR* v19; + STRLIT(v19, "logic error: expeted field in tag.", 34); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v19), v14); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v28; - VAL v29; - mw_mirth_data_Tag_outputZ_type(x19, x18, &v28, &v29); - VAL v30; - VAL v31; - mw_mirth_data_Tag_ctx(v28, x18, &v30, &v31); - VAL v32 = MKI64(0LL /* Nil */); - VAL v33 = mtw_std_list_List_1_Cons(MKU64(x17), v32); - VAL v34 = mtw_std_list_List_1_Cons(MKU64(x16), v33); - VAL v35 = mw_std_list_List_1_cat(v31, v34); - VAL v36 = mtw_mirth_type_StackType_STVar(x16); - incref(v29); - VAL v37 = mw_mirth_type_TZMulZPlus(v36, v29); - VAL v38 = mtw_mirth_type_StackType_STVar(x16); - incref(x20); - VAL v39 = mw_mirth_type_TZMulZPlus(v38, x20); - VAL v40 = mtw_mirth_type_StackType_STVar(x17); - incref(x20); - VAL v41 = mw_mirth_type_TZMulZPlus(v40, x20); - VAL v42 = mw_mirth_type_TZ_ZTo(v39, v41); - VAL v43 = mtw_mirth_type_Type_TMorphism(v42); - VAL v44 = mw_mirth_type_TZMul(v37, v43); - VAL v45 = mtw_mirth_type_StackType_STVar(x17); - incref(v29); - VAL v46 = mw_mirth_type_TZMulZPlus(v45, v29); - VAL v47 = mw_mirth_type_TZ_ZTo(v44, v46); - VAL v48 = MKNIL; - VAL v49 = mkcons(v48, v35); - VAL v50 = mkcons(v49, v47); - decref(v29); - decref(x20); - push_resource(v30); - push_value(v50); -} -static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot134ZRParen_1 (void) { + incref(v5); + VAL v22; + VAL v23; + mw_mirth_data_Tag_outputZ_type(x16, VU64(v5), &v22, &v23); + incref(v5); + VAL v24; + VAL v25; + mw_mirth_data_Tag_ctx(v22, VU64(v5), &v24, &v25); + VAL v26 = MKI64(0LL /* Nil */); + VAL v27 = mtw_std_list_List_1_Cons(MKU64(v13), v26); + VAL v28 = mtw_std_list_List_1_Cons(MKU64(v9), v27); + VAL v29 = mw_std_list_List_1_cat(v25, v28); + VAL v30 = mtw_mirth_type_StackType_STVar(v9); + incref(v23); + VAL v31 = mw_mirth_type_TZMulZPlus(v30, v23); + VAL v32 = mtw_mirth_type_StackType_STVar(v9); + incref(x17); + VAL v33 = mw_mirth_type_TZMulZPlus(v32, x17); + VAL v34 = mtw_mirth_type_StackType_STVar(v13); + incref(x17); + VAL v35 = mw_mirth_type_TZMulZPlus(v34, x17); + VAL v36 = mw_mirth_type_TZ_ZTo(v33, v35); + VAL v37 = mtw_mirth_type_Type_TMorphism(v36); + VAL v38 = mw_mirth_type_TZMul(v31, v37); + VAL v39 = mtw_mirth_type_StackType_STVar(v13); + incref(v23); + VAL v40 = mw_mirth_type_TZMulZPlus(v39, v23); + VAL v41 = mw_mirth_type_TZ_ZTo(v38, v40); + VAL v42 = MKNIL; + VAL v43 = mkcons(v42, v29); + VAL v44 = mkcons(v43, v41); + decref(v23); + decref(x17); + decref(v5); + push_resource(v24); + push_value(v44); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp8_5 (void) { VAL v0 = pop_value(); VAL r1 = pop_resource(); VAL v2; @@ -86828,11 +65882,6 @@ static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_pro STR* v24; STRLIT(v24, "logic error: expected field in tag.", 35); mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v24), v18); - VAL v25 = pop_value(); - x22 = v25; - x21 = v17; - VAL r26 = pop_resource(); - x20 = r26; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -86851,7 +65900,7 @@ static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_pro push_resource(v32); push_value(v33); } -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot106ZRParen_1 (void) { +static void mb_mirth_mirth_PropLabel_prop_1_sp9_3 (void) { VAL v0 = pop_value(); VAL r1 = pop_resource(); VAL v2; @@ -86870,40 +65919,31 @@ static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_pro mw_mirth_data_Tag_projectZ_tagZ_field(v6, VU64(v3), VU64(v5), &v8, &v9); VAL x10; VAL x11; - VAL x12; switch (get_data_tag(v9)) { case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v9); - x12 = v13; - x11 = v8; - x10 = v7; + VAL v12 = mtp_std_maybe_Maybe_1_Some(v9); + x11 = v12; + x10 = v8; } break; case 0LL: { // None - STR* v14; - STRLIT(v14, "logic error: expected field in tag.", 35); - push_value(v7); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v14), v8); - VAL v15 = pop_value(); - x12 = v15; - VAL r16 = pop_resource(); - x11 = r16; - VAL v17 = pop_value(); - x10 = v17; + STR* v13; + STRLIT(v13, "logic error: expected field in tag.", 35); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v13), v8); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v18; - VAL v19; - mw_mirth_elab_dataZ_setZ_labelZ_type(x11, x12, &v18, &v19); - VAL v20 = MKNIL; - VAL v21 = mkcons(v20, x10); - VAL v22 = mkcons(v21, v19); - push_resource(v18); - push_value(v22); -} -static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot73ZRParen_1 (void) { + VAL v16; + VAL v17; + mw_mirth_elab_dataZ_setZ_labelZ_type(x10, x11, &v16, &v17); + VAL v18 = MKNIL; + VAL v19 = mkcons(v18, v7); + VAL v20 = mkcons(v19, v17); + push_resource(v16); + push_value(v20); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp10_5 (void) { VAL v0 = pop_value(); VAL r1 = pop_resource(); VAL v2; @@ -86946,11 +65986,6 @@ static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_pro STR* v24; STRLIT(v24, "logic error: expected field in tag.", 35); mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v24), v18); - VAL v25 = pop_value(); - x22 = v25; - x21 = v17; - VAL r26 = pop_resource(); - x20 = r26; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); @@ -86969,7 +66004,7 @@ static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotcreateZ_pro push_resource(v32); push_value(v33); } -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_projectorsZBangZDot45ZRParen_1 (void) { +static void mb_mirth_mirth_PropLabel_prop_1_sp11_3 (void) { VAL v0 = pop_value(); VAL r1 = pop_resource(); VAL v2; @@ -86988,40 +66023,31 @@ static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotcreateZ_pro mw_mirth_data_Tag_projectZ_tagZ_field(v6, VU64(v3), VU64(v5), &v8, &v9); VAL x10; VAL x11; - VAL x12; switch (get_data_tag(v9)) { case 1LL: { // Some - VAL v13 = mtp_std_maybe_Maybe_1_Some(v9); - x12 = v13; - x11 = v8; - x10 = v7; + VAL v12 = mtp_std_maybe_Maybe_1_Some(v9); + x11 = v12; + x10 = v8; } break; case 0LL: { // None - STR* v14; - STRLIT(v14, "logic error: expected field in tag.", 35); - push_value(v7); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v14), v8); - VAL v15 = pop_value(); - x12 = v15; - VAL r16 = pop_resource(); - x11 = r16; - VAL v17 = pop_value(); - x10 = v17; + STR* v13; + STRLIT(v13, "logic error: expected field in tag.", 35); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v13), v8); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - VAL v18; - VAL v19; - mw_mirth_elab_dataZ_getZ_labelZ_type(x11, x12, &v18, &v19); - VAL v20 = MKNIL; - VAL v21 = mkcons(v20, x10); - VAL v22 = mkcons(v21, v19); - push_resource(v18); - push_value(v22); -} -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotelabZ_dataZ_doneZBangZDot104ZRParen_1 (void) { + VAL v16; + VAL v17; + mw_mirth_elab_dataZ_getZ_labelZ_type(x10, x11, &v16, &v17); + VAL v18 = MKNIL; + VAL v19 = mkcons(v18, v7); + VAL v20 = mkcons(v19, v17); + push_resource(v16); + push_value(v20); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp12_7 (void) { VAL v0 = pop_value(); VAL r1 = pop_resource(); VAL v2; @@ -87055,111 +66081,97 @@ static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotelabZ_dataZ VAL x21; VAL x22; VAL x23; - VAL x24; - uint64_t x25; - uint64_t x26; switch (get_data_tag(v20)) { case 1LL: { // Some - VAL v27 = mtp_std_maybe_Maybe_1_Some(v20); - x26 = VU64(v27); - x25 = VU64(v5); - x24 = v18; - x23 = v15; - x22 = v16; - x21 = v13; + VAL v24 = mtp_std_maybe_Maybe_1_Some(v20); + x23 = v24; + x22 = v15; + x21 = v16; } break; case 0LL: { // None - STR* v28; - STRLIT(v28, "Missing data token info", 23); - push_value(v13); - lpush(&lbl_cod, v18); - lpush(&lbl_tag, v5); - mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v28), v16); - uint64_t v29 = pop_u64(); - x26 = v29; - uint64_t v30 = VU64(lpop(&lbl_tag)); - x25 = v30; - VAL v31 = lpop(&lbl_cod); - x24 = v31; - x23 = v15; - VAL r32 = pop_resource(); - x22 = r32; - VAL v33 = pop_value(); - x21 = v33; + STR* v25; + STRLIT(v25, "Missing data token info", 23); + mw_mirth_mirth_ZPlusMirth_fatalZ_errorZBang(MKSTR(v25), v16); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } + incref(x23); + VAL v28; + VAL v29; + mw_mirth_elab_abZ_ctxZAt(x22, &v28, &v29); + VAL v30; + VAL v31; + mw_mirth_elab_abZ_typeZAt(v28, &v30, &v31); + VAL v32; + uint64_t v33; + mw_mirth_elab_abZ_tokenZAt(v30, &v32, &v33); VAL v34; VAL v35; - mw_mirth_elab_abZ_ctxZAt(x23, &v34, &v35); - VAL v36; - VAL v37; - mw_mirth_elab_abZ_typeZAt(v34, &v36, &v37); - VAL v38; - uint64_t v39; - mw_mirth_elab_abZ_tokenZAt(v36, &v38, &v39); - VAL v40; - VAL v41; - mw_mirth_elab_abZ_homeZAt(v38, &v40, &v41); + mw_mirth_elab_abZ_homeZAt(v32, &v34, &v35); + VAL v36 = MKI64(0LL /* Nil */); + VAL v37 = mtw_mirth_match_ZPlusMatch_ZPlusMatch(v35, v33, VU64(x23), v29, v31, v18, v36); + incref(x23); + VAL v38 = VVAL(VTUP(v37)->cells[1]); + incref(v38); + incref(x23); + VAL v39 = VVAL(VTUP(v37)->cells[4]); + incref(v39); + incref(v39); + VAL v40 = MKI64(0LL /* Nil */); + VAL v41 = VVAL(VTUP(v37)->cells[5]); + incref(v41); + incref(v41); VAL v42 = MKI64(0LL /* Nil */); - VAL v43 = (mtw_mirth_match_ZPlusMatch_ZPlusMatch(v41, v39, x26, v35, v37, x24, v42)); - VAL v44 = VVAL(VTUP(v43)->cells[1]); - incref(v44); - VAL v45 = VVAL(VTUP(v43)->cells[4]); - incref(v45); - incref(v45); - VAL v46 = MKI64(0LL /* Nil */); - VAL v47 = VVAL(VTUP(v43)->cells[5]); + VAL v43 = mtw_mirth_match_Pattern_Pattern(v38, VU64(x23), VU64(x23), v39, v39, v40, v41, v41, v42); + VAL v44 = mw_mirth_match_Pattern_thaw(v43); + incref(v5); + VAL v45; + VAL v46; + mw_mirth_match_ZPlusPattern_tagZBang(x21, v44, VU64(v5), &v45, &v46); + VAL v47 = mw_mirth_match_ZPlusPattern_freezze(v46); incref(v47); + VAL v48 = VVAL(VTUP(v47)->cells[5]); + incref(v48); + decref(v47); incref(v47); - VAL v48 = MKI64(0LL /* Nil */); - VAL v49 = mtw_mirth_match_Pattern_Pattern(v44, x26, x26, v45, v45, v46, v47, v47, v48); - VAL v50 = (mw_mirth_match_Pattern_thaw(v49)); - VAL v51; - VAL v52; - mw_mirth_match_ZPlusPattern_tagZBang(x22, v50, x25, &v51, &v52); - VAL v53 = mw_mirth_match_ZPlusPattern_freezze(v52); - incref(v53); - VAL v54 = VVAL(VTUP(v53)->cells[5]); - incref(v54); - decref(v53); + VAL v49 = mw_mirth_match_Pattern_dom(v47); + VAL v50 = VVAL(VTUP(v37)->cells[6]); + incref(v50); + VAL v51 = mw_mirth_type_TZ_ZTo(v49, v50); + VAL v52 = VVAL(VTUP(v37)->cells[1]); + incref(v52); + VAL v53; + VAL v54; + mw_mirth_type_ArrowType_unpack(v51, &v53, &v54); + incref(x23); incref(v53); - VAL v55 = mw_mirth_match_Pattern_dom(v53); - VAL v56 = VVAL(VTUP(v43)->cells[6]); - incref(v56); - VAL v57 = mw_mirth_type_TZ_ZTo(v55, v56); - VAL v58 = VVAL(VTUP(v43)->cells[1]); - incref(v58); - VAL v59; + VAL v55 = MKI64(0LL /* Nil */); + VAL v56 = mtw_mirth_arrow_Arrow_Arrow(v52, VU64(x23), VU64(x23), v48, v53, v53, v55); + VAL v57; + VAL v58; + mw_mirth_elab_abZ_unifyZ_typeZBang(v54, v45, v56, &v57, &v58); + VAL v59 = mtw_mirth_match_Case_CASE(v47, v58); VAL v60; - mw_mirth_type_ArrowType_unpack(v57, &v59, &v60); - incref(v59); - VAL v61 = MKI64(0LL /* Nil */); - VAL v62 = mtw_mirth_arrow_Arrow_Arrow(v58, x26, x26, v54, v59, v59, v61); - VAL v63; + VAL v61; + mw_mirth_match_ZPlusMatch_addZ_case(v57, v37, v59, &v60, &v61); + VAL v62 = mw_mirth_match_ZPlusMatch_freezze(v61); + VAL v63 = mtw_mirth_arrow_Op_OpMatch(v62); VAL v64; - mw_mirth_elab_abZ_unifyZ_typeZBang(v60, v51, v62, &v63, &v64); - VAL v65 = mtw_mirth_match_Case_CASE(v53, v64); + VAL v65; + mw_mirth_elab_abZ_opZBang(v63, v60, v34, &v64, &v65); VAL v66; VAL v67; - mw_mirth_match_ZPlusMatch_addZ_case(v63, v43, v65, &v66, &v67); - VAL v68 = mw_mirth_match_ZPlusMatch_freezze(v67); - VAL v69 = mtw_mirth_arrow_Op_OpMatch(v68); - VAL v70; - VAL v71; - mw_mirth_elab_abZ_opZBang(v69, v66, v40, &v70, &v71); - VAL v72; - VAL v73; - mw_mirth_elab_abZ_unifyZ_typeZBang(x21, v70, v71, &v72, &v73); - VAL v74; - VAL v75; - mw_mirth_elab_finalizzeZ_wordZ_arrow(v72, v73, v11, &v74, &v75); - push_resource(v74); - push_value(v75); + mw_mirth_elab_abZ_unifyZ_typeZBang(v13, v64, v65, &v66, &v67); + VAL v68; + VAL v69; + mw_mirth_elab_finalizzeZ_wordZ_arrow(v66, v67, v11, &v68, &v69); + decref(v5); + push_resource(v68); + push_value(v69); } -static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotelabZ_dataZ_tagZBangZDot42ZRParen_1 (void) { +static void mb_mirth_mirth_PropLabel_prop_1_sp13_2 (void) { VAL v0 = pop_value(); VAL r1 = pop_resource(); VAL v2; @@ -87177,7 +66189,7 @@ static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotelabZ_dataZ VAL v9 = mw_std_list_List_1_ZToCtx(v8); int64_t v10 = 1LL /* True */; int64_t v11 = 0LL /* False */; - VAL v12 = (mtw_mirth_elab_ZPlusTypeElab_ZPlusTypeElab(v9, VU64(v5), v11, v10)); + VAL v12 = mtw_mirth_elab_ZPlusTypeElab_ZPlusTypeElab(v9, VU64(v5), v11, v10); VAL v13 = mw_mirth_type_T0(); incref(v3); uint64_t v14 = mw_mirth_data_Tag_data(VU64(v3)); @@ -87225,7 +66237,206 @@ static void mb_mirth_mirth_PropLabel_prop2_1_ZLParenmirthZDotelabZDotelabZ_dataZ push_resource(x19); push_value(v33); } -static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotelabZ_aliasZBangZDot21ZRParen_1 (void) { +static void mb_mirth_mirth_PropLabel_prop_1_sp14_0 (void) { + VAL r0 = pop_resource(); + VAL v1 = pop_value(); + VAL v2; + VAL v3; + mw_mirth_elab_elabZ_dataZ_paramsZBang(v1, r0, &v2, &v3); + push_value(v2); + push_resource(v3); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp15_0 (void) { + uint64_t v0 = pop_u64(); + VAL r1 = pop_resource(); + VAL v2; + VAL v3; + mw_mirth_elab_elabZ_simpleZ_typeZ_argZBang(r1, v0, &v2, &v3); + push_resource(v2); + push_value(v3); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp16_1 (void) { + uint64_t v0 = pop_u64(); + VAL r1 = pop_resource(); + uint64_t v2 = mw_mirth_external_External_sig(v0); + VAL v3 = mw_mirth_elab_ZPlusTypeElab_typeZ_sigZ_startZBang(v2); + VAL v4; + VAL v5; + VAL v6; + mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZBang(r1, v3, &v4, &v5, &v6); + VAL v7 = VVAL(VTUP(v5)->cells[1]); + incref(v7); + VAL v8 = MKNIL; + VAL v9 = mkcons(v8, v7); + VAL v10 = mkcons(v9, v6); + mw_mirth_elab_ZPlusTypeElab_rdrop(v5); + push_resource(v4); + push_value(v10); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp17_0 (void) { + uint64_t v0 = pop_u64(); + VAL r1 = pop_resource(); + VAL v2; + VAL v3; + mw_mirth_elab_elabZ_defZ_externalZ_ctype(r1, v0, &v2, &v3); + push_resource(v2); + push_value(v3); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp18_1 (void) { + uint64_t v0 = pop_u64(); + VAL r1 = pop_resource(); + VAL v2 = mw_mirth_word_Word_sigZAsk(v0); + VAL x3; + VAL x4; + switch (get_data_tag(v2)) { + case 1LL: { // Some + VAL v5 = mtp_std_maybe_Maybe_1_Some(v2); + VAL v6 = mw_mirth_elab_ZPlusTypeElab_typeZ_sigZ_startZBang(VU64(v5)); + VAL v7; + VAL v8; + VAL v9; + mw_mirth_elab_ZPlusTypeElab_elabZ_typeZ_sigZBang(r1, v6, &v7, &v8, &v9); + VAL v10 = VVAL(VTUP(v8)->cells[1]); + incref(v10); + VAL v11 = MKNIL; + VAL v12 = mkcons(v11, v10); + VAL v13 = mkcons(v12, v9); + mw_mirth_elab_ZPlusTypeElab_rdrop(v8); + x4 = v13; + x3 = v7; + } break; + case 0LL: { // None + VAL v14; + VAL v15; + mw_mirth_word_Word_arrow(v0, r1, &v14, &v15); + VAL v16; + VAL v17; + mw_mirth_arrow_Arrow_ctxZ_type(v14, &v16, &v17); + VAL v18 = MKNIL; + VAL v19 = mkcons(v18, v16); + VAL v20 = mkcons(v19, v17); + x4 = v20; + x3 = v15; + } break; + default: { + do_panic(str_make("unexpected fallthrough in match\n", 32)); + } + } + push_resource(x3); + push_value(x4); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp19_0 (void) { + uint64_t v0 = pop_u64(); + VAL r1 = pop_resource(); + VAL v2; + VAL v3; + mw_mirth_elab_elabZ_defZ_paramsZBang(r1, v0, &v2, &v3); + push_resource(v2); + push_value(v3); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp20_5 (void) { + uint64_t v0 = pop_u64(); + VAL r1 = pop_resource(); + VAL v2; + VAL v3; + VAL v4; + uint64_t v5; + VAL v6; + uint64_t v7; + mw_mirth_elab_initialZ_ctxZ_typeZ_bodyZ_home(r1, v0, &v2, &v3, &v4, &v5, &v6, &v7); + VAL v8; + VAL v9; + mw_mirth_type_ArrowType_unpack(v4, &v8, &v9); + incref(v8); + VAL v10 = MKI64(0LL /* Nil */); + VAL v11 = mtw_mirth_arrow_Arrow_Arrow(v6, v5, v5, v3, v8, v8, v10); + VAL v12; + VAL v13; + mw_mirth_word_Word_params(v0, v2, &v12, &v13); + incref(v12); + int64_t v14 = mw_std_list_List_1_emptyZAsk(v12); + VAL x15; + VAL x16; + VAL x17; + if (((bool)v14)) { + decref(v12); + VAL v18; + VAL v19; + VAL v20; + mw_mirth_elab_elabZ_defZ_bodyZBang(v9, v13, v11, &v18, &v19, &v20); + x17 = v20; + x16 = v19; + x15 = v18; + } else { + VAL v21; + uint64_t v22; + mw_mirth_elab_abZ_tokenZAt(v11, &v21, &v22); + incref(v12); + VAL v23; + VAL v24; + mw_mirth_elab_abZ_ctxZAt(v21, &v23, &v24); + VAL v25; + VAL v26; + mw_mirth_elab_abZ_typeZAt(v23, &v25, &v26); + VAL v27; + VAL v28; + VAL v29; + VAL v30; + mw_std_list_List_1_reverseZ_for_1_sp9(v13, v25, v24, v26, v12, &v27, &v28, &v29, &v30); + VAL v31; + VAL v32; + mw_mirth_elab_abZ_homeZAt(v28, &v31, &v32); + incref(v30); + VAL v33 = MKI64(0LL /* Nil */); + VAL v34 = mtw_mirth_arrow_Arrow_Arrow(v32, v22, v22, v29, v30, v30, v33); + VAL v35; + VAL v36; + VAL v37; + mw_mirth_elab_elabZ_defZ_bodyZBang(v9, v27, v34, &v35, &v36, &v37); + VAL v38; + VAL v39; + mw_mirth_elab_abZ_ctxZAt(v31, &v38, &v39); + VAL v40; + VAL v41; + mw_mirth_elab_abZ_typeZAt(v38, &v40, &v41); + VAL v42; + uint64_t v43; + mw_mirth_elab_abZ_tokenZAt(v40, &v42, &v43); + VAL v44 = mtw_mirth_arrow_Lambda_Lambda(v43, v39, v41, v12, v37); + VAL v45 = mtw_mirth_arrow_Op_OpLambda(v44); + VAL v46; + VAL v47; + mw_mirth_elab_abZ_opZBang(v45, v36, v42, &v46, &v47); + x17 = v47; + x16 = v46; + x15 = v35; + } + VAL v48; + VAL v49; + mw_mirth_elab_abZ_unifyZ_typeZBang(x15, x16, x17, &v48, &v49); + VAL v50; + VAL v51; + mw_mirth_elab_finalizzeZ_wordZ_arrow(v48, v49, v7, &v50, &v51); + incref(v51); + VAL v52 = mw_mirth_elab_checkZ_inlineZ_recursionZ_arrowZBang(v50, v0, v51); + push_value(v51); + push_resource(v52); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp21_0 (void) { + uint64_t v0 = pop_u64(); + VAL r1 = pop_resource(); + VAL v2 = mw_mirth_arrow_Block_ctx(v0); + VAL v3 = mw_mirth_arrow_Block_dom(v0); + VAL v4 = mw_mirth_arrow_Block_cod(v0); + uint64_t v5 = mw_mirth_arrow_Block_token(v0); + VAL v6 = mw_mirth_arrow_Block_home(v0); + VAL v7; + VAL v8; + mw_mirth_elab_elabZ_arrowZ_homZBang(r1, v2, v3, v4, v5, v6, &v7, &v8); + push_resource(v7); + push_value(v8); +} +static void mb_mirth_mirth_PropLabel_prop_1_sp22_6 (void) { VAL v0 = pop_value(); VAL r1 = pop_resource(); VAL v2; @@ -87251,311 +66462,182 @@ static void mb_mirth_mirth_PropLabel_prop3_1_ZLParenmirthZDotelabZDotelabZ_alias incref(v14); VAL v15 = MKI64(0LL /* Nil */); VAL v16 = MKI64(0LL /* Nil */); - VAL v17; - VAL v18; - mw_std_list_List_1_uncons(v14, &v17, &v18); - uint64_t x19; - VAL x20; - int64_t x21; - VAL x22; - VAL x23; - VAL x24; - VAL x25; - int64_t x26; - switch (get_data_tag(v17)) { - case 1LL: { // Some - VAL v27 = mtp_std_maybe_Maybe_1_Some(v17); - incref(v27); - int64_t v28 = mw_mirth_def_Def_arity(v27); - int64_t v29 = mw_mirth_elab_arityZ_compatibleZAsk(v13, v28); - uint64_t x30; - VAL x31; - int64_t x32; - VAL x33; - VAL x34; - if (((bool)v29)) { - VAL v35 = mtw_std_either_Either_2_Right(v27); - x34 = v35; - x33 = v12; - x32 = v13; - x31 = v11; - x30 = VU64(v5); - } else { - VAL v36 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v27); - VAL v37 = mtw_std_either_Either_2_Left(v36); - x34 = v37; - x33 = v12; - x32 = v13; - x31 = v11; - x30 = VU64(v5); - } - uint64_t x38; - VAL x39; - int64_t x40; - VAL x41; - VAL x42; - VAL x43; - switch (get_data_tag(x34)) { - case 0LL: { // Left - VAL v44 = mtp_std_either_Either_2_Left(x34); - VAL v45 = mtw_std_list_List_1_Cons(v44, v15); - x43 = v16; - x42 = v45; - x41 = x33; - x40 = x32; - x39 = x31; - x38 = x30; - } break; - case 1LL: { // Right - VAL v46 = mtp_std_either_Either_2_Right(x34); - VAL v47 = mtw_std_list_List_1_Cons(v46, v16); - x43 = v47; - x42 = v15; - x41 = x33; - x40 = x32; - x39 = x31; - x38 = x30; - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - int64_t v48 = 1LL /* True */; - x26 = v48; - x25 = v18; - x24 = x43; - x23 = x42; - x22 = x41; - x21 = x40; - x20 = x39; - x19 = x38; - } break; - case 0LL: { // None - int64_t v49 = 0LL /* False */; - x26 = v49; - x25 = v18; - x24 = v16; - x23 = v15; - x22 = v12; - x21 = v13; - x20 = v11; - x19 = VU64(v5); - } break; - default: { - do_panic(str_make("unexpected fallthrough in match\n", 32)); - } - } - uint64_t v50 = x19; - VAL v51 = (x20); - int64_t v52 = x21; - VAL v53 = (x22); - VAL v54 = x23; - VAL v55 = x24; - VAL v56 = x25; - int64_t v57 = x26; - while (((bool)v57)) { - uint64_t v58 = v50; - VAL v59 = (v51); - int64_t v60 = v52; - VAL v61 = (v53); - VAL v62 = v54; - VAL v63 = v55; - VAL v64 = v56; - VAL v65; - VAL v66; - mw_std_list_List_1_uncons(v64, &v65, &v66); - uint64_t x67; - VAL x68; - int64_t x69; - VAL x70; - VAL x71; - VAL x72; - VAL x73; - int64_t x74; - switch (get_data_tag(v65)) { - case 1LL: { // Some - VAL v75 = mtp_std_maybe_Maybe_1_Some(v65); - incref(v75); - int64_t v76 = mw_mirth_def_Def_arity(v75); - int64_t v77 = mw_mirth_elab_arityZ_compatibleZAsk(v60, v76); - uint64_t x78; - VAL x79; - int64_t x80; - VAL x81; - VAL x82; - if (((bool)v77)) { - VAL v83 = mtw_std_either_Either_2_Right(v75); - x82 = v83; - x81 = v61; - x80 = v60; - x79 = v59; - x78 = v58; + int64_t v17 = 1LL /* True */; + VAL v18 = v12; + int64_t v19 = v13; + VAL v20 = v15; + VAL v21 = v16; + VAL v22 = v14; + int64_t v23 = v17; + int64_t v24 = v17; + while (((bool)v24)) { + VAL v25 = v18; + int64_t v26 = v19; + VAL v27 = v20; + VAL v28 = v21; + VAL v29 = v22; + int64_t v30 = v23; + int64_t x31; + VAL x32; + VAL x33; + VAL x34; + VAL x35; + int64_t x36; + switch (get_data_tag(v29)) { + case 1LL: { // Cons + VAL v37; + VAL v38; + mtp_std_list_List_1_Cons(v29, &v37, &v38); + incref(v37); + int64_t v39 = mw_mirth_def_Def_arity(v37); + int64_t v40 = mw_mirth_elab_arityZ_compatibleZAsk(v26, v39); + int64_t x41; + VAL x42; + VAL x43; + if (((bool)v40)) { + VAL v44 = mtw_std_either_Either_2_Right(v37); + x43 = v44; + x42 = v25; + x41 = v26; } else { - VAL v84 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v75); - VAL v85 = mtw_std_either_Either_2_Left(v84); - x82 = v85; - x81 = v61; - x80 = v60; - x79 = v59; - x78 = v58; + VAL v45 = mtw_mirth_elab_RejectedDef_RDz_WRONGz_ARITY(v37); + VAL v46 = mtw_std_either_Either_2_Left(v45); + x43 = v46; + x42 = v25; + x41 = v26; } - uint64_t x86; - VAL x87; - int64_t x88; - VAL x89; - VAL x90; - VAL x91; - switch (get_data_tag(x82)) { + int64_t x47; + VAL x48; + VAL x49; + VAL x50; + switch (get_data_tag(x43)) { case 0LL: { // Left - VAL v92 = mtp_std_either_Either_2_Left(x82); - VAL v93 = mtw_std_list_List_1_Cons(v92, v62); - x91 = v63; - x90 = v93; - x89 = x81; - x88 = x80; - x87 = x79; - x86 = x78; + VAL v51 = mtp_std_either_Either_2_Left(x43); + VAL v52 = mtw_std_list_List_1_Cons(v51, v27); + x50 = v28; + x49 = v52; + x48 = x42; + x47 = x41; } break; case 1LL: { // Right - VAL v94 = mtp_std_either_Either_2_Right(x82); - VAL v95 = mtw_std_list_List_1_Cons(v94, v63); - x91 = v95; - x90 = v62; - x89 = x81; - x88 = x80; - x87 = x79; - x86 = x78; + VAL v53 = mtp_std_either_Either_2_Right(x43); + VAL v54 = mtw_std_list_List_1_Cons(v53, v28); + x50 = v54; + x49 = v27; + x48 = x42; + x47 = x41; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - int64_t v96 = 1LL /* True */; - x74 = v96; - x73 = v66; - x72 = x91; - x71 = x90; - x70 = x89; - x69 = x88; - x68 = x87; - x67 = x86; + int64_t v55 = 1LL /* True */; + x36 = v55; + x35 = v38; + x34 = x50; + x33 = x49; + x32 = x48; + x31 = x47; } break; - case 0LL: { // None - int64_t v97 = 0LL /* False */; - x74 = v97; - x73 = v66; - x72 = v63; - x71 = v62; - x70 = v61; - x69 = v60; - x68 = v59; - x67 = v58; + case 0LL: { // Nil + VAL v56 = MKI64(0LL /* Nil */); + int64_t v57 = 0LL /* False */; + x36 = v57; + x35 = v56; + x34 = v28; + x33 = v27; + x32 = v25; + x31 = v26; } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - v57 = x74; - v56 = x73; - v55 = x72; - v54 = x71; - v53 = x70; - v52 = x69; - v51 = x68; - v50 = x67; + v24 = x36; + v23 = x36; + v22 = x35; + v21 = x34; + v20 = x33; + v19 = x31; + v18 = x32; } - decref(v56); - VAL v98 = mw_std_list_List_1_reverse(v54); - VAL v99 = mw_std_list_List_1_reverse(v55); - VAL v100 = VVAL(VTUP(v53)->cells[5]); - incref(v100); - VAL v101 = mw_std_list_List_1_cat(v98, v100); - VAL v102 = VTUP(v53)->cells[5]; - decref(v102); - VTUP(v53)->cells[5] = v101; - VAL v103 = VTUP(v53)->cells[4]; - decref(v103); - VTUP(v53)->cells[4] = v99; - VAL v104; - VAL v105; - mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v51, v53, &v104, &v105); - VAL v106 = MKI64(0LL /* Nil */); - VAL v107; - VAL v108; - mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v106, v104, v105, &v107, &v108); - VAL v109; - VAL v110; - mw_mirth_elab_resolveZ_defZ_endZBang(v107, v108, &v109, &v110); - uint64_t x111; - VAL x112; - VAL x113; - switch (get_data_tag(v110)) { + decref(v22); + VAL v58 = mw_std_list_List_1_reverse(v20); + VAL v59 = mw_std_list_List_1_reverse(v21); + VAL v60 = VVAL(VTUP(v18)->cells[5]); + incref(v60); + VAL v61 = mw_std_list_List_1_cat(v58, v60); + VAL v62 = VTUP(v18)->cells[5]; + decref(v62); + VTUP(v18)->cells[5] = v61; + VAL v63 = VTUP(v18)->cells[4]; + decref(v63); + VTUP(v18)->cells[4] = v59; + VAL v64; + VAL v65; + mw_mirth_elab_ZPlusResolveDef_filterZ_qualifiers(v11, v18, &v64, &v65); + VAL v66 = MKI64(0LL /* Nil */); + VAL v67; + VAL v68; + mw_mirth_elab_ZPlusResolveDef_filterZ_roots(v66, v64, v65, &v67, &v68); + VAL v69; + VAL v70; + mw_mirth_elab_resolveZ_defZ_endZBang(v67, v68, &v69, &v70); + VAL x71; + VAL x72; + switch (get_data_tag(v70)) { case 1LL: { // Some - VAL v114 = mtp_std_maybe_Maybe_1_Some(v110); - x113 = v114; - x112 = v109; - x111 = v50; + VAL v73 = mtp_std_maybe_Maybe_1_Some(v70); + x72 = v73; + x71 = v69; } break; case 0LL: { // None - lpush(&lbl_target, MKU64(v50)); - mw_mirth_mirth_ZPlusMirth_panicZ_diagnosticsZBang(v109); - VAL v115 = pop_value(); - x113 = v115; - VAL r116 = pop_resource(); - x112 = r116; - uint64_t v117 = VU64(lpop(&lbl_target)); - x111 = v117; + mw_mirth_mirth_ZPlusMirth_panicZ_diagnosticsZBang(v69); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - uint64_t x118; - VAL x119; - VAL x120; - switch (get_data_tag(x113)) { + uint64_t x76; + VAL x77; + VAL x78; + switch (get_data_tag(x72)) { case 0LL: { // DefAlias - uint64_t v121 = mtp_mirth_def_Def_DefAlias(x113); - void* v122 = mfld_mirth_alias_Alias_ZTildetarget(v121); - VAL v123; - VAL v124; - mw_mirth_mirth_Prop_1_tryZ_forceZBang(v122, x112, &v123, &v124); - uint64_t x125; - VAL x126; - VAL x127; - switch (get_data_tag(v123)) { + uint64_t v79 = mtp_mirth_def_Def_DefAlias(x72); + void* v80 = mfld_mirth_alias_Alias_ZTildetarget(v79); + VAL v81; + VAL v82; + mw_mirth_mirth_Prop_1_tryZ_forceZBang(v80, x71, &v81, &v82); + VAL x83; + uint64_t x84; + VAL x85; + switch (get_data_tag(v81)) { case 1LL: { // Some - VAL v128 = mtp_std_maybe_Maybe_1_Some(v123); - x127 = v128; - x126 = v124; - x125 = x111; + VAL v86 = mtp_std_maybe_Maybe_1_Some(v81); + x85 = v86; + x84 = VU64(v5); + x83 = v82; } break; case 0LL: { // None - STR* v129; - STRLIT(v129, "Alias points to itself, circular aliases are not allowed.", 57); - lpush(&lbl_target, MKU64(x111)); - mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(x111, MKSTR(v129), v124); - VAL v130 = pop_value(); - x127 = v130; - VAL r131 = pop_resource(); - x126 = r131; - uint64_t v132 = VU64(lpop(&lbl_target)); - x125 = v132; + incref(v5); + STR* v87; + STRLIT(v87, "Alias points to itself, circular aliases are not allowed.", 57); + mw_mirth_mirth_ZPlusMirth_emitZ_fatalZ_errorZBang(VU64(v5), MKSTR(v87), v82); } break; default: { do_panic(str_make("unexpected fallthrough in match\n", 32)); } } - x120 = x126; - x119 = x127; - x118 = x125; + x78 = x83; + x77 = x85; + x76 = x84; } break; default: { - x120 = x112; - x119 = x113; - x118 = x111; + x78 = x71; + x77 = x72; + x76 = VU64(v5); } break; } - push_value(x119); - push_resource(x120); + push_value(x77); + push_resource(x78); } diff --git a/lib/arg-parser/parse.mth b/lib/arg-parser/parse.mth index 53d5105b..3ed3688f 100644 --- a/lib/arg-parser/parse.mth +++ b/lib/arg-parser/parse.mth @@ -72,7 +72,6 @@ def(check-short-flag, +ArgumentParser(a) ArgpOption Str -- +ArgumentParser(a) Ar )) ||| Parse a short cli flag, possibly with a argument value -inline: def(parse-flags-where(f), (+ArgumentParser(a) ArgpOption Str -- +ArgumentParser(a) ArgpOption Bool) +ArgumentParser(a) Str -- +ArgumentParser(a) Maybe(ArgumentParsingError), argument-parser options diff --git a/lib/std/buffer.mth b/lib/std/buffer.mth index 9a2102c8..6c0b31c7 100644 --- a/lib/std/buffer.mth +++ b/lib/std/buffer.mth @@ -105,7 +105,7 @@ def(+Buffer.!Byte, Byte UOffset +Buffer -- +Buffer, def(+Buffer.!Str, Str UOffset +Buffer -- +Buffer, over num-bytes prepare-span! - base unsafe(uoffset !Str+ drop)) + base unsafe(uoffset !Str)) def(+Buffer.@Str, UOffset USize +Buffer -- Str +Buffer, tuck prepare-span! base unsafe(uoffset swap Str.ClonePtrSlice)) diff --git a/lib/std/byte.mth b/lib/std/byte.mth index bfee23eb..a827f913 100644 --- a/lib/std/byte.mth +++ b/lib/std/byte.mth @@ -5,136 +5,150 @@ import(std.maybe) import(std.str) import(std.list) -data(Byte, - BNUL, BSOH, BSTX, BETX, BEOT, BENQ, BACK, BBEL, - BBS, BHT, BLF, BVT, BFF, BCR, BSO, BSI, - BDLE, BDC1, BDC2, BDC3, BDC4, BNAK, BSYN, BETB, - BCAN, BEM, BSUB, BESC, BFS, BGS, BRS, BUS, - BSPACE, B'!', BQUOTE, BHASH, B'$', B'%', B'&', BTICK, - BLPAREN, BRPAREN, B'*', B'+', BCOMMA, B'-', BDOT, B'/', - B'0', B'1', B'2', B'3', B'4', B'5', B'6', B'7', - B'8', B'9', BCOLON, B';', B'<', B'=', B'>', B'?', - B'@', B'A', B'B', B'C', B'D', B'E', B'F', B'G', - B'H', B'I', B'J', B'K', B'L', B'M', B'N', B'O', - B'P', B'Q', B'R', B'S', B'T', B'U', B'V', B'W', - B'X', B'Y', B'Z', BLSQUARE, B'\', BRSQUARE, B'^', B'_', - B'`', B'a', B'b', B'c', B'd', B'e', B'f', B'g', - B'h', B'i', B'j', B'k', B'l', B'm', B'n', B'o', - B'p', B'q', B'r', B's', B't', B'u', B'v', B'w', - B'x', B'y', B'z', BLCURLY, B'|', BRCURLY, B'~', BDEL, - - Bx80, Bx81, Bx82, Bx83, Bx84, Bx85, Bx86, Bx87, - Bx88, Bx89, Bx8A, Bx8B, Bx8C, Bx8D, Bx8E, Bx8F, - Bx90, Bx91, Bx92, Bx93, Bx94, Bx95, Bx96, Bx97, - Bx98, Bx99, Bx9A, Bx9B, Bx9C, Bx9D, Bx9E, Bx9F, - BxA0, BxA1, BxA2, BxA3, BxA4, BxA5, BxA6, BxA7, - BxA8, BxA9, BxAA, BxAB, BxAC, BxAD, BxAE, BxAF, - BxB0, BxB1, BxB2, BxB3, BxB4, BxB5, BxB6, BxB7, - BxB8, BxB9, BxBA, BxBB, BxBC, BxBD, BxBE, BxBF, - BxC0, BxC1, BxC2, BxC3, BxC4, BxC5, BxC6, BxC7, - BxC8, BxC9, BxCA, BxCB, BxCC, BxCD, BxCE, BxCF, - BxD0, BxD1, BxD2, BxD3, BxD4, BxD5, BxD6, BxD7, - BxD8, BxD9, BxDA, BxDB, BxDC, BxDD, BxDE, BxDF, - BxE0, BxE1, BxE2, BxE3, BxE4, BxE5, BxE6, BxE7, - BxE8, BxE9, BxEA, BxEB, BxEC, BxED, BxEE, BxEF, - BxF0, BxF1, BxF2, BxF3, BxF4, BxF5, BxF6, BxF7, - BxF8, BxF9, BxFA, BxFB, BxFC, BxFD, BxFE, BxFF) +data Byte { + 0x00 BNUL, BSOH, BSTX, BETX, BEOT, BENQ, BACK, BBEL, + 0x08 BBS, BHT, BLF, BVT, BFF, BCR, BSO, BSI, + 0x10 BDLE, BDC1, BDC2, BDC3, BDC4, BNAK, BSYN, BETB, + 0x18 BCAN, BEM, BSUB, BESC, BFS, BGS, BRS, BUS, + 0x20 BSPACE, B'!', BQUOTE, BHASH, B'$', B'%', B'&', BTICK, + 0x28 BLPAREN, BRPAREN, B'*', B'+', BCOMMA, B'-', BDOT, B'/', + 0x30 B'0', B'1', B'2', B'3', B'4', B'5', B'6', B'7', + 0x38 B'8', B'9', BCOLON, B';', B'<', B'=', B'>', B'?', + 0x40 B'@', B'A', B'B', B'C', B'D', B'E', B'F', B'G', + 0x48 B'H', B'I', B'J', B'K', B'L', B'M', B'N', B'O', + 0x50 B'P', B'Q', B'R', B'S', B'T', B'U', B'V', B'W', + 0x58 B'X', B'Y', B'Z', BLSQUARE, B'\', BRSQUARE, B'^', B'_', + 0x60 B'`', B'a', B'b', B'c', B'd', B'e', B'f', B'g', + 0x68 B'h', B'i', B'j', B'k', B'l', B'm', B'n', B'o', + 0x70 B'p', B'q', B'r', B's', B't', B'u', B'v', B'w', + 0x78 B'x', B'y', B'z', BLCURLY, B'|', BRCURLY, B'~', BDEL, + + 0x80 Bx80 Bx81 Bx82 Bx83 Bx84 Bx85 Bx86 Bx87 + 0x88 Bx88 Bx89 Bx8A Bx8B Bx8C Bx8D Bx8E Bx8F + 0x90 Bx90 Bx91 Bx92 Bx93 Bx94 Bx95 Bx96 Bx97 + 0x98 Bx98 Bx99 Bx9A Bx9B Bx9C Bx9D Bx9E Bx9F + 0xA0 BxA0 BxA1 BxA2 BxA3 BxA4 BxA5 BxA6 BxA7 + 0xA8 BxA8 BxA9 BxAA BxAB BxAC BxAD BxAE BxAF + 0xB0 BxB0 BxB1 BxB2 BxB3 BxB4 BxB5 BxB6 BxB7 + 0xB8 BxB8 BxB9 BxBA BxBB BxBC BxBD BxBE BxBF + 0xC0 BxC0 BxC1 BxC2 BxC3 BxC4 BxC5 BxC6 BxC7 + 0xC8 BxC8 BxC9 BxCA BxCB BxCC BxCD BxCE BxCF + 0xD0 BxD0 BxD1 BxD2 BxD3 BxD4 BxD5 BxD6 BxD7 + 0xD8 BxD8 BxD9 BxDA BxDB BxDC BxDD BxDE BxDF + 0xE0 BxE0 BxE1 BxE2 BxE3 BxE4 BxE5 BxE6 BxE7 + 0xE8 BxE8 BxE9 BxEA BxEB BxEC BxED BxEE BxEF + 0xF0 BxF0 BxF1 BxF2 BxF3 BxF4 BxF5 BxF6 BxF7 + 0xF8 BxF8 BxF9 BxFA BxFB BxFC BxFD BxFE BxFF +} inline ( - def(Byte.>Int, Byte -- Int, Byte.cons-value) - def(Byte.>U8, Byte -- U8, >Int >U8-unsafe) - - def(Int.>Byte-unsafe, Int -- Byte, Byte.from-cons-value-unsafe) - def(U8.>Byte, U8 -- Byte, >Int >Byte-unsafe) - - def(Int.>Byte?, Int -- Maybe(Byte), - dup 0 255 in-range if(>Byte-unsafe Some, drop None)) - def(Int.>Byte&, Int -- Byte, >U8& >Byte) - def(Int.>Byte(f), (*a Int -- *a Byte) *a Int -- *a Byte, - >U8(f >U8) >Byte) - - def(Byte.compare, Byte Byte -- Comparison, both(>Int) .compare) - def(Byte.==, Byte Byte -- Bool, both(>Int) ==) - def(Byte.<, Byte Byte -- Bool, both(>Int) <) - def(Byte.>, Byte Byte -- Bool, both(>Int) >) - def(Byte.<=, Byte Byte -- Bool, both(>Int) <=) - def(Byte.>=, Byte Byte -- Bool, both(>Int) >=) - def(Byte.<>, Byte Byte -- Bool, both(>Int) <>) - def(Byte.in-range, Byte Byte Byte -- Bool, dip(both(>Int)) >Int in-range) - def(Byte.clamp, Byte Byte Byte -- Byte, dip(both(>Int)) >Int clamp >Byte-unsafe) + def Byte.>Int [ Byte -- Int ] { Byte.cons-value } + def Byte.>U8 [ Byte -- U8 ] { >Int >U8-unsafe } + + def Int.>Byte-unsafe [ Int -- Byte ] { Byte.from-cons-value-unsafe } + def U8.>Byte [ U8 -- Byte ] { >Int >Byte-unsafe } + + def Int.>Byte& [ Int -- Byte ] { >U8& >Byte } + + def Int.>Byte(f,g) [ (*a Byte -- *b, *a Int -- *b) *a Int -- *b ] { + dup 0 255 in-range if(>Byte-unsafe f, g) + } + def Int.>Byte(f) [ (*a Int -- *a Byte) *a Int -- *a Byte ] { + >U8(f >U8) >Byte + } + def Int.>Byte? [ Int -- Maybe(Byte) ] { + >Byte(Some, drop None) + } + + def Byte.compare [ Byte Byte -- Comparison ] { on2(>Int) .compare } + def Byte.== [ Byte Byte -- Bool ] { on2(>Int) == } + def Byte.< [ Byte Byte -- Bool ] { on2(>Int) < } + def Byte.> [ Byte Byte -- Bool ] { on2(>Int) > } + def Byte.<= [ Byte Byte -- Bool ] { on2(>Int) <= } + def Byte.>= [ Byte Byte -- Bool ] { on2(>Int) >= } + def Byte.<> [ Byte Byte -- Bool ] { on2(>Int) <> } + def Byte.in-range [ Byte Byte Byte -- Bool ] { on3(>Int) in-range } + def Byte.clamp [ Byte Byte Byte -- Byte ] { on3(>Int) clamp >Byte-unsafe } + + def Ptr.@Byte [ Ptr +Unsafe -- Byte +Unsafe ] { @U8 >Byte } + def Ptr.!Byte [ Byte Ptr +Unsafe -- +Unsafe ] { dip(>U8) !U8 } + + def Byte.is-upper [ Byte -- Bool ] { B'A' B'Z' in-range } + def Byte.is-lower [ Byte -- Bool ] { B'a' B'z' in-range } + def Byte.is-digit [ Byte -- Bool ] { B'0' B'9' in-range } + def Byte.is-alpha [ Byte -- Bool ] { dup on2(is-upper, is-lower) || } + def Byte.is-alnum [ Byte -- Bool ] { dup on2(is-digit, is-alpha) || } + def Byte.is-printable [ Byte -- Bool ] { B'!' B'~' in-range } + def Byte.is-hexdigit [ Byte -- Bool ] { + dup dup on3(is-digit, B'A' B'F' in-range, B'a' B'f' in-range) || || + } + def Byte.is-ascii [ Byte -- Bool ] { BNUL BDEL in-range } + def Byte.is-upper-or-underscore [ Byte -- Bool ] { + dup on2(is-upper, B'_' ==) || + } + def Byte.is-overload-trigger [ Byte -- Bool ] { + is-upper-or-underscore not + } + def Byte.is-sign [ Byte -- Bool ] { + dup on2(B'-' ==, B'+' ==) || + } + + def Byte.emit-unsafe; [ +Str Byte -- +Str ] { push-byte-unsafe! } + def Byte.emit-ascii; [ +Str Byte -- +Str ] { push-byte-ascii! } + ) -def(Ptr.@Byte, Ptr +Unsafe -- Byte +Unsafe, @U8 >Byte) -def(Ptr.!Byte, Byte Ptr +Unsafe -- +Unsafe, dip(>U8) !U8) - -def(Byte.is-upper, Byte -- Bool, B'A' B'Z' in-range) -def(Byte.is-lower, Byte -- Bool, B'a' B'z' in-range) -def(Byte.is-digit, Byte -- Bool, B'0' B'9' in-range) -def(Byte.is-alpha, Byte -- Bool, dup is-upper if(drop True, is-lower)) -def(Byte.is-alnum, Byte -- Bool, dup is-digit if(drop True, is-alpha)) -def(Byte.is-printable, Byte -- Bool, B'!' B'~' in-range) - -def(Byte.is-hexdigit, Byte -- Bool, - B'0' -> True, B'1' -> True, B'2' -> True, B'3' -> True, - B'4' -> True, B'5' -> True, B'6' -> True, B'7' -> True, - B'8' -> True, B'9' -> True, B'A' -> True, B'B' -> True, - B'C' -> True, B'D' -> True, B'E' -> True, B'F' -> True, - B'a' -> True, B'b' -> True, B'c' -> True, - B'd' -> True, B'e' -> True, B'f' -> True, - _ -> drop False) - -def(Byte.emit-unsafe;, +Str Byte -- +Str, push-byte-unsafe!) -def(Byte.emit-ascii;, +Str Byte -- +Str, push-byte-ascii!) - -def(Byte.to-str-unsafe, Byte -- Str, - L1 Str.from-bytes-unsafe) -def(Byte.to-ascii-str, Byte -- Maybe(Str), +def Byte.to-str-unsafe [ Byte -- Str ] { + L1 Str.from-bytes-unsafe +} + +def Byte.to-ascii-str [ Byte -- Maybe(Str) ] { dup BNUL BDEL in-range if( to-str-unsafe Some, drop None - )) + ) +} -def(Byte.is-string-end, Byte -- Bool, - BQUOTE -> True, BLF -> True, BNUL -> True, _ -> drop False) +def Byte.is-string-end [ Byte -- Bool ] { + { BQUOTE -> True } + { BLF -> True } + { BNUL -> True } + { _ -> drop False } +} -def(Byte.to-lower, Byte -- Byte, - dup is-upper if(>Int 0x20 + >Byte-unsafe, id)) -def(Byte.to-upper, Byte -- Byte, - dup is-lower if(>Int 0x20 - >Byte-unsafe, id)) +def Byte.to-lower [ Byte -- Byte ] { + dup is-upper then(>Int 0x20 + >Byte-unsafe) +} -def(Byte.to-hexdigits, Byte -- Byte Byte, +def Byte.to-upper [ Byte -- Byte ] { + dup is-lower then(>Int 0x20 - >Byte-unsafe) +} + +def Byte.to-hexdigits [ Byte -- Byte Byte ] { >Int dup 4 >> one-hexdigit-byte - swap 0xF & one-hexdigit-byte) -def(one-hexdigit-byte, Int -- Byte, - dup 9 > if(55, 48) + >Byte-unsafe) - -def(Byte.is-name-byte, Byte -- Bool, - BLPAREN -> False, - BRPAREN -> False, - BLSQUARE -> False, - BRSQUARE -> False, - BLCURLY -> False, - BRCURLY -> False, - BCOMMA -> False, - BQUOTE -> False, - BCOLON -> False, - BDEL -> False, - _ -> BSPACE >) - -def(Byte.is-sign, Byte -- Bool, - B'-' -> True, - B'+' -> True, - _ -> drop False) - -def(Byte.is-upper-or-underscore, Byte -- Bool, - B'_' -> True, - _ -> is-upper) - -def(Byte.is-overload-trigger, Byte -- Bool, - is-upper-or-underscore not) - -def(Byte.zencode, Byte -- Str, + swap 0xF & one-hexdigit-byte +} + +def one-hexdigit-byte [ Int -- Byte ] { + dup 9 > if(55, 48) + >Byte-unsafe +} + +def Byte.is-name-byte [ Byte -- Bool ] { + { BLPAREN -> False } + { BRPAREN -> False } + { BLSQUARE -> False } + { BRSQUARE -> False } + { BLCURLY -> False } + { BRCURLY -> False } + { BCOMMA -> False } + { BQUOTE -> False } + { BCOLON -> False } + { BDEL -> False } + { _ -> BSPACE > } +} + +def Byte.zencode [ Byte -- Str ] { ||| Encode byte as a readable string of alphanumeric or underscore characters. ||| Alphanumeric ASCII characters other than 'z' and 'Z' are left as is. ||| Otherwise, they are encoded as a string beginning with 'z' or 'Z'. @@ -144,25 +158,35 @@ def(Byte.zencode, Byte -- Str, # is unique. To help enforce the invariant, keep these cases in # lexicographical order. - B'&' -> "ZAmp", B'?' -> "ZAsk", B'@' -> "ZAt", - B'\' -> "ZBSlash", B'!' -> "ZBang", - B'^' -> "ZCaret", BCOLON -> "ZColon", BCOMMA -> "ZComma", - B'/' -> "ZDiv", B'$' -> "ZDollar", BDOT -> "ZDot", - B'=' -> "ZEqual", - BHASH -> "ZHash", - BLCURLY -> "ZLCurly", BLPAREN -> "ZLParen", BLSQUARE -> "ZLSquare", B'<' -> "ZLess", - B'%' -> "ZMod", B'*' -> "ZMul", - B'|' -> "ZPipe", B'+' -> "ZPlus", - BQUOTE -> "ZQuote", - BRCURLY -> "ZRCurly", BRPAREN -> "ZRParen", BRSQUARE -> "ZRSquare", - B';' -> "ZThen", BTICK -> "ZTick", B'~' -> "ZTilde", B'>' -> "ZTo", - - B'Z' -> "ZZ", B'-' -> "Z_", - B'z' -> "zz", B'_' -> "z_", - - _ -> + { B'&' -> "ZAmp" } { B'?' -> "ZAsk" } { B'@' -> "ZAt" } + { B'\' -> "ZBSlash" } { B'!' -> "ZBang" } + { B'^' -> "ZCaret" } { BCOLON -> "ZColon" } { BCOMMA -> "ZComma" } + { B'/' -> "ZDiv" } { B'$' -> "ZDollar" } { BDOT -> "ZDot" } + { B'=' -> "ZEqual" } + { BHASH -> "ZHash" } + { BLCURLY -> "ZLCurly" } + { BLPAREN -> "ZLParen" } + { BLSQUARE -> "ZLSquare" } + { B'<' -> "ZLess" } + { B'%' -> "ZMod" } + { B'*' -> "ZMul" } + { B'|' -> "ZPipe" } + { B'+' -> "ZPlus" } + { BQUOTE -> "ZQuote" } + { BRCURLY -> "ZRCurly" } + { BRPAREN -> "ZRParen" } + { BRSQUARE -> "ZRSquare" } + { B';' -> "ZThen" } + { BTICK -> "ZTick" } + { B'~' -> "ZTilde" } + { B'>' -> "ZTo" } + + { B'Z' -> "ZZ" } { B'-' -> "Z_" } + { B'z' -> "zz" } { B'_' -> "z_" } + + { _ -> dup is-alnum if( to-str-unsafe, Str("Z" ; >Int show; "U" ;) - ) - ) + ) } +} diff --git a/lib/std/either.mth b/lib/std/either.mth index 67b9fad2..b8fe1e21 100644 --- a/lib/std/either.mth +++ b/lib/std/either.mth @@ -18,38 +18,38 @@ def Either.right? [ Either(a,b) -- Maybe(b) ] { { Right -> Some } } -inline ( - def Either.map(g) [ (*x b1 -- *x b2) *x Either(a,b1) -- *x Either(a,b2) ] { - { Left -> Left } - { Right -> g Right } - } +def Either.map(g) [ (*x b1 -- *x b2) *x Either(a,b1) -- *x Either(a,b2) ] { + { Left -> Left } + { Right -> g Right } +} - def Either.map(f,g) [ (*x a1 -- *y a2, *x b1 -- *y b2) *x Either(a1,b1) -- *y Either(a2,b2) ] { - { Left -> f Left } - { Right -> g Right } - } +def Either.map(f,g) [ (*x a1 -- *y a2, *x b1 -- *y b2) *x Either(a1,b1) -- *y Either(a2,b2) ] { + { Left -> f Left } + { Right -> g Right } +} - def Either.for(g) [ (*x b -- *x) *x Either(a,b) -- *x ] { - { Left -> drop } - { Right -> g } - } +def Either.for(g) [ (*x b -- *x) *x Either(a,b) -- *x ] { + { Left -> drop } + { Right -> g } +} - def Either.either(f,g) [ (*x a -- *y, *x b -- *y) *x Either(a,b) -- *y ] { - { Left -> f } - { Right -> g } - } +def Either.either(f,g) [ (*x a -- *y, *x b -- *y) *x Either(a,b) -- *y ] { + { Left -> f } + { Right -> g } +} - def Either.bind(g) [ (*x b1 -- *x Either(a,b2)) *x Either(a,b1) -- *x Either(a,b2) ] { - { Left -> Left } - { Right -> g } - } +def Either.bind(g) [ (*x b1 -- *x Either(a,b2)) *x Either(a,b1) -- *x Either(a,b2) ] { + { Left -> Left } + { Right -> g } +} +inline ( def while-left(f) [ (*c a -- *c Either(a,b)) *c a -- *c b ] { - f while-some(dup left?, nip f) + Left while-some(dup left?, nip f) right? unwrap(impossible!) } def while-right(f) [ (*c b -- *c Either(a,b)) *c b -- *c a ] { - f while-some(dup right?, nip f) + Right while-some(dup right?, nip f) left? unwrap(impossible!) } ) diff --git a/lib/std/file.mth b/lib/std/file.mth index fc973bf5..937da6e6 100644 --- a/lib/std/file.mth +++ b/lib/std/file.mth @@ -15,12 +15,10 @@ data(+File, +File -> owned: Bool) data(+File?, +FileOk -> +File, +FileErr -> Str) -inline( - def +File?.unwrap!(f) [ (*a Str -- *a +File) *a +File? -- *a +File ] { - { +FileOk -> id } - { +FileErr -> f } - } -) +def +File?.unwrap!(f) [ (*a Str -- *a +File) *a +File? -- *a +File ] { + { +FileOk -> id } + { +FileErr -> f } +} def(+World.open-file!, Path +World -- +World +File?, dup >Str 0 0 posix-open! diff --git a/lib/std/list.mth b/lib/std/list.mth index d7c69c45..ec410696 100644 --- a/lib/std/list.mth +++ b/lib/std/list.mth @@ -16,16 +16,16 @@ struct List+(t) { } inline( - def L0 [ -- List(t) ] { Nil } - def L1 [ t -- List(t) ] { Nil Cons } + def L0 [ -- List(t) ] { Nil } + def L1 [ t -- List(t) ] { Nil Cons } def L2 [ t t -- List(t) ] { Nil Cons Cons } - def L3 [ t t t -- List(t) ] { Nil Cons Cons Cons } - def L4 [ t t t t -- List(t) ] { Nil Cons Cons Cons Cons } - def L5 [ t t t t t -- List(t) ] { Nil Cons Cons Cons Cons Cons } - def L6 [ t t t t t t -- List(t) ] { Nil Cons Cons Cons Cons Cons Cons } - def L7 [ t t t t t t t -- List(t) ] { Nil Cons Cons Cons Cons Cons Cons Cons } - def L8 [ t t t t t t t t -- List(t) ] { Nil Cons Cons Cons Cons Cons Cons Cons Cons } ) +def L3 [ t t t -- List(t) ] { Nil Cons Cons Cons } +def L4 [ t t t t -- List(t) ] { Nil Cons Cons Cons Cons } +def L5 [ t t t t t -- List(t) ] { Nil Cons Cons Cons Cons Cons } +def L6 [ t t t t t t -- List(t) ] { Nil Cons Cons Cons Cons Cons Cons } +def L7 [ t t t t t t t -- List(t) ] { Nil Cons Cons Cons Cons Cons Cons Cons } +def L8 [ t t t t t t t t -- List(t) ] { Nil Cons Cons Cons Cons Cons Cons Cons Cons } def List./L0 [ List(t) -- Bool ] { Nil -> True, _ -> drop False } def List./L1 [ List(t) -- Maybe(t) ] { Cons -> match(Nil -> Some, _ -> drop2 None), _ -> drop None } @@ -48,9 +48,9 @@ inline( def L8+ [ t t t t t t t t -- List+(t) ] { L7 >tail >head List+ } def List+.>List [ List+(t) -- List(t) ] { /List+ head> tail> Cons } def List+.len [ List+(t) -- Nat ] { tail len 1+ } - def List+./L1+ [ List+(t) -- Maybe(t) ] { /List+ head> tail> /L0 if(Some, drop None) } - def List+./L2+ [ List+(t) -- Maybe([t t]) ] { /List+ tail> /L1 map(@head swap pack2) head> drop } ) +def List+./L1+ [ List+(t) -- Maybe(t) ] { /List+ head> tail> /L0 if(Some, drop None) } +def List+./L2+ [ List+(t) -- Maybe([t t]) ] { /List+ tail> /L1 map(@head swap pack2) head> drop } def List.>List+ [ List(t) -- Maybe(List+(t)) ] { { Nil -> None } @@ -108,201 +108,206 @@ def List+.last [ List+(t) -- t ] { uncons for(nip) } ||| Reverse the list. def List.reverse [ List(a) -- List(a) ] { - L0 swap for(swap Cons) + Nil swap for(swap Cons) } +||| Reverse the list. def List+.reverse [ List+(t) -- List+(t) ] { uncons dip(L1+) for(swap cons+) } -||| Reverse the list. -inline( - ||| Transform each element of the list. - def List.map(f) [ (*c a -- *c b) *c List(a) -- *c List(b) ] { - LIST(for(rdip(f) ;)) - } +||| Transform each element of the list. +def List.map(f) [ (*c a -- *c b) *c List(a) -- *c List(b) ] { + LIST(for(rdip(f) ;)) +} - ||| Transform each element of the list. - def List+.map(f) [ (*c a -- *c b) *c List+(a) -- *c List+(b) ] { - uncons - dip(f) swap - dip(map(f)) swap - cons+ - } +||| Transform each element of the list. +def List+.map(f) [ (*c a -- *c b) *c List+(a) -- *c List+(b) ] { + uncons + dip(f) swap + dip(map(f)) swap + cons+ +} - ||| Traverse the list, left to right. - def List.for(f) [ (*c a -- *c) *c List(a) -- *c ] { - while-some(uncons swap, swap dip(f)) drop +inline ( + def List.if-cons(f,g) [ (*a x List(x) -- *b, *a -- *b) *a List(x) -- *b ] { + { Cons -> f } + { Nil -> g } } +) - ||| Traverse the list, left to right. - def List+.for(f) [ (*c a -- *c) *c List+(a) -- *c ] { - uncons dip(f) for(f) - } +||| Traverse the list, left to right. +def List.for(f) [ (*c a -- *c) *c List(a) -- *c ] { + while(if-cons(dip(f) True, Nil False)) drop +} - ||| Traverse the list, right to left. - def List.reverse-for(f) [ (*c a -- *c) *c List(a) -- *c ] { - reverse for(f) - } +||| Traverse the list, left to right. +def List+.for(f) [ (*c a -- *c) *c List+(a) -- *c ] { + uncons dip(f) for(f) +} - ||| Traverse the list, right to left. - def List+.reverse-for(f) [ (*c a -- *c) *c List+(a) -- *c ] { - uncons swap dip(reverse-for(f)) f - } +||| Traverse the list, right to left. +def List.reverse-for(f) [ (*c a -- *c) *c List(a) -- *c ] { + reverse for(f) +} - ||| Traverse the list, left to right, with an action between each item. - def List.for(f,g) [ (*a t -- *a, *a -- *a) *a List(t) -- *a ] { - uncons dip:for(f) for(dip(g) f) - } +||| Traverse the list, right to left. +def List+.reverse-for(f) [ (*c a -- *c) *c List+(a) -- *c ] { + uncons swap dip(reverse-for(f)) f +} - ||| Traverse the list, left to right, with an action between each item. - def List+.for(f,g) [ (*a t -- *b, *b -- *a) *a List+(t) -- *b ] { - uncons dip(f) for(dip(g) f) - } +||| Traverse the list, left to right, with an action between each item. +def List.for(f,g) [ (*a t -- *a, *a -- *a) *a List(t) -- *a ] { + uncons dip:for(f) for(dip(g) f) +} - ||| Reduce a list via binary operation. - def List.fold(g) [ (*c a a -- *c a) *c List(a) -- *c Maybe(a) ] { - >List+ map(fold(g)) - } +||| Traverse the list, left to right, with an action between each item. +def List+.for(f,g) [ (*a t -- *b, *b -- *a) *a List+(t) -- *b ] { + uncons dip(f) for(dip(g) f) +} - ||| Reduce a list via binary operation. - def List+.fold(g) [ (*c a a -- *c a) *c List+(a) -- *c a ] { - uncons for(g) - } +||| Reduce a list via binary operation. +def List.fold(g) [ (*c a a -- *c a) *c List(a) -- *c Maybe(a) ] { + >List+ map(fold(g)) +} - ||| Filter away any list elements that don't satisfy the predicate. - def List.filter(f) [ (*c a -- *c Bool) *c List(a) -- *c List(a) ] { - filter-some(dup dip(f) swap if(Some, drop None)) - } +||| Reduce a list via binary operation. +def List+.fold(g) [ (*c a a -- *c a) *c List+(a) -- *c a ] { + uncons for(g) +} - ||| Filter away any list elements that don't satisfy the predicate. - def List+.filter(f) [ (*c a -- *c Bool) *c List+(a) -- *c List(a) ] { - >List filter(f) - } +||| Filter away any list elements that don't satisfy the predicate. +def List.filter(f) [ (*c a -- *c Bool) *c List(a) -- *c List(a) ] { + LIST(for(dup dip:rdip(f) swap if(;, drop))) +} - ||| Transform each element of a list into a new list, and concatenate all these lists. - def List.flatmap(f) [ (*c a -- *c List(b)) *c List(a) -- *c List(b) ] { - LIST(for(rdip(f) for(;))) - } - alias(List.bind(f), List.flatmap) +||| Filter away any list elements that don't satisfy the predicate. +def List+.filter(f) [ (*c a -- *c Bool) *c List+(a) -- *c List(a) ] { + >List filter(f) +} - ||| Transform each element of a list into a new list, and concatenate all these lists. - def List+.flatmap(f) [ (*c a -- *c List(b)) *c List+(a) -- *c List(b) ] { - >List flatmap(f) - } +||| Transform each element of a list into a new list, and concatenate all these lists. +def List.flatmap(f) [ (*c a -- *c List(b)) *c List(a) -- *c List(b) ] { + LIST(for(rdip(f) for(;))) +} +alias(List.bind(f), List.flatmap) - ||| Transform each element of a list into a new list, and concatenate all these lists. - ||| This variant of [List.flatmap] preserves the non-emptiness of the list. - def List+.flatmap+(f) [ (*c a -- *c List+(b)) *c List+(a) -- *c List+(b) ] { - uncons LIST+( - dip(rdip(f) uncons dip(;+) for(;)) - for(rdip(f) for(;)) - ) - } - alias(List+.bind(f), List+.flatmap+) +||| Transform each element of a list into a new list, and concatenate all these lists. +def List+.flatmap(f) [ (*c a -- *c List(b)) *c List+(a) -- *c List(b) ] { + >List flatmap(f) +} - ||| Map each element of a list into the [Maybe] type, and collect all of the - ||| [Some] results while discarding all of the [None] results. - def List.filter-some(p) [ (*c a -- *c Maybe(b)) *c List(a) -- *c List(b) ] { - LIST(for(rdip(p) for(;))) - } +||| Transform each element of a list into a new list, and concatenate all these lists. +||| This variant of [List.flatmap] preserves the non-emptiness of the list. +def List+.flatmap+(f) [ (*c a -- *c List+(b)) *c List+(a) -- *c List+(b) ] { + uncons LIST+( + dip(rdip(f) uncons dip(;+) for(;)) + for(rdip(f) for(;)) + ) +} +alias(List+.bind(f), List+.flatmap+) - ||| Map each element of a list into the [Maybe] type, and collect all of the - ||| [Some] results while discarding all of the [None] results. - def List+.filter-some(p) [ (*c a -- *c Maybe(b)) *c List+(a) -- *c List(b) ] { - >List filter-some(p) - } +||| Map each element of a list into the [Maybe] type, and collect all of the +||| [Some] results while discarding all of the [None] results. +def List.filter-some(p) [ (*c a -- *c Maybe(b)) *c List(a) -- *c List(b) ] { + LIST(for(rdip(p) for(;))) +} - ||| Find first element that returns [Some], if it exists. - def List.find-some(f) [ (*c a -- *c Maybe(b)) *c List(a) -- *c Maybe(b) ] { - None swap while-some( - uncons swap, - dip'(dip'(f)) match( - None -> id, - _ -> dip(drop2) Nil - ) - ) drop - } +||| Map each element of a list into the [Maybe] type, and collect all of the +||| [Some] results while discarding all of the [None] results. +def List+.filter-some(p) [ (*c a -- *c Maybe(b)) *c List+(a) -- *c List(b) ] { + >List filter-some(p) +} - ||| Find first element that returns [Some], if it exists. - def List+.find-some(f) [ (*c a -- *c Maybe(b)) *c List+(a) -- *c Maybe(b) ] { - >List find-some(f) - } +||| Find first element that returns [Some], if it exists. +def List.find-some(f) [ (*c a -- *c Maybe(b)) *c List(a) -- *c Maybe(b) ] { + None swap while-some( + uncons swap, + dip'(dip'(f)) match( + None -> id, + _ -> dip(drop2) Nil + ) + ) drop +} - ||| Find last element that returns Some, if it exists. - def List.reverse-find-some(f) [ (*c a -- *c Maybe(b)) *c List(a) -- *c Maybe(b) ] { - reverse find-some(f) - } +||| Find first element that returns [Some], if it exists. +def List+.find-some(f) [ (*c a -- *c Maybe(b)) *c List+(a) -- *c Maybe(b) ] { + >List find-some(f) +} - ||| Find last element that returns Some, if it exists. - def List+.reverse-find-some(f) [ (*c a -- *c Maybe(b)) *c List+(a) -- *c Maybe(b) ] { - >List reverse-find-some(f) - } +||| Find last element that returns Some, if it exists. +def List.reverse-find-some(f) [ (*c a -- *c Maybe(b)) *c List(a) -- *c Maybe(b) ] { + reverse find-some(f) +} - ||| Find the first element that satisfies the predicate, if it exists. - def List.find(f) [ (*c a -- *c Bool) *c List(a) -- *c Maybe(a) ] { - find-some(dup dip(f) swap if(Some, drop None)) - } +||| Find last element that returns Some, if it exists. +def List+.reverse-find-some(f) [ (*c a -- *c Maybe(b)) *c List+(a) -- *c Maybe(b) ] { + >List reverse-find-some(f) +} - ||| Find the first element that satisfies the predicate, if it exists. - def List+.find(f) [ (*c a -- *c Bool) *c List+(a) -- *c Maybe(a) ] { - find-some(dup dip(f) swap if(Some, drop None)) - } +||| Find the first element that satisfies the predicate, if it exists. +def List.find(f) [ (*c a -- *c Bool) *c List(a) -- *c Maybe(a) ] { + find-some(dup dip(f) swap if(Some, drop None)) +} - ||| Find the last element that satisfies the predicate, if it exists. - def List.reverse-find(f) [ (*c a -- *c Bool) *c List(a) -- *c Maybe(a) ] { - reverse-find-some(dup dip(f) swap if(Some, drop None)) - } +||| Find the first element that satisfies the predicate, if it exists. +def List+.find(f) [ (*c a -- *c Bool) *c List+(a) -- *c Maybe(a) ] { + find-some(dup dip(f) swap if(Some, drop None)) +} - ||| Find the last element that satisfies the predicate, if it exists. - def List+.reverse-find(f) [ (*c a -- *c Bool) *c List+(a) -- *c Maybe(a) ] { - reverse-find-some(dup dip(f) swap if(Some, drop None)) - } +||| Find the last element that satisfies the predicate, if it exists. +def List.reverse-find(f) [ (*c a -- *c Bool) *c List(a) -- *c Maybe(a) ] { + reverse-find-some(dup dip(f) swap if(Some, drop None)) +} - ||| Is the predicate true for any element of the list? - def List.has(f) [ (*c a -- *c Bool) *c List(a) -- *c Bool ] { - find(f) some? - } +||| Find the last element that satisfies the predicate, if it exists. +def List+.reverse-find(f) [ (*c a -- *c Bool) *c List+(a) -- *c Maybe(a) ] { + reverse-find-some(dup dip(f) swap if(Some, drop None)) +} - ||| Is the predicate true for any element of the list? - def List+.has(f) [ (*c a -- *c Bool) *c List+(a) -- *c Bool ] { - find(f) some? - } +||| Is the predicate true for any element of the list? +def List.has(f) [ (*c a -- *c Bool) *c List(a) -- *c Bool ] { + find(f) some? +} - ||| Is the predicate true for all elements of the list? - def List.all(f) [ (*c a -- *c Bool) *c List(a) -- *c Bool ] { - find(f not) none? - } +||| Is the predicate true for any element of the list? +def List+.has(f) [ (*c a -- *c Bool) *c List+(a) -- *c Bool ] { + find(f) some? +} - ||| Is the predicate true for all elements of the list? - def List+.all(f) [ (*c a -- *c Bool) *c List+(a) -- *c Bool ] { - find(f not) none? - } +||| Is the predicate true for all elements of the list? +def List.all(f) [ (*c a -- *c Bool) *c List(a) -- *c Bool ] { + find(f not) none? +} - ||| If the predicate matches all elements of the list, return the result. Otherwise return None. - def List.all-some(f) [ (*c a -- *c Maybe(b)) *c List(a) -- *c Maybe(List(b)) ] { - >rest True >ok +L0 while-some( - @rest:uncons, - @rest(@ok(dip2:rdip(f))) if-some( - ; , - False !ok - L0 !rest - ) +||| Is the predicate true for all elements of the list? +def List+.all(f) [ (*c a -- *c Bool) *c List+(a) -- *c Bool ] { + find(f not) none? +} + +||| If the predicate matches all elements of the list, return the result. Otherwise return None. +def List.all-some(f) [ (*c a -- *c Maybe(b)) *c List(a) -- *c Maybe(List(b)) ] { + >rest True >ok +L0 while-some( + @rest:uncons, + @rest(@ok(dip2:rdip(f))) if-some( + ; , + False !ok + L0 !rest ) - rest> drop - ok> if(freeze Some, rdrop None) - } + ) + rest> drop + ok> if(freeze Some, rdrop None) +} - ||| Build a list through repetition, stopping at the first None. - def collect(f) [ (*a -- *a Maybe(b)) *a -- *a List(b) ] { - LIST(while-some(rdip(f), ;)) - } +||| Build a list through repetition, stopping at the first None. +def collect(f) [ (*a -- *a Maybe(b)) *a -- *a List(b) ] { + LIST(while-some(rdip(f), ;)) +} - ||| Build a list through repetition, stopping when condition becomes false. - def collect-while(f,g) [ (*a -- *a Bool, *a -- *a b) *a -- *a List(b) ] { - LIST(while(rdip(f), rdip(g) ;)) - } -) +||| Build a list through repetition, stopping when condition becomes false. +def collect-while(f,g) [ (*a -- *a Bool, *a -- *a b) *a -- *a List(b) ] { + LIST(while(rdip(f), rdip(g) ;)) +} ||| Count up, inclusive at both ends. def Int.range [ Int Int -- List(Int) ] { @@ -344,7 +349,7 @@ struct +List+(t) { List+(t) } inline( def +List.rdrop [ +List (t) -- ] { +List -> drop } def +List+.rdrop [ +List+(t) -- ] { +List+ -> drop } - + def +List.rdup [ +List (t) -- +List (t) +List (t) ] { +List -> dup dip(+List) +List } def +List+.rdup [ +List+(t) -- +List+(t) +List+(t) ] { +List+ -> dup dip(+List+) +List+ } @@ -371,79 +376,75 @@ inline( def(LIST+(f), (*a +List(t) -- *b +List+(t)) *a -- *b List+(t), L0 thaw f freeze) ) -inline( - def List.==(eq) [ (*c a a -- *c Bool) *c List(a) List(a) -- *c Bool ] { - True while ( - dip(dip(uncons) uncons dip(swap) dip2(==(eq)) rotl) && - over2 empty? over2 empty? && not over &&, - id - ) - dip(drop2) - } +def List.==(eq) [ (*c a a -- *c Bool) *c List(a) List(a) -- *c Bool ] { + True while ( + dip(dip(uncons) uncons dip(swap) dip2(==(eq)) rotl) && + over2 empty? over2 empty? && not over &&, + id + ) + dip(drop2) +} - def List+.==(eq) [ (*c a a -- *c Bool) *c List+(a) List+(a) -- *c Bool ] { - dip(>List) >List ==(eq) - } -) +def List+.==(eq) [ (*c a a -- *c Bool) *c List+(a) List+(a) -- *c Bool ] { + dip(>List) >List ==(eq) +} -inline( - def(List.lookup(p), (*c k a -- *c Bool) *c k List(a) -- *c Maybe(a), - find(over dip(p) swap) nip) +def(List.lookup(p), (*c k a -- *c Bool) *c k List(a) -- *c Maybe(a), + find(over dip(p) swap) nip) - def(List+.lookup(p), (*c k a -- *c Bool) *c k List+(a) -- *c Maybe(a), - find(over dip(p) swap) nip) +def(List+.lookup(p), (*c k a -- *c Bool) *c k List+(a) -- *c Maybe(a), + find(over dip(p) swap) nip) - def(List.reverse-lookup(p), (*c k a -- *c Bool) *c k List(a) -- *c Maybe(a), - reverse-find(over dip(p) swap) nip) +def(List.reverse-lookup(p), (*c k a -- *c Bool) *c k List(a) -- *c Maybe(a), + reverse-find(over dip(p) swap) nip) - def(List+.reverse-lookup(p), (*c k a -- *c Bool) *c k List+(a) -- *c Maybe(a), - reverse-find(over dip(p) swap) nip) +def(List+.reverse-lookup(p), (*c k a -- *c Bool) *c k List+(a) -- *c Maybe(a), + reverse-find(over dip(p) swap) nip) - def(List.member(p), (*c k a -- *c Bool) *c k List(a) -- *c Bool, - lookup(p) some?) +def(List.member(p), (*c k a -- *c Bool) *c k List(a) -- *c Bool, + lookup(p) some?) - def(List+.member(p), (*c k a -- *c Bool) *c k List+(a) -- *c Bool, - lookup(p) some?) +def(List+.member(p), (*c k a -- *c Bool) *c k List+(a) -- *c Bool, + lookup(p) some?) - def(List.difference(eq), (*c a a -- *c Bool) *c List(a) List(a) -- *c List(a), - swap filter(over dip(swap member(eq) not) swap) nip) +def(List.difference(eq), (*c a a -- *c Bool) *c List(a) List(a) -- *c List(a), + swap filter(over dip(swap member(eq) not) swap) nip) - def(List.union(eq), (*c a a -- *c Bool) *c List(a) List(a) -- *c List(a), - over dip(swap difference(eq)) swap cat) +def(List.union(eq), (*c a a -- *c Bool) *c List(a) List(a) -- *c List(a), + over dip(swap difference(eq)) swap cat) - def(List.unions(eq), (*c a a -- *c Bool) *c List(List(a)) -- *c List(a), - fold(union(eq)) unwrap(L0)) +def(List.unions(eq), (*c a a -- *c Bool) *c List(List(a)) -- *c List(a), + fold(union(eq)) unwrap(L0)) - def(List.map2(f), (*c x y -- *c z) *c List(x) List(y) -- *c List(z), - collect(uncons dip(dip:uncons swap dip:map2:f) rotl) dip:drop2) - def(List+.map2(f), (*c x y -- *c z) *c List+(x) List+(y) -- *c List+(z), - dip(uncons) uncons dip(swap dip:f) rotl dip(map2(f)) swap cons+) +def(List.map2(f), (*c x y -- *c z) *c List(x) List(y) -- *c List(z), + collect(uncons dip(dip:uncons swap dip:map2:f) rotl) dip:drop2) +def(List+.map2(f), (*c x y -- *c z) *c List+(x) List+(y) -- *c List+(z), + dip(uncons) uncons dip(swap dip:f) rotl dip(map2(f)) swap cons+) - def(List.take-while(p), (*a t -- *a Bool) *a List(t) -- *a List(t), - collect(uncons dip:filter(p) swap) nip) - def(List+.take-while(p), (*a t -- *a Bool) *a List+(t) -- *a List(t), - >List take-while(p)) +def(List.take-while(p), (*a t -- *a Bool) *a List(t) -- *a List(t), + collect(uncons dip:filter(p) swap) nip) +def(List+.take-while(p), (*a t -- *a Bool) *a List+(t) -- *a List(t), + >List take-while(p)) - def(List.partition-either(p), (*a t -- *a Either(t1,t2)) - *a List(t) -- *a List(t1) List(t2), - L0 L0 rotl for( - dip'(dip'(p)) match( - Left -> rotr dip(Cons), - Right -> swap Cons - ) - ) dip(reverse) reverse) +def(List.partition-either(p), (*a t -- *a Either(t1,t2)) + *a List(t) -- *a List(t1) List(t2), + L0 L0 rotl for( + dip'(dip'(p)) match( + Left -> rotr dip(Cons), + Right -> swap Cons + ) + ) dip(reverse) reverse) - def(List+.partition-either(p), (*a t -- *a Either(t1,t2)) - *a List+(t) -- *a List(t1) List(t2), - >List partition-either(p)) +def(List+.partition-either(p), (*a t -- *a Either(t1,t2)) + *a List+(t) -- *a List(t1) List(t2), + >List partition-either(p)) - def(List.partition(p), (*a t -- *a Bool) *a List(t) -- *a List(t) List(t), - partition-either(dup dip(p) swap if(Right, Left))) - def(List+.partition(p), (*a t -- *a Bool) *a List+(t) -- *a List(t) List(t), - partition-either(dup dip(p) swap if(Right, Left))) +def(List.partition(p), (*a t -- *a Bool) *a List(t) -- *a List(t) List(t), + partition-either(dup dip(p) swap if(Right, Left))) +def(List+.partition(p), (*a t -- *a Bool) *a List+(t) -- *a List(t) List(t), + partition-either(dup dip(p) swap if(Right, Left))) - def(List.show;(f), (t +Str -- +Str) List(t) +Str -- +Str, - "LIST( " ; for(f " ; " ;) ")" ;) - def(List+.show;(f), (t +Str -- +Str) List+(t) +Str -- +Str, - "LIST+( " ; unsnoc dip:for(f " ; " ;) f " ;+ )" ;) -) +def(List.show;(f), (t +Str -- +Str) List(t) +Str -- +Str, + "LIST( " ; for(f " ; " ;) ")" ;) +def(List+.show;(f), (t +Str -- +Str) List+(t) +Str -- +Str, + "LIST+( " ; unsnoc dip:for(f " ; " ;) f " ;+ )" ;) diff --git a/lib/std/map.mth b/lib/std/map.mth index e0a711e3..fa5ee520 100644 --- a/lib/std/map.mth +++ b/lib/std/map.mth @@ -10,15 +10,17 @@ import(std.maybe) data(Map(k,v), Map -> List(KVPair(k,v))) data(KVPair(k,v), KVPair -> key:k value:v) +def(Map.len, Map(k,v) -- Nat, /Map len) + def(Map.empty, -- Map(k,v), L0 Map) def(Map.pairs, Map(k,v) -- List(KVPair(k,v)), Map -> id) def(Map.keys, Map(k,v) -- List(k), Map -> map(key)) def(Map.values, Map(k,v) -- List(v), Map -> map(value)) def(Map.insert, KVPair(k,v) Map(k,v) -- Map(k,v), Map -> cons Map) -inline ( - def(Map.lookup-pair(k==), (k k -- Bool) k Map(k,v) -- Maybe(KVPair(k,v)), - Map -> lookup(key k==)) - def(Map.lookup(k==), (k k -- Bool) k Map(k,v) -- Maybe(v), - lookup-pair(k==) map(value)) -) + +def(Map.lookup-pair(k==), (*c k k -- *c Bool) *c k Map(k,v) -- *c Maybe(KVPair(k,v)), + Map -> lookup(key k==)) + +def(Map.lookup(k==), (*c k k -- *c Bool) *c k Map(k,v) -- *c Maybe(v), + lookup-pair(k==) map(value)) diff --git a/lib/std/maybe.mth b/lib/std/maybe.mth index b6090b18..abe42bdc 100644 --- a/lib/std/maybe.mth +++ b/lib/std/maybe.mth @@ -4,97 +4,87 @@ import(std.prelude) import(std.list) import(std.str) -data (Maybe(t), None, Some -> t) - -def Maybe.none? [ Maybe(t) -- Bool ] { - { None -> True } - { Some -> drop False } -} -def Maybe.some? [ Maybe(t) -- Bool ] { - { None -> False } - { Some -> drop True } -} -def Maybe.>Bool [ Maybe(t) -- Bool ] { - some? -} -def Maybe.>List [ Maybe(t) -- List(t) ] { - { None -> L0 } - { Some -> L1 } +data Maybe(t) { + 0 None + 1 Some [ t ] } inline ( - def Maybe.==(eq) [ (*c a a -- *c Bool) *c Maybe(a) Maybe(a) -- *c Bool ] { - { None -> none? } - { Some -> swap if-some(swap eq, drop False) } - } - - def Maybe.compare(cmp) [ (*c a a -- *c Comparison) *c Maybe(a) Maybe(a) -- *c Comparison ] { - { None -> match { - { None -> EQ } - { Some -> drop GT } - } } - { Some -> swap match { - { None -> drop LT } - { Some -> swap cmp } - }} - } - - def Maybe.if(f,g) { { Some -> drop f } { None -> g } } - def Maybe.then(f) { { Some -> drop f } { None -> id } } - def Maybe.else(g) { { Some -> drop } { None -> g } } - def Maybe.and(f) { { Some -> drop f } { None -> False } } - def Maybe.or(f) { { Some -> drop True } { None -> f } } -) + def Maybe.none? [ Maybe(t) -- Bool ] { cons-value 0 == } + def Maybe.some? [ Maybe(t) -- Bool ] { cons-value 1 == } + def Maybe.>Bool [ Maybe(t) -- Bool ] { some? } + def Maybe.not [ Maybe(t) -- Bool ] { none? } + def Maybe.if(f,g) { some? if(f,g) } + def Maybe.then(f) { some? then(f) } + def Maybe.else(f) { none? then(f) } + def Maybe.and(f) { some? and(f) } + def Maybe.or(f) { some? or(f) } -def Maybe.not [ Maybe(t) -- Bool ] { { Some -> drop False } { None -> True } } - -inline( def Maybe.if-some(f,g) { { Some -> f } { None -> g } } def Maybe.or-some(f) { { Some -> Some } { None -> f } } def Maybe.unwrap(f) { { Some -> id } { None -> f } } ) -inline ( - def Maybe.map(f) { { Some -> f Some } { None -> None } } - def Maybe.bind(f) { { Some -> f } { None -> None } } - def Maybe.for(f) { { Some -> f } { None -> id } } - def Maybe.has(f) { { Some -> f } { None -> False } } - def Maybe.all(f) { { Some -> f } { None -> True } } +def Maybe.>List [ Maybe(t) -- List(t) ] { + { None -> L0 } + { Some -> L1 } +} - def Maybe.filter(f) [ (*a b -- *a Bool) *a Maybe(b) -- *a Maybe(b) ] { - { Some -> dup dip(f) swap if(Some, drop None) } - { None -> None } - } +def Maybe.==(eq) [ (*c a a -- *c Bool) *c Maybe(a) Maybe(a) -- *c Bool ] { + { None -> none? } + { Some -> swap if-some(swap eq, drop False) } +} + +def Maybe.compare(cmp) [ (*c a a -- *c Comparison) *c Maybe(a) Maybe(a) -- *c Comparison ] { + { None -> match { + { None -> EQ } + { Some -> drop GT } + } } + { Some -> swap match { + { None -> drop LT } + { Some -> swap cmp } + }} +} + +def Maybe.map(f) { { Some -> f Some } { None -> None } } +def Maybe.bind(f) { { Some -> f } { None -> None } } +def Maybe.for(f) { { Some -> f } { None -> id } } +def Maybe.has(f) { { Some -> f } { None -> False } } +def Maybe.all(f) { { Some -> f } { None -> True } } +def Maybe.filter(f) [ (*a b -- *a Bool) *a Maybe(b) -- *a Maybe(b) ] { + { Some -> dup dip(f) swap if(Some, drop None) } + { None -> None } +} + +inline ( def while-some(f,g) [ (*a -- *a Maybe(b), *a b -- *a) *a -- *a ] { - while(f if-some(g True, False), id) + while(f if-some(g True, False)) } def while-none(f,g) [ (*a -- *a Maybe(b), *a -- *a) *a -- *a b ] { - f while(dup none?, drop g f) + None while(drop f dup if(False, dip:g True)) unwrap(impossible!) } +) - def Maybe.map2(f) [ (*c x y -- *c z) *c Maybe(x) Maybe(y) -- *c Maybe(z) ] { - { None -> drop None } - { Some -> - swap match { - { None -> drop None } - { Some -> swap f Some } - } +def Maybe.map2(f) [ (*c x y -- *c z) *c Maybe(x) Maybe(y) -- *c Maybe(z) ] { + { None -> drop None } + { Some -> + swap match { + { None -> drop None } + { Some -> swap f Some } } } -) +} def Maybe.zip [ Maybe(x) Maybe(y) -- Maybe([x y]) ] { map2(pack2) } -inline ( - def Maybe.show;(f) [ (t +Str -- +Str) Maybe(t) +Str -- +Str ] { - { None -> "None" ; } - { Some -> f " Some" ; } - } +def Maybe.show;(f) [ (t +Str -- +Str) Maybe(t) +Str -- +Str ] { + { None -> "None" ; } + { Some -> f " Some" ; } +} - def Maybe.show(f) [ (t +Str -- +Str) Maybe(t) -- Str ] { - Str( show;(f) ) - } -) +def Maybe.show(f) [ (t +Str -- +Str) Maybe(t) -- Str ] { + Str( show;(f) ) +} diff --git a/lib/std/prelude.mth b/lib/std/prelude.mth index 34af22c5..d578f56d 100644 --- a/lib/std/prelude.mth +++ b/lib/std/prelude.mth @@ -65,8 +65,6 @@ inline( def(Bool.or(p), (*a -- *a Bool) *a Bool -- *a Bool, if(True, p)) def(Bool.and(p), (*a -- *a Bool) *a Bool -- *a Bool, if(p, False)) def(Bool.==, Bool Bool -- Bool, if(id, not)) - def(Bool.show, Bool -- Str, if("True", "False")) - def(Bool.show;, Bool +Str -- +Str, show ;) def(Bool.then(f), (*a -- *a) *a Bool -- *a, if(f, id)) def(Bool.else(f), (*a -- *a) *a Bool -- *a, if(id, f)) @@ -76,7 +74,13 @@ inline( def and(f,g) [ (*x a -- *x Bool, *x a -- *x Bool) *x a -- *x Bool ] { dup dip(f) swap if(g, drop False) } + + def while(f) [ (*x -- *x Bool) *x -- *x ] { + True while(dup, drop f) drop + } ) +def(Bool.show, Bool -- Str, if("True", "False")) +def(Bool.show;, Bool +Str -- +Str, show ;) data(OS, OS_UNKNOWN, @@ -111,9 +115,15 @@ inline( def rotr [ a b c -- c a b ] { swap dip(swap) } def rotl [ a b c -- b c a ] { dip(swap) swap } + def rot4r [ a b c d -- d a b c ] { swap dip(rotr) } + def rot4l [ a b c d -- b c d a ] { dip(rotl) swap } + def rrotr [ +a +b +c -- +c +a +b ] { rswap rdip(rswap) } def rrotl [ +a +b +c -- +b +c +a ] { rdip(rswap) rswap } + def rrot4r [ +a +b +c +d -- +d +a +b +c ] { rswap rdip(rrotr) } + def rrot4l [ +a +b +c +d -- +b +c +d +a ] { rdip(rrotl) rswap } + def over [ a b -- a b a ] { dip(dup) swap } def over2 [ a b1 b2 -- a b1 b2 a ] { dip(over) swap } def over3 [ a b1 b2 b3 -- a b1 b2 b3 a ] { dip(over2) swap } @@ -127,127 +137,106 @@ inline( def dup3 [ a b c -- a b c a b c ] { dup dip(dip(dup2) rotr) } def dip'(f) [ (*a x -- *b y) *a c x -- *b c y ] { swap dip(f) swap } - - def(dip2(f), (*a -- *b) *a c1 c2 -- *b c1 c2, - dip(dip(f))) - def(dip3(f), (*a -- *b) *a c1 c2 c3 -- *b c1 c2 c3, - dip(dip(dip(f)))) - - def(rdip'(f), (*a +r1 -- *b +r2) *a +c +r1 -- *b +c +r2, - rswap rdip(f) rswap) - - def(rdip2(f), (*a -- *b) *a +c1 +c2 -- *b +c1 +c2, - rdip(rdip(f))) - def(rdip3(f), (*a -- *b) *a +c1 +c2 +c3 -- *b +c1 +c2 +c3, - rdip(rdip(rdip(f)))) - - def(sip(f), (*a x -- *b) *a x -- *b x, - dup dip(f)) - def(sip2(f), (*a x1 x2 -- *b) *a x1 x2 -- *b x1 x2, - dup2 dip(dip(f))) - - def(both(f), (a -- b) a a -- b b, dip(f) f) - - def(on2(f,g), - (*a x1 -- *b x2, - *b y1 -- *c y2) - *a x1 y1 -- *c x2 y2, - dip(f) dip'(g)) - def(on3(f,g,h), - (*a x1 -- *b x2, - *b y1 -- *c y2, - *c z1 -- *d z2) - *a x1 y1 z1 -- *d x2 y2 z2, - dip:on2(f,g) dip':dip'(h)) - def(on4(f,g,h,i), - (*a x1 -- *b x2, - *b y1 -- *c y2, - *c z1 -- *d z2, - *d w1 -- *e w2) - *a x1 y1 z1 w1 -- *e x2 y2 z2 w2, - dip:on3(f,g,h) dip':dip':dip'(i)) - - def(on2(f), (*a x -- *a y) *a x x -- *a y y, on2(f,f)) - def(on3(f), (*a x -- *a y) *a x x x -- *a y y y, on3(f,f,f)) - def(on4(f), (*a x -- *a y) *a x x x x -- *a y y y y, on4(f,f,f,f)) - - def(at2(f,g), - (*a x1 -- *b, - *b y1 -- *c) - *a x1 y1 -- *c, - dip(f) g) - def(at3(f,g,h), - (*a x1 -- *b, - *b y1 -- *c, - *c z1 -- *d) - *a x1 y1 z1 -- *d, - dip:at2(f,g) h) - def(at4(f,g,h,i), - (*a x1 -- *b, - *b y1 -- *c, - *c z1 -- *d, - *d w1 -- *e) - *a x1 y1 z1 w1 -- *e, - dip:at3(f,g,h) i) - - def(at2(f), (*a x -- *a) *a x x -- *a, at2(f,f)) - def(at3(f), (*a x -- *a) *a x x x -- *a, at3(f,f,f)) - def(at4(f), (*a x -- *a) *a x x x x -- *a, at4(f,f,f,f)) - - def(drop2, a b --, drop drop) - def(drop3, a b c --, drop drop drop) - def(drop4, a b c d --, drop drop drop drop) - - def(rot4r, a b c d -- d a b c, swap dip(rotr)) - def(rot4l, a b c d -- b c d a, dip(rotl) swap) - - def(rrot4r, +a +b +c +d -- +d +a +b +c, rswap rdip(rrotr)) - def(rrot4l, +a +b +c +d -- +b +c +d +a, rdip(rrotl) rswap) + def dip2(f) [ (*a -- *b) *a c1 c2 -- *b c1 c2 ] { dip(dip(f)) } + def dip3(f) [ (*a -- *b) *a c1 c2 c3 -- *b c1 c2 c3 ] { dip(dip(dip(f))) } + + def rdip'(f) [ (*a +r1 -- *b +r2) *a +c +r1 -- *b +c +r2 ] { rswap rdip(f) rswap } + def rdip2(f) [ (*a -- *b) *a +c1 +c2 -- *b +c1 +c2 ] { rdip(rdip(f)) } + def rdip3(f) [ (*a -- *b) *a +c1 +c2 +c3 -- *b +c1 +c2 +c3 ] { rdip(rdip(rdip(f))) } + + def sip(f) [ (*a x -- *b) *a x -- *b x ] { dup dip(f) } + def sip2(f) [ (*a x1 x2 -- *b) *a x1 x2 -- *b x1 x2 ] { dup2 dip2(f) } + + def both(f) [ (a -- b) a a -- b b ] { dip(f) f } + + def on2(f,g) [ + ( *a x1 -- *b x2 + , *b y1 -- *c y2 + ) *a x1 y1 -- *c x2 y2 ] + { dip(f) dip'(g) } + def on3(f,g,h) [ + ( *a x1 -- *b x2 + , *b y1 -- *c y2 + , *c z1 -- *d z2 + ) *a x1 y1 z1 -- *d x2 y2 z2 ] + { dip:on2(f,g) dip':dip'(h) } + def on4(f,g,h,i) [ + ( *a x1 -- *b x2 + , *b y1 -- *c y2 + , *c z1 -- *d z2 + , *d w1 -- *e w2 + ) *a x1 y1 z1 w1 -- *e x2 y2 z2 w2 ] + { dip:on3(f,g,h) dip':dip':dip'(i) } + + def on2(f) [ (*a x -- *a y) *a x x -- *a y y ] { on2(f,f) } + def on3(f) [ (*a x -- *a y) *a x x x -- *a y y y ] { on3(f,f,f) } + def on4(f) [ (*a x -- *a y) *a x x x x -- *a y y y y ] { on4(f,f,f,f) } + + def at2(f,g) [ + ( *a x1 -- *b + , *b y1 -- *c + ) *a x1 y1 -- *c ] + { dip(f) g } + def at3(f,g,h) [ + ( *a x1 -- *b + , *b y1 -- *c + , *c z1 -- *d + ) *a x1 y1 z1 -- *d ] + { dip:at2(f,g) h } + def at4(f,g,h,i) [ + ( *a x1 -- *b + , *b y1 -- *c + , *c z1 -- *d + , *d w1 -- *e + ) *a x1 y1 z1 w1 -- *e ] + { dip:at3(f,g,h) i } + + def at2(f) [ (*a x -- *a) *a x x -- *a ] { at2(f,f) } + def at3(f) [ (*a x -- *a) *a x x x -- *a ] { at3(f,f,f) } + def at4(f) [ (*a x -- *a) *a x x x x -- *a ] { at4(f,f,f,f) } + + def drop2 [ a b -- ] { drop drop } + def drop3 [ a b c -- ] { drop drop drop } + def drop4 [ a b c d -- ] { drop drop drop drop } def flip3 [ a b c -- c b a ] { >x1 >x2 >x3 x1> x2> x3> } def flip4 [ a b c d -- d c b a ] { >x1 >x2 >x3 >x4 x1> x2> x3> x4> } - def(repeat(f), (*a -- *a) *a Nat -- *a, - while(dup 0>, dip(f) pred) drop) - - def(count(f), (*a Nat -- *a) *a Nat -- *a, - 0u swap repeat(dup dip(f) 1+) drop) - def(countdown(f), (*a Nat -- *a) *a Nat -- *a, - dup swap repeat(pred dup dip(f)) drop) - - def(U8_MAX, Int, 0xFF) - def(U16_MAX, Int, 0xFFFF) - def(U32_MAX, Int, 0xFFFFFFFF) + def repeat(f) [ (*a -- *a) *a Nat -- *a ] { while(dup 0>, dip(f) pred) drop } + def count(f) [ (*a Nat -- *a) *a Nat -- *a ] { 0u swap repeat(dup dip(f) 1+) drop } + def countdown(f) [ (*a Nat -- *a) *a Nat -- *a ] { dup swap repeat(pred dup dip(f)) drop } - def(I8_MAX, Int, 0x7F) def(I16_MAX, Int, 0x7FFF) def(I32_MAX, Int, 0x7FFFFFFF) - def(U8_MIN, Int, 0) - def(U16_MIN, Int, 0) - def(U32_MIN, Int, 0) - - def(I8_MIN, Int, -0x80) def(I16_MIN, Int, -0x8000) def(I32_MIN, Int, -0x80000000) - data(Comparison, LT, EQ, GT) - def(Comparison.lt?, Comparison -- Bool, LT -> True, EQ -> False, GT -> False) - def(Comparison.le?, Comparison -- Bool, LT -> True, EQ -> True, GT -> False) - def(Comparison.eq?, Comparison -- Bool, LT -> False, EQ -> True, GT -> False) - def(Comparison.ge?, Comparison -- Bool, LT -> False, EQ -> True, GT -> True) - def(Comparison.gt?, Comparison -- Bool, LT -> False, EQ -> False, GT -> True) - def(Comparison.ne?, Comparison -- Bool, LT -> True, EQ -> False, GT -> True) + data Comparison { -1 LT, 0 EQ, +1 GT } + def Comparison.eq? [ Comparison -- Bool ] { cons-value 0 = } + def Comparison.lt? [ Comparison -- Bool ] { cons-value 0 < } + def Comparison.le? [ Comparison -- Bool ] { cons-value 0 <= } + def Comparison.ge? [ Comparison -- Bool ] { cons-value 0 > } + def Comparison.gt? [ Comparison -- Bool ] { cons-value 0 >= } + def Comparison.ne? [ Comparison -- Bool ] { cons-value 0 <> } alias(Int.==, prim-int-eq) - alias(Int.=, prim-int-eq) - alias(Int.<, prim-int-lt) + alias(Int.= , prim-int-eq) + alias(Int.< , prim-int-lt) alias(Int.<=, prim-int-le) - alias(Int.>, prim-int-gt) + alias(Int.> , prim-int-gt) alias(Int.>=, prim-int-ge) alias(Int.<>, prim-int-ne) - def(Int.compare, Int Int -- Comparison, dup2 == if(drop2 EQ, < if(LT, GT))) + def Int.in-range [ Int Int Int -- Bool ] { dip(over dip(>=)) <= && } +) + +def Int.compare [ Int Int -- Comparison ] { dup2 == if(drop2 EQ, < if(LT, GT)) } +def Int.max [ Int Int -- Int ] { dup2 < if(nip, drop) } +def Int.min [ Int Int -- Int ] { dup2 < if(drop, nip) } +def Int.clamp [ Int Int Int -- Int ] { dip(max) min } + +inline( alias(F64.==, prim-f64-eq) alias(F64.=, prim-f64-eq) alias(F64.<, prim-f64-lt) @@ -263,11 +252,6 @@ inline( def(F32.<=, F32 F32 -- Bool, swap < not) def(F32.>=, F32 F32 -- Bool, < not) def(F32.<>, F32 F32 -- Bool, = not) - - def(Int.max, Int Int -- Int, dup2 < if(nip, drop)) - def(Int.min, Int Int -- Int, dup2 < if(drop, nip)) - def(Int.in-range, Int Int Int -- Bool, dip(over dip(>=)) <= &&) - def(Int.clamp, Int Int Int -- Int, dip(max) min) ) inline( @@ -288,160 +272,340 @@ def(Str.max, Str Str -- Str, dup2 < if(nip, drop)) def(Str.min, Str Str -- Str, dup2 < if(drop, nip)) inline( - def-missing(prim-int-succ, Int -- Int, 1 +) - def-missing(prim-int-pred, Int -- Int, 1 -) - def-missing(prim-int-negate, Int -- Int, -1 *) - alias(Int.1+, prim-int-succ) - alias(Int.1-, prim-int-pred) - alias(Int.negate, prim-int-negate) - alias(Int.succ, prim-int-succ) - alias(Int.pred, prim-int-pred) - def(Int.2*, Int -- Int, 2 *) - def(Int.2/, Int -- Int, 2 /) - def(Int.0=, Int -- Bool, 0 ==) - def(Int.0<, Int -- Bool, 0 <) - def(Int.0>, Int -- Bool, 0 >) - def(Int.0<=, Int -- Bool, 0 <=) - def(Int.0>=, Int -- Bool, 0 >=) - def(Int.0<>, Int -- Bool, 0 <>) + def Int.negate [ Int -- Int ] { -1 * } + def Int.1- [ Int -- Int ] { 1 - } + def Int.1+ [ Int -- Int ] { 1 + } + def Int.2* [ Int -- Int ] { 2 * } + def Int.2/ [ Int -- Int ] { 2 / } + def Int.0= [ Int -- Bool ] { 0 = } + def Int.0< [ Int -- Bool ] { 0 < } + def Int.0> [ Int -- Bool ] { 0 > } + def Int.0<= [ Int -- Bool ] { 0 <= } + def Int.0>= [ Int -- Bool ] { 0 >= } + def Int.0<> [ Int -- Bool ] { 0 <> } + + def Int.succ [ Int -- Int ] { 1+ } + def Int.pred [ Int -- Int ] { 1- } ||| Nullable pointer. - data(Ptr?, Ptr?-unsafe -> Ptr) - def(Ptr?.Null, -- Ptr?, prim-ptr-nil Ptr?-unsafe) - def(Ptr?.null?, Ptr? -- Bool, Ptr?-unsafe -> prim-ptr-nil ==) - def(Ptr?.==, Ptr? Ptr? -- Bool, both(/Ptr?-unsafe) ==) - def(Ptr?.if-some(f,g), (*a Ptr -- *b, *a -- *b) *a Ptr? -- *b, dup null? if(drop g, /Ptr?-unsafe f)) - def(Ptr?.for(f), (*a Ptr -- *a) *a Ptr? -- *a, if-some(f, id)) - def(Ptr?.unwrap(f), (*a -- *a Ptr) *a Ptr? -- *a Ptr, if-some(id, f)) - def(Ptr?.>Ptr, Ptr? -- Maybe(Ptr), if-some(Some, None)) - - def(Ptr.==, Ptr Ptr -- Bool, prim-ptr-eq) - def(Ptr.>Ptr?, Ptr -- Ptr?, Ptr?-unsafe) - def(Ptr.sizeof, -- USize, |Ptr|) + data Ptr? { Ptr?-unsafe [ Ptr ] } + def Ptr?.Null [ -- Ptr? ] { prim-ptr-nil Ptr?-unsafe } + def Ptr?.null? [ Ptr? -- Bool ] { Ptr?-unsafe -> prim-ptr-nil == } + def Ptr?.== [ Ptr? Ptr? -- Bool ] { both(/Ptr?-unsafe) == } + def Ptr?.if-some(f,g) [ (*a Ptr -- *b, *a -- *b) *a Ptr? -- *b ] { + dup null? if(drop g, /Ptr?-unsafe f) + } + def Ptr?.for(f) [ (*a Ptr -- *a) *a Ptr? -- *a ] { if-some(f, id) } + def Ptr?.unwrap(f) [ (*a -- *a Ptr) *a Ptr? -- *a Ptr ] { if-some(id, f) } + def Ptr?.>Maybe [ Ptr? -- Maybe(Ptr) ] { if-some(Some, None) } + + def Ptr.== [ Ptr Ptr -- Bool ] { prim-ptr-eq } + def Ptr.>Ptr? [ Ptr -- Ptr? ] { Ptr?-unsafe } data(+Unsafe, +Unsafe) - def(unsafe(f), (*a +Unsafe -- *b +Unsafe) *a -- *b, - +Unsafe f /+Unsafe) + def unsafe(f) [ (*a +Unsafe -- *b +Unsafe) *a -- *b ] { + +Unsafe f /+Unsafe + } ||| Add byte offset to Ptr. - def(Ptr.ioffset, IOffset Ptr +Unsafe -- Ptr +Unsafe, dip(>Int) prim-ptr-add) - def(Ptr.uoffset, UOffset Ptr +Unsafe -- Ptr +Unsafe, dip(>Int) prim-ptr-add) - - def(Ptr.@Ptr, Ptr +Unsafe -- Ptr +Unsafe, prim-ptr-get) - def(Ptr.!Ptr, Ptr Ptr +Unsafe -- +Unsafe, prim-ptr-set) - - def(Ptr.@U8, Ptr +Unsafe -- U8 +Unsafe, prim-u8-get) - def(Ptr.@U16, Ptr +Unsafe -- U16 +Unsafe, prim-u16-get) - def(Ptr.@U32, Ptr +Unsafe -- U32 +Unsafe, prim-u32-get) - def(Ptr.@U64, Ptr +Unsafe -- U64 +Unsafe, prim-u64-get) - def(Ptr.@I8, Ptr +Unsafe -- I8 +Unsafe, prim-i8-get) - def(Ptr.@I16, Ptr +Unsafe -- I16 +Unsafe, prim-i16-get) - def(Ptr.@I32, Ptr +Unsafe -- I32 +Unsafe, prim-i32-get) - def(Ptr.@I64, Ptr +Unsafe -- I64 +Unsafe, prim-i64-get) - - def(Ptr.!U8, U8 Ptr +Unsafe -- +Unsafe, prim-u8-set) - def(Ptr.!U16, U16 Ptr +Unsafe -- +Unsafe, prim-u16-set) - def(Ptr.!U32, U32 Ptr +Unsafe -- +Unsafe, prim-u32-set) - def(Ptr.!U64, U64 Ptr +Unsafe -- +Unsafe, prim-u64-set) - def(Ptr.!I8, I8 Ptr +Unsafe -- +Unsafe, prim-i8-set) - def(Ptr.!I16, I16 Ptr +Unsafe -- +Unsafe, prim-i16-set) - def(Ptr.!I32, I32 Ptr +Unsafe -- +Unsafe, prim-i32-set) - def(Ptr.!I64, I64 Ptr +Unsafe -- +Unsafe, prim-i64-set) - - def(Ptr.alloc, USize +Unsafe -- Ptr +Unsafe, >Int prim-ptr-alloc) - def(Ptr.realloc, Ptr USize +Unsafe -- Ptr +Unsafe, >Int prim-ptr-realloc) - def(Ptr.free, Ptr +Unsafe -- +Unsafe, prim-ptr-free) - def(Ptr.copy, Ptr USize Ptr +Unsafe -- +Unsafe, dip(>Int) prim-ptr-copy) - def(Ptr.fill, U8 USize Ptr +Unsafe -- +Unsafe, dip(>Int dip(>Int)) prim-ptr-fill) - def(Ptr.erase, USize Ptr +Unsafe -- +Unsafe, dip2(0u8) fill) - - def(U8.>Int, U8 -- Int, Int>U8-unsafe -> id) - def(U16.>Int, U16 -- Int, Int>U16-unsafe -> id) - def(U32.>Int, U32 -- Int, Int>U32-unsafe -> id) - def(U64.>Int-unsafe, U64 -- Int, Int>U64-unsafe -> id) - def(U64.>Int?, U64 -- Maybe(Int), Int>U64-unsafe -> dup 0 >= if(Some, drop None)) - - def(I8.>Int, I8 -- Int, Int>I8-unsafe -> id) - def(I16.>Int, I16 -- Int, Int>I16-unsafe -> id) - def(I32.>Int, I32 -- Int, Int>I32-unsafe -> id) - def(I64.>Int, I64 -- Int, Int>I64-unsafe -> id) - - def(Int.>U8-unsafe, Int -- U8, Int>U8-unsafe ) - def(Int.>U16-unsafe, Int -- U16, Int>U16-unsafe) - def(Int.>U32-unsafe, Int -- U32, Int>U32-unsafe) - def(Int.>U64-unsafe, Int -- U64, Int>U64-unsafe) - def(Int.>I8-unsafe, Int -- I8, Int>I8-unsafe ) - def(Int.>I16-unsafe, Int -- I16, Int>I16-unsafe) - def(Int.>I32-unsafe, Int -- I32, Int>I32-unsafe) - def(Int.>I64-unsafe, Int -- I64, Int>I64-unsafe) - - def(Int.>U8&, Int -- U8, U8_MAX & >U8-unsafe) - def(Int.>U16&, Int -- U16, U16_MAX & >U16-unsafe) - def(Int.>U32&, Int -- U32, U32_MAX & >U32-unsafe) - def(Int.>U64&, Int -- U64, >U64-unsafe) + def Ptr.ioffset [ IOffset Ptr +Unsafe -- Ptr +Unsafe ] { dip(>Int) prim-ptr-add } + def Ptr.uoffset [ UOffset Ptr +Unsafe -- Ptr +Unsafe ] { dip(>Int) prim-ptr-add } + + def Ptr.@Ptr [ Ptr +Unsafe -- Ptr +Unsafe ] { prim-ptr-get } + def Ptr.!Ptr [ Ptr Ptr +Unsafe -- +Unsafe ] { prim-ptr-set } + + def Ptr.@U8 [ Ptr +Unsafe -- U8 +Unsafe ] { prim-u8-get } + def Ptr.@U16 [ Ptr +Unsafe -- U16 +Unsafe ] { prim-u16-get } + def Ptr.@U32 [ Ptr +Unsafe -- U32 +Unsafe ] { prim-u32-get } + def Ptr.@U64 [ Ptr +Unsafe -- U64 +Unsafe ] { prim-u64-get } + def Ptr.@I8 [ Ptr +Unsafe -- I8 +Unsafe ] { prim-i8-get } + def Ptr.@I16 [ Ptr +Unsafe -- I16 +Unsafe ] { prim-i16-get } + def Ptr.@I32 [ Ptr +Unsafe -- I32 +Unsafe ] { prim-i32-get } + def Ptr.@I64 [ Ptr +Unsafe -- I64 +Unsafe ] { prim-i64-get } + + def Ptr.!U8 [ U8 Ptr +Unsafe -- +Unsafe ] { prim-u8-set } + def Ptr.!U16 [ U16 Ptr +Unsafe -- +Unsafe ] { prim-u16-set } + def Ptr.!U32 [ U32 Ptr +Unsafe -- +Unsafe ] { prim-u32-set } + def Ptr.!U64 [ U64 Ptr +Unsafe -- +Unsafe ] { prim-u64-set } + def Ptr.!I8 [ I8 Ptr +Unsafe -- +Unsafe ] { prim-i8-set } + def Ptr.!I16 [ I16 Ptr +Unsafe -- +Unsafe ] { prim-i16-set } + def Ptr.!I32 [ I32 Ptr +Unsafe -- +Unsafe ] { prim-i32-set } + def Ptr.!I64 [ I64 Ptr +Unsafe -- +Unsafe ] { prim-i64-set } + + def Ptr.alloc [ USize +Unsafe -- Ptr +Unsafe ] { >Int prim-ptr-alloc } + def Ptr.realloc [ Ptr USize +Unsafe -- Ptr +Unsafe ] { >Int prim-ptr-realloc } + def Ptr.free [ Ptr +Unsafe -- +Unsafe ] { prim-ptr-free } + def Ptr.copy [ Ptr USize Ptr +Unsafe -- +Unsafe ] { dip(>Int) prim-ptr-copy } + def Ptr.fill [ U8 USize Ptr +Unsafe -- +Unsafe ] { dip(>Int dip(>Int)) prim-ptr-fill } + def Ptr.erase [ USize Ptr +Unsafe -- +Unsafe ] { dip2(0u8) fill } + ) -def(Int.>U8?, Int -- Maybe( U8), dup U8_MIN U8_MAX .in-range if(Int>U8-unsafe Some, drop None)) -def(Int.>U16?, Int -- Maybe(U16), dup U16_MIN U16_MAX .in-range if(Int>U16-unsafe Some, drop None)) -def(Int.>U32?, Int -- Maybe(U32), dup U32_MIN U32_MAX .in-range if(Int>U32-unsafe Some, drop None)) -def(Int.>U64?, Int -- Maybe(U64), dup 0 >= if(Int>U64-unsafe Some, drop None)) +inline ( + def I8.>Int [ I8 -- Int ] { Int>I8-unsafe -> id } -inline( - def 0u8 [ U8 ] { 0 Int>U8-unsafe } + def Int.>I8-unsafe [ Int -- I8 ] { Int>I8-unsafe } + def Int.>I8? [ Int -- Maybe(I8) ] { >I8(Some, drop None) } + def Int.>I8(f) [ (*a Int -- *a I8 ) *a Int -- *a I8 ] { >I8(id,f) } + def Int.>I8(f,g) [ (*a I8 -- *b, *a Int -- *b) *a Int -- *b ] { + dup I8.MIN I8.MAX on2:>Int in-range if(>I8-unsafe f, g) + } + def Int.i8 [ Int -- I8 ] { I8.MIN I8.MAX on2:>Int clamp >I8-unsafe } + + def 0i8 [ I8 ] { 0 >I8-unsafe } + def 1i8 [ I8 ] { 1 >I8-unsafe } + def 2i8 [ I8 ] { 2 >I8-unsafe } + def -1i8 [ I8 ] { -1 >I8-unsafe } + def -2i8 [ I8 ] { -2 >I8-unsafe } + + def I8.compare [ I8 I8 -- Comparison ] { on2:>Int compare } + def I8.== [ I8 I8 -- Bool ] { on2:>Int == } + def I8.= [ I8 I8 -- Bool ] { on2:>Int = } + def I8.< [ I8 I8 -- Bool ] { on2:>Int < } + def I8.<= [ I8 I8 -- Bool ] { on2:>Int <= } + def I8.> [ I8 I8 -- Bool ] { on2:>Int > } + def I8.>= [ I8 I8 -- Bool ] { on2:>Int >= } + def I8.<> [ I8 I8 -- Bool ] { on2:>Int <> } + + def I8.MIN [ I8 ] { -0x80 >I8-unsafe } + def I8.MAX [ I8 ] { 0x7F >I8-unsafe } + def I8.succ [ I8 -- I8 ] { dup I8.MAX < then(>Int 1+ >I8-unsafe) } + def I8.pred [ I8 -- I8 ] { dup I8.MIN > then(>Int 1- >I8-unsafe) } +) + +inline ( + def I16.>Int [ I16 -- Int ] { Int>I16-unsafe -> id } + + def Int.>I16-unsafe [ Int -- I16 ] { Int>I16-unsafe } + def Int.>I16? [ Int -- Maybe(I16) ] { >I16(Some, drop None) } + def Int.>I16(f) [ (*a Int -- *a I16 ) *a Int -- *a I16 ] { >I16(id,f) } + def Int.>I16(f,g) [ (*a I16 -- *b, *a Int -- *b) *a Int -- *b ] { + dup I16.MIN I16.MAX on2:>Int in-range if(>I16-unsafe f, g) + } + def Int.i16 [ Int -- I16 ] { I16.MIN I16.MAX on2:>Int clamp >I16-unsafe } + + def 0i16 [ I16 ] { 0 >I16-unsafe } + def 1i16 [ I16 ] { 1 >I16-unsafe } + def 2i16 [ I16 ] { 2 >I16-unsafe } + def -1i16 [ I16 ] { -1 >I16-unsafe } + def -2i16 [ I16 ] { -2 >I16-unsafe } + + def I16.compare [ I16 I16 -- Comparison ] { on2:>Int compare } + def I16.== [ I16 I16 -- Bool ] { on2:>Int == } + def I16.= [ I16 I16 -- Bool ] { on2:>Int = } + def I16.< [ I16 I16 -- Bool ] { on2:>Int < } + def I16.<= [ I16 I16 -- Bool ] { on2:>Int <= } + def I16.> [ I16 I16 -- Bool ] { on2:>Int > } + def I16.>= [ I16 I16 -- Bool ] { on2:>Int >= } + def I16.<> [ I16 I16 -- Bool ] { on2:>Int <> } + + def I16.MIN [ I16 ] { -0x8000 >I16-unsafe } + def I16.MAX [ I16 ] { 0x7FFF >I16-unsafe } + def I16.succ [ I16 -- I16 ] { dup I16.MAX < then(>Int 1+ >I16-unsafe) } + def I16.pred [ I16 -- I16 ] { dup I16.MIN > then(>Int 1- >I16-unsafe) } +) + +inline ( + def I32.>Int [ I32 -- Int ] { Int>I32-unsafe -> id } - def(Int.u8, Int -- U8, 0 U8_MAX clamp >U8-unsafe) - def(Int.u16, Int -- U16, 0 U16_MAX clamp >U16-unsafe) - def(Int.u32, Int -- U32, 0 U32_MAX clamp >U32-unsafe) - def(Int.u64, Int -- U64, 0 max >U64-unsafe) + def Int.>I32-unsafe [ Int -- I32 ] { Int>I32-unsafe } + def Int.>I32? [ Int -- Maybe(I32) ] { >I32(Some, drop None) } + def Int.>I32(f) [ (*a Int -- *a I32 ) *a Int -- *a I32 ] { >I32(id,f) } + def Int.>I32(f,g) [ (*a I32 -- *b, *a Int -- *b) *a Int -- *b ] { + dup I32.MIN I32.MAX on2:>Int in-range if(>I32-unsafe f, g) + } + def Int.i32 [ Int -- I32 ] { I32.MIN I32.MAX on2:>Int clamp >I32-unsafe } + + def 0i32 [ I32 ] { 0 >I32-unsafe } + def 1i32 [ I32 ] { 1 >I32-unsafe } + def 2i32 [ I32 ] { 2 >I32-unsafe } + def -1i32 [ I32 ] { -1 >I32-unsafe } + def -2i32 [ I32 ] { -2 >I32-unsafe } + + def I32.compare [ I32 I32 -- Comparison ] { on2:>Int compare } + def I32.== [ I32 I32 -- Bool ] { on2:>Int == } + def I32.= [ I32 I32 -- Bool ] { on2:>Int = } + def I32.< [ I32 I32 -- Bool ] { on2:>Int < } + def I32.<= [ I32 I32 -- Bool ] { on2:>Int <= } + def I32.> [ I32 I32 -- Bool ] { on2:>Int > } + def I32.>= [ I32 I32 -- Bool ] { on2:>Int >= } + def I32.<> [ I32 I32 -- Bool ] { on2:>Int <> } + + def I32.MIN [ I32 ] { -0x80000000 >I32-unsafe } + def I32.MAX [ I32 ] { 0x7FFFFFFF >I32-unsafe } + def I32.succ [ I32 -- I32 ] { dup I32.MAX < then(>Int 1+ >I32-unsafe) } + def I32.pred [ I32 -- I32 ] { dup I32.MIN > then(>Int 1- >I32-unsafe) } +) - def(Int.i8, Int -- I8, I8_MIN I8_MAX clamp >I8-unsafe ) - def(Int.i16, Int -- I16, I16_MIN I16_MAX clamp >I16-unsafe) - def(Int.i32, Int -- I32, I32_MIN I32_MAX clamp >I32-unsafe) - def(Int.i64, Int -- I64, >I64-unsafe) +inline ( + def I64.>Int [ I64 -- Int ] { Int>I64-unsafe -> id } + + def Int.>I64-unsafe [ Int -- I64 ] { Int>I64-unsafe } + def Int.>I64 [ Int -- I64 ] { Int>I64-unsafe } + def Int.i64 [ Int -- I64 ] { >I64 } + + def 0i64 [ I64 ] { 0 >I64-unsafe } + def 1i64 [ I64 ] { 1 >I64-unsafe } + def 2i64 [ I64 ] { 2 >I64-unsafe } + def -1i64 [ I64 ] { -1 >I64-unsafe } + def -2i64 [ I64 ] { -2 >I64-unsafe } + + def I64.compare [ I64 I64 -- Comparison ] { on2:>Int compare } + def I64.== [ I64 I64 -- Bool ] { on2:>Int == } + def I64.= [ I64 I64 -- Bool ] { on2:>Int = } + def I64.< [ I64 I64 -- Bool ] { on2:>Int < } + def I64.<= [ I64 I64 -- Bool ] { on2:>Int <= } + def I64.> [ I64 I64 -- Bool ] { on2:>Int > } + def I64.>= [ I64 I64 -- Bool ] { on2:>Int >= } + def I64.<> [ I64 I64 -- Bool ] { on2:>Int <> } + + def I64.MIN [ I64 ] { -0x7FFFFFFF 1- >I64 } + def I64.MAX [ I64 ] { 0x7FFFFFFF >I64 } + def I64.succ [ I64 -- I64 ] { dup I64.MAX < then(>Int 1+ >I64) } + def I64.pred [ I64 -- I64 ] { dup I64.MIN > then(>Int 1- >I64) } ) inline ( - def(Int.>I8?, Int -- Maybe( I8), dup I8_MIN I8_MAX .in-range if(Int>I8-unsafe Some, drop None)) - def(Int.>I16?, Int -- Maybe(I16), dup I16_MIN I16_MAX .in-range if(Int>I16-unsafe Some, drop None)) - def(Int.>I32?, Int -- Maybe(I32), dup I32_MIN I32_MAX .in-range if(Int>I32-unsafe Some, drop None)) - def(Int.>I64?, Int -- Maybe(I64), Int>I64-unsafe Some) - def(Int.>I64, Int -- I64, Int>I64-unsafe) - - def(Int.>I8(f), (*a Int -- *a I8 ) *a Int -- *a I8 , dup I8_MIN I8_MAX .in-range if(Int>I8-unsafe, f)) - def(Int.>I16(f), (*a Int -- *a I16) *a Int -- *a I16, dup I16_MIN I16_MAX .in-range if(Int>I16-unsafe, f)) - def(Int.>I32(f), (*a Int -- *a I32) *a Int -- *a I32, dup I32_MIN I32_MAX .in-range if(Int>I32-unsafe, f)) - - def(Int.>U8(f), (*a Int -- *a U8 ) *a Int -- *a U8 , dup 0 U8_MAX .in-range if(Int>U8-unsafe, f)) - def(Int.>U16(f), (*a Int -- *a U16) *a Int -- *a U16, dup 0 U16_MAX .in-range if(Int>U16-unsafe, f)) - def(Int.>U32(f), (*a Int -- *a U32) *a Int -- *a U32, dup 0 U32_MAX .in-range if(Int>U32-unsafe, f)) - def(Int.>U64(f), (*a Int -- *a U64) *a Int -- *a U64, dup 0 >= if(Int>U64-unsafe, f)) + def U8.>Int [ U8 -- Int ] { Int>U8-unsafe -> id } + + def Int.>U8-unsafe [ Int -- U8 ] { Int>U8-unsafe } + def Int.>U8& [ Int -- U8 ] { 255 & >U8-unsafe } + def Int.>U8? [ Int -- Maybe(U8) ] { dup 0 255 .in-range if(>U8-unsafe Some, drop None) } + def Int.>U8(f) [ (*a Int -- *a U8 ) *a Int -- *a U8 ] { >U8(id, f) } + def Int.>U8(f,g) [ (*a U8 -- *b, *a Int -- *b ) *a Int -- *b ] { + dup 0 255 in-range if(>U8-unsafe f, g) + } + def Int.u8 [ Int -- U8 ] { 0 255 clamp >U8-unsafe } + + def 0u8 [ U8 ] { 0 >U8-unsafe } + def 1u8 [ U8 ] { 1 >U8-unsafe } + def 2u8 [ U8 ] { 2 >U8-unsafe } + def 3u8 [ U8 ] { 3 >U8-unsafe } + + def U8.& [ U8 U8 -- U8 ] { on2:>Int & >U8-unsafe } + def U8.| [ U8 U8 -- U8 ] { on2:>Int | >U8-unsafe } + def U8.^ [ U8 U8 -- U8 ] { on2:>Int ^ >U8-unsafe } + + def U8.compare [ U8 U8 -- Comparison ] { on2:>Int compare } + def U8.= [ U8 U8 -- Bool ] { on2:>Int = } + def U8.== [ U8 U8 -- Bool ] { on2:>Int == } + def U8.< [ U8 U8 -- Bool ] { on2:>Int < } + def U8.<= [ U8 U8 -- Bool ] { on2:>Int <= } + def U8.> [ U8 U8 -- Bool ] { on2:>Int > } + def U8.>= [ U8 U8 -- Bool ] { on2:>Int >= } + def U8.<> [ U8 U8 -- Bool ] { on2:>Int <> } + def U8.0= [ U8 -- Bool ] { >Int 0= } + def U8.0> [ U8 -- Bool ] { >Int 0> } + + def U8.MAX [ U8 ] { 255 >U8-unsafe } + def U8.MIN [ U8 ] { 0 >U8-unsafe } + def U8.succ [ U8 -- U8 ] { dup U8.MAX < then(>Int 1+ >U8-unsafe) } + def U8.pred [ U8 -- U8 ] { dup 0> then(>Int 1- >U8-unsafe) } ) +inline ( + def U16.>Int [ U16 -- Int ] { Int>U16-unsafe -> id } + + def Int.>U16-unsafe [ Int -- U16 ] { Int>U16-unsafe } + def Int.>U16& [ Int -- U16 ] { 0xFFFF & >U16-unsafe } + def Int.>U16? [ Int -- Maybe(U16) ] { >U16(Some, drop None) } + def Int.>U16(f) [ (*a Int -- *a U16 ) *a Int -- *a U16 ] { >U16(id, f) } + def Int.>U16(f,g) [ (*a U16 -- *b, *a Int -- *b ) *a Int -- *b ] { + dup 0 0xFFFF in-range if(>U16-unsafe f, g) + } + def Int.u16 [ Int -- U16 ] { 0 0xFFFF clamp >U16-unsafe } + + def 0u16 [ U16 ] { 0 >U16-unsafe } + def 1u16 [ U16 ] { 1 >U16-unsafe } + def 2u16 [ U16 ] { 2 >U16-unsafe } + def 3u16 [ U16 ] { 3 >U16-unsafe } + + def U16.& [ U16 U16 -- U16 ] { on2:>Int & >U16-unsafe } + def U16.| [ U16 U16 -- U16 ] { on2:>Int | >U16-unsafe } + def U16.^ [ U16 U16 -- U16 ] { on2:>Int ^ >U16-unsafe } + + def U16.compare [ U16 U16 -- Comparison ] { on2:>Int compare } + def U16.= [ U16 U16 -- Bool ] { on2:>Int = } + def U16.== [ U16 U16 -- Bool ] { on2:>Int == } + def U16.< [ U16 U16 -- Bool ] { on2:>Int < } + def U16.<= [ U16 U16 -- Bool ] { on2:>Int <= } + def U16.> [ U16 U16 -- Bool ] { on2:>Int > } + def U16.>= [ U16 U16 -- Bool ] { on2:>Int >= } + def U16.<> [ U16 U16 -- Bool ] { on2:>Int <> } + def U16.0= [ U16 -- Bool ] { >Int 0= } + def U16.0> [ U16 -- Bool ] { >Int 0> } + + def U16.MAX [ U16 ] { 0xFFFF >U16-unsafe } + def U16.MIN [ U16 ] { 0 >U16-unsafe } + def U16.succ [ U16 -- U16 ] { dup U16.MAX < then(>Int 1+ >U16-unsafe) } + def U16.pred [ U16 -- U16 ] { dup 0> then(>Int 1- >U16-unsafe) } +) -inline( - def(U8.|, U8 U8 -- U8, both(>Int) | >U8-unsafe) - def(U16.|, U16 U16 -- U16, both(>Int) | >U16-unsafe) - def(U32.|, U32 U32 -- U32, both(>Int) | >U32-unsafe) - def(U64.|, U64 U64 -- U64, both(>Int-unsafe) | >U64-unsafe) - - def(U8.&, U8 U8 -- U8, both(>Int) & >U8-unsafe) - def(U16.&, U16 U16 -- U16, both(>Int) & >U16-unsafe) - def(U32.&, U32 U32 -- U32, both(>Int) & >U32-unsafe) - def(U64.&, U64 U64 -- U64, both(>Int-unsafe) & >U64-unsafe) - - def(U8.^, U8 U8 -- U8, both(>Int) ^ >U8-unsafe) - def(U16.^, U16 U16 -- U16, both(>Int) ^ >U16-unsafe) - def(U32.^, U32 U32 -- U32, both(>Int) ^ >U32-unsafe) - def(U64.^, U64 U64 -- U64, both(>Int-unsafe) ^ >U64-unsafe) - - def(U8.==, U8 U8 -- Bool, both(>Int) ==) - def(U16.==, U16 U16 -- Bool, both(>Int) ==) - def(U32.==, U32 U32 -- Bool, both(>Int) ==) - def(U64.==, U64 U64 -- Bool, both(>Int-unsafe) ==) - def(I8.==, I8 I8 -- Bool, both(>Int) ==) - def(I16.==, I16 I16 -- Bool, both(>Int) ==) - def(I32.==, I32 I32 -- Bool, both(>Int) ==) - def(I64.==, I64 I64 -- Bool, both(>Int) ==) +inline ( + def U32.>Int [ U32 -- Int ] { Int>U32-unsafe -> id } + + def Int.>U32-unsafe [ Int -- U32 ] { Int>U32-unsafe } + def Int.>U32& [ Int -- U32 ] { U32.MAX >Int & >U32-unsafe } + def Int.>U32? [ Int -- Maybe(U32) ] { >U32(Some, drop None) } + def Int.>U32(f) [ (*a Int -- *a U32 ) *a Int -- *a U32 ] { >U32(id, f) } + def Int.>U32(f,g) [ (*a U32 -- *b, *a Int -- *b ) *a Int -- *b ] { + dup 0 U32.MAX >Int in-range if(>U32-unsafe f, g) + } + def Int.u32 [ Int -- U32 ] { 0 U32.MAX >Int clamp >U32-unsafe } + + def 0u32 [ U32 ] { 0 >U32-unsafe } + def 1u32 [ U32 ] { 1 >U32-unsafe } + def 2u32 [ U32 ] { 2 >U32-unsafe } + def 3u32 [ U32 ] { 3 >U32-unsafe } + + def U32.& [ U32 U32 -- U32 ] { on2:>Int & >U32-unsafe } + def U32.| [ U32 U32 -- U32 ] { on2:>Int | >U32-unsafe } + def U32.^ [ U32 U32 -- U32 ] { on2:>Int ^ >U32-unsafe } + + def U32.compare [ U32 U32 -- Comparison ] { on2:>Int compare } + def U32.= [ U32 U32 -- Bool ] { on2:>Int = } + def U32.== [ U32 U32 -- Bool ] { on2:>Int == } + def U32.< [ U32 U32 -- Bool ] { on2:>Int < } + def U32.<= [ U32 U32 -- Bool ] { on2:>Int <= } + def U32.> [ U32 U32 -- Bool ] { on2:>Int > } + def U32.>= [ U32 U32 -- Bool ] { on2:>Int >= } + def U32.<> [ U32 U32 -- Bool ] { on2:>Int <> } + def U32.0= [ U32 -- Bool ] { >Int 0= } + def U32.0> [ U32 -- Bool ] { >Int 0> } + + def U32.MAX [ U32 ] { 0xFFFFFFFF >U32-unsafe } + def U32.MIN [ U32 ] { 0 >U32-unsafe } + def U32.succ [ U32 -- U32 ] { dup U32.MAX < then(>Int 1+ >U32-unsafe) } + def U32.pred [ U32 -- U32 ] { dup 0> then(>Int 1- >U32-unsafe) } +) + +inline ( + def Int.>U64-unsafe [ Int -- U64 ] { Int>U64-unsafe } + def Int.>U64& [ Int -- U64 ] { >U64-unsafe } + def Int.>U64? [ Int -- Maybe(U64) ] { >U64(Some, drop None) } + def Int.>U64(f) [ (*a Int -- *a U64) *a Int -- *a U64 ] { >U64(id, f) } + def Int.>U64(f,g) [ (*a U64 -- *b, *a Int -- *b) *a Int -- *b ] { + dup 0< if(g, >U64-unsafe f) + } + def Int.u64 [ Int -- U64 ] { 0 max >U64-unsafe } + + def U64.>Int-unsafe [ U64 -- Int ] { Int>U64-unsafe -> id } + def U64.>Int? [ U64 -- Maybe(Int) ] { >Int(Some, drop None) } + def U64.>Int(f) [ ( *a U64 -- *a Int ) *a U64 -- *a Int ] { >Int(id, f) } + def U64.>Int(f,g) [ ( *a Int -- *b, *a U64 -- *b ) *a U64 -- *b ] { + dup >Int-unsafe 0< if(g, >Int-unsafe f) + } + + def U64.MAX [ U64 ] { -1 >U64-unsafe } + def U64.MIN [ U64 ] { 0 >U64-unsafe } + + def U64.| [ U64 U64 -- U64 ] { on2:>Int-unsafe | >U64-unsafe } + def U64.& [ U64 U64 -- U64 ] { on2:>Int-unsafe & >U64-unsafe } + def U64.^ [ U64 U64 -- U64 ] { on2:>Int-unsafe ^ >U64-unsafe } + + def U64.== [ U64 U64 -- Bool ] { on2:>Int-unsafe == } + def U64.= [ U64 U64 -- Bool ] { on2:>Int-unsafe = } + def U64.<> [ U64 U64 -- Bool ] { on2:>Int-unsafe <> } ) ####### @@ -475,7 +639,12 @@ inline ( def 256u [ Nat ] { 256 NatUnsafe } def Int.u [ Int -- Nat ] { 0 max NatUnsafe } - def Int.>Nat (f,g) [ ( *a Nat -- *b, *a Int -- *b ) *a Int -- *b ] { dup 0< if(g, NatUnsafe f) } + def Int.>Nat (f) [ ( *a Int -- *a Nat ) *a Int -- *a Nat ] { + dup 0< if(f, NatUnsafe) + } + def Int.>Nat (f,g) [ ( *a Nat -- *b, *a Int -- *b ) *a Int -- *b ] { + dup 0< if(g, NatUnsafe f) + } def Nat.>Int [ Nat -- Int ] { /NatUnsafe } @@ -535,7 +704,10 @@ inline ( struct UIndex { Nat } inline( def Nat.>UIndex [ Nat -- UIndex ] { UIndex } - def Int.>UIndex (f,g) [ ( *a UIndex -- *b, *a Int -- *b ) *a Int -- *b ] { >Nat(UIndex f, g) } + def Int.>UIndex (f) [ ( *a Int -- *a UIndex ) *a Int -- *a UIndex ] { >UIndex(id, f) } + def Int.>UIndex (f,g) [ ( *a UIndex -- *b, *a Int -- *b ) *a Int -- *b ] { + >Nat(UIndex f, g) + } def UIndex.>Nat [ UIndex -- Nat ] { /UIndex } def UIndex.>Int [ UIndex -- Int ] { /UIndex >Int } @@ -704,7 +876,6 @@ inline( def UOffset.min [ UOffset UOffset -- UOffset ] { dip(>Nat) >Nat min >UOffset } ) - ########## # TUPLES # ########## @@ -748,7 +919,8 @@ inline( unpack2 dip(f) " " ; g) def(pack3-show;-contents(f,g,h), (a +Str -- +Str, b +Str -- +Str, c +Str -- +Str) [a b c] +Str -- +Str, pack-uncons dip(pack2-show;-contents(f,g)) " " ; h) - def(pack4-show;-contents(f,g,h,i), (a +Str -- +Str, b +Str -- +Str, c +Str -- +Str, d +Str -- +Str) [a b c d] +Str -- +Str, + def(pack4-show;-contents(f,g,h,i), + (a +Str -- +Str, b +Str -- +Str, c +Str -- +Str, d +Str -- +Str) [a b c d] +Str -- +Str, pack-uncons dip(pack3-show;-contents(f,g,h)) " " ; i) def(pack2-show;(f,g), (a +Str -- +Str, b +Str -- +Str) [a b] +Str -- +Str, @@ -773,11 +945,10 @@ inline( def(@?, Mut(t) -- Maybe(t), dup mut-is-set if(@ Some, drop None)) -inline( - def(panic!, *a Str -- *b, prim-panic) - def(impossible!, *a -- *b, "Impossible! The impossible has occured!" panic!) - def(expect!(f,g), (*a -- *a Bool, *a -- *b Str) *a -- *a, - f if(id, g panic!)) - def(assert!(f,g), (*a -- *a Bool, *a -- *b Str) *a -- *a, - expect!(f,g "assertion failed: " swap prim-str-cat)) -) +inline:def(panic!, *a Str -- *b, prim-panic) + +def(impossible!, *a -- *b, "Impossible! The impossible has occured!" panic!) +def(expect!(f,g), (*a -- *a Bool, *a -- *b Str) *a -- *a, + f if(id, g panic!)) +def(assert!(f,g), (*a -- *a Bool, *a -- *b Str) *a -- *a, + expect!(f,g "assertion failed: " swap prim-str-cat)) diff --git a/lib/std/str.mth b/lib/std/str.mth index 24c8a306..5357abeb 100644 --- a/lib/std/str.mth +++ b/lib/std/str.mth @@ -9,18 +9,21 @@ import(std.ctypes) alias(Str.cat, prim-str-cat) inline( - def(Str.num-bytes, Str -- USize, prim-str-num-bytes .u >USize) - def(Str.empty?, Str -- Bool, num-bytes 0=) + def Str.num-bytes [ Str -- USize ] { prim-str-num-bytes NatUnsafe >USize } + def Str.empty? [ Str -- Bool ] { num-bytes 0= } ) ||| Copy string bytes to pointer location (without adding 0 at end). ||| Return first unwritten location in second argument. -def(Ptr.!Str+, Str Ptr +Unsafe -- Ptr +Unsafe, - swap with-data( - rotl - dup2 dip(>UOffset) uoffset - dip(copy) - )) +def Ptr.!Str+ [ Str Ptr +Unsafe -- Ptr +Unsafe ] { + dup2 dip(num-bytes >UOffset) + uoffset dip(!Str) +} + +||| Copy string bytes to pointer location. +def Ptr.!Str [ Str Ptr +Unsafe -- +Unsafe ] { + swap with-data(rotl copy) +} inline( def(Str.ClonePtrSlice, Ptr USize +Unsafe -- Str +Unsafe, >Int prim-str-copy) @@ -33,15 +36,12 @@ inline ( def(Str.thaw, Str -- +Str, +Str) def(+Str.freeze, +Str -- Str, +Str -> id) def(+Str.rdrop, +Str --, +Str -> drop) - def(Str(f), (*a +Str -- *b +Str) *a -- *b Str, "" thaw f freeze) def(+Str.;, Str +Str -- +Str, push-str!) + def(+Str.dup!, +Str -- Str +Str, +Str -> dup dip(+Str)) + def(+Str.num-bytes?, +Str -- USize +Str, + +Str -> dup num-bytes dip(+Str)) ) - -def(+Str.dup!, +Str -- Str +Str, - +Str -> dup dip(+Str)) - -def(+Str.num-bytes?, +Str -- USize +Str, - +Str -> dup num-bytes dip(+Str)) +def(Str(f), (*a +Str -- *b +Str) *a -- *b Str, "" thaw f freeze) def Str.last-byte [ Str -- Byte ] { dup num-bytes 1- >UOffset ( @@ -91,22 +91,20 @@ def +Str.push-str! [ Str +Str -- +Str ] { +Str -> swap cat +Str } -inline ( - ||| Access the string's byte data. This function ensures the - ||| string won't be garbage collected while inspecting its data. - def Str.with-data(f) [ (*a Ptr USize -- *b) *a Str -- *b ] { - dup dip(dup dip(prim-str-base) num-bytes f) drop - } - - ||| Traverse a string's bytes. - def Str.bytes-for(f) [ (*a Byte -- *a) *a Str -- *a ] { - with-data( - >Nat repeat( - dup dip(unsafe(@Byte) f 1u >UOffset) unsafe(uoffset) - ) drop - ) - } -) +||| Access the string's byte data. This function ensures the +||| string won't be garbage collected while inspecting its data. +def Str.with-data(f) [ (*a Ptr USize -- *b) *a Str -- *b ] { + dup dip(dup dip(prim-str-base) num-bytes f) drop +} + +||| Traverse a string's bytes. +def Str.bytes-for(f) [ (*a Byte -- *a) *a Str -- *a ] { + with-data( + >Nat repeat( + dup dip(unsafe(@Byte) f 1u >UOffset) unsafe(uoffset) + ) drop + ) +} ||| Get the string's first byte. ||| Returns None if the string is empty. @@ -137,7 +135,7 @@ def(Str.from-bytes-unsafe, List(Byte) -- Str, base size unsafe(Str.ClonePtrSlice) rdrop) -inline:def(Str.with-cstr(f), (*a CStr -- *b) *a Str -- *b, +def(Str.with-cstr(f), (*a CStr -- *b) *a Str -- *b, with-data( >UOffset over unsafe(uoffset @U8) >Int 0= else("tried to use Str as CStr, but Str is not zero terminated" panic!) @@ -188,7 +186,6 @@ def +Str.find [ Str +Str -- Maybe(UOffset) +Str ] { ) drop2 } -inline: def(+Str.split-byte(p), (*a Byte -- *a Bool) *a +Str -- *a List+(Str) +Str, LIST+( 0u >UOffset dup while( dup rdip(+Str.num-bytes?) >UOffset <, @@ -202,20 +199,19 @@ def(+Str.split-byte(p), (*a Byte -- *a Bool) *a +Str -- *a List+(Str) +Str, def(+Str.split-byte, Byte +Str -- List+(Str) +Str, split-byte(over ==) nip) -inline: def(Str.split-byte(p), (*a Byte -- *a Bool) *a Str -- *a List+(Str), thaw +Str.split-byte(p) rdrop) def(Str.split-byte, Byte Str -- List+(Str), thaw +Str.split-byte rdrop) -inline:def(+Str.find-last-byte(p), (*a Byte -- *a Bool) *a +Str -- *a Maybe(UOffset) +Str, +def(+Str.find-last-byte(p), (*a Byte -- *a Bool) *a +Str -- *a Maybe(UOffset) +Str, num-bytes? >UOffset None while( dup none? and(over 0>), drop pred sip(byte@ rdip(p)) swap if(dup Some, None) ) nip) -inline:def(Str.split-last-byte(p), (*a Byte -- *a Bool) *a Str -- *a Str Maybe(Str), +def(Str.split-last-byte(p), (*a Byte -- *a Bool) *a Str -- *a Str Maybe(Str), thaw find-last-byte(p) freeze swap map(unsafe( swap dup2 dip:1+ drop-slice dip(dip:>USize take-slice) diff --git a/lib/std/world.mth b/lib/std/world.mth index 7d9ea9f6..dd3a92d4 100644 --- a/lib/std/world.mth +++ b/lib/std/world.mth @@ -13,12 +13,11 @@ import(std.output) def(+World.print-, Str +World -- +World, stdout-file with-data:unsafe:write-bytes! drop2 close-file!) def(+World.trace-, Str +World -- +World, stderr-file with-data:unsafe:write-bytes! drop2 close-file!) -inline( - def(+World.print, Str +World -- +World, "\n" cat print-) - def(+World.trace, Str +World -- +World, "\n" cat trace-) - def(+World.print(f), (*a +World +Str -- *b +World +Str) *a +World -- *b +World, Str(f) print) - def(+World.trace(f), (*a +World +Str -- *b +World +Str) *a +World -- *b +World, Str(f) trace) -) +def(+World.print, Str +World -- +World, "\n" cat print-) +def(+World.trace, Str +World -- +World, "\n" cat trace-) + +def(+World.print(f), (*a +World +Str -- *b +World +Str) *a +World -- *b +World, Str(f) print) +def(+World.trace(f), (*a +World +Str -- *b +World +Str) *a +World -- *b +World, Str(f) trace) def(+World.stdin(f), (*a +World +Input -- *b +World +Input) *a +World -- *b +World, stdin-file input(f) diff --git a/src/c99.mth b/src/c99.mth index bc8cd8af..649309bc 100644 --- a/src/c99.mth +++ b/src/c99.mth @@ -47,19 +47,21 @@ struct +C99 { options: C99_Options depth: Nat fresh-counter: Nat + put-enabled: Bool +needs: +Needs +output: +Output +mirth: +Mirth } -def(+C99.put, Str +C99 -- +C99, +output:put) -def(+C99.put-byte, Byte +C99 -- +C99, +output:put-byte) -def(+C99.line, +C99 -- +C99, +output:line) +def(+C99.put, Str +C99 -- +C99, put-enabled if(+output:put, drop)) +def(+C99.put-byte, Byte +C99 -- +C99, put-enabled if(+output:put-byte, drop)) +def(+C99.line, +C99 -- +C99, put-enabled then(+output:line)) def(c99-start!, Arrow C99_Options +World +Mirth -- Arrow +World +C99, >options 0u >depth 0u >fresh-counter + True >put-enabled +Needs.new dup determine-arrow-needs! >+needs >+mirth @options output-path create-file! unwrap!(+mirth> fatal-error!) +Output.start! >+output +C99) @@ -67,6 +69,7 @@ def(c99-start!, Arrow C99_Options +World +Mirth -- Arrow +World +C99, def(c99-end!, +World +C99 -- +World +Mirth, /+C99 depth> fresh-counter> options> drop3 + put-enabled> drop +needs> rdrop +output> end! close-file! +mirth>) @@ -80,11 +83,9 @@ def +C99.fresh-nat! [ +C99 -- Nat +C99 ] { dup 1+ fresh-counter! } -inline ( - def +C99.with-fresh-counter(f) [ ( *a +C99 -- *b +C99 ) *a Nat +C99 -- *b Nat +C99 ] { - fresh-counter dip(fresh-counter! f fresh-counter) fresh-counter! - } -) +def +C99.with-fresh-counter(f) [ ( *a +C99 -- *b +C99 ) *a Nat +C99 -- *b Nat +C99 ] { + fresh-counter dip(fresh-counter! f fresh-counter) fresh-counter! +} def +C99.fresh-name! [ +C99 -- Str +C99 ] { "v" fresh-name-on! @@ -104,6 +105,8 @@ def +C99.fresh-name-on! [ Str +C99 -- Str +C99 ] { def(run-output-c99!, Arrow C99_Options +World +Mirth -- +World +Mirth, num-errors 0> if( + "There were errors, so codegen stopped." rdip:trace + panic-diagnostics! drop2, c99-start! @@ -161,7 +164,7 @@ def c99-buffer! [ Buffer +C99 -- +C99 ] { "[" put size show put "] = {0};" put line } def c99-buffer-call! [ Buffer +C99Branch -- +C99Branch ] { - C99RT_PTR push-expression!(+mirth:cname put) + C99RT_PTR push-value-expression!(+mirth:cname put) } def c99-variables! [ +C99 -- +C99 ] { Variable.for(c99-variable!) } @@ -171,36 +174,36 @@ def c99-variable! [ Variable +C99 -- +C99 ] { " = {0};" put line } def c99-variable-call! [ Variable +C99Branch -- +C99Branch ] { - C99RT_PTR push-expression!("&" put +mirth:cname put) + C99RT_PTR push-value-expression!("&" put +mirth:cname put) } def(c99-tag-defs!, +C99 -- +C99, Tag.for(c99-tag-def!)) def c99-tag-body! [ Tag +C99Branch -- +C99Branch ] { >tag - @tag +core:+mirth:semi-transparent? if-some( + @tag +mirth:semi-transparent? if-some( input match { { STPConsLabel -> - dip:type-to-c99-repr pop-to-local-label! + dip:type-to-c99-repr pop-value-label! @tag outputs-resource? if( - turn-into-resource! push-local-resource!, - push-local! + turn-into-resource! push-resource!, + push-value! ) } { STPWithLabel -> - dip:resource-to-c99-repr pop-to-local-resource-label! - push-local-resource! + dip:resource-to-c99-repr pop-resource-label! + push-resource! } { STPCons -> - type-to-c99-repr pop-to-local! + type-to-c99-repr pop-value! @tag outputs-resource? if( - turn-into-resource! push-local-resource!, - push-local! + turn-into-resource! push-resource!, + push-value! ) } { STPWith -> - resource-to-c99-repr pop-to-local-resource! - push-local-resource! + resource-to-c99-repr pop-resource! + push-resource! } }, @@ -213,7 +216,7 @@ def c99-tag-body! [ Tag +C99Branch -- +C99Branch ] { @tag name >Str put " */" put sfx> put ), - push-expression!( + push-value-expression!( pfx> put @tag value-show put "LL /* " put @tag name >Str put " */" put @@ -241,19 +244,19 @@ def c99-tag-body! [ Tag +C99Branch -- +C99Branch ] { @tag label-inputs reverse-for( >label @label is-resource-label? if( - C99RT_VAL label> pop-to-local-resource-label! consume-as-VAL, - C99RT_VAL label> pop-to-local-label! consume-as-VAL + C99RT_VAL label> pop-resource-label! consume-as-VAL, + C99RT_VAL label> pop-value-label! consume-as-VAL ) c99-line(@tup put "->cells[" put @i show put "] = " put put ";" put) @i:pred ) @tag num-resource-inputs repeat( - C99RT_VAL pop-to-local-resource! consume-as-VAL + C99RT_VAL pop-resource! consume-as-VAL c99-line(@tup put "->cells[" put @i show put "] = " put put ";" put) @i:pred ) @tag num-type-inputs repeat( - C99RT_VAL pop-to-local! consume-as-VAL + C99RT_VAL pop-value! consume-as-VAL c99-line(@tup put "->cells[" put @i show put "] = " put put ";" put) @i:pred ) @@ -264,7 +267,7 @@ def c99-tag-body! [ Tag +C99Branch -- +C99Branch ] { ", " put @tag num-total-inputs 1+ show put ")" put ), - C99RT_VAL push-expression!( + C99RT_VAL push-value-expression!( "MKTUP(" put tup> put ", " put @tag num-total-inputs 1+ show put ")" put @@ -276,43 +279,43 @@ def c99-tag-body! [ Tag +C99Branch -- +C99Branch ] { def c99-reverse-tag-body! [ Tag +C99Branch -- +C99Branch ] { >tag - @tag +core:+mirth:semi-transparent? if-some( + @tag +mirth:semi-transparent? if-some( input match { { STPConsLabel -> swap type-to-c99-repr @tag outputs-resource? if( - pop-to-local-resource! turn-into-value!, - pop-to-local! + pop-resource! turn-into-value!, + pop-value! ) - push-local-label! + push-value-label! } { STPWithLabel -> swap resource-to-c99-repr - pop-to-local-resource! - push-local-resource-label! + pop-resource! + push-resource-label! } { STPCons -> type-to-c99-repr @tag outputs-resource? if( - pop-to-local-resource! turn-into-value!, - pop-to-local! + pop-resource! turn-into-value!, + pop-value! ) - push-local! + push-value! } { STPWith -> - resource-to-c99-repr pop-to-local-resource! - push-local-resource! + resource-to-c99-repr pop-resource! + push-resource! } }, @tag num-total-inputs 0= if( - @tag .data pop-local-value/resource-data! rdrop, # decref is unnecessary + @tag .data pop-value-value/resource-data! rdrop, # decref is unnecessary - @tag .data pop-local-value/resource-data! consume-as-VAL + @tag .data pop-value-value/resource-data! consume-as-VAL Str("VTUP(" ; ; ")" ;) >tup 1 >i @tag num-type-inputs repeat( - C99RT_VAL push-expression!(@tup put "->cells[" put @i show put "]" put) + C99RT_VAL push-value-expression!(@tup put "->cells[" put @i show put "]" put) @i:1+ ) @tag num-resource-inputs repeat( @@ -353,14 +356,14 @@ def(c99-tag-label-index, Tag Label +C99 -- Nat +C99, def c99-tag-get-label! [ TagField +C99Branch -- +C99Branch ] { /TagField type/resource> >fieldty - @tag +core:+mirth:semi-transparent? if( + @tag +mirth:semi-transparent? if( fieldty> match { { Left -> # field is value @tag outputs-resource? if( # wrapper is resource - type-to-c99-repr pop-to-local-resource! - dup-local-resource-as-value! - rdip(push-local-resource!) push-local!, + type-to-c99-repr pop-resource! + dup-resource-as-value! + rdip(push-resource!) push-value!, # wrapper is value drop @@ -373,21 +376,21 @@ def c99-tag-get-label! [ TagField +C99Branch -- +C99Branch ] { } }, - @tag .data pop-local-value/resource-data! >+tuplevar + @tag .data pop-value-value/resource-data! >+tuplevar fieldty> match { { Left -> # field is value type-to-c99-repr >fieldrepr - @fieldrepr +core:local-expression!( + @fieldrepr value-expression!( fieldrepr> v-macro put "(VTUP(" put @+tuplevar:rdup consume-as-VAL put ")->cells[" put @tag @label c99-tag-label-index show put "])" put - ) rswap dup-local! rdrop push-local! + ) dup-value! rdrop push-value! +tuplevar> match { { +Left -> # tuple is value - drop-local! } + drop-value! } { +Right -> # tuple is resource - push-local-resource! } + push-resource! } } } { Right -> # field and tuple are resources @@ -398,7 +401,7 @@ def c99-tag-get-label! [ TagField +C99Branch -- +C99Branch ] { @tag @label c99-tag-label-index show put "])" put ) - +tuplevar> push-local-value/resource! + +tuplevar> push-value-value/resource! } } ) @@ -408,33 +411,33 @@ def c99-tag-get-label! [ TagField +C99Branch -- +C99Branch ] { def c99-tag-set-label! [ TagField +C99Branch -- +C99Branch ] { /TagField type/resource> >fieldty - @tag +core:+mirth:semi-transparent? if( + @tag +mirth:semi-transparent? if( fieldty> match { { Left -> # field is value - @tag .data pop-local-value/resource-data! match { + @tag .data pop-value-value/resource-data! match { { +Right -> # wrapper is resource - drop-local-resource-as-value! - type-to-c99-repr pop-to-local! - turn-into-resource! push-local-resource! } + drop-resource-as-value! + type-to-c99-repr pop-value! + turn-into-resource! push-resource! } { +Left -> # wrapper is value - drop drop-local! } + drop drop-value! } } } { Right -> # field and wrapper are resource - C99RT_I64 pop-to-local-resource! rdrop # vacant wrapper is unit + C99RT_I64 pop-resource! rdrop # vacant wrapper is unit drop } }, - @tag .data pop-local-value/resource-data! >+tuplevar + @tag .data pop-value-value/resource-data! >+tuplevar @fieldty match { - { Left -> type-to-c99-repr pop-to-local! consume-as-VAL } - { Right -> resource-to-c99-repr pop-to-local-resource! consume-as-VAL } + { Left -> type-to-c99-repr pop-value! consume-as-VAL } + { Right -> resource-to-c99-repr pop-resource! consume-as-VAL } } >fieldval +tuplevar> match { { +Left -> # field and tuple are both values consume-as-VAL >tupleval - C99RT_VAL push-expression!( + C99RT_VAL push-value-expression!( "tup_replace(" put tupleval> put ", " put @@ -451,13 +454,13 @@ def c99-tag-set-label! [ TagField +C99Branch -- +C99Branch ] { { Left -> # field is value type-to-c99-repr >fieldrepr @fieldrepr needs-refcounting? then ( - @fieldrepr +core:local-expression! ( + @fieldrepr value-expression! ( "VTUP(" put @+tuplevar:rdup consume-as-VAL put ")->cells[" put @tag @label c99-tag-label-index show put "]" put - ) rswap drop-local! + ) drop-value! ) fieldrepr> drop } @@ -475,7 +478,7 @@ def c99-tag-set-label! [ TagField +C99Branch -- +C99Branch ] { ";" put ) +tuplevar> - push-local-resource! + push-resource! } } ) @@ -499,7 +502,7 @@ def(External.c99-api, External +C99 -- C99API +C99, dup ~c99-api memoize(dup +mirth:cname-type cname-type-to-c99-api) nip) def(c99-external-call!, List(Arg) External +C99Branch -- +C99Branch, - +core:c99-api c99-smart-call!) + +c99:c99-api c99-smart-call!) def(c99-external-def!, External +C99 -- +C99, >ext @@ -577,26 +580,33 @@ def CType.>C99ReprType [ CType -- C99ReprType ] { } def(CTypeStackPart.c99-pop, CTypeStackPart +C99Branch -- Str +C99Branch, - CTSPCons -> >C99ReprType dup pop-to-local! consume-as, - CTSPWith -> >C99ReprType dup pop-to-local-resource! turn-into-value! consume-as, - CTSPConsLabel -> dip(>C99ReprType dup) pop-to-local-label! consume-as, - CTSPWithLabel -> dip(>C99ReprType dup) pop-to-local-resource-label! turn-into-value! consume-as) + CTSPCons -> >C99ReprType dup pop-value! consume-as, + CTSPWith -> >C99ReprType dup pop-resource! turn-into-value! consume-as, + CTSPConsLabel -> dip(>C99ReprType dup) pop-value-label! consume-as, + CTSPWithLabel -> dip(>C99ReprType dup) pop-resource-label! turn-into-value! consume-as) def(CTypeStackPart.c99-push, Str CTypeStackPart +C99Branch -- +C99Branch, - CTSPCons -> >C99ReprType dup push-expression!("(" put underlying-c99-type put ")(" put put ")" put), + CTSPCons -> >C99ReprType dup push-value-expression!("(" put underlying-c99-type put ")(" put put ")" put), CTSPWith -> >C99ReprType dup push-resource-expression!("(" put underlying-c99-type put ")(" put put ")" put), CTSPConsLabel -> dip(>C99ReprType dup) push-label-expression!("(" put underlying-c99-type put ")(" put put ")" put), CTSPWithLabel -> dip(>C99ReprType dup) push-label-expression!("(" put underlying-c99-type put ")(" put put ")" put)) -inline ( - def(+C99.c99-nest(f), (*a +C99 -- *b +C99) *a +C99 -- *b +C99, depth:1+ f depth:pred) - def(+C99.c99-line(f), (*a +C99 -- *b +C99) *a +C99 -- *b +C99, indent f line) +def(+C99.c99-nest(f), (*a +C99 -- *b +C99) *a +C99 -- *b +C99, depth:1+ f depth:pred) + +def +C99.c99-line(f) [ (*a +C99 -- *b +C99) *a +C99 -- *b +C99 ] { + indent f line +} +def +C99.c99-line-if(f) [ (*a +C99 -- *b +C99) *a Bool +C99 -- *b +C99 ] { + put-enabled(swap) + dip:c99-line(f) + put-enabled! +} - def +C99Branch.c99-line(f) [ (*a +C99 -- *b +C99) *a +C99Branch -- *b +C99Branch ] - { +core:c99-line(f) } - def +C99Branch.c99-nest(f) [ (*a +C99Branch -- *b +C99Branch) *a +C99Branch -- *b +C99Branch ] - { +core:depth:1+ f +core:depth:pred } -) +def +C99Branch.c99-line(f) [ (*a +C99 -- *b +C99) *a +C99Branch -- *b +C99Branch ] { + reachable +c99:c99-line-if(f) +} +def +C99Branch.c99-nest(f) [ (*a +C99Branch -- *b +C99Branch) *a +C99Branch -- *b +C99Branch ] + { +c99:depth:1+ f +c99:depth:pred } def(+C99.indent, +C99 -- +C99, depth repeat("\t" put)) data C99APIArgSource { @@ -614,10 +624,10 @@ struct C99APIArg { def C99APIArg.pop-consume! [ C99APIArg +C99Branch -- +C99Branch Str ] { /C99APIArg name> drop repr> dup source> match { - { C99AAS_Value -> pop-to-local! consume-as } - { C99AAS_Resource -> pop-to-local-resource! turn-into-value! consume-as } - { C99AAS_ValueLabel -> pop-to-local-label! consume-as } - { C99AAS_ResourceLabel -> pop-to-local-resource-label! turn-into-value! consume-as } + { C99AAS_Value -> pop-value! consume-as } + { C99AAS_Resource -> pop-resource! turn-into-value! consume-as } + { C99AAS_ValueLabel -> pop-value-label! consume-as } + { C99AAS_ResourceLabel -> pop-resource-label! turn-into-value! consume-as } } } @@ -628,23 +638,23 @@ def C99APIArg.pop-to-reserved! [ C99APIArg +C99Branch -- +C99Branch ] { def C99APIArg.push-to! [ Str C99APIArg +C99Branch -- +C99Branch ] { /C99APIArg name> drop repr> source> match { - { C99AAS_Value -> push-expression!(put) } + { C99AAS_Value -> push-value-expression!(put) } { C99AAS_Resource -> push-resource-expression!(put) } { C99AAS_ValueLabel -> push-label-expression!(put) } { C99AAS_ResourceLabel -> push-label-expression!(put) } } } -def C99APIArg.push-as-local! [ C99APIArg +C99Branch -- +C99Branch ] { +def C99APIArg.push-api-arg! [ C99APIArg +C99Branch -- +C99Branch ] { /C99APIArg - name> >local-name - repr> >local-repr - +C99Local + name> >value-name + repr> >value-repr + +C99Value source> match { - { C99AAS_Value -> push-local! } - { C99AAS_ValueLabel -> push-local-label! } - { C99AAS_Resource -> turn-into-resource! push-local-resource! } - { C99AAS_ResourceLabel -> turn-into-resource! push-local-resource-label! } + { C99AAS_Value -> push-value! } + { C99AAS_ValueLabel -> push-value-label! } + { C99AAS_Resource -> turn-into-resource! push-resource! } + { C99AAS_ResourceLabel -> turn-into-resource! push-resource-label! } } } @@ -654,15 +664,16 @@ struct C99API { in-params: List(C99APIArg) out-params: List(C99APIArg) return-param: Maybe(C99APIArg) - must-flush?: Bool + must-flush: Bool + doesnt-return: Bool } -def +C99.stack-type-to-c99-api-params-aux [ StackType +C99 -- Bool List(C99APIArg) +C99 ] { - { STACK_TYPE_UNIT -> False L0 } - { STACK_TYPE_ERROR -> True L0 } - { STACK_TYPE_DONT_CARE -> True L0 } - { STMeta -> expand-if(>StackType stack-type-to-c99-api-params-aux, drop True L0) } - { STVar -> drop True L0 } +def +C99.stack-type-to-c99-api-params-aux [ StackType +C99 -- must-flush:Bool List(C99APIArg) +C99 ] { + { STACK_TYPE_UNIT -> False >must-flush L0 } + { STACK_TYPE_ERROR -> True >must-flush L0 } + { STACK_TYPE_DONT_CARE -> True >must-flush L0 } + { STMeta -> expand-if(>StackType stack-type-to-c99-api-params-aux, drop True >must-flush L0) } + { STVar -> drop True >must-flush L0 } { STCons -> C99AAS_Value >source +mirth:c99-repr >repr stack-type-to-c99-api-params-aux @@ -681,7 +692,7 @@ def +C99.stack-type-to-c99-api-params-aux [ StackType +C99 -- Bool List(C99APIAr fresh-arg-name! >name C99APIArg swap cons } } -def +C99.stack-type-to-c99-api-params [ StackType +C99 -- Bool List(C99APIArg) +C99 ] { +def +C99.stack-type-to-c99-api-params [ StackType +C99 -- must-flush:Bool List(C99APIArg) +C99 ] { +C99.stack-type-to-c99-api-params-aux reverse } @@ -693,12 +704,20 @@ def +C99.cname-type-to-c99-api [ Str ArrowType +C99 -- C99API +C99 ] { dup /L1 >return-param @return-param then(drop L0) >out-params ) drop - || >must-flush? + must-flush> must-flush> || >must-flush + @type cod linear-base-var? if-some( + @type dom linear-base-var? if-some( + <>, + drop False + ), + False + ) >doesnt-return + @doesnt-return not @must-flush:&& C99API } -def C99APIArg.reserve-as-new-local! [ C99APIArg +C99Branch -- C99APIArg +C99Branch ] { - dup repr new-local! +def C99APIArg.reserve-as-new-value! [ C99APIArg +C99Branch -- C99APIArg +C99Branch ] { + dup repr new-value! consume swap name! } @@ -711,12 +730,12 @@ def C99APIArg.reserve-as-is! [ C99APIArg +C99Branch -- +C99Branch ] { source> drop } -def(c99-smart-call!, List(Arg) C99API +C99Branch -- +C99Branch, +def c99-smart-call! [ List(Arg) C99API +C99Branch -- +C99Branch ] { >api c99-args-push! @api in-params reverse map(pop-consume!) reverse >popped-inputs - @api must-flush? then(flush-cache!) - @api out-params map(reserve-as-new-local!) >reserved-outputs + @api must-flush then(flush-cache!) + @api out-params map(reserve-as-new-value!) >reserved-outputs Str( @api cname ; "(" ; "" >sep @@ -725,14 +744,27 @@ def(c99-smart-call!, List(Arg) C99API +C99Branch -- +C99Branch, sep> drop ")" ; ) - @api return-param if-some(push-to!, c99-line(put ";" put)) - reserved-outputs> for(push-as-local!) - api> drop) + @api return-param if-some( + @api doesnt-return if( + swap c99-line(put ";" put) + False reachable! + "" swap push-to!, + + push-to! + ), + c99-line(put ";" put) + ) + @api doesnt-return not reachable:&& + reserved-outputs> for(push-api-arg!) + api> drop +} def +C99.smart-sig-put [ C99API +C99 -- +C99 ] { >api "static " put - @api return-param if-some( + @api return-param + @api doesnt-return then(drop None) + if-some( repr underlying-c99-type put, "void" put ) @@ -764,8 +796,9 @@ def c99-api-enter! [ C99API +C99 -- +C99Branch ] { @api in-params len @api out-params len + 1+ fresh-counter! + True >reachable start-branch! - @api in-params for(push-as-local!) + @api in-params for(push-api-arg!) api> drop } @@ -776,25 +809,87 @@ def c99-api-exit! [ C99API +C99Branch -- +C99 ] { c99-line("*" put put " = " put put ";" put) ) @api return-param map(pop-consume!) - end-branch! for(c99-line("return " put put ";" put)) + end-branch! + reachable> if( + for(c99-line("return " put put ";" put)), + + drop + @api return-param + @api doesnt-return then(drop None) + for( + repr dummy-value + c99-line("return " put put "; /* unreachable */" put) + ) + ) api> drop } -inline ( - def c99-smart-def! (f) [ (*a +C99Branch -- *b +C99Branch) *a C99API +C99 -- *b +C99 ] { - c99-line(dup smart-sig-put " {" put) - c99-nest( - dup dip(c99-api-enter! f) - c99-api-exit! - ) - c99-line("}" put) - } -) +def c99-smart-def! (f) [ (*a +C99Branch -- *b +C99Branch) *a C99API +C99 -- *b +C99 ] { + c99-line(dup smart-sig-put " {" put) + c99-nest( + dup dip(c99-api-enter! f) + c99-api-exit! + ) + c99-line("}" put) +} + +def c99-codip-arrow! [ Arrow +C99Branch -- +C99Branch ] { + dup +mirth:type unpack + split-parts >cod-parts >cod-base + split-parts >dom-parts >dom-base + cod-base> unit? dom-base> unit? && if( + dom-parts> dip-parts( +stack(+SNil) ) + c99-arrow! + cod-parts> dip-parts( + +stack(rdrop) + ), + + cod-parts> dom-parts> drop2 + c99-arrow! + ) +} + +def +C99Branch.dip-parts(f) [ + ( *a +C99Branch -- *b +C99Branch ) + *a List(StackTypePart) +C99Branch -- *b +C99Branch +] { + pop-stack! + rdip (f) + push-stack! +} + +||| Pop stack parts (right-to-left) into a separate stack cache. +def +C99Branch.pop-stack! [ List(StackTypePart) +C99Branch -- +C99Branch +C99Stack ] { + +SNil reverse-for(pop-stack-part!) +} + +||| Pop a part from branch to separate stack. +def +C99Stack.pop-stack-part! [ StackTypePart +C99Branch +C99Stack -- +C99Branch +C99Stack ] { + { STPCons -> rdip(type-to-c99-repr pop-value!) rswap +SCons } + { STPWith -> rdip(resource-to-c99-repr pop-resource!) rswap +SWith } + { STPConsLabel -> rdip(dip:type-to-c99-repr tuck pop-value-label!) rswap +SConsLabel } + { STPWithLabel -> rdip(dip:resource-to-c99-repr tuck pop-resource-label!) rswap +SWithLabel } +} + +def +C99Stack.reverse-cat! [ +C99Stack +C99Stack -- +C99Stack ] { + while ( match { + { +SNil -> +SNil False } + { +SCons -> rswap rdip:+SCons True } + { +SWith -> rswap rdip:+SWith True } + { +SConsLabel -> rswap rdip:+SConsLabel True } + { +SWithLabel -> rswap rdip:+SWithLabel True } + } ) rdrop +} + +||| Push stack onto branch, right to left. +def +C99Stack.push-stack! [ +C99Branch +C99Stack -- +C99Branch ] { + rswap +stack(rswap reverse-cat!) +} def(c99-arrow!, Arrow +C99Branch -- +C99Branch, atoms for(c99-atom!)) def(c99-atom!, Atom +C99Branch -- +C99Branch, - +core:options emit-debug-info and(dup show-in-stack-trace?) then( - +core:c99-line("WORD_ATOM(" put + +c99:options emit-debug-info and(dup show-in-stack-trace?) then( + +c99:c99-line("WORD_ATOM(" put dup token row >Int show put ", " put dup token col >Int show put ", " put dup token name? if-some(>Str, "") put-cstr @@ -862,104 +957,104 @@ def c99-atom-op! [ Atom Op +C99Branch -- +C99Branch ] { def(c99-get-data-tag!, Data +C99Branch -- +C99Branch, >data @data is-enum-or-unit? else( - @data TData type-to-c99-repr pop-to-local! >+local - @data +core:+mirth:semi-transparent? if-some( - C99RT_I64 push-expression!(tag value show put "LL" put), - C99RT_I64 push-expression!( + @data TData type-to-c99-repr pop-value! >+scrutinee + @data +mirth:semi-transparent? if-some( + C99RT_I64 push-value-expression!(tag value show put "LL" put), + C99RT_I64 push-value-expression!( "get_data_tag(" put - @+local:rdup consume-as-VAL put + @+scrutinee:rdup consume-as-VAL put ")" put ) ) - +local> drop-local! + +scrutinee> drop-value! ) data> drop) def(c99-word!, List(Arg) Word +C99Branch -- +C99Branch, dup prefer-inline? if( dip:c99-args-push! - +core:+mirth:arrow c99-arrow!, - +core:c99-api c99-smart-call! + +mirth:arrow c99-codip-arrow!, + +c99:c99-api c99-smart-call! )) field(Tag.~value-show, Tag, Str) def(Tag.value-show, Tag -- Str, dup ~value-show memoize(dup value show) nip) def c99-tag-call! [ List(Arg) Tag +C99Branch -- +C99Branch ] { - dup +core:+mirth:prefer-inline? if( + dup +mirth:prefer-inline? if( nip c99-tag-body!, - +core:word-c99-api c99-smart-call! + +c99:word-c99-api c99-smart-call! ) } def c99-reverse-tag! [ Tag +C99Branch -- +C99Branch ] { - dup +core:+mirth:prefer-inline? if( + dup +mirth:prefer-inline? if( c99-reverse-tag-body!, - dip:L0 +core:pat-c99-api c99-smart-call! + dip:L0 +c99:pat-c99-api c99-smart-call! ) } def(c99-label-defs!, +C99 -- +C99, Label.for(c99-label-def!)) def(c99-label-def!, Label +C99 -- +C99, "static VAL lbl_" put name mangled put " = MKNIL_C;" put line) -def push-local-label-direct! [ Label +C99 +C99Local -- +C99 ] { +def push-value-label-direct! [ Label +C99Branch +C99Value -- +C99Branch ] { consume-as-VAL swap c99-line("lpush(&lbl_" put name mangled put ", " put put ");" put) } -def push-local-label! [ Label +C99Branch +C99Local -- +C99Branch ] { - rswap +stack(rswap +SCConsLabel) +def push-value-label! [ Label +C99Branch +C99Value -- +C99Branch ] { + rswap +stack(rswap +SConsLabel) } -def push-local-resource-label-direct! [ Label +C99 +C99LocalResource -- +C99 ] { +def push-resource-label-direct! [ Label +C99Branch +C99Resource -- +C99Branch ] { consume-as-VAL swap c99-line("lpush(&lbl_" put name mangled put ", " put put ");" put) } -def push-local-resource-label! [ Label +C99Branch +C99LocalResource -- +C99Branch ] { - rswap +stack(rswap +SCWithLabel) +def push-resource-label! [ Label +C99Branch +C99Resource -- +C99Branch ] { + rswap +stack(rswap +SWithLabel) } -def pop-local-label-direct! [ C99ReprType Label +C99 -- +C99 +C99Local ] { - swap dup local-expression!( +def pop-value-label-direct! [ C99ReprType Label +C99Branch -- +C99Branch +C99Value ] { + swap dup value-expression!( match { { C99RT_VAL -> "lpop(&lbl_" put name mangled put ")" put } { _ -> v-macro put "(lpop(&lbl_" put name mangled put "))" put } } - ) rswap + ) } -def pop-local-resource-label-direct! [ C99ReprType Label +C99 -- +C99 +C99LocalResource ] { - swap dup local-resource-expression!( +def pop-resource-label-direct! [ C99ReprType Label +C99Branch -- +C99Branch +C99Resource ] { + swap dup resource-expression!( match { { C99RT_VAL -> "lpop(&lbl_" put name mangled put ")" put } { _ -> v-macro put "(lpop(&lbl_" put name mangled put "))" put } } - ) rswap + ) } def c99-label-push! [ Atom Label +C99Branch -- +C99Branch ] { - swap dom pop-local-from-stack-type! drop - push-local-label! + swap dom pop-value-from-stack-type! drop + push-value-label! } def c99-label-push-r! [ Atom Label +C99Branch -- +C99Branch ] { - swap dom pop-local-resource-from-stack-type! drop - push-local-resource-label! + swap dom pop-resource-from-stack-type! drop + push-resource-label! } def c99-label-pop! [ Atom Label +C99Branch -- +C99Branch ] { - swap dom pop-local-label-from-stack-type! drop - push-local! + swap dom pop-value-label-from-stack-type! drop + push-value! } def c99-label-pop-r! [ Atom Label +C99Branch -- +C99Branch ] { - swap dom pop-local-resource-label-from-stack-type! drop - push-local-resource! + swap dom pop-resource-label-from-stack-type! drop + push-resource! } def(c99-int!, Int +C99Branch -- +C99Branch, - C99RT_I64 push-expression!(show put "LL" put)) + C99RT_I64 push-value-expression!(show put "LL" put)) def(c99-f64!, F64 +C99Branch -- +C99Branch, - C99RT_F64 push-expression!(>Str put)) + C99RT_F64 push-value-expression!(>Str put)) def c99-str! [ Str +C99Branch -- +C99Branch ] { - C99RT_STR new-local! >+str + C99RT_STR new-value! >+str dup num-bytes 4090 .u >USize > if( c99-line("STRLIT(" put @+str:rdup consume put "," put) c99-nest( @@ -974,7 +1069,7 @@ def c99-str! [ Str +C99Branch -- +C99Branch ] { dup num-bytes show put ");" put) ) drop - +str> push-local! + +str> push-value! } def(+C99.put-cstr-long, Str +C99 -- +C99, @@ -1046,6 +1141,24 @@ def C99ReprType.is-float-like? [ C99ReprType -- Bool ] { { _ -> drop False } } +def C99ReprType.dummy-value [ C99ReprType -- Str ] { + { C99RT_VAL -> "(VAL){0}" } + { C99RT_STR -> "NULL" } + { C99RT_I64 -> "0" } + { C99RT_I32 -> "0" } + { C99RT_I16 -> "0" } + { C99RT_I8 -> "0" } + { C99RT_U64 -> "0" } + { C99RT_U32 -> "0" } + { C99RT_U16 -> "0" } + { C99RT_U8 -> "0" } + { C99RT_F64 -> "0.0" } + { C99RT_F32 -> "0.0" } + { C99RT_BOOL -> "0" } + { C99RT_PTR -> "NULL" } + { C99RT_FNPTR -> "NULL" } +} + def C99ReprType.underlying-c99-type [ C99ReprType -- Str ] { { C99RT_VAL -> "VAL" } { C99RT_STR -> "STR*" } @@ -1178,453 +1291,464 @@ def Data.c99-repr [ Data +Mirth -- C99ReprType +Mirth ] { ) } -struct +C99Local { - local-repr: C99ReprType - local-name: Str +struct +C99Value { + value-repr: C99ReprType + value-name: Str } -def +C99Local.rdup [ +C99Local -- +C99Local +C99Local ] { - local-repr >local-repr - local-name >local-name - +C99Local +def +C99Value.rdup [ +C99Value -- +C99Value +C99Value ] { + value-repr >value-repr + value-name >value-name + +C99Value } -def +C99Local.rdrop [ +C99Local -- ] { - /+C99Local - local-repr> drop - local-name> drop +def +C99Value.rdrop [ +C99Value -- ] { + /+C99Value + value-repr> drop + value-name> drop } -def C99ReprType.new-local! [ C99ReprType +C99Branch -- +C99Branch +C99Local ] { - >local-repr - +core:fresh-name! >local-name - c99-line(@local-repr underlying-c99-type put " " put - @local-name put ";" put) - +C99Local +def C99ReprType.new-value! [ C99ReprType +C99Branch -- +C99Branch +C99Value ] { + >value-repr + +c99:fresh-name! >value-name + c99-line(@value-repr underlying-c99-type put " " put + @value-name put ";" put) + +C99Value } -def C99ReprType.pop-to-local-direct! [ C99ReprType +C99 -- +C99 +C99Local ] { - >local-repr - fresh-name! >local-name - c99-line(@local-repr underlying-c99-type put " " put - @local-name put " = " put - @local-repr pop-macro put "();" put) - +C99Local +def C99ReprType.pop-value-direct! [ C99ReprType +C99Branch -- +C99Branch +C99Value ] { + >value-repr + +c99:fresh-name! >value-name + c99-line(@value-repr underlying-c99-type put " " put + @value-name put " = " put + @value-repr pop-macro put "();" put) + +C99Value } -def +C99.pop-local-direct! [ +C99 -- +C99 +C99Local ] { - C99RT_VAL pop-to-local-direct! +||| Push a value with a certain repr type on the stack. +||| `f` must emit the C99 expression that calculates the value, +||| which must be of the underlying C99 repr type. +def C99ReprType.push-value-expression!(f) [ + (*a +C99 -- *b +C99) *a C99ReprType +C99Branch -- *b +C99Branch +] { + value-expression!(f) push-value! } -inline ( - ||| Push a value with a certain repr type on the stack. - ||| `f` must emit the C99 expression that calculates the value, - ||| which must be of the underlying C99 repr type. - def C99ReprType.push-expression!(f) [ - (*a +C99 -- *b +C99) *a C99ReprType +C99Branch -- *b +C99Branch - ] { - +core:local-expression!(f) rswap push-local! - } - - def push-resource-expression!(f) [ - (*a +C99 -- *b +C99) *a C99ReprType +C99Branch -- *b +C99Branch - ] { - +core:local-resource-expression!(f) rswap push-local-resource! - } +def C99ReprType.push-resource-expression!(f) [ + (*a +C99 -- *b +C99) *a C99ReprType +C99Branch -- *b +C99Branch +] { + resource-expression!(f) push-resource! +} - def push-label-expression!(f) [ - (*a +C99 -- *b +C99) *a C99ReprType Label +C99Branch -- *b +C99Branch - ] { - dip:+core:local-expression!(f) rswap - dup is-resource-label? if( - turn-into-resource! push-local-resource-label!, - push-local-label! - ) - } +def push-label-expression!(f) [ + (*a +C99 -- *b +C99) *a C99ReprType Label +C99Branch -- *b +C99Branch +] { + dip:value-expression!(f) + dup is-resource-label? if( + turn-into-resource! push-resource-label!, + push-value-label! + ) +} - def C99ReprType.local-expression!(f) [ - (*a +C99 -- *b +C99) *a C99ReprType +C99 -- *b +C99Local +C99 - ] { - >local-repr - fresh-name! >local-name - rdip:+C99Local - c99-line(rdip:local-repr underlying-c99-type put " " put - rdip:local-name put " = " put - rswap rdip:f rswap ";" put) - } +def C99ReprType.value-expression!(f) [ + (*a +C99 -- *b +C99) *a C99ReprType +C99Branch -- *b +C99Branch +C99Value +] { + >value-repr + +c99:fresh-name! >value-name + c99-line( + @value-repr underlying-c99-type put " " put + @value-name put " = " put + +C99Value rdip:f rswap ";" put + ) rswap +} - def local-resource-expression!(f) [ - (*a +C99 -- *b +C99) *a C99ReprType +C99 -- *b +C99LocalResource +C99 - ] { - >local-resource-repr - fresh-name! >local-resource-name rdip:+C99LocalResource - c99-line(rdip:local-resource-repr underlying-c99-type put " " put - rdip:local-resource-name put " = (" put - rswap rdip:f rswap ");" put) - } -) +def C99ReprType.resource-expression!(f) [ + (*a +C99 -- *b +C99) *a C99ReprType +C99Branch -- *b +C99Branch +C99Resource +] { + >resource-repr + +c99:fresh-name! >resource-name + c99-line( + @resource-repr underlying-c99-type put " " put + @resource-name put " = " put + +C99Resource rdip:f rswap ";" put + ) rswap +} -def +C99Local.push-local-direct! [ +C99 +C99Local -- +C99 ] { - /+C99Local c99-line( - local-repr> push-macro put "(" put - local-name> put ");" put +def +C99Value.push-value-direct! [ +C99Branch +C99Value -- +C99Branch ] { + /+C99Value c99-line( + value-repr> push-macro put "(" put + value-name> put ");" put ) } -def +C99Local.consume [ +C99Local -- Str ] { - /+C99Local local-repr> drop local-name> +def +C99Value.consume [ +C99Value -- Str ] { + /+C99Value value-repr> drop value-name> } -def +C99Local.consume-as-VAL [ +C99Local -- Str ] { - /+C99Local local-repr> match { - C99RT_VAL -> local-name>, - _ -> Str(mk-macro ; "(" ; local-name> ; ")";) +def +C99Value.consume-as-VAL [ +C99Value -- Str ] { + /+C99Value value-repr> match { + C99RT_VAL -> value-name>, + _ -> Str(mk-macro ; "(" ; value-name> ; ")";) } } -def +C99Local.consume-as [ C99ReprType +C99Local -- Str ] { +def +C99Value.consume-as [ C99ReprType +C99Value -- Str ] { { C99RT_VAL -> consume-as-VAL } { _ -> - /+C99Local - @local-repr match { - { C99RT_VAL -> Str( v-macro ; "(" ; local-name> ; ")" ; ) } + /+C99Value + @value-repr match { + { C99RT_VAL -> Str( v-macro ; "(" ; value-name> ; ")" ; ) } { _ -> over == if( - drop local-name>, - dup is-int-like? @local-repr is-int-like? && if( - Str( "((" ; underlying-c99-type ; ")" ; local-name> ; ")" ; ), - Str( "(\n#error \"attempted to cast " ; local-name> ; " to incompatible C99 repr type " ; + drop value-name>, + dup is-int-like? @value-repr is-int-like? && if( + Str( "((" ; underlying-c99-type ; ")" ; value-name> ; ")" ; ), + Str( "(\n#error \"attempted to cast " ; value-name> ; " to incompatible C99 repr type " ; underlying-c99-type ; "\"\n" ; ) ) ) } } - local-repr> drop + value-repr> drop } } -def +C99Local.drop-local! [ +C99Branch +C99Local -- +C99Branch ] { - local-repr needs-refcounting? if( - consume-as-VAL +core:c99-line("decref(" put put ");" put), +def +C99Value.drop-value! [ +C99Branch +C99Value -- +C99Branch ] { + value-repr needs-refcounting? if( + consume-as-VAL +c99:c99-line("decref(" put put ");" put), rdrop ) } -def +C99Local.dup-local! [ +C99Branch +C99Local -- +C99Branch +C99Local +C99Local ] { - local-repr needs-refcounting? then( - rdup consume-as-VAL rdip:+core:c99-line("incref(" put put ");" put) +def +C99Value.dup-value! [ +C99Branch +C99Value -- +C99Branch +C99Value +C99Value ] { + value-repr needs-refcounting? then( + rdup consume-as-VAL rdip:+c99:c99-line("incref(" put put ");" put) ) rdup } -def +C99Local.peek-data-tag [ +C99Local -- +C99Local Str ] { - local-repr match { - { C99RT_VAL -> local-name Str("get_data_tag(" ; ; ")" ;) } - { _ -> drop local-name } +def +C99Value.peek-data-tag [ +C99Value -- +C99Value Str ] { + value-repr match { + { C99RT_VAL -> value-name Str("get_data_tag(" ; ; ")" ;) } + { _ -> drop value-name } } } -struct +C99LocalResource { - local-resource-repr: C99ReprType - local-resource-name: Str +struct +C99Resource { + resource-repr: C99ReprType + resource-name: Str } -def +C99LocalResource.rdup [ +C99LocalResource -- +C99LocalResource +C99LocalResource ] { - local-resource-repr >local-resource-repr - local-resource-name >local-resource-name - +C99LocalResource +def +C99Resource.rdup [ +C99Resource -- +C99Resource +C99Resource ] { + resource-repr >resource-repr + resource-name >resource-name + +C99Resource } -def +C99LocalResource.rdrop [ +C99LocalResource -- ] { +def +C99Resource.rdrop [ +C99Resource -- ] { consume drop } -def +C99Local.turn-into-resource! [ +C99Local -- +C99LocalResource ] { - /+C99Local - local-repr> >local-resource-repr - local-name> >local-resource-name - +C99LocalResource +def +C99Value.turn-into-resource! [ +C99Value -- +C99Resource ] { + /+C99Value + value-repr> >resource-repr + value-name> >resource-name + +C99Resource } -def +C99LocalResource.turn-into-value! [ +C99LocalResource -- +C99Local ] { - /+C99LocalResource - local-resource-repr> >local-repr - local-resource-name> >local-name - +C99Local +def +C99Resource.turn-into-value! [ +C99Resource -- +C99Value ] { + /+C99Resource + resource-repr> >value-repr + resource-name> >value-name + +C99Value } -def +C99LocalResource.drop-local-resource-as-value! [ +C99Branch +C99LocalResource -- +C99Branch ] { - turn-into-value! drop-local! +def +C99Resource.drop-resource-as-value! [ +C99Branch +C99Resource -- +C99Branch ] { + turn-into-value! drop-value! } -def +C99LocalResource.dup-local-resource-as-value! [ +C99Branch +C99LocalResource -- +C99Branch +C99LocalResource +C99Local ] { - rdup turn-into-value! rswap rdip(dup-local! rdrop) rswap +def +C99Resource.dup-resource-as-value! [ +C99Branch +C99Resource -- +C99Branch +C99Resource +C99Value ] { + rdup turn-into-value! rswap rdip(dup-value! rdrop) rswap } -def +C99LocalResource.consume [ +C99LocalResource -- Str ] { - /+C99LocalResource - local-resource-repr> drop - local-resource-name> +def +C99Resource.consume [ +C99Resource -- Str ] { + /+C99Resource + resource-repr> drop + resource-name> } -def +C99LocalResource.consume-as-VAL [ +C99LocalResource -- Str ] { - /+C99LocalResource local-resource-repr> match { - C99RT_VAL -> local-resource-name>, - _ -> Str(mk-macro ; "(" ; local-resource-name> ; ")";) +def +C99Resource.consume-as-VAL [ +C99Resource -- Str ] { + /+C99Resource resource-repr> match { + C99RT_VAL -> resource-name>, + _ -> Str(mk-macro ; "(" ; resource-name> ; ")";) } } -def +C99.pop-local-resource-direct! [ +C99 C99ReprType -- +C99 +C99LocalResource ] { - >local-resource-repr - fresh-resource-name! >local-resource-name +def +C99Branch.pop-resource-direct! [ +C99Branch C99ReprType -- +C99Branch +C99Resource ] { + >resource-repr + +c99:fresh-resource-name! >resource-name c99-line( - @local-resource-repr underlying-c99-type put " " put - @local-resource-name put " = " put - @local-resource-repr match { + @resource-repr underlying-c99-type put " " put + @resource-name put " = " put + @resource-repr match { { C99RT_VAL -> "pop_resource()" put } { _ -> v-macro put "(pop_resource())" put } } ";" put ) - +C99LocalResource + +C99Resource } -def +C99LocalResource.push-local-resource-direct! [ +C99 +C99LocalResource -- +C99 ] { - /+C99LocalResource +def +C99Resource.push-resource-direct! [ +C99Branch +C99Resource -- +C99Branch ] { + /+C99Resource c99-line( "push_resource(" put - local-resource-repr> match { - { C99RT_VAL -> local-resource-name> put } - { _ -> mk-macro put "(" put local-resource-name> put ")" put } + resource-repr> match { + { C99RT_VAL -> resource-name> put } + { _ -> mk-macro put "(" put resource-name> put ")" put } } ");" put ) } -def +C99LocalResource.peek-data-tag [ +C99LocalResource -- +C99LocalResource Str ] { - local-resource-repr match { - { C99RT_VAL -> local-resource-name Str("get_data_tag(" ; ; ")" ;) } - { _ -> drop local-resource-name } +def +C99Resource.peek-data-tag [ +C99Resource -- +C99Resource Str ] { + resource-repr match { + { C99RT_VAL -> resource-name Str("get_data_tag(" ; ; ")" ;) } + { _ -> drop resource-name } } } -data +C99LocalValue/Resource { - +Left [ +C99Local ] - +Right [ +C99LocalResource ] +data +C99Value/Resource { + +Left [ +C99Value ] + +Right [ +C99Resource ] } -def +C99Local.>Value/Resource { +C99LocalValue/Resource.+Left } -def +C99LocalResource.>Value/Resource { +C99LocalValue/Resource.+Right } -def +C99LocalValue/Resource.push-local-value/resource! { - { +Left -> push-local! } - { +Right -> push-local-resource! } +def +C99Value.>Value/Resource { +C99Value/Resource.+Left } +def +C99Resource.>Value/Resource { +C99Value/Resource.+Right } +def +C99Value/Resource.push-value-value/resource! { + { +Left -> push-value! } + { +Right -> push-resource! } } -def +C99LocalValue/Resource.peek-data-tag [ +C99LocalValue/Resource -- +C99LocalValue/Resource Str ] { +def +C99Value/Resource.peek-data-tag [ +C99Value/Resource -- +C99Value/Resource Str ] { { +Left -> peek-data-tag +Left } { +Right -> peek-data-tag +Right } } -def +C99LocalValue/Resource.rdup [ +C99LocalValue/Resource -- +C99LocalValue/Resource +C99LocalValue/Resource ] { +def +C99Value/Resource.rdup [ +C99Value/Resource -- +C99Value/Resource +C99Value/Resource ] { { +Left -> rdup +Left rdip(+Left) } { +Right -> rdup +Right rdip(+Right) } } -def +C99LocalValue/Resource.rdrop [ +C99LocalValue/Resource -- ] { +def +C99Value/Resource.rdrop [ +C99Value/Resource -- ] { { +Left -> rdrop } { +Right -> rdrop } } -def +C99LocalValue/Resource.consume-as-VAL [ +C99LocalValue/Resource -- Str ] { +def +C99Value/Resource.consume-as-VAL [ +C99Value/Resource -- Str ] { { +Left -> consume-as-VAL } { +Right -> consume-as-VAL } } -def +C99Branch.pop-local-value/resource-data! [ Data +C99Branch -- +C99Branch +C99LocalValue/Resource ] { +def +C99Branch.pop-value-value/resource-data! [ Data +C99Branch -- +C99Branch +C99Value/Resource ] { dup is-resource? if( - +core:+mirth:c99-repr pop-to-local-resource! +C99LocalValue/Resource.+Right, - +core:+mirth:c99-repr pop-to-local! +C99LocalValue/Resource.+Left + +mirth:c99-repr pop-resource! +C99Value/Resource.+Right, + +mirth:c99-repr pop-value! +C99Value/Resource.+Left ) } -data +C99Local? { - +C99LocalNone - +C99LocalSome [ +C99Local ] +data +C99Value? { + +C99ValueNone + +C99ValueSome [ +C99Value ] } -data +C99LocalResource? { - +C99LocalResourceNone - +C99LocalResourceSome [ +C99LocalResource ] +data +C99Resource? { + +C99ResourceNone + +C99ResourceSome [ +C99Resource ] } def +C99Branch.refresh-branch! [ +C99Branch -- +C99Branch ] { /+C99Branch - +core> +stack> + +c99> +stack> refresh-all! } -def +C99StackCache.refresh-all! [ +C99 +C99StackCache -- +C99Branch ] { - { +SCNil -> start-branch! } - { +SCCons -> +def +C99Stack.refresh-all! [ +C99 +C99Stack reachable:Bool -- +C99Branch ] { + { +SNil -> start-branch! } + { +SCons -> >+x refresh-all! - @+x:local-repr push-expression!(+x> consume put) + @+x:value-repr push-value-expression!(+x> consume put) } - { +SCWith -> + { +SWith -> >+x refresh-all! - @+x:local-resource-repr push-resource-expression!(+x> consume put) + @+x:resource-repr push-resource-expression!(+x> consume put) } - { +SCConsLabel -> + { +SConsLabel -> >+x refresh-all! - @+x:local-repr swap push-label-expression!(+x> consume put) + @+x:value-repr swap push-label-expression!(+x> consume put) } - { +SCWithLabel -> + { +SWithLabel -> >+x refresh-all! - @+x:local-resource-repr swap push-label-expression!(+x> consume put) + @+x:resource-repr swap push-label-expression!(+x> consume put) } } -def +C99StackCache.tie-knot! [ +C99Branch +C99StackCache -- +C99Branch ] { - { +SCNil -> flush-cache! } - { +SCCons -> - local-repr dup rdip2(pop-to-local! consume-as) - local-name rdip2:c99-line(put " = " put put ";" put) +def +C99Stack.tie-knot! [ +C99Branch +C99Stack -- +C99Branch ] { + { +SNil -> flush-cache! } + { +SCons -> + value-repr dup rdip2(pop-value! consume-as) + value-name rdip2:c99-line(put " = " put put ";" put) rdip:tie-knot! - push-local! + push-value! } - { +SCWith -> - local-resource-repr dup rdip2(pop-to-local-resource! turn-into-value! consume-as) - local-resource-name rdip2:c99-line(put " = " put put ";" put) + { +SWith -> + resource-repr dup rdip2(pop-resource! turn-into-value! consume-as) + resource-name rdip2:c99-line(put " = " put put ";" put) rdip:tie-knot! - push-local-resource! + push-resource! } - { +SCConsLabel -> >label - local-repr dup rdip2(@label pop-to-local-label! consume-as) - local-name rdip2:c99-line(put " = " put put ";" put) + { +SConsLabel -> >label + value-repr dup rdip2(@label pop-value-label! consume-as) + value-name rdip2:c99-line(put " = " put put ";" put) rdip:tie-knot! - label> push-local-label! + label> push-value-label! } - { +SCWithLabel -> >label - local-resource-repr dup rdip2(@label pop-to-local-resource-label! turn-into-value! consume-as) - local-resource-name rdip2:c99-line(put " = " put put ";" put) + { +SWithLabel -> >label + resource-repr dup rdip2(@label pop-resource-label! turn-into-value! consume-as) + resource-name rdip2:c99-line(put " = " put put ";" put) rdip:tie-knot! - label> push-local-resource-label! + label> push-resource-label! } } -data +C99StackCache { - +SCNil - +SCCons [ +C99StackCache +C99Local ] - +SCWith [ +C99StackCache +C99LocalResource ] - +SCConsLabel [ +C99StackCache +C99Local Label ] - +SCWithLabel [ +C99StackCache +C99LocalResource Label ] +data +C99Stack { + +SNil + +SCons [ +C99Stack +C99Value ] + +SWith [ +C99Stack +C99Resource ] + +SConsLabel [ +C99Stack +C99Value Label ] + +SWithLabel [ +C99Stack +C99Resource Label ] } -def +C99StackCache.pop-local? [ +C99StackCache -- +C99Local? +C99StackCache ] { - { +SCNil -> +C99LocalNone +SCNil } - { +SCCons -> +C99LocalSome rswap } - { +SCWith -> rdip:pop-local? +SCWith } - { +SCConsLabel -> rdip:pop-local? +SCConsLabel } - { +SCWithLabel -> rdip:pop-local? +SCWithLabel } +def +C99Stack.pop-value? [ +C99Stack -- +C99Value? +C99Stack ] { + { +SNil -> +C99ValueNone +SNil } + { +SCons -> +C99ValueSome rswap } + { +SWith -> rdip:pop-value? +SWith } + { +SConsLabel -> rdip:pop-value? +SConsLabel } + { +SWithLabel -> rdip:pop-value? +SWithLabel } } -def +C99StackCache.pop-local-resource? [ +C99StackCache -- +C99LocalResource? +C99StackCache ] { - { +SCNil -> +C99LocalResourceNone +SCNil } - { +SCWith -> +C99LocalResourceSome rswap } - { +SCCons -> rdip:pop-local-resource? +SCCons } - { +SCConsLabel -> rdip:pop-local-resource? +SCConsLabel } - { +SCWithLabel -> rdip:pop-local-resource? +SCWithLabel } +def +C99Stack.pop-resource? [ +C99Stack -- +C99Resource? +C99Stack ] { + { +SNil -> +C99ResourceNone +SNil } + { +SWith -> +C99ResourceSome rswap } + { +SCons -> rdip:pop-resource? +SCons } + { +SConsLabel -> rdip:pop-resource? +SConsLabel } + { +SWithLabel -> rdip:pop-resource? +SWithLabel } } -def +C99StackCache.pop-local-label? [ Label +C99StackCache -- Label +C99Local? +C99StackCache ] { - { +SCNil -> +C99LocalNone +SCNil } - { +SCCons -> rdip:pop-local-label? +SCCons } - { +SCWith -> rdip:pop-local-label? +SCWith } - { +SCWithLabel -> dip:rdip:pop-local-label? +SCWithLabel } - { +SCConsLabel -> +def +C99Stack.pop-value-label? [ Label +C99Stack -- Label +C99Value? +C99Stack ] { + { +SNil -> +C99ValueNone +SNil } + { +SCons -> rdip:pop-value-label? +SCons } + { +SWith -> rdip:pop-value-label? +SWith } + { +SWithLabel -> dip:rdip:pop-value-label? +SWithLabel } + { +SConsLabel -> dup2 == if( - drop +C99LocalSome rswap, - dip:rdip:pop-local-label? +SCConsLabel + drop +C99ValueSome rswap, + dip:rdip:pop-value-label? +SConsLabel ) } } -def +C99StackCache.pop-local-resource-label? [ Label +C99StackCache -- Label +C99LocalResource? +C99StackCache ] { - { +SCNil -> +C99LocalResourceNone +SCNil } - { +SCCons -> rdip:pop-local-resource-label? +SCCons } - { +SCWith -> rdip:pop-local-resource-label? +SCWith } - { +SCConsLabel -> dip:rdip:pop-local-resource-label? +SCConsLabel } - { +SCWithLabel -> +def +C99Stack.pop-resource-label? [ Label +C99Stack -- Label +C99Resource? +C99Stack ] { + { +SNil -> +C99ResourceNone +SNil } + { +SCons -> rdip:pop-resource-label? +SCons } + { +SWith -> rdip:pop-resource-label? +SWith } + { +SConsLabel -> dip:rdip:pop-resource-label? +SConsLabel } + { +SWithLabel -> dup2 == if( - drop +C99LocalResourceSome rswap, - dip:rdip:pop-local-resource-label? +SCWithLabel + drop +C99ResourceSome rswap, + dip:rdip:pop-resource-label? +SWithLabel ) } } -def +C99StackCache.flush-all! [ +C99 +C99StackCache -- +C99 ] { - { +SCNil -> } - { +SCCons -> rdip:flush-all! push-local-direct! } - { +SCWith -> rdip:flush-all! push-local-resource-direct! } - { +SCConsLabel -> rdip:flush-all! push-local-label-direct! } - { +SCWithLabel -> rdip:flush-all! push-local-resource-label-direct! } +def +C99Stack.push-stack-direct! [ +C99Branch +C99Stack -- +C99Branch ] { + { +SNil -> } + { +SCons -> rdip:push-stack-direct! push-value-direct! } + { +SWith -> rdip:push-stack-direct! push-resource-direct! } + { +SConsLabel -> rdip:push-stack-direct! push-value-label-direct! } + { +SWithLabel -> rdip:push-stack-direct! push-resource-label-direct! } } -def +C99StackCache.rdup [ +C99StackCache -- +C99StackCache +C99StackCache ] { - { +SCNil -> +SCNil +SCNil } - { +SCCons -> rdip:rdup rdup rdip:rswap +SCCons rdip:+SCCons } - { +SCWith -> rdip:rdup rdup rdip:rswap +SCWith rdip:+SCWith } - { +SCConsLabel -> dup rdip:rdup rdup rdip:rswap +SCConsLabel rdip:+SCConsLabel } - { +SCWithLabel -> dup rdip:rdup rdup rdip:rswap +SCWithLabel rdip:+SCWithLabel } +def +C99Stack.rdup [ +C99Stack -- +C99Stack +C99Stack ] { + { +SNil -> +SNil +SNil } + { +SCons -> rdip:rdup rdup rdip:rswap +SCons rdip:+SCons } + { +SWith -> rdip:rdup rdup rdip:rswap +SWith rdip:+SWith } + { +SConsLabel -> dup rdip:rdup rdup rdip:rswap +SConsLabel rdip:+SConsLabel } + { +SWithLabel -> dup rdip:rdup rdup rdip:rswap +SWithLabel rdip:+SWithLabel } } -def +C99StackCache.rdrop [ +C99StackCache -- ] { - { +SCNil -> } - { +SCCons -> rdrop rdrop } - { +SCWith -> rdrop rdrop } - { +SCConsLabel -> drop rdrop rdrop } - { +SCWithLabel -> drop rdrop rdrop } +def +C99Stack.rdrop [ +C99Stack -- ] { + { +SNil -> } + { +SCons -> rdrop rdrop } + { +SWith -> rdrop rdrop } + { +SConsLabel -> drop rdrop rdrop } + { +SWithLabel -> drop rdrop rdrop } } struct +C99BranchSplit { - +core: +C99 - +stack: +C99StackCache + +c99: +C99 + +stack: +C99Stack branch-split-target: List(C99APIArg) - branch-split-must-flush?: Bool + reachable-in: Bool + reachable-out: Bool } +def +C99BranchSplit.+mirth(f) { +c99:+mirth(f) } + def +C99Branch.begin-branch-split! [ StackType +C99Branch -- +C99BranchSplit ] { - +core:stack-type-to-c99-api-params >branch-split-target >branch-split-must-flush? + +c99:stack-type-to-c99-api-params >branch-split-target + must-flush> drop @branch-split-target for(reserve-as-is!) - /+C99Branch +C99BranchSplit + /+C99Branch + reachable> >reachable-in + False >reachable-out + +C99BranchSplit } def +C99BranchSplit.end-branch-split! [ +C99BranchSplit -- +C99Branch ] { /+C99BranchSplit +stack> rdrop - +core> start-branch! - branch-split-target> for(push-as-local!) - branch-split-must-flush?> drop -} -inline ( - def +C99BranchSplit.sub-branch(f) [ (*a +C99Branch -- *b +C99Branch) *a +C99BranchSplit -- *b +C99BranchSplit ] { - +stack(rdup >+stack) branch-split-target - +core( - >+core +C99Branch dip:f - reverse-for(pop-to-reserved!) - end-branch! - ) - } + reachable-in> drop + reachable-out> >reachable + +c99> start-branch! + branch-split-target> for(push-api-arg!) +} + +def +C99BranchSplit.sub-branch(f) [ (*a +C99Branch -- *b +C99Branch) *a +C99BranchSplit -- *b +C99BranchSplit ] { + +stack(rdup >+stack) branch-split-target + reachable-in >reachable + +c99( + >+c99 +C99Branch dip:f + reverse-for(pop-to-reserved!) + end-branch! + ) + reachable> reachable-out:|| +} - def +C99BranchSplit.c99-line(f) { +core:c99-line(f) } - def +C99BranchSplit.c99-nest(f) { +core:depth:1+ f +C99BranchSplit.+core:depth:pred } -) +def +C99BranchSplit.c99-line(f) { reachable-in +c99:c99-line-if(f) } +def +C99BranchSplit.c99-nest(f) { +c99:depth:1+ f +C99BranchSplit.+c99:depth:pred } +||| This resource represents a single active branch. struct +C99Branch { - +core: +C99 - +stack: +C99StackCache + +c99: +C99 + +stack: +C99Stack + reachable: Bool } -def +C99.start-branch! [ +C99 -- +C99Branch ] { - >+core +SCNil >+stack +C99Branch +def +C99Branch.+mirth(f) { +c99:+mirth(f) } + +def +C99.start-branch! [ +C99 reachable:Bool -- +C99Branch ] { + >+c99 +SNil >+stack +C99Branch } -def +C99Branch.end-branch! [ +C99Branch -- +C99 ] { - /+C99Branch +core> +stack> flush-all! +def +C99Branch.end-branch! [ +C99Branch -- +C99 reachable:Bool ] { + +stack(+SNil) rswap push-stack-direct! + /+C99Branch +c99> +stack> rdrop } def +C99Branch.flush-cache! [ +C99Branch -- +C99Branch ] { @@ -1632,107 +1756,107 @@ def +C99Branch.flush-cache! [ +C99Branch -- +C99Branch ] { start-branch! } -def +C99Branch.pop-to-local! [ +C99Branch C99ReprType -- +C99Branch +C99Local ] { - +stack(pop-local?) rswap match { - { +C99LocalSome -> drop } - { +C99LocalNone -> +core(pop-to-local-direct! rswap) rswap } +def +C99Branch.pop-value! [ +C99Branch C99ReprType -- +C99Branch +C99Value ] { + +stack(pop-value?) rswap match { + { +C99ValueSome -> drop } + { +C99ValueNone -> pop-value-direct! } } } -def +C99Branch.pop-to-local-label! [ C99ReprType Label +C99Branch -- +C99Branch +C99Local ] { - +stack(pop-local-label?) rswap match { - { +C99LocalSome -> drop2 } - { +C99LocalNone -> +core(pop-local-label-direct! rswap) rswap } +def +C99Branch.pop-value-label! [ C99ReprType Label +C99Branch -- +C99Branch +C99Value ] { + +stack(pop-value-label?) rswap match { + { +C99ValueSome -> drop2 } + { +C99ValueNone -> pop-value-label-direct! } } } -def +C99Branch.pop-to-local-resource! [ +C99Branch C99ReprType -- +C99Branch +C99LocalResource ] { - +stack(pop-local-resource?) rswap match { - { +C99LocalResourceSome -> drop } - { +C99LocalResourceNone -> +core(pop-local-resource-direct! rswap) rswap } +def +C99Branch.pop-resource! [ +C99Branch C99ReprType -- +C99Branch +C99Resource ] { + +stack(pop-resource?) rswap match { + { +C99ResourceSome -> drop } + { +C99ResourceNone -> pop-resource-direct! } } } -def +C99Branch.pop-to-local-resource-label! [ C99ReprType Label +C99Branch -- +C99Branch +C99LocalResource ] { - +stack(pop-local-resource-label?) rswap match { - { +C99LocalResourceSome -> drop2 } - { +C99LocalResourceNone -> +core(pop-local-resource-label-direct! rswap) rswap } +def +C99Branch.pop-resource-label! [ C99ReprType Label +C99Branch -- +C99Branch +C99Resource ] { + +stack(pop-resource-label?) rswap match { + { +C99ResourceSome -> drop2 } + { +C99ResourceNone -> pop-resource-label-direct! } } } -def +C99Local.push-local! [ +C99Branch +C99Local -- +C99Branch ] { - rswap +stack(rswap +SCCons) +def +C99Value.push-value! [ +C99Branch +C99Value -- +C99Branch ] { + rswap +stack(rswap +SCons) } -def +C99LocalResource.push-local-resource! [ +C99Branch +C99LocalResource -- +C99Branch ] { - rswap +stack(rswap +SCWith) +def +C99Resource.push-resource! [ +C99Branch +C99Resource -- +C99Branch ] { + rswap +stack(rswap +SWith) } -def +C99Branch.type-to-c99-repr [ Type +C99Branch -- C99ReprType +C99Branch ] { +core:+mirth:c99-repr } -def +C99Branch.resource-to-c99-repr [ Resource +C99Branch -- C99ReprType +C99Branch ] { +core:+mirth:c99-repr } +def +C99Branch.type-to-c99-repr [ Type +C99Branch -- C99ReprType +C99Branch ] { +mirth:c99-repr } +def +C99Branch.resource-to-c99-repr [ Resource +C99Branch -- C99ReprType +C99Branch ] { +mirth:c99-repr } -def +C99Branch.pop-local-from-stack-type! [ StackType +C99Branch -- StackType +C99Branch +C99Local ] { - force-cons?! unwrap("c99 error: tried to pop from invalid stack type" +core:+mirth:fatal-error!) unpack2 - type-to-c99-repr pop-to-local! +def +C99Branch.pop-value-from-stack-type! [ StackType +C99Branch -- StackType +C99Branch +C99Value ] { + force-cons?! unwrap("c99 error: tried to pop from invalid stack type" +mirth:fatal-error!) unpack2 + type-to-c99-repr pop-value! } -def +C99Branch.pop-local-resource-from-stack-type! [ StackType +C99Branch -- StackType +C99Branch +C99LocalResource ] { - force-with?! unwrap("c99 error: tried to pop from invalid stack type" +core:+mirth:fatal-error!) unpack2 - resource-to-c99-repr pop-to-local-resource! +def +C99Branch.pop-resource-from-stack-type! [ StackType +C99Branch -- StackType +C99Branch +C99Resource ] { + force-with?! unwrap("c99 error: tried to pop from invalid stack type" +mirth:fatal-error!) unpack2 + resource-to-c99-repr pop-resource! } -def +C99Branch.pop-local-label-from-stack-type! [ Label StackType +C99Branch -- StackType +C99Branch +C99Local ] { - dip:dup force-cons-label?! unwrap("c99 error: tried to pop from invalid stack type" +core:+mirth:fatal-error!) unpack2 type-to-c99-repr - rotl pop-to-local-label! +def +C99Branch.pop-value-label-from-stack-type! [ Label StackType +C99Branch -- StackType +C99Branch +C99Value ] { + dip:dup force-cons-label?! unwrap("c99 error: tried to pop from invalid stack type" +mirth:fatal-error!) unpack2 type-to-c99-repr + rotl pop-value-label! } -def +C99Branch.pop-local-resource-label-from-stack-type! [ Label StackType +C99Branch -- StackType +C99Branch +C99LocalResource ] { - dip:dup force-with-label?! unwrap("c99 error: tried to pop from invalid stack type" +core:+mirth:fatal-error!) unpack2 resource-to-c99-repr - rotl pop-to-local-resource-label! +def +C99Branch.pop-resource-label-from-stack-type! [ Label StackType +C99Branch -- StackType +C99Branch +C99Resource ] { + dip:dup force-with-label?! unwrap("c99 error: tried to pop from invalid stack type" +mirth:fatal-error!) unpack2 resource-to-c99-repr + rotl pop-resource-label! } def c99-prim! [ Atom Prim +C99Branch -- +C99Branch ] { { PRIM_CORE_ID -> drop } { PRIM_CORE_DROP -> - dom pop-local-from-stack-type! drop - drop-local! + dom pop-value-from-stack-type! drop + drop-value! } { PRIM_CORE_DUP -> - dom pop-local-from-stack-type! drop - dup-local! rdip:push-local! push-local! + dom pop-value-from-stack-type! drop + dup-value! rdip:push-value! push-value! } { PRIM_CORE_SWAP -> dom - pop-local-from-stack-type! >+b - pop-local-from-stack-type! >+a + pop-value-from-stack-type! >+b + pop-value-from-stack-type! >+a drop - +b> push-local! - +a> push-local! + +b> push-value! + +a> push-value! } { PRIM_CORE_RSWAP -> dom - pop-local-resource-from-stack-type! >+b - pop-local-resource-from-stack-type! >+a + pop-resource-from-stack-type! >+b + pop-resource-from-stack-type! >+a drop - +b> push-local-resource! - +a> push-local-resource! + +b> push-resource! + +a> push-resource! } { PRIM_CORE_DIP -> - dup args /L1 unwrap(token "unexpected number of arguments to PRIM_CORE_DIP" +core:+mirth:emit-fatal-error!) - swap dom pop-local-from-stack-type! drop >+dipped + dup args /L1 unwrap(token "unexpected number of arguments to PRIM_CORE_DIP" +mirth:emit-fatal-error!) + swap dom pop-value-from-stack-type! drop >+dipped c99-arg-run! - +dipped> push-local! + +dipped> push-value! } { PRIM_CORE_RDIP -> - dup args /L1 unwrap(token "unexpected number of arguments to PRIM_CORE_RDIP" +core:+mirth:emit-fatal-error!) - swap dom pop-local-resource-from-stack-type! drop >+dipped + dup args /L1 unwrap(token "unexpected number of arguments to PRIM_CORE_RDIP" +mirth:emit-fatal-error!) + swap dom pop-resource-from-stack-type! drop >+dipped c99-arg-run! - +dipped> push-local-resource! + +dipped> push-resource! } { PRIM_CORE_IF -> - dup args /L2 unwrap(token "unexpected number of arguments to PRIM_CORE_IF" +core:+mirth:emit-fatal-error!) - unpack2 C99RT_BOOL pop-to-local! >+cond + dup args /L2 unwrap(token "unexpected number of arguments to PRIM_CORE_IF" +mirth:emit-fatal-error!) + unpack2 C99RT_BOOL pop-value! >+cond - rotl +core:+mirth:cod + rotl +mirth:cod begin-branch-split! c99-line("if (" put +cond> C99RT_BOOL consume-as put ") {" put) c99-nest:sub-branch(swap c99-arg-run!) @@ -1742,11 +1866,11 @@ def c99-prim! [ Atom Prim +C99Branch -- +C99Branch ] { end-branch-split! } { PRIM_CORE_WHILE -> - dup args /L2 unwrap(token "unexpected number of arguments to PRIM_CORE_WHILE" +core:+mirth:emit-fatal-error!) + dup args /L2 unwrap(token "unexpected number of arguments to PRIM_CORE_WHILE" +mirth:emit-fatal-error!) nip unpack2 over c99-arg-run! - C99RT_BOOL pop-to-local! push-local! + C99RT_BOOL pop-value! push-value! refresh-branch! +stack(rdup >+knot) - C99RT_BOOL dup pop-to-local! consume-as + C99RT_BOOL dup pop-value! consume-as c99-line("while (" put put ") {" put) c99-nest( refresh-branch! @@ -1755,17 +1879,19 @@ def c99-prim! [ Atom Prim +C99Branch -- +C99Branch ] { +knot> tie-knot! ) c99-line("}" put) - C99RT_BOOL pop-to-local! rdrop + C99RT_BOOL pop-value! rdrop } { PRIM_CORE_DEBUG -> drop flush-cache! c99-line("trace_stack();" put) } { PRIM_CORE_PANIC -> drop - C99RT_STR dup pop-to-local! consume-as - flush-cache! c99-line("do_panic(" put put ");" put) + C99RT_STR dup pop-value! consume-as + c99-line("do_panic(" put put ");" put) + +stack(rdrop +SNil) + False reachable! } { PRIM_CORE_RUN -> - dup args empty? else(token "expected no arguments to prim-core-run" +core:+mirth:emit-fatal-error!) drop - C99RT_VAL pop-to-local! >+closure + dup args empty? else(token "expected no arguments to prim-core-run" +mirth:emit-fatal-error!) drop + C99RT_VAL pop-value! >+closure flush-cache! c99-line("run_value(" put +closure> consume-as-VAL put ");" put) } @@ -1814,24 +1940,24 @@ def c99-prim! [ Atom Prim +C99Branch -- +C99Branch ] { { PRIM_BOOL_OR -> drop "(" C99RT_BOOL " || " C99RT_BOOL ")" False C99RT_BOOL Some c99-binop! } { PRIM_BOOL_NOT -> drop "!" C99RT_BOOL "" C99RT_BOOL Some c99-unop! } - { PRIM_PACK_NIL -> drop C99RT_VAL push-expression!("MKNIL" put) } + { PRIM_PACK_NIL -> drop C99RT_VAL push-value-expression!("MKNIL" put) } { PRIM_PACK_CONS -> drop "mkcons(" C99RT_VAL ", " C99RT_VAL ")" False C99RT_VAL Some c99-binop! } { PRIM_PACK_UNCONS -> drop - C99RT_VAL pop-to-local! >+cons - C99RT_VAL new-local! >+tail - C99RT_VAL new-local! >+head + C99RT_VAL pop-value! >+cons + C99RT_VAL new-value! >+tail + C99RT_VAL new-value! >+head c99-line ( "value_uncons(" put +cons> consume-as-VAL put ", &" put - @+tail:local-name put + @+tail:value-name put ", &" put - @+head:local-name put + @+head:value-name put ");" put ) - +tail> push-local! - +head> push-local! + +tail> push-value! + +head> push-value! } { PRIM_MUT_GET -> drop "mut_get(" C99RT_PTR ")" C99RT_VAL Some c99-unop! } @@ -1839,18 +1965,18 @@ def c99-prim! [ Atom Prim +C99Branch -- +C99Branch ] { { PRIM_MUT_IS_SET -> drop "mut_is_set(" C99RT_PTR ")" C99RT_BOOL Some c99-unop! } - { PRIM_PTR_NIL -> drop C99RT_PTR push-expression!("(void*)0" put) } + { PRIM_PTR_NIL -> drop C99RT_PTR push-value-expression!("(void*)0" put) } { PRIM_PTR_EQ -> drop "(" C99RT_PTR " == " C99RT_PTR ")" False C99RT_BOOL Some c99-binop! } { PRIM_PTR_ADD -> drop "(void*)(" C99RT_I64 " + (char*)" C99RT_PTR ")" False C99RT_PTR Some c99-binop! } - { PRIM_PTR_SIZE -> drop C99RT_U64 push-expression!("sizeof(void*)" put) } + { PRIM_PTR_SIZE -> drop C99RT_U64 push-value-expression!("sizeof(void*)" put) } { PRIM_PTR_ALLOC -> drop "ptr_alloc(" C99RT_U64 ");" C99RT_PTR Some c99-unop! } { PRIM_PTR_REALLOC -> drop "ptr_realloc(" C99RT_PTR "," C99RT_U64 ")" False C99RT_PTR Some c99-binop! } { PRIM_PTR_FREE -> drop "free(" C99RT_PTR ");" None c99-unop! } { PRIM_PTR_COPY -> drop - C99RT_PTR pop-to-local! >+dst - C99RT_U64 pop-to-local! >+len - C99RT_PTR pop-to-local! >+src + C99RT_PTR pop-value! >+dst + C99RT_U64 pop-value! >+len + C99RT_PTR pop-value! >+src c99-line ( "ptr_copy(" put +src> C99RT_PTR consume-as put @@ -1863,9 +1989,9 @@ def c99-prim! [ Atom Prim +C99Branch -- +C99Branch ] { } { PRIM_PTR_FILL -> drop - C99RT_PTR pop-to-local! >+dst - C99RT_U64 pop-to-local! >+len - C99RT_U8 pop-to-local! >+val + C99RT_PTR pop-value! >+dst + C99RT_U64 pop-value! >+len + C99RT_U8 pop-value! >+val c99-line ( "ptr_fill(" put +val> C99RT_U8 consume-as put @@ -1911,10 +2037,10 @@ def c99-prim! [ Atom Prim +C99Branch -- +C99Branch ] { { PRIM_I64_SET -> drop "*(int64_t*)" C99RT_PTR " = " C99RT_I64 ";" True None c99-binop! } { PRIM_PTR_SET -> drop "*(void**)" C99RT_PTR " = " C99RT_PTR ";" True None c99-binop! } - { PRIM_SYS_OS -> drop C99RT_I64 push-expression!("RUNNING_OS" put) } - { PRIM_SYS_ARCH -> drop C99RT_I64 push-expression!("RUNNING_ARCH" put) } - { PRIM_SYS_ARGC -> drop C99RT_I64 push-expression!("global_argc" put) } - { PRIM_SYS_ARGV -> drop C99RT_PTR push-expression!("global_argv" put) } + { PRIM_SYS_OS -> drop C99RT_I64 push-value-expression!("RUNNING_OS" put) } + { PRIM_SYS_ARCH -> drop C99RT_I64 push-value-expression!("RUNNING_ARCH" put) } + { PRIM_SYS_ARGC -> drop C99RT_I64 push-value-expression!("global_argc" put) } + { PRIM_SYS_ARGV -> drop C99RT_PTR push-value-expression!("global_argv" put) } { PRIM_CORE_MATCH -> c99-prim-syntax! } { PRIM_CORE_LAMBDA -> c99-prim-syntax! } @@ -1940,7 +2066,7 @@ def c99-prim! [ Atom Prim +C99Branch -- +C99Branch ] { def c99-prim-syntax! [ Atom +C99Branch -- +C99Branch ] { - token "unexpected syntax primitive" +core:+mirth:emit-fatal-error! + token "unexpected syntax primitive" +mirth:emit-fatal-error! } def c99-binop! [ Str C99ReprType Str C99ReprType Str Bool Maybe(C99ReprType) +C99Branch -- +C99Branch ] { @@ -1948,24 +2074,24 @@ def c99-binop! [ Str C99ReprType Str C99ReprType Str Bool Maybe(C99ReprType) +C >sfx >arg2-type >op >arg1-type >pfx args-swapped> if( - arg1-type> dup pop-to-local! consume-as >arg1 - arg2-type> dup pop-to-local! consume-as >arg2, + arg1-type> dup pop-value! consume-as >arg1 + arg2-type> dup pop-value! consume-as >arg2, - arg2-type> dup pop-to-local! consume-as >arg2 - arg1-type> dup pop-to-local! consume-as >arg1 + arg2-type> dup pop-value! consume-as >arg2 + arg1-type> dup pop-value! consume-as >arg1 ) out-type> match { - { Some -> push-expression!(pfx> put arg1> put op> put arg2> put sfx> put) } + { Some -> push-value-expression!(pfx> put arg1> put op> put arg2> put sfx> put) } { None -> c99-line(pfx> put arg1> put op> put arg2> put sfx> put) } } } def c99-unop! [ Str C99ReprType Str Maybe(C99ReprType) +C99Branch -- +C99Branch ] { >out-type >sfx >arg-type >pfx - arg-type> dup pop-to-local! consume-as + arg-type> dup pop-value! consume-as out-type> match { - { Some -> push-expression!(pfx> put put sfx> put) } + { Some -> push-value-expression!(pfx> put put sfx> put) } { None -> c99-line(pfx> put put sfx> put) } } } @@ -1980,15 +2106,15 @@ def(c99-arg-run!, Arg +C99Branch -- +C99Branch, ArgBlock -> c99-block-run!) def(c99-block-run!, Block +C99Branch -- +C99Branch, - +core:+mirth:arrow c99-arrow!) + +mirth:arrow c99-codip-arrow!) def(+C99.var-put, Var +C99 -- +C99, "var_" put name mangled put) def(c99-pack-closure-vars!, List(Var) +C99Branch -- +C99Branch, filter(is-physical?) dup empty? if( drop, - C99RT_FNPTR pop-to-local! >+fnptr - C99RT_VAL +core:local-expression!("MKTUP(tup_new(" put dup len 1+ show dup put "), " put put ")" put) rswap >+tup + C99RT_FNPTR pop-value! >+fnptr + C99RT_VAL value-expression!("MKTUP(tup_new(" put dup len 1+ show dup put "), " put put ")" put) >+tup c99-line( "VTUP(" put @+tup:rdup consume-as-VAL put ")->cells[0] = " put +fnptr> consume-as-VAL put ";" put @@ -2003,18 +2129,18 @@ def(c99-pack-closure-vars!, List(Var) +C99Branch -- +C99Branch, @i:1+ ) i> drop - +tup> push-local! + +tup> push-value! )) def c99-pop-to-var! [ Var +C99Branch -- +C99Branch ] { - dup .type +core:+mirth:c99-repr pop-to-local! consume-as-VAL swap - +core:c99-line("VAL " put var-put " = " put put ";" put) + dup .type +mirth:c99-repr pop-value! consume-as-VAL swap + +c99:c99-line("VAL " put var-put " = " put put ";" put) } def(c99-unpack-closure-vars!, List(Var) +C99Branch -- +C99Branch, filter(is-physical?) dup empty? if( drop, - C99RT_VAL pop-to-local! >+tup + C99RT_VAL pop-value! >+tup 1 >i for( >var @@ -2026,20 +2152,20 @@ def(c99-unpack-closure-vars!, List(Var) +C99Branch -- +C99Branch, @i:1+ ) i> drop - +tup> drop-local! + +tup> drop-value! )) def(c99-decref-closure-vars!, List(Var) +C99Branch -- +C99Branch, filter(is-physical?) reverse-for( - +core:c99-line("decref(" put var-put ");" put) + +c99:c99-line("decref(" put var-put ");" put) )) def(c99-block-push!, Block +C99Branch -- +C99Branch, - dup +core:+mirth:to-run-var match( + dup +mirth:to-run-var match( Some -> nip c99-var-push!, None -> - C99RT_FNPTR push-expression!("&" put dup +mirth:cname put) - dup +core:+mirth:free-vars c99-pack-closure-vars! + C99RT_FNPTR push-value-expression!("&" put dup +mirth:cname put) + dup +mirth:free-vars c99-pack-closure-vars! drop )) @@ -2049,13 +2175,13 @@ def(c99-var!, Var +C99Branch -- +C99Branch, def(c99-var-run!, Var +C99Branch -- +C99Branch, flush-cache! - +core:c99-line("incref(" put dup var-put ");" put) - +core:c99-line("run_value(" put dup var-put ");" put) + +c99:c99-line("incref(" put dup var-put ");" put) + +c99:c99-line("run_value(" put dup var-put ");" put) drop) def(c99-var-push!, Var +C99Branch -- +C99Branch, - +core:c99-line("incref(" put dup var-put ");" put) - C99RT_VAL push-expression!(dup var-put) + +c99:c99-line("incref(" put dup var-put ");" put) + C99RT_VAL push-value-expression!(dup var-put) drop) def(c99-lambda!, Lambda +C99Branch -- +C99Branch, @@ -2066,7 +2192,7 @@ def(c99-lambda!, Lambda +C99Branch -- +C99Branch, dup params reverse-for(c99-pop-to-var!) dup body c99-arrow! params reverse-for( - +core:c99-line("decref(" put var-put ");" put) + +c99:c99-line("decref(" put var-put ");" put) ) end-branch! ) @@ -2078,8 +2204,8 @@ def(c99-match!, Match +C99Branch -- +C99Branch, nip c99-single-case!, dup scrutinee-data? - unwrap(token "non-uniform match, not supported at present" +core:+mirth:emit-fatal-error!) - pop-local-value/resource-data! >+scrutinee + unwrap(token "non-uniform match, not supported at present" +mirth:emit-fatal-error!) + pop-value-value/resource-data! >+scrutinee dup cod begin-branch-split! c99-line("switch (" put @+scrutinee:peek-data-tag put ") {" put) c99-nest( @@ -2106,15 +2232,15 @@ def c99-single-case! [ Case +C99Branch -- +C99Branch ] { body c99-arrow!, pattern token-start "c99 target -- don't know how to compile this pattern" - +core:+mirth:emit-fatal-error! + +mirth:emit-fatal-error! )) } -def c99-case! [ Case +C99BranchSplit +scrutinee:+C99LocalValue/Resource -- +C99BranchSplit ] { +def c99-case! [ Case +C99BranchSplit +scrutinee:+C99Value/Resource -- +C99BranchSplit ] { dup pattern is-default? if( c99-line("default: {" put) c99-nest:sub-branch( - +scrutinee> push-local-value/resource! + +scrutinee> push-value-value/resource! body c99-arrow! ) c99-line("} break;" put), @@ -2122,14 +2248,14 @@ def c99-case! [ Case +C99BranchSplit +scrutinee:+C99LocalValue/Resource -- +C99B dup pattern single-tag? if-some( c99-line("case " put dup value-show put "LL: { // " put dup name >Str put) c99-nest:sub-branch( - +scrutinee> push-local-value/resource! + +scrutinee> push-value-value/resource! c99-reverse-tag! body c99-arrow! ) c99-line("} break;" put), pattern token-start "c99 target -- don't know how to compile this pattern" - +core:+mirth:emit-fatal-error! + +mirth:emit-fatal-error! )) } @@ -2171,10 +2297,12 @@ def(c99-block-enter!, Block +C99 -- +C99Branch, ) drop, drop ) + True >reachable start-branch!) def(c99-block-exit!, Block +C99Branch -- +C99, end-branch! + reachable> drop options emit-debug-info if( c99-line("WORD_EXIT;" put) drop, drop @@ -2186,30 +2314,30 @@ def(c99-block-def!, Block +C99 -- +C99, reset-fresh-counter! c99-nest( dup c99-block-enter! - dup +core:+mirth:arrow - dup +core:+mirth:free-vars c99-unpack-closure-vars! - dup +core:+mirth:type dom expose-stack-type! + dup +mirth:arrow + dup +mirth:free-vars c99-unpack-closure-vars! + dup +mirth:type dom expose-stack-type! dup c99-arrow! - +core:+mirth:free-vars c99-decref-closure-vars! + +mirth:free-vars c99-decref-closure-vars! c99-block-exit! ) c99-line("}" put)) def expose-stack-type! [ StackType +C99Branch -- +C99Branch ] { { STMeta -> expand-if(>StackType expose-stack-type!, drop) } - { STCons -> type-to-c99-repr pop-to-local! rdip:expose-stack-type! push-local! } - { STWith -> resource-to-c99-repr pop-to-local-resource! rdip:expose-stack-type! push-local-resource! } + { STCons -> type-to-c99-repr pop-value! rdip:expose-stack-type! push-value! } + { STWith -> resource-to-c99-repr pop-resource! rdip:expose-stack-type! push-resource! } { STConsLabel -> - >label type-to-c99-repr @label pop-to-local-label! - rdip:expose-stack-type! label> push-local-label! } + >label type-to-c99-repr @label pop-value-label! + rdip:expose-stack-type! label> push-value-label! } { STWithLabel -> - >label resource-to-c99-repr @label pop-to-local-resource-label! - rdip:expose-stack-type! label> push-local-resource-label! } + >label resource-to-c99-repr @label pop-resource-label! + rdip:expose-stack-type! label> push-resource-label! } { _ -> drop } } def(c99-word-enter!, Word +C99Branch -- +C99Branch, - +core:options emit-debug-info then( + +c99:options emit-debug-info then( c99-line( "WORD_ENTER(" put dup name >Str put-cstr ", " put @@ -2220,7 +2348,7 @@ def(c99-word-enter!, Word +C99Branch -- +C99Branch, ) drop) def(c99-word-exit!, Word +C99Branch -- +C99Branch, - +core:options emit-debug-info if( + +c99:options emit-debug-info if( c99-line("WORD_EXIT;" put) drop, drop )) @@ -2229,7 +2357,7 @@ def(c99-word-defs!, +C99 -- +C99, Word.for(dup +needs(needed?) if(c99-word-def!, def(c99-word-def!, Word +C99 -- +C99, dup c99-api c99-smart-def! ( dup c99-word-enter! - dup +core:+mirth:arrow c99-arrow! + dup +mirth:arrow c99-arrow! dup c99-word-exit! ) drop) @@ -2252,8 +2380,8 @@ def c99-field-def! [ Field +C99 -- +C99 ] { } def c99-field-call! [ Field +C99Branch -- +C99Branch ] { - C99RT_U64 pop-to-local! >+index - C99RT_PTR push-expression! ( + C99RT_U64 pop-value! >+index + C99RT_PTR push-value-expression! ( +mirth:cname put "(" put +index> C99RT_U64 consume-as put ")" put @@ -2273,10 +2401,12 @@ def(c99-main!, Arrow +C99 -- +C99, dup token-start row >Int show put ", " put dup token-start col >Int show put ");" put) ) + True >reachable start-branch! C99RT_I64 push-resource-expression!("0 /* The World! */" put) c99-arrow! end-branch! + reachable> drop options emit-debug-info then( c99-line("WORD_EXIT;" put) ) diff --git a/src/elab.mth b/src/elab.mth index a48acdf1..9a78a6d0 100644 --- a/src/elab.mth +++ b/src/elab.mth @@ -162,11 +162,9 @@ def +TypeElab.elab-resource-var! [ +Mirth +TypeElab Name -- +Mirth +TypeElab Res TYPE_RESOURCE elab-implicit-var! if-some(TVar, TYPE_ERROR) Resource } -inline ( - def +TypeElab.gamma(f) [ (*a +Gamma -- *b +Gamma) *a +TypeElab -- *b +TypeElab ] { - token rdip(>token +Gamma f rdrop) - } -) +def +TypeElab.gamma(f) [ (*a +Gamma -- *b +Gamma) *a +TypeElab -- *b +TypeElab ] { + token rdip(>token +Gamma f rdrop) +} def +TypeElab.elab-implicit-var! [ +Mirth +TypeElab Name Type -- +Mirth +TypeElab Maybe(Var) ] { over ctx lookup match( @@ -197,22 +195,20 @@ struct +ResolveDef { report-ambiguous-as-warning: Bool } -inline ( - def +ResolveDef.filter(p) [ - (*a Def +ResolveDef -- *a Either(RejectedDef, Def) +ResolveDef) - *a +ResolveDef -- *a +ResolveDef - ] { - candidates partition-either(p) dip:rejected:cat candidates! - } +def +ResolveDef.filter(p) [ + (*a Def +ResolveDef -- *a Either(RejectedDef, Def) +ResolveDef) + *a +ResolveDef -- *a +ResolveDef +] { + candidates partition-either(p) dip:rejected:cat candidates! +} - def +ResolveDef.filter(p,q) [ - (*a Def +ResolveDef -- *a Def Bool +ResolveDef, - *a Def +ResolveDef -- *a RejectedDef +ResolveDef) - *a +ResolveDef -- *a +ResolveDef - ] { - filter(p if(Right, q Left)) - } -) +def +ResolveDef.filter(p,q) [ + (*a Def +ResolveDef -- *a Def Bool +ResolveDef, + *a Def +ResolveDef -- *a RejectedDef +ResolveDef) + *a +ResolveDef -- *a +ResolveDef +] { + filter(p if(Right, q Left)) +} # TODO: separate this into a reason and a def. data RejectedDef { @@ -258,22 +254,19 @@ def resolve-def-end! [ +Mirth +ResolveDef -- +Mirth Maybe(Def) ] { ) } - -inline ( - def resolve-def(f) [ - (*a +Mirth +ResolveDef -- *b +Mirth +ResolveDef) - *a +Mirth - sort:Str - token:Token - name/dname: Name/DName - ignore-last-name:Bool - report-ambiguous-as-warning:Bool - -- - *b +Mirth Maybe(Def), - ] { - resolve-def-begin! f resolve-def-end! - } -) +def resolve-def(f) [ + (*a +Mirth +ResolveDef -- *b +Mirth +ResolveDef) + *a +Mirth + sort:Str + token:Token + name/dname: Name/DName + ignore-last-name:Bool + report-ambiguous-as-warning:Bool + -- + *b +Mirth Maybe(Def), +] { + resolve-def-begin! f resolve-def-end! +} def +ResolveDef.rdrop [ +ResolveDef -- ] { /+ResolveDef @@ -344,14 +337,12 @@ def +ResolveDef.resolve-def-unknown [ +Mirth +ResolveDef -- +Mirth ] { )) rdip:emit-error! rdrop } -inline( - def +ResolveDef.filter-sort(p) [ - (*a Def +ResolveDef -- *a Def Bool +ResolveDef) - *a +ResolveDef -- *a +ResolveDef - ] { - filter(p, RD_WRONG_SORT) - } -) +def +ResolveDef.filter-sort(p) [ + (*a Def +ResolveDef -- *a Def Bool +ResolveDef) + *a +ResolveDef -- *a +ResolveDef +] { + filter(p, RD_WRONG_SORT) +} def +ResolveDef.filter-arity [ +Mirth +ResolveDef -- +Mirth +ResolveDef ] { token num-args filter( @@ -576,47 +567,45 @@ def ab-type! [ +AB StackType -- +AB ] { arrow:cod! } def ab-ctx@ [ +AB -- +AB Ctx ] { arrow ctx } def ab-home@ [ +AB -- +AB Home ] { arrow home } -inline ( - def +AB.gamma(f) [ (*a +Gamma -- *b +Gamma) *a +AB -- *b +AB ] { - ab-token@ rdip(>token +Gamma f rdrop) - } +def +AB.gamma(f) [ (*a +Gamma -- *b +Gamma) *a +AB -- *b +AB ] { + ab-token@ rdip(>token +Gamma f rdrop) +} - def ab-build!(f) [ (*a +AB -- *b +AB) *a Ctx StackType Token Home -- *b Arrow ] { - >home - dup >token-start >token-end - dup >dom >cod - >ctx L0 >atoms - Arrow >arrow +AB - f /+AB arrow> - } +def ab-build!(f) [ (*a +AB -- *b +AB) *a Ctx StackType Token Home -- *b Arrow ] { + >home + dup >token-start >token-end + dup >dom >cod + >ctx L0 >atoms + Arrow >arrow +AB + f /+AB arrow> +} - ||| Like ab-build! but takes a morphism type to build - ||| instead of just the domain. The codomain is placed - ||| on the stack for (in)convenience. (You can ignore it with dip.) - def ab-build-hom!(f) [ - (*a StackType +Mirth +AB -- *b StackType +Mirth +AB) - *a Ctx ArrowType Token Home +Mirth -- *b Arrow +Mirth - ] { - dip2(unpack rotr) - ab-build!(f ab-unify-type!) - } +||| Like ab-build! but takes a morphism type to build +||| instead of just the domain. The codomain is placed +||| on the stack for (in)convenience. (You can ignore it with dip.) +def ab-build-hom!(f) [ + (*a StackType +Mirth +AB -- *b StackType +Mirth +AB) + *a Ctx ArrowType Token Home +Mirth -- *b Arrow +Mirth +] { + dip2(unpack rotr) + ab-build!(f ab-unify-type!) +} - ||| Build the arrow for a word. If the word type and context are available, use that. - ||| Otherwise, we are in a situation where type and context were not given, so we infer them. - ||| - ||| To infer ctx-type, we start with an initial guess based on the word head (with lots - ||| of metavariables). We temporarily set that as our ctx-type. Then we elaborate the word - ||| body. After elaboration, we rigidify the type to obtain a generalized definition, by - ||| replacing any free metavariables with universally quantified variables. - def ab-build-word-arrow!(f) [ - (*a StackType +Mirth +AB -- *b StackType +Mirth +AB) - *a Word +Mirth -- *b Arrow +Mirth - ] { - initial-ctx-type-body-home - dip:ab-build-hom!(f) - finalize-word-arrow - } -) +||| Build the arrow for a word. If the word type and context are available, use that. +||| Otherwise, we are in a situation where type and context were not given, so we infer them. +||| +||| To infer ctx-type, we start with an initial guess based on the word head (with lots +||| of metavariables). We temporarily set that as our ctx-type. Then we elaborate the word +||| body. After elaboration, we rigidify the type to obtain a generalized definition, by +||| replacing any free metavariables with universally quantified variables. +def ab-build-word-arrow!(f) [ + (*a StackType +Mirth +AB -- *b StackType +Mirth +AB) + *a Word +Mirth -- *b Arrow +Mirth +] { + initial-ctx-type-body-home + dip:ab-build-hom!(f) + finalize-word-arrow +} def initial-ctx-type-body-home [ +Mirth Word -- +Mirth Ctx ArrowType Token Home Word ] { >word @@ -671,12 +660,10 @@ def guess-initial-ctx-type [ +Mirth word:Word -- +Mirth Ctx ArrowType word:Word True @word ~inferring-type? ! } -inline ( - def ab-build-word!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a Word +Mirth -- *b Word +Mirth ] { - sip(ab-build-word-arrow!(dip(f))) sip(WordArrow prop) - tuck ~arrow ! - } -) +def ab-build-word!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a Word +Mirth -- *b Word +Mirth ] { + sip(ab-build-word-arrow!(dip(f))) sip(WordArrow prop) + tuck ~arrow ! +} def ab-unify-type! [ StackType +Mirth +AB -- +Mirth +AB ] { dip:ab-type@ gamma:unify! ab-type! @@ -780,60 +767,58 @@ def ab-label-pop! [ Label +Mirth +AB -- +Mirth +AB ] { OpLabelPop ab-op! } def ab-label-push-r! [ Label +Mirth +AB -- +Mirth +AB ] { OpLabelPushR ab-op! } def ab-label-pop-r! [ Label +Mirth +AB -- +Mirth +AB ] { OpLabelPopR ab-op! } -inline ( - def ab-block-at!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a Token +Mirth +AB -- *b +Mirth +AB ] { - ab-ctx@ MetaVar.new! STMeta rotl ab-home@ rdip(ab-build!(f)) - rdip:Block.new! OpBlockPush ab-op! - } +def ab-block-at!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a Token +Mirth +AB -- *b +Mirth +AB ] { + ab-ctx@ MetaVar.new! STMeta rotl ab-home@ rdip(ab-build!(f)) + rdip:Block.new! OpBlockPush ab-op! +} - def ab-block!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a +Mirth +AB -- *b +Mirth +AB ] { - ab-token@ ab-block-at!(f) - } +def ab-block!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a +Mirth +AB -- *b +Mirth +AB ] { + ab-token@ ab-block-at!(f) +} - def ab-dip!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a +Mirth +AB -- *b +Mirth +AB ] { - ab-block!(f) PRIM_CORE_DIP ab-prim! - } +def ab-dip!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a +Mirth +AB -- *b +Mirth +AB ] { + ab-block!(f) PRIM_CORE_DIP ab-prim! +} - def ab-rdip!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a +Mirth +AB -- *b +Mirth +AB ] { - ab-block!(f) PRIM_CORE_RDIP ab-prim! - } +def ab-rdip!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a +Mirth +AB -- *b +Mirth +AB ] { + ab-block!(f) PRIM_CORE_RDIP ab-prim! +} - def ab-if!(f,g) [ - (*a +Mirth +AB -- *b +Mirth +AB, - *b +Mirth +AB -- *c +Mirth +AB) - *a +Mirth +AB -- *c +Mirth +AB - ] { - ab-block!(f) ab-block!(g) PRIM_CORE_IF ab-prim! - } +def ab-if!(f,g) [ + (*a +Mirth +AB -- *b +Mirth +AB, + *b +Mirth +AB -- *c +Mirth +AB) + *a +Mirth +AB -- *c +Mirth +AB +] { + ab-block!(f) ab-block!(g) PRIM_CORE_IF ab-prim! +} - def ab-while!(f,g) [ - (*a +Mirth +AB -- *b +Mirth +AB, - *b +Mirth +AB -- *c +Mirth +AB) - *a +Mirth +AB -- *c +Mirth +AB - ] { - ab-block!(f) ab-block!(g) PRIM_CORE_WHILE ab-prim! - } +def ab-while!(f,g) [ + (*a +Mirth +AB -- *b +Mirth +AB, + *b +Mirth +AB -- *c +Mirth +AB) + *a +Mirth +AB -- *c +Mirth +AB +] { + ab-block!(f) ab-block!(g) PRIM_CORE_WHILE ab-prim! +} - def ab-lambda!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a List(Var) +Mirth +AB -- *b +Mirth +AB ] { - dip(ab-token@) ab-lambda-at!(f) - } +def ab-lambda!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a List(Var) +Mirth +AB -- *b +Mirth +AB ] { + dip(ab-token@) ab-lambda-at!(f) +} - def ab-lambda-at!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a Token List(Var) +Mirth +AB -- *b +Mirth +AB ] { - dup dip( - dip(ab-ctx@ ab-type@) reverse-for( - swap dip(dup dip(Ctx.new)) - ab-token@ rdip:elab-expand-tensor! - dip(rotl type) rdip:elab-type-unify! drop2 - ) - rotl ab-home@ rdip(ab-build!(f)) +def ab-lambda-at!(f) [ (*a +Mirth +AB -- *b +Mirth +AB) *a Token List(Var) +Mirth +AB -- *b +Mirth +AB ] { + dup dip( + dip(ab-ctx@ ab-type@) reverse-for( + swap dip(dup dip(Ctx.new)) + ab-token@ rdip:elab-expand-tensor! + dip(rotl type) rdip:elab-type-unify! drop2 ) - >params >body - ab-ctx@ >outer-ctx - ab-type@ >dom - ab-token@ >token - Lambda OpLambda ab-op! - } -) + rotl ab-home@ rdip(ab-build!(f)) + ) + >params >body + ab-ctx@ >outer-ctx + ab-type@ >dom + ab-token@ >token + Lambda OpLambda ab-op! +} data OpSig { OPSIG_ID @@ -1189,38 +1174,36 @@ def elab-pattern-atom! [ Token +Mirth +Pattern -- +Mirth +Pattern ] { )) } -inline ( - def ab-match!(f) [ - (*a +Mirth +Match -- *b +Mirth +Match) - *a cod:StackType body:Token +Mirth +AB -- *b +Mirth +AB - ] { - ab-ctx@ >ctx - ab-type@ >dom - ab-token@ >token - ab-home@ >home - L0 >cases - rdip(+Match f freeze) OpMatch ab-op! - } +def ab-match!(f) [ + (*a +Mirth +Match -- *b +Mirth +Match) + *a cod:StackType body:Token +Mirth +AB -- *b +Mirth +AB +] { + ab-ctx@ >ctx + ab-type@ >dom + ab-token@ >token + ab-home@ >home + L0 >cases + rdip(+Match f freeze) OpMatch ab-op! +} - def +Match.case!(mkpat,mkbod) [ - (*a +Mirth +Pattern -- *b +Mirth +Pattern, - *b +Mirth +AB -- *c +Mirth +AB) - *a Token Token +Mirth +Match -- *c +Mirth +Match, - ] { - dip( - +Match.home >home dup >token-start >token-end - +Match.ctx dup >outer-ctx >inner-ctx - L0 >saved +Match.dom dup >mid >cod L0 >atoms - Pattern rdip(thaw mkpat freeze) >pattern - ) - @pattern inner-ctx - @pattern Pattern.dom +Match.cod T-> - rotl - +Match.home - @pattern:dip:rdip(ab-build-hom!(dip(mkbod))) - >body CASE add-case - } -) +def +Match.case!(mkpat,mkbod) [ + (*a +Mirth +Pattern -- *b +Mirth +Pattern, + *b +Mirth +AB -- *c +Mirth +AB) + *a Token Token +Mirth +Match -- *c +Mirth +Match, +] { + dip( + +Match.home >home dup >token-start >token-end + +Match.ctx dup >outer-ctx >inner-ctx + L0 >saved +Match.dom dup >mid >cod L0 >atoms + Pattern rdip(thaw mkpat freeze) >pattern + ) + @pattern inner-ctx + @pattern Pattern.dom +Match.cod T-> + rotl + +Match.home + @pattern:dip:rdip(ab-build-hom!(dip(mkbod))) + >body CASE add-case +} def elab-expand-tensor! [ +Mirth StackType Token -- +Mirth StackType Type Token ] { >tok force-cons?! match( @@ -2081,8 +2064,7 @@ def elab-def-external-ctype [ +Mirth External -- +Mirth CTypeArrow ] { dup head with-error-token( type ctype dup cod parts - filter(label? none?) - filter(ctype phantom? not) + filter(sip(label? none?) ctype phantom? not &&) len 1u > then( "External has too many outputs." error! ) diff --git a/src/main.mth b/src/main.mth index e9faf3ef..98ab30b3 100644 --- a/src/main.mth +++ b/src/main.mth @@ -99,12 +99,17 @@ def compile! [ Arguments +World +Mirth -- +World +Mirth ] { Some -> "Specializer." rdip:trace run-specializer! - "Codegen." rdip:trace - output-file> if-some( - >output-path - C99_Options run-output-c99!, + num-errors 0> if( + trace-diagnostics! + num-errors rdip:trace(FGRed emit; show ; " errors during specializer." ; Reset emit;) 1 posix-exit!, - emit-debug-info> drop2 + "Codegen." rdip:trace + output-file> if-some( + >output-path + C99_Options run-output-c99!, + + emit-debug-info> drop2 + ) ), None -> "Skipping Codegen." rdip:trace diff --git a/src/mirth.mth b/src/mirth.mth index 33bf6db8..3af0242f 100644 --- a/src/mirth.mth +++ b/src/mirth.mth @@ -190,11 +190,9 @@ def(+Mirth.emit-deprecated!, Token old:Str new:Str +Mirth -- +Mirth, FGCyan emit; new> ; Reset emit; " instead.";) emit-warning!) -inline ( - def(+Mirth.with-error-token(f), (*a +Mirth -- *b +Mirth) - *a Token +Mirth -- *b +Mirth, - error-token dip(Some error-token! f) error-token!) -) +def(+Mirth.with-error-token(f), (*a +Mirth -- *b +Mirth) + *a Token +Mirth -- *b +Mirth, + error-token dip(Some error-token! f) error-token!) def +Mirth.default-error-location [ +Mirth -- +Mirth Location ] { builtin prim >module @@ -279,16 +277,14 @@ def(PropLabel.prop3, b1 b2 b3 PropLabel +Mirth -- Prop([b1 b2 b3]) +Mirth, def(PropLabel.prop(f), (a +Mirth -- b +Mirth) a PropLabel +Mirth -- Prop(b) +Mirth, >label [f] PSDelay >state Prop) -inline( - def(PropLabel.prop0(f), (+Mirth -- b +Mirth) PropLabel +Mirth -- Prop(b) +Mirth, - dip:0 prop(drop f)) - def(PropLabel.prop2(f), (a1 a2 +Mirth -- b +Mirth) a1 a2 PropLabel +Mirth -- Prop(b) +Mirth, - dip(pack2) prop(unpack2 f)) - def(PropLabel.prop3(f), (a1 a2 a3 +Mirth -- b +Mirth) a1 a2 a3 PropLabel +Mirth -- Prop(b) +Mirth, - dip(pack3) prop(unpack3 f)) - def(PropLabel.prop4(f), (a1 a2 a3 a4 +Mirth -- b +Mirth) a1 a2 a3 a4 PropLabel +Mirth -- Prop(b) +Mirth, - dip(pack4) prop(unpack4 f)) -) +def(PropLabel.prop0(f), (+Mirth -- b +Mirth) PropLabel +Mirth -- Prop(b) +Mirth, + dip:0 prop(drop f)) +def(PropLabel.prop2(f), (a1 a2 +Mirth -- b +Mirth) a1 a2 PropLabel +Mirth -- Prop(b) +Mirth, + dip(pack2) prop(unpack2 f)) +def(PropLabel.prop3(f), (a1 a2 a3 +Mirth -- b +Mirth) a1 a2 a3 PropLabel +Mirth -- Prop(b) +Mirth, + dip(pack3) prop(unpack3 f)) +def(PropLabel.prop4(f), (a1 a2 a3 a4 +Mirth -- b +Mirth) a1 a2 a3 a4 PropLabel +Mirth -- Prop(b) +Mirth, + dip(pack4) prop(unpack4 f)) def(Prop.ready?, Prop(t) -- Maybe(t), state match( @@ -309,8 +305,6 @@ def(Prop.try-force!, Mut(Prop(t)) +Mirth -- Maybe(t) +Mirth, )) def(Prop.force!, Mut(Prop(t)) +Mirth -- t +Mirth, try-force! unwrap("Recursive prop detected!" fatal-error!)) -inline ( - def(Prop.force-or!(f), (*a +Mirth -- *a b +Mirth) - *a Mut(Prop(b)) +Mirth -- *a b +Mirth, - try-force! unwrap(f)) -) +def(Prop.force-or!(f), (*a +Mirth -- *a b +Mirth) + *a Mut(Prop(b)) +Mirth -- *a b +Mirth, + try-force! unwrap(f)) diff --git a/src/specializer.mth b/src/specializer.mth index 254b8a39..b54241ba 100644 --- a/src/specializer.mth +++ b/src/specializer.mth @@ -11,6 +11,7 @@ import(std.str) import(mirth.mirth) import(mirth.word) import(mirth.arrow) +import(mirth.data) import(mirth.match) import(mirth.type) import(mirth.elab) @@ -79,10 +80,9 @@ def(+SPCheck.check-word-atom!, +Mirth +SPCheck Atom Word -- +Mirth +SPCheck List over args >List+ match( None -> drop L1, Some -> - dup for(check-arg!) - over prefer-inline? not or( - dup has(rdip:free-vars has(is-physical?))) if( - # too complicated, let's skip it + dup has(rdip:free-vars has(is-physical?)) if( + # can't specialize, just check the args + dup for(check-arg!) drop2 L1, # boot up the specializer for real! @@ -113,7 +113,7 @@ def(+SPCheck.push-check-block!, Block +SPCheck -- +SPCheck, SPCHECK_BLOCK checklist:cons )) -inline:def(ab-build-over-atom!(f), (*a +Mirth +AB -- *b +Mirth +AB) *a Atom +Mirth -- *b Arrow +Mirth, +def(ab-build-over-atom!(f), (*a +Mirth +AB -- *b +Mirth +AB) *a Atom +Mirth -- *b Arrow +Mirth, /Atom ctx> dom> cod> T-> @@ -121,8 +121,61 @@ inline:def(ab-build-over-atom!(f), (*a +Mirth +AB -- *b +Mirth +AB) *a Atom +Mir subst> op> args> drop3 ab-build-hom!(dip(f))) +def(Arg.similar, +Mirth Arg Arg -- +Mirth Bool, both(/ArgBlock) similar) +def(Block.similar, +Mirth Block Block -- +Mirth Bool, + dup2 == + or(dup2 on2(arrow) similar) + dip:drop2 +) +def(Arrow.similar, +Mirth Arrow Arrow -- +Mirth Bool, + # both(atoms /L1) if-some(swap if-some(similar, drop False), drop False) + both(atoms) ==:similar +) +def(Atom.similar, +Mirth Atom Atom -- +Mirth Bool, + dup2 both(op) similar + and(dup2 both(args) ==:similar) + dip(drop2) +) +def Op.similar [ +Mirth Op Op -- +Mirth Bool ] { + { OpNone -> match { OpNone -> True, _ -> drop False }} + { OpPrim -> swap match { OpPrim -> ==, _ -> drop2 False }} + { OpWord -> swap match { OpWord -> ==, _ -> drop2 False }} + { OpExternal -> swap match { OpExternal -> ==, _ -> drop2 False }} + { OpBuffer -> swap match { OpBuffer -> ==, _ -> drop2 False }} + { OpVariable -> swap match { OpVariable -> ==, _ -> drop2 False }} + { OpField -> swap match { OpField -> ==, _ -> drop2 False }} + { OpInt -> swap match { OpInt -> ==, _ -> drop2 False }} + { OpF64 -> swap match { OpF64 -> ==, _ -> drop2 False }} + { OpStr -> swap match { OpStr -> ==, _ -> drop2 False }} + { OpTag -> swap match { OpTag -> ==, _ -> drop2 False }} + { OpMatch -> drop2 False } + { OpLambda -> drop2 False } + { OpVar -> drop2 False } + { OpBlockPush -> swap match { OpBlockPush -> similar, _ -> drop2 False }} + { OpBlockRun -> swap match { OpBlockRun -> similar, _ -> drop2 False }} + { OpCoerce -> swap match { OpCoerce -> similar, _ -> drop2 False }} + { OpLabelPush -> swap match { OpLabelPush -> ==, _ -> drop2 False }} + { OpLabelPop -> swap match { OpLabelPop -> ==, _ -> drop2 False }} + { OpLabelPushR -> swap match { OpLabelPushR -> ==, _ -> drop2 False }} + { OpLabelPopR -> swap match { OpLabelPopR -> ==, _ -> drop2 False }} + { OpDataGetTag -> swap match { OpDataGetTag -> ==, _ -> drop2 False }} + { OpDataGetLabel -> swap match { OpDataGetLabel -> similar, _ -> drop2 False }} + { OpDataSetLabel -> swap match { OpDataSetLabel -> similar, _ -> drop2 False }} +} + +def Coerce.similar [ Coerce Coerce -- Bool ] { + drop2 True +} + +def TagField.similar [ TagField TagField -- Bool ] { + /TagField /TagField + label> label> == + tag> tag> == && + type/resource> type/resource> drop2 +} + data(SPKey, SPKEY -> List+(Arg)) -def(SPKey.==, SPKey SPKey -- Bool, both(/SPKEY) ==(==)) +def(SPKey.similar, +Mirth SPKey SPKey -- +Mirth Bool, both(/SPKEY) ==(similar)) def(SPKey.>Str, +Mirth SPKey -- +Mirth Str, SPKEY -> Str("(" ; dip:"" for(dip:; rdip:>Str ; ",") drop ")" ;)) def(SPKey.>Name, +Mirth SPKey -- +Mirth Name, @@ -136,28 +189,38 @@ def(Word.sp-synthed, Word -- Map(SPKey,Word), ||| Those other arguments are pushed on the stack. def specialize-word! [ +Mirth SPKey Word -- +Mirth Word ] { >word >key - @key @word sp-synthed lookup(==) match( - Some -> False over ~prefer-inline? !, + @key @word sp-synthed lookup(similar) match( + Some -> + # This specialization has already been done. So inline this + # specialization only if the word was marked as inline. + @word prefer-inline? over ~prefer-inline? !, None -> + # This word has not been specialized with these arguments before. @word head >head None >sig? @word body >body - @key >Name >name + Str( "sp" ; @word sp-synthed len 1+ show ; ) >Name >name 0u >arity Word.new! >word' - @word NAMESPACE_WORD @key >Name QNAME0 @word' WordQName prop @word' ~qname ! + @word NAMESPACE_WORD @word' name QNAME0 + @word' WordQName prop @word' ~qname ! @key >key @word' >value KVPair @word sp-synthed insert @word ~sp-synthed ! - @key @word @word' WordType prop2( - ctx-type specialize-ctx-type pack2 + # @key @word @word' WordType prop2( + # ctx-type specialize-ctx-type pack2 + # ) @word' ~ctx-type ! + @word' dup WordType prop( + arrow ctx-type pack2 ) @word' ~ctx-type ! + # True @word' ~inferring-type? ! True @word' ~prefer-inline? ! @key @word @word' dup WordArrow prop3(ab-build-word-arrow!(dip( synth-specialized-word! ))) @word' ~arrow ! + @word' type drop word'> ) key> word> drop2 @@ -182,7 +245,6 @@ def(specialize-ctx-type, +Mirth SPKey Ctx ArrowType -- +Mirth Ctx ArrowType, data(+SPSynth, +SPSYNTH -> spkey:SPKey spword:Word spmap:Map(Var,Block) +AB) -inline: def(+SPSynth.ab(f), (*a spkey:SPKey spword:Word spmap:Map(Var,Block) +AB -- *b spkey:SPKey spword:Word spmap:Map(Var,Block) +AB) @@ -226,12 +288,13 @@ def(+SPSynth.synth-op!, +Mirth +SPSynth Op -- +Mirth +SPSynth, _ -> ab:ab-op!) def(+SPSynth.synth-block!, +Mirth +SPSynth Block -- +Mirth +SPSynth, + ab:ab-block!(+SPSYNTH synth-run! /+SPSYNTH) # dup free-vars has(dup spmap lookup(==) some?) if( - dup rdip:to-run-var bind(spmap lookup(==)) match( - None -> ab:ab-block!(+SPSYNTH synth-run! /+SPSYNTH), - Some -> nip OpBlockPush ab:ab-op! - ), - # OpBlockPush ab:ab-op! + # dup rdip:to-run-var bind(spmap lookup(==)) match( + # None -> ab:ab-block!(+SPSYNTH synth-run! /+SPSYNTH), + # Some -> nip OpBlockPush ab:ab-op! + # ), + # # OpBlockPush ab:ab-op! # )) ) @@ -240,7 +303,7 @@ def(+SPSynth.synth-run!, +Mirth +SPSynth Block -- +Mirth +SPSynth, def(+SPSynth.synth-var!, +Mirth +SPSynth Var -- +Mirth +SPSynth, dup spmap lookup(==) match( - Some -> nip OpBlockRun ab:ab-op!, + Some -> nip synth-run!, # Some -> nip arrow synth-arrow!, None -> ab:ab-var! )) diff --git a/src/type.mth b/src/type.mth index 57d58b26..2c53464e 100644 --- a/src/type.mth +++ b/src/type.mth @@ -406,6 +406,31 @@ def(Type.has-meta2?, MetaVar Type Type -- Bool, def(Value.has-meta?, MetaVar Value -- Bool, type has-meta?) +def Type.has-var? [ Var Type -- Bool ] { + { TYPE_ERROR -> drop True } + { TYPE_DONT_CARE -> drop True } + { TVar -> == } + { TMeta -> has-var? } + { TPrim -> drop2 False } + { THole -> drop2 False } + { TTensor -> has-var? } + { TMorphism -> has-var? } + { TApp -> has-var2? } + { TData -> drop2 False } + { TDataPartial -> drop2 False } + { TTable -> drop2 False } + { TValue -> has-var? } + { TMut -> has-var? } +} + +def Type.has-var2? [ Var Type Type -- Bool ] { + dip(over) has-var? if(drop2 True, has-var?) +} + +def Value.has-var? [ Var Value -- Bool ] { + type has-var? +} + def(Type.sig;, Type +Str -- +Str, TMeta -> expand-if(sig;, type;), TYPE_ERROR -> "" ;, @@ -563,6 +588,9 @@ def(MetaVar.has-meta?, MetaVar MetaVar -- Bool, None -> ==, Some -> nip has-meta? )) +def MetaVar.has-var? [ Var MetaVar -- Bool ] { + type? if-some(has-var?, drop False) +} def(MetaVar.type;, +Str MetaVar -- +Str, dup type? match( @@ -573,13 +601,11 @@ def(MetaVar.new!, MetaVar, MetaVar.alloc! None over ~type? !) -inline ( - def(MetaVar.expand-if(f,g), (*a Type -- *b, *a MetaVar -- *b) *a MetaVar -- *b, - dup type? match( - None -> g, - Some -> expand tuck Some swap ~type? ! f - )) -) +def(MetaVar.expand-if(f,g), (*a Type -- *b, *a MetaVar -- *b) *a MetaVar -- *b, + dup type? match( + None -> g, + Some -> expand tuck Some swap ~type? ! f + )) def(MetaVar.expand, MetaVar -- Type, expand-if(id, TMeta)) @@ -600,13 +626,11 @@ def(MetaVar.unify-error!, +Mirth +Gamma MetaVar -- +Mirth +Gamma Type, None -> dip(TYPE_ERROR Some) ~type? ! TYPE_ERROR )) -inline ( - def(MetaVar.expand-or-update!(f), (*a -- *a Type) *a MetaVar -- *a Type, - dup type? match( - None -> dip(f dup Some) ~type? !, - Some -> nip - )) -) +def(MetaVar.expand-or-update!(f), (*a -- *a Type) *a MetaVar -- *a Type, + dup type? match( + None -> dip(f dup Some) ~type? !, + Some -> nip + )) def(MetaVar.==, MetaVar MetaVar -- Bool, both(index) ==) @@ -641,6 +665,7 @@ data(Resource, Resource -> Type) def(Resource.>Type, Resource -- Type, Resource -> id) def(Type.>Resource, Type -- Resource, Resource) def(Resource.has-meta?, MetaVar Resource -- Bool, >Type has-meta?) +def Resource.has-var? [ Var Resource -- Bool ] { >Type has-var? } def(Resource.unify!, +Mirth +Gamma Resource Resource -- +Mirth +Gamma Resource, both(>Type) unify! >Resource) def(Resource.unify-error!, +Mirth +Gamma Resource -- +Mirth +Gamma Resource, @@ -815,6 +840,18 @@ def(StackType.has-meta?, MetaVar StackType -- Bool, STWithLabel -> drop dip(over) has-meta? if(drop2 True, has-meta?), )) +def StackType.has-var? [ Var StackType -- Bool ] { + { STACK_TYPE_ERROR -> drop False } + { STACK_TYPE_DONT_CARE -> drop False } + { STACK_TYPE_UNIT -> drop False } + { STMeta -> has-var? } + { STVar -> == } + { STCons -> dip(over) has-var? if(drop2 True, has-var?) } + { STWith -> dip(over) has-var? if(drop2 True, has-var?) } + { STConsLabel -> drop dip(over) has-var? if(drop2 True, has-var?) } + { STWithLabel -> drop dip(over) has-var? if(drop2 True, has-var?) } +} + def(StackType.unify-failed!, +Mirth +Gamma StackType StackType -- +Mirth +Gamma StackType, both(>Type) unify-failed! >StackType) @@ -1067,6 +1104,30 @@ def(StackType.num-morphisms-on-top, StackType -- Nat, STWithLabel -> drop2 num-morphisms-on-top, _ -> drop 0u) +def StackType.linear-base-meta? [ StackType -- Maybe(MetaVar) ] { + { STACK_TYPE_ERROR -> None } + { STACK_TYPE_DONT_CARE -> None } + { STACK_TYPE_UNIT -> None } + { STMeta -> expand-if(>StackType linear-base-meta?, Some) } + { STVar -> drop None } + { STCons -> swap linear-base-meta? filter(over has-meta? not) nip } + { STWith -> swap linear-base-meta? filter(over has-meta? not) nip } + { STConsLabel -> drop swap linear-base-meta? filter(over has-meta? not) nip } + { STWithLabel -> drop swap linear-base-meta? filter(over has-meta? not) nip } +} + +def StackType.linear-base-var? [ StackType -- Maybe(Var) ] { + { STACK_TYPE_ERROR -> None } + { STACK_TYPE_DONT_CARE -> None } + { STACK_TYPE_UNIT -> None } + { STMeta -> expand-if(>StackType linear-base-var?, drop None) } + { STVar -> Some } + { STCons -> swap linear-base-var? filter(over has-var? not) nip } + { STWith -> swap linear-base-var? filter(over has-var? not) nip } + { STConsLabel -> drop swap linear-base-var? filter(over has-var? not) nip } + { STWithLabel -> drop swap linear-base-var? filter(over has-var? not) nip } +} + ############## # Arrow TYPE # ############## @@ -1087,6 +1148,10 @@ def(ArrowType.unify-error!, +Mirth +Gamma ArrowType -- +Mirth +Gamma ArrowType, unpack dip(unify-error!) dip'(unify-error!) ARROW_TYPE) def(ArrowType.has-meta?, MetaVar ArrowType -- Bool, unpack dip(over) has-meta? if(drop2 True, has-meta?)) +def ArrowType.has-var? [ Var ArrowType -- Bool ] { + unpack + dip(over) has-var? if(drop2 True, has-var?) +} def(ArrowType.sig;, +Str ArrowType -- +Str, unpack swap dom; "--"; cod;) @@ -1132,11 +1197,18 @@ def(ArrowType.rigidify!, +Mirth Ctx ArrowType -- +Mirth Ctx ArrowType, ARROW_TYPE) def(ArrowType.rigidify-sig!, +Mirth Ctx ArrowType -- +Mirth Ctx ArrowType, + dup + unpack linear-base-meta? if-some( + swap linear-base-meta? if-some( + over == if( + TYPE_UNIT Some swap ~type? !, + drop + ), + drop + ), + drop + ) rigidify!) - # TODO check if both stack bases are the same metavar, - # and that this metavar appears nowhere else in the sig, - # and if so, unify that metavar with STACK_TYPE_UNIT. - # https://github.com/mirth-lang/mirth/issues/239 def(ArrowType.max-num-params, ArrowType -- Nat, dom num-morphisms-on-top) @@ -1184,6 +1256,11 @@ data StackTypeBase { STBMeta [ MetaVar ] } +def StackTypeBase.unit? [ StackTypeBase -- Bool ] { + { STB_UNIT -> True } + { _ -> drop False } +} + data StackTypePart { STPCons [ Type ] STPConsLabel [ Type Label ] diff --git a/src/var.mth b/src/var.mth index a4c60462..ab0bc701 100644 --- a/src/var.mth +++ b/src/var.mth @@ -23,7 +23,10 @@ def(Var.name, Var -- Name, ~name @) def(Var.type, Var -- Type, ~type @) def(Var.auto-run?, Var -- Maybe(ArrowType), ~auto-run? @) -def(Var.==, Var Var -- Bool, both(index) ==) +inline ( + def Var.== [ Var Var -- Bool ] { both(index) == } + def Var.<> [ Var Var -- Bool ] { == not } +) def(Var.type;, +Str Var -- +Str, name >Str ;) def(Var.is-type?, Var -- Bool, type prim? has(PRIM_TYPE_TYPE ==)) def(Var.is-stack?, Var -- Bool, type prim? has(PRIM_TYPE_STACK ==)) diff --git a/tools/build.bat b/tools/build.bat index 850fabd0..236eaa9f 100644 --- a/tools/build.bat +++ b/tools/build.bat @@ -1,12 +1,12 @@ @echo off -cl /WX /MD /F 4194304 /TC bin\mirth0.c /Fobin\wmirth0.obj /Febin\wmirth0.exe /link legacy_stdio_definitions.lib /WX || goto :error +cl /WX /MD /TC bin\mirth0.c /Fobin\wmirth0.obj /Febin\wmirth0.exe /link legacy_stdio_definitions.lib /WX || goto :error bin\wmirth0.exe src\main.mth -o bin\wmirth1.c || goto :error -cl /WX /MD /F 4194304 /TC bin\wmirth1.c /Fobin\wmirth1.obj /Febin\wmirth1.exe /link legacy_stdio_definitions.lib /WX || goto :error +cl /WX /MD /TC bin\wmirth1.c /Fobin\wmirth1.obj /Febin\wmirth1.exe /link legacy_stdio_definitions.lib /WX || goto :error bin\wmirth1.exe src\main.mth -o bin\wmirth2.c || goto :error -cl /WX /W3 /MD /F 4194304 /TC bin\wmirth2.c /Fobin\wmirth2.obj /Febin\wmirth2.exe /link legacy_stdio_definitions.lib /WX || goto :error +cl /WX /W2 /MD /TC bin\wmirth2.c /Fobin\wmirth2.obj /Febin\wmirth2.exe /link legacy_stdio_definitions.lib /WX || goto :error bin\wmirth2.exe src\main.mth -o bin\wmirth3.c || goto :error goto :EOF