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

#include "nimbase.h"
#include <string.h>
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Jsonparser324013 Jsonparser324013;
typedef struct Baselexer282024 Baselexer282024;
typedef struct TNimObject TNimObject;
typedef struct Streamobj149427 Streamobj149427;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TY324063 TY324063;
typedef struct Jsonparsingerror325756 Jsonparsingerror325756;
typedef struct Valueerror4049 Valueerror4049;
typedef struct Exception Exception;
typedef struct Cell48946 Cell48946;
typedef struct Cellseq48962 Cellseq48962;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48958 Cellset48958;
typedef struct Pagedesc48954 Pagedesc48954;
typedef struct Memregion30890 Memregion30890;
typedef struct Smallchunk30842 Smallchunk30842;
typedef struct Llchunk30884 Llchunk30884;
typedef struct Bigchunk30844 Bigchunk30844;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30888 Avlnode30888;
typedef struct Gcstat51014 Gcstat51014;
typedef struct Jsonnodeobj325754 Jsonnodeobj325754;
typedef struct TY326284 TY326284;
typedef struct TY325769 TY325769;
typedef struct TY325774 TY325774;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef N_NIMCALL_PTR(void, TY3889) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3894) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3889 marker;
TY3894 deepcopy;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  TNimObject  {
TNimType* m_type;
};
typedef NU8 TY213407[32];
struct  Baselexer282024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Streamobj149427* input;
NI linenumber;
NI sentinel;
NI linestart;
TY213407 refillchars;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Jsonparser324013  {
  Baselexer282024 Sup;
NimStringDesc* a;
NU8 tok;
NU8 kind;
NU8 err;
TY324063* state;
NimStringDesc* filename;
};
struct  Exception  {
  TNimObject Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
NimStringDesc* trace;
};
struct  Valueerror4049  {
  Exception Sup;
};
struct  Jsonparsingerror325756  {
  Valueerror4049 Sup;
};
typedef NimStringDesc* TY194829[4];
struct  Cell48946  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48962  {
NI len;
NI cap;
Cell48946** d;
};
struct  Cellset48958  {
NI counter;
NI max;
Pagedesc48954* head;
Pagedesc48954** data;
};
typedef Smallchunk30842* TY30905[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30890  {
NI minlargeobj;
NI maxlargeobj;
TY30905 freesmallchunks;
Llchunk30884* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30844* freechunkslist;
Intset30817 chunkstarts;
Avlnode30888* root;
Avlnode30888* deleted;
Avlnode30888* last;
Avlnode30888* freeavlnodes;
};
struct  Gcstat51014  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap51018  {
Gcstack51016* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq48962 zct;
Cellseq48962 decstack;
Cellset48958 cycleroots;
Cellseq48962 tempstack;
NI recgclock;
Memregion30890 region;
Gcstat51014 stat;
};
struct TY326284 {
NimStringDesc* Field0;
Jsonnodeobj325754* Field1;
};
struct  Jsonnodeobj325754  {
NU8 kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {TY325769* fields;
} S6;
struct {TY325774* elems;
} S7;
} kindU;
};
typedef N_NIMCALL_PTR(void, TY149428) (Streamobj149427* s);
typedef N_NIMCALL_PTR(NIM_BOOL, TY149432) (Streamobj149427* s);
typedef N_NIMCALL_PTR(void, TY149436) (Streamobj149427* s, NI pos);
typedef N_NIMCALL_PTR(NI, TY149441) (Streamobj149427* s);
typedef N_NIMCALL_PTR(NI, TY149445) (Streamobj149427* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(NI, TY149451) (Streamobj149427* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(void, TY149457) (Streamobj149427* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(void, TY149463) (Streamobj149427* s);
struct  Streamobj149427  {
  TNimObject Sup;
TY149428 closeimpl;
TY149432 atendimpl;
TY149436 setpositionimpl;
TY149441 getpositionimpl;
TY149445 readdataimpl;
TY149451 peekdataimpl;
TY149457 writedataimpl;
TY149463 flushimpl;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30821[16];
struct  Pagedesc48954  {
Pagedesc48954* next;
NI key;
TY30821 bits;
};
struct  Basechunk30840  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30842  {
  Basechunk30840 Sup;
Smallchunk30842* next;
Smallchunk30842* prev;
Freecell30832* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30884  {
NI size;
NI acc;
Llchunk30884* next;
};
struct  Bigchunk30844  {
  Basechunk30840 Sup;
Bigchunk30844* next;
Bigchunk30844* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30821 bits;
};
typedef Avlnode30888* TY30895[2];
struct  Avlnode30888  {
TY30895 link;
NI key;
NI upperbound;
NI level;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct TY324063 {
  TGenericSeq Sup;
  NU8 data[SEQ_DECL_SIZE];
};
struct TY325769 {
  TGenericSeq Sup;
  TY326284 data[SEQ_DECL_SIZE];
};
struct TY325774 {
  TGenericSeq Sup;
  Jsonnodeobj325754* data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, TMP3058)(void* p, NI op);
N_NIMCALL(void, open_283635)(Baselexer282024* L, Streamobj149427* input, NI buflen, TY213407 refillchars);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_NIMCALL(void, genericSeqAssign)(void* dest, void* src_85804, TNimType* mt);
N_NIMCALL(NU8, gettok_325370)(Jsonparser324013* my);
N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newlen);
N_NIMCALL(void, skip_325069)(Jsonparser324013* my);
N_NIMCALL(NI, handlecr_283007)(Baselexer282024* L, NI pos);
N_NIMCALL(NI, handlelf_283216)(Baselexer282024* L, NI pos);
N_NIMCALL(void, parsenumber_325165)(Jsonparser324013* my);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NIM_BOOL, contains_103975)(NimStringDesc* s, TY213407 chars);
N_NIMCALL(NU8, parsestring_324938)(Jsonparser324013* my);
N_NIMCALL(NI, parseescapedutf16_324889)(NCSTRING buf, NI* pos);
N_NIMCALL(NIM_BOOL, handlehexchar_324822)(NIM_CHAR c, NI* x);
static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(NimStringDesc*, nuctoUTF8)(NI c);
N_NIMCALL(void, parsename_325322)(Jsonparser324013* my);
N_NIMCALL(TGenericSeq*, incrSeqV2)(TGenericSeq* seq, NI elemsize);
static N_INLINE(NU8, pop_325556)(TY324063** s);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
N_NIMCALL(void, next_325446)(Jsonparser324013* my);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
N_NIMCALL(void, TMP3072)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_NIMCALL(NimStringDesc*, errormsgexpected_324809)(Jsonparser324013* my, NimStringDesc* e);
N_NIMCALL(NimStringDesc*, nsuFormatOpenArray)(NimStringDesc* formatstr, NimStringDesc** a, NI aLen0);
static N_INLINE(NI, getline_324627)(Jsonparser324013* my);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
static N_INLINE(NI, getcolumn_324617)(Jsonparser324013* my);
N_NIMCALL(NI, getcolnumber_284008)(Baselexer282024* L, NI pos);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
static N_INLINE(Cell48946*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48946* c);
N_NOINLINE(void, addzct_52617)(Cellseq48962* s, Cell48946* c);
N_NIMCALL(void, raiseException)(Exception* e, NCSTRING ename);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_NIMCALL(NimStringDesc*, nsuToHex)(NI64 x, NI len);
N_NIMCALL(void, TMP5156)(void* p, NI op);
N_NIMCALL(void, TMP5157)(void* p, NI op);
N_NIMCALL(void, TMP5158)(void* p, NI op);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_326713)(TY325774* x, TY325774* y);
N_NIMCALL(NIM_BOOL, HEX3DHEX3D_326817)(TY325769* x, TY325769* y);
N_NIMCALL(void, topretty_329932)(NimStringDesc** result, Jsonnodeobj325754* node, NI indent, NIM_BOOL ml, NIM_BOOL lstarr, NI currindent);
N_NIMCALL(void, nl_329884)(NimStringDesc** s, NIM_BOOL ml);
N_NIMCALL(void, indent_329861)(NimStringDesc** s, NI i);
N_NIMCALL(NimStringDesc*, nsuRepeatChar)(NIM_CHAR c, NI count);
N_NIMCALL(NI, newindent_329872)(NI curr, NI indent, NIM_BOOL ml);
N_NIMCALL(NimStringDesc*, escapejson_329895)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x);
N_NIMCALL(NimStringDesc*, nimFloatToStr)(NF f);
N_NIMCALL(NimStringDesc*, nimBoolToStr)(NIM_BOOL x);
N_NIMCALL(NI, len_327106)(Jsonnodeobj325754* n);
N_NIMCALL(void, tougly_330058)(NimStringDesc** result, Jsonnodeobj325754* node);
static NIM_CONST TY213407 TMP3059 = {
0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
NIM_CONST struct {
  TGenericSeq Sup;
  NU8 data[1];
} CNSTSEQ3062 = {{1, 1}, {((NU8) 1)}};
NIM_CONST TY324063* TMP3060 = ((TY324063*)&CNSTSEQ3062);
STRING_LITERAL(TMP3062, "", 0);
STRING_LITERAL(TMP3066, "0.", 2);
static NIM_CONST TY213407 TMP3067 = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
;
STRING_LITERAL(TMP3068, "\\u", 2);
STRING_LITERAL(TMP3069, "null", 4);
STRING_LITERAL(TMP3070, "true", 4);
STRING_LITERAL(TMP3071, "false", 5);
STRING_LITERAL(TMP3073, "$1($2, $3) Error: $4", 20);
STRING_LITERAL(TMP3074, " expected", 9);
STRING_LITERAL(TMP3101, "\"", 1);
STRING_LITERAL(TMP3102, "\\\"", 2);
STRING_LITERAL(TMP3103, "\\\\", 2);
TNimNode* NimDT_325754_kind[8];
STRING_LITERAL(TMP5163, "\012", 1);
STRING_LITERAL(TMP5164, "{", 1);
STRING_LITERAL(TMP5165, ", ", 2);
STRING_LITERAL(TMP5166, ": ", 2);
STRING_LITERAL(TMP5167, "}", 1);
STRING_LITERAL(TMP5168, "{}", 2);
STRING_LITERAL(TMP5169, "[", 1);
STRING_LITERAL(TMP5170, "]", 1);
STRING_LITERAL(TMP5171, "[]", 2);
STRING_LITERAL(TMP5230, ",", 1);
STRING_LITERAL(TMP5231, ":", 1);
extern TNimType NTI282024; /* BaseLexer */
TNimType NTI324013; /* JsonParser */
extern TNimType NTI149; /* string */
TNimType NTI324007; /* TokKind */
TNimType NTI324005; /* JsonEventKind */
TNimType NTI324009; /* JsonError */
TNimType NTI324011; /* ParserState */
TNimType NTI324063; /* seq[ParserState] */
extern TNimType NTI4049; /* ValueError */
TNimType NTI325756; /* JsonParsingError */
TNimType NTI325794; /* ref JsonParsingError */
extern Gcheap51018 gch_51059;
TNimType NTI325754; /* JsonNodeObj */
TNimType NTI325750; /* JsonNodeKind */
extern TNimType NTI8112; /* BiggestInt */
extern TNimType NTI128; /* float */
extern TNimType NTI138; /* bool */
TNimType NTI326284; /* tuple[key: string, val: JsonNode] */
TNimType NTI325769; /* seq[tuple[key: string, val: JsonNode]] */
TNimType NTI325774; /* seq[JsonNode] */
TNimType NTI325752; /* JsonNode */
N_NIMCALL(void, TMP3058)(void* p, NI op) {
	TY324063* a;
	NI LOC1;
	a = (TY324063*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	}
}

N_NIMCALL(void, open_324091)(Jsonparser324013* my, Streamobj149427* input, NimStringDesc* filename) {
	Baselexer282024* LOC1;
	LOC1 = 0;
	LOC1 = &my->Sup;
	open_283635(LOC1, input, ((NI) 8192), TMP3059);
	unsureAsgnRef((void**) (&(*my).filename), copyString(filename));
	genericSeqAssign((&(*my).state), TMP3060, (&NTI324063));
	(*my).kind = ((NU8) 0);
	unsureAsgnRef((void**) (&(*my).a), copyString(((NimStringDesc*) &TMP3062)));
}

N_NIMCALL(void, skip_325069)(Jsonparser324013* my) {
	NI pos;
	NCSTRING buf;
	pos = (*my).Sup.bufpos;
	buf = (*my).Sup.buf;
	{
		while (1) {
			switch (((NU8)(buf[pos]))) {
			case 47:
			{
				{
					if (!((NU8)(buf[(NI)(pos + ((NI) 1))]) == (NU8)(47))) goto LA6;
					pos += ((NI) 2);
					{
						while (1) {
							switch (((NU8)(buf[pos]))) {
							case 0:
							{
								goto LA8;
							}
							break;
							case 13:
							{
								Baselexer282024* LOC12;
								LOC12 = 0;
								LOC12 = &my->Sup;
								pos = handlecr_283007(LOC12, pos);
								buf = (*my).Sup.buf;
								goto LA8;
							}
							break;
							case 10:
							{
								Baselexer282024* LOC14;
								LOC14 = 0;
								LOC14 = &my->Sup;
								pos = handlelf_283216(LOC14, pos);
								buf = (*my).Sup.buf;
								goto LA8;
							}
							break;
							default:
							{
								pos += ((NI) 1);
							}
							break;
							}
						}
					} LA8: ;
				}
				goto LA4;
				LA6: ;
				{
					if (!((NU8)(buf[(NI)(pos + ((NI) 1))]) == (NU8)(42))) goto LA17;
					pos += ((NI) 2);
					{
						while (1) {
							switch (((NU8)(buf[pos]))) {
							case 0:
							{
								(*my).err = ((NU8) 8);
								goto LA19;
							}
							break;
							case 13:
							{
								Baselexer282024* LOC23;
								LOC23 = 0;
								LOC23 = &my->Sup;
								pos = handlecr_283007(LOC23, pos);
								buf = (*my).Sup.buf;
							}
							break;
							case 10:
							{
								Baselexer282024* LOC25;
								LOC25 = 0;
								LOC25 = &my->Sup;
								pos = handlelf_283216(LOC25, pos);
								buf = (*my).Sup.buf;
							}
							break;
							case 42:
							{
								pos += ((NI) 1);
								{
									if (!((NU8)(buf[pos]) == (NU8)(47))) goto LA29;
									pos += ((NI) 1);
									goto LA19;
								}
								LA29: ;
							}
							break;
							default:
							{
								pos += ((NI) 1);
							}
							break;
							}
						}
					} LA19: ;
				}
				goto LA4;
				LA17: ;
				{
					goto LA1;
				}
				LA4: ;
			}
			break;
			case 32:
			case 9:
			{
				pos += ((NI) 1);
			}
			break;
			case 13:
			{
				Baselexer282024* LOC35;
				LOC35 = 0;
				LOC35 = &my->Sup;
				pos = handlecr_283007(LOC35, pos);
				buf = (*my).Sup.buf;
			}
			break;
			case 10:
			{
				Baselexer282024* LOC37;
				LOC37 = 0;
				LOC37 = &my->Sup;
				pos = handlelf_283216(LOC37, pos);
				buf = (*my).Sup.buf;
			}
			break;
			default:
			{
				goto LA1;
			}
			break;
			}
		}
	} LA1: ;
	(*my).Sup.bufpos = pos;
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	memcpy(((NCSTRING) ((&(*dest).data[((*dest).Sup.len)- 0]))), ((NCSTRING) ((*src).data)), (NI)((*src).Sup.len + ((NI) 1)));
	(*dest).Sup.len += (*src).Sup.len;
}

N_NIMCALL(void, parsenumber_325165)(Jsonparser324013* my) {
	NI pos;
	NCSTRING buf;
	pos = (*my).Sup.bufpos;
	buf = (*my).Sup.buf;
	{
		if (!((NU8)(buf[pos]) == (NU8)(45))) goto LA3;
		(*my).a = addChar((*my).a, 45);
		pos += ((NI) 1);
	}
	LA3: ;
	{
		if (!((NU8)(buf[pos]) == (NU8)(46))) goto LA7;
		(*my).a = resizeString((*my).a, 2);
appendString((*my).a, ((NimStringDesc*) &TMP3066));
		pos += ((NI) 1);
	}
	goto LA5;
	LA7: ;
	{
		{
			while (1) {
				if (!(((NU8)(buf[pos])) >= ((NU8)(48)) && ((NU8)(buf[pos])) <= ((NU8)(57)))) goto LA11;
				(*my).a = addChar((*my).a, buf[pos]);
				pos += ((NI) 1);
			} LA11: ;
		}
		{
			if (!((NU8)(buf[pos]) == (NU8)(46))) goto LA14;
			(*my).a = addChar((*my).a, 46);
			pos += ((NI) 1);
		}
		LA14: ;
	}
	LA5: ;
	{
		while (1) {
			if (!(((NU8)(buf[pos])) >= ((NU8)(48)) && ((NU8)(buf[pos])) <= ((NU8)(57)))) goto LA17;
			(*my).a = addChar((*my).a, buf[pos]);
			pos += ((NI) 1);
		} LA17: ;
	}
	{
		if (!(((NU8)(buf[pos])) == ((NU8)(69)) || ((NU8)(buf[pos])) == ((NU8)(101)))) goto LA20;
		(*my).a = addChar((*my).a, buf[pos]);
		pos += ((NI) 1);
		{
			if (!(((NU8)(buf[pos])) == ((NU8)(43)) || ((NU8)(buf[pos])) == ((NU8)(45)))) goto LA24;
			(*my).a = addChar((*my).a, buf[pos]);
			pos += ((NI) 1);
		}
		LA24: ;
		{
			while (1) {
				if (!(((NU8)(buf[pos])) >= ((NU8)(48)) && ((NU8)(buf[pos])) <= ((NU8)(57)))) goto LA27;
				(*my).a = addChar((*my).a, buf[pos]);
				pos += ((NI) 1);
			} LA27: ;
		}
	}
	LA20: ;
	(*my).Sup.bufpos = pos;
}

N_NIMCALL(NIM_BOOL, handlehexchar_324822)(NIM_CHAR c, NI* x) {
	NIM_BOOL result;
	result = 0;
	result = NIM_TRUE;
	switch (((NU8)(c))) {
	case 48 ... 57:
	{
		(*x) = (NI)((NI)((NU32)((*x)) << (NU32)(((NI) 4))) | ((NI) ((NI)(((NI) (((NU8)(c)))) - ((NI) 48)))));
	}
	break;
	case 97 ... 102:
	{
		(*x) = (NI)((NI)((NU32)((*x)) << (NU32)(((NI) 4))) | ((NI) ((NI)(((NI) ((NI)(((NI) (((NU8)(c)))) - ((NI) 97)))) + ((NI) 10)))));
	}
	break;
	case 65 ... 70:
	{
		(*x) = (NI)((NI)((NU32)((*x)) << (NU32)(((NI) 4))) | ((NI) ((NI)(((NI) ((NI)(((NI) (((NU8)(c)))) - ((NI) 65)))) + ((NI) 10)))));
	}
	break;
	default:
	{
		result = NIM_FALSE;
	}
	break;
	}
	return result;
}

N_NIMCALL(NI, parseescapedutf16_324889)(NCSTRING buf, NI* pos) {
	NI result;
{	result = 0;
	result = ((NI) 0);
	{
		NI HEX5F_324905;
		NI res_324919;
		HEX5F_324905 = 0;
		res_324919 = ((NI) 0);
		{
			while (1) {
				if (!(res_324919 <= ((NI) 3))) goto LA3;
				HEX5F_324905 = res_324919;
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = handlehexchar_324822(buf[(*pos)], (&result));
					if (!LOC6) goto LA7;
					(*pos) += ((NI) 1);
				}
				goto LA4;
				LA7: ;
				{
					result = ((NI) -1);
					goto BeforeRet;
				}
				LA4: ;
				res_324919 += ((NI) 1);
			} LA3: ;
		}
	}
	}BeforeRet: ;
	return result;
}

static N_INLINE(void, appendChar)(NimStringDesc* dest, NIM_CHAR c) {
	(*dest).data[((*dest).Sup.len)- 0] = c;
	(*dest).data[((NI)((*dest).Sup.len + ((NI) 1)))- 0] = 0;
	(*dest).Sup.len += ((NI) 1);
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NIM_BOOL LOC11;
	int LOC13;
{	result = 0;
	{
		if (!(a == b)) goto LA3;
		result = NIM_TRUE;
		goto BeforeRet;
	}
	LA3: ;
	{
		NIM_BOOL LOC7;
		LOC7 = 0;
		LOC7 = (a == NIM_NIL);
		if (LOC7) goto LA8;
		LOC7 = (b == NIM_NIL);
		LA8: ;
		if (!LOC7) goto LA9;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	LA9: ;
	LOC11 = 0;
	LOC11 = ((*a).Sup.len == (*b).Sup.len);
	if (!(LOC11)) goto LA12;
	LOC13 = 0;
	LOC13 = memcmp(((NCSTRING) ((*a).data)), ((NCSTRING) ((*b).data)), (*a).Sup.len);
	LOC11 = (LOC13 == ((NI32) 0));
	LA12: ;
	result = LOC11;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(NU8, parsestring_324938)(Jsonparser324013* my) {
	NU8 result;
	NI pos;
	NCSTRING buf;
	result = 0;
	result = ((NU8) 2);
	pos = (NI)((*my).Sup.bufpos + ((NI) 1));
	buf = (*my).Sup.buf;
	{
		while (1) {
			switch (((NU8)(buf[pos]))) {
			case 0:
			{
				(*my).err = ((NU8) 7);
				result = ((NU8) 0);
				goto LA1;
			}
			break;
			case 34:
			{
				pos += ((NI) 1);
				goto LA1;
			}
			break;
			case 92:
			{
				switch (((NU8)(buf[(NI)(pos + ((NI) 1))]))) {
				case 92:
				case 34:
				case 39:
				case 47:
				{
					(*my).a = addChar((*my).a, buf[(NI)(pos + ((NI) 1))]);
					pos += ((NI) 2);
				}
				break;
				case 98:
				{
					(*my).a = addChar((*my).a, 8);
					pos += ((NI) 2);
				}
				break;
				case 102:
				{
					(*my).a = addChar((*my).a, 12);
					pos += ((NI) 2);
				}
				break;
				case 110:
				{
					(*my).a = addChar((*my).a, 10);
					pos += ((NI) 2);
				}
				break;
				case 114:
				{
					(*my).a = addChar((*my).a, 13);
					pos += ((NI) 2);
				}
				break;
				case 116:
				{
					(*my).a = addChar((*my).a, 9);
					pos += ((NI) 2);
				}
				break;
				case 117:
				{
					NI r;
					NimStringDesc* LOC33;
					pos += ((NI) 2);
					r = parseescapedutf16_324889(buf, (&pos));
					{
						if (!(r < ((NI) 0))) goto LA15;
						(*my).err = ((NU8) 1);
						goto LA1;
					}
					LA15: ;
					{
						NI s;
						if (!((NI)(r & ((NI) 64512)) == ((NI) 55296))) goto LA19;
						{
							NimStringDesc* LOC23;
							LOC23 = 0;
							LOC23 = rawNewString(2);
appendChar(LOC23, buf[pos]);
appendChar(LOC23, buf[(NI)(pos + ((NI) 1))]);
							if (!!(eqStrings(LOC23, ((NimStringDesc*) &TMP3068)))) goto LA24;
							(*my).err = ((NU8) 1);
							goto LA1;
						}
						LA24: ;
						pos += ((NI) 2);
						s = parseescapedutf16_324889(buf, (&pos));
						{
							NIM_BOOL LOC28;
							LOC28 = 0;
							LOC28 = ((NI)(s & ((NI) 64512)) == ((NI) 56320));
							if (!(LOC28)) goto LA29;
							LOC28 = (((NI) 0) < s);
							LA29: ;
							if (!LOC28) goto LA30;
							r = (NI)(((NI) 65536) + (NI)((NI)((NU32)((NI)(r - ((NI) 55296))) << (NU32)(((NI) 10))) | (NI)(s - ((NI) 56320))));
						}
						goto LA26;
						LA30: ;
						{
							(*my).err = ((NU8) 1);
							goto LA1;
						}
						LA26: ;
					}
					LA19: ;
					LOC33 = 0;
					LOC33 = nuctoUTF8(r);
					(*my).a = resizeString((*my).a, LOC33->Sup.len + 0);
appendString((*my).a, LOC33);
				}
				break;
				default:
				{
					(*my).a = addChar((*my).a, buf[pos]);
					pos += ((NI) 1);
				}
				break;
				}
			}
			break;
			case 13:
			{
				Baselexer282024* LOC36;
				LOC36 = 0;
				LOC36 = &my->Sup;
				pos = handlecr_283007(LOC36, pos);
				buf = (*my).Sup.buf;
				(*my).a = addChar((*my).a, 13);
			}
			break;
			case 10:
			{
				Baselexer282024* LOC38;
				LOC38 = 0;
				LOC38 = &my->Sup;
				pos = handlelf_283216(LOC38, pos);
				buf = (*my).Sup.buf;
				(*my).a = addChar((*my).a, 10);
			}
			break;
			default:
			{
				(*my).a = addChar((*my).a, buf[pos]);
				pos += ((NI) 1);
			}
			break;
			}
		}
	} LA1: ;
	(*my).Sup.bufpos = pos;
	return result;
}

N_NIMCALL(void, parsename_325322)(Jsonparser324013* my) {
	NI pos;
	NCSTRING buf;
	pos = (*my).Sup.bufpos;
	buf = (*my).Sup.buf;
	{
		if (!(((NU8)(buf[pos])) >= ((NU8)(97)) && ((NU8)(buf[pos])) <= ((NU8)(122)) || ((NU8)(buf[pos])) >= ((NU8)(65)) && ((NU8)(buf[pos])) <= ((NU8)(90)) || ((NU8)(buf[pos])) == ((NU8)(95)))) goto LA3;
		{
			while (1) {
				if (!(((NU8)(buf[pos])) >= ((NU8)(97)) && ((NU8)(buf[pos])) <= ((NU8)(122)) || ((NU8)(buf[pos])) >= ((NU8)(65)) && ((NU8)(buf[pos])) <= ((NU8)(90)) || ((NU8)(buf[pos])) >= ((NU8)(48)) && ((NU8)(buf[pos])) <= ((NU8)(57)) || ((NU8)(buf[pos])) == ((NU8)(95)))) goto LA6;
				(*my).a = addChar((*my).a, buf[pos]);
				pos += ((NI) 1);
			} LA6: ;
		}
	}
	LA3: ;
	(*my).Sup.bufpos = pos;
}

N_NIMCALL(NU8, gettok_325370)(Jsonparser324013* my) {
	NU8 result;
	result = 0;
	(*my).a = setLengthStr((*my).a, ((NI) 0));
	skip_325069(my);
	switch (((NU8)((*my).Sup.buf[(*my).Sup.bufpos]))) {
	case 45:
	case 46:
	case 48 ... 57:
	{
		parsenumber_325165(my);
		{
			NIM_BOOL LOC4;
			LOC4 = 0;
			LOC4 = contains_103975((*my).a, TMP3067);
			if (!LOC4) goto LA5;
			result = ((NU8) 4);
		}
		goto LA2;
		LA5: ;
		{
			result = ((NU8) 3);
		}
		LA2: ;
	}
	break;
	case 34:
	{
		result = parsestring_324938(my);
	}
	break;
	case 91:
	{
		(*my).Sup.bufpos += ((NI) 1);
		result = ((NU8) 10);
	}
	break;
	case 123:
	{
		(*my).Sup.bufpos += ((NI) 1);
		result = ((NU8) 8);
	}
	break;
	case 93:
	{
		(*my).Sup.bufpos += ((NI) 1);
		result = ((NU8) 11);
	}
	break;
	case 125:
	{
		(*my).Sup.bufpos += ((NI) 1);
		result = ((NU8) 9);
	}
	break;
	case 44:
	{
		(*my).Sup.bufpos += ((NI) 1);
		result = ((NU8) 13);
	}
	break;
	case 58:
	{
		(*my).Sup.bufpos += ((NI) 1);
		result = ((NU8) 12);
	}
	break;
	case 0:
	{
		result = ((NU8) 1);
	}
	break;
	case 97 ... 122:
	case 65 ... 90:
	case 95:
	{
		parsename_325322(my);
		if (eqStrings((*my).a, ((NimStringDesc*) &TMP3069))) goto LA17;
		if (eqStrings((*my).a, ((NimStringDesc*) &TMP3070))) goto LA18;
		if (eqStrings((*my).a, ((NimStringDesc*) &TMP3071))) goto LA19;
		goto LA20;
		LA17: ;
		{
			result = ((NU8) 7);
		}
		goto LA21;
		LA18: ;
		{
			result = ((NU8) 5);
		}
		goto LA21;
		LA19: ;
		{
			result = ((NU8) 6);
		}
		goto LA21;
		LA20: ;
		{
			result = ((NU8) 0);
		}
		LA21: ;
	}
	break;
	default:
	{
		(*my).Sup.bufpos += ((NI) 1);
		result = ((NU8) 0);
	}
	break;
	}
	(*my).tok = result;
	return result;
}

static N_INLINE(NU8, pop_325556)(TY324063** s) {
	NU8 result;
	NI L;
	result = 0;
	L = (NI)(((*s) ? (*s)->Sup.len : 0) - ((NI) 1));
	result = (*s)->data[L];
	(*s) = (TY324063*) setLengthSeq(&((*s))->Sup, sizeof(NU8), ((NI) (L)));
	return result;
}

N_NIMCALL(void, next_325446)(Jsonparser324013* my) {
	NU8 tk;
	NI i;
	tk = gettok_325370(my);
	i = (NI)(((*my).state ? (*my).state->Sup.len : 0) - ((NI) 1));
	switch ((*my).state->data[i]) {
	case ((NU8) 0):
	{
		{
			if (!(tk == ((NU8) 1))) goto LA4;
			(*my).kind = ((NU8) 1);
		}
		goto LA2;
		LA4: ;
		{
			(*my).kind = ((NU8) 0);
			(*my).err = ((NU8) 9);
		}
		LA2: ;
	}
	break;
	case ((NU8) 1):
	{
		switch (tk) {
		case ((NU8) 2):
		case ((NU8) 3):
		case ((NU8) 4):
		case ((NU8) 5):
		case ((NU8) 6):
		case ((NU8) 7):
		{
			(*my).state->data[i] = ((NU8) 0);
			(*my).kind = ((NU8) (tk));
		}
		break;
		case ((NU8) 10):
		{
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 3);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) 10);
		}
		break;
		case ((NU8) 8):
		{
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 2);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) 8);
		}
		break;
		case ((NU8) 1):
		{
			(*my).kind = ((NU8) 1);
		}
		break;
		default:
		{
			(*my).kind = ((NU8) 0);
			(*my).err = ((NU8) 9);
		}
		break;
		}
	}
	break;
	case ((NU8) 2):
	{
		switch (tk) {
		case ((NU8) 2):
		case ((NU8) 3):
		case ((NU8) 4):
		case ((NU8) 5):
		case ((NU8) 6):
		case ((NU8) 7):
		{
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 6);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) (tk));
		}
		break;
		case ((NU8) 10):
		{
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 6);
			++(*my).state->Sup.len;
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 3);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) 10);
		}
		break;
		case ((NU8) 8):
		{
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 6);
			++(*my).state->Sup.len;
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 2);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) 8);
		}
		break;
		case ((NU8) 9):
		{
			NU8 LOC18;
			(*my).kind = ((NU8) 9);
			LOC18 = 0;
			LOC18 = pop_325556((&(*my).state));
		}
		break;
		default:
		{
			(*my).kind = ((NU8) 0);
			(*my).err = ((NU8) 6);
		}
		break;
		}
	}
	break;
	case ((NU8) 3):
	{
		switch (tk) {
		case ((NU8) 2):
		case ((NU8) 3):
		case ((NU8) 4):
		case ((NU8) 5):
		case ((NU8) 6):
		case ((NU8) 7):
		{
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 4);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) (tk));
		}
		break;
		case ((NU8) 10):
		{
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 4);
			++(*my).state->Sup.len;
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 3);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) 10);
		}
		break;
		case ((NU8) 8):
		{
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 4);
			++(*my).state->Sup.len;
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 2);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) 8);
		}
		break;
		case ((NU8) 11):
		{
			NU8 LOC25;
			(*my).kind = ((NU8) 11);
			LOC25 = 0;
			LOC25 = pop_325556((&(*my).state));
		}
		break;
		default:
		{
			(*my).kind = ((NU8) 0);
			(*my).err = ((NU8) 5);
		}
		break;
		}
	}
	break;
	case ((NU8) 4):
	{
		switch (tk) {
		case ((NU8) 13):
		{
			NU8 LOC29;
			LOC29 = 0;
			LOC29 = pop_325556((&(*my).state));
			next_325446(my);
		}
		break;
		case ((NU8) 11):
		{
			NU8 LOC31;
			NU8 LOC32;
			(*my).kind = ((NU8) 11);
			LOC31 = 0;
			LOC31 = pop_325556((&(*my).state));
			LOC32 = 0;
			LOC32 = pop_325556((&(*my).state));
		}
		break;
		default:
		{
			(*my).kind = ((NU8) 0);
			(*my).err = ((NU8) 5);
		}
		break;
		}
	}
	break;
	case ((NU8) 5):
	{
		switch (tk) {
		case ((NU8) 13):
		{
			NU8 LOC36;
			LOC36 = 0;
			LOC36 = pop_325556((&(*my).state));
			next_325446(my);
		}
		break;
		case ((NU8) 9):
		{
			NU8 LOC38;
			NU8 LOC39;
			(*my).kind = ((NU8) 9);
			LOC38 = 0;
			LOC38 = pop_325556((&(*my).state));
			LOC39 = 0;
			LOC39 = pop_325556((&(*my).state));
		}
		break;
		default:
		{
			(*my).kind = ((NU8) 0);
			(*my).err = ((NU8) 6);
		}
		break;
		}
	}
	break;
	case ((NU8) 6):
	{
		switch (tk) {
		case ((NU8) 12):
		{
			(*my).state->data[i] = ((NU8) 7);
			next_325446(my);
		}
		break;
		default:
		{
			(*my).kind = ((NU8) 0);
			(*my).err = ((NU8) 3);
		}
		break;
		}
	}
	break;
	case ((NU8) 7):
	{
		switch (tk) {
		case ((NU8) 2):
		case ((NU8) 3):
		case ((NU8) 4):
		case ((NU8) 5):
		case ((NU8) 6):
		case ((NU8) 7):
		{
			(*my).state->data[i] = ((NU8) 5);
			(*my).kind = ((NU8) (tk));
		}
		break;
		case ((NU8) 10):
		{
			(*my).state->data[i] = ((NU8) 5);
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 3);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) 10);
		}
		break;
		case ((NU8) 8):
		{
			(*my).state->data[i] = ((NU8) 5);
			(*my).state = (TY324063*) incrSeqV2(&((*my).state)->Sup, sizeof(NU8));
			(*my).state->data[(*my).state->Sup.len] = ((NU8) 2);
			++(*my).state->Sup.len;
			(*my).kind = ((NU8) 8);
		}
		break;
		default:
		{
			(*my).kind = ((NU8) 0);
			(*my).err = ((NU8) 10);
		}
		break;
		}
	}
	break;
	}
}
N_NIMCALL(void, TMP3072)(void* p, NI op) {
	Jsonparsingerror325756* a;
	a = (Jsonparsingerror325756*)p;
	nimGCvisit((void*)(*a).Sup.Sup.parent, op);
	nimGCvisit((void*)(*a).Sup.Sup.message, op);
	nimGCvisit((void*)(*a).Sup.Sup.trace, op);
}

