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

#include "nimbase.h"
#include <string.h>
typedef struct Tiitable222163 Tiitable222163;
typedef struct Tiipairseq222161 Tiipairseq222161;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Tiipair222159 Tiipair222159;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym215822 Tsym215822;
typedef struct Ttabiter222071 Ttabiter222071;
typedef struct Tstrtable215794 Tstrtable215794;
typedef struct Tsymseq215792 Tsymseq215792;
typedef struct Tident190012 Tident190012;
typedef struct Tidobj190006 Tidobj190006;
typedef struct TNimObject TNimObject;
typedef struct NimStringDesc NimStringDesc;
typedef struct Ttypeseq215824 Ttypeseq215824;
typedef struct Tscope215816 Tscope215816;
typedef struct TY215925 TY215925;
typedef struct Ttype215828 Ttype215828;
typedef struct Tlineinfo183337 Tlineinfo183337;
typedef struct Tnode215790 Tnode215790;
typedef struct Tloc215804 Tloc215804;
typedef struct Ropeobj170006 Ropeobj170006;
typedef struct Tlib215808 Tlib215808;
typedef struct Tidtable215840 Tidtable215840;
typedef struct Tidpairseq215838 Tidpairseq215838;
typedef struct Tidpair215836 Tidpair215836;
typedef struct Cell47504 Cell47504;
typedef struct Cellset47516 Cellset47516;
typedef struct Gcheap49818 Gcheap49818;
typedef struct Gcstack49816 Gcstack49816;
typedef struct Cellseq47520 Cellseq47520;
typedef struct Pagedesc47512 Pagedesc47512;
typedef struct Memregion29688 Memregion29688;
typedef struct Smallchunk29640 Smallchunk29640;
typedef struct Llchunk29682 Llchunk29682;
typedef struct Bigchunk29642 Bigchunk29642;
typedef struct Intset29614 Intset29614;
typedef struct Trunk29610 Trunk29610;
typedef struct Avlnode29686 Avlnode29686;
typedef struct Gcstat49814 Gcstat49814;
typedef struct Tnodeseq215784 Tnodeseq215784;
typedef struct Tidentiter222084 Tidentiter222084;
typedef struct Intset212035 Intset212035;
typedef struct Tidnodetable215846 Tidnodetable215846;
typedef struct Tidnodepairseq215844 Tidnodepairseq215844;
typedef struct Tidnodepair215842 Tidnodepair215842;
typedef struct Tinstantiation215812 Tinstantiation215812;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct Basechunk29638 Basechunk29638;
typedef struct Freecell29630 Freecell29630;
typedef struct Trunk212031 Trunk212031;
typedef struct Trunkseq212033 Trunkseq212033;
typedef struct TY215913 TY215913;
struct  Tiitable222163  {
NI counter;
Tiipairseq222161* data;
};
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tiipair222159  {
NI key;
NI val;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  Tstrtable215794  {
NI counter;
Tsymseq215792* data;
};
struct  Ttabiter222071  {
NI h;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Tidobj190006  {
  TNimObject Sup;
NI id;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tident190012  {
  Tidobj190006 Sup;
NimStringDesc* s;
Tident190012* next;
NI h;
};
struct  Tlineinfo183337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  Tloc215804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype215828* t;
Ropeobj170006* r;
Ropeobj170006* heaproot;
};
struct  Tsym215822  {
  Tidobj190006 Sup;
NU8 kind;
union{
struct {Ttypeseq215824* typeinstcache;
Tscope215816* typscope;
} S1;
struct {TY215925* procinstcache;
Tsym215822* gcunsafetyreason;
} S2;
struct {TY215925* usedgenerics;
Tstrtable215794 tab;
} S3;
struct {Tsym215822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype215828* typ;
Tident190012* name;
Tlineinfo183337 info;
Tsym215822* owner;
NU32 flags;
Tnode215790* ast;
NU32 options;
NI position;
NI offset;
Tloc215804 loc;
Tlib215808* annex;
Tnode215790* constraint;
};
struct  Tidtable215840  {
NI counter;
Tidpairseq215838* data;
};
struct  Tidpair215836  {
Tidobj190006* key;
TNimObject* val;
};
struct  Cell47504  {
NI refcount;
TNimType* typ;
};
struct  Cellseq47520  {
NI len;
NI cap;
Cell47504** d;
};
struct  Cellset47516  {
NI counter;
NI max;
Pagedesc47512* head;
Pagedesc47512** data;
};
typedef Smallchunk29640* TY29703[512];
typedef Trunk29610* Trunkbuckets29612[256];
struct  Intset29614  {
Trunkbuckets29612 data;
};
struct  Memregion29688  {
NI minlargeobj;
NI maxlargeobj;
TY29703 freesmallchunks;
Llchunk29682* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29642* freechunkslist;
Intset29614 chunkstarts;
Avlnode29686* root;
Avlnode29686* deleted;
Avlnode29686* last;
Avlnode29686* freeavlnodes;
};
struct  Gcstat49814  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap49818  {
Gcstack49816* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47520 zct;
Cellseq47520 decstack;
Cellset47516 cycleroots;
Cellseq47520 tempstack;
NI recgclock;
Memregion29688 region;
Gcstat49814 stat;
};
struct  Tnode215790  {
Ttype215828* typ;
Tlineinfo183337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym215822* sym;
} S4;
struct {Tident190012* ident;
} S5;
struct {Tnodeseq215784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Tidentiter222084  {
NI h;
Tident190012* name;
};
struct  Tidnodetable215846  {
NI counter;
Tidnodepairseq215844* data;
};
struct  Tidnodepair215842  {
Tidobj190006* key;
Tnode215790* val;
};
struct  Tscope215816  {
NI depthlevel;
Tstrtable215794 symbols;
Tnodeseq215784* usingsyms;
Tscope215816* parent;
};
struct  Ttype215828  {
  Tidobj190006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq215824* sons;
Tnode215790* n;
Tsym215822* owner;
Tsym215822* sym;
Tsym215822* destructor;
Tsym215822* deepcopy;
Tsym215822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc215804 loc;
};
struct  Ropeobj170006  {
  TNimObject Sup;
Ropeobj170006* left;
Ropeobj170006* right;
NI length;
NimStringDesc* data;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib215808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj170006* name;
Tnode215790* path;
};
struct  Gcstack49816  {
Gcstack49816* prev;
Gcstack49816* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY29619[8];
struct  Pagedesc47512  {
Pagedesc47512* next;
NI key;
TY29619 bits;
};
struct  Basechunk29638  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29640  {
  Basechunk29638 Sup;
Smallchunk29640* next;
Smallchunk29640* prev;
Freecell29630* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29682  {
NI size;
NI acc;
Llchunk29682* next;
};
struct  Bigchunk29642  {
  Basechunk29638 Sup;
Bigchunk29642* next;
Bigchunk29642* prev;
NI align;
NF data;
};
struct  Trunk29610  {
Trunk29610* next;
NI key;
TY29619 bits;
};
typedef Avlnode29686* TY29693[2];
struct  Avlnode29686  {
TY29693 link;
NI key;
NI upperbound;
NI level;
};
struct  Intset212035  {
NI counter;
NI max;
Trunk212031* head;
Trunkseq212033* data;
};
struct  Tinstantiation215812  {
Tsym215822* sym;
Ttypeseq215824* concretetypes;
TY215913* usedby;
NI compilesid;
};
struct  Freecell29630  {
Freecell29630* next;
NI zerofield;
};
struct  Trunk212031  {
Trunk212031* next;
NI key;
TY29619 bits;
};
struct Tiipairseq222161 {
  TGenericSeq Sup;
  Tiipair222159 data[SEQ_DECL_SIZE];
};
struct Tidpairseq215838 {
  TGenericSeq Sup;
  Tidpair215836 data[SEQ_DECL_SIZE];
};
struct Tsymseq215792 {
  TGenericSeq Sup;
  Tsym215822* data[SEQ_DECL_SIZE];
};
struct Tidnodepairseq215844 {
  TGenericSeq Sup;
  Tidnodepair215842 data[SEQ_DECL_SIZE];
};
struct Ttypeseq215824 {
  TGenericSeq Sup;
  Ttype215828* data[SEQ_DECL_SIZE];
};
struct TY215925 {
  TGenericSeq Sup;
  Tinstantiation215812* data[SEQ_DECL_SIZE];
};
struct Tnodeseq215784 {
  TGenericSeq Sup;
  Tnode215790* data[SEQ_DECL_SIZE];
};
struct Trunkseq212033 {
  TGenericSeq Sup;
  Trunk212031* data[SEQ_DECL_SIZE];
};
struct TY215913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, TMP910)(void* p, NI op);
N_NIMCALL(Tsym215822*, nextiter_222078)(Ttabiter222071* ti, Tstrtable215794 tab);
static N_INLINE(NI, nexttry_222151)(NI h, NI maxhash);
N_NIMCALL(NI, iitablerawget_228162)(Tiitable222163 t, NI key);
N_NIMCALL(NI, idtablerawget_226599)(Tidtable215840 t, NI key);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incref_53819)(Cell47504* c);
static N_INLINE(NIM_BOOL, canbecycleroot_51458)(Cell47504* c);
static N_INLINE(void, rtladdcycleroot_52220)(Cell47504* c);
N_NOINLINE(void, incl_48247)(Cellset47516* s, Cell47504* cell);
static N_INLINE(Cell47504*, usrtocell_51440)(void* usr);
static N_INLINE(void, decref_53401)(Cell47504* c);
static N_INLINE(void, rtladdzct_53001)(Cell47504* c);
N_NOINLINE(void, addzct_51417)(Cellseq47520* s, Cell47504* c);
N_NIMCALL(NIM_BOOL, mustrehash_222147)(NI length, NI counter);
N_NIMCALL(void*, newSeq)(TNimType* typ, NI len);
N_NIMCALL(void, idtablerawinsert_226685)(Tidpairseq215838** data, Tidobj190006* key, TNimObject* val);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NI, sonslen_218351)(Tnode215790* n);
N_NIMCALL(Tsym215822*, lookupinrecord_222140)(Tnode215790* n, Tident190012* field);
N_NIMCALL(void, internalerror_188100)(Tlineinfo183337 info, NimStringDesc* errmsg);
N_NIMCALL(Tnode215790*, lastson_218364)(Tnode215790* n);
static N_INLINE(NIM_BOOL, reallysameident_225900)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(void, strtableenlarge_225810)(Tstrtable215794* t);
N_NIMCALL(void, strtablerawinsert_225127)(Tsymseq215792** data, Tsym215822* n);
N_NIMCALL(void, iitablerawinsert_228176)(Tiipairseq222161** data, NI key, NI val);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(NI, cmpStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NIM_BOOL, levalue_222233)(Tnode215790* a, Tnode215790* b);
N_NIMCALL(Tsym215822*, nextidentiter_222093)(Tidentiter222084* ti, Tstrtable215794 tab);
N_NIMCALL(Tsym215822*, nextidentexcluding_226462)(Tidentiter222084* ti, Tstrtable215794 tab, Intset212035* excluding);
N_NIMCALL(NIM_BOOL, contains_212811)(Intset212035* s, NI key);
N_NIMCALL(NI, idnodetablerawget_227464)(Tidnodetable215846 t, Tidobj190006* key);
N_NIMCALL(void, idnodetablerawinsert_227504)(Tidnodepairseq215844** data, Tidobj190006* key, Tnode215790* val);
N_NIMCALL(void, symtabreplaceraw_225414)(Tsymseq215792** data, Tsym215822* prevsym, Tsym215822* newsym);
STRING_LITERAL(TMP1136, "lookupInRecord", 14);
STRING_LITERAL(TMP1137, "lookupInRecord(record case branch)", 34);
STRING_LITERAL(TMP1138, "lookupInRecord()", 16);
STRING_LITERAL(TMP1143, "getSymFromList", 14);
TNimType NTI222163; /* TIITable */
extern TNimType NTI104; /* int */
TNimType NTI222159; /* TIIPair */
TNimType NTI222161; /* TIIPairSeq */
extern Gcheap49818 gch_49859;
extern TNimType NTI215838; /* TIdPairSeq */
extern TNimType NTI215792; /* TSymSeq */
extern TNimType NTI215844; /* TIdNodePairSeq */
N_NIMCALL(void, TMP910)(void* p, NI op) {
	Tiipairseq222161* a;
	NI LOC1;
	a = (Tiipairseq222161*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	}
}

N_NIMCALL(Tsym215822*, nextiter_222078)(Ttabiter222071* ti, Tstrtable215794 tab) {
	Tsym215822* 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(Tsym215822*, inittabiter_222073)(Ttabiter222071* ti, Tstrtable215794 tab) {
	Tsym215822* result;
	result = 0;
	(*ti).h = ((NI) 0);
	{
		if (!(tab.counter == ((NI) 0))) goto LA3;
		result = NIM_NIL;
	}
	goto LA1;
	LA3: ;
	{
		result = nextiter_222078(ti, tab);
	}
	LA1: ;
	return result;
}

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

N_NIMCALL(Tsym215822*, strtableget_222066)(Tstrtable215794 t, Tident190012* name) {
	Tsym215822* 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_222151(h, (t.data ? (t.data->Sup.len-1) : -1));
		}
	} LA1: ;
	return result;
}

N_NIMCALL(NI, iitablerawget_228162)(Tiitable222163 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) (IL64(-9223372036854775807) - IL64(1)))))) goto LA2;
			{
				if (!(t.data->data[h].key == key)) goto LA5;
				result = h;
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_222151(h, (t.data ? (t.data->Sup.len-1) : -1));
		} LA2: ;
	}
	result = ((NI) -1);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NI, iitableget_222172)(Tiitable222163 t, NI key) {
	NI result;
	NI index;
	result = 0;
	index = iitablerawget_228162(t, key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		result = t.data->data[index].val;
	}
	goto LA1;
	LA3: ;
	{
		result = ((NI) (IL64(-9223372036854775807) - IL64(1)));
	}
	LA1: ;
	return result;
}

