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

#include <string.h>
typedef struct tnode226816 tnode226816;
typedef struct tcontext291021 tcontext291021;
typedef struct tsym226846 tsym226846;
typedef struct tpatterncontext480013 tpatterncontext480013;
typedef struct tnodeseq226810 tnodeseq226810;
typedef struct TGenericSeq TGenericSeq;
typedef struct ttype226852 ttype226852;
typedef struct tidobj201015 tidobj201015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq226848 ttypeseq226848;
typedef struct tloc226830 tloc226830;
typedef struct trope178009 trope178009;
typedef struct tscope226840 tscope226840;
typedef struct TY226947 TY226947;
typedef struct tinstantiation226836 tinstantiation226836;
typedef struct tstrtable226820 tstrtable226820;
typedef struct tsymseq226818 tsymseq226818;
typedef struct tident201021 tident201021;
typedef struct tlineinfo196539 tlineinfo196539;
typedef struct tlib226834 tlib226834;
typedef struct NimStringDesc NimStringDesc;
typedef struct tcell44733 tcell44733;
typedef struct tcellseq44749 tcellseq44749;
typedef struct tgcheap46816 tgcheap46816;
typedef struct tcellset44745 tcellset44745;
typedef struct tpagedesc44741 tpagedesc44741;
typedef struct tmemregion27010 tmemregion27010;
typedef struct tsmallchunk26240 tsmallchunk26240;
typedef struct tllchunk27004 tllchunk27004;
typedef struct tbigchunk26242 tbigchunk26242;
typedef struct tintset26217 tintset26217;
typedef struct ttrunk26213 ttrunk26213;
typedef struct tavlnode27008 tavlnode27008;
typedef struct tgcstat46814 tgcstat46814;
typedef struct TY481062 TY481062;
typedef struct tpasscontext287005 tpasscontext287005;
typedef struct tproccon291011 tproccon291011;
typedef struct intset223056 intset223056;
typedef struct ttrunk223052 ttrunk223052;
typedef struct ttrunkseq223054 ttrunkseq223054;
typedef struct tlinkedlist129028 tlinkedlist129028;
typedef struct tlistentry129022 tlistentry129022;
typedef struct tidtable226864 tidtable226864;
typedef struct tidpairseq226862 tidpairseq226862;
typedef struct tidpair226860 tidpair226860;
typedef struct tctx290048 tctx290048;
typedef struct TY291133 TY291133;
typedef struct tinstantiationpair291013 tinstantiationpair291013;
typedef struct TY226936 TY226936;
typedef struct tbasechunk26238 tbasechunk26238;
typedef struct tfreecell26230 tfreecell26230;
typedef struct TY290250 TY290250;
typedef struct TY197414 TY197414;
typedef struct pprocHEX3Aobjecttype290230 pprocHEX3Aobjecttype290230;
typedef struct TY290269 TY290269;
typedef struct TY290270 TY290270;
typedef struct vmargs290042 vmargs290042;
typedef struct TY290231 TY290231;
typedef struct tblock290030 tblock290030;
typedef struct TY290211 TY290211;
typedef struct TY290237 TY290237;
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tpatterncontext480013  {
tsym226846* Owner;
tnodeseq226810* Mapping;
NI Formals;
tcontext291021* 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  tidobj201015  {
  TNimObject Sup;
NI Id;
};
struct  tloc226830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype226852* T;
trope178009* R;
trope178009* Heaproot;
};
struct  ttype226852  {
  tidobj201015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq226848* Sons;
tnode226816* N;
tsym226846* Owner;
tsym226846* Sym;
tsym226846* Destructor;
tsym226846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc226830 Loc;
};
struct  tstrtable226820  {
NI Counter;
tsymseq226818* Data;
};
struct  tlineinfo196539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tsym226846  {
  tidobj201015 Sup;
NU8 Kind;
union {
struct {ttypeseq226848* Typeinstcache;
tscope226840* Typscope;
} S1;
struct {TY226947* Procinstcache;
tscope226840* Scope;
} S2;
struct {TY226947* Usedgenerics;
tstrtable226820 Tab;
} S3;
struct {tsym226846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype226852* Typ;
tident201021* Name;
tlineinfo196539 Info;
tsym226846* Owner;
NU32 Flags;
tnode226816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc226830 Loc;
tlib226834* Annex;
tnode226816* Constraint;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tnode226816  {
ttype226852* Typ;
tlineinfo196539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym226846* Sym;
} S4;
struct {tident201021* Ident;
} S5;
struct {tnodeseq226810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  tident201021  {
  tidobj201015 Sup;
NimStringDesc* S;
tident201021* Next;
NI H;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tcell44733  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44749  {
NI Len;
NI Cap;
tcell44733** D;
};
struct  tcellset44745  {
NI Counter;
NI Max;
tpagedesc44741* Head;
tpagedesc44741** Data;
};
typedef tsmallchunk26240* TY27022[512];
typedef ttrunk26213* ttrunkbuckets26215[256];
struct  tintset26217  {
ttrunkbuckets26215 Data;
};
struct  tmemregion27010  {
NI Minlargeobj;
NI Maxlargeobj;
TY27022 Freesmallchunks;
tllchunk27004* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26242* Freechunkslist;
tintset26217 Chunkstarts;
tavlnode27008* Root;
tavlnode27008* Deleted;
tavlnode27008* Last;
tavlnode27008* Freeavlnodes;
};
struct  tgcstat46814  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap46816  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44749 Zct;
tcellseq44749 Decstack;
tcellset44745 Cycleroots;
tcellseq44749 Tempstack;
NI Recgclock;
tmemregion27010 Region;
tgcstat46814 Stat;
};
struct  TY481062  {
NI HEX3Astate;
tnode226816* P480805;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClPrc) (tpatterncontext480013* c, tnode226816* op, tnode226816* n_480813, tnode226816* arglist, NIM_BOOL rpn, void* ClEnv);
void* ClEnv;
} TY480810;
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3067) (tpatterncontext480013* c, tnode226816* op, tnode226816* n_480813, tnode226816* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3068) (tpatterncontext480013* c, tnode226816* op, tnode226816* n_480813, tnode226816* arglist, NIM_BOOL rpn);
typedef N_CLOSURE_PTR(NIM_BOOL, TMP3069) (tpatterncontext480013* c, tnode226816* op, tnode226816* n_480813, tnode226816* arglist, NIM_BOOL rpn);
struct  tpasscontext287005  {
  TNimObject Sup;
NIM_BOOL Fromcache;
};
struct  intset223056  {
NI Counter;
NI Max;
ttrunk223052* Head;
ttrunkseq223054* Data;
};
struct  tlinkedlist129028  {
tlistentry129022* Head;
tlistentry129022* Tail;
NI Counter;
};
struct  tidpair226860  {
tidobj201015* Key;
TNimObject* Val;
};
struct  tidtable226864  {
NI Counter;
tidpairseq226862* Data;
};
typedef N_NIMCALL_PTR(tnode226816*, TY291064) (tcontext291021* c, tnode226816* n);
typedef N_NIMCALL_PTR(tnode226816*, TY291069) (tcontext291021* c, tnode226816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode226816*, TY291077) (tcontext291021* c, tnode226816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode226816*, TY291085) (tcontext291021* c, tnode226816* n);
typedef N_NIMCALL_PTR(tnode226816*, TY291090) (tcontext291021* c, tnode226816* n, NU16 flags);
typedef N_NIMCALL_PTR(tnode226816*, TY291098) (tcontext291021* c, tnode226816* n);
typedef N_NIMCALL_PTR(tnode226816*, TY291103) (tcontext291021* c, tnode226816* n, tnode226816* norig, NU32 filter);
typedef N_NIMCALL_PTR(ttype226852*, TY291110) (tcontext291021* c, tnode226816* n, ttype226852* prev);
typedef struct {
N_NIMCALL_PTR(tnode226816*, ClPrc) (tcontext291021* c, tidtable226864 pt, tnode226816* n, void* ClEnv);
void* ClEnv;
} TY291116;
typedef struct {
N_NIMCALL_PTR(tsym226846*, ClPrc) (tcontext291021* c, tsym226846* fn, tidtable226864 pt, tlineinfo196539 info, void* ClEnv);
void* ClEnv;
} TY291122;
struct  tinstantiationpair291013  {
tsym226846* Genericsym;
tinstantiation226836* Inst;
};
typedef N_NIMCALL_PTR(tsym226846*, TY291138) (tcontext291021* c, tsym226846* dc, ttype226852* t, tlineinfo196539 info);
struct  tcontext291021  {
  tpasscontext287005 Sup;
tsym226846* Module;
tscope226840* Currentscope;
tscope226840* Importtable;
tscope226840* Toplevelscope;
tproccon291011* P;
tsymseq226818* Friendmodules;
NI Instcounter;
intset223056 Ambiguoussymbols;
NI Intypeclass;
NI Ingenericcontext;
NI Inunrolledcontext;
NI Incompilescontext;
NI Ingenericinst;
tsymseq226818* Converters;
tsymseq226818* Patterns;
tlinkedlist129028 Optionstack;
tidtable226864 Symmapping;
tlinkedlist129028 Libs;
TY291064 Semconstexpr;
TY291069 Semexpr;
TY291077 Semtryexpr;
TY291085 Semtryconstexpr;
TY291090 Semoperand;
TY291098 Semconstboolexpr;
TY291103 Semoverloadedcall;
TY291110 Semtypenode;
TY291116 Seminferredlambda;
TY291122 Semgenerateinstance;
intset223056 Includedfiles;
tstrtable226820 Userpragmas;
tctx290048* Evalcontext;
intset223056 Unknownidents;
TY291133* Generics;
NI Lastgenericidx;
NI Hloloopdetector;
NI Inparallelstmt;
TY291138 Instdeepcopy;
};
struct  trope178009  {
  TNimObject Sup;
trope178009* Left;
trope178009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tscope226840  {
NI Depthlevel;
tstrtable226820 Symbols;
tnodeseq226810* Usingsyms;
tscope226840* Parent;
};
struct  tinstantiation226836  {
tsym226846* Sym;
ttypeseq226848* Concretetypes;
TY226936* Usedby;
};
struct  tlistentry129022  {
  TNimObject Sup;
tlistentry129022* Prev;
tlistentry129022* Next;
};
struct  tlib226834  {
  tlistentry129022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope178009* Name;
tnode226816* Path;
};
typedef NI TY26220[8];
struct  tpagedesc44741  {
tpagedesc44741* Next;
NI Key;
TY26220 Bits;
};
struct  tbasechunk26238  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26240  {
  tbasechunk26238 Sup;
tsmallchunk26240* Next;
tsmallchunk26240* Prev;
tfreecell26230* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27004  {
NI Size;
NI Acc;
tllchunk27004* Next;
};
struct  tbigchunk26242  {
  tbasechunk26238 Sup;
tbigchunk26242* Next;
tbigchunk26242* Prev;
NI Align;
NF Data;
};
struct  ttrunk26213  {
ttrunk26213* Next;
NI Key;
TY26220 Bits;
};
typedef tavlnode27008* TY27014[2];
struct  tavlnode27008  {
TY27014 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tproccon291011  {
tsym226846* Owner;
tsym226846* Resultsym;
NI Nestedloopcounter;
NI Nestedblockcounter;
NI Intrystmt;
tproccon291011* Next;
};
struct  ttrunk223052  {
ttrunk223052* Next;
NI Key;
TY26220 Bits;
};
struct  vmargs290042  {
NI Ra;
NI Rb;
NI Rc;
void* Slots;
tnode226816* Currentexception;
};
typedef struct {
N_NIMCALL_PTR(void, ClPrc) (vmargs290042* args, void* ClEnv);
void* ClEnv;
} vmcallback290044;
struct TY290270 {
NimStringDesc* Field0;
vmcallback290044 Field1;
};
struct  tctx290048  {
  tpasscontext287005 Sup;
TY290250* Code;
TY197414* Debug;
tnode226816* Globals;
tnode226816* Constants;
ttypeseq226848* Types;
tnode226816* Currentexceptiona;
tnode226816* Currentexceptionb;
NI Exceptioninstr;
pprocHEX3Aobjecttype290230* Prc;
tsym226846* Module;
tnode226816* Callsite;
NU8 Mode;
NU8 Features;
NIM_BOOL Traceactive;
NI Loopiterations;
tlineinfo196539 Comesfromheuristic;
TY290269* Callbacks;
NimStringDesc* Errorflag;
};
struct  tfreecell26230  {
tfreecell26230* Next;
NI Zerofield;
};
struct  tblock290030  {
tsym226846* Label;
TY290211* Fixups;
};
struct TY290237 {
NIM_BOOL Field0;
NU8 Field1;
};
typedef TY290237 TY290234[256];
struct  pprocHEX3Aobjecttype290230  {
TY290231* Blocks;
tsym226846* Sym;
TY290234 Slots;
NI Maxslots;
};
struct tnodeseq226810 {
  TGenericSeq Sup;
  tnode226816* data[SEQ_DECL_SIZE];
};
struct ttypeseq226848 {
  TGenericSeq Sup;
  ttype226852* data[SEQ_DECL_SIZE];
};
struct TY226947 {
  TGenericSeq Sup;
  tinstantiation226836* data[SEQ_DECL_SIZE];
};
struct tsymseq226818 {
  TGenericSeq Sup;
  tsym226846* data[SEQ_DECL_SIZE];
};
struct ttrunkseq223054 {
  TGenericSeq Sup;
  ttrunk223052* data[SEQ_DECL_SIZE];
};
struct tidpairseq226862 {
  TGenericSeq Sup;
  tidpair226860 data[SEQ_DECL_SIZE];
};
struct TY291133 {
  TGenericSeq Sup;
  tinstantiationpair291013 data[SEQ_DECL_SIZE];
};
struct TY226936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
struct TY290250 {
  TGenericSeq Sup;
  NU32 data[SEQ_DECL_SIZE];
};
struct TY197414 {
  TGenericSeq Sup;
  tlineinfo196539 data[SEQ_DECL_SIZE];
};
struct TY290269 {
  TGenericSeq Sup;
  TY290270 data[SEQ_DECL_SIZE];
};
struct TY290211 {
  TGenericSeq Sup;
  NI data[SEQ_DECL_SIZE];
};
struct TY290231 {
  TGenericSeq Sup;
  tblock290030 data[SEQ_DECL_SIZE];
};
static N_INLINE(NI, sonslen_227255)(ttype226852* n);
N_NIMCALL(tnode226816*, matchstmtlist_482196)(tpatterncontext480013* c, tnode226816* p, tnode226816* n_482200);
static N_INLINE(NI, len_227364)(tnode226816* n);
N_NIMCALL(tnode226816*, flattenstmts_263416)(tnode226816* n);
N_NIMCALL(NIM_BOOL, matchrange_482202)(tpatterncontext480013* c, tnode226816* p, tnode226816* n, NI i);
N_NIMCALL(NIM_BOOL, matches_480085)(tpatterncontext480013* c, tnode226816* p, tnode226816* n_480089);
static N_INLINE(NIM_BOOL, ispatternparam_480575)(tpatterncontext480013* c, tnode226816* p);
N_NIMCALL(NIM_BOOL, bindorcheck_480711)(tpatterncontext480013* c, tsym226846* param, tnode226816* n);
N_NIMCALL(tnode226816*, getlazy_480025)(tpatterncontext480013* c, tsym226846* sym);
N_NIMCALL(NIM_BOOL, sametrees_480132)(tnode226816* a, tnode226816* b);
static N_INLINE(NIM_BOOL, samekinds_480103)(tnode226816* a, tnode226816* b);
N_NIMCALL(NU8, canonkind_480093)(tnode226816* n);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NIM_BOOL, sametypeornil_269367)(ttype226852* a, ttype226852* b, NU8 flags);
static N_INLINE(NI, sonslen_227249)(tnode226816* n);
N_NIMCALL(NIM_BOOL, checktypes_480521)(tpatterncontext480013* c, tsym226846* p, tnode226816* n);
N_NIMCALL(NIM_BOOL, matchnodekinds_323381)(tnode226816* p, tnode226816* n);
N_NIMCALL(NIM_BOOL, argtypematches_415484)(tcontext291021* c, ttype226852* f, ttype226852* a);
N_NIMCALL(void, putlazy_480047)(tpatterncontext480013* c, tsym226846* sym, tnode226816* 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(tcell44733*, usrtocell_48446)(void* usr);
static N_INLINE(void, rtladdzct_50004)(tcell44733* c);
N_NOINLINE(void, addzct_48417)(tcellseq44749* s, tcell44733* c);
N_NIMCALL(NIM_BOOL, insymchoice_480355)(tnode226816* sc, tnode226816* x);
N_NIMCALL(NIM_BOOL, matchchoice_480648)(tpatterncontext480013* c, tnode226816* p, tnode226816* n);
N_NIMCALL(NIM_BOOL, matchnested_480802)(tpatterncontext480013* c, tnode226816* p, tnode226816* n, NIM_BOOL rpn);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP3066)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(tnode226816*, newnodei_227138)(NU8 kind, tlineinfo196539 info);
N_CLOSURE(NIM_BOOL, matchstaraux_480809)(tpatterncontext480013* c, tnode226816* op, tnode226816* n_480813, tnode226816* arglist, NIM_BOOL rpn, void* ClEnv);
static N_INLINE(tnode226816*, HEX5BHEX5D_227698)(tnode226816* n, NI i);
N_NIMCALL(void, add_227498)(tnode226816* father, tnode226816* son);
N_NIMCALL(void, internalerror_198987)(tlineinfo196539 info, NimStringDesc* errmsg);
N_NIMCALL(void, gather_480750)(tpatterncontext480013* c, tsym226846* param, tnode226816* n);
N_NIMCALL(tnode226816*, newnodei_229007)(NU8 kind, tlineinfo196539 info, NI children);
static N_INLINE(tnode226816*, lastson_227261)(tnode226816* n);
N_NIMCALL(void, genericSeqAssign)(void* dest, void* src_81204, TNimType* mt);
N_NIMCALL(tnode226816*, extractrange_263440)(NU8 k, tnode226816* n, NI a, NI b);
N_NIMCALL(tnode226816*, newsymnode_228754)(tsym226846* sym, tlineinfo196539 info);
N_NIMCALL(NIM_BOOL, aliasanalysisrequested_482382)(tnode226816* params);
N_NIMCALL(NU8, whichalias_322080)(tsym226846* p);
N_NIMCALL(void, addtoarglist_482467)(tnode226816* result, tnode226816* n);
N_NIMCALL(NU8, ispartof_479430)(tnode226816* a, tnode226816* b);
N_NIMCALL(void, markused_406251)(tlineinfo196539 info, tsym226846* s);
STRING_LITERAL(TMP3061, "|", 1);
STRING_LITERAL(TMP3062, "*", 1);
STRING_LITERAL(TMP3063, "**", 2);
STRING_LITERAL(TMP3064, "~", 1);
STRING_LITERAL(TMP3070, "invalid pattern", 15);
extern TNimType NTI226810; /* TNodeSeq */
extern tgcheap46816 gch_46844;
TNimType NTI481062; /* object */
extern TNimType NTI358033; /* range -1..0(int) */
extern TNimType NTI226808; /* PNode */
TNimType NTI481090; /* ref object */

static N_INLINE(NI, sonslen_227255)(ttype226852* 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_227364)(tnode226816* 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_480575)(tpatterncontext480013* c, tnode226816* 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(tnode226816*, getlazy_480025)(tpatterncontext480013* c, tsym226846* sym) {
	tnode226816* result;
	result = 0;
	{
		if (!!((*c).Mapping == 0)) goto LA3;
		result = (*c).Mapping->data[(*sym).Position];
	}
	LA3: ;
	return result;
}

N_NIMCALL(NU8, canonkind_480093)(tnode226816* 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_480103)(tnode226816* a, tnode226816* 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_480093(a);
	LOC4 = 0;
	LOC4 = canonkind_480093(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)), (NI64)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, sonslen_227249)(tnode226816* 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_480132)(tnode226816* a, tnode226816* b) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = samekinds_480103(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_269367((*a).Typ, (*b).Typ, 0);
		}
		break;
		default:
		{
			{
				NI LOC16;
				NI LOC17;
				LOC16 = 0;
				LOC16 = sonslen_227249(a);
				LOC17 = 0;
				LOC17 = sonslen_227249(b);
				if (!(LOC16 == LOC17)) goto LA18;
				{
					NI i_480305;
					NI HEX3Atmp_480335;
					NI LOC21;
					NI res_480338;
					i_480305 = 0;
					HEX3Atmp_480335 = 0;
					LOC21 = 0;
					LOC21 = sonslen_227249(a);
					HEX3Atmp_480335 = (NI64)(LOC21 - 1);
					res_480338 = 0;
					{
						while (1) {
							if (!(res_480338 <= HEX3Atmp_480335)) goto LA23;
							i_480305 = res_480338;
							{
								NIM_BOOL LOC26;
								LOC26 = 0;
								LOC26 = sametrees_480132((*a).kindU.S6.Sons->data[i_480305], (*b).kindU.S6.Sons->data[i_480305]);
								if (!!(LOC26)) goto LA27;
								goto BeforeRet;
							}
							LA27: ;
							res_480338 += 1;
						} LA23: ;
					}
				}
				result = NIM_TRUE;
			}
			LA18: ;
		}
		break;
		}
	}
	LA4: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, checktypes_480521)(tpatterncontext480013* c, tsym226846* p, tnode226816* n) {
	NIM_BOOL result;
	result = 0;
	{
		if (!!(((*p).Constraint == NIM_NIL))) goto LA3;
		result = matchnodekinds_323381((*p).Constraint, n);
		{
			if (!!(result)) goto LA7;
			goto BeforeRet;
		}
		LA7: ;
	}
	LA3: ;
	{
		if (!(*n).Typ == 0) goto LA11;
		result = ((136 &(IL64(1)<<(((*(*p).Typ).Kind)&IL64(63))))!=0);
	}
	goto LA9;
	LA11: ;
	{
		result = argtypematches_415484((*c).C, (*p).Typ, (*n).Typ);
	}
	LA9: ;
	BeforeRet: ;
	return result;
}

static N_INLINE(tcell44733*, usrtocell_48446)(void* usr) {
	tcell44733* result;
	result = 0;
	result = ((tcell44733*) ((NI)((NU64)(((NI) (usr))) - (NU64)(((NI)sizeof(tcell44733))))));
	return result;
}

static N_INLINE(void, rtladdzct_50004)(tcell44733* c) {
	addzct_48417((&gch_46844.Zct), c);
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tcell44733* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_48446(src);
		(*c).Refcount += 8;
	}
	LA3: ;
	{
		tcell44733* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_48446((*dest));
		{
			(*c).Refcount -= 8;
			if (!((NU64)((*c).Refcount) < (NU64)(8))) goto LA11;
			rtladdzct_50004(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NIMCALL(void, putlazy_480047)(tpatterncontext480013* c, tsym226846* sym, tnode226816* n) {
	{
		if (!(*c).Mapping == 0) goto LA3;
		unsureAsgnRef((void**) (&(*c).Mapping), (tnodeseq226810*) newSeq((&NTI226810), (*c).Formals));
	}
	LA3: ;
	asgnRefNoCycle((void**) (&(*c).Mapping->data[(*sym).Position]), n);
}

N_NIMCALL(NIM_BOOL, bindorcheck_480711)(tpatterncontext480013* c, tsym226846* param, tnode226816* n) {
	NIM_BOOL result;
	tnode226816* pp;
	result = 0;
	pp = getlazy_480025(c, param);
	{
		if (!!((pp == NIM_NIL))) goto LA3;
		result = sametrees_480132(pp, n);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = ((*n).Kind == ((NU8) 151));
		if (LOC6) goto LA7;
		LOC6 = checktypes_480521(c, param, n);
		LA7: ;
		if (!LOC6) goto LA8;
		putlazy_480047(c, param, n);
		result = NIM_TRUE;
	}
	goto LA1;
	LA8: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, insymchoice_480355)(tnode226816* sc, tnode226816* x) {
	NIM_BOOL result;
	result = 0;
	{
		if (!((*sc).Kind == ((NU8) 56))) goto LA3;
		{
			NI i_480390;
			NI HEX3Atmp_480501;
			NI LOC6;
			NI res_480504;
			i_480390 = 0;
			HEX3Atmp_480501 = 0;
			LOC6 = 0;
			LOC6 = len_227364(sc);
			HEX3Atmp_480501 = (LOC6 - 1);
			res_480504 = 0;
			{
				while (1) {
					if (!(res_480504 <= HEX3Atmp_480501)) goto LA8;
					i_480390 = res_480504;
					{
						if (!((*(*sc).kindU.S6.Sons->data[i_480390]).kindU.S4.Sym == (*x).kindU.S4.Sym)) goto LA11;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA11: ;
					res_480504 += 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_480648)(tpatterncontext480013* c, tnode226816* p, tnode226816* n) {
	NIM_BOOL result;
	result = 0;
	{
		NI i_480675;
		NI HEX3Atmp_480691;
		NI LOC2;
		NI res_480694;
		i_480675 = 0;
		HEX3Atmp_480691 = 0;
		LOC2 = 0;
		LOC2 = len_227364(p);
		HEX3Atmp_480691 = (LOC2 - 1);
		res_480694 = 1;
		{
			while (1) {
				if (!(res_480694 <= HEX3Atmp_480691)) goto LA4;
				i_480675 = res_480694;
				{
					NIM_BOOL LOC7;
					LOC7 = 0;
					LOC7 = matches_480085(c, (*p).kindU.S6.Sons->data[i_480675], n);
					if (!LOC7) goto LA8;
					result = NIM_TRUE;
					goto BeforeRet;
				}
				LA8: ;
				res_480694 += 1;
			} LA4: ;
		}
	}
	BeforeRet: ;
	return result;
}
N_NIMCALL(void, TMP3066)(void* p, NI op) {
	TY481062* a;
	a = (TY481062*)p;
	nimGCvisit((void*)(*a).P480805, op);
}

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

N_CLOSURE(NIM_BOOL, matchstaraux_480809)(tpatterncontext480013* c, tnode226816* op, tnode226816* n_480813, tnode226816* arglist, NIM_BOOL rpn, void* ClEnv) {
	NIM_BOOL result;
	TY481062* HEX3Aenvp_481086;
	result = 0;
	HEX3Aenvp_481086 = (TY481062*) ClEnv;
	result = NIM_TRUE;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ((*n_480813).Kind == ((NU8) 27) || (*n_480813).Kind == ((NU8) 29) || (*n_480813).Kind == ((NU8) 30) || (*n_480813).Kind == ((NU8) 31) || (*n_480813).Kind == ((NU8) 26) || (*n_480813).Kind == ((NU8) 28) || (*n_480813).Kind == ((NU8) 32));
		if (!(LOC3)) goto LA4;
		LOC3 = matches_480085(c, (*op).kindU.S6.Sons->data[1], (*n_480813).kindU.S6.Sons->data[0]);
		LA4: ;
		if (!LOC3) goto LA5;
		{
			NI i_480868;
			NI HEX3Atmp_480981;
			NI LOC8;
			NI res_480984;
			i_480868 = 0;
			HEX3Atmp_480981 = 0;
			LOC8 = 0;
			LOC8 = sonslen_227249(n_480813);
			HEX3Atmp_480981 = (NI64)(LOC8 - 1);
			res_480984 = 1;
			{
				while (1) {
					if (!(res_480984 <= HEX3Atmp_480981)) goto LA10;
					i_480868 = res_480984;
					{
						TY480810 LOC13;
						tnode226816* LOC14;
						NIM_BOOL LOC15;
						memset((void*)(&LOC13), 0, sizeof(LOC13));
						LOC13.ClPrc = matchstaraux_480809; LOC13.ClEnv = HEX3Aenvp_481086;
						LOC14 = 0;
						LOC14 = HEX5BHEX5D_227698(n_480813, i_480868);
						LOC15 = 0;
						LOC15 = LOC13.ClEnv? LOC13.ClPrc(c, op, LOC14, arglist, rpn, LOC13.ClEnv):((TMP3067)(LOC13.ClPrc))(c, op, LOC14, arglist, rpn);
						if (!!(LOC15)) goto LA16;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA16: ;
					res_480984 += 1;
				} LA10: ;
			}
		}
		{
			if (!rpn) goto LA20;
			add_227498(arglist, (*n_480813).kindU.S6.Sons->data[0]);
		}
		LA20: ;
	}
	goto LA1;
	LA5: ;
	{
		NIM_BOOL LOC23;
		tnode226816* n;
		LOC23 = 0;
		LOC23 = ((*n_480813).Kind == ((NU8) 58));
		if (!(LOC23)) goto LA24;
		LOC23 = ((*(*n_480813).kindU.S6.Sons->data[1]).Kind == ((NU8) 41));
		LA24: ;
		if (!LOC23) goto LA25;
		n = (*n_480813).kindU.S6.Sons->data[1];
		{
			NI i_480951;
			NI HEX3Atmp_480987;
			NI LOC28;
			NI res_480990;
			i_480951 = 0;
			HEX3Atmp_480987 = 0;
			LOC28 = 0;
			LOC28 = len_227364(n);
			HEX3Atmp_480987 = (LOC28 - 1);
			res_480990 = 0;
			{
				while (1) {
					if (!(res_480990 <= HEX3Atmp_480987)) goto LA30;
					i_480951 = res_480990;
					{
						TY480810 LOC33;
						tnode226816* LOC34;
						NIM_BOOL LOC35;
						memset((void*)(&LOC33), 0, sizeof(LOC33));
						LOC33.ClPrc = matchstaraux_480809; LOC33.ClEnv = HEX3Aenvp_481086;
						LOC34 = 0;
						LOC34 = HEX5BHEX5D_227698(n, i_480951);
						LOC35 = 0;
						LOC35 = LOC33.ClEnv? LOC33.ClPrc(c, op, LOC34, arglist, rpn, LOC33.ClEnv):((TMP3068)(LOC33.ClPrc))(c, op, LOC34, arglist, rpn);
						if (!!(LOC35)) goto LA36;
						result = NIM_FALSE;
						goto BeforeRet;
					}
					LA36: ;
					res_480990 += 1;
				} LA30: ;
			}
		}
	}
	goto LA1;
	LA25: ;
	{
		NIM_BOOL LOC39;
		LOC39 = 0;
		LOC39 = checktypes_480521(c, (*(*(*HEX3Aenvp_481086).P480805).kindU.S6.Sons->data[2]).kindU.S4.Sym, n_480813);
		if (!LOC39) goto LA40;
		add_227498(arglist, n_480813);
	}
	goto LA1;
	LA40: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchnested_480802)(tpatterncontext480013* c, tnode226816* p, tnode226816* n, NIM_BOOL rpn) {
	NIM_BOOL result;
	TY481062* HEX3Aenv_481089;
	result = 0;
	HEX3Aenv_481089 = 0;
	HEX3Aenv_481089 = (TY481062*) newObj((&NTI481090), sizeof(TY481062));
	asgnRefNoCycle((void**) (&(*HEX3Aenv_481089).P480805), 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;
		tnode226816* arglist;
		LOC7 = 0;
		LOC7 = matches_480085(c, (*(*HEX3Aenv_481089).P480805).kindU.S6.Sons->data[1], (*n).kindU.S6.Sons->data[0]);
		if (!LOC7) goto LA8;
		arglist = newnodei_227138(((NU8) 151), (*n).Info);
		{
			TY480810 LOC12;
			NIM_BOOL LOC13;
			memset((void*)(&LOC12), 0, sizeof(LOC12));
			LOC12.ClPrc = matchstaraux_480809; LOC12.ClEnv = HEX3Aenv_481089;
			LOC13 = 0;
			LOC13 = LOC12.ClEnv? LOC12.ClPrc(c, (*HEX3Aenv_481089).P480805, n, arglist, rpn, LOC12.ClEnv):((TMP3069)(LOC12.ClPrc))(c, (*HEX3Aenv_481089).P480805, n, arglist, rpn);
			if (!LOC13) goto LA14;
			result = bindorcheck_480711(c, (*(*(*HEX3Aenv_481089).P480805).kindU.S6.Sons->data[2]).kindU.S4.Sym, arglist);
		}
		LA14: ;
	}
	LA8: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, gather_480750)(tpatterncontext480013* c, tsym226846* param, tnode226816* n) {
	tnode226816* pp;
	pp = getlazy_480025(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_227498(pp, n);
	}
	goto LA1;
	LA5: ;
	{
		pp = newnodei_229007(((NU8) 151), (*n).Info, 1);
		asgnRefNoCycle((void**) (&(*pp).kindU.S6.Sons->data[0]), n);
		putlazy_480047(c, param, pp);
	}
	LA1: ;
}

static N_INLINE(tnode226816*, lastson_227261)(tnode226816* n) {
	tnode226816* result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = sonslen_227249(n);
	result = (*n).kindU.S6.Sons->data[(NI64)(LOC1 - 1)];
	return result;
}

N_NIMCALL(NIM_BOOL, matches_480085)(tpatterncontext480013* c, tnode226816* p, tnode226816* n_480089) {
	NIM_BOOL result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = ispatternparam_480575(c, p);
		if (!LOC3) goto LA4;
		result = bindorcheck_480711(c, (*p).kindU.S4.Sym, n_480089);
	}
	goto LA1;
	LA4: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = ((*n_480089).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_480089).kindU.S4.Sym).Name).Sup.Id);
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC12;
		LOC12 = 0;
		LOC12 = ((*n_480089).Kind == ((NU8) 3));
		if (!(LOC12)) goto LA13;
		LOC12 = insymchoice_480355(p, n_480089);
		LA13: ;
		if (!LOC12) goto LA14;
		result = NIM_TRUE;
	}
	goto LA1;
	LA14: ;
	{
		NIM_BOOL LOC17;
		LOC17 = 0;
		LOC17 = ((*n_480089).Kind == ((NU8) 3));
		if (!(LOC17)) goto LA18;
		LOC17 = ((*(*n_480089).kindU.S4.Sym).Kind == ((NU8) 10));
		LA18: ;
		if (!LOC17) goto LA19;
		{
			if (!((*p).Kind == ((NU8) 3))) goto LA23;
			result = ((*p).kindU.S4.Sym == (*n_480089).kindU.S4.Sym);
		}
		goto LA21;
		LA23: ;
		{
			NIM_BOOL LOC26;
			LOC26 = 0;
			LOC26 = matches_480085(c, p, (*(*n_480089).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*) &TMP3061))) goto LA32;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3062))) goto LA33;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3063))) goto LA34;
		if (eqStrings(opr, ((NimStringDesc*) &TMP3064))) goto LA35;
		goto LA36;
		LA32: ;
		{
			result = matchchoice_480648(c, p, n_480089);
		}
		goto LA37;
		LA33: ;
		{
			result = matchnested_480802(c, p, n_480089, NIM_FALSE);
		}
		goto LA37;
		LA34: ;
		{
			result = matchnested_480802(c, p, n_480089, NIM_TRUE);
		}
		goto LA37;
		LA35: ;
		{
			NIM_BOOL LOC42;
			LOC42 = 0;
			LOC42 = matches_480085(c, (*p).kindU.S6.Sons->data[1], n_480089);
			result = !(LOC42);
		}
		goto LA37;
		LA36: ;
		{
			internalerror_198987((*p).Info, ((NimStringDesc*) &TMP3070));
		}
		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_480085(c, (*p).kindU.S6.Sons->data[0], n_480089);
				if (!LOC53) goto LA54;
				gather_480750(c, (*(*(*p).kindU.S6.Sons->data[1]).kindU.S6.Sons->data[1]).kindU.S4.Sym, n_480089);
				result = NIM_TRUE;
			}
			LA54: ;
		}
		goto LA47;
		LA49: ;
		{
			{
				NIM_BOOL LOC59;
				LOC59 = 0;
				LOC59 = matches_480085(c, (*p).kindU.S6.Sons->data[0], n_480089);
				if (!LOC59) goto LA60;
				result = bindorcheck_480711(c, (*(*p).kindU.S6.Sons->data[1]).kindU.S4.Sym, n_480089);
			}
			LA60: ;
		}
		LA47: ;
	}
	goto LA1;
	LA45: ;
	{
		NIM_BOOL LOC63;
		LOC63 = 0;
		LOC63 = samekinds_480103(p, n_480089);
		if (!LOC63) goto LA64;
		switch ((*p).Kind) {
		case ((NU8) 3):
		{
			result = ((*p).kindU.S4.Sym == (*n_480089).kindU.S4.Sym);
		}
		break;
		case ((NU8) 2):
		{
			result = ((*(*p).kindU.S5.Ident).Sup.Id == (*(*n_480089).kindU.S5.Ident).Sup.Id);
		}
		break;
		case ((NU8) 5) ... ((NU8) 10):
		{
			result = ((*p).kindU.S1.Intval == (*n_480089).kindU.S1.Intval);
		}
		break;
		case ((NU8) 16) ... ((NU8) 18):
		{
			result = ((*p).kindU.S2.Floatval == (*n_480089).kindU.S2.Floatval);
		}
		break;
		case ((NU8) 20) ... ((NU8) 22):
		{
			result = eqStrings((*p).kindU.S3.Strval, (*n_480089).kindU.S3.Strval);
		}
		break;
		case ((NU8) 1):
		case ((NU8) 23):
		case ((NU8) 4):
		{
			result = NIM_TRUE;
		}
		break;
		default:
		{
			NI plen;
			tnode226816* v;
			plen = sonslen_227249(p);
			v = lastson_227261(p);
			{
				NIM_BOOL LOC75;
				tnode226816* arglist;
				LOC75 = 0;
				LOC75 = ispatternparam_480575(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_227249(n_480089);
					if (!(plen <= LOC81)) goto LA82;
					{
						NI i_481837;
						NI HEX3Atmp_482116;
						NI res_482119;
						i_481837 = 0;
						HEX3Atmp_482116 = 0;
						HEX3Atmp_482116 = (NI64)(plen - 2);
						res_482119 = 0;
						{
							while (1) {
								if (!(res_482119 <= HEX3Atmp_482116)) goto LA86;
								i_481837 = res_482119;
								{
									NIM_BOOL LOC89;
									LOC89 = 0;
									LOC89 = matches_480085(c, (*p).kindU.S6.Sons->data[i_481837], (*n_480089).kindU.S6.Sons->data[i_481837]);
									if (!!(LOC89)) goto LA90;
									goto BeforeRet;
								}
								LA90: ;
								res_482119 += 1;
							} LA86: ;
						}
					}
					{
						NIM_BOOL LOC94;
						NIM_BOOL LOC95;
						NI LOC96;
						tnode226816* LOC98;
						tnode226816* LOC100;
						tnode226816* n;
						tnode226816* LOC103;
						NI LOC104;
						LOC94 = 0;
						LOC95 = 0;
						LOC96 = 0;
						LOC96 = sonslen_227249(n_480089);
						LOC95 = (plen == LOC96);
						if (!(LOC95)) goto LA97;
						LOC98 = 0;
						LOC98 = lastson_227261(n_480089);
						LOC95 = ((*LOC98).Kind == ((NU8) 58));
						LA97: ;
						LOC94 = LOC95;
						if (!(LOC94)) goto LA99;
						LOC100 = 0;
						LOC100 = lastson_227261(n_480089);
						LOC94 = ((*(*LOC100).kindU.S6.Sons->data[1]).Kind == ((NU8) 41));
						LA99: ;
						if (!LOC94) goto LA101;
						LOC103 = 0;
						LOC103 = lastson_227261(n_480089);
						n = (*LOC103).kindU.S6.Sons->data[1];
						LOC104 = 0;
						LOC104 = len_227364(n);
						arglist = newnodei_229007(((NU8) 151), (*n).Info, LOC104);
						{
							NI i_481934;
							NI HEX3Atmp_482122;
							NI LOC106;
							NI res_482125;
							i_481934 = 0;
							HEX3Atmp_482122 = 0;
							LOC106 = 0;
							LOC106 = len_227364(n);
							HEX3Atmp_482122 = (LOC106 - 1);
							res_482125 = 0;
							{
								while (1) {
									if (!(res_482125 <= HEX3Atmp_482122)) goto LA108;
									i_481934 = res_482125;
									asgnRefNoCycle((void**) (&(*arglist).kindU.S6.Sons->data[i_481934]), (*n).kindU.S6.Sons->data[i_481934]);
									res_482125 += 1;
								} LA108: ;
							}
						}
					}
					goto LA92;
					LA101: ;
					{
						NI LOC110;
						LOC110 = 0;
						LOC110 = sonslen_227249(n_480089);
						arglist = newnodei_229007(((NU8) 151), (*n_480089).Info, (NI64)((NI64)(LOC110 - plen) + 1));
						{
							NI i_481975;
							NI HEX3Atmp_482128;
							NI LOC112;
							NI res_482131;
							i_481975 = 0;
							HEX3Atmp_482128 = 0;
							LOC112 = 0;
							LOC112 = sonslen_227249(n_480089);
							HEX3Atmp_482128 = (NI64)(LOC112 - plen);
							res_482131 = 0;
							{
								while (1) {
									if (!(res_482131 <= HEX3Atmp_482128)) goto LA114;
									i_481975 = res_482131;
									asgnRefNoCycle((void**) (&(*arglist).kindU.S6.Sons->data[i_481975]), (*n_480089).kindU.S6.Sons->data[(NI64)((NI64)(i_481975 + plen) - 1)]);
									res_482131 += 1;
								} LA114: ;
							}
						}
					}
					LA92: ;
					result = bindorcheck_480711(c, (*v).kindU.S4.Sym, arglist);
					goto BeforeRet;
				}
				goto LA79;
				LA82: ;
				{
					NI LOC116;
					LOC116 = 0;
					LOC116 = sonslen_227249(n_480089);
					if (!((NI64)(plen - 1) == LOC116)) goto LA117;
					{
						NI i_482030;
						NI HEX3Atmp_482134;
						NI res_482137;
						i_482030 = 0;
						HEX3Atmp_482134 = 0;
						HEX3Atmp_482134 = (NI64)(plen - 2);
						res_482137 = 0;
						{
							while (1) {
								if (!(res_482137 <= HEX3Atmp_482134)) goto LA121;
								i_482030 = res_482137;
								{
									NIM_BOOL LOC124;
									LOC124 = 0;
									LOC124 = matches_480085(c, (*p).kindU.S6.Sons->data[i_482030], (*n_480089).kindU.S6.Sons->data[i_482030]);
									if (!!(LOC124)) goto LA125;
									goto BeforeRet;
								}
								LA125: ;
								res_482137 += 1;
							} LA121: ;
						}
					}
					arglist = newnodei_227138(((NU8) 151), (*n_480089).Info);
					result = bindorcheck_480711(c, (*v).kindU.S4.Sym, arglist);
					goto BeforeRet;
				}
				goto LA79;
				LA117: ;
				LA79: ;
			}
			LA77: ;
			{
				NI LOC129;
				LOC129 = 0;
				LOC129 = sonslen_227249(n_480089);
				if (!(plen == LOC129)) goto LA130;
				{
					NI i_482085;
					NI HEX3Atmp_482140;
					NI LOC133;
					NI res_482143;
					i_482085 = 0;
					HEX3Atmp_482140 = 0;
					LOC133 = 0;
					LOC133 = sonslen_227249(p);
					HEX3Atmp_482140 = (NI64)(LOC133 - 1);
					res_482143 = 0;
					{
						while (1) {
							if (!(res_482143 <= HEX3Atmp_482140)) goto LA135;
							i_482085 = res_482143;
							{
								NIM_BOOL LOC138;
								LOC138 = 0;
								LOC138 = matches_480085(c, (*p).kindU.S6.Sons->data[i_482085], (*n_480089).kindU.S6.Sons->data[i_482085]);
								if (!!(LOC138)) goto LA139;
								goto BeforeRet;
							}
							LA139: ;
							res_482143 += 1;
						} LA135: ;
					}
				}
				result = NIM_TRUE;
			}
			LA130: ;
		}
		break;
		}
	}
	goto LA1;
	LA64: ;
	LA1: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchrange_482202)(tpatterncontext480013* c, tnode226816* p, tnode226816* n, NI i) {
	NIM_BOOL result;
	result = 0;
	{
		NI j_482230;
		NI HEX3Atmp_482271;
		NI LOC2;
		NI res_482274;
		j_482230 = 0;
		HEX3Atmp_482271 = 0;
		LOC2 = 0;
		LOC2 = len_227364(p);
		HEX3Atmp_482271 = (LOC2 - 1);
		res_482274 = 0;
		{
			while (1) {
				if (!(res_482274 <= HEX3Atmp_482271)) goto LA4;
				j_482230 = res_482274;
				{
					NIM_BOOL LOC7;
					LOC7 = 0;
					LOC7 = matches_480085(c, (*p).kindU.S6.Sons->data[j_482230], (*n).kindU.S6.Sons->data[(NI64)(i + j_482230)]);
					if (!!(LOC7)) goto LA8;
					{
						if (!!((*c).Mapping == 0)) goto LA12;
						genericSeqAssign((&(*c).Mapping), NIM_NIL, (&NTI226810));
					}
					LA12: ;
					result = NIM_FALSE;
					goto BeforeRet;
				}
				LA8: ;
				res_482274 += 1;
			} LA4: ;
		}
	}
	result = NIM_TRUE;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode226816*, matchstmtlist_482196)(tpatterncontext480013* c, tnode226816* p, tnode226816* n_482200) {
	tnode226816* result;
	result = 0;
	{
		NIM_BOOL LOC3;
		NIM_BOOL LOC4;
		NI LOC7;
		NI LOC8;
		tnode226816* n;
		LOC3 = 0;
		LOC4 = 0;
		LOC4 = ((*p).Kind == ((NU8) 115));
		if (!(LOC4)) goto LA5;
		LOC4 = ((*n_482200).Kind == (*p).Kind);
		LA5: ;
		LOC3 = LOC4;
		if (!(LOC3)) goto LA6;
		LOC7 = 0;
		LOC7 = len_227364(p);
		LOC8 = 0;
		LOC8 = len_227364(n_482200);
		LOC3 = (LOC7 < LOC8);
		LA6: ;
		if (!LOC3) goto LA9;
		n = flattenstmts_263416(n_482200);
		{
			NI i_482306;
			NI HEX3Atmp_482350;
			NI LOC12;
			NI LOC13;
			NI res_482353;
			i_482306 = 0;
			HEX3Atmp_482350 = 0;
			LOC12 = 0;
			LOC12 = len_227364(n);
			LOC13 = 0;
			LOC13 = len_227364(p);
			HEX3Atmp_482350 = (NI64)(LOC12 - LOC13);
			res_482353 = 0;
			{
				while (1) {
					if (!(res_482353 <= HEX3Atmp_482350)) goto LA15;
					i_482306 = res_482353;
					{
						NIM_BOOL LOC18;
						NI LOC21;
						NI LOC22;
						NI LOC23;
						LOC18 = 0;
						LOC18 = matchrange_482202(c, p, n, i_482306);
						if (!LOC18) goto LA19;
						(*c).Submatch = NIM_TRUE;
						result = newnodei_229007(((NU8) 115), (*n).Info, 3);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[0]), extractrange_263440(((NU8) 115), n, 0, (NI64)(i_482306 - 1)));
						LOC21 = 0;
						LOC21 = len_227364(p);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[1]), extractrange_263440(((NU8) 115), n, i_482306, (NI64)((NI64)(i_482306 + LOC21) - 1)));
						LOC22 = 0;
						LOC22 = len_227364(p);
						LOC23 = 0;
						LOC23 = len_227364(n);
						asgnRefNoCycle((void**) (&(*result).kindU.S6.Sons->data[2]), extractrange_263440(((NU8) 115), n, (NI64)(i_482306 + LOC22), (NI64)(LOC23 - 1)));
						goto LA11;
					}
					LA19: ;
					res_482353 += 1;
				} LA15: ;
			}
		} LA11: ;
	}
	goto LA1;
	LA9: ;
	{
		NIM_BOOL LOC25;
		LOC25 = 0;
		LOC25 = matches_480085(c, p, n_482200);
		if (!LOC25) goto LA26;
		result = n_482200;
	}
	goto LA1;
	LA26: ;
	LA1: ;
	return result;
}

