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

/* section: NIM_merge_HEADERS */

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

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

/* section: NIM_merge_FORWARD_TYPES */
typedef struct tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_CONSOLE_SCREEN_BUFFER_INFO__r6d5R6U7A9aP1xHUbo2o04A tyObject_CONSOLE_SCREEN_BUFFER_INFO__r6d5R6U7A9aP1xHUbo2o04A;
typedef struct tyObject_COORD__38Oq1GgFPIYv2ksRi9c0fZA tyObject_COORD__38Oq1GgFPIYv2ksRi9c0fZA;
typedef struct tyObject_SMALL_RECT__GSDbaE1SdabWptSZYJG3XA tyObject_SMALL_RECT__GSDbaE1SdabWptSZYJG3XA;

/* section: NIM_merge_TYPES */
struct tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og {
NIM_BOOL trueColorIsSupported;
NIM_BOOL trueColorIsEnabled;
NIM_BOOL fgSetColor;
NI hStdout;
NI hStderr;
NI16 oldStdoutAttr;
NI16 oldStderrAttr;
};
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;
NI align;
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;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
typedef NU16 tySet_tyEnum_Style__NXKayqTLMsAibFwNceBlpA;
typedef N_STDCALL_PTR(NI, tyProc__zP2zGemcuVRvOUE82f9a0Pw) (NI32 nStdHandle);
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef N_STDCALL_PTR(NI32, tyProc__oew1DfaGl5XhHmnBK0HYXQ) (NI hSourceProcessHandle, NI hSourceHandle, NI hTargetProcessHandle, NI* lpTargetHandle, NI32 dwDesiredAccess, NI32 bInheritHandle, NI32 dwOptions);
typedef N_STDCALL_PTR(NI, tyProc__uryidYWkntM7ddjZSyxvyQ) (void);
struct tyObject_COORD__38Oq1GgFPIYv2ksRi9c0fZA {
NI16 x;
NI16 y;
};
struct tyObject_SMALL_RECT__GSDbaE1SdabWptSZYJG3XA {
NI16 left;
NI16 top;
NI16 right;
NI16 bottom;
};
struct tyObject_CONSOLE_SCREEN_BUFFER_INFO__r6d5R6U7A9aP1xHUbo2o04A {
tyObject_COORD__38Oq1GgFPIYv2ksRi9c0fZA dwSize;
tyObject_COORD__38Oq1GgFPIYv2ksRi9c0fZA dwCursorPosition;
NI16 wAttributes;
tyObject_SMALL_RECT__GSDbaE1SdabWptSZYJG3XA srWindow;
tyObject_COORD__38Oq1GgFPIYv2ksRi9c0fZA dwMaximumWindowSize;
};
typedef N_STDCALL_PTR(NI32, tyProc__vjGHiWUJwFzOgSxDffBb6Q) (NI hConsoleOutput, tyObject_CONSOLE_SCREEN_BUFFER_INFO__r6d5R6U7A9aP1xHUbo2o04A* lpConsoleScreenBufferInfo);
typedef NU8 tyEnum_Style__NXKayqTLMsAibFwNceBlpA;
typedef N_STDCALL_PTR(NI32, tyProc__oPCjp4xTgEl9a8fqSzOv8lw) (NI hConsoleOutput, NI16 wAttributes);
typedef NU8 tyEnum_ForegroundColor__ez9ah4IgQc0AbdW68acioDg;
typedef NI tyArray__e7dTfxuKO1YfQGLA3anCHg[10];

