/* Generated by Nimrod Compiler v0.9.5 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, i386, gcc */
/* Command for C compiler:
   gcc -c  -w -O3 -fno-strict-aliasing  -I/build/nimrod/src/nimrod/lib -o compiler/nimcache/patterns.o compiler/nimcache/patterns.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>
typedef struct tnode188803 tnode188803;
typedef struct tcontext250019 tcontext250019;
typedef struct tsym188833 tsym188833;
typedef struct tpatterncontext412008 tpatterncontext412008;
typedef struct tnodeseq188797 tnodeseq188797;
typedef struct TGenericSeq TGenericSeq;
typedef struct ttype188837 ttype188837;
typedef struct tidobj167013 tidobj167013;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq188835 ttypeseq188835;
typedef struct tloc188817 tloc188817;
typedef struct trope145007 trope145007;
typedef struct tscope188827 tscope188827;
typedef struct TY188933 TY188933;
typedef struct tinstantiation188823 tinstantiation188823;
typedef struct tstrtable188807 tstrtable188807;
typedef struct tsymseq188805 tsymseq188805;
typedef struct tident167019 tident167019;
typedef struct tlineinfo163527 tlineinfo163527;
typedef struct tlib188821 tlib188821;
typedef struct NimStringDesc NimStringDesc;
typedef struct tcell41090 tcell41090;
typedef struct tcellseq41106 tcellseq41106;
typedef struct tgcheap43016 tgcheap43016;
typedef struct tcellset41102 tcellset41102;
typedef struct tpagedesc41098 tpagedesc41098;
typedef struct tmemregion23410 tmemregion23410;
typedef struct tsmallchunk22638 tsmallchunk22638;
typedef struct tllchunk23404 tllchunk23404;
typedef struct tbigchunk22640 tbigchunk22640;
typedef struct tintset22615 tintset22615;
typedef struct ttrunk22611 ttrunk22611;
typedef struct tavlnode23408 tavlnode23408;
typedef struct tgcstat43014 tgcstat43014;
typedef struct TY412978 TY412978;
typedef struct tpasscontext246003 tpasscontext246003;
typedef struct tproccon250009 tproccon250009;
typedef struct tintset185047 tintset185047;
typedef struct ttrunk185043 ttrunk185043;
typedef struct ttrunkseq185045 ttrunkseq185045;
typedef struct tlinkedlist118023 tlinkedlist118023;
typedef struct tlistentry118017 tlistentry118017;
typedef struct tidtable188849 tidtable188849;
typedef struct tidpairseq188847 tidpairseq188847;
typedef struct tidpair188845 tidpair188845;
typedef struct tctx249037 tctx249037;
typedef struct TY250131 TY250131;
typedef struct tinstantiationpair250011 tinstantiationpair250011;
typedef struct TY188922 TY188922;
typedef struct tbasechunk22636 tbasechunk22636;
typedef struct tfreecell22628 tfreecell22628;
typedef struct TY249229 TY249229;
typedef struct TY164208 TY164208;
typedef struct pprocHEX3Aobjecttype249216 pprocHEX3Aobjecttype249216;
typedef struct TY249217 TY249217;
typedef struct tblock249023 tblock249023;
typedef struct TY249198 TY249198;
typedef struct TY249223 TY249223;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tpatterncontext412008  {
tsym188833* Owner;
tnodeseq188797* Mapping;
NI Formals;
tcontext250019* C;
NIM_BOOL Submatch;
};
typedef N_NIMCALL_PTR(void, TY2289) (void* p, NI op);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY2289 marker;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj167013  {
  TNimObject Sup;
NI Id;
};
struct  tloc188817  {
NU8 K;
NU8 S;
NU8 Flags;
ttype188837* T;
trope145007* R;
trope145007* Heaproot;
NI A;
};
struct  ttype188837  {
  tidobj167013 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq188835* Sons;
tnode188803* N;
tsym188833* Destructor;
tsym188833* Owner;
tsym188833* Sym;
NI64 Size;
NI Align;
tloc188817 Loc;
};
struct  tstrtable188807  {
NI Counter;
tsymseq188805* Data;
};
struct  tlineinfo163527  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tsym188833  {
  tidobj167013 Sup;
NU8 Kind;
union {
struct {ttypeseq188835* Typeinstcache;
tscope188827* Typscope;
} S1;
struct {TY188933* Procinstcache;
tscope188827* Scope;
} S2;
struct {TY188933* Usedgenerics;
tstrtable188807 Tab;
} S3;
} kindU;
NU16 Magic;
ttype188837* Typ;
tident167019* Name;
tlineinfo163527 Info;
tsym188833* Owner;
NU32 Flags;
tnode188803* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc188817 Loc;
tlib188821* Annex;
tnode188803* Constraint;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tnode188803  {
ttype188837* Typ;
tlineinfo163527 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym188833* Sym;
} S4;
struct {tident167019* Ident;
} S5;
struct {tnodeseq188797* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  tident167019  {
  tidobj167013 Sup;
NimStringDesc* S;
tident167019* Next;
NI H;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tcell41090  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq41106  {
NI Len;
NI Cap;
tcell41090** D;
};
struct  tcellset41102  {
NI Counter;
NI Max;
tpagedesc41098* Head;
tpagedesc41098** Data;
};
typedef tsmallchunk22638* TY23422[512];
typedef ttrunk22611* ttrunkbuckets22613[256];
struct  tintset22615  {
ttrunkbuckets22613 Data;
};
struct  tmemregion23410  {
NI Minlargeobj;
NI Maxlargeobj;
TY23422 Freesmallchunks;
tllchunk23404* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk22640* Freechunkslist;
tintset22615 Chunkstarts;
tavlnode23408* Root;
tavlnode23408* Deleted;
tavlnode23408* Last;
tavlnode23408* Freeavlnodes;
};
struct  tgcstat43014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap43016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq41106 Zct;
tcellseq41106 Decstack;
tcellset41102 Cycleroots;
tcellseq41106 Tempstack;
NI Recgclock;
tmemregion23410 Region;
tgcstat43014 Stat;
};
struct  TY412978  {
NI HEX3Astate412981;
tnode188803* P412722;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (tpatterncontext412008* c, tnode188803* op, tnode188803* n_412730, tnode188803* arglist, NIM_BOOL rpn, void* ClEnv);
void* ClEnv;
} TY412727;
typedef N_CLOSURE_PTR(NIM_BOOL, TMP2873) (tpatterncontext412008* c, tnode188803* op, tnode188803* n_412730, tnode188803* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP2874) (tpatterncontext412008* c, tnode188803* op, tnode188803* n_412730, tnode188803* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP2875) (tpatterncontext412008* c, tnode188803* op, tnode188803* n_412730, tnode188803* arglist, NIM_BOOL rpn);
struct  tpasscontext246003  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  tintset185047  {
NI Counter;
NI Max;
ttrunk185043* Head;
ttrunkseq185045* Data;
};
struct  tlinkedlist118023  {
tlistentry118017* Head;
tlistentry118017* Tail;
NI Counter;
};
struct  tidpair188845  {
tidobj167013* Key;
TNimObject* Val;
};
struct  tidtable188849  {
NI Counter;
tidpairseq188847* Data;
};
typedef N_NIMCALL_PTR(tnode188803*, TY250061) (tcontext250019* c, tnode188803* n);
typedef N_NIMCALL_PTR(tnode188803*, TY250066) (tcontext250019* c, tnode188803* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode188803*, TY250074) (tcontext250019* c, tnode188803* n, NU16 flags, NIM_BOOL buffererrors);
typedef N_NIMCALL_PTR(tnode188803*, TY250083) (tcontext250019* c, tnode188803* n);
typedef N_NIMCALL_PTR(tnode188803*, TY250088) (tcontext250019* c, tnode188803* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode188803*, TY250096) (tcontext250019* c, tnode188803* n);
typedef N_NIMCALL_PTR(tnode188803*, TY250101) (tcontext250019* c, tnode188803* n, tnode188803* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype188837*, TY250108) (tcontext250019* c, tnode188803* n, ttype188837* prev);
typedef struct {
N_NIMCALL_PTR(tnode188803*, ClPrc) (tcontext250019* c, tidtable188849 pt, tnode188803* n, void* ClEnv);
void* ClEnv;
} TY250114;
typedef struct {
N_NIMCALL_PTR(tsym188833*, ClPrc) (tcontext250019* c, tsym188833* fn, tidtable188849 pt, tlineinfo163527 info, void* ClEnv);
void* ClEnv;
} TY250120;
struct  tinstantiationpair250011  {
tsym188833* Genericsym;
tinstantiation188823* Inst;
};
struct  tcontext250019  {
  tpasscontext246003 Sup;
tsym188833* Module;
tscope188827* Currentscope;
tscope188827* Importtable;
tscope188827* Toplevelscope;
tproccon250009* P;
tsym188833* Friendmodule;
NI Instcounter;
tintset185047 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq188805* Converters;
tsymseq188805* Patterns;
tlinkedlist118023 Optionstack;
tidtable188849 Symmapping;
tlinkedlist118023 Libs;
TY250061 Semconstexpr;
TY250066 Semexpr;
TY250074 Semtryexpr;
TY250083 Semtryconstexpr;
TY250088 Semoperand;
TY250096 Semconstboolexpr;
TY250101 Semoverloadedcall;
TY250108 Semtypenode;
TY250114 Seminferredlambda;
TY250120 Semgenerateinstance;
tintset185047 Includedfiles;
tstrtable188807 Userpragmas;
tctx249037* Evalcontext;
tintset185047 Unknownidents;
TY250131* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
};
struct  trope145007  {
  TNimObject Sup;
trope145007* Left;
trope145007* Right;
NI Length;
NimStringDesc* Data;
};
struct  tscope188827  {
NI Depthlevel;
tstrtable188807 Symbols;
tnodeseq188797* Usingsyms;
tscope188827* Parent;
};
struct  tinstantiation188823  {
tsym188833* Sym;
ttypeseq188835* Concretetypes;
TY188922* Usedby;
};
struct  tlistentry118017  {
  TNimObject Sup;
tlistentry118017* Prev;
tlistentry118017* Next;
};
struct  tlib188821  {
  tlistentry118017 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope145007* Name;
tnode188803* Path;
};
typedef NI TY22618[16];
struct  tpagedesc41098  {
tpagedesc41098* Next;
NI Key;
TY22618 Bits;
};
struct  tbasechunk22636  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk22638  {
  tbasechunk22636 Sup;
tsmallchunk22638* Next;
tsmallchunk22638* Prev;
tfreecell22628* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk23404  {
NI Size;
NI Acc;
tllchunk23404* Next;
};
struct  tbigchunk22640  {
  tbasechunk22636 Sup;
tbigchunk22640* Next;
tbigchunk22640* Prev;
NI Align;
NF Data;
};
struct  ttrunk22611  {
ttrunk22611* Next;
NI Key;
TY22618 Bits;
};
typedef tavlnode23408* TY23414[2];
struct  tavlnode23408  {
TY23414 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tproccon250009  {
tsym188833* Owner;
tsym188833* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon250009* Next;
};
struct  ttrunk185043  {
ttrunk185043* Next;
NI Key;
TY22618 Bits;
};
struct  tctx249037  {
  tpasscontext246003 Sup;
TY249229* Code;
TY164208* Debug;
tnode188803* Globals;
tnode188803* Constants;
ttypeseq188835* Types;
tnode188803* Currentexceptiona;
tnode188803* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype249216* Prc;
tsym188833* Module;
tnode188803* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
};
struct  tfreecell22628  {
tfreecell22628* Next;
NI Zerofield;
};
struct  tblock249023  {
tsym188833* Label;
TY249198* Fixups;
};
struct TY249223 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY249223 TY249220[256];
struct  pprocHEX3Aobjecttype249216  {
TY249217* Blocks;
tsym188833* Sym;
TY249220 Slots;
NI Maxslots;
};
struct tnodeseq188797 {
  TGenericSeq Sup;
  tnode188803* data[SEQ_DECL_SIZE];
};
struct ttypeseq188835 {
  TGenericSeq Sup;
  ttype188837* data[SEQ_DECL_SIZE];
};
struct TY188933 {
  TGenericSeq Sup;
  tinstantiation188823* data[SEQ_DECL_SIZE];
};
struct tsymseq188805 {
  TGenericSeq Sup;
  tsym188833* data[SEQ_DECL_SIZE];
};
struct ttrunkseq185045 {
  TGenericSeq Sup;
  ttrunk185043* data[SEQ_DECL_SIZE];
};
struct tidpairseq188847 {
  TGenericSeq Sup;
  tidpair188845 data[SEQ_DECL_SIZE];
};
struct TY250131 {
  TGenericSeq Sup;
  tinstantiationpair250011 data[SEQ_DECL_SIZE];
};
struct TY188922 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY249229 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY164208 {
  TGenericSeq Sup;
  tlineinfo163527 data[SEQ_DECL_SIZE];
};
struct TY249198 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY249217 {
  TGenericSeq Sup;
  tblock249023 data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, sonslen_189185)(ttype188837* n);
N_NIMCALL(tnode188803*, matchstmtlist_413942)(tpatterncontext412008* c, tnode188803* p, tnode188803* n_413946);
static N_INLINE(NI, len_189264)(tnode188803* n);
N_NIMCALL(tnode188803*, flattenstmts_222251)(tnode188803* n);
N_NIMCALL(NIM_BOOL, matchrange_413948)(tpatterncontext412008* c, tnode188803* p, tnode188803* n, NI i);
N_NIMCALL(NIM_BOOL, matches_412070)(tpatterncontext412008* c, tnode188803* p, tnode188803* n_412074);
static N_INLINE(NIM_BOOL, ispatternparam_412518)(tpatterncontext412008* c, tnode188803* p);
N_NIMCALL(NIM_BOOL, bindorcheck_412636)(tpatterncontext412008* c, tsym188833* param, tnode188803* n);
N_NIMCALL(tnode188803*, getlazy_412018)(tpatterncontext412008* c, tsym188833* sym);
N_NIMCALL(NIM_BOOL, sametrees_412107)(tnode188803* a, tnode188803* b);
static N_INLINE(NIM_BOOL, samekinds_412082)(tnode188803* a, tnode188803* b);
N_NIMCALL(NU8, canonkind_412076)(tnode188803* n);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NIM_BOOL, sametypeornil_228128)(ttype188837* a, ttype188837* b, NU8 flags);
static N_INLINE(NI, sonslen_189181)(tnode188803* n);
N_NIMCALL(NIM_BOOL, checktypes_412468)(tpatterncontext412008* c, tsym188833* p, tnode188803* n);
N_NIMCALL(NIM_BOOL, matchnodekinds_277312)(tnode188803* p, tnode188803* n);
N_NIMCALL(NIM_BOOL, argtypematches_353662)(tcontext250019* c, ttype188837* f, ttype188837* a);
N_NIMCALL(void, putlazy_412036)(tpatterncontext412008* c, tsym188833* sym, tnode188803* n);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(tcell41090*, usrtocell_44443)(void* usr);
static N_INLINE(void, rtladdzct_46002)(tcell41090* c);
N_NOINLINE(void, addzct_44418)(tcellseq41106* s, tcell41090* c);
N_NIMCALL(NIM_BOOL, insymchoice_412316)(tnode188803* sc, tnode188803* x);
N_NIMCALL(NIM_BOOL, matchchoice_412587)(tpatterncontext412008* c, tnode188803* p, tnode188803* n);
N_NIMCALL(NIM_BOOL, matchnested_412719)(tpatterncontext412008* c, tnode188803* p, tnode188803* n, NIM_BOOL rpn);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP2872)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(tnode188803*, newnodei_189099)(NU8 kind, tlineinfo163527 info);
N_CLOSURE(NIM_BOOL, matchstaraux_412726)(tpatterncontext412008* c, tnode188803* op, tnode188803* n_412730, tnode188803* arglist, NIM_BOOL rpn, void* ClEnv);
static N_INLINE(tnode188803*, HEX5BHEX5D_189694)(tnode188803* n, NI i);
N_NIMCALL(void, add_189390)(tnode188803* father, tnode188803* son);
N_NIMCALL(void, internalerror_165591)(tlineinfo163527 info, NimStringDesc* errmsg);
N_NIMCALL(void, gather_412671)(tpatterncontext412008* c, tsym188833* param, tnode188803* n);
N_NIMCALL(tnode188803*, newnodei_190803)(NU8 kind, tlineinfo163527 info, NI children);
static N_INLINE(tnode188803*, lastson_189189)(tnode188803* n);
N_NIMCALL(void, genericSeqAssign)(void* dest, void* src_74604, TNimType* mt);
N_NIMCALL(tnode188803*, extractrange_222271)(NU8 k, tnode188803* n, NI a, NI b);
N_NIMCALL(tnode188803*, newsymnode_190723)(tsym188833* sym, tlineinfo163527 info);
N_NIMCALL(NIM_BOOL, aliasanalysisrequested_414102)(tnode188803* params);
N_NIMCALL(NU8, whichalias_276061)(tsym188833* p);
N_NIMCALL(void, addtoarglist_414173)(tnode188803* result, tnode188803* n);
N_NIMCALL(NU8, ispartof_411388)(tnode188803* a, tnode188803* b);
N_NIMCALL(void, markused_345244)(tnode188803* n, tsym188833* s);
STRING_LITERAL(TMP2867, "|", 1);
STRING_LITERAL(TMP2868, "*", 1);
STRING_LITERAL(TMP2869, "**", 2);
STRING_LITERAL(TMP2870, "~", 1);
STRING_LITERAL(TMP2876, "invalid pattern", 15);
extern TNimType NTI188797; /* TNodeSeq */
extern tgcheap43016 gch_43044;
TNimType NTI412978; /* object */
extern TNimType NTI353715; /* range -1..0(int) */
extern TNimType NTI188795; /* PNode */
TNimType NTI412986; /* ref object */

