/* Generated by Nim Compiler v0.11.2 */
/*   (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 Tnode191813 Tnode191813;
typedef struct Ttype191849 Ttype191849;
typedef struct Tlineinfo164338 Tlineinfo164338;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym191843 Tsym191843;
typedef struct Tident168021 Tident168021;
typedef struct Tnodeseq191807 Tnodeseq191807;
typedef struct Table382650 Table382650;
typedef struct Keyvaluepairseq382653 Keyvaluepairseq382653;
typedef struct Jsonparser289013 Jsonparser289013;
typedef struct Baselexer247024 Baselexer247024;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Streamobj140027 Streamobj140027;
typedef struct TY289063 TY289063;
typedef struct Stringstreamobj140554 Stringstreamobj140554;
typedef struct Tidobj168015 Tidobj168015;
typedef struct Ttypeseq191845 Ttypeseq191845;
typedef struct Tloc191827 Tloc191827;
typedef struct Ropeobj162009 Ropeobj162009;
typedef struct Tscope191837 Tscope191837;
typedef struct TY191944 TY191944;
typedef struct Tstrtable191817 Tstrtable191817;
typedef struct Tsymseq191815 Tsymseq191815;
typedef struct Tlib191831 Tlib191831;
typedef struct Tcell46346 Tcell46346;
typedef struct Tcellseq46362 Tcellseq46362;
typedef struct Tgcheap48216 Tgcheap48216;
typedef struct Tcellset46358 Tcellset46358;
typedef struct Tpagedesc46354 Tpagedesc46354;
typedef struct Tmemregion28210 Tmemregion28210;
typedef struct Tsmallchunk27440 Tsmallchunk27440;
typedef struct Tllchunk28204 Tllchunk28204;
typedef struct Tbigchunk27442 Tbigchunk27442;
typedef struct Tintset27417 Tintset27417;
typedef struct Ttrunk27413 Ttrunk27413;
typedef struct Tavlnode28208 Tavlnode28208;
typedef struct Tgcstat48214 Tgcstat48214;
typedef struct Intset188056 Intset188056;
typedef struct Ttrunk188052 Ttrunk188052;
typedef struct Ttrunkseq188054 Ttrunkseq188054;
typedef struct TY88145 TY88145;
typedef struct Keyvaluepair382656 Keyvaluepair382656;
typedef struct Tinstantiation191833 Tinstantiation191833;
typedef struct Tlistentry132022 Tlistentry132022;
typedef struct Tbasechunk27438 Tbasechunk27438;
typedef struct Tfreecell27430 Tfreecell27430;
typedef struct TY191933 TY191933;
struct  Tlineinfo164338  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode191813  {
Ttype191849* typ;
Tlineinfo164338 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym191843* sym;
} S4;
struct {Tident168021* ident;
} S5;
struct {Tnodeseq191807* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Table382650  {
Keyvaluepairseq382653* data;
NI counter;
};
typedef N_NIMCALL_PTR(void, TY3289) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3294) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3289 marker;
TY3294 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
struct  Baselexer247024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Streamobj140027* input;
NI linenumber;
NI sentinel;
NI linestart;
NIM_BOOL fileopened;
};
struct  Jsonparser289013  {
  Baselexer247024 Sup;
NimStringDesc* a;
NU8 tok;
NU8 kind;
NU8 err;
TY289063* state;
NimStringDesc* filename;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tidobj168015  {
  TNimObject Sup;
NI id;
};
struct  Tloc191827  {
NU8 k;
NU8 s;
NU16 flags;
Ttype191849* t;
Ropeobj162009* r;
Ropeobj162009* heaproot;
};
struct  Ttype191849  {
  Tidobj168015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq191845* sons;
Tnode191813* n;
Tsym191843* owner;
Tsym191843* sym;
Tsym191843* destructor;
Tsym191843* deepcopy;
Tsym191843* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc191827 loc;
};
struct  Tstrtable191817  {
NI counter;
Tsymseq191815* data;
};
struct  Tsym191843  {
  Tidobj168015 Sup;
NU8 kind;
union{
struct {Ttypeseq191845* typeinstcache;
Tscope191837* typscope;
} S1;
struct {TY191944* procinstcache;
Tsym191843* gcunsafetyreason;
} S2;
struct {TY191944* usedgenerics;
Tstrtable191817 tab;
} S3;
struct {Tsym191843* guard;
} S4;
} kindU;
NU16 magic;
Ttype191849* typ;
Tident168021* name;
Tlineinfo164338 info;
Tsym191843* owner;
NU32 flags;
Tnode191813* ast;
NU32 options;
NI position;
NI offset;
Tloc191827 loc;
Tlib191831* annex;
Tnode191813* constraint;
};
struct  Tident168021  {
  Tidobj168015 Sup;
NimStringDesc* s;
Tident168021* next;
NI h;
};
struct  Tcell46346  {
NI refcount;
TNimType* typ;
};
struct  Tcellseq46362  {
NI len;
NI cap;
Tcell46346** d;
};
struct  Tcellset46358  {
NI counter;
NI max;
Tpagedesc46354* head;
Tpagedesc46354** data;
};
typedef Tsmallchunk27440* TY28222[512];
typedef Ttrunk27413* Ttrunkbuckets27415[256];
struct  Tintset27417  {
Ttrunkbuckets27415 data;
};
struct  Tmemregion28210  {
NI minlargeobj;
NI maxlargeobj;
TY28222 freesmallchunks;
Tllchunk28204* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Tbigchunk27442* freechunkslist;
Tintset27417 chunkstarts;
Tavlnode28208* root;
Tavlnode28208* deleted;
Tavlnode28208* last;
Tavlnode28208* freeavlnodes;
};
struct  Tgcstat48214  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Tgcheap48216  {
void* stackbottom;
NI cyclethreshold;
Tcellseq46362 zct;
Tcellseq46362 decstack;
Tcellset46358 cycleroots;
Tcellseq46362 tempstack;
NI recgclock;
Tmemregion28210 region;
Tgcstat48214 stat;
};
struct  Intset188056  {
NI counter;
NI max;
Ttrunk188052* head;
Ttrunkseq188054* data;
};
struct TY88145 {
NimStringDesc* Field0;
NI Field1;
};
struct Keyvaluepair382656 {
NI Field0;
NI64 Field1;
Tnode191813* Field2;
};
typedef N_NIMCALL_PTR(void, TY140028) (Streamobj140027* s);
typedef N_NIMCALL_PTR(NIM_BOOL, TY140032) (Streamobj140027* s);
typedef N_NIMCALL_PTR(void, TY140036) (Streamobj140027* s, NI pos);
typedef N_NIMCALL_PTR(NI, TY140041) (Streamobj140027* s);
typedef N_NIMCALL_PTR(NI, TY140045) (Streamobj140027* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(void, TY140051) (Streamobj140027* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(void, TY140057) (Streamobj140027* s);
struct  Streamobj140027  {
  TNimObject Sup;
TY140028 closeimpl;
TY140032 atendimpl;
TY140036 setpositionimpl;
TY140041 getpositionimpl;
TY140045 readdataimpl;
TY140051 writedataimpl;
TY140057 flushimpl;
};
struct  Stringstreamobj140554  {
  Streamobj140027 Sup;
NimStringDesc* data;
NI pos;
};
struct  Ropeobj162009  {
  TNimObject Sup;
Ropeobj162009* left;
Ropeobj162009* right;
NI length;
NimStringDesc* data;
};
struct  Tscope191837  {
NI depthlevel;
Tstrtable191817 symbols;
Tnodeseq191807* usingsyms;
Tscope191837* parent;
};
struct  Tlistentry132022  {
  TNimObject Sup;
Tlistentry132022* prev;
Tlistentry132022* next;
};
struct  Tlib191831  {
  Tlistentry132022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj162009* name;
Tnode191813* path;
};
typedef NI TY27420[16];
struct  Tpagedesc46354  {
Tpagedesc46354* next;
NI key;
TY27420 bits;
};
struct  Tbasechunk27438  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Tsmallchunk27440  {
  Tbasechunk27438 Sup;
Tsmallchunk27440* next;
Tsmallchunk27440* prev;
Tfreecell27430* freelist;
NI free;
NI acc;
NF data;
};
struct  Tllchunk28204  {
NI size;
NI acc;
Tllchunk28204* next;
};
struct  Tbigchunk27442  {
  Tbasechunk27438 Sup;
Tbigchunk27442* next;
Tbigchunk27442* prev;
NI align;
NF data;
};
struct  Ttrunk27413  {
Ttrunk27413* next;
NI key;
TY27420 bits;
};
typedef Tavlnode28208* TY28214[2];
struct  Tavlnode28208  {
TY28214 link;
NI key;
NI upperbound;
NI level;
};
struct  Ttrunk188052  {
Ttrunk188052* next;
NI key;
TY27420 bits;
};
struct  Tinstantiation191833  {
Tsym191843* sym;
Ttypeseq191845* concretetypes;
TY191933* usedby;
};
struct  Tfreecell27430  {
Tfreecell27430* next;
NI zerofield;
};
struct Tnodeseq191807 {
  TGenericSeq Sup;
  Tnode191813* data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq382653 {
  TGenericSeq Sup;
  Keyvaluepair382656 data[SEQ_DECL_SIZE];
};
struct TY289063 {
  TGenericSeq Sup;
  NU8 data[SEQ_DECL_SIZE];
};
struct Ttypeseq191845 {
  TGenericSeq Sup;
  Ttype191849* data[SEQ_DECL_SIZE];
};
struct TY191944 {
  TGenericSeq Sup;
  Tinstantiation191833* data[SEQ_DECL_SIZE];
};
struct Tsymseq191815 {
  TGenericSeq Sup;
  Tsym191843* data[SEQ_DECL_SIZE];
};
struct Ttrunkseq188054 {
  TGenericSeq Sup;
  Ttrunk188052* data[SEQ_DECL_SIZE];
};
struct TY191933 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, inittable_383469)(NI initialsize, Table382650* Result);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, open_289090)(Jsonparser289013* my, Streamobj140027* input, NimStringDesc* filename);
N_NIMCALL(Stringstreamobj140554*, newstringstream_140671)(NimStringDesc* s);
N_NIMCALL(void, next_290418)(Jsonparser289013* my);
N_NIMCALL(Tnode191813*, loadany_382639)(Jsonparser289013* p, Ttype191849* t, Table382650* tab);
static N_INLINE(NU8, kind_289607)(Jsonparser289013* my);
N_NIMCALL(Tnode191813*, newintnode_192608)(NU8 kind, NI64 intval);
N_NOINLINE(void, raiseparseerr_290758)(Jsonparser289013* p, NimStringDesc* msg);
static N_INLINE(NimStringDesc*, str_289125)(Jsonparser289013* my);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(NI64, getint_289207)(Jsonparser289013* my);
N_NIMCALL(NI64, nsuParseBiggestInt)(NimStringDesc* s);
static N_INLINE(NI, len_192097)(Tnode191813* n);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(Tnode191813*, newnode_192401)(NU8 kind);
N_NIMCALL(void, add_192164)(Tnode191813* father, Tnode191813* son);
N_NIMCALL(Ttype191849*, elemtype_221522)(Ttype191849* t);
N_NIMCALL(NI, len_194377)(Ttype191849* n);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, typetostring_221032)(Ttype191849* typ, NU8 prefer);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Tcell46346*, usrtocell_49846)(void* usr);
static N_INLINE(void, rtladdzct_51404)(Tcell46346* c);
N_NOINLINE(void, addzct_49817)(Tcellseq46362* s, Tcell46346* c);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
N_NIMCALL(Tsym191843*, lookupinrecord_199236)(Tnode191813* n, Tident168021* field);
N_NIMCALL(Tident168021*, getident_168463)(NimStringDesc* identifier);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Ttype191849*, lastson_194442)(Ttype191849* n);
N_NIMCALL(Tnode191813*, HEX5BHEX5D_383098)(Table382650 t, NI64 key);
N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x);
N_NIMCALL(void, HEX5BHEX5DHEX3D_383161)(Table382650* t, NI64 key, Tnode191813* val);
N_NIMCALL(Tnode191813*, newstrnode_192644)(NU8 kind, NimStringDesc* strval);
N_NIMCALL(Tnode191813*, newfloatnode_192632)(NU8 kind, NF floatval);
static N_INLINE(NF, getfloat_289407)(Jsonparser289013* my);
N_NIMCALL(NF, nsuParseFloat)(NimStringDesc* s);
N_NIMCALL(void, internalerror_166218)(NimStringDesc* errmsg);
static N_INLINE(void, close_289115)(Jsonparser289013* my);
N_NIMCALL(void, close_247050)(Baselexer247024* L);
N_NIMCALL(void, initintset_188927)(Intset188056* Result);
N_NIMCALL(void, storeany_382137)(NimStringDesc** s, Ttype191849* t, Tnode191813* a, Intset188056* stored);
N_NIMCALL(NimStringDesc*, nimBoolToStr)(NIM_BOOL x);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NimStringDesc*, escapejson_294295)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, nimCharToStr)(NIM_CHAR x);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
static N_INLINE(Tnode191813*, HEX5BHEX5D_192244)(Tnode191813* n, NI i);
N_NIMCALL(Tnode191813*, skipcolon_382277)(Tnode191813* n);
N_NIMCALL(void, storeobj_382148)(NimStringDesc** s, Ttype191849* typ, Tnode191813* x, Intset188056* stored);
N_NIMCALL(NimStringDesc*, HEX24_166306)(TY88145 x);
N_NIMCALL(NI, sonslen_194403)(Tnode191813* n);
N_NIMCALL(Tsym191843*, getfield_382023)(Tnode191813* n, NI position);
N_NIMCALL(Tnode191813*, lastson_194431)(Tnode191813* n);
N_NIMCALL(void, internalerror_166199)(Tlineinfo164338 info, NimStringDesc* errmsg);
N_NIMCALL(Tnode191813*, copynode_195640)(Tnode191813* src);
N_NIMCALL(NIM_BOOL, containsorincl_188898)(Intset188056* s, NI key);
static N_INLINE(NI, ptrtoint_382012)(Tnode191813* x);
N_NIMCALL(NimStringDesc*, nimFloatToStr)(NF f);
STRING_LITERAL(TMP2937, "unknown file", 12);
STRING_LITERAL(TMP2946, "\'true\' or \'false\' expected for a bool", 37);
STRING_LITERAL(TMP2947, "string of length 1 expected for a char", 38);
STRING_LITERAL(TMP2948, "string expected for an enum", 27);
STRING_LITERAL(TMP2949, "\'[\' expected for an array", 25);
STRING_LITERAL(TMP2950, "\']\' end of array expected", 25);
STRING_LITERAL(TMP2951, "", 0);
STRING_LITERAL(TMP2952, "\'[\' expected for a seq", 22);
STRING_LITERAL(TMP2953, "\'{\' expected for an object", 26);
STRING_LITERAL(TMP2954, "string expected for a field name", 32);
STRING_LITERAL(TMP2955, "too many fields to tuple type ", 30);
STRING_LITERAL(TMP2956, "\'}\' end of object expected", 26);
STRING_LITERAL(TMP2960, "unknown field for object of type ", 33);
STRING_LITERAL(TMP2961, "\'[\' expected for a set", 22);
STRING_LITERAL(TMP2962, "cannot load object with address ", 32);
STRING_LITERAL(TMP2963, "index for ref type expected", 27);
STRING_LITERAL(TMP2964, "\']\' end of ref-address pair expected", 36);
STRING_LITERAL(TMP2965, "int for pointer type expected", 29);
STRING_LITERAL(TMP2966, "string expected", 15);
STRING_LITERAL(TMP2967, "int expected", 12);
STRING_LITERAL(TMP2968, "float expected", 14);
STRING_LITERAL(TMP2969, "cannot marshal at compile-time ", 31);
STRING_LITERAL(TMP2976, "null", 4);
STRING_LITERAL(TMP2977, "[", 1);
STRING_LITERAL(TMP2978, ", ", 2);
STRING_LITERAL(TMP2979, "]", 1);
STRING_LITERAL(TMP2980, "{", 1);
STRING_LITERAL(TMP2981, "\"Field", 6);
STRING_LITERAL(TMP2982, "\": ", 3);
STRING_LITERAL(TMP2983, "}", 1);
STRING_LITERAL(TMP2985, "vmmarshal.nim", 13);
NIM_CONST TY88145 TMP2984 = {((NimStringDesc*) &TMP2985),
((NI) 39)}
;
NIM_CONST TY88145 TMP2986 = {((NimStringDesc*) &TMP2985),
((NI) 45)}
;
STRING_LITERAL(TMP2987, ": ", 2);
STRING_LITERAL(TMP2988, "getField(record case branch)", 28);
extern TNimType NTI289013; /* JsonParser */
extern TNimType NTI191807; /* TNodeSeq */
extern Tgcheap48216 gch_48244;

