/* Generated by Nim Compiler v1.6.2 */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks

#include "nimbase.h"
#include <string.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_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw;
typedef struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw;
typedef struct tySequence__6H5Oh5UUvVCLiakt9aTwtUQ tySequence__6H5Oh5UUvVCLiakt9aTwtUQ;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_Int128__9a9axPfb75jdWY25AamJewkA tyObject_Int128__9a9axPfb75jdWY25AamJewkA;
typedef struct tyObject_TType__facALICuu8zUj0hjvbTLFg tyObject_TType__facALICuu8zUj0hjvbTLFg;
typedef struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q;
typedef struct NimStringDesc NimStringDesc;
typedef struct tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ;
typedef struct tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA;
typedef struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ;
typedef struct tyObject_TIdObj__KUwfjfUQEwGHguQbTcXu7w tyObject_TIdObj__KUwfjfUQEwGHguQbTcXu7w;
typedef struct RootObj RootObj;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_ItemId__ozxAxZLHTQ9c3akTzYvt67g tyObject_ItemId__ozxAxZLHTQ9c3akTzYvt67g;
typedef struct tySequence__9aZVGG5Gtti9cC9bqRpXCtA3A tySequence__9aZVGG5Gtti9cC9bqRpXCtA3A;
typedef struct tyObject_TLoc__EtHNvCB0bgfu9bFjzx9cb6aA tyObject_TLoc__EtHNvCB0bgfu9bFjzx9cb6aA;
typedef struct tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA;
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;
struct TGenericSeq {
NI len;
NI reserved;
};
typedef NU32 tyArray__FleBT9cC2nxhgiXmSYYnEKA[4];
struct tyObject_Int128__9a9axPfb75jdWY25AamJewkA {
tyArray__FleBT9cC2nxhgiXmSYYnEKA udata;
};
struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q {
NU16 line;
NI16 col;
NI32 fileIndex;
};
typedef NU32 tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg;
typedef NU8 tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw;
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw {
tyObject_TType__facALICuu8zUj0hjvbTLFg* typ;
tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info;
tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg flags;
tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind;
union{
struct {NI64 intVal;
} _kind_1;
struct {NF floatVal;
} _kind_2;
struct {NimStringDesc* strVal;
} _kind_3;
struct {tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* sym;
} _kind_4;
struct {tyObject_TIdent__1LTsGP7bSxg45u9aHcxh6OA* ident;
} _kind_5;
struct {tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ* sons;
} _kind_6;
};
};
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;
NI align;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
struct RootObj {
TNimType* m_type;
};
struct tyObject_ItemId__ozxAxZLHTQ9c3akTzYvt67g {
NI32 module;
NI32 item;
};
struct tyObject_TIdObj__KUwfjfUQEwGHguQbTcXu7w {
  RootObj Sup;
tyObject_ItemId__ozxAxZLHTQ9c3akTzYvt67g itemId;
};
typedef NU8 tyEnum_TTypeKind__9a3YiReNVD0IJHWFKgXRe9ag;
typedef NU8 tyEnum_TCallingConvention__yjAJ8w0h1PBaSwSGJ3P7IA;
typedef NU64 tySet_tyEnum_TTypeFlag__x2m5g1NpbmDig4wLT3Ylhw;
typedef NU8 tyEnum_TLocKind__O7PRFZKuiBBWbku09cayVBg;
typedef NU8 tyEnum_TStorageLoc__JK9cKMX3XnqHaUky9b6gkGEw;
typedef NU16 tySet_tyEnum_TLocFlag__o2bqJgR4ceIupnUSpxiudA;
struct tyObject_TLoc__EtHNvCB0bgfu9bFjzx9cb6aA {
tyEnum_TLocKind__O7PRFZKuiBBWbku09cayVBg k;
tyEnum_TStorageLoc__JK9cKMX3XnqHaUky9b6gkGEw storage;
tySet_tyEnum_TLocFlag__o2bqJgR4ceIupnUSpxiudA flags;
tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* lode;
tyObject_RopeObj__OFzf0kSiPTcNreUIeJgWVA* r;
};
struct tyObject_TType__facALICuu8zUj0hjvbTLFg {
  tyObject_TIdObj__KUwfjfUQEwGHguQbTcXu7w Sup;
tyEnum_TTypeKind__9a3YiReNVD0IJHWFKgXRe9ag kind;
tyEnum_TCallingConvention__yjAJ8w0h1PBaSwSGJ3P7IA callConv;
tySet_tyEnum_TTypeFlag__x2m5g1NpbmDig4wLT3Ylhw flags;
tySequence__9aZVGG5Gtti9cC9bqRpXCtA3A* sons;
tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n;
tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* owner;
tyObject_TSym__nnJKJFyjDGi5mnv8jwfTGQ* sym;
NI64 size;
NI16 align;
NI16 paddingAtEnd;
NI16 lockLevel;
tyObject_TLoc__EtHNvCB0bgfu9bFjzx9cb6aA loc;
tyObject_TType__facALICuu8zUj0hjvbTLFg* typeInst;
tyObject_ItemId__ozxAxZLHTQ9c3akTzYvt67g uniqueId;
};
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__SPr7N6UKfuF549bNPiUvSRw[256];
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__SPr7N6UKfuF549bNPiUvSRw 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 tySequence__6H5Oh5UUvVCLiakt9aTwtUQ {
  TGenericSeq Sup;
  NU8 data[SEQ_DECL_SIZE];
};
struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ {
  TGenericSeq Sup;
  tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* data[SEQ_DECL_SIZE];
};
struct tySequence__9aZVGG5Gtti9cC9bqRpXCtA3A {
  TGenericSeq Sup;
  tyObject_TType__facALICuu8zUj0hjvbTLFg* data[SEQ_DECL_SIZE];
};
N_LIB_PRIVATE N_NIMCALL(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ*, toBitSet__nimsets_103)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* s);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__9a9axPfb75jdWY25AamJewkA, firstOrd__types_1353)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TType__facALICuu8zUj0hjvbTLFg* t);
N_LIB_PRIVATE N_NIMCALL(void, bitSetInit__bitsets_10)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** b, NI length);
N_LIB_PRIVATE N_NIMCALL(NI64, getSize__types_3336)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TType__facALICuu8zUj0hjvbTLFg* typ);
static N_INLINE(NI, len__ast_3198)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__9a9axPfb75jdWY25AamJewkA, getOrdValue__types_161)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n, tyObject_Int128__9a9axPfb75jdWY25AamJewkA onError);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lteq___int495056_309)(tyObject_Int128__9a9axPfb75jdWY25AamJewkA a, tyObject_Int128__9a9axPfb75jdWY25AamJewkA b);
N_LIB_PRIVATE N_NIMCALL(void, bitSetIncl__bitsets_25)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** x, NI64 elem);
N_LIB_PRIVATE N_NIMCALL(NI64, toInt64__int495056_88)(tyObject_Int128__9a9axPfb75jdWY25AamJewkA arg);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__9a9axPfb75jdWY25AamJewkA, minus___int495056_474)(tyObject_Int128__9a9axPfb75jdWY25AamJewkA a, tyObject_Int128__9a9axPfb75jdWY25AamJewkA b);
N_LIB_PRIVATE N_NIMCALL(void, inc__int495056_251)(tyObject_Int128__9a9axPfb75jdWY25AamJewkA* a, NU32 y);
N_LIB_PRIVATE N_NIMCALL(NI64, bitSetCard__bitsets_40)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, bitSetContains__bitsets_37)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, bitSetEquals__bitsets_34)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y);
N_LIB_PRIVATE N_NIMCALL(void, bitSetIntersect__bitsets_22)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toTreeSet__nimsets_128)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* s, tyObject_TType__facALICuu8zUj0hjvbTLFg* settype, tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, newNodeI__ast_3356)(tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind, tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef__system_5338)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5300)(void* usr);
static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
static N_INLINE(void, decRef__system_5345)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__system_5343)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5294)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, bitSetIn__bitsets_31)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x, NI64 e);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, newIntTypeNode__ast_3783)(NI64 intVal, tyObject_TType__facALICuu8zUj0hjvbTLFg* typ);
N_LIB_PRIVATE N_NIMCALL(void, add__ast_4797)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* father, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* son);
N_LIB_PRIVATE N_NIMCALL(void, bitSetUnion__bitsets_13)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y);
N_LIB_PRIVATE N_NIMCALL(void, bitSetDiff__bitsets_16)(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ** x, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, leValue__astalgo_135)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* b);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, sameValue__astalgo_119)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* b);
extern NIM_CONST tyObject_Int128__9a9axPfb75jdWY25AamJewkA Max__int495056_27;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__system_5247;
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
	nimSetMem__systemZmemory_7(p, ((int) 0), size);
}
static N_INLINE(NI, len__ast_3198)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
	NI result;
	NI T1_;
	result = (NI)0;
	T1_ = ((*n)._kind_6.sons ? (*n)._kind_6.sons->Sup.len : 0);
	result = T1_;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tySequence__6H5Oh5UUvVCLiakt9aTwtUQ*, toBitSet__nimsets_103)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* s) {
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* result;
	tyObject_Int128__9a9axPfb75jdWY25AamJewkA first;
	tyObject_Int128__9a9axPfb75jdWY25AamJewkA j;
	NI64 T1_;
	result = NIM_NIL;
	nimZeroMem((void*)(&first), sizeof(tyObject_Int128__9a9axPfb75jdWY25AamJewkA));
	nimZeroMem((void*)(&j), sizeof(tyObject_Int128__9a9axPfb75jdWY25AamJewkA));
	first = firstOrd__types_1353(conf, (*(*s).typ).sons->data[((NI) 0)]);
	T1_ = (NI64)0;
	T1_ = getSize__types_3336(conf, (*s).typ);
	bitSetInit__bitsets_10((&result), ((NI) (T1_)));
	{
		NI i;
		NI colontmp_;
		NI i_2;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = len__ast_3198(s);
		i_2 = ((NI) 0);
		{
			while (1) {
				if (!(i_2 < colontmp_)) goto LA4;
				i = i_2;
				{
					if (!((*(*s)._kind_6.sons->data[i]).kind == ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 44))) goto LA7_;
					j = getOrdValue__types_161((*(*s)._kind_6.sons->data[i])._kind_6.sons->data[((NI) 0)], first);
					{
						while (1) {
							tyObject_Int128__9a9axPfb75jdWY25AamJewkA T11_;
							NIM_BOOL T12_;
							tyObject_Int128__9a9axPfb75jdWY25AamJewkA T13_;
							NI64 T14_;
							T11_ = getOrdValue__types_161((*(*s)._kind_6.sons->data[i])._kind_6.sons->data[((NI) 1)], first);
							T12_ = (NIM_BOOL)0;
							T12_ = lteq___int495056_309(j, T11_);
							if (!T12_) goto LA10;
							T13_ = minus___int495056_474(j, first);
							T14_ = (NI64)0;
							T14_ = toInt64__int495056_88(T13_);
							bitSetIncl__bitsets_25((&result), T14_);
							inc__int495056_251((&j), ((NU32) 1));
						} LA10: ;
					}
				}
				goto LA5_;
				LA7_: ;
				{
					tyObject_Int128__9a9axPfb75jdWY25AamJewkA T16_;
					tyObject_Int128__9a9axPfb75jdWY25AamJewkA T17_;
					NI64 T18_;
					T16_ = getOrdValue__types_161((*s)._kind_6.sons->data[i], Max__int495056_27);
					T17_ = minus___int495056_474(T16_, first);
					T18_ = (NI64)0;
					T18_ = toInt64__int495056_88(T17_);
					bitSetIncl__bitsets_25((&result), T18_);
				}
				LA5_: ;
				i_2 += ((NI) 1);
			} LA4: ;
		}
	}
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, cardSet__nimsets_241)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a) {
	NI64 result;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x;
	result = (NI64)0;
	x = toBitSet__nimsets_103(conf, a);
	result = bitSetCard__bitsets_40(x);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, containsSets__nimsets_209)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* b) {
	NIM_BOOL result;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y;
	result = (NIM_BOOL)0;
	x = toBitSet__nimsets_103(conf, a);
	y = toBitSet__nimsets_103(conf, b);
	result = bitSetContains__bitsets_37(x, y);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, equalSets__nimsets_216)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* b) {
	NIM_BOOL result;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y;
	result = (NIM_BOOL)0;
	x = toBitSet__nimsets_103(conf, a);
	y = toBitSet__nimsets_103(conf, b);
	result = bitSetEquals__bitsets_34(x, y);
	return result;
}
static N_INLINE(NI, pluspercent___system_696)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU64)(((NU) (x))) + (NU64)(((NU) (y))))));
	return result;
}
static N_INLINE(void, incRef__system_5338)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = pluspercent___system_696((*c).refcount, ((NI) 8));
}
static N_INLINE(NI, minuspercent___system_716)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
	return result;
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__system_5300)(void* usr) {
	tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
	NI T1_;
	result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
	T1_ = (NI)0;
	T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 16));
	result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
	return result;
}
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
	return result;
}
static N_INLINE(void, rtlAddZCT__system_5343)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	addZCT__system_5294((&gch__system_5247.zct), c);
}
static N_INLINE(void, decRef__system_5345)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = minuspercent___system_716((*c).refcount, ((NI) 8));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = ltpercent___system_1005((*c).refcount, ((NI) 8));
		if (!T3_) goto LA4_;
		rtlAddZCT__system_5343(c);
	}
	LA4_: ;
}
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__system_5300(src);
		incRef__system_5338(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T10_ = usrToCell__system_5300((*dest));
		decRef__system_5345(T10_);
	}
	LA8_: ;
	(*dest) = src;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toTreeSet__nimsets_128)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* s, tyObject_TType__facALICuu8zUj0hjvbTLFg* settype, tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	NI64 a;
	NI64 b;
	NI64 e;
	NI64 first;
	tyObject_TType__facALICuu8zUj0hjvbTLFg* elemType;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n;
	tyObject_Int128__9a9axPfb75jdWY25AamJewkA T1_;
	result = NIM_NIL;
	a = (NI64)0;
	b = (NI64)0;
	e = (NI64)0;
	first = (NI64)0;
	elemType = NIM_NIL;
	n = NIM_NIL;
	elemType = (*settype).sons->data[((NI) 0)];
	T1_ = firstOrd__types_1353(conf, elemType);
	first = toInt64__int495056_88(T1_);
	result = newNodeI__ast_3356(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 39), info);
	asgnRef((void**) (&(*result).typ), settype);
	(*result).info = info;
	e = IL64(0);
	{
		while (1) {
			NI T4_;
			T4_ = (s ? s->Sup.len : 0);
			if (!(e < ((NI64) ((NI)(T4_ * ((NI) 8)))))) goto LA3;
			{
				NIM_BOOL T7_;
				tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* aa;
				T7_ = (NIM_BOOL)0;
				T7_ = bitSetIn__bitsets_31(s, e);
				if (!T7_) goto LA8_;
				a = e;
				b = e;
				{
					while (1) {
						b += ((NI) 1);
						{
							NIM_BOOL T14_;
							NI T15_;
							NIM_BOOL T17_;
							T14_ = (NIM_BOOL)0;
							T15_ = (s ? s->Sup.len : 0);
							T14_ = (((NI64) ((NI)(T15_ * ((NI) 8)))) <= b);
							if (T14_) goto LA16_;
							T17_ = (NIM_BOOL)0;
							T17_ = bitSetIn__bitsets_31(s, b);
							T14_ = !(T17_);
							LA16_: ;
							if (!T14_) goto LA18_;
							goto LA10;
						}
						LA18_: ;
					}
				} LA10: ;
				b -= ((NI) 1);
				aa = newIntTypeNode__ast_3783((NI64)(a + first), elemType);
				(*aa).info = info;
				{
					if (!(a == b)) goto LA22_;
					add__ast_4797(result, aa);
				}
				goto LA20_;
				LA22_: ;
				{
					tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* bb;
					n = newNodeI__ast_3356(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 44), info);
					asgnRef((void**) (&(*n).typ), elemType);
					add__ast_4797(n, aa);
					bb = newIntTypeNode__ast_3783((NI64)(b + first), elemType);
					(*bb).info = info;
					add__ast_4797(n, bb);
					add__ast_4797(result, n);
				}
				LA20_: ;
				e = b;
			}
			LA8_: ;
			e += ((NI) 1);
		} LA3: ;
	}
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, intersectSets__nimsets_195)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* b) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y;
	result = NIM_NIL;
	x = toBitSet__nimsets_103(conf, a);
	y = toBitSet__nimsets_103(conf, b);
	bitSetIntersect__bitsets_22((&x), y);
	result = toTreeSet__nimsets_128(conf, x, (*a).typ, (*a).info);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, unionSets__nimsets_181)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* b) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y;
	result = NIM_NIL;
	x = toBitSet__nimsets_103(conf, a);
	y = toBitSet__nimsets_103(conf, b);
	bitSetUnion__bitsets_13((&x), y);
	result = toTreeSet__nimsets_128(conf, x, (*a).typ, (*a).info);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, diffSets__nimsets_188)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* b) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* y;
	result = NIM_NIL;
	x = toBitSet__nimsets_103(conf, a);
	y = toBitSet__nimsets_103(conf, b);
	bitSetDiff__bitsets_16((&x), y);
	result = toTreeSet__nimsets_128(conf, x, (*a).typ, (*a).info);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, inSet__nimsets_7)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* s, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* elem) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!!(((*s).kind == ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 39)))) goto LA3_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	LA3_: ;
	{
		NI i;
		NI colontmp_;
		NI i_2;
		i = (NI)0;
		colontmp_ = (NI)0;
		colontmp_ = len__ast_3198(s);
		i_2 = ((NI) 0);
		{
			while (1) {
				if (!(i_2 < colontmp_)) goto LA7;
				i = i_2;
				{
					if (!((*(*s)._kind_6.sons->data[i]).kind == ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 44))) goto LA10_;
					{
						NIM_BOOL T14_;
						T14_ = (NIM_BOOL)0;
						T14_ = leValue__astalgo_135((*(*s)._kind_6.sons->data[i])._kind_6.sons->data[((NI) 0)], elem);
						if (!(T14_)) goto LA15_;
						T14_ = leValue__astalgo_135(elem, (*(*s)._kind_6.sons->data[i])._kind_6.sons->data[((NI) 1)]);
						LA15_: ;
						if (!T14_) goto LA16_;
						result = NIM_TRUE;
						goto BeforeRet_;
					}
					LA16_: ;
				}
				goto LA8_;
				LA10_: ;
				{
					{
						NIM_BOOL T21_;
						T21_ = (NIM_BOOL)0;
						T21_ = sameValue__astalgo_119((*s)._kind_6.sons->data[i], elem);
						if (!T21_) goto LA22_;
						result = NIM_TRUE;
						goto BeforeRet_;
					}
					LA22_: ;
				}
				LA8_: ;
				i_2 += ((NI) 1);
			} LA7: ;
		}
	}
	result = NIM_FALSE;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, overlap__nimsets_40)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* b) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	{
		if (!((*a).kind == ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 44))) goto LA3_;
		{
			NIM_BOOL T9_;
			if (!((*b).kind == ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 44))) goto LA7_;
			T9_ = (NIM_BOOL)0;
			T9_ = leValue__astalgo_135((*a)._kind_6.sons->data[((NI) 0)], (*b)._kind_6.sons->data[((NI) 1)]);
			if (!(T9_)) goto LA10_;
			T9_ = leValue__astalgo_135((*b)._kind_6.sons->data[((NI) 0)], (*a)._kind_6.sons->data[((NI) 1)]);
			LA10_: ;
			result = T9_;
		}
		goto LA5_;
		LA7_: ;
		{
			NIM_BOOL T12_;
			T12_ = (NIM_BOOL)0;
			T12_ = leValue__astalgo_135((*a)._kind_6.sons->data[((NI) 0)], b);
			if (!(T12_)) goto LA13_;
			T12_ = leValue__astalgo_135(b, (*a)._kind_6.sons->data[((NI) 1)]);
			LA13_: ;
			result = T12_;
		}
		LA5_: ;
	}
	goto LA1_;
	LA3_: ;
	{
		{
			NIM_BOOL T19_;
			if (!((*b).kind == ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 44))) goto LA17_;
			T19_ = (NIM_BOOL)0;
			T19_ = leValue__astalgo_135((*b)._kind_6.sons->data[((NI) 0)], a);
			if (!(T19_)) goto LA20_;
			T19_ = leValue__astalgo_135(a, (*b)._kind_6.sons->data[((NI) 1)]);
			LA20_: ;
			result = T19_;
		}
		goto LA15_;
		LA17_: ;
		{
			result = sameValue__astalgo_119(a, b);
		}
		LA15_: ;
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, emptyRange__nimsets_273)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* b) {
	NIM_BOOL result;
	NIM_BOOL T1_;
	result = (NIM_BOOL)0;
	T1_ = (NIM_BOOL)0;
	T1_ = leValue__astalgo_135(a, b);
	result = !(T1_);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, deduplicate__nimsets_236)(tyObject_ConfigRefcolonObjectType___LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	tySequence__6H5Oh5UUvVCLiakt9aTwtUQ* x;
	result = NIM_NIL;
	x = toBitSet__nimsets_103(conf, a);
	result = toTreeSet__nimsets_128(conf, x, (*a).typ, (*a).info);
	return result;
}
