/* Generated by Nim Compiler v0.13.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 Tnode214790 Tnode214790;
typedef struct Ttype214828 Ttype214828;
typedef struct Tlineinfo182337 Tlineinfo182337;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct Tsym214822 Tsym214822;
typedef struct Tident189012 Tident189012;
typedef struct Tnodeseq214784 Tnodeseq214784;
typedef struct Table398590 Table398590;
typedef struct Keyvaluepairseq398593 Keyvaluepairseq398593;
typedef struct Jsonparser305010 Jsonparser305010;
typedef struct Baselexer265009 Baselexer265009;
typedef struct TNimObject TNimObject;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct Streamobj144418 Streamobj144418;
typedef struct TY305060 TY305060;
typedef struct Stringstreamobj145149 Stringstreamobj145149;
typedef struct Tidobj189006 Tidobj189006;
typedef struct Ttypeseq214824 Ttypeseq214824;
typedef struct Tloc214804 Tloc214804;
typedef struct Ropeobj169006 Ropeobj169006;
typedef struct Tscope214816 Tscope214816;
typedef struct TY214925 TY214925;
typedef struct Tstrtable214794 Tstrtable214794;
typedef struct Tsymseq214792 Tsymseq214792;
typedef struct Tlib214808 Tlib214808;
typedef struct Cell47505 Cell47505;
typedef struct Cellseq47521 Cellseq47521;
typedef struct Gcheap49818 Gcheap49818;
typedef struct Gcstack49816 Gcstack49816;
typedef struct Cellset47517 Cellset47517;
typedef struct Pagedesc47513 Pagedesc47513;
typedef struct Memregion29688 Memregion29688;
typedef struct Smallchunk29640 Smallchunk29640;
typedef struct Llchunk29682 Llchunk29682;
typedef struct Bigchunk29642 Bigchunk29642;
typedef struct Intset29614 Intset29614;
typedef struct Trunk29610 Trunk29610;
typedef struct Avlnode29686 Avlnode29686;
typedef struct Gcstat49814 Gcstat49814;
typedef struct Intset211035 Intset211035;
typedef struct Trunk211031 Trunk211031;
typedef struct Trunkseq211033 Trunkseq211033;
typedef struct TY88487 TY88487;
typedef struct Keyvaluepair398596 Keyvaluepair398596;
typedef struct Tinstantiation214812 Tinstantiation214812;
typedef struct Tlistentry135010 Tlistentry135010;
typedef struct Basechunk29638 Basechunk29638;
typedef struct Freecell29630 Freecell29630;
typedef struct TY214913 TY214913;
struct  Tlineinfo182337  {
NI16 line;
NI16 col;
NI32 fileindex;
};
struct  TGenericSeq  {
NI len;
NI reserved;
};
struct  NimStringDesc  {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct  Tnode214790  {
Ttype214828* typ;
Tlineinfo182337 info;
NU16 flags;
NU8 kind;
union{
struct {NI64 intval;
} S1;
struct {NF floatval;
} S2;
struct {NimStringDesc* strval;
} S3;
struct {Tsym214822* sym;
} S4;
struct {Tident189012* ident;
} S5;
struct {Tnodeseq214784* sons;
} S6;
} kindU;
NimStringDesc* comment;
};
struct  Table398590  {
Keyvaluepairseq398593* data;
NI counter;
};
typedef N_NIMCALL_PTR(void, TY3489) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, TY3494) (void* p);
struct  TNimType  {
NI size;
NU8 kind;
NU8 flags;
TNimType* base;
TNimNode* node;
void* finalizer;
TY3489 marker;
TY3494 deepcopy;
};
struct  TNimObject  {
TNimType* m_type;
};
typedef NU8 TY202404[32];
struct  Baselexer265009  {
  TNimObject Sup;
NI bufpos;
NCSTRING buf;
NI buflen;
Streamobj144418* input;
NI linenumber;
NI sentinel;
NI linestart;
TY202404 refillchars;
};
struct  Jsonparser305010  {
  Baselexer265009 Sup;
NimStringDesc* a;
NU8 tok;
NU8 kind;
NU8 err;
TY305060* state;
NimStringDesc* filename;
};
struct  TNimNode  {
NU8 kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct  Tidobj189006  {
  TNimObject Sup;
NI id;
};
struct  Tloc214804  {
NU8 k;
NU8 s;
NU16 flags;
Ttype214828* t;
Ropeobj169006* r;
Ropeobj169006* heaproot;
};
struct  Ttype214828  {
  Tidobj189006 Sup;
NU8 kind;
NU8 callconv;
NU32 flags;
Ttypeseq214824* sons;
Tnode214790* n;
Tsym214822* owner;
Tsym214822* sym;
Tsym214822* destructor;
Tsym214822* deepcopy;
Tsym214822* assignment;
NI64 size;
NI16 align;
NI16 locklevel;
Tloc214804 loc;
};
struct  Tstrtable214794  {
NI counter;
Tsymseq214792* data;
};
struct  Tsym214822  {
  Tidobj189006 Sup;
NU8 kind;
union{
struct {Ttypeseq214824* typeinstcache;
Tscope214816* typscope;
} S1;
struct {TY214925* procinstcache;
Tsym214822* gcunsafetyreason;
} S2;
struct {TY214925* usedgenerics;
Tstrtable214794 tab;
} S3;
struct {Tsym214822* guard;
NI bitsize;
} S4;
} kindU;
NU8 magic;
Ttype214828* typ;
Tident189012* name;
Tlineinfo182337 info;
Tsym214822* owner;
NU32 flags;
Tnode214790* ast;
NU32 options;
NI position;
NI offset;
Tloc214804 loc;
Tlib214808* annex;
Tnode214790* constraint;
};
struct  Tident189012  {
  Tidobj189006 Sup;
NimStringDesc* s;
Tident189012* next;
NI h;
};
struct  Cell47505  {
NI refcount;
TNimType* typ;
};
struct  Cellseq47521  {
NI len;
NI cap;
Cell47505** d;
};
struct  Cellset47517  {
NI counter;
NI max;
Pagedesc47513* head;
Pagedesc47513** data;
};
typedef Smallchunk29640* TY29703[512];
typedef Trunk29610* Trunkbuckets29612[256];
struct  Intset29614  {
Trunkbuckets29612 data;
};
struct  Memregion29688  {
NI minlargeobj;
NI maxlargeobj;
TY29703 freesmallchunks;
Llchunk29682* llmem;
NI currmem;
NI maxmem;
NI freemem;
NI lastsize;
Bigchunk29642* freechunkslist;
Intset29614 chunkstarts;
Avlnode29686* root;
Avlnode29686* deleted;
Avlnode29686* last;
Avlnode29686* freeavlnodes;
};
struct  Gcstat49814  {
NI stackscans;
NI cyclecollections;
NI maxthreshold;
NI maxstacksize;
NI maxstackcells;
NI cycletablesize;
NI64 maxpause;
};
struct  Gcheap49818  {
Gcstack49816* stack;
void* stackbottom;
NI cyclethreshold;
Cellseq47521 zct;
Cellseq47521 decstack;
Cellset47517 cycleroots;
Cellseq47521 tempstack;
NI recgclock;
Memregion29688 region;
Gcstat49814 stat;
};
typedef Tnode214790* TY230280[1];
struct  Intset211035  {
NI counter;
NI max;
Trunk211031* head;
Trunkseq211033* data;
};
struct TY88487 {
NimStringDesc* Field0;
NI Field1;
};
struct Keyvaluepair398596 {
NI Field0;
NI64 Field1;
Tnode214790* Field2;
};
typedef N_NIMCALL_PTR(void, TY144419) (Streamobj144418* s);
typedef N_NIMCALL_PTR(NIM_BOOL, TY144423) (Streamobj144418* s);
typedef N_NIMCALL_PTR(void, TY144427) (Streamobj144418* s, NI pos);
typedef N_NIMCALL_PTR(NI, TY144432) (Streamobj144418* s);
typedef N_NIMCALL_PTR(NI, TY144436) (Streamobj144418* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(NI, TY144442) (Streamobj144418* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(void, TY144448) (Streamobj144418* s, void* buffer, NI buflen);
typedef N_NIMCALL_PTR(void, TY144454) (Streamobj144418* s);
struct  Streamobj144418  {
  TNimObject Sup;
TY144419 closeimpl;
TY144423 atendimpl;
TY144427 setpositionimpl;
TY144432 getpositionimpl;
TY144436 readdataimpl;
TY144442 peekdataimpl;
TY144448 writedataimpl;
TY144454 flushimpl;
};
struct  Stringstreamobj145149  {
  Streamobj144418 Sup;
NimStringDesc* data;
NI pos;
};
struct  Ropeobj169006  {
  TNimObject Sup;
Ropeobj169006* left;
Ropeobj169006* right;
NI length;
NimStringDesc* data;
};
struct  Tscope214816  {
NI depthlevel;
Tstrtable214794 symbols;
Tnodeseq214784* usingsyms;
Tscope214816* parent;
};
struct  Tlistentry135010  {
  TNimObject Sup;
Tlistentry135010* prev;
Tlistentry135010* next;
};
struct  Tlib214808  {
  Tlistentry135010 Sup;
NU8 kind;
NIM_BOOL generated;
NIM_BOOL isoverriden;
Ropeobj169006* name;
Tnode214790* path;
};
struct  Gcstack49816  {
Gcstack49816* prev;
Gcstack49816* next;
void* starts;
void* pos;
NI maxstacksize;
};
typedef NI TY29619[8];
struct  Pagedesc47513  {
Pagedesc47513* next;
NI key;
TY29619 bits;
};
struct  Basechunk29638  {
NI prevsize;
NI size;
NIM_BOOL used;
};
struct  Smallchunk29640  {
  Basechunk29638 Sup;
Smallchunk29640* next;
Smallchunk29640* prev;
Freecell29630* freelist;
NI free;
NI acc;
NF data;
};
struct  Llchunk29682  {
NI size;
NI acc;
Llchunk29682* next;
};
struct  Bigchunk29642  {
  Basechunk29638 Sup;
Bigchunk29642* next;
Bigchunk29642* prev;
NI align;
NF data;
};
struct  Trunk29610  {
Trunk29610* next;
NI key;
TY29619 bits;
};
typedef Avlnode29686* TY29693[2];
struct  Avlnode29686  {
TY29693 link;
NI key;
NI upperbound;
NI level;
};
struct  Trunk211031  {
Trunk211031* next;
NI key;
TY29619 bits;
};
struct  Tinstantiation214812  {
Tsym214822* sym;
Ttypeseq214824* concretetypes;
TY214913* usedby;
NI compilesid;
};
struct  Freecell29630  {
Freecell29630* next;
NI zerofield;
};
struct Tnodeseq214784 {
  TGenericSeq Sup;
  Tnode214790* data[SEQ_DECL_SIZE];
};
struct Keyvaluepairseq398593 {
  TGenericSeq Sup;
  Keyvaluepair398596 data[SEQ_DECL_SIZE];
};
struct TY305060 {
  TGenericSeq Sup;
  NU8 data[SEQ_DECL_SIZE];
};
struct Ttypeseq214824 {
  TGenericSeq Sup;
  Ttype214828* data[SEQ_DECL_SIZE];
};
struct TY214925 {
  TGenericSeq Sup;
  Tinstantiation214812* data[SEQ_DECL_SIZE];
};
struct Tsymseq214792 {
  TGenericSeq Sup;
  Tsym214822* data[SEQ_DECL_SIZE];
};
struct Trunkseq211033 {
  TGenericSeq Sup;
  Trunk211031* data[SEQ_DECL_SIZE];
};
struct TY214913 {
  TGenericSeq Sup;
  NI32 data[SEQ_DECL_SIZE];
};
N_NIMCALL(void, inittable_399379)(NI initialsize, Table398590* Result);
N_NOINLINE(void, chckNil)(void* p);
N_NIMCALL(void, open_305079)(Jsonparser305010* my, Streamobj144418* input, NimStringDesc* filename);
N_NIMCALL(Stringstreamobj145149*, newstringstream_145233)(NimStringDesc* s);
N_NIMCALL(void, next_306334)(Jsonparser305010* my);
N_NIMCALL(Tnode214790*, loadany_398579)(Jsonparser305010* p, Ttype214828* t, Table398590* tab);
static N_INLINE(NU8, kind_305601)(Jsonparser305010* my);
N_NIMCALL(Tnode214790*, newintnode_215659)(NU8 kind, NI64 intval);
N_NOINLINE(void, raiseparseerr_306659)(Jsonparser305010* p, NimStringDesc* msg) __attribute__((noreturn));
static N_INLINE(NimStringDesc*, str_305102)(Jsonparser305010* my);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(NI64, getint_305201)(Jsonparser305010* my);
N_NIMCALL(NI64, nsuParseBiggestInt)(NimStringDesc* s);
static N_INLINE(NI, len_215059)(Tnode214790* n);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
N_NIMCALL(Tnode214790*, newnode_215401)(NU8 kind);
N_NIMCALL(void, add_215114)(Tnode214790* father, Tnode214790* son);
N_NIMCALL(Ttype214828*, elemtype_240383)(Ttype214828* t);
N_NIMCALL(NI, len_217339)(Ttype214828* n);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NimStringDesc*, typetostring_240017)(Ttype214828* typ, NU8 prefer);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(Cell47505*, usrtocell_51440)(void* usr);
static N_INLINE(void, rtladdzct_53001)(Cell47505* c);
N_NOINLINE(void, addzct_51417)(Cellseq47521* s, Cell47505* c);
N_NIMCALL(void*, newSeqRC1)(TNimType* typ, NI len);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_NIMCALL(Tident189012*, getident_189441)(NimStringDesc* identifier);
N_NIMCALL(Tsym214822*, lookupinrecord_221140)(Tnode214790* n, Tident189012* field);
N_NIMCALL(TGenericSeq*, setLengthSeq)(TGenericSeq* seq, NI elemsize, NI newlen);
N_NIMCALL(void, addson_216807)(Tnode214790* father, Tnode214790* son);
N_NIMCALL(Tnode214790*, newsymnode_216234)(Tsym214822* sym);
N_NIMCALL(Tsym214822*, newsym_215683)(NU8 symkind, Tident189012* name, Tsym214822* owner, Tlineinfo182337 info);
N_NIMCALL(Tlineinfo182337, unknownlineinfo_183087)(void);
N_NIMCALL(Ttype214828*, lastson_217377)(Ttype214828* n);
N_NIMCALL(Tnode214790*, getordefault_399098)(Table398590 t, NI64 key);
N_NIMCALL(NimStringDesc*, nimInt64ToStr)(NI64 x);
N_NIMCALL(void, HEX5BHEX5DHEX3D_399150)(Table398590* t, NI64 key, Tnode214790* val);
N_NIMCALL(Tnode214790*, newstrnode_215677)(NU8 kind, NimStringDesc* strval);
N_NIMCALL(Tnode214790*, newfloatnode_215671)(NU8 kind, NF floatval);
static N_INLINE(NF, getfloat_305401)(Jsonparser305010* my);
N_NIMCALL(NF, nsuParseFloat)(NimStringDesc* s);
N_NIMCALL(void, internalerror_187113)(NimStringDesc* errmsg);
static N_INLINE(void, close_305098)(Jsonparser305010* my);
N_NIMCALL(void, close_265022)(Baselexer265009* L);
N_NIMCALL(void, initintset_211885)(Intset211035* Result);
N_NIMCALL(void, storeany_398096)(NimStringDesc** s, Ttype214828* t, Tnode214790* a, Intset211035* stored);
N_NIMCALL(NimStringDesc*, nimBoolToStr)(NIM_BOOL x);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(NimStringDesc*, escapejson_310644)(NimStringDesc* s);
N_NIMCALL(NimStringDesc*, nimCharToStr)(NIM_CHAR x);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
static N_INLINE(Tnode214790*, HEX5BHEX5D_215238)(Tnode214790* n, NI i);
N_NIMCALL(Tnode214790*, skipcolon_398198)(Tnode214790* n);
N_NIMCALL(void, storeobj_398104)(NimStringDesc** s, Ttype214828* typ, Tnode214790* x, Intset211035* stored);
N_NIMCALL(NimStringDesc*, HEX24_187183)(TY88487 x);
N_NIMCALL(NI, sonslen_217351)(Tnode214790* n);
N_NIMCALL(Tsym214822*, getfield_398008)(Tnode214790* n, NI position);
N_NIMCALL(Tnode214790*, lastson_217364)(Tnode214790* n);
N_NIMCALL(void, internalerror_187100)(Tlineinfo182337 info, NimStringDesc* errmsg);
N_NIMCALL(Tnode214790*, copynode_218542)(Tnode214790* src);
N_NIMCALL(NIM_BOOL, containsorincl_211862)(Intset211035* s, NI key);
static N_INLINE(NI, ptrtoint_398003)(Tnode214790* x);
N_NIMCALL(NimStringDesc*, nimFloatToStr)(NF f);
STRING_LITERAL(TMP3103, "unknown file", 12);
STRING_LITERAL(TMP3113, "\'true\' or \'false\' expected for a bool", 37);
STRING_LITERAL(TMP3114, "string of length 1 expected for a char", 38);
STRING_LITERAL(TMP3115, "string expected for an enum", 27);
STRING_LITERAL(TMP3116, "\'[\' expected for an array", 25);
STRING_LITERAL(TMP3117, "\']\' end of array expected", 25);
STRING_LITERAL(TMP3118, "", 0);
STRING_LITERAL(TMP3119, "\'[\' expected for a seq", 22);
STRING_LITERAL(TMP3120, "\'{\' expected for an object", 26);
STRING_LITERAL(TMP3121, "string expected for a field name", 32);
STRING_LITERAL(TMP3122, "too many fields to tuple type ", 30);
STRING_LITERAL(TMP3123, "\'}\' end of object expected", 26);
STRING_LITERAL(TMP3124, "unknown field for object of type ", 33);
STRING_LITERAL(TMP3125, "\'[\' expected for a set", 22);
STRING_LITERAL(TMP3126, "cannot load object with address ", 32);
STRING_LITERAL(TMP3127, "index for ref type expected", 27);
STRING_LITERAL(TMP3128, "\']\' end of ref-address pair expected", 36);
STRING_LITERAL(TMP3129, "int for pointer type expected", 29);
STRING_LITERAL(TMP3130, "string expected", 15);
STRING_LITERAL(TMP3131, "int expected", 12);
STRING_LITERAL(TMP3132, "float expected", 14);
STRING_LITERAL(TMP3133, "cannot marshal at compile-time ", 31);
STRING_LITERAL(TMP3139, "null", 4);
STRING_LITERAL(TMP3140, "[", 1);
STRING_LITERAL(TMP3141, ", ", 2);
STRING_LITERAL(TMP3142, "]", 1);
STRING_LITERAL(TMP3143, "{", 1);
STRING_LITERAL(TMP3144, "\"Field", 6);
STRING_LITERAL(TMP3145, "\": ", 3);
STRING_LITERAL(TMP3146, "}", 1);
STRING_LITERAL(TMP3148, "compiler/vmmarshal.nim", 22);
NIM_CONST TY88487 TMP3147 = {((NimStringDesc*) &TMP3148),
((NI) 39)}
;
NIM_CONST TY88487 TMP3149 = {((NimStringDesc*) &TMP3148),
((NI) 45)}
;
STRING_LITERAL(TMP3150, ": ", 2);
STRING_LITERAL(TMP3151, "getField(record case branch)", 28);
extern TNimType NTI305010; /* JsonParser */
extern TNimType NTI214784; /* TNodeSeq */
extern Gcheap49818 gch_49859;

