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

#include "nimbase.h"
#include <string.h>
#include <setjmp.h>
#include <stdio.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q;
typedef struct tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg;
typedef struct tySequence_MlAD6nAPq9bHKla9cWiIZP0g tySequence_MlAD6nAPq9bHKla9cWiIZP0g;
typedef struct tySequence_oLpBKXzW3hF9aCVMo5EymfQ tySequence_oLpBKXzW3hF9aCVMo5EymfQ;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack_7fytPA5bBsob6See21YMRA tyObject_GcStack_7fytPA5bBsob6See21YMRA;
typedef struct tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg;
typedef struct tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ;
typedef struct tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg;
typedef struct tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw;
typedef struct tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA;
typedef struct tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw;
typedef struct tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg;
typedef struct tyTuple_ujsjpB2O9cjj3uDHsXbnSzg tyTuple_ujsjpB2O9cjj3uDHsXbnSzg;
typedef struct tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg;
typedef struct tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ;
typedef struct tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg;
typedef struct tyTuple_awOivLjlO76sGdHY7nQUjQ tyTuple_awOivLjlO76sGdHY7nQUjQ;
typedef struct tyTuple_jq7X5k7hWG0tdTZTDkiyGQ tyTuple_jq7X5k7hWG0tdTZTDkiyGQ;
typedef struct tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ;
typedef struct tyObject_IOError_iLZrPn9anoh9ad1MmO0RczFw tyObject_IOError_iLZrPn9anoh9ad1MmO0RczFw;
typedef struct tyObject_CatchableError_qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError_qrLSDoe2oBoAqNtJ9badtnA;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
typedef struct tySequence_uB9b75OUPRENsBAu4AnoePA tySequence_uB9b75OUPRENsBAu4AnoePA;
typedef struct tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ;
typedef struct tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ;
typedef struct tyObject_BaseLexer_MAw8rJZtJ279bVV3TWMtXSg tyObject_BaseLexer_MAw8rJZtJ279bVV3TWMtXSg;
typedef struct tySequence_Ih0V9cYug0VPJyBBGvgEH7Q tySequence_Ih0V9cYug0VPJyBBGvgEH7Q;
typedef struct TSafePoint TSafePoint;
typedef struct tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg;
struct tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg {
tySequence_MlAD6nAPq9bHKla9cWiIZP0g* data;
NI counter;
NI first;
NI last;
};
struct tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q {
tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg kind;
union{
struct {NimStringDesc* str;
} S1;
struct {NI64 num;
} S2;
struct {NF fnum;
} S3;
struct {NIM_BOOL bval;
} S4;
struct {tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg fields;
} S6;
struct {tySequence_oLpBKXzW3hF9aCVMo5EymfQ* elems;
} S7;
} _Ukind;
};
typedef NU8 tyEnum_TNimKind_jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc_ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc_WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
tyEnum_TNimKind_jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag_v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc_ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc_WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind_unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind_unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
struct tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack_7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk_tXn60W2f8h3jgAYdEmy5NQ* tyArray_SiRwrEKZdLgxqz9a9aoVBglg[512];
typedef NU32 tyArray_BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg* tyArray_N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray_N1u1nqOgmuJN9cSZrnMHgOQ tyArray_B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk_W0r8S0Y3UGke6T9bIUWnnuw* tyArray_lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA {
tyArray_lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* tyArray_0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw {
tyArray_0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple_ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk_Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple_ujsjpB2O9cjj3uDHsXbnSzg tyArray_LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray_LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray_SiRwrEKZdLgxqz9a9aoVBglg freeSmallChunks;
NU32 flBitmap;
tyArray_BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray_B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk_XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet_EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode_IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks_PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc_fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack_7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion_x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat_0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet_jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
struct tyTuple_awOivLjlO76sGdHY7nQUjQ {
NI Field0;
NI Field1;
NimStringDesc* Field2;
tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* Field3;
};
struct tyTuple_jq7X5k7hWG0tdTZTDkiyGQ {
NimStringDesc* Field0;
tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* Field1;
};
typedef NU8 tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ;
struct RootObj {
TNimType* m_type;
};
struct Exception {
  RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringDesc* message;
tySequence_uB9b75OUPRENsBAu4AnoePA* trace;
NU raise_id;
Exception* up;
};
struct tyObject_CatchableError_qrLSDoe2oBoAqNtJ9badtnA {
  Exception Sup;
};
struct tyObject_IOError_iLZrPn9anoh9ad1MmO0RczFw {
  tyObject_CatchableError_qrLSDoe2oBoAqNtJ9badtnA Sup;
};
typedef NU8 tySet_tyChar_nmiMWKVIe46vacnhAFrQvw[32];
struct tyObject_BaseLexer_MAw8rJZtJ279bVV3TWMtXSg {
  RootObj Sup;
NI bufpos;
NCSTRING buf;
NI bufLen;
tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* input;
NI lineNumber;
NI sentinel;
NI lineStart;
NI offsetBase;
tySet_tyChar_nmiMWKVIe46vacnhAFrQvw refillChars;
};
typedef NU8 tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw;
typedef NU8 tyEnum_JsonEventKind_0zjE9c54eTrq224F5wMcaFA;
typedef NU8 tyEnum_JsonError_G9cw5MrJXJrcpID5JXaplew;
struct tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ {
  tyObject_BaseLexer_MAw8rJZtJ279bVV3TWMtXSg Sup;
NimStringDesc* a;
tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw tok;
tyEnum_JsonEventKind_0zjE9c54eTrq224F5wMcaFA kind;
tyEnum_JsonError_G9cw5MrJXJrcpID5JXaplew err;
tySequence_Ih0V9cYug0VPJyBBGvgEH7Q* state;
NimStringDesc* filename;
NIM_BOOL rawStringLiterals;
};
typedef struct {
N_NIMCALL_PTR(NIM_BOOL, ClP_0) (Exception* e, void* ClE_0);
void* ClE_0;
} tyProc_NT9bSe2DDkjdtx7j9aov2Z6g;
struct TSafePoint {
TSafePoint* prev;
NI status;
jmp_buf context;
NIM_BOOL hasRaiseAction;
tyProc_NT9bSe2DDkjdtx7j9aov2Z6g raiseAction;
};
typedef N_NIMCALL_PTR(void, tyProc_JQrsH08b4uPTH9cyFPlVOZg) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc_9bmhFrLahRsL2hltfRDVtlQ) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
typedef N_NIMCALL_PTR(void, tyProc_3svSoGIUJIsHkaBL7q4DAQ) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s, NI pos);
typedef N_NIMCALL_PTR(NI, tyProc_xflqkf2D1uVClg70czEDHA) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s);
typedef N_NIMCALL_PTR(NI, tyProc_2VVzVL9bOnKhj1eZKkf9cEuA) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
typedef N_NIMCALL_PTR(void, tyProc_ki6p1QyfOkJLQJ9aw5NI0AQ) (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s, void* buffer, NI bufLen);
struct tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ {
  RootObj Sup;
tyProc_JQrsH08b4uPTH9cyFPlVOZg closeImpl;
tyProc_9bmhFrLahRsL2hltfRDVtlQ atEndImpl;
tyProc_3svSoGIUJIsHkaBL7q4DAQ setPositionImpl;
tyProc_xflqkf2D1uVClg70czEDHA getPositionImpl;
tyProc_2VVzVL9bOnKhj1eZKkf9cEuA readDataImpl;
tyProc_2VVzVL9bOnKhj1eZKkf9cEuA peekDataImpl;
tyProc_ki6p1QyfOkJLQJ9aw5NI0AQ writeDataImpl;
tyProc_JQrsH08b4uPTH9cyFPlVOZg flushImpl;
};
struct tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ {
  tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ Sup;
FILE* f;
};
struct tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
typedef NU8 tyEnum_ParserState_Na0rM2Zdr3RpxeNeXbvLrQ;
struct tySequence_oLpBKXzW3hF9aCVMo5EymfQ {
  TGenericSeq Sup;
  tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* data[SEQ_DECL_SIZE];
};
struct tySequence_MlAD6nAPq9bHKla9cWiIZP0g {
  TGenericSeq Sup;
  tyTuple_awOivLjlO76sGdHY7nQUjQ data[SEQ_DECL_SIZE];
};
struct tySequence_uB9b75OUPRENsBAu4AnoePA {
  TGenericSeq Sup;
  tyObject_StackTraceEntry_oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];
};
struct tySequence_Ih0V9cYug0VPJyBBGvgEH7Q {
  TGenericSeq Sup;
  tyEnum_ParserState_Na0rM2Zdr3RpxeNeXbvLrQ data[SEQ_DECL_SIZE];
};
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
N_NIMCALL(NimStringDesc*, rawNewString)(NI cap);
N_LIB_PRIVATE N_NIMCALL(void, escapeJson_xxovtptDIL7ctJosN3ocbA)(NimStringDesc* s, NimStringDesc** result);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(void, escapeJsonUnquoted_xxovtptDIL7ctJosN3ocbA_2)(NimStringDesc* s, NimStringDesc** result);
N_NIMCALL(NimStringDesc*, nimIntToStr)(NI x);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuToHex)(NI64 x, NI len);
N_NIMCALL(NimStringDesc*, addChar)(NimStringDesc* s, NIM_CHAR c);
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tySequence_oLpBKXzW3hF9aCVMo5EymfQ)(void* p, NI op);
static N_NIMCALL(void, Marker_tyRef_zfzzuQ8txrdZAYK0WGWpHg)(void* p, NI op);
N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr);
static N_INLINE(void, rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT_fCDI7oO1NNVXXURtxSzsRw)(tyObject_CellSeq_Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b);
static N_INLINE(NIM_BOOL, equalMem_DCrUjdaMvFDHaR1hs7sQGwropes)(void* a, void* b, NI size);
static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq__fL0tq3d6JfMw9bvY7G6spBQ)(tySequence_oLpBKXzW3hF9aCVMo5EymfQ* x, tySequence_oLpBKXzW3hF9aCVMo5EymfQ* y);
static N_INLINE(NI, len_YcGrPJJ4pElek9cAaf09a9bmQjson)(tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg t);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem_2Mfumf6CnyNlShDWdIgobwsystem)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL, isFilled_IxXD1UAPoEehVDW9cv9cRaewtables)(NI hcode);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, hasKey_iqm6UDESHopNXjGmU4P7nA)(tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg t, NimStringDesc* key);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq__Ujpjfumo30l2ielPaquw0Q)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* a, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* b);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q**, X5BX5D__3MszA1IsDLkWcBk0f4ZIOQ)(tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg* t, NimStringDesc* key);
N_NIMCALL(TGenericSeq*, incrSeqV3)(TGenericSeq* s, TNimType* typ);
static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJArray_phgxr9cKlc0dmrJpCth52pw)(void);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJObject_phgxr9cKlc0dmrJpCth52pw_2)(void);
N_LIB_PRIVATE N_NIMCALL(void, initOrderedTable_fiyAoB3KBEd8q02UaahGaw)(NI initialSize, tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg* Result);
N_LIB_PRIVATE N_NIMCALL(void, X5BX5Deq__79bwPu2H8TyyZ9cDM1RrH17A)(tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg* t, NimStringDesc* key, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* val);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
N_LIB_PRIVATE N_NIMCALL(NI, len_1r8KCEmq7uHhZ2GR9c7tsOA)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* n);
N_LIB_PRIVATE N_NIMCALL(void, toUgly_5SA9aXRryVJvgoCag29cRzQw)(NimStringDesc** result, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* node);
N_LIB_PRIVATE N_NIMCALL(void, add_IbYQ9cTcoQ89aIwM2IEYGMng)(NimStringDesc** result, NI64 x);
N_LIB_PRIVATE N_NIMCALL(void, add_A9bDQDKw5SEqD3OvtOnC1bg)(NimStringDesc** result, NF x);
N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
N_LIB_PRIVATE N_NIMCALL(void, toPretty_MHqQ3FKhfxfdLtBgX2QXeQ)(NimStringDesc** result, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* node, NI indent, NIM_BOOL ml, NIM_BOOL lstArr, NI currIndent);
N_LIB_PRIVATE N_NIMCALL(void, indent_1Ijhfzd9bSYvew1BrGtRO2g)(NimStringDesc** s, NI i);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, nsuRepeatChar)(NIM_CHAR c, NI count);
N_LIB_PRIVATE N_NIMCALL(void, nl_gOaZJtTQtJqBSCIPT8VfqQ)(NimStringDesc** s, NIM_BOOL ml);
N_LIB_PRIVATE N_NIMCALL(NI, newIndent_jGyhG9amGoXLPyJmHLbefOQ)(NI curr, NI indent, NIM_BOOL ml);
N_LIB_PRIVATE N_NIMCALL(tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ*, newFileStream_X7Yto1yRxc3r4DfqEKWuBQ)(NimStringDesc* filename, tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ mode, NI bufSize);
static N_INLINE(void, asgnRef)(void** dest, void* src);
static N_INLINE(void, incRef_9cAA5YuQAAC3MVbnGeV86swsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(void, decRef_MV4BBk6J1qu70IbBxwEn4wsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c);
N_NIMCALL(void, raiseException)(Exception* e, NCSTRING ename);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, parseJson_USjX2tNLHJG9bTLdnLy01cw)(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc* filename);
N_LIB_PRIVATE N_NIMCALL(void, open_mL4QrKRcNX0dd8pNuLu1ng)(tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ* my, tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* input, NimStringDesc* filename, NIM_BOOL rawStringLiterals);
static N_INLINE(void, pushSafePoint)(TSafePoint* s);
N_LIB_PRIVATE N_NIMCALL(tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw, getTok_8Kxe4bFosECuIdTtgzOahA)(tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ* my);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, parseJson_9cy3XTSABpD79aMQvc9csghxg)(tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ* p);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJStringMove_8iXO9aRAijCPe58pujCBbuQ_2)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJInt_z0g83xvrx4R10lOvgItZ9aQ_2)(NI64 n);
N_LIB_PRIVATE N_NIMCALL(NI64, nsuParseBiggestInt)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJFloat_U9b9aOjHQ9bZDMSNNz4CuY4Pg)(NF n);
N_LIB_PRIVATE N_NIMCALL(NF, nsuParseFloat)(NimStringDesc* s);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJBool_bESUahFJIJ0RSySOPtSYZg)(NIM_BOOL b);
N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJNull_phgxr9cKlc0dmrJpCth52pw_3)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseParseErr_xOEBzQ9aFzD8i9aTrXTVac4A)(tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ* p, NimStringDesc* msg) __attribute__((noreturn));
N_LIB_PRIVATE N_NIMCALL(void, eat_Mn9aEjBGUN5aaCT3HyS9aiSw)(tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ* p, tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw tok);
static N_INLINE(void, X5BX5Deq__zgnKRzXVFYWnC0JSg1UbAQdocgen)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* obj, NimStringDesc* key, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* val);
N_LIB_PRIVATE N_NIMCALL(void, add_NE4BWkXVxUMFtDmmA5ZcHw)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* father, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* child);
static N_INLINE(void, popSafePoint)(void);
static N_INLINE(void, close_c9akwugdNVZsy5liLqKKwWgvmmarshal)(tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ* my);
N_LIB_PRIVATE N_NIMCALL(void, close_CbKzA44X2DxZAmasZ72O9ag_2)(tyObject_BaseLexer_MAw8rJZtJ279bVV3TWMtXSg* L);
N_NIMCALL(void, reraiseException)(void);
TNimType NTI_df9bshXB7C9cTiWPIOtX3j1Q_;
TNimType NTI_RUngo7nCHe6O8aBGIcrhtg_;
extern TNimType NTI_77mFvmsOLKik79ci2hXkHEg_;
extern TNimType NTI_Aav8dQoMlCFnZRxA0IhTHQ_;
extern TNimType NTI_w9bl9a1ul9ctRJWiMl9cNnIMvg_;
extern TNimType NTI_VaVACK0bpYmqIQ0mKcHfQQ_;
extern TNimType NTI_ZZvSdVkA2s2sIyifu4cpkg_;
TNimType NTI_oLpBKXzW3hF9aCVMo5EymfQ_;
TNimType NTI_zfzzuQ8txrdZAYK0WGWpHg_;
extern tyObject_GcHeap_1TRH1TZMaVZTnLNcIHuNFQ gch_IcYaEuuWivYAS86vFMTS3Q;
extern TNimType NTI_HMIVdYjdZYWskTmTQVo5BQ_;
extern TNimType NTI_iLZrPn9anoh9ad1MmO0RczFw_;
extern TNimType NTI_KWIQnzXEOUqdWsnCUL9atyQ_;
extern TSafePoint* excHandler_rqLlY5bs9atDw2OXYqJEn5g;
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_2, "\"", 1);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_3, "\\n", 2);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_4, "\\b", 2);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_5, "\\f", 2);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_6, "\\t", 2);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_7, "\\r", 2);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_8, "\\\"", 2);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_9, "\\u000", 5);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_10, "\\u00", 4);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_11, "\\\\", 2);
TNimNode* NimDT__df9bshXB7C9cTiWPIOtX3j1Q_kind[8];
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_15, "[", 1);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_16, ",", 1);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_17, "]", 1);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_18, "{", 1);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_19, ":", 1);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_20, "}", 1);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_21, "true", 4);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_22, "false", 5);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_23, "null", 4);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_24, "\012", 1);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_25, " ", 1);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_26, ": ", 2);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_27, "{}", 2);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_28, "[]", 2);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_29, "cannot read from file: ", 23);
STRING_LITERAL(TM_9b9bytt1stv9cZ8uqII7HFgew_31, "string literal as key", 21);

