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

#include "nimbase.h"
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
#define nimfr_(x, y)
#define nimln_(x, y)
typedef struct tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg;
typedef struct tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw;
typedef struct tyObject_TType_v9ae2Dpu13OW2ZJ2U9bNMd9cQ tyObject_TType_v9ae2Dpu13OW2ZJ2U9bNMd9cQ;
typedef struct tyObject_TLineInfo_WGx4rAexNXnczy1Avn646Q tyObject_TLineInfo_WGx4rAexNXnczy1Avn646Q;
typedef struct tyObject_TSym_JpsEh5i1AcKChGYbg7aV4w tyObject_TSym_JpsEh5i1AcKChGYbg7aV4w;
typedef struct tyObject_TIdent_GufRQq9c0miSybX3zBD4tyA tyObject_TIdent_GufRQq9c0miSybX3zBD4tyA;
typedef struct tySequence_ehmV9bTklH2Gt9cXHV9c0HLeQ tySequence_ehmV9bTklH2Gt9cXHV9c0HLeQ;
typedef struct tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack_7fytPA5bBsob6See21YMRA tyObject_GcStack_7fytPA5bBsob6See21YMRA;
typedef struct tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg;
typedef struct tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ;
typedef struct tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg;
typedef struct tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw;
typedef struct tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA;
typedef struct tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw;
typedef struct tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg;
typedef struct tyTuple_ujsjpB2O9cjj3uDHsXbnSzg tyTuple_ujsjpB2O9cjj3uDHsXbnSzg;
typedef struct tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg;
typedef struct tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ;
typedef struct tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg;
typedef struct tyTuple_9aIi6GdTSD27YtPkWxMqNxA tyTuple_9aIi6GdTSD27YtPkWxMqNxA;
struct tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg {
tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* root;
NI entries;
};
typedef NU8 tyEnum_TNimKind_jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc_ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc_WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
tyEnum_TNimKind_jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc_ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc_WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NimStringDesc* tyArray_9aijZrM1syqzleJpcL8bUyw[512];
typedef tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* tyArray_VznXOmL540VWlOp56dB9cqA[512];
typedef tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* tyArray_jSFVQ48g222vuMjoJArs8A[512];
struct tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g {
NI entries;
tyArray_9aijZrM1syqzleJpcL8bUyw keys;
NIM_BOOL isInternal;
union{
struct {tyArray_VznXOmL540VWlOp56dB9cqA vals;
};
struct {tyArray_jSFVQ48g222vuMjoJArs8A links;
};
};
};
typedef NU8 tyEnum_TNimNodeKind_unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind_unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct tyObject_TLineInfo_WGx4rAexNXnczy1Avn646Q {
NU16 line;
NI16 col;
NI32 fileIndex;
};
typedef NU32 tySet_tyEnum_TNodeFlag_jyh9acXHkhZANSSvPIY7ZLg;
typedef NU8 tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw;
struct tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw {
tyObject_TType_v9ae2Dpu13OW2ZJ2U9bNMd9cQ* typ;
tyObject_TLineInfo_WGx4rAexNXnczy1Avn646Q info;
tySet_tyEnum_TNodeFlag_jyh9acXHkhZANSSvPIY7ZLg flags;
tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw kind;
union{
struct {NI64 intVal;
};
struct {NF floatVal;
};
struct {NimStringDesc* strVal;
};
struct {tyObject_TSym_JpsEh5i1AcKChGYbg7aV4w* sym;
};
struct {tyObject_TIdent_GufRQq9c0miSybX3zBD4tyA* ident;
};
struct {tySequence_ehmV9bTklH2Gt9cXHV9c0HLeQ* sons;
};
};
NimStringDesc* comment;
};
struct tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack_7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ* tyArray_SiRwrEKZdLgxqz9a9aoVBglg[512];
typedef NU32 tyArray_BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg* tyArray_N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray_N1u1nqOgmuJN9cSZrnMHgOQ tyArray_B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw* tyArray_lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA {
tyArray_lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* tyArray_0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw {
tyArray_0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple_ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple_ujsjpB2O9cjj3uDHsXbnSzg tyArray_LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray_LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray_SiRwrEKZdLgxqz9a9aoVBglg freeSmallChunks;
NU32 flBitmap;
tyArray_BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray_B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack_7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
struct tyTuple_9aIi6GdTSD27YtPkWxMqNxA {
NimStringDesc* Field0;
tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* Field1;
NI Field2;
};
struct tySequence_ehmV9bTklH2Gt9cXHV9c0HLeQ {
  TGenericSeq Sup;
  tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tyRef_tPE9ckDbaXj82MdUy0JgA7w)(void* p, NI op);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, genericReset)(void* dest, TNimType* mt);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
static N_INLINE(NI, addInt)(NI a, NI b);
N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(NI, cmp_NAicU5bAGXmkx2NJujGi7g)(NimStringDesc* x, NimStringDesc* y);
N_NOINLINE(void, raiseIndexError2)(NI i, NI n);
N_NOINLINE(void, raiseFieldError)(NimStringDesc* f);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl_W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg);
N_LIB_PRIVATE N_NIMCALL(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*, insert_J9bkvsuQNLcr7jeLPdOelGQ)(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* h, NimStringDesc* key, tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* val);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(NI, subInt)(NI a, NI b);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef_AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr);
static N_INLINE(void, decRef_AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(void, rtlAddZCT_AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT_Y66tOYFjgwJ0k4aLz4bc0Q)(tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
N_LIB_PRIVATE N_NIMCALL(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*, split_yftxuAKQL15Q5Hq7NIaang)(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* h);
N_LIB_PRIVATE N_NIMCALL(void, copyHalf_QHbavwJ9cIUJ59b9aC42MHBDg)(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* h, tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* result);
N_LIB_PRIVATE N_NIMCALL(NI, countSubTree_9bmJBiJZIhY26taaMZrwXcw)(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* it);
TNimType NTI_VZdzO0Tlflp7WMN4gS8oPg_;
TNimType NTI_dNELmBSmY7nthjhZupWO6g_;
extern TNimType NTI_rR5Bzr1D5krxoo1NcNyeMA_;
extern TNimType NTI_77mFvmsOLKik79ci2hXkHEg_;
TNimType NTI_9aijZrM1syqzleJpcL8bUyw_;
extern TNimType NTI_VaVACK0bpYmqIQ0mKcHfQQ_;
extern TNimType NTI_fKfcLzXYiz5jNu3NH3Tv8Q_;
TNimType NTI_VznXOmL540VWlOp56dB9cqA_;
TNimType NTI_jSFVQ48g222vuMjoJArs8A_;
TNimType NTI_tPE9ckDbaXj82MdUy0JgA7w_;
extern tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ gch_IcYaEuuWivYAS86vFMTS3Q;
TNimNode* NimDT__dNELmBSmY7nthjhZupWO6g_isInternal[3];
STRING_LITERAL(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6, "links", 5);
STRING_LITERAL(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_8, "/Users/travis/build/nim-lang/nightlies/nim/e7471cebae2a404f3e42"
"39f199f5a0c422484aac/compiler/btrees.nim(55, 9) `not x.isInterna"
"l` ", 130);
STRING_LITERAL(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_12, "vals", 4);
STRING_LITERAL(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_36, "/Users/travis/build/nim-lang/nightlies/nim/e7471cebae2a404f3e42"
"39f199f5a0c422484aac/compiler/btrees.nim(44, 9) `not x.isInterna"
"l` ", 130);
static N_NIMCALL(void, Marker_tyRef_tPE9ckDbaXj82MdUy0JgA7w)(void* p, NI op) {
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* a;
	NI T1_;
	NI T2_;
	NI T3_;
	a = (tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*)p;
	T1_ = (NI)0;
	for (T1_ = 0; T1_ < 512; T1_++) {
	nimGCvisit((void*)(*a).keys[T1_], op);
	}
	switch ((*a).isInternal) {
	case NIM_FALSE:
	T2_ = (NI)0;
	for (T2_ = 0; T2_ < 512; T2_++) {
	nimGCvisit((void*)(*a).vals[T2_], op);
	}
	break;
	case NIM_TRUE:
	T3_ = (NI)0;
	for (T3_ = 0; T3_ < 512; T3_++) {
	nimGCvisit((void*)(*a).links[T3_], op);
	}
	break;
	} 
}

N_LIB_PRIVATE N_NIMCALL(void, initBTree_k5whnwDpZp6YeM19cX9ajL9aQ)(tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg* Result) {
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* T1_;
	chckNil((void*)Result);
	genericReset((void*)Result, (&NTI_VZdzO0Tlflp7WMN4gS8oPg_));
	T1_ = (tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*)0;
	T1_ = (tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*) newObj((&NTI_tPE9ckDbaXj82MdUy0JgA7w_), sizeof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g));
	(*T1_).entries = ((NI) 0);
	(*T1_).isInternal = NIM_FALSE;
	unsureAsgnRef((void**) (&(*Result).root), T1_);
}

static N_INLINE(NI, addInt)(NI a, NI b) {
	NI result;
{	result = (NI)0;
	result = (NI)((NU32)(a) + (NU32)(b));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(result ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(result ^ b));
		LA4_: ;
		if (!T3_) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	raiseOverflow();
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, contains_R2s6PEbDP9biCUJnpsKoeYw)(tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg b, NimStringDesc* key) {
	NIM_BOOL result;
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* x;
{	result = (NIM_BOOL)0;
	x = b.root;
	{
		while (1) {
			if (!(*x).isInternal) goto LA2;
			{
				NI j;
				NI colontmp_;
				NI i;
				j = (NI)0;
				colontmp_ = (NI)0;
				colontmp_ = (*x).entries;
				i = ((NI) 0);
				{
					while (1) {
						NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_7;
						if (!(i < colontmp_)) goto LA5;
						j = i;
						{
							NIM_BOOL T8_;
							NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_4;
							NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_5;
							NI T10_;
							T8_ = (NIM_BOOL)0;
							TM_XwGTJ9cLNTC3OG1qQV0hHqQ_4 = addInt(j, ((NI) 1));
							T8_ = ((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_4) == (*x).entries);
							if (T8_) goto LA9_;
							TM_XwGTJ9cLNTC3OG1qQV0hHqQ_5 = addInt(j, ((NI) 1));
							if ((NU)((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_5)) > (NU)(511)) raiseIndexError2((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_5), 511);
							T10_ = (NI)0;
							T10_ = cmp_NAicU5bAGXmkx2NJujGi7g(key, (*x).keys[((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_5))- 0]);
							T8_ = (T10_ < ((NI) 0));
							LA9_: ;
							if (!T8_) goto LA11_;
							if (!(((2 &(1U<<((NU)((*x).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
							if ((NU)(j) > (NU)(511)) raiseIndexError2(j, 511);
							x = (*x).links[(j)- 0];
							goto LA3;
						}
						LA11_: ;
						TM_XwGTJ9cLNTC3OG1qQV0hHqQ_7 = addInt(i, ((NI) 1));
						i = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_7);
					} LA5: ;
				}
			} LA3: ;
		} LA2: ;
	}
	{
		if (!!(!((*x).isInternal))) goto LA15_;
		failedAssertImpl_W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_8));
	}
	LA15_: ;
	{
		NI j_2;
		NI colontmp__2;
		NI i_2;
		j_2 = (NI)0;
		colontmp__2 = (NI)0;
		colontmp__2 = (*x).entries;
		i_2 = ((NI) 0);
		{
			while (1) {
				NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_9;
				if (!(i_2 < colontmp__2)) goto LA19;
				j_2 = i_2;
				{
					NI T22_;
					if ((NU)(j_2) > (NU)(511)) raiseIndexError2(j_2, 511);
					T22_ = (NI)0;
					T22_ = cmp_NAicU5bAGXmkx2NJujGi7g(key, (*x).keys[(j_2)- 0]);
					if (!(T22_ == ((NI) 0))) goto LA23_;
					result = NIM_TRUE;
					goto BeforeRet_;
				}
				LA23_: ;
				TM_XwGTJ9cLNTC3OG1qQV0hHqQ_9 = addInt(i_2, ((NI) 1));
				i_2 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_9);
			} LA19: ;
		}
	}
	result = NIM_FALSE;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

static N_INLINE(NI, subInt)(NI a, NI b) {
	NI result;
{	result = (NI)0;
	result = (NI)((NU32)(a) - (NU32)(b));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI) 0) <= (NI)(result ^ a));
		if (T3_) goto LA4_;
		T3_ = (((NI) 0) <= (NI)(result ^ (NI)((NU32) ~(b))));
		LA4_: ;
		if (!T3_) goto LA5_;
		goto BeforeRet_;
	}
	LA5_: ;
	raiseOverflow();
	}BeforeRet_: ;
	return result;
}

static N_INLINE(void, incRef_AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((NI) 8)));
}

static N_INLINE(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr) {
	tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* result;
	result = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
	result = ((tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU32)(((NI) (ptrdiff_t) (usr))) - (NU32)(((NI) 8)))));
	return result;
}