static N_INLINE(NI, sonslen_189185)(ttype188837* n) {
	NI result;
	result = 0;
	{
		if (!(*n).Sons == 0) goto LA3;
		result = 0;
	}
	goto LA1;
	LA3: ;
	{
		result = (*n).Sons->Sup.len;
	}
	LA1: ;
	return result;
}

static N_INLINE(NI, len_189264)(tnode188803* n) {
	NI result;
	result = 0;
	{
		if (!(*n).kindU.S6.Sons == 0) goto LA3;
		result = 0;
	}
	goto LA1;
	LA3: ;
	{
		result = (*n).kindU.S6.Sons->Sup.len;
	}
	LA1: ;
	return result;
}

static N_INLINE(NIM_BOOL, ispatternparam_412518)(tpatterncontext412008* c, tnode188803* p) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	NIM_BOOL LOC2;
	result = 0;
	LOC1 = 0;
	LOC2 = 0;
	LOC2 = ((*p).Kind == ((NU8) 3));
	if (!(LOC2)) goto LA3;
	LOC2 = ((*(*p).kindU.S4.Sym).Kind == ((NU8) 3));
	LA3: ;
	LOC1 = LOC2;
	if (!(LOC1)) goto LA4;
	LOC1 = ((*(*p).kindU.S4.Sym).Owner == (*c).Owner);
	LA4: ;
	result = LOC1;
	return result;
}

