/* 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 Tnode225809 Tnode225809;
typedef struct Ttype225847 Ttype225847;
typedef struct Tlineinfo190352 Tlineinfo190352;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym225841 Tsym225841;
typedef struct Tident198021 Tident198021;
typedef struct Tnodeseq225803 Tnodeseq225803;
typedef struct Table429650 Table429650;
typedef struct Keyvaluepairseq429653 Keyvaluepairseq429653;
typedef struct Jsonparser324013 Jsonparser324013;
typedef struct Baselexer282024 Baselexer282024;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Streamobj149427 Streamobj149427;
typedef struct TY324063 TY324063;
typedef struct Stringstreamobj150511 Stringstreamobj150511;
typedef struct Tidobj198015 Tidobj198015;
typedef struct Ttypeseq225843 Ttypeseq225843;
typedef struct Tloc225823 Tloc225823;
typedef struct Ropeobj176009 Ropeobj176009;
typedef struct Tscope225835 Tscope225835;
typedef struct TY225944 TY225944;
typedef struct Tstrtable225813 Tstrtable225813;
typedef struct Tsymseq225811 Tsymseq225811;
typedef struct Tlib225827 Tlib225827;
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 Intset222056 Intset222056;
typedef struct Trunk222052 Trunk222052;
typedef struct Trunkseq222054 Trunkseq222054;
typedef struct TY90959 TY90959;
typedef struct Keyvaluepair429656 Keyvaluepair429656;
typedef struct Tinstantiation225831 Tinstantiation225831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct Basechunk30840 Basechunk30840;
typedef struct Freecell30832 Freecell30832;
typedef struct TY225932 TY225932;
struct  Tlineinfo190352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode225809  {
Ttype225847* typ;
Tlineinfo190352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym225841* sym;
} S4;
struct {Tident198021* ident;
} S5;
struct {Tnodeseq225803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Table429650  {
Keyvaluepairseq429653* data;
NI counter;
};
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  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  Jsonparser324013  {
  Baselexer282024 Sup;
NimStringDesc* a;
NU8 tok;
NU8 kind;
NU8 err;
TY324063* state;
NimStringDesc* filename;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tidobj198015  {
  TNimObject Sup;
NI id;
};
struct  Tloc225823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype225847* t;
Ropeobj176009* r;
Ropeobj176009* heaproot;
};
struct  Ttype225847  {
  Tidobj198015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq225843* sons;
Tnode225809* n;
Tsym225841* owner;
Tsym225841* sym;
Tsym225841* destructor;
Tsym225841* deepcopy;
Tsym225841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc225823 loc;
};
struct  Tstrtable225813  {
NI counter;
Tsymseq225811* data;
};
struct  Tsym225841  {
  Tidobj198015 Sup;
NU8 kind;
union{
struct {Ttypeseq225843* typeinstcache;
Tscope225835* typscope;
} S1;
struct {TY225944* procinstcache;
Tsym225841* gcunsafetyreason;
} S2;
struct {TY225944* usedgenerics;
Tstrtable225813 tab;
} S3;
struct {Tsym225841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype225847* typ;
Tident198021* name;
Tlineinfo190352 info;
Tsym225841* owner;
NU32 flags;
Tnode225809* ast;
NU32 options;
NI position;
NI offset;
Tloc225823 loc;
Tlib225827* annex;
Tnode225809* constraint;
};
struct  Tident198021  {
  Tidobj198015 Sup;
NimStringDesc* s;
Tident198021* next;
NI h;
};
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;
};
typedef Tnode225809* TY243880[1];
struct  Intset222056  {
NI counter;
NI max;
Trunk222052* head;
Trunkseq222054* data;
};
struct TY90959 {
NimStringDesc* Field0;
NI Field1;
};
struct Keyvaluepair429656 {
NI Field0;
NI64 Field1;
Tnode225809* Field2;
};
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  Stringstreamobj150511  {
  Streamobj149427 Sup;
NimStringDesc* data;
NI pos;
};
struct  Ropeobj176009  {
  TNimObject Sup;
Ropeobj176009* left;
Ropeobj176009* right;
NI length;
NimStringDesc* data;
};
struct  Tscope225835  {
NI depthlevel;
Tstrtable225813 symbols;
Tnodeseq225803* usingsyms;
Tscope225835* parent;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib225827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj176009* name;
Tnode225809* path;
};
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  Trunk222052  {
Trunk222052* next;
NI key;
TY30821 bits;
};
struct  Tinstantiation225831  {
Tsym225841* sym;
Ttypeseq225843* concretetypes;
TY225932* usedby;
NI compilesid;
};
struct  Freecell30832  {
Freecell30832* next;
NI zerofield;
};
struct Tnodeseq225803 {
  TGenericSeq Sup;
  Tnode225809* data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq429653 {
  TGenericSeq Sup;
  Keyvaluepair429656 data[SEQ_DECL_SIZE];
};
struct TY324063 {
  TGenericSeq Sup;
  NU8 data[SEQ_DECL_SIZE];
};
struct Ttypeseq225843 {
  TGenericSeq Sup;
  Ttype225847* data[SEQ_DECL_SIZE];
};
struct TY225944 {
  TGenericSeq Sup;
  Tinstantiation225831* data[SEQ_DECL_SIZE];
};
struct Tsymseq225811 {
  TGenericSeq Sup;
  Tsym225841* data[SEQ_DECL_SIZE];
};
struct Trunkseq222054 {
  TGenericSeq Sup;
  Trunk222052* data[SEQ_DECL_SIZE];
};
struct TY225932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, inittable_430467)(NI initialsize, Table429650* Result);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, open_324091)(Jsonparser324013* my, Streamobj149427* input, NimStringDesc* filename);
N_NIMCALL(Stringstreamobj150511*, newstringstream_150646)(NimStringDesc* s);
N_NIMCALL(void, next_325446)(Jsonparser324013* my);
N_NIMCALL(Tnode225809*, loadany_429639)(Jsonparser324013* p, Ttype225847* t, Table429650* tab);
static N_INLINE(NU8, kind_324607)(Jsonparser324013* my);
N_NIMCALL(Tnode225809*, newintnode_226608)(NU8 kind, NI64 intval);
N_NOINLINE(void, raiseparseerr_325786)(Jsonparser324013* p, NimStringDesc* msg) __attribute__((noreturn));
static N_INLINE(NimStringDesc*, str_324126)(Jsonparser324013* my);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(NI64, getint_324207)(Jsonparser324013* my);
N_NIMCALL(NI64, nsuParseBiggestInt)(NimStringDesc* s);
static N_INLINE(NI, len_226098)(Tnode225809* n);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(Tnode225809*, newnode_226401)(NU8 kind);
N_NIMCALL(void, add_226165)(Tnode225809* father, Tnode225809* son);
N_NIMCALL(Ttype225847*, elemtype_255522)(Ttype225847* t);
N_NIMCALL(NI, len_228369)(Ttype225847* n);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, typetostring_255032)(Ttype225847* typ, NU8 prefer);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
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*, newSeqRC1)(TNimType* typ, NI len);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Tident198021*, getident_198463)(NimStringDesc* identifier);
N_NIMCALL(Tsym225841*, lookupinrecord_233236)(Tnode225809* n, Tident198021* field);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
N_NIMCALL(void, addson_227819)(Tnode225809* father, Tnode225809* son);
N_NIMCALL(Tnode225809*, newsymnode_227325)(Tsym225841* sym);
N_NIMCALL(Tsym225841*, newsym_226656)(NU8 symkind, Tident198021* name, Tsym225841* owner, Tlineinfo190352 info);
N_NIMCALL(Tlineinfo190352, unknownlineinfo_191411)(void);
N_NIMCALL(Ttype225847*, lastson_228426)(Ttype225847* n);
N_NIMCALL(Tnode225809*, getordefault_430098)(Table429650 t, NI64 key);
N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x);
N_NIMCALL(void, HEX5BHEX5DHEX3D_430162)(Table429650* t, NI64 key, Tnode225809* val);
N_NIMCALL(Tnode225809*, newstrnode_226644)(NU8 kind, NimStringDesc* strval);
N_NIMCALL(Tnode225809*, newfloatnode_226632)(NU8 kind, NF floatval);
static N_INLINE(NF, getfloat_324407)(Jsonparser324013* my);
N_NIMCALL(NF, nsuParseFloat)(NimStringDesc* s);
N_NIMCALL(void, internalerror_196191)(NimStringDesc* errmsg);
static N_INLINE(void, close_324116)(Jsonparser324013* my);
N_NIMCALL(void, close_282046)(Baselexer282024* L);
N_NIMCALL(void, initintset_222927)(Intset222056* Result);
N_NIMCALL(void, storeany_429137)(NimStringDesc** s, Ttype225847* t, Tnode225809* a, Intset222056* stored);
N_NIMCALL(NimStringDesc*, nimBoolToStr)(NIM_BOOL x);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NimStringDesc*, escapejson_329895)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, nimCharToStr)(NIM_CHAR x);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
static N_INLINE(Tnode225809*, HEX5BHEX5D_226244)(Tnode225809* n, NI i);
N_NIMCALL(Tnode225809*, skipcolon_429258)(Tnode225809* n);
N_NIMCALL(void, storeobj_429148)(NimStringDesc** s, Ttype225847* typ, Tnode225809* x, Intset222056* stored);
N_NIMCALL(NimStringDesc*, HEX24_196279)(TY90959 x);
N_NIMCALL(NI, sonslen_228387)(Tnode225809* n);
N_NIMCALL(Tsym225841*, getfield_429023)(Tnode225809* n, NI position);
N_NIMCALL(Tnode225809*, lastson_228406)(Tnode225809* n);
N_NIMCALL(void, internalerror_196172)(Tlineinfo190352 info, NimStringDesc* errmsg);
N_NIMCALL(Tnode225809*, copynode_229660)(Tnode225809* src);
N_NIMCALL(NIM_BOOL, containsorincl_222898)(Intset222056* s, NI key);
static N_INLINE(NI, ptrtoint_429012)(Tnode225809* x);
N_NIMCALL(NimStringDesc*, nimFloatToStr)(NF f);
STRING_LITERAL(TMP3065, "unknown file", 12);
STRING_LITERAL(TMP3075, "\'true\' or \'false\' expected for a bool", 37);
STRING_LITERAL(TMP3076, "string of length 1 expected for a char", 38);
STRING_LITERAL(TMP3077, "string expected for an enum", 27);
STRING_LITERAL(TMP3078, "\'[\' expected for an array", 25);
STRING_LITERAL(TMP3079, "\']\' end of array expected", 25);
STRING_LITERAL(TMP3080, "", 0);
STRING_LITERAL(TMP3081, "\'[\' expected for a seq", 22);
STRING_LITERAL(TMP3082, "\'{\' expected for an object", 26);
STRING_LITERAL(TMP3083, "string expected for a field name", 32);
STRING_LITERAL(TMP3084, "too many fields to tuple type ", 30);
STRING_LITERAL(TMP3085, "\'}\' end of object expected", 26);
STRING_LITERAL(TMP3089, "unknown field for object of type ", 33);
STRING_LITERAL(TMP3090, "\'[\' expected for a set", 22);
STRING_LITERAL(TMP3091, "cannot load object with address ", 32);
STRING_LITERAL(TMP3092, "index for ref type expected", 27);
STRING_LITERAL(TMP3093, "\']\' end of ref-address pair expected", 36);
STRING_LITERAL(TMP3094, "int for pointer type expected", 29);
STRING_LITERAL(TMP3095, "string expected", 15);
STRING_LITERAL(TMP3096, "int expected", 12);
STRING_LITERAL(TMP3097, "float expected", 14);
STRING_LITERAL(TMP3098, "cannot marshal at compile-time ", 31);
STRING_LITERAL(TMP3104, "null", 4);
STRING_LITERAL(TMP3105, "[", 1);
STRING_LITERAL(TMP3106, ", ", 2);
STRING_LITERAL(TMP3107, "]", 1);
STRING_LITERAL(TMP3108, "{", 1);
STRING_LITERAL(TMP3109, "\"Field", 6);
STRING_LITERAL(TMP3110, "\": ", 3);
STRING_LITERAL(TMP3111, "}", 1);
STRING_LITERAL(TMP3113, "compiler/vmmarshal.nim", 22);
NIM_CONST TY90959 TMP3112 = {((NimStringDesc*) &TMP3113),
((NI) 39)}
;
NIM_CONST TY90959 TMP3114 = {((NimStringDesc*) &TMP3113),
((NI) 45)}
;
STRING_LITERAL(TMP3115, ": ", 2);
STRING_LITERAL(TMP3116, "getField(record case branch)", 28);
extern TNimType NTI324013; /* JsonParser */
extern TNimType NTI225803; /* TNodeSeq */
extern Gcheap51018 gch_51059;