static N_INLINE(NI, getline_324627)(Jsonparser324013* my) {
	NI result;
	result = 0;
	result = (*my).Sup.linenumber;
	return result;
}

static N_INLINE(NI, getcolumn_324617)(Jsonparser324013* my) {
	NI result;
	result = 0;
	result = getcolnumber_284008((&(*my).Sup), (*my).Sup.bufpos);
	return result;
}

N_NIMCALL(NimStringDesc*, errormsgexpected_324809)(Jsonparser324013* my, NimStringDesc* e) {
	NimStringDesc* result;
	TY194829 LOC1;
	NI LOC2;
	NI LOC3;
	NimStringDesc* LOC4;
	result = 0;
	memset((void*)LOC1, 0, sizeof(LOC1));
	LOC1[0] = copyString((*my).filename);
	LOC2 = 0;
	LOC2 = getline_324627(my);
	LOC1[1] = nimIntToStr(LOC2);
	LOC3 = 0;
	LOC3 = getcolumn_324617(my);
	LOC1[2] = nimIntToStr(LOC3);
	LOC4 = 0;
	LOC4 = rawNewString(e->Sup.len + 9);
appendString(LOC4, e);
appendString(LOC4, ((NimStringDesc*) &TMP3074));
	LOC1[3] = LOC4;
	result = nsuFormatOpenArray(((NimStringDesc*) &TMP3073), LOC1, 4);
	return result;
}