/* section: NIM_merge_PROC_HEADERS */
static N_NIMCALL(void, Marker_tyRef__flNJLrANZti6Wiy5LTlGGA)(void* p, NI op);
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, TM__CN3raB9atujkEiPpxYAdlgQ_3)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimRegisterThreadLocalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
N_LIB_PRIVATE N_NIMCALL(int, getFileHandle__hOwLbM7eXaZgEJrHWLeiNg)(FILE* f);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*, getTerminal__eaf5C0KoL9blsRnH3dpKg9cAterminal)(void);
N_LIB_PRIVATE N_NIMCALL(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*, newTerminal__gqQwXzih8DHgmLF8712eSg)(void);
N_LIB_PRIVATE N_NIMCALL(void*, newObj)(TNimType* typ, NI size);
N_LIB_PRIVATE N_NIMCALL(void, initTerminal__pedJmwzZhBZ3Plges9cE1og)(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* term);
N_LIB_PRIVATE N_NIMCALL(void*, nimLoadLibrary)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(void, nimLoadLibraryError)(NimStringDesc* path);
N_LIB_PRIVATE N_NIMCALL(void*, nimGetProcAddr)(void* lib, NCSTRING name);
N_LIB_PRIVATE N_NIMCALL(NI16, getAttributes__DruuydPLPxoaQzMTah2aEA)(NI h);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
N_LIB_PRIVATE N_NIMCALL(NI16, toU16__bAz4iFsqhxgGjiYIPM1r9cw)(NI x);

/* section: NIM_merge_DATA */
N_LIB_PRIVATE TNimType NTI__EcU8GhMNGo9bGDXbfqZ82og_;
extern TNimType NTI__VaVACK0bpYmqIQ0mKcHfQQ_;
extern TNimType NTI__rR5Bzr1D5krxoo1NcNyeMA_;
extern TNimType NTI__kDPg4wXyR8DDyA0MeEjIsw_;
N_LIB_PRIVATE TNimType NTI__flNJLrANZti6Wiy5LTlGGA_;
STRING_LITERAL(TM__CN3raB9atujkEiPpxYAdlgQ_6, "kernel32", 8);
STRING_LITERAL(TM__CN3raB9atujkEiPpxYAdlgQ_7, "kernel32", 8);
N_LIB_PRIVATE NIM_CONST tyArray__e7dTfxuKO1YfQGLA3anCHg lookup__iBTamPHB6H8lJIzDyv8epw = {((NI) 0),
((NI) 4),
((NI) 2),
((NI) 6),
((NI) 1),
((NI) 5),
((NI) 3),
((NI) 7),
((NI) 0),
((NI) 0)}
;

/* section: NIM_merge_VARS */
N_LIB_PRIVATE tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* gTerm__wkpx9csKte2r1l45yvskIcA;
N_LIB_PRIVATE NI16 defaultForegroundColor__6AZwdPXNbiAiBenoe9ctX8Q = ((NI16) -1);
N_LIB_PRIVATE NI16 defaultBackgroundColor__YTRYy0uam8XiIGGjkK9cexw = ((NI16) -1);
extern NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
extern tyProc__zP2zGemcuVRvOUE82f9a0Pw Dl_12796820_;
static void* TM__CN3raB9atujkEiPpxYAdlgQ_4;
tyProc__oew1DfaGl5XhHmnBK0HYXQ Dl_15991308_;
tyProc__uryidYWkntM7ddjZSyxvyQ Dl_15991318_;
tyProc__vjGHiWUJwFzOgSxDffBb6Q Dl_15991320_;
tyProc__oPCjp4xTgEl9a8fqSzOv8lw Dl_16010034_;

