/* Generated by Nimrod Compiler v0.9.5 */
/*   (c) 2014 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, i386, gcc */
/* Command for C compiler:
   gcc -c  -w -O3 -fno-strict-aliasing  -I/build/nimrod/src/nimrod/lib -o compiler/nimcache/astalgo.o compiler/nimcache/astalgo.c */
#define NIM_INTBITS 32
#include "nimbase.h"

#include <string.h>
typedef struct tiitable197207 tiitable197207;
typedef struct tiipairseq197205 tiipairseq197205;
typedef struct tiipair197203 tiipair197203;
typedef struct TGenericSeq TGenericSeq;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tstrtable188807 tstrtable188807;
typedef struct tsym188833 tsym188833;
typedef struct tsymseq188805 tsymseq188805;
typedef struct tidobj167013 tidobj167013;
typedef struct TNimObject TNimObject;
typedef struct ttypeseq188835 ttypeseq188835;
typedef struct ttype188837 ttype188837;
typedef struct tscope188827 tscope188827;
typedef struct TY188933 TY188933;
typedef struct tinstantiation188823 tinstantiation188823;
typedef struct tident167019 tident167019;
typedef struct tlineinfo163527 tlineinfo163527;
typedef struct tnode188803 tnode188803;
typedef struct tloc188817 tloc188817;
typedef struct trope145007 trope145007;
typedef struct tlib188821 tlib188821;
typedef struct NimStringDesc NimStringDesc;
typedef struct tcell41090 tcell41090;
typedef struct tcellseq41106 tcellseq41106;
typedef struct tgcheap43016 tgcheap43016;
typedef struct tcellset41102 tcellset41102;
typedef struct tpagedesc41098 tpagedesc41098;
typedef struct tmemregion23410 tmemregion23410;
typedef struct tsmallchunk22638 tsmallchunk22638;
typedef struct tllchunk23404 tllchunk23404;
typedef struct tbigchunk22640 tbigchunk22640;
typedef struct tintset22615 tintset22615;
typedef struct ttrunk22611 ttrunk22611;
typedef struct tavlnode23408 tavlnode23408;
typedef struct tgcstat43014 tgcstat43014;
typedef struct tidtable188849 tidtable188849;
typedef struct tidpairseq188847 tidpairseq188847;
typedef struct tidpair188845 tidpair188845;
typedef struct ttabiter197090 ttabiter197090;
typedef struct tnodeseq188797 tnodeseq188797;
typedef struct tidentiter197106 tidentiter197106;
typedef struct tintset185047 tintset185047;
typedef struct ttrunk185043 ttrunk185043;
typedef struct ttrunkseq185045 ttrunkseq185045;
typedef struct tidnodetable188855 tidnodetable188855;
typedef struct tidnodepairseq188853 tidnodepairseq188853;
typedef struct tidnodepair188851 tidnodepair188851;
typedef struct TY188922 TY188922;
typedef struct tlistentry118017 tlistentry118017;
typedef struct tbasechunk22636 tbasechunk22636;
typedef struct tfreecell22628 tfreecell22628;
struct  tiipair197203  {
NI Key;
NI Val;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  tiitable197207  {
NI Counter;
tiipairseq197205* Data;
};
typedef N_NIMCALL_PTR(void, TY2289) (void* p, NI op);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY2289 marker;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  tstrtable188807  {
NI Counter;
tsymseq188805* Data;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  tidobj167013  {
  TNimObject Sup;
NI Id;
};
struct  tlineinfo163527  {
NI16 Line;
NI16 Col;
NI32 Fileindex;
};
struct  tloc188817  {
NU8 K;
NU8 S;
NU8 Flags;
ttype188837* T;
trope145007* R;
trope145007* Heaproot;
NI A;
};
struct  tsym188833  {
  tidobj167013 Sup;
NU8 Kind;
union {
struct {ttypeseq188835* Typeinstcache;
tscope188827* Typscope;
} S1;
struct {TY188933* Procinstcache;
tscope188827* Scope;
} S2;
struct {TY188933* Usedgenerics;
tstrtable188807 Tab;
} S3;
} kindU;
NU16 Magic;
ttype188837* Typ;
tident167019* Name;
tlineinfo163527 Info;
tsym188833* Owner;
NU32 Flags;
tnode188803* Ast;
NU32 Options;
NI Position;
NI Offset;
tloc188817 Loc;
tlib188821* Annex;
tnode188803* Constraint;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  tident167019  {
  tidobj167013 Sup;
NimStringDesc* S;
tident167019* Next;
NI H;
};
struct  tcell41090  {
NI Refcount;
TNimType* Typ;
};
struct  tcellseq41106  {
NI Len;
NI Cap;
tcell41090** D;
};
struct  tcellset41102  {
NI Counter;
NI Max;
tpagedesc41098* Head;
tpagedesc41098** Data;
};
typedef tsmallchunk22638* TY23422[512];
typedef ttrunk22611* ttrunkbuckets22613[256];
struct  tintset22615  {
ttrunkbuckets22613 Data;
};
struct  tmemregion23410  {
NI Minlargeobj;
NI Maxlargeobj;
TY23422 Freesmallchunks;
tllchunk23404* Llmem;
NI Currmem;
NI Maxmem;
NI Freemem;
NI Lastsize;
tbigchunk22640* Freechunkslist;
tintset22615 Chunkstarts;
tavlnode23408* Root;
tavlnode23408* Deleted;
tavlnode23408* Last;
tavlnode23408* Freeavlnodes;
};
struct  tgcstat43014  {
NI Stackscans;
NI Cyclecollections;
NI Maxthreshold;
NI Maxstacksize;
NI Maxstackcells;
NI Cycletablesize;
NI64 Maxpause;
};
struct  tgcheap43016  {
void* Stackbottom;
NI Cyclethreshold;
tcellseq41106 Zct;
tcellseq41106 Decstack;
tcellset41102 Cycleroots;
tcellseq41106 Tempstack;
NI Recgclock;
tmemregion23410 Region;
tgcstat43014 Stat;
};
struct  tidpair188845  {
tidobj167013* Key;
TNimObject* Val;
};
struct  tidtable188849  {
NI Counter;
tidpairseq188847* Data;
};
struct  ttabiter197090  {
NI H;
};
struct  tnode188803  {
ttype188837* Typ;
tlineinfo163527 Info;
NU16 Flags;
NU8 Kind;
union {
struct {NI64 Intval;
} S1;
struct {NF Floatval;
} S2;
struct {NimStringDesc* Strval;
} S3;
struct {tsym188833* Sym;
} S4;
struct {tident167019* Ident;
} S5;
struct {tnodeseq188797* Sons;
} S6;
} kindU;
NimStringDesc* Comment;
};
struct  tidentiter197106  {
NI H;
tident167019* Name;
};
struct  tintset185047  {
NI Counter;
NI Max;
ttrunk185043* Head;
ttrunkseq185045* Data;
};
struct  tidnodepair188851  {
tidobj167013* Key;
tnode188803* Val;
};
struct  tidnodetable188855  {
NI Counter;
tidnodepairseq188853* Data;
};
struct  ttype188837  {
  tidobj167013 Sup;
NU8 Kind;
NU8 Callconv;
NU32 Flags;
ttypeseq188835* Sons;
tnode188803* N;
tsym188833* Destructor;
tsym188833* Owner;
tsym188833* Sym;
NI64 Size;
NI Align;
tloc188817 Loc;
};
struct  tscope188827  {
NI Depthlevel;
tstrtable188807 Symbols;
tnodeseq188797* Usingsyms;
tscope188827* Parent;
};
struct  tinstantiation188823  {
tsym188833* Sym;
ttypeseq188835* Concretetypes;
TY188922* Usedby;
};
struct  trope145007  {
  TNimObject Sup;
trope145007* Left;
trope145007* Right;
NI Length;
NimStringDesc* Data;
};
struct  tlistentry118017  {
  TNimObject Sup;
tlistentry118017* Prev;
tlistentry118017* Next;
};
struct  tlib188821  {
  tlistentry118017 Sup;
NU8 Kind;
NIM_BOOL Generated;
NIM_BOOL Isoverriden;
trope145007* Name;
tnode188803* Path;
};
typedef NI TY22618[16];
struct  tpagedesc41098  {
tpagedesc41098* Next;
NI Key;
TY22618 Bits;
};
struct  tbasechunk22636  {
NI Prevsize;
NI Size;
NIM_BOOL Used;
};
struct  tsmallchunk22638  {
  tbasechunk22636 Sup;
tsmallchunk22638* Next;
tsmallchunk22638* Prev;
tfreecell22628* Freelist;
NI Free;
NI Acc;
NF Data;
};
struct  tllchunk23404  {
NI Size;
NI Acc;
tllchunk23404* Next;
};
struct  tbigchunk22640  {
  tbasechunk22636 Sup;
tbigchunk22640* Next;
tbigchunk22640* Prev;
NI Align;
NF Data;
};
struct  ttrunk22611  {
ttrunk22611* Next;
NI Key;
TY22618 Bits;
};
typedef tavlnode23408* TY23414[2];
struct  tavlnode23408  {
TY23414 Link;
NI Key;
NI Upperbound;
NI Level;
};
struct  ttrunk185043  {
ttrunk185043* Next;
NI Key;
TY22618 Bits;
};
struct  tfreecell22628  {
tfreecell22628* Next;
NI Zerofield;
};
struct tiipairseq197205 {
  TGenericSeq Sup;
  tiipair197203 data[SEQ_DECL_SIZE];
};
struct tsymseq188805 {
  TGenericSeq Sup;
  tsym188833* data[SEQ_DECL_SIZE];
};
struct ttypeseq188835 {
  TGenericSeq Sup;
  ttype188837* data[SEQ_DECL_SIZE];
};
struct TY188933 {
  TGenericSeq Sup;
  tinstantiation188823* data[SEQ_DECL_SIZE];
};
struct tidpairseq188847 {
  TGenericSeq Sup;
  tidpair188845 data[SEQ_DECL_SIZE];
};
struct tnodeseq188797 {
  TGenericSeq Sup;
  tnode188803* data[SEQ_DECL_SIZE];
};
struct ttrunkseq185045 {
  TGenericSeq Sup;
  ttrunk185043* data[SEQ_DECL_SIZE];
};
struct tidnodepairseq188853 {
  TGenericSeq Sup;
  tidnodepair188851 data[SEQ_DECL_SIZE];
};
struct TY188922 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, TMP815)(void* p, NI op);
N_NIMCALL(NIM_BOOL, mustrehash_197187)(NI length, NI counter);
N_NIMCALL(void, strtableenlarge_202014)(tstrtable188807* t);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(void, strtablerawinsert_201171)(tsymseq188805** data, tsym188833* n);
static N_INLINE(NI, nexttry_197192)(NI h, NI maxhash);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(tcell41090*, usrtocell_44443)(void* usr);
static N_INLINE(void, rtladdzct_46002)(tcell41090* c);
N_NOINLINE(void, addzct_44418)(tcellseq41106* s, tcell41090* c);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NI, iitablerawget_204206)(tiitable197207 t, NI key);
N_NIMCALL(void, iitablerawinsert_204224)(tiipairseq197205** data, NI key, NI val);
N_NIMCALL(NI, idtablerawget_202664)(tidtable188849 t, NI key);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_46827)(tcell41090* c);
static N_INLINE(NIM_BOOL, canbecycleroot_44462)(tcell41090* c);
static N_INLINE(void, rtladdcycleroot_45235)(tcell41090* c);
N_NOINLINE(void, incl_41855)(tcellset41102* s, tcell41090* cell);
static N_INLINE(void, decref_46402)(tcell41090* c);
N_NIMCALL(void, idtablerawinsert_202774)(tidpairseq188847** data, tidobj167013* key, TNimObject* val);
N_NIMCALL(tsym188833*, nextiter_197099)(ttabiter197090* ti, tstrtable188807 tab);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(NI, sonslen_189181)(tnode188803* n);
N_NIMCALL(void, internalerror_165591)(tlineinfo163527 info, NimStringDesc* errmsg);
static N_INLINE(NI, cmpStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NIM_BOOL, levalue_197404)(tnode188803* a, tnode188803* b);
N_NIMCALL(tsym188833*, nextidentiter_197117)(tidentiter197106* ti, tstrtable188807 tab);
N_NIMCALL(tsym188833*, nextidentexcluding_202487)(tidentiter197106* ti, tstrtable188807 tab, tintset185047 excluding);
N_NIMCALL(NIM_BOOL, contains_185821)(tintset185047 s, NI key);
N_NIMCALL(NI, idnodetablerawget_203479)(tidnodetable188855 t, tidobj167013* key);
N_NIMCALL(void, idnodetablerawinsert_203533)(tidnodepairseq188853** data, tidobj167013* key, tnode188803* val);
N_NIMCALL(tnode188803*, skipconv_197231)(tnode188803* n);
N_NIMCALL(void, symtabreplaceraw_201621)(tsymseq188805** data, tsym188833* prevsym, tsym188833* newsym);
N_NIMCALL(tsym188833*, lookupinrecord_197178)(tnode188803* n, tident167019* field);
static N_INLINE(tnode188803*, lastson_189189)(tnode188803* n);
STRING_LITERAL(TMP2566, "getSymFromList", 14);
STRING_LITERAL(TMP3321, "lookupInRecord", 14);
STRING_LITERAL(TMP3322, "lookupInRecord(record case branch)", 34);
STRING_LITERAL(TMP3323, "lookupInRecord()", 16);
TNimType NTI197207; /* TIITable */
extern TNimType NTI106; /* int */
TNimType NTI197203; /* TIIPair */
TNimType NTI197205; /* TIIPairSeq */
extern TNimType NTI188805; /* TSymSeq */
extern tgcheap43016 gch_43044;
extern TNimType NTI188847; /* TIdPairSeq */
extern TNimType NTI188853; /* TIdNodePairSeq */
N_NIMCALL(void, TMP815)(void* p, NI op) {
	tiipairseq197205* a;
	NI LOC1;
	a = (tiipairseq197205*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	}
}

