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

#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 NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_ValueError__5lcTdgqMq62cNGRwBb0thA tyObject_ValueError__5lcTdgqMq62cNGRwBb0thA;
typedef struct tyObject_CatchableError__8K3kdpxrBD9aI27J0kpSCpQ tyObject_CatchableError__8K3kdpxrBD9aI27J0kpSCpQ;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tySequence__QbmGqFaLnb1IWWToREeaIA tySequence__QbmGqFaLnb1IWWToREeaIA;
typedef struct tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g;
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 tyObject_StackTraceEntry__3r2E7OgmrW3VdUTaooCuyA tyObject_StackTraceEntry__3r2E7OgmrW3VdUTaooCuyA;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
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;
};
struct RootObj {
TNimType* m_type;
};
struct Exception {
  RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
tySequence__QbmGqFaLnb1IWWToREeaIA* trace;
Exception* up;
};
struct tyObject_CatchableError__8K3kdpxrBD9aI27J0kpSCpQ {
  Exception Sup;
};
struct tyObject_ValueError__5lcTdgqMq62cNGRwBb0thA {
  tyObject_CatchableError__8K3kdpxrBD9aI27J0kpSCpQ Sup;
};
typedef NU8 tyEnum_TNimNodeKind__rrp49bl1h9aEkXfXp9bNg0yZw;
struct TNimNode {
tyEnum_TNimNodeKind__rrp49bl1h9aEkXfXp9bNg0yZw kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
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_StackTraceEntry__3r2E7OgmrW3VdUTaooCuyA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
struct tySequence__QbmGqFaLnb1IWWToREeaIA {
  TGenericSeq Sup;
  tyObject_StackTraceEntry__3r2E7OgmrW3VdUTaooCuyA data[SEQ_DECL_SIZE];
};
N_LIB_PRIVATE N_NIMCALL(NI, npuParseBiggestInt)(NimStringDesc* s, NI64* number, NI start);
N_LIB_PRIVATE N_NIMCALL(NI, rawParseInt__pureZparseutils_268)(NimStringDesc* s, NI64* b, NI start);
N_LIB_PRIVATE N_NOINLINE(void, integerOutOfRangeError__pureZparseutils_248)(void);
N_LIB_PRIVATE N_NOINLINE(void*, newObj)(TNimType* typ, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, decRef__system_5347)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
static N_INLINE(NI, minuspercent___system_716)(NI x, NI y);
static N_INLINE(NIM_BOOL, ltpercent___system_1005)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__system_5345)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_5296)(tyObject_CellSeq__nav876ELHgxScHhs30CKiA* s, tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
static N_INLINE(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*, usrToCell__system_5302)(void* usr);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef__system_5340)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c);
static N_INLINE(NI, pluspercent___system_696)(NI x, NI y);
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
N_NIMCALL(NI, nimParseBiggestFloat)(NimStringDesc* s, NF* number, NI start);
N_LIB_PRIVATE N_NIMCALL(NI, rawParseUInt__pureZparseutils_367)(NimStringDesc* s, NU64* b, NI start);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, substr__system_7774)(NimStringDesc* s, NI first, NI last);
extern TNimType NTIrefvalueerror__MdotPfdEWddcwl4HcVVgeQ_;
extern TNimType NTIvalueerror__5lcTdgqMq62cNGRwBb0thA_;
STRING_LITERAL(TM__vI9aZNKIcImom6dDyKXW1ZA_2, "Parsed integer outside of valid range", 37);
extern tyObject_GcHeap__ZRn9bWCksoiGwT2drZZzyWQ gch__system_5249;
N_LIB_PRIVATE N_NIMCALL(NI, parseSaturatedNatural__pureZparseutils_326)(NimStringDesc* s, NI* b, NI start) {
	NI result;
	NI i;
	result = (NI)0;
	i = start;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (i < (s ? s->Sup.len : 0));
		if (!(T3_)) goto LA4_;
		T3_ = ((NU8)(s->data[i]) == (NU8)(43));
		LA4_: ;
		if (!T3_) goto LA5_;
		i += ((NI) 1);
	}
	LA5_: ;
	{
		NIM_BOOL T9_;
		T9_ = (NIM_BOOL)0;
		T9_ = (i < (s ? s->Sup.len : 0));
		if (!(T9_)) goto LA10_;
		T9_ = (((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)));
		LA10_: ;
		if (!T9_) goto LA11_;
		(*b) = ((NI) 0);
		{
			while (1) {
				NIM_BOOL T15_;
				NI c;
				T15_ = (NIM_BOOL)0;
				T15_ = (i < (s ? s->Sup.len : 0));
				if (!(T15_)) goto LA16_;
				T15_ = (((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)));
				LA16_: ;
				if (!T15_) goto LA14;
				c = (NI)(((NU8)(s->data[i])) - ((NI) 48));
				{
					if (!((*b) <= (NI)((NI)(((NI) IL64(9223372036854775807)) - c) / ((NI) 10)))) goto LA19_;
					(*b) = (NI)((NI)((*b) * ((NI) 10)) + c);
				}
				goto LA17_;
				LA19_: ;
				{
					(*b) = ((NI) IL64(9223372036854775807));
				}
				LA17_: ;
				i += ((NI) 1);
				{
					while (1) {
						NIM_BOOL T24_;
						T24_ = (NIM_BOOL)0;
						T24_ = (i < (s ? s->Sup.len : 0));
						if (!(T24_)) goto LA25_;
						T24_ = ((NU8)(s->data[i]) == (NU8)(95));
						LA25_: ;
						if (!T24_) goto LA23;
						i += ((NI) 1);
					} LA23: ;
				}
			} LA14: ;
		}
		result = (NI)(i - start);
	}
	LA11_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, parseHex__pureZstrutils_895)(NimStringDesc* s, NI* number, NI start, NI maxLen) {
	NI result;
	NI i;
	NI output;
	NIM_BOOL foundDigit;
	NI last;
	NI T1_;
	result = (NI)0;
	i = start;
	output = ((NI) 0);
	foundDigit = NIM_FALSE;
	T1_ = (NI)0;
	{
		if (!(maxLen == ((NI) 0))) goto LA4_;
		T1_ = (s ? s->Sup.len : 0);
	}
	goto LA2_;
	LA4_: ;
	{
		T1_ = (NI)(i + maxLen);
	}
	LA2_: ;
	last = (((s ? s->Sup.len : 0) <= T1_) ? (s ? s->Sup.len : 0) : T1_);
	{
		NIM_BOOL T9_;
		NIM_BOOL T10_;
		T9_ = (NIM_BOOL)0;
		T10_ = (NIM_BOOL)0;
		T10_ = ((NI)(i + ((NI) 1)) < last);
		if (!(T10_)) goto LA11_;
		T10_ = ((NU8)(s->data[i]) == (NU8)(48));
		LA11_: ;
		T9_ = T10_;
		if (!(T9_)) goto LA12_;
		T9_ = (((NU8)(s->data[(NI)(i + ((NI) 1))])) == ((NU8)(120)) || ((NU8)(s->data[(NI)(i + ((NI) 1))])) == ((NU8)(88)));
		LA12_: ;
		if (!T9_) goto LA13_;
		i += ((NI) 2);
	}
	goto LA7_;
	LA13_: ;
	{
		NIM_BOOL T16_;
		T16_ = (NIM_BOOL)0;
		T16_ = (i < last);
		if (!(T16_)) goto LA17_;
		T16_ = ((NU8)(s->data[i]) == (NU8)(35));
		LA17_: ;
		if (!T16_) goto LA18_;
		i += ((NI) 1);
	}
	goto LA7_;
	LA18_: ;
	LA7_: ;
	{
		while (1) {
			if (!(i < last)) goto LA21;
			switch (((NU8)(s->data[i]))) {
			case 95:
			{
			}
			break;
			case 48 ... 57:
			{
				output = (NI)((NI)((NU64)(output) << (NU64)(((NI) 4))) | (NI)(((NU8)(s->data[i])) - ((NI) 48)));
				foundDigit = NIM_TRUE;
			}
			break;
			case 97 ... 102:
			{
				output = (NI)((NI)((NU64)(output) << (NU64)(((NI) 4))) | (NI)((NI)(((NU8)(s->data[i])) - ((NI) 97)) + ((NI) 10)));
				foundDigit = NIM_TRUE;
			}
			break;
			case 65 ... 70:
			{
				output = (NI)((NI)((NU64)(output) << (NU64)(((NI) 4))) | (NI)((NI)(((NU8)(s->data[i])) - ((NI) 65)) + ((NI) 10)));
				foundDigit = NIM_TRUE;
			}
			break;
			default:
			{
				goto LA20;
			}
			break;
			}
			i += ((NI) 1);
		} LA21: ;
	} LA20: ;
	{
		if (!foundDigit) goto LA29_;
		(*number) = output;
		result = (NI)(i - start);
	}
	LA29_: ;
	return result;
}
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(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_5345)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c) {
	addZCT__system_5296((&gch__system_5249.zct), c);
}
static N_INLINE(void, decRef__system_5347)(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_5345(c);
	}
	LA4_: ;
}
static N_INLINE(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*, usrToCell__system_5302)(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) 16));
	result = ((tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*) (T1_));
	return result;
}
static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* T1_;
	T1_ = (tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*)0;
	T1_ = usrToCell__system_5302(p);
	decRef__system_5347(T1_);
}
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_5340)(tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* c) {
	(*c).refcount = pluspercent___system_696((*c).refcount, ((NI) 8));
}
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_5302(src);
		incRef__system_5340(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell__nhn83Yf9cX7rcmG5W9b4oa6g*)0;
		T10_ = usrToCell__system_5302((*dest));
		decRef__system_5347(T10_);
	}
	LA8_: ;
	(*dest) = src;
}
N_LIB_PRIVATE N_NOINLINE(void, integerOutOfRangeError__pureZparseutils_248)(void) {
	tyObject_ValueError__5lcTdgqMq62cNGRwBb0thA* T1_;
	NimStringDesc* T2_;
	T1_ = NIM_NIL;
	T1_ = (tyObject_ValueError__5lcTdgqMq62cNGRwBb0thA*) newObj((&NTIrefvalueerror__MdotPfdEWddcwl4HcVVgeQ_), sizeof(tyObject_ValueError__5lcTdgqMq62cNGRwBb0thA));
	(*T1_).Sup.Sup.Sup.m_type = (&NTIvalueerror__5lcTdgqMq62cNGRwBb0thA_);
	(*T1_).Sup.Sup.name = "ValueError";
	T2_ = NIM_NIL;
	T2_ = (*T1_).Sup.Sup.message; (*T1_).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TM__vI9aZNKIcImom6dDyKXW1ZA_2));
	if (T2_) nimGCunrefNoCycle(T2_);
	asgnRef((void**) (&(*T1_).Sup.Sup.parent), ((Exception*) NIM_NIL));
	raiseExceptionEx((Exception*)T1_, "ValueError", "integerOutOfRangeError", "parseutils.nim", 426);
}
N_LIB_PRIVATE N_NIMCALL(NI, rawParseInt__pureZparseutils_268)(NimStringDesc* s, NI64* b, NI start) {
	NI result;
	NI64 sign;
	NI i;
	result = (NI)0;
	sign = IL64(-1);
	i = start;
	{
		if (!(i < (s ? s->Sup.len : 0))) goto LA3_;
		{
			if (!((NU8)(s->data[i]) == (NU8)(43))) goto LA7_;
			i += ((NI) 1);
		}
		goto LA5_;
		LA7_: ;
		{
			if (!((NU8)(s->data[i]) == (NU8)(45))) goto LA10_;
			i += ((NI) 1);
			sign = IL64(1);
		}
		goto LA5_;
		LA10_: ;
		LA5_: ;
	}
	LA3_: ;
	{
		NIM_BOOL T14_;
		T14_ = (NIM_BOOL)0;
		T14_ = (i < (s ? s->Sup.len : 0));
		if (!(T14_)) goto LA15_;
		T14_ = (((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)));
		LA15_: ;
		if (!T14_) goto LA16_;
		(*b) = IL64(0);
		{
			while (1) {
				NIM_BOOL T20_;
				NI c;
				T20_ = (NIM_BOOL)0;
				T20_ = (i < (s ? s->Sup.len : 0));
				if (!(T20_)) goto LA21_;
				T20_ = (((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)));
				LA21_: ;
				if (!T20_) goto LA19;
				c = (NI)(((NU8)(s->data[i])) - ((NI) 48));
				{
					if (!((NI64)((NI64)((IL64(-9223372036854775807) - IL64(1)) + ((NI64) (c))) / IL64(10)) <= (*b))) goto LA24_;
					(*b) = (NI64)((NI64)((*b) * IL64(10)) - ((NI64) (c)));
				}
				goto LA22_;
				LA24_: ;
				{
					integerOutOfRangeError__pureZparseutils_248();
				}
				LA22_: ;
				i += ((NI) 1);
				{
					while (1) {
						NIM_BOOL T29_;
						T29_ = (NIM_BOOL)0;
						T29_ = (i < (s ? s->Sup.len : 0));
						if (!(T29_)) goto LA30_;
						T29_ = ((NU8)(s->data[i]) == (NU8)(95));
						LA30_: ;
						if (!T29_) goto LA28;
						i += ((NI) 1);
					} LA28: ;
				}
			} LA19: ;
		}
		{
			NIM_BOOL T33_;
			T33_ = (NIM_BOOL)0;
			T33_ = (sign == IL64(-1));
			if (!(T33_)) goto LA34_;
			T33_ = ((*b) == (IL64(-9223372036854775807) - IL64(1)));
			LA34_: ;
			if (!T33_) goto LA35_;
			integerOutOfRangeError__pureZparseutils_248();
		}
		goto LA31_;
		LA35_: ;
		{
			(*b) = (NI64)((*b) * sign);
			result = (NI)(i - start);
		}
		LA31_: ;
	}
	LA16_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, npuParseBiggestInt)(NimStringDesc* s, NI64* number, NI start) {
	NI result;
	NI64 res;
	result = (NI)0;
	res = IL64(0);
	result = rawParseInt__pureZparseutils_268(s, (&res), start);
	{
		if (!!((result == ((NI) 0)))) goto LA3_;
		(*number) = res;
	}
	LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, npuParseInt)(NimStringDesc* s, NI* number, NI start) {
	NI result;
	NI64 res;
	result = (NI)0;
	res = IL64(0);
	result = npuParseBiggestInt(s, (&res), start);
	{
		if (!!((result == ((NI) 0)))) goto LA3_;
		(*number) = ((NI) (res));
	}
	LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, npuParseFloat)(NimStringDesc* s, NF* number, NI start) {
	NI result;
	NF bf;
	result = (NI)0;
	bf = 0.0;
	result = nimParseBiggestFloat(s, (&bf), start);
	{
		if (!!((result == ((NI) 0)))) goto LA3_;
		(*number) = bf;
	}
	LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, rawParseUInt__pureZparseutils_367)(NimStringDesc* s, NU64* b, NI start) {
	NI result;
	NU64 res;
	NU64 prev;
	NI i;
	result = (NI)0;
	res = 0ULL;
	prev = 0ULL;
	i = start;
	{
		NIM_BOOL T3_;
		NIM_BOOL T4_;
		T3_ = (NIM_BOOL)0;
		T4_ = (NIM_BOOL)0;
		T4_ = (i < (NI)((s ? s->Sup.len : 0) - ((NI) 1)));
		if (!(T4_)) goto LA5_;
		T4_ = ((NU8)(s->data[i]) == (NU8)(45));
		LA5_: ;
		T3_ = T4_;
		if (!(T3_)) goto LA6_;
		T3_ = (((NU8)(s->data[(NI)(i + ((NI) 1))])) >= ((NU8)(48)) && ((NU8)(s->data[(NI)(i + ((NI) 1))])) <= ((NU8)(57)));
		LA6_: ;
		if (!T3_) goto LA7_;
		integerOutOfRangeError__pureZparseutils_248();
	}
	LA7_: ;
	{
		NIM_BOOL T11_;
		T11_ = (NIM_BOOL)0;
		T11_ = (i < (s ? s->Sup.len : 0));
		if (!(T11_)) goto LA12_;
		T11_ = ((NU8)(s->data[i]) == (NU8)(43));
		LA12_: ;
		if (!T11_) goto LA13_;
		i += ((NI) 1);
	}
	LA13_: ;
	{
		NIM_BOOL T17_;
		T17_ = (NIM_BOOL)0;
		T17_ = (i < (s ? s->Sup.len : 0));
		if (!(T17_)) goto LA18_;
		T17_ = (((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)));
		LA18_: ;
		if (!T17_) goto LA19_;
		(*b) = 0ULL;
		{
			while (1) {
				NIM_BOOL T23_;
				T23_ = (NIM_BOOL)0;
				T23_ = (i < (s ? s->Sup.len : 0));
				if (!(T23_)) goto LA24_;
				T23_ = (((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)));
				LA24_: ;
				if (!T23_) goto LA22;
				prev = res;
				res = (NU64)((NU64)((NU64)((NU64)(res) * (NU64)(10ULL))) + (NU64)(((NU64) ((NI)(((NU8)(s->data[i])) - ((NI) 48))))));
				{
					if (!((NU64)(res) < (NU64)(prev))) goto LA27_;
					integerOutOfRangeError__pureZparseutils_248();
				}
				LA27_: ;
				i += ((NI) 1);
				{
					while (1) {
						NIM_BOOL T31_;
						T31_ = (NIM_BOOL)0;
						T31_ = (i < (s ? s->Sup.len : 0));
						if (!(T31_)) goto LA32_;
						T31_ = ((NU8)(s->data[i]) == (NU8)(95));
						LA32_: ;
						if (!T31_) goto LA30;
						i += ((NI) 1);
					} LA30: ;
				}
			} LA22: ;
		}
		(*b) = res;
		result = (NI)(i - start);
	}
	LA19_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, npuParseBiggestUInt)(NimStringDesc* s, NU64* number, NI start) {
	NI result;
	NU64 res;
	result = (NI)0;
	res = 0ULL;
	result = rawParseUInt__pureZparseutils_367(s, (&res), start);
	{
		if (!!((result == ((NI) 0)))) goto LA3_;
		(*number) = res;
	}
	LA3_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, fastSubstr__pureZparseutils_170)(NimStringDesc* s, NimStringDesc** token, NI start, NI length) {
	unsureAsgnRef((void**) (&(*token)), setLengthStr((*token), ((NI) (length))));
	{
		NI i;
		NI i_2;
		i = (NI)0;
		i_2 = ((NI) 0);
		{
			while (1) {
				if (!(i_2 < length)) goto LA3;
				i = i_2;
				(*token)->data[i] = s->data[(NI)(i + start)];
				i_2 += ((NI) 1);
			} LA3: ;
		}
	}
}
N_LIB_PRIVATE N_NIMCALL(NI, parseIdent__pureZparseutils_57)(NimStringDesc* s, NimStringDesc** ident, NI start) {
	NI result;
	NI i;
	result = (NI)0;
	i = start;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (i < (s ? s->Sup.len : 0));
		if (!(T3_)) goto LA4_;
		T3_ = (((NU8)(s->data[i])) >= ((NU8)(97)) && ((NU8)(s->data[i])) <= ((NU8)(122)) || ((NU8)(s->data[i])) >= ((NU8)(65)) && ((NU8)(s->data[i])) <= ((NU8)(90)) || ((NU8)(s->data[i])) == ((NU8)(95)));
		LA4_: ;
		if (!T3_) goto LA5_;
		i += ((NI) 1);
		{
			while (1) {
				NIM_BOOL T9_;
				T9_ = (NIM_BOOL)0;
				T9_ = (i < (s ? s->Sup.len : 0));
				if (!(T9_)) goto LA10_;
				T9_ = (((NU8)(s->data[i])) >= ((NU8)(97)) && ((NU8)(s->data[i])) <= ((NU8)(122)) || ((NU8)(s->data[i])) >= ((NU8)(65)) && ((NU8)(s->data[i])) <= ((NU8)(90)) || ((NU8)(s->data[i])) >= ((NU8)(48)) && ((NU8)(s->data[i])) <= ((NU8)(57)) || ((NU8)(s->data[i])) == ((NU8)(95)));
				LA10_: ;
				if (!T9_) goto LA8;
				i += ((NI) 1);
			} LA8: ;
		}
		unsureAsgnRef((void**) (&(*ident)), substr__system_7774(s, start, (NI)(i - ((NI) 1))));
		result = (NI)(i - start);
	}
	LA5_: ;
	return result;
}
