/* Generated by Nim Compiler v1.6.14 */
#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_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q tyObject_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q;
typedef struct tyTuple__KPVKrfx82Va9azSnb0dl1RQ tyTuple__KPVKrfx82Va9azSnb0dl1RQ;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA;
typedef struct tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g;
typedef struct TNimType TNimType;
typedef struct tyObject_CellSeq__nav876ELHgxScHhs30CKiA tyObject_CellSeq__nav876ELHgxScHhs30CKiA;
typedef struct tyObject_GcHeap__ZRn9bWCksoiGwT2drZZzyWQ tyObject_GcHeap__ZRn9bWCksoiGwT2drZZzyWQ;
typedef struct tyObject_GcStack__qFeGMKlnq6c9cTM2vPWycQQ tyObject_GcStack__qFeGMKlnq6c9cTM2vPWycQQ;
typedef struct tyObject_MemRegion__6QRscFDo4mEwbg9aL76vDGQ tyObject_MemRegion__6QRscFDo4mEwbg9aL76vDGQ;
typedef struct tyObject_SmallChunk__eUrTKmsk1Dqt5tm2WUT2Lw tyObject_SmallChunk__eUrTKmsk1Dqt5tm2WUT2Lw;
typedef struct tyObject_BigChunk__39bC3HTk2w4NGDjG74oNjmA tyObject_BigChunk__39bC3HTk2w4NGDjG74oNjmA;
typedef struct tyObject_LLChunk__Fjkr5Ya6Zl0UoUGxG047hA tyObject_LLChunk__Fjkr5Ya6Zl0UoUGxG047hA;
typedef struct tyObject_IntSet__WrQriiGmHk59cB1lNPtGo6A tyObject_IntSet__WrQriiGmHk59cB1lNPtGo6A;
typedef struct tyObject_Trunk__Ju1AURWHenTn3cJwAjbUhg tyObject_Trunk__Ju1AURWHenTn3cJwAjbUhg;
typedef struct tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw;
typedef struct tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw;
typedef struct tyTuple__p2vAp9cQ6YrpDq9cI3XzEDWA tyTuple__p2vAp9cQ6YrpDq9cI3XzEDWA;
typedef struct tyObject_GcStat__OG9ams3mtFJyICkjTOHbc9bg tyObject_GcStat__OG9ams3mtFJyICkjTOHbc9bg;
typedef struct tyObject_CellSet__A0mJvGLunfUxGkLUtesjdA tyObject_CellSet__A0mJvGLunfUxGkLUtesjdA;
typedef struct tyObject_PageDesc__N7tjEodqPVJaQ6oKQW8YfQ tyObject_PageDesc__N7tjEodqPVJaQ6oKQW8YfQ;
typedef struct TNimNode TNimNode;
typedef NU8 tyEnum_FootnoteType__jXnI8xEO3SXxVR9afYCJnyQ;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyTuple__KPVKrfx82Va9azSnb0dl1RQ {
tyEnum_FootnoteType__jXnI8xEO3SXxVR9afYCJnyQ Field0;
NI Field1;
NI Field2;
NI Field3;
NimStringDesc* Field4;
};
struct tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA {
tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA* next;
tyTuple__KPVKrfx82Va9azSnb0dl1RQ value;
};
struct tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack__qFeGMKlnq6c9cTM2vPWycQQ {
void* bottom;
};
struct tyObject_CellSeq__nav876ELHgxScHhs30CKiA {
NI len;
NI cap;
tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g** d;
};
typedef tyObject_SmallChunk__eUrTKmsk1Dqt5tm2WUT2Lw* tyArray__1eFxjkcKGHnofywkmCV8oQ[256];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__39bC3HTk2w4NGDjG74oNjmA* tyArray__KxTmKT9a3kTkdwYfqXhEYSw[32];
typedef tyArray__KxTmKT9a3kTkdwYfqXhEYSw tyArray__ATT5LBefmjy9bg8ApRmg3rw[24];
typedef tyObject_Trunk__Ju1AURWHenTn3cJwAjbUhg* tyArray__RxhBwkGQwTHLKhoK685Xfg[256];
struct tyObject_IntSet__WrQriiGmHk59cB1lNPtGo6A {
tyArray__RxhBwkGQwTHLKhoK685Xfg data;
};
typedef tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* tyArray__DrxDrI9bg9apB70ydOoNZrWw[2];
struct tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw {
tyArray__DrxDrI9bg9apB70ydOoNZrWw link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__p2vAp9cQ6YrpDq9cI3XzEDWA {
tyObject_BigChunk__39bC3HTk2w4NGDjG74oNjmA* Field0;
NI Field1;
};
typedef tyTuple__p2vAp9cQ6YrpDq9cI3XzEDWA tyArray__wsokuoa9bVBSU4gPLKbFaaw[30];
struct tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw {
NI len;
tyArray__wsokuoa9bVBSU4gPLKbFaaw chunks;
tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw* next;
};
struct tyObject_MemRegion__6QRscFDo4mEwbg9aL76vDGQ {
NI minLargeObj;
NI maxLargeObj;
tyArray__1eFxjkcKGHnofywkmCV8oQ freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__ATT5LBefmjy9bg8ApRmg3rw matrix;
tyObject_LLChunk__Fjkr5Ya6Zl0UoUGxG047hA* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__WrQriiGmHk59cB1lNPtGo6A chunkStarts;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* root;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* deleted;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* last;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__aGkK1t9a0WoXjpugXR6FWpw bottomData;
tyObject_HeapLinks__5IkCDh5QlsYpsfEMJf6zNw heapLinks;
};
struct tyObject_GcStat__OG9ams3mtFJyICkjTOHbc9bg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__A0mJvGLunfUxGkLUtesjdA {
NI counter;
NI max;
tyObject_PageDesc__N7tjEodqPVJaQ6oKQW8YfQ* head;
tyObject_PageDesc__N7tjEodqPVJaQ6oKQW8YfQ** data;
};
struct tyObject_GcHeap__ZRn9bWCksoiGwT2drZZzyWQ {
tyObject_GcStack__qFeGMKlnq6c9cTM2vPWycQQ stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__nav876ELHgxScHhs30CKiA zct;
tyObject_CellSeq__nav876ELHgxScHhs30CKiA decStack;
tyObject_CellSeq__nav876ELHgxScHhs30CKiA tempStack;
NI recGcLock;
tyObject_MemRegion__6QRscFDo4mEwbg9aL76vDGQ region;
tyObject_GcStat__OG9ams3mtFJyICkjTOHbc9bg stat;
tyObject_CellSet__A0mJvGLunfUxGkLUtesjdA marked;
tyObject_CellSeq__nav876ELHgxScHhs30CKiA additionalRoots;
NI gcThreadId;
};
struct tyObject_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q {
tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA* head;
tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA* tail;
};
typedef NU8 tyEnum_TNimKind__pspQAsqJLrw3jEKBD9bxmyQ;
typedef NU8 tySet_tyEnum_TNimTypeFlag__Yt5hq6z2IoHhKZrzIVrc1w;
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__pspQAsqJLrw3jEKBD9bxmyQ kind;
tySet_tyEnum_TNimTypeFlag__Yt5hq6z2IoHhKZrzIVrc1w flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__rrp49bl1h9aEkXfXp9bNg0yZw;
struct TNimNode {
tyEnum_TNimNodeKind__rrp49bl1h9aEkXfXp9bNg0yZw kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
static N_INLINE(void, add__packagesZdocutilsZrst_2886)(tyObject_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q* L, tyTuple__KPVKrfx82Va9azSnb0dl1RQ value);
static N_INLINE(void, add__packagesZdocutilsZrst_2975)(tyObject_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q* L, tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA* n);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef__system_5310)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
static N_INLINE(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*, usrToCell__system_5272)(void* usr);
static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
static N_INLINE(void, decRef__system_5317)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__system_5315)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5266)(tyObject_CellSeq__nav876ELHgxScHhs30CKiA* s, tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
N_LIB_PRIVATE N_NIMCALL(tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA*, newSinglyLinkedNode__packagesZdocutilsZrst_2894)(tyTuple__KPVKrfx82Va9azSnb0dl1RQ value);
N_LIB_PRIVATE N_NOINLINE(void*, newObj)(TNimType* typ, NI size);
N_LIB_PRIVATE N_NIMCALL(void, genericAssign)(void* dest, void* src, TNimType* mt);
extern TNimType NTIsinglylinkednode__gDEfmQjKC8B7ih9cWJmghxg_;
extern TNimType NTIfootnotesubst__KPVKrfx82Va9azSnb0dl1RQ_;
extern tyObject_GcHeap__ZRn9bWCksoiGwT2drZZzyWQ gch__system_5219;
N_LIB_PRIVATE N_NIMCALL(void, initSinglyLinkedList__packagesZdocutilsZrst_2784)(tyObject_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q* Result) {
	unsureAsgnRef((void**)&(*Result).head, NIM_NIL);
	unsureAsgnRef((void**)&(*Result).tail, NIM_NIL);
}
static N_INLINE(NI, pluspercent___system_696)(NI x, NI y) {
	NI result;
	result = (NI)0;
	result = ((NI) ((NU)((NU32)(((NU) (x))) + (NU32)(((NU) (y))))));
	return result;
}
static N_INLINE(void, incRef__system_5310)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* 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)((NU32)(((NU) (x))) - (NU32)(((NU) (y))))));
	return result;
}
static N_INLINE(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*, usrToCell__system_5272)(void* usr) {
	tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* result;
	NI T1_;
	result = (tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*)0;
	T1_ = (NI)0;
	T1_ = minuspercent___system_716(((NI) (ptrdiff_t) (usr)), ((NI) 8));
	result = ((tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*) (T1_));
	return result;
}
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = ((NU32)(((NU) (x))) < (NU32)(((NU) (y))));
	return result;
}
static N_INLINE(void, rtlAddZCT__system_5315)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c) {
	addZCT__system_5266((&gch__system_5219.zct), c);
}
static N_INLINE(void, decRef__system_5317)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* 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_5315(c);
	}
	LA4_: ;
}
static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* T5_;
		if (!!((src == NIM_NIL))) goto LA3_;
		T5_ = (tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*)0;
		T5_ = usrToCell__system_5272(src);
		incRef__system_5310(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*)0;
		T10_ = usrToCell__system_5272((*dest));
		decRef__system_5317(T10_);
	}
	LA8_: ;
	(*dest) = src;
}
static N_INLINE(void, add__packagesZdocutilsZrst_2975)(tyObject_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q* L, tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA* n) {
	asgnRef((void**) (&(*n).next), ((tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA*) NIM_NIL));
	{
		if (!!(((*L).tail == ((tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA*) NIM_NIL)))) goto LA3_;
		asgnRef((void**) (&(*(*L).tail).next), n);
	}
	LA3_: ;
	unsureAsgnRef((void**) (&(*L).tail), n);
	{
		if (!((*L).head == ((tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA*) NIM_NIL))) goto LA7_;
		unsureAsgnRef((void**) (&(*L).head), n);
	}
	LA7_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA*, newSinglyLinkedNode__packagesZdocutilsZrst_2894)(tyTuple__KPVKrfx82Va9azSnb0dl1RQ value) {
	tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA* result;
	result = NIM_NIL;
	result = (tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA*) newObj((&NTIsinglylinkednode__gDEfmQjKC8B7ih9cWJmghxg_), sizeof(tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA));
	genericAssign((void*)(&(*result).value), (void*)(&value), (&NTIfootnotesubst__KPVKrfx82Va9azSnb0dl1RQ_));
	return result;
}
static N_INLINE(void, add__packagesZdocutilsZrst_2886)(tyObject_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q* L, tyTuple__KPVKrfx82Va9azSnb0dl1RQ value) {
	tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA* T1_;
	T1_ = NIM_NIL;
	T1_ = newSinglyLinkedNode__packagesZdocutilsZrst_2894(value);
	add__packagesZdocutilsZrst_2975(L, T1_);
}
N_LIB_PRIVATE N_NIMCALL(void, append__packagesZdocutilsZrst_2811)(tyObject_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q* a, tyTuple__KPVKrfx82Va9azSnb0dl1RQ b) {
	add__packagesZdocutilsZrst_2886(a, b);
}
N_LIB_PRIVATE N_NIMCALL(tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA*, newSinglyLinkedNode__packagesZdocutilsZrst_3387)(tyTuple__KPVKrfx82Va9azSnb0dl1RQ value) {
	tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA* result;
	result = NIM_NIL;
	result = (tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA*) newObj((&NTIsinglylinkednode__gDEfmQjKC8B7ih9cWJmghxg_), sizeof(tyObject_SinglyLinkedNodeObj__dRlnkNHLLKxta2PiHXbXzA));
	genericAssign((void*)(&(*result).value), (void*)(&value), (&NTIfootnotesubst__KPVKrfx82Va9azSnb0dl1RQ_));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, append__packagesZdocutilsZrst_3456)(tyObject_SinglyLinkedList__g3P77tPvg1FlUlZH8ySw8Q* a, tyTuple__KPVKrfx82Va9azSnb0dl1RQ b) {
	add__packagesZdocutilsZrst_2886(a, b);
}