N_NIMCALL(NI, idtablerawget_226599)(Tidtable215840 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_222151(h, (t.data ? (t.data->Sup.len-1) : -1));
		} LA2: ;
	}
	result = ((NI) -1);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(TNimObject*, idtableget_222111)(Tidtable215840 t, NI key) {
	TNimObject* result;
	NI index;
	result = 0;
	index = idtablerawget_226599(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_51458)(Cell47504* c) {
	NIM_BOOL result;
	result = 0;
	result = !((((*(*c).typ).flags &(1U<<((NU)(((NU8) 1))&7U)))!=0));
	return result;
}

static N_INLINE(void, rtladdcycleroot_52220)(Cell47504* c) {
	{
		if (!!((((NI) ((NI)((*c).refcount & ((NI) 3)))) == ((NI) 3)))) goto LA3;
		(*c).refcount = (NI)((NI)((*c).refcount & ((NI) -4)) | ((NI) 3));
		incl_48247((&gch_49859.cycleroots), c);
	}
	LA3: ;
}

static N_INLINE(void, incref_53819)(Cell47504* c) {
	(*c).refcount = (NI)((NU64)((*c).refcount) + (NU64)(((NI) 8)));
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = canbecycleroot_51458(c);
		if (!LOC3) goto LA4;
		rtladdcycleroot_52220(c);
	}
	LA4: ;
}

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