N_NIMCALL(NIM_BOOL, aliasanalysisrequested_482382)(tnode226816* params) {
	NIM_BOOL result;
	result = 0;
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = len_227364(params);
		if (!(2 <= LOC3)) goto LA4;
		{
			NI i_482407;
			NI HEX3Atmp_482447;
			NI LOC7;
			NI res_482450;
			i_482407 = 0;
			HEX3Atmp_482447 = 0;
			LOC7 = 0;
			LOC7 = len_227364(params);
			HEX3Atmp_482447 = (LOC7 - 1);
			res_482450 = 1;
			{
				while (1) {
					tsym226846* param;
					if (!(res_482450 <= HEX3Atmp_482447)) goto LA9;
					i_482407 = res_482450;
					param = (*(*params).kindU.S6.Sons->data[i_482407]).kindU.S4.Sym;
					{
						NU8 LOC12;
						LOC12 = 0;
						LOC12 = whichalias_322080(param);
						if (!!((LOC12 == ((NU8) 1)))) goto LA13;
						result = NIM_TRUE;
						goto BeforeRet;
					}
					LA13: ;
					res_482450 += 1;
				} LA9: ;
			}
		}
	}
	LA4: ;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, addtoarglist_482467)(tnode226816* result, tnode226816* 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_227498(result, n);
		}
		goto LA7;
		LA9: ;
		{
			{
				NI i_482527;
				NI HEX3Atmp_482543;
				NI LOC13;
				NI res_482546;
				i_482527 = 0;
				HEX3Atmp_482543 = 0;
				LOC13 = 0;
				LOC13 = len_227364(n);
				HEX3Atmp_482543 = (LOC13 - 1);
				res_482546 = 0;
				{
					while (1) {
						if (!(res_482546 <= HEX3Atmp_482543)) goto LA15;
						i_482527 = res_482546;
						add_227498(result, (*n).kindU.S6.Sons->data[i_482527]);
						res_482546 += 1;
					} LA15: ;
				}
			}
		}
		LA7: ;
	}
	LA5: ;
}

