/* 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 tnode225816 tnode225816;
typedef struct tcontext290021 tcontext290021;
typedef struct tsym225846 tsym225846;
typedef struct tpatterncontext479013 tpatterncontext479013;
typedef struct tnodeseq225810 tnodeseq225810;
typedef struct TGenericSeq TGenericSeq;
typedef struct ttype225852 ttype225852;
typedef struct tidobj200015 tidobj200015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq225848 ttypeseq225848;
typedef struct tloc225830 tloc225830;
typedef struct trope177009 trope177009;
typedef struct tscope225840 tscope225840;
typedef struct TY225947 TY225947;
typedef struct tinstantiation225836 tinstantiation225836;
typedef struct tstrtable225820 tstrtable225820;
typedef struct tsymseq225818 tsymseq225818;
typedef struct tident200021 tident200021;
typedef struct tlineinfo195539 tlineinfo195539;
typedef struct tlib225834 tlib225834;
typedef struct NimStringDesc NimStringDesc;
typedef struct tcell45135 tcell45135;
typedef struct tcellseq45151 tcellseq45151;
typedef struct tgcheap47216 tgcheap47216;
typedef struct tcellset45147 tcellset45147;
typedef struct tpagedesc45143 tpagedesc45143;
typedef struct tmemregion27410 tmemregion27410;
typedef struct tsmallchunk26640 tsmallchunk26640;
typedef struct tllchunk27404 tllchunk27404;
typedef struct tbigchunk26642 tbigchunk26642;
typedef struct tintset26617 tintset26617;
typedef struct ttrunk26613 ttrunk26613;
typedef struct tavlnode27408 tavlnode27408;
typedef struct tgcstat47214 tgcstat47214;
typedef struct TY480062 TY480062;
typedef struct tpasscontext286005 tpasscontext286005;
typedef struct tproccon290011 tproccon290011;
typedef struct intset222056 intset222056;
typedef struct ttrunk222052 ttrunk222052;
typedef struct ttrunkseq222054 ttrunkseq222054;
typedef struct tlinkedlist127028 tlinkedlist127028;
typedef struct tlistentry127022 tlistentry127022;
typedef struct tidtable225864 tidtable225864;
typedef struct tidpairseq225862 tidpairseq225862;
typedef struct tidpair225860 tidpair225860;
typedef struct tctx289048 tctx289048;
typedef struct TY290133 TY290133;
typedef struct tinstantiationpair290013 tinstantiationpair290013;
typedef struct TY225936 TY225936;
typedef struct tbasechunk26638 tbasechunk26638;
typedef struct tfreecell26630 tfreecell26630;
typedef struct TY289250 TY289250;
typedef struct TY196414 TY196414;
typedef struct pprocHEX3Aobjecttype289230 pprocHEX3Aobjecttype289230;
typedef struct TY289269 TY289269;
typedef struct TY289270 TY289270;
typedef struct vmargs289042 vmargs289042;
typedef struct TY289231 TY289231;
typedef struct tblock289030 tblock289030;
typedef struct TY289211 TY289211;
typedef struct TY289237 TY289237;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tpatterncontext479013  {
tsym225846* Owner;
tnodeseq225810* Mapping;
NI Formals;
tcontext290021* 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  tidobj200015  {
  TNimObject Sup;
NI Id;
};
struct  tloc225830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype225852* T;
trope177009* R;
trope177009* Heaproot;
};
struct  ttype225852  {
  tidobj200015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq225848* Sons;
tnode225816* N;
tsym225846* Owner;
tsym225846* Sym;
tsym225846* Destructor;
tsym225846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc225830 Loc;
};
struct  tstrtable225820  {
NI Counter;
tsymseq225818* Data;
};
struct  tlineinfo195539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tsym225846  {
  tidobj200015 Sup;
NU8 Kind;
union {
struct {ttypeseq225848* Typeinstcache;
tscope225840* Typscope;
} S1;
struct {TY225947* Procinstcache;
tscope225840* Scope;
} S2;
struct {TY225947* Usedgenerics;
tstrtable225820 Tab;
} S3;
struct {tsym225846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype225852* Typ;
tident200021* Name;
tlineinfo195539 Info;
tsym225846* Owner;
NU32 Flags;
tnode225816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc225830 Loc;
tlib225834* Annex;
tnode225816* Constraint;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tnode225816  {
ttype225852* Typ;
tlineinfo195539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym225846* Sym;
} S4;
struct {tident200021* Ident;
} S5;
struct {tnodeseq225810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  tident200021  {
  tidobj200015 Sup;
NimStringDesc* S;
tident200021* Next;
NI H;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tcell45135  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq45151  {
NI Len;
NI Cap;
tcell45135** D;
};
struct  tcellset45147  {
NI Counter;
NI Max;
tpagedesc45143* Head;
tpagedesc45143** Data;
};
typedef tsmallchunk26640* TY27422[512];
typedef ttrunk26613* ttrunkbuckets26615[256];
struct  tintset26617  {
ttrunkbuckets26615 Data;
};
struct  tmemregion27410  {
NI Minlargeobj;
NI Maxlargeobj;
TY27422 Freesmallchunks;
tllchunk27404* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26642* Freechunkslist;
tintset26617 Chunkstarts;
tavlnode27408* Root;
tavlnode27408* Deleted;
tavlnode27408* Last;
tavlnode27408* Freeavlnodes;
};
struct  tgcstat47214  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap47216  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq45151 Zct;
tcellseq45151 Decstack;
tcellset45147 Cycleroots;
tcellseq45151 Tempstack;
NI Recgclock;
tmemregion27410 Region;
tgcstat47214 Stat;
};
struct  TY480062  {
NI HEX3Astate;
tnode225816* P479805;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (tpatterncontext479013* c, tnode225816* op, tnode225816* n_479813, tnode225816* arglist, NIM_BOOL rpn, void* ClEnv);
void* ClEnv;
} TY479810;
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3066) (tpatterncontext479013* c, tnode225816* op, tnode225816* n_479813, tnode225816* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3067) (tpatterncontext479013* c, tnode225816* op, tnode225816* n_479813, tnode225816* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3068) (tpatterncontext479013* c, tnode225816* op, tnode225816* n_479813, tnode225816* arglist, NIM_BOOL rpn);
struct  tpasscontext286005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  intset222056  {
NI Counter;
NI Max;
ttrunk222052* Head;
ttrunkseq222054* Data;
};
struct  tlinkedlist127028  {
tlistentry127022* Head;
tlistentry127022* Tail;
NI Counter;
};
struct  tidpair225860  {
tidobj200015* Key;
TNimObject* Val;
};
struct  tidtable225864  {
NI Counter;
tidpairseq225862* Data;
};
typedef N_NIMCALL_PTR(tnode225816*, TY290064) (tcontext290021* c, tnode225816* n);
typedef N_NIMCALL_PTR(tnode225816*, TY290069) (tcontext290021* c, tnode225816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode225816*, TY290077) (tcontext290021* c, tnode225816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode225816*, TY290085) (tcontext290021* c, tnode225816* n);
typedef N_NIMCALL_PTR(tnode225816*, TY290090) (tcontext290021* c, tnode225816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode225816*, TY290098) (tcontext290021* c, tnode225816* n);
typedef N_NIMCALL_PTR(tnode225816*, TY290103) (tcontext290021* c, tnode225816* n, tnode225816* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype225852*, TY290110) (tcontext290021* c, tnode225816* n, ttype225852* prev);
typedef struct {
N_NIMCALL_PTR(tnode225816*, ClPrc) (tcontext290021* c, tidtable225864 pt, tnode225816* n, void* ClEnv);
void* ClEnv;
} TY290116;
typedef struct {
N_NIMCALL_PTR(tsym225846*, ClPrc) (tcontext290021* c, tsym225846* fn, tidtable225864 pt, tlineinfo195539 info, void* ClEnv);
void* ClEnv;
} TY290122;
struct  tinstantiationpair290013  {
tsym225846* Genericsym;
tinstantiation225836* Inst;
};
typedef N_NIMCALL_PTR(tsym225846*, TY290138) (tcontext290021* c, tsym225846* dc, ttype225852* t, tlineinfo195539 info);
struct  tcontext290021  {
  tpasscontext286005 Sup;
tsym225846* Module;
tscope225840* Currentscope;
tscope225840* Importtable;
tscope225840* Toplevelscope;
tproccon290011* P;
tsymseq225818* Friendmodules;
NI Instcounter;
intset222056 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq225818* Converters;
tsymseq225818* Patterns;
tlinkedlist127028 Optionstack;
tidtable225864 Symmapping;
tlinkedlist127028 Libs;
TY290064 Semconstexpr;
TY290069 Semexpr;
TY290077 Semtryexpr;
TY290085 Semtryconstexpr;
TY290090 Semoperand;
TY290098 Semconstboolexpr;
TY290103 Semoverloadedcall;
TY290110 Semtypenode;
TY290116 Seminferredlambda;
TY290122 Semgenerateinstance;
intset222056 Includedfiles;
tstrtable225820 Userpragmas;
tctx289048* Evalcontext;
intset222056 Unknownidents;
TY290133* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
NI Inparallelstmt;
TY290138 Instdeepcopy;
};
struct  trope177009  {
  TNimObject Sup;
trope177009* Left;
trope177009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tscope225840  {
NI Depthlevel;
tstrtable225820 Symbols;
tnodeseq225810* Usingsyms;
tscope225840* Parent;
};
struct  tinstantiation225836  {
tsym225846* Sym;
ttypeseq225848* Concretetypes;
TY225936* Usedby;
};
struct  tlistentry127022  {
  TNimObject Sup;
tlistentry127022* Prev;
tlistentry127022* Next;
};
struct  tlib225834  {
  tlistentry127022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope177009* Name;
tnode225816* Path;
};
typedef NI TY26620[16];
struct  tpagedesc45143  {
tpagedesc45143* Next;
NI Key;
TY26620 Bits;
};
struct  tbasechunk26638  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26640  {
  tbasechunk26638 Sup;
tsmallchunk26640* Next;
tsmallchunk26640* Prev;
tfreecell26630* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27404  {
NI Size;
NI Acc;
tllchunk27404* Next;
};
struct  tbigchunk26642  {
  tbasechunk26638 Sup;
tbigchunk26642* Next;
tbigchunk26642* Prev;
NI Align;
NF Data;
};
struct  ttrunk26613  {
ttrunk26613* Next;
NI Key;
TY26620 Bits;
};
typedef tavlnode27408* TY27414[2];
struct  tavlnode27408  {
TY27414 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tproccon290011  {
tsym225846* Owner;
tsym225846* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon290011* Next;
};
struct  ttrunk222052  {
ttrunk222052* Next;
NI Key;
TY26620 Bits;
};
struct  vmargs289042  {
NI Ra;
NI Rb;
NI Rc;
void* Slots;
tnode225816* Currentexception;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (vmargs289042* args, void* ClEnv);
void* ClEnv;
} vmcallback289044;
struct TY289270 {
NimStringDesc* Field0;
vmcallback289044 Field1;
};
struct  tctx289048  {
  tpasscontext286005 Sup;
TY289250* Code;
TY196414* Debug;
tnode225816* Globals;
tnode225816* Constants;
ttypeseq225848* Types;
tnode225816* Currentexceptiona;
tnode225816* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype289230* Prc;
tsym225846* Module;
tnode225816* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
tlineinfo195539 Comesfromheuristic;
TY289269* Callbacks;
NimStringDesc* Errorflag;
};
struct  tfreecell26630  {
tfreecell26630* Next;
NI Zerofield;
};
struct  tblock289030  {
tsym225846* Label;
TY289211* Fixups;
};
struct TY289237 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY289237 TY289234[256];
struct  pprocHEX3Aobjecttype289230  {
TY289231* Blocks;
tsym225846* Sym;
TY289234 Slots;
NI Maxslots;
};
struct tnodeseq225810 {
  TGenericSeq Sup;
  tnode225816* data[SEQ_DECL_SIZE];
};
struct ttypeseq225848 {
  TGenericSeq Sup;
  ttype225852* data[SEQ_DECL_SIZE];
};
struct TY225947 {
  TGenericSeq Sup;
  tinstantiation225836* data[SEQ_DECL_SIZE];
};
struct tsymseq225818 {
  TGenericSeq Sup;
  tsym225846* data[SEQ_DECL_SIZE];
};
struct ttrunkseq222054 {
  TGenericSeq Sup;
  ttrunk222052* data[SEQ_DECL_SIZE];
};
struct tidpairseq225862 {
  TGenericSeq Sup;
  tidpair225860 data[SEQ_DECL_SIZE];
};
struct TY290133 {
  TGenericSeq Sup;
  tinstantiationpair290013 data[SEQ_DECL_SIZE];
};
struct TY225936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY289250 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY196414 {
  TGenericSeq Sup;
  tlineinfo195539 data[SEQ_DECL_SIZE];
};
struct TY289269 {
  TGenericSeq Sup;
  TY289270 data[SEQ_DECL_SIZE];
};
struct TY289211 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY289231 {
  TGenericSeq Sup;
  tblock289030 data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, sonslen_226255)(ttype225852* n);
N_NIMCALL(tnode225816*, matchstmtlist_481196)(tpatterncontext479013* c, tnode225816* p, tnode225816* n_481200);
static N_INLINE(NI, len_226364)(tnode225816* n);
N_NIMCALL(tnode225816*, flattenstmts_262416)(tnode225816* n);
N_NIMCALL(NIM_BOOL, matchrange_481202)(tpatterncontext479013* c, tnode225816* p, tnode225816* n, NI i);
N_NIMCALL(NIM_BOOL, matches_479085)(tpatterncontext479013* c, tnode225816* p, tnode225816* n_479089);
static N_INLINE(NIM_BOOL, ispatternparam_479575)(tpatterncontext479013* c, tnode225816* p);
N_NIMCALL(NIM_BOOL, bindorcheck_479711)(tpatterncontext479013* c, tsym225846* param, tnode225816* n);
N_NIMCALL(tnode225816*, getlazy_479025)(tpatterncontext479013* c, tsym225846* sym);
N_NIMCALL(NIM_BOOL, sametrees_479132)(tnode225816* a, tnode225816* b);
static N_INLINE(NIM_BOOL, samekinds_479103)(tnode225816* a, tnode225816* b);
N_NIMCALL(NU8, canonkind_479093)(tnode225816* n);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NIM_BOOL, sametypeornil_268367)(ttype225852* a, ttype225852* b, NU8 flags);
static N_INLINE(NI, sonslen_226249)(tnode225816* n);
N_NIMCALL(NIM_BOOL, checktypes_479521)(tpatterncontext479013* c, tsym225846* p, tnode225816* n);
N_NIMCALL(NIM_BOOL, matchnodekinds_322381)(tnode225816* p, tnode225816* n);
N_NIMCALL(NIM_BOOL, argtypematches_414484)(tcontext290021* c, ttype225852* f, ttype225852* a);
N_NIMCALL(void, putlazy_479047)(tpatterncontext479013* c, tsym225846* sym, tnode225816* 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(tcell45135*, usrtocell_48846)(void* usr);
static N_INLINE(void, rtladdzct_50404)(tcell45135* c);
N_NOINLINE(void, addzct_48817)(tcellseq45151* s, tcell45135* c);
N_NIMCALL(NIM_BOOL, insymchoice_479355)(tnode225816* sc, tnode225816* x);
N_NIMCALL(NIM_BOOL, matchchoice_479648)(tpatterncontext479013* c, tnode225816* p, tnode225816* n);
N_NIMCALL(NIM_BOOL, matchnested_479802)(tpatterncontext479013* c, tnode225816* p, tnode225816* n, NIM_BOOL rpn);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP3065)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(tnode225816*, newnodei_226138)(NU8 kind, tlineinfo195539 info);
N_CLOSURE(NIM_BOOL, matchstaraux_479809)(tpatterncontext479013* c, tnode225816* op, tnode225816* n_479813, tnode225816* arglist, NIM_BOOL rpn, void* ClEnv);
static N_INLINE(tnode225816*, HEX5BHEX5D_226698)(tnode225816* n, NI i);
N_NIMCALL(void, add_226498)(tnode225816* father, tnode225816* son);
N_NIMCALL(void, internalerror_197987)(tlineinfo195539 info, NimStringDesc* errmsg);
N_NIMCALL(void, gather_479750)(tpatterncontext479013* c, tsym225846* param, tnode225816* n);
N_NIMCALL(tnode225816*, newnodei_228007)(NU8 kind, tlineinfo195539 info, NI children);
static N_INLINE(tnode225816*, lastson_226261)(tnode225816* n);
N_NIMCALL(void, genericSeqAssign)(void* dest, void* src_79804, TNimType* mt);
N_NIMCALL(tnode225816*, extractrange_262440)(NU8 k, tnode225816* n, NI a, NI b);
N_NIMCALL(tnode225816*, newsymnode_227755)(tsym225846* sym, tlineinfo195539 info);
N_NIMCALL(NIM_BOOL, aliasanalysisrequested_481382)(tnode225816* params);
N_NIMCALL(NU8, whichalias_321080)(tsym225846* p);
N_NIMCALL(void, addtoarglist_481467)(tnode225816* result, tnode225816* n);
N_NIMCALL(NU8, ispartof_478430)(tnode225816* a, tnode225816* b);
N_NIMCALL(void, markused_405251)(tlineinfo195539 info, tsym225846* s);
STRING_LITERAL(TMP3060, "|", 1);
STRING_LITERAL(TMP3061, "*", 1);
STRING_LITERAL(TMP3062, "**", 2);
STRING_LITERAL(TMP3063, "~", 1);
STRING_LITERAL(TMP3069, "invalid pattern", 15);
extern TNimType NTI225810; /* TNodeSeq */
extern tgcheap47216 gch_47244;
TNimType NTI480062; /* object */
extern TNimType NTI357033; /* range -1..0(int) */
extern TNimType NTI225808; /* PNode */
TNimType NTI480090; /* ref object */

