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

#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
#define nimfr_(x, y)
#define nimln_(x, y)
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyTuple__kN8up2W6YKc5YA9avn5mV5w tyTuple__kN8up2W6YKc5YA9avn5mV5w;
typedef struct tyTuple__nlLlqVveYUlcdyx2e2bPTw tyTuple__nlLlqVveYUlcdyx2e2bPTw;
typedef struct tyTuple__9cqHuynYNPU9avbszh3XtBAg tyTuple__9cqHuynYNPU9avbszh3XtBAg;
typedef struct tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA;
typedef struct tyTuple__flePlH29a9c9cGo1Wdll1KDOQ tyTuple__flePlH29a9c9cGo1Wdll1KDOQ;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyTuple__kN8up2W6YKc5YA9avn5mV5w {
NimStringDesc* Field0;
NI Field1;
NI Field2;
};
typedef NU8 tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw;
struct tyTuple__nlLlqVveYUlcdyx2e2bPTw {
NimStringDesc* Field0;
tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw Field1;
NimStringDesc* Field2;
NimStringDesc* Field3;
NimStringDesc* Field4;
NI Field5;
};
typedef NU8 tyEnum_TTypeKind__9a3YiReNVD0IJHWFKgXRe9ag;
struct tyTuple__9cqHuynYNPU9avbszh3XtBAg {
NimStringDesc* Field0;
tyEnum_TTypeKind__9a3YiReNVD0IJHWFKgXRe9ag Field1;
};
typedef NU16 tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA;
struct tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA {
NimStringDesc* Field0;
tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA Field1;
};
typedef NU8 tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA;
struct tyTuple__flePlH29a9c9cGo1Wdll1KDOQ {
NimStringDesc* Field0;
NimStringDesc* Field1;
NCSTRING Field2;
};
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyString)(NimStringDesc* src);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
static N_INLINE(void, copyMem__M04YC71iJg1N7gBF3HZTngsystem)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, resizeString)(NimStringDesc* dest, NI addlen);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__45fPtFhY4FavRaYwDhRfuA)(NimStringDesc** s, NimStringDesc* x);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__Eys2fLM61EBlquSM8n9cIsw)(NimStringDesc** s, NI x);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__sCg9bHpRxLXpSphc63mtWdw)(NimStringDesc** s, tyEnum_TNodeKind__G4E4Gxe7oI2Cm03rkiOzQw x);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__wRMAZHpaipmaQ037ptRATQ)(NimStringDesc** s, NI x);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__2NPdL9cn8CBwngwsy2yb9bcg)(NimStringDesc** s, tyEnum_TTypeKind__9a3YiReNVD0IJHWFKgXRe9ag x);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__1G4urwoNQVZWpvb9cOSxyDg)(NimStringDesc** s, tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA x);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, collectionToString__doMKFdUqCnGTD5AcDAmwhg)(tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA x, NimStringDesc* prefix, NimStringDesc* separator, NimStringDesc* suffix);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__a1NjIrFmhV6Q9aR4YbBJQ5g)(NimStringDesc** s, tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA x);
N_LIB_PRIVATE N_NIMCALL(void, addQuoted__ARWLtdz6aJCA2LIYS9cFiGQ)(NimStringDesc** s, NCSTRING x);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_2, "(", 1);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_3, ", ", 2);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_4, "filename", 8);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_5, ": ", 2);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_6, "line", 4);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_7, "column", 6);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_8, ")", 1);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_9, ",", 1);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_10, "{", 1);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_11, "}", 1);
STRING_LITERAL(TM__n49a9aYp5BrbXv9a6OCpJYm0g_12, "nil", 3);
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__M04YC71iJg1N7gBF3HZTngsystem)(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__M04YC71iJg1N7gBF3HZTngsystem(((void*) ((&(*dest).data[(*dest).Sup.len]))), ((void*) ((*src).data)), ((NI) ((NI)((*src).Sup.len + ((NI) 1)))));
		(*dest).Sup.len += (*src).Sup.len;
	}
	LA3_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___r38WafKlW80RkvoZTcia4Q)(tyTuple__kN8up2W6YKc5YA9avn5mV5w x) {
	NimStringDesc* result;
	NIM_BOOL firstElement;
	result = (NimStringDesc*)0;
	result = copyString(((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_2));
	firstElement = NIM_TRUE;
	{
		if (!!(firstElement)) goto LA3_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA3_: ;
	result = resizeString(result, 8);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_4));
	result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_5));
	addQuoted__45fPtFhY4FavRaYwDhRfuA((&result), x.Field0);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA7_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA7_: ;
	result = resizeString(result, 4);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_6));
	result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_5));
	addQuoted__Eys2fLM61EBlquSM8n9cIsw((&result), x.Field1);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA11_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA11_: ;
	result = resizeString(result, 6);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_7));
	result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_5));
	addQuoted__Eys2fLM61EBlquSM8n9cIsw((&result), x.Field2);
	firstElement = NIM_FALSE;
	result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_8));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___HBZb4pgGTJ0NuRxlEYFytw)(tyTuple__nlLlqVveYUlcdyx2e2bPTw x) {
	NimStringDesc* result;
	NIM_BOOL firstElement;
	NI count;
	result = (NimStringDesc*)0;
	result = copyString(((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_2));
	firstElement = NIM_TRUE;
	count = ((NI) 0);
	{
		if (!!(firstElement)) goto LA3_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA3_: ;
	count += ((NI) 1);
	addQuoted__45fPtFhY4FavRaYwDhRfuA((&result), x.Field0);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA7_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA7_: ;
	count += ((NI) 1);
	addQuoted__sCg9bHpRxLXpSphc63mtWdw((&result), x.Field1);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA11_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA11_: ;
	count += ((NI) 1);
	addQuoted__45fPtFhY4FavRaYwDhRfuA((&result), x.Field2);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA15_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA15_: ;
	count += ((NI) 1);
	addQuoted__45fPtFhY4FavRaYwDhRfuA((&result), x.Field3);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA19_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA19_: ;
	count += ((NI) 1);
	addQuoted__45fPtFhY4FavRaYwDhRfuA((&result), x.Field4);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA23_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA23_: ;
	count += ((NI) 1);
	addQuoted__wRMAZHpaipmaQ037ptRATQ((&result), x.Field5);
	firstElement = NIM_FALSE;
	{
		if (!(count == ((NI) 1))) goto LA27_;
		result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_9));
	}
	LA27_: ;
	result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_8));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___XSFzZuEhhtAqOvJ5uRr9cuA)(tyTuple__9cqHuynYNPU9avbszh3XtBAg x) {
	NimStringDesc* result;
	NIM_BOOL firstElement;
	NI count;
	result = (NimStringDesc*)0;
	result = copyString(((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_2));
	firstElement = NIM_TRUE;
	count = ((NI) 0);
	{
		if (!!(firstElement)) goto LA3_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA3_: ;
	count += ((NI) 1);
	addQuoted__45fPtFhY4FavRaYwDhRfuA((&result), x.Field0);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA7_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA7_: ;
	count += ((NI) 1);
	addQuoted__2NPdL9cn8CBwngwsy2yb9bcg((&result), x.Field1);
	firstElement = NIM_FALSE;
	{
		if (!(count == ((NI) 1))) goto LA11_;
		result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_9));
	}
	LA11_: ;
	result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_8));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, collectionToString__doMKFdUqCnGTD5AcDAmwhg)(tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA x, NimStringDesc* prefix, NimStringDesc* separator, NimStringDesc* suffix) {
	NimStringDesc* result;
	NIM_BOOL firstElement;
	result = (NimStringDesc*)0;
	result = copyString(prefix);
	firstElement = NIM_TRUE;
	{
		tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA value;
		NI i;
		value = (tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA)0;
		i = ((NI) 0);
		{
			while (1) {
				if (!(i <= ((NI) 8))) goto LA3;
				{
					if (!((x &(1U<<((NU)(((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) (i)))&15U)))!=0)) goto LA6_;
					value = ((tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA) (i));
					{
						if (!firstElement) goto LA10_;
						firstElement = NIM_FALSE;
					}
					goto LA8_;
					LA10_: ;
					{
						result = resizeString(result, (separator ? separator->Sup.len : 0) + 0);
appendString(result, separator);
					}
					LA8_: ;
					addQuoted__a1NjIrFmhV6Q9aR4YbBJQ5g((&result), value);
				}
				LA6_: ;
				i += ((NI) 1);
			} LA3: ;
		}
	}
	result = resizeString(result, (suffix ? suffix->Sup.len : 0) + 0);
appendString(result, suffix);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___rwI9b63GTi28OPn2o8TnuVg)(tySet_tyEnum_FilePermission__uTVeDpjCH6aWw9c74YkAskA x) {
	NimStringDesc* result;
	result = (NimStringDesc*)0;
	result = collectionToString__doMKFdUqCnGTD5AcDAmwhg(x, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_10), ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3), ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_11));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___VhyooW9cjC7wNKZM71oRg9cg)(tyTuple__HFn8JzZZeLZ9aKrFg4S9a7HA x) {
	NimStringDesc* result;
	NIM_BOOL firstElement;
	NI count;
	result = (NimStringDesc*)0;
	result = copyString(((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_2));
	firstElement = NIM_TRUE;
	count = ((NI) 0);
	{
		if (!!(firstElement)) goto LA3_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA3_: ;
	count += ((NI) 1);
	addQuoted__45fPtFhY4FavRaYwDhRfuA((&result), x.Field0);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA7_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA7_: ;
	count += ((NI) 1);
	addQuoted__1G4urwoNQVZWpvb9cOSxyDg((&result), x.Field1);
	firstElement = NIM_FALSE;
	{
		if (!(count == ((NI) 1))) goto LA11_;
		result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_9));
	}
	LA11_: ;
	result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_8));
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, dollar___uRqZ9b9aRtL1gygwVfSa9bmlQ)(tyTuple__flePlH29a9c9cGo1Wdll1KDOQ x) {
	NimStringDesc* result;
	NIM_BOOL firstElement;
	NI count;
	result = (NimStringDesc*)0;
	result = copyString(((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_2));
	firstElement = NIM_TRUE;
	count = ((NI) 0);
	{
		if (!!(firstElement)) goto LA3_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA3_: ;
	count += ((NI) 1);
	addQuoted__45fPtFhY4FavRaYwDhRfuA((&result), x.Field0);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA7_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA7_: ;
	count += ((NI) 1);
	addQuoted__45fPtFhY4FavRaYwDhRfuA((&result), x.Field1);
	firstElement = NIM_FALSE;
	{
		if (!!(firstElement)) goto LA11_;
		result = resizeString(result, 2);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_3));
	}
	LA11_: ;
	count += ((NI) 1);
	{
		if (!(x.Field2 == 0)) goto LA15_;
		result = resizeString(result, 3);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_12));
	}
	goto LA13_;
	LA15_: ;
	{
		addQuoted__ARWLtdz6aJCA2LIYS9cFiGQ((&result), x.Field2);
	}
	LA13_: ;
	firstElement = NIM_FALSE;
	{
		if (!(count == ((NI) 1))) goto LA20_;
		result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_9));
	}
	LA20_: ;
	result = resizeString(result, 1);
appendString(result, ((NimStringDesc*) &TM__n49a9aYp5BrbXv9a6OCpJYm0g_8));
	return result;
}
