/* Generated by Nim Compiler v0.12.0 */
/*   (c) 2015 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32

#include "nimbase.h"
#include <string.h>
typedef struct Tnode225809 Tnode225809;
typedef struct Tcontext280023 Tcontext280023;
typedef struct Tsym225841 Tsym225841;
typedef struct Tpatterncontext448013 Tpatterncontext448013;
typedef struct Tnodeseq225803 Tnodeseq225803;
typedef struct Ttype225847 Ttype225847;
typedef struct Tidobj198015 Tidobj198015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq225843 Ttypeseq225843;
typedef struct Tscope225835 Tscope225835;
typedef struct TY225944 TY225944;
typedef struct Tstrtable225813 Tstrtable225813;
typedef struct Tsymseq225811 Tsymseq225811;
typedef struct Tident198021 Tident198021;
typedef struct Tlineinfo190352 Tlineinfo190352;
typedef struct Tloc225823 Tloc225823;
typedef struct Ropeobj176009 Ropeobj176009;
typedef struct Tlib225827 Tlib225827;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Cell48946 Cell48946;
typedef struct Cellseq48962 Cellseq48962;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48958 Cellset48958;
typedef struct Pagedesc48954 Pagedesc48954;
typedef struct Memregion30890 Memregion30890;
typedef struct Smallchunk30842 Smallchunk30842;
typedef struct Llchunk30884 Llchunk30884;
typedef struct Bigchunk30844 Bigchunk30844;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30888 Avlnode30888;
typedef struct Gcstat51014 Gcstat51014;
typedef struct TY448596 TY448596;
typedef struct Tpasscontext277005 Tpasscontext277005;
typedef struct Tproccon280011 Tproccon280011;
typedef struct Intset222056 Intset222056;
typedef struct Trunk222052 Trunk222052;
typedef struct Trunkseq222054 Trunkseq222054;
typedef struct Tlinkedlist140028 Tlinkedlist140028;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct Tidtable225859 Tidtable225859;
typedef struct Tidpairseq225857 Tidpairseq225857;
typedef struct Tctx279048 Tctx279048;
typedef struct TY280143 TY280143;
typedef struct Tinstantiation225831 Tinstantiation225831;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct Tidpair225855 Tidpair225855;
typedef struct TY279254 TY279254;
typedef struct TY191420 TY191420;
typedef struct PprocHEX3Aobjecttype279233 PprocHEX3Aobjecttype279233;
typedef struct TY279273 TY279273;
typedef struct Tinstantiationpair280013 Tinstantiationpair280013;
typedef struct TY225932 TY225932;
typedef struct TY279234 TY279234;
typedef struct TY279239 TY279239;
typedef struct TY279274 TY279274;
typedef struct Vmargs279042 Vmargs279042;
typedef struct Tblock279030 Tblock279030;
typedef struct TY279214 TY279214;
struct  Tpatterncontext448013  {
Tsym225841* owner;
Tnodeseq225803* mapping;
NI formals;
Tcontext280023* c;
NIM_BOOL submatch;
};
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj198015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable225813  {
NI counter;
Tsymseq225811* data;
};
struct  Tlineinfo190352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc225823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype225847* t;
Ropeobj176009* r;
Ropeobj176009* heaproot;
};
struct  Tsym225841  {
  Tidobj198015 Sup;
NU8 kind;
union{
struct {Ttypeseq225843* typeinstcache;
Tscope225835* typscope;
} S1;
struct {TY225944* procinstcache;
Tsym225841* gcunsafetyreason;
} S2;
struct {TY225944* usedgenerics;
Tstrtable225813 tab;
} S3;
struct {Tsym225841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype225847* typ;
Tident198021* name;
Tlineinfo190352 info;
Tsym225841* owner;
NU32 flags;
Tnode225809* ast;
NU32 options;
NI position;
NI offset;
Tloc225823 loc;
Tlib225827* annex;
Tnode225809* constraint;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode225809  {
Ttype225847* typ;
Tlineinfo190352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym225841* sym;
} S4;
struct {Tident198021* ident;
} S5;
struct {Tnodeseq225803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tident198021  {
  Tidobj198015 Sup;
NimStringDesc* s;
Tident198021* next;
NI h;
};
struct  Ttype225847  {
  Tidobj198015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq225843* sons;
Tnode225809* n;
Tsym225841* owner;
Tsym225841* sym;
Tsym225841* destructor;
Tsym225841* deepcopy;
Tsym225841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc225823 loc;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Cell48946  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48962  {
NI len;
NI cap;
Cell48946** d;
};
struct  Cellset48958  {
NI counter;
NI max;
Pagedesc48954* head;
Pagedesc48954** data;
};
typedef Smallchunk30842* TY30905[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30890  {
NI minlargeobj;
NI maxlargeobj;
TY30905 freesmallchunks;
Llchunk30884* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30844* freechunkslist;
Intset30817 chunkstarts;
Avlnode30888* root;
Avlnode30888* deleted;
Avlnode30888* last;
Avlnode30888* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48962 zct;
Cellseq48962 decstack;
Cellset48958 cycleroots;
Cellseq48962 tempstack;
NI recgclock;
Memregion30890 region;
Gcstat51014 stat;
};
struct  TY448596  {
NI HEX3Astate;
Tnode225809* p448485;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (Tpatterncontext448013* c, Tnode225809* op, Tnode225809* n_448493, Tnode225809* arglist, NIM_BOOL rpn, void* ClEnv);
void* ClEnv;
} TY448490;
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3324) (Tpatterncontext448013* c, Tnode225809* op, Tnode225809* n_448493, Tnode225809* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3325) (Tpatterncontext448013* c, Tnode225809* op, Tnode225809* n_448493, Tnode225809* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3326) (Tpatterncontext448013* c, Tnode225809* op, Tnode225809* n_448493, Tnode225809* arglist, NIM_BOOL rpn);
struct  Tpasscontext277005  {
  TNimObject Sup;
NIM_BOOL fromcache;
};
struct  Intset222056  {
NI counter;
NI max;
Trunk222052* head;
Trunkseq222054* data;
};
struct  Tlinkedlist140028  {
Tlistentry140022* head;
Tlistentry140022* tail;
NI counter;
};
struct  Tidtable225859  {
NI counter;
Tidpairseq225857* data;
};
typedef N_NIMCALL_PTR(Tnode225809*, TY280074) (Tcontext280023* c, Tnode225809* n);
typedef N_NIMCALL_PTR(Tnode225809*, TY280079) (Tcontext280023* c, Tnode225809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode225809*, TY280087) (Tcontext280023* c, Tnode225809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode225809*, TY280095) (Tcontext280023* c, Tnode225809* n);
typedef N_NIMCALL_PTR(Tnode225809*, TY280100) (Tcontext280023* c, Tnode225809* n, NU16 flags);
typedef N_NIMCALL_PTR(Tnode225809*, TY280108) (Tcontext280023* c, Tnode225809* n);
typedef N_NIMCALL_PTR(Tnode225809*, TY280113) (Tcontext280023* c, Tnode225809* n, Tnode225809* norig, NU32 filter);
typedef N_NIMCALL_PTR(Ttype225847*, TY280120) (Tcontext280023* c, Tnode225809* n, Ttype225847* prev);
typedef struct {
N_NIMCALL_PTR(Tnode225809*, ClPrc) (Tcontext280023* c, Tidtable225859 pt, Tnode225809* n, void* ClEnv);
void* ClEnv;
} TY280126;
typedef struct {
N_NIMCALL_PTR(Tsym225841*, ClPrc) (Tcontext280023* c, Tsym225841* fn, Tidtable225859 pt, Tlineinfo190352 info, void* ClEnv);
void* ClEnv;
} TY280132;
typedef N_NIMCALL_PTR(Tsym225841*, TY280148) (Tcontext280023* c, Tsym225841* dc, Ttype225847* t, Tlineinfo190352 info, NU8 op);
struct  Tcontext280023  {
  Tpasscontext277005 Sup;
Tsym225841* module;
Tscope225835* currentscope;
Tscope225835* importtable;
Tscope225835* toplevelscope;
Tproccon280011* p;
Tsymseq225811* friendmodules;
NI instcounter;
Intset222056 ambiguoussymbols;
NI intypeclass;
NI ingenericcontext;
NI inunrolledcontext;
NI compilescontextid;
NI compilescontextidgenerator;
NI ingenericinst;
Tsymseq225811* converters;
Tsymseq225811* patterns;
Tlinkedlist140028 optionstack;
Tidtable225859 symmapping;
Tlinkedlist140028 libs;
TY280074 semconstexpr;
TY280079 semexpr;
TY280087 semtryexpr;
TY280095 semtryconstexpr;
TY280100 semoperand;
TY280108 semconstboolexpr;
TY280113 semoverloadedcall;
TY280120 semtypenode;
TY280126 seminferredlambda;
TY280132 semgenerateinstance;
Intset222056 includedfiles;
Tstrtable225813 userpragmas;
Tctx279048* evalcontext;
Intset222056 unknownidents;
TY280143* generics;
NI lastgenericidx;
NI hloloopdetector;
NI inparallelstmt;
TY280148 insttypeboundop;
};
struct  Tscope225835  {
NI depthlevel;
Tstrtable225813 symbols;
Tnodeseq225803* usingsyms;
Tscope225835* parent;
};
struct  Ropeobj176009  {
  TNimObject Sup;
Ropeobj176009* left;
Ropeobj176009* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib225827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj176009* name;
Tnode225809* path;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30821[16];
struct  Pagedesc48954  {
Pagedesc48954* next;
NI key;
TY30821 bits;
};
struct  Basechunk30840  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30842  {
  Basechunk30840 Sup;
Smallchunk30842* next;
Smallchunk30842* prev;
Freecell30832* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30884  {
NI size;
NI acc;
Llchunk30884* next;
};
struct  Bigchunk30844  {
  Basechunk30840 Sup;
Bigchunk30844* next;
Bigchunk30844* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30821 bits;
};
typedef Avlnode30888* TY30895[2];
struct  Avlnode30888  {
TY30895 link;
NI key;
NI upperbound;
NI level;
};
struct  Tproccon280011  {
Tsym225841* owner;
Tsym225841* resultsym;
NI nestedloopcounter;
NI nestedblockcounter;
NI intrystmt;
Tproccon280011* next;
NIM_BOOL wasforwarded;
Tnode225809* bracketexpr;
};
struct  Trunk222052  {
Trunk222052* next;
NI key;
TY30821 bits;
};
struct  Tidpair225855  {
Tidobj198015* key;
TNimObject* val;
};
struct  Tctx279048  {
  Tpasscontext277005 Sup;
TY279254* code;
TY191420* debug;
Tnode225809* globals;
Tnode225809* constants;
Ttypeseq225843* types;
Tnode225809* currentexceptiona;
Tnode225809* currentexceptionb;
NI exceptioninstr;
PprocHEX3Aobjecttype279233* prc;
Tsym225841* module;
Tnode225809* callsite;
NU8 mode;
NU8 features;
NIM_BOOL traceactive;
NI loopiterations;
Tlineinfo190352 comesfromheuristic;
TY279273* callbacks;
NimStringDesc* errorflag;
};
struct  Tinstantiationpair280013  {
Tsym225841* genericsym;
Tinstantiation225831* inst;
};
struct  Tinstantiation225831  {
Tsym225841* sym;
Ttypeseq225843* concretetypes;
TY225932* usedby;
NI compilesid;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct TY279239 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY279239 TY279242[256];
struct  PprocHEX3Aobjecttype279233  {
TY279234* blocks;
Tsym225841* sym;
TY279242 slots;
NI maxslots;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (Vmargs279042* args, void* ClEnv);
void* ClEnv;
} Vmcallback279044;
struct TY279274 {
NimStringDesc* Field0;
Vmcallback279044 Field1;
};
struct  Tblock279030  {
Tsym225841* label;
TY279214* fixups;
};
struct  Vmargs279042  {
NI ra;
NI rb;
NI rc;
void* slots;
Tnode225809* currentexception;
};
struct Tnodeseq225803 {
  TGenericSeq Sup;
  Tnode225809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq225843 {
  TGenericSeq Sup;
  Ttype225847* data[SEQ_DECL_SIZE];
};
struct TY225944 {
  TGenericSeq Sup;
  Tinstantiation225831* data[SEQ_DECL_SIZE];
};
struct Tsymseq225811 {
  TGenericSeq Sup;
  Tsym225841* data[SEQ_DECL_SIZE];
};
struct Trunkseq222054 {
  TGenericSeq Sup;
  Trunk222052* data[SEQ_DECL_SIZE];
};
struct Tidpairseq225857 {
  TGenericSeq Sup;
  Tidpair225855 data[SEQ_DECL_SIZE];
};
struct TY280143 {
  TGenericSeq Sup;
  Tinstantiationpair280013 data[SEQ_DECL_SIZE];
};
struct TY279254 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY191420 {
  TGenericSeq Sup;
  Tlineinfo190352 data[SEQ_DECL_SIZE];
};
struct TY279273 {
  TGenericSeq Sup;
  TY279274 data[SEQ_DECL_SIZE];
};
struct TY225932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY279234 {
  TGenericSeq Sup;
  Tblock279030 data[SEQ_DECL_SIZE];
};
struct TY279214 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
N_NIMCALL(NI, sonslen_228351)(Ttype225847* n);
N_NIMCALL(Tnode225809*, matchstmtlist_449037)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n_449041);
static N_INLINE(NI, len_226098)(Tnode225809* n);
N_NIMCALL(Tnode225809*, flattenstmts_254773)(Tnode225809* n);
N_NIMCALL(NIM_BOOL, matchrange_449043)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n, NI i);
N_NIMCALL(NIM_BOOL, matches_448075)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n_448079);
static N_INLINE(NIM_BOOL, ispatternparam_448320)(Tpatterncontext448013* c, Tnode225809* p);
N_NIMCALL(NIM_BOOL, bindorcheck_448413)(Tpatterncontext448013* c, Tsym225841* param, Tnode225809* n);
N_NIMCALL(Tnode225809*, getlazy_448025)(Tpatterncontext448013* c, Tsym225841* sym);
N_NIMCALL(NIM_BOOL, sametrees_448124)(Tnode225809* a, Tnode225809* b);
static N_INLINE(NIM_BOOL, samekinds_448093)(Tnode225809* a, Tnode225809* b);
N_NIMCALL(NU8, canonkind_448083)(Tnode225809* n);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NIM_BOOL, sametypeornil_260108)(Ttype225847* a, Ttype225847* b, NU8 flags);
N_NIMCALL(NI, sonslen_228387)(Tnode225809* n);
N_NIMCALL(NIM_BOOL, checktypes_448273)(Tpatterncontext448013* c, Tsym225841* p, Tnode225809* n);
N_NIMCALL(NIM_BOOL, matchnodekinds_306302)(Tnode225809* p, Tnode225809* n);
N_NIMCALL(NIM_BOOL, argtypematches_394817)(Tcontext280023* c, Ttype225847* f, Ttype225847* a);
N_NIMCALL(void, putlazy_448045)(Tpatterncontext448013* c, Tsym225841* sym, Tnode225809* 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(Cell48946*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48946* c);
N_NOINLINE(void, addzct_52617)(Cellseq48962* s, Cell48946* c);
N_NIMCALL(NIM_BOOL, insymchoice_448188)(Tnode225809* sc, Tnode225809* x);
N_NIMCALL(NIM_BOOL, matchchoice_448363)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n);
N_NIMCALL(NIM_BOOL, matchnested_448482)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n, NIM_BOOL rpn);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP3323)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(Tnode225809*, newnodei_227351)(NU8 kind, Tlineinfo190352 info);
N_CLOSURE(NIM_BOOL, matchstaraux_448489)(Tpatterncontext448013* c, Tnode225809* op, Tnode225809* n_448493, Tnode225809* arglist, NIM_BOOL rpn, void* ClEnv);
static N_INLINE(Tnode225809*, HEX5BHEX5D_226244)(Tnode225809* n, NI i);
N_NIMCALL(void, add_226165)(Tnode225809* father, Tnode225809* son);
N_NIMCALL(void, internalerror_196172)(Tlineinfo190352 info, NimStringDesc* errmsg);
N_NIMCALL(void, gather_448447)(Tpatterncontext448013* c, Tsym225841* param, Tnode225809* n);
N_NIMCALL(Tnode225809*, newnodei_227407)(NU8 kind, Tlineinfo190352 info, NI children);
N_NIMCALL(Tnode225809*, lastson_228406)(Tnode225809* n);
N_NIMCALL(void, genericSeqAssign)(void* dest, void* src_85804, TNimType* mt);
N_NIMCALL(Tnode225809*, extractrange_254785)(NU8 k, Tnode225809* n, NI a, NI b);
N_NIMCALL(Tnode225809*, newsymnode_227338)(Tsym225841* sym, Tlineinfo190352 info);
N_NIMCALL(NIM_BOOL, aliasanalysisrequested_449163)(Tnode225809* params);
N_NIMCALL(NU8, whichalias_305080)(Tsym225841* p);
N_NIMCALL(void, addtoarglist_449223)(Tnode225809* result, Tnode225809* n);
N_NIMCALL(NU8, ispartof_447375)(Tnode225809* a, Tnode225809* b);
N_NIMCALL(void, markused_388253)(Tlineinfo190352 info, Tsym225841* s);
STRING_LITERAL(TMP3318, "|", 1);
STRING_LITERAL(TMP3319, "*", 1);
STRING_LITERAL(TMP3320, "**", 2);
STRING_LITERAL(TMP3321, "~", 1);
STRING_LITERAL(TMP3327, "invalid pattern", 15);
extern TNimType NTI225803; /* TNodeSeq */
extern Gcheap51018 gch_51059;
TNimType NTI448596; /* object */
extern TNimType NTI346033; /* range -1..0(int) */
extern TNimType NTI225801; /* PNode */
TNimType NTI448624; /* ref object */

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

