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

#include "nimbase.h"
#include <string.h>
typedef struct Tnode223809 Tnode223809;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Ttype223847 Ttype223847;
typedef struct Tlineinfo188352 Tlineinfo188352;
typedef struct Tsym223841 Tsym223841;
typedef struct Tident196021 Tident196021;
typedef struct Tnodeseq223803 Tnodeseq223803;
typedef struct Tidobj196015 Tidobj196015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Ttypeseq223843 Ttypeseq223843;
typedef struct Tscope223835 Tscope223835;
typedef struct TY223944 TY223944;
typedef struct Tstrtable223813 Tstrtable223813;
typedef struct Tsymseq223811 Tsymseq223811;
typedef struct Tloc223823 Tloc223823;
typedef struct Ropeobj174009 Ropeobj174009;
typedef struct Tlib223827 Tlib223827;
typedef struct Cell48947 Cell48947;
typedef struct Cellseq48963 Cellseq48963;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48959 Cellset48959;
typedef struct Pagedesc48955 Pagedesc48955;
typedef struct Memregion30891 Memregion30891;
typedef struct Smallchunk30843 Smallchunk30843;
typedef struct Llchunk30885 Llchunk30885;
typedef struct Bigchunk30845 Bigchunk30845;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30889 Avlnode30889;
typedef struct Gcstat51014 Gcstat51014;
typedef struct TY90959 TY90959;
typedef struct Tinstantiation223831 Tinstantiation223831;
typedef struct Tlistentry139022 Tlistentry139022;
typedef struct Basechunk30841 Basechunk30841;
typedef struct Freecell30833 Freecell30833;
typedef struct TY223932 TY223932;
typedef NIM_BOOL TY304308[65];
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tlineinfo188352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tnode223809  {
Ttype223847* typ;
Tlineinfo188352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym223841* sym;
} S4;
struct {Tident196021* ident;
} S5;
struct {Tnodeseq223803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
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  Tidobj196015  {
  TNimObject Sup;
NI id;
};
struct  Tstrtable223813  {
NI counter;
Tsymseq223811* data;
};
struct  Tloc223823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype223847* t;
Ropeobj174009* r;
Ropeobj174009* heaproot;
};
struct  Tsym223841  {
  Tidobj196015 Sup;
NU8 kind;
union{
struct {Ttypeseq223843* typeinstcache;
Tscope223835* typscope;
} S1;
struct {TY223944* procinstcache;
Tsym223841* gcunsafetyreason;
} S2;
struct {TY223944* usedgenerics;
Tstrtable223813 tab;
} S3;
struct {Tsym223841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype223847* typ;
Tident196021* name;
Tlineinfo188352 info;
Tsym223841* owner;
NU32 flags;
Tnode223809* ast;
NU32 options;
NI position;
NI offset;
Tloc223823 loc;
Tlib223827* annex;
Tnode223809* constraint;
};
struct  Ttype223847  {
  Tidobj196015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq223843* sons;
Tnode223809* n;
Tsym223841* owner;
Tsym223841* sym;
Tsym223841* destructor;
Tsym223841* deepcopy;
Tsym223841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc223823 loc;
};
struct  Cell48947  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48963  {
NI len;
NI cap;
Cell48947** d;
};
struct  Cellset48959  {
NI counter;
NI max;
Pagedesc48955* head;
Pagedesc48955** data;
};
typedef Smallchunk30843* TY30906[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30891  {
NI minlargeobj;
NI maxlargeobj;
TY30906 freesmallchunks;
Llchunk30885* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30845* freechunkslist;
Intset30817 chunkstarts;
Avlnode30889* root;
Avlnode30889* deleted;
Avlnode30889* last;
Avlnode30889* 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;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30891 region;
Gcstat51014 stat;
};
struct  Tident196021  {
  Tidobj196015 Sup;
NimStringDesc* s;
Tident196021* next;
NI h;
};
struct TY90959 {
NimStringDesc* Field0;
NI Field1;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tscope223835  {
NI depthlevel;
Tstrtable223813 symbols;
Tnodeseq223803* usingsyms;
Tscope223835* parent;
};
struct  Ropeobj174009  {
  TNimObject Sup;
Ropeobj174009* left;
Ropeobj174009* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry139022  {
  TNimObject Sup;
Tlistentry139022* prev;
Tlistentry139022* next;
};
struct  Tlib223827  {
  Tlistentry139022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj174009* name;
Tnode223809* path;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30822[8];
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30822 bits;
};
struct  Basechunk30841  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30843  {
  Basechunk30841 Sup;
Smallchunk30843* next;
Smallchunk30843* prev;
Freecell30833* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30885  {
NI size;
NI acc;
Llchunk30885* next;
};
struct  Bigchunk30845  {
  Basechunk30841 Sup;
Bigchunk30845* next;
Bigchunk30845* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30822 bits;
};
typedef Avlnode30889* TY30896[2];
struct  Avlnode30889  {
TY30896 link;
NI key;
NI upperbound;
NI level;
};
struct  Tinstantiation223831  {
Tsym223841* sym;
Ttypeseq223843* concretetypes;
TY223932* usedby;
NI compilesid;
};
struct  Freecell30833  {
Freecell30833* next;
NI zerofield;
};
struct Tnodeseq223803 {
  TGenericSeq Sup;
  Tnode223809* data[SEQ_DECL_SIZE];
};
struct Ttypeseq223843 {
  TGenericSeq Sup;
  Ttype223847* data[SEQ_DECL_SIZE];
};
struct TY223944 {
  TGenericSeq Sup;
  Tinstantiation223831* data[SEQ_DECL_SIZE];
};
struct Tsymseq223811 {
  TGenericSeq Sup;
  Tsym223841* data[SEQ_DECL_SIZE];
};
struct TY223932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
static N_INLINE(NIM_BOOL, isatom_228905)(Tnode223809* n);
N_NIMCALL(NU8, isassignable_304056)(Tsym223841* owner, Tnode223809* n, NIM_BOOL isunsafeaddr);
N_NIMCALL(Ttype223847*, skiptypes_227167)(Ttype223847* t, NU64 kinds);
N_NIMCALL(NIM_BOOL, comparetypes_260047)(Ttype223847* x, Ttype223847* y, NU8 cmp, NU8 flags);
N_NIMCALL(NU8, getmagic_252417)(Tnode223809* op);
N_NIMCALL(Tnode223809*, lastson_226406)(Tnode223809* n);
N_NIMCALL(NU8, checkforsideeffects_303869)(Tnode223809* n);
static N_INLINE(NIM_BOOL, isroutine_228764)(Tsym223841* s);
static N_INLINE(NI, len_224098)(Tnode223809* n);
N_NIMCALL(Tnode223809*, newnodei_225351)(NU8 kind, Tlineinfo188352 info);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(Cell48947*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48947* c);
N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_NIMCALL(void, compileconstraints_303113)(Tnode223809* p, NimStringDesc** result);
N_NIMCALL(void, patternerror_303051)(Tnode223809* n);
N_NIMCALL(void, localerror_194128)(Tlineinfo188352 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, rendertree_245059)(Tnode223809* n, NU8 renderflags);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(void, add_303061)(NimStringDesc** code, NU8 op);
N_NIMCALL(NimStringDesc*, nsuNormalize)(NimStringDesc* s);
N_NIMCALL(NI, hashString)(NimStringDesc* s);
N_NIMCALL(void, internalerror_194191)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_194279)(TY90959 x);
N_NIMCALL(NI, nsuCmpIgnoreStyle)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI start);
N_NIMCALL(NimStringDesc*, copyStr)(NimStringDesc* s, NI first);
N_NIMCALL(NimStringDesc*, reprEnum)(NI e_86859, TNimType* typ);
N_NIMCALL(void, internalerror_194172)(Tlineinfo188352 info, NimStringDesc* errmsg);
STRING_LITERAL(TMP3253, "|", 1);
STRING_LITERAL(TMP3254, "&", 1);
STRING_LITERAL(TMP3255, "~", 1);
STRING_LITERAL(TMP3256, "atom", 4);
STRING_LITERAL(TMP3257, "lit", 3);
STRING_LITERAL(TMP3258, "sym", 3);
STRING_LITERAL(TMP3259, "ident", 5);
STRING_LITERAL(TMP3260, "call", 4);
STRING_LITERAL(TMP3261, "alias", 5);
STRING_LITERAL(TMP3262, "noalias", 7);
STRING_LITERAL(TMP3263, "lvalue", 6);
STRING_LITERAL(TMP3264, "local", 5);
STRING_LITERAL(TMP3265, "sideeffect", 10);
STRING_LITERAL(TMP3266, "nosideeffect", 12);
STRING_LITERAL(TMP3268, "compiler/parampatterns.nim", 26);
NIM_CONST TY90959 TMP3267 = {((NimStringDesc*) &TMP3268),
((NI) 100)}
;
NIM_CONST TY90959 TMP3269 = {((NimStringDesc*) &TMP3268),
((NI) 107)}
;
STRING_LITERAL(TMP3270, "parameter pattern too complex", 29);
extern Gcheap51018 gch_51059;
extern TNimType NTI223441; /* TSymKind */
extern TNimType NTI223029; /* TNodeKind */

static N_INLINE(NIM_BOOL, isatom_228905)(Tnode223809* n) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = (((NU8) 0) <= (*n).kind);
	if (!(LOC1)) goto LA2;
	LOC1 = ((*n).kind <= ((NU8) 23));
	LA2: ;
	result = LOC1;
	return result;
}

N_NIMCALL(NU8, isassignable_304056)(Tsym223841* owner, Tnode223809* n, NIM_BOOL isunsafeaddr) {
	NU8 result;
	result = 0;
	result = ((NU8) 0);
	switch ((*n).kind) {
	case ((NU8) 3):
	{
		NU32 kinds;
		{
			if (!isunsafeaddr) goto LA4;
			kinds = 2856;
		}
		goto LA2;
		LA4: ;
		{
			kinds = 2336;
		}
		LA2: ;
		{
			if (!((kinds &(1<<(((*(*n).kindU.S4.sym).kind)&31)))!=0)) goto LA9;
			{
				NIM_BOOL LOC13;
				NIM_BOOL LOC14;
				LOC13 = 0;
				LOC14 = 0;
				LOC14 = !((owner == NIM_NIL));
				if (!(LOC14)) goto LA15;
				LOC14 = ((*owner).Sup.id == (*(*(*n).kindU.S4.sym).owner).Sup.id);
				LA15: ;
				LOC13 = LOC14;
				if (!(LOC13)) goto LA16;
				LOC13 = !((((*(*n).kindU.S4.sym).flags &(1<<((((NU8) 3))&31)))!=0));
				LA16: ;
				if (!LOC13) goto LA17;
				result = ((NU8) 2);
			}
			goto LA11;
			LA17: ;
			{
				result = ((NU8) 1);
			}
			LA11: ;
		}
		goto LA7;
		LA9: ;
		{
			NIM_BOOL LOC21;
			LOC21 = 0;
			LOC21 = ((*(*n).kindU.S4.sym).kind == ((NU8) 3));
			if (!(LOC21)) goto LA22;
			LOC21 = ((*(*(*n).kindU.S4.sym).typ).kind == ((NU8) 23));
			LA22: ;
			if (!LOC21) goto LA23;
			result = ((NU8) 1);
		}
		goto LA7;
		LA23: ;
		{
			Ttype223847* t;
			if (!((*(*n).kindU.S4.sym).kind == ((NU8) 7))) goto LA26;
			t = skiptypes_227167((*(*n).kindU.S4.sym).typ, 256);
			{
				if (!((*t).kind == ((NU8) 23))) goto LA30;
				result = ((NU8) 4);
			}
			LA30: ;
		}
		goto LA7;
		LA26: ;
		LA7: ;
	}
	break;
	case ((NU8) 45):
	{
		{
			Ttype223847* LOC35;
			LOC35 = 0;
			LOC35 = skiptypes_227167((*(*n).kindU.S6.sons->data[((NI) 0)]).typ, IL64(211106232576000));
			if (!((14680064 &(IL64(1)<<(((*LOC35).kind)&IL64(63))))!=0)) goto LA36;
			result = ((NU8) 1);
		}
		goto LA33;
		LA36: ;
		{
			result = isassignable_304056(owner, (*n).kindU.S6.sons->data[((NI) 0)], isunsafeaddr);
		}
		LA33: ;
		{
			NIM_BOOL LOC41;
			LOC41 = 0;
			LOC41 = !((result == ((NU8) 0)));
			if (!(LOC41)) goto LA42;
			LOC41 = (((*(*(*n).kindU.S6.sons->data[((NI) 1)]).kindU.S4.sym).flags &(1<<((((NU8) 18))&31)))!=0);
			LA42: ;
			if (!LOC41) goto LA43;
			result = ((NU8) 3);
		}
		LA43: ;
	}
	break;
	case ((NU8) 42):
	{
		{
			Ttype223847* LOC48;
			LOC48 = 0;
			LOC48 = skiptypes_227167((*(*n).kindU.S6.sons->data[((NI) 0)]).typ, IL64(211106232576000));
			if (!((14680064 &(IL64(1)<<(((*LOC48).kind)&IL64(63))))!=0)) goto LA49;
			result = ((NU8) 1);
		}
		goto LA46;
		LA49: ;
		{
			result = isassignable_304056(owner, (*n).kindU.S6.sons->data[((NI) 0)], isunsafeaddr);
		}
		LA46: ;
	}
	break;
	case ((NU8) 58):
	case ((NU8) 59):
	case ((NU8) 60):
	{
		{
			Ttype223847* LOC55;
			LOC55 = 0;
			LOC55 = skiptypes_227167((*n).typ, IL64(211106247256064));
			if (!((134610944 &(IL64(1)<<(((*LOC55).kind)&IL64(63))))!=0)) goto LA56;
			result = isassignable_304056(owner, (*n).kindU.S6.sons->data[((NI) 1)], isunsafeaddr);
		}
		goto LA53;
		LA56: ;
		{
			NIM_BOOL LOC59;
			LOC59 = 0;
			LOC59 = comparetypes_260047((*n).typ, (*(*n).kindU.S6.sons->data[((NI) 1)]).typ, ((NU8) 1), 0);
			if (!LOC59) goto LA60;
			result = isassignable_304056(owner, (*n).kindU.S6.sons->data[((NI) 1)], isunsafeaddr);
		}
		goto LA53;
		LA60: ;
		LA53: ;
	}
	break;
	case ((NU8) 65):
	case ((NU8) 47):
	case ((NU8) 64):
	{
		result = ((NU8) 1);
	}
	break;
	case ((NU8) 67):
	case ((NU8) 66):
	case ((NU8) 46):
	{
		result = isassignable_304056(owner, (*n).kindU.S6.sons->data[((NI) 0)], isunsafeaddr);
	}
	break;
	case ((NU8) 27):
	case ((NU8) 29):
	case ((NU8) 30):
	case ((NU8) 31):
	case ((NU8) 26):
	case ((NU8) 28):
	case ((NU8) 32):
	{
		{
			NU8 LOC67;
			LOC67 = 0;
			LOC67 = getmagic_252417(n);
			if (!(LOC67 == ((NU8) 4) || LOC67 == ((NU8) 138))) goto LA68;
			result = isassignable_304056(owner, (*n).kindU.S6.sons->data[((NI) 1)], isunsafeaddr);
		}
		LA68: ;
	}
	break;
	case ((NU8) 115):
	case ((NU8) 126):
	{
		{
			Tnode223809* LOC75;
			if (!!(((*n).typ == NIM_NIL))) goto LA73;
			LOC75 = 0;
			LOC75 = lastson_226406(n);
			result = isassignable_304056(owner, LOC75, isunsafeaddr);
		}
		LA73: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

static N_INLINE(NIM_BOOL, isroutine_228764)(Tsym223841* s) {
	NIM_BOOL result;
	result = 0;
	result = ((520192 &(1<<(((*s).kind)&31)))!=0);
	return result;
}

static N_INLINE(NI, len_224098)(Tnode223809* 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;
}

N_NIMCALL(NU8, checkforsideeffects_303869)(Tnode223809* n) {
	NU8 result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 27):
	case ((NU8) 29):
	case ((NU8) 30):
	case ((NU8) 31):
	case ((NU8) 26):
	case ((NU8) 28):
	case ((NU8) 32):
	{
		Tnode223809* op;
		op = (*n).kindU.S6.sons->data[((NI) 0)];
		{
			NIM_BOOL LOC4;
			Tsym223841* s;
			LOC4 = 0;
			LOC4 = ((*op).kind == ((NU8) 3));
			if (!(LOC4)) goto LA5;
			LOC4 = isroutine_228764((*op).kindU.S4.sym);
			LA5: ;
			if (!LOC4) goto LA6;
			s = (*op).kindU.S4.sym;
			{
				if (!(((*s).flags &(1<<((((NU8) 11))&31)))!=0)) goto LA10;
				result = ((NU8) 1);
				goto BeforeRet;
			}
			LA10: ;
			result = ((NU8) 2);
		}
		goto LA2;
		LA6: ;
		{
			if (!(((*(*op).typ).flags &(1<<((((NU8) 1))&31)))!=0)) goto LA13;
			result = ((NU8) 2);
		}
		goto LA2;
		LA13: ;
		{
			result = ((NU8) 1);
			goto BeforeRet;
		}
		LA2: ;
		{
			NI i_303927;
			NI HEX3Atmp_304007;
			NI LOC17;
			NI res_304010;
			i_303927 = 0;
			HEX3Atmp_304007 = 0;
			LOC17 = 0;
			LOC17 = len_224098(n);
			HEX3Atmp_304007 = (LOC17 - 1);
			res_304010 = ((NI) 0);
			{
				while (1) {
					NU8 ret;
					if (!(res_304010 <= HEX3Atmp_304007)) goto LA19;
					i_303927 = res_304010;
					ret = checkforsideeffects_303869((*n).kindU.S6.sons->data[i_303927]);
					{
						if (!(ret == ((NU8) 1))) goto LA22;
						result = ret;
						goto BeforeRet;
					}
					goto LA20;
					LA22: ;
					{
						NIM_BOOL LOC25;
						LOC25 = 0;
						LOC25 = (ret == ((NU8) 0));
						if (!(LOC25)) goto LA26;
						LOC25 = (result == ((NU8) 2));
						LA26: ;
						if (!LOC25) goto LA27;
						result = ((NU8) 0);
					}
					goto LA20;
					LA27: ;
					LA20: ;
					res_304010 += ((NI) 1);
				} LA19: ;
			}
		}
	}
	break;
	case ((NU8) 0) ... ((NU8) 23):
	{
		result = ((NU8) 2);
	}
	break;
	default:
	{
		result = ((NU8) 2);
		{
			NI i_303976;
			NI HEX3Atmp_304015;
			NI LOC32;
			NI res_304018;
			i_303976 = 0;
			HEX3Atmp_304015 = 0;
			LOC32 = 0;
			LOC32 = len_224098(n);
			HEX3Atmp_304015 = (LOC32 - 1);
			res_304018 = ((NI) 0);
			{
				while (1) {
					NU8 ret;
					if (!(res_304018 <= HEX3Atmp_304015)) goto LA34;
					i_303976 = res_304018;
					ret = checkforsideeffects_303869((*n).kindU.S6.sons->data[i_303976]);
					{
						if (!(ret == ((NU8) 1))) goto LA37;
						result = ret;
						goto BeforeRet;
					}
					goto LA35;
					LA37: ;
					{
						NIM_BOOL LOC40;
						LOC40 = 0;
						LOC40 = (ret == ((NU8) 0));
						if (!(LOC40)) goto LA41;
						LOC40 = (result == ((NU8) 2));
						LA41: ;
						if (!LOC40) goto LA42;
						result = ((NU8) 0);
					}
					goto LA35;
					LA42: ;
					LA35: ;
					res_304018 += ((NI) 1);
				} LA34: ;
			}
		}
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchnodekinds_304302)(Tnode223809* p, Tnode223809* n) {
	NIM_BOOL result;
	TY304308 stack;
	NI sp;
	NimStringDesc* code;
	NI pc;
	result = 0;
	stack[(((NI) 0))- 0] = NIM_TRUE;
	sp = ((NI) 1);
	code = (*p).kindU.S3.strval;
	pc = ((NI) 1);
	{
		while (1) {
			switch (((NU8) (((NU8)(code->data[pc]))))) {
			case ((NU8) 1):
			{
				goto LA1;
			}
			break;
			case ((NU8) 2):
			{
				NIM_BOOL LOC5;
				LOC5 = 0;
				LOC5 = stack[((NI)(sp - ((NI) 1)))- 0];
				if (LOC5) goto LA6;
				LOC5 = stack[((NI)(sp - ((NI) 2)))- 0];
				LA6: ;
				stack[((NI)(sp - ((NI) 2)))- 0] = LOC5;
				sp -= ((NI) 1);
			}
			break;
			case ((NU8) 3):
			{
				NIM_BOOL LOC8;
				LOC8 = 0;
				LOC8 = stack[((NI)(sp - ((NI) 1)))- 0];
				if (!(LOC8)) goto LA9;
				LOC8 = stack[((NI)(sp - ((NI) 2)))- 0];
				LA9: ;
				stack[((NI)(sp - ((NI) 2)))- 0] = LOC8;
				sp -= ((NI) 1);
			}
			break;
			case ((NU8) 4):
			{
				stack[((NI)(sp - ((NI) 1)))- 0] = !(stack[((NI)(sp - ((NI) 1)))- 0]);
			}
			break;
			case ((NU8) 5):
			{
				stack[(sp)- 0] = ((*n).kind == ((NU8) 3));
				sp += ((NI) 1);
			}
			break;
			case ((NU8) 6):
			{
				stack[(sp)- 0] = isatom_228905(n);
				sp += ((NI) 1);
			}
			break;
			case ((NU8) 7):
			{
				stack[(sp)- 0] = ((*n).kind >= ((NU8) 5) && (*n).kind <= ((NU8) 23));
				sp += ((NI) 1);
			}
			break;
			case ((NU8) 8):
			{
				stack[(sp)- 0] = ((*n).kind == ((NU8) 2));
				sp += ((NI) 1);
			}
			break;
			case ((NU8) 9):
			{
				stack[(sp)- 0] = ((*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));
				sp += ((NI) 1);
			}
			break;
			case ((NU8) 10):
			{
				NU8 kind;
				NIM_BOOL LOC17;
				kind = ((NU8) (((NU8)(code->data[(NI)(pc + ((NI) 1))]))));
				LOC17 = 0;
				LOC17 = ((*n).kind == ((NU8) 3));
				if (!(LOC17)) goto LA18;
				LOC17 = ((*(*n).kindU.S4.sym).kind == kind);
				LA18: ;
				stack[(sp)- 0] = LOC17;
				sp += ((NI) 1);
				pc += ((NI) 1);
			}
			break;
			case ((NU8) 11):
			{
				NU8 kind;
				kind = ((NU8) (((NU8)(code->data[(NI)(pc + ((NI) 1))]))));
				stack[(sp)- 0] = ((*n).kind == kind);
				sp += ((NI) 1);
				pc += ((NI) 1);
			}
			break;
			case ((NU8) 12):
			{
				NU8 LOC21;
				LOC21 = 0;
				LOC21 = isassignable_304056(NIM_NIL, n, NIM_FALSE);
				stack[(sp)- 0] = ((6 &(1<<((LOC21)&7)))!=0);
				sp += ((NI) 1);
			}
			break;
			case ((NU8) 13):
			{
				NU8 LOC23;
				LOC23 = 0;
				LOC23 = isassignable_304056(NIM_NIL, n, NIM_FALSE);
				stack[(sp)- 0] = (LOC23 == ((NU8) 2));
				sp += ((NI) 1);
			}
			break;
			case ((NU8) 14):
			{
				NU8 LOC25;
				LOC25 = 0;
				LOC25 = checkforsideeffects_303869(n);
				stack[(sp)- 0] = (LOC25 == ((NU8) 1));
				sp += ((NI) 1);
			}
			break;
			case ((NU8) 15):
			{
				NU8 LOC27;
				LOC27 = 0;
				LOC27 = checkforsideeffects_303869(n);
				stack[(sp)- 0] = !((LOC27 == ((NU8) 1)));
				sp += ((NI) 1);
			}
			break;
			}
			pc += ((NI) 1);
		}
	} LA1: ;
	result = stack[((NI)(sp - ((NI) 1)))- 0];
	return result;
}

N_NIMCALL(NIM_BOOL, islvalue_304281)(Tnode223809* n) {
	NIM_BOOL result;
	NU8 LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = isassignable_304056(NIM_NIL, n, NIM_FALSE);
	result = ((22 &(1<<((LOC1)&7)))!=0);
	return result;
}

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

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

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

N_NIMCALL(void, patternerror_303051)(Tnode223809* n) {
	NimStringDesc* LOC1;
	LOC1 = 0;
	LOC1 = rendertree_245059(n, 4);
	localerror_194128((*n).info, ((NU16) 1), LOC1);
}

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;
}

static N_INLINE(void, add_303061)(NimStringDesc** code, NU8 op) {
	(*code) = addChar((*code), ((NIM_CHAR) (((NI) (op)))));
}

N_NIMCALL(void, compileconstraints_303113)(Tnode223809* p, NimStringDesc** result) {
{	switch ((*p).kind) {
	case ((NU8) 27):
	case ((NU8) 29):
	case ((NU8) 30):
	case ((NU8) 31):
	case ((NU8) 26):
	case ((NU8) 28):
	case ((NU8) 32):
	{
		Tident196021* op;
		{
			if (!!(((*(*p).kindU.S6.sons->data[((NI) 0)]).kind == ((NU8) 2)))) goto LA4;
			patternerror_303051((*p).kindU.S6.sons->data[((NI) 0)]);
			goto BeforeRet;
		}
		LA4: ;
		op = (*(*p).kindU.S6.sons->data[((NI) 0)]).kindU.S5.ident;
		{
			NI LOC8;
			LOC8 = 0;
			LOC8 = len_224098(p);
			if (!(LOC8 == ((NI) 3))) goto LA9;
			{
				NIM_BOOL LOC13;
				LOC13 = 0;
				LOC13 = eqStrings((*op).s, ((NimStringDesc*) &TMP3253));
				if (LOC13) goto LA14;
				LOC13 = ((*op).Sup.id == ((NI) 49));
				LA14: ;
				if (!LOC13) goto LA15;
				compileconstraints_303113((*p).kindU.S6.sons->data[((NI) 1)], result);
				compileconstraints_303113((*p).kindU.S6.sons->data[((NI) 2)], result);
				add_303061(result, ((NU8) 2));
			}
			goto LA11;
			LA15: ;
			{
				NIM_BOOL LOC18;
				LOC18 = 0;
				LOC18 = eqStrings((*op).s, ((NimStringDesc*) &TMP3254));
				if (LOC18) goto LA19;
				LOC18 = ((*op).Sup.id == ((NI) 2));
				LA19: ;
				if (!LOC18) goto LA20;
				compileconstraints_303113((*p).kindU.S6.sons->data[((NI) 1)], result);
				compileconstraints_303113((*p).kindU.S6.sons->data[((NI) 2)], result);
				add_303061(result, ((NU8) 3));
			}
			goto LA11;
			LA20: ;
			{
				patternerror_303051(p);
			}
			LA11: ;
		}
		goto LA6;
		LA9: ;
		{
			NIM_BOOL LOC24;
			NI LOC25;
			NIM_BOOL LOC27;
			LOC24 = 0;
			LOC25 = 0;
			LOC25 = len_224098(p);
			LOC24 = (LOC25 == ((NI) 2));
			if (!(LOC24)) goto LA26;
			LOC27 = 0;
			LOC27 = eqStrings((*op).s, ((NimStringDesc*) &TMP3255));
			if (LOC27) goto LA28;
			LOC27 = ((*op).Sup.id == ((NI) 45));
			LA28: ;
			LOC24 = LOC27;
			LA26: ;
			if (!LOC24) goto LA29;
			compileconstraints_303113((*p).kindU.S6.sons->data[((NI) 1)], result);
			add_303061(result, ((NU8) 4));
		}
		goto LA6;
		LA29: ;
		{
			patternerror_303051(p);
		}
		LA6: ;
	}
	break;
	case ((NU8) 53):
	case ((NU8) 37):
	{
		{
			NI LOC35;
			LOC35 = 0;
			LOC35 = len_224098(p);
			if (!(LOC35 == ((NI) 1))) goto LA36;
			compileconstraints_303113((*p).kindU.S6.sons->data[((NI) 0)], result);
		}
		goto LA33;
		LA36: ;
		{
			patternerror_303051(p);
		}
		LA33: ;
	}
	break;
	case ((NU8) 2):
	{
		NimStringDesc* spec;
		spec = nsuNormalize((*(*p).kindU.S5.ident).s);
		switch (hashString(spec) & 15) {
		case 2: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3266))) goto LA50;
break;
		case 4: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3258))) goto LA42;
if (eqStrings(spec, ((NimStringDesc*) &TMP3263))) goto LA47;
if (eqStrings(spec, ((NimStringDesc*) &TMP3265))) goto LA49;
break;
		case 6: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3259))) goto LA43;
break;
		case 10: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3262))) goto LA46;