static N_INLINE(void, rtladdzct_53001)(Cell47504* c) {
	addzct_51417((&gch_49859.zct), c);
}

static N_INLINE(void, decref_53401)(Cell47504* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3;
		rtladdzct_53001(c);
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC6;
		LOC6 = 0;
		LOC6 = canbecycleroot_51458(c);
		if (!LOC6) goto LA7;
		rtladdcycleroot_52220(c);
	}
	goto LA1;
	LA7: ;
	LA1: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		Cell47504* LOC5;
		if (!!((src == NIM_NIL))) goto LA3;
		LOC5 = 0;
		LOC5 = usrtocell_51440(src);
		incref_53819(LOC5);
	}
	LA3: ;
	{
		Cell47504* LOC10;
		if (!!(((*dest) == NIM_NIL))) goto LA8;
		LOC10 = 0;
		LOC10 = usrtocell_51440((*dest));
		decref_53401(LOC10);
	}
	LA8: ;
	(*dest) = src;
}

N_NIMCALL(NIM_BOOL, mustrehash_222147)(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_226685)(Tidpairseq215838** data, Tidobj190006* 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_222151(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_222115)(Tidtable215840* t, Tidobj190006* key, TNimObject* val) {
	NI index;
	Tidpairseq215838* n;
	index = 0;
	n = 0;
	index = idtablerawget_226599((*t), (*key).id);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		asgnRef((void**) (&(*t).data->data[index].val), val);
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tidpairseq215838* LOC18;
			LOC8 = 0;
			LOC8 = mustrehash_222147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
			if (!LOC8) goto LA9;
			n = (Tidpairseq215838*) newSeq((&NTI215838), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_227238;
				NI HEX3Atmp_227424;
				NI res_227427;
				i_227238 = 0;
				HEX3Atmp_227424 = 0;
				HEX3Atmp_227424 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
				res_227427 = ((NI) 0);
				{
					while (1) {
						if (!(res_227427 <= HEX3Atmp_227424)) goto LA13;
						i_227238 = res_227427;
						{
							if (!!(((*t).data->data[i_227238].key == NIM_NIL))) goto LA16;
							idtablerawinsert_226685((&n), (*t).data->data[i_227238].key, (*t).data->data[i_227238].val);
						}
						LA16: ;
						res_227427 += ((NI) 1);
					} LA13: ;
				}
			}
			LOC18 = 0;
			LOC18 = (*t).data;
			unsureAsgnRef((void**) (&(*t).data), n);
			n = LOC18;
		}
		LA9: ;
		idtablerawinsert_226685((&(*t).data), key, val);
		(*t).counter += ((NI) 1);
	}
	LA1: ;
}