static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest, source, ((size_t) (size)));
}

static N_INLINE(void, copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem)(void* dest, void* source, NI size) {
	nimCopyMem(dest, source, size);
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
	{
		if (!!((src == NIM_NIL))) goto LA3_;
		copyMem_fPlwH3r9agN9aEHB6yCPMh0wsystem(((void*) ((&(*dest).data[((*dest).Sup.len)- 0]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
		(*dest).Sup.len += (*src).Sup.len;
	}
	LA3_: ;
}

N_LIB_PRIVATE N_NIMCALL(void, escapeJsonUnquoted_xxovtptDIL7ctJosN3ocbA_2)(NimStringDesc* s, NimStringDesc** result) {
	{
		NIM_CHAR c;
		NI i;
		NI L;
		c = (NIM_CHAR)0;
		i = ((NI) 0);
		L = (s ? s->Sup.len : 0);
		{
			while (1) {
				if (!(i < L)) goto LA3;
				c = s->data[i];
				switch (((NU8)(c))) {
				case 10:
				{
					unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_3));
				}
				break;
				case 8:
				{
					unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_4));
				}
				break;
				case 12:
				{
					unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_5));
				}
				break;
				case 9:
				{
					unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_6));
				}
				break;
				case 13:
				{
					unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_7));
				}
				break;
				case 34:
				{
					unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_8));
				}
				break;
				case 0 ... 7:
				{
					NimStringDesc* T11_;
					NimStringDesc* T12_;
					T11_ = (NimStringDesc*)0;
					T12_ = (NimStringDesc*)0;
					T12_ = nimIntToStr(((NU8)(c)));
					T11_ = rawNewString((T12_ ? T12_->Sup.len : 0) + 5);
appendString(T11_, ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_9));
appendString(T11_, T12_);
					unsureAsgnRef((void**) (&(*result)), resizeString((*result), (T11_ ? T11_->Sup.len : 0) + 0));