break;
		case 11: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3256))) goto LA40;
break;
		case 12: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3257))) goto LA41;
break;
		case 13: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3260))) goto LA44;
break;
		case 14: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3261))) goto LA45;
if (eqStrings(spec, ((NimStringDesc*) &TMP3264))) goto LA48;
break;
		}
		goto LA51;
		LA40: ;
		{
			add_303061(result, ((NU8) 6));
		}
		goto LA52;
		LA41: ;
		{
			add_303061(result, ((NU8) 7));
		}
		goto LA52;
		LA42: ;
		{
			add_303061(result, ((NU8) 5));
		}
		goto LA52;
		LA43: ;
		{
			add_303061(result, ((NU8) 8));
		}
		goto LA52;
		LA44: ;
		{
			add_303061(result, ((NU8) 9));
		}
		goto LA52;
		LA45: ;
		{
			(*result)->data[((NI) 0)] = 2;
		}
		goto LA52;
		LA46: ;
		{
			(*result)->data[((NI) 0)] = 3;
		}
		goto LA52;
		LA47: ;
		{
			add_303061(result, ((NU8) 12));
		}
		goto LA52;
		LA48: ;
		{
			add_303061(result, ((NU8) 13));
		}
		goto LA52;
		LA49: ;
		{
			add_303061(result, ((NU8) 14));
		}
		goto LA52;
		LA50: ;
		{
			add_303061(result, ((NU8) 15));
		}
		goto LA52;
		LA51: ;
		{
			{
				NimStringDesc* LOC69;
				if (!NIM_FALSE) goto LA67;
				LOC69 = 0;
				LOC69 = HEX24_194279(TMP3267);
				internalerror_194191(LOC69);
			}
			LA67: ;
			{
				NU8 i_303423;
				NI res_303644;
				i_303423 = 0;
				res_303644 = ((NI) 0);
				{
					while (1) {
						if (!(res_303644 <= ((NI) 25))) goto LA72;
						i_303423 = ((NU8) (res_303644));
						{
							NimStringDesc* LOC75;
							NI LOC76;
							LOC75 = 0;
							LOC75 = copyStr(reprEnum(i_303423, (&NTI223441)), ((NI) 2));
							LOC76 = 0;
							LOC76 = nsuCmpIgnoreStyle(LOC75, spec);
							if (!(LOC76 == ((NI) 0))) goto LA77;
							add_303061(result, ((NU8) 10));
							(*result) = addChar((*result), ((NIM_CHAR) (((NI) (i_303423)))));
							goto BeforeRet;
						}
						LA77: ;
						res_303644 += ((NI) 1);
					} LA72: ;
				}
			}
			{
				NimStringDesc* LOC83;
				if (!NIM_FALSE) goto LA81;
				LOC83 = 0;
				LOC83 = HEX24_194279(TMP3269);
				internalerror_194191(LOC83);
			}
			LA81: ;
			{
				NU8 i_303623;
				NI res_303652;
				i_303623 = 0;
				res_303652 = ((NI) 0);
				{
					while (1) {
						if (!(res_303652 <= ((NI) 158))) goto LA86;
						i_303623 = ((NU8) (res_303652));
						{
							NI LOC89;
							LOC89 = 0;
							LOC89 = nsuCmpIgnoreStyle(reprEnum(i_303623, (&NTI223029)), spec);
							if (!(LOC89 == ((NI) 0))) goto LA90;
							add_303061(result, ((NU8) 11));
							(*result) = addChar((*result), ((NIM_CHAR) (((NI) (i_303623)))));
							goto BeforeRet;
						}
						LA90: ;
						res_303652 += ((NI) 1);
					} LA86: ;
				}
			}
			patternerror_303051(p);
		}
		LA52: ;
	}
	break;
	default:
	{
		patternerror_303051(p);
	}
	break;
	}
	}BeforeRet: ;
}