static N_INLINE(void, rtlAddZCT_AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
	addZCT_Y66tOYFjgwJ0k4aLz4bc0Q((&gch_IcYaEuuWivYAS86vFMTS3Q.zct), c);
}

static N_INLINE(void, decRef_AT1eRuflKWyTTBdLjEDZbgsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) - (NU32)(((NI) 8)));
	{
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3_;
		rtlAddZCT_AT1eRuflKWyTTBdLjEDZbg_2system(c);
	}
	LA3_: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* T5_;
		if (!!((src == NIM_NIL))) goto LA3_;
		T5_ = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T5_ = usrToCell_QFQqcLB3lgOdwipkv9a60xwsystem(src);
		incRef_AT1eRuflKWyTTBdLjEDZbg_3system(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T10_ = usrToCell_QFQqcLB3lgOdwipkv9a60xwsystem((*dest));
		decRef_AT1eRuflKWyTTBdLjEDZbgsystem(T10_);
	}
	LA8_: ;
	(*dest) = src;
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* T1_;
	T1_ = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
	T1_ = usrToCell_QFQqcLB3lgOdwipkv9a60xwsystem(p);
	decRef_AT1eRuflKWyTTBdLjEDZbgsystem(T1_);
}

N_LIB_PRIVATE N_NIMCALL(void, copyHalf_QHbavwJ9cIUJ59b9aC42MHBDg)(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* h, tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* result) {
	{
		NI j;
		NI i;
		j = (NI)0;
		i = ((NI) 0);
		{
			while (1) {
				NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_26;
				NimStringDesc* T4_;
				NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_27;
				if (!(i < ((NI) 256))) goto LA3;
				j = i;
				if ((NU)(j) > (NU)(511)) raiseIndexError2(j, 511);
				TM_XwGTJ9cLNTC3OG1qQV0hHqQ_26 = addInt(((NI) 256), j);
				if ((NU)((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_26)) > (NU)(511)) raiseIndexError2((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_26), 511);
				T4_ = (NimStringDesc*)0;
				T4_ = (*result).keys[(j)- 0]; (*result).keys[(j)- 0] = copyStringRC1((*h).keys[((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_26))- 0]);
				if (T4_) nimGCunrefNoCycle(T4_);
				TM_XwGTJ9cLNTC3OG1qQV0hHqQ_27 = addInt(i, ((NI) 1));
				i = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_27);
			} LA3: ;
		}
	}
	{
		if (!(*h).isInternal) goto LA7_;
		{
			NI j_2;
			NI i_2;
			j_2 = (NI)0;
			i_2 = ((NI) 0);
			{
				while (1) {
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_28;
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_29;
					if (!(i_2 < ((NI) 256))) goto LA11;
					j_2 = i_2;
					if (!(((2 &(1U<<((NU)((*result).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
					if ((NU)(j_2) > (NU)(511)) raiseIndexError2(j_2, 511);
					if (!(((2 &(1U<<((NU)((*h).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_28 = addInt(((NI) 256), j_2);
					if ((NU)((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_28)) > (NU)(511)) raiseIndexError2((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_28), 511);
					asgnRef((void**) (&(*result).links[(j_2)- 0]), (*h).links[((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_28))- 0]);
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_29 = addInt(i_2, ((NI) 1));
					i_2 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_29);
				} LA11: ;
			}
		}
	}
	goto LA5_;
	LA7_: ;
	{
		{
			NI j_3;
			NI i_3;
			j_3 = (NI)0;
			i_3 = ((NI) 0);
			{
				while (1) {
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_30;
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_31;
					if (!(i_3 < ((NI) 256))) goto LA15;
					j_3 = i_3;
					if (!(((1 &(1U<<((NU)((*result).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_12));
					if ((NU)(j_3) > (NU)(511)) raiseIndexError2(j_3, 511);
					if (!(((1 &(1U<<((NU)((*h).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_12));
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_30 = addInt(((NI) 256), j_3);
					if ((NU)((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_30)) > (NU)(511)) raiseIndexError2((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_30), 511);
					asgnRef((void**) (&(*result).vals[(j_3)- 0]), (*h).vals[((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_30))- 0]);
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_31 = addInt(i_3, ((NI) 1));
					i_3 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_31);
				} LA15: ;
			}
		}
	}
	LA5_: ;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*, split_yftxuAKQL15Q5Hq7NIaang)(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* h) {
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* result;
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* T1_;
	result = (tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*)0;
	T1_ = (tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*)0;
	T1_ = (tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*) newObj((&NTI_tPE9ckDbaXj82MdUy0JgA7w_), sizeof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g));
	(*T1_).entries = ((NI) 256);
	(*T1_).isInternal = (*h).isInternal;
	result = T1_;
	(*h).entries = ((NI) 256);
	copyHalf_QHbavwJ9cIUJ59b9aC42MHBDg(h, result);
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*, insert_J9bkvsuQNLcr7jeLPdOelGQ)(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* h, NimStringDesc* key, tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* val) {
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* result;
	NimStringDesc* newKey;
	NI j;
	NimStringDesc* T36_;
	NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_25;
{	result = (tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*)0;
	newKey = copyString(key);
	j = ((NI) 0);
	{
		if (!!((*h).isInternal)) goto LA3_;
		{
			while (1) {
				NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_10;
				if (!(j < (*h).entries)) goto LA6;
				{
					NI T9_;
					if ((NU)(j) > (NU)(511)) raiseIndexError2(j, 511);
					T9_ = (NI)0;
					T9_ = cmp_NAicU5bAGXmkx2NJujGi7g(key, (*h).keys[(j)- 0]);
					if (!(T9_ < ((NI) 0))) goto LA10_;
					goto LA5;
				}
				LA10_: ;
				TM_XwGTJ9cLNTC3OG1qQV0hHqQ_10 = addInt(j, ((NI) 1));
				j = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_10);
			} LA6: ;
		} LA5: ;
		{
			NI i;
			NI colontmp_;
			NI colontmp__2;
			NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_11;
			NI res;
			i = (NI)0;
			colontmp_ = (NI)0;
			colontmp__2 = (NI)0;
			colontmp_ = (*h).entries;
			TM_XwGTJ9cLNTC3OG1qQV0hHqQ_11 = addInt(j, ((NI) 1));
			colontmp__2 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_11);
			res = colontmp_;
			{
				while (1) {
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_13;
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_14;
					if (!(colontmp__2 <= res)) goto LA14;
					i = res;
					if (!(((1 &(1U<<((NU)((*h).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_12));
					if ((NU)(i) > (NU)(511)) raiseIndexError2(i, 511);
					if (!(((1 &(1U<<((NU)((*h).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_12));
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_13 = subInt(i, ((NI) 1));
					if ((NU)((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_13)) > (NU)(511)) raiseIndexError2((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_13), 511);
					asgnRef((void**) (&(*h).vals[(i)- 0]), (*h).vals[((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_13))- 0]);
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_14 = subInt(res, ((NI) 1));
					res = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_14);
				} LA14: ;
			}
		}
		if (!(((1 &(1U<<((NU)((*h).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_12));
		if ((NU)(j) > (NU)(511)) raiseIndexError2(j, 511);
		asgnRef((void**) (&(*h).vals[(j)- 0]), val);
	}
	goto LA1_;
	LA3_: ;
	{
		tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* newLink;
		newLink = NIM_NIL;
		{
			while (1) {
				NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_18;
				if (!(j < (*h).entries)) goto LA17;
				{
					NIM_BOOL T20_;
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_15;
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_16;
					NI T22_;
					tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* u;
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_17;
					T20_ = (NIM_BOOL)0;
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_15 = addInt(j, ((NI) 1));
					T20_ = ((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_15) == (*h).entries);
					if (T20_) goto LA21_;
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_16 = addInt(j, ((NI) 1));
					if ((NU)((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_16)) > (NU)(511)) raiseIndexError2((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_16), 511);
					T22_ = (NI)0;
					T22_ = cmp_NAicU5bAGXmkx2NJujGi7g(key, (*h).keys[((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_16))- 0]);
					T20_ = (T22_ < ((NI) 0));
					LA21_: ;
					if (!T20_) goto LA23_;
					if (!(((2 &(1U<<((NU)((*h).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
					if ((NU)(j) > (NU)(511)) raiseIndexError2(j, 511);
					u = insert_J9bkvsuQNLcr7jeLPdOelGQ((*h).links[(j)- 0], key, val);
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_17 = addInt(j, ((NI) 1));
					j = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_17);
					{
						if (!(u == NIM_NIL)) goto LA27_;
						result = NIM_NIL;
						goto BeforeRet_;
					}
					LA27_: ;
					newKey = copyString((*u).keys[(((NI) 0))- 0]);
					newLink = u;
					goto LA16;
				}
				LA23_: ;
				TM_XwGTJ9cLNTC3OG1qQV0hHqQ_18 = addInt(j, ((NI) 1));
				j = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_18);
			} LA17: ;
		} LA16: ;
		{
			NI i_2;
			NI colontmp__3;
			NI colontmp__4;
			NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_19;
			NI res_2;
			i_2 = (NI)0;
			colontmp__3 = (NI)0;
			colontmp__4 = (NI)0;
			colontmp__3 = (*h).entries;
			TM_XwGTJ9cLNTC3OG1qQV0hHqQ_19 = addInt(j, ((NI) 1));
			colontmp__4 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_19);
			res_2 = colontmp__3;
			{
				while (1) {
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_20;
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_21;
					if (!(colontmp__4 <= res_2)) goto LA31;
					i_2 = res_2;
					if (!(((2 &(1U<<((NU)((*h).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
					if ((NU)(i_2) > (NU)(511)) raiseIndexError2(i_2, 511);
					if (!(((2 &(1U<<((NU)((*h).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_20 = subInt(i_2, ((NI) 1));
					if ((NU)((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_20)) > (NU)(511)) raiseIndexError2((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_20), 511);
					asgnRef((void**) (&(*h).links[(i_2)- 0]), (*h).links[((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_20))- 0]);
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_21 = subInt(res_2, ((NI) 1));
					res_2 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_21);
				} LA31: ;
			}
		}
		if (!(((2 &(1U<<((NU)((*h).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
		if ((NU)(j) > (NU)(511)) raiseIndexError2(j, 511);
		asgnRef((void**) (&(*h).links[(j)- 0]), newLink);
	}
	LA1_: ;
	{
		NI i_3;
		NI colontmp__5;
		NI colontmp__6;
		NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_22;
		NI res_3;
		i_3 = (NI)0;
		colontmp__5 = (NI)0;
		colontmp__6 = (NI)0;
		colontmp__5 = (*h).entries;
		TM_XwGTJ9cLNTC3OG1qQV0hHqQ_22 = addInt(j, ((NI) 1));
		colontmp__6 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_22);
		res_3 = colontmp__5;
		{
			while (1) {
				NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_23;
				NimStringDesc* T35_;
				NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_24;
				if (!(colontmp__6 <= res_3)) goto LA34;
				i_3 = res_3;
				if ((NU)(i_3) > (NU)(511)) raiseIndexError2(i_3, 511);
				TM_XwGTJ9cLNTC3OG1qQV0hHqQ_23 = subInt(i_3, ((NI) 1));
				if ((NU)((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_23)) > (NU)(511)) raiseIndexError2((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_23), 511);
				T35_ = (NimStringDesc*)0;
				T35_ = (*h).keys[(i_3)- 0]; (*h).keys[(i_3)- 0] = copyStringRC1((*h).keys[((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_23))- 0]);
				if (T35_) nimGCunrefNoCycle(T35_);
				TM_XwGTJ9cLNTC3OG1qQV0hHqQ_24 = subInt(res_3, ((NI) 1));
				res_3 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_24);
			} LA34: ;
		}
	}
	if ((NU)(j) > (NU)(511)) raiseIndexError2(j, 511);
	T36_ = (NimStringDesc*)0;
	T36_ = (*h).keys[(j)- 0]; (*h).keys[(j)- 0] = copyStringRC1(newKey);
	if (T36_) nimGCunrefNoCycle(T36_);
	TM_XwGTJ9cLNTC3OG1qQV0hHqQ_25 = addInt((*h).entries, ((NI) 1));
	(*h).entries = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_25);
	{
		if (!((*h).entries < ((NI) 512))) goto LA39_;
		result = NIM_NIL;
	}
	goto LA37_;
	LA39_: ;
	{
		result = split_yftxuAKQL15Q5Hq7NIaang(h);
	}
	LA37_: ;
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(void, add_oXWfa5DZ9ar9aQWG8k6z5P6Q)(tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg* b, NimStringDesc* key, tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* val) {
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* u;
	NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_32;
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* t;
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* T5_;
	NimStringDesc* T6_;
	NimStringDesc* T7_;
{	u = insert_J9bkvsuQNLcr7jeLPdOelGQ((*b).root, key, val);
	TM_XwGTJ9cLNTC3OG1qQV0hHqQ_32 = addInt((*b).entries, ((NI) 1));
	(*b).entries = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_32);
	{
		if (!(u == NIM_NIL)) goto LA3_;
		goto BeforeRet_;
	}
	LA3_: ;
	T5_ = (tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*)0;
	T5_ = (tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*) newObj((&NTI_tPE9ckDbaXj82MdUy0JgA7w_), sizeof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g));
	(*T5_).entries = ((NI) 2);
	(*T5_).isInternal = NIM_TRUE;
	t = T5_;
	T6_ = (NimStringDesc*)0;
	T6_ = (*t).keys[(((NI) 0))- 0]; (*t).keys[(((NI) 0))- 0] = copyStringRC1((*(*b).root).keys[(((NI) 0))- 0]);
	if (T6_) nimGCunrefNoCycle(T6_);
	if (!(((2 &(1U<<((NU)((*t).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
	asgnRef((void**) (&(*t).links[(((NI) 0))- 0]), (*b).root);
	T7_ = (NimStringDesc*)0;
	T7_ = (*t).keys[(((NI) 1))- 0]; (*t).keys[(((NI) 1))- 0] = copyStringRC1((*u).keys[(((NI) 0))- 0]);
	if (T7_) nimGCunrefNoCycle(T7_);
	if (!(((2 &(1U<<((NU)((*t).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
	asgnRef((void**) (&(*t).links[(((NI) 1))- 0]), u);
	unsureAsgnRef((void**) (&(*b).root), t);
	}BeforeRet_: ;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw*, getOrDefault_N7mBvvE4jWcEmzBA3UoB0A)(tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg b, NimStringDesc* key) {
	tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* result;
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* x;
{	result = (tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw*)0;
	x = b.root;
	{
		while (1) {
			if (!(*x).isInternal) goto LA2;
			{
				NI j;
				NI colontmp_;
				NI i;
				j = (NI)0;
				colontmp_ = (NI)0;
				colontmp_ = (*x).entries;
				i = ((NI) 0);
				{
					while (1) {
						NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_35;
						if (!(i < colontmp_)) goto LA5;
						j = i;
						{
							NIM_BOOL T8_;
							NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_33;
							NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_34;
							NI T10_;
							T8_ = (NIM_BOOL)0;
							TM_XwGTJ9cLNTC3OG1qQV0hHqQ_33 = addInt(j, ((NI) 1));
							T8_ = ((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_33) == (*x).entries);
							if (T8_) goto LA9_;
							TM_XwGTJ9cLNTC3OG1qQV0hHqQ_34 = addInt(j, ((NI) 1));
							if ((NU)((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_34)) > (NU)(511)) raiseIndexError2((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_34), 511);
							T10_ = (NI)0;
							T10_ = cmp_NAicU5bAGXmkx2NJujGi7g(key, (*x).keys[((NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_34))- 0]);
							T8_ = (T10_ < ((NI) 0));
							LA9_: ;
							if (!T8_) goto LA11_;
							if (!(((2 &(1U<<((NU)((*x).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
							if ((NU)(j) > (NU)(511)) raiseIndexError2(j, 511);
							x = (*x).links[(j)- 0];
							goto LA3;
						}
						LA11_: ;
						TM_XwGTJ9cLNTC3OG1qQV0hHqQ_35 = addInt(i, ((NI) 1));
						i = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_35);
					} LA5: ;
				}
			} LA3: ;
		} LA2: ;
	}
	{
		if (!!(!((*x).isInternal))) goto LA15_;
		failedAssertImpl_W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_36));
	}
	LA15_: ;
	{
		NI j_2;
		NI colontmp__2;
		NI i_2;
		j_2 = (NI)0;
		colontmp__2 = (NI)0;
		colontmp__2 = (*x).entries;
		i_2 = ((NI) 0);
		{
			while (1) {
				NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_37;
				if (!(i_2 < colontmp__2)) goto LA19;
				j_2 = i_2;
				{
					NI T22_;
					if ((NU)(j_2) > (NU)(511)) raiseIndexError2(j_2, 511);
					T22_ = (NI)0;
					T22_ = cmp_NAicU5bAGXmkx2NJujGi7g(key, (*x).keys[(j_2)- 0]);
					if (!(T22_ == ((NI) 0))) goto LA23_;
					if (!(((1 &(1U<<((NU)((*x).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_12));
					if ((NU)(j_2) > (NU)(511)) raiseIndexError2(j_2, 511);
					result = (*x).vals[(j_2)- 0];
					goto BeforeRet_;
				}
				LA23_: ;
				TM_XwGTJ9cLNTC3OG1qQV0hHqQ_37 = addInt(i_2, ((NI) 1));
				i_2 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_37);
			} LA19: ;
		}
	}
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasNext_4Wt9aVmAb9agcjxA5gGDTJQw)(tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg b, NI index) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = (index < b.entries);
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NI, countSubTree_9bmJBiJZIhY26taaMZrwXcw)(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* it) {
	NI result;
	result = (NI)0;
	{
		if (!(*it).isInternal) goto LA3_;
		result = ((NI) 0);
		{
			NI k;
			NI colontmp_;
			NI i;
			k = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = (*it).entries;
			i = ((NI) 0);
			{
				while (1) {
					NI T8_;
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_38;
					NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_39;
					if (!(i < colontmp_)) goto LA7;
					k = i;
					if (!(((2 &(1U<<((NU)((*it).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
					if ((NU)(k) > (NU)(511)) raiseIndexError2(k, 511);
					T8_ = (NI)0;
					T8_ = countSubTree_9bmJBiJZIhY26taaMZrwXcw((*it).links[(k)- 0]);
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_38 = addInt(result, T8_);
					result = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_38);
					TM_XwGTJ9cLNTC3OG1qQV0hHqQ_39 = addInt(i, ((NI) 1));
					i = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_39);
				} LA7: ;
			}
		}
	}
	goto LA1_;
	LA3_: ;
	{
		result = (*it).entries;
	}
	LA1_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(void, next_CqTK9bD6dhLiHbJZ5GMdxDQ)(tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg b, NI index, tyTuple_9aIi6GdTSD27YtPkWxMqNxA* Result) {
	tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g* it;
	NI i;
	NimStringDesc* colontmp__2;
	tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* colontmp__3;
	NI colontmp__4;
	NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_44;
	it = b.root;
	i = index;
	{
		while (1) {
			NI sum;
			if (!(*it).isInternal) goto LA2;
			sum = ((NI) 0);
			{
				NI k;
				NI colontmp_;
				NI i_2;
				k = (NI)0;
				colontmp_ = (NI)0;
				colontmp_ = (*it).entries;
				i_2 = ((NI) 0);
				{
					while (1) {
						NI c;
						NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_40;
						NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_43;
						if (!(i_2 < colontmp_)) goto LA5;
						k = i_2;
						if (!(((2 &(1U<<((NU)((*it).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
						if ((NU)(k) > (NU)(511)) raiseIndexError2(k, 511);
						c = countSubTree_9bmJBiJZIhY26taaMZrwXcw((*it).links[(k)- 0]);
						TM_XwGTJ9cLNTC3OG1qQV0hHqQ_40 = addInt(sum, c);
						sum = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_40);
						{
							NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_41;
							NI TM_XwGTJ9cLNTC3OG1qQV0hHqQ_42;
							if (!(i < sum)) goto LA8_;
							if (!(((2 &(1U<<((NU)((*it).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_6));
							if ((NU)(k) > (NU)(511)) raiseIndexError2(k, 511);
							it = (*it).links[(k)- 0];
							TM_XwGTJ9cLNTC3OG1qQV0hHqQ_41 = subInt(sum, c);
							TM_XwGTJ9cLNTC3OG1qQV0hHqQ_42 = subInt(i, (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_41));
							i = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_42);
							goto LA3;
						}
						LA8_: ;
						TM_XwGTJ9cLNTC3OG1qQV0hHqQ_43 = addInt(i_2, ((NI) 1));
						i_2 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_43);
					} LA5: ;
				}
			} LA3: ;
		} LA2: ;
	}
	if ((NU)(i) > (NU)(511)) raiseIndexError2(i, 511);
	colontmp__2 = copyString((*it).keys[(i)- 0]);
	if (!(((1 &(1U<<((NU)((*it).isInternal)&7U)))!=0))) raiseFieldError(((NimStringDesc*) &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_12));
	if ((NU)(i) > (NU)(511)) raiseIndexError2(i, 511);
	colontmp__3 = (*it).vals[(i)- 0];
	TM_XwGTJ9cLNTC3OG1qQV0hHqQ_44 = addInt(index, ((NI) 1));
	colontmp__4 = (NI)(TM_XwGTJ9cLNTC3OG1qQV0hHqQ_44);
	unsureAsgnRef((void**) (&(*Result).Field0), copyString(colontmp__2));
	unsureAsgnRef((void**) (&(*Result).Field1), colontmp__3);
	(*Result).Field2 = colontmp__4;
}
N_LIB_PRIVATE N_NIMCALL(void, compiler_btreesDatInit000)(void) {
static TNimNode* TM_XwGTJ9cLNTC3OG1qQV0hHqQ_2_2[2];
static TNimNode* TM_XwGTJ9cLNTC3OG1qQV0hHqQ_3_3[3];
static TNimNode TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[9];
NTI_VZdzO0Tlflp7WMN4gS8oPg_.size = sizeof(tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg);
NTI_VZdzO0Tlflp7WMN4gS8oPg_.kind = 18;
NTI_VZdzO0Tlflp7WMN4gS8oPg_.base = 0;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_2_2[0] = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[1];
NTI_dNELmBSmY7nthjhZupWO6g_.size = sizeof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g);
NTI_dNELmBSmY7nthjhZupWO6g_.kind = 18;
NTI_dNELmBSmY7nthjhZupWO6g_.base = 0;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_3_3[0] = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[3];
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[3].kind = 1;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[3].offset = offsetof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g, entries);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[3].typ = (&NTI_rR5Bzr1D5krxoo1NcNyeMA_);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[3].name = "entries";
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_3_3[1] = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[4];
NTI_9aijZrM1syqzleJpcL8bUyw_.size = sizeof(tyArray_9aijZrM1syqzleJpcL8bUyw);
NTI_9aijZrM1syqzleJpcL8bUyw_.kind = 16;
NTI_9aijZrM1syqzleJpcL8bUyw_.base = (&NTI_77mFvmsOLKik79ci2hXkHEg_);
NTI_9aijZrM1syqzleJpcL8bUyw_.flags = 2;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[4].kind = 1;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[4].offset = offsetof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g, keys);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[4].typ = (&NTI_9aijZrM1syqzleJpcL8bUyw_);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[4].name = "keys";
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_3_3[2] = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[5];
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[5].kind = 3;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[5].offset = offsetof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g, isInternal);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[5].typ = (&NTI_VaVACK0bpYmqIQ0mKcHfQQ_);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[5].name = "isInternal";
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[5].sons = &NimDT__dNELmBSmY7nthjhZupWO6g_isInternal[0];
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[5].len = 2;
NTI_VznXOmL540VWlOp56dB9cqA_.size = sizeof(tyArray_VznXOmL540VWlOp56dB9cqA);
NTI_VznXOmL540VWlOp56dB9cqA_.kind = 16;
NTI_VznXOmL540VWlOp56dB9cqA_.base = (&NTI_fKfcLzXYiz5jNu3NH3Tv8Q_);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[6].kind = 1;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[6].offset = offsetof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g, vals);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[6].typ = (&NTI_VznXOmL540VWlOp56dB9cqA_);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[6].name = "vals";
NimDT__dNELmBSmY7nthjhZupWO6g_isInternal[0] = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[6];
NTI_jSFVQ48g222vuMjoJArs8A_.size = sizeof(tyArray_jSFVQ48g222vuMjoJArs8A);
NTI_jSFVQ48g222vuMjoJArs8A_.kind = 16;
NTI_jSFVQ48g222vuMjoJArs8A_.base = (&NTI_tPE9ckDbaXj82MdUy0JgA7w_);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[7].kind = 1;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[7].offset = offsetof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g, links);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[7].typ = (&NTI_jSFVQ48g222vuMjoJArs8A_);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[7].name = "links";
NimDT__dNELmBSmY7nthjhZupWO6g_isInternal[1] = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[7];
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[2].len = 3; TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[2].kind = 2; TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[2].sons = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_3_3[0];
NTI_dNELmBSmY7nthjhZupWO6g_.node = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[2];
NTI_tPE9ckDbaXj82MdUy0JgA7w_.size = sizeof(tyObject_NodecolonObjectType__dNELmBSmY7nthjhZupWO6g*);
NTI_tPE9ckDbaXj82MdUy0JgA7w_.kind = 22;
NTI_tPE9ckDbaXj82MdUy0JgA7w_.base = (&NTI_dNELmBSmY7nthjhZupWO6g_);
NTI_tPE9ckDbaXj82MdUy0JgA7w_.marker = Marker_tyRef_tPE9ckDbaXj82MdUy0JgA7w;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[1].kind = 1;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[1].offset = offsetof(tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg, root);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[1].typ = (&NTI_tPE9ckDbaXj82MdUy0JgA7w_);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[1].name = "root";
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_2_2[1] = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[8];
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[8].kind = 1;
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[8].offset = offsetof(tyObject_BTree_VZdzO0Tlflp7WMN4gS8oPg, entries);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[8].typ = (&NTI_rR5Bzr1D5krxoo1NcNyeMA_);
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[8].name = "entries";
TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[0].len = 2; TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[0].kind = 2; TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[0].sons = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_2_2[0];
NTI_VZdzO0Tlflp7WMN4gS8oPg_.node = &TM_XwGTJ9cLNTC3OG1qQV0hHqQ_0[0];
}