appendString((*result), T11_);
				}
				break;
				case 14 ... 31:
				{
					NimStringDesc* T14_;
					NimStringDesc* T15_;
					T14_ = (NimStringDesc*)0;
					T15_ = (NimStringDesc*)0;
					T15_ = nsuToHex(((NI64) (((NU8)(c)))), ((NI) 2));
					T14_ = rawNewString((T15_ ? T15_->Sup.len : 0) + 4);
appendString(T14_, ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_10));
appendString(T14_, T15_);
					unsureAsgnRef((void**) (&(*result)), resizeString((*result), (T14_ ? T14_->Sup.len : 0) + 0));
appendString((*result), T14_);
				}
				break;
				case 92:
				{
					unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_11));
				}
				break;
				default:
				{
					unsureAsgnRef((void**) (&(*result)), addChar((*result), c));
				}
				break;
				}
				i += ((NI) 1);
			} LA3: ;
		}
	}
}

N_LIB_PRIVATE N_NIMCALL(void, escapeJson_xxovtptDIL7ctJosN3ocbA)(NimStringDesc* s, NimStringDesc** result) {
	unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_2));
	escapeJsonUnquoted_xxovtptDIL7ctJosN3ocbA_2(s, result);
	unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_2));
}

N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, escapeJson_ajHNbHGhsNVy1pVSYP9cEyA)(NimStringDesc* s) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = rawNewString(((NI) ((NI)((s ? s->Sup.len : 0) + (NI)((NU32)((s ? s->Sup.len : 0)) >> (NU32)(((NI) 3)))))));
	escapeJson_xxovtptDIL7ctJosN3ocbA(s, (&result));
	return result;
}
static N_NIMCALL(void, Marker_tySequence_oLpBKXzW3hF9aCVMo5EymfQ)(void* p, NI op) {
	tySequence_oLpBKXzW3hF9aCVMo5EymfQ* a;
	NI T1_;
	a = (tySequence_oLpBKXzW3hF9aCVMo5EymfQ*)p;
	T1_ = (NI)0;
	for (T1_ = 0; T1_ < (a ? a->Sup.len : 0); T1_++) {
	nimGCvisit((void*)a->data[T1_], op);
	}
}
static N_NIMCALL(void, Marker_tyRef_zfzzuQ8txrdZAYK0WGWpHg)(void* p, NI op) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* a;
	a = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)p;
	switch ((*a).kind) {
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 4):
	nimGCvisit((void*)(*a)._Ukind.S1.str, op);
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 2):
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 3):
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 1):
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 0):
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 5):
	nimGCvisit((void*)(*a)._Ukind.S6.fields.data, op);
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 6):
	nimGCvisit((void*)(*a)._Ukind.S7.elems, op);
	break;
	} 
}

static N_INLINE(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem)(void* usr) {
	tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* result;
	result = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
	result = ((tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU32)(((NI) (ptrdiff_t) (usr))) - (NU32)(((NI)sizeof(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g))))));
	return result;
}

static N_INLINE(void, rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
	addZCT_fCDI7oO1NNVXXURtxSzsRw((&gch_IcYaEuuWivYAS86vFMTS3Q.zct), c);
}

static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
	tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c;
	c = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem(p);
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3_;
		rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system(c);
	}
	LA3_: ;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJArray_phgxr9cKlc0dmrJpCth52pw)(void) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*) newObj((&NTI_zfzzuQ8txrdZAYK0WGWpHg_), sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q));
	(*result).kind = ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 6);
	if ((*result)._Ukind.S7.elems) { nimGCunrefNoCycle((*result)._Ukind.S7.elems); (*result)._Ukind.S7.elems = NIM_NIL; }
	return result;
}

static N_INLINE(int, nimCmpMem)(void* a, void* b, NI size) {
	int result;
	result = (int)0;
	result = memcmp(a, b, ((size_t) (size)));
	return result;
}

static N_INLINE(NIM_BOOL, equalMem_DCrUjdaMvFDHaR1hs7sQGwropes)(void* a, void* b, NI size) {
	NIM_BOOL result;
	int T1_;
	result = (NIM_BOOL)0;
	T1_ = (int)0;
	T1_ = nimCmpMem(a, b, size);
	result = (T1_ == ((NI32) 0));
	return result;
}

static N_INLINE(NIM_BOOL, eqStrings)(NimStringDesc* a, NimStringDesc* b) {
	NIM_BOOL result;
	NI alen;
	NI blen;
{	result = (NIM_BOOL)0;
	alen = (a ? a->Sup.len : 0);
	blen = (b ? b->Sup.len : 0);
	{
		if (!(alen == blen)) goto LA3_;
		{
			if (!(alen == ((NI) 0))) goto LA7_;
			result = NIM_TRUE;
			goto BeforeRet_;
		}
		LA7_: ;
		result = equalMem_DCrUjdaMvFDHaR1hs7sQGwropes(((void*) ((&a->data[((NI) 0)]))), ((void*) ((&b->data[((NI) 0)]))), ((NI) (alen)));
		goto BeforeRet_;
	}
	LA3_: ;
	}BeforeRet_: ;
	return result;
}

static N_INLINE(NI, len_YcGrPJJ4pElek9cAaf09a9bmQjson)(tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg t) {
	NI result;
	result = (NI)0;
	result = t.counter;
	return result;
}

static N_INLINE(void, nimSetMem_2Mfumf6CnyNlShDWdIgobwsystem)(void* a, int v, NI size) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a, v, ((size_t) (size)));
}