static N_INLINE(Cell48946*, usrtocell_52646)(void* usr) {
	Cell48946* result;
	result = 0;
	result = ((Cell48946*) ((NI)((NU32)(((NI) (usr))) - (NU32)(((NI)sizeof(Cell48946))))));
	return result;
}

static N_INLINE(void, rtladdzct_54204)(Cell48946* c) {
	addzct_52617((&gch_51059.zct), c);
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		Cell48946* c;
		if (!!((src == NIM_NIL))) goto LA3;
		c = usrtocell_52646(src);
		(*c).refcount += ((NI) 8);
	}
	LA3: ;
	{
		Cell48946* c;
		if (!!(((*dest) == NIM_NIL))) goto LA7;
		c = usrtocell_52646((*dest));
		{
			(*c).refcount -= ((NI) 8);
			if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA11;
			rtladdzct_54204(c);
		}
		LA11: ;
	}
	LA7: ;
	(*dest) = src;
}

N_NOINLINE(void, raiseparseerr_325786)(Jsonparser324013* p, NimStringDesc* msg) {
	Jsonparsingerror325756* e_325793;
	e_325793 = 0;
	e_325793 = (Jsonparsingerror325756*) newObj((&NTI325794), sizeof(Jsonparsingerror325756));
	(*e_325793).Sup.Sup.Sup.m_type = (&NTI325756);
	asgnRefNoCycle((void**) (&(*e_325793).Sup.Sup.message), errormsgexpected_324809(p, msg));
	raiseException((Exception*)e_325793, "JsonParsingError");
}

