/* Generated by Nim Compiler v0.10.2 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>
typedef struct tnode224816 tnode224816;
typedef struct tcontext289021 tcontext289021;
typedef struct tsym224846 tsym224846;
typedef struct tpatterncontext478013 tpatterncontext478013;
typedef struct tnodeseq224810 tnodeseq224810;
typedef struct TGenericSeq TGenericSeq;
typedef struct ttype224852 ttype224852;
typedef struct tidobj199015 tidobj199015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq224848 ttypeseq224848;
typedef struct tloc224830 tloc224830;
typedef struct trope176009 trope176009;
typedef struct tscope224840 tscope224840;
typedef struct TY224947 TY224947;
typedef struct tinstantiation224836 tinstantiation224836;
typedef struct tstrtable224820 tstrtable224820;
typedef struct tsymseq224818 tsymseq224818;
typedef struct tident199021 tident199021;
typedef struct tlineinfo194539 tlineinfo194539;
typedef struct tlib224834 tlib224834;
typedef struct NimStringDesc NimStringDesc;
typedef struct tcell44935 tcell44935;
typedef struct tcellseq44951 tcellseq44951;
typedef struct tgcheap47016 tgcheap47016;
typedef struct tcellset44947 tcellset44947;
typedef struct tpagedesc44943 tpagedesc44943;
typedef struct tmemregion27210 tmemregion27210;
typedef struct tsmallchunk26440 tsmallchunk26440;
typedef struct tllchunk27204 tllchunk27204;
typedef struct tbigchunk26442 tbigchunk26442;
typedef struct tintset26417 tintset26417;
typedef struct ttrunk26413 ttrunk26413;
typedef struct tavlnode27208 tavlnode27208;
typedef struct tgcstat47014 tgcstat47014;
typedef struct TY479062 TY479062;
typedef struct tpasscontext285005 tpasscontext285005;
typedef struct tproccon289011 tproccon289011;
typedef struct intset221056 intset221056;
typedef struct ttrunk221052 ttrunk221052;
typedef struct ttrunkseq221054 ttrunkseq221054;
typedef struct tlinkedlist126028 tlinkedlist126028;
typedef struct tlistentry126022 tlistentry126022;
typedef struct tidtable224864 tidtable224864;
typedef struct tidpairseq224862 tidpairseq224862;
typedef struct tidpair224860 tidpair224860;
typedef struct tctx288048 tctx288048;
typedef struct TY289133 TY289133;
typedef struct tinstantiationpair289013 tinstantiationpair289013;
typedef struct TY224936 TY224936;
typedef struct tbasechunk26438 tbasechunk26438;
typedef struct tfreecell26430 tfreecell26430;
typedef struct TY288250 TY288250;
typedef struct TY195414 TY195414;
typedef struct pprocHEX3Aobjecttype288230 pprocHEX3Aobjecttype288230;
typedef struct TY288269 TY288269;
typedef struct TY288270 TY288270;
typedef struct vmargs288042 vmargs288042;
typedef struct TY288231 TY288231;
typedef struct tblock288030 tblock288030;
typedef struct TY288211 TY288211;
typedef struct TY288237 TY288237;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tpatterncontext478013  {
tsym224846* Owner;
tnodeseq224810* Mapping;
NI Formals;
tcontext289021* C;
NIM_BOOL Submatch;
};
typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3094) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3089 marker;
TY3094 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj199015  {
  TNimObject Sup;
NI Id;
};
struct  tloc224830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype224852* T;
trope176009* R;
trope176009* Heaproot;
};
struct  ttype224852  {
  tidobj199015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq224848* Sons;
tnode224816* N;
tsym224846* Owner;
tsym224846* Sym;
tsym224846* Destructor;
tsym224846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc224830 Loc;
};
struct  tstrtable224820  {
NI Counter;
tsymseq224818* Data;
};
struct  tlineinfo194539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tsym224846  {
  tidobj199015 Sup;
NU8 Kind;
union {
struct {ttypeseq224848* Typeinstcache;
tscope224840* Typscope;
} S1;
struct {TY224947* Procinstcache;
tscope224840* Scope;
} S2;
struct {TY224947* Usedgenerics;
tstrtable224820 Tab;
} S3;
struct {tsym224846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype224852* Typ;
tident199021* Name;
tlineinfo194539 Info;
tsym224846* Owner;
NU32 Flags;
tnode224816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc224830 Loc;
tlib224834* Annex;
tnode224816* Constraint;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tnode224816  {
ttype224852* Typ;
tlineinfo194539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym224846* Sym;
} S4;
struct {tident199021* Ident;
} S5;
struct {tnodeseq224810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  tident199021  {
  tidobj199015 Sup;
NimStringDesc* S;
tident199021* Next;
NI H;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tcell44935  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44951  {
NI Len;
NI Cap;
tcell44935** D;
};
struct  tcellset44947  {
NI Counter;
NI Max;
tpagedesc44943* Head;
tpagedesc44943** Data;
};
typedef tsmallchunk26440* TY27222[512];
typedef ttrunk26413* ttrunkbuckets26415[256];
struct  tintset26417  {
ttrunkbuckets26415 Data;
};
struct  tmemregion27210  {
NI Minlargeobj;
NI Maxlargeobj;
TY27222 Freesmallchunks;
tllchunk27204* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26442* Freechunkslist;
tintset26417 Chunkstarts;
tavlnode27208* Root;
tavlnode27208* Deleted;
tavlnode27208* Last;
tavlnode27208* Freeavlnodes;
};
struct  tgcstat47014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap47016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44951 Zct;
tcellseq44951 Decstack;
tcellset44947 Cycleroots;
tcellseq44951 Tempstack;
NI Recgclock;
tmemregion27210 Region;
tgcstat47014 Stat;
};
struct  TY479062  {
NI HEX3Astate;
tnode224816* P478805;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (tpatterncontext478013* c, tnode224816* op, tnode224816* n_478813, tnode224816* arglist, NIM_BOOL rpn, void* ClEnv);
void* ClEnv;
} TY478810;
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3069) (tpatterncontext478013* c, tnode224816* op, tnode224816* n_478813, tnode224816* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3070) (tpatterncontext478013* c, tnode224816* op, tnode224816* n_478813, tnode224816* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3071) (tpatterncontext478013* c, tnode224816* op, tnode224816* n_478813, tnode224816* arglist, NIM_BOOL rpn);
struct  tpasscontext285005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  intset221056  {
NI Counter;
NI Max;
ttrunk221052* Head;
ttrunkseq221054* Data;
};
struct  tlinkedlist126028  {
tlistentry126022* Head;
tlistentry126022* Tail;
NI Counter;
};
struct  tidpair224860  {
tidobj199015* Key;
TNimObject* Val;
};
struct  tidtable224864  {
NI Counter;
tidpairseq224862* Data;
};
typedef N_NIMCALL_PTR(tnode224816*, TY289064) (tcontext289021* c, tnode224816* n);
typedef N_NIMCALL_PTR(tnode224816*, TY289069) (tcontext289021* c, tnode224816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode224816*, TY289077) (tcontext289021* c, tnode224816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode224816*, TY289085) (tcontext289021* c, tnode224816* n);
typedef N_NIMCALL_PTR(tnode224816*, TY289090) (tcontext289021* c, tnode224816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode224816*, TY289098) (tcontext289021* c, tnode224816* n);
typedef N_NIMCALL_PTR(tnode224816*, TY289103) (tcontext289021* c, tnode224816* n, tnode224816* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype224852*, TY289110) (tcontext289021* c, tnode224816* n, ttype224852* prev);
typedef struct {
N_NIMCALL_PTR(tnode224816*, ClPrc) (tcontext289021* c, tidtable224864 pt, tnode224816* n, void* ClEnv);
void* ClEnv;
} TY289116;
typedef struct {
N_NIMCALL_PTR(tsym224846*, ClPrc) (tcontext289021* c, tsym224846* fn, tidtable224864 pt, tlineinfo194539 info, void* ClEnv);
void* ClEnv;
} TY289122;
struct  tinstantiationpair289013  {
tsym224846* Genericsym;
tinstantiation224836* Inst;
};
typedef N_NIMCALL_PTR(tsym224846*, TY289138) (tcontext289021* c, tsym224846* dc, ttype224852* t, tlineinfo194539 info);
struct  tcontext289021  {
  tpasscontext285005 Sup;
tsym224846* Module;
tscope224840* Currentscope;
tscope224840* Importtable;
tscope224840* Toplevelscope;
tproccon289011* P;
tsymseq224818* Friendmodules;
NI Instcounter;
intset221056 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq224818* Converters;
tsymseq224818* Patterns;
tlinkedlist126028 Optionstack;
tidtable224864 Symmapping;
tlinkedlist126028 Libs;
TY289064 Semconstexpr;
TY289069 Semexpr;
TY289077 Semtryexpr;
TY289085 Semtryconstexpr;
TY289090 Semoperand;
TY289098 Semconstboolexpr;
TY289103 Semoverloadedcall;
TY289110 Semtypenode;
TY289116 Seminferredlambda;
TY289122 Semgenerateinstance;
intset221056 Includedfiles;
tstrtable224820 Userpragmas;
tctx288048* Evalcontext;
intset221056 Unknownidents;
TY289133* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
NI Inparallelstmt;
TY289138 Instdeepcopy;
};
struct  trope176009  {
  TNimObject Sup;
trope176009* Left;
trope176009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tscope224840  {
NI Depthlevel;
tstrtable224820 Symbols;
tnodeseq224810* Usingsyms;
tscope224840* Parent;
};
struct  tinstantiation224836  {
tsym224846* Sym;
ttypeseq224848* Concretetypes;
TY224936* Usedby;
};
struct  tlistentry126022  {
  TNimObject Sup;
tlistentry126022* Prev;
tlistentry126022* Next;
};
struct  tlib224834  {
  tlistentry126022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope176009* Name;
tnode224816* Path;
};
typedef NI TY26420[16];
struct  tpagedesc44943  {
tpagedesc44943* Next;
NI Key;
TY26420 Bits;
};
struct  tbasechunk26438  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26440  {
  tbasechunk26438 Sup;
tsmallchunk26440* Next;
tsmallchunk26440* Prev;
tfreecell26430* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27204  {
NI Size;
NI Acc;
tllchunk27204* Next;
};
struct  tbigchunk26442  {
  tbasechunk26438 Sup;
tbigchunk26442* Next;
tbigchunk26442* Prev;
NI Align;
NF Data;
};
struct  ttrunk26413  {
ttrunk26413* Next;
NI Key;
TY26420 Bits;
};
typedef tavlnode27208* TY27214[2];
struct  tavlnode27208  {
TY27214 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tproccon289011  {
tsym224846* Owner;
tsym224846* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon289011* Next;
};
struct  ttrunk221052  {
ttrunk221052* Next;
NI Key;
TY26420 Bits;
};
struct  vmargs288042  {
NI Ra;
NI Rb;
NI Rc;
void* Slots;
tnode224816* Currentexception;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (vmargs288042* args, void* ClEnv);
void* ClEnv;
} vmcallback288044;
struct TY288270 {
NimStringDesc* Field0;
vmcallback288044 Field1;
};
struct  tctx288048  {
  tpasscontext285005 Sup;
TY288250* Code;
TY195414* Debug;
tnode224816* Globals;
tnode224816* Constants;
ttypeseq224848* Types;
tnode224816* Currentexceptiona;
tnode224816* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype288230* Prc;
tsym224846* Module;
tnode224816* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
tlineinfo194539 Comesfromheuristic;
TY288269* Callbacks;
NimStringDesc* Errorflag;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct  tblock288030  {
tsym224846* Label;
TY288211* Fixups;
};
struct TY288237 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY288237 TY288234[256];
struct  pprocHEX3Aobjecttype288230  {
TY288231* Blocks;
tsym224846* Sym;
TY288234 Slots;
NI Maxslots;
};
struct tnodeseq224810 {
  TGenericSeq Sup;
  tnode224816* data[SEQ_DECL_SIZE];
};
struct ttypeseq224848 {
  TGenericSeq Sup;
  ttype224852* data[SEQ_DECL_SIZE];
};
struct TY224947 {
  TGenericSeq Sup;
  tinstantiation224836* data[SEQ_DECL_SIZE];
};
struct tsymseq224818 {
  TGenericSeq Sup;
  tsym224846* data[SEQ_DECL_SIZE];
};
struct ttrunkseq221054 {
  TGenericSeq Sup;
  ttrunk221052* data[SEQ_DECL_SIZE];
};
struct tidpairseq224862 {
  TGenericSeq Sup;
  tidpair224860 data[SEQ_DECL_SIZE];
};
struct TY289133 {
  TGenericSeq Sup;
  tinstantiationpair289013 data[SEQ_DECL_SIZE];
};
struct TY224936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY288250 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY195414 {
  TGenericSeq Sup;
  tlineinfo194539 data[SEQ_DECL_SIZE];
};
struct TY288269 {
  TGenericSeq Sup;
  TY288270 data[SEQ_DECL_SIZE];
};
struct TY288211 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY288231 {
  TGenericSeq Sup;
  tblock288030 data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, sonslen_225255)(ttype224852* n);
N_NIMCALL(tnode224816*, matchstmtlist_480196)(tpatterncontext478013* c, tnode224816* p, tnode224816* n_480200);
static N_INLINE(NI, len_225364)(tnode224816* n);
N_NIMCALL(tnode224816*, flattenstmts_261416)(tnode224816* n);
N_NIMCALL(NIM_BOOL, matchrange_480202)(tpatterncontext478013* c, tnode224816* p, tnode224816* n, NI i);
N_NIMCALL(NIM_BOOL, matches_478085)(tpatterncontext478013* c, tnode224816* p, tnode224816* n_478089);
static N_INLINE(NIM_BOOL, ispatternparam_478575)(tpatterncontext478013* c, tnode224816* p);
N_NIMCALL(NIM_BOOL, bindorcheck_478711)(tpatterncontext478013* c, tsym224846* param, tnode224816* n);
N_NIMCALL(tnode224816*, getlazy_478025)(tpatterncontext478013* c, tsym224846* sym);
N_NIMCALL(NIM_BOOL, sametrees_478132)(tnode224816* a, tnode224816* b);
static N_INLINE(NIM_BOOL, samekinds_478103)(tnode224816* a, tnode224816* b);
N_NIMCALL(NU8, canonkind_478093)(tnode224816* n);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NIM_BOOL, sametypeornil_267367)(ttype224852* a, ttype224852* b, NU8 flags);
static N_INLINE(NI, sonslen_225249)(tnode224816* n);
N_NIMCALL(NIM_BOOL, checktypes_478521)(tpatterncontext478013* c, tsym224846* p, tnode224816* n);
N_NIMCALL(NIM_BOOL, matchnodekinds_321381)(tnode224816* p, tnode224816* n);
N_NIMCALL(NIM_BOOL, argtypematches_413484)(tcontext289021* c, ttype224852* f, ttype224852* a);
N_NIMCALL(void, putlazy_478047)(tpatterncontext478013* c, tsym224846* sym, tnode224816* 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(tcell44935*, usrtocell_48646)(void* usr);
static N_INLINE(void, rtladdzct_50204)(tcell44935* c);
N_NOINLINE(void, addzct_48617)(tcellseq44951* s, tcell44935* c);
N_NIMCALL(NIM_BOOL, insymchoice_478355)(tnode224816* sc, tnode224816* x);
N_NIMCALL(NIM_BOOL, matchchoice_478648)(tpatterncontext478013* c, tnode224816* p, tnode224816* n);
N_NIMCALL(NIM_BOOL, matchnested_478802)(tpatterncontext478013* c, tnode224816* p, tnode224816* n, NIM_BOOL rpn);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP3068)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(tnode224816*, newnodei_225138)(NU8 kind, tlineinfo194539 info);
N_CLOSURE(NIM_BOOL, matchstaraux_478809)(tpatterncontext478013* c, tnode224816* op, tnode224816* n_478813, tnode224816* arglist, NIM_BOOL rpn, void* ClEnv);
static N_INLINE(tnode224816*, HEX5BHEX5D_225698)(tnode224816* n, NI i);
N_NIMCALL(void, add_225498)(tnode224816* father, tnode224816* son);
N_NIMCALL(void, internalerror_196987)(tlineinfo194539 info, NimStringDesc* errmsg);
N_NIMCALL(void, gather_478750)(tpatterncontext478013* c, tsym224846* param, tnode224816* n);
N_NIMCALL(tnode224816*, newnodei_227007)(NU8 kind, tlineinfo194539 info, NI children);
static N_INLINE(tnode224816*, lastson_225261)(tnode224816* n);
N_NIMCALL(void, genericSeqAssign)(void* dest, void* src_79604, TNimType* mt);
N_NIMCALL(tnode224816*, extractrange_261440)(NU8 k, tnode224816* n, NI a, NI b);
N_NIMCALL(tnode224816*, newsymnode_226755)(tsym224846* sym, tlineinfo194539 info);
N_NIMCALL(NIM_BOOL, aliasanalysisrequested_480382)(tnode224816* params);
N_NIMCALL(NU8, whichalias_320080)(tsym224846* p);
N_NIMCALL(void, addtoarglist_480467)(tnode224816* result, tnode224816* n);
N_NIMCALL(NU8, ispartof_477430)(tnode224816* a, tnode224816* b);
N_NIMCALL(void, markused_404251)(tlineinfo194539 info, tsym224846* s);
STRING_LITERAL(TMP3063, "|", 1);
STRING_LITERAL(TMP3064, "*", 1);
STRING_LITERAL(TMP3065, "**", 2);
STRING_LITERAL(TMP3066, "~", 1);
STRING_LITERAL(TMP3072, "invalid pattern", 15);
extern TNimType NTI224810; /* TNodeSeq */
extern tgcheap47016 gch_47044;
TNimType NTI479062; /* object */
extern TNimType NTI356033; /* range -1..0(int) */
extern TNimType NTI224808; /* PNode */
TNimType NTI479090; /* ref object */