N_NIMCALL(Tnode214790*, skipcolon_398198)(Tnode214790* n) {
	Tnode214790* 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_305601)(Jsonparser305010* my) {
	NU8 result;
{	result = 0;
	result = (*my).kind;
	goto BeforeRet;
	}BeforeRet: ;
	return result;
}

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

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

static N_INLINE(NI, len_215059)(Tnode214790* 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(Cell47505*, usrtocell_51440)(void* usr) {
	Cell47505* result;
	result = 0;
	result = ((Cell47505*) ((NI)((NU64)(((NI) (usr))) - (NU64)(((NI)sizeof(Cell47505))))));
	return result;
}

static N_INLINE(void, rtladdzct_53001)(Cell47505* c) {
	addzct_51417((&gch_49859.zct), c);
}

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

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

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

N_NIMCALL(Tnode214790*, loadany_398579)(Jsonparser305010* p, Ttype214828* t, Table398590* tab) {
	Tnode214790* result;
{	result = 0;
	switch ((*t).kind) {
	case ((NU8) 0):
	{
	}
	break;
	case ((NU8) 1):
	{
		NU8 LOC3;
		LOC3 = 0;
		LOC3 = kind_305601((&(*p)));
		switch (LOC3) {
		case ((NU8) 6):
		{
			result = newintnode_215659(((NU8) 6), IL64(0));
		}
		break;
		case ((NU8) 5):
		{
			result = newintnode_215659(((NU8) 6), IL64(1));
		}
		break;
		default:
		{
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3113));
		}
		break;
		}
		next_306334(p);
	}
	break;
	case ((NU8) 2):
	{
		{
			NU8 LOC10;
			NimStringDesc* x;
			LOC10 = 0;
			LOC10 = kind_305601((&(*p)));
			if (!(LOC10 == ((NU8) 2))) goto LA11;
			x = str_305102((&(*p)));
			{
				if (!((x ? x->Sup.len : 0) == ((NI) 1))) goto LA15;
				result = newintnode_215659(((NU8) 6), ((NI64) (((NU8)(x->data[((NI) 0)])))));
				next_306334(p);
				goto BeforeRet;
			}
			LA15: ;
		}
		goto LA8;
		LA11: ;
		{
			NU8 LOC18;
			NI64 LOC21;
			LOC18 = 0;
			LOC18 = kind_305601((&(*p)));
			if (!(LOC18 == ((NU8) 3))) goto LA19;
			LOC21 = 0;
			LOC21 = getint_305201((&(*p)));
			result = newintnode_215659(((NU8) 6), LOC21);
			next_306334(p);
			goto BeforeRet;
		}
		goto LA8;
		LA19: ;
		LA8: ;
		raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3114));
	}
	break;
	case ((NU8) 14):
	{
		{
			NU8 LOC25;
			LOC25 = 0;
			LOC25 = kind_305601((&(*p)));
			if (!(LOC25 == ((NU8) 2))) goto LA26;
			{
				Tnode214790* e_398837;
				Tnode214790* HEX3Atmp_399357;
				e_398837 = 0;
				HEX3Atmp_399357 = 0;
				HEX3Atmp_399357 = (*t).n;
				{
					NI i_399361;
					NI HEX3Atmp_399363;
					NI LOC30;
					NI res_399365;
					i_399361 = 0;
					HEX3Atmp_399363 = 0;
					LOC30 = 0;
					LOC30 = len_215059(HEX3Atmp_399357);
					HEX3Atmp_399363 = (LOC30 - 1);
					res_399365 = ((NI) 0);
					{
						while (1) {
							if (!(res_399365 <= HEX3Atmp_399363)) goto LA32;
							i_399361 = res_399365;
							e_398837 = (*HEX3Atmp_399357).kindU.S6.sons->data[i_399361];
							{
								NimStringDesc* LOC35;
								LOC35 = 0;
								LOC35 = str_305102((&(*p)));
								if (!eqStrings((*(*(*e_398837).kindU.S4.sym).name).s, LOC35)) goto LA36;
								result = newintnode_215659(((NU8) 6), ((NI64) ((*(*e_398837).kindU.S4.sym).position)));
								next_306334(p);
								goto BeforeRet;
							}
							LA36: ;
							res_399365 += ((NI) 1);
						} LA32: ;
					}
				}
			}
		}
		LA26: ;
		raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3115));
	}
	break;
	case ((NU8) 16):
	{
		{
			NU8 LOC41;
			LOC41 = 0;
			LOC41 = kind_305601((&(*p)));
			if (!!((LOC41 == ((NU8) 10)))) goto LA42;
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3116));
		}
		LA42: ;
		next_306334(p);
		result = newnode_215401(((NU8) 41));
		{
			while (1) {
				NIM_BOOL LOC46;
				NU8 LOC47;
				NU8 LOC49;
				Ttype214828* LOC50;
				Tnode214790* LOC51;
				LOC46 = 0;
				LOC47 = 0;
				LOC47 = kind_305601((&(*p)));
				LOC46 = !((LOC47 == ((NU8) 11)));
				if (!(LOC46)) goto LA48;
				LOC49 = 0;
				LOC49 = kind_305601((&(*p)));
				LOC46 = !((LOC49 == ((NU8) 1)));
				LA48: ;
				if (!LOC46) goto LA45;
				LOC50 = 0;
				LOC50 = elemtype_240383(t);
				LOC51 = 0;
				LOC51 = loadany_398579(p, LOC50, tab);
				add_215114(result, LOC51);
			} LA45: ;
		}
		{
			NU8 LOC54;
			LOC54 = 0;
			LOC54 = kind_305601((&(*p)));
			if (!(LOC54 == ((NU8) 11))) goto LA55;
			next_306334(p);
		}
		goto LA52;
		LA55: ;
		{
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3117));
		}
		LA52: ;
	}
	break;
	case ((NU8) 24):
	{
		NU8 LOC59;
		LOC59 = 0;
		LOC59 = kind_305601((&(*p)));
		switch (LOC59) {
		case ((NU8) 7):
		{
			result = newnode_215401(((NU8) 23));
			next_306334(p);
		}
		break;
		case ((NU8) 10):
		{
			next_306334(p);
			result = newnode_215401(((NU8) 41));
			{
				while (1) {
					NIM_BOOL LOC64;
					NU8 LOC65;
					NU8 LOC67;
					Ttype214828* LOC68;
					Tnode214790* LOC69;
					LOC64 = 0;
					LOC65 = 0;
					LOC65 = kind_305601((&(*p)));
					LOC64 = !((LOC65 == ((NU8) 11)));
					if (!(LOC64)) goto LA66;
					LOC67 = 0;
					LOC67 = kind_305601((&(*p)));
					LOC64 = !((LOC67 == ((NU8) 1)));
					LA66: ;
					if (!LOC64) goto LA63;
					LOC68 = 0;
					LOC68 = elemtype_240383(t);
					LOC69 = 0;
					LOC69 = loadany_398579(p, LOC68, tab);
					add_215114(result, LOC69);
				} LA63: ;
			}
			{
				NU8 LOC72;
				LOC72 = 0;
				LOC72 = kind_305601((&(*p)));
				if (!(LOC72 == ((NU8) 11))) goto LA73;
				next_306334(p);
			}
			goto LA70;
			LA73: ;
			{
				raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3118));
			}
			LA70: ;
		}
		break;
		default:
		{
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3119));
		}
		break;
		}
	}
	break;
	case ((NU8) 18):
	{
		NI i;
		{
			NU8 LOC80;
			LOC80 = 0;
			LOC80 = kind_305601((&(*p)));
			if (!!((LOC80 == ((NU8) 8)))) goto LA81;
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3120));
		}
		LA81: ;
		next_306334(p);
		result = newnode_215401(((NU8) 37));
		i = ((NI) 0);
		{
			while (1) {
				NIM_BOOL LOC85;
				NU8 LOC86;
				NU8 LOC88;
				Tnode214790* LOC101;
				LOC85 = 0;
				LOC86 = 0;
				LOC86 = kind_305601((&(*p)));
				LOC85 = !((LOC86 == ((NU8) 9)));
				if (!(LOC85)) goto LA87;
				LOC88 = 0;
				LOC88 = kind_305601((&(*p)));
				LOC85 = !((LOC88 == ((NU8) 1)));
				LA87: ;
				if (!LOC85) goto LA84;
				{
					NU8 LOC91;
					LOC91 = 0;
					LOC91 = kind_305601((&(*p)));
					if (!!((LOC91 == ((NU8) 2)))) goto LA92;
					raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3121));
				}
				LA92: ;
				next_306334(p);
				{
					NI LOC96;
					NimStringDesc* LOC99;
					NimStringDesc* LOC100;
					LOC96 = 0;
					LOC96 = len_217339(t);
					if (!(LOC96 <= i)) goto LA97;
					LOC99 = 0;
					LOC100 = 0;
					LOC100 = typetostring_240017(t, ((NU8) 0));
					LOC99 = rawNewString(LOC100->Sup.len + 30);
appendString(LOC99, ((NimStringDesc*) &TMP3122));
appendString(LOC99, LOC100);
					raiseparseerr_306659((&(*p)), LOC99);
				}
				LA97: ;
				LOC101 = 0;
				LOC101 = loadany_398579(p, (*t).sons->data[i], tab);
				add_215114(result, LOC101);
				i += ((NI) 1);
			} LA84: ;
		}
		{
			NU8 LOC104;
			LOC104 = 0;
			LOC104 = kind_305601((&(*p)));
			if (!(LOC104 == ((NU8) 9))) goto LA105;
			next_306334(p);
		}
		goto LA102;
		LA105: ;
		{
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3123));
		}
		LA102: ;
	}
	break;
	case ((NU8) 17):
	{
		TY230280 LOC114;
		{
			NU8 LOC111;
			LOC111 = 0;
			LOC111 = kind_305601((&(*p)));
			if (!!((LOC111 == ((NU8) 8)))) goto LA112;
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3120));
		}
		LA112: ;
		next_306334(p);
		result = newnode_215401(((NU8) 38));
		if ((*result).kindU.S6.sons) nimGCunrefNoCycle((*result).kindU.S6.sons);
		(*result).kindU.S6.sons = (Tnodeseq214784*) newSeqRC1((&NTI214784), 1);
		memset((void*)LOC114, 0, sizeof(LOC114));
		LOC114[0] = newnode_215401(((NU8) 1));
		asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[0]), LOC114[0]);
		{
			while (1) {
				NIM_BOOL LOC117;
				NU8 LOC118;
				NU8 LOC120;
				Tident189012* ident;
				NimStringDesc* LOC126;
				Tsym214822* field;
				NI pos;
				Tnode214790* fieldnode;
				Tlineinfo182337 LOC137;
				Tsym214822* LOC138;
				Tnode214790* LOC139;
				Tnode214790* LOC140;
				LOC117 = 0;
				LOC118 = 0;
				LOC118 = kind_305601((&(*p)));
				LOC117 = !((LOC118 == ((NU8) 9)));
				if (!(LOC117)) goto LA119;
				LOC120 = 0;
				LOC120 = kind_305601((&(*p)));
				LOC117 = !((LOC120 == ((NU8) 1)));
				LA119: ;
				if (!LOC117) goto LA116;
				{
					NU8 LOC123;
					LOC123 = 0;
					LOC123 = kind_305601((&(*p)));
					if (!!((LOC123 == ((NU8) 2)))) goto LA124;
					raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3121));
				}
				LA124: ;
				LOC126 = 0;
				LOC126 = str_305102((&(*p)));
				ident = getident_189441(LOC126);
				field = lookupinrecord_221140((*t).n, ident);
				{
					NimStringDesc* LOC131;
					NimStringDesc* LOC132;
					if (!field == 0) goto LA129;
					LOC131 = 0;
					LOC132 = 0;
					LOC132 = typetostring_240017(t, ((NU8) 0));
					LOC131 = rawNewString(LOC132->Sup.len + 33);
appendString(LOC131, ((NimStringDesc*) &TMP3124));
appendString(LOC131, LOC132);
					raiseparseerr_306659((&(*p)), LOC131);
				}
				LA129: ;
				next_306334(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 = (Tnodeseq214784*) setLengthSeq(&((*result).kindU.S6.sons)->Sup, sizeof(Tnode214790*), ((NI) ((NI)(pos + ((NI) 1)))));
				}
				LA135: ;
				fieldnode = newnode_215401(((NU8) 34));
				LOC137 = unknownlineinfo_183087();
				LOC138 = 0;
				LOC138 = newsym_215683(((NU8) 18), ident, NIM_NIL, LOC137);
				LOC139 = 0;
				LOC139 = newsymnode_216234(LOC138);
				addson_216807(fieldnode, LOC139);
				LOC140 = 0;
				LOC140 = loadany_398579(p, (*field).typ, tab);
				addson_216807(fieldnode, LOC140);
				asgnRefNoCycle((void**) (&(*result).kindU.S6.sons->data[pos]), fieldnode);
			} LA116: ;
		}
		{
			NU8 LOC143;
			LOC143 = 0;
			LOC143 = kind_305601((&(*p)));
			if (!(LOC143 == ((NU8) 9))) goto LA144;
			next_306334(p);
		}
		goto LA141;
		LA144: ;
		{
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3123));
		}
		LA141: ;
	}
	break;
	case ((NU8) 19):
	{
		{
			NU8 LOC150;
			LOC150 = 0;
			LOC150 = kind_305601((&(*p)));
			if (!!((LOC150 == ((NU8) 10)))) goto LA151;
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3125));
		}
		LA151: ;
		next_306334(p);
		result = newnode_215401(((NU8) 39));
		{
			while (1) {
				NIM_BOOL LOC155;
				NU8 LOC156;
				NU8 LOC158;
				Ttype214828* LOC159;
				Tnode214790* LOC160;
				LOC155 = 0;
				LOC156 = 0;
				LOC156 = kind_305601((&(*p)));
				LOC155 = !((LOC156 == ((NU8) 11)));
				if (!(LOC155)) goto LA157;
				LOC158 = 0;
				LOC158 = kind_305601((&(*p)));
				LOC155 = !((LOC158 == ((NU8) 1)));
				LA157: ;
				if (!LOC155) goto LA154;
				LOC159 = 0;
				LOC159 = lastson_217377(t);
				LOC160 = 0;
				LOC160 = loadany_398579(p, LOC159, tab);
				add_215114(result, LOC160);
				next_306334(p);
			} LA154: ;
		}
		{
			NU8 LOC163;
			LOC163 = 0;
			LOC163 = kind_305601((&(*p)));
			if (!(LOC163 == ((NU8) 11))) goto LA164;
			next_306334(p);
		}
		goto LA161;
		LA164: ;
		{
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3117));
		}
		LA161: ;
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	{
		NU8 LOC168;
		LOC168 = 0;
		LOC168 = kind_305601((&(*p)));
		switch (LOC168) {
		case ((NU8) 7):
		{
			result = newnode_215401(((NU8) 23));
			next_306334(p);
		}
		break;
		case ((NU8) 3):
		{
			NI64 LOC171;
			LOC171 = 0;
			LOC171 = getint_305201((&(*p)));
			result = getordefault_399098((*tab), LOC171);
			{
				NimStringDesc* LOC176;
				NI64 LOC177;
				NimStringDesc* LOC178;
				if (!result == 0) goto LA174;
				LOC176 = 0;
				LOC177 = 0;
				LOC177 = getint_305201((&(*p)));
				LOC178 = 0;
				LOC178 = nimInt64ToStr(LOC177);
				LOC176 = rawNewString(LOC178->Sup.len + 32);
appendString(LOC176, ((NimStringDesc*) &TMP3126));
appendString(LOC176, LOC178);
				raiseparseerr_306659((&(*p)), LOC176);
			}
			LA174: ;
			next_306334(p);
		}
		break;
		case ((NU8) 10):
		{
			next_306334(p);
			{
				NU8 LOC182;
				NI64 idx;
				Ttype214828* LOC185;
				LOC182 = 0;
				LOC182 = kind_305601((&(*p)));
				if (!(LOC182 == ((NU8) 3))) goto LA183;
				idx = getint_305201((&(*p)));
				next_306334(p);
				LOC185 = 0;
				LOC185 = lastson_217377(t);
				result = loadany_398579(p, LOC185, tab);
				HEX5BHEX5DHEX3D_399150(tab, idx, result);
			}
			goto LA180;
			LA183: ;
			{
				raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3127));
			}
			LA180: ;
			{
				NU8 LOC189;
				LOC189 = 0;
				LOC189 = kind_305601((&(*p)));
				if (!(LOC189 == ((NU8) 11))) goto LA190;
				next_306334(p);
			}
			goto LA187;
			LA190: ;
			{
				raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3128));
			}
			LA187: ;
		}
		break;
		default:
		{
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3129));
		}
		break;
		}
	}
	break;
	case ((NU8) 28):
	case ((NU8) 29):
	{
		NU8 LOC195;
		LOC195 = 0;
		LOC195 = kind_305601((&(*p)));
		switch (LOC195) {
		case ((NU8) 7):
		{
			result = newnode_215401(((NU8) 23));
			next_306334(p);
		}
		break;
		case ((NU8) 2):
		{
			NimStringDesc* LOC198;
			LOC198 = 0;
			LOC198 = str_305102((&(*p)));
			result = newstrnode_215677(((NU8) 20), LOC198);
			next_306334(p);
		}
		break;
		default:
		{
			raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3130));
		}
		break;
		}
	}
	break;
	case ((NU8) 31) ... ((NU8) 35):
	case ((NU8) 40) ... ((NU8) 44):
	{
		{
			NU8 LOC203;
			NI64 LOC206;
			LOC203 = 0;
			LOC203 = kind_305601((&(*p)));
			if (!(LOC203 == ((NU8) 3))) goto LA204;
			LOC206 = 0;
			LOC206 = getint_305201((&(*p)));
			result = newintnode_215659(((NU8) 6), LOC206);
			next_306334(p);
			goto BeforeRet;
		}
		LA204: ;
		raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3131));
	}
	break;
	case ((NU8) 36) ... ((NU8) 39):
	{
		{
			NU8 LOC210;
			NF LOC213;
			LOC210 = 0;
			LOC210 = kind_305601((&(*p)));
			if (!(LOC210 == ((NU8) 4))) goto LA211;
			LOC213 = 0;
			LOC213 = getfloat_305401((&(*p)));
			result = newfloatnode_215671(((NU8) 16), LOC213);
			next_306334(p);
			goto BeforeRet;
		}
		LA211: ;
		raiseparseerr_306659((&(*p)), ((NimStringDesc*) &TMP3132));
	}
	break;
	case ((NU8) 20):
	case ((NU8) 11):
	{
		Ttype214828* LOC215;
		LOC215 = 0;
		LOC215 = lastson_217377(t);
		result = loadany_398579(p, LOC215, tab);
	}
	break;
	default:
	{
		NimStringDesc* LOC217;
		NimStringDesc* LOC218;
		LOC217 = 0;
		LOC218 = 0;
		LOC218 = typetostring_240017(t, ((NU8) 0));
		LOC217 = rawNewString(LOC218->Sup.len + 31);
appendString(LOC217, ((NimStringDesc*) &TMP3133));
appendString(LOC217, LOC218);
		internalerror_187113(LOC217);
	}
	break;
	}
	}BeforeRet: ;
	return result;
}