N_NIMCALL(NIM_BOOL, mustrehash_197187)(NI length, NI counter) {
	NIM_BOOL result;
	NIM_BOOL LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = ((NI32)(length * 2) < (NI32)(counter * 3));
	if (LOC1) goto LA2;
	LOC1 = ((NI32)(length - counter) < 4);
	LA2: ;
	result = LOC1;
	return result;
}

static N_INLINE(NI, nexttry_197192)(NI h, NI maxhash) {
	NI result;
	result = 0;
	result = (NI)((NI32)((NI32)(5 * h) + 1) & maxhash);
	return result;
}

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

static N_INLINE(void, rtladdzct_46002)(tcell41090* c) {
	addzct_44418(&gch_43044.Zct, c);
}

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

N_NIMCALL(void, strtablerawinsert_201171)(tsymseq188805** data, tsym188833* n) {
	NI h;
	h = (NI)((*(*n).Name).H & ((*data)->Sup.len-1));
	{
		if (!!((((*n).Flags &(1<<((((NU8) 25))&31)))!=0))) goto LA3;
		while (1) {
			if (!!(((*data)->data[h] == NIM_NIL))) goto LA5;
			{
				if (!((*data)->data[h] == n)) goto LA8;
				goto BeforeRet;
			}
			LA8: ;
			h = nexttry_197192(h, ((*data)->Sup.len-1));
		} LA5: ;
		asgnRefNoCycle((void**) &(*data)->data[h], n);
	}
	goto LA1;
	LA3: ;
	{
		NI favpos;
		favpos = -1;
		while (1) {
			if (!!(((*data)->data[h] == NIM_NIL))) goto LA11;
			{
				if (!((*data)->data[h] == n)) goto LA14;
				goto BeforeRet;
			}
			LA14: ;
			{
				NIM_BOOL LOC18;
				LOC18 = 0;
				LOC18 = (favpos < 0);
				if (!(LOC18)) goto LA19;
				LOC18 = ((*(*(*data)->data[h]).Name).Sup.Id == (*(*n).Name).Sup.Id);
				LA19: ;
				if (!LOC18) goto LA20;
				favpos = h;
			}
			LA20: ;
			h = nexttry_197192(h, ((*data)->Sup.len-1));
		} LA11: ;
		asgnRefNoCycle((void**) &(*data)->data[h], n);
		{
			tsym188833* LOC26;
			if (!(0 <= favpos)) goto LA24;
			LOC26 = 0;
			LOC26 = (*data)->data[h];
			asgnRefNoCycle((void**) &(*data)->data[h], (*data)->data[favpos]);
			asgnRefNoCycle((void**) &(*data)->data[favpos], LOC26);
		}
		LA24: ;
	}
	LA1: ;
	BeforeRet: ;
}