static N_INLINE(NIM_BOOL, ispatternparam_448320)(Tpatterncontext448013* c, Tnode225809* 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(Tnode225809*, getlazy_448025)(Tpatterncontext448013* c, Tsym225841* sym) {
	Tnode225809* result;
	result = 0;
	{
		if (!!((*c).mapping == 0)) goto LA3;
		result = (*c).mapping->data[(*sym).position];
	}
	LA3: ;
	return result;
}

N_NIMCALL(NU8, canonkind_448083)(Tnode225809* 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_448093)(Tnode225809* a, Tnode225809* 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_448083(a);
	LOC4 = 0;
	LOC4 = canonkind_448083(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)), (*a).Sup.len);
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, sametrees_448124)(Tnode225809* a, Tnode225809* b) {
	NIM_BOOL result;
{	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = samekinds_448093(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_260108((*a).typ, (*b).typ, 0);
		}
		break;
		default:
		{
			{
				NI LOC16;
				NI LOC17;
				LOC16 = 0;
				LOC16 = sonslen_228387(a);
				LOC17 = 0;
				LOC17 = sonslen_228387(b);
				if (!(LOC16 == LOC17)) goto LA18;
				{
					NI i_448162;
					NI HEX3Atmp_448166;
					NI LOC21;
					NI res_448169;
					i_448162 = 0;
					HEX3Atmp_448166 = 0;
					LOC21 = 0;
					LOC21 = sonslen_228387(a);
					HEX3Atmp_448166 = (NI)(LOC21 - ((NI) 1));
					res_448169 = ((NI) 0);
					{
						while (1) {
							if (!(res_448169 <= HEX3Atmp_448166)) goto LA23;
							i_448162 = res_448169;
							{
								NIM_BOOL LOC26;
								LOC26 = 0;
								LOC26 = sametrees_448124((*a).kindU.S6.sons->data[i_448162], (*b).kindU.S6.sons->data[i_448162]);
								if (!!(LOC26)) goto LA27;
								goto BeforeRet;
							}
							LA27: ;
							res_448169 += ((NI) 1);
						} LA23: ;
					}
				}
				result = NIM_TRUE;
			}
			LA18: ;
		}
		break;
		}
	}
	LA4: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, checktypes_448273)(Tpatterncontext448013* c, Tsym225841* p, Tnode225809* n) {
	NIM_BOOL result;
{	result = 0;
	{
		if (!!(((*p).constraint == NIM_NIL))) goto LA3;
		result = matchnodekinds_306302((*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_394817((*c).c, (*p).typ, (*n).typ);
	}
	LA9: ;
	}BeforeRet: ;
	return result;
}

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

static N_INLINE(void, rtladdzct_54204)(Cell48946* c) {
	addzct_52617((&gch_51059.zct), c);
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell48946* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_52646(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell48946* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_52646((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA11;
			rtladdzct_54204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(void, putlazy_448045)(Tpatterncontext448013* c, Tsym225841* sym, Tnode225809* n) {
	{
		if (!(*c).mapping == 0) goto LA3;
		unsureAsgnRef((void**) (&(*c).mapping), (Tnodeseq225803*) newSeq((&NTI225803), ((NI) ((*c).formals))));
	}
	LA3: ;
	asgnRefNoCycle((void**) (&(*c).mapping->data[(*sym).position]), n);
}

N_NIMCALL(NIM_BOOL, bindorcheck_448413)(Tpatterncontext448013* c, Tsym225841* param, Tnode225809* n) {
	NIM_BOOL result;
	Tnode225809* pp;
	result = 0;
	pp = getlazy_448025(c, param);
	{
		if (!!((pp == NIM_NIL))) goto LA3;
		result = sametrees_448124(pp, n);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = ((*n).kind == ((NU8) 152));
		if (LOC6) goto LA7;
		LOC6 = checktypes_448273(c, param, n);
		LA7: ;
		if (!LOC6) goto LA8;
		putlazy_448045(c, param, n);
		result = NIM_TRUE;
	}
	goto LA1;
	LA8: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, insymchoice_448188)(Tnode225809* sc, Tnode225809* x) {
	NIM_BOOL result;
{	result = 0;
	{
		if (!((*sc).kind == ((NU8) 56))) goto LA3;
		{
			NI i_448221;
			NI HEX3Atmp_448251;
			NI LOC6;
			NI res_448254;
			i_448221 = 0;
			HEX3Atmp_448251 = 0;
			LOC6 = 0;
			LOC6 = len_226098(sc);
			HEX3Atmp_448251 = (LOC6 - 1);
			res_448254 = ((NI) 0);
			{
				while (1) {
					if (!(res_448254 <= HEX3Atmp_448251)) goto LA8;
					i_448221 = res_448254;
					{
						if (!((*(*sc).kindU.S6.sons->data[i_448221]).kindU.S4.sym == (*x).kindU.S4.sym)) goto LA11;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA11: ;
					res_448254 += ((NI) 1);
				} LA8: ;
			}
		}
	}
	goto LA1;
	LA3: ;
	{
		if (!((*sc).kind == ((NU8) 57))) goto LA14;
		result = ((*(*(*(*sc).kindU.S6.sons->data[((NI) 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_448363)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n) {
	NIM_BOOL result;
{	result = 0;
	{
		NI i_448388;
		NI HEX3Atmp_448391;
		NI LOC2;
		NI res_448394;
		i_448388 = 0;
		HEX3Atmp_448391 = 0;
		LOC2 = 0;
		LOC2 = len_226098(p);
		HEX3Atmp_448391 = (LOC2 - 1);
		res_448394 = ((NI) 1);
		{
			while (1) {
				if (!(res_448394 <= HEX3Atmp_448391)) goto LA4;
				i_448388 = res_448394;
				{
					NIM_BOOL LOC7;
					LOC7 = 0;
					LOC7 = matches_448075(c, (*p).kindU.S6.sons->data[i_448388], n);
					if (!LOC7) goto LA8;
					result = NIM_TRUE;
					goto BeforeRet;
				}
				LA8: ;
				res_448394 += ((NI) 1);
			} LA4: ;
		}
	}
	}BeforeRet: ;
	return result;
}
N_NIMCALL(void, TMP3323)(void* p, NI op) {
	TY448596* a;
	a = (TY448596*)p;
	nimGCvisit((void*)(*a).p448485, op);
}

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

N_CLOSURE(NIM_BOOL, matchstaraux_448489)(Tpatterncontext448013* c, Tnode225809* op, Tnode225809* n_448493, Tnode225809* arglist, NIM_BOOL rpn, void* ClEnv) {
	NIM_BOOL result;
	TY448596* HEX3Aenvp_448620;
{	result = 0;
	HEX3Aenvp_448620 = (TY448596*) ClEnv;
	result = NIM_TRUE;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((*n_448493).kind == ((NU8) 27) || (*n_448493).kind == ((NU8) 29) || (*n_448493).kind == ((NU8) 30) || (*n_448493).kind == ((NU8) 31) || (*n_448493).kind == ((NU8) 26) || (*n_448493).kind == ((NU8) 28) || (*n_448493).kind == ((NU8) 32));
		if (!(LOC3)) goto LA4;
		LOC3 = matches_448075(c, (*op).kindU.S6.sons->data[((NI) 1)], (*n_448493).kindU.S6.sons->data[((NI) 0)]);
		LA4: ;
		if (!LOC3) goto LA5;
		{
			NI i_448519;
			NI HEX3Atmp_448566;
			NI LOC8;
			NI res_448569;
			i_448519 = 0;
			HEX3Atmp_448566 = 0;
			LOC8 = 0;
			LOC8 = sonslen_228387(n_448493);
			HEX3Atmp_448566 = (NI)(LOC8 - ((NI) 1));
			res_448569 = ((NI) 1);
			{
				while (1) {
					if (!(res_448569 <= HEX3Atmp_448566)) goto LA10;
					i_448519 = res_448569;
					{
						TY448490 LOC13;
						Tnode225809* LOC14;
						NIM_BOOL LOC15;
						memset((void*)(&LOC13), 0, sizeof(LOC13));
						LOC13.ClPrc = matchstaraux_448489; LOC13.ClEnv = HEX3Aenvp_448620;
						LOC14 = 0;
						LOC14 = HEX5BHEX5D_226244(n_448493, i_448519);
						LOC15 = 0;
						LOC15 = LOC13.ClEnv? LOC13.ClPrc(c, op, LOC14, arglist, rpn, LOC13.ClEnv):((TMP3324)(LOC13.ClPrc))(c, op, LOC14, arglist, rpn);
						if (!!(LOC15)) goto LA16;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA16: ;
					res_448569 += ((NI) 1);
				} LA10: ;
			}
		}
		{
			if (!rpn) goto LA20;
			add_226165(arglist, (*n_448493).kindU.S6.sons->data[((NI) 0)]);
		}
		LA20: ;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC23;
		Tnode225809* n;
		LOC23 = 0;
		LOC23 = ((*n_448493).kind == ((NU8) 58));
		if (!(LOC23)) goto LA24;
		LOC23 = ((*(*n_448493).kindU.S6.sons->data[((NI) 1)]).kind == ((NU8) 41));
		LA24: ;
		if (!LOC23) goto LA25;
		n = (*n_448493).kindU.S6.sons->data[((NI) 1)];
		{
			NI i_448562;
			NI HEX3Atmp_448574;
			NI LOC28;
			NI res_448577;
			i_448562 = 0;
			HEX3Atmp_448574 = 0;
			LOC28 = 0;
			LOC28 = len_226098(n);
			HEX3Atmp_448574 = (LOC28 - 1);
			res_448577 = ((NI) 0);
			{
				while (1) {
					if (!(res_448577 <= HEX3Atmp_448574)) goto LA30;
					i_448562 = res_448577;
					{
						TY448490 LOC33;
						Tnode225809* LOC34;
						NIM_BOOL LOC35;
						memset((void*)(&LOC33), 0, sizeof(LOC33));
						LOC33.ClPrc = matchstaraux_448489; LOC33.ClEnv = HEX3Aenvp_448620;
						LOC34 = 0;
						LOC34 = HEX5BHEX5D_226244(n, i_448562);
						LOC35 = 0;
						LOC35 = LOC33.ClEnv? LOC33.ClPrc(c, op, LOC34, arglist, rpn, LOC33.ClEnv):((TMP3325)(LOC33.ClPrc))(c, op, LOC34, arglist, rpn);
						if (!!(LOC35)) goto LA36;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA36: ;
					res_448577 += ((NI) 1);
				} LA30: ;
			}
		}
	}
	goto LA1;
	LA25: ;
	{
		NIM_BOOL LOC39;
		LOC39 = 0;
		LOC39 = checktypes_448273(c, (*(*(*HEX3Aenvp_448620).p448485).kindU.S6.sons->data[((NI) 2)]).kindU.S4.sym, n_448493);
		if (!LOC39) goto LA40;
		add_226165(arglist, n_448493);
	}
	goto LA1;
	LA40: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchnested_448482)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n, NIM_BOOL rpn) {
	NIM_BOOL result;
	TY448596* HEX3Aenv_448623;
{	result = 0;
	HEX3Aenv_448623 = 0;
	HEX3Aenv_448623 = (TY448596*) newObj((&NTI448624), sizeof(TY448596));
	asgnRefNoCycle((void**) (&(*HEX3Aenv_448623).p448485), 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;
		Tnode225809* arglist;
		LOC7 = 0;
		LOC7 = matches_448075(c, (*(*HEX3Aenv_448623).p448485).kindU.S6.sons->data[((NI) 1)], (*n).kindU.S6.sons->data[((NI) 0)]);
		if (!LOC7) goto LA8;
		arglist = newnodei_227351(((NU8) 152), (*n).info);
		{
			TY448490 LOC12;
			NIM_BOOL LOC13;
			memset((void*)(&LOC12), 0, sizeof(LOC12));
			LOC12.ClPrc = matchstaraux_448489; LOC12.ClEnv = HEX3Aenv_448623;
			LOC13 = 0;
			LOC13 = LOC12.ClEnv? LOC12.ClPrc(c, (*HEX3Aenv_448623).p448485, n, arglist, rpn, LOC12.ClEnv):((TMP3326)(LOC12.ClPrc))(c, (*HEX3Aenv_448623).p448485, n, arglist, rpn);
			if (!LOC13) goto LA14;
			result = bindorcheck_448413(c, (*(*(*HEX3Aenv_448623).p448485).kindU.S6.sons->data[((NI) 2)]).kindU.S4.sym, arglist);
		}
		LA14: ;
	}
	LA8: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, gather_448447)(Tpatterncontext448013* c, Tsym225841* param, Tnode225809* n) {
	Tnode225809* pp;
	pp = getlazy_448025(c, param);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = !((pp == NIM_NIL));
		if (!(LOC3)) goto LA4;
		LOC3 = ((*pp).kind == ((NU8) 152));
		LA4: ;
		if (!LOC3) goto LA5;
		add_226165(pp, n);
	}
	goto LA1;
	LA5: ;
	{
		pp = newnodei_227407(((NU8) 152), (*n).info, ((NI) 1));
		asgnRefNoCycle((void**) (&(*pp).kindU.S6.sons->data[((NI) 0)]), n);
		putlazy_448045(c, param, pp);
	}
	LA1: ;
}

N_NIMCALL(NIM_BOOL, matches_448075)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n_448079) {
	NIM_BOOL result;
{	result = 0;
	{
		if (!(((*n_448079).flags &(1<<((((NU8) 6))&15)))!=0)) goto LA3;
		result = NIM_FALSE;
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = ispatternparam_448320(c, p);
		if (!LOC6) goto LA7;
		result = bindorcheck_448413(c, (*p).kindU.S4.sym, n_448079);
	}
	goto LA1;
	LA7: ;
	{
		NIM_BOOL LOC10;
		LOC10 = 0;
		LOC10 = ((*n_448079).kind == ((NU8) 3));
		if (!(LOC10)) goto LA11;
		LOC10 = ((*p).kind == ((NU8) 2));
		LA11: ;
		if (!LOC10) goto LA12;
		result = ((*(*p).kindU.S5.ident).Sup.id == (*(*(*n_448079).kindU.S4.sym).name).Sup.id);
	}
	goto LA1;
	LA12: ;
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = ((*n_448079).kind == ((NU8) 3));
		if (!(LOC15)) goto LA16;
		LOC15 = insymchoice_448188(p, n_448079);
		LA16: ;
		if (!LOC15) goto LA17;
		result = NIM_TRUE;
	}
	goto LA1;
	LA17: ;
	{
		NIM_BOOL LOC20;
		LOC20 = 0;
		LOC20 = ((*n_448079).kind == ((NU8) 3));
		if (!(LOC20)) goto LA21;
		LOC20 = ((*(*n_448079).kindU.S4.sym).kind == ((NU8) 10));
		LA21: ;
		if (!LOC20) goto LA22;
		{
			if (!((*p).kind == ((NU8) 3))) goto LA26;
			result = ((*p).kindU.S4.sym == (*n_448079).kindU.S4.sym);
		}
		goto LA24;
		LA26: ;
		{
			NIM_BOOL LOC29;
			LOC29 = 0;
			LOC29 = matches_448075(c, p, (*(*n_448079).kindU.S4.sym).ast);
			if (!LOC29) goto LA30;
			result = NIM_TRUE;
		}
		goto LA24;
		LA30: ;
		LA24: ;
	}
	goto LA1;
	LA22: ;
	{
		NimStringDesc* opr;
		if (!((*p).kind == ((NU8) 153))) goto LA33;
		opr = (*(*(*p).kindU.S6.sons->data[((NI) 0)]).kindU.S5.ident).s;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3318))) goto LA35;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3319))) goto LA36;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3320))) goto LA37;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3321))) goto LA38;
		goto LA39;
		LA35: ;
		{
			result = matchchoice_448363(c, p, n_448079);
		}
		goto LA40;
		LA36: ;
		{
			result = matchnested_448482(c, p, n_448079, NIM_FALSE);
		}
		goto LA40;
		LA37: ;
		{
			result = matchnested_448482(c, p, n_448079, NIM_TRUE);
		}
		goto LA40;
		LA38: ;
		{
			NIM_BOOL LOC45;
			LOC45 = 0;
			LOC45 = matches_448075(c, (*p).kindU.S6.sons->data[((NI) 1)], n_448079);
			result = !(LOC45);
		}
		goto LA40;
		LA39: ;
		{
			internalerror_196172((*p).info, ((NimStringDesc*) &TMP3327));
		}
		LA40: ;
	}
	goto LA1;
	LA33: ;
	{
		if (!((*p).kind == ((NU8) 40))) goto LA48;
		{
			if (!((*(*p).kindU.S6.sons->data[((NI) 1)]).kind == ((NU8) 30))) goto LA52;
			{
				NIM_BOOL LOC56;
				LOC56 = 0;
				LOC56 = matches_448075(c, (*p).kindU.S6.sons->data[((NI) 0)], n_448079);
				if (!LOC56) goto LA57;
				gather_448447(c, (*(*(*p).kindU.S6.sons->data[((NI) 1)]).kindU.S6.sons->data[((NI) 1)]).kindU.S4.sym, n_448079);
				result = NIM_TRUE;
			}
			LA57: ;
		}
		goto LA50;
		LA52: ;
		{
			{
				NIM_BOOL LOC62;
				LOC62 = 0;
				LOC62 = matches_448075(c, (*p).kindU.S6.sons->data[((NI) 0)], n_448079);
				if (!LOC62) goto LA63;
				result = bindorcheck_448413(c, (*(*p).kindU.S6.sons->data[((NI) 1)]).kindU.S4.sym, n_448079);
			}
			LA63: ;
		}
		LA50: ;
	}
	goto LA1;
	LA48: ;
	{
		NIM_BOOL LOC66;
		LOC66 = 0;
		LOC66 = samekinds_448093(p, n_448079);
		if (!LOC66) goto LA67;
		switch ((*p).kind) {
		case ((NU8) 3):
		{
			result = ((*p).kindU.S4.sym == (*n_448079).kindU.S4.sym);
		}
		break;
		case ((NU8) 2):
		{
			result = ((*(*p).kindU.S5.ident).Sup.id == (*(*n_448079).kindU.S5.ident).Sup.id);
		}
		break;
		case ((NU8) 5) ... ((NU8) 10):
		{
			result = ((*p).kindU.S1.intval == (*n_448079).kindU.S1.intval);
		}
		break;
		case ((NU8) 16) ... ((NU8) 18):
		{
			result = ((*p).kindU.S2.floatval == (*n_448079).kindU.S2.floatval);
		}
		break;
		case ((NU8) 20) ... ((NU8) 22):
		{
			result = eqStrings((*p).kindU.S3.strval, (*n_448079).kindU.S3.strval);
		}
		break;
		case ((NU8) 1):
		case ((NU8) 23):
		case ((NU8) 4):
		{
			result = NIM_TRUE;
		}
		break;
		default:
		{
			NI plen;
			Tnode225809* v;
			plen = sonslen_228387(p);
			v = lastson_228406(p);
			{
				NIM_BOOL LOC78;
				Tnode225809* arglist;
				LOC78 = 0;
				LOC78 = ispatternparam_448320(c, v);
				if (!(LOC78)) goto LA79;
				LOC78 = ((*(*(*v).kindU.S4.sym).typ).kind == ((NU8) 48));
				LA79: ;
				if (!LOC78) goto LA80;
				arglist = 0;
				{
					NI LOC84;
					LOC84 = 0;
					LOC84 = sonslen_228387(n_448079);
					if (!(plen <= LOC84)) goto LA85;
					{
						NI i_448851;
						NI HEX3Atmp_448947;
						NI res_448950;
						i_448851 = 0;
						HEX3Atmp_448947 = 0;
						HEX3Atmp_448947 = (NI)(plen - ((NI) 2));
						res_448950 = ((NI) 0);
						{
							while (1) {
								if (!(res_448950 <= HEX3Atmp_448947)) goto LA89;
								i_448851 = res_448950;
								{
									NIM_BOOL LOC92;
									LOC92 = 0;
									LOC92 = matches_448075(c, (*p).kindU.S6.sons->data[i_448851], (*n_448079).kindU.S6.sons->data[i_448851]);
									if (!!(LOC92)) goto LA93;
									goto BeforeRet;
								}
								LA93: ;
								res_448950 += ((NI) 1);
							} LA89: ;
						}
					}
					{
						NIM_BOOL LOC97;
						NIM_BOOL LOC98;
						NI LOC99;
						Tnode225809* LOC101;
						Tnode225809* LOC103;
						Tnode225809* n;
						Tnode225809* LOC106;
						NI LOC107;
						LOC97 = 0;
						LOC98 = 0;
						LOC99 = 0;
						LOC99 = sonslen_228387(n_448079);
						LOC98 = (plen == LOC99);
						if (!(LOC98)) goto LA100;
						LOC101 = 0;
						LOC101 = lastson_228406(n_448079);
						LOC98 = ((*LOC101).kind == ((NU8) 58));
						LA100: ;
						LOC97 = LOC98;
						if (!(LOC97)) goto LA102;
						LOC103 = 0;
						LOC103 = lastson_228406(n_448079);
						LOC97 = ((*(*LOC103).kindU.S6.sons->data[((NI) 1)]).kind == ((NU8) 41));
						LA102: ;
						if (!LOC97) goto LA104;
						LOC106 = 0;
						LOC106 = lastson_228406(n_448079);
						n = (*LOC106).kindU.S6.sons->data[((NI) 1)];
						LOC107 = 0;
						LOC107 = len_226098(n);
						arglist = newnodei_227407(((NU8) 152), (*n).info, LOC107);
						{
							NI i_448895;
							NI HEX3Atmp_448955;
							NI LOC109;
							NI res_448958;
							i_448895 = 0;
							HEX3Atmp_448955 = 0;
							LOC109 = 0;
							LOC109 = len_226098(n);
							HEX3Atmp_448955 = (LOC109 - 1);
							res_448958 = ((NI) 0);
							{
								while (1) {
									if (!(res_448958 <= HEX3Atmp_448955)) goto LA111;
									i_448895 = res_448958;
									asgnRefNoCycle((void**) (&(*arglist).kindU.S6.sons->data[i_448895]), (*n).kindU.S6.sons->data[i_448895]);
									res_448958 += ((NI) 1);
								} LA111: ;
							}
						}
					}
					goto LA95;
					LA104: ;
					{
						NI LOC113;
						LOC113 = 0;
						LOC113 = sonslen_228387(n_448079);
						arglist = newnodei_227407(((NU8) 152), (*n_448079).info, (NI)((NI)(LOC113 - plen) + ((NI) 1)));
						{
							NI i_448910;
							NI HEX3Atmp_448963;
							NI LOC115;
							NI res_448966;
							i_448910 = 0;
							HEX3Atmp_448963 = 0;
							LOC115 = 0;
							LOC115 = sonslen_228387(n_448079);
							HEX3Atmp_448963 = (NI)(LOC115 - plen);
							res_448966 = ((NI) 0);
							{
								while (1) {
									if (!(res_448966 <= HEX3Atmp_448963)) goto LA117;
									i_448910 = res_448966;
									asgnRefNoCycle((void**) (&(*arglist).kindU.S6.sons->data[i_448910]), (*n_448079).kindU.S6.sons->data[(NI)((NI)(i_448910 + plen) - ((NI) 1))]);
									res_448966 += ((NI) 1);
								} LA117: ;
							}
						}
					}
					LA95: ;
					result = bindorcheck_448413(c, (*v).kindU.S4.sym, arglist);
					goto BeforeRet;
				}
				goto LA82;
				LA85: ;
				{
					NI LOC119;
					LOC119 = 0;
					LOC119 = sonslen_228387(n_448079);
					if (!((NI)(plen - ((NI) 1)) == LOC119)) goto LA120;
					{
						NI i_448926;
						NI HEX3Atmp_448971;
						NI res_448974;
						i_448926 = 0;
						HEX3Atmp_448971 = 0;
						HEX3Atmp_448971 = (NI)(plen - ((NI) 2));
						res_448974 = ((NI) 0);
						{
							while (1) {
								if (!(res_448974 <= HEX3Atmp_448971)) goto LA124;
								i_448926 = res_448974;
								{
									NIM_BOOL LOC127;
									LOC127 = 0;
									LOC127 = matches_448075(c, (*p).kindU.S6.sons->data[i_448926], (*n_448079).kindU.S6.sons->data[i_448926]);
									if (!!(LOC127)) goto LA128;
									goto BeforeRet;
								}
								LA128: ;
								res_448974 += ((NI) 1);
							} LA124: ;
						}
					}
					arglist = newnodei_227351(((NU8) 152), (*n_448079).info);
					result = bindorcheck_448413(c, (*v).kindU.S4.sym, arglist);
					goto BeforeRet;
				}
				goto LA82;
				LA120: ;
				LA82: ;
			}
			LA80: ;
			{
				NI LOC132;
				LOC132 = 0;
				LOC132 = sonslen_228387(n_448079);
				if (!(plen == LOC132)) goto LA133;
				{
					NI i_448942;
					NI HEX3Atmp_448979;
					NI LOC136;
					NI res_448982;
					i_448942 = 0;
					HEX3Atmp_448979 = 0;
					LOC136 = 0;
					LOC136 = sonslen_228387(p);
					HEX3Atmp_448979 = (NI)(LOC136 - ((NI) 1));
					res_448982 = ((NI) 0);
					{
						while (1) {
							if (!(res_448982 <= HEX3Atmp_448979)) goto LA138;
							i_448942 = res_448982;
							{
								NIM_BOOL LOC141;
								LOC141 = 0;
								LOC141 = matches_448075(c, (*p).kindU.S6.sons->data[i_448942], (*n_448079).kindU.S6.sons->data[i_448942]);
								if (!!(LOC141)) goto LA142;
								goto BeforeRet;
							}
							LA142: ;
							res_448982 += ((NI) 1);
						} LA138: ;
					}
				}
				result = NIM_TRUE;
			}
			LA133: ;
		}
		break;
		}
	}
	goto LA1;
	LA67: ;
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchrange_449043)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n, NI i) {
	NIM_BOOL result;
{	result = 0;
	{
		NI j_449069;
		NI HEX3Atmp_449081;
		NI LOC2;
		NI res_449084;
		j_449069 = 0;
		HEX3Atmp_449081 = 0;
		LOC2 = 0;
		LOC2 = len_226098(p);
		HEX3Atmp_449081 = (LOC2 - 1);
		res_449084 = ((NI) 0);
		{
			while (1) {
				if (!(res_449084 <= HEX3Atmp_449081)) goto LA4;
				j_449069 = res_449084;
				{
					NIM_BOOL LOC7;
					LOC7 = 0;
					LOC7 = matches_448075(c, (*p).kindU.S6.sons->data[j_449069], (*n).kindU.S6.sons->data[(NI)(i + j_449069)]);
					if (!!(LOC7)) goto LA8;
					{
						if (!!((*c).mapping == 0)) goto LA12;
						genericSeqAssign((&(*c).mapping), NIM_NIL, (&NTI225803));
					}
					LA12: ;
					result = NIM_FALSE;
					goto BeforeRet;
				}
				LA8: ;
				res_449084 += ((NI) 1);
			} LA4: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tnode225809*, matchstmtlist_449037)(Tpatterncontext448013* c, Tnode225809* p, Tnode225809* n_449041) {
	Tnode225809* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		NI LOC7;
		NI LOC8;
		Tnode225809* n;
		LOC3 = 0;
		LOC4 = 0;
		LOC4 = ((*p).kind == ((NU8) 115));
		if (!(LOC4)) goto LA5;
		LOC4 = ((*n_449041).kind == (*p).kind);
		LA5: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA6;
		LOC7 = 0;
		LOC7 = len_226098(p);
		LOC8 = 0;
		LOC8 = len_226098(n_449041);
		LOC3 = (LOC7 < LOC8);
		LA6: ;
		if (!LOC3) goto LA9;
		n = flattenstmts_254773(n_449041);
		{
			NI i_449121;
			NI HEX3Atmp_449129;
			NI LOC12;
			NI LOC13;
			NI res_449132;
			i_449121 = 0;
			HEX3Atmp_449129 = 0;
			LOC12 = 0;
			LOC12 = len_226098(n);
			LOC13 = 0;
			LOC13 = len_226098(p);
			HEX3Atmp_449129 = (NI)(LOC12 - LOC13);
			res_449132 = ((NI) 0);
			{
				while (1) {
					if (!(res_449132 <= HEX3Atmp_449129)) goto LA15;
					i_449121 = res_449132;
					{
						NIM_BOOL LOC18;
						NI LOC21;
						NI LOC22;
						NI LOC23;
						LOC18 = 0;
						LOC18 = matchrange_449043(c, p, n, i_449121);
						if (!LOC18) goto LA19;
						(*c).submatch = NIM_TRUE;
						result = newnodei_227407(((NU8) 115), (*n).info, ((NI) 3));
						asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 0)]), extractrange_254785(((NU8) 115), n, ((NI) 0), (NI)(i_449121 - ((NI) 1))));
						LOC21 = 0;
						LOC21 = len_226098(p);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 1)]), extractrange_254785(((NU8) 115), n, i_449121, (NI)((NI)(i_449121 + LOC21) - ((NI) 1))));
						LOC22 = 0;
						LOC22 = len_226098(p);
						LOC23 = 0;
						LOC23 = len_226098(n);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[((NI) 2)]), extractrange_254785(((NU8) 115), n, (NI)(i_449121 + LOC22), (NI)(LOC23 - ((NI) 1))));
						goto LA11;
					}
					LA19: ;
					res_449132 += ((NI) 1);
				} LA15: ;
			}
		} LA11: ;
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC25;
		LOC25 = 0;
		LOC25 = matches_448075(c, p, n_449041);
		if (!LOC25) goto LA26;
		result = n_449041;
	}
	goto LA1;
	LA26: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, aliasanalysisrequested_449163)(Tnode225809* params) {
	NIM_BOOL result;
{	result = 0;
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = len_226098(params);
		if (!(((NI) 2) <= LOC3)) goto LA4;
		{
			NI i_449187;
			NI HEX3Atmp_449201;
			NI LOC7;
			NI res_449204;
			i_449187 = 0;
			HEX3Atmp_449201 = 0;
			LOC7 = 0;
			LOC7 = len_226098(params);
			HEX3Atmp_449201 = (LOC7 - 1);
			res_449204 = ((NI) 1);
			{
				while (1) {
					Tsym225841* param;
					if (!(res_449204 <= HEX3Atmp_449201)) goto LA9;
					i_449187 = res_449204;
					param = (*(*params).kindU.S6.sons->data[i_449187]).kindU.S4.sym;
					{
						NU8 LOC12;
						LOC12 = 0;
						LOC12 = whichalias_305080(param);
						if (!!((LOC12 == ((NU8) 1)))) goto LA13;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA13: ;
					res_449204 += ((NI) 1);
				} LA9: ;
			}
		}
	}
	LA4: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, addtoarglist_449223)(Tnode225809* result, Tnode225809* 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) 152)))) goto LA9;
			add_226165(result, n);
		}
		goto LA7;
		LA9: ;
		{
			{
				NI i_449277;
				NI HEX3Atmp_449281;
				NI LOC13;
				NI res_449284;
				i_449277 = 0;
				HEX3Atmp_449281 = 0;
				LOC13 = 0;
				LOC13 = len_226098(n);
				HEX3Atmp_449281 = (LOC13 - 1);
				res_449284 = ((NI) 0);
				{
					while (1) {
						if (!(res_449284 <= HEX3Atmp_449281)) goto LA15;
						i_449277 = res_449284;
						add_226165(result, (*n).kindU.S6.sons->data[i_449277]);
						res_449284 += ((NI) 1);
					} LA15: ;
				}
			}
		}
		LA7: ;
	}
	LA5: ;
}