/* section: NIM_merge_PROCS */
static N_NIMCALL(void, Marker_tyRef__flNJLrANZti6Wiy5LTlGGA)(void* p, NI op) {
	tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* a;
	a = (tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*)p;
}
static N_NIMCALL(void, TM__CN3raB9atujkEiPpxYAdlgQ_3)(void) {
	nimGCvisit((void*)gTerm__wkpx9csKte2r1l45yvskIcA, 0);
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (NIM_BOOL*)0;
	result = (&nimInErrorMode__759bT87luu8XGcbkw13FUjA);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, isatty__N9cWRL9bvOiaeIezt6AEzXqw)(FILE* f) {
	NIM_BOOL result;
	int T1_;
	int T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NIM_BOOL)0;
	T1_ = (int)0;
	T1_ = getFileHandle__hOwLbM7eXaZgEJrHWLeiNg(f);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T2_ = (int)0;
	T2_ = _isatty(T1_);
	result = !((T2_ == ((NI32) 0)));
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(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) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NI16, getAttributes__DruuydPLPxoaQzMTah2aEA)(NI h) {
	NI16 result;
	tyObject_CONSOLE_SCREEN_BUFFER_INFO__r6d5R6U7A9aP1xHUbo2o04A c;
{	result = (NI16)0;
	nimZeroMem((void*)(&c), sizeof(tyObject_CONSOLE_SCREEN_BUFFER_INFO__r6d5R6U7A9aP1xHUbo2o04A));
	{
		NI32 T3_;
		T3_ = (NI32)0;
		T3_ = Dl_15991320_(h, (&c));
		if (!!((T3_ == ((NI32) 0)))) goto LA4_;
		result = c.wAttributes;
		goto BeforeRet_;
	}
	LA4_: ;
	result = ((NI16) 112);
	goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, initTerminal__pedJmwzZhBZ3Plges9cE1og)(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* term) {
	NI hStdoutTemp;
	NI hStderrTemp;
	NI16 T17_;
	NI16 T18_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	hStdoutTemp = Dl_12796820_(((NI32) -11));
	{
		NI T3_;
		NI T4_;
		NI T5_;
		NI32 T6_;
		T3_ = (NI)0;
		T3_ = Dl_15991318_();
		T4_ = (NI)0;
		T4_ = T3_;
		T5_ = (NI)0;
		T5_ = Dl_15991318_();
		T6_ = (NI32)0;
		T6_ = Dl_15991308_(T4_, hStdoutTemp, T5_, (&(*term).hStdout), ((NI32) 0), ((NI32) 1), ((NI32) 2));
		if (!(T6_ == ((NI32) 0))) goto LA7_;
	}
	LA7_: ;
	hStderrTemp = Dl_12796820_(((NI32) -12));
	{
		NI T11_;
		NI T12_;
		NI T13_;
		NI32 T14_;
		T11_ = (NI)0;
		T11_ = Dl_15991318_();
		T12_ = (NI)0;
		T12_ = T11_;
		T13_ = (NI)0;
		T13_ = Dl_15991318_();
		T14_ = (NI32)0;
		T14_ = Dl_15991308_(T12_, hStderrTemp, T13_, (&(*term).hStderr), ((NI32) 0), ((NI32) 1), ((NI32) 2));
		if (!(T14_ == ((NI32) 0))) goto LA15_;
	}
	LA15_: ;
	T17_ = (NI16)0;
	T17_ = getAttributes__DruuydPLPxoaQzMTah2aEA((*term).hStdout);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	(*term).oldStdoutAttr = T17_;
	T18_ = (NI16)0;
	T18_ = getAttributes__DruuydPLPxoaQzMTah2aEA((*term).hStderr);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	(*term).oldStderrAttr = T18_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*, newTerminal__gqQwXzih8DHgmLF8712eSg)(void) {
	tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*)0;
	result = (tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*) newObj((&NTI__flNJLrANZti6Wiy5LTlGGA_), sizeof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og));
	initTerminal__pedJmwzZhBZ3Plges9cE1og(result);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*, getTerminal__eaf5C0KoL9blsRnH3dpKg9cAterminal)(void) {
	tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*)0;
	{
		tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* T5_;
		if (!(gTerm__wkpx9csKte2r1l45yvskIcA == 0)) goto LA3_;
		T5_ = (tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*)0;
		T5_ = newTerminal__gqQwXzih8DHgmLF8712eSg();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		gTerm__wkpx9csKte2r1l45yvskIcA = T5_;
	}
	LA3_: ;
	result = gTerm__wkpx9csKte2r1l45yvskIcA;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, setStyle__y8lW2LrW2n5ZHaxH9bAf4WA)(FILE* f, tySet_tyEnum_Style__NXKayqTLMsAibFwNceBlpA style) {
	NI h;
	tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* termX60gensym18_;
	NI16 old;
	NI16 T6_;
	NI16 a;
	NI32 T23_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	termX60gensym18_ = getTerminal__eaf5C0KoL9blsRnH3dpKg9cAterminal();
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		if (!(f == stderr)) goto LA3_;
		h = (*termX60gensym18_).hStderr;
	}
	goto LA1_;
	LA3_: ;
	{
		h = (*termX60gensym18_).hStdout;
	}
	LA1_: ;
	T6_ = (NI16)0;
	T6_ = getAttributes__DruuydPLPxoaQzMTah2aEA(h);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	old = (NI16)(T6_ & ((NI16) 119));
	a = ((NI16) 0);
	{
		if (!((style &(1U<<((NU)((((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 1)- 1))&15U)))!=0)) goto LA9_;
		a = (NI16)(a | ((NI16) 8));
	}
	LA9_: ;
	{
		if (!((style &(1U<<((NU)((((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 5)- 1))&15U)))!=0)) goto LA13_;
		a = (NI16)(a | ((NI16) 128));
	}
	LA13_: ;
	{
		if (!((style &(1U<<((NU)((((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 7)- 1))&15U)))!=0)) goto LA17_;
		a = (NI16)(a | ((NI16) 16384));
	}
	LA17_: ;
	{
		if (!((style &(1U<<((NU)((((tyEnum_Style__NXKayqTLMsAibFwNceBlpA) 4)- 1))&15U)))!=0)) goto LA21_;
		a = (NI16)(a | ((NI16) -32768));
	}
	LA21_: ;
	T23_ = (NI32)0;
	T23_ = Dl_16010034_(h, (NI16)(old | a));
	(void)(T23_);
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, resetAttributes__6J8xlU57R8cS9bLzTS89aM5g)(FILE* f) {
	tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* term;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	term = getTerminal__eaf5C0KoL9blsRnH3dpKg9cAterminal();
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		NI32 T5_;
		if (!(f == stderr)) goto LA3_;
		T5_ = (NI32)0;
		T5_ = Dl_16010034_((*term).hStderr, (*term).oldStderrAttr);
		(void)(T5_);
	}
	goto LA1_;
	LA3_: ;
	{
		NI32 T7_;
		T7_ = (NI32)0;
		T7_ = Dl_16010034_((*term).hStdout, (*term).oldStdoutAttr);
		(void)(T7_);
	}
	LA1_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, setForegroundColor__vJutklhcnQq9akCXxcuSHAg)(FILE* f, tyEnum_ForegroundColor__ez9ah4IgQc0AbdW68acioDg fg, NIM_BOOL bright) {
	NI h;
	tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og* termX60gensym23_;
	NI16 old;
	NI16 T6_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	termX60gensym23_ = getTerminal__eaf5C0KoL9blsRnH3dpKg9cAterminal();
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		if (!(f == stderr)) goto LA3_;
		h = (*termX60gensym23_).hStderr;
	}
	goto LA1_;
	LA3_: ;
	{
		h = (*termX60gensym23_).hStdout;
	}
	LA1_: ;
	T6_ = (NI16)0;
	T6_ = getAttributes__DruuydPLPxoaQzMTah2aEA(h);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	old = (NI16)(T6_ & ((NI16) -8));
	{
		if (!(defaultForegroundColor__6AZwdPXNbiAiBenoe9ctX8Q == ((NI16) -1))) goto LA9_;
		defaultForegroundColor__6AZwdPXNbiAiBenoe9ctX8Q = old;
	}
	LA9_: ;
	{
		if (!bright) goto LA13_;
		old = (NI16)(old | ((NI16) 8));
	}
	goto LA11_;
	LA13_: ;
	{
		old = (NI16)(old & ((NI16) -9));
	}
	LA11_: ;
	{
		NI16 T20_;
		NI32 T21_;
		if (!(fg == ((tyEnum_ForegroundColor__ez9ah4IgQc0AbdW68acioDg) 39))) goto LA18_;
		T20_ = (NI16)0;
		T20_ = toU16__bAz4iFsqhxgGjiYIPM1r9cw(((NI) ((NI16)(old | defaultForegroundColor__6AZwdPXNbiAiBenoe9ctX8Q))));
		T21_ = (NI32)0;
		T21_ = Dl_16010034_(h, T20_);
		(void)(T21_);
	}
	goto LA16_;
	LA18_: ;
	{
		NI16 T23_;
		NI32 T24_;
		T23_ = (NI16)0;
		T23_ = toU16__bAz4iFsqhxgGjiYIPM1r9cw((NI)(((NI) (old)) | lookup__iBTamPHB6H8lJIzDyv8epw[(fg)- 30]));
		T24_ = (NI32)0;
		T24_ = Dl_16010034_(h, T23_);
		(void)(T24_);
	}
	LA16_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_terminalInit000)(void) {
{

	nimRegisterThreadLocalMarker(TM__CN3raB9atujkEiPpxYAdlgQ_3);

}
}