N_NIMCALL(tnode188803*, getlazy_412018)(tpatterncontext412008* c, tsym188833* sym) {
	tnode188803* result;
	result = 0;
	{
		if (!!((*c).Mapping == 0)) goto LA3;
		result = (*c).Mapping->data[(*sym).Position];
	}
	LA3: ;
	return result;
}

N_NIMCALL(NU8, canonkind_412076)(tnode188803* n) {
	NU8 result;
	result = 0;
	result = (*n).Kind;
	switch (result) {
	case ((NU8) 27):
	case ((NU8) 29):
	case ((NU8) 30):
	case ((NU8) 31):
	case ((NU8) 26):
	case ((NU8) 28):
	case ((NU8) 32):
	{
		result = ((NU8) 27);
	}
	break;
	case ((NU8) 20) ... ((NU8) 22):
	{
		result = ((NU8) 20);
	}
	break;
	case ((NU8) 74):
	{
		result = ((NU8) 73);
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

static N_INLINE(NIM_BOOL, samekinds_412082)(tnode188803* a, tnode188803* b) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	NU8 LOC3;
	NU8 LOC4;
	result = 0;
	LOC1 = 0;
	LOC1 = ((*a).Kind == (*b).Kind);
	if (LOC1) goto LA2;
	LOC3 = 0;
	LOC3 = canonkind_412076(a);
	LOC4 = 0;
	LOC4 = canonkind_412076(b);
	LOC1 = (LOC3 == LOC4);
	LA2: ;
	result = LOC1;
	return result;
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL LOC11;
	int LOC13;
	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = (a == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = 0;
	LOC11 = ((*a).Sup.len == (*b).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC13 = 0;
	LOC13 = memcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)), (NI32)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, sonslen_189181)(tnode188803* n) {
	NI result;
	result = 0;
	{
		if (!(*n).kindU.S6.Sons == 0) goto LA3;
		result = 0;
	}
	goto LA1;
	LA3: ;
	{
		result = (*n).kindU.S6.Sons->Sup.len;
	}
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, sametrees_412107)(tnode188803* a, tnode188803* b) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = samekinds_412082(a, b);
		if (!LOC3) goto LA4;
		switch ((*a).Kind) {
		case ((NU8) 3):
		{
			result = ((*a).kindU.S4.Sym == (*b).kindU.S4.Sym);
		}
		break;
		case ((NU8) 2):
		{
			result = ((*(*a).kindU.S5.Ident).Sup.Id == (*(*b).kindU.S5.Ident).Sup.Id);
		}
		break;
		case ((NU8) 5) ... ((NU8) 10):
		{
			result = ((*a).kindU.S1.Intval == (*b).kindU.S1.Intval);
		}
		break;
		case ((NU8) 16) ... ((NU8) 18):
		{
			result = ((*a).kindU.S2.Floatval == (*b).kindU.S2.Floatval);
		}
		break;
		case ((NU8) 20) ... ((NU8) 22):
		{
			result = eqStrings((*a).kindU.S3.Strval, (*b).kindU.S3.Strval);
		}
		break;
		case ((NU8) 1):
		case ((NU8) 23):
		{
			result = NIM_TRUE;
		}
		break;
		case ((NU8) 4):
		{
			result = sametypeornil_228128((*a).Typ, (*b).Typ, 0);
		}
		break;
		default:
		{
			{
				NI LOC16;
				NI LOC17;
				NI i_412280;
				NI HEX3Atmp_412309;
				NI LOC20;
				NI res_412311;
				LOC16 = 0;
				LOC16 = sonslen_189181(a);
				LOC17 = 0;
				LOC17 = sonslen_189181(b);
				if (!(LOC16 == LOC17)) goto LA18;
				i_412280 = 0;
				HEX3Atmp_412309 = 0;
				LOC20 = 0;
				LOC20 = sonslen_189181(a);
				HEX3Atmp_412309 = (NI32)(LOC20 - 1);
				res_412311 = 0;
				while (1) {
					if (!(res_412311 <= HEX3Atmp_412309)) goto LA21;
					i_412280 = res_412311;
					{
						NIM_BOOL LOC24;
						LOC24 = 0;
						LOC24 = sametrees_412107((*a).kindU.S6.Sons->data[i_412280], (*b).kindU.S6.Sons->data[i_412280]);
						if (!!(LOC24)) goto LA25;
						goto BeforeRet;
					}
					LA25: ;
					res_412311 += 1;
				} LA21: ;
				result = NIM_TRUE;
			}
			LA18: ;
		}
		break;
		}
	}
	LA4: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, checktypes_412468)(tpatterncontext412008* c, tsym188833* p, tnode188803* n) {
	NIM_BOOL result;
	result = 0;
	{
		if (!!(((*p).Constraint == NIM_NIL))) goto LA3;
		result = matchnodekinds_277312((*p).Constraint, n);
		{
			if (!!(result)) goto LA7;
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	{
		if (!(*n).Typ == 0) goto LA11;
		result = ((*(*p).Typ).Kind == ((NU8) 3) || (*(*p).Typ).Kind == ((NU8) 7));
	}
	goto LA9;
	LA11: ;
	{
		result = argtypematches_353662((*c).C, (*p).Typ, (*n).Typ);
	}
	LA9: ;
	BeforeRet: ;
	return result;
}

static N_INLINE(tcell41090*, usrtocell_44443)(void* usr) {
	tcell41090* result;
	result = 0;
	result = ((tcell41090*) ((NI)((NU32)(((NI) (usr))) - (NU32)(((NI)sizeof(tcell41090))))));
	return result;
}

static N_INLINE(void, rtladdzct_46002)(tcell41090* c) {
	addzct_44418(&gch_43044.Zct, c);
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tcell41090* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_44443(src);
		(*c).Refcount += 8;
	}
	LA3: ;
	{
		tcell41090* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_44443((*dest));
		{
			(*c).Refcount -= 8;
			if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA11;
			rtladdzct_46002(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(void, putlazy_412036)(tpatterncontext412008* c, tsym188833* sym, tnode188803* n) {
	{
		if (!(*c).Mapping == 0) goto LA3;
		unsureAsgnRef((void**) &(*c).Mapping, (tnodeseq188797*) newSeq((&NTI188797), (*c).Formals));
	}
	LA3: ;
	asgnRefNoCycle((void**) &(*c).Mapping->data[(*sym).Position], n);
}

N_NIMCALL(NIM_BOOL, bindorcheck_412636)(tpatterncontext412008* c, tsym188833* param, tnode188803* n) {
	NIM_BOOL result;
	tnode188803* pp;
	result = 0;
	pp = getlazy_412018(c, param);
	{
		if (!!((pp == NIM_NIL))) goto LA3;
		result = sametrees_412107(pp, n);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = ((*n).Kind == ((NU8) 150));
		if (LOC6) goto LA7;
		LOC6 = checktypes_412468(c, param, n);
		LA7: ;
		if (!LOC6) goto LA8;
		putlazy_412036(c, param, n);
		result = NIM_TRUE;
	}
	goto LA1;
	LA8: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, insymchoice_412316)(tnode188803* sc, tnode188803* x) {
	NIM_BOOL result;
	result = 0;
	{
		NI i_412351;
		NI HEX3Atmp_412461;
		NI LOC5;
		NI res_412463;
		if (!((*sc).Kind == ((NU8) 56))) goto LA3;
		i_412351 = 0;
		HEX3Atmp_412461 = 0;
		LOC5 = 0;
		LOC5 = len_189264(sc);
		HEX3Atmp_412461 = LOC5 - 1;
		res_412463 = 0;
		while (1) {
			if (!(res_412463 <= HEX3Atmp_412461)) goto LA6;
			i_412351 = res_412463;
			{
				if (!((*(*sc).kindU.S6.Sons->data[i_412351]).kindU.S4.Sym == (*x).kindU.S4.Sym)) goto LA9;
				result = NIM_TRUE;
				goto BeforeRet;
			}
			LA9: ;
			res_412463 += 1;
		} LA6: ;
	}
	goto LA1;
	LA3: ;
	{
		if (!((*sc).Kind == ((NU8) 57))) goto LA12;
		result = ((*(*(*(*sc).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name).Sup.Id == (*(*(*x).kindU.S4.Sym).Name).Sup.Id);
	}
	goto LA1;
	LA12: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchchoice_412587)(tpatterncontext412008* c, tnode188803* p, tnode188803* n) {
	NIM_BOOL result;
	NI i_412614;
	NI HEX3Atmp_412629;
	NI LOC1;
	NI res_412631;
	result = 0;
	i_412614 = 0;
	HEX3Atmp_412629 = 0;
	LOC1 = 0;
	LOC1 = len_189264(p);
	HEX3Atmp_412629 = LOC1 - 1;
	res_412631 = 1;
	while (1) {
		if (!(res_412631 <= HEX3Atmp_412629)) goto LA2;
		i_412614 = res_412631;
		{
			NIM_BOOL LOC5;
			LOC5 = 0;
			LOC5 = matches_412070(c, (*p).kindU.S6.Sons->data[i_412614], n);
			if (!LOC5) goto LA6;
			result = NIM_TRUE;
			goto BeforeRet;
		}
		LA6: ;
		res_412631 += 1;
	} LA2: ;
	BeforeRet: ;
	return result;
}
N_NIMCALL(void, TMP2872)(void* p, NI op) {
	TY412978* a;
	a = (TY412978*)p;
	nimGCvisit((void*)(*a).P412722, op);
}

static N_INLINE(tnode188803*, HEX5BHEX5D_189694)(tnode188803* n, NI i) {
	tnode188803* result;
	result = 0;
	result = (*n).kindU.S6.Sons->data[i];
	return result;
}

N_CLOSURE(NIM_BOOL, matchstaraux_412726)(tpatterncontext412008* c, tnode188803* op, tnode188803* n_412730, tnode188803* arglist, NIM_BOOL rpn, void* ClEnv) {
	NIM_BOOL result;
	TY412978* HEX3Aenv_412979;
	result = 0;
	HEX3Aenv_412979 = (TY412978*) ClEnv;
	result = NIM_TRUE;
	{
		NIM_BOOL LOC3;
		NI i_412785;
		NI HEX3Atmp_412897;
		NI LOC7;
		NI res_412899;
		LOC3 = 0;
		LOC3 = ((*n_412730).Kind == ((NU8) 27) || (*n_412730).Kind == ((NU8) 29) || (*n_412730).Kind == ((NU8) 30) || (*n_412730).Kind == ((NU8) 31) || (*n_412730).Kind == ((NU8) 26) || (*n_412730).Kind == ((NU8) 28) || (*n_412730).Kind == ((NU8) 32));
		if (!(LOC3)) goto LA4;
		LOC3 = matches_412070(c, (*op).kindU.S6.Sons->data[1], (*n_412730).kindU.S6.Sons->data[0]);
		LA4: ;
		if (!LOC3) goto LA5;
		i_412785 = 0;
		HEX3Atmp_412897 = 0;
		LOC7 = 0;
		LOC7 = sonslen_189181(n_412730);
		HEX3Atmp_412897 = (NI32)(LOC7 - 1);
		res_412899 = 1;
		while (1) {
			if (!(res_412899 <= HEX3Atmp_412897)) goto LA8;
			i_412785 = res_412899;
			{
				TY412727 LOC11;
				tnode188803* LOC12;
				NIM_BOOL LOC13;
				memset((void*)&LOC11, 0, sizeof(LOC11));
				LOC11.ClPrc = matchstaraux_412726; LOC11.ClEnv = HEX3Aenv_412979;
				LOC12 = 0;
				LOC12 = HEX5BHEX5D_189694(n_412730, i_412785);
				LOC13 = 0;
				LOC13 = LOC11.ClEnv? LOC11.ClPrc(c, op, LOC12, arglist, rpn, LOC11.ClEnv):((TMP2873)(LOC11.ClPrc))(c, op, LOC12, arglist, rpn);
				if (!!(LOC13)) goto LA14;
				result = NIM_FALSE;
				goto BeforeRet;
			}
			LA14: ;
			res_412899 += 1;
		} LA8: ;
		{
			if (!rpn) goto LA18;
			add_189390(arglist, (*n_412730).kindU.S6.Sons->data[0]);
		}
		LA18: ;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC21;
		tnode188803* n;
		NI i_412868;
		NI HEX3Atmp_412901;
		NI LOC25;
		NI res_412903;
		LOC21 = 0;
		LOC21 = ((*n_412730).Kind == ((NU8) 58));
		if (!(LOC21)) goto LA22;
		LOC21 = ((*(*n_412730).kindU.S6.Sons->data[1]).Kind == ((NU8) 41));
		LA22: ;
		if (!LOC21) goto LA23;
		n = (*n_412730).kindU.S6.Sons->data[1];
		i_412868 = 0;
		HEX3Atmp_412901 = 0;
		LOC25 = 0;
		LOC25 = len_189264(n);
		HEX3Atmp_412901 = LOC25 - 1;
		res_412903 = 0;
		while (1) {
			if (!(res_412903 <= HEX3Atmp_412901)) goto LA26;
			i_412868 = res_412903;
			{
				TY412727 LOC29;
				tnode188803* LOC30;
				NIM_BOOL LOC31;
				memset((void*)&LOC29, 0, sizeof(LOC29));
				LOC29.ClPrc = matchstaraux_412726; LOC29.ClEnv = HEX3Aenv_412979;
				LOC30 = 0;
				LOC30 = HEX5BHEX5D_189694(n, i_412868);
				LOC31 = 0;
				LOC31 = LOC29.ClEnv? LOC29.ClPrc(c, op, LOC30, arglist, rpn, LOC29.ClEnv):((TMP2874)(LOC29.ClPrc))(c, op, LOC30, arglist, rpn);
				if (!!(LOC31)) goto LA32;
				result = NIM_FALSE;
				goto BeforeRet;
			}
			LA32: ;
			res_412903 += 1;
		} LA26: ;
	}
	goto LA1;
	LA23: ;
	{
		NIM_BOOL LOC35;
		LOC35 = 0;
		LOC35 = checktypes_412468(c, (*(*(*HEX3Aenv_412979).P412722).kindU.S6.Sons->data[2]).kindU.S4.Sym, n_412730);
		if (!LOC35) goto LA36;
		add_189390(arglist, n_412730);
	}
	goto LA1;
	LA36: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchnested_412719)(tpatterncontext412008* c, tnode188803* p, tnode188803* n, NIM_BOOL rpn) {
	NIM_BOOL result;
	TY412978* HEX3Aenv_412985;
	result = 0;
	HEX3Aenv_412985 = 0;
	HEX3Aenv_412985 = (TY412978*) newObj((&NTI412986), sizeof(TY412978));
	asgnRefNoCycle((void**) &(*HEX3Aenv_412985).P412722, p);
	{
		if (!!(((*n).Kind == ((NU8) 27) || (*n).Kind == ((NU8) 29) || (*n).Kind == ((NU8) 30) || (*n).Kind == ((NU8) 31) || (*n).Kind == ((NU8) 26) || (*n).Kind == ((NU8) 28) || (*n).Kind == ((NU8) 32)))) goto LA3;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		tnode188803* arglist;
		LOC7 = 0;
		LOC7 = matches_412070(c, (*(*HEX3Aenv_412985).P412722).kindU.S6.Sons->data[1], (*n).kindU.S6.Sons->data[0]);
		if (!LOC7) goto LA8;
		arglist = newnodei_189099(((NU8) 150), (*n).Info);
		{
			TY412727 LOC12;
			NIM_BOOL LOC13;
			memset((void*)&LOC12, 0, sizeof(LOC12));
			LOC12.ClPrc = matchstaraux_412726; LOC12.ClEnv = HEX3Aenv_412985;
			LOC13 = 0;
			LOC13 = LOC12.ClEnv? LOC12.ClPrc(c, (*HEX3Aenv_412985).P412722, n, arglist, rpn, LOC12.ClEnv):((TMP2875)(LOC12.ClPrc))(c, (*HEX3Aenv_412985).P412722, n, arglist, rpn);
			if (!LOC13) goto LA14;
			result = bindorcheck_412636(c, (*(*(*HEX3Aenv_412985).P412722).kindU.S6.Sons->data[2]).kindU.S4.Sym, arglist);
		}
		LA14: ;
	}
	LA8: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, gather_412671)(tpatterncontext412008* c, tsym188833* param, tnode188803* n) {
	tnode188803* pp;
	pp = getlazy_412018(c, param);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = !((pp == NIM_NIL));
		if (!(LOC3)) goto LA4;
		LOC3 = ((*pp).Kind == ((NU8) 150));
		LA4: ;
		if (!LOC3) goto LA5;
		add_189390(pp, n);
	}
	goto LA1;
	LA5: ;
	{
		pp = newnodei_190803(((NU8) 150), (*n).Info, 1);
		asgnRefNoCycle((void**) &(*pp).kindU.S6.Sons->data[0], n);
		putlazy_412036(c, param, pp);
	}
	LA1: ;
}

static N_INLINE(tnode188803*, lastson_189189)(tnode188803* n) {
	tnode188803* result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = sonslen_189181(n);
	result = (*n).kindU.S6.Sons->data[(NI32)(LOC1 - 1)];
	return result;
}

N_NIMCALL(NIM_BOOL, matches_412070)(tpatterncontext412008* c, tnode188803* p, tnode188803* n_412074) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ispatternparam_412518(c, p);
		if (!LOC3) goto LA4;
		result = bindorcheck_412636(c, (*p).kindU.S4.Sym, n_412074);
	}
	goto LA1;
	LA4: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = ((*n_412074).Kind == ((NU8) 3));
		if (!(LOC7)) goto LA8;
		LOC7 = ((*p).Kind == ((NU8) 2));
		LA8: ;
		if (!LOC7) goto LA9;
		result = ((*(*p).kindU.S5.Ident).Sup.Id == (*(*(*n_412074).kindU.S4.Sym).Name).Sup.Id);
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC12;
		LOC12 = 0;
		LOC12 = ((*n_412074).Kind == ((NU8) 3));
		if (!(LOC12)) goto LA13;
		LOC12 = insymchoice_412316(p, n_412074);
		LA13: ;
		if (!LOC12) goto LA14;
		result = NIM_TRUE;
	}
	goto LA1;
	LA14: ;
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = ((*n_412074).Kind == ((NU8) 3));
		if (!(LOC17)) goto LA18;
		LOC17 = ((*(*n_412074).kindU.S4.Sym).Kind == ((NU8) 10));
		LA18: ;
		if (!LOC17) goto LA19;
		{
			if (!((*p).Kind == ((NU8) 3))) goto LA23;
			result = ((*p).kindU.S4.Sym == (*n_412074).kindU.S4.Sym);
		}
		goto LA21;
		LA23: ;
		{
			NIM_BOOL LOC26;
			LOC26 = 0;
			LOC26 = matches_412070(c, p, (*(*n_412074).kindU.S4.Sym).Ast);
			if (!LOC26) goto LA27;
			result = NIM_TRUE;
		}
		goto LA21;
		LA27: ;
		LA21: ;
	}
	goto LA1;
	LA19: ;
	{
		NimStringDesc* opr;
		if (!((*p).Kind == ((NU8) 151))) goto LA30;
		opr = (*(*(*p).kindU.S6.Sons->data[0]).kindU.S5.Ident).S;
		if (eqStrings(opr, ((NimStringDesc*) &TMP2867))) goto LA32;
		if (eqStrings(opr, ((NimStringDesc*) &TMP2868))) goto LA33;
		if (eqStrings(opr, ((NimStringDesc*) &TMP2869))) goto LA34;
		if (eqStrings(opr, ((NimStringDesc*) &TMP2870))) goto LA35;
		goto LA36;
		LA32: ;
		{
			result = matchchoice_412587(c, p, n_412074);
		}
		goto LA37;
		LA33: ;
		{
			result = matchnested_412719(c, p, n_412074, NIM_FALSE);
		}
		goto LA37;
		LA34: ;
		{
			result = matchnested_412719(c, p, n_412074, NIM_TRUE);
		}
		goto LA37;
		LA35: ;
		{
			NIM_BOOL LOC42;
			LOC42 = 0;
			LOC42 = matches_412070(c, (*p).kindU.S6.Sons->data[1], n_412074);
			result = !(LOC42);
		}
		goto LA37;
		LA36: ;
		{
			internalerror_165591((*p).Info, ((NimStringDesc*) &TMP2876));
		}
		LA37: ;
	}
	goto LA1;
	LA30: ;
	{
		if (!((*p).Kind == ((NU8) 40))) goto LA45;
		{
			if (!((*(*p).kindU.S6.Sons->data[1]).Kind == ((NU8) 30))) goto LA49;
			{
				NIM_BOOL LOC53;
				LOC53 = 0;
				LOC53 = matches_412070(c, (*p).kindU.S6.Sons->data[0], n_412074);
				if (!LOC53) goto LA54;
				gather_412671(c, (*(*(*p).kindU.S6.Sons->data[1]).kindU.S6.Sons->data[1]).kindU.S4.Sym, n_412074);
				result = NIM_TRUE;
			}
			LA54: ;
		}
		goto LA47;
		LA49: ;
		{
			{
				NIM_BOOL LOC59;
				LOC59 = 0;
				LOC59 = matches_412070(c, (*p).kindU.S6.Sons->data[0], n_412074);
				if (!LOC59) goto LA60;
				result = bindorcheck_412636(c, (*(*p).kindU.S6.Sons->data[1]).kindU.S4.Sym, n_412074);
			}
			LA60: ;
		}
		LA47: ;
	}
	goto LA1;
	LA45: ;
	{
		NIM_BOOL LOC63;
		LOC63 = 0;
		LOC63 = samekinds_412082(p, n_412074);
		if (!LOC63) goto LA64;
		switch ((*p).Kind) {
		case ((NU8) 3):
		{
			result = ((*p).kindU.S4.Sym == (*n_412074).kindU.S4.Sym);
		}
		break;
		case ((NU8) 2):
		{
			result = ((*(*p).kindU.S5.Ident).Sup.Id == (*(*n_412074).kindU.S5.Ident).Sup.Id);
		}
		break;
		case ((NU8) 5) ... ((NU8) 10):
		{
			result = ((*p).kindU.S1.Intval == (*n_412074).kindU.S1.Intval);
		}
		break;
		case ((NU8) 16) ... ((NU8) 18):
		{
			result = ((*p).kindU.S2.Floatval == (*n_412074).kindU.S2.Floatval);
		}
		break;
		case ((NU8) 20) ... ((NU8) 22):
		{
			result = eqStrings((*p).kindU.S3.Strval, (*n_412074).kindU.S3.Strval);
		}
		break;
		case ((NU8) 1):
		case ((NU8) 23):
		case ((NU8) 4):
		{
			result = NIM_TRUE;
		}
		break;
		default:
		{
			NI plen;
			tnode188803* v;
			plen = sonslen_189181(p);
			v = lastson_189189(p);
			{
				NIM_BOOL LOC75;
				tnode188803* arglist;
				LOC75 = 0;
				LOC75 = ispatternparam_412518(c, v);
				if (!(LOC75)) goto LA76;
				LOC75 = ((*(*(*v).kindU.S4.Sym).Typ).Kind == ((NU8) 48));
				LA76: ;
				if (!LOC75) goto LA77;
				arglist = 0;
				{
					NI LOC81;
					NI i_413637;
					NI HEX3Atmp_413915;
					NI res_413917;
					LOC81 = 0;
					LOC81 = sonslen_189181(n_412074);
					if (!(plen <= LOC81)) goto LA82;
					i_413637 = 0;
					HEX3Atmp_413915 = 0;
					HEX3Atmp_413915 = (NI32)(plen - 2);
					res_413917 = 0;
					while (1) {
						if (!(res_413917 <= HEX3Atmp_413915)) goto LA84;
						i_413637 = res_413917;
						{
							NIM_BOOL LOC87;
							LOC87 = 0;
							LOC87 = matches_412070(c, (*p).kindU.S6.Sons->data[i_413637], (*n_412074).kindU.S6.Sons->data[i_413637]);
							if (!!(LOC87)) goto LA88;
							goto BeforeRet;
						}
						LA88: ;
						res_413917 += 1;
					} LA84: ;
					{
						NIM_BOOL LOC92;
						NIM_BOOL LOC93;
						NI LOC94;
						tnode188803* LOC96;
						tnode188803* LOC98;
						tnode188803* n;
						tnode188803* LOC101;
						NI LOC102;
						NI i_413734;
						NI HEX3Atmp_413919;
						NI LOC103;
						NI res_413921;
						LOC92 = 0;
						LOC93 = 0;
						LOC94 = 0;
						LOC94 = sonslen_189181(n_412074);
						LOC93 = (plen == LOC94);
						if (!(LOC93)) goto LA95;
						LOC96 = 0;
						LOC96 = lastson_189189(n_412074);
						LOC93 = ((*LOC96).Kind == ((NU8) 58));
						LA95: ;
						LOC92 = LOC93;
						if (!(LOC92)) goto LA97;
						LOC98 = 0;
						LOC98 = lastson_189189(n_412074);
						LOC92 = ((*(*LOC98).kindU.S6.Sons->data[1]).Kind == ((NU8) 41));
						LA97: ;
						if (!LOC92) goto LA99;
						LOC101 = 0;
						LOC101 = lastson_189189(n_412074);
						n = (*LOC101).kindU.S6.Sons->data[1];
						LOC102 = 0;
						LOC102 = len_189264(n);
						arglist = newnodei_190803(((NU8) 150), (*n).Info, LOC102);
						i_413734 = 0;
						HEX3Atmp_413919 = 0;
						LOC103 = 0;
						LOC103 = len_189264(n);
						HEX3Atmp_413919 = LOC103 - 1;
						res_413921 = 0;
						while (1) {
							if (!(res_413921 <= HEX3Atmp_413919)) goto LA104;
							i_413734 = res_413921;
							asgnRefNoCycle((void**) &(*arglist).kindU.S6.Sons->data[i_413734], (*n).kindU.S6.Sons->data[i_413734]);
							res_413921 += 1;
						} LA104: ;
					}
					goto LA90;
					LA99: ;
					{
						NI LOC106;
						NI i_413775;
						NI HEX3Atmp_413923;
						NI LOC107;
						NI res_413925;
						LOC106 = 0;
						LOC106 = sonslen_189181(n_412074);
						arglist = newnodei_190803(((NU8) 150), (*n_412074).Info, (NI32)((NI32)(LOC106 - plen) + 1));
						i_413775 = 0;
						HEX3Atmp_413923 = 0;
						LOC107 = 0;
						LOC107 = sonslen_189181(n_412074);
						HEX3Atmp_413923 = (NI32)(LOC107 - plen);
						res_413925 = 0;
						while (1) {
							if (!(res_413925 <= HEX3Atmp_413923)) goto LA108;
							i_413775 = res_413925;
							asgnRefNoCycle((void**) &(*arglist).kindU.S6.Sons->data[i_413775], (*n_412074).kindU.S6.Sons->data[(NI32)((NI32)(i_413775 + plen) - 1)]);
							res_413925 += 1;
						} LA108: ;
					}
					LA90: ;
					result = bindorcheck_412636(c, (*v).kindU.S4.Sym, arglist);
					goto BeforeRet;
				}
				goto LA79;
				LA82: ;
				{
					NI LOC110;
					NI i_413830;
					NI HEX3Atmp_413927;
					NI res_413929;
					LOC110 = 0;
					LOC110 = sonslen_189181(n_412074);
					if (!((NI32)(plen - 1) == LOC110)) goto LA111;
					i_413830 = 0;
					HEX3Atmp_413927 = 0;
					HEX3Atmp_413927 = (NI32)(plen - 2);
					res_413929 = 0;
					while (1) {
						if (!(res_413929 <= HEX3Atmp_413927)) goto LA113;
						i_413830 = res_413929;
						{
							NIM_BOOL LOC116;
							LOC116 = 0;
							LOC116 = matches_412070(c, (*p).kindU.S6.Sons->data[i_413830], (*n_412074).kindU.S6.Sons->data[i_413830]);
							if (!!(LOC116)) goto LA117;
							goto BeforeRet;
						}
						LA117: ;
						res_413929 += 1;
					} LA113: ;
					arglist = newnodei_189099(((NU8) 150), (*n_412074).Info);
					result = bindorcheck_412636(c, (*v).kindU.S4.Sym, arglist);
					goto BeforeRet;
				}
				goto LA79;
				LA111: ;
				LA79: ;
			}
			LA77: ;
			{
				NI LOC121;
				NI i_413885;
				NI HEX3Atmp_413931;
				NI LOC124;
				NI res_413933;
				LOC121 = 0;
				LOC121 = sonslen_189181(n_412074);
				if (!(plen == LOC121)) goto LA122;
				i_413885 = 0;
				HEX3Atmp_413931 = 0;
				LOC124 = 0;
				LOC124 = sonslen_189181(p);
				HEX3Atmp_413931 = (NI32)(LOC124 - 1);
				res_413933 = 0;
				while (1) {
					if (!(res_413933 <= HEX3Atmp_413931)) goto LA125;
					i_413885 = res_413933;
					{
						NIM_BOOL LOC128;
						LOC128 = 0;
						LOC128 = matches_412070(c, (*p).kindU.S6.Sons->data[i_413885], (*n_412074).kindU.S6.Sons->data[i_413885]);
						if (!!(LOC128)) goto LA129;
						goto BeforeRet;
					}
					LA129: ;
					res_413933 += 1;
				} LA125: ;
				result = NIM_TRUE;
			}
			LA122: ;
		}
		break;
		}
	}
	goto LA1;
	LA64: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchrange_413948)(tpatterncontext412008* c, tnode188803* p, tnode188803* n, NI i) {
	NIM_BOOL result;
	NI j_413976;
	NI HEX3Atmp_414016;
	NI LOC1;
	NI res_414018;
	result = 0;
	j_413976 = 0;
	HEX3Atmp_414016 = 0;
	LOC1 = 0;
	LOC1 = len_189264(p);
	HEX3Atmp_414016 = LOC1 - 1;
	res_414018 = 0;
	while (1) {
		if (!(res_414018 <= HEX3Atmp_414016)) goto LA2;
		j_413976 = res_414018;
		{
			NIM_BOOL LOC5;
			LOC5 = 0;
			LOC5 = matches_412070(c, (*p).kindU.S6.Sons->data[j_413976], (*n).kindU.S6.Sons->data[(NI32)(i + j_413976)]);
			if (!!(LOC5)) goto LA6;
			{
				if (!!((*c).Mapping == 0)) goto LA10;
				genericSeqAssign(&(*c).Mapping, NIM_NIL, (&NTI188797));
			}
			LA10: ;
			result = NIM_FALSE;
			goto BeforeRet;
		}
		LA6: ;
		res_414018 += 1;
	} LA2: ;
	result = NIM_TRUE;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode188803*, matchstmtlist_413942)(tpatterncontext412008* c, tnode188803* p, tnode188803* n_413946) {
	tnode188803* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		NI LOC7;
		NI LOC8;
		tnode188803* n;
		NI i_414052;
		NI HEX3Atmp_414095;
		NI LOC11;
		NI LOC12;
		NI res_414097;
		LOC3 = 0;
		LOC4 = 0;
		LOC4 = ((*p).Kind == ((NU8) 114));
		if (!(LOC4)) goto LA5;
		LOC4 = ((*n_413946).Kind == (*p).Kind);
		LA5: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA6;
		LOC7 = 0;
		LOC7 = len_189264(p);
		LOC8 = 0;
		LOC8 = len_189264(n_413946);
		LOC3 = (LOC7 < LOC8);
		LA6: ;
		if (!LOC3) goto LA9;
		n = flattenstmts_222251(n_413946);
		i_414052 = 0;
		HEX3Atmp_414095 = 0;
		LOC11 = 0;
		LOC11 = len_189264(n);
		LOC12 = 0;
		LOC12 = len_189264(p);
		HEX3Atmp_414095 = (NI32)(LOC11 - LOC12);
		res_414097 = 0;
		while (1) {
			if (!(res_414097 <= HEX3Atmp_414095)) goto LA13;
			i_414052 = res_414097;
			{
				NIM_BOOL LOC16;
				NI LOC19;
				NI LOC20;
				NI LOC21;
				LOC16 = 0;
				LOC16 = matchrange_413948(c, p, n, i_414052);
				if (!LOC16) goto LA17;
				(*c).Submatch = NIM_TRUE;
				result = newnodei_190803(((NU8) 114), (*n).Info, 3);
				asgnRefNoCycle((void**) &(*result).kindU.S6.Sons->data[0], extractrange_222271(((NU8) 114), n, 0, (NI32)(i_414052 - 1)));
				LOC19 = 0;
				LOC19 = len_189264(p);
				asgnRefNoCycle((void**) &(*result).kindU.S6.Sons->data[1], extractrange_222271(((NU8) 114), n, i_414052, (NI32)((NI32)(i_414052 + LOC19) - 1)));
				LOC20 = 0;
				LOC20 = len_189264(p);
				LOC21 = 0;
				LOC21 = len_189264(n);
				asgnRefNoCycle((void**) &(*result).kindU.S6.Sons->data[2], extractrange_222271(((NU8) 114), n, (NI32)(i_414052 + LOC20), (NI32)(LOC21 - 1)));
				goto LA13;
			}
			LA17: ;
			res_414097 += 1;
		} LA13: ;
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC23;
		LOC23 = 0;
		LOC23 = matches_412070(c, p, n_413946);
		if (!LOC23) goto LA24;
		result = n_413946;
	}
	goto LA1;
	LA24: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, aliasanalysisrequested_414102)(tnode188803* params) {
	NIM_BOOL result;
	result = 0;
	{
		NI LOC3;
		NI i_414127;
		NI HEX3Atmp_414166;
		NI LOC6;
		NI res_414168;
		LOC3 = 0;
		LOC3 = len_189264(params);
		if (!(2 <= LOC3)) goto LA4;
		i_414127 = 0;
		HEX3Atmp_414166 = 0;
		LOC6 = 0;
		LOC6 = len_189264(params);
		HEX3Atmp_414166 = LOC6 - 1;
		res_414168 = 1;
		while (1) {
			tsym188833* param;
			if (!(res_414168 <= HEX3Atmp_414166)) goto LA7;
			i_414127 = res_414168;
			param = (*(*params).kindU.S6.Sons->data[i_414127]).kindU.S4.Sym;
			{
				NU8 LOC10;
				LOC10 = 0;
				LOC10 = whichalias_276061(param);
				if (!!((LOC10 == ((NU8) 1)))) goto LA11;
				result = NIM_TRUE;
				goto BeforeRet;
			}
			LA11: ;
			res_414168 += 1;
		} LA7: ;
	}
	LA4: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addtoarglist_414173)(tnode188803* result, tnode188803* n) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = !(((*n).Typ == NIM_NIL));
		if (!(LOC3)) goto LA4;
		LOC3 = !(((*(*n).Typ).Kind == ((NU8) 7)));
		LA4: ;
		if (!LOC3) goto LA5;
		{
			if (!!(((*n).Kind == ((NU8) 150)))) goto LA9;
			add_189390(result, n);
		}
		goto LA7;
		LA9: ;
		{
			NI i_414233;
			NI HEX3Atmp_414248;
			NI LOC12;
			NI res_414250;
			i_414233 = 0;
			HEX3Atmp_414248 = 0;
			LOC12 = 0;
			LOC12 = len_189264(n);
			HEX3Atmp_414248 = LOC12 - 1;
			res_414250 = 0;
			while (1) {
				if (!(res_414250 <= HEX3Atmp_414248)) goto LA13;
				i_414233 = res_414250;
				add_189390(result, (*n).kindU.S6.Sons->data[i_414233]);
				res_414250 += 1;
			} LA13: ;
		}
		LA7: ;
	}
	LA5: ;
}