static N_INLINE(NI, sonslen_226255)(ttype225852* 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_226364)(tnode225816* 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_479575)(tpatterncontext479013* c, tnode225816* 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(tnode225816*, getlazy_479025)(tpatterncontext479013* c, tsym225846* sym) {
	tnode225816* result;
	result = 0;
	{
		if (!!((*c).Mapping == 0)) goto LA3;
		result = (*c).Mapping->data[(*sym).Position];
	}
	LA3: ;
	return result;
}

N_NIMCALL(NU8, canonkind_479093)(tnode225816* 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_479103)(tnode225816* a, tnode225816* 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_479093(a);
	LOC4 = 0;
	LOC4 = canonkind_479093(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_226249)(tnode225816* 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_479132)(tnode225816* a, tnode225816* b) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = samekinds_479103(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_268367((*a).Typ, (*b).Typ, 0);
		}
		break;
		default:
		{
			{
				NI LOC16;
				NI LOC17;
				LOC16 = 0;
				LOC16 = sonslen_226249(a);
				LOC17 = 0;
				LOC17 = sonslen_226249(b);
				if (!(LOC16 == LOC17)) goto LA18;
				{
					NI i_479305;
					NI HEX3Atmp_479335;
					NI LOC21;
					NI res_479338;
					i_479305 = 0;
					HEX3Atmp_479335 = 0;
					LOC21 = 0;
					LOC21 = sonslen_226249(a);
					HEX3Atmp_479335 = (NI32)(LOC21 - 1);
					res_479338 = 0;
					{
						while (1) {
							if (!(res_479338 <= HEX3Atmp_479335)) goto LA23;
							i_479305 = res_479338;
							{
								NIM_BOOL LOC26;
								LOC26 = 0;
								LOC26 = sametrees_479132((*a).kindU.S6.Sons->data[i_479305], (*b).kindU.S6.Sons->data[i_479305]);
								if (!!(LOC26)) goto LA27;
								goto BeforeRet;
							}
							LA27: ;
							res_479338 += 1;
						} LA23: ;
					}
				}
				result = NIM_TRUE;
			}
			LA18: ;
		}
		break;
		}
	}
	LA4: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, checktypes_479521)(tpatterncontext479013* c, tsym225846* p, tnode225816* n) {
	NIM_BOOL result;
	result = 0;
	{
		if (!!(((*p).Constraint == NIM_NIL))) goto LA3;
		result = matchnodekinds_322381((*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_414484((*c).C, (*p).Typ, (*n).Typ);
	}
	LA9: ;
	BeforeRet: ;
	return result;
}

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

static N_INLINE(void, rtladdzct_50404)(tcell45135* c) {
	addzct_48817((&gch_47244.Zct), c);
}

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

N_NIMCALL(void, putlazy_479047)(tpatterncontext479013* c, tsym225846* sym, tnode225816* n) {
	{
		if (!(*c).Mapping == 0) goto LA3;
		unsureAsgnRef((void**) (&(*c).Mapping), (tnodeseq225810*) newSeq((&NTI225810), (*c).Formals));
	}
	LA3: ;
	asgnRefNoCycle((void**) (&(*c).Mapping->data[(*sym).Position]), n);
}

N_NIMCALL(NIM_BOOL, bindorcheck_479711)(tpatterncontext479013* c, tsym225846* param, tnode225816* n) {
	NIM_BOOL result;
	tnode225816* pp;
	result = 0;
	pp = getlazy_479025(c, param);
	{
		if (!!((pp == NIM_NIL))) goto LA3;
		result = sametrees_479132(pp, n);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = ((*n).Kind == ((NU8) 151));
		if (LOC6) goto LA7;
		LOC6 = checktypes_479521(c, param, n);
		LA7: ;
		if (!LOC6) goto LA8;
		putlazy_479047(c, param, n);
		result = NIM_TRUE;
	}
	goto LA1;
	LA8: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, insymchoice_479355)(tnode225816* sc, tnode225816* x) {
	NIM_BOOL result;
	result = 0;
	{
		if (!((*sc).Kind == ((NU8) 56))) goto LA3;
		{
			NI i_479390;
			NI HEX3Atmp_479501;
			NI LOC6;
			NI res_479504;
			i_479390 = 0;
			HEX3Atmp_479501 = 0;
			LOC6 = 0;
			LOC6 = len_226364(sc);
			HEX3Atmp_479501 = (LOC6 - 1);
			res_479504 = 0;
			{
				while (1) {
					if (!(res_479504 <= HEX3Atmp_479501)) goto LA8;
					i_479390 = res_479504;
					{
						if (!((*(*sc).kindU.S6.Sons->data[i_479390]).kindU.S4.Sym == (*x).kindU.S4.Sym)) goto LA11;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA11: ;
					res_479504 += 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_479648)(tpatterncontext479013* c, tnode225816* p, tnode225816* n) {
	NIM_BOOL result;
	result = 0;
	{
		NI i_479675;
		NI HEX3Atmp_479691;
		NI LOC2;
		NI res_479694;
		i_479675 = 0;
		HEX3Atmp_479691 = 0;
		LOC2 = 0;
		LOC2 = len_226364(p);
		HEX3Atmp_479691 = (LOC2 - 1);
		res_479694 = 1;
		{
			while (1) {
				if (!(res_479694 <= HEX3Atmp_479691)) goto LA4;
				i_479675 = res_479694;
				{
					NIM_BOOL LOC7;
					LOC7 = 0;
					LOC7 = matches_479085(c, (*p).kindU.S6.Sons->data[i_479675], n);
					if (!LOC7) goto LA8;
					result = NIM_TRUE;
					goto BeforeRet;
				}
				LA8: ;
				res_479694 += 1;
			} LA4: ;
		}
	}
	BeforeRet: ;
	return result;
}
N_NIMCALL(void, TMP3065)(void* p, NI op) {
	TY480062* a;
	a = (TY480062*)p;
	nimGCvisit((void*)(*a).P479805, op);
}

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

N_CLOSURE(NIM_BOOL, matchstaraux_479809)(tpatterncontext479013* c, tnode225816* op, tnode225816* n_479813, tnode225816* arglist, NIM_BOOL rpn, void* ClEnv) {
	NIM_BOOL result;
	TY480062* HEX3Aenvp_480086;
	result = 0;
	HEX3Aenvp_480086 = (TY480062*) ClEnv;
	result = NIM_TRUE;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((*n_479813).Kind == ((NU8) 27) || (*n_479813).Kind == ((NU8) 29) || (*n_479813).Kind == ((NU8) 30) || (*n_479813).Kind == ((NU8) 31) || (*n_479813).Kind == ((NU8) 26) || (*n_479813).Kind == ((NU8) 28) || (*n_479813).Kind == ((NU8) 32));
		if (!(LOC3)) goto LA4;
		LOC3 = matches_479085(c, (*op).kindU.S6.Sons->data[1], (*n_479813).kindU.S6.Sons->data[0]);
		LA4: ;
		if (!LOC3) goto LA5;
		{
			NI i_479868;
			NI HEX3Atmp_479981;
			NI LOC8;
			NI res_479984;
			i_479868 = 0;
			HEX3Atmp_479981 = 0;
			LOC8 = 0;
			LOC8 = sonslen_226249(n_479813);
			HEX3Atmp_479981 = (NI32)(LOC8 - 1);
			res_479984 = 1;
			{
				while (1) {
					if (!(res_479984 <= HEX3Atmp_479981)) goto LA10;
					i_479868 = res_479984;
					{
						TY479810 LOC13;
						tnode225816* LOC14;
						NIM_BOOL LOC15;
						memset((void*)(&LOC13), 0, sizeof(LOC13));
						LOC13.ClPrc = matchstaraux_479809; LOC13.ClEnv = HEX3Aenvp_480086;
						LOC14 = 0;
						LOC14 = HEX5BHEX5D_226698(n_479813, i_479868);
						LOC15 = 0;
						LOC15 = LOC13.ClEnv? LOC13.ClPrc(c, op, LOC14, arglist, rpn, LOC13.ClEnv):((TMP3066)(LOC13.ClPrc))(c, op, LOC14, arglist, rpn);
						if (!!(LOC15)) goto LA16;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA16: ;
					res_479984 += 1;
				} LA10: ;
			}
		}
		{
			if (!rpn) goto LA20;
			add_226498(arglist, (*n_479813).kindU.S6.Sons->data[0]);
		}
		LA20: ;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC23;
		tnode225816* n;
		LOC23 = 0;
		LOC23 = ((*n_479813).Kind == ((NU8) 58));
		if (!(LOC23)) goto LA24;
		LOC23 = ((*(*n_479813).kindU.S6.Sons->data[1]).Kind == ((NU8) 41));
		LA24: ;
		if (!LOC23) goto LA25;
		n = (*n_479813).kindU.S6.Sons->data[1];
		{
			NI i_479951;
			NI HEX3Atmp_479987;
			NI LOC28;
			NI res_479990;
			i_479951 = 0;
			HEX3Atmp_479987 = 0;
			LOC28 = 0;
			LOC28 = len_226364(n);
			HEX3Atmp_479987 = (LOC28 - 1);
			res_479990 = 0;
			{
				while (1) {
					if (!(res_479990 <= HEX3Atmp_479987)) goto LA30;
					i_479951 = res_479990;
					{
						TY479810 LOC33;
						tnode225816* LOC34;
						NIM_BOOL LOC35;
						memset((void*)(&LOC33), 0, sizeof(LOC33));
						LOC33.ClPrc = matchstaraux_479809; LOC33.ClEnv = HEX3Aenvp_480086;
						LOC34 = 0;
						LOC34 = HEX5BHEX5D_226698(n, i_479951);
						LOC35 = 0;
						LOC35 = LOC33.ClEnv? LOC33.ClPrc(c, op, LOC34, arglist, rpn, LOC33.ClEnv):((TMP3067)(LOC33.ClPrc))(c, op, LOC34, arglist, rpn);
						if (!!(LOC35)) goto LA36;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA36: ;
					res_479990 += 1;
				} LA30: ;
			}
		}
	}
	goto LA1;
	LA25: ;
	{
		NIM_BOOL LOC39;
		LOC39 = 0;
		LOC39 = checktypes_479521(c, (*(*(*HEX3Aenvp_480086).P479805).kindU.S6.Sons->data[2]).kindU.S4.Sym, n_479813);
		if (!LOC39) goto LA40;
		add_226498(arglist, n_479813);
	}
	goto LA1;
	LA40: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchnested_479802)(tpatterncontext479013* c, tnode225816* p, tnode225816* n, NIM_BOOL rpn) {
	NIM_BOOL result;
	TY480062* HEX3Aenv_480089;
	result = 0;
	HEX3Aenv_480089 = 0;
	HEX3Aenv_480089 = (TY480062*) newObj((&NTI480090), sizeof(TY480062));
	asgnRefNoCycle((void**) (&(*HEX3Aenv_480089).P479805), 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;
		tnode225816* arglist;
		LOC7 = 0;
		LOC7 = matches_479085(c, (*(*HEX3Aenv_480089).P479805).kindU.S6.Sons->data[1], (*n).kindU.S6.Sons->data[0]);
		if (!LOC7) goto LA8;
		arglist = newnodei_226138(((NU8) 151), (*n).Info);
		{
			TY479810 LOC12;
			NIM_BOOL LOC13;
			memset((void*)(&LOC12), 0, sizeof(LOC12));
			LOC12.ClPrc = matchstaraux_479809; LOC12.ClEnv = HEX3Aenv_480089;
			LOC13 = 0;
			LOC13 = LOC12.ClEnv? LOC12.ClPrc(c, (*HEX3Aenv_480089).P479805, n, arglist, rpn, LOC12.ClEnv):((TMP3068)(LOC12.ClPrc))(c, (*HEX3Aenv_480089).P479805, n, arglist, rpn);
			if (!LOC13) goto LA14;
			result = bindorcheck_479711(c, (*(*(*HEX3Aenv_480089).P479805).kindU.S6.Sons->data[2]).kindU.S4.Sym, arglist);
		}
		LA14: ;
	}
	LA8: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, gather_479750)(tpatterncontext479013* c, tsym225846* param, tnode225816* n) {
	tnode225816* pp;
	pp = getlazy_479025(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_226498(pp, n);
	}
	goto LA1;
	LA5: ;
	{
		pp = newnodei_228007(((NU8) 151), (*n).Info, 1);
		asgnRefNoCycle((void**) (&(*pp).kindU.S6.Sons->data[0]), n);
		putlazy_479047(c, param, pp);
	}
	LA1: ;
}

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

N_NIMCALL(NIM_BOOL, matches_479085)(tpatterncontext479013* c, tnode225816* p, tnode225816* n_479089) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ispatternparam_479575(c, p);
		if (!LOC3) goto LA4;
		result = bindorcheck_479711(c, (*p).kindU.S4.Sym, n_479089);
	}
	goto LA1;
	LA4: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = ((*n_479089).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_479089).kindU.S4.Sym).Name).Sup.Id);
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC12;
		LOC12 = 0;
		LOC12 = ((*n_479089).Kind == ((NU8) 3));
		if (!(LOC12)) goto LA13;
		LOC12 = insymchoice_479355(p, n_479089);
		LA13: ;
		if (!LOC12) goto LA14;
		result = NIM_TRUE;
	}
	goto LA1;
	LA14: ;
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = ((*n_479089).Kind == ((NU8) 3));
		if (!(LOC17)) goto LA18;
		LOC17 = ((*(*n_479089).kindU.S4.Sym).Kind == ((NU8) 10));
		LA18: ;
		if (!LOC17) goto LA19;
		{
			if (!((*p).Kind == ((NU8) 3))) goto LA23;
			result = ((*p).kindU.S4.Sym == (*n_479089).kindU.S4.Sym);
		}
		goto LA21;
		LA23: ;
		{
			NIM_BOOL LOC26;
			LOC26 = 0;
			LOC26 = matches_479085(c, p, (*(*n_479089).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*) &TMP3060))) goto LA32;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3061))) goto LA33;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3062))) goto LA34;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3063))) goto LA35;
		goto LA36;
		LA32: ;
		{
			result = matchchoice_479648(c, p, n_479089);
		}
		goto LA37;
		LA33: ;
		{
			result = matchnested_479802(c, p, n_479089, NIM_FALSE);
		}
		goto LA37;
		LA34: ;
		{
			result = matchnested_479802(c, p, n_479089, NIM_TRUE);
		}
		goto LA37;
		LA35: ;
		{
			NIM_BOOL LOC42;
			LOC42 = 0;
			LOC42 = matches_479085(c, (*p).kindU.S6.Sons->data[1], n_479089);
			result = !(LOC42);
		}
		goto LA37;
		LA36: ;
		{
			internalerror_197987((*p).Info, ((NimStringDesc*) &TMP3069));
		}
		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_479085(c, (*p).kindU.S6.Sons->data[0], n_479089);
				if (!LOC53) goto LA54;
				gather_479750(c, (*(*(*p).kindU.S6.Sons->data[1]).kindU.S6.Sons->data[1]).kindU.S4.Sym, n_479089);
				result = NIM_TRUE;
			}
			LA54: ;
		}
		goto LA47;
		LA49: ;
		{
			{
				NIM_BOOL LOC59;
				LOC59 = 0;
				LOC59 = matches_479085(c, (*p).kindU.S6.Sons->data[0], n_479089);
				if (!LOC59) goto LA60;
				result = bindorcheck_479711(c, (*(*p).kindU.S6.Sons->data[1]).kindU.S4.Sym, n_479089);
			}
			LA60: ;
		}
		LA47: ;
	}
	goto LA1;
	LA45: ;
	{
		NIM_BOOL LOC63;
		LOC63 = 0;
		LOC63 = samekinds_479103(p, n_479089);
		if (!LOC63) goto LA64;
		switch ((*p).Kind) {
		case ((NU8) 3):
		{
			result = ((*p).kindU.S4.Sym == (*n_479089).kindU.S4.Sym);
		}
		break;
		case ((NU8) 2):
		{
			result = ((*(*p).kindU.S5.Ident).Sup.Id == (*(*n_479089).kindU.S5.Ident).Sup.Id);
		}
		break;
		case ((NU8) 5) ... ((NU8) 10):
		{
			result = ((*p).kindU.S1.Intval == (*n_479089).kindU.S1.Intval);
		}
		break;
		case ((NU8) 16) ... ((NU8) 18):
		{
			result = ((*p).kindU.S2.Floatval == (*n_479089).kindU.S2.Floatval);
		}
		break;
		case ((NU8) 20) ... ((NU8) 22):
		{
			result = eqStrings((*p).kindU.S3.Strval, (*n_479089).kindU.S3.Strval);
		}
		break;
		case ((NU8) 1):
		case ((NU8) 23):
		case ((NU8) 4):
		{
			result = NIM_TRUE;
		}
		break;
		default:
		{
			NI plen;
			tnode225816* v;
			plen = sonslen_226249(p);
			v = lastson_226261(p);
			{
				NIM_BOOL LOC75;
				tnode225816* arglist;
				LOC75 = 0;
				LOC75 = ispatternparam_479575(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_226249(n_479089);
					if (!(plen <= LOC81)) goto LA82;
					{
						NI i_480837;
						NI HEX3Atmp_481116;
						NI res_481119;
						i_480837 = 0;
						HEX3Atmp_481116 = 0;
						HEX3Atmp_481116 = (NI32)(plen - 2);
						res_481119 = 0;
						{
							while (1) {
								if (!(res_481119 <= HEX3Atmp_481116)) goto LA86;
								i_480837 = res_481119;
								{
									NIM_BOOL LOC89;
									LOC89 = 0;
									LOC89 = matches_479085(c, (*p).kindU.S6.Sons->data[i_480837], (*n_479089).kindU.S6.Sons->data[i_480837]);
									if (!!(LOC89)) goto LA90;
									goto BeforeRet;
								}
								LA90: ;
								res_481119 += 1;
							} LA86: ;
						}
					}
					{
						NIM_BOOL LOC94;
						NIM_BOOL LOC95;
						NI LOC96;
						tnode225816* LOC98;
						tnode225816* LOC100;
						tnode225816* n;
						tnode225816* LOC103;
						NI LOC104;
						LOC94 = 0;
						LOC95 = 0;
						LOC96 = 0;
						LOC96 = sonslen_226249(n_479089);
						LOC95 = (plen == LOC96);
						if (!(LOC95)) goto LA97;
						LOC98 = 0;
						LOC98 = lastson_226261(n_479089);
						LOC95 = ((*LOC98).Kind == ((NU8) 58));
						LA97: ;
						LOC94 = LOC95;
						if (!(LOC94)) goto LA99;
						LOC100 = 0;
						LOC100 = lastson_226261(n_479089);
						LOC94 = ((*(*LOC100).kindU.S6.Sons->data[1]).Kind == ((NU8) 41));
						LA99: ;
						if (!LOC94) goto LA101;
						LOC103 = 0;
						LOC103 = lastson_226261(n_479089);
						n = (*LOC103).kindU.S6.Sons->data[1];
						LOC104 = 0;
						LOC104 = len_226364(n);
						arglist = newnodei_228007(((NU8) 151), (*n).Info, LOC104);
						{
							NI i_480934;
							NI HEX3Atmp_481122;
							NI LOC106;
							NI res_481125;
							i_480934 = 0;
							HEX3Atmp_481122 = 0;
							LOC106 = 0;
							LOC106 = len_226364(n);
							HEX3Atmp_481122 = (LOC106 - 1);
							res_481125 = 0;
							{
								while (1) {
									if (!(res_481125 <= HEX3Atmp_481122)) goto LA108;
									i_480934 = res_481125;
									asgnRefNoCycle((void**) (&(*arglist).kindU.S6.Sons->data[i_480934]), (*n).kindU.S6.Sons->data[i_480934]);
									res_481125 += 1;
								} LA108: ;
							}
						}
					}
					goto LA92;
					LA101: ;
					{
						NI LOC110;
						LOC110 = 0;
						LOC110 = sonslen_226249(n_479089);
						arglist = newnodei_228007(((NU8) 151), (*n_479089).Info, (NI32)((NI32)(LOC110 - plen) + 1));
						{
							NI i_480975;
							NI HEX3Atmp_481128;
							NI LOC112;
							NI res_481131;
							i_480975 = 0;
							HEX3Atmp_481128 = 0;
							LOC112 = 0;
							LOC112 = sonslen_226249(n_479089);
							HEX3Atmp_481128 = (NI32)(LOC112 - plen);
							res_481131 = 0;
							{
								while (1) {
									if (!(res_481131 <= HEX3Atmp_481128)) goto LA114;
									i_480975 = res_481131;
									asgnRefNoCycle((void**) (&(*arglist).kindU.S6.Sons->data[i_480975]), (*n_479089).kindU.S6.Sons->data[(NI32)((NI32)(i_480975 + plen) - 1)]);
									res_481131 += 1;
								} LA114: ;
							}
						}
					}
					LA92: ;
					result = bindorcheck_479711(c, (*v).kindU.S4.Sym, arglist);
					goto BeforeRet;
				}
				goto LA79;
				LA82: ;
				{
					NI LOC116;
					LOC116 = 0;
					LOC116 = sonslen_226249(n_479089);
					if (!((NI32)(plen - 1) == LOC116)) goto LA117;
					{
						NI i_481030;
						NI HEX3Atmp_481134;
						NI res_481137;
						i_481030 = 0;
						HEX3Atmp_481134 = 0;
						HEX3Atmp_481134 = (NI32)(plen - 2);
						res_481137 = 0;
						{
							while (1) {
								if (!(res_481137 <= HEX3Atmp_481134)) goto LA121;
								i_481030 = res_481137;
								{
									NIM_BOOL LOC124;
									LOC124 = 0;
									LOC124 = matches_479085(c, (*p).kindU.S6.Sons->data[i_481030], (*n_479089).kindU.S6.Sons->data[i_481030]);
									if (!!(LOC124)) goto LA125;
									goto BeforeRet;
								}
								LA125: ;
								res_481137 += 1;
							} LA121: ;
						}
					}
					arglist = newnodei_226138(((NU8) 151), (*n_479089).Info);
					result = bindorcheck_479711(c, (*v).kindU.S4.Sym, arglist);
					goto BeforeRet;
				}
				goto LA79;
				LA117: ;
				LA79: ;
			}
			LA77: ;
			{
				NI LOC129;
				LOC129 = 0;
				LOC129 = sonslen_226249(n_479089);
				if (!(plen == LOC129)) goto LA130;
				{
					NI i_481085;
					NI HEX3Atmp_481140;
					NI LOC133;
					NI res_481143;
					i_481085 = 0;
					HEX3Atmp_481140 = 0;
					LOC133 = 0;
					LOC133 = sonslen_226249(p);
					HEX3Atmp_481140 = (NI32)(LOC133 - 1);
					res_481143 = 0;
					{
						while (1) {
							if (!(res_481143 <= HEX3Atmp_481140)) goto LA135;
							i_481085 = res_481143;
							{
								NIM_BOOL LOC138;
								LOC138 = 0;
								LOC138 = matches_479085(c, (*p).kindU.S6.Sons->data[i_481085], (*n_479089).kindU.S6.Sons->data[i_481085]);
								if (!!(LOC138)) goto LA139;
								goto BeforeRet;
							}
							LA139: ;
							res_481143 += 1;
						} LA135: ;
					}
				}
				result = NIM_TRUE;
			}
			LA130: ;
		}
		break;
		}
	}
	goto LA1;
	LA64: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchrange_481202)(tpatterncontext479013* c, tnode225816* p, tnode225816* n, NI i) {
	NIM_BOOL result;
	result = 0;
	{
		NI j_481230;
		NI HEX3Atmp_481271;
		NI LOC2;
		NI res_481274;
		j_481230 = 0;
		HEX3Atmp_481271 = 0;
		LOC2 = 0;
		LOC2 = len_226364(p);
		HEX3Atmp_481271 = (LOC2 - 1);
		res_481274 = 0;
		{
			while (1) {
				if (!(res_481274 <= HEX3Atmp_481271)) goto LA4;
				j_481230 = res_481274;
				{
					NIM_BOOL LOC7;
					LOC7 = 0;
					LOC7 = matches_479085(c, (*p).kindU.S6.Sons->data[j_481230], (*n).kindU.S6.Sons->data[(NI32)(i + j_481230)]);
					if (!!(LOC7)) goto LA8;
					{
						if (!!((*c).Mapping == 0)) goto LA12;
						genericSeqAssign((&(*c).Mapping), NIM_NIL, (&NTI225810));
					}
					LA12: ;
					result = NIM_FALSE;
					goto BeforeRet;
				}
				LA8: ;
				res_481274 += 1;
			} LA4: ;
		}
	}
	result = NIM_TRUE;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode225816*, matchstmtlist_481196)(tpatterncontext479013* c, tnode225816* p, tnode225816* n_481200) {
	tnode225816* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		NI LOC7;
		NI LOC8;
		tnode225816* n;
		LOC3 = 0;
		LOC4 = 0;
		LOC4 = ((*p).Kind == ((NU8) 115));
		if (!(LOC4)) goto LA5;
		LOC4 = ((*n_481200).Kind == (*p).Kind);
		LA5: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA6;
		LOC7 = 0;
		LOC7 = len_226364(p);
		LOC8 = 0;
		LOC8 = len_226364(n_481200);
		LOC3 = (LOC7 < LOC8);
		LA6: ;
		if (!LOC3) goto LA9;
		n = flattenstmts_262416(n_481200);
		{
			NI i_481306;
			NI HEX3Atmp_481350;
			NI LOC12;
			NI LOC13;
			NI res_481353;
			i_481306 = 0;
			HEX3Atmp_481350 = 0;
			LOC12 = 0;
			LOC12 = len_226364(n);
			LOC13 = 0;
			LOC13 = len_226364(p);
			HEX3Atmp_481350 = (NI32)(LOC12 - LOC13);
			res_481353 = 0;
			{
				while (1) {
					if (!(res_481353 <= HEX3Atmp_481350)) goto LA15;
					i_481306 = res_481353;
					{
						NIM_BOOL LOC18;
						NI LOC21;
						NI LOC22;
						NI LOC23;
						LOC18 = 0;
						LOC18 = matchrange_481202(c, p, n, i_481306);
						if (!LOC18) goto LA19;
						(*c).Submatch = NIM_TRUE;
						result = newnodei_228007(((NU8) 115), (*n).Info, 3);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[0]), extractrange_262440(((NU8) 115), n, 0, (NI32)(i_481306 - 1)));
						LOC21 = 0;
						LOC21 = len_226364(p);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[1]), extractrange_262440(((NU8) 115), n, i_481306, (NI32)((NI32)(i_481306 + LOC21) - 1)));
						LOC22 = 0;
						LOC22 = len_226364(p);
						LOC23 = 0;
						LOC23 = len_226364(n);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[2]), extractrange_262440(((NU8) 115), n, (NI32)(i_481306 + LOC22), (NI32)(LOC23 - 1)));
						goto LA11;
					}
					LA19: ;
					res_481353 += 1;
				} LA15: ;
			}
		} LA11: ;
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC25;
		LOC25 = 0;
		LOC25 = matches_479085(c, p, n_481200);
		if (!LOC25) goto LA26;
		result = n_481200;
	}
	goto LA1;
	LA26: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, aliasanalysisrequested_481382)(tnode225816* params) {
	NIM_BOOL result;
	result = 0;
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = len_226364(params);
		if (!(2 <= LOC3)) goto LA4;
		{
			NI i_481407;
			NI HEX3Atmp_481447;
			NI LOC7;
			NI res_481450;
			i_481407 = 0;
			HEX3Atmp_481447 = 0;
			LOC7 = 0;
			LOC7 = len_226364(params);
			HEX3Atmp_481447 = (LOC7 - 1);
			res_481450 = 1;
			{
				while (1) {
					tsym225846* param;
					if (!(res_481450 <= HEX3Atmp_481447)) goto LA9;
					i_481407 = res_481450;
					param = (*(*params).kindU.S6.Sons->data[i_481407]).kindU.S4.Sym;
					{
						NU8 LOC12;
						LOC12 = 0;
						LOC12 = whichalias_321080(param);
						if (!!((LOC12 == ((NU8) 1)))) goto LA13;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA13: ;
					res_481450 += 1;
				} LA9: ;
			}
		}
	}
	LA4: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addtoarglist_481467)(tnode225816* result, tnode225816* 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_226498(result, n);
		}
		goto LA7;
		LA9: ;
		{
			{
				NI i_481527;
				NI HEX3Atmp_481543;
				NI LOC13;
				NI res_481546;
				i_481527 = 0;
				HEX3Atmp_481543 = 0;
				LOC13 = 0;
				LOC13 = len_226364(n);
				HEX3Atmp_481543 = (LOC13 - 1);
				res_481546 = 0;
				{
					while (1) {
						if (!(res_481546 <= HEX3Atmp_481543)) goto LA15;
						i_481527 = res_481546;
						add_226498(result, (*n).kindU.S6.Sons->data[i_481527]);
						res_481546 += 1;
					} LA15: ;
				}
			}
		}
		LA7: ;
	}
	LA5: ;
}