N_NIMCALL(void, strtableenlarge_202014)(tstrtable188807* t) {
	tsymseq188805* n;
	NI i_202058;
	NI HEX3Atmp_202093;
	NI res_202095;
	tsymseq188805* LOC6;
	n = 0;
	n = (tsymseq188805*) newSeq((&NTI188805), (NI32)((*t).Data->Sup.len * 2));
	i_202058 = 0;
	HEX3Atmp_202093 = 0;
	HEX3Atmp_202093 = ((*t).Data->Sup.len-1);
	res_202095 = 0;
	while (1) {
		if (!(res_202095 <= HEX3Atmp_202093)) goto LA1;
		i_202058 = res_202095;
		{
			if (!!(((*t).Data->data[i_202058] == NIM_NIL))) goto LA4;
			strtablerawinsert_201171(&n, (*t).Data->data[i_202058]);
		}
		LA4: ;
		res_202095 += 1;
	} LA1: ;
	LOC6 = 0;
	LOC6 = (*t).Data;
	unsureAsgnRef((void**) &(*t).Data, n);
	n = LOC6;
}

N_NIMCALL(void, strtableadd_197078)(tstrtable188807* t, tsym188833* n) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = mustrehash_197187((*t).Data->Sup.len, (*t).Counter);
		if (!LOC3) goto LA4;
		strtableenlarge_202014(t);
	}
	LA4: ;
	strtablerawinsert_201171(&(*t).Data, n);
	(*t).Counter += 1;
}

N_NIMCALL(void, initiitable_197213)(tiitable197207* x) {
	NI i_204199;
	NI res_204201;
	(*x).Counter = 0;
	unsureAsgnRef((void**) &(*x).Data, (tiipairseq197205*) newSeq((&NTI197205), 8));
	i_204199 = 0;
	res_204201 = 0;
	while (1) {
		if (!(res_204201 <= 7)) goto LA1;
		i_204199 = res_204201;
		(*x).Data->data[i_204199].Key = (-2147483647 -1);
		res_204201 += 1;
	} LA1: ;
}