static N_INLINE(NI, sonslen_225255)(ttype224852* 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_225364)(tnode224816* 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_478575)(tpatterncontext478013* c, tnode224816* 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(tnode224816*, getlazy_478025)(tpatterncontext478013* c, tsym224846* sym) {
	tnode224816* result;
	result = 0;
	{
		if (!!((*c).Mapping == 0)) goto LA3;
		result = (*c).Mapping->data[(*sym).Position];
	}
	LA3: ;
	return result;
}

N_NIMCALL(NU8, canonkind_478093)(tnode224816* 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_478103)(tnode224816* a, tnode224816* 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_478093(a);
	LOC4 = 0;
	LOC4 = canonkind_478093(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_225249)(tnode224816* 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_478132)(tnode224816* a, tnode224816* b) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = samekinds_478103(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_267367((*a).Typ, (*b).Typ, 0);
		}
		break;
		default:
		{
			{
				NI LOC16;
				NI LOC17;
				LOC16 = 0;
				LOC16 = sonslen_225249(a);
				LOC17 = 0;
				LOC17 = sonslen_225249(b);
				if (!(LOC16 == LOC17)) goto LA18;
				{
					NI i_478305;
					NI HEX3Atmp_478335;
					NI LOC21;
					NI res_478338;
					i_478305 = 0;
					HEX3Atmp_478335 = 0;
					LOC21 = 0;
					LOC21 = sonslen_225249(a);
					HEX3Atmp_478335 = (NI32)(LOC21 - 1);
					res_478338 = 0;
					{
						while (1) {
							if (!(res_478338 <= HEX3Atmp_478335)) goto LA23;
							i_478305 = res_478338;
							{
								NIM_BOOL LOC26;
								LOC26 = 0;
								LOC26 = sametrees_478132((*a).kindU.S6.Sons->data[i_478305], (*b).kindU.S6.Sons->data[i_478305]);
								if (!!(LOC26)) goto LA27;
								goto BeforeRet;
							}
							LA27: ;
							res_478338 += 1;
						} LA23: ;
					}
				}
				result = NIM_TRUE;
			}
			LA18: ;
		}
		break;
		}
	}
	LA4: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, checktypes_478521)(tpatterncontext478013* c, tsym224846* p, tnode224816* n) {
	NIM_BOOL result;
	result = 0;
	{
		if (!!(((*p).Constraint == NIM_NIL))) goto LA3;
		result = matchnodekinds_321381((*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_413484((*c).C, (*p).Typ, (*n).Typ);
	}
	LA9: ;
	BeforeRet: ;
	return result;
}

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

static N_INLINE(void, rtladdzct_50204)(tcell44935* c) {
	addzct_48617((&gch_47044.Zct), c);
}

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

N_NIMCALL(void, putlazy_478047)(tpatterncontext478013* c, tsym224846* sym, tnode224816* n) {
	{
		if (!(*c).Mapping == 0) goto LA3;
		unsureAsgnRef((void**) (&(*c).Mapping), (tnodeseq224810*) newSeq((&NTI224810), (*c).Formals));
	}
	LA3: ;
	asgnRefNoCycle((void**) (&(*c).Mapping->data[(*sym).Position]), n);
}

N_NIMCALL(NIM_BOOL, bindorcheck_478711)(tpatterncontext478013* c, tsym224846* param, tnode224816* n) {
	NIM_BOOL result;
	tnode224816* pp;
	result = 0;
	pp = getlazy_478025(c, param);
	{
		if (!!((pp == NIM_NIL))) goto LA3;
		result = sametrees_478132(pp, n);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = ((*n).Kind == ((NU8) 151));
		if (LOC6) goto LA7;
		LOC6 = checktypes_478521(c, param, n);
		LA7: ;
		if (!LOC6) goto LA8;
		putlazy_478047(c, param, n);
		result = NIM_TRUE;
	}
	goto LA1;
	LA8: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, insymchoice_478355)(tnode224816* sc, tnode224816* x) {
	NIM_BOOL result;
	result = 0;
	{
		if (!((*sc).Kind == ((NU8) 56))) goto LA3;
		{
			NI i_478390;
			NI HEX3Atmp_478501;
			NI LOC6;
			NI res_478504;
			i_478390 = 0;
			HEX3Atmp_478501 = 0;
			LOC6 = 0;
			LOC6 = len_225364(sc);
			HEX3Atmp_478501 = (LOC6 - 1);
			res_478504 = 0;
			{
				while (1) {
					if (!(res_478504 <= HEX3Atmp_478501)) goto LA8;
					i_478390 = res_478504;
					{
						if (!((*(*sc).kindU.S6.Sons->data[i_478390]).kindU.S4.Sym == (*x).kindU.S4.Sym)) goto LA11;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA11: ;
					res_478504 += 1;
				} LA8: ;
			}
		}
	}
	goto LA1;
	LA3: ;
	{
		if (!((*sc).Kind == ((NU8) 57))) goto LA14;
		result = ((*(*(*(*sc).kindU.S6.Sons->data[0]).kindU.S4.Sym).Name).Sup.Id == (*(*(*x).kindU.S4.Sym).Name).Sup.Id);
	}
	goto LA1;
	LA14: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchchoice_478648)(tpatterncontext478013* c, tnode224816* p, tnode224816* n) {
	NIM_BOOL result;
	result = 0;
	{
		NI i_478675;
		NI HEX3Atmp_478691;
		NI LOC2;
		NI res_478694;
		i_478675 = 0;
		HEX3Atmp_478691 = 0;
		LOC2 = 0;
		LOC2 = len_225364(p);
		HEX3Atmp_478691 = (LOC2 - 1);
		res_478694 = 1;
		{
			while (1) {
				if (!(res_478694 <= HEX3Atmp_478691)) goto LA4;
				i_478675 = res_478694;
				{
					NIM_BOOL LOC7;
					LOC7 = 0;
					LOC7 = matches_478085(c, (*p).kindU.S6.Sons->data[i_478675], n);
					if (!LOC7) goto LA8;
					result = NIM_TRUE;
					goto BeforeRet;
				}
				LA8: ;
				res_478694 += 1;
			} LA4: ;
		}
	}
	BeforeRet: ;
	return result;
}
N_NIMCALL(void, TMP3068)(void* p, NI op) {
	TY479062* a;
	a = (TY479062*)p;
	nimGCvisit((void*)(*a).P478805, op);
}

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

N_CLOSURE(NIM_BOOL, matchstaraux_478809)(tpatterncontext478013* c, tnode224816* op, tnode224816* n_478813, tnode224816* arglist, NIM_BOOL rpn, void* ClEnv) {
	NIM_BOOL result;
	TY479062* HEX3Aenvp_479086;
	result = 0;
	HEX3Aenvp_479086 = (TY479062*) ClEnv;
	result = NIM_TRUE;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((*n_478813).Kind == ((NU8) 27) || (*n_478813).Kind == ((NU8) 29) || (*n_478813).Kind == ((NU8) 30) || (*n_478813).Kind == ((NU8) 31) || (*n_478813).Kind == ((NU8) 26) || (*n_478813).Kind == ((NU8) 28) || (*n_478813).Kind == ((NU8) 32));
		if (!(LOC3)) goto LA4;
		LOC3 = matches_478085(c, (*op).kindU.S6.Sons->data[1], (*n_478813).kindU.S6.Sons->data[0]);
		LA4: ;
		if (!LOC3) goto LA5;
		{
			NI i_478868;
			NI HEX3Atmp_478981;
			NI LOC8;
			NI res_478984;
			i_478868 = 0;
			HEX3Atmp_478981 = 0;
			LOC8 = 0;
			LOC8 = sonslen_225249(n_478813);
			HEX3Atmp_478981 = (NI32)(LOC8 - 1);
			res_478984 = 1;
			{
				while (1) {
					if (!(res_478984 <= HEX3Atmp_478981)) goto LA10;
					i_478868 = res_478984;
					{
						TY478810 LOC13;
						tnode224816* LOC14;
						NIM_BOOL LOC15;
						memset((void*)(&LOC13), 0, sizeof(LOC13));
						LOC13.ClPrc = matchstaraux_478809; LOC13.ClEnv = HEX3Aenvp_479086;
						LOC14 = 0;
						LOC14 = HEX5BHEX5D_225698(n_478813, i_478868);
						LOC15 = 0;
						LOC15 = LOC13.ClEnv? LOC13.ClPrc(c, op, LOC14, arglist, rpn, LOC13.ClEnv):((TMP3069)(LOC13.ClPrc))(c, op, LOC14, arglist, rpn);
						if (!!(LOC15)) goto LA16;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA16: ;
					res_478984 += 1;
				} LA10: ;
			}
		}
		{
			if (!rpn) goto LA20;
			add_225498(arglist, (*n_478813).kindU.S6.Sons->data[0]);
		}
		LA20: ;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC23;
		tnode224816* n;
		LOC23 = 0;
		LOC23 = ((*n_478813).Kind == ((NU8) 58));
		if (!(LOC23)) goto LA24;
		LOC23 = ((*(*n_478813).kindU.S6.Sons->data[1]).Kind == ((NU8) 41));
		LA24: ;
		if (!LOC23) goto LA25;
		n = (*n_478813).kindU.S6.Sons->data[1];
		{
			NI i_478951;
			NI HEX3Atmp_478987;
			NI LOC28;
			NI res_478990;
			i_478951 = 0;
			HEX3Atmp_478987 = 0;
			LOC28 = 0;
			LOC28 = len_225364(n);
			HEX3Atmp_478987 = (LOC28 - 1);
			res_478990 = 0;
			{
				while (1) {
					if (!(res_478990 <= HEX3Atmp_478987)) goto LA30;
					i_478951 = res_478990;
					{
						TY478810 LOC33;
						tnode224816* LOC34;
						NIM_BOOL LOC35;
						memset((void*)(&LOC33), 0, sizeof(LOC33));
						LOC33.ClPrc = matchstaraux_478809; LOC33.ClEnv = HEX3Aenvp_479086;
						LOC34 = 0;
						LOC34 = HEX5BHEX5D_225698(n, i_478951);
						LOC35 = 0;
						LOC35 = LOC33.ClEnv? LOC33.ClPrc(c, op, LOC34, arglist, rpn, LOC33.ClEnv):((TMP3070)(LOC33.ClPrc))(c, op, LOC34, arglist, rpn);
						if (!!(LOC35)) goto LA36;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA36: ;
					res_478990 += 1;
				} LA30: ;
			}
		}
	}
	goto LA1;
	LA25: ;
	{
		NIM_BOOL LOC39;
		LOC39 = 0;
		LOC39 = checktypes_478521(c, (*(*(*HEX3Aenvp_479086).P478805).kindU.S6.Sons->data[2]).kindU.S4.Sym, n_478813);
		if (!LOC39) goto LA40;
		add_225498(arglist, n_478813);
	}
	goto LA1;
	LA40: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchnested_478802)(tpatterncontext478013* c, tnode224816* p, tnode224816* n, NIM_BOOL rpn) {
	NIM_BOOL result;
	TY479062* HEX3Aenv_479089;
	result = 0;
	HEX3Aenv_479089 = 0;
	HEX3Aenv_479089 = (TY479062*) newObj((&NTI479090), sizeof(TY479062));
	asgnRefNoCycle((void**) (&(*HEX3Aenv_479089).P478805), 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;
		tnode224816* arglist;
		LOC7 = 0;
		LOC7 = matches_478085(c, (*(*HEX3Aenv_479089).P478805).kindU.S6.Sons->data[1], (*n).kindU.S6.Sons->data[0]);
		if (!LOC7) goto LA8;
		arglist = newnodei_225138(((NU8) 151), (*n).Info);
		{
			TY478810 LOC12;
			NIM_BOOL LOC13;
			memset((void*)(&LOC12), 0, sizeof(LOC12));
			LOC12.ClPrc = matchstaraux_478809; LOC12.ClEnv = HEX3Aenv_479089;
			LOC13 = 0;
			LOC13 = LOC12.ClEnv? LOC12.ClPrc(c, (*HEX3Aenv_479089).P478805, n, arglist, rpn, LOC12.ClEnv):((TMP3071)(LOC12.ClPrc))(c, (*HEX3Aenv_479089).P478805, n, arglist, rpn);
			if (!LOC13) goto LA14;
			result = bindorcheck_478711(c, (*(*(*HEX3Aenv_479089).P478805).kindU.S6.Sons->data[2]).kindU.S4.Sym, arglist);
		}
		LA14: ;
	}
	LA8: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, gather_478750)(tpatterncontext478013* c, tsym224846* param, tnode224816* n) {
	tnode224816* pp;
	pp = getlazy_478025(c, param);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = !((pp == NIM_NIL));
		if (!(LOC3)) goto LA4;
		LOC3 = ((*pp).Kind == ((NU8) 151));
		LA4: ;
		if (!LOC3) goto LA5;
		add_225498(pp, n);
	}
	goto LA1;
	LA5: ;
	{
		pp = newnodei_227007(((NU8) 151), (*n).Info, 1);
		asgnRefNoCycle((void**) (&(*pp).kindU.S6.Sons->data[0]), n);
		putlazy_478047(c, param, pp);
	}
	LA1: ;
}

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

N_NIMCALL(NIM_BOOL, matches_478085)(tpatterncontext478013* c, tnode224816* p, tnode224816* n_478089) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ispatternparam_478575(c, p);
		if (!LOC3) goto LA4;
		result = bindorcheck_478711(c, (*p).kindU.S4.Sym, n_478089);
	}
	goto LA1;
	LA4: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = ((*n_478089).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_478089).kindU.S4.Sym).Name).Sup.Id);
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC12;
		LOC12 = 0;
		LOC12 = ((*n_478089).Kind == ((NU8) 3));
		if (!(LOC12)) goto LA13;
		LOC12 = insymchoice_478355(p, n_478089);
		LA13: ;
		if (!LOC12) goto LA14;
		result = NIM_TRUE;
	}
	goto LA1;
	LA14: ;
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = ((*n_478089).Kind == ((NU8) 3));
		if (!(LOC17)) goto LA18;
		LOC17 = ((*(*n_478089).kindU.S4.Sym).Kind == ((NU8) 10));
		LA18: ;
		if (!LOC17) goto LA19;
		{
			if (!((*p).Kind == ((NU8) 3))) goto LA23;
			result = ((*p).kindU.S4.Sym == (*n_478089).kindU.S4.Sym);
		}
		goto LA21;
		LA23: ;
		{
			NIM_BOOL LOC26;
			LOC26 = 0;
			LOC26 = matches_478085(c, p, (*(*n_478089).kindU.S4.Sym).Ast);
			if (!LOC26) goto LA27;
			result = NIM_TRUE;
		}
		goto LA21;
		LA27: ;
		LA21: ;
	}
	goto LA1;
	LA19: ;
	{
		NimStringDesc* opr;
		if (!((*p).Kind == ((NU8) 152))) goto LA30;
		opr = (*(*(*p).kindU.S6.Sons->data[0]).kindU.S5.Ident).S;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3063))) goto LA32;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3064))) goto LA33;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3065))) goto LA34;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3066))) goto LA35;
		goto LA36;
		LA32: ;
		{
			result = matchchoice_478648(c, p, n_478089);
		}
		goto LA37;
		LA33: ;
		{
			result = matchnested_478802(c, p, n_478089, NIM_FALSE);
		}
		goto LA37;
		LA34: ;
		{
			result = matchnested_478802(c, p, n_478089, NIM_TRUE);
		}
		goto LA37;
		LA35: ;
		{
			NIM_BOOL LOC42;
			LOC42 = 0;
			LOC42 = matches_478085(c, (*p).kindU.S6.Sons->data[1], n_478089);
			result = !(LOC42);
		}
		goto LA37;
		LA36: ;
		{
			internalerror_196987((*p).Info, ((NimStringDesc*) &TMP3072));
		}
		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_478085(c, (*p).kindU.S6.Sons->data[0], n_478089);
				if (!LOC53) goto LA54;
				gather_478750(c, (*(*(*p).kindU.S6.Sons->data[1]).kindU.S6.Sons->data[1]).kindU.S4.Sym, n_478089);
				result = NIM_TRUE;
			}
			LA54: ;
		}
		goto LA47;
		LA49: ;
		{
			{
				NIM_BOOL LOC59;
				LOC59 = 0;
				LOC59 = matches_478085(c, (*p).kindU.S6.Sons->data[0], n_478089);
				if (!LOC59) goto LA60;
				result = bindorcheck_478711(c, (*(*p).kindU.S6.Sons->data[1]).kindU.S4.Sym, n_478089);
			}
			LA60: ;
		}
		LA47: ;
	}
	goto LA1;
	LA45: ;
	{
		NIM_BOOL LOC63;
		LOC63 = 0;
		LOC63 = samekinds_478103(p, n_478089);
		if (!LOC63) goto LA64;
		switch ((*p).Kind) {
		case ((NU8) 3):
		{
			result = ((*p).kindU.S4.Sym == (*n_478089).kindU.S4.Sym);
		}
		break;
		case ((NU8) 2):
		{
			result = ((*(*p).kindU.S5.Ident).Sup.Id == (*(*n_478089).kindU.S5.Ident).Sup.Id);
		}
		break;
		case ((NU8) 5) ... ((NU8) 10):
		{
			result = ((*p).kindU.S1.Intval == (*n_478089).kindU.S1.Intval);
		}
		break;
		case ((NU8) 16) ... ((NU8) 18):
		{
			result = ((*p).kindU.S2.Floatval == (*n_478089).kindU.S2.Floatval);
		}
		break;
		case ((NU8) 20) ... ((NU8) 22):
		{
			result = eqStrings((*p).kindU.S3.Strval, (*n_478089).kindU.S3.Strval);
		}
		break;
		case ((NU8) 1):
		case ((NU8) 23):
		case ((NU8) 4):
		{
			result = NIM_TRUE;
		}
		break;
		default:
		{
			NI plen;
			tnode224816* v;
			plen = sonslen_225249(p);
			v = lastson_225261(p);
			{
				NIM_BOOL LOC75;
				tnode224816* arglist;
				LOC75 = 0;
				LOC75 = ispatternparam_478575(c, v);
				if (!(LOC75)) goto LA76;
				LOC75 = ((*(*(*v).kindU.S4.Sym).Typ).Kind == ((NU8) 48));
				LA76: ;
				if (!LOC75) goto LA77;
				arglist = 0;
				{
					NI LOC81;
					LOC81 = 0;
					LOC81 = sonslen_225249(n_478089);
					if (!(plen <= LOC81)) goto LA82;
					{
						NI i_479837;
						NI HEX3Atmp_480116;
						NI res_480119;
						i_479837 = 0;
						HEX3Atmp_480116 = 0;
						HEX3Atmp_480116 = (NI32)(plen - 2);
						res_480119 = 0;
						{
							while (1) {
								if (!(res_480119 <= HEX3Atmp_480116)) goto LA86;
								i_479837 = res_480119;
								{
									NIM_BOOL LOC89;
									LOC89 = 0;
									LOC89 = matches_478085(c, (*p).kindU.S6.Sons->data[i_479837], (*n_478089).kindU.S6.Sons->data[i_479837]);
									if (!!(LOC89)) goto LA90;
									goto BeforeRet;
								}
								LA90: ;
								res_480119 += 1;
							} LA86: ;
						}
					}
					{
						NIM_BOOL LOC94;
						NIM_BOOL LOC95;
						NI LOC96;
						tnode224816* LOC98;
						tnode224816* LOC100;
						tnode224816* n;
						tnode224816* LOC103;
						NI LOC104;
						LOC94 = 0;
						LOC95 = 0;
						LOC96 = 0;
						LOC96 = sonslen_225249(n_478089);
						LOC95 = (plen == LOC96);
						if (!(LOC95)) goto LA97;
						LOC98 = 0;
						LOC98 = lastson_225261(n_478089);
						LOC95 = ((*LOC98).Kind == ((NU8) 58));
						LA97: ;
						LOC94 = LOC95;
						if (!(LOC94)) goto LA99;
						LOC100 = 0;
						LOC100 = lastson_225261(n_478089);
						LOC94 = ((*(*LOC100).kindU.S6.Sons->data[1]).Kind == ((NU8) 41));
						LA99: ;
						if (!LOC94) goto LA101;
						LOC103 = 0;
						LOC103 = lastson_225261(n_478089);
						n = (*LOC103).kindU.S6.Sons->data[1];
						LOC104 = 0;
						LOC104 = len_225364(n);
						arglist = newnodei_227007(((NU8) 151), (*n).Info, LOC104);
						{
							NI i_479934;
							NI HEX3Atmp_480122;
							NI LOC106;
							NI res_480125;
							i_479934 = 0;
							HEX3Atmp_480122 = 0;
							LOC106 = 0;
							LOC106 = len_225364(n);
							HEX3Atmp_480122 = (LOC106 - 1);
							res_480125 = 0;
							{
								while (1) {
									if (!(res_480125 <= HEX3Atmp_480122)) goto LA108;
									i_479934 = res_480125;
									asgnRefNoCycle((void**) (&(*arglist).kindU.S6.Sons->data[i_479934]), (*n).kindU.S6.Sons->data[i_479934]);
									res_480125 += 1;
								} LA108: ;
							}
						}
					}
					goto LA92;
					LA101: ;
					{
						NI LOC110;
						LOC110 = 0;
						LOC110 = sonslen_225249(n_478089);
						arglist = newnodei_227007(((NU8) 151), (*n_478089).Info, (NI32)((NI32)(LOC110 - plen) + 1));
						{
							NI i_479975;
							NI HEX3Atmp_480128;
							NI LOC112;
							NI res_480131;
							i_479975 = 0;
							HEX3Atmp_480128 = 0;
							LOC112 = 0;
							LOC112 = sonslen_225249(n_478089);
							HEX3Atmp_480128 = (NI32)(LOC112 - plen);
							res_480131 = 0;
							{
								while (1) {
									if (!(res_480131 <= HEX3Atmp_480128)) goto LA114;
									i_479975 = res_480131;
									asgnRefNoCycle((void**) (&(*arglist).kindU.S6.Sons->data[i_479975]), (*n_478089).kindU.S6.Sons->data[(NI32)((NI32)(i_479975 + plen) - 1)]);
									res_480131 += 1;
								} LA114: ;
							}
						}
					}
					LA92: ;
					result = bindorcheck_478711(c, (*v).kindU.S4.Sym, arglist);
					goto BeforeRet;
				}
				goto LA79;
				LA82: ;
				{
					NI LOC116;
					LOC116 = 0;
					LOC116 = sonslen_225249(n_478089);
					if (!((NI32)(plen - 1) == LOC116)) goto LA117;
					{
						NI i_480030;
						NI HEX3Atmp_480134;
						NI res_480137;
						i_480030 = 0;
						HEX3Atmp_480134 = 0;
						HEX3Atmp_480134 = (NI32)(plen - 2);
						res_480137 = 0;
						{
							while (1) {
								if (!(res_480137 <= HEX3Atmp_480134)) goto LA121;
								i_480030 = res_480137;
								{
									NIM_BOOL LOC124;
									LOC124 = 0;
									LOC124 = matches_478085(c, (*p).kindU.S6.Sons->data[i_480030], (*n_478089).kindU.S6.Sons->data[i_480030]);
									if (!!(LOC124)) goto LA125;
									goto BeforeRet;
								}
								LA125: ;
								res_480137 += 1;
							} LA121: ;
						}
					}
					arglist = newnodei_225138(((NU8) 151), (*n_478089).Info);
					result = bindorcheck_478711(c, (*v).kindU.S4.Sym, arglist);
					goto BeforeRet;
				}
				goto LA79;
				LA117: ;
				LA79: ;
			}
			LA77: ;
			{
				NI LOC129;
				LOC129 = 0;
				LOC129 = sonslen_225249(n_478089);
				if (!(plen == LOC129)) goto LA130;
				{
					NI i_480085;
					NI HEX3Atmp_480140;
					NI LOC133;
					NI res_480143;
					i_480085 = 0;
					HEX3Atmp_480140 = 0;
					LOC133 = 0;
					LOC133 = sonslen_225249(p);
					HEX3Atmp_480140 = (NI32)(LOC133 - 1);
					res_480143 = 0;
					{
						while (1) {
							if (!(res_480143 <= HEX3Atmp_480140)) goto LA135;
							i_480085 = res_480143;
							{
								NIM_BOOL LOC138;
								LOC138 = 0;
								LOC138 = matches_478085(c, (*p).kindU.S6.Sons->data[i_480085], (*n_478089).kindU.S6.Sons->data[i_480085]);
								if (!!(LOC138)) goto LA139;
								goto BeforeRet;
							}
							LA139: ;
							res_480143 += 1;
						} LA135: ;
					}
				}
				result = NIM_TRUE;
			}
			LA130: ;
		}
		break;
		}
	}
	goto LA1;
	LA64: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchrange_480202)(tpatterncontext478013* c, tnode224816* p, tnode224816* n, NI i) {
	NIM_BOOL result;
	result = 0;
	{
		NI j_480230;
		NI HEX3Atmp_480271;
		NI LOC2;
		NI res_480274;
		j_480230 = 0;
		HEX3Atmp_480271 = 0;
		LOC2 = 0;
		LOC2 = len_225364(p);
		HEX3Atmp_480271 = (LOC2 - 1);
		res_480274 = 0;
		{
			while (1) {
				if (!(res_480274 <= HEX3Atmp_480271)) goto LA4;
				j_480230 = res_480274;
				{
					NIM_BOOL LOC7;
					LOC7 = 0;
					LOC7 = matches_478085(c, (*p).kindU.S6.Sons->data[j_480230], (*n).kindU.S6.Sons->data[(NI32)(i + j_480230)]);
					if (!!(LOC7)) goto LA8;
					{
						if (!!((*c).Mapping == 0)) goto LA12;
						genericSeqAssign((&(*c).Mapping), NIM_NIL, (&NTI224810));
					}
					LA12: ;
					result = NIM_FALSE;
					goto BeforeRet;
				}
				LA8: ;
				res_480274 += 1;
			} LA4: ;
		}
	}
	result = NIM_TRUE;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode224816*, matchstmtlist_480196)(tpatterncontext478013* c, tnode224816* p, tnode224816* n_480200) {
	tnode224816* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		NI LOC7;
		NI LOC8;
		tnode224816* n;
		LOC3 = 0;
		LOC4 = 0;
		LOC4 = ((*p).Kind == ((NU8) 115));
		if (!(LOC4)) goto LA5;
		LOC4 = ((*n_480200).Kind == (*p).Kind);
		LA5: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA6;
		LOC7 = 0;
		LOC7 = len_225364(p);
		LOC8 = 0;
		LOC8 = len_225364(n_480200);
		LOC3 = (LOC7 < LOC8);
		LA6: ;
		if (!LOC3) goto LA9;
		n = flattenstmts_261416(n_480200);
		{
			NI i_480306;
			NI HEX3Atmp_480350;
			NI LOC12;
			NI LOC13;
			NI res_480353;
			i_480306 = 0;
			HEX3Atmp_480350 = 0;
			LOC12 = 0;
			LOC12 = len_225364(n);
			LOC13 = 0;
			LOC13 = len_225364(p);
			HEX3Atmp_480350 = (NI32)(LOC12 - LOC13);
			res_480353 = 0;
			{
				while (1) {
					if (!(res_480353 <= HEX3Atmp_480350)) goto LA15;
					i_480306 = res_480353;
					{
						NIM_BOOL LOC18;
						NI LOC21;
						NI LOC22;
						NI LOC23;
						LOC18 = 0;
						LOC18 = matchrange_480202(c, p, n, i_480306);
						if (!LOC18) goto LA19;
						(*c).Submatch = NIM_TRUE;
						result = newnodei_227007(((NU8) 115), (*n).Info, 3);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[0]), extractrange_261440(((NU8) 115), n, 0, (NI32)(i_480306 - 1)));
						LOC21 = 0;
						LOC21 = len_225364(p);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[1]), extractrange_261440(((NU8) 115), n, i_480306, (NI32)((NI32)(i_480306 + LOC21) - 1)));
						LOC22 = 0;
						LOC22 = len_225364(p);
						LOC23 = 0;
						LOC23 = len_225364(n);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[2]), extractrange_261440(((NU8) 115), n, (NI32)(i_480306 + LOC22), (NI32)(LOC23 - 1)));
						goto LA11;
					}
					LA19: ;
					res_480353 += 1;
				} LA15: ;
			}
		} LA11: ;
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC25;
		LOC25 = 0;
		LOC25 = matches_478085(c, p, n_480200);
		if (!LOC25) goto LA26;
		result = n_480200;
	}
	goto LA1;
	LA26: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, aliasanalysisrequested_480382)(tnode224816* params) {
	NIM_BOOL result;
	result = 0;
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = len_225364(params);
		if (!(2 <= LOC3)) goto LA4;
		{
			NI i_480407;
			NI HEX3Atmp_480447;
			NI LOC7;
			NI res_480450;
			i_480407 = 0;
			HEX3Atmp_480447 = 0;
			LOC7 = 0;
			LOC7 = len_225364(params);
			HEX3Atmp_480447 = (LOC7 - 1);
			res_480450 = 1;
			{
				while (1) {
					tsym224846* param;
					if (!(res_480450 <= HEX3Atmp_480447)) goto LA9;
					i_480407 = res_480450;
					param = (*(*params).kindU.S6.Sons->data[i_480407]).kindU.S4.Sym;
					{
						NU8 LOC12;
						LOC12 = 0;
						LOC12 = whichalias_320080(param);
						if (!!((LOC12 == ((NU8) 1)))) goto LA13;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA13: ;
					res_480450 += 1;
				} LA9: ;
			}
		}
	}
	LA4: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addtoarglist_480467)(tnode224816* result, tnode224816* 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) 151)))) goto LA9;
			add_225498(result, n);
		}
		goto LA7;
		LA9: ;
		{
			{
				NI i_480527;
				NI HEX3Atmp_480543;
				NI LOC13;
				NI res_480546;
				i_480527 = 0;
				HEX3Atmp_480543 = 0;
				LOC13 = 0;
				LOC13 = len_225364(n);
				HEX3Atmp_480543 = (LOC13 - 1);
				res_480546 = 0;
				{
					while (1) {
						if (!(res_480546 <= HEX3Atmp_480543)) goto LA15;
						i_480527 = res_480546;
						add_225498(result, (*n).kindU.S6.Sons->data[i_480527]);
						res_480546 += 1;
					} LA15: ;
				}
			}
		}
		LA7: ;
	}
	LA5: ;
}