N_NIMCALL(Tnode225809*, skipcolon_429258)(Tnode225809* n) {
	Tnode225809* 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_324607)(Jsonparser324013* my) {
	NU8 result;
{	result = 0;
	result = (*my).kind;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

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

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

static N_INLINE(NI, len_226098)(Tnode225809* 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(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, 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: ;
}

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

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

N_NIMCALL(Tnode225809*, loadany_429639)(Jsonparser324013* p, Ttype225847* t, Table429650* tab) {
	Tnode225809* result;
{	result = 0;
	switch ((*t).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		NU8 LOC3;
		LOC3 = 0;
		LOC3 = kind_324607((&(*p)));
		switch (LOC3) {
		case ((NU8) 6):
		{
			result = newintnode_226608(((NU8) 6), IL64(0));
		}
		break;
		case ((NU8) 5):
		{
			result = newintnode_226608(((NU8) 6), IL64(1));
		}
		break;
		default:
		{
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3075));
		}
		break;
		}
		next_325446(p);
	}
	break;
	case ((NU8) 2):
	{
		{
			NU8 LOC10;
			NimStringDesc* x;
			LOC10 = 0;
			LOC10 = kind_324607((&(*p)));
			if (!(LOC10 == ((NU8) 2))) goto LA11;
			x = str_324126((&(*p)));
			{
				if (!((x ? x->Sup.len : 0) == ((NI) 1))) goto LA15;
				result = newintnode_226608(((NU8) 6), ((NI64) (((NU8)(x->data[((NI) 0)])))));
				next_325446(p);
				goto BeforeRet;
			}
			LA15: ;
		}
		goto LA8;
		LA11: ;
		{
			NU8 LOC18;
			NI64 LOC21;
			LOC18 = 0;
			LOC18 = kind_324607((&(*p)));
			if (!(LOC18 == ((NU8) 3))) goto LA19;
			LOC21 = 0;
			LOC21 = getint_324207((&(*p)));
			result = newintnode_226608(((NU8) 6), LOC21);
			next_325446(p);
			goto BeforeRet;
		}
		goto LA8;
		LA19: ;
		LA8: ;
		raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3076));
	}
	break;
	case ((NU8) 14):
	{
		{
			NU8 LOC25;
			LOC25 = 0;
			LOC25 = kind_324607((&(*p)));
			if (!(LOC25 == ((NU8) 2))) goto LA26;
			{
				Tnode225809* e_429837;
				Tnode225809* HEX3Atmp_430397;
				e_429837 = 0;
				HEX3Atmp_430397 = 0;
				HEX3Atmp_430397 = (*t).n;
				{
					NI i_430401;
					NI HEX3Atmp_430403;
					NI LOC30;
					NI res_430405;
					i_430401 = 0;
					HEX3Atmp_430403 = 0;
					LOC30 = 0;
					LOC30 = len_226098(HEX3Atmp_430397);
					HEX3Atmp_430403 = (LOC30 - 1);
					res_430405 = ((NI) 0);
					{
						while (1) {
							if (!(res_430405 <= HEX3Atmp_430403)) goto LA32;
							i_430401 = res_430405;
							e_429837 = (*HEX3Atmp_430397).kindU.S6.sons->data[i_430401];
							{
								NimStringDesc* LOC35;
								LOC35 = 0;
								LOC35 = str_324126((&(*p)));
								if (!eqStrings((*(*(*e_429837).kindU.S4.sym).name).s, LOC35)) goto LA36;
								result = newintnode_226608(((NU8) 6), ((NI64) ((*(*e_429837).kindU.S4.sym).position)));
								next_325446(p);
								goto BeforeRet;
							}
							LA36: ;
							res_430405 += ((NI) 1);
						} LA32: ;
					}
				}
			}
		}
		LA26: ;
		raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3077));
	}
	break;
	case ((NU8) 16):
	{
		{
			NU8 LOC41;
			LOC41 = 0;
			LOC41 = kind_324607((&(*p)));
			if (!!((LOC41 == ((NU8) 10)))) goto LA42;
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3078));
		}
		LA42: ;
		next_325446(p);
		result = newnode_226401(((NU8) 41));
		{
			while (1) {
				NIM_BOOL LOC46;
				NU8 LOC47;
				NU8 LOC49;
				Ttype225847* LOC50;
				Tnode225809* LOC51;
				LOC46 = 0;
				LOC47 = 0;
				LOC47 = kind_324607((&(*p)));
				LOC46 = !((LOC47 == ((NU8) 11)));
				if (!(LOC46)) goto LA48;
				LOC49 = 0;
				LOC49 = kind_324607((&(*p)));
				LOC46 = !((LOC49 == ((NU8) 1)));
				LA48: ;
				if (!LOC46) goto LA45;
				LOC50 = 0;
				LOC50 = elemtype_255522(t);
				LOC51 = 0;
				LOC51 = loadany_429639(p, LOC50, tab);
				add_226165(result, LOC51);
			} LA45: ;
		}
		{
			NU8 LOC54;
			LOC54 = 0;
			LOC54 = kind_324607((&(*p)));
			if (!(LOC54 == ((NU8) 11))) goto LA55;
			next_325446(p);
		}
		goto LA52;
		LA55: ;
		{
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3079));
		}
		LA52: ;
	}
	break;
	case ((NU8) 24):
	{
		NU8 LOC59;
		LOC59 = 0;
		LOC59 = kind_324607((&(*p)));
		switch (LOC59) {
		case ((NU8) 7):
		{
			result = newnode_226401(((NU8) 23));
			next_325446(p);
		}
		break;
		case ((NU8) 10):
		{
			next_325446(p);
			result = newnode_226401(((NU8) 41));
			{
				while (1) {
					NIM_BOOL LOC64;
					NU8 LOC65;
					NU8 LOC67;
					Ttype225847* LOC68;
					Tnode225809* LOC69;
					LOC64 = 0;
					LOC65 = 0;
					LOC65 = kind_324607((&(*p)));
					LOC64 = !((LOC65 == ((NU8) 11)));
					if (!(LOC64)) goto LA66;
					LOC67 = 0;
					LOC67 = kind_324607((&(*p)));
					LOC64 = !((LOC67 == ((NU8) 1)));
					LA66: ;
					if (!LOC64) goto LA63;
					LOC68 = 0;
					LOC68 = elemtype_255522(t);
					LOC69 = 0;
					LOC69 = loadany_429639(p, LOC68, tab);
					add_226165(result, LOC69);
				} LA63: ;
			}
			{
				NU8 LOC72;
				LOC72 = 0;
				LOC72 = kind_324607((&(*p)));
				if (!(LOC72 == ((NU8) 11))) goto LA73;
				next_325446(p);
			}
			goto LA70;
			LA73: ;
			{
				raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3080));
			}
			LA70: ;
		}
		break;
		default:
		{
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3081));
		}
		break;
		}
	}
	break;
	case ((NU8) 18):
	{
		NI i;
		{
			NU8 LOC80;
			LOC80 = 0;
			LOC80 = kind_324607((&(*p)));
			if (!!((LOC80 == ((NU8) 8)))) goto LA81;
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3082));
		}
		LA81: ;
		next_325446(p);
		result = newnode_226401(((NU8) 37));
		i = ((NI) 0);
		{
			while (1) {
				NIM_BOOL LOC85;
				NU8 LOC86;
				NU8 LOC88;
				Tnode225809* LOC101;
				LOC85 = 0;
				LOC86 = 0;
				LOC86 = kind_324607((&(*p)));
				LOC85 = !((LOC86 == ((NU8) 9)));
				if (!(LOC85)) goto LA87;
				LOC88 = 0;
				LOC88 = kind_324607((&(*p)));
				LOC85 = !((LOC88 == ((NU8) 1)));
				LA87: ;
				if (!LOC85) goto LA84;
				{
					NU8 LOC91;
					LOC91 = 0;
					LOC91 = kind_324607((&(*p)));
					if (!!((LOC91 == ((NU8) 2)))) goto LA92;
					raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3083));
				}
				LA92: ;
				next_325446(p);
				{
					NI LOC96;
					NimStringDesc* LOC99;
					NimStringDesc* LOC100;
					LOC96 = 0;
					LOC96 = len_228369(t);
					if (!(LOC96 <= i)) goto LA97;
					LOC99 = 0;
					LOC100 = 0;
					LOC100 = typetostring_255032(t, ((NU8) 0));
					LOC99 = rawNewString(LOC100->Sup.len + 30);
appendString(LOC99, ((NimStringDesc*) &TMP3084));
appendString(LOC99, LOC100);
					raiseparseerr_325786((&(*p)), LOC99);
				}
				LA97: ;
				LOC101 = 0;
				LOC101 = loadany_429639(p, (*t).sons->data[i], tab);
				add_226165(result, LOC101);
				i += ((NI) 1);
			} LA84: ;
		}
		{
			NU8 LOC104;
			LOC104 = 0;
			LOC104 = kind_324607((&(*p)));
			if (!(LOC104 == ((NU8) 9))) goto LA105;
			next_325446(p);
		}
		goto LA102;
		LA105: ;
		{
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3085));
		}
		LA102: ;
	}
	break;
	case ((NU8) 17):
	{
		TY243880 LOC114;
		{
			NU8 LOC111;
			LOC111 = 0;
			LOC111 = kind_324607((&(*p)));
			if (!!((LOC111 == ((NU8) 8)))) goto LA112;
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3082));
		}
		LA112: ;
		next_325446(p);
		result = newnode_226401(((NU8) 38));
		if ((*result).kindU.S6.sons) nimGCunrefNoCycle((*result).kindU.S6.sons);
		(*result).kindU.S6.sons = (Tnodeseq225803*) newSeqRC1((&NTI225803), 1);
		memset((void*)LOC114, 0, sizeof(LOC114));
		LOC114[0] = newnode_226401(((NU8) 1));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[0]), LOC114[0]);
		{
			while (1) {
				NIM_BOOL LOC117;
				NU8 LOC118;
				NU8 LOC120;
				Tident198021* ident;
				NimStringDesc* LOC126;
				Tsym225841* field;
				NI pos;
				Tnode225809* fieldnode;
				Tlineinfo190352 LOC137;
				Tsym225841* LOC138;
				Tnode225809* LOC139;
				Tnode225809* LOC140;
				LOC117 = 0;
				LOC118 = 0;
				LOC118 = kind_324607((&(*p)));
				LOC117 = !((LOC118 == ((NU8) 9)));
				if (!(LOC117)) goto LA119;
				LOC120 = 0;
				LOC120 = kind_324607((&(*p)));
				LOC117 = !((LOC120 == ((NU8) 1)));
				LA119: ;
				if (!LOC117) goto LA116;
				{
					NU8 LOC123;
					LOC123 = 0;
					LOC123 = kind_324607((&(*p)));
					if (!!((LOC123 == ((NU8) 2)))) goto LA124;
					raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3083));
				}
				LA124: ;
				LOC126 = 0;
				LOC126 = str_324126((&(*p)));
				ident = getident_198463(LOC126);
				field = lookupinrecord_233236((*t).n, ident);
				{
					NimStringDesc* LOC131;
					NimStringDesc* LOC132;
					if (!field == 0) goto LA129;
					LOC131 = 0;
					LOC132 = 0;
					LOC132 = typetostring_255032(t, ((NU8) 0));
					LOC131 = rawNewString(LOC132->Sup.len + 33);
appendString(LOC131, ((NimStringDesc*) &TMP3089));
appendString(LOC131, LOC132);
					raiseparseerr_325786((&(*p)), LOC131);
				}
				LA129: ;
				next_325446(p);
				pos = (NI)((*field).position + ((NI) 1));
				{
					if (!(((*result).kindU.S6.sons ? (*result).kindU.S6.sons->Sup.len : 0) <= pos)) goto LA135;
					(*result).kindU.S6.sons = (Tnodeseq225803*) setLengthSeq(&((*result).kindU.S6.sons)->Sup, sizeof(Tnode225809*), ((NI) ((NI)(pos + ((NI) 1)))));
				}
				LA135: ;
				fieldnode = newnode_226401(((NU8) 34));
				LOC137 = unknownlineinfo_191411();
				LOC138 = 0;
				LOC138 = newsym_226656(((NU8) 19), ident, NIM_NIL, LOC137);
				LOC139 = 0;
				LOC139 = newsymnode_227325(LOC138);
				addson_227819(fieldnode, LOC139);
				LOC140 = 0;
				LOC140 = loadany_429639(p, (*field).typ, tab);
				addson_227819(fieldnode, LOC140);
				asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[pos]), fieldnode);
			} LA116: ;
		}
		{
			NU8 LOC143;
			LOC143 = 0;
			LOC143 = kind_324607((&(*p)));
			if (!(LOC143 == ((NU8) 9))) goto LA144;
			next_325446(p);
		}
		goto LA141;
		LA144: ;
		{
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3085));
		}
		LA141: ;
	}
	break;
	case ((NU8) 19):
	{
		{
			NU8 LOC150;
			LOC150 = 0;
			LOC150 = kind_324607((&(*p)));
			if (!!((LOC150 == ((NU8) 10)))) goto LA151;
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3090));
		}
		LA151: ;
		next_325446(p);
		result = newnode_226401(((NU8) 39));
		{
			while (1) {
				NIM_BOOL LOC155;
				NU8 LOC156;
				NU8 LOC158;
				Ttype225847* LOC159;
				Tnode225809* LOC160;
				LOC155 = 0;
				LOC156 = 0;
				LOC156 = kind_324607((&(*p)));
				LOC155 = !((LOC156 == ((NU8) 11)));
				if (!(LOC155)) goto LA157;
				LOC158 = 0;
				LOC158 = kind_324607((&(*p)));
				LOC155 = !((LOC158 == ((NU8) 1)));
				LA157: ;
				if (!LOC155) goto LA154;
				LOC159 = 0;
				LOC159 = lastson_228426(t);
				LOC160 = 0;
				LOC160 = loadany_429639(p, LOC159, tab);
				add_226165(result, LOC160);
				next_325446(p);
			} LA154: ;
		}
		{
			NU8 LOC163;
			LOC163 = 0;
			LOC163 = kind_324607((&(*p)));
			if (!(LOC163 == ((NU8) 11))) goto LA164;
			next_325446(p);
		}
		goto LA161;
		LA164: ;
		{
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3079));
		}
		LA161: ;
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	{
		NU8 LOC168;
		LOC168 = 0;
		LOC168 = kind_324607((&(*p)));
		switch (LOC168) {
		case ((NU8) 7):
		{
			result = newnode_226401(((NU8) 23));
			next_325446(p);
		}
		break;
		case ((NU8) 3):
		{
			NI64 LOC171;
			LOC171 = 0;
			LOC171 = getint_324207((&(*p)));
			result = getordefault_430098((*tab), LOC171);
			{
				NimStringDesc* LOC176;
				NI64 LOC177;
				NimStringDesc* LOC178;
				if (!result == 0) goto LA174;
				LOC176 = 0;
				LOC177 = 0;
				LOC177 = getint_324207((&(*p)));
				LOC178 = 0;
				LOC178 = nimInt64ToStr(LOC177);
				LOC176 = rawNewString(LOC178->Sup.len + 32);
appendString(LOC176, ((NimStringDesc*) &TMP3091));
appendString(LOC176, LOC178);
				raiseparseerr_325786((&(*p)), LOC176);
			}
			LA174: ;
			next_325446(p);
		}
		break;
		case ((NU8) 10):
		{
			next_325446(p);
			{
				NU8 LOC182;
				NI64 idx;
				Ttype225847* LOC185;
				LOC182 = 0;
				LOC182 = kind_324607((&(*p)));
				if (!(LOC182 == ((NU8) 3))) goto LA183;
				idx = getint_324207((&(*p)));
				next_325446(p);
				LOC185 = 0;
				LOC185 = lastson_228426(t);
				result = loadany_429639(p, LOC185, tab);
				HEX5BHEX5DHEX3D_430162(tab, idx, result);
			}
			goto LA180;
			LA183: ;
			{
				raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3092));
			}
			LA180: ;
			{
				NU8 LOC189;
				LOC189 = 0;
				LOC189 = kind_324607((&(*p)));
				if (!(LOC189 == ((NU8) 11))) goto LA190;
				next_325446(p);
			}
			goto LA187;
			LA190: ;
			{
				raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3093));
			}
			LA187: ;
		}
		break;
		default:
		{
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3094));
		}
		break;
		}
	}
	break;
	case ((NU8) 28):
	case ((NU8) 29):
	{
		NU8 LOC195;
		LOC195 = 0;
		LOC195 = kind_324607((&(*p)));
		switch (LOC195) {
		case ((NU8) 7):
		{
			result = newnode_226401(((NU8) 23));
			next_325446(p);
		}
		break;
		case ((NU8) 2):
		{
			NimStringDesc* LOC198;
			LOC198 = 0;
			LOC198 = str_324126((&(*p)));
			result = newstrnode_226644(((NU8) 20), LOC198);
			next_325446(p);
		}
		break;
		default:
		{
			raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3095));
		}
		break;
		}
	}
	break;
	case ((NU8) 31) ... ((NU8) 35):
	case ((NU8) 40) ... ((NU8) 44):
	{
		{
			NU8 LOC203;
			NI64 LOC206;
			LOC203 = 0;
			LOC203 = kind_324607((&(*p)));
			if (!(LOC203 == ((NU8) 3))) goto LA204;
			LOC206 = 0;
			LOC206 = getint_324207((&(*p)));
			result = newintnode_226608(((NU8) 6), LOC206);
			next_325446(p);
			goto BeforeRet;
		}
		LA204: ;
		raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3096));
	}
	break;
	case ((NU8) 36) ... ((NU8) 39):
	{
		{
			NU8 LOC210;
			NF LOC213;
			LOC210 = 0;
			LOC210 = kind_324607((&(*p)));
			if (!(LOC210 == ((NU8) 4))) goto LA211;
			LOC213 = 0;
			LOC213 = getfloat_324407((&(*p)));
			result = newfloatnode_226632(((NU8) 16), LOC213);
			next_325446(p);
			goto BeforeRet;
		}
		LA211: ;
		raiseparseerr_325786((&(*p)), ((NimStringDesc*) &TMP3097));
	}
	break;
	case ((NU8) 20):
	case ((NU8) 11):
	{
		Ttype225847* LOC215;
		LOC215 = 0;
		LOC215 = lastson_228426(t);
		result = loadany_429639(p, LOC215, tab);
	}
	break;
	default:
	{
		NimStringDesc* LOC217;
		NimStringDesc* LOC218;
		LOC217 = 0;
		LOC218 = 0;
		LOC218 = typetostring_255032(t, ((NU8) 0));
		LOC217 = rawNewString(LOC218->Sup.len + 31);
appendString(LOC217, ((NimStringDesc*) &TMP3098));
appendString(LOC217, LOC218);
		internalerror_196191(LOC217);
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

static N_INLINE(void, close_324116)(Jsonparser324013* my) {
	Baselexer282024* LOC1;
	LOC1 = 0;
	LOC1 = &my->Sup;
	close_282046(LOC1);
}

N_NIMCALL(Tnode225809*, loadany_430461)(NimStringDesc* s, Ttype225847* t) {
	Tnode225809* result;
	Table429650 tab;
	Jsonparser324013 p;
	Stringstreamobj150511* LOC1;
	Streamobj149427* LOC2;
	result = 0;
	memset((void*)(&tab), 0, sizeof(tab));
	chckNil((void*)(&tab));
	memset((void*)(&tab), 0, sizeof(tab));
	inittable_430467(((NI) 64), (&tab));
	memset((void*)(&p), 0, sizeof(p));
	p.Sup.Sup.m_type = (&NTI324013);
	LOC1 = 0;
	LOC1 = newstringstream_150646(s);
	LOC2 = 0;
	LOC2 = &LOC1->Sup;
	open_324091((&p), LOC2, ((NimStringDesc*) &TMP3065));
	next_325446((&p));
	result = loadany_429639((&p), t, (&tab));
	close_324116((&p));
	return result;
}

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

N_NIMCALL(Tsym225841*, getfield_429023)(Tnode225809* n, NI position) {
	Tsym225841* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 138):
	{
		{
			NI i_429040;
			NI HEX3Atmp_429098;
			NI LOC3;
			NI res_429101;
			i_429040 = 0;
			HEX3Atmp_429098 = 0;
			LOC3 = 0;
			LOC3 = sonslen_228387(n);
			HEX3Atmp_429098 = (NI)(LOC3 - ((NI) 1));
			res_429101 = ((NI) 0);
			{
				while (1) {
					if (!(res_429101 <= HEX3Atmp_429098)) goto LA5;
					i_429040 = res_429101;
					result = getfield_429023((*n).kindU.S6.sons->data[i_429040], position);
					{
						if (!!((result == NIM_NIL))) goto LA8;
						goto BeforeRet;
					}
					LA8: ;
					res_429101 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 139):
	{
		result = getfield_429023((*n).kindU.S6.sons->data[((NI) 0)], position);
		{
			if (!!((result == NIM_NIL))) goto LA13;
			goto BeforeRet;
		}
		LA13: ;
		{
			NI i_429079;
			NI HEX3Atmp_429106;
			NI LOC16;
			NI res_429109;
			i_429079 = 0;
			HEX3Atmp_429106 = 0;
			LOC16 = 0;
			LOC16 = sonslen_228387(n);
			HEX3Atmp_429106 = (NI)(LOC16 - ((NI) 1));
			res_429109 = ((NI) 1);
			{
				while (1) {
					if (!(res_429109 <= HEX3Atmp_429106)) goto LA18;
					i_429079 = res_429109;
					switch ((*(*n).kindU.S6.sons->data[i_429079]).kind) {
					case ((NU8) 85):
					case ((NU8) 88):
					{
						Tnode225809* LOC20;
						LOC20 = 0;
						LOC20 = lastson_228406((*n).kindU.S6.sons->data[i_429079]);
						result = getfield_429023(LOC20, position);
						{
							if (!!((result == NIM_NIL))) goto LA23;
							goto BeforeRet;
						}
						LA23: ;
					}
					break;
					default:
					{
						internalerror_196172((*n).info, ((NimStringDesc*) &TMP3116));
					}
					break;
					}
					res_429109 += ((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_429148)(NimStringDesc** s, Ttype225847* typ, Tnode225809* x, Intset222056* stored) {
	NI start;
	{
		NimStringDesc* LOC5;
		if (!!(((*x).kind == ((NU8) 38)))) goto LA3;
		LOC5 = 0;
		LOC5 = HEX24_196279(TMP3112);
		internalerror_196191(LOC5);
	}
	LA3: ;
	start = ((NI) 1);
	{
		NI i_429185;
		NI HEX3Atmp_429236;
		NI LOC7;
		NI res_429239;
		i_429185 = 0;
		HEX3Atmp_429236 = 0;
		LOC7 = 0;
		LOC7 = sonslen_228387(x);
		HEX3Atmp_429236 = (NI)(LOC7 - ((NI) 1));
		res_429239 = start;
		{
			while (1) {
				Tnode225809* it;
				if (!(res_429239 <= HEX3Atmp_429236)) goto LA9;
				i_429185 = res_429239;
				{
					if (!(start < i_429185)) goto LA12;
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3106));
				}
				LA12: ;
				it = (*x).kindU.S6.sons->data[i_429185];
				{
					Tsym225841* 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_196279(TMP3114);
						internalerror_196191(LOC22);
					}
					LA20: ;
					field = (*(*it).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym;
					LOC23 = 0;
					LOC23 = escapejson_329895((*(*field).name).s);
					(*s) = resizeString((*s), LOC23->Sup.len + 0);
appendString((*s), LOC23);
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3115));
					storeany_429137(s, (*field).typ, (*it).kindU.S6.sons->data[((NI) 1)], stored);
				}
				goto LA14;
				LA16: ;
				{
					Tsym225841* field;
					NimStringDesc* LOC27;
					if (!!(((*typ).n == NIM_NIL))) goto LA25;
					field = getfield_429023((*typ).n, i_429185);
					LOC27 = 0;
					LOC27 = escapejson_329895((*(*field).name).s);
					(*s) = resizeString((*s), LOC27->Sup.len + 0);
appendString((*s), LOC27);
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3115));
					storeany_429137(s, (*field).typ, it, stored);
				}
				goto LA14;
				LA25: ;
				LA14: ;
				res_429239 += ((NI) 1);
			} LA9: ;
		}
	}
}

static N_INLINE(NI, ptrtoint_429012)(Tnode225809* x) {
	NI result;
	result = 0;
	result = ((NI) (x));
	return result;
}

N_NIMCALL(void, storeany_429137)(NimStringDesc** s, Ttype225847* t, Tnode225809* a, Intset222056* 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_329895(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*) &TMP3104));
		}
		goto LA14;
		LA18: ;
		{
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3105));
			{
				NI i_429433;
				NI HEX3Atmp_429538;
				NI LOC22;
				NI res_429541;
				i_429433 = 0;
				HEX3Atmp_429538 = 0;
				LOC22 = 0;
				LOC22 = len_226098(a);
				HEX3Atmp_429538 = (NI)(LOC22 - ((NI) 1));
				res_429541 = ((NI) 0);
				{
					while (1) {
						Ttype225847* LOC29;
						Tnode225809* LOC30;
						if (!(res_429541 <= HEX3Atmp_429538)) goto LA24;
						i_429433 = res_429541;
						{
							if (!(((NI) 0) < i_429433)) goto LA27;
							(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3106));
						}
						LA27: ;
						LOC29 = 0;
						LOC29 = elemtype_255522(t);
						LOC30 = 0;
						LOC30 = HEX5BHEX5D_226244(a, i_429433);
						storeany_429137(s, LOC29, LOC30, stored);
						res_429541 += ((NI) 1);
					} LA24: ;
				}
			}
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3107));
		}
		LA14: ;
	}
	break;
	case ((NU8) 18):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3108));
		{
			NI i_429452;
			NI HEX3Atmp_429546;
			NI LOC33;
			NI res_429549;
			i_429452 = 0;
			HEX3Atmp_429546 = 0;
			LOC33 = 0;
			LOC33 = len_228369(t);
			HEX3Atmp_429546 = (LOC33 - 1);
			res_429549 = ((NI) 0);
			{
				while (1) {
					NimStringDesc* LOC40;
					NimStringDesc* LOC41;
					Tnode225809* LOC42;
					Tnode225809* LOC43;
					if (!(res_429549 <= HEX3Atmp_429546)) goto LA35;
					i_429452 = res_429549;
					{
						if (!(((NI) 0) < i_429452)) goto LA38;
						(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3106));
					}
					LA38: ;
					LOC40 = 0;
					LOC41 = 0;
					LOC41 = nimIntToStr(i_429452);
					LOC40 = rawNewString(LOC41->Sup.len + 6);
appendString(LOC40, ((NimStringDesc*) &TMP3109));
appendString(LOC40, LOC41);
					(*s) = resizeString((*s), LOC40->Sup.len + 0);
appendString((*s), LOC40);
					(*s) = resizeString((*s), 3);
appendString((*s), ((NimStringDesc*) &TMP3110));
					LOC42 = 0;
					LOC42 = HEX5BHEX5D_226244(a, i_429452);
					LOC43 = 0;
					LOC43 = skipcolon_429258(LOC42);
					storeany_429137(s, (*t).sons->data[i_429452], LOC43, stored);
					res_429549 += ((NI) 1);
				} LA35: ;
			}
		}
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3111));
	}
	break;
	case ((NU8) 17):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3108));
		storeobj_429148(s, t, a, stored);
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3111));
	}
	break;
	case ((NU8) 19):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3105));
		{
			NI i_429473;
			NI HEX3Atmp_429555;
			NI LOC47;
			NI res_429558;
			i_429473 = 0;
			HEX3Atmp_429555 = 0;
			LOC47 = 0;
			LOC47 = len_226098(a);
			HEX3Atmp_429555 = (LOC47 - 1);
			res_429558 = ((NI) 0);
			{
				while (1) {
					if (!(res_429558 <= HEX3Atmp_429555)) goto LA49;
					i_429473 = res_429558;
					{
						if (!(((NI) 0) < i_429473)) goto LA52;
						(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3106));
					}
					LA52: ;
					{
						Tnode225809* LOC56;
						Tnode225809* x;
						Tnode225809* LOC59;
						Tnode225809* LOC60;
						Ttype225847* LOC61;
						LOC56 = 0;
						LOC56 = HEX5BHEX5D_226244(a, i_429473);
						if (!((*LOC56).kind == ((NU8) 44))) goto LA57;
						LOC59 = 0;
						LOC59 = HEX5BHEX5D_226244(a, i_429473);
						LOC60 = 0;
						LOC60 = HEX5BHEX5D_226244(LOC59, ((NI) 0));
						x = copynode_229660(LOC60);
						LOC61 = 0;
						LOC61 = lastson_228426(t);
						storeany_429137(s, LOC61, x, stored);
						{
							while (1) {
								Tnode225809* LOC64;
								Tnode225809* LOC65;
								Ttype225847* LOC66;
								LOC64 = 0;
								LOC64 = HEX5BHEX5D_226244(a, i_429473);
								LOC65 = 0;
								LOC65 = HEX5BHEX5D_226244(LOC64, ((NI) 1));
								if (!((NI64)((*x).kindU.S1.intval + IL64(1)) <= (*LOC65).kindU.S1.intval)) goto LA63;
								(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3106));
								LOC66 = 0;
								LOC66 = lastson_228426(t);
								storeany_429137(s, LOC66, x, stored);
								(*x).kindU.S1.intval += ((NI) 1);
							} LA63: ;
						}
					}
					goto LA54;
					LA57: ;
					{
						Ttype225847* LOC68;
						Tnode225809* LOC69;
						LOC68 = 0;
						LOC68 = lastson_228426(t);
						LOC69 = 0;
						LOC69 = HEX5BHEX5D_226244(a, i_429473);
						storeany_429137(s, LOC68, LOC69, stored);
					}
					LA54: ;
					res_429558 += ((NI) 1);
				} LA49: ;
			}
		}
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3107));
	}
	break;
	case ((NU8) 20):
	case ((NU8) 11):
	{
		Ttype225847* LOC71;
		LOC71 = 0;
		LOC71 = lastson_228426(t);
		storeany_429137(s, LOC71, a, stored);
	}
	break;
	case ((NU8) 14):
	{
		{
			Tnode225809* e_429496;
			Tnode225809* HEX3Atmp_429563;
			e_429496 = 0;
			HEX3Atmp_429563 = 0;
			HEX3Atmp_429563 = (*t).n;
			{
				NI i_429567;
				NI HEX3Atmp_429569;
				NI LOC75;
				NI res_429571;
				i_429567 = 0;
				HEX3Atmp_429569 = 0;
				LOC75 = 0;
				LOC75 = len_226098(HEX3Atmp_429563);
				HEX3Atmp_429569 = (LOC75 - 1);
				res_429571 = ((NI) 0);
				{
					while (1) {
						if (!(res_429571 <= HEX3Atmp_429569)) goto LA77;
						i_429567 = res_429571;
						e_429496 = (*HEX3Atmp_429563).kindU.S6.sons->data[i_429567];
						{
							NimStringDesc* LOC82;
							if (!(((NI64) ((*(*e_429496).kindU.S4.sym).position)) == (*a).kindU.S1.intval)) goto LA80;
							LOC82 = 0;
							LOC82 = escapejson_329895((*(*(*e_429496).kindU.S4.sym).name).s);
							(*s) = resizeString((*s), LOC82->Sup.len + 0);
appendString((*s), LOC82);
							goto LA73;
						}
						LA80: ;
						res_429571 += ((NI) 1);
					} LA77: ;
				}
			}
		} LA73: ;
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	{
		Tnode225809* 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*) &TMP3104));
		}
		goto LA84;
		LA88: ;
		{
			NI LOC91;
			NIM_BOOL LOC92;
			NI LOC95;
			NimStringDesc* LOC96;
			LOC91 = 0;
			LOC91 = ptrtoint_429012(x);
			LOC92 = 0;
			LOC92 = containsorincl_222898(stored, LOC91);
			if (!LOC92) goto LA93;
			LOC95 = 0;
			LOC95 = ptrtoint_429012(x);
			LOC96 = 0;
			LOC96 = nimIntToStr(LOC95);
			(*s) = resizeString((*s), LOC96->Sup.len + 0);
appendString((*s), LOC96);
		}
		goto LA84;
		LA93: ;
		{
			NI LOC98;
			NimStringDesc* LOC99;
			Ttype225847* LOC100;
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3105));
			LOC98 = 0;
			LOC98 = ptrtoint_429012(x);
			LOC99 = 0;
			LOC99 = nimIntToStr(LOC98);
			(*s) = resizeString((*s), LOC99->Sup.len + 0);
appendString((*s), LOC99);
			(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3106));
			LOC100 = 0;
			LOC100 = lastson_228426(t);
			storeany_429137(s, LOC100, a, stored);
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3107));
		}
		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*) &TMP3104));
		}
		goto LA102;
		LA106: ;
		{
			NimStringDesc* LOC109;
			LOC109 = 0;
			LOC109 = escapejson_329895((*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_255032(t, ((NU8) 0));
		LOC115 = rawNewString(LOC116->Sup.len + 31);
appendString(LOC115, ((NimStringDesc*) &TMP3098));
appendString(LOC115, LOC116);
		internalerror_196172((*a).info, LOC115);
	}
	break;
	}
}

N_NIMCALL(void, storeany_429625)(NimStringDesc** s, Ttype225847* t, Tnode225809* a) {
	Intset222056 stored;
	memset((void*)(&stored), 0, sizeof(stored));
	chckNil((void*)(&stored));
	memset((void*)(&stored), 0, sizeof(stored));
	initintset_222927((&stored));
	storeany_429137(s, t, a, (&stored));
}
NIM_EXTERNC N_NOINLINE(void, compiler_vmmarshalInit000)(void) {
}

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