N_NIMCALL(NI, iitablerawget_204206)(tiitable197207 t, NI key) {
	NI result;
	NI h;
	result = 0;
	h = 0;
	h = (NI)(key & (t.Data->Sup.len-1));
	while (1) {
		if (!!((t.Data->data[h].Key == (-2147483647 -1)))) goto LA1;
		{
			if (!(t.Data->data[h].Key == key)) goto LA4;
			result = h;
			goto BeforeRet;
		}
		LA4: ;
		h = nexttry_197192(h, (t.Data->Sup.len-1));
	} LA1: ;
	result = -1;
	BeforeRet: ;
	return result;
}

N_NIMCALL(void, iitablerawinsert_204224)(tiipairseq197205** data, NI key, NI val) {
	NI h;
	h = 0;
	h = (NI)(key & ((*data)->Sup.len-1));
	while (1) {
		if (!!(((*data)->data[h].Key == (-2147483647 -1)))) goto LA1;
		h = nexttry_197192(h, ((*data)->Sup.len-1));
	} LA1: ;
	(*data)->data[h].Key = key;
	(*data)->data[h].Val = val;
}

N_NIMCALL(void, iitableput_197223)(tiitable197207* t, NI key, NI val) {
	NI index;
	index = iitablerawget_204206((*t), key);
	{
		if (!(0 <= index)) goto LA3;
		(*t).Data->data[index].Val = val;
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			tiipairseq197205* n;
			NI i_204852;
			NI HEX3Atmp_204900;
			NI res_204902;
			NI i_204865;
			NI HEX3Atmp_204904;
			NI res_204906;
			tiipairseq197205* LOC17;
			LOC8 = 0;
			LOC8 = mustrehash_197187((*t).Data->Sup.len, (*t).Counter);
			if (!LOC8) goto LA9;
			n = 0;
			n = (tiipairseq197205*) newSeq((&NTI197205), (NI32)((*t).Data->Sup.len * 2));
			i_204852 = 0;
			HEX3Atmp_204900 = 0;
			HEX3Atmp_204900 = (n->Sup.len-1);
			res_204902 = 0;
			while (1) {
				if (!(res_204902 <= HEX3Atmp_204900)) goto LA11;
				i_204852 = res_204902;
				n->data[i_204852].Key = (-2147483647 -1);
				res_204902 += 1;
			} LA11: ;
			i_204865 = 0;
			HEX3Atmp_204904 = 0;
			HEX3Atmp_204904 = ((*t).Data->Sup.len-1);
			res_204906 = 0;
			while (1) {
				if (!(res_204906 <= HEX3Atmp_204904)) goto LA12;
				i_204865 = res_204906;
				{
					if (!!(((*t).Data->data[i_204865].Key == (-2147483647 -1)))) goto LA15;
					iitablerawinsert_204224(&n, (*t).Data->data[i_204865].Key, (*t).Data->data[i_204865].Val);
				}
				LA15: ;
				res_204906 += 1;
			} LA12: ;
			LOC17 = 0;
			LOC17 = (*t).Data;
			unsureAsgnRef((void**) &(*t).Data, n);
			n = LOC17;
		}
		LA9: ;
		iitablerawinsert_204224(&(*t).Data, key, val);
		(*t).Counter += 1;
	}
	LA1: ;
}

N_NIMCALL(NI, idtablerawget_202664)(tidtable188849 t, NI key) {
	NI result;
	NI h;
	result = 0;
	h = 0;
	h = (NI)(key & (t.Data->Sup.len-1));
	while (1) {
		if (!!((t.Data->data[h].Key == NIM_NIL))) goto LA1;
		{
			if (!((*t.Data->data[h].Key).Id == key)) goto LA4;
			result = h;
			goto BeforeRet;
		}
		LA4: ;
		h = nexttry_197192(h, (t.Data->Sup.len-1));
	} LA1: ;
	result = -1;
	BeforeRet: ;
	return result;
}

static N_INLINE(NIM_BOOL, canbecycleroot_44462)(tcell41090* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).Typ).flags &(1<<((((NU8) 1))&7)))!=0));
	return result;
}

static N_INLINE(void, rtladdcycleroot_45235)(tcell41090* c) {
	{
		if (!!((((NI) ((NI)((*c).Refcount & 3))) == 3))) goto LA3;
		(*c).Refcount = (NI)((NI)((*c).Refcount & -4) | 3);
		incl_41855(&gch_43044.Cycleroots, c);
	}
	LA3: ;
}

static N_INLINE(void, incref_46827)(tcell41090* c) {
	(*c).Refcount = (NI)((NU32)((*c).Refcount) + (NU32)(8));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_44462(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_45235(c);
	}
	LA4: ;
}