static N_INLINE(void, nimZeroMem)(void* p, NI size) {
	nimSetMem_2Mfumf6CnyNlShDWdIgobwsystem(p, ((int) 0), size);
}

static N_INLINE(NIM_BOOL, isFilled_IxXD1UAPoEehVDW9cv9cRaewtables)(NI hcode) {
	NIM_BOOL result;
	result = (NIM_BOOL)0;
	result = !((hcode == ((NI) 0)));
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq__Ujpjfumo30l2ielPaquw0Q)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* a, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* b) {
	NIM_BOOL result;
{	result = (NIM_BOOL)0;
	{
		if (!(a == 0)) goto LA3_;
		{
			if (!(b == 0)) goto LA7_;
			result = NIM_TRUE;
			goto BeforeRet_;
		}
		LA7_: ;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	goto LA1_;
	LA3_: ;
	{
		NIM_BOOL T10_;
		T10_ = (NIM_BOOL)0;
		T10_ = (b == 0);
		if (T10_) goto LA11_;
		T10_ = !(((*a).kind == (*b).kind));
		LA11_: ;
		if (!T10_) goto LA12_;
		result = NIM_FALSE;
		goto BeforeRet_;
	}
	goto LA1_;
	LA12_: ;
	{
		switch ((*a).kind) {
		case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 4):
		{
			result = eqStrings((*a)._Ukind.S1.str, (*b)._Ukind.S1.str);
		}
		break;
		case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 2):
		{
			result = ((*a)._Ukind.S2.num == (*b)._Ukind.S2.num);
		}
		break;
		case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 3):
		{
			result = ((*a)._Ukind.S3.fnum == (*b)._Ukind.S3.fnum);
		}
		break;
		case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 1):
		{
			result = ((*a)._Ukind.S4.bval == (*b)._Ukind.S4.bval);
		}
		break;
		case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 0):
		{
			result = NIM_TRUE;
		}
		break;
		case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 6):
		{
			result = eqeq__fL0tq3d6JfMw9bvY7G6spBQ((*a)._Ukind.S7.elems, (*b)._Ukind.S7.elems);
		}
		break;
		case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 5):
		{
			{
				NI T24_;
				NI T25_;
				T24_ = (NI)0;
				T24_ = len_YcGrPJJ4pElek9cAaf09a9bmQjson((*a)._Ukind.S6.fields);
				T25_ = (NI)0;
				T25_ = len_YcGrPJJ4pElek9cAaf09a9bmQjson((*b)._Ukind.S6.fields);
				if (!!((T24_ == T25_))) goto LA26_;
				result = NIM_FALSE;
				goto BeforeRet_;
			}
			LA26_: ;
			{
				NimStringDesc* key;
				tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* val;
				tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg colontmp_;
				NI h;
				key = (NimStringDesc*)0;
				val = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
				nimZeroMem((void*)(&colontmp_), sizeof(tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg));
				colontmp_.data = (*a)._Ukind.S6.fields.data;
				colontmp_.counter = (*a)._Ukind.S6.fields.counter;
				colontmp_.first = (*a)._Ukind.S6.fields.first;
				colontmp_.last = (*a)._Ukind.S6.fields.last;
				h = colontmp_.first;
				{
					while (1) {
						NI nxt;
						if (!(((NI) 0) <= h)) goto LA30;
						nxt = colontmp_.data->data[h].Field1;
						{
							NIM_BOOL T33_;
							T33_ = (NIM_BOOL)0;
							T33_ = isFilled_IxXD1UAPoEehVDW9cv9cRaewtables(colontmp_.data->data[h].Field0);
							if (!T33_) goto LA34_;
							key = colontmp_.data->data[h].Field2;
							val = colontmp_.data->data[h].Field3;
							{
								NIM_BOOL T38_;
								T38_ = (NIM_BOOL)0;
								T38_ = hasKey_iqm6UDESHopNXjGmU4P7nA((*b)._Ukind.S6.fields, key);
								if (!!(T38_)) goto LA39_;
								result = NIM_FALSE;
								goto BeforeRet_;
							}
							LA39_: ;
							{
								tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q** T43_;
								NIM_BOOL T44_;
								T43_ = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q**)0;
								T43_ = X5BX5D__3MszA1IsDLkWcBk0f4ZIOQ((&(*b)._Ukind.S6.fields), key);
								T44_ = (NIM_BOOL)0;
								T44_ = eqeq__Ujpjfumo30l2ielPaquw0Q((*T43_), val);
								if (!!(T44_)) goto LA45_;
								result = NIM_FALSE;
								goto BeforeRet_;
							}
							LA45_: ;
						}
						LA34_: ;
						h = nxt;
					} LA30: ;
				}
			}
			result = NIM_TRUE;
		}
		break;
		}
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}

static N_INLINE(void, asgnRefNoCycle)(void** dest, void* src) {
	{
		tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c;
		if (!!((src == NIM_NIL))) goto LA3_;
		c = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem(src);
		(*c).refcount += ((NI) 8);
	}
	LA3_: ;
	{
		tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c_2;
		if (!!(((*dest) == NIM_NIL))) goto LA7_;
		c_2 = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem((*dest));
		{
			(*c_2).refcount -= ((NI) 8);
			if (!((NU32)((*c_2).refcount) < (NU32)(((NI) 8)))) goto LA11_;
			rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system(c_2);
		}
		LA11_: ;
	}
	LA7_: ;
	(*dest) = src;
}

N_LIB_PRIVATE N_NIMCALL(void, add_NE4BWkXVxUMFtDmmA5ZcHw)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* father, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* child) {
	NI T1_;
	asgnRefNoCycle((void**) (&(*father)._Ukind.S7.elems), (tySequence_oLpBKXzW3hF9aCVMo5EymfQ*) incrSeqV3(&((*father)._Ukind.S7.elems)->Sup, (&NTI_oLpBKXzW3hF9aCVMo5EymfQ_)));
	T1_ = (*father)._Ukind.S7.elems->Sup.len++;
	asgnRefNoCycle((void**) (&(*father)._Ukind.S7.elems->data[T1_]), child);
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJObject_phgxr9cKlc0dmrJpCth52pw_2)(void) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*) newObj((&NTI_zfzzuQ8txrdZAYK0WGWpHg_), sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q));
	(*result).kind = ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 5);
	initOrderedTable_fiyAoB3KBEd8q02UaahGaw(((NI) 4), (&(*result)._Ukind.S6.fields));
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, percent__9bR9b9aepApwIZEZZtX9cb7RFA)(tyTuple_jq7X5k7hWG0tdTZTDkiyGQ* keyVals, NI keyValsLen_0) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
{	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	{
		if (!(keyValsLen_0 == ((NI) 0))) goto LA3_;
		result = newJArray_phgxr9cKlc0dmrJpCth52pw();
		goto BeforeRet_;
	}
	LA3_: ;
	result = newJObject_phgxr9cKlc0dmrJpCth52pw_2();
	{
		NimStringDesc* key;
		tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* val;
		NI i;
		key = (NimStringDesc*)0;
		val = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
		i = ((NI) 0);
		{
			while (1) {
				if (!(i < keyValsLen_0)) goto LA7;
				key = keyVals[i].Field0;
				val = keyVals[i].Field1;
				X5BX5Deq__79bwPu2H8TyyZ9cDM1RrH17A((&(*result)._Ukind.S6.fields), key, val);
				i += ((NI) 1);
			} LA7: ;
		}
	}
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, percent__8iXO9aRAijCPe58pujCBbuQ)(NimStringDesc* s) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	NimStringDesc* T1_;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*) newObj((&NTI_zfzzuQ8txrdZAYK0WGWpHg_), sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q));
	(*result).kind = ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 4);
	T1_ = (NimStringDesc*)0;
	T1_ = (*result)._Ukind.S1.str; (*result)._Ukind.S1.str = copyStringRC1(s);
	if (T1_) nimGCunrefNoCycle(T1_);
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, percent__z0g83xvrx4R10lOvgItZ9aQ)(NI64 n) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*) newObj((&NTI_zfzzuQ8txrdZAYK0WGWpHg_), sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q));
	(*result).kind = ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 2);
	(*result)._Ukind.S2.num = n;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NI, len_1r8KCEmq7uHhZ2GR9c7tsOA)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* n) {
	NI result;
	result = (NI)0;
	switch ((*n).kind) {
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 6):
	{
		NI T2_;
		T2_ = ((*n)._Ukind.S7.elems ? (*n)._Ukind.S7.elems->Sup.len : 0);
		result = T2_;
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 5):
	{
		result = len_YcGrPJJ4pElek9cAaf09a9bmQjson((*n)._Ukind.S6.fields);
	}
	break;
	default:
	{
	}
	break;
	}
	return result;
}

