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

#include "nimbase.h"
#include <string.h>
typedef struct Tnode224809 Tnode224809;
typedef struct Ttype224847 Ttype224847;
typedef struct Tlineinfo189352 Tlineinfo189352;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym224841 Tsym224841;
typedef struct Tident197021 Tident197021;
typedef struct Tnodeseq224803 Tnodeseq224803;
typedef struct Table428650 Table428650;
typedef struct Keyvaluepairseq428653 Keyvaluepairseq428653;
typedef struct Jsonparser323013 Jsonparser323013;
typedef struct Baselexer281024 Baselexer281024;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Streamobj149427 Streamobj149427;
typedef struct TY323063 TY323063;
typedef struct Stringstreamobj150511 Stringstreamobj150511;
typedef struct Tidobj197015 Tidobj197015;
typedef struct Ttypeseq224843 Ttypeseq224843;
typedef struct Tloc224823 Tloc224823;
typedef struct Ropeobj175009 Ropeobj175009;
typedef struct Tscope224835 Tscope224835;
typedef struct TY224944 TY224944;
typedef struct Tstrtable224813 Tstrtable224813;
typedef struct Tsymseq224811 Tsymseq224811;
typedef struct Tlib224827 Tlib224827;
typedef struct Cell48947 Cell48947;
typedef struct Cellseq48963 Cellseq48963;
typedef struct Gcheap51018 Gcheap51018;
typedef struct Gcstack51016 Gcstack51016;
typedef struct Cellset48959 Cellset48959;
typedef struct Pagedesc48955 Pagedesc48955;
typedef struct Memregion30891 Memregion30891;
typedef struct Smallchunk30843 Smallchunk30843;
typedef struct Llchunk30885 Llchunk30885;
typedef struct Bigchunk30845 Bigchunk30845;
typedef struct Intset30817 Intset30817;
typedef struct Trunk30813 Trunk30813;
typedef struct Avlnode30889 Avlnode30889;
typedef struct Gcstat51014 Gcstat51014;
typedef struct Intset221056 Intset221056;
typedef struct Trunk221052 Trunk221052;
typedef struct Trunkseq221054 Trunkseq221054;
typedef struct TY90959 TY90959;
typedef struct Keyvaluepair428656 Keyvaluepair428656;
typedef struct Tinstantiation224831 Tinstantiation224831;
typedef struct Tlistentry140022 Tlistentry140022;
typedef struct Basechunk30841 Basechunk30841;
typedef struct Freecell30833 Freecell30833;
typedef struct TY224932 TY224932;
struct  Tlineinfo189352  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode224809  {
Ttype224847* typ;
Tlineinfo189352 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym224841* sym;
} S4;
struct {Tident197021* ident;
} S5;
struct {Tnodeseq224803* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Table428650  {
Keyvaluepairseq428653* 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 TY212407[32];
struct  Baselexer281024  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Streamobj149427* input;
NI linenumber;
NI sentinel;
NI linestart;
TY212407 refillchars;
};
struct  Jsonparser323013  {
  Baselexer281024 Sup;
NimStringDesc* a;
NU8 tok;
NU8 kind;
NU8 err;
TY323063* state;
NimStringDesc* filename;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tidobj197015  {
  TNimObject Sup;
NI id;
};
struct  Tloc224823  {
NU8 k;
NU8 s;
NU16 flags;
Ttype224847* t;
Ropeobj175009* r;
Ropeobj175009* heaproot;
};
struct  Ttype224847  {
  Tidobj197015 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq224843* sons;
Tnode224809* n;
Tsym224841* owner;
Tsym224841* sym;
Tsym224841* destructor;
Tsym224841* deepcopy;
Tsym224841* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc224823 loc;
};
struct  Tstrtable224813  {
NI counter;
Tsymseq224811* data;
};
struct  Tsym224841  {
  Tidobj197015 Sup;
NU8 kind;
union{
struct {Ttypeseq224843* typeinstcache;
Tscope224835* typscope;
} S1;
struct {TY224944* procinstcache;
Tsym224841* gcunsafetyreason;
} S2;
struct {TY224944* usedgenerics;
Tstrtable224813 tab;
} S3;
struct {Tsym224841* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype224847* typ;
Tident197021* name;
Tlineinfo189352 info;
Tsym224841* owner;
NU32 flags;
Tnode224809* ast;
NU32 options;
NI position;
NI offset;
Tloc224823 loc;
Tlib224827* annex;
Tnode224809* constraint;
};
struct  Tident197021  {
  Tidobj197015 Sup;
NimStringDesc* s;
Tident197021* next;
NI h;
};
struct  Cell48947  {
NI refcount;
TNimType* typ;
};
struct  Cellseq48963  {
NI len;
NI cap;
Cell48947** d;
};
struct  Cellset48959  {
NI counter;
NI max;
Pagedesc48955* head;
Pagedesc48955** data;
};
typedef Smallchunk30843* TY30906[512];
typedef Trunk30813* Trunkbuckets30815[256];
struct  Intset30817  {
Trunkbuckets30815 data;
};
struct  Memregion30891  {
NI minlargeobj;
NI maxlargeobj;
TY30906 freesmallchunks;
Llchunk30885* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk30845* freechunkslist;
Intset30817 chunkstarts;
Avlnode30889* root;
Avlnode30889* deleted;
Avlnode30889* last;
Avlnode30889* 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;
Cellseq48963 zct;
Cellseq48963 decstack;
Cellset48959 cycleroots;
Cellseq48963 tempstack;
NI recgclock;
Memregion30891 region;
Gcstat51014 stat;
};
typedef Tnode224809* TY242880[1];
struct  Intset221056  {
NI counter;
NI max;
Trunk221052* head;
Trunkseq221054* data;
};
struct TY90959 {
NimStringDesc* Field0;
NI Field1;
};
struct Keyvaluepair428656 {
NI Field0;
NI64 Field1;
Tnode224809* 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  Ropeobj175009  {
  TNimObject Sup;
Ropeobj175009* left;
Ropeobj175009* right;
NI length;
NimStringDesc* data;
};
struct  Tscope224835  {
NI depthlevel;
Tstrtable224813 symbols;
Tnodeseq224803* usingsyms;
Tscope224835* parent;
};
struct  Tlistentry140022  {
  TNimObject Sup;
Tlistentry140022* prev;
Tlistentry140022* next;
};
struct  Tlib224827  {
  Tlistentry140022 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj175009* name;
Tnode224809* path;
};
struct  Gcstack51016  {
Gcstack51016* prev;
Gcstack51016* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY30822[8];
struct  Pagedesc48955  {
Pagedesc48955* next;
NI key;
TY30822 bits;
};
struct  Basechunk30841  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk30843  {
  Basechunk30841 Sup;
Smallchunk30843* next;
Smallchunk30843* prev;
Freecell30833* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk30885  {
NI size;
NI acc;
Llchunk30885* next;
};
struct  Bigchunk30845  {
  Basechunk30841 Sup;
Bigchunk30845* next;
Bigchunk30845* prev;
NI align;
NF data;
};
struct  Trunk30813  {
Trunk30813* next;
NI key;
TY30822 bits;
};
typedef Avlnode30889* TY30896[2];
struct  Avlnode30889  {
TY30896 link;
NI key;
NI upperbound;
NI level;
};
struct  Trunk221052  {
Trunk221052* next;
NI key;
TY30822 bits;
};
struct  Tinstantiation224831  {
Tsym224841* sym;
Ttypeseq224843* concretetypes;
TY224932* usedby;
NI compilesid;
};
struct  Freecell30833  {
Freecell30833* next;
NI zerofield;
};
struct Tnodeseq224803 {
  TGenericSeq Sup;
  Tnode224809* data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq428653 {
  TGenericSeq Sup;
  Keyvaluepair428656 data[SEQ_DECL_SIZE];
};
struct TY323063 {
  TGenericSeq Sup;
  NU8 data[SEQ_DECL_SIZE];
};
struct Ttypeseq224843 {
  TGenericSeq Sup;
  Ttype224847* data[SEQ_DECL_SIZE];
};
struct TY224944 {
  TGenericSeq Sup;
  Tinstantiation224831* data[SEQ_DECL_SIZE];
};
struct Tsymseq224811 {
  TGenericSeq Sup;
  Tsym224841* data[SEQ_DECL_SIZE];
};
struct Trunkseq221054 {
  TGenericSeq Sup;
  Trunk221052* data[SEQ_DECL_SIZE];
};
struct TY224932 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, inittable_429467)(NI initialsize, Table428650* Result);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, open_323091)(Jsonparser323013* my, Streamobj149427* input, NimStringDesc* filename);
N_NIMCALL(Stringstreamobj150511*, newstringstream_150646)(NimStringDesc* s);
N_NIMCALL(void, next_324446)(Jsonparser323013* my);
N_NIMCALL(Tnode224809*, loadany_428639)(Jsonparser323013* p, Ttype224847* t, Table428650* tab);
static N_INLINE(NU8, kind_323607)(Jsonparser323013* my);
N_NIMCALL(Tnode224809*, newintnode_225607)(NU8 kind, NI64 intval);
N_NOINLINE(void, raiseparseerr_324786)(Jsonparser323013* p, NimStringDesc* msg) __attribute__((noreturn));
static N_INLINE(NimStringDesc*, str_323126)(Jsonparser323013* my);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(NI64, getint_323207)(Jsonparser323013* my);
N_NIMCALL(NI64, nsuParseBiggestInt)(NimStringDesc* s);
static N_INLINE(NI, len_225098)(Tnode224809* n);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(Tnode224809*, newnode_225401)(NU8 kind);
N_NIMCALL(void, add_225165)(Tnode224809* father, Tnode224809* son);
N_NIMCALL(Ttype224847*, elemtype_254522)(Ttype224847* t);
N_NIMCALL(NI, len_227369)(Ttype224847* n);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, typetostring_254032)(Ttype224847* typ, NU8 prefer);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell48947*, usrtocell_52646)(void* usr);
static N_INLINE(void, rtladdzct_54204)(Cell48947* c);
N_NOINLINE(void, addzct_52617)(Cellseq48963* s, Cell48947* c);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Tident197021*, getident_197463)(NimStringDesc* identifier);
N_NIMCALL(Tsym224841*, lookupinrecord_232236)(Tnode224809* n, Tident197021* field);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
N_NIMCALL(void, addson_226819)(Tnode224809* father, Tnode224809* son);
N_NIMCALL(Tnode224809*, newsymnode_226325)(Tsym224841* sym);
N_NIMCALL(Tsym224841*, newsym_225655)(NU8 symkind, Tident197021* name, Tsym224841* owner, Tlineinfo189352 info);
N_NIMCALL(Tlineinfo189352, unknownlineinfo_190408)(void);
N_NIMCALL(Ttype224847*, lastson_227426)(Ttype224847* n);
N_NIMCALL(Tnode224809*, getordefault_429098)(Table428650 t, NI64 key);
N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x);
N_NIMCALL(void, HEX5BHEX5DHEX3D_429162)(Table428650* t, NI64 key, Tnode224809* val);
N_NIMCALL(Tnode224809*, newstrnode_225643)(NU8 kind, NimStringDesc* strval);
N_NIMCALL(Tnode224809*, newfloatnode_225631)(NU8 kind, NF floatval);
static N_INLINE(NF, getfloat_323407)(Jsonparser323013* my);
N_NIMCALL(NF, nsuParseFloat)(NimStringDesc* s);
N_NIMCALL(void, internalerror_195191)(NimStringDesc* errmsg);
static N_INLINE(void, close_323116)(Jsonparser323013* my);
N_NIMCALL(void, close_281046)(Baselexer281024* L);
N_NIMCALL(void, initintset_221927)(Intset221056* Result);
N_NIMCALL(void, storeany_428137)(NimStringDesc** s, Ttype224847* t, Tnode224809* a, Intset221056* stored);
N_NIMCALL(NimStringDesc*, nimBoolToStr)(NIM_BOOL x);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NimStringDesc*, escapejson_328895)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, nimCharToStr)(NIM_CHAR x);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
static N_INLINE(Tnode224809*, HEX5BHEX5D_225244)(Tnode224809* n, NI i);
N_NIMCALL(Tnode224809*, skipcolon_428258)(Tnode224809* n);
N_NIMCALL(void, storeobj_428148)(NimStringDesc** s, Ttype224847* typ, Tnode224809* x, Intset221056* stored);
N_NIMCALL(NimStringDesc*, HEX24_195279)(TY90959 x);
N_NIMCALL(NI, sonslen_227387)(Tnode224809* n);
N_NIMCALL(Tsym224841*, getfield_428023)(Tnode224809* n, NI position);
N_NIMCALL(Tnode224809*, lastson_227406)(Tnode224809* n);
N_NIMCALL(void, internalerror_195172)(Tlineinfo189352 info, NimStringDesc* errmsg);
N_NIMCALL(Tnode224809*, copynode_228660)(Tnode224809* src);
N_NIMCALL(NIM_BOOL, containsorincl_221898)(Intset221056* s, NI key);
static N_INLINE(NI, ptrtoint_428012)(Tnode224809* x);
N_NIMCALL(NimStringDesc*, nimFloatToStr)(NF f);
STRING_LITERAL(TMP3062, "unknown file", 12);
STRING_LITERAL(TMP3072, "\'true\' or \'false\' expected for a bool", 37);
STRING_LITERAL(TMP3073, "string of length 1 expected for a char", 38);
STRING_LITERAL(TMP3074, "string expected for an enum", 27);
STRING_LITERAL(TMP3075, "\'[\' expected for an array", 25);
STRING_LITERAL(TMP3076, "\']\' end of array expected", 25);
STRING_LITERAL(TMP3077, "", 0);
STRING_LITERAL(TMP3078, "\'[\' expected for a seq", 22);
STRING_LITERAL(TMP3079, "\'{\' expected for an object", 26);
STRING_LITERAL(TMP3080, "string expected for a field name", 32);
STRING_LITERAL(TMP3081, "too many fields to tuple type ", 30);
STRING_LITERAL(TMP3082, "\'}\' end of object expected", 26);
STRING_LITERAL(TMP3086, "unknown field for object of type ", 33);
STRING_LITERAL(TMP3087, "\'[\' expected for a set", 22);
STRING_LITERAL(TMP3088, "cannot load object with address ", 32);
STRING_LITERAL(TMP3089, "index for ref type expected", 27);
STRING_LITERAL(TMP3090, "\']\' end of ref-address pair expected", 36);
STRING_LITERAL(TMP3091, "int for pointer type expected", 29);
STRING_LITERAL(TMP3092, "string expected", 15);
STRING_LITERAL(TMP3093, "int expected", 12);
STRING_LITERAL(TMP3094, "float expected", 14);
STRING_LITERAL(TMP3095, "cannot marshal at compile-time ", 31);
STRING_LITERAL(TMP3101, "null", 4);
STRING_LITERAL(TMP3102, "[", 1);
STRING_LITERAL(TMP3103, ", ", 2);
STRING_LITERAL(TMP3104, "]", 1);
STRING_LITERAL(TMP3105, "{", 1);
STRING_LITERAL(TMP3106, "\"Field", 6);
STRING_LITERAL(TMP3107, "\": ", 3);
STRING_LITERAL(TMP3108, "}", 1);
STRING_LITERAL(TMP3110, "compiler/vmmarshal.nim", 22);
NIM_CONST TY90959 TMP3109 = {((NimStringDesc*) &TMP3110),
((NI) 39)}
;
NIM_CONST TY90959 TMP3111 = {((NimStringDesc*) &TMP3110),
((NI) 45)}
;
STRING_LITERAL(TMP3112, ": ", 2);
STRING_LITERAL(TMP3113, "getField(record case branch)", 28);
extern TNimType NTI323013; /* JsonParser */
extern TNimType NTI224803; /* TNodeSeq */
extern Gcheap51018 gch_51059;