N_NIMCALL(tnode224816*, applyrule_480563)(tcontext289021* c, tsym224846* s, tnode224816* n) {
	tnode224816* result;
	tpatterncontext478013 ctx;
	NI LOC1;
	tnode224816* m;
	tnode224816* LOC6;
	tnode224816* params;
	NIM_BOOL requiresaa;
	tnode224816* args;
	result = 0;
	memset((void*)(&ctx), 0, sizeof(ctx));
	ctx.Owner = s;
	ctx.C = c;
	LOC1 = 0;
	LOC1 = sonslen_225255((*s).Typ);
	ctx.Formals = (NI32)(LOC1 - 1);
	m = matchstmtlist_480196((&ctx), (*(*s).Ast).kindU.S6.Sons->data[1], n);
	{
		if (!m == 0) goto LA4;
		result = NIM_NIL;
		goto BeforeRet;
	}
	LA4: ;
	result = newnodei_225138(((NU8) 27), (*n).Info);
	LOC6 = 0;
	LOC6 = newsymnode_226755(s, (*n).Info);
	add_225498(result, LOC6);
	params = (*(*s).Typ).N;
	requiresaa = aliasanalysisrequested_480382(params);
	args = 0;
	{
		if (!requiresaa) goto LA9;
		args = newnodei_225138(((NU8) 151), (*n).Info);
	}
	LA9: ;
	{
		NI i_480621;
		NI HEX3Atmp_480818;
		NI LOC12;
		NI res_480821;
		i_480621 = 0;
		HEX3Atmp_480818 = 0;
		LOC12 = 0;
		LOC12 = len_225364(params);
		HEX3Atmp_480818 = (LOC12 - 1);
		res_480821 = 1;
		{
			while (1) {
				tsym224846* param;
				tnode224816* x;
				if (!(res_480821 <= HEX3Atmp_480818)) goto LA14;
				i_480621 = res_480821;
				param = (*(*params).kindU.S6.Sons->data[i_480621]).kindU.S4.Sym;
				x = getlazy_478025((&ctx), param);
				{
					if (!x == 0) goto LA17;
					result = NIM_NIL;
					goto BeforeRet;
				}
				LA17: ;
				add_225498(result, x);
				{
					if (!requiresaa) goto LA21;
					addtoarglist_480467(args, x);
				}
				LA21: ;
				res_480821 += 1;
			} LA14: ;
		}
	}
	{
		if (!requiresaa) goto LA25;
		{
			NI i_480685;
			NI HEX3Atmp_480842;
			NI LOC28;
			NI res_480845;
			i_480685 = 0;
			HEX3Atmp_480842 = 0;
			LOC28 = 0;
			LOC28 = len_225364(params);
			HEX3Atmp_480842 = (LOC28 - 1);
			res_480845 = 1;
			{
				while (1) {
					tnode224816* rs;
					tsym224846* param;
					NU8 LOC31;
					if (!(res_480845 <= HEX3Atmp_480842)) goto LA30;
					i_480685 = res_480845;
					rs = (*result).kindU.S6.Sons->data[i_480685];
					param = (*(*params).kindU.S6.Sons->data[i_480685]).kindU.S4.Sym;
					LOC31 = 0;
					LOC31 = whichalias_320080(param);
					switch (LOC31) {
					case ((NU8) 1):
					{
					}
					break;
					case ((NU8) 2):
					{
						NIM_BOOL ok;
						ok = NIM_FALSE;
						{
							tnode224816* arg_480731;
							arg_480731 = 0;
							{
								NI i_480828;
								NI HEX3Atmp_480830;
								NI LOC36;
								NI res_480832;
								i_480828 = 0;
								HEX3Atmp_480830 = 0;
								LOC36 = 0;
								LOC36 = len_225364(args);
								HEX3Atmp_480830 = (LOC36 - 1);
								res_480832 = 0;
								{
									while (1) {
										if (!(res_480832 <= HEX3Atmp_480830)) goto LA38;
										i_480828 = res_480832;
										arg_480731 = (*args).kindU.S6.Sons->data[i_480828];
										{
											NIM_BOOL LOC41;
											NU8 LOC43;
											LOC41 = 0;
											LOC41 = !((arg_480731 == rs));
											if (!(LOC41)) goto LA42;
											LOC43 = 0;
											LOC43 = ispartof_477430(rs, arg_480731);
											LOC41 = (LOC43 == ((NU8) 2));
											LA42: ;
											if (!LOC41) goto LA44;
											ok = NIM_TRUE;
											goto LA34;
										}
										LA44: ;
										res_480832 += 1;
									} LA38: ;
								}
							}
						} LA34: ;
						{
							if (!!(ok)) goto LA48;
							result = NIM_NIL;
							goto BeforeRet;
						}
						LA48: ;
					}
					break;
					case ((NU8) 3):
					{
						NIM_BOOL ok;
						ok = NIM_TRUE;
						{
							tnode224816* arg_480758;
							arg_480758 = 0;
							{
								NI i_480837;
								NI HEX3Atmp_480839;
								NI LOC53;
								NI res_480841;
								i_480837 = 0;
								HEX3Atmp_480839 = 0;
								LOC53 = 0;
								LOC53 = len_225364(args);
								HEX3Atmp_480839 = (LOC53 - 1);
								res_480841 = 0;
								{
									while (1) {
										if (!(res_480841 <= HEX3Atmp_480839)) goto LA55;
										i_480837 = res_480841;
										arg_480758 = (*args).kindU.S6.Sons->data[i_480837];
										{
											NIM_BOOL LOC58;
											NU8 LOC60;
											LOC58 = 0;
											LOC58 = !((arg_480758 == rs));
											if (!(LOC58)) goto LA59;
											LOC60 = 0;
											LOC60 = ispartof_477430(rs, arg_480758);
											LOC58 = !((LOC60 == ((NU8) 0)));
											LA59: ;
											if (!LOC58) goto LA61;
											ok = NIM_FALSE;
											goto LA51;
										}
										LA61: ;
										res_480841 += 1;
									} LA55: ;
								}
							}
						} LA51: ;
						{
							if (!!(ok)) goto LA65;
							result = NIM_NIL;
							goto BeforeRet;
						}
						LA65: ;
					}
					break;
					}
					res_480845 += 1;
				} LA30: ;
			}
		}
	}
	LA25: ;
	markused_404251((*n).Info, s);
	{
		if (!ctx.Submatch) goto LA69;
		asgnRefNoCycle((void**) (&(*m).kindU.S6.Sons->data[1]), result);
		result = m;
	}
	LA69: ;
	BeforeRet: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, HEX00_patternsInit)(void) {
}

NIM_EXTERNC N_NOINLINE(void, HEX00_patternsDatInit)(void) {
static TNimNode* TMP3067[2];
static TNimNode TMP946[3];
NTI479062.size = sizeof(TY479062);
NTI479062.kind = 18;
NTI479062.base = 0;
NTI479062.flags = 2;
TMP3067[0] = &TMP946[1];
TMP946[1].kind = 1;
TMP946[1].offset = offsetof(TY479062, HEX3Astate);
TMP946[1].typ = (&NTI356033);
TMP946[1].name = ":state";
TMP3067[1] = &TMP946[2];
TMP946[2].kind = 1;
TMP946[2].offset = offsetof(TY479062, P478805);
TMP946[2].typ = (&NTI224808);
TMP946[2].name = "p478805";
TMP946[0].len = 2; TMP946[0].kind = 2; TMP946[0].sons = &TMP3067[0];
NTI479062.node = &TMP946[0];
NTI479090.size = sizeof(TY479062*);
NTI479090.kind = 22;
NTI479090.base = (&NTI479062);
NTI479090.flags = 2;
NTI479090.marker = TMP3068;
}