N_NIMCALL(Tsym215822*, lookupinrecord_222140)(Tnode215790* n, Tident190012* field) {
	Tsym215822* result;
{	result = 0;
	result = NIM_NIL;
	switch ((*n).kind) {
	case ((NU8) 138):
	{
		{
			NI i_222318;
			NI HEX3Atmp_222385;
			NI LOC3;
			NI res_222388;
			i_222318 = 0;
			HEX3Atmp_222385 = 0;
			LOC3 = 0;
			LOC3 = sonslen_218351(n);
			HEX3Atmp_222385 = (NI)(LOC3 - ((NI) 1));
			res_222388 = ((NI) 0);
			{
				while (1) {
					if (!(res_222388 <= HEX3Atmp_222385)) goto LA5;
					i_222318 = res_222388;
					result = lookupinrecord_222140((*n).kindU.S6.sons->data[i_222318], field);
					{
						if (!!((result == NIM_NIL))) goto LA8;
						goto BeforeRet;
					}
					LA8: ;
					res_222388 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 139):
	{
		{
			if (!!(((*(*n).kindU.S6.sons->data[((NI) 0)]).kind == ((NU8) 3)))) goto LA13;
			internalerror_188100((*n).info, ((NimStringDesc*) &TMP1136));
		}
		LA13: ;
		result = lookupinrecord_222140((*n).kindU.S6.sons->data[((NI) 0)], field);
		{
			if (!!((result == NIM_NIL))) goto LA17;
			goto BeforeRet;
		}
		LA17: ;
		{
			NI i_222366;
			NI HEX3Atmp_222393;
			NI LOC20;
			NI res_222396;
			i_222366 = 0;
			HEX3Atmp_222393 = 0;
			LOC20 = 0;
			LOC20 = sonslen_218351(n);
			HEX3Atmp_222393 = (NI)(LOC20 - ((NI) 1));
			res_222396 = ((NI) 1);
			{
				while (1) {
					if (!(res_222396 <= HEX3Atmp_222393)) goto LA22;
					i_222366 = res_222396;
					switch ((*(*n).kindU.S6.sons->data[i_222366]).kind) {
					case ((NU8) 85):
					case ((NU8) 88):
					{
						Tnode215790* LOC24;
						LOC24 = 0;
						LOC24 = lastson_218364((*n).kindU.S6.sons->data[i_222366]);
						result = lookupinrecord_222140(LOC24, field);
						{
							if (!!((result == NIM_NIL))) goto LA27;
							goto BeforeRet;
						}
						LA27: ;
					}
					break;
					default:
					{
						internalerror_188100((*n).info, ((NimStringDesc*) &TMP1137));
					}
					break;
					}
					res_222396 += ((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_188100((*n).info, ((NimStringDesc*) &TMP1138));
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tsym215822*, getsymfromlist_222135)(Tnode215790* list, Tident190012* ident, NI start) {
	Tsym215822* result;
{	result = 0;
	{
		NI i_222641;
		NI HEX3Atmp_222656;
		NI LOC2;
		NI res_222659;
		i_222641 = 0;
		HEX3Atmp_222656 = 0;
		LOC2 = 0;
		LOC2 = sonslen_218351(list);
		HEX3Atmp_222656 = (NI)(LOC2 - ((NI) 1));
		res_222659 = start;
		{
			while (1) {
				if (!(res_222659 <= HEX3Atmp_222656)) goto LA4;
				i_222641 = res_222659;
				{
					if (!((*(*list).kindU.S6.sons->data[i_222641]).kind == ((NU8) 3))) goto LA7;
					result = (*(*list).kindU.S6.sons->data[i_222641]).kindU.S4.sym;
					{
						if (!((*(*result).name).Sup.id == (*ident).Sup.id)) goto LA11;
						goto BeforeRet;
					}
					LA11: ;
				}
				goto LA5;
				LA7: ;
				{
					internalerror_188100((*list).info, ((NimStringDesc*) &TMP1143));
				}
				LA5: ;
				res_222659 += ((NI) 1);
			} LA4: ;
		}
	}
	result = NIM_NIL;
	}BeforeRet: ;
	return result;
}

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

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

N_NIMCALL(void, strtablerawinsert_225127)(Tsymseq215792** data, Tsym215822* n) {
	NI h;
{	h = (NI)((*(*n).name).h & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		if (!!((((*n).flags &(1U<<((NU)(((NU8) 25))&31U)))!=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_222151(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_222151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
			} LA13: ;
		}
		asgnRefNoCycle((void**) (&(*data)->data[h]), n);
		{
			Tsym215822* 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_225810)(Tstrtable215794* t) {
	Tsymseq215792* n;
	Tsymseq215792* LOC8;
	n = 0;
	n = (Tsymseq215792*) newSeq((&NTI215792), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
	{
		NI i_225844;
		NI HEX3Atmp_225870;
		NI res_225873;
		i_225844 = 0;
		HEX3Atmp_225870 = 0;
		HEX3Atmp_225870 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
		res_225873 = ((NI) 0);
		{
			while (1) {
				if (!(res_225873 <= HEX3Atmp_225870)) goto LA3;
				i_225844 = res_225873;
				{
					if (!!(((*t).data->data[i_225844] == NIM_NIL))) goto LA6;
					strtablerawinsert_225127((&n), (*t).data->data[i_225844]);
				}
				LA6: ;
				res_225873 += ((NI) 1);
			} LA3: ;
		}
	}
	LOC8 = 0;
	LOC8 = (*t).data;
	unsureAsgnRef((void**) (&(*t).data), n);
	n = LOC8;
}

N_NIMCALL(NIM_BOOL, strtableincl_226001)(Tstrtable215794* t, Tsym215822* 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) {
			Tsym215822* 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_225900((*(*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_222151(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_222147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
		if (!LOC22) goto LA23;
		strtableenlarge_225810(t);
		strtablerawinsert_225127((&(*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(void, strtableadd_222061)(Tstrtable215794* t, Tsym215822* n) {
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = mustrehash_222147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
		if (!LOC3) goto LA4;
		strtableenlarge_225810(t);
	}
	LA4: ;
	strtablerawinsert_225127((&(*t).data), n);
	(*t).counter += ((NI) 1);
}

N_NIMCALL(void, initiitable_222168)(Tiitable222163* x) {
	(*x).counter = ((NI) 0);
	unsureAsgnRef((void**) (&(*x).data), (Tiipairseq222161*) newSeq((&NTI222161), ((NI) 8)));
	{
		NI i_228154;
		NI res_228158;
		i_228154 = 0;
		res_228158 = ((NI) 0);
		{
			while (1) {
				if (!(res_228158 <= ((NI) 7))) goto LA3;
				i_228154 = res_228158;
				(*x).data->data[i_228154].key = ((NI) (IL64(-9223372036854775807) - IL64(1)));
				res_228158 += ((NI) 1);
			} LA3: ;
		}
	}
}

N_NIMCALL(void, iitablerawinsert_228176)(Tiipairseq222161** 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) (IL64(-9223372036854775807) - IL64(1)))))) goto LA2;
			h = nexttry_222151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	(*data)->data[h].key = key;
	(*data)->data[h].val = val;
}

N_NIMCALL(void, iitableput_222176)(Tiitable222163* t, NI key, NI val) {
	NI index;
	index = iitablerawget_228162((*t), key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		(*t).data->data[index].val = val;
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tiipairseq222161* n;
			Tiipairseq222161* LOC21;
			LOC8 = 0;
			LOC8 = mustrehash_222147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
			if (!LOC8) goto LA9;
			n = 0;
			n = (Tiipairseq222161*) newSeq((&NTI222161), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_228639;
				NI HEX3Atmp_228675;
				NI res_228678;
				i_228639 = 0;
				HEX3Atmp_228675 = 0;
				HEX3Atmp_228675 = (n ? (n->Sup.len-1) : -1);
				res_228678 = ((NI) 0);
				{
					while (1) {
						if (!(res_228678 <= HEX3Atmp_228675)) goto LA13;
						i_228639 = res_228678;
						n->data[i_228639].key = ((NI) (IL64(-9223372036854775807) - IL64(1)));
						res_228678 += ((NI) 1);
					} LA13: ;
				}
			}
			{
				NI i_228651;
				NI HEX3Atmp_228683;
				NI res_228686;
				i_228651 = 0;
				HEX3Atmp_228683 = 0;
				HEX3Atmp_228683 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
				res_228686 = ((NI) 0);
				{
					while (1) {
						if (!(res_228686 <= HEX3Atmp_228683)) goto LA16;
						i_228651 = res_228686;
						{
							if (!!(((*t).data->data[i_228651].key == ((NI) (IL64(-9223372036854775807) - IL64(1)))))) goto LA19;
							iitablerawinsert_228176((&n), (*t).data->data[i_228651].key, (*t).data->data[i_228651].val);
						}
						LA19: ;
						res_228686 += ((NI) 1);
					} LA16: ;
				}
			}
			LOC21 = 0;
			LOC21 = (*t).data;
			unsureAsgnRef((void**) (&(*t).data), n);
			n = LOC21;
		}
		LA9: ;
		iitablerawinsert_228176((&(*t).data), key, val);
		(*t).counter += ((NI) 1);
	}
	LA1: ;
}

N_NIMCALL(Tsym215822*, getmodule_222144)(Tsym215822* s) {
	Tsym215822* 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_222107)(Tidtable215840 t, Tidobj190006* key) {
	TNimObject* result;
	NI index;
	result = 0;
	index = idtablerawget_226599(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_222189)(Tnode215790* a, Tnode215790* 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(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_222233)(Tnode215790* a, Tnode215790* 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(NU8, weaklevalue_222277)(Tnode215790* a, Tnode215790* 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_222233(a, b);
			if (!LOC10) goto LA11;
			result = ((NU8) 2);
		}
		goto LA8;
		LA11: ;
		{
			result = ((NU8) 1);
		}
		LA8: ;
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym215822*, nextidentiter_222093)(Tidentiter222084* ti, Tstrtable215794 tab) {
	Tsym215822* 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_222151(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_222151(h, (tab.data ? (tab.data->Sup.len-1) : -1));
	return result;
}

N_NIMCALL(Tsym215822*, initidentiter_222087)(Tidentiter222084* ti, Tstrtable215794 tab, Tident190012* s) {
	Tsym215822* 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_222093(ti, tab);
	}
	LA1: ;
	return result;
}

N_NIMCALL(Tsym215822*, nextidentexcluding_226462)(Tidentiter222084* ti, Tstrtable215794 tab, Intset212035* excluding) {
	Tsym215822* 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_212811(excluding, (*result).Sup.id);
				LOC5 = !(LOC7);
				LA6: ;
				if (!LOC5) goto LA8;
				goto LA1;
			}
			LA8: ;
			h = nexttry_222151(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_222151(h, (tab.data ? (tab.data->Sup.len-1) : -1));
	{
		NIM_BOOL LOC16;
		LOC16 = 0;
		LOC16 = !((result == NIM_NIL));
		if (!(LOC16)) goto LA17;
		LOC16 = contains_212811(excluding, (*result).Sup.id);
		LA17: ;
		if (!LOC16) goto LA18;
		result = NIM_NIL;
	}
	LA18: ;
	return result;
}

N_NIMCALL(Tsym215822*, firstidentexcluding_226500)(Tidentiter222084* ti, Tstrtable215794 tab, Tident190012* s, Intset212035* excluding) {
	Tsym215822* 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_226462(ti, tab, excluding);
	}
	LA1: ;
	return result;
}

N_NIMCALL(NI, idnodetablerawget_227464)(Tidnodetable215846 t, Tidobj190006* 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_222151(h, (t.data ? (t.data->Sup.len-1) : -1));
		} LA2: ;
	}
	result = ((NI) -1);
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tnode215790*, idnodetableget_222125)(Tidnodetable215846 t, Tidobj190006* key) {
	Tnode215790* result;
	NI index;
	result = 0;
	index = 0;
	index = idnodetablerawget_227464(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_227504)(Tidnodepairseq215844** data, Tidobj190006* key, Tnode215790* 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_222151(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_222129)(Tidnodetable215846* t, Tidobj190006* key, Tnode215790* val) {
	NI index;
	index = idnodetablerawget_227464((*t), key);
	{
		if (!(((NI) 0) <= index)) goto LA3;
		asgnRefNoCycle((void**) (&(*t).data->data[index].val), val);
	}
	goto LA1;
	LA3: ;
	{
		{
			NIM_BOOL LOC8;
			Tidnodepairseq215844* n;
			Tidnodepairseq215844* LOC18;
			LOC8 = 0;
			LOC8 = mustrehash_222147(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
			if (!LOC8) goto LA9;
			n = 0;
			n = (Tidnodepairseq215844*) newSeq((&NTI215844), ((NI) ((NI)(((*t).data ? (*t).data->Sup.len : 0) * ((NI) 2)))));
			{
				NI i_228039;
				NI HEX3Atmp_228075;
				NI res_228078;
				i_228039 = 0;
				HEX3Atmp_228075 = 0;
				HEX3Atmp_228075 = ((*t).data ? ((*t).data->Sup.len-1) : -1);
				res_228078 = ((NI) 0);
				{
					while (1) {
						if (!(res_228078 <= HEX3Atmp_228075)) goto LA13;
						i_228039 = res_228078;
						{
							if (!!(((*t).data->data[i_228039].key == NIM_NIL))) goto LA16;
							idnodetablerawinsert_227504((&n), (*t).data->data[i_228039].key, (*t).data->data[i_228039].val);
						}
						LA16: ;
						res_228078 += ((NI) 1);
					} LA13: ;
				}
			}
			LOC18 = 0;
			LOC18 = (*t).data;
			unsureAsgnRef((void**) (&(*t).data), n);
			n = LOC18;
		}
		LA9: ;
		idnodetablerawinsert_227504((&(*t).data), key, val);
		(*t).counter += ((NI) 1);
	}
	LA1: ;
}

N_NIMCALL(Tnode215790*, skipconvandclosure_222182)(Tnode215790* n) {
	Tnode215790* 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_225414)(Tsymseq215792** data, Tsym215822* prevsym, Tsym215822* 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_222151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	}BeforeRet: ;
}

N_NIMCALL(void, symtabreplace_225803)(Tstrtable215794* t, Tsym215822* prevsym, Tsym215822* newsym) {
	symtabreplaceraw_225414((&(*t).data), prevsym, newsym);
}

N_NIMCALL(NIM_BOOL, idtablehasobjectaskey_222121)(Tidtable215840 t, Tidobj190006* key) {
	NIM_BOOL result;
	NI index;
	result = 0;
	index = idtablerawget_226599(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, compiler_astalgoInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, compiler_astalgoDatInit000)(void) {
static TNimNode* TMP908[2];
static TNimNode* TMP909[2];
static TNimNode TMP878[6];
NTI222163.size = sizeof(Tiitable222163);
NTI222163.kind = 18;
NTI222163.base = 0;
NTI222163.flags = 2;
TMP908[0] = &TMP878[1];
TMP878[1].kind = 1;
TMP878[1].offset = offsetof(Tiitable222163, counter);
TMP878[1].typ = (&NTI104);
TMP878[1].name = "counter";
TMP908[1] = &TMP878[2];
NTI222159.size = sizeof(Tiipair222159);
NTI222159.kind = 18;
NTI222159.base = 0;
NTI222159.flags = 3;
TMP909[0] = &TMP878[4];
TMP878[4].kind = 1;
TMP878[4].offset = offsetof(Tiipair222159, key);
TMP878[4].typ = (&NTI104);
TMP878[4].name = "key";
TMP909[1] = &TMP878[5];
TMP878[5].kind = 1;
TMP878[5].offset = offsetof(Tiipair222159, val);
TMP878[5].typ = (&NTI104);
TMP878[5].name = "val";
TMP878[3].len = 2; TMP878[3].kind = 2; TMP878[3].sons = &TMP909[0];
NTI222159.node = &TMP878[3];
NTI222161.size = sizeof(Tiipairseq222161*);
NTI222161.kind = 24;
NTI222161.base = (&NTI222159);
NTI222161.flags = 2;
NTI222161.marker = TMP910;
TMP878[2].kind = 1;
TMP878[2].offset = offsetof(Tiitable222163, data);
TMP878[2].typ = (&NTI222161);
TMP878[2].name = "data";
TMP878[0].len = 2; TMP878[0].kind = 2; TMP878[0].sons = &TMP908[0];
NTI222163.node = &TMP878[0];
}

