/* 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 tnode225816 tnode225816;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct ttype225852 ttype225852;
typedef struct tlineinfo195539 tlineinfo195539;
typedef struct tsym225846 tsym225846;
typedef struct tident200021 tident200021;
typedef struct tnodeseq225810 tnodeseq225810;
typedef struct tidobj200015 tidobj200015;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct ttypeseq225848 ttypeseq225848;
typedef struct tscope225840 tscope225840;
typedef struct TY225947 TY225947;
typedef struct tinstantiation225836 tinstantiation225836;
typedef struct tstrtable225820 tstrtable225820;
typedef struct tsymseq225818 tsymseq225818;
typedef struct tloc225830 tloc225830;
typedef struct trope177009 trope177009;
typedef struct tlib225834 tlib225834;
typedef struct tcell44935 tcell44935;
typedef struct tcellseq44951 tcellseq44951;
typedef struct tgcheap47016 tgcheap47016;
typedef struct tcellset44947 tcellset44947;
typedef struct tpagedesc44943 tpagedesc44943;
typedef struct tmemregion27210 tmemregion27210;
typedef struct tsmallchunk26440 tsmallchunk26440;
typedef struct tllchunk27204 tllchunk27204;
typedef struct tbigchunk26442 tbigchunk26442;
typedef struct tintset26417 tintset26417;
typedef struct ttrunk26413 ttrunk26413;
typedef struct tavlnode27208 tavlnode27208;
typedef struct tgcstat47014 tgcstat47014;
typedef struct TY84745 TY84745;
typedef struct TY225936 TY225936;
typedef struct tlistentry127022 tlistentry127022;
typedef struct tbasechunk26438 tbasechunk26438;
typedef struct tfreecell26430 tfreecell26430;
typedef NIM_BOOL TY322386[65];
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tlineinfo195539  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tnode225816  {
ttype225852* Typ;
tlineinfo195539 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym225846* Sym;
} S4;
struct {tident200021* Ident;
} S5;
struct {tnodeseq225810* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
typedef N_NIMCALL_PTR(void, TY3089) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3094) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3089 marker;
TY3094 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj200015  {
  TNimObject Sup;
NI Id;
};
struct  tstrtable225820  {
NI Counter;
tsymseq225818* Data;
};
struct  tloc225830  {
NU8 K;
NU8 S;
NU8 Flags;
ttype225852* T;
trope177009* R;
trope177009* Heaproot;
};
struct  tsym225846  {
  tidobj200015 Sup;
NU8 Kind;
union {
struct {ttypeseq225848* Typeinstcache;
tscope225840* Typscope;
} S1;
struct {TY225947* Procinstcache;
tscope225840* Scope;
} S2;
struct {TY225947* Usedgenerics;
tstrtable225820 Tab;
} S3;
struct {tsym225846* Guard;
} S4;
} kindU;
NU16 Magic;
ttype225852* Typ;
tident200021* Name;
tlineinfo195539 Info;
tsym225846* Owner;
NU32 Flags;
tnode225816* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc225830 Loc;
tlib225834* Annex;
tnode225816* Constraint;
};
struct  ttype225852  {
  tidobj200015 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq225848* Sons;
tnode225816* N;
tsym225846* Owner;
tsym225846* Sym;
tsym225846* Destructor;
tsym225846* Deepcopy;
NI64 Size;
NI16 Align;
NI16 Locklevel;
tloc225830 Loc;
};
struct  tcell44935  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq44951  {
NI Len;
NI Cap;
tcell44935** D;
};
struct  tcellset44947  {
NI Counter;
NI Max;
tpagedesc44943* Head;
tpagedesc44943** Data;
};
typedef tsmallchunk26440* TY27222[512];
typedef ttrunk26413* ttrunkbuckets26415[256];
struct  tintset26417  {
ttrunkbuckets26415 Data;
};
struct  tmemregion27210  {
NI Minlargeobj;
NI Maxlargeobj;
TY27222 Freesmallchunks;
tllchunk27204* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk26442* Freechunkslist;
tintset26417 Chunkstarts;
tavlnode27208* Root;
tavlnode27208* Deleted;
tavlnode27208* Last;
tavlnode27208* Freeavlnodes;
};
struct  tgcstat47014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap47016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq44951 Zct;
tcellseq44951 Decstack;
tcellset44947 Cycleroots;
tcellseq44951 Tempstack;
NI Recgclock;
tmemregion27210 Region;
tgcstat47014 Stat;
};
struct  tident200021  {
  tidobj200015 Sup;
NimStringDesc* S;
tident200021* Next;
NI H;
};
struct TY84745 {
NimStringDesc* Field0;
NI Field1;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tscope225840  {
NI Depthlevel;
tstrtable225820 Symbols;
tnodeseq225810* Usingsyms;
tscope225840* Parent;
};
struct  tinstantiation225836  {
tsym225846* Sym;
ttypeseq225848* Concretetypes;
TY225936* Usedby;
};
struct  trope177009  {
  TNimObject Sup;
trope177009* Left;
trope177009* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlistentry127022  {
  TNimObject Sup;
tlistentry127022* Prev;
tlistentry127022* Next;
};
struct  tlib225834  {
  tlistentry127022 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope177009* Name;
tnode225816* Path;
};
typedef NI TY26420[8];
struct  tpagedesc44943  {
tpagedesc44943* Next;
NI Key;
TY26420 Bits;
};
struct  tbasechunk26438  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk26440  {
  tbasechunk26438 Sup;
tsmallchunk26440* Next;
tsmallchunk26440* Prev;
tfreecell26430* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk27204  {
NI Size;
NI Acc;
tllchunk27204* Next;
};
struct  tbigchunk26442  {
  tbasechunk26438 Sup;
tbigchunk26442* Next;
tbigchunk26442* Prev;
NI Align;
NF Data;
};
struct  ttrunk26413  {
ttrunk26413* Next;
NI Key;
TY26420 Bits;
};
typedef tavlnode27208* TY27214[2];
struct  tavlnode27208  {
TY27214 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  tfreecell26430  {
tfreecell26430* Next;
NI Zerofield;
};
struct tnodeseq225810 {
  TGenericSeq Sup;
  tnode225816* data[SEQ_DECL_SIZE];
};
struct ttypeseq225848 {
  TGenericSeq Sup;
  ttype225852* data[SEQ_DECL_SIZE];
};
struct TY225947 {
  TGenericSeq Sup;
  tinstantiation225836* data[SEQ_DECL_SIZE];
};
struct tsymseq225818 {
  TGenericSeq Sup;
  tsym225846* data[SEQ_DECL_SIZE];
};
struct TY225936 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
static N_INLINE(NIM_BOOL, isatom_232963)(tnode225816* n);
N_NIMCALL(NU8, isassignable_322003)(tsym225846* owner, tnode225816* n);
N_NIMCALL(ttype225852*, skiptypes_230245)(ttype225852* t, NU64 kinds);
N_NIMCALL(NIM_BOOL, comparetypes_270571)(ttype225852* x, ttype225852* y, NU8 cmp, NU8 flags);
N_NIMCALL(NU16, getmagic_261845)(tnode225816* op);
N_NIMCALL(NU8, checkforsideeffects_321747)(tnode225816* n);
static N_INLINE(NIM_BOOL, isroutine_232781)(tsym225846* s);
static N_INLINE(NI, len_226364)(tnode225816* n);
N_NIMCALL(tnode225816*, newnodei_226138)(NU8 kind, tlineinfo195539 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(tcell44935*, usrtocell_48646)(void* usr);
static N_INLINE(void, rtladdzct_50204)(tcell44935* c);
N_NOINLINE(void, addzct_48617)(tcellseq44951* s, tcell44935* c);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_NIMCALL(void, compileconstraints_321129)(tnode225816* p, NimStringDesc** result);
N_NIMCALL(void, patternerror_321051)(tnode225816* n);
N_NIMCALL(void, localerror_197955)(tlineinfo195539 info, NU16 msg, NimStringDesc* arg);
N_NIMCALL(NimStringDesc*, rendertree_250058)(tnode225816* n, NU8 renderflags);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(void, add_321061)(NimStringDesc** code, NU8 op);
N_NIMCALL(NimStringDesc*, nsuNormalize)(NimStringDesc* s);
N_NIMCALL(NI, hashString)(NimStringDesc* s);
N_NIMCALL(void, internalerror_198006)(NimStringDesc* errmsg);
N_NIMCALL(NimStringDesc*, HEX24_198126)(TY84745 x_198130);
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_80907, TNimType* typ);
N_NIMCALL(void, internalerror_197987)(tlineinfo195539 info, NimStringDesc* errmsg);
STRING_LITERAL(TMP3006, "|", 1);
STRING_LITERAL(TMP3007, "&", 1);
STRING_LITERAL(TMP3008, "~", 1);
STRING_LITERAL(TMP3009, "atom", 4);
STRING_LITERAL(TMP3010, "lit", 3);
STRING_LITERAL(TMP3011, "sym", 3);
STRING_LITERAL(TMP3012, "ident", 5);
STRING_LITERAL(TMP3013, "call", 4);
STRING_LITERAL(TMP3014, "alias", 5);
STRING_LITERAL(TMP3015, "noalias", 7);
STRING_LITERAL(TMP3016, "lvalue", 6);
STRING_LITERAL(TMP3017, "local", 5);
STRING_LITERAL(TMP3018, "sideeffect", 10);
STRING_LITERAL(TMP3019, "nosideeffect", 12);
STRING_LITERAL(TMP3021, "compiler/parampatterns.nim", 26);
NIM_CONST TY84745 TMP3020 = {((NimStringDesc*) &TMP3021),
100}
;
NIM_CONST TY84745 TMP3022 = {((NimStringDesc*) &TMP3021),
107}
;
STRING_LITERAL(TMP3023, "parameter pattern too complex", 29);
extern tgcheap47016 gch_47044;
extern TNimType NTI225445; /* TSymKind */
extern TNimType NTI225029; /* TNodeKind */