N_LIB_PRIVATE N_NIMCALL(void, stdlib_terminalDatInit000)(void) {

/* section: NIM_merge_TYPE_INIT1 */
static TNimNode* TM__CN3raB9atujkEiPpxYAdlgQ_2_7[7];
static TNimNode TM__CN3raB9atujkEiPpxYAdlgQ_0[8];

/* section: NIM_merge_TYPE_INIT3 */
NTI__EcU8GhMNGo9bGDXbfqZ82og_.size = sizeof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og);
NTI__EcU8GhMNGo9bGDXbfqZ82og_.align = NIM_ALIGNOF(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og);
NTI__EcU8GhMNGo9bGDXbfqZ82og_.kind = 18;
NTI__EcU8GhMNGo9bGDXbfqZ82og_.base = 0;
NTI__EcU8GhMNGo9bGDXbfqZ82og_.flags = 3;
TM__CN3raB9atujkEiPpxYAdlgQ_2_7[0] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[1];
TM__CN3raB9atujkEiPpxYAdlgQ_0[1].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[1].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, trueColorIsSupported);
TM__CN3raB9atujkEiPpxYAdlgQ_0[1].typ = (&NTI__VaVACK0bpYmqIQ0mKcHfQQ_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[1].name = "trueColorIsSupported";
TM__CN3raB9atujkEiPpxYAdlgQ_2_7[1] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[2];
TM__CN3raB9atujkEiPpxYAdlgQ_0[2].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[2].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, trueColorIsEnabled);
TM__CN3raB9atujkEiPpxYAdlgQ_0[2].typ = (&NTI__VaVACK0bpYmqIQ0mKcHfQQ_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[2].name = "trueColorIsEnabled";
TM__CN3raB9atujkEiPpxYAdlgQ_2_7[2] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[3];
TM__CN3raB9atujkEiPpxYAdlgQ_0[3].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[3].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, fgSetColor);
TM__CN3raB9atujkEiPpxYAdlgQ_0[3].typ = (&NTI__VaVACK0bpYmqIQ0mKcHfQQ_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[3].name = "fgSetColor";
TM__CN3raB9atujkEiPpxYAdlgQ_2_7[3] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[4];
TM__CN3raB9atujkEiPpxYAdlgQ_0[4].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[4].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, hStdout);
TM__CN3raB9atujkEiPpxYAdlgQ_0[4].typ = (&NTI__rR5Bzr1D5krxoo1NcNyeMA_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[4].name = "hStdout";
TM__CN3raB9atujkEiPpxYAdlgQ_2_7[4] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[5];
TM__CN3raB9atujkEiPpxYAdlgQ_0[5].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[5].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, hStderr);
TM__CN3raB9atujkEiPpxYAdlgQ_0[5].typ = (&NTI__rR5Bzr1D5krxoo1NcNyeMA_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[5].name = "hStderr";
TM__CN3raB9atujkEiPpxYAdlgQ_2_7[5] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[6];
TM__CN3raB9atujkEiPpxYAdlgQ_0[6].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[6].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, oldStdoutAttr);
TM__CN3raB9atujkEiPpxYAdlgQ_0[6].typ = (&NTI__kDPg4wXyR8DDyA0MeEjIsw_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[6].name = "oldStdoutAttr";
TM__CN3raB9atujkEiPpxYAdlgQ_2_7[6] = &TM__CN3raB9atujkEiPpxYAdlgQ_0[7];
TM__CN3raB9atujkEiPpxYAdlgQ_0[7].kind = 1;
TM__CN3raB9atujkEiPpxYAdlgQ_0[7].offset = offsetof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og, oldStderrAttr);
TM__CN3raB9atujkEiPpxYAdlgQ_0[7].typ = (&NTI__kDPg4wXyR8DDyA0MeEjIsw_);
TM__CN3raB9atujkEiPpxYAdlgQ_0[7].name = "oldStderrAttr";
TM__CN3raB9atujkEiPpxYAdlgQ_0[0].len = 7; TM__CN3raB9atujkEiPpxYAdlgQ_0[0].kind = 2; TM__CN3raB9atujkEiPpxYAdlgQ_0[0].sons = &TM__CN3raB9atujkEiPpxYAdlgQ_2_7[0];
NTI__EcU8GhMNGo9bGDXbfqZ82og_.node = &TM__CN3raB9atujkEiPpxYAdlgQ_0[0];
NTI__flNJLrANZti6Wiy5LTlGGA_.size = sizeof(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*);
NTI__flNJLrANZti6Wiy5LTlGGA_.align = NIM_ALIGNOF(tyObject_PTerminalcolonObjectType___EcU8GhMNGo9bGDXbfqZ82og*);
NTI__flNJLrANZti6Wiy5LTlGGA_.kind = 22;
NTI__flNJLrANZti6Wiy5LTlGGA_.base = (&NTI__EcU8GhMNGo9bGDXbfqZ82og_);
NTI__flNJLrANZti6Wiy5LTlGGA_.flags = 2;
NTI__flNJLrANZti6Wiy5LTlGGA_.marker = Marker_tyRef__flNJLrANZti6Wiy5LTlGGA;