static N_INLINE(void, close_305098)(Jsonparser305010* my) {
	Baselexer265009* LOC1;
	LOC1 = 0;
	LOC1 = &my->Sup;
	close_265022(LOC1);
}

N_NIMCALL(Tnode214790*, loadany_399373)(NimStringDesc* s, Ttype214828* t) {
	Tnode214790* result;
	Table398590 tab;
	Jsonparser305010 p;
	Stringstreamobj145149* LOC1;
	Streamobj144418* LOC2;
	result = 0;
	memset((void*)(&tab), 0, sizeof(tab));
	chckNil((void*)(&tab));
	memset((void*)(&tab), 0, sizeof(tab));
	inittable_399379(((NI) 64), (&tab));
	memset((void*)(&p), 0, sizeof(p));
	p.Sup.Sup.m_type = (&NTI305010);
	LOC1 = 0;
	LOC1 = newstringstream_145233(s);
	LOC2 = 0;
	LOC2 = &LOC1->Sup;
	open_305079((&p), LOC2, ((NimStringDesc*) &TMP3103));
	next_306334((&p));
	result = loadany_398579((&p), t, (&tab));
	close_305098((&p));
	return result;
}

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

N_NIMCALL(Tsym214822*, getfield_398008)(Tnode214790* n, NI position) {
	Tsym214822* result;
{	result = 0;
	switch ((*n).kind) {
	case ((NU8) 138):
	{
		{
			NI i_398024;
			NI HEX3Atmp_398081;
			NI LOC3;
			NI res_398084;
			i_398024 = 0;
			HEX3Atmp_398081 = 0;
			LOC3 = 0;
			LOC3 = sonslen_217351(n);
			HEX3Atmp_398081 = (NI)(LOC3 - ((NI) 1));
			res_398084 = ((NI) 0);
			{
				while (1) {
					if (!(res_398084 <= HEX3Atmp_398081)) goto LA5;
					i_398024 = res_398084;
					result = getfield_398008((*n).kindU.S6.sons->data[i_398024], position);
					{
						if (!!((result == NIM_NIL))) goto LA8;
						goto BeforeRet;
					}
					LA8: ;
					res_398084 += ((NI) 1);
				} LA5: ;
			}
		}
	}
	break;
	case ((NU8) 139):
	{
		result = getfield_398008((*n).kindU.S6.sons->data[((NI) 0)], position);
		{
			if (!!((result == NIM_NIL))) goto LA13;
			goto BeforeRet;
		}
		LA13: ;
		{
			NI i_398062;
			NI HEX3Atmp_398089;
			NI LOC16;
			NI res_398092;
			i_398062 = 0;
			HEX3Atmp_398089 = 0;
			LOC16 = 0;
			LOC16 = sonslen_217351(n);
			HEX3Atmp_398089 = (NI)(LOC16 - ((NI) 1));
			res_398092 = ((NI) 1);
			{
				while (1) {
					if (!(res_398092 <= HEX3Atmp_398089)) goto LA18;
					i_398062 = res_398092;
					switch ((*(*n).kindU.S6.sons->data[i_398062]).kind) {
					case ((NU8) 85):
					case ((NU8) 88):
					{
						Tnode214790* LOC20;
						LOC20 = 0;
						LOC20 = lastson_217364((*n).kindU.S6.sons->data[i_398062]);
						result = getfield_398008(LOC20, position);
						{
							if (!!((result == NIM_NIL))) goto LA23;
							goto BeforeRet;
						}
						LA23: ;
					}
					break;
					default:
					{
						internalerror_187100((*n).info, ((NimStringDesc*) &TMP3151));
					}
					break;
					}
					res_398092 += ((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_398104)(NimStringDesc** s, Ttype214828* typ, Tnode214790* x, Intset211035* stored) {
	NI start;
	{
		NimStringDesc* LOC5;
		if (!!(((*x).kind == ((NU8) 38)))) goto LA3;
		LOC5 = 0;
		LOC5 = HEX24_187183(TMP3147);
		internalerror_187113(LOC5);
	}
	LA3: ;
	start = ((NI) 1);
	{
		NI i_398140;
		NI HEX3Atmp_398191;
		NI LOC7;
		NI res_398194;
		i_398140 = 0;
		HEX3Atmp_398191 = 0;
		LOC7 = 0;
		LOC7 = sonslen_217351(x);
		HEX3Atmp_398191 = (NI)(LOC7 - ((NI) 1));
		res_398194 = start;
		{
			while (1) {
				Tnode214790* it;
				if (!(res_398194 <= HEX3Atmp_398191)) goto LA9;
				i_398140 = res_398194;
				{
					if (!(start < i_398140)) goto LA12;
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3141));
				}
				LA12: ;
				it = (*x).kindU.S6.sons->data[i_398140];
				{
					Tsym214822* 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_187183(TMP3149);
						internalerror_187113(LOC22);
					}
					LA20: ;
					field = (*(*it).kindU.S6.sons->data[((NI) 0)]).kindU.S4.sym;
					LOC23 = 0;
					LOC23 = escapejson_310644((*(*field).name).s);
					(*s) = resizeString((*s), LOC23->Sup.len + 0);
appendString((*s), LOC23);
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3150));
					storeany_398096(s, (*field).typ, (*it).kindU.S6.sons->data[((NI) 1)], stored);
				}
				goto LA14;
				LA16: ;
				{
					Tsym214822* field;
					NimStringDesc* LOC27;
					if (!!(((*typ).n == NIM_NIL))) goto LA25;
					field = getfield_398008((*typ).n, i_398140);
					LOC27 = 0;
					LOC27 = escapejson_310644((*(*field).name).s);
					(*s) = resizeString((*s), LOC27->Sup.len + 0);
appendString((*s), LOC27);
					(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3150));
					storeany_398096(s, (*field).typ, it, stored);
				}
				goto LA14;
				LA25: ;
				LA14: ;
				res_398194 += ((NI) 1);
			} LA9: ;
		}
	}
}

static N_INLINE(NI, ptrtoint_398003)(Tnode214790* x) {
	NI result;
	result = 0;
	result = ((NI) (x));
	return result;
}

N_NIMCALL(void, storeany_398096)(NimStringDesc** s, Ttype214828* t, Tnode214790* a, Intset211035* 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_310644(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*) &TMP3139));
		}
		goto LA14;
		LA18: ;
		{
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3140));
			{
				NI i_398432;
				NI HEX3Atmp_398535;
				NI LOC22;
				NI res_398538;
				i_398432 = 0;
				HEX3Atmp_398535 = 0;
				LOC22 = 0;
				LOC22 = len_215059(a);
				HEX3Atmp_398535 = (NI)(LOC22 - ((NI) 1));
				res_398538 = ((NI) 0);
				{
					while (1) {
						Ttype214828* LOC29;
						Tnode214790* LOC30;
						if (!(res_398538 <= HEX3Atmp_398535)) goto LA24;
						i_398432 = res_398538;
						{
							if (!(((NI) 0) < i_398432)) goto LA27;
							(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3141));
						}
						LA27: ;
						LOC29 = 0;
						LOC29 = elemtype_240383(t);
						LOC30 = 0;
						LOC30 = HEX5BHEX5D_215238(a, i_398432);
						storeany_398096(s, LOC29, LOC30, stored);
						res_398538 += ((NI) 1);
					} LA24: ;
				}
			}
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3142));
		}
		LA14: ;
	}
	break;
	case ((NU8) 18):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3143));
		{
			NI i_398450;
			NI HEX3Atmp_398543;
			NI LOC33;
			NI res_398546;
			i_398450 = 0;
			HEX3Atmp_398543 = 0;
			LOC33 = 0;
			LOC33 = len_217339(t);
			HEX3Atmp_398543 = (LOC33 - 1);
			res_398546 = ((NI) 0);
			{
				while (1) {
					NimStringDesc* LOC40;
					NimStringDesc* LOC41;
					Tnode214790* LOC42;
					Tnode214790* LOC43;
					if (!(res_398546 <= HEX3Atmp_398543)) goto LA35;
					i_398450 = res_398546;
					{
						if (!(((NI) 0) < i_398450)) goto LA38;
						(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3141));
					}
					LA38: ;
					LOC40 = 0;
					LOC41 = 0;
					LOC41 = nimIntToStr(i_398450);
					LOC40 = rawNewString(LOC41->Sup.len + 6);
appendString(LOC40, ((NimStringDesc*) &TMP3144));
appendString(LOC40, LOC41);
					(*s) = resizeString((*s), LOC40->Sup.len + 0);
appendString((*s), LOC40);
					(*s) = resizeString((*s), 3);
appendString((*s), ((NimStringDesc*) &TMP3145));
					LOC42 = 0;
					LOC42 = HEX5BHEX5D_215238(a, i_398450);
					LOC43 = 0;
					LOC43 = skipcolon_398198(LOC42);
					storeany_398096(s, (*t).sons->data[i_398450], LOC43, stored);
					res_398546 += ((NI) 1);
				} LA35: ;
			}
		}
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3146));
	}
	break;
	case ((NU8) 17):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3143));
		storeobj_398104(s, t, a, stored);
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3146));
	}
	break;
	case ((NU8) 19):
	{
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3140));
		{
			NI i_398470;
			NI HEX3Atmp_398552;
			NI LOC47;
			NI res_398555;
			i_398470 = 0;
			HEX3Atmp_398552 = 0;
			LOC47 = 0;
			LOC47 = len_215059(a);
			HEX3Atmp_398552 = (LOC47 - 1);
			res_398555 = ((NI) 0);
			{
				while (1) {
					if (!(res_398555 <= HEX3Atmp_398552)) goto LA49;
					i_398470 = res_398555;
					{
						if (!(((NI) 0) < i_398470)) goto LA52;
						(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3141));
					}
					LA52: ;
					{
						Tnode214790* LOC56;
						Tnode214790* x;
						Tnode214790* LOC59;
						Tnode214790* LOC60;
						Ttype214828* LOC61;
						LOC56 = 0;
						LOC56 = HEX5BHEX5D_215238(a, i_398470);
						if (!((*LOC56).kind == ((NU8) 44))) goto LA57;
						LOC59 = 0;
						LOC59 = HEX5BHEX5D_215238(a, i_398470);
						LOC60 = 0;
						LOC60 = HEX5BHEX5D_215238(LOC59, ((NI) 0));
						x = copynode_218542(LOC60);
						LOC61 = 0;
						LOC61 = lastson_217377(t);
						storeany_398096(s, LOC61, x, stored);
						{
							while (1) {
								Tnode214790* LOC64;
								Tnode214790* LOC65;
								Ttype214828* LOC66;
								LOC64 = 0;
								LOC64 = HEX5BHEX5D_215238(a, i_398470);
								LOC65 = 0;
								LOC65 = HEX5BHEX5D_215238(LOC64, ((NI) 1));
								if (!((NI64)((*x).kindU.S1.intval + IL64(1)) <= (*LOC65).kindU.S1.intval)) goto LA63;
								(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3141));
								LOC66 = 0;
								LOC66 = lastson_217377(t);
								storeany_398096(s, LOC66, x, stored);
								(*x).kindU.S1.intval += ((NI) 1);
							} LA63: ;
						}
					}
					goto LA54;
					LA57: ;
					{
						Ttype214828* LOC68;
						Tnode214790* LOC69;
						LOC68 = 0;
						LOC68 = lastson_217377(t);
						LOC69 = 0;
						LOC69 = HEX5BHEX5D_215238(a, i_398470);
						storeany_398096(s, LOC68, LOC69, stored);
					}
					LA54: ;
					res_398555 += ((NI) 1);
				} LA49: ;
			}
		}
		(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3142));
	}
	break;
	case ((NU8) 20):
	case ((NU8) 11):
	{
		Ttype214828* LOC71;
		LOC71 = 0;
		LOC71 = lastson_217377(t);
		storeany_398096(s, LOC71, a, stored);
	}
	break;
	case ((NU8) 14):
	{
		{
			Tnode214790* e_398493;
			Tnode214790* HEX3Atmp_398560;
			e_398493 = 0;
			HEX3Atmp_398560 = 0;
			HEX3Atmp_398560 = (*t).n;
			{
				NI i_398564;
				NI HEX3Atmp_398566;
				NI LOC75;
				NI res_398568;
				i_398564 = 0;
				HEX3Atmp_398566 = 0;
				LOC75 = 0;
				LOC75 = len_215059(HEX3Atmp_398560);
				HEX3Atmp_398566 = (LOC75 - 1);
				res_398568 = ((NI) 0);
				{
					while (1) {
						if (!(res_398568 <= HEX3Atmp_398566)) goto LA77;
						i_398564 = res_398568;
						e_398493 = (*HEX3Atmp_398560).kindU.S6.sons->data[i_398564];
						{
							NimStringDesc* LOC82;
							if (!(((NI64) ((*(*e_398493).kindU.S4.sym).position)) == (*a).kindU.S1.intval)) goto LA80;
							LOC82 = 0;
							LOC82 = escapejson_310644((*(*(*e_398493).kindU.S4.sym).name).s);
							(*s) = resizeString((*s), LOC82->Sup.len + 0);
appendString((*s), LOC82);
							goto LA73;
						}
						LA80: ;
						res_398568 += ((NI) 1);
					} LA77: ;
				}
			}
		} LA73: ;
	}
	break;
	case ((NU8) 21):
	case ((NU8) 22):
	{
		Tnode214790* 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*) &TMP3139));
		}
		goto LA84;
		LA88: ;
		{
			NI LOC91;
			NIM_BOOL LOC92;
			NI LOC95;
			NimStringDesc* LOC96;
			LOC91 = 0;
			LOC91 = ptrtoint_398003(x);
			LOC92 = 0;
			LOC92 = containsorincl_211862(stored, LOC91);
			if (!LOC92) goto LA93;
			LOC95 = 0;
			LOC95 = ptrtoint_398003(x);
			LOC96 = 0;
			LOC96 = nimIntToStr(LOC95);
			(*s) = resizeString((*s), LOC96->Sup.len + 0);
appendString((*s), LOC96);
		}
		goto LA84;
		LA93: ;
		{
			NI LOC98;
			NimStringDesc* LOC99;
			Ttype214828* LOC100;
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3140));
			LOC98 = 0;
			LOC98 = ptrtoint_398003(x);
			LOC99 = 0;
			LOC99 = nimIntToStr(LOC98);
			(*s) = resizeString((*s), LOC99->Sup.len + 0);