N_LIB_PRIVATE N_NIMCALL(void, toUgly_5SA9aXRryVJvgoCag29cRzQw)(NimStringDesc** result, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* node) {
	NIM_BOOL comma;
	comma = NIM_FALSE;
	switch ((*node).kind) {
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 6):
	{
		unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_15));
		{
			tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* child;
			tySequence_oLpBKXzW3hF9aCVMo5EymfQ* colontmp_;
			NI i;
			NI L;
			NI T3_;
			child = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
			colontmp_ = (tySequence_oLpBKXzW3hF9aCVMo5EymfQ*)0;
			colontmp_ = (*node)._Ukind.S7.elems;
			i = ((NI) 0);
			T3_ = (colontmp_ ? colontmp_->Sup.len : 0);
			L = T3_;
			{
				while (1) {
					if (!(i < L)) goto LA5;
					child = colontmp_->data[i];
					{
						if (!comma) goto LA8_;
						unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_16));
					}
					goto LA6_;
					LA8_: ;
					{
						comma = NIM_TRUE;
					}
					LA6_: ;
					toUgly_5SA9aXRryVJvgoCag29cRzQw(result, child);
					i += ((NI) 1);
				} LA5: ;
			}
		}
		unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_17));
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 5):
	{
		unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_18));
		{
			NimStringDesc* key;
			tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* value;
			tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg colontmp__2;
			NI h;
			key = (NimStringDesc*)0;
			value = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
			nimZeroMem((void*)(&colontmp__2), sizeof(tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg));
			colontmp__2.data = (*node)._Ukind.S6.fields.data;
			colontmp__2.counter = (*node)._Ukind.S6.fields.counter;
			colontmp__2.first = (*node)._Ukind.S6.fields.first;
			colontmp__2.last = (*node)._Ukind.S6.fields.last;
			h = colontmp__2.first;
			{
				while (1) {
					NI nxt;
					if (!(((NI) 0) <= h)) goto LA14;
					nxt = colontmp__2.data->data[h].Field1;
					{
						NIM_BOOL T17_;
						T17_ = (NIM_BOOL)0;
						T17_ = isFilled_IxXD1UAPoEehVDW9cv9cRaewtables(colontmp__2.data->data[h].Field0);
						if (!T17_) goto LA18_;
						key = colontmp__2.data->data[h].Field2;
						value = colontmp__2.data->data[h].Field3;
						{
							if (!comma) goto LA22_;
							unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_16));
						}
						goto LA20_;
						LA22_: ;
						{
							comma = NIM_TRUE;
						}
						LA20_: ;
						escapeJson_xxovtptDIL7ctJosN3ocbA(key, result);
						unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_19));
						toUgly_5SA9aXRryVJvgoCag29cRzQw(result, value);
					}
					LA18_: ;
					h = nxt;
				} LA14: ;
			}
		}
		unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_20));
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 4):
	{
		escapeJson_xxovtptDIL7ctJosN3ocbA((*node)._Ukind.S1.str, result);
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 2):
	{
		add_IbYQ9cTcoQ89aIwM2IEYGMng(result, (*node)._Ukind.S2.num);
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 3):
	{
		add_A9bDQDKw5SEqD3OvtOnC1bg(result, (*node)._Ukind.S3.fnum);
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 1):
	{
		NimStringDesc* T29_;
		T29_ = (NimStringDesc*)0;
		{
			if (!(*node)._Ukind.S4.bval) goto LA32_;
			T29_ = copyString(((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_21));
		}
		goto LA30_;
		LA32_: ;
		{
			T29_ = copyString(((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_22));
		}
		LA30_: ;
		unsureAsgnRef((void**) (&(*result)), resizeString((*result), (T29_ ? T29_->Sup.len : 0) + 0));
appendString((*result), T29_);
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 0):
	{
		unsureAsgnRef((void**) (&(*result)), resizeString((*result), 4));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_23));
	}
	break;
	}
}

N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar__f9cKpuwjrLNwYtym1kuFzjQ)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* node) {
	NimStringDesc* result;
	NI T1_;
	result = (NimStringDesc*)0;
	T1_ = (NI)0;
	T1_ = len_1r8KCEmq7uHhZ2GR9c7tsOA(node);
	result = rawNewString(((NI) ((NI)((NU32)(T1_) << (NU32)(((NI) 1))))));
	toUgly_5SA9aXRryVJvgoCag29cRzQw((&result), node);
	return result;
}

N_LIB_PRIVATE N_NIMCALL(void, indent_1Ijhfzd9bSYvew1BrGtRO2g)(NimStringDesc** s, NI i) {
	NimStringDesc* T1_;
	T1_ = (NimStringDesc*)0;
	T1_ = nsuRepeatChar(32, ((NI) (i)));
	unsureAsgnRef((void**) (&(*s)), resizeString((*s), (T1_ ? T1_->Sup.len : 0) + 0));
appendString((*s), T1_);
}