static N_INLINE(NIM_BOOL, isatom_232963)(tnode225816* 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_322003)(tsym225846* owner, tnode225816* n) {
	NU8 result;
	result = 0;
	result = ((NU8) 0);
	switch ((*n).Kind) {
	case ((NU8) 3):
	{
		{
			if (!((2336 &(1<<(((*(*n).kindU.S4.Sym).Kind)&31)))!=0)) goto LA4;
			{
				NIM_BOOL LOC8;
				NIM_BOOL LOC9;
				LOC8 = 0;
				LOC9 = 0;
				LOC9 = !((owner == NIM_NIL));
				if (!(LOC9)) goto LA10;
				LOC9 = ((*owner).Sup.Id == (*(*(*n).kindU.S4.Sym).Owner).Sup.Id);
				LA10: ;
				LOC8 = LOC9;
				if (!(LOC8)) goto LA11;
				LOC8 = !((((*(*n).kindU.S4.Sym).Flags &(1<<((((NU8) 3))&31)))!=0));
				LA11: ;
				if (!LOC8) goto LA12;
				result = ((NU8) 2);
			}
			goto LA6;
			LA12: ;
			{
				result = ((NU8) 1);
			}
			LA6: ;
		}
		LA4: ;
	}
	break;
	case ((NU8) 45):
	{
		{
			ttype225852* LOC18;
			LOC18 = 0;
			LOC18 = skiptypes_230245((*(*n).kindU.S6.Sons->data[0]).Typ, IL64(211106232576000));
			if (!((14680064 &(IL64(1)<<(((*LOC18).Kind)&IL64(63))))!=0)) goto LA19;
			result = ((NU8) 1);
		}
		goto LA16;
		LA19: ;
		{
			result = isassignable_322003(owner, (*n).kindU.S6.Sons->data[0]);
		}
		LA16: ;
		{
			NIM_BOOL LOC24;
			LOC24 = 0;
			LOC24 = !((result == ((NU8) 0)));
			if (!(LOC24)) goto LA25;
			LOC24 = (((*(*(*n).kindU.S6.Sons->data[1]).kindU.S4.Sym).Flags &(1<<((((NU8) 18))&31)))!=0);
			LA25: ;
			if (!LOC24) goto LA26;
			result = ((NU8) 3);
		}
		LA26: ;
	}
	break;
	case ((NU8) 42):
	{
		{
			ttype225852* LOC31;
			LOC31 = 0;
			LOC31 = skiptypes_230245((*(*n).kindU.S6.Sons->data[0]).Typ, IL64(211106232576000));
			if (!((14680064 &(IL64(1)<<(((*LOC31).Kind)&IL64(63))))!=0)) goto LA32;
			result = ((NU8) 1);
		}
		goto LA29;
		LA32: ;
		{
			result = isassignable_322003(owner, (*n).kindU.S6.Sons->data[0]);
		}
		LA29: ;
	}
	break;
	case ((NU8) 58):
	case ((NU8) 59):
	case ((NU8) 60):
	{
		{
			ttype225852* LOC38;
			LOC38 = 0;
			LOC38 = skiptypes_230245((*n).Typ, IL64(211106247256064));
			if (!((134610944 &(IL64(1)<<(((*LOC38).Kind)&IL64(63))))!=0)) goto LA39;
			result = isassignable_322003(owner, (*n).kindU.S6.Sons->data[1]);
		}
		goto LA36;
		LA39: ;
		{
			NIM_BOOL LOC42;
			LOC42 = 0;
			LOC42 = comparetypes_270571((*n).Typ, (*(*n).kindU.S6.Sons->data[1]).Typ, ((NU8) 1), 0);
			if (!LOC42) goto LA43;
			result = isassignable_322003(owner, (*n).kindU.S6.Sons->data[1]);
		}
		goto LA36;
		LA43: ;
		LA36: ;
	}
	break;
	case ((NU8) 65):
	case ((NU8) 47):
	{
		result = ((NU8) 1);
	}
	break;
	case ((NU8) 67):
	case ((NU8) 66):
	case ((NU8) 46):
	{
		result = isassignable_322003(owner, (*n).kindU.S6.Sons->data[0]);
	}
	break;
	case ((NU8) 27):
	case ((NU8) 29):
	case ((NU8) 30):
	case ((NU8) 31):
	case ((NU8) 26):
	case ((NU8) 28):
	case ((NU8) 32):
	{
		{
			NU16 LOC50;
			LOC50 = 0;
			LOC50 = getmagic_261845(n);
			if (!(LOC50 == ((NU16) 151))) goto LA51;
			result = isassignable_322003(owner, (*n).kindU.S6.Sons->data[1]);
		}
		LA51: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

static N_INLINE(NIM_BOOL, isroutine_232781)(tsym225846* s) {
	NIM_BOOL result;
	result = 0;
	result = ((520192 &(1<<(((*s).Kind)&31)))!=0);
	return result;
}

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

N_NIMCALL(NU8, checkforsideeffects_321747)(tnode225816* 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):
	{
		tnode225816* op;
		op = (*n).kindU.S6.Sons->data[0];
		{
			NIM_BOOL LOC4;
			tsym225846* s;
			LOC4 = 0;
			LOC4 = ((*op).Kind == ((NU8) 3));
			if (!(LOC4)) goto LA5;
			LOC4 = isroutine_232781((*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_321851;
			NI HEX3Atmp_321959;
			NI LOC17;
			NI res_321962;
			i_321851 = 0;
			HEX3Atmp_321959 = 0;
			LOC17 = 0;
			LOC17 = len_226364(n);
			HEX3Atmp_321959 = (LOC17 - 1);
			res_321962 = 0;
			{
				while (1) {
					NU8 ret;
					if (!(res_321962 <= HEX3Atmp_321959)) goto LA19;
					i_321851 = res_321962;
					ret = checkforsideeffects_321747((*n).kindU.S6.Sons->data[i_321851]);
					{
						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_321962 += 1;
				} LA19: ;
			}
		}
	}
	break;
	case ((NU8) 0) ... ((NU8) 23):
	{
		result = ((NU8) 2);
	}
	break;
	default:
	{
		{
			NI i_321915;
			NI HEX3Atmp_321965;
			NI LOC32;
			NI res_321968;
			i_321915 = 0;
			HEX3Atmp_321965 = 0;
			LOC32 = 0;
			LOC32 = len_226364(n);
			HEX3Atmp_321965 = (LOC32 - 1);
			res_321968 = 0;
			{
				while (1) {
					NU8 ret;
					if (!(res_321968 <= HEX3Atmp_321965)) goto LA34;
					i_321915 = res_321968;
					ret = checkforsideeffects_321747((*n).kindU.S6.Sons->data[i_321915]);
					{
						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_321968 += 1;
				} LA34: ;
			}
		}
	}
	break;
	}
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, matchnodekinds_322381)(tnode225816* p, tnode225816* n) {
	NIM_BOOL result;
	TY322386 stack;
	NI sp;
	NimStringDesc* code;
	NI pc;
	result = 0;
	stack[(0)- 0] = NIM_TRUE;
	sp = 1;
	code = (*p).kindU.S3.Strval;
	pc = 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[((NI64)(sp - 1))- 0];
				if (LOC5) goto LA6;
				LOC5 = stack[((NI64)(sp - 2))- 0];
				LA6: ;
				stack[((NI64)(sp - 2))- 0] = LOC5;
				sp -= 1;
			}
			break;
			case ((NU8) 3):
			{
				NIM_BOOL LOC8;
				LOC8 = 0;
				LOC8 = stack[((NI64)(sp - 1))- 0];
				if (!(LOC8)) goto LA9;
				LOC8 = stack[((NI64)(sp - 2))- 0];
				LA9: ;
				stack[((NI64)(sp - 2))- 0] = LOC8;
				sp -= 1;
			}
			break;
			case ((NU8) 4):
			{
				stack[((NI64)(sp - 1))- 0] = !(stack[((NI64)(sp - 1))- 0]);
			}
			break;
			case ((NU8) 5):
			{
				stack[(sp)- 0] = ((*n).Kind == ((NU8) 3));
				sp += 1;
			}
			break;
			case ((NU8) 6):
			{
				stack[(sp)- 0] = isatom_232963(n);
				sp += 1;
			}
			break;
			case ((NU8) 7):
			{
				stack[(sp)- 0] = ((*n).Kind >= ((NU8) 5) && (*n).Kind <= ((NU8) 23));
				sp += 1;
			}
			break;
			case ((NU8) 8):
			{
				stack[(sp)- 0] = ((*n).Kind == ((NU8) 2));
				sp += 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 += 1;
			}
			break;
			case ((NU8) 10):
			{
				NU8 kind;
				NIM_BOOL LOC17;
				kind = ((NU8) (((NU8)(code->data[(NI64)(pc + 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 += 1;
				pc += 1;
			}
			break;
			case ((NU8) 11):
			{
				NU8 kind;
				kind = ((NU8) (((NU8)(code->data[(NI64)(pc + 1)]))));
				stack[(sp)- 0] = ((*n).Kind == kind);
				sp += 1;
				pc += 1;
			}
			break;
			case ((NU8) 12):
			{
				NU8 LOC21;
				LOC21 = 0;
				LOC21 = isassignable_322003(NIM_NIL, n);
				stack[(sp)- 0] = ((6 &(1<<((LOC21)&7)))!=0);
				sp += 1;
			}
			break;
			case ((NU8) 13):
			{
				NU8 LOC23;
				LOC23 = 0;
				LOC23 = isassignable_322003(NIM_NIL, n);
				stack[(sp)- 0] = (LOC23 == ((NU8) 2));
				sp += 1;
			}
			break;
			case ((NU8) 14):
			{
				NU8 LOC25;
				LOC25 = 0;
				LOC25 = checkforsideeffects_321747(n);
				stack[(sp)- 0] = (LOC25 == ((NU8) 1));
				sp += 1;
			}
			break;
			case ((NU8) 15):
			{
				NU8 LOC27;
				LOC27 = 0;
				LOC27 = checkforsideeffects_321747(n);
				stack[(sp)- 0] = !((LOC27 == ((NU8) 1)));
				sp += 1;
			}
			break;
			}
			pc += 1;
		}
	} LA1: ;
	result = stack[((NI64)(sp - 1))- 0];
	return result;
}

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

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

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

N_NIMCALL(void, patternerror_321051)(tnode225816* n) {
	NimStringDesc* LOC1;
	LOC1 = 0;
	LOC1 = rendertree_250058(n, 4);
	localerror_197955((*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)), (NI64)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

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

N_NIMCALL(void, compileconstraints_321129)(tnode225816* 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):
	{
		tident200021* op;
		{
			if (!!(((*(*p).kindU.S6.Sons->data[0]).Kind == ((NU8) 2)))) goto LA4;
			patternerror_321051((*p).kindU.S6.Sons->data[0]);
			goto BeforeRet;
		}
		LA4: ;
		op = (*(*p).kindU.S6.Sons->data[0]).kindU.S5.Ident;
		{
			NI LOC8;
			LOC8 = 0;
			LOC8 = len_226364(p);
			if (!(LOC8 == 3)) goto LA9;
			{
				NIM_BOOL LOC13;
				LOC13 = 0;
				LOC13 = eqStrings((*op).S, ((NimStringDesc*) &TMP3006));
				if (LOC13) goto LA14;
				LOC13 = ((*op).Sup.Id == 48);
				LA14: ;
				if (!LOC13) goto LA15;
				compileconstraints_321129((*p).kindU.S6.Sons->data[1], result);
				compileconstraints_321129((*p).kindU.S6.Sons->data[2], result);
				add_321061(result, ((NU8) 2));
			}
			goto LA11;
			LA15: ;
			{
				NIM_BOOL LOC18;
				LOC18 = 0;
				LOC18 = eqStrings((*op).S, ((NimStringDesc*) &TMP3007));
				if (LOC18) goto LA19;
				LOC18 = ((*op).Sup.Id == 2);
				LA19: ;
				if (!LOC18) goto LA20;
				compileconstraints_321129((*p).kindU.S6.Sons->data[1], result);
				compileconstraints_321129((*p).kindU.S6.Sons->data[2], result);
				add_321061(result, ((NU8) 3));
			}
			goto LA11;
			LA20: ;
			{
				patternerror_321051(p);
			}
			LA11: ;
		}
		goto LA6;
		LA9: ;
		{
			NIM_BOOL LOC24;
			NI LOC25;
			NIM_BOOL LOC27;
			LOC24 = 0;
			LOC25 = 0;
			LOC25 = len_226364(p);
			LOC24 = (LOC25 == 2);
			if (!(LOC24)) goto LA26;
			LOC27 = 0;
			LOC27 = eqStrings((*op).S, ((NimStringDesc*) &TMP3008));
			if (LOC27) goto LA28;
			LOC27 = ((*op).Sup.Id == 44);
			LA28: ;
			LOC24 = LOC27;
			LA26: ;
			if (!LOC24) goto LA29;
			compileconstraints_321129((*p).kindU.S6.Sons->data[1], result);
			add_321061(result, ((NU8) 4));
		}
		goto LA6;
		LA29: ;
		{
			patternerror_321051(p);
		}
		LA6: ;
	}
	break;
	case ((NU8) 53):
	case ((NU8) 37):
	{
		{
			NI LOC35;
			LOC35 = 0;
			LOC35 = len_226364(p);
			if (!(LOC35 == 1)) goto LA36;
			compileconstraints_321129((*p).kindU.S6.Sons->data[0], result);
		}
		goto LA33;
		LA36: ;
		{
			patternerror_321051(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*) &TMP3019))) goto LA50;
break;
		case 4: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3011))) goto LA42;
if (eqStrings(spec, ((NimStringDesc*) &TMP3016))) goto LA47;
if (eqStrings(spec, ((NimStringDesc*) &TMP3018))) goto LA49;
break;
		case 6: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3012))) goto LA43;
break;
		case 10: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3015))) goto LA46;