N_NIMCALL(Tnode225809*, applyrule_449303)(Tcontext280023* c, Tsym225841* s, Tnode225809* n) {
	Tnode225809* result;
	Tpatterncontext448013 ctx;
	NI LOC1;
	Tnode225809* m;
	Tnode225809* LOC6;
	Tnode225809* params;
	NIM_BOOL requiresaa;
	Tnode225809* args;
{	result = 0;
	memset((void*)(&ctx), 0, sizeof(ctx));
	ctx.owner = s;
	ctx.c = c;
	LOC1 = 0;
	LOC1 = sonslen_228351((*s).typ);
	ctx.formals = (NI)(LOC1 - ((NI) 1));
	m = matchstmtlist_449037((&ctx), (*(*s).ast).kindU.S6.sons->data[((NI) 1)], n);
	{
		if (!m == 0) goto LA4;
		result = NIM_NIL;
		goto BeforeRet;
	}
	LA4: ;
	result = newnodei_227351(((NU8) 27), (*n).info);
	LOC6 = 0;
	LOC6 = newsymnode_227338(s, (*n).info);
	add_226165(result, LOC6);
	params = (*(*s).typ).n;
	requiresaa = aliasanalysisrequested_449163(params);
	args = 0;
	{
		if (!requiresaa) goto LA9;
		args = newnodei_227351(((NU8) 152), (*n).info);
	}
	LA9: ;
	{
		NI i_449347;
		NI HEX3Atmp_449605;
		NI LOC12;
		NI res_449608;
		i_449347 = 0;
		HEX3Atmp_449605 = 0;
		LOC12 = 0;
		LOC12 = len_226098(params);
		HEX3Atmp_449605 = (LOC12 - 1);
		res_449608 = ((NI) 1);
		{
			while (1) {
				Tsym225841* param;
				Tnode225809* x;
				if (!(res_449608 <= HEX3Atmp_449605)) goto LA14;
				i_449347 = res_449608;
				param = (*(*params).kindU.S6.sons->data[i_449347]).kindU.S4.sym;
				x = getlazy_448025((&ctx), param);
				{
					if (!x == 0) goto LA17;
					result = NIM_NIL;
					goto BeforeRet;
				}
				LA17: ;
				add_226165(result, x);
				{
					if (!requiresaa) goto LA21;
					addtoarglist_449223(args, x);
				}
				LA21: ;
				res_449608 += ((NI) 1);
			} LA14: ;
		}
	}
	{
		if (!requiresaa) goto LA25;
		{
			NI i_449381;
			NI HEX3Atmp_449635;
			NI LOC28;
			NI res_449638;
			i_449381 = 0;
			HEX3Atmp_449635 = 0;
			LOC28 = 0;
			LOC28 = len_226098(params);
			HEX3Atmp_449635 = (LOC28 - 1);
			res_449638 = ((NI) 1);
			{
				while (1) {
					Tnode225809* rs;
					Tsym225841* param;
					NU8 LOC31;
					if (!(res_449638 <= HEX3Atmp_449635)) goto LA30;
					i_449381 = res_449638;
					rs = (*result).kindU.S6.sons->data[i_449381];
					param = (*(*params).kindU.S6.sons->data[i_449381]).kindU.S4.sym;
					LOC31 = 0;
					LOC31 = whichalias_305080(param);
					switch (LOC31) {
					case ((NU8) 1):
					{
					}
					break;
					case ((NU8) 2):
					{
						NIM_BOOL ok;
						ok = NIM_FALSE;
						{
							Tnode225809* arg_449388;
							arg_449388 = 0;
							{
								NI i_449617;
								NI HEX3Atmp_449619;
								NI LOC36;
								NI res_449621;
								i_449617 = 0;
								HEX3Atmp_449619 = 0;
								LOC36 = 0;
								LOC36 = len_226098(args);
								HEX3Atmp_449619 = (LOC36 - 1);
								res_449621 = ((NI) 0);
								{
									while (1) {
										if (!(res_449621 <= HEX3Atmp_449619)) goto LA38;
										i_449617 = res_449621;
										arg_449388 = (*args).kindU.S6.sons->data[i_449617];
										{
											NIM_BOOL LOC41;
											NU8 LOC43;
											LOC41 = 0;
											LOC41 = !((arg_449388 == rs));
											if (!(LOC41)) goto LA42;
											LOC43 = 0;
											LOC43 = ispartof_447375(rs, arg_449388);
											LOC41 = (LOC43 == ((NU8) 2));
											LA42: ;
											if (!LOC41) goto LA44;
											ok = NIM_TRUE;
											goto LA34;
										}
										LA44: ;
										res_449621 += ((NI) 1);
									} LA38: ;
								}
							}
						} LA34: ;
						{
							if (!!(ok)) goto LA48;
							result = NIM_NIL;
							goto BeforeRet;
						}
						LA48: ;
					}
					break;
					case ((NU8) 3):
					{
						NIM_BOOL ok;
						ok = NIM_TRUE;
						{
							Tnode225809* arg_449410;
							arg_449410 = 0;
							{
								NI i_449628;
								NI HEX3Atmp_449630;
								NI LOC53;
								NI res_449632;
								i_449628 = 0;
								HEX3Atmp_449630 = 0;
								LOC53 = 0;
								LOC53 = len_226098(args);
								HEX3Atmp_449630 = (LOC53 - 1);
								res_449632 = ((NI) 0);
								{
									while (1) {
										if (!(res_449632 <= HEX3Atmp_449630)) goto LA55;
										i_449628 = res_449632;
										arg_449410 = (*args).kindU.S6.sons->data[i_449628];
										{
											NIM_BOOL LOC58;
											NU8 LOC60;
											LOC58 = 0;
											LOC58 = !((arg_449410 == rs));
											if (!(LOC58)) goto LA59;
											LOC60 = 0;
											LOC60 = ispartof_447375(rs, arg_449410);
											LOC58 = !((LOC60 == ((NU8) 0)));
											LA59: ;
											if (!LOC58) goto LA61;
											ok = NIM_FALSE;
											goto LA51;
										}
										LA61: ;
										res_449632 += ((NI) 1);
									} LA55: ;
								}
							}
						} LA51: ;
						{
							if (!!(ok)) goto LA65;
							result = NIM_NIL;
							goto BeforeRet;
						}
						LA65: ;
					}
					break;
					}
					res_449638 += ((NI) 1);
				} LA30: ;
			}
		}
	}
	LA25: ;
	markused_388253((*n).info, s);
	{
		if (!ctx.submatch) goto LA69;
		asgnRefNoCycle((void**) (&(*m).kindU.S6.sons->data[((NI) 1)]), result);
		result = m;
	}
	LA69: ;
	}BeforeRet: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_patternsInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_patternsDatInit000)(void) {
static TNimNode* TMP3322[2];
static TNimNode TMP1027[3];
NTI448596.size = sizeof(TY448596);
NTI448596.kind = 18;
NTI448596.base = 0;
NTI448596.flags = 2;
TMP3322[0] = &TMP1027[1];
TMP1027[1].kind = 1;
TMP1027[1].offset = offsetof(TY448596, HEX3Astate);
TMP1027[1].typ = (&NTI346033);
TMP1027[1].name = ":state";
TMP3322[1] = &TMP1027[2];
TMP1027[2].kind = 1;
TMP1027[2].offset = offsetof(TY448596, p448485);
TMP1027[2].typ = (&NTI225801);
TMP1027[2].name = "p448485";
TMP1027[0].len = 2; TMP1027[0].kind = 2; TMP1027[0].sons = &TMP3322[0];
NTI448596.node = &TMP1027[0];
NTI448624.size = sizeof(TY448596*);
NTI448624.kind = 22;
NTI448624.base = (&NTI448596);
NTI448624.flags = 2;
NTI448624.marker = TMP3323;
}