N_LIB_PRIVATE N_NIMCALL(void, nl_gOaZJtTQtJqBSCIPT8VfqQ)(NimStringDesc** s, NIM_BOOL ml) {
	NimStringDesc* T1_;
	T1_ = (NimStringDesc*)0;
	{
		if (!ml) goto LA4_;
		T1_ = copyString(((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_24));
	}
	goto LA2_;
	LA4_: ;
	{
		T1_ = copyString(((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_25));
	}
	LA2_: ;
	unsureAsgnRef((void**) (&(*s)), resizeString((*s), (T1_ ? T1_->Sup.len : 0) + 0));
appendString((*s), T1_);
}

N_LIB_PRIVATE N_NIMCALL(NI, newIndent_jGyhG9amGoXLPyJmHLbefOQ)(NI curr, NI indent, NIM_BOOL ml) {
	NI result;
{	result = (NI)0;
	{
		if (!ml) goto LA3_;
		result = (NI)(curr + indent);
		goto BeforeRet_;
	}
	goto LA1_;
	LA3_: ;
	{
		result = indent;
		goto BeforeRet_;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(void, toPretty_MHqQ3FKhfxfdLtBgX2QXeQ)(NimStringDesc** result, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* node, NI indent, NIM_BOOL ml, NIM_BOOL lstArr, NI currIndent) {
	switch ((*node).kind) {
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 5):
	{
		{
			if (!lstArr) goto LA4_;
			indent_1Ijhfzd9bSYvew1BrGtRO2g(result, currIndent);
		}
		LA4_: ;
		{
			NI T8_;
			NI i;
			T8_ = (NI)0;
			T8_ = len_YcGrPJJ4pElek9cAaf09a9bmQjson((*node)._Ukind.S6.fields);
			if (!(((NI) 0) < T8_)) goto LA9_;
			unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_18));
			nl_gOaZJtTQtJqBSCIPT8VfqQ(result, ml);
			i = ((NI) 0);
			{
				NimStringDesc* key;
				tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* val;
				tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg colontmp_;
				NI h;
				key = (NimStringDesc*)0;
				val = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
				nimZeroMem((void*)(&colontmp_), sizeof(tyObject_OrderedTable_ZZvSdVkA2s2sIyifu4cpkg));
				colontmp_.data = (*node)._Ukind.S6.fields.data;
				colontmp_.counter = (*node)._Ukind.S6.fields.counter;
				colontmp_.first = (*node)._Ukind.S6.fields.first;
				colontmp_.last = (*node)._Ukind.S6.fields.last;
				h = colontmp_.first;
				{
					while (1) {
						NI nxt;
						if (!(((NI) 0) <= h)) goto LA13;
						nxt = colontmp_.data->data[h].Field1;
						{
							NIM_BOOL T16_;
							NI T23_;
							NI T24_;
							T16_ = (NIM_BOOL)0;
							T16_ = isFilled_IxXD1UAPoEehVDW9cv9cRaewtables(colontmp_.data->data[h].Field0);
							if (!T16_) goto LA17_;
							key = colontmp_.data->data[h].Field2;
							val = colontmp_.data->data[h].Field3;
							{
								if (!(((NI) 0) < i)) goto LA21_;
								unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_16));
								nl_gOaZJtTQtJqBSCIPT8VfqQ(result, ml);
							}
							LA21_: ;
							i += ((NI) 1);
							T23_ = (NI)0;
							T23_ = newIndent_jGyhG9amGoXLPyJmHLbefOQ(currIndent, indent, ml);
							indent_1Ijhfzd9bSYvew1BrGtRO2g(result, T23_);
							escapeJson_xxovtptDIL7ctJosN3ocbA(key, result);
							unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_26));
							T24_ = (NI)0;
							T24_ = newIndent_jGyhG9amGoXLPyJmHLbefOQ(currIndent, indent, ml);
							toPretty_MHqQ3FKhfxfdLtBgX2QXeQ(result, val, indent, ml, NIM_FALSE, T24_);
						}
						LA17_: ;
						h = nxt;
					} LA13: ;
				}
			}
			nl_gOaZJtTQtJqBSCIPT8VfqQ(result, ml);
			indent_1Ijhfzd9bSYvew1BrGtRO2g(result, currIndent);
			unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_20));
		}
		goto LA6_;
		LA9_: ;
		{
			unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_27));
		}
		LA6_: ;
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 4):
	{
		{
			if (!lstArr) goto LA29_;
			indent_1Ijhfzd9bSYvew1BrGtRO2g(result, currIndent);
		}
		LA29_: ;
		escapeJson_xxovtptDIL7ctJosN3ocbA((*node)._Ukind.S1.str, result);
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 2):
	{
		{
			if (!lstArr) goto LA34_;
			indent_1Ijhfzd9bSYvew1BrGtRO2g(result, currIndent);
		}
		LA34_: ;
		add_IbYQ9cTcoQ89aIwM2IEYGMng(result, (*node)._Ukind.S2.num);
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 3):
	{
		{
			if (!lstArr) goto LA39_;
			indent_1Ijhfzd9bSYvew1BrGtRO2g(result, currIndent);
		}
		LA39_: ;
		add_A9bDQDKw5SEqD3OvtOnC1bg(result, (*node)._Ukind.S3.fnum);
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 1):
	{
		NimStringDesc* T46_;
		{
			if (!lstArr) goto LA44_;
			indent_1Ijhfzd9bSYvew1BrGtRO2g(result, currIndent);
		}
		LA44_: ;
		T46_ = (NimStringDesc*)0;
		{
			if (!(*node)._Ukind.S4.bval) goto LA49_;
			T46_ = copyString(((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_21));
		}
		goto LA47_;
		LA49_: ;
		{
			T46_ = copyString(((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_22));
		}
		LA47_: ;
		unsureAsgnRef((void**) (&(*result)), resizeString((*result), (T46_ ? T46_->Sup.len : 0) + 0));
appendString((*result), T46_);
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 6):
	{
		{
			if (!lstArr) goto LA55_;
			indent_1Ijhfzd9bSYvew1BrGtRO2g(result, currIndent);
		}
		LA55_: ;
		{
			NI T59_;
			T59_ = ((*node)._Ukind.S7.elems ? (*node)._Ukind.S7.elems->Sup.len : 0);
			if (!!((T59_ == ((NI) 0)))) goto LA60_;
			unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_15));
			nl_gOaZJtTQtJqBSCIPT8VfqQ(result, ml);
			{
				NI i_2;
				NI colontmp__2;
				NI T63_;
				NI res;
				i_2 = (NI)0;
				colontmp__2 = (NI)0;
				T63_ = ((*node)._Ukind.S7.elems ? (*node)._Ukind.S7.elems->Sup.len : 0);
				colontmp__2 = (NI)(T63_ - ((NI) 1));
				res = ((NI) 0);
				{
					while (1) {
						NI T70_;
						if (!(res <= colontmp__2)) goto LA65;
						i_2 = res;
						{
							if (!(((NI) 0) < i_2)) goto LA68_;
							unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_16));
							nl_gOaZJtTQtJqBSCIPT8VfqQ(result, ml);
						}
						LA68_: ;
						T70_ = (NI)0;
						T70_ = newIndent_jGyhG9amGoXLPyJmHLbefOQ(currIndent, indent, ml);
						toPretty_MHqQ3FKhfxfdLtBgX2QXeQ(result, (*node)._Ukind.S7.elems->data[i_2], indent, ml, NIM_TRUE, T70_);
						res += ((NI) 1);
					} LA65: ;
				}
			}
			nl_gOaZJtTQtJqBSCIPT8VfqQ(result, ml);
			indent_1Ijhfzd9bSYvew1BrGtRO2g(result, currIndent);
			unsureAsgnRef((void**) (&(*result)), resizeString((*result), 1));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_17));
		}
		goto LA57_;
		LA60_: ;
		{
			unsureAsgnRef((void**) (&(*result)), resizeString((*result), 2));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_28));
		}
		LA57_: ;
	}
	break;
	case ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 0):
	{
		{
			if (!lstArr) goto LA75_;
			indent_1Ijhfzd9bSYvew1BrGtRO2g(result, currIndent);
		}
		LA75_: ;
		unsureAsgnRef((void**) (&(*result)), resizeString((*result), 4));
appendString((*result), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_23));
	}
	break;
	}
}

N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, pretty_jL9c59bDERe59bOWSHweWzoBQ)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* node, NI indent) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = ((NimStringDesc*) NIM_NIL);
	toPretty_MHqQ3FKhfxfdLtBgX2QXeQ((&result), node, indent, NIM_TRUE, NIM_FALSE, ((NI) 0));
	return result;
}

static N_INLINE(void, incRef_9cAA5YuQAAC3MVbnGeV86swsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
	(*c).refcount = (NI)((NU32)((*c).refcount) + (NU32)(((NI) 8)));
}

static N_INLINE(void, decRef_MV4BBk6J1qu70IbBxwEn4wsystem)(tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* c) {
	{
		(*c).refcount -= ((NI) 8);
		if (!((NU32)((*c).refcount) < (NU32)(((NI) 8)))) goto LA3_;
		rtlAddZCT_MV4BBk6J1qu70IbBxwEn4w_2system(c);
	}
	LA3_: ;
}

static N_INLINE(void, asgnRef)(void** dest, void* src) {
	{
		tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* T5_;
		if (!!((src == NIM_NIL))) goto LA3_;
		T5_ = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T5_ = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem(src);
		incRef_9cAA5YuQAAC3MVbnGeV86swsystem(T5_);
	}
	LA3_: ;
	{
		tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g* T10_;
		if (!!(((*dest) == NIM_NIL))) goto LA8_;
		T10_ = (tyObject_Cell_1zcF9cV8XIAtbN8h5HRUB8g*)0;
		T10_ = usrToCell_yB9aH5WIlwd0xkYrcdPeXrQsystem((*dest));
		decRef_MV4BBk6J1qu70IbBxwEn4wsystem(T10_);
	}
	LA8_: ;
	(*dest) = src;
}

static N_INLINE(void, pushSafePoint)(TSafePoint* s) {
	(*s).hasRaiseAction = NIM_FALSE;
	(*s).prev = excHandler_rqLlY5bs9atDw2OXYqJEn5g;
	excHandler_rqLlY5bs9atDw2OXYqJEn5g = s;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJStringMove_8iXO9aRAijCPe58pujCBbuQ_2)(NimStringDesc* s) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*) newObj((&NTI_zfzzuQ8txrdZAYK0WGWpHg_), sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q));
	(*result).kind = ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 4);
	asgnRefNoCycle((void**) (&(*result)._Ukind.S1.str), s);
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJInt_z0g83xvrx4R10lOvgItZ9aQ_2)(NI64 n) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*) newObj((&NTI_zfzzuQ8txrdZAYK0WGWpHg_), sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q));
	(*result).kind = ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 2);
	(*result)._Ukind.S2.num = n;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJFloat_U9b9aOjHQ9bZDMSNNz4CuY4Pg)(NF n) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*) newObj((&NTI_zfzzuQ8txrdZAYK0WGWpHg_), sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q));
	(*result).kind = ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 3);
	(*result)._Ukind.S3.fnum = n;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJBool_bESUahFJIJ0RSySOPtSYZg)(NIM_BOOL b) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*) newObj((&NTI_zfzzuQ8txrdZAYK0WGWpHg_), sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q));
	(*result).kind = ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 1);
	(*result)._Ukind.S4.bval = b;
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, newJNull_phgxr9cKlc0dmrJpCth52pw_3)(void) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*) newObj((&NTI_zfzzuQ8txrdZAYK0WGWpHg_), sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q));
	return result;
}