/* section: NIM_merge_DYNLIB_INIT */
if (!((TM__CN3raB9atujkEiPpxYAdlgQ_4 = nimLoadLibrary(((NimStringDesc*) &TM__CN3raB9atujkEiPpxYAdlgQ_6)))
)) nimLoadLibraryError(((NimStringDesc*) &TM__CN3raB9atujkEiPpxYAdlgQ_7));
	Dl_15991308_ = (tyProc__oew1DfaGl5XhHmnBK0HYXQ) nimGetProcAddr(TM__CN3raB9atujkEiPpxYAdlgQ_4, "DuplicateHandle");
	Dl_15991318_ = (tyProc__uryidYWkntM7ddjZSyxvyQ) nimGetProcAddr(TM__CN3raB9atujkEiPpxYAdlgQ_4, "GetCurrentProcess");
	Dl_15991320_ = (tyProc__vjGHiWUJwFzOgSxDffBb6Q) nimGetProcAddr(TM__CN3raB9atujkEiPpxYAdlgQ_4, "GetConsoleScreenBufferInfo");
	Dl_16010034_ = (tyProc__oPCjp4xTgEl9a8fqSzOv8lw) nimGetProcAddr(TM__CN3raB9atujkEiPpxYAdlgQ_4, "SetConsoleTextAttribute");
}