N_NIMCALL(NimStringDesc*, escapejson_329895)(NimStringDesc* s) {
	NimStringDesc* result;
	result = 0;
	result = rawNewString(((NI) ((NI)((s ? s->Sup.len : 0) + (NI)((NU32)((s ? s->Sup.len : 0)) >> (NU32)(((NI) 3)))))));
	result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TMP3101));
	{
		NI x_329899;
		NI i_329907;
		NI result_329909;
		x_329899 = 0;
		i_329907 = ((NI) 0);
		result_329909 = 0;
		{
			while (1) {
				NI r;
				if (!(i_329907 < (s ? s->Sup.len : 0))) goto LA3;
				{
					if (!((NU32)(((NI) (((NU8)(s->data[i_329907]))))) <= (NU32)(((NI) 127)))) goto LA6;
					result_329909 = ((NI) (((NU8)(s->data[i_329907]))));
					i_329907 += ((NI) 1);
				}
				goto LA4;
				LA6: ;
				{
					if (!((NI)((NU32)(((NI) (((NU8)(s->data[i_329907]))))) >> (NU32)(((NI) 5))) == ((NI) 6))) goto LA9;
					result_329909 = (NI)((NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[i_329907])))) & ((NI) 31))))) << (NU32)(((NI) 6))) | ((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 1))])))) & ((NI) 63)))));
					i_329907 += ((NI) 2);
				}
				goto LA4;
				LA9: ;
				{
					if (!((NI)((NU32)(((NI) (((NU8)(s->data[i_329907]))))) >> (NU32)(((NI) 4))) == ((NI) 14))) goto LA12;
					result_329909 = (NI)((NI)((NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[i_329907])))) & ((NI) 15))))) << (NU32)(((NI) 12))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 1))])))) & ((NI) 63))))) << (NU32)(((NI) 6)))) | ((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 2))])))) & ((NI) 63)))));
					i_329907 += ((NI) 3);
				}
				goto LA4;
				LA12: ;
				{
					if (!((NI)((NU32)(((NI) (((NU8)(s->data[i_329907]))))) >> (NU32)(((NI) 3))) == ((NI) 30))) goto LA15;
					result_329909 = (NI)((NI)((NI)((NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[i_329907])))) & ((NI) 7))))) << (NU32)(((NI) 18))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 1))])))) & ((NI) 63))))) << (NU32)(((NI) 12)))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 2))])))) & ((NI) 63))))) << (NU32)(((NI) 6)))) | ((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 3))])))) & ((NI) 63)))));
					i_329907 += ((NI) 4);
				}
				goto LA4;
				LA15: ;
				{
					if (!((NI)((NU32)(((NI) (((NU8)(s->data[i_329907]))))) >> (NU32)(((NI) 2))) == ((NI) 62))) goto LA18;
					result_329909 = (NI)((NI)((NI)((NI)((NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[i_329907])))) & ((NI) 3))))) << (NU32)(((NI) 24))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 1))])))) & ((NI) 63))))) << (NU32)(((NI) 18)))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 2))])))) & ((NI) 63))))) << (NU32)(((NI) 12)))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 3))])))) & ((NI) 63))))) << (NU32)(((NI) 6)))) | ((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 4))])))) & ((NI) 63)))));
					i_329907 += ((NI) 5);
				}
				goto LA4;
				LA18: ;
				{
					if (!((NI)((NU32)(((NI) (((NU8)(s->data[i_329907]))))) >> (NU32)(((NI) 1))) == ((NI) 126))) goto LA21;
					result_329909 = (NI)((NI)((NI)((NI)((NI)((NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[i_329907])))) & ((NI) 1))))) << (NU32)(((NI) 30))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 1))])))) & ((NI) 63))))) << (NU32)(((NI) 24)))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 2))])))) & ((NI) 63))))) << (NU32)(((NI) 18)))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 3))])))) & ((NI) 63))))) << (NU32)(((NI) 12)))) | (NI)((NU32)(((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 4))])))) & ((NI) 63))))) << (NU32)(((NI) 6)))) | ((NI) ((NI)(((NI) (((NU8)(s->data[(NI)(i_329907 + ((NI) 5))])))) & ((NI) 63)))));
					i_329907 += ((NI) 6);
				}
				goto LA4;
				LA21: ;
				{
					result_329909 = ((NI) (((NU8)(s->data[i_329907]))));
					i_329907 += ((NI) 1);
				}
				LA4: ;
				x_329899 = result_329909;
				r = x_329899;
				{
					NIM_BOOL LOC26;
					NIM_CHAR c;
					LOC26 = 0;
					LOC26 = (((NI) 32) <= r);
					if (!(LOC26)) goto LA27;
					LOC26 = (r <= ((NI) 127));
					LA27: ;
					if (!LOC26) goto LA28;
					c = ((NIM_CHAR) (((NI) (r))));
					switch (((NU8)(c))) {
					case 34:
					{
						result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP3102));
					}
					break;
					case 92:
					{
						result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP3103));
					}
					break;
					default:
					{
						result = addChar(result, c);
					}
					break;
					}
				}
				goto LA24;
				LA28: ;
				{
					NimStringDesc* LOC34;
					result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TMP3068));
					LOC34 = 0;
					LOC34 = nsuToHex(((NI64) (r)), ((NI) 4));
					result = resizeString(result, LOC34->Sup.len + 0);
