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

#include <string.h>
typedef struct Tiitable198274 Tiitable198274;
typedef struct Tiipairseq198272 Tiipairseq198272;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Tiipair198270 Tiipair198270;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym190843 Tsym190843;
typedef struct Ttabiter198119 Ttabiter198119;
typedef struct Tstrtable190817 Tstrtable190817;
typedef struct Tsymseq190815 Tsymseq190815;
typedef struct Tident167021 Tident167021;
typedef struct Tidobj167015 Tidobj167015;
typedef struct TNimObject TNimObject;
typedef struct NimStringDesc NimStringDesc;
typedef struct Ttypeseq190845 Ttypeseq190845;
typedef struct Tscope190837 Tscope190837;
typedef struct TY190944 TY190944;
typedef struct Ttype190849 Ttype190849;
typedef struct Tlineinfo163338 Tlineinfo163338;
typedef struct Tnode190813 Tnode190813;
typedef struct Tloc190827 Tloc190827;
typedef struct Ropeobj161009 Ropeobj161009;
typedef struct Tlib190831 Tlib190831;
typedef struct Tidtable190861 Tidtable190861;
typedef struct Tidpairseq190859 Tidpairseq190859;
typedef struct Tidpair190857 Tidpair190857;
typedef struct Tcell46347 Tcell46347;
typedef struct Tcellset46359 Tcellset46359;
typedef struct Tgcheap48216 Tgcheap48216;
typedef struct Tcellseq46363 Tcellseq46363;
typedef struct Tpagedesc46355 Tpagedesc46355;
typedef struct Tmemregion28210 Tmemregion28210;
typedef struct Tsmallchunk27440 Tsmallchunk27440;
typedef struct Tllchunk28204 Tllchunk28204;
typedef struct Tbigchunk27442 Tbigchunk27442;
typedef struct Tintset27417 Tintset27417;
typedef struct Ttrunk27413 Ttrunk27413;
typedef struct Tavlnode28208 Tavlnode28208;
typedef struct Tgcstat48214 Tgcstat48214;
typedef struct Tnodeseq190807 Tnodeseq190807;
typedef struct Tidentiter198141 Tidentiter198141;
typedef struct Intset187056 Intset187056;
typedef struct Ttrunk187052 Ttrunk187052;
typedef struct Ttrunkseq187054 Ttrunkseq187054;
typedef struct Tidnodetable190867 Tidnodetable190867;
typedef struct Tidnodepairseq190865 Tidnodepairseq190865;
typedef struct Tidnodepair190863 Tidnodepair190863;
typedef struct Tinstantiation190833 Tinstantiation190833;
typedef struct Tlistentry130022 Tlistentry130022;
typedef struct Tbasechunk27438 Tbasechunk27438;
typedef struct Tfreecell27430 Tfreecell27430;
typedef struct TY190933 TY190933;
struct  Tiitable198274  {
NI counter;
Tiipairseq198272* data;
};
typedef N_NIMCALL_PTR(void, TY3289) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3294) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3289 marker;
TY3294 deepcopy;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tiipair198270  {
NI key;
NI val;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  Tstrtable190817  {
NI counter;
Tsymseq190815* data;
};
struct  Ttabiter198119  {
NI h;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj167015  {
  TNimObject Sup;
NI id;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tident167021  {
  Tidobj167015 Sup;
NimStringDesc* s;
Tident167021* next;
NI h;
};
struct  Tlineinfo163338  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc190827  {
NU8 k;
NU8 s;
NU16 flags;
Ttype190849* t;
Ropeobj161009* r;
Ropeobj161009* heaproot;
};
struct  Tsym190843  {
  Tidobj167015 Sup;
NU8 kind;
union{
struct {Ttypeseq190845* typeinstcache;
Tscope190837* typscope;
} S1;
struct {TY190944* procinstcache;
Tsym190843* gcunsafetyreason;
} S2;
struct {TY190944* usedgenerics;
Tstrtable190817 tab;
} S3;
struct {Tsym190843* guard;
} S4;
} kindU;
NU16 magic;
Ttype190849* typ;
Tident167021* name;
Tlineinfo163338 info;
Tsym190843* owner;
NU32 flags;
Tnode190813* ast;
NU32 options;
NI position;
NI offset;
Tloc190827 loc;
Tlib190831* annex;
Tnode190813* constraint;
};
struct  Tidtable190861  {
NI counter;
Tidpairseq190859* data;
};
struct  Tidpair190857  {
Tidobj167015* key;
TNimObject* val;
};
struct  Tcell46347  {
NI refcount;
TNimType* typ;
};
struct  Tcellseq46363  {
NI len;
NI cap;
Tcell46347** d;
};
struct  Tcellset46359  {
NI counter;
NI max;
Tpagedesc46355* head;
Tpagedesc46355** data;
};
typedef Tsmallchunk27440* TY28222[512];
typedef Ttrunk27413* Ttrunkbuckets27415[256];
struct  Tintset27417  {
Ttrunkbuckets27415 data;
};
struct  Tmemregion28210  {
NI minlargeobj;
NI maxlargeobj;
TY28222 freesmallchunks;
Tllchunk28204* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Tbigchunk27442* freechunkslist;
Tintset27417 chunkstarts;
Tavlnode28208* root;
Tavlnode28208* deleted;
Tavlnode28208* last;
Tavlnode28208* freeavlnodes;
};
struct  Tgcstat48214  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Tgcheap48216  {
void* stackbottom;
NI cyclethreshold;
Tcellseq46363 zct;
Tcellseq46363 decstack;
Tcellset46359 cycleroots;
Tcellseq46363 tempstack;
NI recgclock;
Tmemregion28210 region;
Tgcstat48214 stat;
};
struct  Tnode190813  {
Ttype190849* typ;
Tlineinfo163338 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym190843* sym;
} S4;
struct {Tident167021* ident;
} S5;
struct {Tnodeseq190807* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tidentiter198141  {
NI h;
Tident167021* name;
};
struct  Intset187056  {
NI counter;
NI max;
Ttrunk187052* head;
Ttrunkseq187054* data;
};
struct  Tidnodetable190867  {
NI counter;
Tidnodepairseq190865* data;
};
struct  Tidnodepair190863  {
Tidobj167015* key;
Tnode190813* val;
};
struct  Tscope190837  {
NI depthlevel;
Tstrtable190817 symbols;
Tnodeseq190807* usingsyms;
Tscope190837* parent;
};
struct  Ttype190849  {
  Tidobj167015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq190845* sons;
Tnode190813* n;
Tsym190843* owner;
Tsym190843* sym;
Tsym190843* destructor;
Tsym190843* deepcopy;
Tsym190843* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc190827 loc;
};
struct  Ropeobj161009  {
  TNimObject Sup;
Ropeobj161009* left;
Ropeobj161009* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry130022  {
  TNimObject Sup;
Tlistentry130022* prev;
Tlistentry130022* next;
};
struct  Tlib190831  {
  Tlistentry130022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj161009* name;
Tnode190813* path;
};
typedef NI TY27420[16];
struct  Tpagedesc46355  {
Tpagedesc46355* next;
NI key;
TY27420 bits;
};
struct  Tbasechunk27438  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Tsmallchunk27440  {
  Tbasechunk27438 Sup;
Tsmallchunk27440* next;
Tsmallchunk27440* prev;
Tfreecell27430* freelist;
NI free;
NI acc;
NF data;
};
struct  Tllchunk28204  {
NI size;
NI acc;
Tllchunk28204* next;
};
struct  Tbigchunk27442  {
  Tbasechunk27438 Sup;
Tbigchunk27442* next;
Tbigchunk27442* prev;
NI align;
NF data;
};
struct  Ttrunk27413  {
Ttrunk27413* next;
NI key;
TY27420 bits;
};
typedef Tavlnode28208* TY28214[2];
struct  Tavlnode28208  {
TY28214 link;
NI key;
NI upperbound;
NI level;
};
struct  Ttrunk187052  {
Ttrunk187052* next;
NI key;
TY27420 bits;
};
struct  Tinstantiation190833  {
Tsym190843* sym;
Ttypeseq190845* concretetypes;
TY190933* usedby;
};
struct  Tfreecell27430  {
Tfreecell27430* next;
NI zerofield;
};
struct Tiipairseq198272 {
  TGenericSeq Sup;
  Tiipair198270 data[SEQ_DECL_SIZE];
};
struct Tidpairseq190859 {
  TGenericSeq Sup;
  Tidpair190857 data[SEQ_DECL_SIZE];
};
struct Tsymseq190815 {
  TGenericSeq Sup;
  Tsym190843* data[SEQ_DECL_SIZE];
};
struct Tidnodepairseq190865 {
  TGenericSeq Sup;
  Tidnodepair190863 data[SEQ_DECL_SIZE];
};
struct Ttypeseq190845 {
  TGenericSeq Sup;
  Ttype190849* data[SEQ_DECL_SIZE];
};
struct TY190944 {
  TGenericSeq Sup;
  Tinstantiation190833* data[SEQ_DECL_SIZE];
};
struct Tnodeseq190807 {
  TGenericSeq Sup;
  Tnode190813* data[SEQ_DECL_SIZE];
};
struct Ttrunkseq187054 {
  TGenericSeq Sup;
  Ttrunk187052* data[SEQ_DECL_SIZE];
};
struct TY190933 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, TMP825)(void* p, NI op);
N_NIMCALL(Tsym190843*, nextiter_198132)(Ttabiter198119* ti, Tstrtable190817 tab);
static N_INLINE(NI, nexttry_198256)(NI h, NI maxhash);
N_NIMCALL(NI, iitablerawget_205017)(Tiitable198274 t, NI key);
N_NIMCALL(NI, idtablerawget_203306)(Tidtable190861 t, NI key);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_52222)(Tcell46347* c);
static N_INLINE(NIM_BOOL, canbecycleroot_49867)(Tcell46347* c);
static N_INLINE(void, rtladdcycleroot_50623)(Tcell46347* c);
N_NOINLINE(void, incl_47065)(Tcellset46359* s, Tcell46347* cell);
static N_INLINE(Tcell46347*, usrtocell_49846)(void* usr);
static N_INLINE(void, decref_51804)(Tcell46347* c);
static N_INLINE(void, rtladdzct_51404)(Tcell46347* c);
N_NOINLINE(void, addzct_49817)(Tcellseq46363* s, Tcell46347* c);
N_NIMCALL(NIM_BOOL, mustrehash_198249)(NI length, NI counter);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(void, idtablerawinsert_203439)(Tidpairseq190859** data, Tidobj167015* key, TNimObject* val);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(void, strtableenlarge_202428)(Tstrtable190817* t);
N_NIMCALL(void, strtablerawinsert_201573)(Tsymseq190815** data, Tsym190843* n);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, iitablerawinsert_205049)(Tiipairseq198272** data, NI key, NI val);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(NIM_BOOL, reallysameident_202540)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NI, sonslen_193403)(Tnode190813* n);
N_NIMCALL(void, internalerror_165199)(Tlineinfo163338 info, NimStringDesc* errmsg);
static N_INLINE(NI, cmpStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(Tsym190843*, lookupinrecord_198236)(Tnode190813* n, Tident167021* field);
N_NIMCALL(Tnode190813*, lastson_193431)(Tnode190813* n);
N_NIMCALL(NIM_BOOL, levalue_198374)(Tnode190813* a, Tnode190813* b);
N_NIMCALL(Tsym190843*, nextidentiter_198156)(Tidentiter198141* ti, Tstrtable190817 tab);
N_NIMCALL(Tsym190843*, nextidentexcluding_203104)(Tidentiter198141* ti, Tstrtable190817 tab, Intset187056 excluding);
N_NIMCALL(NIM_BOOL, contains_187829)(Intset187056 s, NI key);
N_NIMCALL(NI, idnodetablerawget_204296)(Tidnodetable190867 t, Tidobj167015* key);
N_NIMCALL(void, idnodetablerawinsert_204360)(Tidnodepairseq190865** data, Tidobj167015* key, Tnode190813* val);
N_NIMCALL(void, symtabreplaceraw_202032)(Tsymseq190815** data, Tsym190843* prevsym, Tsym190843* newsym);
STRING_LITERAL(TMP2676, "getSymFromList", 14);
STRING_LITERAL(TMP2957, "lookupInRecord", 14);
STRING_LITERAL(TMP2958, "lookupInRecord(record case branch)", 34);
STRING_LITERAL(TMP2959, "lookupInRecord()", 16);
TNimType NTI198274; /* TIITable */
extern TNimType NTI108; /* int */
TNimType NTI198270; /* TIIPair */
TNimType NTI198272; /* TIIPairSeq */
extern Tgcheap48216 gch_48244;
extern TNimType NTI190859; /* TIdPairSeq */
extern TNimType NTI190815; /* TSymSeq */
extern TNimType NTI190865; /* TIdNodePairSeq */
N_NIMCALL(void, TMP825)(void* p, NI op) {
	Tiipairseq198272* a;
	NI LOC1;
	a = (Tiipairseq198272*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	}
}

N_NIMCALL(Tsym190843*, nextiter_198132)(Ttabiter198119* ti, Tstrtable190817 tab) {
	Tsym190843* result;
	result = 0;
	result = NIM_NIL;
	{
		while (1) {
			if (!((*ti).h <= (tab.data ? (tab.data->Sup.len-1) : -1))) goto LA2;
			result = tab.data->data[(*ti).h];
			(*ti).h += ((NI) 1);
			{
				if (!!((result == NIM_NIL))) goto LA5;
				goto LA1;
			}
			LA5: ;
		} LA2: ;
	} LA1: ;
	return result;
}

N_NIMCALL(Tsym190843*, inittabiter_198124)(Ttabiter198119* ti, Tstrtable190817 tab) {
	Tsym190843* result;
	result = 0;
	(*ti).h = ((NI) 0);
	{
		if (!(tab.counter == ((NI) 0))) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextiter_198132(ti, tab);
	}
	LA1: ;
	return result;
}

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

N_NIMCALL(Tsym190843*, strtableget_198111)(Tstrtable190817 t, Tident167021* name) {
	Tsym190843* result;
	NI h;
	result = 0;
	h = (NI)((*name).h & (t.data ? (t.data->Sup.len-1) : -1));
	{
		while (1) {
			result = t.data->data[h];
			{
				if (!(result == NIM_NIL)) goto LA5;
				goto LA1;
			}
			LA5: ;
			{
				if (!((*(*result).name).Sup.id == (*name).Sup.id)) goto LA9;
				goto LA1;
			}
			LA9: ;
			h = nexttry_198256(h, (t.data ? (t.data->Sup.len-1) : -1));
		}
	} LA1: ;
	return result;
}

N_NIMCALL(NI, iitablerawget_205017)(Tiitable198274 t, NI key) {
	NI result;
	NI h;
{	result = 0;
	h = 0;
	h = (NI)(key & (t.data ? (t.data->Sup.len-1) : -1));
	{
		while (1) {
			if (!!((t.data->data[h].key == ((NI) (-2147483647 -1))))) goto LA2;
			{
				if (!(t.data->data[h].key == key)) goto LA5;
				result = h;
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_198256(h, (t.data ? (t.data->Sup.len-1) : -1));
		} LA2: ;
	}
	result = ((NI) -1);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NI, iitableget_198289)(Tiitable198274 t, NI key) {
	NI result;
	NI index;
	result = 0;
	index = iitablerawget_205017(t, key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = t.data->data[index].val;
	}
	goto LA1;
	LA3: ;
	{
		result = ((NI) (-2147483647 -1));
	}
	LA1: ;
	return result;
}

N_NIMCALL(NI, idtablerawget_203306)(Tidtable190861 t, NI key) {
	NI result;
	NI h;
{	result = 0;
	h = 0;
	h = (NI)(key & (t.data ? (t.data->Sup.len-1) : -1));
	{
		while (1) {
			if (!!((t.data->data[h].key == NIM_NIL))) goto LA2;
			{
				if (!((*t.data->data[h].key).id == key)) goto LA5;
				result = h;
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_198256(h, (t.data ? (t.data->Sup.len-1) : -1));
		} LA2: ;
	}
	result = ((NI) -1);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(TNimObject*, idtableget_198189)(Tidtable190861 t, NI key) {
	TNimObject* result;
	NI index;
	result = 0;
	index = idtablerawget_203306(t, key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = t.data->data[index].val;
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_NIL;
	}
	LA1: ;
	return result;
}

static N_INLINE(NIM_BOOL, canbecycleroot_49867)(Tcell46347* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).typ).flags &(1<<((((NU8) 1))&7)))!=0));
	return result;
}

static N_INLINE(void, rtladdcycleroot_50623)(Tcell46347* c) {
	{
		if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 3)))) goto LA3;
		(*c).refcount = (NI)((NI)((*c).refcount & ((NI) -4)) | ((NI) 3));
		incl_47065((&gch_48244.cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, incref_52222)(Tcell46347* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((NI) 8)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_49867(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_50623(c);
	}
	LA4: ;
}

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

static N_INLINE(void, rtladdzct_51404)(Tcell46347* c) {
	addzct_49817((&gch_48244.zct), c);
}

static N_INLINE(void, decref_51804)(Tcell46347* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3;
		rtladdzct_51404(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_49867(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_50623(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		Tcell46347* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_49846(src);
		incref_52222(LOC5);
	}
	LA3: ;
	{
		Tcell46347* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_49846((*dest));
		decref_51804(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

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

N_NIMCALL(void, idtablerawinsert_203439)(Tidpairseq190859** data, Tidobj167015* key, TNimObject* val) {
	NI h;
	h = 0;
	h = (NI)((*key).id & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h].key == NIM_NIL))) goto LA2;
			h = nexttry_198256(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	asgnRef((void**) (&(*data)->data[h].key), key);
	asgnRef((void**) (&(*data)->data[h].val), val);
}

N_NIMCALL(void, idtableput_198196)(Tidtable190861* t, Tidobj167015* key, TNimObject* val) {
	NI index;
	Tidpairseq190859* n;
	index = 0;
	n = 0;
	index = idtablerawget_203306((*t), (*key).id);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		asgnRef((void**) (&(*t).data->data[index].val), val);
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tidpairseq190859* LOC18;
			LOC8 = 0;
			LOC8 = mustrehash_198249(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
			if (!LOC8) goto LA9;
			n = (Tidpairseq190859*) newSeq((&NTI190859), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_204039;
				NI HEX3Atmp_204224;
				NI res_204227;
				i_204039 = 0;
				HEX3Atmp_204224 = 0;
				HEX3Atmp_204224 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
				res_204227 = ((NI) 0);
				{
					while (1) {
						if (!(res_204227 <= HEX3Atmp_204224)) goto LA13;
						i_204039 = res_204227;
						{
							if (!!(((*t).data->data[i_204039].key == NIM_NIL))) goto LA16;
							idtablerawinsert_203439((&n), (*t).data->data[i_204039].key, (*t).data->data[i_204039].val);
						}
						LA16: ;
						res_204227 += ((NI) 1);
					} LA13: ;
				}
			}
			LOC18 = 0;
			LOC18 = (*t).data;
			unsureAsgnRef((void**) (&(*t).data), n);
			n = LOC18;
		}
		LA9: ;
		idtablerawinsert_203439((&(*t).data), key, val);
		(*t).counter += ((NI) 1);
	}
	LA1: ;
}

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

N_NIMCALL(void, strtablerawinsert_201573)(Tsymseq190815** data, Tsym190843* n) {
	NI h;
{	h = (NI)((*(*n).name).h & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		if (!!((((*n).flags &(1<<((((NU8) 25))&31)))!=0))) goto LA3;
		{
			while (1) {
				if (!!(((*data)->data[h] == NIM_NIL))) goto LA6;
				{
					if (!((*data)->data[h] == n)) goto LA9;
					goto BeforeRet;
				}
				LA9: ;
				h = nexttry_198256(h, ((*data) ? ((*data)->Sup.len-1) : -1));
			} LA6: ;
		}
		asgnRefNoCycle((void**) (&(*data)->data[h]), n);
	}
	goto LA1;
	LA3: ;
	{
		NI favpos;
		favpos = ((NI) -1);
		{
			while (1) {
				if (!!(((*data)->data[h] == NIM_NIL))) goto LA13;
				{
					if (!((*data)->data[h] == n)) goto LA16;
					goto BeforeRet;
				}
				LA16: ;
				{
					NIM_BOOL LOC20;
					LOC20 = 0;
					LOC20 = (favpos < ((NI) 0));
					if (!(LOC20)) goto LA21;
					LOC20 = ((*(*(*data)->data[h]).name).Sup.id == (*(*n).name).Sup.id);
					LA21: ;
					if (!LOC20) goto LA22;
					favpos = h;
				}
				LA22: ;
				h = nexttry_198256(h, ((*data) ? ((*data)->Sup.len-1) : -1));
			} LA13: ;
		}
		asgnRefNoCycle((void**) (&(*data)->data[h]), n);
		{
			Tsym190843* LOC28;
			if (!(((NI) 0) <= favpos)) goto LA26;
			LOC28 = 0;
			LOC28 = (*data)->data[h];
			asgnRefNoCycle((void**) (&(*data)->data[h]), (*data)->data[favpos]);
			asgnRefNoCycle((void**) (&(*data)->data[favpos]), LOC28);
		}
		LA26: ;
	}
	LA1: ;
	}BeforeRet: ;
}

N_NIMCALL(void, strtableenlarge_202428)(Tstrtable190817* t) {
	Tsymseq190815* n;
	Tsymseq190815* LOC8;
	n = 0;
	n = (Tsymseq190815*) newSeq((&NTI190815), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
	{
		NI i_202463;
		NI HEX3Atmp_202489;
		NI res_202492;
		i_202463 = 0;
		HEX3Atmp_202489 = 0;
		HEX3Atmp_202489 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
		res_202492 = ((NI) 0);
		{
			while (1) {
				if (!(res_202492 <= HEX3Atmp_202489)) goto LA3;
				i_202463 = res_202492;
				{
					if (!!(((*t).data->data[i_202463] == NIM_NIL))) goto LA6;
					strtablerawinsert_201573((&n), (*t).data->data[i_202463]);
				}
				LA6: ;
				res_202492 += ((NI) 1);
			} LA3: ;
		}
	}
	LOC8 = 0;
	LOC8 = (*t).data;
	unsureAsgnRef((void**) (&(*t).data), n);
	n = LOC8;
}

N_NIMCALL(void, strtableadd_198103)(Tstrtable190817* t, Tsym190843* n) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = mustrehash_198249(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
		if (!LOC3) goto LA4;
		strtableenlarge_202428(t);
	}
	LA4: ;
	strtablerawinsert_201573((&(*t).data), n);
	(*t).counter += ((NI) 1);
}

N_NIMCALL(void, initiitable_198282)(Tiitable198274* x) {
	(*x).counter = ((NI) 0);
	unsureAsgnRef((void**) (&(*x).data), (Tiipairseq198272*) newSeq((&NTI198272), ((NI) 8)));
	{
		NI i_204994;
		NI res_204998;
		i_204994 = 0;
		res_204998 = ((NI) 0);
		{
			while (1) {
				if (!(res_204998 <= ((NI) 7))) goto LA3;
				i_204994 = res_204998;
				(*x).data->data[i_204994].key = ((NI) (-2147483647 -1));
				res_204998 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, iitablerawinsert_205049)(Tiipairseq198272** data, NI key, NI val) {
	NI h;
	h = 0;
	h = (NI)(key & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h].key == ((NI) (-2147483647 -1))))) goto LA2;
			h = nexttry_198256(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	(*data)->data[h].key = key;
	(*data)->data[h].val = val;
}

N_NIMCALL(void, iitableput_198296)(Tiitable198274* t, NI key, NI val) {
	NI index;
	index = iitablerawget_205017((*t), key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		(*t).data->data[index].val = val;
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tiipairseq198272* n;
			Tiipairseq198272* LOC21;
			LOC8 = 0;
			LOC8 = mustrehash_198249(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
			if (!LOC8) goto LA9;
			n = 0;
			n = (Tiipairseq198272*) newSeq((&NTI198272), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_205640;
				NI HEX3Atmp_205677;
				NI res_205680;
				i_205640 = 0;
				HEX3Atmp_205677 = 0;
				HEX3Atmp_205677 = (n ? (n->Sup.len-1) : -1);
				res_205680 = ((NI) 0);
				{
					while (1) {
						if (!(res_205680 <= HEX3Atmp_205677)) goto LA13;
						i_205640 = res_205680;
						n->data[i_205640].key = ((NI) (-2147483647 -1));
						res_205680 += ((NI) 1);
					} LA13: ;
				}
			}
			{
				NI i_205653;
				NI HEX3Atmp_205685;
				NI res_205688;
				i_205653 = 0;
				HEX3Atmp_205685 = 0;
				HEX3Atmp_205685 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
				res_205688 = ((NI) 0);
				{
					while (1) {
						if (!(res_205688 <= HEX3Atmp_205685)) goto LA16;
						i_205653 = res_205688;
						{
							if (!!(((*t).data->data[i_205653].key == ((NI) (-2147483647 -1))))) goto LA19;
							iitablerawinsert_205049((&n), (*t).data->data[i_205653].key, (*t).data->data[i_205653].val);
						}
						LA19: ;
						res_205688 += ((NI) 1);
					} LA16: ;
				}
			}
			LOC21 = 0;
			LOC21 = (*t).data;
			unsureAsgnRef((void**) (&(*t).data), n);
			n = LOC21;
		}
		LA9: ;
		iitablerawinsert_205049((&(*t).data), key, val);
		(*t).counter += ((NI) 1);
	}
	LA1: ;
}

N_NIMCALL(Tsym190843*, getmodule_198243)(Tsym190843* s) {
	Tsym190843* result;
	result = 0;
	result = s;
	{
		while (1) {
			NIM_BOOL LOC3;
			LOC3 = 0;
			LOC3 = !((result == NIM_NIL));
			if (!(LOC3)) goto LA4;
			LOC3 = !(((*result).kind == ((NU8) 6)));
			LA4: ;
			if (!LOC3) goto LA2;
			result = (*result).owner;
		} LA2: ;
	}
	return result;
}

N_NIMCALL(TNimObject*, idtableget_198182)(Tidtable190861 t, Tidobj167015* key) {
	TNimObject* result;
	NI index;
	result = 0;
	index = idtablerawget_203306(t, (*key).id);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = t.data->data[index].val;
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_NIL;
	}
	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)), (*a).Sup.len);
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NIM_BOOL, samevalue_198324)(Tnode190813* a, Tnode190813* b) {
	NIM_BOOL result;
	result = 0;
	result = NIM_FALSE;
	switch ((*a).kind) {
	case ((NU8) 5) ... ((NU8) 15):
	{
		{
			if (!((*b).kind >= ((NU8) 5) && (*b).kind <= ((NU8) 15))) 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;
}

static N_INLINE(NIM_BOOL, reallysameident_202540)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	result = 0;
	result = NIM_TRUE;
	return result;
}

N_NIMCALL(NIM_BOOL, strtableincl_202607)(Tstrtable190817* t, Tsym190843* n) {
	NIM_BOOL result;
	NI h;
	NI replaceslot;
{	result = 0;
	h = (NI)((*(*n).name).h & ((*t).data ? ((*t).data->Sup.len-1) : -1));
	replaceslot = ((NI) -1);
	{
		while (1) {
			Tsym190843* it;
			it = (*t).data->data[h];
			{
				if (!(it == NIM_NIL)) goto LA5;
				goto LA1;
			}
			LA5: ;
			{
				NIM_BOOL LOC9;
				LOC9 = 0;
				LOC9 = ((*(*it).name).Sup.id == (*(*n).name).Sup.id);
				if (!(LOC9)) goto LA10;
				LOC9 = reallysameident_202540((*(*it).name).s, (*(*n).name).s);
				LA10: ;
				if (!LOC9) goto LA11;
				{
					if (!(it == n)) goto LA15;
					result = NIM_FALSE;
					goto BeforeRet;
				}
				LA15: ;
				replaceslot = h;
			}
			LA11: ;
			h = nexttry_198256(h, ((*t).data ? ((*t).data->Sup.len-1) : -1));
		}
	} LA1: ;
	{
		if (!(((NI) 0) <= replaceslot)) goto LA19;
		asgnRefNoCycle((void**) (&(*t).data->data[replaceslot]), n);
		result = NIM_TRUE;
		goto BeforeRet;
	}
	goto LA17;
	LA19: ;
	{
		NIM_BOOL LOC22;
		LOC22 = 0;
		LOC22 = mustrehash_198249(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
		if (!LOC22) goto LA23;
		strtableenlarge_202428(t);
		strtablerawinsert_201573((&(*t).data), n);
	}
	goto LA17;
	LA23: ;
	{
		asgnRefNoCycle((void**) (&(*t).data->data[h]), n);
	}
	LA17: ;
	(*t).counter += ((NI) 1);
	result = NIM_FALSE;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym190843*, getsymfromlist_198228)(Tnode190813* list, Tident167021* ident, NI start) {
	Tsym190843* result;
{	result = 0;
	{
		NI i_198854;
		NI HEX3Atmp_198869;
		NI LOC2;
		NI res_198872;
		i_198854 = 0;
		HEX3Atmp_198869 = 0;
		LOC2 = 0;
		LOC2 = sonslen_193403(list);
		HEX3Atmp_198869 = (NI)(LOC2 - ((NI) 1));
		res_198872 = start;
		{
			while (1) {
				if (!(res_198872 <= HEX3Atmp_198869)) goto LA4;
				i_198854 = res_198872;
				{
					if (!((*(*list).kindU.S6.sons->data[i_198854]).kind == ((NU8) 3))) goto LA7;
					result = (*(*list).kindU.S6.sons->data[i_198854]).kindU.S4.sym;
					{
						if (!((*(*result).name).Sup.id == (*ident).Sup.id)) goto LA11;
						goto BeforeRet;
					}
					LA11: ;
				}
				goto LA5;
				LA7: ;
				{
					internalerror_165199((*list).info, ((NimStringDesc*) &TMP2676));
				}
				LA5: ;
				res_198872 += ((NI) 1);
			} LA4: ;
		}
	}
	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 = ((NI) 0);
		goto BeforeRet;
	}
	LA3: ;
	{
		if (!(a == NIM_NIL)) goto LA7;
		result = ((NI) -1);
		goto BeforeRet;
	}
	LA7: ;
	{
		if (!(b == NIM_NIL)) goto LA11;
		result = ((NI) 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_198374)(Tnode190813* a, Tnode190813* b) {
	NIM_BOOL result;
	result = 0;
	result = NIM_FALSE;
	switch ((*a).kind) {
	case ((NU8) 5) ... ((NU8) 14):
	{
		{
			if (!((*b).kind >= ((NU8) 5) && (*b).kind <= ((NU8) 14))) 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(Tsym190843*, lookupinrecord_198236)(Tnode190813* n, Tident167021* field) {
	Tsym190843* result;
{	result = 0;
	result = NIM_NIL;
	switch ((*n).kind) {
	case ((NU8) 138):
	{
		{
			NI i_198472;
			NI HEX3Atmp_198540;
			NI LOC3;
			NI res_198543;
			i_198472 = 0;
			HEX3Atmp_198540 = 0;
			LOC3 = 0;
			LOC3 = sonslen_193403(n);
			HEX3Atmp_198540 = (NI)(LOC3 - ((NI) 1));
			res_198543 = ((NI) 0);
			{
				while (1) {
					if (!(res_198543 <= HEX3Atmp_198540)) goto LA5;
					i_198472 = res_198543;
					result = lookupinrecord_198236((*n).kindU.S6.sons->data[i_198472], field);
					{
						if (!!((result == NIM_NIL))) goto LA8;
						goto BeforeRet;
					}
					LA8: ;
					res_198543 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 139):
	{
		{
			if (!!(((*(*n).kindU.S6.sons->data[((NI) 0)]).kind == ((NU8) 3)))) goto LA13;
			internalerror_165199((*n).info, ((NimStringDesc*) &TMP2957));
		}
		LA13: ;
		result = lookupinrecord_198236((*n).kindU.S6.sons->data[((NI) 0)], field);
		{
			if (!!((result == NIM_NIL))) goto LA17;
			goto BeforeRet;
		}
		LA17: ;
		{
			NI i_198521;
			NI HEX3Atmp_198548;
			NI LOC20;
			NI res_198551;
			i_198521 = 0;
			HEX3Atmp_198548 = 0;
			LOC20 = 0;
			LOC20 = sonslen_193403(n);
			HEX3Atmp_198548 = (NI)(LOC20 - ((NI) 1));
			res_198551 = ((NI) 1);
			{
				while (1) {
					if (!(res_198551 <= HEX3Atmp_198548)) goto LA22;
					i_198521 = res_198551;
					switch ((*(*n).kindU.S6.sons->data[i_198521]).kind) {
					case ((NU8) 85):
					case ((NU8) 88):
					{
						Tnode190813* LOC24;
						LOC24 = 0;
						LOC24 = lastson_193431((*n).kindU.S6.sons->data[i_198521]);
						result = lookupinrecord_198236(LOC24, field);
						{
							if (!!((result == NIM_NIL))) goto LA27;
							goto BeforeRet;
						}
						LA27: ;
					}
					break;
					default:
					{
						internalerror_165199((*n).info, ((NimStringDesc*) &TMP2958));
					}
					break;
					}
					res_198551 += ((NI) 1);
				} LA22: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		{
			if (!((*(*(*n).kindU.S4.sym).name).Sup.id == (*field).Sup.id)) goto LA33;
			result = (*n).kindU.S4.sym;
		}
		LA33: ;
	}
	break;
	default:
	{
		internalerror_165199((*n).info, ((NimStringDesc*) &TMP2959));
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NU8, weaklevalue_198424)(Tnode190813* a, Tnode190813* 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_198374(a, b);
			if (!LOC10) goto LA11;
			result = ((NU8) 2);
		}
		goto LA8;
		LA11: ;
		{
			result = ((NU8) 1);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym190843*, nextidentiter_198156)(Tidentiter198141* ti, Tstrtable190817 tab) {
	Tsym190843* result;
	NI h;
	NI start;
	result = 0;
	h = (NI)((*ti).h & (tab.data ? (tab.data->Sup.len-1) : -1));
	start = h;
	result = tab.data->data[h];
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				if (!((*(*result).name).Sup.id == (*(*ti).name).Sup.id)) goto LA5;
				goto LA1;
			}
			LA5: ;
			h = nexttry_198256(h, (tab.data ? (tab.data->Sup.len-1) : -1));
			{
				if (!(h == start)) goto LA9;
				result = NIM_NIL;
				goto LA1;
			}
			LA9: ;
			result = tab.data->data[h];
		} LA2: ;
	} LA1: ;
	(*ti).h = nexttry_198256(h, (tab.data ? (tab.data->Sup.len-1) : -1));
	return result;
}

N_NIMCALL(Tsym190843*, initidentiter_198147)(Tidentiter198141* ti, Tstrtable190817 tab, Tident167021* s) {
	Tsym190843* result;
	result = 0;
	(*ti).h = (*s).h;
	unsureAsgnRef((void**) (&(*ti).name), s);
	{
		if (!(tab.counter == ((NI) 0))) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextidentiter_198156(ti, tab);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym190843*, nextidentexcluding_203104)(Tidentiter198141* ti, Tstrtable190817 tab, Intset187056 excluding) {
	Tsym190843* result;
	NI h;
	NI start;
	result = 0;
	h = (NI)((*ti).h & (tab.data ? (tab.data->Sup.len-1) : -1));
	start = h;
	result = tab.data->data[h];
	{
		while (1) {
			if (!!((result == NIM_NIL))) goto LA2;
			{
				NIM_BOOL LOC5;
				NIM_BOOL LOC7;
				LOC5 = 0;
				LOC5 = ((*(*result).name).Sup.id == (*(*ti).name).Sup.id);
				if (!(LOC5)) goto LA6;
				LOC7 = 0;
				LOC7 = contains_187829(excluding, (*result).Sup.id);
				LOC5 = !(LOC7);
				LA6: ;
				if (!LOC5) goto LA8;
				goto LA1;
			}
			LA8: ;
			h = nexttry_198256(h, (tab.data ? (tab.data->Sup.len-1) : -1));
			{
				if (!(h == start)) goto LA12;
				result = NIM_NIL;
				goto LA1;
			}
			LA12: ;
			result = tab.data->data[h];
		} LA2: ;
	} LA1: ;
	(*ti).h = nexttry_198256(h, (tab.data ? (tab.data->Sup.len-1) : -1));
	{
		NIM_BOOL LOC16;
		LOC16 = 0;
		LOC16 = !((result == NIM_NIL));
		if (!(LOC16)) goto LA17;
		LOC16 = contains_187829(excluding, (*result).Sup.id);
		LA17: ;
		if (!LOC16) goto LA18;
		result = NIM_NIL;
	}
	LA18: ;
	return result;
}

N_NIMCALL(Tsym190843*, firstidentexcluding_203154)(Tidentiter198141* ti, Tstrtable190817 tab, Tident167021* s, Intset187056 excluding) {
	Tsym190843* result;
	result = 0;
	(*ti).h = (*s).h;
	unsureAsgnRef((void**) (&(*ti).name), s);
	{
		if (!(tab.counter == ((NI) 0))) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextidentexcluding_203104(ti, tab, excluding);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NI, idnodetablerawget_204296)(Tidnodetable190867 t, Tidobj167015* key) {
	NI result;
	NI h;
{	result = 0;
	h = 0;
	h = (NI)((*key).id & (t.data ? (t.data->Sup.len-1) : -1));
	{
		while (1) {
			if (!!((t.data->data[h].key == NIM_NIL))) goto LA2;
			{
				if (!((*t.data->data[h].key).id == (*key).id)) goto LA5;
				result = h;
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_198256(h, (t.data ? (t.data->Sup.len-1) : -1));
		} LA2: ;
	}
	result = ((NI) -1);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tnode190813*, idnodetableget_198212)(Tidnodetable190867 t, Tidobj167015* key) {
	Tnode190813* result;
	NI index;
	result = 0;
	index = 0;
	index = idnodetablerawget_204296(t, key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = t.data->data[index].val;
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_NIL;
	}
	LA1: ;
	return result;
}

N_NIMCALL(void, idnodetablerawinsert_204360)(Tidnodepairseq190865** data, Tidobj167015* key, Tnode190813* val) {
	NI h;
	h = 0;
	h = (NI)((*key).id & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h].key == NIM_NIL))) goto LA2;
			h = nexttry_198256(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	asgnRef((void**) (&(*data)->data[h].key), key);
	asgnRefNoCycle((void**) (&(*data)->data[h].val), val);
}

N_NIMCALL(void, idnodetableput_198219)(Tidnodetable190867* t, Tidobj167015* key, Tnode190813* val) {
	NI index;
	index = idnodetablerawget_204296((*t), key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		asgnRefNoCycle((void**) (&(*t).data->data[index].val), val);
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tidnodepairseq190865* n;
			Tidnodepairseq190865* LOC18;
			LOC8 = 0;
			LOC8 = mustrehash_198249(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
			if (!LOC8) goto LA9;
			n = 0;
			n = (Tidnodepairseq190865*) newSeq((&NTI190865), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_204840;
				NI HEX3Atmp_204876;
				NI res_204879;
				i_204840 = 0;
				HEX3Atmp_204876 = 0;
				HEX3Atmp_204876 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
				res_204879 = ((NI) 0);
				{
					while (1) {
						if (!(res_204879 <= HEX3Atmp_204876)) goto LA13;
						i_204840 = res_204879;
						{
							if (!!(((*t).data->data[i_204840].key == NIM_NIL))) goto LA16;
							idnodetablerawinsert_204360((&n), (*t).data->data[i_204840].key, (*t).data->data[i_204840].val);
						}
						LA16: ;
						res_204879 += ((NI) 1);
					} LA13: ;
				}
			}
			LOC18 = 0;
			LOC18 = (*t).data;
			unsureAsgnRef((void**) (&(*t).data), n);
			n = LOC18;
		}
		LA9: ;
		idnodetablerawinsert_204360((&(*t).data), key, val);
		(*t).counter += ((NI) 1);
	}
	LA1: ;
}

N_NIMCALL(Tnode190813*, skipconvandclosure_198305)(Tnode190813* n) {
	Tnode190813* result;
	result = 0;
	result = n;
	{
		while (1) {
			switch ((*result).kind) {
			case ((NU8) 67):
			case ((NU8) 66):
			case ((NU8) 70):
			case ((NU8) 68):
			case ((NU8) 69):
			case ((NU8) 155):
			{
				result = (*result).kindU.S6.sons->data[((NI) 0)];
			}
			break;
			case ((NU8) 58):
			case ((NU8) 59):
			case ((NU8) 60):
			{
				result = (*result).kindU.S6.sons->data[((NI) 1)];
			}
			break;
			default:
			{
				goto LA1;
			}
			break;
			}
		}
	} LA1: ;
	return result;
}

N_NIMCALL(void, symtabreplaceraw_202032)(Tsymseq190815** data, Tsym190843* prevsym, Tsym190843* newsym) {
	NI h;
{	h = (NI)((*(*prevsym).name).h & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h] == NIM_NIL))) goto LA2;
			{
				if (!((*data)->data[h] == prevsym)) goto LA5;
				asgnRefNoCycle((void**) (&(*data)->data[h]), newsym);
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_198256(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	}BeforeRet: ;
}

N_NIMCALL(void, symtabreplace_202415)(Tstrtable190817* t, Tsym190843* prevsym, Tsym190843* newsym) {
	symtabreplaceraw_202032((&(*t).data), prevsym, newsym);
}

N_NIMCALL(NIM_BOOL, idtablehasobjectaskey_198205)(Tidtable190861 t, Tidobj167015* key) {
	NIM_BOOL result;
	NI index;
	result = 0;
	index = idtablerawget_203306(t, (*key).id);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = (t.data->data[index].key == key);
	}
	goto LA1;
	LA3: ;
	{
		result = NIM_FALSE;
	}
	LA1: ;
	return result;
}
NIM_EXTERNC N_NOINLINE(void, nimsrc_astalgoInit)(void) {
}

NIM_EXTERNC N_NOINLINE(void, nimsrc_astalgoDatInit)(void) {
static TNimNode* TMP823[2];
static TNimNode* TMP824[2];
static TNimNode TMP793[6];
NTI198274.size = sizeof(Tiitable198274);
NTI198274.kind = 18;
NTI198274.base = 0;
NTI198274.flags = 2;
TMP823[0] = &TMP793[1];
TMP793[1].kind = 1;
TMP793[1].offset = offsetof(Tiitable198274, counter);
TMP793[1].typ = (&NTI108);
TMP793[1].name = "counter";
TMP823[1] = &TMP793[2];
NTI198270.size = sizeof(Tiipair198270);
NTI198270.kind = 18;
NTI198270.base = 0;
NTI198270.flags = 3;
TMP824[0] = &TMP793[4];
TMP793[4].kind = 1;
TMP793[4].offset = offsetof(Tiipair198270, key);
TMP793[4].typ = (&NTI108);
TMP793[4].name = "key";
TMP824[1] = &TMP793[5];
TMP793[5].kind = 1;
TMP793[5].offset = offsetof(Tiipair198270, val);
TMP793[5].typ = (&NTI108);
TMP793[5].name = "val";
TMP793[3].len = 2; TMP793[3].kind = 2; TMP793[3].sons = &TMP824[0];
NTI198270.node = &TMP793[3];
NTI198272.size = sizeof(Tiipairseq198272*);
NTI198272.kind = 24;
NTI198272.base = (&NTI198270);
NTI198272.flags = 2;
NTI198272.marker = TMP825;
TMP793[2].kind = 1;
TMP793[2].offset = offsetof(Tiitable198274, data);
TMP793[2].typ = (&NTI198272);
TMP793[2].name = "data";
TMP793[0].len = 2; TMP793[0].kind = 2; TMP793[0].sons = &TMP823[0];
NTI198274.node = &TMP793[0];
}