break;
		case 11: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3009))) goto LA40;
break;
		case 12: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3010))) goto LA41;
break;
		case 13: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3013))) goto LA44;
break;
		case 14: 
if (eqStrings(spec, ((NimStringDesc*) &TMP3014))) goto LA45;
if (eqStrings(spec, ((NimStringDesc*) &TMP3017))) goto LA48;
break;
		}
		goto LA51;
		LA40: ;
		{
			add_321061(result, ((NU8) 6));
		}
		goto LA52;
		LA41: ;
		{
			add_321061(result, ((NU8) 7));
		}
		goto LA52;
		LA42: ;
		{
			add_321061(result, ((NU8) 5));
		}
		goto LA52;
		LA43: ;
		{
			add_321061(result, ((NU8) 8));
		}
		goto LA52;
		LA44: ;
		{
			add_321061(result, ((NU8) 9));
		}
		goto LA52;
		LA45: ;
		{
			(*result)->data[0] = 2;
		}
		goto LA52;
		LA46: ;
		{
			(*result)->data[0] = 3;
		}
		goto LA52;
		LA47: ;
		{
			add_321061(result, ((NU8) 12));
		}
		goto LA52;
		LA48: ;
		{
			add_321061(result, ((NU8) 13));
		}
		goto LA52;
		LA49: ;
		{
			add_321061(result, ((NU8) 14));
		}
		goto LA52;
		LA50: ;
		{
			add_321061(result, ((NU8) 15));
		}
		goto LA52;
		LA51: ;
		{
			{
				NimStringDesc* LOC69;
				if (!NIM_FALSE) goto LA67;
				LOC69 = 0;
				LOC69 = HEX24_198126(TMP3020);
				internalerror_198006(LOC69);
			}
			LA67: ;
			{
				NU8 i_321398;
				NU8 res_321494;
				i_321398 = 0;
				res_321494 = ((NU8) 0);
				{
					while (1) {
						if (!(res_321494 <= ((NU8) 25))) goto LA72;
						i_321398 = res_321494;
						{
							NimStringDesc* LOC75;
							NI LOC76;
							LOC75 = 0;
							LOC75 = copyStr(reprEnum(i_321398, (&NTI225445)), 2);
							LOC76 = 0;
							LOC76 = nsuCmpIgnoreStyle(LOC75, spec);
							if (!(LOC76 == 0)) goto LA77;
							add_321061(result, ((NU8) 10));
							(*result) = addChar((*result), ((NIM_CHAR) (((NI) (i_321398)))));
							goto BeforeRet;
						}
						LA77: ;
						res_321494 += 1;
					} LA72: ;
				}
			}
			{
				NimStringDesc* LOC83;
				if (!NIM_FALSE) goto LA81;
				LOC83 = 0;
				LOC83 = HEX24_198126(TMP3022);
				internalerror_198006(LOC83);
			}
			LA81: ;
			{
				NU8 i_321473;
				NU8 res_321501;
				i_321473 = 0;
				res_321501 = ((NU8) 0);
				{
					while (1) {
						if (!(res_321501 <= ((NU8) 157))) goto LA86;
						i_321473 = res_321501;
						{
							NI LOC89;
							LOC89 = 0;
							LOC89 = nsuCmpIgnoreStyle(reprEnum(i_321473, (&NTI225029)), spec);
							if (!(LOC89 == 0)) goto LA90;
							add_321061(result, ((NU8) 11));
							(*result) = addChar((*result), ((NIM_CHAR) (((NI) (i_321473)))));
							goto BeforeRet;
						}
						LA90: ;
						res_321501 += 1;
					} LA86: ;
				}
			}
			patternerror_321051(p);
		}
		LA52: ;
	}
	break;
	default:
	{
		patternerror_321051(p);
	}
	break;
	}
	BeforeRet: ;
}

