/* Generated by Nim Compiler v1.4.2 */
/*   (c) 2020 Andreas Rumpf */
/* The generated code is subject to the original license. */
#define NIM_INTBITS 32

/* section: NIM_merge_HEADERS */

#include "nimbase.h"
#include <string.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

/* section: NIM_merge_FRAME_DEFINES */
#define nimfr_(x, y)
#define nimln_(x, y)

/* section: NIM_merge_FORWARD_TYPES */
typedef struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw;
typedef struct tyTuple__LCURwohbLBusrL8hdCnvng tyTuple__LCURwohbLBusrL8hdCnvng;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_TType__v9ae2Dpu13OW2ZJ2U9bNMd9cQ tyObject_TType__v9ae2Dpu13OW2ZJ2U9bNMd9cQ;
typedef struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q;
typedef struct tyObject_TSym__JpsEh5i1AcKChGYbg7aV4w tyObject_TSym__JpsEh5i1AcKChGYbg7aV4w;
typedef struct tyObject_TIdent__GufRQq9c0miSybX3zBD4tyA tyObject_TIdent__GufRQq9c0miSybX3zBD4tyA;
typedef struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
typedef struct tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q;

/* section: NIM_merge_TYPES */
typedef NU8 tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyTuple__LCURwohbLBusrL8hdCnvng {
tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg Field0;
NimStringDesc* Field1;
};
struct tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q {
NU16 line;
NI16 col;
NI32 fileIndex;
};
typedef NU32 tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg;
typedef NU8 tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw;
struct tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw {
tyObject_TType__v9ae2Dpu13OW2ZJ2U9bNMd9cQ* typ;
tyObject_TLineInfo__WGx4rAexNXnczy1Avn646Q info;
tySet_tyEnum_TNodeFlag__jyh9acXHkhZANSSvPIY7ZLg flags;
tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind;
union{
struct {NI64 intVal;
} _kind_1;
struct {NF floatVal;
} _kind_2;
struct {NimStringDesc* strVal;
} _kind_3;
struct {tyObject_TSym__JpsEh5i1AcKChGYbg7aV4w* sym;
} _kind_4;
struct {tyObject_TIdent__GufRQq9c0miSybX3zBD4tyA* ident;
} _kind_5;
struct {tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ* sons;
} _kind_6;
};
NimStringDesc* comment;
};
typedef tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* tyArray__cypz0nHJsd9cnKgpO7fP5hQ[1];
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringDesc* Field0;
NI Field1;
};
typedef NU8 tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA;
typedef NU8 tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA;
struct tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q {
NI64 seconds;
NI nanosecond;
};

/* section: NIM_merge_SEQ_TYPES */
struct tySequence__ehmV9bTklH2Gt9cXHV9c0HLeQ {
  TGenericSeq Sup;
  tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* data[SEQ_DECL_SIZE];
};

/* section: NIM_merge_PROC_HEADERS */
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, newTree__FpOm4fidh9bWdkMa1BMRJkQ)(tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw** children, NI childrenLen_0);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__JE6t4x7Z3v2iVz27Nx0MRAmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(void, add__P8dDSotTW25BkfbyspojGg)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* father, tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* son);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__XzMAJc0GGWYgaYOSClxvNw)(tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg a);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, newIntNode__zcNs9blLGYB6i9aGKob9bpzRw)(tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind, NI64 intVal);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__N0ltfTCE2Mj4nr8HqFbJ9cQ)(NimStringDesc* a);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, newStrNode__zLcHGdlEbBYFtoCoan9agkg)(tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind, NimStringDesc* strVal);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__KZ9a9bTgdOw1aWV8EscFxiGA)(NI a);
static N_INLINE(NI, safeLen__P89cqdlERShb9alU3iC0yj8w_2ast)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
static N_INLINE(NI, len__P89cqdlERShb9alU3iC0yj8wast)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, newNode__PMZ27S9ai4FB3gXOMDXvwsQ)(tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw kind);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__lzHzqNvA37Tzt69cUn2gqoA)(NI64 a);
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__lPsOmqLsRkODU2dv9bS7i4Q)(NI a);