appendString(result, LOC34);
				}
				LA24: ;
			} LA3: ;
		}
	}
	result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TMP3101));
	return result;
}
N_NIMCALL(void, TMP5156)(void* p, NI op) {
	TY325769* a;
	NI LOC1;
	a = (TY325769*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1].Field0, op);
	nimGCvisit((void*)a->data[LOC1].Field1, op);
	}
}
N_NIMCALL(void, TMP5157)(void* p, NI op) {
	TY325774* a;
	NI LOC1;
	a = (TY325774*)p;
	LOC1 = 0;
	for (LOC1 = 0; LOC1 < a->Sup.len; LOC1++) {
	nimGCvisit((void*)a->data[LOC1], op);
	}
}
N_NIMCALL(void, TMP5158)(void* p, NI op) {
	Jsonnodeobj325754* a;
	a = (Jsonnodeobj325754*)p;
	switch ((*a).kind) {
	case ((NU8) 4):
	nimGCvisit((void*)(*a).kindU.S1.str, op);
	break;
	case ((NU8) 2):
	break;
	case ((NU8) 3):
	break;
	case ((NU8) 1):
	break;
	case ((NU8) 0):
	break;
	case ((NU8) 5):
	nimGCvisit((void*)(*a).kindU.S6.fields, op);
	break;
	case ((NU8) 6):
	nimGCvisit((void*)(*a).kindU.S7.elems, op);
	break;
	} 
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	Cell48946* c;
	c = usrtocell_52646(p);
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3;
		rtladdzct_54204(c);
	}
	LA3: ;
}