static N_INLINE(void, decref_46402)(tcell41090* c) {
	{
		(*c).Refcount -= 8;
		if (!((NU32)((*c).Refcount) < (NU32)(8))) goto LA3;
		rtladdzct_46002(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_44462(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_45235(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tcell41090* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_44443(src);
		incref_46827(LOC5);
	}
	LA3: ;
	{
		tcell41090* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_44443((*dest));
		decref_46402(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

N_NIMCALL(void, idtablerawinsert_202774)(tidpairseq188847** data, tidobj167013* key, TNimObject* val) {
	NI h;
	h = 0;
	h = (NI)((*key).Id & ((*data)->Sup.len-1));
	while (1) {
		if (!!(((*data)->data[h].Key == NIM_NIL))) goto LA1;
		h = nexttry_197192(h, ((*data)->Sup.len-1));
	} LA1: ;
	asgnRef((void**) &(*data)->data[h].Key, key);
	asgnRef((void**) &(*data)->data[h].Val, val);
}

N_NIMCALL(void, idtableput_197147)(tidtable188849* t, tidobj167013* key, TNimObject* val) {
	NI index;
	tidpairseq188847* n;
	index = 0;
	n = 0;
	index = idtablerawget_202664((*t), (*key).Id);
	{
		if (!(0 <= index)) goto LA3;
		asgnRef((void**) &(*t).Data->data[index].Val, val);
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			NI i_203251;
			NI HEX3Atmp_203435;
			NI res_203437;
			tidpairseq188847* LOC16;
			LOC8 = 0;
			LOC8 = mustrehash_197187((*t).Data->Sup.len, (*t).Counter);
			if (!LOC8) goto LA9;
			n = (tidpairseq188847*) newSeq((&NTI188847), (NI32)((*t).Data->Sup.len * 2));
			i_203251 = 0;
			HEX3Atmp_203435 = 0;
			HEX3Atmp_203435 = ((*t).Data->Sup.len-1);
			res_203437 = 0;
			while (1) {
				if (!(res_203437 <= HEX3Atmp_203435)) goto LA11;
				i_203251 = res_203437;
				{
					if (!!(((*t).Data->data[i_203251].Key == NIM_NIL))) goto LA14;
					idtablerawinsert_202774(&n, (*t).Data->data[i_203251].Key, (*t).Data->data[i_203251].Val);
				}
				LA14: ;
				res_203437 += 1;
			} LA11: ;
			LOC16 = 0;
			LOC16 = (*t).Data;
			unsureAsgnRef((void**) &(*t).Data, n);
			n = LOC16;
		}
		LA9: ;
		idtablerawinsert_202774(&(*t).Data, key, val);
		(*t).Counter += 1;
	}
	LA1: ;
}

N_NIMCALL(TNimObject*, idtableget_197142)(tidtable188849 t, NI key) {
	TNimObject* result;
	NI index;
	result = 0;
	index = idtablerawget_202664(t, key);
	{
		if (!(0 <= index)) goto LA3;
		result = t.Data->data[index].Val;
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_NIL;
	}
	LA1: ;
	return result;
}

N_NIMCALL(NI, iitableget_197218)(tiitable197207 t, NI key) {
	NI result;
	NI index;
	result = 0;
	index = iitablerawget_204206(t, key);
	{
		if (!(0 <= index)) goto LA3;
		result = t.Data->data[index].Val;
	}
	goto LA1;
	LA3: ;
	{
		result = (-2147483647 -1);
	}
	LA1: ;
	return result;
}

N_NIMCALL(tsym188833*, nextiter_197099)(ttabiter197090* ti, tstrtable188807 tab) {
	tsym188833* result;
	result = 0;
	result = NIM_NIL;
	while (1) {
		if (!((*ti).H <= (tab.Data->Sup.len-1))) goto LA1;
		result = tab.Data->data[(*ti).H];
		(*ti).H += 1;
		{
			if (!!((result == NIM_NIL))) goto LA4;
			goto LA1;
		}
		LA4: ;
	} LA1: ;
	return result;
}

N_NIMCALL(tsym188833*, inittabiter_197093)(ttabiter197090* ti, tstrtable188807 tab) {
	tsym188833* result;
	result = 0;
	(*ti).H = 0;
	{
		if (!(tab.Counter == 0)) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextiter_197099(ti, tab);
	}
	LA1: ;
	return result;
}

N_NIMCALL(tsym188833*, getmodule_197183)(tsym188833* s) {
	tsym188833* result;
	result = 0;
	result = s;
	while (1) {
		NIM_BOOL LOC2;
		LOC2 = 0;
		LOC2 = !((result == NIM_NIL));
		if (!(LOC2)) goto LA3;
		LOC2 = !(((*result).Kind == ((NU8) 6)));
		LA3: ;
		if (!LOC2) goto LA1;
		result = (*result).Owner;
	} LA1: ;
	return result;
}

N_NIMCALL(TNimObject*, idtableget_197137)(tidtable188849 t, tidobj167013* key) {
	TNimObject* result;
	NI index;
	result = 0;
	index = idtablerawget_202664(t, (*key).Id);
	{
		if (!(0 <= index)) goto LA3;
		result = t.Data->data[index].Val;
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_NIL;
	}
	LA1: ;
	return result;
}

N_NIMCALL(tsym188833*, strtableget_197084)(tstrtable188807 t, tident167019* name) {
	tsym188833* result;
	NI h;
	result = 0;
	h = (NI)((*name).H & (t.Data->Sup.len-1));
	while (1) {
		result = t.Data->data[h];
		{
			if (!(result == NIM_NIL)) goto LA4;
			goto LA1;
		}
		LA4: ;
		{
			if (!((*(*result).Name).Sup.Id == (*name).Sup.Id)) goto LA8;
			goto LA1;
		}
		LA8: ;
		h = nexttry_197192(h, (t.Data->Sup.len-1));
	} LA1: ;
	return result;
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL LOC11;
	int LOC13;
	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = (a == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = 0;
	LOC11 = ((*a).Sup.len == (*b).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC13 = 0;
	LOC13 = memcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)), (NI32)((*a).Sup.len * 1));
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, samevalue_197271)(tnode188803* a, tnode188803* b) {
	NIM_BOOL result;
	result = 0;
	result = NIM_FALSE;
	switch ((*a).Kind) {
	case ((NU8) 5) ... ((NU8) 10):
	{
		{
			if (!((*b).Kind >= ((NU8) 5) && (*b).Kind <= ((NU8) 10))) goto LA4;
			result = ((*a).kindU.S1.Intval == (*b).kindU.S1.Intval);
		}
		LA4: ;
	}
	break;
	case ((NU8) 16) ... ((NU8) 18):
	{
		{
			if (!((*b).Kind >= ((NU8) 16) && (*b).Kind <= ((NU8) 18))) goto LA9;
			result = ((*a).kindU.S2.Floatval == (*b).kindU.S2.Floatval);
		}
		LA9: ;
	}
	break;
	case ((NU8) 20) ... ((NU8) 22):
	{
		{
			if (!((*b).Kind >= ((NU8) 20) && (*b).Kind <= ((NU8) 22))) goto LA14;
			result = eqStrings((*a).kindU.S3.Strval, (*b).kindU.S3.Strval);
		}
		LA14: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

N_NIMCALL(NIM_BOOL, strtableincl_202135)(tstrtable188807* t, tsym188833* n) {
	NIM_BOOL result;
	NI h;
	result = 0;
	h = (NI)((*(*n).Name).H & ((*t).Data->Sup.len-1));
	while (1) {
		tsym188833* it;
		it = (*t).Data->data[h];
		{
			if (!(it == NIM_NIL)) goto LA4;
			goto LA1;
		}
		LA4: ;
		{
			if (!((*(*it).Name).Sup.Id == (*(*n).Name).Sup.Id)) goto LA8;
			asgnRefNoCycle((void**) &(*t).Data->data[h], n);
			result = NIM_TRUE;
			goto BeforeRet;
		}
		LA8: ;
		h = nexttry_197192(h, ((*t).Data->Sup.len-1));
	} LA1: ;
	{
		NIM_BOOL LOC12;
		LOC12 = 0;
		LOC12 = mustrehash_197187((*t).Data->Sup.len, (*t).Counter);
		if (!LOC12) goto LA13;
		strtableenlarge_202014(t);
		strtablerawinsert_201171(&(*t).Data, n);
	}
	goto LA10;
	LA13: ;
	{
		asgnRefNoCycle((void**) &(*t).Data->data[h], n);
	}
	LA10: ;
	(*t).Counter += 1;
	result = NIM_FALSE;
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, sonslen_189181)(tnode188803* 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(tsym188833*, getsymfromlist_197172)(tnode188803* list, tident167019* ident, NI start) {
	tsym188833* result;
	NI i_198048;
	NI HEX3Atmp_198100;
	NI LOC1;
	NI res_198102;
	result = 0;
	i_198048 = 0;
	HEX3Atmp_198100 = 0;
	LOC1 = 0;
	LOC1 = sonslen_189181(list);
	HEX3Atmp_198100 = (NI32)(LOC1 - 1);
	res_198102 = start;
	while (1) {
		if (!(res_198102 <= HEX3Atmp_198100)) goto LA2;
		i_198048 = res_198102;
		{
			if (!((*(*list).kindU.S6.Sons->data[i_198048]).Kind == ((NU8) 3))) goto LA5;
			result = (*(*list).kindU.S6.Sons->data[i_198048]).kindU.S4.Sym;
			{
				if (!((*(*result).Name).Sup.Id == (*ident).Sup.Id)) goto LA9;
				goto BeforeRet;
			}
			LA9: ;
		}
		goto LA3;
		LA5: ;
		{
			internalerror_165591((*list).Info, ((NimStringDesc*) &TMP2566));
		}
		LA3: ;
		res_198102 += 1;
	} LA2: ;
	result = NIM_NIL;
	BeforeRet: ;
	return result;
}

static N_INLINE(NI, cmpStrings)(NimStringDesc* a, NimStringDesc* b) {
	NI result;
	int LOC13;
	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = 0;
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!(a == NIM_NIL)) goto LA7;
		result = -1;
		goto BeforeRet;
	}
	LA7: ;
	{
		if (!(b == NIM_NIL)) goto LA11;
		result = 1;
		goto BeforeRet;
	}
	LA11: ;
	LOC13 = 0;
	LOC13 = strcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)));
	result = ((NI) (LOC13));
	goto BeforeRet;
	BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, levalue_197404)(tnode188803* a, tnode188803* b) {
	NIM_BOOL result;
	result = 0;
	result = NIM_FALSE;
	switch ((*a).Kind) {
	case ((NU8) 5) ... ((NU8) 10):
	{
		{
			if (!((*b).Kind >= ((NU8) 5) && (*b).Kind <= ((NU8) 10))) goto LA4;
			result = ((*a).kindU.S1.Intval <= (*b).kindU.S1.Intval);
		}
		LA4: ;
	}
	break;
	case ((NU8) 16) ... ((NU8) 18):
	{
		{
			if (!((*b).Kind >= ((NU8) 16) && (*b).Kind <= ((NU8) 18))) goto LA9;
			result = ((*a).kindU.S2.Floatval <= (*b).kindU.S2.Floatval);
		}
		LA9: ;
	}
	break;
	case ((NU8) 20) ... ((NU8) 22):
	{
		{
			if (!((*b).Kind >= ((NU8) 20) && (*b).Kind <= ((NU8) 22))) goto LA14;
			result = (cmpStrings((*a).kindU.S3.Strval, (*b).kindU.S3.Strval) <= 0);
		}
		LA14: ;
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

N_NIMCALL(NU8, weaklevalue_197537)(tnode188803* a, tnode188803* b) {
	NU8 result;
	result = 0;
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = !(((*a).Kind >= ((NU8) 5) && (*a).Kind <= ((NU8) 22)));
		if (LOC3) goto LA4;
		LOC3 = !(((*b).Kind >= ((NU8) 5) && (*b).Kind <= ((NU8) 22)));
		LA4: ;
		if (!LOC3) goto LA5;
		result = ((NU8) 0);
	}
	goto LA1;
	LA5: ;
	{
		{
			NIM_BOOL LOC10;
			LOC10 = 0;
			LOC10 = levalue_197404(a, b);
			if (!LOC10) goto LA11;
			result = ((NU8) 2);
		}
		goto LA8;
		LA11: ;
		{
			result = ((NU8) 1);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(tsym188833*, nextidentiter_197117)(tidentiter197106* ti, tstrtable188807 tab) {
	tsym188833* result;
	NI h;
	NI start;
	result = 0;
	h = 0;
	start = 0;
	h = (NI)((*ti).H & (tab.Data->Sup.len-1));
	start = h;
	result = tab.Data->data[h];
	while (1) {
		if (!!((result == NIM_NIL))) goto LA1;
		{
			if (!((*(*result).Name).Sup.Id == (*(*ti).Name).Sup.Id)) goto LA4;
			goto LA1;
		}
		LA4: ;
		h = nexttry_197192(h, (tab.Data->Sup.len-1));
		{
			if (!(h == start)) goto LA8;
			result = NIM_NIL;
			goto LA1;
		}
		LA8: ;
		result = tab.Data->data[h];
	} LA1: ;
	(*ti).H = nexttry_197192(h, (tab.Data->Sup.len-1));
	return result;
}

N_NIMCALL(tsym188833*, initidentiter_197110)(tidentiter197106* ti, tstrtable188807 tab, tident167019* s) {
	tsym188833* result;
	result = 0;
	(*ti).H = (*s).H;
	unsureAsgnRef((void**) &(*ti).Name, s);
	{
		if (!(tab.Counter == 0)) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextidentiter_197117(ti, tab);
	}
	LA1: ;
	return result;
}

N_NIMCALL(tsym188833*, nextidentexcluding_202487)(tidentiter197106* ti, tstrtable188807 tab, tintset185047 excluding) {
	tsym188833* result;
	NI h;
	NI start;
	result = 0;
	h = (NI)((*ti).H & (tab.Data->Sup.len-1));
	start = h;
	result = tab.Data->data[h];
	while (1) {
		if (!!((result == NIM_NIL))) goto LA1;
		{
			NIM_BOOL LOC4;
			NIM_BOOL LOC6;
			LOC4 = 0;
			LOC4 = ((*(*result).Name).Sup.Id == (*(*ti).Name).Sup.Id);
			if (!(LOC4)) goto LA5;
			LOC6 = 0;
			LOC6 = contains_185821(excluding, (*result).Sup.Id);
			LOC4 = !(LOC6);
			LA5: ;
			if (!LOC4) goto LA7;
			goto LA1;
		}
		LA7: ;
		h = nexttry_197192(h, (tab.Data->Sup.len-1));
		{
			if (!(h == start)) goto LA11;
			result = NIM_NIL;
			goto LA1;
		}
		LA11: ;
		result = tab.Data->data[h];
	} LA1: ;
	(*ti).H = nexttry_197192(h, (tab.Data->Sup.len-1));
	{
		NIM_BOOL LOC15;
		LOC15 = 0;
		LOC15 = !((result == NIM_NIL));
		if (!(LOC15)) goto LA16;
		LOC15 = contains_185821(excluding, (*result).Sup.Id);
		LA16: ;
		if (!LOC15) goto LA17;
		result = NIM_NIL;
	}
	LA17: ;
	return result;
}

N_NIMCALL(tsym188833*, firstidentexcluding_202534)(tidentiter197106* ti, tstrtable188807 tab, tident167019* s, tintset185047 excluding) {
	tsym188833* result;
	result = 0;
	(*ti).H = (*s).H;
	unsureAsgnRef((void**) &(*ti).Name, s);
	{
		if (!(tab.Counter == 0)) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextidentexcluding_202487(ti, tab, excluding);
	}
	LA1: ;
	return result;
}

N_NIMCALL(tnode188803*, skipconv_197231)(tnode188803* n) {
	tnode188803* result;
	result = 0;
	switch ((*n).Kind) {
	case ((NU8) 67):
	case ((NU8) 66):
	case ((NU8) 70):
	case ((NU8) 68):
	case ((NU8) 69):
	{
		result = (*n).kindU.S6.Sons->data[0];
	}
	break;
	case ((NU8) 58):
	case ((NU8) 59):
	case ((NU8) 60):
	{
		result = (*n).kindU.S6.Sons->data[1];
	}
	break;
	default:
	{
		result = n;
	}
	break;
	}
	return result;
}

N_NIMCALL(NI, idnodetablerawget_203479)(tidnodetable188855 t, tidobj167013* key) {
	NI result;
	NI h;
	result = 0;
	h = 0;
	h = (NI)((*key).Id & (t.Data->Sup.len-1));
	while (1) {
		if (!!((t.Data->data[h].Key == NIM_NIL))) goto LA1;
		{
			if (!((*t.Data->data[h].Key).Id == (*key).Id)) goto LA4;
			result = h;
			goto BeforeRet;
		}
		LA4: ;
		h = nexttry_197192(h, (t.Data->Sup.len-1));
	} LA1: ;
	result = -1;
	BeforeRet: ;
	return result;
}

N_NIMCALL(tnode188803*, idnodetableget_197159)(tidnodetable188855 t, tidobj167013* key) {
	tnode188803* result;
	NI index;
	result = 0;
	index = 0;
	index = idnodetablerawget_203479(t, key);
	{
		if (!(0 <= index)) goto LA3;
		result = t.Data->data[index].Val;
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_NIL;
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, idnodetablerawinsert_203533)(tidnodepairseq188853** data, tidobj167013* key, tnode188803* val) {
	NI h;
	h = 0;
	h = (NI)((*key).Id & ((*data)->Sup.len-1));
	while (1) {
		if (!!(((*data)->data[h].Key == NIM_NIL))) goto LA1;
		h = nexttry_197192(h, ((*data)->Sup.len-1));
	} LA1: ;
	asgnRef((void**) &(*data)->data[h].Key, key);
	asgnRefNoCycle((void**) &(*data)->data[h].Val, val);
}

N_NIMCALL(void, idnodetableput_197164)(tidnodetable188855* t, tidobj167013* key, tnode188803* val) {
	NI index;
	index = idnodetablerawget_203479((*t), key);
	{
		if (!(0 <= index)) goto LA3;
		asgnRefNoCycle((void**) &(*t).Data->data[index].Val, val);
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			tidnodepairseq188853* n;
			NI i_204052;
			NI HEX3Atmp_204104;
			NI res_204106;
			tidnodepairseq188853* LOC16;
			LOC8 = 0;
			LOC8 = mustrehash_197187((*t).Data->Sup.len, (*t).Counter);
			if (!LOC8) goto LA9;
			n = 0;
			n = (tidnodepairseq188853*) newSeq((&NTI188853), (NI32)((*t).Data->Sup.len * 2));
			i_204052 = 0;
			HEX3Atmp_204104 = 0;
			HEX3Atmp_204104 = ((*t).Data->Sup.len-1);
			res_204106 = 0;
			while (1) {
				if (!(res_204106 <= HEX3Atmp_204104)) goto LA11;
				i_204052 = res_204106;
				{
					if (!!(((*t).Data->data[i_204052].Key == NIM_NIL))) goto LA14;
					idnodetablerawinsert_203533(&n, (*t).Data->data[i_204052].Key, (*t).Data->data[i_204052].Val);
				}
				LA14: ;
				res_204106 += 1;
			} LA11: ;
			LOC16 = 0;
			LOC16 = (*t).Data;
			unsureAsgnRef((void**) &(*t).Data, n);
			n = LOC16;
		}
		LA9: ;
		idnodetablerawinsert_203533(&(*t).Data, key, val);
		(*t).Counter += 1;
	}
	LA1: ;
}

N_NIMCALL(tnode188803*, skipconvtaketype_197265)(tnode188803* n) {
	tnode188803* result;
	result = 0;
	result = skipconv_197231(n);
	asgnRefNoCycle((void**) &(*result).Typ, (*n).Typ);
	return result;
}

N_NIMCALL(void, symtabreplaceraw_201621)(tsymseq188805** data, tsym188833* prevsym, tsym188833* newsym) {
	NI h;
	h = (NI)((*(*prevsym).Name).H & ((*data)->Sup.len-1));
	while (1) {
		if (!!(((*data)->data[h] == NIM_NIL))) goto LA1;
		{
			if (!((*data)->data[h] == prevsym)) goto LA4;
			asgnRefNoCycle((void**) &(*data)->data[h], newsym);
			goto BeforeRet;
		}
		LA4: ;
		h = nexttry_197192(h, ((*data)->Sup.len-1));
	} LA1: ;
	BeforeRet: ;
}

N_NIMCALL(void, symtabreplace_202005)(tstrtable188807* t, tsym188833* prevsym, tsym188833* newsym) {
	symtabreplaceraw_201621(&(*t).Data, prevsym, newsym);
}

N_NIMCALL(NIM_BOOL, idtablehasobjectaskey_197154)(tidtable188849 t, tidobj167013* key) {
	NIM_BOOL result;
	NI index;
	result = 0;
	index = idtablerawget_202664(t, (*key).Id);
	{
		if (!(0 <= index)) goto LA3;
		result = (t.Data->data[index].Key == key);
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	return result;
}

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

N_NIMCALL(tsym188833*, lookupinrecord_197178)(tnode188803* n, tident167019* field) {
	tsym188833* result;
	result = 0;
	result = NIM_NIL;
	switch ((*n).Kind) {
	case ((NU8) 136):
	{
		NI i_197587;
		NI HEX3Atmp_197759;
		NI LOC2;
		NI res_197761;
		i_197587 = 0;
		HEX3Atmp_197759 = 0;
		LOC2 = 0;
		LOC2 = sonslen_189181(n);
		HEX3Atmp_197759 = (NI32)(LOC2 - 1);
		res_197761 = 0;
		while (1) {
			if (!(res_197761 <= HEX3Atmp_197759)) goto LA3;
			i_197587 = res_197761;
			result = lookupinrecord_197178((*n).kindU.S6.Sons->data[i_197587], field);
			{
				if (!!((result == NIM_NIL))) goto LA6;
				goto BeforeRet;
			}
			LA6: ;
			res_197761 += 1;
		} LA3: ;
	}
	break;
	case ((NU8) 137):
	{
		NI i_197685;
		NI HEX3Atmp_197763;
		NI LOC17;
		NI res_197765;
		{
			if (!!(((*(*n).kindU.S6.Sons->data[0]).Kind == ((NU8) 3)))) goto LA11;
			internalerror_165591((*n).Info, ((NimStringDesc*) &TMP3321));
		}
		LA11: ;
		result = lookupinrecord_197178((*n).kindU.S6.Sons->data[0], field);
		{
			if (!!((result == NIM_NIL))) goto LA15;
			goto BeforeRet;
		}
		LA15: ;
		i_197685 = 0;
		HEX3Atmp_197763 = 0;
		LOC17 = 0;
		LOC17 = sonslen_189181(n);
		HEX3Atmp_197763 = (NI32)(LOC17 - 1);
		res_197765 = 1;
		while (1) {
			if (!(res_197765 <= HEX3Atmp_197763)) goto LA18;
			i_197685 = res_197765;
			switch ((*(*n).kindU.S6.Sons->data[i_197685]).Kind) {
			case ((NU8) 85):
			case ((NU8) 88):
			{
				tnode188803* LOC20;
				LOC20 = 0;
				LOC20 = lastson_189189((*n).kindU.S6.Sons->data[i_197685]);
				result = lookupinrecord_197178(LOC20, field);
				{
					if (!!((result == NIM_NIL))) goto LA23;
					goto BeforeRet;
				}
				LA23: ;
			}
			break;
			default:
			{
				internalerror_165591((*n).Info, ((NimStringDesc*) &TMP3322));
			}
			break;
			}
			res_197765 += 1;
		} LA18: ;
	}
	break;
	case ((NU8) 3):
	{
		{
			if (!((*(*(*n).kindU.S4.Sym).Name).Sup.Id == (*field).Sup.Id)) goto LA29;
			result = (*n).kindU.S4.Sym;
		}
		LA29: ;
	}
	break;
	default:
	{
		internalerror_165591((*n).Info, ((NimStringDesc*) &TMP3323));
	}
	break;
	}
	BeforeRet: ;
	return result;
}
N_NOINLINE(void, astalgoInit)(void) {
}

N_NOINLINE(void, astalgoDatInit)(void) {
static TNimNode* TMP813[2];
static TNimNode* TMP814[2];
static TNimNode TMP783[6];
NTI197207.size = sizeof(tiitable197207);
NTI197207.kind = 18;
NTI197207.base = 0;
NTI197207.flags = 2;
TMP813[0] = &TMP783[1];
TMP783[1].kind = 1;
TMP783[1].offset = offsetof(tiitable197207, Counter);
TMP783[1].typ = (&NTI106);
TMP783[1].name = "counter";
TMP813[1] = &TMP783[2];
NTI197203.size = sizeof(tiipair197203);
NTI197203.kind = 18;
NTI197203.base = 0;
NTI197203.flags = 3;
TMP814[0] = &TMP783[4];
TMP783[4].kind = 1;
TMP783[4].offset = offsetof(tiipair197203, Key);
TMP783[4].typ = (&NTI106);
TMP783[4].name = "key";
TMP814[1] = &TMP783[5];
TMP783[5].kind = 1;
TMP783[5].offset = offsetof(tiipair197203, Val);
TMP783[5].typ = (&NTI106);
TMP783[5].name = "val";
TMP783[3].len = 2; TMP783[3].kind = 2; TMP783[3].sons = &TMP814[0];
NTI197203.node = &TMP783[3];
NTI197205.size = sizeof(tiipairseq197205*);
NTI197205.kind = 24;
NTI197205.base = (&NTI197203);
NTI197205.flags = 2;
NTI197205.marker = TMP815;
TMP783[2].kind = 1;
TMP783[2].offset = offsetof(tiitable197207, Data);
TMP783[2].typ = (&NTI197205);
TMP783[2].name = "data";
TMP783[0].len = 2; TMP783[0].kind = 2; TMP783[0].sons = &TMP813[0];
NTI197207.node = &TMP783[0];
}