N_NIMCALL(Tnode224809*, skipcolon_428258)(Tnode224809* n) {
	Tnode224809* 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_323607)(Jsonparser323013* my) {
	NU8 result;
{	result = 0;
	result = (*my).kind;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

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

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

static N_INLINE(NI, len_225098)(Tnode224809* 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(Cell48947*, usrtocell_52646)(void* usr) {
	Cell48947* result;
	result = 0;
	result = ((Cell48947*) ((NI)((NU64)(((NI) (usr))) - (NU64)(((NI)sizeof(Cell48947))))));
	return result;
}

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

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

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

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

N_NIMCALL(Tnode224809*, loadany_428639)(Jsonparser323013* p, Ttype224847* t, Table428650* tab) {
	Tnode224809* result;
{	result = 0;
	switch ((*t).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		NU8 LOC3;
		LOC3 = 0;
		LOC3 = kind_323607((&(*p)));
		switch (LOC3) {
		case ((NU8) 6):
		{
			result = newintnode_225607(((NU8) 6), IL64(0));
		}
		break;
		case ((NU8) 5):
		{
			result = newintnode_225607(((NU8) 6), IL64(1));
		}
		break;
		default:
		{
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3072));
		}
		break;
		}
		next_324446(p);
	}
	break;
	case ((NU8) 2):
	{
		{
			NU8 LOC10;
			NimStringDesc* x;
			LOC10 = 0;
			LOC10 = kind_323607((&(*p)));
			if (!(LOC10 == ((NU8) 2))) goto LA11;
			x = str_323126((&(*p)));
			{
				if (!((x ? x->Sup.len : 0) == ((NI) 1))) goto LA15;
				result = newintnode_225607(((NU8) 6), ((NI64) (((NU8)(x->data[((NI) 0)])))));
				next_324446(p);
				goto BeforeRet;
			}
			LA15: ;
		}
		goto LA8;
		LA11: ;
		{
			NU8 LOC18;
			NI64 LOC21;
			LOC18 = 0;
			LOC18 = kind_323607((&(*p)));
			if (!(LOC18 == ((NU8) 3))) goto LA19;
			LOC21 = 0;
			LOC21 = getint_323207((&(*p)));
			result = newintnode_225607(((NU8) 6), LOC21);
			next_324446(p);
			goto BeforeRet;
		}
		goto LA8;
		LA19: ;
		LA8: ;
		raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3073));
	}
	break;
	case ((NU8) 14):
	{
		{
			NU8 LOC25;
			LOC25 = 0;
			LOC25 = kind_323607((&(*p)));
			if (!(LOC25 == ((NU8) 2))) goto LA26;
			{
				Tnode224809* e_428837;
				Tnode224809* HEX3Atmp_429397;
				e_428837 = 0;
				HEX3Atmp_429397 = 0;
				HEX3Atmp_429397 = (*t).n;
				{
					NI i_429401;
					NI HEX3Atmp_429403;
					NI LOC30;
					NI res_429405;
					i_429401 = 0;
					HEX3Atmp_429403 = 0;
					LOC30 = 0;
					LOC30 = len_225098(HEX3Atmp_429397);
					HEX3Atmp_429403 = (LOC30 - 1);
					res_429405 = ((NI) 0);
					{
						while (1) {
							if (!(res_429405 <= HEX3Atmp_429403)) goto LA32;
							i_429401 = res_429405;
							e_428837 = (*HEX3Atmp_429397).kindU.S6.sons->data[i_429401];
							{
								NimStringDesc* LOC35;
								LOC35 = 0;
								LOC35 = str_323126((&(*p)));
								if (!eqStrings((*(*(*e_428837).kindU.S4.sym).name).s, LOC35)) goto LA36;
								result = newintnode_225607(((NU8) 6), ((NI64) ((*(*e_428837).kindU.S4.sym).position)));
								next_324446(p);
								goto BeforeRet;
							}
							LA36: ;
							res_429405 += ((NI) 1);
						} LA32: ;
					}
				}
			}
		}
		LA26: ;
		raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3074));
	}
	break;
	case ((NU8) 16):
	{
		{
			NU8 LOC41;
			LOC41 = 0;
			LOC41 = kind_323607((&(*p)));
			if (!!((LOC41 == ((NU8) 10)))) goto LA42;
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3075));
		}
		LA42: ;
		next_324446(p);
		result = newnode_225401(((NU8) 41));
		{
			while (1) {
				NIM_BOOL LOC46;
				NU8 LOC47;
				NU8 LOC49;
				Ttype224847* LOC50;
				Tnode224809* LOC51;
				LOC46 = 0;
				LOC47 = 0;
				LOC47 = kind_323607((&(*p)));
				LOC46 = !((LOC47 == ((NU8) 11)));
				if (!(LOC46)) goto LA48;
				LOC49 = 0;
				LOC49 = kind_323607((&(*p)));
				LOC46 = !((LOC49 == ((NU8) 1)));
				LA48: ;
				if (!LOC46) goto LA45;
				LOC50 = 0;
				LOC50 = elemtype_254522(t);
				LOC51 = 0;
				LOC51 = loadany_428639(p, LOC50, tab);
				add_225165(result, LOC51);
			} LA45: ;
		}
		{
			NU8 LOC54;
			LOC54 = 0;
			LOC54 = kind_323607((&(*p)));
			if (!(LOC54 == ((NU8) 11))) goto LA55;
			next_324446(p);
		}
		goto LA52;
		LA55: ;
		{
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3076));
		}
		LA52: ;
	}
	break;
	case ((NU8) 24):
	{
		NU8 LOC59;
		LOC59 = 0;
		LOC59 = kind_323607((&(*p)));
		switch (LOC59) {
		case ((NU8) 7):
		{
			result = newnode_225401(((NU8) 23));
			next_324446(p);
		}
		break;
		case ((NU8) 10):
		{
			next_324446(p);
			result = newnode_225401(((NU8) 41));
			{
				while (1) {
					NIM_BOOL LOC64;
					NU8 LOC65;
					NU8 LOC67;
					Ttype224847* LOC68;
					Tnode224809* LOC69;
					LOC64 = 0;
					LOC65 = 0;
					LOC65 = kind_323607((&(*p)));
					LOC64 = !((LOC65 == ((NU8) 11)));
					if (!(LOC64)) goto LA66;
					LOC67 = 0;
					LOC67 = kind_323607((&(*p)));
					LOC64 = !((LOC67 == ((NU8) 1)));
					LA66: ;
					if (!LOC64) goto LA63;
					LOC68 = 0;
					LOC68 = elemtype_254522(t);
					LOC69 = 0;
					LOC69 = loadany_428639(p, LOC68, tab);
					add_225165(result, LOC69);
				} LA63: ;
			}
			{
				NU8 LOC72;
				LOC72 = 0;
				LOC72 = kind_323607((&(*p)));
				if (!(LOC72 == ((NU8) 11))) goto LA73;
				next_324446(p);
			}
			goto LA70;
			LA73: ;
			{
				raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3077));
			}
			LA70: ;
		}
		break;
		default:
		{
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3078));
		}
		break;
		}
	}
	break;
	case ((NU8) 18):
	{
		NI i;
		{
			NU8 LOC80;
			LOC80 = 0;
			LOC80 = kind_323607((&(*p)));
			if (!!((LOC80 == ((NU8) 8)))) goto LA81;
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3079));
		}
		LA81: ;
		next_324446(p);
		result = newnode_225401(((NU8) 37));
		i = ((NI) 0);
		{
			while (1) {
				NIM_BOOL LOC85;
				NU8 LOC86;
				NU8 LOC88;
				Tnode224809* LOC101;
				LOC85 = 0;
				LOC86 = 0;
				LOC86 = kind_323607((&(*p)));
				LOC85 = !((LOC86 == ((NU8) 9)));
				if (!(LOC85)) goto LA87;
				LOC88 = 0;
				LOC88 = kind_323607((&(*p)));
				LOC85 = !((LOC88 == ((NU8) 1)));
				LA87: ;
				if (!LOC85) goto LA84;
				{
					NU8 LOC91;
					LOC91 = 0;
					LOC91 = kind_323607((&(*p)));
					if (!!((LOC91 == ((NU8) 2)))) goto LA92;
					raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3080));
				}
				LA92: ;
				next_324446(p);
				{
					NI LOC96;
					NimStringDesc* LOC99;
					NimStringDesc* LOC100;
					LOC96 = 0;
					LOC96 = len_227369(t);
					if (!(LOC96 <= i)) goto LA97;
					LOC99 = 0;
					LOC100 = 0;
					LOC100 = typetostring_254032(t, ((NU8) 0));
					LOC99 = rawNewString(LOC100->Sup.len + 30);
appendString(LOC99, ((NimStringDesc*) &TMP3081));
appendString(LOC99, LOC100);
					raiseparseerr_324786((&(*p)), LOC99);
				}
				LA97: ;
				LOC101 = 0;
				LOC101 = loadany_428639(p, (*t).sons->data[i], tab);
				add_225165(result, LOC101);
				i += ((NI) 1);
			} LA84: ;
		}
		{
			NU8 LOC104;
			LOC104 = 0;
			LOC104 = kind_323607((&(*p)));
			if (!(LOC104 == ((NU8) 9))) goto LA105;
			next_324446(p);
		}
		goto LA102;
		LA105: ;
		{
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3082));
		}
		LA102: ;
	}
	break;
	case ((NU8) 17):
	{
		TY242880 LOC114;
		{
			NU8 LOC111;
			LOC111 = 0;
			LOC111 = kind_323607((&(*p)));
			if (!!((LOC111 == ((NU8) 8)))) goto LA112;
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3079));
		}
		LA112: ;
		next_324446(p);
		result = newnode_225401(((NU8) 38));
		if ((*result).kindU.S6.sons) nimGCunrefNoCycle((*result).kindU.S6.sons);
		(*result).kindU.S6.sons = (Tnodeseq224803*) newSeqRC1((&NTI224803), 1);
		memset((void*)LOC114, 0, sizeof(LOC114));
		LOC114[0] = newnode_225401(((NU8) 1));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[0]), LOC114[0]);
		{
			while (1) {
				NIM_BOOL LOC117;
				NU8 LOC118;
				NU8 LOC120;
				Tident197021* ident;
				NimStringDesc* LOC126;
				Tsym224841* field;
				NI pos;
				Tnode224809* fieldnode;
				Tlineinfo189352 LOC137;
				Tsym224841* LOC138;
				Tnode224809* LOC139;
				Tnode224809* LOC140;
				LOC117 = 0;
				LOC118 = 0;
				LOC118 = kind_323607((&(*p)));
				LOC117 = !((LOC118 == ((NU8) 9)));
				if (!(LOC117)) goto LA119;
				LOC120 = 0;
				LOC120 = kind_323607((&(*p)));
				LOC117 = !((LOC120 == ((NU8) 1)));
				LA119: ;
				if (!LOC117) goto LA116;
				{
					NU8 LOC123;
					LOC123 = 0;
					LOC123 = kind_323607((&(*p)));
					if (!!((LOC123 == ((NU8) 2)))) goto LA124;
					raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3080));
				}
				LA124: ;
				LOC126 = 0;
				LOC126 = str_323126((&(*p)));
				ident = getident_197463(LOC126);
				field = lookupinrecord_232236((*t).n, ident);
				{
					NimStringDesc* LOC131;
					NimStringDesc* LOC132;
					if (!field == 0) goto LA129;
					LOC131 = 0;
					LOC132 = 0;
					LOC132 = typetostring_254032(t, ((NU8) 0));
					LOC131 = rawNewString(LOC132->Sup.len + 33);
appendString(LOC131, ((NimStringDesc*) &TMP3086));
appendString(LOC131, LOC132);
					raiseparseerr_324786((&(*p)), LOC131);
				}
				LA129: ;
				next_324446(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 = (Tnodeseq224803*) setLengthSeq(&((*result).kindU.S6.sons)->Sup, sizeof(Tnode224809*), ((NI) ((NI)(pos + ((NI) 1)))));
				}
				LA135: ;
				fieldnode = newnode_225401(((NU8) 34));
				LOC137 = unknownlineinfo_190408();
				LOC138 = 0;
				LOC138 = newsym_225655(((NU8) 19), ident, NIM_NIL, LOC137);
				LOC139 = 0;
				LOC139 = newsymnode_226325(LOC138);
				addson_226819(fieldnode, LOC139);
				LOC140 = 0;
				LOC140 = loadany_428639(p, (*field).typ, tab);
				addson_226819(fieldnode, LOC140);
				asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[pos]), fieldnode);
			} LA116: ;
		}
		{
			NU8 LOC143;
			LOC143 = 0;
			LOC143 = kind_323607((&(*p)));
			if (!(LOC143 == ((NU8) 9))) goto LA144;
			next_324446(p);
		}
		goto LA141;
		LA144: ;
		{
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3082));
		}
		LA141: ;
	}
	break;
	case ((NU8) 19):
	{
		{
			NU8 LOC150;
			LOC150 = 0;
			LOC150 = kind_323607((&(*p)));
			if (!!((LOC150 == ((NU8) 10)))) goto LA151;
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3087));
		}
		LA151: ;
		next_324446(p);
		result = newnode_225401(((NU8) 39));
		{
			while (1) {
				NIM_BOOL LOC155;
				NU8 LOC156;
				NU8 LOC158;
				Ttype224847* LOC159;
				Tnode224809* LOC160;
				LOC155 = 0;
				LOC156 = 0;
				LOC156 = kind_323607((&(*p)));
				LOC155 = !((LOC156 == ((NU8) 11)));
				if (!(LOC155)) goto LA157;
				LOC158 = 0;
				LOC158 = kind_323607((&(*p)));
				LOC155 = !((LOC158 == ((NU8) 1)));
				LA157: ;
				if (!LOC155) goto LA154;
				LOC159 = 0;
				LOC159 = lastson_227426(t);
				LOC160 = 0;
				LOC160 = loadany_428639(p, LOC159, tab);
				add_225165(result, LOC160);
				next_324446(p);
			} LA154: ;
		}
		{
			NU8 LOC163;
			LOC163 = 0;
			LOC163 = kind_323607((&(*p)));
			if (!(LOC163 == ((NU8) 11))) goto LA164;
			next_324446(p);
		}
		goto LA161;
		LA164: ;
		{
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3076));
		}
		LA161: ;
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	{
		NU8 LOC168;
		LOC168 = 0;
		LOC168 = kind_323607((&(*p)));
		switch (LOC168) {
		case ((NU8) 7):
		{
			result = newnode_225401(((NU8) 23));
			next_324446(p);
		}
		break;
		case ((NU8) 3):
		{
			NI64 LOC171;
			LOC171 = 0;
			LOC171 = getint_323207((&(*p)));
			result = getordefault_429098((*tab), LOC171);
			{
				NimStringDesc* LOC176;
				NI64 LOC177;
				NimStringDesc* LOC178;
				if (!result == 0) goto LA174;
				LOC176 = 0;
				LOC177 = 0;
				LOC177 = getint_323207((&(*p)));
				LOC178 = 0;
				LOC178 = nimInt64ToStr(LOC177);
				LOC176 = rawNewString(LOC178->Sup.len + 32);
appendString(LOC176, ((NimStringDesc*) &TMP3088));
appendString(LOC176, LOC178);
				raiseparseerr_324786((&(*p)), LOC176);
			}
			LA174: ;
			next_324446(p);
		}
		break;
		case ((NU8) 10):
		{
			next_324446(p);
			{
				NU8 LOC182;
				NI64 idx;
				Ttype224847* LOC185;
				LOC182 = 0;
				LOC182 = kind_323607((&(*p)));
				if (!(LOC182 == ((NU8) 3))) goto LA183;
				idx = getint_323207((&(*p)));
				next_324446(p);
				LOC185 = 0;
				LOC185 = lastson_227426(t);
				result = loadany_428639(p, LOC185, tab);
				HEX5BHEX5DHEX3D_429162(tab, idx, result);
			}
			goto LA180;
			LA183: ;
			{
				raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3089));
			}
			LA180: ;
			{
				NU8 LOC189;
				LOC189 = 0;
				LOC189 = kind_323607((&(*p)));
				if (!(LOC189 == ((NU8) 11))) goto LA190;
				next_324446(p);
			}
			goto LA187;
			LA190: ;
			{
				raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3090));
			}
			LA187: ;
		}
		break;
		default:
		{
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3091));
		}
		break;
		}
	}
	break;
	case ((NU8) 28):
	case ((NU8) 29):
	{
		NU8 LOC195;
		LOC195 = 0;
		LOC195 = kind_323607((&(*p)));
		switch (LOC195) {
		case ((NU8) 7):
		{
			result = newnode_225401(((NU8) 23));
			next_324446(p);
		}
		break;
		case ((NU8) 2):
		{
			NimStringDesc* LOC198;
			LOC198 = 0;
			LOC198 = str_323126((&(*p)));
			result = newstrnode_225643(((NU8) 20), LOC198);
			next_324446(p);
		}
		break;
		default:
		{
			raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3092));
		}
		break;
		}
	}
	break;
	case ((NU8) 31) ... ((NU8) 35):
	case ((NU8) 40) ... ((NU8) 44):
	{
		{
			NU8 LOC203;
			NI64 LOC206;
			LOC203 = 0;
			LOC203 = kind_323607((&(*p)));
			if (!(LOC203 == ((NU8) 3))) goto LA204;
			LOC206 = 0;
			LOC206 = getint_323207((&(*p)));
			result = newintnode_225607(((NU8) 6), LOC206);
			next_324446(p);
			goto BeforeRet;
		}
		LA204: ;
		raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3093));
	}
	break;
	case ((NU8) 36) ... ((NU8) 39):
	{
		{
			NU8 LOC210;
			NF LOC213;
			LOC210 = 0;
			LOC210 = kind_323607((&(*p)));
			if (!(LOC210 == ((NU8) 4))) goto LA211;
			LOC213 = 0;
			LOC213 = getfloat_323407((&(*p)));
			result = newfloatnode_225631(((NU8) 16), LOC213);
			next_324446(p);
			goto BeforeRet;
		}
		LA211: ;
		raiseparseerr_324786((&(*p)), ((NimStringDesc*) &TMP3094));
	}
	break;
	case ((NU8) 20):
	case ((NU8) 11):
	{
		Ttype224847* LOC215;
		LOC215 = 0;
		LOC215 = lastson_227426(t);
		result = loadany_428639(p, LOC215, tab);
	}
	break;
	default:
	{
		NimStringDesc* LOC217;
		NimStringDesc* LOC218;
		LOC217 = 0;
		LOC218 = 0;
		LOC218 = typetostring_254032(t, ((NU8) 0));
		LOC217 = rawNewString(LOC218->Sup.len + 31);
appendString(LOC217, ((NimStringDesc*) &TMP3095));
appendString(LOC217, LOC218);
		internalerror_195191(LOC217);
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

static N_INLINE(void, close_323116)(Jsonparser323013* my) {
	Baselexer281024* LOC1;
	LOC1 = 0;
	LOC1 = &my->Sup;
	close_281046(LOC1);
}

N_NIMCALL(Tnode224809*, loadany_429461)(NimStringDesc* s, Ttype224847* t) {
	Tnode224809* result;
	Table428650 tab;
	Jsonparser323013 p;
	Stringstreamobj150511* LOC1;
	Streamobj149427* LOC2;
	result = 0;
	memset((void*)(&tab), 0, sizeof(tab));
	chckNil((void*)(&tab));
	memset((void*)(&tab), 0, sizeof(tab));
	inittable_429467(((NI) 64), (&tab));
	memset((void*)(&p), 0, sizeof(p));
	p.Sup.Sup.m_type = (&NTI323013);
	LOC1 = 0;
	LOC1 = newstringstream_150646(s);
	LOC2 = 0;
	LOC2 = &LOC1->Sup;
	open_323091((&p), LOC2, ((NimStringDesc*) &TMP3062));
	next_324446((&p));
	result = loadany_428639((&p), t, (&tab));
	close_323116((&p));
	return result;
}

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

N_NIMCALL(Tsym224841*, getfield_428023)(Tnode224809* n, NI position) {
	Tsym224841* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 138):
	{
		{
			NI i_428040;
			NI HEX3Atmp_428098;
			NI LOC3;
			NI res_428101;
			i_428040 = 0;
			HEX3Atmp_428098 = 0;
			LOC3 = 0;
			LOC3 = sonslen_227387(n);
			HEX3Atmp_428098 = (NI)(LOC3 - ((NI) 1));
			res_428101 = ((NI) 0);
			{
				while (1) {
					if (!(res_428101 <= HEX3Atmp_428098)) goto LA5;
					i_428040 = res_428101;
					result = getfield_428023((*n).kindU.S6.sons->data[i_428040], position);
					{
						if (!!((result == NIM_NIL))) goto LA8;
						goto BeforeRet;
					}
					LA8: ;
					res_428101 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 139):
	{
		result = getfield_428023((*n).kindU.S6.sons->data[((NI) 0)], position);
		{
			if (!!((result == NIM_NIL))) goto LA13;
			goto BeforeRet;
		}
		LA13: ;
		{
			NI i_428079;
			NI HEX3Atmp_428106;
			NI LOC16;
			NI res_428109;
			i_428079 = 0;
			HEX3Atmp_428106 = 0;
			LOC16 = 0;
			LOC16 = sonslen_227387(n);
			HEX3Atmp_428106 = (NI)(LOC16 - ((NI) 1));
			res_428109 = ((NI) 1);
			{
				while (1) {
					if (!(res_428109 <= HEX3Atmp_428106)) goto LA18;
					i_428079 = res_428109;
					switch ((*(*n).kindU.S6.sons->data[i_428079]).kind) {
					case ((NU8) 85):
					case ((NU8) 88):
					{
						Tnode224809* LOC20;
						LOC20 = 0;
						LOC20 = lastson_227406((*n).kindU.S6.sons->data[i_428079]);
						result = getfield_428023(LOC20, position);
						{
							if (!!((result == NIM_NIL))) goto LA23;
							goto BeforeRet;
						}
						LA23: ;
					}
					break;
					default:
					{
						internalerror_195172((*n).info, ((NimStringDesc*) &TMP3113));
					}
					break;
					}
					res_428109 += ((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_428148)(NimStringDesc** s, Ttype224847* typ, Tnode224809* x, Intset221056* stored) {
	NI start;
	{
		NimStringDesc* LOC5;
		if (!!(((*x).kind == ((NU8) 38)))) goto LA3;
		LOC5 = 0;
		LOC5 = HEX24_195279(TMP3109);
		internalerror_195191(LOC5);
	}
	LA3: ;
	start = ((NI) 1);
	{
		NI i_428185;
		NI HEX3Atmp_428236;
		NI LOC7;
		NI res_428239;
		i_428185 = 0;
		HEX3Atmp_428236 = 0;
		LOC7 = 0;
		LOC7 = sonslen_227387(x);
		HEX3Atmp_428236 = (NI)(LOC7 - ((NI) 1));
		res_428239 = start;
		{
			while (1) {
				Tnode224809* it;
				if (!(res_428239 <= HEX3Atmp_428236)) goto LA9;
				i_428185 = res_428239;
				{
					if (!(start < i_428185)) goto LA12;
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3103));
				}
				LA12: ;
				it = (*x).kindU.S6.sons->data[i_428185];
				{
					Tsym224841* 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_195279(TMP3111);
						internalerror_195191(LOC22);
					}
					LA20: ;
					field = (*(*it).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym;
					LOC23 = 0;
					LOC23 = escapejson_328895((*(*field).name).s);
					(*s) = resizeString((*s), LOC23->Sup.len + 0);
appendString((*s), LOC23);
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3112));
					storeany_428137(s, (*field).typ, (*it).kindU.S6.sons->data[((NI) 1)], stored);
				}
				goto LA14;
				LA16: ;
				{
					Tsym224841* field;
					NimStringDesc* LOC27;
					if (!!(((*typ).n == NIM_NIL))) goto LA25;
					field = getfield_428023((*typ).n, i_428185);
					LOC27 = 0;
					LOC27 = escapejson_328895((*(*field).name).s);
					(*s) = resizeString((*s), LOC27->Sup.len + 0);
appendString((*s), LOC27);
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3112));
					storeany_428137(s, (*field).typ, it, stored);
				}
				goto LA14;
				LA25: ;
				LA14: ;
				res_428239 += ((NI) 1);
			} LA9: ;
		}
	}
}

static N_INLINE(NI, ptrtoint_428012)(Tnode224809* x) {
	NI result;
	result = 0;
	result = ((NI) (x));
	return result;
}

N_NIMCALL(void, storeany_428137)(NimStringDesc** s, Ttype224847* t, Tnode224809* a, Intset221056* 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_328895(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*) &TMP3101));
		}
		goto LA14;
		LA18: ;
		{
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3102));
			{
				NI i_428433;
				NI HEX3Atmp_428538;
				NI LOC22;
				NI res_428541;
				i_428433 = 0;
				HEX3Atmp_428538 = 0;
				LOC22 = 0;
				LOC22 = len_225098(a);
				HEX3Atmp_428538 = (NI)(LOC22 - ((NI) 1));
				res_428541 = ((NI) 0);
				{
					while (1) {
						Ttype224847* LOC29;
						Tnode224809* LOC30;
						if (!(res_428541 <= HEX3Atmp_428538)) goto LA24;
						i_428433 = res_428541;
						{
							if (!(((NI) 0) < i_428433)) goto LA27;
							(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3103));
						}
						LA27: ;
						LOC29 = 0;
						LOC29 = elemtype_254522(t);
						LOC30 = 0;
						LOC30 = HEX5BHEX5D_225244(a, i_428433);
						storeany_428137(s, LOC29, LOC30, stored);
						res_428541 += ((NI) 1);
					} LA24: ;
				}
			}
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3104));
		}
		LA14: ;
	}
	break;
	case ((NU8) 18):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3105));
		{
			NI i_428452;
			NI HEX3Atmp_428546;
			NI LOC33;
			NI res_428549;
			i_428452 = 0;
			HEX3Atmp_428546 = 0;
			LOC33 = 0;
			LOC33 = len_227369(t);
			HEX3Atmp_428546 = (LOC33 - 1);
			res_428549 = ((NI) 0);
			{
				while (1) {
					NimStringDesc* LOC40;
					NimStringDesc* LOC41;
					Tnode224809* LOC42;
					Tnode224809* LOC43;
					if (!(res_428549 <= HEX3Atmp_428546)) goto LA35;
					i_428452 = res_428549;
					{
						if (!(((NI) 0) < i_428452)) goto LA38;
						(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3103));
					}
					LA38: ;
					LOC40 = 0;
					LOC41 = 0;
					LOC41 = nimIntToStr(i_428452);
					LOC40 = rawNewString(LOC41->Sup.len + 6);
appendString(LOC40, ((NimStringDesc*) &TMP3106));
appendString(LOC40, LOC41);
					(*s) = resizeString((*s), LOC40->Sup.len + 0);
appendString((*s), LOC40);
					(*s) = resizeString((*s), 3);
appendString((*s), ((NimStringDesc*) &TMP3107));
					LOC42 = 0;
					LOC42 = HEX5BHEX5D_225244(a, i_428452);
					LOC43 = 0;
					LOC43 = skipcolon_428258(LOC42);
					storeany_428137(s, (*t).sons->data[i_428452], LOC43, stored);
					res_428549 += ((NI) 1);
				} LA35: ;
			}
		}
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3108));
	}
	break;
	case ((NU8) 17):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3105));
		storeobj_428148(s, t, a, stored);
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3108));
	}
	break;
	case ((NU8) 19):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3102));
		{
			NI i_428473;
			NI HEX3Atmp_428555;
			NI LOC47;
			NI res_428558;
			i_428473 = 0;
			HEX3Atmp_428555 = 0;
			LOC47 = 0;
			LOC47 = len_225098(a);
			HEX3Atmp_428555 = (LOC47 - 1);
			res_428558 = ((NI) 0);
			{
				while (1) {
					if (!(res_428558 <= HEX3Atmp_428555)) goto LA49;
					i_428473 = res_428558;
					{
						if (!(((NI) 0) < i_428473)) goto LA52;
						(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3103));
					}
					LA52: ;
					{
						Tnode224809* LOC56;
						Tnode224809* x;
						Tnode224809* LOC59;
						Tnode224809* LOC60;
						Ttype224847* LOC61;
						LOC56 = 0;
						LOC56 = HEX5BHEX5D_225244(a, i_428473);
						if (!((*LOC56).kind == ((NU8) 44))) goto LA57;
						LOC59 = 0;
						LOC59 = HEX5BHEX5D_225244(a, i_428473);
						LOC60 = 0;
						LOC60 = HEX5BHEX5D_225244(LOC59, ((NI) 0));
						x = copynode_228660(LOC60);
						LOC61 = 0;
						LOC61 = lastson_227426(t);
						storeany_428137(s, LOC61, x, stored);
						{
							while (1) {
								Tnode224809* LOC64;
								Tnode224809* LOC65;
								Ttype224847* LOC66;
								LOC64 = 0;
								LOC64 = HEX5BHEX5D_225244(a, i_428473);
								LOC65 = 0;
								LOC65 = HEX5BHEX5D_225244(LOC64, ((NI) 1));
								if (!((NI64)((*x).kindU.S1.intval + IL64(1)) <= (*LOC65).kindU.S1.intval)) goto LA63;
								(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3103));
								LOC66 = 0;
								LOC66 = lastson_227426(t);
								storeany_428137(s, LOC66, x, stored);
								(*x).kindU.S1.intval += ((NI) 1);
							} LA63: ;
						}
					}
					goto LA54;
					LA57: ;
					{
						Ttype224847* LOC68;
						Tnode224809* LOC69;
						LOC68 = 0;
						LOC68 = lastson_227426(t);
						LOC69 = 0;
						LOC69 = HEX5BHEX5D_225244(a, i_428473);
						storeany_428137(s, LOC68, LOC69, stored);
					}
					LA54: ;
					res_428558 += ((NI) 1);
				} LA49: ;
			}
		}
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3104));
	}
	break;
	case ((NU8) 20):
	case ((NU8) 11):
	{
		Ttype224847* LOC71;
		LOC71 = 0;
		LOC71 = lastson_227426(t);
		storeany_428137(s, LOC71, a, stored);
	}
	break;
	case ((NU8) 14):
	{
		{
			Tnode224809* e_428496;
			Tnode224809* HEX3Atmp_428563;
			e_428496 = 0;
			HEX3Atmp_428563 = 0;
			HEX3Atmp_428563 = (*t).n;
			{
				NI i_428567;
				NI HEX3Atmp_428569;
				NI LOC75;
				NI res_428571;
				i_428567 = 0;
				HEX3Atmp_428569 = 0;
				LOC75 = 0;
				LOC75 = len_225098(HEX3Atmp_428563);
				HEX3Atmp_428569 = (LOC75 - 1);
				res_428571 = ((NI) 0);
				{
					while (1) {
						if (!(res_428571 <= HEX3Atmp_428569)) goto LA77;
						i_428567 = res_428571;
						e_428496 = (*HEX3Atmp_428563).kindU.S6.sons->data[i_428567];
						{
							NimStringDesc* LOC82;
							if (!(((NI64) ((*(*e_428496).kindU.S4.sym).position)) == (*a).kindU.S1.intval)) goto LA80;
							LOC82 = 0;
							LOC82 = escapejson_328895((*(*(*e_428496).kindU.S4.sym).name).s);
							(*s) = resizeString((*s), LOC82->Sup.len + 0);
appendString((*s), LOC82);
							goto LA73;
						}
						LA80: ;
						res_428571 += ((NI) 1);
					} LA77: ;
				}
			}
		} LA73: ;
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	{
		Tnode224809* 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*) &TMP3101));
		}
		goto LA84;
		LA88: ;
		{
			NI LOC91;
			NIM_BOOL LOC92;
			NI LOC95;
			NimStringDesc* LOC96;
			LOC91 = 0;
			LOC91 = ptrtoint_428012(x);
			LOC92 = 0;
			LOC92 = containsorincl_221898(stored, LOC91);
			if (!LOC92) goto LA93;
			LOC95 = 0;
			LOC95 = ptrtoint_428012(x);
			LOC96 = 0;
			LOC96 = nimIntToStr(LOC95);
			(*s) = resizeString((*s), LOC96->Sup.len + 0);
appendString((*s), LOC96);
		}
		goto LA84;
		LA93: ;
		{
			NI LOC98;
			NimStringDesc* LOC99;
			Ttype224847* LOC100;
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3102));
			LOC98 = 0;
			LOC98 = ptrtoint_428012(x);
			LOC99 = 0;
			LOC99 = nimIntToStr(LOC98);
			(*s) = resizeString((*s), LOC99->Sup.len + 0);
appendString((*s), LOC99);
			(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3103));
			LOC100 = 0;
			LOC100 = lastson_227426(t);
			storeany_428137(s, LOC100, a, stored);
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3104));
		}
		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*) &TMP3101));
		}
		goto LA102;
		LA106: ;
		{
			NimStringDesc* LOC109;
			LOC109 = 0;
			LOC109 = escapejson_328895((*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_254032(t, ((NU8) 0));
		LOC115 = rawNewString(LOC116->Sup.len + 31);
appendString(LOC115, ((NimStringDesc*) &TMP3095));
appendString(LOC115, LOC116);
		internalerror_195172((*a).info, LOC115);
	}
	break;
	}
}

N_NIMCALL(void, storeany_428625)(NimStringDesc** s, Ttype224847* t, Tnode224809* a) {
	Intset221056 stored;
	memset((void*)(&stored), 0, sizeof(stored));
	chckNil((void*)(&stored));
	memset((void*)(&stored), 0, sizeof(stored));
	initintset_221927((&stored));
	storeany_428137(s, t, a, (&stored));
}
NIM_EXTERNC N_NOINLINE(void, compiler_vmmarshalInit000)(void) {
}

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