N_NIMCALL(tnode225816*, applyrule_481563)(tcontext290021* c, tsym225846* s, tnode225816* n) {
	tnode225816* result;
	tpatterncontext479013 ctx;
	NI LOC1;
	tnode225816* m;
	tnode225816* LOC6;
	tnode225816* params;
	NIM_BOOL requiresaa;
	tnode225816* args;
	result = 0;
	memset((void*)(&ctx), 0, sizeof(ctx));
	ctx.Owner = s;
	ctx.C = c;
	LOC1 = 0;
	LOC1 = sonslen_226255((*s).Typ);
	ctx.Formals = (NI32)(LOC1 - 1);
	m = matchstmtlist_481196((&ctx), (*(*s).Ast).kindU.S6.Sons->data[1], n);
	{
		if (!m == 0) goto LA4;
		result = NIM_NIL;
		goto BeforeRet;
	}
	LA4: ;
	result = newnodei_226138(((NU8) 27), (*n).Info);
	LOC6 = 0;
	LOC6 = newsymnode_227755(s, (*n).Info);
	add_226498(result, LOC6);
	params = (*(*s).Typ).N;
	requiresaa = aliasanalysisrequested_481382(params);
	args = 0;
	{
		if (!requiresaa) goto LA9;
		args = newnodei_226138(((NU8) 151), (*n).Info);
	}
	LA9: ;
	{
		NI i_481621;
		NI HEX3Atmp_481818;
		NI LOC12;
		NI res_481821;
		i_481621 = 0;
		HEX3Atmp_481818 = 0;
		LOC12 = 0;
		LOC12 = len_226364(params);
		HEX3Atmp_481818 = (LOC12 - 1);
		res_481821 = 1;
		{
			while (1) {
				tsym225846* param;
				tnode225816* x;
				if (!(res_481821 <= HEX3Atmp_481818)) goto LA14;
				i_481621 = res_481821;
				param = (*(*params).kindU.S6.Sons->data[i_481621]).kindU.S4.Sym;
				x = getlazy_479025((&ctx), param);
				{
					if (!x == 0) goto LA17;
					result = NIM_NIL;
					goto BeforeRet;
				}
				LA17: ;
				add_226498(result, x);
				{
					if (!requiresaa) goto LA21;
					addtoarglist_481467(args, x);
				}
				LA21: ;
				res_481821 += 1;
			} LA14: ;
		}
	}
	{
		if (!requiresaa) goto LA25;
		{
			NI i_481685;
			NI HEX3Atmp_481842;
			NI LOC28;
			NI res_481845;
			i_481685 = 0;
			HEX3Atmp_481842 = 0;
			LOC28 = 0;
			LOC28 = len_226364(params);
			HEX3Atmp_481842 = (LOC28 - 1);
			res_481845 = 1;
			{
				while (1) {
					tnode225816* rs;
					tsym225846* param;
					NU8 LOC31;
					if (!(res_481845 <= HEX3Atmp_481842)) goto LA30;
					i_481685 = res_481845;
					rs = (*result).kindU.S6.Sons->data[i_481685];
					param = (*(*params).kindU.S6.Sons->data[i_481685]).kindU.S4.Sym;
					LOC31 = 0;
					LOC31 = whichalias_321080(param);
					switch (LOC31) {
					case ((NU8) 1):
					{
					}
					break;
					case ((NU8) 2):
					{
						NIM_BOOL ok;
						ok = NIM_FALSE;
						{
							tnode225816* arg_481731;
							arg_481731 = 0;
							{
								NI i_481828;
								NI HEX3Atmp_481830;
								NI LOC36;
								NI res_481832;
								i_481828 = 0;
								HEX3Atmp_481830 = 0;
								LOC36 = 0;
								LOC36 = len_226364(args);
								HEX3Atmp_481830 = (LOC36 - 1);
								res_481832 = 0;
								{
									while (1) {
										if (!(res_481832 <= HEX3Atmp_481830)) goto LA38;
										i_481828 = res_481832;
										arg_481731 = (*args).kindU.S6.Sons->data[i_481828];
										{
											NIM_BOOL LOC41;
											NU8 LOC43;
											LOC41 = 0;
											LOC41 = !((arg_481731 == rs));
											if (!(LOC41)) goto LA42;
											LOC43 = 0;
											LOC43 = ispartof_478430(rs, arg_481731);
											LOC41 = (LOC43 == ((NU8) 2));
											LA42: ;
											if (!LOC41) goto LA44;
											ok = NIM_TRUE;
											goto LA34;
										}
										LA44: ;
										res_481832 += 1;
									} LA38: ;
								}
							}
						} LA34: ;
						{
							if (!!(ok)) goto LA48;
							result = NIM_NIL;
							goto BeforeRet;
						}
						LA48: ;
					}
					break;
					case ((NU8) 3):
					{
						NIM_BOOL ok;
						ok = NIM_TRUE;
						{
							tnode225816* arg_481758;
							arg_481758 = 0;
							{
								NI i_481837;
								NI HEX3Atmp_481839;
								NI LOC53;
								NI res_481841;
								i_481837 = 0;
								HEX3Atmp_481839 = 0;
								LOC53 = 0;
								LOC53 = len_226364(args);
								HEX3Atmp_481839 = (LOC53 - 1);
								res_481841 = 0;
								{
									while (1) {
										if (!(res_481841 <= HEX3Atmp_481839)) goto LA55;
										i_481837 = res_481841;
										arg_481758 = (*args).kindU.S6.Sons->data[i_481837];
										{
											NIM_BOOL LOC58;
											NU8 LOC60;
											LOC58 = 0;
											LOC58 = !((arg_481758 == rs));
											if (!(LOC58)) goto LA59;
											LOC60 = 0;
											LOC60 = ispartof_478430(rs, arg_481758);
											LOC58 = !((LOC60 == ((NU8) 0)));
											LA59: ;
											if (!LOC58) goto LA61;
											ok = NIM_FALSE;
											goto LA51;
										}
										LA61: ;
										res_481841 += 1;
									} LA55: ;
								}
							}
						} LA51: ;
						{
							if (!!(ok)) goto LA65;
							result = NIM_NIL;
							goto BeforeRet;
						}
						LA65: ;
					}
					break;
					}
					res_481845 += 1;
				} LA30: ;
			}
		}
	}
	LA25: ;
	markused_405251((*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* TMP3064[2];
static TNimNode TMP946[3];
NTI480062.size = sizeof(TY480062);
NTI480062.kind = 18;
NTI480062.base = 0;
NTI480062.flags = 2;
TMP3064[0] = &TMP946[1];
TMP946[1].kind = 1;
TMP946[1].offset = offsetof(TY480062, HEX3Astate);
TMP946[1].typ = (&NTI357033);
TMP946[1].name = ":state";
TMP3064[1] = &TMP946[2];
TMP946[2].kind = 1;
TMP946[2].offset = offsetof(TY480062, P479805);
TMP946[2].typ = (&NTI225808);
TMP946[2].name = "p479805";
TMP946[0].len = 2; TMP946[0].kind = 2; TMP946[0].sons = &TMP3064[0];
NTI480062.node = &TMP946[0];
NTI480090.size = sizeof(TY480062*);
NTI480090.kind = 22;
NTI480090.base = (&NTI480062);
NTI480090.flags = 2;
NTI480090.marker = TMP3065;
}