static N_INLINE(void, X5BX5Deq__zgnKRzXVFYWnC0JSg1UbAQdocgen)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* obj, NimStringDesc* key, tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* val) {
	X5BX5Deq__79bwPu2H8TyyZ9cDM1RrH17A((&(*obj)._Ukind.S6.fields), key, val);
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, parseJson_9cy3XTSABpD79aMQvc9csghxg)(tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ* p) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	switch ((*p).tok) {
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 2):
	{
		tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T2_;
		result = newJStringMove_8iXO9aRAijCPe58pujCBbuQ_2((*p).a);
		unsureAsgnRef((void**) (&(*p).a), ((NimStringDesc*) NIM_NIL));
		T2_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
		T2_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
		(void)(T2_);
	}
	break;
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 3):
	{
		NI64 T4_;
		tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T5_;
		T4_ = (NI64)0;
		T4_ = nsuParseBiggestInt((*p).a);
		result = newJInt_z0g83xvrx4R10lOvgItZ9aQ_2(T4_);
		T5_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
		T5_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
		(void)(T5_);
	}
	break;
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 4):
	{
		NF T7_;
		tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T8_;
		T7_ = (NF)0;
		T7_ = nsuParseFloat((*p).a);
		result = newJFloat_U9b9aOjHQ9bZDMSNNz4CuY4Pg(T7_);
		T8_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
		T8_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
		(void)(T8_);
	}
	break;
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 5):
	{
		tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T10_;
		result = newJBool_bESUahFJIJ0RSySOPtSYZg(NIM_TRUE);
		T10_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
		T10_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
		(void)(T10_);
	}
	break;
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 6):
	{
		tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T12_;
		result = newJBool_bESUahFJIJ0RSySOPtSYZg(NIM_FALSE);
		T12_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
		T12_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
		(void)(T12_);
	}
	break;
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 7):
	{
		tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T14_;
		result = newJNull_phgxr9cKlc0dmrJpCth52pw_3();
		T14_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
		T14_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
		(void)(T14_);
	}
	break;
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 8):
	{
		tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T16_;
		result = newJObject_phgxr9cKlc0dmrJpCth52pw_2();
		T16_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
		T16_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
		(void)(T16_);
		{
			while (1) {
				NimStringDesc* key;
				tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T23_;
				tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* val;
				tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T28_;
				if (!!(((*p).tok == ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 9)))) goto LA18;
				{
					if (!!(((*p).tok == ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 2)))) goto LA21_;
					raiseParseErr_xOEBzQ9aFzD8i9aTrXTVac4A((&(*p)), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_31));
				}
				LA21_: ;
				key = copyString((*p).a);
				T23_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
				T23_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
				(void)(T23_);
				eat_Mn9aEjBGUN5aaCT3HyS9aiSw(p, ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 12));
				val = parseJson_9cy3XTSABpD79aMQvc9csghxg(p);
				X5BX5Deq__zgnKRzXVFYWnC0JSg1UbAQdocgen(result, key, val);
				{
					if (!!(((*p).tok == ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 13)))) goto LA26_;
					goto LA17;
				}
				LA26_: ;
				T28_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
				T28_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
				(void)(T28_);
			} LA18: ;
		} LA17: ;
		eat_Mn9aEjBGUN5aaCT3HyS9aiSw(p, ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 9));
	}
	break;
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 10):
	{
		tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T30_;
		result = newJArray_phgxr9cKlc0dmrJpCth52pw();
		T30_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
		T30_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
		(void)(T30_);
		{
			while (1) {
				tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* T33_;
				tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T38_;
				if (!!(((*p).tok == ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 11)))) goto LA32;
				T33_ = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
				T33_ = parseJson_9cy3XTSABpD79aMQvc9csghxg(p);
				add_NE4BWkXVxUMFtDmmA5ZcHw(result, T33_);
				{
					if (!!(((*p).tok == ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 13)))) goto LA36_;
					goto LA31;
				}
				LA36_: ;
				T38_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
				T38_ = getTok_8Kxe4bFosECuIdTtgzOahA(p);
				(void)(T38_);
			} LA32: ;
		} LA31: ;
		eat_Mn9aEjBGUN5aaCT3HyS9aiSw(p, ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 11));
	}
	break;
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 0):
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 9):
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 11):
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 12):
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 13):
	case ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 1):
	{
		raiseParseErr_xOEBzQ9aFzD8i9aTrXTVac4A((&(*p)), ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_18));
	}
	break;
	}
	return result;
}

static N_INLINE(void, popSafePoint)(void) {
	excHandler_rqLlY5bs9atDw2OXYqJEn5g = (*excHandler_rqLlY5bs9atDw2OXYqJEn5g).prev;
}

static N_INLINE(void, close_c9akwugdNVZsy5liLqKKwWgvmmarshal)(tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ* my) {
	tyObject_BaseLexer_MAw8rJZtJ279bVV3TWMtXSg* T1_;
	T1_ = (tyObject_BaseLexer_MAw8rJZtJ279bVV3TWMtXSg*)0;
	T1_ = &my->Sup;
	close_CbKzA44X2DxZAmasZ72O9ag_2(T1_);
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, parseJson_USjX2tNLHJG9bTLdnLy01cw)(tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* s, NimStringDesc* filename) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* volatile result;
	tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ p;
	TSafePoint TM_9b9bytt1stv9cZ8uqII7HFgew_30;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	nimZeroMem((void*)(&p), sizeof(tyObject_JsonParser_KWIQnzXEOUqdWsnCUL9atyQ));
	p.Sup.Sup.m_type = (&NTI_KWIQnzXEOUqdWsnCUL9atyQ_);
	open_mL4QrKRcNX0dd8pNuLu1ng((&p), s, filename, NIM_FALSE);
	pushSafePoint(&TM_9b9bytt1stv9cZ8uqII7HFgew_30);
	TM_9b9bytt1stv9cZ8uqII7HFgew_30.status = _setjmp(TM_9b9bytt1stv9cZ8uqII7HFgew_30.context);
	if (TM_9b9bytt1stv9cZ8uqII7HFgew_30.status == 0) {
		tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw T2_;
		T2_ = (tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw)0;
		T2_ = getTok_8Kxe4bFosECuIdTtgzOahA((&p));
		(void)(T2_);
		result = parseJson_9cy3XTSABpD79aMQvc9csghxg((&p));
		eat_Mn9aEjBGUN5aaCT3HyS9aiSw((&p), ((tyEnum_TokKind_Q9c4KaNqJU4PbXaGht0C7iw) 1));
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		close_c9akwugdNVZsy5liLqKKwWgvmmarshal((&p));
	}
	if (TM_9b9bytt1stv9cZ8uqII7HFgew_30.status != 0) reraiseException();
	return result;
}

N_LIB_PRIVATE N_NIMCALL(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*, parseFile_jHjkbBWx0TRN9bcGqTg49c4A)(NimStringDesc* filename) {
	tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* result;
	tyObject_FileStreamObj_9bEVSsOIpkY9cf5lCtaS39bPQ* stream;
	tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ* T6_;
	result = (tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*)0;
	stream = newFileStream_X7Yto1yRxc3r4DfqEKWuBQ(filename, ((tyEnum_FileMode_fVUBHvW79bXUw1j55Oo9avSQ) 0), ((NI) -1));
	{
		tyObject_IOError_iLZrPn9anoh9ad1MmO0RczFw* e;
		NimStringDesc* T5_;
		if (!(stream == NIM_NIL)) goto LA3_;
		e = (tyObject_IOError_iLZrPn9anoh9ad1MmO0RczFw*)0;
		e = (tyObject_IOError_iLZrPn9anoh9ad1MmO0RczFw*) newObj((&NTI_HMIVdYjdZYWskTmTQVo5BQ_), sizeof(tyObject_IOError_iLZrPn9anoh9ad1MmO0RczFw));
		(*e).Sup.Sup.Sup.m_type = (&NTI_iLZrPn9anoh9ad1MmO0RczFw_);
		T5_ = (NimStringDesc*)0;
		T5_ = rawNewString((filename ? filename->Sup.len : 0) + 23);
appendString(T5_, ((NimStringDesc*) &TM_9b9bytt1stv9cZ8uqII7HFgew_29));
appendString(T5_, filename);
		asgnRefNoCycle((void**) (&(*e).Sup.Sup.message), T5_);
		asgnRef((void**) (&(*e).Sup.Sup.parent), NIM_NIL);
		raiseException((Exception*)e, "IOError");
	}
	LA3_: ;
	T6_ = (tyObject_StreamObj_THYguAi9bSgidczZ3ywEIMQ*)0;
	T6_ = &stream->Sup;
	result = parseJson_USjX2tNLHJG9bTLdnLy01cw(T6_, filename);
	return result;
}