N_NIMCALL(tnode225816*, semnodekindconstraints_321527)(tnode225816* p) {
	tnode225816* result;
	result = 0;
	result = newnodei_226138(((NU8) 20), (*p).Info);
	asgnRefNoCycle((void**) (&(*result).kindU.S3.Strval), rawNewString(10));
	(*result).kindU.S3.Strval = addChar((*result).kindU.S3.Strval, 1);
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = len_226364(p);
		if (!(2 <= LOC3)) goto LA4;
		{
			NI i_321658;
			NI HEX3Atmp_321719;
			NI LOC7;
			NI res_321722;
			i_321658 = 0;
			HEX3Atmp_321719 = 0;
			LOC7 = 0;
			LOC7 = len_226364(p);
			HEX3Atmp_321719 = (LOC7 - 1);
			res_321722 = 1;
			{
				while (1) {
					if (!(res_321722 <= HEX3Atmp_321719)) goto LA9;
					i_321658 = res_321722;
					compileconstraints_321129((*p).kindU.S6.Sons->data[i_321658], (&(*result).kindU.S3.Strval));
					res_321722 += 1;
				} LA9: ;
			}
		}
		{
			if (!(63 < (*result).kindU.S3.Strval->Sup.len)) goto LA12;
			internalerror_197987((*p).Info, ((NimStringDesc*) &TMP3023));
		}
		LA12: ;
	}
	goto LA1;
	LA4: ;
	{
		patternerror_321051(p);
	}
	LA1: ;
	add_321061((&(*result).kindU.S3.Strval), ((NU8) 1));
	return result;
}

N_NIMCALL(NU8, whichalias_321080)(tsym225846* p) {
	NU8 result;
	result = 0;
	{
		if (!!(((*p).Constraint == NIM_NIL))) goto LA3;
		result = ((NU8) (((NU8)((*(*p).Constraint).kindU.S3.Strval->data[0]))));
	}
	goto LA1;
	LA3: ;
	{
		result = ((NU8) 1);
	}
	LA1: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, HEX00_parampatternsInit)(void) {
}

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