N_NIMCALL(Tnode191813*, skipcolon_382277)(Tnode191813* n) {
	Tnode191813* result;
	result = 0;
	result = n;
	{
		if (!((*n).kind == ((NU8) 34))) goto LA3;
		result = (*n).kindU.S6.sons->data[((NI) 1)];
	}
	LA3: ;
	return result;
}

static N_INLINE(NU8, kind_289607)(Jsonparser289013* my) {
	NU8 result;
{	result = 0;
	result = (*my).kind;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

static N_INLINE(NimStringDesc*, str_289125)(Jsonparser289013* my) {
	NimStringDesc* result;
{	result = 0;
	result = copyString((*my).a);
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

static N_INLINE(NI64, getint_289207)(Jsonparser289013* my) {
	NI64 result;
{	result = 0;
	result = nsuParseBiggestInt((*my).a);
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

static N_INLINE(NI, len_192097)(Tnode191813* n) {
	NI result;
	result = 0;
	{
		if (!(*n).kindU.S6.sons == 0) goto LA3;
		result = ((NI) 0);
	}
	goto LA1;
	LA3: ;
	{
		result = ((*n).kindU.S6.sons ? (*n).kindU.S6.sons->Sup.len : 0);
	}
	LA1: ;
	return result;
}

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;
}

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;
}

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

static N_INLINE(void, rtladdzct_51404)(Tcell46346* c) {
	addzct_49817((&gch_48244.zct), c);
}

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

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

static N_INLINE(NF, getfloat_289407)(Jsonparser289013* my) {
	NF result;
{	result = 0;
	result = nsuParseFloat((*my).a);
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

N_NIMCALL(Tnode191813*, loadany_382639)(Jsonparser289013* p, Ttype191849* t, Table382650* tab) {
	Tnode191813* result;
{	result = 0;
	switch ((*t).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		NU8 LOC3;
		LOC3 = 0;
		LOC3 = kind_289607((&(*p)));
		switch (LOC3) {
		case ((NU8) 6):
		{
			result = newintnode_192608(((NU8) 6), IL64(0));
		}
		break;
		case ((NU8) 5):
		{
			result = newintnode_192608(((NU8) 6), IL64(1));
		}
		break;
		default:
		{
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2946));
		}
		break;
		}
		next_290418(p);
	}
	break;
	case ((NU8) 2):
	{
		{
			NU8 LOC10;
			NimStringDesc* x;
			LOC10 = 0;
			LOC10 = kind_289607((&(*p)));
			if (!(LOC10 == ((NU8) 2))) goto LA11;
			x = str_289125((&(*p)));
			{
				if (!((x ? x->Sup.len : 0) == ((NI) 1))) goto LA15;
				result = newintnode_192608(((NU8) 6), ((NI64) (((NU8)(x->data[((NI) 0)])))));
				next_290418(p);
				goto BeforeRet;
			}
			LA15: ;
		}
		goto LA8;
		LA11: ;
		{
			NU8 LOC18;
			NI64 LOC21;
			LOC18 = 0;
			LOC18 = kind_289607((&(*p)));
			if (!(LOC18 == ((NU8) 3))) goto LA19;
			LOC21 = 0;
			LOC21 = getint_289207((&(*p)));
			result = newintnode_192608(((NU8) 6), LOC21);
			next_290418(p);
			goto BeforeRet;
		}
		goto LA8;
		LA19: ;
		LA8: ;
		raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2947));
	}
	break;
	case ((NU8) 14):
	{
		{
			NU8 LOC25;
			LOC25 = 0;
			LOC25 = kind_289607((&(*p)));
			if (!(LOC25 == ((NU8) 2))) goto LA26;
			{
				Tnode191813* e_382837;
				Tnode191813* HEX3Atmp_383399;
				e_382837 = 0;
				HEX3Atmp_383399 = 0;
				HEX3Atmp_383399 = (*t).n;
				{
					NI i_383403;
					NI HEX3Atmp_383405;
					NI LOC30;
					NI res_383407;
					i_383403 = 0;
					HEX3Atmp_383405 = 0;
					LOC30 = 0;
					LOC30 = len_192097(HEX3Atmp_383399);
					HEX3Atmp_383405 = (LOC30 - 1);
					res_383407 = ((NI) 0);
					{
						while (1) {
							if (!(res_383407 <= HEX3Atmp_383405)) goto LA32;
							i_383403 = res_383407;
							e_382837 = (*HEX3Atmp_383399).kindU.S6.sons->data[i_383403];
							{
								NimStringDesc* LOC35;
								LOC35 = 0;
								LOC35 = str_289125((&(*p)));
								if (!eqStrings((*(*(*e_382837).kindU.S4.sym).name).s, LOC35)) goto LA36;
								result = newintnode_192608(((NU8) 6), ((NI64) ((*(*e_382837).kindU.S4.sym).position)));
								next_290418(p);
								goto BeforeRet;
							}
							LA36: ;
							res_383407 += ((NI) 1);
						} LA32: ;
					}
				}
			}
		}
		LA26: ;
		raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2948));
	}
	break;
	case ((NU8) 16):
	{
		{
			NU8 LOC41;
			LOC41 = 0;
			LOC41 = kind_289607((&(*p)));
			if (!!((LOC41 == ((NU8) 10)))) goto LA42;
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2949));
		}
		LA42: ;
		next_290418(p);
		result = newnode_192401(((NU8) 41));
		{
			while (1) {
				NIM_BOOL LOC46;
				NU8 LOC47;
				NU8 LOC49;
				Ttype191849* LOC50;
				Tnode191813* LOC51;
				LOC46 = 0;
				LOC47 = 0;
				LOC47 = kind_289607((&(*p)));
				LOC46 = !((LOC47 == ((NU8) 11)));
				if (!(LOC46)) goto LA48;
				LOC49 = 0;
				LOC49 = kind_289607((&(*p)));
				LOC46 = !((LOC49 == ((NU8) 1)));
				LA48: ;
				if (!LOC46) goto LA45;
				LOC50 = 0;
				LOC50 = elemtype_221522(t);
				LOC51 = 0;
				LOC51 = loadany_382639(p, LOC50, tab);
				add_192164(result, LOC51);
			} LA45: ;
		}
		{
			NU8 LOC54;
			LOC54 = 0;
			LOC54 = kind_289607((&(*p)));
			if (!(LOC54 == ((NU8) 11))) goto LA55;
			next_290418(p);
		}
		goto LA52;
		LA55: ;
		{
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2950));
		}
		LA52: ;
	}
	break;
	case ((NU8) 24):
	{
		NU8 LOC59;
		LOC59 = 0;
		LOC59 = kind_289607((&(*p)));
		switch (LOC59) {
		case ((NU8) 7):
		{
			result = newnode_192401(((NU8) 23));
			next_290418(p);
		}
		break;
		case ((NU8) 10):
		{
			next_290418(p);
			result = newnode_192401(((NU8) 41));
			{
				while (1) {
					NIM_BOOL LOC64;
					NU8 LOC65;
					NU8 LOC67;
					Ttype191849* LOC68;
					Tnode191813* LOC69;
					LOC64 = 0;
					LOC65 = 0;
					LOC65 = kind_289607((&(*p)));
					LOC64 = !((LOC65 == ((NU8) 11)));
					if (!(LOC64)) goto LA66;
					LOC67 = 0;
					LOC67 = kind_289607((&(*p)));
					LOC64 = !((LOC67 == ((NU8) 1)));
					LA66: ;
					if (!LOC64) goto LA63;
					LOC68 = 0;
					LOC68 = elemtype_221522(t);
					LOC69 = 0;
					LOC69 = loadany_382639(p, LOC68, tab);
					add_192164(result, LOC69);
				} LA63: ;
			}
			{
				NU8 LOC72;
				LOC72 = 0;
				LOC72 = kind_289607((&(*p)));
				if (!(LOC72 == ((NU8) 11))) goto LA73;
				next_290418(p);
			}
			goto LA70;
			LA73: ;
			{
				raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2951));
			}
			LA70: ;
		}
		break;
		default:
		{
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2952));
		}
		break;
		}
	}
	break;
	case ((NU8) 18):
	{
		NI i;
		{
			NU8 LOC80;
			LOC80 = 0;
			LOC80 = kind_289607((&(*p)));
			if (!!((LOC80 == ((NU8) 8)))) goto LA81;
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2953));
		}
		LA81: ;
		next_290418(p);
		result = newnode_192401(((NU8) 37));
		i = ((NI) 0);
		{
			while (1) {
				NIM_BOOL LOC85;
				NU8 LOC86;
				NU8 LOC88;
				Tnode191813* LOC101;
				LOC85 = 0;
				LOC86 = 0;
				LOC86 = kind_289607((&(*p)));
				LOC85 = !((LOC86 == ((NU8) 9)));
				if (!(LOC85)) goto LA87;
				LOC88 = 0;
				LOC88 = kind_289607((&(*p)));
				LOC85 = !((LOC88 == ((NU8) 1)));
				LA87: ;
				if (!LOC85) goto LA84;
				{
					NU8 LOC91;
					LOC91 = 0;
					LOC91 = kind_289607((&(*p)));
					if (!!((LOC91 == ((NU8) 2)))) goto LA92;
					raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2954));
				}
				LA92: ;
				next_290418(p);
				{
					NI LOC96;
					NimStringDesc* LOC99;
					NimStringDesc* LOC100;
					LOC96 = 0;
					LOC96 = len_194377(t);
					if (!(LOC96 <= i)) goto LA97;
					LOC99 = 0;
					LOC100 = 0;
					LOC100 = typetostring_221032(t, ((NU8) 0));
					LOC99 = rawNewString(LOC100->Sup.len + 30);
appendString(LOC99, ((NimStringDesc*) &TMP2955));
appendString(LOC99, LOC100);
					raiseparseerr_290758((&(*p)), LOC99);
				}
				LA97: ;
				LOC101 = 0;
				LOC101 = loadany_382639(p, (*t).sons->data[i], tab);
				add_192164(result, LOC101);
				i += ((NI) 1);
			} LA84: ;
		}
		{
			NU8 LOC104;
			LOC104 = 0;
			LOC104 = kind_289607((&(*p)));
			if (!(LOC104 == ((NU8) 9))) goto LA105;
			next_290418(p);
		}
		goto LA102;
		LA105: ;
		{
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2956));
		}
		LA102: ;
	}
	break;
	case ((NU8) 17):
	{
		{
			NU8 LOC111;
			LOC111 = 0;
			LOC111 = kind_289607((&(*p)));
			if (!!((LOC111 == ((NU8) 8)))) goto LA112;
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2953));
		}
		LA112: ;
		next_290418(p);
		result = newnode_192401(((NU8) 37));
		if ((*result).kindU.S6.sons) nimGCunrefNoCycle((*result).kindU.S6.sons);
		(*result).kindU.S6.sons = (Tnodeseq191807*) newSeqRC1((&NTI191807), 0);
		{
			while (1) {
				NIM_BOOL LOC116;
				NU8 LOC117;
				NU8 LOC119;
				Tsym191843* field;
				NimStringDesc* LOC125;
				Tident168021* LOC126;
				LOC116 = 0;
				LOC117 = 0;
				LOC117 = kind_289607((&(*p)));
				LOC116 = !((LOC117 == ((NU8) 9)));
				if (!(LOC116)) goto LA118;
				LOC119 = 0;
				LOC119 = kind_289607((&(*p)));
				LOC116 = !((LOC119 == ((NU8) 1)));
				LA118: ;
				if (!LOC116) goto LA115;
				{
					NU8 LOC122;
					LOC122 = 0;
					LOC122 = kind_289607((&(*p)));
					if (!!((LOC122 == ((NU8) 2)))) goto LA123;
					raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2954));
				}
				LA123: ;
				LOC125 = 0;
				LOC125 = str_289125((&(*p)));
				LOC126 = 0;
				LOC126 = getident_168463(LOC125);
				field = lookupinrecord_199236((*t).n, LOC126);
				{
					NimStringDesc* LOC131;
					NimStringDesc* LOC132;
					if (!field == 0) goto LA129;
					LOC131 = 0;
					LOC132 = 0;
					LOC132 = typetostring_221032(t, ((NU8) 0));
					LOC131 = rawNewString(LOC132->Sup.len + 33);
appendString(LOC131, ((NimStringDesc*) &TMP2960));
appendString(LOC131, LOC132);
					raiseparseerr_290758((&(*p)), LOC131);
				}
				LA129: ;
				next_290418(p);
				{
					if (!(((*result).kindU.S6.sons ? (*result).kindU.S6.sons->Sup.len : 0) <= (*field).position)) goto LA135;
					(*result).kindU.S6.sons = (Tnodeseq191807*) setLengthSeq(&((*result).kindU.S6.sons)->Sup, sizeof(Tnode191813*), ((NI) ((NI)((*field).position + ((NI) 1)))));
				}
				LA135: ;
				asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[(*field).position]), loadany_382639(p, (*field).typ, tab));
			} LA115: ;
		}
		{
			NU8 LOC139;
			LOC139 = 0;
			LOC139 = kind_289607((&(*p)));
			if (!(LOC139 == ((NU8) 9))) goto LA140;
			next_290418(p);
		}
		goto LA137;
		LA140: ;
		{
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2956));
		}
		LA137: ;
	}
	break;
	case ((NU8) 19):
	{
		{
			NU8 LOC146;
			LOC146 = 0;
			LOC146 = kind_289607((&(*p)));
			if (!!((LOC146 == ((NU8) 10)))) goto LA147;
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2961));
		}
		LA147: ;
		next_290418(p);
		result = newnode_192401(((NU8) 39));
		{
			while (1) {
				NIM_BOOL LOC151;
				NU8 LOC152;
				NU8 LOC154;
				Ttype191849* LOC155;
				Tnode191813* LOC156;
				LOC151 = 0;
				LOC152 = 0;
				LOC152 = kind_289607((&(*p)));
				LOC151 = !((LOC152 == ((NU8) 11)));
				if (!(LOC151)) goto LA153;
				LOC154 = 0;
				LOC154 = kind_289607((&(*p)));
				LOC151 = !((LOC154 == ((NU8) 1)));
				LA153: ;
				if (!LOC151) goto LA150;
				LOC155 = 0;
				LOC155 = lastson_194442(t);
				LOC156 = 0;
				LOC156 = loadany_382639(p, LOC155, tab);
				add_192164(result, LOC156);
				next_290418(p);
			} LA150: ;
		}
		{
			NU8 LOC159;
			LOC159 = 0;
			LOC159 = kind_289607((&(*p)));
			if (!(LOC159 == ((NU8) 11))) goto LA160;
			next_290418(p);
		}
		goto LA157;
		LA160: ;
		{
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2950));
		}
		LA157: ;
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	{
		NU8 LOC164;
		LOC164 = 0;
		LOC164 = kind_289607((&(*p)));
		switch (LOC164) {
		case ((NU8) 7):
		{
			result = newnode_192401(((NU8) 23));
			next_290418(p);
		}
		break;
		case ((NU8) 3):
		{
			NI64 LOC167;
			LOC167 = 0;
			LOC167 = getint_289207((&(*p)));
			result = HEX5BHEX5D_383098((*tab), LOC167);
			{
				NimStringDesc* LOC172;
				NI64 LOC173;
				NimStringDesc* LOC174;
				if (!result == 0) goto LA170;
				LOC172 = 0;
				LOC173 = 0;
				LOC173 = getint_289207((&(*p)));
				LOC174 = 0;
				LOC174 = nimInt64ToStr(LOC173);
				LOC172 = rawNewString(LOC174->Sup.len + 32);
appendString(LOC172, ((NimStringDesc*) &TMP2962));
appendString(LOC172, LOC174);
				raiseparseerr_290758((&(*p)), LOC172);
			}
			LA170: ;
			next_290418(p);
		}
		break;
		case ((NU8) 10):
		{
			next_290418(p);
			{
				NU8 LOC178;
				NI64 idx;
				Ttype191849* LOC181;
				LOC178 = 0;
				LOC178 = kind_289607((&(*p)));
				if (!(LOC178 == ((NU8) 3))) goto LA179;
				idx = getint_289207((&(*p)));
				next_290418(p);
				LOC181 = 0;
				LOC181 = lastson_194442(t);
				result = loadany_382639(p, LOC181, tab);
				HEX5BHEX5DHEX3D_383161(tab, idx, result);
			}
			goto LA176;
			LA179: ;
			{
				raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2963));
			}
			LA176: ;
			{
				NU8 LOC185;
				LOC185 = 0;
				LOC185 = kind_289607((&(*p)));
				if (!(LOC185 == ((NU8) 11))) goto LA186;
				next_290418(p);
			}
			goto LA183;
			LA186: ;
			{
				raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2964));
			}
			LA183: ;
		}
		break;
		default:
		{
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2965));
		}
		break;
		}
	}
	break;
	case ((NU8) 28):
	case ((NU8) 29):
	{
		NU8 LOC191;
		LOC191 = 0;
		LOC191 = kind_289607((&(*p)));
		switch (LOC191) {
		case ((NU8) 7):
		{
			result = newnode_192401(((NU8) 23));
			next_290418(p);
		}
		break;
		case ((NU8) 2):
		{
			NimStringDesc* LOC194;
			LOC194 = 0;
			LOC194 = str_289125((&(*p)));
			result = newstrnode_192644(((NU8) 20), LOC194);
			next_290418(p);
		}
		break;
		default:
		{
			raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2966));
		}
		break;
		}
	}
	break;
	case ((NU8) 31) ... ((NU8) 35):
	case ((NU8) 40) ... ((NU8) 44):
	{
		{
			NU8 LOC199;
			NI64 LOC202;
			LOC199 = 0;
			LOC199 = kind_289607((&(*p)));
			if (!(LOC199 == ((NU8) 3))) goto LA200;
			LOC202 = 0;
			LOC202 = getint_289207((&(*p)));
			result = newintnode_192608(((NU8) 6), LOC202);
			next_290418(p);
			goto BeforeRet;
		}
		LA200: ;
		raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2967));
	}
	break;
	case ((NU8) 36) ... ((NU8) 39):
	{
		{
			NU8 LOC206;
			NF LOC209;
			LOC206 = 0;
			LOC206 = kind_289607((&(*p)));
			if (!(LOC206 == ((NU8) 4))) goto LA207;
			LOC209 = 0;
			LOC209 = getfloat_289407((&(*p)));
			result = newfloatnode_192632(((NU8) 16), LOC209);
			next_290418(p);
			goto BeforeRet;
		}
		LA207: ;
		raiseparseerr_290758((&(*p)), ((NimStringDesc*) &TMP2968));
	}
	break;
	case ((NU8) 20):
	case ((NU8) 11):
	{
		Ttype191849* LOC211;
		LOC211 = 0;
		LOC211 = lastson_194442(t);
		result = loadany_382639(p, LOC211, tab);
	}
	break;
	default:
	{
		NimStringDesc* LOC213;
		NimStringDesc* LOC214;
		LOC213 = 0;
		LOC214 = 0;
		LOC214 = typetostring_221032(t, ((NU8) 0));
		LOC213 = rawNewString(LOC214->Sup.len + 31);
appendString(LOC213, ((NimStringDesc*) &TMP2969));
appendString(LOC213, LOC214);
		internalerror_166218(LOC213);
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

static N_INLINE(void, close_289115)(Jsonparser289013* my) {
	Baselexer247024* LOC1;
	LOC1 = 0;
	LOC1 = &my->Sup;
	close_247050(LOC1);
}

N_NIMCALL(Tnode191813*, loadany_383463)(NimStringDesc* s, Ttype191849* t) {
	Tnode191813* result;
	Table382650 tab;
	Jsonparser289013 p;
	Stringstreamobj140554* LOC1;
	Streamobj140027* LOC2;
	result = 0;
	memset((void*)(&tab), 0, sizeof(tab));
	chckNil((void*)(&tab));
	memset((void*)(&tab), 0, sizeof(tab));
	inittable_383469(((NI) 64), (&tab));
	memset((void*)(&p), 0, sizeof(p));
	p.Sup.Sup.m_type = (&NTI289013);
	LOC1 = 0;
	LOC1 = newstringstream_140671(s);
	LOC2 = 0;
	LOC2 = &LOC1->Sup;
	open_289090((&p), LOC2, ((NimStringDesc*) &TMP2937));
	next_290418((&p));
	result = loadany_382639((&p), t, (&tab));
	close_289115((&p));
	return result;
}

static N_INLINE(Tnode191813*, HEX5BHEX5D_192244)(Tnode191813* n, NI i) {
	Tnode191813* result;
	result = 0;
	result = (*n).kindU.S6.sons->data[i];
	return result;
}

N_NIMCALL(Tsym191843*, getfield_382023)(Tnode191813* n, NI position) {
	Tsym191843* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 138):
	{
		{
			NI i_382040;
			NI HEX3Atmp_382098;
			NI LOC3;
			NI res_382101;
			i_382040 = 0;
			HEX3Atmp_382098 = 0;
			LOC3 = 0;
			LOC3 = sonslen_194403(n);
			HEX3Atmp_382098 = (NI)(LOC3 - ((NI) 1));
			res_382101 = ((NI) 0);
			{
				while (1) {
					if (!(res_382101 <= HEX3Atmp_382098)) goto LA5;
					i_382040 = res_382101;
					result = getfield_382023((*n).kindU.S6.sons->data[i_382040], position);
					{
						if (!!((result == NIM_NIL))) goto LA8;
						goto BeforeRet;
					}
					LA8: ;
					res_382101 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 139):
	{
		result = getfield_382023((*n).kindU.S6.sons->data[((NI) 0)], position);
		{
			if (!!((result == NIM_NIL))) goto LA13;
			goto BeforeRet;
		}
		LA13: ;
		{
			NI i_382079;
			NI HEX3Atmp_382106;
			NI LOC16;
			NI res_382109;
			i_382079 = 0;
			HEX3Atmp_382106 = 0;
			LOC16 = 0;
			LOC16 = sonslen_194403(n);
			HEX3Atmp_382106 = (NI)(LOC16 - ((NI) 1));
			res_382109 = ((NI) 1);
			{
				while (1) {
					if (!(res_382109 <= HEX3Atmp_382106)) goto LA18;
					i_382079 = res_382109;
					switch ((*(*n).kindU.S6.sons->data[i_382079]).kind) {
					case ((NU8) 85):
					case ((NU8) 88):
					{
						Tnode191813* LOC20;
						LOC20 = 0;
						LOC20 = lastson_194431((*n).kindU.S6.sons->data[i_382079]);
						result = getfield_382023(LOC20, position);
						{
							if (!!((result == NIM_NIL))) goto LA23;
							goto BeforeRet;
						}
						LA23: ;
					}
					break;
					default:
					{
						internalerror_166199((*n).info, ((NimStringDesc*) &TMP2988));
					}
					break;
					}
					res_382109 += ((NI) 1);
				} LA18: ;
			}
		}
	}
	break;
	case ((NU8) 3):
	{
		{
			if (!((*(*n).kindU.S4.sym).position == position)) goto LA29;
			result = (*n).kindU.S4.sym;
		}
		LA29: ;
	}
	break;
	default:
	{
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

N_NIMCALL(void, storeobj_382148)(NimStringDesc** s, Ttype191849* typ, Tnode191813* x, Intset188056* stored) {
	NI start;
	{
		NimStringDesc* LOC5;
		if (!!(((*x).kind == ((NU8) 38) || (*x).kind == ((NU8) 37)))) goto LA3;
		LOC5 = 0;
		LOC5 = HEX24_166306(TMP2984);
		internalerror_166218(LOC5);
	}
	LA3: ;
	start = ((*x).kind == ((NU8) 38));
	{
		NI i_382204;
		NI HEX3Atmp_382255;
		NI LOC7;
		NI res_382258;
		i_382204 = 0;
		HEX3Atmp_382255 = 0;
		LOC7 = 0;
		LOC7 = sonslen_194403(x);
		HEX3Atmp_382255 = (NI)(LOC7 - ((NI) 1));
		res_382258 = ((NI) (start));
		{
			while (1) {
				Tnode191813* it;
				if (!(res_382258 <= HEX3Atmp_382255)) goto LA9;
				i_382204 = res_382258;
				{
					if (!(((NI) (start)) < i_382204)) goto LA12;
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP2978));
				}
				LA12: ;
				it = (*x).kindU.S6.sons->data[i_382204];
				{
					Tsym191843* field;
					NimStringDesc* LOC23;
					if (!((*it).kind == ((NU8) 34))) goto LA16;
					{
						NimStringDesc* LOC22;
						if (!!(((*(*it).kindU.S6.sons->data[((NI) 0)]).kind == ((NU8) 3)))) goto LA20;
						LOC22 = 0;
						LOC22 = HEX24_166306(TMP2986);
						internalerror_166218(LOC22);
					}
					LA20: ;
					field = (*(*it).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym;
					LOC23 = 0;
					LOC23 = escapejson_294295((*(*field).name).s);
					(*s) = resizeString((*s), LOC23->Sup.len + 0);
appendString((*s), LOC23);
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP2987));
					storeany_382137(s, (*field).typ, (*it).kindU.S6.sons->data[((NI) 1)], stored);
				}
				goto LA14;
				LA16: ;
				{
					Tsym191843* field;
					NimStringDesc* LOC27;
					if (!!(((*typ).n == NIM_NIL))) goto LA25;
					field = getfield_382023((*typ).n, i_382204);
					LOC27 = 0;
					LOC27 = escapejson_294295((*(*field).name).s);
					(*s) = resizeString((*s), LOC27->Sup.len + 0);
appendString((*s), LOC27);
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP2987));
					storeany_382137(s, (*field).typ, it, stored);
				}
				goto LA14;
				LA25: ;
				LA14: ;
				res_382258 += ((NI) 1);
			} LA9: ;
		}
	}
}