N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getStr_z2Itmc4KJ7uMBtaTVQ09cqw)(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q* n, NimStringDesc* default_0) {
	NimStringDesc* result;
{	result = (NimStringDesc*)0;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (n == 0);
		if (T3_) goto LA4_;
		T3_ = !(((*n).kind == ((tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg) 4)));
		LA4_: ;
		if (!T3_) goto LA5_;
		result = copyString(default_0);
		goto BeforeRet_;
	}
	goto LA1_;
	LA5_: ;
	{
		result = copyString((*n)._Ukind.S1.str);
		goto BeforeRet_;
	}
	LA1_: ;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_jsonInit000)(void) {
{
	TFrame FR_; FR_.len = 0;
}
}

N_LIB_PRIVATE N_NIMCALL(void, stdlib_jsonDatInit000)(void) {
static TNimNode* TM_9b9bytt1stv9cZ8uqII7HFgew_12[7];
NI TM_9b9bytt1stv9cZ8uqII7HFgew_14;
static char* NIM_CONST TM_9b9bytt1stv9cZ8uqII7HFgew_13[7] = {
"JNull", 
"JBool", 
"JInt", 
"JFloat", 
"JString", 
"JObject", 
"JArray"};
static TNimNode TM_9b9bytt1stv9cZ8uqII7HFgew_0[16];
NTI_df9bshXB7C9cTiWPIOtX3j1Q_.size = sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q);
NTI_df9bshXB7C9cTiWPIOtX3j1Q_.kind = 18;
NTI_df9bshXB7C9cTiWPIOtX3j1Q_.base = 0;
NTI_df9bshXB7C9cTiWPIOtX3j1Q_.flags = 2;
NTI_RUngo7nCHe6O8aBGIcrhtg_.size = sizeof(tyEnum_JsonNodeKind_RUngo7nCHe6O8aBGIcrhtg);
NTI_RUngo7nCHe6O8aBGIcrhtg_.kind = 14;
NTI_RUngo7nCHe6O8aBGIcrhtg_.base = 0;
NTI_RUngo7nCHe6O8aBGIcrhtg_.flags = 3;
for (TM_9b9bytt1stv9cZ8uqII7HFgew_14 = 0; TM_9b9bytt1stv9cZ8uqII7HFgew_14 < 7; TM_9b9bytt1stv9cZ8uqII7HFgew_14++) {
TM_9b9bytt1stv9cZ8uqII7HFgew_0[TM_9b9bytt1stv9cZ8uqII7HFgew_14+1].kind = 1;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[TM_9b9bytt1stv9cZ8uqII7HFgew_14+1].offset = TM_9b9bytt1stv9cZ8uqII7HFgew_14;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[TM_9b9bytt1stv9cZ8uqII7HFgew_14+1].name = TM_9b9bytt1stv9cZ8uqII7HFgew_13[TM_9b9bytt1stv9cZ8uqII7HFgew_14];
TM_9b9bytt1stv9cZ8uqII7HFgew_12[TM_9b9bytt1stv9cZ8uqII7HFgew_14] = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[TM_9b9bytt1stv9cZ8uqII7HFgew_14+1];
}
TM_9b9bytt1stv9cZ8uqII7HFgew_0[8].len = 7; TM_9b9bytt1stv9cZ8uqII7HFgew_0[8].kind = 2; TM_9b9bytt1stv9cZ8uqII7HFgew_0[8].sons = &TM_9b9bytt1stv9cZ8uqII7HFgew_12[0];
NTI_RUngo7nCHe6O8aBGIcrhtg_.node = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[8];
TM_9b9bytt1stv9cZ8uqII7HFgew_0[0].kind = 3;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[0].offset = offsetof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q, kind);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[0].typ = (&NTI_RUngo7nCHe6O8aBGIcrhtg_);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[0].name = "kind";
TM_9b9bytt1stv9cZ8uqII7HFgew_0[0].sons = &NimDT__df9bshXB7C9cTiWPIOtX3j1Q_kind[0];
TM_9b9bytt1stv9cZ8uqII7HFgew_0[0].len = 7;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[9].kind = 1;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[9].offset = offsetof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q, _Ukind.S1.str);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[9].typ = (&NTI_77mFvmsOLKik79ci2hXkHEg_);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[9].name = "str";
NimDT__df9bshXB7C9cTiWPIOtX3j1Q_kind[4] = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[9];
TM_9b9bytt1stv9cZ8uqII7HFgew_0[10].kind = 1;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[10].offset = offsetof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q, _Ukind.S2.num);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[10].typ = (&NTI_Aav8dQoMlCFnZRxA0IhTHQ_);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[10].name = "num";
NimDT__df9bshXB7C9cTiWPIOtX3j1Q_kind[2] = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[10];
TM_9b9bytt1stv9cZ8uqII7HFgew_0[11].kind = 1;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[11].offset = offsetof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q, _Ukind.S3.fnum);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[11].typ = (&NTI_w9bl9a1ul9ctRJWiMl9cNnIMvg_);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[11].name = "fnum";
NimDT__df9bshXB7C9cTiWPIOtX3j1Q_kind[3] = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[11];
TM_9b9bytt1stv9cZ8uqII7HFgew_0[12].kind = 1;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[12].offset = offsetof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q, _Ukind.S4.bval);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[12].typ = (&NTI_VaVACK0bpYmqIQ0mKcHfQQ_);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[12].name = "bval";
NimDT__df9bshXB7C9cTiWPIOtX3j1Q_kind[1] = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[12];
TM_9b9bytt1stv9cZ8uqII7HFgew_0[13].len = 0; TM_9b9bytt1stv9cZ8uqII7HFgew_0[13].kind = 2;
NimDT__df9bshXB7C9cTiWPIOtX3j1Q_kind[0] = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[13];
TM_9b9bytt1stv9cZ8uqII7HFgew_0[14].kind = 1;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[14].offset = offsetof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q, _Ukind.S6.fields);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[14].typ = (&NTI_ZZvSdVkA2s2sIyifu4cpkg_);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[14].name = "fields";
NimDT__df9bshXB7C9cTiWPIOtX3j1Q_kind[5] = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[14];
NTI_oLpBKXzW3hF9aCVMo5EymfQ_.size = sizeof(tySequence_oLpBKXzW3hF9aCVMo5EymfQ*);
NTI_oLpBKXzW3hF9aCVMo5EymfQ_.kind = 24;
NTI_oLpBKXzW3hF9aCVMo5EymfQ_.base = (&NTI_zfzzuQ8txrdZAYK0WGWpHg_);
NTI_oLpBKXzW3hF9aCVMo5EymfQ_.flags = 2;
NTI_oLpBKXzW3hF9aCVMo5EymfQ_.marker = Marker_tySequence_oLpBKXzW3hF9aCVMo5EymfQ;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[15].kind = 1;
TM_9b9bytt1stv9cZ8uqII7HFgew_0[15].offset = offsetof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q, _Ukind.S7.elems);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[15].typ = (&NTI_oLpBKXzW3hF9aCVMo5EymfQ_);
TM_9b9bytt1stv9cZ8uqII7HFgew_0[15].name = "elems";
NimDT__df9bshXB7C9cTiWPIOtX3j1Q_kind[6] = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[15];
NTI_df9bshXB7C9cTiWPIOtX3j1Q_.node = &TM_9b9bytt1stv9cZ8uqII7HFgew_0[0];
NTI_zfzzuQ8txrdZAYK0WGWpHg_.size = sizeof(tyObject_JsonNodeObj_df9bshXB7C9cTiWPIOtX3j1Q*);
NTI_zfzzuQ8txrdZAYK0WGWpHg_.kind = 22;
NTI_zfzzuQ8txrdZAYK0WGWpHg_.base = (&NTI_df9bshXB7C9cTiWPIOtX3j1Q_);
NTI_zfzzuQ8txrdZAYK0WGWpHg_.flags = 2;
NTI_zfzzuQ8txrdZAYK0WGWpHg_.marker = Marker_tyRef_zfzzuQ8txrdZAYK0WGWpHg;
}