N_NIMCALL(Tnode223809*, semnodekindconstraints_303679)(Tnode223809* p) {
	Tnode223809* result;
	result = 0;
	result = newnodei_225351(((NU8) 20), (*p).info);
	asgnRefNoCycle((void**) (&(*result).kindU.S3.strval), rawNewString(((NI) 10)));
	(*result).kindU.S3.strval = addChar((*result).kindU.S3.strval, 1);
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = len_224098(p);
		if (!(((NI) 2) <= LOC3)) goto LA4;
		{
			NI i_303831;
			NI HEX3Atmp_303839;
			NI LOC7;
			NI res_303842;
			i_303831 = 0;
			HEX3Atmp_303839 = 0;
			LOC7 = 0;
			LOC7 = len_224098(p);
			HEX3Atmp_303839 = (LOC7 - 1);
			res_303842 = ((NI) 1);
			{
				while (1) {
					if (!(res_303842 <= HEX3Atmp_303839)) goto LA9;
					i_303831 = res_303842;
					compileconstraints_303113((*p).kindU.S6.sons->data[i_303831], (&(*result).kindU.S3.strval));
					res_303842 += ((NI) 1);
				} LA9: ;
			}
		}
		{
			if (!(((NI) 63) < ((*result).kindU.S3.strval ? (*result).kindU.S3.strval->Sup.len : 0))) goto LA12;
			internalerror_194172((*p).info, ((NimStringDesc*) &TMP3270));
		}
		LA12: ;
	}
	goto LA1;
	LA4: ;
	{
		patternerror_303051(p);
	}
	LA1: ;
	add_303061((&(*result).kindU.S3.strval), ((NU8) 1));
	return result;
}

N_NIMCALL(NU8, whichalias_303080)(Tsym223841* p) {
	NU8 result;
	result = 0;
	{
		if (!!(((*p).constraint == NIM_NIL))) goto LA3;
		result = ((NU8) (((NU8)((*(*p).constraint).kindU.S3.strval->data[((NI) 0)]))));
	}
	goto LA1;
	LA3: ;
	{
		result = ((NU8) 1);
	}
	LA1: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, compiler_parampatternsInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_parampatternsDatInit000)(void) {
}

