From faa084cca9c764e86c2751109352a599a8782b8a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 14 Aug 2016 18:09:49 -0700 Subject: [PATCH 001/286] get rid of old Alt enum --- all.h | 9 --------- sysv.c | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/all.h b/all.h index 5f87466..5a5c3c0 100644 --- a/all.h +++ b/all.h @@ -100,15 +100,6 @@ struct Ref { uint32_t val:29; }; -enum Alt { - AType, - ACall, - AMem, - - AShift = 28, - AMask = (1<size = 8; a->cls[0] = i->cls; } else { - n = i->arg[0].val & AMask; + n = i->arg[0].val; aclass(a, &typ[n]); if (a->inmem) continue; From 8ca73af85a2351b99e0d19564548dd35ccf61011 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 14 Aug 2016 18:11:49 -0700 Subject: [PATCH 002/286] use an enum for aggregate segments --- all.h | 11 ++++++++--- parse.c | 13 ++++++------- sysv.c | 13 ++++++++----- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/all.h b/all.h index 5a5c3c0..34ad47e 100644 --- a/all.h +++ b/all.h @@ -425,9 +425,14 @@ struct Typ { ulong size; int align; - struct { - uint isflt:1; - uint ispad:1; + struct Seg { + enum { + Spad, + Sint, + Sflt, + Styp, + }; + uint type:2; uint len:30; } seg[NSeg+1]; }; diff --git a/parse.c b/parse.c index 4d6b345..924b5f5 100644 --- a/parse.c +++ b/parse.c @@ -791,7 +791,7 @@ static void parsetyp() { Typ *ty; - int t, n, c, a, al, flt; + int t, n, c, a, al, type; ulong sz, s; if (ntyp >= NTyp) @@ -825,12 +825,12 @@ parsetyp() sz = 0; al = 0; while (t != Trbrace) { - flt = 0; + type = Sint; switch (t) { default: err("invalid size specifier %c", tokval.chr); - case Td: flt = 1; + case Td: type = Sflt; case Tl: s = 8; a = 3; break; - case Ts: flt = 1; + case Ts: type = Sflt; case Tw: s = 4; a = 2; break; case Th: s = 2; a = 1; break; case Tb: s = 1; a = 0; break; @@ -841,7 +841,7 @@ parsetyp() a = s - a; if (n < NSeg) { /* padding segment */ - ty->seg[n].ispad = 1; + ty->seg[n].type = Spad; ty->seg[n].len = a; n++; } @@ -854,8 +854,7 @@ parsetyp() c = 1; sz += a + c*s; for (; c>0 && nseg[n].isflt = flt; - ty->seg[n].ispad = 0; + ty->seg[n].type = type; ty->seg[n].len = s; } if (t != Tcomma) diff --git a/sysv.c b/sysv.c index b011bff..c8bc730 100644 --- a/sysv.c +++ b/sysv.c @@ -49,15 +49,18 @@ aclass(AClass *a, Typ *t) for (e=0, s=0; e<2; e++) { cls = -1; for (n=0; n<8 && t->seg[s].len; s++) { - if (t->seg[s].ispad) { + switch (t->seg[s].type) { + case Spad: /* don't change anything */ - } - else if (t->seg[s].isflt) { + break; + case Sflt: if (cls == -1) cls = Kd; - } - else + break; + case Sint: cls = Kl; + break; + } n += t->seg[s].len; } assert(n <= 8); From 5ad8a2c6fe90554bb6ad425597be732328fe0e41 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 14 Aug 2016 20:03:39 -0700 Subject: [PATCH 003/286] couple of case fixes in tokens --- parse.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/parse.c b/parse.c index 924b5f5..2e7726d 100644 --- a/parse.c +++ b/parse.c @@ -119,8 +119,8 @@ enum { Ttmp, Tlbl, Tglo, - TTyp, - TStr, + Ttyp, + Tstr, Tplus, Teq, @@ -245,7 +245,7 @@ lex() t = Tglo; goto Alpha; case ':': - t = TTyp; + t = Ttyp; goto Alpha; case '#': while ((c=fgetc(inf)) != '\n' && c != EOF) @@ -270,7 +270,7 @@ lex() if (c == '"') if (!i || tokval.str[i-1] != '\\') { tokval.str[i] = 0; - return TStr; + return Tstr; } tokval.str[i] = c; } @@ -419,7 +419,7 @@ parsecls(int *tyn) switch (next()) { default: err("invalid class specifier"); - case TTyp: + case Ttyp: for (i=0; ialign = -1; - if (nextnl() != TTyp || nextnl() != Teq) + if (nextnl() != Ttyp || nextnl() != Teq) err("type name, then = expected"); strcpy(ty->name, tokval.str); t = nextnl(); @@ -955,7 +955,7 @@ parsedat(void cb(Dat *), int export) d.u.num = tokval.num; else if (t == Tglo) parsedatref(&d); - else if (t == TStr) + else if (t == Tstr) parsedatstr(&d); else err("constant literal expected"); From 3f8af2ba7b8f79bd577ca4f2fef5fb922494042d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 14 Aug 2016 21:57:27 -0700 Subject: [PATCH 004/286] specify the allocation function in vnew --- all.h | 3 ++- fold.c | 3 ++- parse.c | 12 ++++++------ ssa.c | 4 ++-- util.c | 20 ++++++++++++++++++-- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/all.h b/all.h index 34ad47e..08056c4 100644 --- a/all.h +++ b/all.h @@ -485,7 +485,8 @@ void emit(int, int, Ref, Ref, Ref); void emiti(Ins); void idup(Ins **, Ins *, ulong); Ins *icpy(Ins *, Ins *, ulong); -void *vnew(ulong, size_t); +void *vnew(ulong, size_t, void *(size_t)); +void vfree(void *); void vgrow(void *, ulong); int clsmerge(short *, short); int phicls(int, Tmp *); diff --git a/fold.c b/fold.c index da566ab..c2a7c12 100644 --- a/fold.c +++ b/fold.c @@ -193,7 +193,7 @@ fold(Fn *fn) val = emalloc(fn->ntmp * sizeof val[0]); edge = emalloc(fn->nblk * sizeof edge[0]); - usewrk = vnew(0, sizeof usewrk[0]); + usewrk = vnew(0, sizeof usewrk[0], emalloc); for (n=0; nntmp; n++) val[n] = Top; @@ -314,6 +314,7 @@ fold(Fn *fn) free(val); free(edge); + vfree(usewrk); } /* boring folding code */ diff --git a/parse.c b/parse.c index 2e7726d..38c212e 100644 --- a/parse.c +++ b/parse.c @@ -261,7 +261,7 @@ lex() return Tint; } if (c == '"') { - tokval.str = vnew(0, 1); + tokval.str = vnew(0, 1, alloc); for (i=0;; i++) { c = fgetc(inf); if (c == EOF) @@ -425,7 +425,7 @@ parsecls(int *tyn) *tyn = i; return 4; } - err("undefined type"); + err("undefined type :%s", tokval.str); case Tw: return Kw; case Tl: @@ -752,11 +752,11 @@ parsefn(int export) curf = alloc(sizeof *curf); curf->ntmp = 0; curf->ncon = 1; /* first constant must be 0 */ - curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0]); - curf->con = vnew(curf->ncon, sizeof curf->con[0]); + curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0], alloc); + curf->con = vnew(curf->ncon, sizeof curf->con[0], alloc); for (r=0; rcon[0].type = CBits; curf->export = export; blink = &curf->start; @@ -779,7 +779,7 @@ parsefn(int export) err("empty function"); if (curb->jmp.type == Jxxx) err("last block misses jump"); - curf->mem = vnew(0, sizeof curf->mem[0]); + curf->mem = vnew(0, sizeof curf->mem[0], alloc); curf->nmem = 0; curf->nblk = nblk; curf->rpo = 0; diff --git a/ssa.c b/ssa.c index a2efb28..4b78fe3 100644 --- a/ssa.c +++ b/ssa.c @@ -52,7 +52,7 @@ filluse(Fn *fn) tmp[t].phi = 0; tmp[t].cls = 0; if (tmp[t].use == 0) - tmp[t].use = vnew(0, sizeof(Use)); + tmp[t].use = vnew(0, sizeof(Use), alloc); } for (b=fn->start; b; b=b->link) { for (p=b->phi; p; p=p->link) { @@ -253,7 +253,7 @@ addfron(Blk *a, Blk *b) if (a->fron[n] == b) return; if (!a->nfron) - a->fron = vnew(++a->nfron, sizeof a->fron[0]); + a->fron = vnew(++a->nfron, sizeof a->fron[0], alloc); else vgrow(&a->fron, ++a->nfron); a->fron[a->nfron-1] = b; diff --git a/util.c b/util.c index 527f214..a99e2dd 100644 --- a/util.c +++ b/util.c @@ -6,6 +6,7 @@ typedef struct Vec Vec; struct Vec { ulong mag; + void *(*alloc)(); size_t esz; ulong cap; union { @@ -159,7 +160,7 @@ icpy(Ins *d, Ins *s, ulong n) } void * -vnew(ulong len, size_t esz) +vnew(ulong len, size_t esz, void *alloc(size_t)) { ulong cap; Vec *v; @@ -170,9 +171,23 @@ vnew(ulong len, size_t esz) v->mag = VMag; v->cap = cap; v->esz = esz; + v->alloc = alloc; return v + 1; } +void +vfree(void *p) +{ + Vec *v; + + v = (Vec *)p - 1; + assert(v->mag == VMag); + if (v->alloc == emalloc) { + v->mag = 0; + free(v); + } +} + void vgrow(void *vp, ulong len) { @@ -183,8 +198,9 @@ vgrow(void *vp, ulong len) assert(v+1 && v->mag == VMag); if (v->cap >= len) return; - v1 = vnew(len, v->esz); + v1 = vnew(len, v->esz, v->alloc); memcpy(v1, v+1, v->cap * v->esz); + vfree(v+1); *(Vec **)vp = v1; } From fbbb8e4d78e8b2e9410699fd27af282cc6ddfc4b Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 15 Aug 2016 22:59:52 -0700 Subject: [PATCH 005/286] parse union types --- all.h | 8 +-- parse.c | 163 +++++++++++++++++++++++++++++++++----------------------- sysv.c | 11 ++-- 3 files changed, 110 insertions(+), 72 deletions(-) diff --git a/all.h b/all.h index 08056c4..b6392e5 100644 --- a/all.h +++ b/all.h @@ -25,6 +25,7 @@ typedef struct Con Con; typedef struct Addr Mem; typedef struct Fn Fn; typedef struct Typ Typ; +typedef struct Seg Seg; typedef struct Dat Dat; enum Reg { @@ -422,8 +423,9 @@ struct Fn { struct Typ { char name[NString]; int dark; - ulong size; int align; + size_t size; + int nunion; struct Seg { enum { @@ -433,8 +435,8 @@ struct Typ { Styp, }; uint type:2; - uint len:30; - } seg[NSeg+1]; + uint len:30; /* index in typ[] for Styp */ + } (*seg)[NSeg+1]; }; struct Dat { diff --git a/parse.c b/parse.c index 38c212e..7afa977 100644 --- a/parse.c +++ b/parse.c @@ -412,20 +412,23 @@ parseref() } static int -parsecls(int *tyn) +findtyp(int i) { - int i; + while (--i >= 0) + if (strcmp(tokval.str, typ[i].name) == 0) + return i; + err("undefined type :%s", tokval.str); +} +static int +parsecls(int *tyn) +{ switch (next()) { default: err("invalid class specifier"); case Ttyp: - for (i=0; ialign; + while (t != Trbrace) { + type = Sint; + switch (t) { + default: err("invalid type member specifier"); + case Td: type = Sflt; + case Tl: s = 8; a = 3; break; + case Ts: type = Sflt; + case Tw: s = 4; a = 2; break; + case Th: s = 2; a = 1; break; + case Tb: s = 1; a = 0; break; + case Ttyp: + type = Styp; + ty1 = &typ[findtyp(ntyp-1)]; + s = ty1->size; + a = ty1->align; + break; + } + if (a > al) + al = a; + if ((a = sz & (s-1))) { + a = s - a; + if (n < NSeg) { + /* padding segment */ + seg[n].type = Spad; + seg[n].len = a; + n++; + } + } + t = nextnl(); + if (t == Tint) { + c = tokval.num; + t = nextnl(); + } else + c = 1; + sz += a + c*s; + if (type == Styp) + s = ty1 - typ; + for (; c>0 && n= ty->size) + ty->size = sz; + ty->align = al; +} + static void parsetyp() { Typ *ty; - int t, n, c, a, al, type; - ulong sz, s; + int t, n, al; if (ntyp >= NTyp) err("too many type definitions"); ty = &typ[ntyp++]; + ty->dark = 0; ty->align = -1; + ty->size = 0; if (nextnl() != Ttyp || nextnl() != Teq) - err("type name, then = expected"); + err("type name and then = expected"); strcpy(ty->name, tokval.str); t = nextnl(); if (t == Talign) { @@ -818,62 +888,23 @@ parsetyp() ty->size = tokval.num; if (ty->align == -1) err("dark types need alignment"); - t = nextnl(); - } else { - ty->dark = 0; - n = 0; - sz = 0; - al = 0; - while (t != Trbrace) { - type = Sint; - switch (t) { - default: err("invalid size specifier %c", tokval.chr); - case Td: type = Sflt; - case Tl: s = 8; a = 3; break; - case Ts: type = Sflt; - case Tw: s = 4; a = 2; break; - case Th: s = 2; a = 1; break; - case Tb: s = 1; a = 0; break; - } - if (a > al) - al = a; - if ((a = sz & (s-1))) { - a = s - a; - if (n < NSeg) { - /* padding segment */ - ty->seg[n].type = Spad; - ty->seg[n].len = a; - n++; - } - } - t = nextnl(); - if (t == Tint) { - c = tokval.num; - t = nextnl(); - } else - c = 1; - sz += a + c*s; - for (; c>0 && nseg[n].type = type; - ty->seg[n].len = s; - } - if (t != Tcomma) - break; - t = nextnl(); - } - if (n >= NSeg) - ty->dark = 1; - else - ty->seg[n].len = 0; - if (ty->align == -1) - ty->align = al; - else - al = ty->align; - a = 1 << al; - ty->size = (sz + a - 1) & -a; + if (nextnl() != Trbrace) + err("} expected"); + return; } - if (t != Trbrace) - err(", or } expected"); + n = 0; + ty->seg = vnew(1, sizeof ty->seg[0], emalloc); + if (t == Tlbrace) + do { + if (t != Tlbrace) + err("invalid union member"); + vgrow(&ty->seg, n+1); + parseseg(ty->seg[n++], ty, nextnl()); + t = nextnl(); + } while (t != Trbrace); + else + parseseg(ty->seg[n++], ty, t); + ty->nunion = n; } static void diff --git a/sysv.c b/sysv.c index c8bc730..7e5b819 100644 --- a/sysv.c +++ b/sysv.c @@ -21,6 +21,7 @@ aclass(AClass *a, Typ *t) { int e, s, n, cls; uint sz, al; + Seg *seg; sz = t->size; al = 1u << t->align; @@ -45,11 +46,12 @@ aclass(AClass *a, Typ *t) return; } + seg = t->seg[0]; a->inmem = 0; for (e=0, s=0; e<2; e++) { cls = -1; - for (n=0; n<8 && t->seg[s].len; s++) { - switch (t->seg[s].type) { + for (n=0; n<8 && seg[s].len; s++) { + switch (seg[s].type) { case Spad: /* don't change anything */ break; @@ -60,8 +62,11 @@ aclass(AClass *a, Typ *t) case Sint: cls = Kl; break; + case Styp: + assert(!"todo"); + break; } - n += t->seg[s].len; + n += seg[s].len; } assert(n <= 8); a->cls[e] = cls; From cad13d0dce46dbbb42140a40f32245f73672dc39 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 16 Aug 2016 13:26:16 -0700 Subject: [PATCH 006/286] add support for unions in sysv abi --- all.h | 5 +-- parse.c | 3 +- sysv.c | 86 ++++++++++++++++++++++++++++++--------------------- test/abi5.ssa | 13 ++++++++ 4 files changed, 67 insertions(+), 40 deletions(-) diff --git a/all.h b/all.h index b6392e5..39c85f1 100644 --- a/all.h +++ b/all.h @@ -429,13 +429,14 @@ struct Typ { struct Seg { enum { + Send, Spad, Sint, Sflt, Styp, }; - uint type:2; - uint len:30; /* index in typ[] for Styp */ + uint type:3; + uint len:29; /* index in typ[] for Styp */ } (*seg)[NSeg+1]; }; diff --git a/parse.c b/parse.c index 7afa977..31a6d09 100644 --- a/parse.c +++ b/parse.c @@ -847,8 +847,7 @@ parseseg(Seg *seg, Typ *ty, int t) } if (t != Trbrace) err(", or } expected"); - seg[n].type = Sint; - seg[n].len = 0; + seg[n].type = Send; a = 1 << al; sz = (sz + a - 1) & -a; if (sz >= ty->size) diff --git a/sysv.c b/sysv.c index 7e5b819..5a82f8e 100644 --- a/sysv.c +++ b/sysv.c @@ -17,11 +17,44 @@ struct RAlloc { }; static void -aclass(AClass *a, Typ *t) +classify(AClass *a, Typ *t, int *pn, int *pe) { - int e, s, n, cls; - uint sz, al; Seg *seg; + int n, s, *cls; + + for (n=0; nnunion; n++) { + seg = t->seg[n]; + for (s=0; *pe<2; (*pe)++) { + cls = &a->cls[*pe]; + for (; *pn<8 && seg[s].type!=Send; s++) { + switch (seg[s].type) { + case Spad: + /* don't change anything */ + break; + case Sflt: + if (*cls == Kx) + *cls = Kd; + break; + case Sint: + *cls = Kl; + break; + case Styp: + classify(a, &typ[seg[s].len], pn, pe); + continue; + } + *pn += seg[s].len; + } + assert(*pn <= 8); + *pn = 0; + } + } +} + +static void +typclass(AClass *a, Typ *t) +{ + int e, n; + uint sz, al; sz = t->size; al = 1u << t->align; @@ -46,31 +79,12 @@ aclass(AClass *a, Typ *t) return; } - seg = t->seg[0]; + a->cls[0] = Kx; + a->cls[1] = Kx; a->inmem = 0; - for (e=0, s=0; e<2; e++) { - cls = -1; - for (n=0; n<8 && seg[s].len; s++) { - switch (seg[s].type) { - case Spad: - /* don't change anything */ - break; - case Sflt: - if (cls == -1) - cls = Kd; - break; - case Sint: - cls = Kl; - break; - case Styp: - assert(!"todo"); - break; - } - n += seg[s].len; - } - assert(n <= 8); - a->cls[e] = cls; - } + n = 0; + e = 0; + classify(a, t, &n, &e); } static void @@ -124,7 +138,7 @@ selret(Blk *b, Fn *fn) b->jmp.type = Jret0; if (j == Jretc) { - aclass(&aret, &typ[fn->retty]); + typclass(&aret, &typ[fn->retty]); if (aret.inmem) { assert(rtype(fn->retr) == RTmp); emit(Ocopy, Kl, TMP(RAX), fn->retr, R); @@ -154,7 +168,7 @@ selret(Blk *b, Fn *fn) } static int -classify(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret) +argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret) { int nint, ni, nsse, ns, n, *pn; AClass *a; @@ -181,7 +195,7 @@ classify(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret) a->cls[0] = i->cls; } else { n = i->arg[0].val; - aclass(a, &typ[n]); + typclass(a, &typ[n]); if (a->inmem) continue; ni = ns = 0; @@ -279,10 +293,10 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) ac = alloc((i1-i0) * sizeof ac[0]); if (!req(i1->arg[1], R)) { assert(rtype(i1->arg[1]) == RType); - aclass(&aret, &typ[i1->arg[1].val]); - ca = classify(i0, i1, ac, Oarg, &aret); + typclass(&aret, &typ[i1->arg[1].val]); + ca = argsclass(i0, i1, ac, Oarg, &aret); } else - ca = classify(i0, i1, ac, Oarg, 0); + ca = argsclass(i0, i1, ac, Oarg, 0); for (stk=0, a=&ac[i1-i0]; a>ac;) if ((--a)->inmem) { @@ -393,10 +407,10 @@ selpar(Fn *fn, Ins *i0, Ins *i1) ni = ns = 0; if (fn->retty >= 0) { - aclass(&aret, &typ[fn->retty]); - classify(i0, i1, ac, Opar, &aret); + typclass(&aret, &typ[fn->retty]); + argsclass(i0, i1, ac, Opar, &aret); } else - classify(i0, i1, ac, Opar, 0); + argsclass(i0, i1, ac, Opar, 0); for (i=i0, a=ac; iop != Oparc || a->inmem) diff --git a/test/abi5.ssa b/test/abi5.ssa index 7899035..c3d9046 100644 --- a/test/abi5.ssa +++ b/test/abi5.ssa @@ -8,6 +8,8 @@ type :st5 = { s, l } type :st6 = { b 16 } type :st7 = { s, d } type :st8 = { w 4 } +type :un9 = { { b } { s } } +type :st9 = { w, :un9 } data $fmt1 = { b "t1: %s\n", b 0 } data $fmt2 = { b "t2: %d\n", b 0 } @@ -17,6 +19,7 @@ data $fmt5 = { b "t5: %f %lld\n", b 0 } data $fmt6 = { b "t6: %s\n", b 0 } data $fmt7 = { b "t7: %f %f\n", b 0 } data $fmt8 = { b "t8: %d %d %d %d\n", b 0 } +data $fmt9 = { b "t9: %d %f\n", b 0 } export function $test() { @@ -68,6 +71,13 @@ function $test() { %w84 =w loadw %r812 %i8 =w call $printf(l $fmt8, w %w81, w %w82, w %w83, w %w84) + %r9 =:st9 call $t9() + %r94 =l add 4, %r9 + %w9 =w loadw %r9 + %s9 =s loads %r94 + %d9 =d exts %s9 + %i9 =w call $printf(l $fmt9, w %w9, d %d9) + ret } @@ -82,6 +92,7 @@ function $test() { # typedef struct { char t[16]; } st6; # typedef struct { float f; double d; } st7; # typedef struct { int i[4]; } st8; +# typedef struct { int i; union { char c; float f; } u; } st9; # extern void test(void); # st1 t1() { return (st1){"abcdefghijklmnop"}; } # st2 t2() { return (st2){2}; } @@ -91,6 +102,7 @@ function $test() { # st6 t6() { return (st6){"abcdefghijklmno"}; } # st7 t7() { return (st7){7.77,77.7}; } # st8 t8() { return (st8){-8,88,-888,8888}; } +# st9 t9() { return (st9){9,{.f=9.9}}; } # int main() { test(); return 0; } # <<< @@ -103,4 +115,5 @@ function $test() { # t6: abcdefghijklmno # t7: 7.770000 77.700000 # t8: -8 88 -888 8888 +# t9: 9 9.900000 # <<< From 490799b7725f9a173fec6945c7dd927dd9aa5801 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 16 Aug 2016 13:38:39 -0700 Subject: [PATCH 007/286] update help message of unit tester --- tools/unit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/unit.sh b/tools/unit.sh index c4a85d2..756a994 100755 --- a/tools/unit.sh +++ b/tools/unit.sh @@ -91,7 +91,7 @@ once() { if test -z "$1" then - echo "usage: test/go.sh {all, SSAFILE}" 2>&1 + echo "usage: tools/unit.sh {all, SSAFILE}" 2>&1 exit 1 fi From 09192cdeabeb185e54d60faa2b275a0e8e2a52a6 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 17 Aug 2016 23:45:28 -0700 Subject: [PATCH 008/286] silent a few warnings --- all.h | 5 ++--- sysv.c | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/all.h b/all.h index 39c85f1..e303a87 100644 --- a/all.h +++ b/all.h @@ -434,9 +434,8 @@ struct Typ { Sint, Sflt, Styp, - }; - uint type:3; - uint len:29; /* index in typ[] for Styp */ + } type; + uint len; /* index in typ[] for Styp */ } (*seg)[NSeg+1]; }; diff --git a/sysv.c b/sysv.c index 5a82f8e..b05510c 100644 --- a/sysv.c +++ b/sysv.c @@ -26,8 +26,10 @@ classify(AClass *a, Typ *t, int *pn, int *pe) seg = t->seg[n]; for (s=0; *pe<2; (*pe)++) { cls = &a->cls[*pe]; - for (; *pn<8 && seg[s].type!=Send; s++) { + for (; *pn<8; s++) { switch (seg[s].type) { + case Send: + goto Done; case Spad: /* don't change anything */ break; @@ -44,6 +46,7 @@ classify(AClass *a, Typ *t, int *pn, int *pe) } *pn += seg[s].len; } + Done: assert(*pn <= 8); *pn = 0; } From fd9c2e045f7cc953bebab2e2e65da9cd73b04f17 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 27 Sep 2016 10:23:31 -0400 Subject: [PATCH 009/286] accept "ret" for functions with a return type This happens to be needed for C. The standard mandates that a return value is used if the caller uses it. Surprisingly, if the return "value" is not used, the callee can use "return;". A better solution is to add an "undef" value and return it, "undef" would also have other use cases for compiling C. --- parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index 31a6d09..f70bbc2 100644 --- a/parse.c +++ b/parse.c @@ -545,10 +545,12 @@ parseline(PState ps) Jrets, Jretd, Jretc, Jret0 }[rcls]; - if (rcls < 5) { + if (peek() == Tnl) + curb->jmp.type = Jret0; + else if (rcls < 5) { r = parseref(); if (req(r, R)) - err("return value expected"); + err("invalid return value"); curb->jmp.arg = r; } goto Close; From b39ccc606171a1ac7f7cbf83d29ee773b3b30997 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 19 Oct 2016 11:24:11 -0400 Subject: [PATCH 010/286] add magic for mobile viewing of doc --- doc/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/Makefile b/doc/Makefile index e4c2d7a..60129d6 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -13,6 +13,7 @@ clean: html/%.html: %.txt mkdir html 2> /dev/null || true ( echo ''; \ + echo ''; \ echo ''; \ echo ''; \ sed -ne '2{s,.*,&,;p;q}' $<; \ From 48896b05982aeee4499fb4149672449180545832 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 19 Oct 2016 19:26:00 -0400 Subject: [PATCH 011/286] improve tests output for contbuild --- tools/unit.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/unit.sh b/tools/unit.sh index 756a994..e21bf77 100755 --- a/tools/unit.sh +++ b/tools/unit.sh @@ -24,8 +24,7 @@ extract() { next } /^# << Date: Sat, 22 Oct 2016 13:32:43 -0400 Subject: [PATCH 012/286] fix bug in copy propagation The pass was not doing anything incorrect, but it missed some opportunities to optimize. On a copy heavy example I observed that, in the output of the pass a phi of the following shape remained: %a =w phi @A %c, @B %a Originally the phi for %a was: %a =w phi @A %b, @B %a Since %b was discovered a copy of %c, %a should have been eliminated and replaced with %c. I think the problem is that knowledge on the first argument of the phi %a changes as the algorithm progresses, a more detailed walk- through follows. In the first round of the algoritm, %a is discovered to be a copy of its first argument %b. phi(%b, %a) -> %b In the second round, %a is computed as the phi of %c (since the first argument changed) and %b (the result of the first iteration), in our lattice, the glb of those two is bottom. phi(%c, %b) -> %a (Bottom) Finally, there is a third round in which we compute %a as the phi of %a and %c, which again, gives bottom. phi(%c, %a) -> %a (Bottom) The bug is not tied to a phi of a copy, for example, if the first argument is speculated to be a copy of 0 and then, this knowledge is retracted; we will compute in sequence: phi(0, %a) -> 0 phi(%b, 0) -> %a (Bottom) phi(%b, %a) -> %a (Bottom) The way I fixed this is by ignoring arguments of the phi that were discovered to be copies of the phi node itself. This will make the last rounds above do the correct thing. --- copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copy.c b/copy.c index 06a0fb3..965f202 100644 --- a/copy.c +++ b/copy.c @@ -38,7 +38,7 @@ visitphi(Phi *p, Ref *cp, RList **w) r = R; for (a=0; anarg; a++) { r1 = copyof(p->arg[a], cp); - if (req(r1, R)) + if (req(r1, R) || req(r1, p->to)) continue; if (req(r, R) || req(r, r1)) r = r1; From 2434d4eb3e039cde972d47923744225e67f98f06 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 24 Oct 2016 13:46:27 -0400 Subject: [PATCH 013/286] fix bug in folding of w comparisons The casting to uint32_t made the code for comparing two signed words invalid. Interestingly, this can be fixed by casting to int32_t instead. Because sign extension is monotonic, all the unsigned comparisons remain valid. CVC4 can even check that for us: x, y : BITVECTOR(32); QUERY BVLT(SX(x, 64), SX(y, 64)) <=> BVLT(x, y); QUERY BVLE(SX(x, 64), SX(y, 64)) <=> BVLE(x, y); QUERY BVGT(SX(x, 64), SX(y, 64)) <=> BVGT(x, y); QUERY BVGE(SX(x, 64), SX(y, 64)) <=> BVGE(x, y); --- fold.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fold.c b/fold.c index c2a7c12..a000ff4 100644 --- a/fold.c +++ b/fold.c @@ -385,8 +385,8 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) default: if (Ocmpw <= op && op <= Ocmpl1) { if (op <= Ocmpw1) { - l.u = (uint32_t)l.u; - r.u = (uint32_t)r.u; + l.u = (int32_t)l.u; + r.u = (int32_t)r.u; } else op -= Ocmpl - Ocmpw; switch (op - Ocmpw) { From 3e8a18dd1b322a811550da9874a2612dd8ad4b03 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 24 Oct 2016 14:36:35 -0400 Subject: [PATCH 014/286] return non-zero when tests fail --- tools/unit.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/unit.sh b/tools/unit.sh index e21bf77..d665d09 100755 --- a/tools/unit.sh +++ b/tools/unit.sh @@ -110,6 +110,7 @@ case $1 in echo echo "All is fine!" fi + exit $F ;; *) once $1 From 6ed62fe94531f2e56c58d1d7891e099de0a26663 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 9 Nov 2016 22:34:05 -0500 Subject: [PATCH 015/286] doc nits --- doc/Makefile | 2 +- doc/il.txt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 60129d6..6fc15e4 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -14,7 +14,7 @@ html/%.html: %.txt mkdir html 2> /dev/null || true ( echo ''; \ echo ''; \ - echo ''; \ + echo ''; \ echo ''; \ sed -ne '2{s,.*,&,;p;q}' $<; \ echo '
'; \ diff --git a/doc/il.txt b/doc/il.txt index 51525d7..865b81f 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -761,7 +761,7 @@ will be correctly compiled by QBE. @end ret %s -Now, if you want to know what a phi instruction is and how +Now, if you want to know what phi instructions are and how to use them in QBE, you can read the following. Phi instructions are specific to SSA form. In SSA form @@ -791,10 +791,10 @@ translate it in SSA form is to insert a phi instruction. %y =w phi @ift 1, @iff 2 ret %y -The phi in the example expresses a choice depending on -which block the control came from. When the `@ift` block -is taken, the phi instruction defining `%y` selects 1; -if `@iff` is taken, 2 is selected. +Phi instructions return one of their arguments depending +on where the control came from. In the example, `%y` is +set to 1 if the `@ift` branch is taken, and it is set to +2 otherwise. An important remark about phi instructions is that QBE assumes that if a variable is defined by a phi it respects From 8032339c59da9eb162fa735ed3c99c10dc0f8ce0 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 5 Dec 2016 02:50:08 -0500 Subject: [PATCH 016/286] disable pie (default on some os) --- tools/unit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/unit.sh b/tools/unit.sh index d665d09..ded1b29 100755 --- a/tools/unit.sh +++ b/tools/unit.sh @@ -59,7 +59,7 @@ once() { LNK="$ASM" fi - if ! cc -g -o $BIN $LNK + if ! cc -no-pie -g -o $BIN $LNK then echo "[cc fail]" return 1 From a9bc0541b5e69f902758210eb3bfa275a53a07e0 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 5 Dec 2016 02:51:31 -0500 Subject: [PATCH 017/286] move some liveness code where it belongs --- live.c | 4 +++- spill.c | 22 +++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/live.c b/live.c index 09a4a25..be5ec8c 100644 --- a/live.c +++ b/live.c @@ -13,8 +13,10 @@ liveon(BSet *v, Blk *b, Blk *s) for (p=s->phi; p; p=p->link) for (a=0; anarg; a++) if (p->blk[a] == b) - if (rtype(p->arg[a]) == RTmp) + if (rtype(p->arg[a]) == RTmp) { bsset(v, p->arg[a].val); + bsset(b->gen, p->arg[a].val); + } } static int diff --git a/spill.c b/spill.c index e4dae28..f9dcc49 100644 --- a/spill.c +++ b/spill.c @@ -1,22 +1,14 @@ #include "all.h" static void -loopmark(Blk *hd, Blk *b, Phi *p) +loopmark(Blk *hd, Blk *b) { - int k, head; - uint n, a; + int k; + uint n; - head = hd->id; - if (b->id < head) + if (b->id < hd->id || b->visit == hd->id) return; - for (; p; p=p->link) - for (a=0; anarg; a++) - if (p->blk[a] == b) - if (rtype(p->arg[a]) == RTmp) - bsset(hd->gen, p->arg[a].val); - if (b->visit == head) - return; - b->visit = head; + b->visit = hd->id; b->loop *= 10; /* aggregate looping information at * loop headers */ @@ -25,7 +17,7 @@ loopmark(Blk *hd, Blk *b, Phi *p) if (b->nlive[k] > hd->nlive[k]) hd->nlive[k] = b->nlive[k]; for (n=0; nnpred; n++) - loopmark(hd, b->pred[n], b->phi); + loopmark(hd, b->pred[n]); } static void @@ -72,7 +64,7 @@ fillcost(Fn *fn) hd = 0; for (a=0; anpred; a++) if (b->pred[a]->id >= n) { - loopmark(b, b->pred[a], b->phi); + loopmark(b, b->pred[a]); hd = 1; } if (hd && debug['S']) { From 844b97cf37e245a538b5b5946ae5c765d2a7733c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 8 Dec 2016 22:15:46 -0500 Subject: [PATCH 018/286] use a queue for copy elimination --- copy.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/copy.c b/copy.c index 965f202..bcb7b4d 100644 --- a/copy.c +++ b/copy.c @@ -16,7 +16,7 @@ copyof(Ref r, Ref *cp) } static void -update(Ref r, Ref rcp, Ref *cp, RList **w) +update(Ref r, Ref rcp, Ref *cp, RList ***pw) { RList *l; @@ -24,13 +24,14 @@ update(Ref r, Ref rcp, Ref *cp, RList **w) cp[r.val] = rcp; l = emalloc(sizeof *l); l->t = r.val; - l->l = *w; - *w = l; + l->l = 0; + **pw = l; + *pw = &l->l; } } static void -visitphi(Phi *p, Ref *cp, RList **w) +visitphi(Phi *p, Ref *cp, RList ***pw) { uint a; Ref r, r1; @@ -47,20 +48,20 @@ visitphi(Phi *p, Ref *cp, RList **w) break; } } - update(p->to, r, cp, w); + update(p->to, r, cp, pw); } static void -visitins(Ins *i, Ref *cp, RList **w) +visitins(Ins *i, Ref *cp, RList ***pw) { Ref r; if (i->op == Ocopy) { r = copyof(i->arg[0], cp); - update(i->to, r, cp, w); + update(i->to, r, cp, pw); } else if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); - update(i->to, i->to, cp, w); + update(i->to, i->to, cp, pw); } } @@ -76,7 +77,7 @@ copy(Fn *fn) { Blk *b; Ref *cp, r; - RList *w, *w1; + RList *w, *w1, **pw; Use *u, *u1; Ins *i; Phi *p, **pp; @@ -84,32 +85,33 @@ copy(Fn *fn) int t; w = 0; + pw = &w; cp = emalloc(fn->ntmp * sizeof cp[0]); for (b=fn->start; b; b=b->link) { for (p=b->phi; p; p=p->link) - visitphi(p, cp, &w); + visitphi(p, cp, &pw); for (i=b->ins; i-b->ins < b->nins; i++) - visitins(i, cp, &w); + visitins(i, cp, &pw); } while ((w1=w)) { t = w->t; - w = w->l; - free(w1); u = fn->tmp[t].use; u1 = u + fn->tmp[t].nuse; for (; utype) { case UPhi: - visitphi(u->u.phi, cp, &w); + visitphi(u->u.phi, cp, &pw); break; case UIns: - visitins(u->u.ins, cp, &w); + visitins(u->u.ins, cp, &pw); break; case UJmp: break; default: die("invalid use %d", u->type); } + w = w->l; + free(w1); } for (b=fn->start; b; b=b->link) { for (pp=&b->phi; (p=*pp);) { From 00f3d2228b96c03e63091f4c92fee0478f39328e Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 10 Dec 2016 20:27:00 -0500 Subject: [PATCH 019/286] new eight queens test --- test/queen.ssa | 282 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 282 insertions(+) create mode 100644 test/queen.ssa diff --git a/test/queen.ssa b/test/queen.ssa new file mode 100644 index 0000000..141e17e --- /dev/null +++ b/test/queen.ssa @@ -0,0 +1,282 @@ +# eight queens program +# generated by minic + +export function w $chk(w %t0, w %t1) { +@l0 + %x =l alloc4 4 + storew %t0, %x + %y =l alloc4 4 + storew %t1, %y + %i =l alloc4 4 + %r =l alloc4 4 + storew 0, %i + storew 0, %r +@l1 + %t6 =w loadw %i + %t7 =w loadw $glo1 + %t5 =w csltw %t6, %t7 + jnz %t5, @l2, @l3 +@l2 + %t10 =w loadw %r + %t15 =l loadl $glo3 + %t16 =w loadw %x + %t17 =l extsw %t16 + %t18 =l mul 8, %t17 + %t14 =l add %t15, %t18 + %t13 =l loadl %t14 + %t19 =w loadw %i + %t20 =l extsw %t19 + %t21 =l mul 4, %t20 + %t12 =l add %t13, %t21 + %t11 =w loadw %t12 + %t9 =w add %t10, %t11 + storew %t9, %r + %t24 =w loadw %r + %t29 =l loadl $glo3 + %t30 =w loadw %i + %t31 =l extsw %t30 + %t32 =l mul 8, %t31 + %t28 =l add %t29, %t32 + %t27 =l loadl %t28 + %t33 =w loadw %y + %t34 =l extsw %t33 + %t35 =l mul 4, %t34 + %t26 =l add %t27, %t35 + %t25 =w loadw %t26 + %t23 =w add %t24, %t25 + storew %t23, %r + %t39 =w loadw %x + %t40 =w loadw %i + %t38 =w add %t39, %t40 + %t41 =w loadw $glo1 + %t37 =w csltw %t38, %t41 + %t44 =w loadw %y + %t45 =w loadw %i + %t43 =w add %t44, %t45 + %t46 =w loadw $glo1 + %t42 =w csltw %t43, %t46 + %t36 =w and %t37, %t42 + jnz %t36, @l4, @l5 +@l4 + %t49 =w loadw %r + %t54 =l loadl $glo3 + %t56 =w loadw %x + %t57 =w loadw %i + %t55 =w add %t56, %t57 + %t58 =l extsw %t55 + %t59 =l mul 8, %t58 + %t53 =l add %t54, %t59 + %t52 =l loadl %t53 + %t61 =w loadw %y + %t62 =w loadw %i + %t60 =w add %t61, %t62 + %t63 =l extsw %t60 + %t64 =l mul 4, %t63 + %t51 =l add %t52, %t64 + %t50 =w loadw %t51 + %t48 =w add %t49, %t50 + storew %t48, %r +@l5 + %t68 =w loadw %x + %t69 =w loadw %i + %t67 =w add %t68, %t69 + %t70 =w loadw $glo1 + %t66 =w csltw %t67, %t70 + %t74 =w loadw %y + %t75 =w loadw %i + %t73 =w sub %t74, %t75 + %t71 =w cslew 0, %t73 + %t65 =w and %t66, %t71 + jnz %t65, @l7, @l8 +@l7 + %t78 =w loadw %r + %t83 =l loadl $glo3 + %t85 =w loadw %x + %t86 =w loadw %i + %t84 =w add %t85, %t86 + %t87 =l extsw %t84 + %t88 =l mul 8, %t87 + %t82 =l add %t83, %t88 + %t81 =l loadl %t82 + %t90 =w loadw %y + %t91 =w loadw %i + %t89 =w sub %t90, %t91 + %t92 =l extsw %t89 + %t93 =l mul 4, %t92 + %t80 =l add %t81, %t93 + %t79 =w loadw %t80 + %t77 =w add %t78, %t79 + storew %t77, %r +@l8 + %t98 =w loadw %x + %t99 =w loadw %i + %t97 =w sub %t98, %t99 + %t95 =w cslew 0, %t97 + %t102 =w loadw %y + %t103 =w loadw %i + %t101 =w add %t102, %t103 + %t104 =w loadw $glo1 + %t100 =w csltw %t101, %t104 + %t94 =w and %t95, %t100 + jnz %t94, @l10, @l11 +@l10 + %t107 =w loadw %r + %t112 =l loadl $glo3 + %t114 =w loadw %x + %t115 =w loadw %i + %t113 =w sub %t114, %t115 + %t116 =l extsw %t113 + %t117 =l mul 8, %t116 + %t111 =l add %t112, %t117 + %t110 =l loadl %t111 + %t119 =w loadw %y + %t120 =w loadw %i + %t118 =w add %t119, %t120 + %t121 =l extsw %t118 + %t122 =l mul 4, %t121 + %t109 =l add %t110, %t122 + %t108 =w loadw %t109 + %t106 =w add %t107, %t108 + storew %t106, %r +@l11 + %t127 =w loadw %x + %t128 =w loadw %i + %t126 =w sub %t127, %t128 + %t124 =w cslew 0, %t126 + %t132 =w loadw %y + %t133 =w loadw %i + %t131 =w sub %t132, %t133 + %t129 =w cslew 0, %t131 + %t123 =w and %t124, %t129 + jnz %t123, @l13, @l14 +@l13 + %t136 =w loadw %r + %t141 =l loadl $glo3 + %t143 =w loadw %x + %t144 =w loadw %i + %t142 =w sub %t143, %t144 + %t145 =l extsw %t142 + %t146 =l mul 8, %t145 + %t140 =l add %t141, %t146 + %t139 =l loadl %t140 + %t148 =w loadw %y + %t149 =w loadw %i + %t147 =w sub %t148, %t149 + %t150 =l extsw %t147 + %t151 =l mul 4, %t150 + %t138 =l add %t139, %t151 + %t137 =w loadw %t138 + %t135 =w add %t136, %t137 + storew %t135, %r +@l14 + %t153 =w loadw %i + %t152 =w add %t153, 1 + storew %t152, %i + jmp @l1 +@l3 + %t154 =w loadw %r + ret %t154 +} + +export function w $go(w %t0) { +@l16 + %y =l alloc4 4 + storew %t0, %y + %x =l alloc4 4 + %t2 =w loadw %y + %t3 =w loadw $glo1 + %t1 =w ceqw %t2, %t3 + jnz %t1, @l17, @l18 +@l17 + %t5 =w loadw $glo2 + %t4 =w add %t5, 1 + storew %t4, $glo2 + ret 0 +@l18 + storew 0, %x +@l20 + %t10 =w loadw %x + %t11 =w loadw $glo1 + %t9 =w csltw %t10, %t11 + jnz %t9, @l21, @l22 +@l21 + %t14 =w loadw %x + %t15 =w loadw %y + %t13 =w call $chk(w %t14, w %t15) + %t12 =w ceqw %t13, 0 + jnz %t12, @l23, @l24 +@l23 + %t21 =l loadl $glo3 + %t22 =w loadw %x + %t23 =l extsw %t22 + %t24 =l mul 8, %t23 + %t20 =l add %t21, %t24 + %t19 =l loadl %t20 + %t25 =w loadw %y + %t26 =l extsw %t25 + %t27 =l mul 4, %t26 + %t18 =l add %t19, %t27 + %t28 =w loadw %t18 + %t17 =w add %t28, 1 + storew %t17, %t18 + %t31 =w loadw %y + %t30 =w add %t31, 1 + %t29 =w call $go(w %t30) + %t37 =l loadl $glo3 + %t38 =w loadw %x + %t39 =l extsw %t38 + %t40 =l mul 8, %t39 + %t36 =l add %t37, %t40 + %t35 =l loadl %t36 + %t41 =w loadw %y + %t42 =l extsw %t41 + %t43 =l mul 4, %t42 + %t34 =l add %t35, %t43 + %t44 =w loadw %t34 + %t33 =w sub %t44, 1 + storew %t33, %t34 +@l24 + %t46 =w loadw %x + %t45 =w add %t46, 1 + storew %t45, %x + jmp @l20 +@l22 + ret 0 +} + +export function w $main() { +@l26 + %i =l alloc4 4 + storew 8, $glo1 + %t4 =w loadw $glo1 + %t3 =l call $calloc(w %t4, w 8) + storel %t3, $glo3 + storew 0, %i +@l27 + %t9 =w loadw %i + %t10 =w loadw $glo1 + %t8 =w csltw %t9, %t10 + jnz %t8, @l28, @l29 +@l28 + %t13 =w loadw $glo1 + %t12 =l call $calloc(w %t13, w 4) + %t16 =l loadl $glo3 + %t17 =w loadw %i + %t18 =l extsw %t17 + %t19 =l mul 8, %t18 + %t15 =l add %t16, %t19 + storel %t12, %t15 + %t21 =w loadw %i + %t20 =w add %t21, 1 + storew %t20, %i + jmp @l27 +@l29 + %t22 =w call $go(w 0) + %t25 =w loadw $glo2 + %t24 =w cnew %t25, 92 + ret %t24 +} + +data $glo1 = { w 0 } +data $glo2 = { w 0 } +data $glo3 = { l 0 } From 2380b5786a515af7149f7648d9e9c22a663e3a9c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 9 Dec 2016 04:26:11 -0500 Subject: [PATCH 020/286] make newtmp() return zeroed out temporaries This was not necessary as temporaries were never freed and returned from an array zero initialized. But in the coming load optimization, we sometimes free temporaries by resetting fn->ntmp. --- util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util.c b/util.c index a99e2dd..63a1202 100644 --- a/util.c +++ b/util.c @@ -250,6 +250,7 @@ newtmp(char *prfx, int k, Fn *fn) t = fn->ntmp++; vgrow(&fn->tmp, fn->ntmp); + memset(&fn->tmp[t], 0, sizeof(Tmp)); if (prfx) sprintf(fn->tmp[t].name, "%s.%d", prfx, ++n); fn->tmp[t].cls = k; From 12f9d16c7b000030ce332778fa4d51d455ae819f Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 5 Dec 2016 02:09:48 -0500 Subject: [PATCH 021/286] create cfg.c for cfg-related functions --- Makefile | 2 +- all.h | 12 ++- cfg.c | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ ssa.c | 187 -------------------------------------------- util.c | 41 ---------- 5 files changed, 241 insertions(+), 231 deletions(-) create mode 100644 cfg.c diff --git a/Makefile b/Makefile index 9528f45..64531ea 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ABI = sysv V = @ OBJDIR = obj -SRC = main.c util.c parse.c mem.c ssa.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c +SRC = main.c util.c parse.c cfg.c mem.c ssa.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c OBJ = $(SRC:%.c=$(OBJDIR)/%.o) CFLAGS += -Wall -Wextra -std=c99 -g -pedantic diff --git a/all.h b/all.h index e303a87..6b1951d 100644 --- a/all.h +++ b/all.h @@ -481,8 +481,6 @@ void die_(char *, char *, ...) __attribute__((noreturn)); void *emalloc(size_t); void *alloc(size_t); void freeall(void); -Blk *blknew(void); -void blkdel(Blk *); void emit(int, int, Ref, Ref, Ref); void emiti(Ins); void idup(Ins **, Ins *, ulong); @@ -523,6 +521,16 @@ void printfn(Fn *, FILE *); void printref(Ref, Fn *, FILE *); void err(char *, ...) __attribute__((noreturn)); +/* cfg.c */ +Blk *blknew(void); +void blkdel(Blk *); +void fillpreds(Fn *); +void fillrpo(Fn *); +void filldom(Fn *); +int sdom(Blk *, Blk *); +int dom(Blk *, Blk *); +void fillfron(Fn *); + /* mem.c */ void memopt(Fn *); diff --git a/cfg.c b/cfg.c new file mode 100644 index 0000000..ae54deb --- /dev/null +++ b/cfg.c @@ -0,0 +1,230 @@ +#include "all.h" + +Blk * +blknew() +{ + static Blk z; + Blk *b; + + b = alloc(sizeof *b); + *b = z; + return b; +} + +void +blkdel(Blk *b) +{ + Blk *s, **ps, *succ[3]; + Phi *p; + uint a; + + succ[0] = b->s1; + succ[1] = b->s2 == b->s1 ? 0 : b->s2; + succ[2] = 0; + for (ps=succ; (s=*ps); ps++) { + for (p=s->phi; p; p=p->link) { + for (a=0; p->blk[a]!=b; a++) + assert(a+1narg); + p->narg--; + memmove(&p->blk[a], &p->blk[a+1], + sizeof p->blk[0] * (p->narg-a)); + memmove(&p->arg[a], &p->arg[a+1], + sizeof p->arg[0] * (p->narg-a)); + } + if (s->npred != 0) { + for (a=0; s->pred[a]!=b; a++) + assert(a+1npred); + s->npred--; + memmove(&s->pred[a], &s->pred[a+1], + sizeof s->pred[0] * (s->npred-a)); + } + } +} + +static void +addpred(Blk *bp, Blk *bc) +{ + if (!bc->pred) { + bc->pred = alloc(bc->npred * sizeof bc->pred[0]); + bc->visit = 0; + } + bc->pred[bc->visit++] = bp; +} + +/* fill predecessors information in blocks */ +void +fillpreds(Fn *f) +{ + Blk *b; + + for (b=f->start; b; b=b->link) { + b->npred = 0; + b->pred = 0; + } + for (b=f->start; b; b=b->link) { + if (b->s1) + b->s1->npred++; + if (b->s2 && b->s2 != b->s1) + b->s2->npred++; + } + for (b=f->start; b; b=b->link) { + if (b->s1) + addpred(b, b->s1); + if (b->s2 && b->s2 != b->s1) + addpred(b, b->s2); + } +} + +static int +rporec(Blk *b, int x) +{ + Blk *s1, *s2; + + if (!b || b->id >= 0) + return x; + b->id = 1; + s1 = b->s1; + s2 = b->s2; + if (s1 && s2 && s1->loop > s2->loop) { + s1 = b->s2; + s2 = b->s1; + } + x = rporec(s1, x); + x = rporec(s2, x); + b->id = x; + assert(x >= 0); + return x - 1; +} + +/* fill the rpo information */ +void +fillrpo(Fn *f) +{ + int n; + Blk *b, **p; + + for (b=f->start; b; b=b->link) + b->id = -1; + n = 1 + rporec(f->start, f->nblk-1); + f->nblk -= n; + f->rpo = alloc(f->nblk * sizeof f->rpo[0]); + for (p=&f->start; (b=*p);) { + if (b->id == -1) { + blkdel(b); + *p = b->link; + } else { + b->id -= n; + f->rpo[b->id] = b; + p = &b->link; + } + } +} + +/* for dominators computation, read + * "A Simple, Fast Dominance Algorithm" + * by K. Cooper, T. Harvey, and K. Kennedy. + */ + +static Blk * +inter(Blk *b1, Blk *b2) +{ + Blk *bt; + + if (b1 == 0) + return b2; + while (b1 != b2) { + if (b1->id < b2->id) { + bt = b1; + b1 = b2; + b2 = bt; + } + while (b1->id > b2->id) { + b1 = b1->idom; + assert(b1); + } + } + return b1; +} + +void +filldom(Fn *fn) +{ + Blk *b, *d; + int ch, n; + uint p; + + for (b=fn->start; b; b=b->link) { + b->idom = 0; + b->dom = 0; + b->dlink = 0; + } + do { + ch = 0; + for (n=1; nnblk; n++) { + b = fn->rpo[n]; + d = 0; + for (p=0; pnpred; p++) + if (b->pred[p]->idom + || b->pred[p] == fn->start) + d = inter(d, b->pred[p]); + if (d != b->idom) { + ch++; + b->idom = d; + } + } + } while (ch); + for (b=fn->start; b; b=b->link) + if ((d=b->idom)) { + assert(d != b); + b->dlink = d->dom; + d->dom = b; + } +} + +int +sdom(Blk *b1, Blk *b2) +{ + assert(b1 && b2); + if (b1 == b2) + return 0; + while (b2->id > b1->id) + b2 = b2->idom; + return b1 == b2; +} + +int +dom(Blk *b1, Blk *b2) +{ + return b1 == b2 || sdom(b1, b2); +} + +static void +addfron(Blk *a, Blk *b) +{ + int n; + + for (n=0; nnfron; n++) + if (a->fron[n] == b) + return; + if (!a->nfron) + a->fron = vnew(++a->nfron, sizeof a->fron[0], alloc); + else + vgrow(&a->fron, ++a->nfron); + a->fron[a->nfron-1] = b; +} + +/* fill the dominance frontier */ +void +fillfron(Fn *fn) +{ + Blk *a, *b; + + for (b=fn->start; b; b=b->link) { + if (b->s1) + for (a=b; !sdom(a, b->s1); a=a->idom) + addfron(a, b->s1); + if (b->s2) + for (a=b; !sdom(a, b->s2); a=a->idom) + addfron(a, b->s2); + } +} diff --git a/ssa.c b/ssa.c index 4b78fe3..a040484 100644 --- a/ssa.c +++ b/ssa.c @@ -87,193 +87,6 @@ filluse(Fn *fn) } } -static void -addpred(Blk *bp, Blk *bc) -{ - if (!bc->pred) { - bc->pred = alloc(bc->npred * sizeof bc->pred[0]); - bc->visit = 0; - } - bc->pred[bc->visit++] = bp; -} - -/* fill predecessors information in blocks */ -void -fillpreds(Fn *f) -{ - Blk *b; - - for (b=f->start; b; b=b->link) { - b->npred = 0; - b->pred = 0; - } - for (b=f->start; b; b=b->link) { - if (b->s1) - b->s1->npred++; - if (b->s2 && b->s2 != b->s1) - b->s2->npred++; - } - for (b=f->start; b; b=b->link) { - if (b->s1) - addpred(b, b->s1); - if (b->s2 && b->s2 != b->s1) - addpred(b, b->s2); - } -} - -static int -rporec(Blk *b, int x) -{ - Blk *s1, *s2; - - if (!b || b->id >= 0) - return x; - b->id = 1; - s1 = b->s1; - s2 = b->s2; - if (s1 && s2 && s1->loop > s2->loop) { - s1 = b->s2; - s2 = b->s1; - } - x = rporec(s1, x); - x = rporec(s2, x); - b->id = x; - assert(x >= 0); - return x - 1; -} - -/* fill the rpo information */ -void -fillrpo(Fn *f) -{ - int n; - Blk *b, **p; - - for (b=f->start; b; b=b->link) - b->id = -1; - n = 1 + rporec(f->start, f->nblk-1); - f->nblk -= n; - f->rpo = alloc(f->nblk * sizeof f->rpo[0]); - for (p=&f->start; (b=*p);) { - if (b->id == -1) { - blkdel(b); - *p = b->link; - } else { - b->id -= n; - f->rpo[b->id] = b; - p = &b->link; - } - } -} - -/* for dominators computation, read - * "A Simple, Fast Dominance Algorithm" - * by K. Cooper, T. Harvey, and K. Kennedy. - */ - -static Blk * -inter(Blk *b1, Blk *b2) -{ - Blk *bt; - - if (b1 == 0) - return b2; - while (b1 != b2) { - if (b1->id < b2->id) { - bt = b1; - b1 = b2; - b2 = bt; - } - while (b1->id > b2->id) { - b1 = b1->idom; - assert(b1); - } - } - return b1; -} - -static void -filldom(Fn *fn) -{ - Blk *b, *d; - int ch, n; - uint p; - - for (b=fn->start; b; b=b->link) { - b->idom = 0; - b->dom = 0; - b->dlink = 0; - } - do { - ch = 0; - for (n=1; nnblk; n++) { - b = fn->rpo[n]; - d = 0; - for (p=0; pnpred; p++) - if (b->pred[p]->idom - || b->pred[p] == fn->start) - d = inter(d, b->pred[p]); - if (d != b->idom) { - ch++; - b->idom = d; - } - } - } while (ch); - for (b=fn->start; b; b=b->link) - if ((d=b->idom)) { - assert(d != b); - b->dlink = d->dom; - d->dom = b; - } -} - -static int -sdom(Blk *b1, Blk *b2) -{ - assert(b1 && b2); - if (b1 == b2) - return 0; - while (b2->id > b1->id) - b2 = b2->idom; - return b1 == b2; -} - -static int -dom(Blk *b1, Blk *b2) -{ - return b1 == b2 || sdom(b1, b2); -} - -static void -addfron(Blk *a, Blk *b) -{ - int n; - - for (n=0; nnfron; n++) - if (a->fron[n] == b) - return; - if (!a->nfron) - a->fron = vnew(++a->nfron, sizeof a->fron[0], alloc); - else - vgrow(&a->fron, ++a->nfron); - a->fron[a->nfron-1] = b; -} - -static void -fillfron(Fn *fn) -{ - Blk *a, *b; - - for (b=fn->start; b; b=b->link) { - if (b->s1) - for (a=b; !sdom(a, b->s1); a=a->idom) - addfron(a, b->s1); - if (b->s2) - for (a=b; !sdom(a, b->s2); a=a->idom) - addfron(a, b->s2); - } -} - static Ref refindex(int t, Fn *fn) { diff --git a/util.c b/util.c index 63a1202..5c54c12 100644 --- a/util.c +++ b/util.c @@ -87,47 +87,6 @@ freeall() nptr = 1; } -Blk * -blknew() -{ - static Blk z; - Blk *b; - - b = alloc(sizeof *b); - *b = z; - return b; -} - -void -blkdel(Blk *b) -{ - Blk *s, **ps, *succ[3]; - Phi *p; - uint a; - - succ[0] = b->s1; - succ[1] = b->s2 == b->s1 ? 0 : b->s2; - succ[2] = 0; - for (ps=succ; (s=*ps); ps++) { - for (p=s->phi; p; p=p->link) { - for (a=0; p->blk[a]!=b; a++) - assert(a+1narg); - p->narg--; - memmove(&p->blk[a], &p->blk[a+1], - sizeof p->blk[0] * (p->narg-a)); - memmove(&p->arg[a], &p->arg[a+1], - sizeof p->arg[0] * (p->narg-a)); - } - if (s->npred != 0) { - for (a=0; s->pred[a]!=b; a++) - assert(a+1npred); - s->npred--; - memmove(&s->pred[a], &s->pred[a+1], - sizeof s->pred[0] * (s->npred-a)); - } - } -} - void emit(int op, int k, Ref to, Ref arg0, Ref arg1) { From 8fdea1dd5236f2693b677fc6bd6e2bb417c0fccd Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 4 Oct 2016 12:02:39 -0400 Subject: [PATCH 022/286] implement a simple alias analysis --- Makefile | 2 +- alias.c | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ all.h | 29 ++++++++++- 3 files changed, 183 insertions(+), 2 deletions(-) create mode 100644 alias.c diff --git a/Makefile b/Makefile index 64531ea..19bf777 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ABI = sysv V = @ OBJDIR = obj -SRC = main.c util.c parse.c cfg.c mem.c ssa.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c +SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c OBJ = $(SRC:%.c=$(OBJDIR)/%.o) CFLAGS += -Wall -Wextra -std=c99 -g -pedantic diff --git a/alias.c b/alias.c new file mode 100644 index 0000000..3d1d00c --- /dev/null +++ b/alias.c @@ -0,0 +1,154 @@ +#include "all.h" + +static void +getalias(Alias *a, Ref r, Fn *fn) +{ + Con *c; + + switch (rtype(r)) { + default: + die("unreachable"); + case RTmp: + *a = fn->tmp[r.val].alias; + assert(a->type != ABot); + break; + case RCon: + c = &fn->con[r.val]; + if (c->type == CAddr) { + a->type = ASym; + strcpy(a->label, c->label); + } else + a->type = ACon; + a->offset = c->bits.i; + break; + } +} + +int +alias(Ref p, int sp, Ref q, int sq, int *delta, Fn *fn) +{ + Alias ap, aq; + int ovlap; + + getalias(&ap, p, fn); + getalias(&aq, q, fn); + *delta = ap.offset - aq.offset; + ovlap = ap.offset < aq.offset + sq && aq.offset < ap.offset + sp; + + if (ap.type & aq.type & 1) { + /* if both are offsets of the same + * stack slot, they alias iif they + * overlap */ + if (req(ap.base, aq.base) && ovlap) + return MustAlias; + return NoAlias; + } + + if (ap.type == ASym && aq.type == ASym) { + /* they conservatively alias if the + * symbols are different, or they + * alias for sure if they overlap */ + if (strcmp(ap.label, aq.label) != 0) + return MayAlias; + if (ovlap) + return MustAlias; + return NoAlias; + } + + if ((ap.type == ACon && aq.type == ACon) + || (ap.type == aq.type && req(ap.base, aq.base))) { + assert(ap.type == ACon || ap.type == AUnk); + /* if they have the same base, we + * can rely on the offsets only */ + if (ovlap) + return MustAlias; + return NoAlias; + } + + /* if one of the two is unknown + * there may be aliasing unless + * the other is provably local */ + if (ap.type == AUnk && aq.type != ALoc) + return MayAlias; + if (aq.type == AUnk && ap.type != ALoc) + return MayAlias; + + return NoAlias; +} + +int +escapes(Ref r, Fn *fn) +{ + if (rtype(r) != RTmp) + return 1; + return fn->tmp[r.val].alias.type != ALoc; +} + +static void +esc(Ref r, Fn *fn) +{ + Alias *a; + + assert(rtype(r) <= RType); + if (rtype(r) == RTmp) { + a = &fn->tmp[r.val].alias; + assert(a->type != ABot); + if (a->type == ALoc) + a->type = AEsc; + } +} + +void +fillalias(Fn *fn) +{ + int n; + Blk *b; + Phi *p; + Ins *i; + Alias *a, a0, a1; + + for (n=0; nnblk; ++n) { + b = fn->rpo[n]; + for (p=b->phi; p; p=p->link) { + assert(rtype(p->to) == RTmp); + a = &fn->tmp[p->to.val].alias; + assert(a->type == ABot); + a->type = AUnk; + a->base = p->to; + a->offset = 0; + } + for (i=b->ins; i<&b->ins[b->nins]; ++i) { + a = 0; + if (!req(i->to, R)) { + assert(rtype(i->to) == RTmp); + a = &fn->tmp[i->to.val].alias; + assert(a->type == ABot); + if (Oalloc <= i->op && i->op <= Oalloc1) + a->type = ALoc; + else + a->type = AUnk; + a->base = i->to; + a->offset = 0; + } + if (i->op == Oadd) { + getalias(&a0, i->arg[0], fn); + getalias(&a1, i->arg[1], fn); + if (a0.type == ACon) { + *a = a1; + a->offset += a0.offset; + } + else if (a1.type == ACon) { + *a = a0; + a->offset += a1.offset; + } + } + if (req(i->to, R) || a->type == AUnk) { + if (!isload(i->op)) + esc(i->arg[0], fn); + if (!isstore(i->op)) + esc(i->arg[1], fn); + } + } + esc(b->jmp.arg, fn); + } +} diff --git a/all.h b/all.h index 6b1951d..943480a 100644 --- a/all.h +++ b/all.h @@ -20,6 +20,7 @@ typedef struct Ins Ins; typedef struct Phi Phi; typedef struct Blk Blk; typedef struct Use Use; +typedef struct Alias Alias; typedef struct Tmp Tmp; typedef struct Con Con; typedef struct Addr Mem; @@ -104,8 +105,8 @@ struct Ref { enum { RTmp, RCon, - RSlot, RType, + RSlot, RCall, RMem, }; @@ -362,6 +363,26 @@ struct Use { } u; }; +enum { + NoAlias, + MayAlias, + MustAlias +}; + +struct Alias { + enum { + ABot = 0, + ALoc = 1, /* stack local */ + ACon = 2, + AEsc = 3, /* stack escaping */ + ASym = 4, + AUnk = 6, + } type; + Ref base; + char label[NString]; + int64_t offset; +}; + struct Tmp { char name[NString]; Use *use; @@ -374,6 +395,7 @@ struct Tmp { bits m; } hint; int phi; + Alias alias; int visit; }; @@ -534,6 +556,11 @@ void fillfron(Fn *); /* mem.c */ void memopt(Fn *); +/* alias.c */ +void fillalias(Fn *); +int alias(Ref, int, Ref, int, int *, Fn *); +int escapes(Ref, Fn *); + /* ssa.c */ void filluse(Fn *); void fillpreds(Fn *); From 3f147ed2e078769a71b2935fc36cb08b2b0ddb67 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 4 Sep 2016 20:22:38 -0400 Subject: [PATCH 023/286] implement a simple load elimination pass --- Makefile | 2 +- all.h | 6 +- load.c | 408 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 414 insertions(+), 2 deletions(-) create mode 100644 load.c diff --git a/Makefile b/Makefile index 19bf777..fc649f8 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ABI = sysv V = @ OBJDIR = obj -SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c +SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c OBJ = $(SRC:%.c=$(OBJDIR)/%.o) CFLAGS += -Wall -Wextra -std=c99 -g -pedantic diff --git a/all.h b/all.h index 943480a..5784d9a 100644 --- a/all.h +++ b/all.h @@ -530,7 +530,8 @@ void bsdiff(BSet *, BSet *); int bsequal(BSet *, BSet *); int bsiter(BSet *, int *); -static inline int bshas(BSet *bs, uint elt) +static inline int +bshas(BSet *bs, uint elt) { assert(elt < bs->nt * NBit); return (bs->t[elt/NBit] & BIT(elt%NBit)) != 0; @@ -561,6 +562,9 @@ void fillalias(Fn *); int alias(Ref, int, Ref, int, int *, Fn *); int escapes(Ref, Fn *); +/* load.c */ +void loadopt(Fn *); + /* ssa.c */ void filluse(Fn *); void fillpreds(Fn *); diff --git a/load.c b/load.c new file mode 100644 index 0000000..a6bd68e --- /dev/null +++ b/load.c @@ -0,0 +1,408 @@ +#include "all.h" + +#define MASK(w) (BIT(8*(w)-1)*2-1) /* must work when w==8 */ + +typedef struct Loc Loc; +typedef struct Slice Slice; +typedef struct Insert Insert; + + +struct Loc { + enum { + LRoot, /* right above the original load */ + LLoad, /* inserting a load is allowed */ + LNoLoad, /* only scalar operations allowed */ + } type; + uint off; + Blk *blk; +}; + +struct Slice { + Ref ref; + short sz; + short cls; /* load class */ +}; + +struct Insert { + uint isphi:1; + uint num:31; + int bid; + uint off; + union { + Ins ins; + struct { + Slice m; + Phi *p; + } phi; + } new; +}; + +static Fn *curf; +static uint inum; /* current insertion number */ +static Insert *ilog; /* global insertion log */ +static uint nlog; /* number of entries in the log */ + +static int +loadsz(Ins *l) +{ + switch (l->op) { + case Oloadsb: case Oloadub: return 1; + case Oloadsh: case Oloaduh: return 2; + case Oloadsw: case Oloaduw: return 4; + case Oload: return KWIDE(l->cls) ? 8 : 4; + } + die("unreachable"); +} + +static int +storesz(Ins *s) +{ + switch (s->op) { + case Ostoreb: return 1; + case Ostoreh: return 2; + case Ostorew: case Ostores: return 4; + case Ostorel: case Ostored: return 8; + } + die("unreachable"); +} + +static Ref +iins(int cls, int op, Ref a0, Ref a1, Loc *l) +{ + Insert *ist; + + vgrow(&ilog, ++nlog); + ist = &ilog[nlog-1]; + ist->isphi = 0; + ist->num = inum++; + ist->bid = l->blk->id; + ist->off = l->off; + ist->new.ins = (Ins){op, R, {a0, a1}, cls}; + return ist->new.ins.to = newtmp("ld", cls, curf); +} + +static void +cast(Ref *r, int cls, Loc *l) +{ + int cls0; + + if (rtype(*r) == RCon) + return; + assert(rtype(*r) == RTmp); + cls0 = curf->tmp[r->val].cls; + if (cls0 == cls || (cls == Kw && cls0 == Kl)) + return; + assert(!KWIDE(cls0) || KWIDE(cls)); + if (KWIDE(cls) == KWIDE(cls0)) + *r = iins(cls, Ocast, *r, R, l); + else { + assert(cls == Kl); + if (cls0 == Ks) + *r = iins(Kw, Ocast, *r, R, l); + *r = iins(Kl, Oextuw, *r, R, l); + } +} + +static inline void +mask(int cls, Ref *r, bits msk, Loc *l) +{ + cast(r, cls, l); + *r = iins(cls, Oand, *r, getcon(msk, curf), l); +} + +static Ref +load(Slice sl, bits msk, Loc *l) +{ + Ref r; + int ld, cls, all; + + ld = (int[]){ + [1] = Oloadub, + [2] = Oloaduh, + [4] = Oloaduw, + [8] = Oload + }[sl.sz]; + all = msk == MASK(sl.sz); + if (all) + cls = sl.cls; + else + cls = sl.sz > 4 ? Kl : Kw; + r = iins(cls, ld, sl.ref, R, l); + if (!all) + mask(cls, &r, msk, l); + return r; +} + +/* returns a ref containing the contents of the slice + * passed as argument, all the bits set to 0 in the + * mask argument are zeroed in the result; + * the returned ref has an integer class when the + * mask does not cover all the bits of the slice, + * otherwise, it has class sl.cls + * the procedure returns R when it fails */ +static Ref +def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) +{ + Blk *bp; + bits msk1, msks; + int off, cls, cls1, op, sz, ld; + uint np, oldl, oldt; + Ref r, r1; + Phi *p; + Insert *ist; + Loc l; + + /* invariants: + * -1- b dominates il->blk; so we can use + * temporaries of b in il->blk + * -2- if il->type != LNoLoad, then il->blk + * postdominates the original load; so it + * is safe to load in il->blk + * -3- if il->type != LNoLoad, then b + * postdominates il->blk (and by 2, the + * original load) + */ + assert(dom(b, il->blk)); + oldl = nlog; + oldt = curf->ntmp; + if (0) { + Load: + curf->ntmp = oldt; + nlog = oldl; + if (il->type != LLoad) + return R; + return load(sl, msk, il); + } + + if (!i) + i = &b->ins[b->nins]; + cls = sl.sz > 4 ? Kl : Kw; + msks = MASK(sl.sz); + + while (i > b->ins) { + --i; + if (req(i->to, sl.ref) + || (i->op == Ocall && escapes(sl.ref, curf))) + goto Load; + ld = isload(i->op); + if (ld) { + sz = loadsz(i); + r1 = i->arg[0]; + r = i->to; + } else if (isstore(i->op)) { + sz = storesz(i); + r1 = i->arg[1]; + r = i->arg[0]; + } else + continue; + switch (alias(sl.ref, sl.sz, r1, sz, &off, curf)) { + case MustAlias: + if (off < 0) { + off = -off; + msk1 = (MASK(sz) << 8*off) & msks; + op = Oshl; + } else { + msk1 = (MASK(sz) >> 8*off) & msks; + op = Oshr; + } + if ((msk1 & msk) == 0) + break; + if (off) { + cls1 = cls; + if (op == Oshr && off + sl.sz > 4) + cls1 = Kl; + cast(&r, cls1, il); + r1 = getcon(8*off, curf); + r = iins(cls1, op, r, r1, il); + } + if ((msk1 & msk) != msk1 || off + sz < sl.sz) + mask(cls, &r, msk1 & msk, il); + if ((msk & ~msk1) != 0) { + r1 = def(sl, msk & ~msk1, b, i, il); + if (req(r1, R)) + goto Load; + r = iins(cls, Oor, r, r1, il); + } + if (msk == msks) + cast(&r, sl.cls, il); + return r; + case MayAlias: + if (ld) + break; + else + goto Load; + case NoAlias: + break; + default: + die("unreachable"); + } + } + + for (ist=ilog; ist<&ilog[nlog]; ++ist) + if (ist->isphi && ist->bid == b->id) + if (req(ist->new.phi.m.ref, sl.ref)) + if (ist->new.phi.m.sz == sl.sz) { + r = ist->new.phi.p->to; + if (msk != msks) + mask(cls, &r, msk, il); + else + cast(&r, sl.cls, il); + return r; + } + + for (p=b->phi; p; p=p->link) + if (req(p->to, sl.ref)) + /* scanning predecessors in that + * case would be unsafe */ + goto Load; + + if (b->npred == 0) + goto Load; + if (b->npred == 1) { + bp = b->pred[0]; + assert(bp->loop == il->blk->loop); + l = *il; + if (bp->s2) + l.type = LNoLoad; + r1 = def(sl, msk, bp, 0, &l); + if (req(r1, R)) + goto Load; + return r1; + } + + r = newtmp("ld", sl.cls, curf); + p = alloc(sizeof *p); + vgrow(&ilog, ++nlog); + ist = &ilog[nlog-1]; + ist->isphi = 1; + ist->bid = b->id; + ist->new.phi.m = sl; + ist->new.phi.p = p; + p->to = r; + p->cls = sl.cls; + p->narg = b->npred; + for (np=0; npnpred; ++np) { + bp = b->pred[np]; + if (!bp->s2 + && il->type != LNoLoad + && bp->loop < il->blk->loop) + l.type = LLoad; + else + l.type = LNoLoad; + l.blk = bp; + l.off = bp->nins; + r1 = def(sl, msks, bp, 0, &l); + if (req(r1, R)) + goto Load; + p->arg[np] = r1; + p->blk[np] = bp; + } + if (msk != msks) + mask(cls, &r, msk, il); + return r; +} + +static int +icmp(const void *pa, const void *pb) +{ + Insert *a, *b; + int c; + + a = (Insert *)pa; + b = (Insert *)pb; + if ((c = a->bid - b->bid)) + return c; + if (a->isphi && b->isphi) + return 0; + if (a->isphi) + return -1; + if (b->isphi) + return +1; + if ((c = a->off - b->off)) + return c; + return a->num - b->num; +} + +/* require rpo ssa alias */ +void +loadopt(Fn *fn) +{ + Ins *i, *ib; + Blk *b; + int n, sz; + uint ni, ext, nt; + Insert *ist; + Slice sl; + Loc l; + + curf = fn; + ilog = vnew(0, sizeof ilog[0], emalloc); + nlog = 0; + inum = 0; + for (b=fn->start; b; b=b->link) + for (i=b->ins; i<&b->ins[b->nins]; ++i) { + if (!isload(i->op)) + continue; + sz = loadsz(i); + sl = (Slice){i->arg[0], sz, i->cls}; + l = (Loc){LRoot, i-b->ins, b}; + i->arg[1] = def(sl, MASK(sz), b, i, &l); + } + qsort(ilog, nlog, sizeof ilog[0], icmp); + vgrow(&ilog, nlog+1); + ilog[nlog].bid = fn->nblk; /* add a sentinel */ + ib = vnew(0, sizeof(Ins), emalloc); + for (ist=ilog, n=0; nnblk; ++n) { + b = fn->rpo[n]; + for (; ist->bid == n && ist->isphi; ++ist) { + ist->new.phi.p->link = b->phi; + b->phi = ist->new.phi.p; + } + ni = 0; + nt = 0; + for (;;) { + if (ist->bid == n && ist->off == ni) + i = &ist++->new.ins; + else { + if (ni == b->nins) + break; + i = &b->ins[ni++]; + if (isload(i->op) + && !req(i->arg[1], R)) { + ext = Oextsb + i->op - Oloadsb; + switch (i->op) { + default: + die("unreachable"); + case Oloadsb: + case Oloadub: + case Oloadsh: + case Oloaduh: + i->op = ext; + break; + case Oloadsw: + case Oloaduw: + if (i->cls == Kl) { + i->op = ext; + break; + } + case Oload: + i->op = Ocopy; + break; + } + i->arg[0] = i->arg[1]; + i->arg[1] = R; + } + } + vgrow(&ib, ++nt); + ib[nt-1] = *i; + } + b->nins = nt; + idup(&b->ins, ib, nt); + } + vfree(ib); + vfree(ilog); + if (debug['M']) { + fprintf(stderr, "\n> After load elimination:\n"); + printfn(fn, stderr); + } +} From 8d8d551df23b5055507c501e3396dcfe3c33af2d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 27 Oct 2016 21:01:37 -0400 Subject: [PATCH 024/286] new tests for the load optimization --- test/ldbits.ssa | 40 ++++++++++++++++++++++++++++++++++++++++ test/ldhoist.ssa | 21 +++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 test/ldbits.ssa create mode 100644 test/ldhoist.ssa diff --git a/test/ldbits.ssa b/test/ldbits.ssa new file mode 100644 index 0000000..5e54487 --- /dev/null +++ b/test/ldbits.ssa @@ -0,0 +1,40 @@ +# unit tests for load elimination + +export +function $tests() { +@start + %p =l alloc8 16 + %p3 =l add %p, 3 + %p4 =l add %p, 4 + %p6 =l add %p, 6 + %p8 =l add %p, 8 +@test1 + storew 1, $a + storel 1311768467139281697, %p + storeh 255, %p8 + %x1 =w load %p6 + %c1 =w cnew %x1, 16716340 + jnz %c1, @fail, @test2 +@test2 + storew 2, $a + %x2 =w loadub %p3 + %c2 =w cnew %x2, 135 + jnz %c2, @fail, @test3 +@test3 + storew 3, $a + storew 2864434397, %p8 + %x3 =l load %p3 + %c3 =w cnel %x3, -4914310023110821753 + jnz %c3, @fail, @test4 +@test4 +@ok + storew 0, $a +@fail + ret +} + +# >>> driver +# extern void tests(void); +# int a; +# int main() { tests(); return a; } +# <<< diff --git a/test/ldhoist.ssa b/test/ldhoist.ssa new file mode 100644 index 0000000..d4b1b64 --- /dev/null +++ b/test/ldhoist.ssa @@ -0,0 +1,21 @@ +# loads must not be unsafely hoisted + +export +function w $f(w %n, l %p) { +@start + %r =w copy 0 +@loop + %n =w sub %n, 1 + %c =w csgew %n, 0 + jnz %c, @loop1, @end +@loop1 + %r =w loadw %p + jmp @loop +@end + ret %r +} + +# >>> driver +# extern int f(int, int *); +# int main() { return f(0, 0); } +# <<< From 96f0711dac07cd124843bb773228c98de2d5d914 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 21 Oct 2016 16:00:08 -0400 Subject: [PATCH 025/286] use the new load optimization --- main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 473eaf3..6642ac2 100644 --- a/main.c +++ b/main.c @@ -45,10 +45,14 @@ func(Fn *fn) fillrpo(fn); fillpreds(fn); filluse(fn); - memopt(fn); + /* memopt(fn); */ ssa(fn); filluse(fn); ssacheck(fn); + fillalias(fn); + loadopt(fn); + filluse(fn); + ssacheck(fn); copy(fn); filluse(fn); fold(fn); From d04ba5eae886ce4e5407ccd711fb1c9846dcf1f7 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 21 Dec 2016 09:54:50 -0500 Subject: [PATCH 026/286] fix wrong assertion in load elimination The assertion fails incorrectly on a block right after the end of a loop. --- load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/load.c b/load.c index a6bd68e..26bc2ca 100644 --- a/load.c +++ b/load.c @@ -260,7 +260,7 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) goto Load; if (b->npred == 1) { bp = b->pred[0]; - assert(bp->loop == il->blk->loop); + assert(bp->s2 || bp->loop == il->blk->loop); l = *il; if (bp->s2) l.type = LNoLoad; From 3c3afdc896be4de996d7486e40e7b81488b745b9 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 21 Dec 2016 09:56:40 -0500 Subject: [PATCH 027/286] schedule loop nesting computations earlier --- all.h | 2 ++ cfg.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ main.c | 1 + spill.c | 39 +++++++++++++-------------------------- 4 files changed, 63 insertions(+), 26 deletions(-) diff --git a/all.h b/all.h index 5784d9a..d2763eb 100644 --- a/all.h +++ b/all.h @@ -553,6 +553,8 @@ void filldom(Fn *); int sdom(Blk *, Blk *); int dom(Blk *, Blk *); void fillfron(Fn *); +void loopiter(Fn *, void (*)(Blk *, Blk *)); +void fillloop(Fn *); /* mem.c */ void memopt(Fn *); diff --git a/cfg.c b/cfg.c index ae54deb..bebf0fa 100644 --- a/cfg.c +++ b/cfg.c @@ -228,3 +228,50 @@ fillfron(Fn *fn) addfron(a, b->s2); } } + +static void +loopmark(Blk *hd, Blk *b, void f(Blk *, Blk *)) +{ + uint p; + + if (b->id < hd->id || b->visit == hd->id) + return; + b->visit = hd->id; + f(hd, b); + for (p=0; pnpred; ++p) + loopmark(hd, b->pred[p], f); +} + +void +loopiter(Fn *fn, void f(Blk *, Blk *)) +{ + int n; + uint p; + Blk *b; + + for (b=fn->start; b; b=b->link) + b->visit = -1; + for (n=0; nnblk; ++n) { + b = fn->rpo[n]; + for (p=0; pnpred; ++p) + if (b->pred[p]->id >= n) + loopmark(b, b->pred[p], f); + } +} + +void +multloop(Blk *hd, Blk *b) +{ + (void)hd; + b->loop *= 10; +} + +void +fillloop(Fn *fn) +{ + Blk *b; + + for (b=fn->start; b; b=b->link) + b->loop = 1; + loopiter(fn, multloop); +} diff --git a/main.c b/main.c index 6642ac2..f8d367f 100644 --- a/main.c +++ b/main.c @@ -49,6 +49,7 @@ func(Fn *fn) ssa(fn); filluse(fn); ssacheck(fn); + fillloop(fn); fillalias(fn); loadopt(fn); filluse(fn); diff --git a/spill.c b/spill.c index f9dcc49..5d1726e 100644 --- a/spill.c +++ b/spill.c @@ -1,23 +1,16 @@ #include "all.h" static void -loopmark(Blk *hd, Blk *b) +aggreg(Blk *hd, Blk *b) { int k; - uint n; - if (b->id < hd->id || b->visit == hd->id) - return; - b->visit = hd->id; - b->loop *= 10; /* aggregate looping information at * loop headers */ bsunion(hd->gen, b->gen); for (k=0; k<2; k++) if (b->nlive[k] > hd->nlive[k]) hd->nlive[k] = b->nlive[k]; - for (n=0; nnpred; n++) - loopmark(hd, b->pred[n]); } static void @@ -46,32 +39,26 @@ tmpuse(Ref r, int use, int loop, Fn *fn) void fillcost(Fn *fn) { - int n, hd; + int n; uint a; Blk *b; Ins *i; Tmp *t; Phi *p; - for (b=fn->start; b; b=b->link) { - b->loop = 1; - b->visit = -1; - } - if (debug['S']) + loopiter(fn, aggreg); + if (debug['S']) { fprintf(stderr, "\n> Loop information:\n"); - for (n=0; nnblk; n++) { - b = fn->rpo[n]; - hd = 0; - for (a=0; anpred; a++) - if (b->pred[a]->id >= n) { - loopmark(b, b->pred[a]); - hd = 1; + for (b=fn->start; b; b=b->link) { + for (a=0; anpred; ++a) + if (b->id <= b->pred[a]->id) + break; + if (a != b->npred) { + fprintf(stderr, "\t%-10s", b->name); + fprintf(stderr, " (% 3d ", b->nlive[0]); + fprintf(stderr, "% 3d) ", b->nlive[1]); + dumpts(b->gen, fn->tmp, stderr); } - if (hd && debug['S']) { - fprintf(stderr, "\t%-10s", b->name); - fprintf(stderr, " (% 3d ", b->nlive[0]); - fprintf(stderr, "% 3d) ", b->nlive[1]); - dumpts(b->gen, fn->tmp, stderr); } } for (t=fn->tmp; t-fn->tmp < fn->ntmp; t++) { From 52cc53185e44a7e8690fb5ec856863a4d259034b Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 28 Dec 2016 06:43:05 -0500 Subject: [PATCH 028/286] loosen assertion in load elimination The assertion was invalid, I was assuming il->blk was b when writing it. The new assertion should be right: If the loop level were to decrease we would get out of a cycle in cfg, this should not be possible unless we go through a block with more than 1 predecessor. --- load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/load.c b/load.c index 26bc2ca..56204dc 100644 --- a/load.c +++ b/load.c @@ -260,7 +260,7 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) goto Load; if (b->npred == 1) { bp = b->pred[0]; - assert(bp->s2 || bp->loop == il->blk->loop); + assert(bp->loop >= il->blk->loop); l = *il; if (bp->s2) l.type = LNoLoad; From ea4b47003b1b2bb0ec204e90e3a3f1b0bb0a6090 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 28 Dec 2016 12:45:40 -0500 Subject: [PATCH 029/286] fix escapes handling (patch from ac) --- parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parse.c b/parse.c index f70bbc2..86a16b8 100644 --- a/parse.c +++ b/parse.c @@ -202,7 +202,7 @@ lex() { 0, Txxx } }; static char tok[NString]; - int c, i; + int c, i, esc; int t; do @@ -262,16 +262,17 @@ lex() } if (c == '"') { tokval.str = vnew(0, 1, alloc); + esc = 0; for (i=0;; i++) { c = fgetc(inf); if (c == EOF) err("unterminated string"); vgrow(&tokval.str, i+1); - if (c == '"') - if (!i || tokval.str[i-1] != '\\') { + if (c == '"' && !esc) { tokval.str[i] = 0; return Tstr; } + esc = (c == '\\' && !esc); tokval.str[i] = c; } } From 7815610cd8af498beac01d3ae6a1c9b20f1f0a8d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 29 Dec 2016 17:51:26 -0500 Subject: [PATCH 030/286] simplify seladdr() This also provides a violent fix to a bug causing an invalid addressing to be generated when indexing into a global variable. The fix is not satisfactory, though, as bad code is generated (instead of invalid code before). --- isel.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/isel.c b/isel.c index 399ed5e..9a60554 100644 --- a/isel.c +++ b/isel.c @@ -24,7 +24,6 @@ typedef struct ANum ANum; struct ANum { char n, l, r; Ins *i; - Ref mem; }; static void amatch(Addr *, Ref, ANum *, Fn *, int); @@ -158,24 +157,19 @@ static void seladdr(Ref *r, ANum *an, Fn *fn) { Addr a; - Ref r0, r1; + Ref r0; r0 = *r; if (rtype(r0) == RTmp) { + amatch(&a, r0, an, fn, 1); + if (req(a.base, R)) + return; chuse(r0, -1, fn); - r1 = an[r0.val].mem; - if (req(r1, R)) { - amatch(&a, r0, an, fn, 1); - vgrow(&fn->mem, ++fn->nmem); - fn->mem[fn->nmem-1] = a; - r1 = MEM(fn->nmem-1); - chuse(a.base, +1, fn); - chuse(a.index, +1, fn); - if (rtype(a.base) != RTmp) - if (rtype(a.index) != RTmp) - an[r0.val].mem = r1; - } - *r = r1; + vgrow(&fn->mem, ++fn->nmem); + fn->mem[fn->nmem-1] = a; + chuse(a.base, +1, fn); + chuse(a.index, +1, fn); + *r = MEM(fn->nmem-1); } } @@ -629,5 +623,9 @@ isel(Fn *fn) if (debug['I']) { fprintf(stderr, "\n> After instruction selection:\n"); printfn(fn, stderr); + for (n=0; nntmp; ++n) { + if (strcmp(fn->tmp[n].name, "i") == 0) + fprintf(stderr, ">> nuse for i: %d\n", fn->tmp[n].nuse); + } } } From e9ccf35b8a18b542603714c84fa2869b24a17af0 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 29 Dec 2016 17:58:56 -0500 Subject: [PATCH 031/286] do not create useless mem refs --- isel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isel.c b/isel.c index 9a60554..708cc0d 100644 --- a/isel.c +++ b/isel.c @@ -162,7 +162,7 @@ seladdr(Ref *r, ANum *an, Fn *fn) r0 = *r; if (rtype(r0) == RTmp) { amatch(&a, r0, an, fn, 1); - if (req(a.base, R)) + if (req(a.base, R) || req(a.base, r0)) return; chuse(r0, -1, fn); vgrow(&fn->mem, ++fn->nmem); From ed8fe831fe583e50c5b3a0c0096deaf350b0c309 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 29 Dec 2016 20:58:30 -0500 Subject: [PATCH 032/286] remove debugging stub --- isel.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/isel.c b/isel.c index 708cc0d..52ba599 100644 --- a/isel.c +++ b/isel.c @@ -623,9 +623,5 @@ isel(Fn *fn) if (debug['I']) { fprintf(stderr, "\n> After instruction selection:\n"); printfn(fn, stderr); - for (n=0; nntmp; ++n) { - if (strcmp(fn->tmp[n].name, "i") == 0) - fprintf(stderr, ">> nuse for i: %d\n", fn->tmp[n].nuse); - } } } From cd458524b3a6008694e349766e514411893601fa Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 30 Dec 2016 21:57:04 -0500 Subject: [PATCH 033/286] new tool to improve lexing speed --- tools/lexh.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 tools/lexh.c diff --git a/tools/lexh.c b/tools/lexh.c new file mode 100644 index 0000000..b61dc06 --- /dev/null +++ b/tools/lexh.c @@ -0,0 +1,91 @@ +/*% c99 -O3 -Wall -o # % + */ +#include +#include +#include +#include + +typedef unsigned int uint; + +char *tok[] = { + + "add", "sub", "div", "rem", "udiv", "urem", "mul", + "and", "or", "xor", "sar", "shr", "shl", "stored", + "stores", "storel", "storew", "storeh", "storeb", + "load", "loadsw", "loaduw", "loadsh", "loaduh", + "loadsb", "loadub", "extsw", "extuw", "extsh", + "extuh", "extsb", "extub", "exts", "truncd", + "stosi", "dtosi", "swtof", "sltof", "cast", "copy", + "alloc4", "alloc8", "alloc16", "culew", "cultw", + "cslew", "csltw", "csgtw", "csgew", "cugtw", + "cugew", "ceqw", "cnew", "culel", "cultl", "cslel", + "csltl", "csgtl", "csgel", "cugtl", "cugel", + "ceql", "cnel", "cles", "clts", "cgts", "cges", + "cnes", "ceqs", "cos", "cuos", "cled", "cltd", + "cgtd", "cged", "cned", "ceqd", "cod", "cuod", + + "call", "phi", "jmp", "jnz", "ret", "export", + "function", "type", "data", "align", "l", "w", + "h", "b", "d", "s", "z", "loadw", "loadl", "loads", + "loadd", "alloc1", "alloc2", + +}; +enum { + Ntok = sizeof tok / sizeof tok[0] +}; + +uint th[Ntok]; + +uint +hash(char *s) +{ + uint h; + + h = 0; + for (; *s; ++s) + h = *s + 5*h; + return h; +} + +int +main() +{ + char *bmap; + uint h; + int i, j; + int M, K; + + bmap = malloc(1u << 31); + + for (i=0; i> M; + if (bmap[h]) + break; + bmap[h] = 1; + } + if (i==Ntok) { + printf("found K=%d for M=%d\n", K, M); + exit(0); + } + } + } +} From 103f4273569f3c03062e0fa8d8aa1fa15607951b Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 31 Dec 2016 14:17:11 -0500 Subject: [PATCH 034/286] minor bugs in lexh tool --- tools/lexh.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/lexh.c b/tools/lexh.c index b61dc06..a8d8763 100644 --- a/tools/lexh.c +++ b/tools/lexh.c @@ -4,8 +4,7 @@ #include #include #include - -typedef unsigned int uint; +#include char *tok[] = { @@ -34,12 +33,12 @@ enum { Ntok = sizeof tok / sizeof tok[0] }; -uint th[Ntok]; +uint32_t th[Ntok]; -uint +uint32_t hash(char *s) { - uint h; + uint32_t h; h = 0; for (; *s; ++s) @@ -51,9 +50,8 @@ int main() { char *bmap; - uint h; + uint32_t h, M, K; int i, j; - int M, K; bmap = malloc(1u << 31); @@ -74,7 +72,8 @@ main() for (;; --M) { printf("trying M=%d...\n", M); - for (K = 1; K> M; @@ -86,6 +85,7 @@ main() printf("found K=%d for M=%d\n", K, M); exit(0); } - } + K += 2; + } while (K != 1); } } From 391b79fcbdae2d1e2fc6ad77e4fadee357759314 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 31 Dec 2016 14:18:17 -0500 Subject: [PATCH 035/286] use a perfect hash for lexing --- parse.c | 127 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 88 insertions(+), 39 deletions(-) diff --git a/parse.c b/parse.c index 86a16b8..c1dc863 100644 --- a/parse.c +++ b/parse.c @@ -94,7 +94,16 @@ typedef enum { } PState; enum { - Txxx = NPubOp, + Txxx = 0, + + /* aliases */ + Tloadw = NPubOp, + Tloadl, + Tloads, + Tloadd, + Talloc1, + Talloc2, + Tcall, Tphi, Tjmp, @@ -131,9 +140,43 @@ enum { Trbrace, Tnl, Teof, + + Ntok }; +static char *kwmap[Ntok] = { + [Tloadw] = "loadw", + [Tloadl] = "loadl", + [Tloads] = "loads", + [Tloadd] = "loadd", + [Talloc1] = "alloc1", + [Talloc2] = "alloc2", + [Tcall] = "call", + [Tphi] = "phi", + [Tjmp] = "jmp", + [Tjnz] = "jnz", + [Tret] = "ret", + [Texport] = "export", + [Tfunc] = "function", + [Ttype] = "type", + [Tdata] = "data", + [Talign] = "align", + [Tl] = "l", + [Tw] = "w", + [Th] = "h", + [Tb] = "b", + [Td] = "d", + [Ts] = "s", + [Tz] = "z", +}; + +enum { + /* found using tools/lexh.c */ + K = 2948605, + M = 23, +}; +static char lexh[1 << (32-M)]; static FILE *inf; static char *inpath; static int thead; @@ -169,38 +212,42 @@ err(char *s, ...) exit(1); } +static inline long +tokh(char *s) +{ + uint32_t h; + + h = 0; + for (; *s; ++s) + h = *s + 5*h; + return h*K >> M; +} + +static void +lexinit() +{ + static int done; + int i; + long h; + + if (done) + return; + for (i=0; i= Tloadw && op <= Tloadd) + op = Oload; + if (op == Talloc1 || op == Talloc2) + op = Oalloc; if (k == 4) err("size class must be w, l, s, or d"); if (op >= NPubOp) @@ -1010,6 +1058,7 @@ parse(FILE *f, char *path, void data(Dat *), void func(Fn *)) { int t, export; + lexinit(); inf = f; inpath = path; lnum = 1; From b976b2da5c88eed0c47bfbe2cf457330bcb93fa3 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 4 Jan 2017 15:02:07 -0500 Subject: [PATCH 036/286] more performance improvements in the parser --- parse.c | 55 +++++++++++++++++++++++++++++----------------------- tools/lexh.c | 2 +- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/parse.c b/parse.c index c1dc863..a435754 100644 --- a/parse.c +++ b/parse.c @@ -171,9 +171,10 @@ static char *kwmap[Ntok] = { }; enum { - /* found using tools/lexh.c */ - K = 2948605, - M = 23, + BMask = 8191, /* for blocks hash */ + + K = 2047061843, /* found using tools/lexh.c */ + M = 24, }; static char lexh[1 << (32-M)]; @@ -191,14 +192,13 @@ static int lnum; static Fn *curf; static Phi **plink; -static Blk **bmap; static Blk *curb; static Blk **blink; +static Blk *blkh[BMask+1]; static int nblk; static int rcls; static int ntyp; - void err(char *s, ...) { @@ -212,15 +212,15 @@ err(char *s, ...) exit(1); } -static inline long -tokh(char *s) +static inline uint32_t +hash(char *s) { uint32_t h; h = 0; for (; *s; ++s) - h = *s + 5*h; - return h*K >> M; + h = *s + 17*h; + return h; } static void @@ -238,7 +238,7 @@ lexinit() assert(Ntok <= CHAR_MAX); for (i=0; i> M; assert(lexh[h] == Txxx); lexh[h] = i; } @@ -340,7 +340,7 @@ Alpha: c = fgetc(inf); if (t != Txxx) { return t; } - t = lexh[tokh(tok)]; + t = lexh[hash(tok)*K >> M]; if (t == Txxx || strcmp(kwmap[t], tok) != 0) { err("unknown keyword %s", tok); return Txxx; @@ -522,16 +522,19 @@ parserefl(int arg) static Blk * findblk(char *name) { - int i; + Blk *b; + uint32_t h; - for (i=0; iname, name) == 0) - return bmap[i]; - vgrow(&bmap, ++nblk); - bmap[i] = blknew(); - bmap[i]->id = i; - strcpy(bmap[i]->name, name); - return bmap[i]; + h = hash(name) & BMask; + for (b=blkh[h]; b; b=b->dlink) + if (strcmp(b->name, name) == 0) + return b; + b = blknew(); + b->id = nblk++; + strcpy(b->name, name); + b->dlink = blkh[h]; + blkh[h] = b; + return b; } static void @@ -797,7 +800,8 @@ typecheck(Fn *fn) static Fn * parsefn(int export) { - int r; + Blk *b; + int i; PState ps; curb = 0; @@ -808,9 +812,8 @@ parsefn(int export) curf->ncon = 1; /* first constant must be 0 */ curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0], alloc); curf->con = vnew(curf->ncon, sizeof curf->con[0], alloc); - for (r=0; rcon[0].type = CBits; curf->export = export; blink = &curf->start; @@ -837,6 +840,10 @@ parsefn(int export) curf->nmem = 0; curf->nblk = nblk; curf->rpo = 0; + for (b=0; b; b=b->link) + b->dlink = 0; /* was trashed by findblk() */ + for (i=0; i Date: Wed, 4 Jan 2017 19:22:31 -0500 Subject: [PATCH 037/286] improve performance of bsiter() --- util.c | 49 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/util.c b/util.c index 5c54c12..380f139 100644 --- a/util.c +++ b/util.c @@ -275,6 +275,32 @@ popcnt(bits b) return b & 0xff; } +inline static int +firstbit(bits b) +{ + int n; + + n = 0; + if (!(b & 0xffffffff)) { + n += 32; + b >>= 32; + } + if (!(b & 0xffff)) { + n += 16; + b >>= 16; + } + if (!(b & 0xff)) { + n += 8; + b >>= 8; + } + if (!(b & 0xf)) { + n += 4; + b >>= 4; + } + n += (char[16]){4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0}[b & 0xf]; + return n; +} + uint bscount(BSet *bs) { @@ -349,18 +375,23 @@ bszero(BSet *bs) int bsiter(BSet *bs, int *elt) { - uint i; + bits b; + uint t, i; - for (i=*elt;; i++) { - while (i < bsmax(bs) && !bs->t[i/NBit]) - i = (i + NBit) & -NBit; - if (i >= bsmax(bs)) + i = *elt; + t = i/NBit; + if (t >= bs->nt) + return 0; + b = bs->t[t]; + b &= ~(BIT(i%NBit) - 1); + while (!b) { + ++t; + if (t >= bs->nt) return 0; - if (bshas(bs, i)) { - *elt = i; - return 1; - } + b = bs->t[t]; } + *elt = NBit*t + firstbit(b); + return 1; } void From f5917c35bdfa6c297647f4ceb60b01793ad57f0a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 4 Jan 2017 21:51:06 -0500 Subject: [PATCH 038/286] attempt to fix cc flags in tests --- tools/unit.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/unit.sh b/tools/unit.sh index ded1b29..ace28fb 100755 --- a/tools/unit.sh +++ b/tools/unit.sh @@ -59,7 +59,7 @@ once() { LNK="$ASM" fi - if ! cc -no-pie -g -o $BIN $LNK + if ! cc $PIE -g -o $BIN $LNK then echo "[cc fail]" return 1 @@ -94,6 +94,15 @@ then exit 1 fi +for wtf in -nopie -no-pie +do + if echo "int main() { return 0; }" | + cc $wtf -x c -o /dev/null - >/dev/null 2>&1 + then + PIE=$wtf + fi +done + case $1 in "all") F=0 From 260178dcef927ecdddfba2a0b4097a3955aa7940 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 6 Jan 2017 22:57:30 -0500 Subject: [PATCH 039/286] prepare for new c9x infrastructure --- doc/Makefile | 15 +++------------ doc/txt/txt.css | 9 --------- 2 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 doc/txt/txt.css diff --git a/doc/Makefile b/doc/Makefile index 6fc15e4..3a30afb 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,21 +1,13 @@ -.PHONY: all clean sync - DOCS = abi il llvm -all: $(DOCS:%=html/%.html) html/txt.css - -html/txt.css: txt/txt.css - cp -f $< $@ +all: $(DOCS:%=html/%.html) clean: rm -fr html html/%.html: %.txt mkdir html 2> /dev/null || true - ( echo ''; \ - echo ''; \ - echo ''; \ - echo ''; \ + ( echo ''; \ sed -ne '2{s,.*,&,;p;q}' $<; \ echo '
'; \ sed -ne '2{s,.*,

&

,;p;q}' $<; \ @@ -23,5 +15,4 @@ html/%.html: %.txt echo '
'; \ ) > $@ -sync: - scp html/* h:/srv/data/w/compile/doc/ +.PHONY: all clean diff --git a/doc/txt/txt.css b/doc/txt/txt.css deleted file mode 100644 index 6f11930..0000000 --- a/doc/txt/txt.css +++ /dev/null @@ -1,9 +0,0 @@ -h3 { - border-bottom: 1px solid #aaa; - background-color: #eee; -} - -.bnf { - background-color: white; - padding-left: 0.7em; -} From 0602ad48f0e21ad604d938cd77c652adeb5eed87 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 7 Jan 2017 15:57:04 -0500 Subject: [PATCH 040/286] remove styling from generated html --- doc/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 3a30afb..e1b93eb 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -7,8 +7,7 @@ clean: html/%.html: %.txt mkdir html 2> /dev/null || true - ( echo ''; \ - sed -ne '2{s,.*,&,;p;q}' $<; \ + ( sed -ne '2{s,.*,&,;p;q}' $<; \ echo '
'; \ sed -ne '2{s,.*,

&

,;p;q}' $<; \ sed -e '1,3d' $< | ocaml txt/txt.ml; \ From e38da51c14d9eaf8c53b58b3d2e33d7b37768f29 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 10 Jan 2017 17:23:56 -0500 Subject: [PATCH 041/286] isel fixes for lame apple assembler --- isel.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/isel.c b/isel.c index 52ba599..0c92dcd 100644 --- a/isel.c +++ b/isel.c @@ -114,7 +114,7 @@ argcls(Ins *i, int n) static void fixarg(Ref *r, int k, int phi, Fn *fn) { - Addr a; + Addr a, *m; Ref r0, r1; int s, n; @@ -149,6 +149,18 @@ fixarg(Ref *r, int k, int phi, Fn *fn) */ r1 = newtmp("isel", Kl, fn); emit(Oaddr, Kl, r1, SLOT(s), R); + } else if (rtype(r0) == RMem) { + /* apple asm fix */ + m = &fn->mem[r0.val]; + if (req(m->base, R)) { + n = fn->ncon; + vgrow(&fn->con, ++fn->ncon); + fn->con[n] = m->offset; + m->offset.type = CUndef; + r0 = newtmp("isel", Kl, fn); + emit(Oaddr, Kl, r0, CON(n), R); + m->base = r0; + } } *r = r1; } @@ -162,8 +174,19 @@ seladdr(Ref *r, ANum *an, Fn *fn) r0 = *r; if (rtype(r0) == RTmp) { amatch(&a, r0, an, fn, 1); - if (req(a.base, R) || req(a.base, r0)) + if (req(a.base, r0)) return; + if (a.offset.type == CAddr) + if (!req(a.base, R)) { + /* apple asm fix */ + if (!req(a.index, R)) + return; + else { + a.index = a.base; + a.scale = 1; + a.base = R; + } + } chuse(r0, -1, fn); vgrow(&fn->mem, ++fn->nmem); fn->mem[fn->nmem-1] = a; @@ -185,7 +208,7 @@ selcmp(Ref arg[2], int k, Fn *fn) } assert(rtype(arg[0]) != RCon); emit(Oxcmp, k, R, arg[1], arg[0]); - iarg = curi->arg; + iarg = curi->arg; /* fixarg() can change curi */ fixarg(&iarg[0], k, 0, fn); fixarg(&iarg[1], k, 0, fn); } @@ -290,7 +313,7 @@ sel(Ins i, ANum *an, Fn *fn) case_OExt: Emit: emiti(i); - iarg = curi->arg; + iarg = curi->arg; /* fixarg() can change curi */ fixarg(&iarg[0], argcls(&i, 0), 0, fn); fixarg(&iarg[1], argcls(&i, 1), 0, fn); break; From 2b4ece6f99c18df090a127ec20c60ff05cbc0705 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 12 Jan 2017 22:31:51 -0500 Subject: [PATCH 042/286] use a less obtuse api for vnew() --- all.h | 11 ++++++----- cfg.c | 2 +- fold.c | 2 +- load.c | 4 ++-- main.c | 5 +++++ parse.c | 10 +++++----- ssa.c | 2 +- util.c | 14 ++++++++------ 8 files changed, 29 insertions(+), 21 deletions(-) diff --git a/all.h b/all.h index d2763eb..7243e09 100644 --- a/all.h +++ b/all.h @@ -490,13 +490,14 @@ struct Dat { /* main.c */ -enum Asm { - Gasmacho, - Gaself, -}; extern char debug['Z'+1]; /* util.c */ +typedef enum { + Pheap, /* free() necessary */ + Pfn, /* discarded after processing the function */ +} Pool; + extern Typ typ[NTyp]; extern Ins insb[NIns], *curi; void die_(char *, char *, ...) __attribute__((noreturn)); @@ -507,7 +508,7 @@ void emit(int, int, Ref, Ref, Ref); void emiti(Ins); void idup(Ins **, Ins *, ulong); Ins *icpy(Ins *, Ins *, ulong); -void *vnew(ulong, size_t, void *(size_t)); +void *vnew(ulong, size_t, Pool); void vfree(void *); void vgrow(void *, ulong); int clsmerge(short *, short); diff --git a/cfg.c b/cfg.c index bebf0fa..583629b 100644 --- a/cfg.c +++ b/cfg.c @@ -207,7 +207,7 @@ addfron(Blk *a, Blk *b) if (a->fron[n] == b) return; if (!a->nfron) - a->fron = vnew(++a->nfron, sizeof a->fron[0], alloc); + a->fron = vnew(++a->nfron, sizeof a->fron[0], Pfn); else vgrow(&a->fron, ++a->nfron); a->fron[a->nfron-1] = b; diff --git a/fold.c b/fold.c index a000ff4..110a23c 100644 --- a/fold.c +++ b/fold.c @@ -193,7 +193,7 @@ fold(Fn *fn) val = emalloc(fn->ntmp * sizeof val[0]); edge = emalloc(fn->nblk * sizeof edge[0]); - usewrk = vnew(0, sizeof usewrk[0], emalloc); + usewrk = vnew(0, sizeof usewrk[0], Pheap); for (n=0; nntmp; n++) val[n] = Top; diff --git a/load.c b/load.c index 56204dc..be6b53d 100644 --- a/load.c +++ b/load.c @@ -336,7 +336,7 @@ loadopt(Fn *fn) Loc l; curf = fn; - ilog = vnew(0, sizeof ilog[0], emalloc); + ilog = vnew(0, sizeof ilog[0], Pheap); nlog = 0; inum = 0; for (b=fn->start; b; b=b->link) @@ -351,7 +351,7 @@ loadopt(Fn *fn) qsort(ilog, nlog, sizeof ilog[0], icmp); vgrow(&ilog, nlog+1); ilog[nlog].bid = fn->nblk; /* add a sentinel */ - ib = vnew(0, sizeof(Ins), emalloc); + ib = vnew(0, sizeof(Ins), Pheap); for (ist=ilog, n=0; nnblk; ++n) { b = fn->rpo[n]; for (; ist->bid == n && ist->isphi; ++ist) { diff --git a/main.c b/main.c index f8d367f..fd0b6e4 100644 --- a/main.c +++ b/main.c @@ -3,6 +3,11 @@ #include #include +enum Asm { + Gasmacho, + Gaself, +}; + char debug['Z'+1] = { ['P'] = 0, /* parsing */ ['A'] = 0, /* abi lowering */ diff --git a/parse.c b/parse.c index a435754..f8fd705 100644 --- a/parse.c +++ b/parse.c @@ -308,7 +308,7 @@ lex() return Tint; } if (c == '"') { - tokval.str = vnew(0, 1, alloc); + tokval.str = vnew(0, 1, Pfn); esc = 0; for (i=0;; i++) { c = fgetc(inf); @@ -810,8 +810,8 @@ parsefn(int export) curf = alloc(sizeof *curf); curf->ntmp = 0; curf->ncon = 1; /* first constant must be 0 */ - curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0], alloc); - curf->con = vnew(curf->ncon, sizeof curf->con[0], alloc); + curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0], Pfn); + curf->con = vnew(curf->ncon, sizeof curf->con[0], Pfn); for (i=0; icon[0].type = CBits; @@ -836,7 +836,7 @@ parsefn(int export) err("empty function"); if (curb->jmp.type == Jxxx) err("last block misses jump"); - curf->mem = vnew(0, sizeof curf->mem[0], alloc); + curf->mem = vnew(0, sizeof curf->mem[0], Pfn); curf->nmem = 0; curf->nblk = nblk; curf->rpo = 0; @@ -950,7 +950,7 @@ parsetyp() return; } n = 0; - ty->seg = vnew(1, sizeof ty->seg[0], emalloc); + ty->seg = vnew(1, sizeof ty->seg[0], Pheap); if (t == Tlbrace) do { if (t != Tlbrace) diff --git a/ssa.c b/ssa.c index a040484..c0c340c 100644 --- a/ssa.c +++ b/ssa.c @@ -52,7 +52,7 @@ filluse(Fn *fn) tmp[t].phi = 0; tmp[t].cls = 0; if (tmp[t].use == 0) - tmp[t].use = vnew(0, sizeof(Use), alloc); + tmp[t].use = vnew(0, sizeof(Use), Pfn); } for (b=fn->start; b; b=b->link) { for (p=b->phi; p; p=p->link) { diff --git a/util.c b/util.c index 380f139..9b73771 100644 --- a/util.c +++ b/util.c @@ -6,7 +6,7 @@ typedef struct Vec Vec; struct Vec { ulong mag; - void *(*alloc)(); + Pool pool; size_t esz; ulong cap; union { @@ -119,18 +119,20 @@ icpy(Ins *d, Ins *s, ulong n) } void * -vnew(ulong len, size_t esz, void *alloc(size_t)) +vnew(ulong len, size_t esz, Pool pool) { + void *(*f)(size_t); ulong cap; Vec *v; for (cap=VMin; capmag = VMag; v->cap = cap; v->esz = esz; - v->alloc = alloc; + v->pool = pool; return v + 1; } @@ -141,7 +143,7 @@ vfree(void *p) v = (Vec *)p - 1; assert(v->mag == VMag); - if (v->alloc == emalloc) { + if (v->pool == Pheap) { v->mag = 0; free(v); } @@ -157,7 +159,7 @@ vgrow(void *vp, ulong len) assert(v+1 && v->mag == VMag); if (v->cap >= len) return; - v1 = vnew(len, v->esz, v->alloc); + v1 = vnew(len, v->esz, v->pool); memcpy(v1, v+1, v->cap * v->esz); vfree(v+1); *(Vec **)vp = v1; From 9fbb276e37125d1e14abbc854b9ad1d7c29f90e0 Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Fri, 20 Jan 2017 17:21:53 +0100 Subject: [PATCH 043/286] change 'b' and 'h' ordering in IL doc --- doc/il.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index 865b81f..4fe55a5 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -109,7 +109,7 @@ starting with the sigil `?`. `bnf BASETY := 'w' | 'l' | 's' | 'd' # Base types - EXTTY := BASETY | 'h' | 'b' # Extended types + EXTTY := BASETY | 'b' | 'h' # Extended types The IL makes very minimal use of types. By design, the types used are restricted to what is necessary for unambiguous @@ -125,8 +125,8 @@ by an integer type sufficiently wide to represent all memory addresses (e.g. `l` on x64). Temporaries in the IL can only have a basic type. -Extended types contain base types and add `h` (half word) -and `b` (byte), respectively for 16 bits and 8 bits integers. +Extended types contain base types plus `b` (byte) and `h` +(half word), respectively for 8 bits and 16 bits integers. They are used in <@ Aggregate Types> and <@ Data> definitions. For C interfacing, the IL also provides user-defined aggregate From cec21e6540ee2ddf6ad874f50ef1c69631ec37a4 Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Fri, 20 Jan 2017 17:15:46 +0100 Subject: [PATCH 044/286] create an instruction index for the IL doc --- doc/il.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/doc/il.txt b/doc/il.txt index 4fe55a5..08ded34 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -30,6 +30,7 @@ * <@ Cast > * <@ Call > * <@ Phi > + * <@ Instructions index > - 1. Basic Concepts ------------------- @@ -800,3 +801,52 @@ An important remark about phi instructions is that QBE assumes that if a variable is defined by a phi it respects all the SSA invariants. So it is critical to not use phi instructions unless you know exactly what you are doing. + +~ Instructions index +~~~~~~~~~~~~~~~~~~~~~ + +List of all QBE IL instructions, linked to their respective +section. + + * <@ Arithmetic and Bits > + + `add`, `sub`, `div`, `mul` + + `udiv`, `rem`, `urem` + + `or`, `xor`, `and` + + `sar`, `shr`, `shl` + + * <@ Memory > + + `stored`, `stores`, `storel`, `storew`, `storeh`, `storeb` + + `loadd`, `loads`, `loadl`, `loadsw`, `loadsh`, `loadsb` + + `alloc4`, `alloc8`, `alloc16` + + * <@ Comparisons > + + `ceqb`, `ceqh`, `ceqw`, `ceql`, `cneb`, `cneh`, `cnew`, + `cnel`, `csleb`, `csleh`, `cslew`, `cslel`, `csltb`, + `cslth`, `csltw`, `csltl`, `csgeb`, `csgeh`, `csgew`, + `csgel`, `csgtb`, `csgth`, `csgtw`, `csgtl`, `culeb`, + `culeh`, `culew`, `culel`, `cultb`, `culth`, `cultw`, + `cultl`, `cugeb`, `cugeh`, `cugew`, `cugel`, `cugtb`, + `cugth`, `cugtw`, `cugtl` + + `ceqs`, `ceqd`, `cnes`, `cned`, `cles`, `cled`, `clts`, + `cltd`, `cges`, `cged`, `cgts`, `cgtd`, `cos`, `cod`, + `cuos`, `cuod` + + * <@ Conversions > + + `extsw`, `extsh`, `extsb`, `exts` + `extuw`, `extuh`, `extub`, `truncd` + `stosi`, `dtosi`, `swtof`, `sltof` + + * <@ Cast > + + `cast` + From 4d656383d8342601aef508bd6141b1c9632d50a0 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 1 Feb 2017 13:46:08 -0500 Subject: [PATCH 045/286] fix bug in varadd(), thanks Ed Davis --- minic/minic.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/minic/minic.y b/minic/minic.y index 51debca..a466c99 100644 --- a/minic/minic.y +++ b/minic/minic.y @@ -137,7 +137,8 @@ varadd(char *v, int glo, unsigned ctyp) } if (strcmp(varh[h].v, v) == 0) die("double definition"); - } while(++h != h0); + h = (h+1) % NVar; + } while(h != h0); die("too many variables"); } From d4be94bae0aa7af8a20372d41a4ae95a881b783c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 1 Feb 2017 13:50:04 -0500 Subject: [PATCH 046/286] fix the same bug in varget() --- minic/minic.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/minic/minic.y b/minic/minic.y index a466c99..6b4150d 100644 --- a/minic/minic.y +++ b/minic/minic.y @@ -162,7 +162,8 @@ varget(char *v) s.ctyp = varh[h].ctyp; return &s; } - } while (++h != h0 && varh[h].v[0] != 0); + h = (h+1) % NVar; + } while (h != h0 && varh[h].v[0] != 0); return 0; } From 835b2b4910c19ee2a9411da55080be6b1e30a722 Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Fri, 20 Jan 2017 17:15:46 +0100 Subject: [PATCH 047/286] create an index for the instructions in the IL doc --- doc/il.txt | 72 +++++++++++++++++++++++------------------------------- 1 file changed, 30 insertions(+), 42 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index 08ded34..7295b3b 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -30,7 +30,7 @@ * <@ Cast > * <@ Call > * <@ Phi > - * <@ Instructions index > + 7. <@ Instructions Index > - 1. Basic Concepts ------------------- @@ -434,7 +434,7 @@ the following list. a return type, no return value can be used. - 6. Instructions -------------------------- +----------------- Instructions are the smallest piece of code in the IL, they form the body of <@ Blocks >. The IL uses a three-address @@ -802,51 +802,39 @@ assumes that if a variable is defined by a phi it respects all the SSA invariants. So it is critical to not use phi instructions unless you know exactly what you are doing. -~ Instructions index -~~~~~~~~~~~~~~~~~~~~~ - -List of all QBE IL instructions, linked to their respective -section. - - * <@ Arithmetic and Bits > - - `add`, `sub`, `div`, `mul` - - `udiv`, `rem`, `urem` - - `or`, `xor`, `and` - - `sar`, `shr`, `shl` - - * <@ Memory > - - `stored`, `stores`, `storel`, `storew`, `storeh`, `storeb` - - `loadd`, `loads`, `loadl`, `loadsw`, `loadsh`, `loadsb` - - `alloc4`, `alloc8`, `alloc16` +- 7. Instructions Index +----------------------- - * <@ Comparisons > +<@ Arithmetic and Bits >: + `add`, `sub`, `div`, `mul`, `udiv`, `rem`, `urem`, `or`, + `xor`, `and`, `sar`, `shr`, `shl` - `ceqb`, `ceqh`, `ceqw`, `ceql`, `cneb`, `cneh`, `cnew`, - `cnel`, `csleb`, `csleh`, `cslew`, `cslel`, `csltb`, - `cslth`, `csltw`, `csltl`, `csgeb`, `csgeh`, `csgew`, - `csgel`, `csgtb`, `csgth`, `csgtw`, `csgtl`, `culeb`, - `culeh`, `culew`, `culel`, `cultb`, `culth`, `cultw`, - `cultl`, `cugeb`, `cugeh`, `cugew`, `cugel`, `cugtb`, - `cugth`, `cugtw`, `cugtl` +<@ Memory >: + `storeb`, `storeh`, `storew`, `storel`, `stores`, `stored`, + `loadd`, `loads`, `loadl`, `loadw`, `loadsw`, `loaduw`, + `loadsh`, `loaduh`, `loadsb`, `loadub`, `alloc4`, `alloc8`, + `alloc16` - `ceqs`, `ceqd`, `cnes`, `cned`, `cles`, `cled`, `clts`, - `cltd`, `cges`, `cged`, `cgts`, `cgtd`, `cos`, `cod`, - `cuos`, `cuod` +<@ Comparisons >: + `ceqw`, `ceql`, `cnew`, `cnel`, `cslew`, `cslel`, `csltw`, + `csltl`, `csgew`, `csgel`, `csgtw`, `csgtl`, `culew`, + `culel`, `cultw`, `cultl`, `cugew`, `cugel`, `cugtw`, + `cugtl`, `ceqs`, `ceqd`, `cnes`, `cned`, `cles`, `cled`, + `clts`, `cltd`, `cges`, `cged`, `cgts`, `cgtd`, `cos`, + `cod`, `cuos`, `cuod` - * <@ Conversions > +<@ Conversions >: + `extsw`, `extsh`, `extsb`, `exts`, `extuw`, `extuh`, + `extub`, `truncd`, `stosi`, `dtosi`, `swtof`, `sltof` - `extsw`, `extsh`, `extsb`, `exts` - `extuw`, `extuh`, `extub`, `truncd` - `stosi`, `dtosi`, `swtof`, `sltof` +<@ Cast >: + `cast` - * <@ Cast > +<@ Call >: + `call` - `cast` +<@ Phi >: + `phi` +<@ Jumps >: + `jmp`, `jnz`, `ret` From 7e1c1f9f779aa4d55c3cbc9e16a9f8f2884dd3fe Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 6 Feb 2017 14:36:27 -0500 Subject: [PATCH 048/286] use uint for block ids --- alias.c | 2 +- all.h | 8 ++++---- cfg.c | 21 ++++++++++----------- fold.c | 18 +++++++++--------- load.c | 6 +++--- main.c | 2 +- rega.c | 6 +++--- ssa.c | 3 ++- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/alias.c b/alias.c index 3d1d00c..56178ca 100644 --- a/alias.c +++ b/alias.c @@ -101,7 +101,7 @@ esc(Ref r, Fn *fn) void fillalias(Fn *fn) { - int n; + uint n; Blk *b; Phi *p; Ins *i; diff --git a/all.h b/all.h index 7243e09..cc94161 100644 --- a/all.h +++ b/all.h @@ -333,13 +333,13 @@ struct Blk { Blk *s2; Blk *link; - int id; - int visit; + uint id; + uint visit; Blk *idom; Blk *dom, *dlink; Blk **fron; - int nfron; + uint nfron; Blk **pred; uint npred; @@ -432,7 +432,7 @@ struct Fn { int ntmp; int ncon; int nmem; - int nblk; + uint nblk; int retty; /* index in typ[], -1 if no aggregate return */ Ref retr; Blk **rpo; diff --git a/cfg.c b/cfg.c index 583629b..3b0c5bb 100644 --- a/cfg.c +++ b/cfg.c @@ -76,11 +76,11 @@ fillpreds(Fn *f) } static int -rporec(Blk *b, int x) +rporec(Blk *b, uint x) { Blk *s1, *s2; - if (!b || b->id >= 0) + if (!b || b->id != -1u) return x; b->id = 1; s1 = b->s1; @@ -100,16 +100,16 @@ rporec(Blk *b, int x) void fillrpo(Fn *f) { - int n; + uint n; Blk *b, **p; for (b=f->start; b; b=b->link) - b->id = -1; + b->id = -1u; n = 1 + rporec(f->start, f->nblk-1); f->nblk -= n; f->rpo = alloc(f->nblk * sizeof f->rpo[0]); for (p=&f->start; (b=*p);) { - if (b->id == -1) { + if (b->id == -1u) { blkdel(b); *p = b->link; } else { @@ -150,8 +150,8 @@ void filldom(Fn *fn) { Blk *b, *d; - int ch, n; - uint p; + int ch; + uint n, p; for (b=fn->start; b; b=b->link) { b->idom = 0; @@ -201,7 +201,7 @@ dom(Blk *b1, Blk *b2) static void addfron(Blk *a, Blk *b) { - int n; + uint n; for (n=0; nnfron; n++) if (a->fron[n] == b) @@ -245,12 +245,11 @@ loopmark(Blk *hd, Blk *b, void f(Blk *, Blk *)) void loopiter(Fn *fn, void f(Blk *, Blk *)) { - int n; - uint p; + uint n, p; Blk *b; for (b=fn->start; b; b=b->link) - b->visit = -1; + b->visit = -1u; for (n=0; nnblk; ++n) { b = fn->rpo[n]; for (p=0; pnpred; ++p) diff --git a/fold.c b/fold.c index 110a23c..c8d490c 100644 --- a/fold.c +++ b/fold.c @@ -188,15 +188,15 @@ fold(Fn *fn) Blk *b, **pb; Phi *p, **pp; Ins *i; - int n, d; - uint a; + int t, d; + uint n, a; val = emalloc(fn->ntmp * sizeof val[0]); edge = emalloc(fn->nblk * sizeof edge[0]); usewrk = vnew(0, sizeof usewrk[0], Pheap); - for (n=0; nntmp; n++) - val[n] = Top; + for (t=0; tntmp; t++) + val[t] = Top; for (n=0; nnblk; n++) { b = fn->rpo[n]; b->visit = 0; @@ -256,14 +256,14 @@ fold(Fn *fn) if (debug['F']) { fprintf(stderr, "\n> SCCP findings:"); - for (n=Tmp0; nntmp; n++) { - if (val[n] == Bot) + for (t=Tmp0; tntmp; t++) { + if (val[t] == Bot) continue; - fprintf(stderr, "\n%10s: ", fn->tmp[n].name); - if (val[n] == Top) + fprintf(stderr, "\n%10s: ", fn->tmp[t].name); + if (val[t] == Top) fprintf(stderr, "Top"); else - printref(CON(val[n]), fn, stderr); + printref(CON(val[t]), fn, stderr); } fprintf(stderr, "\n dead code: "); } diff --git a/load.c b/load.c index be6b53d..ca7d492 100644 --- a/load.c +++ b/load.c @@ -26,7 +26,7 @@ struct Slice { struct Insert { uint isphi:1; uint num:31; - int bid; + uint bid; uint off; union { Ins ins; @@ -329,8 +329,8 @@ loadopt(Fn *fn) { Ins *i, *ib; Blk *b; - int n, sz; - uint ni, ext, nt; + int sz; + uint n, ni, ext, nt; Insert *ist; Slice sl; Loc l; diff --git a/main.c b/main.c index fd0b6e4..b60ded6 100644 --- a/main.c +++ b/main.c @@ -39,7 +39,7 @@ data(Dat *d) static void func(Fn *fn) { - int n; + uint n; if (dbg) fprintf(stderr, "**** Function %s ****", fn->name); diff --git a/rega.c b/rega.c index da4e9e5..fae7538 100644 --- a/rega.c +++ b/rega.c @@ -423,12 +423,12 @@ doblk(Blk *b, RMap *cur) void rega(Fn *fn) { - int j, t, n, r, r1, x, rl[Tmp0]; + int j, t, r, r1, x, rl[Tmp0]; Blk *b, *b1, *s, ***ps, *blist; RMap *end, *beg, cur, old; Ins *i; Phi *p; - uint u; + uint u, n; Ref src, dst; /* 1. setup */ @@ -455,7 +455,7 @@ rega(Fn *fn) } /* 2. assign registers following post-order */ - for (n=fn->nblk-1; n>=0; n--) { + for (n=fn->nblk-1; n!=-1u; n--) { b = fn->rpo[n]; cur.n = 0; bszero(cur.b); diff --git a/ssa.c b/ssa.c index c0c340c..8a28eeb 100644 --- a/ssa.c +++ b/ssa.c @@ -101,7 +101,8 @@ phiins(Fn *fn) Ins *i; Phi *p; Ref r; - int t, n, nt; + int t, nt; + uint n; short k; bsinit(u, fn->nblk); From 1a76fd11f501d0bf762e01661d8a67c18c3e01bd Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 6 Feb 2017 14:37:43 -0500 Subject: [PATCH 049/286] robustness fix in fillfron() This makes it possible to call it several times in a row. --- cfg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cfg.c b/cfg.c index 3b0c5bb..5385811 100644 --- a/cfg.c +++ b/cfg.c @@ -219,6 +219,8 @@ fillfron(Fn *fn) { Blk *a, *b; + for (b=fn->start; b; b=b->link) + b->nfron = 0; for (b=fn->start; b; b=b->link) { if (b->s1) for (a=b; !sdom(a, b->s1); a=a->idom) From 8215b50a10e240581bd1f9e8ae4d13c48f865c6c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 6 Feb 2017 14:38:47 -0500 Subject: [PATCH 050/286] fix edge deletion bug in sccp When an edge is deleted, the phis and predecessors of the destination block have to be updated. This is what blkdel() was doing, but at a level too coarse. The new function edgedel() allows to remove a single edge (and takes care of multiple edges). --- all.h | 2 +- cfg.c | 48 +++++++++++++++++++++++++----------------------- fold.c | 12 ++++++++---- 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/all.h b/all.h index cc94161..a40627c 100644 --- a/all.h +++ b/all.h @@ -547,7 +547,7 @@ void err(char *, ...) __attribute__((noreturn)); /* cfg.c */ Blk *blknew(void); -void blkdel(Blk *); +void edgedel(Blk *, Blk **); void fillpreds(Fn *); void fillrpo(Fn *); void filldom(Fn *); diff --git a/cfg.c b/cfg.c index 5385811..8c6278f 100644 --- a/cfg.c +++ b/cfg.c @@ -12,32 +12,33 @@ blknew() } void -blkdel(Blk *b) +edgedel(Blk *bs, Blk **pbd) { - Blk *s, **ps, *succ[3]; + Blk *bd; Phi *p; uint a; + int mult; - succ[0] = b->s1; - succ[1] = b->s2 == b->s1 ? 0 : b->s2; - succ[2] = 0; - for (ps=succ; (s=*ps); ps++) { - for (p=s->phi; p; p=p->link) { - for (a=0; p->blk[a]!=b; a++) - assert(a+1narg); - p->narg--; - memmove(&p->blk[a], &p->blk[a+1], - sizeof p->blk[0] * (p->narg-a)); - memmove(&p->arg[a], &p->arg[a+1], - sizeof p->arg[0] * (p->narg-a)); - } - if (s->npred != 0) { - for (a=0; s->pred[a]!=b; a++) - assert(a+1npred); - s->npred--; - memmove(&s->pred[a], &s->pred[a+1], - sizeof s->pred[0] * (s->npred-a)); - } + bd = *pbd; + mult = 1 + (bs->s1 == bs->s2); + *pbd = 0; + if (!bd || mult > 1) + return; + for (p=bd->phi; p; p=p->link) { + for (a=0; p->blk[a]!=bs; a++) + assert(a+1narg); + p->narg--; + memmove(&p->blk[a], &p->blk[a+1], + sizeof p->blk[0] * (p->narg-a)); + memmove(&p->arg[a], &p->arg[a+1], + sizeof p->arg[0] * (p->narg-a)); + } + if (bd->npred != 0) { + for (a=0; bd->pred[a]!=bs; a++) + assert(a+1npred); + bd->npred--; + memmove(&bd->pred[a], &bd->pred[a+1], + sizeof bd->pred[0] * (bd->npred-a)); } } @@ -110,7 +111,8 @@ fillrpo(Fn *f) f->rpo = alloc(f->nblk * sizeof f->rpo[0]); for (p=&f->start; (b=*p);) { if (b->id == -1u) { - blkdel(b); + edgedel(b, &b->s1); + edgedel(b, &b->s2); *p = b->link; } else { b->id -= n; diff --git a/fold.c b/fold.c index c8d490c..0cbd6fa 100644 --- a/fold.c +++ b/fold.c @@ -275,7 +275,8 @@ fold(Fn *fn) d = 1; if (debug['F']) fprintf(stderr, "%s ", b->name); - blkdel(b); + edgedel(b, &b->s1); + edgedel(b, &b->s2); *pb = b->link; continue; } @@ -296,11 +297,14 @@ fold(Fn *fn) renref(&i->arg[n]); renref(&b->jmp.arg); if (b->jmp.type == Jjnz && rtype(b->jmp.arg) == RCon) { - b->jmp.type = Jjmp; - if (czero(&fn->con[b->jmp.arg.val], 0)) + if (czero(&fn->con[b->jmp.arg.val], 0)) { + edgedel(b, &b->s1); b->s1 = b->s2; + b->s2 = 0; + } else + edgedel(b, &b->s2); + b->jmp.type = Jjmp; b->jmp.arg = R; - b->s2 = 0; } pb = &b->link; } From c71f44c5a86f41e65179633160edeb90a9543987 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 7 Feb 2017 21:56:00 -0500 Subject: [PATCH 051/286] update assert() missed in 7e1c1f --- cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cfg.c b/cfg.c index 8c6278f..e210589 100644 --- a/cfg.c +++ b/cfg.c @@ -93,7 +93,7 @@ rporec(Blk *b, uint x) x = rporec(s1, x); x = rporec(s2, x); b->id = x; - assert(x >= 0); + assert(x != -1u); return x - 1; } From 8799dc30ac472545bc93957c22f070590ff44cb3 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 7 Feb 2017 22:49:17 -0500 Subject: [PATCH 052/286] make rsp and rbp globally live --- all.h | 31 +++++++++++++++++-------------- isel.c | 3 ++- live.c | 3 ++- rega.c | 20 ++++++++------------ spill.c | 20 +++++++++++--------- 5 files changed, 40 insertions(+), 37 deletions(-) diff --git a/all.h b/all.h index a40627c..1ccf053 100644 --- a/all.h +++ b/all.h @@ -29,6 +29,18 @@ typedef struct Typ Typ; typedef struct Seg Seg; typedef struct Dat Dat; +enum { + NString = 32, + NPred = 63, + NIns = 8192, + NAlign = 3, + NSeg = 32, + NTyp = 128, + NBit = CHAR_BIT * sizeof(bits), +}; + +#define BIT(n) ((bits)1 << (n)) + enum Reg { RXX, @@ -48,8 +60,9 @@ enum Reg { R14, R15, - RBP, /* reserved */ + RBP, /* globally live */ RSP, +#define RGLOB (BIT(RBP)|BIT(RSP)) XMM0, /* sse */ XMM1, @@ -70,7 +83,8 @@ enum Reg { Tmp0, /* first non-reg temporary */ - NIReg = R15 - RAX + 1, + NRGlob = 2, + NIReg = R15 - RAX + 1 + NRGlob, NFReg = XMM14 - XMM0 + 1, /* XMM15 is reserved */ NISave = R11 - RAX + 1, NFSave = NFReg, @@ -78,19 +92,8 @@ enum Reg { NRClob = R15 - RBX + 1, }; -enum { - NString = 32, - NPred = 63, - NIns = 8192, - NAlign = 3, - NSeg = 32, - NTyp = 128, - NBit = CHAR_BIT * sizeof(bits), -}; - MAKESURE(NBit_is_enough, NBit >= (int)Tmp0); -#define BIT(n) ((bits)1 << (n)) struct BSet { uint nt; @@ -388,7 +391,7 @@ struct Tmp { Use *use; uint ndef, nuse; uint cost; - short slot; + short slot; /* -1 for unset */ short cls; struct { int r; diff --git a/isel.c b/isel.c index 0c92dcd..8b4b823 100644 --- a/isel.c +++ b/isel.c @@ -149,7 +149,8 @@ fixarg(Ref *r, int k, int phi, Fn *fn) */ r1 = newtmp("isel", Kl, fn); emit(Oaddr, Kl, r1, SLOT(s), R); - } else if (rtype(r0) == RMem) { + } + else if (rtype(r0) == RMem) { /* apple asm fix */ m = &fn->mem[r0.val]; if (req(m->base, R)) { diff --git a/live.c b/live.c index be5ec8c..18c9b63 100644 --- a/live.c +++ b/live.c @@ -104,13 +104,14 @@ filllive(Fn *f) memset(phi, 0, f->ntmp * sizeof phi[0]); memset(nlv, 0, sizeof nlv); + b->out->t[0] |= RGLOB; bscopy(b->in, b->out); for (t=0; bsiter(b->in, &t); t++) { phifix(t, phi, f->tmp); nlv[KBASE(f->tmp[t].cls)]++; } if (rtype(b->jmp.arg) == RCall) { - assert(bscount(b->in) == 0 && nlv[0] == 0 && nlv[1] == 0); + assert(bscount(b->in) == NRGlob && nlv[0] == NRGlob && nlv[1] == 0); b->in->t[0] |= retregs(b->jmp.arg, nlv); } else bset(b->jmp.arg, b, nlv, phi, f->tmp); diff --git a/rega.c b/rega.c index fae7538..9f02a63 100644 --- a/rega.c +++ b/rega.c @@ -154,9 +154,10 @@ mdump(RMap *m) int i; for (i=0; in; i++) - fprintf(stderr, " (%s, R%d)", - tmp[m->t[i]].name, - m->r[i]); + if (m->t[i] >= Tmp0) + fprintf(stderr, " (%s, R%d)", + tmp[m->t[i]].name, + m->r[i]); fprintf(stderr, "\n"); } @@ -360,15 +361,10 @@ doblk(Blk *b, RMap *cur) Mem *m; Ref *ra[4]; + for (r=0; bsiter(b->out, &r) && rjmp.arg) == RTmp) b->jmp.arg = ralloc(cur, b->jmp.arg.val); - else if (rtype(b->jmp.arg) == RCall) { - /* add return registers */ - rs = retregs(b->jmp.arg, 0); - for (r=0; rs; rs/=2, r++) - if (rs & 1) - radd(cur, r, r); - } for (i=&b->ins[b->nins]; i!=b->ins;) { switch ((--i)->op) { case Ocall: @@ -444,8 +440,8 @@ rega(Fn *fn) bsinit(cur.b, fn->ntmp); bsinit(old.b, fn->ntmp); - for (t=Tmp0; tntmp; t++) - *hint(t) = -1; + for (t=0; tntmp; t++) + *hint(t) = t < Tmp0 ? t : -1; for (b=fn->start, i=b->ins; i-b->ins < b->nins; i++) if (i->op != Ocopy || !isreg(i->arg[0])) break; diff --git a/spill.c b/spill.c index 5d1726e..5e2b9ec 100644 --- a/spill.c +++ b/spill.c @@ -62,7 +62,7 @@ fillcost(Fn *fn) } } for (t=fn->tmp; t-fn->tmp < fn->ntmp; t++) { - t->cost = t-fn->tmp < Tmp0 ? 1e6 : 0; + t->cost = t-fn->tmp < Tmp0 ? UINT_MAX : 0; t->nuse = 0; t->ndef = 0; } @@ -107,7 +107,11 @@ static BSet mask[2][1]; /* class masks */ static int tcmp0(const void *pa, const void *pb) { - return tmp[*(int *)pb].cost - tmp[*(int *)pa].cost; + uint ca, cb; + + ca = tmp[*(int *)pa].cost; + cb = tmp[*(int *)pb].cost; + return (cb < ca) ? -1 : (cb > ca); } static int @@ -337,9 +341,10 @@ spill(Fn *fn) if (!hd || s2->id >= hd->id) hd = s2; r = 0; - bszero(v); if (hd) { /* back-edge */ + bszero(v); + hd->gen->t[0] |= RGLOB; /* don't spill registers */ for (k=0; k<2; k++) { n = k == 0 ? NIReg : NFReg; bscopy(u, b->out); @@ -365,11 +370,8 @@ spill(Fn *fn) bsunion(v, u); } limit2(v, 0, 0, w); - } else if (rtype(b->jmp.arg) == RCall) { - /* return */ - r = retregs(b->jmp.arg, 0); - v->t[0] |= r; - } + } else + bscopy(v, b->out); for (t=Tmp0; bsiter(b->out, &t); t++) if (!bshas(v, t)) slot(t); @@ -447,7 +449,7 @@ spill(Fn *fn) if (r) sethint(v, r); } - assert(!r || b==fn->start); + assert(!(r & ~RGLOB) || b==fn->start); for (p=b->phi; p; p=p->link) { assert(rtype(p->to) == RTmp); From b99a8b0d07d43b89d5e27883ee5a9a67c2645809 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 7 Feb 2017 23:01:24 -0500 Subject: [PATCH 053/286] support variable argument lists This change is backward compatible, calls to "variadic" functions (like printf) must now be annotated (with ...). --- all.h | 5 ++ emit.c | 22 +++-- main.c | 1 + parse.c | 35 +++++--- sysv.c | 219 +++++++++++++++++++++++++++++++++++++++++++++----- test/abi5.ssa | 18 ++--- test/echo.ssa | 2 +- tools/lexh.c | 1 + 8 files changed, 256 insertions(+), 47 deletions(-) diff --git a/all.h b/all.h index 1ccf053..d13ef5c 100644 --- a/all.h +++ b/all.h @@ -256,6 +256,9 @@ enum Op { Oalloc, Oalloc1 = Oalloc + NAlign-1, + Ovastart, + Ovaarg, + Ocopy, NPubOp, @@ -265,6 +268,7 @@ enum Op { Oarg, Oargc, Ocall, + Ovacall, /* reserved instructions */ Onop, @@ -442,6 +446,7 @@ struct Fn { bits reg; int slot; char export; + char vararg; char name[NString]; }; diff --git a/emit.c b/emit.c index 2c0b3cc..ccbd516 100644 --- a/emit.c +++ b/emit.c @@ -137,13 +137,14 @@ slot(int s, Fn *fn) /* sign extend s using a bitfield */ x.i = s; + assert(x.i <= fn->slot); /* specific to NAlign == 3 */ if (x.i < 0) return -4 * x.i; - else { - assert(fn->slot >= x.i); + else if (fn->vararg) + return -176 + -4 * (fn->slot - x.i); + else return -4 * (fn->slot - x.i); - } } static void @@ -481,7 +482,7 @@ framesz(Fn *fn) o ^= 1 & (fn->reg >> rclob[i]); f = fn->slot; f = (f + 3) & -4; - return 4*f + 8*o; + return 4*f + 8*o + 176*fn->vararg; } void @@ -504,20 +505,27 @@ emitfn(Fn *fn, FILE *f) static int id0; Blk *b, *s; Ins *i, itmp; - int *r, c, fs; + int *r, c, fs, o, n; fprintf(f, ".text\n"); if (fn->export) fprintf(f, ".globl %s%s\n", symprefix, fn->name); fprintf(f, "%s%s:\n" - "\tpush %%rbp\n" - "\tmov %%rsp, %%rbp\n", + "\tpushq %%rbp\n" + "\tmovq %%rsp, %%rbp\n", symprefix, fn->name ); fs = framesz(fn); if (fs) fprintf(f, "\tsub $%d, %%rsp\n", fs); + if (fn->vararg) { + o = -176; + for (r=rsave; r-rsave<6; ++r, o+=8) + fprintf(f, "\tmovq %%%s, %d(%%rbp)\n", rname[*r][0], o); + for (n=0; n<8; ++n, o+=16) + fprintf(f, "\tmovaps %%xmm%d, %d(%%rbp)\n", n, o); + } for (r=rclob; r-rclob < NRClob; r++) if (fn->reg & BIT(*r)) { itmp.arg[0] = TMP(*r); diff --git a/main.c b/main.c index b60ded6..f93af37 100644 --- a/main.c +++ b/main.c @@ -63,6 +63,7 @@ func(Fn *fn) filluse(fn); fold(fn); abi(fn); + fillpreds(fn); filluse(fn); isel(fn); fillrpo(fn); diff --git a/parse.c b/parse.c index f8fd705..913fc07 100644 --- a/parse.c +++ b/parse.c @@ -65,11 +65,14 @@ OpDesc opdesc[NOp] = { [Oarg] = { "arg", 0, {A(w,l,s,d), A(x,x,x,x)}, 0, 0, 0 }, [Oargc] = { "argc", 0, {A(e,x,e,e), A(e,l,e,e)}, 0, 0, 0 }, [Ocall] = { "call", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, + [Ovacall] = { "vacall", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, [Oxsetnp] = { "xsetnp", 0, {A(x,x,e,e), A(x,x,e,e)}, 0, 0, 0 }, [Oxsetp] = { "xsetp", 0, {A(x,x,e,e), A(x,x,e,e)}, 0, 0, 0 }, [Oalloc] = { "alloc4", 1, {A(e,l,e,e), A(e,x,e,e)}, 0, 0, 0 }, [Oalloc+1] = { "alloc8", 1, {A(e,l,e,e), A(e,x,e,e)}, 0, 0, 0 }, [Oalloc+2] = { "alloc16", 1, {A(e,l,e,e), A(e,x,e,e)}, 0, 0, 0 }, + [Ovaarg] = { "vaarg", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, + [Ovastart] = { "vastart", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, #define X(c) \ [Ocmpw+IC##c] = { "c" #c "w", 0, {A(w,w,e,e), A(w,w,e,e)}, 1, 0, 1 }, \ [Ocmpl+IC##c] = { "c" #c "l", 0, {A(l,l,e,e), A(l,l,e,e)}, 1, 0, 1 }, \ @@ -139,6 +142,7 @@ enum { Tlbrace, Trbrace, Tnl, + Tdots, Teof, Ntok @@ -168,13 +172,14 @@ static char *kwmap[Ntok] = { [Td] = "d", [Ts] = "s", [Tz] = "z", + [Tdots] = "...", }; enum { BMask = 8191, /* for blocks hash */ - K = 2047061843, /* found using tools/lexh.c */ - M = 24, + K = 3233235, /* found using tools/lexh.c */ + M = 23, }; static char lexh[1 << (32-M)]; @@ -326,7 +331,7 @@ lex() if (0) Alpha: c = fgetc(inf); if (!isalpha(c) && c != '.' && c != '_') - err("lexing failure: invalid character %c (%d)", c, c); + err("invalid character %c (%d)", c, c); i = 0; do { if (i >= NString-1) @@ -485,14 +490,14 @@ parsecls(int *tyn) } } -static void +static int parserefl(int arg) { int k, ty; Ref r; expect(Tlparen); - while (peek() != Trparen) { + while (peek() != Trparen && peek() != Tdots) { if (curi - insb >= NIns) err("too many instructions (1)"); k = parsecls(&ty); @@ -516,7 +521,11 @@ parserefl(int arg) break; expect(Tcomma); } - next(); + if (next() == Tdots) { + expect(Trparen); + return 1; + } + return 0; } static Blk * @@ -561,7 +570,9 @@ parseline(PState ps) err("label or } expected"); switch (t) { default: - if (isstore(t) || t == Tcall) { + if (isstore(t)) { + case Tcall: + case Ovastart: /* operations without result */ r = R; k = Kw; @@ -639,9 +650,11 @@ parseline(PState ps) } if (op == Tcall) { arg[0] = parseref(); - parserefl(1); + if (parserefl(1)) + op = Ovacall; + else + op = Ocall; expect(Tnl); - op = Ocall; if (k == 4) { k = Kl; arg[1] = TYPE(ty); @@ -825,7 +838,7 @@ parsefn(int export) if (next() != Tglo) err("function name expected"); strcpy(curf->name, tokval.str); - parserefl(0); + curf->vararg = parserefl(0); if (nextnl() != Tlbrace) err("function body must start with {"); ps = PLbl; @@ -1142,7 +1155,7 @@ printref(Ref r, Fn *fn, FILE *f) fprintf(f, "S%d", (r.val&(1<<28)) ? r.val-(1<<29) : r.val); break; case RCall: - fprintf(f, "%03x", r.val); + fprintf(f, "%04x", r.val); break; case RType: fprintf(f, ":%s", typ[r.val].name); diff --git a/sysv.c b/sysv.c index b05510c..f4b167b 100644 --- a/sysv.c +++ b/sysv.c @@ -228,6 +228,17 @@ int rclob[] = {RBX, R12, R13, R14, R15}; MAKESURE(rsave_has_correct_size, sizeof rsave == NRSave * sizeof(int)); MAKESURE(rclob_has_correct_size, sizeof rclob == NRClob * sizeof(int)); +/* layout of call's second argument (RCall) + * + * 29 12 8 4 3 0 + * |0...00|x|xxxx|xxxx|xx|xx| range + * | | | | ` gp regs returned (0..2) + * | | | ` sse regs returned (0..2) + * | | ` gp regs passed (0..6) + * | ` sse regs passed (0..8) + * ` 1 if calling a vararg function (0..1) + */ + bits retregs(Ref r, int p[2]) { @@ -257,21 +268,22 @@ bits argregs(Ref r, int p[2]) { bits b; - int j, ni, nf; + int j, ni, nf, va; assert(rtype(r) == RCall); b = 0; ni = (r.val >> 4) & 15; nf = (r.val >> 8) & 15; + va = (r.val >> 12) & 1; for (j=0; jop == Ovacall; + ca |= va << 12; emit(Ocall, i1->cls, R, i1->arg[0], CALL(ca)); - emit(Ocopy, Kw, TMP(RAX), getcon((ca >> 8) & 15, fn), R); + if (va) + emit(Ocopy, Kw, TMP(RAX), getcon((ca >> 8) & 15, fn), R); ni = ns = 0; if (ra && aret.inmem) @@ -397,12 +412,12 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) emit(Osalloc, Kl, r, getcon(stk, fn), R); } -static void +static int selpar(Fn *fn, Ins *i0, Ins *i1) { AClass *ac, *a, aret; Ins *i; - int ni, ns, s, al; + int ni, ns, s, al, fa; Ref r; ac = alloc((i1-i0) * sizeof ac[0]); @@ -411,9 +426,9 @@ selpar(Fn *fn, Ins *i0, Ins *i1) if (fn->retty >= 0) { typclass(&aret, &typ[fn->retty]); - argsclass(i0, i1, ac, Opar, &aret); + fa = argsclass(i0, i1, ac, Opar, &aret); } else - argsclass(i0, i1, ac, Opar, 0); + fa = argsclass(i0, i1, ac, Opar, 0); for (i=i0, a=ac; iop != Oparc || a->inmem) @@ -462,6 +477,156 @@ selpar(Fn *fn, Ins *i0, Ins *i1) } else emit(Ocopy, i->cls, i->to, r, R); } + + return fa | (s*4)<<12; +} + +static Blk * +split(Fn *fn, Blk *b) +{ + Blk *bn; + + ++fn->nblk; + bn = blknew(); + bn->nins = &insb[NIns] - curi; + idup(&bn->ins, curi, bn->nins); + curi = &insb[NIns]; + bn->visit = ++b->visit; + snprintf(bn->name, NString, "%s.%d", b->name, b->visit); + bn->loop = b->loop; + bn->link = b->link; + b->link = bn; + return bn; +} + +static void +chpred(Blk *b, Blk *bp, Blk *bp1) +{ + Phi *p; + uint a; + + for (p=b->phi; p; p=p->link) { + for (a=0; p->blk[a]!=bp; a++) + assert(a+1narg); + p->blk[a] = bp1; + } +} + +void +selvaarg(Fn *fn, Blk *b, Ins *i) +{ + Ref loc, lreg, lstk, nr, r0, r1, c4, c8, c16, c, ap; + Blk *b0, *bstk, *breg; + int isint; + + c4 = getcon(4, fn); + c8 = getcon(8, fn); + c16 = getcon(16, fn); + ap = i->arg[0]; + isint = KBASE(i->cls) == 0; + + /* @b [...] + r0 =l add ap, (0 or 4) + nr =l loadsw r0 + r1 =w cultw nr, (48 or 176) + jnz r1, @breg, @bstk + @breg + r0 =l add ap, 16 + r1 =l loadl r0 + lreg =l add r1, nr + r0 =w add nr, (8 or 16) + r1 =l add ap, (0 or 4) + storew r0, r1 + @bstk + r0 =l add ap, 8 + lstk =l loadl r0 + r1 =l add lstk, 8 + storel r1, r0 + @b0 + %loc =l phi @breg %lreg, @bstk %lstk + i->to =(i->cls) load %loc + */ + + loc = newtmp("abi", Kl, fn); + emit(Oload, i->cls, i->to, loc, R); + b0 = split(fn, b); + b0->jmp = b->jmp; + b0->s1 = b->s1; + b0->s2 = b->s2; + if (b->s1) + chpred(b->s1, b, b0); + if (b->s2 && b->s2 != b->s1) + chpred(b->s2, b, b0); + + lreg = newtmp("abi", Kl, fn); + nr = newtmp("abi", Kl, fn); + r0 = newtmp("abi", Kw, fn); + r1 = newtmp("abi", Kl, fn); + emit(Ostorew, Kw, R, r0, r1); + emit(Oadd, Kl, r1, ap, isint ? CON_Z : c4); + emit(Oadd, Kw, r0, nr, isint ? c8 : c16); + r0 = newtmp("abi", Kl, fn); + r1 = newtmp("abi", Kl, fn); + emit(Oadd, Kl, lreg, r1, nr); + emit(Oload, Kl, r1, r0, R); + emit(Oadd, Kl, r0, ap, c16); + breg = split(fn, b); + breg->jmp.type = Jjmp; + breg->s1 = b0; + + lstk = newtmp("abi", Kl, fn); + r0 = newtmp("abi", Kl, fn); + r1 = newtmp("abi", Kl, fn); + emit(Ostorel, Kw, R, r1, r0); + emit(Oadd, Kl, r1, lstk, c8); + emit(Oload, Kl, lstk, r0, R); + emit(Oadd, Kl, r0, ap, c8); + bstk = split(fn, b); + bstk->jmp.type = Jjmp; + bstk->s1 = b0; + + b0->phi = alloc(sizeof *b0->phi); + *b0->phi = (Phi){ + .cls = Kl, .to = loc, + .narg = 2, + .blk = {bstk, breg}, + .arg = {lstk, lreg}, + }; + r0 = newtmp("abi", Kl, fn); + r1 = newtmp("abi", Kw, fn); + b->jmp.type = Jjnz; + b->jmp.arg = r1; + b->s1 = breg; + b->s2 = bstk; + c = getcon(isint ? 48 : 176, fn); + emit(Ocmpw+ICult, Kw, r1, nr, c); + emit(Oloadsw, Kl, nr, r0, R); + emit(Oadd, Kl, r0, ap, isint ? CON_Z : c4); +} + +void +selvastart(Fn *fn, int fa, Ref ap) +{ + Ref r0, r1; + int gp, fp, sp; + + gp = ((fa >> 4) & 15) * 8; + fp = 48 + ((fa >> 8) & 15) * 16; + sp = fa >> 12; + r0 = newtmp("abi", Kl, fn); + r1 = newtmp("abi", Kl, fn); + emit(Ostorel, Kw, R, r1, r0); + emit(Oadd, Kl, r1, TMP(RBP), getcon(-176, fn)); + emit(Oadd, Kl, r0, ap, getcon(16, fn)); + r0 = newtmp("abi", Kl, fn); + r1 = newtmp("abi", Kl, fn); + emit(Ostorel, Kw, R, r1, r0); + emit(Oadd, Kl, r1, TMP(RBP), getcon(sp, fn)); + emit(Oadd, Kl, r0, ap, getcon(8, fn)); + r0 = newtmp("abi", Kl, fn); + emit(Ostorew, Kw, R, getcon(fp, fn), r0); + emit(Oadd, Kl, r0, ap, getcon(4, fn)); + emit(Ostorew, Kw, R, getcon(gp, fn), ap); } void @@ -470,13 +635,16 @@ abi(Fn *fn) Blk *b; Ins *i, *i0, *ip; RAlloc *ral; - int n; + int n, fa; + + for (b=fn->start; b; b=b->link) + b->visit = 0; - /* lower arguments */ + /* lower parameters */ for (b=fn->start, i=b->ins; i-b->ins < b->nins; i++) if (i->op != Opar && i->op != Oparc) break; - selpar(fn, b->ins, i); + fa = selpar(fn, b->ins, i); n = b->nins - (i - b->ins) + (&insb[NIns] - curi); i0 = alloc(n * sizeof(Ins)); ip = icpy(ip = i0, curi, &insb[NIns] - curi); @@ -484,27 +652,40 @@ abi(Fn *fn) b->nins = n; b->ins = i0; - /* lower calls and returns */ + /* lower calls, returns, and vararg instructions */ ral = 0; b = fn->start; do { if (!(b = b->link)) b = fn->start; /* do it last */ + if (b->visit) + continue; curi = &insb[NIns]; selret(b, fn); - for (i=&b->ins[b->nins]; i!=b->ins;) { - if ((--i)->op == Ocall) { + for (i=&b->ins[b->nins]; i!=b->ins;) + switch ((--i)->op) { + default: + emiti(*i); + break; + case Ocall: + case Ovacall: for (i0=i; i0>b->ins; i0--) if ((i0-1)->op != Oarg) if ((i0-1)->op != Oargc) break; selcall(fn, i0, i, &ral); i = i0; - continue; + break; + case Ovastart: + selvastart(fn, fa, i->arg[0]); + break; + case Ovaarg: + selvaarg(fn, b, i); + break; + case Oarg: + case Oargc: + die("unreachable"); } - assert(i->op != Oarg && i->op != Oargc); - emiti(*i); - } if (b == fn->start) for (; ral; ral=ral->link) emiti(ral->i); diff --git a/test/abi5.ssa b/test/abi5.ssa index c3d9046..edfda4e 100644 --- a/test/abi5.ssa +++ b/test/abi5.ssa @@ -25,41 +25,41 @@ export function $test() { @start %r1 =:st1 call $t1() - %i1 =w call $printf(l $fmt1, l %r1) + %i1 =w call $printf(l $fmt1, l %r1, ...) %r2 =:st2 call $t2() %w2 =w loadw %r2 - %i2 =w call $printf(l $fmt2, w %w2) + %i2 =w call $printf(l $fmt2, w %w2, ...) %r3 =:st3 call $t3() %s3 =s loads %r3 %r34 =l add %r3, 4 %w3 =w loadw %r34 %p3 =d exts %s3 - %i3 =w call $printf(l $fmt3, d %p3, w %w3) + %i3 =w call $printf(l $fmt3, d %p3, w %w3, ...) %r4 =:st4 call $t4() %w4 =w loadw %r4 %r48 =l add 8, %r4 %d4 =d loadd %r48 - %i4 =w call $printf(l $fmt4, w %w4, d %d4) + %i4 =w call $printf(l $fmt4, w %w4, d %d4, ...) %r5 =:st5 call $t5() %s5 =s loads %r5 %d5 =d exts %s5 %r58 =l add %r5, 8 %l5 =l loadl %r58 - %i5 =w call $printf(l $fmt5, d %d5, l %l5) + %i5 =w call $printf(l $fmt5, d %d5, l %l5, ...) %r6 =:st6 call $t6() - %i6 =w call $printf(l $fmt6, l %r6) + %i6 =w call $printf(l $fmt6, l %r6, ...) %r7 =:st7 call $t7() %s7 =s loads %r7 %d71 =d exts %s7 %r78 =l add %r7, 8 %d72 =d loadd %r78 - %i7 =w call $printf(l $fmt7, d %d71, d %d72) + %i7 =w call $printf(l $fmt7, d %d71, d %d72, ...) %r8 =:st8 call $t8() %r84 =l add 4, %r8 @@ -69,14 +69,14 @@ function $test() { %w82 =w loadw %r84 %w83 =w loadw %r88 %w84 =w loadw %r812 - %i8 =w call $printf(l $fmt8, w %w81, w %w82, w %w83, w %w84) + %i8 =w call $printf(l $fmt8, w %w81, w %w82, w %w83, w %w84, ...) %r9 =:st9 call $t9() %r94 =l add 4, %r9 %w9 =w loadw %r9 %s9 =s loads %r94 %d9 =d exts %s9 - %i9 =w call $printf(l $fmt9, w %w9, d %d9) + %i9 =w call $printf(l $fmt9, w %w9, d %d9, ...) ret } diff --git a/test/echo.ssa b/test/echo.ssa index 6671a6a..6010986 100644 --- a/test/echo.ssa +++ b/test/echo.ssa @@ -20,7 +20,7 @@ function w $main(w %argc, l %argv) { @loop2 %sep =w phi @last 10, @nolast 32 %arg =l loadl %av - %r =w call $printf(l %fmt, l %arg, w %sep) + %r =w call $printf(l %fmt, l %arg, w %sep, ...) %av1 =l add %av, 8 %ac1 =w sub %ac, 1 jmp @loop diff --git a/tools/lexh.c b/tools/lexh.c index a4ca937..db27f8f 100644 --- a/tools/lexh.c +++ b/tools/lexh.c @@ -22,6 +22,7 @@ char *tok[] = { "ceql", "cnel", "cles", "clts", "cgts", "cges", "cnes", "ceqs", "cos", "cuos", "cled", "cltd", "cgtd", "cged", "cned", "ceqd", "cod", "cuod", + "vaarg", "vastart", "...", "call", "phi", "jmp", "jnz", "ret", "export", "function", "type", "data", "align", "l", "w", From d9f1121763c126316ab338ca8b1b9d51967a33b1 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 7 Feb 2017 23:04:37 -0500 Subject: [PATCH 054/286] tests for variable argument lists --- test/vararg1.ssa | 30 +++ test/vararg2.ssa | 596 +++++++++++++++++++++++++++++++++++++++++++++++ tools/vatest.py | 157 +++++++++++++ 3 files changed, 783 insertions(+) create mode 100644 test/vararg1.ssa create mode 100644 test/vararg2.ssa create mode 100644 tools/vatest.py diff --git a/test/vararg1.ssa b/test/vararg1.ssa new file mode 100644 index 0000000..28b3d0e --- /dev/null +++ b/test/vararg1.ssa @@ -0,0 +1,30 @@ +export +function d $f(l %x, ...) { +@start + %vp =l alloc8 24 + vastart %vp + %i =l vaarg %vp + %n =d vaarg %vp + ret %n +} + +export +function w $g(l %fmt, ...) { +@start + %vp =l alloc8 24 + vastart %vp + %r =w call $vprintf(l %fmt, l %vp) + ret %r +} + +# >>> driver +# extern double f(int, ...); +# extern int g(char *, ...); +# int main() { +# g("Hell%c %s %g!\n", 'o', "world", f(42, "x", 42.0)); +# } +# <<< + +# >>> output +# Hello world 42! +# <<< diff --git a/test/vararg2.ssa b/test/vararg2.ssa new file mode 100644 index 0000000..7f72acb --- /dev/null +++ b/test/vararg2.ssa @@ -0,0 +1,596 @@ +export function $qbeprint0(l %fmt, ...) { +@start + %fmtdbl =l alloc4 4 + %fmtint =l alloc4 4 + %emptys =l alloc4 4 + storew 2122789, %fmtint + storew 2123557, %fmtdbl + storew 0, %emptys + %vp =l alloc8 24 + %fmt1 =l add 1, %fmt + vastart %vp +@loop + %p =l phi @start %fmt1, @casef %p1, @cased %p1 + %c =w loadsb %p + %p1 =l add 3, %p + jnz %c, @loop1, @end +@loop1 + %isg =w ceqw %c, 103 + jnz %isg, @casef, @cased +@casef + %dbl =d vaarg %vp + call $printf(l %fmtdbl, d %dbl, ...) + jmp @loop +@cased + %int =w vaarg %vp + call $printf(l %fmtint, w %int, ...) + jmp @loop +@end + call $puts(l %emptys) + ret +} + +export function $qbecall0(l %fmt, ...) { +@start + %vp =l alloc8 24 + vastart %vp + call $vprintf(l %fmt, l %vp) + ret +} + +export function $qbeprint1(w %argw0, l %fmt, ...) { +@start + %fmtdbl =l alloc4 4 + %fmtint =l alloc4 4 + %emptys =l alloc4 4 + storew 2122789, %fmtint + storew 2123557, %fmtdbl + storew 0, %emptys + %vp =l alloc8 24 + %fmt1 =l add 1, %fmt + vastart %vp +@loop + %p =l phi @start %fmt1, @casef %p1, @cased %p1 + %c =w loadsb %p + %p1 =l add 3, %p + jnz %c, @loop1, @end +@loop1 + %isg =w ceqw %c, 103 + jnz %isg, @casef, @cased +@casef + %dbl =d vaarg %vp + call $printf(l %fmtdbl, d %dbl, ...) + jmp @loop +@cased + %int =w vaarg %vp + call $printf(l %fmtint, w %int, ...) + jmp @loop +@end + call $puts(l %emptys) + ret +} + +export function $qbecall1(w %argw0, l %fmt, ...) { +@start + %vp =l alloc8 24 + vastart %vp + call $vprintf(l %fmt, l %vp) + ret +} + +export function $qbeprint2(d %argd0, l %fmt, ...) { +@start + %fmtdbl =l alloc4 4 + %fmtint =l alloc4 4 + %emptys =l alloc4 4 + storew 2122789, %fmtint + storew 2123557, %fmtdbl + storew 0, %emptys + %vp =l alloc8 24 + %fmt1 =l add 1, %fmt + vastart %vp +@loop + %p =l phi @start %fmt1, @casef %p1, @cased %p1 + %c =w loadsb %p + %p1 =l add 3, %p + jnz %c, @loop1, @end +@loop1 + %isg =w ceqw %c, 103 + jnz %isg, @casef, @cased +@casef + %dbl =d vaarg %vp + call $printf(l %fmtdbl, d %dbl, ...) + jmp @loop +@cased + %int =w vaarg %vp + call $printf(l %fmtint, w %int, ...) + jmp @loop +@end + call $puts(l %emptys) + ret +} + +export function $qbecall2(d %argd0, l %fmt, ...) { +@start + %vp =l alloc8 24 + vastart %vp + call $vprintf(l %fmt, l %vp) + ret +} + +export function $qbeprint3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) { +@start + %fmtdbl =l alloc4 4 + %fmtint =l alloc4 4 + %emptys =l alloc4 4 + storew 2122789, %fmtint + storew 2123557, %fmtdbl + storew 0, %emptys + %vp =l alloc8 24 + %fmt1 =l add 1, %fmt + vastart %vp +@loop + %p =l phi @start %fmt1, @casef %p1, @cased %p1 + %c =w loadsb %p + %p1 =l add 3, %p + jnz %c, @loop1, @end +@loop1 + %isg =w ceqw %c, 103 + jnz %isg, @casef, @cased +@casef + %dbl =d vaarg %vp + call $printf(l %fmtdbl, d %dbl, ...) + jmp @loop +@cased + %int =w vaarg %vp + call $printf(l %fmtint, w %int, ...) + jmp @loop +@end + call $puts(l %emptys) + ret +} + +export function $qbecall3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) { +@start + %vp =l alloc8 24 + vastart %vp + call $vprintf(l %fmt, l %vp) + ret +} + +export function $qbeprint4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, l %fmt, ...) { +@start + %fmtdbl =l alloc4 4 + %fmtint =l alloc4 4 + %emptys =l alloc4 4 + storew 2122789, %fmtint + storew 2123557, %fmtdbl + storew 0, %emptys + %vp =l alloc8 24 + %fmt1 =l add 1, %fmt + vastart %vp +@loop + %p =l phi @start %fmt1, @casef %p1, @cased %p1 + %c =w loadsb %p + %p1 =l add 3, %p + jnz %c, @loop1, @end +@loop1 + %isg =w ceqw %c, 103 + jnz %isg, @casef, @cased +@casef + %dbl =d vaarg %vp + call $printf(l %fmtdbl, d %dbl, ...) + jmp @loop +@cased + %int =w vaarg %vp + call $printf(l %fmtint, w %int, ...) + jmp @loop +@end + call $puts(l %emptys) + ret +} + +export function $qbecall4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, l %fmt, ...) { +@start + %vp =l alloc8 24 + vastart %vp + call $vprintf(l %fmt, l %vp) + ret +} + +export function $qbeprint5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, d %argd6, l %fmt, ...) { +@start + %fmtdbl =l alloc4 4 + %fmtint =l alloc4 4 + %emptys =l alloc4 4 + storew 2122789, %fmtint + storew 2123557, %fmtdbl + storew 0, %emptys + %vp =l alloc8 24 + %fmt1 =l add 1, %fmt + vastart %vp +@loop + %p =l phi @start %fmt1, @casef %p1, @cased %p1 + %c =w loadsb %p + %p1 =l add 3, %p + jnz %c, @loop1, @end +@loop1 + %isg =w ceqw %c, 103 + jnz %isg, @casef, @cased +@casef + %dbl =d vaarg %vp + call $printf(l %fmtdbl, d %dbl, ...) + jmp @loop +@cased + %int =w vaarg %vp + call $printf(l %fmtint, w %int, ...) + jmp @loop +@end + call $puts(l %emptys) + ret +} + +export function $qbecall5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, d %argd6, l %fmt, ...) { +@start + %vp =l alloc8 24 + vastart %vp + call $vprintf(l %fmt, l %vp) + ret +} + +export function $qbeprint6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %argw5, w %argw6, w %argw7, w %argw8, w %argw9, d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, d %argd6, d %argd7, d %argd8, d %argd9, l %fmt, ...) { +@start + %fmtdbl =l alloc4 4 + %fmtint =l alloc4 4 + %emptys =l alloc4 4 + storew 2122789, %fmtint + storew 2123557, %fmtdbl + storew 0, %emptys + %vp =l alloc8 24 + %fmt1 =l add 1, %fmt + vastart %vp +@loop + %p =l phi @start %fmt1, @casef %p1, @cased %p1 + %c =w loadsb %p + %p1 =l add 3, %p + jnz %c, @loop1, @end +@loop1 + %isg =w ceqw %c, 103 + jnz %isg, @casef, @cased +@casef + %dbl =d vaarg %vp + call $printf(l %fmtdbl, d %dbl, ...) + jmp @loop +@cased + %int =w vaarg %vp + call $printf(l %fmtint, w %int, ...) + jmp @loop +@end + call $puts(l %emptys) + ret +} + +export function $qbecall6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %argw5, w %argw6, w %argw7, w %argw8, w %argw9, d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, d %argd6, d %argd7, d %argd8, d %argd9, l %fmt, ...) { +@start + %vp =l alloc8 24 + vastart %vp + call $vprintf(l %fmt, l %vp) + ret +} + +# >>> driver +# #include +# extern void qbeprint0(char *, ...); +# extern void qbecall0(char *, ...); +# extern void qbeprint1(int argw0, char *, ...); +# extern void qbecall1(int argw0, char *, ...); +# extern void qbeprint2(double argd0, char *, ...); +# extern void qbecall2(double argd0, char *, ...); +# extern void qbeprint3(int argw0, int argw1, int argw2, int argw3, char *, ...); +# extern void qbecall3(int argw0, int argw1, int argw2, int argw3, char *, ...); +# extern void qbeprint4(double argd0, double argd1, double argd2, double argd3, double argd4, double argd5, char *, ...); +# extern void qbecall4(double argd0, double argd1, double argd2, double argd3, double argd4, double argd5, char *, ...); +# extern void qbeprint5(int argw0, int argw1, int argw2, int argw3, int argw4, double argd0, double argd1, double argd2, double argd3, double argd4, double argd5, double argd6, char *, ...); +# extern void qbecall5(int argw0, int argw1, int argw2, int argw3, int argw4, double argd0, double argd1, double argd2, double argd3, double argd4, double argd5, double argd6, char *, ...); +# extern void qbeprint6(int argw0, int argw1, int argw2, int argw3, int argw4, int argw5, int argw6, int argw7, int argw8, int argw9, double argd0, double argd1, double argd2, double argd3, double argd4, double argd5, double argd6, double argd7, double argd8, double argd9, char *, ...); +# extern void qbecall6(int argw0, int argw1, int argw2, int argw3, int argw4, int argw5, int argw6, int argw7, int argw8, int argw9, double argd0, double argd1, double argd2, double argd3, double argd4, double argd5, double argd6, double argd7, double argd8, double argd9, char *, ...); +# int main() { +# puts("# (0 int, 0 double)"); +# qbeprint0("%d \n", 3); +# qbecall0("%d \n", 3); +# qbeprint0("%g \n", -9.5); +# qbecall0("%g \n", -9.5); +# qbeprint0("%d %g \n", -5, -5.536); +# qbecall0("%d %g \n", -5, -5.536); +# qbeprint0("%g %g \n", 4.729, 3.534); +# qbecall0("%g %g \n", 4.729, 3.534); +# qbeprint0("%d %d %d %d \n", 8, -9, -2, -10); +# qbecall0("%d %d %d %d \n", 8, -9, -2, -10); +# qbeprint0("%g %g %g %g \n", -5.627, 0.1071, -9.469, -6.023); +# qbecall0("%g %g %g %g \n", -5.627, 0.1071, -9.469, -6.023); +# qbeprint0("%d %g %d %g \n", 3, 0.8988, -6, 1.785); +# qbecall0("%d %g %d %g \n", 3, 0.8988, -6, 1.785); +# qbeprint0("%g %g %d %d \n", 6.189, -9.87, 6, 4); +# qbecall0("%g %g %d %d \n", 6.189, -9.87, 6, 4); +# qbeprint0("%d %d %g %g \n", -3, -7, 9.144, -3.268); +# qbecall0("%d %d %g %g \n", -3, -7, 9.144, -3.268); +# qbeprint0("\n"); +# qbecall0("\n"); +# puts("# (1 int, 0 double)"); +# qbeprint1(0, "%d \n", -9); +# qbecall1(0, "%d \n", -9); +# qbeprint1(0, "%g \n", -8.066); +# qbecall1(0, "%g \n", -8.066); +# qbeprint1(0, "%d %g \n", 7, 2.075); +# qbecall1(0, "%d %g \n", 7, 2.075); +# qbeprint1(0, "%g %g \n", 6.143, 4.595); +# qbecall1(0, "%g %g \n", 6.143, 4.595); +# qbeprint1(0, "%d %d %d %d \n", 1, 10, -3, 1); +# qbecall1(0, "%d %d %d %d \n", 1, 10, -3, 1); +# qbeprint1(0, "%g %g %g %g \n", 6.588, 2.37, 7.234, 1.547); +# qbecall1(0, "%g %g %g %g \n", 6.588, 2.37, 7.234, 1.547); +# qbeprint1(0, "%d %g %d %g \n", 4, -9.084, -6, -4.212); +# qbecall1(0, "%d %g %d %g \n", 4, -9.084, -6, -4.212); +# qbeprint1(0, "%g %g %d %d \n", -8.404, -5.344, -8, -5); +# qbecall1(0, "%g %g %d %d \n", -8.404, -5.344, -8, -5); +# qbeprint1(0, "%d %d %g %g \n", 3, -3, -2.596, -5.81); +# qbecall1(0, "%d %d %g %g \n", 3, -3, -2.596, -5.81); +# qbeprint1(0, "\n"); +# qbecall1(0, "\n"); +# puts("# (0 int, 1 double)"); +# qbeprint2(0, "%d \n", -5); +# qbecall2(0, "%d \n", -5); +# qbeprint2(0, "%g \n", 8.733); +# qbecall2(0, "%g \n", 8.733); +# qbeprint2(0, "%d %g \n", 3, 2.183); +# qbecall2(0, "%d %g \n", 3, 2.183); +# qbeprint2(0, "%g %g \n", -6.577, 4.583); +# qbecall2(0, "%g %g \n", -6.577, 4.583); +# qbeprint2(0, "%d %d %d %d \n", -7, -3, 10, 3); +# qbecall2(0, "%d %d %d %d \n", -7, -3, 10, 3); +# qbeprint2(0, "%g %g %g %g \n", 1.139, 3.692, 6.857, 5.52); +# qbecall2(0, "%g %g %g %g \n", 1.139, 3.692, 6.857, 5.52); +# qbeprint2(0, "%d %g %d %g \n", -6, -9.358, -4, -4.645); +# qbecall2(0, "%d %g %d %g \n", -6, -9.358, -4, -4.645); +# qbeprint2(0, "%g %g %d %d \n", -5.78, 8.858, 8, -4); +# qbecall2(0, "%g %g %d %d \n", -5.78, 8.858, 8, -4); +# qbeprint2(0, "%d %d %g %g \n", 3, -2, 8.291, -0.823); +# qbecall2(0, "%d %d %g %g \n", 3, -2, 8.291, -0.823); +# qbeprint2(0, "\n"); +# qbecall2(0, "\n"); +# puts("# (4 int, 0 double)"); +# qbeprint3(0, 0, 0, 0, "%d \n", -5); +# qbecall3(0, 0, 0, 0, "%d \n", -5); +# qbeprint3(0, 0, 0, 0, "%g \n", -5.067); +# qbecall3(0, 0, 0, 0, "%g \n", -5.067); +# qbeprint3(0, 0, 0, 0, "%d %g \n", 1, -4.745); +# qbecall3(0, 0, 0, 0, "%d %g \n", 1, -4.745); +# qbeprint3(0, 0, 0, 0, "%g %g \n", 1.692, 7.956); +# qbecall3(0, 0, 0, 0, "%g %g \n", 1.692, 7.956); +# qbeprint3(0, 0, 0, 0, "%d %d %d %d \n", -2, -6, 10, 0); +# qbecall3(0, 0, 0, 0, "%d %d %d %d \n", -2, -6, 10, 0); +# qbeprint3(0, 0, 0, 0, "%g %g %g %g \n", -8.182, -9.058, -7.807, 2.549); +# qbecall3(0, 0, 0, 0, "%g %g %g %g \n", -8.182, -9.058, -7.807, 2.549); +# qbeprint3(0, 0, 0, 0, "%d %g %d %g \n", 6, -1.557, -9, -2.368); +# qbecall3(0, 0, 0, 0, "%d %g %d %g \n", 6, -1.557, -9, -2.368); +# qbeprint3(0, 0, 0, 0, "%g %g %d %d \n", 9.922, 0.5823, 10, 8); +# qbecall3(0, 0, 0, 0, "%g %g %d %d \n", 9.922, 0.5823, 10, 8); +# qbeprint3(0, 0, 0, 0, "%d %d %g %g \n", -10, 5, 3.634, 0.7394); +# qbecall3(0, 0, 0, 0, "%d %d %g %g \n", -10, 5, 3.634, 0.7394); +# qbeprint3(0, 0, 0, 0, "\n"); +# qbecall3(0, 0, 0, 0, "\n"); +# puts("# (0 int, 6 double)"); +# qbeprint4(0, 0, 0, 0, 0, 0, "%d \n", -5); +# qbecall4(0, 0, 0, 0, 0, 0, "%d \n", -5); +# qbeprint4(0, 0, 0, 0, 0, 0, "%g \n", 2.819); +# qbecall4(0, 0, 0, 0, 0, 0, "%g \n", 2.819); +# qbeprint4(0, 0, 0, 0, 0, 0, "%d %g \n", -8, -1.305); +# qbecall4(0, 0, 0, 0, 0, 0, "%d %g \n", -8, -1.305); +# qbeprint4(0, 0, 0, 0, 0, 0, "%g %g \n", -0.9255, 9.076); +# qbecall4(0, 0, 0, 0, 0, 0, "%g %g \n", -0.9255, 9.076); +# qbeprint4(0, 0, 0, 0, 0, 0, "%d %d %d %d \n", 8, -5, 0, -7); +# qbecall4(0, 0, 0, 0, 0, 0, "%d %d %d %d \n", 8, -5, 0, -7); +# qbeprint4(0, 0, 0, 0, 0, 0, "%g %g %g %g \n", 8.253, 7.41, -4.031, 2.779); +# qbecall4(0, 0, 0, 0, 0, 0, "%g %g %g %g \n", 8.253, 7.41, -4.031, 2.779); +# qbeprint4(0, 0, 0, 0, 0, 0, "%d %g %d %g \n", 2, -6.943, 6, 0.7876); +# qbecall4(0, 0, 0, 0, 0, 0, "%d %g %d %g \n", 2, -6.943, 6, 0.7876); +# qbeprint4(0, 0, 0, 0, 0, 0, "%g %g %d %d \n", 5.573, 0.6071, -10, -4); +# qbecall4(0, 0, 0, 0, 0, 0, "%g %g %d %d \n", 5.573, 0.6071, -10, -4); +# qbeprint4(0, 0, 0, 0, 0, 0, "%d %d %g %g \n", -10, 9, 7.574, 6.633); +# qbecall4(0, 0, 0, 0, 0, 0, "%d %d %g %g \n", -10, 9, 7.574, 6.633); +# qbeprint4(0, 0, 0, 0, 0, 0, "\n"); +# qbecall4(0, 0, 0, 0, 0, 0, "\n"); +# puts("# (5 int, 7 double)"); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d \n", -4); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d \n", -4); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g \n", -8.841); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g \n", -8.841); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %g \n", 8, 8.939); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %g \n", 8, 8.939); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g \n", -8.287, -0.2802); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g \n", -8.287, -0.2802); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %d %d %d \n", -9, 5, 6, -8); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %d %d %d \n", -9, 5, 6, -8); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g %g %g \n", -0.4944, 0.9961, -4.699, 7.449); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g %g %g \n", -0.4944, 0.9961, -4.699, 7.449); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %g %d %g \n", -2, -5.764, 1, 4.599); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %g %d %g \n", -2, -5.764, 1, 4.599); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g %d %d \n", -5.977, -3.766, 10, 3); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g %d %d \n", -5.977, -3.766, 10, 3); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %d %g %g \n", -1, 0, -7.58, -5.506); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %d %g %g \n", -1, 0, -7.58, -5.506); +# qbeprint5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "\n"); +# qbecall5(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "\n"); +# puts("# (10 int, 10 double)"); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d \n", -3); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d \n", -3); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g \n", 1.766); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g \n", 1.766); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %g \n", -6, -5.596); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %g \n", -6, -5.596); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g \n", -8.58, 2.622); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g \n", -8.58, 2.622); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %d %d %d \n", -6, 9, 8, -9); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %d %d %d \n", -6, 9, 8, -9); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g %g %g \n", -5.24, 3.38, -5.715, -7.354); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g %g %g \n", -5.24, 3.38, -5.715, -7.354); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %g %d %g \n", 9, 1.421, -1, 5.692); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %g %d %g \n", 9, 1.421, -1, 5.692); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g %d %d \n", 6.15, -6.192, -8, -1); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%g %g %d %d \n", 6.15, -6.192, -8, -1); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %d %g %g \n", -2, -1, 4.582, 3.467); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "%d %d %g %g \n", -2, -1, 4.582, 3.467); +# qbeprint6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "\n"); +# qbecall6(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "\n"); +# } +# <<< + +# >>> output +# # (0 int, 0 double) +# 3 +# 3 +# -9.5 +# -9.5 +# -5 -5.536 +# -5 -5.536 +# 4.729 3.534 +# 4.729 3.534 +# 8 -9 -2 -10 +# 8 -9 -2 -10 +# -5.627 0.1071 -9.469 -6.023 +# -5.627 0.1071 -9.469 -6.023 +# 3 0.8988 -6 1.785 +# 3 0.8988 -6 1.785 +# 6.189 -9.87 6 4 +# 6.189 -9.87 6 4 +# -3 -7 9.144 -3.268 +# -3 -7 9.144 -3.268 +# +# +# # (1 int, 0 double) +# -9 +# -9 +# -8.066 +# -8.066 +# 7 2.075 +# 7 2.075 +# 6.143 4.595 +# 6.143 4.595 +# 1 10 -3 1 +# 1 10 -3 1 +# 6.588 2.37 7.234 1.547 +# 6.588 2.37 7.234 1.547 +# 4 -9.084 -6 -4.212 +# 4 -9.084 -6 -4.212 +# -8.404 -5.344 -8 -5 +# -8.404 -5.344 -8 -5 +# 3 -3 -2.596 -5.81 +# 3 -3 -2.596 -5.81 +# +# +# # (0 int, 1 double) +# -5 +# -5 +# 8.733 +# 8.733 +# 3 2.183 +# 3 2.183 +# -6.577 4.583 +# -6.577 4.583 +# -7 -3 10 3 +# -7 -3 10 3 +# 1.139 3.692 6.857 5.52 +# 1.139 3.692 6.857 5.52 +# -6 -9.358 -4 -4.645 +# -6 -9.358 -4 -4.645 +# -5.78 8.858 8 -4 +# -5.78 8.858 8 -4 +# 3 -2 8.291 -0.823 +# 3 -2 8.291 -0.823 +# +# +# # (4 int, 0 double) +# -5 +# -5 +# -5.067 +# -5.067 +# 1 -4.745 +# 1 -4.745 +# 1.692 7.956 +# 1.692 7.956 +# -2 -6 10 0 +# -2 -6 10 0 +# -8.182 -9.058 -7.807 2.549 +# -8.182 -9.058 -7.807 2.549 +# 6 -1.557 -9 -2.368 +# 6 -1.557 -9 -2.368 +# 9.922 0.5823 10 8 +# 9.922 0.5823 10 8 +# -10 5 3.634 0.7394 +# -10 5 3.634 0.7394 +# +# +# # (0 int, 6 double) +# -5 +# -5 +# 2.819 +# 2.819 +# -8 -1.305 +# -8 -1.305 +# -0.9255 9.076 +# -0.9255 9.076 +# 8 -5 0 -7 +# 8 -5 0 -7 +# 8.253 7.41 -4.031 2.779 +# 8.253 7.41 -4.031 2.779 +# 2 -6.943 6 0.7876 +# 2 -6.943 6 0.7876 +# 5.573 0.6071 -10 -4 +# 5.573 0.6071 -10 -4 +# -10 9 7.574 6.633 +# -10 9 7.574 6.633 +# +# +# # (5 int, 7 double) +# -4 +# -4 +# -8.841 +# -8.841 +# 8 8.939 +# 8 8.939 +# -8.287 -0.2802 +# -8.287 -0.2802 +# -9 5 6 -8 +# -9 5 6 -8 +# -0.4944 0.9961 -4.699 7.449 +# -0.4944 0.9961 -4.699 7.449 +# -2 -5.764 1 4.599 +# -2 -5.764 1 4.599 +# -5.977 -3.766 10 3 +# -5.977 -3.766 10 3 +# -1 0 -7.58 -5.506 +# -1 0 -7.58 -5.506 +# +# +# # (10 int, 10 double) +# -3 +# -3 +# 1.766 +# 1.766 +# -6 -5.596 +# -6 -5.596 +# -8.58 2.622 +# -8.58 2.622 +# -6 9 8 -9 +# -6 9 8 -9 +# -5.24 3.38 -5.715 -7.354 +# -5.24 3.38 -5.715 -7.354 +# 9 1.421 -1 5.692 +# 9 1.421 -1 5.692 +# 6.15 -6.192 -8 -1 +# 6.15 -6.192 -8 -1 +# -2 -1 4.582 3.467 +# -2 -1 4.582 3.467 +# +# +# <<< diff --git a/tools/vatest.py b/tools/vatest.py new file mode 100644 index 0000000..c9b1bbd --- /dev/null +++ b/tools/vatest.py @@ -0,0 +1,157 @@ +# generate variadic calls to test the +# abi implementation + +from random import seed, randint, uniform +from struct import unpack + +I, D = 'd', 'g' + +formats = [ + # list of format to tests + [I], + [D], + [I,D], + [D,D], + [I,I,I,I], + [D,D,D,D], + [I,D,I,D], + [D,D,I,I], + [I,I,D,D], + [], +] + +generate = [ + # numbers of fixed integer and + # floating point arguments to + # test + (0, 0), (1, 0), (0, 1), (4, 0), + (0, 6), (5, 7), (10, 10), +] + +def mkargs(nargs, type, name): + args = map( + lambda n: ''.join([type, name, str(n), ', ']), + range(nargs) + ) + return ''.join(args) + +def mkfstr(fmt): + fstr = map( + lambda x: {I: '%d ', D: '%g '}[x], + fmt + ) + return '"' + ''.join(fstr) + '\\n"' + +def randargs(fmt): + ra = { + I: lambda: '{}'.format(randint(-10, 10)), + D: lambda: '{0:.4g}'.format(uniform(-10, 10)) + } + return list(map(lambda x: ra[x](), fmt)) + +def genssa(qbeprint, qbecall): + funcs = [('qbeprint', qbeprint), ('qbecall', qbecall)] + for fnum, (nia, nfa) in enumerate(generate): + params = "{}{}l %fmt, ...".format( + mkargs(nia, 'w ', '%argw'), + mkargs(nfa, 'd ', '%argd') + ) + for name, code in funcs: + print('export function ${}{}({}) {}' + .format(name, fnum, params, code) + ) + +def gendriver(): + print('# >>> driver') + print('# #include ') + + for fnum, (nia, nfa) in enumerate(generate): + params = "{}{}char *, ...".format( + mkargs(nia, 'int ', 'argw'), + mkargs(nfa, 'double ', 'argd') + ) + for name in ['qbeprint', 'qbecall']: + print('# extern void {}{}({});' + .format(name, fnum, params) + ) + + output = '' + print('# int main() {') + + for fnum, (nia, nfa) in enumerate(generate): + info = '# ({} int, {} double)'.format(nia, nfa) + print('# puts("{}");'.format(info)) + output += '# {}\n'.format(info) + for fmt in formats: + ra = randargs(fmt) + vaargs = ', '.join(ra) + expect = ' '.join(ra) + if fmt: + vaargs = ', ' + vaargs + expect = expect + ' ' + args = ''.join( + ['0, '] * (nia+nfa) + + [mkfstr(fmt), vaargs] + ) + for name in ['qbeprint', 'qbecall']: + print('# {}{}({});' + .format(name, fnum, args) + ) + output += '# {}\n'.format(expect) + + print('# }') + print('# <<<') + + print('\n# >>> output\n' + output + '# <<<') + + +qbeprint="""{{ +@start + %fmtdbl =l alloc4 4 + %fmtint =l alloc4 4 + %emptys =l alloc4 4 + storew {}, %fmtint + storew {}, %fmtdbl + storew 0, %emptys + %vp =l alloc8 24 + %fmt1 =l add 1, %fmt + vastart %vp +@loop + %p =l phi @start %fmt1, @casef %p1, @cased %p1 + %c =w loadsb %p + %p1 =l add 3, %p + jnz %c, @loop1, @end +@loop1 + %isg =w ceqw %c, 103 + jnz %isg, @casef, @cased +@casef + %dbl =d vaarg %vp + call $printf(l %fmtdbl, d %dbl, ...) + jmp @loop +@cased + %int =w vaarg %vp + call $printf(l %fmtint, w %int, ...) + jmp @loop +@end + call $puts(l %emptys) + ret +}} +""".format( + unpack("i", b'%d \x00')[0], + unpack("i", b'%g \x00')[0] +) + +qbecall="""{ +@start + %vp =l alloc8 24 + vastart %vp + call $vprintf(l %fmt, l %vp) + ret +} +""" + + +if __name__ == "__main__": + seed(42) + genssa(qbeprint, qbecall) + gendriver() From b698584443f17b8d0cfd88e0afe037ce351e0ee6 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 7 Feb 2017 23:03:38 -0500 Subject: [PATCH 055/286] update minic for new vararg support We conservatively assume all functions have variable argument lists. --- minic/minic.y | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/minic/minic.y b/minic/minic.y index 6b4150d..eeef900 100644 --- a/minic/minic.y +++ b/minic/minic.y @@ -290,18 +290,12 @@ call(Node *n, Symb *sr) fprintf(of, "\t"); psymb(*sr); fprintf(of, " =%c call $%s(", irtyp(sr->ctyp), f); - a = n->r; - if (a) - for (;;) { - fprintf(of, "%c ", irtyp(a->u.s.ctyp)); - psymb(a->u.s); - a = a->r; - if (a) - fprintf(of, ", "); - else - break; - } - fprintf(of, ")\n"); + for (a=n->r; a; a=a->r) { + fprintf(of, "%c ", irtyp(a->u.s.ctyp)); + psymb(a->u.s); + fprintf(of, ", "); + } + fprintf(of, "...)\n"); } Symb From 249af91ff9d9ffbd8962efcad999de442e609658 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 14 Feb 2017 13:10:02 -0500 Subject: [PATCH 056/286] minor cleanup in all.h --- all.h | 16 +++++++--------- parse.c | 14 +++++++------- sysv.c | 10 +++++----- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/all.h b/all.h index d13ef5c..a038612 100644 --- a/all.h +++ b/all.h @@ -9,7 +9,6 @@ #define die(...) die_(__FILE__, __VA_ARGS__) typedef unsigned int uint; -typedef unsigned short ushort; typedef unsigned long ulong; typedef unsigned long long bits; @@ -101,8 +100,8 @@ struct BSet { }; struct Ref { - uint32_t type:3; - uint32_t val:29; + uint type:3; + uint val:29; }; enum { @@ -456,14 +455,13 @@ struct Typ { int align; size_t size; int nunion; - struct Seg { enum { - Send, - Spad, - Sint, - Sflt, - Styp, + SEnd, + SPad, + SInt, + SFlt, + STyp, } type; uint len; /* index in typ[] for Styp */ } (*seg)[NSeg+1]; diff --git a/parse.c b/parse.c index 913fc07..a61ff1b 100644 --- a/parse.c +++ b/parse.c @@ -872,17 +872,17 @@ parseseg(Seg *seg, Typ *ty, int t) sz = 0; al = ty->align; while (t != Trbrace) { - type = Sint; + type = SInt; switch (t) { default: err("invalid type member specifier"); - case Td: type = Sflt; + case Td: type = SFlt; case Tl: s = 8; a = 3; break; - case Ts: type = Sflt; + case Ts: type = SFlt; case Tw: s = 4; a = 2; break; case Th: s = 2; a = 1; break; case Tb: s = 1; a = 0; break; case Ttyp: - type = Styp; + type = STyp; ty1 = &typ[findtyp(ntyp-1)]; s = ty1->size; a = ty1->align; @@ -894,7 +894,7 @@ parseseg(Seg *seg, Typ *ty, int t) a = s - a; if (n < NSeg) { /* padding segment */ - seg[n].type = Spad; + seg[n].type = SPad; seg[n].len = a; n++; } @@ -906,7 +906,7 @@ parseseg(Seg *seg, Typ *ty, int t) } else c = 1; sz += a + c*s; - if (type == Styp) + if (type == STyp) s = ty1 - typ; for (; c>0 && n= ty->size) diff --git a/sysv.c b/sysv.c index f4b167b..1a036a3 100644 --- a/sysv.c +++ b/sysv.c @@ -28,19 +28,19 @@ classify(AClass *a, Typ *t, int *pn, int *pe) cls = &a->cls[*pe]; for (; *pn<8; s++) { switch (seg[s].type) { - case Send: + case SEnd: goto Done; - case Spad: + case SPad: /* don't change anything */ break; - case Sflt: + case SFlt: if (*cls == Kx) *cls = Kd; break; - case Sint: + case SInt: *cls = Kl; break; - case Styp: + case STyp: classify(a, &typ[seg[s].len], pn, pe); continue; } From a9d81338b19f21f7220e340a1c50870b40587120 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 15 Feb 2017 20:17:13 -0500 Subject: [PATCH 057/286] add support for closure calls Compiling languages with closures often requires passing an extra environment parameter to the called function. One solution is to use a convention, and reserve, say, the first argument for that purpose. However, that makes binding to C a little less smooth. Alternatively, QBE now provides a way to remain fully ABI compatible with C by having a "hidden" environment argument (marked with the keyword 'env'). Calling a function expecting an environment from C will make the contents of the environment undefined, but the normal arguments will be passed without alteration. Conversely, calling a C function like it is a closure by passing it an environemnt will work smoothly. --- all.h | 4 ++++ parse.c | 24 ++++++++++++++++--- sysv.c | 66 +++++++++++++++++++++++++++++++++------------------- tools/lexh.c | 2 +- 4 files changed, 68 insertions(+), 28 deletions(-) diff --git a/all.h b/all.h index a038612..887d680 100644 --- a/all.h +++ b/all.h @@ -264,8 +264,12 @@ enum Op { /* function instructions */ Opar = NPubOp, Oparc, + Opare, +#define ispar(o) (Opar <= o && o <= Opare) Oarg, Oargc, + Oarge, +#define isarg(o) (Oarg <= o && o <= Oarge) Ocall, Ovacall, diff --git a/parse.c b/parse.c index a61ff1b..b911993 100644 --- a/parse.c +++ b/parse.c @@ -60,9 +60,11 @@ OpDesc opdesc[NOp] = { [Oxcmp] = { "xcmp", 1, {A(w,l,s,d), A(w,l,s,d)}, 1, 0, 0 }, [Oxtest] = { "xtest", 1, {A(w,l,e,e), A(w,l,e,e)}, 1, 0, 0 }, [Oaddr] = { "addr", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, - [Opar] = { "parn", 0, {A(x,x,x,x), A(x,x,x,x)}, 0, 0, 0 }, + [Opar] = { "par", 0, {A(x,x,x,x), A(x,x,x,x)}, 0, 0, 0 }, + [Opare] = { "pare", 0, {A(x,x,x,x), A(x,x,x,x)}, 0, 0, 0 }, [Oparc] = { "parc", 0, {A(e,x,e,e), A(e,x,e,e)}, 0, 0, 0 }, [Oarg] = { "arg", 0, {A(w,l,s,d), A(x,x,x,x)}, 0, 0, 0 }, + [Oarge] = { "arge", 0, {A(w,l,s,d), A(x,x,x,x)}, 0, 0, 0 }, [Oargc] = { "argc", 0, {A(e,x,e,e), A(e,l,e,e)}, 0, 0, 0 }, [Ocall] = { "call", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, [Ovacall] = { "vacall", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, @@ -108,6 +110,7 @@ enum { Talloc2, Tcall, + Tenv, Tphi, Tjmp, Tjnz, @@ -156,6 +159,7 @@ static char *kwmap[Ntok] = { [Talloc1] = "alloc1", [Talloc2] = "alloc2", [Tcall] = "call", + [Tenv] = "env", [Tphi] = "phi", [Tjmp] = "jmp", [Tjnz] = "jnz", @@ -493,17 +497,25 @@ parsecls(int *tyn) static int parserefl(int arg) { - int k, ty; + int k, ty, env, hasenv; Ref r; + hasenv = 0; expect(Tlparen); while (peek() != Trparen && peek() != Tdots) { if (curi - insb >= NIns) err("too many instructions (1)"); + env = peek() == Tenv; + if (env) + next(); k = parsecls(&ty); r = parseref(); if (req(r, R)) - err("invalid reference argument"); + err("invalid argument"); + if (hasenv && env) + err("only one environment allowed"); + if (env && k != Kl) + err("environment must be of type l"); if (!arg && rtype(r) != RTmp) err("invalid function parameter"); if (k == 4) @@ -511,12 +523,18 @@ parserefl(int arg) *curi = (Ins){Oargc, R, {TYPE(ty), r}, Kl}; else *curi = (Ins){Oparc, r, {TYPE(ty)}, Kl}; + else if (env) + if (arg) + *curi = (Ins){Oarge, R, {r}, k}; + else + *curi = (Ins){Opare, r, {R}, k}; else if (arg) *curi = (Ins){Oarg, R, {r}, k}; else *curi = (Ins){Opar, r, {R}, k}; curi++; + hasenv |= env; if (peek() == Trparen) break; expect(Tcomma); diff --git a/sysv.c b/sysv.c index 1a036a3..c0480f0 100644 --- a/sysv.c +++ b/sysv.c @@ -171,7 +171,7 @@ selret(Blk *b, Fn *fn) } static int -argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret) +argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret, Ref *env) { int nint, ni, nsse, ns, n, *pn; AClass *a; @@ -182,8 +182,9 @@ argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret) else nint = 6; nsse = 8; - for (i=i0, a=ac; iop == op) { + for (i=i0, a=ac; iop - op + Oarg) { + case Oarg: if (KBASE(i->cls) == 0) pn = &nint; else @@ -196,7 +197,8 @@ argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret) a->align = 3; a->size = 8; a->cls[0] = i->cls; - } else { + break; + case Oargc: n = i->arg[0].val; typclass(a, &typ[n]); if (a->inmem) @@ -212,8 +214,14 @@ argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret) nsse -= ns; } else a->inmem = 1; + break; + case Oarge: + if (op == Opar) + *env = i->to; + else + *env = i->arg[0]; + break; } - } return ((6-nint) << 4) | ((8-nsse) << 8); } @@ -236,7 +244,7 @@ MAKESURE(rclob_has_correct_size, sizeof rclob == NRClob * sizeof(int)); * | | | ` sse regs returned (0..2) * | | ` gp regs passed (0..6) * | ` sse regs passed (0..8) - * ` 1 if calling a vararg function (0..1) + * ` 1 if rax used to pass data (0..1) */ bits @@ -268,22 +276,22 @@ bits argregs(Ref r, int p[2]) { bits b; - int j, ni, nf, va; + int j, ni, nf, ra; assert(rtype(r) == RCall); b = 0; ni = (r.val >> 4) & 15; nf = (r.val >> 8) & 15; - va = (r.val >> 12) & 1; + ra = (r.val >> 12) & 1; for (j=0; jarg[1], R)) { assert(rtype(i1->arg[1]) == RType); typclass(&aret, &typ[i1->arg[1].val]); - ca = argsclass(i0, i1, ac, Oarg, &aret); + ca = argsclass(i0, i1, ac, Oarg, &aret, &env); } else - ca = argsclass(i0, i1, ac, Oarg, 0); + ca = argsclass(i0, i1, ac, Oarg, 0, &env); for (stk=0, a=&ac[i1-i0]; a>ac;) if ((--a)->inmem) { @@ -366,10 +376,15 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) ca += 1 << 2; } } - va = i1->op == Ovacall; - ca |= va << 12; + envc = !req(R, env); + varc = i1->op == Ovacall; + if (varc && envc) + err("sysv abi does not support variadic env calls"); + ca |= (varc | envc) << 12; emit(Ocall, i1->cls, R, i1->arg[0], CALL(ca)); - if (va) + if (envc) + emit(Ocopy, Kl, TMP(RAX), env, R); + if (varc) emit(Ocopy, Kw, TMP(RAX), getcon((ca >> 8) & 15, fn), R); ni = ns = 0; @@ -418,17 +433,18 @@ selpar(Fn *fn, Ins *i0, Ins *i1) AClass *ac, *a, aret; Ins *i; int ni, ns, s, al, fa; - Ref r; + Ref r, env; + env = R; ac = alloc((i1-i0) * sizeof ac[0]); curi = &insb[NIns]; ni = ns = 0; if (fn->retty >= 0) { typclass(&aret, &typ[fn->retty]); - fa = argsclass(i0, i1, ac, Opar, &aret); + fa = argsclass(i0, i1, ac, Opar, &aret, &env); } else - fa = argsclass(i0, i1, ac, Opar, 0); + fa = argsclass(i0, i1, ac, Opar, 0, &env); for (i=i0, a=ac; iop != Oparc || a->inmem) @@ -478,6 +494,9 @@ selpar(Fn *fn, Ins *i0, Ins *i1) emit(Ocopy, i->cls, i->to, r, R); } + if (!req(R, env)) + emit(Ocopy, Kl, env, TMP(RAX), R); + return fa | (s*4)<<12; } @@ -641,8 +660,8 @@ abi(Fn *fn) b->visit = 0; /* lower parameters */ - for (b=fn->start, i=b->ins; i-b->ins < b->nins; i++) - if (i->op != Opar && i->op != Oparc) + for (b=fn->start, i=b->ins; i-b->insnins; i++) + if (!ispar(i->op)) break; fa = selpar(fn, b->ins, i); n = b->nins - (i - b->ins) + (&insb[NIns] - curi); @@ -670,8 +689,7 @@ abi(Fn *fn) case Ocall: case Ovacall: for (i0=i; i0>b->ins; i0--) - if ((i0-1)->op != Oarg) - if ((i0-1)->op != Oargc) + if (!isarg((i0-1)->op)) break; selcall(fn, i0, i, &ral); i = i0; diff --git a/tools/lexh.c b/tools/lexh.c index db27f8f..9e8016a 100644 --- a/tools/lexh.c +++ b/tools/lexh.c @@ -22,7 +22,7 @@ char *tok[] = { "ceql", "cnel", "cles", "clts", "cgts", "cges", "cnes", "ceqs", "cos", "cuos", "cled", "cltd", "cgtd", "cged", "cned", "ceqd", "cod", "cuod", - "vaarg", "vastart", "...", + "vaarg", "vastart", "...", "env", "call", "phi", "jmp", "jnz", "ret", "export", "function", "type", "data", "align", "l", "w", From 28ab26c115fcb6f7c9913c7a4a9f298d1cee98ab Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 15 Feb 2017 20:46:35 -0500 Subject: [PATCH 058/286] comment fix --- sysv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysv.c b/sysv.c index c0480f0..a88b044 100644 --- a/sysv.c +++ b/sysv.c @@ -244,7 +244,7 @@ MAKESURE(rclob_has_correct_size, sizeof rclob == NRClob * sizeof(int)); * | | | ` sse regs returned (0..2) * | | ` gp regs passed (0..6) * | ` sse regs passed (0..8) - * ` 1 if rax used to pass data (0..1) + * ` 1 if rax is used to pass data (0..1) */ bits From 2f99913abbad912b3a323332031a8e1f2a9c64cf Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 17 Feb 2017 14:03:32 -0500 Subject: [PATCH 059/286] stricter class constraints for store & vastart --- parse.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/parse.c b/parse.c index b911993..38481aa 100644 --- a/parse.c +++ b/parse.c @@ -24,12 +24,12 @@ OpDesc opdesc[NOp] = { [Osar] = { "sar", 1, {A(w,l,e,e), A(w,w,e,e)}, 1, 0, 1 }, [Oshr] = { "shr", 1, {A(w,l,e,e), A(w,w,e,e)}, 1, 0, 1 }, [Oshl] = { "shl", 1, {A(w,l,e,e), A(w,w,e,e)}, 1, 0, 1 }, - [Ostored] = { "stored", 0, {A(d,d,d,d), A(m,m,m,m)}, 0, 1, 0 }, - [Ostores] = { "stores", 0, {A(s,s,s,s), A(m,m,m,m)}, 0, 1, 0 }, - [Ostorel] = { "storel", 0, {A(l,l,l,l), A(m,m,m,m)}, 0, 1, 0 }, - [Ostorew] = { "storew", 0, {A(w,w,w,w), A(m,m,m,m)}, 0, 1, 0 }, - [Ostoreh] = { "storeh", 0, {A(w,w,w,w), A(m,m,m,m)}, 0, 1, 0 }, - [Ostoreb] = { "storeb", 0, {A(w,w,w,w), A(m,m,m,m)}, 0, 1, 0 }, + [Ostored] = { "stored", 0, {A(d,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, + [Ostores] = { "stores", 0, {A(s,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, + [Ostorel] = { "storel", 0, {A(l,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, + [Ostorew] = { "storew", 0, {A(w,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, + [Ostoreh] = { "storeh", 0, {A(w,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, + [Ostoreb] = { "storeb", 0, {A(w,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, [Oload] = { "load", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 1, 0 }, [Oloadsw] = { "loadsw", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, [Oloaduw] = { "loaduw", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, @@ -74,7 +74,7 @@ OpDesc opdesc[NOp] = { [Oalloc+1] = { "alloc8", 1, {A(e,l,e,e), A(e,x,e,e)}, 0, 0, 0 }, [Oalloc+2] = { "alloc16", 1, {A(e,l,e,e), A(e,x,e,e)}, 0, 0, 0 }, [Ovaarg] = { "vaarg", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, - [Ovastart] = { "vastart", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, + [Ovastart] = { "vastart", 0, {A(m,e,e,e), A(x,e,e,e)}, 0, 0, 0 }, #define X(c) \ [Ocmpw+IC##c] = { "c" #c "w", 0, {A(w,w,e,e), A(w,w,e,e)}, 1, 0, 1 }, \ [Ocmpl+IC##c] = { "c" #c "l", 0, {A(l,l,e,e), A(l,l,e,e)}, 1, 0, 1 }, \ From a940cc808e12659ff307294492ec6152c67fb471 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 22 Feb 2017 12:30:44 -0500 Subject: [PATCH 060/286] turn the instruction index into a list --- doc/il.txt | 142 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 109 insertions(+), 33 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index 7295b3b..aa7e7e4 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -805,36 +805,112 @@ instructions unless you know exactly what you are doing. - 7. Instructions Index ----------------------- -<@ Arithmetic and Bits >: - `add`, `sub`, `div`, `mul`, `udiv`, `rem`, `urem`, `or`, - `xor`, `and`, `sar`, `shr`, `shl` - -<@ Memory >: - `storeb`, `storeh`, `storew`, `storel`, `stores`, `stored`, - `loadd`, `loads`, `loadl`, `loadw`, `loadsw`, `loaduw`, - `loadsh`, `loaduh`, `loadsb`, `loadub`, `alloc4`, `alloc8`, - `alloc16` - -<@ Comparisons >: - `ceqw`, `ceql`, `cnew`, `cnel`, `cslew`, `cslel`, `csltw`, - `csltl`, `csgew`, `csgel`, `csgtw`, `csgtl`, `culew`, - `culel`, `cultw`, `cultl`, `cugew`, `cugel`, `cugtw`, - `cugtl`, `ceqs`, `ceqd`, `cnes`, `cned`, `cles`, `cled`, - `clts`, `cltd`, `cges`, `cged`, `cgts`, `cgtd`, `cos`, - `cod`, `cuos`, `cuod` - -<@ Conversions >: - `extsw`, `extsh`, `extsb`, `exts`, `extuw`, `extuh`, - `extub`, `truncd`, `stosi`, `dtosi`, `swtof`, `sltof` - -<@ Cast >: - `cast` - -<@ Call >: - `call` - -<@ Phi >: - `phi` - -<@ Jumps >: - `jmp`, `jnz`, `ret` + * <@ Arithmetic and Bits >: + + * `add` + * `and` + * `div` + * `mul` + * `or` + * `rem` + * `sar` + * `shl` + * `shr` + * `sub` + * `udiv` + * `urem` + * `xor` + + * <@ Memory >: + + * `alloc16` + * `alloc4` + * `alloc8` + * `loadd` + * `loadl` + * `loads` + * `loadsb` + * `loadsh` + * `loadsw` + * `loadub` + * `loaduh` + * `loaduw` + * `loadw` + * `storeb` + * `stored` + * `storeh` + * `storel` + * `stores` + * `storew` + + * <@ Comparisons >: + + * `ceqd` + * `ceql` + * `ceqs` + * `ceqw` + * `cged` + * `cges` + * `cgtd` + * `cgts` + * `cled` + * `cles` + * `cltd` + * `clts` + * `cned` + * `cnel` + * `cnes` + * `cnew` + * `cod` + * `cos` + * `csgel` + * `csgew` + * `csgtl` + * `csgtw` + * `cslel` + * `cslew` + * `csltl` + * `csltw` + * `cugel` + * `cugew` + * `cugtl` + * `cugtw` + * `culel` + * `culew` + * `cultl` + * `cultw` + * `cuod` + * `cuos` + + * <@ Conversions >: + + * `dtosi` + * `exts` + * `extsb` + * `extsh` + * `extsw` + * `extub` + * `extuh` + * `extuw` + * `sltof` + * `stosi` + * `swtof` + * `truncd` + + * <@ Cast > : + + * `cast` + + * <@ Call >: + + * `call` + + * <@ Phi >: + + * `phi` + + * <@ Jumps >: + + * `jmp` + * `jnz` + * `ret` From eebbb69291369c3188064d6c3cb779bc47e09bbe Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 21 Feb 2017 16:45:20 -0500 Subject: [PATCH 061/286] do not err on address comparisons While I was at it I also refreshed some bits in the instruction selection. --- fold.c | 15 ++++++---- isel.c | 91 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 55 insertions(+), 51 deletions(-) diff --git a/fold.c b/fold.c index 0cbd6fa..6129421 100644 --- a/fold.c +++ b/fold.c @@ -323,7 +323,7 @@ fold(Fn *fn) /* boring folding code */ -static void +static int foldint(Con *res, int op, int w, Con *cl, Con *cr) { union { @@ -357,8 +357,11 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) else if (cr->type == CAddr) err("undefined substraction (num - addr)"); } - else if (cl->type == CAddr || cr->type == CAddr) + else if (cl->type == CAddr || cr->type == CAddr) { + if (Ocmpl <= op && op <= Ocmpl1) + return 1; err("invalid address operand for '%s'", opdesc[op].name); + } switch (op) { case Oadd: x = l.u + r.u; break; case Osub: x = l.u - r.u; break; @@ -440,6 +443,7 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) res->bits.i = x; if (lab) strcpy(res->label, lab); + return 0; } static void @@ -492,9 +496,10 @@ opfold(int op, int cls, Con *cl, Con *cr, Fn *fn) if ((op == Odiv || op == Oudiv || op == Orem || op == Ourem) && czero(cr, KWIDE(cls))) err("null divisor in '%s'", opdesc[op].name); - if (cls == Kw || cls == Kl) - foldint(&c, op, cls == Kl, cl, cr); - else + if (cls == Kw || cls == Kl) { + if (foldint(&c, op, cls == Kl, cl, cr)) + return Bot; + } else foldflt(&c, op, cls == Kd, cl, cr); if (c.type == CBits) nc = getcon(c.bits.i, fn).val; diff --git a/isel.c b/isel.c index 8b4b823..75d712a 100644 --- a/isel.c +++ b/isel.c @@ -47,30 +47,24 @@ fcmptoi(int fc) static int iscmp(int op, int *pk, int *pc) { - int k, c; - if (Ocmpw <= op && op <= Ocmpw1) { - c = op - Ocmpw; - k = Kw; + *pc = op - Ocmpw; + *pk = Kw; } else if (Ocmpl <= op && op <= Ocmpl1) { - c = op - Ocmpl; - k = Kl; + *pc = op - Ocmpl; + *pk = Kl; } else if (Ocmps <= op && op <= Ocmps1) { - c = fcmptoi(op - Ocmps); - k = Ks; + *pc = fcmptoi(op - Ocmps); + *pk = Ks; } else if (Ocmpd <= op && op <= Ocmpd1) { - c = fcmptoi(op - Ocmpd); - k = Kd; + *pc = fcmptoi(op - Ocmpd); + *pk = Kd; } else return 0; - if (pk) - *pk = k; - if (pc) - *pc = c; return 1; } @@ -197,21 +191,28 @@ seladdr(Ref *r, ANum *an, Fn *fn) } } -static void +static int selcmp(Ref arg[2], int k, Fn *fn) { + int swap; Ref r, *iarg; - if (rtype(arg[0]) == RCon) { + swap = rtype(arg[0]) == RCon; + if (swap) { r = arg[1]; arg[1] = arg[0]; arg[0] = r; } - assert(rtype(arg[0]) != RCon); emit(Oxcmp, k, R, arg[1], arg[0]); - iarg = curi->arg; /* fixarg() can change curi */ + iarg = curi->arg; + if (rtype(arg[0]) == RCon) { + assert(k == Kl); + iarg[1] = newtmp("isel", k, fn); + emit(Ocopy, k, iarg[1], arg[0], R); + } fixarg(&iarg[0], k, 0, fn); fixarg(&iarg[1], k, 0, fn); + return swap; } static void @@ -220,7 +221,7 @@ sel(Ins i, ANum *an, Fn *fn) Ref r0, r1, *iarg; int x, k, kc; int64_t sz; - Ins *i0; + Ins *i0, *i1; if (rtype(i.to) == RTmp) if (!isreg(i.to) && !isreg(i.arg[0]) && !isreg(i.arg[1])) @@ -349,10 +350,10 @@ sel(Ins i, ANum *an, Fn *fn) if (isload(i.op)) goto case_Oload; if (iscmp(i.op, &kc, &x)) { - if (rtype(i.arg[0]) == RCon) - x = icmpop(x); emit(Oxset+x, k, i.to, R, R); - selcmp(i.arg, kc, fn); + i1 = curi; + if (selcmp(i.arg, kc, fn)) + i1->op = Oxset + icmpop(x); break; } die("unknown instruction %s", opdesc[i.op].name); @@ -400,30 +401,31 @@ seljmp(Blk *b, Fn *fn) return; } fi = flagi(b->ins, &b->ins[b->nins]); - if (fi && req(fi->to, r)) { - if (iscmp(fi->op, &k, &c)) { - if (rtype(fi->arg[0]) == RCon) + if (!fi || !req(fi->to, r)) { + selcmp((Ref[2]){r, CON_Z}, Kw, fn); /* todo, long jnz */ + b->jmp.type = Jxjc + ICne; + } + else if (iscmp(fi->op, &k, &c)) { + if (t->nuse == 1) { + if (selcmp(fi->arg, k, fn)) c = icmpop(c); - b->jmp.type = Jxjc + c; - if (t->nuse == 1) { - selcmp(fi->arg, k, fn); - *fi = (Ins){.op = Onop}; - } - return; + *fi = (Ins){.op = Onop}; } - if (fi->op == Oand && t->nuse == 1 - && (rtype(fi->arg[0]) == RTmp || - rtype(fi->arg[1]) == RTmp)) { - fi->op = Oxtest; - fi->to = R; - b->jmp.type = Jxjc + ICne; - if (rtype(fi->arg[1]) == RCon) { - r = fi->arg[1]; - fi->arg[1] = fi->arg[0]; - fi->arg[0] = r; - } - return; + b->jmp.type = Jxjc + c; + } + else if (fi->op == Oand && t->nuse == 1 + && (rtype(fi->arg[0]) == RTmp || + rtype(fi->arg[1]) == RTmp)) { + fi->op = Oxtest; + fi->to = R; + b->jmp.type = Jxjc + ICne; + if (rtype(fi->arg[1]) == RCon) { + r = fi->arg[1]; + fi->arg[1] = fi->arg[0]; + fi->arg[0] = r; } + } + else { /* since flags are not tracked in liveness, * the result of the flag-setting instruction * has to be marked as live @@ -431,10 +433,7 @@ seljmp(Blk *b, Fn *fn) if (t->nuse == 1) emit(Ocopy, Kw, R, r, R); b->jmp.type = Jxjc + ICne; - return; } - selcmp((Ref[2]){r, CON_Z}, Kw, fn); /* todo, add long branch if non-zero */ - b->jmp.type = Jxjc + ICne; } static int From 06899861874b50f9abb3a59ed5b56af98f451111 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 23 Feb 2017 11:19:11 -0500 Subject: [PATCH 062/286] propagate aliasing information through copies --- alias.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alias.c b/alias.c index 56178ca..a24d9b3 100644 --- a/alias.c +++ b/alias.c @@ -130,6 +130,10 @@ fillalias(Fn *fn) a->base = i->to; a->offset = 0; } + if (i->op == Ocopy) { + assert(a); + getalias(a, i->arg[0], fn); + } if (i->op == Oadd) { getalias(&a0, i->arg[0], fn); getalias(&a1, i->arg[1], fn); From 5c35f60732a90c412a9bbec0a50d5b28763c0132 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 23 Feb 2017 11:37:26 -0500 Subject: [PATCH 063/286] add simple idiomatic c test --- test/strcmp.ssa | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 test/strcmp.ssa diff --git a/test/strcmp.ssa b/test/strcmp.ssa new file mode 100644 index 0000000..4956871 --- /dev/null +++ b/test/strcmp.ssa @@ -0,0 +1,63 @@ +# the C strcmp function generated by scc + +export function w $strcmp(l %s1.3.val,l %s2.5.val) +{ +@.37 + %s1.3 =l alloc8 8 + %s2.5 =l alloc8 8 + storel %s1.3.val,%s1.3 + storel %s2.5.val,%s2.5 + jmp @.5 +@.6 + %.9 =l loadl %s1.3 + %.10 =l add %.9,1 + storel %.10,%s1.3 + %.11 =l loadl %s2.5 + %.12 =l add %.11,1 + storel %.12,%s2.5 +@.5 + %.15 =l loadl %s1.3 + %.16 =w loadsb %.15 + %.17 =w extsb %.16 + %.18 =w cnew %.17,0 + jnz %.18,@.14,@.8 +@.14 + %.19 =l loadl %s2.5 + %.20 =w loadsb %.19 + %.21 =w extsb %.20 + %.22 =w cnew %.21,0 + jnz %.22,@.13,@.8 +@.13 + %.23 =l loadl %s1.3 + %.24 =w loadsb %.23 + %.25 =w extsb %.24 + %.26 =l loadl %s2.5 + %.27 =w loadsb %.26 + %.28 =w extsb %.27 + %.29 =w ceqw %.25,%.28 + jnz %.29,@.6,@.8 +@.8 +@.7 + %.30 =l loadl %s1.3 + %.31 =w loadub %.30 + %.32 =w extub %.31 + %.33 =l loadl %s2.5 + %.34 =w loadub %.33 + %.35 =w extub %.34 + %.36 =w sub %.32,%.35 + ret %.36 +} + +# >>> driver +# extern int strcmp(const char *, const char *); +# int main() { +# char a[] = "Hello world"; +# return !( +# strcmp(a, a) == 0 && +# strcmp("aaa", "aab") < 0 && +# strcmp("..cnn", "..bbc") > 0 && +# strcmp(a, "Hellp ...") < 0 && +# strcmp(a, "Hello vorld") > 0 +# ); +# } +# <<< From fc124dd22e6d936de53c60f6752e45c857f10013 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 24 Feb 2017 09:32:13 -0500 Subject: [PATCH 064/286] update isel comment --- isel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/isel.c b/isel.c index 75d712a..6ce5dd0 100644 --- a/isel.c +++ b/isel.c @@ -3,11 +3,10 @@ /* For x86_64, do the following: * - * - lower calls * - check that constants are used only in * places allowed * - ensure immediates always fit in 32b - * - explicit machine register contraints + * - expose machine register contraints * on instructions like division. * - implement fast locals (the streak of * constant allocX in the first basic block) From f3301026fa404c68c7ad399b5a56a5135b88af04 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 24 Feb 2017 09:42:12 -0500 Subject: [PATCH 065/286] reenable and fix a bug in memopt While a minimal dead store elimination is not implemented, the generated code looks quite a bit better with them enabled. It also is quite cheap. --- main.c | 2 +- mem.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index f93af37..fe68ae0 100644 --- a/main.c +++ b/main.c @@ -50,7 +50,7 @@ func(Fn *fn) fillrpo(fn); fillpreds(fn); filluse(fn); - /* memopt(fn); */ + memopt(fn); ssa(fn); filluse(fn); ssacheck(fn); diff --git a/mem.c b/mem.c index ea0bef7..11527fa 100644 --- a/mem.c +++ b/mem.c @@ -86,15 +86,18 @@ memopt(Fn *fn) /* try to turn loads into copies so we * can eliminate them later */ switch(l->op) { - case Oload: case Oloadsw: case Oloaduw: + if (k == Kl) + goto Extend; + case Oload: if (KBASE(k) != KBASE(l->cls)) l->op = Ocast; else l->op = Ocopy; break; default: + Extend: l->op = Oextsb + (l->op - Oloadsb); break; } From 1bb7652484e1c7ca2cd7fcab858b4bbb18509879 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 24 Feb 2017 09:48:53 -0500 Subject: [PATCH 066/286] deduplicate loadsz & storesz --- all.h | 2 ++ load.c | 4 ++-- mem.c | 25 ------------------------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/all.h b/all.h index 887d680..b073124 100644 --- a/all.h +++ b/all.h @@ -576,6 +576,8 @@ int alias(Ref, int, Ref, int, int *, Fn *); int escapes(Ref, Fn *); /* load.c */ +int loadsz(Ins *); +int storesz(Ins *); void loadopt(Fn *); /* ssa.c */ diff --git a/load.c b/load.c index ca7d492..3e22b57 100644 --- a/load.c +++ b/load.c @@ -42,7 +42,7 @@ static uint inum; /* current insertion number */ static Insert *ilog; /* global insertion log */ static uint nlog; /* number of entries in the log */ -static int +int loadsz(Ins *l) { switch (l->op) { @@ -54,7 +54,7 @@ loadsz(Ins *l) die("unreachable"); } -static int +int storesz(Ins *s) { switch (s->op) { diff --git a/mem.c b/mem.c index 11527fa..fd6ee16 100644 --- a/mem.c +++ b/mem.c @@ -1,30 +1,5 @@ #include "all.h" -static int -loadsz(Ins *l) -{ - switch (l->op) { - case Oloadsb: case Oloadub: return 1; - case Oloadsh: case Oloaduh: return 2; - case Oloadsw: case Oloaduw: return 4; - case Oload: return KWIDE(l->cls) ? 8 : 4; - } - die("unreachable"); -} - -static int -storesz(Ins *s) -{ - switch (s->op) { - case Ostoreb: return 1; - case Ostoreh: return 2; - case Ostorew: case Ostores: return 4; - case Ostorel: case Ostored: return 8; - } - die("unreachable"); -} - - /* require use, maintains use counts */ void memopt(Fn *fn) From 0699cd2e575bcaa951cb7d97bc77ab9acb2c9970 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 24 Feb 2017 10:31:50 -0500 Subject: [PATCH 067/286] improve the range of action of load elimination When eliminating `load %foo`, don't limit the search to the live range of %foo, but to the live range of its aliasing information. For example, if %foo is a constant offset into a stack-allocated slot, %foo =l add %slot, 42 the search will proceed on all the code in which %slot is live, not only below the definition of %foo, like before. --- load.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/load.c b/load.c index 3e22b57..4805720 100644 --- a/load.c +++ b/load.c @@ -113,8 +113,9 @@ mask(int cls, Ref *r, bits msk, Loc *l) static Ref load(Slice sl, bits msk, Loc *l) { - Ref r; - int ld, cls, all; + Alias *a; + Ref r, r1; + int ld, cls, all, c; ld = (int[]){ [1] = Oloadub, @@ -127,12 +128,54 @@ load(Slice sl, bits msk, Loc *l) cls = sl.cls; else cls = sl.sz > 4 ? Kl : Kw; - r = iins(cls, ld, sl.ref, R, l); + r = sl.ref; + /* sl.ref might not be live here, + * but its alias base ref will be + * (see killsl() below) */ + if (rtype(r) == RTmp) { + a = &curf->tmp[r.val].alias; + switch (a->type) { + default: + die("unreachable"); + case ALoc: + case AEsc: + case AUnk: + r = a->base; + if (!a->offset) + break; + r1 = getcon(a->offset, curf); + r = iins(Kl, Oadd, r, r1, l); + break; + case ACon: + case ASym: + c = curf->ncon++; + vgrow(&curf->con, curf->ncon); + curf->con[c].type = CAddr; + strcpy(curf->con[c].label, a->label); + curf->con[c].bits.i = a->offset; + curf->con[c].local = 0; + r = CON(c); + break; + } + } + r = iins(cls, ld, r, R, l); if (!all) mask(cls, &r, msk, l); return r; } +static int +killsl(Ref r, Slice sl) +{ + Alias *a; + + if (rtype(sl.ref) != RTmp) + return 0; + a = &curf->tmp[sl.ref.val].alias; + assert(a->type==ALoc || a->type==AEsc || a->type==AUnk); + return req(a->base, r); +} + /* returns a ref containing the contents of the slice * passed as argument, all the bits set to 0 in the * mask argument are zeroed in the result; @@ -181,7 +224,7 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) while (i > b->ins) { --i; - if (req(i->to, sl.ref) + if (killsl(i->to, sl) || (i->op == Ocall && escapes(sl.ref, curf))) goto Load; ld = isload(i->op); @@ -251,7 +294,7 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) } for (p=b->phi; p; p=p->link) - if (req(p->to, sl.ref)) + if (killsl(p->to, sl)) /* scanning predecessors in that * case would be unsafe */ goto Load; From 5165fcae767801a20316530c0ec9f096158aa2e4 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 24 Feb 2017 11:07:24 -0500 Subject: [PATCH 068/286] wrong assumption killsl() --- load.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/load.c b/load.c index 4805720..bb4acbc 100644 --- a/load.c +++ b/load.c @@ -172,8 +172,14 @@ killsl(Ref r, Slice sl) if (rtype(sl.ref) != RTmp) return 0; a = &curf->tmp[sl.ref.val].alias; - assert(a->type==ALoc || a->type==AEsc || a->type==AUnk); - return req(a->base, r); + switch (a->type) { + default: die("unreachable"); + case ALoc: + case AEsc: + case AUnk: return req(a->base, r); + case ACon: + case ASym: return 0; + } } /* returns a ref containing the contents of the slice From a35dc8c495467306ca149d642b2d2983922d7a9d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 24 Feb 2017 12:00:38 -0500 Subject: [PATCH 069/286] fix pretty bad bug in alias analysis When a temporary marked local is escaping, the whole slot must be marked as such. To solve this, Alias now holds a pointer to the alias information of the slot. For simplicity of the code, this pointer is always valid and fetching ->type out of it is meaningful. --- alias.c | 14 ++++++++++---- all.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/alias.c b/alias.c index a24d9b3..ed64501 100644 --- a/alias.c +++ b/alias.c @@ -10,6 +10,7 @@ getalias(Alias *a, Ref r, Fn *fn) die("unreachable"); case RTmp: *a = fn->tmp[r.val].alias; + a->type = a->slot->type; assert(a->type != ABot); break; case RCon: @@ -20,6 +21,7 @@ getalias(Alias *a, Ref r, Fn *fn) } else a->type = ACon; a->offset = c->bits.i; + a->slot = a; break; } } @@ -79,9 +81,12 @@ alias(Ref p, int sp, Ref q, int sq, int *delta, Fn *fn) int escapes(Ref r, Fn *fn) { + Alias *a; + if (rtype(r) != RTmp) return 1; - return fn->tmp[r.val].alias.type != ALoc; + a = &fn->tmp[r.val].alias; + return !(a->type & 1) || a->slot->type == AEsc; } static void @@ -92,9 +97,8 @@ esc(Ref r, Fn *fn) assert(rtype(r) <= RType); if (rtype(r) == RTmp) { a = &fn->tmp[r.val].alias; - assert(a->type != ABot); - if (a->type == ALoc) - a->type = AEsc; + if (a->slot->type == ALoc) + a->slot->type = AEsc; } } @@ -116,6 +120,7 @@ fillalias(Fn *fn) a->type = AUnk; a->base = p->to; a->offset = 0; + a->slot = a; } for (i=b->ins; i<&b->ins[b->nins]; ++i) { a = 0; @@ -129,6 +134,7 @@ fillalias(Fn *fn) a->type = AUnk; a->base = i->to; a->offset = 0; + a->slot = a; } if (i->op == Ocopy) { assert(a); diff --git a/all.h b/all.h index b073124..128d16c 100644 --- a/all.h +++ b/all.h @@ -391,6 +391,7 @@ struct Alias { Ref base; char label[NString]; int64_t offset; + Alias *slot; }; struct Tmp { From df61decee5095479f4760f36027a445d8d792373 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 24 Feb 2017 15:52:56 -0500 Subject: [PATCH 070/286] start a new simplification pass --- Makefile | 2 +- all.h | 3 +++ main.c | 1 + simpl.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 simpl.c diff --git a/Makefile b/Makefile index fc649f8..4040923 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ABI = sysv V = @ OBJDIR = obj -SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c +SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c simpl.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c OBJ = $(SRC:%.c=$(OBJDIR)/%.o) CFLAGS += -Wall -Wextra -std=c99 -g -pedantic diff --git a/all.h b/all.h index 128d16c..f518a36 100644 --- a/all.h +++ b/all.h @@ -588,6 +588,9 @@ void fillrpo(Fn *); void ssa(Fn *); void ssacheck(Fn *); +/* simpl.c */ +void simpl(Fn *); + /* copy.c */ void copy(Fn *); diff --git a/main.c b/main.c index fe68ae0..1a8973f 100644 --- a/main.c +++ b/main.c @@ -59,6 +59,7 @@ func(Fn *fn) loadopt(fn); filluse(fn); ssacheck(fn); + simpl(fn); copy(fn); filluse(fn); fold(fn); diff --git a/simpl.c b/simpl.c new file mode 100644 index 0000000..384a8da --- /dev/null +++ b/simpl.c @@ -0,0 +1,46 @@ +#include "all.h" + +static void +elimext(Ins *i, int ext, Fn *fn) +{ + Tmp *t; + Use *u; + + assert(rtype(i->to) == RTmp); + t = &fn->tmp[i->to.val]; + for (u=t->use; u<&t->use[t->nuse]; u++) + if (u->type == UIns + && u->u.ins->op == ext + && (u->u.ins->cls == i->cls || i->cls == Kl)) { + u->u.ins->op = Ocopy; + elimext(u->u.ins, ext, fn); + } +} + +/* requires & preserves uses */ +void +simpl(Fn *fn) +{ + Blk *b; + Ins *i; + int ext; + + for (b=fn->start; b; b=b->link) + for (i=b->ins; i<&b->ins[b->nins]; i++) + switch (i->op) { + case Oloadsb: + case Oloadub: + case Oloadsh: + case Oloaduh: + ext = Oextsb + (i->op - Oloadsb); + goto Elimext; + case Oextsb: + case Oextub: + case Oextsh: + case Oextuh: + ext = i->op; + Elimext: + elimext(i, ext, fn); + break; + } +} From e46b4e31e83f2f9d638ddffc5575795565f15e88 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 24 Feb 2017 15:53:42 -0500 Subject: [PATCH 071/286] cosmetic modifications to emit.c --- emit.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/emit.c b/emit.c index ccbd516..c3a274b 100644 --- a/emit.c +++ b/emit.c @@ -52,7 +52,7 @@ static struct { { Oshr, Ki, "-shr%k %B1, %=" }, { Oshl, Ki, "-shl%k %B1, %=" }, { Omul, Ki, "+imul%k %1, %=" }, - { Omul, Ks, "+mulss %1, %=" }, /* fixme */ + { Omul, Ks, "+mulss %1, %=" }, { Omul, Kd, "+mulsd %1, %=" }, { Odiv, Ka, "-div%k %1, %=" }, { Ostorel, Ka, "movq %L0, %M1" }, @@ -76,7 +76,7 @@ static struct { { Oextsb, Ki, "movsb%k %B0, %=" }, { Oextub, Ki, "movzb%k %B0, %=" }, - { Oexts, Kd, "cvtss2sd %0, %=" }, /* see if factorization is possible */ + { Oexts, Kd, "cvtss2sd %0, %=" }, { Otruncd, Ks, "cvttsd2ss %0, %=" }, { Ostosi, Ki, "cvttss2si%k %0, %=" }, { Odtosi, Ki, "cvttsd2si%k %0, %=" }, @@ -91,7 +91,7 @@ static struct { { Osign, Kw, "cltd" }, { Oxdiv, Ki, "div%k %0" }, { Oxidiv, Ki, "idiv%k %0" }, - { Oxcmp, Ks, "comiss %S0, %S1" }, /* fixme, Kf */ + { Oxcmp, Ks, "comiss %S0, %S1" }, { Oxcmp, Kd, "comisd %D0, %D1" }, { Oxcmp, Ki, "cmp%k %0, %1" }, { Oxtest, Ki, "test%k %0, %1" }, @@ -533,7 +533,8 @@ emitfn(Fn *fn, FILE *f) } for (b=fn->start; b; b=b->link) { - fprintf(f, "%sbb%d: /* %s */\n", locprefix, id0+b->id, b->name); + fprintf(f, "%sbb%d:\n", locprefix, id0+b->id); + fprintf(f, "/* @%s */\n", b->name); for (i=b->ins; i!=&b->ins[b->nins]; i++) emitins(*i, fn, f); switch (b->jmp.type) { @@ -551,8 +552,8 @@ emitfn(Fn *fn, FILE *f) case Jjmp: Jmp: if (b->s1 != b->link) - fprintf(f, "\tjmp %sbb%d /* %s */\n", - locprefix, id0+b->s1->id, b->s1->name); + fprintf(f, "\tjmp %sbb%d\n", + locprefix, id0+b->s1->id); break; default: c = b->jmp.type - Jxjc; @@ -563,8 +564,8 @@ emitfn(Fn *fn, FILE *f) b->s2 = s; } else c = cneg(c); - fprintf(f, "\tj%s %sbb%d /* %s */\n", ctoa[c], - locprefix, id0+b->s2->id, b->s2->name); + fprintf(f, "\tj%s %sbb%d\n", ctoa[c], + locprefix, id0+b->s2->id); goto Jmp; } die("unhandled jump %d", b->jmp.type); From 2c2db15995ce6c0f362d65e174d5a1b933057b80 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 25 Feb 2017 14:48:15 -0500 Subject: [PATCH 072/286] do sign/zero extensions removal in copy.c --- Makefile | 2 +- all.h | 11 ++++++++++- copy.c | 48 +++++++++++++++++++++++++++++++++++++++++++----- main.c | 1 - simpl.c | 46 ---------------------------------------------- ssa.c | 14 ++++++++++++-- 6 files changed, 66 insertions(+), 56 deletions(-) delete mode 100644 simpl.c diff --git a/Makefile b/Makefile index 4040923..fc649f8 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ ABI = sysv V = @ OBJDIR = obj -SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c simpl.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c +SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c OBJ = $(SRC:%.c=$(OBJDIR)/%.o) CFLAGS += -Wall -Wextra -std=c99 -g -pedantic diff --git a/all.h b/all.h index f518a36..e70bffb 100644 --- a/all.h +++ b/all.h @@ -228,7 +228,7 @@ enum Op { Ostores, Ostored, #define isstore(o) (Ostoreb <= o && o <= Ostored) - Oloadsb, /* needs to match OExt (mem.c) */ + Oloadsb, /* must match Oext and Tmp.width */ Oloadub, Oloadsh, Oloaduh, @@ -407,6 +407,15 @@ struct Tmp { } hint; int phi; Alias alias; + enum { + WFull, + Wsb, /* must match Oload/Oext order */ + Wub, + Wsh, + Wuh, + Wsw, + Wuw + } width; int visit; }; diff --git a/copy.c b/copy.c index bcb7b4d..7442306 100644 --- a/copy.c +++ b/copy.c @@ -51,13 +51,51 @@ visitphi(Phi *p, Ref *cp, RList ***pw) update(p->to, r, cp, pw); } +static int +iscopy(Ins *i, Ref r, Fn *fn) +{ + static bits extcpy[] = { + [WFull] = 0, + [Wsb] = BIT(Wsb) | BIT(Wsh) | BIT(Wsw), + [Wub] = BIT(Wub) | BIT(Wuh) | BIT(Wuw), + [Wsh] = BIT(Wsh) | BIT(Wsw), + [Wuh] = BIT(Wuh) | BIT(Wuw), + [Wsw] = BIT(Wsw), + [Wuw] = BIT(Wuw), + }; + int k, w; + Tmp *t; + + if (i->op == Ocopy) + return 1; + if (!isext(i->op)) + return 0; + if (i->op == Oextsw || i->op == Oextuw) + if (i->cls == Kw) + return 1; + if (rtype(r) == RTmp) { + t = &fn->tmp[r.val]; + w = t->width; + k = t->cls; + assert(k == Kw || k == Kl); + } else { + assert(rtype(r) == RCon); + w = WFull; + k = Kl; + } + if (i->cls == Kl && k == Kw) + /* not enough bits in r */ + return 0; + return (BIT(Wsb + (i->op - Oextsb)) & extcpy[w]) != 0; +} + static void -visitins(Ins *i, Ref *cp, RList ***pw) +visitins(Ins *i, Ref *cp, RList ***pw, Fn *fn) { Ref r; - if (i->op == Ocopy) { - r = copyof(i->arg[0], cp); + r = copyof(i->arg[0], cp); + if (iscopy(i, r, fn)) { update(i->to, r, cp, pw); } else if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); @@ -91,7 +129,7 @@ copy(Fn *fn) for (p=b->phi; p; p=p->link) visitphi(p, cp, &pw); for (i=b->ins; i-b->ins < b->nins; i++) - visitins(i, cp, &pw); + visitins(i, cp, &pw, fn); } while ((w1=w)) { t = w->t; @@ -103,7 +141,7 @@ copy(Fn *fn) visitphi(u->u.phi, cp, &pw); break; case UIns: - visitins(u->u.ins, cp, &pw); + visitins(u->u.ins, cp, &pw, fn); break; case UJmp: break; diff --git a/main.c b/main.c index 1a8973f..fe68ae0 100644 --- a/main.c +++ b/main.c @@ -59,7 +59,6 @@ func(Fn *fn) loadopt(fn); filluse(fn); ssacheck(fn); - simpl(fn); copy(fn); filluse(fn); fold(fn); diff --git a/simpl.c b/simpl.c deleted file mode 100644 index 384a8da..0000000 --- a/simpl.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "all.h" - -static void -elimext(Ins *i, int ext, Fn *fn) -{ - Tmp *t; - Use *u; - - assert(rtype(i->to) == RTmp); - t = &fn->tmp[i->to.val]; - for (u=t->use; u<&t->use[t->nuse]; u++) - if (u->type == UIns - && u->u.ins->op == ext - && (u->u.ins->cls == i->cls || i->cls == Kl)) { - u->u.ins->op = Ocopy; - elimext(u->u.ins, ext, fn); - } -} - -/* requires & preserves uses */ -void -simpl(Fn *fn) -{ - Blk *b; - Ins *i; - int ext; - - for (b=fn->start; b; b=b->link) - for (i=b->ins; i<&b->ins[b->nins]; i++) - switch (i->op) { - case Oloadsb: - case Oloadub: - case Oloadsh: - case Oloaduh: - ext = Oextsb + (i->op - Oloadsb); - goto Elimext; - case Oextsb: - case Oextub: - case Oextsh: - case Oextuh: - ext = i->op; - Elimext: - elimext(i, ext, fn); - break; - } -} diff --git a/ssa.c b/ssa.c index 8a28eeb..632ebbe 100644 --- a/ssa.c +++ b/ssa.c @@ -31,7 +31,7 @@ adduse(Tmp *tmp, int ty, Blk *b, ...) va_end(ap); } -/* fill usage, phi, and class information +/* fill usage, width, phi, and class information * must not change .visit fields */ void @@ -40,7 +40,7 @@ filluse(Fn *fn) Blk *b; Phi *p; Ins *i; - int m, t; + int m, t, w; uint a; Tmp *tmp; @@ -51,6 +51,7 @@ filluse(Fn *fn) tmp[t].nuse = 0; tmp[t].phi = 0; tmp[t].cls = 0; + tmp[t].width = WFull; if (tmp[t].use == 0) tmp[t].use = vnew(0, sizeof(Use), Pfn); } @@ -72,7 +73,16 @@ filluse(Fn *fn) for (i=b->ins; i-b->ins < b->nins; i++) { if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); + w = WFull; + if (isload(i->op) && i->op != Oload) + w = Wsb + (i->op - Oloadsb); + if (isext(i->op)) + w = Wsb + (i->op - Oextsb); + if (w == Wsw || w == Wuw) + if (i->cls == Kw) + w = WFull; t = i->to.val; + tmp[t].width = w; tmp[t].ndef++; tmp[t].cls = i->cls; } From da9a30bd77fd2fd49d801e23b816e7310c2004a8 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 27 Feb 2017 09:38:02 -0500 Subject: [PATCH 073/286] cosmetic fixes --- copy.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/copy.c b/copy.c index 7442306..55c31b2 100644 --- a/copy.c +++ b/copy.c @@ -63,30 +63,23 @@ iscopy(Ins *i, Ref r, Fn *fn) [Wsw] = BIT(Wsw), [Wuw] = BIT(Wuw), }; - int k, w; + bits b; Tmp *t; if (i->op == Ocopy) return 1; - if (!isext(i->op)) + if (!isext(i->op) || rtype(r) != RTmp) return 0; if (i->op == Oextsw || i->op == Oextuw) if (i->cls == Kw) return 1; - if (rtype(r) == RTmp) { - t = &fn->tmp[r.val]; - w = t->width; - k = t->cls; - assert(k == Kw || k == Kl); - } else { - assert(rtype(r) == RCon); - w = WFull; - k = Kl; - } - if (i->cls == Kl && k == Kw) - /* not enough bits in r */ + + t = &fn->tmp[r.val]; + assert(KBASE(t->cls) == 0); + if (i->cls == Kl && t->cls == Kw) return 0; - return (BIT(Wsb + (i->op - Oextsb)) & extcpy[w]) != 0; + b = extcpy[t->width]; + return (BIT(Wsb + (i->op-Oextsb)) & b) != 0; } static void From 3aecf460f5ab60c96ba90042ffd1cd7df41eeca5 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 27 Feb 2017 09:48:49 -0500 Subject: [PATCH 074/286] update license years --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 0b358b4..d8d21af 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -© 2015-2016 Quentin Carbonneaux +© 2015-2017 Quentin Carbonneaux Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), From e80252a52bf25f762bc986ce6e4e0d17fbb130d0 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 27 Feb 2017 10:34:22 -0500 Subject: [PATCH 075/286] scrub assembly output Notably, this adds a new pass to get rid of jumps on jumps. --- all.h | 1 + cfg.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ emit.c | 11 +++++++---- main.c | 3 +++ 4 files changed, 55 insertions(+), 4 deletions(-) diff --git a/all.h b/all.h index e70bffb..124a8d2 100644 --- a/all.h +++ b/all.h @@ -576,6 +576,7 @@ int dom(Blk *, Blk *); void fillfron(Fn *); void loopiter(Fn *, void (*)(Blk *, Blk *)); void fillloop(Fn *); +void simpljmp(Fn *); /* mem.c */ void memopt(Fn *); diff --git a/cfg.c b/cfg.c index e210589..e695f39 100644 --- a/cfg.c +++ b/cfg.c @@ -278,3 +278,47 @@ fillloop(Fn *fn) b->loop = 1; loopiter(fn, multloop); } + +static void +uffind(Blk **pb, Blk **uf, Fn *fn) +{ + Blk **pb1; + + pb1 = &uf[(*pb)->id]; + if (*pb1 != *pb) + uffind(pb1, uf, fn); + *pb = *pb1; +} + +/* requires rpo and no phis, breaks cfg */ +void +simpljmp(Fn *fn) +{ + + Blk **uf; /* union-find */ + Blk *b; + uint n; + int c; + + uf = alloc(fn->nblk * sizeof uf[0]); + for (n=0; nnblk; n++) + uf[n] = fn->rpo[n]; + for (b=fn->start; b; b=b->link) { + assert(!b->phi); + if (b->nins == 0) + if (b->jmp.type == Jjmp) + uf[b->id] = b->s1; + } + for (b=fn->start; b; b=b->link) { + if (b->s1) + uffind(&b->s1, uf, fn); + if (b->s2) + uffind(&b->s2, uf, fn); + c = b->jmp.type - Jxjc; + if (0 <= c && c <= NXICmp) + if (b->s1 == b->s2) { + b->jmp.type = Jjmp; + b->s2 = 0; + } + } +} diff --git a/emit.c b/emit.c index c3a274b..138bc1d 100644 --- a/emit.c +++ b/emit.c @@ -505,7 +505,7 @@ emitfn(Fn *fn, FILE *f) static int id0; Blk *b, *s; Ins *i, itmp; - int *r, c, fs, o, n; + int *r, c, fs, o, n, lbl; fprintf(f, ".text\n"); if (fn->export) @@ -532,11 +532,12 @@ emitfn(Fn *fn, FILE *f) emitf("pushq %L0", &itmp, fn, f); } - for (b=fn->start; b; b=b->link) { - fprintf(f, "%sbb%d:\n", locprefix, id0+b->id); - fprintf(f, "/* @%s */\n", b->name); + for (lbl=0, b=fn->start; b; b=b->link) { + if (lbl || b->npred > 1) + fprintf(f, "%sbb%d:\n", locprefix, id0+b->id); for (i=b->ins; i!=&b->ins[b->nins]; i++) emitins(*i, fn, f); + lbl = 1; switch (b->jmp.type) { case Jret0: for (r=&rclob[NRClob]; r>rclob;) @@ -554,6 +555,8 @@ emitfn(Fn *fn, FILE *f) if (b->s1 != b->link) fprintf(f, "\tjmp %sbb%d\n", locprefix, id0+b->s1->id); + else + lbl = 0; break; default: c = b->jmp.type - Jxjc; diff --git a/main.c b/main.c index fe68ae0..4d2e6bd 100644 --- a/main.c +++ b/main.c @@ -72,6 +72,9 @@ func(Fn *fn) spill(fn); rega(fn); fillrpo(fn); + simpljmp(fn); + fillpreds(fn); + fillrpo(fn); assert(fn->rpo[0] == fn->start); for (n=0;; n++) if (n == fn->nblk-1) { From 7432b0a64761aa07f95ad19761c61bf11db428e9 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 27 Feb 2017 11:14:32 -0500 Subject: [PATCH 076/286] fix int parsing The spec says that numbers can be arbitrarily big, and only the last 64 bits will be taken into consideration. Calling sscanf does not implement this, so I wrote an ad-hoc function. --- parse.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index 38481aa..edb6c29 100644 --- a/parse.c +++ b/parse.c @@ -254,6 +254,29 @@ lexinit() done = 1; } +static int64_t +getint() +{ + uint64_t n; + int c, m; + + n = 0; + c = fgetc(inf); + m = 0; + switch (c) { + case '-': m = 1; + case '+': c = fgetc(inf); + } + do { + n = 10*n + (c - '0'); + c = fgetc(inf); + } while ('0' <= c && c <= '9'); + ungetc(c, inf); + if (m) + n = 1 + ~n; + return *(int64_t *)&n; +} + static int lex() { @@ -312,8 +335,7 @@ lex() } if (isdigit(c) || c == '-' || c == '+') { ungetc(c, inf); - if (fscanf(inf, "%"SCNd64, &tokval.num) != 1) - err("invalid integer literal"); + tokval.num = getint(); return Tint; } if (c == '"') { From 4c3c80e7e17e13ffc5a73d2563156d823c800b63 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 27 Feb 2017 11:54:55 -0500 Subject: [PATCH 077/286] minor tweaks to simpljmp pass --- cfg.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cfg.c b/cfg.c index e695f39..2f681ce 100644 --- a/cfg.c +++ b/cfg.c @@ -285,9 +285,10 @@ uffind(Blk **pb, Blk **uf, Fn *fn) Blk **pb1; pb1 = &uf[(*pb)->id]; - if (*pb1 != *pb) + if (*pb1) { uffind(pb1, uf, fn); - *pb = *pb1; + *pb = *pb1; + } } /* requires rpo and no phis, breaks cfg */ @@ -297,12 +298,9 @@ simpljmp(Fn *fn) Blk **uf; /* union-find */ Blk *b; - uint n; int c; - uf = alloc(fn->nblk * sizeof uf[0]); - for (n=0; nnblk; n++) - uf[n] = fn->rpo[n]; + uf = emalloc(fn->nblk * sizeof uf[0]); for (b=fn->start; b; b=b->link) { assert(!b->phi); if (b->nins == 0) @@ -321,4 +319,5 @@ simpljmp(Fn *fn) b->s2 = 0; } } + free(uf); } From f151e426585ef86e3b4295bbe02f5c9072b58ea4 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 27 Feb 2017 12:01:44 -0500 Subject: [PATCH 078/286] remove unused parameter from uffind() --- cfg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cfg.c b/cfg.c index 2f681ce..dff0765 100644 --- a/cfg.c +++ b/cfg.c @@ -280,13 +280,13 @@ fillloop(Fn *fn) } static void -uffind(Blk **pb, Blk **uf, Fn *fn) +uffind(Blk **pb, Blk **uf) { Blk **pb1; pb1 = &uf[(*pb)->id]; if (*pb1) { - uffind(pb1, uf, fn); + uffind(pb1, uf); *pb = *pb1; } } @@ -309,9 +309,9 @@ simpljmp(Fn *fn) } for (b=fn->start; b; b=b->link) { if (b->s1) - uffind(&b->s1, uf, fn); + uffind(&b->s1, uf); if (b->s2) - uffind(&b->s2, uf, fn); + uffind(&b->s2, uf); c = b->jmp.type - Jxjc; if (0 <= c && c <= NXICmp) if (b->s1 == b->s2) { From 1a313306d6b5a3587aac12bd0093876e84386b03 Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Mon, 27 Feb 2017 18:02:44 +0100 Subject: [PATCH 079/286] add install and uninstall targets to Makefile --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index fc649f8..04ebdad 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,13 @@ config.h: *) echo "#define Defaultasm Gaself" ;; \ esac > $@ +install: $(OBJDIR)/$(BIN) + mkdir -p "$(DESTDIR)/$(PREFIX)/bin/" + cp $< "$(DESTDIR)/$(PREFIX)/bin/" + +uninstall: + rm -f "$(DESTDIR)/$(PREFIX)/bin/$(BIN)" + clean: rm -fr $(OBJDIR) From c6f8985c23217011df01a73447c98244fb63b20a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 27 Feb 2017 12:52:24 -0500 Subject: [PATCH 080/286] make install/uninstall phonies --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 04ebdad..f8e3da0 100644 --- a/Makefile +++ b/Makefile @@ -56,4 +56,4 @@ check: $(OBJDIR)/$(BIN) }" < $$F; \ done -.PHONY: clean clean-gen check 80 syndoc +.PHONY: clean clean-gen check 80 install uninstall From 02408ffd8f95a4334212e1d64de987f9192cb4d5 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 1 Mar 2017 11:16:28 -0500 Subject: [PATCH 081/286] add another idiomatic C test (rega does no good) --- test/strspn.ssa | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 test/strspn.ssa diff --git a/test/strspn.ssa b/test/strspn.ssa new file mode 100644 index 0000000..a64ea19 --- /dev/null +++ b/test/strspn.ssa @@ -0,0 +1,77 @@ +# the C strspn function generated by scc + +export function w $strspn_(l %s1.81.val,l %s2.82.val) +{ +@.64 + %s1.81 =l alloc8 8 + %s2.82 =l alloc8 8 + %n.83 =l alloc4 4 + %c.84 =l alloc4 4 + %p.85 =l alloc8 8 + storel %s1.81.val,%s1.81 + storel %s2.82.val,%s2.82 + storew 0,%n.83 + jmp @.27 +@.28 + %.39 =l loadl %s2.82 + storel %.39,%p.85 + jmp @.29 +@.30 +@.31 + %.40 =l loadl %p.85 + %.41 =l add %.40,1 + storel %.41,%p.85 +@.29 + %.43 =l loadl %p.85 + %.44 =w loadsb %.43 + %.45 =w extsb %.44 + %.46 =w cnew %.45,0 + jnz %.46,@.42,@.36 +@.42 + %.47 =l loadl %p.85 + %.48 =w loadsb %.47 + %.49 =w extsb %.48 + %.50 =w loadsw %c.84 + %.51 =w cnew %.49,%.50 + jnz %.51,@.30,@.36 +@.36 +@.32 + %.52 =l loadl %p.85 + %.53 =w loadsb %.52 + %.54 =w extsb %.53 + %.55 =w cnew %.54,0 + jnz %.55,@.33,@.37 +@.37 + jmp @.34 +@.33 +@.35 + %.56 =w loaduw %n.83 + %.57 =w add %.56,1 + storew %.57,%n.83 +@.27 + %.58 =l loadl %s1.81 + %.59 =l add %.58,1 + storel %.59,%s1.81 + %.60 =w loadsb %.58 + %.61 =w extsb %.60 + storew %.61,%c.84 + %.62 =w cnew %.61,0 + jnz %.62,@.28,@.38 +@.38 +@.34 + %.63 =w loaduw %n.83 + ret %.63 +} + +# >>> driver +# extern unsigned strspn_(const char *, const char *); +# int main() { +# return !( +# strspn_("", "abc") == 0 && +# strspn_("abc", "") == 0 && +# strspn_("abc", "bac") == 3 && +# strspn_("xabc", "bac") == 0 && +# strspn_("axbc", "bca") == 1 +# ); +# } +# <<< From 81e2fdacc536dab7ad3c1e1da313b80f5ae935b7 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 29 Mar 2017 00:16:46 -0400 Subject: [PATCH 082/286] improve global registers handling The register allocation now has stricter assertions about global registers. The stricter assertions required changes in the spiller: We now correctly indicate to the register allocator what registers are used by "ret" instructions. --- rega.c | 12 ++++++++---- spill.c | 16 ++++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/rega.c b/rega.c index 9f02a63..3d83327 100644 --- a/rega.c +++ b/rega.c @@ -135,6 +135,7 @@ rfree(RMap *m, int t) { int i, r; + assert(t >= Tmp0 || !(BIT(t) & RGLOB)); if (!bshas(m->b, t)) return -1; for (i=0; m->t[i] != t; i++) @@ -145,6 +146,7 @@ rfree(RMap *m, int t) m->n--; memmove(&m->t[i], &m->t[i+1], (m->n-i) * sizeof m->t[0]); memmove(&m->r[i], &m->r[i+1], (m->n-i) * sizeof m->r[0]); + assert(t >= Tmp0 || t == r); return r; } @@ -385,13 +387,15 @@ doblk(Blk *b, RMap *cur) default: if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); - r = rfree(cur, i->to.val); - if (r == -1 && !isreg(i->to)) { + r = i->to.val; + if (r >= Tmp0 || !(BIT(r) & RGLOB)) + r = rfree(cur, r); + if (r == -1) { + assert(!isreg(i->to)); *i = (Ins){.op = Onop}; continue; } - if (i->to.val >= Tmp0) - i->to = TMP(r); + i->to = TMP(r); } break; } diff --git a/spill.c b/spill.c index 5e2b9ec..0872fd5 100644 --- a/spill.c +++ b/spill.c @@ -298,7 +298,8 @@ void spill(Fn *fn) { Blk *b, *s1, *s2, *hd, **bp; - int j, n, l, t, k, lvarg[2]; + int j, l, t, k, lvarg[2]; + uint n; BSet u[1], v[1], w[1]; Ins *i; Phi *p; @@ -340,7 +341,6 @@ spill(Fn *fn) if (s2 && s2->id <= b->id) if (!hd || s2->id >= hd->id) hd = s2; - r = 0; if (hd) { /* back-edge */ bszero(v); @@ -352,8 +352,8 @@ spill(Fn *fn) bscopy(w, u); bsinter(u, hd->gen); bsdiff(w, hd->gen); - if ((int)bscount(u) < n) { /* fixme */ - j = bscount(w); /* live through */ + if (bscount(u) < n) { + j = bscount(w); /* live through */ l = hd->nlive[k]; limit(w, n - (l - j), 0); bsunion(u, w); @@ -370,14 +370,18 @@ spill(Fn *fn) bsunion(v, u); } limit2(v, 0, 0, w); - } else + } else { bscopy(v, b->out); + if (rtype(b->jmp.arg) == RCall) + v->t[0] |= retregs(b->jmp.arg, 0); + } for (t=Tmp0; bsiter(b->out, &t); t++) if (!bshas(v, t)) slot(t); bscopy(b->out, v); /* 2. process the block instructions */ + r = v->t[0] & (BIT(Tmp0)-1); curi = &insb[NIns]; for (i=&b->ins[b->nins]; i!=b->ins;) { i--; @@ -449,7 +453,7 @@ spill(Fn *fn) if (r) sethint(v, r); } - assert(!(r & ~RGLOB) || b==fn->start); + assert(r == RGLOB || b == fn->start); for (p=b->phi; p; p=p->link) { assert(rtype(p->to) == RTmp); From 9d1c38d69547d835f7228651e71e8a7d744c456d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:11:33 -0400 Subject: [PATCH 083/286] fix bug in union size computation The size of a union is the size of the largest element aligned with the largest alignment. For example, the size of the following union is 16, not 13 (as returned before this patch). union { char c[13]; int i; }; --- parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parse.c b/parse.c index edb6c29..b393fc2 100644 --- a/parse.c +++ b/parse.c @@ -960,9 +960,9 @@ parseseg(Seg *seg, Typ *ty, int t) err(", or } expected"); seg[n].type = SEnd; a = 1 << al; - sz = (sz + a - 1) & -a; - if (sz >= ty->size) - ty->size = sz; + if (sz < ty->size) + sz = ty->size; + ty->size = (sz + a - 1) & -a; ty->align = al; } From 49a4593c335126ba279f47328824abfef379725e Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:06:33 -0400 Subject: [PATCH 084/286] prepare for multi-target This big diff does multiple changes to allow the addition of new targets to qbe. The changes are listed below in decreasing order of impact. 1. Add a new Target structure. To add support for a given target, one has to implement all the members of the Target structure. All the source files where changed to use this interface where needed. 2. Single out amd64-specific code. In this commit, the amd64 target T_amd64_sysv is the only target available, it is implemented in the amd64/ directory. All the non-static items in this directory are prefixed with either amd64_ or amd64_sysv (for items that are specific to the System V ABI). 3. Centralize Ops information. There is now a file 'ops.h' that must be used to store all the available operations together with their metadata. The various targets will only select what they need; but it is beneficial that there is only *one* place to change to add a new instruction. One good side effect of this change is that any operation 'xyz' in the IL now as a corresponding 'Oxyz' in the code. 4. Misc fixes. One notable change is that instruction selection now generates generic comparison operations and the lowering to the target's comparisons is done in the emitter. GAS directives for data are the same for many targets, so data emission was extracted in a file 'gas.c'. 5. Modularize the Makefile. The Makefile now has a list of C files that are target-independent (SRC), and one list of C files per target. Each target can also use its own 'all.h' header (for example to define registers). --- Makefile | 28 +++- all.h | 334 +++++++++++++---------------------------- amd64/all.h | 70 +++++++++ emit.c => amd64/emit.c | 225 ++++++--------------------- isel.c => amd64/isel.c | 78 ++-------- sysv.c => amd64/sysv.c | 47 ++---- amd64/targ.c | 30 ++++ cfg.c | 4 +- fold.c | 62 ++++---- gas.c | 122 +++++++++++++++ live.c | 30 ++-- main.c | 68 ++++++--- mem.c | 4 +- ops.h | 167 +++++++++++++++++++++ parse.c | 144 ++++-------------- rega.c | 38 ++--- spill.c | 32 ++-- util.c | 90 +++++++++++ 18 files changed, 852 insertions(+), 721 deletions(-) create mode 100644 amd64/all.h rename emit.c => amd64/emit.c (74%) rename isel.c => amd64/isel.c (89%) rename sysv.c => amd64/sysv.c (94%) create mode 100644 amd64/targ.c create mode 100644 gas.c create mode 100644 ops.h diff --git a/Makefile b/Makefile index f8e3da0..2433e25 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,15 @@ BIN = qbe -ABI = sysv V = @ OBJDIR = obj -SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c fold.c live.c $(ABI).c isel.c spill.c rega.c emit.c -OBJ = $(SRC:%.c=$(OBJDIR)/%.o) +SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c \ + fold.c live.c spill.c rega.c gas.c +AMD64SRC = amd64/targ.c amd64/sysv.c amd64/isel.c amd64/emit.c +SRCALL = $(SRC) $(AMD64SRC) + +AMD64OBJ = $(AMD64SRC:%.c=$(OBJDIR)/%.o) +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) CFLAGS += -Wall -Wextra -std=c99 -g -pedantic @@ -19,15 +23,23 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/timestamp $(OBJDIR)/timestamp: @mkdir -p $(OBJDIR) + @mkdir -p $(OBJDIR)/amd64 @touch $@ -$(OBJ): all.h +$(OBJ): all.h ops.h +$(AMD64OBJ): amd64/all.h obj/main.o: config.h config.h: - @case `uname` in \ - *Darwin*) echo "#define Defaultasm Gasmacho" ;; \ - *) echo "#define Defaultasm Gaself" ;; \ + @case `uname` in \ + *Darwin*) \ + echo "#define Defasm Gasmacho"; \ + echo "#define Deftgt T_amd64_sysv"; \ + ;; \ + *) \ + echo "#define Defasm Gaself"; \ + echo "#define Deftgt T_amd64_sysv"; \ + ;; \ esac > $@ install: $(OBJDIR)/$(BIN) @@ -47,7 +59,7 @@ check: $(OBJDIR)/$(BIN) tools/unit.sh all 80: - @for F in $(SRC); \ + @for F in $(SRCALL); \ do \ awk "{ \ gsub(/\\t/, \" \"); \ diff --git a/all.h b/all.h index 124a8d2..c0e08fe 100644 --- a/all.h +++ b/all.h @@ -8,13 +8,14 @@ #define MAKESURE(what, x) typedef char make_sure_##what[(x)?1:-1] #define die(...) die_(__FILE__, __VA_ARGS__) +typedef unsigned char uchar; typedef unsigned int uint; typedef unsigned long ulong; typedef unsigned long long bits; typedef struct BSet BSet; typedef struct Ref Ref; -typedef struct OpDesc OpDesc; +typedef struct Op Op; typedef struct Ins Ins; typedef struct Phi Phi; typedef struct Blk Blk; @@ -27,6 +28,7 @@ typedef struct Fn Fn; typedef struct Typ Typ; typedef struct Seg Seg; typedef struct Dat Dat; +typedef struct Target Target; enum { NString = 32, @@ -38,61 +40,29 @@ enum { NBit = CHAR_BIT * sizeof(bits), }; -#define BIT(n) ((bits)1 << (n)) - -enum Reg { - RXX, - - RAX, /* caller-save */ - RCX, - RDX, - RSI, - RDI, - R8, - R9, - R10, - R11, - - RBX, /* callee-save */ - R12, - R13, - R14, - R15, - - RBP, /* globally live */ - RSP, -#define RGLOB (BIT(RBP)|BIT(RSP)) - - XMM0, /* sse */ - XMM1, - XMM2, - XMM3, - XMM4, - XMM5, - XMM6, - XMM7, - XMM8, - XMM9, - XMM10, - XMM11, - XMM12, - XMM13, - XMM14, - XMM15, - - Tmp0, /* first non-reg temporary */ - - NRGlob = 2, - NIReg = R15 - RAX + 1 + NRGlob, - NFReg = XMM14 - XMM0 + 1, /* XMM15 is reserved */ - NISave = R11 - RAX + 1, - NFSave = NFReg, - NRSave = NISave + NFSave, - NRClob = R15 - RBX + 1, +struct Target { + int gpr0; /* first general purpose reg */ + int ngpr; + int fpr0; /* first floating point reg */ + int nfpr; + bits rglob; /* globally live regs (e.g., sp, fp) */ + int nrglob; + int *rsave; /* caller-save */ + int nrsave[2]; + bits (*retregs)(Ref, int[2]); + bits (*argregs)(Ref, int[2]); + int (*memargs)(int); + void (*abi)(Fn *); + void (*isel)(Fn *); + void (*emitfn)(Fn *, FILE *); }; -MAKESURE(NBit_is_enough, NBit >= (int)Tmp0); +#define BIT(n) ((bits)1 << (n)) +enum { + RXX = 0, + Tmp0 = NBit, /* first non-reg temporary */ +}; struct BSet { uint nt; @@ -139,51 +109,81 @@ static inline int isreg(Ref r) return rtype(r) == RTmp && r.val < Tmp0; } -enum ICmp { -#define ICMPS(X) \ - X(ule) \ - X(ult) \ - X(sle) \ - X(slt) \ - X(sgt) \ - X(sge) \ - X(ugt) \ - X(uge) \ - X(eq) \ - X(ne) /* make sure icmpop() below works! */ - -#define X(c) IC##c, - ICMPS(X) -#undef X - NICmp, +enum CmpI { + Cieq, + Cine, + Cisge, + Cisgt, + Cisle, + Cislt, + Ciuge, + Ciugt, + Ciule, + Ciult, + NCmpI, +}; - ICxnp = NICmp, /* x64 specific */ - ICxp, - NXICmp +enum CmpF { + Cfeq, + Cfge, + Cfgt, + Cfle, + Cflt, + Cfne, + Cfo, + Cfuo, + NCmpF, + NCmp = NCmpI + NCmpF, }; -static inline int icmpop(int c) -{ - return c >= ICeq ? c : ICuge - c; -} +enum O { + Oxxx, +#define O(op, x, y) O##op, + #include "ops.h" + NOp, +}; -enum FCmp { -#define FCMPS(X) \ - X(le) \ - X(lt) \ - X(gt) \ - X(ge) \ - X(ne) \ - X(eq) \ - X(o) \ - X(uo) - -#define X(c) FC##c, - FCMPS(X) +enum J { + Jxxx, +#define JMPS(X) \ + X(ret0) X(retw) X(retl) X(rets) \ + X(retd) X(retc) X(jmp) X(jnz) \ + X(jfieq) X(jfine) X(jfisge) X(jfisgt) \ + X(jfisle) X(jfislt) X(jfiuge) X(jfiugt) \ + X(jfiule) X(jfiult) X(jffeq) X(jffge) \ + X(jffgt) X(jffle) X(jfflt) X(jffne) \ + X(jffo) X(jffuo) +#define X(j) J##j, + JMPS(X) #undef X - NFCmp + NJmp +}; + +enum { + Ocmpw = Oceqw, + Ocmpw1 = Ocultw, + Ocmpl = Oceql, + Ocmpl1 = Ocultl, + Ocmps = Oceqs, + Ocmps1 = Ocuos, + Ocmpd = Oceqd, + Ocmpd1 = Ocuod, + Oalloc = Oalloc4, + Oalloc1 = Oalloc16, + Oflag = Oflagieq, + Oflag1 = Oflagfuo, + NPubOp = Onop, + Jjf = Jjfieq, + Jjf1 = Jjffuo, }; +#define isstore(o) (Ostoreb <= o && o <= Ostored) +#define isload(o) (Oloadsb <= o && o <= Oload) +#define isext(o) (Oextsb <= o && o <= Oextuw) +#define ispar(o) (Opar <= o && o <= Opare) +#define isarg(o) (Oarg <= o && o <= Oarge) +#define isret(j) (Jret0 <= j && j <= Jretc) + enum Class { Kx = -1, /* "top" class (see usecheck() and clsmerge()) */ Kw, @@ -195,124 +195,10 @@ enum Class { #define KWIDE(k) ((k)&1) #define KBASE(k) ((k)>>1) -enum Op { - Oxxx, - - /* public instructions */ - Oadd, - Osub, - Odiv, - Orem, - Oudiv, - Ourem, - Omul, - Oand, - Oor, - Oxor, - Osar, - Oshr, - Oshl, - Ocmpw, - Ocmpw1 = Ocmpw + NICmp-1, - Ocmpl, - Ocmpl1 = Ocmpl + NICmp-1, - Ocmps, - Ocmps1 = Ocmps + NFCmp-1, - Ocmpd, - Ocmpd1 = Ocmpd + NFCmp-1, - - Ostoreb, - Ostoreh, - Ostorew, - Ostorel, - Ostores, - Ostored, -#define isstore(o) (Ostoreb <= o && o <= Ostored) - Oloadsb, /* must match Oext and Tmp.width */ - Oloadub, - Oloadsh, - Oloaduh, - Oloadsw, - Oloaduw, - Oload, -#define isload(o) (Oloadsb <= o && o <= Oload) - Oextsb, - Oextub, - Oextsh, - Oextuh, - Oextsw, - Oextuw, -#define isext(o) (Oextsb <= o && o <= Oextuw) - - Oexts, - Otruncd, - Ostosi, - Odtosi, - Oswtof, - Osltof, - Ocast, - - Oalloc, - Oalloc1 = Oalloc + NAlign-1, - - Ovastart, - Ovaarg, - - Ocopy, - NPubOp, - - /* function instructions */ - Opar = NPubOp, - Oparc, - Opare, -#define ispar(o) (Opar <= o && o <= Opare) - Oarg, - Oargc, - Oarge, -#define isarg(o) (Oarg <= o && o <= Oarge) - Ocall, - Ovacall, - - /* reserved instructions */ - Onop, - Oaddr, - Oswap, - Osign, - Osalloc, - Oxidiv, - Oxdiv, - Oxcmp, - Oxset, - Oxsetnp = Oxset + ICxnp, - Oxsetp = Oxset + ICxp, - Oxtest, - NOp -}; - -enum Jmp { - Jxxx, - Jret0, - Jretw, - Jretl, - Jrets, - Jretd, - Jretc, -#define isret(j) (Jret0 <= j && j <= Jretc) - Jjmp, - Jjnz, - Jxjc, - Jxjnp = Jxjc + ICxnp, - Jxjp = Jxjc + ICxp, - NJmp -}; - -struct OpDesc { +struct Op { char *name; - int nmem; short argcls[2][4]; - uint sflag:1; /* sets the zero flag */ - uint lflag:1; /* leaves flags */ - uint cfold:1; /* can fold */ + int canfold; }; struct Ins { @@ -437,7 +323,7 @@ struct Con { typedef struct Addr Addr; -struct Addr { /* x64 addressing */ +struct Addr { /* amd64 addressing */ Con offset; Ref base; Ref index; @@ -508,8 +394,8 @@ struct Dat { char export; }; - /* main.c */ +extern Target T; extern char debug['Z'+1]; /* util.c */ @@ -524,6 +410,8 @@ void die_(char *, char *, ...) __attribute__((noreturn)); void *emalloc(size_t); void *alloc(size_t); void freeall(void); +int argcls(Ins *, int); +int iscmp(int, int *, int *); void emit(int, int, Ref, Ref, Ref); void emiti(Ins); void idup(Ins **, Ins *, ulong); @@ -531,12 +419,15 @@ Ins *icpy(Ins *, Ins *, ulong); void *vnew(ulong, size_t, Pool); void vfree(void *); void vgrow(void *, ulong); +int cmpop(int); +int cmpneg(int); int clsmerge(short *, short); int phicls(int, Tmp *); Ref newtmp(char *, int, Fn *); void chuse(Ref, int, Fn *); Ref getcon(int64_t, Fn *); void addcon(Con *, Con *); +void blit(Ref, uint, Ref, uint, Fn *); void dumpts(BSet *, Tmp *, FILE *); void bsinit(BSet *, uint); @@ -559,7 +450,7 @@ bshas(BSet *bs, uint elt) } /* parse.c */ -extern OpDesc opdesc[NOp]; +extern Op optab[NOp]; void parse(FILE *, char *, void (Dat *), void (Fn *)); void printfn(Fn *, FILE *); void printref(Ref, Fn *, FILE *); @@ -611,16 +502,6 @@ void fold(Fn *); void liveon(BSet *, Blk *, Blk *); void filllive(Fn *); -/* abi: sysv.c */ -extern int rsave[/* NRSave */]; -extern int rclob[/* NRClob */]; -bits retregs(Ref, int[2]); -bits argregs(Ref, int[2]); -void abi(Fn *); - -/* isel.c */ -void isel(Fn *); - /* spill.c */ void fillcost(Fn *); void spill(Fn *); @@ -628,10 +509,9 @@ void spill(Fn *); /* rega.c */ void rega(Fn *); -/* emit.c */ -extern char *locprefix; -extern char *symprefix; -void emitfn(Fn *, FILE *); -void emitdat(Dat *, FILE *); -int stashfp(int64_t, int); -void emitfin(FILE *); +/* gas.c */ +extern char *gasloc; +extern char *gassym; +void gasemitdat(Dat *, FILE *); +int gasstashfp(int64_t, int); +void gasemitfin(FILE *); diff --git a/amd64/all.h b/amd64/all.h new file mode 100644 index 0000000..3a2db0e --- /dev/null +++ b/amd64/all.h @@ -0,0 +1,70 @@ +#include "../all.h" + +typedef struct Amd64Op Amd64Op; + +enum Amd64Reg { + RAX = RXX+1, /* caller-save */ + RCX, + RDX, + RSI, + RDI, + R8, + R9, + R10, + R11, + + RBX, /* callee-save */ + R12, + R13, + R14, + R15, + + RBP, /* globally live */ + RSP, + + XMM0, /* sse */ + XMM1, + XMM2, + XMM3, + XMM4, + XMM5, + XMM6, + XMM7, + XMM8, + XMM9, + XMM10, + XMM11, + XMM12, + XMM13, + XMM14, + XMM15, + + NFPR = XMM14 - XMM0 + 1, /* reserve XMM15 */ + NGPR = RSP - RAX + 1, + NGPS = R11 - RAX + 1, + NFPS = NFPR, + NCLR = R15 - RBX + 1, +}; +MAKESURE(reg_not_tmp, XMM15 < (int)Tmp0); + +struct Amd64Op { + char nmem; + char zflag; + char lflag; +}; + +/* targ.c */ +extern Amd64Op amd64_op[]; + +/* sysv.c (abi) */ +extern int amd64_sysv_rsave[]; +extern int amd64_sysv_rclob[]; +bits amd64_sysv_retregs(Ref, int[2]); +bits amd64_sysv_argregs(Ref, int[2]); +void amd64_sysv_abi(Fn *); + +/* isel.c */ +void amd64_isel(Fn *); + +/* emit.c */ +void amd64_emitfn(Fn *, FILE *); diff --git a/emit.c b/amd64/emit.c similarity index 74% rename from emit.c rename to amd64/emit.c index 138bc1d..eccbd02 100644 --- a/emit.c +++ b/amd64/emit.c @@ -1,6 +1,25 @@ #include "all.h" -char *locprefix, *symprefix; + +#define CMP(X) \ + X(Ciule, "be") \ + X(Ciult, "b") \ + X(Cisle, "le") \ + X(Cislt, "l") \ + X(Cisgt, "g") \ + X(Cisge, "ge") \ + X(Ciugt, "a") \ + X(Ciuge, "ae") \ + X(Cieq, "z") \ + X(Cine, "nz") \ + X(NCmpI+Cfle, "be") \ + X(NCmpI+Cflt, "b") \ + X(NCmpI+Cfgt, "a") \ + X(NCmpI+Cfge, "ae") \ + X(NCmpI+Cfeq, "z") \ + X(NCmpI+Cfne, "nz") \ + X(NCmpI+Cfo, "np") \ + X(NCmpI+Cfuo, "p") enum { SLong = 0, @@ -95,18 +114,10 @@ static struct { { Oxcmp, Kd, "comisd %D0, %D1" }, { Oxcmp, Ki, "cmp%k %0, %1" }, { Oxtest, Ki, "test%k %0, %1" }, - { Oxset+ICule, Ki, "setbe %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICult, Ki, "setb %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICsle, Ki, "setle %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICslt, Ki, "setl %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICsgt, Ki, "setg %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICsge, Ki, "setge %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICugt, Ki, "seta %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICuge, Ki, "setae %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICeq, Ki, "setz %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICne, Ki, "setnz %B=\n\tmovzb%k %B=, %=" }, - { Oxset+ICxnp, Ki, "setnp %B=\n\tmovsb%k %B=, %=" }, - { Oxset+ICxp, Ki, "setp %B=\n\tmovsb%k %B=, %=" }, +#define X(c, s) \ + { Oflag+c, Ki, "set" s " %B=\n\tmovzb%k %B=, %=" }, + CMP(X) +#undef X { NOp, 0, 0 } }; @@ -153,9 +164,9 @@ emitcon(Con *con, FILE *f) switch (con->type) { case CAddr: if (con->local) - fprintf(f, "%s%s", locprefix, con->label); + fprintf(f, "%s%s", gasloc, con->label); else - fprintf(f, "%s%s", symprefix, con->label); + fprintf(f, "%s%s", gassym, con->label); if (con->bits.i) fprintf(f, "%+"PRId64, con->bits.i); break; @@ -356,7 +367,8 @@ emitins(Ins i, Fn *fn, FILE *f) /* this linear search should really be a binary * search */ if (omap[o].op == NOp) - die("no match for %s(%d)", opdesc[i.op].name, i.cls); + die("no match for %s(%d)", + optab[i.op].name, "wlsd"[i.cls]); if (omap[o].op == i.op) if (omap[o].cls == i.cls || (omap[o].cls == Ki && KBASE(i.cls) == 0) @@ -452,55 +464,26 @@ emitins(Ins i, Fn *fn, FILE *f) } } -static int -cneg(int cmp) -{ - switch (cmp) { - default: die("invalid int comparison %d", cmp); - case ICule: return ICugt; - case ICult: return ICuge; - case ICsle: return ICsgt; - case ICslt: return ICsge; - case ICsgt: return ICsle; - case ICsge: return ICslt; - case ICugt: return ICule; - case ICuge: return ICult; - case ICeq: return ICne; - case ICne: return ICeq; - case ICxnp: return ICxp; - case ICxp: return ICxnp; - } -} - static int framesz(Fn *fn) { int i, o, f; /* specific to NAlign == 3 */ - for (i=0, o=0; ireg >> rclob[i]); + for (i=0, o=0; ireg >> amd64_sysv_rclob[i]); f = fn->slot; f = (f + 3) & -4; return 4*f + 8*o + 176*fn->vararg; } void -emitfn(Fn *fn, FILE *f) +amd64_emitfn(Fn *fn, FILE *f) { static char *ctoa[] = { - [ICeq] = "z", - [ICule] = "be", - [ICult] = "b", - [ICsle] = "le", - [ICslt] = "l", - [ICsgt] = "g", - [ICsge] = "ge", - [ICugt] = "a", - [ICuge] = "ae", - [ICne] = "nz", - [ICxnp] = "np", - [ICxp] = "p" + #define X(c, s) [c] = s, + CMP(X) + #undef X }; static int id0; Blk *b, *s; @@ -509,24 +492,24 @@ emitfn(Fn *fn, FILE *f) fprintf(f, ".text\n"); if (fn->export) - fprintf(f, ".globl %s%s\n", symprefix, fn->name); + fprintf(f, ".globl %s%s\n", gassym, fn->name); fprintf(f, "%s%s:\n" "\tpushq %%rbp\n" "\tmovq %%rsp, %%rbp\n", - symprefix, fn->name + gassym, fn->name ); fs = framesz(fn); if (fs) fprintf(f, "\tsub $%d, %%rsp\n", fs); if (fn->vararg) { o = -176; - for (r=rsave; r-rsave<6; ++r, o+=8) + for (r=amd64_sysv_rsave; r<&amd64_sysv_rsave[6]; r++, o+=8) fprintf(f, "\tmovq %%%s, %d(%%rbp)\n", rname[*r][0], o); for (n=0; n<8; ++n, o+=16) fprintf(f, "\tmovaps %%xmm%d, %d(%%rbp)\n", n, o); } - for (r=rclob; r-rclob < NRClob; r++) + for (r=amd64_sysv_rclob; r<&amd64_sysv_rclob[NCLR]; r++) if (fn->reg & BIT(*r)) { itmp.arg[0] = TMP(*r); emitf("pushq %L0", &itmp, fn, f); @@ -534,13 +517,13 @@ emitfn(Fn *fn, FILE *f) for (lbl=0, b=fn->start; b; b=b->link) { if (lbl || b->npred > 1) - fprintf(f, "%sbb%d:\n", locprefix, id0+b->id); + fprintf(f, "%sbb%d:\n", gasloc, id0+b->id); for (i=b->ins; i!=&b->ins[b->nins]; i++) emitins(*i, fn, f); lbl = 1; switch (b->jmp.type) { case Jret0: - for (r=&rclob[NRClob]; r>rclob;) + for (r=&amd64_sysv_rclob[NCLR]; r>amd64_sysv_rclob;) if (fn->reg & BIT(*--r)) { itmp.arg[0] = TMP(*r); emitf("popq %L0", &itmp, fn, f); @@ -554,21 +537,21 @@ emitfn(Fn *fn, FILE *f) Jmp: if (b->s1 != b->link) fprintf(f, "\tjmp %sbb%d\n", - locprefix, id0+b->s1->id); + gasloc, id0+b->s1->id); else lbl = 0; break; default: - c = b->jmp.type - Jxjc; - if (0 <= c && c <= NXICmp) { + c = b->jmp.type - Jjf; + if (0 <= c && c <= NCmp) { if (b->link == b->s2) { s = b->s1; b->s1 = b->s2; b->s2 = s; } else - c = cneg(c); + c = cmpneg(c); fprintf(f, "\tj%s %sbb%d\n", ctoa[c], - locprefix, id0+b->s2->id); + gasloc, id0+b->s2->id); goto Jmp; } die("unhandled jump %d", b->jmp.type); @@ -576,121 +559,3 @@ emitfn(Fn *fn, FILE *f) } id0 += fn->nblk; } - -void -emitdat(Dat *d, FILE *f) -{ - static int align; - static char *dtoa[] = { - [DAlign] = ".align", - [DB] = "\t.byte", - [DH] = "\t.value", - [DW] = "\t.long", - [DL] = "\t.quad" - }; - - switch (d->type) { - case DStart: - align = 0; - fprintf(f, ".data\n"); - break; - case DEnd: - break; - case DName: - if (!align) - fprintf(f, ".align 8\n"); - if (d->export) - fprintf(f, ".globl %s%s\n", symprefix, d->u.str); - fprintf(f, "%s%s:\n", symprefix, d->u.str); - break; - case DZ: - fprintf(f, "\t.fill %"PRId64",1,0\n", d->u.num); - break; - default: - if (d->type == DAlign) - align = 1; - - if (d->isstr) { - if (d->type != DB) - err("strings only supported for 'b' currently"); - fprintf(f, "\t.ascii \"%s\"\n", d->u.str); - } - else if (d->isref) { - fprintf(f, "%s %s%+"PRId64"\n", - dtoa[d->type], d->u.ref.nam, - d->u.ref.off); - } - else { - fprintf(f, "%s %"PRId64"\n", - dtoa[d->type], d->u.num); - } - break; - } -} - -typedef struct FBits FBits; - -struct FBits { - union { - int64_t n; - float f; - double d; - } bits; - int wide; - FBits *link; -}; - -static FBits *stash; - -int -stashfp(int64_t n, int w) -{ - FBits **pb, *b; - int i; - - /* does a dumb de-dup of fp constants - * this should be the linker's job */ - for (pb=&stash, i=0; (b=*pb); pb=&b->link, i++) - if (n == b->bits.n && w == b->wide) - return i; - b = emalloc(sizeof *b); - b->bits.n = n; - b->wide = w; - b->link = 0; - *pb = b; - return i; -} - -void -emitfin(FILE *f) -{ - FBits *b; - int i; - - if (!stash) - return; - fprintf(f, "/* floating point constants */\n"); - fprintf(f, ".data\n.align 8\n"); - for (b=stash, i=0; b; b=b->link, i++) - if (b->wide) - fprintf(f, - "%sfp%d:\n" - "\t.quad %"PRId64 - " /* %f */\n", - locprefix, i, b->bits.n, - b->bits.d - ); - for (b=stash, i=0; b; b=b->link, i++) - if (!b->wide) - fprintf(f, - "%sfp%d:\n" - "\t.long %"PRId64 - " /* %lf */\n", - locprefix, i, b->bits.n & 0xffffffff, - b->bits.f - ); - while ((b=stash)) { - stash = b->link; - free(b); - } -} diff --git a/isel.c b/amd64/isel.c similarity index 89% rename from isel.c rename to amd64/isel.c index 6ce5dd0..1623b9b 100644 --- a/isel.c +++ b/amd64/isel.c @@ -27,46 +27,6 @@ struct ANum { static void amatch(Addr *, Ref, ANum *, Fn *, int); -static int -fcmptoi(int fc) -{ - switch (fc) { - default: die("invalid fp comparison %d", fc); - case FCle: return ICule; - case FClt: return ICult; - case FCgt: return ICugt; - case FCge: return ICuge; - case FCne: return ICne; - case FCeq: return ICeq; - case FCo: return ICxnp; - case FCuo: return ICxp; - } -} - -static int -iscmp(int op, int *pk, int *pc) -{ - if (Ocmpw <= op && op <= Ocmpw1) { - *pc = op - Ocmpw; - *pk = Kw; - } - else if (Ocmpl <= op && op <= Ocmpl1) { - *pc = op - Ocmpl; - *pk = Kl; - } - else if (Ocmps <= op && op <= Ocmps1) { - *pc = fcmptoi(op - Ocmps); - *pk = Ks; - } - else if (Ocmpd <= op && op <= Ocmpd1) { - *pc = fcmptoi(op - Ocmpd); - *pk = Kd; - } - else - return 0; - return 1; -} - static int noimm(Ref r, Fn *fn) { @@ -98,14 +58,8 @@ rslot(Ref r, Fn *fn) return fn->tmp[r.val].slot; } -static int -argcls(Ins *i, int n) -{ - return opdesc[i->op].argcls[n][i->cls]; -} - static void -fixarg(Ref *r, int k, int phi, Fn *fn) +fixarg(Ref *r, int k, int cpy, Fn *fn) { Addr a, *m; Ref r0, r1; @@ -123,11 +77,11 @@ fixarg(Ref *r, int k, int phi, Fn *fn) memset(&a, 0, sizeof a); a.offset.type = CAddr; a.offset.local = 1; - n = stashfp(fn->con[r0.val].bits.i, KWIDE(k)); + n = gasstashfp(fn->con[r0.val].bits.i, KWIDE(k)); sprintf(a.offset.label, "fp%d", n); fn->mem[fn->nmem-1] = a; } - else if (!phi && k == Kl && noimm(r0, fn)) { + else if (!cpy && k == Kl && noimm(r0, fn)) { /* load constants that do not fit in * a 32bit signed integer into a * long temporary @@ -251,7 +205,7 @@ sel(Ins i, ANum *an, Fn *fn) r0 = i.arg[1]; if (fn->tmp[r0.val].slot != -1) err("unlikely argument %%%s in %s", - fn->tmp[r0.val].name, opdesc[i.op].name); + fn->tmp[r0.val].name, optab[i.op].name); if (i.op == Odiv || i.op == Orem) { emit(Oxidiv, k, R, r0, R); emit(Osign, k, TMP(RDX), TMP(RAX), R); @@ -340,7 +294,7 @@ sel(Ins i, ANum *an, Fn *fn) emit(Oadd, Kl, r1, i.arg[0], getcon(15, fn)); if (fn->tmp[i.arg[0].val].slot != -1) err("unlikely argument %%%s in %s", - fn->tmp[i.arg[0].val].name, opdesc[i.op].name); + fn->tmp[i.arg[0].val].name, optab[i.op].name); } break; default: @@ -349,13 +303,13 @@ sel(Ins i, ANum *an, Fn *fn) if (isload(i.op)) goto case_Oload; if (iscmp(i.op, &kc, &x)) { - emit(Oxset+x, k, i.to, R, R); + emit(Oflag+x, k, i.to, R, R); i1 = curi; if (selcmp(i.arg, kc, fn)) - i1->op = Oxset + icmpop(x); + i1->op = Oflag + cmpop(x); break; } - die("unknown instruction %s", opdesc[i.op].name); + die("unknown instruction %s", optab[i.op].name); } while (i0 > curi && --i0) { @@ -369,9 +323,9 @@ flagi(Ins *i0, Ins *i) { while (i>i0) { i--; - if (opdesc[i->op].sflag) + if (amd64_op[i->op].zflag) return i; - if (opdesc[i->op].lflag) + if (amd64_op[i->op].lflag) continue; return 0; } @@ -402,22 +356,22 @@ seljmp(Blk *b, Fn *fn) fi = flagi(b->ins, &b->ins[b->nins]); if (!fi || !req(fi->to, r)) { selcmp((Ref[2]){r, CON_Z}, Kw, fn); /* todo, long jnz */ - b->jmp.type = Jxjc + ICne; + b->jmp.type = Jjf + Cine; } else if (iscmp(fi->op, &k, &c)) { if (t->nuse == 1) { if (selcmp(fi->arg, k, fn)) - c = icmpop(c); + c = cmpop(c); *fi = (Ins){.op = Onop}; } - b->jmp.type = Jxjc + c; + b->jmp.type = Jjf + c; } else if (fi->op == Oand && t->nuse == 1 && (rtype(fi->arg[0]) == RTmp || rtype(fi->arg[1]) == RTmp)) { fi->op = Oxtest; fi->to = R; - b->jmp.type = Jxjc + ICne; + b->jmp.type = Jjf + Cine; if (rtype(fi->arg[1]) == RCon) { r = fi->arg[1]; fi->arg[1] = fi->arg[0]; @@ -431,7 +385,7 @@ seljmp(Blk *b, Fn *fn) */ if (t->nuse == 1) emit(Ocopy, Kw, R, r, R); - b->jmp.type = Jxjc + ICne; + b->jmp.type = Jjf + Cine; } } @@ -593,7 +547,7 @@ amatch(Addr *a, Ref r, ANum *ai, Fn *fn, int top) * requires use counts (as given by parsing) */ void -isel(Fn *fn) +amd64_isel(Fn *fn) { Blk *b, **sb; Ins *i; diff --git a/sysv.c b/amd64/sysv.c similarity index 94% rename from sysv.c rename to amd64/sysv.c index a88b044..dcaa812 100644 --- a/sysv.c +++ b/amd64/sysv.c @@ -90,25 +90,6 @@ typclass(AClass *a, Typ *t) classify(a, t, &n, &e); } -static void -blit(Ref rstk, uint soff, Ref rsrc, uint sz, Fn *fn) -{ - Ref r, r1; - uint boff; - - /* it's an impolite blit, we might go across the end - * of the source object a little bit... */ - for (boff=0; sz>0; sz-=8, soff+=8, boff+=8) { - r = newtmp("abi", Kl, fn); - r1 = newtmp("abi", Kl, fn); - emit(Ostorel, 0, R, r, r1); - emit(Oadd, Kl, r1, rstk, getcon(soff, fn)); - r1 = newtmp("abi", Kl, fn); - emit(Oload, Kl, r, r1, R); - emit(Oadd, Kl, r1, rsrc, getcon(boff, fn)); - } -} - static int retr(Ref reg[2], AClass *aret) { @@ -226,15 +207,17 @@ argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret, Ref *env) return ((6-nint) << 4) | ((8-nsse) << 8); } -int rsave[] = { +int amd64_sysv_rsave[] = { RDI, RSI, RDX, RCX, R8, R9, R10, R11, RAX, XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, - XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14 + XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, -1 }; -int rclob[] = {RBX, R12, R13, R14, R15}; +int amd64_sysv_rclob[] = {RBX, R12, R13, R14, R15, -1}; -MAKESURE(rsave_has_correct_size, sizeof rsave == NRSave * sizeof(int)); -MAKESURE(rclob_has_correct_size, sizeof rclob == NRClob * sizeof(int)); +MAKESURE(sysv_arrays_ok, + sizeof amd64_sysv_rsave == (NGPS+NFPS+1) * sizeof(int) && + sizeof amd64_sysv_rclob == (NCLR+1) * sizeof(int) +); /* layout of call's second argument (RCall) * @@ -248,7 +231,7 @@ MAKESURE(rclob_has_correct_size, sizeof rclob == NRClob * sizeof(int)); */ bits -retregs(Ref r, int p[2]) +amd64_sysv_retregs(Ref r, int p[2]) { bits b; int ni, nf; @@ -273,7 +256,7 @@ retregs(Ref r, int p[2]) } bits -argregs(Ref r, int p[2]) +amd64_sysv_argregs(Ref r, int p[2]) { bits b; int j, ni, nf, ra; @@ -284,7 +267,7 @@ argregs(Ref r, int p[2]) nf = (r.val >> 8) & 15; ra = (r.val >> 12) & 1; for (j=0; js1 = breg; b->s2 = bstk; c = getcon(isint ? 48 : 176, fn); - emit(Ocmpw+ICult, Kw, r1, nr, c); + emit(Ocmpw+Ciult, Kw, r1, nr, c); emit(Oloadsw, Kl, nr, r0, R); emit(Oadd, Kl, r0, ap, isint ? CON_Z : c4); } -void +static void selvastart(Fn *fn, int fa, Ref ap) { Ref r0, r1; @@ -649,7 +632,7 @@ selvastart(Fn *fn, int fa, Ref ap) } void -abi(Fn *fn) +amd64_sysv_abi(Fn *fn) { Blk *b; Ins *i, *i0, *ip; diff --git a/amd64/targ.c b/amd64/targ.c new file mode 100644 index 0000000..e227574 --- /dev/null +++ b/amd64/targ.c @@ -0,0 +1,30 @@ +#include "all.h" + +Amd64Op amd64_op[NOp] = { +#define O(op, t, x) [O##op] = +#define X(nm, zf, lf) { nm, zf, lf, }, + #include "../ops.h" +}; + +static int +amd64_memargs(int op) +{ + return amd64_op[op].nmem; +} + +Target T_amd64_sysv = { + .gpr0 = RAX, + .ngpr = NGPR, + .fpr0 = XMM0, + .nfpr = NFPR, + .rglob = BIT(RBP) | BIT(RSP), + .nrglob = 2, + .rsave = amd64_sysv_rsave, + .nrsave = {NGPS, NFPS}, + .retregs = amd64_sysv_retregs, + .argregs = amd64_sysv_argregs, + .memargs = amd64_memargs, + .abi = amd64_sysv_abi, + .isel = amd64_isel, + .emitfn = amd64_emitfn, +}; diff --git a/cfg.c b/cfg.c index dff0765..ea1ae12 100644 --- a/cfg.c +++ b/cfg.c @@ -312,8 +312,8 @@ simpljmp(Fn *fn) uffind(&b->s1, uf); if (b->s2) uffind(&b->s2, uf); - c = b->jmp.type - Jxjc; - if (0 <= c && c <= NXICmp) + c = b->jmp.type - Jjf; + if (0 <= c && c <= NCmp) if (b->s1 == b->s2) { b->jmp.type = Jjmp; b->s2 = 0; diff --git a/fold.c b/fold.c index 6129421..55672dd 100644 --- a/fold.c +++ b/fold.c @@ -100,7 +100,7 @@ visitins(Ins *i, Fn *fn) if (rtype(i->to) != RTmp) return; - if (opdesc[i->op].cfold) { + if (optab[i->op].canfold) { l = latval(i->arg[0]); if (!req(i->arg[1], R)) r = latval(i->arg[1]); @@ -114,7 +114,7 @@ visitins(Ins *i, Fn *fn) v = opfold(i->op, i->cls, &fn->con[l], &fn->con[r], fn); } else v = Bot; - /* fprintf(stderr, "\nvisiting %s (%p)", opdesc[i->op].name, (void *)i); */ + /* fprintf(stderr, "\nvisiting %s (%p)", optab[i->op].name, (void *)i); */ update(i->to.val, v, fn); } @@ -360,7 +360,7 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) else if (cl->type == CAddr || cr->type == CAddr) { if (Ocmpl <= op && op <= Ocmpl1) return 1; - err("invalid address operand for '%s'", opdesc[op].name); + err("invalid address operand for '%s'", optab[op].name); } switch (op) { case Oadd: x = l.u + r.u; break; @@ -397,42 +397,42 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) } else op -= Ocmpl - Ocmpw; switch (op - Ocmpw) { - case ICule: x = l.u <= r.u; break; - case ICult: x = l.u < r.u; break; - case ICsle: x = l.s <= r.s; break; - case ICslt: x = l.s < r.s; break; - case ICsgt: x = l.s > r.s; break; - case ICsge: x = l.s >= r.s; break; - case ICugt: x = l.u > r.u; break; - case ICuge: x = l.u >= r.u; break; - case ICeq: x = l.u == r.u; break; - case ICne: x = l.u != r.u; break; + case Ciule: x = l.u <= r.u; break; + case Ciult: x = l.u < r.u; break; + case Cisle: x = l.s <= r.s; break; + case Cislt: x = l.s < r.s; break; + case Cisgt: x = l.s > r.s; break; + case Cisge: x = l.s >= r.s; break; + case Ciugt: x = l.u > r.u; break; + case Ciuge: x = l.u >= r.u; break; + case Cieq: x = l.u == r.u; break; + case Cine: x = l.u != r.u; break; default: die("unreachable"); } } else if (Ocmps <= op && op <= Ocmps1) { switch (op - Ocmps) { - case FCle: x = l.fs <= r.fs; break; - case FClt: x = l.fs < r.fs; break; - case FCgt: x = l.fs > r.fs; break; - case FCge: x = l.fs >= r.fs; break; - case FCne: x = l.fs != r.fs; break; - case FCeq: x = l.fs == r.fs; break; - case FCo: x = l.fs < r.fs || l.fs >= r.fs; break; - case FCuo: x = !(l.fs < r.fs || l.fs >= r.fs); break; + case Cfle: x = l.fs <= r.fs; break; + case Cflt: x = l.fs < r.fs; break; + case Cfgt: x = l.fs > r.fs; break; + case Cfge: x = l.fs >= r.fs; break; + case Cfne: x = l.fs != r.fs; break; + case Cfeq: x = l.fs == r.fs; break; + case Cfo: x = l.fs < r.fs || l.fs >= r.fs; break; + case Cfuo: x = !(l.fs < r.fs || l.fs >= r.fs); break; default: die("unreachable"); } } else if (Ocmpd <= op && op <= Ocmpd1) { switch (op - Ocmpd) { - case FCle: x = l.fd <= r.fd; break; - case FClt: x = l.fd < r.fd; break; - case FCgt: x = l.fd > r.fd; break; - case FCge: x = l.fd >= r.fd; break; - case FCne: x = l.fd != r.fd; break; - case FCeq: x = l.fd == r.fd; break; - case FCo: x = l.fd < r.fd || l.fd >= r.fd; break; - case FCuo: x = !(l.fd < r.fd || l.fd >= r.fd); break; + case Cfle: x = l.fd <= r.fd; break; + case Cflt: x = l.fd < r.fd; break; + case Cfgt: x = l.fd > r.fd; break; + case Cfge: x = l.fd >= r.fd; break; + case Cfne: x = l.fd != r.fd; break; + case Cfeq: x = l.fd == r.fd; break; + case Cfo: x = l.fd < r.fd || l.fd >= r.fd; break; + case Cfuo: x = !(l.fd < r.fd || l.fd >= r.fd); break; default: die("unreachable"); } } @@ -453,7 +453,7 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) double xd, ld, rd; if (cl->type != CBits || cr->type != CBits) - err("invalid address operand for '%s'", opdesc[op].name); + err("invalid address operand for '%s'", optab[op].name); if (w) { ld = cl->bits.d; rd = cr->bits.d; @@ -495,7 +495,7 @@ opfold(int op, int cls, Con *cl, Con *cr, Fn *fn) if ((op == Odiv || op == Oudiv || op == Orem || op == Ourem) && czero(cr, KWIDE(cls))) - err("null divisor in '%s'", opdesc[op].name); + err("null divisor in '%s'", optab[op].name); if (cls == Kw || cls == Kl) { if (foldint(&c, op, cls == Kl, cl, cr)) return Bot; diff --git a/gas.c b/gas.c new file mode 100644 index 0000000..c1fd6df --- /dev/null +++ b/gas.c @@ -0,0 +1,122 @@ +#include "all.h" + + +char *gasloc, *gassym; + +void +gasemitdat(Dat *d, FILE *f) +{ + static int align; + static char *dtoa[] = { + [DAlign] = ".align", + [DB] = "\t.byte", + [DH] = "\t.short", + [DW] = "\t.int", + [DL] = "\t.quad" + }; + + switch (d->type) { + case DStart: + align = 0; + fprintf(f, ".data\n"); + break; + case DEnd: + break; + case DName: + if (!align) + fprintf(f, ".align 8\n"); + if (d->export) + fprintf(f, ".globl %s%s\n", gassym, d->u.str); + fprintf(f, "%s%s:\n", gassym, d->u.str); + break; + case DZ: + fprintf(f, "\t.fill %"PRId64",1,0\n", d->u.num); + break; + default: + if (d->type == DAlign) + align = 1; + + if (d->isstr) { + if (d->type != DB) + err("strings only supported for 'b' currently"); + fprintf(f, "\t.ascii \"%s\"\n", d->u.str); + } + else if (d->isref) { + fprintf(f, "%s %s%+"PRId64"\n", + dtoa[d->type], d->u.ref.nam, + d->u.ref.off); + } + else { + fprintf(f, "%s %"PRId64"\n", + dtoa[d->type], d->u.num); + } + break; + } +} + +typedef struct FBits FBits; + +struct FBits { + union { + int64_t n; + float f; + double d; + } bits; + int wide; + FBits *link; +}; + +static FBits *stash; + +int +gasstashfp(int64_t n, int w) +{ + FBits **pb, *b; + int i; + + /* does a dumb de-dup of fp constants + * this should be the linker's job */ + for (pb=&stash, i=0; (b=*pb); pb=&b->link, i++) + if (n == b->bits.n && w == b->wide) + return i; + b = emalloc(sizeof *b); + b->bits.n = n; + b->wide = w; + b->link = 0; + *pb = b; + return i; +} + +void +gasemitfin(FILE *f) +{ + FBits *b; + int i; + + if (!stash) + return; + fprintf(f, "/* floating point constants */\n"); + fprintf(f, ".data\n.align 8\n"); + for (b=stash, i=0; b; b=b->link, i++) + if (b->wide) + fprintf(f, + "%sfp%d:\n" + "\t.quad %"PRId64 + " /* %f */\n", + gasloc, i, b->bits.n, + b->bits.d + ); + for (b=stash, i=0; b; b=b->link, i++) + if (!b->wide) + fprintf(f, + "%sfp%d:\n" + "\t.long %"PRId64 + " /* %lf */\n", + gasloc, i, b->bits.n & 0xffffffff, + b->bits.f + ); + while ((b=stash)) { + stash = b->link; + free(b); + } +} diff --git a/live.c b/live.c index 18c9b63..6e63705 100644 --- a/live.c +++ b/live.c @@ -104,31 +104,39 @@ filllive(Fn *f) memset(phi, 0, f->ntmp * sizeof phi[0]); memset(nlv, 0, sizeof nlv); - b->out->t[0] |= RGLOB; + b->out->t[0] |= T.rglob; bscopy(b->in, b->out); for (t=0; bsiter(b->in, &t); t++) { phifix(t, phi, f->tmp); nlv[KBASE(f->tmp[t].cls)]++; } if (rtype(b->jmp.arg) == RCall) { - assert(bscount(b->in) == NRGlob && nlv[0] == NRGlob && nlv[1] == 0); - b->in->t[0] |= retregs(b->jmp.arg, nlv); + assert((int)bscount(b->in) == T.nrglob && + nlv[0] == T.nrglob && + nlv[1] == 0); + b->in->t[0] |= T.retregs(b->jmp.arg, nlv); } else bset(b->jmp.arg, b, nlv, phi, f->tmp); for (k=0; k<2; k++) b->nlive[k] = nlv[k]; for (i=&b->ins[b->nins]; i!=b->ins;) { if ((--i)->op == Ocall && rtype(i->arg[1]) == RCall) { - b->in->t[0] &= ~retregs(i->arg[1], m); - for (k=0; k<2; k++) + b->in->t[0] &= ~T.retregs(i->arg[1], m); + for (k=0; k<2; k++) { nlv[k] -= m[k]; - if (nlv[0] + NISave > b->nlive[0]) - b->nlive[0] = nlv[0] + NISave; - if (nlv[1] + NFSave > b->nlive[1]) - b->nlive[1] = nlv[1] + NFSave; - b->in->t[0] |= argregs(i->arg[1], m); - for (k=0; k<2; k++) + /* caller-save registers are used + * by the callee, in that sense, + * right in the middle of the call, + * they are live: */ + nlv[k] += T.nrsave[k]; + if (nlv[k] > b->nlive[k]) + b->nlive[k] = nlv[k]; + } + b->in->t[0] |= T.argregs(i->arg[1], m); + for (k=0; k<2; k++) { + nlv[k] -= T.nrsave[k]; nlv[k] += m[k]; + } } if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); diff --git a/main.c b/main.c index 4d2e6bd..6098dee 100644 --- a/main.c +++ b/main.c @@ -3,6 +3,18 @@ #include #include +Target T; + +extern Target T_amd64_sysv; + +static struct TMap { + char *name; + Target *T; +} tmap[] = { + { "amd64_sysv", &T_amd64_sysv }, + { 0, 0 } +}; + enum Asm { Gasmacho, Gaself, @@ -33,7 +45,7 @@ data(Dat *d) fputs("/* end data */\n\n", outf); freeall(); } - emitdat(d, outf); + gasemitdat(d, outf); } static void @@ -62,10 +74,10 @@ func(Fn *fn) copy(fn); filluse(fn); fold(fn); - abi(fn); + T.abi(fn); fillpreds(fn); filluse(fn); - isel(fn); + T.isel(fn); fillrpo(fn); filllive(fn); fillcost(fn); @@ -83,7 +95,7 @@ func(Fn *fn) } else fn->rpo[n]->link = fn->rpo[n+1]; if (!dbg) { - emitfn(fn, outf); + T.emitfn(fn, outf); fprintf(outf, "/* end function %s */\n\n", fn->name); } else fprintf(stderr, "\n"); @@ -93,13 +105,15 @@ func(Fn *fn) int main(int ac, char *av[]) { - FILE *inf; - char *f; + struct TMap *tm; + FILE *inf, *hf; + char *f, *sep; int c, asm; - asm = Defaultasm; + asm = Defasm; + T = Deftgt; outf = stdout; - while ((c = getopt(ac, av, "hd:o:G:")) != -1) + while ((c = getopt(ac, av, "hd:o:G:t:")) != -1) switch (c) { case 'd': for (; *optarg; optarg++) @@ -112,6 +126,18 @@ main(int ac, char *av[]) if (strcmp(optarg, "-") != 0) outf = fopen(optarg, "w"); break; + case 't': + for (tm=tmap;; tm++) { + if (!tm->name) { + fprintf(stderr, "unknown target '%s'\n", optarg); + exit(1); + } + if (strcmp(optarg, tm->name) == 0) { + T = *tm->T; + break; + } + } + break; case 'G': if (strcmp(optarg, "e") == 0) asm = Gaself; @@ -124,22 +150,28 @@ main(int ac, char *av[]) break; case 'h': default: - fprintf(stderr, "%s [OPTIONS] {file.ssa, -}\n", av[0]); - fprintf(stderr, "\t%-10s prints this help\n", "-h"); - fprintf(stderr, "\t%-10s output to file\n", "-o file"); - fprintf(stderr, "\t%-10s generate gas (e) or osx (m) asm\n", "-G {e,m}"); - fprintf(stderr, "\t%-10s dump debug information\n", "-d "); + hf = c != 'h' ? stderr : stdout; + fprintf(hf, "%s [OPTIONS] {file.ssa, -}\n", av[0]); + fprintf(hf, "\t%-11s prints this help\n", "-h"); + fprintf(hf, "\t%-11s output to file\n", "-o file"); + fprintf(hf, "\t%-11s generate for a target among:\n", "-t "); + fprintf(hf, "\t%-11s ", ""); + for (tm=tmap, sep=""; tm->name; tm++, sep=", ") + fprintf(hf, "%s%s", sep, tm->name); + fprintf(hf, "\n"); + fprintf(hf, "\t%-11s generate gas (e) or osx (m) asm\n", "-G {e,m}"); + fprintf(hf, "\t%-11s dump debug information\n", "-d "); exit(c != 'h'); } switch (asm) { case Gaself: - locprefix = ".L"; - symprefix = ""; + gasloc = ".L"; + gassym = ""; break; case Gasmacho: - locprefix = "L"; - symprefix = "_"; + gasloc = "L"; + gassym = "_"; break; } @@ -159,7 +191,7 @@ main(int ac, char *av[]) } while (++optind < ac); if (!dbg) - emitfin(outf); + gasemitfin(outf); exit(0); } diff --git a/mem.c b/mem.c index fd6ee16..eda3d18 100644 --- a/mem.c +++ b/mem.c @@ -34,9 +34,9 @@ memopt(Fn *fn) if (isstore(l->op)) if (req(i->to, l->arg[1]) && !req(i->to, l->arg[0])) if (s == -1 || s == storesz(l)) - if (k == -1 || k == opdesc[l->op].argcls[0][0]) { + if (k == -1 || k == optab[l->op].argcls[0][0]) { s = storesz(l); - k = opdesc[l->op].argcls[0][0]; + k = optab[l->op].argcls[0][0]; continue; } goto Skip; diff --git a/ops.h b/ops.h new file mode 100644 index 0000000..9b357a5 --- /dev/null +++ b/ops.h @@ -0,0 +1,167 @@ +#ifndef X /* amd64 */ + #define X(NMemArgs, SetsZeroFlag, LeavesFlags) +#endif + +#define T(a,b,c,d,e,f,g,h) { \ + {[Kw]=K##a, [Kl]=K##b, [Ks]=K##c, [Kd]=K##d}, \ + {[Kw]=K##e, [Kl]=K##f, [Ks]=K##g, [Kd]=K##h} \ +} + + +/*********************/ +/* PUBLIC OPERATIONS */ +/*********************/ + +/* Arithmetic and Bits */ +O(add, T(w,l,s,d, w,l,s,d), 1) X(2, 1, 0) +O(sub, T(w,l,s,d, w,l,s,d), 1) X(2, 1, 0) +O(div, T(w,l,s,d, w,l,s,d), 1) X(0, 0, 0) +O(rem, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) +O(udiv, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) +O(urem, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) +O(mul, T(w,l,s,d, w,l,s,d), 1) X(2, 0, 0) +O(and, T(w,l,e,e, w,l,e,e), 1) X(2, 1, 0) +O(or, T(w,l,e,e, w,l,e,e), 1) X(2, 1, 0) +O(xor, T(w,l,e,e, w,l,e,e), 1) X(2, 1, 0) +O(sar, T(w,l,e,e, w,w,e,e), 1) X(1, 1, 0) +O(shr, T(w,l,e,e, w,w,e,e), 1) X(1, 1, 0) +O(shl, T(w,l,e,e, w,w,e,e), 1) X(1, 1, 0) + +/* Comparisons */ +O(ceqw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) +O(cnew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) +O(csgew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) +O(csgtw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) +O(cslew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) +O(csltw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) +O(cugew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) +O(cugtw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) +O(culew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) +O(cultw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) + +O(ceql, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) +O(cnel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) +O(csgel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) +O(csgtl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) +O(cslel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) +O(csltl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) +O(cugel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) +O(cugtl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) +O(culel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) +O(cultl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) + +O(ceqs, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) +O(cges, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) +O(cgts, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) +O(cles, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) +O(clts, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) +O(cnes, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) +O(cos, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) +O(cuos, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) + +O(ceqd, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) +O(cged, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) +O(cgtd, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) +O(cled, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) +O(cltd, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) +O(cned, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) +O(cod, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) +O(cuod, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) + +/* Memory */ +O(storeb, T(w,e,e,e, m,e,e,e), 0) X(0, 0, 1) +O(storeh, T(w,e,e,e, m,e,e,e), 0) X(0, 0, 1) +O(storew, T(w,e,e,e, m,e,e,e), 0) X(0, 0, 1) +O(storel, T(l,e,e,e, m,e,e,e), 0) X(0, 0, 1) +O(stores, T(s,e,e,e, m,e,e,e), 0) X(0, 0, 1) +O(stored, T(d,e,e,e, m,e,e,e), 0) X(0, 0, 1) + +O(loadsb, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) +O(loadub, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) +O(loadsh, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) +O(loaduh, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) +O(loadsw, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) +O(loaduw, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) +O(load, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 1) + +/* Extensions and Truncations */ +O(extsb, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) +O(extub, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) +O(extsh, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) +O(extuh, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) +O(extsw, T(e,w,e,e, e,x,e,e), 1) X(0, 0, 1) +O(extuw, T(e,w,e,e, e,x,e,e), 1) X(0, 0, 1) + +O(exts, T(e,e,e,s, e,e,e,x), 1) X(0, 0, 1) +O(truncd, T(e,e,d,e, e,e,x,e), 1) X(0, 0, 1) +O(stosi, T(s,s,e,e, x,x,e,e), 1) X(0, 0, 1) +O(dtosi, T(d,d,e,e, x,x,e,e), 1) X(0, 0, 1) +O(swtof, T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1) +O(sltof, T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1) +O(cast, T(s,d,w,l, x,x,x,x), 1) X(0, 0, 1) + +/* Stack Allocation */ +O(alloc4, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) +O(alloc8, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) +O(alloc16, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) + +/* Variadic Function Helpers */ +O(vaarg, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) +O(vastart, T(m,e,e,e, x,e,e,e), 0) X(0, 0, 0) + +O(copy, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 1) + + +/****************************************/ +/* INTERNAL OPERATIONS (keep nop first) */ +/****************************************/ + +/* Miscellaneous and Architecture-Specific Operations */ +O(nop, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 1) +O(addr, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) +O(swap, T(w,l,s,d, w,l,s,d), 0) X(1, 0, 0) +O(sign, T(w,l,e,e, x,x,e,e), 0) X(0, 0, 0) +O(salloc, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) +O(xidiv, T(w,l,e,e, x,x,e,e), 0) X(1, 0, 0) +O(xdiv, T(w,l,e,e, x,x,e,e), 0) X(1, 0, 0) +O(xcmp, T(w,l,s,d, w,l,s,d), 0) X(1, 1, 0) +O(xtest, T(w,l,e,e, w,l,e,e), 0) X(1, 1, 0) + +/* Arguments, Parameters, and Calls */ +O(par, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) +O(parc, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0) +O(pare, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) +O(arg, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 0) +O(argc, T(e,x,e,e, e,l,e,e), 0) X(0, 0, 0) +O(arge, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 0) +O(call, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) +O(vacall, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) + +/* Flags Setting */ +O(flagieq, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagine, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagisge, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagisgt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagisle, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagislt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagiuge, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagiugt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagiule, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagiult, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagfeq, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagfge, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagfgt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagfle, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagflt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagfne, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagfo, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagfuo, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) + + +#undef T +#undef X +#undef O + +/* +| column -t -o ' ' +*/ diff --git a/parse.c b/parse.c index b393fc2..69bd74e 100644 --- a/parse.c +++ b/parse.c @@ -4,91 +4,13 @@ enum { Ke = -2, /* Erroneous mode */ - Km = Kl, /* Memory pointer (for x64) */ + Km = Kl, /* Memory pointer */ }; -OpDesc opdesc[NOp] = { -#define A(a,b,c,d) {[Kw]=K##a, [Kl]=K##b, [Ks]=K##c, [Kd]=K##d} - - /* NAME NM ARGCLS0 ARGCLS1 SF LF FLD*/ - [Oadd] = { "add", 2, {A(w,l,s,d), A(w,l,s,d)}, 1, 0, 1 }, - [Osub] = { "sub", 2, {A(w,l,s,d), A(w,l,s,d)}, 1, 0, 1 }, - [Odiv] = { "div", 2, {A(w,l,s,d), A(w,l,s,d)}, 0, 0, 1 }, - [Orem] = { "rem", 2, {A(w,l,e,e), A(w,l,e,e)}, 0, 0, 1 }, - [Oudiv] = { "udiv", 2, {A(w,l,e,e), A(w,l,e,e)}, 0, 0, 1 }, - [Ourem] = { "urem", 2, {A(w,l,e,e), A(w,l,e,e)}, 0, 0, 1 }, - [Omul] = { "mul", 2, {A(w,l,s,d), A(w,l,s,d)}, 0, 0, 1 }, - [Oand] = { "and", 2, {A(w,l,e,e), A(w,l,e,e)}, 1, 0, 1 }, - [Oor] = { "or", 2, {A(w,l,e,e), A(w,l,e,e)}, 1, 0, 1 }, - [Oxor] = { "xor", 2, {A(w,l,e,e), A(w,l,e,e)}, 1, 0, 1 }, - [Osar] = { "sar", 1, {A(w,l,e,e), A(w,w,e,e)}, 1, 0, 1 }, - [Oshr] = { "shr", 1, {A(w,l,e,e), A(w,w,e,e)}, 1, 0, 1 }, - [Oshl] = { "shl", 1, {A(w,l,e,e), A(w,w,e,e)}, 1, 0, 1 }, - [Ostored] = { "stored", 0, {A(d,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, - [Ostores] = { "stores", 0, {A(s,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, - [Ostorel] = { "storel", 0, {A(l,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, - [Ostorew] = { "storew", 0, {A(w,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, - [Ostoreh] = { "storeh", 0, {A(w,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, - [Ostoreb] = { "storeb", 0, {A(w,e,e,e), A(m,e,e,e)}, 0, 1, 0 }, - [Oload] = { "load", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 1, 0 }, - [Oloadsw] = { "loadsw", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, - [Oloaduw] = { "loaduw", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, - [Oloadsh] = { "loadsh", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, - [Oloaduh] = { "loaduh", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, - [Oloadsb] = { "loadsb", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, - [Oloadub] = { "loadub", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, - [Oextsw] = { "extsw", 0, {A(e,w,e,e), A(e,x,e,e)}, 0, 1, 1 }, - [Oextuw] = { "extuw", 0, {A(e,w,e,e), A(e,x,e,e)}, 0, 1, 1 }, - [Oextsh] = { "extsh", 0, {A(w,w,e,e), A(x,x,e,e)}, 0, 1, 1 }, - [Oextuh] = { "extuh", 0, {A(w,w,e,e), A(x,x,e,e)}, 0, 1, 1 }, - [Oextsb] = { "extsb", 0, {A(w,w,e,e), A(x,x,e,e)}, 0, 1, 1 }, - [Oextub] = { "extub", 0, {A(w,w,e,e), A(x,x,e,e)}, 0, 1, 1 }, - [Oexts] = { "exts", 0, {A(e,e,e,s), A(e,e,e,x)}, 0, 1, 1 }, - [Otruncd] = { "truncd", 0, {A(e,e,d,e), A(e,e,x,e)}, 0, 1, 1 }, - [Ostosi] = { "stosi", 0, {A(s,s,e,e), A(x,x,e,e)}, 0, 1, 1 }, - [Odtosi] = { "dtosi", 0, {A(d,d,e,e), A(x,x,e,e)}, 0, 1, 1 }, - [Oswtof] = { "swtof", 0, {A(e,e,w,w), A(e,e,x,x)}, 0, 1, 1 }, - [Osltof] = { "sltof", 0, {A(e,e,l,l), A(e,e,x,x)}, 0, 1, 1 }, - [Ocast] = { "cast", 0, {A(s,d,w,l), A(x,x,x,x)}, 0, 1, 1 }, - [Ocopy] = { "copy", 1, {A(w,l,s,d), A(x,x,x,x)}, 0, 1, 0 }, - [Onop] = { "nop", 0, {A(x,x,x,x), A(x,x,x,x)}, 0, 1, 0 }, - [Oswap] = { "swap", 2, {A(w,l,s,d), A(w,l,s,d)}, 0, 0, 0 }, - [Osign] = { "sign", 0, {A(w,l,e,e), A(x,x,e,e)}, 0, 0, 0 }, - [Osalloc] = { "salloc", 0, {A(e,l,e,e), A(e,x,e,e)}, 0, 0, 0 }, - [Oxidiv] = { "xidiv", 1, {A(w,l,e,e), A(x,x,e,e)}, 0, 0, 0 }, - [Oxdiv] = { "xdiv", 1, {A(w,l,e,e), A(x,x,e,e)}, 0, 0, 0 }, - [Oxcmp] = { "xcmp", 1, {A(w,l,s,d), A(w,l,s,d)}, 1, 0, 0 }, - [Oxtest] = { "xtest", 1, {A(w,l,e,e), A(w,l,e,e)}, 1, 0, 0 }, - [Oaddr] = { "addr", 0, {A(m,m,e,e), A(x,x,e,e)}, 0, 1, 0 }, - [Opar] = { "par", 0, {A(x,x,x,x), A(x,x,x,x)}, 0, 0, 0 }, - [Opare] = { "pare", 0, {A(x,x,x,x), A(x,x,x,x)}, 0, 0, 0 }, - [Oparc] = { "parc", 0, {A(e,x,e,e), A(e,x,e,e)}, 0, 0, 0 }, - [Oarg] = { "arg", 0, {A(w,l,s,d), A(x,x,x,x)}, 0, 0, 0 }, - [Oarge] = { "arge", 0, {A(w,l,s,d), A(x,x,x,x)}, 0, 0, 0 }, - [Oargc] = { "argc", 0, {A(e,x,e,e), A(e,l,e,e)}, 0, 0, 0 }, - [Ocall] = { "call", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, - [Ovacall] = { "vacall", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, - [Oxsetnp] = { "xsetnp", 0, {A(x,x,e,e), A(x,x,e,e)}, 0, 0, 0 }, - [Oxsetp] = { "xsetp", 0, {A(x,x,e,e), A(x,x,e,e)}, 0, 0, 0 }, - [Oalloc] = { "alloc4", 1, {A(e,l,e,e), A(e,x,e,e)}, 0, 0, 0 }, - [Oalloc+1] = { "alloc8", 1, {A(e,l,e,e), A(e,x,e,e)}, 0, 0, 0 }, - [Oalloc+2] = { "alloc16", 1, {A(e,l,e,e), A(e,x,e,e)}, 0, 0, 0 }, - [Ovaarg] = { "vaarg", 0, {A(m,m,m,m), A(x,x,x,x)}, 0, 0, 0 }, - [Ovastart] = { "vastart", 0, {A(m,e,e,e), A(x,e,e,e)}, 0, 0, 0 }, -#define X(c) \ - [Ocmpw+IC##c] = { "c" #c "w", 0, {A(w,w,e,e), A(w,w,e,e)}, 1, 0, 1 }, \ - [Ocmpl+IC##c] = { "c" #c "l", 0, {A(l,l,e,e), A(l,l,e,e)}, 1, 0, 1 }, \ - [Oxset+IC##c] = { "xset" #c, 0, {A(x,x,e,e), A(x,x,e,e)}, 0, 1, 0 }, - ICMPS(X) -#undef X -#define X(c) \ - [Ocmps+FC##c] = { "c" #c "s", 0, {A(s,s,e,e), A(s,s,e,e)}, 1, 0, 1 }, \ - [Ocmpd+FC##c] = { "c" #c "d", 0, {A(d,d,e,e), A(d,d,e,e)}, 1, 0, 1 }, - FCMPS(X) -#undef X - +Op optab[NOp] = { +#define O(op, t, cf) [O##op]={#op, t, cf}, + #include "ops.h" }; -#undef A typedef enum { PXXX, @@ -242,8 +164,8 @@ lexinit() if (done) return; for (i=0; iins; i-b->ins < b->nins; i++) for (n=0; n<2; n++) { - k = opdesc[i->op].argcls[n][i->cls]; + k = optab[i->op].argcls[n][i->cls]; r = i->arg[n]; t = &fn->tmp[r.val]; if (k == Ke) err("invalid instruction type in %s", - opdesc[i->op].name); + optab[i->op].name); if (rtype(r) == RType) continue; if (rtype(r) != -1 && k == Kx) err("no %s operand expected in %s", n == 1 ? "second" : "first", - opdesc[i->op].name); + optab[i->op].name); if (rtype(r) == -1 && k != Kx) err("missing %s operand in %s", n == 1 ? "second" : "first", - opdesc[i->op].name); + optab[i->op].name); if (!usecheck(r, k, fn)) err("invalid type for %s operand %%%s in %s", n == 1 ? "second" : "first", - t->name, opdesc[i->op].name); + t->name, optab[i->op].name); } r = b->jmp.arg; if (isret(b->jmp.type)) { @@ -866,7 +788,10 @@ parsefn(int export) curf->tmp = vnew(curf->ntmp, sizeof curf->tmp[0], Pfn); curf->con = vnew(curf->ncon, sizeof curf->con[0], Pfn); for (i=0; icon[0].type = CBits; curf->export = export; blink = &curf->start; @@ -1228,29 +1153,12 @@ printref(Ref r, Fn *fn, FILE *f) void printfn(Fn *fn, FILE *f) { + static char ktoc[] = "wlsd"; static char *jtoa[NJmp] = { - [Jret0] = "ret", - [Jretw] = "retw", - [Jretl] = "retl", - [Jretc] = "retc", - [Jrets] = "rets", - [Jretd] = "retd", - [Jjnz] = "jnz", - [Jxjnp] = "xjnp", - [Jxjp] = "xjp", - #define X(c) [Jxjc+IC##c] = "xj" #c, - ICMPS(X) + #define X(j) [J##j] = #j, + JMPS(X) #undef X }; - static char prcls[NOp] = { - [Oarg] = 1, - [Oswap] = 1, - [Oxcmp] = 1, - [Oxtest] = 1, - [Oxdiv] = 1, - [Oxidiv] = 1, - }; - static char ktoc[] = "wlsd"; Blk *b; Phi *p; Ins *i; @@ -1282,10 +1190,18 @@ printfn(Fn *fn, FILE *f) printref(i->to, fn, f); fprintf(f, " =%c ", ktoc[i->cls]); } - assert(opdesc[i->op].name); - fprintf(f, "%s", opdesc[i->op].name); - if (req(i->to, R) && prcls[i->op]) - fputc(ktoc[i->cls], f); + assert(optab[i->op].name); + fprintf(f, "%s", optab[i->op].name); + if (req(i->to, R)) + switch (i->op) { + case Oarg: + case Oswap: + case Oxcmp: + case Oxtest: + case Oxdiv: + case Oxidiv: + fputc(ktoc[i->cls], f); + } if (!req(i->arg[0], R)) { fprintf(f, " "); printref(i->arg[0], fn, f); diff --git a/rega.c b/rega.c index 3d83327..02429a6 100644 --- a/rega.c +++ b/rega.c @@ -8,8 +8,8 @@ typedef struct RMap RMap; struct RMap { - int t[NIReg+NFReg]; - int r[NIReg+NFReg]; + int t[Tmp0]; + int r[Tmp0]; BSet b[1]; int n; }; @@ -78,10 +78,12 @@ static void radd(RMap *m, int t, int r) { assert((t >= Tmp0 || t == r) && "invalid temporary"); - assert(((RAX <= r && r < RAX + NIReg) || (XMM0 <= r && r < XMM0 + NFReg)) && "invalid register"); + assert(((T.gpr0 <= r && r < T.gpr0 + T.ngpr) + || (T.fpr0 <= r && r < T.fpr0 + T.nfpr)) + && "invalid register"); assert(!bshas(m->b, t) && "temporary has mapping"); assert(!bshas(m->b, r) && "register already allocated"); - assert(m->n <= NIReg+NFReg && "too many mappings"); + assert(m->n <= T.ngpr+T.nfpr && "too many mappings"); bsset(m->b, t); bsset(m->b, r); m->t[m->n] = t; @@ -110,11 +112,11 @@ ralloc(RMap *m, int t) regs = tmp[phicls(t, tmp)].hint.m; regs |= m->b->t[0]; if (KBASE(tmp[t].cls) == 0) { - r0 = RAX; - r1 = RAX + NIReg; + r0 = T.gpr0; + r1 = r0 + T.ngpr; } else { - r0 = XMM0; - r1 = XMM0 + NFReg; + r0 = T.fpr0; + r1 = r0 + T.nfpr; } for (r=r0; r= Tmp0 || !(BIT(t) & RGLOB)); + assert(t >= Tmp0 || !(BIT(t) & T.rglob)); if (!bshas(m->b, t)) return -1; for (i=0; m->t[i] != t; i++) @@ -295,10 +297,10 @@ dopm(Blk *b, Ins *i, RMap *m) } while (i != b->ins && regcpy(i-1)); assert(m0.n <= m->n); if (i != b->ins && (i-1)->op == Ocall) { - def = retregs((i-1)->arg[1], 0); - for (r=0; rarg[1], 0) | T.rglob; + for (r=0; T.rsave[r]>=0; r++) + if (!(BIT(T.rsave[r]) & def)) + move(T.rsave[r], R, m); } for (npm=0, n=0; nn; n++) { t = m->t[n]; @@ -370,10 +372,10 @@ doblk(Blk *b, RMap *cur) for (i=&b->ins[b->nins]; i!=b->ins;) { switch ((--i)->op) { case Ocall: - rs = argregs(i->arg[1], 0); - for (r=0; rarg[1], 0) | T.rglob; + for (r=0; T.rsave[r]>=0; r++) + if (!(BIT(T.rsave[r]) & rs)) + rfree(cur, T.rsave[r]); break; case Ocopy: if (isreg(i->arg[0])) { @@ -388,7 +390,7 @@ doblk(Blk *b, RMap *cur) if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); r = i->to.val; - if (r >= Tmp0 || !(BIT(r) & RGLOB)) + if (r >= Tmp0 || !(BIT(r) & T.rglob)) r = rfree(cur, r); if (r == -1) { assert(!isreg(i->to)); diff --git a/spill.c b/spill.c index 0872fd5..3871247 100644 --- a/spill.c +++ b/spill.c @@ -196,8 +196,8 @@ limit2(BSet *b1, int k1, int k2, BSet *fst) bscopy(b2, b1); bsinter(b1, mask[0]); bsinter(b2, mask[1]); - limit(b1, NIReg - k1, fst); - limit(b2, NFReg - k2, fst); + limit(b1, T.ngpr - k1, fst); + limit(b2, T.nfpr - k2, fst); bsunion(b1, b2); } @@ -265,11 +265,11 @@ dopm(Blk *b, Ins *i, BSet *v) } while (i != b->ins && regcpy(i-1)); bscopy(u, v); if (i != b->ins && (i-1)->op == Ocall) { - v->t[0] &= ~retregs((i-1)->arg[1], 0); - limit2(v, NISave, NFSave, 0); - for (r=0, n=0; nt[0] |= argregs((i-1)->arg[1], 0); + v->t[0] &= ~T.retregs((i-1)->arg[1], 0); + limit2(v, T.nrsave[0], T.nrsave[1], 0); + for (n=0, r=0; T.rsave[n]>=0; n++) + r |= BIT(T.rsave[n]); + v->t[0] |= T.argregs((i-1)->arg[1], 0); } else { limit2(v, 0, 0, 0); r = v->t[0]; @@ -318,9 +318,9 @@ spill(Fn *fn) slot8 = 0; for (t=0; t= XMM0 && t < XMM0 + NFReg) + if (t >= T.fpr0 && t < T.fpr0 + T.nfpr) k = 1; - else if (t >= Tmp0) + if (t >= Tmp0) k = KBASE(tmp[t].cls); bsset(mask[k], t); } @@ -344,9 +344,9 @@ spill(Fn *fn) if (hd) { /* back-edge */ bszero(v); - hd->gen->t[0] |= RGLOB; /* don't spill registers */ + hd->gen->t[0] |= T.rglob; /* don't spill registers */ for (k=0; k<2; k++) { - n = k == 0 ? NIReg : NFReg; + n = k == 0 ? T.ngpr : T.nfpr; bscopy(u, b->out); bsinter(u, mask[k]); bscopy(w, u); @@ -373,7 +373,7 @@ spill(Fn *fn) } else { bscopy(v, b->out); if (rtype(b->jmp.arg) == RCall) - v->t[0] |= retregs(b->jmp.arg, 0); + v->t[0] |= T.retregs(b->jmp.arg, 0); } for (t=Tmp0; bsiter(b->out, &t); t++) if (!bshas(v, t)) @@ -381,7 +381,7 @@ spill(Fn *fn) bscopy(b->out, v); /* 2. process the block instructions */ - r = v->t[0] & (BIT(Tmp0)-1); + r = v->t[0]; curi = &insb[NIns]; for (i=&b->ins[b->nins]; i!=b->ins;) { i--; @@ -402,7 +402,7 @@ spill(Fn *fn) bsset(w, t); } } - j = opdesc[i->op].nmem; + j = T.memargs(i->op); for (n=0; n<2; n++) if (rtype(i->arg[n]) == RMem) j--; @@ -449,11 +449,11 @@ spill(Fn *fn) bsclr(v, t); } emiti(*i); - r = v->t[0] & (BIT(Tmp0)-1); + r = v->t[0]; /* Tmp0 is NBit */ if (r) sethint(v, r); } - assert(r == RGLOB || b == fn->start); + assert(r == T.rglob || b == fn->start); for (p=b->phi; p; p=p->link) { assert(rtype(p->to) == RTmp); diff --git a/util.c b/util.c index 9b73771..aae1481 100644 --- a/util.c +++ b/util.c @@ -87,6 +87,36 @@ freeall() nptr = 1; } +int +iscmp(int op, int *pk, int *pc) +{ + if (Ocmpw <= op && op <= Ocmpw1) { + *pc = op - Ocmpw; + *pk = Kw; + } + else if (Ocmpl <= op && op <= Ocmpl1) { + *pc = op - Ocmpl; + *pk = Kl; + } + else if (Ocmps <= op && op <= Ocmps1) { + *pc = NCmpI + op - Ocmps; + *pk = Ks; + } + else if (Ocmpd <= op && op <= Ocmpd1) { + *pc = NCmpI + op - Ocmpd; + *pk = Kd; + } + else + return 0; + return 1; +} + +int +argcls(Ins *i, int n) +{ + return optab[i->op].argcls[n][i->cls]; +} + void emit(int op, int k, Ref to, Ref arg0, Ref arg1) { @@ -165,6 +195,42 @@ vgrow(void *vp, ulong len) *(Vec **)vp = v1; } +static int cmptab[][2] ={ + /* negation swap */ + [Ciule] = {Ciugt, Ciuge}, + [Ciult] = {Ciuge, Ciugt}, + [Ciugt] = {Ciule, Ciult}, + [Ciuge] = {Ciult, Ciule}, + [Cisle] = {Cisgt, Cisge}, + [Cislt] = {Cisge, Cisgt}, + [Cisgt] = {Cisle, Cislt}, + [Cisge] = {Cislt, Cisle}, + [Cieq] = {Cine, Cieq}, + [Cine] = {Cieq, Cine}, + [NCmpI+Cfle] = {NCmpI+Cfgt, NCmpI+Cfge}, + [NCmpI+Cflt] = {NCmpI+Cfge, NCmpI+Cfgt}, + [NCmpI+Cfgt] = {NCmpI+Cfle, NCmpI+Cflt}, + [NCmpI+Cfge] = {NCmpI+Cflt, NCmpI+Cfle}, + [NCmpI+Cfeq] = {NCmpI+Cfne, NCmpI+Cfeq}, + [NCmpI+Cfne] = {NCmpI+Cfeq, NCmpI+Cfne}, + [NCmpI+Cfo] = {NCmpI+Cfuo, NCmpI+Cfo}, + [NCmpI+Cfuo] = {NCmpI+Cfo, NCmpI+Cfuo}, +}; + +int +cmpneg(int c) +{ + assert(0 <= c && c < NCmp); + return cmptab[c][0]; +} + +int +cmpop(int c) +{ + assert(0 <= c && c < NCmp); + return cmptab[c][1]; +} + int clsmerge(short *pk, short k) { @@ -256,6 +322,30 @@ addcon(Con *c0, Con *c1) } } +void +blit(Ref rdst, uint doff, Ref rsrc, uint sz, Fn *fn) +{ + struct { int st, ld, cls, size; } *p, tbl[] = { + { Ostorel, Oload, Kl, 8 }, + { Ostorew, Oload, Kw, 8 }, + { Ostoreh, Oloaduh, Kw, 2 }, + { Ostoreb, Oloadub, Kw, 1 } + }; + Ref r, r1; + uint boff, s; + + for (boff=0, p=tbl; sz; p++) + for (s=p->size; sz>=s; sz-=s, doff+=s, boff+=s) { + r = newtmp("blt", Kl, fn); + r1 = newtmp("blt", Kl, fn); + emit(p->st, 0, R, r, r1); + emit(Oadd, Kl, r1, rdst, getcon(doff, fn)); + r1 = newtmp("blt", Kl, fn); + emit(p->ld, p->cls, r, r1, R); + emit(Oadd, Kl, r1, rsrc, getcon(boff, fn)); + } +} + void bsinit(BSet *bs, uint n) { From 96836855a55cd28f1449b4a58d1e5301669350c0 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:09:59 -0400 Subject: [PATCH 085/286] rework storage of types The arm64 ABI needs to know precisely what floating point types are being used, so we need to store that information. I also made typ[] a dynamic array. --- all.h | 31 ++++++++++++++------------ amd64/sysv.c | 27 +++++++++++++---------- parse.c | 62 ++++++++++++++++++++++++++++------------------------ util.c | 2 +- 4 files changed, 68 insertions(+), 54 deletions(-) diff --git a/all.h b/all.h index c0e08fe..8cbec63 100644 --- a/all.h +++ b/all.h @@ -26,7 +26,7 @@ typedef struct Con Con; typedef struct Addr Mem; typedef struct Fn Fn; typedef struct Typ Typ; -typedef struct Seg Seg; +typedef struct Field Field; typedef struct Dat Dat; typedef struct Target Target; @@ -35,8 +35,7 @@ enum { NPred = 63, NIns = 8192, NAlign = 3, - NSeg = 32, - NTyp = 128, + NField = 32, NBit = CHAR_BIT * sizeof(bits), }; @@ -353,18 +352,22 @@ struct Typ { char name[NString]; int dark; int align; - size_t size; - int nunion; - struct Seg { + uint64_t size; + uint nunion; + struct Field { enum { - SEnd, - SPad, - SInt, - SFlt, - STyp, + FEnd, + Fb, + Fh, + Fw, + Fl, + Fs, + Fd, + FPad, + FTyp, } type; - uint len; /* index in typ[] for Styp */ - } (*seg)[NSeg+1]; + uint len; /* or index in typ[] for FTyp */ + } (*fields)[NField+1]; }; struct Dat { @@ -404,7 +407,7 @@ typedef enum { Pfn, /* discarded after processing the function */ } Pool; -extern Typ typ[NTyp]; +extern Typ *typ; extern Ins insb[NIns], *curi; void die_(char *, char *, ...) __attribute__((noreturn)); void *emalloc(size_t); diff --git a/amd64/sysv.c b/amd64/sysv.c index dcaa812..ea81eee 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -19,32 +19,37 @@ struct RAlloc { static void classify(AClass *a, Typ *t, int *pn, int *pe) { - Seg *seg; - int n, s, *cls; + Field *fld; + int s, *cls; + uint n; for (n=0; nnunion; n++) { - seg = t->seg[n]; + fld = t->fields[n]; for (s=0; *pe<2; (*pe)++) { cls = &a->cls[*pe]; for (; *pn<8; s++) { - switch (seg[s].type) { - case SEnd: + switch (fld[s].type) { + case FEnd: goto Done; - case SPad: + case FPad: /* don't change anything */ break; - case SFlt: + case Fs: + case Fd: if (*cls == Kx) *cls = Kd; break; - case SInt: + case Fb: + case Fh: + case Fw: + case Fl: *cls = Kl; break; - case STyp: - classify(a, &typ[seg[s].len], pn, pe); + case FTyp: + classify(a, &typ[fld[s].len], pn, pe); continue; } - *pn += seg[s].len; + *pn += fld[s].len; } Done: assert(*pn <= 8); diff --git a/parse.c b/parse.c index 69bd74e..81cbe9e 100644 --- a/parse.c +++ b/parse.c @@ -128,7 +128,7 @@ static Blk **blink; static Blk *blkh[BMask+1]; static int nblk; static int rcls; -static int ntyp; +static uint ntyp; void err(char *s, ...) @@ -827,27 +827,27 @@ parsefn(int export) } static void -parseseg(Seg *seg, Typ *ty, int t) +parsefields(Field *fld, Typ *ty, int t) { Typ *ty1; int n, c, a, al, type; - size_t sz, s; + uint64_t sz, s; n = 0; sz = 0; al = ty->align; while (t != Trbrace) { - type = SInt; + ty1 = 0; switch (t) { default: err("invalid type member specifier"); - case Td: type = SFlt; - case Tl: s = 8; a = 3; break; - case Ts: type = SFlt; - case Tw: s = 4; a = 2; break; - case Th: s = 2; a = 1; break; - case Tb: s = 1; a = 0; break; + case Td: type = Fd; s = 8; a = 3; break; + case Tl: type = Fl; s = 8; a = 3; break; + case Ts: type = Fs; s = 4; a = 2; break; + case Tw: type = Fw; s = 4; a = 2; break; + case Th: type = Fh; s = 2; a = 1; break; + case Tb: type = Fb; s = 1; a = 0; break; case Ttyp: - type = STyp; + type = FTyp; ty1 = &typ[findtyp(ntyp-1)]; s = ty1->size; a = ty1->align; @@ -855,12 +855,13 @@ parseseg(Seg *seg, Typ *ty, int t) } if (a > al) al = a; - if ((a = sz & (s-1))) { + a = sz & (s-1); + if (a) { a = s - a; - if (n < NSeg) { - /* padding segment */ - seg[n].type = SPad; - seg[n].len = a; + if (n < NField) { + /* padding */ + fld[n].type = FPad; + fld[n].len = a; n++; } } @@ -871,11 +872,11 @@ parseseg(Seg *seg, Typ *ty, int t) } else c = 1; sz += a + c*s; - if (type == STyp) + if (type == FTyp) s = ty1 - typ; - for (; c>0 && n0 && nsize) sz = ty->size; @@ -895,10 +896,14 @@ static void parsetyp() { Typ *ty; - int t, n, al; + int t, al; + uint n; - if (ntyp >= NTyp) - err("too many type definitions"); + /* be careful if extending the syntax + * to handle nested types, any pointer + * held to typ[] might be invalidated! + */ + vgrow(&typ, ntyp+1); ty = &typ[ntyp++]; ty->dark = 0; ty->align = -1; @@ -928,17 +933,17 @@ parsetyp() return; } n = 0; - ty->seg = vnew(1, sizeof ty->seg[0], Pheap); + ty->fields = vnew(1, sizeof ty->fields[0], Pheap); if (t == Tlbrace) do { if (t != Tlbrace) err("invalid union member"); - vgrow(&ty->seg, n+1); - parseseg(ty->seg[n++], ty, nextnl()); + vgrow(&ty->fields, n+1); + parsefields(ty->fields[n++], ty, nextnl()); t = nextnl(); } while (t != Trbrace); else - parseseg(ty->seg[n++], ty, t); + parsefields(ty->fields[n++], ty, t); ty->nunion = n; } @@ -1049,6 +1054,7 @@ parse(FILE *f, char *path, void data(Dat *), void func(Fn *)) lnum = 1; thead = Txxx; ntyp = 0; + typ = vnew(0, sizeof typ[0], Pheap); for (;;) { export = 0; switch (nextnl()) { diff --git a/util.c b/util.c index aae1481..4144f87 100644 --- a/util.c +++ b/util.c @@ -22,7 +22,7 @@ enum { NPtr = 256, }; -Typ typ[NTyp]; +Typ *typ; Ins insb[NIns], *curi; static void *ptr[NPtr]; From 61090c758d36f3919a222efe01c9794fdf7987ef Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:31:59 -0400 Subject: [PATCH 086/286] new arm64 backend, yeepee --- Makefile | 17 +- README | 4 +- arm64/abi.c | 703 +++++++++++++++++++++++++++++++++++++++++++++++++++ arm64/all.h | 37 +++ arm64/emit.c | 455 +++++++++++++++++++++++++++++++++ arm64/isel.c | 266 +++++++++++++++++++ arm64/targ.c | 51 ++++ main.c | 2 + ops.h | 3 + parse.c | 3 + 10 files changed, 1537 insertions(+), 4 deletions(-) create mode 100644 arm64/abi.c create mode 100644 arm64/all.h create mode 100644 arm64/emit.c create mode 100644 arm64/isel.c create mode 100644 arm64/targ.c diff --git a/Makefile b/Makefile index 2433e25..6c0b429 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,12 @@ OBJDIR = obj SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c \ fold.c live.c spill.c rega.c gas.c AMD64SRC = amd64/targ.c amd64/sysv.c amd64/isel.c amd64/emit.c -SRCALL = $(SRC) $(AMD64SRC) +ARM64SRC = arm64/targ.c arm64/abi.c arm64/isel.c arm64/emit.c +SRCALL = $(SRC) $(AMD64SRC) $(ARM64SRC) AMD64OBJ = $(AMD64SRC:%.c=$(OBJDIR)/%.o) -OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) +ARM64OBJ = $(ARM64SRC:%.c=$(OBJDIR)/%.o) +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) $(ARM64OBJ) CFLAGS += -Wall -Wextra -std=c99 -g -pedantic @@ -24,10 +26,12 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/timestamp $(OBJDIR)/timestamp: @mkdir -p $(OBJDIR) @mkdir -p $(OBJDIR)/amd64 + @mkdir -p $(OBJDIR)/arm64 @touch $@ $(OBJ): all.h ops.h $(AMD64OBJ): amd64/all.h +$(ARM64OBJ): arm64/all.h obj/main.o: config.h config.h: @@ -38,7 +42,14 @@ config.h: ;; \ *) \ echo "#define Defasm Gaself"; \ - echo "#define Deftgt T_amd64_sysv"; \ + case `uname -m` in \ + *aarch64*) \ + echo "$define Deftgt T_arm64"; \ + ;; \ + *) \ + echo "#define Deftgt T_amd64_sysv";\ + ;; \ + esac \ ;; \ esac > $@ diff --git a/README b/README index cabfe1f..8c30a1b 100644 --- a/README +++ b/README @@ -3,7 +3,9 @@ QBE - Backend Compiler http://c9x.me/compile/ doc/ Documentation. minic/ An example C frontend for QBE. tools/ Miscellaneous tools (testing). -test/ Unit tests. +test/ Tests. +amd64/ +arm64/ Architecture-specific code. The LICENSE file applies to all files distributed. diff --git a/arm64/abi.c b/arm64/abi.c new file mode 100644 index 0000000..b340af2 --- /dev/null +++ b/arm64/abi.c @@ -0,0 +1,703 @@ +#include "all.h" + +typedef struct Class_ Class; +typedef struct Insl Insl; +typedef struct Params Params; + +enum { + Cstk = 1, /* pass on the stack */ + Cptr = 2, /* replaced by a pointer */ +}; + +struct Class_ { + char class; + char ishfa; + struct { + char base; + uchar size; + } hfa; + uint size; + Typ *t; + uchar nreg; + uchar ngp; + uchar nfp; + int reg[4]; + int cls[4]; +}; + +struct Insl { + Ins i; + Insl *link; +}; + +struct Params { + uint ngp; + uint nfp; + uint nstk; +}; + +static int gpreg[12] = {R0, R1, R2, R3, R4, R5, R6, R7}; +static int fpreg[12] = {V0, V1, V2, V3, V4, V5, V6, V7}; + +/* layout of call's second argument (RCall) + * + * 29 13 9 5 2 0 + * |0.00|x|xxxx|xxxx|xxx|xx| range + * | | | | ` gp regs returned (0..2) + * | | | ` fp regs returned (0..4) + * | | ` gp regs passed (0..8) + * | ` fp regs passed (0..8) + * ` is x8 used (0..1) + */ + +static int +isfloatv(Typ *t, char *cls) +{ + Field *f; + uint n; + + for (n=0; nnunion; n++) + for (f=t->fields[n]; f->type != FEnd; f++) + switch (f->type) { + case Fs: + if (*cls == Kd) + return 0; + *cls = Ks; + break; + case Fd: + if (*cls == Ks) + return 0; + *cls = Kd; + break; + case FTyp: + if (isfloatv(&typ[f->len], cls)) + break; + default: + return 0; + } + return 1; +} + +static void +typclass(Class *c, Typ *t, int *gp, int *fp) +{ + uint64_t sz; + uint n; + + sz = (t->size + 7) & -8; + c->t = t; + c->class = 0; + c->ngp = 0; + c->nfp = 0; + + if (t->align > 4) + err("alignments larger than 16 are not supported"); + + if (t->dark || sz > 16 || sz == 0) { + /* large structs are replaced by a + * pointer to some caller-allocated + * memory */ + c->class |= Cptr; + c->size = 8; + return; + } + + c->size = sz; + c->hfa.base = Kx; + c->ishfa = isfloatv(t, &c->hfa.base); + c->hfa.size = t->size/(KWIDE(c->hfa.base) ? 8 : 4); + + if (c->ishfa) + for (n=0; nhfa.size; n++, c->nfp++) { + c->reg[n] = *fp++; + c->cls[n] = c->hfa.base; + } + else + for (n=0; nngp++) { + c->reg[n] = *gp++; + c->cls[n] = Kl; + } + + c->nreg = n; +} + +static void +sttmps(Ref tmp[], int cls[], uint nreg, Ref mem, Fn *fn) +{ + static int st[] = { + [Kw] = Ostorew, [Kl] = Ostorel, + [Ks] = Ostores, [Kd] = Ostored + }; + uint n; + uint64_t off; + Ref r; + + assert(nreg <= 4); + off = 0; + for (n=0; njmp.type; + + if (!isret(j) || j == Jret0) + return; + + r = b->jmp.arg; + b->jmp.type = Jret0; + + if (j == Jretc) { + typclass(&cr, &typ[fn->retty], gpreg, fpreg); + cty = (cr.nfp << 2) | cr.ngp; + if (cr.class & Cptr) { + assert(rtype(fn->retr) == RTmp); + blit(fn->retr, 0, r, cr.t->size, fn); + } else + ldregs(cr.reg, cr.cls, cr.nreg, r, fn); + } else { + k = j - Jretw; + if (KBASE(k) == 0) { + emit(Ocopy, k, TMP(R0), r, R); + cty = 1; + } else { + emit(Ocopy, k, TMP(V0), r, R); + cty = 1 << 2; + } + } + + b->jmp.arg = CALL(cty); +} + +static int +argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env) +{ + int ngp, nfp, *gp, *fp; + Class *c; + Ins *i; + + gp = gpreg; + fp = fpreg; + ngp = 8; + nfp = 8; + for (i=i0, c=carg; iop) { + case Opar: + case Oarg: + c->cls[0] = i->cls; + c->size = 8; + if (KBASE(i->cls) == 0 && ngp > 0) { + ngp--; + c->reg[0] = *gp++; + break; + } + if (KBASE(i->cls) == 1 && nfp > 0) { + nfp--; + c->reg[0] = *fp++; + break; + } + c->class |= Cstk; + break; + case Oparc: + case Oargc: + typclass(c, &typ[i->arg[0].val], gp, fp); + if (c->class & Cptr) { + if (ngp > 0) { + ngp--; + c->reg[0] = *gp++; + c->cls[0] = Kl; + break; + } + } else if (c->ngp <= ngp) { + if (c->nfp <= nfp) { + ngp -= c->ngp; + nfp -= c->nfp; + gp += c->ngp; + fp += c->nfp; + break; + } else + nfp = 0; + } else + ngp = 0; + c->class |= Cstk; + break; + case Opare: + *env = i->to; + break; + case Oarge: + *env = i->arg[0]; + break; + } + + return ((gp-gpreg) << 5) | ((fp-fpreg) << 9); +} + +bits +arm64_retregs(Ref r, int p[2]) +{ + bits b; + int ngp, nfp; + + assert(rtype(r) == RCall); + ngp = r.val & 3; + nfp = (r.val >> 2) & 7; + if (p) { + p[0] = ngp; + p[1] = nfp; + } + b = 0; + while (ngp--) + b |= BIT(R0+ngp); + while (nfp--) + b |= BIT(V0+nfp); + return b; +} + +bits +arm64_argregs(Ref r, int p[2]) +{ + bits b; + int ngp, nfp, x8; + + assert(rtype(r) == RCall); + ngp = (r.val >> 5) & 15; + nfp = (r.val >> 9) & 15; + x8 = (r.val >> 13) & 1; + if (p) { + p[0] = ngp + x8; + p[1] = nfp; + } + b = 0; + while (ngp--) + b |= BIT(R0+ngp); + while (nfp--) + b |= BIT(V0+nfp); + return b | ((bits)x8 << R8); +} + +static void +stkblob(Ref r, Class *c, Fn *fn, Insl **ilp) +{ + Insl *il; + int al; + + il = alloc(sizeof *il); + al = c->t->align - 2; /* NAlign == 3 */ + if (al < 0) + al = 0; + il->i = (Ins){ + Oalloc + al, r, + {getcon(c->t->size, fn)}, Kl + }; + il->link = *ilp; + *ilp = il; +} + +static void +selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) +{ + Ins *i; + Class *ca, *c, cr; + int cty, envc; + uint n; + uint64_t stk, off; + Ref r, rstk, env, tmp[4]; + + env = R; + ca = alloc((i1-i0) * sizeof ca[0]); + cty = argsclass(i0, i1, ca, &env); + + stk = 0; + for (i=i0, c=ca; iclass & Cptr) { + i->arg[0] = newtmp("abi", Kl, fn); + stkblob(i->arg[0], c, fn, ilp); + i->op = Oarg; + } + if (c->class & Cstk) + stk += c->size; + } + stk += stk & 15; + rstk = getcon(stk, fn); + if (stk) + emit(Oadd, Kl, TMP(SP), TMP(SP), rstk); + + if (!req(i1->arg[1], R)) { + typclass(&cr, &typ[i1->arg[1].val], gpreg, fpreg); + stkblob(i1->to, &cr, fn, ilp); + cty |= (cr.nfp << 2) | cr.ngp; + if (cr.class & Cptr) { + cty |= 1 << 13; + emit(Ocopy, Kw, R, TMP(R0), R); + } else { + sttmps(tmp, cr.cls, cr.nreg, i1->to, fn); + for (n=0; ncls) == 0) { + emit(Ocopy, i1->cls, i1->to, TMP(R0), R); + cty |= 1; + } else { + emit(Ocopy, i1->cls, i1->to, TMP(V0), R); + cty |= 1 << 2; + } + } + + envc = !req(R, env); + if (envc) + die("todo (arm abi): env calls"); + emit(Ocall, 0, R, i1->arg[0], CALL(cty)); + + if (cty & (1 << 13)) + /* struct return argument */ + emit(Ocopy, Kl, TMP(R8), i1->to, R); + + for (i=i0, c=ca; iclass & Cstk) != 0) + continue; + if (i->op != Oargc) + emit(Ocopy, *c->cls, TMP(*c->reg), i->arg[0], R); + else + ldregs(c->reg, c->cls, c->nreg, i->arg[1], fn); + } + + off = 0; + for (i=i0, c=ca; iclass & Cstk) == 0) + continue; + if (i->op != Oargc) { + r = newtmp("abi", Kl, fn); + emit(Ostorel, 0, R, i->arg[0], r); + emit(Oadd, Kl, r, TMP(SP), getcon(off, fn)); + } else + blit(TMP(SP), off, i->arg[1], c->size, fn); + off += c->size; + } + if (stk) + emit(Osub, Kl, TMP(SP), TMP(SP), rstk); + + for (i=i0, c=ca; iclass & Cptr) + blit(i->arg[0], 0, i->arg[1], c->t->size, fn); +} + +static Params +selpar(Fn *fn, Ins *i0, Ins *i1) +{ + Class *ca, *c, cr; + Insl *il; + Ins *i; + int n, s, cty; + Ref r, env, tmp[16], *t; + + env = R; + ca = alloc((i1-i0) * sizeof ca[0]); + curi = &insb[NIns]; + + cty = argsclass(i0, i1, ca, &env); + + il = 0; + t = tmp; + for (i=i0, c=ca; iop != Oparc || (c->class & (Cptr|Cstk))) + continue; + sttmps(t, c->cls, c->nreg, i->to, fn); + stkblob(i->to, c, fn, &il); + t += c->nreg; + } + for (; il; il=il->link) + emiti(il->i); + + if (fn->retty >= 0) { + typclass(&cr, &typ[fn->retty], gpreg, fpreg); + if (cr.class & Cptr) { + fn->retr = newtmp("abi", Kl, fn); + emit(Ocopy, Kl, fn->retr, TMP(R8), R); + } + } + + t = tmp; + for (i=i0, c=ca, s=2; iop == Oparc + && (c->class & Cptr) == 0) { + if (c->class & Cstk) { + fn->tmp[i->to.val].slot = -s; + s += c->size / 8; + } else + for (n=0; nnreg; n++) { + r = TMP(c->reg[n]); + emit(Ocopy, c->cls[n], *t++, r, R); + } + } else if (c->class & Cstk) { + r = newtmp("abi", Kl, fn); + emit(Oload, *c->cls, i->to, r, R); + emit(Oaddr, Kl, r, SLOT(-s), R); + s++; + } else { + r = TMP(*c->reg); + emit(Ocopy, *c->cls, i->to, r, R); + } + } + + if (!req(R, env)) + die("todo (arm abi): env calls"); + + return (Params){ + .nstk = s - 2, + .ngp = (cty >> 5) & 15, + .nfp = (cty >> 9) & 15 + }; +} + +static Blk * +split(Fn *fn, Blk *b) +{ + Blk *bn; + + ++fn->nblk; + bn = blknew(); + bn->nins = &insb[NIns] - curi; + idup(&bn->ins, curi, bn->nins); + curi = &insb[NIns]; + bn->visit = ++b->visit; + snprintf(bn->name, NString, "%s.%d", b->name, b->visit); + bn->loop = b->loop; + bn->link = b->link; + b->link = bn; + return bn; +} + +static void +chpred(Blk *b, Blk *bp, Blk *bp1) +{ + Phi *p; + uint a; + + for (p=b->phi; p; p=p->link) { + for (a=0; p->blk[a]!=bp; a++) + assert(a+1narg); + p->blk[a] = bp1; + } +} + +static void +selvaarg(Fn *fn, Blk *b, Ins *i) +{ + Ref loc, lreg, lstk, nr, r0, r1, c8, c16, c24, c28, ap; + Blk *b0, *bstk, *breg; + int isgp; + + c8 = getcon(8, fn); + c16 = getcon(16, fn); + c24 = getcon(24, fn); + c28 = getcon(28, fn); + ap = i->arg[0]; + isgp = KBASE(i->cls) == 0; + + /* @b [...] + r0 =l add ap, (24 or 28) + nr =l loadsw r0 + r1 =w csltw nr, 0 + jnz r1, @breg, @bstk + @breg + r0 =l add ap, (8 or 16) + r1 =l loadl r0 + lreg =l add r1, nr + r0 =w add nr, (8 or 16) + r1 =l add ap, (24 or 28) + storew r0, r1 + @bstk + lstk =l loadl ap + r0 =l add lstk, 8 + storel r0, ap + @b0 + %loc =l phi @breg %lreg, @bstk %lstk + i->to =(i->cls) load %loc + */ + + loc = newtmp("abi", Kl, fn); + emit(Oload, i->cls, i->to, loc, R); + b0 = split(fn, b); + b0->jmp = b->jmp; + b0->s1 = b->s1; + b0->s2 = b->s2; + if (b->s1) + chpred(b->s1, b, b0); + if (b->s2 && b->s2 != b->s1) + chpred(b->s2, b, b0); + + lreg = newtmp("abi", Kl, fn); + nr = newtmp("abi", Kl, fn); + r0 = newtmp("abi", Kw, fn); + r1 = newtmp("abi", Kl, fn); + emit(Ostorew, Kw, R, r0, r1); + emit(Oadd, Kl, r1, ap, isgp ? c24 : c28); + emit(Oadd, Kw, r0, nr, isgp ? c8 : c16); + r0 = newtmp("abi", Kl, fn); + r1 = newtmp("abi", Kl, fn); + emit(Oadd, Kl, lreg, r1, nr); + emit(Oload, Kl, r1, r0, R); + emit(Oadd, Kl, r0, ap, isgp ? c8 : c16); + breg = split(fn, b); + breg->jmp.type = Jjmp; + breg->s1 = b0; + + lstk = newtmp("abi", Kl, fn); + r0 = newtmp("abi", Kl, fn); + emit(Ostorel, Kw, R, r0, ap); + emit(Oadd, Kl, r0, lstk, c8); + emit(Oload, Kl, lstk, ap, R); + bstk = split(fn, b); + bstk->jmp.type = Jjmp; + bstk->s1 = b0; + + b0->phi = alloc(sizeof *b0->phi); + *b0->phi = (Phi){ + .cls = Kl, .to = loc, + .narg = 2, + .blk = {bstk, breg}, + .arg = {lstk, lreg}, + }; + r0 = newtmp("abi", Kl, fn); + r1 = newtmp("abi", Kw, fn); + b->jmp.type = Jjnz; + b->jmp.arg = r1; + b->s1 = breg; + b->s2 = bstk; + emit(Ocmpw+Cislt, Kw, r1, nr, CON_Z); + emit(Oloadsw, Kl, nr, r0, R); + emit(Oadd, Kl, r0, ap, isgp ? c24 : c28); +} + +static void +selvastart(Fn *fn, Params p, Ref ap) +{ + Ref r0, r1, rsave; + + rsave = newtmp("abi", Kl, fn); + + r0 = newtmp("abi", Kl, fn); + emit(Ostorel, Kw, R, r0, ap); + emit(Oadd, Kl, r0, rsave, getcon(p.nstk*8 + 192, fn)); + + r0 = newtmp("abi", Kl, fn); + r1 = newtmp("abi", Kl, fn); + emit(Ostorel, Kw, R, r1, r0); + emit(Oadd, Kl, r1, rsave, getcon(64, fn)); + emit(Oadd, Kl, r0, ap, getcon(8, fn)); + + r0 = newtmp("abi", Kl, fn); + r1 = newtmp("abi", Kl, fn); + emit(Ostorel, Kw, R, r1, r0); + emit(Oadd, Kl, r1, rsave, getcon(192, fn)); + emit(Oaddr, Kl, rsave, SLOT(-1), R); + emit(Oadd, Kl, r0, ap, getcon(16, fn)); + + r0 = newtmp("abi", Kl, fn); + emit(Ostorew, Kw, R, getcon((p.ngp-8)*8, fn), r0); + emit(Oadd, Kl, r0, ap, getcon(24, fn)); + + r0 = newtmp("abi", Kl, fn); + emit(Ostorew, Kw, R, getcon((p.nfp-8)*16, fn), r0); + emit(Oadd, Kl, r0, ap, getcon(28, fn)); +} + +void +arm64_abi(Fn *fn) +{ + Blk *b; + Ins *i, *i0, *ip; + Insl *il; + int n; + Params p; + + for (b=fn->start; b; b=b->link) + b->visit = 0; + + /* lower parameters */ + for (b=fn->start, i=b->ins; i-b->insnins; i++) + if (!ispar(i->op)) + break; + p = selpar(fn, b->ins, i); + n = b->nins - (i - b->ins) + (&insb[NIns] - curi); + i0 = alloc(n * sizeof(Ins)); + ip = icpy(ip = i0, curi, &insb[NIns] - curi); + ip = icpy(ip, i, &b->ins[b->nins] - i); + b->nins = n; + b->ins = i0; + + /* lower calls, returns, and vararg instructions */ + il = 0; + b = fn->start; + do { + if (!(b = b->link)) + b = fn->start; /* do it last */ + if (b->visit) + continue; + curi = &insb[NIns]; + selret(b, fn); + for (i=&b->ins[b->nins]; i!=b->ins;) + switch ((--i)->op) { + default: + emiti(*i); + break; + case Ocall: + case Ovacall: + for (i0=i; i0>b->ins; i0--) + if (!isarg((i0-1)->op)) + break; + selcall(fn, i0, i, &il); + i = i0; + break; + case Ovastart: + selvastart(fn, p, i->arg[0]); + break; + case Ovaarg: + selvaarg(fn, b, i); + break; + case Oarg: + case Oargc: + die("unreachable"); + } + if (b == fn->start) + for (; il; il=il->link) + emiti(il->i); + b->nins = &insb[NIns] - curi; + idup(&b->ins, curi, b->nins); + } while (b != fn->start); + + if (debug['A']) { + fprintf(stderr, "\n> After ABI lowering:\n"); + printfn(fn, stderr); + } +} diff --git a/arm64/all.h b/arm64/all.h new file mode 100644 index 0000000..0b3073a --- /dev/null +++ b/arm64/all.h @@ -0,0 +1,37 @@ +#include "../all.h" + +enum Arm64Reg { + R0 = RXX + 1, + R1, R2, R3, R4, R5, R6, R7, + R8, R9, R10, R11, R12, R13, R14, R15, + IP0, IP1, R18, R19, R20, R21, R22, R23, + R24, R25, R26, R27, R28, FP, LR, SP, + + V0, V1, V2, V3, V4, V5, V6, V7, + V8, V9, V10, V11, V12, V13, V14, V15, + V16, V17, V18, V19, V20, V21, V22, V23, + V24, V25, V26, V27, V28, V29, V30, /* V31, */ + + NFPR = V30 - V0 + 1, + NGPR = SP - R0 + 1, + NGPS = R18 - R0 + 1, + NFPS = (V7 - V0 + 1) + (V30 - V16 + 1), + NCLR = (R28 - R19 + 1) + (V15 - V8 + 1), +}; +MAKESURE(reg_not_tmp, V30 < (int)Tmp0); + +/* targ.c */ +extern int arm64_rsave[]; +extern int arm64_rclob[]; + +/* abi.c */ +bits arm64_retregs(Ref, int[2]); +bits arm64_argregs(Ref, int[2]); +void arm64_abi(Fn *); + +/* isel.c */ +int arm64_logimm(uint64_t, int); +void arm64_isel(Fn *); + +/* emit.c */ +void arm64_emitfn(Fn *, FILE *); diff --git a/arm64/emit.c b/arm64/emit.c new file mode 100644 index 0000000..1b71179 --- /dev/null +++ b/arm64/emit.c @@ -0,0 +1,455 @@ +#include "all.h" + +typedef struct E E; + +struct E { + FILE *f; + Fn *fn; + uint64_t frame; + uint padding; +}; + +#define CMP(X) \ + X(Cieq, "eq") \ + X(Cine, "ne") \ + X(Cisge, "ge") \ + X(Cisgt, "gt") \ + X(Cisle, "le") \ + X(Cislt, "lt") \ + X(Ciuge, "cs") \ + X(Ciugt, "hi") \ + X(Ciule, "ls") \ + X(Ciult, "cc") \ + X(NCmpI+Cfeq, "eq") \ + X(NCmpI+Cfge, "ge") \ + X(NCmpI+Cfgt, "gt") \ + X(NCmpI+Cfle, "ls") \ + X(NCmpI+Cflt, "mi") \ + X(NCmpI+Cfne, "ne") \ + X(NCmpI+Cfo, "vc") \ + X(NCmpI+Cfuo, "vs") + +enum { + Ki = -1, /* matches Kw and Kl */ + Ka = -2, /* matches all classes */ +}; + +static struct { + short op; + short cls; + char *asm; +} omap[] = { + { Oadd, Ki, "add %=, %0, %1" }, + { Oadd, Ka, "fadd %=, %0, %1" }, + { Osub, Ki, "sub %=, %0, %1" }, + { Osub, Ka, "fsub %=, %0, %1" }, + { Oand, Ki, "and %=, %0, %1" }, + { Oor, Ki, "orr %=, %0, %1" }, + { Oxor, Ki, "eor %=, %0, %1" }, + { Osar, Ki, "asr %=, %0, %1" }, + { Oshr, Ki, "lsr %=, %0, %1" }, + { Oshl, Ki, "lsl %=, %0, %1" }, + { Omul, Ki, "mul %=, %0, %1" }, + { Omul, Ka, "fmul %=, %0, %1" }, + { Odiv, Ki, "sdiv %=, %0, %1" }, + { Odiv, Ka, "fdiv %=, %0, %1" }, + { Oudiv, Ki, "udiv %=, %0, %1" }, + { Orem, Ki, "sdiv %?, %0, %1\n\tmsub\t%=, %?, %1, %0" }, + { Ourem, Ki, "udiv %?, %0, %1\n\tmsub\t%=, %?, %1, %0" }, + { Ocopy, Ki, "mov %=, %0" }, + { Ocopy, Ka, "fmov %=, %0" }, + { Oswap, Ki, "mov %?, %0\n\tmov\t%0, %1\n\tmov\t%1, %?" }, + { Oswap, Ka, "fmov %?, %0\n\tfmov\t%0, %1\n\tfmov\t%1, %?" }, + { Ostoreb, Kw, "strb %W0, %M1" }, + { Ostoreh, Kw, "strh %W0, %M1" }, + { Ostorew, Kw, "str %W0, %M1" }, + { Ostorel, Kw, "str %L0, %M1" }, + { Ostores, Kw, "str %S0, %M1" }, + { Ostored, Kw, "str %D0, %M1" }, + { Oloadsb, Ki, "ldrsb %=, %M0" }, + { Oloadub, Ki, "ldrb %=, %M0" }, + { Oloadsh, Ki, "ldrsh %=, %M0" }, + { Oloaduh, Ki, "ldrh %=, %M0" }, + { Oloadsw, Kw, "ldr %=, %M0" }, + { Oloadsw, Kl, "ldrsw %=, %M0" }, + { Oloaduw, Ki, "ldr %W=, %M0" }, + { Oload, Ka, "ldr %=, %M0" }, + { Oextsb, Ki, "sxtb %=, %W0" }, + { Oextub, Ki, "uxtb %W=, %W0" }, + { Oextsh, Ki, "sxth %=, %W0" }, + { Oextuh, Ki, "uxth %W=, %W0" }, + { Oextsw, Ki, "sxtw %L=, %W0" }, + { Oextuw, Ki, "mov %W=, %W0" }, + { Oexts, Kd, "fcvt %=, %S0" }, + { Ocast, Kw, "fmov %=, %S0" }, + { Ocast, Kl, "fmov %=, %D0" }, + { Ocast, Ks, "fmov %=, %W0" }, + { Ocast, Kd, "fmov %=, %L0" }, + { Ostosi, Ka, "fcvtzs %=, %S0" }, + { Odtosi, Ka, "fcvtzs %=, %D0" }, + { Oswtof, Ka, "scvtf %=, %W0" }, + { Osltof, Ka, "scvtf %=, %L0" }, + { Ocall, Kw, "blr %L0" }, + + { Oacmp, Ki, "cmp %0, %1" }, + { Oacmn, Ki, "cmn %0, %1" }, + { Oafcmp, Ka, "fcmpe %0, %1" }, + +#define X(c, str) \ + { Oflag+c, Ki, "cset %=, " str }, + CMP(X) +#undef X + { NOp, 0, 0 } +}; + +static char * +rname(int r, int k) +{ + static char buf[4]; + + if (r == SP) { + assert(k == Kl); + sprintf(buf, "sp"); + } + else if (R0 <= r && r <= LR) + switch (k) { + default: die("invalid class"); + case Kw: sprintf(buf, "w%d", r-R0); break; + case Kx: + case Kl: sprintf(buf, "x%d", r-R0); break; + } + else if (V0 <= r && r <= V30) + switch (k) { + default: die("invalid class"); + case Ks: sprintf(buf, "s%d", r-V0); break; + case Kx: + case Kd: sprintf(buf, "d%d", r-V0); break; + } + else + die("invalid register"); + return buf; +} + +static uint64_t +slot(int s, E *e) +{ + s = ((int32_t)s << 3) >> 3; + if (s == -1) + return 16 + e->frame; + if (s < 0) { + if (e->fn->vararg) + return 16 + e->frame + 192 - (s+2)*8; + else + return 16 + e->frame - (s+2)*8; + } else + return 16 + e->padding + 4 * s; +} + +static void +emitf(char *s, Ins *i, E *e) +{ + Ref r; + int k, c; + Con *pc; + unsigned n, sp; + + fputc('\t', e->f); + + sp = 0; + for (;;) { + k = i->cls; + while ((c = *s++) != '%') + if (c == ' ' && !sp) { + fputc('\t', e->f); + sp = 1; + } else if ( !c) { + fputc('\n', e->f); + return; + } else + fputc(c, e->f); + Switch: + switch ((c = *s++)) { + default: + die("invalid escape"); + case 'W': + k = Kw; + goto Switch; + case 'L': + k = Kl; + goto Switch; + case 'S': + k = Ks; + goto Switch; + case 'D': + k = Kd; + goto Switch; + case '?': + if (KBASE(k) == 0) + fputs(rname(R18, k), e->f); + else + fputs(k==Ks ? "s31" : "d31", e->f); + break; + case '=': + case '0': + r = c == '=' ? i->to : i->arg[0]; + assert(isreg(r)); + fputs(rname(r.val, k), e->f); + break; + case '1': + r = i->arg[1]; + switch (rtype(r)) { + default: + die("invalid second argument"); + case RTmp: + assert(isreg(r)); + fputs(rname(r.val, k), e->f); + break; + case RCon: + pc = &e->fn->con[r.val]; + n = pc->bits.i; + assert(pc->type == CBits); + if (n & 0xfff000) + fprintf(e->f, "#%u, lsl #12", n>>12); + else + fprintf(e->f, "#%u", n); + break; + } + break; + case 'M': + c = *s++; + assert(c == '0' || c == '1'); + r = i->arg[c - '0']; + assert(isreg(r) && "TODO emit non reg addresses"); + fprintf(e->f, "[%s]", rname(r.val, Kl)); + break; + } + } +} + +static void +loadcon(Con *c, int r, int k, FILE *f) +{ + char *rn, *p, off[32]; + int64_t n; + int w, sh; + + w = KWIDE(k); + rn = rname(r, k); + n = c->bits.i; + if (c->type == CAddr) { + rn = rname(r, Kl); + if (n) + sprintf(off, "+%"PRIi64, n); + else + off[0] = 0; + p = c->local ? ".L" : ""; + fprintf(f, "\tadrp\t%s, %s%s%s\n", + rn, p, c->label, off); + fprintf(f, "\tadd\t%s, %s, #:lo12:%s%s%s\n", + rn, rn, p, c->label, off); + return; + } + assert(c->type == CBits); + if (!w) + n = (int32_t)n; + if ((n | 0xffff) == -1 || arm64_logimm(n, k)) { + fprintf(f, "\tmov\t%s, #%"PRIi64"\n", rn, n); + } else { + fprintf(f, "\tmov\t%s, #%d\n", + rn, (int)(n & 0xffff)); + for (sh=16; n>>=16; sh+=16) { + if ((!w && sh == 32) || sh == 64) + break; + fprintf(f, "\tmovk\t%s, #0x%x, lsl #%d\n", + rn, (unsigned)(n & 0xffff), sh); + } + } +} + +static void +emitins(Ins *i, E *e) +{ + int o; + + switch (i->op) { + default: + Table: + /* most instructions are just pulled out of + * the table omap[], some special cases are + * detailed below */ + for (o=0;; o++) { + /* this linear search should really be a binary + * search */ + if (omap[o].op == NOp) + die("no match for %s(%c)", + optab[i->op].name, "wlsd"[i->cls]); + if (omap[o].op == i->op) + if (omap[o].cls == i->cls || omap[o].cls == Ka + || (omap[o].cls == Ki && KBASE(i->cls) == 0)) + break; + } + emitf(omap[o].asm, i, e); + break; + case Onop: + break; + case Ocopy: + if (req(i->to, i->arg[0])) + break; + if (rtype(i->arg[0]) != RCon) + goto Table; + loadcon(&e->fn->con[i->arg[0].val], i->to.val, i->cls, e->f); + break; + case Oaddr: + assert(rtype(i->arg[0]) == RSlot); + fprintf(e->f, "\tadd\t%s, x29, #%"PRIu64"\n", + rname(i->to.val, Kl), slot(i->arg[0].val, e) + ); + break; + } +} + +static void +framelayout(E *e) +{ + int *r; + uint o; + uint64_t f; + + for (o=0, r=arm64_rclob; *r>=0; r++) + o += 1 & (e->fn->reg >> *r); + f = e->fn->slot; + f = (f + 3) & -4; + o += o & 1; + e->padding = 4*(f-e->fn->slot); + e->frame = 4*f + 8*o; +} + +/* + + Stack-frame layout: + + +=============+ + | varargs | + | save area | + +-------------+ + | callee-save | ^ + | registers | | + +-------------+ | + | ... | | + | spill slots | | + | ... | | e->frame + +-------------+ | + | ... | | + | locals | | + | ... | | + +-------------+ | + | e->padding | v + +-------------+ + | saved x29 | + | saved x30 | + +=============+ <- x29 + +*/ + +void +arm64_emitfn(Fn *fn, FILE *out) +{ + static char *ctoa[] = { + #define X(c, s) [c] = s, + CMP(X) + #undef X + }; + static int id0; + int n, c, lbl, *r; + uint64_t o; + Blk *b, *s; + Ins *i; + E *e; + + e = &(E){.f = out, .fn = fn}; + framelayout(e); + + fprintf(e->f, ".text\n"); + if (e->fn->export) + fprintf(e->f, ".globl %s\n", e->fn->name); + fprintf(e->f, "%s:\n", e->fn->name); + + if (e->fn->vararg) { + for (n=7; n>=0; n--) + fprintf(e->f, "\tstr\tq%d, [sp, -16]!\n", n); + for (n=7; n>=0; n--) + fprintf(e->f, "\tstr\tx%d, [sp, -8]!\n", n); + } + + if (e->frame + 16 > 512) + fprintf(e->f, + "\tsub\tsp, sp, #%"PRIu64"\n" + "\tstp\tx29, x30, [sp, -16]!\n", + e->frame + ); + else + fprintf(e->f, + "\tstp\tx29, x30, [sp, -%"PRIu64"]!\n", + e->frame + 16 + ); + fputs("\tadd\tx29, sp, 0\n", e->f); + for (o=e->frame+16, r=arm64_rclob; *r>=0; r++) + if (e->fn->reg & BIT(*r)) + fprintf(e->f, + "\tstr\t%s, [sp, %"PRIu64"]\n", + rname(*r, Kx), o -= 8 + ); + + for (lbl=0, b=e->fn->start; b; b=b->link) { + if (lbl || b->npred > 1) + fprintf(e->f, ".L%d:\n", id0+b->id); + for (i=b->ins; i!=&b->ins[b->nins]; i++) + emitins(i, e); + lbl = 1; + switch (b->jmp.type) { + case Jret0: + for (o=e->frame+16, r=arm64_rclob; *r>=0; r++) + if (e->fn->reg & BIT(*r)) + fprintf(e->f, + "\tldr\t%s, [sp, %"PRIu64"]\n", + rname(*r, Kx), o -= 8 + ); + o = e->frame + 16; + if (e->fn->vararg) + o += 192; + if (o > 504) + fprintf(e->f, + "\tldp\tx29, x30, [sp], 16\n" + "\tadd\tsp, sp, #%"PRIu64"\n", + o - 16 + ); + else + fprintf(e->f, + "\tldp\tx29, x30, [sp], %"PRIu64"\n", + o + ); + fprintf(e->f, "\tret\n"); + break; + case Jjmp: + Jmp: + if (b->s1 != b->link) + fprintf(e->f, "\tb\t.L%d\n", id0+b->s1->id); + else + lbl = 0; + break; + default: + c = b->jmp.type - Jjf; + if (c < 0 || c > NCmp) + die("unhandled jump %d", b->jmp.type); + if (b->link == b->s2) { + s = b->s1; + b->s1 = b->s2; + b->s2 = s; + } else + c = cmpneg(c); + fprintf(e->f, "\tb%s\t.L%d\n", ctoa[c], id0+b->s2->id); + goto Jmp; + } + } + id0 += e->fn->nblk; +} diff --git a/arm64/isel.c b/arm64/isel.c new file mode 100644 index 0000000..2d4e995 --- /dev/null +++ b/arm64/isel.c @@ -0,0 +1,266 @@ +#include "all.h" + +enum Imm { + Iother, + Iplo12, + Iphi12, + Iplo24, + Inlo12, + Inhi12, + Inlo24 +}; + +static enum Imm +imm(Con *c, int k, int64_t *pn) +{ + int64_t n; + int i; + + if (c->type != CBits) + return Iother; + n = c->bits.i; + if (k == Kw) + n = (int32_t)n; + i = Iplo12; + if (n < 0) { + i = Inlo12; + n = -n; + } + *pn = n; + if ((n & 0x000fff) == n) + return i; + if ((n & 0xfff000) == n) + return i + 1; + if ((n & 0xffffff) == n) + return i + 2; + return Iother; +} + +int +arm64_logimm(uint64_t x, int k) +{ + uint64_t n; + + if (k == Kw) + x = (x & 0xffffffff) | x << 32; + if (x & 1) + x = ~x; + if (x == 0) + return 0; + if (x == 0xaaaaaaaaaaaaaaaa) + return 1; + n = x & 0xf; + if (0x1111111111111111 * n == x) + goto Check; + n = x & 0xff; + if (0x0101010101010101 * n == x) + goto Check; + n = x & 0xffff; + if (0x0001000100010001 * n == x) + goto Check; + n = x & 0xffffffff; + if (0x0000000100000001 * n == x) + goto Check; + n = x; +Check: + return (n & (n + (n & -n))) == 0; +} + +static void +fixarg(Ref *pr, int k, int phi, Fn *fn) +{ + Ref r0, r1, r2; + int s, n; + Con *c; + + r0 = *pr; + switch (rtype(r0)) { + case RCon: + if (KBASE(k) == 0 && phi) + return; + r1 = newtmp("isel", k, fn); + if (KBASE(k) == 0) { + emit(Ocopy, k, r1, r0, R); + } else { + c = &fn->con[r0.val]; + n = gasstashfp(c->bits.i, KWIDE(k)); + vgrow(&fn->con, ++fn->ncon); + c = &fn->con[fn->ncon-1]; + *c = (Con){.type = CAddr, .local = 1}; + sprintf(c->label, "fp%d", n); + r2 = newtmp("isel", Kl, fn); + emit(Oload, k, r1, r2, R); + emit(Ocopy, Kl, r2, CON(c-fn->con), R); + } + *pr = r1; + break; + case RTmp: + s = fn->tmp[r0.val].slot; + if (s == -1) + break; + r1 = newtmp("isel", Kl, fn); + emit(Oaddr, Kl, r1, SLOT(s), R); + *pr = r1; + break; + } +} + +static int +selcmp(Ref arg[2], int k, Fn *fn) +{ + Ref r, *iarg; + Con *c; + int swap, cmp, fix; + int64_t n; + + if (KBASE(k) == 1) { + emit(Oafcmp, k, R, arg[0], arg[1]); + iarg = curi->arg; + fixarg(&iarg[0], k, 0, fn); + fixarg(&iarg[1], k, 0, fn); + return 0; + } + swap = rtype(arg[0]) == RCon; + if (swap) { + r = arg[1]; + arg[1] = arg[0]; + arg[0] = r; + } + fix = 1; + cmp = Oacmp; + r = arg[1]; + if (rtype(r) == RCon) { + c = &fn->con[r.val]; + switch (imm(c, k, &n)) { + default: + break; + case Iplo12: + case Iphi12: + fix = 0; + break; + case Inlo12: + case Inhi12: + cmp = Oacmn; + r = getcon(n, fn); + fix = 0; + break; + } + } + emit(cmp, k, R, arg[0], r); + iarg = curi->arg; + fixarg(&iarg[0], k, 0, fn); + if (fix) + fixarg(&iarg[1], k, 0, fn); + return swap; +} + +static void +sel(Ins i, Fn *fn) +{ + Ref *iarg; + Ins *i0; + int ck, cc; + + if (iscmp(i.op, &ck, &cc)) { + emit(Oflag, i.cls, i.to, R, R); + i0 = curi; + if (selcmp(i.arg, ck, fn)) + i0->op += cmpop(cc); + else + i0->op += cc; + } else if (i.op != Onop) { + emiti(i); + iarg = curi->arg; /* fixarg() can change curi */ + fixarg(&iarg[0], argcls(&i, 0), 0, fn); + fixarg(&iarg[1], argcls(&i, 1), 0, fn); + } +} + +static void +seljmp(Blk *b, Fn *fn) +{ + Ref r; + Ins *i, *ir; + int ck, cc, use; + + switch (b->jmp.type) { + default: + assert(0 && "TODO 2"); + break; + case Jret0: + case Jjmp: + return; + case Jjnz: + break; + } + r = b->jmp.arg; + use = -1; + b->jmp.arg = R; + ir = 0; + i = &b->ins[b->nins]; + while (i > b->ins) + if (req((--i)->to, r)) { + use = fn->tmp[r.val].nuse; + ir = i; + break; + } + if (ir && use == 1 + && iscmp(ir->op, &ck, &cc)) { + if (selcmp(ir->arg, ck, fn)) + cc = cmpop(cc); + b->jmp.type = Jjf + cc; + *ir = (Ins){.op = Onop}; + } + else { + selcmp((Ref[]){r, CON_Z}, Kw, fn); + b->jmp.type = Jjfine; + } +} + +void +arm64_isel(Fn *fn) +{ + Blk *b, **sb; + Ins *i; + Phi *p; + uint n, al; + int64_t sz; + + /* assign slots to fast allocs */ + b = fn->start; + /* specific to NAlign == 3 */ /* or change n=4 and sz /= 4 below */ + for (al=Oalloc, n=4; al<=Oalloc1; al++, n*=2) + for (i=b->ins; i-b->ins < b->nins; i++) + if (i->op == al) { + if (rtype(i->arg[0]) != RCon) + break; + sz = fn->con[i->arg[0].val].bits.i; + if (sz < 0 || sz >= INT_MAX-15) + err("invalid alloc size %"PRId64, sz); + sz = (sz + n-1) & -n; + sz /= 4; + fn->tmp[i->to.val].slot = fn->slot; + fn->slot += sz; + *i = (Ins){.op = Onop}; + } + + for (b=fn->start; b; b=b->link) { + curi = &insb[NIns]; + for (sb=(Blk*[3]){b->s1, b->s2, 0}; *sb; sb++) + for (p=(*sb)->phi; p; p=p->link) { + for (n=0; p->blk[n] != b; n++) + assert(n+1 < p->narg); + fixarg(&p->arg[n], p->cls, 1, fn); + } + seljmp(b, fn); + for (i=&b->ins[b->nins]; i!=b->ins;) + sel(*--i, fn); + b->nins = &insb[NIns] - curi; + idup(&b->ins, curi, b->nins); + } + + if (debug['I']) { + fprintf(stderr, "\n> After instruction selection:\n"); + printfn(fn, stderr); + } +} diff --git a/arm64/targ.c b/arm64/targ.c new file mode 100644 index 0000000..ead6932 --- /dev/null +++ b/arm64/targ.c @@ -0,0 +1,51 @@ +#include "all.h" + +int arm64_rsave[] = { + R0, R1, R2, R3, R4, R5, R6, R7, + R8, R9, R10, R11, R12, R13, R14, R15, + IP0, IP1, R18, + V0, V1, V2, V3, V4, V5, V6, V7, + V16, V17, V18, V19, V20, V21, V22, V23, + V24, V25, V26, V27, V28, V29, V30, + -1 +}; +int arm64_rclob[] = { + R19, R20, R21, R22, R23, R24, R25, R26, + R27, R28, + V8, V9, V10, V11, V12, V13, V14, V15, + -1 +}; + +#define RGLOB (BIT(FP) | BIT(SP) | BIT(R18)) + +static int +arm64_memargs(int op) +{ + (void)op; + return 0; +} + +Target T_arm64 = { + .gpr0 = R0, + .ngpr = NGPR, + .fpr0 = V0, + .nfpr = NFPR, + .rglob = RGLOB, + .nrglob = 3, + .rsave = arm64_rsave, + .nrsave = {NGPS, NFPS}, + .retregs = arm64_retregs, + .argregs = arm64_argregs, + .memargs = arm64_memargs, + .abi = arm64_abi, + .isel = arm64_isel, + .emitfn = arm64_emitfn, +}; + +MAKESURE(globals_are_not_arguments, + (RGLOB & (BIT(R8+1) - 1)) == 0 +); +MAKESURE(arrays_size_ok, + sizeof arm64_rsave == (NGPS+NFPS+1) * sizeof(int) && + sizeof arm64_rclob == (NCLR+1) * sizeof(int) +); diff --git a/main.c b/main.c index 6098dee..033ed9c 100644 --- a/main.c +++ b/main.c @@ -6,12 +6,14 @@ Target T; extern Target T_amd64_sysv; +extern Target T_arm64; static struct TMap { char *name; Target *T; } tmap[] = { { "amd64_sysv", &T_amd64_sysv }, + { "arm64", &T_arm64 }, { 0, 0 } }; diff --git a/ops.h b/ops.h index 9b357a5..848671a 100644 --- a/ops.h +++ b/ops.h @@ -126,6 +126,9 @@ O(xidiv, T(w,l,e,e, x,x,e,e), 0) X(1, 0, 0) O(xdiv, T(w,l,e,e, x,x,e,e), 0) X(1, 0, 0) O(xcmp, T(w,l,s,d, w,l,s,d), 0) X(1, 1, 0) O(xtest, T(w,l,e,e, w,l,e,e), 0) X(1, 1, 0) +O(acmp, T(w,l,e,e, w,l,e,e), 0) X(0, 0, 0) +O(acmn, T(w,l,e,e, w,l,e,e), 0) X(0, 0, 0) +O(afcmp, T(e,e,s,d, e,e,s,d), 0) X(0, 0, 0) /* Arguments, Parameters, and Calls */ O(par, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) diff --git a/parse.c b/parse.c index 81cbe9e..5631bc2 100644 --- a/parse.c +++ b/parse.c @@ -1203,6 +1203,9 @@ printfn(Fn *fn, FILE *f) case Oarg: case Oswap: case Oxcmp: + case Oacmp: + case Oacmn: + case Oafcmp: case Oxtest: case Oxdiv: case Oxidiv: From e4bc35149cc790e3ad034f6643f75c33765b142c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:39:37 -0400 Subject: [PATCH 087/286] add cross testing for arm64 --- Makefile | 2 +- tools/test.sh | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++ tools/unit.sh | 128 -------------------------------------- 3 files changed, 169 insertions(+), 129 deletions(-) create mode 100755 tools/test.sh delete mode 100755 tools/unit.sh diff --git a/Makefile b/Makefile index 6c0b429..45e4b50 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ clean-gen: clean rm -f config.h check: $(OBJDIR)/$(BIN) - tools/unit.sh all + tools/test.sh all 80: @for F in $(SRCALL); \ diff --git a/tools/test.sh b/tools/test.sh new file mode 100755 index 0000000..5430ccd --- /dev/null +++ b/tools/test.sh @@ -0,0 +1,168 @@ +#!/bin/sh + +dir=`cd $(dirname "$0"); pwd` +bin=$dir/../obj/qbe + +tmp=/tmp/qbe.zzzz + +drv=$tmp.c +asm=$tmp.s +exe=$tmp.exe +out=$tmp.out + +init() { + case "$TARGET" in + arm64) + for p in aarch64-linux-musl aarch64-linux-gnu + do + cc=$p-gcc + qemu="qemu-aarch64 -L /usr/$p" + if + $cc -v >/dev/null 2>&1 && + $qemu -version >/dev/null 2>&1 && + test -d /usr/$p + then + break + fi + cc= + done + if test -z "$cc" + then + echo "Cannot find arm64 compiler or qemu." + exit 1 + fi + bin="$bin -t arm64" + ;; + "") + case `uname` in + *OpenBSD*) + cc="cc -nopie" + ;; + *) + cc="cc" + ;; + esac + ;; + *) + echo "Unknown target '$TARGET'." + exit 1 + ;; + esac +} + +cleanup() { + rm -f $drv $asm $exe $out +} + +extract() { + WHAT="$1" + FILE="$2" + + awk " + /^# >>> $WHAT/ { + p = 1 + next + } + /^# <<&2 + exit 1 + fi + + if + sed -e 1q $t | + grep "skip.* $TARGET\( .*\)\?$" \ + >/dev/null + then + return 0 + fi + + printf "%-45s" "$(basename $t)..." + + if ! $bin -o $asm $t + then + echo "[qbe fail]" + return 1 + fi + + extract driver $t > $drv + extract output $t > $out + + if test -s $drv + then + src="$drv $asm" + else + src="$asm" + fi + + if ! $cc -g -o $exe $src + then + echo "[cc fail]" + return 1 + fi + + if test -s $out + then + $qemu $exe a b c | diff - $out + ret=$? + reason="output" + else + $qemu $exe a b c + ret=$? + reason="returned $RET" + fi + + if test $ret -ne 0 + then + echo "[$reason fail]" + return 1 + fi + + echo "[ok]" +} + +#trap cleanup TERM QUIT + +init + +if test -z "$1" +then + echo "usage: tools/test.sh {all, SSAFILE}" 2>&1 + exit 1 +fi + +case "$1" in +"all") + fail=0 + for t in $dir/../test/[!_]*.ssa + do + once $t + fail=`expr $fail + $?` + done + if test $fail -ge 1 + then + echo + echo "$fail test(s) failed!" + else + echo + echo "All is fine!" + fi + exit $fail + ;; +*) + once $1 + exit $? + ;; +esac diff --git a/tools/unit.sh b/tools/unit.sh deleted file mode 100755 index ace28fb..0000000 --- a/tools/unit.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh - -DIR=`cd $(dirname "$0"); pwd` -QBE=$DIR/../obj/qbe - -TMP=/tmp/qbe.zzzz - -DRV=$TMP.c -ASM=$TMP.s -BIN=$TMP.bin -OUT=$TMP.out - -cleanup() { - rm -f $DRV $ASM $BIN $OUT -} - -extract() { - WHAT="$1" - FILE="$2" - - awk " - /^# >>> $WHAT/ { - p = 1 - next - } - /^# <<&2 - exit 1 - fi - - printf "%-45s" "$(basename $T)..." - - if ! $QBE -o $ASM $T - then - echo "[qbe fail]" - return 1 - fi - - extract driver $T > $DRV - extract output $T > $OUT - - if test -s $DRV - then - LNK="$DRV $ASM" - else - LNK="$ASM" - fi - - if ! cc $PIE -g -o $BIN $LNK - then - echo "[cc fail]" - return 1 - fi - - if test -s $OUT - then - $BIN a b c | diff - $OUT - RET=$? - REASON="output" - else - $BIN a b c - RET=$? - REASON="returned $RET" - fi - - if test $RET -ne 0 - then - echo "[$REASON fail]" - return 1 - fi - - echo "[ok]" -} - - -#trap cleanup TERM QUIT - -if test -z "$1" -then - echo "usage: tools/unit.sh {all, SSAFILE}" 2>&1 - exit 1 -fi - -for wtf in -nopie -no-pie -do - if echo "int main() { return 0; }" | - cc $wtf -x c -o /dev/null - >/dev/null 2>&1 - then - PIE=$wtf - fi -done - -case $1 in - "all") - F=0 - for T in $DIR/../test/[!_]*.ssa - do - once $T - F=`expr $F + $?` - done - if test $F -ge 1 - then - echo - echo "$F test(s) failed!" - else - echo - echo "All is fine!" - fi - exit $F - ;; - *) - once $1 - exit $? - ;; -esac From f4ddc9e54ed589b8d168cd39ebf2a5572b32431b Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:40:39 -0400 Subject: [PATCH 088/286] enable arm64 tests The vararg tests had to be changed because va_list is 32-bit wide on arm. The astute reader will notice that the way we pass va_list values is wrong, we should be using the ':valist' type as defined below instead of 'l'. But eh, that works for now, because of the ABI. type :valist = align 8 { 32 } --- Makefile | 5 ++++- test/dark.ssa | 1 + test/vararg1.ssa | 4 ++-- test/vararg2.ssa | 28 ++++++++++++++-------------- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 45e4b50..6fc7d07 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,9 @@ clean-gen: clean check: $(OBJDIR)/$(BIN) tools/test.sh all +check-arm64: $(OBJDIR)/$(BIN) + TARGET=arm64 tools/test.sh all + 80: @for F in $(SRCALL); \ do \ @@ -79,4 +82,4 @@ check: $(OBJDIR)/$(BIN) }" < $$F; \ done -.PHONY: clean clean-gen check 80 install uninstall +.PHONY: clean clean-gen check check-arm64 80 install uninstall diff --git a/test/dark.ssa b/test/dark.ssa index 373b1b1..a1b2e60 100644 --- a/test/dark.ssa +++ b/test/dark.ssa @@ -1,3 +1,4 @@ +# skip arm64 # a hack example, # we use a dark type to get # a pointer to the stack. diff --git a/test/vararg1.ssa b/test/vararg1.ssa index 28b3d0e..393743c 100644 --- a/test/vararg1.ssa +++ b/test/vararg1.ssa @@ -1,7 +1,7 @@ export function d $f(l %x, ...) { @start - %vp =l alloc8 24 + %vp =l alloc8 32 vastart %vp %i =l vaarg %vp %n =d vaarg %vp @@ -11,7 +11,7 @@ function d $f(l %x, ...) { export function w $g(l %fmt, ...) { @start - %vp =l alloc8 24 + %vp =l alloc8 32 vastart %vp %r =w call $vprintf(l %fmt, l %vp) ret %r diff --git a/test/vararg2.ssa b/test/vararg2.ssa index 7f72acb..5ad057a 100644 --- a/test/vararg2.ssa +++ b/test/vararg2.ssa @@ -6,7 +6,7 @@ export function $qbeprint0(l %fmt, ...) { storew 2122789, %fmtint storew 2123557, %fmtdbl storew 0, %emptys - %vp =l alloc8 24 + %vp =l alloc8 32 %fmt1 =l add 1, %fmt vastart %vp @loop @@ -32,7 +32,7 @@ export function $qbeprint0(l %fmt, ...) { export function $qbecall0(l %fmt, ...) { @start - %vp =l alloc8 24 + %vp =l alloc8 32 vastart %vp call $vprintf(l %fmt, l %vp) ret @@ -46,7 +46,7 @@ export function $qbeprint1(w %argw0, l %fmt, ...) { storew 2122789, %fmtint storew 2123557, %fmtdbl storew 0, %emptys - %vp =l alloc8 24 + %vp =l alloc8 32 %fmt1 =l add 1, %fmt vastart %vp @loop @@ -72,7 +72,7 @@ export function $qbeprint1(w %argw0, l %fmt, ...) { export function $qbecall1(w %argw0, l %fmt, ...) { @start - %vp =l alloc8 24 + %vp =l alloc8 32 vastart %vp call $vprintf(l %fmt, l %vp) ret @@ -86,7 +86,7 @@ export function $qbeprint2(d %argd0, l %fmt, ...) { storew 2122789, %fmtint storew 2123557, %fmtdbl storew 0, %emptys - %vp =l alloc8 24 + %vp =l alloc8 32 %fmt1 =l add 1, %fmt vastart %vp @loop @@ -112,7 +112,7 @@ export function $qbeprint2(d %argd0, l %fmt, ...) { export function $qbecall2(d %argd0, l %fmt, ...) { @start - %vp =l alloc8 24 + %vp =l alloc8 32 vastart %vp call $vprintf(l %fmt, l %vp) ret @@ -126,7 +126,7 @@ export function $qbeprint3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) storew 2122789, %fmtint storew 2123557, %fmtdbl storew 0, %emptys - %vp =l alloc8 24 + %vp =l alloc8 32 %fmt1 =l add 1, %fmt vastart %vp @loop @@ -152,7 +152,7 @@ export function $qbeprint3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) export function $qbecall3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) { @start - %vp =l alloc8 24 + %vp =l alloc8 32 vastart %vp call $vprintf(l %fmt, l %vp) ret @@ -166,7 +166,7 @@ export function $qbeprint4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d % storew 2122789, %fmtint storew 2123557, %fmtdbl storew 0, %emptys - %vp =l alloc8 24 + %vp =l alloc8 32 %fmt1 =l add 1, %fmt vastart %vp @loop @@ -192,7 +192,7 @@ export function $qbeprint4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d % export function $qbecall4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, l %fmt, ...) { @start - %vp =l alloc8 24 + %vp =l alloc8 32 vastart %vp call $vprintf(l %fmt, l %vp) ret @@ -206,7 +206,7 @@ export function $qbeprint5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d % storew 2122789, %fmtint storew 2123557, %fmtdbl storew 0, %emptys - %vp =l alloc8 24 + %vp =l alloc8 32 %fmt1 =l add 1, %fmt vastart %vp @loop @@ -232,7 +232,7 @@ export function $qbeprint5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d % export function $qbecall5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, d %argd6, l %fmt, ...) { @start - %vp =l alloc8 24 + %vp =l alloc8 32 vastart %vp call $vprintf(l %fmt, l %vp) ret @@ -246,7 +246,7 @@ export function $qbeprint6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w % storew 2122789, %fmtint storew 2123557, %fmtdbl storew 0, %emptys - %vp =l alloc8 24 + %vp =l alloc8 32 %fmt1 =l add 1, %fmt vastart %vp @loop @@ -272,7 +272,7 @@ export function $qbeprint6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w % export function $qbecall6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %argw5, w %argw6, w %argw7, w %argw8, w %argw9, d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, d %argd6, d %argd7, d %argd8, d %argd9, l %fmt, ...) { @start - %vp =l alloc8 24 + %vp =l alloc8 32 vastart %vp call $vprintf(l %fmt, l %vp) ret From 5c5aaeb932d247e65ca64259ecf0873c7c5b7ad3 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:52:09 -0400 Subject: [PATCH 089/286] new abi test for arm64 HFAs --- test/abi6.ssa | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/abi6.ssa diff --git a/test/abi6.ssa b/test/abi6.ssa new file mode 100644 index 0000000..b90bd34 --- /dev/null +++ b/test/abi6.ssa @@ -0,0 +1,38 @@ +# test arm64's hfa + +data $dfmt = { b "double: %g\n", b 0 } + +type :hfa3 = { s, s, s } + +export +function $f(:hfa3 %h1, :hfa3 %h2, d %d1, :hfa3 %h3, d %d2) { + # the first three parameters should be in 7 registers + # the last two should be on the stack +@start + + call $phfa3(:hfa3 %h1) + call $phfa3(:hfa3 %h2) + call $phfa3(:hfa3 %h3) + call $printf(l $dfmt, d %d1) + call $printf(l $dfmt, d %d2) + ret +} + +# >>> driver +# #include +# typedef struct { float f1, f2, f3; } hfa3; +# void f(hfa3, hfa3, double, hfa3, double); +# void phfa3(hfa3 h) { printf("{ %g, %g, %g }\n", h.f1, h.f2, h.f3); } +# int main() { +# hfa3 h1={1,2,3}, h2={2,3,4}, h3={3,4,5}; +# f(h1, h2, 1, h3, 2); +# } +# <<< + +# >>> output +# { 1, 2, 3 } +# { 2, 3, 4 } +# { 3, 4, 5 } +# double: 1 +# double: 2 +# <<< From 37064c646804e8b3190d2c0126e7357a7b817a13 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:49:30 -0400 Subject: [PATCH 090/286] use amd64 instead of x64 in abi doc --- doc/abi.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/abi.txt b/doc/abi.txt index c14afa9..5f28d0e 100644 --- a/doc/abi.txt +++ b/doc/abi.txt @@ -1,9 +1,9 @@ - ================ - System V ABI x64 - ================ + ================== + System V ABI AMD64 + ================== -This document describes concisely the subset of the x64 +This document describes concisely the subset of the amd64 ABI as it is implemented in QBE. The subset can handle correctly arbitrary standard C-like structs containing float and integer types. Structs that have unaligned From 6fd78ec78f1ef3f50afe9d6d9654351e59653244 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:50:45 -0400 Subject: [PATCH 091/286] nits in the documentation --- doc/il.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index aa7e7e4..35b023d 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -50,7 +50,7 @@ Usually, one file is generated per each compilation unit of the frontend input language. An IL file is a sequence of <@ Definitions > for data, functions, and types. Once processed by QBE, the resulting file can be assembled and -linked using a standard toolchain (e.g. GNU binutils). +linked using a standard toolchain (e.g., GNU binutils). Here is a complete "Hello World" IL file, it defines a function that prints to the screen. Since the string is @@ -123,11 +123,11 @@ and `d` (double), they stand respectively for 32-bit and 64-bit integers, and 32-bit and 64-bit floating-point numbers. There are no pointer types available; pointers are typed by an integer type sufficiently wide to represent all memory -addresses (e.g. `l` on x64). Temporaries in the IL can only -have a basic type. +addresses (e.g., `l` on 64-bit architectures). Temporaries +in the IL can only have a basic type. Extended types contain base types plus `b` (byte) and `h` -(half word), respectively for 8 bits and 16 bits integers. +(half word), respectively for 8-bit and 16-bit integers. They are used in <@ Aggregate Types> and <@ Data> definitions. For C interfacing, the IL also provides user-defined aggregate @@ -175,7 +175,7 @@ They are always parsed as 64-bit blobs. Depending on the context surrounding a constant, only some of its bits are used. For example, in the program below, the two variables defined have the same value since the first -operand of the substraction is a word (32 bits) context. +operand of the substraction is a word (32-bit) context. %x =w sub -1, 0 %y =w sub 4294967295, 0 @@ -290,14 +290,14 @@ or zero-initialize big arrays. Here are various examples of data definitions. - # Three 32 bits values 1, 2, and 3 + # Three 32-bit values 1, 2, and 3 # followed by a 0 byte. data $a = { w 1 2 3, b 0 } # A thousand bytes 0 initialized. data $b = { z 1000 } - # An object containing two 64 bits + # An object containing two 64-bit # fields, one with all bits sets and the # other containing a pointer to the # object itself. @@ -482,7 +482,7 @@ The following abbreviations are used. * `I` stands for `wl` * `F` stands for `sd` * `m` stands for the type of pointers on the target, on - x64 it is the same as `l` + 64-bit architectures it is the same as `l` For example, consider the type string `wl(F)`, it mentions that the instruction has only one argument and that if the @@ -654,7 +654,7 @@ returns 1 when the first argument is smaller than the second one. Conversion operations allow to change the representation of a value, possibly modifying it if the target type cannot hold the value of the source type. Conversions can extend the -precision of a temporary (e.g. from signed 8 bits to 32 bits), +precision of a temporary (e.g., from signed 8-bit to 32-bit), or convert a floating point into an integer and vice versa. * `extsw`, `extuw` -- `l(w)` @@ -720,7 +720,7 @@ The call instruction is special in many ways. It is not a three-address instruction and requires the type of all its arguments to be given. Also, the return type can be either a base type or an aggregate type. These specificities -are required to compile calls with C compatibility (i.e. +are required to compile calls with C compatibility (i.e., to respect the ABI). When an aggregate type is used as argument type or return From d6316a9a5fb4c9420a1cebe7777895da2161c1a6 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:35:41 -0400 Subject: [PATCH 092/286] add instructions to build on windows --- doc/win.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/win.txt diff --git a/doc/win.txt b/doc/win.txt new file mode 100644 index 0000000..2583622 --- /dev/null +++ b/doc/win.txt @@ -0,0 +1,22 @@ + =================== + Windows Quick Start + =================== + +Only 64bits versions of windows are supported. To compile +this software you will need to get a normal UNIX toolchain. +There are several ways to do this, but I will present what +I found to be the easiest and lightest solution. + + 1. Download and install [@1 MSYS2] (the x86_64 version). + 2. In an MSYS2 terminal, run the following command. + + pacman -S git make mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb + + 3. Restart the MSYS2 terminal. + 4. In the new terminal, clone QBE. + + git clone git://c9x.me/qbe.git + + 5. Compile using `make`. + +[1] http://www.msys2.org From 5fde07c211848adc5b220500b257a6a9b8ef50f8 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 8 Apr 2017 21:23:49 -0400 Subject: [PATCH 093/286] add handy src target to the Makefile Intended usage: c_count `make src` (or similar). --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6fc7d07..52574c8 100644 --- a/Makefile +++ b/Makefile @@ -72,6 +72,9 @@ check: $(OBJDIR)/$(BIN) check-arm64: $(OBJDIR)/$(BIN) TARGET=arm64 tools/test.sh all +src: + @echo $(SRCALL) + 80: @for F in $(SRCALL); \ do \ @@ -82,4 +85,4 @@ check-arm64: $(OBJDIR)/$(BIN) }" < $$F; \ done -.PHONY: clean clean-gen check check-arm64 80 install uninstall +.PHONY: clean clean-gen check check-arm64 src 80 install uninstall From c52f9162c4d35f3b55001d7337d618184961966f Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 7 Apr 2017 19:42:47 -0400 Subject: [PATCH 094/286] misc fixes for osx With the default toolchain, it looks like we have to make sure all symbols are loaded using rip-relative addressing. --- all.h | 2 +- amd64/isel.c | 24 ++++++++++++++++-------- tools/test.sh | 3 +++ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/all.h b/all.h index 8cbec63..56c0ef9 100644 --- a/all.h +++ b/all.h @@ -86,7 +86,7 @@ enum { #define TMP(x) (Ref){RTmp, x} #define CON(x) (Ref){RCon, x} #define CON_Z CON(0) /* reserved zero constant */ -#define SLOT(x) (Ref){RSlot, x} +#define SLOT(x) (Ref){RSlot, (x)&0x1fffffff} #define TYPE(x) (Ref){RType, x} #define CALL(x) (Ref){RCall, x} #define MEM(x) (Ref){RMem, x} diff --git a/amd64/isel.c b/amd64/isel.c index 1623b9b..0dbaad3 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -59,14 +59,16 @@ rslot(Ref r, Fn *fn) } static void -fixarg(Ref *r, int k, int cpy, Fn *fn) +fixarg(Ref *r, int k, int op, Fn *fn) { Addr a, *m; Ref r0, r1; - int s, n; + int s, n, cpy, mem; r1 = r0 = *r; s = rslot(r0, fn); + cpy = op == Ocopy || op == -1; + mem = isstore(op) || isload(op) || op == Ocall; if (KBASE(k) == 1 && rtype(r0) == RCon) { /* load floating points from memory * slots, they can't be used as @@ -97,6 +99,12 @@ fixarg(Ref *r, int k, int cpy, Fn *fn) r1 = newtmp("isel", Kl, fn); emit(Oaddr, Kl, r1, SLOT(s), R); } + else if (!mem && rtype(r0) == RCon + && fn->con[r0.val].type == CAddr) { + /* apple asm fix */ + r1 = newtmp("isel", Kl, fn); + emit(Oaddr, Kl, r1, r0, R); + } else if (rtype(r0) == RMem) { /* apple asm fix */ m = &fn->mem[r0.val]; @@ -163,8 +171,8 @@ selcmp(Ref arg[2], int k, Fn *fn) iarg[1] = newtmp("isel", k, fn); emit(Ocopy, k, iarg[1], arg[0], R); } - fixarg(&iarg[0], k, 0, fn); - fixarg(&iarg[1], k, 0, fn); + fixarg(&iarg[0], k, Oxcmp, fn); + fixarg(&iarg[1], k, Oxcmp, fn); return swap; } @@ -214,7 +222,7 @@ sel(Ins i, ANum *an, Fn *fn) emit(Ocopy, k, TMP(RDX), CON_Z, R); } emit(Ocopy, k, TMP(RAX), i.arg[0], R); - fixarg(&curi->arg[0], k, 0, fn); + fixarg(&curi->arg[0], k, Ocopy, fn); if (rtype(i.arg[1]) == RCon) emit(Ocopy, k, r0, i.arg[1], R); break; @@ -269,8 +277,8 @@ sel(Ins i, ANum *an, Fn *fn) Emit: emiti(i); iarg = curi->arg; /* fixarg() can change curi */ - fixarg(&iarg[0], argcls(&i, 0), 0, fn); - fixarg(&iarg[1], argcls(&i, 1), 0, fn); + fixarg(&iarg[0], argcls(&i, 0), i.op, fn); + fixarg(&iarg[1], argcls(&i, 1), i.op, fn); break; case Oalloc: case Oalloc+1: @@ -584,7 +592,7 @@ amd64_isel(Fn *fn) for (p=(*sb)->phi; p; p=p->link) { for (a=0; p->blk[a] != b; a++) assert(a+1 < p->narg); - fixarg(&p->arg[a], p->cls, 1, fn); + fixarg(&p->arg[a], p->cls, -1, fn); } memset(ainfo, 0, n * sizeof ainfo[0]); anumber(ainfo, b, fn->con); diff --git a/tools/test.sh b/tools/test.sh index 5430ccd..5c3f205 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -35,6 +35,9 @@ init() { ;; "") case `uname` in + *Darwin*) + cc="cc -Wl,-no_pie" + ;; *OpenBSD*) cc="cc -nopie" ;; From 8241685fb92b44556a870ff33bc3eca75aae8637 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 9 Apr 2017 18:08:40 -0400 Subject: [PATCH 095/286] always disable pie in tests --- tools/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.sh b/tools/test.sh index 5c3f205..666b573 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -42,7 +42,7 @@ init() { cc="cc -nopie" ;; *) - cc="cc" + cc="cc -no-pie" ;; esac ;; From 19801b9253140443f7c04325dbf67581092b1a99 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 10 Apr 2017 09:09:56 -0400 Subject: [PATCH 096/286] simplify slot logic in alias analysis The previous code was buggy. It would put a stack pointer on the heap when handling "add $foo, 42". The new code is more straightforward and hopefully more correct. Only temporaries with a "stack" alias class will have a slot pointer. --- alias.c | 21 ++++++++++++--------- all.h | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/alias.c b/alias.c index ed64501..77d5d73 100644 --- a/alias.c +++ b/alias.c @@ -10,7 +10,8 @@ getalias(Alias *a, Ref r, Fn *fn) die("unreachable"); case RTmp: *a = fn->tmp[r.val].alias; - a->type = a->slot->type; + if (astack(a->type)) + a->type = a->slot->type; assert(a->type != ABot); break; case RCon: @@ -21,7 +22,7 @@ getalias(Alias *a, Ref r, Fn *fn) } else a->type = ACon; a->offset = c->bits.i; - a->slot = a; + a->slot = 0; break; } } @@ -37,7 +38,7 @@ alias(Ref p, int sp, Ref q, int sq, int *delta, Fn *fn) *delta = ap.offset - aq.offset; ovlap = ap.offset < aq.offset + sq && aq.offset < ap.offset + sp; - if (ap.type & aq.type & 1) { + if (astack(ap.type) && astack(aq.type)) { /* if both are offsets of the same * stack slot, they alias iif they * overlap */ @@ -86,7 +87,7 @@ escapes(Ref r, Fn *fn) if (rtype(r) != RTmp) return 1; a = &fn->tmp[r.val].alias; - return !(a->type & 1) || a->slot->type == AEsc; + return !astack(a->type) || a->slot->type == AEsc; } static void @@ -97,7 +98,7 @@ esc(Ref r, Fn *fn) assert(rtype(r) <= RType); if (rtype(r) == RTmp) { a = &fn->tmp[r.val].alias; - if (a->slot->type == ALoc) + if (astack(a->type)) a->slot->type = AEsc; } } @@ -120,7 +121,7 @@ fillalias(Fn *fn) a->type = AUnk; a->base = p->to; a->offset = 0; - a->slot = a; + a->slot = 0; } for (i=b->ins; i<&b->ins[b->nins]; ++i) { a = 0; @@ -128,13 +129,15 @@ fillalias(Fn *fn) assert(rtype(i->to) == RTmp); a = &fn->tmp[i->to.val].alias; assert(a->type == ABot); - if (Oalloc <= i->op && i->op <= Oalloc1) + if (Oalloc <= i->op && i->op <= Oalloc1) { a->type = ALoc; - else + a->slot = a; + } else { a->type = AUnk; + a->slot = 0; + } a->base = i->to; a->offset = 0; - a->slot = a; } if (i->op == Ocopy) { assert(a); diff --git a/all.h b/all.h index 56c0ef9..e31e2aa 100644 --- a/all.h +++ b/all.h @@ -272,6 +272,7 @@ struct Alias { AEsc = 3, /* stack escaping */ ASym = 4, AUnk = 6, + #define astack(t) ((t) & 1) } type; Ref base; char label[NString]; From dc4cc4969749940f55f36814b95d70c6c1da4d15 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 10 Apr 2017 09:16:51 -0400 Subject: [PATCH 097/286] bump the size of the instruction buffer Ori needs this. It should not cost much more memory at runtime, only a minimal amount of address space. --- all.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all.h b/all.h index e31e2aa..f24d099 100644 --- a/all.h +++ b/all.h @@ -33,7 +33,7 @@ typedef struct Target Target; enum { NString = 32, NPred = 63, - NIns = 8192, + NIns = 1 << 20, NAlign = 3, NField = 32, NBit = CHAR_BIT * sizeof(bits), From 669d8086ae0cd939f8016ad495389a19f6ba8c8f Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 11 Apr 2017 09:51:35 -0400 Subject: [PATCH 098/286] simplify amd64 aggregates classification --- amd64/sysv.c | 74 ++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/amd64/sysv.c b/amd64/sysv.c index ea81eee..014452a 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -17,51 +17,47 @@ struct RAlloc { }; static void -classify(AClass *a, Typ *t, int *pn, int *pe) +classify(AClass *a, Typ *t, uint s) { - Field *fld; - int s, *cls; - uint n; - - for (n=0; nnunion; n++) { - fld = t->fields[n]; - for (s=0; *pe<2; (*pe)++) { - cls = &a->cls[*pe]; - for (; *pn<8; s++) { - switch (fld[s].type) { - case FEnd: - goto Done; - case FPad: - /* don't change anything */ - break; - case Fs: - case Fd: - if (*cls == Kx) - *cls = Kd; - break; - case Fb: - case Fh: - case Fw: - case Fl: - *cls = Kl; - break; - case FTyp: - classify(a, &typ[fld[s].len], pn, pe); - continue; - } - *pn += fld[s].len; + Field *f; + int *cls; + uint n, s1; + + for (n=0, s1=s; nnunion; n++, s=s1) + for (f=t->fields[n]; f->type!=FEnd; f++) { + assert(s <= 16); + cls = &a->cls[s/8]; + switch (f->type) { + case FEnd: + die("unreachable"); + case FPad: + /* don't change anything */ + s += f->len; + break; + case Fs: + case Fd: + if (*cls == Kx) + *cls = Kd; + s += f->len; + break; + case Fb: + case Fh: + case Fw: + case Fl: + *cls = Kl; + s += f->len; + break; + case FTyp: + classify(a, &typ[f->len], s); + s += typ[f->len].size; + break; } - Done: - assert(*pn <= 8); - *pn = 0; } - } } static void typclass(AClass *a, Typ *t) { - int e, n; uint sz, al; sz = t->size; @@ -90,9 +86,7 @@ typclass(AClass *a, Typ *t) a->cls[0] = Kx; a->cls[1] = Kx; a->inmem = 0; - n = 0; - e = 0; - classify(a, t, &n, &e); + classify(a, t, 0); } static int From 1883ab1e01e8078ce2e6206482ec50e446fdce34 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 11 Apr 2017 17:38:37 -0400 Subject: [PATCH 099/286] unscrew freebsd tests --- tools/test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/test.sh b/tools/test.sh index 666b573..384d585 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -41,6 +41,9 @@ init() { *OpenBSD*) cc="cc -nopie" ;; + *FreeBSD*) + cc="cc" + ;; *) cc="cc -no-pie" ;; From b9c8724ea50e92ee7215fca6edadcb5755b2a578 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 14 Apr 2017 12:57:17 -0400 Subject: [PATCH 100/286] remove html converter --- doc/.gitignore | 1 - doc/Makefile | 17 --- doc/txt/txt.ml | 322 ------------------------------------------------- 3 files changed, 340 deletions(-) delete mode 100644 doc/.gitignore delete mode 100644 doc/Makefile delete mode 100644 doc/txt/txt.ml diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index 5ccff1a..0000000 --- a/doc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -html/ diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index e1b93eb..0000000 --- a/doc/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -DOCS = abi il llvm - -all: $(DOCS:%=html/%.html) - -clean: - rm -fr html - -html/%.html: %.txt - mkdir html 2> /dev/null || true - ( sed -ne '2{s,.*,&,;p;q}' $<; \ - echo '
'; \ - sed -ne '2{s,.*,

&

,;p;q}' $<; \ - sed -e '1,3d' $< | ocaml txt/txt.ml; \ - echo '
'; \ - ) > $@ - -.PHONY: all clean diff --git a/doc/txt/txt.ml b/doc/txt/txt.ml deleted file mode 100644 index 35b797a..0000000 --- a/doc/txt/txt.ml +++ /dev/null @@ -1,322 +0,0 @@ -let dent = 4 - -type doc = item list -and item = - | Verb of string * string - | Par of (string * bool) - | Ulist of doc list - | Olist of doc list - | Title of int * string * string - -let (|>) x f = f x - -let isspace = String.contains " \n\t" - -module String = struct - include String - - let suff s n = - let l = String.length s in - if n >= l then "" else - String.sub s n (l-n) - - let haspref p s = - let lp = String.length p in - String.length s >= lp && - p = String.sub s 0 lp - - let trim s = - let l = String.length s in - let i = ref 0 and j = ref (l-1) in - while !i=0 && isspace s.[!j] - do decr j done; - if !j = -1 then s else sub s !i (!j- !i+1) -end - -let idify s = - let rec f i cs = - if i >= String.length s then cs else - match s.[i] with - | ' ' -> f (i+1) ("-" :: cs) - | c -> f (i+1) (String.make 1 c :: cs) in - f 0 [] |> List.rev |> String.concat "" - -let warn = Printf.eprintf - -let getdent s = - let rec f n = - if n >= String.length s then 0 else - if s.[n] = ' ' then f (n+1) else - if s.[n] = '\t' then f (n+8) else - n/dent in - f 0 - -let dedent s i = - let rec f i j = - if i <= 0 then (-i, j) else - if j >= String.length s then (0, j) else - if s.[j] = ' ' then f (i-1) (j+1) else - if s.[j] = '\t' then f (i-8) (j+1) else - (0, j) in - let (p, j) = f (i*dent) 0 in - String.make p ' ' ^ String.suff s j - -let rec getlines acc n = - match try Some (read_line ()) with End_of_file -> None with - | Some s -> - getlines ((n, getdent s, s) :: acc) (n+1) - | None -> List.rev acc - -let matchs skip fin s = - let rec f n = - if n >= String.length s then 0 else - if s.[n] = fin then (n+1) else - if String.contains skip s.[n] then f (n+1) else - 0 in - f 0 - -let endnum = matchs " 0123456789" '.' -let endbul = matchs " " '*' -let skipnum s = String.suff s (endnum s) -let skipbul s = String.suff s (endbul s) - -let gettitles lines = - let titles = Hashtbl.create 100 in - let insert lvl n t = - let t = String.trim (skipnum (String.suff t 2)) in - if Hashtbl.mem titles t then - warn "line %d: title has multiple definitions\n" n; - Hashtbl.add titles t (lvl, idify t) in - lines |> List.iter begin fun (n, lvl, t) -> - if lvl <> 0 then () else - if String.haspref "- " t then insert 0 n t else - if String.haspref "~ " t then insert 1 n t else - () - end; - titles - -let top lines = - match !lines with - | [] -> None - | l :: _ -> Some l - -let pop lines = - lines := List.tl !lines -let push lines l = - lines := l :: !lines - -let isolist l = endnum l <> 0 -let isulist l = endbul l <> 0 - -let getverb lines idnt = - let rec skip = function - | s :: l when String.trim s = "" -> skip l - | l -> l in - let rec f ls = - match top lines with - | Some (n, i, l) - when i >= idnt - || String.trim l = "" -> - pop lines; - f (dedent l idnt :: ls) - | _ -> - skip ls |> List.rev |> - String.concat "\n" in - f [] - -let getpar lines idnt = - let empty = function - | Some (_, _, l) -> String.trim l = "" - | _ -> false in - let rec f ls = - match top lines with - | Some (n, i, l) - when i = idnt - && l <> "" - && not (isolist l) - && not (isulist l) -> - pop lines; - f (l :: ls) - | t -> - String.concat "\n" (List.rev ls), - empty t in - f [] - -let mergedoc = - let rec aggreg f = function - | (i :: is) as is'-> - begin match f i with - | Some l -> - let l', is = aggreg f is in - List.append l l', is - | None -> [], is' - end - | is -> [], is in - let ul = function Ulist l -> Some l | _ -> None in - let ol = function Olist l -> Some l | _ -> None in - let rec f d = match d with - | Ulist _ :: _ -> - let l, d = aggreg ul d in - Ulist l :: f d - | Olist _ :: _ -> - let l, d = aggreg ol d in - Olist l :: f d - | i :: d -> i :: f d - | [] -> [] in - f - -let rec getdoc lines si acc = - match top lines with - | Some (n, i, l) -> - if i = si && isolist l then begin (* Olist item *) - pop lines; - push lines (n, i+1, skipnum l); - let li = getdoc lines (si+1) [] in - getdoc lines si (Olist [li] :: acc); - end else - if i = si && isulist l then begin (* Ulist item *) - pop lines; - push lines (n, i+1, skipbul l); - let li = getdoc lines (si+1) [] in - getdoc lines si (Ulist [li] :: acc); - end else - if i > si then begin (* Verb item *) - let ty = - let l = dedent l i in - if l.[0] <> '`' then "" else begin - pop lines; - String.suff l 1 - end in - let verb = getverb lines (si+1) in - getdoc lines si (Verb (ty, verb) :: acc); - end else - if si = 0 && String.haspref "~ " l - || si = 0 && String.haspref "- " l then begin (* Titles *) - pop lines; - let lvl = if l.[0] = '-' then 0 else 1 in - let tit = String.suff l 2 in - let id = idify (String.trim (skipnum tit)) in - getdoc lines si (Title (lvl, id, tit) :: acc); - end else - if String.haspref "---" l - || String.haspref "~~~" l - || l = "" then begin (* Decorations *) - pop lines; - getdoc lines si acc; - end else - if i = si then begin (* Par item *) - let par = getpar lines si in - getdoc lines si (Par par :: acc); - end else - List.rev acc |> mergedoc - | None -> List.rev acc |> mergedoc - -type printer = - { pchar: char -> unit - ; plink: string -> unit - ; pcode: string -> unit - } - -let print pp s = - let l = String.length s in - let rec getlink j spc = - if j >= l || s.[j] = '>' then j+1, "" else - if isspace s.[j] then - getlink (j+1) true - else - let j', t = getlink (j+1) false in - if spc then - j', Printf.sprintf " %c%s" s.[j] t - else - j', Printf.sprintf "%c%s" s.[j] t in - let getlink j = - let j', s = getlink j false in - j', String.trim s in - let rec getdlim j d = - if j >= l || s.[j] = d then j+1, "" else - let j', t = getdlim (j+1) d in - j', Printf.sprintf "%c%s" s.[j] t in - let rec f i = - if i >= l then () else - match s.[i] with - | '<' when i < l-1 && s.[i+1] = '@' -> - let i, t = getlink (i+2) in - pp.plink t; - f i - | '`' -> - let i, t = getdlim (i+1) '`' in - pp.pcode t; - f i - | c -> - pp.pchar c; - f (i+1) - in f 0 - -let rec dochtml titles d = - let open Printf in - let pchar = function - | '<' -> printf "<" - | '>' -> printf ">" - | '&' -> printf "&" - | c -> printf "%c" c in - let escape = String.iter pchar in - let plink l = - try - let (_, id) = Hashtbl.find titles l in - printf "%s" id l - with Not_found -> - warn "warning: unresolved link '%s'\n" l; - printf "%s" l in - let pcode s = - printf ""; - escape s; - printf ""; in - let pp = {pchar; plink; pcode} in - let rec plist = - List.iter begin fun d -> - match d with - | Par (p, nl) :: d when - not nl || d = [] -> - printf "
  • "; - print pp p; - printf "\n"; - dochtml titles d; - | d -> - printf "
  • "; - dochtml titles d; - end in - let itemhtml = function - | Title (0, id, t) -> - printf "

    " id; - escape t; - printf "

    \n"; - | Title (_, id, t) -> - printf "

    " id; - escape t; - printf "

    \n"; - | Olist l -> - printf "
      \n"; - plist l; - printf "
    \n"; - | Ulist l -> - printf "
      \n"; - plist l; - printf "
    \n"; - | Verb (cls, v) -> - if cls <> "" - then printf "
    " cls
    -      else printf "
    \n";
    -      escape v;
    -      printf "\n
    \n"; - | Par (p, _) -> - printf "

    \n"; - print pp p; - printf "\n

    \n"; in - List.iter itemhtml d - -let _ = - let lines = getlines [] 1 in - let titles = gettitles lines in - getdoc (ref lines) 0 [] |> dochtml titles From 138b09af877707bde9188c292ff98d3d81fe288b Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 16 Apr 2017 14:43:16 -0400 Subject: [PATCH 101/286] minor changes for env parameter Since the environment can only be of type `l`, do not require to write it down. I also tightened the type information of the `pare` and `arge` instructions. --- ops.h | 4 ++-- parse.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ops.h b/ops.h index 848671a..114310c 100644 --- a/ops.h +++ b/ops.h @@ -133,10 +133,10 @@ O(afcmp, T(e,e,s,d, e,e,s,d), 0) X(0, 0, 0) /* Arguments, Parameters, and Calls */ O(par, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) O(parc, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0) -O(pare, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) +O(pare, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0) O(arg, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 0) O(argc, T(e,x,e,e, e,l,e,e), 0) X(0, 0, 0) -O(arge, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 0) +O(arge, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) O(call, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) O(vacall, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) diff --git a/parse.c b/parse.c index 5631bc2..b7bab5b 100644 --- a/parse.c +++ b/parse.c @@ -450,16 +450,16 @@ parserefl(int arg) if (curi - insb >= NIns) err("too many instructions (1)"); env = peek() == Tenv; - if (env) + if (env) { next(); - k = parsecls(&ty); + k = Kl; + } else + k = parsecls(&ty); r = parseref(); if (req(r, R)) err("invalid argument"); if (hasenv && env) err("only one environment allowed"); - if (env && k != Kl) - err("environment must be of type l"); if (!arg && rtype(r) != RTmp) err("invalid function parameter"); if (k == 4) From 0d77e262a60143574e657fb6aa6e707312aa074c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 16 Apr 2017 22:50:47 -0400 Subject: [PATCH 102/286] documentation update --- doc/il.txt | 150 +++++++++++++++++++++++++++++++++++++++++++--------- doc/win.txt | 9 ++-- 2 files changed, 131 insertions(+), 28 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index 35b023d..7ebaf64 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -27,8 +27,9 @@ * <@ Memory > * <@ Comparisons > * <@ Conversions > - * <@ Cast > + * <@ Cast and Copy > * <@ Call > + * <@ Variadic > * <@ Phi > 7. <@ Instructions Index > @@ -55,7 +56,8 @@ linked using a standard toolchain (e.g., GNU binutils). Here is a complete "Hello World" IL file, it defines a function that prints to the screen. Since the string is not a first class object (only the pointer is) it is -defined outside the function's body. +defined outside the function's body. Comments start with +a # character and run until the end of the line. # Define the string constant. data $str = { b "hello world", b 0 } @@ -175,7 +177,7 @@ They are always parsed as 64-bit blobs. Depending on the context surrounding a constant, only some of its bits are used. For example, in the program below, the two variables defined have the same value since the first -operand of the substraction is a word (32-bit) context. +operand of the subtraction is a word (32-bit) context. %x =w sub -1, 0 %y =w sub 4294967295, 0 @@ -211,9 +213,9 @@ using the `export` keyword. `bnf TYPEDEF := # Regular type - 'type' :IDENT '=' [ 'align' NUMBER ] + 'type' :IDENT '=' ['align' NUMBER] '{' - ( EXTTY [ NUMBER ] ), + ( EXTTY [NUMBER] ), '}' | # Opaque type 'type' :IDENT '=' 'align' NUMBER '{' NUMBER '}' @@ -258,9 +260,9 @@ their size between curly braces. '}' DATAITEM := - $IDENT [ '+' NUMBER ] # Symbol and offset - | '"' ... '"' # String - | CONST # Constant + $IDENT ['+' NUMBER] # Symbol and offset + | '"' ... '"' # String + | CONST # Constant Data definitions define objects that will be emitted in the compiled file. They can be local to the file or exported @@ -308,12 +310,17 @@ Here are various examples of data definitions. `bnf FUNCDEF := - ['export'] 'function' [BASETY | :IDENT] $IDENT PARAMS + ['export'] 'function' [ABITY] $IDENT '(' (PARAM), ')' '{' BLOCK+ '}' - PARAMS := '(' ( (BASETY | :IDENT) %IDENT ), ')' + PARAM := + ABITY %IDENT # Regular parameter + | 'env' %IDENT # Environment parameter (first) + | '...' # Variadic marker (last) + + ABITY := BASETY | :IDENT Function definitions contain the actual code to emit in the compiled file. They define a global symbol that @@ -342,6 +349,31 @@ member of the struct. ret %val } +If the parameter list ends with `...`, the function is +a variadic function: It can accept a variable number of +arguments. To access the extra arguments provided by +the caller, use the `vastart` and `vaarg` instructions +described in the <@ Variadic > section. + +Optionally, the parameter list can start with an +environment parameter `env %e`. This special parameter is +a 64-bit integer temporary (i.e., of type `l`). If the +function does not use its environment parameter, callers +can safely omit it. This parameter is invisible to a C +caller: for example, the function + + export function w $add(env %e, w %a, w %b) { + @start + %c =w add %a, %b + ret %c + } + +must be given the C prototype `int add(int, int)`. +The intended use of this feature is to pass the +environment pointer of closures while retaining a +very good compatibility with C. The <@ Call > section +explains how to pass an environment parameter. + Since global symbols are defined mutually recursive, there is no need for function declarations: A function can be referenced before its definition. @@ -405,7 +437,7 @@ to the loop block. JUMP := 'jmp' @IDENT # Unconditional | 'jnz' VAL, @IDENT, @IDENT # Conditional - | 'ret' [ VAL ] # Return + | 'ret' [VAL] # Return A jump instruction ends every block and transfers the control to another program location. The target of @@ -691,15 +723,17 @@ unsigned types are not yet supported. Because of <@ Subtyping >, there is no need to have an instruction to lower the precision of an integer temporary. -~ Cast -~~~~~~ +~ Cast and Copy +~~~~~~~~~~~~~~~ -The `cast` instruction reinterprets the bits of a value of -a given type into another type of the same width. +The `cast` and `copy` instructions return the bits of their +argument verbatim. A `cast` will however change an integer +into a floating point of the same width and vice versa. * `cast` -- `wlsd(sdwl)` + * `copy` -- `T(T)` -It can be used to make bitwise operations on the +Casts can be used to make bitwise operations on the representation of floating point numbers. For example the following program will compute the opposite of the single-precision floating point number `%f` into `%rs`. @@ -712,26 +746,88 @@ single-precision floating point number `%f` into `%rs`. ~~~~~~ `bnf - CALL := [ %IDENT '=' ( BASETY | :IDENT ) ] 'call' VAL PARAMS + CALL := [%IDENT '=' ABITY] 'call' VAL '(' (ARG), ')' + + ARG := + ABITY %IDENT # Regular argument + | 'env' VAL # Environment argument (first) + | '...' # Variadic marker (last) - PARAMS := '(' ( (BASETY | :IDENT) %IDENT ), ')' + ABITY := BASETY | :IDENT The call instruction is special in many ways. It is not a three-address instruction and requires the type of all its arguments to be given. Also, the return type can be -either a base type or an aggregate type. These specificities +either a base type or an aggregate type. These specifics are required to compile calls with C compatibility (i.e., to respect the ABI). When an aggregate type is used as argument type or return -type, the value repectively passed or returned needs to be +type, the value respectively passed or returned needs to be a pointer to a memory location holding the value. This is because aggregate types are not first-class citizens of the IL. -Call instructions are currently required to define a return -temporary, even for functions returning no values. The -temporary can very well be ignored (not used) when necessary. +Unless the called function does not return a value, a +return temporary must be specified, even if it is never +used afterwards. + +An environment parameter can be passed as first argument +using the `env` keyword. The passed value must be a 64-bit +integer. If the called function does not expect an environment +parameter, it will be safely discarded. See the <@ Functions > +section for more information about environment parameters. + +When the called function is variadic, the last argument +must be `...`. + +~ Variadic +~~~~~~~~~~ + +The `vastart` and `vaarg` instructions provide a portable +way to access the extra parameters of a variadic function. + + * `vastart` -- `(m)` + * `vaarg` -- `T(mmmm)` + +The `vastart` instruction initializes a *variable argument +list* used to access the extra parameters of the enclosing +variadic function. It is safe to call it multiple times. + +The `vaarg` instruction fetches the next argument from +a variable argument list. It is currently limited to +fetching arguments that have a base type. This instruction +is essentially effectful: calling it twice in a row will +return two consecutive arguments from the argument list. + +Both instructions take a pointer to a variable argument +list as only argument. The size and alignment of variable +argument lists depend on the target used. However, it +is possible to conservatively use the maximum size and +alignment required by all the targets. + + type :valist = align 8 { 24 } # For amd64_sysv + type :valist = align 8 { 32 } # For arm64 + +The following example defines a variadic function adding +its first three arguments. + + function s $add3(s %a, ...) { + @start + %ap =l alloc8 32 + vastart %ap + %r =s call $vadd(s %a, l %ap) + ret %r + } + + function s $vadd(s %a, l %ap) { + @start + %b =s vaarg %ap + %c =s vaarg %ap + %d =s add %a, %b + %e =s add %d, %c + ret %e + } ~ Phi ~~~~~ @@ -897,14 +993,20 @@ instructions unless you know exactly what you are doing. * `swtof` * `truncd` - * <@ Cast > : + * <@ Cast and Copy > : * `cast` + * `copy` * <@ Call >: * `call` + * <@ Variadic >: + + * `vastart` + * `vaarg` + * <@ Phi >: * `phi` diff --git a/doc/win.txt b/doc/win.txt index 2583622..8d0ca79 100644 --- a/doc/win.txt +++ b/doc/win.txt @@ -2,10 +2,10 @@ Windows Quick Start =================== -Only 64bits versions of windows are supported. To compile +Only 64-bit versions of windows are supported. To compile this software you will need to get a normal UNIX toolchain. -There are several ways to do this, but I will present what -I found to be the easiest and lightest solution. +There are several ways to get one, but I will only describe +how I did it. 1. Download and install [@1 MSYS2] (the x86_64 version). 2. In an MSYS2 terminal, run the following command. @@ -14,9 +14,10 @@ I found to be the easiest and lightest solution. 3. Restart the MSYS2 terminal. 4. In the new terminal, clone QBE. - + git clone git://c9x.me/qbe.git 5. Compile using `make`. + [1] http://www.msys2.org From 51c46ba6914741cbca54d3351f8cf8d2689fd3dc Mon Sep 17 00:00:00 2001 From: Quentin Rameau Date: Wed, 19 Apr 2017 10:57:08 +0200 Subject: [PATCH 103/286] Small corrections in documentation --- doc/il.txt | 109 ++++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index 7ebaf64..d816732 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -46,18 +46,18 @@ to focus on language design issues. ~ Input Files ~~~~~~~~~~~~~ -The intermediate language is provided to QBE as text files. -Usually, one file is generated per each compilation unit of +The intermediate language is provided to QBE as text. +Usually, one file is generated per each compilation unit from the frontend input language. An IL file is a sequence of <@ Definitions > for data, functions, and types. Once processed by QBE, the resulting file can be assembled and linked using a standard toolchain (e.g., GNU binutils). -Here is a complete "Hello World" IL file, it defines a +Here is a complete "Hello World" IL file which defines a function that prints to the screen. Since the string is not a first class object (only the pointer is) it is defined outside the function's body. Comments start with -a # character and run until the end of the line. +a # character and finish with the end of the line. # Define the string constant. data $str = { b "hello world", b 0 } @@ -70,7 +70,7 @@ a # character and run until the end of the line. } If you have read the LLVM language reference, you might -recognize the above example. In comparison, QBE makes a +recognize the example above. In comparison, QBE makes a much lighter use of types and the syntax is terser. ~ BNF Notation @@ -86,7 +86,7 @@ are listed below. * `( ... ),` designates a comma-separated list of the enclosed syntax; * `...*` and `...+` are used for arbitrary and - at-least-once repetition. + at-least-once repetition respectively. ~ Sigils ~~~~~~~~ @@ -94,14 +94,14 @@ are listed below. The intermediate language makes heavy use of sigils, all user-defined names are prefixed with a sigil. This is to avoid keyword conflicts, and also to quickly spot the -scope and kind of an identifier. +scope and nature of identifiers. * `:` is for user-defined <@ Aggregate Types> * `$` is for globals (represented by a pointer) * `%` is for function-scope temporaries * `@` is for block labels -In BNF syntax, we use `?IDENT` to designate an identifier +In this BNF syntax, we use `?IDENT` to designate an identifier starting with the sigil `?`. - 2. Types @@ -114,7 +114,7 @@ starting with the sigil `?`. BASETY := 'w' | 'l' | 's' | 'd' # Base types EXTTY := BASETY | 'b' | 'h' # Extended types -The IL makes very minimal use of types. By design, the types +The IL makes minimal use of types. By design, the types used are restricted to what is necessary for unambiguous compilation to machine code and C interfacing. Unlike LLVM, QBE is not using types as a means to safety; they are only @@ -140,16 +140,16 @@ section. ~ Subtyping ~~~~~~~~~~~ -The IL has a minimal subtyping feature for integer types. +The IL has a minimal subtyping feature, for integer types only. Any value of type `l` can be used in a `w` context. In that case, only the 32 least significant bits of the word value are used. -Make note that it is the inverse of the usual subtyping on +Make note that it is the opposite of the usual subtyping on integers (in C, we can safely use an `int` where a `long` is expected). A long value cannot be used in word context. The rationale is that a word can be signed or unsigned, so -extending it to a long can be done in two ways, either +extending it to a long could be done in two ways, either by zero-extension, or by sign-extension. - 3. Constants @@ -184,9 +184,9 @@ operand of the subtraction is a word (32-bit) context. Because specifying floating-point constants by their bits makes the code less readable, syntactic sugar is provided -to express them. Standard scientific notation is used with -a prefix of `s_` for single and `d_` for double-precision -numbers. Once again, the following example defines twice +to express them. Standard scientific notation is prefixed +with `s_` and `d_` for single and double precision numbers +respectively. Once again, the following example defines twice the same double-precision constant. %x =d add d_0, d_-1 @@ -200,7 +200,7 @@ constants by the linker. ---------------- Definitions are the essential components of an IL file. -They can define three types of objects: Aggregate types, +They can define three types of objects: aggregate types, data, and functions. Aggregate types are never exported and do not compile to any code. Data and function definitions have file scope and are mutually recursive @@ -221,14 +221,14 @@ using the `export` keyword. 'type' :IDENT '=' 'align' NUMBER '{' NUMBER '}' Aggregate type definitions start with the `type` keyword. -They have file scope, but types must be defined before their -first use. The inner structure of a type is expressed by a +They have file scope, but types must be defined before being +referenced. The inner structure of a type is expressed by a comma-separated list of <@ Simple Types> enclosed in curly braces. type :fourfloats = { s, s, d, d } -For ease of generation, a trailing comma is tolerated by +For ease of IL generation, a trailing comma is tolerated by the parser. In case many items of the same type are sequenced (like in a C array), the shorter array syntax can be used. @@ -243,7 +243,7 @@ explicitly specified by the programmer. Opaque types are used when the inner structure of an aggregate cannot be specified; the alignment for opaque -types is mandatory. They are defined by simply enclosing +types is mandatory. They are defined simply by enclosing their size between curly braces. type :opaque = align 16 { 32 } @@ -264,7 +264,7 @@ their size between curly braces. | '"' ... '"' # String | CONST # Constant -Data definitions define objects that will be emitted in the +Data definitions express objects that will be emitted in the compiled file. They can be local to the file or exported with global visibility to the whole program. @@ -282,11 +282,11 @@ initialize multiple fields of the same size. The members of a struct will be packed. This means that padding has to be emitted by the frontend when necessary. Alignment of the whole data objects can be manually specified, -and when no alignment is provided, the maximum alignment of +and when no alignment is provided, the maximum alignment from the platform is used. When the `z` letter is used the number following indicates -the size of the field, the contents of the field are zero +the size of the field; the contents of the field are zero initialized. It can be used to add padding between fields or zero-initialize big arrays. @@ -325,19 +325,18 @@ Here are various examples of data definitions. Function definitions contain the actual code to emit in the compiled file. They define a global symbol that contains a pointer to the function code. This pointer -can be used in call instructions or stored in memory. +can be used in `call` instructions or stored in memory. The type given right before the function name is the return type of the function. All return values of this -function must have the return type. If the return +function must have this return type. If the return type is missing, the function cannot return any value. The parameter list is a comma separated list of temporary names prefixed by types. The types are used to correctly implement C compatibility. When an argument -has an aggregate type, is is set on entry of the -function to a pointer to the aggregate passed by the -caller. In the example below, we have to use a load +has an aggregate type, a pointer to the aggregate is passed +by the caller. In the example below, we have to use a load instruction to get the value of the first (and only) member of the struct. @@ -350,7 +349,7 @@ member of the struct. } If the parameter list ends with `...`, the function is -a variadic function: It can accept a variable number of +a variadic function: it can accept a variable number of arguments. To access the extra arguments provided by the caller, use the `vastart` and `vaarg` instructions described in the <@ Variadic > section. @@ -375,10 +374,10 @@ very good compatibility with C. The <@ Call > section explains how to pass an environment parameter. Since global symbols are defined mutually recursive, -there is no need for function declarations: A function +there is no need for function declarations: a function can be referenced before its definition. Similarly, functions from other modules can be used -without previous declarations. All the type information +without previous declaration. All the type information is provided in the call instructions. The syntax and semantics for the body of functions @@ -389,8 +388,8 @@ are described in the <@ Control > section. The IL represents programs as textual transcriptions of control flow graphs. The control flow is serialized as -a sequence of blocks of straight-line code and connected -using jump instructions. +a sequence of blocks of straight-line code which are +connected using jump instructions. ~ Blocks ~~~~~~~~ @@ -406,12 +405,12 @@ All blocks have a name that is specified by a label at their beginning. Then follows a sequence of instructions that have "fall-through" flow. Finally one jump terminates the block. The jump can either transfer control to another -block of the same function or return, they are described +block of the same function or return; they are described further below. The first block in a function must not be the target of -any jump in the program. If this need is encountered, -the frontend can always insert an empty prelude block +any jump in the program. If this is really needed, +the frontend could insert an empty prelude block at the beginning of the function. When one block jumps to the next block in the IL file, @@ -453,7 +452,7 @@ the following list. When its word argument is non-zero, it jumps to its first label argument; otherwise it jumps to the other - label. The argument must be of word type, because of + label. The argument must be of word type; because of subtyping a long argument can be passed, but only its least significant 32 bits will be compared to 0. @@ -461,7 +460,7 @@ the following list. Terminates the execution of the current function, optionally returning a value to the caller. The value - returned must have the type given in the function + returned must be of the type given in the function prototype. If the function prototype does not specify a return type, no return value can be used. @@ -498,12 +497,12 @@ This is made explicit by the instruction suffix. The types of instructions are described below using a short type string. A type string specifies all the valid return types an instruction can have, its arity, and the type of -its arguments in function of its return type. +its arguments depending on its return type. Type strings begin with acceptable return types, then follows, in parentheses, the possible types for the arguments. -If the n-th return type of the type string is used for an -instruction, the arguments must use the n-th type listed for +If the N-th return type of the type string is used for an +instruction, the arguments must use the N-th type listed for them in the type string. When an instruction does not have a return type, the type string only contains the types of the arguments. @@ -513,7 +512,7 @@ The following abbreviations are used. * `T` stands for `wlsd` * `I` stands for `wl` * `F` stands for `sd` - * `m` stands for the type of pointers on the target, on + * `m` stands for the type of pointers on the target; on 64-bit architectures it is the same as `l` For example, consider the type string `wl(F)`, it mentions @@ -540,7 +539,7 @@ towards zero. The signed and unsigned remainder operations are available as `rem` and `urem`. The sign of the remainder is the same as the one of the dividend. Its magnitude is smaller than -the divisor's. These two instructions and `udiv` are only +the divisor one. These two instructions and `udiv` are only available with integer arguments and result. Bitwise OR, AND, and XOR operations are available for both @@ -548,8 +547,8 @@ integer types. Logical operations of typical programming languages can be implemented using <@ Comparisons > and <@ Jumps >. -Shift instructions `sar`, `shr`, and `shl` shift right or -left their first operand by the amount in the second +Shift instructions `sar`, `shr`, and `shl`, shift right or +left their first operand by the amount from the second operand. The shifting amount is taken modulo the size of the result type. Shifting right can either preserve the sign of the value (using `sar`), or fill the newly freed @@ -591,8 +590,8 @@ towards zero. * `loadsb`, `loadub` -- `I(mm)` For types smaller than long, two variants of the load - instruction is available: one will sign extend the value - loaded, while the other will zero extend it. Remark that + instruction are available: one will sign extend the loaded + value, while the other will zero extend it. Note that all loads smaller than long can load to either a long or a word. @@ -635,9 +634,9 @@ instructions. Pointers are stored in long temporaries. ~~~~~~~~~~~~~ Comparison instructions return an integer value (either a word -or a long), and compare values of arbitrary types. The value -returned is 1 if the two operands satisfy the comparison -relation, and 0 otherwise. The names of comparisons respect +or a long), and compare values of arbitrary types. The returned +value is 1 if the two operands satisfy the comparison +relation, or 0 otherwise. The names of comparisons respect a standard naming scheme in three parts. 1. All comparisons start with the letter `c`. @@ -676,7 +675,7 @@ a standard naming scheme in three parts. For example, `cod` (`I(dd,dd)`) compares two double-precision floating point numbers and returns 1 if the two floating points -are not NaNs, and 0 otherwise. The `csltw` (`I(ww,ww)`) +are not NaNs, or 0 otherwise. The `csltw` (`I(ww,ww)`) instruction compares two words representing signed numbers and returns 1 when the first argument is smaller than the second one. @@ -727,7 +726,7 @@ instruction to lower the precision of an integer temporary. ~~~~~~~~~~~~~~~ The `cast` and `copy` instructions return the bits of their -argument verbatim. A `cast` will however change an integer +argument verbatim. However a `cast` will change an integer into a floating point of the same width and vice versa. * `cast` -- `wlsd(sdwl)` @@ -755,7 +754,7 @@ single-precision floating point number `%f` into `%rs`. ABITY := BASETY | :IDENT -The call instruction is special in many ways. It is not +The call instruction is special in several ways. It is not a three-address instruction and requires the type of all its arguments to be given. Also, the return type can be either a base type or an aggregate type. These specifics @@ -801,7 +800,7 @@ is essentially effectful: calling it twice in a row will return two consecutive arguments from the argument list. Both instructions take a pointer to a variable argument -list as only argument. The size and alignment of variable +list as sole argument. The size and alignment of variable argument lists depend on the target used. However, it is possible to conservatively use the maximum size and alignment required by all the targets. @@ -890,7 +889,7 @@ translate it in SSA form is to insert a phi instruction. Phi instructions return one of their arguments depending on where the control came from. In the example, `%y` is -set to 1 if the `@ift` branch is taken, and it is set to +set to 1 if the `@ift` branch is taken, or it is set to 2 otherwise. An important remark about phi instructions is that QBE From 425a2ed09c08222e1254d93dba24c7a50e7a08b9 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 16 May 2017 11:33:41 -0400 Subject: [PATCH 104/286] do not account for interferences in phi classes Before this commit, I tried to make sure that two interfering temporaries never ended up in the same phi class. This was to make sure that their register hints were not counterproductively stepping on each other's toes. The idea is fine, but: * the implementation is clumsy because it mixes the orthogonal concepts of (i) interference and (ii) phi classes; * the hinting process in the register allocator is hard to understand because the disjoint-set data structure used for phi classes is cut in arbitrary places. After this commit, the phi classes *really* are phi classes represented with a proper disjoint-set data structure. --- live.c | 52 ++++++---------------------------------------------- ssa.c | 17 +++++++++-------- util.c | 16 ++++------------ 3 files changed, 19 insertions(+), 66 deletions(-) diff --git a/live.c b/live.c index 6e63705..4198995 100644 --- a/live.c +++ b/live.c @@ -19,46 +19,13 @@ liveon(BSet *v, Blk *b, Blk *s) } } -static int -phitmp(int t, Tmp *tmp) -{ - int tp; - - tp = tmp[t].phi; - return tp ? tp : t; -} - -static void -phifix(int t1, int *phi, Tmp *tmp) -{ - int t, t2; - - /* detect temporaries arguments - * of the same phi node that - * interfere and separate them - */ - t = phitmp(t1, tmp); - t2 = phi[t]; - if (t2 && t2 != t1) { - if (t != t1) { - tmp[t1].phi = t1; - t = t1; - } else { - tmp[t2].phi = t2; - phi[t2] = t2; - } - } - phi[t] = t1; -} - static void -bset(Ref r, Blk *b, int *nlv, int *phi, Tmp *tmp) +bset(Ref r, Blk *b, int *nlv, Tmp *tmp) { if (rtype(r) != RTmp) return; bsset(b->gen, r.val); - phifix(r.val, phi, tmp); if (!bshas(b->in, r.val)) { nlv[KBASE(tmp[r.val].cls)]++; bsset(b->in, r.val); @@ -74,13 +41,11 @@ filllive(Fn *f) Blk *b; Ins *i; int k, t, m[2], n, chg, nlv[2]; - int *phi; BSet u[1], v[1]; Mem *ma; bsinit(u, f->ntmp); bsinit(v, f->ntmp); - phi = emalloc(f->ntmp * sizeof phi[0]); for (b=f->start; b; b=b->link) { bsinit(b->in, f->ntmp); bsinit(b->out, f->ntmp); @@ -102,21 +67,18 @@ filllive(Fn *f) } chg |= !bsequal(b->out, u); - memset(phi, 0, f->ntmp * sizeof phi[0]); memset(nlv, 0, sizeof nlv); b->out->t[0] |= T.rglob; bscopy(b->in, b->out); - for (t=0; bsiter(b->in, &t); t++) { - phifix(t, phi, f->tmp); + for (t=0; bsiter(b->in, &t); t++) nlv[KBASE(f->tmp[t].cls)]++; - } if (rtype(b->jmp.arg) == RCall) { assert((int)bscount(b->in) == T.nrglob && nlv[0] == T.nrglob && nlv[1] == 0); b->in->t[0] |= T.retregs(b->jmp.arg, nlv); } else - bset(b->jmp.arg, b, nlv, phi, f->tmp); + bset(b->jmp.arg, b, nlv, f->tmp); for (k=0; k<2; k++) b->nlive[k] = nlv[k]; for (i=&b->ins[b->nins]; i!=b->ins;) { @@ -145,17 +107,16 @@ filllive(Fn *f) nlv[KBASE(f->tmp[t].cls)]--; bsset(b->gen, t); bsclr(b->in, t); - phi[phitmp(t, f->tmp)] = 0; } for (k=0; k<2; k++) switch (rtype(i->arg[k])) { case RMem: ma = &f->mem[i->arg[k].val]; - bset(ma->base, b, nlv, phi, f->tmp); - bset(ma->index, b, nlv, phi, f->tmp); + bset(ma->base, b, nlv, f->tmp); + bset(ma->index, b, nlv, f->tmp); break; default: - bset(i->arg[k], b, nlv, phi, f->tmp); + bset(i->arg[k], b, nlv, f->tmp); break; } for (k=0; k<2; k++) @@ -167,7 +128,6 @@ filllive(Fn *f) chg = 0; goto Again; } - free(phi); if (debug['L']) { fprintf(stderr, "\n> Liveness analysis:\n"); diff --git a/ssa.c b/ssa.c index 632ebbe..9aff73c 100644 --- a/ssa.c +++ b/ssa.c @@ -40,7 +40,7 @@ filluse(Fn *fn) Blk *b; Phi *p; Ins *i; - int m, t, w; + int m, t, tp, w; uint a; Tmp *tmp; @@ -49,8 +49,8 @@ filluse(Fn *fn) for (t=Tmp0; tntmp; t++) { tmp[t].ndef = 0; tmp[t].nuse = 0; - tmp[t].phi = 0; tmp[t].cls = 0; + tmp[t].phi = 0; tmp[t].width = WFull; if (tmp[t].use == 0) tmp[t].use = vnew(0, sizeof(Use), Pfn); @@ -58,16 +58,17 @@ filluse(Fn *fn) for (b=fn->start; b; b=b->link) { for (p=b->phi; p; p=p->link) { assert(rtype(p->to) == RTmp); - t = p->to.val; - tmp[t].ndef++; - tmp[t].cls = p->cls; - tmp[t].phi = p->to.val; + tp = p->to.val; + tmp[tp].ndef++; + tmp[tp].cls = p->cls; + tp = phicls(tp, fn->tmp); for (a=0; anarg; a++) if (rtype(p->arg[a]) == RTmp) { t = p->arg[a].val; adduse(&tmp[t], UPhi, b, p); - if (!tmp[t].phi) - tmp[t].phi = p->to.val; + t = phicls(t, fn->tmp); + if (t != tp) + tmp[t].phi = tp; } } for (i=b->ins; i-b->ins < b->nins; i++) { diff --git a/util.c b/util.c index 4144f87..cb6e75c 100644 --- a/util.c +++ b/util.c @@ -249,24 +249,16 @@ clsmerge(short *pk, short k) } int -phicls(int t, Tmp *tmp /*, int c*/) +phicls(int t, Tmp *tmp) { - if (tmp[t].phi) - return tmp[t].phi; - return t; -#if 0 int t1; t1 = tmp[t].phi; if (!t1) - t1 = t; - if (t != t1) { - t1 = phitmp(t1, tmp, c); - if (c) - tmp[t].phi = t1; - } + return t; + t1 = phicls(t1, tmp); + tmp[t].phi = t1; return t1; -#endif } Ref From 436d0fc07e4551dd4265cfed0b0bc459c71ed8ce Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 16 May 2017 11:44:52 -0400 Subject: [PATCH 105/286] change the computation of spill costs for phis I now take the view that a phi is "used" at the end of all the predecessors. (Think that copies are made to phis at the end of all predecessors.) --- spill.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spill.c b/spill.c index 3871247..d3a11f7 100644 --- a/spill.c +++ b/spill.c @@ -68,13 +68,11 @@ fillcost(Fn *fn) } for (b=fn->start; b; b=b->link) { for (p=b->phi; p; p=p->link) { - /* todo, the cost computation - * for p->to is not great... */ + t = &fn->tmp[p->to.val]; tmpuse(p->to, 0, 0, fn); for (a=0; anarg; a++) { n = p->blk[a]->loop; - assert(b->npred==p->narg && "wrong cfg"); - n /= b->npred; + t->cost += n; tmpuse(p->arg[a], 1, n, fn); } } From 2d02070af019e9896ecf2a63bedc098092fd395d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 16 May 2017 11:47:46 -0400 Subject: [PATCH 106/286] new hinting in the register allocator The previous heuristics were ad hoc and it was hard to understand why they worked at all. This patch can be summarized in three points: 1. When a register is freed (an instruction assigns it), we try to find if a temporary would like to be in it, and if we find one, we move it in the newly freed register. I call this an "eager move". 2. Temporaries now remember in what register they were last allocated; this information is stored in the field Tmp.visit, and prevails on the field Tmp.hint when it is set. (This makes having the same hint for interfering temporaries not so disastrous.) 3. Blocks are now allocated in "onion" order, from the innermost loop to the outermost. This is the change I am the least sure about; it should be evaluated thorougly. --- all.h | 5 +- rega.c | 420 +++++++++++++++++++++++++++++++++++---------------------- 2 files changed, 261 insertions(+), 164 deletions(-) diff --git a/all.h b/all.h index f24d099..1e9476d 100644 --- a/all.h +++ b/all.h @@ -288,8 +288,9 @@ struct Tmp { short slot; /* -1 for unset */ short cls; struct { - int r; - bits m; + int r; /* register or -1 */ + int w; /* weight */ + bits m; /* avoid these registers */ } hint; int phi; Alias alias; diff --git a/rega.c b/rega.c index 02429a6..2f01c07 100644 --- a/rega.c +++ b/rega.c @@ -10,6 +10,7 @@ typedef struct RMap RMap; struct RMap { int t[Tmp0]; int r[Tmp0]; + int w[Tmp0]; /* wait list, for unmatched hints */ BSet b[1]; int n; }; @@ -20,8 +21,12 @@ static Mem *mem; /* function mem references */ static struct { Ref src, dst; int cls; -} *pm; /* parallel move constructed */ -static int cpm, npm; /* capacity and size of pm */ +} pm[Tmp0]; /* parallel move constructed */ +static int npm; /* size of pm */ +static int loop; /* current loop level */ + +static uint stmov; /* stats: added moves */ +static uint stblk; /* stats: added blocks */ static int * hint(int t) @@ -32,21 +37,21 @@ hint(int t) static void sethint(int t, int r) { - bits m; + Tmp *p; - m = tmp[phicls(t, tmp)].hint.m; - if (*hint(t) == -1) - if (!(BIT(r) & m)) - *hint(t) = r; + p = &tmp[phicls(t, tmp)]; + if (p->hint.r == -1 || p->hint.w > loop) { + p->hint.r = r; + p->hint.w = loop; + tmp[t].visit = -1; + } } static void rcopy(RMap *ma, RMap *mb) { - memcpy(ma->t, mb->t, sizeof ma->t); - memcpy(ma->r, mb->r, sizeof ma->r); + memcpy(ma, mb, sizeof *ma); bscopy(ma->b, mb->b); - ma->n = mb->n; } static int @@ -93,10 +98,10 @@ radd(RMap *m, int t, int r) } static Ref -ralloc(RMap *m, int t) +ralloctry(RMap *m, int t, int try) { bits regs; - int r, r0, r1; + int h, r, r0, r1; if (t < Tmp0) { assert(bshas(m->b, t)); @@ -107,8 +112,12 @@ ralloc(RMap *m, int t) assert(r != -1); return TMP(r); } - r = *hint(t); + r = tmp[t].visit; + if (r == -1 || bshas(m->b, r)) + r = *hint(t); if (r == -1 || bshas(m->b, r)) { + if (try) + return R; regs = tmp[phicls(t, tmp)].hint.m; regs |= m->b->t[0]; if (KBASE(tmp[t].cls) == 0) { @@ -129,9 +138,19 @@ ralloc(RMap *m, int t) Found: radd(m, t, r); sethint(t, r); + tmp[t].visit = r; + h = *hint(t); + if (h != -1 && h != r) + m->w[h] = t; return TMP(r); } +static inline Ref +ralloc(RMap *m, int t) +{ + return ralloctry(m, t, 0); +} + static int rfree(RMap *m, int t) { @@ -168,12 +187,8 @@ mdump(RMap *m) static void pmadd(Ref src, Ref dst, int k) { - if (npm == cpm) { - cpm = cpm * 2 + 16; - pm = realloc(pm, cpm * sizeof pm[0]); - if (!pm) - die("pmadd, out of memory"); - } + if (npm == Tmp0) + die("cannot have more moves than registers"); pm[npm].src = src; pm[npm].dst = dst; pm[npm].cls = k; @@ -182,77 +197,61 @@ pmadd(Ref src, Ref dst, int k) enum PMStat { ToMove, Moving, Moved }; -static Ref +static int pmrec(enum PMStat *status, int i, int *k) { - Ref swp, swp1; - int j, k1; + int j, c; /* note, this routine might emit - * too many large instructions: - * - * , x -- x - * x -- x -- x | - * ` x -- x - * - * if only the first move is wide - * the whole cycle will be wide, - * this is safe but not necessary + * too many large instructions */ - - if (req(pm[i].src, pm[i].dst)) - return R; - status[i] = Moving; - assert(KBASE(*k) == KBASE(pm[i].cls)); - assert((Kw|1) == Kl && (Ks|1) == Kd); - *k |= KWIDE(pm[i].cls); /* see above */ - swp = R; - for (j=0; jb, r) && r1 != r) { + if (bshas(m->b, r)) { /* r is used and not by to */ + assert(r1 != r); for (n=0; m->r[n] != r; n++) assert(n+1 < m->n); t = m->t[n]; @@ -286,10 +286,11 @@ dopm(Blk *b, Ins *i, RMap *m) { RMap m0; int n, r, r1, t, s; - Ins *i0, *i1, *ip, *ir; + Ins *i1, *ip; bits def; - m0 = *m; + m0 = *m; /* okay since we don't use m0.b */ + m0.b->t = 0; i1 = ++i; do { i--; @@ -320,21 +321,11 @@ dopm(Blk *b, Ins *i, RMap *m) radd(m, r, r); } pmgen(); -#ifdef TEST_PMOV - return 0; -#endif - n = b->nins - (i1 - i) + (curi - insb); - i0 = alloc(n * sizeof(Ins)); - ip = icpy(ip = i0, b->ins, i - b->ins); - ip = icpy(ir = ip, insb, curi - insb); - ip = icpy(ip, i1, &b->ins[b->nins] - i1); - b->nins = n; - b->ins = i0; - return ir; + return i; } static int -prio(Ref r1, Ref r2) +prio1(Ref r1, Ref r2) { /* trivial heuristic to begin with, * later we can use the distance to @@ -350,7 +341,7 @@ insert(Ref *r, Ref **rs, int p) int i; rs[i = p] = r; - while (i-- > 0 && prio(*r, *rs[i])) { + while (i-- > 0 && prio1(*r, *rs[i])) { rs[i+1] = rs[i]; rs[i] = r; } @@ -359,9 +350,9 @@ insert(Ref *r, Ref **rs, int p) static void doblk(Blk *b, RMap *cur) { - int x, r, nr; + int t, x, r, rf, rt, nr; bits rs; - Ins *i; + Ins *i, *i1; Mem *m; Ref *ra[4]; @@ -369,8 +360,12 @@ doblk(Blk *b, RMap *cur) radd(cur, r, r); if (rtype(b->jmp.arg) == RTmp) b->jmp.arg = ralloc(cur, b->jmp.arg.val); - for (i=&b->ins[b->nins]; i!=b->ins;) { - switch ((--i)->op) { + curi = &insb[NIns]; + for (i1=&b->ins[b->nins]; i1!=b->ins;) { + emiti(*--i1); + i = curi; + rf = -1; + switch (i->op) { case Ocall: rs = T.argregs(i->arg[1], 0) | T.rglob; for (r=0; T.rsave[r]>=0; r++) @@ -378,8 +373,10 @@ doblk(Blk *b, RMap *cur) rfree(cur, T.rsave[r]); break; case Ocopy: - if (isreg(i->arg[0])) { - i = dopm(b, i, cur); + if (regcpy(i)) { + curi++; + i1 = dopm(b, i1, cur); + stmov += i+1 - curi; continue; } if (isreg(i->to)) @@ -390,14 +387,15 @@ doblk(Blk *b, RMap *cur) if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); r = i->to.val; - if (r >= Tmp0 || !(BIT(r) & T.rglob)) - r = rfree(cur, r); - if (r == -1) { + if (r < Tmp0 && (BIT(r) & T.rglob)) + break; + rf = rfree(cur, r); + if (rf == -1) { assert(!isreg(i->to)); - *i = (Ins){.op = Onop}; + curi++; continue; } - i->to = TMP(r); + i->to = TMP(rf); } break; } @@ -416,7 +414,57 @@ doblk(Blk *b, RMap *cur) } for (r=0; rval); + + /* try to change the register of a hinted + * temporary if rf is available */ + x = 1; + if (rf != -1 && (t = cur->w[rf]) != 0) + if (!bshas(cur->b, rf) && *hint(t) == rf + && (rt = rfree(cur, t)) != -1) { + tmp[t].visit = -1; + ralloc(cur, t); + assert(bshas(cur->b, rf)); + emit(Ocopy, tmp[t].cls, TMP(rt), TMP(rf), R); + stmov += 1; + cur->w[rf] = 0; + for (r=0; rnins = &insb[NIns] - curi; + idup(&b->ins, curi, b->nins); +} + +/* qsort() comparison function to peel + * loop nests from inside out */ +static int +carve(const void *a, const void *b) +{ + Blk *ba, *bb; + + /* todo, evaluate if this order is really + * better than the simple postorder */ + ba = *(Blk**)a; + bb = *(Blk**)b; + if (ba->loop == bb->loop) + return ba->id > bb->id ? -1 : ba->id < bb->id; + return ba->loop > bb->loop ? -1 : +1; +} + +/* comparison function to order temporaries + * for allocation at the end of blocks */ +static int +prio2(int t1, int t2) +{ + if ((tmp[t1].visit ^ tmp[t2].visit) < 0) /* != signs */ + return tmp[t1].visit != -1 ? +1 : -1; + if ((*hint(t1) ^ *hint(t2)) < 0) + return *hint(t1) != -1 ? +1 : -1; + return tmp[t1].cost - tmp[t2].cost; } /* register allocation @@ -425,18 +473,21 @@ doblk(Blk *b, RMap *cur) void rega(Fn *fn) { - int j, t, r, r1, x, rl[Tmp0]; - Blk *b, *b1, *s, ***ps, *blist; - RMap *end, *beg, cur, old; + int j, t, r, x, rl[Tmp0]; + Blk *b, *b1, *s, ***ps, *blist, **blk, **bp; + RMap *end, *beg, cur, old, *m; Ins *i; Phi *p; uint u, n; Ref src, dst; /* 1. setup */ + stmov = 0; + stblk = 0; regu = 0; tmp = fn->tmp; mem = fn->mem; + blk = alloc(fn->nblk * sizeof blk[0]); end = alloc(fn->nblk * sizeof end[0]); beg = alloc(fn->nblk * sizeof beg[0]); for (n=0; nnblk; n++) { @@ -446,8 +497,15 @@ rega(Fn *fn) bsinit(cur.b, fn->ntmp); bsinit(old.b, fn->ntmp); - for (t=0; tntmp; t++) - *hint(t) = t < Tmp0 ? t : -1; + loop = INT_MAX; + for (t=0; tntmp; t++) { + tmp[t].hint.r = t < Tmp0 ? t : -1; + tmp[t].hint.w = loop; + tmp[t].visit = -1; + } + for (bp=blk, b=fn->start; b; b=b->link) + *bp++ = b; + qsort(blk, fn->nblk, sizeof blk[0], carve); for (b=fn->start, i=b->ins; i-b->ins < b->nins; i++) if (i->op != Ocopy || !isreg(i->arg[0])) break; @@ -456,71 +514,103 @@ rega(Fn *fn) sethint(i->to.val, i->arg[0].val); } - /* 2. assign registers following post-order */ - for (n=fn->nblk-1; n!=-1u; n--) { - b = fn->rpo[n]; + /* 2. assign registers */ + for (bp=blk; bp<&blk[fn->nblk]; bp++) { + b = *bp; + n = b->id; + loop = b->loop; cur.n = 0; bszero(cur.b); - for (x=0; x<2; x++) - for (t=Tmp0; bsiter(b->out, &t); t++) - if (x || (r=*hint(t)) != -1) - if (x || !bshas(cur.b, r)) - ralloc(&cur, t); + memset(cur.w, 0, sizeof cur.w); + for (x=0, t=Tmp0; bsiter(b->out, &t); t++) { + j = x++; + rl[j] = t; + while (j-- > 0 && prio2(t, rl[j]) > 0) { + rl[j+1] = rl[j]; + rl[j] = t; + } + } + for (j=0; jin, cur.b); for (p=b->phi; p; p=p->link) - if (rtype(p->to) == RTmp) { + if (rtype(p->to) == RTmp) bsclr(b->in, p->to.val); - /* heuristic 0: - * if the phi destination has an - * argument from a frequent block - * that was already allocated to - * 'r', use 'r' as the new hint - */ - memset(rl, 0, sizeof rl); - for (u=0; unarg; u++) { - t = p->arg[u].val; - b1 = p->blk[u]; - if (rtype(p->arg[u]) == RTmp) - if ((r=rfind(&end[b1->id], t)) != -1) - rl[r] += b1->loop; - } - for (x=0, j=0; j rl[x]) - x = j; - if (rl[x] >= b->loop) - *hint(p->to.val) = x; + rcopy(&beg[n], &cur); + } + + /* 3. emit copies shared by multiple edges + * to the same block */ + for (s=fn->start; s; s=s->link) { + if (s->npred <= 1) + continue; + m = &beg[s->id]; + + /* rl maps a register that is live at the + * beginning of s to the one used in all + * predecessors (if any, -1 otherwise) */ + memset(rl, 0, sizeof rl); + + /* to find the register of a phi in a + * predecessor, we have to find the + * corresponding argument */ + for (p=s->phi; p; p=p->link) { + r = rfind(m, p->to.val); + if (r == -1) + continue; + for (u=0; unarg; u++) { + b = p->blk[u]; + src = p->arg[u]; + if (rtype(src) != RTmp) + continue; + x = rfind(&end[b->id], src.val); + assert(x != -1); + rl[r] = (!rl[r] || rl[r] == x) ? x : -1; } - if (b->npred > 1) { - /* heuristic 1: - * attempt to satisfy hints - * when it's simple and we have - * multiple predecessors - */ - rcopy(&old, &cur); - curi = &insb[NIns]; - for (j=0; jn; j++) { + t = m->t[j]; + r = m->r[j]; + if (rl[r] || t < Tmp0 /* todo, remove this */) + continue; + for (bp=s->pred; bp<&s->pred[s->npred]; bp++) { + x = rfind(&end[(*bp)->id], t); + assert(x != -1); + rl[r] = (!rl[r] || rl[r] == x) ? x : -1; } - if ((j = &insb[NIns] - curi)) { - b->nins += j; - i = alloc(b->nins * sizeof(Ins)); - icpy(icpy(i, curi, j), b->ins, b->nins-j); - b->ins = i; + } + + npm = 0; + for (j=0; jn; j++) { + t = m->t[j]; + r = m->r[j]; + x = rl[r]; + assert(x != 0 || t < Tmp0 /* todo, ditto */); + if (x > 0) { + pmadd(TMP(x), TMP(r), tmp[t].cls); + m->r[j] = x; } } - rcopy(&beg[n], &cur); + curi = &insb[NIns]; + pmgen(); + j = &insb[NIns] - curi; + if (j == 0) + continue; + stmov += j; + s->nins += j; + i = alloc(s->nins * sizeof(Ins)); + icpy(icpy(i, curi, j), s->ins, s->nins-j); + s->ins = i; } + if (debug['R']) { fprintf(stderr, "\n> Register mappings:\n"); for (n=0; nnblk; n++) { @@ -533,7 +623,7 @@ rega(Fn *fn) fprintf(stderr, "\n"); } - /* 3. compose glue code */ + /* 4. emit remaining copies in new blocks */ blist = 0; for (b=fn->start;; b=b->link) { ps = (Blk**[3]){&b->s1, &b->s2, (Blk*[1]){0}}; @@ -560,8 +650,9 @@ rega(Fn *fn) dst = rref(&beg[s->id], t); pmadd(src, dst, tmp[t].cls); } + curi = &insb[NIns]; pmgen(); - if (curi == insb) + if (curi == &insb[NIns]) continue; b1 = blknew(); b1->loop = (b->loop+s->loop) / 2; @@ -569,8 +660,10 @@ rega(Fn *fn) blist = b1; fn->nblk++; sprintf(b1->name, "%s_%s", b->name, s->name); - b1->nins = curi - insb; - idup(&b1->ins, insb, b1->nins); + b1->nins = &insb[NIns] - curi; + stmov += b1->nins; + stblk += 1; + idup(&b1->ins, curi, b1->nins); b1->jmp.type = Jjmp; b1->s1 = s; **ps = b1; @@ -585,6 +678,9 @@ rega(Fn *fn) fn->reg = regu; if (debug['R']) { + fprintf(stderr, "\n> Register allocation statistics:\n"); + fprintf(stderr, "\tnew moves: %d\n", stmov); + fprintf(stderr, "\tnew blocks: %d\n", stblk); fprintf(stderr, "\n> After register allocation:\n"); printfn(fn, stderr); } From a3a1451c5fabb5c94f7fbeb13fdc6b1e2c23181f Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 17 May 2017 09:40:07 -0400 Subject: [PATCH 107/286] intern symbol names Symbols in the source file are still limited in length because the rest of the code assumes that strings always fit in NString bytes. Regardless, there is already a benefit because comparing/copying symbol names does not require using strcmp()/strcpy() anymore. --- alias.c | 4 +- all.h | 13 +++-- amd64/emit.c | 8 +-- amd64/isel.c | 4 +- arm64/emit.c | 4 +- arm64/isel.c | 4 +- fold.c | 23 +++++--- load.c | 2 +- parse.c | 17 +----- util.c | 151 +++++++++++++++++++++++++++++++++++---------------- 10 files changed, 143 insertions(+), 87 deletions(-) diff --git a/alias.c b/alias.c index 77d5d73..66c12e5 100644 --- a/alias.c +++ b/alias.c @@ -18,7 +18,7 @@ getalias(Alias *a, Ref r, Fn *fn) c = &fn->con[r.val]; if (c->type == CAddr) { a->type = ASym; - strcpy(a->label, c->label); + a->label = c->label; } else a->type = ACon; a->offset = c->bits.i; @@ -51,7 +51,7 @@ alias(Ref p, int sp, Ref q, int sq, int *delta, Fn *fn) /* they conservatively alias if the * symbols are different, or they * alias for sure if they overlap */ - if (strcmp(ap.label, aq.label) != 0) + if (ap.label != aq.label) return MayAlias; if (ovlap) return MustAlias; diff --git a/all.h b/all.h index 1e9476d..b9ac9b2 100644 --- a/all.h +++ b/all.h @@ -275,7 +275,7 @@ struct Alias { #define astack(t) ((t) & 1) } type; Ref base; - char label[NString]; + uint32_t label; int64_t offset; Alias *slot; }; @@ -312,7 +312,7 @@ struct Con { CBits, CAddr, } type; - char label[NString]; + uint32_t label; union { int64_t i; double d; @@ -411,19 +411,22 @@ typedef enum { extern Typ *typ; extern Ins insb[NIns], *curi; +uint32_t hash(char *); void die_(char *, char *, ...) __attribute__((noreturn)); void *emalloc(size_t); void *alloc(size_t); void freeall(void); +void *vnew(ulong, size_t, Pool); +void vfree(void *); +void vgrow(void *, ulong); +uint32_t intern(char *); +char *str(uint32_t); int argcls(Ins *, int); int iscmp(int, int *, int *); void emit(int, int, Ref, Ref, Ref); void emiti(Ins); void idup(Ins **, Ins *, ulong); Ins *icpy(Ins *, Ins *, ulong); -void *vnew(ulong, size_t, Pool); -void vfree(void *); -void vgrow(void *, ulong); int cmpop(int); int cmpneg(int); int clsmerge(short *, short); diff --git a/amd64/emit.c b/amd64/emit.c index eccbd02..cd485bb 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -161,12 +161,12 @@ slot(int s, Fn *fn) static void emitcon(Con *con, FILE *f) { + char *p; + switch (con->type) { case CAddr: - if (con->local) - fprintf(f, "%s%s", gasloc, con->label); - else - fprintf(f, "%s%s", gassym, con->label); + p = con->local ? gasloc : gassym; + fprintf(f, "%s%s", p, str(con->label)); if (con->bits.i) fprintf(f, "%+"PRId64, con->bits.i); break; diff --git a/amd64/isel.c b/amd64/isel.c index 0dbaad3..39fc9e8 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -61,6 +61,7 @@ rslot(Ref r, Fn *fn) static void fixarg(Ref *r, int k, int op, Fn *fn) { + char buf[32]; Addr a, *m; Ref r0, r1; int s, n, cpy, mem; @@ -80,7 +81,8 @@ fixarg(Ref *r, int k, int op, Fn *fn) a.offset.type = CAddr; a.offset.local = 1; n = gasstashfp(fn->con[r0.val].bits.i, KWIDE(k)); - sprintf(a.offset.label, "fp%d", n); + sprintf(buf, "fp%d", n); + a.offset.label = intern(buf); fn->mem[fn->nmem-1] = a; } else if (!cpy && k == Kl && noimm(r0, fn)) { diff --git a/arm64/emit.c b/arm64/emit.c index 1b71179..8211c4f 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -244,9 +244,9 @@ loadcon(Con *c, int r, int k, FILE *f) off[0] = 0; p = c->local ? ".L" : ""; fprintf(f, "\tadrp\t%s, %s%s%s\n", - rn, p, c->label, off); + rn, p, str(c->label), off); fprintf(f, "\tadd\t%s, %s, #:lo12:%s%s%s\n", - rn, rn, p, c->label, off); + rn, rn, p, str(c->label), off); return; } assert(c->type == CBits); diff --git a/arm64/isel.c b/arm64/isel.c index 2d4e995..7ab368f 100644 --- a/arm64/isel.c +++ b/arm64/isel.c @@ -69,6 +69,7 @@ arm64_logimm(uint64_t x, int k) static void fixarg(Ref *pr, int k, int phi, Fn *fn) { + char buf[32]; Ref r0, r1, r2; int s, n; Con *c; @@ -86,8 +87,9 @@ fixarg(Ref *pr, int k, int phi, Fn *fn) n = gasstashfp(c->bits.i, KWIDE(k)); vgrow(&fn->con, ++fn->ncon); c = &fn->con[fn->ncon-1]; + sprintf(buf, "fp%d", n); *c = (Con){.type = CAddr, .local = 1}; - sprintf(c->label, "fp%d", n); + c->label = intern(buf); r2 = newtmp("isel", Kl, fn); emit(Oload, k, r1, r2, R); emit(Ocopy, Kl, r2, CON(c-fn->con), R); diff --git a/fold.c b/fold.c index 55672dd..c2375df 100644 --- a/fold.c +++ b/fold.c @@ -333,8 +333,10 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) double fd; } l, r; uint64_t x; - char *lab; + uint32_t lab; + int typ; + typ = CBits; lab = 0; l.s = cl->bits.i; r.s = cr->bits.i; @@ -343,15 +345,19 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) if (cr->type == CAddr) err("undefined addition (addr + addr)"); lab = cl->label; + typ = CAddr; } - else if (cr->type == CAddr) + else if (cr->type == CAddr) { lab = cr->label; + typ = CAddr; + } } else if (op == Osub) { if (cl->type == CAddr) { - if (cr->type != CAddr) + if (cr->type != CAddr) { lab = cl->label; - else if (strcmp(cl->label, cr->label) != 0) + typ = CAddr; + } else if (cl->label != cr->label) err("undefined substraction (addr1 - addr2)"); } else if (cr->type == CAddr) @@ -386,8 +392,10 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) case Odtosi: x = w ? (int64_t)cl->bits.d : (int32_t)cl->bits.d; break; case Ocast: x = l.u; - if (cl->type == CAddr) + if (cl->type == CAddr) { lab = cl->label; + typ = CAddr; + } break; default: if (Ocmpw <= op && op <= Ocmpl1) { @@ -439,10 +447,7 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) else die("unreachable"); } - *res = (Con){lab ? CAddr : CBits, .bits={.i=x}}; - res->bits.i = x; - if (lab) - strcpy(res->label, lab); + *res = (Con){.type=typ, .label=lab, .bits={.i=x}}; return 0; } diff --git a/load.c b/load.c index bb4acbc..31d00bc 100644 --- a/load.c +++ b/load.c @@ -151,7 +151,7 @@ load(Slice sl, bits msk, Loc *l) c = curf->ncon++; vgrow(&curf->con, curf->ncon); curf->con[c].type = CAddr; - strcpy(curf->con[c].label, a->label); + curf->con[c].label = a->label; curf->con[c].bits.i = a->offset; curf->con[c].local = 0; r = CON(c); diff --git a/parse.c b/parse.c index b7bab5b..f4d4909 100644 --- a/parse.c +++ b/parse.c @@ -143,17 +143,6 @@ err(char *s, ...) exit(1); } -static inline uint32_t -hash(char *s) -{ - uint32_t h; - - h = 0; - for (; *s; ++s) - h = *s + 17*h; - return h; -} - static void lexinit() { @@ -394,12 +383,12 @@ parseref() goto Look; case Tglo: c.type = CAddr; - strcpy(c.label, tokval.str); + c.label = intern(tokval.str); Look: for (i=0; incon; i++) if (curf->con[i].type == c.type && curf->con[i].bits.i == c.bits.i - && strcmp(curf->con[i].label, c.label) == 0) + && curf->con[i].label == c.label) return CON(i); vgrow(&curf->con, ++curf->ncon); curf->con[i] = c; @@ -1091,7 +1080,7 @@ printcon(Con *c, FILE *f) case CUndef: break; case CAddr: - fprintf(f, "$%s", c->label); + fprintf(f, "$%s", str(c->label)); if (c->bits.i) fprintf(f, "%+"PRIi64, c->bits.i); break; diff --git a/util.c b/util.c index cb6e75c..8527931 100644 --- a/util.c +++ b/util.c @@ -3,6 +3,7 @@ typedef struct Bitset Bitset; typedef struct Vec Vec; +typedef struct Bucket Bucket; struct Vec { ulong mag; @@ -16,10 +17,17 @@ struct Vec { } align[]; }; +struct Bucket { + uint nstr; + char **str; +}; + enum { VMin = 2, VMag = 0xcabba9e, NPtr = 256, + IBits = 12, + IMask = (1<mag = VMag; + v->cap = cap; + v->esz = esz; + v->pool = pool; + return v + 1; +} + +void +vfree(void *p) +{ + Vec *v; + + v = (Vec *)p - 1; + assert(v->mag == VMag); + if (v->pool == Pheap) { + v->mag = 0; + free(v); + } +} + +void +vgrow(void *vp, ulong len) +{ + Vec *v; + void *v1; + + v = *(Vec **)vp - 1; + assert(v+1 && v->mag == VMag); + if (v->cap >= len) + return; + v1 = vnew(len, v->esz, v->pool); + memcpy(v1, v+1, v->cap * v->esz); + vfree(v+1); + *(Vec **)vp = v1; +} + +uint32_t +intern(char *s) +{ + Bucket *b; + uint32_t h; + uint i, n; + + h = hash(s) & IMask; + b = &itbl[h]; + n = b->nstr; + + for (i=0; istr[i]) == 0) + return h + (i<str = vnew(1, sizeof b->str[0], Pheap); + else if ((n & (n-1)) == 0) + vgrow(&b->str, n+n); + + b->str[n] = emalloc(strlen(s)+1); + b->nstr = n + 1; + strcpy(b->str[n], s); + return h + (n<>IBits < itbl[id&IMask].nstr); + return itbl[id&IMask].str[id>>IBits]; +} + int iscmp(int op, int *pk, int *pc) { @@ -148,53 +250,6 @@ icpy(Ins *d, Ins *s, ulong n) return d + n; } -void * -vnew(ulong len, size_t esz, Pool pool) -{ - void *(*f)(size_t); - ulong cap; - Vec *v; - - for (cap=VMin; capmag = VMag; - v->cap = cap; - v->esz = esz; - v->pool = pool; - return v + 1; -} - -void -vfree(void *p) -{ - Vec *v; - - v = (Vec *)p - 1; - assert(v->mag == VMag); - if (v->pool == Pheap) { - v->mag = 0; - free(v); - } -} - -void -vgrow(void *vp, ulong len) -{ - Vec *v; - void *v1; - - v = *(Vec **)vp - 1; - assert(v+1 && v->mag == VMag); - if (v->cap >= len) - return; - v1 = vnew(len, v->esz, v->pool); - memcpy(v1, v+1, v->cap * v->esz); - vfree(v+1); - *(Vec **)vp = v1; -} - static int cmptab[][2] ={ /* negation swap */ [Ciule] = {Ciugt, Ciuge}, @@ -308,7 +363,7 @@ addcon(Con *c0, Con *c1) if (c1->type == CAddr) { assert(c0->type != CAddr && "adding two addresses"); c0->type = CAddr; - strcpy(c0->label, c1->label); + c0->label = c1->label; } c0->bits.i += c1->bits.i; } From 66288673cdce588bf81612c0599047665afefce7 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 17 May 2017 11:17:17 -0400 Subject: [PATCH 108/286] free the typ vector at the end of parse() --- parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/parse.c b/parse.c index f4d4909..d9aa1b1 100644 --- a/parse.c +++ b/parse.c @@ -1068,6 +1068,7 @@ parse(FILE *f, char *path, void data(Dat *), void func(Fn *)) parsetyp(); break; case Teof: + vfree(typ); return; } } From 5dcf8c14cbefb3f96262e5fbe5168cfe48e6fd3a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 6 Jun 2017 10:09:31 -0400 Subject: [PATCH 109/286] fix floating-point division It never worked until today. --- amd64/emit.c | 10 ++++++++++ amd64/isel.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/amd64/emit.c b/amd64/emit.c index cd485bb..4d4d3be 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -405,6 +405,16 @@ emitins(Ins i, Fn *fn, FILE *f) break; } goto Table; + case Odiv: + /* adjust the instruction when the conversion to + * a 2-address division is impossible */ + if (req(i.to, i.arg[1])) { + i.arg[1] = TMP(XMM0+15); + emitf("mov%k %=, %1", &i, fn, f); + emitf("mov%k %0, %=", &i, fn, f); + i.arg[0] = i.to; + } + goto Table; case Ocopy: /* make sure we don't emit useless copies, * also, we can use a trick to load 64-bits diff --git a/amd64/isel.c b/amd64/isel.c index 39fc9e8..180439b 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -200,6 +200,8 @@ sel(Ins i, ANum *an, Fn *fn) case Orem: case Oudiv: case Ourem: + if (KBASE(k) == 1) + goto Emit; if (i.op == Odiv || i.op == Oudiv) r0 = TMP(RAX), r1 = TMP(RDX); else From 9908ae067af59cb6e43997552cb0e03e8f082f31 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 6 Jun 2017 13:46:33 -0400 Subject: [PATCH 110/286] isreg() does not need to be inlined --- all.h | 6 +----- util.c | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/all.h b/all.h index b9ac9b2..1abd23c 100644 --- a/all.h +++ b/all.h @@ -103,11 +103,6 @@ static inline int rtype(Ref r) return r.type; } -static inline int isreg(Ref r) -{ - return rtype(r) == RTmp && r.val < Tmp0; -} - enum CmpI { Cieq, Cine, @@ -422,6 +417,7 @@ void vgrow(void *, ulong); uint32_t intern(char *); char *str(uint32_t); int argcls(Ins *, int); +int isreg(Ref); int iscmp(int, int *, int *); void emit(int, int, Ref, Ref, Ref); void emiti(Ins); diff --git a/util.c b/util.c index 8527931..f1a5383 100644 --- a/util.c +++ b/util.c @@ -189,6 +189,12 @@ str(uint32_t id) return itbl[id&IMask].str[id>>IBits]; } +int +isreg(Ref r) +{ + return rtype(r) == RTmp && r.val < Tmp0; +} + int iscmp(int op, int *pk, int *pc) { From 64c79edda0bc29d11b7efaffa9d051f64ea431d0 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 6 Jun 2017 18:06:34 -0400 Subject: [PATCH 111/286] fix fp subtractions on amd64 The stashing of constants in gas.c was also changed to support 16-bytes constants. --- all.h | 2 +- amd64/emit.c | 22 ++++++++++++--- amd64/isel.c | 2 +- arm64/isel.c | 2 +- gas.c | 78 ++++++++++++++++++++++++++-------------------------- 5 files changed, 60 insertions(+), 46 deletions(-) diff --git a/all.h b/all.h index 1abd23c..629fea3 100644 --- a/all.h +++ b/all.h @@ -517,5 +517,5 @@ void rega(Fn *); extern char *gasloc; extern char *gassym; void gasemitdat(Dat *, FILE *); -int gasstashfp(int64_t, int); +int gasstash(void *, int); void gasemitfin(FILE *); diff --git a/amd64/emit.c b/amd64/emit.c index 4d4d3be..51833b4 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -350,6 +350,11 @@ emitf(char *s, Ins *i, Fn *fn, FILE *f) goto Next; } +static void *negmask[4] = { + [Ks] = (uint32_t[4]){ 0x80000000 }, + [Kd] = (uint64_t[2]){ 0x8000000000000000 }, +}; + static void emitins(Ins i, Fn *fn, FILE *f) { @@ -398,16 +403,25 @@ emitins(Ins i, Fn *fn, FILE *f) goto Table; case Osub: /* we have to use the negation trick to handle - * some 3-address substractions */ + * some 3-address subtractions */ if (req(i.to, i.arg[1])) { - emitf("neg%k %=", &i, fn, f); + if (KBASE(i.cls) == 0) + emitf("neg%k %=", &i, fn, f); + else + fprintf(f, + "\txorp%c %sfp%d(%%rip), %%%s\n", + "xxsd"[i.cls], + gasloc, + gasstash(negmask[i.cls], 16), + regtoa(i.to.val, SLong) + ); emitf("add%k %0, %=", &i, fn, f); break; } goto Table; case Odiv: - /* adjust the instruction when the conversion to - * a 2-address division is impossible */ + /* use xmm15 to adjust the instruction when the + * conversion to 2-address in emitf() would fail */ if (req(i.to, i.arg[1])) { i.arg[1] = TMP(XMM0+15); emitf("mov%k %=, %1", &i, fn, f); diff --git a/amd64/isel.c b/amd64/isel.c index 180439b..4202610 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -80,7 +80,7 @@ fixarg(Ref *r, int k, int op, Fn *fn) memset(&a, 0, sizeof a); a.offset.type = CAddr; a.offset.local = 1; - n = gasstashfp(fn->con[r0.val].bits.i, KWIDE(k)); + n = gasstash(&fn->con[r0.val].bits, KWIDE(k) ? 8 : 4); sprintf(buf, "fp%d", n); a.offset.label = intern(buf); fn->mem[fn->nmem-1] = a; diff --git a/arm64/isel.c b/arm64/isel.c index 7ab368f..59f1579 100644 --- a/arm64/isel.c +++ b/arm64/isel.c @@ -84,7 +84,7 @@ fixarg(Ref *pr, int k, int phi, Fn *fn) emit(Ocopy, k, r1, r0, R); } else { c = &fn->con[r0.val]; - n = gasstashfp(c->bits.i, KWIDE(k)); + n = gasstash(&c->bits, KWIDE(k) ? 8 : 4); vgrow(&fn->con, ++fn->ncon); c = &fn->con[fn->ncon-1]; sprintf(buf, "fp%d", n); diff --git a/gas.c b/gas.c index c1fd6df..6c3317d 100644 --- a/gas.c +++ b/gas.c @@ -54,34 +54,30 @@ gasemitdat(Dat *d, FILE *f) } } -typedef struct FBits FBits; +typedef struct Asmbits Asmbits; -struct FBits { - union { - int64_t n; - float f; - double d; - } bits; - int wide; - FBits *link; +struct Asmbits { + char bits[16]; + int size; + Asmbits *link; }; -static FBits *stash; +static Asmbits *stash; int -gasstashfp(int64_t n, int w) +gasstash(void *bits, int size) { - FBits **pb, *b; + Asmbits **pb, *b; int i; - /* does a dumb de-dup of fp constants - * this should be the linker's job */ + assert(size == 4 || size == 8 || size == 16); for (pb=&stash, i=0; (b=*pb); pb=&b->link, i++) - if (n == b->bits.n && w == b->wide) + if (size <= b->size) + if (memcmp(bits, b->bits, size) == 0) return i; b = emalloc(sizeof *b); - b->bits.n = n; - b->wide = w; + memcpy(b->bits, bits, size); + b->size = size; b->link = 0; *pb = b; return i; @@ -90,31 +86,35 @@ gasstashfp(int64_t n, int w) void gasemitfin(FILE *f) { - FBits *b; - int i; + Asmbits *b; + char *p; + int sz, i; + double d; if (!stash) return; - fprintf(f, "/* floating point constants */\n"); - fprintf(f, ".data\n.align 8\n"); - for (b=stash, i=0; b; b=b->link, i++) - if (b->wide) - fprintf(f, - "%sfp%d:\n" - "\t.quad %"PRId64 - " /* %f */\n", - gasloc, i, b->bits.n, - b->bits.d - ); - for (b=stash, i=0; b; b=b->link, i++) - if (!b->wide) - fprintf(f, - "%sfp%d:\n" - "\t.long %"PRId64 - " /* %lf */\n", - gasloc, i, b->bits.n & 0xffffffff, - b->bits.f - ); + fprintf(f, "/* floating point constants */\n.data\n"); + for (sz=16; sz>=4; sz/=2) + for (b=stash, i=0; b; b=b->link, i++) { + if (b->size == sz) { + fprintf(f, + ".align %d\n" + "%sfp%d:", + sz, gasloc, i + ); + for (p=b->bits; p<&b->bits[sz]; p+=4) + fprintf(f, "\n\t.int %"PRId32, + *(int32_t *)p); + if (sz <= 8) { + if (sz == 4) + d = *(float *)b->bits; + else + d = *(double *)b->bits; + fprintf(f, " /* %f */\n", d); + } else + fprintf(f, "\n"); + } + } while ((b=stash)) { stash = b->link; free(b); From 2b64b75c845d0491c7a701e44485d2856eeb686d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 27 Jul 2017 19:48:54 -0400 Subject: [PATCH 112/286] fix dynamic stack allocs for amd64 The arm64 might have the same problem but it is currently unable to handle them even in instruction selection. Thanks to Jean Dao for reporting the bug. --- all.h | 1 + amd64/emit.c | 16 ++++++++++++---- amd64/isel.c | 1 + test/dynalloc.ssa | 27 +++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 test/dynalloc.ssa diff --git a/all.h b/all.h index 629fea3..24a1755 100644 --- a/all.h +++ b/all.h @@ -342,6 +342,7 @@ struct Fn { int slot; char export; char vararg; + char dynalloc; char name[NString]; }; diff --git a/amd64/emit.c b/amd64/emit.c index 51833b4..b8fa655 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -488,10 +488,10 @@ emitins(Ins i, Fn *fn, FILE *f) } } -static int +static uint64_t framesz(Fn *fn) { - int i, o, f; + uint64_t i, o, f; /* specific to NAlign == 3 */ for (i=0, o=0; iexport) @@ -525,7 +526,7 @@ amd64_emitfn(Fn *fn, FILE *f) ); fs = framesz(fn); if (fs) - fprintf(f, "\tsub $%d, %%rsp\n", fs); + fprintf(f, "\tsub $%"PRIu64", %%rsp\n", fs); if (fn->vararg) { o = -176; for (r=amd64_sysv_rsave; r<&amd64_sysv_rsave[6]; r++, o+=8) @@ -537,6 +538,7 @@ amd64_emitfn(Fn *fn, FILE *f) if (fn->reg & BIT(*r)) { itmp.arg[0] = TMP(*r); emitf("pushq %L0", &itmp, fn, f); + fs += 8; } for (lbl=0, b=fn->start; b; b=b->link) { @@ -547,6 +549,12 @@ amd64_emitfn(Fn *fn, FILE *f) lbl = 1; switch (b->jmp.type) { case Jret0: + if (fn->dynalloc) + fprintf(f, + "\tmovq %%rbp, %%rsp\n" + "\tsubq $%"PRIu64", %%rsp\n", + fs + ); for (r=&amd64_sysv_rclob[NCLR]; r>amd64_sysv_rclob;) if (fn->reg & BIT(*--r)) { itmp.arg[0] = TMP(*r); diff --git a/amd64/isel.c b/amd64/isel.c index 4202610..46ed259 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -291,6 +291,7 @@ sel(Ins i, ANum *an, Fn *fn) * the stack remains aligned * (rsp = 0) mod 16 */ + fn->dynalloc = 1; if (rtype(i.arg[0]) == RCon) { sz = fn->con[i.arg[0].val].bits.i; if (sz < 0 || sz >= INT_MAX-15) diff --git a/test/dynalloc.ssa b/test/dynalloc.ssa new file mode 100644 index 0000000..7c54e88 --- /dev/null +++ b/test/dynalloc.ssa @@ -0,0 +1,27 @@ +# make sure dynamic allocations +# and caller-save regs interact +# soundly + +function $g() { +@start + ret +} + +function w $f(w %arg) { +@start + call $g() +@alloc + %r =l alloc8 16 + storel 180388626474, %r + %r8 =l add 8, %r + storel 180388626474, %r8 + ret %arg +} + +export +function w $main() { +@start + %a =w call $f(w 0) + %b =w call $f(w 0) + ret %a +} From ae80e4f7caa6be31f83ae6a94a26ab3b60a5b064 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 17 Aug 2017 04:47:10 -0400 Subject: [PATCH 113/286] fix bug in jumps simplification In presence of jump loops, the algorithm would create cycles in the disjoint-set data structure. This caused infinite recursion and stack overflows. --- cfg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cfg.c b/cfg.c index ea1ae12..b1c80c7 100644 --- a/cfg.c +++ b/cfg.c @@ -304,8 +304,11 @@ simpljmp(Fn *fn) for (b=fn->start; b; b=b->link) { assert(!b->phi); if (b->nins == 0) - if (b->jmp.type == Jjmp) - uf[b->id] = b->s1; + if (b->jmp.type == Jjmp) { + uffind(&b->s1, uf); + if (b->s1 != b) + uf[b->id] = b->s1; + } } for (b=fn->start; b; b=b->link) { if (b->s1) From fedb1fa32cf71536bbc986182e78cd4437b1a63c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 22 Sep 2017 19:55:37 +0200 Subject: [PATCH 114/286] mark printf call as variadic in test --- test/abi6.ssa | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/abi6.ssa b/test/abi6.ssa index b90bd34..0870031 100644 --- a/test/abi6.ssa +++ b/test/abi6.ssa @@ -13,8 +13,8 @@ function $f(:hfa3 %h1, :hfa3 %h2, d %d1, :hfa3 %h3, d %d2) { call $phfa3(:hfa3 %h1) call $phfa3(:hfa3 %h2) call $phfa3(:hfa3 %h3) - call $printf(l $dfmt, d %d1) - call $printf(l $dfmt, d %d2) + call $printf(l $dfmt, d %d1, ...) + call $printf(l $dfmt, d %d2, ...) ret } From e54f7a0fda867f4cc7ae42bfaa6e38ad26034f7f Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 25 Sep 2017 14:41:25 +0200 Subject: [PATCH 115/286] adjust test.sh for ubuntu --- tools/test.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/test.sh b/tools/test.sh index 384d585..6e55447 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -10,6 +10,11 @@ asm=$tmp.s exe=$tmp.exe out=$tmp.out +testcc() { + echo "int main() { }" | $1 -x C -o /dev/null - >/dev/null 2>&1 + return $? +} + init() { case "$TARGET" in arm64) @@ -31,7 +36,7 @@ init() { echo "Cannot find arm64 compiler or qemu." exit 1 fi - bin="$bin -t arm64" + bin="$bin -t arm64" ;; "") case `uname` in @@ -46,6 +51,7 @@ init() { ;; *) cc="cc -no-pie" + testcc $cc || cc="cc" ;; esac ;; From 39b1f468b09d94cac6ec65a8c0fbc210e3c9989e Mon Sep 17 00:00:00 2001 From: Eugene Sharygin Date: Fri, 6 Oct 2017 19:34:50 +0300 Subject: [PATCH 116/286] fix compiler command in testcc This commit adds missing quotation marks around the argument to the function, and changes the value of `-x' option to `c` (lowercase) as per GCC manual [1]. [1]: https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Overall-Options.html --- tools/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test.sh b/tools/test.sh index 6e55447..8abdb21 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -11,7 +11,7 @@ exe=$tmp.exe out=$tmp.out testcc() { - echo "int main() { }" | $1 -x C -o /dev/null - >/dev/null 2>&1 + echo "int main() { }" | $1 -x c -o /dev/null - >/dev/null 2>&1 return $? } @@ -51,7 +51,7 @@ init() { ;; *) cc="cc -no-pie" - testcc $cc || cc="cc" + testcc "$cc" || cc="cc" ;; esac ;; From e7a387585992a9378ba2f2319c2408c62a0b14e8 Mon Sep 17 00:00:00 2001 From: Emil Skoeldberg Date: Thu, 26 Apr 2018 18:11:55 +0100 Subject: [PATCH 117/286] Fix compiler warnings. Compiler warned about comparison between signed and unsigned values. --- amd64/isel.c | 4 ++-- amd64/sysv.c | 2 +- arm64/abi.c | 2 +- arm64/isel.c | 2 +- copy.c | 4 ++-- fold.c | 4 ++-- mem.c | 2 +- parse.c | 6 +++--- rega.c | 2 +- spill.c | 2 +- ssa.c | 12 ++++++------ 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index 46ed259..cb409c4 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -458,7 +458,7 @@ anumber(ANum *ai, Blk *b, Con *con) int a, a1, a2, n1, n2, t1, t2; Ins *i; - for (i=b->ins; i-b->ins < b->nins; i++) { + for (i=b->ins; i<&b->ins[b->nins]; i++) { if (rtype(i->to) == RTmp) ai[i->to.val].i = i; if (i->op != Oadd && i->op != Omul) @@ -574,7 +574,7 @@ amd64_isel(Fn *fn) b = fn->start; /* specific to NAlign == 3 */ /* or change n=4 and sz /= 4 below */ for (al=Oalloc, n=4; al<=Oalloc1; al++, n*=2) - for (i=b->ins; i-b->ins < b->nins; i++) + for (i=b->ins; i<&b->ins[b->nins]; i++) if (i->op == al) { if (rtype(i->arg[0]) != RCon) break; diff --git a/amd64/sysv.c b/amd64/sysv.c index 014452a..d70e70d 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -642,7 +642,7 @@ amd64_sysv_abi(Fn *fn) b->visit = 0; /* lower parameters */ - for (b=fn->start, i=b->ins; i-b->insnins; i++) + for (b=fn->start, i=b->ins; i<&b->ins[b->nins]; i++) if (!ispar(i->op)) break; fa = selpar(fn, b->ins, i); diff --git a/arm64/abi.c b/arm64/abi.c index b340af2..17ea1d1 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -645,7 +645,7 @@ arm64_abi(Fn *fn) b->visit = 0; /* lower parameters */ - for (b=fn->start, i=b->ins; i-b->insnins; i++) + for (b=fn->start, i=b->ins; i<&b->ins[b->nins]; i++) if (!ispar(i->op)) break; p = selpar(fn, b->ins, i); diff --git a/arm64/isel.c b/arm64/isel.c index 59f1579..031ba11 100644 --- a/arm64/isel.c +++ b/arm64/isel.c @@ -232,7 +232,7 @@ arm64_isel(Fn *fn) b = fn->start; /* specific to NAlign == 3 */ /* or change n=4 and sz /= 4 below */ for (al=Oalloc, n=4; al<=Oalloc1; al++, n*=2) - for (i=b->ins; i-b->ins < b->nins; i++) + for (i=b->ins; i<&b->ins[b->nins]; i++) if (i->op == al) { if (rtype(i->arg[0]) != RCon) break; diff --git a/copy.c b/copy.c index 55c31b2..4432986 100644 --- a/copy.c +++ b/copy.c @@ -121,7 +121,7 @@ copy(Fn *fn) for (b=fn->start; b; b=b->link) { for (p=b->phi; p; p=p->link) visitphi(p, cp, &pw); - for (i=b->ins; i-b->ins < b->nins; i++) + for (i=b->ins; i<&b->ins[b->nins]; i++) visitins(i, cp, &pw, fn); } while ((w1=w)) { @@ -155,7 +155,7 @@ copy(Fn *fn) subst(&p->arg[a], cp); pp=&p->link; } - for (i=b->ins; i-b->ins < b->nins; i++) { + for (i=b->ins; i<&b->ins[b->nins]; i++) { r = copyof(i->to, cp); if (!req(r, i->to)) { *i = (Ins){.op = Onop}; diff --git a/fold.c b/fold.c index c2375df..8fc64c5 100644 --- a/fold.c +++ b/fold.c @@ -221,7 +221,7 @@ fold(Fn *fn) for (p=b->phi; p; p=p->link) visitphi(p, n, fn); if (b->visit == 0) { - for (i=b->ins; i-b->ins < b->nins; i++) + for (i=b->ins; i<&b->ins[b->nins]; i++) visitins(i, fn); visitjmp(b, n, fn); } @@ -289,7 +289,7 @@ fold(Fn *fn) renref(&p->arg[a]); pp = &p->link; } - for (i=b->ins; i-b->ins < b->nins; i++) + for (i=b->ins; i<&b->ins[b->nins]; i++) if (renref(&i->to)) *i = (Ins){.op = Onop}; else diff --git a/mem.c b/mem.c index eda3d18..159b6bc 100644 --- a/mem.c +++ b/mem.c @@ -12,7 +12,7 @@ memopt(Fn *fn) /* promote uniform stack slots to temporaries */ b = fn->start; - for (i=b->ins; i-b->ins < b->nins; i++) { + for (i=b->ins; i<&b->ins[b->nins]; i++) { if (Oalloc > i->op || i->op > Oalloc1) continue; /* specific to NAlign == 3 */ diff --git a/parse.c b/parse.c index d9aa1b1..592e079 100644 --- a/parse.c +++ b/parse.c @@ -691,7 +691,7 @@ typecheck(Fn *fn) for (b=fn->start; b; b=b->link) { for (p=b->phi; p; p=p->link) fn->tmp[p->to.val].cls = p->cls; - for (i=b->ins; i-b->ins < b->nins; i++) + for (i=b->ins; i<&b->ins[b->nins]; i++) if (rtype(i->to) == RTmp) { t = &fn->tmp[i->to.val]; if (clsmerge(&t->cls, i->cls)) @@ -719,7 +719,7 @@ typecheck(Fn *fn) if (!bsequal(pb, ppb)) err("predecessors not matched in phi %%%s", t->name); } - for (i=b->ins; i-b->ins < b->nins; i++) + for (i=b->ins; i<&b->ins[b->nins]; i++) for (n=0; n<2; n++) { k = optab[i->op].argcls[n][i->cls]; r = i->arg[n]; @@ -1180,7 +1180,7 @@ printfn(Fn *fn, FILE *f) fprintf(f, ", "); } } - for (i=b->ins; i-b->ins < b->nins; i++) { + for (i=b->ins; i<&b->ins[b->nins]; i++) { fprintf(f, "\t"); if (!req(i->to, R)) { printref(i->to, fn, f); diff --git a/rega.c b/rega.c index 2f01c07..619b0e2 100644 --- a/rega.c +++ b/rega.c @@ -506,7 +506,7 @@ rega(Fn *fn) for (bp=blk, b=fn->start; b; b=b->link) *bp++ = b; qsort(blk, fn->nblk, sizeof blk[0], carve); - for (b=fn->start, i=b->ins; i-b->ins < b->nins; i++) + for (b=fn->start, i=b->ins; i<&b->ins[b->nins]; i++) if (i->op != Ocopy || !isreg(i->arg[0])) break; else { diff --git a/spill.c b/spill.c index d3a11f7..77496f6 100644 --- a/spill.c +++ b/spill.c @@ -77,7 +77,7 @@ fillcost(Fn *fn) } } n = b->loop; - for (i=b->ins; i-b->ins < b->nins; i++) { + for (i=b->ins; i<&b->ins[b->nins]; i++) { tmpuse(i->to, 0, n, fn); tmpuse(i->arg[0], 1, n, fn); tmpuse(i->arg[1], 1, n, fn); diff --git a/ssa.c b/ssa.c index 9aff73c..f7dabb8 100644 --- a/ssa.c +++ b/ssa.c @@ -71,7 +71,7 @@ filluse(Fn *fn) tmp[t].phi = tp; } } - for (i=b->ins; i-b->ins < b->nins; i++) { + for (i=b->ins; i<&b->ins[b->nins]; i++) { if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); w = WFull; @@ -131,7 +131,7 @@ phiins(Fn *fn) for (b=fn->start; b; b=b->link) { b->visit = 0; r = R; - for (i=b->ins; i-b->ins < b->nins; i++) { + for (i=b->ins; i<&b->ins[b->nins]; i++) { if (!req(r, R)) { if (req(i->arg[0], TMP(t))) i->arg[0] = r; @@ -263,7 +263,7 @@ renblk(Blk *b, Name **stk, Fn *fn) for (p=b->phi; p; p=p->link) rendef(&p->to, b, stk, fn); - for (i=b->ins; i-b->ins < b->nins; i++) { + for (i=b->ins; i<&b->ins[b->nins]; i++) { for (m=0; m<2; m++) { t = i->arg[m].val; if (rtype(i->arg[m]) == RTmp) @@ -374,7 +374,7 @@ ssacheck(Fn *fn) for (p=b->phi; p; p=p->link) { r = p->to; t = &fn->tmp[r.val]; - for (u=t->use; u-t->use < t->nuse; u++) { + for (u=t->use; u<&t->use[t->nuse]; u++) { bu = fn->rpo[u->bid]; if (u->type == UPhi) { if (phicheck(u->u.phi, b, r)) @@ -384,12 +384,12 @@ ssacheck(Fn *fn) goto Err; } } - for (i=b->ins; i-b->ins < b->nins; i++) { + for (i=b->ins; i<&b->ins[b->nins]; i++) { if (rtype(i->to) != RTmp) continue; r = i->to; t = &fn->tmp[r.val]; - for (u=t->use; u-t->use < t->nuse; u++) { + for (u=t->use; u<&t->use[t->nuse]; u++) { bu = fn->rpo[u->bid]; if (u->type == UPhi) { if (phicheck(u->u.phi, b, r)) From f1c865f4bc7dff5a5d844049a73ad82463186e9f Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 26 Apr 2018 22:59:30 +0200 Subject: [PATCH 118/286] more compiler warnings... --- amd64/isel.c | 1 + arm64/abi.c | 1 + load.c | 1 + mem.c | 1 + parse.c | 9 ++++----- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index cb409c4..2519ae5 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -538,6 +538,7 @@ amatch(Addr *a, Ref r, ANum *ai, Fn *fn, int top) break; } r = al; + /* fall through */ case 0: s = fn->tmp[r.val].slot; if (s != -1) diff --git a/arm64/abi.c b/arm64/abi.c index 17ea1d1..1c97ef3 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -72,6 +72,7 @@ isfloatv(Typ *t, char *cls) case FTyp: if (isfloatv(&typ[f->len], cls)) break; + /* fall through */ default: return 0; } diff --git a/load.c b/load.c index 31d00bc..504b2d8 100644 --- a/load.c +++ b/load.c @@ -434,6 +434,7 @@ loadopt(Fn *fn) i->op = ext; break; } + /* fall through */ case Oload: i->op = Ocopy; break; diff --git a/mem.c b/mem.c index 159b6bc..f20f378 100644 --- a/mem.c +++ b/mem.c @@ -65,6 +65,7 @@ memopt(Fn *fn) case Oloaduw: if (k == Kl) goto Extend; + /* fall through */ case Oload: if (KBASE(k) != KBASE(l->cls)) l->op = Ocast; diff --git a/parse.c b/parse.c index 592e079..3c4200e 100644 --- a/parse.c +++ b/parse.c @@ -173,11 +173,9 @@ getint() n = 0; c = fgetc(inf); - m = 0; - switch (c) { - case '-': m = 1; - case '+': c = fgetc(inf); - } + m = (c == '-'); + if (m || c == '+') + c = fgetc(inf); do { n = 10*n + (c - '0'); c = fgetc(inf); @@ -240,6 +238,7 @@ lex() case '#': while ((c=fgetc(inf)) != '\n' && c != EOF) ; + /* fall through */ case '\n': lnum++; return Tnl; From 316b57e37eb10cc127526886f58f6cad24916bf1 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 5 Feb 2019 11:48:20 +0100 Subject: [PATCH 119/286] new spiller heuristic for loops If a variable is spilled in a loop, the spiller now tries to keep it spilled over the whole loop. Thanks to Michael Forney for sharing a test case exhibiting a pathological reload. --- spill.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spill.c b/spill.c index 77496f6..2f7ebb2 100644 --- a/spill.c +++ b/spill.c @@ -360,12 +360,17 @@ spill(Fn *fn) bsunion(v, u); } } else if (s1) { - liveon(v, b, s1); + /* avoid reloading temporaries + * in the middle of loops */ + bszero(v); + liveon(w, b, s1); + if (s1->loop >= b->loop) + bsunion(v, w); if (s2) { liveon(u, b, s2); - bscopy(w, u); - bsinter(w, v); - bsunion(v, u); + if (s2->loop >= b->loop) + bsunion(v, u); + bsinter(w, u); } limit2(v, 0, 0, w); } else { From 834b5cb08bbf0f4fbc1992a72327dfc2c0a31796 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 5 Feb 2019 14:53:58 +0100 Subject: [PATCH 120/286] fix a bad bug in regalloc boilerplate That was silly... I believe qbe still managed to work because bitsets are only used inside a basic block where rcopy() is not used. --- rega.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rega.c b/rega.c index 619b0e2..f087f3c 100644 --- a/rega.c +++ b/rega.c @@ -50,8 +50,11 @@ sethint(int t, int r) static void rcopy(RMap *ma, RMap *mb) { - memcpy(ma, mb, sizeof *ma); + memcpy(ma->t, mb->t, sizeof ma->t); + memcpy(ma->r, mb->r, sizeof ma->r); + memcpy(ma->w, mb->w, sizeof ma->w); bscopy(ma->b, mb->b); + ma->n = mb->n; } static int From ce0ab53ed73fb24f9537cab762467efad56f2664 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 6 Feb 2019 08:34:51 +0100 Subject: [PATCH 121/286] 2 bug fixes in rega The worst one was that "part 3" of rega() could break the critical invariant that two interferring temporaries get assigned different registers. This is fixed by being careful when changing the register of a temporary based on predecessor blocks. Thanks to Michael Forney for reporting these bugs and helping with the analysis. --- rega.c | 8 +++++--- test/rega1.ssa | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 test/rega1.ssa diff --git a/rega.c b/rega.c index f087f3c..9ceba70 100644 --- a/rega.c +++ b/rega.c @@ -571,7 +571,8 @@ rega(Fn *fn) if (rtype(src) != RTmp) continue; x = rfind(&end[b->id], src.val); - assert(x != -1); + if (x == -1) /* spilled */ + continue; rl[r] = (!rl[r] || rl[r] == x) ? x : -1; } if (rl[r] == 0) @@ -586,7 +587,8 @@ rega(Fn *fn) continue; for (bp=s->pred; bp<&s->pred[s->npred]; bp++) { x = rfind(&end[(*bp)->id], t); - assert(x != -1); + if (x == -1) /* spilled */ + continue; rl[r] = (!rl[r] || rl[r] == x) ? x : -1; } } @@ -597,7 +599,7 @@ rega(Fn *fn) r = m->r[j]; x = rl[r]; assert(x != 0 || t < Tmp0 /* todo, ditto */); - if (x > 0) { + if (x > 0 && !bshas(m->b, x)) { pmadd(TMP(x), TMP(r), tmp[t].cls); m->r[j] = x; } diff --git a/test/rega1.ssa b/test/rega1.ssa new file mode 100644 index 0000000..9e87c89 --- /dev/null +++ b/test/rega1.ssa @@ -0,0 +1,24 @@ +# tests that %b and %a0 do not end up in +# the same register at the start of @loop + +export function l $f(l %a) { +@start +@loop + %b =l phi @start 42, @loop0 %a1, @loop1 %a1 + %a0 =l phi @start %a, @loop0 %a1, @loop1 %a1 + %a1 =l sub %a0, 1 + jnz %b, @loop0, @loop1 +@loop0 + jnz %a1, @loop, @end +@loop1 + jnz %a1, @loop, @end +@end + ret %b +} + +# >>> driver +# extern long long f(long long); +# int main() { +# return !(f(1) == 42 && f(2) == 1 && f(42) == 1); +# } +# <<< From d9b0d77cf20cb8340bc4a77b66aa8cb56c75b496 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 6 Feb 2019 09:09:03 +0100 Subject: [PATCH 122/286] soften heuristic of 316b57 Instead of systematically spilling any temp live in an exit branch but not in the part of the loop already processed, only spill when it is already known to have been spilled. --- spill.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/spill.c b/spill.c index 2f7ebb2..04afaca 100644 --- a/spill.c +++ b/spill.c @@ -280,6 +280,19 @@ dopm(Blk *b, Ins *i, BSet *v) return i; } +static void +merge(BSet *u, Blk *bu, BSet *v, Blk *bv) +{ + int t; + + if (bu->loop <= bv->loop) + bsunion(u, v); + else + for (t=0; bsiter(v, &t); t++) + if (tmp[t].slot == -1) + bsset(u, t); +} + /* spill code insertion * requires spill costs, rpo, liveness * @@ -364,12 +377,10 @@ spill(Fn *fn) * in the middle of loops */ bszero(v); liveon(w, b, s1); - if (s1->loop >= b->loop) - bsunion(v, w); + merge(v, b, w, s1); if (s2) { liveon(u, b, s2); - if (s2->loop >= b->loop) - bsunion(v, u); + merge(v, b, u, s2); bsinter(w, u); } limit2(v, 0, 0, w); From cde5f95591b6f38df235ac16ee7ee979ec19bd09 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 18 Feb 2019 13:47:33 +0100 Subject: [PATCH 123/286] mark phi arguments as escaping Thanks to Michael Forney for spotting this oversight and providing the test case. Note: because esc() leaves ABot unchanged, the assertion "a->type == ABot" on line 122 remains valid. --- alias.c | 4 +++- test/load1.ssa | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 test/load1.ssa diff --git a/alias.c b/alias.c index 66c12e5..aa3846e 100644 --- a/alias.c +++ b/alias.c @@ -106,7 +106,7 @@ esc(Ref r, Fn *fn) void fillalias(Fn *fn) { - uint n; + uint n, m; Blk *b; Phi *p; Ins *i; @@ -115,6 +115,8 @@ fillalias(Fn *fn) for (n=0; nnblk; ++n) { b = fn->rpo[n]; for (p=b->phi; p; p=p->link) { + for (m=0; mnarg; m++) + esc(p->arg[m], fn); assert(rtype(p->to) == RTmp); a = &fn->tmp[p->to.val].alias; assert(a->type == ABot); diff --git a/test/load1.ssa b/test/load1.ssa new file mode 100644 index 0000000..a87fd2d --- /dev/null +++ b/test/load1.ssa @@ -0,0 +1,27 @@ +# checks that phi arguments are correctly +# handled in alias analysis + +export +function w $f(w %cond) { +@start + %x =l alloc4 4 + %y =l alloc4 4 + storew 0, %x + jnz %cond, @true, @false +@true + jmp @end +@false + jmp @end +@end + %ptr =l phi @true %x, @false %y + storew 1, %ptr + %result =w loadsw %x + ret %result +} + +# >>> driver +# extern int f(int); +# int main() { +# return !(f(0) == 0 && f(1) == 1); +# } +# <<< From ccd415428b2e29952b316c5f7191a1e4c0334e49 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 31 Jan 2019 18:03:25 -0800 Subject: [PATCH 124/286] Fix typo --- spill.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spill.c b/spill.c index 04afaca..42f0c05 100644 --- a/spill.c +++ b/spill.c @@ -338,7 +338,7 @@ spill(Fn *fn) for (bp=&fn->rpo[fn->nblk]; bp!=fn->rpo;) { b = *--bp; - /* invariant: all bocks with bigger rpo got + /* invariant: all blocks with bigger rpo got * their in,out updated. */ /* 1. find temporaries in registers at From fcd55bb4412e314a0643d66e37f2076950b895d0 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 13 Feb 2019 16:42:14 -0800 Subject: [PATCH 125/286] doc: Include `align` in data BNF --- doc/il.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/il.txt b/doc/il.txt index d816732..edc5557 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -253,7 +253,7 @@ their size between curly braces. `bnf DATADEF := - ['export'] 'data' $IDENT '=' + ['export'] 'data' $IDENT '=' ['align' NUMBER] '{' ( EXTTY DATAITEM+ | 'z' NUMBER ), From dad4550dfb735e8043d65d18edae52f4f7b2e21c Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 13 Feb 2019 16:42:51 -0800 Subject: [PATCH 126/286] amd64: Fix typo in truncd instruction --- amd64/emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amd64/emit.c b/amd64/emit.c index b8fa655..653c548 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -96,7 +96,7 @@ static struct { { Oextub, Ki, "movzb%k %B0, %=" }, { Oexts, Kd, "cvtss2sd %0, %=" }, - { Otruncd, Ks, "cvttsd2ss %0, %=" }, + { Otruncd, Ks, "cvtsd2ss %0, %=" }, { Ostosi, Ki, "cvttss2si%k %0, %=" }, { Odtosi, Ki, "cvttsd2si%k %0, %=" }, { Oswtof, Ka, "cvtsi2%k %W0, %=" }, From 44fbc6023793b2f7dd7af42a94a8e5c5a515537d Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 17 Feb 2019 15:26:03 -0800 Subject: [PATCH 127/286] Fix assertion failure if temporary was spilled in all predecessors Since ce0ab53ed7, we skip over predecessors that spilled the temporary. However, if all predecessors spilled, then we might not have an entry in `rl`, triggering an assertion failure in the following loop. --- rega.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rega.c b/rega.c index 9ceba70..6f1da50 100644 --- a/rega.c +++ b/rega.c @@ -591,6 +591,8 @@ rega(Fn *fn) continue; rl[r] = (!rl[r] || rl[r] == x) ? x : -1; } + if (rl[r] == 0) + rl[r] = -1; } npm = 0; From cf9f2e8ef7e775bcedf74b70a3dd35962484f1f1 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 20 Feb 2019 12:57:04 -0800 Subject: [PATCH 128/286] doc: Aggregate types can be nested --- doc/il.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index edc5557..a496759 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -215,16 +215,17 @@ using the `export` keyword. # Regular type 'type' :IDENT '=' ['align' NUMBER] '{' - ( EXTTY [NUMBER] ), + ( SUBTY [NUMBER] ), '}' | # Opaque type 'type' :IDENT '=' 'align' NUMBER '{' NUMBER '}' + SUBTY := EXTTY | :IDENT + Aggregate type definitions start with the `type` keyword. They have file scope, but types must be defined before being referenced. The inner structure of a type is expressed by a -comma-separated list of <@ Simple Types> enclosed in curly -braces. +comma-separated list of types enclosed in curly braces. type :fourfloats = { s, s, d, d } From a877ba986b4c5b24ee07d59b3001d45fd5b3f834 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 21 Feb 2019 14:42:01 +0100 Subject: [PATCH 129/286] fix amd64 addressing mode matcher The numberer made some arranging choices when numbering arguments of an instruction, but these decisions were ignored when matching. The fix is to reconcile numbering and matching. --- amd64/isel.c | 35 +++++++++++++++-------------------- test/isel1.ssa | 24 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 test/isel1.ssa diff --git a/amd64/isel.c b/amd64/isel.c index 2519ae5..6aea850 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -25,7 +25,7 @@ struct ANum { Ins *i; }; -static void amatch(Addr *, Ref, ANum *, Fn *, int); +static int amatch(Addr *, Ref, int, ANum *, Fn *); static int noimm(Ref r, Fn *fn) @@ -131,8 +131,8 @@ seladdr(Ref *r, ANum *an, Fn *fn) r0 = *r; if (rtype(r0) == RTmp) { - amatch(&a, r0, an, fn, 1); - if (req(a.base, r0)) + memset(&a, 0, sizeof a); + if (!amatch(&a, r0, an[r0.val].n, an, fn)) return; if (a.offset.type == CAddr) if (!req(a.base, R)) { @@ -488,18 +488,16 @@ anumber(ANum *ai, Blk *b, Con *con) } } -static void -amatch(Addr *a, Ref r, ANum *ai, Fn *fn, int top) +static int +amatch(Addr *a, Ref r, int n, ANum *ai, Fn *fn) { Ins *i; int nl, nr, t, s; Ref al, ar; - if (top) - memset(a, 0, sizeof *a); if (rtype(r) == RCon) { addcon(&a->offset, &fn->con[r.val]); - return; + return 1; } assert(rtype(r) == RTmp); i = ai[r.val].i; @@ -515,14 +513,11 @@ amatch(Addr *a, Ref r, ANum *ai, Fn *fn, int top) ar = i->arg[1]; } } - switch (ai[r.val].n) { + switch (n) { case 3: /* s * i */ - if (!top) { - a->index = al; - a->scale = fn->con[ar.val].bits.i; - } else - a->base = r; - break; + a->index = al; + a->scale = fn->con[ar.val].bits.i; + return 0; case 4: /* b + s * i */ switch (nr) { case 0: @@ -534,7 +529,7 @@ amatch(Addr *a, Ref r, ANum *ai, Fn *fn, int top) a->scale = 1; break; case 3: - amatch(a, ar, ai, fn, 0); + amatch(a, ar, nr, ai, fn); break; } r = al; @@ -544,14 +539,14 @@ amatch(Addr *a, Ref r, ANum *ai, Fn *fn, int top) if (s != -1) r = SLOT(s); a->base = r; - break; + return n || s != -1; case 2: /* constants */ case 5: /* o + s * i */ case 6: /* o + b */ case 7: /* o + b + s * i */ - amatch(a, ar, ai, fn, 0); - amatch(a, al, ai, fn, 0); - break; + amatch(a, ar, nr, ai, fn); + amatch(a, al, nl, ai, fn); + return 1; default: die("unreachable"); } diff --git a/test/isel1.ssa b/test/isel1.ssa new file mode 100644 index 0000000..879a871 --- /dev/null +++ b/test/isel1.ssa @@ -0,0 +1,24 @@ +# tests that the address matcher is not +# confused by the two multiplications + +# note: the code handling apple asm fixes +# ruins the good work of the matcher here, +# I should revisit these fixes + +export function w $f(l %i, l %j) { +@start + %off1 =l mul %i, 8 + %a_i =l add $a, %off1 + %off2 =l mul %j, 4 + %a_ij =l add %a_i, %off2 + %x =w loadsw %a_ij + ret %x +} + +# >>> driver +# int a[] = {1, 2, 3, 4}; +# extern int f(long long, long long); +# int main() { +# return !(f(0, 0) == 1 && f(0, 1) == 2 && f(1, 0) == 3 && f(1, 1) == 4); +# } +# <<< From dadf6d69d8ef24ada3461ddc81cf56418cfdc91e Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 25 Feb 2019 18:03:47 +0100 Subject: [PATCH 130/286] prefer bigger amd64 addressing Before, amatch() would prefer matching "o + b" to "o + s*i" and "b + s*i". --- amd64/isel.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index 6aea850..cedfdb1 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -443,17 +443,16 @@ anumber(ANum *ai, Blk *b, Con *con) */ static char add[10][10] = { [2] [2] = 2, /* folding */ - [2] [5] = 5, [5] [2] = 5, + [2] [4] = 4, [4] [2] = 4, [2] [6] = 6, [6] [2] = 6, [2] [7] = 7, [7] [2] = 7, - [0] [0] = 4, /* 4: b + s * i */ - [0] [3] = 4, [3] [0] = 4, - [2] [3] = 5, [3] [2] = 5, /* 5: o + s * i */ - [0] [2] = 6, [2] [0] = 6, /* 6: o + b */ - [2] [4] = 7, [4] [2] = 7, /* 7: o + b + s * i */ - [0] [5] = 7, [5] [0] = 7, - [6] [3] = 7, [3] [6] = 7, - + [0] [2] = 4, [2] [0] = 4, /* 4: o + b */ + [0] [0] = 5, /* 5: b + s * i */ + [0] [3] = 5, [3] [0] = 5, + [2] [3] = 6, [3] [2] = 6, /* 6: o + s * i */ + [2] [5] = 7, [5] [2] = 7, /* 7: o + b + s * i */ + [0] [6] = 7, [6] [0] = 7, + [4] [3] = 7, [3] [4] = 7, }; int a, a1, a2, n1, n2, t1, t2; Ins *i; @@ -518,7 +517,7 @@ amatch(Addr *a, Ref r, int n, ANum *ai, Fn *fn) a->index = al; a->scale = fn->con[ar.val].bits.i; return 0; - case 4: /* b + s * i */ + case 5: /* b + s * i */ switch (nr) { case 0: if (fn->tmp[ar.val].slot != -1) { @@ -541,8 +540,8 @@ amatch(Addr *a, Ref r, int n, ANum *ai, Fn *fn) a->base = r; return n || s != -1; case 2: /* constants */ - case 5: /* o + s * i */ - case 6: /* o + b */ + case 4: /* o + b */ + case 6: /* o + s * i */ case 7: /* o + b + s * i */ amatch(a, ar, nr, ai, fn); amatch(a, al, nl, ai, fn); From b2ea8c11b61014cb90e2a025d605ac77a1c7d6bc Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 21 Feb 2019 22:35:12 +0100 Subject: [PATCH 131/286] new copy elimination pass The sparse data-flow analysis used for copy elimination before this patch could sometimes diverge. The core reason for this behavior is that the visitphi() function was not monotonic in the following copy-of lattice: top (represented as the temp / | \ itself) x y z ... \ | / bot (represented as R) This monotonicity defect could be fixed by reverting 2f41ff03, but then the pass would end up missing some redundant phis. This patch re-implements the pass from scratch using a different approach. The new algorithm should get rid of all redundant copies. On the other hand, it can run slower than the monotonic sparse data-flow analysis because, in the worst case, an instruction in a phi cluster can be visited as many times as there are phis in the input program. Thanks to Michael Forney for reviewing and testing the new pass. --- copy.c | 220 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 112 insertions(+), 108 deletions(-) diff --git a/copy.c b/copy.c index 4432986..b92c5f4 100644 --- a/copy.c +++ b/copy.c @@ -1,58 +1,7 @@ #include "all.h" -typedef struct RList RList; -struct RList { - int t; - RList *l; -}; - -static Ref -copyof(Ref r, Ref *cp) -{ - if (rtype(r) == RTmp) - return cp[r.val]; - else - return r; -} - -static void -update(Ref r, Ref rcp, Ref *cp, RList ***pw) -{ - RList *l; - - if (!req(cp[r.val], rcp)) { - cp[r.val] = rcp; - l = emalloc(sizeof *l); - l->t = r.val; - l->l = 0; - **pw = l; - *pw = &l->l; - } -} - -static void -visitphi(Phi *p, Ref *cp, RList ***pw) -{ - uint a; - Ref r, r1; - - r = R; - for (a=0; anarg; a++) { - r1 = copyof(p->arg[a], cp); - if (req(r1, R) || req(r1, p->to)) - continue; - if (req(r, R) || req(r, r1)) - r = r1; - else { - r = p->to; - break; - } - } - update(p->to, r, cp, pw); -} - static int -iscopy(Ins *i, Ref r, Fn *fn) +iscopy(Ins *i, Ref r, Tmp *tmp) { static bits extcpy[] = { [WFull] = 0, @@ -74,7 +23,7 @@ iscopy(Ins *i, Ref r, Fn *fn) if (i->cls == Kw) return 1; - t = &fn->tmp[r.val]; + t = &tmp[r.val]; assert(KBASE(t->cls) == 0); if (i->cls == Kl && t->cls == Kw) return 0; @@ -82,105 +31,160 @@ iscopy(Ins *i, Ref r, Fn *fn) return (BIT(Wsb + (i->op-Oextsb)) & b) != 0; } +static Ref +copyof(Ref r, Ref *cpy) +{ + if (rtype(r) == RTmp && !req(cpy[r.val], R)) + return cpy[r.val]; + return r; +} + +/* detects a cluster of phis/copies redundant with 'r'; + * the algorithm is inspired by Section 3.2 of "Simple + * and Efficient SSA Construction" by Braun M. et al. + */ static void -visitins(Ins *i, Ref *cp, RList ***pw, Fn *fn) +phisimpl(Phi *p, Ref r, Ref *cpy, Use ***pstk, BSet *ts, BSet *as, Tmp *tmp) { - Ref r; + Use **stk, *u, *u1; + uint nstk, a; + int t; + Ref r1; - r = copyof(i->arg[0], cp); - if (iscopy(i, r, fn)) { - update(i->to, r, cp, pw); - } else if (!req(i->to, R)) { - assert(rtype(i->to) == RTmp); - update(i->to, i->to, cp, pw); + bszero(ts); + bszero(as); + stk = *pstk; + nstk = 1; + stk[0] = &(Use){.type = UPhi, .u.phi = p}; + while (nstk) { + u = stk[--nstk]; + if (u->type == UIns && iscopy(u->u.ins, r, tmp)) { + p = &(Phi){.narg = 0}; + t = u->u.ins->to.val; + } + else if (u->type == UPhi) { + p = u->u.phi; + t = p->to.val; + } + else + continue; + if (bshas(ts, t)) + continue; + bsset(ts, t); + for (a=0; anarg; a++) { + r1 = copyof(p->arg[a], cpy); + if (req(r1, r)) + continue; + if (rtype(r1) != RTmp) + return; + bsset(as, r1.val); + } + u = tmp[t].use; + u1 = &u[tmp[t].nuse]; + vgrow(pstk, nstk+(u1-u)); + stk = *pstk; + for (; uval], R)); + *pr = copyof(*pr, cpy); } +/* requires use and rpo, breaks use */ void copy(Fn *fn) { - Blk *b; - Ref *cp, r; - RList *w, *w1, **pw; - Use *u, *u1; - Ins *i; + BSet ts[1], as[1]; + Use **stk; Phi *p, **pp; - uint a; + Ins *i; + Blk *b; + uint n, a; + Ref *cpy, r; int t; - w = 0; - pw = &w; - cp = emalloc(fn->ntmp * sizeof cp[0]); - for (b=fn->start; b; b=b->link) { - for (p=b->phi; p; p=p->link) - visitphi(p, cp, &pw); - for (i=b->ins; i<&b->ins[b->nins]; i++) - visitins(i, cp, &pw, fn); - } - while ((w1=w)) { - t = w->t; - u = fn->tmp[t].use; - u1 = u + fn->tmp[t].nuse; - for (; utype) { - case UPhi: - visitphi(u->u.phi, cp, &pw); - break; - case UIns: - visitins(u->u.ins, cp, &pw, fn); - break; - case UJmp: - break; - default: - die("invalid use %d", u->type); - } - w = w->l; - free(w1); + bsinit(ts, fn->ntmp); + bsinit(as, fn->ntmp); + cpy = emalloc(fn->ntmp * sizeof cpy[0]); + stk = vnew(10, sizeof stk[0], Pheap); + + /* 1. build the copy-of map */ + for (n=0; nnblk; n++) { + b = fn->rpo[n]; + for (p=b->phi; p; p=p->link) { + assert(rtype(p->to) == RTmp); + if (!req(cpy[p->to.val], R)) + continue; + r = R; + for (a=0; anarg; a++) + if (p->blk[a]->id < n) + r = copyof(p->arg[a], cpy); + assert(!req(r, R)); + cpy[p->to.val] = p->to; + phisimpl(p, r, cpy, &stk, ts, as, fn->tmp); + } + for (i=b->ins; i<&b->ins[b->nins]; i++) { + assert(rtype(i->to) <= RTmp); + if (!req(cpy[i->to.val], R)) + continue; + r = copyof(i->arg[0], cpy); + if (iscopy(i, r, fn->tmp)) + cpy[i->to.val] = r; + else + cpy[i->to.val] = i->to; + } } + + /* 2. remove redundant phis/copies + * and rewrite their uses */ for (b=fn->start; b; b=b->link) { for (pp=&b->phi; (p=*pp);) { - r = cp[p->to.val]; + r = cpy[p->to.val]; if (!req(r, p->to)) { *pp = p->link; continue; } for (a=0; anarg; a++) - subst(&p->arg[a], cp); + subst(&p->arg[a], cpy); pp=&p->link; } for (i=b->ins; i<&b->ins[b->nins]; i++) { - r = copyof(i->to, cp); + r = cpy[i->to.val]; if (!req(r, i->to)) { *i = (Ins){.op = Onop}; continue; } - for (a=0; a<2; a++) - subst(&i->arg[a], cp); + subst(&i->arg[0], cpy); + subst(&i->arg[1], cpy); } - subst(&b->jmp.arg, cp); + subst(&b->jmp.arg, cpy); } + if (debug['C']) { fprintf(stderr, "\n> Copy information:"); for (t=Tmp0; tntmp; t++) { - if (req(cp[t], R)) { + if (req(cpy[t], R)) { fprintf(stderr, "\n%10s not seen!", fn->tmp[t].name); } - else if (!req(cp[t], TMP(t))) { + else if (!req(cpy[t], TMP(t))) { fprintf(stderr, "\n%10s copy of ", fn->tmp[t].name); - printref(cp[t], fn, stderr); + printref(cpy[t], fn, stderr); } } fprintf(stderr, "\n\n> After copy elimination:\n"); printfn(fn, stderr); } - free(cp); + vfree(stk); + free(cpy); } From c043227bf792fd341cd19f40cd96b7577dacbd5a Mon Sep 17 00:00:00 2001 From: Andrew Chambers Date: Wed, 27 Feb 2019 22:10:17 +1300 Subject: [PATCH 132/286] Let runtime crash on zero div, don't fold it. Remarks from Quentin: It is an important decision to use Bot and not Top as the result of 'x / 0'. By using Bot, we refuse to give a warrant to the compiler that would allow meaningless subsequent decisions. An example follows. Clang, on my computer, will build a program which prints "Ho" when fed the following C: int main() { puts(1/0 ? "Hi" : "Ho"); } On the other hand, a C compiler based on QBE will build a program which crashes, as one would expect. See also https://c9x.me/notes/2014-09-10.html --- fold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fold.c b/fold.c index 8fc64c5..019b739 100644 --- a/fold.c +++ b/fold.c @@ -500,7 +500,7 @@ opfold(int op, int cls, Con *cl, Con *cr, Fn *fn) if ((op == Odiv || op == Oudiv || op == Orem || op == Ourem) && czero(cr, KWIDE(cls))) - err("null divisor in '%s'", optab[op].name); + return Bot; if (cls == Kw || cls == Kl) { if (foldint(&c, op, cls == Kl, cl, cr)) return Bot; From 60804c92a81cc4cba494b3b48d11151559269d9b Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 28 Feb 2019 13:49:55 +0100 Subject: [PATCH 133/286] update copyright years --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index d8d21af..c91118d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -© 2015-2017 Quentin Carbonneaux +© 2015-2019 Quentin Carbonneaux Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), From a85fe6e2d955b0b34e0d17ca244a978489db4a00 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 1 Mar 2019 15:08:58 +0100 Subject: [PATCH 134/286] skip expensive ssa-building loop when possible If a temporary is assigned exactly once (most are), there is no need to do any work to put it in ssa form. On an input file of ~35k loc, this makes the processing time go from 2.9 secs to 1.2 secs. --- ssa.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ssa.c b/ssa.c index f7dabb8..7ae8117 100644 --- a/ssa.c +++ b/ssa.c @@ -125,6 +125,8 @@ phiins(Fn *fn) fn->tmp[t].visit = 0; if (fn->tmp[t].phi != 0) continue; + if (fn->tmp[t].ndef == 1) + continue; bszero(u); k = -1; bp = be; @@ -140,10 +142,7 @@ phiins(Fn *fn) } if (req(i->to, TMP(t))) { if (!bshas(b->out, t)) { - if (fn->tmp[t].ndef == 1) - r = TMP(t); - else - r = refindex(t, fn); + r = refindex(t, fn); i->to = r; } else { if (!bshas(u, b->id)) { From 52392caecfb4fceeee487dfcc1e327ac140c8f6a Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 6 Mar 2019 20:31:11 -0800 Subject: [PATCH 135/286] fix in load elimination (vacall is a call) --- load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/load.c b/load.c index 504b2d8..8e1328e 100644 --- a/load.c +++ b/load.c @@ -231,7 +231,7 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) while (i > b->ins) { --i; if (killsl(i->to, sl) - || (i->op == Ocall && escapes(sl.ref, curf))) + || ((i->op == Ocall || i->op == Ovacall) && escapes(sl.ref, curf))) goto Load; ld = isload(i->op); if (ld) { From b15a6d47dc666d660c9cb5b7b75337492896902c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 8 Mar 2019 22:00:30 +0100 Subject: [PATCH 136/286] use a hash table to parse temporaries --- parse.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/parse.c b/parse.c index 3c4200e..fd3f609 100644 --- a/parse.c +++ b/parse.c @@ -102,6 +102,7 @@ static char *kwmap[Ntok] = { }; enum { + TMask = 16383, /* for temps hash */ BMask = 8191, /* for blocks hash */ K = 3233235, /* found using tools/lexh.c */ @@ -122,6 +123,7 @@ static struct { static int lnum; static Fn *curf; +static int tmph[TMask+1]; static Phi **plink; static Blk *curb; static Blk **blink; @@ -346,11 +348,19 @@ expect(int t) static Ref tmpref(char *v) { - int t; + int t, *h; - for (t=Tmp0; tntmp; t++) - if (strcmp(v, curf->tmp[t].name) == 0) + h = &tmph[hash(v) & TMask]; + t = *h; + if (t) { + if (strcmp(curf->tmp[t].name, v) == 0) return TMP(t); + for (t=curf->ntmp-1; t>=Tmp0; t--) + if (strcmp(curf->tmp[t].name, v) == 0) + return TMP(t); + } + t = curf->ntmp; + *h = t; newtmp(0, Kx, curf); strcpy(curf->tmp[t].name, v); return TMP(t); @@ -810,6 +820,7 @@ parsefn(int export) b->dlink = 0; /* was trashed by findblk() */ for (i=0; i Date: Sat, 9 Mar 2019 22:35:09 +0100 Subject: [PATCH 137/286] make sure phis are temporaries in rega In fact, after spilling, a phi can be a temporary or a slot. I am now pondering whether this is a good idea or not because it causes annoying mem->mem movs after register allocation. --- rega.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rega.c b/rega.c index 6f1da50..8f2fbd0 100644 --- a/rega.c +++ b/rega.c @@ -562,8 +562,8 @@ rega(Fn *fn) * predecessor, we have to find the * corresponding argument */ for (p=s->phi; p; p=p->link) { - r = rfind(m, p->to.val); - if (r == -1) + if (rtype(p->to) != RTmp + || (r=rfind(m, p->to.val)) == -1) continue; for (u=0; unarg; u++) { b = p->blk[u]; From ec1b18634325cfd47f6228b5164e14cf64e583bb Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 9 Mar 2019 23:10:26 +0100 Subject: [PATCH 138/286] add a stress test for phi spilling --- test/_phispill.ssa | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 test/_phispill.ssa diff --git a/test/_phispill.ssa b/test/_phispill.ssa new file mode 100644 index 0000000..21e98c2 --- /dev/null +++ b/test/_phispill.ssa @@ -0,0 +1,68 @@ +export +function w $f(w %n0) { +@start +@loop + %n1 =w phi @start %n0, @loop %n2 + + %p0 =w phi @start 0, @loop %p01 + %p1 =w phi @start 0, @loop %p11 + %p2 =w phi @start 0, @loop %p21 + %p3 =w phi @start 0, @loop %p31 + %p4 =w phi @start 0, @loop %p41 + %p5 =w phi @start 0, @loop %p51 + %p6 =w phi @start 0, @loop %p61 + %p7 =w phi @start 0, @loop %p71 + %p8 =w phi @start 0, @loop %p81 + %p9 =w phi @start 0, @loop %p91 + %pa =w phi @start 0, @loop %pa1 + %pb =w phi @start 0, @loop %pb1 + %pc =w phi @start 0, @loop %pc1 + %pd =w phi @start 0, @loop %pd1 + %pe =w phi @start 0, @loop %pe1 + %pf =w phi @start 0, @loop %pf1 + + %p01 =w add 1, %p0 + %p11 =w add 2, %p1 + %p21 =w add 3, %p2 + %p31 =w add 4, %p3 + %p41 =w add 5, %p4 + %p51 =w add 6, %p5 + %p61 =w add 7, %p6 + %p71 =w add 8, %p7 + %p81 =w add 9, %p8 + %p91 =w add 10, %p9 + %pa1 =w add 11, %pa + %pb1 =w add 12, %pb + %pc1 =w add 13, %pc + %pd1 =w add 14, %pd + %pe1 =w add 15, %pe + %pf1 =w add 16, %pf + + %n2 =w sub %n1, 1 + jnz %n2, @loop, @end + +@end + %a =w sub 0, 0 + %a =w add %p01, %a + %a =w add %p11, %a + %a =w add %p21, %a + %a =w add %p31, %a + %a =w add %p41, %a + %a =w add %p51, %a + %a =w add %p61, %a + %a =w add %p71, %a + %a =w add %p81, %a + %a =w add %p91, %a + %a =w add %pa1, %a + %a =w add %pb1, %a + %a =w add %pc1, %a + %a =w add %pd1, %a + %a =w add %pe1, %a + %a =w add %pf1, %a + ret %a +} + +# >>> driver +# extern int f(int); +# int main() { return !(f(1) == 136); } +# <<< From c37347a4630fda601b4c40585ca25fff42f756c6 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 12 Mar 2019 17:44:14 +0100 Subject: [PATCH 139/286] emit valid code for mem->mem copies --- amd64/emit.c | 14 +++++++++++--- test/{_phispill.ssa => spill1.ssa} | 0 2 files changed, 11 insertions(+), 3 deletions(-) rename test/{_phispill.ssa => spill1.ssa} (100%) diff --git a/amd64/emit.c b/amd64/emit.c index 653c548..ac7a1f3 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -360,7 +360,7 @@ emitins(Ins i, Fn *fn, FILE *f) { Ref r; int64_t val; - int o; + int o, t0; switch (i.op) { default: @@ -434,19 +434,27 @@ emitins(Ins i, Fn *fn, FILE *f) * also, we can use a trick to load 64-bits * registers, it's detailed in my note below * http://c9x.me/art/notes.html?09/19/2015 */ + t0 = rtype(i.arg[0]); if (req(i.to, R) || req(i.arg[0], R)) break; if (isreg(i.to) - && rtype(i.arg[0]) == RCon + && t0 == RCon && i.cls == Kl && fn->con[i.arg[0].val].type == CBits && (val = fn->con[i.arg[0].val].bits.i) >= 0 && val <= UINT32_MAX) { emitf("movl %W0, %W=", &i, fn, f); } else if (isreg(i.to) - && rtype(i.arg[0]) == RCon + && t0 == RCon && fn->con[i.arg[0].val].type == CAddr) { emitf("lea%k %M0, %=", &i, fn, f); + } else if (rtype(i.to) == RSlot + && (t0 == RSlot || t0 == RMem)) { + i.cls = KWIDE(i.cls) ? Kd : Ks; + i.arg[1] = TMP(XMM0+15); + emitf("mov%k %0, %1", &i, fn, f); + emitf("mov%k %1, %=", &i, fn, f); + } else if (!req(i.arg[0], i.to)) emitf("mov%k %0, %=", &i, fn, f); break; diff --git a/test/_phispill.ssa b/test/spill1.ssa similarity index 100% rename from test/_phispill.ssa rename to test/spill1.ssa From fd65f4275be6dc6603be9610e88c55b8bfc1dc62 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 12 Mar 2019 20:53:18 +0100 Subject: [PATCH 140/286] improve range-checking macros They are now linear and can be safely used with arguments that have side-effects. This patch also introduces an iscall() macro and uses it to fix a missing check for Ovacall in liveness analysis. --- all.h | 14 ++++++++------ live.c | 2 +- load.c | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/all.h b/all.h index 24a1755..e125f3a 100644 --- a/all.h +++ b/all.h @@ -171,12 +171,14 @@ enum { Jjf1 = Jjffuo, }; -#define isstore(o) (Ostoreb <= o && o <= Ostored) -#define isload(o) (Oloadsb <= o && o <= Oload) -#define isext(o) (Oextsb <= o && o <= Oextuw) -#define ispar(o) (Opar <= o && o <= Opare) -#define isarg(o) (Oarg <= o && o <= Oarge) -#define isret(j) (Jret0 <= j && j <= Jretc) +#define INRANGE(x, l, u) ((unsigned)(x) - l <= u - l) /* linear in x */ +#define iscall(o) INRANGE(o, Ocall, Ovacall) +#define isstore(o) INRANGE(o, Ostoreb, Ostored) +#define isload(o) INRANGE(o, Oloadsb, Oload) +#define isext(o) INRANGE(o, Oextsb, Oextuw) +#define ispar(o) INRANGE(o, Opar, Opare) +#define isarg(o) INRANGE(o, Oarg, Oarge) +#define isret(j) INRANGE(j, Jret0, Jretc) enum Class { Kx = -1, /* "top" class (see usecheck() and clsmerge()) */ diff --git a/live.c b/live.c index 4198995..c22e063 100644 --- a/live.c +++ b/live.c @@ -82,7 +82,7 @@ filllive(Fn *f) for (k=0; k<2; k++) b->nlive[k] = nlv[k]; for (i=&b->ins[b->nins]; i!=b->ins;) { - if ((--i)->op == Ocall && rtype(i->arg[1]) == RCall) { + if (iscall((--i)->op) && rtype(i->arg[1]) == RCall) { b->in->t[0] &= ~T.retregs(i->arg[1], m); for (k=0; k<2; k++) { nlv[k] -= m[k]; diff --git a/load.c b/load.c index 8e1328e..c8471f6 100644 --- a/load.c +++ b/load.c @@ -231,7 +231,7 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) while (i > b->ins) { --i; if (killsl(i->to, sl) - || ((i->op == Ocall || i->op == Ovacall) && escapes(sl.ref, curf))) + || (iscall(i->op) && escapes(sl.ref, curf))) goto Load; ld = isload(i->op); if (ld) { From b777cd6c4becf0d834f8fa549315fa11918a53be Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 12 Mar 2019 21:15:21 +0100 Subject: [PATCH 141/286] simple heuristic to reuse stack slots On test/spill1.ssa, the stack frame of the function f() goes from 56 bytes to 40 bytes. That's a reduction of close to 30%. This patch also opens the door to folding operations on spill slots. For example movl $15, %r15d addl -X(%rbp), %r15d movl %r15d, -X(%rbp) should become add $15, -X(%rbp) when %r15d is not used afterwards. --- spill.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/spill.c b/spill.c index 42f0c05..f0b593a 100644 --- a/spill.c +++ b/spill.c @@ -309,7 +309,7 @@ void spill(Fn *fn) { Blk *b, *s1, *s2, *hd, **bp; - int j, l, t, k, lvarg[2]; + int j, l, t, k, s, lvarg[2]; uint n; BSet u[1], v[1], w[1]; Ins *i; @@ -407,6 +407,7 @@ spill(Fn *fn) if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); t = i->to.val; + s = tmp[t].slot; if (bshas(v, t)) bsclr(v, t); else { @@ -440,6 +441,13 @@ spill(Fn *fn) bsset(v, t); if (j-- <= 0) bsset(w, t); + else if (!lvarg[n]) { + /* recycle the slot of + * i->to when possible + */ + if (tmp[t].slot == -1) + tmp[t].slot = s; + } break; } bscopy(u, v); @@ -447,9 +455,12 @@ spill(Fn *fn) for (n=0; n<2; n++) if (rtype(i->arg[n]) == RTmp) { t = i->arg[n].val; - if (!bshas(v, t)) { + if (bshas(v, t)) { + if (tmp[t].slot == s) + tmp[t].slot = -1; + } else { /* do not reload if the - * the temporary was dead + * argument is dead */ if (!lvarg[n]) bsclr(u, t); From f622efa05a3fbd4938d1fb09e692ae0785770bc1 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 14 Feb 2019 13:23:28 -0800 Subject: [PATCH 142/286] Rearrange the fields in Ins so the bit-fields get packed together --- all.h | 2 +- amd64/sysv.c | 2 +- arm64/abi.c | 5 +---- load.c | 2 +- parse.c | 12 ++++++------ tools/pmov.c | 4 ++-- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/all.h b/all.h index e125f3a..ae39145 100644 --- a/all.h +++ b/all.h @@ -199,9 +199,9 @@ struct Op { struct Ins { uint op:30; + uint cls:2; Ref to; Ref arg[2]; - uint cls:2; }; struct Phi { diff --git a/amd64/sysv.c b/amd64/sysv.c index d70e70d..86c59bf 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -345,7 +345,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) ra = alloc(sizeof *ra); /* specific to NAlign == 3 */ al = aret.align >= 2 ? aret.align - 2 : 0; - ra->i = (Ins){Oalloc+al, r1, {getcon(aret.size, fn)}, Kl}; + ra->i = (Ins){Oalloc+al, Kl, r1, {getcon(aret.size, fn)}}; ra->link = (*rap); *rap = ra; } else { diff --git a/arm64/abi.c b/arm64/abi.c index 1c97ef3..846ac87 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -313,10 +313,7 @@ stkblob(Ref r, Class *c, Fn *fn, Insl **ilp) al = c->t->align - 2; /* NAlign == 3 */ if (al < 0) al = 0; - il->i = (Ins){ - Oalloc + al, r, - {getcon(c->t->size, fn)}, Kl - }; + il->i = (Ins){Oalloc+al, Kl, r, {getcon(c->t->size, fn)}}; il->link = *ilp; *ilp = il; } diff --git a/load.c b/load.c index c8471f6..8e2dd64 100644 --- a/load.c +++ b/load.c @@ -77,7 +77,7 @@ iins(int cls, int op, Ref a0, Ref a1, Loc *l) ist->num = inum++; ist->bid = l->blk->id; ist->off = l->off; - ist->new.ins = (Ins){op, R, {a0, a1}, cls}; + ist->new.ins = (Ins){op, cls, R, {a0, a1}}; return ist->new.ins.to = newtmp("ld", cls, curf); } diff --git a/parse.c b/parse.c index fd3f609..c6f16ea 100644 --- a/parse.c +++ b/parse.c @@ -462,19 +462,19 @@ parserefl(int arg) err("invalid function parameter"); if (k == 4) if (arg) - *curi = (Ins){Oargc, R, {TYPE(ty), r}, Kl}; + *curi = (Ins){Oargc, Kl, R, {TYPE(ty), r}}; else - *curi = (Ins){Oparc, r, {TYPE(ty)}, Kl}; + *curi = (Ins){Oparc, Kl, r, {TYPE(ty)}}; else if (env) if (arg) - *curi = (Ins){Oarge, R, {r}, k}; + *curi = (Ins){Oarge, k, R, {r}}; else - *curi = (Ins){Opare, r, {R}, k}; + *curi = (Ins){Opare, k, r, {R}}; else if (arg) - *curi = (Ins){Oarg, R, {r}, k}; + *curi = (Ins){Oarg, k, R, {r}}; else - *curi = (Ins){Opar, r, {R}, k}; + *curi = (Ins){Opar, k, r, {R}}; curi++; hasenv |= env; if (peek() == Trparen) diff --git a/tools/pmov.c b/tools/pmov.c index 62d3921..ffc38ea 100644 --- a/tools/pmov.c +++ b/tools/pmov.c @@ -62,11 +62,11 @@ main() break; case 2: /* in copy, not in reg */ - *ip++ = (Ins){OCopy, TMP(Tmp0+t), {R, R}, Kw}; + *ip++ = (Ins){OCopy, Kw, TMP(Tmp0+t), {R, R}}; break; case 3: /* in copy, in reg */ - *ip++ = (Ins){OCopy, TMP(Tmp0+t), {R, R}, Kw}; + *ip++ = (Ins){OCopy, Kw, TMP(Tmp0+t), {R, R}}; radd(&mbeg, Tmp0+t, t+1); break; } From d84f5fcbb75dcf8f6ff1f12e7509d05598a4b561 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 8 Apr 2019 11:52:44 +0200 Subject: [PATCH 143/286] make sure a spill slot is initialized If an instruction does not have a result, the variable `s` is not set. This could lead to a bogus slot assignment. --- spill.c | 1 + 1 file changed, 1 insertion(+) diff --git a/spill.c b/spill.c index f0b593a..0742caa 100644 --- a/spill.c +++ b/spill.c @@ -404,6 +404,7 @@ spill(Fn *fn) continue; } bszero(w); + s = -1; if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); t = i->to.val; From 81da1cdebb213077a1ce2c1aaed051de0751e13c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 11 Apr 2019 19:36:13 +0200 Subject: [PATCH 144/286] properly detect ssa form Previously, we would skip ssa construction when a temporary has a single definition. This is only part of the ssa invariant: we must also check that all uses are dominated by the single definition. The new code does this. In fact, qbe does not store all the dominators for a block, so instead of walking the idom linked list we use a rough heuristic and declare conservatively that B0 dominates B1 when one of the two conditions is true: a. B0 is the start block b. B0 is B1 Some measurements on a big file from Michael Forney show that the code is still as fast as before this patch. --- all.h | 3 ++- main.c | 1 + ssa.c | 21 ++++++++++++++++----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/all.h b/all.h index ae39145..fc26a61 100644 --- a/all.h +++ b/all.h @@ -248,7 +248,7 @@ struct Use { UIns, UJmp, } type; - int bid; + uint bid; union { Ins *ins; Phi *phi; @@ -279,6 +279,7 @@ struct Alias { struct Tmp { char name[NString]; + uint bid; /* id of a defining block */ Use *use; uint ndef, nuse; uint cost; diff --git a/main.c b/main.c index 033ed9c..99ab330 100644 --- a/main.c +++ b/main.c @@ -65,6 +65,7 @@ func(Fn *fn) fillpreds(fn); filluse(fn); memopt(fn); + filluse(fn); ssa(fn); filluse(fn); ssacheck(fn); diff --git a/ssa.c b/ssa.c index 7ae8117..c098438 100644 --- a/ssa.c +++ b/ssa.c @@ -47,6 +47,7 @@ filluse(Fn *fn) /* todo, is this the correct file? */ tmp = fn->tmp; for (t=Tmp0; tntmp; t++) { + tmp[t].bid = -1u; tmp[t].ndef = 0; tmp[t].nuse = 0; tmp[t].cls = 0; @@ -59,6 +60,7 @@ filluse(Fn *fn) for (p=b->phi; p; p=p->link) { assert(rtype(p->to) == RTmp); tp = p->to.val; + tmp[tp].bid = b->id; tmp[tp].ndef++; tmp[tp].cls = p->cls; tp = phicls(tp, fn->tmp); @@ -84,6 +86,7 @@ filluse(Fn *fn) w = WFull; t = i->to.val; tmp[t].width = w; + tmp[t].bid = b->id; tmp[t].ndef++; tmp[t].cls = i->cls; } @@ -111,9 +114,10 @@ phiins(Fn *fn) Blk *a, *b, **blist, **be, **bp; Ins *i; Phi *p; + Use *use; Ref r; - int t, nt; - uint n; + int t, nt, ok; + uint n, defb; short k; bsinit(u, fn->nblk); @@ -125,8 +129,15 @@ phiins(Fn *fn) fn->tmp[t].visit = 0; if (fn->tmp[t].phi != 0) continue; - if (fn->tmp[t].ndef == 1) - continue; + if (fn->tmp[t].ndef == 1) { + ok = 1; + defb = fn->tmp[t].bid; + use = fn->tmp[t].use; + for (n=fn->tmp[t].nuse; n--; use++) + ok &= use->bid == defb; + if (ok || defb == fn->start->id) + continue; + } bszero(u); k = -1; bp = be; @@ -293,7 +304,7 @@ renblk(Blk *b, Name **stk, Fn *fn) renblk(s, stk, fn); } -/* require rpo and ndef */ +/* require rpo and use */ void ssa(Fn *fn) { From 2a8584c9853f9392ef0ddcb0ed9b3d2b14b1db83 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 15 Apr 2019 19:51:31 +0200 Subject: [PATCH 145/286] handle big constants moves to slots There is no flavor of mov which can set 8 bytes of memory to a constant not representable as an int32. The solution is simply to emit two movs of 4 bytes each. --- amd64/emit.c | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/amd64/emit.c b/amd64/emit.c index ac7a1f3..1fe141f 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -430,33 +430,48 @@ emitins(Ins i, Fn *fn, FILE *f) } goto Table; case Ocopy: - /* make sure we don't emit useless copies, - * also, we can use a trick to load 64-bits - * registers, it's detailed in my note below - * http://c9x.me/art/notes.html?09/19/2015 */ - t0 = rtype(i.arg[0]); + /* copies are used for many things; see my note + * to understand how to load big constants: + * https://c9x.me/notes/2015-09-19.html */ + assert(rtype(i.to) != RMem); if (req(i.to, R) || req(i.arg[0], R)) break; - if (isreg(i.to) + if (req(i.to, i.arg[0])) + break; + t0 = rtype(i.arg[0]); + if (i.cls == Kl && t0 == RCon - && i.cls == Kl - && fn->con[i.arg[0].val].type == CBits - && (val = fn->con[i.arg[0].val].bits.i) >= 0 - && val <= UINT32_MAX) { - emitf("movl %W0, %W=", &i, fn, f); - } else if (isreg(i.to) + && fn->con[i.arg[0].val].type == CBits) { + val = fn->con[i.arg[0].val].bits.i; + if (isreg(i.to)) + if (val >= 0 && val <= UINT32_MAX) { + emitf("movl %W0, %W=", &i, fn, f); + break; + } + if (rtype(i.to) == RSlot) + if (val < INT32_MIN || val > INT32_MAX) { + emitf("movl %0, %=", &i, fn, f); + emitf("movl %0>>32, 4+%=", &i, fn, f); + break; + } + } + if (isreg(i.to) && t0 == RCon && fn->con[i.arg[0].val].type == CAddr) { emitf("lea%k %M0, %=", &i, fn, f); - } else if (rtype(i.to) == RSlot + break; + } + if (rtype(i.to) == RSlot && (t0 == RSlot || t0 == RMem)) { i.cls = KWIDE(i.cls) ? Kd : Ks; i.arg[1] = TMP(XMM0+15); emitf("mov%k %0, %1", &i, fn, f); emitf("mov%k %1, %=", &i, fn, f); - - } else if (!req(i.arg[0], i.to)) - emitf("mov%k %0, %=", &i, fn, f); + break; + } + /* conveniently, the assembler knows if it + * should use movabsq when reading movq */ + emitf("mov%k %0, %=", &i, fn, f); break; case Ocall: /* calls simply have a weird syntax in AT&T From 60142f5d9b02889b9c628d4e7c7dff9cdae5ed2e Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 16 Apr 2019 09:30:41 +0200 Subject: [PATCH 146/286] bump NString and NPred Michael Forney needs this to run his compiler on interesting programs. --- all.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/all.h b/all.h index fc26a61..6053a1a 100644 --- a/all.h +++ b/all.h @@ -31,8 +31,8 @@ typedef struct Dat Dat; typedef struct Target Target; enum { - NString = 32, - NPred = 63, + NString = 64, + NPred = 127, NIns = 1 << 20, NAlign = 3, NField = 32, From ff4e5aab2c44fe5ec996594482a0967e95b54984 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 17 Apr 2019 22:21:46 +0200 Subject: [PATCH 147/286] avoid some gcc warnings In this case, the potential truncations flagged by gcc are only affecting debug information. --- amd64/sysv.c | 2 +- arm64/abi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/amd64/sysv.c b/amd64/sysv.c index 86c59bf..ea9b2d2 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -493,7 +493,7 @@ split(Fn *fn, Blk *b) idup(&bn->ins, curi, bn->nins); curi = &insb[NIns]; bn->visit = ++b->visit; - snprintf(bn->name, NString, "%s.%d", b->name, b->visit); + (void)!snprintf(bn->name, NString, "%s.%d", b->name, b->visit); bn->loop = b->loop; bn->link = b->link; b->link = bn; diff --git a/arm64/abi.c b/arm64/abi.c index 846ac87..8bc9c20 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -488,7 +488,7 @@ split(Fn *fn, Blk *b) idup(&bn->ins, curi, bn->nins); curi = &insb[NIns]; bn->visit = ++b->visit; - snprintf(bn->name, NString, "%s.%d", b->name, b->visit); + (void)!snprintf(bn->name, NString, "%s.%d", b->name, b->visit); bn->loop = b->loop; bn->link = b->link; b->link = bn; From 636568dcba071e212a61c35ce994012b9cb83ec5 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 23 Apr 2019 12:47:26 -0700 Subject: [PATCH 148/286] Fix default config.h for arm64 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 52574c8..b91e498 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ config.h: echo "#define Defasm Gaself"; \ case `uname -m` in \ *aarch64*) \ - echo "$define Deftgt T_arm64"; \ + echo "#define Deftgt T_arm64"; \ ;; \ *) \ echo "#define Deftgt T_amd64_sysv";\ From b4a98c3fa8b880f58b04f5d632ab89ad15725bd4 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 25 Apr 2019 15:27:25 +0200 Subject: [PATCH 149/286] cleanup amd64 constant addressing We now emit correct code when the user refers to a specific constant address. I also made some comments clearer in the instruction selection pass and got rid of some apparently useless code. --- amd64/emit.c | 12 +++++++----- amd64/isel.c | 30 ++++++++++++------------------ 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/amd64/emit.c b/amd64/emit.c index 1fe141f..91223bd 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -292,10 +292,10 @@ emitf(char *s, Ins *i, Fn *fn, FILE *f) if (m->offset.type != CUndef) emitcon(&m->offset, f); fputc('(', f); - if (req(m->base, R)) - fprintf(f, "%%rip"); - else + if (!req(m->base, R)) fprintf(f, "%%%s", regtoa(m->base.val, SLong)); + else if (m->offset.type == CAddr) + fprintf(f, "%%rip"); if (!req(m->index, R)) fprintf(f, ", %%%s, %d", regtoa(m->index.val, SLong), @@ -333,8 +333,10 @@ emitf(char *s, Ins *i, Fn *fn, FILE *f) fprintf(f, "%d(%%rbp)", slot(ref.val, fn)); break; case RCon: - emitcon(&fn->con[ref.val], f); - fprintf(f, "(%%rip)"); + off = fn->con[ref.val]; + emitcon(&off, f); + if (off.type == CAddr) + fprintf(f, "(%%rip)"); break; case RTmp: assert(isreg(ref)); diff --git a/amd64/isel.c b/amd64/isel.c index cedfdb1..ce0c98f 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -62,7 +62,7 @@ static void fixarg(Ref *r, int k, int op, Fn *fn) { char buf[32]; - Addr a, *m; + Addr a; Ref r0, r1; int s, n, cpy, mem; @@ -103,23 +103,13 @@ fixarg(Ref *r, int k, int op, Fn *fn) } else if (!mem && rtype(r0) == RCon && fn->con[r0.val].type == CAddr) { - /* apple asm fix */ + /* apple as does not support 32-bit + * absolute addressing, use a rip- + * relative leaq instead + */ r1 = newtmp("isel", Kl, fn); emit(Oaddr, Kl, r1, r0, R); } - else if (rtype(r0) == RMem) { - /* apple asm fix */ - m = &fn->mem[r0.val]; - if (req(m->base, R)) { - n = fn->ncon; - vgrow(&fn->con, ++fn->ncon); - fn->con[n] = m->offset; - m->offset.type = CUndef; - r0 = newtmp("isel", Kl, fn); - emit(Oaddr, Kl, r0, CON(n), R); - m->base = r0; - } - } *r = r1; } @@ -134,9 +124,13 @@ seladdr(Ref *r, ANum *an, Fn *fn) memset(&a, 0, sizeof a); if (!amatch(&a, r0, an[r0.val].n, an, fn)) return; - if (a.offset.type == CAddr) - if (!req(a.base, R)) { - /* apple asm fix */ + if (!req(a.base, R)) + if (a.offset.type == CAddr) { + /* apple as does not support + * $foo(%r0, %r1, M); try to + * rewrite it or bail out if + * impossible + */ if (!req(a.index, R)) return; else { From 82f5ba58cf76bc431afe0c738cdcfe1f5998ae95 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 26 Apr 2019 12:05:47 +0200 Subject: [PATCH 150/286] restore some code from b4a98c I had forgotten that %rip can only be used as base when there is no index. I also added a test which stresses addressing selection with and without constants. --- amd64/isel.c | 18 +++++++++++++- test/conaddr.ssa | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 test/conaddr.ssa diff --git a/amd64/isel.c b/amd64/isel.c index ce0c98f..e5202cb 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -62,7 +62,7 @@ static void fixarg(Ref *r, int k, int op, Fn *fn) { char buf[32]; - Addr a; + Addr a, *m; Ref r0, r1; int s, n, cpy, mem; @@ -110,6 +110,22 @@ fixarg(Ref *r, int k, int op, Fn *fn) r1 = newtmp("isel", Kl, fn); emit(Oaddr, Kl, r1, r0, R); } + else if (rtype(r0) == RMem) { + /* eliminate memory operands of + * the form $foo(%rip, ...) + */ + m = &fn->mem[r0.val]; + if (req(m->base, R)) + if (m->offset.type == CAddr) { + n = fn->ncon; + vgrow(&fn->con, ++fn->ncon); + fn->con[n] = m->offset; + m->offset.type = CUndef; + r0 = newtmp("isel", Kl, fn); + emit(Oaddr, Kl, r0, CON(n), R); + m->base = r0; + } + } *r = r1; } diff --git a/test/conaddr.ssa b/test/conaddr.ssa new file mode 100644 index 0000000..3f0aba7 --- /dev/null +++ b/test/conaddr.ssa @@ -0,0 +1,65 @@ +# test amd64 addressing modes + +export +function w $f0(l %o) { +@start + %addr =l add $a, %o + %char =w loadub %addr + ret %char +} + +export +function w $f1(l %o) { +@start + %o1 =l mul %o, 1 + %addr =l add 10, %o1 + %char =w loadub %addr + ret %char +} + +export +function w $f2(l %o1, l %o2) { +@start + %o22 =l mul %o2, 2 + %o =l add %o1, %o22 + %addr =l add $a, %o + %char =w loadub %addr + ret %char +} + +export +function l $f3(l %o) { +@start + %addr =l add %o, $a + ret %addr +} + +export +function $writeto0() { +@start + storel 0, 0 + ret +} + +# >>> driver +# #include +# #include +# char a[] = "qbe rocks"; +# int ok = 1; +# extern unsigned f0(long), f1(long), f2(long, long); +# extern char *f3(long); +# extern void writeto0(); +# void h(int sig, siginfo_t *si, void *unused) { +# ok &= si->si_addr == 0; +# exit(!ok); +# } +# int main() { +# struct sigaction sa = {.sa_flags=SA_SIGINFO, .sa_sigaction=h}; +# sigemptyset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0); +# ok &= f0(2) == 'e'; +# ok &= f1((long)a-5) == 'o'; +# ok &= f2(4, 2) == 's'; +# ok &= *f3(0) == 'q'; +# writeto0(); /* will segfault */ +# } +# <<< From 905575d9e6779d795e3f014e99c76c3189b38283 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 25 Apr 2019 11:30:05 -0700 Subject: [PATCH 151/286] Allow stack allocations larger than SHRT_MAX * 4 bytes Slots are stored as `int` in Fn, so use the same type in Tmp. Rearrange the fields in Tmp slightly so that sizeof(Tmp) stays the same (at least on 64-bit systems). --- all.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/all.h b/all.h index 6053a1a..e53e290 100644 --- a/all.h +++ b/all.h @@ -279,11 +279,11 @@ struct Alias { struct Tmp { char name[NString]; - uint bid; /* id of a defining block */ Use *use; uint ndef, nuse; + uint bid; /* id of a defining block */ uint cost; - short slot; /* -1 for unset */ + int slot; /* -1 for unset */ short cls; struct { int r; /* register or -1 */ From 659245773a7cad1954d975ea2e262c8a0c804689 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 25 Apr 2019 11:30:06 -0700 Subject: [PATCH 152/286] amd64/isel: Error if alloc size doesn't fit in Tmp slot type --- amd64/isel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/amd64/isel.c b/amd64/isel.c index e5202cb..22e1e14 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -588,6 +588,8 @@ amd64_isel(Fn *fn) err("invalid alloc size %"PRId64, sz); sz = (sz + n-1) & -n; sz /= 4; + if (sz > INT_MAX - fn->slot) + die("alloc too large"); fn->tmp[i->to.val].slot = fn->slot; fn->slot += sz; *i = (Ins){.op = Onop}; From 2a60575f53d831f36eb93658b40fcd2f5ab3c82f Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 25 Apr 2019 11:59:07 -0700 Subject: [PATCH 153/286] Fix config.h dependency when OBJDIR != obj --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b91e498..1a0074f 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ $(OBJDIR)/timestamp: $(OBJ): all.h ops.h $(AMD64OBJ): amd64/all.h $(ARM64OBJ): arm64/all.h -obj/main.o: config.h +$(OBJDIR)/main.o: config.h config.h: @case `uname` in \ From dda87279c17374baa2b7e1c7e60840c336e09d66 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 26 Apr 2019 14:17:49 +0200 Subject: [PATCH 154/286] update conaddr test to catch early segfaults --- test/conaddr.ssa | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/conaddr.ssa b/test/conaddr.ssa index 3f0aba7..43177ba 100644 --- a/test/conaddr.ssa +++ b/test/conaddr.ssa @@ -45,21 +45,21 @@ function $writeto0() { # #include # #include # char a[] = "qbe rocks"; -# int ok = 1; +# int ok; # extern unsigned f0(long), f1(long), f2(long, long); # extern char *f3(long); # extern void writeto0(); # void h(int sig, siginfo_t *si, void *unused) { -# ok &= si->si_addr == 0; -# exit(!ok); +# ok += si->si_addr == 0; +# exit(!(ok == 5)); # } # int main() { # struct sigaction sa = {.sa_flags=SA_SIGINFO, .sa_sigaction=h}; # sigemptyset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0); -# ok &= f0(2) == 'e'; -# ok &= f1((long)a-5) == 'o'; -# ok &= f2(4, 2) == 's'; -# ok &= *f3(0) == 'q'; +# ok += f0(2) == 'e'; +# ok += f1((long)a-5) == 'o'; +# ok += f2(4, 2) == 's'; +# ok += *f3(0) == 'q'; # writeto0(); /* will segfault */ # } # <<< From 47ee853c961b8ac95b60bd91023933a7c1dc486b Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 26 Apr 2019 14:20:28 +0200 Subject: [PATCH 155/286] new large test to evaluate performance This was generated by csmith and then compiled to qbe il by Michael Forney's C compiler. --- test/_slow.qbe | 35762 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 35762 insertions(+) create mode 100644 test/_slow.qbe diff --git a/test/_slow.qbe b/test/_slow.qbe new file mode 100644 index 0000000..2d107ae --- /dev/null +++ b/test/_slow.qbe @@ -0,0 +1,35762 @@ +function w $safe_unary_minus_func_int8_t_s(w %.1) { +@start.1 + %.2 =l alloc4 1 + storeb %.1, %.2 +@body.2 + %.3 =w loadsb %.2 + %.4 =w extsb %.3 + %.5 =w sub 0, 128 + %.6 =w ceqw %.4, %.5 + %.7 =w cnew %.6, 0 + jnz %.7, @cond_true.3, @cond_false.4 +@cond_true.3 + %.8 =w loadsb %.2 + %.9 =w extsb %.8 + jmp @cond_join.5 +@cond_false.4 + %.10 =w loadsb %.2 + %.11 =w extsb %.10 + %.12 =w sub 0, %.11 +@cond_join.5 + %.13 =w phi @cond_true.3 %.9, @cond_false.4 %.12 + %.14 =w copy %.13 + ret %.14 +} +function w $safe_add_func_int8_t_s_s(w %.1, w %.3) { +@start.6 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.7 + %.5 =w loadsb %.2 + %.6 =w extsb %.5 + %.7 =w csgtw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_right.15, @logic_join.16 +@logic_right.15 + %.9 =w loadsb %.4 + %.10 =w extsb %.9 + %.11 =w csgtw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.16 + %.13 =w phi @body.7 %.8, @logic_right.15 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_right.13, @logic_join.14 +@logic_right.13 + %.15 =w loadsb %.2 + %.16 =w extsb %.15 + %.17 =w loadsb %.4 + %.18 =w extsb %.17 + %.19 =w sub 127, %.18 + %.20 =w csgtw %.16, %.19 + %.21 =w cnew %.20, 0 +@logic_join.14 + %.22 =w phi @logic_join.16 %.14, @logic_right.13 %.21 + %.23 =w cnew %.22, 0 + jnz %.23, @logic_join.12, @logic_right.11 +@logic_right.11 + %.24 =w loadsb %.2 + %.25 =w extsb %.24 + %.26 =w csltw %.25, 0 + %.27 =w cnew %.26, 0 + jnz %.27, @logic_right.19, @logic_join.20 +@logic_right.19 + %.28 =w loadsb %.4 + %.29 =w extsb %.28 + %.30 =w csltw %.29, 0 + %.31 =w cnew %.30, 0 +@logic_join.20 + %.32 =w phi @logic_right.11 %.27, @logic_right.19 %.31 + %.33 =w cnew %.32, 0 + jnz %.33, @logic_right.17, @logic_join.18 +@logic_right.17 + %.34 =w loadsb %.2 + %.35 =w extsb %.34 + %.36 =w sub 0, 128 + %.37 =w loadsb %.4 + %.38 =w extsb %.37 + %.39 =w sub %.36, %.38 + %.40 =w csltw %.35, %.39 + %.41 =w cnew %.40, 0 +@logic_join.18 + %.42 =w phi @logic_join.20 %.33, @logic_right.17 %.41 + %.43 =w cnew %.42, 0 +@logic_join.12 + %.44 =w phi @logic_join.14 %.23, @logic_join.18 %.43 + %.45 =w cnew %.44, 0 + jnz %.45, @cond_true.8, @cond_false.9 +@cond_true.8 + %.46 =w loadsb %.2 + jmp @cond_join.10 +@cond_false.9 + %.47 =w loadsb %.2 + %.48 =w loadsb %.4 + %.49 =w add %.47, %.48 +@cond_join.10 + %.50 =w phi @cond_true.8 %.46, @cond_false.9 %.49 + ret %.50 +} +function w $safe_sub_func_int8_t_s_s(w %.1, w %.3) { +@start.21 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.22 + %.5 =w loadsb %.2 + %.6 =w loadsb %.4 + %.7 =w xor %.5, %.6 + %.8 =w extsb %.7 + %.9 =w loadsb %.2 + %.10 =w extsb %.9 + %.11 =w loadsb %.2 + %.12 =w loadsb %.4 + %.13 =w xor %.11, %.12 + %.14 =w extsb %.13 + %.15 =w xor 127, 18446744073709551615 + %.16 =w and %.14, %.15 + %.17 =w xor %.10, %.16 + %.18 =w loadsb %.4 + %.19 =w extsb %.18 + %.20 =w sub %.17, %.19 + %.21 =w loadsb %.4 + %.22 =w extsb %.21 + %.23 =w xor %.20, %.22 + %.24 =w and %.8, %.23 + %.25 =w csltw %.24, 0 + %.26 =w cnew %.25, 0 + jnz %.26, @cond_true.23, @cond_false.24 +@cond_true.23 + %.27 =w loadsb %.2 + jmp @cond_join.25 +@cond_false.24 + %.28 =w loadsb %.2 + %.29 =w loadsb %.4 + %.30 =w sub %.28, %.29 +@cond_join.25 + %.31 =w phi @cond_true.23 %.27, @cond_false.24 %.30 + ret %.31 +} +function w $safe_mul_func_int8_t_s_s(w %.1, w %.3) { +@start.26 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.27 + %.5 =w loadsb %.2 + %.6 =w extsb %.5 + %.7 =w csgtw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_right.39, @logic_join.40 +@logic_right.39 + %.9 =w loadsb %.4 + %.10 =w extsb %.9 + %.11 =w csgtw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.40 + %.13 =w phi @body.27 %.8, @logic_right.39 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_right.37, @logic_join.38 +@logic_right.37 + %.15 =w loadsb %.2 + %.16 =w extsb %.15 + %.17 =w loadsb %.4 + %.18 =w extsb %.17 + %.19 =w div 127, %.18 + %.20 =w csgtw %.16, %.19 + %.21 =w cnew %.20, 0 +@logic_join.38 + %.22 =w phi @logic_join.40 %.14, @logic_right.37 %.21 + %.23 =w cnew %.22, 0 + jnz %.23, @logic_join.36, @logic_right.35 +@logic_right.35 + %.24 =w loadsb %.2 + %.25 =w extsb %.24 + %.26 =w csgtw %.25, 0 + %.27 =w cnew %.26, 0 + jnz %.27, @logic_right.43, @logic_join.44 +@logic_right.43 + %.28 =w loadsb %.4 + %.29 =w extsb %.28 + %.30 =w cslew %.29, 0 + %.31 =w cnew %.30, 0 +@logic_join.44 + %.32 =w phi @logic_right.35 %.27, @logic_right.43 %.31 + %.33 =w cnew %.32, 0 + jnz %.33, @logic_right.41, @logic_join.42 +@logic_right.41 + %.34 =w loadsb %.4 + %.35 =w extsb %.34 + %.36 =w sub 0, 128 + %.37 =w loadsb %.2 + %.38 =w extsb %.37 + %.39 =w div %.36, %.38 + %.40 =w csltw %.35, %.39 + %.41 =w cnew %.40, 0 +@logic_join.42 + %.42 =w phi @logic_join.44 %.33, @logic_right.41 %.41 + %.43 =w cnew %.42, 0 +@logic_join.36 + %.44 =w phi @logic_join.38 %.23, @logic_join.42 %.43 + %.45 =w cnew %.44, 0 + jnz %.45, @logic_join.34, @logic_right.33 +@logic_right.33 + %.46 =w loadsb %.2 + %.47 =w extsb %.46 + %.48 =w cslew %.47, 0 + %.49 =w cnew %.48, 0 + jnz %.49, @logic_right.47, @logic_join.48 +@logic_right.47 + %.50 =w loadsb %.4 + %.51 =w extsb %.50 + %.52 =w csgtw %.51, 0 + %.53 =w cnew %.52, 0 +@logic_join.48 + %.54 =w phi @logic_right.33 %.49, @logic_right.47 %.53 + %.55 =w cnew %.54, 0 + jnz %.55, @logic_right.45, @logic_join.46 +@logic_right.45 + %.56 =w loadsb %.2 + %.57 =w extsb %.56 + %.58 =w sub 0, 128 + %.59 =w loadsb %.4 + %.60 =w extsb %.59 + %.61 =w div %.58, %.60 + %.62 =w csltw %.57, %.61 + %.63 =w cnew %.62, 0 +@logic_join.46 + %.64 =w phi @logic_join.48 %.55, @logic_right.45 %.63 + %.65 =w cnew %.64, 0 +@logic_join.34 + %.66 =w phi @logic_join.36 %.45, @logic_join.46 %.65 + %.67 =w cnew %.66, 0 + jnz %.67, @logic_join.32, @logic_right.31 +@logic_right.31 + %.68 =w loadsb %.2 + %.69 =w extsb %.68 + %.70 =w cslew %.69, 0 + %.71 =w cnew %.70, 0 + jnz %.71, @logic_right.53, @logic_join.54 +@logic_right.53 + %.72 =w loadsb %.4 + %.73 =w extsb %.72 + %.74 =w cslew %.73, 0 + %.75 =w cnew %.74, 0 +@logic_join.54 + %.76 =w phi @logic_right.31 %.71, @logic_right.53 %.75 + %.77 =w cnew %.76, 0 + jnz %.77, @logic_right.51, @logic_join.52 +@logic_right.51 + %.78 =w loadsb %.2 + %.79 =w extsb %.78 + %.80 =w cnew %.79, 0 + %.81 =w cnew %.80, 0 +@logic_join.52 + %.82 =w phi @logic_join.54 %.77, @logic_right.51 %.81 + %.83 =w cnew %.82, 0 + jnz %.83, @logic_right.49, @logic_join.50 +@logic_right.49 + %.84 =w loadsb %.4 + %.85 =w extsb %.84 + %.86 =w loadsb %.2 + %.87 =w extsb %.86 + %.88 =w div 127, %.87 + %.89 =w csltw %.85, %.88 + %.90 =w cnew %.89, 0 +@logic_join.50 + %.91 =w phi @logic_join.52 %.83, @logic_right.49 %.90 + %.92 =w cnew %.91, 0 +@logic_join.32 + %.93 =w phi @logic_join.34 %.67, @logic_join.50 %.92 + %.94 =w cnew %.93, 0 + jnz %.94, @cond_true.28, @cond_false.29 +@cond_true.28 + %.95 =w loadsb %.2 + jmp @cond_join.30 +@cond_false.29 + %.96 =w loadsb %.2 + %.97 =w loadsb %.4 + %.98 =w mul %.96, %.97 +@cond_join.30 + %.99 =w phi @cond_true.28 %.95, @cond_false.29 %.98 + ret %.99 +} +function w $safe_mod_func_int8_t_s_s(w %.1, w %.3) { +@start.55 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.56 + %.5 =w loadsb %.4 + %.6 =w extsb %.5 + %.7 =w ceqw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.61, @logic_right.60 +@logic_right.60 + %.9 =w loadsb %.2 + %.10 =w extsb %.9 + %.11 =w sub 0, 128 + %.12 =w ceqw %.10, %.11 + %.13 =w cnew %.12, 0 + jnz %.13, @logic_right.62, @logic_join.63 +@logic_right.62 + %.14 =w loadsb %.4 + %.15 =w extsb %.14 + %.16 =w sub 0, 1 + %.17 =w ceqw %.15, %.16 + %.18 =w cnew %.17, 0 +@logic_join.63 + %.19 =w phi @logic_right.60 %.13, @logic_right.62 %.18 + %.20 =w cnew %.19, 0 +@logic_join.61 + %.21 =w phi @body.56 %.8, @logic_join.63 %.20 + %.22 =w cnew %.21, 0 + jnz %.22, @cond_true.57, @cond_false.58 +@cond_true.57 + %.23 =w loadsb %.2 + jmp @cond_join.59 +@cond_false.58 + %.24 =w loadsb %.2 + %.25 =w loadsb %.4 + %.26 =w rem %.24, %.25 +@cond_join.59 + %.27 =w phi @cond_true.57 %.23, @cond_false.58 %.26 + ret %.27 +} +function w $safe_div_func_int8_t_s_s(w %.1, w %.3) { +@start.64 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.65 + %.5 =w loadsb %.4 + %.6 =w extsb %.5 + %.7 =w ceqw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.70, @logic_right.69 +@logic_right.69 + %.9 =w loadsb %.2 + %.10 =w extsb %.9 + %.11 =w sub 0, 128 + %.12 =w ceqw %.10, %.11 + %.13 =w cnew %.12, 0 + jnz %.13, @logic_right.71, @logic_join.72 +@logic_right.71 + %.14 =w loadsb %.4 + %.15 =w extsb %.14 + %.16 =w sub 0, 1 + %.17 =w ceqw %.15, %.16 + %.18 =w cnew %.17, 0 +@logic_join.72 + %.19 =w phi @logic_right.69 %.13, @logic_right.71 %.18 + %.20 =w cnew %.19, 0 +@logic_join.70 + %.21 =w phi @body.65 %.8, @logic_join.72 %.20 + %.22 =w cnew %.21, 0 + jnz %.22, @cond_true.66, @cond_false.67 +@cond_true.66 + %.23 =w loadsb %.2 + jmp @cond_join.68 +@cond_false.67 + %.24 =w loadsb %.2 + %.25 =w loadsb %.4 + %.26 =w div %.24, %.25 +@cond_join.68 + %.27 =w phi @cond_true.66 %.23, @cond_false.67 %.26 + ret %.27 +} +function w $safe_lshift_func_int8_t_s_s(w %.1, w %.3) { +@start.73 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.74 + %.5 =w loadsb %.2 + %.6 =w extsb %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.83, @logic_right.82 +@logic_right.82 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csltw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.83 + %.13 =w phi @body.74 %.8, @logic_right.82 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.81, @logic_right.80 +@logic_right.80 + %.15 =w loadsw %.4 + %.16 =w copy %.15 + %.17 =w csgew %.16, 32 + %.18 =w cnew %.17, 0 +@logic_join.81 + %.19 =w phi @logic_join.83 %.14, @logic_right.80 %.18 + %.20 =w cnew %.19, 0 + jnz %.20, @logic_join.79, @logic_right.78 +@logic_right.78 + %.21 =w loadsb %.2 + %.22 =w extsb %.21 + %.23 =w loadsw %.4 + %.24 =w copy %.23 + %.25 =w sar 127, %.24 + %.26 =w csgtw %.22, %.25 + %.27 =w cnew %.26, 0 +@logic_join.79 + %.28 =w phi @logic_join.81 %.20, @logic_right.78 %.27 + %.29 =w cnew %.28, 0 + jnz %.29, @cond_true.75, @cond_false.76 +@cond_true.75 + %.30 =w loadsb %.2 + %.31 =w extsb %.30 + jmp @cond_join.77 +@cond_false.76 + %.32 =w loadsb %.2 + %.33 =w extsb %.32 + %.34 =w loadsw %.4 + %.35 =w copy %.34 + %.36 =w shl %.33, %.35 +@cond_join.77 + %.37 =w phi @cond_true.75 %.31, @cond_false.76 %.36 + %.38 =w copy %.37 + ret %.38 +} +function w $safe_lshift_func_int8_t_s_u(w %.1, w %.3) { +@start.84 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.85 + %.5 =w loadsb %.2 + %.6 =w extsb %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.92, @logic_right.91 +@logic_right.91 + %.9 =w loaduw %.4 + %.10 =w copy %.9 + %.11 =w copy 32 + %.12 =w cugew %.10, %.11 + %.13 =w cnew %.12, 0 +@logic_join.92 + %.14 =w phi @body.85 %.8, @logic_right.91 %.13 + %.15 =w cnew %.14, 0 + jnz %.15, @logic_join.90, @logic_right.89 +@logic_right.89 + %.16 =w loadsb %.2 + %.17 =w extsb %.16 + %.18 =w loaduw %.4 + %.19 =w copy %.18 + %.20 =w sar 127, %.19 + %.21 =w csgtw %.17, %.20 + %.22 =w cnew %.21, 0 +@logic_join.90 + %.23 =w phi @logic_join.92 %.15, @logic_right.89 %.22 + %.24 =w cnew %.23, 0 + jnz %.24, @cond_true.86, @cond_false.87 +@cond_true.86 + %.25 =w loadsb %.2 + %.26 =w extsb %.25 + jmp @cond_join.88 +@cond_false.87 + %.27 =w loadsb %.2 + %.28 =w extsb %.27 + %.29 =w loaduw %.4 + %.30 =w copy %.29 + %.31 =w shl %.28, %.30 +@cond_join.88 + %.32 =w phi @cond_true.86 %.26, @cond_false.87 %.31 + %.33 =w copy %.32 + ret %.33 +} +function w $safe_rshift_func_int8_t_s_s(w %.1, w %.3) { +@start.93 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.94 + %.5 =w loadsb %.2 + %.6 =w extsb %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.101, @logic_right.100 +@logic_right.100 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csltw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.101 + %.13 =w phi @body.94 %.8, @logic_right.100 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.99, @logic_right.98 +@logic_right.98 + %.15 =w loadsw %.4 + %.16 =w copy %.15 + %.17 =w csgew %.16, 32 + %.18 =w cnew %.17, 0 +@logic_join.99 + %.19 =w phi @logic_join.101 %.14, @logic_right.98 %.18 + %.20 =w cnew %.19, 0 + jnz %.20, @cond_true.95, @cond_false.96 +@cond_true.95 + %.21 =w loadsb %.2 + %.22 =w extsb %.21 + jmp @cond_join.97 +@cond_false.96 + %.23 =w loadsb %.2 + %.24 =w extsb %.23 + %.25 =w loadsw %.4 + %.26 =w copy %.25 + %.27 =w sar %.24, %.26 +@cond_join.97 + %.28 =w phi @cond_true.95 %.22, @cond_false.96 %.27 + %.29 =w copy %.28 + ret %.29 +} +function w $safe_rshift_func_int8_t_s_u(w %.1, w %.3) { +@start.102 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.103 + %.5 =w loadsb %.2 + %.6 =w extsb %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.108, @logic_right.107 +@logic_right.107 + %.9 =w loaduw %.4 + %.10 =w copy %.9 + %.11 =w copy 32 + %.12 =w cugew %.10, %.11 + %.13 =w cnew %.12, 0 +@logic_join.108 + %.14 =w phi @body.103 %.8, @logic_right.107 %.13 + %.15 =w cnew %.14, 0 + jnz %.15, @cond_true.104, @cond_false.105 +@cond_true.104 + %.16 =w loadsb %.2 + %.17 =w extsb %.16 + jmp @cond_join.106 +@cond_false.105 + %.18 =w loadsb %.2 + %.19 =w extsb %.18 + %.20 =w loaduw %.4 + %.21 =w copy %.20 + %.22 =w sar %.19, %.21 +@cond_join.106 + %.23 =w phi @cond_true.104 %.17, @cond_false.105 %.22 + %.24 =w copy %.23 + ret %.24 +} +function w $safe_unary_minus_func_int16_t_s(w %.1) { +@start.109 + %.2 =l alloc4 2 + storeh %.1, %.2 +@body.110 + %.3 =w loadsh %.2 + %.4 =w extsh %.3 + %.5 =w sub 0, 32767 + %.6 =w sub %.5, 1 + %.7 =w ceqw %.4, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.111, @cond_false.112 +@cond_true.111 + %.9 =w loadsh %.2 + %.10 =w extsh %.9 + jmp @cond_join.113 +@cond_false.112 + %.11 =w loadsh %.2 + %.12 =w extsh %.11 + %.13 =w sub 0, %.12 +@cond_join.113 + %.14 =w phi @cond_true.111 %.10, @cond_false.112 %.13 + %.15 =w copy %.14 + ret %.15 +} +function w $safe_add_func_int16_t_s_s(w %.1, w %.3) { +@start.114 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.115 + %.5 =w loadsh %.2 + %.6 =w extsh %.5 + %.7 =w csgtw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_right.123, @logic_join.124 +@logic_right.123 + %.9 =w loadsh %.4 + %.10 =w extsh %.9 + %.11 =w csgtw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.124 + %.13 =w phi @body.115 %.8, @logic_right.123 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_right.121, @logic_join.122 +@logic_right.121 + %.15 =w loadsh %.2 + %.16 =w extsh %.15 + %.17 =w loadsh %.4 + %.18 =w extsh %.17 + %.19 =w sub 32767, %.18 + %.20 =w csgtw %.16, %.19 + %.21 =w cnew %.20, 0 +@logic_join.122 + %.22 =w phi @logic_join.124 %.14, @logic_right.121 %.21 + %.23 =w cnew %.22, 0 + jnz %.23, @logic_join.120, @logic_right.119 +@logic_right.119 + %.24 =w loadsh %.2 + %.25 =w extsh %.24 + %.26 =w csltw %.25, 0 + %.27 =w cnew %.26, 0 + jnz %.27, @logic_right.127, @logic_join.128 +@logic_right.127 + %.28 =w loadsh %.4 + %.29 =w extsh %.28 + %.30 =w csltw %.29, 0 + %.31 =w cnew %.30, 0 +@logic_join.128 + %.32 =w phi @logic_right.119 %.27, @logic_right.127 %.31 + %.33 =w cnew %.32, 0 + jnz %.33, @logic_right.125, @logic_join.126 +@logic_right.125 + %.34 =w loadsh %.2 + %.35 =w extsh %.34 + %.36 =w sub 0, 32767 + %.37 =w sub %.36, 1 + %.38 =w loadsh %.4 + %.39 =w extsh %.38 + %.40 =w sub %.37, %.39 + %.41 =w csltw %.35, %.40 + %.42 =w cnew %.41, 0 +@logic_join.126 + %.43 =w phi @logic_join.128 %.33, @logic_right.125 %.42 + %.44 =w cnew %.43, 0 +@logic_join.120 + %.45 =w phi @logic_join.122 %.23, @logic_join.126 %.44 + %.46 =w cnew %.45, 0 + jnz %.46, @cond_true.116, @cond_false.117 +@cond_true.116 + %.47 =w loadsh %.2 + jmp @cond_join.118 +@cond_false.117 + %.48 =w loadsh %.2 + %.49 =w loadsh %.4 + %.50 =w add %.48, %.49 +@cond_join.118 + %.51 =w phi @cond_true.116 %.47, @cond_false.117 %.50 + ret %.51 +} +function w $safe_sub_func_int16_t_s_s(w %.1, w %.3) { +@start.129 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.130 + %.5 =w loadsh %.2 + %.6 =w loadsh %.4 + %.7 =w xor %.5, %.6 + %.8 =w extsh %.7 + %.9 =w loadsh %.2 + %.10 =w extsh %.9 + %.11 =w loadsh %.2 + %.12 =w loadsh %.4 + %.13 =w xor %.11, %.12 + %.14 =w extsh %.13 + %.15 =w xor 32767, 18446744073709551615 + %.16 =w and %.14, %.15 + %.17 =w xor %.10, %.16 + %.18 =w loadsh %.4 + %.19 =w extsh %.18 + %.20 =w sub %.17, %.19 + %.21 =w loadsh %.4 + %.22 =w extsh %.21 + %.23 =w xor %.20, %.22 + %.24 =w and %.8, %.23 + %.25 =w csltw %.24, 0 + %.26 =w cnew %.25, 0 + jnz %.26, @cond_true.131, @cond_false.132 +@cond_true.131 + %.27 =w loadsh %.2 + jmp @cond_join.133 +@cond_false.132 + %.28 =w loadsh %.2 + %.29 =w loadsh %.4 + %.30 =w sub %.28, %.29 +@cond_join.133 + %.31 =w phi @cond_true.131 %.27, @cond_false.132 %.30 + ret %.31 +} +function w $safe_mul_func_int16_t_s_s(w %.1, w %.3) { +@start.134 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.135 + %.5 =w loadsh %.2 + %.6 =w extsh %.5 + %.7 =w csgtw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_right.147, @logic_join.148 +@logic_right.147 + %.9 =w loadsh %.4 + %.10 =w extsh %.9 + %.11 =w csgtw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.148 + %.13 =w phi @body.135 %.8, @logic_right.147 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_right.145, @logic_join.146 +@logic_right.145 + %.15 =w loadsh %.2 + %.16 =w extsh %.15 + %.17 =w loadsh %.4 + %.18 =w extsh %.17 + %.19 =w div 32767, %.18 + %.20 =w csgtw %.16, %.19 + %.21 =w cnew %.20, 0 +@logic_join.146 + %.22 =w phi @logic_join.148 %.14, @logic_right.145 %.21 + %.23 =w cnew %.22, 0 + jnz %.23, @logic_join.144, @logic_right.143 +@logic_right.143 + %.24 =w loadsh %.2 + %.25 =w extsh %.24 + %.26 =w csgtw %.25, 0 + %.27 =w cnew %.26, 0 + jnz %.27, @logic_right.151, @logic_join.152 +@logic_right.151 + %.28 =w loadsh %.4 + %.29 =w extsh %.28 + %.30 =w cslew %.29, 0 + %.31 =w cnew %.30, 0 +@logic_join.152 + %.32 =w phi @logic_right.143 %.27, @logic_right.151 %.31 + %.33 =w cnew %.32, 0 + jnz %.33, @logic_right.149, @logic_join.150 +@logic_right.149 + %.34 =w loadsh %.4 + %.35 =w extsh %.34 + %.36 =w sub 0, 32767 + %.37 =w sub %.36, 1 + %.38 =w loadsh %.2 + %.39 =w extsh %.38 + %.40 =w div %.37, %.39 + %.41 =w csltw %.35, %.40 + %.42 =w cnew %.41, 0 +@logic_join.150 + %.43 =w phi @logic_join.152 %.33, @logic_right.149 %.42 + %.44 =w cnew %.43, 0 +@logic_join.144 + %.45 =w phi @logic_join.146 %.23, @logic_join.150 %.44 + %.46 =w cnew %.45, 0 + jnz %.46, @logic_join.142, @logic_right.141 +@logic_right.141 + %.47 =w loadsh %.2 + %.48 =w extsh %.47 + %.49 =w cslew %.48, 0 + %.50 =w cnew %.49, 0 + jnz %.50, @logic_right.155, @logic_join.156 +@logic_right.155 + %.51 =w loadsh %.4 + %.52 =w extsh %.51 + %.53 =w csgtw %.52, 0 + %.54 =w cnew %.53, 0 +@logic_join.156 + %.55 =w phi @logic_right.141 %.50, @logic_right.155 %.54 + %.56 =w cnew %.55, 0 + jnz %.56, @logic_right.153, @logic_join.154 +@logic_right.153 + %.57 =w loadsh %.2 + %.58 =w extsh %.57 + %.59 =w sub 0, 32767 + %.60 =w sub %.59, 1 + %.61 =w loadsh %.4 + %.62 =w extsh %.61 + %.63 =w div %.60, %.62 + %.64 =w csltw %.58, %.63 + %.65 =w cnew %.64, 0 +@logic_join.154 + %.66 =w phi @logic_join.156 %.56, @logic_right.153 %.65 + %.67 =w cnew %.66, 0 +@logic_join.142 + %.68 =w phi @logic_join.144 %.46, @logic_join.154 %.67 + %.69 =w cnew %.68, 0 + jnz %.69, @logic_join.140, @logic_right.139 +@logic_right.139 + %.70 =w loadsh %.2 + %.71 =w extsh %.70 + %.72 =w cslew %.71, 0 + %.73 =w cnew %.72, 0 + jnz %.73, @logic_right.161, @logic_join.162 +@logic_right.161 + %.74 =w loadsh %.4 + %.75 =w extsh %.74 + %.76 =w cslew %.75, 0 + %.77 =w cnew %.76, 0 +@logic_join.162 + %.78 =w phi @logic_right.139 %.73, @logic_right.161 %.77 + %.79 =w cnew %.78, 0 + jnz %.79, @logic_right.159, @logic_join.160 +@logic_right.159 + %.80 =w loadsh %.2 + %.81 =w extsh %.80 + %.82 =w cnew %.81, 0 + %.83 =w cnew %.82, 0 +@logic_join.160 + %.84 =w phi @logic_join.162 %.79, @logic_right.159 %.83 + %.85 =w cnew %.84, 0 + jnz %.85, @logic_right.157, @logic_join.158 +@logic_right.157 + %.86 =w loadsh %.4 + %.87 =w extsh %.86 + %.88 =w loadsh %.2 + %.89 =w extsh %.88 + %.90 =w div 32767, %.89 + %.91 =w csltw %.87, %.90 + %.92 =w cnew %.91, 0 +@logic_join.158 + %.93 =w phi @logic_join.160 %.85, @logic_right.157 %.92 + %.94 =w cnew %.93, 0 +@logic_join.140 + %.95 =w phi @logic_join.142 %.69, @logic_join.158 %.94 + %.96 =w cnew %.95, 0 + jnz %.96, @cond_true.136, @cond_false.137 +@cond_true.136 + %.97 =w loadsh %.2 + jmp @cond_join.138 +@cond_false.137 + %.98 =w loadsh %.2 + %.99 =w loadsh %.4 + %.100 =w mul %.98, %.99 +@cond_join.138 + %.101 =w phi @cond_true.136 %.97, @cond_false.137 %.100 + ret %.101 +} +function w $safe_mod_func_int16_t_s_s(w %.1, w %.3) { +@start.163 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.164 + %.5 =w loadsh %.4 + %.6 =w extsh %.5 + %.7 =w ceqw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.169, @logic_right.168 +@logic_right.168 + %.9 =w loadsh %.2 + %.10 =w extsh %.9 + %.11 =w sub 0, 32767 + %.12 =w sub %.11, 1 + %.13 =w ceqw %.10, %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_right.170, @logic_join.171 +@logic_right.170 + %.15 =w loadsh %.4 + %.16 =w extsh %.15 + %.17 =w sub 0, 1 + %.18 =w ceqw %.16, %.17 + %.19 =w cnew %.18, 0 +@logic_join.171 + %.20 =w phi @logic_right.168 %.14, @logic_right.170 %.19 + %.21 =w cnew %.20, 0 +@logic_join.169 + %.22 =w phi @body.164 %.8, @logic_join.171 %.21 + %.23 =w cnew %.22, 0 + jnz %.23, @cond_true.165, @cond_false.166 +@cond_true.165 + %.24 =w loadsh %.2 + jmp @cond_join.167 +@cond_false.166 + %.25 =w loadsh %.2 + %.26 =w loadsh %.4 + %.27 =w rem %.25, %.26 +@cond_join.167 + %.28 =w phi @cond_true.165 %.24, @cond_false.166 %.27 + ret %.28 +} +function w $safe_div_func_int16_t_s_s(w %.1, w %.3) { +@start.172 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.173 + %.5 =w loadsh %.4 + %.6 =w extsh %.5 + %.7 =w ceqw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.178, @logic_right.177 +@logic_right.177 + %.9 =w loadsh %.2 + %.10 =w extsh %.9 + %.11 =w sub 0, 32767 + %.12 =w sub %.11, 1 + %.13 =w ceqw %.10, %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_right.179, @logic_join.180 +@logic_right.179 + %.15 =w loadsh %.4 + %.16 =w extsh %.15 + %.17 =w sub 0, 1 + %.18 =w ceqw %.16, %.17 + %.19 =w cnew %.18, 0 +@logic_join.180 + %.20 =w phi @logic_right.177 %.14, @logic_right.179 %.19 + %.21 =w cnew %.20, 0 +@logic_join.178 + %.22 =w phi @body.173 %.8, @logic_join.180 %.21 + %.23 =w cnew %.22, 0 + jnz %.23, @cond_true.174, @cond_false.175 +@cond_true.174 + %.24 =w loadsh %.2 + jmp @cond_join.176 +@cond_false.175 + %.25 =w loadsh %.2 + %.26 =w loadsh %.4 + %.27 =w div %.25, %.26 +@cond_join.176 + %.28 =w phi @cond_true.174 %.24, @cond_false.175 %.27 + ret %.28 +} +function w $safe_lshift_func_int16_t_s_s(w %.1, w %.3) { +@start.181 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.182 + %.5 =w loadsh %.2 + %.6 =w extsh %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.191, @logic_right.190 +@logic_right.190 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csltw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.191 + %.13 =w phi @body.182 %.8, @logic_right.190 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.189, @logic_right.188 +@logic_right.188 + %.15 =w loadsw %.4 + %.16 =w copy %.15 + %.17 =w csgew %.16, 32 + %.18 =w cnew %.17, 0 +@logic_join.189 + %.19 =w phi @logic_join.191 %.14, @logic_right.188 %.18 + %.20 =w cnew %.19, 0 + jnz %.20, @logic_join.187, @logic_right.186 +@logic_right.186 + %.21 =w loadsh %.2 + %.22 =w extsh %.21 + %.23 =w loadsw %.4 + %.24 =w copy %.23 + %.25 =w sar 32767, %.24 + %.26 =w csgtw %.22, %.25 + %.27 =w cnew %.26, 0 +@logic_join.187 + %.28 =w phi @logic_join.189 %.20, @logic_right.186 %.27 + %.29 =w cnew %.28, 0 + jnz %.29, @cond_true.183, @cond_false.184 +@cond_true.183 + %.30 =w loadsh %.2 + %.31 =w extsh %.30 + jmp @cond_join.185 +@cond_false.184 + %.32 =w loadsh %.2 + %.33 =w extsh %.32 + %.34 =w loadsw %.4 + %.35 =w copy %.34 + %.36 =w shl %.33, %.35 +@cond_join.185 + %.37 =w phi @cond_true.183 %.31, @cond_false.184 %.36 + %.38 =w copy %.37 + ret %.38 +} +function w $safe_lshift_func_int16_t_s_u(w %.1, w %.3) { +@start.192 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.193 + %.5 =w loadsh %.2 + %.6 =w extsh %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.200, @logic_right.199 +@logic_right.199 + %.9 =w loaduw %.4 + %.10 =w copy %.9 + %.11 =w copy 32 + %.12 =w cugew %.10, %.11 + %.13 =w cnew %.12, 0 +@logic_join.200 + %.14 =w phi @body.193 %.8, @logic_right.199 %.13 + %.15 =w cnew %.14, 0 + jnz %.15, @logic_join.198, @logic_right.197 +@logic_right.197 + %.16 =w loadsh %.2 + %.17 =w extsh %.16 + %.18 =w loaduw %.4 + %.19 =w copy %.18 + %.20 =w sar 32767, %.19 + %.21 =w csgtw %.17, %.20 + %.22 =w cnew %.21, 0 +@logic_join.198 + %.23 =w phi @logic_join.200 %.15, @logic_right.197 %.22 + %.24 =w cnew %.23, 0 + jnz %.24, @cond_true.194, @cond_false.195 +@cond_true.194 + %.25 =w loadsh %.2 + %.26 =w extsh %.25 + jmp @cond_join.196 +@cond_false.195 + %.27 =w loadsh %.2 + %.28 =w extsh %.27 + %.29 =w loaduw %.4 + %.30 =w copy %.29 + %.31 =w shl %.28, %.30 +@cond_join.196 + %.32 =w phi @cond_true.194 %.26, @cond_false.195 %.31 + %.33 =w copy %.32 + ret %.33 +} +function w $safe_rshift_func_int16_t_s_s(w %.1, w %.3) { +@start.201 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.202 + %.5 =w loadsh %.2 + %.6 =w extsh %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.209, @logic_right.208 +@logic_right.208 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csltw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.209 + %.13 =w phi @body.202 %.8, @logic_right.208 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.207, @logic_right.206 +@logic_right.206 + %.15 =w loadsw %.4 + %.16 =w copy %.15 + %.17 =w csgew %.16, 32 + %.18 =w cnew %.17, 0 +@logic_join.207 + %.19 =w phi @logic_join.209 %.14, @logic_right.206 %.18 + %.20 =w cnew %.19, 0 + jnz %.20, @cond_true.203, @cond_false.204 +@cond_true.203 + %.21 =w loadsh %.2 + %.22 =w extsh %.21 + jmp @cond_join.205 +@cond_false.204 + %.23 =w loadsh %.2 + %.24 =w extsh %.23 + %.25 =w loadsw %.4 + %.26 =w copy %.25 + %.27 =w sar %.24, %.26 +@cond_join.205 + %.28 =w phi @cond_true.203 %.22, @cond_false.204 %.27 + %.29 =w copy %.28 + ret %.29 +} +function w $safe_rshift_func_int16_t_s_u(w %.1, w %.3) { +@start.210 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.211 + %.5 =w loadsh %.2 + %.6 =w extsh %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.216, @logic_right.215 +@logic_right.215 + %.9 =w loaduw %.4 + %.10 =w copy %.9 + %.11 =w copy 32 + %.12 =w cugew %.10, %.11 + %.13 =w cnew %.12, 0 +@logic_join.216 + %.14 =w phi @body.211 %.8, @logic_right.215 %.13 + %.15 =w cnew %.14, 0 + jnz %.15, @cond_true.212, @cond_false.213 +@cond_true.212 + %.16 =w loadsh %.2 + %.17 =w extsh %.16 + jmp @cond_join.214 +@cond_false.213 + %.18 =w loadsh %.2 + %.19 =w extsh %.18 + %.20 =w loaduw %.4 + %.21 =w copy %.20 + %.22 =w sar %.19, %.21 +@cond_join.214 + %.23 =w phi @cond_true.212 %.17, @cond_false.213 %.22 + %.24 =w copy %.23 + ret %.24 +} +function w $safe_unary_minus_func_int32_t_s(w %.1) { +@start.217 + %.2 =l alloc4 4 + storew %.1, %.2 +@body.218 + %.3 =w loadsw %.2 + %.4 =w sub 0, 2147483647 + %.5 =w sub %.4, 1 + %.6 =w ceqw %.3, %.5 + %.7 =w cnew %.6, 0 + jnz %.7, @cond_true.219, @cond_false.220 +@cond_true.219 + %.8 =w loadsw %.2 + jmp @cond_join.221 +@cond_false.220 + %.9 =w loadsw %.2 + %.10 =w sub 0, %.9 +@cond_join.221 + %.11 =w phi @cond_true.219 %.8, @cond_false.220 %.10 + ret %.11 +} +function w $safe_add_func_int32_t_s_s(w %.1, w %.3) { +@start.222 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.223 + %.5 =w loadsw %.2 + %.6 =w csgtw %.5, 0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_right.231, @logic_join.232 +@logic_right.231 + %.8 =w loadsw %.4 + %.9 =w csgtw %.8, 0 + %.10 =w cnew %.9, 0 +@logic_join.232 + %.11 =w phi @body.223 %.7, @logic_right.231 %.10 + %.12 =w cnew %.11, 0 + jnz %.12, @logic_right.229, @logic_join.230 +@logic_right.229 + %.13 =w loadsw %.2 + %.14 =w loadsw %.4 + %.15 =w sub 2147483647, %.14 + %.16 =w csgtw %.13, %.15 + %.17 =w cnew %.16, 0 +@logic_join.230 + %.18 =w phi @logic_join.232 %.12, @logic_right.229 %.17 + %.19 =w cnew %.18, 0 + jnz %.19, @logic_join.228, @logic_right.227 +@logic_right.227 + %.20 =w loadsw %.2 + %.21 =w csltw %.20, 0 + %.22 =w cnew %.21, 0 + jnz %.22, @logic_right.235, @logic_join.236 +@logic_right.235 + %.23 =w loadsw %.4 + %.24 =w csltw %.23, 0 + %.25 =w cnew %.24, 0 +@logic_join.236 + %.26 =w phi @logic_right.227 %.22, @logic_right.235 %.25 + %.27 =w cnew %.26, 0 + jnz %.27, @logic_right.233, @logic_join.234 +@logic_right.233 + %.28 =w loadsw %.2 + %.29 =w sub 0, 2147483647 + %.30 =w sub %.29, 1 + %.31 =w loadsw %.4 + %.32 =w sub %.30, %.31 + %.33 =w csltw %.28, %.32 + %.34 =w cnew %.33, 0 +@logic_join.234 + %.35 =w phi @logic_join.236 %.27, @logic_right.233 %.34 + %.36 =w cnew %.35, 0 +@logic_join.228 + %.37 =w phi @logic_join.230 %.19, @logic_join.234 %.36 + %.38 =w cnew %.37, 0 + jnz %.38, @cond_true.224, @cond_false.225 +@cond_true.224 + %.39 =w loadsw %.2 + jmp @cond_join.226 +@cond_false.225 + %.40 =w loadsw %.2 + %.41 =w loadsw %.4 + %.42 =w add %.40, %.41 +@cond_join.226 + %.43 =w phi @cond_true.224 %.39, @cond_false.225 %.42 + ret %.43 +} +function w $safe_sub_func_int32_t_s_s(w %.1, w %.3) { +@start.237 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.238 + %.5 =w loadsw %.2 + %.6 =w loadsw %.4 + %.7 =w xor %.5, %.6 + %.8 =w loadsw %.2 + %.9 =w loadsw %.2 + %.10 =w loadsw %.4 + %.11 =w xor %.9, %.10 + %.12 =w xor 2147483647, 18446744073709551615 + %.13 =w and %.11, %.12 + %.14 =w xor %.8, %.13 + %.15 =w loadsw %.4 + %.16 =w sub %.14, %.15 + %.17 =w loadsw %.4 + %.18 =w xor %.16, %.17 + %.19 =w and %.7, %.18 + %.20 =w csltw %.19, 0 + %.21 =w cnew %.20, 0 + jnz %.21, @cond_true.239, @cond_false.240 +@cond_true.239 + %.22 =w loadsw %.2 + jmp @cond_join.241 +@cond_false.240 + %.23 =w loadsw %.2 + %.24 =w loadsw %.4 + %.25 =w sub %.23, %.24 +@cond_join.241 + %.26 =w phi @cond_true.239 %.22, @cond_false.240 %.25 + ret %.26 +} +function w $safe_mul_func_int32_t_s_s(w %.1, w %.3) { +@start.242 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.243 + %.5 =w loadsw %.2 + %.6 =w csgtw %.5, 0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_right.255, @logic_join.256 +@logic_right.255 + %.8 =w loadsw %.4 + %.9 =w csgtw %.8, 0 + %.10 =w cnew %.9, 0 +@logic_join.256 + %.11 =w phi @body.243 %.7, @logic_right.255 %.10 + %.12 =w cnew %.11, 0 + jnz %.12, @logic_right.253, @logic_join.254 +@logic_right.253 + %.13 =w loadsw %.2 + %.14 =w loadsw %.4 + %.15 =w div 2147483647, %.14 + %.16 =w csgtw %.13, %.15 + %.17 =w cnew %.16, 0 +@logic_join.254 + %.18 =w phi @logic_join.256 %.12, @logic_right.253 %.17 + %.19 =w cnew %.18, 0 + jnz %.19, @logic_join.252, @logic_right.251 +@logic_right.251 + %.20 =w loadsw %.2 + %.21 =w csgtw %.20, 0 + %.22 =w cnew %.21, 0 + jnz %.22, @logic_right.259, @logic_join.260 +@logic_right.259 + %.23 =w loadsw %.4 + %.24 =w cslew %.23, 0 + %.25 =w cnew %.24, 0 +@logic_join.260 + %.26 =w phi @logic_right.251 %.22, @logic_right.259 %.25 + %.27 =w cnew %.26, 0 + jnz %.27, @logic_right.257, @logic_join.258 +@logic_right.257 + %.28 =w loadsw %.4 + %.29 =w sub 0, 2147483647 + %.30 =w sub %.29, 1 + %.31 =w loadsw %.2 + %.32 =w div %.30, %.31 + %.33 =w csltw %.28, %.32 + %.34 =w cnew %.33, 0 +@logic_join.258 + %.35 =w phi @logic_join.260 %.27, @logic_right.257 %.34 + %.36 =w cnew %.35, 0 +@logic_join.252 + %.37 =w phi @logic_join.254 %.19, @logic_join.258 %.36 + %.38 =w cnew %.37, 0 + jnz %.38, @logic_join.250, @logic_right.249 +@logic_right.249 + %.39 =w loadsw %.2 + %.40 =w cslew %.39, 0 + %.41 =w cnew %.40, 0 + jnz %.41, @logic_right.263, @logic_join.264 +@logic_right.263 + %.42 =w loadsw %.4 + %.43 =w csgtw %.42, 0 + %.44 =w cnew %.43, 0 +@logic_join.264 + %.45 =w phi @logic_right.249 %.41, @logic_right.263 %.44 + %.46 =w cnew %.45, 0 + jnz %.46, @logic_right.261, @logic_join.262 +@logic_right.261 + %.47 =w loadsw %.2 + %.48 =w sub 0, 2147483647 + %.49 =w sub %.48, 1 + %.50 =w loadsw %.4 + %.51 =w div %.49, %.50 + %.52 =w csltw %.47, %.51 + %.53 =w cnew %.52, 0 +@logic_join.262 + %.54 =w phi @logic_join.264 %.46, @logic_right.261 %.53 + %.55 =w cnew %.54, 0 +@logic_join.250 + %.56 =w phi @logic_join.252 %.38, @logic_join.262 %.55 + %.57 =w cnew %.56, 0 + jnz %.57, @logic_join.248, @logic_right.247 +@logic_right.247 + %.58 =w loadsw %.2 + %.59 =w cslew %.58, 0 + %.60 =w cnew %.59, 0 + jnz %.60, @logic_right.269, @logic_join.270 +@logic_right.269 + %.61 =w loadsw %.4 + %.62 =w cslew %.61, 0 + %.63 =w cnew %.62, 0 +@logic_join.270 + %.64 =w phi @logic_right.247 %.60, @logic_right.269 %.63 + %.65 =w cnew %.64, 0 + jnz %.65, @logic_right.267, @logic_join.268 +@logic_right.267 + %.66 =w loadsw %.2 + %.67 =w cnew %.66, 0 + %.68 =w cnew %.67, 0 +@logic_join.268 + %.69 =w phi @logic_join.270 %.65, @logic_right.267 %.68 + %.70 =w cnew %.69, 0 + jnz %.70, @logic_right.265, @logic_join.266 +@logic_right.265 + %.71 =w loadsw %.4 + %.72 =w loadsw %.2 + %.73 =w div 2147483647, %.72 + %.74 =w csltw %.71, %.73 + %.75 =w cnew %.74, 0 +@logic_join.266 + %.76 =w phi @logic_join.268 %.70, @logic_right.265 %.75 + %.77 =w cnew %.76, 0 +@logic_join.248 + %.78 =w phi @logic_join.250 %.57, @logic_join.266 %.77 + %.79 =w cnew %.78, 0 + jnz %.79, @cond_true.244, @cond_false.245 +@cond_true.244 + %.80 =w loadsw %.2 + jmp @cond_join.246 +@cond_false.245 + %.81 =w loadsw %.2 + %.82 =w loadsw %.4 + %.83 =w mul %.81, %.82 +@cond_join.246 + %.84 =w phi @cond_true.244 %.80, @cond_false.245 %.83 + ret %.84 +} +function w $safe_mod_func_int32_t_s_s(w %.1, w %.3) { +@start.271 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.272 + %.5 =w loadsw %.4 + %.6 =w ceqw %.5, 0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_join.277, @logic_right.276 +@logic_right.276 + %.8 =w loadsw %.2 + %.9 =w sub 0, 2147483647 + %.10 =w sub %.9, 1 + %.11 =w ceqw %.8, %.10 + %.12 =w cnew %.11, 0 + jnz %.12, @logic_right.278, @logic_join.279 +@logic_right.278 + %.13 =w loadsw %.4 + %.14 =w sub 0, 1 + %.15 =w ceqw %.13, %.14 + %.16 =w cnew %.15, 0 +@logic_join.279 + %.17 =w phi @logic_right.276 %.12, @logic_right.278 %.16 + %.18 =w cnew %.17, 0 +@logic_join.277 + %.19 =w phi @body.272 %.7, @logic_join.279 %.18 + %.20 =w cnew %.19, 0 + jnz %.20, @cond_true.273, @cond_false.274 +@cond_true.273 + %.21 =w loadsw %.2 + jmp @cond_join.275 +@cond_false.274 + %.22 =w loadsw %.2 + %.23 =w loadsw %.4 + %.24 =w rem %.22, %.23 +@cond_join.275 + %.25 =w phi @cond_true.273 %.21, @cond_false.274 %.24 + ret %.25 +} +function w $safe_div_func_int32_t_s_s(w %.1, w %.3) { +@start.280 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.281 + %.5 =w loadsw %.4 + %.6 =w ceqw %.5, 0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_join.286, @logic_right.285 +@logic_right.285 + %.8 =w loadsw %.2 + %.9 =w sub 0, 2147483647 + %.10 =w sub %.9, 1 + %.11 =w ceqw %.8, %.10 + %.12 =w cnew %.11, 0 + jnz %.12, @logic_right.287, @logic_join.288 +@logic_right.287 + %.13 =w loadsw %.4 + %.14 =w sub 0, 1 + %.15 =w ceqw %.13, %.14 + %.16 =w cnew %.15, 0 +@logic_join.288 + %.17 =w phi @logic_right.285 %.12, @logic_right.287 %.16 + %.18 =w cnew %.17, 0 +@logic_join.286 + %.19 =w phi @body.281 %.7, @logic_join.288 %.18 + %.20 =w cnew %.19, 0 + jnz %.20, @cond_true.282, @cond_false.283 +@cond_true.282 + %.21 =w loadsw %.2 + jmp @cond_join.284 +@cond_false.283 + %.22 =w loadsw %.2 + %.23 =w loadsw %.4 + %.24 =w div %.22, %.23 +@cond_join.284 + %.25 =w phi @cond_true.282 %.21, @cond_false.283 %.24 + ret %.25 +} +function w $safe_lshift_func_int32_t_s_s(w %.1, w %.3) { +@start.289 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.290 + %.5 =w loadsw %.2 + %.6 =w csltw %.5, 0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_join.299, @logic_right.298 +@logic_right.298 + %.8 =w loadsw %.4 + %.9 =w copy %.8 + %.10 =w csltw %.9, 0 + %.11 =w cnew %.10, 0 +@logic_join.299 + %.12 =w phi @body.290 %.7, @logic_right.298 %.11 + %.13 =w cnew %.12, 0 + jnz %.13, @logic_join.297, @logic_right.296 +@logic_right.296 + %.14 =w loadsw %.4 + %.15 =w copy %.14 + %.16 =w csgew %.15, 32 + %.17 =w cnew %.16, 0 +@logic_join.297 + %.18 =w phi @logic_join.299 %.13, @logic_right.296 %.17 + %.19 =w cnew %.18, 0 + jnz %.19, @logic_join.295, @logic_right.294 +@logic_right.294 + %.20 =w loadsw %.2 + %.21 =w loadsw %.4 + %.22 =w copy %.21 + %.23 =w sar 2147483647, %.22 + %.24 =w csgtw %.20, %.23 + %.25 =w cnew %.24, 0 +@logic_join.295 + %.26 =w phi @logic_join.297 %.19, @logic_right.294 %.25 + %.27 =w cnew %.26, 0 + jnz %.27, @cond_true.291, @cond_false.292 +@cond_true.291 + %.28 =w loadsw %.2 + jmp @cond_join.293 +@cond_false.292 + %.29 =w loadsw %.2 + %.30 =w loadsw %.4 + %.31 =w copy %.30 + %.32 =w shl %.29, %.31 +@cond_join.293 + %.33 =w phi @cond_true.291 %.28, @cond_false.292 %.32 + ret %.33 +} +function w $safe_lshift_func_int32_t_s_u(w %.1, w %.3) { +@start.300 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.301 + %.5 =w loadsw %.2 + %.6 =w csltw %.5, 0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_join.308, @logic_right.307 +@logic_right.307 + %.8 =w loaduw %.4 + %.9 =w copy %.8 + %.10 =w copy 32 + %.11 =w cugew %.9, %.10 + %.12 =w cnew %.11, 0 +@logic_join.308 + %.13 =w phi @body.301 %.7, @logic_right.307 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.306, @logic_right.305 +@logic_right.305 + %.15 =w loadsw %.2 + %.16 =w loaduw %.4 + %.17 =w copy %.16 + %.18 =w sar 2147483647, %.17 + %.19 =w csgtw %.15, %.18 + %.20 =w cnew %.19, 0 +@logic_join.306 + %.21 =w phi @logic_join.308 %.14, @logic_right.305 %.20 + %.22 =w cnew %.21, 0 + jnz %.22, @cond_true.302, @cond_false.303 +@cond_true.302 + %.23 =w loadsw %.2 + jmp @cond_join.304 +@cond_false.303 + %.24 =w loadsw %.2 + %.25 =w loaduw %.4 + %.26 =w copy %.25 + %.27 =w shl %.24, %.26 +@cond_join.304 + %.28 =w phi @cond_true.302 %.23, @cond_false.303 %.27 + ret %.28 +} +function w $safe_rshift_func_int32_t_s_s(w %.1, w %.3) { +@start.309 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.310 + %.5 =w loadsw %.2 + %.6 =w csltw %.5, 0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_join.317, @logic_right.316 +@logic_right.316 + %.8 =w loadsw %.4 + %.9 =w copy %.8 + %.10 =w csltw %.9, 0 + %.11 =w cnew %.10, 0 +@logic_join.317 + %.12 =w phi @body.310 %.7, @logic_right.316 %.11 + %.13 =w cnew %.12, 0 + jnz %.13, @logic_join.315, @logic_right.314 +@logic_right.314 + %.14 =w loadsw %.4 + %.15 =w copy %.14 + %.16 =w csgew %.15, 32 + %.17 =w cnew %.16, 0 +@logic_join.315 + %.18 =w phi @logic_join.317 %.13, @logic_right.314 %.17 + %.19 =w cnew %.18, 0 + jnz %.19, @cond_true.311, @cond_false.312 +@cond_true.311 + %.20 =w loadsw %.2 + jmp @cond_join.313 +@cond_false.312 + %.21 =w loadsw %.2 + %.22 =w loadsw %.4 + %.23 =w copy %.22 + %.24 =w sar %.21, %.23 +@cond_join.313 + %.25 =w phi @cond_true.311 %.20, @cond_false.312 %.24 + ret %.25 +} +function w $safe_rshift_func_int32_t_s_u(w %.1, w %.3) { +@start.318 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.319 + %.5 =w loadsw %.2 + %.6 =w csltw %.5, 0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_join.324, @logic_right.323 +@logic_right.323 + %.8 =w loaduw %.4 + %.9 =w copy %.8 + %.10 =w copy 32 + %.11 =w cugew %.9, %.10 + %.12 =w cnew %.11, 0 +@logic_join.324 + %.13 =w phi @body.319 %.7, @logic_right.323 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @cond_true.320, @cond_false.321 +@cond_true.320 + %.15 =w loadsw %.2 + jmp @cond_join.322 +@cond_false.321 + %.16 =w loadsw %.2 + %.17 =w loaduw %.4 + %.18 =w copy %.17 + %.19 =w sar %.16, %.18 +@cond_join.322 + %.20 =w phi @cond_true.320 %.15, @cond_false.321 %.19 + ret %.20 +} +function l $safe_unary_minus_func_int64_t_s(l %.1) { +@start.325 + %.2 =l alloc8 8 + storel %.1, %.2 +@body.326 + %.3 =l loadl %.2 + %.4 =l extsw 0 + %.5 =l sub %.4, 9223372036854775807 + %.6 =l extsw 1 + %.7 =l sub %.5, %.6 + %.8 =w ceql %.3, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @cond_true.327, @cond_false.328 +@cond_true.327 + %.10 =l loadl %.2 + jmp @cond_join.329 +@cond_false.328 + %.11 =l extsw 0 + %.12 =l loadl %.2 + %.13 =l sub %.11, %.12 +@cond_join.329 + %.14 =l phi @cond_true.327 %.10, @cond_false.328 %.13 + ret %.14 +} +function l $safe_add_func_int64_t_s_s(l %.1, l %.3) { +@start.330 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.331 + %.5 =l loadl %.2 + %.6 =l extsw 0 + %.7 =w csgtl %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_right.339, @logic_join.340 +@logic_right.339 + %.9 =l loadl %.4 + %.10 =l extsw 0 + %.11 =w csgtl %.9, %.10 + %.12 =w cnew %.11, 0 +@logic_join.340 + %.13 =w phi @body.331 %.8, @logic_right.339 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_right.337, @logic_join.338 +@logic_right.337 + %.15 =l loadl %.2 + %.16 =l loadl %.4 + %.17 =l sub 9223372036854775807, %.16 + %.18 =w csgtl %.15, %.17 + %.19 =w cnew %.18, 0 +@logic_join.338 + %.20 =w phi @logic_join.340 %.14, @logic_right.337 %.19 + %.21 =w cnew %.20, 0 + jnz %.21, @logic_join.336, @logic_right.335 +@logic_right.335 + %.22 =l loadl %.2 + %.23 =l extsw 0 + %.24 =w csltl %.22, %.23 + %.25 =w cnew %.24, 0 + jnz %.25, @logic_right.343, @logic_join.344 +@logic_right.343 + %.26 =l loadl %.4 + %.27 =l extsw 0 + %.28 =w csltl %.26, %.27 + %.29 =w cnew %.28, 0 +@logic_join.344 + %.30 =w phi @logic_right.335 %.25, @logic_right.343 %.29 + %.31 =w cnew %.30, 0 + jnz %.31, @logic_right.341, @logic_join.342 +@logic_right.341 + %.32 =l loadl %.2 + %.33 =l extsw 0 + %.34 =l sub %.33, 9223372036854775807 + %.35 =l extsw 1 + %.36 =l sub %.34, %.35 + %.37 =l loadl %.4 + %.38 =l sub %.36, %.37 + %.39 =w csltl %.32, %.38 + %.40 =w cnew %.39, 0 +@logic_join.342 + %.41 =w phi @logic_join.344 %.31, @logic_right.341 %.40 + %.42 =w cnew %.41, 0 +@logic_join.336 + %.43 =w phi @logic_join.338 %.21, @logic_join.342 %.42 + %.44 =w cnew %.43, 0 + jnz %.44, @cond_true.332, @cond_false.333 +@cond_true.332 + %.45 =l loadl %.2 + jmp @cond_join.334 +@cond_false.333 + %.46 =l loadl %.2 + %.47 =l loadl %.4 + %.48 =l add %.46, %.47 +@cond_join.334 + %.49 =l phi @cond_true.332 %.45, @cond_false.333 %.48 + ret %.49 +} +function l $safe_sub_func_int64_t_s_s(l %.1, l %.3) { +@start.345 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.346 + %.5 =l loadl %.2 + %.6 =l loadl %.4 + %.7 =l xor %.5, %.6 + %.8 =l loadl %.2 + %.9 =l loadl %.2 + %.10 =l loadl %.4 + %.11 =l xor %.9, %.10 + %.12 =l xor 9223372036854775807, 18446744073709551615 + %.13 =l and %.11, %.12 + %.14 =l xor %.8, %.13 + %.15 =l loadl %.4 + %.16 =l sub %.14, %.15 + %.17 =l loadl %.4 + %.18 =l xor %.16, %.17 + %.19 =l and %.7, %.18 + %.20 =l extsw 0 + %.21 =w csltl %.19, %.20 + %.22 =w cnew %.21, 0 + jnz %.22, @cond_true.347, @cond_false.348 +@cond_true.347 + %.23 =l loadl %.2 + jmp @cond_join.349 +@cond_false.348 + %.24 =l loadl %.2 + %.25 =l loadl %.4 + %.26 =l sub %.24, %.25 +@cond_join.349 + %.27 =l phi @cond_true.347 %.23, @cond_false.348 %.26 + ret %.27 +} +function l $safe_mul_func_int64_t_s_s(l %.1, l %.3) { +@start.350 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.351 + %.5 =l loadl %.2 + %.6 =l extsw 0 + %.7 =w csgtl %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_right.363, @logic_join.364 +@logic_right.363 + %.9 =l loadl %.4 + %.10 =l extsw 0 + %.11 =w csgtl %.9, %.10 + %.12 =w cnew %.11, 0 +@logic_join.364 + %.13 =w phi @body.351 %.8, @logic_right.363 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_right.361, @logic_join.362 +@logic_right.361 + %.15 =l loadl %.2 + %.16 =l loadl %.4 + %.17 =l div 9223372036854775807, %.16 + %.18 =w csgtl %.15, %.17 + %.19 =w cnew %.18, 0 +@logic_join.362 + %.20 =w phi @logic_join.364 %.14, @logic_right.361 %.19 + %.21 =w cnew %.20, 0 + jnz %.21, @logic_join.360, @logic_right.359 +@logic_right.359 + %.22 =l loadl %.2 + %.23 =l extsw 0 + %.24 =w csgtl %.22, %.23 + %.25 =w cnew %.24, 0 + jnz %.25, @logic_right.367, @logic_join.368 +@logic_right.367 + %.26 =l loadl %.4 + %.27 =l extsw 0 + %.28 =w cslel %.26, %.27 + %.29 =w cnew %.28, 0 +@logic_join.368 + %.30 =w phi @logic_right.359 %.25, @logic_right.367 %.29 + %.31 =w cnew %.30, 0 + jnz %.31, @logic_right.365, @logic_join.366 +@logic_right.365 + %.32 =l loadl %.4 + %.33 =l extsw 0 + %.34 =l sub %.33, 9223372036854775807 + %.35 =l extsw 1 + %.36 =l sub %.34, %.35 + %.37 =l loadl %.2 + %.38 =l div %.36, %.37 + %.39 =w csltl %.32, %.38 + %.40 =w cnew %.39, 0 +@logic_join.366 + %.41 =w phi @logic_join.368 %.31, @logic_right.365 %.40 + %.42 =w cnew %.41, 0 +@logic_join.360 + %.43 =w phi @logic_join.362 %.21, @logic_join.366 %.42 + %.44 =w cnew %.43, 0 + jnz %.44, @logic_join.358, @logic_right.357 +@logic_right.357 + %.45 =l loadl %.2 + %.46 =l extsw 0 + %.47 =w cslel %.45, %.46 + %.48 =w cnew %.47, 0 + jnz %.48, @logic_right.371, @logic_join.372 +@logic_right.371 + %.49 =l loadl %.4 + %.50 =l extsw 0 + %.51 =w csgtl %.49, %.50 + %.52 =w cnew %.51, 0 +@logic_join.372 + %.53 =w phi @logic_right.357 %.48, @logic_right.371 %.52 + %.54 =w cnew %.53, 0 + jnz %.54, @logic_right.369, @logic_join.370 +@logic_right.369 + %.55 =l loadl %.2 + %.56 =l extsw 0 + %.57 =l sub %.56, 9223372036854775807 + %.58 =l extsw 1 + %.59 =l sub %.57, %.58 + %.60 =l loadl %.4 + %.61 =l div %.59, %.60 + %.62 =w csltl %.55, %.61 + %.63 =w cnew %.62, 0 +@logic_join.370 + %.64 =w phi @logic_join.372 %.54, @logic_right.369 %.63 + %.65 =w cnew %.64, 0 +@logic_join.358 + %.66 =w phi @logic_join.360 %.44, @logic_join.370 %.65 + %.67 =w cnew %.66, 0 + jnz %.67, @logic_join.356, @logic_right.355 +@logic_right.355 + %.68 =l loadl %.2 + %.69 =l extsw 0 + %.70 =w cslel %.68, %.69 + %.71 =w cnew %.70, 0 + jnz %.71, @logic_right.377, @logic_join.378 +@logic_right.377 + %.72 =l loadl %.4 + %.73 =l extsw 0 + %.74 =w cslel %.72, %.73 + %.75 =w cnew %.74, 0 +@logic_join.378 + %.76 =w phi @logic_right.355 %.71, @logic_right.377 %.75 + %.77 =w cnew %.76, 0 + jnz %.77, @logic_right.375, @logic_join.376 +@logic_right.375 + %.78 =l loadl %.2 + %.79 =l extsw 0 + %.80 =w cnel %.78, %.79 + %.81 =w cnew %.80, 0 +@logic_join.376 + %.82 =w phi @logic_join.378 %.77, @logic_right.375 %.81 + %.83 =w cnew %.82, 0 + jnz %.83, @logic_right.373, @logic_join.374 +@logic_right.373 + %.84 =l loadl %.4 + %.85 =l loadl %.2 + %.86 =l div 9223372036854775807, %.85 + %.87 =w csltl %.84, %.86 + %.88 =w cnew %.87, 0 +@logic_join.374 + %.89 =w phi @logic_join.376 %.83, @logic_right.373 %.88 + %.90 =w cnew %.89, 0 +@logic_join.356 + %.91 =w phi @logic_join.358 %.67, @logic_join.374 %.90 + %.92 =w cnew %.91, 0 + jnz %.92, @cond_true.352, @cond_false.353 +@cond_true.352 + %.93 =l loadl %.2 + jmp @cond_join.354 +@cond_false.353 + %.94 =l loadl %.2 + %.95 =l loadl %.4 + %.96 =l mul %.94, %.95 +@cond_join.354 + %.97 =l phi @cond_true.352 %.93, @cond_false.353 %.96 + ret %.97 +} +function l $safe_mod_func_int64_t_s_s(l %.1, l %.3) { +@start.379 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.380 + %.5 =l loadl %.4 + %.6 =l extsw 0 + %.7 =w ceql %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.385, @logic_right.384 +@logic_right.384 + %.9 =l loadl %.2 + %.10 =l extsw 0 + %.11 =l sub %.10, 9223372036854775807 + %.12 =l extsw 1 + %.13 =l sub %.11, %.12 + %.14 =w ceql %.9, %.13 + %.15 =w cnew %.14, 0 + jnz %.15, @logic_right.386, @logic_join.387 +@logic_right.386 + %.16 =l loadl %.4 + %.17 =w sub 0, 1 + %.18 =l extsw %.17 + %.19 =w ceql %.16, %.18 + %.20 =w cnew %.19, 0 +@logic_join.387 + %.21 =w phi @logic_right.384 %.15, @logic_right.386 %.20 + %.22 =w cnew %.21, 0 +@logic_join.385 + %.23 =w phi @body.380 %.8, @logic_join.387 %.22 + %.24 =w cnew %.23, 0 + jnz %.24, @cond_true.381, @cond_false.382 +@cond_true.381 + %.25 =l loadl %.2 + jmp @cond_join.383 +@cond_false.382 + %.26 =l loadl %.2 + %.27 =l loadl %.4 + %.28 =l rem %.26, %.27 +@cond_join.383 + %.29 =l phi @cond_true.381 %.25, @cond_false.382 %.28 + ret %.29 +} +function l $safe_div_func_int64_t_s_s(l %.1, l %.3) { +@start.388 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.389 + %.5 =l loadl %.4 + %.6 =l extsw 0 + %.7 =w ceql %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.394, @logic_right.393 +@logic_right.393 + %.9 =l loadl %.2 + %.10 =l extsw 0 + %.11 =l sub %.10, 9223372036854775807 + %.12 =l extsw 1 + %.13 =l sub %.11, %.12 + %.14 =w ceql %.9, %.13 + %.15 =w cnew %.14, 0 + jnz %.15, @logic_right.395, @logic_join.396 +@logic_right.395 + %.16 =l loadl %.4 + %.17 =w sub 0, 1 + %.18 =l extsw %.17 + %.19 =w ceql %.16, %.18 + %.20 =w cnew %.19, 0 +@logic_join.396 + %.21 =w phi @logic_right.393 %.15, @logic_right.395 %.20 + %.22 =w cnew %.21, 0 +@logic_join.394 + %.23 =w phi @body.389 %.8, @logic_join.396 %.22 + %.24 =w cnew %.23, 0 + jnz %.24, @cond_true.390, @cond_false.391 +@cond_true.390 + %.25 =l loadl %.2 + jmp @cond_join.392 +@cond_false.391 + %.26 =l loadl %.2 + %.27 =l loadl %.4 + %.28 =l div %.26, %.27 +@cond_join.392 + %.29 =l phi @cond_true.390 %.25, @cond_false.391 %.28 + ret %.29 +} +function l $safe_lshift_func_int64_t_s_s(l %.1, w %.3) { +@start.397 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.398 + %.5 =l loadl %.2 + %.6 =l extsw 0 + %.7 =w csltl %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.407, @logic_right.406 +@logic_right.406 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csltw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.407 + %.13 =w phi @body.398 %.8, @logic_right.406 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.405, @logic_right.404 +@logic_right.404 + %.15 =w loadsw %.4 + %.16 =w copy %.15 + %.17 =w csgew %.16, 32 + %.18 =w cnew %.17, 0 +@logic_join.405 + %.19 =w phi @logic_join.407 %.14, @logic_right.404 %.18 + %.20 =w cnew %.19, 0 + jnz %.20, @logic_join.403, @logic_right.402 +@logic_right.402 + %.21 =l loadl %.2 + %.22 =w loadsw %.4 + %.23 =w copy %.22 + %.24 =l sar 9223372036854775807, %.23 + %.25 =w csgtl %.21, %.24 + %.26 =w cnew %.25, 0 +@logic_join.403 + %.27 =w phi @logic_join.405 %.20, @logic_right.402 %.26 + %.28 =w cnew %.27, 0 + jnz %.28, @cond_true.399, @cond_false.400 +@cond_true.399 + %.29 =l loadl %.2 + jmp @cond_join.401 +@cond_false.400 + %.30 =l loadl %.2 + %.31 =w loadsw %.4 + %.32 =w copy %.31 + %.33 =l shl %.30, %.32 +@cond_join.401 + %.34 =l phi @cond_true.399 %.29, @cond_false.400 %.33 + ret %.34 +} +function l $safe_lshift_func_int64_t_s_u(l %.1, w %.3) { +@start.408 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.409 + %.5 =l loadl %.2 + %.6 =l extsw 0 + %.7 =w csltl %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.416, @logic_right.415 +@logic_right.415 + %.9 =w loaduw %.4 + %.10 =w copy %.9 + %.11 =w copy 32 + %.12 =w cugew %.10, %.11 + %.13 =w cnew %.12, 0 +@logic_join.416 + %.14 =w phi @body.409 %.8, @logic_right.415 %.13 + %.15 =w cnew %.14, 0 + jnz %.15, @logic_join.414, @logic_right.413 +@logic_right.413 + %.16 =l loadl %.2 + %.17 =w loaduw %.4 + %.18 =w copy %.17 + %.19 =l sar 9223372036854775807, %.18 + %.20 =w csgtl %.16, %.19 + %.21 =w cnew %.20, 0 +@logic_join.414 + %.22 =w phi @logic_join.416 %.15, @logic_right.413 %.21 + %.23 =w cnew %.22, 0 + jnz %.23, @cond_true.410, @cond_false.411 +@cond_true.410 + %.24 =l loadl %.2 + jmp @cond_join.412 +@cond_false.411 + %.25 =l loadl %.2 + %.26 =w loaduw %.4 + %.27 =w copy %.26 + %.28 =l shl %.25, %.27 +@cond_join.412 + %.29 =l phi @cond_true.410 %.24, @cond_false.411 %.28 + ret %.29 +} +function l $safe_rshift_func_int64_t_s_s(l %.1, w %.3) { +@start.417 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.418 + %.5 =l loadl %.2 + %.6 =l extsw 0 + %.7 =w csltl %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.425, @logic_right.424 +@logic_right.424 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csltw %.10, 0 + %.12 =w cnew %.11, 0 +@logic_join.425 + %.13 =w phi @body.418 %.8, @logic_right.424 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.423, @logic_right.422 +@logic_right.422 + %.15 =w loadsw %.4 + %.16 =w copy %.15 + %.17 =w csgew %.16, 32 + %.18 =w cnew %.17, 0 +@logic_join.423 + %.19 =w phi @logic_join.425 %.14, @logic_right.422 %.18 + %.20 =w cnew %.19, 0 + jnz %.20, @cond_true.419, @cond_false.420 +@cond_true.419 + %.21 =l loadl %.2 + jmp @cond_join.421 +@cond_false.420 + %.22 =l loadl %.2 + %.23 =w loadsw %.4 + %.24 =w copy %.23 + %.25 =l sar %.22, %.24 +@cond_join.421 + %.26 =l phi @cond_true.419 %.21, @cond_false.420 %.25 + ret %.26 +} +function l $safe_rshift_func_int64_t_s_u(l %.1, w %.3) { +@start.426 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.427 + %.5 =l loadl %.2 + %.6 =l extsw 0 + %.7 =w csltl %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.432, @logic_right.431 +@logic_right.431 + %.9 =w loaduw %.4 + %.10 =w copy %.9 + %.11 =w copy 32 + %.12 =w cugew %.10, %.11 + %.13 =w cnew %.12, 0 +@logic_join.432 + %.14 =w phi @body.427 %.8, @logic_right.431 %.13 + %.15 =w cnew %.14, 0 + jnz %.15, @cond_true.428, @cond_false.429 +@cond_true.428 + %.16 =l loadl %.2 + jmp @cond_join.430 +@cond_false.429 + %.17 =l loadl %.2 + %.18 =w loaduw %.4 + %.19 =w copy %.18 + %.20 =l sar %.17, %.19 +@cond_join.430 + %.21 =l phi @cond_true.428 %.16, @cond_false.429 %.20 + ret %.21 +} +function w $safe_unary_minus_func_uint8_t_u(w %.1) { +@start.433 + %.2 =l alloc4 1 + storeb %.1, %.2 +@body.434 + %.3 =w loadub %.2 + %.4 =w extub %.3 + %.5 =w sub 0, %.4 + %.6 =w copy %.5 + ret %.6 +} +function w $safe_add_func_uint8_t_u_u(w %.1, w %.3) { +@start.435 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.436 + %.5 =w loadub %.2 + %.6 =w loadub %.4 + %.7 =w add %.5, %.6 + ret %.7 +} +function w $safe_sub_func_uint8_t_u_u(w %.1, w %.3) { +@start.437 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.438 + %.5 =w loadub %.2 + %.6 =w loadub %.4 + %.7 =w sub %.5, %.6 + ret %.7 +} +function w $safe_mul_func_uint8_t_u_u(w %.1, w %.3) { +@start.439 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.440 + %.5 =w loadub %.2 + %.6 =w extub %.5 + %.7 =w loadub %.4 + %.8 =w extub %.7 + %.9 =w mul %.6, %.8 + %.10 =w copy %.9 + ret %.10 +} +function w $safe_mod_func_uint8_t_u_u(w %.1, w %.3) { +@start.441 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.442 + %.5 =w loadub %.4 + %.6 =w extub %.5 + %.7 =w ceqw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.443, @cond_false.444 +@cond_true.443 + %.9 =w loadub %.2 + jmp @cond_join.445 +@cond_false.444 + %.10 =w loadub %.2 + %.11 =w loadub %.4 + %.12 =w urem %.10, %.11 +@cond_join.445 + %.13 =w phi @cond_true.443 %.9, @cond_false.444 %.12 + ret %.13 +} +function w $safe_div_func_uint8_t_u_u(w %.1, w %.3) { +@start.446 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 +@body.447 + %.5 =w loadub %.4 + %.6 =w extub %.5 + %.7 =w ceqw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.448, @cond_false.449 +@cond_true.448 + %.9 =w loadub %.2 + jmp @cond_join.450 +@cond_false.449 + %.10 =w loadub %.2 + %.11 =w loadub %.4 + %.12 =w udiv %.10, %.11 +@cond_join.450 + %.13 =w phi @cond_true.448 %.9, @cond_false.449 %.12 + ret %.13 +} +function w $safe_lshift_func_uint8_t_u_s(w %.1, w %.3) { +@start.451 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.452 + %.5 =w loadsw %.4 + %.6 =w copy %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.459, @logic_right.458 +@logic_right.458 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csgew %.10, 32 + %.12 =w cnew %.11, 0 +@logic_join.459 + %.13 =w phi @body.452 %.8, @logic_right.458 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.457, @logic_right.456 +@logic_right.456 + %.15 =w loadub %.2 + %.16 =w extub %.15 + %.17 =w loadsw %.4 + %.18 =w copy %.17 + %.19 =w sar 255, %.18 + %.20 =w csgtw %.16, %.19 + %.21 =w cnew %.20, 0 +@logic_join.457 + %.22 =w phi @logic_join.459 %.14, @logic_right.456 %.21 + %.23 =w cnew %.22, 0 + jnz %.23, @cond_true.453, @cond_false.454 +@cond_true.453 + %.24 =w loadub %.2 + %.25 =w extub %.24 + jmp @cond_join.455 +@cond_false.454 + %.26 =w loadub %.2 + %.27 =w extub %.26 + %.28 =w loadsw %.4 + %.29 =w copy %.28 + %.30 =w shl %.27, %.29 +@cond_join.455 + %.31 =w phi @cond_true.453 %.25, @cond_false.454 %.30 + %.32 =w copy %.31 + ret %.32 +} +function w $safe_lshift_func_uint8_t_u_u(w %.1, w %.3) { +@start.460 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.461 + %.5 =w loaduw %.4 + %.6 =w copy %.5 + %.7 =w copy 32 + %.8 =w cugew %.6, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @logic_join.466, @logic_right.465 +@logic_right.465 + %.10 =w loadub %.2 + %.11 =w extub %.10 + %.12 =w loaduw %.4 + %.13 =w copy %.12 + %.14 =w sar 255, %.13 + %.15 =w csgtw %.11, %.14 + %.16 =w cnew %.15, 0 +@logic_join.466 + %.17 =w phi @body.461 %.9, @logic_right.465 %.16 + %.18 =w cnew %.17, 0 + jnz %.18, @cond_true.462, @cond_false.463 +@cond_true.462 + %.19 =w loadub %.2 + %.20 =w extub %.19 + jmp @cond_join.464 +@cond_false.463 + %.21 =w loadub %.2 + %.22 =w extub %.21 + %.23 =w loaduw %.4 + %.24 =w copy %.23 + %.25 =w shl %.22, %.24 +@cond_join.464 + %.26 =w phi @cond_true.462 %.20, @cond_false.463 %.25 + %.27 =w copy %.26 + ret %.27 +} +function w $safe_rshift_func_uint8_t_u_s(w %.1, w %.3) { +@start.467 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.468 + %.5 =w loadsw %.4 + %.6 =w copy %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.473, @logic_right.472 +@logic_right.472 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csgew %.10, 32 + %.12 =w cnew %.11, 0 +@logic_join.473 + %.13 =w phi @body.468 %.8, @logic_right.472 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @cond_true.469, @cond_false.470 +@cond_true.469 + %.15 =w loadub %.2 + %.16 =w extub %.15 + jmp @cond_join.471 +@cond_false.470 + %.17 =w loadub %.2 + %.18 =w extub %.17 + %.19 =w loadsw %.4 + %.20 =w copy %.19 + %.21 =w sar %.18, %.20 +@cond_join.471 + %.22 =w phi @cond_true.469 %.16, @cond_false.470 %.21 + %.23 =w copy %.22 + ret %.23 +} +function w $safe_rshift_func_uint8_t_u_u(w %.1, w %.3) { +@start.474 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.475 + %.5 =w loaduw %.4 + %.6 =w copy %.5 + %.7 =w copy 32 + %.8 =w cugew %.6, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @cond_true.476, @cond_false.477 +@cond_true.476 + %.10 =w loadub %.2 + %.11 =w extub %.10 + jmp @cond_join.478 +@cond_false.477 + %.12 =w loadub %.2 + %.13 =w extub %.12 + %.14 =w loaduw %.4 + %.15 =w copy %.14 + %.16 =w sar %.13, %.15 +@cond_join.478 + %.17 =w phi @cond_true.476 %.11, @cond_false.477 %.16 + %.18 =w copy %.17 + ret %.18 +} +function w $safe_unary_minus_func_uint16_t_u(w %.1) { +@start.479 + %.2 =l alloc4 2 + storeh %.1, %.2 +@body.480 + %.3 =w loaduh %.2 + %.4 =w extuh %.3 + %.5 =w sub 0, %.4 + %.6 =w copy %.5 + ret %.6 +} +function w $safe_add_func_uint16_t_u_u(w %.1, w %.3) { +@start.481 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.482 + %.5 =w loaduh %.2 + %.6 =w loaduh %.4 + %.7 =w add %.5, %.6 + ret %.7 +} +function w $safe_sub_func_uint16_t_u_u(w %.1, w %.3) { +@start.483 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.484 + %.5 =w loaduh %.2 + %.6 =w loaduh %.4 + %.7 =w sub %.5, %.6 + ret %.7 +} +function w $safe_mul_func_uint16_t_u_u(w %.1, w %.3) { +@start.485 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.486 + %.5 =w loaduh %.2 + %.6 =w extuh %.5 + %.7 =w loaduh %.4 + %.8 =w extuh %.7 + %.9 =w mul %.6, %.8 + %.10 =w copy %.9 + ret %.10 +} +function w $safe_mod_func_uint16_t_u_u(w %.1, w %.3) { +@start.487 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.488 + %.5 =w loaduh %.4 + %.6 =w extuh %.5 + %.7 =w ceqw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.489, @cond_false.490 +@cond_true.489 + %.9 =w loaduh %.2 + jmp @cond_join.491 +@cond_false.490 + %.10 =w loaduh %.2 + %.11 =w loaduh %.4 + %.12 =w urem %.10, %.11 +@cond_join.491 + %.13 =w phi @cond_true.489 %.9, @cond_false.490 %.12 + ret %.13 +} +function w $safe_div_func_uint16_t_u_u(w %.1, w %.3) { +@start.492 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 +@body.493 + %.5 =w loaduh %.4 + %.6 =w extuh %.5 + %.7 =w ceqw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.494, @cond_false.495 +@cond_true.494 + %.9 =w loaduh %.2 + jmp @cond_join.496 +@cond_false.495 + %.10 =w loaduh %.2 + %.11 =w loaduh %.4 + %.12 =w udiv %.10, %.11 +@cond_join.496 + %.13 =w phi @cond_true.494 %.9, @cond_false.495 %.12 + ret %.13 +} +function w $safe_lshift_func_uint16_t_u_s(w %.1, w %.3) { +@start.497 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.498 + %.5 =w loadsw %.4 + %.6 =w copy %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.505, @logic_right.504 +@logic_right.504 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csgew %.10, 32 + %.12 =w cnew %.11, 0 +@logic_join.505 + %.13 =w phi @body.498 %.8, @logic_right.504 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.503, @logic_right.502 +@logic_right.502 + %.15 =w loaduh %.2 + %.16 =w extuh %.15 + %.17 =w loadsw %.4 + %.18 =w copy %.17 + %.19 =w sar 65535, %.18 + %.20 =w csgtw %.16, %.19 + %.21 =w cnew %.20, 0 +@logic_join.503 + %.22 =w phi @logic_join.505 %.14, @logic_right.502 %.21 + %.23 =w cnew %.22, 0 + jnz %.23, @cond_true.499, @cond_false.500 +@cond_true.499 + %.24 =w loaduh %.2 + %.25 =w extuh %.24 + jmp @cond_join.501 +@cond_false.500 + %.26 =w loaduh %.2 + %.27 =w extuh %.26 + %.28 =w loadsw %.4 + %.29 =w copy %.28 + %.30 =w shl %.27, %.29 +@cond_join.501 + %.31 =w phi @cond_true.499 %.25, @cond_false.500 %.30 + %.32 =w copy %.31 + ret %.32 +} +function w $safe_lshift_func_uint16_t_u_u(w %.1, w %.3) { +@start.506 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.507 + %.5 =w loaduw %.4 + %.6 =w copy %.5 + %.7 =w copy 32 + %.8 =w cugew %.6, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @logic_join.512, @logic_right.511 +@logic_right.511 + %.10 =w loaduh %.2 + %.11 =w extuh %.10 + %.12 =w loaduw %.4 + %.13 =w copy %.12 + %.14 =w sar 65535, %.13 + %.15 =w csgtw %.11, %.14 + %.16 =w cnew %.15, 0 +@logic_join.512 + %.17 =w phi @body.507 %.9, @logic_right.511 %.16 + %.18 =w cnew %.17, 0 + jnz %.18, @cond_true.508, @cond_false.509 +@cond_true.508 + %.19 =w loaduh %.2 + %.20 =w extuh %.19 + jmp @cond_join.510 +@cond_false.509 + %.21 =w loaduh %.2 + %.22 =w extuh %.21 + %.23 =w loaduw %.4 + %.24 =w copy %.23 + %.25 =w shl %.22, %.24 +@cond_join.510 + %.26 =w phi @cond_true.508 %.20, @cond_false.509 %.25 + %.27 =w copy %.26 + ret %.27 +} +function w $safe_rshift_func_uint16_t_u_s(w %.1, w %.3) { +@start.513 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.514 + %.5 =w loadsw %.4 + %.6 =w copy %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.519, @logic_right.518 +@logic_right.518 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csgew %.10, 32 + %.12 =w cnew %.11, 0 +@logic_join.519 + %.13 =w phi @body.514 %.8, @logic_right.518 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @cond_true.515, @cond_false.516 +@cond_true.515 + %.15 =w loaduh %.2 + %.16 =w extuh %.15 + jmp @cond_join.517 +@cond_false.516 + %.17 =w loaduh %.2 + %.18 =w extuh %.17 + %.19 =w loadsw %.4 + %.20 =w copy %.19 + %.21 =w sar %.18, %.20 +@cond_join.517 + %.22 =w phi @cond_true.515 %.16, @cond_false.516 %.21 + %.23 =w copy %.22 + ret %.23 +} +function w $safe_rshift_func_uint16_t_u_u(w %.1, w %.3) { +@start.520 + %.2 =l alloc4 2 + storeh %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.521 + %.5 =w loaduw %.4 + %.6 =w copy %.5 + %.7 =w copy 32 + %.8 =w cugew %.6, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @cond_true.522, @cond_false.523 +@cond_true.522 + %.10 =w loaduh %.2 + %.11 =w extuh %.10 + jmp @cond_join.524 +@cond_false.523 + %.12 =w loaduh %.2 + %.13 =w extuh %.12 + %.14 =w loaduw %.4 + %.15 =w copy %.14 + %.16 =w sar %.13, %.15 +@cond_join.524 + %.17 =w phi @cond_true.522 %.11, @cond_false.523 %.16 + %.18 =w copy %.17 + ret %.18 +} +function w $safe_unary_minus_func_uint32_t_u(w %.1) { +@start.525 + %.2 =l alloc4 4 + storew %.1, %.2 +@body.526 + %.3 =w copy 0 + %.4 =w loaduw %.2 + %.5 =w sub %.3, %.4 + ret %.5 +} +function w $safe_add_func_uint32_t_u_u(w %.1, w %.3) { +@start.527 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.528 + %.5 =w loaduw %.2 + %.6 =w loaduw %.4 + %.7 =w add %.5, %.6 + ret %.7 +} +function w $safe_sub_func_uint32_t_u_u(w %.1, w %.3) { +@start.529 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.530 + %.5 =w loaduw %.2 + %.6 =w loaduw %.4 + %.7 =w sub %.5, %.6 + ret %.7 +} +function w $safe_mul_func_uint32_t_u_u(w %.1, w %.3) { +@start.531 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.532 + %.5 =w loaduw %.2 + %.6 =w copy %.5 + %.7 =w loaduw %.4 + %.8 =w copy %.7 + %.9 =w mul %.6, %.8 + ret %.9 +} +function w $safe_mod_func_uint32_t_u_u(w %.1, w %.3) { +@start.533 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.534 + %.5 =w loaduw %.4 + %.6 =w copy 0 + %.7 =w ceqw %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.535, @cond_false.536 +@cond_true.535 + %.9 =w loaduw %.2 + jmp @cond_join.537 +@cond_false.536 + %.10 =w loaduw %.2 + %.11 =w loaduw %.4 + %.12 =w urem %.10, %.11 +@cond_join.537 + %.13 =w phi @cond_true.535 %.9, @cond_false.536 %.12 + ret %.13 +} +function w $safe_div_func_uint32_t_u_u(w %.1, w %.3) { +@start.538 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.539 + %.5 =w loaduw %.4 + %.6 =w copy 0 + %.7 =w ceqw %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.540, @cond_false.541 +@cond_true.540 + %.9 =w loaduw %.2 + jmp @cond_join.542 +@cond_false.541 + %.10 =w loaduw %.2 + %.11 =w loaduw %.4 + %.12 =w udiv %.10, %.11 +@cond_join.542 + %.13 =w phi @cond_true.540 %.9, @cond_false.541 %.12 + ret %.13 +} +function w $safe_lshift_func_uint32_t_u_s(w %.1, w %.3) { +@start.543 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.544 + %.5 =w loadsw %.4 + %.6 =w copy %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.551, @logic_right.550 +@logic_right.550 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csgew %.10, 32 + %.12 =w cnew %.11, 0 +@logic_join.551 + %.13 =w phi @body.544 %.8, @logic_right.550 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.549, @logic_right.548 +@logic_right.548 + %.15 =w loaduw %.2 + %.16 =w loadsw %.4 + %.17 =w copy %.16 + %.18 =w shr 4294967295, %.17 + %.19 =w cugtw %.15, %.18 + %.20 =w cnew %.19, 0 +@logic_join.549 + %.21 =w phi @logic_join.551 %.14, @logic_right.548 %.20 + %.22 =w cnew %.21, 0 + jnz %.22, @cond_true.545, @cond_false.546 +@cond_true.545 + %.23 =w loaduw %.2 + jmp @cond_join.547 +@cond_false.546 + %.24 =w loaduw %.2 + %.25 =w loadsw %.4 + %.26 =w copy %.25 + %.27 =w shl %.24, %.26 +@cond_join.547 + %.28 =w phi @cond_true.545 %.23, @cond_false.546 %.27 + ret %.28 +} +function w $safe_lshift_func_uint32_t_u_u(w %.1, w %.3) { +@start.552 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.553 + %.5 =w loaduw %.4 + %.6 =w copy %.5 + %.7 =w copy 32 + %.8 =w cugew %.6, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @logic_join.558, @logic_right.557 +@logic_right.557 + %.10 =w loaduw %.2 + %.11 =w loaduw %.4 + %.12 =w copy %.11 + %.13 =w shr 4294967295, %.12 + %.14 =w cugtw %.10, %.13 + %.15 =w cnew %.14, 0 +@logic_join.558 + %.16 =w phi @body.553 %.9, @logic_right.557 %.15 + %.17 =w cnew %.16, 0 + jnz %.17, @cond_true.554, @cond_false.555 +@cond_true.554 + %.18 =w loaduw %.2 + jmp @cond_join.556 +@cond_false.555 + %.19 =w loaduw %.2 + %.20 =w loaduw %.4 + %.21 =w copy %.20 + %.22 =w shl %.19, %.21 +@cond_join.556 + %.23 =w phi @cond_true.554 %.18, @cond_false.555 %.22 + ret %.23 +} +function w $safe_rshift_func_uint32_t_u_s(w %.1, w %.3) { +@start.559 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.560 + %.5 =w loadsw %.4 + %.6 =w copy %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.565, @logic_right.564 +@logic_right.564 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csgew %.10, 32 + %.12 =w cnew %.11, 0 +@logic_join.565 + %.13 =w phi @body.560 %.8, @logic_right.564 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @cond_true.561, @cond_false.562 +@cond_true.561 + %.15 =w loaduw %.2 + jmp @cond_join.563 +@cond_false.562 + %.16 =w loaduw %.2 + %.17 =w loadsw %.4 + %.18 =w copy %.17 + %.19 =w shr %.16, %.18 +@cond_join.563 + %.20 =w phi @cond_true.561 %.15, @cond_false.562 %.19 + ret %.20 +} +function w $safe_rshift_func_uint32_t_u_u(w %.1, w %.3) { +@start.566 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.567 + %.5 =w loaduw %.4 + %.6 =w copy %.5 + %.7 =w copy 32 + %.8 =w cugew %.6, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @cond_true.568, @cond_false.569 +@cond_true.568 + %.10 =w loaduw %.2 + jmp @cond_join.570 +@cond_false.569 + %.11 =w loaduw %.2 + %.12 =w loaduw %.4 + %.13 =w copy %.12 + %.14 =w shr %.11, %.13 +@cond_join.570 + %.15 =w phi @cond_true.568 %.10, @cond_false.569 %.14 + ret %.15 +} +function l $safe_unary_minus_func_uint64_t_u(l %.1) { +@start.571 + %.2 =l alloc8 8 + storel %.1, %.2 +@body.572 + %.3 =l extsw 0 + %.4 =l loadl %.2 + %.5 =l sub %.3, %.4 + ret %.5 +} +function l $safe_add_func_uint64_t_u_u(l %.1, l %.3) { +@start.573 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.574 + %.5 =l loadl %.2 + %.6 =l loadl %.4 + %.7 =l add %.5, %.6 + ret %.7 +} +function l $safe_sub_func_uint64_t_u_u(l %.1, l %.3) { +@start.575 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.576 + %.5 =l loadl %.2 + %.6 =l loadl %.4 + %.7 =l sub %.5, %.6 + ret %.7 +} +function l $safe_mul_func_uint64_t_u_u(l %.1, l %.3) { +@start.577 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.578 + %.5 =l loadl %.2 + %.6 =l copy %.5 + %.7 =l loadl %.4 + %.8 =l copy %.7 + %.9 =l mul %.6, %.8 + ret %.9 +} +function l $safe_mod_func_uint64_t_u_u(l %.1, l %.3) { +@start.579 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.580 + %.5 =l loadl %.4 + %.6 =l extsw 0 + %.7 =w ceql %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.581, @cond_false.582 +@cond_true.581 + %.9 =l loadl %.2 + jmp @cond_join.583 +@cond_false.582 + %.10 =l loadl %.2 + %.11 =l loadl %.4 + %.12 =l urem %.10, %.11 +@cond_join.583 + %.13 =l phi @cond_true.581 %.9, @cond_false.582 %.12 + ret %.13 +} +function l $safe_div_func_uint64_t_u_u(l %.1, l %.3) { +@start.584 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 +@body.585 + %.5 =l loadl %.4 + %.6 =l extsw 0 + %.7 =w ceql %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.586, @cond_false.587 +@cond_true.586 + %.9 =l loadl %.2 + jmp @cond_join.588 +@cond_false.587 + %.10 =l loadl %.2 + %.11 =l loadl %.4 + %.12 =l udiv %.10, %.11 +@cond_join.588 + %.13 =l phi @cond_true.586 %.9, @cond_false.587 %.12 + ret %.13 +} +function l $safe_lshift_func_uint64_t_u_s(l %.1, w %.3) { +@start.589 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.590 + %.5 =w loadsw %.4 + %.6 =w copy %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.597, @logic_right.596 +@logic_right.596 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csgew %.10, 32 + %.12 =w cnew %.11, 0 +@logic_join.597 + %.13 =w phi @body.590 %.8, @logic_right.596 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @logic_join.595, @logic_right.594 +@logic_right.594 + %.15 =l loadl %.2 + %.16 =w loadsw %.4 + %.17 =w copy %.16 + %.18 =l shr 18446744073709551615, %.17 + %.19 =w cugtl %.15, %.18 + %.20 =w cnew %.19, 0 +@logic_join.595 + %.21 =w phi @logic_join.597 %.14, @logic_right.594 %.20 + %.22 =w cnew %.21, 0 + jnz %.22, @cond_true.591, @cond_false.592 +@cond_true.591 + %.23 =l loadl %.2 + jmp @cond_join.593 +@cond_false.592 + %.24 =l loadl %.2 + %.25 =w loadsw %.4 + %.26 =w copy %.25 + %.27 =l shl %.24, %.26 +@cond_join.593 + %.28 =l phi @cond_true.591 %.23, @cond_false.592 %.27 + ret %.28 +} +function l $safe_lshift_func_uint64_t_u_u(l %.1, w %.3) { +@start.598 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.599 + %.5 =w loaduw %.4 + %.6 =w copy %.5 + %.7 =w copy 32 + %.8 =w cugew %.6, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @logic_join.604, @logic_right.603 +@logic_right.603 + %.10 =l loadl %.2 + %.11 =w loaduw %.4 + %.12 =w copy %.11 + %.13 =l shr 18446744073709551615, %.12 + %.14 =w cugtl %.10, %.13 + %.15 =w cnew %.14, 0 +@logic_join.604 + %.16 =w phi @body.599 %.9, @logic_right.603 %.15 + %.17 =w cnew %.16, 0 + jnz %.17, @cond_true.600, @cond_false.601 +@cond_true.600 + %.18 =l loadl %.2 + jmp @cond_join.602 +@cond_false.601 + %.19 =l loadl %.2 + %.20 =w loaduw %.4 + %.21 =w copy %.20 + %.22 =l shl %.19, %.21 +@cond_join.602 + %.23 =l phi @cond_true.600 %.18, @cond_false.601 %.22 + ret %.23 +} +function l $safe_rshift_func_uint64_t_u_s(l %.1, w %.3) { +@start.605 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.606 + %.5 =w loadsw %.4 + %.6 =w copy %.5 + %.7 =w csltw %.6, 0 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.611, @logic_right.610 +@logic_right.610 + %.9 =w loadsw %.4 + %.10 =w copy %.9 + %.11 =w csgew %.10, 32 + %.12 =w cnew %.11, 0 +@logic_join.611 + %.13 =w phi @body.606 %.8, @logic_right.610 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @cond_true.607, @cond_false.608 +@cond_true.607 + %.15 =l loadl %.2 + jmp @cond_join.609 +@cond_false.608 + %.16 =l loadl %.2 + %.17 =w loadsw %.4 + %.18 =w copy %.17 + %.19 =l shr %.16, %.18 +@cond_join.609 + %.20 =l phi @cond_true.607 %.15, @cond_false.608 %.19 + ret %.20 +} +function l $safe_rshift_func_uint64_t_u_u(l %.1, w %.3) { +@start.612 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.613 + %.5 =w loaduw %.4 + %.6 =w copy %.5 + %.7 =w copy 32 + %.8 =w cugew %.6, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @cond_true.614, @cond_false.615 +@cond_true.614 + %.10 =l loadl %.2 + jmp @cond_join.616 +@cond_false.615 + %.11 =l loadl %.2 + %.12 =w loaduw %.4 + %.13 =w copy %.12 + %.14 =l shr %.11, %.13 +@cond_join.616 + %.15 =l phi @cond_true.614 %.10, @cond_false.615 %.14 + ret %.15 +} +function s $safe_add_func_float_f_f(s %.1, s %.3) { +@start.617 + %.2 =l alloc4 4 + stores %.1, %.2 + %.4 =l alloc4 4 + stores %.3, %.4 +@body.618 + %.5 =s swtof 0 + %.6 =s mul s_0x1p-1, s_0x1.fffffe091ff3dp+127 + %.7 =w cgts %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.619, @cond_false.620 +@cond_true.619 + %.9 =s loads %.2 + jmp @cond_join.621 +@cond_false.620 + %.10 =s loads %.2 + %.11 =s loads %.4 + %.12 =s add %.10, %.11 +@cond_join.621 + %.13 =s phi @cond_true.619 %.9, @cond_false.620 %.12 + ret %.13 +} +function s $safe_sub_func_float_f_f(s %.1, s %.3) { +@start.622 + %.2 =l alloc4 4 + stores %.1, %.2 + %.4 =l alloc4 4 + stores %.3, %.4 +@body.623 + %.5 =s swtof 0 + %.6 =s mul s_0x1p-1, s_0x1.fffffe091ff3dp+127 + %.7 =w cgts %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.624, @cond_false.625 +@cond_true.624 + %.9 =s loads %.2 + jmp @cond_join.626 +@cond_false.625 + %.10 =s loads %.2 + %.11 =s loads %.4 + %.12 =s sub %.10, %.11 +@cond_join.626 + %.13 =s phi @cond_true.624 %.9, @cond_false.625 %.12 + ret %.13 +} +function s $safe_mul_func_float_f_f(s %.1, s %.3) { +@start.627 + %.2 =l alloc4 4 + stores %.1, %.2 + %.4 =l alloc4 4 + stores %.3, %.4 +@body.628 + %.5 =s swtof 0 + %.6 =s mul s_0x1p-28, s_0x1.fffffe091ff3dp+127 + %.7 =s mul s_0x1p-100, %.6 + %.8 =w cgts %.5, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @cond_true.629, @cond_false.630 +@cond_true.629 + %.10 =s loads %.2 + jmp @cond_join.631 +@cond_false.630 + %.11 =s loads %.2 + %.12 =s loads %.4 + %.13 =s mul %.11, %.12 +@cond_join.631 + %.14 =s phi @cond_true.629 %.10, @cond_false.630 %.13 + ret %.14 +} +function s $safe_div_func_float_f_f(s %.1, s %.3) { +@start.632 + %.2 =l alloc4 4 + stores %.1, %.2 + %.4 =l alloc4 4 + stores %.3, %.4 +@body.633 + %.5 =s swtof 0 + %.6 =w clts %.5, s_0x1p+0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_right.637, @logic_join.638 +@logic_right.637 + %.8 =s loads %.4 + %.9 =w ceqs %.8, s_0x0p+0 + %.10 =w cnew %.9, 0 + jnz %.10, @logic_join.640, @logic_right.639 +@logic_right.639 + %.11 =s swtof 0 + %.12 =s mul s_0x1p-49, s_0x1.fffffe091ff3dp+127 + %.13 =s mul s_0x1p-100, %.12 + %.14 =w cgts %.11, %.13 + %.15 =w cnew %.14, 0 +@logic_join.640 + %.16 =w phi @logic_right.637 %.10, @logic_right.639 %.15 + %.17 =w cnew %.16, 0 +@logic_join.638 + %.18 =w phi @body.633 %.7, @logic_join.640 %.17 + %.19 =w cnew %.18, 0 + jnz %.19, @cond_true.634, @cond_false.635 +@cond_true.634 + %.20 =s loads %.2 + jmp @cond_join.636 +@cond_false.635 + %.21 =s loads %.2 + %.22 =s loads %.4 + %.23 =s div %.21, %.22 +@cond_join.636 + %.24 =s phi @cond_true.634 %.20, @cond_false.635 %.23 + ret %.24 +} +function d $safe_add_func_double_f_f(d %.1, d %.3) { +@start.641 + %.2 =l alloc8 8 + stored %.1, %.2 + %.4 =l alloc8 8 + stored %.3, %.4 +@body.642 + %.5 =d swtof 0 + %.6 =d mul d_0x1p-1, d_0x1.fffffffffffffp+1023 + %.7 =w cgtd %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.643, @cond_false.644 +@cond_true.643 + %.9 =d loadd %.2 + jmp @cond_join.645 +@cond_false.644 + %.10 =d loadd %.2 + %.11 =d loadd %.4 + %.12 =d add %.10, %.11 +@cond_join.645 + %.13 =d phi @cond_true.643 %.9, @cond_false.644 %.12 + ret %.13 +} +function d $safe_sub_func_double_f_f(d %.1, d %.3) { +@start.646 + %.2 =l alloc8 8 + stored %.1, %.2 + %.4 =l alloc8 8 + stored %.3, %.4 +@body.647 + %.5 =d swtof 0 + %.6 =d mul d_0x1p-1, d_0x1.fffffffffffffp+1023 + %.7 =w cgtd %.5, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @cond_true.648, @cond_false.649 +@cond_true.648 + %.9 =d loadd %.2 + jmp @cond_join.650 +@cond_false.649 + %.10 =d loadd %.2 + %.11 =d loadd %.4 + %.12 =d sub %.10, %.11 +@cond_join.650 + %.13 =d phi @cond_true.648 %.9, @cond_false.649 %.12 + ret %.13 +} +function d $safe_mul_func_double_f_f(d %.1, d %.3) { +@start.651 + %.2 =l alloc8 8 + stored %.1, %.2 + %.4 =l alloc8 8 + stored %.3, %.4 +@body.652 + %.5 =d swtof 0 + %.6 =d mul d_0x1p-924, d_0x1.fffffffffffffp+1023 + %.7 =d mul d_0x1p-100, %.6 + %.8 =w cgtd %.5, %.7 + %.9 =w cnew %.8, 0 + jnz %.9, @cond_true.653, @cond_false.654 +@cond_true.653 + %.10 =d loadd %.2 + jmp @cond_join.655 +@cond_false.654 + %.11 =d loadd %.2 + %.12 =d loadd %.4 + %.13 =d mul %.11, %.12 +@cond_join.655 + %.14 =d phi @cond_true.653 %.10, @cond_false.654 %.13 + ret %.14 +} +function d $safe_div_func_double_f_f(d %.1, d %.3) { +@start.656 + %.2 =l alloc8 8 + stored %.1, %.2 + %.4 =l alloc8 8 + stored %.3, %.4 +@body.657 + %.5 =d swtof 0 + %.6 =w cltd %.5, d_0x1p+0 + %.7 =w cnew %.6, 0 + jnz %.7, @logic_right.661, @logic_join.662 +@logic_right.661 + %.8 =d loadd %.4 + %.9 =w ceqd %.8, d_0x0p+0 + %.10 =w cnew %.9, 0 + jnz %.10, @logic_join.664, @logic_right.663 +@logic_right.663 + %.11 =d swtof 0 + %.12 =d mul d_0x1p-974, d_0x1.fffffffffffffp+1023 + %.13 =d mul d_0x1p-100, %.12 + %.14 =w cgtd %.11, %.13 + %.15 =w cnew %.14, 0 +@logic_join.664 + %.16 =w phi @logic_right.661 %.10, @logic_right.663 %.15 + %.17 =w cnew %.16, 0 +@logic_join.662 + %.18 =w phi @body.657 %.7, @logic_join.664 %.17 + %.19 =w cnew %.18, 0 + jnz %.19, @cond_true.658, @cond_false.659 +@cond_true.658 + %.20 =d loadd %.2 + jmp @cond_join.660 +@cond_false.659 + %.21 =d loadd %.2 + %.22 =d loadd %.4 + %.23 =d div %.21, %.22 +@cond_join.660 + %.24 =d phi @cond_true.658 %.20, @cond_false.659 %.23 + ret %.24 +} +function w $safe_convert_func_float_to_int32_t(s %.1) { +@start.665 + %.2 =l alloc4 4 + stores %.1, %.2 +@body.666 + %.3 =s loads %.2 + %.4 =w sub 0, 2147483647 + %.5 =w sub %.4, 1 + %.6 =s swtof %.5 + %.7 =w cles %.3, %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @logic_join.671, @logic_right.670 +@logic_right.670 + %.9 =s loads %.2 + %.10 =s swtof 2147483647 + %.11 =w cges %.9, %.10 + %.12 =w cnew %.11, 0 +@logic_join.671 + %.13 =w phi @body.666 %.8, @logic_right.670 %.12 + %.14 =w cnew %.13, 0 + jnz %.14, @cond_true.667, @cond_false.668 +@cond_true.667 + jmp @cond_join.669 +@cond_false.668 + %.15 =s loads %.2 + %.16 =w stosi %.15 +@cond_join.669 + %.17 =w phi @cond_true.667 2147483647, @cond_false.668 %.16 + ret %.17 +} +function $platform_main_begin() { +@start.672 +@body.673 + ret +} +function $crc32_gentab() { +@start.674 +@body.675 + ret +} +data $.Lstring.93 = align 1 { b "%s %d\012", z 1, } +function $transparent_crc(l %.1, l %.3, w %.5) { +@start.676 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 + %.6 =l alloc4 4 + storew %.5, %.6 +@body.677 + %.7 =w loadsw %.6 + %.8 =w cnew %.7, 0 + jnz %.8, @if_true.678, @if_false.679 +@if_true.678 + %.9 =l copy $.Lstring.93 + %.10 =l loadl %.4 + %.11 =l loadl %.2 + %.12 =w call $printf(l %.9, l %.10, l %.11, ...) +@if_false.679 + %.13 =l loadl $crc32_context + %.14 =l loadl %.2 + %.15 =l add %.13, %.14 + storel %.15, $crc32_context + ret +} +data $.Lstring.95 = align 1 { b "...checksum after hashing %s : %lX\012", z 1, } +function $transparent_crc_bytes(l %.1, w %.3, l %.5, w %.7) { +@start.680 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 + %.6 =l alloc8 8 + storel %.5, %.6 + %.8 =l alloc4 4 + storew %.7, %.8 + %.9 =l alloc4 4 +@body.681 + storew 0, %.9 +@for_cond.682 + %.10 =w loadsw %.9 + %.11 =w loadsw %.4 + %.12 =w csltw %.10, %.11 + jnz %.12, @for_body.683, @for_join.685 +@for_body.683 + %.13 =l loadl $crc32_context + %.14 =l loadl %.2 + %.15 =w loadsw %.9 + %.16 =l extsw %.15 + %.17 =l mul %.16, 1 + %.18 =l add %.14, %.17 + %.19 =w loadsb %.18 + %.20 =l extsb %.19 + %.21 =l add %.13, %.20 + storel %.21, $crc32_context +@for_cont.684 + %.22 =w loadsw %.9 + %.23 =w add %.22, 1 + storew %.23, %.9 + jmp @for_cond.682 +@for_join.685 + %.24 =w loadsw %.8 + %.25 =w cnew %.24, 0 + jnz %.25, @if_true.686, @if_false.687 +@if_true.686 + %.26 =l copy $.Lstring.95 + %.27 =l loadl %.6 + %.28 =l loadl $crc32_context + %.29 =l copy 4294967295 + %.30 =l xor %.28, %.29 + %.31 =w call $printf(l %.26, l %.27, l %.30, ...) +@if_false.687 + ret +} +data $.Lstring.97 = align 1 { b "checksum = %llx\012", z 1, } +function $platform_main_end(l %.1, w %.3) { +@start.688 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 +@body.689 + %.5 =w loadsw %.4 + %.6 =w ceqw %.5, 0 + %.7 =w cnew %.6, 0 + jnz %.7, @if_true.690, @if_false.691 +@if_true.690 + %.8 =l copy $.Lstring.97 + %.9 =l loadl %.2 + %.10 =w call $printf(l %.8, l %.9, ...) +@if_false.691 + ret +} +data $g_2 = align 1 { b 215, } +data $g_13 = align 4 { w 18446744073709551612, w 3113531208, w 447237310, w 657824592, w 447237310, w 3113531208, w 18446744073709551612, w 0, w 3145062956, w 1458304211, w 1458304211, w 3145062956, w 0, w 18446744073709551612, w 3113531208, w 447237310, w 657824592, w 447237310, w 3113531208, w 18446744073709551612, w 0, w 3145062956, w 1458304211, w 1458304211, w 3145062956, w 0, w 18446744073709551612, } +data $g_24 = align 4 { w 18446744073709551613, } +data $g_23 = align 8 { l $g_24, } +data $g_38 = align 8 { l 0, } +data $g_46 = align 1 { b 0, } +data $g_50 = align 4 { w 1, } +data $g_57 = align 1 { b 224, } +data $g_58 = align 8 { l 8, } +data $g_80 = align 8 { l 1104779632179292239, } +data $g_81 = align 2 { h 18446744073709551615, } +data $g_82 = align 8 { l 17444925578407733218, } +data $g_84 = align 4 { w 1166649911, } +data $g_88 = align 8 { l $g_38, } +data $g_115 = align 4 { w 18446744073709551613, } +data $g_130 = align 4 { w 18446744073709551607, w 0, h 5458, z 2, w 0, w 397636938, } +data $g_132 = align 1 { b 65, b 65, b 65, b 65, b 65, b 65, } +data $g_173 = align 8 { l $g_130 + 0, } +data $g_172 = align 8 { l $g_173, l $g_173, } +data $g_185 = align 8 { b 1, z 7, l 1, w 4071577471, z 4, l 1, w 3048012705, w 1, w 1, w 1, w 18446744073709551615, z 4 } +data $g_201 = align 8 { l $g_185, } +data $g_265 = align 8 { b 0, z 7, l 9646574861175543734, w 3690576639, z 4, l 18446744073709551615, w 4294967292, w 2450216573, w 18446744073709551612, w 1636002719, w 1518760778, z 4 } +data $g_296 = align 8 { l $g_201, } +data $g_364 = align 8 { l $g_185 + 0, l $g_185 + 0, l $g_185 + 0, l $g_185 + 0, l $g_185 + 0, l $g_185 + 0, l $g_185 + 0, l $g_185 + 0, } +data $g_363 = align 8 { l $g_364 + 48, } +data $g_394 = align 8 { l 0, } +data $g_399 = align 8 { l 1, } +data $g_422 = align 8 { l $g_265 + 32, } +data $g_425 = align 2 { h 22013, } +data $g_477 = align 8 { l 5223132716906150842, } +data $g_518 = align 8 { b 255, z 7, l 17526030672371278218, w 1, z 4, l 13446109256110216392, w 2, w 18446744073709551610, w 0, w 8, w 1038833289, z 4 } +data $g_566 = align 1 { b 9, } +data $g_619 = align 2 { h 65535, } +data $g_629 = align 1 { b 1, } +data $g_631 = align 1 { b 70, } +data $g_634 = align 8 { l 0, } +data $g_662 = align 8 { l 0, } +data $g_776 = align 8 { l 0, } +data $g_775 = align 8 { l $g_776, l $g_776, l $g_776, l $g_776, l $g_776, } +data $g_794 = align 4 { w 1906903063, w 6, h 0, z 2, w 2863962639, w 3301065942, } +data $g_850 = align 8 { l 0, l 0, } +data $g_858 = align 2 { h 7, } +data $g_937 = align 1 { b 4, } +data $g_1018 = align 4 { w 0, } +data $g_1038 = align 8 { l $g_422, } +data $g_1037 = align 8 { l $g_1038, } +data $g_1070 = align 8 { l $g_662, } +data $g_1069 = align 8 { l $g_1070, } +data $g_1123 = align 8 { l $g_794, } +data $g_1130 = align 1 { b 250, } +data $g_1183 = align 8 { b 254, z 7, l 5, w 2966657800, z 4, l 3, w 1, w 1125518946, w 1, w 18446744073709551615, w 18446744073709551615, z 4 } +data $g_1269 = align 8 { l $g_296, } +data $g_1298 = align 4 { w 489894291, } +data $g_1313 = align 8 { l $g_1037, } +data $g_1393 = align 4 { w 4294967294, } +data $g_1476 = align 8 { l 0, } +data $g_1590 = align 8 { l $g_619, } +data $g_1589 = align 8 { l $g_1590, } +data $g_1604 = align 8 { l 18446744073709551615, } +data $g_1616 = align 8 { l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, l $g_1476, } +data $g_1615 = align 8 { l 0, l 0, l 0, l 0, l 0, } +data $g_1617 = align 2 { h 65528, } +data $g_1645 = align 4 { w 218946655, } +data $g_1706 = align 8 { l 0, } +data $g_1705 = align 8 { l $g_1706, } +data $g_1752 = align 8 { l 0, } +data $g_1922 = align 2 { h 18773, } +data $g_1972 = align 8 { l 1, } +data $g_1984 = align 8 { l $g_1269, } +data $g_1983 = align 8 { l $g_1984, } +data $g_2013 = align 4 { w 2920810850, } +data $g_2028 = align 8 { l 0, } +data $g_2102 = align 2 { h 0, } +data $g_2127 = align 8 { l $g_394, } +function l $func_1() { +@start.692 + %.1 =l alloc8 8 + %.7 =l alloc8 8 + %.9 =l alloc8 8 + %.11 =l alloc8 8 + %.13 =l alloc8 8 + %.15 =l alloc4 40 + %.50 =l alloc4 8 + %.51 =l alloc4 4 + %.52 =l alloc4 4 + %.55 =l alloc8 8 + %.58 =l alloc4 2 + %.61 =l alloc4 4 + %.64 =l alloc8 8 + %.68 =l alloc8 8 + %.70 =l alloc4 8 + %.71 =l alloc8 64 + %.80 =l alloc4 4 + %.83 =l alloc8 8 + %.85 =l alloc4 4 + %.88 =l alloc4 20 + %.100 =l alloc8 8 + %.104 =l alloc8 8 + %.106 =l alloc4 2 + %.109 =l alloc4 1 + %.112 =l alloc4 4 + %.113 =l alloc4 4 + %.154 =l alloc4 24 + %.167 =l alloc8 8 + %.173 =l alloc8 8 + %.175 =l alloc4 4 + %.178 =l alloc4 4 + %.181 =l alloc4 4 + %.184 =l alloc4 4 + %.185 =l alloc8 240 + %.241 =l alloc4 4 + %.244 =l alloc4 32 + %.261 =l alloc4 2 + %.264 =l alloc8 8 + %.266 =l alloc8 8 + %.272 =l alloc8 8 + %.278 =l alloc8 8 + %.289 =l alloc8 8 + %.295 =l alloc8 8 + %.306 =l alloc8 8 + %.308 =l alloc8 56 + %.309 =l alloc4 8 + %.310 =l alloc4 4 + %.313 =l alloc8 8 + %.317 =l alloc8 8 + %.323 =l alloc8 8 + %.325 =l alloc8 3136 + %.1642 =l alloc4 2 + %.1645 =l alloc4 2 + %.1648 =l alloc8 1600 + %.2010 =l alloc4 4 + %.2013 =l alloc4 4 + %.2014 =l alloc4 4 + %.2015 =l alloc4 4 + %.2050 =l alloc8 40 + %.2051 =l alloc8 8 + %.2053 =l alloc8 8 + %.2059 =l alloc8 8 + %.2062 =l alloc4 2 + %.2067 =l alloc8 64 + %.2076 =l alloc4 216 + %.2185 =l alloc4 4 + %.2186 =l alloc4 4 + %.2219 =l alloc4 140 + %.2360 =l alloc4 4 + %.2363 =l alloc4 4 + %.2366 =l alloc4 4 + %.2371 =l alloc4 192 + %.2468 =l alloc4 4 + %.2469 =l alloc4 4 + %.2470 =l alloc4 4 + %.2475 =l alloc8 1728 + %.3142 =l alloc4 4 + %.3145 =l alloc4 24 + %.3194 =l alloc4 4 + %.3197 =l alloc4 4 + %.3200 =l alloc4 4 + %.3201 =l alloc4 4 + %.3202 =l alloc4 4 + %.3331 =l alloc4 4 + %.3334 =l alloc8 8 + %.3336 =l alloc4 4 + %.3341 =l alloc4 4 + %.3344 =l alloc4 4 + %.3452 =l alloc4 2 + %.3455 =l alloc8 8 + %.3457 =l alloc8 64 + %.3474 =l alloc4 28 + %.3475 =l alloc4 4 + %.3480 =l alloc4 4 + %.3483 =l alloc4 4 + %.3514 =l alloc8 128 + %.3544 =l alloc4 1 + %.3547 =l alloc4 4 + %.3550 =l alloc8 8 + %.3552 =l alloc8 8 + %.3558 =l alloc8 8 + %.3560 =l alloc4 2 + %.3565 =l alloc4 2 + %.3568 =l alloc4 4 + %.3569 =l alloc4 4 + %.3691 =l alloc4 1 + %.3694 =l alloc4 2 + %.3767 =l alloc4 16 + %.3768 =l alloc8 8 + %.3772 =l alloc8 40 + %.3778 =l alloc8 8 + %.3784 =l alloc4 4 + %.3785 =l alloc4 4 + %.3921 =l alloc8 8 + %.3923 =l alloc8 8 + %.3925 =l alloc8 8 + %.3931 =l alloc4 4 + %.3934 =l alloc4 1 + %.3937 =l alloc4 4 + %.4061 =l alloc4 12 + %.4062 =l alloc8 8 + %.4068 =l alloc8 8 + %.4070 =l alloc8 8 + %.4072 =l alloc4 4 + %.4160 =l alloc8 8 + %.4179 =l alloc8 8 + %.4183 =l alloc8 8 + %.4186 =l alloc4 4 + %.4191 =l alloc4 4 + %.4194 =l alloc4 4 + %.4197 =l alloc4 4 + %.4202 =l alloc4 4 + %.4205 =l alloc4 32 + %.4228 =l alloc4 4 + %.4229 =l alloc4 4 + %.4325 =l alloc4 4 + %.4398 =l alloc4 2 + %.4401 =l alloc4 120 + %.4480 =l alloc8 8 + %.4492 =l alloc4 4 + %.4495 =l alloc4 4 + %.4498 =l alloc4 4 + %.4511 =l alloc8 8 + %.4512 =l alloc8 56 + %.4540 =l alloc8 8 + %.4544 =l alloc4 4 + %.4547 =l alloc8 8 + %.4553 =l alloc4 4 + %.4556 =l alloc8 8 + %.4558 =l alloc4 4 + %.4561 =l alloc4 4 + %.4585 =l alloc4 1 + %.4588 =l alloc4 4 + %.4591 =l alloc8 8 + %.4596 =l alloc8 8 + %.4610 =l alloc8 8 + %.4614 =l alloc4 4 + %.4617 =l alloc4 20 + %.4629 =l alloc4 1 + %.4769 =l alloc4 2 + %.4772 =l alloc8 24 + %.4773 =l alloc8 8 + %.4778 =l alloc8 8 + %.4782 =l alloc8 8 + %.4784 =l alloc8 8 + %.4789 =l alloc4 4 + %.4965 =l alloc8 8 + %.4967 =l alloc8 8 + %.4969 =l alloc8 8 + %.5136 =l alloc4 1 + %.5176 =l alloc4 4 + %.5179 =l alloc4 4 + %.5182 =l alloc4 4 + %.5187 =l alloc4 1 + %.5190 =l alloc8 8 + %.5192 =l alloc4 8 + %.5193 =l alloc8 8 + %.5196 =l alloc4 2 + %.5199 =l alloc8 8 + %.5202 =l alloc4 20 + %.5203 =l alloc4 4 + %.5226 =l alloc8 8 + %.5232 =l alloc8 64 + %.5265 =l alloc8 56 + %.5295 =l alloc8 8 + %.5297 =l alloc8 8 + %.5301 =l alloc8 8 + %.5307 =l alloc8 8 + %.5313 =l alloc8 8 + %.5319 =l alloc4 4 + %.5322 =l alloc4 1 + %.5325 =l alloc4 4 + %.5328 =l alloc4 4 + %.5412 =l alloc4 4 + %.5415 =l alloc8 8 + %.5419 =l alloc8 8 + %.5423 =l alloc8 960 + %.5845 =l alloc4 16 + %.5846 =l alloc4 4 + %.5847 =l alloc4 4 + %.5848 =l alloc4 4 + %.5938 =l alloc4 2 + %.5941 =l alloc4 4 + %.5944 =l alloc4 1 + %.5947 =l alloc8 8 + %.5949 =l alloc4 4 + %.5952 =l alloc4 4 + %.5955 =l alloc4 20 + %.5979 =l alloc4 4 + %.5982 =l alloc4 4 + %.5985 =l alloc8 64 + %.6010 =l alloc8 8 + %.6015 =l alloc4 4 + %.6267 =l alloc4 20 + %.6279 =l alloc8 8 + %.6285 =l alloc4 4 + %.6412 =l alloc8 8 + %.6416 =l alloc8 8 + %.6422 =l alloc8 8 + %.6428 =l alloc4 4 + %.6663 =l alloc4 60 + %.6703 =l alloc8 64 + %.6728 =l alloc4 4 + %.6758 =l alloc8 72 + %.6804 =l alloc8 8 + %.6806 =l alloc4 4 + %.6850 =l alloc4 2 + %.6853 =l alloc8 8 + %.6855 =l alloc8 8 + %.6861 =l alloc4 4 + %.6866 =l alloc4 4 + %.6871 =l alloc4 24 + %.6884 =l alloc4 4 + %.7004 =l alloc4 1008 + %.7509 =l alloc4 4 + %.7510 =l alloc4 4 + %.7511 =l alloc4 4 + %.7516 =l alloc4 4 + %.7519 =l alloc4 4 + %.7522 =l alloc8 8 + %.7528 =l alloc8 8 + %.7534 =l alloc8 8 + %.7540 =l alloc8 8 + %.7546 =l alloc8 8 + %.7552 =l alloc8 8 + %.7558 =l alloc8 8 + %.7562 =l alloc8 8 + %.7568 =l alloc8 8 + %.7574 =l alloc8 72 + %.7602 =l alloc4 4 +@body.693 + %.2 =l add %.1, 0 + %.3 =l copy $g_185 + %.4 =l mul 48, 1 + %.5 =l add %.3, %.4 + %.6 =l copy %.5 + storel %.6, %.2 + %.8 =l add %.7, 0 + storel $g_88, %.8 + %.10 =l add %.9, 0 + storel %.7, %.10 + %.12 =l add %.11, 0 + storel %.7, %.12 + %.14 =l add %.13, 0 + storel $g_88, %.14 + %.16 =l add %.15, 0 + %.17 =l extsw 0 + %.18 =l sub %.17, 1 + %.19 =w copy %.18 + storew %.19, %.16 + %.20 =l add %.15, 4 + %.21 =l extsw 0 + %.22 =l sub %.21, 1 + %.23 =w copy %.22 + storew %.23, %.20 + %.24 =l add %.15, 8 + %.25 =w copy 0 + storew %.25, %.24 + %.26 =l add %.15, 12 + %.27 =l extsw 0 + %.28 =l sub %.27, 1 + %.29 =w copy %.28 + storew %.29, %.26 + %.30 =l add %.15, 16 + %.31 =l extsw 0 + %.32 =l sub %.31, 1 + %.33 =w copy %.32 + storew %.33, %.30 + %.34 =l add %.15, 20 + %.35 =w copy 0 + storew %.35, %.34 + %.36 =l add %.15, 24 + %.37 =l extsw 0 + %.38 =l sub %.37, 1 + %.39 =w copy %.38 + storew %.39, %.36 + %.40 =l add %.15, 28 + %.41 =l extsw 0 + %.42 =l sub %.41, 1 + %.43 =w copy %.42 + storew %.43, %.40 + %.44 =l add %.15, 32 + %.45 =w copy 0 + storew %.45, %.44 + %.46 =l add %.15, 36 + %.47 =l extsw 0 + %.48 =l sub %.47, 1 + %.49 =w copy %.48 + storew %.49, %.46 + %.53 =l add %.52, 0 + %.54 =w copy 1876554256 + storew %.54, %.53 + %.56 =l add %.55, 0 + %.57 =l copy 388595597875467280 + storel %.57, %.56 + %.59 =l add %.58, 0 + %.60 =w copy 15327 + storeh %.60, %.59 + %.62 =l add %.61, 0 + %.63 =w copy 7 + storew %.63, %.62 + %.65 =l add %.64, 0 + %.66 =l extsw 0 + %.67 =l copy %.66 + storel %.67, %.65 + %.69 =l add %.68, 0 + storel %.64, %.69 + %.72 =l add %.71, 0 + storel $g_1038, %.72 + %.73 =l add %.71, 8 + storel $g_1038, %.73 + %.74 =l add %.71, 16 + storel $g_1038, %.74 + %.75 =l add %.71, 24 + storel $g_1038, %.75 + %.76 =l add %.71, 32 + storel $g_1038, %.76 + %.77 =l add %.71, 40 + storel $g_1038, %.77 + %.78 =l add %.71, 48 + storel $g_1038, %.78 + %.79 =l add %.71, 56 + storel $g_1038, %.79 + %.81 =l add %.80, 0 + %.82 =w copy 3267697444 + storew %.82, %.81 + %.84 =l add %.83, 0 + storel $g_1070, %.84 + %.86 =l add %.85, 0 + %.87 =w copy 1 + storew %.87, %.86 + %.89 =l add %.88, 0 + %.90 =w copy 0 + storew %.90, %.89 + %.91 =l add %.88, 4 + %.92 =w copy 9 + storew %.92, %.91 + %.93 =l add %.88, 8 + %.94 =w copy 64920 + storeh %.94, %.93 + %.95 =l add %.88, 10 + storeh 0, %.95 + %.96 =l add %.88, 12 + %.97 =w copy 9 + storew %.97, %.96 + %.98 =l add %.88, 16 + %.99 =w copy 18446744073709551615 + storew %.99, %.98 + %.101 =l add %.100, 0 + %.102 =l extsw 0 + %.103 =l copy %.102 + storel %.103, %.101 + %.105 =l add %.104, 0 + storel %.100, %.105 + %.107 =l add %.106, 0 + %.108 =w copy 8 + storeh %.108, %.107 + %.110 =l add %.109, 0 + %.111 =w copy 255 + storeb %.111, %.110 + storew 0, %.112 +@for_cond.694 + %.114 =w loadsw %.112 + %.115 =w csltw %.114, 4 + jnz %.115, @for_body.695, @for_join.697 +@for_body.695 + %.116 =w copy 48300 + %.117 =w loadsw %.112 + %.118 =l extsw %.117 + %.119 =l mul %.118, 2 + %.120 =l add %.50, %.119 + storeh %.116, %.120 +@for_cont.696 + %.121 =w loadsw %.112 + %.122 =w add %.121, 1 + storew %.122, %.112 + jmp @for_cond.694 +@for_join.697 + storew 0, %.112 +@for_cond.698 + %.123 =w loadsw %.112 + %.124 =w csltw %.123, 2 + jnz %.124, @for_body.699, @for_join.701 +@for_body.699 + %.125 =w copy 45763 + %.126 =w loadsw %.112 + %.127 =l extsw %.126 + %.128 =l mul %.127, 2 + %.129 =l add %.51, %.128 + storeh %.125, %.129 +@for_cont.700 + %.130 =w loadsw %.112 + %.131 =w add %.130, 1 + storew %.131, %.112 + jmp @for_cond.698 +@for_join.701 + storew 0, %.112 +@for_cond.702 + %.132 =w loadsw %.112 + %.133 =w csltw %.132, 1 + jnz %.133, @for_body.703, @for_join.705 +@for_body.703 + storew 0, %.113 +@for_cond.706 + %.134 =w loadsw %.113 + %.135 =w csltw %.134, 4 + jnz %.135, @for_body.707, @for_join.709 +@for_body.707 + %.136 =l extsw 0 + %.137 =l sub %.136, 8 + %.138 =w copy %.137 + %.139 =w loadsw %.112 + %.140 =l extsw %.139 + %.141 =l mul %.140, 8 + %.142 =l add %.70, %.141 + %.143 =w loadsw %.113 + %.144 =l extsw %.143 + %.145 =l mul %.144, 2 + %.146 =l add %.142, %.145 + storeh %.138, %.146 +@for_cont.708 + %.147 =w loadsw %.113 + %.148 =w add %.147, 1 + storew %.148, %.113 + jmp @for_cond.706 +@for_join.709 +@for_cont.704 + %.149 =w loadsw %.112 + %.150 =w add %.149, 1 + storew %.150, %.112 + jmp @for_cond.702 +@for_join.705 + %.151 =w loadsb $g_2 + %.152 =w extsb %.151 + %.153 =w cnew %.152, 0 + jnz %.153, @if_true.710, @if_false.711 +@if_true.710 + %.155 =l add %.154, 0 + %.156 =w copy 448696097 + storew %.156, %.155 + %.157 =l add %.154, 4 + %.158 =w copy 448696097 + storew %.158, %.157 + %.159 =l add %.154, 8 + %.160 =w copy 3159920155 + storew %.160, %.159 + %.161 =l add %.154, 12 + %.162 =w copy 448696097 + storew %.162, %.161 + %.163 =l add %.154, 16 + %.164 =w copy 448696097 + storew %.164, %.163 + %.165 =l add %.154, 20 + %.166 =w copy 3159920155 + storew %.166, %.165 + %.168 =l add %.167, 0 + %.169 =l copy $g_265 + %.170 =l mul 44, 1 + %.171 =l add %.169, %.170 + %.172 =l copy %.171 + storel %.172, %.168 + %.174 =l add %.173, 0 + storel %.7, %.174 + %.176 =l add %.175, 0 + %.177 =w copy 3065563876 + storew %.177, %.176 + %.179 =l add %.178, 0 + %.180 =w copy 3026640288 + storew %.180, %.179 + %.182 =l add %.181, 0 + %.183 =w copy 3133052029 + storew %.183, %.182 + %.186 =l add %.185, 0 + %.187 =l copy 5 + storel %.187, %.186 + %.188 =l add %.185, 8 + %.189 =l copy 2140593435845799635 + storel %.189, %.188 + %.190 =l add %.185, 16 + storel 14997647914956660667, %.190 + %.191 =l add %.185, 24 + %.192 =l copy 1 + storel %.192, %.191 + %.193 =l add %.185, 32 + %.194 =l copy 1 + storel %.194, %.193 + %.195 =l add %.185, 40 + storel 14997647914956660667, %.195 + %.196 =l add %.185, 48 + %.197 =l copy 2140593435845799635 + storel %.197, %.196 + %.198 =l add %.185, 56 + %.199 =l copy 5 + storel %.199, %.198 + %.200 =l add %.185, 64 + %.201 =l copy 2140593435845799635 + storel %.201, %.200 + %.202 =l add %.185, 72 + storel 14997647914956660667, %.202 + %.203 =l add %.185, 80 + %.204 =l copy 18446744073709551609 + storel %.204, %.203 + %.205 =l add %.185, 88 + %.206 =l copy 18446744073709551615 + storel %.206, %.205 + %.207 =l add %.185, 96 + %.208 =l copy 1 + storel %.208, %.207 + %.209 =l add %.185, 104 + %.210 =l copy 18446744073709551615 + storel %.210, %.209 + %.211 =l add %.185, 112 + %.212 =l copy 18446744073709551609 + storel %.212, %.211 + %.213 =l add %.185, 120 + storel 14997647914956660667, %.213 + %.214 =l add %.185, 128 + storel 14997647914956660667, %.214 + %.215 =l add %.185, 136 + %.216 =l copy 18446744073709551609 + storel %.216, %.215 + %.217 =l add %.185, 144 + %.218 =l copy 18446744073709551615 + storel %.218, %.217 + %.219 =l add %.185, 152 + %.220 =l copy 1 + storel %.220, %.219 + %.221 =l add %.185, 160 + %.222 =l copy 5 + storel %.222, %.221 + %.223 =l add %.185, 168 + %.224 =l copy 5 + storel %.224, %.223 + %.225 =l add %.185, 176 + %.226 =l copy 1 + storel %.226, %.225 + %.227 =l add %.185, 184 + %.228 =l copy 18446744073709551609 + storel %.228, %.227 + %.229 =l add %.185, 192 + %.230 =l copy 8317808307966024155 + storel %.230, %.229 + %.231 =l add %.185, 200 + %.232 =l copy 18446744073709551609 + storel %.232, %.231 + %.233 =l add %.185, 208 + %.234 =l copy 1 + storel %.234, %.233 + %.235 =l add %.185, 216 + %.236 =l copy 5 + storel %.236, %.235 + %.237 =l add %.185, 224 + %.238 =l copy 5 + storel %.238, %.237 + %.239 =l add %.185, 232 + %.240 =l copy 1 + storel %.240, %.239 + %.242 =l add %.241, 0 + %.243 =w copy 0 + storew %.243, %.242 + %.245 =l add %.244, 0 + %.246 =w copy 2269255619 + storew %.246, %.245 + %.247 =l add %.244, 4 + %.248 =w copy 2269255619 + storew %.248, %.247 + %.249 =l add %.244, 8 + %.250 =w copy 1 + storew %.250, %.249 + %.251 =l add %.244, 12 + %.252 =w copy 2269255619 + storew %.252, %.251 + %.253 =l add %.244, 16 + %.254 =w copy 2269255619 + storew %.254, %.253 + %.255 =l add %.244, 20 + %.256 =w copy 1 + storew %.256, %.255 + %.257 =l add %.244, 24 + %.258 =w copy 2269255619 + storew %.258, %.257 + %.259 =l add %.244, 28 + %.260 =w copy 2269255619 + storew %.260, %.259 + %.262 =l add %.261, 0 + %.263 =w copy 0 + storeh %.263, %.262 + %.265 =l add %.264, 0 + storel %.178, %.265 + %.267 =l add %.266, 0 + %.268 =l copy $g_265 + %.269 =l mul 48, 1 + %.270 =l add %.268, %.269 + %.271 =l copy %.270 + storel %.271, %.267 + %.273 =l add %.272, 0 + %.274 =l copy $g_1183 + %.275 =l mul 48, 1 + %.276 =l add %.274, %.275 + %.277 =l copy %.276 + storel %.277, %.273 + %.279 =l add %.278, 0 + %.280 =l extsw 6 + %.281 =l mul %.280, 12 + %.282 =l add $g_13, %.281 + %.283 =l extsw 1 + %.284 =l mul %.283, 4 + %.285 =l add %.282, %.284 + %.286 =l extsw 0 + %.287 =l mul %.286, 4 + %.288 =l add %.285, %.287 + storel %.288, %.279 + %.290 =l add %.289, 0 + %.291 =l copy $g_1183 + %.292 =l mul 16, 1 + %.293 =l add %.291, %.292 + %.294 =l copy %.293 + storel %.294, %.290 + %.296 =l add %.295, 0 + %.297 =l extsw 7 + %.298 =l mul %.297, 12 + %.299 =l add $g_13, %.298 + %.300 =l extsw 0 + %.301 =l mul %.300, 4 + %.302 =l add %.299, %.301 + %.303 =l extsw 0 + %.304 =l mul %.303, 4 + %.305 =l add %.302, %.304 + storel %.305, %.296 + %.307 =l add %.306, 0 + storel %.178, %.307 + %.311 =l add %.310, 0 + %.312 =w copy 18446744073709551615 + storew %.312, %.311 + %.314 =l add %.313, 0 + %.315 =l extsw 0 + %.316 =l copy %.315 + storel %.316, %.314 + %.318 =l add %.317, 0 + %.319 =l copy $g_265 + %.320 =l mul 8, 1 + %.321 =l add %.319, %.320 + %.322 =l copy %.321 + storel %.322, %.318 + %.324 =l add %.323, 0 + storel $g_80, %.324 + %.326 =l add %.325, 0 + %.327 =w copy 59 + storeb %.327, %.326 + %.328 =l add %.325, 1 + storeb 0, %.328 + %.329 =l add %.325, 2 + storeh 0, %.329 + %.330 =l add %.325, 4 + storew 0, %.330 + %.331 =l add %.325, 8 + storel 5846713185812282113, %.331 + %.332 =l add %.325, 16 + %.333 =w copy 3470287970 + storew %.333, %.332 + %.334 =l add %.325, 20 + storew 0, %.334 + %.335 =l add %.325, 24 + storel 12566983408779698474, %.335 + %.336 =l add %.325, 32 + %.337 =w copy 848682309 + storew %.337, %.336 + %.338 =l add %.325, 36 + %.339 =w copy 5 + storew %.339, %.338 + %.340 =l add %.325, 40 + %.341 =w copy 462078022 + storew %.341, %.340 + %.342 =l add %.325, 44 + %.343 =l extsw 0 + %.344 =l sub %.343, 7 + %.345 =w copy %.344 + storew %.345, %.342 + %.346 =l add %.325, 48 + %.347 =l extsw 0 + %.348 =l sub %.347, 1 + %.349 =w copy %.348 + storew %.349, %.346 + %.350 =l add %.325, 52 + storew 0, %.350 + %.351 =l add %.325, 56 + %.352 =w copy 30 + storeb %.352, %.351 + %.353 =l add %.325, 57 + storeb 0, %.353 + %.354 =l add %.325, 58 + storeh 0, %.354 + %.355 =l add %.325, 60 + storew 0, %.355 + %.356 =l add %.325, 64 + storel 4531615791379082412, %.356 + %.357 =l add %.325, 72 + %.358 =w copy 3542425067 + storew %.358, %.357 + %.359 =l add %.325, 76 + storew 0, %.359 + %.360 =l add %.325, 80 + %.361 =l copy 18446744073709551615 + storel %.361, %.360 + %.362 =l add %.325, 88 + %.363 =w copy 2349175835 + storew %.363, %.362 + %.364 =l add %.325, 92 + %.365 =w copy 1457159742 + storew %.365, %.364 + %.366 =l add %.325, 96 + %.367 =w copy 673000678 + storew %.367, %.366 + %.368 =l add %.325, 100 + %.369 =w copy 2013111086 + storew %.369, %.368 + %.370 =l add %.325, 104 + %.371 =w copy 713487104 + storew %.371, %.370 + %.372 =l add %.325, 108 + storew 0, %.372 + %.373 =l add %.325, 112 + %.374 =w copy 59 + storeb %.374, %.373 + %.375 =l add %.325, 113 + storeb 0, %.375 + %.376 =l add %.325, 114 + storeh 0, %.376 + %.377 =l add %.325, 116 + storew 0, %.377 + %.378 =l add %.325, 120 + storel 5846713185812282113, %.378 + %.379 =l add %.325, 128 + %.380 =w copy 3470287970 + storew %.380, %.379 + %.381 =l add %.325, 132 + storew 0, %.381 + %.382 =l add %.325, 136 + storel 12566983408779698474, %.382 + %.383 =l add %.325, 144 + %.384 =w copy 848682309 + storew %.384, %.383 + %.385 =l add %.325, 148 + %.386 =w copy 5 + storew %.386, %.385 + %.387 =l add %.325, 152 + %.388 =w copy 462078022 + storew %.388, %.387 + %.389 =l add %.325, 156 + %.390 =l extsw 0 + %.391 =l sub %.390, 7 + %.392 =w copy %.391 + storew %.392, %.389 + %.393 =l add %.325, 160 + %.394 =l extsw 0 + %.395 =l sub %.394, 1 + %.396 =w copy %.395 + storew %.396, %.393 + %.397 =l add %.325, 164 + storew 0, %.397 + %.398 =l add %.325, 168 + %.399 =w copy 30 + storeb %.399, %.398 + %.400 =l add %.325, 169 + storeb 0, %.400 + %.401 =l add %.325, 170 + storeh 0, %.401 + %.402 =l add %.325, 172 + storew 0, %.402 + %.403 =l add %.325, 176 + storel 4531615791379082412, %.403 + %.404 =l add %.325, 184 + %.405 =w copy 3542425067 + storew %.405, %.404 + %.406 =l add %.325, 188 + storew 0, %.406 + %.407 =l add %.325, 192 + %.408 =l copy 18446744073709551615 + storel %.408, %.407 + %.409 =l add %.325, 200 + %.410 =w copy 2349175835 + storew %.410, %.409 + %.411 =l add %.325, 204 + %.412 =w copy 1457159742 + storew %.412, %.411 + %.413 =l add %.325, 208 + %.414 =w copy 673000678 + storew %.414, %.413 + %.415 =l add %.325, 212 + %.416 =w copy 2013111086 + storew %.416, %.415 + %.417 =l add %.325, 216 + %.418 =w copy 713487104 + storew %.418, %.417 + %.419 =l add %.325, 220 + storew 0, %.419 + %.420 =l add %.325, 224 + %.421 =w copy 59 + storeb %.421, %.420 + %.422 =l add %.325, 225 + storeb 0, %.422 + %.423 =l add %.325, 226 + storeh 0, %.423 + %.424 =l add %.325, 228 + storew 0, %.424 + %.425 =l add %.325, 232 + storel 5846713185812282113, %.425 + %.426 =l add %.325, 240 + %.427 =w copy 3470287970 + storew %.427, %.426 + %.428 =l add %.325, 244 + storew 0, %.428 + %.429 =l add %.325, 248 + storel 12566983408779698474, %.429 + %.430 =l add %.325, 256 + %.431 =w copy 848682309 + storew %.431, %.430 + %.432 =l add %.325, 260 + %.433 =w copy 5 + storew %.433, %.432 + %.434 =l add %.325, 264 + %.435 =w copy 462078022 + storew %.435, %.434 + %.436 =l add %.325, 268 + %.437 =l extsw 0 + %.438 =l sub %.437, 7 + %.439 =w copy %.438 + storew %.439, %.436 + %.440 =l add %.325, 272 + %.441 =l extsw 0 + %.442 =l sub %.441, 1 + %.443 =w copy %.442 + storew %.443, %.440 + %.444 =l add %.325, 276 + storew 0, %.444 + %.445 =l add %.325, 280 + %.446 =w copy 30 + storeb %.446, %.445 + %.447 =l add %.325, 281 + storeb 0, %.447 + %.448 =l add %.325, 282 + storeh 0, %.448 + %.449 =l add %.325, 284 + storew 0, %.449 + %.450 =l add %.325, 288 + storel 4531615791379082412, %.450 + %.451 =l add %.325, 296 + %.452 =w copy 3542425067 + storew %.452, %.451 + %.453 =l add %.325, 300 + storew 0, %.453 + %.454 =l add %.325, 304 + %.455 =l copy 18446744073709551615 + storel %.455, %.454 + %.456 =l add %.325, 312 + %.457 =w copy 2349175835 + storew %.457, %.456 + %.458 =l add %.325, 316 + %.459 =w copy 1457159742 + storew %.459, %.458 + %.460 =l add %.325, 320 + %.461 =w copy 673000678 + storew %.461, %.460 + %.462 =l add %.325, 324 + %.463 =w copy 2013111086 + storew %.463, %.462 + %.464 =l add %.325, 328 + %.465 =w copy 713487104 + storew %.465, %.464 + %.466 =l add %.325, 332 + storew 0, %.466 + %.467 =l add %.325, 336 + %.468 =w copy 59 + storeb %.468, %.467 + %.469 =l add %.325, 337 + storeb 0, %.469 + %.470 =l add %.325, 338 + storeh 0, %.470 + %.471 =l add %.325, 340 + storew 0, %.471 + %.472 =l add %.325, 344 + storel 5846713185812282113, %.472 + %.473 =l add %.325, 352 + %.474 =w copy 3470287970 + storew %.474, %.473 + %.475 =l add %.325, 356 + storew 0, %.475 + %.476 =l add %.325, 360 + storel 12566983408779698474, %.476 + %.477 =l add %.325, 368 + %.478 =w copy 848682309 + storew %.478, %.477 + %.479 =l add %.325, 372 + %.480 =w copy 5 + storew %.480, %.479 + %.481 =l add %.325, 376 + %.482 =w copy 462078022 + storew %.482, %.481 + %.483 =l add %.325, 380 + %.484 =l extsw 0 + %.485 =l sub %.484, 7 + %.486 =w copy %.485 + storew %.486, %.483 + %.487 =l add %.325, 384 + %.488 =l extsw 0 + %.489 =l sub %.488, 1 + %.490 =w copy %.489 + storew %.490, %.487 + %.491 =l add %.325, 388 + storew 0, %.491 + %.492 =l add %.325, 392 + %.493 =w copy 30 + storeb %.493, %.492 + %.494 =l add %.325, 393 + storeb 0, %.494 + %.495 =l add %.325, 394 + storeh 0, %.495 + %.496 =l add %.325, 396 + storew 0, %.496 + %.497 =l add %.325, 400 + storel 4531615791379082412, %.497 + %.498 =l add %.325, 408 + %.499 =w copy 3542425067 + storew %.499, %.498 + %.500 =l add %.325, 412 + storew 0, %.500 + %.501 =l add %.325, 416 + %.502 =l copy 18446744073709551615 + storel %.502, %.501 + %.503 =l add %.325, 424 + %.504 =w copy 2349175835 + storew %.504, %.503 + %.505 =l add %.325, 428 + %.506 =w copy 1457159742 + storew %.506, %.505 + %.507 =l add %.325, 432 + %.508 =w copy 673000678 + storew %.508, %.507 + %.509 =l add %.325, 436 + %.510 =w copy 2013111086 + storew %.510, %.509 + %.511 =l add %.325, 440 + %.512 =w copy 713487104 + storew %.512, %.511 + %.513 =l add %.325, 444 + storew 0, %.513 + %.514 =l add %.325, 448 + %.515 =w copy 59 + storeb %.515, %.514 + %.516 =l add %.325, 449 + storeb 0, %.516 + %.517 =l add %.325, 450 + storeh 0, %.517 + %.518 =l add %.325, 452 + storew 0, %.518 + %.519 =l add %.325, 456 + storel 5846713185812282113, %.519 + %.520 =l add %.325, 464 + %.521 =w copy 3470287970 + storew %.521, %.520 + %.522 =l add %.325, 468 + storew 0, %.522 + %.523 =l add %.325, 472 + storel 12566983408779698474, %.523 + %.524 =l add %.325, 480 + %.525 =w copy 848682309 + storew %.525, %.524 + %.526 =l add %.325, 484 + %.527 =w copy 5 + storew %.527, %.526 + %.528 =l add %.325, 488 + %.529 =w copy 462078022 + storew %.529, %.528 + %.530 =l add %.325, 492 + %.531 =l extsw 0 + %.532 =l sub %.531, 7 + %.533 =w copy %.532 + storew %.533, %.530 + %.534 =l add %.325, 496 + %.535 =l extsw 0 + %.536 =l sub %.535, 1 + %.537 =w copy %.536 + storew %.537, %.534 + %.538 =l add %.325, 500 + storew 0, %.538 + %.539 =l add %.325, 504 + %.540 =w copy 30 + storeb %.540, %.539 + %.541 =l add %.325, 505 + storeb 0, %.541 + %.542 =l add %.325, 506 + storeh 0, %.542 + %.543 =l add %.325, 508 + storew 0, %.543 + %.544 =l add %.325, 512 + storel 4531615791379082412, %.544 + %.545 =l add %.325, 520 + %.546 =w copy 3542425067 + storew %.546, %.545 + %.547 =l add %.325, 524 + storew 0, %.547 + %.548 =l add %.325, 528 + %.549 =l copy 18446744073709551615 + storel %.549, %.548 + %.550 =l add %.325, 536 + %.551 =w copy 2349175835 + storew %.551, %.550 + %.552 =l add %.325, 540 + %.553 =w copy 1457159742 + storew %.553, %.552 + %.554 =l add %.325, 544 + %.555 =w copy 673000678 + storew %.555, %.554 + %.556 =l add %.325, 548 + %.557 =w copy 2013111086 + storew %.557, %.556 + %.558 =l add %.325, 552 + %.559 =w copy 713487104 + storew %.559, %.558 + %.560 =l add %.325, 556 + storew 0, %.560 + %.561 =l add %.325, 560 + %.562 =w copy 59 + storeb %.562, %.561 + %.563 =l add %.325, 561 + storeb 0, %.563 + %.564 =l add %.325, 562 + storeh 0, %.564 + %.565 =l add %.325, 564 + storew 0, %.565 + %.566 =l add %.325, 568 + storel 5846713185812282113, %.566 + %.567 =l add %.325, 576 + %.568 =w copy 3470287970 + storew %.568, %.567 + %.569 =l add %.325, 580 + storew 0, %.569 + %.570 =l add %.325, 584 + storel 12566983408779698474, %.570 + %.571 =l add %.325, 592 + %.572 =w copy 848682309 + storew %.572, %.571 + %.573 =l add %.325, 596 + %.574 =w copy 5 + storew %.574, %.573 + %.575 =l add %.325, 600 + %.576 =w copy 462078022 + storew %.576, %.575 + %.577 =l add %.325, 604 + %.578 =l extsw 0 + %.579 =l sub %.578, 7 + %.580 =w copy %.579 + storew %.580, %.577 + %.581 =l add %.325, 608 + %.582 =l extsw 0 + %.583 =l sub %.582, 1 + %.584 =w copy %.583 + storew %.584, %.581 + %.585 =l add %.325, 612 + storew 0, %.585 + %.586 =l add %.325, 616 + %.587 =w copy 30 + storeb %.587, %.586 + %.588 =l add %.325, 617 + storeb 0, %.588 + %.589 =l add %.325, 618 + storeh 0, %.589 + %.590 =l add %.325, 620 + storew 0, %.590 + %.591 =l add %.325, 624 + storel 4531615791379082412, %.591 + %.592 =l add %.325, 632 + %.593 =w copy 3542425067 + storew %.593, %.592 + %.594 =l add %.325, 636 + storew 0, %.594 + %.595 =l add %.325, 640 + %.596 =l copy 18446744073709551615 + storel %.596, %.595 + %.597 =l add %.325, 648 + %.598 =w copy 2349175835 + storew %.598, %.597 + %.599 =l add %.325, 652 + %.600 =w copy 1457159742 + storew %.600, %.599 + %.601 =l add %.325, 656 + %.602 =w copy 673000678 + storew %.602, %.601 + %.603 =l add %.325, 660 + %.604 =w copy 2013111086 + storew %.604, %.603 + %.605 =l add %.325, 664 + %.606 =w copy 713487104 + storew %.606, %.605 + %.607 =l add %.325, 668 + storew 0, %.607 + %.608 =l add %.325, 672 + %.609 =w copy 59 + storeb %.609, %.608 + %.610 =l add %.325, 673 + storeb 0, %.610 + %.611 =l add %.325, 674 + storeh 0, %.611 + %.612 =l add %.325, 676 + storew 0, %.612 + %.613 =l add %.325, 680 + storel 5846713185812282113, %.613 + %.614 =l add %.325, 688 + %.615 =w copy 3470287970 + storew %.615, %.614 + %.616 =l add %.325, 692 + storew 0, %.616 + %.617 =l add %.325, 696 + storel 12566983408779698474, %.617 + %.618 =l add %.325, 704 + %.619 =w copy 848682309 + storew %.619, %.618 + %.620 =l add %.325, 708 + %.621 =w copy 5 + storew %.621, %.620 + %.622 =l add %.325, 712 + %.623 =w copy 462078022 + storew %.623, %.622 + %.624 =l add %.325, 716 + %.625 =l extsw 0 + %.626 =l sub %.625, 7 + %.627 =w copy %.626 + storew %.627, %.624 + %.628 =l add %.325, 720 + %.629 =l extsw 0 + %.630 =l sub %.629, 1 + %.631 =w copy %.630 + storew %.631, %.628 + %.632 =l add %.325, 724 + storew 0, %.632 + %.633 =l add %.325, 728 + %.634 =w copy 30 + storeb %.634, %.633 + %.635 =l add %.325, 729 + storeb 0, %.635 + %.636 =l add %.325, 730 + storeh 0, %.636 + %.637 =l add %.325, 732 + storew 0, %.637 + %.638 =l add %.325, 736 + storel 4531615791379082412, %.638 + %.639 =l add %.325, 744 + %.640 =w copy 3542425067 + storew %.640, %.639 + %.641 =l add %.325, 748 + storew 0, %.641 + %.642 =l add %.325, 752 + %.643 =l copy 18446744073709551615 + storel %.643, %.642 + %.644 =l add %.325, 760 + %.645 =w copy 2349175835 + storew %.645, %.644 + %.646 =l add %.325, 764 + %.647 =w copy 1457159742 + storew %.647, %.646 + %.648 =l add %.325, 768 + %.649 =w copy 673000678 + storew %.649, %.648 + %.650 =l add %.325, 772 + %.651 =w copy 2013111086 + storew %.651, %.650 + %.652 =l add %.325, 776 + %.653 =w copy 713487104 + storew %.653, %.652 + %.654 =l add %.325, 780 + storew 0, %.654 + %.655 =l add %.325, 784 + %.656 =w copy 59 + storeb %.656, %.655 + %.657 =l add %.325, 785 + storeb 0, %.657 + %.658 =l add %.325, 786 + storeh 0, %.658 + %.659 =l add %.325, 788 + storew 0, %.659 + %.660 =l add %.325, 792 + storel 5846713185812282113, %.660 + %.661 =l add %.325, 800 + %.662 =w copy 3470287970 + storew %.662, %.661 + %.663 =l add %.325, 804 + storew 0, %.663 + %.664 =l add %.325, 808 + storel 12566983408779698474, %.664 + %.665 =l add %.325, 816 + %.666 =w copy 848682309 + storew %.666, %.665 + %.667 =l add %.325, 820 + %.668 =w copy 5 + storew %.668, %.667 + %.669 =l add %.325, 824 + %.670 =w copy 462078022 + storew %.670, %.669 + %.671 =l add %.325, 828 + %.672 =l extsw 0 + %.673 =l sub %.672, 7 + %.674 =w copy %.673 + storew %.674, %.671 + %.675 =l add %.325, 832 + %.676 =l extsw 0 + %.677 =l sub %.676, 1 + %.678 =w copy %.677 + storew %.678, %.675 + %.679 =l add %.325, 836 + storew 0, %.679 + %.680 =l add %.325, 840 + %.681 =w copy 30 + storeb %.681, %.680 + %.682 =l add %.325, 841 + storeb 0, %.682 + %.683 =l add %.325, 842 + storeh 0, %.683 + %.684 =l add %.325, 844 + storew 0, %.684 + %.685 =l add %.325, 848 + storel 4531615791379082412, %.685 + %.686 =l add %.325, 856 + %.687 =w copy 3542425067 + storew %.687, %.686 + %.688 =l add %.325, 860 + storew 0, %.688 + %.689 =l add %.325, 864 + %.690 =l copy 18446744073709551615 + storel %.690, %.689 + %.691 =l add %.325, 872 + %.692 =w copy 2349175835 + storew %.692, %.691 + %.693 =l add %.325, 876 + %.694 =w copy 1457159742 + storew %.694, %.693 + %.695 =l add %.325, 880 + %.696 =w copy 673000678 + storew %.696, %.695 + %.697 =l add %.325, 884 + %.698 =w copy 2013111086 + storew %.698, %.697 + %.699 =l add %.325, 888 + %.700 =w copy 713487104 + storew %.700, %.699 + %.701 =l add %.325, 892 + storew 0, %.701 + %.702 =l add %.325, 896 + %.703 =w copy 59 + storeb %.703, %.702 + %.704 =l add %.325, 897 + storeb 0, %.704 + %.705 =l add %.325, 898 + storeh 0, %.705 + %.706 =l add %.325, 900 + storew 0, %.706 + %.707 =l add %.325, 904 + storel 5846713185812282113, %.707 + %.708 =l add %.325, 912 + %.709 =w copy 3470287970 + storew %.709, %.708 + %.710 =l add %.325, 916 + storew 0, %.710 + %.711 =l add %.325, 920 + storel 12566983408779698474, %.711 + %.712 =l add %.325, 928 + %.713 =w copy 848682309 + storew %.713, %.712 + %.714 =l add %.325, 932 + %.715 =w copy 5 + storew %.715, %.714 + %.716 =l add %.325, 936 + %.717 =w copy 462078022 + storew %.717, %.716 + %.718 =l add %.325, 940 + %.719 =l extsw 0 + %.720 =l sub %.719, 7 + %.721 =w copy %.720 + storew %.721, %.718 + %.722 =l add %.325, 944 + %.723 =l extsw 0 + %.724 =l sub %.723, 1 + %.725 =w copy %.724 + storew %.725, %.722 + %.726 =l add %.325, 948 + storew 0, %.726 + %.727 =l add %.325, 952 + %.728 =w copy 30 + storeb %.728, %.727 + %.729 =l add %.325, 953 + storeb 0, %.729 + %.730 =l add %.325, 954 + storeh 0, %.730 + %.731 =l add %.325, 956 + storew 0, %.731 + %.732 =l add %.325, 960 + storel 4531615791379082412, %.732 + %.733 =l add %.325, 968 + %.734 =w copy 3542425067 + storew %.734, %.733 + %.735 =l add %.325, 972 + storew 0, %.735 + %.736 =l add %.325, 976 + %.737 =l copy 18446744073709551615 + storel %.737, %.736 + %.738 =l add %.325, 984 + %.739 =w copy 2349175835 + storew %.739, %.738 + %.740 =l add %.325, 988 + %.741 =w copy 1457159742 + storew %.741, %.740 + %.742 =l add %.325, 992 + %.743 =w copy 673000678 + storew %.743, %.742 + %.744 =l add %.325, 996 + %.745 =w copy 2013111086 + storew %.745, %.744 + %.746 =l add %.325, 1000 + %.747 =w copy 713487104 + storew %.747, %.746 + %.748 =l add %.325, 1004 + storew 0, %.748 + %.749 =l add %.325, 1008 + %.750 =w copy 59 + storeb %.750, %.749 + %.751 =l add %.325, 1009 + storeb 0, %.751 + %.752 =l add %.325, 1010 + storeh 0, %.752 + %.753 =l add %.325, 1012 + storew 0, %.753 + %.754 =l add %.325, 1016 + storel 5846713185812282113, %.754 + %.755 =l add %.325, 1024 + %.756 =w copy 3470287970 + storew %.756, %.755 + %.757 =l add %.325, 1028 + storew 0, %.757 + %.758 =l add %.325, 1032 + storel 12566983408779698474, %.758 + %.759 =l add %.325, 1040 + %.760 =w copy 848682309 + storew %.760, %.759 + %.761 =l add %.325, 1044 + %.762 =w copy 5 + storew %.762, %.761 + %.763 =l add %.325, 1048 + %.764 =w copy 462078022 + storew %.764, %.763 + %.765 =l add %.325, 1052 + %.766 =l extsw 0 + %.767 =l sub %.766, 7 + %.768 =w copy %.767 + storew %.768, %.765 + %.769 =l add %.325, 1056 + %.770 =l extsw 0 + %.771 =l sub %.770, 1 + %.772 =w copy %.771 + storew %.772, %.769 + %.773 =l add %.325, 1060 + storew 0, %.773 + %.774 =l add %.325, 1064 + %.775 =w copy 30 + storeb %.775, %.774 + %.776 =l add %.325, 1065 + storeb 0, %.776 + %.777 =l add %.325, 1066 + storeh 0, %.777 + %.778 =l add %.325, 1068 + storew 0, %.778 + %.779 =l add %.325, 1072 + storel 4531615791379082412, %.779 + %.780 =l add %.325, 1080 + %.781 =w copy 3542425067 + storew %.781, %.780 + %.782 =l add %.325, 1084 + storew 0, %.782 + %.783 =l add %.325, 1088 + %.784 =l copy 18446744073709551615 + storel %.784, %.783 + %.785 =l add %.325, 1096 + %.786 =w copy 2349175835 + storew %.786, %.785 + %.787 =l add %.325, 1100 + %.788 =w copy 1457159742 + storew %.788, %.787 + %.789 =l add %.325, 1104 + %.790 =w copy 673000678 + storew %.790, %.789 + %.791 =l add %.325, 1108 + %.792 =w copy 2013111086 + storew %.792, %.791 + %.793 =l add %.325, 1112 + %.794 =w copy 713487104 + storew %.794, %.793 + %.795 =l add %.325, 1116 + storew 0, %.795 + %.796 =l add %.325, 1120 + %.797 =w copy 59 + storeb %.797, %.796 + %.798 =l add %.325, 1121 + storeb 0, %.798 + %.799 =l add %.325, 1122 + storeh 0, %.799 + %.800 =l add %.325, 1124 + storew 0, %.800 + %.801 =l add %.325, 1128 + storel 5846713185812282113, %.801 + %.802 =l add %.325, 1136 + %.803 =w copy 3470287970 + storew %.803, %.802 + %.804 =l add %.325, 1140 + storew 0, %.804 + %.805 =l add %.325, 1144 + storel 12566983408779698474, %.805 + %.806 =l add %.325, 1152 + %.807 =w copy 848682309 + storew %.807, %.806 + %.808 =l add %.325, 1156 + %.809 =w copy 5 + storew %.809, %.808 + %.810 =l add %.325, 1160 + %.811 =w copy 462078022 + storew %.811, %.810 + %.812 =l add %.325, 1164 + %.813 =l extsw 0 + %.814 =l sub %.813, 7 + %.815 =w copy %.814 + storew %.815, %.812 + %.816 =l add %.325, 1168 + %.817 =l extsw 0 + %.818 =l sub %.817, 1 + %.819 =w copy %.818 + storew %.819, %.816 + %.820 =l add %.325, 1172 + storew 0, %.820 + %.821 =l add %.325, 1176 + %.822 =w copy 30 + storeb %.822, %.821 + %.823 =l add %.325, 1177 + storeb 0, %.823 + %.824 =l add %.325, 1178 + storeh 0, %.824 + %.825 =l add %.325, 1180 + storew 0, %.825 + %.826 =l add %.325, 1184 + storel 4531615791379082412, %.826 + %.827 =l add %.325, 1192 + %.828 =w copy 3542425067 + storew %.828, %.827 + %.829 =l add %.325, 1196 + storew 0, %.829 + %.830 =l add %.325, 1200 + %.831 =l copy 18446744073709551615 + storel %.831, %.830 + %.832 =l add %.325, 1208 + %.833 =w copy 2349175835 + storew %.833, %.832 + %.834 =l add %.325, 1212 + %.835 =w copy 1457159742 + storew %.835, %.834 + %.836 =l add %.325, 1216 + %.837 =w copy 673000678 + storew %.837, %.836 + %.838 =l add %.325, 1220 + %.839 =w copy 2013111086 + storew %.839, %.838 + %.840 =l add %.325, 1224 + %.841 =w copy 713487104 + storew %.841, %.840 + %.842 =l add %.325, 1228 + storew 0, %.842 + %.843 =l add %.325, 1232 + %.844 =w copy 59 + storeb %.844, %.843 + %.845 =l add %.325, 1233 + storeb 0, %.845 + %.846 =l add %.325, 1234 + storeh 0, %.846 + %.847 =l add %.325, 1236 + storew 0, %.847 + %.848 =l add %.325, 1240 + storel 5846713185812282113, %.848 + %.849 =l add %.325, 1248 + %.850 =w copy 3470287970 + storew %.850, %.849 + %.851 =l add %.325, 1252 + storew 0, %.851 + %.852 =l add %.325, 1256 + storel 12566983408779698474, %.852 + %.853 =l add %.325, 1264 + %.854 =w copy 848682309 + storew %.854, %.853 + %.855 =l add %.325, 1268 + %.856 =w copy 5 + storew %.856, %.855 + %.857 =l add %.325, 1272 + %.858 =w copy 462078022 + storew %.858, %.857 + %.859 =l add %.325, 1276 + %.860 =l extsw 0 + %.861 =l sub %.860, 7 + %.862 =w copy %.861 + storew %.862, %.859 + %.863 =l add %.325, 1280 + %.864 =l extsw 0 + %.865 =l sub %.864, 1 + %.866 =w copy %.865 + storew %.866, %.863 + %.867 =l add %.325, 1284 + storew 0, %.867 + %.868 =l add %.325, 1288 + %.869 =w copy 30 + storeb %.869, %.868 + %.870 =l add %.325, 1289 + storeb 0, %.870 + %.871 =l add %.325, 1290 + storeh 0, %.871 + %.872 =l add %.325, 1292 + storew 0, %.872 + %.873 =l add %.325, 1296 + storel 4531615791379082412, %.873 + %.874 =l add %.325, 1304 + %.875 =w copy 3542425067 + storew %.875, %.874 + %.876 =l add %.325, 1308 + storew 0, %.876 + %.877 =l add %.325, 1312 + %.878 =l copy 18446744073709551615 + storel %.878, %.877 + %.879 =l add %.325, 1320 + %.880 =w copy 2349175835 + storew %.880, %.879 + %.881 =l add %.325, 1324 + %.882 =w copy 1457159742 + storew %.882, %.881 + %.883 =l add %.325, 1328 + %.884 =w copy 673000678 + storew %.884, %.883 + %.885 =l add %.325, 1332 + %.886 =w copy 2013111086 + storew %.886, %.885 + %.887 =l add %.325, 1336 + %.888 =w copy 713487104 + storew %.888, %.887 + %.889 =l add %.325, 1340 + storew 0, %.889 + %.890 =l add %.325, 1344 + %.891 =w copy 59 + storeb %.891, %.890 + %.892 =l add %.325, 1345 + storeb 0, %.892 + %.893 =l add %.325, 1346 + storeh 0, %.893 + %.894 =l add %.325, 1348 + storew 0, %.894 + %.895 =l add %.325, 1352 + storel 5846713185812282113, %.895 + %.896 =l add %.325, 1360 + %.897 =w copy 3470287970 + storew %.897, %.896 + %.898 =l add %.325, 1364 + storew 0, %.898 + %.899 =l add %.325, 1368 + storel 12566983408779698474, %.899 + %.900 =l add %.325, 1376 + %.901 =w copy 848682309 + storew %.901, %.900 + %.902 =l add %.325, 1380 + %.903 =w copy 5 + storew %.903, %.902 + %.904 =l add %.325, 1384 + %.905 =w copy 462078022 + storew %.905, %.904 + %.906 =l add %.325, 1388 + %.907 =l extsw 0 + %.908 =l sub %.907, 7 + %.909 =w copy %.908 + storew %.909, %.906 + %.910 =l add %.325, 1392 + %.911 =l extsw 0 + %.912 =l sub %.911, 1 + %.913 =w copy %.912 + storew %.913, %.910 + %.914 =l add %.325, 1396 + storew 0, %.914 + %.915 =l add %.325, 1400 + %.916 =w copy 30 + storeb %.916, %.915 + %.917 =l add %.325, 1401 + storeb 0, %.917 + %.918 =l add %.325, 1402 + storeh 0, %.918 + %.919 =l add %.325, 1404 + storew 0, %.919 + %.920 =l add %.325, 1408 + storel 4531615791379082412, %.920 + %.921 =l add %.325, 1416 + %.922 =w copy 3542425067 + storew %.922, %.921 + %.923 =l add %.325, 1420 + storew 0, %.923 + %.924 =l add %.325, 1424 + %.925 =l copy 18446744073709551615 + storel %.925, %.924 + %.926 =l add %.325, 1432 + %.927 =w copy 2349175835 + storew %.927, %.926 + %.928 =l add %.325, 1436 + %.929 =w copy 1457159742 + storew %.929, %.928 + %.930 =l add %.325, 1440 + %.931 =w copy 673000678 + storew %.931, %.930 + %.932 =l add %.325, 1444 + %.933 =w copy 2013111086 + storew %.933, %.932 + %.934 =l add %.325, 1448 + %.935 =w copy 713487104 + storew %.935, %.934 + %.936 =l add %.325, 1452 + storew 0, %.936 + %.937 =l add %.325, 1456 + %.938 =w copy 59 + storeb %.938, %.937 + %.939 =l add %.325, 1457 + storeb 0, %.939 + %.940 =l add %.325, 1458 + storeh 0, %.940 + %.941 =l add %.325, 1460 + storew 0, %.941 + %.942 =l add %.325, 1464 + storel 5846713185812282113, %.942 + %.943 =l add %.325, 1472 + %.944 =w copy 3470287970 + storew %.944, %.943 + %.945 =l add %.325, 1476 + storew 0, %.945 + %.946 =l add %.325, 1480 + storel 12566983408779698474, %.946 + %.947 =l add %.325, 1488 + %.948 =w copy 848682309 + storew %.948, %.947 + %.949 =l add %.325, 1492 + %.950 =w copy 5 + storew %.950, %.949 + %.951 =l add %.325, 1496 + %.952 =w copy 462078022 + storew %.952, %.951 + %.953 =l add %.325, 1500 + %.954 =l extsw 0 + %.955 =l sub %.954, 7 + %.956 =w copy %.955 + storew %.956, %.953 + %.957 =l add %.325, 1504 + %.958 =l extsw 0 + %.959 =l sub %.958, 1 + %.960 =w copy %.959 + storew %.960, %.957 + %.961 =l add %.325, 1508 + storew 0, %.961 + %.962 =l add %.325, 1512 + %.963 =w copy 30 + storeb %.963, %.962 + %.964 =l add %.325, 1513 + storeb 0, %.964 + %.965 =l add %.325, 1514 + storeh 0, %.965 + %.966 =l add %.325, 1516 + storew 0, %.966 + %.967 =l add %.325, 1520 + storel 4531615791379082412, %.967 + %.968 =l add %.325, 1528 + %.969 =w copy 3542425067 + storew %.969, %.968 + %.970 =l add %.325, 1532 + storew 0, %.970 + %.971 =l add %.325, 1536 + %.972 =l copy 18446744073709551615 + storel %.972, %.971 + %.973 =l add %.325, 1544 + %.974 =w copy 2349175835 + storew %.974, %.973 + %.975 =l add %.325, 1548 + %.976 =w copy 1457159742 + storew %.976, %.975 + %.977 =l add %.325, 1552 + %.978 =w copy 673000678 + storew %.978, %.977 + %.979 =l add %.325, 1556 + %.980 =w copy 2013111086 + storew %.980, %.979 + %.981 =l add %.325, 1560 + %.982 =w copy 713487104 + storew %.982, %.981 + %.983 =l add %.325, 1564 + storew 0, %.983 + %.984 =l add %.325, 1568 + %.985 =w copy 59 + storeb %.985, %.984 + %.986 =l add %.325, 1569 + storeb 0, %.986 + %.987 =l add %.325, 1570 + storeh 0, %.987 + %.988 =l add %.325, 1572 + storew 0, %.988 + %.989 =l add %.325, 1576 + storel 5846713185812282113, %.989 + %.990 =l add %.325, 1584 + %.991 =w copy 3470287970 + storew %.991, %.990 + %.992 =l add %.325, 1588 + storew 0, %.992 + %.993 =l add %.325, 1592 + storel 12566983408779698474, %.993 + %.994 =l add %.325, 1600 + %.995 =w copy 848682309 + storew %.995, %.994 + %.996 =l add %.325, 1604 + %.997 =w copy 5 + storew %.997, %.996 + %.998 =l add %.325, 1608 + %.999 =w copy 462078022 + storew %.999, %.998 + %.1000 =l add %.325, 1612 + %.1001 =l extsw 0 + %.1002 =l sub %.1001, 7 + %.1003 =w copy %.1002 + storew %.1003, %.1000 + %.1004 =l add %.325, 1616 + %.1005 =l extsw 0 + %.1006 =l sub %.1005, 1 + %.1007 =w copy %.1006 + storew %.1007, %.1004 + %.1008 =l add %.325, 1620 + storew 0, %.1008 + %.1009 =l add %.325, 1624 + %.1010 =w copy 30 + storeb %.1010, %.1009 + %.1011 =l add %.325, 1625 + storeb 0, %.1011 + %.1012 =l add %.325, 1626 + storeh 0, %.1012 + %.1013 =l add %.325, 1628 + storew 0, %.1013 + %.1014 =l add %.325, 1632 + storel 4531615791379082412, %.1014 + %.1015 =l add %.325, 1640 + %.1016 =w copy 3542425067 + storew %.1016, %.1015 + %.1017 =l add %.325, 1644 + storew 0, %.1017 + %.1018 =l add %.325, 1648 + %.1019 =l copy 18446744073709551615 + storel %.1019, %.1018 + %.1020 =l add %.325, 1656 + %.1021 =w copy 2349175835 + storew %.1021, %.1020 + %.1022 =l add %.325, 1660 + %.1023 =w copy 1457159742 + storew %.1023, %.1022 + %.1024 =l add %.325, 1664 + %.1025 =w copy 673000678 + storew %.1025, %.1024 + %.1026 =l add %.325, 1668 + %.1027 =w copy 2013111086 + storew %.1027, %.1026 + %.1028 =l add %.325, 1672 + %.1029 =w copy 713487104 + storew %.1029, %.1028 + %.1030 =l add %.325, 1676 + storew 0, %.1030 + %.1031 =l add %.325, 1680 + %.1032 =w copy 59 + storeb %.1032, %.1031 + %.1033 =l add %.325, 1681 + storeb 0, %.1033 + %.1034 =l add %.325, 1682 + storeh 0, %.1034 + %.1035 =l add %.325, 1684 + storew 0, %.1035 + %.1036 =l add %.325, 1688 + storel 5846713185812282113, %.1036 + %.1037 =l add %.325, 1696 + %.1038 =w copy 3470287970 + storew %.1038, %.1037 + %.1039 =l add %.325, 1700 + storew 0, %.1039 + %.1040 =l add %.325, 1704 + storel 12566983408779698474, %.1040 + %.1041 =l add %.325, 1712 + %.1042 =w copy 848682309 + storew %.1042, %.1041 + %.1043 =l add %.325, 1716 + %.1044 =w copy 5 + storew %.1044, %.1043 + %.1045 =l add %.325, 1720 + %.1046 =w copy 462078022 + storew %.1046, %.1045 + %.1047 =l add %.325, 1724 + %.1048 =l extsw 0 + %.1049 =l sub %.1048, 7 + %.1050 =w copy %.1049 + storew %.1050, %.1047 + %.1051 =l add %.325, 1728 + %.1052 =l extsw 0 + %.1053 =l sub %.1052, 1 + %.1054 =w copy %.1053 + storew %.1054, %.1051 + %.1055 =l add %.325, 1732 + storew 0, %.1055 + %.1056 =l add %.325, 1736 + %.1057 =w copy 30 + storeb %.1057, %.1056 + %.1058 =l add %.325, 1737 + storeb 0, %.1058 + %.1059 =l add %.325, 1738 + storeh 0, %.1059 + %.1060 =l add %.325, 1740 + storew 0, %.1060 + %.1061 =l add %.325, 1744 + storel 4531615791379082412, %.1061 + %.1062 =l add %.325, 1752 + %.1063 =w copy 3542425067 + storew %.1063, %.1062 + %.1064 =l add %.325, 1756 + storew 0, %.1064 + %.1065 =l add %.325, 1760 + %.1066 =l copy 18446744073709551615 + storel %.1066, %.1065 + %.1067 =l add %.325, 1768 + %.1068 =w copy 2349175835 + storew %.1068, %.1067 + %.1069 =l add %.325, 1772 + %.1070 =w copy 1457159742 + storew %.1070, %.1069 + %.1071 =l add %.325, 1776 + %.1072 =w copy 673000678 + storew %.1072, %.1071 + %.1073 =l add %.325, 1780 + %.1074 =w copy 2013111086 + storew %.1074, %.1073 + %.1075 =l add %.325, 1784 + %.1076 =w copy 713487104 + storew %.1076, %.1075 + %.1077 =l add %.325, 1788 + storew 0, %.1077 + %.1078 =l add %.325, 1792 + %.1079 =w copy 59 + storeb %.1079, %.1078 + %.1080 =l add %.325, 1793 + storeb 0, %.1080 + %.1081 =l add %.325, 1794 + storeh 0, %.1081 + %.1082 =l add %.325, 1796 + storew 0, %.1082 + %.1083 =l add %.325, 1800 + storel 5846713185812282113, %.1083 + %.1084 =l add %.325, 1808 + %.1085 =w copy 3470287970 + storew %.1085, %.1084 + %.1086 =l add %.325, 1812 + storew 0, %.1086 + %.1087 =l add %.325, 1816 + storel 12566983408779698474, %.1087 + %.1088 =l add %.325, 1824 + %.1089 =w copy 848682309 + storew %.1089, %.1088 + %.1090 =l add %.325, 1828 + %.1091 =w copy 5 + storew %.1091, %.1090 + %.1092 =l add %.325, 1832 + %.1093 =w copy 462078022 + storew %.1093, %.1092 + %.1094 =l add %.325, 1836 + %.1095 =l extsw 0 + %.1096 =l sub %.1095, 7 + %.1097 =w copy %.1096 + storew %.1097, %.1094 + %.1098 =l add %.325, 1840 + %.1099 =l extsw 0 + %.1100 =l sub %.1099, 1 + %.1101 =w copy %.1100 + storew %.1101, %.1098 + %.1102 =l add %.325, 1844 + storew 0, %.1102 + %.1103 =l add %.325, 1848 + %.1104 =w copy 30 + storeb %.1104, %.1103 + %.1105 =l add %.325, 1849 + storeb 0, %.1105 + %.1106 =l add %.325, 1850 + storeh 0, %.1106 + %.1107 =l add %.325, 1852 + storew 0, %.1107 + %.1108 =l add %.325, 1856 + storel 4531615791379082412, %.1108 + %.1109 =l add %.325, 1864 + %.1110 =w copy 3542425067 + storew %.1110, %.1109 + %.1111 =l add %.325, 1868 + storew 0, %.1111 + %.1112 =l add %.325, 1872 + %.1113 =l copy 18446744073709551615 + storel %.1113, %.1112 + %.1114 =l add %.325, 1880 + %.1115 =w copy 2349175835 + storew %.1115, %.1114 + %.1116 =l add %.325, 1884 + %.1117 =w copy 1457159742 + storew %.1117, %.1116 + %.1118 =l add %.325, 1888 + %.1119 =w copy 673000678 + storew %.1119, %.1118 + %.1120 =l add %.325, 1892 + %.1121 =w copy 2013111086 + storew %.1121, %.1120 + %.1122 =l add %.325, 1896 + %.1123 =w copy 713487104 + storew %.1123, %.1122 + %.1124 =l add %.325, 1900 + storew 0, %.1124 + %.1125 =l add %.325, 1904 + %.1126 =w copy 59 + storeb %.1126, %.1125 + %.1127 =l add %.325, 1905 + storeb 0, %.1127 + %.1128 =l add %.325, 1906 + storeh 0, %.1128 + %.1129 =l add %.325, 1908 + storew 0, %.1129 + %.1130 =l add %.325, 1912 + storel 5846713185812282113, %.1130 + %.1131 =l add %.325, 1920 + %.1132 =w copy 3470287970 + storew %.1132, %.1131 + %.1133 =l add %.325, 1924 + storew 0, %.1133 + %.1134 =l add %.325, 1928 + storel 12566983408779698474, %.1134 + %.1135 =l add %.325, 1936 + %.1136 =w copy 848682309 + storew %.1136, %.1135 + %.1137 =l add %.325, 1940 + %.1138 =w copy 5 + storew %.1138, %.1137 + %.1139 =l add %.325, 1944 + %.1140 =w copy 462078022 + storew %.1140, %.1139 + %.1141 =l add %.325, 1948 + %.1142 =l extsw 0 + %.1143 =l sub %.1142, 7 + %.1144 =w copy %.1143 + storew %.1144, %.1141 + %.1145 =l add %.325, 1952 + %.1146 =l extsw 0 + %.1147 =l sub %.1146, 1 + %.1148 =w copy %.1147 + storew %.1148, %.1145 + %.1149 =l add %.325, 1956 + storew 0, %.1149 + %.1150 =l add %.325, 1960 + %.1151 =w copy 30 + storeb %.1151, %.1150 + %.1152 =l add %.325, 1961 + storeb 0, %.1152 + %.1153 =l add %.325, 1962 + storeh 0, %.1153 + %.1154 =l add %.325, 1964 + storew 0, %.1154 + %.1155 =l add %.325, 1968 + storel 4531615791379082412, %.1155 + %.1156 =l add %.325, 1976 + %.1157 =w copy 3542425067 + storew %.1157, %.1156 + %.1158 =l add %.325, 1980 + storew 0, %.1158 + %.1159 =l add %.325, 1984 + %.1160 =l copy 18446744073709551615 + storel %.1160, %.1159 + %.1161 =l add %.325, 1992 + %.1162 =w copy 2349175835 + storew %.1162, %.1161 + %.1163 =l add %.325, 1996 + %.1164 =w copy 1457159742 + storew %.1164, %.1163 + %.1165 =l add %.325, 2000 + %.1166 =w copy 673000678 + storew %.1166, %.1165 + %.1167 =l add %.325, 2004 + %.1168 =w copy 2013111086 + storew %.1168, %.1167 + %.1169 =l add %.325, 2008 + %.1170 =w copy 713487104 + storew %.1170, %.1169 + %.1171 =l add %.325, 2012 + storew 0, %.1171 + %.1172 =l add %.325, 2016 + %.1173 =w copy 59 + storeb %.1173, %.1172 + %.1174 =l add %.325, 2017 + storeb 0, %.1174 + %.1175 =l add %.325, 2018 + storeh 0, %.1175 + %.1176 =l add %.325, 2020 + storew 0, %.1176 + %.1177 =l add %.325, 2024 + storel 5846713185812282113, %.1177 + %.1178 =l add %.325, 2032 + %.1179 =w copy 3470287970 + storew %.1179, %.1178 + %.1180 =l add %.325, 2036 + storew 0, %.1180 + %.1181 =l add %.325, 2040 + storel 12566983408779698474, %.1181 + %.1182 =l add %.325, 2048 + %.1183 =w copy 848682309 + storew %.1183, %.1182 + %.1184 =l add %.325, 2052 + %.1185 =w copy 5 + storew %.1185, %.1184 + %.1186 =l add %.325, 2056 + %.1187 =w copy 462078022 + storew %.1187, %.1186 + %.1188 =l add %.325, 2060 + %.1189 =l extsw 0 + %.1190 =l sub %.1189, 7 + %.1191 =w copy %.1190 + storew %.1191, %.1188 + %.1192 =l add %.325, 2064 + %.1193 =l extsw 0 + %.1194 =l sub %.1193, 1 + %.1195 =w copy %.1194 + storew %.1195, %.1192 + %.1196 =l add %.325, 2068 + storew 0, %.1196 + %.1197 =l add %.325, 2072 + %.1198 =w copy 30 + storeb %.1198, %.1197 + %.1199 =l add %.325, 2073 + storeb 0, %.1199 + %.1200 =l add %.325, 2074 + storeh 0, %.1200 + %.1201 =l add %.325, 2076 + storew 0, %.1201 + %.1202 =l add %.325, 2080 + storel 4531615791379082412, %.1202 + %.1203 =l add %.325, 2088 + %.1204 =w copy 3542425067 + storew %.1204, %.1203 + %.1205 =l add %.325, 2092 + storew 0, %.1205 + %.1206 =l add %.325, 2096 + %.1207 =l copy 18446744073709551615 + storel %.1207, %.1206 + %.1208 =l add %.325, 2104 + %.1209 =w copy 2349175835 + storew %.1209, %.1208 + %.1210 =l add %.325, 2108 + %.1211 =w copy 1457159742 + storew %.1211, %.1210 + %.1212 =l add %.325, 2112 + %.1213 =w copy 673000678 + storew %.1213, %.1212 + %.1214 =l add %.325, 2116 + %.1215 =w copy 2013111086 + storew %.1215, %.1214 + %.1216 =l add %.325, 2120 + %.1217 =w copy 713487104 + storew %.1217, %.1216 + %.1218 =l add %.325, 2124 + storew 0, %.1218 + %.1219 =l add %.325, 2128 + %.1220 =w copy 59 + storeb %.1220, %.1219 + %.1221 =l add %.325, 2129 + storeb 0, %.1221 + %.1222 =l add %.325, 2130 + storeh 0, %.1222 + %.1223 =l add %.325, 2132 + storew 0, %.1223 + %.1224 =l add %.325, 2136 + storel 5846713185812282113, %.1224 + %.1225 =l add %.325, 2144 + %.1226 =w copy 3470287970 + storew %.1226, %.1225 + %.1227 =l add %.325, 2148 + storew 0, %.1227 + %.1228 =l add %.325, 2152 + storel 12566983408779698474, %.1228 + %.1229 =l add %.325, 2160 + %.1230 =w copy 848682309 + storew %.1230, %.1229 + %.1231 =l add %.325, 2164 + %.1232 =w copy 5 + storew %.1232, %.1231 + %.1233 =l add %.325, 2168 + %.1234 =w copy 462078022 + storew %.1234, %.1233 + %.1235 =l add %.325, 2172 + %.1236 =l extsw 0 + %.1237 =l sub %.1236, 7 + %.1238 =w copy %.1237 + storew %.1238, %.1235 + %.1239 =l add %.325, 2176 + %.1240 =l extsw 0 + %.1241 =l sub %.1240, 1 + %.1242 =w copy %.1241 + storew %.1242, %.1239 + %.1243 =l add %.325, 2180 + storew 0, %.1243 + %.1244 =l add %.325, 2184 + %.1245 =w copy 30 + storeb %.1245, %.1244 + %.1246 =l add %.325, 2185 + storeb 0, %.1246 + %.1247 =l add %.325, 2186 + storeh 0, %.1247 + %.1248 =l add %.325, 2188 + storew 0, %.1248 + %.1249 =l add %.325, 2192 + storel 4531615791379082412, %.1249 + %.1250 =l add %.325, 2200 + %.1251 =w copy 3542425067 + storew %.1251, %.1250 + %.1252 =l add %.325, 2204 + storew 0, %.1252 + %.1253 =l add %.325, 2208 + %.1254 =l copy 18446744073709551615 + storel %.1254, %.1253 + %.1255 =l add %.325, 2216 + %.1256 =w copy 2349175835 + storew %.1256, %.1255 + %.1257 =l add %.325, 2220 + %.1258 =w copy 1457159742 + storew %.1258, %.1257 + %.1259 =l add %.325, 2224 + %.1260 =w copy 673000678 + storew %.1260, %.1259 + %.1261 =l add %.325, 2228 + %.1262 =w copy 2013111086 + storew %.1262, %.1261 + %.1263 =l add %.325, 2232 + %.1264 =w copy 713487104 + storew %.1264, %.1263 + %.1265 =l add %.325, 2236 + storew 0, %.1265 + %.1266 =l add %.325, 2240 + %.1267 =w copy 59 + storeb %.1267, %.1266 + %.1268 =l add %.325, 2241 + storeb 0, %.1268 + %.1269 =l add %.325, 2242 + storeh 0, %.1269 + %.1270 =l add %.325, 2244 + storew 0, %.1270 + %.1271 =l add %.325, 2248 + storel 5846713185812282113, %.1271 + %.1272 =l add %.325, 2256 + %.1273 =w copy 3470287970 + storew %.1273, %.1272 + %.1274 =l add %.325, 2260 + storew 0, %.1274 + %.1275 =l add %.325, 2264 + storel 12566983408779698474, %.1275 + %.1276 =l add %.325, 2272 + %.1277 =w copy 848682309 + storew %.1277, %.1276 + %.1278 =l add %.325, 2276 + %.1279 =w copy 5 + storew %.1279, %.1278 + %.1280 =l add %.325, 2280 + %.1281 =w copy 462078022 + storew %.1281, %.1280 + %.1282 =l add %.325, 2284 + %.1283 =l extsw 0 + %.1284 =l sub %.1283, 7 + %.1285 =w copy %.1284 + storew %.1285, %.1282 + %.1286 =l add %.325, 2288 + %.1287 =l extsw 0 + %.1288 =l sub %.1287, 1 + %.1289 =w copy %.1288 + storew %.1289, %.1286 + %.1290 =l add %.325, 2292 + storew 0, %.1290 + %.1291 =l add %.325, 2296 + %.1292 =w copy 30 + storeb %.1292, %.1291 + %.1293 =l add %.325, 2297 + storeb 0, %.1293 + %.1294 =l add %.325, 2298 + storeh 0, %.1294 + %.1295 =l add %.325, 2300 + storew 0, %.1295 + %.1296 =l add %.325, 2304 + storel 4531615791379082412, %.1296 + %.1297 =l add %.325, 2312 + %.1298 =w copy 3542425067 + storew %.1298, %.1297 + %.1299 =l add %.325, 2316 + storew 0, %.1299 + %.1300 =l add %.325, 2320 + %.1301 =l copy 18446744073709551615 + storel %.1301, %.1300 + %.1302 =l add %.325, 2328 + %.1303 =w copy 2349175835 + storew %.1303, %.1302 + %.1304 =l add %.325, 2332 + %.1305 =w copy 1457159742 + storew %.1305, %.1304 + %.1306 =l add %.325, 2336 + %.1307 =w copy 673000678 + storew %.1307, %.1306 + %.1308 =l add %.325, 2340 + %.1309 =w copy 2013111086 + storew %.1309, %.1308 + %.1310 =l add %.325, 2344 + %.1311 =w copy 713487104 + storew %.1311, %.1310 + %.1312 =l add %.325, 2348 + storew 0, %.1312 + %.1313 =l add %.325, 2352 + %.1314 =w copy 59 + storeb %.1314, %.1313 + %.1315 =l add %.325, 2353 + storeb 0, %.1315 + %.1316 =l add %.325, 2354 + storeh 0, %.1316 + %.1317 =l add %.325, 2356 + storew 0, %.1317 + %.1318 =l add %.325, 2360 + storel 5846713185812282113, %.1318 + %.1319 =l add %.325, 2368 + %.1320 =w copy 3470287970 + storew %.1320, %.1319 + %.1321 =l add %.325, 2372 + storew 0, %.1321 + %.1322 =l add %.325, 2376 + storel 12566983408779698474, %.1322 + %.1323 =l add %.325, 2384 + %.1324 =w copy 848682309 + storew %.1324, %.1323 + %.1325 =l add %.325, 2388 + %.1326 =w copy 5 + storew %.1326, %.1325 + %.1327 =l add %.325, 2392 + %.1328 =w copy 462078022 + storew %.1328, %.1327 + %.1329 =l add %.325, 2396 + %.1330 =l extsw 0 + %.1331 =l sub %.1330, 7 + %.1332 =w copy %.1331 + storew %.1332, %.1329 + %.1333 =l add %.325, 2400 + %.1334 =l extsw 0 + %.1335 =l sub %.1334, 1 + %.1336 =w copy %.1335 + storew %.1336, %.1333 + %.1337 =l add %.325, 2404 + storew 0, %.1337 + %.1338 =l add %.325, 2408 + %.1339 =w copy 30 + storeb %.1339, %.1338 + %.1340 =l add %.325, 2409 + storeb 0, %.1340 + %.1341 =l add %.325, 2410 + storeh 0, %.1341 + %.1342 =l add %.325, 2412 + storew 0, %.1342 + %.1343 =l add %.325, 2416 + storel 4531615791379082412, %.1343 + %.1344 =l add %.325, 2424 + %.1345 =w copy 3542425067 + storew %.1345, %.1344 + %.1346 =l add %.325, 2428 + storew 0, %.1346 + %.1347 =l add %.325, 2432 + %.1348 =l copy 18446744073709551615 + storel %.1348, %.1347 + %.1349 =l add %.325, 2440 + %.1350 =w copy 2349175835 + storew %.1350, %.1349 + %.1351 =l add %.325, 2444 + %.1352 =w copy 1457159742 + storew %.1352, %.1351 + %.1353 =l add %.325, 2448 + %.1354 =w copy 673000678 + storew %.1354, %.1353 + %.1355 =l add %.325, 2452 + %.1356 =w copy 2013111086 + storew %.1356, %.1355 + %.1357 =l add %.325, 2456 + %.1358 =w copy 713487104 + storew %.1358, %.1357 + %.1359 =l add %.325, 2460 + storew 0, %.1359 + %.1360 =l add %.325, 2464 + %.1361 =w copy 59 + storeb %.1361, %.1360 + %.1362 =l add %.325, 2465 + storeb 0, %.1362 + %.1363 =l add %.325, 2466 + storeh 0, %.1363 + %.1364 =l add %.325, 2468 + storew 0, %.1364 + %.1365 =l add %.325, 2472 + storel 5846713185812282113, %.1365 + %.1366 =l add %.325, 2480 + %.1367 =w copy 3470287970 + storew %.1367, %.1366 + %.1368 =l add %.325, 2484 + storew 0, %.1368 + %.1369 =l add %.325, 2488 + storel 12566983408779698474, %.1369 + %.1370 =l add %.325, 2496 + %.1371 =w copy 848682309 + storew %.1371, %.1370 + %.1372 =l add %.325, 2500 + %.1373 =w copy 5 + storew %.1373, %.1372 + %.1374 =l add %.325, 2504 + %.1375 =w copy 462078022 + storew %.1375, %.1374 + %.1376 =l add %.325, 2508 + %.1377 =l extsw 0 + %.1378 =l sub %.1377, 7 + %.1379 =w copy %.1378 + storew %.1379, %.1376 + %.1380 =l add %.325, 2512 + %.1381 =l extsw 0 + %.1382 =l sub %.1381, 1 + %.1383 =w copy %.1382 + storew %.1383, %.1380 + %.1384 =l add %.325, 2516 + storew 0, %.1384 + %.1385 =l add %.325, 2520 + %.1386 =w copy 30 + storeb %.1386, %.1385 + %.1387 =l add %.325, 2521 + storeb 0, %.1387 + %.1388 =l add %.325, 2522 + storeh 0, %.1388 + %.1389 =l add %.325, 2524 + storew 0, %.1389 + %.1390 =l add %.325, 2528 + storel 4531615791379082412, %.1390 + %.1391 =l add %.325, 2536 + %.1392 =w copy 3542425067 + storew %.1392, %.1391 + %.1393 =l add %.325, 2540 + storew 0, %.1393 + %.1394 =l add %.325, 2544 + %.1395 =l copy 18446744073709551615 + storel %.1395, %.1394 + %.1396 =l add %.325, 2552 + %.1397 =w copy 2349175835 + storew %.1397, %.1396 + %.1398 =l add %.325, 2556 + %.1399 =w copy 1457159742 + storew %.1399, %.1398 + %.1400 =l add %.325, 2560 + %.1401 =w copy 673000678 + storew %.1401, %.1400 + %.1402 =l add %.325, 2564 + %.1403 =w copy 2013111086 + storew %.1403, %.1402 + %.1404 =l add %.325, 2568 + %.1405 =w copy 713487104 + storew %.1405, %.1404 + %.1406 =l add %.325, 2572 + storew 0, %.1406 + %.1407 =l add %.325, 2576 + %.1408 =w copy 59 + storeb %.1408, %.1407 + %.1409 =l add %.325, 2577 + storeb 0, %.1409 + %.1410 =l add %.325, 2578 + storeh 0, %.1410 + %.1411 =l add %.325, 2580 + storew 0, %.1411 + %.1412 =l add %.325, 2584 + storel 5846713185812282113, %.1412 + %.1413 =l add %.325, 2592 + %.1414 =w copy 3470287970 + storew %.1414, %.1413 + %.1415 =l add %.325, 2596 + storew 0, %.1415 + %.1416 =l add %.325, 2600 + storel 12566983408779698474, %.1416 + %.1417 =l add %.325, 2608 + %.1418 =w copy 848682309 + storew %.1418, %.1417 + %.1419 =l add %.325, 2612 + %.1420 =w copy 5 + storew %.1420, %.1419 + %.1421 =l add %.325, 2616 + %.1422 =w copy 462078022 + storew %.1422, %.1421 + %.1423 =l add %.325, 2620 + %.1424 =l extsw 0 + %.1425 =l sub %.1424, 7 + %.1426 =w copy %.1425 + storew %.1426, %.1423 + %.1427 =l add %.325, 2624 + %.1428 =l extsw 0 + %.1429 =l sub %.1428, 1 + %.1430 =w copy %.1429 + storew %.1430, %.1427 + %.1431 =l add %.325, 2628 + storew 0, %.1431 + %.1432 =l add %.325, 2632 + %.1433 =w copy 30 + storeb %.1433, %.1432 + %.1434 =l add %.325, 2633 + storeb 0, %.1434 + %.1435 =l add %.325, 2634 + storeh 0, %.1435 + %.1436 =l add %.325, 2636 + storew 0, %.1436 + %.1437 =l add %.325, 2640 + storel 4531615791379082412, %.1437 + %.1438 =l add %.325, 2648 + %.1439 =w copy 3542425067 + storew %.1439, %.1438 + %.1440 =l add %.325, 2652 + storew 0, %.1440 + %.1441 =l add %.325, 2656 + %.1442 =l copy 18446744073709551615 + storel %.1442, %.1441 + %.1443 =l add %.325, 2664 + %.1444 =w copy 2349175835 + storew %.1444, %.1443 + %.1445 =l add %.325, 2668 + %.1446 =w copy 1457159742 + storew %.1446, %.1445 + %.1447 =l add %.325, 2672 + %.1448 =w copy 673000678 + storew %.1448, %.1447 + %.1449 =l add %.325, 2676 + %.1450 =w copy 2013111086 + storew %.1450, %.1449 + %.1451 =l add %.325, 2680 + %.1452 =w copy 713487104 + storew %.1452, %.1451 + %.1453 =l add %.325, 2684 + storew 0, %.1453 + %.1454 =l add %.325, 2688 + %.1455 =w copy 59 + storeb %.1455, %.1454 + %.1456 =l add %.325, 2689 + storeb 0, %.1456 + %.1457 =l add %.325, 2690 + storeh 0, %.1457 + %.1458 =l add %.325, 2692 + storew 0, %.1458 + %.1459 =l add %.325, 2696 + storel 5846713185812282113, %.1459 + %.1460 =l add %.325, 2704 + %.1461 =w copy 3470287970 + storew %.1461, %.1460 + %.1462 =l add %.325, 2708 + storew 0, %.1462 + %.1463 =l add %.325, 2712 + storel 12566983408779698474, %.1463 + %.1464 =l add %.325, 2720 + %.1465 =w copy 848682309 + storew %.1465, %.1464 + %.1466 =l add %.325, 2724 + %.1467 =w copy 5 + storew %.1467, %.1466 + %.1468 =l add %.325, 2728 + %.1469 =w copy 462078022 + storew %.1469, %.1468 + %.1470 =l add %.325, 2732 + %.1471 =l extsw 0 + %.1472 =l sub %.1471, 7 + %.1473 =w copy %.1472 + storew %.1473, %.1470 + %.1474 =l add %.325, 2736 + %.1475 =l extsw 0 + %.1476 =l sub %.1475, 1 + %.1477 =w copy %.1476 + storew %.1477, %.1474 + %.1478 =l add %.325, 2740 + storew 0, %.1478 + %.1479 =l add %.325, 2744 + %.1480 =w copy 30 + storeb %.1480, %.1479 + %.1481 =l add %.325, 2745 + storeb 0, %.1481 + %.1482 =l add %.325, 2746 + storeh 0, %.1482 + %.1483 =l add %.325, 2748 + storew 0, %.1483 + %.1484 =l add %.325, 2752 + storel 4531615791379082412, %.1484 + %.1485 =l add %.325, 2760 + %.1486 =w copy 3542425067 + storew %.1486, %.1485 + %.1487 =l add %.325, 2764 + storew 0, %.1487 + %.1488 =l add %.325, 2768 + %.1489 =l copy 18446744073709551615 + storel %.1489, %.1488 + %.1490 =l add %.325, 2776 + %.1491 =w copy 2349175835 + storew %.1491, %.1490 + %.1492 =l add %.325, 2780 + %.1493 =w copy 1457159742 + storew %.1493, %.1492 + %.1494 =l add %.325, 2784 + %.1495 =w copy 673000678 + storew %.1495, %.1494 + %.1496 =l add %.325, 2788 + %.1497 =w copy 2013111086 + storew %.1497, %.1496 + %.1498 =l add %.325, 2792 + %.1499 =w copy 713487104 + storew %.1499, %.1498 + %.1500 =l add %.325, 2796 + storew 0, %.1500 + %.1501 =l add %.325, 2800 + %.1502 =w copy 59 + storeb %.1502, %.1501 + %.1503 =l add %.325, 2801 + storeb 0, %.1503 + %.1504 =l add %.325, 2802 + storeh 0, %.1504 + %.1505 =l add %.325, 2804 + storew 0, %.1505 + %.1506 =l add %.325, 2808 + storel 5846713185812282113, %.1506 + %.1507 =l add %.325, 2816 + %.1508 =w copy 3470287970 + storew %.1508, %.1507 + %.1509 =l add %.325, 2820 + storew 0, %.1509 + %.1510 =l add %.325, 2824 + storel 12566983408779698474, %.1510 + %.1511 =l add %.325, 2832 + %.1512 =w copy 848682309 + storew %.1512, %.1511 + %.1513 =l add %.325, 2836 + %.1514 =w copy 5 + storew %.1514, %.1513 + %.1515 =l add %.325, 2840 + %.1516 =w copy 462078022 + storew %.1516, %.1515 + %.1517 =l add %.325, 2844 + %.1518 =l extsw 0 + %.1519 =l sub %.1518, 7 + %.1520 =w copy %.1519 + storew %.1520, %.1517 + %.1521 =l add %.325, 2848 + %.1522 =l extsw 0 + %.1523 =l sub %.1522, 1 + %.1524 =w copy %.1523 + storew %.1524, %.1521 + %.1525 =l add %.325, 2852 + storew 0, %.1525 + %.1526 =l add %.325, 2856 + %.1527 =w copy 30 + storeb %.1527, %.1526 + %.1528 =l add %.325, 2857 + storeb 0, %.1528 + %.1529 =l add %.325, 2858 + storeh 0, %.1529 + %.1530 =l add %.325, 2860 + storew 0, %.1530 + %.1531 =l add %.325, 2864 + storel 4531615791379082412, %.1531 + %.1532 =l add %.325, 2872 + %.1533 =w copy 3542425067 + storew %.1533, %.1532 + %.1534 =l add %.325, 2876 + storew 0, %.1534 + %.1535 =l add %.325, 2880 + %.1536 =l copy 18446744073709551615 + storel %.1536, %.1535 + %.1537 =l add %.325, 2888 + %.1538 =w copy 2349175835 + storew %.1538, %.1537 + %.1539 =l add %.325, 2892 + %.1540 =w copy 1457159742 + storew %.1540, %.1539 + %.1541 =l add %.325, 2896 + %.1542 =w copy 673000678 + storew %.1542, %.1541 + %.1543 =l add %.325, 2900 + %.1544 =w copy 2013111086 + storew %.1544, %.1543 + %.1545 =l add %.325, 2904 + %.1546 =w copy 713487104 + storew %.1546, %.1545 + %.1547 =l add %.325, 2908 + storew 0, %.1547 + %.1548 =l add %.325, 2912 + %.1549 =w copy 59 + storeb %.1549, %.1548 + %.1550 =l add %.325, 2913 + storeb 0, %.1550 + %.1551 =l add %.325, 2914 + storeh 0, %.1551 + %.1552 =l add %.325, 2916 + storew 0, %.1552 + %.1553 =l add %.325, 2920 + storel 5846713185812282113, %.1553 + %.1554 =l add %.325, 2928 + %.1555 =w copy 3470287970 + storew %.1555, %.1554 + %.1556 =l add %.325, 2932 + storew 0, %.1556 + %.1557 =l add %.325, 2936 + storel 12566983408779698474, %.1557 + %.1558 =l add %.325, 2944 + %.1559 =w copy 848682309 + storew %.1559, %.1558 + %.1560 =l add %.325, 2948 + %.1561 =w copy 5 + storew %.1561, %.1560 + %.1562 =l add %.325, 2952 + %.1563 =w copy 462078022 + storew %.1563, %.1562 + %.1564 =l add %.325, 2956 + %.1565 =l extsw 0 + %.1566 =l sub %.1565, 7 + %.1567 =w copy %.1566 + storew %.1567, %.1564 + %.1568 =l add %.325, 2960 + %.1569 =l extsw 0 + %.1570 =l sub %.1569, 1 + %.1571 =w copy %.1570 + storew %.1571, %.1568 + %.1572 =l add %.325, 2964 + storew 0, %.1572 + %.1573 =l add %.325, 2968 + %.1574 =w copy 30 + storeb %.1574, %.1573 + %.1575 =l add %.325, 2969 + storeb 0, %.1575 + %.1576 =l add %.325, 2970 + storeh 0, %.1576 + %.1577 =l add %.325, 2972 + storew 0, %.1577 + %.1578 =l add %.325, 2976 + storel 4531615791379082412, %.1578 + %.1579 =l add %.325, 2984 + %.1580 =w copy 3542425067 + storew %.1580, %.1579 + %.1581 =l add %.325, 2988 + storew 0, %.1581 + %.1582 =l add %.325, 2992 + %.1583 =l copy 18446744073709551615 + storel %.1583, %.1582 + %.1584 =l add %.325, 3000 + %.1585 =w copy 2349175835 + storew %.1585, %.1584 + %.1586 =l add %.325, 3004 + %.1587 =w copy 1457159742 + storew %.1587, %.1586 + %.1588 =l add %.325, 3008 + %.1589 =w copy 673000678 + storew %.1589, %.1588 + %.1590 =l add %.325, 3012 + %.1591 =w copy 2013111086 + storew %.1591, %.1590 + %.1592 =l add %.325, 3016 + %.1593 =w copy 713487104 + storew %.1593, %.1592 + %.1594 =l add %.325, 3020 + storew 0, %.1594 + %.1595 =l add %.325, 3024 + %.1596 =w copy 59 + storeb %.1596, %.1595 + %.1597 =l add %.325, 3025 + storeb 0, %.1597 + %.1598 =l add %.325, 3026 + storeh 0, %.1598 + %.1599 =l add %.325, 3028 + storew 0, %.1599 + %.1600 =l add %.325, 3032 + storel 5846713185812282113, %.1600 + %.1601 =l add %.325, 3040 + %.1602 =w copy 3470287970 + storew %.1602, %.1601 + %.1603 =l add %.325, 3044 + storew 0, %.1603 + %.1604 =l add %.325, 3048 + storel 12566983408779698474, %.1604 + %.1605 =l add %.325, 3056 + %.1606 =w copy 848682309 + storew %.1606, %.1605 + %.1607 =l add %.325, 3060 + %.1608 =w copy 5 + storew %.1608, %.1607 + %.1609 =l add %.325, 3064 + %.1610 =w copy 462078022 + storew %.1610, %.1609 + %.1611 =l add %.325, 3068 + %.1612 =l extsw 0 + %.1613 =l sub %.1612, 7 + %.1614 =w copy %.1613 + storew %.1614, %.1611 + %.1615 =l add %.325, 3072 + %.1616 =l extsw 0 + %.1617 =l sub %.1616, 1 + %.1618 =w copy %.1617 + storew %.1618, %.1615 + %.1619 =l add %.325, 3076 + storew 0, %.1619 + %.1620 =l add %.325, 3080 + %.1621 =w copy 30 + storeb %.1621, %.1620 + %.1622 =l add %.325, 3081 + storeb 0, %.1622 + %.1623 =l add %.325, 3082 + storeh 0, %.1623 + %.1624 =l add %.325, 3084 + storew 0, %.1624 + %.1625 =l add %.325, 3088 + storel 4531615791379082412, %.1625 + %.1626 =l add %.325, 3096 + %.1627 =w copy 3542425067 + storew %.1627, %.1626 + %.1628 =l add %.325, 3100 + storew 0, %.1628 + %.1629 =l add %.325, 3104 + %.1630 =l copy 18446744073709551615 + storel %.1630, %.1629 + %.1631 =l add %.325, 3112 + %.1632 =w copy 2349175835 + storew %.1632, %.1631 + %.1633 =l add %.325, 3116 + %.1634 =w copy 1457159742 + storew %.1634, %.1633 + %.1635 =l add %.325, 3120 + %.1636 =w copy 673000678 + storew %.1636, %.1635 + %.1637 =l add %.325, 3124 + %.1638 =w copy 2013111086 + storew %.1638, %.1637 + %.1639 =l add %.325, 3128 + %.1640 =w copy 713487104 + storew %.1640, %.1639 + %.1641 =l add %.325, 3132 + storew 0, %.1641 + %.1643 =l add %.1642, 0 + %.1644 =w copy 0 + storeh %.1644, %.1643 + %.1646 =l add %.1645, 0 + %.1647 =w copy 8649 + storeh %.1647, %.1646 + %.1649 =l add %.1648, 0 + %.1650 =l copy 6084821566261148539 + storel %.1650, %.1649 + %.1651 =l add %.1648, 8 + storel 16245754612124257930, %.1651 + %.1652 =l add %.1648, 16 + %.1653 =l copy 4052120349730717228 + storel %.1653, %.1652 + %.1654 =l add %.1648, 24 + %.1655 =l copy 873105079974555151 + storel %.1655, %.1654 + %.1656 =l add %.1648, 32 + %.1657 =l copy 18446744073709551615 + storel %.1657, %.1656 + %.1658 =l add %.1648, 40 + %.1659 =l copy 18446744073709551606 + storel %.1659, %.1658 + %.1660 =l add %.1648, 48 + %.1661 =l copy 2875883040891070095 + storel %.1661, %.1660 + %.1662 =l add %.1648, 56 + %.1663 =l copy 1 + storel %.1663, %.1662 + %.1664 =l add %.1648, 64 + %.1665 =l copy 8230877399174301244 + storel %.1665, %.1664 + %.1666 =l add %.1648, 72 + %.1667 =l copy 0 + storel %.1667, %.1666 + %.1668 =l add %.1648, 80 + %.1669 =l copy 2248553449639285191 + storel %.1669, %.1668 + %.1670 =l add %.1648, 88 + storel 16175365243520763722, %.1670 + %.1671 =l add %.1648, 96 + %.1672 =l copy 18446744073709551615 + storel %.1672, %.1671 + %.1673 =l add %.1648, 104 + storel 16245754612124257930, %.1673 + %.1674 =l add %.1648, 112 + %.1675 =l copy 18446744073709551615 + storel %.1675, %.1674 + %.1676 =l add %.1648, 120 + %.1677 =l copy 8230877399174301244 + storel %.1677, %.1676 + %.1678 =l add %.1648, 128 + %.1679 =l copy 8230877399174301244 + storel %.1679, %.1678 + %.1680 =l add %.1648, 136 + %.1681 =l copy 4 + storel %.1681, %.1680 + %.1682 =l add %.1648, 144 + %.1683 =l copy 1 + storel %.1683, %.1682 + %.1684 =l add %.1648, 152 + %.1685 =l copy 7 + storel %.1685, %.1684 + %.1686 =l add %.1648, 160 + %.1687 =l copy 18446744073709551615 + storel %.1687, %.1686 + %.1688 =l add %.1648, 168 + storel 14224845232216782397, %.1688 + %.1689 =l add %.1648, 176 + %.1690 =l copy 6007172698835695880 + storel %.1690, %.1689 + %.1691 =l add %.1648, 184 + %.1692 =l copy 18446744073709551612 + storel %.1692, %.1691 + %.1693 =l add %.1648, 192 + %.1694 =l copy 0 + storel %.1694, %.1693 + %.1695 =l add %.1648, 200 + %.1696 =l copy 18446744073709551607 + storel %.1696, %.1695 + %.1697 =l add %.1648, 208 + storel 18269964541825259806, %.1697 + %.1698 =l add %.1648, 216 + %.1699 =l copy 0 + storel %.1699, %.1698 + %.1700 =l add %.1648, 224 + storel 18269964541825259806, %.1700 + %.1701 =l add %.1648, 232 + %.1702 =l copy 8230877399174301244 + storel %.1702, %.1701 + %.1703 =l add %.1648, 240 + %.1704 =l copy 0 + storel %.1704, %.1703 + %.1705 =l add %.1648, 248 + %.1706 =l copy 18446744073709551610 + storel %.1706, %.1705 + %.1707 =l add %.1648, 256 + storel 12201917979609006375, %.1707 + %.1708 =l add %.1648, 264 + storel 12800017575156089034, %.1708 + %.1709 =l add %.1648, 272 + storel 14583114485114116895, %.1709 + %.1710 =l add %.1648, 280 + %.1711 =l copy 18446744073709551615 + storel %.1711, %.1710 + %.1712 =l add %.1648, 288 + %.1713 =l copy 18446744073709551607 + storel %.1713, %.1712 + %.1714 =l add %.1648, 296 + %.1715 =l copy 0 + storel %.1715, %.1714 + %.1716 =l add %.1648, 304 + %.1717 =l copy 5937592181530390446 + storel %.1717, %.1716 + %.1718 =l add %.1648, 312 + %.1719 =l copy 7 + storel %.1719, %.1718 + %.1720 =l add %.1648, 320 + %.1721 =l copy 4052120349730717228 + storel %.1721, %.1720 + %.1722 =l add %.1648, 328 + %.1723 =l copy 18446744073709551611 + storel %.1723, %.1722 + %.1724 =l add %.1648, 336 + %.1725 =l copy 3705651564574322605 + storel %.1725, %.1724 + %.1726 =l add %.1648, 344 + storel 16245754612124257930, %.1726 + %.1727 =l add %.1648, 352 + storel 12201917979609006375, %.1727 + %.1728 =l add %.1648, 360 + %.1729 =l copy 18446744073709551615 + storel %.1729, %.1728 + %.1730 =l add %.1648, 368 + %.1731 =l copy 18446744073709551615 + storel %.1731, %.1730 + %.1732 =l add %.1648, 376 + %.1733 =l copy 5937592181530390446 + storel %.1733, %.1732 + %.1734 =l add %.1648, 384 + %.1735 =l copy 5937592181530390446 + storel %.1735, %.1734 + %.1736 =l add %.1648, 392 + %.1737 =l copy 18446744073709551615 + storel %.1737, %.1736 + %.1738 =l add %.1648, 400 + %.1739 =l copy 0 + storel %.1739, %.1738 + %.1740 =l add %.1648, 408 + storel 15873037008906187302, %.1740 + %.1741 =l add %.1648, 416 + %.1742 =l copy 8133712095574703050 + storel %.1742, %.1741 + %.1743 =l add %.1648, 424 + storel 12800017575156089034, %.1743 + %.1744 =l add %.1648, 432 + %.1745 =l copy 1 + storel %.1745, %.1744 + %.1746 =l add %.1648, 440 + %.1747 =l copy 0 + storel %.1747, %.1746 + %.1748 =l add %.1648, 448 + %.1749 =l copy 8230877399174301244 + storel %.1749, %.1748 + %.1750 =l add %.1648, 456 + %.1751 =l copy 18446744073709551607 + storel %.1751, %.1750 + %.1752 =l add %.1648, 464 + storel 18269964541825259806, %.1752 + %.1753 =l add %.1648, 472 + %.1754 =l copy 0 + storel %.1754, %.1753 + %.1755 =l add %.1648, 480 + %.1756 =l copy 3 + storel %.1756, %.1755 + %.1757 =l add %.1648, 488 + storel 10372949673387309524, %.1757 + %.1758 =l add %.1648, 496 + %.1759 =l copy 6084821566261148539 + storel %.1759, %.1758 + %.1760 =l add %.1648, 504 + %.1761 =l copy 18446744073709551607 + storel %.1761, %.1760 + %.1762 =l add %.1648, 512 + %.1763 =l copy 6007172698835695880 + storel %.1763, %.1762 + %.1764 =l add %.1648, 520 + %.1765 =l copy 0 + storel %.1765, %.1764 + %.1766 =l add %.1648, 528 + %.1767 =l copy 0 + storel %.1767, %.1766 + %.1768 =l add %.1648, 536 + %.1769 =l copy 0 + storel %.1769, %.1768 + %.1770 =l add %.1648, 544 + %.1771 =l copy 2875883040891070095 + storel %.1771, %.1770 + %.1772 =l add %.1648, 552 + %.1773 =l copy 4 + storel %.1773, %.1772 + %.1774 =l add %.1648, 560 + %.1775 =l copy 0 + storel %.1775, %.1774 + %.1776 =l add %.1648, 568 + %.1777 =l copy 18446744073709551615 + storel %.1777, %.1776 + %.1778 =l add %.1648, 576 + %.1779 =l copy 7 + storel %.1779, %.1778 + %.1780 =l add %.1648, 584 + storel 15873037008906187302, %.1780 + %.1781 =l add %.1648, 592 + %.1782 =l copy 18446744073709551615 + storel %.1782, %.1781 + %.1783 =l add %.1648, 600 + %.1784 =l copy 18446744073709551615 + storel %.1784, %.1783 + %.1785 =l add %.1648, 608 + storel 18269964541825259806, %.1785 + %.1786 =l add %.1648, 616 + %.1787 =l copy 7 + storel %.1787, %.1786 + %.1788 =l add %.1648, 624 + %.1789 =l copy 18446744073709551607 + storel %.1789, %.1788 + %.1790 =l add %.1648, 632 + %.1791 =l copy 1 + storel %.1791, %.1790 + %.1792 =l add %.1648, 640 + %.1793 =l copy 4052120349730717228 + storel %.1793, %.1792 + %.1794 =l add %.1648, 648 + %.1795 =l copy 2 + storel %.1795, %.1794 + %.1796 =l add %.1648, 656 + %.1797 =l copy 7 + storel %.1797, %.1796 + %.1798 =l add %.1648, 664 + %.1799 =l copy 2 + storel %.1799, %.1798 + %.1800 =l add %.1648, 672 + %.1801 =l copy 4052120349730717228 + storel %.1801, %.1800 + %.1802 =l add %.1648, 680 + %.1803 =l copy 18446744073709551615 + storel %.1803, %.1802 + %.1804 =l add %.1648, 688 + %.1805 =l copy 18446744073709551606 + storel %.1805, %.1804 + %.1806 =l add %.1648, 696 + %.1807 =l copy 0 + storel %.1807, %.1806 + %.1808 =l add %.1648, 704 + %.1809 =l copy 8230877399174301244 + storel %.1809, %.1808 + %.1810 =l add %.1648, 712 + %.1811 =l copy 18446744073709551607 + storel %.1811, %.1810 + %.1812 =l add %.1648, 720 + %.1813 =l copy 0 + storel %.1813, %.1812 + %.1814 =l add %.1648, 728 + storel 14224845232216782397, %.1814 + %.1815 =l add %.1648, 736 + %.1816 =l copy 6084821566261148539 + storel %.1816, %.1815 + %.1817 =l add %.1648, 744 + storel 14991488133450330097, %.1817 + %.1818 =l add %.1648, 752 + %.1819 =l copy 3705651564574322605 + storel %.1819, %.1818 + %.1820 =l add %.1648, 760 + %.1821 =l copy 1 + storel %.1821, %.1820 + %.1822 =l add %.1648, 768 + %.1823 =l copy 0 + storel %.1823, %.1822 + %.1824 =l add %.1648, 776 + %.1825 =l copy 18446744073709551607 + storel %.1825, %.1824 + %.1826 =l add %.1648, 784 + %.1827 =l copy 18446744073709551606 + storel %.1827, %.1826 + %.1828 =l add %.1648, 792 + %.1829 =l copy 18446744073709551607 + storel %.1829, %.1828 + %.1830 =l add %.1648, 800 + %.1831 =l copy 2248553449639285191 + storel %.1831, %.1830 + %.1832 =l add %.1648, 808 + storel 14991488133450330097, %.1832 + %.1833 =l add %.1648, 816 + %.1834 =l copy 8133712095574703050 + storel %.1834, %.1833 + %.1835 =l add %.1648, 824 + %.1836 =l copy 0 + storel %.1836, %.1835 + %.1837 =l add %.1648, 832 + %.1838 =l copy 4052120349730717228 + storel %.1838, %.1837 + %.1839 =l add %.1648, 840 + %.1840 =l copy 18446744073709551607 + storel %.1840, %.1839 + %.1841 =l add %.1648, 848 + %.1842 =l copy 0 + storel %.1842, %.1841 + %.1843 =l add %.1648, 856 + %.1844 =l copy 5937592181530390446 + storel %.1844, %.1843 + %.1845 =l add %.1648, 864 + %.1846 =l copy 7 + storel %.1846, %.1845 + %.1847 =l add %.1648, 872 + %.1848 =l copy 1 + storel %.1848, %.1847 + %.1849 =l add %.1648, 880 + %.1850 =l copy 7 + storel %.1850, %.1849 + %.1851 =l add %.1648, 888 + %.1852 =l copy 873105079974555151 + storel %.1852, %.1851 + %.1853 =l add %.1648, 896 + %.1854 =l copy 3705651564574322605 + storel %.1854, %.1853 + %.1855 =l add %.1648, 904 + storel 10372949673387309524, %.1855 + %.1856 =l add %.1648, 912 + %.1857 =l copy 18446744073709551615 + storel %.1857, %.1856 + %.1858 =l add %.1648, 920 + storel 14234092197388013524, %.1858 + %.1859 =l add %.1648, 928 + %.1860 =l copy 0 + storel %.1860, %.1859 + %.1861 =l add %.1648, 936 + %.1862 =l copy 0 + storel %.1862, %.1861 + %.1863 =l add %.1648, 944 + storel 14234092197388013524, %.1863 + %.1864 =l add %.1648, 952 + %.1865 =l copy 4 + storel %.1865, %.1864 + %.1866 =l add %.1648, 960 + %.1867 =l copy 1 + storel %.1867, %.1866 + %.1868 =l add %.1648, 968 + storel 14991488133450330097, %.1868 + %.1869 =l add %.1648, 976 + storel 12201917979609006375, %.1869 + %.1870 =l add %.1648, 984 + storel 16175365243520763722, %.1870 + %.1871 =l add %.1648, 992 + %.1872 =l copy 6007172698835695880 + storel %.1872, %.1871 + %.1873 =l add %.1648, 1000 + %.1874 =l copy 5937592181530390446 + storel %.1874, %.1873 + %.1875 =l add %.1648, 1008 + %.1876 =l copy 0 + storel %.1876, %.1875 + %.1877 =l add %.1648, 1016 + %.1878 =l copy 18446744073709551608 + storel %.1878, %.1877 + %.1879 =l add %.1648, 1024 + %.1880 =l copy 1 + storel %.1880, %.1879 + %.1881 =l add %.1648, 1032 + %.1882 =l copy 0 + storel %.1882, %.1881 + %.1883 =l add %.1648, 1040 + %.1884 =l copy 876013142962575738 + storel %.1884, %.1883 + %.1885 =l add %.1648, 1048 + storel 14224845232216782397, %.1885 + %.1886 =l add %.1648, 1056 + %.1887 =l copy 4052120349730717228 + storel %.1887, %.1886 + %.1888 =l add %.1648, 1064 + storel 16175365243520763722, %.1888 + %.1889 =l add %.1648, 1072 + %.1890 =l copy 1 + storel %.1890, %.1889 + %.1891 =l add %.1648, 1080 + %.1892 =l copy 1 + storel %.1892, %.1891 + %.1893 =l add %.1648, 1088 + %.1894 =l copy 18446744073709551606 + storel %.1894, %.1893 + %.1895 =l add %.1648, 1096 + %.1896 =l copy 0 + storel %.1896, %.1895 + %.1897 =l add %.1648, 1104 + storel 14234092197388013524, %.1897 + %.1898 =l add %.1648, 1112 + %.1899 =l copy 18446744073709551615 + storel %.1899, %.1898 + %.1900 =l add %.1648, 1120 + %.1901 =l copy 0 + storel %.1901, %.1900 + %.1902 =l add %.1648, 1128 + %.1903 =l copy 2 + storel %.1903, %.1902 + %.1904 =l add %.1648, 1136 + %.1905 =l copy 2248553449639285191 + storel %.1905, %.1904 + %.1906 =l add %.1648, 1144 + storel 10372949673387309524, %.1906 + %.1907 =l add %.1648, 1152 + storel 12201917979609006375, %.1907 + %.1908 =l add %.1648, 1160 + %.1909 =l copy 18446744073709551606 + storel %.1909, %.1908 + %.1910 =l add %.1648, 1168 + storel 18269964541825259806, %.1910 + %.1911 =l add %.1648, 1176 + %.1912 =l copy 2875883040891070095 + storel %.1912, %.1911 + %.1913 =l add %.1648, 1184 + %.1914 =l copy 7 + storel %.1914, %.1913 + %.1915 =l add %.1648, 1192 + %.1916 =l copy 7 + storel %.1916, %.1915 + %.1917 =l add %.1648, 1200 + %.1918 =l copy 0 + storel %.1918, %.1917 + %.1919 =l add %.1648, 1208 + %.1920 =l copy 18446744073709551615 + storel %.1920, %.1919 + %.1921 =l add %.1648, 1216 + %.1922 =l copy 0 + storel %.1922, %.1921 + %.1923 =l add %.1648, 1224 + %.1924 =l copy 0 + storel %.1924, %.1923 + %.1925 =l add %.1648, 1232 + storel 14583114485114116895, %.1925 + %.1926 =l add %.1648, 1240 + %.1927 =l copy 1 + storel %.1927, %.1926 + %.1928 =l add %.1648, 1248 + %.1929 =l copy 0 + storel %.1929, %.1928 + %.1930 =l add %.1648, 1256 + %.1931 =l copy 1 + storel %.1931, %.1930 + %.1932 =l add %.1648, 1264 + %.1933 =l copy 18446744073709551606 + storel %.1933, %.1932 + %.1934 =l add %.1648, 1272 + %.1935 =l copy 8230877399174301244 + storel %.1935, %.1934 + %.1936 =l add %.1648, 1280 + %.1937 =l copy 876013142962575738 + storel %.1937, %.1936 + %.1938 =l add %.1648, 1288 + storel 10372949673387309524, %.1938 + %.1939 =l add %.1648, 1296 + %.1940 =l copy 6007172698835695880 + storel %.1940, %.1939 + %.1941 =l add %.1648, 1304 + storel 14991488133450330097, %.1941 + %.1942 =l add %.1648, 1312 + %.1943 =l copy 0 + storel %.1943, %.1942 + %.1944 =l add %.1648, 1320 + %.1945 =l copy 5937592181530390446 + storel %.1945, %.1944 + %.1946 =l add %.1648, 1328 + %.1947 =l copy 8230877399174301244 + storel %.1947, %.1946 + %.1948 =l add %.1648, 1336 + %.1949 =l copy 1 + storel %.1949, %.1948 + %.1950 =l add %.1648, 1344 + %.1951 =l copy 8230877399174301244 + storel %.1951, %.1950 + %.1952 =l add %.1648, 1352 + %.1953 =l copy 5937592181530390446 + storel %.1953, %.1952 + %.1954 =l add %.1648, 1360 + %.1955 =l copy 1 + storel %.1955, %.1954 + %.1956 =l add %.1648, 1368 + storel 15873037008906187302, %.1956 + %.1957 =l add %.1648, 1376 + %.1958 =l copy 0 + storel %.1958, %.1957 + %.1959 =l add %.1648, 1384 + %.1960 =l copy 2 + storel %.1960, %.1959 + %.1961 =l add %.1648, 1392 + %.1962 =l copy 2248553449639285191 + storel %.1962, %.1961 + %.1963 =l add %.1648, 1400 + storel 14234092197388013524, %.1963 + %.1964 =l add %.1648, 1408 + %.1965 =l copy 18446744073709551615 + storel %.1965, %.1964 + %.1966 =l add %.1648, 1416 + %.1967 =l copy 2875883040891070095 + storel %.1967, %.1966 + %.1968 =l add %.1648, 1424 + %.1969 =l copy 18446744073709551607 + storel %.1969, %.1968 + %.1970 =l add %.1648, 1432 + %.1971 =l copy 18446744073709551608 + storel %.1971, %.1970 + %.1972 =l add %.1648, 1440 + %.1973 =l copy 7 + storel %.1973, %.1972 + %.1974 =l add %.1648, 1448 + %.1975 =l copy 18446744073709551611 + storel %.1975, %.1974 + %.1976 =l add %.1648, 1456 + %.1977 =l copy 2248553449639285191 + storel %.1977, %.1976 + %.1978 =l add %.1648, 1464 + storel 15873037008906187302, %.1978 + %.1979 =l add %.1648, 1472 + %.1980 =l copy 2248553449639285191 + storel %.1980, %.1979 + %.1981 =l add %.1648, 1480 + %.1982 =l copy 18446744073709551607 + storel %.1982, %.1981 + %.1983 =l add %.1648, 1488 + %.1984 =l copy 18446744073709551607 + storel %.1984, %.1983 + %.1985 =l add %.1648, 1496 + %.1986 =l copy 0 + storel %.1986, %.1985 + %.1987 =l add %.1648, 1504 + %.1988 =l copy 2875883040891070095 + storel %.1988, %.1987 + %.1989 =l add %.1648, 1512 + %.1990 =l copy 5937592181530390446 + storel %.1990, %.1989 + %.1991 =l add %.1648, 1520 + %.1992 =l copy 2248553449639285191 + storel %.1992, %.1991 + %.1993 =l add %.1648, 1528 + %.1994 =l copy 18446744073709551610 + storel %.1994, %.1993 + %.1995 =l add %.1648, 1536 + %.1996 =l copy 4052120349730717228 + storel %.1996, %.1995 + %.1997 =l add %.1648, 1544 + %.1998 =l copy 18446744073709551607 + storel %.1998, %.1997 + %.1999 =l add %.1648, 1552 + %.2000 =l copy 0 + storel %.2000, %.1999 + %.2001 =l add %.1648, 1560 + %.2002 =l copy 1 + storel %.2002, %.2001 + %.2003 =l add %.1648, 1568 + %.2004 =l copy 18446744073709551615 + storel %.2004, %.2003 + %.2005 =l add %.1648, 1576 + %.2006 =l copy 18446744073709551608 + storel %.2006, %.2005 + %.2007 =l add %.1648, 1584 + storel 18269964541825259806, %.2007 + %.2008 =l add %.1648, 1592 + %.2009 =l copy 8230877399174301244 + storel %.2009, %.2008 + %.2011 =l add %.2010, 0 + %.2012 =w copy 886398557 + storew %.2012, %.2011 + storew 0, %.2013 +@for_cond.712 + %.2016 =w loadsw %.2013 + %.2017 =w csltw %.2016, 1 + jnz %.2017, @for_body.713, @for_join.715 +@for_body.713 + %.2018 =w copy 1 + %.2019 =w loadsw %.2013 + %.2020 =l extsw %.2019 + %.2021 =l mul %.2020, 4 + %.2022 =l add %.184, %.2021 + storew %.2018, %.2022 +@for_cont.714 + %.2023 =w loadsw %.2013 + %.2024 =w add %.2023, 1 + storew %.2024, %.2013 + jmp @for_cond.712 +@for_join.715 + storew 0, %.2013 +@for_cond.716 + %.2025 =w loadsw %.2013 + %.2026 =w csltw %.2025, 7 + jnz %.2026, @for_body.717, @for_join.719 +@for_body.717 + %.2027 =l copy $g_185 + %.2028 =l mul 16, 1 + %.2029 =l add %.2027, %.2028 + %.2030 =l copy %.2029 + %.2031 =w loadsw %.2013 + %.2032 =l extsw %.2031 + %.2033 =l mul %.2032, 8 + %.2034 =l add %.308, %.2033 + storel %.2030, %.2034 +@for_cont.718 + %.2035 =w loadsw %.2013 + %.2036 =w add %.2035, 1 + storew %.2036, %.2013 + jmp @for_cond.716 +@for_join.719 + storew 0, %.2013 +@for_cond.720 + %.2037 =w loadsw %.2013 + %.2038 =w csltw %.2037, 2 + jnz %.2038, @for_body.721, @for_join.723 +@for_body.721 + %.2039 =w copy 2935257452 + %.2040 =w loadsw %.2013 + %.2041 =l extsw %.2040 + %.2042 =l mul %.2041, 4 + %.2043 =l add %.309, %.2042 + storew %.2039, %.2043 +@for_cont.722 + %.2044 =w loadsw %.2013 + %.2045 =w add %.2044, 1 + storew %.2045, %.2013 + jmp @for_cond.720 +@for_join.723 + %.2046 =w copy 0 + storeb %.2046, $g_2 +@for_cond.724 + %.2047 =w loadsb $g_2 + %.2048 =w extsb %.2047 + %.2049 =w cslew %.2048, 5 + jnz %.2049, @for_body.725, @for_join.727 +@for_body.725 + %.2052 =l add %.2051, 0 + storel %.7, %.2052 + %.2054 =l add %.2053, 0 + %.2055 =l copy $g_265 + %.2056 =l mul 24, 1 + %.2057 =l add %.2055, %.2056 + %.2058 =l copy %.2057 + storel %.2058, %.2054 + %.2060 =l add %.2059, 0 + %.2061 =l copy 1 + storel %.2061, %.2060 + %.2063 =l add %.2062, 0 + %.2064 =l extsw 0 + %.2065 =l sub %.2064, 6 + %.2066 =w copy %.2065 + storeh %.2066, %.2063 + %.2068 =l add %.2067, 0 + storel $g_1476, %.2068 + %.2069 =l add %.2067, 8 + storel $g_1476, %.2069 + %.2070 =l add %.2067, 16 + storel $g_1476, %.2070 + %.2071 =l add %.2067, 24 + storel $g_1476, %.2071 + %.2072 =l add %.2067, 32 + storel $g_1476, %.2072 + %.2073 =l add %.2067, 40 + storel $g_1476, %.2073 + %.2074 =l add %.2067, 48 + storel $g_1476, %.2074 + %.2075 =l add %.2067, 56 + storel $g_1476, %.2075 + %.2077 =l add %.2076, 0 + %.2078 =w copy 18446744073709551615 + storew %.2078, %.2077 + %.2079 =l add %.2076, 4 + %.2080 =w copy 621699884 + storew %.2080, %.2079 + %.2081 =l add %.2076, 8 + %.2082 =w copy 3733628126 + storew %.2082, %.2081 + %.2083 =l add %.2076, 12 + %.2084 =w copy 1999332396 + storew %.2084, %.2083 + %.2085 =l add %.2076, 16 + %.2086 =w copy 8 + storew %.2086, %.2085 + %.2087 =l add %.2076, 20 + %.2088 =w copy 1999332396 + storew %.2088, %.2087 + %.2089 =l add %.2076, 24 + %.2090 =w copy 18446744073709551615 + storew %.2090, %.2089 + %.2091 =l add %.2076, 28 + %.2092 =w copy 7 + storew %.2092, %.2091 + %.2093 =l add %.2076, 32 + %.2094 =w copy 18446744073709551615 + storew %.2094, %.2093 + %.2095 =l add %.2076, 36 + %.2096 =w copy 621699884 + storew %.2096, %.2095 + %.2097 =l add %.2076, 40 + %.2098 =w copy 18446744073709551615 + storew %.2098, %.2097 + %.2099 =l add %.2076, 44 + %.2100 =w copy 18446744073709551606 + storew %.2100, %.2099 + %.2101 =l add %.2076, 48 + %.2102 =w copy 3733628126 + storew %.2102, %.2101 + %.2103 =l add %.2076, 52 + %.2104 =w copy 621699884 + storew %.2104, %.2103 + %.2105 =l add %.2076, 56 + %.2106 =w copy 18446744073709551615 + storew %.2106, %.2105 + %.2107 =l add %.2076, 60 + %.2108 =w copy 7 + storew %.2108, %.2107 + %.2109 =l add %.2076, 64 + %.2110 =w copy 18446744073709551615 + storew %.2110, %.2109 + %.2111 =l add %.2076, 68 + %.2112 =w copy 621699884 + storew %.2112, %.2111 + %.2113 =l add %.2076, 72 + %.2114 =w copy 18446744073709551615 + storew %.2114, %.2113 + %.2115 =l add %.2076, 76 + %.2116 =w copy 3827321299 + storew %.2116, %.2115 + %.2117 =l add %.2076, 80 + %.2118 =w copy 8 + storew %.2118, %.2117 + %.2119 =l add %.2076, 84 + %.2120 =w copy 7 + storew %.2120, %.2119 + %.2121 =l add %.2076, 88 + %.2122 =w copy 1116279750 + storew %.2122, %.2121 + %.2123 =l add %.2076, 92 + %.2124 =w copy 1999332396 + storew %.2124, %.2123 + %.2125 =l add %.2076, 96 + %.2126 =w copy 3733628126 + storew %.2126, %.2125 + %.2127 =l add %.2076, 100 + %.2128 =w copy 1999332396 + storew %.2128, %.2127 + %.2129 =l add %.2076, 104 + %.2130 =w copy 8 + storew %.2130, %.2129 + %.2131 =l add %.2076, 108 + %.2132 =w copy 1999332396 + storew %.2132, %.2131 + %.2133 =l add %.2076, 112 + %.2134 =w copy 3733628126 + storew %.2134, %.2133 + %.2135 =l add %.2076, 116 + %.2136 =w copy 621699884 + storew %.2136, %.2135 + %.2137 =l add %.2076, 120 + %.2138 =w copy 18446744073709551611 + storew %.2138, %.2137 + %.2139 =l add %.2076, 124 + %.2140 =w copy 1999332396 + storew %.2140, %.2139 + %.2141 =l add %.2076, 128 + %.2142 =w copy 18446744073709551615 + storew %.2142, %.2141 + %.2143 =l add %.2076, 132 + %.2144 =w copy 18446744073709551606 + storew %.2144, %.2143 + %.2145 =l add %.2076, 136 + %.2146 =w copy 1116279750 + storew %.2146, %.2145 + %.2147 =l add %.2076, 140 + %.2148 =w copy 18446744073709551606 + storew %.2148, %.2147 + %.2149 =l add %.2076, 144 + %.2150 =w copy 18446744073709551611 + storew %.2150, %.2149 + %.2151 =l add %.2076, 148 + %.2152 =w copy 3827321299 + storew %.2152, %.2151 + %.2153 =l add %.2076, 152 + %.2154 =w copy 18446744073709551611 + storew %.2154, %.2153 + %.2155 =l add %.2076, 156 + %.2156 =w copy 1999332396 + storew %.2156, %.2155 + %.2157 =l add %.2076, 160 + %.2158 =w copy 18446744073709551615 + storew %.2158, %.2157 + %.2159 =l add %.2076, 164 + %.2160 =w copy 18446744073709551606 + storew %.2160, %.2159 + %.2161 =l add %.2076, 168 + %.2162 =w copy 3733628126 + storew %.2162, %.2161 + %.2163 =l add %.2076, 172 + %.2164 =w copy 621699884 + storew %.2164, %.2163 + %.2165 =l add %.2076, 176 + %.2166 =w copy 18446744073709551615 + storew %.2166, %.2165 + %.2167 =l add %.2076, 180 + %.2168 =w copy 7 + storew %.2168, %.2167 + %.2169 =l add %.2076, 184 + %.2170 =w copy 18446744073709551615 + storew %.2170, %.2169 + %.2171 =l add %.2076, 188 + %.2172 =w copy 621699884 + storew %.2172, %.2171 + %.2173 =l add %.2076, 192 + %.2174 =w copy 18446744073709551615 + storew %.2174, %.2173 + %.2175 =l add %.2076, 196 + %.2176 =w copy 3827321299 + storew %.2176, %.2175 + %.2177 =l add %.2076, 200 + %.2178 =w copy 8 + storew %.2178, %.2177 + %.2179 =l add %.2076, 204 + %.2180 =w copy 7 + storew %.2180, %.2179 + %.2181 =l add %.2076, 208 + %.2182 =w copy 1116279750 + storew %.2182, %.2181 + %.2183 =l add %.2076, 212 + %.2184 =w copy 1999332396 + storew %.2184, %.2183 + storew 0, %.2185 +@for_cond.728 + %.2187 =w loadsw %.2185 + %.2188 =w csltw %.2187, 5 + jnz %.2188, @for_body.729, @for_join.731 +@for_body.729 + %.2189 =w loadsw %.2185 + %.2190 =l extsw %.2189 + %.2191 =l mul %.2190, 8 + %.2192 =l add %.2050, %.2191 + storel $g_23, %.2192 +@for_cont.730 + %.2193 =w loadsw %.2185 + %.2194 =w add %.2193, 1 + storew %.2194, %.2185 + jmp @for_cond.728 +@for_join.731 + %.2195 =w loadsb $g_2 + %.2196 =l extsb %.2195 + %.2197 =l mul %.2196, 4 + %.2198 =l add %.154, %.2197 + %.2199 =w loaduw %.2198 + %.2200 =w copy %.2199 + %.2201 =l call $func_8(w %.2200) + storel %.2201, %.1 + %.2202 =l loadl %.167 + %.2203 =l loadl %.167 + %.2204 =l call $func_4(l %.2201, l %.2202, l %.2203) + storel %.2204, %.167 + %.2205 =l loadl %.1 + storel %.2205, %.167 + %.2206 =w loadsb $g_2 + %.2207 =l extsb %.2206 + %.2208 =l mul %.2207, 4 + %.2209 =l add %.154, %.2208 + %.2210 =w loaduw %.2209 + %.2211 =l loadl %.9 + storel %.2211, %.2051 + %.2212 =l loadl %.173 + storel %.2212, %.11 + %.2213 =w cnel %.2211, %.2212 + %.2214 =l extsw %.2213 + %.2215 =l loadl %.2053 + storel %.2214, %.2215 + %.2216 =l copy 3872474516526135072 + %.2217 =l and %.2214, %.2216 + %.2218 =w cnel %.2217, 0 + jnz %.2218, @if_true.732, @if_false.733 +@if_true.732 + %.2220 =l add %.2219, 0 + %.2221 =w copy 29657 + storeh %.2221, %.2220 + %.2222 =l add %.2219, 2 + %.2223 =w copy 5 + storeh %.2223, %.2222 + %.2224 =l add %.2219, 4 + %.2225 =w copy 65535 + storeh %.2225, %.2224 + %.2226 =l add %.2219, 6 + %.2227 =w copy 11174 + storeh %.2227, %.2226 + %.2228 =l add %.2219, 8 + %.2229 =w copy 17984 + storeh %.2229, %.2228 + %.2230 =l add %.2219, 10 + %.2231 =w copy 17984 + storeh %.2231, %.2230 + %.2232 =l add %.2219, 12 + %.2233 =w copy 11174 + storeh %.2233, %.2232 + %.2234 =l add %.2219, 14 + %.2235 =w copy 28699 + storeh %.2235, %.2234 + %.2236 =l add %.2219, 16 + %.2237 =w copy 65532 + storeh %.2237, %.2236 + %.2238 =l add %.2219, 18 + %.2239 =w copy 28699 + storeh %.2239, %.2238 + %.2240 =l add %.2219, 20 + %.2241 =w copy 65529 + storeh %.2241, %.2240 + %.2242 =l add %.2219, 22 + %.2243 =w copy 0 + storeh %.2243, %.2242 + %.2244 =l add %.2219, 24 + %.2245 =w copy 9905 + storeh %.2245, %.2244 + %.2246 =l add %.2219, 26 + %.2247 =w copy 2665 + storeh %.2247, %.2246 + %.2248 =l add %.2219, 28 + %.2249 =w copy 42935 + storeh %.2249, %.2248 + %.2250 =l add %.2219, 30 + %.2251 =w copy 6 + storeh %.2251, %.2250 + %.2252 =l add %.2219, 32 + %.2253 =w copy 11174 + storeh %.2253, %.2252 + %.2254 =l add %.2219, 34 + %.2255 =w copy 5 + storeh %.2255, %.2254 + %.2256 =l add %.2219, 36 + %.2257 =w copy 8560 + storeh %.2257, %.2256 + %.2258 =l add %.2219, 38 + %.2259 =w copy 0 + storeh %.2259, %.2258 + %.2260 =l add %.2219, 40 + %.2261 =w copy 29657 + storeh %.2261, %.2260 + %.2262 =l add %.2219, 42 + %.2263 =w copy 9905 + storeh %.2263, %.2262 + %.2264 =l add %.2219, 44 + %.2265 =w copy 65530 + storeh %.2265, %.2264 + %.2266 =l add %.2219, 46 + %.2267 =w copy 20681 + storeh %.2267, %.2266 + %.2268 =l add %.2219, 48 + %.2269 =w copy 20681 + storeh %.2269, %.2268 + %.2270 =l add %.2219, 50 + %.2271 =w copy 65530 + storeh %.2271, %.2270 + %.2272 =l add %.2219, 52 + %.2273 =w copy 9905 + storeh %.2273, %.2272 + %.2274 =l add %.2219, 54 + %.2275 =w copy 1 + storeh %.2275, %.2274 + %.2276 =l add %.2219, 56 + %.2277 =w copy 1 + storeh %.2277, %.2276 + %.2278 =l add %.2219, 58 + %.2279 =w copy 11174 + storeh %.2279, %.2278 + %.2280 =l add %.2219, 60 + %.2281 =w copy 8560 + storeh %.2281, %.2280 + %.2282 =l add %.2219, 62 + %.2283 =w copy 1 + storeh %.2283, %.2282 + %.2284 =l add %.2219, 64 + %.2285 =w copy 65535 + storeh %.2285, %.2284 + %.2286 =l add %.2219, 66 + %.2287 =w copy 17984 + storeh %.2287, %.2286 + %.2288 =l add %.2219, 68 + %.2289 =w copy 39046 + storeh %.2289, %.2288 + %.2290 =l add %.2219, 70 + %.2291 =w copy 8 + storeh %.2291, %.2290 + %.2292 =l add %.2219, 72 + %.2293 =w copy 9905 + storeh %.2293, %.2292 + %.2294 =l add %.2219, 74 + %.2295 =w copy 7040 + storeh %.2295, %.2294 + %.2296 =l add %.2219, 76 + %.2297 =w copy 2665 + storeh %.2297, %.2296 + %.2298 =l add %.2219, 78 + %.2299 =w copy 54886 + storeh %.2299, %.2298 + %.2300 =l add %.2219, 80 + %.2301 =w copy 2665 + storeh %.2301, %.2300 + %.2302 =l add %.2219, 82 + %.2303 =w copy 7040 + storeh %.2303, %.2302 + %.2304 =l add %.2219, 84 + %.2305 =w copy 11174 + storeh %.2305, %.2304 + %.2306 =l add %.2219, 86 + %.2307 =w copy 11174 + storeh %.2307, %.2306 + %.2308 =l add %.2219, 88 + %.2309 =w copy 0 + storeh %.2309, %.2308 + %.2310 =l add %.2219, 90 + %.2311 =w copy 3 + storeh %.2311, %.2310 + %.2312 =l add %.2219, 92 + %.2313 =w copy 1 + storeh %.2313, %.2312 + %.2314 =l add %.2219, 94 + %.2315 =w copy 42935 + storeh %.2315, %.2314 + %.2316 =l add %.2219, 96 + %.2317 =w copy 50276 + storeh %.2317, %.2316 + %.2318 =l add %.2219, 98 + %.2319 =w copy 1 + storeh %.2319, %.2318 + %.2320 =l add %.2219, 100 + %.2321 =w copy 65530 + storeh %.2321, %.2320 + %.2322 =l add %.2219, 102 + %.2323 =w copy 65529 + storeh %.2323, %.2322 + %.2324 =l add %.2219, 104 + %.2325 =w copy 6129 + storeh %.2325, %.2324 + %.2326 =l add %.2219, 106 + %.2327 =w copy 7040 + storeh %.2327, %.2326 + %.2328 =l add %.2219, 108 + %.2329 =w copy 0 + storeh %.2329, %.2328 + %.2330 =l add %.2219, 110 + %.2331 =w copy 0 + storeh %.2331, %.2330 + %.2332 =l add %.2219, 112 + %.2333 =w copy 1 + storeh %.2333, %.2332 + %.2334 =l add %.2219, 114 + %.2335 =w copy 6 + storeh %.2335, %.2334 + %.2336 =l add %.2219, 116 + %.2337 =w copy 8 + storeh %.2337, %.2336 + %.2338 =l add %.2219, 118 + %.2339 =w copy 6 + storeh %.2339, %.2338 + %.2340 =l add %.2219, 120 + %.2341 =w copy 1 + storeh %.2341, %.2340 + %.2342 =l add %.2219, 122 + %.2343 =w copy 11174 + storeh %.2343, %.2342 + %.2344 =l add %.2219, 124 + %.2345 =w copy 34633 + storeh %.2345, %.2344 + %.2346 =l add %.2219, 126 + %.2347 =w copy 58382 + storeh %.2347, %.2346 + %.2348 =l add %.2219, 128 + %.2349 =w copy 65532 + storeh %.2349, %.2348 + %.2350 =l add %.2219, 130 + %.2351 =w copy 8 + storeh %.2351, %.2350 + %.2352 =l add %.2219, 132 + %.2353 =w copy 39628 + storeh %.2353, %.2352 + %.2354 =l add %.2219, 134 + %.2355 =w copy 54886 + storeh %.2355, %.2354 + %.2356 =l add %.2219, 136 + %.2357 =w copy 4 + storeh %.2357, %.2356 + %.2358 =l add %.2219, 138 + %.2359 =w copy 9905 + storeh %.2359, %.2358 + %.2361 =l add %.2360, 0 + %.2362 =w copy 511172155 + storew %.2362, %.2361 + %.2364 =l add %.2363, 0 + %.2365 =w copy 2207426902 + storew %.2365, %.2364 + %.2367 =l add %.2366, 0 + %.2368 =l extsw 0 + %.2369 =l sub %.2368, 1 + %.2370 =w copy %.2369 + storew %.2370, %.2367 + %.2372 =l add %.2371, 0 + %.2373 =w copy 3215778575 + storew %.2373, %.2372 + %.2374 =l add %.2371, 4 + %.2375 =w copy 3428235063 + storew %.2375, %.2374 + %.2376 =l add %.2371, 8 + %.2377 =w copy 3215778575 + storew %.2377, %.2376 + %.2378 =l add %.2371, 12 + %.2379 =w copy 3428235063 + storew %.2379, %.2378 + %.2380 =l add %.2371, 16 + %.2381 =w copy 3215778575 + storew %.2381, %.2380 + %.2382 =l add %.2371, 20 + %.2383 =w copy 3428235063 + storew %.2383, %.2382 + %.2384 =l add %.2371, 24 + %.2385 =w copy 3215778575 + storew %.2385, %.2384 + %.2386 =l add %.2371, 28 + %.2387 =w copy 3428235063 + storew %.2387, %.2386 + %.2388 =l add %.2371, 32 + %.2389 =w copy 3215778575 + storew %.2389, %.2388 + %.2390 =l add %.2371, 36 + %.2391 =w copy 3428235063 + storew %.2391, %.2390 + %.2392 =l add %.2371, 40 + %.2393 =w copy 3215778575 + storew %.2393, %.2392 + %.2394 =l add %.2371, 44 + %.2395 =w copy 3428235063 + storew %.2395, %.2394 + %.2396 =l add %.2371, 48 + %.2397 =w copy 3215778575 + storew %.2397, %.2396 + %.2398 =l add %.2371, 52 + %.2399 =w copy 3428235063 + storew %.2399, %.2398 + %.2400 =l add %.2371, 56 + %.2401 =w copy 3215778575 + storew %.2401, %.2400 + %.2402 =l add %.2371, 60 + %.2403 =w copy 3428235063 + storew %.2403, %.2402 + %.2404 =l add %.2371, 64 + %.2405 =w copy 3215778575 + storew %.2405, %.2404 + %.2406 =l add %.2371, 68 + %.2407 =w copy 3428235063 + storew %.2407, %.2406 + %.2408 =l add %.2371, 72 + %.2409 =w copy 3215778575 + storew %.2409, %.2408 + %.2410 =l add %.2371, 76 + %.2411 =w copy 3428235063 + storew %.2411, %.2410 + %.2412 =l add %.2371, 80 + %.2413 =w copy 3215778575 + storew %.2413, %.2412 + %.2414 =l add %.2371, 84 + %.2415 =w copy 3428235063 + storew %.2415, %.2414 + %.2416 =l add %.2371, 88 + %.2417 =w copy 3215778575 + storew %.2417, %.2416 + %.2418 =l add %.2371, 92 + %.2419 =w copy 3428235063 + storew %.2419, %.2418 + %.2420 =l add %.2371, 96 + %.2421 =w copy 3215778575 + storew %.2421, %.2420 + %.2422 =l add %.2371, 100 + %.2423 =w copy 3428235063 + storew %.2423, %.2422 + %.2424 =l add %.2371, 104 + %.2425 =w copy 3215778575 + storew %.2425, %.2424 + %.2426 =l add %.2371, 108 + %.2427 =w copy 3428235063 + storew %.2427, %.2426 + %.2428 =l add %.2371, 112 + %.2429 =w copy 3215778575 + storew %.2429, %.2428 + %.2430 =l add %.2371, 116 + %.2431 =w copy 3428235063 + storew %.2431, %.2430 + %.2432 =l add %.2371, 120 + %.2433 =w copy 3215778575 + storew %.2433, %.2432 + %.2434 =l add %.2371, 124 + %.2435 =w copy 3428235063 + storew %.2435, %.2434 + %.2436 =l add %.2371, 128 + %.2437 =w copy 3215778575 + storew %.2437, %.2436 + %.2438 =l add %.2371, 132 + %.2439 =w copy 3428235063 + storew %.2439, %.2438 + %.2440 =l add %.2371, 136 + %.2441 =w copy 3215778575 + storew %.2441, %.2440 + %.2442 =l add %.2371, 140 + %.2443 =w copy 3428235063 + storew %.2443, %.2442 + %.2444 =l add %.2371, 144 + %.2445 =w copy 3215778575 + storew %.2445, %.2444 + %.2446 =l add %.2371, 148 + %.2447 =w copy 3428235063 + storew %.2447, %.2446 + %.2448 =l add %.2371, 152 + %.2449 =w copy 3215778575 + storew %.2449, %.2448 + %.2450 =l add %.2371, 156 + %.2451 =w copy 3428235063 + storew %.2451, %.2450 + %.2452 =l add %.2371, 160 + %.2453 =w copy 3215778575 + storew %.2453, %.2452 + %.2454 =l add %.2371, 164 + %.2455 =w copy 3428235063 + storew %.2455, %.2454 + %.2456 =l add %.2371, 168 + %.2457 =w copy 3215778575 + storew %.2457, %.2456 + %.2458 =l add %.2371, 172 + %.2459 =w copy 3428235063 + storew %.2459, %.2458 + %.2460 =l add %.2371, 176 + %.2461 =w copy 3215778575 + storew %.2461, %.2460 + %.2462 =l add %.2371, 180 + %.2463 =w copy 3428235063 + storew %.2463, %.2462 + %.2464 =l add %.2371, 184 + %.2465 =w copy 3215778575 + storew %.2465, %.2464 + %.2466 =l add %.2371, 188 + %.2467 =w copy 3428235063 + storew %.2467, %.2466 + %.2471 =w copy 1 + storew %.2471, $g_84 +@for_cond.734 + %.2472 =w loaduw $g_84 + %.2473 =w copy 5 + %.2474 =w culew %.2472, %.2473 + jnz %.2474, @for_body.735, @for_join.737 +@for_body.735 + %.2476 =l add %.2475, 0 + %.2477 =l copy $g_1183 + %.2478 =l mul 0, 1 + %.2479 =l add %.2477, %.2478 + %.2480 =l copy %.2479 + storel %.2480, %.2476 + %.2481 =l add %.2475, 8 + %.2482 =l copy $g_1183 + %.2483 =l mul 0, 1 + %.2484 =l add %.2482, %.2483 + %.2485 =l copy %.2484 + storel %.2485, %.2481 + %.2486 =l add %.2475, 16 + storel $g_566, %.2486 + %.2487 =l add %.2475, 24 + %.2488 =l copy $g_1183 + %.2489 =l mul 0, 1 + %.2490 =l add %.2488, %.2489 + %.2491 =l copy %.2490 + storel %.2491, %.2487 + %.2492 =l add %.2475, 32 + %.2493 =l extsw 0 + %.2494 =l copy %.2493 + storel %.2494, %.2492 + %.2495 =l add %.2475, 40 + %.2496 =l extsw 0 + %.2497 =l copy %.2496 + storel %.2497, %.2495 + %.2498 =l add %.2475, 48 + %.2499 =l copy $g_518 + %.2500 =l mul 0, 1 + %.2501 =l add %.2499, %.2500 + %.2502 =l copy %.2501 + storel %.2502, %.2498 + %.2503 =l add %.2475, 56 + %.2504 =l extsw 0 + %.2505 =l copy %.2504 + storel %.2505, %.2503 + %.2506 =l add %.2475, 64 + %.2507 =l copy $g_265 + %.2508 =l mul 0, 1 + %.2509 =l add %.2507, %.2508 + %.2510 =l copy %.2509 + storel %.2510, %.2506 + %.2511 =l add %.2475, 72 + %.2512 =l copy $g_265 + %.2513 =l mul 0, 1 + %.2514 =l add %.2512, %.2513 + %.2515 =l copy %.2514 + storel %.2515, %.2511 + %.2516 =l add %.2475, 80 + %.2517 =l copy $g_518 + %.2518 =l mul 0, 1 + %.2519 =l add %.2517, %.2518 + %.2520 =l copy %.2519 + storel %.2520, %.2516 + %.2521 =l add %.2475, 88 + %.2522 =l copy $g_1183 + %.2523 =l mul 0, 1 + %.2524 =l add %.2522, %.2523 + %.2525 =l copy %.2524 + storel %.2525, %.2521 + %.2526 =l add %.2475, 96 + %.2527 =l copy $g_1183 + %.2528 =l mul 0, 1 + %.2529 =l add %.2527, %.2528 + %.2530 =l copy %.2529 + storel %.2530, %.2526 + %.2531 =l add %.2475, 104 + storel $g_566, %.2531 + %.2532 =l add %.2475, 112 + %.2533 =l copy $g_518 + %.2534 =l mul 0, 1 + %.2535 =l add %.2533, %.2534 + %.2536 =l copy %.2535 + storel %.2536, %.2532 + %.2537 =l add %.2475, 120 + %.2538 =l copy $g_1183 + %.2539 =l mul 0, 1 + %.2540 =l add %.2538, %.2539 + %.2541 =l copy %.2540 + storel %.2541, %.2537 + %.2542 =l add %.2475, 128 + %.2543 =l copy $g_265 + %.2544 =l mul 0, 1 + %.2545 =l add %.2543, %.2544 + %.2546 =l copy %.2545 + storel %.2546, %.2542 + %.2547 =l add %.2475, 136 + storel $g_566, %.2547 + %.2548 =l add %.2475, 144 + storel $g_46, %.2548 + %.2549 =l add %.2475, 152 + %.2550 =l extsw 0 + %.2551 =l copy %.2550 + storel %.2551, %.2549 + %.2552 =l add %.2475, 160 + %.2553 =l copy $g_1183 + %.2554 =l mul 0, 1 + %.2555 =l add %.2553, %.2554 + %.2556 =l copy %.2555 + storel %.2556, %.2552 + %.2557 =l add %.2475, 168 + storel $g_566, %.2557 + %.2558 =l add %.2475, 176 + storel $g_46, %.2558 + %.2559 =l add %.2475, 184 + %.2560 =l extsw 0 + %.2561 =l copy %.2560 + storel %.2561, %.2559 + %.2562 =l add %.2475, 192 + storel $g_566, %.2562 + %.2563 =l add %.2475, 200 + %.2564 =l extsw 0 + %.2565 =l copy %.2564 + storel %.2565, %.2563 + %.2566 =l add %.2475, 208 + %.2567 =l copy $g_265 + %.2568 =l mul 0, 1 + %.2569 =l add %.2567, %.2568 + %.2570 =l copy %.2569 + storel %.2570, %.2566 + %.2571 =l add %.2475, 216 + %.2572 =l copy $g_185 + %.2573 =l mul 0, 1 + %.2574 =l add %.2572, %.2573 + %.2575 =l copy %.2574 + storel %.2575, %.2571 + %.2576 =l add %.2475, 224 + storel $g_57, %.2576 + %.2577 =l add %.2475, 232 + %.2578 =l extsw 0 + %.2579 =l copy %.2578 + storel %.2579, %.2577 + %.2580 =l add %.2475, 240 + %.2581 =l extsw 0 + %.2582 =l copy %.2581 + storel %.2582, %.2580 + %.2583 =l add %.2475, 248 + %.2584 =l extsw 0 + %.2585 =l copy %.2584 + storel %.2585, %.2583 + %.2586 =l add %.2475, 256 + %.2587 =l copy $g_1183 + %.2588 =l mul 0, 1 + %.2589 =l add %.2587, %.2588 + %.2590 =l copy %.2589 + storel %.2590, %.2586 + %.2591 =l add %.2475, 264 + %.2592 =l copy $g_265 + %.2593 =l mul 0, 1 + %.2594 =l add %.2592, %.2593 + %.2595 =l copy %.2594 + storel %.2595, %.2591 + %.2596 =l add %.2475, 272 + %.2597 =l copy $g_265 + %.2598 =l mul 0, 1 + %.2599 =l add %.2597, %.2598 + %.2600 =l copy %.2599 + storel %.2600, %.2596 + %.2601 =l add %.2475, 280 + storel $g_566, %.2601 + %.2602 =l add %.2475, 288 + %.2603 =l copy $g_1183 + %.2604 =l mul 0, 1 + %.2605 =l add %.2603, %.2604 + %.2606 =l copy %.2605 + storel %.2606, %.2602 + %.2607 =l add %.2475, 296 + %.2608 =l copy $g_265 + %.2609 =l mul 0, 1 + %.2610 =l add %.2608, %.2609 + %.2611 =l copy %.2610 + storel %.2611, %.2607 + %.2612 =l add %.2475, 304 + %.2613 =l copy $g_265 + %.2614 =l mul 0, 1 + %.2615 =l add %.2613, %.2614 + %.2616 =l copy %.2615 + storel %.2616, %.2612 + %.2617 =l add %.2475, 312 + storel $g_57, %.2617 + %.2618 =l add %.2475, 320 + %.2619 =l copy $g_265 + %.2620 =l mul 0, 1 + %.2621 =l add %.2619, %.2620 + %.2622 =l copy %.2621 + storel %.2622, %.2618 + %.2623 =l add %.2475, 328 + %.2624 =l copy $g_1183 + %.2625 =l mul 0, 1 + %.2626 =l add %.2624, %.2625 + %.2627 =l copy %.2626 + storel %.2627, %.2623 + %.2628 =l add %.2475, 336 + storel $g_566, %.2628 + %.2629 =l add %.2475, 344 + %.2630 =l copy $g_185 + %.2631 =l mul 0, 1 + %.2632 =l add %.2630, %.2631 + %.2633 =l copy %.2632 + storel %.2633, %.2629 + %.2634 =l add %.2475, 352 + storel $g_566, %.2634 + %.2635 =l add %.2475, 360 + storel $g_46, %.2635 + %.2636 =l add %.2475, 368 + storel $g_57, %.2636 + %.2637 =l add %.2475, 376 + storel $g_566, %.2637 + %.2638 =l add %.2475, 384 + %.2639 =l copy $g_265 + %.2640 =l mul 0, 1 + %.2641 =l add %.2639, %.2640 + %.2642 =l copy %.2641 + storel %.2642, %.2638 + %.2643 =l add %.2475, 392 + storel $g_566, %.2643 + %.2644 =l add %.2475, 400 + storel $g_57, %.2644 + %.2645 =l add %.2475, 408 + storel $g_57, %.2645 + %.2646 =l add %.2475, 416 + %.2647 =l copy $g_1183 + %.2648 =l mul 0, 1 + %.2649 =l add %.2647, %.2648 + %.2650 =l copy %.2649 + storel %.2650, %.2646 + %.2651 =l add %.2475, 424 + %.2652 =l copy $g_265 + %.2653 =l mul 0, 1 + %.2654 =l add %.2652, %.2653 + %.2655 =l copy %.2654 + storel %.2655, %.2651 + %.2656 =l add %.2475, 432 + %.2657 =l copy $g_265 + %.2658 =l mul 0, 1 + %.2659 =l add %.2657, %.2658 + %.2660 =l copy %.2659 + storel %.2660, %.2656 + %.2661 =l add %.2475, 440 + %.2662 =l copy $g_518 + %.2663 =l mul 0, 1 + %.2664 =l add %.2662, %.2663 + %.2665 =l copy %.2664 + storel %.2665, %.2661 + %.2666 =l add %.2475, 448 + %.2667 =l copy $g_265 + %.2668 =l mul 0, 1 + %.2669 =l add %.2667, %.2668 + %.2670 =l copy %.2669 + storel %.2670, %.2666 + %.2671 =l add %.2475, 456 + %.2672 =l copy $g_518 + %.2673 =l mul 0, 1 + %.2674 =l add %.2672, %.2673 + %.2675 =l copy %.2674 + storel %.2675, %.2671 + %.2676 =l add %.2475, 464 + %.2677 =l copy $g_265 + %.2678 =l mul 0, 1 + %.2679 =l add %.2677, %.2678 + %.2680 =l copy %.2679 + storel %.2680, %.2676 + %.2681 =l add %.2475, 472 + storel $g_57, %.2681 + %.2682 =l add %.2475, 480 + storel $g_566, %.2682 + %.2683 =l add %.2475, 488 + storel $g_566, %.2683 + %.2684 =l add %.2475, 496 + %.2685 =l copy $g_185 + %.2686 =l mul 0, 1 + %.2687 =l add %.2685, %.2686 + %.2688 =l copy %.2687 + storel %.2688, %.2684 + %.2689 =l add %.2475, 504 + %.2690 =l copy $g_518 + %.2691 =l mul 0, 1 + %.2692 =l add %.2690, %.2691 + %.2693 =l copy %.2692 + storel %.2693, %.2689 + %.2694 =l add %.2475, 512 + %.2695 =l extsw 0 + %.2696 =l copy %.2695 + storel %.2696, %.2694 + %.2697 =l add %.2475, 520 + storel $g_566, %.2697 + %.2698 =l add %.2475, 528 + storel $g_566, %.2698 + %.2699 =l add %.2475, 536 + %.2700 =l extsw 0 + %.2701 =l copy %.2700 + storel %.2701, %.2699 + %.2702 =l add %.2475, 544 + %.2703 =l copy $g_185 + %.2704 =l mul 0, 1 + %.2705 =l add %.2703, %.2704 + %.2706 =l copy %.2705 + storel %.2706, %.2702 + %.2707 =l add %.2475, 552 + storel $g_57, %.2707 + %.2708 =l add %.2475, 560 + %.2709 =l copy $g_518 + %.2710 =l mul 0, 1 + %.2711 =l add %.2709, %.2710 + %.2712 =l copy %.2711 + storel %.2712, %.2708 + %.2713 =l add %.2475, 568 + %.2714 =l copy $g_518 + %.2715 =l mul 0, 1 + %.2716 =l add %.2714, %.2715 + %.2717 =l copy %.2716 + storel %.2717, %.2713 + %.2718 =l add %.2475, 576 + storel $g_57, %.2718 + %.2719 =l add %.2475, 584 + storel $g_566, %.2719 + %.2720 =l add %.2475, 592 + %.2721 =l copy $g_185 + %.2722 =l mul 0, 1 + %.2723 =l add %.2721, %.2722 + %.2724 =l copy %.2723 + storel %.2724, %.2720 + %.2725 =l add %.2475, 600 + %.2726 =l extsw 0 + %.2727 =l copy %.2726 + storel %.2727, %.2725 + %.2728 =l add %.2475, 608 + storel $g_566, %.2728 + %.2729 =l add %.2475, 616 + storel $g_566, %.2729 + %.2730 =l add %.2475, 624 + %.2731 =l extsw 0 + %.2732 =l copy %.2731 + storel %.2732, %.2730 + %.2733 =l add %.2475, 632 + storel $g_566, %.2733 + %.2734 =l add %.2475, 640 + %.2735 =l copy $g_185 + %.2736 =l mul 0, 1 + %.2737 =l add %.2735, %.2736 + %.2738 =l copy %.2737 + storel %.2738, %.2734 + %.2739 =l add %.2475, 648 + storel $g_566, %.2739 + %.2740 =l add %.2475, 656 + %.2741 =l extsw 0 + %.2742 =l copy %.2741 + storel %.2742, %.2740 + %.2743 =l add %.2475, 664 + storel $g_57, %.2743 + %.2744 =l add %.2475, 672 + %.2745 =l copy $g_265 + %.2746 =l mul 0, 1 + %.2747 =l add %.2745, %.2746 + %.2748 =l copy %.2747 + storel %.2748, %.2744 + %.2749 =l add %.2475, 680 + %.2750 =l copy $g_265 + %.2751 =l mul 0, 1 + %.2752 =l add %.2750, %.2751 + %.2753 =l copy %.2752 + storel %.2753, %.2749 + %.2754 =l add %.2475, 688 + %.2755 =l copy $g_265 + %.2756 =l mul 0, 1 + %.2757 =l add %.2755, %.2756 + %.2758 =l copy %.2757 + storel %.2758, %.2754 + %.2759 =l add %.2475, 696 + storel $g_57, %.2759 + %.2760 =l add %.2475, 704 + %.2761 =l copy $g_185 + %.2762 =l mul 0, 1 + %.2763 =l add %.2761, %.2762 + %.2764 =l copy %.2763 + storel %.2764, %.2760 + %.2765 =l add %.2475, 712 + %.2766 =l copy $g_265 + %.2767 =l mul 0, 1 + %.2768 =l add %.2766, %.2767 + %.2769 =l copy %.2768 + storel %.2769, %.2765 + %.2770 =l add %.2475, 720 + storel $g_566, %.2770 + %.2771 =l add %.2475, 728 + storel $g_46, %.2771 + %.2772 =l add %.2475, 736 + storel $g_57, %.2772 + %.2773 =l add %.2475, 744 + %.2774 =l copy $g_1183 + %.2775 =l mul 0, 1 + %.2776 =l add %.2774, %.2775 + %.2777 =l copy %.2776 + storel %.2777, %.2773 + %.2778 =l add %.2475, 752 + %.2779 =l copy $g_185 + %.2780 =l mul 0, 1 + %.2781 =l add %.2779, %.2780 + %.2782 =l copy %.2781 + storel %.2782, %.2778 + %.2783 =l add %.2475, 760 + storel $g_566, %.2783 + %.2784 =l add %.2475, 768 + %.2785 =l copy $g_265 + %.2786 =l mul 0, 1 + %.2787 =l add %.2785, %.2786 + %.2788 =l copy %.2787 + storel %.2788, %.2784 + %.2789 =l add %.2475, 776 + %.2790 =l copy $g_185 + %.2791 =l mul 0, 1 + %.2792 =l add %.2790, %.2791 + %.2793 =l copy %.2792 + storel %.2793, %.2789 + %.2794 =l add %.2475, 784 + storel $g_566, %.2794 + %.2795 =l add %.2475, 792 + %.2796 =l copy $g_265 + %.2797 =l mul 0, 1 + %.2798 =l add %.2796, %.2797 + %.2799 =l copy %.2798 + storel %.2799, %.2795 + %.2800 =l add %.2475, 800 + storel $g_46, %.2800 + %.2801 =l add %.2475, 808 + %.2802 =l copy $g_1183 + %.2803 =l mul 0, 1 + %.2804 =l add %.2802, %.2803 + %.2805 =l copy %.2804 + storel %.2805, %.2801 + %.2806 =l add %.2475, 816 + %.2807 =l copy $g_518 + %.2808 =l mul 0, 1 + %.2809 =l add %.2807, %.2808 + %.2810 =l copy %.2809 + storel %.2810, %.2806 + %.2811 =l add %.2475, 824 + storel $g_566, %.2811 + %.2812 =l add %.2475, 832 + %.2813 =l copy $g_265 + %.2814 =l mul 0, 1 + %.2815 =l add %.2813, %.2814 + %.2816 =l copy %.2815 + storel %.2816, %.2812 + %.2817 =l add %.2475, 840 + storel $g_57, %.2817 + %.2818 =l add %.2475, 848 + %.2819 =l extsw 0 + %.2820 =l copy %.2819 + storel %.2820, %.2818 + %.2821 =l add %.2475, 856 + storel $g_566, %.2821 + %.2822 =l add %.2475, 864 + %.2823 =l copy $g_1183 + %.2824 =l mul 0, 1 + %.2825 =l add %.2823, %.2824 + %.2826 =l copy %.2825 + storel %.2826, %.2822 + %.2827 =l add %.2475, 872 + %.2828 =l copy $g_265 + %.2829 =l mul 0, 1 + %.2830 =l add %.2828, %.2829 + %.2831 =l copy %.2830 + storel %.2831, %.2827 + %.2832 =l add %.2475, 880 + %.2833 =l copy $g_1183 + %.2834 =l mul 0, 1 + %.2835 =l add %.2833, %.2834 + %.2836 =l copy %.2835 + storel %.2836, %.2832 + %.2837 =l add %.2475, 888 + %.2838 =l extsw 0 + %.2839 =l copy %.2838 + storel %.2839, %.2837 + %.2840 =l add %.2475, 896 + storel $g_57, %.2840 + %.2841 =l add %.2475, 904 + %.2842 =l extsw 0 + %.2843 =l copy %.2842 + storel %.2843, %.2841 + %.2844 =l add %.2475, 912 + %.2845 =l copy $g_518 + %.2846 =l mul 0, 1 + %.2847 =l add %.2845, %.2846 + %.2848 =l copy %.2847 + storel %.2848, %.2844 + %.2849 =l add %.2475, 920 + storel $g_57, %.2849 + %.2850 =l add %.2475, 928 + %.2851 =l extsw 0 + %.2852 =l copy %.2851 + storel %.2852, %.2850 + %.2853 =l add %.2475, 936 + storel $g_566, %.2853 + %.2854 =l add %.2475, 944 + %.2855 =l copy $g_265 + %.2856 =l mul 0, 1 + %.2857 =l add %.2855, %.2856 + %.2858 =l copy %.2857 + storel %.2858, %.2854 + %.2859 =l add %.2475, 952 + %.2860 =l copy $g_185 + %.2861 =l mul 0, 1 + %.2862 =l add %.2860, %.2861 + %.2863 =l copy %.2862 + storel %.2863, %.2859 + %.2864 =l add %.2475, 960 + storel $g_566, %.2864 + %.2865 =l add %.2475, 968 + %.2866 =l extsw 0 + %.2867 =l copy %.2866 + storel %.2867, %.2865 + %.2868 =l add %.2475, 976 + %.2869 =l extsw 0 + %.2870 =l copy %.2869 + storel %.2870, %.2868 + %.2871 =l add %.2475, 984 + storel $g_57, %.2871 + %.2872 =l add %.2475, 992 + storel $g_566, %.2872 + %.2873 =l add %.2475, 1000 + %.2874 =l extsw 0 + %.2875 =l copy %.2874 + storel %.2875, %.2873 + %.2876 =l add %.2475, 1008 + %.2877 =l copy $g_185 + %.2878 =l mul 0, 1 + %.2879 =l add %.2877, %.2878 + %.2880 =l copy %.2879 + storel %.2880, %.2876 + %.2881 =l add %.2475, 1016 + storel $g_46, %.2881 + %.2882 =l add %.2475, 1024 + %.2883 =l extsw 0 + %.2884 =l copy %.2883 + storel %.2884, %.2882 + %.2885 =l add %.2475, 1032 + %.2886 =l extsw 0 + %.2887 =l copy %.2886 + storel %.2887, %.2885 + %.2888 =l add %.2475, 1040 + %.2889 =l copy $g_185 + %.2890 =l mul 0, 1 + %.2891 =l add %.2889, %.2890 + %.2892 =l copy %.2891 + storel %.2892, %.2888 + %.2893 =l add %.2475, 1048 + %.2894 =l copy $g_265 + %.2895 =l mul 0, 1 + %.2896 =l add %.2894, %.2895 + %.2897 =l copy %.2896 + storel %.2897, %.2893 + %.2898 =l add %.2475, 1056 + %.2899 =l extsw 0 + %.2900 =l copy %.2899 + storel %.2900, %.2898 + %.2901 =l add %.2475, 1064 + %.2902 =l copy $g_185 + %.2903 =l mul 0, 1 + %.2904 =l add %.2902, %.2903 + %.2905 =l copy %.2904 + storel %.2905, %.2901 + %.2906 =l add %.2475, 1072 + storel $g_57, %.2906 + %.2907 =l add %.2475, 1080 + %.2908 =l extsw 0 + %.2909 =l copy %.2908 + storel %.2909, %.2907 + %.2910 =l add %.2475, 1088 + storel $g_46, %.2910 + %.2911 =l add %.2475, 1096 + storel $g_566, %.2911 + %.2912 =l add %.2475, 1104 + storel $g_57, %.2912 + %.2913 =l add %.2475, 1112 + %.2914 =l copy $g_185 + %.2915 =l mul 0, 1 + %.2916 =l add %.2914, %.2915 + %.2917 =l copy %.2916 + storel %.2917, %.2913 + %.2918 =l add %.2475, 1120 + %.2919 =l copy $g_518 + %.2920 =l mul 0, 1 + %.2921 =l add %.2919, %.2920 + %.2922 =l copy %.2921 + storel %.2922, %.2918 + %.2923 =l add %.2475, 1128 + %.2924 =l copy $g_185 + %.2925 =l mul 0, 1 + %.2926 =l add %.2924, %.2925 + %.2927 =l copy %.2926 + storel %.2927, %.2923 + %.2928 =l add %.2475, 1136 + %.2929 =l copy $g_265 + %.2930 =l mul 0, 1 + %.2931 =l add %.2929, %.2930 + %.2932 =l copy %.2931 + storel %.2932, %.2928 + %.2933 =l add %.2475, 1144 + storel $g_46, %.2933 + %.2934 =l add %.2475, 1152 + %.2935 =l copy $g_1183 + %.2936 =l mul 0, 1 + %.2937 =l add %.2935, %.2936 + %.2938 =l copy %.2937 + storel %.2938, %.2934 + %.2939 =l add %.2475, 1160 + %.2940 =l extsw 0 + %.2941 =l copy %.2940 + storel %.2941, %.2939 + %.2942 =l add %.2475, 1168 + %.2943 =l copy $g_1183 + %.2944 =l mul 0, 1 + %.2945 =l add %.2943, %.2944 + %.2946 =l copy %.2945 + storel %.2946, %.2942 + %.2947 =l add %.2475, 1176 + storel $g_46, %.2947 + %.2948 =l add %.2475, 1184 + storel $g_566, %.2948 + %.2949 =l add %.2475, 1192 + storel $g_566, %.2949 + %.2950 =l add %.2475, 1200 + storel $g_566, %.2950 + %.2951 =l add %.2475, 1208 + storel $g_566, %.2951 + %.2952 =l add %.2475, 1216 + storel $g_57, %.2952 + %.2953 =l add %.2475, 1224 + %.2954 =l copy $g_1183 + %.2955 =l mul 0, 1 + %.2956 =l add %.2954, %.2955 + %.2957 =l copy %.2956 + storel %.2957, %.2953 + %.2958 =l add %.2475, 1232 + storel $g_566, %.2958 + %.2959 =l add %.2475, 1240 + %.2960 =l copy $g_518 + %.2961 =l mul 0, 1 + %.2962 =l add %.2960, %.2961 + %.2963 =l copy %.2962 + storel %.2963, %.2959 + %.2964 =l add %.2475, 1248 + storel $g_566, %.2964 + %.2965 =l add %.2475, 1256 + %.2966 =l copy $g_518 + %.2967 =l mul 0, 1 + %.2968 =l add %.2966, %.2967 + %.2969 =l copy %.2968 + storel %.2969, %.2965 + %.2970 =l add %.2475, 1264 + %.2971 =l extsw 0 + %.2972 =l copy %.2971 + storel %.2972, %.2970 + %.2973 =l add %.2475, 1272 + %.2974 =l copy $g_1183 + %.2975 =l mul 0, 1 + %.2976 =l add %.2974, %.2975 + %.2977 =l copy %.2976 + storel %.2977, %.2973 + %.2978 =l add %.2475, 1280 + %.2979 =l extsw 0 + %.2980 =l copy %.2979 + storel %.2980, %.2978 + %.2981 =l add %.2475, 1288 + storel $g_57, %.2981 + %.2982 =l add %.2475, 1296 + storel $g_566, %.2982 + %.2983 =l add %.2475, 1304 + %.2984 =l extsw 0 + %.2985 =l copy %.2984 + storel %.2985, %.2983 + %.2986 =l add %.2475, 1312 + %.2987 =l extsw 0 + %.2988 =l copy %.2987 + storel %.2988, %.2986 + %.2989 =l add %.2475, 1320 + storel $g_46, %.2989 + %.2990 =l add %.2475, 1328 + storel $g_566, %.2990 + %.2991 =l add %.2475, 1336 + storel $g_566, %.2991 + %.2992 =l add %.2475, 1344 + %.2993 =l copy $g_1183 + %.2994 =l mul 0, 1 + %.2995 =l add %.2993, %.2994 + %.2996 =l copy %.2995 + storel %.2996, %.2992 + %.2997 =l add %.2475, 1352 + %.2998 =l copy $g_265 + %.2999 =l mul 0, 1 + %.3000 =l add %.2998, %.2999 + %.3001 =l copy %.3000 + storel %.3001, %.2997 + %.3002 =l add %.2475, 1360 + %.3003 =l extsw 0 + %.3004 =l copy %.3003 + storel %.3004, %.3002 + %.3005 =l add %.2475, 1368 + %.3006 =l copy $g_185 + %.3007 =l mul 0, 1 + %.3008 =l add %.3006, %.3007 + %.3009 =l copy %.3008 + storel %.3009, %.3005 + %.3010 =l add %.2475, 1376 + %.3011 =l copy $g_518 + %.3012 =l mul 0, 1 + %.3013 =l add %.3011, %.3012 + %.3014 =l copy %.3013 + storel %.3014, %.3010 + %.3015 =l add %.2475, 1384 + %.3016 =l extsw 0 + %.3017 =l copy %.3016 + storel %.3017, %.3015 + %.3018 =l add %.2475, 1392 + storel $g_57, %.3018 + %.3019 =l add %.2475, 1400 + %.3020 =l copy $g_1183 + %.3021 =l mul 0, 1 + %.3022 =l add %.3020, %.3021 + %.3023 =l copy %.3022 + storel %.3023, %.3019 + %.3024 =l add %.2475, 1408 + %.3025 =l copy $g_265 + %.3026 =l mul 0, 1 + %.3027 =l add %.3025, %.3026 + %.3028 =l copy %.3027 + storel %.3028, %.3024 + %.3029 =l add %.2475, 1416 + %.3030 =l extsw 0 + %.3031 =l copy %.3030 + storel %.3031, %.3029 + %.3032 =l add %.2475, 1424 + storel $g_566, %.3032 + %.3033 =l add %.2475, 1432 + %.3034 =l extsw 0 + %.3035 =l copy %.3034 + storel %.3035, %.3033 + %.3036 =l add %.2475, 1440 + %.3037 =l extsw 0 + %.3038 =l copy %.3037 + storel %.3038, %.3036 + %.3039 =l add %.2475, 1448 + storel $g_57, %.3039 + %.3040 =l add %.2475, 1456 + %.3041 =l copy $g_185 + %.3042 =l mul 0, 1 + %.3043 =l add %.3041, %.3042 + %.3044 =l copy %.3043 + storel %.3044, %.3040 + %.3045 =l add %.2475, 1464 + %.3046 =l extsw 0 + %.3047 =l copy %.3046 + storel %.3047, %.3045 + %.3048 =l add %.2475, 1472 + %.3049 =l copy $g_185 + %.3050 =l mul 0, 1 + %.3051 =l add %.3049, %.3050 + %.3052 =l copy %.3051 + storel %.3052, %.3048 + %.3053 =l add %.2475, 1480 + %.3054 =l copy $g_1183 + %.3055 =l mul 0, 1 + %.3056 =l add %.3054, %.3055 + %.3057 =l copy %.3056 + storel %.3057, %.3053 + %.3058 =l add %.2475, 1488 + %.3059 =l copy $g_185 + %.3060 =l mul 0, 1 + %.3061 =l add %.3059, %.3060 + %.3062 =l copy %.3061 + storel %.3062, %.3058 + %.3063 =l add %.2475, 1496 + %.3064 =l copy $g_265 + %.3065 =l mul 0, 1 + %.3066 =l add %.3064, %.3065 + %.3067 =l copy %.3066 + storel %.3067, %.3063 + %.3068 =l add %.2475, 1504 + %.3069 =l extsw 0 + %.3070 =l copy %.3069 + storel %.3070, %.3068 + %.3071 =l add %.2475, 1512 + storel $g_57, %.3071 + %.3072 =l add %.2475, 1520 + %.3073 =l copy $g_265 + %.3074 =l mul 0, 1 + %.3075 =l add %.3073, %.3074 + %.3076 =l copy %.3075 + storel %.3076, %.3072 + %.3077 =l add %.2475, 1528 + storel $g_566, %.3077 + %.3078 =l add %.2475, 1536 + storel $g_566, %.3078 + %.3079 =l add %.2475, 1544 + %.3080 =l copy $g_265 + %.3081 =l mul 0, 1 + %.3082 =l add %.3080, %.3081 + %.3083 =l copy %.3082 + storel %.3083, %.3079 + %.3084 =l add %.2475, 1552 + storel $g_46, %.3084 + %.3085 =l add %.2475, 1560 + storel $g_566, %.3085 + %.3086 =l add %.2475, 1568 + %.3087 =l extsw 0 + %.3088 =l copy %.3087 + storel %.3088, %.3086 + %.3089 =l add %.2475, 1576 + storel $g_566, %.3089 + %.3090 =l add %.2475, 1584 + %.3091 =l copy $g_518 + %.3092 =l mul 0, 1 + %.3093 =l add %.3091, %.3092 + %.3094 =l copy %.3093 + storel %.3094, %.3090 + %.3095 =l add %.2475, 1592 + storel $g_566, %.3095 + %.3096 =l add %.2475, 1600 + storel $g_566, %.3096 + %.3097 =l add %.2475, 1608 + %.3098 =l extsw 0 + %.3099 =l copy %.3098 + storel %.3099, %.3097 + %.3100 =l add %.2475, 1616 + storel $g_46, %.3100 + %.3101 =l add %.2475, 1624 + storel $g_46, %.3101 + %.3102 =l add %.2475, 1632 + %.3103 =l copy $g_1183 + %.3104 =l mul 0, 1 + %.3105 =l add %.3103, %.3104 + %.3106 =l copy %.3105 + storel %.3106, %.3102 + %.3107 =l add %.2475, 1640 + %.3108 =l copy $g_1183 + %.3109 =l mul 0, 1 + %.3110 =l add %.3108, %.3109 + %.3111 =l copy %.3110 + storel %.3111, %.3107 + %.3112 =l add %.2475, 1648 + storel $g_566, %.3112 + %.3113 =l add %.2475, 1656 + storel $g_57, %.3113 + %.3114 =l add %.2475, 1664 + storel $g_46, %.3114 + %.3115 =l add %.2475, 1672 + %.3116 =l extsw 0 + %.3117 =l copy %.3116 + storel %.3117, %.3115 + %.3118 =l add %.2475, 1680 + %.3119 =l copy $g_518 + %.3120 =l mul 0, 1 + %.3121 =l add %.3119, %.3120 + %.3122 =l copy %.3121 + storel %.3122, %.3118 + %.3123 =l add %.2475, 1688 + storel $g_566, %.3123 + %.3124 =l add %.2475, 1696 + %.3125 =l copy $g_1183 + %.3126 =l mul 0, 1 + %.3127 =l add %.3125, %.3126 + %.3128 =l copy %.3127 + storel %.3128, %.3124 + %.3129 =l add %.2475, 1704 + %.3130 =l copy $g_265 + %.3131 =l mul 0, 1 + %.3132 =l add %.3130, %.3131 + %.3133 =l copy %.3132 + storel %.3133, %.3129 + %.3134 =l add %.2475, 1712 + %.3135 =l extsw 0 + %.3136 =l copy %.3135 + storel %.3136, %.3134 + %.3137 =l add %.2475, 1720 + %.3138 =l copy $g_185 + %.3139 =l mul 0, 1 + %.3140 =l add %.3138, %.3139 + %.3141 =l copy %.3140 + storel %.3141, %.3137 + %.3143 =l add %.3142, 0 + %.3144 =w copy 2383211199 + storew %.3144, %.3143 + %.3146 =l add %.3145, 0 + %.3147 =w copy 254 + storeb %.3147, %.3146 + %.3148 =l add %.3145, 1 + %.3149 =w copy 250 + storeb %.3149, %.3148 + %.3150 =l add %.3145, 2 + %.3151 =w copy 255 + storeb %.3151, %.3150 + %.3152 =l add %.3145, 3 + %.3153 =w copy 250 + storeb %.3153, %.3152 + %.3154 =l add %.3145, 4 + %.3155 =w copy 184 + storeb %.3155, %.3154 + %.3156 =l add %.3145, 5 + %.3157 =w copy 121 + storeb %.3157, %.3156 + %.3158 =l add %.3145, 6 + %.3159 =w copy 0 + storeb %.3159, %.3158 + %.3160 =l add %.3145, 7 + %.3161 =w copy 189 + storeb %.3161, %.3160 + %.3162 =l add %.3145, 8 + %.3163 =w copy 121 + storeb %.3163, %.3162 + %.3164 =l add %.3145, 9 + %.3165 =w copy 254 + storeb %.3165, %.3164 + %.3166 =l add %.3145, 10 + %.3167 =w copy 255 + storeb %.3167, %.3166 + %.3168 =l add %.3145, 11 + %.3169 =w copy 184 + storeb %.3169, %.3168 + %.3170 =l add %.3145, 12 + %.3171 =w copy 6 + storeb %.3171, %.3170 + %.3172 =l add %.3145, 13 + %.3173 =w copy 255 + storeb %.3173, %.3172 + %.3174 =l add %.3145, 14 + %.3175 =w copy 255 + storeb %.3175, %.3174 + %.3176 =l add %.3145, 15 + %.3177 =w copy 6 + storeb %.3177, %.3176 + %.3178 =l add %.3145, 16 + %.3179 =w copy 6 + storeb %.3179, %.3178 + %.3180 =l add %.3145, 17 + %.3181 =w copy 189 + storeb %.3181, %.3180 + %.3182 =l add %.3145, 18 + %.3183 =w copy 255 + storeb %.3183, %.3182 + %.3184 =l add %.3145, 19 + %.3185 =w copy 224 + storeb %.3185, %.3184 + %.3186 =l add %.3145, 20 + %.3187 =w copy 121 + storeb %.3187, %.3186 + %.3188 =l add %.3145, 21 + %.3189 =w copy 6 + storeb %.3189, %.3188 + %.3190 =l add %.3145, 22 + %.3191 =w copy 0 + storeb %.3191, %.3190 + %.3192 =l add %.3145, 23 + %.3193 =w copy 250 + storeb %.3193, %.3192 + %.3195 =l add %.3194, 0 + %.3196 =w copy 3785821799 + storew %.3196, %.3195 + %.3198 =l add %.3197, 0 + %.3199 =w copy 1382872816 + storew %.3199, %.3198 + %.3203 =w copy 65535 + %.3204 =w call $safe_rshift_func_uint16_t_u_s(w %.3203, w 10) + %.3205 =w copy %.3204 + %.3206 =l loadl $g_1070 + %.3207 =l loadl %.3206 + %.3208 =l loadl $g_1069 + %.3209 =l loadl %.3208 + %.3210 =l loadl %.3209 + %.3211 =w ceql %.3207, %.3210 + %.3212 =w loadsb $g_629 + %.3213 =w extsb %.3212 + %.3214 =w copy 255 + %.3215 =l copy $g_1183 + %.3216 =l mul 16, 1 + %.3217 =l add %.3215, %.3216 + %.3218 =l copy %.3217 + %.3219 =w loadsw %.3218 + %.3220 =l extsw 6 + %.3221 =l mul %.3220, 14 + %.3222 =l add %.2219, %.3221 + %.3223 =l extsw 1 + %.3224 =l mul %.3223, 2 + %.3225 =l add %.3222, %.3224 + %.3226 =w loaduh %.3225 + %.3227 =w sub %.3226, 1 + storeh %.3227, %.3225 + %.3228 =w copy %.3227 + %.3229 =l copy $g_794 + %.3230 =l mul 0, 1 + %.3231 =l add %.3229, %.3230 + %.3232 =l copy %.3231 + %.3233 =w loadsw %.3232 + %.3234 =w copy %.3233 + %.3235 =w call $safe_rshift_func_int8_t_s_s(w %.3234, w 0) + %.3236 =w loadsw %.3142 + %.3237 =w loadsw %.2360 + %.3238 =l extsw %.3237 + %.3239 =w csgtl %.3238, 71 + %.3240 =l extsw %.3239 + %.3241 =l loadl %.167 + %.3242 =w loadsw %.3241 + %.3243 =l extsw %.3242 + %.3244 =l call $safe_sub_func_int64_t_s_s(l %.3240, l %.3243) + %.3245 =w copy %.3244 + %.3246 =l loadl %.1 + %.3247 =w loadsw %.3246 + %.3248 =w copy %.3247 + %.3249 =w call $safe_div_func_uint8_t_u_u(w %.3245, w %.3248) + %.3250 =w extub %.3249 + %.3251 =w or %.3236, %.3250 + %.3252 =l loadl %.167 + %.3253 =w loadsw %.3252 + %.3254 =w copy %.3253 + %.3255 =w call $safe_mul_func_uint8_t_u_u(w %.3228, w %.3254) + %.3256 =w extub %.3255 + %.3257 =w loadsw %.2360 + %.3258 =w ceqw %.3256, %.3257 + %.3259 =l loadl %.13 + %.3260 =w cnel %.3259, $g_88 + %.3261 =w copy %.3260 + %.3262 =l copy $g_1183 + %.3263 =l mul 16, 1 + %.3264 =l add %.3262, %.3263 + %.3265 =l copy %.3264 + %.3266 =w loadsw %.3265 + %.3267 =w copy %.3266 + %.3268 =w call $safe_mul_func_int8_t_s_s(w %.3261, w %.3267) + %.3269 =l loadl %.167 + %.3270 =w loadsw %.3269 + %.3271 =w call $safe_rshift_func_int8_t_s_s(w %.3268, w %.3270) + %.3272 =w extsb %.3271 + %.3273 =w loadsw %.3142 + %.3274 =w copy %.3273 + %.3275 =w call $safe_add_func_uint16_t_u_u(w %.3272, w %.3274) + %.3276 =l loadl %.1 + %.3277 =w loadsw %.3276 + %.3278 =l loadl $g_1123 + %.3279 =l loadl %.167 + %.3280 =w loadsw %.3279 + %.3281 =l loadl %.167 + storew %.3280, %.3281 + %.3282 =l extsw %.3280 + %.3283 =w cnel %.3282, 183 + %.3284 =w loadsw %.3142 + %.3285 =w csgew %.3283, %.3284 + %.3286 =w copy %.3285 + %.3287 =w call $safe_mul_func_uint8_t_u_u(w %.3214, w %.3286) + %.3288 =w extub %.3287 + %.3289 =w cnew %.3288, 0 + jnz %.3289, @logic_join.739, @logic_right.738 +@logic_right.738 + %.3290 =w loadsw %.3142 + %.3291 =w cnew %.3290, 0 +@logic_join.739 + %.3292 =w phi @for_body.735 %.3289, @logic_right.738 %.3291 + %.3293 =l extsw 2 + %.3294 =l mul %.3293, 8 + %.3295 =l add %.3145, %.3294 + %.3296 =l extsw 1 + %.3297 =l mul %.3296, 4 + %.3298 =l add %.3295, %.3297 + %.3299 =l extsw 2 + %.3300 =l mul %.3299, 1 + %.3301 =l add %.3298, %.3300 + %.3302 =w loadub %.3301 + %.3303 =w extub %.3302 + %.3304 =w or %.3292, %.3303 + %.3305 =w copy %.3304 + %.3306 =l loadl %.2059 + %.3307 =w copy %.3306 + %.3308 =w call $safe_mul_func_int8_t_s_s(w %.3305, w %.3307) + %.3309 =l extsb %.3308 + %.3310 =w csgel %.3309, 15 + %.3311 =w ceqw %.3213, %.3310 + %.3312 =w and %.3211, %.3311 + %.3313 =w loadsw %.2360 + %.3314 =w cslew %.3312, %.3313 + %.3315 =l extsw 0 + %.3316 =l mul %.3315, 8 + %.3317 =l add %.3145, %.3316 + %.3318 =l extsw 1 + %.3319 =l mul %.3318, 4 + %.3320 =l add %.3317, %.3319 + %.3321 =l extsw 0 + %.3322 =l mul %.3321, 1 + %.3323 =l add %.3320, %.3322 + %.3324 =w loadub %.3323 + %.3325 =w extub %.3324 + %.3326 =w csgew %.3314, %.3325 + %.3327 =w copy %.3326 + %.3328 =w call $safe_mul_func_int8_t_s_s(w %.3205, w %.3327) + %.3329 =w extsb %.3328 + %.3330 =w cnew %.3329, 0 + jnz %.3330, @if_true.740, @if_false.741 +@if_true.740 + %.3332 =l add %.3331, 0 + %.3333 =w copy 618275278 + storew %.3333, %.3332 + %.3335 =l add %.3334, 0 + storel $g_858, %.3335 + %.3337 =l add %.3336, 0 + %.3338 =l extsw 0 + %.3339 =l sub %.3338, 1 + %.3340 =w copy %.3339 + storew %.3340, %.3337 + %.3342 =l add %.3341, 0 + %.3343 =w copy 2 + storew %.3343, %.3342 + %.3345 =l add %.3344, 0 + %.3346 =w copy 4149646672 + storew %.3346, %.3345 + %.3347 =l loadl $g_23 + %.3348 =w loadsw %.3347 + %.3349 =l loadl %.3334 + %.3350 =w loaduh %.3349 + %.3351 =w extuh %.3350 + %.3352 =w loaduw %.3331 + %.3353 =w or %.3351, %.3352 + %.3354 =w copy %.3353 + storeh %.3354, %.3349 + %.3355 =w loadsw %.3142 + %.3356 =l extsw %.3355 + %.3357 =l extsw 0 + %.3358 =l mul %.3357, 8 + %.3359 =l add $g_850, %.3358 + %.3360 =l loadl %.3359 + %.3361 =l loadl $g_1589 + %.3362 =w ceql %.3360, %.3361 + %.3363 =l extsw %.3362 + %.3364 =l call $safe_add_func_uint64_t_u_u(l %.3356, l %.3363) + %.3365 =l loadl $g_1604 + %.3366 =l add %.3365, 1 + storel %.3366, $g_1604 + %.3367 =l or %.3364, %.3365 + %.3368 =w copy %.3367 + %.3369 =l copy 11677653728370779156 + %.3370 =l call $safe_mod_func_int64_t_s_s(l 768946313878535519, l %.3369) + %.3371 =l loadl $g_1590 + %.3372 =w loaduh %.3371 + %.3373 =l extuh %.3372 + %.3374 =w csltl %.3370, %.3373 + %.3375 =w copy %.3374 + %.3376 =w call $safe_rshift_func_int8_t_s_u(w %.3368, w %.3375) + %.3377 =w extsb %.3376 + %.3378 =l extsw 0 + %.3379 =l mul %.3378, 48 + %.3380 =l add %.2371, %.3379 + %.3381 =l extsw 0 + %.3382 =l mul %.3381, 16 + %.3383 =l add %.3380, %.3382 + %.3384 =l extsw 1 + %.3385 =l mul %.3384, 4 + %.3386 =l add %.3383, %.3385 + %.3387 =w loadsw %.3386 + %.3388 =w copy 213 + %.3389 =l copy $g_518 + %.3390 =l mul 24, 1 + %.3391 =l add %.3389, %.3390 + %.3392 =l copy %.3391 + %.3393 =l loadl %.3392 + %.3394 =w copy %.3393 + %.3395 =w call $safe_mul_func_uint8_t_u_u(w %.3388, w %.3394) + %.3396 =w extub %.3395 + %.3397 =w and %.3387, %.3396 + %.3398 =w copy %.3397 + %.3399 =l loadl $g_1590 + %.3400 =w loaduh %.3399 + %.3401 =w extuh %.3400 + %.3402 =w call $safe_lshift_func_int16_t_s_u(w %.3398, w %.3401) + %.3403 =w copy 4 + %.3404 =l loadl $g_1313 + %.3405 =l loadl %.3404 + %.3406 =l loadl %.3405 + %.3407 =l loadl %.3406 + %.3408 =w loaduw %.3407 + %.3409 =w call $safe_div_func_uint32_t_u_u(w %.3403, w %.3408) + %.3410 =l extsw 0 + %.3411 =l extsw 0 + %.3412 =l mul %.3411, 40 + %.3413 =l add $g_1615, %.3412 + %.3414 =l extsw 4 + %.3415 =l mul %.3414, 8 + %.3416 =l add %.3413, %.3415 + %.3417 =l loadl %.3416 + %.3418 =w ceql %.3410, %.3417 + %.3419 =w copy %.3418 + %.3420 =w call $safe_mul_func_int16_t_s_s(w %.3377, w %.3419) + %.3421 =w extsh %.3420 + %.3422 =w or %.3348, %.3421 + storew %.3422, %.3347 + jmp @if_join.742 +@if_false.741 + %.3423 =w loaduh $g_1617 + %.3424 =l extuh %.3423 + ret %.3424 +@if_join.742 + %.3425 =l loadl $g_173 + %.3426 =w loadsw %.3425 + %.3427 =w cnew %.3426, 0 + jnz %.3427, @if_true.743, @if_false.744 +@if_true.743 + jmp @for_cont.736 +@if_false.744 + %.3428 =l copy $g_518 + %.3429 =l mul 40, 1 + %.3430 =l add %.3428, %.3429 + %.3431 =l copy %.3430 + storew 5, %.3431 +@for_cond.745 + %.3432 =l copy $g_518 + %.3433 =l mul 40, 1 + %.3434 =l add %.3432, %.3433 + %.3435 =l copy %.3434 + %.3436 =w loadsw %.3435 + %.3437 =w csgew %.3436, 1 + jnz %.3437, @for_body.746, @for_join.748 +@for_body.746 + %.3438 =l extsw 0 + %.3439 =l mul %.3438, 2 + %.3440 =l add %.50, %.3439 + %.3441 =w loaduh %.3440 + %.3442 =l extuh %.3441 + ret %.3442 +@for_cont.747 + %.3443 =l copy $g_518 + %.3444 =l mul 40, 1 + %.3445 =l add %.3443, %.3444 + %.3446 =l copy %.3445 + %.3447 =w loadsw %.3446 + %.3448 =w sub %.3447, 1 + storew %.3448, %.3446 + jmp @for_cond.745 +@for_join.748 +@for_cont.736 + %.3449 =w loaduw $g_84 + %.3450 =w copy 1 + %.3451 =w add %.3449, %.3450 + storew %.3451, $g_84 + jmp @for_cond.734 +@for_join.737 + jmp @if_join.749 +@if_false.733 + %.3453 =l add %.3452, 0 + %.3454 =w copy 64090 + storeh %.3454, %.3453 + %.3456 =l add %.3455, 0 + storel $g_1038, %.3456 + %.3458 =l add %.3457, 0 + storel $g_776, %.3458 + %.3459 =l add %.3457, 8 + %.3460 =l extsw 0 + %.3461 =l copy %.3460 + storel %.3461, %.3459 + %.3462 =l add %.3457, 16 + storel $g_776, %.3462 + %.3463 =l add %.3457, 24 + %.3464 =l extsw 0 + %.3465 =l copy %.3464 + storel %.3465, %.3463 + %.3466 =l add %.3457, 32 + storel $g_776, %.3466 + %.3467 =l add %.3457, 40 + %.3468 =l extsw 0 + %.3469 =l copy %.3468 + storel %.3469, %.3467 + %.3470 =l add %.3457, 48 + storel $g_776, %.3470 + %.3471 =l add %.3457, 56 + %.3472 =l extsw 0 + %.3473 =l copy %.3472 + storel %.3473, %.3471 + %.3476 =l add %.3475, 0 + %.3477 =l extsw 0 + %.3478 =l sub %.3477, 1 + %.3479 =w copy %.3478 + storew %.3479, %.3476 + %.3481 =l add %.3480, 0 + %.3482 =w copy 3767361468 + storew %.3482, %.3481 + storew 0, %.3483 +@for_cond.750 + %.3484 =w loadsw %.3483 + %.3485 =w csltw %.3484, 7 + jnz %.3485, @for_body.751, @for_join.753 +@for_body.751 + %.3486 =w copy 2380640979 + %.3487 =w loadsw %.3483 + %.3488 =l extsw %.3487 + %.3489 =l mul %.3488, 4 + %.3490 =l add %.3474, %.3489 + storew %.3486, %.3490 +@for_cont.752 + %.3491 =w loadsw %.3483 + %.3492 =w add %.3491, 1 + storew %.3492, %.3483 + jmp @for_cond.750 +@for_join.753 + %.3493 =l loadl $g_1123 + %.3494 =l loadl $g_1123 + %.3495 =l loaduw %.3493 + storew %.3495, %.3494 + %.3496 =l add %.3493, 4 + %.3497 =l add %.3494, 4 + %.3498 =l loaduw %.3496 + storew %.3498, %.3497 + %.3499 =l add %.3496, 4 + %.3500 =l add %.3497, 4 + %.3501 =l loaduw %.3499 + storew %.3501, %.3500 + %.3502 =l add %.3499, 4 + %.3503 =l add %.3500, 4 + %.3504 =l loaduw %.3502 + storew %.3504, %.3503 + %.3505 =l add %.3502, 4 + %.3506 =l add %.3503, 4 + %.3507 =l loaduw %.3505 + storew %.3507, %.3506 + %.3508 =l add %.3505, 4 + %.3509 =l add %.3506, 4 + %.3510 =l extsw 0 + storel %.3510, $g_1604 +@for_cond.754 + %.3511 =l loadl $g_1604 + %.3512 =l extsw 0 + %.3513 =w culel %.3511, %.3512 + jnz %.3513, @for_body.755, @for_join.757 +@for_body.755 + %.3515 =l add %.3514, 0 + %.3516 =l extsw 0 + %.3517 =l sub %.3516, 4 + %.3518 =l copy %.3517 + storel %.3518, %.3515 + %.3519 =l add %.3514, 8 + storel 7086594054811500327, %.3519 + %.3520 =l add %.3514, 16 + storel 6118719662111260546, %.3520 + %.3521 =l add %.3514, 24 + %.3522 =l copy 2 + storel %.3522, %.3521 + %.3523 =l add %.3514, 32 + %.3524 =l extsw 0 + %.3525 =l sub %.3524, 4 + %.3526 =l copy %.3525 + storel %.3526, %.3523 + %.3527 =l add %.3514, 40 + storel 6118719662111260546, %.3527 + %.3528 =l add %.3514, 48 + %.3529 =l extsw 0 + %.3530 =l sub %.3529, 4 + %.3531 =l copy %.3530 + storel %.3531, %.3528 + %.3532 =l add %.3514, 56 + storel 724151589213230642, %.3532 + %.3533 =l add %.3514, 64 + storel 7086594054811500327, %.3533 + %.3534 =l add %.3514, 72 + %.3535 =l copy 2 + storel %.3535, %.3534 + %.3536 =l add %.3514, 80 + storel 724151589213230642, %.3536 + %.3537 =l add %.3514, 88 + storel 724151589213230642, %.3537 + %.3538 =l add %.3514, 96 + storel 6118719662111260546, %.3538 + %.3539 =l add %.3514, 104 + storel 6118719662111260546, %.3539 + %.3540 =l add %.3514, 112 + %.3541 =l copy 7 + storel %.3541, %.3540 + %.3542 =l add %.3514, 120 + %.3543 =l copy 2 + storel %.3543, %.3542 + %.3545 =l add %.3544, 0 + %.3546 =w copy 253 + storeb %.3546, %.3545 + %.3548 =l add %.3547, 0 + %.3549 =w copy 1738457409 + storew %.3549, %.3548 + %.3551 =l add %.3550, 0 + storel %.2053, %.3551 + %.3553 =l add %.3552, 0 + %.3554 =w loadsb $g_2 + %.3555 =l extsb %.3554 + %.3556 =l mul %.3555, 4 + %.3557 =l add %.154, %.3556 + storel %.3557, %.3553 + %.3559 =l add %.3558, 0 + storel $g_1038, %.3559 + %.3561 =l add %.3560, 0 + %.3562 =l extsw 0 + %.3563 =l sub %.3562, 3 + %.3564 =w copy %.3563 + storeh %.3564, %.3561 + %.3566 =l add %.3565, 0 + %.3567 =w copy 65532 + storeh %.3567, %.3566 + %.3570 =w loadsw %.3547 + %.3571 =l extsw %.3570 + %.3572 =l loadl $g_1604 + %.3573 =l extsw 3 + %.3574 =l add %.3572, %.3573 + %.3575 =l copy %.3574 + %.3576 =l mul %.3575, 2 + %.3577 =l add %.50, %.3576 + %.3578 =w loaduh %.3577 + %.3579 =l extuh %.3578 + %.3580 =w cnel 51900480, 0 + jnz %.3580, @logic_join.759, @logic_right.758 +@logic_right.758 + %.3581 =w copy 4045989480 + %.3582 =l loadl %.167 + %.3583 =w loadsw %.3582 + %.3584 =l loadl $g_1589 + %.3585 =l loadl %.3584 + %.3586 =w loaduh %.3585 + %.3587 =w extuh %.3586 + %.3588 =w cnew %.3587, 0 + jnz %.3588, @logic_right.760, @logic_join.761 +@logic_right.760 + %.3589 =l extsw 0 + %.3590 =l sub %.3589, 1 + %.3591 =w copy %.3590 + %.3592 =w copy 13 + %.3593 =w call $safe_rshift_func_int16_t_s_u(w %.3591, w %.3592) + %.3594 =w extsh %.3593 + %.3595 =w loaduh %.3452 + %.3596 =w extuh %.3595 + %.3597 =w cnew %.3594, %.3596 + %.3598 =w cnew %.3597, 0 +@logic_join.761 + %.3599 =w phi @logic_right.758 %.3588, @logic_right.760 %.3598 + %.3600 =w or %.3583, %.3599 + storew %.3600, %.3582 + %.3601 =l loadl $g_23 + storew %.3600, %.3601 + %.3602 =w copy %.3600 + %.3603 =w call $safe_mod_func_uint32_t_u_u(w %.3581, w %.3602) + %.3604 =w copy %.3603 + %.3605 =l extsw 0 + %.3606 =l sub %.3605, 1 + %.3607 =w copy %.3606 + %.3608 =w call $safe_mod_func_int8_t_s_s(w %.3604, w %.3607) + %.3609 =w extsb %.3608 + %.3610 =l extsw 1 + %.3611 =l mul %.3610, 2 + %.3612 =l add %.51, %.3611 + %.3613 =w loadsh %.3612 + %.3614 =l extsh %.3613 + %.3615 =l xor %.3614, 153 + %.3616 =w copy %.3615 + storeh %.3616, %.3612 + %.3617 =w copy %.3616 + %.3618 =l copy $g_185 + %.3619 =l mul 44, 1 + %.3620 =l add %.3618, %.3619 + %.3621 =l copy %.3620 + %.3622 =w loadsw %.3621 + %.3623 =w call $safe_lshift_func_uint8_t_u_s(w %.3617, w %.3622) + %.3624 =w extub %.3623 + %.3625 =w and %.3609, %.3624 + %.3626 =l extsw %.3625 + %.3627 =l copy $g_794 + %.3628 =l mul 12, 1 + %.3629 =l add %.3627, %.3628 + %.3630 =l copy %.3629 + %.3631 =w loadsw %.3630 + %.3632 =l extsw %.3631 + %.3633 =l call $safe_add_func_int64_t_s_s(l %.3626, l %.3632) + %.3634 =w copy %.3633 + %.3635 =w call $safe_unary_minus_func_int32_t_s(w %.3634) + %.3636 =l extsw %.3635 + %.3637 =w csgtl %.3636, 1 + %.3638 =l extsw %.3637 + %.3639 =l extsw 2 + %.3640 =l mul %.3639, 32 + %.3641 =l add %.3514, %.3640 + %.3642 =l extsw 2 + %.3643 =l mul %.3642, 8 + %.3644 =l add %.3641, %.3643 + %.3645 =l loadl %.3644 + %.3646 =l copy %.3645 + %.3647 =l call $safe_div_func_uint64_t_u_u(l %.3638, l %.3646) + %.3648 =l extsw 0 + %.3649 =l sub %.3648, 1 + %.3650 =l copy %.3649 + %.3651 =w cnel %.3647, %.3650 + %.3652 =w cnew %.3651, 0 +@logic_join.759 + %.3653 =w phi @for_body.755 %.3580, @logic_join.761 %.3652 + %.3654 =w loadsb $g_631 + %.3655 =l extsb %.3654 + %.3656 =w csgel 19, %.3655 + %.3657 =l copy $g_1183 + %.3658 =l mul 8, 1 + %.3659 =l add %.3657, %.3658 + %.3660 =l copy %.3659 + %.3661 =l loadl %.3660 + %.3662 =l copy %.3661 + %.3663 =l copy 18446744073709551615 + %.3664 =l call $safe_div_func_uint64_t_u_u(l %.3662, l %.3663) + %.3665 =w cugtl %.3579, %.3664 + %.3666 =l loadl $g_1590 + %.3667 =w loaduh %.3666 + %.3668 =w extuh %.3667 + %.3669 =w or %.3665, %.3668 + %.3670 =l copy 1979550271 + %.3671 =w cultl 4294967295, %.3670 + %.3672 =w copy %.3671 + %.3673 =l extsw 1 + %.3674 =l mul %.3673, 80 + %.3675 =l add %.185, %.3674 + %.3676 =l extsw 8 + %.3677 =l mul %.3676, 8 + %.3678 =l add %.3675, %.3677 + %.3679 =l loadl %.3678 + %.3680 =w copy %.3679 + %.3681 =w call $safe_add_func_int16_t_s_s(w %.3672, w %.3680) + %.3682 =w loadub %.3544 + %.3683 =l extub %.3682 + %.3684 =w loadsh %.2062 + %.3685 =l extsh %.3684 + %.3686 =l call $safe_mod_func_int64_t_s_s(l %.3683, l %.3685) + %.3687 =l or %.3571, %.3686 + %.3688 =w copy %.3687 + storew %.3688, %.3547 + %.3689 =w loadsw $g_1645 + %.3690 =w cnew %.3689, 0 + jnz %.3690, @if_true.762, @if_false.763 +@if_true.762 + %.3692 =l add %.3691, 0 + %.3693 =w copy 5 + storeb %.3693, %.3692 + %.3695 =l add %.3694, 0 + %.3696 =w copy 10544 + storeh %.3696, %.3695 + %.3697 =l extsw 0 + %.3698 =l loadl %.3550 + %.3699 =w cnel %.3697, %.3698 + %.3700 =w loadsb %.3691 + %.3701 =w extsb %.3700 + %.3702 =l loadl $g_1589 + %.3703 =l loadl %.3702 + %.3704 =w loaduh %.3703 + %.3705 =l extuh %.3704 + %.3706 =l copy $g_794 + %.3707 =l mul 4, 1 + %.3708 =l add %.3706, %.3707 + %.3709 =l copy %.3708 + %.3710 =w loaduw %.3709 + %.3711 =l loadl $g_173 + %.3712 =w loadsw %.3711 + %.3713 =w loadsb %.3691 + %.3714 =w extsb %.3713 + %.3715 =w or %.3712, %.3714 + %.3716 =w copy %.3715 + %.3717 =l loadl %.167 + %.3718 =w loadsw %.3717 + %.3719 =l extsw %.3718 + %.3720 =l loadl $g_1037 + %.3721 =l loadl %.3720 + %.3722 =l loadl %.3721 + %.3723 =l loadl $g_1037 + %.3724 =l loadl %.3723 + storel %.3722, %.3724 + %.3725 =l loadl %.3552 + %.3726 =w ceql %.3722, %.3725 + %.3727 =w copy %.3726 + %.3728 =w loadsb %.3691 + %.3729 =w extsb %.3728 + %.3730 =w call $safe_mul_func_int16_t_s_s(w %.3727, w %.3729) + %.3731 =w extsh %.3730 + %.3732 =l loadl %.1 + %.3733 =w loadsw %.3732 + %.3734 =w and %.3731, %.3733 + %.3735 =l extsw %.3734 + %.3736 =w loadsh $g_81 + %.3737 =l extsh %.3736 + %.3738 =l call $safe_mod_func_int64_t_s_s(l %.3735, l %.3737) + %.3739 =w cslel %.3719, %.3738 + %.3740 =w copy %.3739 + %.3741 =w call $safe_rshift_func_int16_t_s_u(w %.3716, w %.3740) + %.3742 =w copy %.3741 + %.3743 =w copy 2 + %.3744 =w call $safe_rshift_func_int8_t_s_u(w %.3742, w %.3743) + %.3745 =l extsb %.3744 + %.3746 =w csgel 48, %.3745 + %.3747 =l extsw %.3746 + %.3748 =l copy 643467775842209626 + %.3749 =l call $safe_mod_func_uint64_t_u_u(l %.3747, l %.3748) + %.3750 =l xor %.3705, %.3749 + %.3751 =w copy %.3750 + storeh %.3751, %.3703 + %.3752 =w loadsh %.3694 + %.3753 =w copy %.3752 + %.3754 =w call $safe_mul_func_uint16_t_u_u(w %.3751, w %.3753) + %.3755 =w extuh %.3754 + %.3756 =w call $safe_mod_func_int32_t_s_s(w %.3701, w %.3755) + %.3757 =w copy %.3756 + %.3758 =w call $safe_lshift_func_int16_t_s_s(w %.3757, w 12) + %.3759 =w extsh %.3758 + %.3760 =w xor %.3699, %.3759 + %.3761 =l loadl $g_173 + storew %.3760, %.3761 + %.3762 =l loadl $g_173 + %.3763 =w loadsw %.3762 + %.3764 =w cnew %.3763, 0 + jnz %.3764, @if_true.764, @if_false.765 +@if_true.764 + jmp @for_cont.756 +@if_false.765 + %.3765 =w loadsw %.241 + %.3766 =l extsw %.3765 + ret %.3766 +@if_false.763 + %.3769 =l add %.3768, 0 + %.3770 =l extsw 0 + %.3771 =l copy %.3770 + storel %.3771, %.3769 + %.3773 =l add %.3772, 0 + storel $g_46, %.3773 + %.3774 =l add %.3772, 8 + storel $g_46, %.3774 + %.3775 =l add %.3772, 16 + storel $g_46, %.3775 + %.3776 =l add %.3772, 24 + storel $g_46, %.3776 + %.3777 =l add %.3772, 32 + storel $g_46, %.3777 + %.3779 =l add %.3778, 0 + %.3780 =l copy $g_185 + %.3781 =l mul 8, 1 + %.3782 =l add %.3780, %.3781 + %.3783 =l copy %.3782 + storel %.3783, %.3779 + storew 0, %.3784 +@for_cond.767 + %.3786 =w loadsw %.3784 + %.3787 =w csltw %.3786, 4 + jnz %.3787, @for_body.768, @for_join.770 +@for_body.768 + %.3788 =w copy 66482976 + %.3789 =w loadsw %.3784 + %.3790 =l extsw %.3789 + %.3791 =l mul %.3790, 4 + %.3792 =l add %.3767, %.3791 + storew %.3788, %.3792 +@for_cont.769 + %.3793 =w loadsw %.3784 + %.3794 =w add %.3793, 1 + storew %.3794, %.3784 + jmp @for_cond.767 +@for_join.770 + %.3795 =l extsw 0 + %.3796 =l loadl $g_1604 + %.3797 =l copy %.3796 + %.3798 =l mul %.3797, 40 + %.3799 =l add $g_1615, %.3798 + %.3800 =l loadl $g_1604 + %.3801 =l extsw 1 + %.3802 =l add %.3800, %.3801 + %.3803 =l copy %.3802 + %.3804 =l mul %.3803, 8 + %.3805 =l add %.3799, %.3804 + %.3806 =l loadl %.3805 + %.3807 =w ceql %.3795, %.3806 + %.3808 =l extsw %.3807 + %.3809 =w culel %.3808, 0 + %.3810 =w cnew %.3809, 0 + jnz %.3810, @logic_right.771, @logic_join.772 +@logic_right.771 + %.3811 =l extsw 0 + %.3812 =l mul %.3811, 4 + %.3813 =l add %.3767, %.3812 + %.3814 =w loadsw %.3813 + storew %.3814, %.3547 + %.3815 =l extsw 0 + %.3816 =l mul %.3815, 4 + %.3817 =l add %.3767, %.3816 + %.3818 =w loadsw %.3817 + %.3819 =w or %.3814, %.3818 + %.3820 =w copy %.3819 + %.3821 =l extsw 0 + %.3822 =l mul %.3821, 4 + %.3823 =l add %.3767, %.3822 + %.3824 =w loadsw %.3823 + %.3825 =l loadl %.3558 + %.3826 =l loadl $g_1313 + storel %.3825, %.3826 + %.3827 =w copy 1 + %.3828 =w copy 5 + %.3829 =w call $safe_lshift_func_int8_t_s_u(w %.3827, w %.3828) + %.3830 =l extsb %.3829 + %.3831 =l loadl %.3778 + storel %.3830, %.3831 + %.3832 =l loadl $g_173 + %.3833 =w loadsw %.3832 + %.3834 =w cnew %.3833, 0 + jnz %.3834, @logic_join.774, @logic_right.773 +@logic_right.773 + %.3835 =w loadsh %.3560 + %.3836 =w extsh %.3835 + %.3837 =w cnew %.3836, 0 +@logic_join.774 + %.3838 =w phi @logic_right.771 %.3834, @logic_right.773 %.3837 + %.3839 =w copy %.3838 + %.3840 =w copy 9 + %.3841 =w call $safe_lshift_func_int16_t_s_u(w %.3839, w %.3840) + %.3842 =w loadsw %.52 + %.3843 =w copy %.3842 + %.3844 =w call $safe_mod_func_int16_t_s_s(w %.3841, w %.3843) + %.3845 =l extsh %.3844 + %.3846 =l and %.3845, 54431 + %.3847 =w copy %.3846 + %.3848 =l extsw 6 + %.3849 =l mul %.3848, 4 + %.3850 =l add %.244, %.3849 + storew %.3847, %.3850 + %.3851 =l extuw %.3847 + %.3852 =w csgtl %.3830, %.3851 + %.3853 =w copy %.3852 + %.3854 =w copy 76 + %.3855 =w call $safe_add_func_uint8_t_u_u(w %.3853, w %.3854) + %.3856 =l extub %.3855 + %.3857 =w cslel %.3856, 44776 + %.3858 =w copy %.3857 + %.3859 =w call $safe_lshift_func_int8_t_s_s(w %.3858, w 4) + %.3860 =l extsb %.3859 + %.3861 =w loadub $g_566 + %.3862 =l extub %.3861 + %.3863 =l call $safe_div_func_int64_t_s_s(l %.3860, l %.3862) + %.3864 =l loadl %.3455 + %.3865 =w cnel %.3825, %.3864 + %.3866 =l extsw %.3865 + %.3867 =w csltl %.3866, 156 + %.3868 =w or %.3824, %.3867 + %.3869 =l loadl $g_1604 + %.3870 =l extsw 3 + %.3871 =l add %.3869, %.3870 + %.3872 =l copy %.3871 + %.3873 =l mul %.3872, 2 + %.3874 =l add %.50, %.3873 + %.3875 =w loaduh %.3874 + %.3876 =l extuh %.3875 + %.3877 =l and 57607, %.3876 + %.3878 =l and %.3877, 3 + %.3879 =w copy %.3878 + %.3880 =l extsw 2 + %.3881 =l mul %.3880, 32 + %.3882 =l add %.3514, %.3881 + %.3883 =l extsw 2 + %.3884 =l mul %.3883, 8 + %.3885 =l add %.3882, %.3884 + %.3886 =l loadl %.3885 + %.3887 =w copy %.3886 + %.3888 =w call $safe_lshift_func_uint8_t_u_u(w %.3879, w %.3887) + %.3889 =w extub %.3888 + %.3890 =w call $safe_add_func_uint16_t_u_u(w %.3820, w %.3889) + %.3891 =w extuh %.3890 + %.3892 =w cnew %.3891, 0 +@logic_join.772 + %.3893 =w phi @for_join.770 %.3810, @logic_join.774 %.3892 + %.3894 =l loadl $g_23 + storew %.3893, %.3894 + %.3895 =l extsw 2 + %.3896 =l mul %.3895, 4 + %.3897 =l add %.3767, %.3896 + %.3898 =w loadsw %.3897 + %.3899 =w cnew %.3898, 0 + jnz %.3899, @if_true.775, @if_false.776 +@if_true.775 + jmp @for_cont.756 +@if_false.776 +@if_join.766 + %.3900 =l loadl $g_1123 + %.3901 =l loadl $g_1123 + %.3902 =l loaduw %.3900 + storew %.3902, %.3901 + %.3903 =l add %.3900, 4 + %.3904 =l add %.3901, 4 + %.3905 =l loaduw %.3903 + storew %.3905, %.3904 + %.3906 =l add %.3903, 4 + %.3907 =l add %.3904, 4 + %.3908 =l loaduw %.3906 + storew %.3908, %.3907 + %.3909 =l add %.3906, 4 + %.3910 =l add %.3907, 4 + %.3911 =l loaduw %.3909 + storew %.3911, %.3910 + %.3912 =l add %.3909, 4 + %.3913 =l add %.3910, 4 + %.3914 =l loaduw %.3912 + storew %.3914, %.3913 + %.3915 =l add %.3912, 4 + %.3916 =l add %.3913, 4 + %.3917 =w loadub %.3544 + %.3918 =w extub %.3917 + %.3919 =l loadl %.1 + storew %.3918, %.3919 + %.3920 =w cnew %.3918, 0 + jnz %.3920, @if_true.777, @if_false.778 +@if_true.777 + %.3922 =l add %.3921, 0 + storel $g_1123, %.3922 + %.3924 =l add %.3923, 0 + storel %.3921, %.3924 + %.3926 =l add %.3925, 0 + %.3927 =l copy $g_1183 + %.3928 =l mul 8, 1 + %.3929 =l add %.3927, %.3928 + %.3930 =l copy %.3929 + storel %.3930, %.3926 + %.3932 =l add %.3931, 0 + %.3933 =w copy 1741455405 + storew %.3933, %.3932 + %.3935 =l add %.3934, 0 + %.3936 =w copy 86 + storeb %.3936, %.3935 + %.3938 =l loadl $g_296 + %.3939 =l loadl %.3938 + %.3940 =w loadub %.3544 + %.3941 =w extub %.3940 + %.3942 =w cnew %.3941, 0 + jnz %.3942, @logic_join.780, @logic_right.779 +@logic_right.779 + %.3943 =l extsw 0 + %.3944 =l extsw 3 + %.3945 =l mul %.3944, 8 + %.3946 =l add %.3457, %.3945 + %.3947 =l loadl %.3946 + %.3948 =w cnel %.3943, %.3947 + %.3949 =l loadl $g_173 + %.3950 =w loadsw %.3949 + %.3951 =l extsw %.3950 + %.3952 =l loadl %.3923 + %.3953 =l loadl $g_1705 + storel %.3953, $g_1705 + %.3954 =w ceql %.3952, %.3953 + %.3955 =w copy %.3954 + %.3956 =w copy 27473 + %.3957 =l loadl $g_1604 + %.3958 =l copy %.3957 + %.3959 =l mul %.3958, 4 + %.3960 =l add %.154, %.3959 + %.3961 =w loaduw %.3960 + %.3962 =l copy 3 + %.3963 =l loadl %.3925 + storel %.3962, %.3963 + %.3964 =w cnel %.3962, 0 + jnz %.3964, @logic_join.786, @logic_right.785 +@logic_right.785 + %.3965 =l copy $g_130 + %.3966 =l mul 4, 1 + %.3967 =l add %.3965, %.3966 + %.3968 =l copy %.3967 + %.3969 =w loaduw %.3968 + %.3970 =w cnew %.3969, 0 + jnz %.3970, @logic_join.788, @logic_right.787 +@logic_right.787 + %.3971 =w loaduh %.3452 + %.3972 =w extuh %.3971 + %.3973 =w cnew %.3972, 0 +@logic_join.788 + %.3974 =w phi @logic_right.785 %.3970, @logic_right.787 %.3973 + %.3975 =l extsw %.3974 + %.3976 =l xor %.3975, 14260922971091615517 + %.3977 =w copy %.3976 + %.3978 =w loadsw %.3931 + %.3979 =w copy %.3978 + %.3980 =w call $safe_div_func_uint16_t_u_u(w %.3977, w %.3979) + %.3981 =l extsw 0 + %.3982 =l sub %.3981, 9 + %.3983 =w copy %.3982 + %.3984 =w loaduh %.3452 + %.3985 =w extuh %.3984 + %.3986 =w call $safe_lshift_func_int8_t_s_u(w %.3983, w %.3985) + %.3987 =l extsb %.3986 + %.3988 =w ceql %.3987, 253 + %.3989 =w copy %.3988 + %.3990 =w loaduh %.3452 + %.3991 =w copy %.3990 + %.3992 =w call $safe_div_func_uint8_t_u_u(w %.3989, w %.3991) + %.3993 =w extub %.3992 + %.3994 =l extsw 2 + %.3995 =l mul %.3994, 32 + %.3996 =l add %.3514, %.3995 + %.3997 =l extsw 2 + %.3998 =l mul %.3997, 8 + %.3999 =l add %.3996, %.3998 + %.4000 =l loadl %.3999 + %.4001 =w copy %.4000 + %.4002 =w call $safe_sub_func_uint32_t_u_u(w %.3993, w %.4001) + %.4003 =w cnew %.4002, 0 +@logic_join.786 + %.4004 =w phi @logic_right.779 %.3964, @logic_join.788 %.4003 + %.4005 =w copy %.4004 + %.4006 =w xor %.3961, %.4005 + storew %.4006, %.3960 + %.4007 =w cnew %.4006, 0 + jnz %.4007, @logic_join.784, @logic_right.783 +@logic_right.783 + %.4008 =w cnel 880984431, 0 +@logic_join.784 + %.4009 =w phi @logic_join.786 %.4007, @logic_right.783 %.4008 + %.4010 =l extsw 0 + %.4011 =w cnel %.4010, $g_1590 + %.4012 =w copy %.4011 + %.4013 =w call $safe_sub_func_uint16_t_u_u(w %.3956, w %.4012) + %.4014 =w copy %.4013 + %.4015 =w call $safe_mod_func_uint8_t_u_u(w %.3955, w %.4014) + %.4016 =w extub %.4015 + %.4017 =w loaduh %.3452 + %.4018 =w extuh %.4017 + %.4019 =w and %.4016, %.4018 + %.4020 =w loadsb %.3934 + %.4021 =w extsb %.4020 + %.4022 =w csgew %.4019, %.4021 + %.4023 =l extsw %.4022 + %.4024 =w csgtl %.4023, 63294 + %.4025 =l extsw %.4024 + %.4026 =l loadl %.55 + %.4027 =l xor %.4025, %.4026 + %.4028 =l xor %.3951, %.4027 + %.4029 =w copy %.4028 + storew %.4029, %.3949 + %.4030 =w loaduh %.3452 + %.4031 =w loadsw %.3547 + %.4032 =l loadl $g_23 + %.4033 =w loadsw %.4032 + %.4034 =w csltw %.4031, %.4033 + %.4035 =w copy %.4034 + %.4036 =w copy 4 + %.4037 =w call $safe_lshift_func_uint8_t_u_u(w %.4035, w %.4036) + %.4038 =w extub %.4037 + %.4039 =w loaduh %.3452 + %.4040 =w extuh %.4039 + %.4041 =w csgtw %.4038, %.4040 + %.4042 =w ceqw %.4041, 0 + %.4043 =l extsw %.4042 + %.4044 =w culel %.4043, 10993731942557843686 + %.4045 =w copy %.4044 + %.4046 =l loadl %.167 + %.4047 =w loadsw %.4046 + %.4048 =w copy %.4047 + %.4049 =w call $safe_mul_func_int8_t_s_s(w %.4045, w %.4048) + %.4050 =w extsb %.4049 + %.4051 =w call $safe_sub_func_int32_t_s_s(w %.3948, w %.4050) + %.4052 =w cnew %.4051, 0 + jnz %.4052, @logic_join.782, @logic_right.781 +@logic_right.781 + %.4053 =w loadsh %.3560 + %.4054 =w extsh %.4053 + %.4055 =w cnew %.4054, 0 +@logic_join.782 + %.4056 =w phi @logic_join.784 %.4052, @logic_right.781 %.4055 + %.4057 =w cnew %.4056, 0 +@logic_join.780 + %.4058 =w phi @if_true.777 %.3942, @logic_join.782 %.4057 + storel %.3547, %.1 + %.4059 =w loadsh %.58 + %.4060 =l extsh %.4059 + ret %.4060 +@if_false.778 + %.4063 =l add %.4062, 0 + %.4064 =l copy $g_185 + %.4065 =l mul 36, 1 + %.4066 =l add %.4064, %.4065 + %.4067 =l copy %.4066 + storel %.4067, %.4063 + %.4069 =l add %.4068, 0 + storel %.4062, %.4069 + %.4071 =l add %.4070, 0 + storel $g_566, %.4071 + storew 0, %.4072 +@for_cond.790 + %.4073 =w loadsw %.4072 + %.4074 =w csltw %.4073, 6 + jnz %.4074, @for_body.791, @for_join.793 +@for_body.791 + %.4075 =w copy 65396 + %.4076 =w loadsw %.4072 + %.4077 =l extsw %.4076 + %.4078 =l mul %.4077, 2 + %.4079 =l add %.4061, %.4078 + storeh %.4075, %.4079 +@for_cont.792 + %.4080 =w loadsw %.4072 + %.4081 =w add %.4080, 1 + storew %.4081, %.4072 + jmp @for_cond.790 +@for_join.793 + %.4082 =l extsw 1 + %.4083 =l mul %.4082, 2 + %.4084 =l add %.4061, %.4083 + %.4085 =w loaduh %.4084 + %.4086 =w sub %.4085, 1 + storeh %.4086, %.4084 + %.4087 =w loadub %.3544 + %.4088 =w extub %.4087 + %.4089 =w cnew %.4088, 0 + jnz %.4089, @logic_join.795, @logic_right.794 +@logic_right.794 + %.4090 =l loadl %.3552 + %.4091 =l loadl %.4068 + storel %.4090, %.4091 + %.4092 =w ceql %.4090, $g_1298 + %.4093 =l extsw %.4092 + %.4094 =w cslel %.4093, 59139 + %.4095 =w cnew %.4094, 0 + jnz %.4095, @logic_join.797, @logic_right.796 +@logic_right.796 + %.4096 =l copy $g_518 + %.4097 =l mul 0, 1 + %.4098 =l add %.4096, %.4097 + %.4099 =l copy %.4098 + %.4100 =w loadub %.4099 + %.4101 =w cnel 0, 0 + jnz %.4101, @logic_join.799, @logic_right.798 +@logic_right.798 + %.4102 =l extsw 0 + %.4103 =w cnel %.4102, $g_1706 + %.4104 =w loaduh %.3452 + %.4105 =w copy %.4104 + %.4106 =l loadl %.4070 + storeb %.4105, %.4106 + %.4107 =l loadl $g_80 + %.4108 =w copy %.4107 + %.4109 =w call $safe_div_func_uint8_t_u_u(w %.4105, w %.4108) + %.4110 =w loaduh %.3452 + %.4111 =w extuh %.4110 + %.4112 =w cnew %.4111, 0 + jnz %.4112, @logic_join.801, @logic_right.800 +@logic_right.800 + %.4113 =l loadl $g_1590 + %.4114 =w loaduh %.4113 + %.4115 =w extuh %.4114 + %.4116 =w cnew %.4115, 0 +@logic_join.801 + %.4117 =w phi @logic_right.798 %.4112, @logic_right.800 %.4116 + %.4118 =w cslew %.4103, %.4117 + %.4119 =w cnew %.4118, 0 +@logic_join.799 + %.4120 =w phi @logic_right.796 %.4101, @logic_join.801 %.4119 + %.4121 =l extsw %.4120 + %.4122 =l extsw 0 + %.4123 =l sub %.4122, 1 + %.4124 =w cslel %.4121, %.4123 + %.4125 =w cnel 0, 0 +@logic_join.797 + %.4126 =w phi @logic_right.794 %.4095, @logic_join.799 %.4125 + %.4127 =w cnew %.4126, 0 +@logic_join.795 + %.4128 =w phi @for_join.793 %.4089, @logic_join.797 %.4127 + storew %.4128, %.3547 + %.4129 =l extsw 4 + %.4130 =l mul %.4129, 2 + %.4131 =l add %.4061, %.4130 + %.4132 =w loaduh %.4131 + %.4133 =w copy %.4132 + %.4134 =l extsw 0 + %.4135 =l mul %.4134, 2 + %.4136 =l add %.4061, %.4135 + %.4137 =w loaduh %.4136 + %.4138 =w copy %.4137 + %.4139 =w call $safe_mul_func_int8_t_s_s(w %.4133, w %.4138) + %.4140 =w extsb %.4139 + %.4141 =w loadsh %.3560 + %.4142 =w extsh %.4141 + %.4143 =w cnew %.4140, %.4142 + %.4144 =l extsw %.4143 + %.4145 =w csgtl %.4144, 621071666104868882 + %.4146 =l extsw %.4145 + %.4147 =l copy $g_265 + %.4148 =l mul 24, 1 + %.4149 =l add %.4147, %.4148 + %.4150 =l copy %.4149 + %.4151 =l loadl %.4150 + %.4152 =l call $safe_add_func_uint64_t_u_u(l %.4146, l %.4151) + %.4153 =w loaduh %.3565 + %.4154 =w copy %.4153 + storeh %.4154, %.261 +@if_join.789 +@for_cont.756 + %.4155 =l loadl $g_1604 + %.4156 =l extsw 1 + %.4157 =l add %.4155, %.4156 + storel %.4157, $g_1604 + jmp @for_cond.754 +@for_join.757 + storew 4, %.178 +@for_cond.802 + %.4158 =w loadsw %.178 + %.4159 =w csgew %.4158, 0 + jnz %.4159, @for_body.803, @for_join.805 +@for_body.803 + %.4161 =l add %.4160, 0 + %.4162 =l extsw 2 + %.4163 =l mul %.4162, 72 + %.4164 =l add $g_1616, %.4163 + %.4165 =l extsw 5 + %.4166 =l mul %.4165, 8 + %.4167 =l add %.4164, %.4166 + storel %.4167, %.4161 + %.4168 =l extsw 7 + %.4169 =l mul %.4168, 8 + %.4170 =l add %.2067, %.4169 + %.4171 =l loadl %.4170 + %.4172 =l loadl %.4160 + storel %.4171, %.4172 +@for_cont.804 + %.4173 =w loadsw %.178 + %.4174 =w sub %.4173, 1 + storew %.4174, %.178 + jmp @for_cond.802 +@for_join.805 + %.4175 =w copy 0 + storeb %.4175, $g_629 +@for_cond.806 + %.4176 =w loadsb $g_629 + %.4177 =w extsb %.4176 + %.4178 =w cslew %.4177, 7 + jnz %.4178, @for_body.807, @for_join.809 +@for_body.807 + %.4180 =l add %.4179, 0 + %.4181 =l extsw 0 + %.4182 =l copy %.4181 + storel %.4182, %.4180 + %.4184 =l add %.4183, 0 + %.4185 =l copy 2 + storel %.4185, %.4184 + %.4187 =l add %.4186, 0 + %.4188 =l extsw 0 + %.4189 =l sub %.4188, 1 + %.4190 =w copy %.4189 + storew %.4190, %.4187 + %.4192 =l add %.4191, 0 + %.4193 =w copy 734174619 + storew %.4193, %.4192 + %.4195 =l add %.4194, 0 + %.4196 =w copy 9 + storew %.4196, %.4195 + %.4198 =l add %.4197, 0 + %.4199 =l extsw 0 + %.4200 =l sub %.4199, 2 + %.4201 =w copy %.4200 + storew %.4201, %.4198 + %.4203 =l add %.4202, 0 + %.4204 =w copy 0 + storew %.4204, %.4203 + %.4206 =l add %.4205, 0 + %.4207 =l extsw 0 + %.4208 =l sub %.4207, 2 + %.4209 =w copy %.4208 + storew %.4209, %.4206 + %.4210 =l add %.4205, 4 + %.4211 =w copy 5 + storew %.4211, %.4210 + %.4212 =l add %.4205, 8 + %.4213 =l extsw 0 + %.4214 =l sub %.4213, 2 + %.4215 =w copy %.4214 + storew %.4215, %.4212 + %.4216 =l add %.4205, 12 + %.4217 =l extsw 0 + %.4218 =l sub %.4217, 2 + %.4219 =w copy %.4218 + storew %.4219, %.4216 + %.4220 =l add %.4205, 16 + %.4221 =w copy 5 + storew %.4221, %.4220 + %.4222 =l add %.4205, 20 + %.4223 =w copy 5 + storew %.4223, %.4222 + %.4224 =l add %.4205, 24 + %.4225 =w copy 3043948438 + storew %.4225, %.4224 + %.4226 =l add %.4205, 28 + %.4227 =w copy 5 + storew %.4227, %.4226 + %.4230 =w loaduw %.61 + %.4231 =w sub %.4230, 1 + storew %.4231, %.61 + %.4232 =l copy $g_130 + %.4233 =l mul 0, 1 + %.4234 =l add %.4232, %.4233 + %.4235 =l copy %.4234 + %.4236 =w loadsw %.4235 + %.4237 =w copy 8 + %.4238 =w call $safe_rshift_func_int8_t_s_s(w %.4237, w 7) + %.4239 =w extsb %.4238 + %.4240 =w or %.4236, %.4239 + %.4241 =w copy %.4240 + %.4242 =l loadl $g_1752 + %.4243 =l loadl %.68 + %.4244 =w cnel %.4242, %.4243 + %.4245 =l extsw 0 + %.4246 =w cnel %.4245, $g_1269 + %.4247 =w xor %.4244, %.4246 + %.4248 =l loadl $g_1589 + %.4249 =l loadl %.4248 + %.4250 =w loaduh %.4249 + %.4251 =l loadl %.4179 + %.4252 =l copy $g_265 + %.4253 =l mul 32, 1 + %.4254 =l add %.4252, %.4253 + %.4255 =l copy %.4254 + %.4256 =w loaduw %.4255 + %.4257 =w copy %.4256 + %.4258 =w copy 246 + %.4259 =w call $safe_mul_func_int8_t_s_s(w %.4257, w %.4258) + %.4260 =w extsb %.4259 + %.4261 =l loadl %.1 + %.4262 =w loadsw %.4261 + %.4263 =w csgew %.4260, %.4262 + %.4264 =l call $func_8(w %.4263) + %.4265 =l extsw 5 + %.4266 =l mul %.4265, 4 + %.4267 =l add %.3474, %.4266 + %.4268 =l extsw 6 + %.4269 =l mul %.4268, 4 + %.4270 =l add %.3474, %.4269 + %.4271 =l call $func_4(l %.4264, l %.4267, l %.4270) + storel %.4271, %.1 + %.4272 =l loadl %.4179 + %.4273 =l call $func_4(l %.4251, l %.4271, l %.4272) + %.4274 =l loadl %.4179 + %.4275 =l loadl %.264 + %.4276 =l call $func_4(l %.4273, l %.4274, l %.4275) + %.4277 =l loadl %.4179 + %.4278 =l extsw 6 + %.4279 =l mul %.4278, 4 + %.4280 =l add %.3474, %.4279 + %.4281 =l call $func_4(l %.4276, l %.4277, l %.4280) + %.4282 =l loadl %.4179 + %.4283 =l extsw 5 + %.4284 =l mul %.4283, 4 + %.4285 =l add %.3474, %.4284 + %.4286 =l call $func_4(l %.4281, l %.4282, l %.4285) + %.4287 =l loadl %.3455 + %.4288 =l loadl %.4287 + %.4289 =l loadl %.4288 + %.4290 =w ceql %.4286, %.4289 + %.4291 =l extsw %.4290 + %.4292 =l or %.4291, 12837 + %.4293 =w cnel %.4292, 0 + jnz %.4293, @logic_right.810, @logic_join.811 +@logic_right.810 + %.4294 =l loadl %.167 + %.4295 =w loadsw %.4294 + %.4296 =w cnew %.4295, 0 +@logic_join.811 + %.4297 =w phi @for_body.807 %.4293, @logic_right.810 %.4296 + %.4298 =w copy %.4297 + %.4299 =l loadl $g_1313 + %.4300 =l loadl %.4299 + %.4301 =l loadl %.4300 + %.4302 =l loadl %.4301 + %.4303 =w loaduw %.4302 + %.4304 =w cultw %.4298, %.4303 + %.4305 =w copy %.4304 + %.4306 =w call $safe_sub_func_uint8_t_u_u(w %.4241, w %.4305) + %.4307 =l extub %.4306 + %.4308 =l loadl %.4183 + %.4309 =l call $safe_mod_func_uint64_t_u_u(l %.4307, l %.4308) + %.4310 =w copy %.4309 + %.4311 =w copy 0 + %.4312 =w call $safe_add_func_uint16_t_u_u(w %.4310, w %.4311) + %.4313 =w extuh %.4312 + %.4314 =l loadl %.167 + storew %.4313, %.4314 + %.4315 =l copy $g_518 + %.4316 =l mul 48, 1 + %.4317 =l add %.4315, %.4316 + %.4318 =l copy %.4317 + storew 0, %.4318 +@for_cond.812 + %.4319 =l copy $g_518 + %.4320 =l mul 48, 1 + %.4321 =l add %.4319, %.4320 + %.4322 =l copy %.4321 + %.4323 =w loadsw %.4322 + %.4324 =w cslew %.4323, 0 + jnz %.4324, @for_body.813, @for_join.815 +@for_body.813 + %.4326 =w loadsw %.3475 + %.4327 =l copy $g_518 + %.4328 =l mul 48, 1 + %.4329 =l add %.4327, %.4328 + %.4330 =l copy %.4329 + %.4331 =w loadsw %.4330 + %.4332 =l extsw %.4331 + %.4333 =l mul %.4332, 4 + %.4334 =l add %.184, %.4333 + storew %.4326, %.4334 + %.4335 =l loadl %.1 + storew %.4326, %.4335 + %.4336 =l loadl %.4183 + %.4337 =l copy %.4336 + ret %.4337 +@for_cont.814 + %.4338 =l copy $g_518 + %.4339 =l mul 48, 1 + %.4340 =l add %.4338, %.4339 + %.4341 =l copy %.4340 + %.4342 =w loadsw %.4341 + %.4343 =w add %.4342, 1 + storew %.4343, %.4341 + jmp @for_cond.812 +@for_join.815 + %.4344 =l extsw 2 + %.4345 =l mul %.4344, 24 + %.4346 =l add %.2076, %.4345 + %.4347 =l extsw 4 + %.4348 =l mul %.4347, 4 + %.4349 =l add %.4346, %.4348 + %.4350 =w loaduw %.4349 + %.4351 =w add %.4350, 1 + storew %.4351, %.4349 +@for_cont.808 + %.4352 =w loadsb $g_629 + %.4353 =w extsb %.4352 + %.4354 =w add %.4353, 1 + %.4355 =w copy %.4354 + storeb %.4355, $g_629 + jmp @for_cond.806 +@for_join.809 +@if_join.749 +@for_cont.726 + %.4356 =w loadsb $g_2 + %.4357 =w extsb %.4356 + %.4358 =w add %.4357, 1 + %.4359 =w copy %.4358 + storeb %.4359, $g_2 + jmp @for_cond.724 +@for_join.727 + %.4360 =w loaduw %.310 + %.4361 =w add %.4360, 1 + storew %.4361, %.310 + %.4362 =l loadl %.317 + %.4363 =l loadl %.4362 + %.4364 =l loadl $g_1590 + %.4365 =w loaduh %.4364 + %.4366 =l loadl $g_1589 + %.4367 =l loadl %.4366 + %.4368 =w loaduh %.4367 + %.4369 =w call $safe_mod_func_uint16_t_u_u(w %.4365, w %.4368) + %.4370 =l extuh %.4369 + %.4371 =l and %.4363, %.4370 + storel %.4371, %.4362 + %.4372 =l loadl %.323 + storel %.4371, %.4372 + %.4373 =l loadl $g_1038 + %.4374 =l loadl %.4373 + %.4375 =w loaduw %.4374 + %.4376 =w cnew %.4375, 0 + jnz %.4376, @logic_join.817, @logic_right.816 +@logic_right.816 + %.4377 =l loadl $g_422 + %.4378 =w loaduw %.4377 + %.4379 =l loadl $g_422 + storew %.4378, %.4379 + %.4380 =w cnew %.4378, 0 +@logic_join.817 + %.4381 =w phi @for_join.727 %.4376, @logic_right.816 %.4380 + %.4382 =w copy %.4381 + %.4383 =w call $safe_unary_minus_func_int8_t_s(w %.4382) + %.4384 =w extsb %.4383 + %.4385 =l loadl $g_173 + storew %.4384, %.4385 + %.4386 =w copy 0 + %.4387 =l copy $g_518 + %.4388 =l mul 36, 1 + %.4389 =l add %.4387, %.4388 + %.4390 =l copy %.4389 + storew %.4386, %.4390 +@for_cond.818 + %.4391 =l copy $g_518 + %.4392 =l mul 36, 1 + %.4393 =l add %.4391, %.4392 + %.4394 =l copy %.4393 + %.4395 =w loaduw %.4394 + %.4396 =w copy 1 + %.4397 =w culew %.4395, %.4396 + jnz %.4397, @for_body.819, @for_join.821 +@for_body.819 + %.4399 =l add %.4398, 0 + %.4400 =w copy 48818 + storeh %.4400, %.4399 + %.4402 =l add %.4401, 0 + %.4403 =w copy 2698380460 + storew %.4403, %.4402 + %.4404 =l add %.4401, 4 + %.4405 =w copy 18446744073709551609 + storew %.4405, %.4404 + %.4406 =l add %.4401, 8 + %.4407 =l extsw 0 + %.4408 =l sub %.4407, 1 + %.4409 =w copy %.4408 + storeh %.4409, %.4406 + %.4410 =l add %.4401, 10 + storeh 0, %.4410 + %.4411 =l add %.4401, 12 + %.4412 =w copy 2875702494 + storew %.4412, %.4411 + %.4413 =l add %.4401, 16 + %.4414 =w copy 0 + storew %.4414, %.4413 + %.4415 =l add %.4401, 20 + %.4416 =w copy 2698380460 + storew %.4416, %.4415 + %.4417 =l add %.4401, 24 + %.4418 =w copy 18446744073709551609 + storew %.4418, %.4417 + %.4419 =l add %.4401, 28 + %.4420 =l extsw 0 + %.4421 =l sub %.4420, 1 + %.4422 =w copy %.4421 + storeh %.4422, %.4419 + %.4423 =l add %.4401, 30 + storeh 0, %.4423 + %.4424 =l add %.4401, 32 + %.4425 =w copy 2875702494 + storew %.4425, %.4424 + %.4426 =l add %.4401, 36 + %.4427 =w copy 0 + storew %.4427, %.4426 + %.4428 =l add %.4401, 40 + %.4429 =w copy 2698380460 + storew %.4429, %.4428 + %.4430 =l add %.4401, 44 + %.4431 =w copy 18446744073709551609 + storew %.4431, %.4430 + %.4432 =l add %.4401, 48 + %.4433 =l extsw 0 + %.4434 =l sub %.4433, 1 + %.4435 =w copy %.4434 + storeh %.4435, %.4432 + %.4436 =l add %.4401, 50 + storeh 0, %.4436 + %.4437 =l add %.4401, 52 + %.4438 =w copy 2875702494 + storew %.4438, %.4437 + %.4439 =l add %.4401, 56 + %.4440 =w copy 0 + storew %.4440, %.4439 + %.4441 =l add %.4401, 60 + %.4442 =w copy 2698380460 + storew %.4442, %.4441 + %.4443 =l add %.4401, 64 + %.4444 =w copy 18446744073709551609 + storew %.4444, %.4443 + %.4445 =l add %.4401, 68 + %.4446 =l extsw 0 + %.4447 =l sub %.4446, 1 + %.4448 =w copy %.4447 + storeh %.4448, %.4445 + %.4449 =l add %.4401, 70 + storeh 0, %.4449 + %.4450 =l add %.4401, 72 + %.4451 =w copy 2875702494 + storew %.4451, %.4450 + %.4452 =l add %.4401, 76 + %.4453 =w copy 0 + storew %.4453, %.4452 + %.4454 =l add %.4401, 80 + %.4455 =w copy 2698380460 + storew %.4455, %.4454 + %.4456 =l add %.4401, 84 + %.4457 =w copy 18446744073709551609 + storew %.4457, %.4456 + %.4458 =l add %.4401, 88 + %.4459 =l extsw 0 + %.4460 =l sub %.4459, 1 + %.4461 =w copy %.4460 + storeh %.4461, %.4458 + %.4462 =l add %.4401, 90 + storeh 0, %.4462 + %.4463 =l add %.4401, 92 + %.4464 =w copy 2875702494 + storew %.4464, %.4463 + %.4465 =l add %.4401, 96 + %.4466 =w copy 0 + storew %.4466, %.4465 + %.4467 =l add %.4401, 100 + %.4468 =w copy 2698380460 + storew %.4468, %.4467 + %.4469 =l add %.4401, 104 + %.4470 =w copy 18446744073709551609 + storew %.4470, %.4469 + %.4471 =l add %.4401, 108 + %.4472 =l extsw 0 + %.4473 =l sub %.4472, 1 + %.4474 =w copy %.4473 + storeh %.4474, %.4471 + %.4475 =l add %.4401, 110 + storeh 0, %.4475 + %.4476 =l add %.4401, 112 + %.4477 =w copy 2875702494 + storew %.4477, %.4476 + %.4478 =l add %.4401, 116 + %.4479 =w copy 0 + storew %.4479, %.4478 + %.4481 =l add %.4480, 0 + %.4482 =l extsw 3 + %.4483 =l mul %.4482, 448 + %.4484 =l add %.325, %.4483 + %.4485 =l extsw 0 + %.4486 =l mul %.4485, 56 + %.4487 =l add %.4484, %.4486 + %.4488 =l copy %.4487 + %.4489 =l mul 44, 1 + %.4490 =l add %.4488, %.4489 + %.4491 =l copy %.4490 + storel %.4491, %.4481 + %.4493 =l add %.4492, 0 + %.4494 =w copy 6 + storew %.4494, %.4493 + %.4496 =l add %.4495, 0 + %.4497 =w copy 3016449401 + storew %.4497, %.4496 + %.4499 =w copy 0 + %.4500 =l copy $g_130 + %.4501 =l mul 16, 1 + %.4502 =l add %.4500, %.4501 + %.4503 =l copy %.4502 + storew %.4499, %.4503 +@for_cond.822 + %.4504 =l copy $g_130 + %.4505 =l mul 16, 1 + %.4506 =l add %.4504, %.4505 + %.4507 =l copy %.4506 + %.4508 =w loaduw %.4507 + %.4509 =w copy 1 + %.4510 =w culew %.4508, %.4509 + jnz %.4510, @for_body.823, @for_join.825 +@for_body.823 + %.4513 =l add %.4512, 0 + %.4514 =w copy 1 + storeb %.4514, %.4513 + %.4515 =l add %.4512, 1 + storeb 0, %.4515 + %.4516 =l add %.4512, 2 + storeh 0, %.4516 + %.4517 =l add %.4512, 4 + storew 0, %.4517 + %.4518 =l add %.4512, 8 + %.4519 =l extsw 0 + %.4520 =l sub %.4519, 6 + %.4521 =l copy %.4520 + storel %.4521, %.4518 + %.4522 =l add %.4512, 16 + %.4523 =w copy 7 + storew %.4523, %.4522 + %.4524 =l add %.4512, 20 + storew 0, %.4524 + %.4525 =l add %.4512, 24 + %.4526 =l copy 1 + storel %.4526, %.4525 + %.4527 =l add %.4512, 32 + %.4528 =w copy 4294967295 + storew %.4528, %.4527 + %.4529 =l add %.4512, 36 + %.4530 =w copy 1 + storew %.4530, %.4529 + %.4531 =l add %.4512, 40 + %.4532 =w copy 2429467455 + storew %.4532, %.4531 + %.4533 =l add %.4512, 44 + %.4534 =w copy 762222995 + storew %.4534, %.4533 + %.4535 =l add %.4512, 48 + %.4536 =l extsw 0 + %.4537 =l sub %.4536, 1 + %.4538 =w copy %.4537 + storew %.4538, %.4535 + %.4539 =l add %.4512, 52 + storew 0, %.4539 + %.4541 =l add %.4540, 0 + %.4542 =l extsw 0 + %.4543 =l copy %.4542 + storel %.4543, %.4541 + %.4545 =l add %.4544, 0 + %.4546 =w copy 1 + storew %.4546, %.4545 + %.4548 =l add %.4547, 0 + %.4549 =l copy $g_1183 + %.4550 =l mul 48, 1 + %.4551 =l add %.4549, %.4550 + %.4552 =l copy %.4551 + storel %.4552, %.4548 + %.4554 =l add %.4553, 0 + %.4555 =w copy 9 + storew %.4555, %.4554 + %.4557 =l add %.4556, 0 + storel $g_662, %.4557 + %.4559 =l add %.4558, 0 + %.4560 =w copy 921221594 + storew %.4560, %.4559 + storew 0, %.4561 +@for_cond.826 + %.4562 =w loadsw %.4561 + %.4563 =w csltw %.4562, 1 + jnz %.4563, @for_body.827, @for_join.829 +@for_body.827 + %.4564 =l copy 7934066739426349945 + %.4565 =w loadsw %.4561 + %.4566 =l extsw %.4565 + %.4567 =l mul %.4566, 8 + %.4568 =l add %.4511, %.4567 + storel %.4564, %.4568 +@for_cont.828 + %.4569 =w loadsw %.4561 + %.4570 =w add %.4569, 1 + storew %.4570, %.4561 + jmp @for_cond.826 +@for_join.829 +@for_cont.824 + %.4571 =l copy $g_130 + %.4572 =l mul 16, 1 + %.4573 =l add %.4571, %.4572 + %.4574 =l copy %.4573 + %.4575 =w loaduw %.4574 + %.4576 =w copy 1 + %.4577 =w add %.4575, %.4576 + storew %.4577, %.4574 + jmp @for_cond.822 +@for_join.825 + %.4578 =l loadl %.4480 + %.4579 =w loadsw %.4578 + %.4580 =w cnew %.4579, 0 + jnz %.4580, @if_true.830, @if_false.831 +@if_true.830 + jmp @for_cont.820 +@if_false.831 + %.4581 =l extsw 1 + storel %.4581, $g_80 +@for_cond.832 + %.4582 =l loadl $g_80 + %.4583 =l extsw 0 + %.4584 =w csgel %.4582, %.4583 + jnz %.4584, @for_body.833, @for_join.835 +@for_body.833 + %.4586 =l add %.4585, 0 + %.4587 =w copy 255 + storeb %.4587, %.4586 + %.4589 =l add %.4588, 0 + %.4590 =w copy 1 + storew %.4590, %.4589 + %.4592 =l add %.4591, 0 + %.4593 =l extsw 4 + %.4594 =l mul %.4593, 1 + %.4595 =l add $g_132, %.4594 + storel %.4595, %.4592 + %.4597 =l add %.4596, 0 + storel %.4591, %.4597 + %.4598 =w loaduw %.4492 + %.4599 =w sub %.4598, 1 + storew %.4599, %.4492 + %.4600 =l copy $g_1183 + %.4601 =l mul 48, 1 + %.4602 =l add %.4600, %.4601 + %.4603 =l copy %.4602 + storew 0, %.4603 +@for_cond.836 + %.4604 =l copy $g_1183 + %.4605 =l mul 48, 1 + %.4606 =l add %.4604, %.4605 + %.4607 =l copy %.4606 + %.4608 =w loadsw %.4607 + %.4609 =w cslew %.4608, 1 + jnz %.4609, @for_body.837, @for_join.839 +@for_body.837 + %.4611 =l add %.4610, 0 + %.4612 =l extsw 0 + %.4613 =l copy %.4612 + storel %.4613, %.4611 + %.4615 =l add %.4614, 0 + %.4616 =w copy 2834361667 + storew %.4616, %.4615 + %.4618 =l add %.4617, 0 + %.4619 =w copy 1313316793 + storew %.4619, %.4618 + %.4620 =l add %.4617, 4 + %.4621 =w copy 3377634704 + storew %.4621, %.4620 + %.4622 =l add %.4617, 8 + %.4623 =w copy 37131 + storeh %.4623, %.4622 + %.4624 =l add %.4617, 10 + storeh 0, %.4624 + %.4625 =l add %.4617, 12 + %.4626 =w copy 3716013692 + storew %.4626, %.4625 + %.4627 =l add %.4617, 16 + %.4628 =w copy 170244838 + storew %.4628, %.4627 + %.4630 =l add %.4629, 0 + %.4631 =w copy 0 + storeb %.4631, %.4630 + %.4632 =l extsw 0 + %.4633 =l copy $g_518 + %.4634 =l mul 24, 1 + %.4635 =l add %.4633, %.4634 + %.4636 =l copy %.4635 + storel %.4632, %.4636 +@for_cond.840 + %.4637 =l copy $g_518 + %.4638 =l mul 24, 1 + %.4639 =l add %.4637, %.4638 + %.4640 =l copy %.4639 + %.4641 =l loadl %.4640 + %.4642 =l extsw 9 + %.4643 =w cultl %.4641, %.4642 + jnz %.4643, @for_body.841, @for_join.843 +@for_body.841 + %.4644 =w copy 0 + %.4645 =l copy $g_794 + %.4646 =l mul 8, 1 + %.4647 =l add %.4645, %.4646 + %.4648 =l copy %.4647 + storeh %.4644, %.4648 +@for_cond.844 + %.4649 =l copy $g_794 + %.4650 =l mul 8, 1 + %.4651 =l add %.4649, %.4650 + %.4652 =l copy %.4651 + %.4653 =w loadsh %.4652 + %.4654 =w extsh %.4653 + %.4655 =w csltw %.4654, 3 + jnz %.4655, @for_body.845, @for_join.847 +@for_body.845 + %.4656 =l copy $g_265 + %.4657 =l mul 48, 1 + %.4658 =l add %.4656, %.4657 + %.4659 =l copy %.4658 + storew 0, %.4659 +@for_cond.848 + %.4660 =l copy $g_265 + %.4661 =l mul 48, 1 + %.4662 =l add %.4660, %.4661 + %.4663 =l copy %.4662 + %.4664 =w loadsw %.4663 + %.4665 =w csltw %.4664, 1 + jnz %.4665, @for_body.849, @for_join.851 +@for_body.849 + %.4666 =l extsw 0 + %.4667 =l sub %.4666, 4 + %.4668 =w copy %.4667 + %.4669 =l copy $g_518 + %.4670 =l mul 24, 1 + %.4671 =l add %.4669, %.4670 + %.4672 =l copy %.4671 + %.4673 =l loadl %.4672 + %.4674 =l copy %.4673 + %.4675 =l mul %.4674, 12 + %.4676 =l add $g_13, %.4675 + %.4677 =l copy $g_794 + %.4678 =l mul 8, 1 + %.4679 =l add %.4677, %.4678 + %.4680 =l copy %.4679 + %.4681 =w loadsh %.4680 + %.4682 =l extsh %.4681 + %.4683 =l mul %.4682, 4 + %.4684 =l add %.4676, %.4683 + %.4685 =l copy $g_265 + %.4686 =l mul 48, 1 + %.4687 =l add %.4685, %.4686 + %.4688 =l copy %.4687 + %.4689 =w loadsw %.4688 + %.4690 =l extsw %.4689 + %.4691 =l mul %.4690, 4 + %.4692 =l add %.4684, %.4691 + storew %.4668, %.4692 +@for_cont.850 + %.4693 =l copy $g_265 + %.4694 =l mul 48, 1 + %.4695 =l add %.4693, %.4694 + %.4696 =l copy %.4695 + %.4697 =w loadsw %.4696 + %.4698 =w add %.4697, 1 + storew %.4698, %.4696 + jmp @for_cond.848 +@for_join.851 +@for_cont.846 + %.4699 =l copy $g_794 + %.4700 =l mul 8, 1 + %.4701 =l add %.4699, %.4700 + %.4702 =l copy %.4701 + %.4703 =w loadsh %.4702 + %.4704 =w extsh %.4703 + %.4705 =w add %.4704, 1 + %.4706 =w copy %.4705 + storeh %.4706, %.4702 + jmp @for_cond.844 +@for_join.847 +@for_cont.842 + %.4707 =l copy $g_518 + %.4708 =l mul 24, 1 + %.4709 =l add %.4707, %.4708 + %.4710 =l copy %.4709 + %.4711 =l loadl %.4710 + %.4712 =l extsw 1 + %.4713 =l add %.4711, %.4712 + storel %.4713, %.4710 + jmp @for_cond.840 +@for_join.843 + %.4714 =l loadl %.1 + %.4715 =w loadsw %.4714 + %.4716 =w cnew %.4715, 0 + jnz %.4716, @logic_join.853, @logic_right.852 +@logic_right.852 + %.4717 =w copy 59312 + %.4718 =w call $safe_unary_minus_func_int16_t_s(w %.4717) + %.4719 =w extsh %.4718 + storew %.4719, %.4614 + %.4720 =w copy %.4719 + %.4721 =l loadl %.4480 + %.4722 =w loadsw %.4721 + %.4723 =w copy %.4722 + %.4724 =w call $safe_mul_func_int8_t_s_s(w %.4720, w %.4723) + %.4725 =w extsb %.4724 + %.4726 =l copy $g_1183 + %.4727 =l mul 8, 1 + %.4728 =l add %.4726, %.4727 + %.4729 =l copy %.4728 + %.4730 =l loadl %.4729 + %.4731 =l or 3025800570176797084, %.4730 + %.4732 =w copy %.4731 + %.4733 =w call $safe_lshift_func_uint16_t_u_s(w %.4732, w 8) + %.4734 =w extuh %.4733 + %.4735 =w cnew %.4725, %.4734 + %.4736 =w cnew %.4735, 0 +@logic_join.853 + %.4737 =w phi @for_join.843 %.4716, @logic_right.852 %.4736 + %.4738 =l loadl %.266 + %.4739 =w loadsw %.4738 + %.4740 =w loadsw %.4614 + %.4741 =w copy %.4740 + %.4742 =l loadl %.278 + %.4743 =w loadsw %.4742 + %.4744 =w copy %.4743 + %.4745 =w call $safe_unary_minus_func_int16_t_s(w %.4744) + %.4746 =w copy %.4745 + %.4747 =w call $safe_add_func_int8_t_s_s(w %.4741, w %.4746) + %.4748 =l extsb %.4747 + %.4749 =l loadl $g_1589 + %.4750 =l loadl %.4749 + %.4751 =w loaduh %.4750 + %.4752 =l extuh %.4751 + %.4753 =w csgtl %.4752, 35293 + %.4754 =l loadl %.4480 + storew %.4753, %.4754 + %.4755 =l extsw %.4753 + %.4756 =l call $safe_add_func_int64_t_s_s(l %.4748, l %.4755) + %.4757 =w copy %.4756 + %.4758 =w loadsw %.4614 + %.4759 =w copy %.4758 + %.4760 =w call $safe_rshift_func_int8_t_s_u(w %.4757, w %.4759) + %.4761 =w extsb %.4760 + %.4762 =w csgtw %.4739, %.4761 + %.4763 =w loadsh %.1645 + %.4764 =w extsh %.4763 + %.4765 =w call $safe_div_func_int32_t_s_s(w %.4762, w %.4764) + %.4766 =w loadub %.4585 + %.4767 =w extub %.4766 + %.4768 =w cnew %.4767, 0 + jnz %.4768, @if_true.854, @if_false.855 +@if_true.854 + %.4770 =l add %.4769, 0 + %.4771 =w copy 13655 + storeh %.4771, %.4770 + %.4774 =l add %.4773, 0 + %.4775 =l extsw 4 + %.4776 =l mul %.4775, 1 + %.4777 =l add $g_132, %.4776 + storel %.4777, %.4774 + %.4779 =l add %.4778, 0 + %.4780 =l extsw 0 + %.4781 =l copy %.4780 + storel %.4781, %.4779 + %.4783 =l add %.4782, 0 + storel $g_81, %.4783 + %.4785 =l add %.4784, 0 + %.4786 =l extsw 0 + %.4787 =l mul %.4786, 4 + %.4788 =l add %.184, %.4787 + storel %.4788, %.4785 + storew 0, %.4789 +@for_cond.856 + %.4790 =w loadsw %.4789 + %.4791 =w csltw %.4790, 3 + jnz %.4791, @for_body.857, @for_join.859 +@for_body.857 + %.4792 =l extsw 0 + %.4793 =l copy %.4792 + %.4794 =w loadsw %.4789 + %.4795 =l extsw %.4794 + %.4796 =l mul %.4795, 8 + %.4797 =l add %.4772, %.4796 + storel %.4793, %.4797 +@for_cont.858 + %.4798 =w loadsw %.4789 + %.4799 =w add %.4798, 1 + storew %.4799, %.4789 + jmp @for_cond.856 +@for_join.859 + %.4800 =l loadl %.167 + %.4801 =w loadsw %.4800 + %.4802 =l extsw 0 + %.4803 =l sub %.4802, 1 + %.4804 =w cnel %.4803, 0 + jnz %.4804, @logic_right.860, @logic_join.861 +@logic_right.860 + %.4805 =w loaduh %.4769 + %.4806 =w extuh %.4805 + %.4807 =w cnew %.4806, 0 +@logic_join.861 + %.4808 =w phi @for_join.859 %.4804, @logic_right.860 %.4807 + %.4809 =l extsw %.4808 + %.4810 =l loadl %.306 + %.4811 =w loadsw %.4810 + %.4812 =l loadl $g_296 + %.4813 =l loadl %.4812 + %.4814 =l loadl %.4773 + %.4815 =w loadsb %.4814 + %.4816 =w extsb %.4815 + %.4817 =w loaduh %.4769 + %.4818 =w extuh %.4817 + %.4819 =l loadl %.4480 + %.4820 =w loadsw %.4819 + %.4821 =w or %.4818, %.4820 + %.4822 =l extsw 3 + %.4823 =l mul %.4822, 400 + %.4824 =l add %.1648, %.4823 + %.4825 =l extsw 7 + %.4826 =l mul %.4825, 40 + %.4827 =l add %.4824, %.4826 + %.4828 =l extsw 1 + %.4829 =l mul %.4828, 8 + %.4830 =l add %.4827, %.4829 + %.4831 =l loadl %.4830 + %.4832 =w loadsh $g_1922 + %.4833 =l extsh %.4832 + %.4834 =w cugel %.4831, %.4833 + %.4835 =l extsw 0 + %.4836 =l sub %.4835, 9 + %.4837 =l extsw 0 + %.4838 =l mul %.4837, 8 + %.4839 =l add %.4772, %.4838 + %.4840 =l loadl %.4839 + %.4841 =l loadl %.83 + %.4842 =w ceql %.4840, %.4841 + %.4843 =l extsw %.4842 + %.4844 =w cugel 255, %.4843 + %.4845 =w cslew %.4821, %.4844 + %.4846 =w copy %.4845 + %.4847 =l copy %.4617 + %.4848 =l mul 4, 1 + %.4849 =l add %.4847, %.4848 + %.4850 =l copy %.4849 + %.4851 =w loaduw %.4850 + %.4852 =w cugew %.4846, %.4851 + %.4853 =w copy %.4852 + %.4854 =l loadl $g_1590 + %.4855 =w loaduh %.4854 + %.4856 =w extuh %.4855 + %.4857 =w call $safe_rshift_func_uint16_t_u_u(w %.4853, w %.4856) + %.4858 =w extuh %.4857 + %.4859 =w loadub %.4585 + %.4860 =w extub %.4859 + %.4861 =w or %.4858, %.4860 + %.4862 =l loadl $g_1589 + %.4863 =l loadl %.4862 + %.4864 =w loaduh %.4863 + %.4865 =w extuh %.4864 + %.4866 =w csgew %.4861, %.4865 + %.4867 =w xor %.4816, %.4866 + %.4868 =w copy %.4867 + storeb %.4868, %.4814 + %.4869 =w extsb %.4868 + %.4870 =l loadl %.289 + %.4871 =w loadsw %.4870 + %.4872 =w cnew %.4869, %.4871 + %.4873 =w copy %.4872 + %.4874 =l loadl %.4782 + storeh %.4873, %.4874 + %.4875 =w extsh %.4873 + %.4876 =w cnew %.4875, 0 + jnz %.4876, @logic_right.864, @logic_join.865 +@logic_right.864 + %.4877 =l loadl %.4480 + %.4878 =w loadsw %.4877 + %.4879 =w cnew %.4878, 0 +@logic_join.865 + %.4880 =w phi @logic_join.861 %.4876, @logic_right.864 %.4879 + %.4881 =w copy %.4880 + %.4882 =w copy 39728 + %.4883 =w call $safe_add_func_uint16_t_u_u(w %.4881, w %.4882) + %.4884 =w extuh %.4883 + %.4885 =l extsw %.4884 + %.4886 =w cugtl %.4885, 248 + %.4887 =w copy %.4886 + %.4888 =l loadl $g_1038 + %.4889 =l loadl %.4888 + %.4890 =w loaduw %.4889 + %.4891 =w call $safe_add_func_uint32_t_u_u(w %.4887, w %.4890) + %.4892 =w copy %.4891 + storeb %.4892, %.4629 + %.4893 =l extsb %.4892 + %.4894 =l call $safe_div_func_int64_t_s_s(l %.4893, l 7921571751143292974) + %.4895 =l loadl %.4480 + %.4896 =w loadsw %.4895 + %.4897 =l extsw %.4896 + %.4898 =w csgel %.4894, %.4897 + %.4899 =l loadl %.264 + %.4900 =w loadsw %.4899 + %.4901 =w copy %.4900 + %.4902 =w loadub %.4585 + %.4903 =w extub %.4902 + %.4904 =w call $safe_mod_func_int16_t_s_s(w %.4901, w %.4903) + %.4905 =l extsh %.4904 + %.4906 =l loadl %.4480 + %.4907 =w loadsw %.4906 + %.4908 =l extsw %.4907 + %.4909 =l call $safe_mod_func_int64_t_s_s(l %.4905, l %.4908) + %.4910 =l copy 0 + %.4911 =l or %.4909, %.4910 + %.4912 =w copy %.4911 + %.4913 =w call $safe_lshift_func_uint16_t_u_s(w %.4912, w 6) + %.4914 =w extuh %.4913 + %.4915 =l loadl %.266 + storew %.4914, %.4915 + %.4916 =w ceqw %.4811, %.4914 + %.4917 =w copy %.4916 + %.4918 =w copy 91 + %.4919 =w call $safe_div_func_int8_t_s_s(w %.4917, w %.4918) + %.4920 =w extsb %.4919 + %.4921 =w cnew %.4920, 0 + jnz %.4921, @logic_right.862, @logic_join.863 +@logic_right.862 + %.4922 =w cnel 1635734213, 0 +@logic_join.863 + %.4923 =w phi @logic_join.865 %.4921, @logic_right.862 %.4922 + %.4924 =w copy %.4923 + %.4925 =l loadl %.278 + %.4926 =w loadsw %.4925 + %.4927 =w call $safe_rshift_func_uint16_t_u_s(w %.4924, w %.4926) + %.4928 =w loaduh %.4769 + %.4929 =w extuh %.4928 + %.4930 =w loadsw %.4614 + %.4931 =w cslew %.4929, %.4930 + %.4932 =w loadub %.4585 + %.4933 =w extub %.4932 + %.4934 =w or %.4931, %.4933 + %.4935 =w loaduh %.4769 + %.4936 =w extuh %.4935 + %.4937 =w cslew %.4934, %.4936 + %.4938 =w cnel %.4809, 6213 + %.4939 =w and %.4801, %.4938 + storew %.4939, %.4800 + %.4940 =l loadl %.4784 + %.4941 =l loadl %.4480 + %.4942 =w ceql %.4940, %.4941 + %.4943 =l loadl %.264 + storew %.4942, %.4943 + %.4944 =l loadl $g_1123 + %.4945 =l extsw 4 + %.4946 =l mul %.4945, 20 + %.4947 =l add %.4401, %.4946 + %.4948 =l loaduw %.4944 + storew %.4948, %.4947 + %.4949 =l add %.4944, 4 + %.4950 =l add %.4947, 4 + %.4951 =l loaduw %.4949 + storew %.4951, %.4950 + %.4952 =l add %.4949, 4 + %.4953 =l add %.4950, 4 + %.4954 =l loaduw %.4952 + storew %.4954, %.4953 + %.4955 =l add %.4952, 4 + %.4956 =l add %.4953, 4 + %.4957 =l loaduw %.4955 + storew %.4957, %.4956 + %.4958 =l add %.4955, 4 + %.4959 =l add %.4956, 4 + %.4960 =l loaduw %.4958 + storew %.4960, %.4959 + %.4961 =l add %.4958, 4 + %.4962 =l add %.4959, 4 + %.4963 =w loaduw %.4495 + %.4964 =w cnew %.4963, 0 + jnz %.4964, @if_true.866, @if_false.867 +@if_true.866 + jmp @for_join.839 +@if_false.867 + jmp @if_join.868 +@if_false.855 + %.4966 =l add %.4965, 0 + storel 7722482555776156576, %.4966 + %.4968 =l add %.4967, 0 + storel $g_1604, %.4968 + %.4970 =l add %.4969, 0 + storel %.4596, %.4970 + %.4971 =l loadl %.4480 + %.4972 =w loadsw %.4971 + %.4973 =l copy %.4617 + %.4974 =l mul 16, 1 + %.4975 =l add %.4973, %.4974 + %.4976 =l copy %.4975 + %.4977 =w loaduw %.4976 + %.4978 =w copy %.4977 + %.4979 =w call $safe_rshift_func_int16_t_s_s(w %.4978, w 15) + %.4980 =w extsh %.4979 + %.4981 =l loadl %.4965 + %.4982 =l loadl $g_1590 + %.4983 =w loaduh %.4982 + %.4984 =l extuh %.4983 + %.4985 =l xor %.4984, 5122 + %.4986 =w copy %.4985 + storeh %.4986, %.4982 + %.4987 =w extuh %.4986 + %.4988 =w xor %.4987, 18446744073709551615 + %.4989 =w loadsw %.4614 + %.4990 =l copy $g_185 + %.4991 =l mul 24, 1 + %.4992 =l add %.4990, %.4991 + %.4993 =l copy %.4992 + %.4994 =l loadl %.4993 + %.4995 =l copy 0 + %.4996 =l loadl %.4967 + storel %.4995, %.4996 + %.4997 =l loadl %.295 + %.4998 =w loadsw %.4997 + %.4999 =w copy %.4998 + %.5000 =w copy 65533 + %.5001 =l copy %.4617 + %.5002 =l mul 8, 1 + %.5003 =l add %.5001, %.5002 + %.5004 =l copy %.5003 + %.5005 =w loadsh %.5004 + %.5006 =w copy %.5005 + %.5007 =w call $safe_add_func_uint16_t_u_u(w %.5000, w %.5006) + %.5008 =w extuh %.5007 + %.5009 =w call $safe_rshift_func_uint8_t_u_u(w %.4999, w %.5008) + %.5010 =w extub %.5009 + %.5011 =w cnew %.5010, 0 + jnz %.5011, @logic_right.871, @logic_join.872 +@logic_right.871 + %.5012 =l extsw 0 + %.5013 =l sub %.5012, 9 + %.5014 =l copy %.5013 + %.5015 =l copy $g_1183 + %.5016 =l mul 24, 1 + %.5017 =l add %.5015, %.5016 + %.5018 =l copy %.5017 + %.5019 =l loadl %.5018 + %.5020 =w cugtl %.5014, %.5019 + %.5021 =w cnew %.5020, 0 +@logic_join.872 + %.5022 =w phi @if_false.855 %.5011, @logic_right.871 %.5021 + %.5023 =w copy %.5022 + %.5024 =l loadl $g_1038 + %.5025 =l loadl %.5024 + %.5026 =w loaduw %.5025 + %.5027 =w xor %.5023, %.5026 + %.5028 =l extuw %.5027 + %.5029 =l call $safe_sub_func_uint64_t_u_u(l %.4995, l %.5028) + %.5030 =l extsw 0 + %.5031 =l extsw 0 + %.5032 =w cnel %.5030, %.5031 + %.5033 =l extsw %.5032 + %.5034 =l or %.4994, %.5033 + storel %.5034, %.4993 + %.5035 =l copy $g_1183 + %.5036 =l mul 36, 1 + %.5037 =l add %.5035, %.5036 + %.5038 =l copy %.5037 + %.5039 =w loaduw %.5038 + %.5040 =l extuw %.5039 + %.5041 =l xor %.5034, %.5040 + %.5042 =w cnel %.5041, 0 + jnz %.5042, @logic_right.869, @logic_join.870 +@logic_right.869 + %.5043 =l copy %.4617 + %.5044 =l mul 0, 1 + %.5045 =l add %.5043, %.5044 + %.5046 =l copy %.5045 + %.5047 =w loadsw %.5046 + %.5048 =w cnew %.5047, 0 +@logic_join.870 + %.5049 =w phi @logic_join.872 %.5042, @logic_right.869 %.5048 + %.5050 =w call $safe_mod_func_int32_t_s_s(w %.4980, w %.5049) + %.5051 =w or %.4972, %.5050 + storew %.5051, %.4971 + %.5052 =w loaduw %.2010 + %.5053 =w copy %.5052 + %.5054 =l loadl %.4480 + storew %.5053, %.5054 + %.5055 =w loadsw %.4588 + %.5056 =l loadl $g_1269 + %.5057 =l loadl %.5056 + %.5058 =l loadl %.5057 + %.5059 =l loadl %.4480 + %.5060 =l copy $g_1183 + %.5061 =l mul 48, 1 + %.5062 =l add %.5060, %.5061 + %.5063 =l copy %.5062 + %.5064 =w loadsw %.5063 + %.5065 =w loadsw %.4614 + %.5066 =l loadl %.1 + %.5067 =w loadsw %.5066 + %.5068 =w xor %.5065, %.5067 + storew %.5068, %.4614 + %.5069 =w copy 5802 + %.5070 =l loadl $g_1590 + storeh %.5069, %.5070 + %.5071 =w extuh %.5069 + %.5072 =w cnew %.5071, 0 + jnz %.5072, @logic_join.874, @logic_right.873 +@logic_right.873 + %.5073 =l loadl $g_1038 + %.5074 =l loadl %.5073 + %.5075 =w loaduw %.5074 + %.5076 =w copy 3856688714 + %.5077 =w call $safe_div_func_uint32_t_u_u(w %.5075, w %.5076) + %.5078 =l extuw %.5077 + %.5079 =l loadl %.317 + %.5080 =l loadl %.5079 + %.5081 =l extsw 4 + %.5082 =l mul %.5081, 20 + %.5083 =l add %.4401, %.5082 + %.5084 =l extsw 1 + %.5085 =l mul %.5084, 448 + %.5086 =l add %.325, %.5085 + %.5087 =l extsw 3 + %.5088 =l mul %.5087, 56 + %.5089 =l add %.5086, %.5088 + %.5090 =l loadl $g_422 + %.5091 =w loaduw %.5090 + %.5092 =l extuw %.5091 + %.5093 =l or %.5092, 2844124571 + %.5094 =l loadl %.4965 + %.5095 =l loadl $g_1589 + %.5096 =l loadl %.5095 + %.5097 =w loaduh %.5096 + %.5098 =l extuh %.5097 + %.5099 =w csltl %.5094, %.5098 + %.5100 =l extsw %.5099 + %.5101 =l or %.5080, %.5100 + storel %.5101, %.5079 + %.5102 =w csgtl %.5078, %.5101 + %.5103 =l loadl %.4480 + %.5104 =w loadsw %.5103 + %.5105 =w cnew %.5104, 0 +@logic_join.874 + %.5106 =w phi @logic_join.870 %.5072, @logic_right.873 %.5105 + %.5107 =l extsw %.5106 + %.5108 =l loadl %.4965 + %.5109 =l copy %.5108 + %.5110 =l call $safe_mod_func_uint64_t_u_u(l %.5107, l %.5109) + %.5111 =l loadl %.4965 + %.5112 =l copy %.5111 + %.5113 =l or %.5110, %.5112 + %.5114 =l copy 3166269750 + %.5115 =l or %.5113, %.5114 + %.5116 =l loadl $g_23 + %.5117 =w loadsw %.5116 + %.5118 =l extsw %.5117 + %.5119 =w ceql %.5115, %.5118 + %.5120 =w cnew %.5064, %.5119 + %.5121 =l extsw 0 + %.5122 =w ceql %.5059, %.5121 + %.5123 =w xor %.5055, %.5122 + storew %.5123, %.4588 + %.5124 =l loadl %.4596 + %.5125 =l loadl %.4969 + storel %.5124, %.5125 +@if_join.868 + %.5126 =l copy $g_185 + %.5127 =l mul 40, 1 + %.5128 =l add %.5126, %.5127 + %.5129 =l copy %.5128 + storew 1, %.5129 +@for_cond.875 + %.5130 =l copy $g_185 + %.5131 =l mul 40, 1 + %.5132 =l add %.5130, %.5131 + %.5133 =l copy %.5132 + %.5134 =w loadsw %.5133 + %.5135 =w csgew %.5134, 0 + jnz %.5135, @for_body.876, @for_join.878 +@for_body.876 + %.5137 =l add %.5136, 0 + %.5138 =w copy 0 + storeb %.5138, %.5137 + %.5139 =l copy %.4617 + %.5140 =l mul 8, 1 + %.5141 =l add %.5139, %.5140 + %.5142 =l copy %.5141 + %.5143 =w loadsh %.5142 + %.5144 =w extsh %.5143 + %.5145 =l loadl $g_23 + storew %.5144, %.5145 + %.5146 =w loadub %.5136 + %.5147 =w sub %.5146, 1 + storeb %.5147, %.5136 +@for_cont.877 + %.5148 =l copy $g_185 + %.5149 =l mul 40, 1 + %.5150 =l add %.5148, %.5149 + %.5151 =l copy %.5150 + %.5152 =w loadsw %.5151 + %.5153 =w sub %.5152, 1 + storew %.5153, %.5151 + jmp @for_cond.875 +@for_join.878 + %.5154 =l copy %.4617 + %.5155 =l mul 12, 1 + %.5156 =l add %.5154, %.5155 + %.5157 =l copy %.5156 + %.5158 =w loadsw %.5157 + %.5159 =w cnew %.5158, 0 + jnz %.5159, @if_true.879, @if_false.880 +@if_true.879 + jmp @for_cont.838 +@if_false.880 +@for_cont.838 + %.5160 =l copy $g_1183 + %.5161 =l mul 48, 1 + %.5162 =l add %.5160, %.5161 + %.5163 =l copy %.5162 + %.5164 =w loadsw %.5163 + %.5165 =w add %.5164, 1 + storew %.5165, %.5163 + jmp @for_cond.836 +@for_join.839 +@for_cont.834 + %.5166 =l loadl $g_80 + %.5167 =l extsw 1 + %.5168 =l sub %.5166, %.5167 + storel %.5168, $g_80 + jmp @for_cond.832 +@for_join.835 +@for_cont.820 + %.5169 =l copy $g_518 + %.5170 =l mul 36, 1 + %.5171 =l add %.5169, %.5170 + %.5172 =l copy %.5171 + %.5173 =w loaduw %.5172 + %.5174 =w copy 1 + %.5175 =w add %.5173, %.5174 + storew %.5175, %.5172 + jmp @for_cond.818 +@for_join.821 + jmp @if_join.881 +@if_false.711 + %.5177 =l add %.5176, 0 + %.5178 =w copy 2069187283 + storew %.5178, %.5177 + %.5180 =l add %.5179, 0 + %.5181 =w copy 1 + storew %.5181, %.5180 + %.5183 =l add %.5182, 0 + %.5184 =l extsw 0 + %.5185 =l sub %.5184, 5 + %.5186 =w copy %.5185 + storew %.5186, %.5183 + %.5188 =l add %.5187, 0 + %.5189 =w copy 255 + storeb %.5189, %.5188 + %.5191 =l add %.5190, 0 + storel $g_518, %.5191 + %.5194 =l add %.5193, 0 + %.5195 =l copy 3 + storel %.5195, %.5194 + %.5197 =l add %.5196, 0 + %.5198 =w copy 23235 + storeh %.5198, %.5197 + %.5200 =l add %.5199, 0 + %.5201 =l copy 18446744073709551611 + storel %.5201, %.5200 + storew 0, %.5203 +@for_cond.882 + %.5204 =w loadsw %.5203 + %.5205 =w csltw %.5204, 2 + jnz %.5205, @for_body.883, @for_join.885 +@for_body.883 + %.5206 =w copy 4192325373 + %.5207 =w loadsw %.5203 + %.5208 =l extsw %.5207 + %.5209 =l mul %.5208, 4 + %.5210 =l add %.5192, %.5209 + storew %.5206, %.5210 +@for_cont.884 + %.5211 =w loadsw %.5203 + %.5212 =w add %.5211, 1 + storew %.5212, %.5203 + jmp @for_cond.882 +@for_join.885 + storew 0, %.5203 +@for_cond.886 + %.5213 =w loadsw %.5203 + %.5214 =w csltw %.5213, 5 + jnz %.5214, @for_body.887, @for_join.889 +@for_body.887 + %.5215 =w copy 1346007472 + %.5216 =w loadsw %.5203 + %.5217 =l extsw %.5216 + %.5218 =l mul %.5217, 4 + %.5219 =l add %.5202, %.5218 + storew %.5215, %.5219 +@for_cont.888 + %.5220 =w loadsw %.5203 + %.5221 =w add %.5220, 1 + storew %.5221, %.5203 + jmp @for_cond.886 +@for_join.889 + %.5222 =l extsw 0 + storel %.5222, $g_82 +@for_cond.890 + %.5223 =l loadl $g_82 + %.5224 =l extsw 0 + %.5225 =w csgel %.5223, %.5224 + jnz %.5225, @for_body.891, @for_join.893 +@for_body.891 + %.5227 =l add %.5226, 0 + %.5228 =l copy $g_265 + %.5229 =l mul 0, 1 + %.5230 =l add %.5228, %.5229 + %.5231 =l copy %.5230 + storel %.5231, %.5227 + %.5233 =l add %.5232, 0 + %.5234 =l extsw 0 + %.5235 =l mul %.5234, 1 + %.5236 =l add $g_132, %.5235 + storel %.5236, %.5233 + %.5237 =l add %.5232, 8 + %.5238 =l extsw 0 + %.5239 =l mul %.5238, 1 + %.5240 =l add $g_132, %.5239 + storel %.5240, %.5237 + %.5241 =l add %.5232, 16 + %.5242 =l extsw 0 + %.5243 =l mul %.5242, 1 + %.5244 =l add $g_132, %.5243 + storel %.5244, %.5241 + %.5245 =l add %.5232, 24 + %.5246 =l extsw 0 + %.5247 =l mul %.5246, 1 + %.5248 =l add $g_132, %.5247 + storel %.5248, %.5245 + %.5249 =l add %.5232, 32 + %.5250 =l extsw 0 + %.5251 =l mul %.5250, 1 + %.5252 =l add $g_132, %.5251 + storel %.5252, %.5249 + %.5253 =l add %.5232, 40 + %.5254 =l extsw 0 + %.5255 =l mul %.5254, 1 + %.5256 =l add $g_132, %.5255 + storel %.5256, %.5253 + %.5257 =l add %.5232, 48 + %.5258 =l extsw 0 + %.5259 =l mul %.5258, 1 + %.5260 =l add $g_132, %.5259 + storel %.5260, %.5257 + %.5261 =l add %.5232, 56 + %.5262 =l extsw 0 + %.5263 =l mul %.5262, 1 + %.5264 =l add $g_132, %.5263 + storel %.5264, %.5261 + %.5266 =l add %.5265, 0 + %.5267 =w copy 255 + storeb %.5267, %.5266 + %.5268 =l add %.5265, 1 + storeb 0, %.5268 + %.5269 =l add %.5265, 2 + storeh 0, %.5269 + %.5270 =l add %.5265, 4 + storew 0, %.5270 + %.5271 =l add %.5265, 8 + %.5272 =l copy 3 + storel %.5272, %.5271 + %.5273 =l add %.5265, 16 + %.5274 =l extsw 0 + %.5275 =l sub %.5274, 3 + %.5276 =w copy %.5275 + storew %.5276, %.5273 + %.5277 =l add %.5265, 20 + storew 0, %.5277 + %.5278 =l add %.5265, 24 + %.5279 =l copy 18446744073709551615 + storel %.5279, %.5278 + %.5280 =l add %.5265, 32 + %.5281 =w copy 4294967286 + storew %.5281, %.5280 + %.5282 =l add %.5265, 36 + %.5283 =w copy 0 + storew %.5283, %.5282 + %.5284 =l add %.5265, 40 + %.5285 =l extsw 0 + %.5286 =l sub %.5285, 1 + %.5287 =w copy %.5286 + storew %.5287, %.5284 + %.5288 =l add %.5265, 44 + %.5289 =l extsw 0 + %.5290 =l sub %.5289, 2 + %.5291 =w copy %.5290 + storew %.5291, %.5288 + %.5292 =l add %.5265, 48 + %.5293 =w copy 0 + storew %.5293, %.5292 + %.5294 =l add %.5265, 52 + storew 0, %.5294 + %.5296 =l add %.5295, 0 + storel $g_425, %.5296 + %.5298 =l add %.5297, 0 + %.5299 =l extsw 0 + %.5300 =l copy %.5299 + storel %.5300, %.5298 + %.5302 =l add %.5301, 0 + %.5303 =l copy $g_185 + %.5304 =l mul 32, 1 + %.5305 =l add %.5303, %.5304 + %.5306 =l copy %.5305 + storel %.5306, %.5302 + %.5308 =l add %.5307, 0 + %.5309 =l copy %.5265 + %.5310 =l mul 44, 1 + %.5311 =l add %.5309, %.5310 + %.5312 =l copy %.5311 + storel %.5312, %.5308 + %.5314 =l add %.5313, 0 + %.5315 =l copy $g_1183 + %.5316 =l mul 40, 1 + %.5317 =l add %.5315, %.5316 + %.5318 =l copy %.5317 + storel %.5318, %.5314 + %.5320 =l add %.5319, 0 + %.5321 =w copy 1123578037 + storew %.5321, %.5320 + %.5323 =l add %.5322, 0 + %.5324 =w copy 222 + storeb %.5324, %.5323 + %.5326 =l add %.5325, 0 + %.5327 =w copy 852478378 + storew %.5327, %.5326 + %.5329 =l loadl $g_23 + %.5330 =w loadsw %.5329 + %.5331 =w loaduw %.85 + %.5332 =l extuw %.5331 + %.5333 =l extsw 0 + %.5334 =l sub %.5333, 4 + %.5335 =w cnel %.5334, 0 + jnz %.5335, @logic_join.895, @logic_right.894 +@logic_right.894 + %.5336 =w loadsw %.5179 + %.5337 =w copy %.5336 + %.5338 =w loaduw %.5176 + %.5339 =w copy 6 + %.5340 =l loadl %.5226 + storeb %.5339, %.5340 + %.5341 =w copy 1 + %.5342 =w call $safe_lshift_func_uint8_t_u_u(w %.5339, w %.5341) + %.5343 =l copy $g_130 + %.5344 =l mul 16, 1 + %.5345 =l add %.5343, %.5344 + %.5346 =l copy %.5345 + %.5347 =w loaduw %.5346 + %.5348 =w xor %.5337, %.5347 + %.5349 =w copy %.5348 + storew %.5349, %.5179 + %.5350 =w cnew %.5349, 0 +@logic_join.895 + %.5351 =w phi @for_body.891 %.5335, @logic_right.894 %.5350 + %.5352 =l extsw %.5351 + %.5353 =w loadsw %.5182 + %.5354 =l loadl $g_1269 + %.5355 =l loadl %.5354 + %.5356 =l loadl %.5355 + %.5357 =w cnel $g_1706, $g_1706 + %.5358 =w copy %.5357 + %.5359 =w call $safe_unary_minus_func_int16_t_s(w %.5358) + %.5360 =w extsh %.5359 + %.5361 =w loaduw %.5176 + %.5362 =w cultw %.5360, %.5361 + %.5363 =w cnew %.5362, 0 + jnz %.5363, @logic_join.897, @logic_right.896 +@logic_right.896 + %.5364 =l copy %.5265 + %.5365 =l mul 44, 1 + %.5366 =l add %.5364, %.5365 + %.5367 =l copy %.5366 + %.5368 =w loadsw %.5367 + %.5369 =w cnew %.5368, 0 +@logic_join.897 + %.5370 =w phi @logic_join.895 %.5363, @logic_right.896 %.5369 + %.5371 =w loadsw %.5182 + %.5372 =w copy %.5371 + %.5373 =l loadl $g_1590 + storeh %.5372, %.5373 + %.5374 =l loadl %.5295 + storeh %.5372, %.5374 + %.5375 =l extuh %.5372 + %.5376 =l loadl $g_1972 + %.5377 =l and %.5375, %.5376 + %.5378 =w loaduw %.5176 + %.5379 =l extuw %.5378 + %.5380 =l and %.5377, %.5379 + %.5381 =l copy %.5380 + %.5382 =l copy 0 + %.5383 =w cugel %.5381, %.5382 + %.5384 =w copy %.5383 + %.5385 =w loaduw %.5176 + %.5386 =w cultw %.5384, %.5385 + %.5387 =w or %.5353, %.5386 + %.5388 =w ceql %.5352, 65529 + %.5389 =w loadsh $g_81 + %.5390 =l copy 18446744073709551615 + %.5391 =l call $safe_div_func_int64_t_s_s(l %.5332, l %.5390) + %.5392 =w copy %.5391 + %.5393 =l copy $g_1183 + %.5394 =l mul 24, 1 + %.5395 =l add %.5393, %.5394 + %.5396 =l copy %.5395 + %.5397 =l loadl %.5396 + %.5398 =w copy %.5397 + %.5399 =w call $safe_rshift_func_int8_t_s_s(w %.5392, w %.5398) + %.5400 =w extsb %.5399 + %.5401 =w or %.5330, %.5400 + storew %.5401, %.5329 + %.5402 =l copy %.5265 + %.5403 =l mul 48, 1 + %.5404 =l add %.5402, %.5403 + %.5405 =l copy %.5404 + storew 0, %.5405 +@for_cond.898 + %.5406 =l copy %.5265 + %.5407 =l mul 48, 1 + %.5408 =l add %.5406, %.5407 + %.5409 =l copy %.5408 + %.5410 =w loadsw %.5409 + %.5411 =w cslew %.5410, 0 + jnz %.5411, @for_body.899, @for_join.901 +@for_body.899 + %.5413 =l add %.5412, 0 + %.5414 =w copy 1469999110 + storew %.5414, %.5413 + %.5416 =l add %.5415, 0 + %.5417 =l extsw 0 + %.5418 =l copy %.5417 + storel %.5418, %.5416 + %.5420 =l add %.5419, 0 + %.5421 =l extsw 0 + %.5422 =l copy %.5421 + storel %.5422, %.5420 + %.5424 =l add %.5423, 0 + %.5425 =l extsw 0 + %.5426 =l copy %.5425 + storel %.5426, %.5424 + %.5427 =l add %.5423, 8 + %.5428 =l extsw 9 + %.5429 =l mul %.5428, 4 + %.5430 =l add %.15, %.5429 + storel %.5430, %.5427 + %.5431 =l add %.5423, 16 + %.5432 =l extsw 9 + %.5433 =l mul %.5432, 4 + %.5434 =l add %.15, %.5433 + storel %.5434, %.5431 + %.5435 =l add %.5423, 24 + storel %.5179, %.5435 + %.5436 =l add %.5423, 32 + %.5437 =l extsw 9 + %.5438 =l mul %.5437, 4 + %.5439 =l add %.15, %.5438 + storel %.5439, %.5436 + %.5440 =l add %.5423, 40 + %.5441 =l extsw 9 + %.5442 =l mul %.5441, 4 + %.5443 =l add %.15, %.5442 + storel %.5443, %.5440 + %.5444 =l add %.5423, 48 + %.5445 =l extsw 0 + %.5446 =l copy %.5445 + storel %.5446, %.5444 + %.5447 =l add %.5423, 56 + %.5448 =l copy $g_185 + %.5449 =l mul 40, 1 + %.5450 =l add %.5448, %.5449 + %.5451 =l copy %.5450 + storel %.5451, %.5447 + %.5452 =l add %.5423, 64 + %.5453 =l extsw 9 + %.5454 =l mul %.5453, 4 + %.5455 =l add %.15, %.5454 + storel %.5455, %.5452 + %.5456 =l add %.5423, 72 + %.5457 =l extsw 9 + %.5458 =l mul %.5457, 4 + %.5459 =l add %.15, %.5458 + storel %.5459, %.5456 + %.5460 =l add %.5423, 80 + %.5461 =l extsw 0 + %.5462 =l copy %.5461 + storel %.5462, %.5460 + %.5463 =l add %.5423, 88 + %.5464 =l copy $g_185 + %.5465 =l mul 40, 1 + %.5466 =l add %.5464, %.5465 + %.5467 =l copy %.5466 + storel %.5467, %.5463 + %.5468 =l add %.5423, 96 + %.5469 =l extsw 0 + %.5470 =l copy %.5469 + storel %.5470, %.5468 + %.5471 =l add %.5423, 104 + %.5472 =l extsw 0 + %.5473 =l copy %.5472 + storel %.5473, %.5471 + %.5474 =l add %.5423, 112 + %.5475 =l copy $g_185 + %.5476 =l mul 40, 1 + %.5477 =l add %.5475, %.5476 + %.5478 =l copy %.5477 + storel %.5478, %.5474 + %.5479 =l add %.5423, 120 + %.5480 =l extsw 0 + %.5481 =l copy %.5480 + storel %.5481, %.5479 + %.5482 =l add %.5423, 128 + storel $g_50, %.5482 + %.5483 =l add %.5423, 136 + storel $g_50, %.5483 + %.5484 =l add %.5423, 144 + %.5485 =l extsw 9 + %.5486 =l mul %.5485, 4 + %.5487 =l add %.15, %.5486 + storel %.5487, %.5484 + %.5488 =l add %.5423, 152 + %.5489 =l extsw 0 + %.5490 =l copy %.5489 + storel %.5490, %.5488 + %.5491 =l add %.5423, 160 + %.5492 =l extsw 0 + %.5493 =l copy %.5492 + storel %.5493, %.5491 + %.5494 =l add %.5423, 168 + storel %.5179, %.5494 + %.5495 =l add %.5423, 176 + %.5496 =l extsw 7 + %.5497 =l mul %.5496, 12 + %.5498 =l add $g_13, %.5497 + %.5499 =l extsw 0 + %.5500 =l mul %.5499, 4 + %.5501 =l add %.5498, %.5500 + %.5502 =l extsw 0 + %.5503 =l mul %.5502, 4 + %.5504 =l add %.5501, %.5503 + storel %.5504, %.5495 + %.5505 =l add %.5423, 184 + storel %.5179, %.5505 + %.5506 =l add %.5423, 192 + %.5507 =l extsw 9 + %.5508 =l mul %.5507, 4 + %.5509 =l add %.15, %.5508 + storel %.5509, %.5506 + %.5510 =l add %.5423, 200 + %.5511 =l extsw 0 + %.5512 =l copy %.5511 + storel %.5512, %.5510 + %.5513 =l add %.5423, 208 + %.5514 =l extsw 0 + %.5515 =l copy %.5514 + storel %.5515, %.5513 + %.5516 =l add %.5423, 216 + %.5517 =l extsw 0 + %.5518 =l copy %.5517 + storel %.5518, %.5516 + %.5519 =l add %.5423, 224 + %.5520 =l extsw 9 + %.5521 =l mul %.5520, 4 + %.5522 =l add %.15, %.5521 + storel %.5522, %.5519 + %.5523 =l add %.5423, 232 + storel $g_50, %.5523 + %.5524 =l add %.5423, 240 + storel $g_50, %.5524 + %.5525 =l add %.5423, 248 + storel %.5179, %.5525 + %.5526 =l add %.5423, 256 + %.5527 =l extsw 0 + %.5528 =l copy %.5527 + storel %.5528, %.5526 + %.5529 =l add %.5423, 264 + %.5530 =l extsw 0 + %.5531 =l copy %.5530 + storel %.5531, %.5529 + %.5532 =l add %.5423, 272 + %.5533 =l extsw 7 + %.5534 =l mul %.5533, 12 + %.5535 =l add $g_13, %.5534 + %.5536 =l extsw 0 + %.5537 =l mul %.5536, 4 + %.5538 =l add %.5535, %.5537 + %.5539 =l extsw 0 + %.5540 =l mul %.5539, 4 + %.5541 =l add %.5538, %.5540 + storel %.5541, %.5532 + %.5542 =l add %.5423, 280 + %.5543 =l extsw 0 + %.5544 =l copy %.5543 + storel %.5544, %.5542 + %.5545 =l add %.5423, 288 + %.5546 =l extsw 0 + %.5547 =l copy %.5546 + storel %.5547, %.5545 + %.5548 =l add %.5423, 296 + %.5549 =l extsw 7 + %.5550 =l mul %.5549, 12 + %.5551 =l add $g_13, %.5550 + %.5552 =l extsw 0 + %.5553 =l mul %.5552, 4 + %.5554 =l add %.5551, %.5553 + %.5555 =l extsw 0 + %.5556 =l mul %.5555, 4 + %.5557 =l add %.5554, %.5556 + storel %.5557, %.5548 + %.5558 =l add %.5423, 304 + %.5559 =l extsw 0 + %.5560 =l copy %.5559 + storel %.5560, %.5558 + %.5561 =l add %.5423, 312 + %.5562 =l extsw 0 + %.5563 =l copy %.5562 + storel %.5563, %.5561 + %.5564 =l add %.5423, 320 + %.5565 =l extsw 9 + %.5566 =l mul %.5565, 4 + %.5567 =l add %.15, %.5566 + storel %.5567, %.5564 + %.5568 =l add %.5423, 328 + storel $g_50, %.5568 + %.5569 =l add %.5423, 336 + %.5570 =l extsw 7 + %.5571 =l mul %.5570, 12 + %.5572 =l add $g_13, %.5571 + %.5573 =l extsw 0 + %.5574 =l mul %.5573, 4 + %.5575 =l add %.5572, %.5574 + %.5576 =l extsw 0 + %.5577 =l mul %.5576, 4 + %.5578 =l add %.5575, %.5577 + storel %.5578, %.5569 + %.5579 =l add %.5423, 344 + %.5580 =l copy $g_185 + %.5581 =l mul 40, 1 + %.5582 =l add %.5580, %.5581 + %.5583 =l copy %.5582 + storel %.5583, %.5579 + %.5584 =l add %.5423, 352 + storel $g_50, %.5584 + %.5585 =l add %.5423, 360 + %.5586 =l extsw 9 + %.5587 =l mul %.5586, 4 + %.5588 =l add %.15, %.5587 + storel %.5588, %.5585 + %.5589 =l add %.5423, 368 + storel $g_50, %.5589 + %.5590 =l add %.5423, 376 + %.5591 =l copy $g_185 + %.5592 =l mul 40, 1 + %.5593 =l add %.5591, %.5592 + %.5594 =l copy %.5593 + storel %.5594, %.5590 + %.5595 =l add %.5423, 384 + %.5596 =l extsw 0 + %.5597 =l copy %.5596 + storel %.5597, %.5595 + %.5598 =l add %.5423, 392 + %.5599 =l copy $g_130 + %.5600 =l mul 0, 1 + %.5601 =l add %.5599, %.5600 + %.5602 =l copy %.5601 + storel %.5602, %.5598 + %.5603 =l add %.5423, 400 + %.5604 =l extsw 0 + %.5605 =l copy %.5604 + storel %.5605, %.5603 + %.5606 =l add %.5423, 408 + storel %.5179, %.5606 + %.5607 =l add %.5423, 416 + %.5608 =l copy $g_185 + %.5609 =l mul 40, 1 + %.5610 =l add %.5608, %.5609 + %.5611 =l copy %.5610 + storel %.5611, %.5607 + %.5612 =l add %.5423, 424 + %.5613 =l extsw 9 + %.5614 =l mul %.5613, 4 + %.5615 =l add %.15, %.5614 + storel %.5615, %.5612 + %.5616 =l add %.5423, 432 + %.5617 =l extsw 7 + %.5618 =l mul %.5617, 12 + %.5619 =l add $g_13, %.5618 + %.5620 =l extsw 0 + %.5621 =l mul %.5620, 4 + %.5622 =l add %.5619, %.5621 + %.5623 =l extsw 0 + %.5624 =l mul %.5623, 4 + %.5625 =l add %.5622, %.5624 + storel %.5625, %.5616 + %.5626 =l add %.5423, 440 + %.5627 =l extsw 7 + %.5628 =l mul %.5627, 12 + %.5629 =l add $g_13, %.5628 + %.5630 =l extsw 0 + %.5631 =l mul %.5630, 4 + %.5632 =l add %.5629, %.5631 + %.5633 =l extsw 0 + %.5634 =l mul %.5633, 4 + %.5635 =l add %.5632, %.5634 + storel %.5635, %.5626 + %.5636 =l add %.5423, 448 + %.5637 =l extsw 7 + %.5638 =l mul %.5637, 12 + %.5639 =l add $g_13, %.5638 + %.5640 =l extsw 0 + %.5641 =l mul %.5640, 4 + %.5642 =l add %.5639, %.5641 + %.5643 =l extsw 0 + %.5644 =l mul %.5643, 4 + %.5645 =l add %.5642, %.5644 + storel %.5645, %.5636 + %.5646 =l add %.5423, 456 + storel $g_50, %.5646 + %.5647 =l add %.5423, 464 + %.5648 =l extsw 9 + %.5649 =l mul %.5648, 4 + %.5650 =l add %.15, %.5649 + storel %.5650, %.5647 + %.5651 =l add %.5423, 472 + %.5652 =l extsw 9 + %.5653 =l mul %.5652, 4 + %.5654 =l add %.15, %.5653 + storel %.5654, %.5651 + %.5655 =l add %.5423, 480 + storel $g_50, %.5655 + %.5656 =l add %.5423, 488 + %.5657 =l extsw 7 + %.5658 =l mul %.5657, 12 + %.5659 =l add $g_13, %.5658 + %.5660 =l extsw 0 + %.5661 =l mul %.5660, 4 + %.5662 =l add %.5659, %.5661 + %.5663 =l extsw 0 + %.5664 =l mul %.5663, 4 + %.5665 =l add %.5662, %.5664 + storel %.5665, %.5656 + %.5666 =l add %.5423, 496 + %.5667 =l copy $g_185 + %.5668 =l mul 40, 1 + %.5669 =l add %.5667, %.5668 + %.5670 =l copy %.5669 + storel %.5670, %.5666 + %.5671 =l add %.5423, 504 + storel $g_50, %.5671 + %.5672 =l add %.5423, 512 + %.5673 =l extsw 7 + %.5674 =l mul %.5673, 12 + %.5675 =l add $g_13, %.5674 + %.5676 =l extsw 0 + %.5677 =l mul %.5676, 4 + %.5678 =l add %.5675, %.5677 + %.5679 =l extsw 0 + %.5680 =l mul %.5679, 4 + %.5681 =l add %.5678, %.5680 + storel %.5681, %.5672 + %.5682 =l add %.5423, 520 + %.5683 =l extsw 0 + %.5684 =l copy %.5683 + storel %.5684, %.5682 + %.5685 =l add %.5423, 528 + %.5686 =l extsw 0 + %.5687 =l copy %.5686 + storel %.5687, %.5685 + %.5688 =l add %.5423, 536 + storel $g_50, %.5688 + %.5689 =l add %.5423, 544 + %.5690 =l copy $g_185 + %.5691 =l mul 40, 1 + %.5692 =l add %.5690, %.5691 + %.5693 =l copy %.5692 + storel %.5693, %.5689 + %.5694 =l add %.5423, 552 + storel $g_50, %.5694 + %.5695 =l add %.5423, 560 + %.5696 =l extsw 0 + %.5697 =l copy %.5696 + storel %.5697, %.5695 + %.5698 =l add %.5423, 568 + %.5699 =l extsw 0 + %.5700 =l copy %.5699 + storel %.5700, %.5698 + %.5701 =l add %.5423, 576 + %.5702 =l extsw 0 + %.5703 =l copy %.5702 + storel %.5703, %.5701 + %.5704 =l add %.5423, 584 + %.5705 =l extsw 0 + %.5706 =l copy %.5705 + storel %.5706, %.5704 + %.5707 =l add %.5423, 592 + %.5708 =l extsw 9 + %.5709 =l mul %.5708, 4 + %.5710 =l add %.15, %.5709 + storel %.5710, %.5707 + %.5711 =l add %.5423, 600 + storel $g_50, %.5711 + %.5712 =l add %.5423, 608 + storel $g_50, %.5712 + %.5713 =l add %.5423, 616 + storel %.5179, %.5713 + %.5714 =l add %.5423, 624 + storel %.5179, %.5714 + %.5715 =l add %.5423, 632 + storel $g_50, %.5715 + %.5716 =l add %.5423, 640 + %.5717 =l extsw 9 + %.5718 =l mul %.5717, 4 + %.5719 =l add %.15, %.5718 + storel %.5719, %.5716 + %.5720 =l add %.5423, 648 + storel $g_50, %.5720 + %.5721 =l add %.5423, 656 + storel $g_50, %.5721 + %.5722 =l add %.5423, 664 + %.5723 =l extsw 9 + %.5724 =l mul %.5723, 4 + %.5725 =l add %.15, %.5724 + storel %.5725, %.5722 + %.5726 =l add %.5423, 672 + %.5727 =l extsw 0 + %.5728 =l copy %.5727 + storel %.5728, %.5726 + %.5729 =l add %.5423, 680 + %.5730 =l extsw 0 + %.5731 =l copy %.5730 + storel %.5731, %.5729 + %.5732 =l add %.5423, 688 + storel %.5179, %.5732 + %.5733 =l add %.5423, 696 + %.5734 =l extsw 7 + %.5735 =l mul %.5734, 12 + %.5736 =l add $g_13, %.5735 + %.5737 =l extsw 0 + %.5738 =l mul %.5737, 4 + %.5739 =l add %.5736, %.5738 + %.5740 =l extsw 0 + %.5741 =l mul %.5740, 4 + %.5742 =l add %.5739, %.5741 + storel %.5742, %.5733 + %.5743 =l add %.5423, 704 + %.5744 =l extsw 0 + %.5745 =l copy %.5744 + storel %.5745, %.5743 + %.5746 =l add %.5423, 712 + %.5747 =l extsw 9 + %.5748 =l mul %.5747, 4 + %.5749 =l add %.15, %.5748 + storel %.5749, %.5746 + %.5750 =l add %.5423, 720 + %.5751 =l extsw 9 + %.5752 =l mul %.5751, 4 + %.5753 =l add %.15, %.5752 + storel %.5753, %.5750 + %.5754 =l add %.5423, 728 + storel %.5179, %.5754 + %.5755 =l add %.5423, 736 + %.5756 =l extsw 9 + %.5757 =l mul %.5756, 4 + %.5758 =l add %.15, %.5757 + storel %.5758, %.5755 + %.5759 =l add %.5423, 744 + %.5760 =l extsw 9 + %.5761 =l mul %.5760, 4 + %.5762 =l add %.15, %.5761 + storel %.5762, %.5759 + %.5763 =l add %.5423, 752 + %.5764 =l extsw 0 + %.5765 =l copy %.5764 + storel %.5765, %.5763 + %.5766 =l add %.5423, 760 + %.5767 =l copy $g_185 + %.5768 =l mul 40, 1 + %.5769 =l add %.5767, %.5768 + %.5770 =l copy %.5769 + storel %.5770, %.5766 + %.5771 =l add %.5423, 768 + %.5772 =l extsw 9 + %.5773 =l mul %.5772, 4 + %.5774 =l add %.15, %.5773 + storel %.5774, %.5771 + %.5775 =l add %.5423, 776 + %.5776 =l extsw 9 + %.5777 =l mul %.5776, 4 + %.5778 =l add %.15, %.5777 + storel %.5778, %.5775 + %.5779 =l add %.5423, 784 + %.5780 =l extsw 0 + %.5781 =l copy %.5780 + storel %.5781, %.5779 + %.5782 =l add %.5423, 792 + %.5783 =l copy $g_185 + %.5784 =l mul 40, 1 + %.5785 =l add %.5783, %.5784 + %.5786 =l copy %.5785 + storel %.5786, %.5782 + %.5787 =l add %.5423, 800 + %.5788 =l extsw 0 + %.5789 =l copy %.5788 + storel %.5789, %.5787 + %.5790 =l add %.5423, 808 + %.5791 =l extsw 0 + %.5792 =l copy %.5791 + storel %.5792, %.5790 + %.5793 =l add %.5423, 816 + %.5794 =l copy $g_185 + %.5795 =l mul 40, 1 + %.5796 =l add %.5794, %.5795 + %.5797 =l copy %.5796 + storel %.5797, %.5793 + %.5798 =l add %.5423, 824 + %.5799 =l extsw 0 + %.5800 =l copy %.5799 + storel %.5800, %.5798 + %.5801 =l add %.5423, 832 + storel $g_50, %.5801 + %.5802 =l add %.5423, 840 + storel $g_50, %.5802 + %.5803 =l add %.5423, 848 + %.5804 =l extsw 9 + %.5805 =l mul %.5804, 4 + %.5806 =l add %.15, %.5805 + storel %.5806, %.5803 + %.5807 =l add %.5423, 856 + %.5808 =l extsw 0 + %.5809 =l copy %.5808 + storel %.5809, %.5807 + %.5810 =l add %.5423, 864 + %.5811 =l extsw 0 + %.5812 =l copy %.5811 + storel %.5812, %.5810 + %.5813 =l add %.5423, 872 + storel %.5179, %.5813 + %.5814 =l add %.5423, 880 + %.5815 =l extsw 7 + %.5816 =l mul %.5815, 12 + %.5817 =l add $g_13, %.5816 + %.5818 =l extsw 0 + %.5819 =l mul %.5818, 4 + %.5820 =l add %.5817, %.5819 + %.5821 =l extsw 0 + %.5822 =l mul %.5821, 4 + %.5823 =l add %.5820, %.5822 + storel %.5823, %.5814 + %.5824 =l add %.5423, 888 + storel %.5179, %.5824 + %.5825 =l add %.5423, 896 + %.5826 =l extsw 9 + %.5827 =l mul %.5826, 4 + %.5828 =l add %.15, %.5827 + storel %.5828, %.5825 + %.5829 =l add %.5423, 904 + %.5830 =l extsw 0 + %.5831 =l copy %.5830 + storel %.5831, %.5829 + %.5832 =l add %.5423, 912 + %.5833 =l extsw 0 + %.5834 =l copy %.5833 + storel %.5834, %.5832 + %.5835 =l add %.5423, 920 + %.5836 =l extsw 0 + %.5837 =l copy %.5836 + storel %.5837, %.5835 + %.5838 =l add %.5423, 928 + %.5839 =l extsw 9 + %.5840 =l mul %.5839, 4 + %.5841 =l add %.15, %.5840 + storel %.5841, %.5838 + %.5842 =l add %.5423, 936 + storel $g_50, %.5842 + %.5843 =l add %.5423, 944 + storel $g_50, %.5843 + %.5844 =l add %.5423, 952 + storel %.5179, %.5844 + storew 0, %.5846 +@for_cond.902 + %.5849 =w loadsw %.5846 + %.5850 =w csltw %.5849, 4 + jnz %.5850, @for_body.903, @for_join.905 +@for_body.903 + %.5851 =w copy 857976620 + %.5852 =w loadsw %.5846 + %.5853 =l extsw %.5852 + %.5854 =l mul %.5853, 4 + %.5855 =l add %.5845, %.5854 + storew %.5851, %.5855 +@for_cont.904 + %.5856 =w loadsw %.5846 + %.5857 =w add %.5856, 1 + storew %.5857, %.5846 + jmp @for_cond.902 +@for_join.905 + %.5858 =w copy 0 + %.5859 =l copy $g_794 + %.5860 =l mul 4, 1 + %.5861 =l add %.5859, %.5860 + %.5862 =l copy %.5861 + storew %.5858, %.5862 +@for_cond.906 + %.5863 =l copy $g_794 + %.5864 =l mul 4, 1 + %.5865 =l add %.5863, %.5864 + %.5866 =l copy %.5865 + %.5867 =w loaduw %.5866 + %.5868 =w copy 1 + %.5869 =w culew %.5867, %.5868 + jnz %.5869, @for_body.907, @for_join.909 +@for_body.907 + %.5870 =l copy %.5265 + %.5871 =l mul 36, 1 + %.5872 =l add %.5870, %.5871 + %.5873 =l copy %.5872 + %.5874 =w loaduw %.5873 + %.5875 =w cnew %.5874, 0 + jnz %.5875, @if_true.910, @if_false.911 +@if_true.910 + jmp @for_join.909 +@if_false.911 +@for_cont.908 + %.5876 =l copy $g_794 + %.5877 =l mul 4, 1 + %.5878 =l add %.5876, %.5877 + %.5879 =l copy %.5878 + %.5880 =w loaduw %.5879 + %.5881 =w copy 1 + %.5882 =w add %.5880, %.5881 + storew %.5882, %.5879 + jmp @for_cond.906 +@for_join.909 + %.5883 =l extsw 3 + %.5884 =l mul %.5883, 4 + %.5885 =l add %.5845, %.5884 + %.5886 =w loaduw %.5885 + %.5887 =w sub %.5886, 1 + storew %.5887, %.5885 + %.5888 =l loadl %.1 + %.5889 =w loadsw %.5888 + %.5890 =l loadl $g_23 + %.5891 =w loadsw %.5890 + %.5892 =w or %.5889, %.5891 + storew %.5892, %.5888 +@for_cont.900 + %.5893 =l copy %.5265 + %.5894 =l mul 48, 1 + %.5895 =l add %.5893, %.5894 + %.5896 =l copy %.5895 + %.5897 =w loadsw %.5896 + %.5898 =w add %.5897, 1 + storew %.5898, %.5896 + jmp @for_cond.898 +@for_join.901 + %.5899 =l loadl $g_296 + %.5900 =l loadl %.5899 + %.5901 =l copy %.5265 + %.5902 =l mul 32, 1 + %.5903 =l add %.5901, %.5902 + %.5904 =l copy %.5903 + %.5905 =w loaduw %.5904 + %.5906 =l extuw %.5905 + %.5907 =w csltl 49, %.5906 + %.5908 =w copy %.5907 + %.5909 =l copy %.5265 + %.5910 =l mul 48, 1 + %.5911 =l add %.5909, %.5910 + %.5912 =l copy %.5911 + %.5913 =w loadsw %.5912 + %.5914 =l loadl %.5297 + %.5915 =l extsw 0 + %.5916 =l mul %.5915, 40 + %.5917 =l add $g_1615, %.5916 + %.5918 =l extsw 1 + %.5919 =l mul %.5918, 8 + %.5920 =l add %.5917, %.5919 + storel %.5914, %.5920 + %.5921 =l extsw 0 + %.5922 =w cnel %.5914, %.5921 + %.5923 =w copy %.5922 + %.5924 =w call $safe_mul_func_int8_t_s_s(w %.5908, w %.5923) + %.5925 =w extsb %.5924 + storel %.64, $g_1752 + %.5926 =l loadl %.1 + %.5927 =w loadsw %.5926 + %.5928 =l extsw %.5927 + %.5929 =l copy $g_1183 + %.5930 =l mul 8, 1 + %.5931 =l add %.5929, %.5930 + %.5932 =l copy %.5931 + storel %.5928, %.5932 + %.5933 =l loadl $g_1983 + %.5934 =w ceql %.64, %.5933 + %.5935 =w xor %.5925, %.5934 + %.5936 =l loadl %.1 + storew %.5935, %.5936 + %.5937 =w cnew %.5935, 0 + jnz %.5937, @if_true.912, @if_false.913 +@if_true.912 + %.5939 =l add %.5938, 0 + %.5940 =w copy 40695 + storeh %.5940, %.5939 + %.5942 =l add %.5941, 0 + %.5943 =w copy 1497767668 + storew %.5943, %.5942 + %.5945 =l add %.5944, 0 + %.5946 =w copy 136 + storeb %.5946, %.5945 + %.5948 =l add %.5947, 0 + storel $g_296, %.5948 + %.5950 =l add %.5949, 0 + %.5951 =w copy 3083152646 + storew %.5951, %.5950 + %.5953 =l add %.5952, 0 + %.5954 =w copy 3152178012 + storew %.5954, %.5953 + %.5956 =l add %.5955, 0 + %.5957 =w copy 5 + storew %.5957, %.5956 + %.5958 =l add %.5955, 4 + %.5959 =w copy 505745575 + storew %.5959, %.5958 + %.5960 =l add %.5955, 8 + %.5961 =w copy 4707 + storeh %.5961, %.5960 + %.5962 =l add %.5955, 10 + storeh 0, %.5962 + %.5963 =l add %.5955, 12 + %.5964 =w copy 0 + storew %.5964, %.5963 + %.5965 =l add %.5955, 16 + %.5966 =w copy 1 + storew %.5966, %.5965 + %.5967 =w copy 0 + %.5968 =l copy $g_518 + %.5969 =l mul 0, 1 + %.5970 =l add %.5968, %.5969 + %.5971 =l copy %.5970 + storeb %.5967, %.5971 +@for_cond.914 + %.5972 =l copy $g_518 + %.5973 =l mul 0, 1 + %.5974 =l add %.5972, %.5973 + %.5975 =l copy %.5974 + %.5976 =w loadub %.5975 + %.5977 =w extub %.5976 + %.5978 =w cslew %.5977, 0 + jnz %.5978, @for_body.915, @for_join.917 +@for_body.915 + %.5980 =l add %.5979, 0 + %.5981 =w copy 18446744073709551612 + storew %.5981, %.5980 + %.5983 =l add %.5982, 0 + %.5984 =w copy 3939614397 + storew %.5984, %.5983 + %.5986 =l add %.5985, 0 + %.5987 =l extsw 0 + %.5988 =l copy %.5987 + storel %.5988, %.5986 + %.5989 =l add %.5985, 8 + %.5990 =l extsw 0 + %.5991 =l copy %.5990 + storel %.5991, %.5989 + %.5992 =l add %.5985, 16 + %.5993 =l extsw 0 + %.5994 =l copy %.5993 + storel %.5994, %.5992 + %.5995 =l add %.5985, 24 + %.5996 =l extsw 0 + %.5997 =l copy %.5996 + storel %.5997, %.5995 + %.5998 =l add %.5985, 32 + %.5999 =l extsw 0 + %.6000 =l copy %.5999 + storel %.6000, %.5998 + %.6001 =l add %.5985, 40 + %.6002 =l extsw 0 + %.6003 =l copy %.6002 + storel %.6003, %.6001 + %.6004 =l add %.5985, 48 + %.6005 =l extsw 0 + %.6006 =l copy %.6005 + storel %.6006, %.6004 + %.6007 =l add %.5985, 56 + %.6008 =l extsw 0 + %.6009 =l copy %.6008 + storel %.6009, %.6007 + %.6011 =l add %.6010, 0 + %.6012 =l extsw 1 + %.6013 =l mul %.6012, 2 + %.6014 =l add %.51, %.6013 + storel %.6014, %.6011 + %.6016 =w loadub %.5187 + %.6017 =w extub %.6016 + %.6018 =w cnew %.6017, 0 + jnz %.6018, @logic_right.918, @logic_join.919 +@logic_right.918 + %.6019 =l copy %.5265 + %.6020 =l mul 40, 1 + %.6021 =l add %.6019, %.6020 + %.6022 =l copy %.6021 + %.6023 =w loadsw %.6022 + %.6024 =w copy %.6023 + %.6025 =w copy 0 + %.6026 =l loadl $g_1590 + storeh %.6025, %.6026 + %.6027 =w extuh %.6025 + %.6028 =w cnew %.6027, 0 + jnz %.6028, @logic_join.925, @logic_right.924 +@logic_right.924 + %.6029 =l loadl %.5226 + %.6030 =w loadub %.6029 + %.6031 =w sub %.6030, 1 + storeb %.6031, %.6029 + %.6032 =w loaduw %.5979 + %.6033 =w copy %.6032 + %.6034 =w copy 13288484106753422136 + storew %.6034, %.5982 + %.6035 =l copy %.5265 + %.6036 =l mul 16, 1 + %.6037 =l add %.6035, %.6036 + %.6038 =l copy %.6037 + %.6039 =w loadsw %.6038 + %.6040 =w copy %.6039 + %.6041 =w loaduw %.5979 + %.6042 =w loadsw %.5941 + %.6043 =l extsw %.6042 + %.6044 =w loadsw %.5179 + %.6045 =l loadl $g_1590 + %.6046 =w loaduh %.6045 + %.6047 =l loadl %.83 + %.6048 =w loaduw %.5979 + %.6049 =l extuw %.6048 + %.6050 =l or 61837, %.6049 + %.6051 =w copy %.6050 + %.6052 =l loadl $g_422 + %.6053 =w loaduw %.6052 + %.6054 =w copy %.6053 + %.6055 =w call $safe_div_func_int32_t_s_s(w %.6051, w %.6054) + %.6056 =l loadl %.83 + %.6057 =w cnel %.6047, %.6056 + %.6058 =w loaduh %.5938 + %.6059 =w extuh %.6058 + %.6060 =w cnew %.6059, 0 + jnz %.6060, @logic_join.929, @logic_right.928 +@logic_right.928 + %.6061 =w cnel 7, 0 +@logic_join.929 + %.6062 =w phi @logic_right.924 %.6060, @logic_right.928 %.6061 + storew %.6062, %.5182 + %.6063 =l loadl $g_1590 + %.6064 =w loaduh %.6063 + %.6065 =w extuh %.6064 + %.6066 =w call $safe_lshift_func_uint16_t_u_u(w %.6046, w %.6065) + %.6067 =w extuh %.6066 + %.6068 =w cnew %.6067, 0 + jnz %.6068, @logic_join.927, @logic_right.926 +@logic_right.926 + %.6069 =w loaduw %.5979 + %.6070 =w cnew %.6069, 0 +@logic_join.927 + %.6071 =w phi @logic_join.929 %.6068, @logic_right.926 %.6070 + %.6072 =w copy %.6071 + %.6073 =l loadl $g_1038 + %.6074 =l loadl %.6073 + %.6075 =w loaduw %.6074 + %.6076 =w cugtw %.6072, %.6075 + %.6077 =l extsw %.6076 + %.6078 =w csgel %.6077, 12088 + %.6079 =w and %.6044, %.6078 + storew %.6079, %.5179 + %.6080 =l extsw %.6079 + %.6081 =l call $safe_add_func_int64_t_s_s(l %.6080, l 4276973671381511902) + %.6082 =l loadl %.1 + %.6083 =w loadsw %.6082 + %.6084 =l extsw %.6083 + %.6085 =l or %.6081, %.6084 + %.6086 =l copy 33187 + %.6087 =l and %.6085, %.6086 + %.6088 =l and %.6043, %.6087 + %.6089 =w copy %.6088 + storew %.6089, %.5941 + %.6090 =w copy %.6089 + %.6091 =w and %.6041, %.6090 + %.6092 =w loaduw %.5176 + %.6093 =w or %.6040, %.6092 + %.6094 =w copy %.6093 + storew %.6094, %.6038 + %.6095 =w xor %.6034, %.6094 + %.6096 =w copy %.6095 + %.6097 =w call $safe_mod_func_int16_t_s_s(w %.6033, w %.6096) + %.6098 =w copy %.6097 + %.6099 =w call $safe_add_func_uint8_t_u_u(w %.6031, w %.6098) + %.6100 =w extub %.6099 + %.6101 =w cnew %.6100, 0 +@logic_join.925 + %.6102 =w phi @logic_right.918 %.6028, @logic_join.927 %.6101 + %.6103 =w cnew %.6102, 0 + jnz %.6103, @logic_join.923, @logic_right.922 +@logic_right.922 + %.6104 =w loaduh %.5938 + %.6105 =w extuh %.6104 + %.6106 =w cnew %.6105, 0 +@logic_join.923 + %.6107 =w phi @logic_join.925 %.6103, @logic_right.922 %.6106 + %.6108 =w copy %.6107 + %.6109 =w loaduh %.5938 + %.6110 =w extuh %.6109 + %.6111 =w call $safe_sub_func_uint32_t_u_u(w %.6108, w %.6110) + %.6112 =l loadl %.1 + %.6113 =w loadsw %.6112 + %.6114 =w copy %.6113 + %.6115 =w culew %.6111, %.6114 + %.6116 =w copy %.6115 + %.6117 =w copy 221 + %.6118 =w call $safe_mul_func_int8_t_s_s(w %.6116, w %.6117) + %.6119 =w extsb %.6118 + %.6120 =w loaduw %.5979 + %.6121 =w xor %.6119, %.6120 + %.6122 =w copy %.6121 + %.6123 =w loadub %.5187 + %.6124 =w extub %.6123 + %.6125 =w call $safe_lshift_func_int8_t_s_u(w %.6122, w %.6124) + %.6126 =w extsb %.6125 + %.6127 =w call $safe_div_func_int16_t_s_s(w %.6024, w %.6126) + %.6128 =w extsh %.6127 + %.6129 =w loaduh %.5938 + %.6130 =w extuh %.6129 + %.6131 =w csltw %.6128, %.6130 + %.6132 =l loadl $g_1038 + %.6133 =l loadl %.6132 + %.6134 =w loaduw %.6133 + %.6135 =w loaduw $g_2013 + %.6136 =w or %.6134, %.6135 + %.6137 =w cnew %.6136, 0 + jnz %.6137, @logic_join.921, @logic_right.920 +@logic_right.920 + %.6138 =w loadsw %.5982 + %.6139 =w cnew %.6138, 0 +@logic_join.921 + %.6140 =w phi @logic_join.923 %.6137, @logic_right.920 %.6139 + %.6141 =l copy %.5265 + %.6142 =l mul 24, 1 + %.6143 =l add %.6141, %.6142 + %.6144 =l copy %.6143 + %.6145 =l loadl %.6144 + %.6146 =w copy %.6145 + %.6147 =w call $safe_mod_func_int32_t_s_s(w %.6140, w %.6146) + %.6148 =w loadsb %.5944 + %.6149 =w extsb %.6148 + %.6150 =w and %.6147, %.6149 + %.6151 =l loadl $g_173 + %.6152 =w loadsw %.6151 + %.6153 =l extsw %.6152 + %.6154 =w culel %.6153, 4294967292 + %.6155 =w cnew %.6154, 0 +@logic_join.919 + %.6156 =w phi @for_body.915 %.6018, @logic_join.921 %.6155 + %.6157 =l loadl $g_173 + storew %.6156, %.6157 + %.6158 =l loadl $g_1983 + %.6159 =l loadl %.6158 + %.6160 =l loadl %.6159 + %.6161 =l loadl %.6160 + %.6162 =l loadl %.6161 + %.6163 =w loadsw %.5941 + %.6164 =l extsw 0 + %.6165 =l sub %.6164, 9 + %.6166 =w copy %.6165 + %.6167 =w call $safe_lshift_func_int8_t_s_s(w %.6166, w 4) + %.6168 =w extsb %.6167 + %.6169 =w cnew %.6168, 0 + jnz %.6169, @logic_join.933, @logic_right.932 +@logic_right.932 + %.6170 =l loadl %.5301 + %.6171 =w copy 46190 + %.6172 =w call $safe_rshift_func_int16_t_s_s(w %.6171, w 4) + %.6173 =w extsh %.6172 + %.6174 =l extsw 0 + %.6175 =l loadl $g_1705 + %.6176 =l loadl %.6175 + %.6177 =w ceql %.6174, %.6176 + %.6178 =w xor %.6173, %.6177 + %.6179 =w copy %.6178 + %.6180 =l loadl $g_1313 + %.6181 =l loadl %.6180 + %.6182 =l loadl %.6181 + %.6183 =l loadl %.6182 + storew %.6179, %.6183 + %.6184 =l copy %.5265 + %.6185 =l mul 32, 1 + %.6186 =l add %.6184, %.6185 + %.6187 =l copy %.6186 + %.6188 =w loaduw %.6187 + %.6189 =w loadub %.5187 + %.6190 =w extub %.6189 + %.6191 =w or %.6188, %.6190 + %.6192 =w call $safe_mod_func_uint32_t_u_u(w %.6179, w %.6191) + %.6193 =w cnel 194, 0 + jnz %.6193, @logic_join.935, @logic_right.934 +@logic_right.934 + %.6194 =w cnel 30, 0 +@logic_join.935 + %.6195 =w phi @logic_right.932 %.6193, @logic_right.934 %.6194 + %.6196 =w copy %.6195 + %.6197 =l loadl %.6010 + storeh %.6196, %.6197 + %.6198 =l extsw 0 + %.6199 =w cnel %.6170, %.6198 + %.6200 =l copy %.5265 + %.6201 =l mul 40, 1 + %.6202 =l add %.6200, %.6201 + %.6203 =l copy %.6202 + %.6204 =w loadsw %.6203 + %.6205 =w csgtw %.6199, %.6204 + %.6206 =w cnew %.6205, 0 +@logic_join.933 + %.6207 =w phi @logic_join.919 %.6169, @logic_join.935 %.6206 + %.6208 =l extsw %.6207 + %.6209 =w loaduw %.5176 + %.6210 =l extuw %.6209 + %.6211 =l call $safe_div_func_uint64_t_u_u(l %.6208, l %.6210) + %.6212 =l copy 5 + %.6213 =w cugtl %.6211, %.6212 + %.6214 =w cnew %.6213, 0 + jnz %.6214, @logic_join.931, @logic_right.930 +@logic_right.930 + %.6215 =l loadl $g_2028 + %.6216 =w cnel %.6215, 0 +@logic_join.931 + %.6217 =w phi @logic_join.933 %.6214, @logic_right.930 %.6216 + %.6218 =w or %.6163, %.6217 + %.6219 =l extsw %.6218 + %.6220 =l copy $g_1183 + %.6221 =l mul 8, 1 + %.6222 =l add %.6220, %.6221 + %.6223 =l copy %.6222 + storel %.6219, %.6223 + %.6224 =w copy %.6219 + storew %.6224, %.5941 + %.6225 =l loadl %.5190 + %.6226 =w ceql %.6162, %.6225 + %.6227 =w loadsw %.5982 + %.6228 =w csgtw %.6226, %.6227 + %.6229 =w cnew %.6228, 0 + jnz %.6229, @if_true.936, @if_false.937 +@if_true.936 + %.6230 =w loadsw %.5941 + %.6231 =l loadl %.5295 + %.6232 =w loaduh %.6231 + %.6233 =l extuh %.6232 + %.6234 =l xor 7, 1973726022 + %.6235 =l or %.6233, %.6234 + %.6236 =w copy %.6235 + storeh %.6236, %.6231 + %.6237 =w call $safe_lshift_func_uint16_t_u_s(w %.6236, w 10) + %.6238 =w extuh %.6237 + %.6239 =l loadl $g_173 + storew %.6238, %.6239 + %.6240 =w or %.6230, %.6238 + storew %.6240, %.5941 + jmp @if_join.938 +@if_false.937 + %.6241 =l loadl %.5307 + storel %.6241, %.5313 + %.6242 =l loadl %.5313 + %.6243 =w loadsw %.6242 + %.6244 =w copy %.6243 + %.6245 =w copy 9 + %.6246 =l loadl $g_1038 + %.6247 =l loadl %.6246 + storew %.6245, %.6247 + %.6248 =w loaduh %.5938 + %.6249 =w extuh %.6248 + %.6250 =w xor %.6245, %.6249 + %.6251 =w xor %.6244, %.6250 + %.6252 =w copy %.6251 + storew %.6252, %.6242 + %.6253 =w loadsw %.5182 + %.6254 =l extsw %.6253 + ret %.6254 +@if_join.938 + storel %.5182, %.5313 +@for_cont.916 + %.6255 =l copy $g_518 + %.6256 =l mul 0, 1 + %.6257 =l add %.6255, %.6256 + %.6258 =l copy %.6257 + %.6259 =w loadub %.6258 + %.6260 =w extub %.6259 + %.6261 =w add %.6260, 1 + %.6262 =w copy %.6261 + storeb %.6262, %.6258 + jmp @for_cond.914 +@for_join.917 + %.6263 =w copy 0 + storeb %.6263, $g_937 +@for_cond.939 + %.6264 =w loadsb $g_937 + %.6265 =w extsb %.6264 + %.6266 =w cslew %.6265, 0 + jnz %.6266, @for_body.940, @for_join.942 +@for_body.940 + %.6268 =l add %.6267, 0 + %.6269 =w copy 0 + storew %.6269, %.6268 + %.6270 =l add %.6267, 4 + %.6271 =w copy 18446744073709551615 + storew %.6271, %.6270 + %.6272 =l add %.6267, 8 + %.6273 =w copy 2804 + storeh %.6273, %.6272 + %.6274 =l add %.6267, 10 + storeh 0, %.6274 + %.6275 =l add %.6267, 12 + %.6276 =w copy 1575345085 + storew %.6276, %.6275 + %.6277 =l add %.6267, 16 + %.6278 =w copy 8 + storew %.6278, %.6277 + %.6280 =l add %.6279, 0 + %.6281 =l copy %.5265 + %.6282 =l mul 44, 1 + %.6283 =l add %.6281, %.6282 + %.6284 =l copy %.6283 + storel %.6284, %.6280 + %.6286 =l add %.6285, 0 + %.6287 =w copy 2173313342 + storew %.6287, %.6286 + %.6288 =l loadl $g_23 + %.6289 =w loadsw %.6288 + %.6290 =l extsw 4 + %.6291 =l mul %.6290, 1 + %.6292 =l add $g_132, %.6291 + %.6293 =w loadsb %.6292 + %.6294 =w extsb %.6293 + %.6295 =w copy 65534 + %.6296 =w loaduh %.5938 + %.6297 =l extuh %.6296 + %.6298 =l copy $g_1183 + %.6299 =l mul 32, 1 + %.6300 =l add %.6298, %.6299 + %.6301 =l copy %.6300 + %.6302 =w loaduw %.6301 + %.6303 =w copy %.6302 + %.6304 =w call $safe_lshift_func_int8_t_s_s(w %.6303, w 5) + %.6305 =w extsb %.6304 + %.6306 =w loadsb $g_1130 + %.6307 =w extsb %.6306 + %.6308 =w loaduw %.5319 + %.6309 =w copy %.6308 + %.6310 =w loadsw %.5179 + %.6311 =w copy %.6310 + %.6312 =w copy 30 + %.6313 =w call $safe_sub_func_uint8_t_u_u(w %.6311, w %.6312) + %.6314 =l copy $g_265 + %.6315 =l mul 36, 1 + %.6316 =l add %.6314, %.6315 + %.6317 =l copy %.6316 + %.6318 =w loaduw %.6317 + %.6319 =w copy %.6318 + %.6320 =w call $safe_lshift_func_uint8_t_u_s(w %.6313, w %.6319) + %.6321 =w extub %.6320 + %.6322 =w loadsw %.5941 + %.6323 =w cnew %.6322, 0 + jnz %.6323, @logic_right.947, @logic_join.948 +@logic_right.947 + %.6324 =w cnel 17356307903983304843, 0 +@logic_join.948 + %.6325 =w phi @for_body.940 %.6323, @logic_right.947 %.6324 + %.6326 =l copy %.6267 + %.6327 =l mul 8, 1 + %.6328 =l add %.6326, %.6327 + %.6329 =l copy %.6328 + %.6330 =w loadsh %.6329 + %.6331 =w extsh %.6330 + %.6332 =w cslew %.6321, %.6331 + %.6333 =w cnew %.6332, 0 + jnz %.6333, @logic_join.946, @logic_right.945 +@logic_right.945 + %.6334 =l copy %.6267 + %.6335 =l mul 16, 1 + %.6336 =l add %.6334, %.6335 + %.6337 =l copy %.6336 + %.6338 =w loaduw %.6337 + %.6339 =w cnew %.6338, 0 +@logic_join.946 + %.6340 =w phi @logic_join.948 %.6333, @logic_right.945 %.6339 + %.6341 =l extsw %.6340 + %.6342 =l copy $g_185 + %.6343 =l mul 8, 1 + %.6344 =l add %.6342, %.6343 + %.6345 =l copy %.6344 + %.6346 =l loadl %.6345 + %.6347 =l xor %.6341, %.6346 + %.6348 =w copy %.6347 + %.6349 =w call $safe_lshift_func_int16_t_s_u(w %.6309, w %.6348) + %.6350 =w loadsw %.5179 + %.6351 =w call $safe_rshift_func_int16_t_s_s(w %.6349, w %.6350) + %.6352 =l extsh %.6351 + %.6353 =l xor %.6352, 0 + %.6354 =l loadl $g_173 + %.6355 =w loadsw %.6354 + %.6356 =l extsw %.6355 + %.6357 =w ceql %.6353, %.6356 + %.6358 =w loadub %.5187 + %.6359 =w extub %.6358 + %.6360 =w csltw %.6357, %.6359 + %.6361 =l loadl $g_1313 + %.6362 =l loadl %.6361 + %.6363 =l loadl %.6362 + %.6364 =l loadl %.6363 + %.6365 =w loaduw %.6364 + %.6366 =w xor %.6365, 18446744073709551615 + %.6367 =w and %.6307, %.6366 + %.6368 =w copy %.6367 + storeb %.6368, $g_1130 + %.6369 =l loadl $g_422 + %.6370 =w loaduw %.6369 + %.6371 =w copy %.6370 + %.6372 =w call $safe_mod_func_int32_t_s_s(w %.6305, w %.6371) + %.6373 =l extsw %.6372 + %.6374 =l copy $g_518 + %.6375 =l mul 8, 1 + %.6376 =l add %.6374, %.6375 + %.6377 =l copy %.6376 + %.6378 =l loadl %.6377 + %.6379 =l copy %.6378 + %.6380 =l call $safe_sub_func_uint64_t_u_u(l %.6373, l %.6379) + %.6381 =w cugel %.6297, %.6380 + %.6382 =w copy %.6381 + %.6383 =w call $safe_mul_func_uint16_t_u_u(w %.6295, w %.6382) + %.6384 =w extuh %.6383 + %.6385 =l extsw 0 + %.6386 =l mul %.6385, 4 + %.6387 =l add %.5192, %.6386 + %.6388 =w loadsw %.6387 + %.6389 =w ceqw %.6384, %.6388 + %.6390 =w xor %.6294, %.6389 + %.6391 =w copy %.6390 + storeb %.6391, %.6292 + %.6392 =l loadl $g_2028 + %.6393 =w copy %.6392 + %.6394 =w call $safe_mod_func_int8_t_s_s(w %.6391, w %.6393) + %.6395 =w extsb %.6394 + %.6396 =w cnew %.6395, 0 + jnz %.6396, @logic_right.943, @logic_join.944 +@logic_right.943 + %.6397 =l loadl %.5307 + %.6398 =w loadsw %.6397 + %.6399 =w cnew %.6398, 0 +@logic_join.944 + %.6400 =w phi @logic_join.946 %.6396, @logic_right.943 %.6399 + %.6401 =l copy %.6267 + %.6402 =l mul 12, 1 + %.6403 =l add %.6401, %.6402 + %.6404 =l copy %.6403 + %.6405 =w loadsw %.6404 + %.6406 =w and %.6289, %.6405 + storew %.6406, %.6288 + %.6407 =l loadl %.6279 + storel %.6407, %.6279 + %.6408 =w copy 0 + storew %.6408, %.61 +@for_cond.949 + %.6409 =w loaduw %.61 + %.6410 =w copy 0 + %.6411 =w culew %.6409, %.6410 + jnz %.6411, @for_body.950, @for_join.952 +@for_body.950 + %.6413 =l add %.6412, 0 + %.6414 =l extsw 0 + %.6415 =l copy %.6414 + storel %.6415, %.6413 + %.6417 =l add %.6416, 0 + %.6418 =l copy %.6267 + %.6419 =l mul 8, 1 + %.6420 =l add %.6418, %.6419 + %.6421 =l copy %.6420 + storel %.6421, %.6417 + %.6423 =l add %.6422, 0 + %.6424 =l copy $g_185 + %.6425 =l mul 24, 1 + %.6426 =l add %.6424, %.6425 + %.6427 =l copy %.6426 + storel %.6427, %.6423 + %.6429 =l loadl $g_82 + %.6430 =l copy %.6429 + %.6431 =l mul %.6430, 4 + %.6432 =l add %.15, %.6431 + %.6433 =w loadsw %.6432 + %.6434 =w copy %.6433 + %.6435 =l loadl $g_82 + %.6436 =l copy %.6435 + %.6437 =l mul %.6436, 4 + %.6438 =l add %.15, %.6437 + %.6439 =w loadsw %.6438 + %.6440 =w copy %.6439 + %.6441 =w call $safe_rshift_func_uint8_t_u_u(w %.6434, w %.6440) + %.6442 =w extub %.6441 + %.6443 =w cnew %.6442, 0 + jnz %.6443, @logic_join.956, @logic_right.955 +@logic_right.955 + %.6444 =l loadl $g_82 + %.6445 =l copy %.6444 + %.6446 =l mul %.6445, 4 + %.6447 =l add %.15, %.6446 + %.6448 =w loadsw %.6447 + %.6449 =l extsw %.6448 + %.6450 =w copy 2112370878 + %.6451 =l loadl $g_1037 + %.6452 =l loadl %.6451 + %.6453 =l loadl %.6452 + storew %.6450, %.6453 + %.6454 =l extuw %.6450 + %.6455 =l xor %.6454, 3 + %.6456 =l xor %.6449, %.6455 + %.6457 =l loadl $g_1984 + %.6458 =l loadl %.6457 + storel %.6458, %.5947 + %.6459 =l extsw 0 + %.6460 =w ceql %.6458, %.6459 + %.6461 =w cnew %.6460, 0 + jnz %.6461, @logic_right.957, @logic_join.958 +@logic_right.957 + %.6462 =l extsw 1 + %.6463 =l mul %.6462, 1 + %.6464 =l add $g_132, %.6463 + %.6465 =w loadsb %.6464 + %.6466 =l loadl %.5313 + %.6467 =w loadsw %.6466 + %.6468 =w copy 3409771330 + %.6469 =w call $safe_add_func_int32_t_s_s(w %.6467, w %.6468) + %.6470 =w copy %.6469 + %.6471 =l loadl %.5193 + %.6472 =w copy %.6471 + %.6473 =w call $safe_mul_func_uint16_t_u_u(w %.6470, w %.6472) + %.6474 =w extuh %.6473 + %.6475 =w cnew %.6474, 0 +@logic_join.958 + %.6476 =w phi @logic_right.955 %.6461, @logic_right.957 %.6475 + %.6477 =l extsw %.6476 + %.6478 =w csgtl %.6456, %.6477 + %.6479 =w copy %.6478 + %.6480 =w copy 1 + %.6481 =w call $safe_mod_func_uint16_t_u_u(w %.6479, w %.6480) + %.6482 =w copy %.6481 + %.6483 =w call $safe_unary_minus_func_int8_t_s(w %.6482) + %.6484 =l extsb %.6483 + %.6485 =l extsw 0 + %.6486 =l sub %.6485, 7 + %.6487 =l copy %.6486 + %.6488 =l call $safe_sub_func_int64_t_s_s(l %.6484, l %.6487) + %.6489 =w copy %.6488 + %.6490 =l loadl %.6416 + storeh %.6489, %.6490 + %.6491 =w extsh %.6489 + %.6492 =w cnew %.6491, 0 +@logic_join.956 + %.6493 =w phi @for_body.950 %.6443, @logic_join.958 %.6492 + %.6494 =l extsw %.6493 + %.6495 =w loadsb %.5944 + %.6496 =l extsb %.6495 + %.6497 =l call $safe_div_func_uint64_t_u_u(l %.6494, l %.6496) + %.6498 =w cnel %.6497, 0 + jnz %.6498, @logic_join.954, @logic_right.953 +@logic_right.953 + %.6499 =w loaduw %.5949 + %.6500 =w cnew %.6499, 0 +@logic_join.954 + %.6501 =w phi @logic_join.956 %.6498, @logic_right.953 %.6500 + %.6502 =w loadsb $g_937 + %.6503 =w extsb %.6502 + %.6504 =w add %.6503, 7 + %.6505 =l extsw %.6504 + %.6506 =l mul %.6505, 4 + %.6507 =l add %.15, %.6506 + storew %.6501, %.6507 + %.6508 =w copy 46382 + %.6509 =l loadl %.6422 + %.6510 =l loadl %.6509 + %.6511 =w loadsb $g_937 + %.6512 =w extsb %.6511 + %.6513 =w add %.6512, 7 + %.6514 =l extsw %.6513 + %.6515 =l mul %.6514, 4 + %.6516 =l add %.15, %.6515 + %.6517 =w loadsw %.6516 + %.6518 =w ceqw %.6517, 0 + %.6519 =l extsw %.6518 + %.6520 =l or %.6510, %.6519 + storel %.6520, %.6509 + %.6521 =w loadsw %.6285 + %.6522 =w loadsb %.5322 + %.6523 =w extsb %.6522 + %.6524 =l loadl $g_1590 + %.6525 =w loaduh %.6524 + %.6526 =w loadsb $g_937 + %.6527 =w extsb %.6526 + %.6528 =w add %.6527, 7 + %.6529 =l extsw %.6528 + %.6530 =l mul %.6529, 4 + %.6531 =l add %.15, %.6530 + %.6532 =w loadsw %.6531 + %.6533 =w copy %.6532 + %.6534 =l extsw 4 + %.6535 =l mul %.6534, 1 + %.6536 =l add $g_132, %.6535 + storeb %.6533, %.6536 + %.6537 =w extsb %.6533 + %.6538 =w ceqw %.6537, 0 + %.6539 =w loadsb $g_937 + %.6540 =w extsb %.6539 + %.6541 =w add %.6540, 7 + %.6542 =l extsw %.6541 + %.6543 =l mul %.6542, 4 + %.6544 =l add %.15, %.6543 + %.6545 =w loadsw %.6544 + %.6546 =w cslew %.6538, %.6545 + %.6547 =w copy %.6546 + %.6548 =w call $safe_add_func_uint16_t_u_u(w %.6525, w %.6547) + %.6549 =w extuh %.6548 + %.6550 =w and %.6523, %.6549 + %.6551 =l extsw %.6550 + %.6552 =l loadl $g_82 + %.6553 =l copy %.6552 + %.6554 =l mul %.6553, 4 + %.6555 =l add %.15, %.6554 + %.6556 =w loadsw %.6555 + %.6557 =l extsw %.6556 + %.6558 =l loadl %.5307 + %.6559 =w loadsw %.6558 + %.6560 =w loaduh $g_2102 + %.6561 =w extuh %.6560 + %.6562 =w csltw %.6559, %.6561 + %.6563 =w copy %.6562 + %.6564 =l loadl %.5307 + %.6565 =w loadsw %.6564 + %.6566 =w copy %.6565 + %.6567 =w call $safe_mul_func_int16_t_s_s(w %.6563, w %.6566) + %.6568 =w loadsb %.5944 + %.6569 =w extsb %.6568 + %.6570 =w call $safe_mul_func_int16_t_s_s(w %.6567, w %.6569) + %.6571 =l extsh %.6570 + %.6572 =w csgel %.6571, 3216404459 + %.6573 =l extsw %.6572 + %.6574 =l xor %.6573, 50202 + %.6575 =w copy %.6574 + %.6576 =l loadl $g_1313 + %.6577 =l loadl %.6576 + %.6578 =l loadl %.6577 + %.6579 =l loadl %.6578 + storew %.6575, %.6579 + %.6580 =l loadl $g_82 + %.6581 =l copy %.6580 + %.6582 =l mul %.6581, 4 + %.6583 =l add %.15, %.6582 + %.6584 =w loadsw %.6583 + %.6585 =w copy %.6584 + %.6586 =w or %.6575, %.6585 + %.6587 =l loadl %.5313 + %.6588 =w loadsw %.6587 + %.6589 =w copy %.6588 + %.6590 =w cugew %.6586, %.6589 + %.6591 =w loadsh %.5196 + %.6592 =l extsh %.6591 + %.6593 =w cnel %.6592, 0 + %.6594 =w copy %.6593 + %.6595 =l loadl $g_1590 + %.6596 =w loaduh %.6595 + %.6597 =w call $safe_add_func_uint16_t_u_u(w %.6594, w %.6596) + %.6598 =l extuh %.6597 + %.6599 =l or %.6598, 13760 + %.6600 =l copy %.6599 + %.6601 =l call $safe_div_func_int64_t_s_s(l %.6557, l %.6600) + %.6602 =l extsw 0 + %.6603 =w cnel $g_1070, %.6602 + %.6604 =l extsw %.6603 + %.6605 =l call $safe_sub_func_int64_t_s_s(l %.6551, l %.6604) + %.6606 =l copy 1 + %.6607 =w cslel %.6605, %.6606 + %.6608 =w copy %.6607 + %.6609 =w loaduw %.5176 + %.6610 =w or %.6608, %.6609 + %.6611 =w copy %.6610 + %.6612 =l loadl %.6279 + %.6613 =w loadsw %.6612 + %.6614 =w copy %.6613 + %.6615 =w call $safe_mod_func_uint16_t_u_u(w %.6611, w %.6614) + %.6616 =l extuh %.6615 + %.6617 =l extsw 0 + %.6618 =l sub %.6617, 1 + %.6619 =l and %.6616, %.6618 + %.6620 =l xor %.6619, 2235 + %.6621 =w copy %.6620 + %.6622 =l extsw 0 + %.6623 =l mul %.6622, 4 + %.6624 =l add %.5192, %.6623 + %.6625 =w loadsw %.6624 + %.6626 =w call $safe_rshift_func_int16_t_s_s(w %.6621, w %.6625) + %.6627 =w extsh %.6626 + %.6628 =w csgtw %.6521, %.6627 + %.6629 =l extsw %.6628 + %.6630 =w cultl %.6520, %.6629 + %.6631 =w cnew %.6630, 0 + jnz %.6631, @logic_join.960, @logic_right.959 +@logic_right.959 + %.6632 =l loadl %.5199 + %.6633 =w cnel %.6632, 0 +@logic_join.960 + %.6634 =w phi @logic_join.954 %.6631, @logic_right.959 %.6633 + %.6635 =w copy %.6634 + %.6636 =w loaduw %.5952 + %.6637 =w or %.6635, %.6636 + %.6638 =w copy %.6637 + %.6639 =l loadl %.5313 + %.6640 =w loadsw %.6639 + %.6641 =w copy %.6640 + %.6642 =w call $safe_mul_func_int16_t_s_s(w %.6638, w %.6641) + %.6643 =w copy %.6642 + %.6644 =w call $safe_add_func_uint16_t_u_u(w %.6508, w %.6643) + %.6645 =w extuh %.6644 + %.6646 =l loadl %.5307 + storew %.6645, %.6646 + %.6647 =l loadl %.5313 + %.6648 =w loadsw %.6647 + %.6649 =w cnew %.6648, 0 + jnz %.6649, @if_true.961, @if_false.962 +@if_true.961 + jmp @for_join.952 +@if_false.962 + %.6650 =w loadsb %.5944 + %.6651 =l extsb %.6650 + ret %.6651 +@for_cont.951 + %.6652 =w loaduw %.61 + %.6653 =w copy 1 + %.6654 =w add %.6652, %.6653 + storew %.6654, %.61 + jmp @for_cond.949 +@for_join.952 +@for_cont.941 + %.6655 =w loadsb $g_937 + %.6656 =w extsb %.6655 + %.6657 =w add %.6656, 1 + %.6658 =w copy %.6657 + storeb %.6658, $g_937 + jmp @for_cond.939 +@for_join.942 + %.6659 =w copy 0 + storeb %.6659, $g_566 +@for_cond.963 + %.6660 =w loadub $g_566 + %.6661 =w extub %.6660 + %.6662 =w cslew %.6661, 0 + jnz %.6662, @for_body.964, @for_join.966 +@for_body.964 + %.6664 =l add %.6663, 0 + %.6665 =w copy 8 + storew %.6665, %.6664 + %.6666 =l add %.6663, 4 + %.6667 =w copy 1 + storew %.6667, %.6666 + %.6668 =l add %.6663, 8 + %.6669 =l extsw 0 + %.6670 =l sub %.6669, 8 + %.6671 =w copy %.6670 + storeh %.6671, %.6668 + %.6672 =l add %.6663, 10 + storeh 0, %.6672 + %.6673 =l add %.6663, 12 + %.6674 =w copy 789134719 + storew %.6674, %.6673 + %.6675 =l add %.6663, 16 + %.6676 =w copy 0 + storew %.6676, %.6675 + %.6677 =l add %.6663, 20 + %.6678 =w copy 8 + storew %.6678, %.6677 + %.6679 =l add %.6663, 24 + %.6680 =w copy 1 + storew %.6680, %.6679 + %.6681 =l add %.6663, 28 + %.6682 =l extsw 0 + %.6683 =l sub %.6682, 8 + %.6684 =w copy %.6683 + storeh %.6684, %.6681 + %.6685 =l add %.6663, 30 + storeh 0, %.6685 + %.6686 =l add %.6663, 32 + %.6687 =w copy 789134719 + storew %.6687, %.6686 + %.6688 =l add %.6663, 36 + %.6689 =w copy 0 + storew %.6689, %.6688 + %.6690 =l add %.6663, 40 + %.6691 =w copy 8 + storew %.6691, %.6690 + %.6692 =l add %.6663, 44 + %.6693 =w copy 1 + storew %.6693, %.6692 + %.6694 =l add %.6663, 48 + %.6695 =l extsw 0 + %.6696 =l sub %.6695, 8 + %.6697 =w copy %.6696 + storeh %.6697, %.6694 + %.6698 =l add %.6663, 50 + storeh 0, %.6698 + %.6699 =l add %.6663, 52 + %.6700 =w copy 789134719 + storew %.6700, %.6699 + %.6701 =l add %.6663, 56 + %.6702 =w copy 0 + storew %.6702, %.6701 + %.6704 =l add %.6703, 0 + storel $g_24, %.6704 + %.6705 =l add %.6703, 8 + %.6706 =l copy $g_518 + %.6707 =l mul 16, 1 + %.6708 =l add %.6706, %.6707 + %.6709 =l copy %.6708 + storel %.6709, %.6705 + %.6710 =l add %.6703, 16 + storel $g_24, %.6710 + %.6711 =l add %.6703, 24 + %.6712 =l copy $g_518 + %.6713 =l mul 16, 1 + %.6714 =l add %.6712, %.6713 + %.6715 =l copy %.6714 + storel %.6715, %.6711 + %.6716 =l add %.6703, 32 + storel $g_24, %.6716 + %.6717 =l add %.6703, 40 + %.6718 =l copy $g_518 + %.6719 =l mul 16, 1 + %.6720 =l add %.6718, %.6719 + %.6721 =l copy %.6720 + storel %.6721, %.6717 + %.6722 =l add %.6703, 48 + storel $g_24, %.6722 + %.6723 =l add %.6703, 56 + %.6724 =l copy $g_518 + %.6725 =l mul 16, 1 + %.6726 =l add %.6724, %.6725 + %.6727 =l copy %.6726 + storel %.6727, %.6723 + %.6729 =l extsw 0 + %.6730 =l mul %.6729, 20 + %.6731 =l add %.6663, %.6730 + %.6732 =l loadl $g_1123 + %.6733 =l loaduw %.6731 + storew %.6733, %.6732 + %.6734 =l add %.6731, 4 + %.6735 =l add %.6732, 4 + %.6736 =l loaduw %.6734 + storew %.6736, %.6735 + %.6737 =l add %.6734, 4 + %.6738 =l add %.6735, 4 + %.6739 =l loaduw %.6737 + storew %.6739, %.6738 + %.6740 =l add %.6737, 4 + %.6741 =l add %.6738, 4 + %.6742 =l loaduw %.6740 + storew %.6742, %.6741 + %.6743 =l add %.6740, 4 + %.6744 =l add %.6741, 4 + %.6745 =l loaduw %.6743 + storew %.6745, %.6744 + %.6746 =l add %.6743, 4 + %.6747 =l add %.6744, 4 + %.6748 =l copy $g_185 + %.6749 =l mul 16, 1 + %.6750 =l add %.6748, %.6749 + %.6751 =l copy %.6750 + storew 0, %.6751 +@for_cond.967 + %.6752 =l copy $g_185 + %.6753 =l mul 16, 1 + %.6754 =l add %.6752, %.6753 + %.6755 =l copy %.6754 + %.6756 =w loadsw %.6755 + %.6757 =w csgew %.6756, 0 + jnz %.6757, @for_body.968, @for_join.970 +@for_body.968 + %.6759 =l add %.6758, 0 + %.6760 =l copy $g_518 + %.6761 =l mul 48, 1 + %.6762 =l add %.6760, %.6761 + %.6763 =l copy %.6762 + storel %.6763, %.6759 + %.6764 =l add %.6758, 8 + %.6765 =l copy $g_518 + %.6766 =l mul 48, 1 + %.6767 =l add %.6765, %.6766 + %.6768 =l copy %.6767 + storel %.6768, %.6764 + %.6769 =l add %.6758, 16 + %.6770 =l copy $g_518 + %.6771 =l mul 48, 1 + %.6772 =l add %.6770, %.6771 + %.6773 =l copy %.6772 + storel %.6773, %.6769 + %.6774 =l add %.6758, 24 + %.6775 =l copy $g_518 + %.6776 =l mul 48, 1 + %.6777 =l add %.6775, %.6776 + %.6778 =l copy %.6777 + storel %.6778, %.6774 + %.6779 =l add %.6758, 32 + %.6780 =l copy $g_518 + %.6781 =l mul 48, 1 + %.6782 =l add %.6780, %.6781 + %.6783 =l copy %.6782 + storel %.6783, %.6779 + %.6784 =l add %.6758, 40 + %.6785 =l copy $g_518 + %.6786 =l mul 48, 1 + %.6787 =l add %.6785, %.6786 + %.6788 =l copy %.6787 + storel %.6788, %.6784 + %.6789 =l add %.6758, 48 + %.6790 =l copy $g_518 + %.6791 =l mul 48, 1 + %.6792 =l add %.6790, %.6791 + %.6793 =l copy %.6792 + storel %.6793, %.6789 + %.6794 =l add %.6758, 56 + %.6795 =l copy $g_518 + %.6796 =l mul 48, 1 + %.6797 =l add %.6795, %.6796 + %.6798 =l copy %.6797 + storel %.6798, %.6794 + %.6799 =l add %.6758, 64 + %.6800 =l copy $g_518 + %.6801 =l mul 48, 1 + %.6802 =l add %.6800, %.6801 + %.6803 =l copy %.6802 + storel %.6803, %.6799 + %.6805 =l add %.6804, 0 + storel $g_23, %.6805 + %.6807 =l loadl $g_23 + %.6808 =w loadsw %.6807 + %.6809 =l extsw %.6808 + %.6810 =l and %.6809, 1 + %.6811 =w copy %.6810 + storew %.6811, %.6807 + %.6812 =l extsw 0 + %.6813 =l mul %.6812, 8 + %.6814 =l add %.6703, %.6813 + %.6815 =l loadl %.6814 + %.6816 =l call $func_4(l %.5941, l %.6815, l %.5941) + %.6817 =l loadl %.6804 + storel %.6816, %.6817 +@for_cont.969 + %.6818 =l copy $g_185 + %.6819 =l mul 16, 1 + %.6820 =l add %.6818, %.6819 + %.6821 =l copy %.6820 + %.6822 =w loadsw %.6821 + %.6823 =w sub %.6822, 1 + storew %.6823, %.6821 + jmp @for_cond.967 +@for_join.970 +@for_cont.965 + %.6824 =w loadub $g_566 + %.6825 =w extub %.6824 + %.6826 =w add %.6825, 1 + %.6827 =w copy %.6826 + storeb %.6827, $g_566 + jmp @for_cond.963 +@for_join.966 + %.6828 =l copy $g_265 + %.6829 =l mul 48, 1 + %.6830 =l add %.6828, %.6829 + %.6831 =l copy %.6830 + storew 0, %.6831 +@for_cond.971 + %.6832 =l copy $g_265 + %.6833 =l mul 48, 1 + %.6834 =l add %.6832, %.6833 + %.6835 =l copy %.6834 + %.6836 =w loadsw %.6835 + %.6837 =w cslew %.6836, 0 + jnz %.6837, @for_body.972, @for_join.974 +@for_body.972 + %.6838 =l copy %.5955 + %.6839 =l mul 12, 1 + %.6840 =l add %.6838, %.6839 + %.6841 =l copy %.6840 + %.6842 =w loadsw %.6841 + %.6843 =l extsw %.6842 + ret %.6843 +@for_cont.973 + %.6844 =l copy $g_265 + %.6845 =l mul 48, 1 + %.6846 =l add %.6844, %.6845 + %.6847 =l copy %.6846 + %.6848 =w loadsw %.6847 + %.6849 =w add %.6848, 1 + storew %.6849, %.6847 + jmp @for_cond.971 +@for_join.974 + jmp @if_join.975 +@if_false.913 + %.6851 =l add %.6850, 0 + %.6852 =w copy 1 + storeh %.6852, %.6851 + %.6854 =l add %.6853, 0 + storel $g_1972, %.6854 + %.6856 =l add %.6855, 0 + %.6857 =l copy %.88 + %.6858 =l mul 8, 1 + %.6859 =l add %.6857, %.6858 + %.6860 =l copy %.6859 + storel %.6860, %.6856 + %.6862 =l add %.6861, 0 + %.6863 =l extsw 0 + %.6864 =l sub %.6863, 1 + %.6865 =w copy %.6864 + storew %.6865, %.6862 + %.6867 =l add %.6866, 0 + %.6868 =l extsw 0 + %.6869 =l sub %.6868, 8 + %.6870 =w copy %.6869 + storew %.6870, %.6867 + %.6872 =l add %.6871, 0 + %.6873 =w copy 192325631 + storew %.6873, %.6872 + %.6874 =l add %.6871, 4 + %.6875 =w copy 192325631 + storew %.6875, %.6874 + %.6876 =l add %.6871, 8 + %.6877 =w copy 192325631 + storew %.6877, %.6876 + %.6878 =l add %.6871, 12 + %.6879 =w copy 192325631 + storew %.6879, %.6878 + %.6880 =l add %.6871, 16 + %.6881 =w copy 192325631 + storew %.6881, %.6880 + %.6882 =l add %.6871, 20 + %.6883 =w copy 192325631 + storew %.6883, %.6882 + %.6885 =l copy $g_265 + %.6886 =l mul 24, 1 + %.6887 =l add %.6885, %.6886 + %.6888 =l copy %.6887 + %.6889 =l loadl %.6888 + %.6890 =w copy 26311 + %.6891 =w loadsh %.6850 + %.6892 =w extsh %.6891 + %.6893 =w call $safe_rshift_func_int16_t_s_s(w %.6890, w %.6892) + %.6894 =l extsh %.6893 + %.6895 =w copy 6 + %.6896 =w call $safe_unary_minus_func_uint8_t_u(w %.6895) + %.6897 =l loadl %.5307 + %.6898 =w loadsw %.6897 + storel $g_394, $g_2127 + %.6899 =w cnel $g_363, $g_394 + %.6900 =l loadl %.104 + %.6901 =l loadl %.5313 + %.6902 =w loadsw %.6901 + %.6903 =l extsw %.6902 + %.6904 =w csgel %.6903, 2 + %.6905 =w copy %.6904 + %.6906 =w loadsw %.5182 + %.6907 =w copy %.6906 + %.6908 =w call $safe_mod_func_uint8_t_u_u(w %.6905, w %.6907) + %.6909 =w copy %.6908 + %.6910 =l copy $g_794 + %.6911 =l mul 4, 1 + %.6912 =l add %.6910, %.6911 + %.6913 =l copy %.6912 + %.6914 =w loaduw %.6913 + %.6915 =w copy %.6914 + %.6916 =w call $safe_add_func_int8_t_s_s(w %.6909, w %.6915) + %.6917 =w extsb %.6916 + %.6918 =l extsw 0 + %.6919 =l mul %.6918, 4 + %.6920 =l add %.5192, %.6919 + %.6921 =w loadsw %.6920 + %.6922 =w call $safe_rshift_func_uint16_t_u_s(w %.6917, w %.6921) + %.6923 =w extuh %.6922 + %.6924 =l extsw 0 + %.6925 =l mul %.6924, 4 + %.6926 =l add %.5192, %.6925 + storew %.6923, %.6926 + storew %.6923, %.5182 + %.6927 =l extsw 0 + %.6928 =w cnel %.6900, %.6927 + %.6929 =l loadl %.1 + %.6930 =w loadsw %.6929 + %.6931 =w cnew %.6928, %.6930 + %.6932 =l extsw %.6931 + %.6933 =l loadl %.6853 + storel %.6932, %.6933 + %.6934 =l call $safe_add_func_int64_t_s_s(l %.6932, l 5017732426839066702) + %.6935 =w cnel %.6934, 0 + jnz %.6935, @logic_join.977, @logic_right.976 +@logic_right.976 + %.6936 =w loadsh %.6850 + %.6937 =w extsh %.6936 + %.6938 =w cnew %.6937, 0 +@logic_join.977 + %.6939 =w phi @if_false.913 %.6935, @logic_right.976 %.6938 + %.6940 =w xor %.6899, %.6939 + %.6941 =w copy %.6940 + %.6942 =w copy 7 + %.6943 =w call $safe_rshift_func_int8_t_s_u(w %.6941, w %.6942) + %.6944 =w extsb %.6943 + %.6945 =l loadl %.6855 + storeh %.6944, %.6945 + %.6946 =w copy 65535 + %.6947 =w call $safe_mod_func_int16_t_s_s(w %.6944, w %.6946) + %.6948 =l extsh %.6947 + %.6949 =l loadl %.5193 + %.6950 =w ceql %.6948, %.6949 + %.6951 =w copy %.6950 + %.6952 =l loadl $g_1313 + %.6953 =l loadl %.6952 + %.6954 =l loadl %.6953 + %.6955 =l loadl %.6954 + %.6956 =w loaduw %.6955 + %.6957 =w culew %.6951, %.6956 + %.6958 =w csltw %.6898, %.6957 + %.6959 =w call $safe_unary_minus_func_int32_t_s(w %.6958) + %.6960 =l extsw %.6959 + %.6961 =w csgel %.6960, 44916 + %.6962 =l extsw %.6961 + %.6963 =l call $safe_add_func_uint64_t_u_u(l %.6894, l %.6962) + %.6964 =w loadsh %.5196 + %.6965 =l extsh %.6964 + %.6966 =w culel %.6963, %.6965 + %.6967 =l loadl %.5307 + %.6968 =w loadsw %.6967 + %.6969 =w cnew %.6966, %.6968 + %.6970 =l extsw %.6969 + %.6971 =w ceql %.6970, 3 + %.6972 =w loadsh %.6850 + %.6973 =w extsh %.6972 + %.6974 =w or %.6971, %.6973 + %.6975 =w xor %.6974, 18446744073709551615 + %.6976 =w loadsh %.106 + %.6977 =w extsh %.6976 + %.6978 =w csgtw %.6975, %.6977 + %.6979 =l extsw 1 + %.6980 =l mul %.6979, 4 + %.6981 =l add %.5202, %.6980 + %.6982 =w loadsw %.6981 + %.6983 =w and %.6978, %.6982 + %.6984 =w copy %.6983 + %.6985 =l extsw 1 + %.6986 =l mul %.6985, 4 + %.6987 =l add %.5202, %.6986 + %.6988 =w loadsw %.6987 + %.6989 =w copy %.6988 + %.6990 =w call $safe_mod_func_uint8_t_u_u(w %.6984, w %.6989) + %.6991 =w extub %.6990 + %.6992 =l loadl $g_1038 + %.6993 =l loadl %.6992 + %.6994 =w loaduw %.6993 + %.6995 =w and %.6991, %.6994 + %.6996 =l extuw %.6995 + %.6997 =l and %.6996, 18446744073709551613 + %.6998 =w copy %.6997 + %.6999 =l loadl $g_422 + storew %.6998, %.6999 + %.7000 =w cnel 1, 0 + jnz %.7000, @if_true.978, @if_false.979 +@if_true.978 + %.7001 =l loadl %.1 + %.7002 =w loadsw %.7001 + %.7003 =l extsw %.7002 + ret %.7003 +@if_false.979 + %.7005 =l add %.7004, 0 + %.7006 =w copy 3605607459 + storew %.7006, %.7005 + %.7007 =l add %.7004, 4 + %.7008 =w copy 7 + storew %.7008, %.7007 + %.7009 =l add %.7004, 8 + %.7010 =w copy 3827000415 + storew %.7010, %.7009 + %.7011 =l add %.7004, 12 + %.7012 =w copy 737796084 + storew %.7012, %.7011 + %.7013 =l add %.7004, 16 + %.7014 =w copy 2981231114 + storew %.7014, %.7013 + %.7015 =l add %.7004, 20 + %.7016 =w copy 18446744073709551615 + storew %.7016, %.7015 + %.7017 =l add %.7004, 24 + %.7018 =w copy 18446744073709551613 + storew %.7018, %.7017 + %.7019 =l add %.7004, 28 + %.7020 =w copy 1691684583 + storew %.7020, %.7019 + %.7021 =l add %.7004, 32 + %.7022 =w copy 1699922327 + storew %.7022, %.7021 + %.7023 =l add %.7004, 36 + %.7024 =w copy 644777404 + storew %.7024, %.7023 + %.7025 =l add %.7004, 40 + %.7026 =w copy 18446744073709551615 + storew %.7026, %.7025 + %.7027 =l add %.7004, 44 + %.7028 =w copy 7 + storew %.7028, %.7027 + %.7029 =l add %.7004, 48 + %.7030 =w copy 5 + storew %.7030, %.7029 + %.7031 =l add %.7004, 52 + %.7032 =w copy 3681951840 + storew %.7032, %.7031 + %.7033 =l add %.7004, 56 + %.7034 =w copy 2389908307 + storew %.7034, %.7033 + %.7035 =l add %.7004, 60 + %.7036 =w copy 3418309949 + storew %.7036, %.7035 + %.7037 =l add %.7004, 64 + %.7038 =w copy 1 + storew %.7038, %.7037 + %.7039 =l add %.7004, 68 + %.7040 =w copy 2 + storew %.7040, %.7039 + %.7041 =l add %.7004, 72 + %.7042 =w copy 2125129727 + storew %.7042, %.7041 + %.7043 =l add %.7004, 76 + %.7044 =w copy 0 + storew %.7044, %.7043 + %.7045 =l add %.7004, 80 + %.7046 =w copy 18446744073709551611 + storew %.7046, %.7045 + %.7047 =l add %.7004, 84 + %.7048 =w copy 18446744073709551606 + storew %.7048, %.7047 + %.7049 =l add %.7004, 88 + %.7050 =w copy 18446744073709551609 + storew %.7050, %.7049 + %.7051 =l add %.7004, 92 + %.7052 =w copy 1294648098 + storew %.7052, %.7051 + %.7053 =l add %.7004, 96 + %.7054 =w copy 927038418 + storew %.7054, %.7053 + %.7055 =l add %.7004, 100 + %.7056 =w copy 18446744073709551608 + storew %.7056, %.7055 + %.7057 =l add %.7004, 104 + %.7058 =w copy 18446744073709551613 + storew %.7058, %.7057 + %.7059 =l add %.7004, 108 + %.7060 =w copy 4187825284 + storew %.7060, %.7059 + %.7061 =l add %.7004, 112 + %.7062 =w copy 5 + storew %.7062, %.7061 + %.7063 =l add %.7004, 116 + %.7064 =w copy 3681951840 + storew %.7064, %.7063 + %.7065 =l add %.7004, 120 + %.7066 =w copy 18446744073709551615 + storew %.7066, %.7065 + %.7067 =l add %.7004, 124 + %.7068 =w copy 1 + storew %.7068, %.7067 + %.7069 =l add %.7004, 128 + %.7070 =w copy 18446744073709551608 + storew %.7070, %.7069 + %.7071 =l add %.7004, 132 + %.7072 =w copy 459369300 + storew %.7072, %.7071 + %.7073 =l add %.7004, 136 + %.7074 =w copy 1827016989 + storew %.7074, %.7073 + %.7075 =l add %.7004, 140 + %.7076 =w copy 680997031 + storew %.7076, %.7075 + %.7077 =l add %.7004, 144 + %.7078 =w copy 1639435908 + storew %.7078, %.7077 + %.7079 =l add %.7004, 148 + %.7080 =w copy 3644077451 + storew %.7080, %.7079 + %.7081 =l add %.7004, 152 + %.7082 =w copy 1 + storew %.7082, %.7081 + %.7083 =l add %.7004, 156 + %.7084 =w copy 2125129727 + storew %.7084, %.7083 + %.7085 =l add %.7004, 160 + %.7086 =w copy 2569114947 + storew %.7086, %.7085 + %.7087 =l add %.7004, 164 + %.7088 =w copy 3605607459 + storew %.7088, %.7087 + %.7089 =l add %.7004, 168 + %.7090 =w copy 18446744073709551608 + storew %.7090, %.7089 + %.7091 =l add %.7004, 172 + %.7092 =w copy 3218957464 + storew %.7092, %.7091 + %.7093 =l add %.7004, 176 + %.7094 =w copy 1 + storew %.7094, %.7093 + %.7095 =l add %.7004, 180 + %.7096 =w copy 18446744073709551615 + storew %.7096, %.7095 + %.7097 =l add %.7004, 184 + %.7098 =w copy 7 + storew %.7098, %.7097 + %.7099 =l add %.7004, 188 + %.7100 =w copy 7 + storew %.7100, %.7099 + %.7101 =l add %.7004, 192 + %.7102 =w copy 18446744073709551615 + storew %.7102, %.7101 + %.7103 =l add %.7004, 196 + %.7104 =w copy 2044415521 + storew %.7104, %.7103 + %.7105 =l add %.7004, 200 + %.7106 =w copy 18446744073709551608 + storew %.7106, %.7105 + %.7107 =l add %.7004, 204 + %.7108 =w copy 0 + storew %.7108, %.7107 + %.7109 =l add %.7004, 208 + %.7110 =w copy 3827000415 + storew %.7110, %.7109 + %.7111 =l add %.7004, 212 + %.7112 =w copy 2981231114 + storew %.7112, %.7111 + %.7113 =l add %.7004, 216 + %.7114 =w copy 4121401781 + storew %.7114, %.7113 + %.7115 =l add %.7004, 220 + %.7116 =w copy 18446744073709551608 + storew %.7116, %.7115 + %.7117 =l add %.7004, 224 + %.7118 =w copy 18446744073709551613 + storew %.7118, %.7117 + %.7119 =l add %.7004, 228 + %.7120 =w copy 18446744073709551615 + storew %.7120, %.7119 + %.7121 =l add %.7004, 232 + %.7122 =w copy 18446744073709551611 + storew %.7122, %.7121 + %.7123 =l add %.7004, 236 + %.7124 =w copy 18446744073709551608 + storew %.7124, %.7123 + %.7125 =l add %.7004, 240 + %.7126 =w copy 18446744073709551609 + storew %.7126, %.7125 + %.7127 =l add %.7004, 244 + %.7128 =w copy 18446744073709551606 + storew %.7128, %.7127 + %.7129 =l add %.7004, 248 + %.7130 =w copy 0 + storew %.7130, %.7129 + %.7131 =l add %.7004, 252 + %.7132 =w copy 1925250850 + storew %.7132, %.7131 + %.7133 =l add %.7004, 256 + %.7134 =w copy 2934917713 + storew %.7134, %.7133 + %.7135 =l add %.7004, 260 + %.7136 =w copy 5 + storew %.7136, %.7135 + %.7137 =l add %.7004, 264 + %.7138 =w copy 18446744073709551615 + storew %.7138, %.7137 + %.7139 =l add %.7004, 268 + %.7140 =w copy 3418309949 + storew %.7140, %.7139 + %.7141 =l add %.7004, 272 + %.7142 =w copy 4073918674 + storew %.7142, %.7141 + %.7143 =l add %.7004, 276 + %.7144 =w copy 18446744073709551615 + storew %.7144, %.7143 + %.7145 =l add %.7004, 280 + %.7146 =w copy 2 + storew %.7146, %.7145 + %.7147 =l add %.7004, 284 + %.7148 =w copy 1639435908 + storew %.7148, %.7147 + %.7149 =l add %.7004, 288 + %.7150 =w copy 1827016989 + storew %.7150, %.7149 + %.7151 =l add %.7004, 292 + %.7152 =w copy 644777404 + storew %.7152, %.7151 + %.7153 =l add %.7004, 296 + %.7154 =w copy 940826840 + storew %.7154, %.7153 + %.7155 =l add %.7004, 300 + %.7156 =w copy 18446744073709551613 + storew %.7156, %.7155 + %.7157 =l add %.7004, 304 + %.7158 =w copy 18446744073709551613 + storew %.7158, %.7157 + %.7159 =l add %.7004, 308 + %.7160 =w copy 749146208 + storew %.7160, %.7159 + %.7161 =l add %.7004, 312 + %.7162 =w copy 18446744073709551606 + storew %.7162, %.7161 + %.7163 =l add %.7004, 316 + %.7164 =w copy 737796084 + storew %.7164, %.7163 + %.7165 =l add %.7004, 320 + %.7166 =w copy 18446744073709551606 + storew %.7166, %.7165 + %.7167 =l add %.7004, 324 + %.7168 =w copy 749146208 + storew %.7168, %.7167 + %.7169 =l add %.7004, 328 + %.7170 =w copy 1768884348 + storew %.7170, %.7169 + %.7171 =l add %.7004, 332 + %.7172 =w copy 5 + storew %.7172, %.7171 + %.7173 =l add %.7004, 336 + %.7174 =w copy 4037700173 + storew %.7174, %.7173 + %.7175 =l add %.7004, 340 + %.7176 =w copy 18446744073709551609 + storew %.7176, %.7175 + %.7177 =l add %.7004, 344 + %.7178 =w copy 18446744073709551615 + storew %.7178, %.7177 + %.7179 =l add %.7004, 348 + %.7180 =w copy 3644077451 + storew %.7180, %.7179 + %.7181 =l add %.7004, 352 + %.7182 =w copy 1 + storew %.7182, %.7181 + %.7183 =l add %.7004, 356 + %.7184 =w copy 18446744073709551615 + storew %.7184, %.7183 + %.7185 =l add %.7004, 360 + %.7186 =w copy 18446744073709551609 + storew %.7186, %.7185 + %.7187 =l add %.7004, 364 + %.7188 =w copy 2934917713 + storew %.7188, %.7187 + %.7189 =l add %.7004, 368 + %.7190 =w copy 2 + storew %.7190, %.7189 + %.7191 =l add %.7004, 372 + %.7192 =w copy 3155281286 + storew %.7192, %.7191 + %.7193 =l add %.7004, 376 + %.7194 =w copy 3643049425 + storew %.7194, %.7193 + %.7195 =l add %.7004, 380 + %.7196 =w copy 1340931701 + storew %.7196, %.7195 + %.7197 =l add %.7004, 384 + %.7198 =w copy 18446744073709551606 + storew %.7198, %.7197 + %.7199 =l add %.7004, 388 + %.7200 =w copy 1 + storew %.7200, %.7199 + %.7201 =l add %.7004, 392 + %.7202 =w copy 4037700173 + storew %.7202, %.7201 + %.7203 =l add %.7004, 396 + %.7204 =w copy 3644077451 + storew %.7204, %.7203 + %.7205 =l add %.7004, 400 + %.7206 =w copy 2934917713 + storew %.7206, %.7205 + %.7207 =l add %.7004, 404 + %.7208 =w copy 1 + storew %.7208, %.7207 + %.7209 =l add %.7004, 408 + %.7210 =w copy 18446744073709551615 + storew %.7210, %.7209 + %.7211 =l add %.7004, 412 + %.7212 =w copy 0 + storew %.7212, %.7211 + %.7213 =l add %.7004, 416 + %.7214 =w copy 3218957464 + storew %.7214, %.7213 + %.7215 =l add %.7004, 420 + %.7216 =w copy 749146208 + storew %.7216, %.7215 + %.7217 =l add %.7004, 424 + %.7218 =w copy 7 + storew %.7218, %.7217 + %.7219 =l add %.7004, 428 + %.7220 =w copy 2125129727 + storew %.7220, %.7219 + %.7221 =l add %.7004, 432 + %.7222 =w copy 1463937332 + storew %.7222, %.7221 + %.7223 =l add %.7004, 436 + %.7224 =w copy 2 + storew %.7224, %.7223 + %.7225 =l add %.7004, 440 + %.7226 =w copy 36518684 + storew %.7226, %.7225 + %.7227 =l add %.7004, 444 + %.7228 =w copy 1691684583 + storew %.7228, %.7227 + %.7229 =l add %.7004, 448 + %.7230 =w copy 2 + storew %.7230, %.7229 + %.7231 =l add %.7004, 452 + %.7232 =w copy 18446744073709551615 + storew %.7232, %.7231 + %.7233 =l add %.7004, 456 + %.7234 =w copy 18446744073709551613 + storew %.7234, %.7233 + %.7235 =l add %.7004, 460 + %.7236 =w copy 7 + storew %.7236, %.7235 + %.7237 =l add %.7004, 464 + %.7238 =w copy 18446744073709551613 + storew %.7238, %.7237 + %.7239 =l add %.7004, 468 + %.7240 =w copy 18446744073709551615 + storew %.7240, %.7239 + %.7241 =l add %.7004, 472 + %.7242 =w copy 940826840 + storew %.7242, %.7241 + %.7243 =l add %.7004, 476 + %.7244 =w copy 1925250850 + storew %.7244, %.7243 + %.7245 =l add %.7004, 480 + %.7246 =w copy 1340931701 + storew %.7246, %.7245 + %.7247 =l add %.7004, 484 + %.7248 =w copy 18446744073709551615 + storew %.7248, %.7247 + %.7249 =l add %.7004, 488 + %.7250 =w copy 1827016989 + storew %.7250, %.7249 + %.7251 =l add %.7004, 492 + %.7252 =w copy 2256088511 + storew %.7252, %.7251 + %.7253 =l add %.7004, 496 + %.7254 =w copy 2058348708 + storew %.7254, %.7253 + %.7255 =l add %.7004, 500 + %.7256 =w copy 411449477 + storew %.7256, %.7255 + %.7257 =l add %.7004, 504 + %.7258 =w copy 18446744073709551613 + storew %.7258, %.7257 + %.7259 =l add %.7004, 508 + %.7260 =w copy 1 + storew %.7260, %.7259 + %.7261 =l add %.7004, 512 + %.7262 =w copy 18446744073709551606 + storew %.7262, %.7261 + %.7263 =l add %.7004, 516 + %.7264 =w copy 1 + storew %.7264, %.7263 + %.7265 =l add %.7004, 520 + %.7266 =w copy 0 + storew %.7266, %.7265 + %.7267 =l add %.7004, 524 + %.7268 =w copy 18446744073709551613 + storew %.7268, %.7267 + %.7269 =l add %.7004, 528 + %.7270 =w copy 4183864120 + storew %.7270, %.7269 + %.7271 =l add %.7004, 532 + %.7272 =w copy 2044415521 + storew %.7272, %.7271 + %.7273 =l add %.7004, 536 + %.7274 =w copy 2256088511 + storew %.7274, %.7273 + %.7275 =l add %.7004, 540 + %.7276 =w copy 1 + storew %.7276, %.7275 + %.7277 =l add %.7004, 544 + %.7278 =w copy 5 + storew %.7278, %.7277 + %.7279 =l add %.7004, 548 + %.7280 =w copy 4183864120 + storew %.7280, %.7279 + %.7281 =l add %.7004, 552 + %.7282 =w copy 18446744073709551615 + storew %.7282, %.7281 + %.7283 =l add %.7004, 556 + %.7284 =w copy 3644077451 + storew %.7284, %.7283 + %.7285 =l add %.7004, 560 + %.7286 =w copy 18446744073709551608 + storew %.7286, %.7285 + %.7287 =l add %.7004, 564 + %.7288 =w copy 18446744073709551615 + storew %.7288, %.7287 + %.7289 =l add %.7004, 568 + %.7290 =w copy 7 + storew %.7290, %.7289 + %.7291 =l add %.7004, 572 + %.7292 =w copy 18446744073709551613 + storew %.7292, %.7291 + %.7293 =l add %.7004, 576 + %.7294 =w copy 1827016989 + storew %.7294, %.7293 + %.7295 =l add %.7004, 580 + %.7296 =w copy 935585686 + storew %.7296, %.7295 + %.7297 =l add %.7004, 584 + %.7298 =w copy 1691684583 + storew %.7298, %.7297 + %.7299 =l add %.7004, 588 + %.7300 =w copy 680997031 + storew %.7300, %.7299 + %.7301 =l add %.7004, 592 + %.7302 =w copy 7 + storew %.7302, %.7301 + %.7303 =l add %.7004, 596 + %.7304 =w copy 921227315 + storew %.7304, %.7303 + %.7305 =l add %.7004, 600 + %.7306 =w copy 2125129727 + storew %.7306, %.7305 + %.7307 =l add %.7004, 604 + %.7308 =w copy 749146208 + storew %.7308, %.7307 + %.7309 =l add %.7004, 608 + %.7310 =w copy 18446744073709551613 + storew %.7310, %.7309 + %.7311 =l add %.7004, 612 + %.7312 =w copy 2934917713 + storew %.7312, %.7311 + %.7313 =l add %.7004, 616 + %.7314 =w copy 5 + storew %.7314, %.7313 + %.7315 =l add %.7004, 620 + %.7316 =w copy 0 + storew %.7316, %.7315 + %.7317 =l add %.7004, 624 + %.7318 =w copy 258848418 + storew %.7318, %.7317 + %.7319 =l add %.7004, 628 + %.7320 =w copy 18446744073709551615 + storew %.7320, %.7319 + %.7321 =l add %.7004, 632 + %.7322 =w copy 18446744073709551613 + storew %.7322, %.7321 + %.7323 =l add %.7004, 636 + %.7324 =w copy 3643049425 + storew %.7324, %.7323 + %.7325 =l add %.7004, 640 + %.7326 =w copy 7 + storew %.7326, %.7325 + %.7327 =l add %.7004, 644 + %.7328 =w copy 1 + storew %.7328, %.7327 + %.7329 =l add %.7004, 648 + %.7330 =w copy 18446744073709551609 + storew %.7330, %.7329 + %.7331 =l add %.7004, 652 + %.7332 =w copy 18446744073709551609 + storew %.7332, %.7331 + %.7333 =l add %.7004, 656 + %.7334 =w copy 0 + storew %.7334, %.7333 + %.7335 =l add %.7004, 660 + %.7336 =w copy 18446744073709551608 + storew %.7336, %.7335 + %.7337 =l add %.7004, 664 + %.7338 =w copy 0 + storew %.7338, %.7337 + %.7339 =l add %.7004, 668 + %.7340 =w copy 680997031 + storew %.7340, %.7339 + %.7341 =l add %.7004, 672 + %.7342 =w copy 18446744073709551611 + storew %.7342, %.7341 + %.7343 =l add %.7004, 676 + %.7344 =w copy 0 + storew %.7344, %.7343 + %.7345 =l add %.7004, 680 + %.7346 =w copy 459369300 + storew %.7346, %.7345 + %.7347 =l add %.7004, 684 + %.7348 =w copy 3155281286 + storew %.7348, %.7347 + %.7349 =l add %.7004, 688 + %.7350 =w copy 36518684 + storew %.7350, %.7349 + %.7351 =l add %.7004, 692 + %.7352 =w copy 18446744073709551615 + storew %.7352, %.7351 + %.7353 =l add %.7004, 696 + %.7354 =w copy 1750864649 + storew %.7354, %.7353 + %.7355 =l add %.7004, 700 + %.7356 =w copy 940826840 + storew %.7356, %.7355 + %.7357 =l add %.7004, 704 + %.7358 =w copy 3218957464 + storew %.7358, %.7357 + %.7359 =l add %.7004, 708 + %.7360 =w copy 0 + storew %.7360, %.7359 + %.7361 =l add %.7004, 712 + %.7362 =w copy 18446744073709551615 + storew %.7362, %.7361 + %.7363 =l add %.7004, 716 + %.7364 =w copy 1 + storew %.7364, %.7363 + %.7365 =l add %.7004, 720 + %.7366 =w copy 2934917713 + storew %.7366, %.7365 + %.7367 =l add %.7004, 724 + %.7368 =w copy 3644077451 + storew %.7368, %.7367 + %.7369 =l add %.7004, 728 + %.7370 =w copy 5 + storew %.7370, %.7369 + %.7371 =l add %.7004, 732 + %.7372 =w copy 2219850352 + storew %.7372, %.7371 + %.7373 =l add %.7004, 736 + %.7374 =w copy 2 + storew %.7374, %.7373 + %.7375 =l add %.7004, 740 + %.7376 =w copy 18446744073709551610 + storew %.7376, %.7375 + %.7377 =l add %.7004, 744 + %.7378 =w copy 3218957464 + storew %.7378, %.7377 + %.7379 =l add %.7004, 748 + %.7380 =w copy 2 + storew %.7380, %.7379 + %.7381 =l add %.7004, 752 + %.7382 =w copy 0 + storew %.7382, %.7381 + %.7383 =l add %.7004, 756 + %.7384 =w copy 927038418 + storew %.7384, %.7383 + %.7385 =l add %.7004, 760 + %.7386 =w copy 18446744073709551608 + storew %.7386, %.7385 + %.7387 =l add %.7004, 764 + %.7388 =w copy 3739975818 + storew %.7388, %.7387 + %.7389 =l add %.7004, 768 + %.7390 =w copy 18446744073709551612 + storew %.7390, %.7389 + %.7391 =l add %.7004, 772 + %.7392 =w copy 0 + storew %.7392, %.7391 + %.7393 =l add %.7004, 776 + %.7394 =w copy 737796084 + storew %.7394, %.7393 + %.7395 =l add %.7004, 780 + %.7396 =w copy 18446744073709551615 + storew %.7396, %.7395 + %.7397 =l add %.7004, 784 + %.7398 =w copy 1 + storew %.7398, %.7397 + %.7399 =l add %.7004, 788 + %.7400 =w copy 2764042410 + storew %.7400, %.7399 + %.7401 =l add %.7004, 792 + %.7402 =w copy 18446744073709551611 + storew %.7402, %.7401 + %.7403 =l add %.7004, 796 + %.7404 =w copy 411449477 + storew %.7404, %.7403 + %.7405 =l add %.7004, 800 + %.7406 =w copy 1691684583 + storew %.7406, %.7405 + %.7407 =l add %.7004, 804 + %.7408 =w copy 2389908307 + storew %.7408, %.7407 + %.7409 =l add %.7004, 808 + %.7410 =w copy 1691684583 + storew %.7410, %.7409 + %.7411 =l add %.7004, 812 + %.7412 =w copy 3739975818 + storew %.7412, %.7411 + %.7413 =l add %.7004, 816 + %.7414 =w copy 4121401781 + storew %.7414, %.7413 + %.7415 =l add %.7004, 820 + %.7416 =w copy 4121401781 + storew %.7416, %.7415 + %.7417 =l add %.7004, 824 + %.7418 =w copy 3739975818 + storew %.7418, %.7417 + %.7419 =l add %.7004, 828 + %.7420 =w copy 18446744073709551613 + storew %.7420, %.7419 + %.7421 =l add %.7004, 832 + %.7422 =w copy 644777404 + storew %.7422, %.7421 + %.7423 =l add %.7004, 836 + %.7424 =w copy 1925250850 + storew %.7424, %.7423 + %.7425 =l add %.7004, 840 + %.7426 =w copy 3681951840 + storew %.7426, %.7425 + %.7427 =l add %.7004, 844 + %.7428 =w copy 2934917713 + storew %.7428, %.7427 + %.7429 =l add %.7004, 848 + %.7430 =w copy 2044415521 + storew %.7430, %.7429 + %.7431 =l add %.7004, 852 + %.7432 =w copy 18446744073709551609 + storew %.7432, %.7431 + %.7433 =l add %.7004, 856 + %.7434 =w copy 2389908307 + storew %.7434, %.7433 + %.7435 =l add %.7004, 860 + %.7436 =w copy 460029231 + storew %.7436, %.7435 + %.7437 =l add %.7004, 864 + %.7438 =w copy 5 + storew %.7438, %.7437 + %.7439 =l add %.7004, 868 + %.7440 =w copy 460029231 + storew %.7440, %.7439 + %.7441 =l add %.7004, 872 + %.7442 =w copy 1 + storew %.7442, %.7441 + %.7443 =l add %.7004, 876 + %.7444 =w copy 1 + storew %.7444, %.7443 + %.7445 =l add %.7004, 880 + %.7446 =w copy 18446744073709551613 + storew %.7446, %.7445 + %.7447 =l add %.7004, 884 + %.7448 =w copy 3218957464 + storew %.7448, %.7447 + %.7449 =l add %.7004, 888 + %.7450 =w copy 3681951840 + storew %.7450, %.7449 + %.7451 =l add %.7004, 892 + %.7452 =w copy 1925250850 + storew %.7452, %.7451 + %.7453 =l add %.7004, 896 + %.7454 =w copy 644777404 + storew %.7454, %.7453 + %.7455 =l add %.7004, 900 + %.7456 =w copy 1691684583 + storew %.7456, %.7455 + %.7457 =l add %.7004, 904 + %.7458 =w copy 258848418 + storew %.7458, %.7457 + %.7459 =l add %.7004, 908 + %.7460 =w copy 0 + storew %.7460, %.7459 + %.7461 =l add %.7004, 912 + %.7462 =w copy 18446744073709551615 + storew %.7462, %.7461 + %.7463 =l add %.7004, 916 + %.7464 =w copy 3739975818 + storew %.7464, %.7463 + %.7465 =l add %.7004, 920 + %.7466 =w copy 1691684583 + storew %.7466, %.7465 + %.7467 =l add %.7004, 924 + %.7468 =w copy 2389908307 + storew %.7468, %.7467 + %.7469 =l add %.7004, 928 + %.7470 =w copy 1890112767 + storew %.7470, %.7469 + %.7471 =l add %.7004, 932 + %.7472 =w copy 1004611940 + storew %.7472, %.7471 + %.7473 =l add %.7004, 936 + %.7474 =w copy 2631950342 + storew %.7474, %.7473 + %.7475 =l add %.7004, 940 + %.7476 =w copy 1886988034 + storew %.7476, %.7475 + %.7477 =l add %.7004, 944 + %.7478 =w copy 1 + storew %.7478, %.7477 + %.7479 =l add %.7004, 948 + %.7480 =w copy 18446744073709551615 + storew %.7480, %.7479 + %.7481 =l add %.7004, 952 + %.7482 =w copy 737796084 + storew %.7482, %.7481 + %.7483 =l add %.7004, 956 + %.7484 =w copy 18446744073709551615 + storew %.7484, %.7483 + %.7485 =l add %.7004, 960 + %.7486 =w copy 18446744073709551608 + storew %.7486, %.7485 + %.7487 =l add %.7004, 964 + %.7488 =w copy 18446744073709551613 + storew %.7488, %.7487 + %.7489 =l add %.7004, 968 + %.7490 =w copy 2569114947 + storew %.7490, %.7489 + %.7491 =l add %.7004, 972 + %.7492 =w copy 927038418 + storew %.7492, %.7491 + %.7493 =l add %.7004, 976 + %.7494 =w copy 0 + storew %.7494, %.7493 + %.7495 =l add %.7004, 980 + %.7496 =w copy 2 + storew %.7496, %.7495 + %.7497 =l add %.7004, 984 + %.7498 =w copy 2934917713 + storew %.7498, %.7497 + %.7499 =l add %.7004, 988 + %.7500 =w copy 18446744073709551615 + storew %.7500, %.7499 + %.7501 =l add %.7004, 992 + %.7502 =w copy 3418309949 + storew %.7502, %.7501 + %.7503 =l add %.7004, 996 + %.7504 =w copy 2044415521 + storew %.7504, %.7503 + %.7505 =l add %.7004, 1000 + %.7506 =w copy 5 + storew %.7506, %.7505 + %.7507 =l add %.7004, 1004 + %.7508 =w copy 3644077451 + storew %.7508, %.7507 + %.7512 =w loaduw %.5325 + %.7513 =w add %.7512, 1 + storew %.7513, %.5325 + storew 0, $g_24 +@for_cond.981 + %.7514 =w loadsw $g_24 + %.7515 =w cslew %.7514, 0 + jnz %.7515, @for_body.982, @for_join.984 +@for_body.982 + %.7517 =l add %.7516, 0 + %.7518 =w copy 2322715888 + storew %.7518, %.7517 + %.7520 =l add %.7519, 0 + %.7521 =w copy 562249091 + storew %.7521, %.7520 + %.7523 =l add %.7522, 0 + %.7524 =l copy $g_185 + %.7525 =l mul 16, 1 + %.7526 =l add %.7524, %.7525 + %.7527 =l copy %.7526 + storel %.7527, %.7523 + %.7529 =l add %.7528, 0 + %.7530 =l copy $g_185 + %.7531 =l mul 40, 1 + %.7532 =l add %.7530, %.7531 + %.7533 =l copy %.7532 + storel %.7533, %.7529 + %.7535 =l add %.7534, 0 + %.7536 =l copy $g_1183 + %.7537 =l mul 40, 1 + %.7538 =l add %.7536, %.7537 + %.7539 =l copy %.7538 + storel %.7539, %.7535 + %.7541 =l add %.7540, 0 + %.7542 =l copy $g_518 + %.7543 =l mul 16, 1 + %.7544 =l add %.7542, %.7543 + %.7545 =l copy %.7544 + storel %.7545, %.7541 + %.7547 =l add %.7546, 0 + %.7548 =l copy $g_1183 + %.7549 =l mul 16, 1 + %.7550 =l add %.7548, %.7549 + %.7551 =l copy %.7550 + storel %.7551, %.7547 + %.7553 =l add %.7552, 0 + %.7554 =l copy $g_794 + %.7555 =l mul 0, 1 + %.7556 =l add %.7554, %.7555 + %.7557 =l copy %.7556 + storel %.7557, %.7553 + %.7559 =l add %.7558, 0 + %.7560 =l extsw 0 + %.7561 =l copy %.7560 + storel %.7561, %.7559 + %.7563 =l add %.7562, 0 + %.7564 =l copy $g_518 + %.7565 =l mul 40, 1 + %.7566 =l add %.7564, %.7565 + %.7567 =l copy %.7566 + storel %.7567, %.7563 + %.7569 =l add %.7568, 0 + %.7570 =l copy $g_185 + %.7571 =l mul 48, 1 + %.7572 =l add %.7570, %.7571 + %.7573 =l copy %.7572 + storel %.7573, %.7569 + %.7575 =l add %.7574, 0 + %.7576 =l extsw 0 + %.7577 =l copy %.7576 + storel %.7577, %.7575 + %.7578 =l add %.7574, 8 + %.7579 =l extsw 0 + %.7580 =l copy %.7579 + storel %.7580, %.7578 + %.7581 =l add %.7574, 16 + %.7582 =l extsw 0 + %.7583 =l copy %.7582 + storel %.7583, %.7581 + %.7584 =l add %.7574, 24 + %.7585 =l extsw 0 + %.7586 =l copy %.7585 + storel %.7586, %.7584 + %.7587 =l add %.7574, 32 + %.7588 =l extsw 0 + %.7589 =l copy %.7588 + storel %.7589, %.7587 + %.7590 =l add %.7574, 40 + %.7591 =l extsw 0 + %.7592 =l copy %.7591 + storel %.7592, %.7590 + %.7593 =l add %.7574, 48 + %.7594 =l extsw 0 + %.7595 =l copy %.7594 + storel %.7595, %.7593 + %.7596 =l add %.7574, 56 + %.7597 =l extsw 0 + %.7598 =l copy %.7597 + storel %.7598, %.7596 + %.7599 =l add %.7574, 64 + %.7600 =l extsw 0 + %.7601 =l copy %.7600 + storel %.7601, %.7599 + %.7603 =w loaduw %.7516 + %.7604 =w cnew %.7603, 0 + jnz %.7604, @if_true.985, @if_false.986 +@if_true.985 + jmp @for_join.984 +@if_false.986 + %.7605 =l extsw 3 + %.7606 =l mul %.7605, 252 + %.7607 =l add %.7004, %.7606 + %.7608 =l extsw 6 + %.7609 =l mul %.7608, 28 + %.7610 =l add %.7607, %.7609 + %.7611 =l extsw 2 + %.7612 =l mul %.7611, 4 + %.7613 =l add %.7610, %.7612 + %.7614 =w loaduw %.7613 + %.7615 =w sub %.7614, 1 + storew %.7615, %.7613 +@for_cont.983 + %.7616 =w loadsw $g_24 + %.7617 =w add %.7616, 1 + storew %.7617, $g_24 + jmp @for_cond.981 +@for_join.984 +@if_join.980 + %.7618 =w loadsh %.6850 + %.7619 =w extsh %.7618 + %.7620 =l extsw 4 + %.7621 =l mul %.7620, 4 + %.7622 =l add %.6871, %.7621 + storew %.7619, %.7622 + %.7623 =l loadl %.1 + %.7624 =w loadsw %.7623 + %.7625 =l loadl $g_1038 + %.7626 =l loadl %.7625 + %.7627 =w loaduw %.7626 + %.7628 =w loadsw %.6861 + %.7629 =w or %.7624, %.7628 + storew %.7629, %.7623 +@if_join.975 + %.7630 =l extsw 1 + %.7631 =l mul %.7630, 4 + %.7632 =l add %.5202, %.7631 + %.7633 =w loadsw %.7632 + %.7634 =l extsw %.7633 + ret %.7634 +@for_cont.892 + %.7635 =l loadl $g_82 + %.7636 =l extsw 1 + %.7637 =l sub %.7635, %.7636 + storel %.7637, $g_82 + jmp @for_cond.890 +@for_join.893 +@if_join.881 + %.7638 =w loadub %.109 + %.7639 =l extub %.7638 + ret %.7639 +} +function l $func_4(l %.1, l %.3, l %.5) { +@start.987 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 + %.6 =l alloc8 8 + storel %.5, %.6 +@body.988 + %.7 =l loadl %.2 + ret %.7 +} +function l $func_8(w %.1) { +@start.989 + %.2 =l alloc4 4 + storew %.1, %.2 + %.3 =l alloc8 8 + %.14 =l alloc8 8 + %.15 =l alloc4 20 + %.29 =l alloc8 1960 + %.877 =l alloc4 56 + %.934 =l alloc8 8 + %.936 =l alloc8 8 + %.938 =l alloc8 1568 + %.1647 =l alloc8 56 + %.1669 =l alloc8 8 + %.1675 =l alloc8 8 + %.1677 =l alloc8 8 + %.1679 =l alloc8 8 + %.1684 =l alloc8 8 + %.1688 =l alloc4 2 + %.1689 =l alloc4 2 + %.1692 =l alloc4 4 + %.1693 =l alloc4 4 + %.1694 =l alloc4 4 +@body.990 + %.4 =l add %.3, 0 + %.5 =l extsw 7 + %.6 =l mul %.5, 12 + %.7 =l add $g_13, %.6 + %.8 =l extsw 0 + %.9 =l mul %.8, 4 + %.10 =l add %.7, %.9 + %.11 =l extsw 0 + %.12 =l mul %.11, 4 + %.13 =l add %.10, %.12 + storel %.13, %.4 + %.16 =l add %.15, 0 + %.17 =l extsw 0 + %.18 =l sub %.17, 6 + %.19 =w copy %.18 + storew %.19, %.16 + %.20 =l add %.15, 4 + %.21 =w copy 0 + storew %.21, %.20 + %.22 =l add %.15, 8 + %.23 =w copy 4800 + storeh %.23, %.22 + %.24 =l add %.15, 10 + storeh 0, %.24 + %.25 =l add %.15, 12 + %.26 =w copy 2965183498 + storew %.26, %.25 + %.27 =l add %.15, 16 + %.28 =w copy 18446744073709551615 + storew %.28, %.27 + %.30 =l add %.29, 0 + %.31 =l copy $g_185 + %.32 =l mul 8, 1 + %.33 =l add %.31, %.32 + %.34 =l copy %.33 + storel %.34, %.30 + %.35 =l add %.29, 8 + %.36 =l copy $g_518 + %.37 =l mul 8, 1 + %.38 =l add %.36, %.37 + %.39 =l copy %.38 + storel %.39, %.35 + %.40 =l add %.29, 16 + %.41 =l extsw 0 + %.42 =l copy %.41 + storel %.42, %.40 + %.43 =l add %.29, 24 + %.44 =l copy $g_518 + %.45 =l mul 8, 1 + %.46 =l add %.44, %.45 + %.47 =l copy %.46 + storel %.47, %.43 + %.48 =l add %.29, 32 + %.49 =l extsw 0 + %.50 =l copy %.49 + storel %.50, %.48 + %.51 =l add %.29, 40 + %.52 =l extsw 0 + %.53 =l copy %.52 + storel %.53, %.51 + %.54 =l add %.29, 48 + %.55 =l copy $g_265 + %.56 =l mul 8, 1 + %.57 =l add %.55, %.56 + %.58 =l copy %.57 + storel %.58, %.54 + %.59 =l add %.29, 56 + storel $g_82, %.59 + %.60 =l add %.29, 64 + %.61 =l copy $g_518 + %.62 =l mul 8, 1 + %.63 =l add %.61, %.62 + %.64 =l copy %.63 + storel %.64, %.60 + %.65 =l add %.29, 72 + %.66 =l extsw 0 + %.67 =l copy %.66 + storel %.67, %.65 + %.68 =l add %.29, 80 + storel $g_82, %.68 + %.69 =l add %.29, 88 + storel $g_80, %.69 + %.70 =l add %.29, 96 + storel $g_82, %.70 + %.71 =l add %.29, 104 + %.72 =l extsw 0 + %.73 =l copy %.72 + storel %.73, %.71 + %.74 =l add %.29, 112 + %.75 =l copy $g_1183 + %.76 =l mul 8, 1 + %.77 =l add %.75, %.76 + %.78 =l copy %.77 + storel %.78, %.74 + %.79 =l add %.29, 120 + %.80 =l extsw 0 + %.81 =l copy %.80 + storel %.81, %.79 + %.82 =l add %.29, 128 + %.83 =l copy $g_265 + %.84 =l mul 8, 1 + %.85 =l add %.83, %.84 + %.86 =l copy %.85 + storel %.86, %.82 + %.87 =l add %.29, 136 + %.88 =l copy $g_185 + %.89 =l mul 8, 1 + %.90 =l add %.88, %.89 + %.91 =l copy %.90 + storel %.91, %.87 + %.92 =l add %.29, 144 + %.93 =l copy $g_185 + %.94 =l mul 8, 1 + %.95 =l add %.93, %.94 + %.96 =l copy %.95 + storel %.96, %.92 + %.97 =l add %.29, 152 + %.98 =l copy $g_185 + %.99 =l mul 8, 1 + %.100 =l add %.98, %.99 + %.101 =l copy %.100 + storel %.101, %.97 + %.102 =l add %.29, 160 + %.103 =l extsw 0 + %.104 =l copy %.103 + storel %.104, %.102 + %.105 =l add %.29, 168 + storel $g_80, %.105 + %.106 =l add %.29, 176 + %.107 =l extsw 0 + %.108 =l copy %.107 + storel %.108, %.106 + %.109 =l add %.29, 184 + storel $g_80, %.109 + %.110 =l add %.29, 192 + %.111 =l copy $g_518 + %.112 =l mul 8, 1 + %.113 =l add %.111, %.112 + %.114 =l copy %.113 + storel %.114, %.110 + %.115 =l add %.29, 200 + %.116 =l copy $g_185 + %.117 =l mul 8, 1 + %.118 =l add %.116, %.117 + %.119 =l copy %.118 + storel %.119, %.115 + %.120 =l add %.29, 208 + %.121 =l copy $g_185 + %.122 =l mul 8, 1 + %.123 =l add %.121, %.122 + %.124 =l copy %.123 + storel %.124, %.120 + %.125 =l add %.29, 216 + %.126 =l copy $g_518 + %.127 =l mul 8, 1 + %.128 =l add %.126, %.127 + %.129 =l copy %.128 + storel %.129, %.125 + %.130 =l add %.29, 224 + storel $g_80, %.130 + %.131 =l add %.29, 232 + %.132 =l copy $g_265 + %.133 =l mul 8, 1 + %.134 =l add %.132, %.133 + %.135 =l copy %.134 + storel %.135, %.131 + %.136 =l add %.29, 240 + storel $g_80, %.136 + %.137 =l add %.29, 248 + %.138 =l copy $g_185 + %.139 =l mul 8, 1 + %.140 =l add %.138, %.139 + %.141 =l copy %.140 + storel %.141, %.137 + %.142 =l add %.29, 256 + %.143 =l copy $g_185 + %.144 =l mul 8, 1 + %.145 =l add %.143, %.144 + %.146 =l copy %.145 + storel %.146, %.142 + %.147 =l add %.29, 264 + %.148 =l copy $g_1183 + %.149 =l mul 8, 1 + %.150 =l add %.148, %.149 + %.151 =l copy %.150 + storel %.151, %.147 + %.152 =l add %.29, 272 + %.153 =l copy $g_518 + %.154 =l mul 8, 1 + %.155 =l add %.153, %.154 + %.156 =l copy %.155 + storel %.156, %.152 + %.157 =l add %.29, 280 + storel $g_80, %.157 + %.158 =l add %.29, 288 + storel $g_80, %.158 + %.159 =l add %.29, 296 + %.160 =l copy $g_518 + %.161 =l mul 8, 1 + %.162 =l add %.160, %.161 + %.163 =l copy %.162 + storel %.163, %.159 + %.164 =l add %.29, 304 + %.165 =l copy $g_518 + %.166 =l mul 8, 1 + %.167 =l add %.165, %.166 + %.168 =l copy %.167 + storel %.168, %.164 + %.169 =l add %.29, 312 + %.170 =l copy $g_518 + %.171 =l mul 8, 1 + %.172 =l add %.170, %.171 + %.173 =l copy %.172 + storel %.173, %.169 + %.174 =l add %.29, 320 + %.175 =l copy $g_185 + %.176 =l mul 8, 1 + %.177 =l add %.175, %.176 + %.178 =l copy %.177 + storel %.178, %.174 + %.179 =l add %.29, 328 + %.180 =l extsw 0 + %.181 =l copy %.180 + storel %.181, %.179 + %.182 =l add %.29, 336 + %.183 =l copy $g_1183 + %.184 =l mul 8, 1 + %.185 =l add %.183, %.184 + %.186 =l copy %.185 + storel %.186, %.182 + %.187 =l add %.29, 344 + %.188 =l copy $g_265 + %.189 =l mul 8, 1 + %.190 =l add %.188, %.189 + %.191 =l copy %.190 + storel %.191, %.187 + %.192 =l add %.29, 352 + %.193 =l copy $g_185 + %.194 =l mul 8, 1 + %.195 =l add %.193, %.194 + %.196 =l copy %.195 + storel %.196, %.192 + %.197 =l add %.29, 360 + %.198 =l copy $g_1183 + %.199 =l mul 8, 1 + %.200 =l add %.198, %.199 + %.201 =l copy %.200 + storel %.201, %.197 + %.202 =l add %.29, 368 + %.203 =l extsw 0 + %.204 =l copy %.203 + storel %.204, %.202 + %.205 =l add %.29, 376 + %.206 =l copy $g_1183 + %.207 =l mul 8, 1 + %.208 =l add %.206, %.207 + %.209 =l copy %.208 + storel %.209, %.205 + %.210 =l add %.29, 384 + %.211 =l copy $g_185 + %.212 =l mul 8, 1 + %.213 =l add %.211, %.212 + %.214 =l copy %.213 + storel %.214, %.210 + %.215 =l add %.29, 392 + storel $g_80, %.215 + %.216 =l add %.29, 400 + %.217 =l extsw 0 + %.218 =l copy %.217 + storel %.218, %.216 + %.219 =l add %.29, 408 + %.220 =l extsw 0 + %.221 =l copy %.220 + storel %.221, %.219 + %.222 =l add %.29, 416 + %.223 =l copy $g_185 + %.224 =l mul 8, 1 + %.225 =l add %.223, %.224 + %.226 =l copy %.225 + storel %.226, %.222 + %.227 =l add %.29, 424 + %.228 =l copy $g_185 + %.229 =l mul 8, 1 + %.230 =l add %.228, %.229 + %.231 =l copy %.230 + storel %.231, %.227 + %.232 =l add %.29, 432 + %.233 =l copy $g_185 + %.234 =l mul 8, 1 + %.235 =l add %.233, %.234 + %.236 =l copy %.235 + storel %.236, %.232 + %.237 =l add %.29, 440 + %.238 =l extsw 0 + %.239 =l copy %.238 + storel %.239, %.237 + %.240 =l add %.29, 448 + %.241 =l copy $g_185 + %.242 =l mul 8, 1 + %.243 =l add %.241, %.242 + %.244 =l copy %.243 + storel %.244, %.240 + %.245 =l add %.29, 456 + %.246 =l copy $g_185 + %.247 =l mul 8, 1 + %.248 =l add %.246, %.247 + %.249 =l copy %.248 + storel %.249, %.245 + %.250 =l add %.29, 464 + %.251 =l extsw 0 + %.252 =l copy %.251 + storel %.252, %.250 + %.253 =l add %.29, 472 + %.254 =l copy $g_185 + %.255 =l mul 8, 1 + %.256 =l add %.254, %.255 + %.257 =l copy %.256 + storel %.257, %.253 + %.258 =l add %.29, 480 + %.259 =l copy $g_1183 + %.260 =l mul 8, 1 + %.261 =l add %.259, %.260 + %.262 =l copy %.261 + storel %.262, %.258 + %.263 =l add %.29, 488 + %.264 =l copy $g_185 + %.265 =l mul 8, 1 + %.266 =l add %.264, %.265 + %.267 =l copy %.266 + storel %.267, %.263 + %.268 =l add %.29, 496 + %.269 =l copy $g_265 + %.270 =l mul 8, 1 + %.271 =l add %.269, %.270 + %.272 =l copy %.271 + storel %.272, %.268 + %.273 =l add %.29, 504 + %.274 =l extsw 0 + %.275 =l copy %.274 + storel %.275, %.273 + %.276 =l add %.29, 512 + %.277 =l copy $g_1183 + %.278 =l mul 8, 1 + %.279 =l add %.277, %.278 + %.280 =l copy %.279 + storel %.280, %.276 + %.281 =l add %.29, 520 + %.282 =l copy $g_518 + %.283 =l mul 8, 1 + %.284 =l add %.282, %.283 + %.285 =l copy %.284 + storel %.285, %.281 + %.286 =l add %.29, 528 + storel $g_80, %.286 + %.287 =l add %.29, 536 + %.288 =l extsw 0 + %.289 =l copy %.288 + storel %.289, %.287 + %.290 =l add %.29, 544 + storel $g_82, %.290 + %.291 =l add %.29, 552 + %.292 =l copy $g_518 + %.293 =l mul 8, 1 + %.294 =l add %.292, %.293 + %.295 =l copy %.294 + storel %.295, %.291 + %.296 =l add %.29, 560 + %.297 =l extsw 0 + %.298 =l copy %.297 + storel %.298, %.296 + %.299 =l add %.29, 568 + storel $g_80, %.299 + %.300 =l add %.29, 576 + %.301 =l copy $g_1183 + %.302 =l mul 8, 1 + %.303 =l add %.301, %.302 + %.304 =l copy %.303 + storel %.304, %.300 + %.305 =l add %.29, 584 + %.306 =l copy $g_1183 + %.307 =l mul 8, 1 + %.308 =l add %.306, %.307 + %.309 =l copy %.308 + storel %.309, %.305 + %.310 =l add %.29, 592 + storel $g_80, %.310 + %.311 =l add %.29, 600 + %.312 =l extsw 0 + %.313 =l copy %.312 + storel %.313, %.311 + %.314 =l add %.29, 608 + %.315 =l copy $g_518 + %.316 =l mul 8, 1 + %.317 =l add %.315, %.316 + %.318 =l copy %.317 + storel %.318, %.314 + %.319 =l add %.29, 616 + %.320 =l extsw 0 + %.321 =l copy %.320 + storel %.321, %.319 + %.322 =l add %.29, 624 + storel $g_80, %.322 + %.323 =l add %.29, 632 + %.324 =l copy $g_185 + %.325 =l mul 8, 1 + %.326 =l add %.324, %.325 + %.327 =l copy %.326 + storel %.327, %.323 + %.328 =l add %.29, 640 + %.329 =l copy $g_518 + %.330 =l mul 8, 1 + %.331 =l add %.329, %.330 + %.332 =l copy %.331 + storel %.332, %.328 + %.333 =l add %.29, 648 + %.334 =l extsw 0 + %.335 =l copy %.334 + storel %.335, %.333 + %.336 =l add %.29, 656 + storel $g_82, %.336 + %.337 =l add %.29, 664 + storel $g_80, %.337 + %.338 =l add %.29, 672 + %.339 =l copy $g_1183 + %.340 =l mul 8, 1 + %.341 =l add %.339, %.340 + %.342 =l copy %.341 + storel %.342, %.338 + %.343 =l add %.29, 680 + %.344 =l copy $g_185 + %.345 =l mul 8, 1 + %.346 =l add %.344, %.345 + %.347 =l copy %.346 + storel %.347, %.343 + %.348 =l add %.29, 688 + %.349 =l copy $g_1183 + %.350 =l mul 8, 1 + %.351 =l add %.349, %.350 + %.352 =l copy %.351 + storel %.352, %.348 + %.353 =l add %.29, 696 + %.354 =l extsw 0 + %.355 =l copy %.354 + storel %.355, %.353 + %.356 =l add %.29, 704 + %.357 =l copy $g_518 + %.358 =l mul 8, 1 + %.359 =l add %.357, %.358 + %.360 =l copy %.359 + storel %.360, %.356 + %.361 =l add %.29, 712 + %.362 =l copy $g_265 + %.363 =l mul 8, 1 + %.364 =l add %.362, %.363 + %.365 =l copy %.364 + storel %.365, %.361 + %.366 =l add %.29, 720 + %.367 =l copy $g_185 + %.368 =l mul 8, 1 + %.369 =l add %.367, %.368 + %.370 =l copy %.369 + storel %.370, %.366 + %.371 =l add %.29, 728 + %.372 =l extsw 0 + %.373 =l copy %.372 + storel %.373, %.371 + %.374 =l add %.29, 736 + %.375 =l copy $g_518 + %.376 =l mul 8, 1 + %.377 =l add %.375, %.376 + %.378 =l copy %.377 + storel %.378, %.374 + %.379 =l add %.29, 744 + %.380 =l copy $g_1183 + %.381 =l mul 8, 1 + %.382 =l add %.380, %.381 + %.383 =l copy %.382 + storel %.383, %.379 + %.384 =l add %.29, 752 + %.385 =l copy $g_518 + %.386 =l mul 8, 1 + %.387 =l add %.385, %.386 + %.388 =l copy %.387 + storel %.388, %.384 + %.389 =l add %.29, 760 + %.390 =l extsw 0 + %.391 =l copy %.390 + storel %.391, %.389 + %.392 =l add %.29, 768 + %.393 =l copy $g_185 + %.394 =l mul 8, 1 + %.395 =l add %.393, %.394 + %.396 =l copy %.395 + storel %.396, %.392 + %.397 =l add %.29, 776 + storel $g_82, %.397 + %.398 =l add %.29, 784 + %.399 =l extsw 0 + %.400 =l copy %.399 + storel %.400, %.398 + %.401 =l add %.29, 792 + %.402 =l extsw 0 + %.403 =l copy %.402 + storel %.403, %.401 + %.404 =l add %.29, 800 + %.405 =l copy $g_185 + %.406 =l mul 8, 1 + %.407 =l add %.405, %.406 + %.408 =l copy %.407 + storel %.408, %.404 + %.409 =l add %.29, 808 + storel $g_80, %.409 + %.410 =l add %.29, 816 + %.411 =l copy $g_1183 + %.412 =l mul 8, 1 + %.413 =l add %.411, %.412 + %.414 =l copy %.413 + storel %.414, %.410 + %.415 =l add %.29, 824 + %.416 =l copy $g_185 + %.417 =l mul 8, 1 + %.418 =l add %.416, %.417 + %.419 =l copy %.418 + storel %.419, %.415 + %.420 =l add %.29, 832 + storel $g_82, %.420 + %.421 =l add %.29, 840 + storel $g_82, %.421 + %.422 =l add %.29, 848 + storel $g_80, %.422 + %.423 =l add %.29, 856 + %.424 =l copy $g_265 + %.425 =l mul 8, 1 + %.426 =l add %.424, %.425 + %.427 =l copy %.426 + storel %.427, %.423 + %.428 =l add %.29, 864 + %.429 =l copy $g_1183 + %.430 =l mul 8, 1 + %.431 =l add %.429, %.430 + %.432 =l copy %.431 + storel %.432, %.428 + %.433 =l add %.29, 872 + %.434 =l copy $g_518 + %.435 =l mul 8, 1 + %.436 =l add %.434, %.435 + %.437 =l copy %.436 + storel %.437, %.433 + %.438 =l add %.29, 880 + storel $g_82, %.438 + %.439 =l add %.29, 888 + storel $g_80, %.439 + %.440 =l add %.29, 896 + %.441 =l extsw 0 + %.442 =l copy %.441 + storel %.442, %.440 + %.443 =l add %.29, 904 + storel $g_80, %.443 + %.444 =l add %.29, 912 + storel $g_82, %.444 + %.445 =l add %.29, 920 + %.446 =l copy $g_265 + %.447 =l mul 8, 1 + %.448 =l add %.446, %.447 + %.449 =l copy %.448 + storel %.449, %.445 + %.450 =l add %.29, 928 + storel $g_82, %.450 + %.451 =l add %.29, 936 + %.452 =l copy $g_265 + %.453 =l mul 8, 1 + %.454 =l add %.452, %.453 + %.455 =l copy %.454 + storel %.455, %.451 + %.456 =l add %.29, 944 + storel $g_82, %.456 + %.457 =l add %.29, 952 + storel $g_82, %.457 + %.458 =l add %.29, 960 + storel $g_82, %.458 + %.459 =l add %.29, 968 + %.460 =l copy $g_518 + %.461 =l mul 8, 1 + %.462 =l add %.460, %.461 + %.463 =l copy %.462 + storel %.463, %.459 + %.464 =l add %.29, 976 + %.465 =l copy $g_1183 + %.466 =l mul 8, 1 + %.467 =l add %.465, %.466 + %.468 =l copy %.467 + storel %.468, %.464 + %.469 =l add %.29, 984 + storel $g_82, %.469 + %.470 =l add %.29, 992 + %.471 =l copy $g_185 + %.472 =l mul 8, 1 + %.473 =l add %.471, %.472 + %.474 =l copy %.473 + storel %.474, %.470 + %.475 =l add %.29, 1000 + %.476 =l extsw 0 + %.477 =l copy %.476 + storel %.477, %.475 + %.478 =l add %.29, 1008 + %.479 =l copy $g_265 + %.480 =l mul 8, 1 + %.481 =l add %.479, %.480 + %.482 =l copy %.481 + storel %.482, %.478 + %.483 =l add %.29, 1016 + storel $g_82, %.483 + %.484 =l add %.29, 1024 + %.485 =l copy $g_1183 + %.486 =l mul 8, 1 + %.487 =l add %.485, %.486 + %.488 =l copy %.487 + storel %.488, %.484 + %.489 =l add %.29, 1032 + %.490 =l copy $g_1183 + %.491 =l mul 8, 1 + %.492 =l add %.490, %.491 + %.493 =l copy %.492 + storel %.493, %.489 + %.494 =l add %.29, 1040 + %.495 =l copy $g_265 + %.496 =l mul 8, 1 + %.497 =l add %.495, %.496 + %.498 =l copy %.497 + storel %.498, %.494 + %.499 =l add %.29, 1048 + %.500 =l copy $g_265 + %.501 =l mul 8, 1 + %.502 =l add %.500, %.501 + %.503 =l copy %.502 + storel %.503, %.499 + %.504 =l add %.29, 1056 + %.505 =l copy $g_1183 + %.506 =l mul 8, 1 + %.507 =l add %.505, %.506 + %.508 =l copy %.507 + storel %.508, %.504 + %.509 =l add %.29, 1064 + %.510 =l copy $g_1183 + %.511 =l mul 8, 1 + %.512 =l add %.510, %.511 + %.513 =l copy %.512 + storel %.513, %.509 + %.514 =l add %.29, 1072 + %.515 =l copy $g_185 + %.516 =l mul 8, 1 + %.517 =l add %.515, %.516 + %.518 =l copy %.517 + storel %.518, %.514 + %.519 =l add %.29, 1080 + storel $g_82, %.519 + %.520 =l add %.29, 1088 + %.521 =l copy $g_518 + %.522 =l mul 8, 1 + %.523 =l add %.521, %.522 + %.524 =l copy %.523 + storel %.524, %.520 + %.525 =l add %.29, 1096 + storel $g_82, %.525 + %.526 =l add %.29, 1104 + %.527 =l copy $g_1183 + %.528 =l mul 8, 1 + %.529 =l add %.527, %.528 + %.530 =l copy %.529 + storel %.530, %.526 + %.531 =l add %.29, 1112 + storel $g_80, %.531 + %.532 =l add %.29, 1120 + storel $g_80, %.532 + %.533 =l add %.29, 1128 + %.534 =l copy $g_185 + %.535 =l mul 8, 1 + %.536 =l add %.534, %.535 + %.537 =l copy %.536 + storel %.537, %.533 + %.538 =l add %.29, 1136 + %.539 =l copy $g_518 + %.540 =l mul 8, 1 + %.541 =l add %.539, %.540 + %.542 =l copy %.541 + storel %.542, %.538 + %.543 =l add %.29, 1144 + %.544 =l copy $g_518 + %.545 =l mul 8, 1 + %.546 =l add %.544, %.545 + %.547 =l copy %.546 + storel %.547, %.543 + %.548 =l add %.29, 1152 + storel $g_82, %.548 + %.549 =l add %.29, 1160 + %.550 =l copy $g_1183 + %.551 =l mul 8, 1 + %.552 =l add %.550, %.551 + %.553 =l copy %.552 + storel %.553, %.549 + %.554 =l add %.29, 1168 + %.555 =l copy $g_185 + %.556 =l mul 8, 1 + %.557 =l add %.555, %.556 + %.558 =l copy %.557 + storel %.558, %.554 + %.559 =l add %.29, 1176 + %.560 =l copy $g_185 + %.561 =l mul 8, 1 + %.562 =l add %.560, %.561 + %.563 =l copy %.562 + storel %.563, %.559 + %.564 =l add %.29, 1184 + storel $g_82, %.564 + %.565 =l add %.29, 1192 + storel $g_80, %.565 + %.566 =l add %.29, 1200 + %.567 =l copy $g_185 + %.568 =l mul 8, 1 + %.569 =l add %.567, %.568 + %.570 =l copy %.569 + storel %.570, %.566 + %.571 =l add %.29, 1208 + %.572 =l copy $g_518 + %.573 =l mul 8, 1 + %.574 =l add %.572, %.573 + %.575 =l copy %.574 + storel %.575, %.571 + %.576 =l add %.29, 1216 + storel $g_82, %.576 + %.577 =l add %.29, 1224 + storel $g_82, %.577 + %.578 =l add %.29, 1232 + %.579 =l copy $g_265 + %.580 =l mul 8, 1 + %.581 =l add %.579, %.580 + %.582 =l copy %.581 + storel %.582, %.578 + %.583 =l add %.29, 1240 + %.584 =l copy $g_265 + %.585 =l mul 8, 1 + %.586 =l add %.584, %.585 + %.587 =l copy %.586 + storel %.587, %.583 + %.588 =l add %.29, 1248 + %.589 =l copy $g_1183 + %.590 =l mul 8, 1 + %.591 =l add %.589, %.590 + %.592 =l copy %.591 + storel %.592, %.588 + %.593 =l add %.29, 1256 + %.594 =l copy $g_185 + %.595 =l mul 8, 1 + %.596 =l add %.594, %.595 + %.597 =l copy %.596 + storel %.597, %.593 + %.598 =l add %.29, 1264 + %.599 =l copy $g_1183 + %.600 =l mul 8, 1 + %.601 =l add %.599, %.600 + %.602 =l copy %.601 + storel %.602, %.598 + %.603 =l add %.29, 1272 + %.604 =l copy $g_265 + %.605 =l mul 8, 1 + %.606 =l add %.604, %.605 + %.607 =l copy %.606 + storel %.607, %.603 + %.608 =l add %.29, 1280 + %.609 =l copy $g_265 + %.610 =l mul 8, 1 + %.611 =l add %.609, %.610 + %.612 =l copy %.611 + storel %.612, %.608 + %.613 =l add %.29, 1288 + %.614 =l extsw 0 + %.615 =l copy %.614 + storel %.615, %.613 + %.616 =l add %.29, 1296 + storel $g_82, %.616 + %.617 =l add %.29, 1304 + %.618 =l extsw 0 + %.619 =l copy %.618 + storel %.619, %.617 + %.620 =l add %.29, 1312 + storel $g_82, %.620 + %.621 =l add %.29, 1320 + %.622 =l extsw 0 + %.623 =l copy %.622 + storel %.623, %.621 + %.624 =l add %.29, 1328 + %.625 =l copy $g_185 + %.626 =l mul 8, 1 + %.627 =l add %.625, %.626 + %.628 =l copy %.627 + storel %.628, %.624 + %.629 =l add %.29, 1336 + storel $g_82, %.629 + %.630 =l add %.29, 1344 + %.631 =l copy $g_518 + %.632 =l mul 8, 1 + %.633 =l add %.631, %.632 + %.634 =l copy %.633 + storel %.634, %.630 + %.635 =l add %.29, 1352 + %.636 =l copy $g_185 + %.637 =l mul 8, 1 + %.638 =l add %.636, %.637 + %.639 =l copy %.638 + storel %.639, %.635 + %.640 =l add %.29, 1360 + %.641 =l copy $g_265 + %.642 =l mul 8, 1 + %.643 =l add %.641, %.642 + %.644 =l copy %.643 + storel %.644, %.640 + %.645 =l add %.29, 1368 + storel $g_80, %.645 + %.646 =l add %.29, 1376 + %.647 =l copy $g_518 + %.648 =l mul 8, 1 + %.649 =l add %.647, %.648 + %.650 =l copy %.649 + storel %.650, %.646 + %.651 =l add %.29, 1384 + %.652 =l extsw 0 + %.653 =l copy %.652 + storel %.653, %.651 + %.654 =l add %.29, 1392 + storel $g_82, %.654 + %.655 =l add %.29, 1400 + storel $g_80, %.655 + %.656 =l add %.29, 1408 + storel $g_80, %.656 + %.657 =l add %.29, 1416 + storel $g_82, %.657 + %.658 =l add %.29, 1424 + %.659 =l copy $g_265 + %.660 =l mul 8, 1 + %.661 =l add %.659, %.660 + %.662 =l copy %.661 + storel %.662, %.658 + %.663 =l add %.29, 1432 + storel $g_80, %.663 + %.664 =l add %.29, 1440 + %.665 =l copy $g_518 + %.666 =l mul 8, 1 + %.667 =l add %.665, %.666 + %.668 =l copy %.667 + storel %.668, %.664 + %.669 =l add %.29, 1448 + storel $g_80, %.669 + %.670 =l add %.29, 1456 + %.671 =l copy $g_518 + %.672 =l mul 8, 1 + %.673 =l add %.671, %.672 + %.674 =l copy %.673 + storel %.674, %.670 + %.675 =l add %.29, 1464 + storel $g_80, %.675 + %.676 =l add %.29, 1472 + %.677 =l copy $g_1183 + %.678 =l mul 8, 1 + %.679 =l add %.677, %.678 + %.680 =l copy %.679 + storel %.680, %.676 + %.681 =l add %.29, 1480 + %.682 =l extsw 0 + %.683 =l copy %.682 + storel %.683, %.681 + %.684 =l add %.29, 1488 + %.685 =l extsw 0 + %.686 =l copy %.685 + storel %.686, %.684 + %.687 =l add %.29, 1496 + %.688 =l copy $g_185 + %.689 =l mul 8, 1 + %.690 =l add %.688, %.689 + %.691 =l copy %.690 + storel %.691, %.687 + %.692 =l add %.29, 1504 + storel $g_80, %.692 + %.693 =l add %.29, 1512 + %.694 =l extsw 0 + %.695 =l copy %.694 + storel %.695, %.693 + %.696 =l add %.29, 1520 + %.697 =l copy $g_185 + %.698 =l mul 8, 1 + %.699 =l add %.697, %.698 + %.700 =l copy %.699 + storel %.700, %.696 + %.701 =l add %.29, 1528 + storel $g_82, %.701 + %.702 =l add %.29, 1536 + %.703 =l copy $g_1183 + %.704 =l mul 8, 1 + %.705 =l add %.703, %.704 + %.706 =l copy %.705 + storel %.706, %.702 + %.707 =l add %.29, 1544 + %.708 =l copy $g_518 + %.709 =l mul 8, 1 + %.710 =l add %.708, %.709 + %.711 =l copy %.710 + storel %.711, %.707 + %.712 =l add %.29, 1552 + %.713 =l extsw 0 + %.714 =l copy %.713 + storel %.714, %.712 + %.715 =l add %.29, 1560 + %.716 =l extsw 0 + %.717 =l copy %.716 + storel %.717, %.715 + %.718 =l add %.29, 1568 + %.719 =l copy $g_265 + %.720 =l mul 8, 1 + %.721 =l add %.719, %.720 + %.722 =l copy %.721 + storel %.722, %.718 + %.723 =l add %.29, 1576 + storel $g_80, %.723 + %.724 =l add %.29, 1584 + %.725 =l copy $g_185 + %.726 =l mul 8, 1 + %.727 =l add %.725, %.726 + %.728 =l copy %.727 + storel %.728, %.724 + %.729 =l add %.29, 1592 + %.730 =l copy $g_518 + %.731 =l mul 8, 1 + %.732 =l add %.730, %.731 + %.733 =l copy %.732 + storel %.733, %.729 + %.734 =l add %.29, 1600 + %.735 =l copy $g_185 + %.736 =l mul 8, 1 + %.737 =l add %.735, %.736 + %.738 =l copy %.737 + storel %.738, %.734 + %.739 =l add %.29, 1608 + %.740 =l copy $g_265 + %.741 =l mul 8, 1 + %.742 =l add %.740, %.741 + %.743 =l copy %.742 + storel %.743, %.739 + %.744 =l add %.29, 1616 + storel $g_82, %.744 + %.745 =l add %.29, 1624 + %.746 =l copy $g_185 + %.747 =l mul 8, 1 + %.748 =l add %.746, %.747 + %.749 =l copy %.748 + storel %.749, %.745 + %.750 =l add %.29, 1632 + %.751 =l extsw 0 + %.752 =l copy %.751 + storel %.752, %.750 + %.753 =l add %.29, 1640 + storel $g_80, %.753 + %.754 =l add %.29, 1648 + storel $g_82, %.754 + %.755 =l add %.29, 1656 + storel $g_82, %.755 + %.756 =l add %.29, 1664 + storel $g_80, %.756 + %.757 =l add %.29, 1672 + %.758 =l extsw 0 + %.759 =l copy %.758 + storel %.759, %.757 + %.760 =l add %.29, 1680 + storel $g_80, %.760 + %.761 =l add %.29, 1688 + %.762 =l copy $g_185 + %.763 =l mul 8, 1 + %.764 =l add %.762, %.763 + %.765 =l copy %.764 + storel %.765, %.761 + %.766 =l add %.29, 1696 + %.767 =l copy $g_518 + %.768 =l mul 8, 1 + %.769 =l add %.767, %.768 + %.770 =l copy %.769 + storel %.770, %.766 + %.771 =l add %.29, 1704 + %.772 =l extsw 0 + %.773 =l copy %.772 + storel %.773, %.771 + %.774 =l add %.29, 1712 + storel $g_82, %.774 + %.775 =l add %.29, 1720 + %.776 =l copy $g_518 + %.777 =l mul 8, 1 + %.778 =l add %.776, %.777 + %.779 =l copy %.778 + storel %.779, %.775 + %.780 =l add %.29, 1728 + %.781 =l extsw 0 + %.782 =l copy %.781 + storel %.782, %.780 + %.783 =l add %.29, 1736 + %.784 =l copy $g_1183 + %.785 =l mul 8, 1 + %.786 =l add %.784, %.785 + %.787 =l copy %.786 + storel %.787, %.783 + %.788 =l add %.29, 1744 + %.789 =l copy $g_518 + %.790 =l mul 8, 1 + %.791 =l add %.789, %.790 + %.792 =l copy %.791 + storel %.792, %.788 + %.793 =l add %.29, 1752 + storel $g_80, %.793 + %.794 =l add %.29, 1760 + storel $g_82, %.794 + %.795 =l add %.29, 1768 + %.796 =l extsw 0 + %.797 =l copy %.796 + storel %.797, %.795 + %.798 =l add %.29, 1776 + %.799 =l copy $g_518 + %.800 =l mul 8, 1 + %.801 =l add %.799, %.800 + %.802 =l copy %.801 + storel %.802, %.798 + %.803 =l add %.29, 1784 + storel $g_82, %.803 + %.804 =l add %.29, 1792 + %.805 =l copy $g_265 + %.806 =l mul 8, 1 + %.807 =l add %.805, %.806 + %.808 =l copy %.807 + storel %.808, %.804 + %.809 =l add %.29, 1800 + %.810 =l copy $g_185 + %.811 =l mul 8, 1 + %.812 =l add %.810, %.811 + %.813 =l copy %.812 + storel %.813, %.809 + %.814 =l add %.29, 1808 + %.815 =l copy $g_1183 + %.816 =l mul 8, 1 + %.817 =l add %.815, %.816 + %.818 =l copy %.817 + storel %.818, %.814 + %.819 =l add %.29, 1816 + %.820 =l extsw 0 + %.821 =l copy %.820 + storel %.821, %.819 + %.822 =l add %.29, 1824 + %.823 =l copy $g_1183 + %.824 =l mul 8, 1 + %.825 =l add %.823, %.824 + %.826 =l copy %.825 + storel %.826, %.822 + %.827 =l add %.29, 1832 + %.828 =l copy $g_185 + %.829 =l mul 8, 1 + %.830 =l add %.828, %.829 + %.831 =l copy %.830 + storel %.831, %.827 + %.832 =l add %.29, 1840 + %.833 =l extsw 0 + %.834 =l copy %.833 + storel %.834, %.832 + %.835 =l add %.29, 1848 + storel $g_82, %.835 + %.836 =l add %.29, 1856 + storel $g_82, %.836 + %.837 =l add %.29, 1864 + %.838 =l copy $g_265 + %.839 =l mul 8, 1 + %.840 =l add %.838, %.839 + %.841 =l copy %.840 + storel %.841, %.837 + %.842 =l add %.29, 1872 + storel $g_82, %.842 + %.843 =l add %.29, 1880 + %.844 =l copy $g_265 + %.845 =l mul 8, 1 + %.846 =l add %.844, %.845 + %.847 =l copy %.846 + storel %.847, %.843 + %.848 =l add %.29, 1888 + %.849 =l copy $g_185 + %.850 =l mul 8, 1 + %.851 =l add %.849, %.850 + %.852 =l copy %.851 + storel %.852, %.848 + %.853 =l add %.29, 1896 + storel $g_82, %.853 + %.854 =l add %.29, 1904 + %.855 =l extsw 0 + %.856 =l copy %.855 + storel %.856, %.854 + %.857 =l add %.29, 1912 + storel $g_82, %.857 + %.858 =l add %.29, 1920 + %.859 =l extsw 0 + %.860 =l copy %.859 + storel %.860, %.858 + %.861 =l add %.29, 1928 + %.862 =l copy $g_518 + %.863 =l mul 8, 1 + %.864 =l add %.862, %.863 + %.865 =l copy %.864 + storel %.865, %.861 + %.866 =l add %.29, 1936 + storel $g_80, %.866 + %.867 =l add %.29, 1944 + %.868 =l copy $g_265 + %.869 =l mul 8, 1 + %.870 =l add %.868, %.869 + %.871 =l copy %.870 + storel %.871, %.867 + %.872 =l add %.29, 1952 + %.873 =l copy $g_185 + %.874 =l mul 8, 1 + %.875 =l add %.873, %.874 + %.876 =l copy %.875 + storel %.876, %.872 + %.878 =l add %.877, 0 + %.879 =w copy 57862 + storeh %.879, %.878 + %.880 =l add %.877, 2 + %.881 =w copy 0 + storeh %.881, %.880 + %.882 =l add %.877, 4 + %.883 =w copy 43252 + storeh %.883, %.882 + %.884 =l add %.877, 6 + %.885 =w copy 43252 + storeh %.885, %.884 + %.886 =l add %.877, 8 + %.887 =w copy 0 + storeh %.887, %.886 + %.888 =l add %.877, 10 + %.889 =w copy 57862 + storeh %.889, %.888 + %.890 =l add %.877, 12 + %.891 =w copy 0 + storeh %.891, %.890 + %.892 =l add %.877, 14 + %.893 =w copy 9 + storeh %.893, %.892 + %.894 =l add %.877, 16 + %.895 =w copy 1 + storeh %.895, %.894 + %.896 =l add %.877, 18 + %.897 =w copy 1 + storeh %.897, %.896 + %.898 =l add %.877, 20 + %.899 =w copy 9 + storeh %.899, %.898 + %.900 =l add %.877, 22 + %.901 =w copy 41442 + storeh %.901, %.900 + %.902 =l add %.877, 24 + %.903 =w copy 9 + storeh %.903, %.902 + %.904 =l add %.877, 26 + %.905 =w copy 1 + storeh %.905, %.904 + %.906 =l add %.877, 28 + %.907 =w copy 7 + storeh %.907, %.906 + %.908 =l add %.877, 30 + %.909 =w copy 7 + storeh %.909, %.908 + %.910 =l add %.877, 32 + %.911 =w copy 57862 + storeh %.911, %.910 + %.912 =l add %.877, 34 + %.913 =w copy 43252 + storeh %.913, %.912 + %.914 =l add %.877, 36 + %.915 =w copy 57862 + storeh %.915, %.914 + %.916 =l add %.877, 38 + %.917 =w copy 7 + storeh %.917, %.916 + %.918 =l add %.877, 40 + %.919 =w copy 7 + storeh %.919, %.918 + %.920 =l add %.877, 42 + %.921 =w copy 61416 + storeh %.921, %.920 + %.922 =l add %.877, 44 + %.923 =w copy 1 + storeh %.923, %.922 + %.924 =l add %.877, 46 + %.925 =w copy 51327 + storeh %.925, %.924 + %.926 =l add %.877, 48 + %.927 =w copy 1 + storeh %.927, %.926 + %.928 =l add %.877, 50 + %.929 =w copy 61416 + storeh %.929, %.928 + %.930 =l add %.877, 52 + %.931 =w copy 61416 + storeh %.931, %.930 + %.932 =l add %.877, 54 + %.933 =w copy 1 + storeh %.933, %.932 + %.935 =l add %.934, 0 + storel 4246175373668383303, %.935 + %.937 =l add %.936, 0 + storel $g_296, %.937 + %.939 =l add %.938, 0 + %.940 =w copy 7 + storeb %.940, %.939 + %.941 =l add %.938, 1 + storeb 0, %.941 + %.942 =l add %.938, 2 + storeh 0, %.942 + %.943 =l add %.938, 4 + storew 0, %.943 + %.944 =l add %.938, 8 + %.945 =l copy 12916396440129209738 + storel %.945, %.944 + %.946 =l add %.938, 16 + %.947 =w copy 2845575975 + storew %.947, %.946 + %.948 =l add %.938, 20 + storew 0, %.948 + %.949 =l add %.938, 24 + storel 16685243662073323047, %.949 + %.950 =l add %.938, 32 + %.951 =w copy 2128478778 + storew %.951, %.950 + %.952 =l add %.938, 36 + %.953 =w copy 1831715476 + storew %.953, %.952 + %.954 =l add %.938, 40 + %.955 =w copy 2458647541 + storew %.955, %.954 + %.956 =l add %.938, 44 + %.957 =w copy 1195810902 + storew %.957, %.956 + %.958 =l add %.938, 48 + %.959 =w copy 0 + storew %.959, %.958 + %.960 =l add %.938, 52 + storew 0, %.960 + %.961 =l add %.938, 56 + %.962 =w copy 4 + storeb %.962, %.961 + %.963 =l add %.938, 57 + storeb 0, %.963 + %.964 =l add %.938, 58 + storeh 0, %.964 + %.965 =l add %.938, 60 + storew 0, %.965 + %.966 =l add %.938, 64 + %.967 =l copy 3 + storel %.967, %.966 + %.968 =l add %.938, 72 + %.969 =w copy 3413279085 + storew %.969, %.968 + %.970 =l add %.938, 76 + storew 0, %.970 + %.971 =l add %.938, 80 + storel 12472845116585076645, %.971 + %.972 =l add %.938, 88 + %.973 =w copy 1 + storew %.973, %.972 + %.974 =l add %.938, 92 + %.975 =w copy 18446744073709551607 + storew %.975, %.974 + %.976 =l add %.938, 96 + %.977 =l extsw 0 + %.978 =l sub %.977, 7 + %.979 =w copy %.978 + storew %.979, %.976 + %.980 =l add %.938, 100 + %.981 =l extsw 0 + %.982 =l sub %.981, 4 + %.983 =w copy %.982 + storew %.983, %.980 + %.984 =l add %.938, 104 + %.985 =w copy 6 + storew %.985, %.984 + %.986 =l add %.938, 108 + storew 0, %.986 + %.987 =l add %.938, 112 + %.988 =w copy 7 + storeb %.988, %.987 + %.989 =l add %.938, 113 + storeb 0, %.989 + %.990 =l add %.938, 114 + storeh 0, %.990 + %.991 =l add %.938, 116 + storew 0, %.991 + %.992 =l add %.938, 120 + %.993 =l copy 12916396440129209738 + storel %.993, %.992 + %.994 =l add %.938, 128 + %.995 =w copy 2845575975 + storew %.995, %.994 + %.996 =l add %.938, 132 + storew 0, %.996 + %.997 =l add %.938, 136 + storel 16685243662073323047, %.997 + %.998 =l add %.938, 144 + %.999 =w copy 2128478778 + storew %.999, %.998 + %.1000 =l add %.938, 148 + %.1001 =w copy 1831715476 + storew %.1001, %.1000 + %.1002 =l add %.938, 152 + %.1003 =w copy 2458647541 + storew %.1003, %.1002 + %.1004 =l add %.938, 156 + %.1005 =w copy 1195810902 + storew %.1005, %.1004 + %.1006 =l add %.938, 160 + %.1007 =w copy 0 + storew %.1007, %.1006 + %.1008 =l add %.938, 164 + storew 0, %.1008 + %.1009 =l add %.938, 168 + %.1010 =w copy 7 + storeb %.1010, %.1009 + %.1011 =l add %.938, 169 + storeb 0, %.1011 + %.1012 =l add %.938, 170 + storeh 0, %.1012 + %.1013 =l add %.938, 172 + storew 0, %.1013 + %.1014 =l add %.938, 176 + %.1015 =l copy 12916396440129209738 + storel %.1015, %.1014 + %.1016 =l add %.938, 184 + %.1017 =w copy 2845575975 + storew %.1017, %.1016 + %.1018 =l add %.938, 188 + storew 0, %.1018 + %.1019 =l add %.938, 192 + storel 16685243662073323047, %.1019 + %.1020 =l add %.938, 200 + %.1021 =w copy 2128478778 + storew %.1021, %.1020 + %.1022 =l add %.938, 204 + %.1023 =w copy 1831715476 + storew %.1023, %.1022 + %.1024 =l add %.938, 208 + %.1025 =w copy 2458647541 + storew %.1025, %.1024 + %.1026 =l add %.938, 212 + %.1027 =w copy 1195810902 + storew %.1027, %.1026 + %.1028 =l add %.938, 216 + %.1029 =w copy 0 + storew %.1029, %.1028 + %.1030 =l add %.938, 220 + storew 0, %.1030 + %.1031 =l add %.938, 224 + %.1032 =w copy 250 + storeb %.1032, %.1031 + %.1033 =l add %.938, 225 + storeb 0, %.1033 + %.1034 =l add %.938, 226 + storeh 0, %.1034 + %.1035 =l add %.938, 228 + storew 0, %.1035 + %.1036 =l add %.938, 232 + %.1037 =l copy 3 + storel %.1037, %.1036 + %.1038 =l add %.938, 240 + %.1039 =w copy 2424977419 + storew %.1039, %.1038 + %.1040 =l add %.938, 244 + storew 0, %.1040 + %.1041 =l add %.938, 248 + %.1042 =l copy 6541172831621759081 + storel %.1042, %.1041 + %.1043 =l add %.938, 256 + %.1044 =w copy 4294967290 + storew %.1044, %.1043 + %.1045 =l add %.938, 260 + %.1046 =w copy 18446744073709551613 + storew %.1046, %.1045 + %.1047 =l add %.938, 264 + %.1048 =w copy 1 + storew %.1048, %.1047 + %.1049 =l add %.938, 268 + %.1050 =w copy 4109237926 + storew %.1050, %.1049 + %.1051 =l add %.938, 272 + %.1052 =l extsw 0 + %.1053 =l sub %.1052, 3 + %.1054 =w copy %.1053 + storew %.1054, %.1051 + %.1055 =l add %.938, 276 + storew 0, %.1055 + %.1056 =l add %.938, 280 + %.1057 =w copy 4 + storeb %.1057, %.1056 + %.1058 =l add %.938, 281 + storeb 0, %.1058 + %.1059 =l add %.938, 282 + storeh 0, %.1059 + %.1060 =l add %.938, 284 + storew 0, %.1060 + %.1061 =l add %.938, 288 + %.1062 =l copy 3 + storel %.1062, %.1061 + %.1063 =l add %.938, 296 + %.1064 =w copy 3413279085 + storew %.1064, %.1063 + %.1065 =l add %.938, 300 + storew 0, %.1065 + %.1066 =l add %.938, 304 + storel 12472845116585076645, %.1066 + %.1067 =l add %.938, 312 + %.1068 =w copy 1 + storew %.1068, %.1067 + %.1069 =l add %.938, 316 + %.1070 =w copy 18446744073709551607 + storew %.1070, %.1069 + %.1071 =l add %.938, 320 + %.1072 =l extsw 0 + %.1073 =l sub %.1072, 7 + %.1074 =w copy %.1073 + storew %.1074, %.1071 + %.1075 =l add %.938, 324 + %.1076 =l extsw 0 + %.1077 =l sub %.1076, 4 + %.1078 =w copy %.1077 + storew %.1078, %.1075 + %.1079 =l add %.938, 328 + %.1080 =w copy 6 + storew %.1080, %.1079 + %.1081 =l add %.938, 332 + storew 0, %.1081 + %.1082 =l add %.938, 336 + %.1083 =w copy 4 + storeb %.1083, %.1082 + %.1084 =l add %.938, 337 + storeb 0, %.1084 + %.1085 =l add %.938, 338 + storeh 0, %.1085 + %.1086 =l add %.938, 340 + storew 0, %.1086 + %.1087 =l add %.938, 344 + %.1088 =l copy 3 + storel %.1088, %.1087 + %.1089 =l add %.938, 352 + %.1090 =w copy 3413279085 + storew %.1090, %.1089 + %.1091 =l add %.938, 356 + storew 0, %.1091 + %.1092 =l add %.938, 360 + storel 12472845116585076645, %.1092 + %.1093 =l add %.938, 368 + %.1094 =w copy 1 + storew %.1094, %.1093 + %.1095 =l add %.938, 372 + %.1096 =w copy 18446744073709551607 + storew %.1096, %.1095 + %.1097 =l add %.938, 376 + %.1098 =l extsw 0 + %.1099 =l sub %.1098, 7 + %.1100 =w copy %.1099 + storew %.1100, %.1097 + %.1101 =l add %.938, 380 + %.1102 =l extsw 0 + %.1103 =l sub %.1102, 4 + %.1104 =w copy %.1103 + storew %.1104, %.1101 + %.1105 =l add %.938, 384 + %.1106 =w copy 6 + storew %.1106, %.1105 + %.1107 =l add %.938, 388 + storew 0, %.1107 + %.1108 =l add %.938, 392 + %.1109 =w copy 250 + storeb %.1109, %.1108 + %.1110 =l add %.938, 393 + storeb 0, %.1110 + %.1111 =l add %.938, 394 + storeh 0, %.1111 + %.1112 =l add %.938, 396 + storew 0, %.1112 + %.1113 =l add %.938, 400 + %.1114 =l copy 3 + storel %.1114, %.1113 + %.1115 =l add %.938, 408 + %.1116 =w copy 2424977419 + storew %.1116, %.1115 + %.1117 =l add %.938, 412 + storew 0, %.1117 + %.1118 =l add %.938, 416 + %.1119 =l copy 6541172831621759081 + storel %.1119, %.1118 + %.1120 =l add %.938, 424 + %.1121 =w copy 4294967290 + storew %.1121, %.1120 + %.1122 =l add %.938, 428 + %.1123 =w copy 18446744073709551613 + storew %.1123, %.1122 + %.1124 =l add %.938, 432 + %.1125 =w copy 1 + storew %.1125, %.1124 + %.1126 =l add %.938, 436 + %.1127 =w copy 4109237926 + storew %.1127, %.1126 + %.1128 =l add %.938, 440 + %.1129 =l extsw 0 + %.1130 =l sub %.1129, 3 + %.1131 =w copy %.1130 + storew %.1131, %.1128 + %.1132 =l add %.938, 444 + storew 0, %.1132 + %.1133 =l add %.938, 448 + %.1134 =w copy 4 + storeb %.1134, %.1133 + %.1135 =l add %.938, 449 + storeb 0, %.1135 + %.1136 =l add %.938, 450 + storeh 0, %.1136 + %.1137 =l add %.938, 452 + storew 0, %.1137 + %.1138 =l add %.938, 456 + %.1139 =l copy 3 + storel %.1139, %.1138 + %.1140 =l add %.938, 464 + %.1141 =w copy 3413279085 + storew %.1141, %.1140 + %.1142 =l add %.938, 468 + storew 0, %.1142 + %.1143 =l add %.938, 472 + storel 12472845116585076645, %.1143 + %.1144 =l add %.938, 480 + %.1145 =w copy 1 + storew %.1145, %.1144 + %.1146 =l add %.938, 484 + %.1147 =w copy 18446744073709551607 + storew %.1147, %.1146 + %.1148 =l add %.938, 488 + %.1149 =l extsw 0 + %.1150 =l sub %.1149, 7 + %.1151 =w copy %.1150 + storew %.1151, %.1148 + %.1152 =l add %.938, 492 + %.1153 =l extsw 0 + %.1154 =l sub %.1153, 4 + %.1155 =w copy %.1154 + storew %.1155, %.1152 + %.1156 =l add %.938, 496 + %.1157 =w copy 6 + storew %.1157, %.1156 + %.1158 =l add %.938, 500 + storew 0, %.1158 + %.1159 =l add %.938, 504 + %.1160 =w copy 4 + storeb %.1160, %.1159 + %.1161 =l add %.938, 505 + storeb 0, %.1161 + %.1162 =l add %.938, 506 + storeh 0, %.1162 + %.1163 =l add %.938, 508 + storew 0, %.1163 + %.1164 =l add %.938, 512 + %.1165 =l copy 3 + storel %.1165, %.1164 + %.1166 =l add %.938, 520 + %.1167 =w copy 3413279085 + storew %.1167, %.1166 + %.1168 =l add %.938, 524 + storew 0, %.1168 + %.1169 =l add %.938, 528 + storel 12472845116585076645, %.1169 + %.1170 =l add %.938, 536 + %.1171 =w copy 1 + storew %.1171, %.1170 + %.1172 =l add %.938, 540 + %.1173 =w copy 18446744073709551607 + storew %.1173, %.1172 + %.1174 =l add %.938, 544 + %.1175 =l extsw 0 + %.1176 =l sub %.1175, 7 + %.1177 =w copy %.1176 + storew %.1177, %.1174 + %.1178 =l add %.938, 548 + %.1179 =l extsw 0 + %.1180 =l sub %.1179, 4 + %.1181 =w copy %.1180 + storew %.1181, %.1178 + %.1182 =l add %.938, 552 + %.1183 =w copy 6 + storew %.1183, %.1182 + %.1184 =l add %.938, 556 + storew 0, %.1184 + %.1185 =l add %.938, 560 + %.1186 =w copy 250 + storeb %.1186, %.1185 + %.1187 =l add %.938, 561 + storeb 0, %.1187 + %.1188 =l add %.938, 562 + storeh 0, %.1188 + %.1189 =l add %.938, 564 + storew 0, %.1189 + %.1190 =l add %.938, 568 + %.1191 =l copy 3 + storel %.1191, %.1190 + %.1192 =l add %.938, 576 + %.1193 =w copy 2424977419 + storew %.1193, %.1192 + %.1194 =l add %.938, 580 + storew 0, %.1194 + %.1195 =l add %.938, 584 + %.1196 =l copy 6541172831621759081 + storel %.1196, %.1195 + %.1197 =l add %.938, 592 + %.1198 =w copy 4294967290 + storew %.1198, %.1197 + %.1199 =l add %.938, 596 + %.1200 =w copy 18446744073709551613 + storew %.1200, %.1199 + %.1201 =l add %.938, 600 + %.1202 =w copy 1 + storew %.1202, %.1201 + %.1203 =l add %.938, 604 + %.1204 =w copy 4109237926 + storew %.1204, %.1203 + %.1205 =l add %.938, 608 + %.1206 =l extsw 0 + %.1207 =l sub %.1206, 3 + %.1208 =w copy %.1207 + storew %.1208, %.1205 + %.1209 =l add %.938, 612 + storew 0, %.1209 + %.1210 =l add %.938, 616 + %.1211 =w copy 4 + storeb %.1211, %.1210 + %.1212 =l add %.938, 617 + storeb 0, %.1212 + %.1213 =l add %.938, 618 + storeh 0, %.1213 + %.1214 =l add %.938, 620 + storew 0, %.1214 + %.1215 =l add %.938, 624 + %.1216 =l copy 3 + storel %.1216, %.1215 + %.1217 =l add %.938, 632 + %.1218 =w copy 3413279085 + storew %.1218, %.1217 + %.1219 =l add %.938, 636 + storew 0, %.1219 + %.1220 =l add %.938, 640 + storel 12472845116585076645, %.1220 + %.1221 =l add %.938, 648 + %.1222 =w copy 1 + storew %.1222, %.1221 + %.1223 =l add %.938, 652 + %.1224 =w copy 18446744073709551607 + storew %.1224, %.1223 + %.1225 =l add %.938, 656 + %.1226 =l extsw 0 + %.1227 =l sub %.1226, 7 + %.1228 =w copy %.1227 + storew %.1228, %.1225 + %.1229 =l add %.938, 660 + %.1230 =l extsw 0 + %.1231 =l sub %.1230, 4 + %.1232 =w copy %.1231 + storew %.1232, %.1229 + %.1233 =l add %.938, 664 + %.1234 =w copy 6 + storew %.1234, %.1233 + %.1235 =l add %.938, 668 + storew 0, %.1235 + %.1236 =l add %.938, 672 + %.1237 =w copy 4 + storeb %.1237, %.1236 + %.1238 =l add %.938, 673 + storeb 0, %.1238 + %.1239 =l add %.938, 674 + storeh 0, %.1239 + %.1240 =l add %.938, 676 + storew 0, %.1240 + %.1241 =l add %.938, 680 + %.1242 =l copy 3 + storel %.1242, %.1241 + %.1243 =l add %.938, 688 + %.1244 =w copy 3413279085 + storew %.1244, %.1243 + %.1245 =l add %.938, 692 + storew 0, %.1245 + %.1246 =l add %.938, 696 + storel 12472845116585076645, %.1246 + %.1247 =l add %.938, 704 + %.1248 =w copy 1 + storew %.1248, %.1247 + %.1249 =l add %.938, 708 + %.1250 =w copy 18446744073709551607 + storew %.1250, %.1249 + %.1251 =l add %.938, 712 + %.1252 =l extsw 0 + %.1253 =l sub %.1252, 7 + %.1254 =w copy %.1253 + storew %.1254, %.1251 + %.1255 =l add %.938, 716 + %.1256 =l extsw 0 + %.1257 =l sub %.1256, 4 + %.1258 =w copy %.1257 + storew %.1258, %.1255 + %.1259 =l add %.938, 720 + %.1260 =w copy 6 + storew %.1260, %.1259 + %.1261 =l add %.938, 724 + storew 0, %.1261 + %.1262 =l add %.938, 728 + %.1263 =w copy 250 + storeb %.1263, %.1262 + %.1264 =l add %.938, 729 + storeb 0, %.1264 + %.1265 =l add %.938, 730 + storeh 0, %.1265 + %.1266 =l add %.938, 732 + storew 0, %.1266 + %.1267 =l add %.938, 736 + %.1268 =l copy 3 + storel %.1268, %.1267 + %.1269 =l add %.938, 744 + %.1270 =w copy 2424977419 + storew %.1270, %.1269 + %.1271 =l add %.938, 748 + storew 0, %.1271 + %.1272 =l add %.938, 752 + %.1273 =l copy 6541172831621759081 + storel %.1273, %.1272 + %.1274 =l add %.938, 760 + %.1275 =w copy 4294967290 + storew %.1275, %.1274 + %.1276 =l add %.938, 764 + %.1277 =w copy 18446744073709551613 + storew %.1277, %.1276 + %.1278 =l add %.938, 768 + %.1279 =w copy 1 + storew %.1279, %.1278 + %.1280 =l add %.938, 772 + %.1281 =w copy 4109237926 + storew %.1281, %.1280 + %.1282 =l add %.938, 776 + %.1283 =l extsw 0 + %.1284 =l sub %.1283, 3 + %.1285 =w copy %.1284 + storew %.1285, %.1282 + %.1286 =l add %.938, 780 + storew 0, %.1286 + %.1287 =l add %.938, 784 + %.1288 =w copy 4 + storeb %.1288, %.1287 + %.1289 =l add %.938, 785 + storeb 0, %.1289 + %.1290 =l add %.938, 786 + storeh 0, %.1290 + %.1291 =l add %.938, 788 + storew 0, %.1291 + %.1292 =l add %.938, 792 + %.1293 =l copy 3 + storel %.1293, %.1292 + %.1294 =l add %.938, 800 + %.1295 =w copy 3413279085 + storew %.1295, %.1294 + %.1296 =l add %.938, 804 + storew 0, %.1296 + %.1297 =l add %.938, 808 + storel 12472845116585076645, %.1297 + %.1298 =l add %.938, 816 + %.1299 =w copy 1 + storew %.1299, %.1298 + %.1300 =l add %.938, 820 + %.1301 =w copy 18446744073709551607 + storew %.1301, %.1300 + %.1302 =l add %.938, 824 + %.1303 =l extsw 0 + %.1304 =l sub %.1303, 7 + %.1305 =w copy %.1304 + storew %.1305, %.1302 + %.1306 =l add %.938, 828 + %.1307 =l extsw 0 + %.1308 =l sub %.1307, 4 + %.1309 =w copy %.1308 + storew %.1309, %.1306 + %.1310 =l add %.938, 832 + %.1311 =w copy 6 + storew %.1311, %.1310 + %.1312 =l add %.938, 836 + storew 0, %.1312 + %.1313 =l add %.938, 840 + %.1314 =w copy 4 + storeb %.1314, %.1313 + %.1315 =l add %.938, 841 + storeb 0, %.1315 + %.1316 =l add %.938, 842 + storeh 0, %.1316 + %.1317 =l add %.938, 844 + storew 0, %.1317 + %.1318 =l add %.938, 848 + %.1319 =l copy 3 + storel %.1319, %.1318 + %.1320 =l add %.938, 856 + %.1321 =w copy 3413279085 + storew %.1321, %.1320 + %.1322 =l add %.938, 860 + storew 0, %.1322 + %.1323 =l add %.938, 864 + storel 12472845116585076645, %.1323 + %.1324 =l add %.938, 872 + %.1325 =w copy 1 + storew %.1325, %.1324 + %.1326 =l add %.938, 876 + %.1327 =w copy 18446744073709551607 + storew %.1327, %.1326 + %.1328 =l add %.938, 880 + %.1329 =l extsw 0 + %.1330 =l sub %.1329, 7 + %.1331 =w copy %.1330 + storew %.1331, %.1328 + %.1332 =l add %.938, 884 + %.1333 =l extsw 0 + %.1334 =l sub %.1333, 4 + %.1335 =w copy %.1334 + storew %.1335, %.1332 + %.1336 =l add %.938, 888 + %.1337 =w copy 6 + storew %.1337, %.1336 + %.1338 =l add %.938, 892 + storew 0, %.1338 + %.1339 =l add %.938, 896 + %.1340 =w copy 250 + storeb %.1340, %.1339 + %.1341 =l add %.938, 897 + storeb 0, %.1341 + %.1342 =l add %.938, 898 + storeh 0, %.1342 + %.1343 =l add %.938, 900 + storew 0, %.1343 + %.1344 =l add %.938, 904 + %.1345 =l copy 3 + storel %.1345, %.1344 + %.1346 =l add %.938, 912 + %.1347 =w copy 2424977419 + storew %.1347, %.1346 + %.1348 =l add %.938, 916 + storew 0, %.1348 + %.1349 =l add %.938, 920 + %.1350 =l copy 6541172831621759081 + storel %.1350, %.1349 + %.1351 =l add %.938, 928 + %.1352 =w copy 4294967290 + storew %.1352, %.1351 + %.1353 =l add %.938, 932 + %.1354 =w copy 18446744073709551613 + storew %.1354, %.1353 + %.1355 =l add %.938, 936 + %.1356 =w copy 1 + storew %.1356, %.1355 + %.1357 =l add %.938, 940 + %.1358 =w copy 4109237926 + storew %.1358, %.1357 + %.1359 =l add %.938, 944 + %.1360 =l extsw 0 + %.1361 =l sub %.1360, 3 + %.1362 =w copy %.1361 + storew %.1362, %.1359 + %.1363 =l add %.938, 948 + storew 0, %.1363 + %.1364 =l add %.938, 952 + %.1365 =w copy 4 + storeb %.1365, %.1364 + %.1366 =l add %.938, 953 + storeb 0, %.1366 + %.1367 =l add %.938, 954 + storeh 0, %.1367 + %.1368 =l add %.938, 956 + storew 0, %.1368 + %.1369 =l add %.938, 960 + %.1370 =l copy 3 + storel %.1370, %.1369 + %.1371 =l add %.938, 968 + %.1372 =w copy 3413279085 + storew %.1372, %.1371 + %.1373 =l add %.938, 972 + storew 0, %.1373 + %.1374 =l add %.938, 976 + storel 12472845116585076645, %.1374 + %.1375 =l add %.938, 984 + %.1376 =w copy 1 + storew %.1376, %.1375 + %.1377 =l add %.938, 988 + %.1378 =w copy 18446744073709551607 + storew %.1378, %.1377 + %.1379 =l add %.938, 992 + %.1380 =l extsw 0 + %.1381 =l sub %.1380, 7 + %.1382 =w copy %.1381 + storew %.1382, %.1379 + %.1383 =l add %.938, 996 + %.1384 =l extsw 0 + %.1385 =l sub %.1384, 4 + %.1386 =w copy %.1385 + storew %.1386, %.1383 + %.1387 =l add %.938, 1000 + %.1388 =w copy 6 + storew %.1388, %.1387 + %.1389 =l add %.938, 1004 + storew 0, %.1389 + %.1390 =l add %.938, 1008 + %.1391 =w copy 4 + storeb %.1391, %.1390 + %.1392 =l add %.938, 1009 + storeb 0, %.1392 + %.1393 =l add %.938, 1010 + storeh 0, %.1393 + %.1394 =l add %.938, 1012 + storew 0, %.1394 + %.1395 =l add %.938, 1016 + %.1396 =l copy 3 + storel %.1396, %.1395 + %.1397 =l add %.938, 1024 + %.1398 =w copy 3413279085 + storew %.1398, %.1397 + %.1399 =l add %.938, 1028 + storew 0, %.1399 + %.1400 =l add %.938, 1032 + storel 12472845116585076645, %.1400 + %.1401 =l add %.938, 1040 + %.1402 =w copy 1 + storew %.1402, %.1401 + %.1403 =l add %.938, 1044 + %.1404 =w copy 18446744073709551607 + storew %.1404, %.1403 + %.1405 =l add %.938, 1048 + %.1406 =l extsw 0 + %.1407 =l sub %.1406, 7 + %.1408 =w copy %.1407 + storew %.1408, %.1405 + %.1409 =l add %.938, 1052 + %.1410 =l extsw 0 + %.1411 =l sub %.1410, 4 + %.1412 =w copy %.1411 + storew %.1412, %.1409 + %.1413 =l add %.938, 1056 + %.1414 =w copy 6 + storew %.1414, %.1413 + %.1415 =l add %.938, 1060 + storew 0, %.1415 + %.1416 =l add %.938, 1064 + %.1417 =w copy 250 + storeb %.1417, %.1416 + %.1418 =l add %.938, 1065 + storeb 0, %.1418 + %.1419 =l add %.938, 1066 + storeh 0, %.1419 + %.1420 =l add %.938, 1068 + storew 0, %.1420 + %.1421 =l add %.938, 1072 + %.1422 =l copy 3 + storel %.1422, %.1421 + %.1423 =l add %.938, 1080 + %.1424 =w copy 2424977419 + storew %.1424, %.1423 + %.1425 =l add %.938, 1084 + storew 0, %.1425 + %.1426 =l add %.938, 1088 + %.1427 =l copy 6541172831621759081 + storel %.1427, %.1426 + %.1428 =l add %.938, 1096 + %.1429 =w copy 4294967290 + storew %.1429, %.1428 + %.1430 =l add %.938, 1100 + %.1431 =w copy 18446744073709551613 + storew %.1431, %.1430 + %.1432 =l add %.938, 1104 + %.1433 =w copy 1 + storew %.1433, %.1432 + %.1434 =l add %.938, 1108 + %.1435 =w copy 4109237926 + storew %.1435, %.1434 + %.1436 =l add %.938, 1112 + %.1437 =l extsw 0 + %.1438 =l sub %.1437, 3 + %.1439 =w copy %.1438 + storew %.1439, %.1436 + %.1440 =l add %.938, 1116 + storew 0, %.1440 + %.1441 =l add %.938, 1120 + %.1442 =w copy 4 + storeb %.1442, %.1441 + %.1443 =l add %.938, 1121 + storeb 0, %.1443 + %.1444 =l add %.938, 1122 + storeh 0, %.1444 + %.1445 =l add %.938, 1124 + storew 0, %.1445 + %.1446 =l add %.938, 1128 + %.1447 =l copy 3 + storel %.1447, %.1446 + %.1448 =l add %.938, 1136 + %.1449 =w copy 3413279085 + storew %.1449, %.1448 + %.1450 =l add %.938, 1140 + storew 0, %.1450 + %.1451 =l add %.938, 1144 + storel 12472845116585076645, %.1451 + %.1452 =l add %.938, 1152 + %.1453 =w copy 1 + storew %.1453, %.1452 + %.1454 =l add %.938, 1156 + %.1455 =w copy 18446744073709551607 + storew %.1455, %.1454 + %.1456 =l add %.938, 1160 + %.1457 =l extsw 0 + %.1458 =l sub %.1457, 7 + %.1459 =w copy %.1458 + storew %.1459, %.1456 + %.1460 =l add %.938, 1164 + %.1461 =l extsw 0 + %.1462 =l sub %.1461, 4 + %.1463 =w copy %.1462 + storew %.1463, %.1460 + %.1464 =l add %.938, 1168 + %.1465 =w copy 6 + storew %.1465, %.1464 + %.1466 =l add %.938, 1172 + storew 0, %.1466 + %.1467 =l add %.938, 1176 + %.1468 =w copy 4 + storeb %.1468, %.1467 + %.1469 =l add %.938, 1177 + storeb 0, %.1469 + %.1470 =l add %.938, 1178 + storeh 0, %.1470 + %.1471 =l add %.938, 1180 + storew 0, %.1471 + %.1472 =l add %.938, 1184 + %.1473 =l copy 3 + storel %.1473, %.1472 + %.1474 =l add %.938, 1192 + %.1475 =w copy 3413279085 + storew %.1475, %.1474 + %.1476 =l add %.938, 1196 + storew 0, %.1476 + %.1477 =l add %.938, 1200 + storel 12472845116585076645, %.1477 + %.1478 =l add %.938, 1208 + %.1479 =w copy 1 + storew %.1479, %.1478 + %.1480 =l add %.938, 1212 + %.1481 =w copy 18446744073709551607 + storew %.1481, %.1480 + %.1482 =l add %.938, 1216 + %.1483 =l extsw 0 + %.1484 =l sub %.1483, 7 + %.1485 =w copy %.1484 + storew %.1485, %.1482 + %.1486 =l add %.938, 1220 + %.1487 =l extsw 0 + %.1488 =l sub %.1487, 4 + %.1489 =w copy %.1488 + storew %.1489, %.1486 + %.1490 =l add %.938, 1224 + %.1491 =w copy 6 + storew %.1491, %.1490 + %.1492 =l add %.938, 1228 + storew 0, %.1492 + %.1493 =l add %.938, 1232 + %.1494 =w copy 250 + storeb %.1494, %.1493 + %.1495 =l add %.938, 1233 + storeb 0, %.1495 + %.1496 =l add %.938, 1234 + storeh 0, %.1496 + %.1497 =l add %.938, 1236 + storew 0, %.1497 + %.1498 =l add %.938, 1240 + %.1499 =l copy 3 + storel %.1499, %.1498 + %.1500 =l add %.938, 1248 + %.1501 =w copy 2424977419 + storew %.1501, %.1500 + %.1502 =l add %.938, 1252 + storew 0, %.1502 + %.1503 =l add %.938, 1256 + %.1504 =l copy 6541172831621759081 + storel %.1504, %.1503 + %.1505 =l add %.938, 1264 + %.1506 =w copy 4294967290 + storew %.1506, %.1505 + %.1507 =l add %.938, 1268 + %.1508 =w copy 18446744073709551613 + storew %.1508, %.1507 + %.1509 =l add %.938, 1272 + %.1510 =w copy 1 + storew %.1510, %.1509 + %.1511 =l add %.938, 1276 + %.1512 =w copy 4109237926 + storew %.1512, %.1511 + %.1513 =l add %.938, 1280 + %.1514 =l extsw 0 + %.1515 =l sub %.1514, 3 + %.1516 =w copy %.1515 + storew %.1516, %.1513 + %.1517 =l add %.938, 1284 + storew 0, %.1517 + %.1518 =l add %.938, 1288 + %.1519 =w copy 4 + storeb %.1519, %.1518 + %.1520 =l add %.938, 1289 + storeb 0, %.1520 + %.1521 =l add %.938, 1290 + storeh 0, %.1521 + %.1522 =l add %.938, 1292 + storew 0, %.1522 + %.1523 =l add %.938, 1296 + %.1524 =l copy 3 + storel %.1524, %.1523 + %.1525 =l add %.938, 1304 + %.1526 =w copy 3413279085 + storew %.1526, %.1525 + %.1527 =l add %.938, 1308 + storew 0, %.1527 + %.1528 =l add %.938, 1312 + storel 12472845116585076645, %.1528 + %.1529 =l add %.938, 1320 + %.1530 =w copy 1 + storew %.1530, %.1529 + %.1531 =l add %.938, 1324 + %.1532 =w copy 18446744073709551607 + storew %.1532, %.1531 + %.1533 =l add %.938, 1328 + %.1534 =l extsw 0 + %.1535 =l sub %.1534, 7 + %.1536 =w copy %.1535 + storew %.1536, %.1533 + %.1537 =l add %.938, 1332 + %.1538 =l extsw 0 + %.1539 =l sub %.1538, 4 + %.1540 =w copy %.1539 + storew %.1540, %.1537 + %.1541 =l add %.938, 1336 + %.1542 =w copy 6 + storew %.1542, %.1541 + %.1543 =l add %.938, 1340 + storew 0, %.1543 + %.1544 =l add %.938, 1344 + %.1545 =w copy 4 + storeb %.1545, %.1544 + %.1546 =l add %.938, 1345 + storeb 0, %.1546 + %.1547 =l add %.938, 1346 + storeh 0, %.1547 + %.1548 =l add %.938, 1348 + storew 0, %.1548 + %.1549 =l add %.938, 1352 + %.1550 =l copy 3 + storel %.1550, %.1549 + %.1551 =l add %.938, 1360 + %.1552 =w copy 3413279085 + storew %.1552, %.1551 + %.1553 =l add %.938, 1364 + storew 0, %.1553 + %.1554 =l add %.938, 1368 + storel 12472845116585076645, %.1554 + %.1555 =l add %.938, 1376 + %.1556 =w copy 1 + storew %.1556, %.1555 + %.1557 =l add %.938, 1380 + %.1558 =w copy 18446744073709551607 + storew %.1558, %.1557 + %.1559 =l add %.938, 1384 + %.1560 =l extsw 0 + %.1561 =l sub %.1560, 7 + %.1562 =w copy %.1561 + storew %.1562, %.1559 + %.1563 =l add %.938, 1388 + %.1564 =l extsw 0 + %.1565 =l sub %.1564, 4 + %.1566 =w copy %.1565 + storew %.1566, %.1563 + %.1567 =l add %.938, 1392 + %.1568 =w copy 6 + storew %.1568, %.1567 + %.1569 =l add %.938, 1396 + storew 0, %.1569 + %.1570 =l add %.938, 1400 + %.1571 =w copy 250 + storeb %.1571, %.1570 + %.1572 =l add %.938, 1401 + storeb 0, %.1572 + %.1573 =l add %.938, 1402 + storeh 0, %.1573 + %.1574 =l add %.938, 1404 + storew 0, %.1574 + %.1575 =l add %.938, 1408 + %.1576 =l copy 3 + storel %.1576, %.1575 + %.1577 =l add %.938, 1416 + %.1578 =w copy 2424977419 + storew %.1578, %.1577 + %.1579 =l add %.938, 1420 + storew 0, %.1579 + %.1580 =l add %.938, 1424 + %.1581 =l copy 6541172831621759081 + storel %.1581, %.1580 + %.1582 =l add %.938, 1432 + %.1583 =w copy 4294967290 + storew %.1583, %.1582 + %.1584 =l add %.938, 1436 + %.1585 =w copy 18446744073709551613 + storew %.1585, %.1584 + %.1586 =l add %.938, 1440 + %.1587 =w copy 1 + storew %.1587, %.1586 + %.1588 =l add %.938, 1444 + %.1589 =w copy 4109237926 + storew %.1589, %.1588 + %.1590 =l add %.938, 1448 + %.1591 =l extsw 0 + %.1592 =l sub %.1591, 3 + %.1593 =w copy %.1592 + storew %.1593, %.1590 + %.1594 =l add %.938, 1452 + storew 0, %.1594 + %.1595 =l add %.938, 1456 + %.1596 =w copy 4 + storeb %.1596, %.1595 + %.1597 =l add %.938, 1457 + storeb 0, %.1597 + %.1598 =l add %.938, 1458 + storeh 0, %.1598 + %.1599 =l add %.938, 1460 + storew 0, %.1599 + %.1600 =l add %.938, 1464 + %.1601 =l copy 3 + storel %.1601, %.1600 + %.1602 =l add %.938, 1472 + %.1603 =w copy 3413279085 + storew %.1603, %.1602 + %.1604 =l add %.938, 1476 + storew 0, %.1604 + %.1605 =l add %.938, 1480 + storel 12472845116585076645, %.1605 + %.1606 =l add %.938, 1488 + %.1607 =w copy 1 + storew %.1607, %.1606 + %.1608 =l add %.938, 1492 + %.1609 =w copy 18446744073709551607 + storew %.1609, %.1608 + %.1610 =l add %.938, 1496 + %.1611 =l extsw 0 + %.1612 =l sub %.1611, 7 + %.1613 =w copy %.1612 + storew %.1613, %.1610 + %.1614 =l add %.938, 1500 + %.1615 =l extsw 0 + %.1616 =l sub %.1615, 4 + %.1617 =w copy %.1616 + storew %.1617, %.1614 + %.1618 =l add %.938, 1504 + %.1619 =w copy 6 + storew %.1619, %.1618 + %.1620 =l add %.938, 1508 + storew 0, %.1620 + %.1621 =l add %.938, 1512 + %.1622 =w copy 4 + storeb %.1622, %.1621 + %.1623 =l add %.938, 1513 + storeb 0, %.1623 + %.1624 =l add %.938, 1514 + storeh 0, %.1624 + %.1625 =l add %.938, 1516 + storew 0, %.1625 + %.1626 =l add %.938, 1520 + %.1627 =l copy 3 + storel %.1627, %.1626 + %.1628 =l add %.938, 1528 + %.1629 =w copy 3413279085 + storew %.1629, %.1628 + %.1630 =l add %.938, 1532 + storew 0, %.1630 + %.1631 =l add %.938, 1536 + storel 12472845116585076645, %.1631 + %.1632 =l add %.938, 1544 + %.1633 =w copy 1 + storew %.1633, %.1632 + %.1634 =l add %.938, 1548 + %.1635 =w copy 18446744073709551607 + storew %.1635, %.1634 + %.1636 =l add %.938, 1552 + %.1637 =l extsw 0 + %.1638 =l sub %.1637, 7 + %.1639 =w copy %.1638 + storew %.1639, %.1636 + %.1640 =l add %.938, 1556 + %.1641 =l extsw 0 + %.1642 =l sub %.1641, 4 + %.1643 =w copy %.1642 + storew %.1643, %.1640 + %.1644 =l add %.938, 1560 + %.1645 =w copy 6 + storew %.1645, %.1644 + %.1646 =l add %.938, 1564 + storew 0, %.1646 + %.1648 =l add %.1647, 0 + %.1649 =w copy 93 + storeb %.1649, %.1648 + %.1650 =l add %.1647, 1 + storeb 0, %.1650 + %.1651 =l add %.1647, 2 + storeh 0, %.1651 + %.1652 =l add %.1647, 4 + storew 0, %.1652 + %.1653 =l add %.1647, 8 + storel 1149193768119386005, %.1653 + %.1654 =l add %.1647, 16 + %.1655 =w copy 3821279724 + storew %.1655, %.1654 + %.1656 =l add %.1647, 20 + storew 0, %.1656 + %.1657 =l add %.1647, 24 + storel 13837231179985012781, %.1657 + %.1658 =l add %.1647, 32 + %.1659 =w copy 8 + storew %.1659, %.1658 + %.1660 =l add %.1647, 36 + %.1661 =w copy 2352557560 + storew %.1661, %.1660 + %.1662 =l add %.1647, 40 + %.1663 =w copy 3321767348 + storew %.1663, %.1662 + %.1664 =l add %.1647, 44 + %.1665 =w copy 1113148436 + storew %.1665, %.1664 + %.1666 =l add %.1647, 48 + %.1667 =w copy 5 + storew %.1667, %.1666 + %.1668 =l add %.1647, 52 + storew 0, %.1668 + %.1670 =l add %.1669, 0 + %.1671 =l copy $g_265 + %.1672 =l mul 40, 1 + %.1673 =l add %.1671, %.1672 + %.1674 =l copy %.1673 + storel %.1674, %.1670 + %.1676 =l add %.1675, 0 + storel $g_88, %.1676 + %.1678 =l add %.1677, 0 + storel $g_634, %.1678 + %.1680 =l add %.1679, 0 + %.1681 =l extsw 4 + %.1682 =l mul %.1681, 1 + %.1683 =l add $g_132, %.1682 + storel %.1683, %.1680 + %.1685 =l add %.1684, 0 + %.1686 =l extsw 0 + %.1687 =l copy %.1686 + storel %.1687, %.1685 + %.1690 =l add %.1689, 0 + %.1691 =w copy 4 + storeh %.1691, %.1690 + storew 0, %.1692 +@for_cond.991 + %.1695 =w loadsw %.1692 + %.1696 =w csltw %.1695, 1 + jnz %.1696, @for_body.992, @for_join.994 +@for_body.992 + %.1697 =w loadsw %.1692 + %.1698 =l extsw %.1697 + %.1699 =l mul %.1698, 8 + %.1700 =l add %.14, %.1699 + storel $g_24, %.1700 +@for_cont.993 + %.1701 =w loadsw %.1692 + %.1702 =w add %.1701, 1 + storew %.1702, %.1692 + jmp @for_cond.991 +@for_join.994 + storew 0, %.1692 +@for_cond.995 + %.1703 =w loadsw %.1692 + %.1704 =w csltw %.1703, 2 + jnz %.1704, @for_body.996, @for_join.998 +@for_body.996 + %.1705 =w copy 30 + %.1706 =w loadsw %.1692 + %.1707 =l extsw %.1706 + %.1708 =l mul %.1707, 1 + %.1709 =l add %.1688, %.1708 + storeb %.1705, %.1709 +@for_cont.997 + %.1710 =w loadsw %.1692 + %.1711 =w add %.1710, 1 + storew %.1711, %.1692 + jmp @for_cond.995 +@for_join.998 + %.1712 =l loadl %.1669 + ret %.1712 +} +function w $func_16(l %.1, l %.3) { +@start.999 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 + %.5 =l alloc4 2 +@body.1000 + %.6 =l add %.5, 0 + %.7 =w copy 1 + storeh %.7, %.6 + %.8 =w loadsh %.5 + %.9 =w extsh %.8 + ret %.9 +} +type :S1.1 = { w, w, h, w, w, } +function l $func_19(w %.1, l %.3, :S1.1 %.5) { +@start.1001 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 + %.6 =l alloc8 8 + %.8 =l alloc8 8 + %.27 =l alloc8 8 +@body.1002 + %.7 =l add %.6, 0 + storel $g_80, %.7 + %.9 =l add %.8, 0 + %.10 =l copy $g_518 + %.11 =l mul 16, 1 + %.12 =l add %.10, %.11 + %.13 =l copy %.12 + storel %.13, %.9 + %.14 =w sub 0, 11 + %.15 =w copy %.14 + %.16 =l copy $g_794 + %.17 =l mul 16, 1 + %.18 =l add %.16, %.17 + %.19 =l copy %.18 + storew %.15, %.19 +@for_cond.1003 + %.20 =l copy $g_794 + %.21 =l mul 16, 1 + %.22 =l add %.20, %.21 + %.23 =l copy %.22 + %.24 =w loaduw %.23 + %.25 =w copy 12 + %.26 =w cultw %.24, %.25 + jnz %.26, @for_body.1004, @for_join.1006 +@for_body.1004 + %.28 =l add %.27, 0 + %.29 =l copy $g_518 + %.30 =l mul 8, 1 + %.31 =l add %.29, %.30 + %.32 =l copy %.31 + storel %.32, %.28 + %.33 =l loadl $g_38 + %.34 =l loadl %.33 + %.35 =w loadsw %.34 + %.36 =l loadl %.27 + %.37 =l loadl %.6 + %.38 =w ceql %.36, %.37 + %.39 =w and %.35, %.38 + storew %.39, %.34 +@for_cont.1005 + %.40 =l copy $g_794 + %.41 =l mul 16, 1 + %.42 =l add %.40, %.41 + %.43 =l copy %.42 + %.44 =w loaduw %.43 + %.45 =l extuw %.44 + %.46 =l extsw 4 + %.47 =l call $safe_add_func_uint64_t_u_u(l %.45, l %.46) + %.48 =w copy %.47 + %.49 =l copy $g_794 + %.50 =l mul 16, 1 + %.51 =l add %.49, %.50 + %.52 =l copy %.51 + storew %.48, %.52 + jmp @for_cond.1003 +@for_join.1006 + %.53 =l loadl %.8 + %.54 =l loadl $g_38 + storel %.53, %.54 + %.55 =l loadl $g_88 + %.56 =l loadl %.55 + %.57 =l loadl %.56 + ret %.57 +} +type :S0.2 = { b, l, w, l, w, w, w, w, w, } +function w $func_25(w %.1, w %.3, l %.5, :S0.2 %.7) { +@start.1007 + %.2 =l alloc4 1 + storeb %.1, %.2 + %.4 =l alloc4 2 + storeh %.3, %.4 + %.6 =l alloc8 8 + storel %.5, %.6 + %.8 =l alloc8 64 + %.9 =l alloc8 8 + %.14 =l alloc4 40 + %.37 =l alloc8 56 + %.38 =l alloc4 4 +@body.1008 + %.10 =l add %.9, 0 + %.11 =l extsw 1 + %.12 =l mul %.11, 8 + %.13 =l add %.8, %.12 + storel %.13, %.10 + %.15 =l add %.14, 0 + %.16 =w copy 1614650852 + storew %.16, %.15 + %.17 =l add %.14, 4 + %.18 =w copy 18446744073709551609 + storew %.18, %.17 + %.19 =l add %.14, 8 + %.20 =w copy 53864 + storeh %.20, %.19 + %.21 =l add %.14, 10 + storeh 0, %.21 + %.22 =l add %.14, 12 + %.23 =w copy 3514176187 + storew %.23, %.22 + %.24 =l add %.14, 16 + %.25 =w copy 3295455848 + storew %.25, %.24 + %.26 =l add %.14, 20 + %.27 =w copy 1614650852 + storew %.27, %.26 + %.28 =l add %.14, 24 + %.29 =w copy 18446744073709551609 + storew %.29, %.28 + %.30 =l add %.14, 28 + %.31 =w copy 53864 + storeh %.31, %.30 + %.32 =l add %.14, 30 + storeh 0, %.32 + %.33 =l add %.14, 32 + %.34 =w copy 3514176187 + storew %.34, %.33 + %.35 =l add %.14, 36 + %.36 =w copy 3295455848 + storew %.36, %.35 + storew 0, %.38 +@for_cond.1009 + %.39 =w loadsw %.38 + %.40 =w csltw %.39, 8 + jnz %.40, @for_body.1010, @for_join.1012 +@for_body.1010 + %.41 =l copy $g_794 + %.42 =l mul 12, 1 + %.43 =l add %.41, %.42 + %.44 =l copy %.43 + %.45 =w loadsw %.38 + %.46 =l extsw %.45 + %.47 =l mul %.46, 8 + %.48 =l add %.8, %.47 + storel %.44, %.48 +@for_cont.1011 + %.49 =w loadsw %.38 + %.50 =w add %.49, 1 + storew %.50, %.38 + jmp @for_cond.1009 +@for_join.1012 + storew 0, %.38 +@for_cond.1013 + %.51 =w loadsw %.38 + %.52 =w csltw %.51, 7 + jnz %.52, @for_body.1014, @for_join.1016 +@for_body.1014 + %.53 =w loadsw %.38 + %.54 =l extsw %.53 + %.55 =l mul %.54, 8 + %.56 =l add %.37, %.55 + storel $g_201, %.56 +@for_cont.1015 + %.57 =w loadsw %.38 + %.58 =w add %.57, 1 + storew %.58, %.38 + jmp @for_cond.1013 +@for_join.1016 + %.59 =l loadl %.9 + %.60 =l extsw 1 + %.61 =l mul %.60, 8 + %.62 =l add %.8, %.61 + %.63 =w ceql %.59, %.62 + %.64 =l extsw %.63 + %.65 =l and %.64, 1 + %.66 =l copy %.65 + %.67 =l copy %.7 + %.68 =l mul 0, 1 + %.69 =l add %.67, %.68 + %.70 =l copy %.69 + %.71 =w loadub %.70 + %.72 =l extsw 0 + %.73 =l mul %.72, 20 + %.74 =l add %.14, %.73 + %.75 =l extsw 0 + %.76 =l mul %.75, 20 + %.77 =l add %.14, %.76 + %.78 =l copy %.77 + %.79 =l mul 8, 1 + %.80 =l add %.78, %.79 + %.81 =l copy %.80 + %.82 =w loadsh %.81 + %.83 =l loadl $g_201 + %.84 =l extsw 3 + %.85 =l mul %.84, 8 + %.86 =l add %.37, %.85 + %.87 =l loadl %.86 + %.88 =w cnel $g_201, %.87 + %.89 =w cnew %.88, 0 + jnz %.89, @logic_right.1021, @logic_join.1022 +@logic_right.1021 + %.90 =l loadl %.6 + %.91 =w loadsw %.90 + %.92 =w cnew %.91, 0 +@logic_join.1022 + %.93 =w phi @for_join.1016 %.89, @logic_right.1021 %.92 + %.94 =w cnew %.93, 0 + jnz %.94, @logic_join.1020, @logic_right.1019 +@logic_right.1019 + %.95 =l extsw 0 + %.96 =l mul %.95, 20 + %.97 =l add %.14, %.96 + %.98 =l copy %.97 + %.99 =l mul 12, 1 + %.100 =l add %.98, %.99 + %.101 =l copy %.100 + %.102 =w loadsw %.101 + %.103 =w cnew %.102, 0 +@logic_join.1020 + %.104 =w phi @logic_join.1022 %.94, @logic_right.1019 %.103 + %.105 =w copy %.104 + %.106 =l extsw 0 + %.107 =l mul %.106, 20 + %.108 =l add %.14, %.107 + %.109 =l copy %.108 + %.110 =l mul 4, 1 + %.111 =l add %.109, %.110 + %.112 =l copy %.111 + %.113 =w loaduw %.112 + %.114 =w and %.105, %.113 + %.115 =w copy 0 + %.116 =w ceqw %.114, %.115 + %.117 =w cnew %.116, 0 + jnz %.117, @logic_join.1018, @logic_right.1017 +@logic_right.1017 + %.118 =w cnel 12400815938564546249, 0 +@logic_join.1018 + %.119 =w phi @logic_join.1020 %.117, @logic_right.1017 %.118 + %.120 =l extsw %.119 + %.121 =l or %.120, 4294967288 + %.122 =l extsw 0 + %.123 =l mul %.122, 20 + %.124 =l add %.14, %.123 + %.125 =l copy %.124 + %.126 =l mul 0, 1 + %.127 =l add %.125, %.126 + %.128 =l copy %.127 + %.129 =w loadsw %.128 + %.130 =l extsw %.129 + %.131 =w cugtl %.121, %.130 + %.132 =w loadsh %.4 + %.133 =w extsh %.132 + %.134 =w cnew %.131, %.133 + %.135 =l extsw 0 + %.136 =l extsw 2 + %.137 =l mul %.136, 8 + %.138 =l add %.8, %.137 + %.139 =l loadl %.138 + %.140 =w ceql %.135, %.139 + %.141 =l extsw %.140 + %.142 =l copy %.7 + %.143 =l mul 16, 1 + %.144 =l add %.142, %.143 + %.145 =l copy %.144 + %.146 =w loadsw %.145 + %.147 =l extsw %.146 + %.148 =l call $safe_sub_func_int64_t_s_s(l %.141, l %.147) + %.149 =l copy %.148 + %.150 =w cugel %.66, %.149 + %.151 =w loadsh %.4 + %.152 =w extsh %.151 + %.153 =l extsw 0 + %.154 =l mul %.153, 20 + %.155 =l add %.14, %.154 + %.156 =l copy %.155 + %.157 =l mul 4, 1 + %.158 =l add %.156, %.157 + %.159 =l copy %.158 + %.160 =w loaduw %.159 + %.161 =w or %.152, %.160 + %.162 =w copy %.161 + %.163 =l loadl %.6 + storew %.162, %.163 + %.164 =l extsw 0 + %.165 =l mul %.164, 20 + %.166 =l add %.14, %.165 + %.167 =l copy %.166 + %.168 =l mul 4, 1 + %.169 =l add %.167, %.168 + %.170 =l copy %.169 + %.171 =w loaduw %.170 + %.172 =w copy %.171 + ret %.172 +} +function w $func_30(w %.1, l %.3) { +@start.1023 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 + %.5 =l alloc4 1 + %.8 =l alloc8 8 + %.10 =l alloc8 56 + %.35 =l alloc8 8 + %.37 =l alloc8 8 + %.39 =l alloc8 336 + %.84 =l alloc4 4 + %.87 =l alloc8 8 + %.89 =l alloc4 20 + %.101 =l alloc4 4 + %.104 =l alloc4 4 + %.109 =l alloc8 8 + %.110 =l alloc4 2 + %.113 =l alloc4 4 + %.118 =l alloc4 4 + %.123 =l alloc4 4 + %.126 =l alloc4 4 + %.129 =l alloc4 4 + %.132 =l alloc4 24 + %.133 =l alloc4 20 + %.147 =l alloc8 8 + %.151 =l alloc8 8 + %.155 =l alloc8 8 + %.161 =l alloc4 2 + %.164 =l alloc4 12 + %.165 =l alloc4 4 + %.170 =l alloc4 2 + %.173 =l alloc4 4 + %.174 =l alloc4 4 + %.175 =l alloc4 4 + %.206 =l alloc4 2 + %.209 =l alloc8 72 + %.219 =l alloc4 4 + %.224 =l alloc4 4 + %.227 =l alloc4 4 + %.230 =l alloc4 1 + %.233 =l alloc8 8 + %.235 =l alloc8 8 + %.237 =l alloc4 4 + %.240 =l alloc4 4 + %.241 =l alloc4 4 + %.254 =l alloc8 8 + %.272 =l alloc4 1 + %.275 =l alloc8 56 + %.323 =l alloc8 8 + %.325 =l alloc8 8 + %.327 =l alloc8 8 + %.329 =l alloc8 8 + %.331 =l alloc4 4 + %.334 =l alloc4 4 + %.444 =l alloc4 2 + %.447 =l alloc4 24 + %.448 =l alloc8 8 + %.452 =l alloc4 4 + %.455 =l alloc4 4 + %.458 =l alloc4 4 + %.461 =l alloc4 4 + %.462 =l alloc8 8 + %.464 =l alloc4 4 + %.465 =l alloc4 4 + %.500 =l alloc4 1 + %.503 =l alloc8 8 + %.505 =l alloc8 8 + %.509 =l alloc4 1 + %.512 =l alloc8 144 + %.531 =l alloc8 8 + %.533 =l alloc4 980 + %.1106 =l alloc4 4 + %.1109 =l alloc8 8 + %.1113 =l alloc8 8 + %.1115 =l alloc8 8 + %.1117 =l alloc4 4 + %.1120 =l alloc4 1 + %.1123 =l alloc4 4 + %.1124 =l alloc4 4 + %.1125 =l alloc4 4 + %.1138 =l alloc4 36 + %.1157 =l alloc4 4 + %.1193 =l alloc8 8 + %.1198 =l alloc4 24 + %.1211 =l alloc8 8 + %.1213 =l alloc8 8 + %.1215 =l alloc4 4 + %.1220 =l alloc4 20 + %.1261 =l alloc8 8 + %.1263 =l alloc4 4 + %.1266 =l alloc4 4 + %.1269 =l alloc4 4 + %.1272 =l alloc4 4 + %.1275 =l alloc4 12 + %.1276 =l alloc8 8 + %.1278 =l alloc8 8 + %.1284 =l alloc4 1 + %.1287 =l alloc8 8 + %.1289 =l alloc8 8 + %.1291 =l alloc8 56 + %.1316 =l alloc4 4 + %.1317 =l alloc4 4 + %.1318 =l alloc4 4 + %.1350 =l alloc8 8 + %.1378 =l alloc4 4 + %.1405 =l alloc8 8 + %.1407 =l alloc8 1008 + %.1564 =l alloc8 8 + %.1568 =l alloc8 8 + %.1570 =l alloc8 8 + %.1572 =l alloc8 8 + %.1574 =l alloc8 8 + %.1576 =l alloc4 4 + %.1577 =l alloc4 4 + %.1578 =l alloc4 4 + %.1668 =l alloc4 4 + %.1673 =l alloc8 8 + %.1675 =l alloc8 8 + %.1677 =l alloc8 8 + %.1679 =l alloc8 8 + %.1681 =l alloc8 72 + %.1700 =l alloc8 8 + %.1711 =l alloc8 8 + %.1713 =l alloc8 8 + %.1715 =l alloc8 8 + %.1717 =l alloc8 8 + %.1719 =l alloc4 4 + %.1811 =l alloc8 8 + %.1815 =l alloc8 8 + %.1819 =l alloc8 784 + %.2212 =l alloc4 2 + %.2217 =l alloc4 4 + %.2218 =l alloc4 4 + %.2219 =l alloc4 4 + %.2309 =l alloc8 80 + %.2328 =l alloc4 4 + %.2333 =l alloc4 4 + %.2336 =l alloc4 4 + %.2541 =l alloc8 8 + %.2547 =l alloc8 8 + %.2549 =l alloc4 4 + %.2552 =l alloc8 8 + %.2556 =l alloc8 8 + %.2559 =l alloc8 8 + %.2565 =l alloc8 8 + %.2567 =l alloc8 8 + %.2569 =l alloc4 4 + %.2572 =l alloc8 384 + %.2573 =l alloc8 8 + %.2577 =l alloc8 8 + %.2583 =l alloc4 4 + %.2584 =l alloc4 4 + %.2921 =l alloc4 1 + %.3028 =l alloc8 8 + %.3033 =l alloc8 8 + %.3037 =l alloc8 8 + %.3043 =l alloc8 8 + %.3047 =l alloc8 8 + %.3053 =l alloc8 8 + %.3059 =l alloc8 8 + %.3065 =l alloc8 8 + %.3076 =l alloc8 8 + %.3082 =l alloc8 8 + %.3088 =l alloc8 1008 + %.3653 =l alloc8 8 + %.3655 =l alloc4 4 + %.3658 =l alloc4 1 + %.3661 =l alloc4 4 + %.3662 =l alloc4 4 + %.3663 =l alloc4 4 + %.3692 =l alloc4 1 + %.3695 =l alloc8 8 + %.3697 =l alloc4 4 + %.3702 =l alloc4 4 + %.3705 =l alloc4 36 + %.3706 =l alloc4 4 + %.3770 =l alloc4 2 + %.3820 =l alloc4 4 + %.3823 =l alloc4 4 + %.3826 =l alloc4 4 + %.3829 =l alloc4 4 + %.3832 =l alloc4 4 + %.3835 =l alloc8 8 + %.3841 =l alloc8 8 + %.3847 =l alloc8 8 + %.3849 =l alloc8 8 + %.3855 =l alloc8 576 + %.4204 =l alloc4 4 + %.4207 =l alloc4 4 + %.4210 =l alloc8 8 + %.4212 =l alloc4 4 + %.4213 =l alloc4 4 + %.4214 =l alloc4 4 + %.4219 =l alloc8 40 + %.4220 =l alloc4 4 + %.4378 =l alloc8 8 + %.4384 =l alloc8 8 + %.4386 =l alloc8 8 + %.4387 =l alloc4 4 + %.4390 =l alloc4 4 + %.4393 =l alloc4 2 + %.4396 =l alloc4 4 + %.4397 =l alloc4 4 +@body.1024 + %.6 =l add %.5, 0 + %.7 =w copy 0 + storeb %.7, %.6 + %.9 =l add %.8, 0 + storel $g_634, %.9 + %.11 =l add %.10, 0 + %.12 =w copy 117 + storeb %.12, %.11 + %.13 =l add %.10, 1 + storeb 0, %.13 + %.14 =l add %.10, 2 + storeh 0, %.14 + %.15 =l add %.10, 4 + storew 0, %.15 + %.16 =l add %.10, 8 + %.17 =l copy 12657291016094885149 + storel %.17, %.16 + %.18 =l add %.10, 16 + %.19 =l extsw 0 + %.20 =l sub %.19, 3 + %.21 =w copy %.20 + storew %.21, %.18 + %.22 =l add %.10, 20 + storew 0, %.22 + %.23 =l add %.10, 24 + storel 16915919946376103100, %.23 + %.24 =l add %.10, 32 + %.25 =w copy 2 + storew %.25, %.24 + %.26 =l add %.10, 36 + %.27 =w copy 1649859335 + storew %.27, %.26 + %.28 =l add %.10, 40 + %.29 =w copy 1843708338 + storew %.29, %.28 + %.30 =l add %.10, 44 + %.31 =w copy 0 + storew %.31, %.30 + %.32 =l add %.10, 48 + %.33 =w copy 474072632 + storew %.33, %.32 + %.34 =l add %.10, 52 + storew 0, %.34 + %.36 =l add %.35, 0 + storel $g_201, %.36 + %.38 =l add %.37, 0 + storel $g_619, %.38 + %.40 =l add %.39, 0 + storel %.37, %.40 + %.41 =l add %.39, 8 + storel %.37, %.41 + %.42 =l add %.39, 16 + storel %.37, %.42 + %.43 =l add %.39, 24 + storel %.37, %.43 + %.44 =l add %.39, 32 + storel %.37, %.44 + %.45 =l add %.39, 40 + storel %.37, %.45 + %.46 =l add %.39, 48 + storel %.37, %.46 + %.47 =l add %.39, 56 + storel %.37, %.47 + %.48 =l add %.39, 64 + storel %.37, %.48 + %.49 =l add %.39, 72 + storel %.37, %.49 + %.50 =l add %.39, 80 + storel %.37, %.50 + %.51 =l add %.39, 88 + storel %.37, %.51 + %.52 =l add %.39, 96 + storel %.37, %.52 + %.53 =l add %.39, 104 + %.54 =l extsw 0 + %.55 =l copy %.54 + storel %.55, %.53 + %.56 =l add %.39, 112 + storel %.37, %.56 + %.57 =l add %.39, 120 + storel %.37, %.57 + %.58 =l add %.39, 128 + storel %.37, %.58 + %.59 =l add %.39, 136 + storel %.37, %.59 + %.60 =l add %.39, 144 + storel %.37, %.60 + %.61 =l add %.39, 152 + storel %.37, %.61 + %.62 =l add %.39, 160 + storel %.37, %.62 + %.63 =l add %.39, 168 + storel %.37, %.63 + %.64 =l add %.39, 176 + storel %.37, %.64 + %.65 =l add %.39, 184 + storel %.37, %.65 + %.66 =l add %.39, 192 + storel %.37, %.66 + %.67 =l add %.39, 200 + storel %.37, %.67 + %.68 =l add %.39, 208 + storel %.37, %.68 + %.69 =l add %.39, 216 + storel %.37, %.69 + %.70 =l add %.39, 224 + storel %.37, %.70 + %.71 =l add %.39, 232 + storel %.37, %.71 + %.72 =l add %.39, 240 + storel %.37, %.72 + %.73 =l add %.39, 248 + storel %.37, %.73 + %.74 =l add %.39, 256 + storel %.37, %.74 + %.75 =l add %.39, 264 + storel %.37, %.75 + %.76 =l add %.39, 272 + storel %.37, %.76 + %.77 =l add %.39, 280 + storel %.37, %.77 + %.78 =l add %.39, 288 + storel %.37, %.78 + %.79 =l add %.39, 296 + storel %.37, %.79 + %.80 =l add %.39, 304 + storel %.37, %.80 + %.81 =l add %.39, 312 + storel %.37, %.81 + %.82 =l add %.39, 320 + storel %.37, %.82 + %.83 =l add %.39, 328 + storel %.37, %.83 + %.85 =l add %.84, 0 + %.86 =w copy 2656057619 + storew %.86, %.85 + %.88 =l add %.87, 0 + storel %.37, %.88 + %.90 =l add %.89, 0 + %.91 =w copy 4005622477 + storew %.91, %.90 + %.92 =l add %.89, 4 + %.93 =w copy 18446744073709551615 + storew %.93, %.92 + %.94 =l add %.89, 8 + %.95 =w copy 52208 + storeh %.95, %.94 + %.96 =l add %.89, 10 + storeh 0, %.96 + %.97 =l add %.89, 12 + %.98 =w copy 1484313967 + storew %.98, %.97 + %.99 =l add %.89, 16 + %.100 =w copy 354572175 + storew %.100, %.99 + %.102 =l add %.101, 0 + %.103 =w copy 1081308049 + storew %.103, %.102 + %.105 =l add %.104, 0 + %.106 =l extsw 0 + %.107 =l sub %.106, 1 + %.108 =w copy %.107 + storew %.108, %.105 + %.111 =l add %.110, 0 + %.112 =w copy 27520 + storeh %.112, %.111 + %.114 =l add %.113, 0 + %.115 =l extsw 0 + %.116 =l sub %.115, 6 + %.117 =w copy %.116 + storew %.117, %.114 + %.119 =l add %.118, 0 + %.120 =l extsw 0 + %.121 =l sub %.120, 8 + %.122 =w copy %.121 + storew %.122, %.119 + %.124 =l add %.123, 0 + %.125 =w copy 0 + storew %.125, %.124 + %.127 =l add %.126, 0 + %.128 =w copy 3763325653 + storew %.128, %.127 + %.130 =l add %.129, 0 + %.131 =w copy 2542601390 + storew %.131, %.130 + %.134 =l add %.133, 0 + %.135 =l extsw 0 + %.136 =l sub %.135, 1 + %.137 =w copy %.136 + storew %.137, %.134 + %.138 =l add %.133, 4 + %.139 =w copy 1 + storew %.139, %.138 + %.140 =l add %.133, 8 + %.141 =w copy 0 + storeh %.141, %.140 + %.142 =l add %.133, 10 + storeh 0, %.142 + %.143 =l add %.133, 12 + %.144 =w copy 1 + storew %.144, %.143 + %.145 =l add %.133, 16 + %.146 =w copy 1878225502 + storew %.146, %.145 + %.148 =l add %.147, 0 + %.149 =l extsw 0 + %.150 =l copy %.149 + storel %.150, %.148 + %.152 =l add %.151, 0 + %.153 =l extsw 0 + %.154 =l copy %.153 + storel %.154, %.152 + %.156 =l add %.155, 0 + %.157 =l copy %.89 + %.158 =l mul 8, 1 + %.159 =l add %.157, %.158 + %.160 =l copy %.159 + storel %.160, %.156 + %.162 =l add %.161, 0 + %.163 =w copy 44324 + storeh %.163, %.162 + %.166 =l add %.165, 0 + %.167 =l extsw 0 + %.168 =l sub %.167, 2 + %.169 =w copy %.168 + storew %.169, %.166 + %.171 =l add %.170, 0 + %.172 =w copy 18816 + storeh %.172, %.171 + storew 0, %.173 +@for_cond.1025 + %.176 =w loadsw %.173 + %.177 =w csltw %.176, 1 + jnz %.177, @for_body.1026, @for_join.1028 +@for_body.1026 + %.178 =l copy 18446744073709551606 + %.179 =w loadsw %.173 + %.180 =l extsw %.179 + %.181 =l mul %.180, 8 + %.182 =l add %.109, %.181 + storel %.178, %.182 +@for_cont.1027 + %.183 =w loadsw %.173 + %.184 =w add %.183, 1 + storew %.184, %.173 + jmp @for_cond.1025 +@for_join.1028 + storew 0, %.173 +@for_cond.1029 + %.185 =w loadsw %.173 + %.186 =w csltw %.185, 6 + jnz %.186, @for_body.1030, @for_join.1032 +@for_body.1030 + %.187 =w copy 3620798230 + %.188 =w loadsw %.173 + %.189 =l extsw %.188 + %.190 =l mul %.189, 4 + %.191 =l add %.132, %.190 + storew %.187, %.191 +@for_cont.1031 + %.192 =w loadsw %.173 + %.193 =w add %.192, 1 + storew %.193, %.173 + jmp @for_cond.1029 +@for_join.1032 + storew 0, %.173 +@for_cond.1033 + %.194 =w loadsw %.173 + %.195 =w csltw %.194, 3 + jnz %.195, @for_body.1034, @for_join.1036 +@for_body.1034 + %.196 =w copy 1 + %.197 =w loadsw %.173 + %.198 =l extsw %.197 + %.199 =l mul %.198, 4 + %.200 =l add %.164, %.199 + storew %.196, %.200 +@for_cont.1035 + %.201 =w loadsw %.173 + %.202 =w add %.201, 1 + storew %.202, %.173 + jmp @for_cond.1033 +@for_join.1036 + %.203 =w loadsb %.5 + %.204 =w extsb %.203 + %.205 =w cnew %.204, 0 + jnz %.205, @if_true.1037, @if_false.1038 +@if_true.1037 + %.207 =l add %.206, 0 + %.208 =w copy 58237 + storeh %.208, %.207 + %.210 =l add %.209, 0 + storel $g_634, %.210 + %.211 =l add %.209, 8 + storel $g_634, %.211 + %.212 =l add %.209, 16 + storel $g_634, %.212 + %.213 =l add %.209, 24 + storel $g_634, %.213 + %.214 =l add %.209, 32 + storel $g_634, %.214 + %.215 =l add %.209, 40 + storel $g_634, %.215 + %.216 =l add %.209, 48 + storel $g_634, %.216 + %.217 =l add %.209, 56 + storel $g_634, %.217 + %.218 =l add %.209, 64 + storel $g_634, %.218 + %.220 =l add %.219, 0 + %.221 =l extsw 0 + %.222 =l sub %.221, 1 + %.223 =w copy %.222 + storew %.223, %.220 + %.225 =l add %.224, 0 + %.226 =w copy 0 + storew %.226, %.225 + %.228 =l add %.227, 0 + %.229 =w copy 1423873353 + storew %.229, %.228 + %.231 =l add %.230, 0 + %.232 =w copy 141 + storeb %.232, %.231 + %.234 =l add %.233, 0 + storel $g_81, %.234 + %.236 =l add %.235, 0 + storel %.233, %.236 + %.238 =l add %.237, 0 + %.239 =w copy 3164006327 + storew %.239, %.238 + %.242 =w copy 0 + %.243 =l copy $g_518 + %.244 =l mul 36, 1 + %.245 =l add %.243, %.244 + %.246 =l copy %.245 + storew %.242, %.246 +@for_cond.1039 + %.247 =l copy $g_518 + %.248 =l mul 36, 1 + %.249 =l add %.247, %.248 + %.250 =l copy %.249 + %.251 =w loaduw %.250 + %.252 =w copy 7 + %.253 =w culew %.251, %.252 + jnz %.253, @for_body.1040, @for_join.1042 +@for_body.1040 + %.255 =l add %.254, 0 + %.256 =l copy $g_265 + %.257 =l mul 40, 1 + %.258 =l add %.256, %.257 + %.259 =l copy %.258 + storel %.259, %.255 + %.260 =w copy 0 + %.261 =l copy $g_185 + %.262 =l mul 32, 1 + %.263 =l add %.261, %.262 + %.264 =l copy %.263 + storew %.260, %.264 +@for_cond.1043 + %.265 =l copy $g_185 + %.266 =l mul 32, 1 + %.267 =l add %.265, %.266 + %.268 =l copy %.267 + %.269 =w loaduw %.268 + %.270 =w copy 7 + %.271 =w culew %.269, %.270 + jnz %.271, @for_body.1044, @for_join.1046 +@for_body.1044 + %.273 =l add %.272, 0 + %.274 =w copy 247 + storeb %.274, %.273 + %.276 =l add %.275, 0 + %.277 =w copy 115 + storeb %.277, %.276 + %.278 =l add %.275, 1 + storeb 0, %.278 + %.279 =l add %.275, 2 + storeh 0, %.279 + %.280 =l add %.275, 4 + storew 0, %.280 + %.281 =l add %.275, 8 + %.282 =l copy 15860712757478651316 + storel %.282, %.281 + %.283 =l add %.275, 16 + %.284 =w copy 0 + storew %.284, %.283 + %.285 =l add %.275, 20 + storew 0, %.285 + %.286 =l add %.275, 24 + %.287 =l copy 0 + storel %.287, %.286 + %.288 =l add %.275, 32 + %.289 =w copy 4294967295 + storew %.289, %.288 + %.290 =l add %.275, 36 + %.291 =w copy 231051218 + storew %.291, %.290 + %.292 =l add %.275, 40 + %.293 =w copy 4107508781 + storew %.293, %.292 + %.294 =l add %.275, 44 + %.295 =w copy 3780069515 + storew %.295, %.294 + %.296 =l add %.275, 48 + %.297 =w copy 2575030066 + storew %.297, %.296 + %.298 =l add %.275, 52 + storew 0, %.298 + %.299 =l loadl %.4 + %.300 =w loadsw %.299 + %.301 =l loadl $g_173 + %.302 =w loadsw %.301 + %.303 =l extsw %.302 + %.304 =l and %.303, 7 + %.305 =w copy %.304 + storew %.305, %.301 + %.306 =w or %.300, %.305 + storew %.306, %.299 + %.307 =w loaduh %.206 + %.308 =w extuh %.307 + %.309 =l extsw 0 + %.310 =l sub %.309, 10 + %.311 =w cnel %.310, 0 + jnz %.311, @logic_join.1048, @logic_right.1047 +@logic_right.1047 + %.312 =w loadub %.272 + %.313 =w extub %.312 + %.314 =w cnew %.313, 0 +@logic_join.1048 + %.315 =w phi @for_body.1044 %.311, @logic_right.1047 %.314 + %.316 =w loadsb %.5 + %.317 =w extsb %.316 + %.318 =w csgew %.315, %.317 + %.319 =w cnew %.308, %.318 + %.320 =l extsw %.319 + %.321 =w cslel 63086, %.320 + %.322 =w cnew %.321, 0 + jnz %.322, @if_true.1049, @if_false.1050 +@if_true.1049 + %.324 =l add %.323, 0 + storel $g_619, %.324 + %.326 =l add %.325, 0 + storel %.323, %.326 + %.328 =l add %.327, 0 + storel $g_84, %.328 + %.330 =l add %.329, 0 + storel $g_82, %.330 + %.332 =l add %.331, 0 + %.333 =w copy 107414150 + storew %.333, %.332 + %.335 =l loadl $g_173 + %.336 =w loadsw %.335 + %.337 =w copy %.336 + %.338 =w loadsw %.2 + %.339 =w copy %.338 + %.340 =w copy 254 + %.341 =l loadl %.325 + storel $g_619, %.341 + %.342 =w ceql $g_619, $g_619 + %.343 =w copy %.342 + %.344 =w call $safe_add_func_uint8_t_u_u(w %.340, w %.343) + %.345 =w loadsw %.2 + %.346 =l extsw %.345 + %.347 =w ceql 7045748483853119398, %.346 + %.348 =w copy %.347 + %.349 =l loadl %.327 + storew %.348, %.349 + %.350 =w cnel 65535, 0 + jnz %.350, @logic_right.1051, @logic_join.1052 +@logic_right.1051 + %.351 =l copy $g_130 + %.352 =l mul 8, 1 + %.353 =l add %.351, %.352 + %.354 =l copy %.353 + %.355 =w loadsh %.354 + %.356 =l extsh %.355 + %.357 =w loadsw $g_24 + %.358 =l extsw %.357 + %.359 =l loadl %.329 + storel %.358, %.359 + %.360 =l and %.356, %.358 + %.361 =w loadsw %.331 + %.362 =l extsw %.361 + %.363 =w csltl %.360, %.362 + %.364 =w loaduh %.206 + %.365 =w extuh %.364 + %.366 =w cnew %.363, %.365 + %.367 =w loadsb %.5 + %.368 =w extsb %.367 + %.369 =w csgtw %.366, %.368 + %.370 =w cnew %.369, 0 +@logic_join.1052 + %.371 =w phi @if_true.1049 %.350, @logic_right.1051 %.370 + %.372 =w copy %.371 + %.373 =w cnew %.348, %.372 + %.374 =w loadsw %.331 + %.375 =l extsw %.374 + %.376 =w cslel 130, %.375 + %.377 =w loadsb %.5 + %.378 =l extsb %.377 + %.379 =l xor 1351500553408859485, %.378 + %.380 =w copy %.379 + %.381 =w call $safe_div_func_uint32_t_u_u(w %.339, w %.380) + %.382 =w and %.337, %.381 + %.383 =w copy %.382 + storew %.383, %.335 + jmp @if_join.1053 +@if_false.1050 + %.384 =l extsw 2 + storel %.384, $g_82 +@for_cond.1054 + %.385 =l loadl $g_82 + %.386 =l extsw 7 + %.387 =w cslel %.385, %.386 + jnz %.387, @for_body.1055, @for_join.1057 +@for_body.1055 + %.388 =w loadsb %.5 + %.389 =w extsb %.388 + %.390 =w cnew %.389, 0 + jnz %.390, @if_true.1058, @if_false.1059 +@if_true.1058 + jmp @for_join.1057 +@if_false.1059 + %.391 =l extsw 0 + %.392 =l copy %.391 + storel %.392, %.254 +@for_cont.1056 + %.393 =l loadl $g_82 + %.394 =l extsw 1 + %.395 =l add %.393, %.394 + storel %.395, $g_82 + jmp @for_cond.1054 +@for_join.1057 + storew 0, $g_24 +@for_cond.1060 + %.396 =w loadsw $g_24 + %.397 =w csltw %.396, 6 + jnz %.397, @for_body.1061, @for_join.1063 +@for_body.1061 + %.398 =w copy 1 + %.399 =w loadsw $g_24 + %.400 =l extsw %.399 + %.401 =l mul %.400, 1 + %.402 =l add $g_132, %.401 + storeb %.398, %.402 +@for_cont.1062 + %.403 =w loadsw $g_24 + %.404 =w add %.403, 1 + storew %.404, $g_24 + jmp @for_cond.1060 +@for_join.1063 + %.405 =l loadl $g_23 + %.406 =w loadsw %.405 + %.407 =l copy %.275 + %.408 =l mul 16, 1 + %.409 =l add %.407, %.408 + %.410 =l copy %.409 + %.411 =w loadsw %.410 + %.412 =w or %.406, %.411 + storew %.412, %.405 +@if_join.1053 +@for_cont.1045 + %.413 =l copy $g_185 + %.414 =l mul 32, 1 + %.415 =l add %.413, %.414 + %.416 =l copy %.415 + %.417 =w loaduw %.416 + %.418 =w copy 1 + %.419 =w add %.417, %.418 + storew %.419, %.416 + jmp @for_cond.1043 +@for_join.1046 +@for_cont.1041 + %.420 =l copy $g_518 + %.421 =l mul 36, 1 + %.422 =l add %.420, %.421 + %.423 =l copy %.422 + %.424 =w loaduw %.423 + %.425 =w copy 1 + %.426 =w add %.424, %.425 + storew %.426, %.423 + jmp @for_cond.1039 +@for_join.1042 + %.427 =l loadl $g_38 + %.428 =l loadl %.427 + %.429 =w loadsw %.428 + %.430 =l extsw %.429 + %.431 =l xor %.430, 0 + %.432 =w copy %.431 + storew %.432, %.428 + %.433 =l copy $g_518 + %.434 =l mul 40, 1 + %.435 =l add %.433, %.434 + %.436 =l copy %.435 + storew 0, %.436 +@for_cond.1064 + %.437 =l copy $g_518 + %.438 =l mul 40, 1 + %.439 =l add %.437, %.438 + %.440 =l copy %.439 + %.441 =w loadsw %.440 + %.442 =w sub 0, 24 + %.443 =w csgew %.441, %.442 + jnz %.443, @for_body.1065, @for_join.1067 +@for_body.1065 + %.445 =l add %.444, 0 + %.446 =w copy 9830 + storeh %.446, %.445 + %.449 =l add %.448, 0 + %.450 =l extsw 0 + %.451 =l copy %.450 + storel %.451, %.449 + %.453 =l add %.452, 0 + %.454 =w copy 200348871 + storew %.454, %.453 + %.456 =l add %.455, 0 + %.457 =w copy 18446744073709551615 + storew %.457, %.456 + %.459 =l add %.458, 0 + %.460 =w copy 640759230 + storew %.460, %.459 + %.463 =l add %.462, 0 + storel %.37, %.463 + storew 0, %.464 +@for_cond.1068 + %.466 =w loadsw %.464 + %.467 =w csltw %.466, 2 + jnz %.467, @for_body.1069, @for_join.1071 +@for_body.1069 + storew 0, %.465 +@for_cond.1072 + %.468 =w loadsw %.465 + %.469 =w csltw %.468, 3 + jnz %.469, @for_body.1073, @for_join.1075 +@for_body.1073 + %.470 =w copy 4109095570 + %.471 =w loadsw %.464 + %.472 =l extsw %.471 + %.473 =l mul %.472, 12 + %.474 =l add %.447, %.473 + %.475 =w loadsw %.465 + %.476 =l extsw %.475 + %.477 =l mul %.476, 4 + %.478 =l add %.474, %.477 + storew %.470, %.478 +@for_cont.1074 + %.479 =w loadsw %.465 + %.480 =w add %.479, 1 + storew %.480, %.465 + jmp @for_cond.1072 +@for_join.1075 +@for_cont.1070 + %.481 =w loadsw %.464 + %.482 =w add %.481, 1 + storew %.482, %.464 + jmp @for_cond.1068 +@for_join.1071 + storew 0, %.464 +@for_cond.1076 + %.483 =w loadsw %.464 + %.484 =w csltw %.483, 2 + jnz %.484, @for_body.1077, @for_join.1079 +@for_body.1077 + %.485 =w copy 14430 + %.486 =w loadsw %.464 + %.487 =l extsw %.486 + %.488 =l mul %.487, 2 + %.489 =l add %.461, %.488 + storeh %.485, %.489 +@for_cont.1078 + %.490 =w loadsw %.464 + %.491 =w add %.490, 1 + storew %.491, %.464 + jmp @for_cond.1076 +@for_join.1079 +@for_cont.1066 + %.492 =l copy $g_518 + %.493 =l mul 40, 1 + %.494 =l add %.492, %.493 + %.495 =l copy %.494 + %.496 =w loadsw %.495 + %.497 =w sub %.496, 1 + storew %.497, %.495 + jmp @for_cond.1064 +@for_join.1067 + %.498 =w loadsw %.224 + %.499 =l loadl $g_23 + storew %.498, %.499 + jmp @if_join.1080 +@if_false.1038 + %.501 =l add %.500, 0 + %.502 =w copy 1 + storeb %.502, %.501 + %.504 =l add %.503, 0 + storel $g_776, %.504 + %.506 =l add %.505, 0 + %.507 =l extsw 0 + %.508 =l copy %.507 + storel %.508, %.506 + %.510 =l add %.509, 0 + %.511 =w copy 220 + storeb %.511, %.510 + %.513 =l add %.512, 0 + storel $g_794, %.513 + %.514 =l add %.512, 8 + storel $g_794, %.514 + %.515 =l add %.512, 16 + storel %.89, %.515 + %.516 =l add %.512, 24 + storel $g_794, %.516 + %.517 =l add %.512, 32 + storel $g_794, %.517 + %.518 =l add %.512, 40 + storel $g_794, %.518 + %.519 =l add %.512, 48 + storel %.89, %.519 + %.520 =l add %.512, 56 + storel $g_794, %.520 + %.521 =l add %.512, 64 + storel $g_794, %.521 + %.522 =l add %.512, 72 + storel $g_130, %.522 + %.523 =l add %.512, 80 + storel $g_794, %.523 + %.524 =l add %.512, 88 + storel $g_794, %.524 + %.525 =l add %.512, 96 + storel %.89, %.525 + %.526 =l add %.512, 104 + storel %.89, %.526 + %.527 =l add %.512, 112 + storel $g_794, %.527 + %.528 =l add %.512, 120 + storel $g_794, %.528 + %.529 =l add %.512, 128 + storel $g_130, %.529 + %.530 =l add %.512, 136 + storel $g_794, %.530 + %.532 =l add %.531, 0 + storel %.8, %.532 + %.534 =l add %.533, 0 + %.535 =w copy 3959554745 + storew %.535, %.534 + %.536 =l add %.533, 4 + %.537 =w copy 0 + storew %.537, %.536 + %.538 =l add %.533, 8 + %.539 =l extsw 0 + %.540 =l sub %.539, 1 + %.541 =w copy %.540 + storew %.541, %.538 + %.542 =l add %.533, 12 + %.543 =w copy 1653568614 + storew %.543, %.542 + %.544 =l add %.533, 16 + %.545 =w copy 3252988231 + storew %.545, %.544 + %.546 =l add %.533, 20 + %.547 =w copy 3 + storew %.547, %.546 + %.548 =l add %.533, 24 + %.549 =w copy 1653568614 + storew %.549, %.548 + %.550 =l add %.533, 28 + %.551 =w copy 2004438502 + storew %.551, %.550 + %.552 =l add %.533, 32 + %.553 =w copy 3959554745 + storew %.553, %.552 + %.554 =l add %.533, 36 + %.555 =w copy 4196441402 + storew %.555, %.554 + %.556 =l add %.533, 40 + %.557 =l extsw 0 + %.558 =l sub %.557, 1 + %.559 =w copy %.558 + storew %.559, %.556 + %.560 =l add %.533, 44 + %.561 =w copy 1 + storew %.561, %.560 + %.562 =l add %.533, 48 + %.563 =w copy 0 + storew %.563, %.562 + %.564 =l add %.533, 52 + %.565 =w copy 3252988231 + storew %.565, %.564 + %.566 =l add %.533, 56 + %.567 =l extsw 0 + %.568 =l sub %.567, 9 + %.569 =w copy %.568 + storew %.569, %.566 + %.570 =l add %.533, 60 + %.571 =w copy 3 + storew %.571, %.570 + %.572 =l add %.533, 64 + %.573 =w copy 2108666265 + storew %.573, %.572 + %.574 =l add %.533, 68 + %.575 =w copy 1 + storew %.575, %.574 + %.576 =l add %.533, 72 + %.577 =w copy 3 + storew %.577, %.576 + %.578 =l add %.533, 76 + %.579 =w copy 0 + storew %.579, %.578 + %.580 =l add %.533, 80 + %.581 =w copy 3959554745 + storew %.581, %.580 + %.582 =l add %.533, 84 + %.583 =w copy 836215103 + storew %.583, %.582 + %.584 =l add %.533, 88 + %.585 =w copy 2004438502 + storew %.585, %.584 + %.586 =l add %.533, 92 + %.587 =w copy 1 + storew %.587, %.586 + %.588 =l add %.533, 96 + %.589 =w copy 1 + storew %.589, %.588 + %.590 =l add %.533, 100 + %.591 =w copy 2853350422 + storew %.591, %.590 + %.592 =l add %.533, 104 + %.593 =w copy 836215103 + storew %.593, %.592 + %.594 =l add %.533, 108 + %.595 =w copy 2853350422 + storew %.595, %.594 + %.596 =l add %.533, 112 + %.597 =w copy 0 + storew %.597, %.596 + %.598 =l add %.533, 116 + %.599 =w copy 3 + storew %.599, %.598 + %.600 =l add %.533, 120 + %.601 =w copy 1 + storew %.601, %.600 + %.602 =l add %.533, 124 + %.603 =w copy 2108666265 + storew %.603, %.602 + %.604 =l add %.533, 128 + %.605 =w copy 0 + storew %.605, %.604 + %.606 =l add %.533, 132 + %.607 =l extsw 0 + %.608 =l sub %.607, 9 + %.609 =w copy %.608 + storew %.609, %.606 + %.610 =l add %.533, 136 + %.611 =w copy 3252988231 + storew %.611, %.610 + %.612 =l add %.533, 140 + %.613 =l extsw 0 + %.614 =l sub %.613, 9 + %.615 =w copy %.614 + storew %.615, %.612 + %.616 =l add %.533, 144 + %.617 =w copy 1 + storew %.617, %.616 + %.618 =l add %.533, 148 + %.619 =w copy 263794776 + storew %.619, %.618 + %.620 =l add %.533, 152 + %.621 =w copy 4196441402 + storew %.621, %.620 + %.622 =l add %.533, 156 + %.623 =w copy 3959554745 + storew %.623, %.622 + %.624 =l add %.533, 160 + %.625 =w copy 2853350422 + storew %.625, %.624 + %.626 =l add %.533, 164 + %.627 =w copy 1653568614 + storew %.627, %.626 + %.628 =l add %.533, 168 + %.629 =w copy 0 + storew %.629, %.628 + %.630 =l add %.533, 172 + %.631 =w copy 3252988231 + storew %.631, %.630 + %.632 =l add %.533, 176 + %.633 =w copy 1653568614 + storew %.633, %.632 + %.634 =l add %.533, 180 + %.635 =w copy 1653568614 + storew %.635, %.634 + %.636 =l add %.533, 184 + %.637 =w copy 0 + storew %.637, %.636 + %.638 =l add %.533, 188 + %.639 =w copy 2853350422 + storew %.639, %.638 + %.640 =l add %.533, 192 + %.641 =w copy 0 + storew %.641, %.640 + %.642 =l add %.533, 196 + %.643 =w copy 3252988231 + storew %.643, %.642 + %.644 =l add %.533, 200 + %.645 =w copy 836215103 + storew %.645, %.644 + %.646 =l add %.533, 204 + %.647 =w copy 0 + storew %.647, %.646 + %.648 =l add %.533, 208 + %.649 =w copy 2004438502 + storew %.649, %.648 + %.650 =l add %.533, 212 + %.651 =w copy 0 + storew %.651, %.650 + %.652 =l add %.533, 216 + %.653 =w copy 836215103 + storew %.653, %.652 + %.654 =l add %.533, 220 + %.655 =l extsw 0 + %.656 =l sub %.655, 1 + %.657 =w copy %.656 + storew %.657, %.654 + %.658 =l add %.533, 224 + %.659 =l extsw 0 + %.660 =l sub %.659, 9 + %.661 =w copy %.660 + storew %.661, %.658 + %.662 =l add %.533, 228 + %.663 =w copy 1 + storew %.663, %.662 + %.664 =l add %.533, 232 + %.665 =w copy 3252988231 + storew %.665, %.664 + %.666 =l add %.533, 236 + %.667 =w copy 2208162857 + storew %.667, %.666 + %.668 =l add %.533, 240 + %.669 =w copy 4196441402 + storew %.669, %.668 + %.670 =l add %.533, 244 + %.671 =w copy 2108666265 + storew %.671, %.670 + %.672 =l add %.533, 248 + %.673 =w copy 0 + storew %.673, %.672 + %.674 =l add %.533, 252 + %.675 =w copy 4196441402 + storew %.675, %.674 + %.676 =l add %.533, 256 + %.677 =w copy 0 + storew %.677, %.676 + %.678 =l add %.533, 260 + %.679 =w copy 0 + storew %.679, %.678 + %.680 =l add %.533, 264 + %.681 =w copy 3 + storew %.681, %.680 + %.682 =l add %.533, 268 + %.683 =w copy 2004438502 + storew %.683, %.682 + %.684 =l add %.533, 272 + %.685 =l extsw 0 + %.686 =l sub %.685, 9 + %.687 =w copy %.686 + storew %.687, %.684 + %.688 =l add %.533, 276 + %.689 =w copy 2208162857 + storew %.689, %.688 + %.690 =l add %.533, 280 + %.691 =w copy 2853350422 + storew %.691, %.690 + %.692 =l add %.533, 284 + %.693 =w copy 4196441402 + storew %.693, %.692 + %.694 =l add %.533, 288 + %.695 =l extsw 0 + %.696 =l sub %.695, 1 + %.697 =w copy %.696 + storew %.697, %.694 + %.698 =l add %.533, 292 + %.699 =w copy 0 + storew %.699, %.698 + %.700 =l add %.533, 296 + %.701 =w copy 836215103 + storew %.701, %.700 + %.702 =l add %.533, 300 + %.703 =w copy 2208162857 + storew %.703, %.702 + %.704 =l add %.533, 304 + %.705 =w copy 2108666265 + storew %.705, %.704 + %.706 =l add %.533, 308 + %.707 =w copy 3252988231 + storew %.707, %.706 + %.708 =l add %.533, 312 + %.709 =w copy 1 + storew %.709, %.708 + %.710 =l add %.533, 316 + %.711 =w copy 3252988231 + storew %.711, %.710 + %.712 =l add %.533, 320 + %.713 =w copy 2208162857 + storew %.713, %.712 + %.714 =l add %.533, 324 + %.715 =w copy 2208162857 + storew %.715, %.714 + %.716 =l add %.533, 328 + %.717 =w copy 263794776 + storew %.717, %.716 + %.718 =l add %.533, 332 + %.719 =w copy 3 + storew %.719, %.718 + %.720 =l add %.533, 336 + %.721 =w copy 1653568614 + storew %.721, %.720 + %.722 =l add %.533, 340 + %.723 =w copy 2853350422 + storew %.723, %.722 + %.724 =l add %.533, 344 + %.725 =w copy 3959554745 + storew %.725, %.724 + %.726 =l add %.533, 348 + %.727 =w copy 1 + storew %.727, %.726 + %.728 =l add %.533, 352 + %.729 =w copy 3252988231 + storew %.729, %.728 + %.730 =l add %.533, 356 + %.731 =w copy 3959554745 + storew %.731, %.730 + %.732 =l add %.533, 360 + %.733 =w copy 0 + storew %.733, %.732 + %.734 =l add %.533, 364 + %.735 =w copy 0 + storew %.735, %.734 + %.736 =l add %.533, 368 + %.737 =w copy 5 + storew %.737, %.736 + %.738 =l add %.533, 372 + %.739 =w copy 3959554745 + storew %.739, %.738 + %.740 =l add %.533, 376 + %.741 =w copy 3252988231 + storew %.741, %.740 + %.742 =l add %.533, 380 + %.743 =w copy 0 + storew %.743, %.742 + %.744 =l add %.533, 384 + %.745 =w copy 3252988231 + storew %.745, %.744 + %.746 =l add %.533, 388 + %.747 =l extsw 0 + %.748 =l sub %.747, 9 + %.749 =w copy %.748 + storew %.749, %.746 + %.750 =l add %.533, 392 + %.751 =w copy 0 + storew %.751, %.750 + %.752 =l add %.533, 396 + %.753 =w copy 2108666265 + storew %.753, %.752 + %.754 =l add %.533, 400 + %.755 =l extsw 0 + %.756 =l sub %.755, 1 + %.757 =w copy %.756 + storew %.757, %.754 + %.758 =l add %.533, 404 + %.759 =w copy 5 + storew %.759, %.758 + %.760 =l add %.533, 408 + %.761 =w copy 1101784401 + storew %.761, %.760 + %.762 =l add %.533, 412 + %.763 =w copy 2523405358 + storew %.763, %.762 + %.764 =l add %.533, 416 + %.765 =l extsw 0 + %.766 =l sub %.765, 1 + %.767 =w copy %.766 + storew %.767, %.764 + %.768 =l add %.533, 420 + %.769 =w copy 1 + storew %.769, %.768 + %.770 =l add %.533, 424 + %.771 =w copy 1101784401 + storew %.771, %.770 + %.772 =l add %.533, 428 + %.773 =w copy 1101784401 + storew %.773, %.772 + %.774 =l add %.533, 432 + %.775 =w copy 1 + storew %.775, %.774 + %.776 =l add %.533, 436 + %.777 =w copy 2657468036 + storew %.777, %.776 + %.778 =l add %.533, 440 + %.779 =w copy 0 + storew %.779, %.778 + %.780 =l add %.533, 444 + %.781 =w copy 0 + storew %.781, %.780 + %.782 =l add %.533, 448 + %.783 =l extsw 0 + %.784 =l sub %.783, 9 + %.785 =w copy %.784 + storew %.785, %.782 + %.786 =l add %.533, 452 + %.787 =w copy 5 + storew %.787, %.786 + %.788 =l add %.533, 456 + %.789 =w copy 2853350422 + storew %.789, %.788 + %.790 =l add %.533, 460 + %.791 =l extsw 0 + %.792 =l sub %.791, 4 + %.793 =w copy %.792 + storew %.793, %.790 + %.794 =l add %.533, 464 + %.795 =w copy 2108666265 + storew %.795, %.794 + %.796 =l add %.533, 468 + %.797 =l extsw 0 + %.798 =l sub %.797, 1 + %.799 =w copy %.798 + storew %.799, %.796 + %.800 =l add %.533, 472 + %.801 =w copy 2657468036 + storew %.801, %.800 + %.802 =l add %.533, 476 + %.803 =w copy 0 + storew %.803, %.802 + %.804 =l add %.533, 480 + %.805 =w copy 2853350422 + storew %.805, %.804 + %.806 =l add %.533, 484 + %.807 =w copy 1101784401 + storew %.807, %.806 + %.808 =l add %.533, 488 + %.809 =w copy 51963591 + storew %.809, %.808 + %.810 =l add %.533, 492 + %.811 =w copy 5 + storew %.811, %.810 + %.812 =l add %.533, 496 + %.813 =w copy 2523405358 + storew %.813, %.812 + %.814 =l add %.533, 500 + %.815 =l extsw 0 + %.816 =l sub %.815, 1 + %.817 =w copy %.816 + storew %.817, %.814 + %.818 =l add %.533, 504 + %.819 =w copy 2853350422 + storew %.819, %.818 + %.820 =l add %.533, 508 + %.821 =w copy 1 + storew %.821, %.820 + %.822 =l add %.533, 512 + %.823 =w copy 1 + storew %.823, %.822 + %.824 =l add %.533, 516 + %.825 =w copy 1 + storew %.825, %.824 + %.826 =l add %.533, 520 + %.827 =l extsw 0 + %.828 =l sub %.827, 4 + %.829 =w copy %.828 + storew %.829, %.826 + %.830 =l add %.533, 524 + %.831 =w copy 1 + storew %.831, %.830 + %.832 =l add %.533, 528 + %.833 =w copy 2523405358 + storew %.833, %.832 + %.834 =l add %.533, 532 + %.835 =w copy 2523405358 + storew %.835, %.834 + %.836 =l add %.533, 536 + %.837 =w copy 1 + storew %.837, %.836 + %.838 =l add %.533, 540 + %.839 =w copy 3252988231 + storew %.839, %.838 + %.840 =l add %.533, 544 + %.841 =w copy 2004438502 + storew %.841, %.840 + %.842 =l add %.533, 548 + %.843 =l extsw 0 + %.844 =l sub %.843, 1 + %.845 =w copy %.844 + storew %.845, %.842 + %.846 =l add %.533, 552 + %.847 =w copy 0 + storew %.847, %.846 + %.848 =l add %.533, 556 + %.849 =w copy 2523405358 + storew %.849, %.848 + %.850 =l add %.533, 560 + %.851 =w copy 2108666265 + storew %.851, %.850 + %.852 =l add %.533, 564 + %.853 =w copy 0 + storew %.853, %.852 + %.854 =l add %.533, 568 + %.855 =l extsw 0 + %.856 =l sub %.855, 9 + %.857 =w copy %.856 + storew %.857, %.854 + %.858 =l add %.533, 572 + %.859 =w copy 3252988231 + storew %.859, %.858 + %.860 =l add %.533, 576 + %.861 =w copy 0 + storew %.861, %.860 + %.862 =l add %.533, 580 + %.863 =l extsw 0 + %.864 =l sub %.863, 1 + %.865 =w copy %.864 + storew %.865, %.862 + %.866 =l add %.533, 584 + %.867 =l extsw 0 + %.868 =l sub %.867, 1 + %.869 =w copy %.868 + storew %.869, %.866 + %.870 =l add %.533, 588 + %.871 =w copy 2004438502 + storew %.871, %.870 + %.872 =l add %.533, 592 + %.873 =w copy 2523405358 + storew %.873, %.872 + %.874 =l add %.533, 596 + %.875 =w copy 2853350422 + storew %.875, %.874 + %.876 =l add %.533, 600 + %.877 =w copy 2108666265 + storew %.877, %.876 + %.878 =l add %.533, 604 + %.879 =w copy 1101784401 + storew %.879, %.878 + %.880 =l add %.533, 608 + %.881 =w copy 263794776 + storew %.881, %.880 + %.882 =l add %.533, 612 + %.883 =w copy 2108666265 + storew %.883, %.882 + %.884 =l add %.533, 616 + %.885 =w copy 2657468036 + storew %.885, %.884 + %.886 =l add %.533, 620 + %.887 =w copy 3252988231 + storew %.887, %.886 + %.888 =l add %.533, 624 + %.889 =w copy 1 + storew %.889, %.888 + %.890 =l add %.533, 628 + %.891 =l extsw 0 + %.892 =l sub %.891, 9 + %.893 =w copy %.892 + storew %.893, %.890 + %.894 =l add %.533, 632 + %.895 =l extsw 0 + %.896 =l sub %.895, 1 + %.897 =w copy %.896 + storew %.897, %.894 + %.898 =l add %.533, 636 + %.899 =l extsw 0 + %.900 =l sub %.899, 1 + %.901 =w copy %.900 + storew %.901, %.898 + %.902 =l add %.533, 640 + %.903 =l extsw 0 + %.904 =l sub %.903, 4 + %.905 =w copy %.904 + storew %.905, %.902 + %.906 =l add %.533, 644 + %.907 =w copy 1 + storew %.907, %.906 + %.908 =l add %.533, 648 + %.909 =l extsw 0 + %.910 =l sub %.909, 4 + %.911 =w copy %.910 + storew %.911, %.908 + %.912 =l add %.533, 652 + %.913 =w copy 2657468036 + storew %.913, %.912 + %.914 =l add %.533, 656 + %.915 =w copy 2108666265 + storew %.915, %.914 + %.916 =l add %.533, 660 + %.917 =l extsw 0 + %.918 =l sub %.917, 1 + %.919 =w copy %.918 + storew %.919, %.916 + %.920 =l add %.533, 664 + %.921 =w copy 1101784401 + storew %.921, %.920 + %.922 =l add %.533, 668 + %.923 =w copy 2657468036 + storew %.923, %.922 + %.924 =l add %.533, 672 + %.925 =w copy 2853350422 + storew %.925, %.924 + %.926 =l add %.533, 676 + %.927 =w copy 2523405358 + storew %.927, %.926 + %.928 =l add %.533, 680 + %.929 =w copy 2853350422 + storew %.929, %.928 + %.930 =l add %.533, 684 + %.931 =l extsw 0 + %.932 =l sub %.931, 1 + %.933 =w copy %.932 + storew %.933, %.930 + %.934 =l add %.533, 688 + %.935 =w copy 1 + storew %.935, %.934 + %.936 =l add %.533, 692 + %.937 =w copy 0 + storew %.937, %.936 + %.938 =l add %.533, 696 + %.939 =w copy 3252988231 + storew %.939, %.938 + %.940 =l add %.533, 700 + %.941 =l extsw 0 + %.942 =l sub %.941, 4 + %.943 =w copy %.942 + storew %.943, %.940 + %.944 =l add %.533, 704 + %.945 =w copy 0 + storew %.945, %.944 + %.946 =l add %.533, 708 + %.947 =w copy 2657468036 + storew %.947, %.946 + %.948 =l add %.533, 712 + %.949 =w copy 2523405358 + storew %.949, %.948 + %.950 =l add %.533, 716 + %.951 =w copy 0 + storew %.951, %.950 + %.952 =l add %.533, 720 + %.953 =w copy 0 + storew %.953, %.952 + %.954 =l add %.533, 724 + %.955 =w copy 2004438502 + storew %.955, %.954 + %.956 =l add %.533, 728 + %.957 =l extsw 0 + %.958 =l sub %.957, 4 + %.959 =w copy %.958 + storew %.959, %.956 + %.960 =l add %.533, 732 + %.961 =w copy 1 + storew %.961, %.960 + %.962 =l add %.533, 736 + %.963 =w copy 2523405358 + storew %.963, %.962 + %.964 =l add %.533, 740 + %.965 =w copy 1 + storew %.965, %.964 + %.966 =l add %.533, 744 + %.967 =w copy 1 + storew %.967, %.966 + %.968 =l add %.533, 748 + %.969 =l extsw 0 + %.970 =l sub %.969, 9 + %.971 =w copy %.970 + storew %.971, %.968 + %.972 =l add %.533, 752 + %.973 =w copy 1 + storew %.973, %.972 + %.974 =l add %.533, 756 + %.975 =w copy 1 + storew %.975, %.974 + %.976 =l add %.533, 760 + %.977 =l extsw 0 + %.978 =l sub %.977, 1 + %.979 =w copy %.978 + storew %.979, %.976 + %.980 =l add %.533, 764 + %.981 =w copy 2853350422 + storew %.981, %.980 + %.982 =l add %.533, 768 + %.983 =w copy 263794776 + storew %.983, %.982 + %.984 =l add %.533, 772 + %.985 =w copy 2523405358 + storew %.985, %.984 + %.986 =l add %.533, 776 + %.987 =w copy 5 + storew %.987, %.986 + %.988 =l add %.533, 780 + %.989 =w copy 0 + storew %.989, %.988 + %.990 =l add %.533, 784 + %.991 =w copy 1101784401 + storew %.991, %.990 + %.992 =l add %.533, 788 + %.993 =w copy 2004438502 + storew %.993, %.992 + %.994 =l add %.533, 792 + %.995 =w copy 0 + storew %.995, %.994 + %.996 =l add %.533, 796 + %.997 =w copy 2657468036 + storew %.997, %.996 + %.998 =l add %.533, 800 + %.999 =w copy 1 + storew %.999, %.998 + %.1000 =l add %.533, 804 + %.1001 =w copy 2108666265 + storew %.1001, %.1000 + %.1002 =l add %.533, 808 + %.1003 =l extsw 0 + %.1004 =l sub %.1003, 9 + %.1005 =w copy %.1004 + storew %.1005, %.1002 + %.1006 =l add %.533, 812 + %.1007 =w copy 2853350422 + storew %.1007, %.1006 + %.1008 =l add %.533, 816 + %.1009 =w copy 5 + storew %.1009, %.1008 + %.1010 =l add %.533, 820 + %.1011 =l extsw 0 + %.1012 =l sub %.1011, 4 + %.1013 =w copy %.1012 + storew %.1013, %.1010 + %.1014 =l add %.533, 824 + %.1015 =w copy 0 + storew %.1015, %.1014 + %.1016 =l add %.533, 828 + %.1017 =l extsw 0 + %.1018 =l sub %.1017, 1 + %.1019 =w copy %.1018 + storew %.1019, %.1016 + %.1020 =l add %.533, 832 + %.1021 =w copy 2657468036 + storew %.1021, %.1020 + %.1022 =l add %.533, 836 + %.1023 =w copy 1 + storew %.1023, %.1022 + %.1024 =l add %.533, 840 + %.1025 =w copy 5 + storew %.1025, %.1024 + %.1026 =l add %.533, 844 + %.1027 =w copy 1101784401 + storew %.1027, %.1026 + %.1028 =l add %.533, 848 + %.1029 =w copy 2523405358 + storew %.1029, %.1028 + %.1030 =l add %.533, 852 + %.1031 =l extsw 0 + %.1032 =l sub %.1031, 1 + %.1033 =w copy %.1032 + storew %.1033, %.1030 + %.1034 =l add %.533, 856 + %.1035 =w copy 2523405358 + storew %.1035, %.1034 + %.1036 =l add %.533, 860 + %.1037 =w copy 5 + storew %.1037, %.1036 + %.1038 =l add %.533, 864 + %.1039 =w copy 5 + storew %.1039, %.1038 + %.1040 =l add %.533, 868 + %.1041 =w copy 1 + storew %.1041, %.1040 + %.1042 =l add %.533, 872 + %.1043 =w copy 2108666265 + storew %.1043, %.1042 + %.1044 =l add %.533, 876 + %.1045 =w copy 0 + storew %.1045, %.1044 + %.1046 =l add %.533, 880 + %.1047 =l extsw 0 + %.1048 =l sub %.1047, 4 + %.1049 =w copy %.1048 + storew %.1049, %.1046 + %.1050 =l add %.533, 884 + %.1051 =w copy 3252988231 + storew %.1051, %.1050 + %.1052 =l add %.533, 888 + %.1053 =w copy 51963591 + storew %.1053, %.1052 + %.1054 =l add %.533, 892 + %.1055 =w copy 2523405358 + storew %.1055, %.1054 + %.1056 =l add %.533, 896 + %.1057 =w copy 3252988231 + storew %.1057, %.1056 + %.1058 =l add %.533, 900 + %.1059 =w copy 1 + storew %.1059, %.1058 + %.1060 =l add %.533, 904 + %.1061 =w copy 2004438502 + storew %.1061, %.1060 + %.1062 =l add %.533, 908 + %.1063 =l extsw 0 + %.1064 =l sub %.1063, 1 + %.1065 =w copy %.1064 + storew %.1065, %.1062 + %.1066 =l add %.533, 912 + %.1067 =w copy 3252988231 + storew %.1067, %.1066 + %.1068 =l add %.533, 916 + %.1069 =w copy 2523405358 + storew %.1069, %.1068 + %.1070 =l add %.533, 920 + %.1071 =w copy 0 + storew %.1071, %.1070 + %.1072 =l add %.533, 924 + %.1073 =w copy 3252988231 + storew %.1073, %.1072 + %.1074 =l add %.533, 928 + %.1075 =l extsw 0 + %.1076 =l sub %.1075, 9 + %.1077 =w copy %.1076 + storew %.1077, %.1074 + %.1078 =l add %.533, 932 + %.1079 =w copy 0 + storew %.1079, %.1078 + %.1080 =l add %.533, 936 + %.1081 =w copy 2108666265 + storew %.1081, %.1080 + %.1082 =l add %.533, 940 + %.1083 =l extsw 0 + %.1084 =l sub %.1083, 1 + %.1085 =w copy %.1084 + storew %.1085, %.1082 + %.1086 =l add %.533, 944 + %.1087 =w copy 5 + storew %.1087, %.1086 + %.1088 =l add %.533, 948 + %.1089 =w copy 1101784401 + storew %.1089, %.1088 + %.1090 =l add %.533, 952 + %.1091 =w copy 2523405358 + storew %.1091, %.1090 + %.1092 =l add %.533, 956 + %.1093 =l extsw 0 + %.1094 =l sub %.1093, 1 + %.1095 =w copy %.1094 + storew %.1095, %.1092 + %.1096 =l add %.533, 960 + %.1097 =w copy 1 + storew %.1097, %.1096 + %.1098 =l add %.533, 964 + %.1099 =w copy 1101784401 + storew %.1099, %.1098 + %.1100 =l add %.533, 968 + %.1101 =w copy 1101784401 + storew %.1101, %.1100 + %.1102 =l add %.533, 972 + %.1103 =w copy 1 + storew %.1103, %.1102 + %.1104 =l add %.533, 976 + %.1105 =w copy 2657468036 + storew %.1105, %.1104 + %.1107 =l add %.1106, 0 + %.1108 =w copy 1 + storew %.1108, %.1107 + %.1110 =l add %.1109, 0 + %.1111 =l extsw 0 + %.1112 =l copy %.1111 + storel %.1112, %.1110 + %.1114 =l add %.1113, 0 + storel %.1109, %.1114 + %.1116 =l add %.1115, 0 + storel $g_130, %.1116 + %.1118 =l add %.1117, 0 + %.1119 =w copy 3 + storew %.1119, %.1118 + %.1121 =l add %.1120, 0 + %.1122 =w copy 67 + storeb %.1122, %.1121 + %.1126 =w copy 25 + %.1127 =l copy $g_518 + %.1128 =l mul 32, 1 + %.1129 =l add %.1127, %.1128 + %.1130 =l copy %.1129 + storew %.1126, %.1130 +@for_cond.1081 + %.1131 =l copy $g_518 + %.1132 =l mul 32, 1 + %.1133 =l add %.1131, %.1132 + %.1134 =l copy %.1133 + %.1135 =w loaduw %.1134 + %.1136 =w copy 43 + %.1137 =w cnew %.1135, %.1136 + jnz %.1137, @for_body.1082, @for_join.1084 +@for_body.1082 + %.1139 =l add %.1138, 0 + %.1140 =w copy 0 + storew %.1140, %.1139 + %.1141 =l add %.1138, 4 + %.1142 =w copy 0 + storew %.1142, %.1141 + %.1143 =l add %.1138, 8 + %.1144 =w copy 0 + storew %.1144, %.1143 + %.1145 =l add %.1138, 12 + %.1146 =w copy 0 + storew %.1146, %.1145 + %.1147 =l add %.1138, 16 + %.1148 =w copy 0 + storew %.1148, %.1147 + %.1149 =l add %.1138, 20 + %.1150 =w copy 0 + storew %.1150, %.1149 + %.1151 =l add %.1138, 24 + %.1152 =w copy 0 + storew %.1152, %.1151 + %.1153 =l add %.1138, 28 + %.1154 =w copy 0 + storew %.1154, %.1153 + %.1155 =l add %.1138, 32 + %.1156 =w copy 0 + storew %.1156, %.1155 + %.1158 =l loadl $g_23 + %.1159 =w loadsw %.1158 + %.1160 =l extsw 6 + %.1161 =l mul %.1160, 4 + %.1162 =l add %.1138, %.1161 + %.1163 =w loadsw %.1162 + %.1164 =w and %.1159, %.1163 + storew %.1164, %.1158 +@for_cont.1083 + %.1165 =l copy $g_518 + %.1166 =l mul 32, 1 + %.1167 =l add %.1165, %.1166 + %.1168 =l copy %.1167 + %.1169 =w loaduw %.1168 + %.1170 =l extuw %.1169 + %.1171 =l extsw 2 + %.1172 =l call $safe_add_func_uint64_t_u_u(l %.1170, l %.1171) + %.1173 =w copy %.1172 + %.1174 =l copy $g_518 + %.1175 =l mul 32, 1 + %.1176 =l add %.1174, %.1175 + %.1177 =l copy %.1176 + storew %.1173, %.1177 + jmp @for_cond.1081 +@for_join.1084 + %.1178 =w loadub %.500 + %.1179 =w sub %.1178, 1 + storeb %.1179, %.500 + %.1180 =w copy 27 + %.1181 =l copy %.89 + %.1182 =l mul 8, 1 + %.1183 =l add %.1181, %.1182 + %.1184 =l copy %.1183 + storeh %.1180, %.1184 +@for_cond.1085 + %.1185 =l copy %.89 + %.1186 =l mul 8, 1 + %.1187 =l add %.1185, %.1186 + %.1188 =l copy %.1187 + %.1189 =w loadsh %.1188 + %.1190 =w extsh %.1189 + %.1191 =w sub 0, 12 + %.1192 =w cslew %.1190, %.1191 + jnz %.1192, @for_body.1086, @for_join.1088 +@for_body.1086 + %.1194 =l add %.1193, 0 + %.1195 =l extsw 0 + %.1196 =l sub %.1195, 3 + %.1197 =l copy %.1196 + storel %.1197, %.1194 + %.1199 =l add %.1198, 0 + %.1200 =w copy 1 + storew %.1200, %.1199 + %.1201 =l add %.1198, 4 + %.1202 =w copy 1 + storew %.1202, %.1201 + %.1203 =l add %.1198, 8 + %.1204 =w copy 3909724799 + storew %.1204, %.1203 + %.1205 =l add %.1198, 12 + %.1206 =w copy 1 + storew %.1206, %.1205 + %.1207 =l add %.1198, 16 + %.1208 =w copy 1 + storew %.1208, %.1207 + %.1209 =l add %.1198, 20 + %.1210 =w copy 3909724799 + storew %.1210, %.1209 + %.1212 =l add %.1211, 0 + storel %.531, %.1212 + %.1214 =l add %.1213, 0 + storel %.1109, %.1214 + %.1216 =w copy 0 + storew %.1216, $g_84 +@for_cond.1089 + %.1217 =w loaduw $g_84 + %.1218 =w copy 0 + %.1219 =w culew %.1217, %.1218 + jnz %.1219, @for_body.1090, @for_join.1092 +@for_body.1090 + %.1221 =l add %.1220, 0 + %.1222 =w copy 9 + storeb %.1222, %.1221 + %.1223 =l add %.1220, 1 + %.1224 =w copy 21 + storeb %.1224, %.1223 + %.1225 =l add %.1220, 2 + %.1226 =w copy 1 + storeb %.1226, %.1225 + %.1227 =l add %.1220, 3 + %.1228 =w copy 1 + storeb %.1228, %.1227 + %.1229 =l add %.1220, 4 + %.1230 =w copy 1 + storeb %.1230, %.1229 + %.1231 =l add %.1220, 5 + %.1232 =w copy 21 + storeb %.1232, %.1231 + %.1233 =l add %.1220, 6 + %.1234 =w copy 9 + storeb %.1234, %.1233 + %.1235 =l add %.1220, 7 + %.1236 =w copy 70 + storeb %.1236, %.1235 + %.1237 =l add %.1220, 8 + %.1238 =w copy 5 + storeb %.1238, %.1237 + %.1239 =l add %.1220, 9 + %.1240 =w copy 70 + storeb %.1240, %.1239 + %.1241 =l add %.1220, 10 + %.1242 =w copy 9 + storeb %.1242, %.1241 + %.1243 =l add %.1220, 11 + %.1244 =w copy 21 + storeb %.1244, %.1243 + %.1245 =l add %.1220, 12 + %.1246 =w copy 1 + storeb %.1246, %.1245 + %.1247 =l add %.1220, 13 + %.1248 =w copy 1 + storeb %.1248, %.1247 + %.1249 =l add %.1220, 14 + %.1250 =w copy 1 + storeb %.1250, %.1249 + %.1251 =l add %.1220, 15 + %.1252 =w copy 21 + storeb %.1252, %.1251 + %.1253 =l add %.1220, 16 + %.1254 =w copy 9 + storeb %.1254, %.1253 + %.1255 =l add %.1220, 17 + %.1256 =w copy 70 + storeb %.1256, %.1255 + %.1257 =l add %.1220, 18 + %.1258 =w copy 5 + storeb %.1258, %.1257 + %.1259 =l add %.1220, 19 + %.1260 =w copy 70 + storeb %.1260, %.1259 + %.1262 =l add %.1261, 0 + storel $g_50, %.1262 + %.1264 =l add %.1263, 0 + %.1265 =w copy 2636067377 + storew %.1265, %.1264 + %.1267 =l add %.1266, 0 + %.1268 =w copy 1 + storew %.1268, %.1267 + %.1270 =l add %.1269, 0 + %.1271 =w copy 3650403282 + storew %.1271, %.1270 + %.1273 =l add %.1272, 0 + %.1274 =w copy 6 + storew %.1274, %.1273 + %.1277 =l add %.1276, 0 + storel $g_58, %.1277 + %.1279 =l add %.1278, 0 + %.1280 =l copy $g_185 + %.1281 =l mul 8, 1 + %.1282 =l add %.1280, %.1281 + %.1283 =l copy %.1282 + storel %.1283, %.1279 + %.1285 =l add %.1284, 0 + %.1286 =w copy 7 + storeb %.1286, %.1285 + %.1288 =l add %.1287, 0 + storel $g_81, %.1288 + %.1290 =l add %.1289, 0 + storel %.5, %.1290 + %.1292 =l add %.1291, 0 + %.1293 =w copy 54 + storeb %.1293, %.1292 + %.1294 =l add %.1291, 1 + storeb 0, %.1294 + %.1295 =l add %.1291, 2 + storeh 0, %.1295 + %.1296 =l add %.1291, 4 + storew 0, %.1296 + %.1297 =l add %.1291, 8 + %.1298 =l extsw 0 + %.1299 =l sub %.1298, 7 + %.1300 =l copy %.1299 + storel %.1300, %.1297 + %.1301 =l add %.1291, 16 + %.1302 =w copy 1 + storew %.1302, %.1301 + %.1303 =l add %.1291, 20 + storew 0, %.1303 + %.1304 =l add %.1291, 24 + storel 11604192345489365348, %.1304 + %.1305 =l add %.1291, 32 + %.1306 =w copy 9 + storew %.1306, %.1305 + %.1307 =l add %.1291, 36 + %.1308 =w copy 0 + storew %.1308, %.1307 + %.1309 =l add %.1291, 40 + %.1310 =w copy 3737664569 + storew %.1310, %.1309 + %.1311 =l add %.1291, 44 + %.1312 =w copy 2923809832 + storew %.1312, %.1311 + %.1313 =l add %.1291, 48 + %.1314 =w copy 0 + storew %.1314, %.1313 + %.1315 =l add %.1291, 52 + storew 0, %.1315 + storew 0, %.1316 +@for_cond.1093 + %.1319 =w loadsw %.1316 + %.1320 =w csltw %.1319, 3 + jnz %.1320, @for_body.1094, @for_join.1096 +@for_body.1094 + %.1321 =w copy 4 + %.1322 =w loadsw %.1316 + %.1323 =l extsw %.1322 + %.1324 =l mul %.1323, 4 + %.1325 =l add %.1275, %.1324 + storew %.1321, %.1325 +@for_cont.1095 + %.1326 =w loadsw %.1316 + %.1327 =w add %.1326, 1 + storew %.1327, %.1316 + jmp @for_cond.1093 +@for_join.1096 + %.1328 =w copy 0 + %.1329 =l copy $g_130 + %.1330 =l mul 8, 1 + %.1331 =l add %.1329, %.1330 + %.1332 =l copy %.1331 + storeh %.1328, %.1332 +@for_cond.1097 + %.1333 =l copy $g_130 + %.1334 =l mul 8, 1 + %.1335 =l add %.1333, %.1334 + %.1336 =l copy %.1335 + %.1337 =w loadsh %.1336 + %.1338 =w extsh %.1337 + %.1339 =w csgew %.1338, 0 + jnz %.1339, @for_body.1098, @for_join.1100 +@for_body.1098 + %.1340 =l copy %.10 + %.1341 =l mul 48, 1 + %.1342 =l add %.1340, %.1341 + %.1343 =l copy %.1342 + storew 0, %.1343 +@for_cond.1101 + %.1344 =l copy %.10 + %.1345 =l mul 48, 1 + %.1346 =l add %.1344, %.1345 + %.1347 =l copy %.1346 + %.1348 =w loadsw %.1347 + %.1349 =w cslew %.1348, 0 + jnz %.1349, @for_body.1102, @for_join.1104 +@for_body.1102 + %.1351 =l add %.1350, 0 + storel $g_794, %.1351 + storel %.2, %.4 + %.1352 =l loadl %.1350 + %.1353 =l loaduw %.89 + storew %.1353, %.1352 + %.1354 =l add %.89, 4 + %.1355 =l add %.1352, 4 + %.1356 =l loaduw %.1354 + storew %.1356, %.1355 + %.1357 =l add %.1354, 4 + %.1358 =l add %.1355, 4 + %.1359 =l loaduw %.1357 + storew %.1359, %.1358 + %.1360 =l add %.1357, 4 + %.1361 =l add %.1358, 4 + %.1362 =l loaduw %.1360 + storew %.1362, %.1361 + %.1363 =l add %.1360, 4 + %.1364 =l add %.1361, 4 + %.1365 =l loaduw %.1363 + storew %.1365, %.1364 + %.1366 =l add %.1363, 4 + %.1367 =l add %.1364, 4 +@for_cont.1103 + %.1368 =l copy %.10 + %.1369 =l mul 48, 1 + %.1370 =l add %.1368, %.1369 + %.1371 =l copy %.1370 + %.1372 =w loadsw %.1371 + %.1373 =w add %.1372, 1 + storew %.1373, %.1371 + jmp @for_cond.1101 +@for_join.1104 + %.1374 =l extsw 0 + storel %.1374, $g_82 +@for_cond.1105 + %.1375 =l loadl $g_82 + %.1376 =l extsw 1 + %.1377 =w cslel %.1375, %.1376 + jnz %.1377, @for_body.1106, @for_join.1108 +@for_body.1106 + %.1379 =w copy 6 + %.1380 =l loadl %.4 + storew %.1379, %.1380 + %.1381 =l extsw 2 + %.1382 =l mul %.1381, 2 + %.1383 =l add %.1220, %.1382 + %.1384 =l extsw 0 + %.1385 =l mul %.1384, 1 + %.1386 =l add %.1383, %.1385 + %.1387 =l extsw 0 + %.1388 =l mul %.1387, 1 + %.1389 =l add %.1386, %.1388 + %.1390 =w loadsb %.1389 + %.1391 =w extsb %.1390 + ret %.1391 +@for_cont.1107 + %.1392 =l loadl $g_82 + %.1393 =l extsw 1 + %.1394 =l add %.1392, %.1393 + storel %.1394, $g_82 + jmp @for_cond.1105 +@for_join.1108 + %.1395 =l copy $g_794 + %.1396 =l mul 12, 1 + %.1397 =l add %.1395, %.1396 + %.1398 =l copy %.1397 + storew 0, %.1398 +@for_cond.1109 + %.1399 =l copy $g_794 + %.1400 =l mul 12, 1 + %.1401 =l add %.1399, %.1400 + %.1402 =l copy %.1401 + %.1403 =w loadsw %.1402 + %.1404 =w cslew %.1403, 0 + jnz %.1404, @for_body.1110, @for_join.1112 +@for_body.1110 + %.1406 =l add %.1405, 0 + storel %.1261, %.1406 + %.1408 =l add %.1407, 0 + storel $g_23, %.1408 + %.1409 =l add %.1407, 8 + storel $g_173, %.1409 + %.1410 =l add %.1407, 16 + storel $g_173, %.1410 + %.1411 =l add %.1407, 24 + storel $g_23, %.1411 + %.1412 =l add %.1407, 32 + %.1413 =l extsw 0 + %.1414 =l copy %.1413 + storel %.1414, %.1412 + %.1415 =l add %.1407, 40 + storel $g_23, %.1415 + %.1416 =l add %.1407, 48 + storel $g_23, %.1416 + %.1417 =l add %.1407, 56 + storel $g_173, %.1417 + %.1418 =l add %.1407, 64 + storel $g_173, %.1418 + %.1419 =l add %.1407, 72 + storel $g_23, %.1419 + %.1420 =l add %.1407, 80 + %.1421 =l extsw 0 + %.1422 =l copy %.1421 + storel %.1422, %.1420 + %.1423 =l add %.1407, 88 + storel $g_23, %.1423 + %.1424 =l add %.1407, 96 + storel $g_173, %.1424 + %.1425 =l add %.1407, 104 + storel $g_173, %.1425 + %.1426 =l add %.1407, 112 + storel $g_173, %.1426 + %.1427 =l add %.1407, 120 + storel $g_23, %.1427 + %.1428 =l add %.1407, 128 + %.1429 =l extsw 0 + %.1430 =l copy %.1429 + storel %.1430, %.1428 + %.1431 =l add %.1407, 136 + storel $g_23, %.1431 + %.1432 =l add %.1407, 144 + storel $g_173, %.1432 + %.1433 =l add %.1407, 152 + storel $g_173, %.1433 + %.1434 =l add %.1407, 160 + storel $g_23, %.1434 + %.1435 =l add %.1407, 168 + storel $g_23, %.1435 + %.1436 =l add %.1407, 176 + storel $g_173, %.1436 + %.1437 =l add %.1407, 184 + storel $g_23, %.1437 + %.1438 =l add %.1407, 192 + storel $g_23, %.1438 + %.1439 =l add %.1407, 200 + storel $g_23, %.1439 + %.1440 =l add %.1407, 208 + storel $g_23, %.1440 + %.1441 =l add %.1407, 216 + storel $g_173, %.1441 + %.1442 =l add %.1407, 224 + storel $g_23, %.1442 + %.1443 =l add %.1407, 232 + storel $g_173, %.1443 + %.1444 =l add %.1407, 240 + %.1445 =l extsw 0 + %.1446 =l copy %.1445 + storel %.1446, %.1444 + %.1447 =l add %.1407, 248 + %.1448 =l extsw 0 + %.1449 =l copy %.1448 + storel %.1449, %.1447 + %.1450 =l add %.1407, 256 + storel $g_173, %.1450 + %.1451 =l add %.1407, 264 + storel $g_23, %.1451 + %.1452 =l add %.1407, 272 + storel $g_173, %.1452 + %.1453 =l add %.1407, 280 + storel $g_23, %.1453 + %.1454 =l add %.1407, 288 + storel $g_23, %.1454 + %.1455 =l add %.1407, 296 + storel $g_23, %.1455 + %.1456 =l add %.1407, 304 + storel $g_23, %.1456 + %.1457 =l add %.1407, 312 + storel $g_173, %.1457 + %.1458 =l add %.1407, 320 + storel $g_23, %.1458 + %.1459 =l add %.1407, 328 + storel $g_23, %.1459 + %.1460 =l add %.1407, 336 + storel $g_173, %.1460 + %.1461 =l add %.1407, 344 + storel $g_173, %.1461 + %.1462 =l add %.1407, 352 + storel $g_23, %.1462 + %.1463 =l add %.1407, 360 + %.1464 =l extsw 0 + %.1465 =l copy %.1464 + storel %.1465, %.1463 + %.1466 =l add %.1407, 368 + storel $g_23, %.1466 + %.1467 =l add %.1407, 376 + storel $g_173, %.1467 + %.1468 =l add %.1407, 384 + storel $g_173, %.1468 + %.1469 =l add %.1407, 392 + storel $g_173, %.1469 + %.1470 =l add %.1407, 400 + storel $g_23, %.1470 + %.1471 =l add %.1407, 408 + %.1472 =l extsw 0 + %.1473 =l copy %.1472 + storel %.1473, %.1471 + %.1474 =l add %.1407, 416 + storel $g_23, %.1474 + %.1475 =l add %.1407, 424 + storel $g_173, %.1475 + %.1476 =l add %.1407, 432 + storel $g_173, %.1476 + %.1477 =l add %.1407, 440 + storel $g_23, %.1477 + %.1478 =l add %.1407, 448 + storel $g_23, %.1478 + %.1479 =l add %.1407, 456 + storel $g_173, %.1479 + %.1480 =l add %.1407, 464 + storel $g_23, %.1480 + %.1481 =l add %.1407, 472 + storel $g_23, %.1481 + %.1482 =l add %.1407, 480 + storel $g_23, %.1482 + %.1483 =l add %.1407, 488 + storel $g_23, %.1483 + %.1484 =l add %.1407, 496 + storel $g_173, %.1484 + %.1485 =l add %.1407, 504 + storel $g_23, %.1485 + %.1486 =l add %.1407, 512 + storel $g_173, %.1486 + %.1487 =l add %.1407, 520 + %.1488 =l extsw 0 + %.1489 =l copy %.1488 + storel %.1489, %.1487 + %.1490 =l add %.1407, 528 + %.1491 =l extsw 0 + %.1492 =l copy %.1491 + storel %.1492, %.1490 + %.1493 =l add %.1407, 536 + storel $g_173, %.1493 + %.1494 =l add %.1407, 544 + storel $g_23, %.1494 + %.1495 =l add %.1407, 552 + storel $g_173, %.1495 + %.1496 =l add %.1407, 560 + storel $g_23, %.1496 + %.1497 =l add %.1407, 568 + storel $g_23, %.1497 + %.1498 =l add %.1407, 576 + storel $g_23, %.1498 + %.1499 =l add %.1407, 584 + storel $g_23, %.1499 + %.1500 =l add %.1407, 592 + storel $g_173, %.1500 + %.1501 =l add %.1407, 600 + storel $g_23, %.1501 + %.1502 =l add %.1407, 608 + storel $g_23, %.1502 + %.1503 =l add %.1407, 616 + storel $g_173, %.1503 + %.1504 =l add %.1407, 624 + storel $g_173, %.1504 + %.1505 =l add %.1407, 632 + storel $g_23, %.1505 + %.1506 =l add %.1407, 640 + %.1507 =l extsw 0 + %.1508 =l copy %.1507 + storel %.1508, %.1506 + %.1509 =l add %.1407, 648 + storel $g_23, %.1509 + %.1510 =l add %.1407, 656 + storel $g_173, %.1510 + %.1511 =l add %.1407, 664 + storel $g_173, %.1511 + %.1512 =l add %.1407, 672 + storel $g_173, %.1512 + %.1513 =l add %.1407, 680 + storel $g_23, %.1513 + %.1514 =l add %.1407, 688 + %.1515 =l extsw 0 + %.1516 =l copy %.1515 + storel %.1516, %.1514 + %.1517 =l add %.1407, 696 + storel $g_23, %.1517 + %.1518 =l add %.1407, 704 + storel $g_173, %.1518 + %.1519 =l add %.1407, 712 + storel $g_173, %.1519 + %.1520 =l add %.1407, 720 + storel $g_23, %.1520 + %.1521 =l add %.1407, 728 + storel $g_23, %.1521 + %.1522 =l add %.1407, 736 + storel $g_173, %.1522 + %.1523 =l add %.1407, 744 + storel $g_23, %.1523 + %.1524 =l add %.1407, 752 + storel $g_23, %.1524 + %.1525 =l add %.1407, 760 + storel $g_23, %.1525 + %.1526 =l add %.1407, 768 + storel $g_23, %.1526 + %.1527 =l add %.1407, 776 + storel $g_173, %.1527 + %.1528 =l add %.1407, 784 + storel $g_23, %.1528 + %.1529 =l add %.1407, 792 + storel $g_173, %.1529 + %.1530 =l add %.1407, 800 + %.1531 =l extsw 0 + %.1532 =l copy %.1531 + storel %.1532, %.1530 + %.1533 =l add %.1407, 808 + %.1534 =l extsw 0 + %.1535 =l copy %.1534 + storel %.1535, %.1533 + %.1536 =l add %.1407, 816 + storel $g_173, %.1536 + %.1537 =l add %.1407, 824 + storel $g_23, %.1537 + %.1538 =l add %.1407, 832 + storel $g_173, %.1538 + %.1539 =l add %.1407, 840 + storel $g_23, %.1539 + %.1540 =l add %.1407, 848 + storel $g_23, %.1540 + %.1541 =l add %.1407, 856 + storel $g_23, %.1541 + %.1542 =l add %.1407, 864 + storel $g_23, %.1542 + %.1543 =l add %.1407, 872 + storel $g_173, %.1543 + %.1544 =l add %.1407, 880 + storel $g_23, %.1544 + %.1545 =l add %.1407, 888 + storel $g_23, %.1545 + %.1546 =l add %.1407, 896 + storel $g_173, %.1546 + %.1547 =l add %.1407, 904 + storel $g_173, %.1547 + %.1548 =l add %.1407, 912 + storel $g_23, %.1548 + %.1549 =l add %.1407, 920 + %.1550 =l extsw 0 + %.1551 =l copy %.1550 + storel %.1551, %.1549 + %.1552 =l add %.1407, 928 + storel $g_23, %.1552 + %.1553 =l add %.1407, 936 + storel $g_173, %.1553 + %.1554 =l add %.1407, 944 + storel $g_173, %.1554 + %.1555 =l add %.1407, 952 + storel $g_173, %.1555 + %.1556 =l add %.1407, 960 + storel $g_23, %.1556 + %.1557 =l add %.1407, 968 + %.1558 =l extsw 0 + %.1559 =l copy %.1558 + storel %.1559, %.1557 + %.1560 =l add %.1407, 976 + storel $g_23, %.1560 + %.1561 =l add %.1407, 984 + storel $g_173, %.1561 + %.1562 =l add %.1407, 992 + storel $g_173, %.1562 + %.1563 =l add %.1407, 1000 + storel $g_23, %.1563 + %.1565 =l add %.1564, 0 + %.1566 =l extsw 0 + %.1567 =l copy %.1566 + storel %.1567, %.1565 + %.1569 =l add %.1568, 0 + storel %.1564, %.1569 + %.1571 =l add %.1570, 0 + storel %.1568, %.1571 + %.1573 =l add %.1572, 0 + storel %.1564, %.1573 + %.1575 =l add %.1574, 0 + storel %.1572, %.1575 + %.1579 =l loadl %.1261 + %.1580 =l loadl %.1405 + storel %.1579, %.1580 + storel %.1579, %.4 + %.1581 =l loadl $g_173 + %.1582 =w loadsw %.1581 + %.1583 =w loadsw %.101 + %.1584 =w copy %.1583 + %.1585 =w call $safe_lshift_func_int16_t_s_s(w %.1584, w 9) + %.1586 =w copy %.1585 + %.1587 =w loadsw %.2 + %.1588 =w cnew %.1587, 0 + jnz %.1588, @logic_right.1113, @logic_join.1114 +@logic_right.1113 + %.1589 =l copy $g_265 + %.1590 =l mul 32, 1 + %.1591 =l add %.1589, %.1590 + %.1592 =l copy %.1591 + %.1593 =w loaduw %.1592 + %.1594 =w add %.1593, 1 + storew %.1594, %.1592 + %.1595 =l loadl %.503 + %.1596 =l extsw 0 + %.1597 =w ceql %.1595, %.1596 + %.1598 =w copy %.1597 + %.1599 =w call $safe_rshift_func_int16_t_s_s(w %.1598, w 11) + %.1600 =w extsh %.1599 + %.1601 =l loadl %.4 + %.1602 =w loadsw %.1601 + %.1603 =l loadl $g_88 + %.1604 =l loadl %.1603 + %.1605 =l loadl %.1604 + storew %.1602, %.1605 + %.1606 =l loadl %.1570 + storel $g_422, %.1606 + %.1607 =l loadl %.1574 + storel $g_422, %.1607 + %.1608 =l loadl %.505 + %.1609 =w ceql $g_422, %.1608 + %.1610 =w copy %.1609 + %.1611 =w call $safe_lshift_func_int16_t_s_s(w %.1610, w 7) + %.1612 =w extsh %.1611 + %.1613 =w cnew %.1612, 0 + jnz %.1613, @logic_right.1115, @logic_join.1116 +@logic_right.1115 + %.1614 =l loadl $g_399 + %.1615 =w copy %.1614 + %.1616 =w loaduh $g_425 + %.1617 =w extuh %.1616 + %.1618 =w cnew %.1617, 0 + jnz %.1618, @logic_right.1117, @logic_join.1118 +@logic_right.1117 + %.1619 =l loadl %.4 + %.1620 =w loadsw %.1619 + %.1621 =w cnew %.1620, 0 +@logic_join.1118 + %.1622 =w phi @logic_right.1115 %.1618, @logic_right.1117 %.1621 + %.1623 =w copy %.1622 + %.1624 =w call $safe_sub_func_int8_t_s_s(w %.1615, w %.1623) + %.1625 =w extsb %.1624 + %.1626 =w cnew %.1625, 0 +@logic_join.1116 + %.1627 =w phi @logic_right.1113 %.1613, @logic_join.1118 %.1626 + %.1628 =w call $safe_add_func_int32_t_s_s(w %.1602, w %.1627) + %.1629 =l copy %.10 + %.1630 =l mul 40, 1 + %.1631 =l add %.1629, %.1630 + %.1632 =l copy %.1631 + %.1633 =w loadsw %.1632 + %.1634 =w copy %.1633 + %.1635 =w call $safe_sub_func_uint32_t_u_u(w %.1600, w %.1634) + %.1636 =w loadsw %.2 + %.1637 =w copy %.1636 + %.1638 =w xor %.1635, %.1637 + %.1639 =w call $safe_add_func_uint32_t_u_u(w %.1593, w %.1638) + %.1640 =w cnew %.1639, 0 +@logic_join.1114 + %.1641 =w phi @for_body.1110 %.1588, @logic_join.1116 %.1640 + %.1642 =l extsw %.1641 + %.1643 =w cnel %.1642, 394305013 + %.1644 =w copy %.1643 + %.1645 =w loadsb %.509 + %.1646 =w extsb %.1645 + %.1647 =w call $safe_mul_func_uint16_t_u_u(w %.1644, w %.1646) + %.1648 =w copy %.1647 + %.1649 =w call $safe_sub_func_int8_t_s_s(w %.1586, w %.1648) + %.1650 =w extsb %.1649 + %.1651 =w xor %.1582, %.1650 + storew %.1651, %.1581 +@for_cont.1111 + %.1652 =l copy $g_794 + %.1653 =l mul 12, 1 + %.1654 =l add %.1652, %.1653 + %.1655 =l copy %.1654 + %.1656 =w loadsw %.1655 + %.1657 =w add %.1656, 1 + storew %.1657, %.1655 + jmp @for_cond.1109 +@for_join.1112 + %.1658 =l copy $g_185 + %.1659 =l mul 16, 1 + %.1660 =l add %.1658, %.1659 + %.1661 =l copy %.1660 + storew 0, %.1661 +@for_cond.1119 + %.1662 =l copy $g_185 + %.1663 =l mul 16, 1 + %.1664 =l add %.1662, %.1663 + %.1665 =l copy %.1664 + %.1666 =w loadsw %.1665 + %.1667 =w csgew %.1666, 0 + jnz %.1667, @for_body.1120, @for_join.1122 +@for_body.1120 + %.1669 =l add %.1668, 0 + %.1670 =l extsw 0 + %.1671 =l sub %.1670, 4 + %.1672 =w copy %.1671 + storew %.1672, %.1669 + %.1674 =l add %.1673, 0 + storel $g_662, %.1674 + %.1676 =l add %.1675, 0 + storel %.1673, %.1676 + %.1678 =l add %.1677, 0 + storel %.531, %.1678 + %.1680 =l add %.1679, 0 + storel %.509, %.1680 + %.1682 =l add %.1681, 0 + storel $g_629, %.1682 + %.1683 =l add %.1681, 8 + %.1684 =l extsw 1 + %.1685 =l mul %.1684, 1 + %.1686 =l add $g_132, %.1685 + storel %.1686, %.1683 + %.1687 =l add %.1681, 16 + storel $g_629, %.1687 + %.1688 =l add %.1681, 24 + storel $g_629, %.1688 + %.1689 =l add %.1681, 32 + %.1690 =l extsw 1 + %.1691 =l mul %.1690, 1 + %.1692 =l add $g_132, %.1691 + storel %.1692, %.1689 + %.1693 =l add %.1681, 40 + storel $g_629, %.1693 + %.1694 =l add %.1681, 48 + storel $g_629, %.1694 + %.1695 =l add %.1681, 56 + %.1696 =l extsw 1 + %.1697 =l mul %.1696, 1 + %.1698 =l add $g_132, %.1697 + storel %.1698, %.1695 + %.1699 =l add %.1681, 64 + storel $g_629, %.1699 + %.1701 =l add %.1700, 0 + %.1702 =l extsw 2 + %.1703 =l mul %.1702, 24 + %.1704 =l add %.512, %.1703 + %.1705 =l extsw 0 + %.1706 =l mul %.1705, 24 + %.1707 =l add %.1704, %.1706 + %.1708 =l extsw 0 + %.1709 =l mul %.1708, 8 + %.1710 =l add %.1707, %.1709 + storel %.1710, %.1701 + %.1712 =l add %.1711, 0 + storel $g_130, %.1712 + %.1714 =l add %.1713, 0 + storel %.1711, %.1714 + %.1716 =l add %.1715, 0 + storel $g_794, %.1716 + %.1718 =l add %.1717, 0 + storel %.1715, %.1718 + %.1720 =l extsw 2 + %.1721 =l mul %.1720, 24 + %.1722 =l add %.512, %.1721 + %.1723 =l extsw 0 + %.1724 =l mul %.1723, 24 + %.1725 =l add %.1722, %.1724 + %.1726 =l extsw 0 + %.1727 =l mul %.1726, 8 + %.1728 =l add %.1725, %.1727 + storel $g_130, %.1728 + %.1729 =w cnel $g_130, $g_130 + %.1730 =l loadl %.4 + %.1731 =w loadsw %.1730 + %.1732 =l extsw 0 + %.1733 =w cnel %.84, %.1732 + %.1734 =w cnew %.1733, 0 + jnz %.1734, @logic_join.1124, @logic_right.1123 +@logic_right.1123 + %.1735 =w loadsw %.1668 + %.1736 =w loadsw %.2 + %.1737 =w copy %.1736 + %.1738 =l loadl %.1675 + storel $g_662, %.1738 + %.1739 =l loadl %.531 + %.1740 =l loadl %.1677 + storel %.1739, %.1740 + %.1741 =w cnel $g_662, %.1739 + %.1742 =w copy %.1741 + %.1743 =w call $safe_mul_func_uint16_t_u_u(w %.1737, w %.1742) + %.1744 =w extuh %.1743 + %.1745 =w csgew %.1735, %.1744 + %.1746 =w cnew %.1745, 0 +@logic_join.1124 + %.1747 =w phi @for_body.1120 %.1734, @logic_right.1123 %.1746 + %.1748 =w copy %.1747 + %.1749 =l loadl %.1679 + storeb %.1748, %.1749 + %.1750 =w loadub %.500 + %.1751 =w copy %.1750 + %.1752 =w call $safe_add_func_int8_t_s_s(w %.1748, w %.1751) + %.1753 =w extsb %.1752 + %.1754 =l copy %.10 + %.1755 =l mul 40, 1 + %.1756 =l add %.1754, %.1755 + %.1757 =l copy %.1756 + storew %.1753, %.1757 + %.1758 =w copy %.1753 + %.1759 =w copy 12 + %.1760 =w call $safe_sub_func_int8_t_s_s(w %.1758, w %.1759) + %.1761 =w extsb %.1760 + %.1762 =w copy 441 + %.1763 =w call $safe_mul_func_int16_t_s_s(w %.1761, w %.1762) + %.1764 =w copy %.1763 + %.1765 =w loadsw %.2 + %.1766 =w copy %.1765 + %.1767 =w call $safe_lshift_func_int8_t_s_u(w %.1764, w %.1766) + %.1768 =w extsb %.1767 + %.1769 =w csltw %.1731, %.1768 + %.1770 =w and %.1729, %.1769 + %.1771 =l copy %.89 + %.1772 =l mul 0, 1 + %.1773 =l add %.1771, %.1772 + %.1774 =l copy %.1773 + storew %.1770, %.1774 + %.1775 =l loadl %.4 + storew %.1770, %.1775 + %.1776 =l extsw 0 + %.1777 =l copy %.1776 + %.1778 =l loadl %.1700 + storel %.1777, %.1778 + %.1779 =l loadl %.1713 + storel %.1777, %.1779 + %.1780 =l loadl %.1717 + storel %.1777, %.1780 + %.1781 =l loadl $g_173 + %.1782 =w loadsw %.1781 + %.1783 =l loadl %.4 + storew %.1782, %.1783 +@for_cont.1121 + %.1784 =l copy $g_185 + %.1785 =l mul 16, 1 + %.1786 =l add %.1784, %.1785 + %.1787 =l copy %.1786 + %.1788 =w loadsw %.1787 + %.1789 =w sub %.1788, 1 + storew %.1789, %.1787 + jmp @for_cond.1119 +@for_join.1122 +@for_cont.1099 + %.1790 =l copy $g_130 + %.1791 =l mul 8, 1 + %.1792 =l add %.1790, %.1791 + %.1793 =l copy %.1792 + %.1794 =w loadsh %.1793 + %.1795 =w extsh %.1794 + %.1796 =w sub %.1795, 1 + %.1797 =w copy %.1796 + storeh %.1797, %.1793 + jmp @for_cond.1097 +@for_join.1100 + %.1798 =l loadl $g_38 + %.1799 =l loadl %.1798 + %.1800 =w loadsw %.1799 + %.1801 =l loadl %.1261 + %.1802 =w loadsw %.1801 + %.1803 =w copy %.1802 + %.1804 =w loadub %.500 + %.1805 =w extub %.1804 + %.1806 =w call $safe_mul_func_int16_t_s_s(w %.1803, w %.1805) + %.1807 =w extsh %.1806 + %.1808 =w or %.1800, %.1807 + storew %.1808, %.1799 + %.1809 =l loadl %.1261 + storew %.1808, %.1809 + %.1810 =w cnew %.1808, 0 + jnz %.1810, @if_true.1125, @if_false.1126 +@if_true.1125 + %.1812 =l add %.1811, 0 + %.1813 =l extsw 0 + %.1814 =l copy %.1813 + storel %.1814, %.1812 + %.1816 =l add %.1815, 0 + %.1817 =l extsw 0 + %.1818 =l copy %.1817 + storel %.1818, %.1816 + %.1820 =l add %.1819, 0 + %.1821 =l extsw 0 + %.1822 =l copy %.1821 + storel %.1822, %.1820 + %.1823 =l add %.1819, 8 + %.1824 =l extsw 0 + %.1825 =l copy %.1824 + storel %.1825, %.1823 + %.1826 =l add %.1819, 16 + %.1827 =l extsw 0 + %.1828 =l copy %.1827 + storel %.1828, %.1826 + %.1829 =l add %.1819, 24 + %.1830 =l extsw 0 + %.1831 =l copy %.1830 + storel %.1831, %.1829 + %.1832 =l add %.1819, 32 + %.1833 =l extsw 0 + %.1834 =l copy %.1833 + storel %.1834, %.1832 + %.1835 =l add %.1819, 40 + %.1836 =l extsw 0 + %.1837 =l copy %.1836 + storel %.1837, %.1835 + %.1838 =l add %.1819, 48 + %.1839 =l extsw 0 + %.1840 =l copy %.1839 + storel %.1840, %.1838 + %.1841 =l add %.1819, 56 + %.1842 =l copy $g_518 + %.1843 =l mul 44, 1 + %.1844 =l add %.1842, %.1843 + %.1845 =l copy %.1844 + storel %.1845, %.1841 + %.1846 =l add %.1819, 64 + %.1847 =l copy %.10 + %.1848 =l mul 40, 1 + %.1849 =l add %.1847, %.1848 + %.1850 =l copy %.1849 + storel %.1850, %.1846 + %.1851 =l add %.1819, 72 + %.1852 =l copy $g_518 + %.1853 =l mul 44, 1 + %.1854 =l add %.1852, %.1853 + %.1855 =l copy %.1854 + storel %.1855, %.1851 + %.1856 =l add %.1819, 80 + %.1857 =l copy %.10 + %.1858 =l mul 40, 1 + %.1859 =l add %.1857, %.1858 + %.1860 =l copy %.1859 + storel %.1860, %.1856 + %.1861 =l add %.1819, 88 + %.1862 =l copy $g_518 + %.1863 =l mul 44, 1 + %.1864 =l add %.1862, %.1863 + %.1865 =l copy %.1864 + storel %.1865, %.1861 + %.1866 =l add %.1819, 96 + %.1867 =l copy %.10 + %.1868 =l mul 40, 1 + %.1869 =l add %.1867, %.1868 + %.1870 =l copy %.1869 + storel %.1870, %.1866 + %.1871 =l add %.1819, 104 + %.1872 =l copy $g_518 + %.1873 =l mul 44, 1 + %.1874 =l add %.1872, %.1873 + %.1875 =l copy %.1874 + storel %.1875, %.1871 + %.1876 =l add %.1819, 112 + %.1877 =l extsw 0 + %.1878 =l copy %.1877 + storel %.1878, %.1876 + %.1879 =l add %.1819, 120 + %.1880 =l extsw 0 + %.1881 =l copy %.1880 + storel %.1881, %.1879 + %.1882 =l add %.1819, 128 + %.1883 =l extsw 0 + %.1884 =l copy %.1883 + storel %.1884, %.1882 + %.1885 =l add %.1819, 136 + %.1886 =l extsw 0 + %.1887 =l copy %.1886 + storel %.1887, %.1885 + %.1888 =l add %.1819, 144 + %.1889 =l extsw 0 + %.1890 =l copy %.1889 + storel %.1890, %.1888 + %.1891 =l add %.1819, 152 + %.1892 =l extsw 0 + %.1893 =l copy %.1892 + storel %.1893, %.1891 + %.1894 =l add %.1819, 160 + %.1895 =l extsw 0 + %.1896 =l copy %.1895 + storel %.1896, %.1894 + %.1897 =l add %.1819, 168 + %.1898 =l copy $g_518 + %.1899 =l mul 44, 1 + %.1900 =l add %.1898, %.1899 + %.1901 =l copy %.1900 + storel %.1901, %.1897 + %.1902 =l add %.1819, 176 + %.1903 =l copy %.10 + %.1904 =l mul 40, 1 + %.1905 =l add %.1903, %.1904 + %.1906 =l copy %.1905 + storel %.1906, %.1902 + %.1907 =l add %.1819, 184 + %.1908 =l copy $g_518 + %.1909 =l mul 44, 1 + %.1910 =l add %.1908, %.1909 + %.1911 =l copy %.1910 + storel %.1911, %.1907 + %.1912 =l add %.1819, 192 + %.1913 =l copy %.10 + %.1914 =l mul 40, 1 + %.1915 =l add %.1913, %.1914 + %.1916 =l copy %.1915 + storel %.1916, %.1912 + %.1917 =l add %.1819, 200 + %.1918 =l copy $g_518 + %.1919 =l mul 44, 1 + %.1920 =l add %.1918, %.1919 + %.1921 =l copy %.1920 + storel %.1921, %.1917 + %.1922 =l add %.1819, 208 + %.1923 =l copy %.10 + %.1924 =l mul 40, 1 + %.1925 =l add %.1923, %.1924 + %.1926 =l copy %.1925 + storel %.1926, %.1922 + %.1927 =l add %.1819, 216 + %.1928 =l copy $g_518 + %.1929 =l mul 44, 1 + %.1930 =l add %.1928, %.1929 + %.1931 =l copy %.1930 + storel %.1931, %.1927 + %.1932 =l add %.1819, 224 + %.1933 =l extsw 0 + %.1934 =l copy %.1933 + storel %.1934, %.1932 + %.1935 =l add %.1819, 232 + %.1936 =l extsw 0 + %.1937 =l copy %.1936 + storel %.1937, %.1935 + %.1938 =l add %.1819, 240 + %.1939 =l extsw 0 + %.1940 =l copy %.1939 + storel %.1940, %.1938 + %.1941 =l add %.1819, 248 + %.1942 =l extsw 0 + %.1943 =l copy %.1942 + storel %.1943, %.1941 + %.1944 =l add %.1819, 256 + %.1945 =l extsw 0 + %.1946 =l copy %.1945 + storel %.1946, %.1944 + %.1947 =l add %.1819, 264 + %.1948 =l extsw 0 + %.1949 =l copy %.1948 + storel %.1949, %.1947 + %.1950 =l add %.1819, 272 + %.1951 =l extsw 0 + %.1952 =l copy %.1951 + storel %.1952, %.1950 + %.1953 =l add %.1819, 280 + %.1954 =l copy $g_518 + %.1955 =l mul 44, 1 + %.1956 =l add %.1954, %.1955 + %.1957 =l copy %.1956 + storel %.1957, %.1953 + %.1958 =l add %.1819, 288 + %.1959 =l copy %.10 + %.1960 =l mul 40, 1 + %.1961 =l add %.1959, %.1960 + %.1962 =l copy %.1961 + storel %.1962, %.1958 + %.1963 =l add %.1819, 296 + %.1964 =l copy $g_518 + %.1965 =l mul 44, 1 + %.1966 =l add %.1964, %.1965 + %.1967 =l copy %.1966 + storel %.1967, %.1963 + %.1968 =l add %.1819, 304 + %.1969 =l copy %.10 + %.1970 =l mul 40, 1 + %.1971 =l add %.1969, %.1970 + %.1972 =l copy %.1971 + storel %.1972, %.1968 + %.1973 =l add %.1819, 312 + %.1974 =l copy $g_518 + %.1975 =l mul 44, 1 + %.1976 =l add %.1974, %.1975 + %.1977 =l copy %.1976 + storel %.1977, %.1973 + %.1978 =l add %.1819, 320 + %.1979 =l copy %.10 + %.1980 =l mul 40, 1 + %.1981 =l add %.1979, %.1980 + %.1982 =l copy %.1981 + storel %.1982, %.1978 + %.1983 =l add %.1819, 328 + %.1984 =l copy $g_518 + %.1985 =l mul 44, 1 + %.1986 =l add %.1984, %.1985 + %.1987 =l copy %.1986 + storel %.1987, %.1983 + %.1988 =l add %.1819, 336 + %.1989 =l extsw 0 + %.1990 =l copy %.1989 + storel %.1990, %.1988 + %.1991 =l add %.1819, 344 + %.1992 =l extsw 0 + %.1993 =l copy %.1992 + storel %.1993, %.1991 + %.1994 =l add %.1819, 352 + %.1995 =l extsw 0 + %.1996 =l copy %.1995 + storel %.1996, %.1994 + %.1997 =l add %.1819, 360 + %.1998 =l extsw 0 + %.1999 =l copy %.1998 + storel %.1999, %.1997 + %.2000 =l add %.1819, 368 + %.2001 =l extsw 0 + %.2002 =l copy %.2001 + storel %.2002, %.2000 + %.2003 =l add %.1819, 376 + %.2004 =l extsw 0 + %.2005 =l copy %.2004 + storel %.2005, %.2003 + %.2006 =l add %.1819, 384 + %.2007 =l extsw 0 + %.2008 =l copy %.2007 + storel %.2008, %.2006 + %.2009 =l add %.1819, 392 + %.2010 =l copy $g_518 + %.2011 =l mul 44, 1 + %.2012 =l add %.2010, %.2011 + %.2013 =l copy %.2012 + storel %.2013, %.2009 + %.2014 =l add %.1819, 400 + %.2015 =l copy %.10 + %.2016 =l mul 40, 1 + %.2017 =l add %.2015, %.2016 + %.2018 =l copy %.2017 + storel %.2018, %.2014 + %.2019 =l add %.1819, 408 + %.2020 =l copy $g_518 + %.2021 =l mul 44, 1 + %.2022 =l add %.2020, %.2021 + %.2023 =l copy %.2022 + storel %.2023, %.2019 + %.2024 =l add %.1819, 416 + %.2025 =l copy %.10 + %.2026 =l mul 40, 1 + %.2027 =l add %.2025, %.2026 + %.2028 =l copy %.2027 + storel %.2028, %.2024 + %.2029 =l add %.1819, 424 + %.2030 =l copy $g_518 + %.2031 =l mul 44, 1 + %.2032 =l add %.2030, %.2031 + %.2033 =l copy %.2032 + storel %.2033, %.2029 + %.2034 =l add %.1819, 432 + %.2035 =l copy %.10 + %.2036 =l mul 40, 1 + %.2037 =l add %.2035, %.2036 + %.2038 =l copy %.2037 + storel %.2038, %.2034 + %.2039 =l add %.1819, 440 + %.2040 =l copy $g_518 + %.2041 =l mul 44, 1 + %.2042 =l add %.2040, %.2041 + %.2043 =l copy %.2042 + storel %.2043, %.2039 + %.2044 =l add %.1819, 448 + %.2045 =l extsw 0 + %.2046 =l copy %.2045 + storel %.2046, %.2044 + %.2047 =l add %.1819, 456 + %.2048 =l extsw 0 + %.2049 =l copy %.2048 + storel %.2049, %.2047 + %.2050 =l add %.1819, 464 + %.2051 =l extsw 0 + %.2052 =l copy %.2051 + storel %.2052, %.2050 + %.2053 =l add %.1819, 472 + %.2054 =l extsw 0 + %.2055 =l copy %.2054 + storel %.2055, %.2053 + %.2056 =l add %.1819, 480 + %.2057 =l extsw 0 + %.2058 =l copy %.2057 + storel %.2058, %.2056 + %.2059 =l add %.1819, 488 + %.2060 =l extsw 0 + %.2061 =l copy %.2060 + storel %.2061, %.2059 + %.2062 =l add %.1819, 496 + %.2063 =l extsw 0 + %.2064 =l copy %.2063 + storel %.2064, %.2062 + %.2065 =l add %.1819, 504 + %.2066 =l copy $g_518 + %.2067 =l mul 44, 1 + %.2068 =l add %.2066, %.2067 + %.2069 =l copy %.2068 + storel %.2069, %.2065 + %.2070 =l add %.1819, 512 + %.2071 =l copy %.10 + %.2072 =l mul 40, 1 + %.2073 =l add %.2071, %.2072 + %.2074 =l copy %.2073 + storel %.2074, %.2070 + %.2075 =l add %.1819, 520 + %.2076 =l copy $g_518 + %.2077 =l mul 44, 1 + %.2078 =l add %.2076, %.2077 + %.2079 =l copy %.2078 + storel %.2079, %.2075 + %.2080 =l add %.1819, 528 + %.2081 =l copy %.10 + %.2082 =l mul 40, 1 + %.2083 =l add %.2081, %.2082 + %.2084 =l copy %.2083 + storel %.2084, %.2080 + %.2085 =l add %.1819, 536 + %.2086 =l copy $g_518 + %.2087 =l mul 44, 1 + %.2088 =l add %.2086, %.2087 + %.2089 =l copy %.2088 + storel %.2089, %.2085 + %.2090 =l add %.1819, 544 + %.2091 =l copy %.10 + %.2092 =l mul 40, 1 + %.2093 =l add %.2091, %.2092 + %.2094 =l copy %.2093 + storel %.2094, %.2090 + %.2095 =l add %.1819, 552 + %.2096 =l copy $g_518 + %.2097 =l mul 44, 1 + %.2098 =l add %.2096, %.2097 + %.2099 =l copy %.2098 + storel %.2099, %.2095 + %.2100 =l add %.1819, 560 + %.2101 =l extsw 0 + %.2102 =l copy %.2101 + storel %.2102, %.2100 + %.2103 =l add %.1819, 568 + %.2104 =l extsw 0 + %.2105 =l copy %.2104 + storel %.2105, %.2103 + %.2106 =l add %.1819, 576 + %.2107 =l extsw 0 + %.2108 =l copy %.2107 + storel %.2108, %.2106 + %.2109 =l add %.1819, 584 + %.2110 =l extsw 0 + %.2111 =l copy %.2110 + storel %.2111, %.2109 + %.2112 =l add %.1819, 592 + %.2113 =l extsw 0 + %.2114 =l copy %.2113 + storel %.2114, %.2112 + %.2115 =l add %.1819, 600 + %.2116 =l extsw 0 + %.2117 =l copy %.2116 + storel %.2117, %.2115 + %.2118 =l add %.1819, 608 + %.2119 =l extsw 0 + %.2120 =l copy %.2119 + storel %.2120, %.2118 + %.2121 =l add %.1819, 616 + %.2122 =l copy $g_518 + %.2123 =l mul 44, 1 + %.2124 =l add %.2122, %.2123 + %.2125 =l copy %.2124 + storel %.2125, %.2121 + %.2126 =l add %.1819, 624 + %.2127 =l copy %.10 + %.2128 =l mul 40, 1 + %.2129 =l add %.2127, %.2128 + %.2130 =l copy %.2129 + storel %.2130, %.2126 + %.2131 =l add %.1819, 632 + %.2132 =l copy $g_518 + %.2133 =l mul 44, 1 + %.2134 =l add %.2132, %.2133 + %.2135 =l copy %.2134 + storel %.2135, %.2131 + %.2136 =l add %.1819, 640 + %.2137 =l copy %.10 + %.2138 =l mul 40, 1 + %.2139 =l add %.2137, %.2138 + %.2140 =l copy %.2139 + storel %.2140, %.2136 + %.2141 =l add %.1819, 648 + %.2142 =l copy $g_518 + %.2143 =l mul 44, 1 + %.2144 =l add %.2142, %.2143 + %.2145 =l copy %.2144 + storel %.2145, %.2141 + %.2146 =l add %.1819, 656 + %.2147 =l copy %.10 + %.2148 =l mul 40, 1 + %.2149 =l add %.2147, %.2148 + %.2150 =l copy %.2149 + storel %.2150, %.2146 + %.2151 =l add %.1819, 664 + %.2152 =l copy $g_518 + %.2153 =l mul 44, 1 + %.2154 =l add %.2152, %.2153 + %.2155 =l copy %.2154 + storel %.2155, %.2151 + %.2156 =l add %.1819, 672 + %.2157 =l extsw 0 + %.2158 =l copy %.2157 + storel %.2158, %.2156 + %.2159 =l add %.1819, 680 + %.2160 =l extsw 0 + %.2161 =l copy %.2160 + storel %.2161, %.2159 + %.2162 =l add %.1819, 688 + %.2163 =l extsw 0 + %.2164 =l copy %.2163 + storel %.2164, %.2162 + %.2165 =l add %.1819, 696 + %.2166 =l extsw 0 + %.2167 =l copy %.2166 + storel %.2167, %.2165 + %.2168 =l add %.1819, 704 + %.2169 =l extsw 0 + %.2170 =l copy %.2169 + storel %.2170, %.2168 + %.2171 =l add %.1819, 712 + %.2172 =l extsw 0 + %.2173 =l copy %.2172 + storel %.2173, %.2171 + %.2174 =l add %.1819, 720 + %.2175 =l extsw 0 + %.2176 =l copy %.2175 + storel %.2176, %.2174 + %.2177 =l add %.1819, 728 + %.2178 =l copy $g_518 + %.2179 =l mul 44, 1 + %.2180 =l add %.2178, %.2179 + %.2181 =l copy %.2180 + storel %.2181, %.2177 + %.2182 =l add %.1819, 736 + %.2183 =l copy %.10 + %.2184 =l mul 40, 1 + %.2185 =l add %.2183, %.2184 + %.2186 =l copy %.2185 + storel %.2186, %.2182 + %.2187 =l add %.1819, 744 + %.2188 =l copy $g_518 + %.2189 =l mul 44, 1 + %.2190 =l add %.2188, %.2189 + %.2191 =l copy %.2190 + storel %.2191, %.2187 + %.2192 =l add %.1819, 752 + %.2193 =l copy %.10 + %.2194 =l mul 40, 1 + %.2195 =l add %.2193, %.2194 + %.2196 =l copy %.2195 + storel %.2196, %.2192 + %.2197 =l add %.1819, 760 + %.2198 =l copy $g_518 + %.2199 =l mul 44, 1 + %.2200 =l add %.2198, %.2199 + %.2201 =l copy %.2200 + storel %.2201, %.2197 + %.2202 =l add %.1819, 768 + %.2203 =l copy %.10 + %.2204 =l mul 40, 1 + %.2205 =l add %.2203, %.2204 + %.2206 =l copy %.2205 + storel %.2206, %.2202 + %.2207 =l add %.1819, 776 + %.2208 =l copy $g_518 + %.2209 =l mul 44, 1 + %.2210 =l add %.2208, %.2209 + %.2211 =l copy %.2210 + storel %.2211, %.2207 + %.2213 =l add %.2212, 0 + %.2214 =l extsw 0 + %.2215 =l sub %.2214, 1 + %.2216 =w copy %.2215 + storeh %.2216, %.2213 + %.2220 =l loadl %.35 + %.2221 =l loadl %.2220 + %.2222 =l loadl %.35 + %.2223 =l loadl %.2222 + %.2224 =l loadl %.2221 + storel %.2224, %.2223 + %.2225 =l add %.2221, 8 + %.2226 =l add %.2223, 8 + %.2227 =l loadl %.2225 + storel %.2227, %.2226 + %.2228 =l add %.2225, 8 + %.2229 =l add %.2226, 8 + %.2230 =l loadl %.2228 + storel %.2230, %.2229 + %.2231 =l add %.2228, 8 + %.2232 =l add %.2229, 8 + %.2233 =l loadl %.2231 + storel %.2233, %.2232 + %.2234 =l add %.2231, 8 + %.2235 =l add %.2232, 8 + %.2236 =l loadl %.2234 + storel %.2236, %.2235 + %.2237 =l add %.2234, 8 + %.2238 =l add %.2235, 8 + %.2239 =l loadl %.2237 + storel %.2239, %.2238 + %.2240 =l add %.2237, 8 + %.2241 =l add %.2238, 8 + %.2242 =l loadl %.2240 + storel %.2242, %.2241 + %.2243 =l add %.2240, 8 + %.2244 =l add %.2241, 8 + %.2245 =l extsw 0 + %.2246 =l mul %.2245, 8 + %.2247 =l add %.109, %.2246 + %.2248 =l loadl %.2247 + %.2249 =l add %.2248, 1 + storel %.2249, %.2247 + storew 0, $g_24 +@for_cond.1127 + %.2250 =w loadsw $g_24 + %.2251 =w csgew %.2250, 0 + jnz %.2251, @for_body.1128, @for_join.1130 +@for_body.1128 + %.2252 =w loadsw %.2 + %.2253 =w copy %.2252 + ret %.2253 +@for_cont.1129 + %.2254 =w loadsw $g_24 + %.2255 =w sub %.2254, 1 + storew %.2255, $g_24 + jmp @for_cond.1127 +@for_join.1130 + %.2256 =w loadsw %.1106 + %.2257 =w copy 1 + %.2258 =w call $safe_lshift_func_uint8_t_u_s(w %.2257, w 3) + %.2259 =w extub %.2258 + %.2260 =w loadsw %.2 + %.2261 =w copy %.2260 + %.2262 =l loadl %.37 + storeh %.2261, %.2262 + %.2263 =w extuh %.2261 + %.2264 =l loadl %.1261 + storew %.2263, %.2264 + %.2265 =l extsw 0 + %.2266 =l mul %.2265, 140 + %.2267 =l add %.533, %.2266 + %.2268 =l extsw 3 + %.2269 =l mul %.2268, 20 + %.2270 =l add %.2267, %.2269 + %.2271 =l extsw 3 + %.2272 =l mul %.2271, 4 + %.2273 =l add %.2270, %.2272 + %.2274 =w loadsw %.2273 + %.2275 =l extsw %.2274 + %.2276 =l loadl %.1193 + %.2277 =l and %.2275, %.2276 + %.2278 =w copy %.2277 + storew %.2278, %.2273 + %.2279 =w copy %.2278 + %.2280 =w loadsw %.2 + %.2281 =w loadub %.500 + %.2282 =w extub %.2281 + %.2283 =w call $safe_add_func_uint16_t_u_u(w %.2279, w %.2282) + %.2284 =w extuh %.2283 + %.2285 =w or %.2263, %.2284 + %.2286 =w copy %.2285 + %.2287 =w call $safe_add_func_uint32_t_u_u(w %.2259, w %.2286) + %.2288 =w copy %.2287 + %.2289 =w loadsw %.2 + %.2290 =l loadl %.1211 + %.2291 =l extsw 0 + %.2292 =w ceql %.2290, %.2291 + %.2293 =l loadl $g_38 + %.2294 =l loadl %.2293 + %.2295 =w loadsw %.2294 + %.2296 =l loadl $g_23 + storew %.2295, %.2296 + %.2297 =w xor %.2292, %.2295 + %.2298 =w csltw %.2289, %.2297 + %.2299 =l extsw %.2298 + %.2300 =l and %.2299, 38184 + %.2301 =w copy %.2300 + %.2302 =w call $safe_mod_func_int16_t_s_s(w %.2288, w %.2301) + %.2303 =w copy %.2302 + %.2304 =w loadsw %.2 + %.2305 =w copy %.2304 + %.2306 =w call $safe_mul_func_uint16_t_u_u(w %.2303, w %.2305) + %.2307 =w extuh %.2306 + %.2308 =w xor %.2256, %.2307 + storew %.2308, %.1106 + jmp @if_join.1131 +@if_false.1126 + %.2310 =l add %.2309, 0 + %.2311 =l copy $g_265 + %.2312 =l mul 0, 1 + %.2313 =l add %.2311, %.2312 + %.2314 =l copy %.2313 + storel %.2314, %.2310 + %.2315 =l add %.2309, 8 + storel %.500, %.2315 + %.2316 =l add %.2309, 16 + storel %.500, %.2316 + %.2317 =l add %.2309, 24 + storel %.500, %.2317 + %.2318 =l add %.2309, 32 + storel %.500, %.2318 + %.2319 =l add %.2309, 40 + %.2320 =l copy $g_265 + %.2321 =l mul 0, 1 + %.2322 =l add %.2320, %.2321 + %.2323 =l copy %.2322 + storel %.2323, %.2319 + %.2324 =l add %.2309, 48 + storel %.500, %.2324 + %.2325 =l add %.2309, 56 + storel %.500, %.2325 + %.2326 =l add %.2309, 64 + storel %.500, %.2326 + %.2327 =l add %.2309, 72 + storel %.500, %.2327 + %.2329 =l add %.2328, 0 + %.2330 =l extsw 0 + %.2331 =l sub %.2330, 8 + %.2332 =w copy %.2331 + storew %.2332, %.2329 + %.2334 =l add %.2333, 0 + %.2335 =w copy 5 + storew %.2335, %.2334 + %.2337 =l loadl $g_173 + %.2338 =w loadsw %.2337 + %.2339 =w copy 1881345186 + %.2340 =l loadl $g_38 + %.2341 =l loadl %.2340 + %.2342 =w loadsw %.2341 + %.2343 =w call $safe_mod_func_int32_t_s_s(w %.2339, w %.2342) + %.2344 =w loadsb %.509 + %.2345 =w extsb %.2344 + %.2346 =w copy 1 + %.2347 =w call $safe_lshift_func_uint16_t_u_u(w %.2345, w %.2346) + %.2348 =w extuh %.2347 + storew %.2348, %.2328 + %.2349 =l extsw %.2348 + %.2350 =l copy %.10 + %.2351 =l mul 24, 1 + %.2352 =l add %.2350, %.2351 + %.2353 =l copy %.2352 + %.2354 =l loadl %.2353 + %.2355 =l and %.2349, %.2354 + %.2356 =w cnel %.2355, 0 + jnz %.2356, @logic_right.1134, @logic_join.1135 +@logic_right.1134 + %.2357 =l loadl $g_88 + %.2358 =l loadl %.2357 + %.2359 =w cnel %.2358, %.4 + %.2360 =w cnew %.2359, 0 +@logic_join.1135 + %.2361 =w phi @if_false.1126 %.2356, @logic_right.1134 %.2360 + %.2362 =w csgtw %.2343, %.2361 + %.2363 =l loadl %.87 + %.2364 =l loadl %.2363 + %.2365 =w loaduh %.2364 + %.2366 =w extuh %.2365 + %.2367 =l loadl $g_23 + %.2368 =w loadsw %.2367 + %.2369 =w loadsw %.2333 + %.2370 =w cslew %.2368, %.2369 + %.2371 =w cnew %.2370, 0 + jnz %.2371, @logic_join.1137, @logic_right.1136 +@logic_right.1136 + %.2372 =w loadsh $g_81 + %.2373 =w extsh %.2372 + %.2374 =w cnew %.2373, 0 +@logic_join.1137 + %.2375 =w phi @logic_join.1135 %.2371, @logic_right.1136 %.2374 + %.2376 =w copy %.2375 + %.2377 =w copy 97 + %.2378 =w call $safe_mul_func_int8_t_s_s(w %.2376, w %.2377) + %.2379 =w extsb %.2378 + %.2380 =w xor %.2366, %.2379 + %.2381 =w copy %.2380 + storeh %.2381, %.2364 + %.2382 =w extuh %.2381 + %.2383 =w and %.2362, %.2382 + %.2384 =l extsw %.2383 + %.2385 =w loadsb $g_631 + %.2386 =l extsb %.2385 + %.2387 =l call $safe_div_func_int64_t_s_s(l %.2384, l %.2386) + %.2388 =l copy $g_265 + %.2389 =l mul 48, 1 + %.2390 =l add %.2388, %.2389 + %.2391 =l copy %.2390 + %.2392 =w loadsw %.2391 + %.2393 =l extsw %.2392 + %.2394 =l extsw 0 + %.2395 =l mul %.2394, 140 + %.2396 =l add %.533, %.2395 + %.2397 =l extsw 4 + %.2398 =l mul %.2397, 20 + %.2399 =l add %.2396, %.2398 + %.2400 =l extsw 3 + %.2401 =l mul %.2400, 4 + %.2402 =l add %.2399, %.2401 + %.2403 =w loadsw %.2402 + %.2404 =l extsw %.2403 + %.2405 =l call $safe_div_func_uint64_t_u_u(l %.2393, l %.2404) + %.2406 =w cnel %.2405, 0 + jnz %.2406, @logic_join.1133, @logic_right.1132 +@logic_right.1132 + %.2407 =w loadsw %.2 + %.2408 =w cnew %.2407, 0 +@logic_join.1133 + %.2409 =w phi @logic_join.1137 %.2406, @logic_right.1132 %.2408 + %.2410 =w or %.2338, %.2409 + storew %.2410, %.2337 + %.2411 =w loadsw %.2 + %.2412 =w copy %.2411 + ret %.2412 +@if_join.1131 + %.2413 =l loadl %.1261 + %.2414 =w loadsw %.2413 + %.2415 =l copy $g_130 + %.2416 =l mul 8, 1 + %.2417 =l add %.2415, %.2416 + %.2418 =l copy %.2417 + %.2419 =w loadsh %.2418 + %.2420 =w extsh %.2419 + %.2421 =l extsw 0 + %.2422 =l mul %.2421, 140 + %.2423 =l add %.533, %.2422 + %.2424 =l extsw 4 + %.2425 =l mul %.2424, 20 + %.2426 =l add %.2423, %.2425 + %.2427 =l extsw 3 + %.2428 =l mul %.2427, 4 + %.2429 =l add %.2426, %.2428 + %.2430 =w loadsw %.2429 + %.2431 =w copy %.2430 + %.2432 =l loadl %.1289 + %.2433 =w loadsb %.2432 + %.2434 =w extsb %.2433 + %.2435 =w loadsw %.2 + %.2436 =w loadsw %.2 + %.2437 =l extsw %.2436 + %.2438 =l loadl %.1276 + storel %.2437, %.2438 + %.2439 =w loadsw %.1106 + %.2440 =w loadsw %.2 + %.2441 =w cnew %.2440, 0 + jnz %.2441, @logic_join.1141, @logic_right.1140 +@logic_right.1140 + %.2442 =l loadl %.1193 + %.2443 =w cnel %.2442, 0 +@logic_join.1141 + %.2444 =w phi @if_join.1131 %.2441, @logic_right.1140 %.2443 + %.2445 =l loadl $g_23 + storew %.2444, %.2445 + %.2446 =w cnew %.2444, 0 + jnz %.2446, @logic_join.1139, @logic_right.1138 +@logic_right.1138 + %.2447 =w loadsw %.2 + %.2448 =w copy %.2447 + %.2449 =l loadl %.1276 + %.2450 =l loadl %.1278 + %.2451 =w cnel %.2449, %.2450 + %.2452 =w copy %.2451 + %.2453 =l loadl %.4 + %.2454 =w loadsw %.2453 + %.2455 =w copy %.2454 + %.2456 =w call $safe_add_func_uint32_t_u_u(w %.2452, w %.2455) + %.2457 =w copy %.2456 + %.2458 =w loadsw %.2 + %.2459 =w copy %.2458 + %.2460 =w call $safe_add_func_uint16_t_u_u(w %.2457, w %.2459) + %.2461 =w copy %.2460 + %.2462 =w call $safe_sub_func_uint8_t_u_u(w %.2448, w %.2461) + %.2463 =w copy 65 + %.2464 =w call $safe_mul_func_uint8_t_u_u(w %.2462, w %.2463) + %.2465 =w cnel 9, 0 +@logic_join.1139 + %.2466 =w phi @logic_join.1141 %.2446, @logic_right.1138 %.2465 + %.2467 =w loadsb %.1284 + %.2468 =w extsb %.2467 + %.2469 =w cslew %.2466, %.2468 + %.2470 =w and %.2439, %.2469 + storew %.2470, %.1106 + %.2471 =l extsw %.2470 + %.2472 =l xor %.2437, %.2471 + %.2473 =w copy %.2472 + %.2474 =w copy 3978 + %.2475 =w call $safe_sub_func_int16_t_s_s(w %.2473, w %.2474) + %.2476 =l loadl %.1287 + storeh %.2475, %.2476 + %.2477 =w call $safe_rshift_func_int16_t_s_s(w %.2475, w 13) + %.2478 =w copy %.2477 + %.2479 =w copy 2 + %.2480 =w call $safe_rshift_func_uint8_t_u_u(w %.2478, w %.2479) + %.2481 =w extub %.2480 + %.2482 =l extsw 5 + %.2483 =l mul %.2482, 4 + %.2484 =l add %.1198, %.2483 + storew %.2481, %.2484 + %.2485 =w loadsw %.2 + %.2486 =w csltw %.2481, %.2485 + %.2487 =l extsw %.2486 + %.2488 =l copy 18446744073709551615 + %.2489 =l call $safe_div_func_uint64_t_u_u(l %.2487, l %.2488) + %.2490 =w loadsw %.2 + %.2491 =w copy %.2490 + %.2492 =l copy $g_518 + %.2493 =l mul 32, 1 + %.2494 =l add %.2492, %.2493 + %.2495 =l copy %.2494 + %.2496 =w loaduw %.2495 + %.2497 =w copy %.2496 + %.2498 =w call $safe_mul_func_int8_t_s_s(w %.2491, w %.2497) + %.2499 =w extsb %.2498 + %.2500 =w cnew %.2435, %.2499 + %.2501 =l extsw %.2500 + %.2502 =l extsw 0 + %.2503 =l sub %.2502, 1 + %.2504 =w ceql %.2501, %.2503 + %.2505 =w or %.2434, %.2504 + %.2506 =w copy %.2505 + storeb %.2506, %.2432 + %.2507 =w copy %.2506 + %.2508 =w call $safe_div_func_uint8_t_u_u(w %.2431, w %.2507) + %.2509 =w extub %.2508 + %.2510 =w loadsw %.2 + %.2511 =w csgtw %.2509, %.2510 + %.2512 =w copy %.2511 + %.2513 =w copy 6 + %.2514 =w call $safe_rshift_func_uint8_t_u_u(w %.2512, w %.2513) + %.2515 =w extub %.2514 + %.2516 =w loadsw %.2 + %.2517 =w copy %.2516 + %.2518 =w call $safe_mul_func_int16_t_s_s(w %.2515, w %.2517) + %.2519 =w extsh %.2518 + %.2520 =l loadl %.1261 + %.2521 =w loadsw %.2520 + %.2522 =w cslew %.2519, %.2521 + %.2523 =w or %.2420, %.2522 + %.2524 =l loadl $g_173 + storew %.2523, %.2524 + %.2525 =l extsw 0 + %.2526 =l sub %.2525, 6 + %.2527 =w copy %.2526 + %.2528 =l loadl $g_173 + storew %.2527, %.2528 + %.2529 =w copy 0 + %.2530 =l copy $g_265 + %.2531 =l mul 32, 1 + %.2532 =l add %.2530, %.2531 + %.2533 =l copy %.2532 + storew %.2529, %.2533 +@for_cond.1142 + %.2534 =l copy $g_265 + %.2535 =l mul 32, 1 + %.2536 =l add %.2534, %.2535 + %.2537 =l copy %.2536 + %.2538 =w loaduw %.2537 + %.2539 =w copy 0 + %.2540 =w culew %.2538, %.2539 + jnz %.2540, @for_body.1143, @for_join.1145 +@for_body.1143 + %.2542 =l add %.2541, 0 + %.2543 =l copy $g_518 + %.2544 =l mul 44, 1 + %.2545 =l add %.2543, %.2544 + %.2546 =l copy %.2545 + storel %.2546, %.2542 + %.2548 =l add %.2547, 0 + storel $g_80, %.2548 + %.2550 =l add %.2549, 0 + %.2551 =w copy 4105257827 + storew %.2551, %.2550 + %.2553 =l add %.2552, 0 + %.2554 =l extsw 0 + %.2555 =l copy %.2554 + storel %.2555, %.2553 + %.2557 =l add %.2556, 0 + %.2558 =l copy 1 + storel %.2558, %.2557 + %.2560 =l add %.2559, 0 + storel %.531, %.2560 + %.2561 =w copy 0 + storeb %.2561, $g_631 +@for_cond.1146 + %.2562 =w loadsb $g_631 + %.2563 =w extsb %.2562 + %.2564 =w csgew %.2563, 0 + jnz %.2564, @for_body.1147, @for_join.1149 +@for_body.1147 + %.2566 =l add %.2565, 0 + storel $g_173, %.2566 + %.2568 =l add %.2567, 0 + storel %.1261, %.2568 + %.2570 =l add %.2569, 0 + %.2571 =w copy 1109499388 + storew %.2571, %.2570 + %.2574 =l add %.2573, 0 + %.2575 =l extsw 0 + %.2576 =l copy %.2575 + storel %.2576, %.2574 + %.2578 =l add %.2577, 0 + %.2579 =l copy %.1291 + %.2580 =l mul 36, 1 + %.2581 =l add %.2579, %.2580 + %.2582 =l copy %.2581 + storel %.2582, %.2578 + storew 0, %.2583 +@for_cond.1150 + %.2585 =w loadsw %.2583 + %.2586 =w csltw %.2585, 8 + jnz %.2586, @for_body.1151, @for_join.1153 +@for_body.1151 + storew 0, %.2584 +@for_cond.1154 + %.2587 =w loadsw %.2584 + %.2588 =w csltw %.2587, 6 + jnz %.2588, @for_body.1155, @for_join.1157 +@for_body.1155 + %.2589 =w loadsw %.2583 + %.2590 =l extsw %.2589 + %.2591 =l mul %.2590, 48 + %.2592 =l add %.2572, %.2591 + %.2593 =w loadsw %.2584 + %.2594 =l extsw %.2593 + %.2595 =l mul %.2594, 8 + %.2596 =l add %.2592, %.2595 + storel %.1113, %.2596 +@for_cont.1156 + %.2597 =w loadsw %.2584 + %.2598 =w add %.2597, 1 + storew %.2598, %.2584 + jmp @for_cond.1154 +@for_join.1157 +@for_cont.1152 + %.2599 =w loadsw %.2583 + %.2600 =w add %.2599, 1 + storew %.2600, %.2583 + jmp @for_cond.1150 +@for_join.1153 + %.2601 =l loadl %.2541 + %.2602 =l loadl %.2565 + storel %.2601, %.2602 + %.2603 =l loadl %.2567 + storel %.2601, %.2603 + %.2604 =l extsw 0 + %.2605 =l loadl %.2547 + %.2606 =w cnel %.2604, %.2605 + %.2607 =l copy $g_518 + %.2608 =l mul 0, 1 + %.2609 =l add %.2607, %.2608 + %.2610 =l copy %.2609 + %.2611 =w loadub %.2610 + %.2612 =w extub %.2611 + %.2613 =l loadl %.1289 + %.2614 =w loaduw $g_1018 + %.2615 =w copy %.2614 + %.2616 =w call $safe_lshift_func_uint8_t_u_s(w %.2615, w 3) + %.2617 =l extub %.2616 + %.2618 =w loadsw %.2 + %.2619 =w copy %.2618 + %.2620 =w loaduw %.2569 + %.2621 =w cultw %.2619, %.2620 + %.2622 =l extsw 0 + %.2623 =l mul %.2622, 140 + %.2624 =l add %.533, %.2623 + %.2625 =l extsw 4 + %.2626 =l mul %.2625, 20 + %.2627 =l add %.2624, %.2626 + %.2628 =l extsw 3 + %.2629 =l mul %.2628, 4 + %.2630 =l add %.2627, %.2629 + %.2631 =w loadsw %.2630 + %.2632 =w and %.2621, %.2631 + %.2633 =l extsw %.2632 + %.2634 =l or %.2633, 5192295408440469150 + %.2635 =l copy 1 + %.2636 =l or %.2634, %.2635 + %.2637 =l copy 0 + %.2638 =w cslel %.2636, %.2637 + %.2639 =l loadl %.2567 + %.2640 =l loadl %.2639 + storew %.2638, %.2640 + %.2641 =l extsw %.2638 + %.2642 =w loadsw %.2 + %.2643 =l extsw %.2642 + %.2644 =l call $safe_add_func_int64_t_s_s(l %.2641, l %.2643) + %.2645 =w copy %.2644 + %.2646 =l loadl $g_23 + storew %.2645, %.2646 + %.2647 =l extsw %.2645 + %.2648 =l extsw 0 + %.2649 =l sub %.2648, 1 + %.2650 =l and %.2647, %.2649 + %.2651 =l and 1, %.2650 + %.2652 =l xor %.2617, %.2651 + %.2653 =w loadsw %.2549 + %.2654 =l extsw %.2653 + %.2655 =l xor %.2652, %.2654 + %.2656 =w copy %.2655 + %.2657 =w copy 32877 + %.2658 =w call $safe_div_func_int16_t_s_s(w %.2656, w %.2657) + %.2659 =w ceql %.2613, %.500 + %.2660 =w copy %.2659 + %.2661 =l copy %.10 + %.2662 =l mul 36, 1 + %.2663 =l add %.2661, %.2662 + %.2664 =l copy %.2663 + %.2665 =w loaduw %.2664 + %.2666 =w copy %.2665 + %.2667 =w call $safe_mul_func_int16_t_s_s(w %.2660, w %.2666) + %.2668 =w extsh %.2667 + %.2669 =w cnew %.2668, 0 + jnz %.2669, @logic_right.1162, @logic_join.1163 +@logic_right.1162 + %.2670 =w loadsw %.2 + %.2671 =w cnew %.2670, 0 +@logic_join.1163 + %.2672 =w phi @for_join.1153 %.2669, @logic_right.1162 %.2671 + %.2673 =l extsw %.2672 + %.2674 =l copy 0 + %.2675 =l call $safe_sub_func_uint64_t_u_u(l %.2673, l %.2674) + %.2676 =l copy 0 + %.2677 =l xor %.2675, %.2676 + %.2678 =l copy %.2677 + %.2679 =l extsw 4 + %.2680 =l mul %.2679, 140 + %.2681 =l add %.533, %.2680 + %.2682 =l extsw 3 + %.2683 =l mul %.2682, 20 + %.2684 =l add %.2681, %.2683 + %.2685 =l extsw 4 + %.2686 =l mul %.2685, 4 + %.2687 =l add %.2684, %.2686 + %.2688 =w loadsw %.2687 + %.2689 =l extsw %.2688 + %.2690 =l call $safe_mod_func_int64_t_s_s(l %.2678, l %.2689) + %.2691 =w copy %.2690 + %.2692 =w call $safe_div_func_uint32_t_u_u(w %.2612, w %.2691) + %.2693 =w loadsw %.2 + %.2694 =w copy %.2693 + %.2695 =w cnew %.2692, %.2694 + %.2696 =l extsw %.2695 + %.2697 =l or 1, %.2696 + %.2698 =w copy %.2697 + %.2699 =l copy %.10 + %.2700 =l mul 40, 1 + %.2701 =l add %.2699, %.2700 + %.2702 =l copy %.2701 + %.2703 =w loadsw %.2702 + %.2704 =w copy %.2703 + %.2705 =w call $safe_add_func_uint8_t_u_u(w %.2698, w %.2704) + %.2706 =w copy %.2705 + %.2707 =l copy %.10 + %.2708 =l mul 48, 1 + %.2709 =l add %.2707, %.2708 + %.2710 =l copy %.2709 + %.2711 =w loadsw %.2710 + %.2712 =w copy %.2711 + %.2713 =w call $safe_sub_func_int8_t_s_s(w %.2706, w %.2712) + %.2714 =w extsb %.2713 + %.2715 =w cnew %.2714, 0 + jnz %.2715, @logic_join.1161, @logic_right.1160 +@logic_right.1160 + %.2716 =w cnel 63509, 0 +@logic_join.1161 + %.2717 =w phi @logic_join.1163 %.2715, @logic_right.1160 %.2716 + %.2718 =w loadsw %.2 + %.2719 =w and %.2717, %.2718 + %.2720 =w cnew %.2719, 0 + jnz %.2720, @logic_join.1159, @logic_right.1158 +@logic_right.1158 + %.2721 =l copy %.10 + %.2722 =l mul 8, 1 + %.2723 =l add %.2721, %.2722 + %.2724 =l copy %.2723 + %.2725 =l loadl %.2724 + %.2726 =w cnel %.2725, 0 +@logic_join.1159 + %.2727 =w phi @logic_join.1161 %.2720, @logic_right.1158 %.2726 + %.2728 =w xor %.2606, %.2727 + %.2729 =l extsw %.2728 + %.2730 =w cultl %.2729, 14106069369177510227 + %.2731 =w loadsw %.2 + %.2732 =w xor %.2730, %.2731 + storew %.2732, %.1272 + %.2733 =l loadl $g_23 + %.2734 =w loadsw %.2733 + %.2735 =l loadl %.1113 + storel %.2735, %.1213 + %.2736 =l extsw 0 + %.2737 =w cnel %.2735, %.2736 + %.2738 =l loadl %.1261 + %.2739 =w loadsw %.2738 + %.2740 =w csgew %.2737, %.2739 + %.2741 =l copy %.89 + %.2742 =l mul 8, 1 + %.2743 =l add %.2741, %.2742 + %.2744 =l copy %.2743 + %.2745 =w loadsh %.2744 + %.2746 =w cnel $g_2, %.5 + %.2747 =w cnew %.2746, 0 + jnz %.2747, @logic_join.1167, @logic_right.1166 +@logic_right.1166 + %.2748 =w cnel 0, 0 +@logic_join.1167 + %.2749 =w phi @logic_join.1159 %.2747, @logic_right.1166 %.2748 + %.2750 =w cnew %.2749, 0 + jnz %.2750, @logic_right.1164, @logic_join.1165 +@logic_right.1164 + %.2751 =w loadsw %.2 + %.2752 =w loadsw %.2 + %.2753 =w csltw %.2751, %.2752 + %.2754 =w loadsw %.2 + %.2755 =w copy %.2754 + %.2756 =w copy 6 + %.2757 =w call $safe_lshift_func_uint8_t_u_u(w %.2755, w %.2756) + %.2758 =w extub %.2757 + %.2759 =w cnew %.2758, 0 +@logic_join.1165 + %.2760 =w phi @logic_join.1167 %.2750, @logic_right.1164 %.2759 + %.2761 =l extsw %.2760 + %.2762 =l loadl %.1193 + %.2763 =w cslel %.2761, %.2762 + %.2764 =w copy %.2763 + %.2765 =w copy 58831 + %.2766 =w call $safe_mul_func_uint16_t_u_u(w %.2764, w %.2765) + %.2767 =w loadsw %.1106 + %.2768 =w copy %.2767 + %.2769 =w loadsw %.2 + %.2770 =w call $safe_lshift_func_uint8_t_u_s(w %.2768, w %.2769) + %.2771 =w copy %.2770 + %.2772 =l loadl %.1261 + %.2773 =w loadsw %.2772 + %.2774 =w copy %.2773 + %.2775 =w call $safe_lshift_func_int8_t_s_u(w %.2771, w %.2774) + %.2776 =w extsb %.2775 + %.2777 =w loadsw %.2 + %.2778 =w cslew %.2776, %.2777 + %.2779 =w and %.2734, %.2778 + storew %.2779, %.2733 + %.2780 =l loadl %.2573 + %.2781 =l loadl %.1115 + %.2782 =w cnel %.2780, %.2781 + %.2783 =l loadl %.1289 + %.2784 =w loadsb %.2783 + %.2785 =w extsb %.2784 + %.2786 =w loadsw %.2 + %.2787 =w or %.2785, %.2786 + %.2788 =w copy %.2787 + storeb %.2788, %.2783 + %.2789 =w extsb %.2788 + %.2790 =l loadl $g_1037 + %.2791 =l extsw 0 + %.2792 =w cnel %.2790, %.2791 + %.2793 =l loadl %.2552 + %.2794 =l loadl %.2565 + %.2795 =l loadl %.2794 + %.2796 =w loadsw %.2795 + %.2797 =l extsw %.2796 + %.2798 =l loadl %.87 + %.2799 =l loadl %.2798 + %.2800 =w loaduh %.2799 + %.2801 =l extuh %.2800 + %.2802 =w loadsw %.2 + %.2803 =l extsw %.2802 + %.2804 =l loadl %.1278 + %.2805 =l loadl %.2804 + %.2806 =l copy %.2805 + %.2807 =l copy $g_265 + %.2808 =l mul 48, 1 + %.2809 =l add %.2807, %.2808 + %.2810 =l copy %.2809 + %.2811 =w loadsw %.2810 + %.2812 =w copy %.2811 + %.2813 =w loadsw %.2 + %.2814 =w copy %.2813 + %.2815 =w call $safe_div_func_int8_t_s_s(w %.2812, w %.2814) + %.2816 =l copy 4 + %.2817 =w loadsw %.2 + %.2818 =l extsw %.2817 + %.2819 =l call $safe_add_func_uint64_t_u_u(l %.2816, l %.2818) + %.2820 =l and %.2806, %.2819 + %.2821 =l copy %.2820 + storel %.2821, %.2804 + %.2822 =l copy %.10 + %.2823 =l mul 16, 1 + %.2824 =l add %.2822, %.2823 + %.2825 =l copy %.2824 + %.2826 =w loadsw %.2825 + %.2827 =l extsw %.2826 + %.2828 =l call $safe_div_func_int64_t_s_s(l %.2821, l %.2827) + %.2829 =w copy %.2828 + %.2830 =w copy 203 + %.2831 =w call $safe_mul_func_int8_t_s_s(w %.2829, w %.2830) + %.2832 =w extsb %.2831 + %.2833 =w loadsw %.2 + %.2834 =w or %.2832, %.2833 + %.2835 =l extsw %.2834 + %.2836 =l loadl %.2547 + storel %.2835, %.2836 + %.2837 =l call $safe_add_func_int64_t_s_s(l %.2803, l %.2835) + %.2838 =l or %.2801, %.2837 + %.2839 =w copy %.2838 + storeh %.2839, %.2799 + %.2840 =l extuh %.2839 + %.2841 =l or %.2840, 65535 + %.2842 =w cnel %.2841, 0 + jnz %.2842, @logic_right.1172, @logic_join.1173 +@logic_right.1172 + %.2843 =w loadsw %.2 + %.2844 =w cnew %.2843, 0 +@logic_join.1173 + %.2845 =w phi @logic_join.1165 %.2842, @logic_right.1172 %.2844 + %.2846 =l extsw %.2845 + %.2847 =l call $safe_sub_func_int64_t_s_s(l %.2797, l %.2846) + %.2848 =w cnel 2224236467, 0 + jnz %.2848, @logic_right.1170, @logic_join.1171 +@logic_right.1170 + %.2849 =l loadl %.2565 + %.2850 =l loadl %.2849 + %.2851 =w loadsw %.2850 + %.2852 =w cnew %.2851, 0 +@logic_join.1171 + %.2853 =w phi @logic_join.1173 %.2848, @logic_right.1170 %.2852 + %.2854 =w copy %.2853 + %.2855 =l loadl %.2556 + %.2856 =w copy %.2855 + %.2857 =w call $safe_mul_func_uint16_t_u_u(w %.2854, w %.2856) + %.2858 =l loadl %.2565 + %.2859 =l loadl %.2858 + %.2860 =w loadsw %.2859 + %.2861 =w copy %.2860 + %.2862 =w call $safe_mul_func_uint16_t_u_u(w %.2857, w %.2861) + %.2863 =w copy %.2862 + %.2864 =w loadub $g_46 + %.2865 =w extub %.2864 + %.2866 =w call $safe_lshift_func_uint8_t_u_s(w %.2863, w %.2865) + %.2867 =w extub %.2866 + %.2868 =l loadl %.2577 + storew %.2867, %.2868 + %.2869 =l copy 1656972998 + %.2870 =w culel 4294967292, %.2869 + %.2871 =l or 214, 246 + %.2872 =w loadsw %.2 + %.2873 =l extsw %.2872 + %.2874 =w cnel %.2871, %.2873 + %.2875 =w loadsw %.1106 + %.2876 =w and %.2874, %.2875 + %.2877 =l extsw %.2876 + %.2878 =l xor %.2877, 3 + %.2879 =l loadl %.1289 + %.2880 =w ceql %.2793, %.2879 + %.2881 =w csgew %.2789, %.2880 + %.2882 =w cnew %.2881, 0 + jnz %.2882, @logic_right.1168, @logic_join.1169 +@logic_right.1168 + %.2883 =w loadsb %.509 + %.2884 =w extsb %.2883 + %.2885 =w cnew %.2884, 0 +@logic_join.1169 + %.2886 =w phi @logic_join.1171 %.2882, @logic_right.1168 %.2885 + %.2887 =l loadl %.4 + storew %.2886, %.2887 +@for_cont.1148 + %.2888 =w loadsb $g_631 + %.2889 =w extsb %.2888 + %.2890 =w sub %.2889, 1 + %.2891 =w copy %.2890 + storeb %.2891, $g_631 + jmp @for_cond.1146 +@for_join.1149 + %.2892 =w loadsw %.2 + %.2893 =w copy %.2892 + %.2894 =w call $safe_lshift_func_int16_t_s_s(w %.2893, w 10) + %.2895 =w extsh %.2894 + %.2896 =l loadl %.1261 + storew %.2895, %.2896 + %.2897 =w copy 0 + storeb %.2897, $g_566 +@for_cond.1174 + %.2898 =w loadub $g_566 + %.2899 =w extub %.2898 + %.2900 =w csltw %.2899, 8 + jnz %.2900, @for_body.1175, @for_join.1177 +@for_body.1175 + %.2901 =l extsw 0 + %.2902 =l copy %.2901 + %.2903 =w loadub $g_566 + %.2904 =l extub %.2903 + %.2905 =l mul %.2904, 8 + %.2906 =l add $g_364, %.2905 + storel %.2902, %.2906 +@for_cont.1176 + %.2907 =w loadub $g_566 + %.2908 =w extub %.2907 + %.2909 =w add %.2908, 1 + %.2910 =w copy %.2909 + storeb %.2910, $g_566 + jmp @for_cond.1174 +@for_join.1177 + %.2911 =l copy %.10 + %.2912 =l mul 48, 1 + %.2913 =l add %.2911, %.2912 + %.2914 =l copy %.2913 + storew 0, %.2914 +@for_cond.1178 + %.2915 =l copy %.10 + %.2916 =l mul 48, 1 + %.2917 =l add %.2915, %.2916 + %.2918 =l copy %.2917 + %.2919 =w loadsw %.2918 + %.2920 =w csgew %.2919, 0 + jnz %.2920, @for_body.1179, @for_join.1181 +@for_body.1179 + %.2922 =l add %.2921, 0 + %.2923 =l extsw 0 + %.2924 =l sub %.2923, 10 + %.2925 =w copy %.2924 + storeb %.2925, %.2922 + %.2926 =l loadl $g_88 + %.2927 =l loadl %.2926 + %.2928 =l loadl %.2927 + %.2929 =w loadsw %.2928 + %.2930 =w cnew %.2929, 0 + jnz %.2930, @if_true.1182, @if_false.1183 +@if_true.1182 + jmp @for_join.1181 +@if_false.1183 + %.2931 =l loadl $g_23 + %.2932 =w loadsw %.2931 + %.2933 =w cnew %.2932, 0 + jnz %.2933, @if_true.1184, @if_false.1185 +@if_true.1184 + jmp @for_cont.1180 +@if_false.1185 + %.2934 =l loadl %.4 + %.2935 =w loadsw %.2934 + %.2936 =w cnew %.2935, 0 + jnz %.2936, @if_true.1186, @if_false.1187 +@if_true.1186 + jmp @for_join.1181 +@if_false.1187 + %.2937 =l loadl $g_23 + %.2938 =w loadsw %.2937 + %.2939 =l copy $g_518 + %.2940 =l mul 48, 1 + %.2941 =l add %.2939, %.2940 + %.2942 =l copy %.2941 + %.2943 =w loadsw %.2942 + %.2944 =l copy %.10 + %.2945 =l mul 8, 1 + %.2946 =l add %.2944, %.2945 + %.2947 =l copy %.2946 + %.2948 =l loadl %.2947 + %.2949 =l loadl %.2547 + storel %.2948, %.2949 + %.2950 =l extsw 0 + %.2951 =l mul %.2950, 140 + %.2952 =l add %.533, %.2951 + %.2953 =l extsw 4 + %.2954 =l mul %.2953, 20 + %.2955 =l add %.2952, %.2954 + %.2956 =l extsw 3 + %.2957 =l mul %.2956, 4 + %.2958 =l add %.2955, %.2957 + %.2959 =w loadsw %.2958 + %.2960 =w copy %.2959 + %.2961 =w call $safe_lshift_func_int8_t_s_s(w %.2960, w 2) + %.2962 =l extsb %.2961 + %.2963 =w csltl %.2948, %.2962 + %.2964 =l loadl %.1261 + storew %.2963, %.2964 + %.2965 =w loadsw %.2 + %.2966 =l loadl %.2559 + %.2967 =l loadl $g_1069 + storel %.2967, $g_1069 + %.2968 =w cnel %.2966, %.2967 + %.2969 =w copy %.2968 + %.2970 =w loadsw %.2 + %.2971 =l extsw 0 + %.2972 =w ceql %.2, %.2971 + %.2973 =w ceqw %.2972, 0 + %.2974 =w copy %.2973 + %.2975 =w loadsw %.2 + %.2976 =w copy %.2975 + %.2977 =w call $safe_mul_func_int8_t_s_s(w %.2974, w %.2976) + %.2978 =w extsb %.2977 + %.2979 =w loadsw %.2 + %.2980 =w csltw %.2978, %.2979 + %.2981 =w copy %.2980 + %.2982 =w call $safe_sub_func_uint16_t_u_u(w %.2969, w %.2981) + %.2983 =l extuh %.2982 + %.2984 =w ceql 255, %.2983 + %.2985 =w loadsw %.2 + %.2986 =w or %.2965, %.2985 + %.2987 =w copy %.2986 + %.2988 =w copy 1 + %.2989 =w call $safe_add_func_uint8_t_u_u(w %.2987, w %.2988) + %.2990 =w extub %.2989 + %.2991 =w loadsb %.2921 + %.2992 =w extsb %.2991 + %.2993 =w cslew %.2990, %.2992 + %.2994 =w cnew %.2963, %.2993 + %.2995 =w loadsw %.2 + %.2996 =w xor %.2994, %.2995 + %.2997 =w loadsw %.2 + %.2998 =w ceqw %.2996, %.2997 + %.2999 =w xor %.2938, %.2998 + storew %.2999, %.2937 +@for_cont.1180 + %.3000 =l copy %.10 + %.3001 =l mul 48, 1 + %.3002 =l add %.3000, %.3001 + %.3003 =l copy %.3002 + %.3004 =w loadsw %.3003 + %.3005 =w sub %.3004, 1 + storew %.3005, %.3003 + jmp @for_cond.1178 +@for_join.1181 +@for_cont.1144 + %.3006 =l copy $g_265 + %.3007 =l mul 32, 1 + %.3008 =l add %.3006, %.3007 + %.3009 =l copy %.3008 + %.3010 =w loaduw %.3009 + %.3011 =w copy 1 + %.3012 =w add %.3010, %.3011 + storew %.3012, %.3009 + jmp @for_cond.1142 +@for_join.1145 +@for_cont.1091 + %.3013 =w loaduw $g_84 + %.3014 =w copy 1 + %.3015 =w add %.3013, %.3014 + storew %.3015, $g_84 + jmp @for_cond.1089 +@for_join.1092 + %.3016 =l extsw 0 + %.3017 =l copy $g_185 + %.3018 =l mul 24, 1 + %.3019 =l add %.3017, %.3018 + %.3020 =l copy %.3019 + storel %.3016, %.3020 +@for_cond.1188 + %.3021 =l copy $g_185 + %.3022 =l mul 24, 1 + %.3023 =l add %.3021, %.3022 + %.3024 =l copy %.3023 + %.3025 =l loadl %.3024 + %.3026 =l extsw 26 + %.3027 =w ceql %.3025, %.3026 + jnz %.3027, @for_body.1189, @for_join.1191 +@for_body.1189 + %.3029 =l add %.3028, 0 + %.3030 =l extsw 3 + %.3031 =l mul %.3030, 4 + %.3032 =l add %.1198, %.3031 + storel %.3032, %.3029 + %.3034 =l add %.3033, 0 + %.3035 =l extsw 0 + %.3036 =l copy %.3035 + storel %.3036, %.3034 + %.3038 =l add %.3037, 0 + %.3039 =l copy $g_185 + %.3040 =l mul 44, 1 + %.3041 =l add %.3039, %.3040 + %.3042 =l copy %.3041 + storel %.3042, %.3038 + %.3044 =l add %.3043, 0 + %.3045 =l extsw 0 + %.3046 =l copy %.3045 + storel %.3046, %.3044 + %.3048 =l add %.3047, 0 + %.3049 =l copy $g_518 + %.3050 =l mul 16, 1 + %.3051 =l add %.3049, %.3050 + %.3052 =l copy %.3051 + storel %.3052, %.3048 + %.3054 =l add %.3053, 0 + %.3055 =l copy $g_265 + %.3056 =l mul 48, 1 + %.3057 =l add %.3055, %.3056 + %.3058 =l copy %.3057 + storel %.3058, %.3054 + %.3060 =l add %.3059, 0 + %.3061 =l copy $g_185 + %.3062 =l mul 16, 1 + %.3063 =l add %.3061, %.3062 + %.3064 =l copy %.3063 + storel %.3064, %.3060 + %.3066 =l add %.3065, 0 + %.3067 =l extsw 0 + %.3068 =l mul %.3067, 140 + %.3069 =l add %.533, %.3068 + %.3070 =l extsw 4 + %.3071 =l mul %.3070, 20 + %.3072 =l add %.3069, %.3071 + %.3073 =l extsw 3 + %.3074 =l mul %.3073, 4 + %.3075 =l add %.3072, %.3074 + storel %.3075, %.3066 + %.3077 =l add %.3076, 0 + %.3078 =l copy $g_518 + %.3079 =l mul 44, 1 + %.3080 =l add %.3078, %.3079 + %.3081 =l copy %.3080 + storel %.3081, %.3077 + %.3083 =l add %.3082, 0 + %.3084 =l copy $g_185 + %.3085 =l mul 16, 1 + %.3086 =l add %.3084, %.3085 + %.3087 =l copy %.3086 + storel %.3087, %.3083 + %.3089 =l add %.3088, 0 + %.3090 =l copy %.89 + %.3091 =l mul 0, 1 + %.3092 =l add %.3090, %.3091 + %.3093 =l copy %.3092 + storel %.3093, %.3089 + %.3094 =l add %.3088, 8 + %.3095 =l extsw 0 + %.3096 =l mul %.3095, 140 + %.3097 =l add %.533, %.3096 + %.3098 =l extsw 4 + %.3099 =l mul %.3098, 20 + %.3100 =l add %.3097, %.3099 + %.3101 =l extsw 3 + %.3102 =l mul %.3101, 4 + %.3103 =l add %.3100, %.3102 + storel %.3103, %.3094 + %.3104 =l add %.3088, 16 + %.3105 =l copy $g_185 + %.3106 =l mul 44, 1 + %.3107 =l add %.3105, %.3106 + %.3108 =l copy %.3107 + storel %.3108, %.3104 + %.3109 =l add %.3088, 24 + %.3110 =l extsw 5 + %.3111 =l mul %.3110, 140 + %.3112 =l add %.533, %.3111 + %.3113 =l extsw 0 + %.3114 =l mul %.3113, 20 + %.3115 =l add %.3112, %.3114 + %.3116 =l extsw 3 + %.3117 =l mul %.3116, 4 + %.3118 =l add %.3115, %.3117 + storel %.3118, %.3109 + %.3119 =l add %.3088, 32 + %.3120 =l extsw 5 + %.3121 =l mul %.3120, 4 + %.3122 =l add %.1198, %.3121 + storel %.3122, %.3119 + %.3123 =l add %.3088, 40 + %.3124 =l copy %.10 + %.3125 =l mul 48, 1 + %.3126 =l add %.3124, %.3125 + %.3127 =l copy %.3126 + storel %.3127, %.3123 + %.3128 =l add %.3088, 48 + storel %.1106, %.3128 + %.3129 =l add %.3088, 56 + %.3130 =l extsw 0 + %.3131 =l copy %.3130 + storel %.3131, %.3129 + %.3132 =l add %.3088, 64 + %.3133 =l copy $g_185 + %.3134 =l mul 48, 1 + %.3135 =l add %.3133, %.3134 + %.3136 =l copy %.3135 + storel %.3136, %.3132 + %.3137 =l add %.3088, 72 + %.3138 =l copy $g_265 + %.3139 =l mul 44, 1 + %.3140 =l add %.3138, %.3139 + %.3141 =l copy %.3140 + storel %.3141, %.3137 + %.3142 =l add %.3088, 80 + %.3143 =l copy $g_185 + %.3144 =l mul 48, 1 + %.3145 =l add %.3143, %.3144 + %.3146 =l copy %.3145 + storel %.3146, %.3142 + %.3147 =l add %.3088, 88 + %.3148 =l extsw 5 + %.3149 =l mul %.3148, 140 + %.3150 =l add %.533, %.3149 + %.3151 =l extsw 0 + %.3152 =l mul %.3151, 20 + %.3153 =l add %.3150, %.3152 + %.3154 =l extsw 3 + %.3155 =l mul %.3154, 4 + %.3156 =l add %.3153, %.3155 + storel %.3156, %.3147 + %.3157 =l add %.3088, 96 + %.3158 =l copy $g_518 + %.3159 =l mul 48, 1 + %.3160 =l add %.3158, %.3159 + %.3161 =l copy %.3160 + storel %.3161, %.3157 + %.3162 =l add %.3088, 104 + %.3163 =l extsw 5 + %.3164 =l mul %.3163, 4 + %.3165 =l add %.1198, %.3164 + storel %.3165, %.3162 + %.3166 =l add %.3088, 112 + %.3167 =l extsw 0 + %.3168 =l copy %.3167 + storel %.3168, %.3166 + %.3169 =l add %.3088, 120 + %.3170 =l copy $g_518 + %.3171 =l mul 48, 1 + %.3172 =l add %.3170, %.3171 + %.3173 =l copy %.3172 + storel %.3173, %.3169 + %.3174 =l add %.3088, 128 + %.3175 =l extsw 0 + %.3176 =l mul %.3175, 140 + %.3177 =l add %.533, %.3176 + %.3178 =l extsw 4 + %.3179 =l mul %.3178, 20 + %.3180 =l add %.3177, %.3179 + %.3181 =l extsw 3 + %.3182 =l mul %.3181, 4 + %.3183 =l add %.3180, %.3182 + storel %.3183, %.3174 + %.3184 =l add %.3088, 136 + %.3185 =l extsw 0 + %.3186 =l copy %.3185 + storel %.3186, %.3184 + %.3187 =l add %.3088, 144 + %.3188 =l copy $g_185 + %.3189 =l mul 48, 1 + %.3190 =l add %.3188, %.3189 + %.3191 =l copy %.3190 + storel %.3191, %.3187 + %.3192 =l add %.3088, 152 + %.3193 =l copy %.89 + %.3194 =l mul 0, 1 + %.3195 =l add %.3193, %.3194 + %.3196 =l copy %.3195 + storel %.3196, %.3192 + %.3197 =l add %.3088, 160 + %.3198 =l copy %.10 + %.3199 =l mul 44, 1 + %.3200 =l add %.3198, %.3199 + %.3201 =l copy %.3200 + storel %.3201, %.3197 + %.3202 =l add %.3088, 168 + %.3203 =l copy $g_265 + %.3204 =l mul 44, 1 + %.3205 =l add %.3203, %.3204 + %.3206 =l copy %.3205 + storel %.3206, %.3202 + %.3207 =l add %.3088, 176 + %.3208 =l extsw 0 + %.3209 =l copy %.3208 + storel %.3209, %.3207 + %.3210 =l add %.3088, 184 + %.3211 =l copy $g_518 + %.3212 =l mul 48, 1 + %.3213 =l add %.3211, %.3212 + %.3214 =l copy %.3213 + storel %.3214, %.3210 + %.3215 =l add %.3088, 192 + %.3216 =l copy $g_130 + %.3217 =l mul 0, 1 + %.3218 =l add %.3216, %.3217 + %.3219 =l copy %.3218 + storel %.3219, %.3215 + %.3220 =l add %.3088, 200 + storel %.1106, %.3220 + %.3221 =l add %.3088, 208 + storel %.1106, %.3221 + %.3222 =l add %.3088, 216 + %.3223 =l copy %.10 + %.3224 =l mul 16, 1 + %.3225 =l add %.3223, %.3224 + %.3226 =l copy %.3225 + storel %.3226, %.3222 + %.3227 =l add %.3088, 224 + %.3228 =l copy $g_130 + %.3229 =l mul 0, 1 + %.3230 =l add %.3228, %.3229 + %.3231 =l copy %.3230 + storel %.3231, %.3227 + %.3232 =l add %.3088, 232 + %.3233 =l extsw 5 + %.3234 =l mul %.3233, 4 + %.3235 =l add %.1198, %.3234 + storel %.3235, %.3232 + %.3236 =l add %.3088, 240 + %.3237 =l extsw 0 + %.3238 =l copy %.3237 + storel %.3238, %.3236 + %.3239 =l add %.3088, 248 + %.3240 =l copy $g_130 + %.3241 =l mul 0, 1 + %.3242 =l add %.3240, %.3241 + %.3243 =l copy %.3242 + storel %.3243, %.3239 + %.3244 =l add %.3088, 256 + %.3245 =l copy $g_185 + %.3246 =l mul 48, 1 + %.3247 =l add %.3245, %.3246 + %.3248 =l copy %.3247 + storel %.3248, %.3244 + %.3249 =l add %.3088, 264 + %.3250 =l copy %.10 + %.3251 =l mul 48, 1 + %.3252 =l add %.3250, %.3251 + %.3253 =l copy %.3252 + storel %.3253, %.3249 + %.3254 =l add %.3088, 272 + %.3255 =l copy %.10 + %.3256 =l mul 48, 1 + %.3257 =l add %.3255, %.3256 + %.3258 =l copy %.3257 + storel %.3258, %.3254 + %.3259 =l add %.3088, 280 + %.3260 =l copy $g_518 + %.3261 =l mul 44, 1 + %.3262 =l add %.3260, %.3261 + %.3263 =l copy %.3262 + storel %.3263, %.3259 + %.3264 =l add %.3088, 288 + %.3265 =l extsw 0 + %.3266 =l copy %.3265 + storel %.3266, %.3264 + %.3267 =l add %.3088, 296 + %.3268 =l copy $g_518 + %.3269 =l mul 48, 1 + %.3270 =l add %.3268, %.3269 + %.3271 =l copy %.3270 + storel %.3271, %.3267 + %.3272 =l add %.3088, 304 + %.3273 =l extsw 0 + %.3274 =l copy %.3273 + storel %.3274, %.3272 + %.3275 =l add %.3088, 312 + %.3276 =l copy $g_518 + %.3277 =l mul 44, 1 + %.3278 =l add %.3276, %.3277 + %.3279 =l copy %.3278 + storel %.3279, %.3275 + %.3280 =l add %.3088, 320 + %.3281 =l extsw 5 + %.3282 =l mul %.3281, 4 + %.3283 =l add %.1198, %.3282 + storel %.3283, %.3280 + %.3284 =l add %.3088, 328 + %.3285 =l copy $g_518 + %.3286 =l mul 16, 1 + %.3287 =l add %.3285, %.3286 + %.3288 =l copy %.3287 + storel %.3288, %.3284 + %.3289 =l add %.3088, 336 + %.3290 =l copy $g_130 + %.3291 =l mul 0, 1 + %.3292 =l add %.3290, %.3291 + %.3293 =l copy %.3292 + storel %.3293, %.3289 + %.3294 =l add %.3088, 344 + %.3295 =l extsw 5 + %.3296 =l mul %.3295, 4 + %.3297 =l add %.1198, %.3296 + storel %.3297, %.3294 + %.3298 =l add %.3088, 352 + %.3299 =l copy $g_185 + %.3300 =l mul 16, 1 + %.3301 =l add %.3299, %.3300 + %.3302 =l copy %.3301 + storel %.3302, %.3298 + %.3303 =l add %.3088, 360 + %.3304 =l copy $g_185 + %.3305 =l mul 48, 1 + %.3306 =l add %.3304, %.3305 + %.3307 =l copy %.3306 + storel %.3307, %.3303 + %.3308 =l add %.3088, 368 + %.3309 =l extsw 0 + %.3310 =l copy %.3309 + storel %.3310, %.3308 + %.3311 =l add %.3088, 376 + %.3312 =l extsw 0 + %.3313 =l copy %.3312 + storel %.3313, %.3311 + %.3314 =l add %.3088, 384 + %.3315 =l copy %.10 + %.3316 =l mul 40, 1 + %.3317 =l add %.3315, %.3316 + %.3318 =l copy %.3317 + storel %.3318, %.3314 + %.3319 =l add %.3088, 392 + %.3320 =l extsw 0 + %.3321 =l copy %.3320 + storel %.3321, %.3319 + %.3322 =l add %.3088, 400 + %.3323 =l copy %.89 + %.3324 =l mul 0, 1 + %.3325 =l add %.3323, %.3324 + %.3326 =l copy %.3325 + storel %.3326, %.3322 + %.3327 =l add %.3088, 408 + %.3328 =l copy $g_518 + %.3329 =l mul 16, 1 + %.3330 =l add %.3328, %.3329 + %.3331 =l copy %.3330 + storel %.3331, %.3327 + %.3332 =l add %.3088, 416 + %.3333 =l extsw 5 + %.3334 =l mul %.3333, 140 + %.3335 =l add %.533, %.3334 + %.3336 =l extsw 0 + %.3337 =l mul %.3336, 20 + %.3338 =l add %.3335, %.3337 + %.3339 =l extsw 3 + %.3340 =l mul %.3339, 4 + %.3341 =l add %.3338, %.3340 + storel %.3341, %.3332 + %.3342 =l add %.3088, 424 + %.3343 =l copy $g_185 + %.3344 =l mul 16, 1 + %.3345 =l add %.3343, %.3344 + %.3346 =l copy %.3345 + storel %.3346, %.3342 + %.3347 =l add %.3088, 432 + %.3348 =l extsw 0 + %.3349 =l copy %.3348 + storel %.3349, %.3347 + %.3350 =l add %.3088, 440 + %.3351 =l extsw 5 + %.3352 =l mul %.3351, 4 + %.3353 =l add %.1198, %.3352 + storel %.3353, %.3350 + %.3354 =l add %.3088, 448 + %.3355 =l copy $g_130 + %.3356 =l mul 0, 1 + %.3357 =l add %.3355, %.3356 + %.3358 =l copy %.3357 + storel %.3358, %.3354 + %.3359 =l add %.3088, 456 + %.3360 =l copy $g_185 + %.3361 =l mul 48, 1 + %.3362 =l add %.3360, %.3361 + %.3363 =l copy %.3362 + storel %.3363, %.3359 + %.3364 =l add %.3088, 464 + %.3365 =l extsw 0 + %.3366 =l copy %.3365 + storel %.3366, %.3364 + %.3367 =l add %.3088, 472 + %.3368 =l copy %.10 + %.3369 =l mul 48, 1 + %.3370 =l add %.3368, %.3369 + %.3371 =l copy %.3370 + storel %.3371, %.3367 + %.3372 =l add %.3088, 480 + %.3373 =l copy $g_265 + %.3374 =l mul 44, 1 + %.3375 =l add %.3373, %.3374 + %.3376 =l copy %.3375 + storel %.3376, %.3372 + %.3377 =l add %.3088, 488 + %.3378 =l copy $g_130 + %.3379 =l mul 0, 1 + %.3380 =l add %.3378, %.3379 + %.3381 =l copy %.3380 + storel %.3381, %.3377 + %.3382 =l add %.3088, 496 + %.3383 =l copy $g_518 + %.3384 =l mul 44, 1 + %.3385 =l add %.3383, %.3384 + %.3386 =l copy %.3385 + storel %.3386, %.3382 + %.3387 =l add %.3088, 504 + %.3388 =l copy $g_518 + %.3389 =l mul 44, 1 + %.3390 =l add %.3388, %.3389 + %.3391 =l copy %.3390 + storel %.3391, %.3387 + %.3392 =l add %.3088, 512 + %.3393 =l copy $g_265 + %.3394 =l mul 44, 1 + %.3395 =l add %.3393, %.3394 + %.3396 =l copy %.3395 + storel %.3396, %.3392 + %.3397 =l add %.3088, 520 + %.3398 =l copy $g_185 + %.3399 =l mul 48, 1 + %.3400 =l add %.3398, %.3399 + %.3401 =l copy %.3400 + storel %.3401, %.3397 + %.3402 =l add %.3088, 528 + %.3403 =l extsw 5 + %.3404 =l mul %.3403, 4 + %.3405 =l add %.1198, %.3404 + storel %.3405, %.3402 + %.3406 =l add %.3088, 536 + %.3407 =l extsw 5 + %.3408 =l mul %.3407, 4 + %.3409 =l add %.1198, %.3408 + storel %.3409, %.3406 + %.3410 =l add %.3088, 544 + storel %.1106, %.3410 + %.3411 =l add %.3088, 552 + %.3412 =l copy %.10 + %.3413 =l mul 48, 1 + %.3414 =l add %.3412, %.3413 + %.3415 =l copy %.3414 + storel %.3415, %.3411 + %.3416 =l add %.3088, 560 + %.3417 =l copy $g_130 + %.3418 =l mul 0, 1 + %.3419 =l add %.3417, %.3418 + %.3420 =l copy %.3419 + storel %.3420, %.3416 + %.3421 =l add %.3088, 568 + %.3422 =l copy $g_518 + %.3423 =l mul 48, 1 + %.3424 =l add %.3422, %.3423 + %.3425 =l copy %.3424 + storel %.3425, %.3421 + %.3426 =l add %.3088, 576 + %.3427 =l extsw 5 + %.3428 =l mul %.3427, 4 + %.3429 =l add %.1198, %.3428 + storel %.3429, %.3426 + %.3430 =l add %.3088, 584 + %.3431 =l extsw 0 + %.3432 =l copy %.3431 + storel %.3432, %.3430 + %.3433 =l add %.3088, 592 + %.3434 =l extsw 5 + %.3435 =l mul %.3434, 4 + %.3436 =l add %.1198, %.3435 + storel %.3436, %.3433 + %.3437 =l add %.3088, 600 + storel %.1106, %.3437 + %.3438 =l add %.3088, 608 + %.3439 =l copy $g_185 + %.3440 =l mul 48, 1 + %.3441 =l add %.3439, %.3440 + %.3442 =l copy %.3441 + storel %.3442, %.3438 + %.3443 =l add %.3088, 616 + %.3444 =l copy $g_265 + %.3445 =l mul 44, 1 + %.3446 =l add %.3444, %.3445 + %.3447 =l copy %.3446 + storel %.3447, %.3443 + %.3448 =l add %.3088, 624 + %.3449 =l copy $g_265 + %.3450 =l mul 44, 1 + %.3451 =l add %.3449, %.3450 + %.3452 =l copy %.3451 + storel %.3452, %.3448 + %.3453 =l add %.3088, 632 + %.3454 =l copy $g_185 + %.3455 =l mul 48, 1 + %.3456 =l add %.3454, %.3455 + %.3457 =l copy %.3456 + storel %.3457, %.3453 + %.3458 =l add %.3088, 640 + %.3459 =l copy $g_185 + %.3460 =l mul 48, 1 + %.3461 =l add %.3459, %.3460 + %.3462 =l copy %.3461 + storel %.3462, %.3458 + %.3463 =l add %.3088, 648 + %.3464 =l copy $g_265 + %.3465 =l mul 44, 1 + %.3466 =l add %.3464, %.3465 + %.3467 =l copy %.3466 + storel %.3467, %.3463 + %.3468 =l add %.3088, 656 + %.3469 =l copy $g_265 + %.3470 =l mul 44, 1 + %.3471 =l add %.3469, %.3470 + %.3472 =l copy %.3471 + storel %.3472, %.3468 + %.3473 =l add %.3088, 664 + %.3474 =l copy %.89 + %.3475 =l mul 0, 1 + %.3476 =l add %.3474, %.3475 + %.3477 =l copy %.3476 + storel %.3477, %.3473 + %.3478 =l add %.3088, 672 + %.3479 =l extsw 0 + %.3480 =l copy %.3479 + storel %.3480, %.3478 + %.3481 =l add %.3088, 680 + storel %.1106, %.3481 + %.3482 =l add %.3088, 688 + %.3483 =l copy %.10 + %.3484 =l mul 48, 1 + %.3485 =l add %.3483, %.3484 + %.3486 =l copy %.3485 + storel %.3486, %.3482 + %.3487 =l add %.3088, 696 + %.3488 =l copy %.10 + %.3489 =l mul 44, 1 + %.3490 =l add %.3488, %.3489 + %.3491 =l copy %.3490 + storel %.3491, %.3487 + %.3492 =l add %.3088, 704 + %.3493 =l copy $g_185 + %.3494 =l mul 16, 1 + %.3495 =l add %.3493, %.3494 + %.3496 =l copy %.3495 + storel %.3496, %.3492 + %.3497 =l add %.3088, 712 + %.3498 =l copy $g_518 + %.3499 =l mul 16, 1 + %.3500 =l add %.3498, %.3499 + %.3501 =l copy %.3500 + storel %.3501, %.3497 + %.3502 =l add %.3088, 720 + %.3503 =l copy $g_265 + %.3504 =l mul 44, 1 + %.3505 =l add %.3503, %.3504 + %.3506 =l copy %.3505 + storel %.3506, %.3502 + %.3507 =l add %.3088, 728 + %.3508 =l extsw 0 + %.3509 =l copy %.3508 + storel %.3509, %.3507 + %.3510 =l add %.3088, 736 + %.3511 =l extsw 0 + %.3512 =l copy %.3511 + storel %.3512, %.3510 + %.3513 =l add %.3088, 744 + %.3514 =l copy $g_265 + %.3515 =l mul 44, 1 + %.3516 =l add %.3514, %.3515 + %.3517 =l copy %.3516 + storel %.3517, %.3513 + %.3518 =l add %.3088, 752 + %.3519 =l copy $g_794 + %.3520 =l mul 0, 1 + %.3521 =l add %.3519, %.3520 + %.3522 =l copy %.3521 + storel %.3522, %.3518 + %.3523 =l add %.3088, 760 + %.3524 =l extsw 0 + %.3525 =l copy %.3524 + storel %.3525, %.3523 + %.3526 =l add %.3088, 768 + %.3527 =l extsw 3 + %.3528 =l mul %.3527, 4 + %.3529 =l add %.1198, %.3528 + storel %.3529, %.3526 + %.3530 =l add %.3088, 776 + storel %.1106, %.3530 + %.3531 =l add %.3088, 784 + %.3532 =l copy %.89 + %.3533 =l mul 0, 1 + %.3534 =l add %.3532, %.3533 + %.3535 =l copy %.3534 + storel %.3535, %.3531 + %.3536 =l add %.3088, 792 + storel %.1106, %.3536 + %.3537 =l add %.3088, 800 + %.3538 =l copy %.89 + %.3539 =l mul 0, 1 + %.3540 =l add %.3538, %.3539 + %.3541 =l copy %.3540 + storel %.3541, %.3537 + %.3542 =l add %.3088, 808 + %.3543 =l extsw 0 + %.3544 =l copy %.3543 + storel %.3544, %.3542 + %.3545 =l add %.3088, 816 + %.3546 =l copy $g_518 + %.3547 =l mul 44, 1 + %.3548 =l add %.3546, %.3547 + %.3549 =l copy %.3548 + storel %.3549, %.3545 + %.3550 =l add %.3088, 824 + %.3551 =l copy $g_265 + %.3552 =l mul 44, 1 + %.3553 =l add %.3551, %.3552 + %.3554 =l copy %.3553 + storel %.3554, %.3550 + %.3555 =l add %.3088, 832 + %.3556 =l copy $g_185 + %.3557 =l mul 48, 1 + %.3558 =l add %.3556, %.3557 + %.3559 =l copy %.3558 + storel %.3559, %.3555 + %.3560 =l add %.3088, 840 + %.3561 =l copy %.10 + %.3562 =l mul 48, 1 + %.3563 =l add %.3561, %.3562 + %.3564 =l copy %.3563 + storel %.3564, %.3560 + %.3565 =l add %.3088, 848 + %.3566 =l copy $g_265 + %.3567 =l mul 44, 1 + %.3568 =l add %.3566, %.3567 + %.3569 =l copy %.3568 + storel %.3569, %.3565 + %.3570 =l add %.3088, 856 + %.3571 =l copy $g_130 + %.3572 =l mul 0, 1 + %.3573 =l add %.3571, %.3572 + %.3574 =l copy %.3573 + storel %.3574, %.3570 + %.3575 =l add %.3088, 864 + %.3576 =l copy $g_518 + %.3577 =l mul 44, 1 + %.3578 =l add %.3576, %.3577 + %.3579 =l copy %.3578 + storel %.3579, %.3575 + %.3580 =l add %.3088, 872 + %.3581 =l copy $g_185 + %.3582 =l mul 48, 1 + %.3583 =l add %.3581, %.3582 + %.3584 =l copy %.3583 + storel %.3584, %.3580 + %.3585 =l add %.3088, 880 + %.3586 =l extsw 0 + %.3587 =l copy %.3586 + storel %.3587, %.3585 + %.3588 =l add %.3088, 888 + %.3589 =l extsw 0 + %.3590 =l copy %.3589 + storel %.3590, %.3588 + %.3591 =l add %.3088, 896 + storel %.1106, %.3591 + %.3592 =l add %.3088, 904 + %.3593 =l copy $g_518 + %.3594 =l mul 48, 1 + %.3595 =l add %.3593, %.3594 + %.3596 =l copy %.3595 + storel %.3596, %.3592 + %.3597 =l add %.3088, 912 + %.3598 =l extsw 3 + %.3599 =l mul %.3598, 4 + %.3600 =l add %.1198, %.3599 + storel %.3600, %.3597 + %.3601 =l add %.3088, 920 + %.3602 =l extsw 0 + %.3603 =l copy %.3602 + storel %.3603, %.3601 + %.3604 =l add %.3088, 928 + storel %.1106, %.3604 + %.3605 =l add %.3088, 936 + %.3606 =l extsw 0 + %.3607 =l copy %.3606 + storel %.3607, %.3605 + %.3608 =l add %.3088, 944 + %.3609 =l extsw 0 + %.3610 =l mul %.3609, 140 + %.3611 =l add %.533, %.3610 + %.3612 =l extsw 4 + %.3613 =l mul %.3612, 20 + %.3614 =l add %.3611, %.3613 + %.3615 =l extsw 3 + %.3616 =l mul %.3615, 4 + %.3617 =l add %.3614, %.3616 + storel %.3617, %.3608 + %.3618 =l add %.3088, 952 + %.3619 =l copy $g_185 + %.3620 =l mul 48, 1 + %.3621 =l add %.3619, %.3620 + %.3622 =l copy %.3621 + storel %.3622, %.3618 + %.3623 =l add %.3088, 960 + %.3624 =l copy $g_265 + %.3625 =l mul 44, 1 + %.3626 =l add %.3624, %.3625 + %.3627 =l copy %.3626 + storel %.3627, %.3623 + %.3628 =l add %.3088, 968 + %.3629 =l copy $g_185 + %.3630 =l mul 48, 1 + %.3631 =l add %.3629, %.3630 + %.3632 =l copy %.3631 + storel %.3632, %.3628 + %.3633 =l add %.3088, 976 + %.3634 =l copy $g_185 + %.3635 =l mul 40, 1 + %.3636 =l add %.3634, %.3635 + %.3637 =l copy %.3636 + storel %.3637, %.3633 + %.3638 =l add %.3088, 984 + %.3639 =l copy $g_185 + %.3640 =l mul 48, 1 + %.3641 =l add %.3639, %.3640 + %.3642 =l copy %.3641 + storel %.3642, %.3638 + %.3643 =l add %.3088, 992 + %.3644 =l copy $g_265 + %.3645 =l mul 44, 1 + %.3646 =l add %.3644, %.3645 + %.3647 =l copy %.3646 + storel %.3647, %.3643 + %.3648 =l add %.3088, 1000 + %.3649 =l copy $g_185 + %.3650 =l mul 48, 1 + %.3651 =l add %.3649, %.3650 + %.3652 =l copy %.3651 + storel %.3652, %.3648 + %.3654 =l add %.3653, 0 + storel 6920699678995543627, %.3654 + %.3656 =l add %.3655, 0 + %.3657 =w copy 9 + storew %.3657, %.3656 + %.3659 =l add %.3658, 0 + %.3660 =w copy 193 + storeb %.3660, %.3659 + %.3664 =l loadl %.1115 + %.3665 =l loaduw $g_794 + storew %.3665, %.3664 + %.3666 =l add $g_794, 4 + %.3667 =l add %.3664, 4 + %.3668 =l loaduw %.3666 + storew %.3668, %.3667 + %.3669 =l add %.3666, 4 + %.3670 =l add %.3667, 4 + %.3671 =l loaduw %.3669 + storew %.3671, %.3670 + %.3672 =l add %.3669, 4 + %.3673 =l add %.3670, 4 + %.3674 =l loaduw %.3672 + storew %.3674, %.3673 + %.3675 =l add %.3672, 4 + %.3676 =l add %.3673, 4 + %.3677 =l loaduw %.3675 + storew %.3677, %.3676 + %.3678 =l add %.3675, 4 + %.3679 =l add %.3676, 4 + %.3680 =w loaduh %.110 + %.3681 =w add %.3680, 1 + storeh %.3681, %.110 + %.3682 =l copy $g_130 + %.3683 =l mul 12, 1 + %.3684 =l add %.3682, %.3683 + %.3685 =l copy %.3684 + storew 1, %.3685 +@for_cond.1192 + %.3686 =l copy $g_130 + %.3687 =l mul 12, 1 + %.3688 =l add %.3686, %.3687 + %.3689 =l copy %.3688 + %.3690 =w loadsw %.3689 + %.3691 =w cslew %.3690, 5 + jnz %.3691, @for_body.1193, @for_join.1195 +@for_body.1193 + %.3693 =l add %.3692, 0 + %.3694 =w copy 254 + storeb %.3694, %.3693 + %.3696 =l add %.3695, 0 + storel %.3043, %.3696 + %.3698 =l add %.3697, 0 + %.3699 =l extsw 0 + %.3700 =l sub %.3699, 1 + %.3701 =w copy %.3700 + storew %.3701, %.3698 + %.3703 =l add %.3702, 0 + %.3704 =w copy 150919925 + storew %.3704, %.3703 + storew 0, %.3706 +@for_cond.1196 + %.3707 =w loadsw %.3706 + %.3708 =w csltw %.3707, 9 + jnz %.3708, @for_body.1197, @for_join.1199 +@for_body.1197 + %.3709 =w copy 0 + %.3710 =w loadsw %.3706 + %.3711 =l extsw %.3710 + %.3712 =l mul %.3711, 4 + %.3713 =l add %.3705, %.3712 + storew %.3709, %.3713 +@for_cont.1198 + %.3714 =w loadsw %.3706 + %.3715 =w add %.3714, 1 + storew %.3715, %.3706 + jmp @for_cond.1196 +@for_join.1199 + %.3716 =w loadub %.3692 + %.3717 =w add %.3716, 1 + storeb %.3717, %.3692 + %.3718 =l loadl %.3695 + storel %.2, %.3718 + %.3719 =w loadub %.3658 + %.3720 =w add %.3719, 1 + storeb %.3720, %.3658 + %.3721 =l copy $g_130 + %.3722 =l mul 12, 1 + %.3723 =l add %.3721, %.3722 + %.3724 =l copy %.3723 + %.3725 =w loadsw %.3724 + %.3726 =l extsw %.3725 + %.3727 =l mul %.3726, 1 + %.3728 =l add $g_132, %.3727 + %.3729 =w loadsb %.3728 + %.3730 =w extsb %.3729 + %.3731 =w cnew %.3730, 0 + jnz %.3731, @if_true.1200, @if_false.1201 +@if_true.1200 + jmp @for_join.1195 +@if_false.1201 +@for_cont.1194 + %.3732 =l copy $g_130 + %.3733 =l mul 12, 1 + %.3734 =l add %.3732, %.3733 + %.3735 =l copy %.3734 + %.3736 =w loadsw %.3735 + %.3737 =w add %.3736, 1 + storew %.3737, %.3735 + jmp @for_cond.1192 +@for_join.1195 +@for_cont.1190 + %.3738 =l copy $g_185 + %.3739 =l mul 24, 1 + %.3740 =l add %.3738, %.3739 + %.3741 =l copy %.3740 + %.3742 =l loadl %.3741 + %.3743 =l copy %.3742 + %.3744 =l extsw 6 + %.3745 =l call $safe_add_func_int64_t_s_s(l %.3743, l %.3744) + %.3746 =l copy %.3745 + %.3747 =l copy $g_185 + %.3748 =l mul 24, 1 + %.3749 =l add %.3747, %.3748 + %.3750 =l copy %.3749 + storel %.3746, %.3750 + jmp @for_cond.1188 +@for_join.1191 +@for_cont.1087 + %.3751 =l copy %.89 + %.3752 =l mul 8, 1 + %.3753 =l add %.3751, %.3752 + %.3754 =l copy %.3753 + %.3755 =w loadsh %.3754 + %.3756 =w sub %.3755, 1 + storeh %.3756, %.3754 + jmp @for_cond.1085 +@for_join.1088 + %.3757 =w sub 0, 4 + %.3758 =w copy %.3757 + %.3759 =l copy $g_518 + %.3760 =l mul 0, 1 + %.3761 =l add %.3759, %.3760 + %.3762 =l copy %.3761 + storeb %.3758, %.3762 +@for_cond.1202 + %.3763 =l copy $g_518 + %.3764 =l mul 0, 1 + %.3765 =l add %.3763, %.3764 + %.3766 =l copy %.3765 + %.3767 =w loadub %.3766 + %.3768 =w extub %.3767 + %.3769 =w csgew %.3768, 55 + jnz %.3769, @for_body.1203, @for_join.1205 +@for_body.1203 + %.3771 =l add %.3770, 0 + %.3772 =w copy 6002 + storeh %.3772, %.3771 + %.3773 =l extsw 3 + %.3774 =l mul %.3773, 140 + %.3775 =l add %.533, %.3774 + %.3776 =l extsw 0 + %.3777 =l mul %.3776, 20 + %.3778 =l add %.3775, %.3777 + %.3779 =l extsw 3 + %.3780 =l mul %.3779, 4 + %.3781 =l add %.3778, %.3780 + %.3782 =w loadsw %.3781 + %.3783 =w loaduh %.3770 + %.3784 =w call $safe_lshift_func_uint16_t_u_s(w %.3783, w 12) + %.3785 =w extuh %.3784 + %.3786 =l loadl $g_173 + %.3787 =w loadsw %.3786 + %.3788 =w cslew %.3785, %.3787 + %.3789 =l extsw 0 + %.3790 =w cnel %.4, %.3789 + %.3791 =w copy 2634066933 + %.3792 =w call $safe_add_func_int32_t_s_s(w %.3790, w %.3791) + %.3793 =w cslew %.3788, %.3792 + %.3794 =w xor %.3782, %.3793 + storew %.3794, %.3781 +@for_cont.1204 + %.3795 =l copy $g_518 + %.3796 =l mul 0, 1 + %.3797 =l add %.3795, %.3796 + %.3798 =l copy %.3797 + %.3799 =w loadub %.3798 + %.3800 =w extub %.3799 + %.3801 =w copy 6 + %.3802 =w call $safe_add_func_int16_t_s_s(w %.3800, w %.3801) + %.3803 =w copy %.3802 + %.3804 =l copy $g_518 + %.3805 =l mul 0, 1 + %.3806 =l add %.3804, %.3805 + %.3807 =l copy %.3806 + storeb %.3803, %.3807 + jmp @for_cond.1202 +@for_join.1205 +@if_join.1080 +@lbl_1172.1206 + %.3808 =w copy 0 + %.3809 =l copy $g_518 + %.3810 =l mul 0, 1 + %.3811 =l add %.3809, %.3810 + %.3812 =l copy %.3811 + storeb %.3808, %.3812 +@for_cond.1207 + %.3813 =l copy $g_518 + %.3814 =l mul 0, 1 + %.3815 =l add %.3813, %.3814 + %.3816 =l copy %.3815 + %.3817 =w loadub %.3816 + %.3818 =w extub %.3817 + %.3819 =w cnew %.3818, 57 + jnz %.3819, @for_body.1208, @for_join.1210 +@for_body.1208 + %.3821 =l add %.3820, 0 + %.3822 =w copy 1 + storew %.3822, %.3821 + %.3824 =l add %.3823, 0 + %.3825 =w copy 809845413 + storew %.3825, %.3824 + %.3827 =l add %.3826, 0 + %.3828 =w copy 140435225 + storew %.3828, %.3827 + %.3830 =l add %.3829, 0 + %.3831 =w copy 1062787020 + storew %.3831, %.3830 + %.3833 =l add %.3832, 0 + %.3834 =w copy 0 + storew %.3834, %.3833 + %.3836 =l add %.3835, 0 + %.3837 =l copy $g_185 + %.3838 =l mul 40, 1 + %.3839 =l add %.3837, %.3838 + %.3840 =l copy %.3839 + storel %.3840, %.3836 + %.3842 =l add %.3841, 0 + %.3843 =l copy $g_185 + %.3844 =l mul 44, 1 + %.3845 =l add %.3843, %.3844 + %.3846 =l copy %.3845 + storel %.3846, %.3842 + %.3848 =l add %.3847, 0 + storel %.3823, %.3848 + %.3850 =l add %.3849, 0 + %.3851 =l copy %.10 + %.3852 =l mul 44, 1 + %.3853 =l add %.3851, %.3852 + %.3854 =l copy %.3853 + storel %.3854, %.3850 + %.3856 =l add %.3855, 0 + %.3857 =l copy %.10 + %.3858 =l mul 16, 1 + %.3859 =l add %.3857, %.3858 + %.3860 =l copy %.3859 + storel %.3860, %.3856 + %.3861 =l add %.3855, 8 + %.3862 =l extsw 0 + %.3863 =l copy %.3862 + storel %.3863, %.3861 + %.3864 =l add %.3855, 16 + %.3865 =l copy %.10 + %.3866 =l mul 16, 1 + %.3867 =l add %.3865, %.3866 + %.3868 =l copy %.3867 + storel %.3868, %.3864 + %.3869 =l add %.3855, 24 + %.3870 =l copy %.10 + %.3871 =l mul 16, 1 + %.3872 =l add %.3870, %.3871 + %.3873 =l copy %.3872 + storel %.3873, %.3869 + %.3874 =l add %.3855, 32 + %.3875 =l extsw 0 + %.3876 =l copy %.3875 + storel %.3876, %.3874 + %.3877 =l add %.3855, 40 + %.3878 =l copy %.10 + %.3879 =l mul 16, 1 + %.3880 =l add %.3878, %.3879 + %.3881 =l copy %.3880 + storel %.3881, %.3877 + %.3882 =l add %.3855, 48 + %.3883 =l copy %.10 + %.3884 =l mul 16, 1 + %.3885 =l add %.3883, %.3884 + %.3886 =l copy %.3885 + storel %.3886, %.3882 + %.3887 =l add %.3855, 56 + %.3888 =l extsw 0 + %.3889 =l copy %.3888 + storel %.3889, %.3887 + %.3890 =l add %.3855, 64 + %.3891 =l copy %.10 + %.3892 =l mul 16, 1 + %.3893 =l add %.3891, %.3892 + %.3894 =l copy %.3893 + storel %.3894, %.3890 + %.3895 =l add %.3855, 72 + %.3896 =l copy %.10 + %.3897 =l mul 16, 1 + %.3898 =l add %.3896, %.3897 + %.3899 =l copy %.3898 + storel %.3899, %.3895 + %.3900 =l add %.3855, 80 + %.3901 =l extsw 0 + %.3902 =l copy %.3901 + storel %.3902, %.3900 + %.3903 =l add %.3855, 88 + %.3904 =l copy %.10 + %.3905 =l mul 16, 1 + %.3906 =l add %.3904, %.3905 + %.3907 =l copy %.3906 + storel %.3907, %.3903 + %.3908 =l add %.3855, 96 + %.3909 =l copy %.10 + %.3910 =l mul 16, 1 + %.3911 =l add %.3909, %.3910 + %.3912 =l copy %.3911 + storel %.3912, %.3908 + %.3913 =l add %.3855, 104 + %.3914 =l extsw 0 + %.3915 =l copy %.3914 + storel %.3915, %.3913 + %.3916 =l add %.3855, 112 + %.3917 =l copy %.10 + %.3918 =l mul 16, 1 + %.3919 =l add %.3917, %.3918 + %.3920 =l copy %.3919 + storel %.3920, %.3916 + %.3921 =l add %.3855, 120 + %.3922 =l copy %.10 + %.3923 =l mul 16, 1 + %.3924 =l add %.3922, %.3923 + %.3925 =l copy %.3924 + storel %.3925, %.3921 + %.3926 =l add %.3855, 128 + %.3927 =l extsw 0 + %.3928 =l copy %.3927 + storel %.3928, %.3926 + %.3929 =l add %.3855, 136 + %.3930 =l copy %.10 + %.3931 =l mul 16, 1 + %.3932 =l add %.3930, %.3931 + %.3933 =l copy %.3932 + storel %.3933, %.3929 + %.3934 =l add %.3855, 144 + %.3935 =l copy $g_265 + %.3936 =l mul 48, 1 + %.3937 =l add %.3935, %.3936 + %.3938 =l copy %.3937 + storel %.3938, %.3934 + %.3939 =l add %.3855, 152 + %.3940 =l copy %.10 + %.3941 =l mul 16, 1 + %.3942 =l add %.3940, %.3941 + %.3943 =l copy %.3942 + storel %.3943, %.3939 + %.3944 =l add %.3855, 160 + %.3945 =l copy $g_265 + %.3946 =l mul 48, 1 + %.3947 =l add %.3945, %.3946 + %.3948 =l copy %.3947 + storel %.3948, %.3944 + %.3949 =l add %.3855, 168 + %.3950 =l copy $g_265 + %.3951 =l mul 48, 1 + %.3952 =l add %.3950, %.3951 + %.3953 =l copy %.3952 + storel %.3953, %.3949 + %.3954 =l add %.3855, 176 + %.3955 =l copy %.10 + %.3956 =l mul 16, 1 + %.3957 =l add %.3955, %.3956 + %.3958 =l copy %.3957 + storel %.3958, %.3954 + %.3959 =l add %.3855, 184 + %.3960 =l copy $g_265 + %.3961 =l mul 48, 1 + %.3962 =l add %.3960, %.3961 + %.3963 =l copy %.3962 + storel %.3963, %.3959 + %.3964 =l add %.3855, 192 + %.3965 =l copy $g_265 + %.3966 =l mul 48, 1 + %.3967 =l add %.3965, %.3966 + %.3968 =l copy %.3967 + storel %.3968, %.3964 + %.3969 =l add %.3855, 200 + %.3970 =l copy %.10 + %.3971 =l mul 16, 1 + %.3972 =l add %.3970, %.3971 + %.3973 =l copy %.3972 + storel %.3973, %.3969 + %.3974 =l add %.3855, 208 + %.3975 =l copy $g_265 + %.3976 =l mul 48, 1 + %.3977 =l add %.3975, %.3976 + %.3978 =l copy %.3977 + storel %.3978, %.3974 + %.3979 =l add %.3855, 216 + %.3980 =l copy $g_265 + %.3981 =l mul 48, 1 + %.3982 =l add %.3980, %.3981 + %.3983 =l copy %.3982 + storel %.3983, %.3979 + %.3984 =l add %.3855, 224 + %.3985 =l copy %.10 + %.3986 =l mul 16, 1 + %.3987 =l add %.3985, %.3986 + %.3988 =l copy %.3987 + storel %.3988, %.3984 + %.3989 =l add %.3855, 232 + %.3990 =l copy $g_265 + %.3991 =l mul 48, 1 + %.3992 =l add %.3990, %.3991 + %.3993 =l copy %.3992 + storel %.3993, %.3989 + %.3994 =l add %.3855, 240 + %.3995 =l copy $g_265 + %.3996 =l mul 48, 1 + %.3997 =l add %.3995, %.3996 + %.3998 =l copy %.3997 + storel %.3998, %.3994 + %.3999 =l add %.3855, 248 + %.4000 =l copy %.10 + %.4001 =l mul 16, 1 + %.4002 =l add %.4000, %.4001 + %.4003 =l copy %.4002 + storel %.4003, %.3999 + %.4004 =l add %.3855, 256 + %.4005 =l copy $g_265 + %.4006 =l mul 48, 1 + %.4007 =l add %.4005, %.4006 + %.4008 =l copy %.4007 + storel %.4008, %.4004 + %.4009 =l add %.3855, 264 + %.4010 =l copy $g_265 + %.4011 =l mul 48, 1 + %.4012 =l add %.4010, %.4011 + %.4013 =l copy %.4012 + storel %.4013, %.4009 + %.4014 =l add %.3855, 272 + %.4015 =l copy %.10 + %.4016 =l mul 16, 1 + %.4017 =l add %.4015, %.4016 + %.4018 =l copy %.4017 + storel %.4018, %.4014 + %.4019 =l add %.3855, 280 + %.4020 =l copy $g_265 + %.4021 =l mul 48, 1 + %.4022 =l add %.4020, %.4021 + %.4023 =l copy %.4022 + storel %.4023, %.4019 + %.4024 =l add %.3855, 288 + %.4025 =l copy $g_265 + %.4026 =l mul 48, 1 + %.4027 =l add %.4025, %.4026 + %.4028 =l copy %.4027 + storel %.4028, %.4024 + %.4029 =l add %.3855, 296 + %.4030 =l copy %.10 + %.4031 =l mul 16, 1 + %.4032 =l add %.4030, %.4031 + %.4033 =l copy %.4032 + storel %.4033, %.4029 + %.4034 =l add %.3855, 304 + %.4035 =l copy $g_265 + %.4036 =l mul 48, 1 + %.4037 =l add %.4035, %.4036 + %.4038 =l copy %.4037 + storel %.4038, %.4034 + %.4039 =l add %.3855, 312 + %.4040 =l copy $g_265 + %.4041 =l mul 48, 1 + %.4042 =l add %.4040, %.4041 + %.4043 =l copy %.4042 + storel %.4043, %.4039 + %.4044 =l add %.3855, 320 + %.4045 =l copy %.10 + %.4046 =l mul 16, 1 + %.4047 =l add %.4045, %.4046 + %.4048 =l copy %.4047 + storel %.4048, %.4044 + %.4049 =l add %.3855, 328 + %.4050 =l copy $g_265 + %.4051 =l mul 48, 1 + %.4052 =l add %.4050, %.4051 + %.4053 =l copy %.4052 + storel %.4053, %.4049 + %.4054 =l add %.3855, 336 + %.4055 =l copy $g_265 + %.4056 =l mul 48, 1 + %.4057 =l add %.4055, %.4056 + %.4058 =l copy %.4057 + storel %.4058, %.4054 + %.4059 =l add %.3855, 344 + %.4060 =l copy %.10 + %.4061 =l mul 16, 1 + %.4062 =l add %.4060, %.4061 + %.4063 =l copy %.4062 + storel %.4063, %.4059 + %.4064 =l add %.3855, 352 + %.4065 =l copy $g_265 + %.4066 =l mul 48, 1 + %.4067 =l add %.4065, %.4066 + %.4068 =l copy %.4067 + storel %.4068, %.4064 + %.4069 =l add %.3855, 360 + %.4070 =l copy $g_265 + %.4071 =l mul 48, 1 + %.4072 =l add %.4070, %.4071 + %.4073 =l copy %.4072 + storel %.4073, %.4069 + %.4074 =l add %.3855, 368 + %.4075 =l copy %.10 + %.4076 =l mul 16, 1 + %.4077 =l add %.4075, %.4076 + %.4078 =l copy %.4077 + storel %.4078, %.4074 + %.4079 =l add %.3855, 376 + %.4080 =l copy $g_265 + %.4081 =l mul 48, 1 + %.4082 =l add %.4080, %.4081 + %.4083 =l copy %.4082 + storel %.4083, %.4079 + %.4084 =l add %.3855, 384 + %.4085 =l copy $g_265 + %.4086 =l mul 48, 1 + %.4087 =l add %.4085, %.4086 + %.4088 =l copy %.4087 + storel %.4088, %.4084 + %.4089 =l add %.3855, 392 + %.4090 =l copy %.10 + %.4091 =l mul 16, 1 + %.4092 =l add %.4090, %.4091 + %.4093 =l copy %.4092 + storel %.4093, %.4089 + %.4094 =l add %.3855, 400 + %.4095 =l copy $g_265 + %.4096 =l mul 48, 1 + %.4097 =l add %.4095, %.4096 + %.4098 =l copy %.4097 + storel %.4098, %.4094 + %.4099 =l add %.3855, 408 + %.4100 =l copy $g_265 + %.4101 =l mul 48, 1 + %.4102 =l add %.4100, %.4101 + %.4103 =l copy %.4102 + storel %.4103, %.4099 + %.4104 =l add %.3855, 416 + %.4105 =l copy %.10 + %.4106 =l mul 16, 1 + %.4107 =l add %.4105, %.4106 + %.4108 =l copy %.4107 + storel %.4108, %.4104 + %.4109 =l add %.3855, 424 + %.4110 =l copy $g_265 + %.4111 =l mul 48, 1 + %.4112 =l add %.4110, %.4111 + %.4113 =l copy %.4112 + storel %.4113, %.4109 + %.4114 =l add %.3855, 432 + %.4115 =l copy $g_265 + %.4116 =l mul 48, 1 + %.4117 =l add %.4115, %.4116 + %.4118 =l copy %.4117 + storel %.4118, %.4114 + %.4119 =l add %.3855, 440 + %.4120 =l copy %.10 + %.4121 =l mul 16, 1 + %.4122 =l add %.4120, %.4121 + %.4123 =l copy %.4122 + storel %.4123, %.4119 + %.4124 =l add %.3855, 448 + %.4125 =l copy $g_265 + %.4126 =l mul 48, 1 + %.4127 =l add %.4125, %.4126 + %.4128 =l copy %.4127 + storel %.4128, %.4124 + %.4129 =l add %.3855, 456 + %.4130 =l copy $g_265 + %.4131 =l mul 48, 1 + %.4132 =l add %.4130, %.4131 + %.4133 =l copy %.4132 + storel %.4133, %.4129 + %.4134 =l add %.3855, 464 + %.4135 =l copy %.10 + %.4136 =l mul 16, 1 + %.4137 =l add %.4135, %.4136 + %.4138 =l copy %.4137 + storel %.4138, %.4134 + %.4139 =l add %.3855, 472 + %.4140 =l copy $g_265 + %.4141 =l mul 48, 1 + %.4142 =l add %.4140, %.4141 + %.4143 =l copy %.4142 + storel %.4143, %.4139 + %.4144 =l add %.3855, 480 + %.4145 =l copy $g_265 + %.4146 =l mul 48, 1 + %.4147 =l add %.4145, %.4146 + %.4148 =l copy %.4147 + storel %.4148, %.4144 + %.4149 =l add %.3855, 488 + %.4150 =l copy %.10 + %.4151 =l mul 16, 1 + %.4152 =l add %.4150, %.4151 + %.4153 =l copy %.4152 + storel %.4153, %.4149 + %.4154 =l add %.3855, 496 + %.4155 =l copy $g_265 + %.4156 =l mul 48, 1 + %.4157 =l add %.4155, %.4156 + %.4158 =l copy %.4157 + storel %.4158, %.4154 + %.4159 =l add %.3855, 504 + %.4160 =l copy $g_265 + %.4161 =l mul 48, 1 + %.4162 =l add %.4160, %.4161 + %.4163 =l copy %.4162 + storel %.4163, %.4159 + %.4164 =l add %.3855, 512 + %.4165 =l copy %.10 + %.4166 =l mul 16, 1 + %.4167 =l add %.4165, %.4166 + %.4168 =l copy %.4167 + storel %.4168, %.4164 + %.4169 =l add %.3855, 520 + %.4170 =l copy $g_265 + %.4171 =l mul 48, 1 + %.4172 =l add %.4170, %.4171 + %.4173 =l copy %.4172 + storel %.4173, %.4169 + %.4174 =l add %.3855, 528 + %.4175 =l copy $g_265 + %.4176 =l mul 48, 1 + %.4177 =l add %.4175, %.4176 + %.4178 =l copy %.4177 + storel %.4178, %.4174 + %.4179 =l add %.3855, 536 + %.4180 =l copy %.10 + %.4181 =l mul 16, 1 + %.4182 =l add %.4180, %.4181 + %.4183 =l copy %.4182 + storel %.4183, %.4179 + %.4184 =l add %.3855, 544 + %.4185 =l copy $g_265 + %.4186 =l mul 48, 1 + %.4187 =l add %.4185, %.4186 + %.4188 =l copy %.4187 + storel %.4188, %.4184 + %.4189 =l add %.3855, 552 + %.4190 =l copy $g_265 + %.4191 =l mul 48, 1 + %.4192 =l add %.4190, %.4191 + %.4193 =l copy %.4192 + storel %.4193, %.4189 + %.4194 =l add %.3855, 560 + %.4195 =l copy %.10 + %.4196 =l mul 16, 1 + %.4197 =l add %.4195, %.4196 + %.4198 =l copy %.4197 + storel %.4198, %.4194 + %.4199 =l add %.3855, 568 + %.4200 =l copy $g_265 + %.4201 =l mul 48, 1 + %.4202 =l add %.4200, %.4201 + %.4203 =l copy %.4202 + storel %.4203, %.4199 + %.4205 =l add %.4204, 0 + %.4206 =w copy 360956765 + storew %.4206, %.4205 + %.4208 =l add %.4207, 0 + %.4209 =w copy 2328868295 + storew %.4209, %.4208 + %.4211 =l add %.4210, 0 + storel $g_88, %.4211 + %.4215 =w copy 0 + storew %.4215, $g_1018 +@for_cond.1211 + %.4216 =w loaduw $g_1018 + %.4217 =w copy 9 + %.4218 =w culew %.4216, %.4217 + jnz %.4218, @for_body.1212, @for_join.1214 +@for_body.1212 + storew 0, %.4220 +@for_cond.1215 + %.4221 =w loadsw %.4220 + %.4222 =w csltw %.4221, 5 + jnz %.4222, @for_body.1216, @for_join.1218 +@for_body.1216 + %.4223 =l copy $g_185 + %.4224 =l mul 44, 1 + %.4225 =l add %.4223, %.4224 + %.4226 =l copy %.4225 + %.4227 =w loadsw %.4220 + %.4228 =l extsw %.4227 + %.4229 =l mul %.4228, 8 + %.4230 =l add %.4219, %.4229 + storel %.4226, %.4230 +@for_cont.1217 + %.4231 =w loadsw %.4220 + %.4232 =w add %.4231, 1 + storew %.4232, %.4220 + jmp @for_cond.1215 +@for_join.1218 + %.4233 =w loaduw %.3829 + %.4234 =w sub %.4233, 1 + storew %.4234, %.3829 + %.4235 =l extsw 0 + %.4236 =l copy %.4235 + storel %.4236, $g_1123 +@for_cont.1213 + %.4237 =w loaduw $g_1018 + %.4238 =w add %.4237, 1 + storew %.4238, $g_1018 + jmp @for_cond.1211 +@for_join.1214 + %.4239 =w loadsw %.2 + %.4240 =l extsw %.4239 + %.4241 =w ceql %.4240, 7 + %.4242 =l loadl %.4 + storew %.4241, %.4242 + %.4243 =w loaduw %.4207 + %.4244 =w add %.4243, 1 + storew %.4244, %.4207 + %.4245 =l extsw 1 + %.4246 =l mul %.4245, 8 + %.4247 =l add $g_172, %.4246 + %.4248 =l loadl %.4210 + storel %.4247, %.4248 +@for_cont.1209 + %.4249 =l copy $g_518 + %.4250 =l mul 0, 1 + %.4251 =l add %.4249, %.4250 + %.4252 =l copy %.4251 + %.4253 =w loadub %.4252 + %.4254 =w copy 3 + %.4255 =w call $safe_add_func_uint8_t_u_u(w %.4253, w %.4254) + %.4256 =l copy $g_518 + %.4257 =l mul 0, 1 + %.4258 =l add %.4256, %.4257 + %.4259 =l copy %.4258 + storeb %.4255, %.4259 + jmp @for_cond.1207 +@for_join.1210 + %.4260 =l copy %.89 + %.4261 =l mul 4, 1 + %.4262 =l add %.4260, %.4261 + %.4263 =l copy %.4262 + %.4264 =w loaduw %.4263 + %.4265 =w copy %.4264 + %.4266 =w loadsw %.101 + %.4267 =w call $safe_sub_func_int32_t_s_s(w %.4265, w %.4266) + %.4268 =w cnel 1, 0 + jnz %.4268, @logic_join.1220, @logic_right.1219 +@logic_right.1219 + %.4269 =w loadsw %.123 + %.4270 =w cnew %.4269, 0 +@logic_join.1220 + %.4271 =w phi @for_join.1210 %.4268, @logic_right.1219 %.4270 + %.4272 =l loadl $g_88 + %.4273 =l loadl %.4272 + %.4274 =l extsw 0 + %.4275 =w cnel %.4273, %.4274 + %.4276 =w loadsw %.2 + %.4277 =l copy %.10 + %.4278 =l mul 8, 1 + %.4279 =l add %.4277, %.4278 + %.4280 =l copy %.4279 + %.4281 =l loadl %.4280 + %.4282 =w copy %.4281 + %.4283 =l copy %.133 + %.4284 =l mul 0, 1 + %.4285 =l add %.4283, %.4284 + %.4286 =l copy %.4285 + storew %.4282, %.4286 + %.4287 =w copy %.4282 + %.4288 =l loadl %.155 + storeh %.4287, %.4288 + %.4289 =w copy 41250 + %.4290 =w call $safe_mul_func_int16_t_s_s(w %.4287, w %.4289) + %.4291 =w copy %.4290 + %.4292 =w loadsh %.161 + %.4293 =w copy %.4292 + %.4294 =w call $safe_mul_func_uint16_t_u_u(w %.4291, w %.4293) + %.4295 =w extuh %.4294 + %.4296 =w loadsb %.5 + %.4297 =w extsb %.4296 + %.4298 =w csgew %.4295, %.4297 + %.4299 =w copy %.4298 + %.4300 =w loadsh %.161 + %.4301 =w extsh %.4300 + %.4302 =w call $safe_rshift_func_uint8_t_u_u(w %.4299, w %.4301) + %.4303 =w extub %.4302 + %.4304 =w cslew %.4276, %.4303 + %.4305 =w copy %.4304 + %.4306 =l copy %.89 + %.4307 =l mul 0, 1 + %.4308 =l add %.4306, %.4307 + %.4309 =l copy %.4308 + %.4310 =w loadsw %.4309 + %.4311 =w call $safe_lshift_func_uint8_t_u_s(w %.4305, w %.4310) + %.4312 =w extub %.4311 + %.4313 =l extsw 2 + %.4314 =l mul %.4313, 4 + %.4315 =l add %.164, %.4314 + %.4316 =w loaduw %.4315 + %.4317 =w copy %.4316 + %.4318 =w call $safe_sub_func_int16_t_s_s(w %.4312, w %.4317) + %.4319 =w extsh %.4318 + %.4320 =w xor %.4275, %.4319 + %.4321 =w copy %.4320 + %.4322 =l copy %.89 + %.4323 =l mul 12, 1 + %.4324 =l add %.4322, %.4323 + %.4325 =l copy %.4324 + %.4326 =w loadsw %.4325 + %.4327 =w copy %.4326 + %.4328 =w call $safe_add_func_int8_t_s_s(w %.4321, w %.4327) + %.4329 =l extsw 0 + %.4330 =w cnel %.147, %.4329 + %.4331 =w copy %.4330 + %.4332 =w loaduh %.110 + %.4333 =w copy %.4332 + %.4334 =w call $safe_mul_func_int16_t_s_s(w %.4331, w %.4333) + %.4335 =w extsh %.4334 + %.4336 =w csgtw %.4271, %.4335 + %.4337 =w and %.4267, %.4336 + %.4338 =l extsw %.4337 + %.4339 =w loadsw %.2 + %.4340 =l extsw %.4339 + %.4341 =l call $safe_add_func_uint64_t_u_u(l %.4338, l %.4340) + %.4342 =l extsw 0 + %.4343 =l extsw 0 + %.4344 =w cnel %.4342, %.4343 + %.4345 =w copy %.4344 + %.4346 =l extsw 0 + %.4347 =l mul %.4346, 8 + %.4348 =l add %.109, %.4347 + %.4349 =l loadl %.4348 + %.4350 =w copy %.4349 + %.4351 =w call $safe_rshift_func_uint8_t_u_u(w %.4345, w %.4350) + %.4352 =w extub %.4351 + %.4353 =l loadl $g_23 + %.4354 =w loadsw %.4353 + %.4355 =w or %.4352, %.4354 + %.4356 =l extsw %.4355 + %.4357 =w ceql %.4356, 233 + %.4358 =l loadl %.4 + %.4359 =w loadsw %.4358 + %.4360 =l extsw %.4359 + %.4361 =w cnel %.4360, 877431633 + %.4362 =l loadl $g_173 + %.4363 =w loadsw %.4362 + %.4364 =w ceqw %.4361, %.4363 + %.4365 =w loadsw %.2 + %.4366 =w copy %.4365 + %.4367 =w loadsw %.101 + %.4368 =w copy %.4367 + %.4369 =w call $safe_mod_func_uint16_t_u_u(w %.4366, w %.4368) + %.4370 =w extuh %.4369 + %.4371 =l loadl $g_38 + %.4372 =l loadl %.4371 + storew %.4370, %.4372 + %.4373 =w sub 0, 6 + %.4374 =w copy %.4373 + storeb %.4374, $g_566 +@for_cond.1221 + %.4375 =w loadub $g_566 + %.4376 =w extub %.4375 + %.4377 =w csgew %.4376, 48 + jnz %.4377, @for_body.1222, @for_join.1224 +@for_body.1222 + %.4379 =l add %.4378, 0 + %.4380 =l copy $g_185 + %.4381 =l mul 44, 1 + %.4382 =l add %.4380, %.4381 + %.4383 =l copy %.4382 + storel %.4383, %.4379 + %.4385 =l add %.4384, 0 + storel %.123, %.4385 + %.4388 =l add %.4387, 0 + %.4389 =w copy 460368954 + storew %.4389, %.4388 + %.4391 =l add %.4390, 0 + %.4392 =w copy 9 + storew %.4392, %.4391 + %.4394 =l add %.4393, 0 + %.4395 =w copy 35248 + storeh %.4395, %.4394 + storew 0, %.4396 +@for_cond.1225 + %.4398 =w loadsw %.4396 + %.4399 =w csltw %.4398, 1 + jnz %.4399, @for_body.1226, @for_join.1228 +@for_body.1226 + storew 0, %.4397 +@for_cond.1229 + %.4400 =w loadsw %.4397 + %.4401 =w csltw %.4400, 1 + jnz %.4401, @for_body.1230, @for_join.1232 +@for_body.1230 + %.4402 =l copy %.10 + %.4403 =l mul 16, 1 + %.4404 =l add %.4402, %.4403 + %.4405 =l copy %.4404 + %.4406 =w loadsw %.4396 + %.4407 =l extsw %.4406 + %.4408 =l mul %.4407, 8 + %.4409 =l add %.4386, %.4408 + %.4410 =w loadsw %.4397 + %.4411 =l extsw %.4410 + %.4412 =l mul %.4411, 8 + %.4413 =l add %.4409, %.4412 + storel %.4405, %.4413 +@for_cont.1231 + %.4414 =w loadsw %.4397 + %.4415 =w add %.4414, 1 + storew %.4415, %.4397 + jmp @for_cond.1229 +@for_join.1232 +@for_cont.1227 + %.4416 =w loadsw %.4396 + %.4417 =w add %.4416, 1 + storew %.4417, %.4396 + jmp @for_cond.1225 +@for_join.1228 + %.4418 =l copy %.10 + %.4419 =l mul 36, 1 + %.4420 =l add %.4418, %.4419 + %.4421 =l copy %.4420 + %.4422 =w loaduw %.4421 + %.4423 =w cnew %.4422, 0 + jnz %.4423, @if_true.1233, @if_false.1234 +@if_true.1233 + jmp @lbl_1172.1206 +@if_false.1234 + %.4424 =w loaduh %.4393 + %.4425 =w sub %.4424, 1 + storeh %.4425, %.4393 +@for_cont.1223 + %.4426 =w loadub $g_566 + %.4427 =w add %.4426, 1 + storeb %.4427, $g_566 + jmp @for_cond.1221 +@for_join.1224 + %.4428 =w loadsw %.126 + %.4429 =w copy %.4428 + ret %.4429 +} +function l $func_33(l %.1, w %.3, w %.5) { +@start.1235 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 4 + storew %.3, %.4 + %.6 =l alloc4 1 + storeb %.5, %.6 + %.7 =l alloc8 1920 + %.248 =l alloc8 8 + %.250 =l alloc4 2880 + %.2005 =l alloc8 8 + %.2010 =l alloc4 4 + %.2013 =l alloc8 72 + %.2023 =l alloc4 1 + %.2026 =l alloc8 8 + %.2030 =l alloc4 4 + %.2033 =l alloc4 4 + %.2036 =l alloc8 8 + %.2042 =l alloc4 1 + %.2045 =l alloc8 8 + %.2047 =l alloc4 4 + %.2048 =l alloc4 4 + %.2049 =l alloc4 4 + %.2122 =l alloc4 4 + %.2125 =l alloc4 4 + %.2128 =l alloc8 8 + %.2130 =l alloc8 8 + %.2132 =l alloc8 8 + %.2143 =l alloc8 8 + %.2145 =l alloc8 16 + %.2146 =l alloc4 4 + %.2149 =l alloc4 4 + %.2152 =l alloc4 4 + %.2153 =l alloc8 720 + %.2829 =l alloc4 1 + %.2832 =l alloc4 1 + %.2835 =l alloc4 4 + %.2840 =l alloc4 4 + %.2841 =l alloc4 4 + %.2842 =l alloc4 4 + %.2872 =l alloc4 1 + %.2875 =l alloc8 8 + %.2886 =l alloc4 4 + %.2891 =l alloc8 8 + %.2893 =l alloc8 8 + %.2895 =l alloc8 8 + %.2897 =l alloc8 216 + %.2935 =l alloc4 240 + %.3464 =l alloc8 8 + %.3468 =l alloc8 8 + %.3470 =l alloc4 4 + %.3471 =l alloc4 4 + %.3472 =l alloc4 4 + %.3496 =l alloc8 8 + %.3498 =l alloc4 324 + %.3699 =l alloc8 320 + %.3840 =l alloc8 8 + %.3844 =l alloc8 8 + %.3848 =l alloc8 8 + %.3850 =l alloc8 64 + %.3859 =l alloc8 8 + %.3861 =l alloc8 8 + %.3865 =l alloc8 8 + %.3869 =l alloc4 4 + %.3872 =l alloc8 8 + %.3878 =l alloc8 8 + %.3880 =l alloc4 1 + %.3883 =l alloc8 8 + %.3885 =l alloc4 4 + %.3888 =l alloc4 4 + %.3889 =l alloc4 4 + %.3890 =l alloc4 4 + %.4031 =l alloc8 48 + %.4038 =l alloc8 8 + %.4041 =l alloc8 8 + %.4043 =l alloc8 8 + %.4054 =l alloc8 48 + %.4069 =l alloc4 4 + %.4070 =l alloc4 4 + %.4113 =l alloc8 8 + %.4115 =l alloc8 8 + %.4117 =l alloc4 4 + %.4120 =l alloc8 8 + %.4126 =l alloc8 8 + %.4273 =l alloc8 8 + %.4305 =l alloc8 8 + %.4404 =l alloc8 8 + %.4406 =l alloc8 8 + %.4410 =l alloc8 8 + %.4412 =l alloc8 8 + %.4427 =l alloc4 4 + %.4432 =l alloc8 16 + %.4433 =l alloc8 8 + %.4436 =l alloc8 8 + %.4439 =l alloc4 4 + %.4532 =l alloc4 4 + %.4535 =l alloc8 48 + %.4548 =l alloc4 360 + %.4763 =l alloc8 8 + %.4774 =l alloc4 4 + %.4775 =l alloc4 4 + %.4776 =l alloc4 4 + %.4953 =l alloc8 8 + %.4955 =l alloc4 4 + %.4958 =l alloc4 360 + %.5147 =l alloc8 8 + %.5149 =l alloc8 8 + %.5153 =l alloc4 4 + %.5154 =l alloc4 4 + %.5444 =l alloc4 4 + %.5449 =l alloc4 2 + %.5452 =l alloc8 8 + %.5610 =l alloc4 2 + %.5613 =l alloc8 8 + %.5617 =l alloc8 8 + %.5621 =l alloc8 56 + %.5629 =l alloc8 8 + %.5631 =l alloc8 80 + %.5732 =l alloc4 4 + %.5735 =l alloc4 20 + %.5749 =l alloc8 160 + %.5890 =l alloc8 8 + %.5892 =l alloc4 4 + %.5895 =l alloc4 4 + %.5896 =l alloc4 4 + %.5982 =l alloc8 8 + %.5993 =l alloc8 8 + %.5995 =l alloc4 12 + %.5996 =l alloc4 1 + %.5999 =l alloc8 72 + %.6126 =l alloc8 8 + %.6132 =l alloc4 4 + %.6188 =l alloc8 8 + %.6191 =l alloc8 8 + %.6197 =l alloc4 4 + %.6210 =l alloc4 4 + %.6299 =l alloc8 8 + %.6301 =l alloc8 8 + %.6303 =l alloc8 8 + %.6307 =l alloc8 8 + %.6309 =l alloc8 8 + %.6317 =l alloc4 84 + %.6368 =l alloc4 4 + %.6369 =l alloc4 4 + %.6433 =l alloc8 8 + %.6436 =l alloc4 4 + %.6439 =l alloc4 16 + %.6448 =l alloc4 4 + %.6519 =l alloc8 8 + %.6552 =l alloc4 4 + %.6679 =l alloc4 1 + %.6682 =l alloc8 8 + %.6683 =l alloc4 4 + %.6744 =l alloc8 8 + %.6750 =l alloc4 8 + %.6751 =l alloc4 4 + %.6754 =l alloc8 8 + %.6760 =l alloc4 4 + %.6779 =l alloc4 14 + %.6780 =l alloc8 56 + %.6805 =l alloc4 2 + %.6806 =l alloc4 4 + %.6807 =l alloc4 4 + %.6847 =l alloc4 2 + %.6850 =l alloc4 4 + %.6853 =l alloc4 4 + %.6993 =l alloc4 4 + %.6994 =l alloc4 4 + %.7110 =l alloc8 64 + %.7127 =l alloc8 8 + %.7142 =l alloc8 8 + %.7144 =l alloc8 8 + %.7147 =l alloc8 32 + %.7152 =l alloc4 4 + %.7155 =l alloc8 1680 + %.7825 =l alloc8 8 + %.7827 =l alloc4 4 + %.7828 =l alloc4 4 + %.7829 =l alloc4 4 + %.7900 =l alloc8 8 + %.7902 =l alloc4 4 + %.7905 =l alloc4 1 + %.7929 =l alloc8 48 + %.7958 =l alloc4 4 + %.7961 =l alloc4 4 + %.8018 =l alloc8 8 + %.8020 =l alloc8 256 + %.8065 =l alloc4 4 + %.8068 =l alloc4 4 + %.8069 =l alloc4 4 + %.8070 =l alloc4 4 + %.8075 =l alloc4 4 + %.8076 =l alloc4 4 + %.8077 =l alloc4 4 + %.8187 =l alloc8 8 + %.8189 =l alloc4 4 + %.8190 =l alloc4 4 + %.8191 =l alloc4 4 + %.8247 =l alloc4 20 +@body.1236 + %.8 =l add %.7, 0 + storel $g_24, %.8 + %.9 =l add %.7, 8 + storel $g_24, %.9 + %.10 =l add %.7, 16 + storel $g_24, %.10 + %.11 =l add %.7, 24 + storel $g_24, %.11 + %.12 =l add %.7, 32 + storel $g_24, %.12 + %.13 =l add %.7, 40 + storel $g_24, %.13 + %.14 =l add %.7, 48 + storel $g_24, %.14 + %.15 =l add %.7, 56 + storel $g_24, %.15 + %.16 =l add %.7, 64 + storel $g_24, %.16 + %.17 =l add %.7, 72 + storel $g_24, %.17 + %.18 =l add %.7, 80 + storel $g_24, %.18 + %.19 =l add %.7, 88 + storel $g_24, %.19 + %.20 =l add %.7, 96 + storel $g_24, %.20 + %.21 =l add %.7, 104 + storel $g_24, %.21 + %.22 =l add %.7, 112 + storel $g_24, %.22 + %.23 =l add %.7, 120 + storel $g_24, %.23 + %.24 =l add %.7, 128 + storel $g_24, %.24 + %.25 =l add %.7, 136 + storel $g_24, %.25 + %.26 =l add %.7, 144 + storel $g_24, %.26 + %.27 =l add %.7, 152 + storel $g_24, %.27 + %.28 =l add %.7, 160 + storel $g_24, %.28 + %.29 =l add %.7, 168 + storel $g_24, %.29 + %.30 =l add %.7, 176 + storel $g_24, %.30 + %.31 =l add %.7, 184 + storel $g_24, %.31 + %.32 =l add %.7, 192 + storel $g_24, %.32 + %.33 =l add %.7, 200 + storel $g_24, %.33 + %.34 =l add %.7, 208 + storel $g_24, %.34 + %.35 =l add %.7, 216 + storel $g_24, %.35 + %.36 =l add %.7, 224 + storel $g_24, %.36 + %.37 =l add %.7, 232 + storel $g_24, %.37 + %.38 =l add %.7, 240 + storel $g_24, %.38 + %.39 =l add %.7, 248 + storel $g_24, %.39 + %.40 =l add %.7, 256 + storel $g_24, %.40 + %.41 =l add %.7, 264 + storel $g_24, %.41 + %.42 =l add %.7, 272 + storel $g_24, %.42 + %.43 =l add %.7, 280 + storel $g_24, %.43 + %.44 =l add %.7, 288 + storel $g_24, %.44 + %.45 =l add %.7, 296 + storel $g_24, %.45 + %.46 =l add %.7, 304 + storel $g_24, %.46 + %.47 =l add %.7, 312 + storel $g_24, %.47 + %.48 =l add %.7, 320 + storel $g_24, %.48 + %.49 =l add %.7, 328 + storel $g_24, %.49 + %.50 =l add %.7, 336 + storel $g_24, %.50 + %.51 =l add %.7, 344 + storel $g_24, %.51 + %.52 =l add %.7, 352 + storel $g_24, %.52 + %.53 =l add %.7, 360 + storel $g_24, %.53 + %.54 =l add %.7, 368 + storel $g_24, %.54 + %.55 =l add %.7, 376 + storel $g_24, %.55 + %.56 =l add %.7, 384 + storel $g_24, %.56 + %.57 =l add %.7, 392 + storel $g_24, %.57 + %.58 =l add %.7, 400 + storel $g_24, %.58 + %.59 =l add %.7, 408 + storel $g_24, %.59 + %.60 =l add %.7, 416 + storel $g_24, %.60 + %.61 =l add %.7, 424 + storel $g_24, %.61 + %.62 =l add %.7, 432 + storel $g_24, %.62 + %.63 =l add %.7, 440 + storel $g_24, %.63 + %.64 =l add %.7, 448 + storel $g_24, %.64 + %.65 =l add %.7, 456 + storel $g_24, %.65 + %.66 =l add %.7, 464 + storel $g_24, %.66 + %.67 =l add %.7, 472 + storel $g_24, %.67 + %.68 =l add %.7, 480 + storel $g_24, %.68 + %.69 =l add %.7, 488 + storel $g_24, %.69 + %.70 =l add %.7, 496 + storel $g_24, %.70 + %.71 =l add %.7, 504 + storel $g_24, %.71 + %.72 =l add %.7, 512 + storel $g_24, %.72 + %.73 =l add %.7, 520 + storel $g_24, %.73 + %.74 =l add %.7, 528 + storel $g_24, %.74 + %.75 =l add %.7, 536 + storel $g_24, %.75 + %.76 =l add %.7, 544 + storel $g_24, %.76 + %.77 =l add %.7, 552 + storel $g_24, %.77 + %.78 =l add %.7, 560 + storel $g_24, %.78 + %.79 =l add %.7, 568 + storel $g_24, %.79 + %.80 =l add %.7, 576 + storel $g_24, %.80 + %.81 =l add %.7, 584 + storel $g_24, %.81 + %.82 =l add %.7, 592 + storel $g_24, %.82 + %.83 =l add %.7, 600 + storel $g_24, %.83 + %.84 =l add %.7, 608 + storel $g_24, %.84 + %.85 =l add %.7, 616 + storel $g_24, %.85 + %.86 =l add %.7, 624 + storel $g_24, %.86 + %.87 =l add %.7, 632 + storel $g_24, %.87 + %.88 =l add %.7, 640 + storel $g_24, %.88 + %.89 =l add %.7, 648 + storel $g_24, %.89 + %.90 =l add %.7, 656 + storel $g_24, %.90 + %.91 =l add %.7, 664 + storel $g_24, %.91 + %.92 =l add %.7, 672 + storel $g_24, %.92 + %.93 =l add %.7, 680 + storel $g_24, %.93 + %.94 =l add %.7, 688 + storel $g_24, %.94 + %.95 =l add %.7, 696 + storel $g_24, %.95 + %.96 =l add %.7, 704 + storel $g_24, %.96 + %.97 =l add %.7, 712 + storel $g_24, %.97 + %.98 =l add %.7, 720 + storel $g_24, %.98 + %.99 =l add %.7, 728 + storel $g_24, %.99 + %.100 =l add %.7, 736 + storel $g_24, %.100 + %.101 =l add %.7, 744 + storel $g_24, %.101 + %.102 =l add %.7, 752 + storel $g_24, %.102 + %.103 =l add %.7, 760 + storel $g_24, %.103 + %.104 =l add %.7, 768 + storel $g_24, %.104 + %.105 =l add %.7, 776 + storel $g_24, %.105 + %.106 =l add %.7, 784 + storel $g_24, %.106 + %.107 =l add %.7, 792 + storel $g_24, %.107 + %.108 =l add %.7, 800 + storel $g_24, %.108 + %.109 =l add %.7, 808 + storel $g_24, %.109 + %.110 =l add %.7, 816 + storel $g_24, %.110 + %.111 =l add %.7, 824 + storel $g_24, %.111 + %.112 =l add %.7, 832 + storel $g_24, %.112 + %.113 =l add %.7, 840 + storel $g_24, %.113 + %.114 =l add %.7, 848 + storel $g_24, %.114 + %.115 =l add %.7, 856 + storel $g_24, %.115 + %.116 =l add %.7, 864 + storel $g_24, %.116 + %.117 =l add %.7, 872 + storel $g_24, %.117 + %.118 =l add %.7, 880 + storel $g_24, %.118 + %.119 =l add %.7, 888 + storel $g_24, %.119 + %.120 =l add %.7, 896 + storel $g_24, %.120 + %.121 =l add %.7, 904 + storel $g_24, %.121 + %.122 =l add %.7, 912 + storel $g_24, %.122 + %.123 =l add %.7, 920 + storel $g_24, %.123 + %.124 =l add %.7, 928 + storel $g_24, %.124 + %.125 =l add %.7, 936 + storel $g_24, %.125 + %.126 =l add %.7, 944 + storel $g_24, %.126 + %.127 =l add %.7, 952 + storel $g_24, %.127 + %.128 =l add %.7, 960 + storel $g_24, %.128 + %.129 =l add %.7, 968 + storel $g_24, %.129 + %.130 =l add %.7, 976 + storel $g_24, %.130 + %.131 =l add %.7, 984 + storel $g_24, %.131 + %.132 =l add %.7, 992 + storel $g_24, %.132 + %.133 =l add %.7, 1000 + storel $g_24, %.133 + %.134 =l add %.7, 1008 + storel $g_24, %.134 + %.135 =l add %.7, 1016 + storel $g_24, %.135 + %.136 =l add %.7, 1024 + storel $g_24, %.136 + %.137 =l add %.7, 1032 + storel $g_24, %.137 + %.138 =l add %.7, 1040 + storel $g_24, %.138 + %.139 =l add %.7, 1048 + storel $g_24, %.139 + %.140 =l add %.7, 1056 + storel $g_24, %.140 + %.141 =l add %.7, 1064 + storel $g_24, %.141 + %.142 =l add %.7, 1072 + storel $g_24, %.142 + %.143 =l add %.7, 1080 + storel $g_24, %.143 + %.144 =l add %.7, 1088 + storel $g_24, %.144 + %.145 =l add %.7, 1096 + storel $g_24, %.145 + %.146 =l add %.7, 1104 + storel $g_24, %.146 + %.147 =l add %.7, 1112 + storel $g_24, %.147 + %.148 =l add %.7, 1120 + storel $g_24, %.148 + %.149 =l add %.7, 1128 + storel $g_24, %.149 + %.150 =l add %.7, 1136 + storel $g_24, %.150 + %.151 =l add %.7, 1144 + storel $g_24, %.151 + %.152 =l add %.7, 1152 + storel $g_24, %.152 + %.153 =l add %.7, 1160 + storel $g_24, %.153 + %.154 =l add %.7, 1168 + storel $g_24, %.154 + %.155 =l add %.7, 1176 + storel $g_24, %.155 + %.156 =l add %.7, 1184 + storel $g_24, %.156 + %.157 =l add %.7, 1192 + storel $g_24, %.157 + %.158 =l add %.7, 1200 + storel $g_24, %.158 + %.159 =l add %.7, 1208 + storel $g_24, %.159 + %.160 =l add %.7, 1216 + storel $g_24, %.160 + %.161 =l add %.7, 1224 + storel $g_24, %.161 + %.162 =l add %.7, 1232 + storel $g_24, %.162 + %.163 =l add %.7, 1240 + storel $g_24, %.163 + %.164 =l add %.7, 1248 + storel $g_24, %.164 + %.165 =l add %.7, 1256 + storel $g_24, %.165 + %.166 =l add %.7, 1264 + storel $g_24, %.166 + %.167 =l add %.7, 1272 + storel $g_24, %.167 + %.168 =l add %.7, 1280 + storel $g_24, %.168 + %.169 =l add %.7, 1288 + storel $g_24, %.169 + %.170 =l add %.7, 1296 + storel $g_24, %.170 + %.171 =l add %.7, 1304 + storel $g_24, %.171 + %.172 =l add %.7, 1312 + storel $g_24, %.172 + %.173 =l add %.7, 1320 + storel $g_24, %.173 + %.174 =l add %.7, 1328 + storel $g_24, %.174 + %.175 =l add %.7, 1336 + storel $g_24, %.175 + %.176 =l add %.7, 1344 + storel $g_24, %.176 + %.177 =l add %.7, 1352 + storel $g_24, %.177 + %.178 =l add %.7, 1360 + storel $g_24, %.178 + %.179 =l add %.7, 1368 + storel $g_24, %.179 + %.180 =l add %.7, 1376 + storel $g_24, %.180 + %.181 =l add %.7, 1384 + storel $g_24, %.181 + %.182 =l add %.7, 1392 + storel $g_24, %.182 + %.183 =l add %.7, 1400 + storel $g_24, %.183 + %.184 =l add %.7, 1408 + storel $g_24, %.184 + %.185 =l add %.7, 1416 + storel $g_24, %.185 + %.186 =l add %.7, 1424 + storel $g_24, %.186 + %.187 =l add %.7, 1432 + storel $g_24, %.187 + %.188 =l add %.7, 1440 + storel $g_24, %.188 + %.189 =l add %.7, 1448 + storel $g_24, %.189 + %.190 =l add %.7, 1456 + storel $g_24, %.190 + %.191 =l add %.7, 1464 + storel $g_24, %.191 + %.192 =l add %.7, 1472 + storel $g_24, %.192 + %.193 =l add %.7, 1480 + storel $g_24, %.193 + %.194 =l add %.7, 1488 + storel $g_24, %.194 + %.195 =l add %.7, 1496 + storel $g_24, %.195 + %.196 =l add %.7, 1504 + storel $g_24, %.196 + %.197 =l add %.7, 1512 + storel $g_24, %.197 + %.198 =l add %.7, 1520 + storel $g_24, %.198 + %.199 =l add %.7, 1528 + storel $g_24, %.199 + %.200 =l add %.7, 1536 + storel $g_24, %.200 + %.201 =l add %.7, 1544 + storel $g_24, %.201 + %.202 =l add %.7, 1552 + storel $g_24, %.202 + %.203 =l add %.7, 1560 + storel $g_24, %.203 + %.204 =l add %.7, 1568 + storel $g_24, %.204 + %.205 =l add %.7, 1576 + storel $g_24, %.205 + %.206 =l add %.7, 1584 + storel $g_24, %.206 + %.207 =l add %.7, 1592 + storel $g_24, %.207 + %.208 =l add %.7, 1600 + storel $g_24, %.208 + %.209 =l add %.7, 1608 + storel $g_24, %.209 + %.210 =l add %.7, 1616 + storel $g_24, %.210 + %.211 =l add %.7, 1624 + storel $g_24, %.211 + %.212 =l add %.7, 1632 + storel $g_24, %.212 + %.213 =l add %.7, 1640 + storel $g_24, %.213 + %.214 =l add %.7, 1648 + storel $g_24, %.214 + %.215 =l add %.7, 1656 + storel $g_24, %.215 + %.216 =l add %.7, 1664 + storel $g_24, %.216 + %.217 =l add %.7, 1672 + storel $g_24, %.217 + %.218 =l add %.7, 1680 + storel $g_24, %.218 + %.219 =l add %.7, 1688 + storel $g_24, %.219 + %.220 =l add %.7, 1696 + storel $g_24, %.220 + %.221 =l add %.7, 1704 + storel $g_24, %.221 + %.222 =l add %.7, 1712 + storel $g_24, %.222 + %.223 =l add %.7, 1720 + storel $g_24, %.223 + %.224 =l add %.7, 1728 + storel $g_24, %.224 + %.225 =l add %.7, 1736 + storel $g_24, %.225 + %.226 =l add %.7, 1744 + storel $g_24, %.226 + %.227 =l add %.7, 1752 + storel $g_24, %.227 + %.228 =l add %.7, 1760 + storel $g_24, %.228 + %.229 =l add %.7, 1768 + storel $g_24, %.229 + %.230 =l add %.7, 1776 + storel $g_24, %.230 + %.231 =l add %.7, 1784 + storel $g_24, %.231 + %.232 =l add %.7, 1792 + storel $g_24, %.232 + %.233 =l add %.7, 1800 + storel $g_24, %.233 + %.234 =l add %.7, 1808 + storel $g_24, %.234 + %.235 =l add %.7, 1816 + storel $g_24, %.235 + %.236 =l add %.7, 1824 + storel $g_24, %.236 + %.237 =l add %.7, 1832 + storel $g_24, %.237 + %.238 =l add %.7, 1840 + storel $g_24, %.238 + %.239 =l add %.7, 1848 + storel $g_24, %.239 + %.240 =l add %.7, 1856 + storel $g_24, %.240 + %.241 =l add %.7, 1864 + storel $g_24, %.241 + %.242 =l add %.7, 1872 + storel $g_24, %.242 + %.243 =l add %.7, 1880 + storel $g_24, %.243 + %.244 =l add %.7, 1888 + storel $g_24, %.244 + %.245 =l add %.7, 1896 + storel $g_24, %.245 + %.246 =l add %.7, 1904 + storel $g_24, %.246 + %.247 =l add %.7, 1912 + storel $g_24, %.247 + %.249 =l add %.248, 0 + storel $g_46, %.249 + %.251 =l add %.250, 0 + %.252 =w copy 1083426737 + storew %.252, %.251 + %.253 =l add %.250, 4 + %.254 =w copy 0 + storew %.254, %.253 + %.255 =l add %.250, 8 + %.256 =l extsw 0 + %.257 =l sub %.256, 1 + %.258 =w copy %.257 + storeh %.258, %.255 + %.259 =l add %.250, 10 + storeh 0, %.259 + %.260 =l add %.250, 12 + %.261 =l extsw 0 + %.262 =l sub %.261, 1 + %.263 =w copy %.262 + storew %.263, %.260 + %.264 =l add %.250, 16 + %.265 =w copy 4055616320 + storew %.265, %.264 + %.266 =l add %.250, 20 + %.267 =l extsw 0 + %.268 =l sub %.267, 1 + %.269 =w copy %.268 + storew %.269, %.266 + %.270 =l add %.250, 24 + %.271 =w copy 2 + storew %.271, %.270 + %.272 =l add %.250, 28 + %.273 =w copy 1 + storeh %.273, %.272 + %.274 =l add %.250, 30 + storeh 0, %.274 + %.275 =l add %.250, 32 + %.276 =w copy 2194741943 + storew %.276, %.275 + %.277 =l add %.250, 36 + %.278 =w copy 18446744073709551608 + storew %.278, %.277 + %.279 =l add %.250, 40 + %.280 =w copy 1 + storew %.280, %.279 + %.281 =l add %.250, 44 + %.282 =w copy 0 + storew %.282, %.281 + %.283 =l add %.250, 48 + %.284 =w copy 1167 + storeh %.284, %.283 + %.285 =l add %.250, 50 + storeh 0, %.285 + %.286 =l add %.250, 52 + %.287 =w copy 1072189932 + storew %.287, %.286 + %.288 =l add %.250, 56 + %.289 =w copy 18446744073709551609 + storew %.289, %.288 + %.290 =l add %.250, 60 + %.291 =w copy 669812072 + storew %.291, %.290 + %.292 =l add %.250, 64 + %.293 =w copy 891221781 + storew %.293, %.292 + %.294 =l add %.250, 68 + %.295 =w copy 37985 + storeh %.295, %.294 + %.296 =l add %.250, 70 + storeh 0, %.296 + %.297 =l add %.250, 72 + %.298 =w copy 8 + storew %.298, %.297 + %.299 =l add %.250, 76 + %.300 =w copy 2421504469 + storew %.300, %.299 + %.301 =l add %.250, 80 + %.302 =w copy 669812072 + storew %.302, %.301 + %.303 =l add %.250, 84 + %.304 =w copy 891221781 + storew %.304, %.303 + %.305 =l add %.250, 88 + %.306 =w copy 37985 + storeh %.306, %.305 + %.307 =l add %.250, 90 + storeh 0, %.307 + %.308 =l add %.250, 92 + %.309 =w copy 8 + storew %.309, %.308 + %.310 =l add %.250, 96 + %.311 =w copy 2421504469 + storew %.311, %.310 + %.312 =l add %.250, 100 + %.313 =w copy 1 + storew %.313, %.312 + %.314 =l add %.250, 104 + %.315 =w copy 0 + storew %.315, %.314 + %.316 =l add %.250, 108 + %.317 =w copy 1167 + storeh %.317, %.316 + %.318 =l add %.250, 110 + storeh 0, %.318 + %.319 =l add %.250, 112 + %.320 =w copy 1072189932 + storew %.320, %.319 + %.321 =l add %.250, 116 + %.322 =w copy 18446744073709551609 + storew %.322, %.321 + %.323 =l add %.250, 120 + %.324 =w copy 1691421598 + storew %.324, %.323 + %.325 =l add %.250, 124 + %.326 =w copy 2686270919 + storew %.326, %.325 + %.327 =l add %.250, 128 + %.328 =l extsw 0 + %.329 =l sub %.328, 6 + %.330 =w copy %.329 + storeh %.330, %.327 + %.331 =l add %.250, 130 + storeh 0, %.331 + %.332 =l add %.250, 132 + %.333 =w copy 3658217481 + storew %.333, %.332 + %.334 =l add %.250, 136 + %.335 =w copy 1 + storew %.335, %.334 + %.336 =l add %.250, 140 + %.337 =w copy 1691421598 + storew %.337, %.336 + %.338 =l add %.250, 144 + %.339 =w copy 2686270919 + storew %.339, %.338 + %.340 =l add %.250, 148 + %.341 =l extsw 0 + %.342 =l sub %.341, 6 + %.343 =w copy %.342 + storeh %.343, %.340 + %.344 =l add %.250, 150 + storeh 0, %.344 + %.345 =l add %.250, 152 + %.346 =w copy 3658217481 + storew %.346, %.345 + %.347 =l add %.250, 156 + %.348 =w copy 1 + storew %.348, %.347 + %.349 =l add %.250, 160 + %.350 =w copy 0 + storew %.350, %.349 + %.351 =l add %.250, 164 + %.352 =w copy 3828594409 + storew %.352, %.351 + %.353 =l add %.250, 168 + %.354 =w copy 23810 + storeh %.354, %.353 + %.355 =l add %.250, 170 + storeh 0, %.355 + %.356 =l add %.250, 172 + %.357 =w copy 2063202579 + storew %.357, %.356 + %.358 =l add %.250, 176 + %.359 =w copy 1748107750 + storew %.359, %.358 + %.360 =l add %.250, 180 + %.361 =l extsw 0 + %.362 =l sub %.361, 1 + %.363 =w copy %.362 + storew %.363, %.360 + %.364 =l add %.250, 184 + %.365 =w copy 70130414 + storew %.365, %.364 + %.366 =l add %.250, 188 + %.367 =w copy 4963 + storeh %.367, %.366 + %.368 =l add %.250, 190 + storeh 0, %.368 + %.369 =l add %.250, 192 + %.370 =l extsw 0 + %.371 =l sub %.370, 1 + %.372 =w copy %.371 + storew %.372, %.369 + %.373 =l add %.250, 196 + %.374 =w copy 1686473211 + storew %.374, %.373 + %.375 =l add %.250, 200 + %.376 =w copy 1 + storew %.376, %.375 + %.377 =l add %.250, 204 + %.378 =w copy 1 + storew %.378, %.377 + %.379 =l add %.250, 208 + %.380 =w copy 21621 + storeh %.380, %.379 + %.381 =l add %.250, 210 + storeh 0, %.381 + %.382 =l add %.250, 212 + %.383 =w copy 855572299 + storew %.383, %.382 + %.384 =l add %.250, 216 + %.385 =w copy 1 + storew %.385, %.384 + %.386 =l add %.250, 220 + %.387 =w copy 1 + storew %.387, %.386 + %.388 =l add %.250, 224 + %.389 =w copy 658990580 + storew %.389, %.388 + %.390 =l add %.250, 228 + %.391 =l extsw 0 + %.392 =l sub %.391, 2 + %.393 =w copy %.392 + storeh %.393, %.390 + %.394 =l add %.250, 230 + storeh 0, %.394 + %.395 =l add %.250, 232 + %.396 =w copy 376143518 + storew %.396, %.395 + %.397 =l add %.250, 236 + %.398 =w copy 2827151306 + storew %.398, %.397 + %.399 =l add %.250, 240 + %.400 =w copy 0 + storew %.400, %.399 + %.401 =l add %.250, 244 + %.402 =w copy 1 + storew %.402, %.401 + %.403 =l add %.250, 248 + %.404 =w copy 25431 + storeh %.404, %.403 + %.405 =l add %.250, 250 + storeh 0, %.405 + %.406 =l add %.250, 252 + %.407 =w copy 3588134414 + storew %.407, %.406 + %.408 =l add %.250, 256 + %.409 =w copy 8 + storew %.409, %.408 + %.410 =l add %.250, 260 + %.411 =w copy 1 + storew %.411, %.410 + %.412 =l add %.250, 264 + %.413 =w copy 1769489573 + storew %.413, %.412 + %.414 =l add %.250, 268 + %.415 =w copy 57523 + storeh %.415, %.414 + %.416 =l add %.250, 270 + storeh 0, %.416 + %.417 =l add %.250, 272 + %.418 =l extsw 0 + %.419 =l sub %.418, 1 + %.420 =w copy %.419 + storew %.420, %.417 + %.421 =l add %.250, 276 + %.422 =w copy 18446744073709551615 + storew %.422, %.421 + %.423 =l add %.250, 280 + %.424 =l extsw 0 + %.425 =l sub %.424, 1 + %.426 =w copy %.425 + storew %.426, %.423 + %.427 =l add %.250, 284 + %.428 =w copy 2953570971 + storew %.428, %.427 + %.429 =l add %.250, 288 + %.430 =w copy 55280 + storeh %.430, %.429 + %.431 =l add %.250, 290 + storeh 0, %.431 + %.432 =l add %.250, 292 + %.433 =w copy 890946016 + storew %.433, %.432 + %.434 =l add %.250, 296 + %.435 =w copy 1 + storew %.435, %.434 + %.436 =l add %.250, 300 + %.437 =l extsw 0 + %.438 =l sub %.437, 1 + %.439 =w copy %.438 + storew %.439, %.436 + %.440 =l add %.250, 304 + %.441 =w copy 18446744073709551615 + storew %.441, %.440 + %.442 =l add %.250, 308 + %.443 =l extsw 0 + %.444 =l sub %.443, 9 + %.445 =w copy %.444 + storeh %.445, %.442 + %.446 =l add %.250, 310 + storeh 0, %.446 + %.447 =l add %.250, 312 + %.448 =w copy 0 + storew %.448, %.447 + %.449 =l add %.250, 316 + %.450 =w copy 1638797083 + storew %.450, %.449 + %.451 =l add %.250, 320 + %.452 =w copy 465264126 + storew %.452, %.451 + %.453 =l add %.250, 324 + %.454 =w copy 1 + storew %.454, %.453 + %.455 =l add %.250, 328 + %.456 =l extsw 0 + %.457 =l sub %.456, 1 + %.458 =w copy %.457 + storeh %.458, %.455 + %.459 =l add %.250, 330 + storeh 0, %.459 + %.460 =l add %.250, 332 + %.461 =w copy 1950417622 + storew %.461, %.460 + %.462 =l add %.250, 336 + %.463 =w copy 976311328 + storew %.463, %.462 + %.464 =l add %.250, 340 + %.465 =w copy 0 + storew %.465, %.464 + %.466 =l add %.250, 344 + %.467 =w copy 3828594409 + storew %.467, %.466 + %.468 =l add %.250, 348 + %.469 =w copy 23810 + storeh %.469, %.468 + %.470 =l add %.250, 350 + storeh 0, %.470 + %.471 =l add %.250, 352 + %.472 =w copy 2063202579 + storew %.472, %.471 + %.473 =l add %.250, 356 + %.474 =w copy 1748107750 + storew %.474, %.473 + %.475 =l add %.250, 360 + %.476 =w copy 146340782 + storew %.476, %.475 + %.477 =l add %.250, 364 + %.478 =w copy 2063185036 + storew %.478, %.477 + %.479 =l add %.250, 368 + %.480 =l extsw 0 + %.481 =l sub %.480, 8 + %.482 =w copy %.481 + storeh %.482, %.479 + %.483 =l add %.250, 370 + storeh 0, %.483 + %.484 =l add %.250, 372 + %.485 =l extsw 0 + %.486 =l sub %.485, 8 + %.487 =w copy %.486 + storew %.487, %.484 + %.488 =l add %.250, 376 + %.489 =w copy 3813695288 + storew %.489, %.488 + %.490 =l add %.250, 380 + %.491 =w copy 0 + storew %.491, %.490 + %.492 =l add %.250, 384 + %.493 =w copy 1 + storew %.493, %.492 + %.494 =l add %.250, 388 + %.495 =w copy 25431 + storeh %.495, %.494 + %.496 =l add %.250, 390 + storeh 0, %.496 + %.497 =l add %.250, 392 + %.498 =w copy 3588134414 + storew %.498, %.497 + %.499 =l add %.250, 396 + %.500 =w copy 8 + storew %.500, %.499 + %.501 =l add %.250, 400 + %.502 =l extsw 0 + %.503 =l sub %.502, 1 + %.504 =w copy %.503 + storew %.504, %.501 + %.505 =l add %.250, 404 + %.506 =w copy 2953570971 + storew %.506, %.505 + %.507 =l add %.250, 408 + %.508 =w copy 55280 + storeh %.508, %.507 + %.509 =l add %.250, 410 + storeh 0, %.509 + %.510 =l add %.250, 412 + %.511 =w copy 890946016 + storew %.511, %.510 + %.512 =l add %.250, 416 + %.513 =w copy 1 + storew %.513, %.512 + %.514 =l add %.250, 420 + %.515 =w copy 1 + storew %.515, %.514 + %.516 =l add %.250, 424 + %.517 =w copy 18446744073709551615 + storew %.517, %.516 + %.518 =l add %.250, 428 + %.519 =w copy 35279 + storeh %.519, %.518 + %.520 =l add %.250, 430 + storeh 0, %.520 + %.521 =l add %.250, 432 + %.522 =l extsw 0 + %.523 =l sub %.522, 5 + %.524 =w copy %.523 + storew %.524, %.521 + %.525 =l add %.250, 436 + %.526 =w copy 1022186559 + storew %.526, %.525 + %.527 =l add %.250, 440 + %.528 =w copy 1691421598 + storew %.528, %.527 + %.529 =l add %.250, 444 + %.530 =w copy 2686270919 + storew %.530, %.529 + %.531 =l add %.250, 448 + %.532 =l extsw 0 + %.533 =l sub %.532, 6 + %.534 =w copy %.533 + storeh %.534, %.531 + %.535 =l add %.250, 450 + storeh 0, %.535 + %.536 =l add %.250, 452 + %.537 =w copy 3658217481 + storew %.537, %.536 + %.538 =l add %.250, 456 + %.539 =w copy 1 + storew %.539, %.538 + %.540 =l add %.250, 460 + %.541 =w copy 1 + storew %.541, %.540 + %.542 =l add %.250, 464 + %.543 =w copy 658990580 + storew %.543, %.542 + %.544 =l add %.250, 468 + %.545 =l extsw 0 + %.546 =l sub %.545, 2 + %.547 =w copy %.546 + storeh %.547, %.544 + %.548 =l add %.250, 470 + storeh 0, %.548 + %.549 =l add %.250, 472 + %.550 =w copy 376143518 + storew %.550, %.549 + %.551 =l add %.250, 476 + %.552 =w copy 2827151306 + storew %.552, %.551 + %.553 =l add %.250, 480 + %.554 =w copy 1 + storew %.554, %.553 + %.555 =l add %.250, 484 + %.556 =w copy 0 + storew %.556, %.555 + %.557 =l add %.250, 488 + %.558 =w copy 1167 + storeh %.558, %.557 + %.559 =l add %.250, 490 + storeh 0, %.559 + %.560 =l add %.250, 492 + %.561 =w copy 1072189932 + storew %.561, %.560 + %.562 =l add %.250, 496 + %.563 =w copy 18446744073709551609 + storew %.563, %.562 + %.564 =l add %.250, 500 + %.565 =w copy 1 + storew %.565, %.564 + %.566 =l add %.250, 504 + %.567 =w copy 18446744073709551615 + storew %.567, %.566 + %.568 =l add %.250, 508 + %.569 =w copy 35279 + storeh %.569, %.568 + %.570 =l add %.250, 510 + storeh 0, %.570 + %.571 =l add %.250, 512 + %.572 =l extsw 0 + %.573 =l sub %.572, 5 + %.574 =w copy %.573 + storew %.574, %.571 + %.575 =l add %.250, 516 + %.576 =w copy 1022186559 + storew %.576, %.575 + %.577 =l add %.250, 520 + %.578 =w copy 0 + storew %.578, %.577 + %.579 =l add %.250, 524 + %.580 =w copy 3828594409 + storew %.580, %.579 + %.581 =l add %.250, 528 + %.582 =w copy 23810 + storeh %.582, %.581 + %.583 =l add %.250, 530 + storeh 0, %.583 + %.584 =l add %.250, 532 + %.585 =w copy 2063202579 + storew %.585, %.584 + %.586 =l add %.250, 536 + %.587 =w copy 1748107750 + storew %.587, %.586 + %.588 =l add %.250, 540 + %.589 =w copy 7 + storew %.589, %.588 + %.590 =l add %.250, 544 + %.591 =w copy 1 + storew %.591, %.590 + %.592 =l add %.250, 548 + %.593 =w copy 56340 + storeh %.593, %.592 + %.594 =l add %.250, 550 + storeh 0, %.594 + %.595 =l add %.250, 552 + %.596 =w copy 3253414294 + storew %.596, %.595 + %.597 =l add %.250, 556 + %.598 =w copy 3590563017 + storew %.598, %.597 + %.599 =l add %.250, 560 + %.600 =l extsw 0 + %.601 =l sub %.600, 8 + %.602 =w copy %.601 + storew %.602, %.599 + %.603 =l add %.250, 564 + %.604 =w copy 239898201 + storew %.604, %.603 + %.605 =l add %.250, 568 + %.606 =w copy 15795 + storeh %.606, %.605 + %.607 =l add %.250, 570 + storeh 0, %.607 + %.608 =l add %.250, 572 + %.609 =w copy 0 + storew %.609, %.608 + %.610 =l add %.250, 576 + %.611 =w copy 1 + storew %.611, %.610 + %.612 =l add %.250, 580 + %.613 =w copy 1 + storew %.613, %.612 + %.614 =l add %.250, 584 + %.615 =w copy 0 + storew %.615, %.614 + %.616 =l add %.250, 588 + %.617 =w copy 1167 + storeh %.617, %.616 + %.618 =l add %.250, 590 + storeh 0, %.618 + %.619 =l add %.250, 592 + %.620 =w copy 1072189932 + storew %.620, %.619 + %.621 =l add %.250, 596 + %.622 =w copy 18446744073709551609 + storew %.622, %.621 + %.623 =l add %.250, 600 + %.624 =w copy 7 + storew %.624, %.623 + %.625 =l add %.250, 604 + %.626 =w copy 1 + storew %.626, %.625 + %.627 =l add %.250, 608 + %.628 =w copy 56340 + storeh %.628, %.627 + %.629 =l add %.250, 610 + storeh 0, %.629 + %.630 =l add %.250, 612 + %.631 =w copy 3253414294 + storew %.631, %.630 + %.632 =l add %.250, 616 + %.633 =w copy 3590563017 + storew %.633, %.632 + %.634 =l add %.250, 620 + %.635 =l extsw 0 + %.636 =l sub %.635, 8 + %.637 =w copy %.636 + storew %.637, %.634 + %.638 =l add %.250, 624 + %.639 =w copy 239898201 + storew %.639, %.638 + %.640 =l add %.250, 628 + %.641 =w copy 15795 + storeh %.641, %.640 + %.642 =l add %.250, 630 + storeh 0, %.642 + %.643 =l add %.250, 632 + %.644 =w copy 0 + storew %.644, %.643 + %.645 =l add %.250, 636 + %.646 =w copy 1 + storew %.646, %.645 + %.647 =l add %.250, 640 + %.648 =w copy 1 + storew %.648, %.647 + %.649 =l add %.250, 644 + %.650 =w copy 0 + storew %.650, %.649 + %.651 =l add %.250, 648 + %.652 =w copy 1167 + storeh %.652, %.651 + %.653 =l add %.250, 650 + storeh 0, %.653 + %.654 =l add %.250, 652 + %.655 =w copy 1072189932 + storew %.655, %.654 + %.656 =l add %.250, 656 + %.657 =w copy 18446744073709551609 + storew %.657, %.656 + %.658 =l add %.250, 660 + %.659 =w copy 804387281 + storew %.659, %.658 + %.660 =l add %.250, 664 + %.661 =w copy 2402775829 + storew %.661, %.660 + %.662 =l add %.250, 668 + %.663 =w copy 1 + storeh %.663, %.662 + %.664 =l add %.250, 670 + storeh 0, %.664 + %.665 =l add %.250, 672 + %.666 =w copy 330816246 + storew %.666, %.665 + %.667 =l add %.250, 676 + %.668 =w copy 3830945193 + storew %.668, %.667 + %.669 =l add %.250, 680 + %.670 =w copy 2436229418 + storew %.670, %.669 + %.671 =l add %.250, 684 + %.672 =w copy 2052428021 + storew %.672, %.671 + %.673 =l add %.250, 688 + %.674 =w copy 39355 + storeh %.674, %.673 + %.675 =l add %.250, 690 + storeh 0, %.675 + %.676 =l add %.250, 692 + %.677 =w copy 410469209 + storew %.677, %.676 + %.678 =l add %.250, 696 + %.679 =w copy 1 + storew %.679, %.678 + %.680 =l add %.250, 700 + %.681 =w copy 2243791941 + storew %.681, %.680 + %.682 =l add %.250, 704 + %.683 =w copy 1 + storew %.683, %.682 + %.684 =l add %.250, 708 + %.685 =w copy 23672 + storeh %.685, %.684 + %.686 =l add %.250, 710 + storeh 0, %.686 + %.687 =l add %.250, 712 + %.688 =w copy 3298880888 + storew %.688, %.687 + %.689 =l add %.250, 716 + %.690 =w copy 6 + storew %.690, %.689 + %.691 =l add %.250, 720 + %.692 =w copy 1963360965 + storew %.692, %.691 + %.693 =l add %.250, 724 + %.694 =w copy 3550624554 + storew %.694, %.693 + %.695 =l add %.250, 728 + %.696 =l extsw 0 + %.697 =l sub %.696, 1 + %.698 =w copy %.697 + storeh %.698, %.695 + %.699 =l add %.250, 730 + storeh 0, %.699 + %.700 =l add %.250, 732 + %.701 =w copy 733588941 + storew %.701, %.700 + %.702 =l add %.250, 736 + %.703 =w copy 1 + storew %.703, %.702 + %.704 =l add %.250, 740 + %.705 =w copy 2356246768 + storew %.705, %.704 + %.706 =l add %.250, 744 + %.707 =w copy 18446744073709551611 + storew %.707, %.706 + %.708 =l add %.250, 748 + %.709 =w copy 40204 + storeh %.709, %.708 + %.710 =l add %.250, 750 + storeh 0, %.710 + %.711 =l add %.250, 752 + %.712 =w copy 3056896668 + storew %.712, %.711 + %.713 =l add %.250, 756 + %.714 =w copy 7 + storew %.714, %.713 + %.715 =l add %.250, 760 + %.716 =w copy 669812072 + storew %.716, %.715 + %.717 =l add %.250, 764 + %.718 =w copy 891221781 + storew %.718, %.717 + %.719 =l add %.250, 768 + %.720 =w copy 37985 + storeh %.720, %.719 + %.721 =l add %.250, 770 + storeh 0, %.721 + %.722 =l add %.250, 772 + %.723 =w copy 8 + storew %.723, %.722 + %.724 =l add %.250, 776 + %.725 =w copy 2421504469 + storew %.725, %.724 + %.726 =l add %.250, 780 + %.727 =w copy 1575629687 + storew %.727, %.726 + %.728 =l add %.250, 784 + %.729 =w copy 18446744073709551615 + storew %.729, %.728 + %.730 =l add %.250, 788 + %.731 =w copy 1 + storeh %.731, %.730 + %.732 =l add %.250, 790 + storeh 0, %.732 + %.733 =l add %.250, 792 + %.734 =w copy 1989414205 + storew %.734, %.733 + %.735 =l add %.250, 796 + %.736 =w copy 124094497 + storew %.736, %.735 + %.737 =l add %.250, 800 + %.738 =w copy 202050518 + storew %.738, %.737 + %.739 =l add %.250, 804 + %.740 =w copy 0 + storew %.740, %.739 + %.741 =l add %.250, 808 + %.742 =w copy 6474 + storeh %.742, %.741 + %.743 =l add %.250, 810 + storeh 0, %.743 + %.744 =l add %.250, 812 + %.745 =l extsw 0 + %.746 =l sub %.745, 1 + %.747 =w copy %.746 + storew %.747, %.744 + %.748 =l add %.250, 816 + %.749 =w copy 0 + storew %.749, %.748 + %.750 =l add %.250, 820 + %.751 =w copy 9 + storew %.751, %.750 + %.752 =l add %.250, 824 + %.753 =w copy 2313779975 + storew %.753, %.752 + %.754 =l add %.250, 828 + %.755 =w copy 26682 + storeh %.755, %.754 + %.756 =l add %.250, 830 + storeh 0, %.756 + %.757 =l add %.250, 832 + %.758 =w copy 0 + storew %.758, %.757 + %.759 =l add %.250, 836 + %.760 =w copy 18446744073709551612 + storew %.760, %.759 + %.761 =l add %.250, 840 + %.762 =w copy 202050518 + storew %.762, %.761 + %.763 =l add %.250, 844 + %.764 =w copy 0 + storew %.764, %.763 + %.765 =l add %.250, 848 + %.766 =w copy 6474 + storeh %.766, %.765 + %.767 =l add %.250, 850 + storeh 0, %.767 + %.768 =l add %.250, 852 + %.769 =l extsw 0 + %.770 =l sub %.769, 1 + %.771 =w copy %.770 + storew %.771, %.768 + %.772 =l add %.250, 856 + %.773 =w copy 0 + storew %.773, %.772 + %.774 =l add %.250, 860 + %.775 =w copy 1 + storew %.775, %.774 + %.776 =l add %.250, 864 + %.777 =w copy 1769489573 + storew %.777, %.776 + %.778 =l add %.250, 868 + %.779 =w copy 57523 + storeh %.779, %.778 + %.780 =l add %.250, 870 + storeh 0, %.780 + %.781 =l add %.250, 872 + %.782 =l extsw 0 + %.783 =l sub %.782, 1 + %.784 =w copy %.783 + storew %.784, %.781 + %.785 =l add %.250, 876 + %.786 =w copy 18446744073709551615 + storew %.786, %.785 + %.787 =l add %.250, 880 + %.788 =w copy 1575629687 + storew %.788, %.787 + %.789 =l add %.250, 884 + %.790 =w copy 18446744073709551615 + storew %.790, %.789 + %.791 =l add %.250, 888 + %.792 =w copy 1 + storeh %.792, %.791 + %.793 =l add %.250, 890 + storeh 0, %.793 + %.794 =l add %.250, 892 + %.795 =w copy 1989414205 + storew %.795, %.794 + %.796 =l add %.250, 896 + %.797 =w copy 124094497 + storew %.797, %.796 + %.798 =l add %.250, 900 + %.799 =w copy 50251224 + storew %.799, %.798 + %.800 =l add %.250, 904 + %.801 =w copy 1 + storew %.801, %.800 + %.802 =l add %.250, 908 + %.803 =w copy 0 + storeh %.803, %.802 + %.804 =l add %.250, 910 + storeh 0, %.804 + %.805 =l add %.250, 912 + %.806 =l extsw 0 + %.807 =l sub %.806, 1 + %.808 =w copy %.807 + storew %.808, %.805 + %.809 =l add %.250, 916 + %.810 =w copy 3083430017 + storew %.810, %.809 + %.811 =l add %.250, 920 + %.812 =l extsw 0 + %.813 =l sub %.812, 1 + %.814 =w copy %.813 + storew %.814, %.811 + %.815 =l add %.250, 924 + %.816 =w copy 2 + storew %.816, %.815 + %.817 =l add %.250, 928 + %.818 =w copy 1 + storeh %.818, %.817 + %.819 =l add %.250, 930 + storeh 0, %.819 + %.820 =l add %.250, 932 + %.821 =w copy 2194741943 + storew %.821, %.820 + %.822 =l add %.250, 936 + %.823 =w copy 18446744073709551608 + storew %.823, %.822 + %.824 =l add %.250, 940 + %.825 =w copy 1 + storew %.825, %.824 + %.826 =l add %.250, 944 + %.827 =w copy 1 + storew %.827, %.826 + %.828 =l add %.250, 948 + %.829 =w copy 21621 + storeh %.829, %.828 + %.830 =l add %.250, 950 + storeh 0, %.830 + %.831 =l add %.250, 952 + %.832 =w copy 855572299 + storew %.832, %.831 + %.833 =l add %.250, 956 + %.834 =w copy 1 + storew %.834, %.833 + %.835 =l add %.250, 960 + %.836 =w copy 321451902 + storew %.836, %.835 + %.837 =l add %.250, 964 + %.838 =w copy 221008639 + storew %.838, %.837 + %.839 =l add %.250, 968 + %.840 =w copy 31068 + storeh %.840, %.839 + %.841 =l add %.250, 970 + storeh 0, %.841 + %.842 =l add %.250, 972 + %.843 =l extsw 0 + %.844 =l sub %.843, 1 + %.845 =w copy %.844 + storew %.845, %.842 + %.846 =l add %.250, 976 + %.847 =w copy 18446744073709551615 + storew %.847, %.846 + %.848 =l add %.250, 980 + %.849 =w copy 2436229418 + storew %.849, %.848 + %.850 =l add %.250, 984 + %.851 =w copy 2052428021 + storew %.851, %.850 + %.852 =l add %.250, 988 + %.853 =w copy 39355 + storeh %.853, %.852 + %.854 =l add %.250, 990 + storeh 0, %.854 + %.855 =l add %.250, 992 + %.856 =w copy 410469209 + storew %.856, %.855 + %.857 =l add %.250, 996 + %.858 =w copy 1 + storew %.858, %.857 + %.859 =l add %.250, 1000 + %.860 =w copy 1 + storew %.860, %.859 + %.861 =l add %.250, 1004 + %.862 =w copy 2536799018 + storew %.862, %.861 + %.863 =l add %.250, 1008 + %.864 =w copy 8956 + storeh %.864, %.863 + %.865 =l add %.250, 1010 + storeh 0, %.865 + %.866 =l add %.250, 1012 + %.867 =w copy 806078605 + storew %.867, %.866 + %.868 =l add %.250, 1016 + %.869 =w copy 2894914844 + storew %.869, %.868 + %.870 =l add %.250, 1020 + %.871 =w copy 0 + storew %.871, %.870 + %.872 =l add %.250, 1024 + %.873 =w copy 3828594409 + storew %.873, %.872 + %.874 =l add %.250, 1028 + %.875 =w copy 23810 + storeh %.875, %.874 + %.876 =l add %.250, 1030 + storeh 0, %.876 + %.877 =l add %.250, 1032 + %.878 =w copy 2063202579 + storew %.878, %.877 + %.879 =l add %.250, 1036 + %.880 =w copy 1748107750 + storew %.880, %.879 + %.881 =l add %.250, 1040 + %.882 =w copy 146340782 + storew %.882, %.881 + %.883 =l add %.250, 1044 + %.884 =w copy 2063185036 + storew %.884, %.883 + %.885 =l add %.250, 1048 + %.886 =l extsw 0 + %.887 =l sub %.886, 8 + %.888 =w copy %.887 + storeh %.888, %.885 + %.889 =l add %.250, 1050 + storeh 0, %.889 + %.890 =l add %.250, 1052 + %.891 =l extsw 0 + %.892 =l sub %.891, 8 + %.893 =w copy %.892 + storew %.893, %.890 + %.894 =l add %.250, 1056 + %.895 =w copy 3813695288 + storew %.895, %.894 + %.896 =l add %.250, 1060 + %.897 =w copy 3448018338 + storew %.897, %.896 + %.898 =l add %.250, 1064 + %.899 =w copy 1 + storew %.899, %.898 + %.900 =l add %.250, 1068 + %.901 =w copy 8346 + storeh %.901, %.900 + %.902 =l add %.250, 1070 + storeh 0, %.902 + %.903 =l add %.250, 1072 + %.904 =w copy 2430042709 + storew %.904, %.903 + %.905 =l add %.250, 1076 + %.906 =w copy 362575220 + storew %.906, %.905 + %.907 =l add %.250, 1080 + %.908 =w copy 1 + storew %.908, %.907 + %.909 =l add %.250, 1084 + %.910 =w copy 0 + storew %.910, %.909 + %.911 =l add %.250, 1088 + %.912 =w copy 1167 + storeh %.912, %.911 + %.913 =l add %.250, 1090 + storeh 0, %.913 + %.914 =l add %.250, 1092 + %.915 =w copy 1072189932 + storew %.915, %.914 + %.916 =l add %.250, 1096 + %.917 =w copy 18446744073709551609 + storew %.917, %.916 + %.918 =l add %.250, 1100 + %.919 =w copy 1 + storew %.919, %.918 + %.920 =l add %.250, 1104 + %.921 =w copy 1 + storew %.921, %.920 + %.922 =l add %.250, 1108 + %.923 =w copy 21621 + storeh %.923, %.922 + %.924 =l add %.250, 1110 + storeh 0, %.924 + %.925 =l add %.250, 1112 + %.926 =w copy 855572299 + storew %.926, %.925 + %.927 =l add %.250, 1116 + %.928 =w copy 1 + storew %.928, %.927 + %.929 =l add %.250, 1120 + %.930 =w copy 0 + storew %.930, %.929 + %.931 =l add %.250, 1124 + %.932 =w copy 1 + storew %.932, %.931 + %.933 =l add %.250, 1128 + %.934 =w copy 25431 + storeh %.934, %.933 + %.935 =l add %.250, 1130 + storeh 0, %.935 + %.936 =l add %.250, 1132 + %.937 =w copy 3588134414 + storew %.937, %.936 + %.938 =l add %.250, 1136 + %.939 =w copy 8 + storew %.939, %.938 + %.940 =l add %.250, 1140 + %.941 =w copy 1 + storew %.941, %.940 + %.942 =l add %.250, 1144 + %.943 =w copy 18446744073709551615 + storew %.943, %.942 + %.944 =l add %.250, 1148 + %.945 =w copy 1 + storeh %.945, %.944 + %.946 =l add %.250, 1150 + storeh 0, %.946 + %.947 =l add %.250, 1152 + %.948 =w copy 4158742492 + storew %.948, %.947 + %.949 =l add %.250, 1156 + %.950 =w copy 18446744073709551615 + storew %.950, %.949 + %.951 =l add %.250, 1160 + %.952 =w copy 0 + storew %.952, %.951 + %.953 =l add %.250, 1164 + %.954 =w copy 18446744073709551612 + storew %.954, %.953 + %.955 =l add %.250, 1168 + %.956 =l extsw 0 + %.957 =l sub %.956, 1 + %.958 =w copy %.957 + storeh %.958, %.955 + %.959 =l add %.250, 1170 + storeh 0, %.959 + %.960 =l add %.250, 1172 + %.961 =w copy 31118189 + storew %.961, %.960 + %.962 =l add %.250, 1176 + %.963 =w copy 2 + storew %.963, %.962 + %.964 =l add %.250, 1180 + %.965 =w copy 1 + storew %.965, %.964 + %.966 =l add %.250, 1184 + %.967 =w copy 18446744073709551615 + storew %.967, %.966 + %.968 =l add %.250, 1188 + %.969 =w copy 1 + storeh %.969, %.968 + %.970 =l add %.250, 1190 + storeh 0, %.970 + %.971 =l add %.250, 1192 + %.972 =w copy 4158742492 + storew %.972, %.971 + %.973 =l add %.250, 1196 + %.974 =w copy 18446744073709551615 + storew %.974, %.973 + %.975 =l add %.250, 1200 + %.976 =w copy 3 + storew %.976, %.975 + %.977 =l add %.250, 1204 + %.978 =w copy 18446744073709551613 + storew %.978, %.977 + %.979 =l add %.250, 1208 + %.980 =l extsw 0 + %.981 =l sub %.980, 1 + %.982 =w copy %.981 + storeh %.982, %.979 + %.983 =l add %.250, 1210 + storeh 0, %.983 + %.984 =l add %.250, 1212 + %.985 =w copy 3074106023 + storew %.985, %.984 + %.986 =l add %.250, 1216 + %.987 =w copy 0 + storew %.987, %.986 + %.988 =l add %.250, 1220 + %.989 =w copy 1103311892 + storew %.989, %.988 + %.990 =l add %.250, 1224 + %.991 =w copy 1 + storew %.991, %.990 + %.992 =l add %.250, 1228 + %.993 =w copy 1 + storeh %.993, %.992 + %.994 =l add %.250, 1230 + storeh 0, %.994 + %.995 =l add %.250, 1232 + %.996 =w copy 704967764 + storew %.996, %.995 + %.997 =l add %.250, 1236 + %.998 =w copy 7 + storew %.998, %.997 + %.999 =l add %.250, 1240 + %.1000 =w copy 3 + storew %.1000, %.999 + %.1001 =l add %.250, 1244 + %.1002 =w copy 18446744073709551613 + storew %.1002, %.1001 + %.1003 =l add %.250, 1248 + %.1004 =l extsw 0 + %.1005 =l sub %.1004, 1 + %.1006 =w copy %.1005 + storeh %.1006, %.1003 + %.1007 =l add %.250, 1250 + storeh 0, %.1007 + %.1008 =l add %.250, 1252 + %.1009 =w copy 3074106023 + storew %.1009, %.1008 + %.1010 =l add %.250, 1256 + %.1011 =w copy 0 + storew %.1011, %.1010 + %.1012 =l add %.250, 1260 + %.1013 =w copy 2844539373 + storew %.1013, %.1012 + %.1014 =l add %.250, 1264 + %.1015 =w copy 3196485425 + storew %.1015, %.1014 + %.1016 =l add %.250, 1268 + %.1017 =l extsw 0 + %.1018 =l sub %.1017, 1 + %.1019 =w copy %.1018 + storeh %.1019, %.1016 + %.1020 =l add %.250, 1270 + storeh 0, %.1020 + %.1021 =l add %.250, 1272 + %.1022 =w copy 0 + storew %.1022, %.1021 + %.1023 =l add %.250, 1276 + %.1024 =w copy 754300143 + storew %.1024, %.1023 + %.1025 =l add %.250, 1280 + %.1026 =w copy 804387281 + storew %.1026, %.1025 + %.1027 =l add %.250, 1284 + %.1028 =w copy 2402775829 + storew %.1028, %.1027 + %.1029 =l add %.250, 1288 + %.1030 =w copy 1 + storeh %.1030, %.1029 + %.1031 =l add %.250, 1290 + storeh 0, %.1031 + %.1032 =l add %.250, 1292 + %.1033 =w copy 330816246 + storew %.1033, %.1032 + %.1034 =l add %.250, 1296 + %.1035 =w copy 3830945193 + storew %.1035, %.1034 + %.1036 =l add %.250, 1300 + %.1037 =w copy 2243791941 + storew %.1037, %.1036 + %.1038 =l add %.250, 1304 + %.1039 =w copy 1 + storew %.1039, %.1038 + %.1040 =l add %.250, 1308 + %.1041 =w copy 23672 + storeh %.1041, %.1040 + %.1042 =l add %.250, 1310 + storeh 0, %.1042 + %.1043 =l add %.250, 1312 + %.1044 =w copy 3298880888 + storew %.1044, %.1043 + %.1045 =l add %.250, 1316 + %.1046 =w copy 6 + storew %.1046, %.1045 + %.1047 =l add %.250, 1320 + %.1048 =w copy 2356246768 + storew %.1048, %.1047 + %.1049 =l add %.250, 1324 + %.1050 =w copy 18446744073709551611 + storew %.1050, %.1049 + %.1051 =l add %.250, 1328 + %.1052 =w copy 40204 + storeh %.1052, %.1051 + %.1053 =l add %.250, 1330 + storeh 0, %.1053 + %.1054 =l add %.250, 1332 + %.1055 =w copy 3056896668 + storew %.1055, %.1054 + %.1056 =l add %.250, 1336 + %.1057 =w copy 7 + storew %.1057, %.1056 + %.1058 =l add %.250, 1340 + %.1059 =w copy 3448018338 + storew %.1059, %.1058 + %.1060 =l add %.250, 1344 + %.1061 =w copy 1 + storew %.1061, %.1060 + %.1062 =l add %.250, 1348 + %.1063 =w copy 8346 + storeh %.1063, %.1062 + %.1064 =l add %.250, 1350 + storeh 0, %.1064 + %.1065 =l add %.250, 1352 + %.1066 =w copy 2430042709 + storew %.1066, %.1065 + %.1067 =l add %.250, 1356 + %.1068 =w copy 362575220 + storew %.1068, %.1067 + %.1069 =l add %.250, 1360 + %.1070 =l extsw 0 + %.1071 =l sub %.1070, 1 + %.1072 =w copy %.1071 + storew %.1072, %.1069 + %.1073 =l add %.250, 1364 + %.1074 =w copy 805176143 + storew %.1074, %.1073 + %.1075 =l add %.250, 1368 + %.1076 =w copy 9977 + storeh %.1076, %.1075 + %.1077 =l add %.250, 1370 + storeh 0, %.1077 + %.1078 =l add %.250, 1372 + %.1079 =w copy 714761159 + storew %.1079, %.1078 + %.1080 =l add %.250, 1376 + %.1081 =w copy 4 + storew %.1081, %.1080 + %.1082 =l add %.250, 1380 + %.1083 =l extsw 0 + %.1084 =l sub %.1083, 1 + %.1085 =w copy %.1084 + storew %.1085, %.1082 + %.1086 =l add %.250, 1384 + %.1087 =w copy 70130414 + storew %.1087, %.1086 + %.1088 =l add %.250, 1388 + %.1089 =w copy 4963 + storeh %.1089, %.1088 + %.1090 =l add %.250, 1390 + storeh 0, %.1090 + %.1091 =l add %.250, 1392 + %.1092 =l extsw 0 + %.1093 =l sub %.1092, 1 + %.1094 =w copy %.1093 + storew %.1094, %.1091 + %.1095 =l add %.250, 1396 + %.1096 =w copy 1686473211 + storew %.1096, %.1095 + %.1097 =l add %.250, 1400 + %.1098 =w copy 669812072 + storew %.1098, %.1097 + %.1099 =l add %.250, 1404 + %.1100 =w copy 891221781 + storew %.1100, %.1099 + %.1101 =l add %.250, 1408 + %.1102 =w copy 37985 + storeh %.1102, %.1101 + %.1103 =l add %.250, 1410 + storeh 0, %.1103 + %.1104 =l add %.250, 1412 + %.1105 =w copy 8 + storew %.1105, %.1104 + %.1106 =l add %.250, 1416 + %.1107 =w copy 2421504469 + storew %.1107, %.1106 + %.1108 =l add %.250, 1420 + %.1109 =w copy 1 + storew %.1109, %.1108 + %.1110 =l add %.250, 1424 + %.1111 =w copy 2842899806 + storew %.1111, %.1110 + %.1112 =l add %.250, 1428 + %.1113 =l extsw 0 + %.1114 =l sub %.1113, 5 + %.1115 =w copy %.1114 + storeh %.1115, %.1112 + %.1116 =l add %.250, 1430 + storeh 0, %.1116 + %.1117 =l add %.250, 1432 + %.1118 =l extsw 0 + %.1119 =l sub %.1118, 7 + %.1120 =w copy %.1119 + storew %.1120, %.1117 + %.1121 =l add %.250, 1436 + %.1122 =w copy 3779923269 + storew %.1122, %.1121 + %.1123 =l add %.250, 1440 + %.1124 =w copy 2436229418 + storew %.1124, %.1123 + %.1125 =l add %.250, 1444 + %.1126 =w copy 2052428021 + storew %.1126, %.1125 + %.1127 =l add %.250, 1448 + %.1128 =w copy 39355 + storeh %.1128, %.1127 + %.1129 =l add %.250, 1450 + storeh 0, %.1129 + %.1130 =l add %.250, 1452 + %.1131 =w copy 410469209 + storew %.1131, %.1130 + %.1132 =l add %.250, 1456 + %.1133 =w copy 1 + storew %.1133, %.1132 + %.1134 =l add %.250, 1460 + %.1135 =w copy 732249490 + storew %.1135, %.1134 + %.1136 =l add %.250, 1464 + %.1137 =w copy 18446744073709551609 + storew %.1137, %.1136 + %.1138 =l add %.250, 1468 + %.1139 =w copy 32232 + storeh %.1139, %.1138 + %.1140 =l add %.250, 1470 + storeh 0, %.1140 + %.1141 =l add %.250, 1472 + %.1142 =w copy 0 + storew %.1142, %.1141 + %.1143 =l add %.250, 1476 + %.1144 =w copy 1338704947 + storew %.1144, %.1143 + %.1145 =l add %.250, 1480 + %.1146 =w copy 1 + storew %.1146, %.1145 + %.1147 =l add %.250, 1484 + %.1148 =w copy 790890217 + storew %.1148, %.1147 + %.1149 =l add %.250, 1488 + %.1150 =w copy 7776 + storeh %.1150, %.1149 + %.1151 =l add %.250, 1490 + storeh 0, %.1151 + %.1152 =l add %.250, 1492 + %.1153 =w copy 1603143842 + storew %.1153, %.1152 + %.1154 =l add %.250, 1496 + %.1155 =w copy 1259960115 + storew %.1155, %.1154 + %.1156 =l add %.250, 1500 + %.1157 =l extsw 0 + %.1158 =l sub %.1157, 1 + %.1159 =w copy %.1158 + storew %.1159, %.1156 + %.1160 =l add %.250, 1504 + %.1161 =w copy 70130414 + storew %.1161, %.1160 + %.1162 =l add %.250, 1508 + %.1163 =w copy 4963 + storeh %.1163, %.1162 + %.1164 =l add %.250, 1510 + storeh 0, %.1164 + %.1165 =l add %.250, 1512 + %.1166 =l extsw 0 + %.1167 =l sub %.1166, 1 + %.1168 =w copy %.1167 + storew %.1168, %.1165 + %.1169 =l add %.250, 1516 + %.1170 =w copy 1686473211 + storew %.1170, %.1169 + %.1171 =l add %.250, 1520 + %.1172 =l extsw 0 + %.1173 =l sub %.1172, 1 + %.1174 =w copy %.1173 + storew %.1174, %.1171 + %.1175 =l add %.250, 1524 + %.1176 =w copy 2 + storew %.1176, %.1175 + %.1177 =l add %.250, 1528 + %.1178 =w copy 1 + storeh %.1178, %.1177 + %.1179 =l add %.250, 1530 + storeh 0, %.1179 + %.1180 =l add %.250, 1532 + %.1181 =w copy 2194741943 + storew %.1181, %.1180 + %.1182 =l add %.250, 1536 + %.1183 =w copy 18446744073709551608 + storew %.1183, %.1182 + %.1184 =l add %.250, 1540 + %.1185 =w copy 2844539373 + storew %.1185, %.1184 + %.1186 =l add %.250, 1544 + %.1187 =w copy 3196485425 + storew %.1187, %.1186 + %.1188 =l add %.250, 1548 + %.1189 =l extsw 0 + %.1190 =l sub %.1189, 1 + %.1191 =w copy %.1190 + storeh %.1191, %.1188 + %.1192 =l add %.250, 1550 + storeh 0, %.1192 + %.1193 =l add %.250, 1552 + %.1194 =w copy 0 + storew %.1194, %.1193 + %.1195 =l add %.250, 1556 + %.1196 =w copy 754300143 + storew %.1196, %.1195 + %.1197 =l add %.250, 1560 + %.1198 =w copy 2356246768 + storew %.1198, %.1197 + %.1199 =l add %.250, 1564 + %.1200 =w copy 18446744073709551611 + storew %.1200, %.1199 + %.1201 =l add %.250, 1568 + %.1202 =w copy 40204 + storeh %.1202, %.1201 + %.1203 =l add %.250, 1570 + storeh 0, %.1203 + %.1204 =l add %.250, 1572 + %.1205 =w copy 3056896668 + storew %.1205, %.1204 + %.1206 =l add %.250, 1576 + %.1207 =w copy 7 + storew %.1207, %.1206 + %.1208 =l add %.250, 1580 + %.1209 =w copy 0 + storew %.1209, %.1208 + %.1210 =l add %.250, 1584 + %.1211 =w copy 3828594409 + storew %.1211, %.1210 + %.1212 =l add %.250, 1588 + %.1213 =w copy 23810 + storeh %.1213, %.1212 + %.1214 =l add %.250, 1590 + storeh 0, %.1214 + %.1215 =l add %.250, 1592 + %.1216 =w copy 2063202579 + storew %.1216, %.1215 + %.1217 =l add %.250, 1596 + %.1218 =w copy 1748107750 + storew %.1218, %.1217 + %.1219 =l add %.250, 1600 + %.1220 =l extsw 0 + %.1221 =l sub %.1220, 1 + %.1222 =w copy %.1221 + storew %.1222, %.1219 + %.1223 =l add %.250, 1604 + %.1224 =w copy 2953570971 + storew %.1224, %.1223 + %.1225 =l add %.250, 1608 + %.1226 =w copy 55280 + storeh %.1226, %.1225 + %.1227 =l add %.250, 1610 + storeh 0, %.1227 + %.1228 =l add %.250, 1612 + %.1229 =w copy 890946016 + storew %.1229, %.1228 + %.1230 =l add %.250, 1616 + %.1231 =w copy 1 + storew %.1231, %.1230 + %.1232 =l add %.250, 1620 + %.1233 =w copy 2844539373 + storew %.1233, %.1232 + %.1234 =l add %.250, 1624 + %.1235 =w copy 3196485425 + storew %.1235, %.1234 + %.1236 =l add %.250, 1628 + %.1237 =l extsw 0 + %.1238 =l sub %.1237, 1 + %.1239 =w copy %.1238 + storeh %.1239, %.1236 + %.1240 =l add %.250, 1630 + storeh 0, %.1240 + %.1241 =l add %.250, 1632 + %.1242 =w copy 0 + storew %.1242, %.1241 + %.1243 =l add %.250, 1636 + %.1244 =w copy 754300143 + storew %.1244, %.1243 + %.1245 =l add %.250, 1640 + %.1246 =w copy 1963360965 + storew %.1246, %.1245 + %.1247 =l add %.250, 1644 + %.1248 =w copy 3550624554 + storew %.1248, %.1247 + %.1249 =l add %.250, 1648 + %.1250 =l extsw 0 + %.1251 =l sub %.1250, 1 + %.1252 =w copy %.1251 + storeh %.1252, %.1249 + %.1253 =l add %.250, 1650 + storeh 0, %.1253 + %.1254 =l add %.250, 1652 + %.1255 =w copy 733588941 + storew %.1255, %.1254 + %.1256 =l add %.250, 1656 + %.1257 =w copy 1 + storew %.1257, %.1256 + %.1258 =l add %.250, 1660 + %.1259 =w copy 321451902 + storew %.1259, %.1258 + %.1260 =l add %.250, 1664 + %.1261 =w copy 221008639 + storew %.1261, %.1260 + %.1262 =l add %.250, 1668 + %.1263 =w copy 31068 + storeh %.1263, %.1262 + %.1264 =l add %.250, 1670 + storeh 0, %.1264 + %.1265 =l add %.250, 1672 + %.1266 =l extsw 0 + %.1267 =l sub %.1266, 1 + %.1268 =w copy %.1267 + storew %.1268, %.1265 + %.1269 =l add %.250, 1676 + %.1270 =w copy 18446744073709551615 + storew %.1270, %.1269 + %.1271 =l add %.250, 1680 + %.1272 =w copy 3 + storew %.1272, %.1271 + %.1273 =l add %.250, 1684 + %.1274 =w copy 18446744073709551613 + storew %.1274, %.1273 + %.1275 =l add %.250, 1688 + %.1276 =l extsw 0 + %.1277 =l sub %.1276, 1 + %.1278 =w copy %.1277 + storeh %.1278, %.1275 + %.1279 =l add %.250, 1690 + storeh 0, %.1279 + %.1280 =l add %.250, 1692 + %.1281 =w copy 3074106023 + storew %.1281, %.1280 + %.1282 =l add %.250, 1696 + %.1283 =w copy 0 + storew %.1283, %.1282 + %.1284 =l add %.250, 1700 + %.1285 =w copy 0 + storew %.1285, %.1284 + %.1286 =l add %.250, 1704 + %.1287 =w copy 1 + storew %.1287, %.1286 + %.1288 =l add %.250, 1708 + %.1289 =w copy 25431 + storeh %.1289, %.1288 + %.1290 =l add %.250, 1710 + storeh 0, %.1290 + %.1291 =l add %.250, 1712 + %.1292 =w copy 3588134414 + storew %.1292, %.1291 + %.1293 =l add %.250, 1716 + %.1294 =w copy 8 + storew %.1294, %.1293 + %.1295 =l add %.250, 1720 + %.1296 =w copy 202050518 + storew %.1296, %.1295 + %.1297 =l add %.250, 1724 + %.1298 =w copy 0 + storew %.1298, %.1297 + %.1299 =l add %.250, 1728 + %.1300 =w copy 6474 + storeh %.1300, %.1299 + %.1301 =l add %.250, 1730 + storeh 0, %.1301 + %.1302 =l add %.250, 1732 + %.1303 =l extsw 0 + %.1304 =l sub %.1303, 1 + %.1305 =w copy %.1304 + storew %.1305, %.1302 + %.1306 =l add %.250, 1736 + %.1307 =w copy 0 + storew %.1307, %.1306 + %.1308 =l add %.250, 1740 + %.1309 =w copy 1 + storew %.1309, %.1308 + %.1310 =l add %.250, 1744 + %.1311 =w copy 18446744073709551615 + storew %.1311, %.1310 + %.1312 =l add %.250, 1748 + %.1313 =w copy 1 + storeh %.1313, %.1312 + %.1314 =l add %.250, 1750 + storeh 0, %.1314 + %.1315 =l add %.250, 1752 + %.1316 =w copy 4158742492 + storew %.1316, %.1315 + %.1317 =l add %.250, 1756 + %.1318 =w copy 18446744073709551615 + storew %.1318, %.1317 + %.1319 =l add %.250, 1760 + %.1320 =w copy 1 + storew %.1320, %.1319 + %.1321 =l add %.250, 1764 + %.1322 =w copy 658990580 + storew %.1322, %.1321 + %.1323 =l add %.250, 1768 + %.1324 =l extsw 0 + %.1325 =l sub %.1324, 2 + %.1326 =w copy %.1325 + storeh %.1326, %.1323 + %.1327 =l add %.250, 1770 + storeh 0, %.1327 + %.1328 =l add %.250, 1772 + %.1329 =w copy 376143518 + storew %.1329, %.1328 + %.1330 =l add %.250, 1776 + %.1331 =w copy 2827151306 + storew %.1331, %.1330 + %.1332 =l add %.250, 1780 + %.1333 =w copy 1575629687 + storew %.1333, %.1332 + %.1334 =l add %.250, 1784 + %.1335 =w copy 18446744073709551615 + storew %.1335, %.1334 + %.1336 =l add %.250, 1788 + %.1337 =w copy 1 + storeh %.1337, %.1336 + %.1338 =l add %.250, 1790 + storeh 0, %.1338 + %.1339 =l add %.250, 1792 + %.1340 =w copy 1989414205 + storew %.1340, %.1339 + %.1341 =l add %.250, 1796 + %.1342 =w copy 124094497 + storew %.1342, %.1341 + %.1343 =l add %.250, 1800 + %.1344 =l extsw 0 + %.1345 =l sub %.1344, 1 + %.1346 =w copy %.1345 + storew %.1346, %.1343 + %.1347 =l add %.250, 1804 + %.1348 =w copy 70130414 + storew %.1348, %.1347 + %.1349 =l add %.250, 1808 + %.1350 =w copy 4963 + storeh %.1350, %.1349 + %.1351 =l add %.250, 1810 + storeh 0, %.1351 + %.1352 =l add %.250, 1812 + %.1353 =l extsw 0 + %.1354 =l sub %.1353, 1 + %.1355 =w copy %.1354 + storew %.1355, %.1352 + %.1356 =l add %.250, 1816 + %.1357 =w copy 1686473211 + storew %.1357, %.1356 + %.1358 =l add %.250, 1820 + %.1359 =w copy 321451902 + storew %.1359, %.1358 + %.1360 =l add %.250, 1824 + %.1361 =w copy 221008639 + storew %.1361, %.1360 + %.1362 =l add %.250, 1828 + %.1363 =w copy 31068 + storeh %.1363, %.1362 + %.1364 =l add %.250, 1830 + storeh 0, %.1364 + %.1365 =l add %.250, 1832 + %.1366 =l extsw 0 + %.1367 =l sub %.1366, 1 + %.1368 =w copy %.1367 + storew %.1368, %.1365 + %.1369 =l add %.250, 1836 + %.1370 =w copy 18446744073709551615 + storew %.1370, %.1369 + %.1371 =l add %.250, 1840 + %.1372 =w copy 1 + storew %.1372, %.1371 + %.1373 =l add %.250, 1844 + %.1374 =w copy 2536799018 + storew %.1374, %.1373 + %.1375 =l add %.250, 1848 + %.1376 =w copy 8956 + storeh %.1376, %.1375 + %.1377 =l add %.250, 1850 + storeh 0, %.1377 + %.1378 =l add %.250, 1852 + %.1379 =w copy 806078605 + storew %.1379, %.1378 + %.1380 =l add %.250, 1856 + %.1381 =w copy 2894914844 + storew %.1381, %.1380 + %.1382 =l add %.250, 1860 + %.1383 =w copy 3 + storew %.1383, %.1382 + %.1384 =l add %.250, 1864 + %.1385 =w copy 0 + storew %.1385, %.1384 + %.1386 =l add %.250, 1868 + %.1387 =w copy 1 + storeh %.1387, %.1386 + %.1388 =l add %.250, 1870 + storeh 0, %.1388 + %.1389 =l add %.250, 1872 + %.1390 =w copy 3107308236 + storew %.1390, %.1389 + %.1391 =l add %.250, 1876 + %.1392 =w copy 1 + storew %.1392, %.1391 + %.1393 =l add %.250, 1880 + %.1394 =w copy 7 + storew %.1394, %.1393 + %.1395 =l add %.250, 1884 + %.1396 =w copy 1 + storew %.1396, %.1395 + %.1397 =l add %.250, 1888 + %.1398 =w copy 56340 + storeh %.1398, %.1397 + %.1399 =l add %.250, 1890 + storeh 0, %.1399 + %.1400 =l add %.250, 1892 + %.1401 =w copy 3253414294 + storew %.1401, %.1400 + %.1402 =l add %.250, 1896 + %.1403 =w copy 3590563017 + storew %.1403, %.1402 + %.1404 =l add %.250, 1900 + %.1405 =l extsw 0 + %.1406 =l sub %.1405, 1 + %.1407 =w copy %.1406 + storew %.1407, %.1404 + %.1408 =l add %.250, 1904 + %.1409 =w copy 70130414 + storew %.1409, %.1408 + %.1410 =l add %.250, 1908 + %.1411 =w copy 4963 + storeh %.1411, %.1410 + %.1412 =l add %.250, 1910 + storeh 0, %.1412 + %.1413 =l add %.250, 1912 + %.1414 =l extsw 0 + %.1415 =l sub %.1414, 1 + %.1416 =w copy %.1415 + storew %.1416, %.1413 + %.1417 =l add %.250, 1916 + %.1418 =w copy 1686473211 + storew %.1418, %.1417 + %.1419 =l add %.250, 1920 + %.1420 =w copy 2436229418 + storew %.1420, %.1419 + %.1421 =l add %.250, 1924 + %.1422 =w copy 2052428021 + storew %.1422, %.1421 + %.1423 =l add %.250, 1928 + %.1424 =w copy 39355 + storeh %.1424, %.1423 + %.1425 =l add %.250, 1930 + storeh 0, %.1425 + %.1426 =l add %.250, 1932 + %.1427 =w copy 410469209 + storew %.1427, %.1426 + %.1428 =l add %.250, 1936 + %.1429 =w copy 1 + storew %.1429, %.1428 + %.1430 =l add %.250, 1940 + %.1431 =w copy 0 + storew %.1431, %.1430 + %.1432 =l add %.250, 1944 + %.1433 =w copy 3828594409 + storew %.1433, %.1432 + %.1434 =l add %.250, 1948 + %.1435 =w copy 23810 + storeh %.1435, %.1434 + %.1436 =l add %.250, 1950 + storeh 0, %.1436 + %.1437 =l add %.250, 1952 + %.1438 =w copy 2063202579 + storew %.1438, %.1437 + %.1439 =l add %.250, 1956 + %.1440 =w copy 1748107750 + storew %.1440, %.1439 + %.1441 =l add %.250, 1960 + %.1442 =w copy 3 + storew %.1442, %.1441 + %.1443 =l add %.250, 1964 + %.1444 =w copy 18446744073709551613 + storew %.1444, %.1443 + %.1445 =l add %.250, 1968 + %.1446 =l extsw 0 + %.1447 =l sub %.1446, 1 + %.1448 =w copy %.1447 + storeh %.1448, %.1445 + %.1449 =l add %.250, 1970 + storeh 0, %.1449 + %.1450 =l add %.250, 1972 + %.1451 =w copy 3074106023 + storew %.1451, %.1450 + %.1452 =l add %.250, 1976 + %.1453 =w copy 0 + storew %.1453, %.1452 + %.1454 =l add %.250, 1980 + %.1455 =l extsw 0 + %.1456 =l sub %.1455, 1 + %.1457 =w copy %.1456 + storew %.1457, %.1454 + %.1458 =l add %.250, 1984 + %.1459 =w copy 2 + storew %.1459, %.1458 + %.1460 =l add %.250, 1988 + %.1461 =w copy 1 + storeh %.1461, %.1460 + %.1462 =l add %.250, 1990 + storeh 0, %.1462 + %.1463 =l add %.250, 1992 + %.1464 =w copy 2194741943 + storew %.1464, %.1463 + %.1465 =l add %.250, 1996 + %.1466 =w copy 18446744073709551608 + storew %.1466, %.1465 + %.1467 =l add %.250, 2000 + %.1468 =w copy 3902700085 + storew %.1468, %.1467 + %.1469 =l add %.250, 2004 + %.1470 =w copy 6 + storew %.1470, %.1469 + %.1471 =l add %.250, 2008 + %.1472 =l extsw 0 + %.1473 =l sub %.1472, 10 + %.1474 =w copy %.1473 + storeh %.1474, %.1471 + %.1475 =l add %.250, 2010 + storeh 0, %.1475 + %.1476 =l add %.250, 2012 + %.1477 =w copy 1449819268 + storew %.1477, %.1476 + %.1478 =l add %.250, 2016 + %.1479 =w copy 18446744073709551615 + storew %.1479, %.1478 + %.1480 =l add %.250, 2020 + %.1481 =l extsw 0 + %.1482 =l sub %.1481, 1 + %.1483 =w copy %.1482 + storew %.1483, %.1480 + %.1484 =l add %.250, 2024 + %.1485 =w copy 805176143 + storew %.1485, %.1484 + %.1486 =l add %.250, 2028 + %.1487 =w copy 9977 + storeh %.1487, %.1486 + %.1488 =l add %.250, 2030 + storeh 0, %.1488 + %.1489 =l add %.250, 2032 + %.1490 =w copy 714761159 + storew %.1490, %.1489 + %.1491 =l add %.250, 2036 + %.1492 =w copy 4 + storew %.1492, %.1491 + %.1493 =l add %.250, 2040 + %.1494 =w copy 1 + storew %.1494, %.1493 + %.1495 =l add %.250, 2044 + %.1496 =w copy 0 + storew %.1496, %.1495 + %.1497 =l add %.250, 2048 + %.1498 =w copy 1167 + storeh %.1498, %.1497 + %.1499 =l add %.250, 2050 + storeh 0, %.1499 + %.1500 =l add %.250, 2052 + %.1501 =w copy 1072189932 + storew %.1501, %.1500 + %.1502 =l add %.250, 2056 + %.1503 =w copy 18446744073709551609 + storew %.1503, %.1502 + %.1504 =l add %.250, 2060 + %.1505 =l extsw 0 + %.1506 =l sub %.1505, 1 + %.1507 =w copy %.1506 + storew %.1507, %.1504 + %.1508 =l add %.250, 2064 + %.1509 =w copy 306860618 + storew %.1509, %.1508 + %.1510 =l add %.250, 2068 + %.1511 =l extsw 0 + %.1512 =l sub %.1511, 2 + %.1513 =w copy %.1512 + storeh %.1513, %.1510 + %.1514 =l add %.250, 2070 + storeh 0, %.1514 + %.1515 =l add %.250, 2072 + %.1516 =w copy 256486627 + storew %.1516, %.1515 + %.1517 =l add %.250, 2076 + %.1518 =w copy 0 + storew %.1518, %.1517 + %.1519 =l add %.250, 2080 + %.1520 =l extsw 0 + %.1521 =l sub %.1520, 8 + %.1522 =w copy %.1521 + storew %.1522, %.1519 + %.1523 =l add %.250, 2084 + %.1524 =w copy 239898201 + storew %.1524, %.1523 + %.1525 =l add %.250, 2088 + %.1526 =w copy 15795 + storeh %.1526, %.1525 + %.1527 =l add %.250, 2090 + storeh 0, %.1527 + %.1528 =l add %.250, 2092 + %.1529 =w copy 0 + storew %.1529, %.1528 + %.1530 =l add %.250, 2096 + %.1531 =w copy 1 + storew %.1531, %.1530 + %.1532 =l add %.250, 2100 + %.1533 =w copy 1103311892 + storew %.1533, %.1532 + %.1534 =l add %.250, 2104 + %.1535 =w copy 1 + storew %.1535, %.1534 + %.1536 =l add %.250, 2108 + %.1537 =w copy 1 + storeh %.1537, %.1536 + %.1538 =l add %.250, 2110 + storeh 0, %.1538 + %.1539 =l add %.250, 2112 + %.1540 =w copy 704967764 + storew %.1540, %.1539 + %.1541 =l add %.250, 2116 + %.1542 =w copy 7 + storew %.1542, %.1541 + %.1543 =l add %.250, 2120 + %.1544 =w copy 1 + storew %.1544, %.1543 + %.1545 =l add %.250, 2124 + %.1546 =w copy 2842899806 + storew %.1546, %.1545 + %.1547 =l add %.250, 2128 + %.1548 =l extsw 0 + %.1549 =l sub %.1548, 5 + %.1550 =w copy %.1549 + storeh %.1550, %.1547 + %.1551 =l add %.250, 2130 + storeh 0, %.1551 + %.1552 =l add %.250, 2132 + %.1553 =l extsw 0 + %.1554 =l sub %.1553, 7 + %.1555 =w copy %.1554 + storew %.1555, %.1552 + %.1556 =l add %.250, 2136 + %.1557 =w copy 3779923269 + storew %.1557, %.1556 + %.1558 =l add %.250, 2140 + %.1559 =w copy 7 + storew %.1559, %.1558 + %.1560 =l add %.250, 2144 + %.1561 =w copy 1 + storew %.1561, %.1560 + %.1562 =l add %.250, 2148 + %.1563 =w copy 56340 + storeh %.1563, %.1562 + %.1564 =l add %.250, 2150 + storeh 0, %.1564 + %.1565 =l add %.250, 2152 + %.1566 =w copy 3253414294 + storew %.1566, %.1565 + %.1567 =l add %.250, 2156 + %.1568 =w copy 3590563017 + storew %.1568, %.1567 + %.1569 =l add %.250, 2160 + %.1570 =l extsw 0 + %.1571 =l sub %.1570, 1 + %.1572 =w copy %.1571 + storew %.1572, %.1569 + %.1573 =l add %.250, 2164 + %.1574 =w copy 805176143 + storew %.1574, %.1573 + %.1575 =l add %.250, 2168 + %.1576 =w copy 9977 + storeh %.1576, %.1575 + %.1577 =l add %.250, 2170 + storeh 0, %.1577 + %.1578 =l add %.250, 2172 + %.1579 =w copy 714761159 + storew %.1579, %.1578 + %.1580 =l add %.250, 2176 + %.1581 =w copy 4 + storew %.1581, %.1580 + %.1582 =l add %.250, 2180 + %.1583 =w copy 3 + storew %.1583, %.1582 + %.1584 =l add %.250, 2184 + %.1585 =w copy 0 + storew %.1585, %.1584 + %.1586 =l add %.250, 2188 + %.1587 =w copy 1 + storeh %.1587, %.1586 + %.1588 =l add %.250, 2190 + storeh 0, %.1588 + %.1589 =l add %.250, 2192 + %.1590 =w copy 3107308236 + storew %.1590, %.1589 + %.1591 =l add %.250, 2196 + %.1592 =w copy 1 + storew %.1592, %.1591 + %.1593 =l add %.250, 2200 + %.1594 =w copy 1103311892 + storew %.1594, %.1593 + %.1595 =l add %.250, 2204 + %.1596 =w copy 1 + storew %.1596, %.1595 + %.1597 =l add %.250, 2208 + %.1598 =w copy 1 + storeh %.1598, %.1597 + %.1599 =l add %.250, 2210 + storeh 0, %.1599 + %.1600 =l add %.250, 2212 + %.1601 =w copy 704967764 + storew %.1601, %.1600 + %.1602 =l add %.250, 2216 + %.1603 =w copy 7 + storew %.1603, %.1602 + %.1604 =l add %.250, 2220 + %.1605 =w copy 3364913714 + storew %.1605, %.1604 + %.1606 =l add %.250, 2224 + %.1607 =w copy 1 + storew %.1607, %.1606 + %.1608 =l add %.250, 2228 + %.1609 =w copy 13821 + storeh %.1609, %.1608 + %.1610 =l add %.250, 2230 + storeh 0, %.1610 + %.1611 =l add %.250, 2232 + %.1612 =w copy 334994584 + storew %.1612, %.1611 + %.1613 =l add %.250, 2236 + %.1614 =w copy 559742891 + storew %.1614, %.1613 + %.1615 =l add %.250, 2240 + %.1616 =w copy 202050518 + storew %.1616, %.1615 + %.1617 =l add %.250, 2244 + %.1618 =w copy 0 + storew %.1618, %.1617 + %.1619 =l add %.250, 2248 + %.1620 =w copy 6474 + storeh %.1620, %.1619 + %.1621 =l add %.250, 2250 + storeh 0, %.1621 + %.1622 =l add %.250, 2252 + %.1623 =l extsw 0 + %.1624 =l sub %.1623, 1 + %.1625 =w copy %.1624 + storew %.1625, %.1622 + %.1626 =l add %.250, 2256 + %.1627 =w copy 0 + storew %.1627, %.1626 + %.1628 =l add %.250, 2260 + %.1629 =w copy 202050518 + storew %.1629, %.1628 + %.1630 =l add %.250, 2264 + %.1631 =w copy 0 + storew %.1631, %.1630 + %.1632 =l add %.250, 2268 + %.1633 =w copy 6474 + storeh %.1633, %.1632 + %.1634 =l add %.250, 2270 + storeh 0, %.1634 + %.1635 =l add %.250, 2272 + %.1636 =l extsw 0 + %.1637 =l sub %.1636, 1 + %.1638 =w copy %.1637 + storew %.1638, %.1635 + %.1639 =l add %.250, 2276 + %.1640 =w copy 0 + storew %.1640, %.1639 + %.1641 =l add %.250, 2280 + %.1642 =w copy 1 + storew %.1642, %.1641 + %.1643 =l add %.250, 2284 + %.1644 =w copy 2536799018 + storew %.1644, %.1643 + %.1645 =l add %.250, 2288 + %.1646 =w copy 8956 + storeh %.1646, %.1645 + %.1647 =l add %.250, 2290 + storeh 0, %.1647 + %.1648 =l add %.250, 2292 + %.1649 =w copy 806078605 + storew %.1649, %.1648 + %.1650 =l add %.250, 2296 + %.1651 =w copy 2894914844 + storew %.1651, %.1650 + %.1652 =l add %.250, 2300 + %.1653 =w copy 3902700085 + storew %.1653, %.1652 + %.1654 =l add %.250, 2304 + %.1655 =w copy 6 + storew %.1655, %.1654 + %.1656 =l add %.250, 2308 + %.1657 =l extsw 0 + %.1658 =l sub %.1657, 10 + %.1659 =w copy %.1658 + storeh %.1659, %.1656 + %.1660 =l add %.250, 2310 + storeh 0, %.1660 + %.1661 =l add %.250, 2312 + %.1662 =w copy 1449819268 + storew %.1662, %.1661 + %.1663 =l add %.250, 2316 + %.1664 =w copy 18446744073709551615 + storew %.1664, %.1663 + %.1665 =l add %.250, 2320 + %.1666 =w copy 3902700085 + storew %.1666, %.1665 + %.1667 =l add %.250, 2324 + %.1668 =w copy 6 + storew %.1668, %.1667 + %.1669 =l add %.250, 2328 + %.1670 =l extsw 0 + %.1671 =l sub %.1670, 10 + %.1672 =w copy %.1671 + storeh %.1672, %.1669 + %.1673 =l add %.250, 2330 + storeh 0, %.1673 + %.1674 =l add %.250, 2332 + %.1675 =w copy 1449819268 + storew %.1675, %.1674 + %.1676 =l add %.250, 2336 + %.1677 =w copy 18446744073709551615 + storew %.1677, %.1676 + %.1678 =l add %.250, 2340 + %.1679 =w copy 1 + storew %.1679, %.1678 + %.1680 =l add %.250, 2344 + %.1681 =w copy 2536799018 + storew %.1681, %.1680 + %.1682 =l add %.250, 2348 + %.1683 =w copy 8956 + storeh %.1683, %.1682 + %.1684 =l add %.250, 2350 + storeh 0, %.1684 + %.1685 =l add %.250, 2352 + %.1686 =w copy 806078605 + storew %.1686, %.1685 + %.1687 =l add %.250, 2356 + %.1688 =w copy 2894914844 + storew %.1688, %.1687 + %.1689 =l add %.250, 2360 + %.1690 =w copy 9 + storew %.1690, %.1689 + %.1691 =l add %.250, 2364 + %.1692 =w copy 2313779975 + storew %.1692, %.1691 + %.1693 =l add %.250, 2368 + %.1694 =w copy 26682 + storeh %.1694, %.1693 + %.1695 =l add %.250, 2370 + storeh 0, %.1695 + %.1696 =l add %.250, 2372 + %.1697 =w copy 0 + storew %.1697, %.1696 + %.1698 =l add %.250, 2376 + %.1699 =w copy 18446744073709551612 + storew %.1699, %.1698 + %.1700 =l add %.250, 2380 + %.1701 =l extsw 0 + %.1702 =l sub %.1701, 1 + %.1703 =w copy %.1702 + storew %.1703, %.1700 + %.1704 =l add %.250, 2384 + %.1705 =w copy 2953570971 + storew %.1705, %.1704 + %.1706 =l add %.250, 2388 + %.1707 =w copy 55280 + storeh %.1707, %.1706 + %.1708 =l add %.250, 2390 + storeh 0, %.1708 + %.1709 =l add %.250, 2392 + %.1710 =w copy 890946016 + storew %.1710, %.1709 + %.1711 =l add %.250, 2396 + %.1712 =w copy 1 + storew %.1712, %.1711 + %.1713 =l add %.250, 2400 + %.1714 =l extsw 0 + %.1715 =l sub %.1714, 1 + %.1716 =w copy %.1715 + storew %.1716, %.1713 + %.1717 =l add %.250, 2404 + %.1718 =w copy 70130414 + storew %.1718, %.1717 + %.1719 =l add %.250, 2408 + %.1720 =w copy 4963 + storeh %.1720, %.1719 + %.1721 =l add %.250, 2410 + storeh 0, %.1721 + %.1722 =l add %.250, 2412 + %.1723 =l extsw 0 + %.1724 =l sub %.1723, 1 + %.1725 =w copy %.1724 + storew %.1725, %.1722 + %.1726 =l add %.250, 2416 + %.1727 =w copy 1686473211 + storew %.1727, %.1726 + %.1728 =l add %.250, 2420 + %.1729 =w copy 1963360965 + storew %.1729, %.1728 + %.1730 =l add %.250, 2424 + %.1731 =w copy 3550624554 + storew %.1731, %.1730 + %.1732 =l add %.250, 2428 + %.1733 =l extsw 0 + %.1734 =l sub %.1733, 1 + %.1735 =w copy %.1734 + storeh %.1735, %.1732 + %.1736 =l add %.250, 2430 + storeh 0, %.1736 + %.1737 =l add %.250, 2432 + %.1738 =w copy 733588941 + storew %.1738, %.1737 + %.1739 =l add %.250, 2436 + %.1740 =w copy 1 + storew %.1740, %.1739 + %.1741 =l add %.250, 2440 + %.1742 =w copy 0 + storew %.1742, %.1741 + %.1743 =l add %.250, 2444 + %.1744 =w copy 18446744073709551613 + storew %.1744, %.1743 + %.1745 =l add %.250, 2448 + %.1746 =l extsw 0 + %.1747 =l sub %.1746, 7 + %.1748 =w copy %.1747 + storeh %.1748, %.1745 + %.1749 =l add %.250, 2450 + storeh 0, %.1749 + %.1750 =l add %.250, 2452 + %.1751 =w copy 4174508792 + storew %.1751, %.1750 + %.1752 =l add %.250, 2456 + %.1753 =w copy 18446744073709551607 + storew %.1753, %.1752 + %.1754 =l add %.250, 2460 + %.1755 =w copy 7 + storew %.1755, %.1754 + %.1756 =l add %.250, 2464 + %.1757 =w copy 1 + storew %.1757, %.1756 + %.1758 =l add %.250, 2468 + %.1759 =w copy 56340 + storeh %.1759, %.1758 + %.1760 =l add %.250, 2470 + storeh 0, %.1760 + %.1761 =l add %.250, 2472 + %.1762 =w copy 3253414294 + storew %.1762, %.1761 + %.1763 =l add %.250, 2476 + %.1764 =w copy 3590563017 + storew %.1764, %.1763 + %.1765 =l add %.250, 2480 + %.1766 =w copy 3364913714 + storew %.1766, %.1765 + %.1767 =l add %.250, 2484 + %.1768 =w copy 1 + storew %.1768, %.1767 + %.1769 =l add %.250, 2488 + %.1770 =w copy 13821 + storeh %.1770, %.1769 + %.1771 =l add %.250, 2490 + storeh 0, %.1771 + %.1772 =l add %.250, 2492 + %.1773 =w copy 334994584 + storew %.1773, %.1772 + %.1774 =l add %.250, 2496 + %.1775 =w copy 559742891 + storew %.1775, %.1774 + %.1776 =l add %.250, 2500 + %.1777 =w copy 1 + storew %.1777, %.1776 + %.1778 =l add %.250, 2504 + %.1779 =w copy 790890217 + storew %.1779, %.1778 + %.1780 =l add %.250, 2508 + %.1781 =w copy 7776 + storeh %.1781, %.1780 + %.1782 =l add %.250, 2510 + storeh 0, %.1782 + %.1783 =l add %.250, 2512 + %.1784 =w copy 1603143842 + storew %.1784, %.1783 + %.1785 =l add %.250, 2516 + %.1786 =w copy 1259960115 + storew %.1786, %.1785 + %.1787 =l add %.250, 2520 + %.1788 =w copy 1 + storew %.1788, %.1787 + %.1789 =l add %.250, 2524 + %.1790 =w copy 18446744073709551615 + storew %.1790, %.1789 + %.1791 =l add %.250, 2528 + %.1792 =w copy 35279 + storeh %.1792, %.1791 + %.1793 =l add %.250, 2530 + storeh 0, %.1793 + %.1794 =l add %.250, 2532 + %.1795 =l extsw 0 + %.1796 =l sub %.1795, 5 + %.1797 =w copy %.1796 + storew %.1797, %.1794 + %.1798 =l add %.250, 2536 + %.1799 =w copy 1022186559 + storew %.1799, %.1798 + %.1800 =l add %.250, 2540 + %.1801 =w copy 804387281 + storew %.1801, %.1800 + %.1802 =l add %.250, 2544 + %.1803 =w copy 2402775829 + storew %.1803, %.1802 + %.1804 =l add %.250, 2548 + %.1805 =w copy 1 + storeh %.1805, %.1804 + %.1806 =l add %.250, 2550 + storeh 0, %.1806 + %.1807 =l add %.250, 2552 + %.1808 =w copy 330816246 + storew %.1808, %.1807 + %.1809 =l add %.250, 2556 + %.1810 =w copy 3830945193 + storew %.1810, %.1809 + %.1811 =l add %.250, 2560 + %.1812 =w copy 1 + storew %.1812, %.1811 + %.1813 =l add %.250, 2564 + %.1814 =w copy 18446744073709551615 + storew %.1814, %.1813 + %.1815 =l add %.250, 2568 + %.1816 =w copy 1 + storeh %.1816, %.1815 + %.1817 =l add %.250, 2570 + storeh 0, %.1817 + %.1818 =l add %.250, 2572 + %.1819 =w copy 4158742492 + storew %.1819, %.1818 + %.1820 =l add %.250, 2576 + %.1821 =w copy 18446744073709551615 + storew %.1821, %.1820 + %.1822 =l add %.250, 2580 + %.1823 =w copy 0 + storew %.1823, %.1822 + %.1824 =l add %.250, 2584 + %.1825 =w copy 0 + storew %.1825, %.1824 + %.1826 =l add %.250, 2588 + %.1827 =w copy 29620 + storeh %.1827, %.1826 + %.1828 =l add %.250, 2590 + storeh 0, %.1828 + %.1829 =l add %.250, 2592 + %.1830 =w copy 3777737321 + storew %.1830, %.1829 + %.1831 =l add %.250, 2596 + %.1832 =w copy 3251181128 + storew %.1832, %.1831 + %.1833 =l add %.250, 2600 + %.1834 =w copy 3364913714 + storew %.1834, %.1833 + %.1835 =l add %.250, 2604 + %.1836 =w copy 1 + storew %.1836, %.1835 + %.1837 =l add %.250, 2608 + %.1838 =w copy 13821 + storeh %.1838, %.1837 + %.1839 =l add %.250, 2610 + storeh 0, %.1839 + %.1840 =l add %.250, 2612 + %.1841 =w copy 334994584 + storew %.1841, %.1840 + %.1842 =l add %.250, 2616 + %.1843 =w copy 559742891 + storew %.1843, %.1842 + %.1844 =l add %.250, 2620 + %.1845 =l extsw 0 + %.1846 =l sub %.1845, 1 + %.1847 =w copy %.1846 + storew %.1847, %.1844 + %.1848 =l add %.250, 2624 + %.1849 =w copy 805176143 + storew %.1849, %.1848 + %.1850 =l add %.250, 2628 + %.1851 =w copy 9977 + storeh %.1851, %.1850 + %.1852 =l add %.250, 2630 + storeh 0, %.1852 + %.1853 =l add %.250, 2632 + %.1854 =w copy 714761159 + storew %.1854, %.1853 + %.1855 =l add %.250, 2636 + %.1856 =w copy 4 + storew %.1856, %.1855 + %.1857 =l add %.250, 2640 + %.1858 =w copy 738655802 + storew %.1858, %.1857 + %.1859 =l add %.250, 2644 + %.1860 =w copy 0 + storew %.1860, %.1859 + %.1861 =l add %.250, 2648 + %.1862 =w copy 1 + storeh %.1862, %.1861 + %.1863 =l add %.250, 2650 + storeh 0, %.1863 + %.1864 =l add %.250, 2652 + %.1865 =l extsw 0 + %.1866 =l sub %.1865, 3 + %.1867 =w copy %.1866 + storew %.1867, %.1864 + %.1868 =l add %.250, 2656 + %.1869 =w copy 7 + storew %.1869, %.1868 + %.1870 =l add %.250, 2660 + %.1871 =w copy 1963360965 + storew %.1871, %.1870 + %.1872 =l add %.250, 2664 + %.1873 =w copy 3550624554 + storew %.1873, %.1872 + %.1874 =l add %.250, 2668 + %.1875 =l extsw 0 + %.1876 =l sub %.1875, 1 + %.1877 =w copy %.1876 + storeh %.1877, %.1874 + %.1878 =l add %.250, 2670 + storeh 0, %.1878 + %.1879 =l add %.250, 2672 + %.1880 =w copy 733588941 + storew %.1880, %.1879 + %.1881 =l add %.250, 2676 + %.1882 =w copy 1 + storew %.1882, %.1881 + %.1883 =l add %.250, 2680 + %.1884 =l extsw 0 + %.1885 =l sub %.1884, 7 + %.1886 =w copy %.1885 + storew %.1886, %.1883 + %.1887 =l add %.250, 2684 + %.1888 =w copy 1857691956 + storew %.1888, %.1887 + %.1889 =l add %.250, 2688 + %.1890 =w copy 0 + storeh %.1890, %.1889 + %.1891 =l add %.250, 2690 + storeh 0, %.1891 + %.1892 =l add %.250, 2692 + %.1893 =w copy 1683517642 + storew %.1893, %.1892 + %.1894 =l add %.250, 2696 + %.1895 =w copy 172710452 + storew %.1895, %.1894 + %.1896 =l add %.250, 2700 + %.1897 =l extsw 0 + %.1898 =l sub %.1897, 8 + %.1899 =w copy %.1898 + storew %.1899, %.1896 + %.1900 =l add %.250, 2704 + %.1901 =w copy 239898201 + storew %.1901, %.1900 + %.1902 =l add %.250, 2708 + %.1903 =w copy 15795 + storeh %.1903, %.1902 + %.1904 =l add %.250, 2710 + storeh 0, %.1904 + %.1905 =l add %.250, 2712 + %.1906 =w copy 0 + storew %.1906, %.1905 + %.1907 =l add %.250, 2716 + %.1908 =w copy 1 + storew %.1908, %.1907 + %.1909 =l add %.250, 2720 + %.1910 =w copy 9 + storew %.1910, %.1909 + %.1911 =l add %.250, 2724 + %.1912 =w copy 2313779975 + storew %.1912, %.1911 + %.1913 =l add %.250, 2728 + %.1914 =w copy 26682 + storeh %.1914, %.1913 + %.1915 =l add %.250, 2730 + storeh 0, %.1915 + %.1916 =l add %.250, 2732 + %.1917 =w copy 0 + storew %.1917, %.1916 + %.1918 =l add %.250, 2736 + %.1919 =w copy 18446744073709551612 + storew %.1919, %.1918 + %.1920 =l add %.250, 2740 + %.1921 =w copy 3 + storew %.1921, %.1920 + %.1922 =l add %.250, 2744 + %.1923 =w copy 18446744073709551613 + storew %.1923, %.1922 + %.1924 =l add %.250, 2748 + %.1925 =l extsw 0 + %.1926 =l sub %.1925, 1 + %.1927 =w copy %.1926 + storeh %.1927, %.1924 + %.1928 =l add %.250, 2750 + storeh 0, %.1928 + %.1929 =l add %.250, 2752 + %.1930 =w copy 3074106023 + storew %.1930, %.1929 + %.1931 =l add %.250, 2756 + %.1932 =w copy 0 + storew %.1932, %.1931 + %.1933 =l add %.250, 2760 + %.1934 =w copy 2844539373 + storew %.1934, %.1933 + %.1935 =l add %.250, 2764 + %.1936 =w copy 3196485425 + storew %.1936, %.1935 + %.1937 =l add %.250, 2768 + %.1938 =l extsw 0 + %.1939 =l sub %.1938, 1 + %.1940 =w copy %.1939 + storeh %.1940, %.1937 + %.1941 =l add %.250, 2770 + storeh 0, %.1941 + %.1942 =l add %.250, 2772 + %.1943 =w copy 0 + storew %.1943, %.1942 + %.1944 =l add %.250, 2776 + %.1945 =w copy 754300143 + storew %.1945, %.1944 + %.1946 =l add %.250, 2780 + %.1947 =w copy 3902700085 + storew %.1947, %.1946 + %.1948 =l add %.250, 2784 + %.1949 =w copy 6 + storew %.1949, %.1948 + %.1950 =l add %.250, 2788 + %.1951 =l extsw 0 + %.1952 =l sub %.1951, 10 + %.1953 =w copy %.1952 + storeh %.1953, %.1950 + %.1954 =l add %.250, 2790 + storeh 0, %.1954 + %.1955 =l add %.250, 2792 + %.1956 =w copy 1449819268 + storew %.1956, %.1955 + %.1957 =l add %.250, 2796 + %.1958 =w copy 18446744073709551615 + storew %.1958, %.1957 + %.1959 =l add %.250, 2800 + %.1960 =w copy 732249490 + storew %.1960, %.1959 + %.1961 =l add %.250, 2804 + %.1962 =w copy 18446744073709551609 + storew %.1962, %.1961 + %.1963 =l add %.250, 2808 + %.1964 =w copy 32232 + storeh %.1964, %.1963 + %.1965 =l add %.250, 2810 + storeh 0, %.1965 + %.1966 =l add %.250, 2812 + %.1967 =w copy 0 + storew %.1967, %.1966 + %.1968 =l add %.250, 2816 + %.1969 =w copy 1338704947 + storew %.1969, %.1968 + %.1970 =l add %.250, 2820 + %.1971 =w copy 1 + storew %.1971, %.1970 + %.1972 =l add %.250, 2824 + %.1973 =w copy 18446744073709551615 + storew %.1973, %.1972 + %.1974 =l add %.250, 2828 + %.1975 =w copy 1 + storeh %.1975, %.1974 + %.1976 =l add %.250, 2830 + storeh 0, %.1976 + %.1977 =l add %.250, 2832 + %.1978 =w copy 4158742492 + storew %.1978, %.1977 + %.1979 =l add %.250, 2836 + %.1980 =w copy 18446744073709551615 + storew %.1980, %.1979 + %.1981 =l add %.250, 2840 + %.1982 =w copy 202050518 + storew %.1982, %.1981 + %.1983 =l add %.250, 2844 + %.1984 =w copy 0 + storew %.1984, %.1983 + %.1985 =l add %.250, 2848 + %.1986 =w copy 6474 + storeh %.1986, %.1985 + %.1987 =l add %.250, 2850 + storeh 0, %.1987 + %.1988 =l add %.250, 2852 + %.1989 =l extsw 0 + %.1990 =l sub %.1989, 1 + %.1991 =w copy %.1990 + storew %.1991, %.1988 + %.1992 =l add %.250, 2856 + %.1993 =w copy 0 + storew %.1993, %.1992 + %.1994 =l add %.250, 2860 + %.1995 =w copy 0 + storew %.1995, %.1994 + %.1996 =l add %.250, 2864 + %.1997 =w copy 1 + storew %.1997, %.1996 + %.1998 =l add %.250, 2868 + %.1999 =w copy 25431 + storeh %.1999, %.1998 + %.2000 =l add %.250, 2870 + storeh 0, %.2000 + %.2001 =l add %.250, 2872 + %.2002 =w copy 3588134414 + storew %.2002, %.2001 + %.2003 =l add %.250, 2876 + %.2004 =w copy 8 + storew %.2004, %.2003 + %.2006 =l add %.2005, 0 + %.2007 =l extsw 4 + %.2008 =l mul %.2007, 1 + %.2009 =l add $g_132, %.2008 + storel %.2009, %.2006 + %.2011 =l add %.2010, 0 + %.2012 =w copy 620157876 + storew %.2012, %.2011 + %.2014 =l add %.2013, 0 + storel $g_265, %.2014 + %.2015 =l add %.2013, 8 + storel $g_265, %.2015 + %.2016 =l add %.2013, 16 + storel $g_265, %.2016 + %.2017 =l add %.2013, 24 + storel $g_265, %.2017 + %.2018 =l add %.2013, 32 + storel $g_265, %.2018 + %.2019 =l add %.2013, 40 + storel $g_265, %.2019 + %.2020 =l add %.2013, 48 + storel $g_265, %.2020 + %.2021 =l add %.2013, 56 + storel $g_265, %.2021 + %.2022 =l add %.2013, 64 + storel $g_265, %.2022 + %.2024 =l add %.2023, 0 + %.2025 =w copy 248 + storeb %.2025, %.2024 + %.2027 =l add %.2026, 0 + %.2028 =l extsw 0 + %.2029 =l copy %.2028 + storel %.2029, %.2027 + %.2031 =l add %.2030, 0 + %.2032 =w copy 2742309445 + storew %.2032, %.2031 + %.2034 =l add %.2033, 0 + %.2035 =w copy 0 + storew %.2035, %.2034 + %.2037 =l add %.2036, 0 + %.2038 =l copy $g_265 + %.2039 =l mul 16, 1 + %.2040 =l add %.2038, %.2039 + %.2041 =l copy %.2040 + storel %.2041, %.2037 + %.2043 =l add %.2042, 0 + %.2044 =w copy 196 + storeb %.2044, %.2043 + %.2046 =l add %.2045, 0 + storel $g_130, %.2046 +@lbl_234.1237 + storel $g_23, $g_38 + %.2050 =l extsw 3 + %.2051 =l mul %.2050, 320 + %.2052 =l add %.7, %.2051 + %.2053 =l extsw 3 + %.2054 =l mul %.2053, 64 + %.2055 =l add %.2052, %.2054 + %.2056 =l extsw 1 + %.2057 =l mul %.2056, 8 + %.2058 =l add %.2055, %.2057 + %.2059 =l loadl %.2058 + %.2060 =l loadl %.248 + %.2061 =w loadub %.2060 + %.2062 =w sub %.2061, 1 + storeb %.2062, %.2060 + %.2063 =w call $func_41(l %.2059, w %.2062) + %.2064 =w loaduw %.4 + %.2065 =w copy %.2064 + %.2066 =w call $func_51(w %.2065) + %.2067 =w extsb %.2066 + %.2068 =w cnew %.2067, 0 + jnz %.2068, @logic_right.1240, @logic_join.1241 +@logic_right.1240 + %.2069 =l copy 18446744073709551615 + %.2070 =l call $safe_unary_minus_func_uint64_t_u(l %.2069) + %.2071 =l extsw 2 + %.2072 =l mul %.2071, 360 + %.2073 =l add %.250, %.2072 + %.2074 =l extsw 1 + %.2075 =l mul %.2074, 120 + %.2076 =l add %.2073, %.2075 + %.2077 =l extsw 1 + %.2078 =l mul %.2077, 20 + %.2079 =l add %.2076, %.2078 + %.2080 =l loadl %.248 + %.2081 =w ceql %.6, %.2080 + %.2082 =w loadub %.6 + %.2083 =w extub %.2082 + %.2084 =w ceqw %.2081, %.2083 + %.2085 =l extsw 0 + %.2086 =w cnel %.2085, $g_46 + %.2087 =w copy %.2086 + %.2088 =l loadl %.2005 + storeb %.2087, %.2088 + %.2089 =l loadl $g_82 + %.2090 =w copy %.2089 + %.2091 =w call $safe_mul_func_int8_t_s_s(w %.2087, w %.2090) + %.2092 =w copy 247 + %.2093 =w call $safe_div_func_int8_t_s_s(w %.2091, w %.2092) + %.2094 =w loadsh $g_81 + %.2095 =w copy %.2094 + %.2096 =w call $safe_rshift_func_int8_t_s_s(w %.2095, w 4) + %.2097 =l extsb %.2096 + %.2098 =w csgel 129, %.2097 + %.2099 =l loadl %.2 + %.2100 =w loadsw %.2099 + %.2101 =l loadl $g_23 + %.2102 =w loadsw %.2101 + %.2103 =w call $safe_div_func_int32_t_s_s(w %.2100, w %.2102) + %.2104 =l extsw %.2103 + %.2105 =w cugtl %.2070, %.2104 + %.2106 =w cnew %.2105, 0 +@logic_join.1241 + %.2107 =w phi @lbl_234.1237 %.2068, @logic_right.1240 %.2106 + %.2108 =w cnew %.2107, 0 + jnz %.2108, @logic_right.1238, @logic_join.1239 +@logic_right.1238 + %.2109 =l loadl $g_80 + %.2110 =w cnel %.2109, 0 +@logic_join.1239 + %.2111 =w phi @logic_join.1241 %.2108, @logic_right.1238 %.2110 + %.2112 =w copy %.2111 + %.2113 =l copy $g_130 + %.2114 =l mul 12, 1 + %.2115 =l add %.2113, %.2114 + %.2116 =l copy %.2115 + %.2117 =w loadsw %.2116 + %.2118 =w copy %.2117 + %.2119 =w call $safe_lshift_func_uint8_t_u_u(w %.2112, w %.2118) + %.2120 =w extub %.2119 + %.2121 =w cnew %.2120, 0 + jnz %.2121, @if_true.1242, @if_false.1243 +@if_true.1242 + %.2123 =l add %.2122, 0 + %.2124 =w copy 4285949620 + storew %.2124, %.2123 + %.2126 =l add %.2125, 0 + %.2127 =w copy 613107830 + storew %.2127, %.2126 + %.2129 =l add %.2128, 0 + storel $g_23, %.2129 + %.2131 =l add %.2130, 0 + storel $g_185, %.2131 + %.2133 =l add %.2132, 0 + %.2134 =l extsw 2 + %.2135 =l mul %.2134, 360 + %.2136 =l add %.250, %.2135 + %.2137 =l extsw 1 + %.2138 =l mul %.2137, 120 + %.2139 =l add %.2136, %.2138 + %.2140 =l extsw 1 + %.2141 =l mul %.2140, 20 + %.2142 =l add %.2139, %.2141 + storel %.2142, %.2133 + %.2144 =l add %.2143, 0 + storel $g_84, %.2144 + %.2147 =l add %.2146, 0 + %.2148 =w copy 18446744073709551608 + storew %.2148, %.2147 + %.2150 =l add %.2149, 0 + %.2151 =w copy 6 + storew %.2151, %.2150 + %.2154 =l add %.2153, 0 + storel $g_81, %.2154 + %.2155 =l add %.2153, 8 + storel $g_81, %.2155 + %.2156 =l add %.2153, 16 + storel $g_81, %.2156 + %.2157 =l add %.2153, 24 + storel $g_81, %.2157 + %.2158 =l add %.2153, 32 + storel $g_81, %.2158 + %.2159 =l add %.2153, 40 + %.2160 =l extsw 2 + %.2161 =l mul %.2160, 360 + %.2162 =l add %.250, %.2161 + %.2163 =l extsw 1 + %.2164 =l mul %.2163, 120 + %.2165 =l add %.2162, %.2164 + %.2166 =l extsw 1 + %.2167 =l mul %.2166, 20 + %.2168 =l add %.2165, %.2167 + %.2169 =l copy %.2168 + %.2170 =l mul 8, 1 + %.2171 =l add %.2169, %.2170 + %.2172 =l copy %.2171 + storel %.2172, %.2159 + %.2173 =l add %.2153, 48 + %.2174 =l extsw 2 + %.2175 =l mul %.2174, 360 + %.2176 =l add %.250, %.2175 + %.2177 =l extsw 1 + %.2178 =l mul %.2177, 120 + %.2179 =l add %.2176, %.2178 + %.2180 =l extsw 1 + %.2181 =l mul %.2180, 20 + %.2182 =l add %.2179, %.2181 + %.2183 =l copy %.2182 + %.2184 =l mul 8, 1 + %.2185 =l add %.2183, %.2184 + %.2186 =l copy %.2185 + storel %.2186, %.2173 + %.2187 =l add %.2153, 56 + %.2188 =l extsw 2 + %.2189 =l mul %.2188, 360 + %.2190 =l add %.250, %.2189 + %.2191 =l extsw 1 + %.2192 =l mul %.2191, 120 + %.2193 =l add %.2190, %.2192 + %.2194 =l extsw 1 + %.2195 =l mul %.2194, 20 + %.2196 =l add %.2193, %.2195 + %.2197 =l copy %.2196 + %.2198 =l mul 8, 1 + %.2199 =l add %.2197, %.2198 + %.2200 =l copy %.2199 + storel %.2200, %.2187 + %.2201 =l add %.2153, 64 + %.2202 =l extsw 2 + %.2203 =l mul %.2202, 360 + %.2204 =l add %.250, %.2203 + %.2205 =l extsw 1 + %.2206 =l mul %.2205, 120 + %.2207 =l add %.2204, %.2206 + %.2208 =l extsw 1 + %.2209 =l mul %.2208, 20 + %.2210 =l add %.2207, %.2209 + %.2211 =l copy %.2210 + %.2212 =l mul 8, 1 + %.2213 =l add %.2211, %.2212 + %.2214 =l copy %.2213 + storel %.2214, %.2201 + %.2215 =l add %.2153, 72 + %.2216 =l extsw 2 + %.2217 =l mul %.2216, 360 + %.2218 =l add %.250, %.2217 + %.2219 =l extsw 1 + %.2220 =l mul %.2219, 120 + %.2221 =l add %.2218, %.2220 + %.2222 =l extsw 1 + %.2223 =l mul %.2222, 20 + %.2224 =l add %.2221, %.2223 + %.2225 =l copy %.2224 + %.2226 =l mul 8, 1 + %.2227 =l add %.2225, %.2226 + %.2228 =l copy %.2227 + storel %.2228, %.2215 + %.2229 =l add %.2153, 80 + storel $g_81, %.2229 + %.2230 =l add %.2153, 88 + storel $g_81, %.2230 + %.2231 =l add %.2153, 96 + storel $g_81, %.2231 + %.2232 =l add %.2153, 104 + storel $g_81, %.2232 + %.2233 =l add %.2153, 112 + storel $g_81, %.2233 + %.2234 =l add %.2153, 120 + %.2235 =l extsw 2 + %.2236 =l mul %.2235, 360 + %.2237 =l add %.250, %.2236 + %.2238 =l extsw 1 + %.2239 =l mul %.2238, 120 + %.2240 =l add %.2237, %.2239 + %.2241 =l extsw 1 + %.2242 =l mul %.2241, 20 + %.2243 =l add %.2240, %.2242 + %.2244 =l copy %.2243 + %.2245 =l mul 8, 1 + %.2246 =l add %.2244, %.2245 + %.2247 =l copy %.2246 + storel %.2247, %.2234 + %.2248 =l add %.2153, 128 + %.2249 =l extsw 2 + %.2250 =l mul %.2249, 360 + %.2251 =l add %.250, %.2250 + %.2252 =l extsw 1 + %.2253 =l mul %.2252, 120 + %.2254 =l add %.2251, %.2253 + %.2255 =l extsw 1 + %.2256 =l mul %.2255, 20 + %.2257 =l add %.2254, %.2256 + %.2258 =l copy %.2257 + %.2259 =l mul 8, 1 + %.2260 =l add %.2258, %.2259 + %.2261 =l copy %.2260 + storel %.2261, %.2248 + %.2262 =l add %.2153, 136 + %.2263 =l extsw 2 + %.2264 =l mul %.2263, 360 + %.2265 =l add %.250, %.2264 + %.2266 =l extsw 1 + %.2267 =l mul %.2266, 120 + %.2268 =l add %.2265, %.2267 + %.2269 =l extsw 1 + %.2270 =l mul %.2269, 20 + %.2271 =l add %.2268, %.2270 + %.2272 =l copy %.2271 + %.2273 =l mul 8, 1 + %.2274 =l add %.2272, %.2273 + %.2275 =l copy %.2274 + storel %.2275, %.2262 + %.2276 =l add %.2153, 144 + %.2277 =l extsw 2 + %.2278 =l mul %.2277, 360 + %.2279 =l add %.250, %.2278 + %.2280 =l extsw 1 + %.2281 =l mul %.2280, 120 + %.2282 =l add %.2279, %.2281 + %.2283 =l extsw 1 + %.2284 =l mul %.2283, 20 + %.2285 =l add %.2282, %.2284 + %.2286 =l copy %.2285 + %.2287 =l mul 8, 1 + %.2288 =l add %.2286, %.2287 + %.2289 =l copy %.2288 + storel %.2289, %.2276 + %.2290 =l add %.2153, 152 + %.2291 =l extsw 2 + %.2292 =l mul %.2291, 360 + %.2293 =l add %.250, %.2292 + %.2294 =l extsw 1 + %.2295 =l mul %.2294, 120 + %.2296 =l add %.2293, %.2295 + %.2297 =l extsw 1 + %.2298 =l mul %.2297, 20 + %.2299 =l add %.2296, %.2298 + %.2300 =l copy %.2299 + %.2301 =l mul 8, 1 + %.2302 =l add %.2300, %.2301 + %.2303 =l copy %.2302 + storel %.2303, %.2290 + %.2304 =l add %.2153, 160 + storel $g_81, %.2304 + %.2305 =l add %.2153, 168 + storel $g_81, %.2305 + %.2306 =l add %.2153, 176 + storel $g_81, %.2306 + %.2307 =l add %.2153, 184 + storel $g_81, %.2307 + %.2308 =l add %.2153, 192 + storel $g_81, %.2308 + %.2309 =l add %.2153, 200 + %.2310 =l extsw 2 + %.2311 =l mul %.2310, 360 + %.2312 =l add %.250, %.2311 + %.2313 =l extsw 1 + %.2314 =l mul %.2313, 120 + %.2315 =l add %.2312, %.2314 + %.2316 =l extsw 1 + %.2317 =l mul %.2316, 20 + %.2318 =l add %.2315, %.2317 + %.2319 =l copy %.2318 + %.2320 =l mul 8, 1 + %.2321 =l add %.2319, %.2320 + %.2322 =l copy %.2321 + storel %.2322, %.2309 + %.2323 =l add %.2153, 208 + %.2324 =l extsw 2 + %.2325 =l mul %.2324, 360 + %.2326 =l add %.250, %.2325 + %.2327 =l extsw 1 + %.2328 =l mul %.2327, 120 + %.2329 =l add %.2326, %.2328 + %.2330 =l extsw 1 + %.2331 =l mul %.2330, 20 + %.2332 =l add %.2329, %.2331 + %.2333 =l copy %.2332 + %.2334 =l mul 8, 1 + %.2335 =l add %.2333, %.2334 + %.2336 =l copy %.2335 + storel %.2336, %.2323 + %.2337 =l add %.2153, 216 + %.2338 =l extsw 2 + %.2339 =l mul %.2338, 360 + %.2340 =l add %.250, %.2339 + %.2341 =l extsw 1 + %.2342 =l mul %.2341, 120 + %.2343 =l add %.2340, %.2342 + %.2344 =l extsw 1 + %.2345 =l mul %.2344, 20 + %.2346 =l add %.2343, %.2345 + %.2347 =l copy %.2346 + %.2348 =l mul 8, 1 + %.2349 =l add %.2347, %.2348 + %.2350 =l copy %.2349 + storel %.2350, %.2337 + %.2351 =l add %.2153, 224 + %.2352 =l extsw 2 + %.2353 =l mul %.2352, 360 + %.2354 =l add %.250, %.2353 + %.2355 =l extsw 1 + %.2356 =l mul %.2355, 120 + %.2357 =l add %.2354, %.2356 + %.2358 =l extsw 1 + %.2359 =l mul %.2358, 20 + %.2360 =l add %.2357, %.2359 + %.2361 =l copy %.2360 + %.2362 =l mul 8, 1 + %.2363 =l add %.2361, %.2362 + %.2364 =l copy %.2363 + storel %.2364, %.2351 + %.2365 =l add %.2153, 232 + %.2366 =l extsw 2 + %.2367 =l mul %.2366, 360 + %.2368 =l add %.250, %.2367 + %.2369 =l extsw 1 + %.2370 =l mul %.2369, 120 + %.2371 =l add %.2368, %.2370 + %.2372 =l extsw 1 + %.2373 =l mul %.2372, 20 + %.2374 =l add %.2371, %.2373 + %.2375 =l copy %.2374 + %.2376 =l mul 8, 1 + %.2377 =l add %.2375, %.2376 + %.2378 =l copy %.2377 + storel %.2378, %.2365 + %.2379 =l add %.2153, 240 + storel $g_81, %.2379 + %.2380 =l add %.2153, 248 + storel $g_81, %.2380 + %.2381 =l add %.2153, 256 + storel $g_81, %.2381 + %.2382 =l add %.2153, 264 + storel $g_81, %.2382 + %.2383 =l add %.2153, 272 + storel $g_81, %.2383 + %.2384 =l add %.2153, 280 + %.2385 =l extsw 2 + %.2386 =l mul %.2385, 360 + %.2387 =l add %.250, %.2386 + %.2388 =l extsw 1 + %.2389 =l mul %.2388, 120 + %.2390 =l add %.2387, %.2389 + %.2391 =l extsw 1 + %.2392 =l mul %.2391, 20 + %.2393 =l add %.2390, %.2392 + %.2394 =l copy %.2393 + %.2395 =l mul 8, 1 + %.2396 =l add %.2394, %.2395 + %.2397 =l copy %.2396 + storel %.2397, %.2384 + %.2398 =l add %.2153, 288 + %.2399 =l extsw 2 + %.2400 =l mul %.2399, 360 + %.2401 =l add %.250, %.2400 + %.2402 =l extsw 1 + %.2403 =l mul %.2402, 120 + %.2404 =l add %.2401, %.2403 + %.2405 =l extsw 1 + %.2406 =l mul %.2405, 20 + %.2407 =l add %.2404, %.2406 + %.2408 =l copy %.2407 + %.2409 =l mul 8, 1 + %.2410 =l add %.2408, %.2409 + %.2411 =l copy %.2410 + storel %.2411, %.2398 + %.2412 =l add %.2153, 296 + %.2413 =l extsw 2 + %.2414 =l mul %.2413, 360 + %.2415 =l add %.250, %.2414 + %.2416 =l extsw 1 + %.2417 =l mul %.2416, 120 + %.2418 =l add %.2415, %.2417 + %.2419 =l extsw 1 + %.2420 =l mul %.2419, 20 + %.2421 =l add %.2418, %.2420 + %.2422 =l copy %.2421 + %.2423 =l mul 8, 1 + %.2424 =l add %.2422, %.2423 + %.2425 =l copy %.2424 + storel %.2425, %.2412 + %.2426 =l add %.2153, 304 + %.2427 =l extsw 2 + %.2428 =l mul %.2427, 360 + %.2429 =l add %.250, %.2428 + %.2430 =l extsw 1 + %.2431 =l mul %.2430, 120 + %.2432 =l add %.2429, %.2431 + %.2433 =l extsw 1 + %.2434 =l mul %.2433, 20 + %.2435 =l add %.2432, %.2434 + %.2436 =l copy %.2435 + %.2437 =l mul 8, 1 + %.2438 =l add %.2436, %.2437 + %.2439 =l copy %.2438 + storel %.2439, %.2426 + %.2440 =l add %.2153, 312 + %.2441 =l extsw 2 + %.2442 =l mul %.2441, 360 + %.2443 =l add %.250, %.2442 + %.2444 =l extsw 1 + %.2445 =l mul %.2444, 120 + %.2446 =l add %.2443, %.2445 + %.2447 =l extsw 1 + %.2448 =l mul %.2447, 20 + %.2449 =l add %.2446, %.2448 + %.2450 =l copy %.2449 + %.2451 =l mul 8, 1 + %.2452 =l add %.2450, %.2451 + %.2453 =l copy %.2452 + storel %.2453, %.2440 + %.2454 =l add %.2153, 320 + storel $g_81, %.2454 + %.2455 =l add %.2153, 328 + storel $g_81, %.2455 + %.2456 =l add %.2153, 336 + storel $g_81, %.2456 + %.2457 =l add %.2153, 344 + storel $g_81, %.2457 + %.2458 =l add %.2153, 352 + storel $g_81, %.2458 + %.2459 =l add %.2153, 360 + %.2460 =l extsw 2 + %.2461 =l mul %.2460, 360 + %.2462 =l add %.250, %.2461 + %.2463 =l extsw 1 + %.2464 =l mul %.2463, 120 + %.2465 =l add %.2462, %.2464 + %.2466 =l extsw 1 + %.2467 =l mul %.2466, 20 + %.2468 =l add %.2465, %.2467 + %.2469 =l copy %.2468 + %.2470 =l mul 8, 1 + %.2471 =l add %.2469, %.2470 + %.2472 =l copy %.2471 + storel %.2472, %.2459 + %.2473 =l add %.2153, 368 + %.2474 =l extsw 2 + %.2475 =l mul %.2474, 360 + %.2476 =l add %.250, %.2475 + %.2477 =l extsw 1 + %.2478 =l mul %.2477, 120 + %.2479 =l add %.2476, %.2478 + %.2480 =l extsw 1 + %.2481 =l mul %.2480, 20 + %.2482 =l add %.2479, %.2481 + %.2483 =l copy %.2482 + %.2484 =l mul 8, 1 + %.2485 =l add %.2483, %.2484 + %.2486 =l copy %.2485 + storel %.2486, %.2473 + %.2487 =l add %.2153, 376 + %.2488 =l extsw 2 + %.2489 =l mul %.2488, 360 + %.2490 =l add %.250, %.2489 + %.2491 =l extsw 1 + %.2492 =l mul %.2491, 120 + %.2493 =l add %.2490, %.2492 + %.2494 =l extsw 1 + %.2495 =l mul %.2494, 20 + %.2496 =l add %.2493, %.2495 + %.2497 =l copy %.2496 + %.2498 =l mul 8, 1 + %.2499 =l add %.2497, %.2498 + %.2500 =l copy %.2499 + storel %.2500, %.2487 + %.2501 =l add %.2153, 384 + %.2502 =l extsw 2 + %.2503 =l mul %.2502, 360 + %.2504 =l add %.250, %.2503 + %.2505 =l extsw 1 + %.2506 =l mul %.2505, 120 + %.2507 =l add %.2504, %.2506 + %.2508 =l extsw 1 + %.2509 =l mul %.2508, 20 + %.2510 =l add %.2507, %.2509 + %.2511 =l copy %.2510 + %.2512 =l mul 8, 1 + %.2513 =l add %.2511, %.2512 + %.2514 =l copy %.2513 + storel %.2514, %.2501 + %.2515 =l add %.2153, 392 + %.2516 =l extsw 2 + %.2517 =l mul %.2516, 360 + %.2518 =l add %.250, %.2517 + %.2519 =l extsw 1 + %.2520 =l mul %.2519, 120 + %.2521 =l add %.2518, %.2520 + %.2522 =l extsw 1 + %.2523 =l mul %.2522, 20 + %.2524 =l add %.2521, %.2523 + %.2525 =l copy %.2524 + %.2526 =l mul 8, 1 + %.2527 =l add %.2525, %.2526 + %.2528 =l copy %.2527 + storel %.2528, %.2515 + %.2529 =l add %.2153, 400 + storel $g_81, %.2529 + %.2530 =l add %.2153, 408 + storel $g_81, %.2530 + %.2531 =l add %.2153, 416 + storel $g_81, %.2531 + %.2532 =l add %.2153, 424 + storel $g_81, %.2532 + %.2533 =l add %.2153, 432 + storel $g_81, %.2533 + %.2534 =l add %.2153, 440 + %.2535 =l extsw 2 + %.2536 =l mul %.2535, 360 + %.2537 =l add %.250, %.2536 + %.2538 =l extsw 1 + %.2539 =l mul %.2538, 120 + %.2540 =l add %.2537, %.2539 + %.2541 =l extsw 1 + %.2542 =l mul %.2541, 20 + %.2543 =l add %.2540, %.2542 + %.2544 =l copy %.2543 + %.2545 =l mul 8, 1 + %.2546 =l add %.2544, %.2545 + %.2547 =l copy %.2546 + storel %.2547, %.2534 + %.2548 =l add %.2153, 448 + %.2549 =l extsw 2 + %.2550 =l mul %.2549, 360 + %.2551 =l add %.250, %.2550 + %.2552 =l extsw 1 + %.2553 =l mul %.2552, 120 + %.2554 =l add %.2551, %.2553 + %.2555 =l extsw 1 + %.2556 =l mul %.2555, 20 + %.2557 =l add %.2554, %.2556 + %.2558 =l copy %.2557 + %.2559 =l mul 8, 1 + %.2560 =l add %.2558, %.2559 + %.2561 =l copy %.2560 + storel %.2561, %.2548 + %.2562 =l add %.2153, 456 + %.2563 =l extsw 2 + %.2564 =l mul %.2563, 360 + %.2565 =l add %.250, %.2564 + %.2566 =l extsw 1 + %.2567 =l mul %.2566, 120 + %.2568 =l add %.2565, %.2567 + %.2569 =l extsw 1 + %.2570 =l mul %.2569, 20 + %.2571 =l add %.2568, %.2570 + %.2572 =l copy %.2571 + %.2573 =l mul 8, 1 + %.2574 =l add %.2572, %.2573 + %.2575 =l copy %.2574 + storel %.2575, %.2562 + %.2576 =l add %.2153, 464 + %.2577 =l extsw 2 + %.2578 =l mul %.2577, 360 + %.2579 =l add %.250, %.2578 + %.2580 =l extsw 1 + %.2581 =l mul %.2580, 120 + %.2582 =l add %.2579, %.2581 + %.2583 =l extsw 1 + %.2584 =l mul %.2583, 20 + %.2585 =l add %.2582, %.2584 + %.2586 =l copy %.2585 + %.2587 =l mul 8, 1 + %.2588 =l add %.2586, %.2587 + %.2589 =l copy %.2588 + storel %.2589, %.2576 + %.2590 =l add %.2153, 472 + %.2591 =l extsw 2 + %.2592 =l mul %.2591, 360 + %.2593 =l add %.250, %.2592 + %.2594 =l extsw 1 + %.2595 =l mul %.2594, 120 + %.2596 =l add %.2593, %.2595 + %.2597 =l extsw 1 + %.2598 =l mul %.2597, 20 + %.2599 =l add %.2596, %.2598 + %.2600 =l copy %.2599 + %.2601 =l mul 8, 1 + %.2602 =l add %.2600, %.2601 + %.2603 =l copy %.2602 + storel %.2603, %.2590 + %.2604 =l add %.2153, 480 + storel $g_81, %.2604 + %.2605 =l add %.2153, 488 + storel $g_81, %.2605 + %.2606 =l add %.2153, 496 + storel $g_81, %.2606 + %.2607 =l add %.2153, 504 + storel $g_81, %.2607 + %.2608 =l add %.2153, 512 + storel $g_81, %.2608 + %.2609 =l add %.2153, 520 + %.2610 =l extsw 2 + %.2611 =l mul %.2610, 360 + %.2612 =l add %.250, %.2611 + %.2613 =l extsw 1 + %.2614 =l mul %.2613, 120 + %.2615 =l add %.2612, %.2614 + %.2616 =l extsw 1 + %.2617 =l mul %.2616, 20 + %.2618 =l add %.2615, %.2617 + %.2619 =l copy %.2618 + %.2620 =l mul 8, 1 + %.2621 =l add %.2619, %.2620 + %.2622 =l copy %.2621 + storel %.2622, %.2609 + %.2623 =l add %.2153, 528 + %.2624 =l extsw 2 + %.2625 =l mul %.2624, 360 + %.2626 =l add %.250, %.2625 + %.2627 =l extsw 1 + %.2628 =l mul %.2627, 120 + %.2629 =l add %.2626, %.2628 + %.2630 =l extsw 1 + %.2631 =l mul %.2630, 20 + %.2632 =l add %.2629, %.2631 + %.2633 =l copy %.2632 + %.2634 =l mul 8, 1 + %.2635 =l add %.2633, %.2634 + %.2636 =l copy %.2635 + storel %.2636, %.2623 + %.2637 =l add %.2153, 536 + %.2638 =l extsw 2 + %.2639 =l mul %.2638, 360 + %.2640 =l add %.250, %.2639 + %.2641 =l extsw 1 + %.2642 =l mul %.2641, 120 + %.2643 =l add %.2640, %.2642 + %.2644 =l extsw 1 + %.2645 =l mul %.2644, 20 + %.2646 =l add %.2643, %.2645 + %.2647 =l copy %.2646 + %.2648 =l mul 8, 1 + %.2649 =l add %.2647, %.2648 + %.2650 =l copy %.2649 + storel %.2650, %.2637 + %.2651 =l add %.2153, 544 + %.2652 =l extsw 2 + %.2653 =l mul %.2652, 360 + %.2654 =l add %.250, %.2653 + %.2655 =l extsw 1 + %.2656 =l mul %.2655, 120 + %.2657 =l add %.2654, %.2656 + %.2658 =l extsw 1 + %.2659 =l mul %.2658, 20 + %.2660 =l add %.2657, %.2659 + %.2661 =l copy %.2660 + %.2662 =l mul 8, 1 + %.2663 =l add %.2661, %.2662 + %.2664 =l copy %.2663 + storel %.2664, %.2651 + %.2665 =l add %.2153, 552 + %.2666 =l extsw 2 + %.2667 =l mul %.2666, 360 + %.2668 =l add %.250, %.2667 + %.2669 =l extsw 1 + %.2670 =l mul %.2669, 120 + %.2671 =l add %.2668, %.2670 + %.2672 =l extsw 1 + %.2673 =l mul %.2672, 20 + %.2674 =l add %.2671, %.2673 + %.2675 =l copy %.2674 + %.2676 =l mul 8, 1 + %.2677 =l add %.2675, %.2676 + %.2678 =l copy %.2677 + storel %.2678, %.2665 + %.2679 =l add %.2153, 560 + storel $g_81, %.2679 + %.2680 =l add %.2153, 568 + storel $g_81, %.2680 + %.2681 =l add %.2153, 576 + storel $g_81, %.2681 + %.2682 =l add %.2153, 584 + storel $g_81, %.2682 + %.2683 =l add %.2153, 592 + storel $g_81, %.2683 + %.2684 =l add %.2153, 600 + %.2685 =l extsw 2 + %.2686 =l mul %.2685, 360 + %.2687 =l add %.250, %.2686 + %.2688 =l extsw 1 + %.2689 =l mul %.2688, 120 + %.2690 =l add %.2687, %.2689 + %.2691 =l extsw 1 + %.2692 =l mul %.2691, 20 + %.2693 =l add %.2690, %.2692 + %.2694 =l copy %.2693 + %.2695 =l mul 8, 1 + %.2696 =l add %.2694, %.2695 + %.2697 =l copy %.2696 + storel %.2697, %.2684 + %.2698 =l add %.2153, 608 + %.2699 =l extsw 2 + %.2700 =l mul %.2699, 360 + %.2701 =l add %.250, %.2700 + %.2702 =l extsw 1 + %.2703 =l mul %.2702, 120 + %.2704 =l add %.2701, %.2703 + %.2705 =l extsw 1 + %.2706 =l mul %.2705, 20 + %.2707 =l add %.2704, %.2706 + %.2708 =l copy %.2707 + %.2709 =l mul 8, 1 + %.2710 =l add %.2708, %.2709 + %.2711 =l copy %.2710 + storel %.2711, %.2698 + %.2712 =l add %.2153, 616 + %.2713 =l extsw 2 + %.2714 =l mul %.2713, 360 + %.2715 =l add %.250, %.2714 + %.2716 =l extsw 1 + %.2717 =l mul %.2716, 120 + %.2718 =l add %.2715, %.2717 + %.2719 =l extsw 1 + %.2720 =l mul %.2719, 20 + %.2721 =l add %.2718, %.2720 + %.2722 =l copy %.2721 + %.2723 =l mul 8, 1 + %.2724 =l add %.2722, %.2723 + %.2725 =l copy %.2724 + storel %.2725, %.2712 + %.2726 =l add %.2153, 624 + %.2727 =l extsw 2 + %.2728 =l mul %.2727, 360 + %.2729 =l add %.250, %.2728 + %.2730 =l extsw 1 + %.2731 =l mul %.2730, 120 + %.2732 =l add %.2729, %.2731 + %.2733 =l extsw 1 + %.2734 =l mul %.2733, 20 + %.2735 =l add %.2732, %.2734 + %.2736 =l copy %.2735 + %.2737 =l mul 8, 1 + %.2738 =l add %.2736, %.2737 + %.2739 =l copy %.2738 + storel %.2739, %.2726 + %.2740 =l add %.2153, 632 + %.2741 =l extsw 2 + %.2742 =l mul %.2741, 360 + %.2743 =l add %.250, %.2742 + %.2744 =l extsw 1 + %.2745 =l mul %.2744, 120 + %.2746 =l add %.2743, %.2745 + %.2747 =l extsw 1 + %.2748 =l mul %.2747, 20 + %.2749 =l add %.2746, %.2748 + %.2750 =l copy %.2749 + %.2751 =l mul 8, 1 + %.2752 =l add %.2750, %.2751 + %.2753 =l copy %.2752 + storel %.2753, %.2740 + %.2754 =l add %.2153, 640 + storel $g_81, %.2754 + %.2755 =l add %.2153, 648 + storel $g_81, %.2755 + %.2756 =l add %.2153, 656 + storel $g_81, %.2756 + %.2757 =l add %.2153, 664 + storel $g_81, %.2757 + %.2758 =l add %.2153, 672 + storel $g_81, %.2758 + %.2759 =l add %.2153, 680 + %.2760 =l extsw 2 + %.2761 =l mul %.2760, 360 + %.2762 =l add %.250, %.2761 + %.2763 =l extsw 1 + %.2764 =l mul %.2763, 120 + %.2765 =l add %.2762, %.2764 + %.2766 =l extsw 1 + %.2767 =l mul %.2766, 20 + %.2768 =l add %.2765, %.2767 + %.2769 =l copy %.2768 + %.2770 =l mul 8, 1 + %.2771 =l add %.2769, %.2770 + %.2772 =l copy %.2771 + storel %.2772, %.2759 + %.2773 =l add %.2153, 688 + %.2774 =l extsw 2 + %.2775 =l mul %.2774, 360 + %.2776 =l add %.250, %.2775 + %.2777 =l extsw 1 + %.2778 =l mul %.2777, 120 + %.2779 =l add %.2776, %.2778 + %.2780 =l extsw 1 + %.2781 =l mul %.2780, 20 + %.2782 =l add %.2779, %.2781 + %.2783 =l copy %.2782 + %.2784 =l mul 8, 1 + %.2785 =l add %.2783, %.2784 + %.2786 =l copy %.2785 + storel %.2786, %.2773 + %.2787 =l add %.2153, 696 + %.2788 =l extsw 2 + %.2789 =l mul %.2788, 360 + %.2790 =l add %.250, %.2789 + %.2791 =l extsw 1 + %.2792 =l mul %.2791, 120 + %.2793 =l add %.2790, %.2792 + %.2794 =l extsw 1 + %.2795 =l mul %.2794, 20 + %.2796 =l add %.2793, %.2795 + %.2797 =l copy %.2796 + %.2798 =l mul 8, 1 + %.2799 =l add %.2797, %.2798 + %.2800 =l copy %.2799 + storel %.2800, %.2787 + %.2801 =l add %.2153, 704 + %.2802 =l extsw 2 + %.2803 =l mul %.2802, 360 + %.2804 =l add %.250, %.2803 + %.2805 =l extsw 1 + %.2806 =l mul %.2805, 120 + %.2807 =l add %.2804, %.2806 + %.2808 =l extsw 1 + %.2809 =l mul %.2808, 20 + %.2810 =l add %.2807, %.2809 + %.2811 =l copy %.2810 + %.2812 =l mul 8, 1 + %.2813 =l add %.2811, %.2812 + %.2814 =l copy %.2813 + storel %.2814, %.2801 + %.2815 =l add %.2153, 712 + %.2816 =l extsw 2 + %.2817 =l mul %.2816, 360 + %.2818 =l add %.250, %.2817 + %.2819 =l extsw 1 + %.2820 =l mul %.2819, 120 + %.2821 =l add %.2818, %.2820 + %.2822 =l extsw 1 + %.2823 =l mul %.2822, 20 + %.2824 =l add %.2821, %.2823 + %.2825 =l copy %.2824 + %.2826 =l mul 8, 1 + %.2827 =l add %.2825, %.2826 + %.2828 =l copy %.2827 + storel %.2828, %.2815 + %.2830 =l add %.2829, 0 + %.2831 =w copy 5 + storeb %.2831, %.2830 + %.2833 =l add %.2832, 0 + %.2834 =w copy 188 + storeb %.2834, %.2833 + %.2836 =l add %.2835, 0 + %.2837 =l extsw 0 + %.2838 =l sub %.2837, 3 + %.2839 =w copy %.2838 + storew %.2839, %.2836 + storew 0, %.2840 +@for_cond.1244 + %.2843 =w loadsw %.2840 + %.2844 =w csltw %.2843, 2 + jnz %.2844, @for_body.1245, @for_join.1247 +@for_body.1245 + %.2845 =w loadsw %.2840 + %.2846 =l extsw %.2845 + %.2847 =l mul %.2846, 8 + %.2848 =l add %.2145, %.2847 + storel $g_296, %.2848 +@for_cont.1246 + %.2849 =w loadsw %.2840 + %.2850 =w add %.2849, 1 + storew %.2850, %.2840 + jmp @for_cond.1244 +@for_join.1247 + storew 0, %.2840 +@for_cond.1248 + %.2851 =w loadsw %.2840 + %.2852 =w csltw %.2851, 1 + jnz %.2852, @for_body.1249, @for_join.1251 +@for_body.1249 + %.2853 =w copy 3422380986 + %.2854 =w loadsw %.2840 + %.2855 =l extsw %.2854 + %.2856 =l mul %.2855, 4 + %.2857 =l add %.2152, %.2856 + storew %.2853, %.2857 +@for_cont.1250 + %.2858 =w loadsw %.2840 + %.2859 =w add %.2858, 1 + storew %.2859, %.2840 + jmp @for_cond.1248 +@for_join.1251 + %.2860 =w copy 0 + %.2861 =l copy $g_130 + %.2862 =l mul 4, 1 + %.2863 =l add %.2861, %.2862 + %.2864 =l copy %.2863 + storew %.2860, %.2864 +@for_cond.1252 + %.2865 =l copy $g_130 + %.2866 =l mul 4, 1 + %.2867 =l add %.2865, %.2866 + %.2868 =l copy %.2867 + %.2869 =w loaduw %.2868 + %.2870 =w copy 9 + %.2871 =w cugew %.2869, %.2870 + jnz %.2871, @for_body.1253, @for_join.1255 +@for_body.1253 + %.2873 =l add %.2872, 0 + %.2874 =w copy 0 + storeb %.2874, %.2873 + %.2876 =l add %.2875, 0 + %.2877 =l extsw 2 + %.2878 =l mul %.2877, 360 + %.2879 =l add %.250, %.2878 + %.2880 =l extsw 1 + %.2881 =l mul %.2880, 120 + %.2882 =l add %.2879, %.2881 + %.2883 =l extsw 1 + %.2884 =l mul %.2883, 20 + %.2885 =l add %.2882, %.2884 + storel %.2885, %.2876 + %.2887 =l add %.2886, 0 + %.2888 =l extsw 0 + %.2889 =l sub %.2888, 1 + %.2890 =w copy %.2889 + storew %.2890, %.2887 + %.2892 =l add %.2891, 0 + storel $g_201, %.2892 + %.2894 =l add %.2893, 0 + storel %.2130, %.2894 + %.2896 =l add %.2895, 0 + storel %.248, %.2896 + %.2898 =l add %.2897, 0 + storel %.2132, %.2898 + %.2899 =l add %.2897, 8 + %.2900 =l extsw 0 + %.2901 =l copy %.2900 + storel %.2901, %.2899 + %.2902 =l add %.2897, 16 + storel %.2132, %.2902 + %.2903 =l add %.2897, 24 + storel %.2132, %.2903 + %.2904 =l add %.2897, 32 + storel %.2132, %.2904 + %.2905 =l add %.2897, 40 + storel %.2132, %.2905 + %.2906 =l add %.2897, 48 + storel %.2132, %.2906 + %.2907 =l add %.2897, 56 + %.2908 =l extsw 0 + %.2909 =l copy %.2908 + storel %.2909, %.2907 + %.2910 =l add %.2897, 64 + storel %.2132, %.2910 + %.2911 =l add %.2897, 72 + storel %.2132, %.2911 + %.2912 =l add %.2897, 80 + storel %.2132, %.2912 + %.2913 =l add %.2897, 88 + storel %.2132, %.2913 + %.2914 =l add %.2897, 96 + storel %.2132, %.2914 + %.2915 =l add %.2897, 104 + %.2916 =l extsw 0 + %.2917 =l copy %.2916 + storel %.2917, %.2915 + %.2918 =l add %.2897, 112 + storel %.2132, %.2918 + %.2919 =l add %.2897, 120 + storel %.2132, %.2919 + %.2920 =l add %.2897, 128 + storel %.2132, %.2920 + %.2921 =l add %.2897, 136 + storel %.2132, %.2921 + %.2922 =l add %.2897, 144 + storel %.2132, %.2922 + %.2923 =l add %.2897, 152 + %.2924 =l extsw 0 + %.2925 =l copy %.2924 + storel %.2925, %.2923 + %.2926 =l add %.2897, 160 + storel %.2132, %.2926 + %.2927 =l add %.2897, 168 + storel %.2132, %.2927 + %.2928 =l add %.2897, 176 + storel %.2132, %.2928 + %.2929 =l add %.2897, 184 + storel %.2132, %.2929 + %.2930 =l add %.2897, 192 + storel %.2132, %.2930 + %.2931 =l add %.2897, 200 + %.2932 =l extsw 0 + %.2933 =l copy %.2932 + storel %.2933, %.2931 + %.2934 =l add %.2897, 208 + storel %.2132, %.2934 + %.2936 =l add %.2935, 0 + %.2937 =w copy 8 + storeb %.2937, %.2936 + %.2938 =l add %.2935, 1 + %.2939 =w copy 1 + storeb %.2939, %.2938 + %.2940 =l add %.2935, 2 + %.2941 =w copy 1 + storeb %.2941, %.2940 + %.2942 =l add %.2935, 3 + %.2943 =w copy 8 + storeb %.2943, %.2942 + %.2944 =l add %.2935, 4 + %.2945 =w copy 176 + storeb %.2945, %.2944 + %.2946 =l add %.2935, 5 + %.2947 =w copy 178 + storeb %.2947, %.2946 + %.2948 =l add %.2935, 6 + %.2949 =w copy 75 + storeb %.2949, %.2948 + %.2950 =l add %.2935, 7 + %.2951 =w copy 15 + storeb %.2951, %.2950 + %.2952 =l add %.2935, 8 + %.2953 =w copy 1 + storeb %.2953, %.2952 + %.2954 =l add %.2935, 9 + %.2955 =w copy 1 + storeb %.2955, %.2954 + %.2956 =l add %.2935, 10 + %.2957 =w copy 140 + storeb %.2957, %.2956 + %.2958 =l add %.2935, 11 + %.2959 =w copy 140 + storeb %.2959, %.2958 + %.2960 =l add %.2935, 12 + %.2961 =w copy 1 + storeb %.2961, %.2960 + %.2962 =l add %.2935, 13 + %.2963 =w copy 1 + storeb %.2963, %.2962 + %.2964 =l add %.2935, 14 + %.2965 =w copy 140 + storeb %.2965, %.2964 + %.2966 =l add %.2935, 15 + %.2967 =w copy 140 + storeb %.2967, %.2966 + %.2968 =l add %.2935, 16 + %.2969 =w copy 49 + storeb %.2969, %.2968 + %.2970 =l add %.2935, 17 + %.2971 =w copy 49 + storeb %.2971, %.2970 + %.2972 =l add %.2935, 18 + %.2973 =w copy 176 + storeb %.2973, %.2972 + %.2974 =l add %.2935, 19 + %.2975 =l extsw 0 + %.2976 =l sub %.2975, 1 + %.2977 =w copy %.2976 + storeb %.2977, %.2974 + %.2978 =l add %.2935, 20 + %.2979 =w copy 8 + storeb %.2979, %.2978 + %.2980 =l add %.2935, 21 + %.2981 =l extsw 0 + %.2982 =l sub %.2981, 8 + %.2983 =w copy %.2982 + storeb %.2983, %.2980 + %.2984 =l add %.2935, 22 + %.2985 =w copy 75 + storeb %.2985, %.2984 + %.2986 =l add %.2935, 23 + %.2987 =w copy 49 + storeb %.2987, %.2986 + %.2988 =l add %.2935, 24 + %.2989 =w copy 1 + storeb %.2989, %.2988 + %.2990 =l add %.2935, 25 + %.2991 =w copy 178 + storeb %.2991, %.2990 + %.2992 =l add %.2935, 26 + %.2993 =w copy 8 + storeb %.2993, %.2992 + %.2994 =l add %.2935, 27 + %.2995 =w copy 1 + storeb %.2995, %.2994 + %.2996 =l add %.2935, 28 + %.2997 =w copy 75 + storeb %.2997, %.2996 + %.2998 =l add %.2935, 29 + %.2999 =w copy 8 + storeb %.2999, %.2998 + %.3000 =l add %.2935, 30 + %.3001 =w copy 140 + storeb %.3001, %.3000 + %.3002 =l add %.2935, 31 + %.3003 =w copy 49 + storeb %.3003, %.3002 + %.3004 =l add %.2935, 32 + %.3005 =w copy 178 + storeb %.3005, %.3004 + %.3006 =l add %.2935, 33 + %.3007 =w copy 242 + storeb %.3007, %.3006 + %.3008 =l add %.2935, 34 + %.3009 =w copy 1 + storeb %.3009, %.3008 + %.3010 =l add %.2935, 35 + %.3011 =l extsw 0 + %.3012 =l sub %.3011, 1 + %.3013 =w copy %.3012 + storeb %.3013, %.3010 + %.3014 =l add %.2935, 36 + %.3015 =w copy 1 + storeb %.3015, %.3014 + %.3016 =l add %.2935, 37 + %.3017 =w copy 242 + storeb %.3017, %.3016 + %.3018 =l add %.2935, 38 + %.3019 =w copy 178 + storeb %.3019, %.3018 + %.3020 =l add %.2935, 39 + %.3021 =w copy 140 + storeb %.3021, %.3020 + %.3022 =l add %.2935, 40 + %.3023 =w copy 1 + storeb %.3023, %.3022 + %.3024 =l add %.2935, 41 + %.3025 =l extsw 0 + %.3026 =l sub %.3025, 1 + %.3027 =w copy %.3026 + storeb %.3027, %.3024 + %.3028 =l add %.2935, 42 + %.3029 =w copy 121 + storeb %.3029, %.3028 + %.3030 =l add %.2935, 43 + %.3031 =w copy 140 + storeb %.3031, %.3030 + %.3032 =l add %.2935, 44 + %.3033 =l extsw 0 + %.3034 =l sub %.3033, 1 + %.3035 =w copy %.3034 + storeb %.3035, %.3032 + %.3036 =l add %.2935, 45 + %.3037 =w copy 1 + storeb %.3037, %.3036 + %.3038 =l add %.2935, 46 + %.3039 =w copy 75 + storeb %.3039, %.3038 + %.3040 =l add %.2935, 47 + %.3041 =w copy 1 + storeb %.3041, %.3040 + %.3042 =l add %.2935, 48 + %.3043 =w copy 0 + storeb %.3043, %.3042 + %.3044 =l add %.2935, 49 + %.3045 =w copy 1 + storeb %.3045, %.3044 + %.3046 =l add %.2935, 50 + %.3047 =w copy 1 + storeb %.3047, %.3046 + %.3048 =l add %.2935, 51 + %.3049 =w copy 242 + storeb %.3049, %.3048 + %.3050 =l add %.2935, 52 + %.3051 =l extsw 0 + %.3052 =l sub %.3051, 1 + %.3053 =w copy %.3052 + storeb %.3053, %.3050 + %.3054 =l add %.2935, 53 + %.3055 =w copy 8 + storeb %.3055, %.3054 + %.3056 =l add %.2935, 54 + %.3057 =w copy 8 + storeb %.3057, %.3056 + %.3058 =l add %.2935, 55 + %.3059 =l extsw 0 + %.3060 =l sub %.3059, 1 + %.3061 =w copy %.3060 + storeb %.3061, %.3058 + %.3062 =l add %.2935, 56 + %.3063 =w copy 1 + storeb %.3063, %.3062 + %.3064 =l add %.2935, 57 + %.3065 =w copy 140 + storeb %.3065, %.3064 + %.3066 =l add %.2935, 58 + %.3067 =w copy 140 + storeb %.3067, %.3066 + %.3068 =l add %.2935, 59 + %.3069 =w copy 1 + storeb %.3069, %.3068 + %.3070 =l add %.2935, 60 + %.3071 =w copy 1 + storeb %.3071, %.3070 + %.3072 =l add %.2935, 61 + %.3073 =w copy 0 + storeb %.3073, %.3072 + %.3074 =l add %.2935, 62 + %.3075 =w copy 49 + storeb %.3075, %.3074 + %.3076 =l add %.2935, 63 + %.3077 =w copy 242 + storeb %.3077, %.3076 + %.3078 =l add %.2935, 64 + %.3079 =w copy 178 + storeb %.3079, %.3078 + %.3080 =l add %.2935, 65 + %.3081 =w copy 49 + storeb %.3081, %.3080 + %.3082 =l add %.2935, 66 + %.3083 =w copy 0 + storeb %.3083, %.3082 + %.3084 =l add %.2935, 67 + %.3085 =w copy 140 + storeb %.3085, %.3084 + %.3086 =l add %.2935, 68 + %.3087 =w copy 75 + storeb %.3087, %.3086 + %.3088 =l add %.2935, 69 + %.3089 =w copy 176 + storeb %.3089, %.3088 + %.3090 =l add %.2935, 70 + %.3091 =w copy 140 + storeb %.3091, %.3090 + %.3092 =l add %.2935, 71 + %.3093 =w copy 178 + storeb %.3093, %.3092 + %.3094 =l add %.2935, 72 + %.3095 =w copy 1 + storeb %.3095, %.3094 + %.3096 =l add %.2935, 73 + %.3097 =w copy 49 + storeb %.3097, %.3096 + %.3098 =l add %.2935, 74 + %.3099 =w copy 1 + storeb %.3099, %.3098 + %.3100 =l add %.2935, 75 + %.3101 =w copy 0 + storeb %.3101, %.3100 + %.3102 =l add %.2935, 76 + %.3103 =w copy 8 + storeb %.3103, %.3102 + %.3104 =l add %.2935, 77 + %.3105 =w copy 0 + storeb %.3105, %.3104 + %.3106 =l add %.2935, 78 + %.3107 =w copy 1 + storeb %.3107, %.3106 + %.3108 =l add %.2935, 79 + %.3109 =w copy 49 + storeb %.3109, %.3108 + %.3110 =l add %.2935, 80 + %.3111 =w copy 49 + storeb %.3111, %.3110 + %.3112 =l add %.2935, 81 + %.3113 =w copy 140 + storeb %.3113, %.3112 + %.3114 =l add %.2935, 82 + %.3115 =w copy 8 + storeb %.3115, %.3114 + %.3116 =l add %.2935, 83 + %.3117 =w copy 75 + storeb %.3117, %.3116 + %.3118 =l add %.2935, 84 + %.3119 =w copy 1 + storeb %.3119, %.3118 + %.3120 =l add %.2935, 85 + %.3121 =w copy 8 + storeb %.3121, %.3120 + %.3122 =l add %.2935, 86 + %.3123 =w copy 178 + storeb %.3123, %.3122 + %.3124 =l add %.2935, 87 + %.3125 =w copy 1 + storeb %.3125, %.3124 + %.3126 =l add %.2935, 88 + %.3127 =w copy 178 + storeb %.3127, %.3126 + %.3128 =l add %.2935, 89 + %.3129 =w copy 1 + storeb %.3129, %.3128 + %.3130 =l add %.2935, 90 + %.3131 =l extsw 0 + %.3132 =l sub %.3131, 1 + %.3133 =w copy %.3132 + storeb %.3133, %.3130 + %.3134 =l add %.2935, 91 + %.3135 =l extsw 0 + %.3136 =l sub %.3135, 1 + %.3137 =w copy %.3136 + storeb %.3137, %.3134 + %.3138 =l add %.2935, 92 + %.3139 =w copy 49 + storeb %.3139, %.3138 + %.3140 =l add %.2935, 93 + %.3141 =w copy 1 + storeb %.3141, %.3140 + %.3142 =l add %.2935, 94 + %.3143 =w copy 178 + storeb %.3143, %.3142 + %.3144 =l add %.2935, 95 + %.3145 =w copy 178 + storeb %.3145, %.3144 + %.3146 =l add %.2935, 96 + %.3147 =w copy 242 + storeb %.3147, %.3146 + %.3148 =l add %.2935, 97 + %.3149 =l extsw 0 + %.3150 =l sub %.3149, 1 + %.3151 =w copy %.3150 + storeb %.3151, %.3148 + %.3152 =l add %.2935, 98 + %.3153 =w copy 8 + storeb %.3153, %.3152 + %.3154 =l add %.2935, 99 + %.3155 =w copy 8 + storeb %.3155, %.3154 + %.3156 =l add %.2935, 100 + %.3157 =l extsw 0 + %.3158 =l sub %.3157, 1 + %.3159 =w copy %.3158 + storeb %.3159, %.3156 + %.3160 =l add %.2935, 101 + %.3161 =w copy 242 + storeb %.3161, %.3160 + %.3162 =l add %.2935, 102 + %.3163 =w copy 1 + storeb %.3163, %.3162 + %.3164 =l add %.2935, 103 + %.3165 =w copy 1 + storeb %.3165, %.3164 + %.3166 =l add %.2935, 104 + %.3167 =l extsw 0 + %.3168 =l sub %.3167, 1 + %.3169 =w copy %.3168 + storeb %.3169, %.3166 + %.3170 =l add %.2935, 105 + %.3171 =w copy 242 + storeb %.3171, %.3170 + %.3172 =l add %.2935, 106 + %.3173 =w copy 1 + storeb %.3173, %.3172 + %.3174 =l add %.2935, 107 + %.3175 =w copy 1 + storeb %.3175, %.3174 + %.3176 =l add %.2935, 108 + %.3177 =w copy 0 + storeb %.3177, %.3176 + %.3178 =l add %.2935, 109 + %.3179 =w copy 8 + storeb %.3179, %.3178 + %.3180 =l add %.2935, 110 + %.3181 =w copy 140 + storeb %.3181, %.3180 + %.3182 =l add %.2935, 111 + %.3183 =w copy 0 + storeb %.3183, %.3182 + %.3184 =l add %.2935, 112 + %.3185 =w copy 1 + storeb %.3185, %.3184 + %.3186 =l add %.2935, 113 + %.3187 =w copy 178 + storeb %.3187, %.3186 + %.3188 =l add %.2935, 114 + %.3189 =w copy 0 + storeb %.3189, %.3188 + %.3190 =l add %.2935, 115 + %.3191 =w copy 1 + storeb %.3191, %.3190 + %.3192 =l add %.2935, 116 + %.3193 =w copy 49 + storeb %.3193, %.3192 + %.3194 =l add %.2935, 117 + %.3195 =l extsw 0 + %.3196 =l sub %.3195, 8 + %.3197 =w copy %.3196 + storeb %.3197, %.3194 + %.3198 =l add %.2935, 118 + %.3199 =w copy 49 + storeb %.3199, %.3198 + %.3200 =l add %.2935, 119 + %.3201 =w copy 1 + storeb %.3201, %.3200 + %.3202 =l add %.2935, 120 + %.3203 =w copy 140 + storeb %.3203, %.3202 + %.3204 =l add %.2935, 121 + %.3205 =w copy 49 + storeb %.3205, %.3204 + %.3206 =l add %.2935, 122 + %.3207 =w copy 140 + storeb %.3207, %.3206 + %.3208 =l add %.2935, 123 + %.3209 =w copy 8 + storeb %.3209, %.3208 + %.3210 =l add %.2935, 124 + %.3211 =w copy 75 + storeb %.3211, %.3210 + %.3212 =l add %.2935, 125 + %.3213 =w copy 1 + storeb %.3213, %.3212 + %.3214 =l add %.2935, 126 + %.3215 =w copy 8 + storeb %.3215, %.3214 + %.3216 =l add %.2935, 127 + %.3217 =w copy 178 + storeb %.3217, %.3216 + %.3218 =l add %.2935, 128 + %.3219 =w copy 49 + storeb %.3219, %.3218 + %.3220 =l add %.2935, 129 + %.3221 =w copy 1 + storeb %.3221, %.3220 + %.3222 =l add %.2935, 130 + %.3223 =w copy 1 + storeb %.3223, %.3222 + %.3224 =l add %.2935, 131 + %.3225 =l extsw 0 + %.3226 =l sub %.3225, 1 + %.3227 =w copy %.3226 + storeb %.3227, %.3224 + %.3228 =l add %.2935, 132 + %.3229 =w copy 119 + storeb %.3229, %.3228 + %.3230 =l add %.2935, 133 + %.3231 =w copy 0 + storeb %.3231, %.3230 + %.3232 =l add %.2935, 134 + %.3233 =w copy 75 + storeb %.3233, %.3232 + %.3234 =l add %.2935, 135 + %.3235 =w copy 1 + storeb %.3235, %.3234 + %.3236 =l add %.2935, 136 + %.3237 =w copy 49 + storeb %.3237, %.3236 + %.3238 =l add %.2935, 137 + %.3239 =w copy 178 + storeb %.3239, %.3238 + %.3240 =l add %.2935, 138 + %.3241 =w copy 121 + storeb %.3241, %.3240 + %.3242 =l add %.2935, 139 + %.3243 =w copy 75 + storeb %.3243, %.3242 + %.3244 =l add %.2935, 140 + %.3245 =w copy 75 + storeb %.3245, %.3244 + %.3246 =l add %.2935, 141 + %.3247 =w copy 121 + storeb %.3247, %.3246 + %.3248 =l add %.2935, 142 + %.3249 =w copy 178 + storeb %.3249, %.3248 + %.3250 =l add %.2935, 143 + %.3251 =w copy 49 + storeb %.3251, %.3250 + %.3252 =l add %.2935, 144 + %.3253 =w copy 140 + storeb %.3253, %.3252 + %.3254 =l add %.2935, 145 + %.3255 =w copy 1 + storeb %.3255, %.3254 + %.3256 =l add %.2935, 146 + %.3257 =w copy 1 + storeb %.3257, %.3256 + %.3258 =l add %.2935, 147 + %.3259 =w copy 0 + storeb %.3259, %.3258 + %.3260 =l add %.2935, 148 + %.3261 =w copy 49 + storeb %.3261, %.3260 + %.3262 =l add %.2935, 149 + %.3263 =w copy 242 + storeb %.3263, %.3262 + %.3264 =l add %.2935, 150 + %.3265 =w copy 140 + storeb %.3265, %.3264 + %.3266 =l add %.2935, 151 + %.3267 =w copy 178 + storeb %.3267, %.3266 + %.3268 =l add %.2935, 152 + %.3269 =w copy 1 + storeb %.3269, %.3268 + %.3270 =l add %.2935, 153 + %.3271 =w copy 0 + storeb %.3271, %.3270 + %.3272 =l add %.2935, 154 + %.3273 =w copy 8 + storeb %.3273, %.3272 + %.3274 =l add %.2935, 155 + %.3275 =w copy 140 + storeb %.3275, %.3274 + %.3276 =l add %.2935, 156 + %.3277 =w copy 0 + storeb %.3277, %.3276 + %.3278 =l add %.2935, 157 + %.3279 =w copy 242 + storeb %.3279, %.3278 + %.3280 =l add %.2935, 158 + %.3281 =w copy 75 + storeb %.3281, %.3280 + %.3282 =l add %.2935, 159 + %.3283 =w copy 242 + storeb %.3283, %.3282 + %.3284 =l add %.2935, 160 + %.3285 =l extsw 0 + %.3286 =l sub %.3285, 1 + %.3287 =w copy %.3286 + storeb %.3287, %.3284 + %.3288 =l add %.2935, 161 + %.3289 =w copy 1 + storeb %.3289, %.3288 + %.3290 =l add %.2935, 162 + %.3291 =w copy 176 + storeb %.3291, %.3290 + %.3292 =l add %.2935, 163 + %.3293 =w copy 1 + storeb %.3293, %.3292 + %.3294 =l add %.2935, 164 + %.3295 =l extsw 0 + %.3296 =l sub %.3295, 1 + %.3297 =w copy %.3296 + storeb %.3297, %.3294 + %.3298 =l add %.2935, 165 + %.3299 =w copy 121 + storeb %.3299, %.3298 + %.3300 =l add %.2935, 166 + %.3301 =w copy 140 + storeb %.3301, %.3300 + %.3302 =l add %.2935, 167 + %.3303 =l extsw 0 + %.3304 =l sub %.3303, 1 + %.3305 =w copy %.3304 + storeb %.3305, %.3302 + %.3306 =l add %.2935, 168 + %.3307 =w copy 242 + storeb %.3307, %.3306 + %.3308 =l add %.2935, 169 + %.3309 =w copy 178 + storeb %.3309, %.3308 + %.3310 =l add %.2935, 170 + %.3311 =w copy 140 + storeb %.3311, %.3310 + %.3312 =l add %.2935, 171 + %.3313 =w copy 242 + storeb %.3313, %.3312 + %.3314 =l add %.2935, 172 + %.3315 =w copy 49 + storeb %.3315, %.3314 + %.3316 =l add %.2935, 173 + %.3317 =w copy 0 + storeb %.3317, %.3316 + %.3318 =l add %.2935, 174 + %.3319 =w copy 1 + storeb %.3319, %.3318 + %.3320 =l add %.2935, 175 + %.3321 =w copy 1 + storeb %.3321, %.3320 + %.3322 =l add %.2935, 176 + %.3323 =w copy 178 + storeb %.3323, %.3322 + %.3324 =l add %.2935, 177 + %.3325 =w copy 1 + storeb %.3325, %.3324 + %.3326 =l add %.2935, 178 + %.3327 =w copy 140 + storeb %.3327, %.3326 + %.3328 =l add %.2935, 179 + %.3329 =w copy 140 + storeb %.3329, %.3328 + %.3330 =l add %.2935, 180 + %.3331 =w copy 1 + storeb %.3331, %.3330 + %.3332 =l add %.2935, 181 + %.3333 =w copy 1 + storeb %.3333, %.3332 + %.3334 =l add %.2935, 182 + %.3335 =w copy 140 + storeb %.3335, %.3334 + %.3336 =l add %.2935, 183 + %.3337 =w copy 140 + storeb %.3337, %.3336 + %.3338 =l add %.2935, 184 + %.3339 =w copy 49 + storeb %.3339, %.3338 + %.3340 =l add %.2935, 185 + %.3341 =w copy 49 + storeb %.3341, %.3340 + %.3342 =l add %.2935, 186 + %.3343 =w copy 176 + storeb %.3343, %.3342 + %.3344 =l add %.2935, 187 + %.3345 =l extsw 0 + %.3346 =l sub %.3345, 1 + %.3347 =w copy %.3346 + storeb %.3347, %.3344 + %.3348 =l add %.2935, 188 + %.3349 =w copy 8 + storeb %.3349, %.3348 + %.3350 =l add %.2935, 189 + %.3351 =l extsw 0 + %.3352 =l sub %.3351, 8 + %.3353 =w copy %.3352 + storeb %.3353, %.3350 + %.3354 =l add %.2935, 190 + %.3355 =w copy 75 + storeb %.3355, %.3354 + %.3356 =l add %.2935, 191 + %.3357 =w copy 49 + storeb %.3357, %.3356 + %.3358 =l add %.2935, 192 + %.3359 =w copy 1 + storeb %.3359, %.3358 + %.3360 =l add %.2935, 193 + %.3361 =w copy 178 + storeb %.3361, %.3360 + %.3362 =l add %.2935, 194 + %.3363 =w copy 8 + storeb %.3363, %.3362 + %.3364 =l add %.2935, 195 + %.3365 =w copy 1 + storeb %.3365, %.3364 + %.3366 =l add %.2935, 196 + %.3367 =w copy 75 + storeb %.3367, %.3366 + %.3368 =l add %.2935, 197 + %.3369 =w copy 8 + storeb %.3369, %.3368 + %.3370 =l add %.2935, 198 + %.3371 =w copy 140 + storeb %.3371, %.3370 + %.3372 =l add %.2935, 199 + %.3373 =w copy 119 + storeb %.3373, %.3372 + %.3374 =l add %.2935, 200 + %.3375 =w copy 0 + storeb %.3375, %.3374 + %.3376 =l add %.2935, 201 + %.3377 =w copy 0 + storeb %.3377, %.3376 + %.3378 =l add %.2935, 202 + %.3379 =w copy 15 + storeb %.3379, %.3378 + %.3380 =l add %.2935, 203 + %.3381 =w copy 8 + storeb %.3381, %.3380 + %.3382 =l add %.2935, 204 + %.3383 =w copy 15 + storeb %.3383, %.3382 + %.3384 =l add %.2935, 205 + %.3385 =w copy 0 + storeb %.3385, %.3384 + %.3386 =l add %.2935, 206 + %.3387 =w copy 0 + storeb %.3387, %.3386 + %.3388 =l add %.2935, 207 + %.3389 =l extsw 0 + %.3390 =l sub %.3389, 8 + %.3391 =w copy %.3390 + storeb %.3391, %.3388 + %.3392 =l add %.2935, 208 + %.3393 =w copy 140 + storeb %.3393, %.3392 + %.3394 =l add %.2935, 209 + %.3395 =w copy 8 + storeb %.3395, %.3394 + %.3396 =l add %.2935, 210 + %.3397 =w copy 75 + storeb %.3397, %.3396 + %.3398 =l add %.2935, 211 + %.3399 =w copy 1 + storeb %.3399, %.3398 + %.3400 =l add %.2935, 212 + %.3401 =w copy 8 + storeb %.3401, %.3400 + %.3402 =l add %.2935, 213 + %.3403 =w copy 178 + storeb %.3403, %.3402 + %.3404 =l add %.2935, 214 + %.3405 =w copy 1 + storeb %.3405, %.3404 + %.3406 =l add %.2935, 215 + %.3407 =w copy 140 + storeb %.3407, %.3406 + %.3408 =l add %.2935, 216 + %.3409 =w copy 121 + storeb %.3409, %.3408 + %.3410 =l add %.2935, 217 + %.3411 =w copy 140 + storeb %.3411, %.3410 + %.3412 =l add %.2935, 218 + %.3413 =l extsw 0 + %.3414 =l sub %.3413, 1 + %.3415 =w copy %.3414 + storeb %.3415, %.3412 + %.3416 =l add %.2935, 219 + %.3417 =w copy 0 + storeb %.3417, %.3416 + %.3418 =l add %.2935, 220 + %.3419 =w copy 8 + storeb %.3419, %.3418 + %.3420 =l add %.2935, 221 + %.3421 =w copy 176 + storeb %.3421, %.3420 + %.3422 =l add %.2935, 222 + %.3423 =w copy 176 + storeb %.3423, %.3422 + %.3424 =l add %.2935, 223 + %.3425 =w copy 8 + storeb %.3425, %.3424 + %.3426 =l add %.2935, 224 + %.3427 =w copy 140 + storeb %.3427, %.3426 + %.3428 =l add %.2935, 225 + %.3429 =l extsw 0 + %.3430 =l sub %.3429, 8 + %.3431 =w copy %.3430 + storeb %.3431, %.3428 + %.3432 =l add %.2935, 226 + %.3433 =l extsw 0 + %.3434 =l sub %.3433, 8 + %.3435 =w copy %.3434 + storeb %.3435, %.3432 + %.3436 =l add %.2935, 227 + %.3437 =w copy 140 + storeb %.3437, %.3436 + %.3438 =l add %.2935, 228 + %.3439 =w copy 15 + storeb %.3439, %.3438 + %.3440 =l add %.2935, 229 + %.3441 =w copy 121 + storeb %.3441, %.3440 + %.3442 =l add %.2935, 230 + %.3443 =w copy 119 + storeb %.3443, %.3442 + %.3444 =l add %.2935, 231 + %.3445 =w copy 0 + storeb %.3445, %.3444 + %.3446 =l add %.2935, 232 + %.3447 =w copy 0 + storeb %.3447, %.3446 + %.3448 =l add %.2935, 233 + %.3449 =w copy 119 + storeb %.3449, %.3448 + %.3450 =l add %.2935, 234 + %.3451 =l extsw 0 + %.3452 =l sub %.3451, 1 + %.3453 =w copy %.3452 + storeb %.3453, %.3450 + %.3454 =l add %.2935, 235 + %.3455 =w copy 1 + storeb %.3455, %.3454 + %.3456 =l add %.2935, 236 + %.3457 =w copy 1 + storeb %.3457, %.3456 + %.3458 =l add %.2935, 237 + %.3459 =w copy 49 + storeb %.3459, %.3458 + %.3460 =l add %.2935, 238 + %.3461 =w copy 1 + storeb %.3461, %.3460 + %.3462 =l add %.2935, 239 + %.3463 =w copy 0 + storeb %.3463, %.3462 + %.3465 =l add %.3464, 0 + %.3466 =l extsw 0 + %.3467 =l copy %.3466 + storel %.3467, %.3465 + %.3469 =l add %.3468, 0 + storel $g_80, %.3469 + %.3473 =l loadl $g_38 + %.3474 =l loadl %.3473 + %.3475 =w loadsw %.3474 + storew %.3475, %.2122 + %.3476 =w loaduw %.4 + %.3477 =w cnew %.3476, 0 + jnz %.3477, @logic_right.1256, @logic_join.1257 +@logic_right.1256 + %.3478 =w loadub %.6 + %.3479 =w extub %.3478 + %.3480 =l extsw 2 + %.3481 =l mul %.3480, 1 + %.3482 =l add $g_132, %.3481 + %.3483 =w loadsb %.3482 + %.3484 =w extsb %.3483 + %.3485 =w csgew %.3479, %.3484 + %.3486 =w cnew %.3485, 0 +@logic_join.1257 + %.3487 =w phi @for_body.1253 %.3477, @logic_right.1256 %.3486 + %.3488 =w copy %.3487 + %.3489 =w loadsw %.2122 + %.3490 =l extsw %.3489 + %.3491 =w cugel %.3490, 1 + %.3492 =w copy %.3491 + %.3493 =w call $safe_add_func_uint32_t_u_u(w %.3488, w %.3492) + %.3494 =w copy %.3493 + storew %.3494, %.2125 + %.3495 =w cnew %.3494, 0 + jnz %.3495, @if_true.1258, @if_false.1259 +@if_true.1258 + %.3497 =l add %.3496, 0 + storel %.248, %.3497 + %.3499 =l add %.3498, 0 + %.3500 =w copy 0 + storew %.3500, %.3499 + %.3501 =l add %.3498, 4 + %.3502 =w copy 535778462 + storew %.3502, %.3501 + %.3503 =l add %.3498, 8 + %.3504 =l extsw 0 + %.3505 =l sub %.3504, 1 + %.3506 =w copy %.3505 + storew %.3506, %.3503 + %.3507 =l add %.3498, 12 + %.3508 =w copy 0 + storew %.3508, %.3507 + %.3509 =l add %.3498, 16 + %.3510 =l extsw 0 + %.3511 =l sub %.3510, 10 + %.3512 =w copy %.3511 + storew %.3512, %.3509 + %.3513 =l add %.3498, 20 + %.3514 =w copy 4237820494 + storew %.3514, %.3513 + %.3515 =l add %.3498, 24 + %.3516 =w copy 0 + storew %.3516, %.3515 + %.3517 =l add %.3498, 28 + %.3518 =w copy 4237820494 + storew %.3518, %.3517 + %.3519 =l add %.3498, 32 + %.3520 =l extsw 0 + %.3521 =l sub %.3520, 10 + %.3522 =w copy %.3521 + storew %.3522, %.3519 + %.3523 =l add %.3498, 36 + %.3524 =w copy 0 + storew %.3524, %.3523 + %.3525 =l add %.3498, 40 + %.3526 =l extsw 0 + %.3527 =l sub %.3526, 1 + %.3528 =w copy %.3527 + storew %.3528, %.3525 + %.3529 =l add %.3498, 44 + %.3530 =w copy 535778462 + storew %.3530, %.3529 + %.3531 =l add %.3498, 48 + %.3532 =w copy 0 + storew %.3532, %.3531 + %.3533 =l add %.3498, 52 + %.3534 =w copy 919506955 + storew %.3534, %.3533 + %.3535 =l add %.3498, 56 + %.3536 =w copy 430035244 + storew %.3536, %.3535 + %.3537 =l add %.3498, 60 + %.3538 =w copy 0 + storew %.3538, %.3537 + %.3539 =l add %.3498, 64 + %.3540 =w copy 430035244 + storew %.3540, %.3539 + %.3541 =l add %.3498, 68 + %.3542 =w copy 919506955 + storew %.3542, %.3541 + %.3543 =l add %.3498, 72 + %.3544 =w copy 0 + storew %.3544, %.3543 + %.3545 =l add %.3498, 76 + %.3546 =w copy 535778462 + storew %.3546, %.3545 + %.3547 =l add %.3498, 80 + %.3548 =l extsw 0 + %.3549 =l sub %.3548, 1 + %.3550 =w copy %.3549 + storew %.3550, %.3547 + %.3551 =l add %.3498, 84 + %.3552 =w copy 0 + storew %.3552, %.3551 + %.3553 =l add %.3498, 88 + %.3554 =l extsw 0 + %.3555 =l sub %.3554, 10 + %.3556 =w copy %.3555 + storew %.3556, %.3553 + %.3557 =l add %.3498, 92 + %.3558 =w copy 4237820494 + storew %.3558, %.3557 + %.3559 =l add %.3498, 96 + %.3560 =w copy 0 + storew %.3560, %.3559 + %.3561 =l add %.3498, 100 + %.3562 =w copy 4237820494 + storew %.3562, %.3561 + %.3563 =l add %.3498, 104 + %.3564 =l extsw 0 + %.3565 =l sub %.3564, 10 + %.3566 =w copy %.3565 + storew %.3566, %.3563 + %.3567 =l add %.3498, 108 + %.3568 =w copy 0 + storew %.3568, %.3567 + %.3569 =l add %.3498, 112 + %.3570 =l extsw 0 + %.3571 =l sub %.3570, 1 + %.3572 =w copy %.3571 + storew %.3572, %.3569 + %.3573 =l add %.3498, 116 + %.3574 =w copy 535778462 + storew %.3574, %.3573 + %.3575 =l add %.3498, 120 + %.3576 =w copy 0 + storew %.3576, %.3575 + %.3577 =l add %.3498, 124 + %.3578 =w copy 919506955 + storew %.3578, %.3577 + %.3579 =l add %.3498, 128 + %.3580 =w copy 430035244 + storew %.3580, %.3579 + %.3581 =l add %.3498, 132 + %.3582 =w copy 0 + storew %.3582, %.3581 + %.3583 =l add %.3498, 136 + %.3584 =w copy 430035244 + storew %.3584, %.3583 + %.3585 =l add %.3498, 140 + %.3586 =w copy 919506955 + storew %.3586, %.3585 + %.3587 =l add %.3498, 144 + %.3588 =w copy 0 + storew %.3588, %.3587 + %.3589 =l add %.3498, 148 + %.3590 =w copy 535778462 + storew %.3590, %.3589 + %.3591 =l add %.3498, 152 + %.3592 =l extsw 0 + %.3593 =l sub %.3592, 1 + %.3594 =w copy %.3593 + storew %.3594, %.3591 + %.3595 =l add %.3498, 156 + %.3596 =w copy 0 + storew %.3596, %.3595 + %.3597 =l add %.3498, 160 + %.3598 =l extsw 0 + %.3599 =l sub %.3598, 10 + %.3600 =w copy %.3599 + storew %.3600, %.3597 + %.3601 =l add %.3498, 164 + %.3602 =w copy 4237820494 + storew %.3602, %.3601 + %.3603 =l add %.3498, 168 + %.3604 =w copy 0 + storew %.3604, %.3603 + %.3605 =l add %.3498, 172 + %.3606 =w copy 4237820494 + storew %.3606, %.3605 + %.3607 =l add %.3498, 176 + %.3608 =l extsw 0 + %.3609 =l sub %.3608, 10 + %.3610 =w copy %.3609 + storew %.3610, %.3607 + %.3611 =l add %.3498, 180 + %.3612 =w copy 0 + storew %.3612, %.3611 + %.3613 =l add %.3498, 184 + %.3614 =l extsw 0 + %.3615 =l sub %.3614, 1 + %.3616 =w copy %.3615 + storew %.3616, %.3613 + %.3617 =l add %.3498, 188 + %.3618 =w copy 535778462 + storew %.3618, %.3617 + %.3619 =l add %.3498, 192 + %.3620 =w copy 0 + storew %.3620, %.3619 + %.3621 =l add %.3498, 196 + %.3622 =w copy 919506955 + storew %.3622, %.3621 + %.3623 =l add %.3498, 200 + %.3624 =w copy 430035244 + storew %.3624, %.3623 + %.3625 =l add %.3498, 204 + %.3626 =w copy 0 + storew %.3626, %.3625 + %.3627 =l add %.3498, 208 + %.3628 =w copy 430035244 + storew %.3628, %.3627 + %.3629 =l add %.3498, 212 + %.3630 =w copy 919506955 + storew %.3630, %.3629 + %.3631 =l add %.3498, 216 + %.3632 =w copy 0 + storew %.3632, %.3631 + %.3633 =l add %.3498, 220 + %.3634 =w copy 535778462 + storew %.3634, %.3633 + %.3635 =l add %.3498, 224 + %.3636 =l extsw 0 + %.3637 =l sub %.3636, 1 + %.3638 =w copy %.3637 + storew %.3638, %.3635 + %.3639 =l add %.3498, 228 + %.3640 =w copy 0 + storew %.3640, %.3639 + %.3641 =l add %.3498, 232 + %.3642 =l extsw 0 + %.3643 =l sub %.3642, 10 + %.3644 =w copy %.3643 + storew %.3644, %.3641 + %.3645 =l add %.3498, 236 + %.3646 =w copy 4237820494 + storew %.3646, %.3645 + %.3647 =l add %.3498, 240 + %.3648 =w copy 0 + storew %.3648, %.3647 + %.3649 =l add %.3498, 244 + %.3650 =w copy 4237820494 + storew %.3650, %.3649 + %.3651 =l add %.3498, 248 + %.3652 =l extsw 0 + %.3653 =l sub %.3652, 10 + %.3654 =w copy %.3653 + storew %.3654, %.3651 + %.3655 =l add %.3498, 252 + %.3656 =w copy 0 + storew %.3656, %.3655 + %.3657 =l add %.3498, 256 + %.3658 =l extsw 0 + %.3659 =l sub %.3658, 1 + %.3660 =w copy %.3659 + storew %.3660, %.3657 + %.3661 =l add %.3498, 260 + %.3662 =w copy 535778462 + storew %.3662, %.3661 + %.3663 =l add %.3498, 264 + %.3664 =w copy 0 + storew %.3664, %.3663 + %.3665 =l add %.3498, 268 + %.3666 =w copy 919506955 + storew %.3666, %.3665 + %.3667 =l add %.3498, 272 + %.3668 =w copy 430035244 + storew %.3668, %.3667 + %.3669 =l add %.3498, 276 + %.3670 =w copy 0 + storew %.3670, %.3669 + %.3671 =l add %.3498, 280 + %.3672 =w copy 430035244 + storew %.3672, %.3671 + %.3673 =l add %.3498, 284 + %.3674 =w copy 919506955 + storew %.3674, %.3673 + %.3675 =l add %.3498, 288 + %.3676 =w copy 0 + storew %.3676, %.3675 + %.3677 =l add %.3498, 292 + %.3678 =w copy 535778462 + storew %.3678, %.3677 + %.3679 =l add %.3498, 296 + %.3680 =l extsw 0 + %.3681 =l sub %.3680, 1 + %.3682 =w copy %.3681 + storew %.3682, %.3679 + %.3683 =l add %.3498, 300 + %.3684 =w copy 0 + storew %.3684, %.3683 + %.3685 =l add %.3498, 304 + %.3686 =l extsw 0 + %.3687 =l sub %.3686, 10 + %.3688 =w copy %.3687 + storew %.3688, %.3685 + %.3689 =l add %.3498, 308 + %.3690 =w copy 4237820494 + storew %.3690, %.3689 + %.3691 =l add %.3498, 312 + %.3692 =w copy 0 + storew %.3692, %.3691 + %.3693 =l add %.3498, 316 + %.3694 =w copy 4237820494 + storew %.3694, %.3693 + %.3695 =l add %.3498, 320 + %.3696 =l extsw 0 + %.3697 =l sub %.3696, 10 + %.3698 =w copy %.3697 + storew %.3698, %.3695 + %.3700 =l add %.3699, 0 + %.3701 =l extsw 4 + %.3702 =l mul %.3701, 1 + %.3703 =l add $g_132, %.3702 + storel %.3703, %.3700 + %.3704 =l add %.3699, 8 + %.3705 =l extsw 0 + %.3706 =l copy %.3705 + storel %.3706, %.3704 + %.3707 =l add %.3699, 16 + %.3708 =l extsw 2 + %.3709 =l mul %.3708, 1 + %.3710 =l add $g_132, %.3709 + storel %.3710, %.3707 + %.3711 =l add %.3699, 24 + %.3712 =l extsw 0 + %.3713 =l copy %.3712 + storel %.3713, %.3711 + %.3714 =l add %.3699, 32 + %.3715 =l extsw 4 + %.3716 =l mul %.3715, 1 + %.3717 =l add $g_132, %.3716 + storel %.3717, %.3714 + %.3718 =l add %.3699, 40 + %.3719 =l extsw 0 + %.3720 =l copy %.3719 + storel %.3720, %.3718 + %.3721 =l add %.3699, 48 + %.3722 =l extsw 2 + %.3723 =l mul %.3722, 1 + %.3724 =l add $g_132, %.3723 + storel %.3724, %.3721 + %.3725 =l add %.3699, 56 + %.3726 =l extsw 0 + %.3727 =l copy %.3726 + storel %.3727, %.3725 + %.3728 =l add %.3699, 64 + %.3729 =l extsw 4 + %.3730 =l mul %.3729, 1 + %.3731 =l add $g_132, %.3730 + storel %.3731, %.3728 + %.3732 =l add %.3699, 72 + %.3733 =l extsw 0 + %.3734 =l copy %.3733 + storel %.3734, %.3732 + %.3735 =l add %.3699, 80 + %.3736 =l extsw 2 + %.3737 =l mul %.3736, 1 + %.3738 =l add $g_132, %.3737 + storel %.3738, %.3735 + %.3739 =l add %.3699, 88 + %.3740 =l extsw 0 + %.3741 =l copy %.3740 + storel %.3741, %.3739 + %.3742 =l add %.3699, 96 + %.3743 =l extsw 4 + %.3744 =l mul %.3743, 1 + %.3745 =l add $g_132, %.3744 + storel %.3745, %.3742 + %.3746 =l add %.3699, 104 + %.3747 =l extsw 0 + %.3748 =l copy %.3747 + storel %.3748, %.3746 + %.3749 =l add %.3699, 112 + %.3750 =l extsw 2 + %.3751 =l mul %.3750, 1 + %.3752 =l add $g_132, %.3751 + storel %.3752, %.3749 + %.3753 =l add %.3699, 120 + %.3754 =l extsw 0 + %.3755 =l copy %.3754 + storel %.3755, %.3753 + %.3756 =l add %.3699, 128 + %.3757 =l extsw 4 + %.3758 =l mul %.3757, 1 + %.3759 =l add $g_132, %.3758 + storel %.3759, %.3756 + %.3760 =l add %.3699, 136 + %.3761 =l extsw 0 + %.3762 =l copy %.3761 + storel %.3762, %.3760 + %.3763 =l add %.3699, 144 + %.3764 =l extsw 2 + %.3765 =l mul %.3764, 1 + %.3766 =l add $g_132, %.3765 + storel %.3766, %.3763 + %.3767 =l add %.3699, 152 + %.3768 =l extsw 0 + %.3769 =l copy %.3768 + storel %.3769, %.3767 + %.3770 =l add %.3699, 160 + %.3771 =l extsw 4 + %.3772 =l mul %.3771, 1 + %.3773 =l add $g_132, %.3772 + storel %.3773, %.3770 + %.3774 =l add %.3699, 168 + %.3775 =l extsw 0 + %.3776 =l copy %.3775 + storel %.3776, %.3774 + %.3777 =l add %.3699, 176 + %.3778 =l extsw 2 + %.3779 =l mul %.3778, 1 + %.3780 =l add $g_132, %.3779 + storel %.3780, %.3777 + %.3781 =l add %.3699, 184 + %.3782 =l extsw 0 + %.3783 =l copy %.3782 + storel %.3783, %.3781 + %.3784 =l add %.3699, 192 + %.3785 =l extsw 4 + %.3786 =l mul %.3785, 1 + %.3787 =l add $g_132, %.3786 + storel %.3787, %.3784 + %.3788 =l add %.3699, 200 + %.3789 =l extsw 0 + %.3790 =l copy %.3789 + storel %.3790, %.3788 + %.3791 =l add %.3699, 208 + %.3792 =l extsw 2 + %.3793 =l mul %.3792, 1 + %.3794 =l add $g_132, %.3793 + storel %.3794, %.3791 + %.3795 =l add %.3699, 216 + %.3796 =l extsw 0 + %.3797 =l copy %.3796 + storel %.3797, %.3795 + %.3798 =l add %.3699, 224 + %.3799 =l extsw 4 + %.3800 =l mul %.3799, 1 + %.3801 =l add $g_132, %.3800 + storel %.3801, %.3798 + %.3802 =l add %.3699, 232 + %.3803 =l extsw 0 + %.3804 =l copy %.3803 + storel %.3804, %.3802 + %.3805 =l add %.3699, 240 + %.3806 =l extsw 2 + %.3807 =l mul %.3806, 1 + %.3808 =l add $g_132, %.3807 + storel %.3808, %.3805 + %.3809 =l add %.3699, 248 + %.3810 =l extsw 0 + %.3811 =l copy %.3810 + storel %.3811, %.3809 + %.3812 =l add %.3699, 256 + %.3813 =l extsw 4 + %.3814 =l mul %.3813, 1 + %.3815 =l add $g_132, %.3814 + storel %.3815, %.3812 + %.3816 =l add %.3699, 264 + %.3817 =l extsw 0 + %.3818 =l copy %.3817 + storel %.3818, %.3816 + %.3819 =l add %.3699, 272 + %.3820 =l extsw 2 + %.3821 =l mul %.3820, 1 + %.3822 =l add $g_132, %.3821 + storel %.3822, %.3819 + %.3823 =l add %.3699, 280 + %.3824 =l extsw 0 + %.3825 =l copy %.3824 + storel %.3825, %.3823 + %.3826 =l add %.3699, 288 + %.3827 =l extsw 4 + %.3828 =l mul %.3827, 1 + %.3829 =l add $g_132, %.3828 + storel %.3829, %.3826 + %.3830 =l add %.3699, 296 + %.3831 =l extsw 0 + %.3832 =l copy %.3831 + storel %.3832, %.3830 + %.3833 =l add %.3699, 304 + %.3834 =l extsw 2 + %.3835 =l mul %.3834, 1 + %.3836 =l add $g_132, %.3835 + storel %.3836, %.3833 + %.3837 =l add %.3699, 312 + %.3838 =l extsw 0 + %.3839 =l copy %.3838 + storel %.3839, %.3837 + %.3841 =l add %.3840, 0 + %.3842 =l extsw 0 + %.3843 =l copy %.3842 + storel %.3843, %.3841 + %.3845 =l add %.3844, 0 + %.3846 =l extsw 0 + %.3847 =l copy %.3846 + storel %.3847, %.3845 + %.3849 =l add %.3848, 0 + storel $g_46, %.3849 + %.3851 =l add %.3850, 0 + storel $g_57, %.3851 + %.3852 =l add %.3850, 8 + storel $g_57, %.3852 + %.3853 =l add %.3850, 16 + storel $g_57, %.3853 + %.3854 =l add %.3850, 24 + storel $g_57, %.3854 + %.3855 =l add %.3850, 32 + storel $g_57, %.3855 + %.3856 =l add %.3850, 40 + storel $g_57, %.3856 + %.3857 =l add %.3850, 48 + storel $g_57, %.3857 + %.3858 =l add %.3850, 56 + storel $g_57, %.3858 + %.3860 =l add %.3859, 0 + storel $g_84, %.3860 + %.3862 =l add %.3861, 0 + %.3863 =l extsw 0 + %.3864 =l copy %.3863 + storel %.3864, %.3862 + %.3866 =l add %.3865, 0 + %.3867 =l extsw 0 + %.3868 =l copy %.3867 + storel %.3868, %.3866 + %.3870 =l add %.3869, 0 + %.3871 =w copy 1589124801 + storew %.3871, %.3870 + %.3873 =l add %.3872, 0 + %.3874 =l copy $g_185 + %.3875 =l mul 24, 1 + %.3876 =l add %.3874, %.3875 + %.3877 =l copy %.3876 + storel %.3877, %.3873 + %.3879 =l add %.3878, 0 + storel $g_265, %.3879 + %.3881 =l add %.3880, 0 + %.3882 =w copy 1 + storeb %.3882, %.3881 + %.3884 =l add %.3883, 0 + storel $g_296, %.3884 + %.3886 =l add %.3885, 0 + %.3887 =w copy 2320921989 + storew %.3887, %.3886 + %.3891 =l loadl %.2 + storel %.3891, %.2 + %.3892 =l loadl %.3496 + storel $g_46, %.3892 + %.3893 =l extsw 6 + %.3894 =l mul %.3893, 36 + %.3895 =l add %.3498, %.3894 + %.3896 =l extsw 6 + %.3897 =l mul %.3896, 4 + %.3898 =l add %.3895, %.3897 + %.3899 =l extsw 0 + %.3900 =l mul %.3899, 4 + %.3901 =l add %.3898, %.3900 + %.3902 =w loadsw %.3901 + %.3903 =l extsw 0 + %.3904 =l extsw 4 + %.3905 =l mul %.3904, 64 + %.3906 =l add %.3699, %.3905 + %.3907 =l extsw 3 + %.3908 =l mul %.3907, 16 + %.3909 =l add %.3906, %.3908 + %.3910 =l extsw 0 + %.3911 =l mul %.3910, 8 + %.3912 =l add %.3909, %.3911 + %.3913 =l loadl %.3912 + %.3914 =w cnel %.3903, %.3913 + %.3915 =w copy %.3914 + %.3916 =l loadl %.3848 + storeb %.3915, %.3916 + %.3917 =w loadub $g_57 + %.3918 =w add %.3917, 1 + storeb %.3918, $g_57 + %.3919 =w call $safe_add_func_uint8_t_u_u(w %.3915, w %.3918) + %.3920 =w extub %.3919 + %.3921 =w ceqw %.3920, 0 + %.3922 =w cnew %.3902, %.3921 + %.3923 =w copy %.3922 + %.3924 =l loadl %.3859 + storew %.3923, %.3924 + %.3925 =w loadsb %.2872 + %.3926 =w extsb %.3925 + %.3927 =w call $safe_div_func_uint32_t_u_u(w %.3923, w %.3926) + %.3928 =w copy %.3927 + %.3929 =l extsw 3 + %.3930 =l mul %.3929, 36 + %.3931 =l add %.3498, %.3930 + %.3932 =l extsw 4 + %.3933 =l mul %.3932, 4 + %.3934 =l add %.3931, %.3933 + %.3935 =l extsw 0 + %.3936 =l mul %.3935, 4 + %.3937 =l add %.3934, %.3936 + %.3938 =w loadsw %.3937 + %.3939 =w loadsw %.2122 + %.3940 =w copy %.3939 + %.3941 =w copy 2 + %.3942 =w call $safe_rshift_func_uint8_t_u_u(w %.3940, w %.3941) + %.3943 =w extub %.3942 + %.3944 =l loadl $g_88 + %.3945 =l loadl %.3944 + %.3946 =l loadl %.2128 + %.3947 =l extsw 0 + %.3948 =l mul %.3947, 8 + %.3949 =l add $g_172, %.3948 + storel %.3946, %.3949 + %.3950 =w ceql %.3945, %.3946 + %.3951 =l extsw %.3950 + %.3952 =l loadl $g_58 + %.3953 =w cnel %.3951, %.3952 + %.3954 =w copy %.3953 + %.3955 =w loaduw %.4 + %.3956 =w copy %.3955 + %.3957 =w call $safe_div_func_int16_t_s_s(w %.3954, w %.3956) + %.3958 =w extsh %.3957 + %.3959 =w csgtw %.3943, %.3958 + %.3960 =w csgew %.3938, %.3959 + %.3961 =w copy %.3960 + %.3962 =w copy 7 + %.3963 =w call $safe_lshift_func_int16_t_s_u(w %.3961, w %.3962) + %.3964 =l extsh %.3963 + %.3965 =l extsw 0 + %.3966 =l sub %.3965, 1 + %.3967 =l and %.3964, %.3966 + %.3968 =w loadsb %.2872 + %.3969 =l extsb %.3968 + %.3970 =w cnel %.3967, %.3969 + %.3971 =l extsw %.3970 + %.3972 =w loadsb $g_2 + %.3973 =l extsb %.3972 + %.3974 =l call $safe_add_func_uint64_t_u_u(l %.3971, l %.3973) + %.3975 =l copy $g_130 + %.3976 =l mul 8, 1 + %.3977 =l add %.3975, %.3976 + %.3978 =l copy %.3977 + %.3979 =w loadsh %.3978 + %.3980 =l extsh %.3979 + %.3981 =l and %.3974, %.3980 + %.3982 =l extsw 1 + %.3983 =l mul %.3982, 1 + %.3984 =l add $g_132, %.3983 + %.3985 =w loadsb %.3984 + %.3986 =l extsb %.3985 + %.3987 =l or %.3981, %.3986 + %.3988 =w copy %.3987 + %.3989 =w call $safe_rshift_func_uint16_t_u_s(w %.3928, w %.3988) + %.3990 =l loadl %.3865 + %.3991 =l loadl $g_88 + %.3992 =l loadl %.3991 + %.3993 =l loadl %.3992 + %.3994 =w ceql %.3990, %.3993 + %.3995 =w cnew %.3994, 0 + jnz %.3995, @logic_right.1260, @logic_join.1261 +@logic_right.1260 + %.3996 =w loadub %.6 + %.3997 =w extub %.3996 + %.3998 =w cnew %.3997, 0 +@logic_join.1261 + %.3999 =w phi @if_true.1258 %.3995, @logic_right.1260 %.3998 + %.4000 =l copy $g_130 + %.4001 =l mul 0, 1 + %.4002 =l add %.4000, %.4001 + %.4003 =l copy %.4002 + %.4004 =w loadsw %.4003 + %.4005 =w csgew %.3999, %.4004 + %.4006 =w loadub %.6 + %.4007 =w extub %.4006 + %.4008 =w ceqw %.4005, %.4007 + %.4009 =l extsw %.4008 + %.4010 =w loadsb $g_2 + %.4011 =l extsb %.4010 + %.4012 =l call $safe_mod_func_uint64_t_u_u(l %.4009, l %.4011) + %.4013 =w loaduw %.4 + %.4014 =l extuw %.4013 + %.4015 =w cugtl %.4012, %.4014 + %.4016 =l extsw %.4015 + %.4017 =l or %.4016, 0 + %.4018 =l copy 4143169914 + %.4019 =l or %.4017, %.4018 + %.4020 =w copy %.4019 + %.4021 =w call $safe_unary_minus_func_uint16_t_u(w %.4020) + %.4022 =w copy 10535 + %.4023 =w copy 1 + %.4024 =w call $safe_lshift_func_int16_t_s_u(w %.4022, w %.4023) + %.4025 =w ceql $g_46, $g_46 + %.4026 =w loadub %.6 + %.4027 =l loadl %.2128 + %.4028 =l loadl %.4027 + %.4029 =w loadsw %.4028 + %.4030 =w cnew %.4029, 0 + jnz %.4030, @if_true.1262, @if_false.1263 +@if_true.1262 + %.4032 =l add %.4031, 0 + storel $g_185, %.4032 + %.4033 =l add %.4031, 8 + storel $g_185, %.4033 + %.4034 =l add %.4031, 16 + storel $g_185, %.4034 + %.4035 =l add %.4031, 24 + storel $g_185, %.4035 + %.4036 =l add %.4031, 32 + storel $g_185, %.4036 + %.4037 =l add %.4031, 40 + storel $g_185, %.4037 + %.4039 =l add %.4038, 0 + %.4040 =l copy 1 + storel %.4040, %.4039 + %.4042 =l add %.4041, 0 + storel %.2875, %.4042 + %.4044 =l add %.4043, 0 + %.4045 =l extsw 3 + %.4046 =l mul %.4045, 360 + %.4047 =l add %.250, %.4046 + %.4048 =l extsw 1 + %.4049 =l mul %.4048, 120 + %.4050 =l add %.4047, %.4049 + %.4051 =l extsw 4 + %.4052 =l mul %.4051, 20 + %.4053 =l add %.4050, %.4052 + storel %.4053, %.4044 + %.4055 =l add %.4054, 0 + %.4056 =l extsw 0 + %.4057 =l copy %.4056 + storel %.4057, %.4055 + %.4058 =l add %.4054, 8 + storel %.4043, %.4058 + %.4059 =l add %.4054, 16 + %.4060 =l extsw 0 + %.4061 =l copy %.4060 + storel %.4061, %.4059 + %.4062 =l add %.4054, 24 + %.4063 =l extsw 0 + %.4064 =l copy %.4063 + storel %.4064, %.4062 + %.4065 =l add %.4054, 32 + storel %.4043, %.4065 + %.4066 =l add %.4054, 40 + %.4067 =l extsw 0 + %.4068 =l copy %.4067 + storel %.4068, %.4066 + %.4071 =l extsw 0 + %.4072 =w cnel %.4071, %.248 + %.4073 =l loadl %.2 + %.4074 =w loadsw %.4073 + %.4075 =l loadl $g_88 + %.4076 =l loadl %.4075 + %.4077 =l loadl %.4076 + %.4078 =w loadsw %.4077 + %.4079 =l loadl %.2 + %.4080 =w loadsw %.4079 + %.4081 =w call $safe_sub_func_int32_t_s_s(w %.4078, w %.4080) + %.4082 =w csgtw %.4074, %.4081 + %.4083 =w copy %.4082 + %.4084 =w loaduw %.4 + %.4085 =w culew %.4083, %.4084 + %.4086 =l xor 155, 18446744073709551615 + %.4087 =w cnel %.4086, 0 + jnz %.4087, @logic_right.1264, @logic_join.1265 +@logic_right.1264 + %.4088 =l loadl %.3496 + %.4089 =l loadl %.4088 + %.4090 =w loadub %.4089 + %.4091 =w sub %.4090, 1 + storeb %.4091, %.4089 + %.4092 =l extsw 4 + %.4093 =l mul %.4092, 1 + %.4094 =l add $g_132, %.4093 + %.4095 =w loadsb %.4094 + %.4096 =w copy %.4095 + %.4097 =w call $safe_sub_func_uint8_t_u_u(w %.4091, w %.4096) + %.4098 =w extub %.4097 + %.4099 =w cnew %.4098, 0 +@logic_join.1265 + %.4100 =w phi @if_true.1262 %.4087, @logic_right.1264 %.4099 + %.4101 =l extsw 4 + %.4102 =l mul %.4101, 1 + %.4103 =l add $g_132, %.4102 + %.4104 =w loadsb %.4103 + %.4105 =w copy %.4104 + %.4106 =w loadub %.6 + %.4107 =w extub %.4106 + %.4108 =w call $safe_lshift_func_uint8_t_u_u(w %.4105, w %.4107) + %.4109 =w extub %.4108 + %.4110 =w csgew %.4100, %.4109 + %.4111 =w ceqw %.4085, %.4110 + %.4112 =w cnew %.4111, 0 + jnz %.4112, @if_true.1266, @if_false.1267 +@if_true.1266 + %.4114 =l add %.4113, 0 + storel $g_185, %.4114 + %.4116 =l add %.4115, 0 + storel %.4113, %.4116 + %.4118 =l add %.4117, 0 + %.4119 =w copy 2 + storew %.4119, %.4118 + %.4121 =l add %.4120, 0 + %.4122 =l copy $g_185 + %.4123 =l mul 8, 1 + %.4124 =l add %.4122, %.4123 + %.4125 =l copy %.4124 + storel %.4125, %.4121 + %.4127 =l add %.4126, 0 + %.4128 =l copy 1 + storel %.4128, %.4127 + %.4129 =l loadl %.4113 + %.4130 =l loadl %.4115 + storel %.4129, %.4130 + storel %.4129, %.2130 + %.4131 =l loadl $g_173 + %.4132 =w loadsw %.4131 + %.4133 =l extsw %.4132 + %.4134 =w loadsw %.4117 + %.4135 =l extsw %.4134 + %.4136 =l copy 1533123651342385939 + %.4137 =l copy $g_185 + %.4138 =l mul 24, 1 + %.4139 =l add %.4137, %.4138 + %.4140 =l copy %.4139 + storel %.4136, %.4140 + %.4141 =l copy %.4136 + %.4142 =l call $safe_sub_func_int64_t_s_s(l 8436840764840713857, l %.4141) + %.4143 =l or %.4135, %.4142 + %.4144 =l or %.4133, %.4143 + %.4145 =w copy %.4144 + storew %.4145, %.4131 + %.4146 =l loadl $g_173 + %.4147 =w loadsw %.4146 + %.4148 =l extsw 0 + %.4149 =l mul %.4148, 48 + %.4150 =l add %.4031, %.4149 + %.4151 =l extsw 4 + %.4152 =l mul %.4151, 8 + %.4153 =l add %.4150, %.4152 + %.4154 =l loadl %.4153 + storel %.4154, $g_201 + %.4155 =l loadl %.4115 + %.4156 =l loadl %.4155 + %.4157 =w cnel %.4154, %.4156 + %.4158 =w copy %.4157 + %.4159 =w copy 6 + %.4160 =w call $safe_lshift_func_int16_t_s_u(w %.4158, w %.4159) + %.4161 =w copy 7 + %.4162 =w call $safe_rshift_func_int16_t_s_u(w %.4160, w %.4161) + %.4163 =w extsh %.4162 + %.4164 =l loadl %.4038 + %.4165 =l copy $g_185 + %.4166 =l mul 40, 1 + %.4167 =l add %.4165, %.4166 + %.4168 =l copy %.4167 + %.4169 =w loadsw %.4168 + %.4170 =w copy %.4169 + %.4171 =w copy 31567 + %.4172 =w call $safe_rshift_func_uint16_t_u_s(w %.4171, w 12) + %.4173 =w copy 622138554 + %.4174 =w copy 1 + %.4175 =w call $safe_sub_func_int32_t_s_s(w %.4173, w %.4174) + %.4176 =l extsw %.4175 + %.4177 =l xor 3541410248, %.4176 + %.4178 =l copy $g_130 + %.4179 =l mul 4, 1 + %.4180 =l add %.4178, %.4179 + %.4181 =l copy %.4180 + %.4182 =w loaduw %.4181 + %.4183 =w copy %.4182 + %.4184 =w loadub %.6 + %.4185 =w extub %.4184 + %.4186 =w call $safe_lshift_func_int8_t_s_s(w %.4183, w %.4185) + %.4187 =l extsb %.4186 + %.4188 =w loaduw %.4 + %.4189 =l extuw %.4188 + %.4190 =l call $safe_div_func_uint64_t_u_u(l %.4187, l %.4189) + %.4191 =w cnel %.4190, 0 + jnz %.4191, @logic_right.1272, @logic_join.1273 +@logic_right.1272 + %.4192 =w cnel 0, 0 +@logic_join.1273 + %.4193 =w phi @if_true.1266 %.4191, @logic_right.1272 %.4192 + %.4194 =l copy $g_130 + %.4195 =l mul 12, 1 + %.4196 =l add %.4194, %.4195 + %.4197 =l copy %.4196 + %.4198 =w loadsw %.4197 + %.4199 =w cslew %.4193, %.4198 + %.4200 =l extsw %.4199 + %.4201 =l or %.4200, 7 + %.4202 =w copy %.4201 + %.4203 =w call $safe_sub_func_int8_t_s_s(w %.4170, w %.4202) + %.4204 =w extsb %.4203 + %.4205 =w loaduw %.4 + %.4206 =w copy %.4205 + %.4207 =w call $safe_mul_func_uint16_t_u_u(w %.4204, w %.4206) + %.4208 =w extuh %.4207 + %.4209 =w loaduw %.4 + %.4210 =w ceqw %.4208, %.4209 + %.4211 =l extsw %.4210 + %.4212 =l loadl %.4120 + storel %.4211, %.4212 + %.4213 =l loadl $g_58 + %.4214 =l copy %.4213 + %.4215 =l call $safe_sub_func_int64_t_s_s(l %.4211, l %.4214) + %.4216 =w cnel %.4215, 0 + jnz %.4216, @logic_join.1271, @logic_right.1270 +@logic_right.1270 + %.4217 =l loadl %.2128 + %.4218 =l loadl %.4217 + %.4219 =w loadsw %.4218 + %.4220 =w cnew %.4219, 0 +@logic_join.1271 + %.4221 =w phi @logic_join.1273 %.4216, @logic_right.1270 %.4220 + %.4222 =l extsw %.4221 + %.4223 =w csgtl %.4164, %.4222 + %.4224 =l extsw %.4223 + %.4225 =l and %.4224, 2 + %.4226 =w copy %.4225 + %.4227 =l loadl %.4038 + %.4228 =w copy %.4227 + %.4229 =w call $safe_mod_func_int16_t_s_s(w %.4226, w %.4228) + %.4230 =l extsh %.4229 + %.4231 =l and 3162042065273101369, %.4230 + %.4232 =l copy 1 + %.4233 =w ceql %.4231, %.4232 + %.4234 =l extsw %.4233 + %.4235 =w csltl %.4234, 24 + %.4236 =l extsw 0 + %.4237 =l extsw 0 + %.4238 =w cnel %.4236, %.4237 + %.4239 =w cnew %.4238, 0 + jnz %.4239, @logic_right.1268, @logic_join.1269 +@logic_right.1268 + %.4240 =w cnel 1, 0 +@logic_join.1269 + %.4241 =w phi @logic_join.1271 %.4239, @logic_right.1268 %.4240 + %.4242 =w copy %.4241 + %.4243 =l copy $g_185 + %.4244 =l mul 32, 1 + %.4245 =l add %.4243, %.4244 + %.4246 =l copy %.4245 + %.4247 =w loaduw %.4246 + %.4248 =w copy %.4247 + %.4249 =w call $safe_rshift_func_int16_t_s_s(w %.4242, w %.4248) + %.4250 =w extsh %.4249 + %.4251 =w loadsw $g_24 + %.4252 =w and %.4250, %.4251 + %.4253 =w loadub %.6 + %.4254 =w copy %.4253 + %.4255 =w loadub $g_57 + %.4256 =w copy %.4255 + %.4257 =w call $safe_mul_func_int8_t_s_s(w %.4254, w %.4256) + %.4258 =w loaduw %.4 + %.4259 =l extuw %.4258 + %.4260 =l loadl %.4126 + %.4261 =w cnel %.4259, %.4260 + %.4262 =w csgew %.4163, %.4261 + %.4263 =w copy %.4262 + %.4264 =l copy $g_185 + %.4265 =l mul 32, 1 + %.4266 =l add %.4264, %.4265 + %.4267 =l copy %.4266 + %.4268 =w loaduw %.4267 + %.4269 =w call $safe_lshift_func_uint16_t_u_u(w %.4263, w %.4268) + %.4270 =w extuh %.4269 + %.4271 =w xor %.4270, 18446744073709551615 + %.4272 =w and %.4147, %.4271 + storew %.4272, %.4146 + jmp @if_join.1274 +@if_false.1267 + %.4274 =l add %.4273, 0 + %.4275 =l extsw 0 + %.4276 =l mul %.4275, 48 + %.4277 =l add %.4031, %.4276 + %.4278 =l extsw 4 + %.4279 =l mul %.4278, 8 + %.4280 =l add %.4277, %.4279 + storel %.4280, %.4274 + %.4281 =l loadl %.2130 + %.4282 =l loadl %.4273 + storel %.4281, %.4282 + %.4283 =l loadl $g_88 + %.4284 =l loadl %.4283 + %.4285 =l loadl %.4284 + %.4286 =w loadsw %.4285 + %.4287 =w cnew %.4286, 0 + jnz %.4287, @if_true.1275, @if_false.1276 +@if_true.1275 + jmp @for_cont.1254 +@if_false.1276 + %.4288 =l loadl %.2 + %.4289 =w loadsw %.4288 + %.4290 =w cnew %.4289, 0 + jnz %.4290, @if_true.1277, @if_false.1278 +@if_true.1277 + jmp @for_cont.1254 +@if_false.1278 +@if_join.1274 + %.4291 =l loadl %.2875 + %.4292 =l loadl %.4041 + storel %.4291, %.4292 + storel %.4291, %.2132 + jmp @if_join.1279 +@if_false.1263 + %.4293 =w copy 15 + %.4294 =l copy $g_185 + %.4295 =l mul 0, 1 + %.4296 =l add %.4294, %.4295 + %.4297 =l copy %.4296 + storeb %.4293, %.4297 +@for_cond.1280 + %.4298 =l copy $g_185 + %.4299 =l mul 0, 1 + %.4300 =l add %.4298, %.4299 + %.4301 =l copy %.4300 + %.4302 =w loadub %.4301 + %.4303 =w extub %.4302 + %.4304 =w csltw %.4303, 22 + jnz %.4304, @for_body.1281, @for_join.1283 +@for_body.1281 + %.4306 =l add %.4305, 0 + %.4307 =l extsw 5 + %.4308 =l mul %.4307, 320 + %.4309 =l add %.7, %.4308 + %.4310 =l extsw 1 + %.4311 =l mul %.4310, 64 + %.4312 =l add %.4309, %.4311 + %.4313 =l extsw 2 + %.4314 =l mul %.4313, 8 + %.4315 =l add %.4312, %.4314 + storel %.4315, %.4306 + %.4316 =l loadl %.2 + %.4317 =l loadl %.4305 + storel %.4316, %.4317 + %.4318 =l copy $g_130 + %.4319 =l mul 12, 1 + %.4320 =l add %.4318, %.4319 + %.4321 =l copy %.4320 + %.4322 =w loadsw %.4321 + %.4323 =w cnew %.4322, 0 + jnz %.4323, @if_true.1284, @if_false.1285 +@if_true.1284 + jmp @lbl_234.1237 +@if_false.1285 +@for_cont.1282 + %.4324 =l copy $g_185 + %.4325 =l mul 0, 1 + %.4326 =l add %.4324, %.4325 + %.4327 =l copy %.4326 + %.4328 =w loadub %.4327 + %.4329 =l extub %.4328 + %.4330 =l extsw 2 + %.4331 =l call $safe_add_func_int64_t_s_s(l %.4329, l %.4330) + %.4332 =w copy %.4331 + %.4333 =l copy $g_185 + %.4334 =l mul 0, 1 + %.4335 =l add %.4333, %.4334 + %.4336 =l copy %.4335 + storeb %.4332, %.4336 + jmp @for_cond.1280 +@for_join.1283 +@if_join.1279 + %.4337 =l loadl $g_80 + %.4338 =w copy %.4337 + %.4339 =l loadl %.3859 + storew %.4338, %.4339 + %.4340 =w loadsb %.2872 + %.4341 =l extsb %.4340 + %.4342 =l copy $g_130 + %.4343 =l mul 8, 1 + %.4344 =l add %.4342, %.4343 + %.4345 =l copy %.4344 + %.4346 =w loadsh %.4345 + %.4347 =l extsh %.4346 + %.4348 =l call $safe_sub_func_uint64_t_u_u(l %.4341, l %.4347) + %.4349 =w copy %.4348 + %.4350 =l copy $g_185 + %.4351 =l mul 48, 1 + %.4352 =l add %.4350, %.4351 + %.4353 =l copy %.4352 + %.4354 =w loadsw %.4353 + %.4355 =w copy %.4354 + %.4356 =w call $safe_sub_func_uint8_t_u_u(w %.4349, w %.4355) + %.4357 =w extub %.4356 + %.4358 =l copy $g_185 + %.4359 =l mul 48, 1 + %.4360 =l add %.4358, %.4359 + %.4361 =l copy %.4360 + %.4362 =w loadsw %.4361 + %.4363 =l extsw %.4362 + %.4364 =l loadl %.2128 + %.4365 =l loadl %.4364 + %.4366 =w loadsw %.4365 + %.4367 =l loadl %.2 + %.4368 =w loadsw %.4367 + %.4369 =l loadl %.2 + %.4370 =w loadsw %.4369 + %.4371 =w ceqw %.4368, %.4370 + %.4372 =w loadsw %.3869 + %.4373 =w and %.4371, %.4372 + %.4374 =w loadub %.6 + %.4375 =w extub %.4374 + %.4376 =w or %.4373, %.4375 + %.4377 =w csgtw %.4366, %.4376 + %.4378 =w copy %.4377 + %.4379 =l loadl $g_82 + %.4380 =w copy %.4379 + %.4381 =w call $safe_mod_func_uint8_t_u_u(w %.4378, w %.4380) + %.4382 =l extub %.4381 + %.4383 =l loadl %.3872 + storel %.4382, %.4383 + %.4384 =l or %.4382, 9439950986158878797 + %.4385 =w copy %.4384 + %.4386 =l copy $g_130 + %.4387 =l mul 4, 1 + %.4388 =l add %.4386, %.4387 + %.4389 =l copy %.4388 + %.4390 =w loaduw %.4389 + %.4391 =w copy %.4390 + %.4392 =w call $safe_mod_func_uint16_t_u_u(w %.4385, w %.4391) + %.4393 =l extuh %.4392 + %.4394 =w cnel %.4393, 2112011544 + %.4395 =w ceqw %.4394, 0 + %.4396 =l extsw %.4395 + %.4397 =l call $safe_add_func_int64_t_s_s(l %.4363, l %.4396) + %.4398 =w copy %.4397 + %.4399 =w call $safe_div_func_int32_t_s_s(w %.4357, w %.4398) + %.4400 =w copy %.4399 + %.4401 =w ceqw %.4338, %.4400 + %.4402 =w cnel 154, 1 + %.4403 =w cnew %.4402, 0 + jnz %.4403, @if_true.1286, @if_false.1287 +@if_true.1286 + %.4405 =l add %.4404, 0 + storel %.3859, %.4405 + %.4407 =l add %.4406, 0 + %.4408 =l extsw 0 + %.4409 =l copy %.4408 + storel %.4409, %.4407 + %.4411 =l add %.4410, 0 + storel %.4406, %.4411 + %.4413 =l add %.4412, 0 + %.4414 =l extsw 2 + %.4415 =l mul %.4414, 360 + %.4416 =l add %.250, %.4415 + %.4417 =l extsw 1 + %.4418 =l mul %.4417, 120 + %.4419 =l add %.4416, %.4418 + %.4420 =l extsw 1 + %.4421 =l mul %.4420, 20 + %.4422 =l add %.4419, %.4421 + %.4423 =l copy %.4422 + %.4424 =l mul 12, 1 + %.4425 =l add %.4423, %.4424 + %.4426 =l copy %.4425 + storel %.4426, %.4413 + %.4428 =l add %.4427, 0 + %.4429 =l extsw 0 + %.4430 =l sub %.4429, 1 + %.4431 =w copy %.4430 + storew %.4431, %.4428 + %.4434 =l add %.4433, 0 + %.4435 =l copy 1 + storel %.4435, %.4434 + %.4437 =l add %.4436, 0 + %.4438 =l copy 5986165483539914317 + storel %.4438, %.4437 + storew 0, %.4439 +@for_cond.1288 + %.4440 =w loadsw %.4439 + %.4441 =w csltw %.4440, 2 + jnz %.4441, @for_body.1289, @for_join.1291 +@for_body.1289 + %.4442 =w loadsw %.4439 + %.4443 =l extsw %.4442 + %.4444 =l mul %.4443, 8 + %.4445 =l add %.4432, %.4444 + storel $g_2, %.4445 +@for_cont.1290 + %.4446 =w loadsw %.4439 + %.4447 =w add %.4446, 1 + storew %.4447, %.4439 + jmp @for_cond.1288 +@for_join.1291 + %.4448 =l loadl $g_173 + %.4449 =w loadsw %.4448 + %.4450 =l loadl %.4404 + storel %.4, %.4450 + %.4451 =l loadl %.2130 + %.4452 =l loadl $g_201 + %.4453 =l loadl %.4451 + storel %.4453, %.4452 + %.4454 =l add %.4451, 8 + %.4455 =l add %.4452, 8 + %.4456 =l loadl %.4454 + storel %.4456, %.4455 + %.4457 =l add %.4454, 8 + %.4458 =l add %.4455, 8 + %.4459 =l loadl %.4457 + storel %.4459, %.4458 + %.4460 =l add %.4457, 8 + %.4461 =l add %.4458, 8 + %.4462 =l loadl %.4460 + storel %.4462, %.4461 + %.4463 =l add %.4460, 8 + %.4464 =l add %.4461, 8 + %.4465 =l loadl %.4463 + storel %.4465, %.4464 + %.4466 =l add %.4463, 8 + %.4467 =l add %.4464, 8 + %.4468 =l loadl %.4466 + storel %.4468, %.4467 + %.4469 =l add %.4466, 8 + %.4470 =l add %.4467, 8 + %.4471 =l loadl %.4469 + storel %.4471, %.4470 + %.4472 =l add %.4469, 8 + %.4473 =l add %.4470, 8 + %.4474 =w cnel %.4, %.4 + %.4475 =w and %.4449, %.4474 + storew %.4475, %.4448 + %.4476 =l extsw %.4475 + %.4477 =w loadub %.6 + %.4478 =l extub %.4477 + %.4479 =w loadsb %.2872 + %.4480 =l extsb %.4479 + %.4481 =l call $safe_div_func_uint64_t_u_u(l %.4478, l %.4480) + %.4482 =w copy %.4481 + %.4483 =l copy $g_130 + %.4484 =l mul 8, 1 + %.4485 =l add %.4483, %.4484 + %.4486 =l copy %.4485 + %.4487 =w loadsh %.4486 + %.4488 =w copy %.4487 + %.4489 =w call $safe_sub_func_int8_t_s_s(w %.4482, w %.4488) + %.4490 =w extsb %.4489 + %.4491 =w call $safe_rshift_func_uint16_t_u_s(w %.4490, w 4) + %.4492 =w extuh %.4491 + %.4493 =w cnew %.4492, 0 + jnz %.4493, @logic_right.1292, @logic_join.1293 +@logic_right.1292 + %.4494 =w loadub %.6 + %.4495 =w extub %.4494 + %.4496 =w cnew %.4495, 0 +@logic_join.1293 + %.4497 =w phi @for_join.1291 %.4493, @logic_right.1292 %.4496 + %.4498 =l loadl %.4406 + %.4499 =l loadl %.4410 + storel %.4498, %.4499 + %.4500 =l loadl %.3878 + %.4501 =w ceql %.4498, %.4500 + %.4502 =w copy %.4501 + %.4503 =w loaduw %.4 + %.4504 =w copy %.4503 + %.4505 =w call $safe_mul_func_int16_t_s_s(w %.4502, w %.4504) + %.4506 =w extsh %.4505 + %.4507 =w and %.4497, %.4506 + %.4508 =l loadl %.4412 + storew %.4507, %.4508 + %.4509 =l loadl $g_82 + %.4510 =l extsw 0 + %.4511 =w ceql %.4509, %.4510 + %.4512 =l extsw %.4511 + %.4513 =w loadsw %.4427 + %.4514 =l extsw %.4513 + %.4515 =l call $safe_add_func_int64_t_s_s(l %.4512, l %.4514) + %.4516 =w csltl %.4476, %.4515 + %.4517 =w cnew %.4516, 0 + jnz %.4517, @if_true.1294, @if_false.1295 +@if_true.1294 + %.4518 =l loadl $g_173 + %.4519 =w loadsw %.4518 + %.4520 =w loadsb %.2872 + %.4521 =w extsb %.4520 + %.4522 =w copy 2 + %.4523 =w call $safe_lshift_func_int16_t_s_u(w %.4521, w %.4522) + %.4524 =w extsh %.4523 + %.4525 =w or %.4519, %.4524 + storew %.4525, %.4518 + %.4526 =w loaduw $g_115 + %.4527 =w cnew %.4526, 0 + jnz %.4527, @if_true.1296, @if_false.1297 +@if_true.1296 + jmp @lbl_234.1237 +@if_false.1297 + %.4528 =l loadl %.2 + storel %.4528, %.3865 + %.4529 =w loadsb %.2872 + %.4530 =w extsb %.4529 + %.4531 =w cnew %.4530, 0 + jnz %.4531, @if_true.1298, @if_false.1299 +@if_true.1298 + jmp @for_join.1255 +@if_false.1299 + jmp @if_join.1300 +@if_false.1295 + %.4533 =l add %.4532, 0 + %.4534 =w copy 4 + storew %.4534, %.4533 + %.4536 =l add %.4535, 0 + storel %.4410, %.4536 + %.4537 =l add %.4535, 8 + %.4538 =l extsw 0 + %.4539 =l copy %.4538 + storel %.4539, %.4537 + %.4540 =l add %.4535, 16 + storel %.4410, %.4540 + %.4541 =l add %.4535, 24 + %.4542 =l extsw 0 + %.4543 =l copy %.4542 + storel %.4543, %.4541 + %.4544 =l add %.4535, 32 + storel %.4410, %.4544 + %.4545 =l add %.4535, 40 + %.4546 =l extsw 0 + %.4547 =l copy %.4546 + storel %.4547, %.4545 + %.4549 =l add %.4548, 0 + %.4550 =l extsw 0 + %.4551 =l sub %.4550, 8 + %.4552 =w copy %.4551 + storew %.4552, %.4549 + %.4553 =l add %.4548, 4 + %.4554 =w copy 3696835799 + storew %.4554, %.4553 + %.4555 =l add %.4548, 8 + %.4556 =w copy 2764261059 + storew %.4556, %.4555 + %.4557 =l add %.4548, 12 + %.4558 =w copy 1 + storew %.4558, %.4557 + %.4559 =l add %.4548, 16 + %.4560 =w copy 0 + storew %.4560, %.4559 + %.4561 =l add %.4548, 20 + %.4562 =w copy 2545267655 + storew %.4562, %.4561 + %.4563 =l add %.4548, 24 + %.4564 =l extsw 0 + %.4565 =l sub %.4564, 1 + %.4566 =w copy %.4565 + storew %.4566, %.4563 + %.4567 =l add %.4548, 28 + %.4568 =w copy 5 + storew %.4568, %.4567 + %.4569 =l add %.4548, 32 + %.4570 =l extsw 0 + %.4571 =l sub %.4570, 1 + %.4572 =w copy %.4571 + storew %.4572, %.4569 + %.4573 =l add %.4548, 36 + %.4574 =l extsw 0 + %.4575 =l sub %.4574, 1 + %.4576 =w copy %.4575 + storew %.4576, %.4573 + %.4577 =l add %.4548, 40 + %.4578 =w copy 2 + storew %.4578, %.4577 + %.4579 =l add %.4548, 44 + %.4580 =w copy 3473621425 + storew %.4580, %.4579 + %.4581 =l add %.4548, 48 + %.4582 =w copy 1 + storew %.4582, %.4581 + %.4583 =l add %.4548, 52 + %.4584 =w copy 1958032190 + storew %.4584, %.4583 + %.4585 =l add %.4548, 56 + %.4586 =l extsw 0 + %.4587 =l sub %.4586, 1 + %.4588 =w copy %.4587 + storew %.4588, %.4585 + %.4589 =l add %.4548, 60 + %.4590 =w copy 3473621425 + storew %.4590, %.4589 + %.4591 =l add %.4548, 64 + %.4592 =w copy 1958032190 + storew %.4592, %.4591 + %.4593 =l add %.4548, 68 + %.4594 =w copy 2545267655 + storew %.4594, %.4593 + %.4595 =l add %.4548, 72 + %.4596 =w copy 0 + storew %.4596, %.4595 + %.4597 =l add %.4548, 76 + %.4598 =w copy 2 + storew %.4598, %.4597 + %.4599 =l add %.4548, 80 + %.4600 =w copy 728500888 + storew %.4600, %.4599 + %.4601 =l add %.4548, 84 + %.4602 =w copy 3473621425 + storew %.4602, %.4601 + %.4603 =l add %.4548, 88 + %.4604 =w copy 5 + storew %.4604, %.4603 + %.4605 =l add %.4548, 92 + %.4606 =w copy 728500888 + storew %.4606, %.4605 + %.4607 =l add %.4548, 96 + %.4608 =w copy 1 + storew %.4608, %.4607 + %.4609 =l add %.4548, 100 + %.4610 =w copy 0 + storew %.4610, %.4609 + %.4611 =l add %.4548, 104 + %.4612 =w copy 2545267655 + storew %.4612, %.4611 + %.4613 =l add %.4548, 108 + %.4614 =l extsw 0 + %.4615 =l sub %.4614, 1 + %.4616 =w copy %.4615 + storew %.4616, %.4613 + %.4617 =l add %.4548, 112 + %.4618 =w copy 5 + storew %.4618, %.4617 + %.4619 =l add %.4548, 116 + %.4620 =l extsw 0 + %.4621 =l sub %.4620, 1 + %.4622 =w copy %.4621 + storew %.4622, %.4619 + %.4623 =l add %.4548, 120 + %.4624 =l extsw 0 + %.4625 =l sub %.4624, 1 + %.4626 =w copy %.4625 + storew %.4626, %.4623 + %.4627 =l add %.4548, 124 + %.4628 =w copy 2 + storew %.4628, %.4627 + %.4629 =l add %.4548, 128 + %.4630 =w copy 3473621425 + storew %.4630, %.4629 + %.4631 =l add %.4548, 132 + %.4632 =w copy 1 + storew %.4632, %.4631 + %.4633 =l add %.4548, 136 + %.4634 =w copy 1958032190 + storew %.4634, %.4633 + %.4635 =l add %.4548, 140 + %.4636 =l extsw 0 + %.4637 =l sub %.4636, 1 + %.4638 =w copy %.4637 + storew %.4638, %.4635 + %.4639 =l add %.4548, 144 + %.4640 =w copy 3473621425 + storew %.4640, %.4639 + %.4641 =l add %.4548, 148 + %.4642 =w copy 1958032190 + storew %.4642, %.4641 + %.4643 =l add %.4548, 152 + %.4644 =w copy 2545267655 + storew %.4644, %.4643 + %.4645 =l add %.4548, 156 + %.4646 =w copy 0 + storew %.4646, %.4645 + %.4647 =l add %.4548, 160 + %.4648 =w copy 2 + storew %.4648, %.4647 + %.4649 =l add %.4548, 164 + %.4650 =w copy 728500888 + storew %.4650, %.4649 + %.4651 =l add %.4548, 168 + %.4652 =w copy 3473621425 + storew %.4652, %.4651 + %.4653 =l add %.4548, 172 + %.4654 =w copy 5 + storew %.4654, %.4653 + %.4655 =l add %.4548, 176 + %.4656 =w copy 728500888 + storew %.4656, %.4655 + %.4657 =l add %.4548, 180 + %.4658 =w copy 1 + storew %.4658, %.4657 + %.4659 =l add %.4548, 184 + %.4660 =w copy 0 + storew %.4660, %.4659 + %.4661 =l add %.4548, 188 + %.4662 =w copy 2545267655 + storew %.4662, %.4661 + %.4663 =l add %.4548, 192 + %.4664 =l extsw 0 + %.4665 =l sub %.4664, 1 + %.4666 =w copy %.4665 + storew %.4666, %.4663 + %.4667 =l add %.4548, 196 + %.4668 =w copy 5 + storew %.4668, %.4667 + %.4669 =l add %.4548, 200 + %.4670 =l extsw 0 + %.4671 =l sub %.4670, 1 + %.4672 =w copy %.4671 + storew %.4672, %.4669 + %.4673 =l add %.4548, 204 + %.4674 =l extsw 0 + %.4675 =l sub %.4674, 1 + %.4676 =w copy %.4675 + storew %.4676, %.4673 + %.4677 =l add %.4548, 208 + %.4678 =w copy 2 + storew %.4678, %.4677 + %.4679 =l add %.4548, 212 + %.4680 =w copy 3473621425 + storew %.4680, %.4679 + %.4681 =l add %.4548, 216 + %.4682 =w copy 1 + storew %.4682, %.4681 + %.4683 =l add %.4548, 220 + %.4684 =w copy 1958032190 + storew %.4684, %.4683 + %.4685 =l add %.4548, 224 + %.4686 =l extsw 0 + %.4687 =l sub %.4686, 1 + %.4688 =w copy %.4687 + storew %.4688, %.4685 + %.4689 =l add %.4548, 228 + %.4690 =w copy 3473621425 + storew %.4690, %.4689 + %.4691 =l add %.4548, 232 + %.4692 =w copy 1958032190 + storew %.4692, %.4691 + %.4693 =l add %.4548, 236 + %.4694 =w copy 2545267655 + storew %.4694, %.4693 + %.4695 =l add %.4548, 240 + %.4696 =w copy 0 + storew %.4696, %.4695 + %.4697 =l add %.4548, 244 + %.4698 =w copy 2 + storew %.4698, %.4697 + %.4699 =l add %.4548, 248 + %.4700 =w copy 728500888 + storew %.4700, %.4699 + %.4701 =l add %.4548, 252 + %.4702 =w copy 3473621425 + storew %.4702, %.4701 + %.4703 =l add %.4548, 256 + %.4704 =w copy 5 + storew %.4704, %.4703 + %.4705 =l add %.4548, 260 + %.4706 =w copy 728500888 + storew %.4706, %.4705 + %.4707 =l add %.4548, 264 + %.4708 =w copy 1 + storew %.4708, %.4707 + %.4709 =l add %.4548, 268 + %.4710 =w copy 0 + storew %.4710, %.4709 + %.4711 =l add %.4548, 272 + %.4712 =w copy 2545267655 + storew %.4712, %.4711 + %.4713 =l add %.4548, 276 + %.4714 =l extsw 0 + %.4715 =l sub %.4714, 1 + %.4716 =w copy %.4715 + storew %.4716, %.4713 + %.4717 =l add %.4548, 280 + %.4718 =w copy 5 + storew %.4718, %.4717 + %.4719 =l add %.4548, 284 + %.4720 =l extsw 0 + %.4721 =l sub %.4720, 1 + %.4722 =w copy %.4721 + storew %.4722, %.4719 + %.4723 =l add %.4548, 288 + %.4724 =l extsw 0 + %.4725 =l sub %.4724, 1 + %.4726 =w copy %.4725 + storew %.4726, %.4723 + %.4727 =l add %.4548, 292 + %.4728 =w copy 2 + storew %.4728, %.4727 + %.4729 =l add %.4548, 296 + %.4730 =w copy 3473621425 + storew %.4730, %.4729 + %.4731 =l add %.4548, 300 + %.4732 =w copy 1 + storew %.4732, %.4731 + %.4733 =l add %.4548, 304 + %.4734 =w copy 1958032190 + storew %.4734, %.4733 + %.4735 =l add %.4548, 308 + %.4736 =l extsw 0 + %.4737 =l sub %.4736, 1 + %.4738 =w copy %.4737 + storew %.4738, %.4735 + %.4739 =l add %.4548, 312 + %.4740 =w copy 3473621425 + storew %.4740, %.4739 + %.4741 =l add %.4548, 316 + %.4742 =w copy 1958032190 + storew %.4742, %.4741 + %.4743 =l add %.4548, 320 + %.4744 =w copy 2545267655 + storew %.4744, %.4743 + %.4745 =l add %.4548, 324 + %.4746 =w copy 0 + storew %.4746, %.4745 + %.4747 =l add %.4548, 328 + %.4748 =w copy 2 + storew %.4748, %.4747 + %.4749 =l add %.4548, 332 + %.4750 =w copy 728500888 + storew %.4750, %.4749 + %.4751 =l add %.4548, 336 + %.4752 =w copy 3473621425 + storew %.4752, %.4751 + %.4753 =l add %.4548, 340 + %.4754 =w copy 5 + storew %.4754, %.4753 + %.4755 =l add %.4548, 344 + %.4756 =w copy 728500888 + storew %.4756, %.4755 + %.4757 =l add %.4548, 348 + %.4758 =w copy 1 + storew %.4758, %.4757 + %.4759 =l add %.4548, 352 + %.4760 =w copy 0 + storew %.4760, %.4759 + %.4761 =l add %.4548, 356 + %.4762 =w copy 2545267655 + storew %.4762, %.4761 + %.4764 =l add %.4763, 0 + %.4765 =l extsw 3 + %.4766 =l mul %.4765, 320 + %.4767 =l add %.7, %.4766 + %.4768 =l extsw 3 + %.4769 =l mul %.4768, 64 + %.4770 =l add %.4767, %.4769 + %.4771 =l extsw 0 + %.4772 =l mul %.4771, 8 + %.4773 =l add %.4770, %.4772 + storel %.4773, %.4764 + %.4777 =w loaduw %.4532 + %.4778 =w copy %.4777 + %.4779 =w copy 7 + %.4780 =w call $safe_rshift_func_int8_t_s_u(w %.4778, w %.4779) + %.4781 =w extsb %.4780 + storew %.4781, %.2886 + %.4782 =w loadsw %.2010 + %.4783 =w csgew %.4781, %.4782 + %.4784 =l extsw 1 + %.4785 =l mul %.4784, 8 + %.4786 =l add %.4432, %.4785 + %.4787 =l loadl %.4786 + %.4788 =w cnel $g_2, %.4787 + %.4789 =l loadl %.2128 + %.4790 =l loadl %.4789 + %.4791 =w loadsw %.4790 + %.4792 =w cslew %.4788, %.4791 + %.4793 =w cnew %.4792, 0 + jnz %.4793, @logic_right.1301, @logic_join.1302 +@logic_right.1301 + %.4794 =w cnel 1, 0 +@logic_join.1302 + %.4795 =w phi @if_false.1295 %.4793, @logic_right.1301 %.4794 + %.4796 =l extsw 6 + %.4797 =l mul %.4796, 8 + %.4798 =l add %.3850, %.4797 + %.4799 =l loadl %.4798 + %.4800 =w ceql %.4799, %.2872 + %.4801 =w loadsb %.2872 + %.4802 =l extsb %.4801 + %.4803 =w cslel %.4802, 38 + %.4804 =l loadl %.2 + %.4805 =w loadsw %.4804 + %.4806 =w cslew %.4803, %.4805 + %.4807 =w copy %.4806 + %.4808 =w loaduw %.4 + %.4809 =w ceqw %.4807, %.4808 + %.4810 =l copy $g_185 + %.4811 =l mul 44, 1 + %.4812 =l add %.4810, %.4811 + %.4813 =l copy %.4812 + %.4814 =w loadsw %.4813 + %.4815 =w and %.4809, %.4814 + %.4816 =l extsw %.4815 + %.4817 =l copy $g_185 + %.4818 =l mul 44, 1 + %.4819 =l add %.4817, %.4818 + %.4820 =l copy %.4819 + %.4821 =w loadsw %.4820 + %.4822 =l extsw %.4821 + %.4823 =l call $safe_sub_func_int64_t_s_s(l %.4816, l %.4822) + %.4824 =l loadl %.2 + %.4825 =w loadsw %.4824 + %.4826 =l extsw %.4825 + %.4827 =w cslel %.4823, %.4826 + %.4828 =w copy %.4827 + %.4829 =w loadub %.6 + %.4830 =w extub %.4829 + %.4831 =w call $safe_rshift_func_int16_t_s_u(w %.4828, w %.4830) + %.4832 =w extsh %.4831 + %.4833 =w cnew %.4800, %.4832 + %.4834 =l loadl $g_173 + storew %.4833, %.4834 + %.4835 =l extsw 2 + %.4836 =l mul %.4835, 60 + %.4837 =l add %.4548, %.4836 + %.4838 =l extsw 3 + %.4839 =l mul %.4838, 12 + %.4840 =l add %.4837, %.4839 + %.4841 =l extsw 1 + %.4842 =l mul %.4841, 4 + %.4843 =l add %.4840, %.4842 + %.4844 =w loadsw %.4843 + %.4845 =w loadsb $g_2 + %.4846 =w copy 4 + %.4847 =w loadub %.6 + %.4848 =w extub %.4847 + storew %.4848, %.2125 + storel %.2130, %.2891 + storel %.2130, $g_296 + storel %.2130, %.2893 + %.4849 =w cnel %.2130, $g_201 + %.4850 =w csgew %.4848, %.4849 + %.4851 =w copy %.4850 + %.4852 =l loadl %.2005 + %.4853 =w loadsb %.4852 + %.4854 =l extsb %.4853 + %.4855 =l extsw 0 + %.4856 =l sub %.4855, 1 + %.4857 =l or %.4854, %.4856 + %.4858 =w copy %.4857 + storeb %.4858, %.4852 + %.4859 =w loadsw $g_50 + %.4860 =l copy $g_130 + %.4861 =l mul 16, 1 + %.4862 =l add %.4860, %.4861 + %.4863 =l copy %.4862 + %.4864 =w loaduw %.4863 + %.4865 =l copy $g_130 + %.4866 =l mul 8, 1 + %.4867 =l add %.4865, %.4866 + %.4868 =l copy %.4867 + %.4869 =w loadsh %.4868 + %.4870 =l extsh %.4869 + %.4871 =l xor %.4870, 3249 + %.4872 =w copy %.4871 + storeh %.4872, %.4868 + %.4873 =w extsh %.4872 + %.4874 =w or %.4864, %.4873 + %.4875 =w loadsb %.2872 + %.4876 =w extsb %.4875 + %.4877 =w and %.4874, %.4876 + %.4878 =w copy %.4877 + %.4879 =l extsw 0 + %.4880 =l sub %.4879, 9 + %.4881 =w copy %.4880 + %.4882 =w call $safe_div_func_int8_t_s_s(w %.4878, w %.4881) + %.4883 =l extsb %.4882 + %.4884 =l loadl $g_58 + %.4885 =l copy %.4884 + %.4886 =l call $safe_add_func_int64_t_s_s(l %.4883, l %.4885) + %.4887 =w copy %.4886 + %.4888 =w copy 20699 + %.4889 =w call $safe_add_func_int16_t_s_s(w %.4887, w %.4888) + %.4890 =w copy %.4889 + %.4891 =w loaduw $g_115 + %.4892 =w copy %.4891 + %.4893 =w call $safe_add_func_uint8_t_u_u(w %.4890, w %.4892) + %.4894 =l extub %.4893 + %.4895 =w csltl %.4894, 96816888117085888 + %.4896 =l extsw %.4895 + %.4897 =l loadl $g_82 + %.4898 =w cslel %.4896, %.4897 + %.4899 =w copy %.4898 + %.4900 =w loaduw %.4 + %.4901 =w cugtw %.4899, %.4900 + %.4902 =w ceqw %.4859, %.4901 + %.4903 =w loadsb %.3880 + %.4904 =w extsb %.4903 + %.4905 =w ceqw %.4902, %.4904 + %.4906 =l extsw %.4905 + %.4907 =w csltl %.4906, 227 + %.4908 =w copy %.4907 + %.4909 =w call $safe_sub_func_int16_t_s_s(w %.4851, w %.4908) + %.4910 =w loadsb %.2872 + %.4911 =w extsb %.4910 + %.4912 =w call $safe_add_func_int16_t_s_s(w %.4909, w %.4911) + %.4913 =w extsh %.4912 + %.4914 =l loadl $g_88 + %.4915 =l loadl %.4914 + %.4916 =l loadl %.4915 + %.4917 =w loadsw %.4916 + %.4918 =w csgew %.4913, %.4917 + %.4919 =l extsw %.4918 + %.4920 =l copy $g_265 + %.4921 =l mul 48, 1 + %.4922 =l add %.4920, %.4921 + %.4923 =l copy %.4922 + %.4924 =w loadsw %.4923 + %.4925 =l extsw %.4924 + %.4926 =l call $safe_mod_func_uint64_t_u_u(l %.4919, l %.4925) + %.4927 =w copy %.4926 + %.4928 =w loaduw %.4532 + %.4929 =w copy %.4928 + %.4930 =w call $safe_sub_func_int8_t_s_s(w %.4927, w %.4929) + %.4931 =l extsb %.4930 + %.4932 =l and %.4931, 1 + %.4933 =w copy %.4932 + %.4934 =w call $safe_mod_func_int8_t_s_s(w %.4846, w %.4933) + %.4935 =l extsb %.4934 + %.4936 =l copy $g_185 + %.4937 =l mul 36, 1 + %.4938 =l add %.4936, %.4937 + %.4939 =l copy %.4938 + %.4940 =w loaduw %.4939 + %.4941 =l extuw %.4940 + %.4942 =l call $safe_div_func_uint64_t_u_u(l %.4935, l %.4941) + %.4943 =w loadsw %.2886 + %.4944 =l extsw %.4943 + %.4945 =w cnel %.4942, %.4944 + %.4946 =w or %.4844, %.4945 + storew %.4946, %.4843 + %.4947 =w loaduw %.4532 + %.4948 =w cnew %.4947, 0 + jnz %.4948, @if_true.1303, @if_false.1304 +@if_true.1303 + jmp @for_join.1255 +@if_false.1304 + %.4949 =l loadl %.2 + %.4950 =l loadl %.4763 + storel %.4949, %.4950 +@if_join.1300 + %.4951 =w loadsw %.4427 + %.4952 =w cnew %.4951, 0 + jnz %.4952, @if_true.1305, @if_false.1306 +@if_true.1305 + %.4954 =l add %.4953, 0 + storel $g_84, %.4954 + %.4956 =l add %.4955, 0 + %.4957 =w copy 0 + storew %.4957, %.4956 + %.4959 =l add %.4958, 0 + %.4960 =w copy 862420352 + storew %.4960, %.4959 + %.4961 =l add %.4958, 4 + %.4962 =w copy 2 + storew %.4962, %.4961 + %.4963 =l add %.4958, 8 + %.4964 =w copy 3109269297 + storew %.4964, %.4963 + %.4965 =l add %.4958, 12 + %.4966 =w copy 2451567122 + storew %.4966, %.4965 + %.4967 =l add %.4958, 16 + %.4968 =w copy 862420352 + storew %.4968, %.4967 + %.4969 =l add %.4958, 20 + %.4970 =w copy 2451567122 + storew %.4970, %.4969 + %.4971 =l add %.4958, 24 + %.4972 =w copy 3109269297 + storew %.4972, %.4971 + %.4973 =l add %.4958, 28 + %.4974 =w copy 2 + storew %.4974, %.4973 + %.4975 =l add %.4958, 32 + %.4976 =w copy 862420352 + storew %.4976, %.4975 + %.4977 =l add %.4958, 36 + %.4978 =w copy 2 + storew %.4978, %.4977 + %.4979 =l add %.4958, 40 + %.4980 =w copy 0 + storew %.4980, %.4979 + %.4981 =l add %.4958, 44 + %.4982 =w copy 2451567122 + storew %.4982, %.4981 + %.4983 =l add %.4958, 48 + %.4984 =w copy 2531821652 + storew %.4984, %.4983 + %.4985 =l add %.4958, 52 + %.4986 =w copy 1738135665 + storew %.4986, %.4985 + %.4987 =l add %.4958, 56 + %.4988 =w copy 2531821652 + storew %.4988, %.4987 + %.4989 =l add %.4958, 60 + %.4990 =w copy 2451567122 + storew %.4990, %.4989 + %.4991 =l add %.4958, 64 + %.4992 =w copy 0 + storew %.4992, %.4991 + %.4993 =l add %.4958, 68 + %.4994 =w copy 1738135665 + storew %.4994, %.4993 + %.4995 =l add %.4958, 72 + %.4996 =w copy 0 + storew %.4996, %.4995 + %.4997 =l add %.4958, 76 + %.4998 =w copy 2451567122 + storew %.4998, %.4997 + %.4999 =l add %.4958, 80 + %.5000 =w copy 862420352 + storew %.5000, %.4999 + %.5001 =l add %.4958, 84 + %.5002 =w copy 1738135665 + storew %.5002, %.5001 + %.5003 =l add %.4958, 88 + %.5004 =l extsw 0 + %.5005 =l sub %.5004, 1 + %.5006 =w copy %.5005 + storew %.5006, %.5003 + %.5007 =l add %.4958, 92 + %.5008 =w copy 1738135665 + storew %.5008, %.5007 + %.5009 =l add %.4958, 96 + %.5010 =w copy 862420352 + storew %.5010, %.5009 + %.5011 =l add %.4958, 100 + %.5012 =w copy 6 + storew %.5012, %.5011 + %.5013 =l add %.4958, 104 + %.5014 =l extsw 0 + %.5015 =l sub %.5014, 1 + %.5016 =w copy %.5015 + storew %.5016, %.5013 + %.5017 =l add %.4958, 108 + %.5018 =w copy 6 + storew %.5018, %.5017 + %.5019 =l add %.4958, 112 + %.5020 =w copy 862420352 + storew %.5020, %.5019 + %.5021 =l add %.4958, 116 + %.5022 =w copy 1738135665 + storew %.5022, %.5021 + %.5023 =l add %.4958, 120 + %.5024 =w copy 2531821652 + storew %.5024, %.5023 + %.5025 =l add %.4958, 124 + %.5026 =w copy 1738135665 + storew %.5026, %.5025 + %.5027 =l add %.4958, 128 + %.5028 =w copy 2531821652 + storew %.5028, %.5027 + %.5029 =l add %.4958, 132 + %.5030 =w copy 2451567122 + storew %.5030, %.5029 + %.5031 =l add %.4958, 136 + %.5032 =w copy 0 + storew %.5032, %.5031 + %.5033 =l add %.4958, 140 + %.5034 =w copy 1738135665 + storew %.5034, %.5033 + %.5035 =l add %.4958, 144 + %.5036 =w copy 0 + storew %.5036, %.5035 + %.5037 =l add %.4958, 148 + %.5038 =w copy 2451567122 + storew %.5038, %.5037 + %.5039 =l add %.4958, 152 + %.5040 =w copy 2531821652 + storew %.5040, %.5039 + %.5041 =l add %.4958, 156 + %.5042 =w copy 1738135665 + storew %.5042, %.5041 + %.5043 =l add %.4958, 160 + %.5044 =w copy 862420352 + storew %.5044, %.5043 + %.5045 =l add %.4958, 164 + %.5046 =w copy 2451567122 + storew %.5046, %.5045 + %.5047 =l add %.4958, 168 + %.5048 =w copy 3109269297 + storew %.5048, %.5047 + %.5049 =l add %.4958, 172 + %.5050 =w copy 2 + storew %.5050, %.5049 + %.5051 =l add %.4958, 176 + %.5052 =w copy 862420352 + storew %.5052, %.5051 + %.5053 =l add %.4958, 180 + %.5054 =w copy 2 + storew %.5054, %.5053 + %.5055 =l add %.4958, 184 + %.5056 =w copy 3109269297 + storew %.5056, %.5055 + %.5057 =l add %.4958, 188 + %.5058 =w copy 2451567122 + storew %.5058, %.5057 + %.5059 =l add %.4958, 192 + %.5060 =w copy 862420352 + storew %.5060, %.5059 + %.5061 =l add %.4958, 196 + %.5062 =w copy 2451567122 + storew %.5062, %.5061 + %.5063 =l add %.4958, 200 + %.5064 =w copy 0 + storew %.5064, %.5063 + %.5065 =l add %.4958, 204 + %.5066 =w copy 2 + storew %.5066, %.5065 + %.5067 =l add %.4958, 208 + %.5068 =w copy 2531821652 + storew %.5068, %.5067 + %.5069 =l add %.4958, 212 + %.5070 =w copy 6 + storew %.5070, %.5069 + %.5071 =l add %.4958, 216 + %.5072 =w copy 2531821652 + storew %.5072, %.5071 + %.5073 =l add %.4958, 220 + %.5074 =w copy 2 + storew %.5074, %.5073 + %.5075 =l add %.4958, 224 + %.5076 =w copy 0 + storew %.5076, %.5075 + %.5077 =l add %.4958, 228 + %.5078 =w copy 6 + storew %.5078, %.5077 + %.5079 =l add %.4958, 232 + %.5080 =w copy 0 + storew %.5080, %.5079 + %.5081 =l add %.4958, 236 + %.5082 =w copy 2 + storew %.5082, %.5081 + %.5083 =l add %.4958, 240 + %.5084 =w copy 862420352 + storew %.5084, %.5083 + %.5085 =l add %.4958, 244 + %.5086 =w copy 6 + storew %.5086, %.5085 + %.5087 =l add %.4958, 248 + %.5088 =l extsw 0 + %.5089 =l sub %.5088, 1 + %.5090 =w copy %.5089 + storew %.5090, %.5087 + %.5091 =l add %.4958, 252 + %.5092 =w copy 6 + storew %.5092, %.5091 + %.5093 =l add %.4958, 256 + %.5094 =w copy 862420352 + storew %.5094, %.5093 + %.5095 =l add %.4958, 260 + %.5096 =w copy 1738135665 + storew %.5096, %.5095 + %.5097 =l add %.4958, 264 + %.5098 =l extsw 0 + %.5099 =l sub %.5098, 1 + %.5100 =w copy %.5099 + storew %.5100, %.5097 + %.5101 =l add %.4958, 268 + %.5102 =w copy 1738135665 + storew %.5102, %.5101 + %.5103 =l add %.4958, 272 + %.5104 =w copy 862420352 + storew %.5104, %.5103 + %.5105 =l add %.4958, 276 + %.5106 =w copy 6 + storew %.5106, %.5105 + %.5107 =l add %.4958, 280 + %.5108 =w copy 2531821652 + storew %.5108, %.5107 + %.5109 =l add %.4958, 284 + %.5110 =w copy 6 + storew %.5110, %.5109 + %.5111 =l add %.4958, 288 + %.5112 =w copy 2531821652 + storew %.5112, %.5111 + %.5113 =l add %.4958, 292 + %.5114 =w copy 2 + storew %.5114, %.5113 + %.5115 =l add %.4958, 296 + %.5116 =w copy 0 + storew %.5116, %.5115 + %.5117 =l add %.4958, 300 + %.5118 =w copy 6 + storew %.5118, %.5117 + %.5119 =l add %.4958, 304 + %.5120 =w copy 0 + storew %.5120, %.5119 + %.5121 =l add %.4958, 308 + %.5122 =w copy 2 + storew %.5122, %.5121 + %.5123 =l add %.4958, 312 + %.5124 =w copy 2531821652 + storew %.5124, %.5123 + %.5125 =l add %.4958, 316 + %.5126 =w copy 6 + storew %.5126, %.5125 + %.5127 =l add %.4958, 320 + %.5128 =w copy 862420352 + storew %.5128, %.5127 + %.5129 =l add %.4958, 324 + %.5130 =w copy 2 + storew %.5130, %.5129 + %.5131 =l add %.4958, 328 + %.5132 =w copy 3109269297 + storew %.5132, %.5131 + %.5133 =l add %.4958, 332 + %.5134 =w copy 2451567122 + storew %.5134, %.5133 + %.5135 =l add %.4958, 336 + %.5136 =w copy 862420352 + storew %.5136, %.5135 + %.5137 =l add %.4958, 340 + %.5138 =w copy 2451567122 + storew %.5138, %.5137 + %.5139 =l add %.4958, 344 + %.5140 =w copy 3109269297 + storew %.5140, %.5139 + %.5141 =l add %.4958, 348 + %.5142 =w copy 2 + storew %.5142, %.5141 + %.5143 =l add %.4958, 352 + %.5144 =w copy 862420352 + storew %.5144, %.5143 + %.5145 =l add %.4958, 356 + %.5146 =w copy 2 + storew %.5146, %.5145 + %.5148 =l add %.5147, 0 + storel $g_82, %.5148 + %.5150 =l add %.5149, 0 + %.5151 =l extsw 0 + %.5152 =l copy %.5151 + storel %.5152, %.5150 + %.5155 =l extsw 2 + %.5156 =l mul %.5155, 8 + %.5157 =l add %.2013, %.5156 + %.5158 =l loadl %.5157 + %.5159 =l extsw 0 + %.5160 =w ceql %.5158, %.5159 + %.5161 =l loadl $g_173 + storew %.5160, %.5161 + %.5162 =w loadsw %.4955 + %.5163 =l loadl %.2143 + %.5164 =l loadl %.4953 + %.5165 =w ceql %.5163, %.5164 + %.5166 =w copy %.5165 + %.5167 =l copy $g_265 + %.5168 =l mul 44, 1 + %.5169 =l add %.5167, %.5168 + %.5170 =l copy %.5169 + %.5171 =w loadsw %.5170 + %.5172 =w copy %.5171 + %.5173 =w call $safe_mod_func_uint8_t_u_u(w %.5166, w %.5172) + %.5174 =l loadl %.2128 + %.5175 =l loadl %.5174 + %.5176 =w loadsw %.5175 + %.5177 =l extsw 0 + %.5178 =w ceql %.5177, $g_296 + %.5179 =l copy $g_265 + %.5180 =l mul 0, 1 + %.5181 =l add %.5179, %.5180 + %.5182 =l copy %.5181 + %.5183 =w loadub %.5182 + %.5184 =w extub %.5183 + %.5185 =w or %.5178, %.5184 + %.5186 =l extsw %.5185 + %.5187 =l copy $g_185 + %.5188 =l mul 24, 1 + %.5189 =l add %.5187, %.5188 + %.5190 =l copy %.5189 + %.5191 =l loadl %.5190 + %.5192 =w copy %.5191 + %.5193 =w loadub $g_57 + %.5194 =l loadl $g_88 + %.5195 =l loadl %.5194 + %.5196 =l loadl %.5195 + %.5197 =w loadsw %.5196 + %.5198 =l copy $g_185 + %.5199 =l mul 0, 1 + %.5200 =l add %.5198, %.5199 + %.5201 =l copy %.5200 + %.5202 =w loadub %.5201 + %.5203 =w extub %.5202 + %.5204 =w call $safe_mod_func_int16_t_s_s(w %.5192, w %.5203) + %.5205 =w copy %.5204 + %.5206 =w loadub $g_57 + %.5207 =w call $safe_mul_func_uint8_t_u_u(w %.5205, w %.5206) + %.5208 =l copy $g_265 + %.5209 =l mul 24, 1 + %.5210 =l add %.5208, %.5209 + %.5211 =l copy %.5210 + %.5212 =l loadl %.5211 + %.5213 =w ceql %.5186, %.5212 + %.5214 =l extsw %.5213 + %.5215 =l copy $g_265 + %.5216 =l mul 8, 1 + %.5217 =l add %.5215, %.5216 + %.5218 =l copy %.5217 + %.5219 =l loadl %.5218 + %.5220 =w cnel %.5214, %.5219 + %.5221 =w copy %.5220 + %.5222 =w loadub %.6 + %.5223 =w extub %.5222 + %.5224 =w call $safe_lshift_func_uint16_t_u_s(w %.5221, w %.5223) + %.5225 =w loaduw %.4 + %.5226 =w loadub %.6 + %.5227 =l extub %.5226 + %.5228 =l xor %.5227, 36 + %.5229 =w cnel %.5228, 0 + jnz %.5229, @logic_right.1307, @logic_join.1308 +@logic_right.1307 + %.5230 =w cnel 21158, 0 +@logic_join.1308 + %.5231 =w phi @if_true.1305 %.5229, @logic_right.1307 %.5230 + %.5232 =l loadl $g_88 + %.5233 =l loadl %.5232 + %.5234 =l loadl %.5233 + %.5235 =w loadsw %.5234 + %.5236 =w cnew %.5231, %.5235 + %.5237 =w copy %.5236 + %.5238 =w call $safe_mul_func_uint8_t_u_u(w %.5173, w %.5237) + %.5239 =l loadl $g_173 + %.5240 =w loadsw %.5239 + %.5241 =l extsw %.5240 + storel %.5241, %.4433 + %.5242 =l extsw 0 + %.5243 =l mul %.5242, 8 + %.5244 =l add %.2145, %.5243 + %.5245 =l loadl %.5244 + %.5246 =l loadl %.3883 + %.5247 =w ceql %.5245, %.5246 + %.5248 =w or %.5162, %.5247 + storew %.5248, %.4955 + %.5249 =l loadl %.2895 + %.5250 =l copy $g_185 + %.5251 =l mul 8, 1 + %.5252 =l add %.5250, %.5251 + %.5253 =l copy %.5252 + %.5254 =l loadl %.5253 + %.5255 =w loadsb %.2872 + %.5256 =w extsb %.5255 + %.5257 =l extsw 0 + %.5258 =w cnel %.3880, %.5257 + %.5259 =l copy $g_130 + %.5260 =l mul 8, 1 + %.5261 =l add %.5259, %.5260 + %.5262 =l copy %.5261 + %.5263 =w loadsh %.5262 + %.5264 =w copy %.5263 + %.5265 =l copy 39984 + %.5266 =w cultl 0, %.5265 + %.5267 =l extsw %.5266 + %.5268 =w ceql 1, %.5267 + %.5269 =w ceqw %.5268, 0 + %.5270 =l extsw %.5269 + %.5271 =w cugtl 65532, %.5270 + %.5272 =l copy $g_185 + %.5273 =l mul 48, 1 + %.5274 =l add %.5272, %.5273 + %.5275 =l copy %.5274 + %.5276 =w loadsw %.5275 + %.5277 =w xor %.5271, %.5276 + %.5278 =w copy %.5277 + %.5279 =w call $safe_div_func_uint8_t_u_u(w %.5264, w %.5278) + %.5280 =w loadub %.6 + %.5281 =w extub %.5279 + %.5282 =w extub %.5280 + %.5283 =w cugew %.5281, %.5282 + %.5284 =w loadsb %.2872 + %.5285 =w extsb %.5284 + %.5286 =w csgew %.5283, %.5285 + %.5287 =w copy %.5286 + %.5288 =w copy 27268 + %.5289 =w call $safe_mul_func_uint16_t_u_u(w %.5287, w %.5288) + %.5290 =w extuh %.5289 + storew %.5290, %.4955 + %.5291 =w cnew %.5290, 0 + jnz %.5291, @logic_join.1316, @logic_right.1315 +@logic_right.1315 + %.5292 =w cnel 0, 0 +@logic_join.1316 + %.5293 =w phi @logic_join.1308 %.5291, @logic_right.1315 %.5292 + %.5294 =l extsw 8 + %.5295 =l mul %.5294, 40 + %.5296 =l add %.4958, %.5295 + %.5297 =l extsw 4 + %.5298 =l mul %.5297, 4 + %.5299 =l add %.5296, %.5298 + %.5300 =w loadsw %.5299 + %.5301 =w csgew %.5293, %.5300 + %.5302 =w copy %.5301 + %.5303 =l loadl $g_173 + %.5304 =w loadsw %.5303 + %.5305 =w copy %.5304 + %.5306 =w call $safe_add_func_uint32_t_u_u(w %.5302, w %.5305) + %.5307 =l extuw %.5306 + %.5308 =w ceql %.5307, 4 + %.5309 =l extsw %.5308 + %.5310 =l loadl %.4436 + %.5311 =w cugel %.5309, %.5310 + %.5312 =w copy %.5311 + %.5313 =l loadl %.4436 + %.5314 =w copy %.5313 + %.5315 =w call $safe_mul_func_uint8_t_u_u(w %.5312, w %.5314) + %.5316 =w extub %.5315 + %.5317 =w or %.5256, %.5316 + %.5318 =w copy %.5317 + %.5319 =w loaduw $g_115 + %.5320 =w cugew %.5318, %.5319 + %.5321 =l extsw 0 + %.5322 =l loadl %.2 + %.5323 =w ceql %.5321, %.5322 + %.5324 =w cnew %.5323, 0 + jnz %.5324, @logic_join.1314, @logic_right.1313 +@logic_right.1313 + %.5325 =w loadub %.6 + %.5326 =w extub %.5325 + %.5327 =w cnew %.5326, 0 +@logic_join.1314 + %.5328 =w phi @logic_join.1316 %.5324, @logic_right.1313 %.5327 + %.5329 =w copy %.5328 + %.5330 =w loaduw %.4 + %.5331 =w or %.5329, %.5330 + %.5332 =w xor %.5331, 18446744073709551615 + %.5333 =w copy %.5332 + %.5334 =w loadsb %.2872 + %.5335 =w extsb %.5334 + %.5336 =w call $safe_rshift_func_int16_t_s_s(w %.5333, w %.5335) + %.5337 =w extsh %.5336 + %.5338 =w loadsb %.2872 + %.5339 =w extsb %.5338 + %.5340 =w call $safe_sub_func_uint32_t_u_u(w %.5337, w %.5339) + %.5341 =l extuw %.5340 + %.5342 =l copy $g_185 + %.5343 =l mul 8, 1 + %.5344 =l add %.5342, %.5343 + %.5345 =l copy %.5344 + %.5346 =l loadl %.5345 + %.5347 =w ceql %.5341, %.5346 + %.5348 =w copy %.5347 + %.5349 =w loaduw %.2146 + %.5350 =w copy %.5349 + %.5351 =w call $safe_mul_func_uint8_t_u_u(w %.5348, w %.5350) + %.5352 =l extub %.5351 + %.5353 =l loadl $g_82 + %.5354 =w csgel %.5352, %.5353 + %.5355 =w copy %.5354 + %.5356 =l extsw 8 + %.5357 =l mul %.5356, 40 + %.5358 =l add %.4958, %.5357 + %.5359 =l extsw 4 + %.5360 =l mul %.5359, 4 + %.5361 =l add %.5358, %.5360 + %.5362 =w loadsw %.5361 + %.5363 =w copy %.5362 + %.5364 =w call $safe_div_func_uint8_t_u_u(w %.5355, w %.5363) + %.5365 =l extub %.5364 + %.5366 =l copy $g_185 + %.5367 =l mul 24, 1 + %.5368 =l add %.5366, %.5367 + %.5369 =l copy %.5368 + %.5370 =l loadl %.5369 + %.5371 =w ceql %.5365, %.5370 + %.5372 =l extsw %.5371 + %.5373 =w cslel %.5372, 4224946571 + %.5374 =w copy %.5373 + %.5375 =l copy $g_185 + %.5376 =l mul 36, 1 + %.5377 =l add %.5375, %.5376 + %.5378 =l copy %.5377 + %.5379 =w loaduw %.5378 + %.5380 =w culew %.5374, %.5379 + %.5381 =w copy %.5380 + %.5382 =w loaduw %.4 + %.5383 =w ceqw %.5381, %.5382 + %.5384 =w loadub %.6 + %.5385 =w extub %.5384 + %.5386 =w ceqw %.5383, %.5385 + %.5387 =w copy %.5386 + %.5388 =w loadub %.6 + %.5389 =w call $safe_div_func_uint8_t_u_u(w %.5387, w %.5388) + %.5390 =l copy $g_130 + %.5391 =l mul 4, 1 + %.5392 =l add %.5390, %.5391 + %.5393 =l copy %.5392 + %.5394 =w loaduw %.5393 + %.5395 =w copy %.5394 + %.5396 =w call $safe_mul_func_uint8_t_u_u(w %.5389, w %.5395) + %.5397 =l extub %.5396 + %.5398 =l loadl %.5147 + storel %.5397, %.5398 + %.5399 =w copy 41088 + %.5400 =w loadsh $g_81 + %.5401 =w copy %.5400 + %.5402 =w call $safe_mul_func_uint16_t_u_u(w %.5399, w %.5401) + %.5403 =w extuh %.5402 + %.5404 =w cnew %.5403, 0 + jnz %.5404, @logic_join.1312, @logic_right.1311 +@logic_right.1311 + %.5405 =w loadsw %.3885 + %.5406 =w cnew %.5405, 0 +@logic_join.1312 + %.5407 =w phi @logic_join.1314 %.5404, @logic_right.1311 %.5406 + %.5408 =w cnew %.5407, 0 + jnz %.5408, @logic_right.1309, @logic_join.1310 +@logic_right.1309 + %.5409 =w cnel 0, 0 +@logic_join.1310 + %.5410 =w phi @logic_join.1312 %.5408, @logic_right.1309 %.5409 + %.5411 =l loadl $g_363 + %.5412 =w ceql %.5249, %.5411 + %.5413 =w loadub %.6 + %.5414 =w extub %.5413 + %.5415 =w csgew %.5412, %.5414 + %.5416 =w copy %.5415 + %.5417 =w loadsb %.2872 + %.5418 =w copy %.5417 + %.5419 =w call $safe_add_func_uint8_t_u_u(w %.5416, w %.5418) + %.5420 =l extub %.5419 + %.5421 =w csltl %.5420, 1 + %.5422 =l loadl %.5149 + %.5423 =l loadl %.2893 + storel %.5422, %.5423 + %.5424 =l loadl $g_88 + %.5425 =l loadl %.5424 + %.5426 =l loadl %.5425 + ret %.5426 +@if_false.1306 + %.5427 =l loadl $g_38 + %.5428 =l loadl %.5427 + ret %.5428 +@if_join.1317 + jmp @if_join.1318 +@if_false.1287 + %.5429 =w loadub %.2023 + %.5430 =w sub %.5429, 1 + storeb %.5430, %.2023 +@if_join.1318 + jmp @if_join.1319 +@if_false.1259 + %.5431 =l loadl %.2 + ret %.5431 +@if_join.1319 + %.5432 =w sub 0, 22 + %.5433 =l copy $g_265 + %.5434 =l mul 48, 1 + %.5435 =l add %.5433, %.5434 + %.5436 =l copy %.5435 + storew %.5432, %.5436 +@for_cond.1320 + %.5437 =l copy $g_265 + %.5438 =l mul 48, 1 + %.5439 =l add %.5437, %.5438 + %.5440 =l copy %.5439 + %.5441 =w loadsw %.5440 + %.5442 =w sub 0, 16 + %.5443 =w ceqw %.5441, %.5442 + jnz %.5443, @for_body.1321, @for_join.1323 +@for_body.1321 + %.5445 =l add %.5444, 0 + %.5446 =l extsw 0 + %.5447 =l sub %.5446, 9 + %.5448 =w copy %.5447 + storew %.5448, %.5445 + %.5450 =l add %.5449, 0 + %.5451 =w copy 8 + storeh %.5451, %.5450 + %.5453 =l add %.5452, 0 + %.5454 =l extsw 0 + %.5455 =l copy %.5454 + storel %.5455, %.5453 + %.5456 =w loadsw %.2886 + %.5457 =w cnew %.5456, 0 + jnz %.5457, @if_true.1324, @if_false.1325 +@if_true.1324 + jmp @lbl_234.1237 +@if_false.1325 + %.5458 =l extsw 0 + storel %.5458, $g_80 +@for_cond.1326 + %.5459 =l loadl $g_80 + %.5460 =l extsw 9 + %.5461 =w csltl %.5459, %.5460 + jnz %.5461, @for_body.1327, @for_join.1329 +@for_body.1327 + %.5462 =l loadl %.2 + ret %.5462 +@for_cont.1328 + %.5463 =l loadl $g_80 + %.5464 =l add %.5463, 1 + storel %.5464, $g_80 + jmp @for_cond.1326 +@for_join.1329 + %.5465 =l extsw 0 + %.5466 =l extsw 0 + %.5467 =l mul %.5466, 24 + %.5468 =l add %.2897, %.5467 + %.5469 =l extsw 0 + %.5470 =l mul %.5469, 24 + %.5471 =l add %.5468, %.5470 + %.5472 =l extsw 1 + %.5473 =l mul %.5472, 8 + %.5474 =l add %.5471, %.5473 + %.5475 =l loadl %.5474 + %.5476 =w ceql %.5465, %.5475 + %.5477 =w copy %.5476 + %.5478 =w copy 48769 + %.5479 =w call $safe_add_func_uint16_t_u_u(w %.5477, w %.5478) + %.5480 =l extuh %.5479 + %.5481 =l loadl $g_82 + %.5482 =w csgel %.5480, %.5481 + %.5483 =l loadl $g_173 + storew %.5482, %.5483 + %.5484 =l loadl $g_173 + %.5485 =w loadsw %.5484 + %.5486 =l copy $g_130 + %.5487 =l mul 16, 1 + %.5488 =l add %.5486, %.5487 + %.5489 =l copy %.5488 + %.5490 =w loaduw %.5489 + %.5491 =l extuw %.5490 + %.5492 =l and %.5491, 12268102678362359027 + %.5493 =l extsw 1 + %.5494 =l mul %.5493, 48 + %.5495 =l add %.2935, %.5494 + %.5496 =l extsw 5 + %.5497 =l mul %.5496, 8 + %.5498 =l add %.5495, %.5497 + %.5499 =l extsw 4 + %.5500 =l mul %.5499, 1 + %.5501 =l add %.5498, %.5500 + %.5502 =w loadsb %.5501 + %.5503 =l extsb %.5502 + %.5504 =l extsw 0 + %.5505 =l extsw 0 + %.5506 =l mul %.5505, 8 + %.5507 =l add %.2145, %.5506 + %.5508 =l loadl %.5507 + %.5509 =w cnel %.5504, %.5508 + %.5510 =w loadsw %.5444 + %.5511 =w cnew %.5510, 0 + jnz %.5511, @logic_right.1330, @logic_join.1331 +@logic_right.1330 + %.5512 =w loaduh %.5449 + %.5513 =l loadl %.5452 + %.5514 =l extsw 0 + %.5515 =w cnel %.5513, %.5514 + %.5516 =w cnew %.5515, 0 +@logic_join.1331 + %.5517 =w phi @for_join.1329 %.5511, @logic_right.1330 %.5516 + %.5518 =l loadl %.2128 + %.5519 =l loadl %.5518 + %.5520 =w loadsw %.5519 + %.5521 =l extsw %.5520 + %.5522 =l and %.5521, 2796228265 + %.5523 =w loadsw %.2149 + %.5524 =l extsw %.5523 + %.5525 =w ceql %.5522, %.5524 + %.5526 =w ceqw %.5525, 0 + %.5527 =w copy %.5526 + %.5528 =w loaduw $g_115 + %.5529 =w copy %.5528 + %.5530 =w call $safe_mod_func_int16_t_s_s(w %.5527, w %.5529) + %.5531 =l loadl %.2026 + %.5532 =l extsw 0 + %.5533 =w cnel %.5531, %.5532 + %.5534 =w copy %.5533 + %.5535 =w call $safe_rshift_func_uint16_t_u_s(w %.5534, w 11) + %.5536 =w extuh %.5535 + %.5537 =w loaduw %.4 + %.5538 =w xor %.5536, %.5537 + %.5539 =w loadsb %.2872 + %.5540 =l extsb %.5539 + %.5541 =w csgtl 0, %.5540 + %.5542 =w cnew %.5509, %.5541 + %.5543 =l copy 6 + %.5544 =l call $safe_mod_func_uint64_t_u_u(l %.5503, l %.5543) + %.5545 =l copy $g_185 + %.5546 =l mul 16, 1 + %.5547 =l add %.5545, %.5546 + %.5548 =l copy %.5547 + %.5549 =w loadsw %.5548 + %.5550 =l extsw %.5549 + %.5551 =w cultl %.5544, %.5550 + %.5552 =l extsw %.5551 + %.5553 =w cugel %.5492, %.5552 + %.5554 =w copy %.5553 + %.5555 =w call $safe_rshift_func_uint8_t_u_s(w %.5554, w 3) + %.5556 =w extub %.5555 + %.5557 =w and %.5485, %.5556 + storew %.5557, %.5484 +@for_cont.1322 + %.5558 =l copy $g_265 + %.5559 =l mul 48, 1 + %.5560 =l add %.5558, %.5559 + %.5561 =l copy %.5560 + %.5562 =w loadsw %.5561 + %.5563 =w add %.5562, 1 + storew %.5563, %.5561 + jmp @for_cond.1320 +@for_join.1323 + %.5564 =l extsw 0 + %.5565 =l sub %.5564, 10 + %.5566 =w loadub %.6 + %.5567 =w extub %.5566 + %.5568 =w cnew %.5567, 0 + jnz %.5568, @logic_right.1332, @logic_join.1333 +@logic_right.1332 + %.5569 =l loadl $g_394 + %.5570 =l extsw 0 + %.5571 =w ceql %.5569, %.5570 + %.5572 =l extsw %.5571 + %.5573 =l loadl %.3468 + storel %.5572, %.5573 + %.5574 =l copy %.5572 + %.5575 =l extsw 0 + %.5576 =l sub %.5575, 9 + %.5577 =l copy %.5576 + %.5578 =l extsw 0 + %.5579 =w cnel %.5578, %.2143 + %.5580 =l extsw %.5579 + storel %.5580, $g_399 + %.5581 =l and %.5577, %.5580 + %.5582 =w ceql %.5574, %.5581 + %.5583 =l extsw 0 + %.5584 =l sub %.5583, 3 + %.5585 =w loaduw %.4 + %.5586 =l extuw %.5585 + %.5587 =w csgel %.5584, %.5586 + %.5588 =w ceqw %.5582, %.5587 + %.5589 =l extsw %.5588 + %.5590 =w loaduw %.4 + %.5591 =l extuw %.5590 + %.5592 =l call $safe_add_func_int64_t_s_s(l %.5589, l %.5591) + %.5593 =w cnel %.5592, 0 +@logic_join.1333 + %.5594 =w phi @for_join.1323 %.5568, @logic_right.1332 %.5593 + %.5595 =w copy %.5594 + %.5596 =l loadl %.2005 + storeb %.5595, %.5596 + %.5597 =l extsb %.5595 + %.5598 =w csgel %.5565, %.5597 + %.5599 =l loadl $g_173 + storew %.5598, %.5599 +@for_cont.1254 + %.5600 =l copy $g_130 + %.5601 =l mul 4, 1 + %.5602 =l add %.5600, %.5601 + %.5603 =l copy %.5602 + %.5604 =w loaduw %.5603 + %.5605 =w add %.5604, 1 + storew %.5605, %.5603 + jmp @for_cond.1252 +@for_join.1255 + %.5606 =w copy 0 + storeb %.5606, $g_46 +@for_cond.1334 + %.5607 =w loadub $g_46 + %.5608 =w extub %.5607 + %.5609 =w cslew %.5608, 5 + jnz %.5609, @for_body.1335, @for_join.1337 +@for_body.1335 + %.5611 =l add %.5610, 0 + %.5612 =w copy 27126 + storeh %.5612, %.5611 + %.5614 =l add %.5613, 0 + %.5615 =l extsw 0 + %.5616 =l copy %.5615 + storel %.5616, %.5614 + %.5618 =l add %.5617, 0 + %.5619 =l extsw 0 + %.5620 =l copy %.5619 + storel %.5620, %.5618 + %.5622 =l add %.5621, 0 + storel $g_425, %.5622 + %.5623 =l add %.5621, 8 + storel $g_425, %.5623 + %.5624 =l add %.5621, 16 + storel $g_425, %.5624 + %.5625 =l add %.5621, 24 + storel $g_425, %.5625 + %.5626 =l add %.5621, 32 + storel $g_425, %.5626 + %.5627 =l add %.5621, 40 + storel $g_425, %.5627 + %.5628 =l add %.5621, 48 + storel $g_425, %.5628 + %.5630 =l add %.5629, 0 + storel $g_58, %.5630 + %.5632 =l add %.5631, 0 + %.5633 =l extsw 2 + %.5634 =l mul %.5633, 320 + %.5635 =l add %.7, %.5634 + %.5636 =l extsw 2 + %.5637 =l mul %.5636, 64 + %.5638 =l add %.5635, %.5637 + %.5639 =l extsw 1 + %.5640 =l mul %.5639, 8 + %.5641 =l add %.5638, %.5640 + storel %.5641, %.5632 + %.5642 =l add %.5631, 8 + %.5643 =l extsw 2 + %.5644 =l mul %.5643, 320 + %.5645 =l add %.7, %.5644 + %.5646 =l extsw 2 + %.5647 =l mul %.5646, 64 + %.5648 =l add %.5645, %.5647 + %.5649 =l extsw 1 + %.5650 =l mul %.5649, 8 + %.5651 =l add %.5648, %.5650 + storel %.5651, %.5642 + %.5652 =l add %.5631, 16 + %.5653 =l extsw 2 + %.5654 =l mul %.5653, 320 + %.5655 =l add %.7, %.5654 + %.5656 =l extsw 2 + %.5657 =l mul %.5656, 64 + %.5658 =l add %.5655, %.5657 + %.5659 =l extsw 1 + %.5660 =l mul %.5659, 8 + %.5661 =l add %.5658, %.5660 + storel %.5661, %.5652 + %.5662 =l add %.5631, 24 + %.5663 =l extsw 2 + %.5664 =l mul %.5663, 320 + %.5665 =l add %.7, %.5664 + %.5666 =l extsw 2 + %.5667 =l mul %.5666, 64 + %.5668 =l add %.5665, %.5667 + %.5669 =l extsw 1 + %.5670 =l mul %.5669, 8 + %.5671 =l add %.5668, %.5670 + storel %.5671, %.5662 + %.5672 =l add %.5631, 32 + %.5673 =l extsw 2 + %.5674 =l mul %.5673, 320 + %.5675 =l add %.7, %.5674 + %.5676 =l extsw 2 + %.5677 =l mul %.5676, 64 + %.5678 =l add %.5675, %.5677 + %.5679 =l extsw 1 + %.5680 =l mul %.5679, 8 + %.5681 =l add %.5678, %.5680 + storel %.5681, %.5672 + %.5682 =l add %.5631, 40 + %.5683 =l extsw 2 + %.5684 =l mul %.5683, 320 + %.5685 =l add %.7, %.5684 + %.5686 =l extsw 2 + %.5687 =l mul %.5686, 64 + %.5688 =l add %.5685, %.5687 + %.5689 =l extsw 1 + %.5690 =l mul %.5689, 8 + %.5691 =l add %.5688, %.5690 + storel %.5691, %.5682 + %.5692 =l add %.5631, 48 + %.5693 =l extsw 2 + %.5694 =l mul %.5693, 320 + %.5695 =l add %.7, %.5694 + %.5696 =l extsw 2 + %.5697 =l mul %.5696, 64 + %.5698 =l add %.5695, %.5697 + %.5699 =l extsw 1 + %.5700 =l mul %.5699, 8 + %.5701 =l add %.5698, %.5700 + storel %.5701, %.5692 + %.5702 =l add %.5631, 56 + %.5703 =l extsw 2 + %.5704 =l mul %.5703, 320 + %.5705 =l add %.7, %.5704 + %.5706 =l extsw 2 + %.5707 =l mul %.5706, 64 + %.5708 =l add %.5705, %.5707 + %.5709 =l extsw 1 + %.5710 =l mul %.5709, 8 + %.5711 =l add %.5708, %.5710 + storel %.5711, %.5702 + %.5712 =l add %.5631, 64 + %.5713 =l extsw 2 + %.5714 =l mul %.5713, 320 + %.5715 =l add %.7, %.5714 + %.5716 =l extsw 2 + %.5717 =l mul %.5716, 64 + %.5718 =l add %.5715, %.5717 + %.5719 =l extsw 1 + %.5720 =l mul %.5719, 8 + %.5721 =l add %.5718, %.5720 + storel %.5721, %.5712 + %.5722 =l add %.5631, 72 + %.5723 =l extsw 2 + %.5724 =l mul %.5723, 320 + %.5725 =l add %.7, %.5724 + %.5726 =l extsw 2 + %.5727 =l mul %.5726, 64 + %.5728 =l add %.5725, %.5727 + %.5729 =l extsw 1 + %.5730 =l mul %.5729, 8 + %.5731 =l add %.5728, %.5730 + storel %.5731, %.5722 + %.5733 =l add %.5732, 0 + %.5734 =w copy 3 + storew %.5734, %.5733 + %.5736 =l add %.5735, 0 + %.5737 =w copy 3172288781 + storew %.5737, %.5736 + %.5738 =l add %.5735, 4 + %.5739 =w copy 18446744073709551615 + storew %.5739, %.5738 + %.5740 =l add %.5735, 8 + %.5741 =l extsw 0 + %.5742 =l sub %.5741, 3 + %.5743 =w copy %.5742 + storeh %.5743, %.5740 + %.5744 =l add %.5735, 10 + storeh 0, %.5744 + %.5745 =l add %.5735, 12 + %.5746 =w copy 2 + storew %.5746, %.5745 + %.5747 =l add %.5735, 16 + %.5748 =w copy 1389690011 + storew %.5748, %.5747 + %.5750 =l add %.5749, 0 + %.5751 =l extsw 2 + %.5752 =l mul %.5751, 360 + %.5753 =l add %.250, %.5752 + %.5754 =l extsw 1 + %.5755 =l mul %.5754, 120 + %.5756 =l add %.5753, %.5755 + %.5757 =l extsw 1 + %.5758 =l mul %.5757, 20 + %.5759 =l add %.5756, %.5758 + %.5760 =l copy %.5759 + %.5761 =l mul 12, 1 + %.5762 =l add %.5760, %.5761 + %.5763 =l copy %.5762 + storel %.5763, %.5750 + %.5764 =l add %.5749, 8 + %.5765 =l extsw 2 + %.5766 =l mul %.5765, 360 + %.5767 =l add %.250, %.5766 + %.5768 =l extsw 1 + %.5769 =l mul %.5768, 120 + %.5770 =l add %.5767, %.5769 + %.5771 =l extsw 1 + %.5772 =l mul %.5771, 20 + %.5773 =l add %.5770, %.5772 + %.5774 =l copy %.5773 + %.5775 =l mul 12, 1 + %.5776 =l add %.5774, %.5775 + %.5777 =l copy %.5776 + storel %.5777, %.5764 + %.5778 =l add %.5749, 16 + %.5779 =l copy %.5735 + %.5780 =l mul 12, 1 + %.5781 =l add %.5779, %.5780 + %.5782 =l copy %.5781 + storel %.5782, %.5778 + %.5783 =l add %.5749, 24 + %.5784 =l copy %.5735 + %.5785 =l mul 12, 1 + %.5786 =l add %.5784, %.5785 + %.5787 =l copy %.5786 + storel %.5787, %.5783 + %.5788 =l add %.5749, 32 + %.5789 =l extsw 2 + %.5790 =l mul %.5789, 360 + %.5791 =l add %.250, %.5790 + %.5792 =l extsw 1 + %.5793 =l mul %.5792, 120 + %.5794 =l add %.5791, %.5793 + %.5795 =l extsw 1 + %.5796 =l mul %.5795, 20 + %.5797 =l add %.5794, %.5796 + %.5798 =l copy %.5797 + %.5799 =l mul 12, 1 + %.5800 =l add %.5798, %.5799 + %.5801 =l copy %.5800 + storel %.5801, %.5788 + %.5802 =l add %.5749, 40 + %.5803 =l copy $g_130 + %.5804 =l mul 12, 1 + %.5805 =l add %.5803, %.5804 + %.5806 =l copy %.5805 + storel %.5806, %.5802 + %.5807 =l add %.5749, 48 + %.5808 =l extsw 0 + %.5809 =l copy %.5808 + storel %.5809, %.5807 + %.5810 =l add %.5749, 56 + %.5811 =l copy $g_130 + %.5812 =l mul 12, 1 + %.5813 =l add %.5811, %.5812 + %.5814 =l copy %.5813 + storel %.5814, %.5810 + %.5815 =l add %.5749, 64 + %.5816 =l extsw 0 + %.5817 =l copy %.5816 + storel %.5817, %.5815 + %.5818 =l add %.5749, 72 + %.5819 =l copy $g_130 + %.5820 =l mul 12, 1 + %.5821 =l add %.5819, %.5820 + %.5822 =l copy %.5821 + storel %.5822, %.5818 + %.5823 =l add %.5749, 80 + %.5824 =l extsw 2 + %.5825 =l mul %.5824, 360 + %.5826 =l add %.250, %.5825 + %.5827 =l extsw 1 + %.5828 =l mul %.5827, 120 + %.5829 =l add %.5826, %.5828 + %.5830 =l extsw 1 + %.5831 =l mul %.5830, 20 + %.5832 =l add %.5829, %.5831 + %.5833 =l copy %.5832 + %.5834 =l mul 12, 1 + %.5835 =l add %.5833, %.5834 + %.5836 =l copy %.5835 + storel %.5836, %.5823 + %.5837 =l add %.5749, 88 + %.5838 =l copy %.5735 + %.5839 =l mul 12, 1 + %.5840 =l add %.5838, %.5839 + %.5841 =l copy %.5840 + storel %.5841, %.5837 + %.5842 =l add %.5749, 96 + %.5843 =l copy %.5735 + %.5844 =l mul 12, 1 + %.5845 =l add %.5843, %.5844 + %.5846 =l copy %.5845 + storel %.5846, %.5842 + %.5847 =l add %.5749, 104 + %.5848 =l extsw 2 + %.5849 =l mul %.5848, 360 + %.5850 =l add %.250, %.5849 + %.5851 =l extsw 1 + %.5852 =l mul %.5851, 120 + %.5853 =l add %.5850, %.5852 + %.5854 =l extsw 1 + %.5855 =l mul %.5854, 20 + %.5856 =l add %.5853, %.5855 + %.5857 =l copy %.5856 + %.5858 =l mul 12, 1 + %.5859 =l add %.5857, %.5858 + %.5860 =l copy %.5859 + storel %.5860, %.5847 + %.5861 =l add %.5749, 112 + %.5862 =l extsw 2 + %.5863 =l mul %.5862, 360 + %.5864 =l add %.250, %.5863 + %.5865 =l extsw 1 + %.5866 =l mul %.5865, 120 + %.5867 =l add %.5864, %.5866 + %.5868 =l extsw 1 + %.5869 =l mul %.5868, 20 + %.5870 =l add %.5867, %.5869 + %.5871 =l copy %.5870 + %.5872 =l mul 12, 1 + %.5873 =l add %.5871, %.5872 + %.5874 =l copy %.5873 + storel %.5874, %.5861 + %.5875 =l add %.5749, 120 + %.5876 =l extsw 0 + %.5877 =l copy %.5876 + storel %.5877, %.5875 + %.5878 =l add %.5749, 128 + %.5879 =l extsw 0 + %.5880 =l copy %.5879 + storel %.5880, %.5878 + %.5881 =l add %.5749, 136 + %.5882 =l extsw 0 + %.5883 =l copy %.5882 + storel %.5883, %.5881 + %.5884 =l add %.5749, 144 + %.5885 =l extsw 0 + %.5886 =l copy %.5885 + storel %.5886, %.5884 + %.5887 =l add %.5749, 152 + %.5888 =l extsw 0 + %.5889 =l copy %.5888 + storel %.5889, %.5887 + %.5891 =l add %.5890, 0 + storel %.2042, %.5891 + %.5893 =l add %.5892, 0 + %.5894 =w copy 1953940215 + storew %.5894, %.5893 + %.5897 =l copy $g_130 + %.5898 =l mul 12, 1 + %.5899 =l add %.5897, %.5898 + %.5900 =l copy %.5899 + %.5901 =w loadsw %.5900 + %.5902 =w loaduh %.5610 + %.5903 =w copy %.5902 + %.5904 =w loadub %.6 + %.5905 =w loadsh $g_81 + %.5906 =w copy %.5905 + %.5907 =w loadsw %.2125 + storel %.4, $g_422 + %.5908 =w cnel %.4, %.4 + %.5909 =w copy %.5908 + %.5910 =l copy $g_185 + %.5911 =l mul 16, 1 + %.5912 =l add %.5910, %.5911 + %.5913 =l copy %.5912 + %.5914 =w loadsw %.5913 + %.5915 =w copy %.5914 + %.5916 =w call $safe_add_func_uint32_t_u_u(w %.5909, w %.5915) + %.5917 =w copy %.5916 + %.5918 =w loaduh %.5610 + %.5919 =w copy %.5918 + %.5920 =w call $safe_add_func_uint8_t_u_u(w %.5917, w %.5919) + %.5921 =w copy %.5920 + %.5922 =l loadl %.2128 + %.5923 =l loadl %.5922 + %.5924 =w loadsw %.5923 + %.5925 =w copy %.5924 + %.5926 =w call $safe_add_func_int8_t_s_s(w %.5921, w %.5925) + %.5927 =w copy %.5926 + %.5928 =l copy $g_185 + %.5929 =l mul 36, 1 + %.5930 =l add %.5928, %.5929 + %.5931 =l copy %.5930 + %.5932 =w loaduw %.5931 + %.5933 =w copy %.5932 + %.5934 =w call $safe_div_func_uint8_t_u_u(w %.5927, w %.5933) + %.5935 =w copy %.5934 + %.5936 =w loaduw %.4 + %.5937 =w copy %.5936 + %.5938 =w call $safe_div_func_int8_t_s_s(w %.5935, w %.5937) + %.5939 =w extsb %.5938 + %.5940 =w or %.5907, %.5939 + storew %.5940, %.2125 + %.5941 =w copy %.5940 + %.5942 =w call $safe_div_func_uint16_t_u_u(w %.5906, w %.5941) + %.5943 =l extuh %.5942 + %.5944 =w csgtl %.5943, 3030009979941848488 + %.5945 =w copy %.5944 + %.5946 =w loaduw %.4 + %.5947 =w copy %.5946 + %.5948 =w call $safe_mod_func_int8_t_s_s(w %.5945, w %.5947) + %.5949 =l extsb %.5948 + %.5950 =w csltl 4182057465624465012, %.5949 + %.5951 =l extsw %.5950 + %.5952 =w csltl 0, %.5951 + %.5953 =l extsw %.5952 + %.5954 =l copy 16470644504123542939 + %.5955 =l call $safe_div_func_int64_t_s_s(l %.5953, l %.5954) + %.5956 =l copy $g_265 + %.5957 =l mul 36, 1 + %.5958 =l add %.5956, %.5957 + %.5959 =l copy %.5958 + %.5960 =w loaduw %.5959 + %.5961 =l extuw %.5960 + %.5962 =w cnel %.5955, %.5961 + %.5963 =w cnew %.5962, 0 + jnz %.5963, @logic_join.1343, @logic_right.1342 +@logic_right.1342 + %.5964 =w loadsw %.2030 + %.5965 =w cnew %.5964, 0 +@logic_join.1343 + %.5966 =w phi @for_body.1335 %.5963, @logic_right.1342 %.5965 + %.5967 =w copy %.5966 + %.5968 =w call $safe_div_func_uint8_t_u_u(w %.5903, w %.5967) + %.5969 =w extub %.5968 + %.5970 =w and %.5901, %.5969 + %.5971 =w cnew %.5970, 0 + jnz %.5971, @logic_join.1341, @logic_right.1340 +@logic_right.1340 + %.5972 =w cnel 15144162022194725640, 0 +@logic_join.1341 + %.5973 =w phi @logic_join.1343 %.5971, @logic_right.1340 %.5972 + %.5974 =l extsw %.5973 + %.5975 =l loadl %.5629 + storel %.5974, %.5975 + %.5976 =w cnel %.5974, 0 + jnz %.5976, @logic_right.1338, @logic_join.1339 +@logic_right.1338 + %.5977 =w loadub %.6 + %.5978 =w extub %.5977 + %.5979 =w cnew %.5978, 0 +@logic_join.1339 + %.5980 =w phi @logic_join.1341 %.5976, @logic_right.1338 %.5979 + %.5981 =w cnew %.5980, 0 + jnz %.5981, @if_true.1344, @if_false.1345 +@if_true.1344 + %.5983 =l add %.5982, 0 + %.5984 =l extsw 3 + %.5985 =l mul %.5984, 320 + %.5986 =l add %.7, %.5985 + %.5987 =l extsw 3 + %.5988 =l mul %.5987, 64 + %.5989 =l add %.5986, %.5988 + %.5990 =l extsw 1 + %.5991 =l mul %.5990, 8 + %.5992 =l add %.5989, %.5991 + storel %.5992, %.5983 + %.5994 =l add %.5993, 0 + storel $g_81, %.5994 + %.5997 =l add %.5996, 0 + %.5998 =w copy 0 + storeb %.5998, %.5997 + %.6000 =l add %.5999, 0 + %.6001 =l extsw 2 + %.6002 =l mul %.6001, 360 + %.6003 =l add %.250, %.6002 + %.6004 =l extsw 1 + %.6005 =l mul %.6004, 120 + %.6006 =l add %.6003, %.6005 + %.6007 =l extsw 1 + %.6008 =l mul %.6007, 20 + %.6009 =l add %.6006, %.6008 + %.6010 =l copy %.6009 + %.6011 =l mul 8, 1 + %.6012 =l add %.6010, %.6011 + %.6013 =l copy %.6012 + storel %.6013, %.6000 + %.6014 =l add %.5999, 8 + %.6015 =l extsw 2 + %.6016 =l mul %.6015, 360 + %.6017 =l add %.250, %.6016 + %.6018 =l extsw 1 + %.6019 =l mul %.6018, 120 + %.6020 =l add %.6017, %.6019 + %.6021 =l extsw 1 + %.6022 =l mul %.6021, 20 + %.6023 =l add %.6020, %.6022 + %.6024 =l copy %.6023 + %.6025 =l mul 8, 1 + %.6026 =l add %.6024, %.6025 + %.6027 =l copy %.6026 + storel %.6027, %.6014 + %.6028 =l add %.5999, 16 + %.6029 =l extsw 2 + %.6030 =l mul %.6029, 360 + %.6031 =l add %.250, %.6030 + %.6032 =l extsw 1 + %.6033 =l mul %.6032, 120 + %.6034 =l add %.6031, %.6033 + %.6035 =l extsw 1 + %.6036 =l mul %.6035, 20 + %.6037 =l add %.6034, %.6036 + %.6038 =l copy %.6037 + %.6039 =l mul 8, 1 + %.6040 =l add %.6038, %.6039 + %.6041 =l copy %.6040 + storel %.6041, %.6028 + %.6042 =l add %.5999, 24 + %.6043 =l extsw 2 + %.6044 =l mul %.6043, 360 + %.6045 =l add %.250, %.6044 + %.6046 =l extsw 1 + %.6047 =l mul %.6046, 120 + %.6048 =l add %.6045, %.6047 + %.6049 =l extsw 1 + %.6050 =l mul %.6049, 20 + %.6051 =l add %.6048, %.6050 + %.6052 =l copy %.6051 + %.6053 =l mul 8, 1 + %.6054 =l add %.6052, %.6053 + %.6055 =l copy %.6054 + storel %.6055, %.6042 + %.6056 =l add %.5999, 32 + %.6057 =l extsw 2 + %.6058 =l mul %.6057, 360 + %.6059 =l add %.250, %.6058 + %.6060 =l extsw 1 + %.6061 =l mul %.6060, 120 + %.6062 =l add %.6059, %.6061 + %.6063 =l extsw 1 + %.6064 =l mul %.6063, 20 + %.6065 =l add %.6062, %.6064 + %.6066 =l copy %.6065 + %.6067 =l mul 8, 1 + %.6068 =l add %.6066, %.6067 + %.6069 =l copy %.6068 + storel %.6069, %.6056 + %.6070 =l add %.5999, 40 + %.6071 =l extsw 2 + %.6072 =l mul %.6071, 360 + %.6073 =l add %.250, %.6072 + %.6074 =l extsw 1 + %.6075 =l mul %.6074, 120 + %.6076 =l add %.6073, %.6075 + %.6077 =l extsw 1 + %.6078 =l mul %.6077, 20 + %.6079 =l add %.6076, %.6078 + %.6080 =l copy %.6079 + %.6081 =l mul 8, 1 + %.6082 =l add %.6080, %.6081 + %.6083 =l copy %.6082 + storel %.6083, %.6070 + %.6084 =l add %.5999, 48 + %.6085 =l extsw 2 + %.6086 =l mul %.6085, 360 + %.6087 =l add %.250, %.6086 + %.6088 =l extsw 1 + %.6089 =l mul %.6088, 120 + %.6090 =l add %.6087, %.6089 + %.6091 =l extsw 1 + %.6092 =l mul %.6091, 20 + %.6093 =l add %.6090, %.6092 + %.6094 =l copy %.6093 + %.6095 =l mul 8, 1 + %.6096 =l add %.6094, %.6095 + %.6097 =l copy %.6096 + storel %.6097, %.6084 + %.6098 =l add %.5999, 56 + %.6099 =l extsw 2 + %.6100 =l mul %.6099, 360 + %.6101 =l add %.250, %.6100 + %.6102 =l extsw 1 + %.6103 =l mul %.6102, 120 + %.6104 =l add %.6101, %.6103 + %.6105 =l extsw 1 + %.6106 =l mul %.6105, 20 + %.6107 =l add %.6104, %.6106 + %.6108 =l copy %.6107 + %.6109 =l mul 8, 1 + %.6110 =l add %.6108, %.6109 + %.6111 =l copy %.6110 + storel %.6111, %.6098 + %.6112 =l add %.5999, 64 + %.6113 =l extsw 2 + %.6114 =l mul %.6113, 360 + %.6115 =l add %.250, %.6114 + %.6116 =l extsw 1 + %.6117 =l mul %.6116, 120 + %.6118 =l add %.6115, %.6117 + %.6119 =l extsw 1 + %.6120 =l mul %.6119, 20 + %.6121 =l add %.6118, %.6120 + %.6122 =l copy %.6121 + %.6123 =l mul 8, 1 + %.6124 =l add %.6122, %.6123 + %.6125 =l copy %.6124 + storel %.6125, %.6112 + %.6127 =l add %.6126, 0 + %.6128 =l copy $g_518 + %.6129 =l mul 44, 1 + %.6130 =l add %.6128, %.6129 + %.6131 =l copy %.6130 + storel %.6131, %.6127 + storew 0, %.6132 +@for_cond.1346 + %.6133 =w loadsw %.6132 + %.6134 =w csltw %.6133, 3 + jnz %.6134, @for_body.1347, @for_join.1349 +@for_body.1347 + %.6135 =w copy 1 + %.6136 =w loadsw %.6132 + %.6137 =l extsw %.6136 + %.6138 =l mul %.6137, 4 + %.6139 =l add %.5995, %.6138 + storew %.6135, %.6139 +@for_cont.1348 + %.6140 =w loadsw %.6132 + %.6141 =w add %.6140, 1 + storew %.6141, %.6132 + jmp @for_cond.1346 +@for_join.1349 + %.6142 =l loadl %.5982 + %.6143 =l loadl %.2128 + %.6144 =w cnel %.6142, %.6143 + %.6145 =l copy 18446744073709551609 + %.6146 =l extsw 0 + %.6147 =l extsw 2 + %.6148 =l mul %.6147, 360 + %.6149 =l add %.250, %.6148 + %.6150 =l extsw 1 + %.6151 =l mul %.6150, 120 + %.6152 =l add %.6149, %.6151 + %.6153 =l extsw 1 + %.6154 =l mul %.6153, 20 + %.6155 =l add %.6152, %.6154 + %.6156 =w cnel %.6146, %.6155 + %.6157 =w xor %.6156, 18446744073709551615 + %.6158 =w copy %.6157 + %.6159 =w copy 8 + %.6160 =w call $safe_lshift_func_uint16_t_u_u(w %.6158, w %.6159) + %.6161 =w loadub %.6 + %.6162 =l extsw 4 + %.6163 =l mul %.6162, 1 + %.6164 =l add $g_132, %.6163 + %.6165 =w loadsb %.6164 + %.6166 =w extsb %.6165 + %.6167 =l loadl %.5993 + storeh %.6166, %.6167 + %.6168 =l extsh %.6166 + %.6169 =l and %.6168, 3197 + %.6170 =w ceql %.6169, 248615576 + %.6171 =l loadl %.2128 + %.6172 =l loadl %.6171 + %.6173 =w loadsw %.6172 + %.6174 =w ceqw %.6170, %.6173 + %.6175 =w call $safe_lshift_func_uint16_t_u_s(w %.6160, w %.6174) + %.6176 =l extuh %.6175 + %.6177 =l call $safe_div_func_uint64_t_u_u(l %.6145, l %.6176) + %.6178 =l copy 7 + %.6179 =w cnel %.6177, %.6178 + %.6180 =l extsw %.6179 + %.6181 =l and %.6180, 4 + %.6182 =w copy %.6181 + %.6183 =w loaduw %.4 + %.6184 =w call $safe_rshift_func_uint8_t_u_u(w %.6182, w %.6183) + %.6185 =w extub %.6184 + %.6186 =w xor %.6144, %.6185 + %.6187 =w cnel 9, 0 + jnz %.6187, @if_true.1350, @if_false.1351 +@if_true.1350 + %.6189 =l add %.6188, 0 + %.6190 =l copy 1 + storel %.6190, %.6189 + %.6192 =l add %.6191, 0 + %.6193 =l copy $g_265 + %.6194 =l mul 0, 1 + %.6195 =l add %.6193, %.6194 + %.6196 =l copy %.6195 + storel %.6196, %.6192 + %.6198 =l add %.6197, 0 + %.6199 =w copy 1 + storew %.6199, %.6198 + %.6200 =l copy $g_265 + %.6201 =l mul 48, 1 + %.6202 =l add %.6200, %.6201 + %.6203 =l copy %.6202 + storew 0, %.6203 +@for_cond.1352 + %.6204 =l copy $g_265 + %.6205 =l mul 48, 1 + %.6206 =l add %.6204, %.6205 + %.6207 =l copy %.6206 + %.6208 =w loadsw %.6207 + %.6209 =w csgtw %.6208, 13 + jnz %.6209, @for_body.1353, @for_join.1355 +@for_body.1353 + %.6211 =l add %.6210, 0 + %.6212 =l extsw 0 + %.6213 =l sub %.6212, 1 + %.6214 =w copy %.6213 + storew %.6214, %.6211 + %.6215 =w loadsw %.6210 + %.6216 =w cnew %.6215, 0 + jnz %.6216, @if_true.1356, @if_false.1357 +@if_true.1356 + jmp @for_join.1355 +@if_false.1357 +@for_cont.1354 + %.6217 =l copy $g_265 + %.6218 =l mul 48, 1 + %.6219 =l add %.6217, %.6218 + %.6220 =l copy %.6219 + %.6221 =w loadsw %.6220 + %.6222 =w add %.6221, 1 + storew %.6222, %.6220 + jmp @for_cond.1352 +@for_join.1355 + %.6223 =w loadsw %.2149 + %.6224 =l loadl %.2128 + %.6225 =l loadl %.6224 + %.6226 =w loadsw %.6225 + %.6227 =w loaduw %.2033 + %.6228 =l loadl $g_88 + %.6229 =l loadl %.6228 + %.6230 =l loadl %.6229 + %.6231 =w loadsw %.6230 + %.6232 =w copy %.6231 + %.6233 =w or %.6227, %.6232 + %.6234 =w loaduw %.4 + %.6235 =l loadl %.6188 + %.6236 =w copy %.6235 + %.6237 =w call $safe_lshift_func_uint8_t_u_s(w %.6236, w 2) + %.6238 =w loadub %.6 + %.6239 =l loadl %.6191 + storeb %.6238, %.6239 + %.6240 =w copy 1 + %.6241 =w call $safe_rshift_func_uint8_t_u_u(w %.6238, w %.6240) + %.6242 =w extub %.6241 + %.6243 =l loadl $g_173 + storew %.6242, %.6243 + %.6244 =l extsw 6 + %.6245 =l mul %.6244, 8 + %.6246 =l add $g_364, %.6245 + %.6247 =l extsw 0 + %.6248 =w ceql %.6246, %.6247 + %.6249 =w copy %.6248 + %.6250 =l extsw 0 + %.6251 =l mul %.6250, 4 + %.6252 =l add %.2152, %.6251 + %.6253 =w loaduw %.6252 + %.6254 =w or %.6249, %.6253 + %.6255 =l extuw %.6254 + %.6256 =l loadl $g_399 + %.6257 =l copy %.6256 + %.6258 =l call $safe_mod_func_int64_t_s_s(l %.6255, l %.6257) + %.6259 =l loadl %.2128 + %.6260 =l loadl %.6259 + %.6261 =w loadsw %.6260 + %.6262 =l extsw 5 + %.6263 =l mul %.6262, 8 + %.6264 =l add %.5631, %.6263 + %.6265 =l loadl %.6264 + %.6266 =w ceql %.2, %.6265 + %.6267 =w copy %.6266 + %.6268 =w copy 1 + %.6269 =w call $safe_lshift_func_int8_t_s_u(w %.6267, w %.6268) + %.6270 =w extsb %.6269 + %.6271 =w loaduw %.4 + %.6272 =w cnew %.6270, %.6271 + %.6273 =w copy %.6272 + %.6274 =w copy 5 + %.6275 =w call $safe_mod_func_uint8_t_u_u(w %.6273, w %.6274) + %.6276 =w extub %.6275 + %.6277 =w call $safe_add_func_int32_t_s_s(w %.6242, w %.6276) + %.6278 =w copy %.6277 + %.6279 =w call $safe_div_func_uint8_t_u_u(w %.6237, w %.6278) + %.6280 =w extub %.6279 + %.6281 =w culew %.6233, %.6280 + storew %.6281, %.6197 + %.6282 =w copy %.6281 + %.6283 =l loadl $g_422 + %.6284 =w loaduw %.6283 + %.6285 =w xor %.6282, %.6284 + %.6286 =l copy $g_265 + %.6287 =l mul 36, 1 + %.6288 =l add %.6286, %.6287 + %.6289 =l copy %.6288 + %.6290 =w loaduw %.6289 + %.6291 =w culew %.6285, %.6290 + %.6292 =w or %.6226, %.6291 + %.6293 =w loadub %.6 + %.6294 =w extub %.6293 + %.6295 =w cnew %.6294, 0 + jnz %.6295, @logic_join.1359, @logic_right.1358 +@logic_right.1358 + %.6296 =w cnel 0, 0 +@logic_join.1359 + %.6297 =w phi @for_join.1355 %.6295, @logic_right.1358 %.6296 + %.6298 =w and %.6223, %.6297 + storew %.6298, %.2149 + jmp @if_join.1360 +@if_false.1351 + %.6300 =l add %.6299, 0 + storel $g_173, %.6300 + %.6302 =l add %.6301, 0 + storel %.248, %.6302 + %.6304 =l add %.6303, 0 + %.6305 =l extsw 0 + %.6306 =l copy %.6305 + storel %.6306, %.6304 + %.6308 =l add %.6307, 0 + storel %.5993, %.6308 + %.6310 =l add %.6309, 0 + %.6311 =l extsw 0 + %.6312 =l mul %.6311, 40 + %.6313 =l add %.5749, %.6312 + %.6314 =l extsw 0 + %.6315 =l mul %.6314, 8 + %.6316 =l add %.6313, %.6315 + storel %.6316, %.6310 + %.6318 =l add %.6317, 0 + %.6319 =w copy 3360582374 + storew %.6319, %.6318 + %.6320 =l add %.6317, 4 + %.6321 =w copy 3360582374 + storew %.6321, %.6320 + %.6322 =l add %.6317, 8 + %.6323 =w copy 3745884853 + storew %.6323, %.6322 + %.6324 =l add %.6317, 12 + %.6325 =l extsw 0 + %.6326 =l sub %.6325, 8 + %.6327 =w copy %.6326 + storew %.6327, %.6324 + %.6328 =l add %.6317, 16 + %.6329 =w copy 1 + storew %.6329, %.6328 + %.6330 =l add %.6317, 20 + %.6331 =w copy 3745884853 + storew %.6331, %.6330 + %.6332 =l add %.6317, 24 + %.6333 =w copy 1 + storew %.6333, %.6332 + %.6334 =l add %.6317, 28 + %.6335 =l extsw 0 + %.6336 =l sub %.6335, 8 + %.6337 =w copy %.6336 + storew %.6337, %.6334 + %.6338 =l add %.6317, 32 + %.6339 =w copy 3745884853 + storew %.6339, %.6338 + %.6340 =l add %.6317, 36 + %.6341 =w copy 3360582374 + storew %.6341, %.6340 + %.6342 =l add %.6317, 40 + %.6343 =w copy 3360582374 + storew %.6343, %.6342 + %.6344 =l add %.6317, 44 + %.6345 =w copy 3745884853 + storew %.6345, %.6344 + %.6346 =l add %.6317, 48 + %.6347 =l extsw 0 + %.6348 =l sub %.6347, 8 + %.6349 =w copy %.6348 + storew %.6349, %.6346 + %.6350 =l add %.6317, 52 + %.6351 =w copy 1 + storew %.6351, %.6350 + %.6352 =l add %.6317, 56 + %.6353 =w copy 3745884853 + storew %.6353, %.6352 + %.6354 =l add %.6317, 60 + %.6355 =w copy 1 + storew %.6355, %.6354 + %.6356 =l add %.6317, 64 + %.6357 =l extsw 0 + %.6358 =l sub %.6357, 8 + %.6359 =w copy %.6358 + storew %.6359, %.6356 + %.6360 =l add %.6317, 68 + %.6361 =w copy 3745884853 + storew %.6361, %.6360 + %.6362 =l add %.6317, 72 + %.6363 =w copy 3360582374 + storew %.6363, %.6362 + %.6364 =l add %.6317, 76 + %.6365 =w copy 3360582374 + storew %.6365, %.6364 + %.6366 =l add %.6317, 80 + %.6367 =w copy 3745884853 + storew %.6367, %.6366 + %.6370 =l extsw 0 + %.6371 =l loadl %.6299 + %.6372 =w cnel %.6370, %.6371 + %.6373 =w copy %.6372 + %.6374 =l copy $g_265 + %.6375 =l mul 0, 1 + %.6376 =l add %.6374, %.6375 + %.6377 =l copy %.6376 + %.6378 =w loadub %.6377 + %.6379 =l extsw 0 + %.6380 =l extsw 1 + %.6381 =l mul %.6380, 240 + %.6382 =l add %.2153, %.6381 + %.6383 =l extsw 3 + %.6384 =l mul %.6383, 40 + %.6385 =l add %.6382, %.6384 + %.6386 =l extsw 0 + %.6387 =l mul %.6386, 8 + %.6388 =l add %.6385, %.6387 + %.6389 =l loadl %.6388 + %.6390 =w ceql %.6379, %.6389 + %.6391 =w copy %.6390 + %.6392 =w call $safe_mul_func_int16_t_s_s(w %.6373, w %.6391) + %.6393 =w extsh %.6392 + %.6394 =w loaduw %.5732 + %.6395 =w cnew %.6393, %.6394 + %.6396 =w cnew %.6395, 0 + jnz %.6396, @logic_right.1361, @logic_join.1362 +@logic_right.1361 + %.6397 =l loadl %.5993 + %.6398 =w loadsh %.6397 + %.6399 =w extsh %.6398 + %.6400 =l extsw 0 + %.6401 =l sub %.6400, 1 + %.6402 =w cnel %.6401, 0 + jnz %.6402, @logic_right.1365, @logic_join.1366 +@logic_right.1365 + %.6403 =w loadub %.2829 + %.6404 =w extub %.6403 + %.6405 =w cnew %.6404, 0 +@logic_join.1366 + %.6406 =w phi @logic_right.1361 %.6402, @logic_right.1365 %.6405 + %.6407 =w copy 0 + %.6408 =w copy 6 + %.6409 =w call $safe_lshift_func_uint16_t_u_u(w %.6407, w %.6408) + %.6410 =w extuh %.6409 + %.6411 =w or %.6406, %.6410 + %.6412 =l extsw %.6411 + %.6413 =l xor %.6412, 0 + %.6414 =w loadub %.6 + %.6415 =l extub %.6414 + %.6416 =w cultl %.6413, %.6415 + %.6417 =w cnew %.6416, 0 + jnz %.6417, @logic_right.1363, @logic_join.1364 +@logic_right.1363 + %.6418 =l extsw 0 + %.6419 =l sub %.6418, 1 + %.6420 =w cnel %.6419, 0 +@logic_join.1364 + %.6421 =w phi @logic_join.1366 %.6417, @logic_right.1363 %.6420 + %.6422 =w and %.6399, %.6421 + %.6423 =w copy %.6422 + storeh %.6423, %.6397 + %.6424 =w extsh %.6423 + %.6425 =w cnew %.6424, 0 +@logic_join.1362 + %.6426 =w phi @if_false.1351 %.6396, @logic_join.1364 %.6425 + %.6427 =l extsw %.6426 + %.6428 =l call $safe_unary_minus_func_uint64_t_u(l %.6427) + %.6429 =w loaduw %.4 + %.6430 =l extuw %.6429 + %.6431 =l or %.6428, %.6430 + %.6432 =w cnel %.6431, 0 + jnz %.6432, @if_true.1367, @if_false.1368 +@if_true.1367 + %.6434 =l add %.6433, 0 + %.6435 =l copy 12462308736532551437 + storel %.6435, %.6434 + %.6437 =l add %.6436, 0 + %.6438 =w copy 1687502936 + storew %.6438, %.6437 + %.6440 =l add %.6439, 0 + %.6441 =w copy 3369665070 + storew %.6441, %.6440 + %.6442 =l add %.6439, 4 + %.6443 =w copy 3369665070 + storew %.6443, %.6442 + %.6444 =l add %.6439, 8 + %.6445 =w copy 3369665070 + storew %.6445, %.6444 + %.6446 =l add %.6439, 12 + %.6447 =w copy 3369665070 + storew %.6447, %.6446 + %.6449 =l loadl %.6299 + %.6450 =l loadl %.6449 + %.6451 =w loadsw %.6450 + %.6452 =l extsw %.6451 + %.6453 =l extsw 0 + %.6454 =l sub %.6453, 6 + %.6455 =l or %.6452, %.6454 + %.6456 =w copy %.6455 + storew %.6456, %.6450 + %.6457 =l extsw %.6456 + storel %.6457, %.6433 + %.6458 =l loadl $g_477 + %.6459 =l sub %.6458, 1 + storel %.6459, $g_477 + jmp @if_join.1369 +@if_false.1368 + %.6460 =w copy 72875385 + %.6461 =l extsw 0 + %.6462 =l mul %.6461, 4 + %.6463 =l add %.5995, %.6462 + storew %.6460, %.6463 + %.6464 =l loadl $g_38 + %.6465 =l loadl %.6464 + ret %.6465 +@if_join.1369 + %.6466 =w copy 305323823 + %.6467 =l loadl $g_173 + %.6468 =w loadsw %.6467 + %.6469 =w call $safe_add_func_int32_t_s_s(w %.6466, w %.6468) + %.6470 =l extsw %.6469 + %.6471 =w cnel 1309538961660777797, %.6470 + %.6472 =w loadub %.5996 + %.6473 =w extub %.6472 + %.6474 =l loadl $g_363 + storel %.2829, %.6474 + %.6475 =l loadl %.6301 + storel %.6, %.6475 + %.6476 =w cnel %.2829, %.6 + %.6477 =w csgtw %.6473, %.6476 + %.6478 =w copy %.6477 + %.6479 =l loadl %.6307 + storel $g_81, %.6479 + %.6480 =l extsw 0 + %.6481 =l mul %.6480, 8 + %.6482 =l add %.5621, %.6481 + %.6483 =l loadl %.6482 + %.6484 =l copy %.6483 + %.6485 =l extsw 8 + %.6486 =l mul %.6485, 8 + %.6487 =l add %.5999, %.6486 + storel %.6484, %.6487 + %.6488 =w ceql $g_81, %.6484 + %.6489 =l loadl $g_38 + %.6490 =l loadl %.6489 + %.6491 =w loadsw %.6490 + %.6492 =l extsw %.6491 + %.6493 =w cnel %.6492, 2495061802 + %.6494 =w call $safe_add_func_int32_t_s_s(w %.6488, w %.6493) + %.6495 =w cnew %.6494, 0 + jnz %.6495, @logic_join.1373, @logic_right.1372 +@logic_right.1372 + %.6496 =w loadub %.6 + %.6497 =w extub %.6496 + %.6498 =w cnew %.6497, 0 +@logic_join.1373 + %.6499 =w phi @if_join.1369 %.6495, @logic_right.1372 %.6498 + %.6500 =w copy %.6499 + %.6501 =w call $safe_mod_func_uint16_t_u_u(w %.6478, w %.6500) + %.6502 =w extuh %.6501 + %.6503 =w csltw %.6471, %.6502 + %.6504 =l copy $g_130 + %.6505 =l mul 8, 1 + %.6506 =l add %.6504, %.6505 + %.6507 =l copy %.6506 + %.6508 =w loadsh %.6507 + %.6509 =w extsh %.6508 + %.6510 =w cnew %.6509, 0 + jnz %.6510, @logic_right.1370, @logic_join.1371 +@logic_right.1370 + %.6511 =w loadub %.6 + %.6512 =w extub %.6511 + %.6513 =w cnew %.6512, 0 +@logic_join.1371 + %.6514 =w phi @logic_join.1373 %.6510, @logic_right.1370 %.6513 + %.6515 =l loadl $g_422 + %.6516 =l extsw 0 + %.6517 =w ceql %.6515, %.6516 + %.6518 =w cnew %.6517, 0 + jnz %.6518, @if_true.1374, @if_false.1375 +@if_true.1374 + %.6520 =l add %.6519, 0 + %.6521 =l copy $g_265 + %.6522 =l mul 8, 1 + %.6523 =l add %.6521, %.6522 + %.6524 =l copy %.6523 + storel %.6524, %.6520 + %.6525 =l loadl %.6519 + %.6526 =w cnel $g_80, %.6525 + %.6527 =l loadl %.6299 + %.6528 =l loadl %.6527 + storew %.6526, %.6528 + %.6529 =l loadl %.2 + ret %.6529 +@if_false.1375 + %.6530 =l loadl %.2 + %.6531 =l loadl %.5982 + storel %.6530, %.6531 + storel %.6530, %.2036 + %.6532 =l loadl %.2128 + %.6533 =l loadl %.6532 + %.6534 =w loadsw %.6533 + %.6535 =w cnew %.6534, 0 + jnz %.6535, @if_true.1377, @if_false.1378 +@if_true.1377 + jmp @for_join.1337 +@if_false.1378 +@if_join.1376 + %.6536 =l extsw 0 + %.6537 =l mul %.6536, 40 + %.6538 =l add %.5749, %.6537 + %.6539 =l extsw 0 + %.6540 =l mul %.6539, 8 + %.6541 =l add %.6538, %.6540 + %.6542 =l loadl %.6541 + %.6543 =l loadl %.6309 + storel %.6542, %.6543 + %.6544 =l loadl $g_23 + %.6545 =w cnel %.6542, %.6544 + %.6546 =w copy %.6545 + %.6547 =w call $safe_lshift_func_uint16_t_u_s(w %.6546, w 3) + %.6548 =w copy %.6547 + %.6549 =w call $safe_rshift_func_int16_t_s_s(w %.6548, w 7) + %.6550 =w extsh %.6549 + %.6551 =w cnew %.6550, 0 + jnz %.6551, @if_true.1379, @if_false.1380 +@if_true.1379 + %.6553 =l add %.6552, 0 + %.6554 =w copy 911566708 + storew %.6554, %.6553 + %.6555 =w loaduw %.6552 + %.6556 =w sub %.6555, 1 + storew %.6556, %.6552 + %.6557 =w loadsw %.2125 + %.6558 =l copy $g_265 + %.6559 =l mul 48, 1 + %.6560 =l add %.6558, %.6559 + %.6561 =l copy %.6560 + %.6562 =w loadsw %.6561 + %.6563 =w copy %.6562 + %.6564 =l loadl %.5629 + %.6565 =l loadl %.6564 + %.6566 =w loaduw %.4 + %.6567 =w cnew %.6566, 0 + jnz %.6567, @logic_join.1382, @logic_right.1381 +@logic_right.1381 + %.6568 =l loadl %.2036 + %.6569 =w loadsw %.6568 + %.6570 =w loaduw %.4 + %.6571 =w loaduw %.4 + %.6572 =w loadub %.6 + %.6573 =w extub %.6572 + %.6574 =w cultw %.6571, %.6573 + %.6575 =w cnew %.6574, 0 + jnz %.6575, @logic_join.1384, @logic_right.1383 +@logic_right.1383 + %.6576 =w loadub %.2832 + %.6577 =l extub %.6576 + %.6578 =w cslel 4740881255833919779, %.6577 + %.6579 =l extsw %.6578 + %.6580 =l extsw 3 + %.6581 =l mul %.6580, 12 + %.6582 =l add %.6317, %.6581 + %.6583 =l extsw 2 + %.6584 =l mul %.6583, 4 + %.6585 =l add %.6582, %.6584 + %.6586 =w loadsw %.6585 + %.6587 =l extsw %.6586 + %.6588 =w cultl %.6587, 65531 + %.6589 =l copy $g_185 + %.6590 =l mul 40, 1 + %.6591 =l add %.6589, %.6590 + %.6592 =l copy %.6591 + %.6593 =w loadsw %.6592 + %.6594 =w csltw %.6588, %.6593 + %.6595 =l extsw 0 + %.6596 =l sub %.6595, 4 + %.6597 =w copy %.6596 + %.6598 =w call $safe_sub_func_int32_t_s_s(w %.6594, w %.6597) + %.6599 =w copy %.6598 + %.6600 =w copy 6 + %.6601 =w call $safe_lshift_func_uint16_t_u_u(w %.6599, w %.6600) + %.6602 =w copy %.6601 + %.6603 =w loadub %.6 + %.6604 =w extub %.6603 + %.6605 =w call $safe_rshift_func_int8_t_s_s(w %.6602, w %.6604) + %.6606 =l extsb %.6605 + %.6607 =l loadl %.2128 + %.6608 =l loadl %.6607 + %.6609 =w loadsw %.6608 + %.6610 =l extsw %.6609 + %.6611 =l call $safe_mod_func_uint64_t_u_u(l %.6606, l %.6610) + %.6612 =l extsw 0 + %.6613 =l mul %.6612, 40 + %.6614 =l add %.5749, %.6613 + %.6615 =l extsw 0 + %.6616 =l mul %.6615, 8 + %.6617 =l add %.6614, %.6616 + %.6618 =l loadl %.6617 + %.6619 =l extsw 0 + %.6620 =w cnel %.6618, %.6619 + %.6621 =l extsw %.6620 + %.6622 =l or %.6621, 4294967293 + %.6623 =l or %.6622, 1 + %.6624 =w copy %.6623 + %.6625 =l loadl %.2128 + %.6626 =l loadl %.6625 + %.6627 =w loadsw %.6626 + %.6628 =w copy %.6627 + %.6629 =w call $safe_add_func_int16_t_s_s(w %.6624, w %.6628) + %.6630 =w extsh %.6629 + %.6631 =w cnew %.6630, 0 + jnz %.6631, @logic_join.1388, @logic_right.1387 +@logic_right.1387 + %.6632 =l copy $g_130 + %.6633 =l mul 8, 1 + %.6634 =l add %.6632, %.6633 + %.6635 =l copy %.6634 + %.6636 =w loadsh %.6635 + %.6637 =w extsh %.6636 + %.6638 =w cnew %.6637, 0 +@logic_join.1388 + %.6639 =w phi @logic_right.1383 %.6631, @logic_right.1387 %.6638 + %.6640 =l extsw %.6639 + %.6641 =l call $safe_unary_minus_func_int64_t_s(l %.6640) + %.6642 =l loadl %.2036 + %.6643 =w loadsw %.6642 + %.6644 =l extsw %.6643 + %.6645 =w cnel %.6641, %.6644 + %.6646 =w cnew %.6645, 0 + jnz %.6646, @logic_right.1385, @logic_join.1386 +@logic_right.1385 + %.6647 =w cnel 39637, 0 +@logic_join.1386 + %.6648 =w phi @logic_join.1388 %.6646, @logic_right.1385 %.6647 + %.6649 =w csltl %.6579, 1651712922 + %.6650 =w cnew %.6649, 0 +@logic_join.1384 + %.6651 =w phi @logic_right.1381 %.6575, @logic_join.1386 %.6650 + %.6652 =w or %.6569, %.6651 + %.6653 =l copy $g_130 + %.6654 =l mul 8, 1 + %.6655 =l add %.6653, %.6654 + %.6656 =l copy %.6655 + %.6657 =w loadsh %.6656 + %.6658 =l copy $g_185 + %.6659 =l mul 16, 1 + %.6660 =l add %.6658, %.6659 + %.6661 =l copy %.6660 + %.6662 =w loadsw %.6661 + %.6663 =w cnew %.6662, 0 +@logic_join.1382 + %.6664 =w phi @if_true.1379 %.6567, @logic_join.1384 %.6663 + %.6665 =w loaduw %.4 + %.6666 =l extuw %.6665 + %.6667 =l or %.6565, %.6666 + storel %.6667, %.6564 + %.6668 =w loadsb %.2042 + %.6669 =l extsb %.6668 + %.6670 =w cugtl %.6667, %.6669 + %.6671 =w copy %.6670 + %.6672 =w call $safe_mul_func_int16_t_s_s(w %.6563, w %.6671) + %.6673 =w extsh %.6672 + %.6674 =l loadl $g_173 + storew %.6673, %.6674 + %.6675 =w or %.6557, %.6673 + storew %.6675, %.2125 + %.6676 =l loadl %.2 + %.6677 =w loadsw %.6676 + %.6678 =w cnew %.6677, 0 + jnz %.6678, @if_true.1389, @if_false.1390 +@if_true.1389 + jmp @for_join.1337 +@if_false.1390 + jmp @if_join.1391 +@if_false.1380 + %.6680 =l add %.6679, 0 + %.6681 =w copy 140 + storeb %.6681, %.6680 + storew 0, %.6683 +@for_cond.1392 + %.6684 =w loadsw %.6683 + %.6685 =w csltw %.6684, 1 + jnz %.6685, @for_body.1393, @for_join.1395 +@for_body.1393 + %.6686 =l copy $g_185 + %.6687 =l mul 8, 1 + %.6688 =l add %.6686, %.6687 + %.6689 =l copy %.6688 + %.6690 =w loadsw %.6683 + %.6691 =l extsw %.6690 + %.6692 =l mul %.6691, 8 + %.6693 =l add %.6682, %.6692 + storel %.6689, %.6693 +@for_cont.1394 + %.6694 =w loadsw %.6683 + %.6695 =w add %.6694, 1 + storew %.6695, %.6683 + jmp @for_cond.1392 +@for_join.1395 + %.6696 =l loadl %.6299 + %.6697 =l loadl %.6696 + %.6698 =w loadsw %.6697 + %.6699 =l extsw %.6698 + %.6700 =l extsw 0 + %.6701 =l sub %.6700, 5 + %.6702 =l and %.6699, %.6701 + %.6703 =w copy %.6702 + storew %.6703, %.6697 + %.6704 =l loadl %.6299 + %.6705 =l loadl %.6704 + %.6706 =l loadl %.6299 + storel %.6705, %.6706 + %.6707 =w loadsw %.2149 + %.6708 =w loadsb %.6679 + %.6709 =w copy %.6708 + %.6710 =l copy 11888349605583498864 + storel %.6710, $g_82 + %.6711 =w cnel %.6710, 0 + jnz %.6711, @logic_right.1396, @logic_join.1397 +@logic_right.1396 + %.6712 =w loaduw %.4 + %.6713 =w xor %.6712, 18446744073709551615 + %.6714 =w copy %.6713 + %.6715 =l loadl %.6299 + %.6716 =l loadl %.6715 + storew %.6714, %.6716 + %.6717 =w cnew %.6714, 0 +@logic_join.1397 + %.6718 =w phi @for_join.1395 %.6711, @logic_right.1396 %.6717 + %.6719 =w copy %.6718 + %.6720 =w call $safe_add_func_uint8_t_u_u(w %.6709, w %.6719) + %.6721 =w extub %.6720 + %.6722 =w and %.6707, %.6721 + storew %.6722, %.2149 + %.6723 =l loadl %.6299 + %.6724 =l loadl %.6723 + %.6725 =w loadsw %.6724 + %.6726 =l loadl $g_82 + %.6727 =l copy 6184310116488843811 + %.6728 =l copy 1 + %.6729 =w cugtl %.6727, %.6728 + %.6730 =l extsw %.6729 + %.6731 =w cslel %.6726, %.6730 + %.6732 =w loaduw %.4 + %.6733 =l extuw %.6732 + %.6734 =w csgel 408415716, %.6733 + %.6735 =l copy 7 + %.6736 =w cnel %.6735, 1 + %.6737 =w xor %.6731, %.6736 + %.6738 =w and %.6725, %.6737 + storew %.6738, %.6724 +@if_join.1391 + %.6739 =l loadl %.6126 + ret %.6739 +@if_join.1360 + %.6740 =l loadl %.2 + %.6741 =w loadsw %.6740 + %.6742 =l loadl $g_173 + storew %.6741, %.6742 + %.6743 =l loadl %.6126 + storew %.6741, %.6743 + jmp @if_join.1398 +@if_false.1345 + %.6745 =l add %.6744, 0 + %.6746 =l copy $g_130 + %.6747 =l mul 8, 1 + %.6748 =l add %.6746, %.6747 + %.6749 =l copy %.6748 + storel %.6749, %.6745 + %.6752 =l add %.6751, 0 + %.6753 =w copy 3440299814 + storew %.6753, %.6752 + %.6755 =l add %.6754, 0 + %.6756 =l copy $g_185 + %.6757 =l mul 32, 1 + %.6758 =l add %.6756, %.6757 + %.6759 =l copy %.6758 + storel %.6759, %.6755 + storew 0, %.6760 +@for_cond.1399 + %.6761 =w loadsw %.6760 + %.6762 =w csltw %.6761, 2 + jnz %.6762, @for_body.1400, @for_join.1402 +@for_body.1400 + %.6763 =w copy 1393370637 + %.6764 =w loadsw %.6760 + %.6765 =l extsw %.6764 + %.6766 =l mul %.6765, 4 + %.6767 =l add %.6750, %.6766 + storew %.6763, %.6767 +@for_cont.1401 + %.6768 =w loadsw %.6760 + %.6769 =w add %.6768, 1 + storew %.6769, %.6760 + jmp @for_cond.1399 +@for_join.1402 + %.6770 =l loadl $g_88 + %.6771 =l loadl %.6770 + %.6772 =l loadl %.6771 + %.6773 =w loadsw %.6772 + %.6774 =w cnew %.6773, 0 + jnz %.6774, @if_true.1403, @if_false.1404 +@if_true.1403 + jmp @for_join.1337 +@if_false.1404 + %.6775 =w copy 0 + storew %.6775, %.4 +@for_cond.1405 + %.6776 =w loaduw %.4 + %.6777 =w copy 24 + %.6778 =w cnew %.6776, %.6777 + jnz %.6778, @for_body.1406, @for_join.1408 +@for_body.1406 + %.6781 =l add %.6780, 0 + %.6782 =w copy 72 + storeb %.6782, %.6781 + %.6783 =l add %.6780, 1 + storeb 0, %.6783 + %.6784 =l add %.6780, 2 + storeh 0, %.6784 + %.6785 =l add %.6780, 4 + storew 0, %.6785 + %.6786 =l add %.6780, 8 + storel 321589332028328224, %.6786 + %.6787 =l add %.6780, 16 + %.6788 =w copy 9 + storew %.6788, %.6787 + %.6789 =l add %.6780, 20 + storew 0, %.6789 + %.6790 =l add %.6780, 24 + %.6791 =l copy 1143993877391193064 + storel %.6791, %.6790 + %.6792 =l add %.6780, 32 + %.6793 =w copy 4294967295 + storew %.6793, %.6792 + %.6794 =l add %.6780, 36 + %.6795 =w copy 6 + storew %.6795, %.6794 + %.6796 =l add %.6780, 40 + %.6797 =w copy 2065283816 + storew %.6797, %.6796 + %.6798 =l add %.6780, 44 + %.6799 =l extsw 0 + %.6800 =l sub %.6799, 1 + %.6801 =w copy %.6800 + storew %.6801, %.6798 + %.6802 =l add %.6780, 48 + %.6803 =w copy 3321033948 + storew %.6803, %.6802 + %.6804 =l add %.6780, 52 + storew 0, %.6804 + storew 0, %.6806 +@for_cond.1409 + %.6808 =w loadsw %.6806 + %.6809 =w csltw %.6808, 7 + jnz %.6809, @for_body.1410, @for_join.1412 +@for_body.1410 + storew 0, %.6807 +@for_cond.1413 + %.6810 =w loadsw %.6807 + %.6811 =w csltw %.6810, 2 + jnz %.6811, @for_body.1414, @for_join.1416 +@for_body.1414 + %.6812 =w copy 1 + %.6813 =w loadsw %.6806 + %.6814 =l extsw %.6813 + %.6815 =l mul %.6814, 2 + %.6816 =l add %.6779, %.6815 + %.6817 =w loadsw %.6807 + %.6818 =l extsw %.6817 + %.6819 =l mul %.6818, 1 + %.6820 =l add %.6816, %.6819 + storeb %.6812, %.6820 +@for_cont.1415 + %.6821 =w loadsw %.6807 + %.6822 =w add %.6821, 1 + storew %.6822, %.6807 + jmp @for_cond.1413 +@for_join.1416 +@for_cont.1411 + %.6823 =w loadsw %.6806 + %.6824 =w add %.6823, 1 + storew %.6824, %.6806 + jmp @for_cond.1409 +@for_join.1412 + storew 0, %.6806 +@for_cond.1417 + %.6825 =w loadsw %.6806 + %.6826 =w csltw %.6825, 1 + jnz %.6826, @for_body.1418, @for_join.1420 +@for_body.1418 + %.6827 =w copy 47661 + %.6828 =w loadsw %.6806 + %.6829 =l extsw %.6828 + %.6830 =l mul %.6829, 2 + %.6831 =l add %.6805, %.6830 + storeh %.6827, %.6831 +@for_cont.1419 + %.6832 =w loadsw %.6806 + %.6833 =w add %.6832, 1 + storew %.6833, %.6806 + jmp @for_cond.1417 +@for_join.1420 + %.6834 =w loadub %.6 + %.6835 =w loaduw %.4 + %.6836 =w copy %.6835 + %.6837 =w call $safe_lshift_func_uint8_t_u_s(w %.6836, w 1) + %.6838 =w loaduw %.4 + %.6839 =w copy %.6838 + %.6840 =w call $safe_sub_func_uint8_t_u_u(w %.6837, w %.6839) + %.6841 =l extub %.6840 + %.6842 =l and 248, %.6841 + %.6843 =w cnel %.6842, 0 + jnz %.6843, @if_true.1421, @if_false.1422 +@if_true.1421 + %.6844 =l loadl %.2 + storel %.6844, %.2 + %.6845 =w cslel 20, 0 + %.6846 =l loadl %.2036 + storew %.6845, %.6846 + jmp @if_join.1423 +@if_false.1422 + %.6848 =l add %.6847, 0 + %.6849 =w copy 65534 + storeh %.6849, %.6848 + %.6851 =l add %.6850, 0 + %.6852 =w copy 1179286828 + storew %.6852, %.6851 + %.6854 =l add %.6853, 0 + %.6855 =l extsw 0 + %.6856 =l sub %.6855, 4 + %.6857 =w copy %.6856 + storew %.6857, %.6854 + %.6858 =l extsw 5 + %.6859 =l mul %.6858, 2 + %.6860 =l add %.6779, %.6859 + %.6861 =l extsw 1 + %.6862 =l mul %.6861, 1 + %.6863 =l add %.6860, %.6862 + %.6864 =w loadub %.6863 + %.6865 =w sub %.6864, 1 + storeb %.6865, %.6863 + %.6866 =w loadsw %.6751 + %.6867 =w loadsw %.6853 + %.6868 =w loaduh %.6847 + %.6869 =w sub %.6868, 1 + storeh %.6869, %.6847 + %.6870 =l loadl %.6744 + %.6871 =w loadsh %.6870 + %.6872 =w extsh %.6871 + %.6873 =l extsw 4 + %.6874 =l mul %.6873, 8 + %.6875 =l add %.5621, %.6874 + %.6876 =l loadl %.6875 + %.6877 =l loadl %.6744 + %.6878 =w ceql %.6876, %.6877 + %.6879 =l extsw %.6878 + %.6880 =l loadl %.5629 + %.6881 =l loadl %.6880 + %.6882 =l xor %.6881, 17145105804842445641 + storel %.6882, %.6880 + %.6883 =w cugtl %.6879, %.6882 + %.6884 =l loadl %.2036 + %.6885 =w loadsw %.6884 + %.6886 =l copy $g_518 + %.6887 =l mul 40, 1 + %.6888 =l add %.6886, %.6887 + %.6889 =l copy %.6888 + %.6890 =w loadsw %.6889 + %.6891 =w csgew %.6883, %.6890 + %.6892 =l extsw 1 + %.6893 =l mul %.6892, 4 + %.6894 =l add %.6750, %.6893 + %.6895 =w loadsw %.6894 + %.6896 =l loadl $g_422 + %.6897 =w loaduw %.6896 + %.6898 =w loadsw %.6850 + %.6899 =w copy %.6898 + %.6900 =l loadl %.2128 + %.6901 =l loadl %.6900 + %.6902 =w loadsw %.6901 + %.6903 =w copy %.6902 + %.6904 =w call $safe_rshift_func_uint16_t_u_u(w %.6899, w %.6903) + %.6905 =l extsw 0 + %.6906 =l mul %.6905, 4 + %.6907 =l add %.6750, %.6906 + %.6908 =w loadsw %.6907 + %.6909 =l copy $g_185 + %.6910 =l mul 48, 1 + %.6911 =l add %.6909, %.6910 + %.6912 =l copy %.6911 + %.6913 =w loadsw %.6912 + %.6914 =w cnew %.6908, %.6913 + %.6915 =l copy 1 + storel %.6915, $g_82 + %.6916 =l copy $g_265 + %.6917 =l mul 32, 1 + %.6918 =l add %.6916, %.6917 + %.6919 =l copy %.6918 + %.6920 =w loaduw %.6919 + %.6921 =l extuw %.6920 + %.6922 =l xor %.6915, %.6921 + %.6923 =w copy %.6922 + %.6924 =l loadl %.2128 + %.6925 =l loadl %.6924 + %.6926 =w loadsw %.6925 + %.6927 =w call $safe_lshift_func_int16_t_s_s(w %.6923, w %.6926) + %.6928 =l extsh %.6927 + %.6929 =l xor %.6928, 255 + %.6930 =l copy 1 + %.6931 =w ceql %.6929, %.6930 + %.6932 =w copy %.6931 + %.6933 =w call $safe_mul_func_uint32_t_u_u(w %.6897, w %.6932) + %.6934 =w loaduw %.4 + %.6935 =l extsw 0 + %.6936 =l loadl %.5890 + %.6937 =w ceql %.6935, %.6936 + %.6938 =w copy %.6937 + %.6939 =l loadl $g_422 + %.6940 =w loaduw %.6939 + %.6941 =w call $safe_add_func_uint32_t_u_u(w %.6938, w %.6940) + %.6942 =w cnew %.6941, 0 + jnz %.6942, @logic_right.1426, @logic_join.1427 +@logic_right.1426 + %.6943 =l loadl %.2036 + %.6944 =w loadsw %.6943 + %.6945 =w cnew %.6944, 0 +@logic_join.1427 + %.6946 =w phi @if_false.1422 %.6942, @logic_right.1426 %.6945 + %.6947 =l extsw 9 + %.6948 =l mul %.6947, 8 + %.6949 =l add %.5631, %.6948 + %.6950 =l extsw 0 + %.6951 =w cnel %.6949, %.6950 + %.6952 =w ceqw %.6951, 0 + %.6953 =w cnew %.6952, 0 + jnz %.6953, @logic_join.1425, @logic_right.1424 +@logic_right.1424 + %.6954 =w cnel 1980754864, 0 +@logic_join.1425 + %.6955 =w phi @logic_join.1427 %.6953, @logic_right.1424 %.6954 + %.6956 =w csltw %.6895, %.6955 + %.6957 =w copy %.6956 + %.6958 =w copy 1113302927 + %.6959 =w call $safe_div_func_uint32_t_u_u(w %.6957, w %.6958) + %.6960 =w loadub $g_566 + %.6961 =w extub %.6960 + %.6962 =w and %.6959, %.6961 + %.6963 =w copy %.6962 + %.6964 =w call $safe_rshift_func_int16_t_s_s(w %.6963, w 1) + %.6965 =l extsw 0 + %.6966 =l mul %.6965, 2 + %.6967 =l add %.6805, %.6966 + %.6968 =w loadsh %.6967 + %.6969 =l extsw 1 + %.6970 =l mul %.6969, 4 + %.6971 =l add %.6750, %.6970 + %.6972 =w loadsw %.6971 + %.6973 =w copy %.6972 + %.6974 =w call $safe_lshift_func_int16_t_s_u(w %.6968, w %.6973) + %.6975 =w extsh %.6974 + %.6976 =l loadl $g_173 + storew %.6975, %.6976 + %.6977 =l extsw %.6975 + %.6978 =w cugel %.6977, 0 + %.6979 =w csgew %.6891, %.6978 + %.6980 =w xor %.6872, %.6979 + %.6981 =w copy %.6980 + storeh %.6981, %.6870 + %.6982 =w copy %.6981 + %.6983 =w call $safe_div_func_uint16_t_u_u(w %.6869, w %.6982) + %.6984 =w extuh %.6983 + %.6985 =w and %.6867, %.6984 + storew %.6985, %.6853 + %.6986 =w or %.6866, %.6985 + storew %.6986, %.6751 +@if_join.1423 +@for_cont.1407 + %.6987 =w loaduw %.4 + %.6988 =w add %.6987, 1 + storew %.6988, %.4 + jmp @for_cond.1405 +@for_join.1408 + %.6989 =w copy 0 + storeb %.6989, %.6 +@for_cond.1428 + %.6990 =w loadub %.6 + %.6991 =w extub %.6990 + %.6992 =w cslew %.6991, 3 + jnz %.6992, @for_body.1429, @for_join.1431 +@for_body.1429 + %.6995 =l loadl %.2 + ret %.6995 +@for_cont.1430 + %.6996 =w loadub %.6 + %.6997 =w extub %.6996 + %.6998 =w add %.6997, 1 + %.6999 =w copy %.6998 + storeb %.6999, %.6 + jmp @for_cond.1428 +@for_join.1431 + %.7000 =l loadl $g_173 + %.7001 =w loadsw %.7000 + %.7002 =l extsw %.7001 + %.7003 =w loadub %.6 + %.7004 =w extub %.7003 + %.7005 =w loaduh $g_425 + %.7006 =w extuh %.7005 + %.7007 =w copy 5 + %.7008 =l loadl %.2005 + storeb %.7007, %.7008 + %.7009 =w extsb %.7007 + %.7010 =w or %.7006, %.7009 + %.7011 =w or %.7004, %.7010 + %.7012 =w copy %.7011 + storeb %.7012, %.6 + %.7013 =l loadl %.2128 + %.7014 =l loadl %.7013 + %.7015 =w loadsw %.7014 + %.7016 =l copy $g_265 + %.7017 =l mul 40, 1 + %.7018 =l add %.7016, %.7017 + %.7019 =l copy %.7018 + %.7020 =w loadsw %.7019 + %.7021 =l copy $g_185 + %.7022 =l mul 32, 1 + %.7023 =l add %.7021, %.7022 + %.7024 =l copy %.7023 + %.7025 =w loaduw %.7024 + %.7026 =w copy %.7025 + %.7027 =w loaduw %.4 + %.7028 =l loadl $g_477 + %.7029 =l loadl %.6754 + %.7030 =l extsw 0 + %.7031 =w ceql %.7029, %.7030 + %.7032 =w xor %.7031, 18446744073709551615 + %.7033 =w loadsw %.6751 + %.7034 =w cnew %.7032, %.7033 + %.7035 =w cnew %.7034, 0 + jnz %.7035, @logic_right.1438, @logic_join.1439 +@logic_right.1438 + %.7036 =l copy $g_265 + %.7037 =l mul 16, 1 + %.7038 =l add %.7036, %.7037 + %.7039 =l copy %.7038 + %.7040 =w loadsw %.7039 + %.7041 =w cnew %.7040, 0 +@logic_join.1439 + %.7042 =w phi @for_join.1431 %.7035, @logic_right.1438 %.7041 + %.7043 =w copy %.7042 + %.7044 =w call $safe_mul_func_int8_t_s_s(w %.7026, w %.7043) + %.7045 =w extsb %.7044 + %.7046 =w cslew %.7020, %.7045 + %.7047 =l copy $g_265 + %.7048 =l mul 36, 1 + %.7049 =l add %.7047, %.7048 + %.7050 =l copy %.7049 + %.7051 =w loaduw %.7050 + %.7052 =w copy 0 + %.7053 =w ceqw %.7051, %.7052 + %.7054 =l extsw %.7053 + %.7055 =w csltl 661320705, %.7054 + %.7056 =w copy %.7055 + %.7057 =l extsw 0 + %.7058 =l sub %.7057, 1 + %.7059 =w copy %.7058 + %.7060 =w call $safe_add_func_uint8_t_u_u(w %.7056, w %.7059) + %.7061 =l extub %.7060 + %.7062 =l extsw 0 + %.7063 =l sub %.7062, 1 + %.7064 =w ceql %.7061, %.7063 + %.7065 =w cnew %.7064, 0 + jnz %.7065, @logic_join.1437, @logic_right.1436 +@logic_right.1436 + %.7066 =l loadl %.2128 + %.7067 =l loadl %.7066 + %.7068 =w loadsw %.7067 + %.7069 =w cnew %.7068, 0 +@logic_join.1437 + %.7070 =w phi @logic_join.1439 %.7065, @logic_right.1436 %.7069 + %.7071 =w copy %.7070 + %.7072 =l copy $g_518 + %.7073 =l mul 8, 1 + %.7074 =l add %.7072, %.7073 + %.7075 =l copy %.7074 + %.7076 =l loadl %.7075 + %.7077 =w copy %.7076 + %.7078 =w call $safe_sub_func_int8_t_s_s(w %.7071, w %.7077) + %.7079 =w extsb %.7078 + %.7080 =l extsw 0 + %.7081 =l mul %.7080, 4 + %.7082 =l add %.6750, %.7081 + %.7083 =w loadsw %.7082 + %.7084 =w cslew %.7079, %.7083 + %.7085 =w loaduw %.4 + %.7086 =l extuw %.7085 + %.7087 =l loadl $g_80 + %.7088 =w csltl %.7086, %.7087 + %.7089 =w cnew %.7088, 0 + jnz %.7089, @logic_join.1435, @logic_right.1434 +@logic_right.1434 + %.7090 =w loaduw %.4 + %.7091 =w cnew %.7090, 0 +@logic_join.1435 + %.7092 =w phi @logic_join.1437 %.7089, @logic_right.1434 %.7091 + %.7093 =w cnew %.7092, 0 + jnz %.7093, @logic_right.1432, @logic_join.1433 +@logic_right.1432 + %.7094 =w loaduw %.4 + %.7095 =w cnew %.7094, 0 +@logic_join.1433 + %.7096 =w phi @logic_join.1435 %.7093, @logic_right.1432 %.7095 + %.7097 =w copy %.7096 + %.7098 =w copy 2 + %.7099 =w call $safe_mul_func_int16_t_s_s(w %.7097, w %.7098) + %.7100 =w copy %.7099 + %.7101 =w copy 252 + %.7102 =w call $safe_mod_func_uint8_t_u_u(w %.7100, w %.7101) + %.7103 =w call $safe_add_func_uint8_t_u_u(w %.7012, w %.7102) + %.7104 =l or %.7002, 2129988974 + %.7105 =w copy %.7104 + storew %.7105, %.7000 +@if_join.1398 + %.7106 =w loaduw %.5892 + %.7107 =w add %.7106, 1 + storew %.7107, %.5892 +@for_cont.1336 + %.7108 =w loadub $g_46 + %.7109 =w add %.7108, 1 + storeb %.7109, $g_46 + jmp @for_cond.1334 +@for_join.1337 + jmp @if_join.1440 +@if_false.1243 + %.7111 =l add %.7110, 0 + %.7112 =l copy 0 + storel %.7112, %.7111 + %.7113 =l add %.7110, 8 + %.7114 =l copy 0 + storel %.7114, %.7113 + %.7115 =l add %.7110, 16 + %.7116 =l copy 0 + storel %.7116, %.7115 + %.7117 =l add %.7110, 24 + %.7118 =l copy 0 + storel %.7118, %.7117 + %.7119 =l add %.7110, 32 + %.7120 =l copy 0 + storel %.7120, %.7119 + %.7121 =l add %.7110, 40 + %.7122 =l copy 0 + storel %.7122, %.7121 + %.7123 =l add %.7110, 48 + %.7124 =l copy 0 + storel %.7124, %.7123 + %.7125 =l add %.7110, 56 + %.7126 =l copy 0 + storel %.7126, %.7125 + %.7128 =l add %.7127, 0 + %.7129 =l extsw 2 + %.7130 =l mul %.7129, 360 + %.7131 =l add %.250, %.7130 + %.7132 =l extsw 1 + %.7133 =l mul %.7132, 120 + %.7134 =l add %.7131, %.7133 + %.7135 =l extsw 1 + %.7136 =l mul %.7135, 20 + %.7137 =l add %.7134, %.7136 + %.7138 =l copy %.7137 + %.7139 =l mul 8, 1 + %.7140 =l add %.7138, %.7139 + %.7141 =l copy %.7140 + storel %.7141, %.7128 + %.7143 =l add %.7142, 0 + storel %.7127, %.7143 + %.7145 =l add %.7144, 0 + %.7146 =l copy 7 + storel %.7146, %.7145 + %.7148 =l add %.7147, 0 + storel $g_425, %.7148 + %.7149 =l add %.7147, 8 + storel $g_425, %.7149 + %.7150 =l add %.7147, 16 + storel $g_425, %.7150 + %.7151 =l add %.7147, 24 + storel $g_425, %.7151 + %.7153 =l add %.7152, 0 + %.7154 =w copy 2883204843 + storew %.7154, %.7153 + %.7156 =l add %.7155, 0 + %.7157 =l extsw 0 + %.7158 =l copy %.7157 + storel %.7158, %.7156 + %.7159 =l add %.7155, 8 + %.7160 =l extsw 0 + %.7161 =l copy %.7160 + storel %.7161, %.7159 + %.7162 =l add %.7155, 16 + storel $g_173, %.7162 + %.7163 =l add %.7155, 24 + %.7164 =l extsw 3 + %.7165 =l mul %.7164, 320 + %.7166 =l add %.7, %.7165 + %.7167 =l extsw 1 + %.7168 =l mul %.7167, 64 + %.7169 =l add %.7166, %.7168 + %.7170 =l extsw 4 + %.7171 =l mul %.7170, 8 + %.7172 =l add %.7169, %.7171 + storel %.7172, %.7163 + %.7173 =l add %.7155, 32 + storel %.2036, %.7173 + %.7174 =l add %.7155, 40 + %.7175 =l extsw 0 + %.7176 =l copy %.7175 + storel %.7176, %.7174 + %.7177 =l add %.7155, 48 + storel $g_23, %.7177 + %.7178 =l add %.7155, 56 + storel %.2036, %.7178 + %.7179 =l add %.7155, 64 + storel $g_173, %.7179 + %.7180 =l add %.7155, 72 + storel %.2036, %.7180 + %.7181 =l add %.7155, 80 + storel %.2036, %.7181 + %.7182 =l add %.7155, 88 + %.7183 =l extsw 3 + %.7184 =l mul %.7183, 320 + %.7185 =l add %.7, %.7184 + %.7186 =l extsw 3 + %.7187 =l mul %.7186, 64 + %.7188 =l add %.7185, %.7187 + %.7189 =l extsw 1 + %.7190 =l mul %.7189, 8 + %.7191 =l add %.7188, %.7190 + storel %.7191, %.7182 + %.7192 =l add %.7155, 96 + %.7193 =l extsw 3 + %.7194 =l mul %.7193, 320 + %.7195 =l add %.7, %.7194 + %.7196 =l extsw 3 + %.7197 =l mul %.7196, 64 + %.7198 =l add %.7195, %.7197 + %.7199 =l extsw 1 + %.7200 =l mul %.7199, 8 + %.7201 =l add %.7198, %.7200 + storel %.7201, %.7192 + %.7202 =l add %.7155, 104 + %.7203 =l extsw 3 + %.7204 =l mul %.7203, 320 + %.7205 =l add %.7, %.7204 + %.7206 =l extsw 3 + %.7207 =l mul %.7206, 64 + %.7208 =l add %.7205, %.7207 + %.7209 =l extsw 1 + %.7210 =l mul %.7209, 8 + %.7211 =l add %.7208, %.7210 + storel %.7211, %.7202 + %.7212 =l add %.7155, 112 + %.7213 =l extsw 0 + %.7214 =l copy %.7213 + storel %.7214, %.7212 + %.7215 =l add %.7155, 120 + storel %.2036, %.7215 + %.7216 =l add %.7155, 128 + %.7217 =l extsw 0 + %.7218 =l copy %.7217 + storel %.7218, %.7216 + %.7219 =l add %.7155, 136 + storel %.2036, %.7219 + %.7220 =l add %.7155, 144 + %.7221 =l extsw 0 + %.7222 =l copy %.7221 + storel %.7222, %.7220 + %.7223 =l add %.7155, 152 + storel $g_23, %.7223 + %.7224 =l add %.7155, 160 + %.7225 =l extsw 0 + %.7226 =l copy %.7225 + storel %.7226, %.7224 + %.7227 =l add %.7155, 168 + storel $g_173, %.7227 + %.7228 =l add %.7155, 176 + storel $g_173, %.7228 + %.7229 =l add %.7155, 184 + storel %.2036, %.7229 + %.7230 =l add %.7155, 192 + storel $g_23, %.7230 + %.7231 =l add %.7155, 200 + storel $g_173, %.7231 + %.7232 =l add %.7155, 208 + storel $g_173, %.7232 + %.7233 =l add %.7155, 216 + storel %.2036, %.7233 + %.7234 =l add %.7155, 224 + %.7235 =l extsw 2 + %.7236 =l mul %.7235, 320 + %.7237 =l add %.7, %.7236 + %.7238 =l extsw 2 + %.7239 =l mul %.7238, 64 + %.7240 =l add %.7237, %.7239 + %.7241 =l extsw 0 + %.7242 =l mul %.7241, 8 + %.7243 =l add %.7240, %.7242 + storel %.7243, %.7234 + %.7244 =l add %.7155, 232 + storel $g_23, %.7244 + %.7245 =l add %.7155, 240 + storel %.2036, %.7245 + %.7246 =l add %.7155, 248 + %.7247 =l extsw 3 + %.7248 =l mul %.7247, 320 + %.7249 =l add %.7, %.7248 + %.7250 =l extsw 3 + %.7251 =l mul %.7250, 64 + %.7252 =l add %.7249, %.7251 + %.7253 =l extsw 1 + %.7254 =l mul %.7253, 8 + %.7255 =l add %.7252, %.7254 + storel %.7255, %.7246 + %.7256 =l add %.7155, 256 + %.7257 =l extsw 0 + %.7258 =l copy %.7257 + storel %.7258, %.7256 + %.7259 =l add %.7155, 264 + %.7260 =l extsw 0 + %.7261 =l copy %.7260 + storel %.7261, %.7259 + %.7262 =l add %.7155, 272 + %.7263 =l extsw 0 + %.7264 =l copy %.7263 + storel %.7264, %.7262 + %.7265 =l add %.7155, 280 + storel $g_173, %.7265 + %.7266 =l add %.7155, 288 + storel $g_23, %.7266 + %.7267 =l add %.7155, 296 + %.7268 =l extsw 3 + %.7269 =l mul %.7268, 320 + %.7270 =l add %.7, %.7269 + %.7271 =l extsw 1 + %.7272 =l mul %.7271, 64 + %.7273 =l add %.7270, %.7272 + %.7274 =l extsw 2 + %.7275 =l mul %.7274, 8 + %.7276 =l add %.7273, %.7275 + storel %.7276, %.7267 + %.7277 =l add %.7155, 304 + storel $g_23, %.7277 + %.7278 =l add %.7155, 312 + %.7279 =l extsw 3 + %.7280 =l mul %.7279, 320 + %.7281 =l add %.7, %.7280 + %.7282 =l extsw 1 + %.7283 =l mul %.7282, 64 + %.7284 =l add %.7281, %.7283 + %.7285 =l extsw 6 + %.7286 =l mul %.7285, 8 + %.7287 =l add %.7284, %.7286 + storel %.7287, %.7278 + %.7288 =l add %.7155, 320 + storel %.2036, %.7288 + %.7289 =l add %.7155, 328 + storel $g_23, %.7289 + %.7290 =l add %.7155, 336 + %.7291 =l extsw 0 + %.7292 =l copy %.7291 + storel %.7292, %.7290 + %.7293 =l add %.7155, 344 + %.7294 =l extsw 0 + %.7295 =l copy %.7294 + storel %.7295, %.7293 + %.7296 =l add %.7155, 352 + storel %.2036, %.7296 + %.7297 =l add %.7155, 360 + storel %.2036, %.7297 + %.7298 =l add %.7155, 368 + storel %.2036, %.7298 + %.7299 =l add %.7155, 376 + storel %.2036, %.7299 + %.7300 =l add %.7155, 384 + %.7301 =l extsw 0 + %.7302 =l copy %.7301 + storel %.7302, %.7300 + %.7303 =l add %.7155, 392 + storel %.2036, %.7303 + %.7304 =l add %.7155, 400 + %.7305 =l extsw 3 + %.7306 =l mul %.7305, 320 + %.7307 =l add %.7, %.7306 + %.7308 =l extsw 3 + %.7309 =l mul %.7308, 64 + %.7310 =l add %.7307, %.7309 + %.7311 =l extsw 1 + %.7312 =l mul %.7311, 8 + %.7313 =l add %.7310, %.7312 + storel %.7313, %.7304 + %.7314 =l add %.7155, 408 + storel $g_23, %.7314 + %.7315 =l add %.7155, 416 + storel %.2036, %.7315 + %.7316 =l add %.7155, 424 + %.7317 =l extsw 0 + %.7318 =l copy %.7317 + storel %.7318, %.7316 + %.7319 =l add %.7155, 432 + storel $g_173, %.7319 + %.7320 =l add %.7155, 440 + %.7321 =l extsw 0 + %.7322 =l mul %.7321, 320 + %.7323 =l add %.7, %.7322 + %.7324 =l extsw 0 + %.7325 =l mul %.7324, 64 + %.7326 =l add %.7323, %.7325 + %.7327 =l extsw 2 + %.7328 =l mul %.7327, 8 + %.7329 =l add %.7326, %.7328 + storel %.7329, %.7320 + %.7330 =l add %.7155, 448 + %.7331 =l extsw 0 + %.7332 =l copy %.7331 + storel %.7332, %.7330 + %.7333 =l add %.7155, 456 + %.7334 =l extsw 0 + %.7335 =l copy %.7334 + storel %.7335, %.7333 + %.7336 =l add %.7155, 464 + %.7337 =l extsw 0 + %.7338 =l copy %.7337 + storel %.7338, %.7336 + %.7339 =l add %.7155, 472 + storel $g_173, %.7339 + %.7340 =l add %.7155, 480 + storel %.2036, %.7340 + %.7341 =l add %.7155, 488 + %.7342 =l extsw 3 + %.7343 =l mul %.7342, 320 + %.7344 =l add %.7, %.7343 + %.7345 =l extsw 3 + %.7346 =l mul %.7345, 64 + %.7347 =l add %.7344, %.7346 + %.7348 =l extsw 1 + %.7349 =l mul %.7348, 8 + %.7350 =l add %.7347, %.7349 + storel %.7350, %.7341 + %.7351 =l add %.7155, 496 + %.7352 =l extsw 0 + %.7353 =l copy %.7352 + storel %.7353, %.7351 + %.7354 =l add %.7155, 504 + %.7355 =l extsw 3 + %.7356 =l mul %.7355, 320 + %.7357 =l add %.7, %.7356 + %.7358 =l extsw 3 + %.7359 =l mul %.7358, 64 + %.7360 =l add %.7357, %.7359 + %.7361 =l extsw 1 + %.7362 =l mul %.7361, 8 + %.7363 =l add %.7360, %.7362 + storel %.7363, %.7354 + %.7364 =l add %.7155, 512 + storel $g_23, %.7364 + %.7365 =l add %.7155, 520 + storel $g_173, %.7365 + %.7366 =l add %.7155, 528 + storel %.2036, %.7366 + %.7367 =l add %.7155, 536 + storel $g_173, %.7367 + %.7368 =l add %.7155, 544 + storel %.2036, %.7368 + %.7369 =l add %.7155, 552 + %.7370 =l extsw 0 + %.7371 =l copy %.7370 + storel %.7371, %.7369 + %.7372 =l add %.7155, 560 + storel $g_173, %.7372 + %.7373 =l add %.7155, 568 + %.7374 =l extsw 0 + %.7375 =l copy %.7374 + storel %.7375, %.7373 + %.7376 =l add %.7155, 576 + %.7377 =l extsw 0 + %.7378 =l copy %.7377 + storel %.7378, %.7376 + %.7379 =l add %.7155, 584 + storel %.2036, %.7379 + %.7380 =l add %.7155, 592 + %.7381 =l extsw 0 + %.7382 =l copy %.7381 + storel %.7382, %.7380 + %.7383 =l add %.7155, 600 + %.7384 =l extsw 0 + %.7385 =l copy %.7384 + storel %.7385, %.7383 + %.7386 =l add %.7155, 608 + %.7387 =l extsw 0 + %.7388 =l copy %.7387 + storel %.7388, %.7386 + %.7389 =l add %.7155, 616 + storel $g_23, %.7389 + %.7390 =l add %.7155, 624 + %.7391 =l extsw 0 + %.7392 =l copy %.7391 + storel %.7392, %.7390 + %.7393 =l add %.7155, 632 + %.7394 =l extsw 0 + %.7395 =l copy %.7394 + storel %.7395, %.7393 + %.7396 =l add %.7155, 640 + storel $g_23, %.7396 + %.7397 =l add %.7155, 648 + storel $g_23, %.7397 + %.7398 =l add %.7155, 656 + storel $g_23, %.7398 + %.7399 =l add %.7155, 664 + %.7400 =l extsw 0 + %.7401 =l copy %.7400 + storel %.7401, %.7399 + %.7402 =l add %.7155, 672 + %.7403 =l extsw 3 + %.7404 =l mul %.7403, 320 + %.7405 =l add %.7, %.7404 + %.7406 =l extsw 3 + %.7407 =l mul %.7406, 64 + %.7408 =l add %.7405, %.7407 + %.7409 =l extsw 1 + %.7410 =l mul %.7409, 8 + %.7411 =l add %.7408, %.7410 + storel %.7411, %.7402 + %.7412 =l add %.7155, 680 + storel %.2036, %.7412 + %.7413 =l add %.7155, 688 + %.7414 =l extsw 0 + %.7415 =l copy %.7414 + storel %.7415, %.7413 + %.7416 =l add %.7155, 696 + %.7417 =l extsw 3 + %.7418 =l mul %.7417, 320 + %.7419 =l add %.7, %.7418 + %.7420 =l extsw 3 + %.7421 =l mul %.7420, 64 + %.7422 =l add %.7419, %.7421 + %.7423 =l extsw 1 + %.7424 =l mul %.7423, 8 + %.7425 =l add %.7422, %.7424 + storel %.7425, %.7416 + %.7426 =l add %.7155, 704 + storel $g_173, %.7426 + %.7427 =l add %.7155, 712 + %.7428 =l extsw 0 + %.7429 =l copy %.7428 + storel %.7429, %.7427 + %.7430 =l add %.7155, 720 + storel $g_173, %.7430 + %.7431 =l add %.7155, 728 + %.7432 =l extsw 3 + %.7433 =l mul %.7432, 320 + %.7434 =l add %.7, %.7433 + %.7435 =l extsw 1 + %.7436 =l mul %.7435, 64 + %.7437 =l add %.7434, %.7436 + %.7438 =l extsw 2 + %.7439 =l mul %.7438, 8 + %.7440 =l add %.7437, %.7439 + storel %.7440, %.7431 + %.7441 =l add %.7155, 736 + storel %.2036, %.7441 + %.7442 =l add %.7155, 744 + storel $g_23, %.7442 + %.7443 =l add %.7155, 752 + storel $g_23, %.7443 + %.7444 =l add %.7155, 760 + storel %.2036, %.7444 + %.7445 =l add %.7155, 768 + storel $g_23, %.7445 + %.7446 =l add %.7155, 776 + %.7447 =l extsw 0 + %.7448 =l copy %.7447 + storel %.7448, %.7446 + %.7449 =l add %.7155, 784 + %.7450 =l extsw 0 + %.7451 =l copy %.7450 + storel %.7451, %.7449 + %.7452 =l add %.7155, 792 + %.7453 =l extsw 0 + %.7454 =l copy %.7453 + storel %.7454, %.7452 + %.7455 =l add %.7155, 800 + storel $g_23, %.7455 + %.7456 =l add %.7155, 808 + storel %.2036, %.7456 + %.7457 =l add %.7155, 816 + %.7458 =l extsw 3 + %.7459 =l mul %.7458, 320 + %.7460 =l add %.7, %.7459 + %.7461 =l extsw 3 + %.7462 =l mul %.7461, 64 + %.7463 =l add %.7460, %.7462 + %.7464 =l extsw 1 + %.7465 =l mul %.7464, 8 + %.7466 =l add %.7463, %.7465 + storel %.7466, %.7457 + %.7467 =l add %.7155, 824 + storel %.2036, %.7467 + %.7468 =l add %.7155, 832 + %.7469 =l extsw 0 + %.7470 =l copy %.7469 + storel %.7470, %.7468 + %.7471 =l add %.7155, 840 + %.7472 =l extsw 0 + %.7473 =l copy %.7472 + storel %.7473, %.7471 + %.7474 =l add %.7155, 848 + storel %.2036, %.7474 + %.7475 =l add %.7155, 856 + storel $g_23, %.7475 + %.7476 =l add %.7155, 864 + storel %.2036, %.7476 + %.7477 =l add %.7155, 872 + storel $g_23, %.7477 + %.7478 =l add %.7155, 880 + storel %.2036, %.7478 + %.7479 =l add %.7155, 888 + %.7480 =l extsw 0 + %.7481 =l copy %.7480 + storel %.7481, %.7479 + %.7482 =l add %.7155, 896 + %.7483 =l extsw 0 + %.7484 =l copy %.7483 + storel %.7484, %.7482 + %.7485 =l add %.7155, 904 + %.7486 =l extsw 3 + %.7487 =l mul %.7486, 320 + %.7488 =l add %.7, %.7487 + %.7489 =l extsw 3 + %.7490 =l mul %.7489, 64 + %.7491 =l add %.7488, %.7490 + %.7492 =l extsw 1 + %.7493 =l mul %.7492, 8 + %.7494 =l add %.7491, %.7493 + storel %.7494, %.7485 + %.7495 =l add %.7155, 912 + %.7496 =l extsw 2 + %.7497 =l mul %.7496, 320 + %.7498 =l add %.7, %.7497 + %.7499 =l extsw 2 + %.7500 =l mul %.7499, 64 + %.7501 =l add %.7498, %.7500 + %.7502 =l extsw 0 + %.7503 =l mul %.7502, 8 + %.7504 =l add %.7501, %.7503 + storel %.7504, %.7495 + %.7505 =l add %.7155, 920 + %.7506 =l extsw 3 + %.7507 =l mul %.7506, 320 + %.7508 =l add %.7, %.7507 + %.7509 =l extsw 1 + %.7510 =l mul %.7509, 64 + %.7511 =l add %.7508, %.7510 + %.7512 =l extsw 4 + %.7513 =l mul %.7512, 8 + %.7514 =l add %.7511, %.7513 + storel %.7514, %.7505 + %.7515 =l add %.7155, 928 + storel $g_173, %.7515 + %.7516 =l add %.7155, 936 + storel %.2036, %.7516 + %.7517 =l add %.7155, 944 + %.7518 =l extsw 0 + %.7519 =l copy %.7518 + storel %.7519, %.7517 + %.7520 =l add %.7155, 952 + storel %.2036, %.7520 + %.7521 =l add %.7155, 960 + storel $g_23, %.7521 + %.7522 =l add %.7155, 968 + %.7523 =l extsw 3 + %.7524 =l mul %.7523, 320 + %.7525 =l add %.7, %.7524 + %.7526 =l extsw 3 + %.7527 =l mul %.7526, 64 + %.7528 =l add %.7525, %.7527 + %.7529 =l extsw 1 + %.7530 =l mul %.7529, 8 + %.7531 =l add %.7528, %.7530 + storel %.7531, %.7522 + %.7532 =l add %.7155, 976 + storel %.2036, %.7532 + %.7533 =l add %.7155, 984 + storel $g_23, %.7533 + %.7534 =l add %.7155, 992 + storel $g_23, %.7534 + %.7535 =l add %.7155, 1000 + %.7536 =l extsw 3 + %.7537 =l mul %.7536, 320 + %.7538 =l add %.7, %.7537 + %.7539 =l extsw 3 + %.7540 =l mul %.7539, 64 + %.7541 =l add %.7538, %.7540 + %.7542 =l extsw 1 + %.7543 =l mul %.7542, 8 + %.7544 =l add %.7541, %.7543 + storel %.7544, %.7535 + %.7545 =l add %.7155, 1008 + storel %.2036, %.7545 + %.7546 =l add %.7155, 1016 + storel $g_23, %.7546 + %.7547 =l add %.7155, 1024 + %.7548 =l extsw 0 + %.7549 =l copy %.7548 + storel %.7549, %.7547 + %.7550 =l add %.7155, 1032 + %.7551 =l extsw 3 + %.7552 =l mul %.7551, 320 + %.7553 =l add %.7, %.7552 + %.7554 =l extsw 3 + %.7555 =l mul %.7554, 64 + %.7556 =l add %.7553, %.7555 + %.7557 =l extsw 1 + %.7558 =l mul %.7557, 8 + %.7559 =l add %.7556, %.7558 + storel %.7559, %.7550 + %.7560 =l add %.7155, 1040 + %.7561 =l extsw 0 + %.7562 =l copy %.7561 + storel %.7562, %.7560 + %.7563 =l add %.7155, 1048 + storel %.2036, %.7563 + %.7564 =l add %.7155, 1056 + %.7565 =l extsw 0 + %.7566 =l copy %.7565 + storel %.7566, %.7564 + %.7567 =l add %.7155, 1064 + %.7568 =l extsw 3 + %.7569 =l mul %.7568, 320 + %.7570 =l add %.7, %.7569 + %.7571 =l extsw 3 + %.7572 =l mul %.7571, 64 + %.7573 =l add %.7570, %.7572 + %.7574 =l extsw 1 + %.7575 =l mul %.7574, 8 + %.7576 =l add %.7573, %.7575 + storel %.7576, %.7567 + %.7577 =l add %.7155, 1072 + %.7578 =l extsw 3 + %.7579 =l mul %.7578, 320 + %.7580 =l add %.7, %.7579 + %.7581 =l extsw 1 + %.7582 =l mul %.7581, 64 + %.7583 =l add %.7580, %.7582 + %.7584 =l extsw 6 + %.7585 =l mul %.7584, 8 + %.7586 =l add %.7583, %.7585 + storel %.7586, %.7577 + %.7587 =l add %.7155, 1080 + %.7588 =l extsw 0 + %.7589 =l copy %.7588 + storel %.7589, %.7587 + %.7590 =l add %.7155, 1088 + storel $g_23, %.7590 + %.7591 =l add %.7155, 1096 + storel %.2036, %.7591 + %.7592 =l add %.7155, 1104 + storel %.2036, %.7592 + %.7593 =l add %.7155, 1112 + storel $g_23, %.7593 + %.7594 =l add %.7155, 1120 + %.7595 =l extsw 3 + %.7596 =l mul %.7595, 320 + %.7597 =l add %.7, %.7596 + %.7598 =l extsw 3 + %.7599 =l mul %.7598, 64 + %.7600 =l add %.7597, %.7599 + %.7601 =l extsw 1 + %.7602 =l mul %.7601, 8 + %.7603 =l add %.7600, %.7602 + storel %.7603, %.7594 + %.7604 =l add %.7155, 1128 + %.7605 =l extsw 0 + %.7606 =l copy %.7605 + storel %.7606, %.7604 + %.7607 =l add %.7155, 1136 + %.7608 =l extsw 3 + %.7609 =l mul %.7608, 320 + %.7610 =l add %.7, %.7609 + %.7611 =l extsw 3 + %.7612 =l mul %.7611, 64 + %.7613 =l add %.7610, %.7612 + %.7614 =l extsw 1 + %.7615 =l mul %.7614, 8 + %.7616 =l add %.7613, %.7615 + storel %.7616, %.7607 + %.7617 =l add %.7155, 1144 + storel $g_23, %.7617 + %.7618 =l add %.7155, 1152 + storel $g_173, %.7618 + %.7619 =l add %.7155, 1160 + storel %.2036, %.7619 + %.7620 =l add %.7155, 1168 + %.7621 =l extsw 0 + %.7622 =l copy %.7621 + storel %.7622, %.7620 + %.7623 =l add %.7155, 1176 + storel %.2036, %.7623 + %.7624 =l add %.7155, 1184 + storel %.2036, %.7624 + %.7625 =l add %.7155, 1192 + storel $g_173, %.7625 + %.7626 =l add %.7155, 1200 + storel %.2036, %.7626 + %.7627 =l add %.7155, 1208 + %.7628 =l extsw 3 + %.7629 =l mul %.7628, 320 + %.7630 =l add %.7, %.7629 + %.7631 =l extsw 1 + %.7632 =l mul %.7631, 64 + %.7633 =l add %.7630, %.7632 + %.7634 =l extsw 6 + %.7635 =l mul %.7634, 8 + %.7636 =l add %.7633, %.7635 + storel %.7636, %.7627 + %.7637 =l add %.7155, 1216 + storel %.2036, %.7637 + %.7638 =l add %.7155, 1224 + storel %.2036, %.7638 + %.7639 =l add %.7155, 1232 + %.7640 =l extsw 2 + %.7641 =l mul %.7640, 320 + %.7642 =l add %.7, %.7641 + %.7643 =l extsw 2 + %.7644 =l mul %.7643, 64 + %.7645 =l add %.7642, %.7644 + %.7646 =l extsw 0 + %.7647 =l mul %.7646, 8 + %.7648 =l add %.7645, %.7647 + storel %.7648, %.7639 + %.7649 =l add %.7155, 1240 + %.7650 =l extsw 0 + %.7651 =l copy %.7650 + storel %.7651, %.7649 + %.7652 =l add %.7155, 1248 + %.7653 =l extsw 0 + %.7654 =l copy %.7653 + storel %.7654, %.7652 + %.7655 =l add %.7155, 1256 + storel $g_173, %.7655 + %.7656 =l add %.7155, 1264 + storel %.2036, %.7656 + %.7657 =l add %.7155, 1272 + storel %.2036, %.7657 + %.7658 =l add %.7155, 1280 + %.7659 =l extsw 0 + %.7660 =l copy %.7659 + storel %.7660, %.7658 + %.7661 =l add %.7155, 1288 + storel $g_23, %.7661 + %.7662 =l add %.7155, 1296 + %.7663 =l extsw 4 + %.7664 =l mul %.7663, 320 + %.7665 =l add %.7, %.7664 + %.7666 =l extsw 0 + %.7667 =l mul %.7666, 64 + %.7668 =l add %.7665, %.7667 + %.7669 =l extsw 3 + %.7670 =l mul %.7669, 8 + %.7671 =l add %.7668, %.7670 + storel %.7671, %.7662 + %.7672 =l add %.7155, 1304 + storel $g_23, %.7672 + %.7673 =l add %.7155, 1312 + storel $g_23, %.7673 + %.7674 =l add %.7155, 1320 + %.7675 =l extsw 3 + %.7676 =l mul %.7675, 320 + %.7677 =l add %.7, %.7676 + %.7678 =l extsw 3 + %.7679 =l mul %.7678, 64 + %.7680 =l add %.7677, %.7679 + %.7681 =l extsw 1 + %.7682 =l mul %.7681, 8 + %.7683 =l add %.7680, %.7682 + storel %.7683, %.7674 + %.7684 =l add %.7155, 1328 + storel %.2036, %.7684 + %.7685 =l add %.7155, 1336 + storel $g_173, %.7685 + %.7686 =l add %.7155, 1344 + storel %.2036, %.7686 + %.7687 =l add %.7155, 1352 + %.7688 =l extsw 0 + %.7689 =l copy %.7688 + storel %.7689, %.7687 + %.7690 =l add %.7155, 1360 + %.7691 =l extsw 3 + %.7692 =l mul %.7691, 320 + %.7693 =l add %.7, %.7692 + %.7694 =l extsw 3 + %.7695 =l mul %.7694, 64 + %.7696 =l add %.7693, %.7695 + %.7697 =l extsw 1 + %.7698 =l mul %.7697, 8 + %.7699 =l add %.7696, %.7698 + storel %.7699, %.7690 + %.7700 =l add %.7155, 1368 + %.7701 =l extsw 3 + %.7702 =l mul %.7701, 320 + %.7703 =l add %.7, %.7702 + %.7704 =l extsw 3 + %.7705 =l mul %.7704, 64 + %.7706 =l add %.7703, %.7705 + %.7707 =l extsw 1 + %.7708 =l mul %.7707, 8 + %.7709 =l add %.7706, %.7708 + storel %.7709, %.7700 + %.7710 =l add %.7155, 1376 + %.7711 =l extsw 0 + %.7712 =l copy %.7711 + storel %.7712, %.7710 + %.7713 =l add %.7155, 1384 + storel %.2036, %.7713 + %.7714 =l add %.7155, 1392 + %.7715 =l extsw 3 + %.7716 =l mul %.7715, 320 + %.7717 =l add %.7, %.7716 + %.7718 =l extsw 3 + %.7719 =l mul %.7718, 64 + %.7720 =l add %.7717, %.7719 + %.7721 =l extsw 1 + %.7722 =l mul %.7721, 8 + %.7723 =l add %.7720, %.7722 + storel %.7723, %.7714 + %.7724 =l add %.7155, 1400 + storel %.2036, %.7724 + %.7725 =l add %.7155, 1408 + storel %.2036, %.7725 + %.7726 =l add %.7155, 1416 + storel $g_23, %.7726 + %.7727 =l add %.7155, 1424 + storel %.2036, %.7727 + %.7728 =l add %.7155, 1432 + storel $g_23, %.7728 + %.7729 =l add %.7155, 1440 + storel $g_23, %.7729 + %.7730 =l add %.7155, 1448 + %.7731 =l extsw 3 + %.7732 =l mul %.7731, 320 + %.7733 =l add %.7, %.7732 + %.7734 =l extsw 1 + %.7735 =l mul %.7734, 64 + %.7736 =l add %.7733, %.7735 + %.7737 =l extsw 2 + %.7738 =l mul %.7737, 8 + %.7739 =l add %.7736, %.7738 + storel %.7739, %.7730 + %.7740 =l add %.7155, 1456 + storel $g_173, %.7740 + %.7741 =l add %.7155, 1464 + storel %.2036, %.7741 + %.7742 =l add %.7155, 1472 + %.7743 =l extsw 0 + %.7744 =l copy %.7743 + storel %.7744, %.7742 + %.7745 =l add %.7155, 1480 + storel $g_173, %.7745 + %.7746 =l add %.7155, 1488 + storel $g_23, %.7746 + %.7747 =l add %.7155, 1496 + storel $g_173, %.7747 + %.7748 =l add %.7155, 1504 + storel $g_23, %.7748 + %.7749 =l add %.7155, 1512 + %.7750 =l extsw 3 + %.7751 =l mul %.7750, 320 + %.7752 =l add %.7, %.7751 + %.7753 =l extsw 1 + %.7754 =l mul %.7753, 64 + %.7755 =l add %.7752, %.7754 + %.7756 =l extsw 2 + %.7757 =l mul %.7756, 8 + %.7758 =l add %.7755, %.7757 + storel %.7758, %.7749 + %.7759 =l add %.7155, 1520 + storel %.2036, %.7759 + %.7760 =l add %.7155, 1528 + storel $g_23, %.7760 + %.7761 =l add %.7155, 1536 + storel $g_23, %.7761 + %.7762 =l add %.7155, 1544 + storel $g_23, %.7762 + %.7763 =l add %.7155, 1552 + storel %.2036, %.7763 + %.7764 =l add %.7155, 1560 + %.7765 =l extsw 0 + %.7766 =l mul %.7765, 320 + %.7767 =l add %.7, %.7766 + %.7768 =l extsw 0 + %.7769 =l mul %.7768, 64 + %.7770 =l add %.7767, %.7769 + %.7771 =l extsw 2 + %.7772 =l mul %.7771, 8 + %.7773 =l add %.7770, %.7772 + storel %.7773, %.7764 + %.7774 =l add %.7155, 1568 + %.7775 =l extsw 0 + %.7776 =l copy %.7775 + storel %.7776, %.7774 + %.7777 =l add %.7155, 1576 + %.7778 =l extsw 0 + %.7779 =l copy %.7778 + storel %.7779, %.7777 + %.7780 =l add %.7155, 1584 + storel %.2036, %.7780 + %.7781 =l add %.7155, 1592 + %.7782 =l extsw 0 + %.7783 =l copy %.7782 + storel %.7783, %.7781 + %.7784 =l add %.7155, 1600 + %.7785 =l extsw 0 + %.7786 =l copy %.7785 + storel %.7786, %.7784 + %.7787 =l add %.7155, 1608 + %.7788 =l extsw 0 + %.7789 =l copy %.7788 + storel %.7789, %.7787 + %.7790 =l add %.7155, 1616 + storel %.2036, %.7790 + %.7791 =l add %.7155, 1624 + %.7792 =l extsw 4 + %.7793 =l mul %.7792, 320 + %.7794 =l add %.7, %.7793 + %.7795 =l extsw 0 + %.7796 =l mul %.7795, 64 + %.7797 =l add %.7794, %.7796 + %.7798 =l extsw 3 + %.7799 =l mul %.7798, 8 + %.7800 =l add %.7797, %.7799 + storel %.7800, %.7791 + %.7801 =l add %.7155, 1632 + %.7802 =l extsw 4 + %.7803 =l mul %.7802, 320 + %.7804 =l add %.7, %.7803 + %.7805 =l extsw 0 + %.7806 =l mul %.7805, 64 + %.7807 =l add %.7804, %.7806 + %.7808 =l extsw 3 + %.7809 =l mul %.7808, 8 + %.7810 =l add %.7807, %.7809 + storel %.7810, %.7801 + %.7811 =l add %.7155, 1640 + storel %.2036, %.7811 + %.7812 =l add %.7155, 1648 + storel $g_173, %.7812 + %.7813 =l add %.7155, 1656 + %.7814 =l extsw 0 + %.7815 =l mul %.7814, 320 + %.7816 =l add %.7, %.7815 + %.7817 =l extsw 0 + %.7818 =l mul %.7817, 64 + %.7819 =l add %.7816, %.7818 + %.7820 =l extsw 2 + %.7821 =l mul %.7820, 8 + %.7822 =l add %.7819, %.7821 + storel %.7822, %.7813 + %.7823 =l add %.7155, 1664 + storel %.2036, %.7823 + %.7824 =l add %.7155, 1672 + storel $g_23, %.7824 + %.7826 =l add %.7825, 0 + storel $g_130, %.7826 + %.7830 =l extsw 1 + %.7831 =l mul %.7830, 8 + %.7832 =l add %.7110, %.7831 + %.7833 =l loadl %.7832 + %.7834 =w copy %.7833 + %.7835 =l loadl $g_296 + %.7836 =l loadl %.7835 + %.7837 =w loaduw %.4 + %.7838 =l loadl %.2026 + %.7839 =l extsw 1 + %.7840 =l mul %.7839, 8 + %.7841 =l add %.7110, %.7840 + %.7842 =w ceql %.7838, %.7841 + %.7843 =l loadl %.7142 + storel $g_81, %.7843 + %.7844 =w cnel $g_81, $g_81 + %.7845 =l loadl %.2036 + %.7846 =w loadsw %.7845 + %.7847 =w cslew %.7844, %.7846 + %.7848 =l extsw %.7847 + %.7849 =l loadl %.7144 + %.7850 =l xor %.7848, %.7849 + %.7851 =w copy %.7850 + %.7852 =l copy $g_265 + %.7853 =l mul 8, 1 + %.7854 =l add %.7852, %.7853 + %.7855 =l copy %.7854 + %.7856 =l loadl %.7855 + %.7857 =w copy %.7856 + %.7858 =w call $safe_mod_func_int16_t_s_s(w %.7851, w %.7857) + %.7859 =l extsh %.7858 + %.7860 =w cnel %.7859, 842 + %.7861 =l extsw %.7860 + %.7862 =w csgtl %.7861, 40679 + %.7863 =l extsw %.7862 + %.7864 =l and %.7863, 0 + %.7865 =w ceql %.7864, 34194 + %.7866 =w csgew %.7842, %.7865 + %.7867 =w cnel %.2030, %.2030 + %.7868 =w cnew %.7867, 0 + jnz %.7868, @logic_join.1442, @logic_right.1441 +@logic_right.1441 + %.7869 =l extsw 0 + %.7870 =l sub %.7869, 5 + %.7871 =w cnel %.7870, 0 +@logic_join.1442 + %.7872 =w phi @if_false.1243 %.7868, @logic_right.1441 %.7871 + %.7873 =l extsw 2 + %.7874 =l mul %.7873, 360 + %.7875 =l add %.250, %.7874 + %.7876 =l extsw 1 + %.7877 =l mul %.7876, 120 + %.7878 =l add %.7875, %.7877 + %.7879 =l extsw 1 + %.7880 =l mul %.7879, 20 + %.7881 =l add %.7878, %.7880 + %.7882 =w loaduw $g_115 + %.7883 =w copy %.7882 + %.7884 =w call $safe_mul_func_int16_t_s_s(w %.7834, w %.7883) + %.7885 =w extsh %.7884 + storew %.7885, %.7152 + %.7886 =l extsw %.7885 + %.7887 =w cslel %.7886, 49357 + %.7888 =l extsw 0 + %.7889 =l copy %.7888 + storel %.7889, %.2 + %.7890 =l copy $g_518 + %.7891 =l mul 24, 1 + %.7892 =l add %.7890, %.7891 + %.7893 =l copy %.7892 + %.7894 =l loadl %.7893 + %.7895 =w cnel %.7894, 0 + jnz %.7895, @if_true.1443, @if_false.1444 +@if_true.1443 + jmp @lbl_640.1445 +@if_false.1444 +@lbl_640.1445 + %.7896 =w copy 3 + storeb %.7896, %.2042 +@for_cond.1446 + %.7897 =w loadsb %.2042 + %.7898 =w extsb %.7897 + %.7899 =w csgew %.7898, 1 + jnz %.7899, @for_body.1447, @for_join.1449 +@for_body.1447 + %.7901 =l add %.7900, 0 + storel $g_185, %.7901 + %.7903 =l add %.7902, 0 + %.7904 =w copy 7 + storew %.7904, %.7903 + %.7906 =l add %.7905, 0 + %.7907 =w copy 132 + storeb %.7907, %.7906 + %.7908 =l extsw 2 + %.7909 =l mul %.7908, 360 + %.7910 =l add %.250, %.7909 + %.7911 =l extsw 1 + %.7912 =l mul %.7911, 120 + %.7913 =l add %.7910, %.7912 + %.7914 =l extsw 1 + %.7915 =l mul %.7914, 20 + %.7916 =l add %.7913, %.7915 + storel %.7916, %.2045 + %.7917 =w copy 0 + %.7918 =l copy $g_265 + %.7919 =l mul 32, 1 + %.7920 =l add %.7918, %.7919 + %.7921 =l copy %.7920 + storew %.7917, %.7921 +@for_cond.1450 + %.7922 =l copy $g_265 + %.7923 =l mul 32, 1 + %.7924 =l add %.7922, %.7923 + %.7925 =l copy %.7924 + %.7926 =w loaduw %.7925 + %.7927 =w copy 4 + %.7928 =w culew %.7926, %.7927 + jnz %.7928, @for_body.1451, @for_join.1453 +@for_body.1451 + %.7930 =l add %.7929, 0 + %.7931 =l extsw 3 + %.7932 =l mul %.7931, 8 + %.7933 =l add %.7110, %.7932 + storel %.7933, %.7930 + %.7934 =l add %.7929, 8 + %.7935 =l copy $g_185 + %.7936 =l mul 8, 1 + %.7937 =l add %.7935, %.7936 + %.7938 =l copy %.7937 + storel %.7938, %.7934 + %.7939 =l add %.7929, 16 + %.7940 =l copy $g_185 + %.7941 =l mul 8, 1 + %.7942 =l add %.7940, %.7941 + %.7943 =l copy %.7942 + storel %.7943, %.7939 + %.7944 =l add %.7929, 24 + %.7945 =l extsw 3 + %.7946 =l mul %.7945, 8 + %.7947 =l add %.7110, %.7946 + storel %.7947, %.7944 + %.7948 =l add %.7929, 32 + %.7949 =l copy $g_185 + %.7950 =l mul 8, 1 + %.7951 =l add %.7949, %.7950 + %.7952 =l copy %.7951 + storel %.7952, %.7948 + %.7953 =l add %.7929, 40 + %.7954 =l copy $g_185 + %.7955 =l mul 8, 1 + %.7956 =l add %.7954, %.7955 + %.7957 =l copy %.7956 + storel %.7957, %.7953 + %.7959 =l add %.7958, 0 + %.7960 =w copy 8 + storew %.7960, %.7959 + %.7962 =l loadl $g_82 + %.7963 =w loadub %.6 + %.7964 =l extub %.7963 + storel %.7964, $g_80 + %.7965 =l copy %.7964 + %.7966 =l or 14975625374428453295, %.7965 + %.7967 =w loadub %.6 + %.7968 =l extub %.7967 + %.7969 =l and %.7962, %.7968 + %.7970 =l copy $g_518 + %.7971 =l mul 24, 1 + %.7972 =l add %.7970, %.7971 + %.7973 =l copy %.7972 + %.7974 =l loadl %.7973 + %.7975 =w copy 37368 + %.7976 =w call $safe_rshift_func_uint16_t_u_s(w %.7975, w 2) + %.7977 =w extuh %.7976 + %.7978 =l loadl %.2005 + %.7979 =w loadsb %.7978 + %.7980 =w extsb %.7979 + %.7981 =w loadub %.6 + %.7982 =w extub %.7981 + %.7983 =w copy 46361 + %.7984 =l copy $g_518 + %.7985 =l mul 24, 1 + %.7986 =l add %.7984, %.7985 + %.7987 =l copy %.7986 + %.7988 =l loadl %.7987 + %.7989 =l copy 2 + %.7990 =l and %.7988, %.7989 + %.7991 =w copy %.7990 + %.7992 =w call $safe_sub_func_int16_t_s_s(w %.7983, w %.7991) + %.7993 =w extsh %.7992 + %.7994 =w cnew %.7982, %.7993 + %.7995 =w or %.7980, %.7994 + %.7996 =w copy %.7995 + storeb %.7996, %.7978 + %.7997 =w extsb %.7996 + %.7998 =w ceqw %.7977, %.7997 + %.7999 =w cnew %.7998, 0 + jnz %.7999, @logic_join.1455, @logic_right.1454 +@logic_right.1454 + %.8000 =l loadl $g_422 + %.8001 =w loaduw %.8000 + %.8002 =w cnew %.8001, 0 +@logic_join.1455 + %.8003 =w phi @for_body.1451 %.7999, @logic_right.1454 %.8002 + %.8004 =w copy %.8003 + %.8005 =w copy 7 + %.8006 =w call $safe_lshift_func_uint8_t_u_u(w %.8004, w %.8005) + %.8007 =w extub %.8006 + storew %.8007, %.7958 + %.8008 =l copy $g_185 + %.8009 =l mul 48, 1 + %.8010 =l add %.8008, %.8009 + %.8011 =l copy %.8010 + storew 0, %.8011 +@for_cond.1456 + %.8012 =l copy $g_185 + %.8013 =l mul 48, 1 + %.8014 =l add %.8012, %.8013 + %.8015 =l copy %.8014 + %.8016 =w loadsw %.8015 + %.8017 =w cslew %.8016, 4 + jnz %.8017, @for_body.1457, @for_join.1459 +@for_body.1457 + %.8019 =l add %.8018, 0 + storel $g_629, %.8019 + %.8021 =l add %.8020, 0 + storel %.2042, %.8021 + %.8022 =l add %.8020, 8 + storel $g_631, %.8022 + %.8023 =l add %.8020, 16 + storel %.2042, %.8023 + %.8024 =l add %.8020, 24 + %.8025 =l extsw 0 + %.8026 =l copy %.8025 + storel %.8026, %.8024 + %.8027 =l add %.8020, 32 + storel %.2042, %.8027 + %.8028 =l add %.8020, 40 + storel $g_631, %.8028 + %.8029 =l add %.8020, 48 + %.8030 =l extsw 0 + %.8031 =l copy %.8030 + storel %.8031, %.8029 + %.8032 =l add %.8020, 56 + storel $g_631, %.8032 + %.8033 =l add %.8020, 64 + %.8034 =l extsw 0 + %.8035 =l copy %.8034 + storel %.8035, %.8033 + %.8036 =l add %.8020, 72 + storel $g_631, %.8036 + %.8037 =l add %.8020, 80 + storel $g_2, %.8037 + %.8038 =l add %.8020, 88 + storel $g_631, %.8038 + %.8039 =l add %.8020, 96 + %.8040 =l extsw 0 + %.8041 =l copy %.8040 + storel %.8041, %.8039 + %.8042 =l add %.8020, 104 + storel $g_631, %.8042 + %.8043 =l add %.8020, 112 + storel %.2042, %.8043 + %.8044 =l add %.8020, 120 + storel %.2042, %.8044 + %.8045 =l add %.8020, 128 + storel %.2042, %.8045 + %.8046 =l add %.8020, 136 + storel $g_631, %.8046 + %.8047 =l add %.8020, 144 + storel $g_631, %.8047 + %.8048 =l add %.8020, 152 + storel $g_631, %.8048 + %.8049 =l add %.8020, 160 + %.8050 =l extsw 0 + %.8051 =l copy %.8050 + storel %.8051, %.8049 + %.8052 =l add %.8020, 168 + %.8053 =l extsw 0 + %.8054 =l copy %.8053 + storel %.8054, %.8052 + %.8055 =l add %.8020, 176 + storel $g_631, %.8055 + %.8056 =l add %.8020, 184 + storel $g_631, %.8056 + %.8057 =l add %.8020, 192 + storel %.2042, %.8057 + %.8058 =l add %.8020, 200 + storel %.2042, %.8058 + %.8059 =l add %.8020, 208 + storel $g_631, %.8059 + %.8060 =l add %.8020, 216 + storel %.2042, %.8060 + %.8061 =l add %.8020, 224 + storel %.2042, %.8061 + %.8062 =l add %.8020, 232 + storel %.2042, %.8062 + %.8063 =l add %.8020, 240 + storel %.2042, %.8063 + %.8064 =l add %.8020, 248 + storel %.2042, %.8064 + %.8066 =l add %.8065, 0 + %.8067 =w copy 0 + storew %.8067, %.8066 + %.8071 =w copy 0 + storeh %.8071, $g_425 +@for_cond.1460 + %.8072 =w loaduh $g_425 + %.8073 =w extuh %.8072 + %.8074 =w cslew %.8073, 7 + jnz %.8074, @for_body.1461, @for_join.1463 +@for_body.1461 + %.8078 =w loadsb %.2042 + %.8079 =w extsb %.8078 + %.8080 =w add %.8079, 1 + %.8081 =l extsw %.8080 + %.8082 =l mul %.8081, 320 + %.8083 =l add %.7, %.8082 + %.8084 =w loadsb %.2042 + %.8085 =l extsb %.8084 + %.8086 =l mul %.8085, 64 + %.8087 =l add %.8083, %.8086 + %.8088 =w loadsb %.2042 + %.8089 =l extsb %.8088 + %.8090 =l mul %.8089, 8 + %.8091 =l add %.8087, %.8090 + %.8092 =l loadl %.8091 + %.8093 =w loadsb %.2042 + %.8094 =w extsb %.8093 + %.8095 =w add %.8094, 2 + %.8096 =l extsw %.8095 + %.8097 =l mul %.8096, 320 + %.8098 =l add %.7, %.8097 + %.8099 =l copy $g_265 + %.8100 =l mul 32, 1 + %.8101 =l add %.8099, %.8100 + %.8102 =l copy %.8101 + %.8103 =w loaduw %.8102 + %.8104 =l extuw %.8103 + %.8105 =l mul %.8104, 64 + %.8106 =l add %.8098, %.8105 + %.8107 =w loadsb %.2042 + %.8108 =w extsb %.8107 + %.8109 =w add %.8108, 1 + %.8110 =l extsw %.8109 + %.8111 =l mul %.8110, 8 + %.8112 =l add %.8106, %.8111 + storel %.8092, %.8112 + %.8113 =l loadl %.7900 + %.8114 =l loadl $g_296 + storel %.8113, %.8114 +@for_cont.1462 + %.8115 =w loaduh $g_425 + %.8116 =w extuh %.8115 + %.8117 =w add %.8116, 1 + %.8118 =w copy %.8117 + storeh %.8118, $g_425 + jmp @for_cond.1460 +@for_join.1463 + %.8119 =w loaduw %.4 + %.8120 =l extuw %.8119 + %.8121 =w loadub %.6 + %.8122 =w extub %.8121 + %.8123 =w loaduh $g_619 + %.8124 =w extuh %.8123 + %.8125 =w cnew %.8124, 0 + jnz %.8125, @logic_right.1464, @logic_join.1465 +@logic_right.1464 + %.8126 =w copy 8 + %.8127 =l loadl %.7825 + %.8128 =l extsw 0 + %.8129 =w ceql %.8127, %.8128 + %.8130 =w call $safe_rshift_func_uint16_t_u_s(w %.8126, w %.8129) + %.8131 =w extuh %.8130 + %.8132 =w ceql $g_201, %.7900 + %.8133 =w copy %.8132 + %.8134 =l loadl %.2005 + storeb %.8133, %.8134 + %.8135 =w call $safe_lshift_func_int8_t_s_s(w %.8133, w 3) + %.8136 =w copy %.8135 + %.8137 =w loadsw %.7958 + %.8138 =w copy %.8137 + %.8139 =w call $safe_div_func_uint8_t_u_u(w %.8136, w %.8138) + %.8140 =w extub %.8139 + %.8141 =w xor %.8140, 18446744073709551615 + %.8142 =w and %.8131, %.8141 + %.8143 =w cnew %.8142, 0 +@logic_join.1465 + %.8144 =w phi @for_join.1463 %.8125, @logic_right.1464 %.8143 + %.8145 =l extsw %.8144 + %.8146 =l or %.8145, 98 + %.8147 =w copy %.8146 + %.8148 =l loadl %.8018 + storeb %.8147, %.8148 + %.8149 =w extsb %.8147 + storew %.8149, %.7902 + %.8150 =w copy %.8149 + %.8151 =w loaduw %.4 + %.8152 =w cultw %.8150, %.8151 + %.8153 =l extsw %.8152 + %.8154 =l copy 0 + %.8155 =l call $safe_sub_func_int64_t_s_s(l %.8153, l %.8154) + %.8156 =w loadub %.6 + %.8157 =l extub %.8156 + %.8158 =l call $safe_unary_minus_func_int64_t_s(l %.8157) + %.8159 =w loadub %.6 + %.8160 =l extub %.8159 + %.8161 =w csgtl %.8158, %.8160 + %.8162 =w call $safe_lshift_func_uint16_t_u_s(w %.8122, w %.8161) + %.8163 =l copy $g_265 + %.8164 =l mul 44, 1 + %.8165 =l add %.8163, %.8164 + %.8166 =l copy %.8165 + %.8167 =w loadsw %.8166 + %.8168 =l copy 1 + %.8169 =w loaduw %.4 + %.8170 =l extuw %.8169 + %.8171 =l call $safe_add_func_int64_t_s_s(l %.8168, l %.8170) + %.8172 =w loadsw %.8065 + %.8173 =l extsw %.8172 + %.8174 =l or %.8171, %.8173 + %.8175 =w copy %.8174 + %.8176 =w copy 50742 + %.8177 =w call $safe_mul_func_uint16_t_u_u(w %.8175, w %.8176) + %.8178 =l copy $g_265 + %.8179 =l mul 24, 1 + %.8180 =l add %.8178, %.8179 + %.8181 =l copy %.8180 + %.8182 =l loadl %.8181 + %.8183 =w cnel %.8120, %.8182 + %.8184 =l extsw %.8183 + %.8185 =l xor %.8184, 65535 + %.8186 =w cnel %.8185, 0 + jnz %.8186, @if_true.1466, @if_false.1467 +@if_true.1466 + %.8188 =l add %.8187, 0 + storel $g_634, %.8188 + %.8192 =l copy $g_265 + %.8193 =l mul 32, 1 + %.8194 =l add %.8192, %.8193 + %.8195 =l copy %.8194 + %.8196 =w loaduw %.8195 + %.8197 =w loaduw %.4 + %.8198 =l loadl $g_634 + %.8199 =l loadl %.8187 + storel %.8198, %.8199 + %.8200 =l copy $g_265 + %.8201 =l mul 32, 1 + %.8202 =l add %.8200, %.8201 + %.8203 =l copy %.8202 + %.8204 =w loaduw %.8203 + %.8205 =l extuw %.8204 + %.8206 =l mul %.8205, 320 + %.8207 =l add %.7, %.8206 + %.8208 =w loadsb %.2042 + %.8209 =w extsb %.8208 + %.8210 =w add %.8209, 1 + %.8211 =l extsw %.8210 + %.8212 =l mul %.8211, 64 + %.8213 =l add %.8207, %.8212 + %.8214 =l copy $g_185 + %.8215 =l mul 48, 1 + %.8216 =l add %.8214, %.8215 + %.8217 =l copy %.8216 + %.8218 =w loadsw %.8217 + %.8219 =l extsw %.8218 + %.8220 =l mul %.8219, 8 + %.8221 =l add %.8213, %.8220 + %.8222 =l loadl %.8221 + %.8223 =l copy $g_265 + %.8224 =l mul 32, 1 + %.8225 =l add %.8223, %.8224 + %.8226 =l copy %.8225 + %.8227 =w loaduw %.8226 + %.8228 =w copy 1 + %.8229 =w add %.8227, %.8228 + %.8230 =l extuw %.8229 + %.8231 =l mul %.8230, 320 + %.8232 =l add %.7, %.8231 + %.8233 =w loadsb %.2042 + %.8234 =w extsb %.8233 + %.8235 =w add %.8234, 1 + %.8236 =l extsw %.8235 + %.8237 =l mul %.8236, 64 + %.8238 =l add %.8232, %.8237 + %.8239 =l copy $g_265 + %.8240 =l mul 32, 1 + %.8241 =l add %.8239, %.8240 + %.8242 =l copy %.8241 + %.8243 =w loaduw %.8242 + %.8244 =l extuw %.8243 + %.8245 =l mul %.8244, 8 + %.8246 =l add %.8238, %.8245 + storel %.8222, %.8246 + jmp @if_join.1468 +@if_false.1467 + %.8248 =l add %.8247, 0 + %.8249 =w copy 0 + storew %.8249, %.8248 + %.8250 =l add %.8247, 4 + %.8251 =w copy 786565377 + storew %.8251, %.8250 + %.8252 =l add %.8247, 8 + %.8253 =w copy 1 + storeh %.8253, %.8252 + %.8254 =l add %.8247, 10 + storeh 0, %.8254 + %.8255 =l add %.8247, 12 + %.8256 =w copy 3536423064 + storew %.8256, %.8255 + %.8257 =l add %.8247, 16 + %.8258 =w copy 1245577790 + storew %.8258, %.8257 + %.8259 =l loadl %.7825 + %.8260 =l loaduw %.8247 + storew %.8260, %.8259 + %.8261 =l add %.8247, 4 + %.8262 =l add %.8259, 4 + %.8263 =l loaduw %.8261 + storew %.8263, %.8262 + %.8264 =l add %.8261, 4 + %.8265 =l add %.8262, 4 + %.8266 =l loaduw %.8264 + storew %.8266, %.8265 + %.8267 =l add %.8264, 4 + %.8268 =l add %.8265, 4 + %.8269 =l loaduw %.8267 + storew %.8269, %.8268 + %.8270 =l add %.8267, 4 + %.8271 =l add %.8268, 4 + %.8272 =l loaduw %.8270 + storew %.8272, %.8271 + %.8273 =l add %.8270, 4 + %.8274 =l add %.8271, 4 +@if_join.1468 + %.8275 =w loadub %.7905 + %.8276 =w sub %.8275, 1 + storeb %.8276, %.7905 +@for_cont.1458 + %.8277 =l copy $g_185 + %.8278 =l mul 48, 1 + %.8279 =l add %.8277, %.8278 + %.8280 =l copy %.8279 + %.8281 =w loadsw %.8280 + %.8282 =w add %.8281, 1 + storew %.8282, %.8280 + jmp @for_cond.1456 +@for_join.1459 +@for_cont.1452 + %.8283 =l copy $g_265 + %.8284 =l mul 32, 1 + %.8285 =l add %.8283, %.8284 + %.8286 =l copy %.8285 + %.8287 =w loaduw %.8286 + %.8288 =w copy 1 + %.8289 =w add %.8287, %.8288 + storew %.8289, %.8286 + jmp @for_cond.1450 +@for_join.1453 +@for_cont.1448 + %.8290 =w loadsb %.2042 + %.8291 =w extsb %.8290 + %.8292 =w sub %.8291, 1 + %.8293 =w copy %.8292 + storeb %.8293, %.2042 + jmp @for_cond.1446 +@for_join.1449 + %.8294 =l loadl $g_173 + %.8295 =w loadsw %.8294 + %.8296 =l loadl %.2036 + storew %.8295, %.8296 +@if_join.1440 + %.8297 =l loadl $g_88 + %.8298 =l loadl %.8297 + %.8299 =l loadl %.8298 + ret %.8299 +} +function w $func_41(l %.1, w %.3) { +@start.1469 + %.2 =l alloc8 8 + storel %.1, %.2 + %.4 =l alloc4 1 + storeb %.3, %.4 + %.5 =l alloc8 72 + %.15 =l alloc4 4 +@body.1470 + %.6 =l add %.5, 0 + storel $g_50, %.6 + %.7 =l add %.5, 8 + storel $g_50, %.7 + %.8 =l add %.5, 16 + storel $g_50, %.8 + %.9 =l add %.5, 24 + storel $g_50, %.9 + %.10 =l add %.5, 32 + storel $g_50, %.10 + %.11 =l add %.5, 40 + storel $g_50, %.11 + %.12 =l add %.5, 48 + storel $g_50, %.12 + %.13 =l add %.5, 56 + storel $g_50, %.13 + %.14 =l add %.5, 64 + storel $g_50, %.14 + %.16 =w loadsw $g_50 + %.17 =l loadl $g_23 + %.18 =w loadsw %.17 + %.19 =w xor %.16, %.18 + storew %.19, $g_50 + %.20 =w loadub %.4 + %.21 =w extub %.20 + ret %.21 +} +function w $func_51(w %.1) { +@start.1471 + %.2 =l alloc4 4 + storew %.1, %.2 + %.3 =l alloc4 4 + %.6 =l alloc8 8 + %.8 =l alloc8 8 + %.10 =l alloc4 28 + %.25 =l alloc4 4 + %.28 =l alloc4 4 + %.31 =l alloc4 1 + %.34 =l alloc4 4 + %.37 =l alloc4 4 + %.40 =l alloc8 8 + %.42 =l alloc8 8 + %.44 =l alloc4 4 + %.60 =l alloc8 8 + %.62 =l alloc8 8 + %.64 =l alloc8 8 + %.66 =l alloc8 8 + %.68 =l alloc4 4 + %.73 =l alloc8 8 + %.75 =l alloc8 8 + %.77 =l alloc8 8 + %.79 =l alloc4 20 + %.90 =l alloc8 8 + %.92 =l alloc8 8 + %.94 =l alloc4 2 + %.97 =l alloc8 8 + %.102 =l alloc8 8 + %.106 =l alloc8 8 + %.108 =l alloc8 72 + %.109 =l alloc8 8 + %.111 =l alloc4 4 + %.220 =l alloc8 8 + %.222 =l alloc4 4 + %.225 =l alloc8 392 + %.275 =l alloc8 8 + %.279 =l alloc8 1176 + %.817 =l alloc4 4 + %.818 =l alloc4 4 + %.819 =l alloc4 4 +@body.1472 + %.4 =l add %.3, 0 + %.5 =w copy 1159863208 + storew %.5, %.4 + %.7 =l add %.6, 0 + storel $g_46, %.7 + %.9 =l add %.8, 0 + storel $g_57, %.9 + %.11 =l add %.10, 0 + %.12 =w copy 4248860344 + storew %.12, %.11 + %.13 =l add %.10, 4 + %.14 =w copy 4248860344 + storew %.14, %.13 + %.15 =l add %.10, 8 + %.16 =w copy 4248860344 + storew %.16, %.15 + %.17 =l add %.10, 12 + %.18 =w copy 4248860344 + storew %.18, %.17 + %.19 =l add %.10, 16 + %.20 =w copy 4248860344 + storew %.20, %.19 + %.21 =l add %.10, 20 + %.22 =w copy 4248860344 + storew %.22, %.21 + %.23 =l add %.10, 24 + %.24 =w copy 4248860344 + storew %.24, %.23 + %.26 =l add %.25, 0 + %.27 =w copy 1082973296 + storew %.27, %.26 + %.29 =l add %.28, 0 + %.30 =w copy 3433997516 + storew %.30, %.29 + %.32 =l add %.31, 0 + %.33 =w copy 250 + storeb %.33, %.32 + %.35 =l add %.34, 0 + %.36 =w copy 1749978495 + storew %.36, %.35 + %.38 =l add %.37, 0 + %.39 =w copy 3489158437 + storew %.39, %.38 + %.41 =l add %.40, 0 + storel $g_84, %.41 + %.43 =l add %.42, 0 + storel %.34, %.43 + %.45 =w loadsw %.3 + %.46 =w loadsw %.3 + %.47 =w loadsw %.3 + %.48 =w cnew %.47, 0 + jnz %.48, @logic_right.1473, @logic_join.1474 +@logic_right.1473 + %.49 =w cnel 306100898, 0 +@logic_join.1474 + %.50 =w phi @body.1472 %.48, @logic_right.1473 %.49 + %.51 =w xor %.46, %.50 + %.52 =w copy %.51 + %.53 =l loadl %.6 + storeb %.52, %.53 + %.54 =l loadl %.8 + storeb %.52, %.54 + %.55 =w extub %.52 + %.56 =w ceqw %.45, %.55 + %.57 =l extsw %.56 + storel %.57, $g_58 + storew 0, $g_50 +@for_cond.1475 + %.58 =w loadsw $g_50 + %.59 =w cslew %.58, 6 + jnz %.59, @for_body.1476, @for_join.1478 +@for_body.1476 + %.61 =l add %.60, 0 + storel %.3, %.61 + %.63 =l add %.62, 0 + storel %.3, %.63 + %.65 =l add %.64, 0 + storel %.3, %.65 + %.67 =l add %.66, 0 + storel %.3, %.67 + %.69 =l add %.68, 0 + %.70 =l extsw 0 + %.71 =l sub %.70, 1 + %.72 =w copy %.71 + storew %.72, %.69 + %.74 =l add %.73, 0 + storel %.68, %.74 + %.76 =l add %.75, 0 + storel %.68, %.76 + %.78 =l add %.77, 0 + storel %.68, %.78 + %.80 =l add %.79, 0 + %.81 =w copy 595471528 + storew %.81, %.80 + %.82 =l add %.79, 4 + %.83 =w copy 595471528 + storew %.83, %.82 + %.84 =l add %.79, 8 + %.85 =w copy 595471528 + storew %.85, %.84 + %.86 =l add %.79, 12 + %.87 =w copy 595471528 + storew %.87, %.86 + %.88 =l add %.79, 16 + %.89 =w copy 595471528 + storew %.89, %.88 + %.91 =l add %.90, 0 + storel %.68, %.91 + %.93 =l add %.92, 0 + storel %.3, %.93 + %.95 =l add %.94, 0 + %.96 =w copy 58364 + storeh %.96, %.95 + %.98 =l add %.97, 0 + %.99 =l extsw 1 + %.100 =l mul %.99, 4 + %.101 =l add %.79, %.100 + storel %.101, %.98 + %.103 =l add %.102, 0 + %.104 =l extsw 0 + %.105 =l copy %.104 + storel %.105, %.103 + %.107 =l add %.106, 0 + storel %.68, %.107 + %.110 =l add %.109, 0 + storel $g_38, %.110 + storew 0, %.111 +@for_cond.1479 + %.112 =w loadsw %.111 + %.113 =w csltw %.112, 9 + jnz %.113, @for_body.1480, @for_join.1482 +@for_body.1480 + %.114 =w loadsw %.111 + %.115 =l extsw %.114 + %.116 =l mul %.115, 8 + %.117 =l add %.108, %.116 + storel %.68, %.117 +@for_cont.1481 + %.118 =w loadsw %.111 + %.119 =w add %.118, 1 + storew %.119, %.111 + jmp @for_cond.1479 +@for_join.1482 + %.120 =w loaduw $g_84 + %.121 =w sub %.120, 1 + storew %.121, $g_84 + %.122 =l loadl %.77 + %.123 =w loadsw %.122 + %.124 =w copy %.123 + %.125 =w loadsw $g_50 + %.126 =l extsw %.125 + %.127 =l mul %.126, 4 + %.128 =l add %.10, %.127 + %.129 =w loaduw %.128 + %.130 =w and %.124, %.129 + %.131 =w copy %.130 + storew %.131, %.122 + %.132 =l extsw 4 + storel %.132, $g_80 +@for_cond.1483 + %.133 =l loadl $g_80 + %.134 =l extsw 1 + %.135 =w csgel %.133, %.134 + jnz %.135, @for_body.1484, @for_join.1486 +@for_body.1484 + %.136 =l loadl %.109 + storel %.136, $g_88 +@for_cont.1485 + %.137 =l loadl $g_80 + %.138 =l extsw 1 + %.139 =l sub %.137, %.138 + storel %.139, $g_80 + jmp @for_cond.1483 +@for_join.1486 + storew 2, %.25 +@for_cond.1487 + %.140 =w loadsw %.25 + %.141 =w cslew %.140, 6 + jnz %.141, @for_body.1488, @for_join.1490 +@for_body.1488 + %.142 =l loadl $g_23 + %.143 =w loadsw %.142 + %.144 =w cnew %.143, 0 + jnz %.144, @if_true.1491, @if_false.1492 +@if_true.1491 + jmp @for_join.1490 +@if_false.1492 + %.145 =l loadl $g_23 + %.146 =w loadsw %.145 + %.147 =w cnew %.146, 0 + jnz %.147, @if_true.1493, @if_false.1494 +@if_true.1493 + jmp @for_cont.1489 +@if_false.1494 + %.148 =l loadl $g_23 + %.149 =w loadsw %.148 + %.150 =w cnew %.149, 0 + jnz %.150, @if_true.1495, @if_false.1496 +@if_true.1495 + jmp @for_join.1490 +@if_false.1496 +@for_cont.1489 + %.151 =w loadsw %.25 + %.152 =w add %.151, 1 + storew %.152, %.25 + jmp @for_cond.1487 +@for_join.1490 +@for_cont.1477 + %.153 =w loadsw $g_50 + %.154 =w add %.153, 1 + storew %.154, $g_50 + jmp @for_cond.1475 +@for_join.1478 + %.155 =l loadl %.42 + %.156 =w loadsw %.155 + %.157 =w copy 0 + %.158 =w call $safe_lshift_func_int8_t_s_s(w %.157, w 5) + %.159 =w copy 28 + %.160 =w loadsw $g_50 + %.161 =l loadl $g_80 + %.162 =w copy %.161 + %.163 =w loadsb %.31 + %.164 =w extsb %.163 + %.165 =w call $safe_mul_func_uint16_t_u_u(w %.162, w %.164) + %.166 =w extuh %.165 + %.167 =w csltw %.160, %.166 + %.168 =w loadsw %.2 + %.169 =w copy %.168 + %.170 =w loadsw %.37 + %.171 =l loadl $g_58 + %.172 =l loadl %.40 + %.173 =w loaduw %.172 + %.174 =w loadsh $g_81 + %.175 =w extsh %.174 + %.176 =w and %.173, %.175 + storew %.176, %.172 + %.177 =w copy 46 + %.178 =w loadsw %.2 + %.179 =w copy %.178 + %.180 =w call $safe_mul_func_uint8_t_u_u(w %.177, w %.179) + %.181 =w loadsw %.25 + %.182 =l extsw 0 + %.183 =w cnel %.25, %.182 + %.184 =w loadsw %.2 + %.185 =w copy %.184 + %.186 =w copy 251 + %.187 =w call $safe_mul_func_uint8_t_u_u(w %.185, w %.186) + %.188 =w loadsw %.2 + %.189 =w copy %.188 + %.190 =w call $safe_mod_func_uint8_t_u_u(w %.187, w %.189) + %.191 =l extub %.190 + %.192 =l and %.171, %.191 + storel %.192, $g_58 + %.193 =w loadsb %.31 + %.194 =l extsb %.193 + %.195 =w cugtl %.192, %.194 + %.196 =w ceqw %.195, 0 + %.197 =l extsw %.196 + %.198 =w csgel %.197, 7466234982433381138 + %.199 =w or %.170, %.198 + storew %.199, %.37 + %.200 =w loadsw $g_24 + %.201 =w call $safe_mod_func_int32_t_s_s(w %.199, w %.200) + %.202 =w copy %.201 + %.203 =w call $safe_mul_func_uint8_t_u_u(w %.169, w %.202) + %.204 =w extub %.203 + %.205 =w call $safe_lshift_func_uint16_t_u_s(w %.204, w 3) + %.206 =w extuh %.205 + %.207 =w csgew %.167, %.206 + %.208 =w copy %.207 + %.209 =w loadsw %.2 + %.210 =w call $safe_rshift_func_int16_t_s_s(w %.208, w %.209) + %.211 =w copy %.210 + %.212 =w call $safe_div_func_int8_t_s_s(w %.159, w %.211) + %.213 =w extsb %.158 + %.214 =w extsb %.212 + %.215 =w csgtw %.213, %.214 + %.216 =w and %.156, %.215 + storew %.216, %.155 + %.217 =w cnew %.216, 0 + jnz %.217, @if_true.1497, @if_false.1498 +@if_true.1497 + %.218 =w loadsw %.2 + %.219 =w copy %.218 + ret %.219 +@if_false.1498 + %.221 =l add %.220, 0 + storel %.37, %.221 + %.223 =l add %.222, 0 + %.224 =w copy 4261573277 + storew %.224, %.223 + %.226 =l add %.225, 0 + storel %.28, %.226 + %.227 =l add %.225, 8 + storel %.28, %.227 + %.228 =l add %.225, 16 + storel %.3, %.228 + %.229 =l add %.225, 24 + storel %.28, %.229 + %.230 =l add %.225, 32 + storel %.28, %.230 + %.231 =l add %.225, 40 + storel %.3, %.231 + %.232 =l add %.225, 48 + storel %.28, %.232 + %.233 =l add %.225, 56 + storel %.28, %.233 + %.234 =l add %.225, 64 + storel %.34, %.234 + %.235 =l add %.225, 72 + storel %.34, %.235 + %.236 =l add %.225, 80 + storel %.28, %.236 + %.237 =l add %.225, 88 + storel %.34, %.237 + %.238 =l add %.225, 96 + storel %.34, %.238 + %.239 =l add %.225, 104 + storel %.28, %.239 + %.240 =l add %.225, 112 + storel %.34, %.240 + %.241 =l add %.225, 120 + storel %.28, %.241 + %.242 =l add %.225, 128 + storel %.34, %.242 + %.243 =l add %.225, 136 + storel %.34, %.243 + %.244 =l add %.225, 144 + storel %.28, %.244 + %.245 =l add %.225, 152 + storel %.34, %.245 + %.246 =l add %.225, 160 + storel %.34, %.246 + %.247 =l add %.225, 168 + storel %.28, %.247 + %.248 =l add %.225, 176 + storel %.28, %.248 + %.249 =l add %.225, 184 + storel %.3, %.249 + %.250 =l add %.225, 192 + storel %.28, %.250 + %.251 =l add %.225, 200 + storel %.28, %.251 + %.252 =l add %.225, 208 + storel %.3, %.252 + %.253 =l add %.225, 216 + storel %.28, %.253 + %.254 =l add %.225, 224 + storel %.28, %.254 + %.255 =l add %.225, 232 + storel %.34, %.255 + %.256 =l add %.225, 240 + storel %.34, %.256 + %.257 =l add %.225, 248 + storel %.28, %.257 + %.258 =l add %.225, 256 + storel %.34, %.258 + %.259 =l add %.225, 264 + storel %.34, %.259 + %.260 =l add %.225, 272 + storel %.28, %.260 + %.261 =l add %.225, 280 + storel %.34, %.261 + %.262 =l add %.225, 288 + storel %.28, %.262 + %.263 =l add %.225, 296 + storel %.34, %.263 + %.264 =l add %.225, 304 + storel %.34, %.264 + %.265 =l add %.225, 312 + storel %.28, %.265 + %.266 =l add %.225, 320 + storel %.34, %.266 + %.267 =l add %.225, 328 + storel %.34, %.267 + %.268 =l add %.225, 336 + storel %.28, %.268 + %.269 =l add %.225, 344 + storel %.34, %.269 + %.270 =l add %.225, 352 + storel %.28, %.270 + %.271 =l add %.225, 360 + storel %.34, %.271 + %.272 =l add %.225, 368 + storel %.34, %.272 + %.273 =l add %.225, 376 + storel %.28, %.273 + %.274 =l add %.225, 384 + storel %.34, %.274 + %.276 =l add %.275, 0 + %.277 =l extsw 0 + %.278 =l copy %.277 + storel %.278, %.276 + %.280 =l add %.279, 0 + storel %.42, %.280 + %.281 =l add %.279, 8 + %.282 =l extsw 0 + %.283 =l mul %.282, 56 + %.284 =l add %.225, %.283 + %.285 =l extsw 1 + %.286 =l mul %.285, 8 + %.287 =l add %.284, %.286 + storel %.287, %.281 + %.288 =l add %.279, 16 + storel %.220, %.288 + %.289 =l add %.279, 24 + %.290 =l extsw 3 + %.291 =l mul %.290, 56 + %.292 =l add %.225, %.291 + %.293 =l extsw 0 + %.294 =l mul %.293, 8 + %.295 =l add %.292, %.294 + storel %.295, %.289 + %.296 =l add %.279, 32 + %.297 =l extsw 0 + %.298 =l mul %.297, 56 + %.299 =l add %.225, %.298 + %.300 =l extsw 1 + %.301 =l mul %.300, 8 + %.302 =l add %.299, %.301 + storel %.302, %.296 + %.303 =l add %.279, 40 + %.304 =l extsw 0 + %.305 =l mul %.304, 56 + %.306 =l add %.225, %.305 + %.307 =l extsw 1 + %.308 =l mul %.307, 8 + %.309 =l add %.306, %.308 + storel %.309, %.303 + %.310 =l add %.279, 48 + %.311 =l extsw 3 + %.312 =l mul %.311, 56 + %.313 =l add %.225, %.312 + %.314 =l extsw 0 + %.315 =l mul %.314, 8 + %.316 =l add %.313, %.315 + storel %.316, %.310 + %.317 =l add %.279, 56 + %.318 =l extsw 0 + %.319 =l mul %.318, 56 + %.320 =l add %.225, %.319 + %.321 =l extsw 1 + %.322 =l mul %.321, 8 + %.323 =l add %.320, %.322 + storel %.323, %.317 + %.324 =l add %.279, 64 + %.325 =l extsw 0 + %.326 =l mul %.325, 56 + %.327 =l add %.225, %.326 + %.328 =l extsw 1 + %.329 =l mul %.328, 8 + %.330 =l add %.327, %.329 + storel %.330, %.324 + %.331 =l add %.279, 72 + %.332 =l extsw 0 + %.333 =l mul %.332, 56 + %.334 =l add %.225, %.333 + %.335 =l extsw 1 + %.336 =l mul %.335, 8 + %.337 =l add %.334, %.336 + storel %.337, %.331 + %.338 =l add %.279, 80 + %.339 =l extsw 0 + %.340 =l mul %.339, 56 + %.341 =l add %.225, %.340 + %.342 =l extsw 1 + %.343 =l mul %.342, 8 + %.344 =l add %.341, %.343 + storel %.344, %.338 + %.345 =l add %.279, 88 + storel %.220, %.345 + %.346 =l add %.279, 96 + %.347 =l extsw 0 + %.348 =l mul %.347, 56 + %.349 =l add %.225, %.348 + %.350 =l extsw 1 + %.351 =l mul %.350, 8 + %.352 =l add %.349, %.351 + storel %.352, %.346 + %.353 =l add %.279, 104 + %.354 =l extsw 0 + %.355 =l mul %.354, 56 + %.356 =l add %.225, %.355 + %.357 =l extsw 1 + %.358 =l mul %.357, 8 + %.359 =l add %.356, %.358 + storel %.359, %.353 + %.360 =l add %.279, 112 + storel %.42, %.360 + %.361 =l add %.279, 120 + %.362 =l extsw 3 + %.363 =l mul %.362, 56 + %.364 =l add %.225, %.363 + %.365 =l extsw 0 + %.366 =l mul %.365, 8 + %.367 =l add %.364, %.366 + storel %.367, %.361 + %.368 =l add %.279, 128 + storel %.220, %.368 + %.369 =l add %.279, 136 + storel %.42, %.369 + %.370 =l add %.279, 144 + storel %.42, %.370 + %.371 =l add %.279, 152 + storel %.220, %.371 + %.372 =l add %.279, 160 + %.373 =l extsw 3 + %.374 =l mul %.373, 56 + %.375 =l add %.225, %.374 + %.376 =l extsw 0 + %.377 =l mul %.376, 8 + %.378 =l add %.375, %.377 + storel %.378, %.372 + %.379 =l add %.279, 168 + storel %.42, %.379 + %.380 =l add %.279, 176 + %.381 =l extsw 0 + %.382 =l mul %.381, 56 + %.383 =l add %.225, %.382 + %.384 =l extsw 1 + %.385 =l mul %.384, 8 + %.386 =l add %.383, %.385 + storel %.386, %.380 + %.387 =l add %.279, 184 + storel %.220, %.387 + %.388 =l add %.279, 192 + %.389 =l extsw 0 + %.390 =l mul %.389, 56 + %.391 =l add %.225, %.390 + %.392 =l extsw 1 + %.393 =l mul %.392, 8 + %.394 =l add %.391, %.393 + storel %.394, %.388 + %.395 =l add %.279, 200 + storel %.220, %.395 + %.396 =l add %.279, 208 + %.397 =l extsw 0 + %.398 =l mul %.397, 56 + %.399 =l add %.225, %.398 + %.400 =l extsw 1 + %.401 =l mul %.400, 8 + %.402 =l add %.399, %.401 + storel %.402, %.396 + %.403 =l add %.279, 216 + storel %.42, %.403 + %.404 =l add %.279, 224 + %.405 =l extsw 0 + %.406 =l mul %.405, 56 + %.407 =l add %.225, %.406 + %.408 =l extsw 1 + %.409 =l mul %.408, 8 + %.410 =l add %.407, %.409 + storel %.410, %.404 + %.411 =l add %.279, 232 + storel %.42, %.411 + %.412 =l add %.279, 240 + storel %.220, %.412 + %.413 =l add %.279, 248 + storel %.220, %.413 + %.414 =l add %.279, 256 + storel %.42, %.414 + %.415 =l add %.279, 264 + %.416 =l extsw 0 + %.417 =l mul %.416, 56 + %.418 =l add %.225, %.417 + %.419 =l extsw 1 + %.420 =l mul %.419, 8 + %.421 =l add %.418, %.420 + storel %.421, %.415 + %.422 =l add %.279, 272 + storel %.220, %.422 + %.423 =l add %.279, 280 + storel %.220, %.423 + %.424 =l add %.279, 288 + %.425 =l extsw 0 + %.426 =l mul %.425, 56 + %.427 =l add %.225, %.426 + %.428 =l extsw 1 + %.429 =l mul %.428, 8 + %.430 =l add %.427, %.429 + storel %.430, %.424 + %.431 =l add %.279, 296 + storel %.220, %.431 + %.432 =l add %.279, 304 + %.433 =l extsw 0 + %.434 =l mul %.433, 56 + %.435 =l add %.225, %.434 + %.436 =l extsw 1 + %.437 =l mul %.436, 8 + %.438 =l add %.435, %.437 + storel %.438, %.432 + %.439 =l add %.279, 312 + storel %.220, %.439 + %.440 =l add %.279, 320 + storel %.220, %.440 + %.441 =l add %.279, 328 + storel %.220, %.441 + %.442 =l add %.279, 336 + storel %.42, %.442 + %.443 =l add %.279, 344 + storel %.220, %.443 + %.444 =l add %.279, 352 + storel %.220, %.444 + %.445 =l add %.279, 360 + storel %.42, %.445 + %.446 =l add %.279, 368 + %.447 =l extsw 0 + %.448 =l mul %.447, 56 + %.449 =l add %.225, %.448 + %.450 =l extsw 1 + %.451 =l mul %.450, 8 + %.452 =l add %.449, %.451 + storel %.452, %.446 + %.453 =l add %.279, 376 + storel %.220, %.453 + %.454 =l add %.279, 384 + %.455 =l extsw 3 + %.456 =l mul %.455, 56 + %.457 =l add %.225, %.456 + %.458 =l extsw 0 + %.459 =l mul %.458, 8 + %.460 =l add %.457, %.459 + storel %.460, %.454 + %.461 =l add %.279, 392 + storel %.220, %.461 + %.462 =l add %.279, 400 + %.463 =l extsw 0 + %.464 =l mul %.463, 56 + %.465 =l add %.225, %.464 + %.466 =l extsw 1 + %.467 =l mul %.466, 8 + %.468 =l add %.465, %.467 + storel %.468, %.462 + %.469 =l add %.279, 408 + storel %.220, %.469 + %.470 =l add %.279, 416 + %.471 =l extsw 0 + %.472 =l mul %.471, 56 + %.473 =l add %.225, %.472 + %.474 =l extsw 1 + %.475 =l mul %.474, 8 + %.476 =l add %.473, %.475 + storel %.476, %.470 + %.477 =l add %.279, 424 + storel %.42, %.477 + %.478 =l add %.279, 432 + %.479 =l extsw 0 + %.480 =l mul %.479, 56 + %.481 =l add %.225, %.480 + %.482 =l extsw 1 + %.483 =l mul %.482, 8 + %.484 =l add %.481, %.483 + storel %.484, %.478 + %.485 =l add %.279, 440 + storel %.220, %.485 + %.486 =l add %.279, 448 + storel %.42, %.486 + %.487 =l add %.279, 456 + storel %.42, %.487 + %.488 =l add %.279, 464 + storel %.220, %.488 + %.489 =l add %.279, 472 + %.490 =l extsw 3 + %.491 =l mul %.490, 56 + %.492 =l add %.225, %.491 + %.493 =l extsw 0 + %.494 =l mul %.493, 8 + %.495 =l add %.492, %.494 + storel %.495, %.489 + %.496 =l add %.279, 480 + storel %.42, %.496 + %.497 =l add %.279, 488 + storel %.220, %.497 + %.498 =l add %.279, 496 + %.499 =l extsw 3 + %.500 =l mul %.499, 56 + %.501 =l add %.225, %.500 + %.502 =l extsw 0 + %.503 =l mul %.502, 8 + %.504 =l add %.501, %.503 + storel %.504, %.498 + %.505 =l add %.279, 504 + storel %.220, %.505 + %.506 =l add %.279, 512 + %.507 =l extsw 0 + %.508 =l mul %.507, 56 + %.509 =l add %.225, %.508 + %.510 =l extsw 1 + %.511 =l mul %.510, 8 + %.512 =l add %.509, %.511 + storel %.512, %.506 + %.513 =l add %.279, 520 + %.514 =l extsw 0 + %.515 =l mul %.514, 56 + %.516 =l add %.225, %.515 + %.517 =l extsw 1 + %.518 =l mul %.517, 8 + %.519 =l add %.516, %.518 + storel %.519, %.513 + %.520 =l add %.279, 528 + %.521 =l extsw 0 + %.522 =l mul %.521, 56 + %.523 =l add %.225, %.522 + %.524 =l extsw 1 + %.525 =l mul %.524, 8 + %.526 =l add %.523, %.525 + storel %.526, %.520 + %.527 =l add %.279, 536 + %.528 =l extsw 0 + %.529 =l mul %.528, 56 + %.530 =l add %.225, %.529 + %.531 =l extsw 1 + %.532 =l mul %.531, 8 + %.533 =l add %.530, %.532 + storel %.533, %.527 + %.534 =l add %.279, 544 + %.535 =l extsw 0 + %.536 =l mul %.535, 56 + %.537 =l add %.225, %.536 + %.538 =l extsw 1 + %.539 =l mul %.538, 8 + %.540 =l add %.537, %.539 + storel %.540, %.534 + %.541 =l add %.279, 552 + storel %.220, %.541 + %.542 =l add %.279, 560 + %.543 =l extsw 0 + %.544 =l mul %.543, 56 + %.545 =l add %.225, %.544 + %.546 =l extsw 1 + %.547 =l mul %.546, 8 + %.548 =l add %.545, %.547 + storel %.548, %.542 + %.549 =l add %.279, 568 + %.550 =l extsw 3 + %.551 =l mul %.550, 56 + %.552 =l add %.225, %.551 + %.553 =l extsw 0 + %.554 =l mul %.553, 8 + %.555 =l add %.552, %.554 + storel %.555, %.549 + %.556 =l add %.279, 576 + storel %.220, %.556 + %.557 =l add %.279, 584 + %.558 =l extsw 0 + %.559 =l mul %.558, 56 + %.560 =l add %.225, %.559 + %.561 =l extsw 1 + %.562 =l mul %.561, 8 + %.563 =l add %.560, %.562 + storel %.563, %.557 + %.564 =l add %.279, 592 + storel %.42, %.564 + %.565 =l add %.279, 600 + storel %.220, %.565 + %.566 =l add %.279, 608 + storel %.220, %.566 + %.567 =l add %.279, 616 + storel %.42, %.567 + %.568 =l add %.279, 624 + %.569 =l extsw 0 + %.570 =l mul %.569, 56 + %.571 =l add %.225, %.570 + %.572 =l extsw 1 + %.573 =l mul %.572, 8 + %.574 =l add %.571, %.573 + storel %.574, %.568 + %.575 =l add %.279, 632 + %.576 =l extsw 0 + %.577 =l mul %.576, 56 + %.578 =l add %.225, %.577 + %.579 =l extsw 1 + %.580 =l mul %.579, 8 + %.581 =l add %.578, %.580 + storel %.581, %.575 + %.582 =l add %.279, 640 + %.583 =l extsw 0 + %.584 =l mul %.583, 56 + %.585 =l add %.225, %.584 + %.586 =l extsw 1 + %.587 =l mul %.586, 8 + %.588 =l add %.585, %.587 + storel %.588, %.582 + %.589 =l add %.279, 648 + storel %.42, %.589 + %.590 =l add %.279, 656 + storel %.220, %.590 + %.591 =l add %.279, 664 + storel %.42, %.591 + %.592 =l add %.279, 672 + storel %.42, %.592 + %.593 =l add %.279, 680 + %.594 =l extsw 0 + %.595 =l mul %.594, 56 + %.596 =l add %.225, %.595 + %.597 =l extsw 1 + %.598 =l mul %.597, 8 + %.599 =l add %.596, %.598 + storel %.599, %.593 + %.600 =l add %.279, 688 + storel %.220, %.600 + %.601 =l add %.279, 696 + %.602 =l extsw 3 + %.603 =l mul %.602, 56 + %.604 =l add %.225, %.603 + %.605 =l extsw 0 + %.606 =l mul %.605, 8 + %.607 =l add %.604, %.606 + storel %.607, %.601 + %.608 =l add %.279, 704 + %.609 =l extsw 0 + %.610 =l mul %.609, 56 + %.611 =l add %.225, %.610 + %.612 =l extsw 1 + %.613 =l mul %.612, 8 + %.614 =l add %.611, %.613 + storel %.614, %.608 + %.615 =l add %.279, 712 + %.616 =l extsw 0 + %.617 =l mul %.616, 56 + %.618 =l add %.225, %.617 + %.619 =l extsw 1 + %.620 =l mul %.619, 8 + %.621 =l add %.618, %.620 + storel %.621, %.615 + %.622 =l add %.279, 720 + %.623 =l extsw 3 + %.624 =l mul %.623, 56 + %.625 =l add %.225, %.624 + %.626 =l extsw 0 + %.627 =l mul %.626, 8 + %.628 =l add %.625, %.627 + storel %.628, %.622 + %.629 =l add %.279, 728 + %.630 =l extsw 0 + %.631 =l mul %.630, 56 + %.632 =l add %.225, %.631 + %.633 =l extsw 1 + %.634 =l mul %.633, 8 + %.635 =l add %.632, %.634 + storel %.635, %.629 + %.636 =l add %.279, 736 + %.637 =l extsw 0 + %.638 =l mul %.637, 56 + %.639 =l add %.225, %.638 + %.640 =l extsw 1 + %.641 =l mul %.640, 8 + %.642 =l add %.639, %.641 + storel %.642, %.636 + %.643 =l add %.279, 744 + %.644 =l extsw 0 + %.645 =l mul %.644, 56 + %.646 =l add %.225, %.645 + %.647 =l extsw 1 + %.648 =l mul %.647, 8 + %.649 =l add %.646, %.648 + storel %.649, %.643 + %.650 =l add %.279, 752 + %.651 =l extsw 0 + %.652 =l mul %.651, 56 + %.653 =l add %.225, %.652 + %.654 =l extsw 1 + %.655 =l mul %.654, 8 + %.656 =l add %.653, %.655 + storel %.656, %.650 + %.657 =l add %.279, 760 + storel %.220, %.657 + %.658 =l add %.279, 768 + %.659 =l extsw 0 + %.660 =l mul %.659, 56 + %.661 =l add %.225, %.660 + %.662 =l extsw 1 + %.663 =l mul %.662, 8 + %.664 =l add %.661, %.663 + storel %.664, %.658 + %.665 =l add %.279, 776 + %.666 =l extsw 0 + %.667 =l mul %.666, 56 + %.668 =l add %.225, %.667 + %.669 =l extsw 1 + %.670 =l mul %.669, 8 + %.671 =l add %.668, %.670 + storel %.671, %.665 + %.672 =l add %.279, 784 + storel %.42, %.672 + %.673 =l add %.279, 792 + %.674 =l extsw 3 + %.675 =l mul %.674, 56 + %.676 =l add %.225, %.675 + %.677 =l extsw 0 + %.678 =l mul %.677, 8 + %.679 =l add %.676, %.678 + storel %.679, %.673 + %.680 =l add %.279, 800 + storel %.220, %.680 + %.681 =l add %.279, 808 + storel %.42, %.681 + %.682 =l add %.279, 816 + storel %.42, %.682 + %.683 =l add %.279, 824 + storel %.220, %.683 + %.684 =l add %.279, 832 + %.685 =l extsw 3 + %.686 =l mul %.685, 56 + %.687 =l add %.225, %.686 + %.688 =l extsw 0 + %.689 =l mul %.688, 8 + %.690 =l add %.687, %.689 + storel %.690, %.684 + %.691 =l add %.279, 840 + storel %.42, %.691 + %.692 =l add %.279, 848 + %.693 =l extsw 0 + %.694 =l mul %.693, 56 + %.695 =l add %.225, %.694 + %.696 =l extsw 1 + %.697 =l mul %.696, 8 + %.698 =l add %.695, %.697 + storel %.698, %.692 + %.699 =l add %.279, 856 + storel %.220, %.699 + %.700 =l add %.279, 864 + %.701 =l extsw 0 + %.702 =l mul %.701, 56 + %.703 =l add %.225, %.702 + %.704 =l extsw 1 + %.705 =l mul %.704, 8 + %.706 =l add %.703, %.705 + storel %.706, %.700 + %.707 =l add %.279, 872 + storel %.220, %.707 + %.708 =l add %.279, 880 + %.709 =l extsw 0 + %.710 =l mul %.709, 56 + %.711 =l add %.225, %.710 + %.712 =l extsw 1 + %.713 =l mul %.712, 8 + %.714 =l add %.711, %.713 + storel %.714, %.708 + %.715 =l add %.279, 888 + storel %.42, %.715 + %.716 =l add %.279, 896 + %.717 =l extsw 0 + %.718 =l mul %.717, 56 + %.719 =l add %.225, %.718 + %.720 =l extsw 1 + %.721 =l mul %.720, 8 + %.722 =l add %.719, %.721 + storel %.722, %.716 + %.723 =l add %.279, 904 + storel %.42, %.723 + %.724 =l add %.279, 912 + storel %.220, %.724 + %.725 =l add %.279, 920 + storel %.220, %.725 + %.726 =l add %.279, 928 + storel %.42, %.726 + %.727 =l add %.279, 936 + %.728 =l extsw 0 + %.729 =l mul %.728, 56 + %.730 =l add %.225, %.729 + %.731 =l extsw 1 + %.732 =l mul %.731, 8 + %.733 =l add %.730, %.732 + storel %.733, %.727 + %.734 =l add %.279, 944 + storel %.220, %.734 + %.735 =l add %.279, 952 + storel %.220, %.735 + %.736 =l add %.279, 960 + %.737 =l extsw 0 + %.738 =l mul %.737, 56 + %.739 =l add %.225, %.738 + %.740 =l extsw 1 + %.741 =l mul %.740, 8 + %.742 =l add %.739, %.741 + storel %.742, %.736 + %.743 =l add %.279, 968 + storel %.220, %.743 + %.744 =l add %.279, 976 + %.745 =l extsw 0 + %.746 =l mul %.745, 56 + %.747 =l add %.225, %.746 + %.748 =l extsw 1 + %.749 =l mul %.748, 8 + %.750 =l add %.747, %.749 + storel %.750, %.744 + %.751 =l add %.279, 984 + storel %.220, %.751 + %.752 =l add %.279, 992 + storel %.220, %.752 + %.753 =l add %.279, 1000 + storel %.220, %.753 + %.754 =l add %.279, 1008 + storel %.42, %.754 + %.755 =l add %.279, 1016 + storel %.220, %.755 + %.756 =l add %.279, 1024 + storel %.220, %.756 + %.757 =l add %.279, 1032 + storel %.42, %.757 + %.758 =l add %.279, 1040 + %.759 =l extsw 0 + %.760 =l mul %.759, 56 + %.761 =l add %.225, %.760 + %.762 =l extsw 1 + %.763 =l mul %.762, 8 + %.764 =l add %.761, %.763 + storel %.764, %.758 + %.765 =l add %.279, 1048 + storel %.220, %.765 + %.766 =l add %.279, 1056 + %.767 =l extsw 3 + %.768 =l mul %.767, 56 + %.769 =l add %.225, %.768 + %.770 =l extsw 0 + %.771 =l mul %.770, 8 + %.772 =l add %.769, %.771 + storel %.772, %.766 + %.773 =l add %.279, 1064 + storel %.220, %.773 + %.774 =l add %.279, 1072 + %.775 =l extsw 0 + %.776 =l mul %.775, 56 + %.777 =l add %.225, %.776 + %.778 =l extsw 1 + %.779 =l mul %.778, 8 + %.780 =l add %.777, %.779 + storel %.780, %.774 + %.781 =l add %.279, 1080 + storel %.220, %.781 + %.782 =l add %.279, 1088 + %.783 =l extsw 0 + %.784 =l mul %.783, 56 + %.785 =l add %.225, %.784 + %.786 =l extsw 1 + %.787 =l mul %.786, 8 + %.788 =l add %.785, %.787 + storel %.788, %.782 + %.789 =l add %.279, 1096 + storel %.42, %.789 + %.790 =l add %.279, 1104 + %.791 =l extsw 0 + %.792 =l mul %.791, 56 + %.793 =l add %.225, %.792 + %.794 =l extsw 1 + %.795 =l mul %.794, 8 + %.796 =l add %.793, %.795 + storel %.796, %.790 + %.797 =l add %.279, 1112 + storel %.220, %.797 + %.798 =l add %.279, 1120 + storel %.42, %.798 + %.799 =l add %.279, 1128 + storel %.42, %.799 + %.800 =l add %.279, 1136 + storel %.220, %.800 + %.801 =l add %.279, 1144 + %.802 =l extsw 3 + %.803 =l mul %.802, 56 + %.804 =l add %.225, %.803 + %.805 =l extsw 0 + %.806 =l mul %.805, 8 + %.807 =l add %.804, %.806 + storel %.807, %.801 + %.808 =l add %.279, 1152 + storel %.42, %.808 + %.809 =l add %.279, 1160 + storel %.220, %.809 + %.810 =l add %.279, 1168 + %.811 =l extsw 3 + %.812 =l mul %.811, 56 + %.813 =l add %.225, %.812 + %.814 =l extsw 0 + %.815 =l mul %.814, 8 + %.816 =l add %.813, %.815 + storel %.816, %.810 + %.820 =w loaduw $g_115 + %.821 =w add %.820, 1 + storew %.821, $g_115 + %.822 =l loadl $g_38 + %.823 =l loadl %.822 + storel %.823, %.42 +@if_join.1499 + %.824 =w loaduw $g_115 + %.825 =w copy %.824 + ret %.825 +} +data $.Lstring.109 = align 1 { b "1", z 1, } +data $.Lstring.110 = align 1 { b "g_2", z 1, } +data $.Lstring.111 = align 1 { b "g_13[i][j][k]", z 1, } +data $.Lstring.112 = align 1 { b "index = [%d][%d][%d]\012", z 1, } +data $.Lstring.113 = align 1 { b "g_24", z 1, } +data $.Lstring.114 = align 1 { b "g_46", z 1, } +data $.Lstring.115 = align 1 { b "g_50", z 1, } +data $.Lstring.116 = align 1 { b "g_57", z 1, } +data $.Lstring.117 = align 1 { b "g_58", z 1, } +data $.Lstring.118 = align 1 { b "g_80", z 1, } +data $.Lstring.119 = align 1 { b "g_81", z 1, } +data $.Lstring.120 = align 1 { b "g_82", z 1, } +data $.Lstring.121 = align 1 { b "g_84", z 1, } +data $.Lstring.122 = align 1 { b "g_115", z 1, } +data $.Lstring.123 = align 1 { b "g_130.f0", z 1, } +data $.Lstring.124 = align 1 { b "g_130.f1", z 1, } +data $.Lstring.125 = align 1 { b "g_130.f2", z 1, } +data $.Lstring.126 = align 1 { b "g_130.f3", z 1, } +data $.Lstring.127 = align 1 { b "g_130.f4", z 1, } +data $.Lstring.128 = align 1 { b "g_132[i]", z 1, } +data $.Lstring.129 = align 1 { b "index = [%d]\012", z 1, } +data $.Lstring.130 = align 1 { b "g_185.f0", z 1, } +data $.Lstring.131 = align 1 { b "g_185.f1", z 1, } +data $.Lstring.132 = align 1 { b "g_185.f2", z 1, } +data $.Lstring.133 = align 1 { b "g_185.f3", z 1, } +data $.Lstring.134 = align 1 { b "g_185.f4", z 1, } +data $.Lstring.135 = align 1 { b "g_185.f5", z 1, } +data $.Lstring.136 = align 1 { b "g_185.f6", z 1, } +data $.Lstring.137 = align 1 { b "g_185.f7", z 1, } +data $.Lstring.138 = align 1 { b "g_185.f8", z 1, } +data $.Lstring.139 = align 1 { b "g_265.f0", z 1, } +data $.Lstring.140 = align 1 { b "g_265.f1", z 1, } +data $.Lstring.141 = align 1 { b "g_265.f2", z 1, } +data $.Lstring.142 = align 1 { b "g_265.f3", z 1, } +data $.Lstring.143 = align 1 { b "g_265.f4", z 1, } +data $.Lstring.144 = align 1 { b "g_265.f5", z 1, } +data $.Lstring.145 = align 1 { b "g_265.f6", z 1, } +data $.Lstring.146 = align 1 { b "g_265.f7", z 1, } +data $.Lstring.147 = align 1 { b "g_265.f8", z 1, } +data $.Lstring.148 = align 1 { b "g_399", z 1, } +data $.Lstring.149 = align 1 { b "g_425", z 1, } +data $.Lstring.150 = align 1 { b "g_477", z 1, } +data $.Lstring.151 = align 1 { b "g_518.f0", z 1, } +data $.Lstring.152 = align 1 { b "g_518.f1", z 1, } +data $.Lstring.153 = align 1 { b "g_518.f2", z 1, } +data $.Lstring.154 = align 1 { b "g_518.f3", z 1, } +data $.Lstring.155 = align 1 { b "g_518.f4", z 1, } +data $.Lstring.156 = align 1 { b "g_518.f5", z 1, } +data $.Lstring.157 = align 1 { b "g_518.f6", z 1, } +data $.Lstring.158 = align 1 { b "g_518.f7", z 1, } +data $.Lstring.159 = align 1 { b "g_518.f8", z 1, } +data $.Lstring.160 = align 1 { b "g_566", z 1, } +data $.Lstring.161 = align 1 { b "g_619", z 1, } +data $.Lstring.162 = align 1 { b "g_629", z 1, } +data $.Lstring.163 = align 1 { b "g_631", z 1, } +data $.Lstring.164 = align 1 { b "g_794.f0", z 1, } +data $.Lstring.165 = align 1 { b "g_794.f1", z 1, } +data $.Lstring.166 = align 1 { b "g_794.f2", z 1, } +data $.Lstring.167 = align 1 { b "g_794.f3", z 1, } +data $.Lstring.168 = align 1 { b "g_794.f4", z 1, } +data $.Lstring.169 = align 1 { b "g_858", z 1, } +data $.Lstring.170 = align 1 { b "g_937", z 1, } +data $.Lstring.171 = align 1 { b "g_1018", z 1, } +data $.Lstring.172 = align 1 { b "g_1130", z 1, } +data $.Lstring.173 = align 1 { b "g_1183.f0", z 1, } +data $.Lstring.174 = align 1 { b "g_1183.f1", z 1, } +data $.Lstring.175 = align 1 { b "g_1183.f2", z 1, } +data $.Lstring.176 = align 1 { b "g_1183.f3", z 1, } +data $.Lstring.177 = align 1 { b "g_1183.f4", z 1, } +data $.Lstring.178 = align 1 { b "g_1183.f5", z 1, } +data $.Lstring.179 = align 1 { b "g_1183.f6", z 1, } +data $.Lstring.180 = align 1 { b "g_1183.f7", z 1, } +data $.Lstring.181 = align 1 { b "g_1183.f8", z 1, } +data $.Lstring.182 = align 1 { b "g_1298", z 1, } +data $.Lstring.183 = align 1 { b "g_1393", z 1, } +data $.Lstring.184 = align 1 { b "g_1604", z 1, } +data $.Lstring.185 = align 1 { b "g_1617", z 1, } +data $.Lstring.186 = align 1 { b "g_1645", z 1, } +data $.Lstring.187 = align 1 { b "g_1922", z 1, } +data $.Lstring.188 = align 1 { b "g_1972", z 1, } +data $.Lstring.189 = align 1 { b "g_2013", z 1, } +data $.Lstring.190 = align 1 { b "g_2028", z 1, } +data $.Lstring.191 = align 1 { b "g_2102", z 1, } +export +function w $main(w %.1, l %.3) { +@start.1500 + %.2 =l alloc4 4 + storew %.1, %.2 + %.4 =l alloc8 8 + storel %.3, %.4 + %.5 =l alloc4 4 + %.6 =l alloc4 4 + %.7 =l alloc4 4 + %.8 =l alloc4 4 +@body.1501 + %.9 =l add %.8, 0 + storew 0, %.9 + %.10 =w loadsw %.2 + %.11 =w ceqw %.10, 2 + %.12 =w cnew %.11, 0 + jnz %.12, @logic_right.1502, @logic_join.1503 +@logic_right.1502 + %.13 =l loadl %.4 + %.14 =l extsw 1 + %.15 =l mul %.14, 8 + %.16 =l add %.13, %.15 + %.17 =l loadl %.16 + %.18 =l copy %.17 + %.19 =l copy $.Lstring.109 + %.20 =w call $strcmp(l %.18, l %.19) + %.21 =w ceqw %.20, 0 + %.22 =w cnew %.21, 0 +@logic_join.1503 + %.23 =w phi @body.1501 %.12, @logic_right.1502 %.22 + %.24 =w cnew %.23, 0 + jnz %.24, @if_true.1504, @if_false.1505 +@if_true.1504 + storew 1, %.8 +@if_false.1505 + call $platform_main_begin() + call $crc32_gentab() + %.25 =l call $func_1() + %.26 =w loadsb $g_2 + %.27 =l extsb %.26 + %.28 =w loadsw %.8 + call $transparent_crc(l %.27, l $.Lstring.110, w %.28) + storew 0, %.5 +@for_cond.1506 + %.29 =w loadsw %.5 + %.30 =w csltw %.29, 9 + jnz %.30, @for_body.1507, @for_join.1509 +@for_body.1507 + storew 0, %.6 +@for_cond.1510 + %.31 =w loadsw %.6 + %.32 =w csltw %.31, 3 + jnz %.32, @for_body.1511, @for_join.1513 +@for_body.1511 + storew 0, %.7 +@for_cond.1514 + %.33 =w loadsw %.7 + %.34 =w csltw %.33, 1 + jnz %.34, @for_body.1515, @for_join.1517 +@for_body.1515 + %.35 =w loadsw %.5 + %.36 =l extsw %.35 + %.37 =l mul %.36, 12 + %.38 =l add $g_13, %.37 + %.39 =w loadsw %.6 + %.40 =l extsw %.39 + %.41 =l mul %.40, 4 + %.42 =l add %.38, %.41 + %.43 =w loadsw %.7 + %.44 =l extsw %.43 + %.45 =l mul %.44, 4 + %.46 =l add %.42, %.45 + %.47 =w loadsw %.46 + %.48 =l extsw %.47 + %.49 =w loadsw %.8 + call $transparent_crc(l %.48, l $.Lstring.111, w %.49) + %.50 =w loadsw %.8 + %.51 =w cnew %.50, 0 + jnz %.51, @if_true.1518, @if_false.1519 +@if_true.1518 + %.52 =l copy $.Lstring.112 + %.53 =w loadsw %.5 + %.54 =w loadsw %.6 + %.55 =w loadsw %.7 + %.56 =w call $printf(l %.52, w %.53, w %.54, w %.55, ...) +@if_false.1519 +@for_cont.1516 + %.57 =w loadsw %.7 + %.58 =w add %.57, 1 + storew %.58, %.7 + jmp @for_cond.1514 +@for_join.1517 +@for_cont.1512 + %.59 =w loadsw %.6 + %.60 =w add %.59, 1 + storew %.60, %.6 + jmp @for_cond.1510 +@for_join.1513 +@for_cont.1508 + %.61 =w loadsw %.5 + %.62 =w add %.61, 1 + storew %.62, %.5 + jmp @for_cond.1506 +@for_join.1509 + %.63 =w loadsw $g_24 + %.64 =l extsw %.63 + %.65 =w loadsw %.8 + call $transparent_crc(l %.64, l $.Lstring.113, w %.65) + %.66 =w loadub $g_46 + %.67 =l extub %.66 + %.68 =w loadsw %.8 + call $transparent_crc(l %.67, l $.Lstring.114, w %.68) + %.69 =w loadsw $g_50 + %.70 =l extsw %.69 + %.71 =w loadsw %.8 + call $transparent_crc(l %.70, l $.Lstring.115, w %.71) + %.72 =w loadub $g_57 + %.73 =l extub %.72 + %.74 =w loadsw %.8 + call $transparent_crc(l %.73, l $.Lstring.116, w %.74) + %.75 =l loadl $g_58 + %.76 =w loadsw %.8 + call $transparent_crc(l %.75, l $.Lstring.117, w %.76) + %.77 =l loadl $g_80 + %.78 =l copy %.77 + %.79 =w loadsw %.8 + call $transparent_crc(l %.78, l $.Lstring.118, w %.79) + %.80 =w loadsh $g_81 + %.81 =l extsh %.80 + %.82 =w loadsw %.8 + call $transparent_crc(l %.81, l $.Lstring.119, w %.82) + %.83 =l loadl $g_82 + %.84 =l copy %.83 + %.85 =w loadsw %.8 + call $transparent_crc(l %.84, l $.Lstring.120, w %.85) + %.86 =w loaduw $g_84 + %.87 =l extuw %.86 + %.88 =w loadsw %.8 + call $transparent_crc(l %.87, l $.Lstring.121, w %.88) + %.89 =w loaduw $g_115 + %.90 =l extuw %.89 + %.91 =w loadsw %.8 + call $transparent_crc(l %.90, l $.Lstring.122, w %.91) + %.92 =l copy $g_130 + %.93 =l mul 0, 1 + %.94 =l add %.92, %.93 + %.95 =l copy %.94 + %.96 =w loadsw %.95 + %.97 =l extsw %.96 + %.98 =w loadsw %.8 + call $transparent_crc(l %.97, l $.Lstring.123, w %.98) + %.99 =l copy $g_130 + %.100 =l mul 4, 1 + %.101 =l add %.99, %.100 + %.102 =l copy %.101 + %.103 =w loaduw %.102 + %.104 =l extuw %.103 + %.105 =w loadsw %.8 + call $transparent_crc(l %.104, l $.Lstring.124, w %.105) + %.106 =l copy $g_130 + %.107 =l mul 8, 1 + %.108 =l add %.106, %.107 + %.109 =l copy %.108 + %.110 =w loadsh %.109 + %.111 =l extsh %.110 + %.112 =w loadsw %.8 + call $transparent_crc(l %.111, l $.Lstring.125, w %.112) + %.113 =l copy $g_130 + %.114 =l mul 12, 1 + %.115 =l add %.113, %.114 + %.116 =l copy %.115 + %.117 =w loadsw %.116 + %.118 =l extsw %.117 + %.119 =w loadsw %.8 + call $transparent_crc(l %.118, l $.Lstring.126, w %.119) + %.120 =l copy $g_130 + %.121 =l mul 16, 1 + %.122 =l add %.120, %.121 + %.123 =l copy %.122 + %.124 =w loaduw %.123 + %.125 =l extuw %.124 + %.126 =w loadsw %.8 + call $transparent_crc(l %.125, l $.Lstring.127, w %.126) + storew 0, %.5 +@for_cond.1520 + %.127 =w loadsw %.5 + %.128 =w csltw %.127, 6 + jnz %.128, @for_body.1521, @for_join.1523 +@for_body.1521 + %.129 =w loadsw %.5 + %.130 =l extsw %.129 + %.131 =l mul %.130, 1 + %.132 =l add $g_132, %.131 + %.133 =w loadsb %.132 + %.134 =l extsb %.133 + %.135 =w loadsw %.8 + call $transparent_crc(l %.134, l $.Lstring.128, w %.135) + %.136 =w loadsw %.8 + %.137 =w cnew %.136, 0 + jnz %.137, @if_true.1524, @if_false.1525 +@if_true.1524 + %.138 =l copy $.Lstring.129 + %.139 =w loadsw %.5 + %.140 =w call $printf(l %.138, w %.139, ...) +@if_false.1525 +@for_cont.1522 + %.141 =w loadsw %.5 + %.142 =w add %.141, 1 + storew %.142, %.5 + jmp @for_cond.1520 +@for_join.1523 + %.143 =l copy $g_185 + %.144 =l mul 0, 1 + %.145 =l add %.143, %.144 + %.146 =l copy %.145 + %.147 =w loadub %.146 + %.148 =l extub %.147 + %.149 =w loadsw %.8 + call $transparent_crc(l %.148, l $.Lstring.130, w %.149) + %.150 =l copy $g_185 + %.151 =l mul 8, 1 + %.152 =l add %.150, %.151 + %.153 =l copy %.152 + %.154 =l loadl %.153 + %.155 =l copy %.154 + %.156 =w loadsw %.8 + call $transparent_crc(l %.155, l $.Lstring.131, w %.156) + %.157 =l copy $g_185 + %.158 =l mul 16, 1 + %.159 =l add %.157, %.158 + %.160 =l copy %.159 + %.161 =w loadsw %.160 + %.162 =l extsw %.161 + %.163 =w loadsw %.8 + call $transparent_crc(l %.162, l $.Lstring.132, w %.163) + %.164 =l copy $g_185 + %.165 =l mul 24, 1 + %.166 =l add %.164, %.165 + %.167 =l copy %.166 + %.168 =l loadl %.167 + %.169 =w loadsw %.8 + call $transparent_crc(l %.168, l $.Lstring.133, w %.169) + %.170 =l copy $g_185 + %.171 =l mul 32, 1 + %.172 =l add %.170, %.171 + %.173 =l copy %.172 + %.174 =w loaduw %.173 + %.175 =l extuw %.174 + %.176 =w loadsw %.8 + call $transparent_crc(l %.175, l $.Lstring.134, w %.176) + %.177 =l copy $g_185 + %.178 =l mul 36, 1 + %.179 =l add %.177, %.178 + %.180 =l copy %.179 + %.181 =w loaduw %.180 + %.182 =l extuw %.181 + %.183 =w loadsw %.8 + call $transparent_crc(l %.182, l $.Lstring.135, w %.183) + %.184 =l copy $g_185 + %.185 =l mul 40, 1 + %.186 =l add %.184, %.185 + %.187 =l copy %.186 + %.188 =w loadsw %.187 + %.189 =l extsw %.188 + %.190 =w loadsw %.8 + call $transparent_crc(l %.189, l $.Lstring.136, w %.190) + %.191 =l copy $g_185 + %.192 =l mul 44, 1 + %.193 =l add %.191, %.192 + %.194 =l copy %.193 + %.195 =w loadsw %.194 + %.196 =l extsw %.195 + %.197 =w loadsw %.8 + call $transparent_crc(l %.196, l $.Lstring.137, w %.197) + %.198 =l copy $g_185 + %.199 =l mul 48, 1 + %.200 =l add %.198, %.199 + %.201 =l copy %.200 + %.202 =w loadsw %.201 + %.203 =l extsw %.202 + %.204 =w loadsw %.8 + call $transparent_crc(l %.203, l $.Lstring.138, w %.204) + %.205 =l copy $g_265 + %.206 =l mul 0, 1 + %.207 =l add %.205, %.206 + %.208 =l copy %.207 + %.209 =w loadub %.208 + %.210 =l extub %.209 + %.211 =w loadsw %.8 + call $transparent_crc(l %.210, l $.Lstring.139, w %.211) + %.212 =l copy $g_265 + %.213 =l mul 8, 1 + %.214 =l add %.212, %.213 + %.215 =l copy %.214 + %.216 =l loadl %.215 + %.217 =l copy %.216 + %.218 =w loadsw %.8 + call $transparent_crc(l %.217, l $.Lstring.140, w %.218) + %.219 =l copy $g_265 + %.220 =l mul 16, 1 + %.221 =l add %.219, %.220 + %.222 =l copy %.221 + %.223 =w loadsw %.222 + %.224 =l extsw %.223 + %.225 =w loadsw %.8 + call $transparent_crc(l %.224, l $.Lstring.141, w %.225) + %.226 =l copy $g_265 + %.227 =l mul 24, 1 + %.228 =l add %.226, %.227 + %.229 =l copy %.228 + %.230 =l loadl %.229 + %.231 =w loadsw %.8 + call $transparent_crc(l %.230, l $.Lstring.142, w %.231) + %.232 =l copy $g_265 + %.233 =l mul 32, 1 + %.234 =l add %.232, %.233 + %.235 =l copy %.234 + %.236 =w loaduw %.235 + %.237 =l extuw %.236 + %.238 =w loadsw %.8 + call $transparent_crc(l %.237, l $.Lstring.143, w %.238) + %.239 =l copy $g_265 + %.240 =l mul 36, 1 + %.241 =l add %.239, %.240 + %.242 =l copy %.241 + %.243 =w loaduw %.242 + %.244 =l extuw %.243 + %.245 =w loadsw %.8 + call $transparent_crc(l %.244, l $.Lstring.144, w %.245) + %.246 =l copy $g_265 + %.247 =l mul 40, 1 + %.248 =l add %.246, %.247 + %.249 =l copy %.248 + %.250 =w loadsw %.249 + %.251 =l extsw %.250 + %.252 =w loadsw %.8 + call $transparent_crc(l %.251, l $.Lstring.145, w %.252) + %.253 =l copy $g_265 + %.254 =l mul 44, 1 + %.255 =l add %.253, %.254 + %.256 =l copy %.255 + %.257 =w loadsw %.256 + %.258 =l extsw %.257 + %.259 =w loadsw %.8 + call $transparent_crc(l %.258, l $.Lstring.146, w %.259) + %.260 =l copy $g_265 + %.261 =l mul 48, 1 + %.262 =l add %.260, %.261 + %.263 =l copy %.262 + %.264 =w loadsw %.263 + %.265 =l extsw %.264 + %.266 =w loadsw %.8 + call $transparent_crc(l %.265, l $.Lstring.147, w %.266) + %.267 =l loadl $g_399 + %.268 =w loadsw %.8 + call $transparent_crc(l %.267, l $.Lstring.148, w %.268) + %.269 =w loaduh $g_425 + %.270 =l extuh %.269 + %.271 =w loadsw %.8 + call $transparent_crc(l %.270, l $.Lstring.149, w %.271) + %.272 =l loadl $g_477 + %.273 =w loadsw %.8 + call $transparent_crc(l %.272, l $.Lstring.150, w %.273) + %.274 =l copy $g_518 + %.275 =l mul 0, 1 + %.276 =l add %.274, %.275 + %.277 =l copy %.276 + %.278 =w loadub %.277 + %.279 =l extub %.278 + %.280 =w loadsw %.8 + call $transparent_crc(l %.279, l $.Lstring.151, w %.280) + %.281 =l copy $g_518 + %.282 =l mul 8, 1 + %.283 =l add %.281, %.282 + %.284 =l copy %.283 + %.285 =l loadl %.284 + %.286 =l copy %.285 + %.287 =w loadsw %.8 + call $transparent_crc(l %.286, l $.Lstring.152, w %.287) + %.288 =l copy $g_518 + %.289 =l mul 16, 1 + %.290 =l add %.288, %.289 + %.291 =l copy %.290 + %.292 =w loadsw %.291 + %.293 =l extsw %.292 + %.294 =w loadsw %.8 + call $transparent_crc(l %.293, l $.Lstring.153, w %.294) + %.295 =l copy $g_518 + %.296 =l mul 24, 1 + %.297 =l add %.295, %.296 + %.298 =l copy %.297 + %.299 =l loadl %.298 + %.300 =w loadsw %.8 + call $transparent_crc(l %.299, l $.Lstring.154, w %.300) + %.301 =l copy $g_518 + %.302 =l mul 32, 1 + %.303 =l add %.301, %.302 + %.304 =l copy %.303 + %.305 =w loaduw %.304 + %.306 =l extuw %.305 + %.307 =w loadsw %.8 + call $transparent_crc(l %.306, l $.Lstring.155, w %.307) + %.308 =l copy $g_518 + %.309 =l mul 36, 1 + %.310 =l add %.308, %.309 + %.311 =l copy %.310 + %.312 =w loaduw %.311 + %.313 =l extuw %.312 + %.314 =w loadsw %.8 + call $transparent_crc(l %.313, l $.Lstring.156, w %.314) + %.315 =l copy $g_518 + %.316 =l mul 40, 1 + %.317 =l add %.315, %.316 + %.318 =l copy %.317 + %.319 =w loadsw %.318 + %.320 =l extsw %.319 + %.321 =w loadsw %.8 + call $transparent_crc(l %.320, l $.Lstring.157, w %.321) + %.322 =l copy $g_518 + %.323 =l mul 44, 1 + %.324 =l add %.322, %.323 + %.325 =l copy %.324 + %.326 =w loadsw %.325 + %.327 =l extsw %.326 + %.328 =w loadsw %.8 + call $transparent_crc(l %.327, l $.Lstring.158, w %.328) + %.329 =l copy $g_518 + %.330 =l mul 48, 1 + %.331 =l add %.329, %.330 + %.332 =l copy %.331 + %.333 =w loadsw %.332 + %.334 =l extsw %.333 + %.335 =w loadsw %.8 + call $transparent_crc(l %.334, l $.Lstring.159, w %.335) + %.336 =w loadub $g_566 + %.337 =l extub %.336 + %.338 =w loadsw %.8 + call $transparent_crc(l %.337, l $.Lstring.160, w %.338) + %.339 =w loaduh $g_619 + %.340 =l extuh %.339 + %.341 =w loadsw %.8 + call $transparent_crc(l %.340, l $.Lstring.161, w %.341) + %.342 =w loadsb $g_629 + %.343 =l extsb %.342 + %.344 =w loadsw %.8 + call $transparent_crc(l %.343, l $.Lstring.162, w %.344) + %.345 =w loadsb $g_631 + %.346 =l extsb %.345 + %.347 =w loadsw %.8 + call $transparent_crc(l %.346, l $.Lstring.163, w %.347) + %.348 =l copy $g_794 + %.349 =l mul 0, 1 + %.350 =l add %.348, %.349 + %.351 =l copy %.350 + %.352 =w loadsw %.351 + %.353 =l extsw %.352 + %.354 =w loadsw %.8 + call $transparent_crc(l %.353, l $.Lstring.164, w %.354) + %.355 =l copy $g_794 + %.356 =l mul 4, 1 + %.357 =l add %.355, %.356 + %.358 =l copy %.357 + %.359 =w loaduw %.358 + %.360 =l extuw %.359 + %.361 =w loadsw %.8 + call $transparent_crc(l %.360, l $.Lstring.165, w %.361) + %.362 =l copy $g_794 + %.363 =l mul 8, 1 + %.364 =l add %.362, %.363 + %.365 =l copy %.364 + %.366 =w loadsh %.365 + %.367 =l extsh %.366 + %.368 =w loadsw %.8 + call $transparent_crc(l %.367, l $.Lstring.166, w %.368) + %.369 =l copy $g_794 + %.370 =l mul 12, 1 + %.371 =l add %.369, %.370 + %.372 =l copy %.371 + %.373 =w loadsw %.372 + %.374 =l extsw %.373 + %.375 =w loadsw %.8 + call $transparent_crc(l %.374, l $.Lstring.167, w %.375) + %.376 =l copy $g_794 + %.377 =l mul 16, 1 + %.378 =l add %.376, %.377 + %.379 =l copy %.378 + %.380 =w loaduw %.379 + %.381 =l extuw %.380 + %.382 =w loadsw %.8 + call $transparent_crc(l %.381, l $.Lstring.168, w %.382) + %.383 =w loaduh $g_858 + %.384 =l extuh %.383 + %.385 =w loadsw %.8 + call $transparent_crc(l %.384, l $.Lstring.169, w %.385) + %.386 =w loadsb $g_937 + %.387 =l extsb %.386 + %.388 =w loadsw %.8 + call $transparent_crc(l %.387, l $.Lstring.170, w %.388) + %.389 =w loaduw $g_1018 + %.390 =l extuw %.389 + %.391 =w loadsw %.8 + call $transparent_crc(l %.390, l $.Lstring.171, w %.391) + %.392 =w loadsb $g_1130 + %.393 =l extsb %.392 + %.394 =w loadsw %.8 + call $transparent_crc(l %.393, l $.Lstring.172, w %.394) + %.395 =l copy $g_1183 + %.396 =l mul 0, 1 + %.397 =l add %.395, %.396 + %.398 =l copy %.397 + %.399 =w loadub %.398 + %.400 =l extub %.399 + %.401 =w loadsw %.8 + call $transparent_crc(l %.400, l $.Lstring.173, w %.401) + %.402 =l copy $g_1183 + %.403 =l mul 8, 1 + %.404 =l add %.402, %.403 + %.405 =l copy %.404 + %.406 =l loadl %.405 + %.407 =l copy %.406 + %.408 =w loadsw %.8 + call $transparent_crc(l %.407, l $.Lstring.174, w %.408) + %.409 =l copy $g_1183 + %.410 =l mul 16, 1 + %.411 =l add %.409, %.410 + %.412 =l copy %.411 + %.413 =w loadsw %.412 + %.414 =l extsw %.413 + %.415 =w loadsw %.8 + call $transparent_crc(l %.414, l $.Lstring.175, w %.415) + %.416 =l copy $g_1183 + %.417 =l mul 24, 1 + %.418 =l add %.416, %.417 + %.419 =l copy %.418 + %.420 =l loadl %.419 + %.421 =w loadsw %.8 + call $transparent_crc(l %.420, l $.Lstring.176, w %.421) + %.422 =l copy $g_1183 + %.423 =l mul 32, 1 + %.424 =l add %.422, %.423 + %.425 =l copy %.424 + %.426 =w loaduw %.425 + %.427 =l extuw %.426 + %.428 =w loadsw %.8 + call $transparent_crc(l %.427, l $.Lstring.177, w %.428) + %.429 =l copy $g_1183 + %.430 =l mul 36, 1 + %.431 =l add %.429, %.430 + %.432 =l copy %.431 + %.433 =w loaduw %.432 + %.434 =l extuw %.433 + %.435 =w loadsw %.8 + call $transparent_crc(l %.434, l $.Lstring.178, w %.435) + %.436 =l copy $g_1183 + %.437 =l mul 40, 1 + %.438 =l add %.436, %.437 + %.439 =l copy %.438 + %.440 =w loadsw %.439 + %.441 =l extsw %.440 + %.442 =w loadsw %.8 + call $transparent_crc(l %.441, l $.Lstring.179, w %.442) + %.443 =l copy $g_1183 + %.444 =l mul 44, 1 + %.445 =l add %.443, %.444 + %.446 =l copy %.445 + %.447 =w loadsw %.446 + %.448 =l extsw %.447 + %.449 =w loadsw %.8 + call $transparent_crc(l %.448, l $.Lstring.180, w %.449) + %.450 =l copy $g_1183 + %.451 =l mul 48, 1 + %.452 =l add %.450, %.451 + %.453 =l copy %.452 + %.454 =w loadsw %.453 + %.455 =l extsw %.454 + %.456 =w loadsw %.8 + call $transparent_crc(l %.455, l $.Lstring.181, w %.456) + %.457 =w loaduw $g_1298 + %.458 =l extuw %.457 + %.459 =w loadsw %.8 + call $transparent_crc(l %.458, l $.Lstring.182, w %.459) + %.460 =w loaduw $g_1393 + %.461 =l extuw %.460 + %.462 =w loadsw %.8 + call $transparent_crc(l %.461, l $.Lstring.183, w %.462) + %.463 =l loadl $g_1604 + %.464 =w loadsw %.8 + call $transparent_crc(l %.463, l $.Lstring.184, w %.464) + %.465 =w loaduh $g_1617 + %.466 =l extuh %.465 + %.467 =w loadsw %.8 + call $transparent_crc(l %.466, l $.Lstring.185, w %.467) + %.468 =w loadsw $g_1645 + %.469 =l extsw %.468 + %.470 =w loadsw %.8 + call $transparent_crc(l %.469, l $.Lstring.186, w %.470) + %.471 =w loadsh $g_1922 + %.472 =l extsh %.471 + %.473 =w loadsw %.8 + call $transparent_crc(l %.472, l $.Lstring.187, w %.473) + %.474 =l loadl $g_1972 + %.475 =l copy %.474 + %.476 =w loadsw %.8 + call $transparent_crc(l %.475, l $.Lstring.188, w %.476) + %.477 =w loaduw $g_2013 + %.478 =l extuw %.477 + %.479 =w loadsw %.8 + call $transparent_crc(l %.478, l $.Lstring.189, w %.479) + %.480 =l loadl $g_2028 + %.481 =l copy %.480 + %.482 =w loadsw %.8 + call $transparent_crc(l %.481, l $.Lstring.190, w %.482) + %.483 =w loaduh $g_2102 + %.484 =l extuh %.483 + %.485 =w loadsw %.8 + call $transparent_crc(l %.484, l $.Lstring.191, w %.485) + %.486 =l loadl $crc32_context + %.487 =l copy 4294967295 + %.488 =l xor %.486, %.487 + %.489 =w loadsw %.8 + call $platform_main_end(l %.488, w %.489) + ret 0 +} +export data $crc32_context = align 8 { z 8 } +data $__undefined = align 8 { z 8 } From 3a6cc4d0c0820319fc75cdde463eaf35d1731f4c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 29 Apr 2019 10:15:24 +0200 Subject: [PATCH 156/286] add missing gas prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Jorge Acereda Maciá for catching this. --- gas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gas.c b/gas.c index 6c3317d..1b6a053 100644 --- a/gas.c +++ b/gas.c @@ -42,8 +42,8 @@ gasemitdat(Dat *d, FILE *f) fprintf(f, "\t.ascii \"%s\"\n", d->u.str); } else if (d->isref) { - fprintf(f, "%s %s%+"PRId64"\n", - dtoa[d->type], d->u.ref.nam, + fprintf(f, "%s %s%s%+"PRId64"\n", + dtoa[d->type], gassym, d->u.ref.nam, d->u.ref.off); } else { From e2bc0ad3960769ba7a0f1223ac160b0d985fff35 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 27 Apr 2019 18:27:21 -0700 Subject: [PATCH 157/286] amd64: Use unordered compare for floating points This prevents an FE_INVALID exception when comparing with NaN. --- amd64/emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amd64/emit.c b/amd64/emit.c index 91223bd..d4bd54c 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -110,8 +110,8 @@ static struct { { Osign, Kw, "cltd" }, { Oxdiv, Ki, "div%k %0" }, { Oxidiv, Ki, "idiv%k %0" }, - { Oxcmp, Ks, "comiss %S0, %S1" }, - { Oxcmp, Kd, "comisd %D0, %D1" }, + { Oxcmp, Ks, "ucomiss %S0, %S1" }, + { Oxcmp, Kd, "ucomisd %D0, %D1" }, { Oxcmp, Ki, "cmp%k %0, %1" }, { Oxtest, Ki, "test%k %0, %1" }, #define X(c, s) \ From 0384d73e8daa5c948fb08c7301144c0d7e740ef9 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 27 Apr 2019 12:22:57 -0700 Subject: [PATCH 158/286] fold: Make sure 32-bit constants get sign extended when necessary --- fold.c | 6 +++--- test/fold1.ssa | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 test/fold1.ssa diff --git a/fold.c b/fold.c index 019b739..521c911 100644 --- a/fold.c +++ b/fold.c @@ -371,15 +371,15 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) switch (op) { case Oadd: x = l.u + r.u; break; case Osub: x = l.u - r.u; break; - case Odiv: x = l.s / r.s; break; - case Orem: x = l.s % r.s; break; + case Odiv: x = w ? l.s / r.s : (int32_t)l.s / (int32_t)r.s; break; + case Orem: x = w ? l.s % r.s : (int32_t)l.s % (int32_t)r.s; break; case Oudiv: x = l.u / r.u; break; case Ourem: x = l.u % r.u; break; case Omul: x = l.u * r.u; break; case Oand: x = l.u & r.u; break; case Oor: x = l.u | r.u; break; case Oxor: x = l.u ^ r.u; break; - case Osar: x = l.s >> (r.u & 63); break; + case Osar: x = (w ? l.s : (int32_t)l.s) >> (r.u & 63); break; case Oshr: x = l.u >> (r.u & 63); break; case Oshl: x = l.u << (r.u & 63); break; case Oextsb: x = (int8_t)l.u; break; diff --git a/test/fold1.ssa b/test/fold1.ssa new file mode 100644 index 0000000..0ee2f91 --- /dev/null +++ b/test/fold1.ssa @@ -0,0 +1,25 @@ +export +function w $f1() { +@start + %x =w sar 2147483648, 31 + ret %x +} + +export +function w $f2() { +@start + %x =w div 4294967040, 8 # -256 / 8 + ret %x +} + +export +function w $f3() { +@start + %x =w rem 4294967284, 7 # -12 % 7 + ret %x +} + +# >>> driver +# extern int f1(), f2(), f3(); +# int main() { return !(f1() == -1 && f2() == -32 && f3() == -5); } +# <<< From 660a8d9dfa44050897b2f5ead823554893d79f24 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 29 Apr 2019 11:29:22 +0200 Subject: [PATCH 159/286] fix folding of unsigned operations This fixes similar bugs than the ones fixed in the previous commit. In the folding code the invariant is that when a result is 32 bits wide, the low 32 bits of 'x' are correct. The high bits can be anything. --- fold.c | 6 +++--- test/fold1.ssa | 26 ++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/fold.c b/fold.c index 521c911..0a3945f 100644 --- a/fold.c +++ b/fold.c @@ -373,14 +373,14 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) case Osub: x = l.u - r.u; break; case Odiv: x = w ? l.s / r.s : (int32_t)l.s / (int32_t)r.s; break; case Orem: x = w ? l.s % r.s : (int32_t)l.s % (int32_t)r.s; break; - case Oudiv: x = l.u / r.u; break; - case Ourem: x = l.u % r.u; break; + case Oudiv: x = w ? l.u / r.u : (uint32_t)l.u / (uint32_t)r.u; break; + case Ourem: x = w ? l.u % r.u : (uint32_t)l.u % (uint32_t)r.u; break; case Omul: x = l.u * r.u; break; case Oand: x = l.u & r.u; break; case Oor: x = l.u | r.u; break; case Oxor: x = l.u ^ r.u; break; case Osar: x = (w ? l.s : (int32_t)l.s) >> (r.u & 63); break; - case Oshr: x = l.u >> (r.u & 63); break; + case Oshr: x = (w ? l.u : (uint32_t)l.u) >> (r.u & 63); break; case Oshl: x = l.u << (r.u & 63); break; case Oextsb: x = (int8_t)l.u; break; case Oextub: x = (uint8_t)l.u; break; diff --git a/test/fold1.ssa b/test/fold1.ssa index 0ee2f91..9fb5d71 100644 --- a/test/fold1.ssa +++ b/test/fold1.ssa @@ -19,7 +19,29 @@ function w $f3() { ret %x } +export +function w $f4() { +@start + %x =w shr 4294967296, 1 # 2^32 >> 1 + ret %x +} + +export +function w $f5() { +@start + %x =w udiv 1, 4294967297 # 1 / (2^32 + 1) + ret %x +} + +export +function w $f6() { +@start + %x =w urem 4294967296, 7 # 2^32 % 7 + ret %x +} + # >>> driver -# extern int f1(), f2(), f3(); -# int main() { return !(f1() == -1 && f2() == -32 && f3() == -5); } +# extern int f1(), f2(), f3(), f4(), f5(), f6(); +# int main() { return !(f1() == -1 && f2() == -32 && f3() == -5 && +# f4() == 0 && f5() == 1 && f6() == 0); } # <<< From 4b7f02c09710b379a706708ae5880a1811519539 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 30 Apr 2019 11:02:42 +0200 Subject: [PATCH 160/286] isel fix for amd64 memory stores The value argument of store instructions was handled incorrectly. --- amd64/isel.c | 37 +++++++++++++++++++------------------ test/conaddr.ssa | 14 ++++++++++++-- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index 22e1e14..56e4cf3 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -59,17 +59,16 @@ rslot(Ref r, Fn *fn) } static void -fixarg(Ref *r, int k, int op, Fn *fn) +fixarg(Ref *r, int k, Ins *i, Fn *fn) { char buf[32]; Addr a, *m; Ref r0, r1; - int s, n, cpy, mem; + int s, n, op; r1 = r0 = *r; s = rslot(r0, fn); - cpy = op == Ocopy || op == -1; - mem = isstore(op) || isload(op) || op == Ocall; + op = i ? i->op : Ocopy; if (KBASE(k) == 1 && rtype(r0) == RCon) { /* load floating points from memory * slots, they can't be used as @@ -85,7 +84,7 @@ fixarg(Ref *r, int k, int op, Fn *fn) a.offset.label = intern(buf); fn->mem[fn->nmem-1] = a; } - else if (!cpy && k == Kl && noimm(r0, fn)) { + else if (op != Ocopy && k == Kl && noimm(r0, fn)) { /* load constants that do not fit in * a 32bit signed integer into a * long temporary @@ -101,7 +100,8 @@ fixarg(Ref *r, int k, int op, Fn *fn) r1 = newtmp("isel", Kl, fn); emit(Oaddr, Kl, r1, SLOT(s), R); } - else if (!mem && rtype(r0) == RCon + else if (!(isstore(op) && r == &i->arg[1]) + && !isload(op) && op != Ocall && rtype(r0) == RCon && fn->con[r0.val].type == CAddr) { /* apple as does not support 32-bit * absolute addressing, use a rip- @@ -168,7 +168,8 @@ static int selcmp(Ref arg[2], int k, Fn *fn) { int swap; - Ref r, *iarg; + Ref r; + Ins *icmp; swap = rtype(arg[0]) == RCon; if (swap) { @@ -177,21 +178,21 @@ selcmp(Ref arg[2], int k, Fn *fn) arg[0] = r; } emit(Oxcmp, k, R, arg[1], arg[0]); - iarg = curi->arg; + icmp = curi; if (rtype(arg[0]) == RCon) { assert(k == Kl); - iarg[1] = newtmp("isel", k, fn); - emit(Ocopy, k, iarg[1], arg[0], R); + icmp->arg[1] = newtmp("isel", k, fn); + emit(Ocopy, k, icmp->arg[1], arg[0], R); } - fixarg(&iarg[0], k, Oxcmp, fn); - fixarg(&iarg[1], k, Oxcmp, fn); + fixarg(&icmp->arg[0], k, icmp, fn); + fixarg(&icmp->arg[1], k, icmp, fn); return swap; } static void sel(Ins i, ANum *an, Fn *fn) { - Ref r0, r1, *iarg; + Ref r0, r1; int x, k, kc; int64_t sz; Ins *i0, *i1; @@ -236,7 +237,7 @@ sel(Ins i, ANum *an, Fn *fn) emit(Ocopy, k, TMP(RDX), CON_Z, R); } emit(Ocopy, k, TMP(RAX), i.arg[0], R); - fixarg(&curi->arg[0], k, Ocopy, fn); + fixarg(&curi->arg[0], k, curi, fn); if (rtype(i.arg[1]) == RCon) emit(Ocopy, k, r0, i.arg[1], R); break; @@ -290,9 +291,9 @@ sel(Ins i, ANum *an, Fn *fn) case_OExt: Emit: emiti(i); - iarg = curi->arg; /* fixarg() can change curi */ - fixarg(&iarg[0], argcls(&i, 0), i.op, fn); - fixarg(&iarg[1], argcls(&i, 1), i.op, fn); + i1 = curi; /* fixarg() can change curi */ + fixarg(&i1->arg[0], argcls(&i, 0), i1, fn); + fixarg(&i1->arg[1], argcls(&i, 1), i1, fn); break; case Oalloc: case Oalloc+1: @@ -604,7 +605,7 @@ amd64_isel(Fn *fn) for (p=(*sb)->phi; p; p=p->link) { for (a=0; p->blk[a] != b; a++) assert(a+1 < p->narg); - fixarg(&p->arg[a], p->cls, -1, fn); + fixarg(&p->arg[a], p->cls, 0, fn); } memset(ainfo, 0, n * sizeof ainfo[0]); anumber(ainfo, b, fn->con); diff --git a/test/conaddr.ssa b/test/conaddr.ssa index 43177ba..9e24d49 100644 --- a/test/conaddr.ssa +++ b/test/conaddr.ssa @@ -34,6 +34,13 @@ function l $f3(l %o) { ret %addr } +export +function $f4() { +@start + storel $p, $p + ret +} + export function $writeto0() { @start @@ -45,13 +52,14 @@ function $writeto0() { # #include # #include # char a[] = "qbe rocks"; +# void *p; # int ok; # extern unsigned f0(long), f1(long), f2(long, long); # extern char *f3(long); -# extern void writeto0(); +# extern void f4(), writeto0(); # void h(int sig, siginfo_t *si, void *unused) { # ok += si->si_addr == 0; -# exit(!(ok == 5)); +# exit(!(ok == 6)); # } # int main() { # struct sigaction sa = {.sa_flags=SA_SIGINFO, .sa_sigaction=h}; @@ -60,6 +68,8 @@ function $writeto0() { # ok += f1((long)a-5) == 'o'; # ok += f2(4, 2) == 's'; # ok += *f3(0) == 'q'; +# f4(); +# ok += p == &p; # writeto0(); /* will segfault */ # } # <<< From 2e7d6b24eaa1314eb4fe663ef5dc529e461fb8ce Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 2 May 2019 20:26:16 +0200 Subject: [PATCH 161/286] revert heuristic to reuse stack slots The heuristic was bogus for at least two reasons (see below), and, looking at some generated code, it looks like some other issues are more pressing. 1. A stack slot of 4 bytes could be used for a temporary of 8 bytes. 2. Should 2 arguments of an operation end up spilled, the same slot could be allocated to both! --- spill.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/spill.c b/spill.c index 0742caa..c1599c0 100644 --- a/spill.c +++ b/spill.c @@ -309,7 +309,7 @@ void spill(Fn *fn) { Blk *b, *s1, *s2, *hd, **bp; - int j, l, t, k, s, lvarg[2]; + int j, l, t, k, lvarg[2]; uint n; BSet u[1], v[1], w[1]; Ins *i; @@ -404,11 +404,9 @@ spill(Fn *fn) continue; } bszero(w); - s = -1; if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); t = i->to.val; - s = tmp[t].slot; if (bshas(v, t)) bsclr(v, t); else { @@ -442,13 +440,6 @@ spill(Fn *fn) bsset(v, t); if (j-- <= 0) bsset(w, t); - else if (!lvarg[n]) { - /* recycle the slot of - * i->to when possible - */ - if (tmp[t].slot == -1) - tmp[t].slot = s; - } break; } bscopy(u, v); @@ -456,10 +447,7 @@ spill(Fn *fn) for (n=0; n<2; n++) if (rtype(i->arg[n]) == RTmp) { t = i->arg[n].val; - if (bshas(v, t)) { - if (tmp[t].slot == s) - tmp[t].slot = -1; - } else { + if (!bshas(v, t)) { /* do not reload if the * argument is dead */ From 34fee80e690986175ba9417802fad69fb5b821db Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 2 May 2019 20:57:26 +0200 Subject: [PATCH 162/286] detect ubiquitous simple copies When lowering pointer arithmetic, it is natural for a C frontend to generate those instructions. --- copy.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/copy.c b/copy.c index b92c5f4..8354929 100644 --- a/copy.c +++ b/copy.c @@ -1,7 +1,15 @@ #include "all.h" static int -iscopy(Ins *i, Ref r, Tmp *tmp) +iscon(Ref r, int64_t bits, Fn *fn) +{ + return rtype(r) == RCon + && fn->con[r.val].type == CBits + && fn->con[r.val].bits.i == bits; +} + +static int +iscopy(Ins *i, Ref r, Fn *fn) { static bits extcpy[] = { [WFull] = 0, @@ -15,15 +23,25 @@ iscopy(Ins *i, Ref r, Tmp *tmp) bits b; Tmp *t; - if (i->op == Ocopy) + switch (i->op) { + case Ocopy: return 1; + case Omul: + return iscon(i->arg[0], 1, fn) || iscon(i->arg[1], 1, fn); + case Odiv: + return iscon(i->arg[1], 1, fn); + case Oadd: + return iscon(i->arg[0], 0, fn) || iscon(i->arg[1], 0, fn); + default: + break; + } if (!isext(i->op) || rtype(r) != RTmp) return 0; if (i->op == Oextsw || i->op == Oextuw) if (i->cls == Kw) return 1; - t = &tmp[r.val]; + t = &fn->tmp[r.val]; assert(KBASE(t->cls) == 0); if (i->cls == Kl && t->cls == Kw) return 0; @@ -44,7 +62,7 @@ copyof(Ref r, Ref *cpy) * and Efficient SSA Construction" by Braun M. et al. */ static void -phisimpl(Phi *p, Ref r, Ref *cpy, Use ***pstk, BSet *ts, BSet *as, Tmp *tmp) +phisimpl(Phi *p, Ref r, Ref *cpy, Use ***pstk, BSet *ts, BSet *as, Fn *fn) { Use **stk, *u, *u1; uint nstk, a; @@ -58,7 +76,7 @@ phisimpl(Phi *p, Ref r, Ref *cpy, Use ***pstk, BSet *ts, BSet *as, Tmp *tmp) stk[0] = &(Use){.type = UPhi, .u.phi = p}; while (nstk) { u = stk[--nstk]; - if (u->type == UIns && iscopy(u->u.ins, r, tmp)) { + if (u->type == UIns && iscopy(u->u.ins, r, fn)) { p = &(Phi){.narg = 0}; t = u->u.ins->to.val; } @@ -79,8 +97,8 @@ phisimpl(Phi *p, Ref r, Ref *cpy, Use ***pstk, BSet *ts, BSet *as, Tmp *tmp) return; bsset(as, r1.val); } - u = tmp[t].use; - u1 = &u[tmp[t].nuse]; + u = fn->tmp[t].use; + u1 = &u[fn->tmp[t].nuse]; vgrow(pstk, nstk+(u1-u)); stk = *pstk; for (; uarg[a], cpy); assert(!req(r, R)); cpy[p->to.val] = p->to; - phisimpl(p, r, cpy, &stk, ts, as, fn->tmp); + phisimpl(p, r, cpy, &stk, ts, as, fn); } for (i=b->ins; i<&b->ins[b->nins]; i++) { assert(rtype(i->to) <= RTmp); if (!req(cpy[i->to.val], R)) continue; r = copyof(i->arg[0], cpy); - if (iscopy(i, r, fn->tmp)) + if (iscopy(i, r, fn)) cpy[i->to.val] = r; else cpy[i->to.val] = i->to; From 84b889c6ef536de35ac0360d28c057c8548a42c1 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 2 May 2019 21:13:27 +0200 Subject: [PATCH 163/286] move fillloop() after fold() SCCP is currently the one and only pass which seriously affects control flow; so we must compute loop costs afterwards. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.c b/main.c index 99ab330..56529c9 100644 --- a/main.c +++ b/main.c @@ -69,7 +69,6 @@ func(Fn *fn) ssa(fn); filluse(fn); ssacheck(fn); - fillloop(fn); fillalias(fn); loadopt(fn); filluse(fn); @@ -83,6 +82,7 @@ func(Fn *fn) T.isel(fn); fillrpo(fn); filllive(fn); + fillloop(fn); fillcost(fn); spill(fn); rega(fn); From c8ffe7262f28022854a504cb8260e0cfdd8c55ed Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 3 May 2019 00:09:40 +0200 Subject: [PATCH 164/286] gas: use .balign instead of .align MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .align N can either mean align to the next multiple of N or align to the next multiple of 1<export) fprintf(f, ".globl %s%s\n", gassym, d->u.str); fprintf(f, "%s%s:\n", gassym, d->u.str); @@ -98,7 +98,7 @@ gasemitfin(FILE *f) for (b=stash, i=0; b; b=b->link, i++) { if (b->size == sz) { fprintf(f, - ".align %d\n" + ".balign %d\n" "%sfp%d:", sz, gasloc, i ); From b1063d46e8c625a6aab4ee36d68e8514a6aa1493 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 4 May 2019 13:17:48 +0200 Subject: [PATCH 165/286] emit only one epilog per function Previously, each ret would lead to an epilog. This caused bloat for large functions with multiple return points. --- amd64/emit.c | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/amd64/emit.c b/amd64/emit.c index d4bd54c..f986cb8 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -537,7 +537,7 @@ amd64_emitfn(Fn *fn, FILE *f) static int id0; Blk *b, *s; Ins *i, itmp; - int *r, c, o, n, lbl; + int *r, c, o, n, lbl, ret; uint64_t fs; fprintf(f, ".text\n"); @@ -566,7 +566,7 @@ amd64_emitfn(Fn *fn, FILE *f) fs += 8; } - for (lbl=0, b=fn->start; b; b=b->link) { + for (ret=lbl=0, b=fn->start; b; b=b->link) { if (lbl || b->npred > 1) fprintf(f, "%sbb%d:\n", gasloc, id0+b->id); for (i=b->ins; i!=&b->ins[b->nins]; i++) @@ -574,21 +574,11 @@ amd64_emitfn(Fn *fn, FILE *f) lbl = 1; switch (b->jmp.type) { case Jret0: - if (fn->dynalloc) - fprintf(f, - "\tmovq %%rbp, %%rsp\n" - "\tsubq $%"PRIu64", %%rsp\n", - fs - ); - for (r=&amd64_sysv_rclob[NCLR]; r>amd64_sysv_rclob;) - if (fn->reg & BIT(*--r)) { - itmp.arg[0] = TMP(*r); - emitf("popq %L0", &itmp, fn, f); - } - fprintf(f, - "\tleave\n" - "\tret\n" - ); + if (b->link) { + ret++; + fprintf(f, "\tjmp %sbb%d\n", + gasloc, id0+fn->nblk); + } break; case Jjmp: Jmp: @@ -614,5 +604,22 @@ amd64_emitfn(Fn *fn, FILE *f) die("unhandled jump %d", b->jmp.type); } } - id0 += fn->nblk; + if (ret) + fprintf(f, "%sbb%d:\n", gasloc, id0+fn->nblk); + if (fn->dynalloc) + fprintf(f, + "\tmovq %%rbp, %%rsp\n" + "\tsubq $%"PRIu64", %%rsp\n", + fs + ); + for (r=&amd64_sysv_rclob[NCLR]; r>amd64_sysv_rclob;) + if (fn->reg & BIT(*--r)) { + itmp.arg[0] = TMP(*r); + emitf("popq %L0", &itmp, fn, f); + } + fprintf(f, + "\tleave\n" + "\tret\n" + ); + id0 += fn->nblk + (ret>0); } From e6c216baadf89402a21b3eb60df1196e562df527 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 5 May 2019 15:08:28 +0200 Subject: [PATCH 166/286] revert last commit The same functionality can be implemented naturally in the cfg simplification pass. --- amd64/emit.c | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/amd64/emit.c b/amd64/emit.c index f986cb8..d4bd54c 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -537,7 +537,7 @@ amd64_emitfn(Fn *fn, FILE *f) static int id0; Blk *b, *s; Ins *i, itmp; - int *r, c, o, n, lbl, ret; + int *r, c, o, n, lbl; uint64_t fs; fprintf(f, ".text\n"); @@ -566,7 +566,7 @@ amd64_emitfn(Fn *fn, FILE *f) fs += 8; } - for (ret=lbl=0, b=fn->start; b; b=b->link) { + for (lbl=0, b=fn->start; b; b=b->link) { if (lbl || b->npred > 1) fprintf(f, "%sbb%d:\n", gasloc, id0+b->id); for (i=b->ins; i!=&b->ins[b->nins]; i++) @@ -574,11 +574,21 @@ amd64_emitfn(Fn *fn, FILE *f) lbl = 1; switch (b->jmp.type) { case Jret0: - if (b->link) { - ret++; - fprintf(f, "\tjmp %sbb%d\n", - gasloc, id0+fn->nblk); - } + if (fn->dynalloc) + fprintf(f, + "\tmovq %%rbp, %%rsp\n" + "\tsubq $%"PRIu64", %%rsp\n", + fs + ); + for (r=&amd64_sysv_rclob[NCLR]; r>amd64_sysv_rclob;) + if (fn->reg & BIT(*--r)) { + itmp.arg[0] = TMP(*r); + emitf("popq %L0", &itmp, fn, f); + } + fprintf(f, + "\tleave\n" + "\tret\n" + ); break; case Jjmp: Jmp: @@ -604,22 +614,5 @@ amd64_emitfn(Fn *fn, FILE *f) die("unhandled jump %d", b->jmp.type); } } - if (ret) - fprintf(f, "%sbb%d:\n", gasloc, id0+fn->nblk); - if (fn->dynalloc) - fprintf(f, - "\tmovq %%rbp, %%rsp\n" - "\tsubq $%"PRIu64", %%rsp\n", - fs - ); - for (r=&amd64_sysv_rclob[NCLR]; r>amd64_sysv_rclob;) - if (fn->reg & BIT(*--r)) { - itmp.arg[0] = TMP(*r); - emitf("popq %L0", &itmp, fn, f); - } - fprintf(f, - "\tleave\n" - "\tret\n" - ); - id0 += fn->nblk + (ret>0); + id0 += fn->nblk; } From 7ba69be87b3910cac2a8cd1cfe021e58f57f58d7 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 5 May 2019 14:34:17 +0200 Subject: [PATCH 167/286] fuse epilog deduplication with jump threading --- cfg.c | 12 ++++++++++-- rega.c | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cfg.c b/cfg.c index b1c80c7..81da842 100644 --- a/cfg.c +++ b/cfg.c @@ -297,12 +297,19 @@ simpljmp(Fn *fn) { Blk **uf; /* union-find */ - Blk *b; + Blk **p, *b, *ret; int c; + ret = blknew(); + ret->id = fn->nblk++; + ret->jmp.type = Jret0; uf = emalloc(fn->nblk * sizeof uf[0]); for (b=fn->start; b; b=b->link) { assert(!b->phi); + if (b->jmp.type == Jret0) { + b->jmp.type = Jjmp; + b->s1 = ret; + } if (b->nins == 0) if (b->jmp.type == Jjmp) { uffind(&b->s1, uf); @@ -310,7 +317,7 @@ simpljmp(Fn *fn) uf[b->id] = b->s1; } } - for (b=fn->start; b; b=b->link) { + for (p=&fn->start; (b=*p); p=&b->link) { if (b->s1) uffind(&b->s1, uf); if (b->s2) @@ -322,5 +329,6 @@ simpljmp(Fn *fn) b->s2 = 0; } } + *p = ret; free(uf); } diff --git a/rega.c b/rega.c index 8f2fbd0..ba405e5 100644 --- a/rega.c +++ b/rega.c @@ -417,10 +417,11 @@ doblk(Blk *b, RMap *cur) } for (r=0; rval); + if (i->op == Ocopy && req(i->to, i->arg[0])) + curi++; /* try to change the register of a hinted * temporary if rf is available */ - x = 1; if (rf != -1 && (t = cur->w[rf]) != 0) if (!bshas(cur->b, rf) && *hint(t) == rf && (rt = rfree(cur, t)) != -1) { From 61309852742548b496d222cf4e3f2c5e1569e6dd Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 5 May 2019 16:04:14 +0200 Subject: [PATCH 168/286] add asm diffing in test script --- tools/test.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/test.sh b/tools/test.sh index 8abdb21..c2c25c5 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -2,11 +2,13 @@ dir=`cd $(dirname "$0"); pwd` bin=$dir/../obj/qbe +binref=$dir/../obj/qbe.ref tmp=/tmp/qbe.zzzz drv=$tmp.c asm=$tmp.s +asmref=$tmp.ref.s exe=$tmp.exe out=$tmp.out @@ -109,6 +111,11 @@ once() { return 1 fi + if test -x $binref + then + $binref -o $asmref $t 2>/dev/null + fi + extract driver $t > $drv extract output $t > $out @@ -143,6 +150,14 @@ once() { fi echo "[ok]" + + if test -f $asmref && ! cmp -s $asm $asmref + then + loc0=`wc -l $asm | cut -d' ' -f1` + loc1=`wc -l $asmref | cut -d' ' -f1` + printf " asm diff: %+d\n" $(($loc0 - $loc1)) + return 0 + fi } #trap cleanup TERM QUIT From 1b1a7f618ce9fc6b455e3c30213a8ec8feaab1dc Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 14 May 2019 18:43:39 +0200 Subject: [PATCH 169/286] fix a bad bug in copy detection The code used to see add 0, 10 as a copy of 0. --- copy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copy.c b/copy.c index 8354929..3aa3b98 100644 --- a/copy.c +++ b/copy.c @@ -27,11 +27,11 @@ iscopy(Ins *i, Ref r, Fn *fn) case Ocopy: return 1; case Omul: - return iscon(i->arg[0], 1, fn) || iscon(i->arg[1], 1, fn); + return iscon(i->arg[1], 1, fn); case Odiv: return iscon(i->arg[1], 1, fn); case Oadd: - return iscon(i->arg[0], 0, fn) || iscon(i->arg[1], 0, fn); + return iscon(i->arg[1], 0, fn); default: break; } From 72f2e8445adaeeb4916690263f65d6b61ffa5c1d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 14 May 2019 18:49:54 +0200 Subject: [PATCH 170/286] drop dead declaration --- all.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/all.h b/all.h index e53e290..59eefe1 100644 --- a/all.h +++ b/all.h @@ -497,9 +497,6 @@ void fillrpo(Fn *); void ssa(Fn *); void ssacheck(Fn *); -/* simpl.c */ -void simpl(Fn *); - /* copy.c */ void copy(Fn *); From 9e7e5bffc4e4af37a6c29657ba87fbb6a1123cf2 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 14 May 2019 14:34:23 -0700 Subject: [PATCH 171/286] Allow specifying literal global names --- amd64/emit.c | 13 ++++++++----- gas.c | 2 +- parse.c | 23 +++++++++++++++-------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/amd64/emit.c b/amd64/emit.c index d4bd54c..d8b29bd 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -161,12 +161,13 @@ slot(int s, Fn *fn) static void emitcon(Con *con, FILE *f) { - char *p; + char *p, *l; switch (con->type) { case CAddr: - p = con->local ? gasloc : gassym; - fprintf(f, "%s%s", p, str(con->label)); + l = str(con->label); + p = con->local ? gasloc : l[0] == '"' ? "" : gassym; + fprintf(f, "%s%s", p, l); if (con->bits.i) fprintf(f, "%+"PRId64, con->bits.i); break; @@ -539,15 +540,17 @@ amd64_emitfn(Fn *fn, FILE *f) Ins *i, itmp; int *r, c, o, n, lbl; uint64_t fs; + char *p; + p = fn->name[0] == '"' ? "" : gassym; fprintf(f, ".text\n"); if (fn->export) - fprintf(f, ".globl %s%s\n", gassym, fn->name); + fprintf(f, ".globl %s%s\n", p, fn->name); fprintf(f, "%s%s:\n" "\tpushq %%rbp\n" "\tmovq %%rsp, %%rbp\n", - gassym, fn->name + p, fn->name ); fs = framesz(fn); if (fs) diff --git a/gas.c b/gas.c index 8e2f04c..2a24ab2 100644 --- a/gas.c +++ b/gas.c @@ -39,7 +39,7 @@ gasemitdat(Dat *d, FILE *f) if (d->isstr) { if (d->type != DB) err("strings only supported for 'b' currently"); - fprintf(f, "\t.ascii \"%s\"\n", d->u.str); + fprintf(f, "\t.ascii %s\n", d->u.str); } else if (d->isref) { fprintf(f, "%s %s%s%+"PRId64"\n", diff --git a/parse.c b/parse.c index c6f16ea..c4c1fe6 100644 --- a/parse.c +++ b/parse.c @@ -227,15 +227,20 @@ lex() return Tfltd; case '%': t = Ttmp; + c = fgetc(inf); goto Alpha; case '@': t = Tlbl; + c = fgetc(inf); goto Alpha; case '$': t = Tglo; + if ((c = fgetc(inf)) == '"') + goto Quoted; goto Alpha; case ':': t = Ttyp; + c = fgetc(inf); goto Alpha; case '#': while ((c=fgetc(inf)) != '\n' && c != EOF) @@ -251,23 +256,25 @@ lex() return Tint; } if (c == '"') { - tokval.str = vnew(0, 1, Pfn); + t = Tstr; + Quoted: + tokval.str = vnew(2, 1, Pfn); + tokval.str[0] = c; esc = 0; - for (i=0;; i++) { + for (i=1;; i++) { c = fgetc(inf); if (c == EOF) err("unterminated string"); - vgrow(&tokval.str, i+1); + vgrow(&tokval.str, i+2); + tokval.str[i] = c; if (c == '"' && !esc) { - tokval.str[i] = 0; - return Tstr; + tokval.str[i+1] = 0; + return t; } esc = (c == '\\' && !esc); - tokval.str[i] = c; } } - if (0) -Alpha: c = fgetc(inf); +Alpha: if (!isalpha(c) && c != '.' && c != '_') err("invalid character %c (%d)", c, c); i = 0; From 359c4ebb17f79767ab2aa29162e7f164cb513163 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 8 May 2019 14:16:39 -0700 Subject: [PATCH 172/286] arm64: Use 32-bit register name when loading 'b' or 'h' into 'l' The ldrb and ldrh instructions require a 32-bit register name for the destination and will clear the upper 32-bits of that register. --- arm64/emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index 8211c4f..847d613 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -67,9 +67,9 @@ static struct { { Ostores, Kw, "str %S0, %M1" }, { Ostored, Kw, "str %D0, %M1" }, { Oloadsb, Ki, "ldrsb %=, %M0" }, - { Oloadub, Ki, "ldrb %=, %M0" }, + { Oloadub, Ki, "ldrb %W=, %M0" }, { Oloadsh, Ki, "ldrsh %=, %M0" }, - { Oloaduh, Ki, "ldrh %=, %M0" }, + { Oloaduh, Ki, "ldrh %W=, %M0" }, { Oloadsw, Kw, "ldr %=, %M0" }, { Oloadsw, Kl, "ldrsw %=, %M0" }, { Oloaduw, Ki, "ldr %W=, %M0" }, From 8655181f63b5327a68b27da315e889094e9e6251 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 8 May 2019 14:16:40 -0700 Subject: [PATCH 173/286] arm64: Handle truncd instruction --- arm64/emit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arm64/emit.c b/arm64/emit.c index 847d613..7c5b2b6 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -81,6 +81,7 @@ static struct { { Oextsw, Ki, "sxtw %L=, %W0" }, { Oextuw, Ki, "mov %W=, %W0" }, { Oexts, Kd, "fcvt %=, %S0" }, + { Otruncd, Ks, "fcvt %=, %D0" }, { Ocast, Kw, "fmov %=, %S0" }, { Ocast, Kl, "fmov %=, %D0" }, { Ocast, Ks, "fmov %=, %W0" }, From 7837770ba1018d8c3320a9eaf29920ef53ba2791 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 8 May 2019 14:16:41 -0700 Subject: [PATCH 174/286] arm64: Handle stack allocations larger than 4095 bytes In this case, the immediate is too large to use directly in the add/sub instructions, so move it into a temporary register first. Also, for clarity, rearrange the if-conditions so that they match the constraints of the instructions that immediately follow. --- arm64/emit.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index 7c5b2b6..59e1aae 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -382,7 +382,12 @@ arm64_emitfn(Fn *fn, FILE *out) fprintf(e->f, "\tstr\tx%d, [sp, -8]!\n", n); } - if (e->frame + 16 > 512) + if (e->frame + 16 <= 512) + fprintf(e->f, + "\tstp\tx29, x30, [sp, -%"PRIu64"]!\n", + e->frame + 16 + ); + else if (e->frame <= 4095) fprintf(e->f, "\tsub\tsp, sp, #%"PRIu64"\n" "\tstp\tx29, x30, [sp, -16]!\n", @@ -390,8 +395,10 @@ arm64_emitfn(Fn *fn, FILE *out) ); else fprintf(e->f, - "\tstp\tx29, x30, [sp, -%"PRIu64"]!\n", - e->frame + 16 + "\tmov\tx16, #%"PRIu64"\n" + "\tsub\tsp, sp, x16\n" + "\tstp\tx29, x30, [sp, -16]!\n", + e->frame ); fputs("\tadd\tx29, sp, 0\n", e->f); for (o=e->frame+16, r=arm64_rclob; *r>=0; r++) @@ -418,7 +425,12 @@ arm64_emitfn(Fn *fn, FILE *out) o = e->frame + 16; if (e->fn->vararg) o += 192; - if (o > 504) + if (o <= 504) + fprintf(e->f, + "\tldp\tx29, x30, [sp], %"PRIu64"\n", + o + ); + else if (o - 16 <= 4095) fprintf(e->f, "\tldp\tx29, x30, [sp], 16\n" "\tadd\tsp, sp, #%"PRIu64"\n", @@ -426,8 +438,10 @@ arm64_emitfn(Fn *fn, FILE *out) ); else fprintf(e->f, - "\tldp\tx29, x30, [sp], %"PRIu64"\n", - o + "\tldp\tx29, x30, [sp], 16\n" + "\tmov\tx16, #%"PRIu64"\n" + "\tadd\tsp, sp, x16\n", + o - 16 ); fprintf(e->f, "\tret\n"); break; From acc3af47330fd6610cf0fbdb28e9fbd05160888f Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 15 May 2019 17:29:51 -0700 Subject: [PATCH 175/286] Fix a few uses of gassym missed in 9e7e5bff --- gas.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gas.c b/gas.c index 2a24ab2..227c297 100644 --- a/gas.c +++ b/gas.c @@ -14,6 +14,7 @@ gasemitdat(Dat *d, FILE *f) [DW] = "\t.int", [DL] = "\t.quad" }; + char *p; switch (d->type) { case DStart: @@ -25,9 +26,10 @@ gasemitdat(Dat *d, FILE *f) case DName: if (!align) fprintf(f, ".balign 8\n"); + p = d->u.str[0] == '"' ? "" : gassym; if (d->export) - fprintf(f, ".globl %s%s\n", gassym, d->u.str); - fprintf(f, "%s%s:\n", gassym, d->u.str); + fprintf(f, ".globl %s%s\n", p, d->u.str); + fprintf(f, "%s%s:\n", p, d->u.str); break; case DZ: fprintf(f, "\t.fill %"PRId64",1,0\n", d->u.num); @@ -42,8 +44,9 @@ gasemitdat(Dat *d, FILE *f) fprintf(f, "\t.ascii %s\n", d->u.str); } else if (d->isref) { + p = d->u.ref.nam[0] == '"' ? "" : gassym; fprintf(f, "%s %s%s%+"PRId64"\n", - dtoa[d->type], gassym, d->u.ref.nam, + dtoa[d->type], p, d->u.ref.nam, d->u.ref.off); } else { From 7bf08ff50729037c8820b26d085905175b5593c8 Mon Sep 17 00:00:00 2001 From: "Sergei V. Rogachev" Date: Mon, 8 Jul 2019 16:55:20 +0300 Subject: [PATCH 176/286] minic: fix undefined symbol linkage issue The mandel example uses SDL2 for graphics output. When GCC is used to assemble the resulting *.s file it shows linker's errors about undefined symbols from the library. This behavior can be fixed by moving the flags passed to the compiler after the source file name. --- minic/mcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minic/mcc b/minic/mcc index c8d500e..77d3d33 100755 --- a/minic/mcc +++ b/minic/mcc @@ -33,7 +33,7 @@ fi $DIR/minic < $file > /tmp/minic.ssa && $QBE < /tmp/minic.ssa > /tmp/minic.s && -cc $flags /tmp/minic.s +cc /tmp/minic.s $flags if test $? -ne 0 then From 190263f1b628ba3171309147120fd3ba0e370b42 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 20 Nov 2019 00:20:21 -0800 Subject: [PATCH 177/286] copy: Fix use of compound literal outside its scope C99 6.5.2.5p6: > If the compound literal occurs outside the body of a function, > the object has static storage duration; otherwise, it has automatic > storage duration associated with the enclosing block. So, we can't use the address of a compound literal here. Instead, just set p to NULL, and make the loop conditional on p being non-NULL. Remarks from Quentin: I made a cosmetic change to Michael's original patch and merely pushed the literal at toplevel. --- copy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/copy.c b/copy.c index 3aa3b98..053f319 100644 --- a/copy.c +++ b/copy.c @@ -68,16 +68,18 @@ phisimpl(Phi *p, Ref r, Ref *cpy, Use ***pstk, BSet *ts, BSet *as, Fn *fn) uint nstk, a; int t; Ref r1; + Phi *p0; bszero(ts); bszero(as); + p0 = &(Phi){.narg = 0}; stk = *pstk; nstk = 1; stk[0] = &(Use){.type = UPhi, .u.phi = p}; while (nstk) { u = stk[--nstk]; if (u->type == UIns && iscopy(u->u.ins, r, fn)) { - p = &(Phi){.narg = 0}; + p = p0; t = u->u.ins->to.val; } else if (u->type == UPhi) { From 9de57265ce8453de0f773c48550ca05460844dd1 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 19 Apr 2020 16:31:52 -0700 Subject: [PATCH 178/286] Use a dynamic array for phi arguments --- all.h | 4 ++-- amd64/sysv.c | 8 ++++++-- arm64/abi.c | 8 ++++++-- load.c | 2 ++ parse.c | 2 ++ ssa.c | 6 ++++-- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/all.h b/all.h index 59eefe1..fba93b1 100644 --- a/all.h +++ b/all.h @@ -206,8 +206,8 @@ struct Ins { struct Phi { Ref to; - Ref arg[NPred]; - Blk *blk[NPred]; + Ref *arg; + Blk **blk; uint narg; int cls; Phi *link; diff --git a/amd64/sysv.c b/amd64/sysv.c index ea9b2d2..286300a 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -590,9 +590,13 @@ selvaarg(Fn *fn, Blk *b, Ins *i) *b0->phi = (Phi){ .cls = Kl, .to = loc, .narg = 2, - .blk = {bstk, breg}, - .arg = {lstk, lreg}, + .blk = vnew(2, sizeof b0->phi->blk[0], Pfn), + .arg = vnew(2, sizeof b0->phi->arg[0], Pfn), }; + b0->phi->blk[0] = bstk; + b0->phi->blk[1] = breg; + b0->phi->arg[0] = lstk; + b0->phi->arg[1] = lreg; r0 = newtmp("abi", Kl, fn); r1 = newtmp("abi", Kw, fn); b->jmp.type = Jjnz; diff --git a/arm64/abi.c b/arm64/abi.c index 8bc9c20..f5b605a 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -583,9 +583,13 @@ selvaarg(Fn *fn, Blk *b, Ins *i) *b0->phi = (Phi){ .cls = Kl, .to = loc, .narg = 2, - .blk = {bstk, breg}, - .arg = {lstk, lreg}, + .blk = vnew(2, sizeof b0->phi->blk[0], Pfn), + .arg = vnew(2, sizeof b0->phi->arg[0], Pfn), }; + b0->phi->blk[0] = bstk; + b0->phi->blk[1] = breg; + b0->phi->arg[0] = lstk; + b0->phi->arg[1] = lreg; r0 = newtmp("abi", Kl, fn); r1 = newtmp("abi", Kw, fn); b->jmp.type = Jjnz; diff --git a/load.c b/load.c index 8e2dd64..ae9cfcf 100644 --- a/load.c +++ b/load.c @@ -330,6 +330,8 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) p->to = r; p->cls = sl.cls; p->narg = b->npred; + p->arg = vnew(p->narg, sizeof p->arg[0], Pfn); + p->blk = vnew(p->narg, sizeof p->blk[0], Pfn); for (np=0; npnpred; ++np) { bp = b->pred[np]; if (!bp->s2 diff --git a/parse.c b/parse.c index c4c1fe6..95bcf45 100644 --- a/parse.c +++ b/parse.c @@ -673,7 +673,9 @@ parseline(PState ps) phi = alloc(sizeof *phi); phi->to = r; phi->cls = k; + phi->arg = vnew(i, sizeof arg[0], Pfn); memcpy(phi->arg, arg, i * sizeof arg[0]); + phi->blk = vnew(i, sizeof blk[0], Pfn); memcpy(phi->blk, blk, i * sizeof blk[0]); phi->narg = i; *plink = phi; diff --git a/ssa.c b/ssa.c index c098438..2de02d1 100644 --- a/ssa.c +++ b/ssa.c @@ -181,6 +181,8 @@ phiins(Fn *fn) p->cls = k; p->to = TMP(t); p->link = a->phi; + p->arg = vnew(0, sizeof p->arg[0], Pfn); + p->blk = vnew(0, sizeof p->blk[0], Pfn); a->phi = p; if (!bshas(defs, a->id)) if (!bshas(u, a->id)) { @@ -294,8 +296,8 @@ renblk(Blk *b, Name **stk, Fn *fn) t = p->to.val; if ((t=fn->tmp[t].visit)) { m = p->narg++; - if (m == NPred) - die("renblk, too many phi args"); + vgrow(&p->arg, p->narg); + vgrow(&p->blk, p->narg); p->arg[m] = getstk(t, b, stk); p->blk[m] = b; } From 706d6beca6218caf76f0107d15e79a8f3af1646a Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 19 Apr 2020 16:31:54 -0700 Subject: [PATCH 179/286] Move NPred in parse.c and decrease it This now only limits the number of arguments when parsing the input SSA, which is usually a small fixed size (depending on the frontend). --- all.h | 1 - parse.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/all.h b/all.h index fba93b1..7f843a9 100644 --- a/all.h +++ b/all.h @@ -32,7 +32,6 @@ typedef struct Target Target; enum { NString = 64, - NPred = 127, NIns = 1 << 20, NAlign = 3, NField = 32, diff --git a/parse.c b/parse.c index 95bcf45..b279ff4 100644 --- a/parse.c +++ b/parse.c @@ -102,6 +102,8 @@ static char *kwmap[Ntok] = { }; enum { + NPred = 63, + TMask = 16383, /* for temps hash */ BMask = 8191, /* for blocks hash */ From 84f1e2950b3ab41523f25d205c99e9d8afd7ebba Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 19 Apr 2020 16:31:55 -0700 Subject: [PATCH 180/286] arm64: Make sure SP stays aligned by 16 According to the ARMv8 overview document However if SP is used as the base register then the value of the stack pointer prior to adding any offset must be quadword (16 byte) aligned, or else a stack alignment exception will be generated. This manifests as a bus error on my system. To resolve this, just save registers two at a time with stp. --- arm64/emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index 59e1aae..892d027 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -378,8 +378,8 @@ arm64_emitfn(Fn *fn, FILE *out) if (e->fn->vararg) { for (n=7; n>=0; n--) fprintf(e->f, "\tstr\tq%d, [sp, -16]!\n", n); - for (n=7; n>=0; n--) - fprintf(e->f, "\tstr\tx%d, [sp, -8]!\n", n); + for (n=7; n>=0; n-=2) + fprintf(e->f, "\tstp\tx%d, x%d, [sp, -16]!\n", n-1, n); } if (e->frame + 16 <= 512) From 9639940cb46f0f8b5dcd872e99a9801df742f24c Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 19 Apr 2020 16:31:56 -0700 Subject: [PATCH 181/286] rega: Fix allocation of multiple temporaries to the same register --- rega.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rega.c b/rega.c index ba405e5..7547293 100644 --- a/rega.c +++ b/rega.c @@ -605,6 +605,7 @@ rega(Fn *fn) if (x > 0 && !bshas(m->b, x)) { pmadd(TMP(x), TMP(r), tmp[t].cls); m->r[j] = x; + bsset(m->b, x); } } curi = &insb[NIns]; From f059f8b1cf415a7fba36f6b96206bb3d6776e41d Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 19 Apr 2020 16:31:57 -0700 Subject: [PATCH 182/286] amd64: Use member class for aggregate parameter temporary Otherwise, we may end up using an integer and floating class for the same register, triggering an assertion failure: qbe: rega.c:215: pmrec: Assertion `KBASE(pm[i].cls) == KBASE(*k)' failed. Test case: type :T = { s } export function $d(:T %.1, s %.2) { @start call $c(s %.2) ret } --- amd64/sysv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amd64/sysv.c b/amd64/sysv.c index 286300a..3125069 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -467,10 +467,10 @@ selpar(Fn *fn, Ins *i0, Ins *i1) } r = rarg(a->cls[0], &ni, &ns); if (i->op == Oparc) { - emit(Ocopy, Kl, a->ref[0], r, R); + emit(Ocopy, a->cls[0], a->ref[0], r, R); if (a->size > 8) { r = rarg(a->cls[1], &ni, &ns); - emit(Ocopy, Kl, a->ref[1], r, R); + emit(Ocopy, a->cls[1], a->ref[1], r, R); } } else emit(Ocopy, i->cls, i->to, r, R); From 5e5e301e866e1eeb4523b9ecae6a2a327c019a08 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 6 Aug 2020 10:34:42 +0200 Subject: [PATCH 183/286] fix a typo in call's BNF Thanks to Jakob for pointing this out. --- doc/il.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index a496759..d1ed755 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -749,9 +749,9 @@ single-precision floating point number `%f` into `%rs`. CALL := [%IDENT '=' ABITY] 'call' VAL '(' (ARG), ')' ARG := - ABITY %IDENT # Regular argument - | 'env' VAL # Environment argument (first) - | '...' # Variadic marker (last) + ABITY VAL # Regular argument + | 'env' VAL # Environment argument (first) + | '...' # Variadic marker (last) ABITY := BASETY | :IDENT From 496c069405cd79aed968f59dd5a5f92d1f96809f Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 19 Sep 2020 16:33:43 -0700 Subject: [PATCH 184/286] fold: zero-initialize padding bits of constants Otherwise, if a constant is stored as a float and retrieved as an int, the padding bits are uninitialized. This can result in the generation of invalid assembly: Error: suffix or operands invalid for `cvtsi2ss' Reported by Hiltjo Posthuma. --- fold.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fold.c b/fold.c index 0a3945f..5344cf4 100644 --- a/fold.c +++ b/fold.c @@ -459,6 +459,8 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) if (cl->type != CBits || cr->type != CBits) err("invalid address operand for '%s'", optab[op].name); + *res = (Con){CBits}; + memset(&res->bits, 0, sizeof(res->bits)); if (w) { ld = cl->bits.d; rd = cr->bits.d; @@ -473,7 +475,8 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) case Ocast: xd = ld; break; default: die("unreachable"); } - *res = (Con){CBits, .bits={.d=xd}, .flt=2}; + res->bits.d = xd; + res->flt = 2; } else { ls = cl->bits.s; rs = cr->bits.s; @@ -488,7 +491,8 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) case Ocast: xs = ls; break; default: die("unreachable"); } - *res = (Con){CBits, .bits={.s=xs}, .flt=1}; + res->bits.s = xs; + res->flt = 1; } } From 4756643e58965eb21e0bf2ddb45ddb24b9f8bf03 Mon Sep 17 00:00:00 2001 From: Thomas Bracht Laumann Jespersen Date: Mon, 15 Feb 2021 09:25:56 +0100 Subject: [PATCH 185/286] docs/llvm: Fix typo jeoparadized -> jeopardized --- doc/llvm.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/llvm.txt b/doc/llvm.txt index cb18b58..a21fc1f 100644 --- a/doc/llvm.txt +++ b/doc/llvm.txt @@ -92,7 +92,7 @@ are a few things provided in QBE to consider. Because QBE makes a much lighter use of types, the IL is more readable and shorter. It can of course be - argued back that the correctness of QBE is jeoparadized, + argued back that the correctness of QBE is jeopardized, but remember that, in practice, the large amount of casts necessary in LLVM IL is undermining the overall effectiveness of the type system. From 2feb742b6911b385fc80177f8df77315fef9cd37 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 1 Mar 2021 17:41:35 -0800 Subject: [PATCH 186/286] arm64: handle stack offsets >=4096 in Oaddr The immediate in the add instruction is only 12 bits. If the offset does not fit, we must move it into a register first. --- arm64/emit.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index 892d027..cd0a2b1 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -271,6 +271,8 @@ static void emitins(Ins *i, E *e) { int o; + char *rn; + uint64_t s; switch (i->op) { default: @@ -302,9 +304,17 @@ emitins(Ins *i, E *e) break; case Oaddr: assert(rtype(i->arg[0]) == RSlot); - fprintf(e->f, "\tadd\t%s, x29, #%"PRIu64"\n", - rname(i->to.val, Kl), slot(i->arg[0].val, e) - ); + rn = rname(i->to.val, Kl); + s = slot(i->arg[0].val, e); + if (s <= 4095) { + fprintf(e->f, "\tadd\t%s, x29, #%"PRIu64"\n", rn, s); + } else { + fprintf(e->f, + "\tmov\t%s, #%"PRIu64"\n" + "\tadd\t%s, x29, %s\n", + rn, s, rn, rn + ); + } break; } } From 201881d6ca47150fb4037c9babbcf6717471da60 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 21 Oct 2020 15:32:14 -0700 Subject: [PATCH 187/286] gas: emit GNU-stack note so that stack is not executable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GNU ld uses the presence of these notes to determine the flags of the final GNU_STACK program header. If they are present in every object, then the resulting executable's GNU_STACK uses flags RW instead of RWE. Reported by Érico Nogueira Rolim. --- gas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gas.c b/gas.c index 227c297..339154e 100644 --- a/gas.c +++ b/gas.c @@ -122,4 +122,5 @@ gasemitfin(FILE *f) stash = b->link; free(b); } + fprintf(f, ".section .note.GNU-stack,\"\",@progbits\n"); } From cdee1d81c4c73113eb293bf2ac816bee53047f36 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 2 Mar 2021 08:40:47 +0100 Subject: [PATCH 188/286] silence a gcc10 warning --- fold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fold.c b/fold.c index 5344cf4..2081a72 100644 --- a/fold.c +++ b/fold.c @@ -459,7 +459,7 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) if (cl->type != CBits || cr->type != CBits) err("invalid address operand for '%s'", optab[op].name); - *res = (Con){CBits}; + *res = (Con){.type = CBits}; memset(&res->bits, 0, sizeof(res->bits)); if (w) { ld = cl->bits.d; From 83c210834197b7ad3208214a4f9d8669134c4a3c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 10 Aug 2020 12:28:48 -0400 Subject: [PATCH 189/286] add data $name = section "section" ... This allows you to explicitly specify the section to emit the data directive for, allowing for sections other than .data: for example, .bss or .init_array. --- gas.c | 6 +++++- parse.c | 27 ++++++++++++++++++--------- tools/lexh.c | 6 +++--- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/gas.c b/gas.c index 339154e..f8f4051 100644 --- a/gas.c +++ b/gas.c @@ -19,7 +19,11 @@ gasemitdat(Dat *d, FILE *f) switch (d->type) { case DStart: align = 0; - fprintf(f, ".data\n"); + if (d->u.str) { + fprintf(f, ".section %s\n", d->u.str); + } else { + fprintf(f, ".data\n"); + } break; case DEnd: break; diff --git a/parse.c b/parse.c index b279ff4..48f2f6e 100644 --- a/parse.c +++ b/parse.c @@ -41,6 +41,7 @@ enum { Tfunc, Ttype, Tdata, + Tsection, Talign, Tl, Tw, @@ -90,6 +91,7 @@ static char *kwmap[Ntok] = { [Tfunc] = "function", [Ttype] = "type", [Tdata] = "data", + [Tsection] = "section", [Talign] = "align", [Tl] = "l", [Tw] = "w", @@ -984,29 +986,36 @@ parsedatstr(Dat *d) static void parsedat(void cb(Dat *), int export) { - char s[NString]; + char name[NString] = {0}; int t; Dat d; - d.type = DStart; - d.isstr = 0; - d.isref = 0; - d.export = export; - cb(&d); if (nextnl() != Tglo || nextnl() != Teq) err("data name, then = expected"); - strcpy(s, tokval.str); + strncpy(name, tokval.str, NString-1); t = nextnl(); + d.u.str = 0; + if (t == Tsection) { + if (nextnl() != Tstr) + err("section \"name\" expected"); + d.u.str = tokval.str; + t = nextnl(); + } + d.type = DStart; + cb(&d); if (t == Talign) { if (nextnl() != Tint) err("alignment expected"); d.type = DAlign; d.u.num = tokval.num; + d.isstr = 0; + d.isref = 0; cb(&d); t = nextnl(); } d.type = DName; - d.u.str = s; + d.u.str = name; + d.export = export; cb(&d); if (t != Tlbrace) @@ -1025,8 +1034,8 @@ parsedat(void cb(Dat *), int export) } t = nextnl(); do { - d.isref = 0; d.isstr = 0; + d.isref = 0; memset(&d.u, 0, sizeof d.u); if (t == Tflts) d.u.flts = tokval.flts; diff --git a/tools/lexh.c b/tools/lexh.c index 9e8016a..2ebb022 100644 --- a/tools/lexh.c +++ b/tools/lexh.c @@ -25,9 +25,9 @@ char *tok[] = { "vaarg", "vastart", "...", "env", "call", "phi", "jmp", "jnz", "ret", "export", - "function", "type", "data", "align", "l", "w", - "h", "b", "d", "s", "z", "loadw", "loadl", "loads", - "loadd", "alloc1", "alloc2", + "function", "type", "data", "section", "align", + "l", "w", "h", "b", "d", "s", "z", "loadw", "loadl", + "loads", "loadd", "alloc1", "alloc2", }; enum { From 4e81cc2f8a28ba168b446dbbd24a3877e6837da9 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 2 Mar 2021 10:00:56 +0100 Subject: [PATCH 190/286] renaming in gas.c --- gas.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gas.c b/gas.c index f8f4051..d339f3e 100644 --- a/gas.c +++ b/gas.c @@ -6,7 +6,7 @@ char *gasloc, *gassym; void gasemitdat(Dat *d, FILE *f) { - static int align; + static int aligned; static char *dtoa[] = { [DAlign] = ".balign", [DB] = "\t.byte", @@ -18,7 +18,7 @@ gasemitdat(Dat *d, FILE *f) switch (d->type) { case DStart: - align = 0; + aligned = 0; if (d->u.str) { fprintf(f, ".section %s\n", d->u.str); } else { @@ -28,7 +28,7 @@ gasemitdat(Dat *d, FILE *f) case DEnd: break; case DName: - if (!align) + if (!aligned) fprintf(f, ".balign 8\n"); p = d->u.str[0] == '"' ? "" : gassym; if (d->export) @@ -40,7 +40,7 @@ gasemitdat(Dat *d, FILE *f) break; default: if (d->type == DAlign) - align = 1; + aligned = 1; if (d->isstr) { if (d->type != DB) From 99c8f84efc280265d026737b2bdfd4741c8a74e8 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 2 Mar 2021 10:01:26 +0100 Subject: [PATCH 191/286] fix a couple asan complaints --- spill.c | 12 +++++++----- util.c | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/spill.c b/spill.c index c1599c0..1aab8e5 100644 --- a/spill.c +++ b/spill.c @@ -173,11 +173,13 @@ limit(BSet *b, int k, BSet *f) bsclr(b, t); tarr[i++] = t; } - if (!f) - qsort(tarr, nt, sizeof tarr[0], tcmp0); - else { - fst = f; - qsort(tarr, nt, sizeof tarr[0], tcmp1); + if (nt > 1) { + if (!f) + qsort(tarr, nt, sizeof tarr[0], tcmp0); + else { + fst = f; + qsort(tarr, nt, sizeof tarr[0], tcmp1); + } } for (i=0; i Date: Wed, 2 Dec 2020 12:17:42 +0100 Subject: [PATCH 192/286] arm64: try qemu-system-aarch64 --- tools/test.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/test.sh b/tools/test.sh index c2c25c5..4e7076f 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -20,10 +20,15 @@ testcc() { init() { case "$TARGET" in arm64) + qemucmd=qemu-system-aarch64 + if ! $qemucmd -version >/dev/null 2>&1 + then + qemucmd=qemu-aarch64 + fi for p in aarch64-linux-musl aarch64-linux-gnu do cc=$p-gcc - qemu="qemu-aarch64 -L /usr/$p" + qemu="$qemucmd -L /usr/$p" if $cc -v >/dev/null 2>&1 && $qemu -version >/dev/null 2>&1 && From d3313ade5f58dcf02b90e69b9b7ef4376d15620d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 2 Mar 2021 10:19:53 +0100 Subject: [PATCH 193/286] disable pie for arm64 tests --- tools/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.sh b/tools/test.sh index 4e7076f..3bf7e95 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -27,7 +27,7 @@ init() { fi for p in aarch64-linux-musl aarch64-linux-gnu do - cc=$p-gcc + cc="$p-gcc -no-pie" qemu="$qemucmd -L /usr/$p" if $cc -v >/dev/null 2>&1 && From 9c4e4bc68afa23e1e22dcf939cd7647a0a615c2b Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 11 Mar 2021 18:54:28 -0800 Subject: [PATCH 194/286] Arrange debug flag table to match pass order This makes it easier to determine which flag to pass to show the desired debug info. --- main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 56529c9..d265475 100644 --- a/main.c +++ b/main.c @@ -24,13 +24,13 @@ enum Asm { char debug['Z'+1] = { ['P'] = 0, /* parsing */ - ['A'] = 0, /* abi lowering */ - ['I'] = 0, /* instruction selection */ - ['L'] = 0, /* liveness */ ['M'] = 0, /* memory optimization */ ['N'] = 0, /* ssa construction */ ['C'] = 0, /* copy elimination */ ['F'] = 0, /* constant folding */ + ['A'] = 0, /* abi lowering */ + ['I'] = 0, /* instruction selection */ + ['L'] = 0, /* liveness */ ['S'] = 0, /* spilling */ ['R'] = 0, /* reg. allocation */ }; From a2962bb1ec4f14197d8c6901fb27ee44a439cd15 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 11 Mar 2021 18:57:33 -0800 Subject: [PATCH 195/286] arm64: fix selcall call data for return of aggregate in memory The no-op `copy R0` is necessary in order to trigger dopm in spill.c and rega.c, which assume that a call is always followed by one or more copies from registers. However, the arm64 ABI does not actually return the caller-passed pointer as in x86_64. This causes an assertion failure qbe: aarch64: Assertion failed: r == T.rglob || b == fn->start (spill.c: spill: 470) for the following test program type :t = { l 3 } function $f() { @start.1 @start.2 %ret =:t call $g() ret } The assertion failure only triggers when the block containing the call is not the first block, because the check is skipped for the first block (since some registers may have been used for arguments). To fix this, set R0 in the call data so that spill/rega can see that this dummy "return" register was generated by the call. This matches qbe's existing behavior when the function returns void, another case where no register is used for the function result. --- arm64/abi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arm64/abi.c b/arm64/abi.c index f5b605a..eef47bc 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -352,7 +352,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) stkblob(i1->to, &cr, fn, ilp); cty |= (cr.nfp << 2) | cr.ngp; if (cr.class & Cptr) { - cty |= 1 << 13; + cty |= 1 << 13 | 1; emit(Ocopy, Kw, R, TMP(R0), R); } else { sttmps(tmp, cr.cls, cr.nreg, i1->to, fn); From 0678bee5788acd08d62219f4fc857589e2703197 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 16 Mar 2021 18:21:07 -0700 Subject: [PATCH 196/286] Revert "arm64: try qemu-system-aarch64" This reverts commit be3a67a7f5079f30b0ccc696d549fd03a2dbbad1. qemu-system-aarch64 is a full system emulator and is not suitable for running the qbe test suite (at least without a kernel and root filesystem). --- tools/test.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/test.sh b/tools/test.sh index 3bf7e95..937974b 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -20,15 +20,10 @@ testcc() { init() { case "$TARGET" in arm64) - qemucmd=qemu-system-aarch64 - if ! $qemucmd -version >/dev/null 2>&1 - then - qemucmd=qemu-aarch64 - fi for p in aarch64-linux-musl aarch64-linux-gnu do cc="$p-gcc -no-pie" - qemu="$qemucmd -L /usr/$p" + qemu="qemu-aarch64 -L /usr/$p" if $cc -v >/dev/null 2>&1 && $qemu -version >/dev/null 2>&1 && From 097dc86c45cc2f20cf98ec0385dbb57aaba419ec Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 16 Mar 2021 18:21:08 -0700 Subject: [PATCH 197/286] use toolchain to determine aarch64 sysroot path --- tools/test.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/test.sh b/tools/test.sh index 937974b..b4e7470 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -23,12 +23,15 @@ init() { for p in aarch64-linux-musl aarch64-linux-gnu do cc="$p-gcc -no-pie" - qemu="qemu-aarch64 -L /usr/$p" + qemu="qemu-aarch64" if $cc -v >/dev/null 2>&1 && - $qemu -version >/dev/null 2>&1 && - test -d /usr/$p + $qemu -version >/dev/null 2>&1 then + if sysroot=$($cc -print-sysroot) && test -n "$sysroot" + then + qemu="$qemu -L $sysroot" + fi break fi cc= From e0b94a3d6ade2f99ded481318e9e6d9f16953662 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 11 Mar 2021 19:24:28 -0800 Subject: [PATCH 198/286] spill: use stronger assertion for registers in use at start of function --- amd64/sysv.c | 1 + arm64/abi.c | 1 + spill.c | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/amd64/sysv.c b/amd64/sysv.c index 3125069..045ec85 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -427,6 +427,7 @@ selpar(Fn *fn, Ins *i0, Ins *i1) fa = argsclass(i0, i1, ac, Opar, &aret, &env); } else fa = argsclass(i0, i1, ac, Opar, 0, &env); + fn->reg = amd64_sysv_argregs(CALL(fa), 0); for (i=i0, a=ac; iop != Oparc || a->inmem) diff --git a/arm64/abi.c b/arm64/abi.c index eef47bc..5fe9553 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -423,6 +423,7 @@ selpar(Fn *fn, Ins *i0, Ins *i1) curi = &insb[NIns]; cty = argsclass(i0, i1, ca, &env); + fn->reg = arm64_argregs(CALL(cty), 0); il = 0; t = tmp; diff --git a/spill.c b/spill.c index 1aab8e5..132e0e9 100644 --- a/spill.c +++ b/spill.c @@ -397,7 +397,6 @@ spill(Fn *fn) bscopy(b->out, v); /* 2. process the block instructions */ - r = v->t[0]; curi = &insb[NIns]; for (i=&b->ins[b->nins]; i!=b->ins;) { i--; @@ -469,7 +468,10 @@ spill(Fn *fn) if (r) sethint(v, r); } - assert(r == T.rglob || b == fn->start); + if (b == fn->start) + assert(v->t[0] == (T.rglob | fn->reg)); + else + assert(v->t[0] == T.rglob); for (p=b->phi; p; p=p->link) { assert(rtype(p->to) == RTmp); From 6d9ee1389572ae985f6a39bb99dbd10cdf42c123 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 16 Jun 2021 20:27:49 -0700 Subject: [PATCH 199/286] amd64: fix conditional jump when compare is swapped and used elsewhere selcmp may potentially swap the arguments and return 1 indicating that the opposite operation should be used. However, if the compare result is used for a conditional jump as well as elsewhere, the original compare op is used instead of the opposite. To fix this, add a check to see whether the opposite compare should be used, regardless of whether selcmp() is done now, or later on during sel(). Bug report and test case from Charlie Stanton. --- amd64/isel.c | 5 +++-- test/cmp1.ssa | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 test/cmp1.ssa diff --git a/amd64/isel.c b/amd64/isel.c index 56e4cf3..5f84561 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -383,9 +383,10 @@ seljmp(Blk *b, Fn *fn) b->jmp.type = Jjf + Cine; } else if (iscmp(fi->op, &k, &c)) { + if (rtype(fi->arg[0]) == RCon) + c = cmpop(c); if (t->nuse == 1) { - if (selcmp(fi->arg, k, fn)) - c = cmpop(c); + selcmp(fi->arg, k, fn); *fi = (Ins){.op = Onop}; } b->jmp.type = Jjf + c; diff --git a/test/cmp1.ssa b/test/cmp1.ssa new file mode 100644 index 0000000..dd5bfa1 --- /dev/null +++ b/test/cmp1.ssa @@ -0,0 +1,17 @@ +# test cmp used in jnz as well as its result value + +export +function w $test(w %c) { +@start + %cmp =w cultw 1, %c + jnz %cmp, @yes, @no +@yes + %cmp =w copy 1 +@no + ret %cmp +} + +# >>> driver +# int test(int); +# int main(void) { return test(0); } +# <<< From 7f4ab8d801edd1db8518ecd110c53483f847a8e9 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 28 Jul 2021 00:29:50 +0200 Subject: [PATCH 200/286] fix amd64 addressing selection bug (afl) Reported by Alessandro Mantovani. Unlikely to be hit in practice because we don't add addresses to addresses. type :biggie = { l, l, l } function $repro(:biggie %p) { @start %x =l add %p, $a storew 42, %x ret } --- amd64/emit.c | 1 + amd64/isel.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/amd64/emit.c b/amd64/emit.c index d8b29bd..29b6bbb 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -184,6 +184,7 @@ regtoa(int reg, int sz) { static char buf[6]; + assert(reg <= XMM15); if (reg >= XMM0) { sprintf(buf, "xmm%d", reg-XMM0); return buf; diff --git a/amd64/isel.c b/amd64/isel.c index 5f84561..31199da 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -147,7 +147,7 @@ seladdr(Ref *r, ANum *an, Fn *fn) * rewrite it or bail out if * impossible */ - if (!req(a.index, R)) + if (!req(a.index, R) || rtype(a.base) != RTmp) return; else { a.index = a.base; From 5a4369dd279b1ee50779ae4ab16daaa035eeeb69 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 28 Jul 2021 00:53:09 +0200 Subject: [PATCH 201/286] fix buffer overflow in parser (afl) Reported by Alessandro Mantovani. Overly long function names would trigger out-of-bounds accesses. --- parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.c b/parse.c index 48f2f6e..a7e4452 100644 --- a/parse.c +++ b/parse.c @@ -813,7 +813,7 @@ parsefn(int export) rcls = 5; if (next() != Tglo) err("function name expected"); - strcpy(curf->name, tokval.str); + strncpy(curf->name, tokval.str, NString-1); curf->vararg = parserefl(0); if (nextnl() != Tlbrace) err("function body must start with {"); From b543ffed71497fb079bfdca53934870a1189c325 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 28 Jul 2021 01:15:51 +0200 Subject: [PATCH 202/286] handle fast locals in amd64 shifts (afl) Reported by Alessandro Mantovani. Although unlikely in real programs it was found that using the address of a fast local in amd64 shifts triggers assertion failures. We now err when the shift count is given by an address; but we allow shifting an address. --- amd64/isel.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index 31199da..e8a78f3 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -244,13 +244,18 @@ sel(Ins i, ANum *an, Fn *fn) case Osar: case Oshr: case Oshl: - if (rtype(i.arg[1]) == RCon) - goto Emit; r0 = i.arg[1]; + if (rtype(r0) == RCon) + goto Emit; + if (fn->tmp[r0.val].slot != -1) + err("unlikely argument %%%s in %s", + fn->tmp[r0.val].name, optab[i.op].name); i.arg[1] = TMP(RCX); emit(Ocopy, Kw, R, TMP(RCX), R); emiti(i); + i1 = curi; emit(Ocopy, Kw, TMP(RCX), r0, R); + fixarg(&i1->arg[0], argcls(&i, 0), i1, fn); break; case Onop: break; @@ -336,7 +341,7 @@ sel(Ins i, ANum *an, Fn *fn) die("unknown instruction %s", optab[i.op].name); } - while (i0 > curi && --i0) { + while (i0>curi && --i0) { assert(rslot(i0->arg[0], fn) == -1); assert(rslot(i0->arg[1], fn) == -1); } From 98cd2e817616fff14622b8e514fc88b378a100ef Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 11 Apr 2021 01:49:15 -0700 Subject: [PATCH 203/286] load: handle all cases in cast() Previously, all casts but d->w, d->s, l->s, s->d, w->d were supported. At least the first three can occur by storing to then loading from a slot, currently triggering an assertion failure. Though the other two might not be possible, they are easy enough to support as well. Fixes hare#360. --- load.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/load.c b/load.c index ae9cfcf..f3a695b 100644 --- a/load.c +++ b/load.c @@ -92,14 +92,17 @@ cast(Ref *r, int cls, Loc *l) cls0 = curf->tmp[r->val].cls; if (cls0 == cls || (cls == Kw && cls0 == Kl)) return; - assert(!KWIDE(cls0) || KWIDE(cls)); - if (KWIDE(cls) == KWIDE(cls0)) - *r = iins(cls, Ocast, *r, R, l); - else { - assert(cls == Kl); + if (KWIDE(cls0) < KWIDE(cls)) { if (cls0 == Ks) *r = iins(Kw, Ocast, *r, R, l); *r = iins(Kl, Oextuw, *r, R, l); + if (cls == Kd) + *r = iins(Kd, Ocast, *r, R, l); + } else { + if (cls0 == Kd && cls != Kl) + *r = iins(Kl, Ocast, *r, R, l); + if (cls0 != Kd || cls != Kw) + *r = iins(cls, Ocast, *r, R, l); } } From 3da3815a674c922c520e013b30eb96c7491a5e85 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 30 Jul 2021 00:11:27 +0200 Subject: [PATCH 204/286] err when an address contains a sum $a+$b (afl) Reported by Alessandro Mantovani. These addresses are likely bogus, but they triggered an unwarranted assertion failure. We now raise a civilized error. --- all.h | 2 +- amd64/isel.c | 4 +++- util.c | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/all.h b/all.h index 7f843a9..4b9eb0e 100644 --- a/all.h +++ b/all.h @@ -433,7 +433,7 @@ int phicls(int, Tmp *); Ref newtmp(char *, int, Fn *); void chuse(Ref, int, Fn *); Ref getcon(int64_t, Fn *); -void addcon(Con *, Con *); +int addcon(Con *, Con *); void blit(Ref, uint, Ref, uint, Fn *); void dumpts(BSet *, Tmp *, FILE *); diff --git a/amd64/isel.c b/amd64/isel.c index e8a78f3..0b0a2df 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -512,7 +512,9 @@ amatch(Addr *a, Ref r, int n, ANum *ai, Fn *fn) Ref al, ar; if (rtype(r) == RCon) { - addcon(&a->offset, &fn->con[r.val]); + if (!addcon(&a->offset, &fn->con[r.val])) + err("unlikely sum of $%s and $%s", + str(a->offset.label), str(fn->con[r.val].label)); return 1; } assert(rtype(r) == RTmp); diff --git a/util.c b/util.c index 0123e27..a28176d 100644 --- a/util.c +++ b/util.c @@ -362,19 +362,21 @@ getcon(int64_t val, Fn *fn) return CON(c); } -void +int addcon(Con *c0, Con *c1) { if (c0->type == CUndef) *c0 = *c1; else { if (c1->type == CAddr) { - assert(c0->type != CAddr && "adding two addresses"); + if (c0->type == CAddr) + return 0; c0->type = CAddr; c0->label = c1->label; } c0->bits.i += c1->bits.i; } + return 1; } void From 0437e97a1bb126cfa1974dad7b5479fa4b407f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Sun, 11 Jul 2021 16:12:19 -0300 Subject: [PATCH 205/286] gas: always emit GNU-stack note In cases where stash was 0, gasemitfin exits immediately and the GNU-stack note isn't added to the asm output. This would result in an executable where GNU_STACK uses flags RWE instead of the desired RW. --- gas.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gas.c b/gas.c index d339f3e..6d89a89 100644 --- a/gas.c +++ b/gas.c @@ -98,6 +98,8 @@ gasemitfin(FILE *f) int sz, i; double d; + fprintf(f, ".section .note.GNU-stack,\"\",@progbits\n"); + if (!stash) return; fprintf(f, "/* floating point constants */\n.data\n"); @@ -126,5 +128,4 @@ gasemitfin(FILE *f) stash = b->link; free(b); } - fprintf(f, ".section .note.GNU-stack,\"\",@progbits\n"); } From 2bbfcf61b38edfe3c347cd270380e5117454c0cf Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 6 Jul 2021 21:31:34 -0700 Subject: [PATCH 206/286] copy: consider identity element for more instructions udiv %x, 1 == %x, and for each of sub, or, xor, sar, shr, and shl, %x, 0 == %x. --- copy.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/copy.c b/copy.c index 053f319..593ce24 100644 --- a/copy.c +++ b/copy.c @@ -27,10 +27,16 @@ iscopy(Ins *i, Ref r, Fn *fn) case Ocopy: return 1; case Omul: - return iscon(i->arg[1], 1, fn); case Odiv: + case Oudiv: return iscon(i->arg[1], 1, fn); case Oadd: + case Osub: + case Oor: + case Oxor: + case Osar: + case Oshl: + case Oshr: return iscon(i->arg[1], 0, fn); default: break; From f3414a492bf4623731f3850aaae5b4a7a2a83a4d Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 17 Aug 2021 15:18:00 +0200 Subject: [PATCH 207/286] parsefields: fix padding calculation This was causing issues with aggregate types. A simple reproduction is: type :type.1 = align 8 { 24 } type :type.2 = align 8 { w 1, :type.1 1 } The size of type.2 should be 32, adding only 4 bytes of padding between the first and second field. Prior to this patch, 20 bytes of padding was added instead, causing the type to have a size of 48. Signed-off-by: Drew DeVault --- parse.c | 4 ++-- test/abi7.ssa | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 test/abi7.ssa diff --git a/parse.c b/parse.c index a7e4452..43ae23b 100644 --- a/parse.c +++ b/parse.c @@ -867,9 +867,9 @@ parsefields(Field *fld, Typ *ty, int t) } if (a > al) al = a; - a = sz & (s-1); + a = (1 << a) - 1; + a = ((sz + a) & ~a) - sz; if (a) { - a = s - a; if (n < NField) { /* padding */ fld[n].type = FPad; diff --git a/test/abi7.ssa b/test/abi7.ssa new file mode 100644 index 0000000..bf8ca1f --- /dev/null +++ b/test/abi7.ssa @@ -0,0 +1,21 @@ +# test padding calculation with +# embedded struct + +type :s1 = align 4 { w 3 } +type :s2 = align 4 { b 1, :s1 1 } + +export function :s2 $test() { +@start + ret $s +} + +# >>> driver +# struct s2 { +# char x; +# struct { int a[3]; } s1; +# } s = { .x = 123 }; +# extern struct s2 test(void); +# int main(void) { +# return !(test().x == 123); +# } +# <<< From 2dd269f522298836796ff78390d0eb0e244e41f4 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 16 Aug 2021 19:09:42 -0700 Subject: [PATCH 208/286] test: include exit status in test failure reason This was intended, but was missing due to a typo in the test status variable. --- tools/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.sh b/tools/test.sh index b4e7470..5f3292c 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -143,7 +143,7 @@ once() { else $qemu $exe a b c ret=$? - reason="returned $RET" + reason="returned $ret" fi if test $ret -ne 0 From 3cbad4d9c465d3f298cbe19c46f7c16f6a9b9f0f Mon Sep 17 00:00:00 2001 From: Eyal Sawady Date: Fri, 13 Aug 2021 08:15:49 +0000 Subject: [PATCH 209/286] amd64/emit.c: fix %x =k sub %x, %x The negate trick is unnecessary and broken when the first arg is the result. --- amd64/emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amd64/emit.c b/amd64/emit.c index 29b6bbb..09b90d5 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -408,7 +408,7 @@ emitins(Ins i, Fn *fn, FILE *f) case Osub: /* we have to use the negation trick to handle * some 3-address subtractions */ - if (req(i.to, i.arg[1])) { + if (req(i.to, i.arg[1]) && !req(i.arg[0], i.to)) { if (KBASE(i.cls) == 0) emitf("neg%k %=", &i, fn, f); else From 804921a3ab463848aa0ffbe495ca542b3789c841 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 17 Aug 2021 13:14:54 -0700 Subject: [PATCH 210/286] amd64/isel: fix floating < and <= result with NaN When the two operands are Unordered (for instance if one of them is NaN), ucomisd sets ZF=1, PF=1, and CF=1. When the result is LessThan, it sets ZF=0, PF=0, and CF=1. However, jb[e]/setb[e] only checks that CF=1 [or ZF=1] which causes the result to be true for unordered operands. To fix this, change the operand swap condition for these two floating point comparison types: always rewrite x < y as y > x, and never rewrite x > y as y < x. Add a test to check the result of cltd, cled, cgtd, cged, ceqd, and cned with arguments that are LessThan, Equal, GreaterThan, and Unordered. Additionally, check three different implementations for equality testing: one that uses the result of ceqd directly, one that uses the result to control a conditional jump, and one that uses the result both as a value and for a conditional jump. For now, unordered equality tests are still broken so they are disabled. --- amd64/isel.c | 40 ++++++++++++------ test/isel2.ssa | 108 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 13 deletions(-) create mode 100644 test/isel2.ssa diff --git a/amd64/isel.c b/amd64/isel.c index 0b0a2df..07e6142 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -165,13 +165,25 @@ seladdr(Ref *r, ANum *an, Fn *fn) } static int -selcmp(Ref arg[2], int k, Fn *fn) +cmpswap(Ref arg[2], int op) +{ + switch (op) { + case NCmpI+Cflt: + case NCmpI+Cfle: + return 1; + case NCmpI+Cfgt: + case NCmpI+Cfge: + return 0; + } + return rtype(arg[0]) == RCon; +} + +static void +selcmp(Ref arg[2], int k, int swap, Fn *fn) { - int swap; Ref r; Ins *icmp; - swap = rtype(arg[0]) == RCon; if (swap) { r = arg[1]; arg[1] = arg[0]; @@ -180,20 +192,20 @@ selcmp(Ref arg[2], int k, Fn *fn) emit(Oxcmp, k, R, arg[1], arg[0]); icmp = curi; if (rtype(arg[0]) == RCon) { - assert(k == Kl); + assert(k != Kw); icmp->arg[1] = newtmp("isel", k, fn); emit(Ocopy, k, icmp->arg[1], arg[0], R); + fixarg(&curi->arg[0], k, curi, fn); } fixarg(&icmp->arg[0], k, icmp, fn); fixarg(&icmp->arg[1], k, icmp, fn); - return swap; } static void sel(Ins i, ANum *an, Fn *fn) { Ref r0, r1; - int x, k, kc; + int x, k, kc, swap; int64_t sz; Ins *i0, *i1; @@ -332,10 +344,11 @@ sel(Ins i, ANum *an, Fn *fn) if (isload(i.op)) goto case_Oload; if (iscmp(i.op, &kc, &x)) { + swap = cmpswap(i.arg, x); + if (swap) + x = cmpop(x); emit(Oflag+x, k, i.to, R, R); - i1 = curi; - if (selcmp(i.arg, kc, fn)) - i1->op = Oflag + cmpop(x); + selcmp(i.arg, kc, swap, fn); break; } die("unknown instruction %s", optab[i.op].name); @@ -365,7 +378,7 @@ static void seljmp(Blk *b, Fn *fn) { Ref r; - int c, k; + int c, k, swap; Ins *fi; Tmp *t; @@ -384,14 +397,15 @@ seljmp(Blk *b, Fn *fn) } fi = flagi(b->ins, &b->ins[b->nins]); if (!fi || !req(fi->to, r)) { - selcmp((Ref[2]){r, CON_Z}, Kw, fn); /* todo, long jnz */ + selcmp((Ref[2]){r, CON_Z}, Kw, 0, fn); /* todo, long jnz */ b->jmp.type = Jjf + Cine; } else if (iscmp(fi->op, &k, &c)) { - if (rtype(fi->arg[0]) == RCon) + swap = cmpswap(fi->arg, c); + if (swap) c = cmpop(c); if (t->nuse == 1) { - selcmp(fi->arg, k, fn); + selcmp(fi->arg, k, swap, fn); *fi = (Ins){.op = Onop}; } b->jmp.type = Jjf + c; diff --git a/test/isel2.ssa b/test/isel2.ssa new file mode 100644 index 0000000..280ceb2 --- /dev/null +++ b/test/isel2.ssa @@ -0,0 +1,108 @@ +# tests that NaN is handled properly by +# floating point comparisons +# +# TODO: fix eq[123](NAN, NAN) on amd64 + +export function w $lt(d %x, d %y) { +@start + %r =w cltd %x, %y + ret %r +} + +export function w $le(d %x, d %y) { +@start + %r =w cled %x, %y + ret %r +} + +export function w $gt(d %x, d %y) { +@start + %r =w cgtd %x, %y + ret %r +} + +export function w $ge(d %x, d %y) { +@start + %r =w cged %x, %y + ret %r +} + +export function w $eq1(d %x, d %y) { +@start + %r =w ceqd %x, %y + ret %r +} + +export function w $eq2(d %x, d %y) { +@start + %r =w ceqd %x, %y + jnz %r, @true, @false +@true + ret 1 +@false + ret 0 +} + +export function w $eq3(d %x, d %y) { +@start + %r =w ceqd %x, %y + jnz %r, @true, @false +@true + ret %r +@false + ret 0 +} + +export function w $ne1(d %x, d %y) { +@start + %r =w cned %x, %y + ret %r +} + +export function w $ne2(d %x, d %y) { +@start + %r =w cned %x, %y + jnz %r, @true, @false +@true + ret 1 +@false + ret 0 +} + +export function w $ne3(d %x, d %y) { +@start + %r =w cned %x, %y + jnz %r, @true, @false +@true + ret %r +@false + ret 0 +} + +# >>> driver +# #include +# extern int lt(double, double); +# extern int le(double, double); +# extern int gt(double, double); +# extern int ge(double, double); +# extern int eq1(double, double); +# extern int eq2(double, double); +# extern int eq3(double, double); +# extern int ne1(double, double); +# extern int ne2(double, double); +# extern int ne3(double, double); +# int main(void) { +# /* LessThan Equal GreaterThan Unordered */ +# return !lt(0, 1) + lt(0, 0) + lt(1, 0) + lt(NAN, NAN) +# + !le(0, 1) + !le(0, 0) + le(1, 0) + le(NAN, NAN) +# + gt(0, 1) + gt(0, 0) + !gt(1, 0) + gt(NAN, NAN) +# + ge(0, 1) + !ge(0, 0) + !ge(1, 0) + ge(NAN, NAN) +# + eq1(0, 1) + !eq1(0, 0) + eq1(1, 0) /*+ eq1(NAN, NAN)*/ +# + eq2(0, 1) + !eq2(0, 0) + eq2(1, 0) /*+ eq2(NAN, NAN)*/ +# + eq3(0, 1) + !eq3(0, 0) + eq3(1, 0) /*+ eq3(NAN, NAN)*/ +# + !ne1(0, 1) + ne1(0, 0) + !ne1(1, 0) /*+ !ne1(NAN, NAN)*/ +# + !ne2(0, 1) + ne2(0, 0) + !ne2(1, 0) /*+ !ne2(NAN, NAN)*/ +# + !ne3(0, 1) + ne3(0, 0) + !ne3(1, 0) /*+ !ne3(NAN, NAN)*/ +# ; +# } +# <<< From 7ac88f5d4874f03d62f48055eded26e9a08e54ac Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 22 Aug 2021 12:55:02 -0700 Subject: [PATCH 211/286] amd64/isel: fix floating point == and != result with NaN On x86_64, ucomis[sd] sets ZF=1, PF=0, CF=0 for equal arguments. However, if the arguments are unordered it sets ZF=1, PF=1, CF=1, and there is no jump/flag instruction for ZF=1 & PF=0 or ZF=1 & CF=0. So, in order to correctly implement ceq[sd] on x86_64, we need to be a bit more creative. There are several options available, depending on whether the result of ceq[sd] is used with jnz, or with other instructions, or both. If the result is used for a conditional jump, both gcc and clang use a combination of jp and jnz: ucomisd %xmm1, %xmm0 jp .Lfalse jnz .Lfalse ... .Lfalse: If the result is used in other instructions or return, gcc does the following for x == y: ucomisd %xmm1, %xmm0 setnp %al movzbl %al, %eax movl $0, %edx cmovne %edx, %eax This sets EAX to PF=0, then uses cmovne to clear it if ZF=0. It also takes care to avoid clobbering the flags register in case the result is also used for a conditional jump. Implementing this approach in QBE would require adding an architecture-specific instruction for cmovne. In contrast, clang does an additional compare, this time using cmpeqsd instead of ucomisd: cmpeqsd %xmm1, %xmm0 movq %xmm0, %rax andl $1, %rax The cmpeqsd instruction doas a floating point equality test, setting XMM0 to all 1s if they are equal and all 0s if they are not. However, we need the result in a non-XMM register, so it moves the result back then masks off all but the first bit. Both of these approaches are a bit awkward to implement in QBE, so instead, this commit does the following: ucomisd %xmm1, %xmm0 setz %al movzbl %al, %eax setnp %cl movzbl %cl, %ecx andl %ecx, %eax This sets the result by anding the two flags, but has a side effect of clobbering the flags register. This was a problem in one of my earlier patches to fix this issue[0], in addition to being more complex than I'd hoped. Instead, this commit always leaves the ceq[sd] instruction in the block, even if the result is only used to control a jump, so that the above instruction sequence is always used. Then, since we now have ZF=!(ZF=1 & PF=0) for x == y, or ZF=!(ZF=0 | PF=1) for x != y, we can use jnz for the jump instruction. [0] https://git.sr.ht/~sircmpwn/qbe/commit/64833841b18c074a23b4a1254625315e05b86658 --- amd64/isel.c | 26 ++++++++++++++++++++++++-- test/isel2.ssa | 14 ++++++-------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index 07e6142..607c176 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -344,6 +344,26 @@ sel(Ins i, ANum *an, Fn *fn) if (isload(i.op)) goto case_Oload; if (iscmp(i.op, &kc, &x)) { + switch (x) { + case NCmpI+Cfeq: + /* zf is set when operands are + * unordered, so we may have to + * check pf + */ + r0 = newtmp("isel", Kw, fn); + r1 = newtmp("isel", Kw, fn); + emit(Oand, Kw, i.to, r0, r1); + emit(Oflagfo, k, r1, R, R); + i.to = r0; + break; + case NCmpI+Cfne: + r0 = newtmp("isel", Kw, fn); + r1 = newtmp("isel", Kw, fn); + emit(Oor, Kw, i.to, r0, r1); + emit(Oflagfuo, k, r1, R, R); + i.to = r0; + break; + } swap = cmpswap(i.arg, x); if (swap) x = cmpop(x); @@ -388,7 +408,7 @@ seljmp(Blk *b, Fn *fn) r = b->jmp.arg; t = &fn->tmp[r.val]; b->jmp.arg = R; - assert(!req(r, R) && rtype(r) != RCon); + assert(rtype(r) == RTmp); if (b->s1 == b->s2) { chuse(r, -1, fn); b->jmp.type = Jjmp; @@ -400,7 +420,9 @@ seljmp(Blk *b, Fn *fn) selcmp((Ref[2]){r, CON_Z}, Kw, 0, fn); /* todo, long jnz */ b->jmp.type = Jjf + Cine; } - else if (iscmp(fi->op, &k, &c)) { + else if (iscmp(fi->op, &k, &c) + && c != NCmpI+Cfeq /* see sel() */ + && c != NCmpI+Cfne) { swap = cmpswap(fi->arg, c); if (swap) c = cmpop(c); diff --git a/test/isel2.ssa b/test/isel2.ssa index 280ceb2..8ca4a24 100644 --- a/test/isel2.ssa +++ b/test/isel2.ssa @@ -1,7 +1,5 @@ # tests that NaN is handled properly by # floating point comparisons -# -# TODO: fix eq[123](NAN, NAN) on amd64 export function w $lt(d %x, d %y) { @start @@ -97,12 +95,12 @@ export function w $ne3(d %x, d %y) { # + !le(0, 1) + !le(0, 0) + le(1, 0) + le(NAN, NAN) # + gt(0, 1) + gt(0, 0) + !gt(1, 0) + gt(NAN, NAN) # + ge(0, 1) + !ge(0, 0) + !ge(1, 0) + ge(NAN, NAN) -# + eq1(0, 1) + !eq1(0, 0) + eq1(1, 0) /*+ eq1(NAN, NAN)*/ -# + eq2(0, 1) + !eq2(0, 0) + eq2(1, 0) /*+ eq2(NAN, NAN)*/ -# + eq3(0, 1) + !eq3(0, 0) + eq3(1, 0) /*+ eq3(NAN, NAN)*/ -# + !ne1(0, 1) + ne1(0, 0) + !ne1(1, 0) /*+ !ne1(NAN, NAN)*/ -# + !ne2(0, 1) + ne2(0, 0) + !ne2(1, 0) /*+ !ne2(NAN, NAN)*/ -# + !ne3(0, 1) + ne3(0, 0) + !ne3(1, 0) /*+ !ne3(NAN, NAN)*/ +# + eq1(0, 1) + !eq1(0, 0) + eq1(1, 0) + eq1(NAN, NAN) +# + eq2(0, 1) + !eq2(0, 0) + eq2(1, 0) + eq2(NAN, NAN) +# + eq3(0, 1) + !eq3(0, 0) + eq3(1, 0) + eq3(NAN, NAN) +# + !ne1(0, 1) + ne1(0, 0) + !ne1(1, 0) + !ne1(NAN, NAN) +# + !ne2(0, 1) + ne2(0, 0) + !ne2(1, 0) + !ne2(NAN, NAN) +# + !ne3(0, 1) + ne3(0, 0) + !ne3(1, 0) + !ne3(NAN, NAN) # ; # } # <<< From 028534d9897079bf64559dca0402bc59a956ce46 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 30 Aug 2021 09:31:57 +0200 Subject: [PATCH 212/286] skip jump arguments in rega On both amd64 & arm64, the jumps making it to rega won't have any argument. --- rega.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rega.c b/rega.c index 7547293..bd26f1c 100644 --- a/rega.c +++ b/rega.c @@ -359,10 +359,9 @@ doblk(Blk *b, RMap *cur) Mem *m; Ref *ra[4]; + assert(rtype(b->jmp.arg) != RTmp); for (r=0; bsiter(b->out, &r) && rjmp.arg) == RTmp) - b->jmp.arg = ralloc(cur, b->jmp.arg.val); curi = &insb[NIns]; for (i1=&b->ins[b->nins]; i1!=b->ins;) { emiti(*--i1); From 649a546d702b41474fe76e9c779086cc8d35f3d2 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 4 Sep 2021 17:23:53 -0700 Subject: [PATCH 213/286] test: assign result of print functions to temporary Though I am not aware of any architecture where this matters, it is technically incorrect to call these stdio functions as if they had no result. The QBE documentation says > Unless the called function does not return a value, a return > temporary must be specified, even if it is never used afterwards. so we should follow it in the tests as well. --- test/vararg2.ssa | 56 ++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/test/vararg2.ssa b/test/vararg2.ssa index 5ad057a..52a6906 100644 --- a/test/vararg2.ssa +++ b/test/vararg2.ssa @@ -19,14 +19,14 @@ export function $qbeprint0(l %fmt, ...) { jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -34,7 +34,7 @@ export function $qbecall0(l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -59,14 +59,14 @@ export function $qbeprint1(w %argw0, l %fmt, ...) { jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -74,7 +74,7 @@ export function $qbecall1(w %argw0, l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -99,14 +99,14 @@ export function $qbeprint2(d %argd0, l %fmt, ...) { jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -114,7 +114,7 @@ export function $qbecall2(d %argd0, l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -139,14 +139,14 @@ export function $qbeprint3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -154,7 +154,7 @@ export function $qbecall3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -179,14 +179,14 @@ export function $qbeprint4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d % jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -194,7 +194,7 @@ export function $qbecall4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %a @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -219,14 +219,14 @@ export function $qbeprint5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d % jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -234,7 +234,7 @@ export function $qbecall5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d %a @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } @@ -259,14 +259,14 @@ export function $qbeprint6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w % jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, d %dbl, ...) jmp @loop @cased %int =w vaarg %vp - call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, w %int, ...) jmp @loop @end - call $puts(l %emptys) + %r =w call $puts(l %emptys) ret } @@ -274,7 +274,7 @@ export function $qbecall6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %a @start %vp =l alloc8 32 vastart %vp - call $vprintf(l %fmt, l %vp) + %r =w call $vprintf(l %fmt, l %vp) ret } From 6a69210b0faf33ad4feb6adc97d094022c520978 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 4 Sep 2021 17:23:54 -0700 Subject: [PATCH 214/286] test: use architecture-neutral wrapper for calling vprintf Different architectures use different types for va_list: x86_64 uses an 1-length array of struct type[0]: typedef struct { unsigned int gp_offset; unsigned int fp_offset; void *overflow_arg_area; void *reg_save_area; } va_list[1]; aarch64 uses a struct type[1] typedef struct { void *__stack; void *__gr_top; void *__vr_top; int __gr_offs; int __vr_offs; } va_list; Consequently, C functions which takes a va_list as an argument, such as vprintf, may pass va_list in different ways depending on the architecture. On x86_64, va_list is an array type, so parameter decays to a pointer and passing the address of the va_list is correct. On aarch64, the va_list struct is passed by value, but since it is larger than 16 bytes, the parameter is replaced with a pointer to caller-allocated memory. Thus, passing the address as an l argument happens to work. However, this pattern of passing the address of the va_list to vprintf doesn't extend to other architectures. On riscv64, va_list is defined as typedef void *va_list; which is *not* passed by reference. This means that tests that call vprintf using the address of a va_list (vararg1 and vararg2) will not work on riscv. To fix this while keeping the tests architecture-neutral, add a small wrapper function to the driver which takes a va_list *, and let the C compiler deal with the details of passing va_list by value. [0] https://c9x.me/compile/bib/abi-x64.pdf#figure.3.34 [1] https://c9x.me/compile/bib/abi-arm64.pdf#%5B%7B%22num%22%3A63%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C52%2C757%2C0%5D [2] https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#va_list-va_start-and-va_arg$ --- test/vararg1.ssa | 7 ++++++- test/vararg2.ssa | 18 +++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/test/vararg1.ssa b/test/vararg1.ssa index 393743c..3b33890 100644 --- a/test/vararg1.ssa +++ b/test/vararg1.ssa @@ -13,13 +13,18 @@ function w $g(l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - %r =w call $vprintf(l %fmt, l %vp) + %r =w call $print(l %fmt, l %vp) ret %r } # >>> driver +# #include +# #include # extern double f(int, ...); # extern int g(char *, ...); +# int print(const char *fmt, va_list *ap) { +# return vprintf(fmt, *ap); +# } # int main() { # g("Hell%c %s %g!\n", 'o', "world", f(42, "x", 42.0)); # } diff --git a/test/vararg2.ssa b/test/vararg2.ssa index 52a6906..7e85774 100644 --- a/test/vararg2.ssa +++ b/test/vararg2.ssa @@ -34,7 +34,7 @@ export function $qbecall0(l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - %r =w call $vprintf(l %fmt, l %vp) + %r =w call $print(l %fmt, l %vp) ret } @@ -74,7 +74,7 @@ export function $qbecall1(w %argw0, l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - %r =w call $vprintf(l %fmt, l %vp) + %r =w call $print(l %fmt, l %vp) ret } @@ -114,7 +114,7 @@ export function $qbecall2(d %argd0, l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - %r =w call $vprintf(l %fmt, l %vp) + %r =w call $print(l %fmt, l %vp) ret } @@ -154,7 +154,7 @@ export function $qbecall3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) { @start %vp =l alloc8 32 vastart %vp - %r =w call $vprintf(l %fmt, l %vp) + %r =w call $print(l %fmt, l %vp) ret } @@ -194,7 +194,7 @@ export function $qbecall4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %a @start %vp =l alloc8 32 vastart %vp - %r =w call $vprintf(l %fmt, l %vp) + %r =w call $print(l %fmt, l %vp) ret } @@ -234,7 +234,7 @@ export function $qbecall5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d %a @start %vp =l alloc8 32 vastart %vp - %r =w call $vprintf(l %fmt, l %vp) + %r =w call $print(l %fmt, l %vp) ret } @@ -274,11 +274,12 @@ export function $qbecall6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %a @start %vp =l alloc8 32 vastart %vp - %r =w call $vprintf(l %fmt, l %vp) + %r =w call $print(l %fmt, l %vp) ret } # >>> driver +# #include # #include # extern void qbeprint0(char *, ...); # extern void qbecall0(char *, ...); @@ -294,6 +295,9 @@ export function $qbecall6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %a # extern void qbecall5(int argw0, int argw1, int argw2, int argw3, int argw4, double argd0, double argd1, double argd2, double argd3, double argd4, double argd5, double argd6, char *, ...); # extern void qbeprint6(int argw0, int argw1, int argw2, int argw3, int argw4, int argw5, int argw6, int argw7, int argw8, int argw9, double argd0, double argd1, double argd2, double argd3, double argd4, double argd5, double argd6, double argd7, double argd8, double argd9, char *, ...); # extern void qbecall6(int argw0, int argw1, int argw2, int argw3, int argw4, int argw5, int argw6, int argw7, int argw8, int argw9, double argd0, double argd1, double argd2, double argd3, double argd4, double argd5, double argd6, double argd7, double argd8, double argd9, char *, ...); +# int print(const char *fmt, va_list *ap) { +# return vprintf(fmt, *ap); +# } # int main() { # puts("# (0 int, 0 double)"); # qbeprint0("%d \n", 3); From 52c8eb48ee86c8fd0e44570c31c7de28dea63cf3 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 9 Sep 2021 14:35:17 +0200 Subject: [PATCH 215/286] skip nx stack annotation on osx --- gas.c | 2 -- main.c | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gas.c b/gas.c index 6d89a89..8c31794 100644 --- a/gas.c +++ b/gas.c @@ -98,8 +98,6 @@ gasemitfin(FILE *f) int sz, i; double d; - fprintf(f, ".section .note.GNU-stack,\"\",@progbits\n"); - if (!stash) return; fprintf(f, "/* floating point constants */\n.data\n"); diff --git a/main.c b/main.c index d265475..abef591 100644 --- a/main.c +++ b/main.c @@ -193,8 +193,11 @@ main(int ac, char *av[]) parse(inf, f, data, func); } while (++optind < ac); - if (!dbg) + if (!dbg) { gasemitfin(outf); + if (asm == Gaself) + fprintf(outf, ".section .note.GNU-stack,\"\",@progbits\n"); + } exit(0); } From bb16529b34a844c6e15f8837950585761122106e Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 14 Sep 2021 13:49:26 -0700 Subject: [PATCH 216/286] parse: fix loadw when assigned to l temporary The documentation states that loadw is syntactic sugar for loadsw, but it actually got parsed as Oload. If the result is an l temporary, Oload behaves like Oloadl, not Oloadsw. To fix this, parse Tloadw as Oloadsw explicitly. --- parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parse.c b/parse.c index 43ae23b..da88f58 100644 --- a/parse.c +++ b/parse.c @@ -633,7 +633,9 @@ parseline(PState ps) arg[1] = R; goto Ins; } - if (op >= Tloadw && op <= Tloadd) + if (op == Tloadw) + op = Oloadsw; + if (op >= Tloadl && op <= Tloadd) op = Oload; if (op == Talloc1 || op == Talloc2) op = Oalloc; From ae23a3223f8f91aad898b73242ee9ec29ffabb11 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 25 Sep 2021 13:25:57 -0700 Subject: [PATCH 217/286] avoid some one last gcc truncation warning --- rega.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rega.c b/rega.c index bd26f1c..0359d2b 100644 --- a/rega.c +++ b/rega.c @@ -667,7 +667,7 @@ rega(Fn *fn) b1->link = blist; blist = b1; fn->nblk++; - sprintf(b1->name, "%s_%s", b->name, s->name); + (void)!snprintf(b1->name, sizeof(b1->name), "%s_%s", b->name, s->name); b1->nins = &insb[NIns] - curi; stmov += b1->nins; stblk += 1; From 8401139089ad8dfd1c8478e14a0cbf04572c42ce Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 25 Sep 2021 13:28:13 -0700 Subject: [PATCH 218/286] util: fix typo preventing 4-byte copy in blit() --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index a28176d..9a3576a 100644 --- a/util.c +++ b/util.c @@ -384,7 +384,7 @@ blit(Ref rdst, uint doff, Ref rsrc, uint sz, Fn *fn) { struct { int st, ld, cls, size; } *p, tbl[] = { { Ostorel, Oload, Kl, 8 }, - { Ostorew, Oload, Kw, 8 }, + { Ostorew, Oload, Kw, 4 }, { Ostoreh, Oloaduh, Kw, 2 }, { Ostoreb, Oloadub, Kw, 1 } }; From 4309ac5bdc75763324fb7384f04027c3f07525cd Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 25 Sep 2021 13:29:54 -0700 Subject: [PATCH 219/286] spill: add some comments describing functions --- spill.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/spill.c b/spill.c index 132e0e9..baceccc 100644 --- a/spill.c +++ b/spill.c @@ -155,6 +155,12 @@ slot(int t) return SLOT(s); } +/* restricts b to hold at most k + * temporaries, preferring those + * present in f (if given), then + * those with the largest spill + * cost + */ static void limit(BSet *b, int k, BSet *f) { @@ -187,8 +193,14 @@ limit(BSet *b, int k, BSet *f) slot(tarr[i]); } +/* spills temporaries to fit the + * target limits using the same + * preferences as limit(); assumes + * that k1 gprs and k2 fprs are + * currently in use + */ static void -limit2(BSet *b1, int k1, int k2, BSet *fst) +limit2(BSet *b1, int k1, int k2, BSet *f) { BSet b2[1]; @@ -196,8 +208,8 @@ limit2(BSet *b1, int k1, int k2, BSet *fst) bscopy(b2, b1); bsinter(b1, mask[0]); bsinter(b2, mask[1]); - limit(b1, T.ngpr - k1, fst); - limit(b2, T.nfpr - k2, fst); + limit(b1, T.ngpr - k1, f); + limit(b2, T.nfpr - k2, f); bsunion(b1, b2); } @@ -210,6 +222,9 @@ sethint(BSet *u, bits r) tmp[phicls(t, tmp)].hint.m |= r; } +/* reloads temporaries in u that are + * not in v from their slots + */ static void reloads(BSet *u, BSet *v) { From 462e49fd5c8ff82a341212d9a66621727c70fe1d Mon Sep 17 00:00:00 2001 From: Andrew Chambers Date: Wed, 13 Oct 2021 17:07:40 +1300 Subject: [PATCH 220/286] add size suffix to frame setup. --- amd64/emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amd64/emit.c b/amd64/emit.c index 09b90d5..a888000 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -555,7 +555,7 @@ amd64_emitfn(Fn *fn, FILE *f) ); fs = framesz(fn); if (fs) - fprintf(f, "\tsub $%"PRIu64", %%rsp\n", fs); + fprintf(f, "\tsubq $%"PRIu64", %%rsp\n", fs); if (fn->vararg) { o = -176; for (r=amd64_sysv_rsave; r<&amd64_sysv_rsave[6]; r++, o+=8) From 503c672d47695afe62fdf3439732ec96a68903b0 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 17 Oct 2021 20:56:25 +0200 Subject: [PATCH 221/286] amd64/sysv: unbreak env calls Env calls were disfunctional from the start. This fixes them on amd64, but they remain to do on arm64. A new test shows how to use them. --- amd64/sysv.c | 8 +++++--- test/env.ssa | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 test/env.ssa diff --git a/amd64/sysv.c b/amd64/sysv.c index 045ec85..842f645 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -203,7 +203,7 @@ argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret, Ref *env) break; } - return ((6-nint) << 4) | ((8-nsse) << 8); + return (!req(R, *env) << 12) | ((6-nint) << 4) | ((8-nsse) << 8); } int amd64_sysv_rsave[] = { @@ -362,7 +362,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) varc = i1->op == Ovacall; if (varc && envc) err("sysv abi does not support variadic env calls"); - ca |= (varc | envc) << 12; + ca |= varc << 12; /* envc set in argsclass() */ emit(Ocall, i1->cls, R, i1->arg[0], CALL(ca)); if (envc) emit(Ocopy, Kl, TMP(RAX), env, R); @@ -373,7 +373,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) if (ra && aret.inmem) emit(Ocopy, Kl, rarg(Kl, &ni, &ns), ra->i.to, R); /* pass hidden argument */ for (i=i0, a=ac; iinmem) + if (a->inmem || i->op == Oarge) continue; r1 = rarg(a->cls[0], &ni, &ns); if (i->op == Oargc) { @@ -466,6 +466,8 @@ selpar(Fn *fn, Ins *i0, Ins *i1) s += 2; continue; } + if (i->op == Opare) + continue; r = rarg(a->cls[0], &ni, &ns); if (i->op == Oparc) { emit(Ocopy, a->cls[0], a->ref[0], r, R); diff --git a/test/env.ssa b/test/env.ssa new file mode 100644 index 0000000..7a7bb58 --- /dev/null +++ b/test/env.ssa @@ -0,0 +1,21 @@ +# sanity checks for env calls + +function l $epar(env %e, l %i) { +@start + %x =l add %e, %i + ret %x +} + +export function l $earg(l %a, l %b) { +@start + %r1 =l call $epar(env %a, l %b) + # okay to call a regular function + # with an env argument + %r2 =l call $labs(env 113, l %r1) + ret %r2 +} + +# >>> driver +# extern long earg(long, long); +# int main(void) { return !(earg(2, -44) == 42); } +# <<< From 9858a12730717d9c5e5deec4264d7041d75fc947 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 17 Oct 2021 21:21:45 +0200 Subject: [PATCH 222/286] use -static when cross-compiling tests --- tools/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.sh b/tools/test.sh index 5f3292c..c02b784 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -22,7 +22,7 @@ init() { arm64) for p in aarch64-linux-musl aarch64-linux-gnu do - cc="$p-gcc -no-pie" + cc="$p-gcc -no-pie -static" qemu="qemu-aarch64" if $cc -v >/dev/null 2>&1 && From fcdef10dae54d7124aca9ccbefe53baa8e67267d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 18 Oct 2021 21:04:10 +0200 Subject: [PATCH 223/286] make variadic args explicit Some abis, like the riscv one, treat arguments differently depending on whether they are variadic or not. To prepare for the upcomming riscv target, we change the variadic call syntax and give meaning to the location of the '...' marker. # new syntax %ret =w call $f(w %regular, ..., w %variadic) By nature of their abis, the change is backwards compatible for existing targets. --- all.h | 3 +-- amd64/sysv.c | 34 +++++++++++++++++++++------------- arm64/abi.c | 17 +++++++++++------ doc/il.txt | 6 +++--- live.c | 2 +- load.c | 2 +- ops.h | 2 +- parse.c | 48 +++++++++++++++++++++++++++++++----------------- test/_slow.qbe | 10 +++++----- test/abi5.ssa | 18 +++++++++--------- test/abi6.ssa | 4 ++-- test/echo.ssa | 2 +- test/vararg2.ssa | 28 ++++++++++++++-------------- 13 files changed, 101 insertions(+), 75 deletions(-) diff --git a/all.h b/all.h index 4b9eb0e..37980d3 100644 --- a/all.h +++ b/all.h @@ -171,12 +171,11 @@ enum { }; #define INRANGE(x, l, u) ((unsigned)(x) - l <= u - l) /* linear in x */ -#define iscall(o) INRANGE(o, Ocall, Ovacall) #define isstore(o) INRANGE(o, Ostoreb, Ostored) #define isload(o) INRANGE(o, Oloadsb, Oload) #define isext(o) INRANGE(o, Oextsb, Oextuw) #define ispar(o) INRANGE(o, Opar, Opare) -#define isarg(o) INRANGE(o, Oarg, Oarge) +#define isarg(o) INRANGE(o, Oarg, Oargv) #define isret(j) INRANGE(j, Jret0, Jretc) enum Class { diff --git a/amd64/sysv.c b/amd64/sysv.c index 842f645..2e3e4a8 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -153,7 +153,7 @@ selret(Blk *b, Fn *fn) static int argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret, Ref *env) { - int nint, ni, nsse, ns, n, *pn; + int varc, envc, nint, ni, nsse, ns, n, *pn; AClass *a; Ins *i; @@ -162,6 +162,8 @@ argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret, Ref *env) else nint = 6; nsse = 8; + varc = 0; + envc = 0; for (i=i0, a=ac; iop - op + Oarg) { case Oarg: @@ -196,14 +198,23 @@ argsclass(Ins *i0, Ins *i1, AClass *ac, int op, AClass *aret, Ref *env) a->inmem = 1; break; case Oarge: + envc = 1; if (op == Opar) *env = i->to; else *env = i->arg[0]; break; + case Oargv: + varc = 1; + break; + default: + die("unreachable"); } - return (!req(R, *env) << 12) | ((6-nint) << 4) | ((8-nsse) << 8); + if (varc && envc) + err("sysv abi does not support variadic env calls"); + + return ((varc|envc) << 12) | ((6-nint) << 4) | ((8-nsse) << 8); } int amd64_sysv_rsave[] = { @@ -290,7 +301,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) { Ins *i; AClass *ac, *a, aret; - int ca, ni, ns, al, varc, envc; + int ca, ni, ns, al; uint stk, off; Ref r, r1, r2, reg[2], env; RAlloc *ra; @@ -358,22 +369,20 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) ca += 1 << 2; } } - envc = !req(R, env); - varc = i1->op == Ovacall; - if (varc && envc) - err("sysv abi does not support variadic env calls"); - ca |= varc << 12; /* envc set in argsclass() */ + emit(Ocall, i1->cls, R, i1->arg[0], CALL(ca)); - if (envc) + + if (!req(R, env)) emit(Ocopy, Kl, TMP(RAX), env, R); - if (varc) + else if ((ca >> 12) & 1) /* vararg call */ emit(Ocopy, Kw, TMP(RAX), getcon((ca >> 8) & 15, fn), R); ni = ns = 0; if (ra && aret.inmem) emit(Ocopy, Kl, rarg(Kl, &ni, &ns), ra->i.to, R); /* pass hidden argument */ + for (i=i0, a=ac; iinmem || i->op == Oarge) + if (i->op >= Oarge || a->inmem) continue; r1 = rarg(a->cls[0], &ni, &ns); if (i->op == Oargc) { @@ -393,7 +402,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) r = newtmp("abi", Kl, fn); for (i=i0, a=ac, off=0; iinmem) + if (i->op >= Oarge || !a->inmem) continue; if (i->op == Oargc) { if (a->align == 4) @@ -676,7 +685,6 @@ amd64_sysv_abi(Fn *fn) emiti(*i); break; case Ocall: - case Ovacall: for (i0=i; i0>b->ins; i0--) if (!isarg((i0-1)->op)) break; diff --git a/arm64/abi.c b/arm64/abi.c index 5fe9553..d38dcf5 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -255,6 +255,10 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env) case Oarge: *env = i->arg[0]; break; + case Oargv: + break; + default: + die("unreachable"); } return ((gp-gpreg) << 5) | ((fp-fpreg) << 9); @@ -371,10 +375,11 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) } } + emit(Ocall, 0, R, i1->arg[0], CALL(cty)); + envc = !req(R, env); if (envc) die("todo (arm abi): env calls"); - emit(Ocall, 0, R, i1->arg[0], CALL(cty)); if (cty & (1 << 13)) /* struct return argument */ @@ -383,9 +388,9 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) for (i=i0, c=ca; iclass & Cstk) != 0) continue; - if (i->op != Oargc) + if (i->op == Oarg) emit(Ocopy, *c->cls, TMP(*c->reg), i->arg[0], R); - else + if (i->op == Oargc) ldregs(c->reg, c->cls, c->nreg, i->arg[1], fn); } @@ -393,11 +398,12 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) for (i=i0, c=ca; iclass & Cstk) == 0) continue; - if (i->op != Oargc) { + if (i->op == Oarg) { r = newtmp("abi", Kl, fn); emit(Ostorel, 0, R, i->arg[0], r); emit(Oadd, Kl, r, TMP(SP), getcon(off, fn)); - } else + } + if (i->op == Oargc) blit(TMP(SP), off, i->arg[1], c->size, fn); off += c->size; } @@ -675,7 +681,6 @@ arm64_abi(Fn *fn) emiti(*i); break; case Ocall: - case Ovacall: for (i0=i; i0>b->ins; i0--) if (!isarg((i0-1)->op)) break; diff --git a/doc/il.txt b/doc/il.txt index d1ed755..87a4d9f 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -751,7 +751,7 @@ single-precision floating point number `%f` into `%rs`. ARG := ABITY VAL # Regular argument | 'env' VAL # Environment argument (first) - | '...' # Variadic marker (last) + | '...' # Variadic marker ABITY := BASETY | :IDENT @@ -778,8 +778,8 @@ integer. If the called function does not expect an environment parameter, it will be safely discarded. See the <@ Functions > section for more information about environment parameters. -When the called function is variadic, the last argument -must be `...`. +When the called function is variadic, there must be a `...` +marker separating the named and variadic arguments. ~ Variadic ~~~~~~~~~~ diff --git a/live.c b/live.c index c22e063..4198995 100644 --- a/live.c +++ b/live.c @@ -82,7 +82,7 @@ filllive(Fn *f) for (k=0; k<2; k++) b->nlive[k] = nlv[k]; for (i=&b->ins[b->nins]; i!=b->ins;) { - if (iscall((--i)->op) && rtype(i->arg[1]) == RCall) { + if ((--i)->op == Ocall && rtype(i->arg[1]) == RCall) { b->in->t[0] &= ~T.retregs(i->arg[1], m); for (k=0; k<2; k++) { nlv[k] -= m[k]; diff --git a/load.c b/load.c index f3a695b..5d61a6c 100644 --- a/load.c +++ b/load.c @@ -234,7 +234,7 @@ def(Slice sl, bits msk, Blk *b, Ins *i, Loc *il) while (i > b->ins) { --i; if (killsl(i->to, sl) - || (iscall(i->op) && escapes(sl.ref, curf))) + || (i->op == Ocall && escapes(sl.ref, curf))) goto Load; ld = isload(i->op); if (ld) { diff --git a/ops.h b/ops.h index 114310c..535be71 100644 --- a/ops.h +++ b/ops.h @@ -137,8 +137,8 @@ O(pare, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0) O(arg, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 0) O(argc, T(e,x,e,e, e,l,e,e), 0) X(0, 0, 0) O(arge, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) +O(argv, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) O(call, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) -O(vacall, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) /* Flags Setting */ O(flagieq, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) diff --git a/parse.c b/parse.c index da88f58..104ca1d 100644 --- a/parse.c +++ b/parse.c @@ -450,25 +450,44 @@ parsecls(int *tyn) static int parserefl(int arg) { - int k, ty, env, hasenv; + int k, ty, env, hasenv, vararg; Ref r; hasenv = 0; + vararg = 0; expect(Tlparen); - while (peek() != Trparen && peek() != Tdots) { + while (peek() != Trparen) { if (curi - insb >= NIns) err("too many instructions (1)"); - env = peek() == Tenv; - if (env) { + if (!arg && vararg) + err("no parameters allowed after '...'"); + switch (peek()) { + case Tdots: + if (vararg) + err("only one '...' allowed"); + vararg = 1; + if (arg) { + *curi = (Ins){.op = Oargv}; + curi++; + } + next(); + goto Next; + case Tenv: + if (hasenv) + err("only one environment allowed"); + hasenv = 1; + env = 1; next(); k = Kl; - } else + break; + default: + env = 0; k = parsecls(&ty); + break; + } r = parseref(); if (req(r, R)) err("invalid argument"); - if (hasenv && env) - err("only one environment allowed"); if (!arg && rtype(r) != RTmp) err("invalid function parameter"); if (k == 4) @@ -487,16 +506,13 @@ parserefl(int arg) else *curi = (Ins){Opar, k, r, {R}}; curi++; - hasenv |= env; + Next: if (peek() == Trparen) break; expect(Tcomma); } - if (next() == Tdots) { - expect(Trparen); - return 1; - } - return 0; + expect(Trparen); + return vararg; } static Blk * @@ -621,10 +637,8 @@ parseline(PState ps) } if (op == Tcall) { arg[0] = parseref(); - if (parserefl(1)) - op = Ovacall; - else - op = Ocall; + parserefl(1); + op = Ocall; expect(Tnl); if (k == 4) { k = Kl; diff --git a/test/_slow.qbe b/test/_slow.qbe index 2d107ae..a411e41 100644 --- a/test/_slow.qbe +++ b/test/_slow.qbe @@ -3408,7 +3408,7 @@ function $transparent_crc(l %.1, l %.3, w %.5) { %.9 =l copy $.Lstring.93 %.10 =l loadl %.4 %.11 =l loadl %.2 - %.12 =w call $printf(l %.9, l %.10, l %.11, ...) + %.12 =w call $printf(l %.9, ..., l %.10, l %.11) @if_false.679 %.13 =l loadl $crc32_context %.14 =l loadl %.2 @@ -3461,7 +3461,7 @@ function $transparent_crc_bytes(l %.1, w %.3, l %.5, w %.7) { %.28 =l loadl $crc32_context %.29 =l copy 4294967295 %.30 =l xor %.28, %.29 - %.31 =w call $printf(l %.26, l %.27, l %.30, ...) + %.31 =w call $printf(l %.26, ..., l %.27, l %.30) @if_false.687 ret } @@ -3480,7 +3480,7 @@ function $platform_main_end(l %.1, w %.3) { @if_true.690 %.8 =l copy $.Lstring.97 %.9 =l loadl %.2 - %.10 =w call $printf(l %.8, l %.9, ...) + %.10 =w call $printf(l %.8, ..., l %.9) @if_false.691 ret } @@ -35219,7 +35219,7 @@ function w $main(w %.1, l %.3) { %.53 =w loadsw %.5 %.54 =w loadsw %.6 %.55 =w loadsw %.7 - %.56 =w call $printf(l %.52, w %.53, w %.54, w %.55, ...) + %.56 =w call $printf(l %.52, ..., w %.53, w %.54, w %.55) @if_false.1519 @for_cont.1516 %.57 =w loadsw %.7 @@ -35338,7 +35338,7 @@ function w $main(w %.1, l %.3) { @if_true.1524 %.138 =l copy $.Lstring.129 %.139 =w loadsw %.5 - %.140 =w call $printf(l %.138, w %.139, ...) + %.140 =w call $printf(l %.138, ..., w %.139) @if_false.1525 @for_cont.1522 %.141 =w loadsw %.5 diff --git a/test/abi5.ssa b/test/abi5.ssa index edfda4e..1d823b1 100644 --- a/test/abi5.ssa +++ b/test/abi5.ssa @@ -25,41 +25,41 @@ export function $test() { @start %r1 =:st1 call $t1() - %i1 =w call $printf(l $fmt1, l %r1, ...) + %i1 =w call $printf(l $fmt1, ..., l %r1) %r2 =:st2 call $t2() %w2 =w loadw %r2 - %i2 =w call $printf(l $fmt2, w %w2, ...) + %i2 =w call $printf(l $fmt2, ..., w %w2) %r3 =:st3 call $t3() %s3 =s loads %r3 %r34 =l add %r3, 4 %w3 =w loadw %r34 %p3 =d exts %s3 - %i3 =w call $printf(l $fmt3, d %p3, w %w3, ...) + %i3 =w call $printf(l $fmt3, ..., d %p3, w %w3) %r4 =:st4 call $t4() %w4 =w loadw %r4 %r48 =l add 8, %r4 %d4 =d loadd %r48 - %i4 =w call $printf(l $fmt4, w %w4, d %d4, ...) + %i4 =w call $printf(l $fmt4, ..., w %w4, d %d4) %r5 =:st5 call $t5() %s5 =s loads %r5 %d5 =d exts %s5 %r58 =l add %r5, 8 %l5 =l loadl %r58 - %i5 =w call $printf(l $fmt5, d %d5, l %l5, ...) + %i5 =w call $printf(l $fmt5, ..., d %d5, l %l5) %r6 =:st6 call $t6() - %i6 =w call $printf(l $fmt6, l %r6, ...) + %i6 =w call $printf(l $fmt6, ..., l %r6) %r7 =:st7 call $t7() %s7 =s loads %r7 %d71 =d exts %s7 %r78 =l add %r7, 8 %d72 =d loadd %r78 - %i7 =w call $printf(l $fmt7, d %d71, d %d72, ...) + %i7 =w call $printf(l $fmt7, ..., d %d71, d %d72) %r8 =:st8 call $t8() %r84 =l add 4, %r8 @@ -69,14 +69,14 @@ function $test() { %w82 =w loadw %r84 %w83 =w loadw %r88 %w84 =w loadw %r812 - %i8 =w call $printf(l $fmt8, w %w81, w %w82, w %w83, w %w84, ...) + %i8 =w call $printf(l $fmt8, ..., w %w81, w %w82, w %w83, w %w84) %r9 =:st9 call $t9() %r94 =l add 4, %r9 %w9 =w loadw %r9 %s9 =s loads %r94 %d9 =d exts %s9 - %i9 =w call $printf(l $fmt9, w %w9, d %d9, ...) + %i9 =w call $printf(l $fmt9, ..., w %w9, d %d9) ret } diff --git a/test/abi6.ssa b/test/abi6.ssa index 0870031..da2370c 100644 --- a/test/abi6.ssa +++ b/test/abi6.ssa @@ -13,8 +13,8 @@ function $f(:hfa3 %h1, :hfa3 %h2, d %d1, :hfa3 %h3, d %d2) { call $phfa3(:hfa3 %h1) call $phfa3(:hfa3 %h2) call $phfa3(:hfa3 %h3) - call $printf(l $dfmt, d %d1, ...) - call $printf(l $dfmt, d %d2, ...) + call $printf(l $dfmt, ..., d %d1) + call $printf(l $dfmt, ..., d %d2) ret } diff --git a/test/echo.ssa b/test/echo.ssa index 6010986..5e48b0e 100644 --- a/test/echo.ssa +++ b/test/echo.ssa @@ -20,7 +20,7 @@ function w $main(w %argc, l %argv) { @loop2 %sep =w phi @last 10, @nolast 32 %arg =l loadl %av - %r =w call $printf(l %fmt, l %arg, w %sep, ...) + %r =w call $printf(l %fmt, ..., l %arg, w %sep) %av1 =l add %av, 8 %ac1 =w sub %ac, 1 jmp @loop diff --git a/test/vararg2.ssa b/test/vararg2.ssa index 7e85774..0b2eb53 100644 --- a/test/vararg2.ssa +++ b/test/vararg2.ssa @@ -19,11 +19,11 @@ export function $qbeprint0(l %fmt, ...) { jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - %r =w call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, ..., d %dbl) jmp @loop @cased %int =w vaarg %vp - %r =w call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, ..., w %int) jmp @loop @end %r =w call $puts(l %emptys) @@ -59,11 +59,11 @@ export function $qbeprint1(w %argw0, l %fmt, ...) { jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - %r =w call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, ..., d %dbl) jmp @loop @cased %int =w vaarg %vp - %r =w call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, ..., w %int) jmp @loop @end %r =w call $puts(l %emptys) @@ -99,11 +99,11 @@ export function $qbeprint2(d %argd0, l %fmt, ...) { jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - %r =w call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, ..., d %dbl) jmp @loop @cased %int =w vaarg %vp - %r =w call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, ..., w %int) jmp @loop @end %r =w call $puts(l %emptys) @@ -139,11 +139,11 @@ export function $qbeprint3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - %r =w call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, ..., d %dbl) jmp @loop @cased %int =w vaarg %vp - %r =w call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, ..., w %int) jmp @loop @end %r =w call $puts(l %emptys) @@ -179,11 +179,11 @@ export function $qbeprint4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d % jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - %r =w call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, ..., d %dbl) jmp @loop @cased %int =w vaarg %vp - %r =w call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, ..., w %int) jmp @loop @end %r =w call $puts(l %emptys) @@ -219,11 +219,11 @@ export function $qbeprint5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d % jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - %r =w call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, ..., d %dbl) jmp @loop @cased %int =w vaarg %vp - %r =w call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, ..., w %int) jmp @loop @end %r =w call $puts(l %emptys) @@ -259,11 +259,11 @@ export function $qbeprint6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w % jnz %isg, @casef, @cased @casef %dbl =d vaarg %vp - %r =w call $printf(l %fmtdbl, d %dbl, ...) + %r =w call $printf(l %fmtdbl, ..., d %dbl) jmp @loop @cased %int =w vaarg %vp - %r =w call $printf(l %fmtint, w %int, ...) + %r =w call $printf(l %fmtint, ..., w %int) jmp @loop @end %r =w call $puts(l %emptys) From 5f994fed4e17bd65fc3958b5a8aab577a8948b9f Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 8 May 2019 18:29:28 -0700 Subject: [PATCH 224/286] arm64: handle slots --- arm64/emit.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index cd0a2b1..76588ed 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -220,8 +220,17 @@ emitf(char *s, Ins *i, E *e) c = *s++; assert(c == '0' || c == '1'); r = i->arg[c - '0']; - assert(isreg(r) && "TODO emit non reg addresses"); - fprintf(e->f, "[%s]", rname(r.val, Kl)); + switch (rtype(r)) { + default: + die("todo (arm emit): unhandled ref"); + case RTmp: + assert(isreg(r)); + fprintf(e->f, "[%s]", rname(r.val, Kl)); + break; + case RSlot: + fprintf(e->f, "[sp, %"PRIu64"]", slot(r.val, e)); + break; + } break; } } From 542825d1f48cd1037c76e12fd5a14b6a91422cf6 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 9 May 2019 23:32:15 -0700 Subject: [PATCH 225/286] arm64: Handle slots in Ocopy operands --- arm64/emit.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index 76588ed..f48dbee 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -218,8 +218,8 @@ emitf(char *s, Ins *i, E *e) break; case 'M': c = *s++; - assert(c == '0' || c == '1'); - r = i->arg[c - '0']; + assert(c == '0' || c == '1' || c == '='); + r = c == '=' ? i->to : i->arg[c - '0']; switch (rtype(r)) { default: die("todo (arm emit): unhandled ref"); @@ -307,9 +307,26 @@ emitins(Ins *i, E *e) case Ocopy: if (req(i->to, i->arg[0])) break; - if (rtype(i->arg[0]) != RCon) + if (rtype(i->to) == RSlot) { + if (rtype(i->arg[0]) == RSlot) { + emitf("ldr %?, %M0\n\tstr %?, %M=", i, e); + } else { + assert(isreg(i->arg[0])); + emitf("str %0, %M=", i, e); + } + break; + } + assert(isreg(i->to)); + switch (rtype(i->arg[0])) { + case RCon: + loadcon(&e->fn->con[i->arg[0].val], i->to.val, i->cls, e->f); + break; + case RSlot: + emitf("ldr %=, %M0", i, e); + break; + default: goto Table; - loadcon(&e->fn->con[i->arg[0].val], i->to.val, i->cls, e->f); + } break; case Oaddr: assert(rtype(i->arg[0]) == RSlot); From 5dbc5dc2c9816821db6e7f1a2903c54a7d549efd Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 25 Mar 2021 13:51:25 -0700 Subject: [PATCH 226/286] arm64: handle copy of constant to slot If registers spill onto the stack, we may end up with SSA like S320 =l copy 0 after rega(). Handle this case in arm64 emit(). --- arm64/emit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index f48dbee..eda1079 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -308,9 +308,15 @@ emitins(Ins *i, E *e) if (req(i->to, i->arg[0])) break; if (rtype(i->to) == RSlot) { - if (rtype(i->arg[0]) == RSlot) { + switch (rtype(i->arg[0])) { + case RSlot: emitf("ldr %?, %M0\n\tstr %?, %M=", i, e); - } else { + break; + case RCon: + loadcon(&e->fn->con[i->arg[0].val], R18, i->cls, e->f); + emitf("str %?, %M=", i, e); + break; + default: assert(isreg(i->arg[0])); emitf("str %0, %M=", i, e); } From 5e0ba156116036ba42d7ce8e361004ea20fb2d6b Mon Sep 17 00:00:00 2001 From: Sudipto Mallick Date: Sun, 11 Jul 2021 20:38:30 +0000 Subject: [PATCH 227/286] arm64/emit.c: fix move instructions with big immediate values Fixes #467. It assumes that the stack won't need to grow beyond 2^32 bytes. If that were to happen, we'd need another or at most two more `movk` instructions. Signed-off-by: Sudipto Mallick --- arm64/emit.c | 86 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 71 insertions(+), 15 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index eda1079..752b455 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -338,15 +338,21 @@ emitins(Ins *i, E *e) assert(rtype(i->arg[0]) == RSlot); rn = rname(i->to.val, Kl); s = slot(i->arg[0].val, e); - if (s <= 4095) { + if (s <= 4095) fprintf(e->f, "\tadd\t%s, x29, #%"PRIu64"\n", rn, s); - } else { + else if (s <= 65535) fprintf(e->f, "\tmov\t%s, #%"PRIu64"\n" "\tadd\t%s, x29, %s\n", rn, s, rn, rn ); - } + else + fprintf(e->f, + "\tmov\t%s, #%"PRIu64"\n" + "\tmovk\t%s, #%"PRIu64", lsl #16\n" + "\tadd\t%s, x29, %s\n", + rn, s & 0xFFFF, rn, s >> 16, rn, rn + ); break; } } @@ -435,20 +441,45 @@ arm64_emitfn(Fn *fn, FILE *out) "\tstp\tx29, x30, [sp, -16]!\n", e->frame ); - else + else if (e->frame <= 65535) fprintf(e->f, "\tmov\tx16, #%"PRIu64"\n" "\tsub\tsp, sp, x16\n" "\tstp\tx29, x30, [sp, -16]!\n", e->frame ); + else + fprintf(e->f, + "\tmov\tx16, #%"PRIu64"\n" + "\tmovk\tx16, #%"PRIu64", lsl #16\n" + "\tsub\tsp, sp, x16\n" + "\tstp\tx29, x30, [sp, -16]!\n", + e->frame & 0xFFFF, e->frame >> 16 + ); fputs("\tadd\tx29, sp, 0\n", e->f); for (o=e->frame+16, r=arm64_rclob; *r>=0; r++) - if (e->fn->reg & BIT(*r)) - fprintf(e->f, - "\tstr\t%s, [sp, %"PRIu64"]\n", - rname(*r, Kx), o -= 8 - ); + if (e->fn->reg & BIT(*r)) { + if (o <= 32760) + fprintf(e->f, + "\tstr\t%s, [sp, %"PRIu64"]\n", + rname(*r, Kx), o -= 8 + ); + else if (o <= 65535) + fprintf(e->f, + "\tmov\tx16, #%"PRIu64"\n" + "\tstr\t%s, [sp, x16]\n", + o -= 8, rname(*r, Kx) + ); + else { + o -= 8; + fprintf(e->f, + "\tmov\tx16, #%"PRIu64"\n" + "\tmovk\tx16, #%"PRIu64", lsl #16\n" + "\tstr\t%s, [sp, x16]\n", + o & 0xFFFF, o >> 16, rname(*r, Kx) + ); + } + } for (lbl=0, b=e->fn->start; b; b=b->link) { if (lbl || b->npred > 1) @@ -459,11 +490,28 @@ arm64_emitfn(Fn *fn, FILE *out) switch (b->jmp.type) { case Jret0: for (o=e->frame+16, r=arm64_rclob; *r>=0; r++) - if (e->fn->reg & BIT(*r)) - fprintf(e->f, - "\tldr\t%s, [sp, %"PRIu64"]\n", - rname(*r, Kx), o -= 8 - ); + if (e->fn->reg & BIT(*r)) { + if (o <= 32760) + fprintf(e->f, + "\tldr\t%s, [sp, %"PRIu64"]\n", + rname(*r, Kx), o -= 8 + ); + else if (o <= 65535) + fprintf(e->f, + "\tmov\tx16, #%"PRIu64"\n" + "\tldr\t%s, [sp, x16]\n", + o -= 8, rname(*r, Kx) + ); + else { + o -= 8; + fprintf(e->f, + "\tmov\tx16, #%"PRIu64"\n" + "\tmovk\tx16, #%"PRIu64", lsl #16\n" + "\tldr\t%s, [sp, x16]\n", + o & 0xFFFF, o >> 16, rname(*r, Kx) + ); + } + } o = e->frame + 16; if (e->fn->vararg) o += 192; @@ -478,13 +526,21 @@ arm64_emitfn(Fn *fn, FILE *out) "\tadd\tsp, sp, #%"PRIu64"\n", o - 16 ); - else + else if (o - 16 <= 65535) fprintf(e->f, "\tldp\tx29, x30, [sp], 16\n" "\tmov\tx16, #%"PRIu64"\n" "\tadd\tsp, sp, x16\n", o - 16 ); + else + fprintf(e->f, + "\tldp\tx29, x30, [sp], 16\n" + "\tmov\tx16, #%"PRIu64"\n" + "\tmovk\tx16, #%"PRIu64", lsl #16\n" + "\tadd\tsp, sp, x16\n", + (o - 16) & 0xFFFF, (o - 16) >> 16 + ); fprintf(e->f, "\tret\n"); break; case Jjmp: From fd33b2ef25ff55217e229666c4d2f0877aac2515 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 26 Mar 2021 14:39:55 +0100 Subject: [PATCH 228/286] arm64: Add LR to list of registers to save Tested-by: Thomas Bracht Laumann Jespersen Fixes: https://todo.sr.ht/~sircmpwn/hare/312 --- arm64/all.h | 2 +- arm64/targ.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arm64/all.h b/arm64/all.h index 0b3073a..ff2b3ff 100644 --- a/arm64/all.h +++ b/arm64/all.h @@ -14,7 +14,7 @@ enum Arm64Reg { NFPR = V30 - V0 + 1, NGPR = SP - R0 + 1, - NGPS = R18 - R0 + 1, + NGPS = R18 - R0 + 1 /* LR */ + 1, NFPS = (V7 - V0 + 1) + (V30 - V16 + 1), NCLR = (R28 - R19 + 1) + (V15 - V8 + 1), }; diff --git a/arm64/targ.c b/arm64/targ.c index ead6932..99c4347 100644 --- a/arm64/targ.c +++ b/arm64/targ.c @@ -3,7 +3,7 @@ int arm64_rsave[] = { R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, - IP0, IP1, R18, + IP0, IP1, R18, LR, V0, V1, V2, V3, V4, V5, V6, V7, V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V26, V27, V28, V29, V30, From b2a25215fcc71c86e0120c7bac14f679b70a3a3c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 25 Oct 2021 13:39:20 +0200 Subject: [PATCH 229/286] spill: fix regs assertions Some arm64 abi tests have been failing for some time now. This fixes them by being a bit more careful with liveset management in spill.c. A late bsclr() call in spill.c may drop legitimately live registers in e.g., R12 =w add R12, 1 While it hurts for regs, it does not matter for ssa temps because those cannot be both in the arguments & return (by the ssa invariant). I added a check before bsclr() to make sure we are clearing only ssa temps. One might be surprised that any ssa temp may be live at this point. The reason why this is the case is the special handling of dead return values earlier in spill(). I think that it is the only case where the return value can be (awkwardly) live at the same time as the arguments, and I think this never happens with registers (i.e., we never have dead register- assigning instructions). I added an assert to check the latter invariant. Finally, there was a simple bug in the arm64 abi which I fixed: In case the return happens via a pointer, x8 needs to be marked live at the beginning of the function. This was caught by test/abi4.ssa. --- arm64/abi.c | 1 + spill.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arm64/abi.c b/arm64/abi.c index d38dcf5..8209944 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -448,6 +448,7 @@ selpar(Fn *fn, Ins *i0, Ins *i1) if (cr.class & Cptr) { fn->retr = newtmp("abi", Kl, fn); emit(Ocopy, Kl, fn->retr, TMP(R8), R); + fn->reg |= BIT(R8); } } diff --git a/spill.c b/spill.c index baceccc..4c11d9f 100644 --- a/spill.c +++ b/spill.c @@ -428,6 +428,7 @@ spill(Fn *fn) else { /* make sure we have a reg * for the result */ + assert(t >= Tmp0 && "dead reg"); bsset(v, t); bsset(w, t); } @@ -476,7 +477,10 @@ spill(Fn *fn) if (!req(i->to, R)) { t = i->to.val; store(i->to, tmp[t].slot); - bsclr(v, t); + if (t >= Tmp0) + /* in case i->to was a + * dead temporary */ + bsclr(v, t); } emiti(*i); r = v->t[0]; /* Tmp0 is NBit */ From 9dec866d2cdfcd076b91b7216e74646a004efb43 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 26 Oct 2021 12:24:27 -0700 Subject: [PATCH 230/286] remove trailing whitespace from test/abi7.ssa --- test/abi7.ssa | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/test/abi7.ssa b/test/abi7.ssa index bf8ca1f..193e36a 100644 --- a/test/abi7.ssa +++ b/test/abi7.ssa @@ -1,21 +1,21 @@ -# test padding calculation with -# embedded struct - -type :s1 = align 4 { w 3 } -type :s2 = align 4 { b 1, :s1 1 } - -export function :s2 $test() { -@start - ret $s -} - -# >>> driver -# struct s2 { -# char x; -# struct { int a[3]; } s1; -# } s = { .x = 123 }; -# extern struct s2 test(void); -# int main(void) { -# return !(test().x == 123); -# } -# <<< +# test padding calculation with +# embedded struct + +type :s1 = align 4 { w 3 } +type :s2 = align 4 { b 1, :s1 1 } + +export function :s2 $test() { +@start + ret $s +} + +# >>> driver +# struct s2 { +# char x; +# struct { int a[3]; } s1; +# } s = { .x = 123 }; +# extern struct s2 test(void); +# int main(void) { +# return !(test().x == 123); +# } +# <<< From 900805a8fe5cfa799966c4ef221524e967c44ca5 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 26 Oct 2021 12:26:28 -0700 Subject: [PATCH 231/286] use unified diff format for test output This make it easier to understand the differences. --- tools/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.sh b/tools/test.sh index c02b784..c5e5b37 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -137,7 +137,7 @@ once() { if test -s $out then - $qemu $exe a b c | diff - $out + $qemu $exe a b c | diff -u - $out ret=$? reason="output" else From 0d68986b6f6aa046ab13776f39cc37b67b3477ba Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 28 Oct 2021 15:53:51 +0200 Subject: [PATCH 232/286] new chacha20 test --- test/_chacha20.ssa | 233 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 test/_chacha20.ssa diff --git a/test/_chacha20.ssa b/test/_chacha20.ssa new file mode 100644 index 0000000..9b25745 --- /dev/null +++ b/test/_chacha20.ssa @@ -0,0 +1,233 @@ +export function $chacha20_rounds_qbe(l %out, l %in) { +@start + %t0 =w loadw %in + %in =l add %in, 4 + %t1 =w loadw %in + %in =l add %in, 4 + %t2 =w loadw %in + %in =l add %in, 4 + %t3 =w loadw %in + %in =l add %in, 4 + %t4 =w loadw %in + %in =l add %in, 4 + %t5 =w loadw %in + %in =l add %in, 4 + %t6 =w loadw %in + %in =l add %in, 4 + %t7 =w loadw %in + %in =l add %in, 4 + %t8 =w loadw %in + %in =l add %in, 4 + %t9 =w loadw %in + %in =l add %in, 4 + %t10 =w loadw %in + %in =l add %in, 4 + %t11 =w loadw %in + %in =l add %in, 4 + %t12 =w loadw %in + %in =l add %in, 4 + %t13 =w loadw %in + %in =l add %in, 4 + %t14 =w loadw %in + %in =l add %in, 4 + %t15 =w loadw %in + %in =l add %in, 4 + %counter =w copy 10 +@loop + %t0 =w add %t0, %t4 + %t12 =w xor %t12, %t0 + %rotl32_a =w shl %t12, 16 + %rotl32_b =w shr %t12, 16 + %t12 =w xor %rotl32_a, %rotl32_b + %t8 =w add %t8, %t12 + %t4 =w xor %t4, %t8 + %rotl32_a =w shl %t4, 12 + %rotl32_b =w shr %t4, 20 + %t4 =w xor %rotl32_a, %rotl32_b + %t0 =w add %t0, %t4 + %t12 =w xor %t12, %t0 + %rotl32_a =w shl %t12, 8 + %rotl32_b =w shr %t12, 24 + %t12 =w xor %rotl32_a, %rotl32_b + %t8 =w add %t8, %t12 + %t4 =w xor %t4, %t8 + %rotl32_a =w shl %t4, 7 + %rotl32_b =w shr %t4, 25 + %t4 =w xor %rotl32_a, %rotl32_b + %t1 =w add %t1, %t5 + %t13 =w xor %t13, %t1 + %rotl32_a =w shl %t13, 16 + %rotl32_b =w shr %t13, 16 + %t13 =w xor %rotl32_a, %rotl32_b + %t9 =w add %t9, %t13 + %t5 =w xor %t5, %t9 + %rotl32_a =w shl %t5, 12 + %rotl32_b =w shr %t5, 20 + %t5 =w xor %rotl32_a, %rotl32_b + %t1 =w add %t1, %t5 + %t13 =w xor %t13, %t1 + %rotl32_a =w shl %t13, 8 + %rotl32_b =w shr %t13, 24 + %t13 =w xor %rotl32_a, %rotl32_b + %t9 =w add %t9, %t13 + %t5 =w xor %t5, %t9 + %rotl32_a =w shl %t5, 7 + %rotl32_b =w shr %t5, 25 + %t5 =w xor %rotl32_a, %rotl32_b + %t2 =w add %t2, %t6 + %t14 =w xor %t14, %t2 + %rotl32_a =w shl %t14, 16 + %rotl32_b =w shr %t14, 16 + %t14 =w xor %rotl32_a, %rotl32_b + %t10 =w add %t10, %t14 + %t6 =w xor %t6, %t10 + %rotl32_a =w shl %t6, 12 + %rotl32_b =w shr %t6, 20 + %t6 =w xor %rotl32_a, %rotl32_b + %t2 =w add %t2, %t6 + %t14 =w xor %t14, %t2 + %rotl32_a =w shl %t14, 8 + %rotl32_b =w shr %t14, 24 + %t14 =w xor %rotl32_a, %rotl32_b + %t10 =w add %t10, %t14 + %t6 =w xor %t6, %t10 + %rotl32_a =w shl %t6, 7 + %rotl32_b =w shr %t6, 25 + %t6 =w xor %rotl32_a, %rotl32_b + %t3 =w add %t3, %t7 + %t15 =w xor %t15, %t3 + %rotl32_a =w shl %t15, 16 + %rotl32_b =w shr %t15, 16 + %t15 =w xor %rotl32_a, %rotl32_b + %t11 =w add %t11, %t15 + %t7 =w xor %t7, %t11 + %rotl32_a =w shl %t7, 12 + %rotl32_b =w shr %t7, 20 + %t7 =w xor %rotl32_a, %rotl32_b + %t3 =w add %t3, %t7 + %t15 =w xor %t15, %t3 + %rotl32_a =w shl %t15, 8 + %rotl32_b =w shr %t15, 24 + %t15 =w xor %rotl32_a, %rotl32_b + %t11 =w add %t11, %t15 + %t7 =w xor %t7, %t11 + %rotl32_a =w shl %t7, 7 + %rotl32_b =w shr %t7, 25 + %t7 =w xor %rotl32_a, %rotl32_b + %t0 =w add %t0, %t5 + %t15 =w xor %t15, %t0 + %rotl32_a =w shl %t15, 16 + %rotl32_b =w shr %t15, 16 + %t15 =w xor %rotl32_a, %rotl32_b + %t10 =w add %t10, %t15 + %t5 =w xor %t5, %t10 + %rotl32_a =w shl %t5, 12 + %rotl32_b =w shr %t5, 20 + %t5 =w xor %rotl32_a, %rotl32_b + %t0 =w add %t0, %t5 + %t15 =w xor %t15, %t0 + %rotl32_a =w shl %t15, 8 + %rotl32_b =w shr %t15, 24 + %t15 =w xor %rotl32_a, %rotl32_b + %t10 =w add %t10, %t15 + %t5 =w xor %t5, %t10 + %rotl32_a =w shl %t5, 7 + %rotl32_b =w shr %t5, 25 + %t5 =w xor %rotl32_a, %rotl32_b + %t1 =w add %t1, %t6 + %t12 =w xor %t12, %t1 + %rotl32_a =w shl %t12, 16 + %rotl32_b =w shr %t12, 16 + %t12 =w xor %rotl32_a, %rotl32_b + %t11 =w add %t11, %t12 + %t6 =w xor %t6, %t11 + %rotl32_a =w shl %t6, 12 + %rotl32_b =w shr %t6, 20 + %t6 =w xor %rotl32_a, %rotl32_b + %t1 =w add %t1, %t6 + %t12 =w xor %t12, %t1 + %rotl32_a =w shl %t12, 8 + %rotl32_b =w shr %t12, 24 + %t12 =w xor %rotl32_a, %rotl32_b + %t11 =w add %t11, %t12 + %t6 =w xor %t6, %t11 + %rotl32_a =w shl %t6, 7 + %rotl32_b =w shr %t6, 25 + %t6 =w xor %rotl32_a, %rotl32_b + %t2 =w add %t2, %t7 + %t13 =w xor %t13, %t2 + %rotl32_a =w shl %t13, 16 + %rotl32_b =w shr %t13, 16 + %t13 =w xor %rotl32_a, %rotl32_b + %t8 =w add %t8, %t13 + %t7 =w xor %t7, %t8 + %rotl32_a =w shl %t7, 12 + %rotl32_b =w shr %t7, 20 + %t7 =w xor %rotl32_a, %rotl32_b + %t2 =w add %t2, %t7 + %t13 =w xor %t13, %t2 + %rotl32_a =w shl %t13, 8 + %rotl32_b =w shr %t13, 24 + %t13 =w xor %rotl32_a, %rotl32_b + %t8 =w add %t8, %t13 + %t7 =w xor %t7, %t8 + %rotl32_a =w shl %t7, 7 + %rotl32_b =w shr %t7, 25 + %t7 =w xor %rotl32_a, %rotl32_b + %t3 =w add %t3, %t4 + %t14 =w xor %t14, %t3 + %rotl32_a =w shl %t14, 16 + %rotl32_b =w shr %t14, 16 + %t14 =w xor %rotl32_a, %rotl32_b + %t9 =w add %t9, %t14 + %t4 =w xor %t4, %t9 + %rotl32_a =w shl %t4, 12 + %rotl32_b =w shr %t4, 20 + %t4 =w xor %rotl32_a, %rotl32_b + %t3 =w add %t3, %t4 + %t14 =w xor %t14, %t3 + %rotl32_a =w shl %t14, 8 + %rotl32_b =w shr %t14, 24 + %t14 =w xor %rotl32_a, %rotl32_b + %t9 =w add %t9, %t14 + %t4 =w xor %t4, %t9 + %rotl32_a =w shl %t4, 7 + %rotl32_b =w shr %t4, 25 + %t4 =w xor %rotl32_a, %rotl32_b + %counter =w sub %counter, 10 + jnz %counter, @loop, @done +@done + storew %t0, %out + %out =l add %out, 4 + storew %t1, %out + %out =l add %out, 4 + storew %t2, %out + %out =l add %out, 4 + storew %t3, %out + %out =l add %out, 4 + storew %t4, %out + %out =l add %out, 4 + storew %t5, %out + %out =l add %out, 4 + storew %t6, %out + %out =l add %out, 4 + storew %t7, %out + %out =l add %out, 4 + storew %t8, %out + %out =l add %out, 4 + storew %t9, %out + %out =l add %out, 4 + storew %t10, %out + %out =l add %out, 4 + storew %t11, %out + %out =l add %out, 4 + storew %t12, %out + %out =l add %out, 4 + storew %t13, %out + %out =l add %out, 4 + storew %t14, %out + %out =l add %out, 4 + storew %t15, %out + %out =l add %out, 4 + ret +} From cd095a44db262351b09ea144a44b76e22d62c77a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 8 Nov 2021 10:46:20 +0100 Subject: [PATCH 233/286] fix for sloppy reg->mem in arm64 abi Michael found a bug where some copies from registers to memory in the arm64 abi clobber the stack. The test case is: type :T = { w } function w $f() { @start %p =:T call $g() %x =w loadw %p ret %x } qbe will write 4 bytes out of bounds when pulling the result struct from its register. The same bug can be observed if :T's definition is {w 3}; in this case qbe writes 16 bytes in a slot of 12 bytes. This patch changes stkblob() to use the rounded argument size if it is going to be restored from registers. Relatedly, mem->reg loads for structs with size < 16 and != 8, are treated a bit sloppily both in the arm64 and in the sysv abis. That is much less harmful than the present bug. --- arm64/abi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arm64/abi.c b/arm64/abi.c index 8209944..f37c892 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -312,12 +312,14 @@ stkblob(Ref r, Class *c, Fn *fn, Insl **ilp) { Insl *il; int al; + uint64_t sz; il = alloc(sizeof *il); al = c->t->align - 2; /* NAlign == 3 */ if (al < 0) al = 0; - il->i = (Ins){Oalloc+al, Kl, r, {getcon(c->t->size, fn)}}; + sz = c->class & Cptr ? c->t->size : c->size; + il->i = (Ins){Oalloc+al, Kl, r, {getcon(sz, fn)}}; il->link = *ilp; *ilp = il; } From ae8803cbe655f64a2ef1739c8dfc5c12af99bdfb Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 25 Sep 2021 13:27:27 -0700 Subject: [PATCH 234/286] amd64: avoid reading past end of passed struct If the size of the struct is not a multiple of 8, the actual struct size may be different from the size reserved on the stack. This fixes the case where the struct is passed in memory, but we still may over-read a struct passed in registers. A TODO is added for now. --- amd64/sysv.c | 10 ++++++++-- arm64/abi.c | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/amd64/sysv.c b/amd64/sysv.c index 2e3e4a8..7dc5981 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -4,6 +4,7 @@ typedef struct AClass AClass; typedef struct RAlloc RAlloc; struct AClass { + Typ *type; int inmem; int align; uint size; @@ -72,6 +73,7 @@ typclass(AClass *a, Typ *t) al = 8; sz = (sz + al-1) & -al; + a->type = t; a->size = sz; a->align = t->align; @@ -125,7 +127,7 @@ selret(Blk *b, Fn *fn) if (aret.inmem) { assert(rtype(fn->retr) == RTmp); emit(Ocopy, Kl, TMP(RAX), fn->retr, R); - blit(fn->retr, 0, r0, aret.size, fn); + blit(fn->retr, 0, r0, aret.type->size, fn); ca = 1; } else { ca = retr(reg, &aret); @@ -338,6 +340,10 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) emit(Ocopy, Kl, i1->to, TMP(RAX), R); ca += 1; } else { + /* todo, may read out of bounds. + * gcc did this up until 5.2, but + * this should still be fixed. + */ if (aret.size > 8) { r = newtmp("abi", Kl, fn); aret.ref[1] = newtmp("abi", aret.cls[1], fn); @@ -407,7 +413,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) if (i->op == Oargc) { if (a->align == 4) off += off & 15; - blit(r, off, i->arg[1], a->size, fn); + blit(r, off, i->arg[1], a->type->size, fn); } else { r1 = newtmp("abi", Kl, fn); emit(Ostorel, 0, R, i->arg[0], r1); diff --git a/arm64/abi.c b/arm64/abi.c index f37c892..db794f6 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -144,6 +144,7 @@ sttmps(Ref tmp[], int cls[], uint nreg, Ref mem, Fn *fn) } } +/* todo, may read out of bounds */ static void ldregs(int reg[], int cls[], int n, Ref mem, Fn *fn) { From 6838496e5c990339755577eb16b949fe2f47790e Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 2 Jul 2019 20:32:09 -0700 Subject: [PATCH 235/286] fold: Don't fold invalid addition/subtraction rather than failing This may happen in a branch QBE doesn't realize is unreachable, for example (simplified from real code found in ncurses) data $str = { b "abcdef", b 0 } function l $f(w %x) { @start %.1 =w ceqw %x, 0 jnz %.1, @logic_join, @logic_right @logic_right %p =l call $strchr(l $str, w %x) %.2 =w ceql %p, 0 @logic_join %.3 =w phi @start %.1, @logic_right %.2 jnz %.3, @fail, @return @fail ret 0 @return %.4 =l sub %p, $str ret %.4 } --- fold.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fold.c b/fold.c index 2081a72..5c09469 100644 --- a/fold.c +++ b/fold.c @@ -343,7 +343,7 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) if (op == Oadd) { if (cl->type == CAddr) { if (cr->type == CAddr) - err("undefined addition (addr + addr)"); + return 1; lab = cl->label; typ = CAddr; } @@ -358,10 +358,10 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) lab = cl->label; typ = CAddr; } else if (cl->label != cr->label) - err("undefined substraction (addr1 - addr2)"); + return 1; } else if (cr->type == CAddr) - err("undefined substraction (num - addr)"); + return 1; } else if (cl->type == CAddr || cr->type == CAddr) { if (Ocmpl <= op && op <= Ocmpl1) From 49fb63ebac93dd5e23a65ceac8ce72dfa845d7fa Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Wed, 10 Nov 2021 23:18:09 +0100 Subject: [PATCH 236/286] bump NString --- all.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all.h b/all.h index 37980d3..f49b4ef 100644 --- a/all.h +++ b/all.h @@ -31,7 +31,7 @@ typedef struct Dat Dat; typedef struct Target Target; enum { - NString = 64, + NString = 72, NIns = 1 << 20, NAlign = 3, NField = 32, From b0f16dad64d14f36ffe235b2e9cca96aa3ce35ba Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 16 Jun 2019 01:38:27 -0700 Subject: [PATCH 237/286] fold: Prevent error when address is used as operand --- fold.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fold.c b/fold.c index 5c09469..50a862e 100644 --- a/fold.c +++ b/fold.c @@ -363,11 +363,8 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) else if (cr->type == CAddr) return 1; } - else if (cl->type == CAddr || cr->type == CAddr) { - if (Ocmpl <= op && op <= Ocmpl1) - return 1; - err("invalid address operand for '%s'", optab[op].name); - } + else if (cl->type == CAddr || cr->type == CAddr) + return 1; switch (op) { case Oadd: x = l.u + r.u; break; case Osub: x = l.u - r.u; break; From bf153b359e9ce3ebef9bca899eb7ed5bd9045c11 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 18 Nov 2021 01:45:27 -0800 Subject: [PATCH 238/286] reuse previous address constants in fold() parseref() has code to reuse address constants, but this is not done in other passes such as fold or isel. Introduce a new function newcon() which takes a Con and returns a Ref for that constant, and use this whenever creating address constants. This is necessary to fix folding of address constants when one operand is already folded. For example, in %a =l add $x, 1 %b =l add %a, 2 %c =w loadw %b %a and %b were folded to $x+1 and $x+3 respectively, but then the second add is visited again since it uses %a. This gets folded to $x+3 as well, but as a new distinct constant. This results in %b getting labeled as bottom instead of either constant, disabling the replacement of %b by a constant in subsequent instructions (such as the loadw). --- all.h | 1 + amd64/isel.c | 7 ++----- fold.c | 12 +++--------- load.c | 15 +++++++-------- parse.c | 10 +--------- util.c | 19 +++++++++++++++++++ 6 files changed, 33 insertions(+), 31 deletions(-) diff --git a/all.h b/all.h index f49b4ef..98b77dd 100644 --- a/all.h +++ b/all.h @@ -431,6 +431,7 @@ int clsmerge(short *, short); int phicls(int, Tmp *); Ref newtmp(char *, int, Fn *); void chuse(Ref, int, Fn *); +Ref newcon(Con *, Fn *); Ref getcon(int64_t, Fn *); int addcon(Con *, Con *); void blit(Ref, uint, Ref, uint, Fn *); diff --git a/amd64/isel.c b/amd64/isel.c index 607c176..0f4c7a5 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -117,12 +117,9 @@ fixarg(Ref *r, int k, Ins *i, Fn *fn) m = &fn->mem[r0.val]; if (req(m->base, R)) if (m->offset.type == CAddr) { - n = fn->ncon; - vgrow(&fn->con, ++fn->ncon); - fn->con[n] = m->offset; - m->offset.type = CUndef; r0 = newtmp("isel", Kl, fn); - emit(Oaddr, Kl, r0, CON(n), R); + emit(Oaddr, Kl, r0, newcon(&m->offset, fn), R); + m->offset.type = CUndef; m->base = r0; } } diff --git a/fold.c b/fold.c index 50a862e..348e532 100644 --- a/fold.c +++ b/fold.c @@ -496,7 +496,7 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) static int opfold(int op, int cls, Con *cl, Con *cr, Fn *fn) { - int nc; + Ref r; Con c; if ((op == Odiv || op == Oudiv @@ -507,13 +507,7 @@ opfold(int op, int cls, Con *cl, Con *cr, Fn *fn) return Bot; } else foldflt(&c, op, cls == Kd, cl, cr); - if (c.type == CBits) - nc = getcon(c.bits.i, fn).val; - else { - nc = fn->ncon; - vgrow(&fn->con, ++fn->ncon); - } + r = newcon(&c, fn); assert(!(cls == Ks || cls == Kd) || c.flt); - fn->con[nc] = c; - return nc; + return r.val; } diff --git a/load.c b/load.c index 5d61a6c..2e10a35 100644 --- a/load.c +++ b/load.c @@ -118,7 +118,8 @@ load(Slice sl, bits msk, Loc *l) { Alias *a; Ref r, r1; - int ld, cls, all, c; + int ld, cls, all; + Con c; ld = (int[]){ [1] = Oloadub, @@ -151,13 +152,11 @@ load(Slice sl, bits msk, Loc *l) break; case ACon: case ASym: - c = curf->ncon++; - vgrow(&curf->con, curf->ncon); - curf->con[c].type = CAddr; - curf->con[c].label = a->label; - curf->con[c].bits.i = a->offset; - curf->con[c].local = 0; - r = CON(c); + c.type = CAddr; + c.label = a->label; + c.bits.i = a->offset; + c.local = 0; + r = newcon(&c, curf); break; } } diff --git a/parse.c b/parse.c index 104ca1d..6e22e1f 100644 --- a/parse.c +++ b/parse.c @@ -381,7 +381,6 @@ static Ref parseref() { Con c; - int i; memset(&c, 0, sizeof c); switch (next()) { @@ -405,14 +404,7 @@ parseref() c.type = CAddr; c.label = intern(tokval.str); Look: - for (i=0; incon; i++) - if (curf->con[i].type == c.type - && curf->con[i].bits.i == c.bits.i - && curf->con[i].label == c.label) - return CON(i); - vgrow(&curf->con, ++curf->ncon); - curf->con[i] = c; - return CON(i); + return newcon(&c, curf); default: return R; } diff --git a/util.c b/util.c index 9a3576a..c8b0b9c 100644 --- a/util.c +++ b/util.c @@ -349,6 +349,25 @@ chuse(Ref r, int du, Fn *fn) fn->tmp[r.val].nuse += du; } +Ref +newcon(Con *c0, Fn *fn) +{ + Con *c1; + int i; + + for (i=0; incon; i++) { + c1 = &fn->con[i]; + if (c0->type == c1->type + && c0->bits.i == c1->bits.i + && c0->label == c1->label + && c0->local == c1->local) + return CON(i); + } + vgrow(&fn->con, ++fn->ncon); + fn->con[i] = *c0; + return CON(i); +} + Ref getcon(int64_t val, Fn *fn) { From 367c8215d99054892740ad74c690b106c45ebf60 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 5 Dec 2021 21:25:00 +0100 Subject: [PATCH 239/286] arm64: fix slots with offset >32k When slots are used with a large offset, the emitter generates invalid assembly code. That is caught later on by the assembler, but it prevents compilation of programs with large stack frames. When a slot offset is too large to be expressed as a constant offset to x29 (the frame pointer), emitins() inserts a late Oaddr instruction to x16 and replaces the large slot reference with x16. This change also gave me the opportunity to refactor the save/restore logic for callee-save registers. This fixes the following Hare issue: https://todo.sr.ht/~sircmpwn/hare/387 --- arm64/emit.c | 88 ++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index 752b455..bd0ebdc 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -228,7 +228,7 @@ emitf(char *s, Ins *i, E *e) fprintf(e->f, "[%s]", rname(r.val, Kl)); break; case RSlot: - fprintf(e->f, "[sp, %"PRIu64"]", slot(r.val, e)); + fprintf(e->f, "[x29, %"PRIu64"]", slot(r.val, e)); break; } break; @@ -276,6 +276,26 @@ loadcon(Con *c, int r, int k, FILE *f) } } +static void emitins(Ins *, E *); + +static void +fixarg(Ref *pr, E *e) +{ + Ins *i; + Ref r; + uint64_t s; + + r = *pr; + if (rtype(r) == RSlot) { + s = slot(r.val, e); + if (s > 32760) { + i = &(Ins){Oaddr, Kl, TMP(IP0), {r}}; + emitins(i, e); + *pr = TMP(IP0); + } + } +} + static void emitins(Ins *i, E *e) { @@ -285,6 +305,10 @@ emitins(Ins *i, E *e) switch (i->op) { default: + if (isload(i->op)) + fixarg(&i->arg[0], e); + if (isstore(i->op)) + fixarg(&i->arg[1], e); Table: /* most instructions are just pulled out of * the table omap[], some special cases are @@ -409,9 +433,9 @@ arm64_emitfn(Fn *fn, FILE *out) #undef X }; static int id0; - int n, c, lbl, *r; + int s, n, c, lbl, *r; uint64_t o; - Blk *b, *s; + Blk *b, *t; Ins *i; E *e; @@ -457,28 +481,13 @@ arm64_emitfn(Fn *fn, FILE *out) e->frame & 0xFFFF, e->frame >> 16 ); fputs("\tadd\tx29, sp, 0\n", e->f); - for (o=e->frame+16, r=arm64_rclob; *r>=0; r++) + s = (e->frame - e->padding) / 4; + for (r=arm64_rclob; *r>=0; r++) if (e->fn->reg & BIT(*r)) { - if (o <= 32760) - fprintf(e->f, - "\tstr\t%s, [sp, %"PRIu64"]\n", - rname(*r, Kx), o -= 8 - ); - else if (o <= 65535) - fprintf(e->f, - "\tmov\tx16, #%"PRIu64"\n" - "\tstr\t%s, [sp, x16]\n", - o -= 8, rname(*r, Kx) - ); - else { - o -= 8; - fprintf(e->f, - "\tmov\tx16, #%"PRIu64"\n" - "\tmovk\tx16, #%"PRIu64", lsl #16\n" - "\tstr\t%s, [sp, x16]\n", - o & 0xFFFF, o >> 16, rname(*r, Kx) - ); - } + s -= 2; + i = &(Ins){.arg = {TMP(*r), SLOT(s)}}; + i->op = *r >= V0 ? Ostored : Ostorel; + emitins(i, e); } for (lbl=0, b=e->fn->start; b; b=b->link) { @@ -489,28 +498,13 @@ arm64_emitfn(Fn *fn, FILE *out) lbl = 1; switch (b->jmp.type) { case Jret0: - for (o=e->frame+16, r=arm64_rclob; *r>=0; r++) + s = (e->frame - e->padding) / 4; + for (r=arm64_rclob; *r>=0; r++) if (e->fn->reg & BIT(*r)) { - if (o <= 32760) - fprintf(e->f, - "\tldr\t%s, [sp, %"PRIu64"]\n", - rname(*r, Kx), o -= 8 - ); - else if (o <= 65535) - fprintf(e->f, - "\tmov\tx16, #%"PRIu64"\n" - "\tldr\t%s, [sp, x16]\n", - o -= 8, rname(*r, Kx) - ); - else { - o -= 8; - fprintf(e->f, - "\tmov\tx16, #%"PRIu64"\n" - "\tmovk\tx16, #%"PRIu64", lsl #16\n" - "\tldr\t%s, [sp, x16]\n", - o & 0xFFFF, o >> 16, rname(*r, Kx) - ); - } + s -= 2; + i = &(Ins){Oload, 0, TMP(*r), {SLOT(s)}}; + i->cls = *r >= V0 ? Kd : Kl; + emitins(i, e); } o = e->frame + 16; if (e->fn->vararg) @@ -555,9 +549,9 @@ arm64_emitfn(Fn *fn, FILE *out) if (c < 0 || c > NCmp) die("unhandled jump %d", b->jmp.type); if (b->link == b->s2) { - s = b->s1; + t = b->s1; b->s1 = b->s2; - b->s2 = s; + b->s2 = t; } else c = cmpneg(c); fprintf(e->f, "\tb%s\t.L%d\n", ctoa[c], id0+b->s2->id); From e91d12158122b23271ff49de8977c92fef7f3908 Mon Sep 17 00:00:00 2001 From: Eyal Sawady Date: Mon, 17 Jan 2022 22:00:48 +0000 Subject: [PATCH 240/286] Add a negation instruction Necessary for floating-point negation, because `%result = sub 0, %operand` doesn't give the correct sign for 0/-0. --- amd64/emit.c | 29 ++++++++++++++++++----------- amd64/isel.c | 1 + arm64/emit.c | 2 ++ doc/il.txt | 1 + fold.c | 3 +++ ops.h | 1 + parse.c | 2 +- tools/lexh.c | 2 +- 8 files changed, 28 insertions(+), 13 deletions(-) diff --git a/amd64/emit.c b/amd64/emit.c index a888000..4cb340d 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -365,6 +365,7 @@ emitins(Ins i, Fn *fn, FILE *f) Ref r; int64_t val; int o, t0; + Ins ineg; switch (i.op) { default: @@ -376,7 +377,7 @@ emitins(Ins i, Fn *fn, FILE *f) /* this linear search should really be a binary * search */ if (omap[o].op == NOp) - die("no match for %s(%d)", + die("no match for %s(%c)", optab[i.op].name, "wlsd"[i.cls]); if (omap[o].op == i.op) if (omap[o].cls == i.cls @@ -409,20 +410,26 @@ emitins(Ins i, Fn *fn, FILE *f) /* we have to use the negation trick to handle * some 3-address subtractions */ if (req(i.to, i.arg[1]) && !req(i.arg[0], i.to)) { - if (KBASE(i.cls) == 0) - emitf("neg%k %=", &i, fn, f); - else - fprintf(f, - "\txorp%c %sfp%d(%%rip), %%%s\n", - "xxsd"[i.cls], - gasloc, - gasstash(negmask[i.cls], 16), - regtoa(i.to.val, SLong) - ); + ineg = (Ins){Oneg, i.cls, i.to, {i.to}}; + emitins(ineg, fn, f); emitf("add%k %0, %=", &i, fn, f); break; } goto Table; + case Oneg: + if (!req(i.to, i.arg[0])) + emitf("mov%k %0, %=", &i, fn, f); + if (KBASE(i.cls) == 0) + emitf("neg%k %=", &i, fn, f); + else + fprintf(f, + "\txorp%c %sfp%d(%%rip), %%%s\n", + "xxsd"[i.cls], + gasloc, + gasstash(negmask[i.cls], 16), + regtoa(i.to.val, SLong) + ); + break; case Odiv: /* use xmm15 to adjust the instruction when the * conversion to 2-address in emitf() would fail */ diff --git a/amd64/isel.c b/amd64/isel.c index 0f4c7a5..404b714 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -290,6 +290,7 @@ sel(Ins i, ANum *an, Fn *fn) case Ocopy: case Oadd: case Osub: + case Oneg: case Omul: case Oand: case Oor: diff --git a/arm64/emit.c b/arm64/emit.c index bd0ebdc..de1859b 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -43,6 +43,8 @@ static struct { { Oadd, Ka, "fadd %=, %0, %1" }, { Osub, Ki, "sub %=, %0, %1" }, { Osub, Ka, "fsub %=, %0, %1" }, + { Oneg, Ki, "neg %=, %0" }, + { Oneg, Ka, "fneg %=, %0" }, { Oand, Ki, "and %=, %0, %1" }, { Oor, Ki, "orr %=, %0, %1" }, { Oxor, Ki, "eor %=, %0, %1" }, diff --git a/doc/il.txt b/doc/il.txt index 87a4d9f..48ecb23 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -524,6 +524,7 @@ return type used is long, the argument must be of type double. ~~~~~~~~~~~~~~~~~~~~~ * `add`, `sub`, `div`, `mul` -- `T(T,T)` + * `neg` -- `T(T)` * `udiv`, `rem`, `urem` -- `I(I,I)` * `or`, `xor`, `and` -- `I(I,I)` * `sar`, `shr`, `shl` -- `I(I,ww)` diff --git a/fold.c b/fold.c index 348e532..9923f75 100644 --- a/fold.c +++ b/fold.c @@ -368,6 +368,7 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) switch (op) { case Oadd: x = l.u + r.u; break; case Osub: x = l.u - r.u; break; + case Oneg: x = -l.u; break; case Odiv: x = w ? l.s / r.s : (int32_t)l.s / (int32_t)r.s; break; case Orem: x = w ? l.s % r.s : (int32_t)l.s % (int32_t)r.s; break; case Oudiv: x = w ? l.u / r.u : (uint32_t)l.u / (uint32_t)r.u; break; @@ -464,6 +465,7 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) switch (op) { case Oadd: xd = ld + rd; break; case Osub: xd = ld - rd; break; + case Oneg: xd = -ld; break; case Odiv: xd = ld / rd; break; case Omul: xd = ld * rd; break; case Oswtof: xd = (int32_t)cl->bits.i; break; @@ -480,6 +482,7 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) switch (op) { case Oadd: xs = ls + rs; break; case Osub: xs = ls - rs; break; + case Oneg: xs = -ls; break; case Odiv: xs = ls / rs; break; case Omul: xs = ls * rs; break; case Oswtof: xs = (int32_t)cl->bits.i; break; diff --git a/ops.h b/ops.h index 535be71..0729d46 100644 --- a/ops.h +++ b/ops.h @@ -15,6 +15,7 @@ /* Arithmetic and Bits */ O(add, T(w,l,s,d, w,l,s,d), 1) X(2, 1, 0) O(sub, T(w,l,s,d, w,l,s,d), 1) X(2, 1, 0) +O(neg, T(w,l,s,d, x,x,x,x), 1) X(1, 1, 0) O(div, T(w,l,s,d, w,l,s,d), 1) X(0, 0, 0) O(rem, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) O(udiv, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) diff --git a/parse.c b/parse.c index 6e22e1f..c05c370 100644 --- a/parse.c +++ b/parse.c @@ -109,7 +109,7 @@ enum { TMask = 16383, /* for temps hash */ BMask = 8191, /* for blocks hash */ - K = 3233235, /* found using tools/lexh.c */ + K = 4331239, /* found using tools/lexh.c */ M = 23, }; diff --git a/tools/lexh.c b/tools/lexh.c index 2ebb022..3c5ae24 100644 --- a/tools/lexh.c +++ b/tools/lexh.c @@ -8,7 +8,7 @@ char *tok[] = { - "add", "sub", "div", "rem", "udiv", "urem", "mul", + "add", "sub", "neg", "div", "rem", "udiv", "urem", "mul", "and", "or", "xor", "sar", "shr", "shl", "stored", "stores", "storel", "storew", "storeh", "storeb", "load", "loadsw", "loaduw", "loadsh", "loaduh", From 55a1522b555c3b9f8745285e9ce3009c2f9b30ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bor=20Gro=C5=A1elj=20Simi=C4=87?= Date: Wed, 19 Jan 2022 15:03:59 +0100 Subject: [PATCH 241/286] check for fopen() errors for output file --- main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index abef591..a52551e 100644 --- a/main.c +++ b/main.c @@ -126,8 +126,13 @@ main(int ac, char *av[]) } break; case 'o': - if (strcmp(optarg, "-") != 0) + if (strcmp(optarg, "-") != 0) { outf = fopen(optarg, "w"); + if (!outf) { + fprintf(stderr, "cannot open '%s'\n", optarg); + exit(1); + } + } break; case 't': for (tm=tmap;; tm++) { From 49654f82adc9cd1de6b5196dd4efd683c542215f Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 23 Jan 2022 13:38:37 +0100 Subject: [PATCH 242/286] bump copyright year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index c91118d..0d1a5ca 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -© 2015-2019 Quentin Carbonneaux +© 2015-2022 Quentin Carbonneaux Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), From b0d27d8a019811d6a4e0c0cb7ec804ab27fcec80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bor=20Gro=C5=A1elj=20Simi=C4=87?= Date: Wed, 19 Jan 2022 03:33:12 +0100 Subject: [PATCH 243/286] increase token limit to 255 --- parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index c05c370..e5143ce 100644 --- a/parse.c +++ b/parse.c @@ -113,7 +113,7 @@ enum { M = 23, }; -static char lexh[1 << (32-M)]; +static uchar lexh[1 << (32-M)]; static FILE *inf; static char *inpath; static int thead; @@ -161,7 +161,7 @@ lexinit() for (i=0; i> M; From 74d022f975f22fda20c0d1fe09a3f6fc7680f64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bor=20Gro=C5=A1elj=20Simi=C4=87?= Date: Fri, 28 Jan 2022 02:06:17 +0100 Subject: [PATCH 244/286] implement unsigned -> float casts amd64 lacks an instruction for this so it has to be implemented with signed -> float casts: - Word casting is done by zero-extending the word to a long and then doing a regular signed cast. - Long casting is done by dividing by two with correct rounding if the highest bit is set and casting that to float, then adding 1 to mantissa with integer addition --- amd64/isel.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- arm64/emit.c | 2 ++ doc/il.txt | 10 +++++++--- fold.c | 4 ++++ ops.h | 2 ++ test/fpcnv.ssa | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 107 insertions(+), 5 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index 404b714..17ab86d 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -201,8 +201,8 @@ selcmp(Ref arg[2], int k, int swap, Fn *fn) static void sel(Ins i, ANum *an, Fn *fn) { - Ref r0, r1; - int x, k, kc, swap; + Ref r0, r1, tmp[7]; + int x, j, k, kc, swap; int64_t sz; Ins *i0, *i1; @@ -266,6 +266,47 @@ sel(Ins i, ANum *an, Fn *fn) emit(Ocopy, Kw, TMP(RCX), r0, R); fixarg(&i1->arg[0], argcls(&i, 0), i1, fn); break; + case Ouwtof: + r0 = newtmp("utof", Kl, fn); + emit(Osltof, k, i.to, r0, R); + emit(Oextuw, Kl, r0, i.arg[0], R); + fixarg(&curi->arg[0], k, curi, fn); + break; + case Oultof: + /* + %mask =l and %arg.0, 1 + %isbig =l shr %arg.0, 63 + %divided =l shr %arg.0, %isbig + %or =l or %mask, %divided + %float =d sltof %or + %cast =l cast %float + %addend =l shl %isbig, 52 + %sum =l add %cast, %addend + %result =d cast %sum + */ + r0 = newtmp("utof", k, fn); + if (k == Ks) + kc = Kw; + else + kc = Kl; + for (j=0; j<4; j++) + tmp[j] = newtmp("utof", Kl, fn); + for (; j<7; j++) + tmp[j] = newtmp("utof", kc, fn); + emit(Ocast, k, i.to, tmp[6], R); + emit(Oadd, kc, tmp[6], tmp[4], tmp[5]); + emit(Oshl, kc, tmp[5], tmp[1], getcon(k == Ks ? 23 : 52, fn)); + emit(Ocast, kc, tmp[4], r0, R); + + emit(Osltof, k, r0, tmp[3], R); + emit(Oor, Kl, tmp[3], tmp[0], tmp[2]); + emit(Oshr, Kl, tmp[2], i.arg[0], tmp[1]); + sel(*curi++, an, fn); + emit(Oshr, Kl, tmp[1], i.arg[0], getcon(63, fn)); + fixarg(&curi->arg[0], Kl, curi, fn); + emit(Oand, Kl, tmp[0], i.arg[0], getcon(1, fn)); + fixarg(&curi->arg[0], Kl, curi, fn); + break; case Onop: break; case Ostored: diff --git a/arm64/emit.c b/arm64/emit.c index de1859b..7cebcab 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -91,7 +91,9 @@ static struct { { Ostosi, Ka, "fcvtzs %=, %S0" }, { Odtosi, Ka, "fcvtzs %=, %D0" }, { Oswtof, Ka, "scvtf %=, %W0" }, + { Ouwtof, Ka, "ucvtf %=, %W0" }, { Osltof, Ka, "scvtf %=, %L0" }, + { Oultof, Ka, "ucvtf %=, %L0" }, { Ocall, Kw, "blr %L0" }, { Oacmp, Ki, "cmp %0, %1" }, diff --git a/doc/il.txt b/doc/il.txt index 48ecb23..818f0a4 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -698,7 +698,9 @@ or convert a floating point into an integer and vice versa. * `stosi` -- `I(ss)` * `dtosi` -- `I(dd)` * `swtof` -- `F(ww)` + * `uwtof` -- `F(ww)` * `sltof` -- `F(ll)` + * `ultof` -- `F(ll)` Extending the precision of a temporary is done using the `ext` family of instructions. Because QBE types do not @@ -717,9 +719,9 @@ zero. Converting between signed integers and floating points is done using `stosi` (single to signed integer), `dtosi` (double to signed integer), `swtof` (signed word to float), -and `sltof` (signed long to float). These instructions -only handle signed integers, conversion to and from -unsigned types are not yet supported. +`uwtof` (unsigned word to float), `sltof` (signed long +to float) and `ultof` (unsigned long to float). Conversion +from unsigned types is not yet supported. Because of <@ Subtyping >, there is no need to have an instruction to lower the precision of an integer temporary. @@ -990,8 +992,10 @@ instructions unless you know exactly what you are doing. * `extuh` * `extuw` * `sltof` + * `ultof` * `stosi` * `swtof` + * `uwtof` * `truncd` * <@ Cast and Copy > : diff --git a/fold.c b/fold.c index 9923f75..30e21d2 100644 --- a/fold.c +++ b/fold.c @@ -469,7 +469,9 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) case Odiv: xd = ld / rd; break; case Omul: xd = ld * rd; break; case Oswtof: xd = (int32_t)cl->bits.i; break; + case Ouwtof: xd = (uint32_t)cl->bits.i; break; case Osltof: xd = (int64_t)cl->bits.i; break; + case Oultof: xd = (uint64_t)cl->bits.i; break; case Oexts: xd = cl->bits.s; break; case Ocast: xd = ld; break; default: die("unreachable"); @@ -486,7 +488,9 @@ foldflt(Con *res, int op, int w, Con *cl, Con *cr) case Odiv: xs = ls / rs; break; case Omul: xs = ls * rs; break; case Oswtof: xs = (int32_t)cl->bits.i; break; + case Ouwtof: xs = (uint32_t)cl->bits.i; break; case Osltof: xs = (int64_t)cl->bits.i; break; + case Oultof: xs = (uint64_t)cl->bits.i; break; case Otruncd: xs = cl->bits.d; break; case Ocast: xs = ls; break; default: die("unreachable"); diff --git a/ops.h b/ops.h index 0729d46..04b0cf8 100644 --- a/ops.h +++ b/ops.h @@ -98,7 +98,9 @@ O(truncd, T(e,e,d,e, e,e,x,e), 1) X(0, 0, 1) O(stosi, T(s,s,e,e, x,x,e,e), 1) X(0, 0, 1) O(dtosi, T(d,d,e,e, x,x,e,e), 1) X(0, 0, 1) O(swtof, T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1) +O(uwtof, T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1) O(sltof, T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1) +O(ultof, T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1) O(cast, T(s,d,w,l, x,x,x,x), 1) X(0, 0, 1) /* Stack Allocation */ diff --git a/test/fpcnv.ssa b/test/fpcnv.ssa index d9851d8..4dac489 100644 --- a/test/fpcnv.ssa +++ b/test/fpcnv.ssa @@ -17,13 +17,62 @@ function d $ftrunc(d %f) { ret %rt } +export +function s $wtos(w %w) { +@start + %rt =s uwtof %w + ret %rt +} +export +function d $wtod(w %w) { +@start + %rt =d uwtof %w + ret %rt +} + +export +function s $ltos(l %l) { +@start + %rt =s ultof %l + ret %rt +} +export +function d $ltod(l %l) { +@start + %rt =d ultof %l + ret %rt +} + # >>> driver # extern float fneg(float); # extern double ftrunc(double); +# +# extern float wtos(unsigned int); +# extern double wtod(unsigned int); +# extern float ltos(long long unsigned int); +# extern double ltod(long long unsigned int); +# +# unsigned long long iin[] = { 0, 1, 16, 234987, 427386245, 0x7fff0000, +# 0xffff0000, 23602938196141, 72259248152500195, 9589010795705032704ull, +# 0xdcf5fbe299d0148aull, 0xffffffff00000000ull, -1 }; +# # int main() { +# int i; +# # if (fneg(1.23f) != -1.23f) return 1; # if (ftrunc(3.1415) != 3.0) return 2; # if (ftrunc(-1.234) != -1.0) return 3; +# +# for (i=0; i Date: Fri, 28 Jan 2022 02:06:18 +0100 Subject: [PATCH 245/286] implement float -> unsigned casts amd64 lacks instruction for this so it has to be implemented with float -> signed casts. The approach is borrowed from llvm. --- amd64/isel.c | 26 +++++++++++++++++++++++++ arm64/emit.c | 2 ++ doc/il.txt | 16 ++++++++++------ fold.c | 2 ++ ops.h | 2 ++ test/fpcnv.ssa | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 93 insertions(+), 6 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index 17ab86d..570bff6 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -307,6 +307,32 @@ sel(Ins i, ANum *an, Fn *fn) emit(Oand, Kl, tmp[0], i.arg[0], getcon(1, fn)); fixarg(&curi->arg[0], Kl, curi, fn); break; + case Ostoui: + i.op = Ostosi; + r0 = newtmp("ftou", Ks, fn); + goto Oftoui; + case Odtoui: + i.op = Odtosi; + r0 = newtmp("ftou", Kd, fn); + Oftoui: + if (k == Kw) { + goto Emit; + } + for (j=0; j<4; j++) + tmp[j] = newtmp("ftou", Kl, fn); + emit(Oor, Kl, i.to, tmp[0], tmp[3]); + emit(Oand, Kl, tmp[3], tmp[2], tmp[1]); + emit(i.op, Kl, tmp[2], r0, R); + if (i.op == Ostosi) + emit(Oadd, Ks, r0, getcon(0xdf000000, fn), i.arg[0]); + else + emit(Oadd, Kd, r0, getcon(0xc3e0000000000000, fn), i.arg[0]); + i1 = curi; + fixarg(&i1->arg[0], i.op == Ostosi ? Ks : Kd, i1, fn); + fixarg(&i1->arg[1], i.op == Ostosi ? Ks : Kd, i1, fn); + emit(Osar, Kl, tmp[1], tmp[0], getcon(63, fn)); + emit(i.op, Kl, tmp[0], i.arg[0], R); + fixarg(&curi->arg[0], Kl, curi, fn); case Onop: break; case Ostored: diff --git a/arm64/emit.c b/arm64/emit.c index 7cebcab..70384c0 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -89,7 +89,9 @@ static struct { { Ocast, Ks, "fmov %=, %W0" }, { Ocast, Kd, "fmov %=, %L0" }, { Ostosi, Ka, "fcvtzs %=, %S0" }, + { Ostoui, Ka, "fcvtzu %=, %S0" }, { Odtosi, Ka, "fcvtzs %=, %D0" }, + { Odtoui, Ka, "fcvtzu %=, %D0" }, { Oswtof, Ka, "scvtf %=, %W0" }, { Ouwtof, Ka, "ucvtf %=, %W0" }, { Osltof, Ka, "scvtf %=, %L0" }, diff --git a/doc/il.txt b/doc/il.txt index 818f0a4..2236340 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -696,7 +696,9 @@ or convert a floating point into an integer and vice versa. * `exts` -- `d(s)` * `truncd` -- `s(d)` * `stosi` -- `I(ss)` + * `stoui` -- `I(ss)` * `dtosi` -- `I(dd)` + * `dtoui` -- `I(dd)` * `swtof` -- `F(ww)` * `uwtof` -- `F(ww)` * `sltof` -- `F(ll)` @@ -716,12 +718,12 @@ argument of `truncd` cannot be represented as a single-precision floating point, it is truncated towards zero. -Converting between signed integers and floating points is -done using `stosi` (single to signed integer), `dtosi` -(double to signed integer), `swtof` (signed word to float), -`uwtof` (unsigned word to float), `sltof` (signed long -to float) and `ultof` (unsigned long to float). Conversion -from unsigned types is not yet supported. +Converting between signed integers and floating points is done +using `stosi` (single to signed integer), `stoui` (single to +unsigned integer`, `dtosi` (double to signed integer), `dtoui` +(double to unsigned integer), `swtof` (signed word to float), +`uwtof` (unsigned word to float), `sltof` (signed long to +float) and `ultof` (unsigned long to float). Because of <@ Subtyping >, there is no need to have an instruction to lower the precision of an integer temporary. @@ -984,6 +986,7 @@ instructions unless you know exactly what you are doing. * <@ Conversions >: * `dtosi` + * `dtoui` * `exts` * `extsb` * `extsh` @@ -994,6 +997,7 @@ instructions unless you know exactly what you are doing. * `sltof` * `ultof` * `stosi` + * `stoui` * `swtof` * `uwtof` * `truncd` diff --git a/fold.c b/fold.c index 30e21d2..5d3c83c 100644 --- a/fold.c +++ b/fold.c @@ -387,7 +387,9 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) case Oextsw: x = (int32_t)l.u; break; case Oextuw: x = (uint32_t)l.u; break; case Ostosi: x = w ? (int64_t)cl->bits.s : (int32_t)cl->bits.s; break; + case Ostoui: x = w ? (uint64_t)cl->bits.s : (uint32_t)cl->bits.s; break; case Odtosi: x = w ? (int64_t)cl->bits.d : (int32_t)cl->bits.d; break; + case Odtoui: x = w ? (uint64_t)cl->bits.d : (uint32_t)cl->bits.d; break; case Ocast: x = l.u; if (cl->type == CAddr) { diff --git a/ops.h b/ops.h index 04b0cf8..9f02262 100644 --- a/ops.h +++ b/ops.h @@ -96,7 +96,9 @@ O(extuw, T(e,w,e,e, e,x,e,e), 1) X(0, 0, 1) O(exts, T(e,e,e,s, e,e,e,x), 1) X(0, 0, 1) O(truncd, T(e,e,d,e, e,e,x,e), 1) X(0, 0, 1) O(stosi, T(s,s,e,e, x,x,e,e), 1) X(0, 0, 1) +O(stoui, T(s,s,e,e, x,x,e,e), 1) X(0, 0, 1) O(dtosi, T(d,d,e,e, x,x,e,e), 1) X(0, 0, 1) +O(dtoui, T(d,d,e,e, x,x,e,e), 1) X(0, 0, 1) O(swtof, T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1) O(uwtof, T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1) O(sltof, T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1) diff --git a/test/fpcnv.ssa b/test/fpcnv.ssa index 4dac489..3036168 100644 --- a/test/fpcnv.ssa +++ b/test/fpcnv.ssa @@ -43,7 +43,37 @@ function d $ltod(l %l) { ret %rt } +export +function w $stow(s %f) { +@start + %rt =w stoui %f + ret %rt +} +export +function w $dtow(d %f) { +@start + %rt =w dtoui %f + ret %rt +} + +export +function l $stol(s %f) { +@start + %rt =l stoui %f + ret %rt +} +export +function l $dtol(d %f) { +@start + %rt =l dtoui %f + ret %rt +} + + + # >>> driver +# #include +# # extern float fneg(float); # extern double ftrunc(double); # @@ -52,10 +82,19 @@ function d $ltod(l %l) { # extern float ltos(long long unsigned int); # extern double ltod(long long unsigned int); # +# extern unsigned int stow(float); +# extern unsigned int dtow(double); +# extern unsigned long long stol(float); +# extern unsigned long long dtol(double); +# # unsigned long long iin[] = { 0, 1, 16, 234987, 427386245, 0x7fff0000, # 0xffff0000, 23602938196141, 72259248152500195, 9589010795705032704ull, # 0xdcf5fbe299d0148aull, 0xffffffff00000000ull, -1 }; # +# double fin[] = { 0.17346516197824458, 442.0760005466251, 4342856.879893436, +# 98547543006.49626, 236003043787688.3, 9.499222733527032e+18, +# 1.1936266170755652e+19 }; +# # int main() { # int i; # @@ -72,6 +111,18 @@ function d $ltod(l %l) { # return 6; # if (ltod(iin[i]) != (double)iin[i]) # return 7; +# } +# for (i=0; i UINT_MAX) +# continue; +# if (stow((float)fin[i]) != (unsigned int)(float)fin[i]) +# return 10; +# if (dtow(fin[i]) != (unsigned int)fin[i]) +# return 11; # } # return 0; # } From 2fd3a95d6f984b10b7169dbaa47f6b81324a2755 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 28 Jan 2022 11:07:07 +0100 Subject: [PATCH 246/286] update token hash params --- parse.c | 2 +- tools/lexh.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index e5143ce..e97b196 100644 --- a/parse.c +++ b/parse.c @@ -109,7 +109,7 @@ enum { TMask = 16383, /* for temps hash */ BMask = 8191, /* for blocks hash */ - K = 4331239, /* found using tools/lexh.c */ + K = 5041217, /* found using tools/lexh.c */ M = 23, }; diff --git a/tools/lexh.c b/tools/lexh.c index 3c5ae24..8d0af21 100644 --- a/tools/lexh.c +++ b/tools/lexh.c @@ -14,7 +14,8 @@ char *tok[] = { "load", "loadsw", "loaduw", "loadsh", "loaduh", "loadsb", "loadub", "extsw", "extuw", "extsh", "extuh", "extsb", "extub", "exts", "truncd", - "stosi", "dtosi", "swtof", "sltof", "cast", "copy", + "stosi", "dtosi", "stoui", "dtoui", "uwtof", + "ultof", "swtof", "sltof", "cast", "copy", "alloc4", "alloc8", "alloc16", "culew", "cultw", "cslew", "csltw", "csgtw", "csgew", "cugtw", "cugew", "ceqw", "cnew", "culel", "cultl", "cslel", From 8403dcb709fc013197a9f4af72e67d9ae0c99a03 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 28 Jan 2022 11:08:06 +0100 Subject: [PATCH 247/286] fix test/fpcnv (wrong spacing) --- test/fpcnv.ssa | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/fpcnv.ssa b/test/fpcnv.ssa index 3036168..aea67ac 100644 --- a/test/fpcnv.ssa +++ b/test/fpcnv.ssa @@ -72,36 +72,36 @@ function l $dtol(d %f) { # >>> driver -# #include -# +# #include +# # extern float fneg(float); # extern double ftrunc(double); -# +# # extern float wtos(unsigned int); # extern double wtod(unsigned int); # extern float ltos(long long unsigned int); # extern double ltod(long long unsigned int); -# +# # extern unsigned int stow(float); # extern unsigned int dtow(double); # extern unsigned long long stol(float); # extern unsigned long long dtol(double); -# +# # unsigned long long iin[] = { 0, 1, 16, 234987, 427386245, 0x7fff0000, # 0xffff0000, 23602938196141, 72259248152500195, 9589010795705032704ull, # 0xdcf5fbe299d0148aull, 0xffffffff00000000ull, -1 }; -# +# # double fin[] = { 0.17346516197824458, 442.0760005466251, 4342856.879893436, # 98547543006.49626, 236003043787688.3, 9.499222733527032e+18, # 1.1936266170755652e+19 }; -# +# # int main() { # int i; -# +# # if (fneg(1.23f) != -1.23f) return 1; # if (ftrunc(3.1415) != 3.0) return 2; # if (ftrunc(-1.234) != -1.0) return 3; -# +# # for (i=0; i Date: Fri, 28 Jan 2022 11:10:16 +0100 Subject: [PATCH 248/286] amd64/isel: nits --- amd64/isel.c | 52 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index 570bff6..4181e26 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -202,7 +202,7 @@ static void sel(Ins i, ANum *an, Fn *fn) { Ref r0, r1, tmp[7]; - int x, j, k, kc, swap; + int x, j, k, kc, sh, swap; int64_t sz; Ins *i0, *i1; @@ -273,35 +273,33 @@ sel(Ins i, ANum *an, Fn *fn) fixarg(&curi->arg[0], k, curi, fn); break; case Oultof: - /* - %mask =l and %arg.0, 1 - %isbig =l shr %arg.0, 63 - %divided =l shr %arg.0, %isbig - %or =l or %mask, %divided - %float =d sltof %or - %cast =l cast %float - %addend =l shl %isbig, 52 - %sum =l add %cast, %addend - %result =d cast %sum + /* %mask =l and %arg.0, 1 + %isbig =l shr %arg.0, 63 + %divided =l shr %arg.0, %isbig + %or =l or %mask, %divided + %float =d sltof %or + %cast =l cast %float + %addend =l shl %isbig, 52 + %sum =l add %cast, %addend + %result =d cast %sum */ r0 = newtmp("utof", k, fn); if (k == Ks) - kc = Kw; + kc = Kw, sh = 23; else - kc = Kl; + kc = Kl, sh = 52; for (j=0; j<4; j++) tmp[j] = newtmp("utof", Kl, fn); for (; j<7; j++) tmp[j] = newtmp("utof", kc, fn); emit(Ocast, k, i.to, tmp[6], R); emit(Oadd, kc, tmp[6], tmp[4], tmp[5]); - emit(Oshl, kc, tmp[5], tmp[1], getcon(k == Ks ? 23 : 52, fn)); + emit(Oshl, kc, tmp[5], tmp[1], getcon(sh, fn)); emit(Ocast, kc, tmp[4], r0, R); - emit(Osltof, k, r0, tmp[3], R); emit(Oor, Kl, tmp[3], tmp[0], tmp[2]); emit(Oshr, Kl, tmp[2], i.arg[0], tmp[1]); - sel(*curi++, an, fn); + sel(*curi++, 0, fn); emit(Oshr, Kl, tmp[1], i.arg[0], getcon(63, fn)); fixarg(&curi->arg[0], Kl, curi, fn); emit(Oand, Kl, tmp[0], i.arg[0], getcon(1, fn)); @@ -309,30 +307,30 @@ sel(Ins i, ANum *an, Fn *fn) break; case Ostoui: i.op = Ostosi; - r0 = newtmp("ftou", Ks, fn); + kc = Ks; + tmp[4] = getcon(0xdf000000, fn); goto Oftoui; case Odtoui: i.op = Odtosi; - r0 = newtmp("ftou", Kd, fn); + kc = Kd; + tmp[4] = getcon(0xc3e0000000000000, fn); Oftoui: - if (k == Kw) { + if (k == Kw) goto Emit; - } + r0 = newtmp("ftou", kc, fn); for (j=0; j<4; j++) tmp[j] = newtmp("ftou", Kl, fn); emit(Oor, Kl, i.to, tmp[0], tmp[3]); emit(Oand, Kl, tmp[3], tmp[2], tmp[1]); emit(i.op, Kl, tmp[2], r0, R); - if (i.op == Ostosi) - emit(Oadd, Ks, r0, getcon(0xdf000000, fn), i.arg[0]); - else - emit(Oadd, Kd, r0, getcon(0xc3e0000000000000, fn), i.arg[0]); - i1 = curi; - fixarg(&i1->arg[0], i.op == Ostosi ? Ks : Kd, i1, fn); - fixarg(&i1->arg[1], i.op == Ostosi ? Ks : Kd, i1, fn); + emit(Oadd, kc, r0, tmp[4], i.arg[0]); + i1 = curi; /* fixarg() can change curi */ + fixarg(&i1->arg[0], kc, i1, fn); + fixarg(&i1->arg[1], kc, i1, fn); emit(Osar, Kl, tmp[1], tmp[0], getcon(63, fn)); emit(i.op, Kl, tmp[0], i.arg[0], R); fixarg(&curi->arg[0], Kl, curi, fn); + break; case Onop: break; case Ostored: From a32ecfb452d4d1f4ae64d5d7e9284dda1e6a20df Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Fri, 28 Jan 2022 22:42:25 +0100 Subject: [PATCH 249/286] Do not use the asm keyword as a local variable Signed-off-by: Detlef Riekenberg --- main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index a52551e..83f08ba 100644 --- a/main.c +++ b/main.c @@ -111,9 +111,9 @@ main(int ac, char *av[]) struct TMap *tm; FILE *inf, *hf; char *f, *sep; - int c, asm; + int c, asmmode; - asm = Defasm; + asmmode = Defasm; T = Deftgt; outf = stdout; while ((c = getopt(ac, av, "hd:o:G:t:")) != -1) @@ -148,9 +148,9 @@ main(int ac, char *av[]) break; case 'G': if (strcmp(optarg, "e") == 0) - asm = Gaself; + asmmode = Gaself; else if (strcmp(optarg, "m") == 0) - asm = Gasmacho; + asmmode = Gasmacho; else { fprintf(stderr, "unknown gas flavor '%s'\n", optarg); exit(1); @@ -172,7 +172,7 @@ main(int ac, char *av[]) exit(c != 'h'); } - switch (asm) { + switch (asmmode) { case Gaself: gasloc = ".L"; gassym = ""; @@ -200,7 +200,7 @@ main(int ac, char *av[]) if (!dbg) { gasemitfin(outf); - if (asm == Gaself) + if (asmmode == Gaself) fprintf(outf, ".section .note.GNU-stack,\"\",@progbits\n"); } From 20ee522ce8c4d1ffdd7b6e24a4f7af587c35404a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 31 Jan 2022 13:48:52 +0100 Subject: [PATCH 250/286] arm64: handle large slots in Ocopy --- arm64/emit.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/arm64/emit.c b/arm64/emit.c index 70384c0..9700abe 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -305,9 +305,10 @@ fixarg(Ref *pr, E *e) static void emitins(Ins *i, E *e) { - int o; char *rn; uint64_t s; + int o; + Ref r; switch (i->op) { default: @@ -338,18 +339,16 @@ emitins(Ins *i, E *e) if (req(i->to, i->arg[0])) break; if (rtype(i->to) == RSlot) { - switch (rtype(i->arg[0])) { - case RSlot: - emitf("ldr %?, %M0\n\tstr %?, %M=", i, e); - break; - case RCon: - loadcon(&e->fn->con[i->arg[0].val], R18, i->cls, e->f); - emitf("str %?, %M=", i, e); - break; - default: - assert(isreg(i->arg[0])); - emitf("str %0, %M=", i, e); + r = i->to; + if (!isreg(i->arg[0])) { + i->to = TMP(R18); + emitins(i, e); + i->arg[0] = i->to; } + i->op = Ostorew + i->cls; + i->cls = Kw; + i->arg[1] = r; + emitins(i, e); break; } assert(isreg(i->to)); @@ -358,9 +357,11 @@ emitins(Ins *i, E *e) loadcon(&e->fn->con[i->arg[0].val], i->to.val, i->cls, e->f); break; case RSlot: - emitf("ldr %=, %M0", i, e); + i->op = Oload; + emitins(i, e); break; default: + assert(i->to.val != R18); goto Table; } break; From 2ca6fb25a238842418019a3f9ee8d1beb1327f7e Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 31 Jan 2022 22:03:18 +0100 Subject: [PATCH 251/286] shared linkage logic for func/data --- all.h | 20 +++++++++---- amd64/emit.c | 13 ++------ arm64/emit.c | 6 +--- doc/il.txt | 65 ++++++++++++++++++++++++++++++++-------- gas.c | 48 +++++++++++++++++------------- parse.c | 83 ++++++++++++++++++++++++++++------------------------ 6 files changed, 143 insertions(+), 92 deletions(-) diff --git a/all.h b/all.h index 98b77dd..942c52d 100644 --- a/all.h +++ b/all.h @@ -28,6 +28,7 @@ typedef struct Fn Fn; typedef struct Typ Typ; typedef struct Field Field; typedef struct Dat Dat; +typedef struct Lnk Lnk; typedef struct Target Target; enum { @@ -327,6 +328,13 @@ struct Addr { /* amd64 addressing */ int scale; }; +struct Lnk { + char export; + char align; + char *sec; + char *secf; +}; + struct Fn { Blk *start; Tmp *tmp; @@ -341,10 +349,10 @@ struct Fn { Blk **rpo; bits reg; int slot; - char export; char vararg; char dynalloc; char name[NString]; + Lnk lnk; }; struct Typ { @@ -373,8 +381,6 @@ struct Dat { enum { DStart, DEnd, - DName, - DAlign, DB, DH, DW, @@ -387,13 +393,16 @@ struct Dat { float flts; char *str; struct { - char *nam; + char *name; int64_t off; } ref; + struct { + char *name; + Lnk *lnk; + } start; } u; char isref; char isstr; - char export; }; /* main.c */ @@ -516,6 +525,7 @@ void rega(Fn *); /* gas.c */ extern char *gasloc; extern char *gassym; +void gasemitlnk(char *, Lnk *, char *, FILE *); void gasemitdat(Dat *, FILE *); int gasstash(void *, int); void gasemitfin(FILE *); diff --git a/amd64/emit.c b/amd64/emit.c index 4cb340d..b8e9e8e 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -548,18 +548,9 @@ amd64_emitfn(Fn *fn, FILE *f) Ins *i, itmp; int *r, c, o, n, lbl; uint64_t fs; - char *p; - p = fn->name[0] == '"' ? "" : gassym; - fprintf(f, ".text\n"); - if (fn->export) - fprintf(f, ".globl %s%s\n", p, fn->name); - fprintf(f, - "%s%s:\n" - "\tpushq %%rbp\n" - "\tmovq %%rsp, %%rbp\n", - p, fn->name - ); + gasemitlnk(fn->name, &fn->lnk, ".text", f); + fputs("\tpushq %rbp\n\tmovq %rsp, %rbp\n", f); fs = framesz(fn); if (fs) fprintf(f, "\tsubq $%"PRIu64", %%rsp\n", fs); diff --git a/arm64/emit.c b/arm64/emit.c index 9700abe..b25f4f5 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -446,14 +446,10 @@ arm64_emitfn(Fn *fn, FILE *out) Ins *i; E *e; + gasemitlnk(fn->name, &fn->lnk, ".text", out); e = &(E){.f = out, .fn = fn}; framelayout(e); - fprintf(e->f, ".text\n"); - if (e->fn->export) - fprintf(e->f, ".globl %s\n", e->fn->name); - fprintf(e->f, "%s:\n", e->fn->name); - if (e->fn->vararg) { for (n=7; n>=0; n--) fprintf(e->f, "\tstr\tq%d, [sp, -16]!\n", n); diff --git a/doc/il.txt b/doc/il.txt index 2236340..b667b64 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -15,14 +15,15 @@ * <@ Simple Types > * <@ Subtyping > 3. <@ Constants > - 4. <@ Definitions > + 4. <@ Linkage > + 5. <@ Definitions > * <@ Aggregate Types > * <@ Data > * <@ Functions > - 5. <@ Control > + 6. <@ Control > * <@ Blocks > * <@ Jumps > - 6. <@ Instructions > + 7. <@ Instructions > * <@ Arithmetic and Bits > * <@ Memory > * <@ Comparisons > @@ -31,7 +32,7 @@ * <@ Call > * <@ Variadic > * <@ Phi > - 7. <@ Instructions Index > + 8. <@ Instructions Index > - 1. Basic Concepts ------------------- @@ -196,7 +197,46 @@ Global symbols can also be used directly as constants; they will be resolved and turned into actual numeric constants by the linker. -- 4. Definitions +- 4. Linkage +------------ + + `bnf + LINKAGE := + 'extern' + | 'section' SECNAME + | 'section' SECNAME SECFLAGS + + SECNAME := '"' .... '"' + SECFLAGS := '"' .... '"' + +Function and data definitions (see below) can specify +linkage information to be passed to the assembler and +eventually to the linker. + +The `extern` linkage flag marks the defined item as +visible outside the current file's scope. If absent, +the symbol can only be referred to locally. Functions +compiled by QBE and called from C need to have extern +linkage. + +A `section` flag can be specified to tell the linker to +put the defined item in a certain section. The use of +the section flag is platform dependent and we refer the +user to the documentation of their assembler and linker +for relevant information. + + export section ".bss" + data $zerobuf = { z 1024 } + +Example uses of the section flag include adding function +pointers to a global initialization list, or storing a +zeroed object in the BSS section, as depicted above. + +The section and extern linkage flags should each appear +at most once in a definition. If multiple occurrences +are present, QBE is free to use any. + +- 5. Definitions ---------------- Definitions are the essential components of an IL file. @@ -254,7 +294,7 @@ their size between curly braces. `bnf DATADEF := - ['export'] 'data' $IDENT '=' ['align' NUMBER] + LINKAGE* 'data' $IDENT '=' ['align' NUMBER] '{' ( EXTTY DATAITEM+ | 'z' NUMBER ), @@ -266,8 +306,9 @@ their size between curly braces. | CONST # Constant Data definitions express objects that will be emitted in the -compiled file. They can be local to the file or exported -with global visibility to the whole program. +compiled file. Their visibility and location in the compiled +artifact are controlled with linkage flags described in the +<@ Linkage > section. They define a global identifier (starting with the sigil `$`), that will contain a pointer to the object specified @@ -311,7 +352,7 @@ Here are various examples of data definitions. `bnf FUNCDEF := - ['export'] 'function' [ABITY] $IDENT '(' (PARAM), ')' + LINKAGE* 'function' [ABITY] $IDENT '(' (PARAM), ')' '{' BLOCK+ '}' @@ -384,7 +425,7 @@ is provided in the call instructions. The syntax and semantics for the body of functions are described in the <@ Control > section. -- 5. Control +- 6. Control ------------ The IL represents programs as textual transcriptions of @@ -465,7 +506,7 @@ the following list. prototype. If the function prototype does not specify a return type, no return value can be used. -- 6. Instructions +- 7. Instructions ----------------- Instructions are the smallest piece of code in the IL, they @@ -903,7 +944,7 @@ assumes that if a variable is defined by a phi it respects all the SSA invariants. So it is critical to not use phi instructions unless you know exactly what you are doing. -- 7. Instructions Index +- 8. Instructions Index ----------------------- * <@ Arithmetic and Bits >: diff --git a/gas.c b/gas.c index 8c31794..4400769 100644 --- a/gas.c +++ b/gas.c @@ -3,12 +3,31 @@ char *gasloc, *gassym; +void +gasemitlnk(char *n, Lnk *l, char *s, FILE *f) +{ + char *p; + + if (l->sec) { + fprintf(f, ".section %s", l->sec); + if (l->secf) + fprintf(f, ", %s", l->secf); + } else { + fputs(s, f); + } + fputc('\n', f); + if (l->align) + fprintf(f, ".balign %d\n", l->align); + p = n[0] == '"' ? "" : gassym; + if (l->export) + fprintf(f, ".globl %s%s\n", p, n); + fprintf(f, "%s%s:\n", p, n); +} + void gasemitdat(Dat *d, FILE *f) { - static int aligned; static char *dtoa[] = { - [DAlign] = ".balign", [DB] = "\t.byte", [DH] = "\t.short", [DW] = "\t.int", @@ -18,39 +37,26 @@ gasemitdat(Dat *d, FILE *f) switch (d->type) { case DStart: - aligned = 0; - if (d->u.str) { - fprintf(f, ".section %s\n", d->u.str); - } else { - fprintf(f, ".data\n"); - } + gasemitlnk( + d->u.start.name, + d->u.start.lnk, + ".data", f); break; case DEnd: break; - case DName: - if (!aligned) - fprintf(f, ".balign 8\n"); - p = d->u.str[0] == '"' ? "" : gassym; - if (d->export) - fprintf(f, ".globl %s%s\n", p, d->u.str); - fprintf(f, "%s%s:\n", p, d->u.str); - break; case DZ: fprintf(f, "\t.fill %"PRId64",1,0\n", d->u.num); break; default: - if (d->type == DAlign) - aligned = 1; - if (d->isstr) { if (d->type != DB) err("strings only supported for 'b' currently"); fprintf(f, "\t.ascii %s\n", d->u.str); } else if (d->isref) { - p = d->u.ref.nam[0] == '"' ? "" : gassym; + p = d->u.ref.name[0] == '"' ? "" : gassym; fprintf(f, "%s %s%s%+"PRId64"\n", - dtoa[d->type], p, d->u.ref.nam, + dtoa[d->type], p, d->u.ref.name, d->u.ref.off); } else { diff --git a/parse.c b/parse.c index e97b196..5e5ab66 100644 --- a/parse.c +++ b/parse.c @@ -792,7 +792,7 @@ typecheck(Fn *fn) } static Fn * -parsefn(int export) +parsefn(Lnk *lnk) { Blk *b; int i; @@ -812,7 +812,7 @@ parsefn(int export) else newtmp(0, Kl, curf); curf->con[0].type = CBits; - curf->export = export; + curf->lnk = *lnk; blink = &curf->start; curf->retty = Kx; if (peek() != Tglo) @@ -973,7 +973,7 @@ parsedatref(Dat *d) int t; d->isref = 1; - d->u.ref.nam = tokval.str; + d->u.ref.name = tokval.str; d->u.ref.off = 0; t = peek(); if (t == Tplus) { @@ -992,7 +992,7 @@ parsedatstr(Dat *d) } static void -parsedat(void cb(Dat *), int export) +parsedat(void cb(Dat *), Lnk *lnk) { char name[NString] = {0}; int t; @@ -1002,28 +1002,16 @@ parsedat(void cb(Dat *), int export) err("data name, then = expected"); strncpy(name, tokval.str, NString-1); t = nextnl(); - d.u.str = 0; - if (t == Tsection) { - if (nextnl() != Tstr) - err("section \"name\" expected"); - d.u.str = tokval.str; - t = nextnl(); - } - d.type = DStart; - cb(&d); + lnk->align = 8; if (t == Talign) { if (nextnl() != Tint) err("alignment expected"); - d.type = DAlign; - d.u.num = tokval.num; - d.isstr = 0; - d.isref = 0; - cb(&d); + lnk->align = tokval.num; t = nextnl(); } - d.type = DName; - d.u.str = name; - d.export = export; + d.type = DStart; + d.u.start.name = name; + d.u.start.lnk = lnk; cb(&d); if (t != Tlbrace) @@ -1070,10 +1058,38 @@ parsedat(void cb(Dat *), int export) cb(&d); } +static int +parselnk(Lnk *lnk) +{ + int t, haslnk; + + for (haslnk=0;; haslnk=1) + switch ((t=nextnl())) { + case Texport: + lnk->export = 1; + break; + case Tsection: + if (next() != Tstr) + err("section \"name\" expected"); + lnk->sec = tokval.str; + if (peek() == Tstr) { + next(); + lnk->secf = tokval.str; + } + break; + default: + if (haslnk) + if (t != Tdata) + if (t != Tfunc) + err("only data and function have linkage"); + return t; + } +} + void parse(FILE *f, char *path, void data(Dat *), void func(Fn *)) { - int t, export; + Lnk lnk; lexinit(); inf = f; @@ -1083,25 +1099,16 @@ parse(FILE *f, char *path, void data(Dat *), void func(Fn *)) ntyp = 0; typ = vnew(0, sizeof typ[0], Pheap); for (;;) { - export = 0; - switch (nextnl()) { + lnk = (Lnk){0}; + switch (parselnk(&lnk)) { default: err("top-level definition expected"); - case Texport: - export = 1; - t = nextnl(); - if (t == Tfunc) { case Tfunc: - func(parsefn(export)); - break; - } - else if (t == Tdata) { + func(parsefn(&lnk)); + break; case Tdata: - parsedat(data, export); - break; - } - else - err("export can only qualify data and function"); + parsedat(data, &lnk); + break; case Ttype: parsetyp(); break; @@ -1198,7 +1205,7 @@ printfn(Fn *fn, FILE *f) Ins *i; uint n; - if (fn->export) + if (fn->lnk.export) fprintf(f, "export "); fprintf(f, "function $%s() {\n", fn->name); for (b=fn->start; b; b=b->link) { From 9fc0394d7ed2b86be9eae7f2b410e83fbe3ae497 Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Thu, 10 Feb 2022 20:27:29 -0500 Subject: [PATCH 252/286] doc: fix name of export linkage flag --- doc/il.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index b667b64..8713e0d 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -202,7 +202,7 @@ constants by the linker. `bnf LINKAGE := - 'extern' + 'export' | 'section' SECNAME | 'section' SECNAME SECFLAGS @@ -213,11 +213,10 @@ Function and data definitions (see below) can specify linkage information to be passed to the assembler and eventually to the linker. -The `extern` linkage flag marks the defined item as +The `export` linkage flag marks the defined item as visible outside the current file's scope. If absent, the symbol can only be referred to locally. Functions -compiled by QBE and called from C need to have extern -linkage. +compiled by QBE and called from C need to be exported. A `section` flag can be specified to tell the linker to put the defined item in a certain section. The use of @@ -232,7 +231,7 @@ Example uses of the section flag include adding function pointers to a global initialization list, or storing a zeroed object in the BSS section, as depicted above. -The section and extern linkage flags should each appear +The section and export linkage flags should each appear at most once in a definition. If multiple occurrences are present, QBE is free to use any. From 7aceb24c50276322f79e7d13cbc6c9cd9251f447 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 10 Feb 2022 15:29:20 -0800 Subject: [PATCH 253/286] gas: put zero data into .bss by default This allows frontends to use BSS generically, without knowledge of platform-dependent details. --- all.h | 6 ++---- gas.c | 21 ++++++++++++++++----- parse.c | 4 ++-- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/all.h b/all.h index 942c52d..257d6ba 100644 --- a/all.h +++ b/all.h @@ -387,6 +387,8 @@ struct Dat { DL, DZ } type; + char *name; + Lnk *lnk; union { int64_t num; double fltd; @@ -396,10 +398,6 @@ struct Dat { char *name; int64_t off; } ref; - struct { - char *name; - Lnk *lnk; - } start; } u; char isref; char isstr; diff --git a/gas.c b/gas.c index 4400769..e67043b 100644 --- a/gas.c +++ b/gas.c @@ -33,21 +33,32 @@ gasemitdat(Dat *d, FILE *f) [DW] = "\t.int", [DL] = "\t.quad" }; + static int64_t zero; char *p; switch (d->type) { case DStart: - gasemitlnk( - d->u.start.name, - d->u.start.lnk, - ".data", f); + zero = 0; break; case DEnd: + if (zero != -1) { + gasemitlnk(d->name, d->lnk, ".bss", f); + fprintf(f, "\t.fill %"PRId64",1,0\n", zero); + } break; case DZ: - fprintf(f, "\t.fill %"PRId64",1,0\n", d->u.num); + if (zero != -1) + zero += d->u.num; + else + fprintf(f, "\t.fill %"PRId64",1,0\n", d->u.num); break; default: + if (zero != -1) { + gasemitlnk(d->name, d->lnk, ".data", f); + if (zero > 0) + fprintf(f, "\t.fill %"PRId64",1,0\n", zero); + zero = -1; + } if (d->isstr) { if (d->type != DB) err("strings only supported for 'b' currently"); diff --git a/parse.c b/parse.c index 5e5ab66..fb8b509 100644 --- a/parse.c +++ b/parse.c @@ -1010,8 +1010,8 @@ parsedat(void cb(Dat *), Lnk *lnk) t = nextnl(); } d.type = DStart; - d.u.start.name = name; - d.u.start.lnk = lnk; + d.name = name; + d.lnk = lnk; cb(&d); if (t != Tlbrace) From e092473be1cf48216085f8349677cefc8f19b3b2 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 11 Feb 2022 09:14:17 +0100 Subject: [PATCH 254/286] document the automatic use of bss --- doc/il.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index 8713e0d..994729e 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -224,12 +224,15 @@ the section flag is platform dependent and we refer the user to the documentation of their assembler and linker for relevant information. - export section ".bss" - data $zerobuf = { z 1024 } + section ".init_array" + data $.init.f = { l $f } -Example uses of the section flag include adding function -pointers to a global initialization list, or storing a -zeroed object in the BSS section, as depicted above. +The section flag can be used to add function pointers to +a global initialization list, as depicted above. Note +that some platforms provide a BSS section that can be +used to minimize the footprint of uniformly zeroed data. +When this section is available, QBE will automatically +make use of it and no section flag is required. The section and export linkage flags should each appear at most once in a definition. If multiple occurrences @@ -244,7 +247,7 @@ data, and functions. Aggregate types are never exported and do not compile to any code. Data and function definitions have file scope and are mutually recursive (even across IL files). Their visibility can be controlled -using the `export` keyword. +using linkage flags. ~ Aggregate Types ~~~~~~~~~~~~~~~~~ From 630127c68b872dcb7ddb22079f91f001b73945fc Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 12 Feb 2022 02:27:46 -0800 Subject: [PATCH 255/286] spill: consider jump argument as use of register --- spill.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spill.c b/spill.c index 4c11d9f..2ce1d4f 100644 --- a/spill.c +++ b/spill.c @@ -412,6 +412,20 @@ spill(Fn *fn) bscopy(b->out, v); /* 2. process the block instructions */ + if (rtype(b->jmp.arg) == RTmp) { + t = b->jmp.arg.val; + assert(KBASE(tmp[t].cls) == 0); + lvarg[0] = bshas(v, t); + bsset(v, t); + bscopy(u, v); + limit2(v, 0, 0, NULL); + if (!bshas(v, t)) { + if (!lvarg[0]) + bsclr(u, t); + b->jmp.arg = slot(t); + } + reloads(u, v); + } curi = &insb[NIns]; for (i=&b->ins[b->nins]; i!=b->ins;) { i--; From 3b75357e2bd14d6222bd9e3fb8b6894239ff2ae3 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 12 Feb 2022 02:27:47 -0800 Subject: [PATCH 256/286] Revert "skip jump arguments in rega" This reverts commit 028534d9897079bf64559dca0402bc59a956ce46. riscv64 will have jump arguments with type RTmp. --- rega.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rega.c b/rega.c index 0359d2b..dd77a75 100644 --- a/rega.c +++ b/rega.c @@ -359,9 +359,10 @@ doblk(Blk *b, RMap *cur) Mem *m; Ref *ra[4]; - assert(rtype(b->jmp.arg) != RTmp); for (r=0; bsiter(b->out, &r) && rjmp.arg) == RTmp) + b->jmp.arg = ralloc(cur, b->jmp.arg.val); curi = &insb[NIns]; for (i1=&b->ins[b->nins]; i1!=b->ins;) { emiti(*--i1); From 2cba9f6871fe92e06d5e6433f8e15d2712fa9d52 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 12 Feb 2022 02:27:48 -0800 Subject: [PATCH 257/286] cfg: remove unnecessary check for jump type This condition should match any jump with two successors. This is needed on riscv64, where there is no flags register, so Jjnz is used all the way to emit(). --- cfg.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cfg.c b/cfg.c index 81da842..36e6427 100644 --- a/cfg.c +++ b/cfg.c @@ -298,7 +298,6 @@ simpljmp(Fn *fn) Blk **uf; /* union-find */ Blk **p, *b, *ret; - int c; ret = blknew(); ret->id = fn->nblk++; @@ -322,9 +321,7 @@ simpljmp(Fn *fn) uffind(&b->s1, uf); if (b->s2) uffind(&b->s2, uf); - c = b->jmp.type - Jjf; - if (0 <= c && c <= NCmp) - if (b->s1 == b->s2) { + if (b->s1 && b->s1 == b->s2) { b->jmp.type = Jjmp; b->s2 = 0; } From 8e040d58615e49a63fb50dda5dc695e96a54a7bc Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 12 Feb 2022 02:27:49 -0800 Subject: [PATCH 258/286] test: add c[u]od checks to isel2 and add new integer compare test isel3 --- test/isel2.ssa | 16 ++++++++++ test/isel3.ssa | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 test/isel3.ssa diff --git a/test/isel2.ssa b/test/isel2.ssa index 8ca4a24..1086495 100644 --- a/test/isel2.ssa +++ b/test/isel2.ssa @@ -77,6 +77,18 @@ export function w $ne3(d %x, d %y) { ret 0 } +export function w $o(d %x, d %y) { +@start + %r =w cod %x, %y + ret %r +} + +export function w $uo(d %x, d %y) { +@start + %r =w cuod %x, %y + ret %r +} + # >>> driver # #include # extern int lt(double, double); @@ -89,6 +101,8 @@ export function w $ne3(d %x, d %y) { # extern int ne1(double, double); # extern int ne2(double, double); # extern int ne3(double, double); +# extern int o(double, double); +# extern int uo(double, double); # int main(void) { # /* LessThan Equal GreaterThan Unordered */ # return !lt(0, 1) + lt(0, 0) + lt(1, 0) + lt(NAN, NAN) @@ -101,6 +115,8 @@ export function w $ne3(d %x, d %y) { # + !ne1(0, 1) + ne1(0, 0) + !ne1(1, 0) + !ne1(NAN, NAN) # + !ne2(0, 1) + ne2(0, 0) + !ne2(1, 0) + !ne2(NAN, NAN) # + !ne3(0, 1) + ne3(0, 0) + !ne3(1, 0) + !ne3(NAN, NAN) +# + !o(0, 1) + !o(0, 0) + !o(1, 0) + o(NAN, NAN) +# + uo(0, 1) + uo(0, 0) + uo(1, 0) + !uo(NAN, NAN) # ; # } # <<< diff --git a/test/isel3.ssa b/test/isel3.ssa new file mode 100644 index 0000000..5e8862a --- /dev/null +++ b/test/isel3.ssa @@ -0,0 +1,87 @@ +export function w $slt(w %x, w %y) { +@start + %r =w csltw %x, %y + ret %r +} + +export function w $sle(w %x, w %y) { +@start + %r =w cslew %x, %y + ret %r +} + +export function w $sgt(w %x, w %y) { +@start + %r =w csgtw %x, %y + ret %r +} + +export function w $sge(w %x, w %y) { +@start + %r =w csgew %x, %y + ret %r +} + +export function w $ult(w %x, w %y) { +@start + %r =w cultw %x, %y + ret %r +} + +export function w $ule(w %x, w %y) { +@start + %r =w culew %x, %y + ret %r +} + +export function w $ugt(w %x, w %y) { +@start + %r =w cugtw %x, %y + ret %r +} + +export function w $uge(w %x, w %y) { +@start + %r =w cugew %x, %y + ret %r +} + +export function w $eq(w %x, w %y) { +@start + %r =w ceqw %x, %y + ret %r +} + +export function w $ne(w %x, w %y) { +@start + %r =w cnew %x, %y + ret %r +} + +# >>> driver +# #include +# extern int slt(int, int); +# extern int sle(int, int); +# extern int sgt(int, int); +# extern int sge(int, int); +# extern int ult(unsigned, unsigned); +# extern int ule(unsigned, unsigned); +# extern int ugt(unsigned, unsigned); +# extern int uge(unsigned, unsigned); +# extern int eq(unsigned, unsigned); +# extern int ne(unsigned, unsigned); +# int main(void) { +# /* LessThan Equal GreaterThan */ +# return !slt(-1, 0) + slt(0, 0) + slt(0, -1) +# + !sle(-1, 0) + !sle(0, 0) + sle(0, -1) +# + sgt(-1, 0) + sgt(0, 0) + !sgt(0, -1) +# + sge(-1, 0) + !sge(0, 0) + !sge(0, -1) +# + !ult(0, -1) + ult(0, 0) + ult(-1, 0) +# + !ule(0, -1) + !ule(0, 0) + ule(-1, 0) +# + ugt(0, -1) + ugt(0, 0) + !ugt(-1, 0) +# + uge(0, -1) + !uge(0, 0) + !uge(-1, 0) +# + eq(0, 1) + !eq(0, 0) + eq(1, 0) +# + !ne(0, 1) + ne(0, 0) + !ne(1, 0) +# ; +# } +# <<< From 4e93eeaa3b63b6ae50954a29662cc3ea6be48b23 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 12 Feb 2022 02:27:50 -0800 Subject: [PATCH 259/286] add rv64 backend It is mostly complete, but still has a few ABI bugs when passing floats in structs, or when structs are passed partly in register, and partly on stack. --- Makefile | 14 +- all.h | 2 +- doc/il.txt | 1 + doc/rv64.txt | 20 ++ main.c | 2 + ops.h | 266 ++++++++++++----------- rv64/abi.c | 584 ++++++++++++++++++++++++++++++++++++++++++++++++++ rv64/all.h | 49 +++++ rv64/emit.c | 499 ++++++++++++++++++++++++++++++++++++++++++ rv64/isel.c | 278 ++++++++++++++++++++++++ rv64/targ.c | 53 +++++ test/dark.ssa | 2 +- tools/test.sh | 24 +++ 13 files changed, 1661 insertions(+), 133 deletions(-) create mode 100644 doc/rv64.txt create mode 100644 rv64/abi.c create mode 100644 rv64/all.h create mode 100644 rv64/emit.c create mode 100644 rv64/isel.c create mode 100644 rv64/targ.c diff --git a/Makefile b/Makefile index 1a0074f..711873b 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,13 @@ SRC = main.c util.c parse.c cfg.c mem.c ssa.c alias.c load.c copy.c \ fold.c live.c spill.c rega.c gas.c AMD64SRC = amd64/targ.c amd64/sysv.c amd64/isel.c amd64/emit.c ARM64SRC = arm64/targ.c arm64/abi.c arm64/isel.c arm64/emit.c -SRCALL = $(SRC) $(AMD64SRC) $(ARM64SRC) +RV64SRC = rv64/targ.c rv64/abi.c rv64/isel.c rv64/emit.c +SRCALL = $(SRC) $(AMD64SRC) $(ARM64SRC) $(RV64SRC) AMD64OBJ = $(AMD64SRC:%.c=$(OBJDIR)/%.o) ARM64OBJ = $(ARM64SRC:%.c=$(OBJDIR)/%.o) -OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) $(ARM64OBJ) +RV64OBJ = $(RV64SRC:%.c=$(OBJDIR)/%.o) +OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(AMD64OBJ) $(ARM64OBJ) $(RV64OBJ) CFLAGS += -Wall -Wextra -std=c99 -g -pedantic @@ -27,11 +29,13 @@ $(OBJDIR)/timestamp: @mkdir -p $(OBJDIR) @mkdir -p $(OBJDIR)/amd64 @mkdir -p $(OBJDIR)/arm64 + @mkdir -p $(OBJDIR)/rv64 @touch $@ $(OBJ): all.h ops.h $(AMD64OBJ): amd64/all.h $(ARM64OBJ): arm64/all.h +$(RV64OBJ): rv64/all.h $(OBJDIR)/main.o: config.h config.h: @@ -46,6 +50,9 @@ config.h: *aarch64*) \ echo "#define Deftgt T_arm64"; \ ;; \ + *riscv64*) \ + echo "#define Deftgt T_rv64"; \ + ;; \ *) \ echo "#define Deftgt T_amd64_sysv";\ ;; \ @@ -72,6 +79,9 @@ check: $(OBJDIR)/$(BIN) check-arm64: $(OBJDIR)/$(BIN) TARGET=arm64 tools/test.sh all +check-rv64: $(OBJDIR)/$(BIN) + TARGET=rv64 tools/test.sh all + src: @echo $(SRCALL) diff --git a/all.h b/all.h index 257d6ba..c19b4ae 100644 --- a/all.h +++ b/all.h @@ -179,7 +179,7 @@ enum { #define isarg(o) INRANGE(o, Oarg, Oargv) #define isret(j) INRANGE(j, Jret0, Jretc) -enum Class { +enum { Kx = -1, /* "top" class (see usecheck() and clsmerge()) */ Kw, Kl, diff --git a/doc/il.txt b/doc/il.txt index 994729e..0e05283 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -856,6 +856,7 @@ alignment required by all the targets. type :valist = align 8 { 24 } # For amd64_sysv type :valist = align 8 { 32 } # For arm64 + type :valist = align 8 { 8 } # For rv64 The following example defines a variadic function adding its first three arguments. diff --git a/doc/rv64.txt b/doc/rv64.txt new file mode 100644 index 0000000..e696d77 --- /dev/null +++ b/doc/rv64.txt @@ -0,0 +1,20 @@ +========= +RISC-V 64 +========= + +- Known issues +-------------- + +ABI with structs containing floats is not yet supported. + +- Possible improvements +----------------------- + +rv64_isel() could turn compare used only with jnz into b{lt,ge}[u]. + +- Helpful links +--------------- + +RISC-V spec: https://github.com/riscv/riscv-isa-manual/releases/latest/download/riscv-spec.pdf +ASM manual: https://github.com/riscv-non-isa/riscv-asm-manual/blob/master/riscv-asm.md +psABI: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc diff --git a/main.c b/main.c index 83f08ba..ee16a75 100644 --- a/main.c +++ b/main.c @@ -7,6 +7,7 @@ Target T; extern Target T_amd64_sysv; extern Target T_arm64; +extern Target T_rv64; static struct TMap { char *name; @@ -14,6 +15,7 @@ static struct TMap { } tmap[] = { { "amd64_sysv", &T_amd64_sysv }, { "arm64", &T_arm64 }, + { "rv64", &T_rv64 }, { 0, 0 } }; diff --git a/ops.h b/ops.h index 9f02262..285bc5c 100644 --- a/ops.h +++ b/ops.h @@ -2,6 +2,11 @@ #define X(NMemArgs, SetsZeroFlag, LeavesFlags) #endif +#ifndef V /* riscv64 */ + #define V(Imm) +#endif + + #define T(a,b,c,d,e,f,g,h) { \ {[Kw]=K##a, [Kl]=K##b, [Ks]=K##c, [Kd]=K##d}, \ {[Kw]=K##e, [Kl]=K##f, [Ks]=K##g, [Kd]=K##h} \ @@ -13,108 +18,108 @@ /*********************/ /* Arithmetic and Bits */ -O(add, T(w,l,s,d, w,l,s,d), 1) X(2, 1, 0) -O(sub, T(w,l,s,d, w,l,s,d), 1) X(2, 1, 0) -O(neg, T(w,l,s,d, x,x,x,x), 1) X(1, 1, 0) -O(div, T(w,l,s,d, w,l,s,d), 1) X(0, 0, 0) -O(rem, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) -O(udiv, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) -O(urem, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) -O(mul, T(w,l,s,d, w,l,s,d), 1) X(2, 0, 0) -O(and, T(w,l,e,e, w,l,e,e), 1) X(2, 1, 0) -O(or, T(w,l,e,e, w,l,e,e), 1) X(2, 1, 0) -O(xor, T(w,l,e,e, w,l,e,e), 1) X(2, 1, 0) -O(sar, T(w,l,e,e, w,w,e,e), 1) X(1, 1, 0) -O(shr, T(w,l,e,e, w,w,e,e), 1) X(1, 1, 0) -O(shl, T(w,l,e,e, w,w,e,e), 1) X(1, 1, 0) +O(add, T(w,l,s,d, w,l,s,d), 1) X(2, 1, 0) V(1) +O(sub, T(w,l,s,d, w,l,s,d), 1) X(2, 1, 0) V(0) +O(neg, T(w,l,s,d, x,x,x,x), 1) X(1, 1, 0) V(0) +O(div, T(w,l,s,d, w,l,s,d), 1) X(0, 0, 0) V(0) +O(rem, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) V(0) +O(udiv, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) V(0) +O(urem, T(w,l,e,e, w,l,e,e), 1) X(0, 0, 0) V(0) +O(mul, T(w,l,s,d, w,l,s,d), 1) X(2, 0, 0) V(0) +O(and, T(w,l,e,e, w,l,e,e), 1) X(2, 1, 0) V(1) +O(or, T(w,l,e,e, w,l,e,e), 1) X(2, 1, 0) V(1) +O(xor, T(w,l,e,e, w,l,e,e), 1) X(2, 1, 0) V(1) +O(sar, T(w,l,e,e, w,w,e,e), 1) X(1, 1, 0) V(1) +O(shr, T(w,l,e,e, w,w,e,e), 1) X(1, 1, 0) V(1) +O(shl, T(w,l,e,e, w,w,e,e), 1) X(1, 1, 0) V(1) /* Comparisons */ -O(ceqw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) -O(cnew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) -O(csgew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) -O(csgtw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) -O(cslew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) -O(csltw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) -O(cugew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) -O(cugtw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) -O(culew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) -O(cultw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) - -O(ceql, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) -O(cnel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) -O(csgel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) -O(csgtl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) -O(cslel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) -O(csltl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) -O(cugel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) -O(cugtl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) -O(culel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) -O(cultl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) - -O(ceqs, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) -O(cges, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) -O(cgts, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) -O(cles, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) -O(clts, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) -O(cnes, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) -O(cos, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) -O(cuos, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) - -O(ceqd, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) -O(cged, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) -O(cgtd, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) -O(cled, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) -O(cltd, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) -O(cned, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) -O(cod, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) -O(cuod, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) +O(ceqw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(0) +O(cnew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(0) +O(csgew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(0) +O(csgtw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(0) +O(cslew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(0) +O(csltw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(1) +O(cugew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(0) +O(cugtw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(0) +O(culew, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(0) +O(cultw, T(w,w,e,e, w,w,e,e), 1) X(0, 1, 0) V(1) + +O(ceql, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(0) +O(cnel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(0) +O(csgel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(0) +O(csgtl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(0) +O(cslel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(0) +O(csltl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(1) +O(cugel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(0) +O(cugtl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(0) +O(culel, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(0) +O(cultl, T(l,l,e,e, l,l,e,e), 1) X(0, 1, 0) V(1) + +O(ceqs, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) V(0) +O(cges, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) V(0) +O(cgts, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) V(0) +O(cles, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) V(0) +O(clts, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) V(0) +O(cnes, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) V(0) +O(cos, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) V(0) +O(cuos, T(s,s,e,e, s,s,e,e), 1) X(0, 1, 0) V(0) + +O(ceqd, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) V(0) +O(cged, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) V(0) +O(cgtd, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) V(0) +O(cled, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) V(0) +O(cltd, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) V(0) +O(cned, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) V(0) +O(cod, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) V(0) +O(cuod, T(d,d,e,e, d,d,e,e), 1) X(0, 1, 0) V(0) /* Memory */ -O(storeb, T(w,e,e,e, m,e,e,e), 0) X(0, 0, 1) -O(storeh, T(w,e,e,e, m,e,e,e), 0) X(0, 0, 1) -O(storew, T(w,e,e,e, m,e,e,e), 0) X(0, 0, 1) -O(storel, T(l,e,e,e, m,e,e,e), 0) X(0, 0, 1) -O(stores, T(s,e,e,e, m,e,e,e), 0) X(0, 0, 1) -O(stored, T(d,e,e,e, m,e,e,e), 0) X(0, 0, 1) - -O(loadsb, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) -O(loadub, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) -O(loadsh, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) -O(loaduh, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) -O(loadsw, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) -O(loaduw, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) -O(load, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 1) +O(storeb, T(w,e,e,e, m,e,e,e), 0) X(0, 0, 1) V(0) +O(storeh, T(w,e,e,e, m,e,e,e), 0) X(0, 0, 1) V(0) +O(storew, T(w,e,e,e, m,e,e,e), 0) X(0, 0, 1) V(0) +O(storel, T(l,e,e,e, m,e,e,e), 0) X(0, 0, 1) V(0) +O(stores, T(s,e,e,e, m,e,e,e), 0) X(0, 0, 1) V(0) +O(stored, T(d,e,e,e, m,e,e,e), 0) X(0, 0, 1) V(0) + +O(loadsb, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(loadub, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(loadsh, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(loaduh, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(loadsw, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(loaduw, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(load, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 1) V(0) /* Extensions and Truncations */ -O(extsb, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) -O(extub, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) -O(extsh, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) -O(extuh, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) -O(extsw, T(e,w,e,e, e,x,e,e), 1) X(0, 0, 1) -O(extuw, T(e,w,e,e, e,x,e,e), 1) X(0, 0, 1) - -O(exts, T(e,e,e,s, e,e,e,x), 1) X(0, 0, 1) -O(truncd, T(e,e,d,e, e,e,x,e), 1) X(0, 0, 1) -O(stosi, T(s,s,e,e, x,x,e,e), 1) X(0, 0, 1) -O(stoui, T(s,s,e,e, x,x,e,e), 1) X(0, 0, 1) -O(dtosi, T(d,d,e,e, x,x,e,e), 1) X(0, 0, 1) -O(dtoui, T(d,d,e,e, x,x,e,e), 1) X(0, 0, 1) -O(swtof, T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1) -O(uwtof, T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1) -O(sltof, T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1) -O(ultof, T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1) -O(cast, T(s,d,w,l, x,x,x,x), 1) X(0, 0, 1) +O(extsb, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) V(0) +O(extub, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) V(0) +O(extsh, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) V(0) +O(extuh, T(w,w,e,e, x,x,e,e), 1) X(0, 0, 1) V(0) +O(extsw, T(e,w,e,e, e,x,e,e), 1) X(0, 0, 1) V(0) +O(extuw, T(e,w,e,e, e,x,e,e), 1) X(0, 0, 1) V(0) + +O(exts, T(e,e,e,s, e,e,e,x), 1) X(0, 0, 1) V(0) +O(truncd, T(e,e,d,e, e,e,x,e), 1) X(0, 0, 1) V(0) +O(stosi, T(s,s,e,e, x,x,e,e), 1) X(0, 0, 1) V(0) +O(stoui, T(s,s,e,e, x,x,e,e), 1) X(0, 0, 1) V(0) +O(dtosi, T(d,d,e,e, x,x,e,e), 1) X(0, 0, 1) V(0) +O(dtoui, T(d,d,e,e, x,x,e,e), 1) X(0, 0, 1) V(0) +O(swtof, T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1) V(0) +O(uwtof, T(e,e,w,w, e,e,x,x), 1) X(0, 0, 1) V(0) +O(sltof, T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1) V(0) +O(ultof, T(e,e,l,l, e,e,x,x), 1) X(0, 0, 1) V(0) +O(cast, T(s,d,w,l, x,x,x,x), 1) X(0, 0, 1) V(0) /* Stack Allocation */ -O(alloc4, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) -O(alloc8, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) -O(alloc16, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) +O(alloc4, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) V(0) +O(alloc8, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) V(0) +O(alloc16, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) V(0) /* Variadic Function Helpers */ -O(vaarg, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) -O(vastart, T(m,e,e,e, x,e,e,e), 0) X(0, 0, 0) +O(vaarg, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) V(0) +O(vastart, T(m,e,e,e, x,e,e,e), 0) X(0, 0, 0) V(0) -O(copy, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 1) +O(copy, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 1) V(0) /****************************************/ @@ -122,52 +127,55 @@ O(copy, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 1) /****************************************/ /* Miscellaneous and Architecture-Specific Operations */ -O(nop, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 1) -O(addr, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) -O(swap, T(w,l,s,d, w,l,s,d), 0) X(1, 0, 0) -O(sign, T(w,l,e,e, x,x,e,e), 0) X(0, 0, 0) -O(salloc, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) -O(xidiv, T(w,l,e,e, x,x,e,e), 0) X(1, 0, 0) -O(xdiv, T(w,l,e,e, x,x,e,e), 0) X(1, 0, 0) -O(xcmp, T(w,l,s,d, w,l,s,d), 0) X(1, 1, 0) -O(xtest, T(w,l,e,e, w,l,e,e), 0) X(1, 1, 0) -O(acmp, T(w,l,e,e, w,l,e,e), 0) X(0, 0, 0) -O(acmn, T(w,l,e,e, w,l,e,e), 0) X(0, 0, 0) -O(afcmp, T(e,e,s,d, e,e,s,d), 0) X(0, 0, 0) +O(nop, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 1) V(0) +O(addr, T(m,m,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(swap, T(w,l,s,d, w,l,s,d), 0) X(1, 0, 0) V(0) +O(sign, T(w,l,e,e, x,x,e,e), 0) X(0, 0, 0) V(0) +O(salloc, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) V(0) +O(xidiv, T(w,l,e,e, x,x,e,e), 0) X(1, 0, 0) V(0) +O(xdiv, T(w,l,e,e, x,x,e,e), 0) X(1, 0, 0) V(0) +O(xcmp, T(w,l,s,d, w,l,s,d), 0) X(1, 1, 0) V(0) +O(xtest, T(w,l,e,e, w,l,e,e), 0) X(1, 1, 0) V(0) +O(acmp, T(w,l,e,e, w,l,e,e), 0) X(0, 0, 0) V(0) +O(acmn, T(w,l,e,e, w,l,e,e), 0) X(0, 0, 0) V(0) +O(afcmp, T(e,e,s,d, e,e,s,d), 0) X(0, 0, 0) V(0) +O(reqz, T(w,l,e,e, x,x,e,e), 0) X(0, 0, 0) V(0) +O(rnez, T(w,l,e,e, x,x,e,e), 0) X(0, 0, 0) V(0) /* Arguments, Parameters, and Calls */ -O(par, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) -O(parc, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0) -O(pare, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0) -O(arg, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 0) -O(argc, T(e,x,e,e, e,l,e,e), 0) X(0, 0, 0) -O(arge, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) -O(argv, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) -O(call, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) +O(par, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) V(0) +O(parc, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0) V(0) +O(pare, T(e,x,e,e, e,x,e,e), 0) X(0, 0, 0) V(0) +O(arg, T(w,l,s,d, x,x,x,x), 0) X(0, 0, 0) V(0) +O(argc, T(e,x,e,e, e,l,e,e), 0) X(0, 0, 0) V(0) +O(arge, T(e,l,e,e, e,x,e,e), 0) X(0, 0, 0) V(0) +O(argv, T(x,x,x,x, x,x,x,x), 0) X(0, 0, 0) V(0) +O(call, T(m,m,m,m, x,x,x,x), 0) X(0, 0, 0) V(0) /* Flags Setting */ -O(flagieq, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagine, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagisge, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagisgt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagisle, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagislt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagiuge, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagiugt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagiule, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagiult, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagfeq, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagfge, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagfgt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagfle, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagflt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagfne, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagfo, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) -O(flagfuo, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) +O(flagieq, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagine, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagisge, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagisgt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagisle, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagislt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagiuge, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagiugt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagiule, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagiult, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagfeq, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagfge, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagfgt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagfle, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagflt, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagfne, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagfo, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) +O(flagfuo, T(x,x,e,e, x,x,e,e), 0) X(0, 0, 1) V(0) #undef T #undef X +#undef V #undef O /* diff --git a/rv64/abi.c b/rv64/abi.c new file mode 100644 index 0000000..1dd4fb0 --- /dev/null +++ b/rv64/abi.c @@ -0,0 +1,584 @@ +#include "all.h" + +typedef struct Class Class; +typedef struct Insl Insl; +typedef struct Params Params; + +enum { + Cptr = 1, /* replaced by a pointer */ + Cstk1 = 2, /* pass first XLEN on the stack */ + Cstk2 = 4, /* pass second XLEN on the stack */ + Cstk = Cstk1 | Cstk2, + Cfpint = 8, /* float passed like integer */ +}; + +struct Class { + char class; + uint size; + Typ *t; + uchar nreg; + uchar ngp; + uchar nfp; + int reg[2]; + int cls[2]; +}; + +struct Insl { + Ins i; + Insl *link; +}; + +struct Params { + int ngp; + int nfp; + int stk; /* stack offset for varargs */ +}; + +static int gpreg[] = { A0, A1, A2, A3, A4, A5, A6, A7}; +static int fpreg[] = {FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7}; + +/* layout of call's second argument (RCall) + * + * 29 8 4 2 0 + * |0.00|xxxx|xxxx|xx|xx| range + * | | | ` gp regs returned (0..2) + * | | ` fp regs returned (0..2) + * | ` gp regs passed (0..8) + * ` fp regs passed (0..8) + */ + +bits +rv64_retregs(Ref r, int p[2]) +{ + bits b; + int ngp, nfp; + + assert(rtype(r) == RCall); + ngp = r.val & 3; + nfp = (r.val >> 2) & 3; + if (p) { + p[0] = ngp; + p[1] = nfp; + } + b = 0; + while (ngp--) + b |= BIT(A0+ngp); + while (nfp--) + b |= BIT(FA0+nfp); + return b; +} + +bits +rv64_argregs(Ref r, int p[2]) +{ + bits b; + int ngp, nfp; + + assert(rtype(r) == RCall); + ngp = (r.val >> 4) & 15; + nfp = (r.val >> 8) & 15; + b = 0; + if (p) { + p[0] = ngp; + p[1] = nfp; + } + b = 0; + while (ngp--) + b |= BIT(A0+ngp); + while (nfp--) + b |= BIT(FA0+nfp); + return b; +} + +static void +typclass(Class *c, Typ *t, int *gp, int *fp) +{ + uint64_t sz; + uint n; + + sz = (t->size + 7) & ~7; + c->t = t; + c->class = 0; + c->ngp = 0; + c->nfp = 0; + + if (t->align > 4) + err("alignments larger than 16 are not supported"); + + if (t->dark || sz > 16 || sz == 0) { + /* large structs are replaced by a + * pointer to some caller-allocated + * memory */ + c->class |= Cptr; + c->size = 8; + return; + } + + c->size = sz; + + /* TODO: float */ + + for (n=0; nngp++) { + c->reg[n] = *gp++; + c->cls[n] = Kl; + } + + c->nreg = n; +} + +static void +sttmps(Ref tmp[], int cls[], uint nreg, Ref mem, Fn *fn) +{ + static int st[] = { + [Kw] = Ostorew, [Kl] = Ostorel, + [Ks] = Ostores, [Kd] = Ostored + }; + uint n; + uint64_t off; + Ref r; + + assert(nreg <= 4); + off = 0; + for (n=0; njmp.type; + + if (!isret(j) || j == Jret0) + return; + + r = b->jmp.arg; + b->jmp.type = Jret0; + + if (j == Jretc) { + typclass(&cr, &typ[fn->retty], gpreg, fpreg); + cty = (cr.nfp << 2) | cr.ngp; + if (cr.class & Cptr) { + assert(rtype(fn->retr) == RTmp); + blit(fn->retr, 0, r, cr.t->size, fn); + } else { + ldregs(cr.reg, cr.cls, cr.nreg, r, fn); + } + } else { + k = j - Jretw; + if (KBASE(k) == 0) { + emit(Ocopy, k, TMP(A0), r, R); + cty = 1; + } else { + emit(Ocopy, k, TMP(FA0), r, R); + cty = 1 << 2; + } + } + + b->jmp.arg = CALL(cty); +} + +static int +argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env, int retptr) +{ + int ngp, nfp, *gp, *fp, vararg; + Class *c; + Ins *i; + + gp = gpreg; + fp = fpreg; + ngp = 8; + nfp = 8; + vararg = 0; + if (retptr) { + gp++; + ngp--; + } + for (i=i0, c=carg; iop) { + case Opar: + case Oarg: + c->cls[0] = i->cls; + c->size = 8; + /* variadic float args are passed in int regs */ + if (!vararg && KBASE(i->cls) == 1 && nfp > 0) { + nfp--; + c->reg[0] = *fp++; + } else if (ngp > 0) { + if (KBASE(i->cls) == 1) + c->class |= Cfpint; + ngp--; + c->reg[0] = *gp++; + } else { + c->class |= Cstk1; + } + break; + case Oargv: + /* subsequent arguments are variadic */ + vararg = 1; + break; + case Oparc: + case Oargc: + typclass(c, &typ[i->arg[0].val], gp, fp); + if (c->class & Cptr) { + c->ngp = 1; + c->reg[0] = *gp; + c->cls[0] = Kl; + } + if (c->ngp <= ngp && c->nfp <= nfp) { + ngp -= c->ngp; + nfp -= c->nfp; + gp += c->ngp; + fp += c->nfp; + break; + } + c->ngp += c->nfp; + c->nfp = 0; + if (c->ngp <= ngp) { + ngp -= c->ngp; + gp += c->ngp; + break; + } + c->class |= Cstk1; + if (c->ngp - 1 > ngp) + c->class |= Cstk2; + break; + case Opare: + *env = i->to; + break; + case Oarge: + *env = i->arg[0]; + break; + } + } + return (gp-gpreg) << 4 | (fp-fpreg) << 8; +} + +static void +stkblob(Ref r, Class *c, Fn *fn, Insl **ilp) +{ + Insl *il; + int al; + uint64_t sz; + + il = alloc(sizeof *il); + al = c->t->align - 2; /* NAlign == 3 */ + if (al < 0) + al = 0; + sz = c->class & Cptr ? c->t->size : c->size; + il->i = (Ins){Oalloc+al, Kl, r, {getcon(sz, fn)}}; + il->link = *ilp; + *ilp = il; +} + +static void +selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) +{ + Ins *i; + Class *ca, *c, cr; + int k, cty, envc; + uint n; + uint64_t stk, off; + Ref r, r1, env, tmp[2]; + + env = R; + ca = alloc((i1-i0) * sizeof ca[0]); + cr.class = 0; + + if (!req(i1->arg[1], R)) + typclass(&cr, &typ[i1->arg[1].val], gpreg, fpreg); + + cty = argsclass(i0, i1, ca, &env, cr.class & Cptr); + stk = 0; + for (i=i0, c=ca; iop == Oargv) + continue; + if (c->class & Cptr) { + i->arg[0] = newtmp("abi", Kl, fn); + stkblob(i->arg[0], c, fn, ilp); + i->op = Oarg; + } + if (c->class & Cstk1) + stk += 8; + if (c->class & Cstk2) + stk += 8; + } + if (stk) + emit(Osalloc, Kl, R, getcon(-stk, fn), R); + + if (!req(i1->arg[1], R)) { + stkblob(i1->to, &cr, fn, ilp); + cty |= (cr.nfp << 2) | cr.ngp; + if (cr.class & Cptr) { + cty |= 1; + emit(Ocopy, Kw, R, TMP(A0), R); + } else { + sttmps(tmp, cr.cls, cr.nreg, i1->to, fn); + for (n=0; ncls) == 0) { + emit(Ocopy, i1->cls, i1->to, TMP(A0), R); + cty |= 1; + } else { + emit(Ocopy, i1->cls, i1->to, TMP(FA0), R); + cty |= 1 << 2; + } + + envc = !req(R, env); + if (envc) + die("todo (rv64 abi): env calls"); + emit(Ocall, 0, R, i1->arg[0], CALL(cty)); + + if (cr.class & Cptr) + /* struct return argument */ + emit(Ocopy, Kl, TMP(A0), i1->to, R); + + /* move arguments into registers */ + for (i=i0, c=ca; iop == Oargv || c->class & Cstk1) + continue; + if (i->op == Oargc) { + ldregs(c->reg, c->cls, c->nreg, i->arg[1], fn); + } else if (c->class & Cfpint) { + k = KWIDE(*c->cls) ? Kl : Kw; + r = newtmp("abi", k, fn); + emit(Ocopy, k, TMP(c->reg[0]), r, R); + c->reg[0] = r.val; + } else { + emit(Ocopy, *c->cls, TMP(*c->reg), i->arg[0], R); + } + } + + for (i=i0, c=ca; iclass & Cfpint) + emit(Ocast, KWIDE(*c->cls) ? Kl : Kw, TMP(*c->reg), i->arg[0], R); + if (c->class & Cptr) + blit(i->arg[0], 0, i->arg[1], c->t->size, fn); + } + + if (!stk) + return; + + r = newtmp("abi", Kl, fn); + for (i=i0, c=ca, off=0; iop == Oargv || (c->class & Cstk) == 0) + continue; + if (i->op != Oargc) { + r1 = newtmp("abi", Kl, fn); + /* w arguments are stored sign-extended + * to 64-bits + * + * s arguments can just be stored with + * Ostores into the first 32-bits in the + * stack position since the ABI says the + * upper bits are undefined + */ + emit(i->cls == Kw ? Ostorel : Ostorew+i->cls, 0, R, i->arg[0], r1); + if (i->cls == Kw) { + /* TODO: we only need this sign extension + * for subtyped l temporaries passed as w + * arguments (see rv64/isel.c:fixarg) + * + * however, we cannot just fix it in isel + * since by that point we have forgotten + * the original argument type + */ + curi->arg[0] = newtmp("abi", Kl, fn); + emit(Oextsw, Kl, curi->arg[0], i->arg[0], R); + } + emit(Oadd, Kl, r1, r, getcon(off, fn)); + } else + blit(r, off, i->arg[1], c->t->size, fn); + off += c->size; + } + emit(Osalloc, Kl, r, getcon(stk, fn), R); +} + +static Params +selpar(Fn *fn, Ins *i0, Ins *i1) +{ + Class *ca, *c, cr; + Insl *il; + Ins *i; + int n, s, cty; + Ref r, env, tmp[16], *t; + + env = R; + ca = alloc((i1-i0) * sizeof ca[0]); + cr.class = 0; + curi = &insb[NIns]; + + if (fn->retty >= 0) { + typclass(&cr, &typ[fn->retty], gpreg, fpreg); + if (cr.class & Cptr) { + fn->retr = newtmp("abi", Kl, fn); + emit(Ocopy, Kl, fn->retr, TMP(A0), R); + } + } + + cty = argsclass(i0, i1, ca, &env, cr.class & Cptr); + fn->reg = rv64_argregs(CALL(cty), 0); + + il = 0; + t = tmp; + for (i=i0, c=ca; iop != Oparc || (c->class & (Cptr|Cstk))) + continue; + sttmps(t, c->cls, c->nreg, i->to, fn); + stkblob(i->to, c, fn, &il); + t += c->nreg; + } + for (; il; il=il->link) + emiti(il->i); + + t = tmp; + for (i=i0, c=ca, s=2 + 8 * fn->vararg; iop == Oparc + && (c->class & Cptr) == 0) { + if (c->class & Cstk) { + fn->tmp[i->to.val].slot = -s; + s += c->size / 8; + } else { + for (n=0; nnreg; n++) { + r = TMP(c->reg[n]); + emit(Ocopy, c->cls[n], *t++, r, R); + } + } + } else if (c->class & Cstk1) { + emit(Oload, c->cls[0], i->to, SLOT(-s), R); + s++; + } else { + emit(Ocopy, c->cls[0], i->to, TMP(c->reg[0]), R); + } + } + + if (!req(R, env)) + die("todo (rv64 abi): env calls"); + + return (Params){ + .stk = s, + .ngp = (cty >> 4) & 15, + .nfp = (cty >> 8) & 15, + }; +} + +static void +selvaarg(Fn *fn, Ins *i) +{ + Ref loc, newloc; + + loc = newtmp("abi", Kl, fn); + newloc = newtmp("abi", Kl, fn); + emit(Ostorel, Kw, R, newloc, i->arg[0]); + emit(Oadd, Kl, newloc, loc, getcon(8, fn)); + emit(Oload, i->cls, i->to, loc, R); + emit(Oload, Kl, loc, i->arg[0], R); +} + +static void +selvastart(Fn *fn, Params p, Ref ap) +{ + Ref rsave; + int s; + + rsave = newtmp("abi", Kl, fn); + emit(Ostorel, Kw, R, rsave, ap); + s = p.stk > 2 + 8 * fn->vararg ? p.stk : 2 + p.ngp; + emit(Oaddr, Kl, rsave, SLOT(-s), R); +} + +void +rv64_abi(Fn *fn) +{ + Blk *b; + Ins *i, *i0, *ip; + Insl *il; + int n; + Params p; + + for (b=fn->start; b; b=b->link) + b->visit = 0; + + /* lower parameters */ + for (b=fn->start, i=b->ins; i<&b->ins[b->nins]; i++) + if (!ispar(i->op)) + break; + p = selpar(fn, b->ins, i); + n = b->nins - (i - b->ins) + (&insb[NIns] - curi); + i0 = alloc(n * sizeof(Ins)); + ip = icpy(ip = i0, curi, &insb[NIns] - curi); + ip = icpy(ip, i, &b->ins[b->nins] - i); + b->nins = n; + b->ins = i0; + + /* lower calls, returns, and vararg instructions */ + il = 0; + b = fn->start; + do { + if (!(b = b->link)) + b = fn->start; /* do it last */ + if (b->visit) + continue; + curi = &insb[NIns]; + selret(b, fn); + for (i=&b->ins[b->nins]; i!=b->ins;) + switch ((--i)->op) { + default: + emiti(*i); + break; + case Ocall: + for (i0=i; i0>b->ins; i0--) + if (!isarg((i0-1)->op)) + break; + selcall(fn, i0, i, &il); + i = i0; + break; + case Ovastart: + selvastart(fn, p, i->arg[0]); + break; + case Ovaarg: + selvaarg(fn, i); + break; + case Oarg: + case Oargc: + die("unreachable"); + } + if (b == fn->start) + for (; il; il=il->link) + emiti(il->i); + b->nins = &insb[NIns] - curi; + idup(&b->ins, curi, b->nins); + } while (b != fn->start); + + if (debug['A']) { + fprintf(stderr, "\n> After ABI lowering:\n"); + printfn(fn, stderr); + } +} diff --git a/rv64/all.h b/rv64/all.h new file mode 100644 index 0000000..eb2daa9 --- /dev/null +++ b/rv64/all.h @@ -0,0 +1,49 @@ +#include "../all.h" + +typedef struct Rv64Op Rv64Op; + +enum Rv64Reg { + /* caller-save */ + T0 = RXX + 1, T1, T2, T3, T4, T5, + A0, A1, A2, A3, A4, A5, A6, A7, + + /* callee-save */ + S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, + + /* globally live */ + FP, SP, GP, TP, RA, T6, + + /* FP caller-save */ + FT0, FT1, FT2, FT3, FT4, FT5, FT6, FT7, FT8, FT9, FT10, FT11, + FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7, + + /* FP callee-save */ + FS0, FS1, FS2, FS3, FS4, FS5, FS6, FS7, FS8, FS9, FS10, FS11, + + NFPR = FS11 - FT0 + 1, + NGPR = T6 - T0 + 1, + NGPS = A7 - T0 + 1, + NFPS = FA7 - FT0 + 1, + NCLR = (S11 - S1 + 1) + (FS11 - FS0 + 1), +}; +MAKESURE(reg_not_tmp, FS11 < (int)Tmp0); + +struct Rv64Op { + char imm; +}; + +/* targ.c */ +extern int rv64_rsave[]; +extern int rv64_rclob[]; +extern Rv64Op rv64_op[]; + +/* abi.c */ +bits rv64_retregs(Ref, int[2]); +bits rv64_argregs(Ref, int[2]); +void rv64_abi(Fn *); + +/* isel.c */ +void rv64_isel(Fn *); + +/* emit.c */ +void rv64_emitfn(Fn *, FILE *); diff --git a/rv64/emit.c b/rv64/emit.c new file mode 100644 index 0000000..b34b424 --- /dev/null +++ b/rv64/emit.c @@ -0,0 +1,499 @@ +#include "all.h" + +enum { + Ki = -1, /* matches Kw and Kl */ + Ka = -2, /* matches all classes */ +}; + +static struct { + short op; + short cls; + char *asm; +} omap[] = { + { Oadd, Ki, "add%k %=, %0, %1" }, + { Oadd, Ka, "fadd.%k %=, %0, %1" }, + { Osub, Ki, "sub%k %=, %0, %1" }, + { Osub, Ka, "fsub.%k %=, %0, %1" }, + { Oneg, Ki, "neg%k %=, %0" }, + { Oneg, Ka, "fneg.%k %=, %0" }, + { Odiv, Ki, "div%k %=, %0, %1" }, + { Odiv, Ka, "fdiv.%k %=, %0, %1" }, + { Orem, Ki, "rem%k %=, %0, %1" }, + { Orem, Kl, "rem %=, %0, %1" }, + { Oudiv, Ki, "divu%k %=, %0, %1" }, + { Ourem, Ki, "remu%k %=, %0, %1" }, + { Omul, Ki, "mul%k %=, %0, %1" }, + { Omul, Ka, "fmul.%k %=, %0, %1" }, + { Oand, Ki, "and %=, %0, %1" }, + { Oor, Ki, "or %=, %0, %1" }, + { Oxor, Ki, "xor %=, %0, %1" }, + { Osar, Ki, "sra%k %=, %0, %1" }, + { Oshr, Ki, "srl%k %=, %0, %1" }, + { Oshl, Ki, "sll%k %=, %0, %1" }, + { Ocsltl, Ki, "slt %=, %0, %1" }, + { Ocultl, Ki, "sltu %=, %0, %1" }, + { Oceqs, Ki, "feq.s %=, %0, %1" }, + { Ocges, Ki, "fge.s %=, %0, %1" }, + { Ocgts, Ki, "fgt.s %=, %0, %1" }, + { Ocles, Ki, "fle.s %=, %0, %1" }, + { Oclts, Ki, "flt.s %=, %0, %1" }, + { Oceqd, Ki, "feq.d %=, %0, %1" }, + { Ocged, Ki, "fge.d %=, %0, %1" }, + { Ocgtd, Ki, "fgt.d %=, %0, %1" }, + { Ocled, Ki, "fle.d %=, %0, %1" }, + { Ocltd, Ki, "flt.d %=, %0, %1" }, + { Ostoreb, Kw, "sb %0, %M1" }, + { Ostoreh, Kw, "sh %0, %M1" }, + { Ostorew, Kw, "sw %0, %M1" }, + { Ostorel, Ki, "sd %0, %M1" }, + { Ostores, Kw, "fsw %0, %M1" }, + { Ostored, Kw, "fsd %0, %M1" }, + { Oloadsb, Ki, "lb %=, %M0" }, + { Oloadub, Ki, "lbu %=, %M0" }, + { Oloadsh, Ki, "lh %=, %M0" }, + { Oloaduh, Ki, "lhu %=, %M0" }, + { Oloadsw, Ki, "lw %=, %M0" }, + /* riscv64 always sign-extends 32-bit + * values stored in 64-bit registers + */ + { Oloaduw, Kw, "lw %=, %M0" }, + { Oloaduw, Kl, "lwu %=, %M0" }, + { Oload, Kw, "lw %=, %M0" }, + { Oload, Kl, "ld %=, %M0" }, + { Oload, Ks, "flw %=, %M0" }, + { Oload, Kd, "fld %=, %M0" }, + { Oextsb, Ki, "sext.b %=, %0" }, + { Oextub, Ki, "zext.b %=, %0" }, + { Oextsh, Ki, "sext.h %=, %0" }, + { Oextuh, Ki, "zext.h %=, %0" }, + { Oextsw, Kl, "sext.w %=, %0" }, + { Oextuw, Kl, "zext.w %=, %0" }, + { Otruncd, Ks, "fcvt.s.d %=, %0" }, + { Oexts, Kd, "fcvt.d.s %=, %0" }, + { Ostosi, Kw, "fcvt.w.s %=, %0, rtz" }, + { Ostosi, Kl, "fcvt.l.s %=, %0, rtz" }, + { Ostoui, Kw, "fcvt.wu.s %=, %0, rtz" }, + { Ostoui, Kl, "fcvt.lu.s %=, %0, rtz" }, + { Odtosi, Kw, "fcvt.w.d %=, %0, rtz" }, + { Odtosi, Kl, "fcvt.l.d %=, %0, rtz" }, + { Odtoui, Kw, "fcvt.wu.d %=, %0, rtz" }, + { Odtoui, Kl, "fcvt.lu.d %=, %0, rtz" }, + { Oswtof, Ka, "fcvt.%k.w %=, %0" }, + { Ouwtof, Ka, "fcvt.%k.wu %=, %0" }, + { Osltof, Ka, "fcvt.%k.l %=, %0" }, + { Oultof, Ka, "fcvt.%k.lu %=, %0" }, + { Ocast, Kw, "fmv.x.w %=, %0" }, + { Ocast, Kl, "fmv.x.d %=, %0" }, + { Ocast, Ks, "fmv.w.x %=, %0" }, + { Ocast, Kd, "fmv.d.x %=, %0" }, + { Ocopy, Ki, "mv %=, %0" }, + { Ocopy, Ka, "fmv.%k %=, %0" }, + { Oswap, Ki, "mv %?, %0\n\tmv %0, %1\n\tmv %1, %?" }, + { Oreqz, Ki, "seqz %=, %0" }, + { Ornez, Ki, "snez %=, %0" }, + { Ocall, Kw, "jalr %0" }, + { NOp, 0, 0 } +}; + +static char *rname[] = { + [FP] = "fp", + [SP] = "sp", + [GP] = "gp", + [TP] = "tp", + [RA] = "ra", + [T6] = "t6", + [T0] = "t0", "t1", "t2", "t3", "t4", "t5", + [A0] = "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", + [S1] = "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s10", "s11", + + [FT0] = "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", "ft8", "ft9", "ft10", "ft11", + [FA0] = "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6", "fa7", + [FS0] = "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", "fs8", "fs9", "fs10", "fs11", +}; + +static int64_t +slot(int s, Fn *fn) +{ + s = ((int32_t)s << 3) >> 3; + assert(s <= fn->slot); + if (s < 0) + return 8 * -s; + else + return -4 * (fn->slot - s); +} + +static void +emitaddr(Con *c, FILE *f) +{ + char off[32], *p; + + if (c->bits.i) + sprintf(off, "+%"PRIi64, c->bits.i); + else + off[0] = 0; + p = c->local ? ".L" : ""; + fprintf(f, "%s%s%s", p, str(c->label), off); +} + +static void +emitf(char *s, Ins *i, Fn *fn, FILE *f) +{ + static char clschr[] = {'w', 'l', 's', 'd'}; + Ref r; + int k, c; + Con *pc; + int64_t offset; + + fputc('\t', f); + for (;;) { + k = i->cls; + while ((c = *s++) != '%') + if (!c) { + fputc('\n', f); + return; + } else + fputc(c, f); + switch ((c = *s++)) { + default: + die("invalid escape"); + case '?': + if (KBASE(k) == 0) + fputs("t6", f); + else + abort(); + break; + case 'k': + if (i->cls != Kl) + fputc(clschr[i->cls], f); + break; + case '=': + case '0': + r = c == '=' ? i->to : i->arg[0]; + assert(isreg(r)); + fputs(rname[r.val], f); + break; + case '1': + r = i->arg[1]; + switch (rtype(r)) { + default: + die("invalid second argument"); + case RTmp: + assert(isreg(r)); + fputs(rname[r.val], f); + break; + case RCon: + pc = &fn->con[r.val]; + assert(pc->type == CBits); + assert(pc->bits.i >= -2048 && pc->bits.i <= 2047); + fprintf(f, "%d", (int)pc->bits.i); + break; + } + break; + case 'M': + c = *s++; + assert(c == '0' || c == '1'); + r = i->arg[c - '0']; + switch (rtype(r)) { + default: + die("invalid address argument"); + case RTmp: + fprintf(f, "0(%s)", rname[r.val]); + break; + case RCon: + pc = &fn->con[r.val]; + assert(pc->type == CAddr); + emitaddr(pc, f); + if (isstore(i->op) + || (isload(i->op) && KBASE(i->cls) == 1)) { + /* store (and float load) + * pseudo-instructions need a + * temporary register in which to + * load the address + */ + fprintf(f, ", t6"); + } + break; + case RSlot: + offset = slot(r.val, fn); + assert(offset >= -2048 && offset <= 2047); + fprintf(f, "%d(fp)", (int)offset); + break; + } + break; + } + } +} + +static void +loadcon(Con *c, int r, int k, FILE *f) +{ + char *rn; + int64_t n; + int w; + + w = KWIDE(k); + rn = rname[r]; + switch (c->type) { + case CAddr: + fprintf(f, "\tla %s, ", rn); + emitaddr(c, f); + fputc('\n', f); + break; + case CBits: + n = c->bits.i; + if (!w) + n = (int32_t)n; + fprintf(f, "\tli %s, %"PRIu64"\n", rn, n); + break; + default: + die("invalid constant"); + } +} + +static void +fixslot(Ref *pr, Fn *fn, FILE *f) +{ + Ref r; + int64_t s; + + r = *pr; + if (rtype(r) == RSlot) { + s = slot(r.val, fn); + if (s < -2048 || s > 2047) { + fprintf(f, "\tli t6, %"PRId64"\n", s); + fprintf(f, "\tadd t6, fp, t6\n"); + *pr = TMP(T6); + } + } +} + +static void +emitins(Ins *i, Fn *fn, FILE *f) +{ + int o; + char *rn; + int64_t s; + Con *con; + + switch (i->op) { + default: + if (isload(i->op)) + fixslot(&i->arg[0], fn, f); + else if (isstore(i->op)) + fixslot(&i->arg[1], fn, f); + Table: + /* most instructions are just pulled out of + * the table omap[], some special cases are + * detailed below */ + for (o=0;; o++) { + /* this linear search should really be a binary + * search */ + if (omap[o].op == NOp) + die("no match for %s(%c)", + optab[i->op].name, "wlsd"[i->cls]); + if (omap[o].op == i->op) + if (omap[o].cls == i->cls || omap[o].cls == Ka + || (omap[o].cls == Ki && KBASE(i->cls) == 0)) + break; + } + emitf(omap[o].asm, i, fn, f); + break; + case Ocopy: + if (req(i->to, i->arg[0])) + break; + if (rtype(i->to) == RSlot) { + switch (rtype(i->arg[0])) { + case RSlot: + case RCon: + die("unimplemented"); + break; + default: + assert(isreg(i->arg[0])); + i->arg[1] = i->to; + i->to = R; + switch (i->cls) { + case Kw: i->op = Ostorew; break; + case Kl: i->op = Ostorel; break; + case Ks: i->op = Ostores; break; + case Kd: i->op = Ostored; break; + } + fixslot(&i->arg[1], fn, f); + goto Table; + } + break; + } + assert(isreg(i->to)); + switch (rtype(i->arg[0])) { + case RCon: + loadcon(&fn->con[i->arg[0].val], i->to.val, i->cls, f); + break; + case RSlot: + i->op = Oload; + fixslot(&i->arg[0], fn, f); + goto Table; + default: + assert(isreg(i->arg[0])); + goto Table; + } + break; + case Onop: + break; + case Oaddr: + assert(rtype(i->arg[0]) == RSlot); + rn = rname[i->to.val]; + s = slot(i->arg[0].val, fn); + if (-s < 2048) { + fprintf(f, "\tadd %s, fp, %"PRId64"\n", rn, s); + } else { + fprintf(f, + "\tli %s, %"PRId64"\n" + "\tadd %s, fp, %s\n", + rn, s, rn, rn + ); + } + break; + case Ocall: + switch (rtype(i->arg[0])) { + case RCon: + con = &fn->con[i->arg[0].val]; + if (con->type != CAddr || con->bits.i) + goto invalid; + fprintf(f, "\tcall %s\n", str(con->label)); + break; + case RTmp: + emitf("jalr %0", i, fn, f); + break; + default: + invalid: + die("invalid call argument"); + } + break; + case Osalloc: + emitf("sub sp, sp, %0", i, fn, f); + if (!req(i->to, R)) + emitf("mv %=, sp", i, fn, f); + break; + } +} + +/* + + Stack-frame layout: + + +=============+ + | varargs | + | save area | + +-------------+ + | saved ra | + | saved fp | + +-------------+ <- fp + | ... | + | spill slots | + | ... | + +-------------+ + | ... | + | locals | + | ... | + +-------------+ + | padding | + +-------------+ + | callee-save | + | registers | + +=============+ + +*/ + +void +rv64_emitfn(Fn *fn, FILE *f) +{ + static int id0; + int lbl, neg, off, frame, *pr, r; + Blk *b, *s; + Ins *i; + + gasemitlnk(fn->name, &fn->lnk, ".text", f); + + if (fn->vararg) { + /* TODO: only need space for registers unused by named arguments */ + fprintf(f, "\tadd sp, sp, -64\n"); + for (r = A0; r <= A7; r++) + fprintf(f, "\tsd %s, %d(sp)\n", rname[r], 8 * (r - A0)); + } + fprintf(f, "\tsd fp, -16(sp)\n"); + fprintf(f, "\tsd ra, -8(sp)\n"); + fprintf(f, "\tadd fp, sp, -16\n"); + + frame = (16 + 4 * fn->slot + 15) & ~15; + for (pr = rv64_rclob; *pr>=0; pr++) { + if (fn->reg & BIT(*pr)) + frame += 8; + } + frame = (frame + 15) & ~15; + + if (frame <= 2048) + fprintf(f, "\tadd sp, sp, -%d\n", frame); + else + fprintf(f, + "\tli t6, %d\n" + "\tsub sp, sp, t6\n", + frame); + for (pr = rv64_rclob, off = 0; *pr >= 0; pr++) { + if (fn->reg & BIT(*pr)) { + fprintf(f, "\t%s %s, %d(sp)\n", *pr < FT0 ? "sd" : "fsd", rname[*pr], off); + off += 8; + } + } + + for (lbl = 0, b = fn->start; b; b=b->link) { + if (lbl || b->npred > 1) + fprintf(f, ".L%d:\n", id0+b->id); + for (i=b->ins; i!=&b->ins[b->nins]; i++) + emitins(i, fn, f); + lbl = 1; + switch (b->jmp.type) { + case Jret0: + if (fn->dynalloc) { + if (frame - 16 <= 2048) + fprintf(f, "\tadd sp, fp, -%d\n", frame - 16); + else + fprintf(f, + "\tli t6, %d\n" + "\tsub sp, sp, t6\n", + frame - 16); + } + for (pr = rv64_rclob, off = 0; *pr >= 0; pr++) { + if (fn->reg & BIT(*pr)) { + fprintf(f, "\t%s %s, %d(sp)\n", *pr < FT0 ? "ld" : "fld", rname[*pr], off); + off += 8; + } + } + fprintf(f, + "\tadd sp, fp, %d\n" + "\tld ra, 8(fp)\n" + "\tld fp, 0(fp)\n" + "\tret\n", + 16 + fn->vararg * 64 + ); + break; + case Jjmp: + Jmp: + if (b->s1 != b->link) + fprintf(f, "\tj .L%d\n", id0+b->s1->id); + else + lbl = 0; + break; + case Jjnz: + neg = 0; + if (b->link == b->s2) { + s = b->s1; + b->s1 = b->s2; + b->s2 = s; + neg = 1; + } + assert(isreg(b->jmp.arg)); + fprintf(f, "\tb%sz %s, .L%d\n", neg ? "ne" : "eq", rname[b->jmp.arg.val], id0+b->s2->id); + goto Jmp; + } + } + id0 += fn->nblk; +} diff --git a/rv64/isel.c b/rv64/isel.c new file mode 100644 index 0000000..bb6fb02 --- /dev/null +++ b/rv64/isel.c @@ -0,0 +1,278 @@ +#include "all.h" + +static int +memarg(Ref *r, int op, Ins *i) +{ + return ((isload(op) || op == Ocall) && r == &i->arg[0]) + || (isstore(op) && r == &i->arg[1]); +} + +static int +immarg(Ref *r, int op, Ins *i) +{ + return rv64_op[op].imm && r == &i->arg[1]; +} + +static void +fixarg(Ref *r, int k, Ins *i, Fn *fn) +{ + char buf[32]; + Ref r0, r1; + int s, n, op; + Con *c; + + r0 = r1 = *r; + op = i ? i->op : Ocopy; + switch (rtype(r0)) { + case RCon: + c = &fn->con[r0.val]; + if (c->type == CAddr && memarg(r, op, i)) + break; + if (c->type == CBits && immarg(r, op, i) + && -2048 <= c->bits.i && c->bits.i < 2048) + break; + r1 = newtmp("isel", k, fn); + if (KBASE(k) == 1) { + /* load floating points from memory + * slots, they can't be used as + * immediates + */ + assert(c->type == CBits); + n = gasstash(&c->bits, KWIDE(k) ? 8 : 4); + vgrow(&fn->con, ++fn->ncon); + c = &fn->con[fn->ncon-1]; + sprintf(buf, "fp%d", n); + *c = (Con){.type = CAddr, .local = 1}; + c->label = intern(buf); + emit(Oload, k, r1, CON(c-fn->con), R); + break; + } + emit(Ocopy, k, r1, r0, R); + break; + case RTmp: + if (isreg(r0)) + break; + s = fn->tmp[r0.val].slot; + if (s != -1) { + /* aggregate passed by value on + * stack, or fast local address, + * replace with slot if we can + */ + if (memarg(r, op, i)) { + r1 = SLOT(s); + break; + } + r1 = newtmp("isel", k, fn); + emit(Oaddr, k, r1, SLOT(s), R); + break; + } + if (k == Kw && fn->tmp[r0.val].cls == Kl) { + /* TODO: this sign extension isn't needed + * for 32-bit arithmetic instructions + */ + r1 = newtmp("isel", k, fn); + emit(Oextsw, Kl, r1, r0, R); + } else { + assert(k == fn->tmp[r0.val].cls); + } + break; + } + *r = r1; +} + +static void +negate(Ref *pr, Fn *fn) +{ + Ref r; + + r = newtmp("isel", Kw, fn); + emit(Oxor, Kw, *pr, r, getcon(1, fn)); + *pr = r; +} + +static void +selcmp(Ins i, int k, int op, Fn *fn) +{ + Ins *icmp; + Ref r, r0, r1; + int sign, swap, neg; + + switch (op) { + case Cieq: + r = newtmp("isel", k, fn); + emit(Oreqz, i.cls, i.to, r, R); + emit(Oxor, k, r, i.arg[0], i.arg[1]); + icmp = curi; + fixarg(&icmp->arg[0], k, icmp, fn); + fixarg(&icmp->arg[1], k, icmp, fn); + return; + case Cine: + r = newtmp("isel", k, fn); + emit(Ornez, i.cls, i.to, r, R); + emit(Oxor, k, r, i.arg[0], i.arg[1]); + icmp = curi; + fixarg(&icmp->arg[0], k, icmp, fn); + fixarg(&icmp->arg[1], k, icmp, fn); + return; + case Cisge: sign = 1, swap = 0, neg = 1; break; + case Cisgt: sign = 1, swap = 1, neg = 0; break; + case Cisle: sign = 1, swap = 1, neg = 1; break; + case Cislt: sign = 1, swap = 0, neg = 0; break; + case Ciuge: sign = 0, swap = 0, neg = 1; break; + case Ciugt: sign = 0, swap = 1, neg = 0; break; + case Ciule: sign = 0, swap = 1, neg = 1; break; + case Ciult: sign = 0, swap = 0, neg = 0; break; + case NCmpI+Cfeq: + case NCmpI+Cfge: + case NCmpI+Cfgt: + case NCmpI+Cfle: + case NCmpI+Cflt: + swap = 0, neg = 0; + break; + case NCmpI+Cfuo: + negate(&i.to, fn); + /* fallthrough */ + case NCmpI+Cfo: + r0 = newtmp("isel", i.cls, fn); + r1 = newtmp("isel", i.cls, fn); + emit(Oand, i.cls, i.to, r0, r1); + op = KWIDE(k) ? Oceqd : Oceqs; + emit(op, i.cls, r0, i.arg[0], i.arg[0]); + icmp = curi; + fixarg(&icmp->arg[0], k, icmp, fn); + fixarg(&icmp->arg[1], k, icmp, fn); + emit(op, i.cls, r1, i.arg[1], i.arg[1]); + icmp = curi; + fixarg(&icmp->arg[0], k, icmp, fn); + fixarg(&icmp->arg[1], k, icmp, fn); + return; + case NCmpI+Cfne: + swap = 0, neg = 1; + i.op = KWIDE(k) ? Oceqd : Oceqs; + break; + default: + assert(0 && "unknown comparison"); + } + if (op < NCmpI) + i.op = sign ? Ocsltl : Ocultl; + if (swap) { + r = i.arg[0]; + i.arg[0] = i.arg[1]; + i.arg[1] = r; + } + if (neg) + negate(&i.to, fn); + emiti(i); + icmp = curi; + fixarg(&icmp->arg[0], k, icmp, fn); + fixarg(&icmp->arg[1], k, icmp, fn); +} + +static void +sel(Ins i, Fn *fn) +{ + Ref r0, r1; + Ins *i0; + int ck, cc; + int64_t sz; + + switch (i.op) { + case Onop: + break; + case Oalloc4: + case Oalloc8: + case Oalloc16: + /* we need to make sure + * the stack remains aligned + * (rsp = 0) mod 16 + */ + fn->dynalloc = 1; + if (rtype(i.arg[0]) == RCon) { + sz = fn->con[i.arg[0].val].bits.i; + if (sz < 0) + err("invalid alloc size %"PRId64, sz); + sz = (sz + 15) & -16; + emit(Osalloc, Kl, i.to, getcon(sz, fn), R); + fixarg(&curi->arg[0], Kl, curi, fn); + } else { + /* r0 = (i.arg[0] + 15) & -16 */ + r0 = newtmp("isel", Kl, fn); + r1 = newtmp("isel", Kl, fn); + emit(Osalloc, Kl, i.to, r0, R); + emit(Oand, Kl, r0, r1, getcon(-16, fn)); + emit(Oadd, Kl, r1, i.arg[0], getcon(15, fn)); + if (fn->tmp[i.arg[0].val].slot != -1) + err("unlikely argument %%%s in %s", + fn->tmp[i.arg[0].val].name, optab[i.op].name); + } + break; + default: + if (iscmp(i.op, &ck, &cc)) { + selcmp(i, ck, cc, fn); + break; + } + emiti(i); + i0 = curi; /* fixarg() can change curi */ + fixarg(&i0->arg[0], argcls(&i, 0), i0, fn); + fixarg(&i0->arg[1], argcls(&i, 1), i0, fn); + } +} + +static void +seljmp(Blk *b, Fn *fn) +{ + /* TODO: replace cmp+jnz with beq/bne/blt[u]/bge[u] */ + if (b->jmp.type == Jjnz) + fixarg(&b->jmp.arg, Kw, 0, fn); +} + +void +rv64_isel(Fn *fn) +{ + Blk *b, **sb; + Ins *i; + Phi *p; + uint n; + int al; + int64_t sz; + + /* assign slots to fast allocs */ + b = fn->start; + /* specific to NAlign == 3 */ /* or change n=4 and sz /= 4 below */ + for (al=Oalloc, n=4; al<=Oalloc1; al++, n*=2) + for (i=b->ins; i<&b->ins[b->nins]; i++) + if (i->op == al) { + if (rtype(i->arg[0]) != RCon) + break; + sz = fn->con[i->arg[0].val].bits.i; + if (sz < 0 || sz >= INT_MAX-15) + err("invalid alloc size %"PRId64, sz); + sz = (sz + n-1) & -n; + sz /= 4; + if (sz > INT_MAX - fn->slot) + die("alloc too large"); + fn->tmp[i->to.val].slot = fn->slot; + fn->slot += sz; + *i = (Ins){.op = Onop}; + } + + for (b=fn->start; b; b=b->link) { + curi = &insb[NIns]; + for (sb=(Blk*[3]){b->s1, b->s2, 0}; *sb; sb++) + for (p=(*sb)->phi; p; p=p->link) { + for (n=0; p->blk[n] != b; n++) + assert(n+1 < p->narg); + fixarg(&p->arg[n], p->cls, 0, fn); + } + seljmp(b, fn); + for (i=&b->ins[b->nins]; i!=b->ins;) + sel(*--i, fn); + b->nins = &insb[NIns] - curi; + idup(&b->ins, curi, b->nins); + } + + if (debug['I']) { + fprintf(stderr, "\n> After instruction selection:\n"); + printfn(fn, stderr); + } +} diff --git a/rv64/targ.c b/rv64/targ.c new file mode 100644 index 0000000..ead8fe2 --- /dev/null +++ b/rv64/targ.c @@ -0,0 +1,53 @@ +#include "all.h" + +Rv64Op rv64_op[NOp] = { +#define O(op, t, x) [O##op] = +#define V(imm) { imm }, +#include "../ops.h" +}; + +int rv64_rsave[] = { + T0, T1, T2, T3, T4, T5, + A0, A1, A2, A3, A4, A5, A6, A7, + FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7, + FT0, FT1, FT2, FT3, FT4, FT5, FT6, FT7, + FT8, FT9, FT10, FT11, + -1 +}; +int rv64_rclob[] = { + S1, S2, S3, S4, S5, S6, S7, + S8, S9, S10, S11, + FS0, FS1, FS2, FS3, FS4, FS5, FS6, FS7, + FS8, FS9, FS10, FS11, + -1 +}; + +/* T6 used as swap register (TODO: is there a better choice?) */ +#define RGLOB (BIT(FP) | BIT(SP) | BIT(GP) | BIT(TP) | BIT(RA) | BIT(T6)) + +static int +rv64_memargs(int op) +{ + (void)op; + return 0; +} + +Target T_rv64 = { + .gpr0 = T0, + .ngpr = NGPR, + .fpr0 = FT0, + .nfpr = NFPR, + .rglob = RGLOB, + .nrglob = 6, + .rsave = rv64_rsave, + .nrsave = {NGPS, NFPS}, + .retregs = rv64_retregs, + .argregs = rv64_argregs, + .memargs = rv64_memargs, + .abi = rv64_abi, + .isel = rv64_isel, + .emitfn = rv64_emitfn, +}; + +MAKESURE(rsave_size_ok, sizeof rv64_rsave == (NGPS+NFPS+1) * sizeof(int)); +MAKESURE(rclob_size_ok, sizeof rv64_rclob == (NCLR+1) * sizeof(int)); diff --git a/test/dark.ssa b/test/dark.ssa index a1b2e60..de58e4c 100644 --- a/test/dark.ssa +++ b/test/dark.ssa @@ -1,4 +1,4 @@ -# skip arm64 +# skip arm64 rv64 # a hack example, # we use a dark type to get # a pointer to the stack. diff --git a/tools/test.sh b/tools/test.sh index c5e5b37..1b23469 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -43,6 +43,30 @@ init() { fi bin="$bin -t arm64" ;; + rv64) + for p in riscv64-linux-musl riscv64-linux-gnu + do + cc="$p-gcc -no-pie" + qemu="qemu-riscv64" + if + $cc -v >/dev/null 2>&1 && + $qemu -version >/dev/null 2>&1 + then + if sysroot=$($cc -print-sysroot) && test -n "$sysroot" + then + qemu="$qemu -L $sysroot" + fi + break + fi + cc= + done + if test -z "$cc" + then + echo "Cannot find riscv64 compiler or qemu." + exit 1 + fi + bin="$bin -t rv64" + ;; "") case `uname` in *Darwin*) From e7c13e8d0191d9e8987af42a8561fceba0f6c2f1 Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Wed, 23 Feb 2022 10:33:16 -0500 Subject: [PATCH 260/286] fix folding of shifts of word operand by >32 --- fold.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fold.c b/fold.c index 5d3c83c..58a7c4f 100644 --- a/fold.c +++ b/fold.c @@ -377,9 +377,9 @@ foldint(Con *res, int op, int w, Con *cl, Con *cr) case Oand: x = l.u & r.u; break; case Oor: x = l.u | r.u; break; case Oxor: x = l.u ^ r.u; break; - case Osar: x = (w ? l.s : (int32_t)l.s) >> (r.u & 63); break; - case Oshr: x = (w ? l.u : (uint32_t)l.u) >> (r.u & 63); break; - case Oshl: x = l.u << (r.u & 63); break; + case Osar: x = (w ? l.s : (int32_t)l.s) >> (r.u & (31|w<<5)); break; + case Oshr: x = (w ? l.u : (uint32_t)l.u) >> (r.u & (31|w<<5)); break; + case Oshl: x = l.u << (r.u & (31|w<<5)); break; case Oextsb: x = (int8_t)l.u; break; case Oextub: x = (uint8_t)l.u; break; case Oextsh: x = (int16_t)l.u; break; From e04a2cd281ce34d985933489b7a9562658a5b07f Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Thu, 17 Feb 2022 18:09:26 -0500 Subject: [PATCH 261/286] doc: minor fixes --- doc/il.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/il.txt b/doc/il.txt index 0e05283..635357c 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -751,7 +751,7 @@ Extending the precision of a temporary is done using the `ext` family of instructions. Because QBE types do not precise the signedness (like in LLVM), extension instructions exist to sign-extend and zero-extend a value. For example, -`extsb` takes a word argument and sign-extend the 8 +`extsb` takes a word argument and sign-extends the 8 least-significant bits to a full word or long, depending on the return type. @@ -763,7 +763,7 @@ zero. Converting between signed integers and floating points is done using `stosi` (single to signed integer), `stoui` (single to -unsigned integer`, `dtosi` (double to signed integer), `dtoui` +unsigned integer, `dtosi` (double to signed integer), `dtoui` (double to unsigned integer), `swtof` (signed word to float), `uwtof` (unsigned word to float), `sltof` (signed long to float) and `ultof` (unsigned long to float). From 979385718b9f047ea69bb49459faaf27e3470c75 Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Thu, 17 Feb 2022 18:24:03 -0500 Subject: [PATCH 262/286] parse: allow string after first data item --- parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.c b/parse.c index fb8b509..c9638fd 100644 --- a/parse.c +++ b/parse.c @@ -1047,7 +1047,7 @@ parsedat(void cb(Dat *), Lnk *lnk) err("constant literal expected"); cb(&d); t = nextnl(); - } while (t == Tint || t == Tflts || t == Tfltd); + } while (t == Tint || t == Tflts || t == Tfltd || t == Tstr); if (t == Trbrace) break; if (t != Tcomma) From 42cbdc04d034bde82573d6503f4755823915de5a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 25 Feb 2022 10:47:41 +0100 Subject: [PATCH 263/286] improve consistency in arm64 and rv64 abis --- arm64/abi.c | 18 +++++++++--------- rv64/abi.c | 34 +++++++++++++++++++--------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/arm64/abi.c b/arm64/abi.c index db794f6..18e8ef3 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -1,6 +1,6 @@ #include "all.h" -typedef struct Class_ Class; +typedef struct Class Class; typedef struct Insl Insl; typedef struct Params Params; @@ -9,7 +9,7 @@ enum { Cptr = 2, /* replaced by a pointer */ }; -struct Class_ { +struct Class { char class; char ishfa; struct { @@ -213,16 +213,16 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env) switch (i->op) { case Opar: case Oarg: - c->cls[0] = i->cls; + *c->cls = i->cls; c->size = 8; if (KBASE(i->cls) == 0 && ngp > 0) { ngp--; - c->reg[0] = *gp++; + *c->reg = *gp++; break; } if (KBASE(i->cls) == 1 && nfp > 0) { nfp--; - c->reg[0] = *fp++; + *c->reg = *fp++; break; } c->class |= Cstk; @@ -233,8 +233,8 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env) if (c->class & Cptr) { if (ngp > 0) { ngp--; - c->reg[0] = *gp++; - c->cls[0] = Kl; + *c->reg = *gp++; + *c->cls = Kl; break; } } else if (c->ngp <= ngp) { @@ -382,7 +382,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) envc = !req(R, env); if (envc) - die("todo (arm abi): env calls"); + die("todo: env calls"); if (cty & (1 << 13)) /* struct return argument */ @@ -479,7 +479,7 @@ selpar(Fn *fn, Ins *i0, Ins *i1) } if (!req(R, env)) - die("todo (arm abi): env calls"); + die("todo: env calls"); return (Params){ .nstk = s - 2, diff --git a/rv64/abi.c b/rv64/abi.c index 1dd4fb0..ece7a6e 100644 --- a/rv64/abi.c +++ b/rv64/abi.c @@ -117,6 +117,7 @@ typclass(Class *c, Typ *t, int *gp, int *fp) c->size = sz; /* TODO: float */ + (void)fp; for (n=0; nngp++) { c->reg[n] = *gp++; @@ -222,17 +223,17 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env, int retptr) switch (i->op) { case Opar: case Oarg: - c->cls[0] = i->cls; + *c->cls = i->cls; c->size = 8; /* variadic float args are passed in int regs */ if (!vararg && KBASE(i->cls) == 1 && nfp > 0) { nfp--; - c->reg[0] = *fp++; + *c->reg = *fp++; } else if (ngp > 0) { if (KBASE(i->cls) == 1) c->class |= Cfpint; ngp--; - c->reg[0] = *gp++; + *c->reg = *gp++; } else { c->class |= Cstk1; } @@ -246,8 +247,8 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env, int retptr) typclass(c, &typ[i->arg[0].val], gp, fp); if (c->class & Cptr) { c->ngp = 1; - c->reg[0] = *gp; - c->cls[0] = Kl; + *c->reg = *gp; + *c->cls = Kl; } if (c->ngp <= ngp && c->nfp <= nfp) { ngp -= c->ngp; @@ -353,7 +354,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) envc = !req(R, env); if (envc) - die("todo (rv64 abi): env calls"); + die("todo: env calls"); emit(Ocall, 0, R, i1->arg[0], CALL(cty)); if (cr.class & Cptr) @@ -369,16 +370,18 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) } else if (c->class & Cfpint) { k = KWIDE(*c->cls) ? Kl : Kw; r = newtmp("abi", k, fn); - emit(Ocopy, k, TMP(c->reg[0]), r, R); - c->reg[0] = r.val; + emit(Ocopy, k, TMP(*c->reg), r, R); + *c->reg = r.val; } else { emit(Ocopy, *c->cls, TMP(*c->reg), i->arg[0], R); } } for (i=i0, c=ca; iclass & Cfpint) - emit(Ocast, KWIDE(*c->cls) ? Kl : Kw, TMP(*c->reg), i->arg[0], R); + if (c->class & Cfpint) { + k = KWIDE(*c->cls) ? Kl : Kw; + emit(Ocast, k, TMP(*c->reg), i->arg[0], R); + } if (c->class & Cptr) blit(i->arg[0], 0, i->arg[1], c->t->size, fn); } @@ -391,7 +394,6 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) if (i->op == Oargv || (c->class & Cstk) == 0) continue; if (i->op != Oargc) { - r1 = newtmp("abi", Kl, fn); /* w arguments are stored sign-extended * to 64-bits * @@ -400,7 +402,8 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) * stack position since the ABI says the * upper bits are undefined */ - emit(i->cls == Kw ? Ostorel : Ostorew+i->cls, 0, R, i->arg[0], r1); + r1 = newtmp("abi", Kl, fn); + emit(Ostorew+i->cls, Kw, R, i->arg[0], r1); if (i->cls == Kw) { /* TODO: we only need this sign extension * for subtyped l temporaries passed as w @@ -410,6 +413,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) * since by that point we have forgotten * the original argument type */ + curi->op = Ostorel; curi->arg[0] = newtmp("abi", Kl, fn); emit(Oextsw, Kl, curi->arg[0], i->arg[0], R); } @@ -472,15 +476,15 @@ selpar(Fn *fn, Ins *i0, Ins *i1) } } } else if (c->class & Cstk1) { - emit(Oload, c->cls[0], i->to, SLOT(-s), R); + emit(Oload, *c->cls, i->to, SLOT(-s), R); s++; } else { - emit(Ocopy, c->cls[0], i->to, TMP(c->reg[0]), R); + emit(Ocopy, *c->cls, i->to, TMP(*c->reg), R); } } if (!req(R, env)) - die("todo (rv64 abi): env calls"); + die("todo: env calls"); return (Params){ .stk = s, From 65821c9b14f8a950ed8b82be085da4a698ebf20d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 25 Feb 2022 10:51:22 +0100 Subject: [PATCH 264/286] disable pie for rv64 tests --- tools/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test.sh b/tools/test.sh index 1b23469..fc96dba 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -46,7 +46,7 @@ init() { rv64) for p in riscv64-linux-musl riscv64-linux-gnu do - cc="$p-gcc -no-pie" + cc="$p-gcc -no-pie -static" qemu="qemu-riscv64" if $cc -v >/dev/null 2>&1 && From c0cdef2e447aa9acf7494d4968151aaebc601955 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 25 Feb 2022 11:09:04 +0100 Subject: [PATCH 265/286] rv64: cosmetics in isel --- rv64/isel.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rv64/isel.c b/rv64/isel.c index bb6fb02..e441597 100644 --- a/rv64/isel.c +++ b/rv64/isel.c @@ -3,8 +3,11 @@ static int memarg(Ref *r, int op, Ins *i) { - return ((isload(op) || op == Ocall) && r == &i->arg[0]) - || (isstore(op) && r == &i->arg[1]); + if (isload(op) || op == Ocall) + return r == &i->arg[0]; + if (isstore(op)) + return r == &i->arg[1]; + return 0; } static int @@ -28,8 +31,8 @@ fixarg(Ref *r, int k, Ins *i, Fn *fn) c = &fn->con[r0.val]; if (c->type == CAddr && memarg(r, op, i)) break; - if (c->type == CBits && immarg(r, op, i) - && -2048 <= c->bits.i && c->bits.i < 2048) + if (c->type == CBits && immarg(r, op, i)) + if (-2048 <= c->bits.i && c->bits.i < 2048) break; r1 = newtmp("isel", k, fn); if (KBASE(k) == 1) { @@ -131,7 +134,7 @@ selcmp(Ins i, int k, int op, Fn *fn) break; case NCmpI+Cfuo: negate(&i.to, fn); - /* fallthrough */ + /* fall through */ case NCmpI+Cfo: r0 = newtmp("isel", i.cls, fn); r1 = newtmp("isel", i.cls, fn); From ddd101df6622ed38736d8600e72f8a18b4e964bf Mon Sep 17 00:00:00 2001 From: Scott Graham Date: Thu, 24 Feb 2022 22:35:18 -0800 Subject: [PATCH 266/286] doc: Add missing neg entry to index --- doc/il.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/il.txt b/doc/il.txt index 635357c..928d16c 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -956,6 +956,7 @@ instructions unless you know exactly what you are doing. * `and` * `div` * `mul` + * `neg` * `or` * `rem` * `sar` From 457e568ce9deb0476062fe89383f9a9a6f706e0a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sun, 27 Feb 2022 11:26:50 +0100 Subject: [PATCH 267/286] rv64: formatting and bug fix in epilogue --- rv64/emit.c | 68 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/rv64/emit.c b/rv64/emit.c index b34b424..841c555 100644 --- a/rv64/emit.c +++ b/rv64/emit.c @@ -104,11 +104,13 @@ static char *rname[] = { [T6] = "t6", [T0] = "t0", "t1", "t2", "t3", "t4", "t5", [A0] = "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", - [S1] = "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s10", "s11", - - [FT0] = "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", "ft8", "ft9", "ft10", "ft11", + [S1] = "s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", + "s9", "s10", "s11", + [FT0] = "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", + "ft8", "ft9", "ft10", "ft11", [FA0] = "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6", "fa7", - [FS0] = "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", "fs8", "fs9", "fs10", "fs11", + [FS0] = "fs0", "fs1", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", + "fs8", "fs9", "fs10", "fs11", }; static int64_t @@ -184,7 +186,7 @@ emitf(char *s, Ins *i, Fn *fn, FILE *f) case RCon: pc = &fn->con[r.val]; assert(pc->type == CBits); - assert(pc->bits.i >= -2048 && pc->bits.i <= 2047); + assert(pc->bits.i >= -2048 && pc->bits.i < 2048); fprintf(f, "%d", (int)pc->bits.i); break; } @@ -414,37 +416,50 @@ rv64_emitfn(Fn *fn, FILE *f) gasemitlnk(fn->name, &fn->lnk, ".text", f); if (fn->vararg) { - /* TODO: only need space for registers unused by named arguments */ + /* TODO: only need space for registers + * unused by named arguments + */ fprintf(f, "\tadd sp, sp, -64\n"); - for (r = A0; r <= A7; r++) - fprintf(f, "\tsd %s, %d(sp)\n", rname[r], 8 * (r - A0)); + for (r=A0; r<=A7; r++) + fprintf(f, + "\tsd %s, %d(sp)\n", + rname[r], 8 * (r - A0) + ); } fprintf(f, "\tsd fp, -16(sp)\n"); fprintf(f, "\tsd ra, -8(sp)\n"); fprintf(f, "\tadd fp, sp, -16\n"); frame = (16 + 4 * fn->slot + 15) & ~15; - for (pr = rv64_rclob; *pr>=0; pr++) { + for (pr=rv64_rclob; *pr>=0; pr++) { if (fn->reg & BIT(*pr)) frame += 8; } frame = (frame + 15) & ~15; if (frame <= 2048) - fprintf(f, "\tadd sp, sp, -%d\n", frame); + fprintf(f, + "\tadd sp, sp, -%d\n", + frame + ); else fprintf(f, "\tli t6, %d\n" "\tsub sp, sp, t6\n", - frame); - for (pr = rv64_rclob, off = 0; *pr >= 0; pr++) { + frame + ); + for (pr=rv64_rclob, off=0; *pr>=0; pr++) { if (fn->reg & BIT(*pr)) { - fprintf(f, "\t%s %s, %d(sp)\n", *pr < FT0 ? "sd" : "fsd", rname[*pr], off); + fprintf(f, + "\t%s %s, %d(sp)\n", + *pr < FT0 ? "sd" : "fsd", + rname[*pr], off + ); off += 8; } } - for (lbl = 0, b = fn->start; b; b=b->link) { + for (lbl=0, b=fn->start; b; b=b->link) { if (lbl || b->npred > 1) fprintf(f, ".L%d:\n", id0+b->id); for (i=b->ins; i!=&b->ins[b->nins]; i++) @@ -454,16 +469,24 @@ rv64_emitfn(Fn *fn, FILE *f) case Jret0: if (fn->dynalloc) { if (frame - 16 <= 2048) - fprintf(f, "\tadd sp, fp, -%d\n", frame - 16); + fprintf(f, + "\tadd sp, fp, -%d\n", + frame - 16 + ); else fprintf(f, "\tli t6, %d\n" - "\tsub sp, sp, t6\n", - frame - 16); + "\tsub sp, fp, t6\n", + frame - 16 + ); } - for (pr = rv64_rclob, off = 0; *pr >= 0; pr++) { + for (pr=rv64_rclob, off=0; *pr>=0; pr++) { if (fn->reg & BIT(*pr)) { - fprintf(f, "\t%s %s, %d(sp)\n", *pr < FT0 ? "ld" : "fld", rname[*pr], off); + fprintf(f, + "\t%s %s, %d(sp)\n", + *pr < FT0 ? "ld" : "fld", + rname[*pr], off + ); off += 8; } } @@ -491,7 +514,12 @@ rv64_emitfn(Fn *fn, FILE *f) neg = 1; } assert(isreg(b->jmp.arg)); - fprintf(f, "\tb%sz %s, .L%d\n", neg ? "ne" : "eq", rname[b->jmp.arg.val], id0+b->s2->id); + fprintf(f, + "\tb%sz %s, .L%d\n", + neg ? "ne" : "eq", + rname[b->jmp.arg.val], + id0+b->s2->id + ); goto Jmp; } } From 3d294346ab168fd0b12761711fbe667e47fd644e Mon Sep 17 00:00:00 2001 From: "lincoln auster [they/them]" Date: Sat, 5 Mar 2022 22:36:31 -0700 Subject: [PATCH 268/286] doc: export function main in hello world example This enables the example to be compiled and run as-is, without any additional modification. --- doc/il.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/il.txt b/doc/il.txt index 928d16c..6d9345b 100644 --- a/doc/il.txt +++ b/doc/il.txt @@ -63,7 +63,7 @@ a # character and finish with the end of the line. # Define the string constant. data $str = { b "hello world", b 0 } - function w $main() { + export function w $main() { @start # Call the puts function with $str as argument. %r =w call $puts(l $str) From 349794f3e4f11e4cc34a501ba935a2a305229738 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 8 Mar 2022 15:33:21 +0100 Subject: [PATCH 269/286] cosmetics --- all.h | 3 ++- amd64/sysv.c | 4 ++-- arm64/abi.c | 10 +++++++--- doc/rv64.txt | 2 +- live.c | 2 +- rv64/abi.c | 6 +++--- util.c | 12 +++++++++--- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/all.h b/all.h index c19b4ae..a62b19b 100644 --- a/all.h +++ b/all.h @@ -441,7 +441,8 @@ void chuse(Ref, int, Fn *); Ref newcon(Con *, Fn *); Ref getcon(int64_t, Fn *); int addcon(Con *, Con *); -void blit(Ref, uint, Ref, uint, Fn *); +void blit(Ref, uint, Ref, uint, uint, Fn *); +void blit0(Ref, Ref, uint, Fn *); void dumpts(BSet *, Tmp *, FILE *); void bsinit(BSet *, uint); diff --git a/amd64/sysv.c b/amd64/sysv.c index 7dc5981..7287f41 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -127,7 +127,7 @@ selret(Blk *b, Fn *fn) if (aret.inmem) { assert(rtype(fn->retr) == RTmp); emit(Ocopy, Kl, TMP(RAX), fn->retr, R); - blit(fn->retr, 0, r0, aret.type->size, fn); + blit0(fn->retr, r0, aret.type->size, fn); ca = 1; } else { ca = retr(reg, &aret); @@ -413,7 +413,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) if (i->op == Oargc) { if (a->align == 4) off += off & 15; - blit(r, off, i->arg[1], a->type->size, fn); + blit(r, off, i->arg[1], 0, a->type->size, fn); } else { r1 = newtmp("abi", Kl, fn); emit(Ostorel, 0, R, i->arg[0], r1); diff --git a/arm64/abi.c b/arm64/abi.c index 18e8ef3..f127576 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -181,7 +181,7 @@ selret(Blk *b, Fn *fn) cty = (cr.nfp << 2) | cr.ngp; if (cr.class & Cptr) { assert(rtype(fn->retr) == RTmp); - blit(fn->retr, 0, r, cr.t->size, fn); + blit0(fn->retr, r, cr.t->size, fn); } else ldregs(cr.reg, cr.cls, cr.nreg, r, fn); } else { @@ -359,6 +359,10 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) stkblob(i1->to, &cr, fn, ilp); cty |= (cr.nfp << 2) | cr.ngp; if (cr.class & Cptr) { + /* spill & rega expect calls to be + * followed by copies from regs, + * so we emit a dummy + */ cty |= 1 << 13 | 1; emit(Ocopy, Kw, R, TMP(R0), R); } else { @@ -407,7 +411,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) emit(Oadd, Kl, r, TMP(SP), getcon(off, fn)); } if (i->op == Oargc) - blit(TMP(SP), off, i->arg[1], c->size, fn); + blit(TMP(SP), off, i->arg[1], 0, c->size, fn); off += c->size; } if (stk) @@ -415,7 +419,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) for (i=i0, c=ca; iclass & Cptr) - blit(i->arg[0], 0, i->arg[1], c->t->size, fn); + blit0(i->arg[0], i->arg[1], c->t->size, fn); } static Params diff --git a/doc/rv64.txt b/doc/rv64.txt index e696d77..17f6072 100644 --- a/doc/rv64.txt +++ b/doc/rv64.txt @@ -17,4 +17,4 @@ rv64_isel() could turn compare used only with jnz into b{lt,ge}[u]. RISC-V spec: https://github.com/riscv/riscv-isa-manual/releases/latest/download/riscv-spec.pdf ASM manual: https://github.com/riscv-non-isa/riscv-asm-manual/blob/master/riscv-asm.md -psABI: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc +ABI: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc diff --git a/live.c b/live.c index 4198995..a1b4219 100644 --- a/live.c +++ b/live.c @@ -103,7 +103,7 @@ filllive(Fn *f) if (!req(i->to, R)) { assert(rtype(i->to) == RTmp); t = i->to.val; - if (bshas(b->in, i->to.val)) + if (bshas(b->in, t)) nlv[KBASE(f->tmp[t].cls)]--; bsset(b->gen, t); bsclr(b->in, t); diff --git a/rv64/abi.c b/rv64/abi.c index ece7a6e..05deabe 100644 --- a/rv64/abi.c +++ b/rv64/abi.c @@ -185,7 +185,7 @@ selret(Blk *b, Fn *fn) cty = (cr.nfp << 2) | cr.ngp; if (cr.class & Cptr) { assert(rtype(fn->retr) == RTmp); - blit(fn->retr, 0, r, cr.t->size, fn); + blit0(fn->retr, r, cr.t->size, fn); } else { ldregs(cr.reg, cr.cls, cr.nreg, r, fn); } @@ -383,7 +383,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) emit(Ocast, k, TMP(*c->reg), i->arg[0], R); } if (c->class & Cptr) - blit(i->arg[0], 0, i->arg[1], c->t->size, fn); + blit0(i->arg[0], i->arg[1], c->t->size, fn); } if (!stk) @@ -419,7 +419,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) } emit(Oadd, Kl, r1, r, getcon(off, fn)); } else - blit(r, off, i->arg[1], c->t->size, fn); + blit(r, off, i->arg[1], 0, c->t->size, fn); off += c->size; } emit(Osalloc, Kl, r, getcon(stk, fn), R); diff --git a/util.c b/util.c index c8b0b9c..5296b86 100644 --- a/util.c +++ b/util.c @@ -399,7 +399,7 @@ addcon(Con *c0, Con *c1) } void -blit(Ref rdst, uint doff, Ref rsrc, uint sz, Fn *fn) +blit(Ref rdst, uint doff, Ref rsrc, uint boff, uint sz, Fn *fn) { struct { int st, ld, cls, size; } *p, tbl[] = { { Ostorel, Oload, Kl, 8 }, @@ -408,9 +408,9 @@ blit(Ref rdst, uint doff, Ref rsrc, uint sz, Fn *fn) { Ostoreb, Oloadub, Kw, 1 } }; Ref r, r1; - uint boff, s; + uint s; - for (boff=0, p=tbl; sz; p++) + for (p=tbl; sz; p++) for (s=p->size; sz>=s; sz-=s, doff+=s, boff+=s) { r = newtmp("blt", Kl, fn); r1 = newtmp("blt", Kl, fn); @@ -422,6 +422,12 @@ blit(Ref rdst, uint doff, Ref rsrc, uint sz, Fn *fn) } } +void +blit0(Ref rdst, Ref rsrc, uint sz, Fn *fn) +{ + blit(rdst, 0, rsrc, 0, sz, fn); +} + void bsinit(BSet *bs, uint n) { From 9060981c10c21834596d5677a2c9ccc56809eb64 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 8 Mar 2022 15:49:01 +0100 Subject: [PATCH 270/286] flag types defined as unions The risc-v abi needs to know if a type is defined as a union or not. We cannot use nunion to obtain this information because the risc-v abi made the unfortunate decision of treating union { int i; } differently from int i; So, instead, I introduce a single bit flag 'isunion'. --- all.h | 3 ++- amd64/sysv.c | 2 +- arm64/abi.c | 2 +- parse.c | 10 ++++++---- rv64/abi.c | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/all.h b/all.h index a62b19b..f806c5b 100644 --- a/all.h +++ b/all.h @@ -357,7 +357,8 @@ struct Fn { struct Typ { char name[NString]; - int dark; + char isdark; + char isunion; int align; uint64_t size; uint nunion; diff --git a/amd64/sysv.c b/amd64/sysv.c index 7287f41..e9f3d6b 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -77,7 +77,7 @@ typclass(AClass *a, Typ *t) a->size = sz; a->align = t->align; - if (t->dark || sz > 16 || sz == 0) { + if (t->isdark || sz > 16 || sz == 0) { /* large or unaligned structures are * required to be passed in memory */ diff --git a/arm64/abi.c b/arm64/abi.c index f127576..6ed393d 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -94,7 +94,7 @@ typclass(Class *c, Typ *t, int *gp, int *fp) if (t->align > 4) err("alignments larger than 16 are not supported"); - if (t->dark || sz > 16 || sz == 0) { + if (t->isdark || sz > 16 || sz == 0) { /* large structs are replaced by a * pointer to some caller-allocated * memory */ diff --git a/parse.c b/parse.c index c9638fd..70c291b 100644 --- a/parse.c +++ b/parse.c @@ -925,7 +925,8 @@ parsetyp() */ vgrow(&typ, ntyp+1); ty = &typ[ntyp++]; - ty->dark = 0; + ty->isdark = 0; + ty->isunion = 0; ty->align = -1; ty->size = 0; if (nextnl() != Ttyp || nextnl() != Teq) @@ -944,7 +945,7 @@ parsetyp() err("type body must start with {"); t = nextnl(); if (t == Tint) { - ty->dark = 1; + ty->isdark = 1; ty->size = tokval.num; if (ty->align == -1) err("dark types need alignment"); @@ -954,7 +955,8 @@ parsetyp() } n = 0; ty->fields = vnew(1, sizeof ty->fields[0], Pheap); - if (t == Tlbrace) + if (t == Tlbrace) { + ty->isunion = 1; do { if (t != Tlbrace) err("invalid union member"); @@ -962,7 +964,7 @@ parsetyp() parsefields(ty->fields[n++], ty, nextnl()); t = nextnl(); } while (t != Trbrace); - else + } else parsefields(ty->fields[n++], ty, t); ty->nunion = n; } diff --git a/rv64/abi.c b/rv64/abi.c index 05deabe..b49057b 100644 --- a/rv64/abi.c +++ b/rv64/abi.c @@ -105,7 +105,7 @@ typclass(Class *c, Typ *t, int *gp, int *fp) if (t->align > 4) err("alignments larger than 16 are not supported"); - if (t->dark || sz > 16 || sz == 0) { + if (t->isdark || sz > 16 || sz == 0) { /* large structs are replaced by a * pointer to some caller-allocated * memory */ From 7f7e34cd1fba56fa7e4adddc8646fa47dcf02a6d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 10 Mar 2022 16:01:50 +0100 Subject: [PATCH 271/286] new abi stress test --- test/abi8.ssa | 257 ++++++++++++++++++++++++++++++++++++++++++++++++++ tools/abi8.py | 110 +++++++++++++++++++++ 2 files changed, 367 insertions(+) create mode 100644 test/abi8.ssa create mode 100755 tools/abi8.py diff --git a/test/abi8.ssa b/test/abi8.ssa new file mode 100644 index 0000000..ae59961 --- /dev/null +++ b/test/abi8.ssa @@ -0,0 +1,257 @@ +# riscv64 ABI stress +# see tools/abi8.py + +type :fi1 = { h, s } # in a gp & fp pair +type :fi2 = { s, w } # ditto +type :uw = { { w } } +type :fi3 = { s, :uw } # in a single gp reg +type :ss = { s, s } # in two fp regs +type :sd = { s, d } # ditto +type :ww = { w, w } # in a single gp reg +type :lb = { l, b } # in two gp regs +type :big = { b 17 } # by reference + +data $ctoqbestr = { b "c->qbe(%d)", b 0 } +data $emptystr = { b 0 } + +export +function $qfn0(s %p0, s %p1, s %p2, s %p3, s %p4, s %p5, s %p6, s %p7, s %p8) { +@start + %r0 =w call $printf(l $ctoqbestr, w 0) + call $ps(s %p8) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn1(w %p0, s %p1, :fi1 %p2) { +@start + %r0 =w call $printf(l $ctoqbestr, w 1) + call $pw(w %p0) + call $ps(s %p1) + call $pfi1(l %p2) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn2(w %p0, :fi2 %p1, s %p2) { +@start + %r0 =w call $printf(l $ctoqbestr, w 2) + call $pw(w %p0) + call $pfi2(l %p1) + call $ps(s %p2) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn3(w %p0, s %p1, :fi3 %p2) { +@start + %r0 =w call $printf(l $ctoqbestr, w 3) + call $pw(w %p0) + call $ps(s %p1) + call $pfi3(l %p2) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn4(:ss %p0) { +@start + %r0 =w call $printf(l $ctoqbestr, w 4) + call $pss(l %p0) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn5(d %p0, d %p1, d %p2, d %p3, d %p4, d %p5, d %p6, :ss %p7, s %p8, l %p9) { +@start + %r0 =w call $printf(l $ctoqbestr, w 5) + call $pss(l %p7) + call $ps(s %p8) + call $pl(l %p9) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn6(:lb %p0) { +@start + %r0 =w call $printf(l $ctoqbestr, w 6) + call $plb(l %p0) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn7(w %p0, w %p1, w %p2, w %p3, w %p4, w %p5, w %p6, :lb %p7) { +@start + %r0 =w call $printf(l $ctoqbestr, w 7) + call $plb(l %p7) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn8(w %p0, w %p1, w %p2, w %p3, w %p4, w %p5, w %p6, w %p7, :lb %p8) { +@start + %r0 =w call $printf(l $ctoqbestr, w 8) + call $plb(l %p8) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn9(:big %p0) { +@start + %r0 =w call $printf(l $ctoqbestr, w 9) + call $pbig(l %p0) + %r1 =w call $puts(l $emptystr) + ret +} +export +function $qfn10(w %p0, w %p1, w %p2, w %p3, w %p4, w %p5, w %p6, w %p7, :big %p8, s %p9, l %p10) { +@start + %r0 =w call $printf(l $ctoqbestr, w 10) + call $pbig(l %p8) + call $ps(s %p9) + call $pl(l %p10) + %r1 =w call $puts(l $emptystr) + ret +} + +export +function w $main() { +@start + + call $cfn0(s 0, s 0, s 0, s 0, s 0, s 0, s 0, s 0, s s_9.9) + call $cfn1(w 1, s s_2.2, :fi1 $fi1) + call $cfn2(w 1, :fi2 $fi2, s s_3.3) + call $cfn3(w 1, s s_2.2, :fi3 $fi3) + call $cfn4(:ss $ss) + call $cfn5(d 0, d 0, d 0, d 0, d 0, d 0, d 0, :ss $ss, s s_9.9, l 10) + call $cfn6(:lb $lb) + call $cfn7(w 0, w 0, w 0, w 0, w 0, w 0, w 0, :lb $lb) + call $cfn8(w 0, w 0, w 0, w 0, w 0, w 0, w 0, w 0, :lb $lb) + call $cfn9(:big $big) + call $cfn10(w 0, w 0, w 0, w 0, w 0, w 0, w 0, w 0, :big $big, s s_10.10, l 11) + + ret 0 +} + +# >>> driver +# #include +# typedef struct { short h; float s; } Sfi1; +# typedef struct { float s; int w; } Sfi2; +# typedef struct { float s; union { int w; } u; } Sfi3; +# typedef struct { float s0, s1; } Sss; +# typedef struct { float s; double d; } Ssd; +# typedef struct { int w0, w1; } Sww; +# typedef struct { long l; char b; } Slb; +# typedef struct { char b[17]; } Sbig; +# Sfi1 zfi1, fi1 = { -123, 4.56 }; +# Sfi2 zfi2, fi2 = { 1.23, 456 }; +# Sfi3 zfi3, fi3 = { 3.45, 567 }; +# Sss zss, ss = { 1.23, 45.6 }; +# Ssd zsd, sd = { 2.34, 5.67 }; +# Sww zww, ww = { -123, -456 }; +# Slb zlb, lb = { 123, 'z' }; +# Sbig zbig, big = { "abcdefhijklmnopqr" }; +# void pfi1(Sfi1 *s) { printf(" { %d, %g }", s->h, s->s); } +# void pfi2(Sfi2 *s) { printf(" { %g, %d }", s->s, s->w); } +# void pfi3(Sfi3 *s) { printf(" { %g, %d }", s->s, s->u.w); } +# void pss(Sss *s) { printf(" { %g, %g }", s->s0, s->s1); } +# void psd(Ssd *s) { printf(" { %g, %g }", s->s, s->d); } +# void pww(Sww *s) { printf(" { %d, %d }", s->w0, s->w1); } +# void plb(Slb *s) { printf(" { %ld, '%c' }", s->l, s->b); } +# void pbig(Sbig *s) { printf(" \"%.17s\"", s->b); } +# void pw(int w) { printf(" %d", w); } +# void pl(long l) { printf(" %ld", l); } +# void ps(float s) { printf(" %g", s); } +# void pd(double d) { printf(" %g", d); } +# /* --------------------------- */ +# extern void qfn0(float, float, float, float, float, float, float, float, float); +# void cfn0(float p0, float p1, float p2, float p3, float p4, float p5, float p6, float p7, float p8) { +# printf("qbe->c(%d)", 0); +# ps(p8); puts(""); +# qfn0(p0, p1, p2, p3, p4, p5, p6, p7, p8); +# } +# extern void qfn1(int, float, Sfi1); +# void cfn1(int p0, float p1, Sfi1 p2) { +# printf("qbe->c(%d)", 1); +# pw(p0); ps(p1); pfi1(&p2); puts(""); +# qfn1(p0, p1, p2); +# } +# extern void qfn2(int, Sfi2, float); +# void cfn2(int p0, Sfi2 p1, float p2) { +# printf("qbe->c(%d)", 2); +# pw(p0); pfi2(&p1); ps(p2); puts(""); +# qfn2(p0, p1, p2); +# } +# extern void qfn3(int, float, Sfi3); +# void cfn3(int p0, float p1, Sfi3 p2) { +# printf("qbe->c(%d)", 3); +# pw(p0); ps(p1); pfi3(&p2); puts(""); +# qfn3(p0, p1, p2); +# } +# extern void qfn4(Sss); +# void cfn4(Sss p0) { +# printf("qbe->c(%d)", 4); +# pss(&p0); puts(""); +# qfn4(p0); +# } +# extern void qfn5(double, double, double, double, double, double, double, Sss, float, long); +# void cfn5(double p0, double p1, double p2, double p3, double p4, double p5, double p6, Sss p7, float p8, long p9) { +# printf("qbe->c(%d)", 5); +# pss(&p7); ps(p8); pl(p9); puts(""); +# qfn5(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); +# } +# extern void qfn6(Slb); +# void cfn6(Slb p0) { +# printf("qbe->c(%d)", 6); +# plb(&p0); puts(""); +# qfn6(p0); +# } +# extern void qfn7(int, int, int, int, int, int, int, Slb); +# void cfn7(int p0, int p1, int p2, int p3, int p4, int p5, int p6, Slb p7) { +# printf("qbe->c(%d)", 7); +# plb(&p7); puts(""); +# qfn7(p0, p1, p2, p3, p4, p5, p6, p7); +# } +# extern void qfn8(int, int, int, int, int, int, int, int, Slb); +# void cfn8(int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, Slb p8) { +# printf("qbe->c(%d)", 8); +# plb(&p8); puts(""); +# qfn8(p0, p1, p2, p3, p4, p5, p6, p7, p8); +# } +# extern void qfn9(Sbig); +# void cfn9(Sbig p0) { +# printf("qbe->c(%d)", 9); +# pbig(&p0); puts(""); +# qfn9(p0); +# } +# extern void qfn10(int, int, int, int, int, int, int, int, Sbig, float, long); +# void cfn10(int p0, int p1, int p2, int p3, int p4, int p5, int p6, int p7, Sbig p8, float p9, long p10) { +# printf("qbe->c(%d)", 10); +# pbig(&p8); ps(p9); pl(p10); puts(""); +# qfn10(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); +# } +# <<< + +# >>> output +# qbe->c(0) 9.9 +# c->qbe(0) 9.9 +# qbe->c(1) 1 2.2 { -123, 4.56 } +# c->qbe(1) 1 2.2 { -123, 4.56 } +# qbe->c(2) 1 { 1.23, 456 } 3.3 +# c->qbe(2) 1 { 1.23, 456 } 3.3 +# qbe->c(3) 1 2.2 { 3.45, 567 } +# c->qbe(3) 1 2.2 { 3.45, 567 } +# qbe->c(4) { 1.23, 45.6 } +# c->qbe(4) { 1.23, 45.6 } +# qbe->c(5) { 1.23, 45.6 } 9.9 10 +# c->qbe(5) { 1.23, 45.6 } 9.9 10 +# qbe->c(6) { 123, 'z' } +# c->qbe(6) { 123, 'z' } +# qbe->c(7) { 123, 'z' } +# c->qbe(7) { 123, 'z' } +# qbe->c(8) { 123, 'z' } +# c->qbe(8) { 123, 'z' } +# qbe->c(9) "abcdefhijklmnopqr" +# c->qbe(9) "abcdefhijklmnopqr" +# qbe->c(10) "abcdefhijklmnopqr" 10.1 11 +# c->qbe(10) "abcdefhijklmnopqr" 10.1 11 +# <<< diff --git a/tools/abi8.py b/tools/abi8.py new file mode 100755 index 0000000..4616ca5 --- /dev/null +++ b/tools/abi8.py @@ -0,0 +1,110 @@ +#!/usr/bin/python3 + +# support script to create +# the abi8.ssa test + +def ctype(arg): + if arg[0] == 'p': return ctype(arg[1:]) + if arg[0] == ':': return 'S' + arg[1:] + return {'w':'int', 'l':'long', + 's':'float', 'd':'double'}[arg] + +def cparam(iarg): + return ctype(iarg[1]) + ' p' + str(iarg[0]) + +def gencfn(id, args): + out = '# extern void qfn' + id + '(' + out += ', '.join(map(ctype, args)) + ');\n' + out += '# void cfn' + id + '(' + out += ', '.join(map(cparam, enumerate(args))) + out += ') {\n' + out += '# \tprintf("qbe->c(%d)", ' + id + ');\n' + out += '# \t' + for (i, arg) in enumerate(args): + if arg[0] != 'p': continue + ty = arg[1:] + if ty[0] == ':': + out += 'p' + ty[1:] + '(&' + else: + out += 'p' + ty + '(' + out += 'p' + str(i) + '); ' + out += 'puts("");\n' + out += '# \tqfn' + id + '(' + out += ', '.join('p'+str(i) for i in range(len(args))) + out += ');\n' + out += '# }\n' + return out + +def qparam(iarg): + ty = iarg[1][1:] if iarg[1][0] == 'p' else iarg[1] + return ty + ' %p' + str(iarg[0]) + +def genqfn(id, args): + out = 'export\nfunction $qfn' + id + '(' + out += ', '.join(map(qparam, enumerate(args))) + out += ') {\n' + out += '@start\n' + out += '\t%r0 =w call $printf(l $ctoqbestr, w ' + id + ')\n' + for (i, arg) in enumerate(args): + if arg[0] != 'p': continue + ty = arg[1:] + if ty[0] == ':': + out += '\tcall $p' + ty[1:] + out += '(l %p' + str(i) + ')\n' + else: + out += '\tcall $p' + ty + out += '(' + ty + ' %p' + str(i) + ')\n' + out += '\t%r1 =w call $puts(l $emptystr)\n' + out += '\tret\n' + out += '}\n' + return out + +def carg(iarg): + i, arg = iarg + print = arg[0] == 'p' + ty = arg if not print else arg[1:] + if ty[0] == ':': + if print: + return ty + ' $' + ty[1:] + else: + return ty + ' $z' + ty[1:] + if not print: + return ty + ' 0' + if ty == 'w' or ty == 'l': + return ty + ' ' + str(i+1) + if ty == 's' or ty == 'd': + flt = str(i+1) + '.' + str(i+1) + return ty + ' ' + ty + '_' + flt + +def genmaincall(id, args): + out = '\tcall $cfn' + id + '(' + out += ', '.join(map(carg, enumerate(args))) + out += ')\n' + return out + +def gen(tvec): + for i, t in enumerate(tvec): + print(genqfn(str(i), t), end='') + print('') + for i, t in enumerate(tvec): + print(genmaincall(str(i), t), end='') + print('') + for i, t in enumerate(tvec): + print(gencfn(str(i), t), end='') + +TVEC = [ + ['s']*8 + ['ps'], + ['pw', 'ps', 'p:fi1'], + ['pw', 'p:fi2', 'ps'], + ['pw', 'ps', 'p:fi3'], + ['p:ss'], + ['d']*7 + ['p:ss', 'ps', 'pl'], + ['p:lb'], + ['w']*7 + ['p:lb'], + ['w']*8 + ['p:lb'], + [ 'p:big' ], + ['w']*8 + ['p:big', 'ps', 'pl'], +] + +if __name__ == '__main__': + gen(TVEC) From e6debbbb02b4b0b118546e05fa88b51428abddca Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 10 Mar 2022 22:46:57 +0100 Subject: [PATCH 272/286] two new tests in abi5.ssa They are meant to exercise the hardware floating-point calling convention of the risc-v target. --- test/abi5.ssa | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/test/abi5.ssa b/test/abi5.ssa index 1d823b1..65b702c 100644 --- a/test/abi5.ssa +++ b/test/abi5.ssa @@ -10,6 +10,8 @@ type :st7 = { s, d } type :st8 = { w 4 } type :un9 = { { b } { s } } type :st9 = { w, :un9 } +type :sta = { b, s } +type :stb = { b, b, s } data $fmt1 = { b "t1: %s\n", b 0 } data $fmt2 = { b "t2: %d\n", b 0 } @@ -20,6 +22,8 @@ data $fmt6 = { b "t6: %s\n", b 0 } data $fmt7 = { b "t7: %f %f\n", b 0 } data $fmt8 = { b "t8: %d %d %d %d\n", b 0 } data $fmt9 = { b "t9: %d %f\n", b 0 } +data $fmta = { b "ta: %d %f\n", b 0 } +data $fmtb = { b "tb: %d %d %f\n", b 0 } export function $test() { @@ -78,12 +82,27 @@ function $test() { %d9 =d exts %s9 %i9 =w call $printf(l $fmt9, ..., w %w9, d %d9) + %ra =:sta call $ta() + %ra4 =l add 4, %ra + %wa =w loadsb %ra + %sa =s loads %ra4 + %da =d exts %sa + %ia =w call $printf(l $fmta, ..., w %wa, d %da) + + %rb =:stb call $tb() + %rb1 =l add 1, %rb + %rb4 =l add 4, %rb + %w0b =w loadsb %rb + %w1b =w loadsb %rb1 + %sb =s loads %rb4 + %db =d exts %sb + %ib =w call $printf(l $fmtb, ..., w %w0b, w %w1b, d %db) + ret } # >>> driver -# #include # typedef struct { char t[17]; } st1; # typedef struct { int i; } st2; # typedef struct { float f; int i; } st3; @@ -93,6 +112,8 @@ function $test() { # typedef struct { float f; double d; } st7; # typedef struct { int i[4]; } st8; # typedef struct { int i; union { char c; float f; } u; } st9; +# typedef struct { char c; float f; } sta; +# typedef struct { char c0, c1; float f; } stb; # extern void test(void); # st1 t1() { return (st1){"abcdefghijklmnop"}; } # st2 t2() { return (st2){2}; } @@ -103,6 +124,8 @@ function $test() { # st7 t7() { return (st7){7.77,77.7}; } # st8 t8() { return (st8){-8,88,-888,8888}; } # st9 t9() { return (st9){9,{.f=9.9}}; } +# sta ta() { return (sta){-10,10.1}; } +# stb tb() { return (stb){-1,11,11.11}; } # int main() { test(); return 0; } # <<< @@ -116,4 +139,6 @@ function $test() { # t7: 7.770000 77.700000 # t8: -8 88 -888 8888 # t9: 9 9.900000 +# ta: -10 10.100000 +# tb: -1 11 11.110000 # <<< From a9e4fa9715bf0f56f546dce72149da09af5349a3 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 10 Mar 2022 22:49:08 +0100 Subject: [PATCH 273/286] rv64: plug holes in the abi Many things got fixed, but the most notable change is the proper support of floating point types in aggregates. Minor fixes: - selpar() did not deal correctly with Cfpint - typclass() was reading out of bounds in the gp/fp arrays - support for env calls --- rv64/abi.c | 345 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 196 insertions(+), 149 deletions(-) diff --git a/rv64/abi.c b/rv64/abi.c index b49057b..ddcba9d 100644 --- a/rv64/abi.c +++ b/rv64/abi.c @@ -1,5 +1,7 @@ #include "all.h" +/* the risc-v lp64d abi */ + typedef struct Class Class; typedef struct Insl Insl; typedef struct Params Params; @@ -14,13 +16,13 @@ enum { struct Class { char class; - uint size; - Typ *t; - uchar nreg; - uchar ngp; - uchar nfp; + Typ *type; int reg[2]; int cls[2]; + int off[2]; + char ngp; /* only valid after typclass() */ + char nfp; /* ditto */ + char nreg; }; struct Insl { @@ -34,17 +36,18 @@ struct Params { int stk; /* stack offset for varargs */ }; -static int gpreg[] = { A0, A1, A2, A3, A4, A5, A6, A7}; -static int fpreg[] = {FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7}; +static int gpreg[10] = {A0, A1, A2, A3, A4, A5, A6, A7}; +static int fpreg[10] = {FA0, FA1, FA2, FA3, FA4, FA5, FA6, FA7}; /* layout of call's second argument (RCall) * - * 29 8 4 2 0 - * |0.00|xxxx|xxxx|xx|xx| range - * | | | ` gp regs returned (0..2) - * | | ` fp regs returned (0..2) - * | ` gp regs passed (0..8) - * ` fp regs passed (0..8) + * 29 12 8 4 2 0 + * |0.00|x|xxxx|xxxx|xx|xx| range + * | | | | ` gp regs returned (0..2) + * | | | ` fp regs returned (0..2) + * | | ` gp regs passed (0..8) + * | ` fp regs passed (0..8) + * ` env pointer passed in t5 (0..1) */ bits @@ -72,12 +75,12 @@ bits rv64_argregs(Ref r, int p[2]) { bits b; - int ngp, nfp; + int ngp, nfp, t5; assert(rtype(r) == RCall); ngp = (r.val >> 4) & 15; nfp = (r.val >> 8) & 15; - b = 0; + t5 = (r.val >> 12) & 1; if (p) { p[0] = ngp; p[1] = nfp; @@ -87,17 +90,52 @@ rv64_argregs(Ref r, int p[2]) b |= BIT(A0+ngp); while (nfp--) b |= BIT(FA0+nfp); - return b; + return b | ((bits)t5 << T5); +} + +static int +fpstruct(Typ *t, int off, Class *c) +{ + Field *f; + int n; + + if (t->isunion) + return -1; + + for (f=*t->fields; f->type != FEnd; f++) + if (f->type == FPad) + off += f->len; + else if (f->type == FTyp) { + if (fpstruct(&typ[f->len], off, c) == -1) + return -1; + } + else { + n = c->nfp + c->ngp; + if (n == 2) + return -1; + switch (f->type) { + default: die("unreachable"); + case Fb: + case Fh: + case Fw: c->cls[n] = Kw; c->ngp++; break; + case Fl: c->cls[n] = Kl; c->ngp++; break; + case Fs: c->cls[n] = Ks; c->nfp++; break; + case Fd: c->cls[n] = Kd; c->nfp++; break; + } + c->off[n] = off; + off += f->len; + } + + return c->nfp; } static void -typclass(Class *c, Typ *t, int *gp, int *fp) +typclass(Class *c, Typ *t, int fpabi, int *gp, int *fp) { - uint64_t sz; uint n; + int i; - sz = (t->size + 7) & ~7; - c->t = t; + c->type = t; c->class = 0; c->ngp = 0; c->nfp = 0; @@ -105,63 +143,63 @@ typclass(Class *c, Typ *t, int *gp, int *fp) if (t->align > 4) err("alignments larger than 16 are not supported"); - if (t->isdark || sz > 16 || sz == 0) { + if (t->isdark || t->size > 16 || t->size == 0) { /* large structs are replaced by a * pointer to some caller-allocated - * memory */ + * memory + */ c->class |= Cptr; - c->size = 8; - return; + *c->cls = Kl; + *c->off = 0; + c->ngp = 1; } - - c->size = sz; - - /* TODO: float */ - (void)fp; - - for (n=0; nngp++) { - c->reg[n] = *gp++; - c->cls[n] = Kl; + else if (!fpabi || fpstruct(t, 0, c) <= 0) { + for (n=0; 8*nsize; n++) { + c->cls[n] = Kl; + c->off[n] = 8*n; + } + c->nfp = 0; + c->ngp = n; } - c->nreg = n; + c->nreg = c->nfp + c->ngp; + for (i=0; inreg; i++) + if (KBASE(c->cls[i]) == 0) + c->reg[i] = *gp++; + else + c->reg[i] = *fp++; } static void -sttmps(Ref tmp[], int cls[], uint nreg, Ref mem, Fn *fn) +sttmps(Ref tmp[], int ntmp, Class *c, Ref mem, Fn *fn) { static int st[] = { [Kw] = Ostorew, [Kl] = Ostorel, [Ks] = Ostores, [Kd] = Ostored }; - uint n; - uint64_t off; + int i; Ref r; - assert(nreg <= 4); - off = 0; - for (n=0; n 0); + assert(ntmp <= 2); + for (i=0; icls[i], fn); r = newtmp("abi", Kl, fn); - emit(st[cls[n]], 0, R, tmp[n], r); - emit(Oadd, Kl, r, mem, getcon(off, fn)); - off += KWIDE(cls[n]) ? 8 : 4; + emit(st[c->cls[i]], 0, R, tmp[i], r); + emit(Oadd, Kl, r, mem, getcon(c->off[i], fn)); } } static void -ldregs(int reg[], int cls[], int n, Ref mem, Fn *fn) +ldregs(Class *c, Ref mem, Fn *fn) { int i; - uint64_t off; Ref r; - off = 0; - for (i=0; inreg; i++) { r = newtmp("abi", Kl, fn); - emit(Oload, cls[i], TMP(reg[i]), r, R); - emit(Oadd, Kl, r, mem, getcon(off, fn)); - off += KWIDE(cls[i]) ? 8 : 4; + emit(Oload, c->cls[i], TMP(c->reg[i]), r, R); + emit(Oadd, Kl, r, mem, getcon(c->off[i], fn)); } } @@ -181,13 +219,13 @@ selret(Blk *b, Fn *fn) b->jmp.type = Jret0; if (j == Jretc) { - typclass(&cr, &typ[fn->retty], gpreg, fpreg); + typclass(&cr, &typ[fn->retty], 1, gpreg, fpreg); cty = (cr.nfp << 2) | cr.ngp; if (cr.class & Cptr) { assert(rtype(fn->retr) == RTmp); - blit0(fn->retr, r, cr.t->size, fn); + blit0(fn->retr, r, cr.type->size, fn); } else { - ldregs(cr.reg, cr.cls, cr.nreg, r, fn); + ldregs(&cr, r, fn); } } else { k = j - Jretw; @@ -204,10 +242,11 @@ selret(Blk *b, Fn *fn) } static int -argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env, int retptr) +argsclass(Ins *i0, Ins *i1, Class *carg, int retptr) { - int ngp, nfp, *gp, *fp, vararg; + int ngp, nfp, *gp, *fp, vararg, envc; Class *c; + Typ *t; Ins *i; gp = gpreg; @@ -215,6 +254,7 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env, int retptr) ngp = 8; nfp = 8; vararg = 0; + envc = 0; if (retptr) { gp++; ngp--; @@ -224,8 +264,6 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env, int retptr) case Opar: case Oarg: *c->cls = i->cls; - c->size = 8; - /* variadic float args are passed in int regs */ if (!vararg && KBASE(i->cls) == 1 && nfp > 0) { nfp--; *c->reg = *fp++; @@ -234,63 +272,62 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env, int retptr) c->class |= Cfpint; ngp--; *c->reg = *gp++; - } else { + } else c->class |= Cstk1; - } break; case Oargv: - /* subsequent arguments are variadic */ vararg = 1; break; case Oparc: case Oargc: - typclass(c, &typ[i->arg[0].val], gp, fp); - if (c->class & Cptr) { - c->ngp = 1; - *c->reg = *gp; - *c->cls = Kl; - } - if (c->ngp <= ngp && c->nfp <= nfp) { + t = &typ[i->arg[0].val]; + typclass(c, t, 1, gp, fp); + if (c->nfp > 0) + if (c->nfp >= nfp || c->ngp >= ngp) + typclass(c, t, 0, gp, fp); + assert(c->nfp <= nfp); + if (c->ngp <= ngp) { ngp -= c->ngp; nfp -= c->nfp; gp += c->ngp; fp += c->nfp; - break; - } - c->ngp += c->nfp; - c->nfp = 0; - if (c->ngp <= ngp) { - ngp -= c->ngp; - gp += c->ngp; - break; - } - c->class |= Cstk1; - if (c->ngp - 1 > ngp) + } else if (ngp > 0) { + assert(c->ngp == 2); + assert(c->class == 0); c->class |= Cstk2; + c->nreg = 1; + ngp--; + gp++; + } else { + c->class |= Cstk1; + if (c->nreg > 1) + c->class |= Cstk2; + c->nreg = 0; + } break; case Opare: - *env = i->to; - break; case Oarge: - *env = i->arg[0]; + *c->cls = Kl; + *c->reg = T5; + envc = 1; break; } } - return (gp-gpreg) << 4 | (fp-fpreg) << 8; + return envc << 12 | (gp-gpreg) << 4 | (fp-fpreg) << 8; } static void -stkblob(Ref r, Class *c, Fn *fn, Insl **ilp) +stkblob(Ref r, Typ *t, Fn *fn, Insl **ilp) { Insl *il; int al; uint64_t sz; il = alloc(sizeof *il); - al = c->t->align - 2; /* NAlign == 3 */ + al = t->align - 2; /* specific to NAlign == 3 */ if (al < 0) al = 0; - sz = c->class & Cptr ? c->t->size : c->size; + sz = (t->size + 7) & ~7; il->i = (Ins){Oalloc+al, Kl, r, {getcon(sz, fn)}}; il->link = *ilp; *ilp = il; @@ -301,26 +338,24 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) { Ins *i; Class *ca, *c, cr; - int k, cty, envc; - uint n; + int j, k, cty; uint64_t stk, off; - Ref r, r1, env, tmp[2]; + Ref r, r1, tmp[2]; - env = R; ca = alloc((i1-i0) * sizeof ca[0]); cr.class = 0; if (!req(i1->arg[1], R)) - typclass(&cr, &typ[i1->arg[1].val], gpreg, fpreg); + typclass(&cr, &typ[i1->arg[1].val], 1, gpreg, fpreg); - cty = argsclass(i0, i1, ca, &env, cr.class & Cptr); + cty = argsclass(i0, i1, ca, cr.class & Cptr); stk = 0; for (i=i0, c=ca; iop == Oargv) continue; if (c->class & Cptr) { i->arg[0] = newtmp("abi", Kl, fn); - stkblob(i->arg[0], c, fn, ilp); + stkblob(i->arg[0], c->type, fn, ilp); i->op = Oarg; } if (c->class & Cstk1) @@ -328,20 +363,24 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) if (c->class & Cstk2) stk += 8; } + stk += stk & 15; if (stk) emit(Osalloc, Kl, R, getcon(-stk, fn), R); if (!req(i1->arg[1], R)) { - stkblob(i1->to, &cr, fn, ilp); + stkblob(i1->to, cr.type, fn, ilp); cty |= (cr.nfp << 2) | cr.ngp; - if (cr.class & Cptr) { - cty |= 1; + if (cr.class & Cptr) + /* spill & rega expect calls to be + * followed by copies from regs, + * so we emit a dummy + */ emit(Ocopy, Kw, R, TMP(A0), R); - } else { - sttmps(tmp, cr.cls, cr.nreg, i1->to, fn); - for (n=0; nto, fn); + for (j=0; jcls) == 0) { @@ -352,9 +391,6 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) cty |= 1 << 2; } - envc = !req(R, env); - if (envc) - die("todo: env calls"); emit(Ocall, 0, R, i1->arg[0], CALL(cty)); if (cr.class & Cptr) @@ -366,7 +402,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) if (i->op == Oargv || c->class & Cstk1) continue; if (i->op == Oargc) { - ldregs(c->reg, c->cls, c->nreg, i->arg[1], fn); + ldregs(c, i->arg[1], fn); } else if (c->class & Cfpint) { k = KWIDE(*c->cls) ? Kl : Kw; r = newtmp("abi", k, fn); @@ -383,7 +419,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) emit(Ocast, k, TMP(*c->reg), i->arg[0], R); } if (c->class & Cptr) - blit0(i->arg[0], i->arg[1], c->t->size, fn); + blit0(i->arg[0], i->arg[1], c->type->size, fn); } if (!stk) @@ -391,36 +427,33 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) r = newtmp("abi", Kl, fn); for (i=i0, c=ca, off=0; iop == Oargv || (c->class & Cstk) == 0) + if (i->op == Oargv || !(c->class & Cstk)) continue; - if (i->op != Oargc) { - /* w arguments are stored sign-extended - * to 64-bits - * - * s arguments can just be stored with - * Ostores into the first 32-bits in the - * stack position since the ABI says the - * upper bits are undefined - */ + if (i->op == Oarg) { r1 = newtmp("abi", Kl, fn); emit(Ostorew+i->cls, Kw, R, i->arg[0], r1); if (i->cls == Kw) { /* TODO: we only need this sign extension * for subtyped l temporaries passed as w * arguments (see rv64/isel.c:fixarg) - * - * however, we cannot just fix it in isel - * since by that point we have forgotten - * the original argument type */ curi->op = Ostorel; curi->arg[0] = newtmp("abi", Kl, fn); emit(Oextsw, Kl, curi->arg[0], i->arg[0], R); } emit(Oadd, Kl, r1, r, getcon(off, fn)); - } else - blit(r, off, i->arg[1], 0, c->t->size, fn); - off += c->size; + off += 8; + } + if (i->op == Oargc) { + if (c->class & Cstk1) { + blit(r, off, i->arg[1], 0, 8, fn); + off += 8; + } + if (c->class & Cstk2) { + blit(r, off, i->arg[1], 8, 8, fn); + off += 8; + } + } } emit(Osalloc, Kl, r, getcon(stk, fn), R); } @@ -431,60 +464,74 @@ selpar(Fn *fn, Ins *i0, Ins *i1) Class *ca, *c, cr; Insl *il; Ins *i; - int n, s, cty; - Ref r, env, tmp[16], *t; + int j, k, s, cty, nt; + Ref r, tmp[17], *t; - env = R; ca = alloc((i1-i0) * sizeof ca[0]); cr.class = 0; curi = &insb[NIns]; if (fn->retty >= 0) { - typclass(&cr, &typ[fn->retty], gpreg, fpreg); + typclass(&cr, &typ[fn->retty], 1, gpreg, fpreg); if (cr.class & Cptr) { fn->retr = newtmp("abi", Kl, fn); emit(Ocopy, Kl, fn->retr, TMP(A0), R); } } - cty = argsclass(i0, i1, ca, &env, cr.class & Cptr); + cty = argsclass(i0, i1, ca, cr.class & Cptr); fn->reg = rv64_argregs(CALL(cty), 0); il = 0; t = tmp; for (i=i0, c=ca; iop != Oparc || (c->class & (Cptr|Cstk))) - continue; - sttmps(t, c->cls, c->nreg, i->to, fn); - stkblob(i->to, c, fn, &il); - t += c->nreg; + if (c->class & Cfpint) { + r = i->to; + k = *c->cls; + *c->cls = KWIDE(k) ? Kl : Kw; + i->to = newtmp("abi", k, fn); + emit(Ocast, k, r, i->to, R); + } + if (i->op == Oparc) + if (!(c->class & Cptr)) + if (c->nreg != 0) { + nt = c->nreg; + if (c->class & Cstk2) { + c->cls[1] = Kl; + c->off[1] = 8; + assert(nt == 1); + nt = 2; + } + sttmps(t, nt, c, i->to, fn); + stkblob(i->to, c->type, fn, &il); + t += nt; + } } for (; il; il=il->link) emiti(il->i); t = tmp; - for (i=i0, c=ca, s=2 + 8 * fn->vararg; iop == Oparc - && (c->class & Cptr) == 0) { - if (c->class & Cstk) { + s = 2 + 8*fn->vararg; + for (i=i0, c=ca; iop == Oparc && !(c->class & Cptr)) { + if (c->nreg == 0) { fn->tmp[i->to.val].slot = -s; - s += c->size / 8; - } else { - for (n=0; nnreg; n++) { - r = TMP(c->reg[n]); - emit(Ocopy, c->cls[n], *t++, r, R); - } + s += (c->class & Cstk2) ? 2 : 1; + continue; + } + for (j=0; jnreg; j++) { + r = TMP(c->reg[j]); + emit(Ocopy, c->cls[j], *t++, r, R); + } + if (c->class & Cstk2) { + emit(Oload, Kl, *t, SLOT(-s), R); + t++, s++; } } else if (c->class & Cstk1) { emit(Oload, *c->cls, i->to, SLOT(-s), R); s++; - } else { + } else emit(Ocopy, *c->cls, i->to, TMP(*c->reg), R); - } - } - - if (!req(R, env)) - die("todo: env calls"); return (Params){ .stk = s, From c7842d84da65bcaf2d3c82aa69fb3ec930c7369f Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 11 Mar 2022 13:38:46 +0100 Subject: [PATCH 274/286] dust off antique .tag --- .tag | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .tag diff --git a/.tag b/.tag deleted file mode 100644 index 5b8c210..0000000 --- a/.tag +++ /dev/null @@ -1,11 +0,0 @@ -Look slot( - -Get lisc.h -Get parse.c -Get isel.c -Get spill.c -Get rega.c -Get emit.c - -New -|fmt From 905e9cef302727fdaacd7069826ff448c2d88361 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 14 Mar 2022 09:59:14 +0100 Subject: [PATCH 275/286] arm64/abi: fix big aggregates passed on the stack The riscv test abi8.ssa caught a bug in the arm backend. It turns out we were using the wrong class when loading pointers to aggregates from the stack. The fix is simple and mirrors what is done in the riscv abi. --- arm64/abi.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arm64/abi.c b/arm64/abi.c index 6ed393d..b6b4612 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -100,6 +100,9 @@ typclass(Class *c, Typ *t, int *gp, int *fp) * memory */ c->class |= Cptr; c->size = 8; + c->ngp = 1; + *c->reg = *gp; + *c->cls = Kl; return; } @@ -230,14 +233,7 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env) case Oparc: case Oargc: typclass(c, &typ[i->arg[0].val], gp, fp); - if (c->class & Cptr) { - if (ngp > 0) { - ngp--; - *c->reg = *gp++; - *c->cls = Kl; - break; - } - } else if (c->ngp <= ngp) { + if (c->ngp <= ngp) { if (c->nfp <= nfp) { ngp -= c->ngp; nfp -= c->nfp; From 7a7a5f480312b997dcac0e4cc3befb502e54c836 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 14 Mar 2022 10:40:30 +0100 Subject: [PATCH 276/286] improve consistency in abis --- arm64/abi.c | 15 ++++++--------- rv64/abi.c | 14 +++++++++----- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/arm64/abi.c b/arm64/abi.c index b6b4612..0e4b941 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -397,6 +397,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) ldregs(c->reg, c->cls, c->nreg, i->arg[1], fn); } + /* populate the stack */ off = 0; for (i=i0, c=ca; iclass & Cstk) == 0) @@ -456,9 +457,9 @@ selpar(Fn *fn, Ins *i0, Ins *i1) } t = tmp; - for (i=i0, c=ca, s=2; iop == Oparc - && (c->class & Cptr) == 0) { + s = 2; + for (i=i0, c=ca; iop == Oparc && !(c->class & Cptr)) { if (c->class & Cstk) { fn->tmp[i->to.val].slot = -s; s += c->size / 8; @@ -468,15 +469,11 @@ selpar(Fn *fn, Ins *i0, Ins *i1) emit(Ocopy, c->cls[n], *t++, r, R); } } else if (c->class & Cstk) { - r = newtmp("abi", Kl, fn); - emit(Oload, *c->cls, i->to, r, R); - emit(Oaddr, Kl, r, SLOT(-s), R); + emit(Oload, *c->cls, i->to, SLOT(-s), R); s++; } else { - r = TMP(*c->reg); - emit(Ocopy, *c->cls, i->to, r, R); + emit(Ocopy, *c->cls, i->to, TMP(*c->reg), R); } - } if (!req(R, env)) die("todo: env calls"); diff --git a/rv64/abi.c b/rv64/abi.c index ddcba9d..d937fe8 100644 --- a/rv64/abi.c +++ b/rv64/abi.c @@ -425,17 +425,20 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) if (!stk) return; + /* populate the stack */ + off = 0; r = newtmp("abi", Kl, fn); - for (i=i0, c=ca, off=0; iop == Oargv || !(c->class & Cstk)) continue; if (i->op == Oarg) { r1 = newtmp("abi", Kl, fn); emit(Ostorew+i->cls, Kw, R, i->arg[0], r1); if (i->cls == Kw) { - /* TODO: we only need this sign extension - * for subtyped l temporaries passed as w - * arguments (see rv64/isel.c:fixarg) + /* TODO: we only need this sign + * extension for l temps passed + * as w arguments + * (see rv64/isel.c:fixarg) */ curi->op = Ostorel; curi->arg[0] = newtmp("abi", Kl, fn); @@ -530,8 +533,9 @@ selpar(Fn *fn, Ins *i0, Ins *i1) } else if (c->class & Cstk1) { emit(Oload, *c->cls, i->to, SLOT(-s), R); s++; - } else + } else { emit(Ocopy, *c->cls, i->to, TMP(*c->reg), R); + } return (Params){ .stk = s, From 6ca9399ed6bec1a448aef79236670cd3daeb7daf Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 14 Mar 2022 10:58:55 +0100 Subject: [PATCH 277/286] output symbol type and size That is not available on osx so I tweaked the gas.c api a little to conditionally output the two directives. --- all.h | 6 ++++++ gas.c | 26 ++++++++++++++++++++++++++ main.c | 17 ++--------------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/all.h b/all.h index f806c5b..7e1a8d3 100644 --- a/all.h +++ b/all.h @@ -523,9 +523,15 @@ void spill(Fn *); void rega(Fn *); /* gas.c */ +enum Asm { + Gasmacho, + Gaself, +}; extern char *gasloc; extern char *gassym; +void gasinit(enum Asm); void gasemitlnk(char *, Lnk *, char *, FILE *); +void gasemitfntail(char *, FILE *); void gasemitdat(Dat *, FILE *); int gasstash(void *, int); void gasemitfin(FILE *); diff --git a/gas.c b/gas.c index e67043b..4ac42be 100644 --- a/gas.c +++ b/gas.c @@ -2,6 +2,23 @@ char *gasloc, *gassym; +static int gasasm; + +void +gasinit(enum Asm asmmode) +{ + gasasm = asmmode; + switch (gasasm) { + case Gaself: + gasloc = ".L"; + gassym = ""; + break; + case Gasmacho: + gasloc = "L"; + gassym = "_"; + break; + } +} void gasemitlnk(char *n, Lnk *l, char *s, FILE *f) @@ -24,6 +41,15 @@ gasemitlnk(char *n, Lnk *l, char *s, FILE *f) fprintf(f, "%s%s:\n", p, n); } +void +gasemitfntail(char *fn, FILE *f) +{ + if (gasasm == Gaself) { + fprintf(f, ".type %s, @function\n", fn); + fprintf(f, ".size %s, .-%s\n", fn, fn); + } +} + void gasemitdat(Dat *d, FILE *f) { diff --git a/main.c b/main.c index ee16a75..74d057d 100644 --- a/main.c +++ b/main.c @@ -19,11 +19,6 @@ static struct TMap { { 0, 0 } }; -enum Asm { - Gasmacho, - Gaself, -}; - char debug['Z'+1] = { ['P'] = 0, /* parsing */ ['M'] = 0, /* memory optimization */ @@ -101,6 +96,7 @@ func(Fn *fn) fn->rpo[n]->link = fn->rpo[n+1]; if (!dbg) { T.emitfn(fn, outf); + gasemitfntail(fn->name, outf); fprintf(outf, "/* end function %s */\n\n", fn->name); } else fprintf(stderr, "\n"); @@ -174,16 +170,7 @@ main(int ac, char *av[]) exit(c != 'h'); } - switch (asmmode) { - case Gaself: - gasloc = ".L"; - gassym = ""; - break; - case Gasmacho: - gasloc = "L"; - gassym = "_"; - break; - } + gasinit(asmmode); do { f = av[optind]; From 329a18a30b9f8db598db39b7326fc4149bcc1431 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 14 Mar 2022 15:29:10 +0100 Subject: [PATCH 278/286] add rv64/ to README --- README | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README b/README index 8c30a1b..015cf4a 100644 --- a/README +++ b/README @@ -5,7 +5,8 @@ minic/ An example C frontend for QBE. tools/ Miscellaneous tools (testing). test/ Tests. amd64/ -arm64/ Architecture-specific code. +arm64/ +rv64/ Architecture-specific code. The LICENSE file applies to all files distributed. From c5769f62b4912e429a332c9aa0bead3a383fe966 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 14 Mar 2022 23:10:39 +0100 Subject: [PATCH 279/286] dynamic stack allocs for arm64 I also moved some isel logic that would have been repeated a third time in util.c. --- all.h | 1 + amd64/isel.c | 30 ++++-------------------------- arm64/emit.c | 9 ++++++++- arm64/isel.c | 10 +++++++++- rv64/isel.c | 48 +++++++++++------------------------------------- util.c | 30 ++++++++++++++++++++++++++++++ 6 files changed, 63 insertions(+), 65 deletions(-) diff --git a/all.h b/all.h index 7e1a8d3..b775748 100644 --- a/all.h +++ b/all.h @@ -444,6 +444,7 @@ Ref getcon(int64_t, Fn *); int addcon(Con *, Con *); void blit(Ref, uint, Ref, uint, uint, Fn *); void blit0(Ref, Ref, uint, Fn *); +void salloc(Ref, Ref, Fn *); void dumpts(BSet *, Tmp *, FILE *); void bsinit(BSet *, uint); diff --git a/amd64/isel.c b/amd64/isel.c index 4181e26..9dffd06 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -203,7 +203,6 @@ sel(Ins i, ANum *an, Fn *fn) { Ref r0, r1, tmp[7]; int x, j, k, kc, sh, swap; - int64_t sz; Ins *i0, *i1; if (rtype(i.to) == RTmp) @@ -375,31 +374,10 @@ sel(Ins i, ANum *an, Fn *fn) fixarg(&i1->arg[0], argcls(&i, 0), i1, fn); fixarg(&i1->arg[1], argcls(&i, 1), i1, fn); break; - case Oalloc: - case Oalloc+1: - case Oalloc+2: /* == Oalloc1 */ - /* we need to make sure - * the stack remains aligned - * (rsp = 0) mod 16 - */ - fn->dynalloc = 1; - if (rtype(i.arg[0]) == RCon) { - sz = fn->con[i.arg[0].val].bits.i; - if (sz < 0 || sz >= INT_MAX-15) - err("invalid alloc size %"PRId64, sz); - sz = (sz + 15) & -16; - emit(Osalloc, Kl, i.to, getcon(sz, fn), R); - } else { - /* r0 = (i.arg[0] + 15) & -16 */ - r0 = newtmp("isel", Kl, fn); - r1 = newtmp("isel", Kl, fn); - emit(Osalloc, Kl, i.to, r0, R); - emit(Oand, Kl, r0, r1, getcon(-16, fn)); - emit(Oadd, Kl, r1, i.arg[0], getcon(15, fn)); - if (fn->tmp[i.arg[0].val].slot != -1) - err("unlikely argument %%%s in %s", - fn->tmp[i.arg[0].val].name, optab[i.op].name); - } + case Oalloc4: + case Oalloc8: + case Oalloc16: + salloc(i.to, i.arg[0], fn); break; default: if (isext(i.op)) diff --git a/arm64/emit.c b/arm64/emit.c index b25f4f5..47097b7 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -385,6 +385,11 @@ emitins(Ins *i, E *e) rn, s & 0xFFFF, rn, s >> 16, rn, rn ); break; + case Osalloc: + emitf("sub sp, sp, %0", i, e); + if (!req(i->to, R)) + emitf("mov %=, sp", i, e); + break; } } @@ -483,7 +488,7 @@ arm64_emitfn(Fn *fn, FILE *out) "\tstp\tx29, x30, [sp, -16]!\n", e->frame & 0xFFFF, e->frame >> 16 ); - fputs("\tadd\tx29, sp, 0\n", e->f); + fputs("\tmov\tx29, sp\n", e->f); s = (e->frame - e->padding) / 4; for (r=arm64_rclob; *r>=0; r++) if (e->fn->reg & BIT(*r)) { @@ -509,6 +514,8 @@ arm64_emitfn(Fn *fn, FILE *out) i->cls = *r >= V0 ? Kd : Kl; emitins(i, e); } + if (e->fn->dynalloc) + fputs("\tmov sp, x29\n", e->f); o = e->frame + 16; if (e->fn->vararg) o += 192; diff --git a/arm64/isel.c b/arm64/isel.c index 031ba11..bb5c12b 100644 --- a/arm64/isel.c +++ b/arm64/isel.c @@ -163,6 +163,12 @@ sel(Ins i, Fn *fn) Ins *i0; int ck, cc; + if (INRANGE(i.op, Oalloc, Oalloc1)) { + i0 = curi - 1; + salloc(i.to, i.arg[0], fn); + fixarg(&i0->arg[0], Kl, 0, fn); + return; + } if (iscmp(i.op, &ck, &cc)) { emit(Oflag, i.cls, i.to, R, R); i0 = curi; @@ -170,7 +176,9 @@ sel(Ins i, Fn *fn) i0->op += cmpop(cc); else i0->op += cc; - } else if (i.op != Onop) { + return; + } + if (i.op != Onop) { emiti(i); iarg = curi->arg; /* fixarg() can change curi */ fixarg(&iarg[0], argcls(&i, 0), 0, fn); diff --git a/rv64/isel.c b/rv64/isel.c index e441597..e41578b 100644 --- a/rv64/isel.c +++ b/rv64/isel.c @@ -174,46 +174,20 @@ selcmp(Ins i, int k, int op, Fn *fn) static void sel(Ins i, Fn *fn) { - Ref r0, r1; Ins *i0; int ck, cc; - int64_t sz; - switch (i.op) { - case Onop: - break; - case Oalloc4: - case Oalloc8: - case Oalloc16: - /* we need to make sure - * the stack remains aligned - * (rsp = 0) mod 16 - */ - fn->dynalloc = 1; - if (rtype(i.arg[0]) == RCon) { - sz = fn->con[i.arg[0].val].bits.i; - if (sz < 0) - err("invalid alloc size %"PRId64, sz); - sz = (sz + 15) & -16; - emit(Osalloc, Kl, i.to, getcon(sz, fn), R); - fixarg(&curi->arg[0], Kl, curi, fn); - } else { - /* r0 = (i.arg[0] + 15) & -16 */ - r0 = newtmp("isel", Kl, fn); - r1 = newtmp("isel", Kl, fn); - emit(Osalloc, Kl, i.to, r0, R); - emit(Oand, Kl, r0, r1, getcon(-16, fn)); - emit(Oadd, Kl, r1, i.arg[0], getcon(15, fn)); - if (fn->tmp[i.arg[0].val].slot != -1) - err("unlikely argument %%%s in %s", - fn->tmp[i.arg[0].val].name, optab[i.op].name); - } - break; - default: - if (iscmp(i.op, &ck, &cc)) { - selcmp(i, ck, cc, fn); - break; - } + if (INRANGE(i.op, Oalloc, Oalloc1)) { + i0 = curi - 1; + salloc(i.to, i.arg[0], fn); + fixarg(&i0->arg[0], Kl, i0, fn); + return; + } + if (iscmp(i.op, &ck, &cc)) { + selcmp(i, ck, cc, fn); + return; + } + if (i.op != Onop) { emiti(i); i0 = curi; /* fixarg() can change curi */ fixarg(&i0->arg[0], argcls(&i, 0), i0, fn); diff --git a/util.c b/util.c index 5296b86..6a33d1a 100644 --- a/util.c +++ b/util.c @@ -428,6 +428,36 @@ blit0(Ref rdst, Ref rsrc, uint sz, Fn *fn) blit(rdst, 0, rsrc, 0, sz, fn); } +void +salloc(Ref rt, Ref rs, Fn *fn) +{ + Ref r0, r1; + int64_t sz; + + /* we need to make sure + * the stack remains aligned + * (rsp = 0) mod 16 + */ + fn->dynalloc = 1; + if (rtype(rs) == RCon) { + sz = fn->con[rs.val].bits.i; + if (sz < 0 || sz >= INT_MAX-15) + err("invalid alloc size %"PRId64, sz); + sz = (sz + 15) & -16; + emit(Osalloc, Kl, rt, getcon(sz, fn), R); + } else { + /* r0 = (r + 15) & -16 */ + r0 = newtmp("isel", Kl, fn); + r1 = newtmp("isel", Kl, fn); + emit(Osalloc, Kl, rt, r0, R); + emit(Oand, Kl, r0, r1, getcon(-16, fn)); + emit(Oadd, Kl, r1, rs, getcon(15, fn)); + if (fn->tmp[rs.val].slot != -1) + err("unlikely alloc argument %%%s for %%%s", + fn->tmp[rs.val].name, fn->tmp[rt.val].name); + } +} + void bsinit(BSet *bs, uint n) { From c656c48f04aff067b7addd8d1c40935f6bf3acca Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 15 Mar 2022 14:10:14 +0100 Subject: [PATCH 280/286] fix register count in riscv argregs --- rv64/abi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rv64/abi.c b/rv64/abi.c index d937fe8..ae53c61 100644 --- a/rv64/abi.c +++ b/rv64/abi.c @@ -82,7 +82,7 @@ rv64_argregs(Ref r, int p[2]) nfp = (r.val >> 8) & 15; t5 = (r.val >> 12) & 1; if (p) { - p[0] = ngp; + p[0] = ngp + t5; p[1] = nfp; } b = 0; From 01142fa0594b6d3efe05214c844012deec1afc3d Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 15 Mar 2022 14:14:42 +0100 Subject: [PATCH 281/286] support env calls on arm64 The x9 register is used for the env parameter. --- arm64/abi.c | 57 ++++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/arm64/abi.c b/arm64/abi.c index 0e4b941..396c704 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -41,13 +41,15 @@ static int fpreg[12] = {V0, V1, V2, V3, V4, V5, V6, V7}; /* layout of call's second argument (RCall) * - * 29 13 9 5 2 0 - * |0.00|x|xxxx|xxxx|xxx|xx| range - * | | | | ` gp regs returned (0..2) - * | | | ` fp regs returned (0..4) - * | | ` gp regs passed (0..8) - * | ` fp regs passed (0..8) - * ` is x8 used (0..1) + * 13 + * 29 14 | 9 5 2 0 + * |0.00|x|x|xxxx|xxxx|xxx|xx| range + * | | | | | ` gp regs returned (0..2) + * | | | | ` fp regs returned (0..4) + * | | | ` gp regs passed (0..8) + * | | ` fp regs passed (0..8) + * | ` indirect result register x8 used (0..1) + * ` env pointer passed in x9 (0..1) */ static int @@ -202,12 +204,13 @@ selret(Blk *b, Fn *fn) } static int -argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env) +argsclass(Ins *i0, Ins *i1, Class *carg) { - int ngp, nfp, *gp, *fp; + int envc, ngp, nfp, *gp, *fp; Class *c; Ins *i; + envc = 0; gp = gpreg; fp = fpreg; ngp = 8; @@ -247,10 +250,10 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env) c->class |= Cstk; break; case Opare: - *env = i->to; - break; case Oarge: - *env = i->arg[0]; + *c->reg = R9; + *c->cls = Kl; + envc = 1; break; case Oargv: break; @@ -258,7 +261,7 @@ argsclass(Ins *i0, Ins *i1, Class *carg, Ref *env) die("unreachable"); } - return ((gp-gpreg) << 5) | ((fp-fpreg) << 9); + return envc << 14 | (gp-gpreg) << 5 | (fp-fpreg) << 9; } bits @@ -286,14 +289,15 @@ bits arm64_argregs(Ref r, int p[2]) { bits b; - int ngp, nfp, x8; + int ngp, nfp, x8, x9; assert(rtype(r) == RCall); ngp = (r.val >> 5) & 15; nfp = (r.val >> 9) & 15; x8 = (r.val >> 13) & 1; + x9 = (r.val >> 14) & 1; if (p) { - p[0] = ngp + x8; + p[0] = ngp + x8 + x9; p[1] = nfp; } b = 0; @@ -301,7 +305,7 @@ arm64_argregs(Ref r, int p[2]) b |= BIT(R0+ngp); while (nfp--) b |= BIT(V0+nfp); - return b | ((bits)x8 << R8); + return b | ((bits)x8 << R8) | ((bits)x9 << R9); } static void @@ -326,14 +330,13 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) { Ins *i; Class *ca, *c, cr; - int cty, envc; + int cty; uint n; uint64_t stk, off; - Ref r, rstk, env, tmp[4]; + Ref r, rstk, tmp[4]; - env = R; ca = alloc((i1-i0) * sizeof ca[0]); - cty = argsclass(i0, i1, ca, &env); + cty = argsclass(i0, i1, ca); stk = 0; for (i=i0, c=ca; iarg[0], CALL(cty)); - envc = !req(R, env); - if (envc) - die("todo: env calls"); - if (cty & (1 << 13)) /* struct return argument */ emit(Ocopy, Kl, TMP(R8), i1->to, R); @@ -391,7 +390,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp) for (i=i0, c=ca; iclass & Cstk) != 0) continue; - if (i->op == Oarg) + if (i->op == Oarg || i->op == Oarge) emit(Ocopy, *c->cls, TMP(*c->reg), i->arg[0], R); if (i->op == Oargc) ldregs(c->reg, c->cls, c->nreg, i->arg[1], fn); @@ -426,13 +425,12 @@ selpar(Fn *fn, Ins *i0, Ins *i1) Insl *il; Ins *i; int n, s, cty; - Ref r, env, tmp[16], *t; + Ref r, tmp[16], *t; - env = R; ca = alloc((i1-i0) * sizeof ca[0]); curi = &insb[NIns]; - cty = argsclass(i0, i1, ca, &env); + cty = argsclass(i0, i1, ca); fn->reg = arm64_argregs(CALL(cty), 0); il = 0; @@ -475,9 +473,6 @@ selpar(Fn *fn, Ins *i0, Ins *i1) emit(Ocopy, *c->cls, i->to, TMP(*c->reg), R); } - if (!req(R, env)) - die("todo: env calls"); - return (Params){ .nstk = s - 2, .ngp = (cty >> 5) & 15, From da36b211ab9f0d00b0128d9daaf32eba5ab5e56e Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 15 Mar 2022 14:16:32 +0100 Subject: [PATCH 282/286] homogenize riscv and arm abis --- rv64/abi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rv64/abi.c b/rv64/abi.c index ae53c61..0baaa67 100644 --- a/rv64/abi.c +++ b/rv64/abi.c @@ -307,8 +307,8 @@ argsclass(Ins *i0, Ins *i1, Class *carg, int retptr) break; case Opare: case Oarge: - *c->cls = Kl; *c->reg = T5; + *c->cls = Kl; envc = 1; break; } From 2416d291417954a1fd7f4945a100f2c125d4d9a6 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 15 Mar 2022 22:29:09 +0100 Subject: [PATCH 283/286] new -t? flag to print default target --- all.h | 1 + amd64/targ.c | 1 + arm64/targ.c | 1 + main.c | 42 +++++++++++++++++++++--------------------- rv64/targ.c | 1 + 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/all.h b/all.h index b775748..3cfb60a 100644 --- a/all.h +++ b/all.h @@ -40,6 +40,7 @@ enum { }; struct Target { + char name[8]; int gpr0; /* first general purpose reg */ int ngpr; int fpr0; /* first floating point reg */ diff --git a/amd64/targ.c b/amd64/targ.c index e227574..d341339 100644 --- a/amd64/targ.c +++ b/amd64/targ.c @@ -13,6 +13,7 @@ amd64_memargs(int op) } Target T_amd64_sysv = { + .name = "amd64", .gpr0 = RAX, .ngpr = NGPR, .fpr0 = XMM0, diff --git a/arm64/targ.c b/arm64/targ.c index 99c4347..33b14f4 100644 --- a/arm64/targ.c +++ b/arm64/targ.c @@ -26,6 +26,7 @@ arm64_memargs(int op) } Target T_arm64 = { + .name = "arm64", .gpr0 = R0, .ngpr = NGPR, .fpr0 = V0, diff --git a/main.c b/main.c index 74d057d..dc76a86 100644 --- a/main.c +++ b/main.c @@ -5,20 +5,6 @@ Target T; -extern Target T_amd64_sysv; -extern Target T_arm64; -extern Target T_rv64; - -static struct TMap { - char *name; - Target *T; -} tmap[] = { - { "amd64_sysv", &T_amd64_sysv }, - { "arm64", &T_arm64 }, - { "rv64", &T_rv64 }, - { 0, 0 } -}; - char debug['Z'+1] = { ['P'] = 0, /* parsing */ ['M'] = 0, /* memory optimization */ @@ -32,6 +18,16 @@ char debug['Z'+1] = { ['R'] = 0, /* reg. allocation */ }; +extern Target T_amd64_sysv; +extern Target T_arm64; +extern Target T_rv64; + +static Target *tlist[] = { + &T_amd64_sysv, + &T_arm64, + &T_rv64, + 0 +}; static FILE *outf; static int dbg; @@ -106,7 +102,7 @@ func(Fn *fn) int main(int ac, char *av[]) { - struct TMap *tm; + Target **t; FILE *inf, *hf; char *f, *sep; int c, asmmode; @@ -133,13 +129,17 @@ main(int ac, char *av[]) } break; case 't': - for (tm=tmap;; tm++) { - if (!tm->name) { + if (strcmp(optarg, "?") == 0) { + puts(T.name); + exit(0); + } + for (t=tlist;; t++) { + if (!*t) { fprintf(stderr, "unknown target '%s'\n", optarg); exit(1); } - if (strcmp(optarg, tm->name) == 0) { - T = *tm->T; + if (strcmp(optarg, (*t)->name) == 0) { + T = **t; break; } } @@ -162,8 +162,8 @@ main(int ac, char *av[]) fprintf(hf, "\t%-11s output to file\n", "-o file"); fprintf(hf, "\t%-11s generate for a target among:\n", "-t "); fprintf(hf, "\t%-11s ", ""); - for (tm=tmap, sep=""; tm->name; tm++, sep=", ") - fprintf(hf, "%s%s", sep, tm->name); + for (t=tlist, sep=""; *t; t++, sep=", ") + fprintf(hf, "%s%s", sep, (*t)->name); fprintf(hf, "\n"); fprintf(hf, "\t%-11s generate gas (e) or osx (m) asm\n", "-G {e,m}"); fprintf(hf, "\t%-11s dump debug information\n", "-d "); diff --git a/rv64/targ.c b/rv64/targ.c index ead8fe2..d42d0a1 100644 --- a/rv64/targ.c +++ b/rv64/targ.c @@ -33,6 +33,7 @@ rv64_memargs(int op) } Target T_rv64 = { + .name = "rv64", .gpr0 = T0, .ngpr = NGPR, .fpr0 = FT0, From cec9855fa0c8d9566d4c9755ef7677f49634bc60 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Tue, 15 Mar 2022 22:34:03 +0100 Subject: [PATCH 284/286] detect target in tests --- tools/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test.sh b/tools/test.sh index fc96dba..15cff88 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -83,6 +83,7 @@ init() { testcc "$cc" || cc="cc" ;; esac + TARGET=`$bin -t?` ;; *) echo "Unknown target '$TARGET'." From bf2a90ef7c183e9e0442d14d6f74fb6d5f79c6bb Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Thu, 17 Mar 2022 10:57:09 +0100 Subject: [PATCH 285/286] fix return for big aggregates The recent changes in arm and riscv typclass() set ngp to 1 when a struct is returned via a caller-provided buffer. This interacts bogusly with selret() that ends up declaring a gp register live when none is set in the returning sequence. The fix is simply to set cty to zero (all registers dead) in case a caller- provided buffer is used. --- arm64/abi.c | 6 ++++-- rv64/abi.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/arm64/abi.c b/arm64/abi.c index 396c704..b2b5973 100644 --- a/arm64/abi.c +++ b/arm64/abi.c @@ -183,12 +183,14 @@ selret(Blk *b, Fn *fn) if (j == Jretc) { typclass(&cr, &typ[fn->retty], gpreg, fpreg); - cty = (cr.nfp << 2) | cr.ngp; if (cr.class & Cptr) { assert(rtype(fn->retr) == RTmp); blit0(fn->retr, r, cr.t->size, fn); - } else + cty = 0; + } else { ldregs(cr.reg, cr.cls, cr.nreg, r, fn); + cty = (cr.nfp << 2) | cr.ngp; + } } else { k = j - Jretw; if (KBASE(k) == 0) { diff --git a/rv64/abi.c b/rv64/abi.c index 0baaa67..3a97a6a 100644 --- a/rv64/abi.c +++ b/rv64/abi.c @@ -220,12 +220,13 @@ selret(Blk *b, Fn *fn) if (j == Jretc) { typclass(&cr, &typ[fn->retty], 1, gpreg, fpreg); - cty = (cr.nfp << 2) | cr.ngp; if (cr.class & Cptr) { assert(rtype(fn->retr) == RTmp); blit0(fn->retr, r, cr.type->size, fn); + cty = 0; } else { ldregs(&cr, r, fn); + cty = (cr.nfp << 2) | cr.ngp; } } else { k = j - Jretw; From c6b41eb8c8cece8266b2173a83216e1ce77eb2be Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 16 Mar 2022 15:01:24 -0700 Subject: [PATCH 286/286] amd64: restore previous name of amd64_sysv target --- all.h | 2 +- amd64/targ.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/all.h b/all.h index 3cfb60a..c8ec93c 100644 --- a/all.h +++ b/all.h @@ -40,7 +40,7 @@ enum { }; struct Target { - char name[8]; + char name[16]; int gpr0; /* first general purpose reg */ int ngpr; int fpr0; /* first floating point reg */ diff --git a/amd64/targ.c b/amd64/targ.c index d341339..2cf1bdc 100644 --- a/amd64/targ.c +++ b/amd64/targ.c @@ -13,7 +13,7 @@ amd64_memargs(int op) } Target T_amd64_sysv = { - .name = "amd64", + .name = "amd64_sysv", .gpr0 = RAX, .ngpr = NGPR, .fpr0 = XMM0,