N_NIMCALL(tnode188803*, applyrule_414255)(tcontext250019* c, tsym188833* s, tnode188803* n) {
	tnode188803* result;
	tpatterncontext412008 ctx;
	NI LOC1;
	tnode188803* m;
	tnode188803* LOC6;
	tnode188803* params;
	NIM_BOOL requiresaa;
	tnode188803* args;
	NI i_414313;
	NI HEX3Atmp_414617;
	NI LOC11;
	NI res_414619;
	result = 0;
	memset((void*)&ctx, 0, sizeof(ctx));
	ctx.Owner = s;
	ctx.C = c;
	LOC1 = 0;
	LOC1 = sonslen_189185((*s).Typ);
	ctx.Formals = (NI32)(LOC1 - 1);
	m = matchstmtlist_413942(&ctx, (*(*s).Ast).kindU.S6.Sons->data[1], n);
	{
		if (!m == 0) goto LA4;
		result = NIM_NIL;
		goto BeforeRet;
	}
	LA4: ;
	result = newnodei_189099(((NU8) 27), (*n).Info);
	LOC6 = 0;
	LOC6 = newsymnode_190723(s, (*n).Info);
	add_189390(result, LOC6);
	params = (*(*s).Typ).N;
	requiresaa = aliasanalysisrequested_414102(params);
	args = 0;
	{
		if (!requiresaa) goto LA9;
		args = newnodei_189099(((NU8) 150), (*n).Info);
	}
	LA9: ;
	i_414313 = 0;
	HEX3Atmp_414617 = 0;
	LOC11 = 0;
	LOC11 = len_189264(params);
	HEX3Atmp_414617 = LOC11 - 1;
	res_414619 = 1;
	while (1) {
		tsym188833* param;
		tnode188803* x;
		if (!(res_414619 <= HEX3Atmp_414617)) goto LA12;
		i_414313 = res_414619;
		param = (*(*params).kindU.S6.Sons->data[i_414313]).kindU.S4.Sym;
		x = getlazy_412018(&ctx, param);
		{
			if (!x == 0) goto LA15;
			result = NIM_NIL;
			goto BeforeRet;
		}
		LA15: ;
		add_189390(result, x);
		{
			if (!requiresaa) goto LA19;
			addtoarglist_414173(args, n);
		}
		LA19: ;
		res_414619 += 1;
	} LA12: ;
	{
		NI i_414377;
		NI HEX3Atmp_414633;
		NI LOC25;
		NI res_414635;
		if (!requiresaa) goto LA23;
		i_414377 = 0;
		HEX3Atmp_414633 = 0;
		LOC25 = 0;
		LOC25 = len_189264(params);
		HEX3Atmp_414633 = LOC25 - 1;
		res_414635 = 1;
		while (1) {
			tnode188803* rs;
			tsym188833* param;
			NU8 LOC27;
			if (!(res_414635 <= HEX3Atmp_414633)) goto LA26;
			i_414377 = res_414635;
			rs = (*result).kindU.S6.Sons->data[i_414377];
			param = (*(*params).kindU.S6.Sons->data[i_414377]).kindU.S4.Sym;
			LOC27 = 0;
			LOC27 = whichalias_276061(param);
			switch (LOC27) {
			case ((NU8) 1):
			{
			}
			break;
			case ((NU8) 2):
			{
				NIM_BOOL ok;
				tnode188803* arg_414423;
				NI i_414622;
				NI HEX3Atmp_414624;
				NI LOC30;
				NI res_414626;
				ok = NIM_FALSE;
				arg_414423 = 0;
				i_414622 = 0;
				HEX3Atmp_414624 = 0;
				LOC30 = 0;
				LOC30 = len_189264(args);
				HEX3Atmp_414624 = LOC30 - 1;
				res_414626 = 0;
				while (1) {
					if (!(res_414626 <= HEX3Atmp_414624)) goto LA31;
					i_414622 = res_414626;
					arg_414423 = (*args).kindU.S6.Sons->data[i_414622];
					{
						NIM_BOOL LOC34;
						NU8 LOC36;
						LOC34 = 0;
						LOC34 = !((arg_414423 == rs));
						if (!(LOC34)) goto LA35;
						LOC36 = 0;
						LOC36 = ispartof_411388(rs, arg_414423);
						LOC34 = (LOC36 == ((NU8) 2));
						LA35: ;
						if (!LOC34) goto LA37;
						ok = NIM_TRUE;
						goto LA31;
					}
					LA37: ;
					res_414626 += 1;
				} LA31: ;
				{
					if (!!(ok)) goto LA41;
					result = NIM_NIL;
					goto BeforeRet;
				}
				LA41: ;
			}
			break;
			case ((NU8) 3):
			{
				NIM_BOOL ok;
				tnode188803* arg_414450;
				NI i_414628;
				NI HEX3Atmp_414630;
				NI LOC44;
				NI res_414632;
				ok = NIM_TRUE;
				arg_414450 = 0;
				i_414628 = 0;
				HEX3Atmp_414630 = 0;
				LOC44 = 0;
				LOC44 = len_189264(args);
				HEX3Atmp_414630 = LOC44 - 1;
				res_414632 = 0;
				while (1) {
					if (!(res_414632 <= HEX3Atmp_414630)) goto LA45;
					i_414628 = res_414632;
					arg_414450 = (*args).kindU.S6.Sons->data[i_414628];
					{
						NIM_BOOL LOC48;
						NU8 LOC50;
						LOC48 = 0;
						LOC48 = !((arg_414450 == rs));
						if (!(LOC48)) goto LA49;
						LOC50 = 0;
						LOC50 = ispartof_411388(rs, arg_414450);
						LOC48 = !((LOC50 == ((NU8) 0)));
						LA49: ;
						if (!LOC48) goto LA51;
						ok = NIM_FALSE;
						goto LA45;
					}
					LA51: ;
					res_414632 += 1;
				} LA45: ;
				{
					if (!!(ok)) goto LA55;
					result = NIM_NIL;
					goto BeforeRet;
				}
				LA55: ;
			}
			break;
			}
			res_414635 += 1;
		} LA26: ;
	}
	LA23: ;
	markused_345244(n, s);
	{
		if (!ctx.Submatch) goto LA59;
		asgnRefNoCycle((void**) &(*m).kindU.S6.Sons->data[1], result);
		result = m;
	}
	LA59: ;
	BeforeRet: ;
	return result;
}
N_NOINLINE(void, patternsInit)(void) {
}

N_NOINLINE(void, patternsDatInit)(void) {
static TNimNode* TMP2871[2];
static TNimNode TMP930[3];
NTI412978.size = sizeof(TY412978);
NTI412978.kind = 18;
NTI412978.base = 0;
NTI412978.flags = 2;
TMP2871[0] = &TMP930[1];
TMP930[1].kind = 1;
TMP930[1].offset = offsetof(TY412978, HEX3Astate412981);
TMP930[1].typ = (&NTI353715);
TMP930[1].name = ":state412981";
TMP2871[1] = &TMP930[2];
TMP930[2].kind = 1;
TMP930[2].offset = offsetof(TY412978, P412722);
TMP930[2].typ = (&NTI188795);
TMP930[2].name = "p412722";
TMP930[0].len = 2; TMP930[0].kind = 2; TMP930[0].sons = &TMP2871[0];
NTI412978.node = &TMP930[0];
NTI412986.size = sizeof(TY412978*);
NTI412986.kind = 22;
NTI412986.base = (&NTI412978);
NTI412986.flags = 2;
NTI412986.marker = TMP2872;
}