N_NIMCALL(Jsonnodeobj325754*, HEX25_326281)(TY326284* keyvals, NI keyvalsLen0) {
	Jsonnodeobj325754* result;
	result = 0;
	result = (Jsonnodeobj325754*) newObj((&NTI325752), sizeof(Jsonnodeobj325754));
	(*result).kind = ((NU8) 5);
	if ((*result).kindU.S6.fields) nimGCunrefNoCycle((*result).kindU.S6.fields);
	(*result).kindU.S6.fields = (TY325769*) newSeqRC1((&NTI325769), ((NI) (keyvalsLen0)));
	{
		NI i_326356;
		TY326284 p_326357;
		NI i_326362;
		i_326356 = 0;
		memset((void*)(&p_326357), 0, sizeof(p_326357));
		i_326362 = ((NI) 0);
		{
			while (1) {
				NimStringDesc* LOC4;
				if (!(i_326362 < keyvalsLen0)) goto LA3;
				i_326356 = i_326362;
				p_326357.Field0 = keyvals[i_326362].Field0;
				p_326357.Field1 = keyvals[i_326362].Field1;
				LOC4 = 0;
				LOC4 = (*result).kindU.S6.fields->data[i_326356].Field0; (*result).kindU.S6.fields->data[i_326356].Field0 = copyStringRC1(p_326357.Field0);
				if (LOC4) nimGCunrefNoCycle(LOC4);
				asgnRefNoCycle((void**) (&(*result).kindU.S6.fields->data[i_326356].Field1), p_326357.Field1);
				i_326362 += ((NI) 1);
			} LA3: ;
		}
	}
	return result;
}

N_NIMCALL(Jsonnodeobj325754*, HEX25_326205)(NimStringDesc* s) {
	Jsonnodeobj325754* result;
	NimStringDesc* LOC1;
	result = 0;
	result = (Jsonnodeobj325754*) newObj((&NTI325752), sizeof(Jsonnodeobj325754));
	(*result).kind = ((NU8) 4);
	LOC1 = 0;
	LOC1 = (*result).kindU.S1.str; (*result).kindU.S1.str = copyStringRC1(s);
	if (LOC1) nimGCunrefNoCycle(LOC1);
	return result;
}

N_NIMCALL(NIM_BOOL, HEX3DHEX3D_326661)(Jsonnodeobj325754* a, Jsonnodeobj325754* b) {
	NIM_BOOL result;
{	result = 0;
	{
		if (!a == 0) goto LA3;
		{
			if (!b == 0) goto LA7;
			result = NIM_TRUE;
			goto BeforeRet;
		}
		LA7: ;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	goto LA1;
	LA3: ;
	{
		NIM_BOOL LOC10;
		LOC10 = 0;
		LOC10 = b == 0;
		if (LOC10) goto LA11;
		LOC10 = !(((*a).kind == (*b).kind));
		LA11: ;
		if (!LOC10) goto LA12;
		result = NIM_FALSE;
		goto BeforeRet;
	}
	goto LA1;
	LA12: ;
	{
		switch ((*a).kind) {
		case ((NU8) 4):
		{
			result = eqStrings((*a).kindU.S1.str, (*b).kindU.S1.str);
		}
		break;
		case ((NU8) 2):
		{
			result = ((*a).kindU.S2.num == (*b).kindU.S2.num);
		}
		break;
		case ((NU8) 3):
		{
			result = ((*a).kindU.S3.fnum == (*b).kindU.S3.fnum);
		}
		break;
		case ((NU8) 1):
		{
			result = ((*a).kindU.S4.bval == (*b).kindU.S4.bval);
		}
		break;
		case ((NU8) 0):
		{
			result = NIM_TRUE;
		}
		break;
		case ((NU8) 6):
		{
			result = HEX3DHEX3D_326713((*a).kindU.S7.elems, (*b).kindU.S7.elems);
		}
		break;
		case ((NU8) 5):
		{
			result = HEX3DHEX3D_326817((*a).kindU.S6.fields, (*b).kindU.S6.fields);
		}
		break;
		}
		goto BeforeRet;
	}
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Jsonnodeobj325754*, newjarray_325956)(void) {
	Jsonnodeobj325754* result;
	result = 0;
	result = (Jsonnodeobj325754*) newObj((&NTI325752), sizeof(Jsonnodeobj325754));
	(*result).kind = ((NU8) 6);
	if ((*result).kindU.S7.elems) nimGCunrefNoCycle((*result).kindU.S7.elems);
	(*result).kindU.S7.elems = (TY325774*) newSeqRC1((&NTI325774), 0);
	return result;
}

N_NIMCALL(void, add_328247)(Jsonnodeobj325754* father, Jsonnodeobj325754* child) {
	(*father).kindU.S7.elems = (TY325774*) incrSeqV2(&((*father).kindU.S7.elems)->Sup, sizeof(Jsonnodeobj325754*));
	asgnRefNoCycle((void**) (&(*father).kindU.S7.elems->data[(*father).kindU.S7.elems->Sup.len]), child);
	++(*father).kindU.S7.elems->Sup.len;
}

N_NIMCALL(void, nl_329884)(NimStringDesc** s, NIM_BOOL ml) {
	{
		if (!ml) goto LA3;
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP5163));
	}
	LA3: ;
}

N_NIMCALL(void, indent_329861)(NimStringDesc** s, NI i) {
	NimStringDesc* LOC1;
	LOC1 = 0;
	LOC1 = nsuRepeatChar(32, ((NI) (i)));
	(*s) = resizeString((*s), LOC1->Sup.len + 0);
appendString((*s), LOC1);
}

N_NIMCALL(NI, newindent_329872)(NI curr, NI indent, NIM_BOOL ml) {
	NI result;
{	result = 0;
	{
		if (!ml) goto LA3;
		result = (NI)(curr + indent);
		goto BeforeRet;
	}
	goto LA1;
	LA3: ;
	{
		result = indent;
		goto BeforeRet;
	}
	LA1: ;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, topretty_329932)(NimStringDesc** result, Jsonnodeobj325754* node, NI indent, NIM_BOOL ml, NIM_BOOL lstarr, NI currindent) {
	switch ((*node).kind) {
	case ((NU8) 5):
	{
		{
			NIM_BOOL LOC4;
			LOC4 = 0;
			LOC4 = !((currindent == ((NI) 0)));
			if (!(LOC4)) goto LA5;
			LOC4 = !(lstarr);
			LA5: ;
			if (!LOC4) goto LA6;
			nl_329884(result, ml);
		}
		LA6: ;
		indent_329861(result, currindent);
		{
			if (!(((NI) 0) < ((*node).kindU.S6.fields ? (*node).kindU.S6.fields->Sup.len : 0))) goto LA10;
			(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5164));
			nl_329884(result, ml);
			{
				NI i_329969;
				NI HEX3Atmp_330007;
				NI res_330010;
				i_329969 = 0;
				HEX3Atmp_330007 = 0;
				HEX3Atmp_330007 = (NI)(((*node).kindU.S6.fields ? (*node).kindU.S6.fields->Sup.len : 0) - ((NI) 1));
				res_330010 = ((NI) 0);
				{
					while (1) {
						NI LOC19;
						NimStringDesc* LOC20;
						NI LOC21;
						if (!(res_330010 <= HEX3Atmp_330007)) goto LA14;
						i_329969 = res_330010;
						{
							if (!(((NI) 0) < i_329969)) goto LA17;
							(*result) = resizeString((*result), 2);
appendString((*result), ((NimStringDesc*) &TMP5165));
							nl_329884(result, ml);
						}
						LA17: ;
						LOC19 = 0;
						LOC19 = newindent_329872(currindent, indent, ml);
						indent_329861(result, LOC19);
						LOC20 = 0;
						LOC20 = escapejson_329895((*node).kindU.S6.fields->data[i_329969].Field0);
						(*result) = resizeString((*result), LOC20->Sup.len + 0);
appendString((*result), LOC20);
						(*result) = resizeString((*result), 2);
appendString((*result), ((NimStringDesc*) &TMP5166));
						LOC21 = 0;
						LOC21 = newindent_329872(currindent, indent, ml);
						topretty_329932(result, (*node).kindU.S6.fields->data[i_329969].Field1, indent, ml, NIM_FALSE, LOC21);
						res_330010 += ((NI) 1);
					} LA14: ;
				}
			}
			nl_329884(result, ml);
			indent_329861(result, currindent);
			(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5167));
		}
		goto LA8;
		LA10: ;
		{
			(*result) = resizeString((*result), 2);
appendString((*result), ((NimStringDesc*) &TMP5168));
		}
		LA8: ;
	}
	break;
	case ((NU8) 4):
	{
		NimStringDesc* LOC28;
		{
			if (!lstarr) goto LA26;
			indent_329861(result, currindent);
		}
		LA26: ;
		LOC28 = 0;
		LOC28 = escapejson_329895((*node).kindU.S1.str);
		(*result) = resizeString((*result), LOC28->Sup.len + 0);
appendString((*result), LOC28);
	}
	break;
	case ((NU8) 2):
	{
		NimStringDesc* LOC34;
		{
			if (!lstarr) goto LA32;
			indent_329861(result, currindent);
		}
		LA32: ;
		LOC34 = 0;
		LOC34 = nimInt64ToStr((*node).kindU.S2.num);
		(*result) = resizeString((*result), LOC34->Sup.len + 0);
appendString((*result), LOC34);
	}
	break;
	case ((NU8) 3):
	{
		NimStringDesc* LOC40;
		{
			if (!lstarr) goto LA38;
			indent_329861(result, currindent);
		}
		LA38: ;
		LOC40 = 0;
		LOC40 = nimFloatToStr((*node).kindU.S3.fnum);
		(*result) = resizeString((*result), LOC40->Sup.len + 0);
appendString((*result), LOC40);
	}
	break;
	case ((NU8) 1):
	{
		NimStringDesc* LOC46;
		{
			if (!lstarr) goto LA44;
			indent_329861(result, currindent);
		}
		LA44: ;
		LOC46 = 0;
		LOC46 = nimBoolToStr((*node).kindU.S4.bval);
		(*result) = resizeString((*result), LOC46->Sup.len + 0);
appendString((*result), LOC46);
	}
	break;
	case ((NU8) 6):
	{
		{
			if (!lstarr) goto LA50;
			indent_329861(result, currindent);
		}
		LA50: ;
		{
			if (!!((((*node).kindU.S7.elems ? (*node).kindU.S7.elems->Sup.len : 0) == ((NI) 0)))) goto LA54;
			(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5169));
			nl_329884(result, ml);
			{
				NI i_330004;
				NI HEX3Atmp_330015;
				NI res_330018;
				i_330004 = 0;
				HEX3Atmp_330015 = 0;
				HEX3Atmp_330015 = (NI)(((*node).kindU.S7.elems ? (*node).kindU.S7.elems->Sup.len : 0) - ((NI) 1));
				res_330018 = ((NI) 0);
				{
					while (1) {
						NI LOC63;
						if (!(res_330018 <= HEX3Atmp_330015)) goto LA58;
						i_330004 = res_330018;
						{
							if (!(((NI) 0) < i_330004)) goto LA61;
							(*result) = resizeString((*result), 2);
appendString((*result), ((NimStringDesc*) &TMP5165));
							nl_329884(result, ml);
						}
						LA61: ;
						LOC63 = 0;
						LOC63 = newindent_329872(currindent, indent, ml);
						topretty_329932(result, (*node).kindU.S7.elems->data[i_330004], indent, ml, NIM_TRUE, LOC63);
						res_330018 += ((NI) 1);
					} LA58: ;
				}
			}
			nl_329884(result, ml);
			indent_329861(result, currindent);
			(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5170));
		}
		goto LA52;
		LA54: ;
		{
			(*result) = resizeString((*result), 2);
appendString((*result), ((NimStringDesc*) &TMP5171));
		}
		LA52: ;
	}
	break;
	case ((NU8) 0):
	{
		{
			if (!lstarr) goto LA68;
			indent_329861(result, currindent);
		}
		LA68: ;
		(*result) = resizeString((*result), 4);
appendString((*result), ((NimStringDesc*) &TMP3069));
	}
	break;
	}
}