appendString((*s), LOC99);
			(*s) = resizeString((*s), 2);
appendString((*s), ((NimStringDesc*) &TMP3141));
			LOC100 = 0;
			LOC100 = lastson_217377(t);
			storeany_398096(s, LOC100, a, stored);
			(*s) = resizeString((*s), 1);
appendString((*s), ((NimStringDesc*) &TMP3142));
		}
		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*) &TMP3139));
		}
		goto LA102;
		LA106: ;
		{
			NimStringDesc* LOC109;
			LOC109 = 0;
			LOC109 = escapejson_310644((*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_240017(t, ((NU8) 0));
		LOC115 = rawNewString(LOC116->Sup.len + 31);
appendString(LOC115, ((NimStringDesc*) &TMP3133));
appendString(LOC115, LOC116);
		internalerror_187100((*a).info, LOC115);
	}
	break;
	}
}

N_NIMCALL(void, storeany_398571)(NimStringDesc** s, Ttype214828* t, Tnode214790* a) {
	Intset211035 stored;
	memset((void*)(&stored), 0, sizeof(stored));
	chckNil((void*)(&stored));
	memset((void*)(&stored), 0, sizeof(stored));
	initintset_211885((&stored));
	storeany_398096(s, t, a, (&stored));
}
NIM_EXTERNC N_NOINLINE(void, compiler_vmmarshalInit000)(void) {
}

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

