diff --git a/bootstrap/s2c-seed.c b/bootstrap/s2c-seed.c index 0c0a8b55..c254926f 100644 --- a/bootstrap/s2c-seed.c +++ b/bootstrap/s2c-seed.c @@ -205,7 +205,10 @@ struct E_Mem__Mult; struct E_Mem__Row; struct E_Coll__List__Mem__Row; struct E_Mem__Block; +struct E_Coll__List__I64; struct E_Coll__List__Mem__Block; +struct E_Mem__FreeAt; +struct E_Coll__List__Mem__FreeAt; struct E_Mem__Report; struct E_Flow__Clash; struct E_Coll__List__Flow__Clash; @@ -250,7 +253,6 @@ struct E_D__Row; struct E_Coll__List__D__Val; struct E_Coll__BTree__Coll__BTree_1_Coll__List_1_D__Row; struct E_Coll__BTree__Coll__List_1_D__Row; -struct E_Coll__List__I64; struct E_Coll__List__D__RelRef; struct E_Coll__List__Tl__Err; struct E_Tl__Err; @@ -1168,16 +1170,22 @@ struct E_S2c__MemCount { union { uint8_t tag; union { struct { uint8_t t_; int64 _Static_assert(sizeof(((struct E_S2c__MemCount*)0)->u.C_S2c__MemCount) == 48, "srs layout"); struct E_Mem__Mult { union { uint8_t tag; union { struct { uint8_t t_; struct E_Mem__Why* f_why; } C_Mem__Many; uint8_t none_; } u; }; }; _Static_assert(sizeof(((struct E_Mem__Mult*)0)->u.C_Mem__Many) == 16, "srs layout"); -struct E_Mem__Row { union { uint8_t tag; union { struct { uint8_t t_; bool f_dies; int64_t f_line; struct E_Sym__Sym* f_ctor; struct E_Coll__Option__I64* f_bytes; struct E_Mem__Mult* f_m; } C_Mem__Row; uint8_t none_; } u; }; }; -_Static_assert(sizeof(((struct E_Mem__Row*)0)->u.C_Mem__Row) == 40, "srs layout"); +struct E_Mem__Row { union { uint8_t tag; union { struct { uint8_t t_; bool f_dies; int64_t f_line; struct E_Sym__Sym* f_f; struct E_Sym__Sym* f_ctor; struct E_Coll__Option__I64* f_bytes; struct E_Mem__Mult* f_m; } C_Mem__Row; uint8_t none_; } u; }; }; +_Static_assert(sizeof(((struct E_Mem__Row*)0)->u.C_Mem__Row) == 48, "srs layout"); struct E_Coll__List__Mem__Row { union { uint8_t tag; union { struct { uint8_t t_; struct E_Mem__Row* f_h; struct E_Coll__List__Mem__Row* f_t; } C_Coll__Cons; uint8_t none_; } u; }; }; _Static_assert(sizeof(((struct E_Coll__List__Mem__Row*)0)->u.C_Coll__Cons) == 24, "srs layout"); -struct E_Mem__Block { union { uint8_t tag; union { struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_x; struct E_Sym__Sym* f_h; struct E_Coll__List__Mem__Row* f_rows; } C_Mem__Block; uint8_t none_; } u; }; }; -_Static_assert(sizeof(((struct E_Mem__Block*)0)->u.C_Mem__Block) == 40, "srs layout"); +struct E_Mem__Block { union { uint8_t tag; union { struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_f; struct E_Sym__Sym* f_x; struct E_Sym__Sym* f_h; struct E_Coll__List__Mem__Row* f_rows; struct E_Coll__List__Sym__Sym* f_defs; struct E_Coll__List__I64* f_frees; } C_Mem__Block; uint8_t none_; } u; }; }; +_Static_assert(sizeof(((struct E_Mem__Block*)0)->u.C_Mem__Block) == 64, "srs layout"); +struct E_Coll__List__I64 { union { uint8_t tag; union { struct { uint8_t t_; int64_t f_h; struct E_Coll__List__I64* f_t; } C_Coll__Cons; uint8_t none_; } u; }; }; +_Static_assert(sizeof(((struct E_Coll__List__I64*)0)->u.C_Coll__Cons) == 24, "srs layout"); struct E_Coll__List__Mem__Block { union { uint8_t tag; union { struct { uint8_t t_; struct E_Mem__Block* f_h; struct E_Coll__List__Mem__Block* f_t; } C_Coll__Cons; uint8_t none_; } u; }; }; _Static_assert(sizeof(((struct E_Coll__List__Mem__Block*)0)->u.C_Coll__Cons) == 24, "srs layout"); -struct E_Mem__Report { union { uint8_t tag; union { struct { uint8_t t_; struct E_Coll__List__Mem__Block* f_bs; struct E_Coll__List__Mem__Reuse* f_rs; struct E_Coll__List__Mem__Compact* f_cs; } C_Mem__Ok; struct { uint8_t t_; struct E_Sym__Sym* f_rel; } C_Mem__RulesBad; uint8_t none_; } u; }; }; -_Static_assert(sizeof(((struct E_Mem__Report*)0)->u.C_Mem__Ok) == 32, "srs layout"); +struct E_Mem__FreeAt { union { uint8_t tag; union { struct { uint8_t t_; struct E_Sym__Sym* f_f; int64_t f_line; struct E_Sym__Sym* f_x; } C_Mem__FreeAt; uint8_t none_; } u; }; }; +_Static_assert(sizeof(((struct E_Mem__FreeAt*)0)->u.C_Mem__FreeAt) == 32, "srs layout"); +struct E_Coll__List__Mem__FreeAt { union { uint8_t tag; union { struct { uint8_t t_; struct E_Mem__FreeAt* f_h; struct E_Coll__List__Mem__FreeAt* f_t; } C_Coll__Cons; uint8_t none_; } u; }; }; +_Static_assert(sizeof(((struct E_Coll__List__Mem__FreeAt*)0)->u.C_Coll__Cons) == 24, "srs layout"); +struct E_Mem__Report { union { uint8_t tag; union { struct { uint8_t t_; struct E_Coll__List__Mem__Block* f_bs; struct E_Coll__List__Mem__FreeAt* f_pf; struct E_Coll__List__Mem__Reuse* f_rs; struct E_Coll__List__Mem__Compact* f_cs; } C_Mem__Ok; struct { uint8_t t_; struct E_Sym__Sym* f_rel; } C_Mem__RulesBad; uint8_t none_; } u; }; }; +_Static_assert(sizeof(((struct E_Mem__Report*)0)->u.C_Mem__Ok) == 40, "srs layout"); _Static_assert(sizeof(((struct E_Mem__Report*)0)->u.C_Mem__RulesBad) == 16, "srs layout"); struct E_Flow__Clash { union { uint8_t tag; union { struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__Stuck; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__Split; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__Unended; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__Ambig; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__ExitBad; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__NoSol; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__Dead; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__Escape; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_x; } C_Flow__Stale; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__MsState; struct { uint8_t t_; int64_t f_line; struct E_Sym__Sym* f_cap; } C_Flow__Bound; uint8_t none_; } u; }; }; _Static_assert(sizeof(((struct E_Flow__Clash*)0)->u.C_Flow__Stuck) == 24, "srs layout"); @@ -1298,8 +1306,6 @@ struct E_Coll__BTree__Coll__List_1_D__Row { union { uint8_t tag; union { struct _Static_assert(sizeof(((struct E_Coll__BTree__Coll__List_1_D__Row*)0)->u.C_Coll__B2) == 40, "srs layout"); _Static_assert(sizeof(((struct E_Coll__BTree__Coll__List_1_D__Row*)0)->u.C_Coll__B3) == 64, "srs layout"); _Static_assert(sizeof(((struct E_Coll__BTree__Coll__List_1_D__Row*)0)->u.C_Coll__B4) == 88, "srs layout"); -struct E_Coll__List__I64 { union { uint8_t tag; union { struct { uint8_t t_; int64_t f_h; struct E_Coll__List__I64* f_t; } C_Coll__Cons; uint8_t none_; } u; }; }; -_Static_assert(sizeof(((struct E_Coll__List__I64*)0)->u.C_Coll__Cons) == 24, "srs layout"); struct E_Coll__List__D__RelRef { union { uint8_t tag; union { struct { uint8_t t_; struct E_D__RelRef* f_h; struct E_Coll__List__D__RelRef* f_t; } C_Coll__Cons; uint8_t none_; } u; }; }; _Static_assert(sizeof(((struct E_Coll__List__D__RelRef*)0)->u.C_Coll__Cons) == 24, "srs layout"); struct E_Coll__List__Tl__Err { union { uint8_t tag; union { struct { uint8_t t_; struct E_Tl__Err* f_h; struct E_Coll__List__Tl__Err* f_t; } C_Coll__Cons; uint8_t none_; } u; }; }; @@ -2753,8 +2759,12 @@ static const struct E_Mem__Mult N_Mem__Once = { .tag = 0 }; static struct E_Mem__Mult* const P_Mem__Once = (struct E_Mem__Mult*)&N_Mem__Once; static const struct E_Coll__List__Mem__Row N_Coll__Nil__Mem__Row = { .tag = 0 }; static struct E_Coll__List__Mem__Row* const P_Coll__Nil__Mem__Row = (struct E_Coll__List__Mem__Row*)&N_Coll__Nil__Mem__Row; +static const struct E_Coll__List__I64 N_Coll__Nil__I64 = { .tag = 0 }; +static struct E_Coll__List__I64* const P_Coll__Nil__I64 = (struct E_Coll__List__I64*)&N_Coll__Nil__I64; static const struct E_Coll__List__Mem__Block N_Coll__Nil__Mem__Block = { .tag = 0 }; static struct E_Coll__List__Mem__Block* const P_Coll__Nil__Mem__Block = (struct E_Coll__List__Mem__Block*)&N_Coll__Nil__Mem__Block; +static const struct E_Coll__List__Mem__FreeAt N_Coll__Nil__Mem__FreeAt = { .tag = 0 }; +static struct E_Coll__List__Mem__FreeAt* const P_Coll__Nil__Mem__FreeAt = (struct E_Coll__List__Mem__FreeAt*)&N_Coll__Nil__Mem__FreeAt; static const struct E_Coll__List__Flow__Clash N_Coll__Nil__Flow__Clash = { .tag = 0 }; static struct E_Coll__List__Flow__Clash* const P_Coll__Nil__Flow__Clash = (struct E_Coll__List__Flow__Clash*)&N_Coll__Nil__Flow__Clash; static const struct E_Coll__List__Names__Clash N_Coll__Nil__Names__Clash = { .tag = 0 }; @@ -2799,8 +2809,6 @@ static const struct E_Coll__BTree__Coll__BTree_1_Coll__List_1_D__Row N_Coll__BTi static struct E_Coll__BTree__Coll__BTree_1_Coll__List_1_D__Row* const P_Coll__BTip__Coll__BTree_1_Coll__List_1_D__Row = (struct E_Coll__BTree__Coll__BTree_1_Coll__List_1_D__Row*)&N_Coll__BTip__Coll__BTree_1_Coll__List_1_D__Row; static const struct E_Coll__BTree__Coll__List_1_D__Row N_Coll__BTip__Coll__List_1_D__Row = { .tag = 0 }; static struct E_Coll__BTree__Coll__List_1_D__Row* const P_Coll__BTip__Coll__List_1_D__Row = (struct E_Coll__BTree__Coll__List_1_D__Row*)&N_Coll__BTip__Coll__List_1_D__Row; -static const struct E_Coll__List__I64 N_Coll__Nil__I64 = { .tag = 0 }; -static struct E_Coll__List__I64* const P_Coll__Nil__I64 = (struct E_Coll__List__I64*)&N_Coll__Nil__I64; static const struct E_Coll__List__D__RelRef N_Coll__Nil__D__RelRef = { .tag = 0 }; static struct E_Coll__List__D__RelRef* const P_Coll__Nil__D__RelRef = (struct E_Coll__List__D__RelRef*)&N_Coll__Nil__D__RelRef; static const struct E_Coll__List__Tl__Err N_Coll__Nil__Tl__Err = { .tag = 0 }; @@ -5657,9 +5665,20 @@ static struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* f_Coll__runs__I64(struc static struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* f_Coll__runStep__I64(struct E_Coll__List__Coll__KV_1_I64* p_xs, struct E_Coll__Dir* p_d, struct E_Coll__KV__I64* p_h, struct E_Coll__List__Coll__KV_1_I64* p_rt, struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* p_acc); static struct E_Coll__List__Coll__KV_1_I64* f_Coll__closeRun__I64(struct E_Coll__Dir* p_d, struct E_Coll__KV__I64* p_h, struct E_Coll__List__Coll__KV_1_I64* p_rt); static struct E_Coll__List__I64* f_Mem__vals(struct E_Coll__List__Coll__KV_1_I64* p_xs, struct E_Coll__List__I64* p_acc); -static struct E_Coll__List__Mem__Block* f_Mem__blocks(struct E_Mem__Model* p_md, struct E_Coll__SMap__I64* p_cs, struct E_Coll__List__Mem__Edge* p_free, struct E_Coll__IMap__Mem__Site* p_ss, int64_t p_ns, struct E_Coll__IMap__Mem__Region* p_rs, struct E_Coll__List__I64* p_ids, struct E_Coll__List__Mem__Block* p_acc); +static struct E_Coll__List__Mem__Block* f_Mem__blocks(struct E_Mem__Model* p_md, struct E_Coll__SMap__I64* p_cs, struct E_Coll__List__Mem__Edge* p_free, struct E_Coll__IMap__Mem__Site* p_ss, int64_t p_ns, struct E_Coll__IMap__Mem__Region* p_rs, struct E_Coll__List__Mem__FreeAt* p_mf, struct E_Coll__List__I64* p_ids, struct E_Coll__List__Mem__Block* p_acc); static struct E_Coll__List__Mem__Block* f_Coll__rev__Mem__Block(struct E_Coll__List__Mem__Block* p_xs); static struct E_Coll__List__Mem__Block* f_Coll__revOnto__Mem__Block(struct E_Coll__List__Mem__Block* p_xs, struct E_Coll__List__Mem__Block* p_acc); +static struct E_Coll__List__Sym__Sym* f_Mem__rowDefs(struct E_Coll__List__Mem__Row* p_rows, struct E_Coll__SMap__Bool* p_seen, struct E_Coll__List__Sym__Sym* p_acc); +static struct E_Coll__List__I64* f_Mem__freeLines(struct E_Coll__List__Mem__FreeAt* p_mf, struct E_Sym__Sym* p_f, struct E_Sym__Sym* p_x, int64_t p_line, struct E_Coll__List__I64* p_acc); +static struct E_Coll__List__Mem__FreeAt* f_Mem__paramFrees(struct E_Coll__List__Mem__FreeAt* p_mf, struct E_Coll__List__Mem__Block* p_bs, struct E_Coll__List__Mem__FreeAt* p_acc); +static struct E_Coll__List__Mem__FreeAt* f_Coll__rev__Mem__FreeAt(struct E_Coll__List__Mem__FreeAt* p_xs); +static struct E_Coll__List__Mem__FreeAt* f_Coll__revOnto__Mem__FreeAt(struct E_Coll__List__Mem__FreeAt* p_xs, struct E_Coll__List__Mem__FreeAt* p_acc); +static bool f_Mem__freedIn(struct E_Mem__FreeAt* p_m, struct E_Coll__List__Mem__Block* p_bs); +static struct E_Coll__List__Mem__FreeAt* f_Mem__manualFrees(struct E_Coll__List__Ast__Fn* p_fs, struct E_Coll__List__Mem__FreeAt* p_acc); +static struct E_Coll__List__Mem__FreeAt* f_Mem__mfx(struct E_Sym__Sym* p_f, struct E_Ast__Expr* p_e, struct E_Coll__List__Mem__FreeAt* p_acc); +static struct E_Coll__List__Mem__FreeAt* f_Mem__mfxs(struct E_Sym__Sym* p_f, struct E_Coll__List__Ast__Expr* p_es, struct E_Coll__List__Mem__FreeAt* p_acc); +static struct E_Coll__List__Mem__FreeAt* f_Mem__mfArms(struct E_Sym__Sym* p_f, struct E_Coll__List__Ast__Arm* p_arms, struct E_Coll__List__Mem__FreeAt* p_acc); +static struct E_Coll__List__Mem__FreeAt* f_Mem__mfStmts(struct E_Sym__Sym* p_f, struct E_Coll__List__Ast__Stmt* p_ss, struct E_Coll__List__Mem__FreeAt* p_acc); static struct E_Coll__List__Mem__Row* f_Mem__rows(struct E_Mem__Model* p_md, struct E_Coll__SMap__I64* p_cs, struct E_Coll__List__Mem__Edge* p_free, struct E_Coll__IMap__Mem__Site* p_ss, struct E_Coll__List__I64* p_ids, struct E_Coll__List__Mem__Row* p_acc); static struct E_Coll__List__Mem__Row* f_Coll__rev__Mem__Row(struct E_Coll__List__Mem__Row* p_xs); static struct E_Coll__List__Mem__Row* f_Coll__revOnto__Mem__Row(struct E_Coll__List__Mem__Row* p_xs, struct E_Coll__List__Mem__Row* p_acc); @@ -6683,6 +6702,8 @@ static int64_t f_S2c__showNames(struct E_Coll__List__S2c__File* p_fs, struct E_C static int64_t f_S2c__showFlow(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Flow__Clash* p_cs); static int64_t f_S2c__internal(srs_str p_phase, struct E_Sym__Sym* p_rel); static int64_t f_S2c__mem(struct E_Coll__List__S2c__File* p_fs, struct E_Mem__Report* p_r); +static int64_t f_Coll__length__Mem__Block(struct E_Coll__List__Mem__Block* p_xs); +static int64_t f_Coll__lengthFrom__Mem__Block(struct E_Coll__List__Mem__Block* p_xs, int64_t p_n); static int64_t f_S2c__jStr(srs_str p_s); static int64_t f_S2c__jBody(srs_str p_s); static bool f_S2c__jPlain(srs_str p_s, int64_t p_i, int64_t p_n); @@ -6694,6 +6715,10 @@ static int64_t f_S2c__jSym(struct E_Sym__Sym* p_x); static int64_t f_S2c__jAt(struct E_Coll__List__S2c__File* p_fs, int64_t p_line); static int64_t f_S2c__jSep(bool p_first); static int64_t f_S2c__jRegions(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Block* p_bs, int64_t p_id); +static int64_t f_S2c__jSyms(struct E_Coll__List__Sym__Sym* p_xs, bool p_first); +static int64_t f_S2c__jFrees(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Block* p_bs, int64_t p_id); +static int64_t f_S2c__jManual(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__I64* p_ls, int64_t p_id); +static int64_t f_S2c__jParamFrees(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__FreeAt* p_pf, bool p_first); static struct E_S2c__MemCount* f_S2c__jBlocks(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Block* p_bs, int64_t p_region, struct E_S2c__MemCount* p_c); static struct E_S2c__MemCount* f_S2c__jRows(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Row* p_rows, int64_t p_region, struct E_S2c__MemCount* p_c); static int64_t f_S2c__jBytes(struct E_Coll__Option__I64* p_b); @@ -8566,7 +8591,7 @@ static struct E_Coll__List__Ast__Fn* f_Mem__fnList(struct E_Coll__List__Ast__Dec static struct E_Coll__List__Ast__Fn* f_Coll__rev__Ast__Fn(struct E_Coll__List__Ast__Fn* p_xs) { return f_Coll__revOnto__Ast__Fn(p_xs, P_Coll__Nil__Ast__Fn); } static struct E_Coll__List__Ast__Fn* f_Coll__revOnto__Ast__Fn(struct E_Coll__List__Ast__Fn* p_xs, struct E_Coll__List__Ast__Fn* p_acc) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_h_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_t_1 = s0->u.C_Coll__Cons.f_t; ({ struct E_Coll__List__Ast__Fn* t0 = v_t_1; struct E_Coll__List__Ast__Fn* t1 = ({ struct E_Coll__List__Ast__Fn* o2 = (struct E_Coll__List__Ast__Fn*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Ast__Fn, u) + sizeof(((struct E_Coll__List__Ast__Fn*)0)->u.C_Coll__Cons))); o2->u.C_Coll__Cons.t_ = 1; o2->u.C_Coll__Cons.f_h = v_h_0; o2->u.C_Coll__Cons.f_t = p_acc; o2; }); p_xs = t0; p_acc = t1; goto srs_tail; (struct E_Coll__List__Ast__Fn*){0}; }); }); }); } static struct E_Coll__List__D__Fact* f_Mem__multis(struct E_Coll__List__Ast__Fn* p_fns, struct E_Coll__SMap__I64* p_cs, struct E_Coll__List__D__Fact* p_acc) { srs_tail: return ({ __auto_type s0 = p_fns; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_f_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_f_0; ({ __auto_type v_n_2 = s2->u.C_Ast__Fn.f_name; ({ __auto_type res_ = ({ struct E_Coll__List__Ast__Fn* t0 = v_rest_1; struct E_Coll__SMap__I64* t1 = p_cs; struct E_Coll__List__D__Fact* t2 = ((f_Mem__count(p_cs, v_n_2) >= ((int64_t)2)) ? ({ struct E_Coll__List__D__Fact* o3 = (struct E_Coll__List__D__Fact*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__D__Fact, u) + sizeof(((struct E_Coll__List__D__Fact*)0)->u.C_Coll__Cons))); o3->u.C_Coll__Cons.t_ = 1; o3->u.C_Coll__Cons.f_h = f_Mem__f1(P_Mem__RMulti, ({ struct E_D__Val* o3 = (struct E_D__Val*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_D__Val, u) + sizeof(((struct E_D__Val*)0)->u.C_D__VSym))); o3->u.C_D__VSym.t_ = 0; o3->u.C_D__VSym.f_s = v_n_2; o3; })); o3->u.C_Coll__Cons.f_t = p_acc; o3; }) : p_acc); p_fns = t0; p_cs = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__D__Fact*){0}; }); res_; }); }); }); res_; }); }); }); } -static struct E_Mem__Report* f_Mem__report(struct E_Coll__List__Ast__Decl* p_ds, struct E_Coll__List__Emit__SiteB* p_sb) { return ({ struct E_Coll__List__Ast__Fn* v_fl_0 = f_Mem__fnList(p_ds, P_Coll__Nil__Ast__Fn); struct E_Mem__Cx* v_cx_1 = ({ struct E_Mem__Cx* o1 = (struct E_Mem__Cx*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Cx, u) + sizeof(((struct E_Mem__Cx*)0)->u.C_Mem__Cx))); o1->u.C_Mem__Cx.t_ = 0; o1->u.C_Mem__Cx.f_fns = f_Ty__idxFns(v_fl_0, f_Coll__sEmpty__Ast__Fn()); o1->u.C_Mem__Cx.f_ctors = f_Mem__ctors(p_ds, f_Coll__sEmpty__Coll__List_1_Ast__Binder()); o1->u.C_Mem__Cx.f_regionHs = f_Mem__regionHs(p_ds, f_Coll__sEmpty__Bool()); o1->u.C_Mem__Cx.f_ss = f_Eff__syms(); o1; }); struct E_Mem__W* v_w_2 = f_Mem__decls(v_cx_1, ({ struct E_Mem__W* o2 = (struct E_Mem__W*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__W, u) + sizeof(((struct E_Mem__W*)0)->u.C_Mem__W))); o2->u.C_Mem__W.t_ = 0; o2->u.C_Mem__W.f_sites = P_Coll__Tip__Mem__Site; o2->u.C_Mem__W.f_ns = ((int64_t)0); o2->u.C_Mem__W.f_regions = P_Coll__Tip__Mem__Region; o2->u.C_Mem__W.f_nr = ((int64_t)0); o2->u.C_Mem__W.f_facts = P_Coll__Nil__D__Fact; o2->u.C_Mem__W.f_calls = f_Coll__sEmpty__I64(); o2->u.C_Mem__W.f_free = P_Coll__Nil__Mem__Edge; o2; }), p_ds); __auto_type res_ = ({ __auto_type s3 = v_w_2; ({ __auto_type v_sites_3 = s3->u.C_Mem__W.f_sites; __auto_type v_ns_4 = s3->u.C_Mem__W.f_ns; __auto_type v_regions_5 = s3->u.C_Mem__W.f_regions; __auto_type v_nr_6 = s3->u.C_Mem__W.f_nr; __auto_type v_fs_7 = s3->u.C_Mem__W.f_facts; __auto_type v_cs_8 = s3->u.C_Mem__W.f_calls; __auto_type v_free_9 = s3->u.C_Mem__W.f_free; ({ struct E_Coll__List__D__Fact* v_facts_10 = ({ struct E_Coll__List__D__Fact* o10 = (struct E_Coll__List__D__Fact*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__D__Fact, u) + sizeof(((struct E_Coll__List__D__Fact*)0)->u.C_Coll__Cons))); o10->u.C_Coll__Cons.t_ = 1; o10->u.C_Coll__Cons.f_h = f_Mem__f1(P_Mem__RReached, ({ struct E_D__Val* o10 = (struct E_D__Val*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_D__Val, u) + sizeof(((struct E_D__Val*)0)->u.C_D__VSym))); o10->u.C_D__VSym.t_ = 0; o10->u.C_D__VSym.f_s = f_Sym__of(((srs_str){(const uint8_t*)"main", 4})); o10; })); o10->u.C_Coll__Cons.f_t = f_Mem__multis(v_fl_0, v_cs_8, v_fs_7); o10; }); struct E_Coll__List__Ast__Fn* v_dfs_11 = f_Mem__dispatchFns(p_ds, P_Coll__Nil__Ast__Fn); __auto_type res_ = ({ __auto_type s12 = f_Mem__eDecls(v_cx_1, ({ struct E_Mem__EW* o12 = (struct E_Mem__EW*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__EW, u) + sizeof(((struct E_Mem__EW*)0)->u.C_Mem__EW))); o12->u.C_Mem__EW.t_ = 0; o12->u.C_Mem__EW.f_facts = P_Coll__Nil__Mem__EF; o12->u.C_Mem__EW.f_n = ((int64_t)0); o12->u.C_Mem__EW.f_sites = P_Coll__Nil__Mem__ESite; o12; }), f_Coll__revOnto__Ast__Decl(f_Mem__asDecls(v_dfs_11, P_Coll__Nil__Ast__Decl), p_ds)); ({ __auto_type v_efs_12 = s12->u.C_Mem__EW.f_facts; __auto_type v_esites_13 = s12->u.C_Mem__EW.f_sites; ({ struct E_Mem__IT* v_it_14 = f_Mem__interned(f_Coll__revOnto__Mem__EF(f_Mem__fnSeeds(v_dfs_11, true, f_Mem__fnSeeds(v_fl_0, false, P_Coll__Nil__Mem__EF)), v_efs_12)); struct E_Coll__List__D__Fact* v_all_15 = f_Coll__revOnto__D__Fact(v_facts_10, f_Coll__revOnto__D__Fact(f_Mem__factsOf(v_it_14), f_Mem__siteFacts(f_Mem__siteList(v_sites_3, ((int64_t)0), v_ns_4, P_Coll__Nil__Mem__Site), f_Mem__sFacts(v_fs_7, P_Coll__Nil__D__Fact)))); __auto_type res_ = ({ __auto_type s16 = f_D__solve(f_Coll__revOnto__D__Rule(f_Coll__rev__D__Rule(f_Mem__rules()), f_Coll__revOnto__D__Rule(f_Coll__rev__D__Rule(f_Mem__eRules()), f_Coll__revOnto__D__Rule(f_Coll__rev__D__Rule(f_Mem__sharedRules()), f_Mem__sRules()))), v_all_15); s16->tag == 0 ? ({ __auto_type v_m_16 = s16->u.C_D__Solved.f_m; ({ struct E_Coll__List__Mem__ESiteR* v_esc_17 = f_Mem__marks(v_esites_13, f_Mem__idSet(f_D__tuples(v_m_16, f_Mem__eSym(P_Mem__EEsc)), P_Coll__Tip__Bool), true, P_Coll__Nil__Mem__ESiteR); struct E_Mem__Model* v_md_18 = ({ struct E_Mem__Model* o18 = (struct E_Mem__Model*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Model, u) + sizeof(((struct E_Mem__Model*)0)->u.C_Mem__Model))); o18->u.C_Mem__Model.t_ = 0; o18->u.C_Mem__Model.f_manyDef = f_Mem__names(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RManyDef)), f_Coll__sEmpty__Bool()); o18->u.C_Mem__Model.f_loopCall = f_Mem__names(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RLoopCall)), f_Coll__sEmpty__Bool()); o18->u.C_Mem__Model.f_byRegion = f_Mem__group(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RFills)), P_Coll__Tip__Coll__List_1_I64); o18->u.C_Mem__Model.f_live = f_Mem__ints(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RLive)), P_Coll__Nil__I64); o18->u.C_Mem__Model.f_bytes = f_Mem__siteMap(p_sb, P_Coll__Tip__Coll__List_1_Emit__SiteB); o18->u.C_Mem__Model.f_esc = v_esc_17; o18; }); struct E_Coll__List__Mem__Reuse* v_reuse_19 = f_Mem__scanFns(f_Mem__caseEnums(p_ds, f_Coll__sEmpty__Sym__Sym()), v_cx_1, f_Mem__sharedSet(f_Mem__varMap(v_it_14), f_D__tuples(v_m_16, f_Mem__s7(P_Mem__RShared7)), f_Coll__sEmpty__Coll__SMap_1_Bool()), v_fl_0, P_Coll__Nil__Mem__Reuse); struct E_Coll__SMap__Bool* v_need_20 = f_Mem__names(f_D__tuples(v_m_16, f_Mem__sSym(P_Mem__SNeed)), f_Coll__sEmpty__Bool()); struct E_Coll__SMap__Bool* v_skip_21 = f_Mem__names(f_D__tuples(v_m_16, f_Mem__sSym(P_Mem__SRunSink)), f_Mem__names(f_D__tuples(v_m_16, f_Mem__sSym(P_Mem__SSelf)), f_Mem__regionDefs(v_regions_5, ((int64_t)0), v_nr_6, f_Coll__sEmpty__Bool()))); struct E_Coll__List__Mem__Compact* v_compact_22 = f_Mem__pickCompacts(v_need_20, v_skip_21, f_Mem__names(f_D__tuples(v_m_16, f_Mem__sSym(P_Mem__SNewRet)), f_Coll__sEmpty__Bool()), v_fl_0, P_Coll__Nil__Mem__Compact); __auto_type res_ = ({ struct E_Mem__Report* o23 = (struct E_Mem__Report*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Report, u) + sizeof(((struct E_Mem__Report*)0)->u.C_Mem__Ok))); o23->u.C_Mem__Ok.t_ = 0; o23->u.C_Mem__Ok.f_bs = f_Mem__blocks(v_md_18, v_cs_8, v_free_9, v_sites_3, v_ns_4, v_regions_5, f_Mem__byLine(f_Mem__regionKeys(v_regions_5, v_nr_6, f_Mem__liveOf(v_md_18), P_Coll__Nil__Coll__KV_1_I64)), P_Coll__Nil__Mem__Block); o23->u.C_Mem__Ok.f_rs = f_Mem__byReuseLine(v_reuse_19); o23->u.C_Mem__Ok.f_cs = f_Mem__reachedOnly(v_compact_22, f_Mem__names(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RReached)), f_Coll__sEmpty__Bool()), P_Coll__Nil__Mem__Compact); o23; }); res_; }); }) : s16->tag == 1 ? ({ __auto_type v_rel_16 = s16->u.C_D__Unsafe.f_rel; ({ struct E_Mem__Report* o17 = (struct E_Mem__Report*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Report, u) + sizeof(((struct E_Mem__Report*)0)->u.C_Mem__RulesBad))); o17->u.C_Mem__RulesBad.t_ = 1; o17->u.C_Mem__RulesBad.f_rel = v_rel_16; o17; }); }) : ({ __auto_type v_rel_16 = s16->u.C_D__NegCycle.f_rel; ({ struct E_Mem__Report* o17 = (struct E_Mem__Report*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Report, u) + sizeof(((struct E_Mem__Report*)0)->u.C_Mem__RulesBad))); o17->u.C_Mem__RulesBad.t_ = 1; o17->u.C_Mem__RulesBad.f_rel = v_rel_16; o17; }); }); }); res_; }); }); }); res_; }); }); }); res_; }); } +static struct E_Mem__Report* f_Mem__report(struct E_Coll__List__Ast__Decl* p_ds, struct E_Coll__List__Emit__SiteB* p_sb) { return ({ struct E_Coll__List__Ast__Fn* v_fl_0 = f_Mem__fnList(p_ds, P_Coll__Nil__Ast__Fn); struct E_Mem__Cx* v_cx_1 = ({ struct E_Mem__Cx* o1 = (struct E_Mem__Cx*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Cx, u) + sizeof(((struct E_Mem__Cx*)0)->u.C_Mem__Cx))); o1->u.C_Mem__Cx.t_ = 0; o1->u.C_Mem__Cx.f_fns = f_Ty__idxFns(v_fl_0, f_Coll__sEmpty__Ast__Fn()); o1->u.C_Mem__Cx.f_ctors = f_Mem__ctors(p_ds, f_Coll__sEmpty__Coll__List_1_Ast__Binder()); o1->u.C_Mem__Cx.f_regionHs = f_Mem__regionHs(p_ds, f_Coll__sEmpty__Bool()); o1->u.C_Mem__Cx.f_ss = f_Eff__syms(); o1; }); struct E_Mem__W* v_w_2 = f_Mem__decls(v_cx_1, ({ struct E_Mem__W* o2 = (struct E_Mem__W*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__W, u) + sizeof(((struct E_Mem__W*)0)->u.C_Mem__W))); o2->u.C_Mem__W.t_ = 0; o2->u.C_Mem__W.f_sites = P_Coll__Tip__Mem__Site; o2->u.C_Mem__W.f_ns = ((int64_t)0); o2->u.C_Mem__W.f_regions = P_Coll__Tip__Mem__Region; o2->u.C_Mem__W.f_nr = ((int64_t)0); o2->u.C_Mem__W.f_facts = P_Coll__Nil__D__Fact; o2->u.C_Mem__W.f_calls = f_Coll__sEmpty__I64(); o2->u.C_Mem__W.f_free = P_Coll__Nil__Mem__Edge; o2; }), p_ds); __auto_type res_ = ({ __auto_type s3 = v_w_2; ({ __auto_type v_sites_3 = s3->u.C_Mem__W.f_sites; __auto_type v_ns_4 = s3->u.C_Mem__W.f_ns; __auto_type v_regions_5 = s3->u.C_Mem__W.f_regions; __auto_type v_nr_6 = s3->u.C_Mem__W.f_nr; __auto_type v_fs_7 = s3->u.C_Mem__W.f_facts; __auto_type v_cs_8 = s3->u.C_Mem__W.f_calls; __auto_type v_free_9 = s3->u.C_Mem__W.f_free; ({ struct E_Coll__List__D__Fact* v_facts_10 = ({ struct E_Coll__List__D__Fact* o10 = (struct E_Coll__List__D__Fact*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__D__Fact, u) + sizeof(((struct E_Coll__List__D__Fact*)0)->u.C_Coll__Cons))); o10->u.C_Coll__Cons.t_ = 1; o10->u.C_Coll__Cons.f_h = f_Mem__f1(P_Mem__RReached, ({ struct E_D__Val* o10 = (struct E_D__Val*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_D__Val, u) + sizeof(((struct E_D__Val*)0)->u.C_D__VSym))); o10->u.C_D__VSym.t_ = 0; o10->u.C_D__VSym.f_s = f_Sym__of(((srs_str){(const uint8_t*)"main", 4})); o10; })); o10->u.C_Coll__Cons.f_t = f_Mem__multis(v_fl_0, v_cs_8, v_fs_7); o10; }); struct E_Coll__List__Ast__Fn* v_dfs_11 = f_Mem__dispatchFns(p_ds, P_Coll__Nil__Ast__Fn); __auto_type res_ = ({ __auto_type s12 = f_Mem__eDecls(v_cx_1, ({ struct E_Mem__EW* o12 = (struct E_Mem__EW*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__EW, u) + sizeof(((struct E_Mem__EW*)0)->u.C_Mem__EW))); o12->u.C_Mem__EW.t_ = 0; o12->u.C_Mem__EW.f_facts = P_Coll__Nil__Mem__EF; o12->u.C_Mem__EW.f_n = ((int64_t)0); o12->u.C_Mem__EW.f_sites = P_Coll__Nil__Mem__ESite; o12; }), f_Coll__revOnto__Ast__Decl(f_Mem__asDecls(v_dfs_11, P_Coll__Nil__Ast__Decl), p_ds)); ({ __auto_type v_efs_12 = s12->u.C_Mem__EW.f_facts; __auto_type v_esites_13 = s12->u.C_Mem__EW.f_sites; ({ struct E_Mem__IT* v_it_14 = f_Mem__interned(f_Coll__revOnto__Mem__EF(f_Mem__fnSeeds(v_dfs_11, true, f_Mem__fnSeeds(v_fl_0, false, P_Coll__Nil__Mem__EF)), v_efs_12)); struct E_Coll__List__D__Fact* v_all_15 = f_Coll__revOnto__D__Fact(v_facts_10, f_Coll__revOnto__D__Fact(f_Mem__factsOf(v_it_14), f_Mem__siteFacts(f_Mem__siteList(v_sites_3, ((int64_t)0), v_ns_4, P_Coll__Nil__Mem__Site), f_Mem__sFacts(v_fs_7, P_Coll__Nil__D__Fact)))); __auto_type res_ = ({ __auto_type s16 = f_D__solve(f_Coll__revOnto__D__Rule(f_Coll__rev__D__Rule(f_Mem__rules()), f_Coll__revOnto__D__Rule(f_Coll__rev__D__Rule(f_Mem__eRules()), f_Coll__revOnto__D__Rule(f_Coll__rev__D__Rule(f_Mem__sharedRules()), f_Mem__sRules()))), v_all_15); s16->tag == 0 ? ({ __auto_type v_m_16 = s16->u.C_D__Solved.f_m; ({ struct E_Coll__List__Mem__ESiteR* v_esc_17 = f_Mem__marks(v_esites_13, f_Mem__idSet(f_D__tuples(v_m_16, f_Mem__eSym(P_Mem__EEsc)), P_Coll__Tip__Bool), true, P_Coll__Nil__Mem__ESiteR); struct E_Mem__Model* v_md_18 = ({ struct E_Mem__Model* o18 = (struct E_Mem__Model*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Model, u) + sizeof(((struct E_Mem__Model*)0)->u.C_Mem__Model))); o18->u.C_Mem__Model.t_ = 0; o18->u.C_Mem__Model.f_manyDef = f_Mem__names(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RManyDef)), f_Coll__sEmpty__Bool()); o18->u.C_Mem__Model.f_loopCall = f_Mem__names(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RLoopCall)), f_Coll__sEmpty__Bool()); o18->u.C_Mem__Model.f_byRegion = f_Mem__group(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RFills)), P_Coll__Tip__Coll__List_1_I64); o18->u.C_Mem__Model.f_live = f_Mem__ints(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RLive)), P_Coll__Nil__I64); o18->u.C_Mem__Model.f_bytes = f_Mem__siteMap(p_sb, P_Coll__Tip__Coll__List_1_Emit__SiteB); o18->u.C_Mem__Model.f_esc = v_esc_17; o18; }); struct E_Coll__List__Mem__Reuse* v_reuse_19 = f_Mem__scanFns(f_Mem__caseEnums(p_ds, f_Coll__sEmpty__Sym__Sym()), v_cx_1, f_Mem__sharedSet(f_Mem__varMap(v_it_14), f_D__tuples(v_m_16, f_Mem__s7(P_Mem__RShared7)), f_Coll__sEmpty__Coll__SMap_1_Bool()), v_fl_0, P_Coll__Nil__Mem__Reuse); struct E_Coll__SMap__Bool* v_need_20 = f_Mem__names(f_D__tuples(v_m_16, f_Mem__sSym(P_Mem__SNeed)), f_Coll__sEmpty__Bool()); struct E_Coll__SMap__Bool* v_skip_21 = f_Mem__names(f_D__tuples(v_m_16, f_Mem__sSym(P_Mem__SRunSink)), f_Mem__names(f_D__tuples(v_m_16, f_Mem__sSym(P_Mem__SSelf)), f_Mem__regionDefs(v_regions_5, ((int64_t)0), v_nr_6, f_Coll__sEmpty__Bool()))); struct E_Coll__List__Mem__Compact* v_compact_22 = f_Mem__pickCompacts(v_need_20, v_skip_21, f_Mem__names(f_D__tuples(v_m_16, f_Mem__sSym(P_Mem__SNewRet)), f_Coll__sEmpty__Bool()), v_fl_0, P_Coll__Nil__Mem__Compact); struct E_Coll__List__Mem__FreeAt* v_mf_23 = f_Mem__manualFrees(v_fl_0, P_Coll__Nil__Mem__FreeAt); struct E_Coll__List__Mem__Block* v_bs_24 = f_Mem__blocks(v_md_18, v_cs_8, v_free_9, v_sites_3, v_ns_4, v_regions_5, v_mf_23, f_Mem__byLine(f_Mem__regionKeys(v_regions_5, v_nr_6, f_Mem__liveOf(v_md_18), P_Coll__Nil__Coll__KV_1_I64)), P_Coll__Nil__Mem__Block); __auto_type res_ = ({ struct E_Mem__Report* o25 = (struct E_Mem__Report*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Report, u) + sizeof(((struct E_Mem__Report*)0)->u.C_Mem__Ok))); o25->u.C_Mem__Ok.t_ = 0; o25->u.C_Mem__Ok.f_bs = v_bs_24; o25->u.C_Mem__Ok.f_pf = f_Mem__paramFrees(v_mf_23, v_bs_24, P_Coll__Nil__Mem__FreeAt); o25->u.C_Mem__Ok.f_rs = f_Mem__byReuseLine(v_reuse_19); o25->u.C_Mem__Ok.f_cs = f_Mem__reachedOnly(v_compact_22, f_Mem__names(f_D__tuples(v_m_16, f_Mem__relSym(P_Mem__RReached)), f_Coll__sEmpty__Bool()), P_Coll__Nil__Mem__Compact); o25; }); res_; }); }) : s16->tag == 1 ? ({ __auto_type v_rel_16 = s16->u.C_D__Unsafe.f_rel; ({ struct E_Mem__Report* o17 = (struct E_Mem__Report*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Report, u) + sizeof(((struct E_Mem__Report*)0)->u.C_Mem__RulesBad))); o17->u.C_Mem__RulesBad.t_ = 1; o17->u.C_Mem__RulesBad.f_rel = v_rel_16; o17; }); }) : ({ __auto_type v_rel_16 = s16->u.C_D__NegCycle.f_rel; ({ struct E_Mem__Report* o17 = (struct E_Mem__Report*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Report, u) + sizeof(((struct E_Mem__Report*)0)->u.C_Mem__RulesBad))); o17->u.C_Mem__RulesBad.t_ = 1; o17->u.C_Mem__RulesBad.f_rel = v_rel_16; o17; }); }); }); res_; }); }); }); res_; }); }); }); res_; }); } static struct E_Coll__SMap__Coll__List_1_Ast__Binder* f_Coll__sEmpty__Coll__List_1_Ast__Binder(void) { return ({ struct E_Coll__SMap__Coll__List_1_Ast__Binder* o0 = (struct E_Coll__SMap__Coll__List_1_Ast__Binder*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__SMap__Coll__List_1_Ast__Binder, u) + sizeof(((struct E_Coll__SMap__Coll__List_1_Ast__Binder*)0)->u.C_Coll__SMap))); o0->u.C_Coll__SMap.t_ = 0; o0->u.C_Coll__SMap.f_t = P_Coll__BTip__Coll__List_1_Coll__SEntry_1_Coll__List_1_Ast__Binder; o0; }); } static struct E_Coll__List__Ast__Decl* f_Coll__revOnto__Ast__Decl(struct E_Coll__List__Ast__Decl* p_xs, struct E_Coll__List__Ast__Decl* p_acc) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_h_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_t_1 = s0->u.C_Coll__Cons.f_t; ({ struct E_Coll__List__Ast__Decl* t0 = v_t_1; struct E_Coll__List__Ast__Decl* t1 = ({ struct E_Coll__List__Ast__Decl* o2 = (struct E_Coll__List__Ast__Decl*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Ast__Decl, u) + sizeof(((struct E_Coll__List__Ast__Decl*)0)->u.C_Coll__Cons))); o2->u.C_Coll__Cons.t_ = 1; o2->u.C_Coll__Cons.f_h = v_h_0; o2->u.C_Coll__Cons.f_t = p_acc; o2; }); p_xs = t0; p_acc = t1; goto srs_tail; (struct E_Coll__List__Ast__Decl*){0}; }); }); }); } static struct E_Coll__List__Mem__EF* f_Coll__revOnto__Mem__EF(struct E_Coll__List__Mem__EF* p_xs, struct E_Coll__List__Mem__EF* p_acc) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_h_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_t_1 = s0->u.C_Coll__Cons.f_t; ({ struct E_Coll__List__Mem__EF* t0 = v_t_1; struct E_Coll__List__Mem__EF* t1 = ({ struct E_Coll__List__Mem__EF* o2 = (struct E_Coll__List__Mem__EF*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__EF, u) + sizeof(((struct E_Coll__List__Mem__EF*)0)->u.C_Coll__Cons))); o2->u.C_Coll__Cons.t_ = 1; o2->u.C_Coll__Cons.f_h = v_h_0; o2->u.C_Coll__Cons.f_t = p_acc; o2; }); p_xs = t0; p_acc = t1; goto srs_tail; (struct E_Coll__List__Mem__EF*){0}; }); }); }); } @@ -8597,10 +8622,21 @@ static struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* f_Coll__runs__I64(struc static struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* f_Coll__runStep__I64(struct E_Coll__List__Coll__KV_1_I64* p_xs, struct E_Coll__Dir* p_d, struct E_Coll__KV__I64* p_h, struct E_Coll__List__Coll__KV_1_I64* p_rt, struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* p_acc) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ ({ struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* o0 = (struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Coll__List_1_Coll__KV_1_I64, u) + sizeof(((struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*)0)->u.C_Coll__Cons))); o0->u.C_Coll__Cons.t_ = 1; o0->u.C_Coll__Cons.f_h = f_Coll__closeRun__I64(p_d, p_h, p_rt); o0->u.C_Coll__Cons.f_t = p_acc; o0; }); }) : ({ __auto_type v_y_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_t_1 = s0->u.C_Coll__Cons.f_t; ({ int64_t v_ky_2 = f_Coll__kvKey__I64(v_y_0); int64_t v_kh_3 = f_Coll__kvKey__I64(p_h); __auto_type res_ = ({ __auto_type s4 = p_d; s4->tag == 0 ? ({ ({ __auto_type res_ = ((v_ky_2 > v_kh_3) ? ({ struct E_Coll__List__Coll__KV_1_I64* t0 = v_t_1; struct E_Coll__Dir* t1 = p_d; struct E_Coll__KV__I64* t2 = v_y_0; struct E_Coll__List__Coll__KV_1_I64* t3 = ({ struct E_Coll__List__Coll__KV_1_I64* o4 = (struct E_Coll__List__Coll__KV_1_I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Coll__KV_1_I64, u) + sizeof(((struct E_Coll__List__Coll__KV_1_I64*)0)->u.C_Coll__Cons))); o4->u.C_Coll__Cons.t_ = 1; o4->u.C_Coll__Cons.f_h = p_h; o4->u.C_Coll__Cons.f_t = p_rt; o4; }); struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* t4 = p_acc; p_xs = t0; p_d = t1; p_h = t2; p_rt = t3; p_acc = t4; goto srs_tail; (struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*){0}; }) : ((v_ky_2 == v_kh_3) ? ({ struct E_Coll__List__Coll__KV_1_I64* t0 = v_t_1; struct E_Coll__Dir* t1 = p_d; struct E_Coll__KV__I64* t2 = v_y_0; struct E_Coll__List__Coll__KV_1_I64* t3 = p_rt; struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* t4 = p_acc; p_xs = t0; p_d = t1; p_h = t2; p_rt = t3; p_acc = t4; goto srs_tail; (struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*){0}; }) : ({ __auto_type s4 = p_rt; s4->tag == 0 ? ({ ({ struct E_Coll__List__Coll__KV_1_I64* t0 = v_t_1; struct E_Coll__Dir* t1 = P_Coll__Down; struct E_Coll__KV__I64* t2 = v_y_0; struct E_Coll__List__Coll__KV_1_I64* t3 = ({ struct E_Coll__List__Coll__KV_1_I64* o4 = (struct E_Coll__List__Coll__KV_1_I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Coll__KV_1_I64, u) + sizeof(((struct E_Coll__List__Coll__KV_1_I64*)0)->u.C_Coll__Cons))); o4->u.C_Coll__Cons.t_ = 1; o4->u.C_Coll__Cons.f_h = p_h; o4->u.C_Coll__Cons.f_t = p_rt; o4; }); struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* t4 = p_acc; p_xs = t0; p_d = t1; p_h = t2; p_rt = t3; p_acc = t4; goto srs_tail; (struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*){0}; }); }) : ({ ({ struct E_Coll__List__Coll__KV_1_I64* t0 = v_t_1; struct E_Coll__Dir* t1 = P_Coll__Up; struct E_Coll__KV__I64* t2 = v_y_0; struct E_Coll__List__Coll__KV_1_I64* t3 = P_Coll__Nil__Coll__KV_1_I64; struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* t4 = ({ struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* o4 = (struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Coll__List_1_Coll__KV_1_I64, u) + sizeof(((struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*)0)->u.C_Coll__Cons))); o4->u.C_Coll__Cons.t_ = 1; o4->u.C_Coll__Cons.f_h = ({ struct E_Coll__List__Coll__KV_1_I64* o4 = (struct E_Coll__List__Coll__KV_1_I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Coll__KV_1_I64, u) + sizeof(((struct E_Coll__List__Coll__KV_1_I64*)0)->u.C_Coll__Cons))); o4->u.C_Coll__Cons.t_ = 1; o4->u.C_Coll__Cons.f_h = p_h; o4->u.C_Coll__Cons.f_t = p_rt; o4; }); o4->u.C_Coll__Cons.f_t = p_acc; o4; }); p_xs = t0; p_d = t1; p_h = t2; p_rt = t3; p_acc = t4; goto srs_tail; (struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*){0}; }); }); }))); res_; }); }) : ({ ({ __auto_type res_ = ((v_ky_2 < v_kh_3) ? ({ struct E_Coll__List__Coll__KV_1_I64* t0 = v_t_1; struct E_Coll__Dir* t1 = p_d; struct E_Coll__KV__I64* t2 = v_y_0; struct E_Coll__List__Coll__KV_1_I64* t3 = ({ struct E_Coll__List__Coll__KV_1_I64* o4 = (struct E_Coll__List__Coll__KV_1_I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Coll__KV_1_I64, u) + sizeof(((struct E_Coll__List__Coll__KV_1_I64*)0)->u.C_Coll__Cons))); o4->u.C_Coll__Cons.t_ = 1; o4->u.C_Coll__Cons.f_h = p_h; o4->u.C_Coll__Cons.f_t = p_rt; o4; }); struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* t4 = p_acc; p_xs = t0; p_d = t1; p_h = t2; p_rt = t3; p_acc = t4; goto srs_tail; (struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*){0}; }) : ({ struct E_Coll__List__Coll__KV_1_I64* t0 = v_t_1; struct E_Coll__Dir* t1 = P_Coll__Up; struct E_Coll__KV__I64* t2 = v_y_0; struct E_Coll__List__Coll__KV_1_I64* t3 = P_Coll__Nil__Coll__KV_1_I64; struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* t4 = ({ struct E_Coll__List__Coll__List_1_Coll__KV_1_I64* o4 = (struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Coll__List_1_Coll__KV_1_I64, u) + sizeof(((struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*)0)->u.C_Coll__Cons))); o4->u.C_Coll__Cons.t_ = 1; o4->u.C_Coll__Cons.f_h = f_Coll__closeRun__I64(p_d, p_h, p_rt); o4->u.C_Coll__Cons.f_t = p_acc; o4; }); p_xs = t0; p_d = t1; p_h = t2; p_rt = t3; p_acc = t4; goto srs_tail; (struct E_Coll__List__Coll__List_1_Coll__KV_1_I64*){0}; })); res_; }); }); }); res_; }); }); }); } static struct E_Coll__List__Coll__KV_1_I64* f_Coll__closeRun__I64(struct E_Coll__Dir* p_d, struct E_Coll__KV__I64* p_h, struct E_Coll__List__Coll__KV_1_I64* p_rt) { return ({ __auto_type s0 = p_d; s0->tag == 0 ? ({ ({ struct E_Coll__List__Coll__KV_1_I64* o0 = (struct E_Coll__List__Coll__KV_1_I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Coll__KV_1_I64, u) + sizeof(((struct E_Coll__List__Coll__KV_1_I64*)0)->u.C_Coll__Cons))); o0->u.C_Coll__Cons.t_ = 1; o0->u.C_Coll__Cons.f_h = p_h; o0->u.C_Coll__Cons.f_t = p_rt; o0; }); }) : ({ f_Coll__revOnto__Coll__KV_1_I64(p_rt, ({ struct E_Coll__List__Coll__KV_1_I64* o0 = (struct E_Coll__List__Coll__KV_1_I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Coll__KV_1_I64, u) + sizeof(((struct E_Coll__List__Coll__KV_1_I64*)0)->u.C_Coll__Cons))); o0->u.C_Coll__Cons.t_ = 1; o0->u.C_Coll__Cons.f_h = p_h; o0->u.C_Coll__Cons.f_t = P_Coll__Nil__Coll__KV_1_I64; o0; })); }); }); } static struct E_Coll__List__I64* f_Mem__vals(struct E_Coll__List__Coll__KV_1_I64* p_xs, struct E_Coll__List__I64* p_acc) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ f_Coll__rev__I64(p_acc); }) : ({ __auto_type v_kv_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_kv_0; ({ __auto_type v_v_2 = s2->u.C_Coll__KV.f_v; ({ __auto_type res_ = ({ struct E_Coll__List__Coll__KV_1_I64* t0 = v_rest_1; struct E_Coll__List__I64* t1 = ({ struct E_Coll__List__I64* o3 = (struct E_Coll__List__I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__I64, u) + sizeof(((struct E_Coll__List__I64*)0)->u.C_Coll__Cons))); o3->u.C_Coll__Cons.t_ = 1; o3->u.C_Coll__Cons.f_h = v_v_2; o3->u.C_Coll__Cons.f_t = p_acc; o3; }); p_xs = t0; p_acc = t1; goto srs_tail; (struct E_Coll__List__I64*){0}; }); res_; }); }); }); res_; }); }); }); } -static struct E_Coll__List__Mem__Block* f_Mem__blocks(struct E_Mem__Model* p_md, struct E_Coll__SMap__I64* p_cs, struct E_Coll__List__Mem__Edge* p_free, struct E_Coll__IMap__Mem__Site* p_ss, int64_t p_ns, struct E_Coll__IMap__Mem__Region* p_rs, struct E_Coll__List__I64* p_ids, struct E_Coll__List__Mem__Block* p_acc) { srs_tail: return ({ __auto_type s0 = p_ids; s0->tag == 0 ? ({ f_Coll__rev__Mem__Block(p_acc); }) : ({ __auto_type v_r_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type s2 = f_Coll__lookup__Mem__Region(p_rs, v_r_0); s2->tag == 1 ? ({ __auto_type v_x_2 = s2->u.C_Coll__Some.f_v; ({ __auto_type res_ = ({ __auto_type s3 = v_x_2; ({ __auto_type v_line_3 = s3->u.C_Mem__Region.f_line; __auto_type v_nm_4 = s3->u.C_Mem__Region.f_x; __auto_type v_h_5 = s3->u.C_Mem__Region.f_h; ({ __auto_type res_ = ({ __auto_type s6 = p_md; ({ __auto_type v_byRegion_6 = s6->u.C_Mem__Model.f_byRegion; ({ struct E_Coll__List__Mem__Row* v_rows_7 = f_Mem__rows(p_md, p_cs, p_free, p_ss, f_Mem__byLine(f_Mem__siteKeys(p_ss, p_ns, f_Mem__idsOf(v_byRegion_6, v_r_0), P_Coll__Nil__Coll__KV_1_I64)), P_Coll__Nil__Mem__Row); __auto_type res_ = ({ struct E_Mem__Model* t0 = p_md; struct E_Coll__SMap__I64* t1 = p_cs; struct E_Coll__List__Mem__Edge* t2 = p_free; struct E_Coll__IMap__Mem__Site* t3 = p_ss; int64_t t4 = p_ns; struct E_Coll__IMap__Mem__Region* t5 = p_rs; struct E_Coll__List__I64* t6 = v_rest_1; struct E_Coll__List__Mem__Block* t7 = ({ struct E_Coll__List__Mem__Block* o8 = (struct E_Coll__List__Mem__Block*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__Block, u) + sizeof(((struct E_Coll__List__Mem__Block*)0)->u.C_Coll__Cons))); o8->u.C_Coll__Cons.t_ = 1; o8->u.C_Coll__Cons.f_h = ({ struct E_Mem__Block* o8 = (struct E_Mem__Block*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Block, u) + sizeof(((struct E_Mem__Block*)0)->u.C_Mem__Block))); o8->u.C_Mem__Block.t_ = 0; o8->u.C_Mem__Block.f_line = v_line_3; o8->u.C_Mem__Block.f_x = v_nm_4; o8->u.C_Mem__Block.f_h = v_h_5; o8->u.C_Mem__Block.f_rows = v_rows_7; o8; }); o8->u.C_Coll__Cons.f_t = p_acc; o8; }); p_md = t0; p_cs = t1; p_free = t2; p_ss = t3; p_ns = t4; p_rs = t5; p_ids = t6; p_acc = t7; goto srs_tail; (struct E_Coll__List__Mem__Block*){0}; }); res_; }); }); }); res_; }); }); }); res_; }); }) : ({ ({ struct E_Mem__Model* t0 = p_md; struct E_Coll__SMap__I64* t1 = p_cs; struct E_Coll__List__Mem__Edge* t2 = p_free; struct E_Coll__IMap__Mem__Site* t3 = p_ss; int64_t t4 = p_ns; struct E_Coll__IMap__Mem__Region* t5 = p_rs; struct E_Coll__List__I64* t6 = v_rest_1; struct E_Coll__List__Mem__Block* t7 = p_acc; p_md = t0; p_cs = t1; p_free = t2; p_ss = t3; p_ns = t4; p_rs = t5; p_ids = t6; p_acc = t7; goto srs_tail; (struct E_Coll__List__Mem__Block*){0}; }); }); }); }); }); } +static struct E_Coll__List__Mem__Block* f_Mem__blocks(struct E_Mem__Model* p_md, struct E_Coll__SMap__I64* p_cs, struct E_Coll__List__Mem__Edge* p_free, struct E_Coll__IMap__Mem__Site* p_ss, int64_t p_ns, struct E_Coll__IMap__Mem__Region* p_rs, struct E_Coll__List__Mem__FreeAt* p_mf, struct E_Coll__List__I64* p_ids, struct E_Coll__List__Mem__Block* p_acc) { srs_tail: return ({ __auto_type s0 = p_ids; s0->tag == 0 ? ({ f_Coll__rev__Mem__Block(p_acc); }) : ({ __auto_type v_r_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type s2 = f_Coll__lookup__Mem__Region(p_rs, v_r_0); s2->tag == 1 ? ({ __auto_type v_x_2 = s2->u.C_Coll__Some.f_v; ({ __auto_type res_ = ({ __auto_type s3 = v_x_2; ({ __auto_type v_f_3 = s3->u.C_Mem__Region.f_f; __auto_type v_line_4 = s3->u.C_Mem__Region.f_line; __auto_type v_nm_5 = s3->u.C_Mem__Region.f_x; __auto_type v_h_6 = s3->u.C_Mem__Region.f_h; ({ __auto_type res_ = ({ __auto_type s7 = p_md; ({ __auto_type v_byRegion_7 = s7->u.C_Mem__Model.f_byRegion; ({ struct E_Coll__List__Mem__Row* v_rows_8 = f_Mem__rows(p_md, p_cs, p_free, p_ss, f_Mem__byLine(f_Mem__siteKeys(p_ss, p_ns, f_Mem__idsOf(v_byRegion_7, v_r_0), P_Coll__Nil__Coll__KV_1_I64)), P_Coll__Nil__Mem__Row); struct E_Mem__Block* v_b_9 = ({ struct E_Mem__Block* o9 = (struct E_Mem__Block*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Block, u) + sizeof(((struct E_Mem__Block*)0)->u.C_Mem__Block))); o9->u.C_Mem__Block.t_ = 0; o9->u.C_Mem__Block.f_line = v_line_4; o9->u.C_Mem__Block.f_f = v_f_3; o9->u.C_Mem__Block.f_x = v_nm_5; o9->u.C_Mem__Block.f_h = v_h_6; o9->u.C_Mem__Block.f_rows = v_rows_8; o9->u.C_Mem__Block.f_defs = f_Mem__rowDefs(v_rows_8, f_Coll__sEmpty__Bool(), P_Coll__Nil__Sym__Sym); o9->u.C_Mem__Block.f_frees = f_Mem__freeLines(p_mf, v_f_3, v_nm_5, v_line_4, P_Coll__Nil__I64); o9; }); __auto_type res_ = ({ struct E_Mem__Model* t0 = p_md; struct E_Coll__SMap__I64* t1 = p_cs; struct E_Coll__List__Mem__Edge* t2 = p_free; struct E_Coll__IMap__Mem__Site* t3 = p_ss; int64_t t4 = p_ns; struct E_Coll__IMap__Mem__Region* t5 = p_rs; struct E_Coll__List__Mem__FreeAt* t6 = p_mf; struct E_Coll__List__I64* t7 = v_rest_1; struct E_Coll__List__Mem__Block* t8 = ({ struct E_Coll__List__Mem__Block* o10 = (struct E_Coll__List__Mem__Block*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__Block, u) + sizeof(((struct E_Coll__List__Mem__Block*)0)->u.C_Coll__Cons))); o10->u.C_Coll__Cons.t_ = 1; o10->u.C_Coll__Cons.f_h = v_b_9; o10->u.C_Coll__Cons.f_t = p_acc; o10; }); p_md = t0; p_cs = t1; p_free = t2; p_ss = t3; p_ns = t4; p_rs = t5; p_mf = t6; p_ids = t7; p_acc = t8; goto srs_tail; (struct E_Coll__List__Mem__Block*){0}; }); res_; }); }); }); res_; }); }); }); res_; }); }) : ({ ({ struct E_Mem__Model* t0 = p_md; struct E_Coll__SMap__I64* t1 = p_cs; struct E_Coll__List__Mem__Edge* t2 = p_free; struct E_Coll__IMap__Mem__Site* t3 = p_ss; int64_t t4 = p_ns; struct E_Coll__IMap__Mem__Region* t5 = p_rs; struct E_Coll__List__Mem__FreeAt* t6 = p_mf; struct E_Coll__List__I64* t7 = v_rest_1; struct E_Coll__List__Mem__Block* t8 = p_acc; p_md = t0; p_cs = t1; p_free = t2; p_ss = t3; p_ns = t4; p_rs = t5; p_mf = t6; p_ids = t7; p_acc = t8; goto srs_tail; (struct E_Coll__List__Mem__Block*){0}; }); }); }); }); }); } static struct E_Coll__List__Mem__Block* f_Coll__rev__Mem__Block(struct E_Coll__List__Mem__Block* p_xs) { return f_Coll__revOnto__Mem__Block(p_xs, P_Coll__Nil__Mem__Block); } static struct E_Coll__List__Mem__Block* f_Coll__revOnto__Mem__Block(struct E_Coll__List__Mem__Block* p_xs, struct E_Coll__List__Mem__Block* p_acc) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_h_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_t_1 = s0->u.C_Coll__Cons.f_t; ({ struct E_Coll__List__Mem__Block* t0 = v_t_1; struct E_Coll__List__Mem__Block* t1 = ({ struct E_Coll__List__Mem__Block* o2 = (struct E_Coll__List__Mem__Block*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__Block, u) + sizeof(((struct E_Coll__List__Mem__Block*)0)->u.C_Coll__Cons))); o2->u.C_Coll__Cons.t_ = 1; o2->u.C_Coll__Cons.f_h = v_h_0; o2->u.C_Coll__Cons.f_t = p_acc; o2; }); p_xs = t0; p_acc = t1; goto srs_tail; (struct E_Coll__List__Mem__Block*){0}; }); }); }); } -static struct E_Coll__List__Mem__Row* f_Mem__rows(struct E_Mem__Model* p_md, struct E_Coll__SMap__I64* p_cs, struct E_Coll__List__Mem__Edge* p_free, struct E_Coll__IMap__Mem__Site* p_ss, struct E_Coll__List__I64* p_ids, struct E_Coll__List__Mem__Row* p_acc) { srs_tail: return ({ __auto_type s0 = p_ids; s0->tag == 0 ? ({ f_Coll__rev__Mem__Row(p_acc); }) : ({ __auto_type v_s_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type s2 = f_Coll__lookup__Mem__Site(p_ss, v_s_0); s2->tag == 1 ? ({ __auto_type v_x_2 = s2->u.C_Coll__Some.f_v; ({ __auto_type res_ = ({ __auto_type s3 = v_x_2; ({ __auto_type v_f_3 = s3->u.C_Mem__Site.f_f; __auto_type v_line_4 = s3->u.C_Mem__Site.f_line; __auto_type v_ctor_5 = s3->u.C_Mem__Site.f_ctor; __auto_type v_loop_6 = s3->u.C_Mem__Site.f_loop; ({ __auto_type res_ = ({ struct E_Mem__Model* t0 = p_md; struct E_Coll__SMap__I64* t1 = p_cs; struct E_Coll__List__Mem__Edge* t2 = p_free; struct E_Coll__IMap__Mem__Site* t3 = p_ss; struct E_Coll__List__I64* t4 = v_rest_1; struct E_Coll__List__Mem__Row* t5 = ({ struct E_Coll__List__Mem__Row* o7 = (struct E_Coll__List__Mem__Row*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__Row, u) + sizeof(((struct E_Coll__List__Mem__Row*)0)->u.C_Coll__Cons))); o7->u.C_Coll__Cons.t_ = 1; o7->u.C_Coll__Cons.f_h = ({ struct E_Mem__Row* o7 = (struct E_Mem__Row*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Row, u) + sizeof(((struct E_Mem__Row*)0)->u.C_Mem__Row))); o7->u.C_Mem__Row.t_ = 0; o7->u.C_Mem__Row.f_line = v_line_4; o7->u.C_Mem__Row.f_ctor = v_ctor_5; o7->u.C_Mem__Row.f_bytes = f_Mem__bytesAt(p_md, v_line_4, v_ctor_5); o7->u.C_Mem__Row.f_dies = f_Mem__dies(p_md, v_f_3, v_line_4, v_ctor_5); o7->u.C_Mem__Row.f_m = f_Mem__multOf(p_md, p_cs, p_free, v_f_3, v_loop_6); o7; }); o7->u.C_Coll__Cons.f_t = p_acc; o7; }); p_md = t0; p_cs = t1; p_free = t2; p_ss = t3; p_ids = t4; p_acc = t5; goto srs_tail; (struct E_Coll__List__Mem__Row*){0}; }); res_; }); }); }); res_; }); }) : ({ ({ struct E_Mem__Model* t0 = p_md; struct E_Coll__SMap__I64* t1 = p_cs; struct E_Coll__List__Mem__Edge* t2 = p_free; struct E_Coll__IMap__Mem__Site* t3 = p_ss; struct E_Coll__List__I64* t4 = v_rest_1; struct E_Coll__List__Mem__Row* t5 = p_acc; p_md = t0; p_cs = t1; p_free = t2; p_ss = t3; p_ids = t4; p_acc = t5; goto srs_tail; (struct E_Coll__List__Mem__Row*){0}; }); }); }); }); }); } +static struct E_Coll__List__Sym__Sym* f_Mem__rowDefs(struct E_Coll__List__Mem__Row* p_rows, struct E_Coll__SMap__Bool* p_seen, struct E_Coll__List__Sym__Sym* p_acc) { srs_tail: return ({ __auto_type s0 = p_rows; s0->tag == 0 ? ({ f_Coll__rev__Sym__Sym(p_acc); }) : ({ __auto_type v_r_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_r_0; ({ __auto_type v_f_2 = s2->u.C_Mem__Row.f_f; ({ __auto_type res_ = (f_Mem__isIn__Bool(p_seen, v_f_2) ? ({ struct E_Coll__List__Mem__Row* t0 = v_rest_1; struct E_Coll__SMap__Bool* t1 = p_seen; struct E_Coll__List__Sym__Sym* t2 = p_acc; p_rows = t0; p_seen = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Sym__Sym*){0}; }) : ({ struct E_Coll__List__Mem__Row* t0 = v_rest_1; struct E_Coll__SMap__Bool* t1 = f_Coll__sInsert__Bool(p_seen, v_f_2, true); struct E_Coll__List__Sym__Sym* t2 = ({ struct E_Coll__List__Sym__Sym* o3 = (struct E_Coll__List__Sym__Sym*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Sym__Sym, u) + sizeof(((struct E_Coll__List__Sym__Sym*)0)->u.C_Coll__Cons))); o3->u.C_Coll__Cons.t_ = 1; o3->u.C_Coll__Cons.f_h = v_f_2; o3->u.C_Coll__Cons.f_t = p_acc; o3; }); p_rows = t0; p_seen = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Sym__Sym*){0}; })); res_; }); }); }); res_; }); }); }); } +static struct E_Coll__List__I64* f_Mem__freeLines(struct E_Coll__List__Mem__FreeAt* p_mf, struct E_Sym__Sym* p_f, struct E_Sym__Sym* p_x, int64_t p_line, struct E_Coll__List__I64* p_acc) { srs_tail: return ({ __auto_type s0 = p_mf; s0->tag == 0 ? ({ f_Coll__rev__I64(p_acc); }) : ({ __auto_type v_m_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_m_0; ({ __auto_type v_g_2 = s2->u.C_Mem__FreeAt.f_f; __auto_type v_l_3 = s2->u.C_Mem__FreeAt.f_line; __auto_type v_y_4 = s2->u.C_Mem__FreeAt.f_x; ({ __auto_type res_ = ((((v_l_3 > p_line) && f_Sym__eq(v_g_2, p_f)) && f_Sym__eq(p_x, v_y_4)) ? ({ struct E_Coll__List__Mem__FreeAt* t0 = v_rest_1; struct E_Sym__Sym* t1 = p_f; struct E_Sym__Sym* t2 = p_x; int64_t t3 = p_line; struct E_Coll__List__I64* t4 = ({ struct E_Coll__List__I64* o5 = (struct E_Coll__List__I64*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__I64, u) + sizeof(((struct E_Coll__List__I64*)0)->u.C_Coll__Cons))); o5->u.C_Coll__Cons.t_ = 1; o5->u.C_Coll__Cons.f_h = v_l_3; o5->u.C_Coll__Cons.f_t = p_acc; o5; }); p_mf = t0; p_f = t1; p_x = t2; p_line = t3; p_acc = t4; goto srs_tail; (struct E_Coll__List__I64*){0}; }) : ({ struct E_Coll__List__Mem__FreeAt* t0 = v_rest_1; struct E_Sym__Sym* t1 = p_f; struct E_Sym__Sym* t2 = p_x; int64_t t3 = p_line; struct E_Coll__List__I64* t4 = p_acc; p_mf = t0; p_f = t1; p_x = t2; p_line = t3; p_acc = t4; goto srs_tail; (struct E_Coll__List__I64*){0}; })); res_; }); }); }); res_; }); }); }); } +static struct E_Coll__List__Mem__FreeAt* f_Mem__paramFrees(struct E_Coll__List__Mem__FreeAt* p_mf, struct E_Coll__List__Mem__Block* p_bs, struct E_Coll__List__Mem__FreeAt* p_acc) { srs_tail: return ({ __auto_type s0 = p_mf; s0->tag == 0 ? ({ f_Coll__rev__Mem__FreeAt(p_acc); }) : ({ __auto_type v_m_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ struct E_Coll__List__Mem__FreeAt* t0 = v_rest_1; struct E_Coll__List__Mem__Block* t1 = p_bs; struct E_Coll__List__Mem__FreeAt* t2 = (f_Mem__freedIn(v_m_0, p_bs) ? p_acc : ({ struct E_Coll__List__Mem__FreeAt* o2 = (struct E_Coll__List__Mem__FreeAt*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__FreeAt, u) + sizeof(((struct E_Coll__List__Mem__FreeAt*)0)->u.C_Coll__Cons))); o2->u.C_Coll__Cons.t_ = 1; o2->u.C_Coll__Cons.f_h = v_m_0; o2->u.C_Coll__Cons.f_t = p_acc; o2; })); p_mf = t0; p_bs = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }); }); } +static struct E_Coll__List__Mem__FreeAt* f_Coll__rev__Mem__FreeAt(struct E_Coll__List__Mem__FreeAt* p_xs) { return f_Coll__revOnto__Mem__FreeAt(p_xs, P_Coll__Nil__Mem__FreeAt); } +static struct E_Coll__List__Mem__FreeAt* f_Coll__revOnto__Mem__FreeAt(struct E_Coll__List__Mem__FreeAt* p_xs, struct E_Coll__List__Mem__FreeAt* p_acc) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_h_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_t_1 = s0->u.C_Coll__Cons.f_t; ({ struct E_Coll__List__Mem__FreeAt* t0 = v_t_1; struct E_Coll__List__Mem__FreeAt* t1 = ({ struct E_Coll__List__Mem__FreeAt* o2 = (struct E_Coll__List__Mem__FreeAt*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__FreeAt, u) + sizeof(((struct E_Coll__List__Mem__FreeAt*)0)->u.C_Coll__Cons))); o2->u.C_Coll__Cons.t_ = 1; o2->u.C_Coll__Cons.f_h = v_h_0; o2->u.C_Coll__Cons.f_t = p_acc; o2; }); p_xs = t0; p_acc = t1; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }); }); } +static bool f_Mem__freedIn(struct E_Mem__FreeAt* p_m, struct E_Coll__List__Mem__Block* p_bs) { srs_tail: return ({ __auto_type s0 = p_bs; s0->tag == 0 ? ({ false; }) : ({ __auto_type v_b_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = p_m; ({ __auto_type v_f_2 = s2->u.C_Mem__FreeAt.f_f; __auto_type v_l_3 = s2->u.C_Mem__FreeAt.f_line; __auto_type v_x_4 = s2->u.C_Mem__FreeAt.f_x; ({ __auto_type res_ = ({ __auto_type s5 = v_b_0; ({ __auto_type v_line_5 = s5->u.C_Mem__Block.f_line; __auto_type v_g_6 = s5->u.C_Mem__Block.f_f; __auto_type v_y_7 = s5->u.C_Mem__Block.f_x; ({ __auto_type res_ = ((((v_l_3 > v_line_5) && f_Sym__eq(v_f_2, v_g_6)) && f_Sym__eq(v_x_4, v_y_7)) ? true : ({ struct E_Mem__FreeAt* t0 = p_m; struct E_Coll__List__Mem__Block* t1 = v_rest_1; p_m = t0; p_bs = t1; goto srs_tail; (bool){0}; })); res_; }); }); }); res_; }); }); }); res_; }); }); }); } +static struct E_Coll__List__Mem__FreeAt* f_Mem__manualFrees(struct E_Coll__List__Ast__Fn* p_fs, struct E_Coll__List__Mem__FreeAt* p_acc) { srs_tail: return ({ __auto_type s0 = p_fs; s0->tag == 0 ? ({ f_Coll__rev__Mem__FreeAt(p_acc); }) : ({ __auto_type v_f_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_f_0; ({ __auto_type v_n_2 = s2->u.C_Ast__Fn.f_name; __auto_type v_body_3 = s2->u.C_Ast__Fn.f_body; ({ struct E_Coll__List__Mem__FreeAt* v_acc2_4 = ({ __auto_type s4 = v_body_3; s4->tag == 0 ? ({ __auto_type v_e_4 = s4->u.C_Ast__Def.f_e; f_Mem__mfx(v_n_2, v_e_4, p_acc); }) : ({ p_acc; }); }); __auto_type res_ = ({ struct E_Coll__List__Ast__Fn* t0 = v_rest_1; struct E_Coll__List__Mem__FreeAt* t1 = v_acc2_4; p_fs = t0; p_acc = t1; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); res_; }); }); }); res_; }); }); }); } +static struct E_Coll__List__Mem__FreeAt* f_Mem__mfx(struct E_Sym__Sym* p_f, struct E_Ast__Expr* p_e, struct E_Coll__List__Mem__FreeAt* p_acc) { srs_tail: return ({ __auto_type s0 = p_e; s0->tag == 6 ? ({ __auto_type v_line_0 = s0->u.C_Ast__Method.f_line; __auto_type v_r_1 = s0->u.C_Ast__Method.f_recv; __auto_type v_op_2 = s0->u.C_Ast__Method.f_op; __auto_type v_args_3 = s0->u.C_Ast__Method.f_args; ({ struct E_Coll__List__Mem__FreeAt* v_acc2_4 = (Str__eq(f_Sym__str(v_op_2), ((srs_str){(const uint8_t*)"free", 4})) ? ({ struct E_Coll__List__Mem__FreeAt* o4 = (struct E_Coll__List__Mem__FreeAt*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__FreeAt, u) + sizeof(((struct E_Coll__List__Mem__FreeAt*)0)->u.C_Coll__Cons))); o4->u.C_Coll__Cons.t_ = 1; o4->u.C_Coll__Cons.f_h = ({ struct E_Mem__FreeAt* o4 = (struct E_Mem__FreeAt*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__FreeAt, u) + sizeof(((struct E_Mem__FreeAt*)0)->u.C_Mem__FreeAt))); o4->u.C_Mem__FreeAt.t_ = 0; o4->u.C_Mem__FreeAt.f_f = p_f; o4->u.C_Mem__FreeAt.f_line = v_line_0; o4->u.C_Mem__FreeAt.f_x = v_r_1; o4; }); o4->u.C_Coll__Cons.f_t = p_acc; o4; }) : p_acc); __auto_type res_ = f_Mem__mfxs(p_f, v_args_3, v_acc2_4); res_; }); }) : s0->tag == 5 ? ({ __auto_type v_args_0 = s0->u.C_Ast__Call.f_args; f_Mem__mfxs(p_f, v_args_0, p_acc); }) : s0->tag == 7 ? ({ __auto_type v_x_0 = s0->u.C_Ast__Resume.f_arg; ({ struct E_Sym__Sym* t0 = p_f; struct E_Ast__Expr* t1 = v_x_0; struct E_Coll__List__Mem__FreeAt* t2 = p_acc; p_f = t0; p_e = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : s0->tag == 8 ? ({ __auto_type v_l_0 = s0->u.C_Ast__Bin.f_l; __auto_type v_r_1 = s0->u.C_Ast__Bin.f_rhs; ({ struct E_Sym__Sym* t0 = p_f; struct E_Ast__Expr* t1 = v_r_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfx(p_f, v_l_0, p_acc); p_f = t0; p_e = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : s0->tag == 9 ? ({ __auto_type v_x_0 = s0->u.C_Ast__Un.f_e; ({ struct E_Sym__Sym* t0 = p_f; struct E_Ast__Expr* t1 = v_x_0; struct E_Coll__List__Mem__FreeAt* t2 = p_acc; p_f = t0; p_e = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : s0->tag == 10 ? ({ __auto_type v_c_0 = s0->u.C_Ast__If.f_c; __auto_type v_t_1 = s0->u.C_Ast__If.f_t; __auto_type v_x_2 = s0->u.C_Ast__If.f_e; f_Mem__mfxs(p_f, ({ struct E_Coll__List__Ast__Expr* o3 = (struct E_Coll__List__Ast__Expr*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Ast__Expr, u) + sizeof(((struct E_Coll__List__Ast__Expr*)0)->u.C_Coll__Cons))); o3->u.C_Coll__Cons.t_ = 1; o3->u.C_Coll__Cons.f_h = v_c_0; o3->u.C_Coll__Cons.f_t = ({ struct E_Coll__List__Ast__Expr* o3 = (struct E_Coll__List__Ast__Expr*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Ast__Expr, u) + sizeof(((struct E_Coll__List__Ast__Expr*)0)->u.C_Coll__Cons))); o3->u.C_Coll__Cons.t_ = 1; o3->u.C_Coll__Cons.f_h = v_t_1; o3->u.C_Coll__Cons.f_t = ({ struct E_Coll__List__Ast__Expr* o3 = (struct E_Coll__List__Ast__Expr*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Ast__Expr, u) + sizeof(((struct E_Coll__List__Ast__Expr*)0)->u.C_Coll__Cons))); o3->u.C_Coll__Cons.t_ = 1; o3->u.C_Coll__Cons.f_h = v_x_2; o3->u.C_Coll__Cons.f_t = P_Coll__Nil__Ast__Expr; o3; }); o3; }); o3; }), p_acc); }) : s0->tag == 11 ? ({ __auto_type v_s_0 = s0->u.C_Ast__Match.f_s; __auto_type v_arms_1 = s0->u.C_Ast__Match.f_arms; f_Mem__mfArms(p_f, v_arms_1, f_Mem__mfx(p_f, v_s_0, p_acc)); }) : s0->tag == 12 ? ({ __auto_type v_ss_0 = s0->u.C_Ast__Block.f_stmts; __auto_type v_last_1 = s0->u.C_Ast__Block.f_last; ({ struct E_Sym__Sym* t0 = p_f; struct E_Ast__Expr* t1 = v_last_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfStmts(p_f, v_ss_0, p_acc); p_f = t0; p_e = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : s0->tag == 13 ? ({ __auto_type v_c_0 = s0->u.C_Ast__While.f_c; __auto_type v_b_1 = s0->u.C_Ast__While.f_body; ({ struct E_Sym__Sym* t0 = p_f; struct E_Ast__Expr* t1 = v_b_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfx(p_f, v_c_0, p_acc); p_f = t0; p_e = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : s0->tag == 14 ? ({ __auto_type v_x_0 = s0->u.C_Ast__Assign.f_e; ({ struct E_Sym__Sym* t0 = p_f; struct E_Ast__Expr* t1 = v_x_0; struct E_Coll__List__Mem__FreeAt* t2 = p_acc; p_f = t0; p_e = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : ({ p_acc; }); }); } +static struct E_Coll__List__Mem__FreeAt* f_Mem__mfxs(struct E_Sym__Sym* p_f, struct E_Coll__List__Ast__Expr* p_es, struct E_Coll__List__Mem__FreeAt* p_acc) { srs_tail: return ({ __auto_type s0 = p_es; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_e_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ struct E_Sym__Sym* t0 = p_f; struct E_Coll__List__Ast__Expr* t1 = v_rest_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfx(p_f, v_e_0, p_acc); p_f = t0; p_es = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }); }); } +static struct E_Coll__List__Mem__FreeAt* f_Mem__mfArms(struct E_Sym__Sym* p_f, struct E_Coll__List__Ast__Arm* p_arms, struct E_Coll__List__Mem__FreeAt* p_acc) { srs_tail: return ({ __auto_type s0 = p_arms; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_a_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_a_0; ({ __auto_type v_b_2 = s2->u.C_Ast__Arm.f_body; ({ __auto_type res_ = ({ struct E_Sym__Sym* t0 = p_f; struct E_Coll__List__Ast__Arm* t1 = v_rest_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfx(p_f, v_b_2, p_acc); p_f = t0; p_arms = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); res_; }); }); }); res_; }); }); }); } +static struct E_Coll__List__Mem__FreeAt* f_Mem__mfStmts(struct E_Sym__Sym* p_f, struct E_Coll__List__Ast__Stmt* p_ss, struct E_Coll__List__Mem__FreeAt* p_acc) { srs_tail: return ({ __auto_type s0 = p_ss; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_s_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type s2 = v_s_0; s2->tag == 0 ? ({ __auto_type v_e_2 = s2->u.C_Ast__Val.f_e; ({ struct E_Sym__Sym* t0 = p_f; struct E_Coll__List__Ast__Stmt* t1 = v_rest_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfx(p_f, v_e_2, p_acc); p_f = t0; p_ss = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : s2->tag == 1 ? ({ __auto_type v_e_2 = s2->u.C_Ast__Var.f_e; ({ struct E_Sym__Sym* t0 = p_f; struct E_Coll__List__Ast__Stmt* t1 = v_rest_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfx(p_f, v_e_2, p_acc); p_f = t0; p_ss = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : s2->tag == 2 ? ({ __auto_type v_args_2 = s2->u.C_Ast__Handle.f_args; ({ struct E_Sym__Sym* t0 = p_f; struct E_Coll__List__Ast__Stmt* t1 = v_rest_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfxs(p_f, v_args_2, p_acc); p_f = t0; p_ss = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : s2->tag == 3 ? ({ __auto_type v_e_2 = s2->u.C_Ast__Do.f_e; ({ struct E_Sym__Sym* t0 = p_f; struct E_Coll__List__Ast__Stmt* t1 = v_rest_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfx(p_f, v_e_2, p_acc); p_f = t0; p_ss = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }) : ({ __auto_type v_e_2 = s2->u.C_Ast__Check.f_e; ({ struct E_Sym__Sym* t0 = p_f; struct E_Coll__List__Ast__Stmt* t1 = v_rest_1; struct E_Coll__List__Mem__FreeAt* t2 = f_Mem__mfx(p_f, v_e_2, p_acc); p_f = t0; p_ss = t1; p_acc = t2; goto srs_tail; (struct E_Coll__List__Mem__FreeAt*){0}; }); }); }); }); }); } +static struct E_Coll__List__Mem__Row* f_Mem__rows(struct E_Mem__Model* p_md, struct E_Coll__SMap__I64* p_cs, struct E_Coll__List__Mem__Edge* p_free, struct E_Coll__IMap__Mem__Site* p_ss, struct E_Coll__List__I64* p_ids, struct E_Coll__List__Mem__Row* p_acc) { srs_tail: return ({ __auto_type s0 = p_ids; s0->tag == 0 ? ({ f_Coll__rev__Mem__Row(p_acc); }) : ({ __auto_type v_s_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type s2 = f_Coll__lookup__Mem__Site(p_ss, v_s_0); s2->tag == 1 ? ({ __auto_type v_x_2 = s2->u.C_Coll__Some.f_v; ({ __auto_type res_ = ({ __auto_type s3 = v_x_2; ({ __auto_type v_f_3 = s3->u.C_Mem__Site.f_f; __auto_type v_line_4 = s3->u.C_Mem__Site.f_line; __auto_type v_ctor_5 = s3->u.C_Mem__Site.f_ctor; __auto_type v_loop_6 = s3->u.C_Mem__Site.f_loop; ({ __auto_type res_ = ({ struct E_Mem__Model* t0 = p_md; struct E_Coll__SMap__I64* t1 = p_cs; struct E_Coll__List__Mem__Edge* t2 = p_free; struct E_Coll__IMap__Mem__Site* t3 = p_ss; struct E_Coll__List__I64* t4 = v_rest_1; struct E_Coll__List__Mem__Row* t5 = ({ struct E_Coll__List__Mem__Row* o7 = (struct E_Coll__List__Mem__Row*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__Row, u) + sizeof(((struct E_Coll__List__Mem__Row*)0)->u.C_Coll__Cons))); o7->u.C_Coll__Cons.t_ = 1; o7->u.C_Coll__Cons.f_h = ({ struct E_Mem__Row* o7 = (struct E_Mem__Row*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Row, u) + sizeof(((struct E_Mem__Row*)0)->u.C_Mem__Row))); o7->u.C_Mem__Row.t_ = 0; o7->u.C_Mem__Row.f_line = v_line_4; o7->u.C_Mem__Row.f_f = v_f_3; o7->u.C_Mem__Row.f_ctor = v_ctor_5; o7->u.C_Mem__Row.f_bytes = f_Mem__bytesAt(p_md, v_line_4, v_ctor_5); o7->u.C_Mem__Row.f_dies = f_Mem__dies(p_md, v_f_3, v_line_4, v_ctor_5); o7->u.C_Mem__Row.f_m = f_Mem__multOf(p_md, p_cs, p_free, v_f_3, v_loop_6); o7; }); o7->u.C_Coll__Cons.f_t = p_acc; o7; }); p_md = t0; p_cs = t1; p_free = t2; p_ss = t3; p_ids = t4; p_acc = t5; goto srs_tail; (struct E_Coll__List__Mem__Row*){0}; }); res_; }); }); }); res_; }); }) : ({ ({ struct E_Mem__Model* t0 = p_md; struct E_Coll__SMap__I64* t1 = p_cs; struct E_Coll__List__Mem__Edge* t2 = p_free; struct E_Coll__IMap__Mem__Site* t3 = p_ss; struct E_Coll__List__I64* t4 = v_rest_1; struct E_Coll__List__Mem__Row* t5 = p_acc; p_md = t0; p_cs = t1; p_free = t2; p_ss = t3; p_ids = t4; p_acc = t5; goto srs_tail; (struct E_Coll__List__Mem__Row*){0}; }); }); }); }); }); } static struct E_Coll__List__Mem__Row* f_Coll__rev__Mem__Row(struct E_Coll__List__Mem__Row* p_xs) { return f_Coll__revOnto__Mem__Row(p_xs, P_Coll__Nil__Mem__Row); } static struct E_Coll__List__Mem__Row* f_Coll__revOnto__Mem__Row(struct E_Coll__List__Mem__Row* p_xs, struct E_Coll__List__Mem__Row* p_acc) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ p_acc; }) : ({ __auto_type v_h_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_t_1 = s0->u.C_Coll__Cons.f_t; ({ struct E_Coll__List__Mem__Row* t0 = v_t_1; struct E_Coll__List__Mem__Row* t1 = ({ struct E_Coll__List__Mem__Row* o2 = (struct E_Coll__List__Mem__Row*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Coll__List__Mem__Row, u) + sizeof(((struct E_Coll__List__Mem__Row*)0)->u.C_Coll__Cons))); o2->u.C_Coll__Cons.t_ = 1; o2->u.C_Coll__Cons.f_h = v_h_0; o2->u.C_Coll__Cons.f_t = p_acc; o2; }); p_xs = t0; p_acc = t1; goto srs_tail; (struct E_Coll__List__Mem__Row*){0}; }); }); }); } static struct E_Mem__Mult* f_Mem__multOf(struct E_Mem__Model* p_md, struct E_Coll__SMap__I64* p_cs, struct E_Coll__List__Mem__Edge* p_free, struct E_Sym__Sym* p_f, bool p_loop) { return ({ __auto_type res_ = ({ __auto_type s0 = p_md; ({ __auto_type v_manyDef_0 = s0->u.C_Mem__Model.f_manyDef; __auto_type v_loopCall_1 = s0->u.C_Mem__Model.f_loopCall; ({ __auto_type res_ = (p_loop ? ({ struct E_Mem__Mult* o2 = (struct E_Mem__Mult*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Mult, u) + sizeof(((struct E_Mem__Mult*)0)->u.C_Mem__Many))); o2->u.C_Mem__Many.t_ = 1; o2->u.C_Mem__Many.f_why = P_Mem__InLoop; o2; }) : ((!f_Mem__isIn__Bool(v_manyDef_0, p_f)) ? P_Mem__Once : ((f_Mem__count(p_cs, p_f) >= ((int64_t)2)) ? ({ struct E_Mem__Mult* o2 = (struct E_Mem__Mult*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Mult, u) + sizeof(((struct E_Mem__Mult*)0)->u.C_Mem__Many))); o2->u.C_Mem__Many.t_ = 1; o2->u.C_Mem__Many.f_why = ({ struct E_Mem__Why* o2 = (struct E_Mem__Why*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Why, u) + sizeof(((struct E_Mem__Why*)0)->u.C_Mem__Sites))); o2->u.C_Mem__Sites.t_ = 1; o2->u.C_Mem__Sites.f_f = p_f; o2->u.C_Mem__Sites.f_n = f_Mem__count(p_cs, p_f); o2; }); o2; }) : (f_Mem__isIn__Bool(v_loopCall_1, p_f) ? ({ struct E_Mem__Mult* o2 = (struct E_Mem__Mult*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Mult, u) + sizeof(((struct E_Mem__Mult*)0)->u.C_Mem__Many))); o2->u.C_Mem__Many.t_ = 1; o2->u.C_Mem__Many.f_why = ({ struct E_Mem__Why* o2 = (struct E_Mem__Why*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Why, u) + sizeof(((struct E_Mem__Why*)0)->u.C_Mem__LoopCalled))); o2->u.C_Mem__LoopCalled.t_ = 2; o2->u.C_Mem__LoopCalled.f_f = p_f; o2; }); o2; }) : ({ struct E_Mem__Mult* o2 = (struct E_Mem__Mult*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Mult, u) + sizeof(((struct E_Mem__Mult*)0)->u.C_Mem__Many))); o2->u.C_Mem__Many.t_ = 1; o2->u.C_Mem__Many.f_why = ({ struct E_Mem__Why* o2 = (struct E_Mem__Why*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_Mem__Why, u) + sizeof(((struct E_Mem__Why*)0)->u.C_Mem__Via))); o2->u.C_Mem__Via.t_ = 3; o2->u.C_Mem__Via.f_f = f_Mem__manyCaller(v_manyDef_0, p_free, p_f); o2; }); o2; }))))); res_; }); }); }); res_; }); } @@ -9622,7 +9658,9 @@ static struct E_S2c__Flowed* f_S2c__flowAll(struct E_Flow__Plans* p_p, struct E_ static int64_t f_S2c__showNames(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Names__Clash* p_cs) { srs_tail: return ({ __auto_type s0 = p_cs; s0->tag == 0 ? ({ ((int64_t)0); }) : ({ __auto_type v_c_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ (void)(({ __auto_type s2 = v_c_0; s2->tag == 0 ? ({ __auto_type v_l_2 = s2->u.C_Names__Dup.f_line; __auto_type v_n_3 = s2->u.C_Names__Dup.f_name; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"duplicate", 9}), v_l_2, ((srs_str){(const uint8_t*)"duplicate name", 14}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"rename one of them", 18})); }) : s2->tag == 1 ? ({ __auto_type v_l_2 = s2->u.C_Names__Unknown.f_line; __auto_type v_n_3 = s2->u.C_Names__Unknown.f_name; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"unknown-name", 12}), v_l_2, ((srs_str){(const uint8_t*)"unknown name", 12}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"declare it, or fix its spelling (module members are written qualified: Foo.bar)", 79})); }) : s2->tag == 2 ? ({ __auto_type v_l_2 = s2->u.C_Names__NoType.f_line; __auto_type v_n_3 = s2->u.C_Names__NoType.f_name; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"unknown-type", 12}), v_l_2, ((srs_str){(const uint8_t*)"unknown type", 12}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"declare it, or fix its spelling", 31})); }) : s2->tag == 3 ? ({ __auto_type v_l_2 = s2->u.C_Names__BadState.f_line; __auto_type v_n_3 = s2->u.C_Names__BadState.f_name; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"unknown-state", 13}), v_l_2, ((srs_str){(const uint8_t*)"unknown capability state", 24}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"use a state the capability declares", 35})); }) : s2->tag == 4 ? ({ __auto_type v_l_2 = s2->u.C_Names__NoDrop.f_line; __auto_type v_n_3 = s2->u.C_Names__NoDrop.f_name; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"unknown-drop", 12}), v_l_2, ((srs_str){(const uint8_t*)"unknown drop op", 15}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"drop one of the capability's ops", 32})); }) : s2->tag == 5 ? ({ __auto_type v_l_2 = s2->u.C_Names__NoProto.f_line; __auto_type v_n_3 = s2->u.C_Names__NoProto.f_name; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"not-a-capability", 16}), v_l_2, ((srs_str){(const uint8_t*)"a handler of a name that is not a capability:", 45}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"write a handler for a capability", 32})); }) : s2->tag == 6 ? ({ __auto_type v_l_2 = s2->u.C_Names__NoInit.f_line; __auto_type v_n_3 = s2->u.C_Names__NoInit.f_name; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"handler-no-init", 15}), v_l_2, ((srs_str){(const uint8_t*)"a handler without init:", 23}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"define def init(...): Ptr", 25})); }) : s2->tag == 7 ? ({ __auto_type v_l_2 = s2->u.C_Names__NoOp.f_line; __auto_type v_n_3 = s2->u.C_Names__NoOp.f_name; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"handler-missing-op", 18}), v_l_2, ((srs_str){(const uint8_t*)"a handler misses the op", 23}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"define every op of the capability", 33})); }) : ({ __auto_type v_l_2 = s2->u.C_Names__BadArity.f_line; __auto_type v_n_3 = s2->u.C_Names__BadArity.f_name; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"handler-arity", 13}), v_l_2, ((srs_str){(const uint8_t*)"a handler fn has the wrong arity:", 33}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"take self: Ptr first, then the op's params", 42})); }); })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Names__Clash* t1 = v_rest_1; p_fs = t0; p_cs = t1; goto srs_tail; (int64_t){0}; }); res_; }); }); }); } static int64_t f_S2c__showFlow(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Flow__Clash* p_cs) { srs_tail: return ({ __auto_type s0 = p_cs; s0->tag == 0 ? ({ ((int64_t)0); }) : ({ __auto_type v_c_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ (void)(({ __auto_type s2 = v_c_0; s2->tag == 0 ? ({ __auto_type v_l_2 = s2->u.C_Flow__Stuck.f_line; __auto_type v_n_3 = s2->u.C_Flow__Stuck.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"op-not-allowed", 14}), v_l_2, ((srs_str){(const uint8_t*)"op not allowed in this state of the capability", 46}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"call the ops in the order the capability allows", 47})); }) : s2->tag == 1 ? ({ __auto_type v_l_2 = s2->u.C_Flow__Split.f_line; __auto_type v_n_3 = s2->u.C_Flow__Split.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"branch-states", 13}), v_l_2, ((srs_str){(const uint8_t*)"branches leave the capability in different states:", 50}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"bring it to one state on every branch", 37})); }) : s2->tag == 2 ? ({ __auto_type v_l_2 = s2->u.C_Flow__Unended.f_line; __auto_type v_n_3 = s2->u.C_Flow__Unended.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"capability-not-ended", 20}), v_l_2, ((srs_str){(const uint8_t*)"the capability does not end in its declared state:", 50}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"end it (its drop op or an op into an end state) before its scope ends", 69})); }) : s2->tag == 3 ? ({ __auto_type v_l_2 = s2->u.C_Flow__Ambig.f_line; __auto_type v_n_3 = s2->u.C_Flow__Ambig.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"entry-facts-ambiguous", 21}), v_l_2, ((srs_str){(const uint8_t*)"entry facts with more than one solution at the call of", 54}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"fix the capability states before the call", 41})); }) : s2->tag == 4 ? ({ __auto_type v_l_2 = s2->u.C_Flow__ExitBad.f_line; __auto_type v_n_3 = s2->u.C_Flow__ExitBad.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"exit-state", 10}), v_l_2, ((srs_str){(const uint8_t*)"a capability ends in another state than the exit fact of", 56}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"end it in the state the exit fact names", 39})); }) : s2->tag == 5 ? ({ __auto_type v_l_2 = s2->u.C_Flow__NoSol.f_line; __auto_type v_n_3 = s2->u.C_Flow__NoSol.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"entry-facts-unsolvable", 22}), v_l_2, ((srs_str){(const uint8_t*)"entry facts with no solution in", 31}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"make the entry facts satisfiable", 32})); }) : s2->tag == 6 ? ({ __auto_type v_l_2 = s2->u.C_Flow__Dead.f_line; __auto_type v_n_3 = s2->u.C_Flow__Dead.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"use-after-free", 14}), v_l_2, ((srs_str){(const uint8_t*)"use of a value after its region ended:", 38}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"use it before the region ends, or allocate it in a longer region", 64})); }) : s2->tag == 7 ? ({ __auto_type v_l_2 = s2->u.C_Flow__Escape.f_line; __auto_type v_n_3 = s2->u.C_Flow__Escape.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"region-escape", 13}), v_l_2, ((srs_str){(const uint8_t*)"a value escapes the scope of its region", 39}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"allocate it in a region that outlives the block", 47})); }) : s2->tag == 8 ? ({ __auto_type v_l_2 = s2->u.C_Flow__Stale.f_line; __auto_type v_x_3 = s2->u.C_Flow__Stale.f_x; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"stale-value", 11}), v_l_2, ((srs_str){(const uint8_t*)"the value needs its capability in the state its type names; it is in another state:", 83}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_x_3; o4; }), ((srs_str){(const uint8_t*)"use it before the capability changes state", 42})); }) : s2->tag == 10 ? ({ __auto_type v_l_2 = s2->u.C_Flow__Bound.f_line; __auto_type v_n_3 = s2->u.C_Flow__Bound.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"capability-bound", 16}), v_l_2, ((srs_str){(const uint8_t*)"a value lives in, or is bound to, a capability its type does not name:", 70}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_n_3; o4; }), ((srs_str){(const uint8_t*)"pass or make a value of the capability the type names (its <...> or its fact), or name that capability in the type", 114})); }) : ({ __auto_type v_l_2 = s2->u.C_Flow__MsState.f_line; __auto_type v_c_3 = s2->u.C_Flow__MsState.f_cap; f_S2c__diag(p_fs, ((srs_str){(const uint8_t*)"multishot-state", 15}), v_l_2, ((srs_str){(const uint8_t*)"a capability from outside a multi-shot handle is in another state here than at the end of the block:", 100}), ({ struct E_S2c__What* o4 = (struct E_S2c__What*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__What, u) + sizeof(((struct E_S2c__What*)0)->u.C_S2c__Name))); o4->u.C_S2c__Name.t_ = 1; o4->u.C_S2c__Name.f_n = v_c_3; o4; }), ((srs_str){(const uint8_t*)"each resume runs the rest of the block again from here: bring the capability back to this state by the end, or open it inside the block", 135})); }); })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Flow__Clash* t1 = v_rest_1; p_fs = t0; p_cs = t1; goto srs_tail; (int64_t){0}; }); res_; }); }); }); } static int64_t f_S2c__internal(srs_str p_phase, struct E_Sym__Sym* p_rel) { return ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[3]))(eff__Console->self, ((srs_str){(const uint8_t*)"srs internal: the ", 18})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[3]))(eff__Console->self, p_phase); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[3]))(eff__Console->self, ((srs_str){(const uint8_t*)" rules are ill-formed at relation ", 34})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[3]))(eff__Console->self, f_Sym__str(p_rel)); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[3]))(eff__Console->self, ((srs_str){(const uint8_t*)"\n", 1})); eff__Console->live = 0; r_; })); __auto_type res_ = ((int64_t)2); res_; }); } -static int64_t f_S2c__mem(struct E_Coll__List__S2c__File* p_fs, struct E_Mem__Report* p_r) { return ({ __auto_type s0 = p_r; s0->tag == 1 ? ({ __auto_type v_rel_0 = s0->u.C_Mem__RulesBad.f_rel; f_S2c__internal(((srs_str){(const uint8_t*)"mem", 3}), v_rel_0); }) : ({ __auto_type v_bs_0 = s0->u.C_Mem__Ok.f_bs; __auto_type v_rs_1 = s0->u.C_Mem__Ok.f_rs; __auto_type v_cs_2 = s0->u.C_Mem__Ok.f_cs; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"regions\":[", 12})); eff__Console->live = 0; r_; })); (void)(f_S2c__jRegions(p_fs, v_bs_0, ((int64_t)0))); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"],\"sites\":[", 11})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ __auto_type s3 = f_S2c__jBlocks(p_fs, v_bs_0, ((int64_t)0), ({ struct E_S2c__MemCount* o3 = (struct E_S2c__MemCount*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__MemCount, u) + sizeof(((struct E_S2c__MemCount*)0)->u.C_S2c__MemCount))); o3->u.C_S2c__MemCount.t_ = 0; o3->u.C_S2c__MemCount.f_once = ((int64_t)0); o3->u.C_S2c__MemCount.f_onceB = ((int64_t)0); o3->u.C_S2c__MemCount.f_many = ((int64_t)0); o3->u.C_S2c__MemCount.f_die = ((int64_t)0); o3->u.C_S2c__MemCount.f_site = ((int64_t)0); o3; })); ({ __auto_type v_once_3 = s3->u.C_S2c__MemCount.f_once; __auto_type v_onceB_4 = s3->u.C_S2c__MemCount.f_onceB; __auto_type v_many_5 = s3->u.C_S2c__MemCount.f_many; __auto_type v_die_6 = s3->u.C_S2c__MemCount.f_die; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"],\"total\":{\"once\":", 18})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_once_3); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"onceBytes\":", 13})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_onceB_4); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"many\":", 8})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_many_5); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"dies\":", 8})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_die_6); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"},\"reuse\":[", 11})); eff__Console->live = 0; r_; })); (void)(f_S2c__jReuses(p_fs, v_rs_1, true)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"],\"compact\":[", 13})); eff__Console->live = 0; r_; })); (void)(f_S2c__jCompacts(p_fs, v_cs_2, true)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"]}\n", 3})); eff__Console->live = 0; r_; })); __auto_type res_ = ((int64_t)0); res_; }); }); }); res_; }); }); }); } +static int64_t f_S2c__mem(struct E_Coll__List__S2c__File* p_fs, struct E_Mem__Report* p_r) { return ({ __auto_type s0 = p_r; s0->tag == 1 ? ({ __auto_type v_rel_0 = s0->u.C_Mem__RulesBad.f_rel; f_S2c__internal(((srs_str){(const uint8_t*)"mem", 3}), v_rel_0); }) : ({ __auto_type v_bs_0 = s0->u.C_Mem__Ok.f_bs; __auto_type v_pf_1 = s0->u.C_Mem__Ok.f_pf; __auto_type v_rs_2 = s0->u.C_Mem__Ok.f_rs; __auto_type v_cs_3 = s0->u.C_Mem__Ok.f_cs; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"regions\":[", 12})); eff__Console->live = 0; r_; })); (void)(f_S2c__jRegions(p_fs, v_bs_0, ((int64_t)0))); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"],\"sites\":[", 11})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ __auto_type s4 = f_S2c__jBlocks(p_fs, v_bs_0, ((int64_t)0), ({ struct E_S2c__MemCount* o4 = (struct E_S2c__MemCount*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__MemCount, u) + sizeof(((struct E_S2c__MemCount*)0)->u.C_S2c__MemCount))); o4->u.C_S2c__MemCount.t_ = 0; o4->u.C_S2c__MemCount.f_once = ((int64_t)0); o4->u.C_S2c__MemCount.f_onceB = ((int64_t)0); o4->u.C_S2c__MemCount.f_many = ((int64_t)0); o4->u.C_S2c__MemCount.f_die = ((int64_t)0); o4->u.C_S2c__MemCount.f_site = ((int64_t)0); o4; })); ({ __auto_type v_once_4 = s4->u.C_S2c__MemCount.f_once; __auto_type v_onceB_5 = s4->u.C_S2c__MemCount.f_onceB; __auto_type v_many_6 = s4->u.C_S2c__MemCount.f_many; __auto_type v_die_7 = s4->u.C_S2c__MemCount.f_die; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"],\"frees\":[", 11})); eff__Console->live = 0; r_; })); (void)(f_S2c__jFrees(p_fs, v_bs_0, ((int64_t)0))); (void)(f_S2c__jParamFrees(p_fs, v_pf_1, (f_Coll__length__Mem__Block(v_bs_0) == ((int64_t)0)))); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"],\"total\":{\"once\":", 18})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_once_4); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"onceBytes\":", 13})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_onceB_5); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"many\":", 8})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_many_6); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"dies\":", 8})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_die_7); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"},\"reuse\":[", 11})); eff__Console->live = 0; r_; })); (void)(f_S2c__jReuses(p_fs, v_rs_2, true)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"],\"compact\":[", 13})); eff__Console->live = 0; r_; })); (void)(f_S2c__jCompacts(p_fs, v_cs_3, true)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"]}\n", 3})); eff__Console->live = 0; r_; })); __auto_type res_ = ((int64_t)0); res_; }); }); }); res_; }); }); }); } +static int64_t f_Coll__length__Mem__Block(struct E_Coll__List__Mem__Block* p_xs) { return f_Coll__lengthFrom__Mem__Block(p_xs, ((int64_t)0)); } +static int64_t f_Coll__lengthFrom__Mem__Block(struct E_Coll__List__Mem__Block* p_xs, int64_t p_n) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ p_n; }) : ({ __auto_type v_t_0 = s0->u.C_Coll__Cons.f_t; ({ struct E_Coll__List__Mem__Block* t0 = v_t_0; int64_t t1 = (p_n + ((int64_t)1)); p_xs = t0; p_n = t1; goto srs_tail; (int64_t){0}; }); }); }); } static int64_t f_S2c__jStr(srs_str p_s) { return ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"\"", 1})); eff__Console->live = 0; r_; })); (void)(f_S2c__jBody(p_s)); __auto_type res_ = ({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"\"", 1})); eff__Console->live = 0; r_; }); res_; }); } static int64_t f_S2c__jBody(srs_str p_s) { return ({ int64_t v_n_0 = Str__len(p_s); __auto_type res_ = (f_S2c__jPlain(p_s, ((int64_t)0), v_n_0) ? ({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, p_s); eff__Console->live = 0; r_; }) : f_S2c__jChars(p_s, ((int64_t)0), v_n_0)); res_; }); } static bool f_S2c__jPlain(srs_str p_s, int64_t p_i, int64_t p_n) { srs_tail: return ({ __auto_type res_ = ((p_i == p_n) ? true : (f_S2c__jEsc(Str__at(p_s, p_i)) ? false : ({ srs_str t0 = p_s; int64_t t1 = (p_i + ((int64_t)1)); int64_t t2 = p_n; p_s = t0; p_i = t1; p_n = t2; goto srs_tail; (bool){0}; }))); res_; }); } @@ -9633,9 +9671,13 @@ static int64_t f_S2c__jHex(int64_t p_d) { return ((p_d < ((int64_t)10)) ? ({ __a static int64_t f_S2c__jSym(struct E_Sym__Sym* p_x) { return f_S2c__jStr(f_Sym__str(p_x)); } static int64_t f_S2c__jAt(struct E_Coll__List__S2c__File* p_fs, int64_t p_line) { return ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"\"", 1})); eff__Console->live = 0; r_; })); (void)(({ __auto_type s0 = f_S2c__fileOf(p_fs, p_line); s0->tag == 1 ? ({ __auto_type v_f_0 = s0->u.C_Coll__Some.f_v; ({ __auto_type res_ = ({ __auto_type s1 = v_f_0; ({ __auto_type v_p_1 = s1->u.C_S2c__File.f_path; __auto_type v_base_2 = s1->u.C_S2c__File.f_base; ({ (void)(f_S2c__jBody(v_p_1)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)":", 1})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, ((p_line - v_base_2) + ((int64_t)1))); eff__Console->live = 0; r_; }); res_; }); }); }); res_; }); }) : ({ ({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, p_line); eff__Console->live = 0; r_; }); }); })); __auto_type res_ = ({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"\"", 1})); eff__Console->live = 0; r_; }); res_; }); } static int64_t f_S2c__jSep(bool p_first) { return (p_first ? ((int64_t)0) : ({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",", 1})); eff__Console->live = 0; r_; })); } -static int64_t f_S2c__jRegions(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Block* p_bs, int64_t p_id) { srs_tail: return ({ __auto_type s0 = p_bs; s0->tag == 0 ? ({ ((int64_t)0); }) : ({ __auto_type v_b_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_b_0; ({ __auto_type v_line_2 = s2->u.C_Mem__Block.f_line; __auto_type v_x_3 = s2->u.C_Mem__Block.f_x; __auto_type v_h_4 = s2->u.C_Mem__Block.f_h; ({ (void)(f_S2c__jSep((p_id == ((int64_t)0)))); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"id\":", 6})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, p_id); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"at\":", 6})); eff__Console->live = 0; r_; })); (void)(f_S2c__jAt(p_fs, v_line_2)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"var\":", 7})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_x_3)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"handler\":", 11})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_h_4)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"}", 1})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__Block* t1 = v_rest_1; int64_t t2 = (p_id + ((int64_t)1)); p_fs = t0; p_bs = t1; p_id = t2; goto srs_tail; (int64_t){0}; }); res_; }); }); }); res_; }); }); }); } +static int64_t f_S2c__jRegions(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Block* p_bs, int64_t p_id) { srs_tail: return ({ __auto_type s0 = p_bs; s0->tag == 0 ? ({ ((int64_t)0); }) : ({ __auto_type v_b_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_b_0; ({ __auto_type v_line_2 = s2->u.C_Mem__Block.f_line; __auto_type v_f_3 = s2->u.C_Mem__Block.f_f; __auto_type v_x_4 = s2->u.C_Mem__Block.f_x; __auto_type v_h_5 = s2->u.C_Mem__Block.f_h; __auto_type v_defs_6 = s2->u.C_Mem__Block.f_defs; ({ (void)(f_S2c__jSep((p_id == ((int64_t)0)))); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"id\":", 6})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, p_id); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"def\":", 7})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_f_3)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"at\":", 6})); eff__Console->live = 0; r_; })); (void)(f_S2c__jAt(p_fs, v_line_2)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"var\":", 7})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_x_4)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"handler\":", 11})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_h_5)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"defs\":[", 9})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSyms(v_defs_6, true)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"]}", 2})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__Block* t1 = v_rest_1; int64_t t2 = (p_id + ((int64_t)1)); p_fs = t0; p_bs = t1; p_id = t2; goto srs_tail; (int64_t){0}; }); res_; }); }); }); res_; }); }); }); } +static int64_t f_S2c__jSyms(struct E_Coll__List__Sym__Sym* p_xs, bool p_first) { srs_tail: return ({ __auto_type s0 = p_xs; s0->tag == 0 ? ({ ((int64_t)0); }) : ({ __auto_type v_x_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ (void)(f_S2c__jSep(p_first)); (void)(f_S2c__jSym(v_x_0)); __auto_type res_ = ({ struct E_Coll__List__Sym__Sym* t0 = v_rest_1; bool t1 = false; p_xs = t0; p_first = t1; goto srs_tail; (int64_t){0}; }); res_; }); }); }); } +static int64_t f_S2c__jFrees(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Block* p_bs, int64_t p_id) { srs_tail: return ({ __auto_type s0 = p_bs; s0->tag == 0 ? ({ ((int64_t)0); }) : ({ __auto_type v_b_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_b_0; ({ __auto_type v_frees_2 = s2->u.C_Mem__Block.f_frees; ({ (void)(f_S2c__jSep((p_id == ((int64_t)0)))); (void)(f_S2c__jManual(p_fs, v_frees_2, p_id)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"region\":", 10})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, p_id); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"kind\":\"auto\",\"when\":\"blockEnd\",\"ifLive\":true}", 47})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__Block* t1 = v_rest_1; int64_t t2 = (p_id + ((int64_t)1)); p_fs = t0; p_bs = t1; p_id = t2; goto srs_tail; (int64_t){0}; }); res_; }); }); }); res_; }); }); }); } +static int64_t f_S2c__jManual(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__I64* p_ls, int64_t p_id) { srs_tail: return ({ __auto_type s0 = p_ls; s0->tag == 0 ? ({ ((int64_t)0); }) : ({ __auto_type v_l_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"region\":", 10})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, p_id); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"kind\":\"manual\",\"at\":", 22})); eff__Console->live = 0; r_; })); (void)(f_S2c__jAt(p_fs, v_l_0)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"},", 2})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__I64* t1 = v_rest_1; int64_t t2 = p_id; p_fs = t0; p_ls = t1; p_id = t2; goto srs_tail; (int64_t){0}; }); res_; }); }); }); } +static int64_t f_S2c__jParamFrees(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__FreeAt* p_pf, bool p_first) { srs_tail: return ({ __auto_type s0 = p_pf; s0->tag == 0 ? ({ ((int64_t)0); }) : ({ __auto_type v_m_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_m_0; ({ __auto_type v_f_2 = s2->u.C_Mem__FreeAt.f_f; __auto_type v_l_3 = s2->u.C_Mem__FreeAt.f_line; __auto_type v_x_4 = s2->u.C_Mem__FreeAt.f_x; ({ (void)(f_S2c__jSep(p_first)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"region\":null,\"kind\":\"manual\",\"at\":", 36})); eff__Console->live = 0; r_; })); (void)(f_S2c__jAt(p_fs, v_l_3)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"def\":", 7})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_f_2)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"param\":", 9})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_x_4)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"}", 1})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__FreeAt* t1 = v_rest_1; bool t2 = false; p_fs = t0; p_pf = t1; p_first = t2; goto srs_tail; (int64_t){0}; }); res_; }); }); }); res_; }); }); }); } static struct E_S2c__MemCount* f_S2c__jBlocks(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Block* p_bs, int64_t p_region, struct E_S2c__MemCount* p_c) { srs_tail: return ({ __auto_type s0 = p_bs; s0->tag == 0 ? ({ p_c; }) : ({ __auto_type v_b_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_b_0; ({ __auto_type v_rows_2 = s2->u.C_Mem__Block.f_rows; ({ __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__Block* t1 = v_rest_1; int64_t t2 = (p_region + ((int64_t)1)); struct E_S2c__MemCount* t3 = f_S2c__jRows(p_fs, v_rows_2, p_region, p_c); p_fs = t0; p_bs = t1; p_region = t2; p_c = t3; goto srs_tail; (struct E_S2c__MemCount*){0}; }); res_; }); }); }); res_; }); }); }); } -static struct E_S2c__MemCount* f_S2c__jRows(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Row* p_rows, int64_t p_region, struct E_S2c__MemCount* p_c) { srs_tail: return ({ __auto_type s0 = p_rows; s0->tag == 0 ? ({ p_c; }) : ({ __auto_type v_r_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_r_0; ({ __auto_type v_line_2 = s2->u.C_Mem__Row.f_line; __auto_type v_ctor_3 = s2->u.C_Mem__Row.f_ctor; __auto_type v_bytes_4 = s2->u.C_Mem__Row.f_bytes; __auto_type v_dies_5 = s2->u.C_Mem__Row.f_dies; __auto_type v_m_6 = s2->u.C_Mem__Row.f_m; ({ __auto_type res_ = ({ __auto_type s7 = p_c; ({ __auto_type v_once_7 = s7->u.C_S2c__MemCount.f_once; __auto_type v_onceB_8 = s7->u.C_S2c__MemCount.f_onceB; __auto_type v_many_9 = s7->u.C_S2c__MemCount.f_many; __auto_type v_die_10 = s7->u.C_S2c__MemCount.f_die; __auto_type v_site_11 = s7->u.C_S2c__MemCount.f_site; ({ (void)(f_S2c__jSep((v_site_11 == ((int64_t)0)))); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"id\":", 6})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_site_11); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"region\":", 10})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, p_region); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"at\":", 6})); eff__Console->live = 0; r_; })); (void)(f_S2c__jAt(p_fs, v_line_2)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"ctor\":", 8})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_ctor_3)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"bytes\":", 9})); eff__Console->live = 0; r_; })); int64_t v_n_12 = f_S2c__jBytes(v_bytes_4); int64_t v_d_13 = (v_dies_5 ? ((int64_t)1) : ((int64_t)0)); srs_str v_fate_14 = (v_dies_5 ? ((srs_str){(const uint8_t*)",\"fate\":\"dies\"", 14}) : ((srs_str){(const uint8_t*)",\"fate\":\"escapes\"", 17})); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, v_fate_14); eff__Console->live = 0; r_; })); __auto_type res_ = ({ __auto_type s15 = v_m_6; s15->tag == 0 ? ({ ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"mult\":\"once\"}", 15})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__Row* t1 = v_rest_1; int64_t t2 = p_region; struct E_S2c__MemCount* t3 = ({ struct E_S2c__MemCount* o15 = (struct E_S2c__MemCount*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__MemCount, u) + sizeof(((struct E_S2c__MemCount*)0)->u.C_S2c__MemCount))); o15->u.C_S2c__MemCount.t_ = 0; o15->u.C_S2c__MemCount.f_once = (v_once_7 + ((int64_t)1)); o15->u.C_S2c__MemCount.f_onceB = (v_onceB_8 + v_n_12); o15->u.C_S2c__MemCount.f_many = v_many_9; o15->u.C_S2c__MemCount.f_die = (v_die_10 + v_d_13); o15->u.C_S2c__MemCount.f_site = (v_site_11 + ((int64_t)1)); o15; }); p_fs = t0; p_rows = t1; p_region = t2; p_c = t3; goto srs_tail; (struct E_S2c__MemCount*){0}; }); res_; }); }) : ({ __auto_type v_why_15 = s15->u.C_Mem__Many.f_why; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"mult\":\"many\",\"why\":", 21})); eff__Console->live = 0; r_; })); (void)(f_S2c__jWhy(v_why_15)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"}", 1})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__Row* t1 = v_rest_1; int64_t t2 = p_region; struct E_S2c__MemCount* t3 = ({ struct E_S2c__MemCount* o16 = (struct E_S2c__MemCount*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__MemCount, u) + sizeof(((struct E_S2c__MemCount*)0)->u.C_S2c__MemCount))); o16->u.C_S2c__MemCount.t_ = 0; o16->u.C_S2c__MemCount.f_once = v_once_7; o16->u.C_S2c__MemCount.f_onceB = v_onceB_8; o16->u.C_S2c__MemCount.f_many = (v_many_9 + ((int64_t)1)); o16->u.C_S2c__MemCount.f_die = (v_die_10 + v_d_13); o16->u.C_S2c__MemCount.f_site = (v_site_11 + ((int64_t)1)); o16; }); p_fs = t0; p_rows = t1; p_region = t2; p_c = t3; goto srs_tail; (struct E_S2c__MemCount*){0}; }); res_; }); }); }); res_; }); }); }); res_; }); }); }); res_; }); }); }); } +static struct E_S2c__MemCount* f_S2c__jRows(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Row* p_rows, int64_t p_region, struct E_S2c__MemCount* p_c) { srs_tail: return ({ __auto_type s0 = p_rows; s0->tag == 0 ? ({ p_c; }) : ({ __auto_type v_r_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_r_0; ({ __auto_type v_line_2 = s2->u.C_Mem__Row.f_line; __auto_type v_f_3 = s2->u.C_Mem__Row.f_f; __auto_type v_ctor_4 = s2->u.C_Mem__Row.f_ctor; __auto_type v_bytes_5 = s2->u.C_Mem__Row.f_bytes; __auto_type v_dies_6 = s2->u.C_Mem__Row.f_dies; __auto_type v_m_7 = s2->u.C_Mem__Row.f_m; ({ __auto_type res_ = ({ __auto_type s8 = p_c; ({ __auto_type v_once_8 = s8->u.C_S2c__MemCount.f_once; __auto_type v_onceB_9 = s8->u.C_S2c__MemCount.f_onceB; __auto_type v_many_10 = s8->u.C_S2c__MemCount.f_many; __auto_type v_die_11 = s8->u.C_S2c__MemCount.f_die; __auto_type v_site_12 = s8->u.C_S2c__MemCount.f_site; ({ (void)(f_S2c__jSep((v_site_12 == ((int64_t)0)))); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"id\":", 6})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_site_12); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"region\":", 10})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, p_region); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"def\":", 7})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_f_3)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"at\":", 6})); eff__Console->live = 0; r_; })); (void)(f_S2c__jAt(p_fs, v_line_2)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"ctor\":", 8})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_ctor_4)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"bytes\":", 9})); eff__Console->live = 0; r_; })); int64_t v_n_13 = f_S2c__jBytes(v_bytes_5); int64_t v_d_14 = (v_dies_6 ? ((int64_t)1) : ((int64_t)0)); srs_str v_fate_15 = (v_dies_6 ? ((srs_str){(const uint8_t*)",\"fate\":\"dies\"", 14}) : ((srs_str){(const uint8_t*)",\"fate\":\"escapes\"", 17})); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, v_fate_15); eff__Console->live = 0; r_; })); __auto_type res_ = ({ __auto_type s16 = v_m_7; s16->tag == 0 ? ({ ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"mult\":\"once\"}", 15})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__Row* t1 = v_rest_1; int64_t t2 = p_region; struct E_S2c__MemCount* t3 = ({ struct E_S2c__MemCount* o16 = (struct E_S2c__MemCount*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__MemCount, u) + sizeof(((struct E_S2c__MemCount*)0)->u.C_S2c__MemCount))); o16->u.C_S2c__MemCount.t_ = 0; o16->u.C_S2c__MemCount.f_once = (v_once_8 + ((int64_t)1)); o16->u.C_S2c__MemCount.f_onceB = (v_onceB_9 + v_n_13); o16->u.C_S2c__MemCount.f_many = v_many_10; o16->u.C_S2c__MemCount.f_die = (v_die_11 + v_d_14); o16->u.C_S2c__MemCount.f_site = (v_site_12 + ((int64_t)1)); o16; }); p_fs = t0; p_rows = t1; p_region = t2; p_c = t3; goto srs_tail; (struct E_S2c__MemCount*){0}; }); res_; }); }) : ({ __auto_type v_why_16 = s16->u.C_Mem__Many.f_why; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"mult\":\"many\",\"why\":", 21})); eff__Console->live = 0; r_; })); (void)(f_S2c__jWhy(v_why_16)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"}", 1})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__Row* t1 = v_rest_1; int64_t t2 = p_region; struct E_S2c__MemCount* t3 = ({ struct E_S2c__MemCount* o17 = (struct E_S2c__MemCount*)srs_alloc(eff__Region, (int64_t)(offsetof(struct E_S2c__MemCount, u) + sizeof(((struct E_S2c__MemCount*)0)->u.C_S2c__MemCount))); o17->u.C_S2c__MemCount.t_ = 0; o17->u.C_S2c__MemCount.f_once = v_once_8; o17->u.C_S2c__MemCount.f_onceB = v_onceB_9; o17->u.C_S2c__MemCount.f_many = (v_many_10 + ((int64_t)1)); o17->u.C_S2c__MemCount.f_die = (v_die_11 + v_d_14); o17->u.C_S2c__MemCount.f_site = (v_site_12 + ((int64_t)1)); o17; }); p_fs = t0; p_rows = t1; p_region = t2; p_c = t3; goto srs_tail; (struct E_S2c__MemCount*){0}; }); res_; }); }); }); res_; }); }); }); res_; }); }); }); res_; }); }); }); } static int64_t f_S2c__jBytes(struct E_Coll__Option__I64* p_b) { return ({ __auto_type s0 = p_b; s0->tag == 1 ? ({ __auto_type v_n_0 = s0->u.C_Coll__Some.f_v; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_n_0); eff__Console->live = 0; r_; })); __auto_type res_ = v_n_0; res_; }); }) : ({ ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"null", 4})); eff__Console->live = 0; r_; })); __auto_type res_ = ((int64_t)0); res_; }); }); }); } static int64_t f_S2c__jWhy(struct E_Mem__Why* p_w) { return ({ __auto_type s0 = p_w; s0->tag == 0 ? ({ ({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"kind\":\"loop\"}", 15})); eff__Console->live = 0; r_; }); }) : s0->tag == 1 ? ({ __auto_type v_f_0 = s0->u.C_Mem__Sites.f_f; __auto_type v_n_1 = s0->u.C_Mem__Sites.f_n; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"kind\":\"sites\",\"def\":", 22})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_f_0)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"n\":", 5})); eff__Console->live = 0; r_; })); (void)(({ __auto_type r_ = ((int64_t(*)(void*, int64_t))(eff__Console->vt[1]))(eff__Console->self, v_n_1); eff__Console->live = 0; r_; })); __auto_type res_ = ({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"}", 1})); eff__Console->live = 0; r_; }); res_; }); }) : s0->tag == 2 ? ({ __auto_type v_f_0 = s0->u.C_Mem__LoopCalled.f_f; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"kind\":\"loopCalled\",\"def\":", 27})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_f_0)); __auto_type res_ = ({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"}", 1})); eff__Console->live = 0; r_; }); res_; }); }) : ({ __auto_type v_f_0 = s0->u.C_Mem__Via.f_f; ({ (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"kind\":\"via\",\"def\":", 20})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_f_0)); __auto_type res_ = ({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"}", 1})); eff__Console->live = 0; r_; }); res_; }); }); }); } static int64_t f_S2c__jReuses(struct E_Coll__List__S2c__File* p_fs, struct E_Coll__List__Mem__Reuse* p_rs, bool p_first) { srs_tail: return ({ __auto_type s0 = p_rs; s0->tag == 0 ? ({ ((int64_t)0); }) : ({ __auto_type v_r_0 = s0->u.C_Coll__Cons.f_h; __auto_type v_rest_1 = s0->u.C_Coll__Cons.f_t; ({ __auto_type res_ = ({ __auto_type s2 = v_r_0; ({ __auto_type v_line_2 = s2->u.C_Mem__Reuse.f_line; __auto_type v_x_3 = s2->u.C_Mem__Reuse.f_x; __auto_type v_c_4 = s2->u.C_Mem__Reuse.f_c; __auto_type v_k_5 = s2->u.C_Mem__Reuse.f_ctor; ({ (void)(f_S2c__jSep(p_first)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"{\"at\":", 6})); eff__Console->live = 0; r_; })); (void)(f_S2c__jAt(p_fs, v_line_2)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"var\":", 7})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_x_3)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"case\":", 8})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_c_4)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)",\"ctor\":", 8})); eff__Console->live = 0; r_; })); (void)(f_S2c__jSym(v_k_5)); (void)(({ __auto_type r_ = ((int64_t(*)(void*, srs_str))(eff__Console->vt[0]))(eff__Console->self, ((srs_str){(const uint8_t*)"}", 1})); eff__Console->live = 0; r_; })); __auto_type res_ = ({ struct E_Coll__List__S2c__File* t0 = p_fs; struct E_Coll__List__Mem__Reuse* t1 = v_rest_1; bool t2 = false; p_fs = t0; p_rs = t1; p_first = t2; goto srs_tail; (int64_t){0}; }); res_; }); }); }); res_; }); }); }); } diff --git a/s2/mem.srs b/s2/mem.srs index 65a19485..e60b09e0 100644 --- a/s2/mem.srs +++ b/s2/mem.srs @@ -233,13 +233,20 @@ enum Mem.Mult: case Mem.Many(why: Mem.Why) enum Mem.Row: - case Mem.Row(line: I64, ctor: Sym.Sym, bytes: Coll.Option[I64], dies: Bool, m: Mem.Mult) + case Mem.Row(line: I64, f: Sym.Sym, ctor: Sym.Sym, bytes: Coll.Option[I64], dies: Bool, m: Mem.Mult) +// a handled region: the def f that handles it at line as x with handler h, its sites, the defs whose sites fill it (in +// order of first site), and the lines of its manual frees (x.free()); the drop op frees it at the end of its block when +// it is still live enum Mem.Block: - case Mem.Block(line: I64, x: Sym.Sym, h: Sym.Sym, rows: Coll.List[Mem.Row]) + case Mem.Block(line: I64, f: Sym.Sym, x: Sym.Sym, h: Sym.Sym, rows: Coll.List[Mem.Row], defs: Coll.List[Sym.Sym], frees: Coll.List[I64]) + +// a call x.free() in def f at line +enum Mem.FreeAt: + case Mem.FreeAt(f: Sym.Sym, line: I64, x: Sym.Sym) enum Mem.Report: - case Mem.Ok(bs: Coll.List[Mem.Block], rs: Coll.List[Mem.Reuse], cs: Coll.List[Mem.Compact]) + case Mem.Ok(bs: Coll.List[Mem.Block], pf: Coll.List[Mem.FreeAt], rs: Coll.List[Mem.Reuse], cs: Coll.List[Mem.Compact]) case Mem.RulesBad(rel: Sym.Sym) // what the model says, by name or id @@ -267,7 +274,9 @@ def Mem.report(ds: Coll.List[Ast.Decl], sb: Coll.List[Emit.SiteB]): Mem.Report = val need = Mem.names(D.tuples(m, Mem.sSym(Mem.SNeed)), Coll.sEmpty()) val skip = Mem.names(D.tuples(m, Mem.sSym(Mem.SRunSink)), Mem.names(D.tuples(m, Mem.sSym(Mem.SSelf)), Mem.regionDefs(regions, 0, nr, Coll.sEmpty()))) val compact = Mem.pickCompacts(need, skip, Mem.names(D.tuples(m, Mem.sSym(Mem.SNewRet)), Coll.sEmpty()), fl, Coll.Nil) - Mem.Ok(Mem.blocks(md, cs, free, sites, ns, regions, Mem.byLine(Mem.regionKeys(regions, nr, Mem.liveOf(md), Coll.Nil)), Coll.Nil), Mem.byReuseLine(reuse), Mem.reachedOnly(compact, Mem.names(D.tuples(m, Mem.relSym(Mem.RReached)), Coll.sEmpty()), Coll.Nil)) + val mf = Mem.manualFrees(fl, Coll.Nil) + val bs = Mem.blocks(md, cs, free, sites, ns, regions, mf, Mem.byLine(Mem.regionKeys(regions, nr, Mem.liveOf(md), Coll.Nil)), Coll.Nil) + Mem.Ok(bs, Mem.paramFrees(mf, bs, Coll.Nil), Mem.byReuseLine(reuse), Mem.reachedOnly(compact, Mem.names(D.tuples(m, Mem.relSym(Mem.RReached)), Coll.sEmpty()), Coll.Nil)) case D.Unsafe(rel) => Mem.RulesBad(rel) case D.NegCycle(rel) => Mem.RulesBad(rel) @@ -335,22 +344,93 @@ def Mem.vals(xs: Coll.List[Coll.KV[I64]], acc: Coll.List[I64]): Coll.List[I64] = val Coll.KV(_, v) = kv Mem.vals(rest, Coll.Cons(v, acc)) -def Mem.blocks(md: Mem.Model, cs: Coll.SMap[I64], free: Coll.List[Mem.Edge], ss: Coll.IMap[Mem.Site], ns: I64, rs: Coll.IMap[Mem.Region], ids: Coll.List[I64], acc: Coll.List[Mem.Block]): Coll.List[Mem.Block] = ids match +def Mem.blocks(md: Mem.Model, cs: Coll.SMap[I64], free: Coll.List[Mem.Edge], ss: Coll.IMap[Mem.Site], ns: I64, rs: Coll.IMap[Mem.Region], mf: Coll.List[Mem.FreeAt], ids: Coll.List[I64], acc: Coll.List[Mem.Block]): Coll.List[Mem.Block] = ids match case Coll.Nil => Coll.rev(acc) case Coll.Cons(r, rest) => Coll.lookup(rs, r) match case Coll.Some(x) => - val Mem.Region(_, line, nm, h) = x + val Mem.Region(f, line, nm, h) = x val Mem.Model(_, _, byRegion, _, _, _) = md val rows = Mem.rows(md, cs, free, ss, Mem.byLine(Mem.siteKeys(ss, ns, Mem.idsOf(byRegion, r), Coll.Nil)), Coll.Nil) - Mem.blocks(md, cs, free, ss, ns, rs, rest, Coll.Cons(Mem.Block(line, nm, h, rows), acc)) - case Coll.None => Mem.blocks(md, cs, free, ss, ns, rs, rest, acc) + val b = Mem.Block(line, f, nm, h, rows, Mem.rowDefs(rows, Coll.sEmpty(), Coll.Nil), Mem.freeLines(mf, f, nm, line, Coll.Nil)) + Mem.blocks(md, cs, free, ss, ns, rs, mf, rest, Coll.Cons(b, acc)) + case Coll.None => Mem.blocks(md, cs, free, ss, ns, rs, mf, rest, acc) + +// the defs of rows, each once, in order of first row +def Mem.rowDefs(rows: Coll.List[Mem.Row], seen: Coll.SMap[Bool], acc: Coll.List[Sym.Sym]): Coll.List[Sym.Sym] = rows match + case Coll.Nil => Coll.rev(acc) + case Coll.Cons(r, rest) => + val Mem.Row(_, f, _, _, _, _) = r + if Mem.isIn(seen, f) then Mem.rowDefs(rest, seen, acc) else Mem.rowDefs(rest, Coll.sInsert(seen, f, true), Coll.Cons(f, acc)) + +// the lines of the calls x.free() in def f after the handle at line, in order +def Mem.freeLines(mf: Coll.List[Mem.FreeAt], f: Sym.Sym, x: Sym.Sym, line: I64, acc: Coll.List[I64]): Coll.List[I64] = mf match + case Coll.Nil => Coll.rev(acc) + case Coll.Cons(m, rest) => + val Mem.FreeAt(g, l, y) = m + if l > line && Sym.eq(g, f) && Sym.eq(x, y) then Mem.freeLines(rest, f, x, line, Coll.Cons(l, acc)) else Mem.freeLines(rest, f, x, line, acc) + +// the frees of no region its def handles: x is a {} Region param, so the free ends the region its caller passes +def Mem.paramFrees(mf: Coll.List[Mem.FreeAt], bs: Coll.List[Mem.Block], acc: Coll.List[Mem.FreeAt]): Coll.List[Mem.FreeAt] = mf match + case Coll.Nil => Coll.rev(acc) + case Coll.Cons(m, rest) => Mem.paramFrees(rest, bs, if Mem.freedIn(m, bs) then acc else Coll.Cons(m, acc)) + +def Mem.freedIn(m: Mem.FreeAt, bs: Coll.List[Mem.Block]): Bool = bs match + case Coll.Nil => false + case Coll.Cons(b, rest) => + val Mem.FreeAt(f, l, x) = m + val Mem.Block(line, g, y, _, _, _, _) = b + if l > line && Sym.eq(f, g) && Sym.eq(x, y) then true else Mem.freedIn(m, rest) + +// every call x.free() in the bodies of fs, in program order +def Mem.manualFrees(fs: Coll.List[Ast.Fn], acc: Coll.List[Mem.FreeAt]): Coll.List[Mem.FreeAt] = fs match + case Coll.Nil => Coll.rev(acc) + case Coll.Cons(f, rest) => + val Ast.Fn(_, n, _, _, _, _, body) = f + val acc2: Coll.List[Mem.FreeAt] = body match + case Ast.Def(_, e) => Mem.mfx(n, e, acc) + case Ast.Extern(_) => acc + Mem.manualFrees(rest, acc2) + +def Mem.mfx(f: Sym.Sym, e: Ast.Expr, acc: Coll.List[Mem.FreeAt]): Coll.List[Mem.FreeAt] = e match + case Ast.Method(line, r, op, args) => + val acc2 = if Str.eq(Sym.str(op), "free") then Coll.Cons(Mem.FreeAt(f, line, r), acc) else acc + Mem.mfxs(f, args, acc2) + case Ast.Call(_, _, _, _, args) => Mem.mfxs(f, args, acc) + case Ast.Resume(_, _, x) => Mem.mfx(f, x, acc) + case Ast.Bin(_, _, l, r) => Mem.mfx(f, r, Mem.mfx(f, l, acc)) + case Ast.Un(_, _, x) => Mem.mfx(f, x, acc) + case Ast.If(_, c, t, x) => Mem.mfxs(f, Coll.Cons(c, Coll.Cons(t, Coll.Cons(x, Coll.Nil))), acc) + case Ast.Match(_, s, arms) => Mem.mfArms(f, arms, Mem.mfx(f, s, acc)) + case Ast.Block(_, ss, last) => Mem.mfx(f, last, Mem.mfStmts(f, ss, acc)) + case Ast.While(_, c, b) => Mem.mfx(f, b, Mem.mfx(f, c, acc)) + case Ast.Assign(_, _, x) => Mem.mfx(f, x, acc) + case _ => acc + +def Mem.mfxs(f: Sym.Sym, es: Coll.List[Ast.Expr], acc: Coll.List[Mem.FreeAt]): Coll.List[Mem.FreeAt] = es match + case Coll.Nil => acc + case Coll.Cons(e, rest) => Mem.mfxs(f, rest, Mem.mfx(f, e, acc)) + +def Mem.mfArms(f: Sym.Sym, arms: Coll.List[Ast.Arm], acc: Coll.List[Mem.FreeAt]): Coll.List[Mem.FreeAt] = arms match + case Coll.Nil => acc + case Coll.Cons(a, rest) => + val Ast.Arm(_, _, b) = a + Mem.mfArms(f, rest, Mem.mfx(f, b, acc)) + +def Mem.mfStmts(f: Sym.Sym, ss: Coll.List[Ast.Stmt], acc: Coll.List[Mem.FreeAt]): Coll.List[Mem.FreeAt] = ss match + case Coll.Nil => acc + case Coll.Cons(s, rest) => s match + case Ast.Val(_, _, _, e) => Mem.mfStmts(f, rest, Mem.mfx(f, e, acc)) + case Ast.Var(_, _, _, e) => Mem.mfStmts(f, rest, Mem.mfx(f, e, acc)) + case Ast.Handle(_, _, _, args) => Mem.mfStmts(f, rest, Mem.mfxs(f, args, acc)) + case Ast.Do(e) => Mem.mfStmts(f, rest, Mem.mfx(f, e, acc)) + case Ast.Check(_, _, e) => Mem.mfStmts(f, rest, Mem.mfx(f, e, acc)) def Mem.rows(md: Mem.Model, cs: Coll.SMap[I64], free: Coll.List[Mem.Edge], ss: Coll.IMap[Mem.Site], ids: Coll.List[I64], acc: Coll.List[Mem.Row]): Coll.List[Mem.Row] = ids match case Coll.Nil => Coll.rev(acc) case Coll.Cons(s, rest) => Coll.lookup(ss, s) match case Coll.Some(x) => val Mem.Site(f, line, ctor, loop) = x - Mem.rows(md, cs, free, ss, rest, Coll.Cons(Mem.Row(line, ctor, Mem.bytesAt(md, line, ctor), Mem.dies(md, f, line, ctor), Mem.multOf(md, cs, free, f, loop)), acc)) + Mem.rows(md, cs, free, ss, rest, Coll.Cons(Mem.Row(line, f, ctor, Mem.bytesAt(md, line, ctor), Mem.dies(md, f, line, ctor), Mem.multOf(md, cs, free, f, loop)), acc)) case Coll.None => Mem.rows(md, cs, free, ss, rest, acc) // a site in a loop of its def, else its def's reason to be many: its own call sites, a call in a loop, or a caller diff --git a/s2c/main.srs b/s2c/main.srs index 6797c4ea..2f67dd10 100644 --- a/s2c/main.srs +++ b/s2c/main.srs @@ -404,18 +404,21 @@ enum S2c.Mode: // --mem: each Region and the allocation sites that fill it, once or many (s2/mem.srs, vic/c/mem-design.md) case S2c.MemAll -// --mem: one JSON object on one line (read it with jq). regions: each handled Region; sites: -// each allocation site of a region, with its bytes (null for an Array.fill), once or many and why, dies or escapes; -// total: the once sites and their bytes, the many sites, the sites that die; reuse: each match that can build its -// arm's box in the scrutinee's cell (M7a); compact: each def that can run in a scratch region and copy its result out -// (M6a) +// --mem: one JSON object on one line (read it with jq). regions: each handled Region, its def and the defs whose sites +// fill it; sites: each allocation site of a region, its def, its bytes (null for an Array.fill), once or many and why, +// dies or escapes; frees: each region's manual frees and its drop at block end; total: the once sites and their bytes, +// the many sites, the sites that die; reuse: each match that can build its arm's box in the scrutinee's cell (M7a); +// compact: each def that can run in a scratch region and copy its result out (M6a) def S2c.mem(fs: Coll.List[S2c.File], r: Mem.Report): I64 = r match case Mem.RulesBad(rel) => S2c.internal("mem", rel) - case Mem.Ok(bs, rs, cs) => + case Mem.Ok(bs, pf, rs, cs) => Console.print("{\"regions\":[") S2c.jRegions(fs, bs, 0) Console.print("],\"sites\":[") val S2c.MemCount(once, onceB, many, die, _) = S2c.jBlocks(fs, bs, 0, S2c.MemCount(0, 0, 0, 0, 0)) + Console.print("],\"frees\":[") + S2c.jFrees(fs, bs, 0) + S2c.jParamFrees(fs, pf, Coll.length(bs) == 0) Console.print("],\"total\":{\"once\":") Console.printI64(once) Console.print(",\"onceBytes\":") @@ -492,35 +495,86 @@ def S2c.jSep(first: Bool): Unit = if first then () else Console.print(",") def S2c.jRegions(fs: Coll.List[S2c.File], bs: Coll.List[Mem.Block], id: I64): Unit = bs match case Coll.Nil => () case Coll.Cons(b, rest) => - val Mem.Block(line, x, h, _) = b + val Mem.Block(line, f, x, h, _, defs, _) = b S2c.jSep(id == 0) Console.print("{\"id\":") Console.printI64(id) + Console.print(",\"def\":") + S2c.jSym(f) Console.print(",\"at\":") S2c.jAt(fs, line) Console.print(",\"var\":") S2c.jSym(x) Console.print(",\"handler\":") S2c.jSym(h) - Console.print("}") + Console.print(",\"defs\":[") + S2c.jSyms(defs, true) + Console.print("]}") S2c.jRegions(fs, rest, id + 1) +def S2c.jSyms(xs: Coll.List[Sym.Sym], first: Bool): Unit = xs match + case Coll.Nil => () + case Coll.Cons(x, rest) => + S2c.jSep(first) + S2c.jSym(x) + S2c.jSyms(rest, false) + +// each region's manual frees (x.free() at a line), then its drop at the end of its block, which frees it when it is +// still live +def S2c.jFrees(fs: Coll.List[S2c.File], bs: Coll.List[Mem.Block], id: I64): Unit = bs match + case Coll.Nil => () + case Coll.Cons(b, rest) => + val Mem.Block(_, _, _, _, _, _, frees) = b + S2c.jSep(id == 0) + S2c.jManual(fs, frees, id) + Console.print("{\"region\":") + Console.printI64(id) + Console.print(",\"kind\":\"auto\",\"when\":\"blockEnd\",\"ifLive\":true}") + S2c.jFrees(fs, rest, id + 1) + +def S2c.jManual(fs: Coll.List[S2c.File], ls: Coll.List[I64], id: I64): Unit = ls match + case Coll.Nil => () + case Coll.Cons(l, rest) => + Console.print("{\"region\":") + Console.printI64(id) + Console.print(",\"kind\":\"manual\",\"at\":") + S2c.jAt(fs, l) + Console.print("},") + S2c.jManual(fs, rest, id) + +// a manual free of a {} Region param: region null, the def and the param name (its caller passes the region) +def S2c.jParamFrees(fs: Coll.List[S2c.File], pf: Coll.List[Mem.FreeAt], first: Bool): Unit = pf match + case Coll.Nil => () + case Coll.Cons(m, rest) => + val Mem.FreeAt(f, l, x) = m + S2c.jSep(first) + Console.print("{\"region\":null,\"kind\":\"manual\",\"at\":") + S2c.jAt(fs, l) + Console.print(",\"def\":") + S2c.jSym(f) + Console.print(",\"param\":") + S2c.jSym(x) + Console.print("}") + S2c.jParamFrees(fs, rest, false) + def S2c.jBlocks(fs: Coll.List[S2c.File], bs: Coll.List[Mem.Block], region: I64, c: S2c.MemCount): S2c.MemCount = bs match case Coll.Nil => c case Coll.Cons(b, rest) => - val Mem.Block(_, _, _, rows) = b + val Mem.Block(_, _, _, _, rows, _, _) = b S2c.jBlocks(fs, rest, region + 1, S2c.jRows(fs, rows, region, c)) def S2c.jRows(fs: Coll.List[S2c.File], rows: Coll.List[Mem.Row], region: I64, c: S2c.MemCount): S2c.MemCount = rows match case Coll.Nil => c case Coll.Cons(r, rest) => - val Mem.Row(line, ctor, bytes, dies, m) = r + val Mem.Row(line, f, ctor, bytes, dies, m) = r val S2c.MemCount(once, onceB, many, die, site) = c S2c.jSep(site == 0) Console.print("{\"id\":") Console.printI64(site) Console.print(",\"region\":") Console.printI64(region) + Console.print(",\"def\":") + S2c.jSym(f) Console.print(",\"at\":") S2c.jAt(fs, line) Console.print(",\"ctor\":") diff --git a/tests/s2/mem/bytes.out b/tests/s2/mem/bytes.out index ba480651..1492483c 100644 --- a/tests/s2/mem/bytes.out +++ b/tests/s2/mem/bytes.out @@ -1 +1 @@ -{"regions":[{"id":0,"at":"tests/s2/mem/bytes.srs:15","var":"r","handler":"Srs.Arena"}],"sites":[{"id":0,"region":0,"at":"tests/s2/mem/bytes.srs:8","ctor":"MG","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"MG.wrap","n":2}},{"id":1,"region":0,"at":"tests/s2/mem/bytes.srs:18","ctor":"MS","bytes":32,"fate":"dies","mult":"once"}],"total":{"once":1,"onceBytes":32,"many":1,"dies":1},"reuse":[],"compact":[]} +{"regions":[{"id":0,"def":"main","at":"tests/s2/mem/bytes.srs:15","var":"r","handler":"Srs.Arena","defs":["MG.wrap","main"]}],"sites":[{"id":0,"region":0,"def":"MG.wrap","at":"tests/s2/mem/bytes.srs:8","ctor":"MG","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"MG.wrap","n":2}},{"id":1,"region":0,"def":"main","at":"tests/s2/mem/bytes.srs:18","ctor":"MS","bytes":32,"fate":"dies","mult":"once"}],"frees":[{"region":0,"kind":"auto","when":"blockEnd","ifLive":true}],"total":{"once":1,"onceBytes":32,"many":1,"dies":1},"reuse":[],"compact":[]} diff --git a/tests/s2/mem/compact.out b/tests/s2/mem/compact.out index e78fdf2e..1353917d 100644 --- a/tests/s2/mem/compact.out +++ b/tests/s2/mem/compact.out @@ -1 +1 @@ -{"regions":[{"id":0,"at":"tests/s2/mem/compact.srs:35","var":"r","handler":"Srs.Arena"}],"sites":[{"id":0,"region":0,"at":"tests/s2/mem/compact.srs:11","ctor":"CC","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"CL.build","n":6}},{"id":1,"region":0,"at":"tests/s2/mem/compact.srs:20","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":2,"region":0,"at":"tests/s2/mem/compact.srs:30","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":3,"region":0,"at":"tests/s2/mem/compact.srs:38","ctor":"Array.fill","bytes":null,"fate":"escapes","mult":"once"},{"id":4,"region":0,"at":"tests/s2/mem/compact.srs:38","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":5,"region":0,"at":"tests/s2/mem/compact.srs:39","ctor":"CS","bytes":16,"fate":"dies","mult":"once"},{"id":6,"region":0,"at":"tests/s2/mem/compact.srs:44","ctor":"Array.fill","bytes":null,"fate":"escapes","mult":"once"},{"id":7,"region":0,"at":"tests/s2/mem/compact.srs:44","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":8,"region":0,"at":"tests/s2/mem/compact.srs:46","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":9,"region":0,"at":"tests/s2/mem/compact.srs:47","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":10,"region":0,"at":"tests/s2/mem/compact.srs:49","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":11,"region":0,"at":"tests/s2/mem/compact.srs:52","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"}],"total":{"once":11,"onceBytes":144,"many":1,"dies":1},"reuse":[],"compact":[{"at":"tests/s2/mem/compact.srs:20","def":"C.summary"},{"at":"tests/s2/mem/compact.srs:52","def":"C.deep"}]} +{"regions":[{"id":0,"def":"main","at":"tests/s2/mem/compact.srs:35","var":"r","handler":"Srs.Arena","defs":["CL.build","C.summary","C.store","main","C.sink","C.small","C.deep"]}],"sites":[{"id":0,"region":0,"def":"CL.build","at":"tests/s2/mem/compact.srs:11","ctor":"CC","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"CL.build","n":6}},{"id":1,"region":0,"def":"C.summary","at":"tests/s2/mem/compact.srs:20","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":2,"region":0,"def":"C.store","at":"tests/s2/mem/compact.srs:30","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":3,"region":0,"def":"main","at":"tests/s2/mem/compact.srs:38","ctor":"Array.fill","bytes":null,"fate":"escapes","mult":"once"},{"id":4,"region":0,"def":"main","at":"tests/s2/mem/compact.srs:38","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":5,"region":0,"def":"main","at":"tests/s2/mem/compact.srs:39","ctor":"CS","bytes":16,"fate":"dies","mult":"once"},{"id":6,"region":0,"def":"C.sink","at":"tests/s2/mem/compact.srs:44","ctor":"Array.fill","bytes":null,"fate":"escapes","mult":"once"},{"id":7,"region":0,"def":"C.sink","at":"tests/s2/mem/compact.srs:44","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":8,"region":0,"def":"C.sink","at":"tests/s2/mem/compact.srs:46","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":9,"region":0,"def":"C.sink","at":"tests/s2/mem/compact.srs:47","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":10,"region":0,"def":"C.small","at":"tests/s2/mem/compact.srs:49","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"},{"id":11,"region":0,"def":"C.deep","at":"tests/s2/mem/compact.srs:52","ctor":"CS","bytes":16,"fate":"escapes","mult":"once"}],"frees":[{"region":0,"kind":"auto","when":"blockEnd","ifLive":true}],"total":{"once":11,"onceBytes":144,"many":1,"dies":1},"reuse":[],"compact":[{"at":"tests/s2/mem/compact.srs:20","def":"C.summary"},{"at":"tests/s2/mem/compact.srs:52","def":"C.deep"}]} diff --git a/tests/s2/mem/cycle.out b/tests/s2/mem/cycle.out index f0a92b84..351229d4 100644 --- a/tests/s2/mem/cycle.out +++ b/tests/s2/mem/cycle.out @@ -1 +1 @@ -{"regions":[{"id":0,"at":"tests/s2/mem/cycle.srs:14","var":"r","handler":"Srs.Arena"}],"sites":[{"id":0,"region":0,"at":"tests/s2/mem/cycle.srs:10","ctor":"MT","bytes":16,"fate":"dies","mult":"many","why":{"kind":"via","def":"MT.a"}}],"total":{"once":0,"onceBytes":0,"many":1,"dies":1},"reuse":[],"compact":[]} +{"regions":[{"id":0,"def":"main","at":"tests/s2/mem/cycle.srs:14","var":"r","handler":"Srs.Arena","defs":["MT.b"]}],"sites":[{"id":0,"region":0,"def":"MT.b","at":"tests/s2/mem/cycle.srs:10","ctor":"MT","bytes":16,"fate":"dies","mult":"many","why":{"kind":"via","def":"MT.a"}}],"frees":[{"region":0,"kind":"auto","when":"blockEnd","ifLive":true}],"total":{"once":0,"onceBytes":0,"many":1,"dies":1},"reuse":[],"compact":[]} diff --git a/tests/s2/mem/death.out b/tests/s2/mem/death.out index bf09dfc9..35852d86 100644 --- a/tests/s2/mem/death.out +++ b/tests/s2/mem/death.out @@ -1 +1 @@ -{"regions":[{"id":0,"at":"tests/s2/mem/death.srs:23","var":"r","handler":"Srs.Arena"}],"sites":[{"id":0,"region":0,"at":"tests/s2/mem/death.srs:10","ctor":"MD","bytes":16,"fate":"escapes","mult":"once"},{"id":1,"region":0,"at":"tests/s2/mem/death.srs:12","ctor":"MD","bytes":16,"fate":"dies","mult":"once"},{"id":2,"region":0,"at":"tests/s2/mem/death.srs:14","ctor":"MD","bytes":16,"fate":"escapes","mult":"once"},{"id":3,"region":0,"at":"tests/s2/mem/death.srs:17","ctor":"MD","bytes":16,"fate":"dies","mult":"once"},{"id":4,"region":0,"at":"tests/s2/mem/death.srs:18","ctor":"MD","bytes":16,"fate":"dies","mult":"once"},{"id":5,"region":0,"at":"tests/s2/mem/death.srs:30","ctor":"MW","bytes":16,"fate":"escapes","mult":"once"},{"id":6,"region":0,"at":"tests/s2/mem/death.srs:30","ctor":"MD","bytes":16,"fate":"escapes","mult":"once"}],"total":{"once":7,"onceBytes":112,"many":0,"dies":3},"reuse":[],"compact":[]} +{"regions":[{"id":0,"def":"main","at":"tests/s2/mem/death.srs:23","var":"r","handler":"Srs.Arena","defs":["MD.make","MD.peek","MD.wrap","MD.keep","MD.box"]}],"sites":[{"id":0,"region":0,"def":"MD.make","at":"tests/s2/mem/death.srs:10","ctor":"MD","bytes":16,"fate":"escapes","mult":"once"},{"id":1,"region":0,"def":"MD.peek","at":"tests/s2/mem/death.srs:12","ctor":"MD","bytes":16,"fate":"dies","mult":"once"},{"id":2,"region":0,"def":"MD.wrap","at":"tests/s2/mem/death.srs:14","ctor":"MD","bytes":16,"fate":"escapes","mult":"once"},{"id":3,"region":0,"def":"MD.keep","at":"tests/s2/mem/death.srs:17","ctor":"MD","bytes":16,"fate":"dies","mult":"once"},{"id":4,"region":0,"def":"MD.keep","at":"tests/s2/mem/death.srs:18","ctor":"MD","bytes":16,"fate":"dies","mult":"once"},{"id":5,"region":0,"def":"MD.box","at":"tests/s2/mem/death.srs:30","ctor":"MW","bytes":16,"fate":"escapes","mult":"once"},{"id":6,"region":0,"def":"MD.box","at":"tests/s2/mem/death.srs:30","ctor":"MD","bytes":16,"fate":"escapes","mult":"once"}],"frees":[{"region":0,"kind":"auto","when":"blockEnd","ifLive":true}],"total":{"once":7,"onceBytes":112,"many":0,"dies":3},"reuse":[],"compact":[]} diff --git a/tests/s2/mem/frees.out b/tests/s2/mem/frees.out new file mode 100644 index 00000000..3eb1b568 --- /dev/null +++ b/tests/s2/mem/frees.out @@ -0,0 +1 @@ +{"regions":[{"id":0,"def":"main","at":"tests/s2/mem/frees.srs:18","var":"r","handler":"Srs.Arena","defs":["main"]},{"id":1,"def":"main","at":"tests/s2/mem/frees.srs:21","var":"t","handler":"Srs.Arena","defs":["FR.mk","main"]},{"id":2,"def":"main","at":"tests/s2/mem/frees.srs:23","var":"u","handler":"Srs.Arena","defs":[]}],"sites":[{"id":0,"region":0,"def":"main","at":"tests/s2/mem/frees.srs:19","ctor":"FB","bytes":16,"fate":"dies","mult":"once"},{"id":1,"region":1,"def":"FR.mk","at":"tests/s2/mem/frees.srs:10","ctor":"FB","bytes":16,"fate":"escapes","mult":"once"},{"id":2,"region":1,"def":"main","at":"tests/s2/mem/frees.srs:22","ctor":"FB","bytes":16,"fate":"dies","mult":"once"}],"frees":[{"region":0,"kind":"manual","at":"tests/s2/mem/frees.srs:20"},{"region":0,"kind":"auto","when":"blockEnd","ifLive":true},{"region":1,"kind":"auto","when":"blockEnd","ifLive":true},{"region":2,"kind":"auto","when":"blockEnd","ifLive":true},{"region":null,"kind":"manual","at":"tests/s2/mem/frees.srs:13","def":"FR.drain","param":"s"}],"total":{"once":3,"onceBytes":48,"many":0,"dies":2},"reuse":[],"compact":[]} diff --git a/tests/s2/mem/frees.srs b/tests/s2/mem/frees.srs new file mode 100644 index 00000000..81c6bd4d --- /dev/null +++ b/tests/s2/mem/frees.srs @@ -0,0 +1,25 @@ +// mem: frees. main's region r is freed by hand, then the drop at its block end finds it dead; t is freed only by the +// drop; FR.drain frees the {s: Region} param its caller passes (region null: the call gives it); FR.mk and main both +// fill t (two defs share one region) +enum FB: + case FB(v: I64) + +def FB.get(b: FB): I64 = b match + case FB(v) => v + +def FR.mk(x: I64): FB = FB(x) + +def FR.drain {s: Region} (n: I64): I64 = + s.free() + n + +def main(): I64 = + handle io = Srs.Console() + handle r = Srs.Arena() + val a = FB.get(FB(1)) + r.free() + handle t = Srs.Arena() + val b = FB.get(FR.mk(2)) + FB.get(FB(3)) + handle u = Srs.Arena() + Console.printI64(a + b + FR.drain{u}(4)) + 0 diff --git a/tests/s2/mem/inner.out b/tests/s2/mem/inner.out index 5d310839..39b3b9bd 100644 --- a/tests/s2/mem/inner.out +++ b/tests/s2/mem/inner.out @@ -1 +1 @@ -{"regions":[{"id":0,"at":"tests/s2/mem/inner.srs:12","var":"s","handler":"Srs.Arena"},{"id":1,"at":"tests/s2/mem/inner.srs:21","var":"r","handler":"Srs.Arena"}],"sites":[{"id":0,"region":0,"at":"tests/s2/mem/inner.srs:9","ctor":"MB","bytes":16,"fate":"escapes","mult":"once"},{"id":1,"region":1,"at":"tests/s2/mem/inner.srs:22","ctor":"MB","bytes":16,"fate":"dies","mult":"once"}],"total":{"once":2,"onceBytes":32,"many":0,"dies":1},"reuse":[],"compact":[]} +{"regions":[{"id":0,"def":"MB.work","at":"tests/s2/mem/inner.srs:12","var":"s","handler":"Srs.Arena","defs":["MB.mk"]},{"id":1,"def":"main","at":"tests/s2/mem/inner.srs:21","var":"r","handler":"Srs.Arena","defs":["main"]}],"sites":[{"id":0,"region":0,"def":"MB.mk","at":"tests/s2/mem/inner.srs:9","ctor":"MB","bytes":16,"fate":"escapes","mult":"once"},{"id":1,"region":1,"def":"main","at":"tests/s2/mem/inner.srs:22","ctor":"MB","bytes":16,"fate":"dies","mult":"once"}],"frees":[{"region":0,"kind":"auto","when":"blockEnd","ifLive":true},{"region":1,"kind":"auto","when":"blockEnd","ifLive":true}],"total":{"once":2,"onceBytes":32,"many":0,"dies":1},"reuse":[],"compact":[]} diff --git a/tests/s2/mem/many.out b/tests/s2/mem/many.out index becd5f3e..73e1fb5d 100644 --- a/tests/s2/mem/many.out +++ b/tests/s2/mem/many.out @@ -1 +1 @@ -{"regions":[{"id":0,"at":"tests/s2/mem/many.srs:16","var":"r","handler":"Srs.Arena"}],"sites":[{"id":0,"region":0,"at":"tests/s2/mem/many.srs:6","ctor":"MCons","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"ML.build","n":2}},{"id":1,"region":0,"at":"tests/s2/mem/many.srs:8","ctor":"MCons","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"ML.one","n":2}}],"total":{"once":0,"onceBytes":0,"many":2,"dies":0},"reuse":[],"compact":[]} +{"regions":[{"id":0,"def":"main","at":"tests/s2/mem/many.srs:16","var":"r","handler":"Srs.Arena","defs":["ML.build","ML.one"]}],"sites":[{"id":0,"region":0,"def":"ML.build","at":"tests/s2/mem/many.srs:6","ctor":"MCons","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"ML.build","n":2}},{"id":1,"region":0,"def":"ML.one","at":"tests/s2/mem/many.srs:8","ctor":"MCons","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"ML.one","n":2}}],"frees":[{"region":0,"kind":"auto","when":"blockEnd","ifLive":true}],"total":{"once":0,"onceBytes":0,"many":2,"dies":0},"reuse":[],"compact":[]} diff --git a/tests/s2/mem/once.out b/tests/s2/mem/once.out index 6644482a..edf6e6e3 100644 --- a/tests/s2/mem/once.out +++ b/tests/s2/mem/once.out @@ -1 +1 @@ -{"regions":[{"id":0,"at":"tests/s2/mem/once.srs:12","var":"r","handler":"Srs.Arena"}],"sites":[{"id":0,"region":0,"at":"tests/s2/mem/once.srs:13","ctor":"MP","bytes":24,"fate":"dies","mult":"once"}],"total":{"once":1,"onceBytes":24,"many":0,"dies":1},"reuse":[],"compact":[]} +{"regions":[{"id":0,"def":"main","at":"tests/s2/mem/once.srs:12","var":"r","handler":"Srs.Arena","defs":["main"]}],"sites":[{"id":0,"region":0,"def":"main","at":"tests/s2/mem/once.srs:13","ctor":"MP","bytes":24,"fate":"dies","mult":"once"}],"frees":[{"region":0,"kind":"auto","when":"blockEnd","ifLive":true}],"total":{"once":1,"onceBytes":24,"many":0,"dies":1},"reuse":[],"compact":[]} diff --git a/tests/s2/mem/reasons.out b/tests/s2/mem/reasons.out index 5a662425..66eaacc7 100644 --- a/tests/s2/mem/reasons.out +++ b/tests/s2/mem/reasons.out @@ -1 +1 @@ -{"regions":[{"id":0,"at":"tests/s2/mem/reasons.srs:41","var":"r","handler":"Srs.Arena"}],"sites":[{"id":0,"region":0,"at":"tests/s2/mem/reasons.srs:11","ctor":"ME","bytes":16,"fate":"escapes","mult":"once"},{"id":1,"region":0,"at":"tests/s2/mem/reasons.srs:14","ctor":"ME","bytes":16,"fate":"dies","mult":"once"},{"id":2,"region":0,"at":"tests/s2/mem/reasons.srs:17","ctor":"ME","bytes":16,"fate":"dies","mult":"once"},{"id":3,"region":0,"at":"tests/s2/mem/reasons.srs:18","ctor":"MF","bytes":16,"fate":"dies","mult":"once"},{"id":4,"region":0,"at":"tests/s2/mem/reasons.srs:21","ctor":"ME","bytes":16,"fate":"escapes","mult":"once"},{"id":5,"region":0,"at":"tests/s2/mem/reasons.srs:25","ctor":"ME","bytes":16,"fate":"dies","mult":"once"},{"id":6,"region":0,"at":"tests/s2/mem/reasons.srs:34","ctor":"MF","bytes":16,"fate":"escapes","mult":"once"},{"id":7,"region":0,"at":"tests/s2/mem/reasons.srs:34","ctor":"ME","bytes":16,"fate":"escapes","mult":"once"},{"id":8,"region":0,"at":"tests/s2/mem/reasons.srs:43","ctor":"Array.fill","bytes":null,"fate":"escapes","mult":"once"},{"id":9,"region":0,"at":"tests/s2/mem/reasons.srs:43","ctor":"ME","bytes":16,"fate":"escapes","mult":"once"}],"total":{"once":10,"onceBytes":144,"many":0,"dies":4},"reuse":[],"compact":[]} +{"regions":[{"id":0,"def":"main","at":"tests/s2/mem/reasons.srs:41","var":"r","handler":"Srs.Arena","defs":["ME.put","ME.read","ME.nest","ME.give","ME.drop","MF.out","main"]}],"sites":[{"id":0,"region":0,"def":"ME.put","at":"tests/s2/mem/reasons.srs:11","ctor":"ME","bytes":16,"fate":"escapes","mult":"once"},{"id":1,"region":0,"def":"ME.read","at":"tests/s2/mem/reasons.srs:14","ctor":"ME","bytes":16,"fate":"dies","mult":"once"},{"id":2,"region":0,"def":"ME.nest","at":"tests/s2/mem/reasons.srs:17","ctor":"ME","bytes":16,"fate":"dies","mult":"once"},{"id":3,"region":0,"def":"ME.nest","at":"tests/s2/mem/reasons.srs:18","ctor":"MF","bytes":16,"fate":"dies","mult":"once"},{"id":4,"region":0,"def":"ME.give","at":"tests/s2/mem/reasons.srs:21","ctor":"ME","bytes":16,"fate":"escapes","mult":"once"},{"id":5,"region":0,"def":"ME.drop","at":"tests/s2/mem/reasons.srs:25","ctor":"ME","bytes":16,"fate":"dies","mult":"once"},{"id":6,"region":0,"def":"MF.out","at":"tests/s2/mem/reasons.srs:34","ctor":"MF","bytes":16,"fate":"escapes","mult":"once"},{"id":7,"region":0,"def":"MF.out","at":"tests/s2/mem/reasons.srs:34","ctor":"ME","bytes":16,"fate":"escapes","mult":"once"},{"id":8,"region":0,"def":"main","at":"tests/s2/mem/reasons.srs:43","ctor":"Array.fill","bytes":null,"fate":"escapes","mult":"once"},{"id":9,"region":0,"def":"main","at":"tests/s2/mem/reasons.srs:43","ctor":"ME","bytes":16,"fate":"escapes","mult":"once"}],"frees":[{"region":0,"kind":"auto","when":"blockEnd","ifLive":true}],"total":{"once":10,"onceBytes":144,"many":0,"dies":4},"reuse":[],"compact":[]} diff --git a/tests/s2/mem/reuse.out b/tests/s2/mem/reuse.out index 3bd3a415..764fa74c 100644 --- a/tests/s2/mem/reuse.out +++ b/tests/s2/mem/reuse.out @@ -1 +1 @@ -{"regions":[{"id":0,"at":"tests/s2/mem/reuse.srs:40","var":"r","handler":"Srs.Arena"}],"sites":[{"id":0,"region":0,"at":"tests/s2/mem/reuse.srs:9","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":1,"region":0,"at":"tests/s2/mem/reuse.srs:11","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":2,"region":0,"at":"tests/s2/mem/reuse.srs:15","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":3,"region":0,"at":"tests/s2/mem/reuse.srs:17","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":4,"region":0,"at":"tests/s2/mem/reuse.srs:21","ctor":"RB","bytes":16,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"RB.bump","n":3}},{"id":5,"region":0,"at":"tests/s2/mem/reuse.srs:24","ctor":"RB","bytes":16,"fate":"escapes","mult":"once"},{"id":6,"region":0,"at":"tests/s2/mem/reuse.srs:32","ctor":"RCons","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"RL.rev","n":2}},{"id":7,"region":0,"at":"tests/s2/mem/reuse.srs:41","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":8,"region":0,"at":"tests/s2/mem/reuse.srs:45","ctor":"Array.fill","bytes":null,"fate":"dies","mult":"once"},{"id":9,"region":0,"at":"tests/s2/mem/reuse.srs:45","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":10,"region":0,"at":"tests/s2/mem/reuse.srs:46","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":11,"region":0,"at":"tests/s2/mem/reuse.srs:46","ctor":"RCons","bytes":24,"fate":"dies","mult":"once"},{"id":12,"region":0,"at":"tests/s2/mem/reuse.srs:46","ctor":"RCons","bytes":24,"fate":"dies","mult":"once"},{"id":13,"region":0,"at":"tests/s2/mem/reuse.srs:46","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":14,"region":0,"at":"tests/s2/mem/reuse.srs:46","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":15,"region":0,"at":"tests/s2/mem/reuse.srs:46","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":16,"region":0,"at":"tests/s2/mem/reuse.srs:54","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":17,"region":0,"at":"tests/s2/mem/reuse.srs:59","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":18,"region":0,"at":"tests/s2/mem/reuse.srs:61","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":19,"region":0,"at":"tests/s2/mem/reuse.srs:65","ctor":"RB","bytes":16,"fate":"escapes","mult":"once"},{"id":20,"region":0,"at":"tests/s2/mem/reuse.srs:74","ctor":"RB","bytes":16,"fate":"escapes","mult":"once"},{"id":21,"region":0,"at":"tests/s2/mem/reuse.srs:84","ctor":"RB","bytes":16,"fate":"dies","mult":"once"}],"total":{"once":20,"onceBytes":320,"many":2,"dies":17},"reuse":[{"at":"tests/s2/mem/reuse.srs:10","var":"b","case":"RB","ctor":"RB"},{"at":"tests/s2/mem/reuse.srs:20","var":"b","case":"RB","ctor":"RB"},{"at":"tests/s2/mem/reuse.srs:30","var":"l","case":"RCons","ctor":"RCons"},{"at":"tests/s2/mem/reuse.srs:64","var":"b","case":"RB","ctor":"RB"},{"at":"tests/s2/mem/reuse.srs:73","var":"b","case":"RB","ctor":"RB"}],"compact":[]} +{"regions":[{"id":0,"def":"main","at":"tests/s2/mem/reuse.srs:40","var":"r","handler":"Srs.Arena","defs":["RB.local","RB.twice","RB.bump","RB.bumpS","RL.rev","main","RB.viaKeep","RB.fromArr","RB.bumpT","RB.bumpU","RB.split"]}],"sites":[{"id":0,"region":0,"def":"RB.local","at":"tests/s2/mem/reuse.srs:9","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":1,"region":0,"def":"RB.local","at":"tests/s2/mem/reuse.srs:11","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":2,"region":0,"def":"RB.twice","at":"tests/s2/mem/reuse.srs:15","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":3,"region":0,"def":"RB.twice","at":"tests/s2/mem/reuse.srs:17","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":4,"region":0,"def":"RB.bump","at":"tests/s2/mem/reuse.srs:21","ctor":"RB","bytes":16,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"RB.bump","n":3}},{"id":5,"region":0,"def":"RB.bumpS","at":"tests/s2/mem/reuse.srs:24","ctor":"RB","bytes":16,"fate":"escapes","mult":"once"},{"id":6,"region":0,"def":"RL.rev","at":"tests/s2/mem/reuse.srs:32","ctor":"RCons","bytes":24,"fate":"escapes","mult":"many","why":{"kind":"sites","def":"RL.rev","n":2}},{"id":7,"region":0,"def":"main","at":"tests/s2/mem/reuse.srs:41","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":8,"region":0,"def":"main","at":"tests/s2/mem/reuse.srs:45","ctor":"Array.fill","bytes":null,"fate":"dies","mult":"once"},{"id":9,"region":0,"def":"main","at":"tests/s2/mem/reuse.srs:45","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":10,"region":0,"def":"main","at":"tests/s2/mem/reuse.srs:46","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":11,"region":0,"def":"main","at":"tests/s2/mem/reuse.srs:46","ctor":"RCons","bytes":24,"fate":"dies","mult":"once"},{"id":12,"region":0,"def":"main","at":"tests/s2/mem/reuse.srs:46","ctor":"RCons","bytes":24,"fate":"dies","mult":"once"},{"id":13,"region":0,"def":"main","at":"tests/s2/mem/reuse.srs:46","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":14,"region":0,"def":"main","at":"tests/s2/mem/reuse.srs:46","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":15,"region":0,"def":"main","at":"tests/s2/mem/reuse.srs:46","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":16,"region":0,"def":"RB.viaKeep","at":"tests/s2/mem/reuse.srs:54","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":17,"region":0,"def":"RB.fromArr","at":"tests/s2/mem/reuse.srs:59","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":18,"region":0,"def":"RB.fromArr","at":"tests/s2/mem/reuse.srs:61","ctor":"RB","bytes":16,"fate":"dies","mult":"once"},{"id":19,"region":0,"def":"RB.bumpT","at":"tests/s2/mem/reuse.srs:65","ctor":"RB","bytes":16,"fate":"escapes","mult":"once"},{"id":20,"region":0,"def":"RB.bumpU","at":"tests/s2/mem/reuse.srs:74","ctor":"RB","bytes":16,"fate":"escapes","mult":"once"},{"id":21,"region":0,"def":"RB.split","at":"tests/s2/mem/reuse.srs:84","ctor":"RB","bytes":16,"fate":"dies","mult":"once"}],"frees":[{"region":0,"kind":"auto","when":"blockEnd","ifLive":true}],"total":{"once":20,"onceBytes":320,"many":2,"dies":17},"reuse":[{"at":"tests/s2/mem/reuse.srs:10","var":"b","case":"RB","ctor":"RB"},{"at":"tests/s2/mem/reuse.srs:20","var":"b","case":"RB","ctor":"RB"},{"at":"tests/s2/mem/reuse.srs:30","var":"l","case":"RCons","ctor":"RCons"},{"at":"tests/s2/mem/reuse.srs:64","var":"b","case":"RB","ctor":"RB"},{"at":"tests/s2/mem/reuse.srs:73","var":"b","case":"RB","ctor":"RB"}],"compact":[]}