N_NIMCALL(NimStringDesc*, pretty_330046)(Jsonnodeobj325754* node, NI indent) {
	NimStringDesc* result;
	result = 0;
	result = copyString(((NimStringDesc*) &TMP3062));
	topretty_329932((&result), node, indent, NIM_TRUE, NIM_FALSE, ((NI) 0));
	return result;
}

N_NIMCALL(NI, len_327106)(Jsonnodeobj325754* n) {
	NI result;
	result = 0;
	switch ((*n).kind) {
	case ((NU8) 6):
	{
		result = ((*n).kindU.S7.elems ? (*n).kindU.S7.elems->Sup.len : 0);
	}
	break;
	case ((NU8) 5):
	{
		result = ((*n).kindU.S6.fields ? (*n).kindU.S6.fields->Sup.len : 0);
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

N_NIMCALL(void, tougly_330058)(NimStringDesc** result, Jsonnodeobj325754* node) {
	NIM_BOOL comma;
	comma = NIM_FALSE;
	switch ((*node).kind) {
	case ((NU8) 6):
	{
		(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5169));
		{
			Jsonnodeobj325754* child_330074;
			TY325774* HEX3Atmp_330092;
			NI i_330095;
			NI L_330097;
			child_330074 = 0;
			HEX3Atmp_330092 = 0;
			HEX3Atmp_330092 = (*node).kindU.S7.elems;
			i_330095 = ((NI) 0);
			L_330097 = (HEX3Atmp_330092 ? HEX3Atmp_330092->Sup.len : 0);
			{
				while (1) {
					if (!(i_330095 < L_330097)) goto LA4;
					child_330074 = HEX3Atmp_330092->data[i_330095];
					{
						if (!comma) goto LA7;
						(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5230));
					}
					goto LA5;
					LA7: ;
					{
						comma = NIM_TRUE;
					}
					LA5: ;
					tougly_330058(result, child_330074);
					i_330095 += ((NI) 1);
				} LA4: ;
			}
		}
		(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5170));
	}
	break;
	case ((NU8) 5):
	{
		(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5164));
		{
			NimStringDesc* key_330085;
			Jsonnodeobj325754* value_330086;
			TY325769* HEX3Atmp_330099;
			NI i_330102;
			NI L_330104;
			key_330085 = 0;
			value_330086 = 0;
			HEX3Atmp_330099 = 0;
			HEX3Atmp_330099 = (*node).kindU.S6.fields;
			i_330102 = ((NI) 0);
			L_330104 = (HEX3Atmp_330099 ? HEX3Atmp_330099->Sup.len : 0);
			{
				while (1) {
					NimStringDesc* LOC19;
					if (!(i_330102 < L_330104)) goto LA13;
					key_330085 = HEX3Atmp_330099->data[i_330102].Field0;
					value_330086 = HEX3Atmp_330099->data[i_330102].Field1;
					{
						if (!comma) goto LA16;
						(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5230));
					}
					goto LA14;
					LA16: ;
					{
						comma = NIM_TRUE;
					}
					LA14: ;
					LOC19 = 0;
					LOC19 = escapejson_329895(key_330085);
					(*result) = resizeString((*result), LOC19->Sup.len + 0);
appendString((*result), LOC19);
					(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5231));
					tougly_330058(result, value_330086);
					i_330102 += ((NI) 1);
				} LA13: ;
			}
		}
		(*result) = resizeString((*result), 1);
appendString((*result), ((NimStringDesc*) &TMP5167));
	}
	break;
	case ((NU8) 4):
	{
		NimStringDesc* LOC21;
		LOC21 = 0;
		LOC21 = escapejson_329895((*node).kindU.S1.str);
		(*result) = resizeString((*result), LOC21->Sup.len + 0);
appendString((*result), LOC21);
	}
	break;
	case ((NU8) 2):
	{
		NimStringDesc* LOC23;
		LOC23 = 0;
		LOC23 = nimInt64ToStr((*node).kindU.S2.num);
		(*result) = resizeString((*result), LOC23->Sup.len + 0);
appendString((*result), LOC23);
	}
	break;
	case ((NU8) 3):
	{
		NimStringDesc* LOC25;
		LOC25 = 0;
		LOC25 = nimFloatToStr((*node).kindU.S3.fnum);
		(*result) = resizeString((*result), LOC25->Sup.len + 0);
appendString((*result), LOC25);
	}
	break;
	case ((NU8) 1):
	{
		NimStringDesc* LOC27;
		LOC27 = 0;
		{
			if (!(*node).kindU.S4.bval) goto LA30;
			LOC27 = copyString(((NimStringDesc*) &TMP3070));
		}
		goto LA28;
		LA30: ;
		{
			LOC27 = copyString(((NimStringDesc*) &TMP3071));
		}
		LA28: ;
		(*result) = resizeString((*result), LOC27->Sup.len + 0);
appendString((*result), LOC27);
	}
	break;
	case ((NU8) 0):
	{
		(*result) = resizeString((*result), 4);
appendString((*result), ((NimStringDesc*) &TMP3069));
	}
	break;
	}
}

N_NIMCALL(NimStringDesc*, HEX24_330129)(Jsonnodeobj325754* node) {
	NimStringDesc* result;
	NI LOC1;
	result = 0;
	LOC1 = 0;
	LOC1 = len_327106(node);
	result = rawNewString(((NI) ((NI)((NU32)(LOC1) << (NU32)(((NI) 1))))));
	tougly_330058((&result), node);
	return result;
}
NIM_EXTERNC N_NOINLINE(void, stdlib_jsonInit000)(void) {
}