static N_INLINE(NI, ptrtoint_382012)(Tnode191813* x) {
	NI result;
	result = 0;
	result = ((NI) (x));
	return result;
}

N_NIMCALL(void, storeany_382137)(NimStringDesc** s, Ttype191849* t, Tnode191813* a, Intset188056* stored) {
	switch ((*t).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		NimStringDesc* LOC3;
		LOC3 = 0;
		LOC3 = nimBoolToStr(!(((*a).kindU.S1.intval == IL64(0))));
		(*s) = resizeString((*s), LOC3->Sup.len + 0);
appendString((*s), LOC3);
	}
	break;
	case ((NU8) 2):
	{
		NIM_CHAR ch;
		ch = ((NIM_CHAR) ((*a).kindU.S1.intval));
		{
			NimStringDesc* LOC9;
			NimStringDesc* LOC10;
			if (!((NU8)(ch) < (NU8)(128))) goto LA7;
			LOC9 = 0;
			LOC9 = nimCharToStr(ch);
			LOC10 = 0;
			LOC10 = escapejson_294295(LOC9);
			(*s) = resizeString((*s), LOC10->Sup.len + 0);
appendString((*s), LOC10);
		}
		goto LA5;
		LA7: ;
		{
			NimStringDesc* LOC12;
			LOC12 = 0;
			LOC12 = nimIntToStr(((NI) (((NU8)(ch)))));
			(*s) = resizeString((*s), LOC12->Sup.len + 0);
appendString((*s), LOC12);
		}
		LA5: ;
	}
	break;
	case ((NU8) 16):
	case ((NU8) 24):
	{
		{
			NIM_BOOL LOC16;
			LOC16 = 0;
			LOC16 = ((*t).kind == ((NU8) 24));
			if (!(LOC16)) goto LA17;
			LOC16 = ((*a).kind == ((NU8) 23));
			LA17: ;
			if (!LOC16) goto LA18;
			(*s) = resizeString((*s), 4);
appendString((*s), ((NimStringDesc*) &TMP2976));
		}
		goto LA14;
		LA18: ;
		{
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2977));
			{
				NI i_382433;
				NI HEX3Atmp_382538;
				NI LOC22;
				NI res_382541;
				i_382433 = 0;
				HEX3Atmp_382538 = 0;
				LOC22 = 0;
				LOC22 = len_192097(a);
				HEX3Atmp_382538 = (NI)(LOC22 - ((NI) 1));
				res_382541 = ((NI) 0);
				{
					while (1) {
						Ttype191849* LOC29;
						Tnode191813* LOC30;
						if (!(res_382541 <= HEX3Atmp_382538)) goto LA24;
						i_382433 = res_382541;
						{
							if (!(((NI) 0) < i_382433)) goto LA27;
							(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP2978));
						}
						LA27: ;
						LOC29 = 0;
						LOC29 = elemtype_221522(t);
						LOC30 = 0;
						LOC30 = HEX5BHEX5D_192244(a, i_382433);
						storeany_382137(s, LOC29, LOC30, stored);
						res_382541 += ((NI) 1);
					} LA24: ;
				}
			}
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2979));
		}
		LA14: ;
	}
	break;
	case ((NU8) 18):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2980));
		{
			NI i_382452;
			NI HEX3Atmp_382546;
			NI LOC33;
			NI res_382549;
			i_382452 = 0;
			HEX3Atmp_382546 = 0;
			LOC33 = 0;
			LOC33 = len_194377(t);
			HEX3Atmp_382546 = (LOC33 - 1);
			res_382549 = ((NI) 0);
			{
				while (1) {
					NimStringDesc* LOC40;
					NimStringDesc* LOC41;
					Tnode191813* LOC42;
					Tnode191813* LOC43;
					if (!(res_382549 <= HEX3Atmp_382546)) goto LA35;
					i_382452 = res_382549;
					{
						if (!(((NI) 0) < i_382452)) goto LA38;
						(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP2978));
					}
					LA38: ;
					LOC40 = 0;
					LOC41 = 0;
					LOC41 = nimIntToStr(i_382452);
					LOC40 = rawNewString(LOC41->Sup.len + 6);
appendString(LOC40, ((NimStringDesc*) &TMP2981));
appendString(LOC40, LOC41);
					(*s) = resizeString((*s), LOC40->Sup.len + 0);
appendString((*s), LOC40);
					(*s) = resizeString((*s), 3);
appendString((*s), ((NimStringDesc*) &TMP2982));
					LOC42 = 0;
					LOC42 = HEX5BHEX5D_192244(a, i_382452);
					LOC43 = 0;
					LOC43 = skipcolon_382277(LOC42);
					storeany_382137(s, (*t).sons->data[i_382452], LOC43, stored);
					res_382549 += ((NI) 1);
				} LA35: ;
			}
		}
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2983));
	}
	break;
	case ((NU8) 17):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2980));
		storeobj_382148(s, t, a, stored);
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2983));
	}
	break;
	case ((NU8) 19):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2977));
		{
			NI i_382473;
			NI HEX3Atmp_382555;
			NI LOC47;
			NI res_382558;
			i_382473 = 0;
			HEX3Atmp_382555 = 0;
			LOC47 = 0;
			LOC47 = len_192097(a);
			HEX3Atmp_382555 = (LOC47 - 1);
			res_382558 = ((NI) 0);
			{
				while (1) {
					if (!(res_382558 <= HEX3Atmp_382555)) goto LA49;
					i_382473 = res_382558;
					{
						if (!(((NI) 0) < i_382473)) goto LA52;
						(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP2978));
					}
					LA52: ;
					{
						Tnode191813* LOC56;
						Tnode191813* x;
						Tnode191813* LOC59;
						Tnode191813* LOC60;
						Ttype191849* LOC61;
						LOC56 = 0;
						LOC56 = HEX5BHEX5D_192244(a, i_382473);
						if (!((*LOC56).kind == ((NU8) 44))) goto LA57;
						LOC59 = 0;
						LOC59 = HEX5BHEX5D_192244(a, i_382473);
						LOC60 = 0;
						LOC60 = HEX5BHEX5D_192244(LOC59, ((NI) 0));
						x = copynode_195640(LOC60);
						LOC61 = 0;
						LOC61 = lastson_194442(t);
						storeany_382137(s, LOC61, x, stored);
						{
							while (1) {
								Tnode191813* LOC64;
								Tnode191813* LOC65;
								Ttype191849* LOC66;
								LOC64 = 0;
								LOC64 = HEX5BHEX5D_192244(a, i_382473);
								LOC65 = 0;
								LOC65 = HEX5BHEX5D_192244(LOC64, ((NI) 1));
								if (!((NI64)((*x).kindU.S1.intval + IL64(1)) <= (*LOC65).kindU.S1.intval)) goto LA63;
								(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP2978));
								LOC66 = 0;
								LOC66 = lastson_194442(t);
								storeany_382137(s, LOC66, x, stored);
								(*x).kindU.S1.intval += ((NI) 1);
							} LA63: ;
						}
					}
					goto LA54;
					LA57: ;
					{
						Ttype191849* LOC68;
						Tnode191813* LOC69;
						LOC68 = 0;
						LOC68 = lastson_194442(t);
						LOC69 = 0;
						LOC69 = HEX5BHEX5D_192244(a, i_382473);
						storeany_382137(s, LOC68, LOC69, stored);
					}
					LA54: ;
					res_382558 += ((NI) 1);
				} LA49: ;
			}
		}
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2979));
	}
	break;
	case ((NU8) 20):
	case ((NU8) 11):
	{
		Ttype191849* LOC71;
		LOC71 = 0;
		LOC71 = lastson_194442(t);
		storeany_382137(s, LOC71, a, stored);
	}
	break;
	case ((NU8) 14):
	{
		{
			Tnode191813* e_382496;
			Tnode191813* HEX3Atmp_382563;
			e_382496 = 0;
			HEX3Atmp_382563 = 0;
			HEX3Atmp_382563 = (*t).n;
			{
				NI i_382567;
				NI HEX3Atmp_382569;
				NI LOC75;
				NI res_382571;
				i_382567 = 0;
				HEX3Atmp_382569 = 0;
				LOC75 = 0;
				LOC75 = len_192097(HEX3Atmp_382563);
				HEX3Atmp_382569 = (LOC75 - 1);
				res_382571 = ((NI) 0);
				{
					while (1) {
						if (!(res_382571 <= HEX3Atmp_382569)) goto LA77;
						i_382567 = res_382571;
						e_382496 = (*HEX3Atmp_382563).kindU.S6.sons->data[i_382567];
						{
							NimStringDesc* LOC82;
							if (!(((NI64) ((*(*e_382496).kindU.S4.sym).position)) == (*a).kindU.S1.intval)) goto LA80;
							LOC82 = 0;
							LOC82 = escapejson_294295((*(*(*e_382496).kindU.S4.sym).name).s);
							(*s) = resizeString((*s), LOC82->Sup.len + 0);
appendString((*s), LOC82);
							goto LA73;
						}
						LA80: ;
						res_382571 += ((NI) 1);
					} LA77: ;
				}
			}
		} LA73: ;
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	{
		Tnode191813* x;
		x = a;
		{
			NIM_BOOL LOC86;
			LOC86 = 0;
			LOC86 = x == 0;
			if (LOC86) goto LA87;
			LOC86 = ((*x).kind == ((NU8) 23));
			LA87: ;
			if (!LOC86) goto LA88;
			(*s) = resizeString((*s), 4);
appendString((*s), ((NimStringDesc*) &TMP2976));
		}
		goto LA84;
		LA88: ;
		{
			NI LOC91;
			NIM_BOOL LOC92;
			NI LOC95;
			NimStringDesc* LOC96;
			LOC91 = 0;
			LOC91 = ptrtoint_382012(x);
			LOC92 = 0;
			LOC92 = containsorincl_188898(stored, LOC91);
			if (!LOC92) goto LA93;
			LOC95 = 0;
			LOC95 = ptrtoint_382012(x);
			LOC96 = 0;
			LOC96 = nimIntToStr(LOC95);
			(*s) = resizeString((*s), LOC96->Sup.len + 0);
appendString((*s), LOC96);
		}
		goto LA84;
		LA93: ;
		{
			NI LOC98;
			NimStringDesc* LOC99;
			Ttype191849* LOC100;
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2977));
			LOC98 = 0;
			LOC98 = ptrtoint_382012(x);
			LOC99 = 0;
			LOC99 = nimIntToStr(LOC98);
			(*s) = resizeString((*s), LOC99->Sup.len + 0);
appendString((*s), LOC99);
			(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP2978));
			LOC100 = 0;
			LOC100 = lastson_194442(t);
			storeany_382137(s, LOC100, a, stored);
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP2979));
		}
		LA84: ;
	}
	break;
	case ((NU8) 28):
	case ((NU8) 29):
	{
		{
			NIM_BOOL LOC104;
			LOC104 = 0;
			LOC104 = ((*a).kind == ((NU8) 23));
			if (LOC104) goto LA105;
			LOC104 = (*a).kindU.S3.strval == 0;
			LA105: ;
			if (!LOC104) goto LA106;
			(*s) = resizeString((*s), 4);
appendString((*s), ((NimStringDesc*) &TMP2976));
		}
		goto LA102;
		LA106: ;
		{
			NimStringDesc* LOC109;
			LOC109 = 0;
			LOC109 = escapejson_294295((*a).kindU.S3.strval);
			(*s) = resizeString((*s), LOC109->Sup.len + 0);
appendString((*s), LOC109);
		}
		LA102: ;
	}
	break;
	case ((NU8) 31) ... ((NU8) 35):
	case ((NU8) 40) ... ((NU8) 44):
	{
		NimStringDesc* LOC111;
		LOC111 = 0;
		LOC111 = nimInt64ToStr((*a).kindU.S1.intval);
		(*s) = resizeString((*s), LOC111->Sup.len + 0);
appendString((*s), LOC111);
	}
	break;
	case ((NU8) 36) ... ((NU8) 39):
	{
		NimStringDesc* LOC113;
		LOC113 = 0;
		LOC113 = nimFloatToStr((*a).kindU.S2.floatval);
		(*s) = resizeString((*s), LOC113->Sup.len + 0);
appendString((*s), LOC113);
	}
	break;
	default:
	{
		NimStringDesc* LOC115;
		NimStringDesc* LOC116;
		LOC115 = 0;
		LOC116 = 0;
		LOC116 = typetostring_221032(t, ((NU8) 0));
		LOC115 = rawNewString(LOC116->Sup.len + 31);
appendString(LOC115, ((NimStringDesc*) &TMP2969));
appendString(LOC115, LOC116);
		internalerror_166199((*a).info, LOC115);
	}
	break;
	}
}

N_NIMCALL(void, storeany_382625)(NimStringDesc** s, Ttype191849* t, Tnode191813* a) {
	Intset188056 stored;
	memset((void*)(&stored), 0, sizeof(stored));
	chckNil((void*)(&stored));
	memset((void*)(&stored), 0, sizeof(stored));
	initintset_188927((&stored));
	storeany_382137(s, t, a, (&stored));
}
NIM_EXTERNC N_NOINLINE(void, nimsrc_vmmarshalInit)(void) {
}

NIM_EXTERNC N_NOINLINE(void, nimsrc_vmmarshalDatInit)(void) {
}