/* section: NIM_merge_DATA */
STRING_LITERAL(TM__Cx3HKQVn9adIHIP3IGqzKvw_2, "seconds", 7);
STRING_LITERAL(TM__Cx3HKQVn9adIHIP3IGqzKvw_3, "nanosecond", 10);

/* section: NIM_merge_PROCS */
static N_INLINE(void, nimSetMem__JE6t4x7Z3v2iVz27Nx0MRAmemory)(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__JE6t4x7Z3v2iVz27Nx0MRAmemory(p, ((int) 0), size);
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__XzMAJc0GGWYgaYOSClxvNw)(tyEnum_PathComponent__9c1SIU9cO1wHcl09b703A9cDrg a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	result = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	result = newIntNode__zcNs9blLGYB6i9aGKob9bpzRw(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 6), ((NI64) (a)));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__N0ltfTCE2Mj4nr8HqFbJ9cQ)(NimStringDesc* a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	result = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	result = newStrNode__zLcHGdlEbBYFtoCoan9agkg(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 20), a);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__EiNc3CjWjUuz7a9aOLdGMhw)(tyTuple__LCURwohbLBusrL8hdCnvng a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	tyArray__cypz0nHJsd9cnKgpO7fP5hQ T1_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T2_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T3_;
	result = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	nimZeroMem((void*)T1_, sizeof(tyArray__cypz0nHJsd9cnKgpO7fP5hQ));
	result = newTree__FpOm4fidh9bWdkMa1BMRJkQ(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 160), T1_, 0);
	T2_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T2_ = toLit__XzMAJc0GGWYgaYOSClxvNw(a.Field0);
	add__P8dDSotTW25BkfbyspojGg(result, T2_);
	T3_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T3_ = toLit__N0ltfTCE2Mj4nr8HqFbJ9cQ(a.Field1);
	add__P8dDSotTW25BkfbyspojGg(result, T3_);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__KZ9a9bTgdOw1aWV8EscFxiGA)(NI a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	result = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	result = newIntNode__zcNs9blLGYB6i9aGKob9bpzRw(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 6), ((NI64) (a)));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__KipqGaFAV5q2V57HtRKVog)(tyTuple__XOVT24GHXwqiEj5GCsEGCA a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	tyArray__cypz0nHJsd9cnKgpO7fP5hQ T1_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T2_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T3_;
	result = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	nimZeroMem((void*)T1_, sizeof(tyArray__cypz0nHJsd9cnKgpO7fP5hQ));
	result = newTree__FpOm4fidh9bWdkMa1BMRJkQ(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 160), T1_, 0);
	T2_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T2_ = toLit__N0ltfTCE2Mj4nr8HqFbJ9cQ(a.Field0);
	add__P8dDSotTW25BkfbyspojGg(result, T2_);
	T3_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T3_ = toLit__KZ9a9bTgdOw1aWV8EscFxiGA(a.Field1);
	add__P8dDSotTW25BkfbyspojGg(result, T3_);
	return result;
}
static N_INLINE(NI, len__P89cqdlERShb9alU3iC0yj8wast)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
	NI result;
	NI T1_;
	result = (NI)0;
	T1_ = ((*n)._kind_6.sons ? (*n)._kind_6.sons->Sup.len : 0);
	result = T1_;
	return result;
}
static N_INLINE(NI, safeLen__P89cqdlERShb9alU3iC0yj8w_2ast)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* n) {
	NI result;
	result = (NI)0;
	{
		if (!((*n).kind >= ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 0) && (*n).kind <= ((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 23))) goto LA3_;
		result = ((NI) 0);
	}
	goto LA1_;
	LA3_: ;
	{
		result = len__P89cqdlERShb9alU3iC0yj8wast(n);
	}
	LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA, fromLit__e9bUTNbnzAFOnIlmlr8pdHQ)(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* a) {
	tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA result;
	nimZeroMem((void*)(&result), sizeof(tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA));
	nimZeroMem((void*)(&result), sizeof(tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA));
	{
		tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* ai;
		ai = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
		{
			NI i;
			NI colontmp_;
			NI i_2;
			i = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = safeLen__P89cqdlERShb9alU3iC0yj8w_2ast(a);
			i_2 = ((NI) 0);
			{
				while (1) {
					if (!(i_2 < colontmp_)) goto LA4;
					i = i_2;
					ai = (*a)._kind_6.sons->data[i];
					result |= ((NU8)1)<<((((tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA) ((*ai)._kind_1.intVal))) & 7);
					i_2 += ((NI) 1);
				} LA4: ;
			}
		}
	}
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__DMaoEIGAr8AMJz2e1gXYjA)(tyTuple__XOVT24GHXwqiEj5GCsEGCA a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	tyArray__cypz0nHJsd9cnKgpO7fP5hQ T1_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T2_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T3_;
	result = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	nimZeroMem((void*)T1_, sizeof(tyArray__cypz0nHJsd9cnKgpO7fP5hQ));
	result = newTree__FpOm4fidh9bWdkMa1BMRJkQ(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 160), T1_, 0);
	T2_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T2_ = toLit__N0ltfTCE2Mj4nr8HqFbJ9cQ(a.Field0);
	add__P8dDSotTW25BkfbyspojGg(result, T2_);
	T3_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T3_ = toLit__KZ9a9bTgdOw1aWV8EscFxiGA(a.Field1);
	add__P8dDSotTW25BkfbyspojGg(result, T3_);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__lzHzqNvA37Tzt69cUn2gqoA)(NI64 a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	result = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	result = newIntNode__zcNs9blLGYB6i9aGKob9bpzRw(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 6), ((NI64) (a)));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__lPsOmqLsRkODU2dv9bS7i4Q)(NI a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	result = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	result = newIntNode__zcNs9blLGYB6i9aGKob9bpzRw(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 6), ((NI64) (a)));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*, toLit__LV9bmSfqNNIbUGH8kJv4pMw)(tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q a) {
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* result;
	tyArray__cypz0nHJsd9cnKgpO7fP5hQ T1_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T2_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* reti;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T3_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T4_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* reti_2;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T5_;
	tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw* T6_;
	result = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	nimZeroMem((void*)T1_, sizeof(tyArray__cypz0nHJsd9cnKgpO7fP5hQ));
	result = newTree__FpOm4fidh9bWdkMa1BMRJkQ(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 38), T1_, 0);
	T2_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T2_ = newNode__PMZ27S9ai4FB3gXOMDXvwsQ(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 1));
	add__P8dDSotTW25BkfbyspojGg(result, T2_);
	reti = newNode__PMZ27S9ai4FB3gXOMDXvwsQ(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 34));
	T3_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T3_ = toLit__N0ltfTCE2Mj4nr8HqFbJ9cQ(((NimStringDesc*) &TM__Cx3HKQVn9adIHIP3IGqzKvw_2));
	add__P8dDSotTW25BkfbyspojGg(reti, T3_);
	T4_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T4_ = toLit__lzHzqNvA37Tzt69cUn2gqoA(a.seconds);
	add__P8dDSotTW25BkfbyspojGg(reti, T4_);
	add__P8dDSotTW25BkfbyspojGg(result, reti);
	reti_2 = newNode__PMZ27S9ai4FB3gXOMDXvwsQ(((tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw) 34));
	T5_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T5_ = toLit__N0ltfTCE2Mj4nr8HqFbJ9cQ(((NimStringDesc*) &TM__Cx3HKQVn9adIHIP3IGqzKvw_3));
	add__P8dDSotTW25BkfbyspojGg(reti_2, T5_);
	T6_ = (tyObject_TNode__bROa11lyF5vxEN9aYNbHmhw*)0;
	T6_ = toLit__lPsOmqLsRkODU2dv9bS7i4Q(a.nanosecond);
	add__P8dDSotTW25BkfbyspojGg(reti_2, T6_);
	add__P8dDSotTW25BkfbyspojGg(result, reti_2);
	return result;
}