NIM_EXTERNC N_NOINLINE(void, stdlib_jsonDatInit000)(void) {
static TNimNode* TMP3045[6];
static TNimNode* TMP3046[14];
NI TMP3048;
static char* NIM_CONST TMP3047[14] = {
"tkError", 
"tkEof", 
"tkString", 
"tkInt", 
"tkFloat", 
"tkTrue", 
"tkFalse", 
"tkNull", 
"tkCurlyLe", 
"tkCurlyRi", 
"tkBracketLe", 
"tkBracketRi", 
"tkColon", 
"tkComma"};
static TNimNode* TMP3049[12];
NI TMP3051;
static char* NIM_CONST TMP3050[12] = {
"jsonError", 
"jsonEof", 
"jsonString", 
"jsonInt", 
"jsonFloat", 
"jsonTrue", 
"jsonFalse", 
"jsonNull", 
"jsonObjectStart", 
"jsonObjectEnd", 
"jsonArrayStart", 
"jsonArrayEnd"};
static TNimNode* TMP3052[11];
NI TMP3054;
static char* NIM_CONST TMP3053[11] = {
"errNone", 
"errInvalidToken", 
"errStringExpected", 
"errColonExpected", 
"errCommaExpected", 
"errBracketRiExpected", 
"errCurlyRiExpected", 
"errQuoteExpected", 
"errEOC_Expected", 
"errEofExpected", 
"errExprExpected"};
static TNimNode* TMP3055[8];
NI TMP3057;
static char* NIM_CONST TMP3056[8] = {
"stateEof", 
"stateStart", 
"stateObject", 
"stateArray", 
"stateExpectArrayComma", 
"stateExpectObjectComma", 
"stateExpectColon", 
"stateExpectValue"};
static TNimNode* TMP5152[7];
NI TMP5154;
static char* NIM_CONST TMP5153[7] = {
"JNull", 
"JBool", 
"JInt", 
"JFloat", 
"JString", 
"JObject", 
"JArray"};
static TNimNode* TMP5155[2];
static TNimNode TMP965[76];
NTI324013.size = sizeof(Jsonparser324013);
NTI324013.kind = 17;
NTI324013.base = (&NTI282024);
TMP3045[0] = &TMP965[1];
TMP965[1].kind = 1;
TMP965[1].offset = offsetof(Jsonparser324013, a);
TMP965[1].typ = (&NTI149);
TMP965[1].name = "a";
TMP3045[1] = &TMP965[2];
NTI324007.size = sizeof(NU8);
NTI324007.kind = 14;
NTI324007.base = 0;
NTI324007.flags = 3;
for (TMP3048 = 0; TMP3048 < 14; TMP3048++) {
TMP965[TMP3048+3].kind = 1;
TMP965[TMP3048+3].offset = TMP3048;
TMP965[TMP3048+3].name = TMP3047[TMP3048];
TMP3046[TMP3048] = &TMP965[TMP3048+3];
}
TMP965[17].len = 14; TMP965[17].kind = 2; TMP965[17].sons = &TMP3046[0];
NTI324007.node = &TMP965[17];
TMP965[2].kind = 1;
TMP965[2].offset = offsetof(Jsonparser324013, tok);
TMP965[2].typ = (&NTI324007);
TMP965[2].name = "tok";
TMP3045[2] = &TMP965[18];
NTI324005.size = sizeof(NU8);
NTI324005.kind = 14;
NTI324005.base = 0;
NTI324005.flags = 3;
for (TMP3051 = 0; TMP3051 < 12; TMP3051++) {
TMP965[TMP3051+19].kind = 1;
TMP965[TMP3051+19].offset = TMP3051;
TMP965[TMP3051+19].name = TMP3050[TMP3051];
TMP3049[TMP3051] = &TMP965[TMP3051+19];
}
TMP965[31].len = 12; TMP965[31].kind = 2; TMP965[31].sons = &TMP3049[0];
NTI324005.node = &TMP965[31];
TMP965[18].kind = 1;
TMP965[18].offset = offsetof(Jsonparser324013, kind);
TMP965[18].typ = (&NTI324005);
TMP965[18].name = "kind";
TMP3045[3] = &TMP965[32];
NTI324009.size = sizeof(NU8);
NTI324009.kind = 14;
NTI324009.base = 0;
NTI324009.flags = 3;
for (TMP3054 = 0; TMP3054 < 11; TMP3054++) {
TMP965[TMP3054+33].kind = 1;
TMP965[TMP3054+33].offset = TMP3054;
TMP965[TMP3054+33].name = TMP3053[TMP3054];
TMP3052[TMP3054] = &TMP965[TMP3054+33];
}
TMP965[44].len = 11; TMP965[44].kind = 2; TMP965[44].sons = &TMP3052[0];
NTI324009.node = &TMP965[44];
TMP965[32].kind = 1;
TMP965[32].offset = offsetof(Jsonparser324013, err);
TMP965[32].typ = (&NTI324009);
TMP965[32].name = "err";
TMP3045[4] = &TMP965[45];
NTI324011.size = sizeof(NU8);
NTI324011.kind = 14;
NTI324011.base = 0;
NTI324011.flags = 3;
for (TMP3057 = 0; TMP3057 < 8; TMP3057++) {
TMP965[TMP3057+46].kind = 1;
TMP965[TMP3057+46].offset = TMP3057;
TMP965[TMP3057+46].name = TMP3056[TMP3057];
TMP3055[TMP3057] = &TMP965[TMP3057+46];
}
TMP965[54].len = 8; TMP965[54].kind = 2; TMP965[54].sons = &TMP3055[0];
NTI324011.node = &TMP965[54];
NTI324063.size = sizeof(TY324063*);
NTI324063.kind = 24;
NTI324063.base = (&NTI324011);
NTI324063.flags = 2;
NTI324063.marker = TMP3058;
TMP965[45].kind = 1;
TMP965[45].offset = offsetof(Jsonparser324013, state);
TMP965[45].typ = (&NTI324063);
TMP965[45].name = "state";
TMP3045[5] = &TMP965[55];
TMP965[55].kind = 1;
TMP965[55].offset = offsetof(Jsonparser324013, filename);
TMP965[55].typ = (&NTI149);
TMP965[55].name = "filename";
TMP965[0].len = 6; TMP965[0].kind = 2; TMP965[0].sons = &TMP3045[0];
NTI324013.node = &TMP965[0];
NTI325756.size = sizeof(Jsonparsingerror325756);
NTI325756.kind = 17;
NTI325756.base = (&NTI4049);
TMP965[56].len = 0; TMP965[56].kind = 2;
NTI325756.node = &TMP965[56];
NTI325794.size = sizeof(Jsonparsingerror325756*);
NTI325794.kind = 22;
NTI325794.base = (&NTI325756);
NTI325794.marker = TMP3072;
NTI325754.size = sizeof(Jsonnodeobj325754);
NTI325754.kind = 18;
NTI325754.base = 0;
NTI325754.flags = 2;
NTI325750.size = sizeof(NU8);
NTI325750.kind = 14;
NTI325750.base = 0;
NTI325750.flags = 3;
for (TMP5154 = 0; TMP5154 < 7; TMP5154++) {
TMP965[TMP5154+58].kind = 1;
TMP965[TMP5154+58].offset = TMP5154;
TMP965[TMP5154+58].name = TMP5153[TMP5154];
TMP5152[TMP5154] = &TMP965[TMP5154+58];
}
TMP965[65].len = 7; TMP965[65].kind = 2; TMP965[65].sons = &TMP5152[0];
NTI325750.node = &TMP965[65];
TMP965[57].kind = 3;
TMP965[57].offset = offsetof(Jsonnodeobj325754, kind);
TMP965[57].typ = (&NTI325750);
TMP965[57].name = "kind";
TMP965[57].sons = &NimDT_325754_kind[0];
TMP965[57].len = 7;
TMP965[66].kind = 1;
TMP965[66].offset = offsetof(Jsonnodeobj325754, kindU.S1.str);
TMP965[66].typ = (&NTI149);
TMP965[66].name = "str";
NimDT_325754_kind[4] = &TMP965[66];
TMP965[67].kind = 1;
TMP965[67].offset = offsetof(Jsonnodeobj325754, kindU.S2.num);
TMP965[67].typ = (&NTI8112);
TMP965[67].name = "num";
NimDT_325754_kind[2] = &TMP965[67];
TMP965[68].kind = 1;
TMP965[68].offset = offsetof(Jsonnodeobj325754, kindU.S3.fnum);
TMP965[68].typ = (&NTI128);
TMP965[68].name = "fnum";
NimDT_325754_kind[3] = &TMP965[68];
TMP965[69].kind = 1;
TMP965[69].offset = offsetof(Jsonnodeobj325754, kindU.S4.bval);
TMP965[69].typ = (&NTI138);
TMP965[69].name = "bval";
NimDT_325754_kind[1] = &TMP965[69];
TMP965[70].len = 0; TMP965[70].kind = 2;
NimDT_325754_kind[0] = &TMP965[70];
NTI326284.size = sizeof(TY326284);
NTI326284.kind = 18;
NTI326284.base = 0;
NTI326284.flags = 2;
TMP5155[0] = &TMP965[73];
TMP965[73].kind = 1;
TMP965[73].offset = offsetof(TY326284, Field0);
TMP965[73].typ = (&NTI149);
TMP965[73].name = "Field0";
TMP5155[1] = &TMP965[74];
TMP965[74].kind = 1;
TMP965[74].offset = offsetof(TY326284, Field1);
TMP965[74].typ = (&NTI325752);
TMP965[74].name = "Field1";
TMP965[72].len = 2; TMP965[72].kind = 2; TMP965[72].sons = &TMP5155[0];
NTI326284.node = &TMP965[72];
NTI325769.size = sizeof(TY325769*);
NTI325769.kind = 24;
NTI325769.base = (&NTI326284);
NTI325769.flags = 2;
NTI325769.marker = TMP5156;
TMP965[71].kind = 1;
TMP965[71].offset = offsetof(Jsonnodeobj325754, kindU.S6.fields);
TMP965[71].typ = (&NTI325769);
TMP965[71].name = "fields";
NimDT_325754_kind[5] = &TMP965[71];
NTI325774.size = sizeof(TY325774*);
NTI325774.kind = 24;
NTI325774.base = (&NTI325752);
NTI325774.flags = 2;
NTI325774.marker = TMP5157;
TMP965[75].kind = 1;
TMP965[75].offset = offsetof(Jsonnodeobj325754, kindU.S7.elems);
TMP965[75].typ = (&NTI325774);
TMP965[75].name = "elems";
NimDT_325754_kind[6] = &TMP965[75];
NTI325754.node = &TMP965[57];
NTI325752.size = sizeof(Jsonnodeobj325754*);
NTI325752.kind = 22;
NTI325752.base = (&NTI325754);
NTI325752.flags = 2;
NTI325752.marker = TMP5158;
}