N_NIMCALL(tnode226816*, applyrule_482563)(tcontext291021* c, tsym226846* s, tnode226816* n) {
	tnode226816* result;
	tpatterncontext480013 ctx;
	NI LOC1;
	tnode226816* m;
	tnode226816* LOC6;
	tnode226816* params;
	NIM_BOOL requiresaa;
	tnode226816* args;
	result = 0;
	memset((void*)(&ctx), 0, sizeof(ctx));
	ctx.Owner = s;
	ctx.C = c;
	LOC1 = 0;
	LOC1 = sonslen_227255((*s).Typ);
	ctx.Formals = (NI64)(LOC1 - 1);
	m = matchstmtlist_482196((&ctx), (*(*s).Ast).kindU.S6.Sons->data[1], n);
	{
		if (!m == 0) goto LA4;
		result = NIM_NIL;
		goto BeforeRet;
	}
	LA4: ;
	result = newnodei_227138(((NU8) 27), (*n).Info);
	LOC6 = 0;
	LOC6 = newsymnode_228754(s, (*n).Info);
	add_227498(result, LOC6);
	params = (*(*s).Typ).N;
	requiresaa = aliasanalysisrequested_482382(params);
	args = 0;
	{
		if (!requiresaa) goto LA9;
		args = newnodei_227138(((NU8) 151), (*n).Info);
	}
	LA9: ;
	{
		NI i_482621;
		NI HEX3Atmp_482818;
		NI LOC12;
		NI res_482821;
		i_482621 = 0;
		HEX3Atmp_482818 = 0;
		LOC12 = 0;
		LOC12 = len_227364(params);
		HEX3Atmp_482818 = (LOC12 - 1);
		res_482821 = 1;
		{
			while (1) {
				tsym226846* param;
				tnode226816* x;
				if (!(res_482821 <= HEX3Atmp_482818)) goto LA14;
				i_482621 = res_482821;
				param = (*(*params).kindU.S6.Sons->data[i_482621]).kindU.S4.Sym;
				x = getlazy_480025((&ctx), param);
				{
					if (!x == 0) goto LA17;
					result = NIM_NIL;
					goto BeforeRet;
				}
				LA17: ;
				add_227498(result, x);
				{
					if (!requiresaa) goto LA21;
					addtoarglist_482467(args, x);
				}
				LA21: ;
				res_482821 += 1;
			} LA14: ;
		}
	}
	{
		if (!requiresaa) goto LA25;
		{
			NI i_482685;
			NI HEX3Atmp_482842;
			NI LOC28;
			NI res_482845;
			i_482685 = 0;
			HEX3Atmp_482842 = 0;
			LOC28 = 0;
			LOC28 = len_227364(params);
			HEX3Atmp_482842 = (LOC28 - 1);
			res_482845 = 1;
			{
				while (1) {
					tnode226816* rs;
					tsym226846* param;
					NU8 LOC31;
					if (!(res_482845 <= HEX3Atmp_482842)) goto LA30;
					i_482685 = res_482845;
					rs = (*result).kindU.S6.Sons->data[i_482685];
					param = (*(*params).kindU.S6.Sons->data[i_482685]).kindU.S4.Sym;
					LOC31 = 0;
					LOC31 = whichalias_322080(param);
					switch (LOC31) {
					case ((NU8) 1):
					{
					}
					break;
					case ((NU8) 2):
					{
						NIM_BOOL ok;
						ok = NIM_FALSE;
						{
							tnode226816* arg_482731;
							arg_482731 = 0;
							{
								NI i_482828;
								NI HEX3Atmp_482830;
								NI LOC36;
								NI res_482832;
								i_482828 = 0;
								HEX3Atmp_482830 = 0;
								LOC36 = 0;
								LOC36 = len_227364(args);
								HEX3Atmp_482830 = (LOC36 - 1);
								res_482832 = 0;
								{
									while (1) {
										if (!(res_482832 <= HEX3Atmp_482830)) goto LA38;
										i_482828 = res_482832;
										arg_482731 = (*args).kindU.S6.Sons->data[i_482828];
										{
											NIM_BOOL LOC41;
											NU8 LOC43;
											LOC41 = 0;
											LOC41 = !((arg_482731 == rs));
											if (!(LOC41)) goto LA42;
											LOC43 = 0;
											LOC43 = ispartof_479430(rs, arg_482731);
											LOC41 = (LOC43 == ((NU8) 2));
											LA42: ;
											if (!LOC41) goto LA44;
											ok = NIM_TRUE;
											goto LA34;
										}
										LA44: ;
										res_482832 += 1;
									} LA38: ;
								}
							}
						} LA34: ;
						{
							if (!!(ok)) goto LA48;
							result = NIM_NIL;
							goto BeforeRet;
						}
						LA48: ;
					}
					break;
					case ((NU8) 3):
					{
						NIM_BOOL ok;
						ok = NIM_TRUE;
						{
							tnode226816* arg_482758;
							arg_482758 = 0;
							{
								NI i_482837;
								NI HEX3Atmp_482839;
								NI LOC53;
								NI res_482841;
								i_482837 = 0;
								HEX3Atmp_482839 = 0;
								LOC53 = 0;
								LOC53 = len_227364(args);
								HEX3Atmp_482839 = (LOC53 - 1);
								res_482841 = 0;
								{
									while (1) {
										if (!(res_482841 <= HEX3Atmp_482839)) goto LA55;
										i_482837 = res_482841;
										arg_482758 = (*args).kindU.S6.Sons->data[i_482837];
										{
											NIM_BOOL LOC58;
											NU8 LOC60;
											LOC58 = 0;
											LOC58 = !((arg_482758 == rs));
											if (!(LOC58)) goto LA59;
											LOC60 = 0;
											LOC60 = ispartof_479430(rs, arg_482758);
											LOC58 = !((LOC60 == ((NU8) 0)));
											LA59: ;
											if (!LOC58) goto LA61;
											ok = NIM_FALSE;
											goto LA51;
										}
										LA61: ;
										res_482841 += 1;
									} LA55: ;
								}
							}
						} LA51: ;
						{
							if (!!(ok)) goto LA65;
							result = NIM_NIL;
							goto BeforeRet;
						}
						LA65: ;
					}
					break;
					}
					res_482845 += 1;
				} LA30: ;
			}
		}
	}
	LA25: ;
	markused_406251((*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* TMP3065[2];
static TNimNode TMP959[3];
NTI481062.size = sizeof(TY481062);
NTI481062.kind = 18;
NTI481062.base = 0;
NTI481062.flags = 2;
TMP3065[0] = &TMP959[1];
TMP959[1].kind = 1;
TMP959[1].offset = offsetof(TY481062, HEX3Astate);
TMP959[1].typ = (&NTI358033);
TMP959[1].name = ":state";
TMP3065[1] = &TMP959[2];
TMP959[2].kind = 1;
TMP959[2].offset = offsetof(TY481062, P480805);
TMP959[2].typ = (&NTI226808);
TMP959[2].name = "p480805";
TMP959[0].len = 2; TMP959[0].kind = 2; TMP959[0].sons = &TMP3065[0];
NTI481062.node = &TMP959[0];
NTI481090.size = sizeof(TY481062*);
NTI481090.kind = 22;
NTI481090.base = (&NTI481062);
NTI481090.flags = 2;
NTI481090.marker = TMP3066;
}

