/* 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 "winsock2.h"
#include <windows.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_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_PDispatcherBasecolonObjectType___YNzlM8oq8NLlO720L2VFMw tyObject_PDispatcherBasecolonObjectType___YNzlM8oq8NLlO720L2VFMw;
typedef struct RootObj RootObj;
typedef struct tyObject_HeapQueue__mgfFdry9aKsRMW9au5u9bSpOQ tyObject_HeapQueue__mgfFdry9aKsRMW9au5u9bSpOQ;
typedef struct tySequence__oKfdUHDH0q5oP14wOM6kug tySequence__oKfdUHDH0q5oP14wOM6kug;
typedef struct tyObject_Deque__NuwIXbomwb0PtcywOgXRnA tyObject_Deque__NuwIXbomwb0PtcywOgXRnA;
typedef struct tySequence__aNpJjaoUowCQc7fBn3wtDQ tySequence__aNpJjaoUowCQc7fBn3wtDQ;
typedef struct tyTuple__5aoVPIWYzahUyBc9bMm0M5w tyTuple__5aoVPIWYzahUyBc9bMm0M5w;
typedef struct tyObject_MonoTime__FEvFMlkqJiSSGVO6HgTv8w tyObject_MonoTime__FEvFMlkqJiSSGVO6HgTv8w;
typedef struct tyObject_FuturecolonObjectType___te3W2Tqi7xuJ7rlPtg9al5w tyObject_FuturecolonObjectType___te3W2Tqi7xuJ7rlPtg9al5w;
typedef struct tyObject_HashSet__bGAilYs5sUICRbD13gZaFg tyObject_HashSet__bGAilYs5sUICRbD13gZaFg;
typedef struct tySequence__8Np6tlClE5az1CyqZdN19bQ tySequence__8Np6tlClE5az1CyqZdN19bQ;
typedef struct tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg;
typedef struct tyObject_OVERLAPPED__9ayhTq9cybD7eA9aZA09akSNXg tyObject_OVERLAPPED__9ayhTq9cybD7eA9aZA09akSNXg;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct tyObject_GUID__J2WQBMgezjwf6Trblkflgg tyObject_GUID__J2WQBMgezjwf6Trblkflgg;
typedef struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ;
typedef struct Exception Exception;
typedef struct TSafePoint TSafePoint;
typedef struct GcFrameHeader GcFrameHeader;
typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
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_SharedList__JI9cx34TL8n3aOKF6tSMBUw tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw;
typedef struct tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg;
typedef struct tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tyObject_SslContextcolonObjectType___nNdejAl9bbVbX7sP6RJ4h0w tyObject_SslContextcolonObjectType___nNdejAl9bbVbX7sP6RJ4h0w;

/* section: NIM_merge_TYPES */
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;
};
struct RootObj {
TNimType* m_type;
};
struct tyObject_HeapQueue__mgfFdry9aKsRMW9au5u9bSpOQ {
tySequence__oKfdUHDH0q5oP14wOM6kug* data;
};
struct tyObject_Deque__NuwIXbomwb0PtcywOgXRnA {
tySequence__aNpJjaoUowCQc7fBn3wtDQ* data;
NI head;
NI tail;
NI count;
NI mask;
};
struct tyObject_PDispatcherBasecolonObjectType___YNzlM8oq8NLlO720L2VFMw {
  RootObj Sup;
tyObject_HeapQueue__mgfFdry9aKsRMW9au5u9bSpOQ timers;
tyObject_Deque__NuwIXbomwb0PtcywOgXRnA callbacks;
};
struct tyObject_MonoTime__FEvFMlkqJiSSGVO6HgTv8w {
NI64 ticks;
};
struct tyTuple__5aoVPIWYzahUyBc9bMm0M5w {
tyObject_MonoTime__FEvFMlkqJiSSGVO6HgTv8w Field0;
tyObject_FuturecolonObjectType___te3W2Tqi7xuJ7rlPtg9al5w* Field1;
};
struct tyObject_HashSet__bGAilYs5sUICRbD13gZaFg {
tySequence__8Np6tlClE5az1CyqZdN19bQ* data;
NI counter;
};
struct tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg {
  tyObject_PDispatcherBasecolonObjectType___YNzlM8oq8NLlO720L2VFMw Sup;
NI ioPort;
tyObject_HashSet__bGAilYs5sUICRbD13gZaFg handles;
};
typedef NF tyArray__iV2wVpdhi9coq9cstlcqapXg[2001];
struct tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg {
tyArray__iV2wVpdhi9coq9cstlcqapXg tls;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
typedef N_STDCALL_PTR(NIM_BOOL, tyProc__jMtAEGtpoW3l9c2OBP7TLUg) (NI sListenSocket, NI sAcceptSocket, void* lpOutputBuffer, NI32 dwReceiveDataLength, NI32 dwLocalAddressLength, NI32 dwRemoteAddressLength, NI32* lpdwBytesReceived, tyObject_OVERLAPPED__9ayhTq9cybD7eA9aZA09akSNXg* lpOverlapped);
typedef N_STDCALL_PTR(NIM_BOOL, tyProc__Fu9blnESfbEfNTZg7CqNT9cA) (NI s, SOCKADDR* name, int namelen, void* lpSendBuffer, NI32 dwSendDataLength, NI32* lpdwBytesSent, tyObject_OVERLAPPED__9ayhTq9cybD7eA9aZA09akSNXg* lpOverlapped);
typedef N_STDCALL_PTR(void, tyProc__QyC5w14biZTJwNTa1s4BKg) (void* lpOutputBuffer, NI32 dwReceiveDataLength, NI32 dwLocalAddressLength, NI32 dwRemoteAddressLength, SOCKADDR** LocalSockaddr, int* LocalSockaddrLength, SOCKADDR** RemoteSockaddr, int* RemoteSockaddrLength);
typedef NU8 tyEnum_Domain__Q79bEtFARvq0ekDNtvj3Vqg;
typedef NU8 tyEnum_SockType__NQT1bItGG2X9byGdrWX7ujw;
typedef NU8 tyEnum_Protocol__dqJ1OqRGclxIMMdSLRzzXg;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef N_STDCALL_PTR(void, tyProc__X0Q3cs1Ai9bfe54O0LJQ1fQ) (NI32 para1, NI32 para2, tyObject_OVERLAPPED__9ayhTq9cybD7eA9aZA09akSNXg* para3);
typedef N_STDCALL_PTR(int, tyProc__m8OtNuKklv1X2vQjXQkzSA) (NI s, NI32 dwIoControlCode, void* lpvInBuffer, NI32 cbInBuffer, void* lpvOutBuffer, NI32 cbOutBuffer, NI32* lpcbBytesReturned, tyObject_OVERLAPPED__9ayhTq9cybD7eA9aZA09akSNXg* lpOverlapped, tyProc__X0Q3cs1Ai9bfe54O0LJQ1fQ lpCompletionRoutine);
typedef NI8 tyArray__9cWG514ToTTjfTPLhXXV0IQ[8];
struct tyObject_GUID__J2WQBMgezjwf6Trblkflgg {
NI32 D1;
NI16 D2;
NI16 D3;
tyArray__9cWG514ToTTjfTPLhXXV0IQ D4;
};
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
struct tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ {
NI Field0;
NI Field1;
};
typedef NIM_CHAR tyArray__NSMq3FMCIrS8gSbyinBZ8w[14];
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__9axCnCRMUx32AHzFgBrzSMg) (Exception* e);
struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
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__SPr7N6UKfuF549bNPiUvSRw 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 collections;
NI maxThreshold;
NI maxStackSize;
NI freedObjects;
};
struct tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw {
tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg* head;
tyObject_SharedListNodecolonObjectType___KGw0YAw6W9aSz3Sr9aXGu7zg* tail;
CRITICAL_SECTION lock;
};
struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_SharedList__JI9cx34TL8n3aOKF6tSMBUw toDispose;
NI gcThreadId;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
};
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (tyProc__HzVCwACFYM9cx9aV62PdjtuA cbproc, void* ClE_0);
void* ClE_0;
} tyProc__VHS3NdmbwcdcZKmKV1JWhw;

/* section: NIM_merge_SEQ_TYPES */
struct tySequence__oKfdUHDH0q5oP14wOM6kug {
  TGenericSeq Sup;
  tyTuple__5aoVPIWYzahUyBc9bMm0M5w data[SEQ_DECL_SIZE];
};
struct tySequence__aNpJjaoUowCQc7fBn3wtDQ {
  TGenericSeq Sup;
  tyProc__HzVCwACFYM9cx9aV62PdjtuA data[SEQ_DECL_SIZE];
};
struct tySequence__8Np6tlClE5az1CyqZdN19bQ {
  TGenericSeq Sup;
  tyTuple__1v9bKyksXWMsm0vNwmZ4EuQ data[SEQ_DECL_SIZE];
};
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  TGenericSeq Sup;
  NimStringDesc* data[SEQ_DECL_SIZE];
};
typedef struct {tyProc__9axCnCRMUx32AHzFgBrzSMg localRaiseHook__EIvMhANBvB9cp2Ezvt29cADg;
NIM_BOOL nimInErrorMode__759bT87luu8XGcbkw13FUjA;
tySequence__aNpJjaoUowCQc7fBn3wtDQ* threadDestructionHandlers__8OmU3x0fNdA0DLtOmU3kWw;
NI threadId__wzrdPYhtL9czkCWS4o9an9cRw;
TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
TSafePoint* excHandler__rqLlY5bs9atDw2OXYqJEn5g;
Exception* currException__9bVPeDJlYTi9bQApZpfH8wjg;
GcFrameHeader* gcFramePtr__ot48iojqko9aFxGhyjjjVaA;
tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__IcYaEuuWivYAS86vFMTS3Q;
tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw* utcInstance__oeKVHn4dFpBJO35HhEkelw;
tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw* localInstance__cLtN9cK9bCe6IPhJ3UFNLNKA;
NIM_BOOL envComputed__LLyFo9bsdu1ZXMDvAe8DhrQ;
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* environment__mlhK49b6YMgc9cgrcYkKq9a3g;
tySequence__sM4lkSb7zS6F7OVMvW9cffQ* ownArgv__WVJ54JSHy7VxacV39bwBPFA;
NIM_BOOL ownParsedArgv__9btHydaUC5pNXxitEZsyzIg;
tyProc__VHS3NdmbwcdcZKmKV1JWhw callSoonProc__9b9b4iUSd60RO2UqC52ifJ6A;
tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg* gDisp__yIbBArLUsg2pBJkilx4yvg;
tyObject_SslContextcolonObjectType___nNdejAl9bbVbX7sP6RJ4h0w* defaultSslContext__3GZQajZtKdLpqTTN2RjTzw;
NIM_BOOL isSlave__t9a8wsVVRYqGEKhg1vb49b3g;
NIM_BOOL pyThreadFrameInited__0LBR4zzVR5uWvgtv8SrMjg;
NIM_BOOL gcInited__uuy3PWTwb5gov9ao9bXJYBPg;
} NimThreadVars;

/* section: NIM_merge_PROC_HEADERS */
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, Marker_tyRef__OGnyBMU9csFmaJm9bh2uOQiQ)(void* p, NI op);
static N_INLINE(void*, GetThreadLocalVars)(void);
N_LIB_PRIVATE N_NIMCALL(void*, threadVarGetValue__O8VJSmwa3WY6y9bP6Ht9b7hw)(NI32 dwTlsIndex);
static N_NIMCALL(void, TM__gfe9a52b5gJr8GSrnr883iA_5)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimRegisterThreadLocalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
N_LIB_PRIVATE N_NIMCALL(void, initAll__4E2MjiuuW9bb2xAhvUqWsoQ)(void);
N_LIB_PRIVATE N_NIMCALL(NI, createNativeSocket__n7HkrQGl6EXucCT9cZGSEqA)(tyEnum_Domain__Q79bEtFARvq0ekDNtvj3Vqg domain, tyEnum_SockType__NQT1bItGG2X9byGdrWX7ujw sockType, tyEnum_Protocol__dqJ1OqRGclxIMMdSLRzzXg protocol, NIM_BOOL inheritable);
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__CWyPYlyH9a6rAuZckFyVxPA)(NI32 errorCode, NimStringDesc* additionalInfo);
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__9bUWNxbcGnToMWA9b79aTXLIw)(void);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, initPointer__rrU5asl0oI3yYPDxkwgTZg)(NI s, void** fun, tyObject_GUID__J2WQBMgezjwf6Trblkflgg* guid);
N_LIB_PRIVATE N_NIMCALL(void, close__6NjvlIELQKVp8O4T8sBSUg)(NI socket_0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);

/* section: NIM_merge_DATA */
extern TNimType NTI__ytyiCJqK439aF9cIibuRVpAg_;
N_LIB_PRIVATE TNimType NTI__YNzlM8oq8NLlO720L2VFMw_;
N_LIB_PRIVATE TNimType NTI__5aoVPIWYzahUyBc9bMm0M5w_;
extern TNimType NTI__FEvFMlkqJiSSGVO6HgTv8w_;
extern TNimType NTI__TjokxNjmnZmr9bygVDVC9bvg_;
extern TNimType NTI__mgfFdry9aKsRMW9au5u9bSpOQ_;
extern TNimType NTI__NuwIXbomwb0PtcywOgXRnA_;
N_LIB_PRIVATE TNimType NTI__mNiwh37MfaAP9cG4kqT6kpg_;
extern TNimType NTI__rR5Bzr1D5krxoo1NcNyeMA_;
extern TNimType NTI__bGAilYs5sUICRbD13gZaFg_;
N_LIB_PRIVATE TNimType NTI__OGnyBMU9csFmaJm9bh2uOQiQ_;

/* section: NIM_merge_VARS */
extern NI32 globalsSlot__ciXDZu9c27pHpCRMoz4RIgw;
N_LIB_PRIVATE tyProc__jMtAEGtpoW3l9c2OBP7TLUg acceptEx__qL9aOi8PWOvbR8SHPxunTBw;
N_LIB_PRIVATE tyProc__Fu9blnESfbEfNTZg7CqNT9cA connectEx__GpSroD0hGBCPYZj9cs0wVPw;
N_LIB_PRIVATE tyProc__QyC5w14biZTJwNTa1s4BKg getAcceptExSockAddrs__f71GgXAuEzrmpDWPdU4pYg;
extern tyProc__m8OtNuKklv1X2vQjXQkzSA Dl_12985067_;
extern tyObject_GUID__J2WQBMgezjwf6Trblkflgg WSAID_CONNECTEX__YmR9c9crObjjK9ckt1ygsPQKg;
extern tyObject_GUID__J2WQBMgezjwf6Trblkflgg WSAID_ACCEPTEX__pwoOiDuyZgHBOLaI2GSBpg;
extern tyObject_GUID__J2WQBMgezjwf6Trblkflgg WSAID_GETACCEPTEXSOCKADDRS__rSjtFMq7pCHQR2EQvcKbDg;

/* section: NIM_merge_PROCS */
static N_NIMCALL(void, Marker_tyRef__OGnyBMU9csFmaJm9bh2uOQiQ)(void* p, NI op) {
	tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg* a;
	a = (tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg*)p;
	nimGCvisit((void*)(*a).Sup.timers.data, op);
	nimGCvisit((void*)(*a).Sup.callbacks.data, op);
	nimGCvisit((void*)(*a).handles.data, op);
}
static N_INLINE(void*, GetThreadLocalVars)(void) {
	void* result;
	void* T1_;
	result = (void*)0;
	T1_ = (void*)0;
	T1_ = threadVarGetValue__O8VJSmwa3WY6y9bP6Ht9b7hw(globalsSlot__ciXDZu9c27pHpCRMoz4RIgw);
	result = ((void*) ((*((tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg*) (T1_))).tls));
	return result;
}
static N_NIMCALL(void, TM__gfe9a52b5gJr8GSrnr883iA_5)(void) {
	NimThreadVars* NimTV_;
	NimTV_ = (NimThreadVars*) GetThreadLocalVars();
	nimGCvisit((void*)NimTV_->gDisp__yIbBArLUsg2pBJkilx4yvg, 0);
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, initPointer__rrU5asl0oI3yYPDxkwgTZg)(NI s, void** fun, tyObject_GUID__J2WQBMgezjwf6Trblkflgg* guid) {
	NIM_BOOL result;
	NI32 bytesRet;
	int T1_;
	result = (NIM_BOOL)0;
	bytesRet = (NI32)0;
	(*fun) = NIM_NIL;
	T1_ = (int)0;
	T1_ = Dl_12985067_(s, ((NI32) -939524090), ((void*) (guid)), ((NI32) 16), ((void*) (fun)), ((NI32) 8), (&bytesRet), NIM_NIL, NIM_NIL);
	result = (T1_ == ((NI32) 0));
	return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	NimThreadVars* NimTV_;
	NimTV_ = (NimThreadVars*) GetThreadLocalVars();
	result = (NIM_BOOL*)0;
	result = (&NimTV_->nimInErrorMode__759bT87luu8XGcbkw13FUjA);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, initAll__4E2MjiuuW9bb2xAhvUqWsoQ)(void) {
	NI dummySock;
	void* fun;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	dummySock = createNativeSocket__n7HkrQGl6EXucCT9cZGSEqA(((tyEnum_Domain__Q79bEtFARvq0ekDNtvj3Vqg) 2), ((tyEnum_SockType__NQT1bItGG2X9byGdrWX7ujw) 1), ((tyEnum_Protocol__dqJ1OqRGclxIMMdSLRzzXg) 6), NIM_FALSE);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		NI32 T5_;
		if (!(dummySock == INVALID_SOCKET)) goto LA3_;
		T5_ = (NI32)0;
		T5_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T5_, ((NimStringDesc*) NIM_NIL));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	LA3_: ;
	fun = NIM_NIL;
	{
		NIM_BOOL T8_;
		NI32 T11_;
		T8_ = (NIM_BOOL)0;
		T8_ = initPointer__rrU5asl0oI3yYPDxkwgTZg(dummySock, (&fun), (&WSAID_CONNECTEX__YmR9c9crObjjK9ckt1ygsPQKg));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!!(T8_)) goto LA9_;
		T11_ = (NI32)0;
		T11_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T11_, ((NimStringDesc*) NIM_NIL));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	LA9_: ;
	connectEx__GpSroD0hGBCPYZj9cs0wVPw = ((tyProc__Fu9blnESfbEfNTZg7CqNT9cA) (fun));
	{
		NIM_BOOL T14_;
		NI32 T17_;
		T14_ = (NIM_BOOL)0;
		T14_ = initPointer__rrU5asl0oI3yYPDxkwgTZg(dummySock, (&fun), (&WSAID_ACCEPTEX__pwoOiDuyZgHBOLaI2GSBpg));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!!(T14_)) goto LA15_;
		T17_ = (NI32)0;
		T17_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T17_, ((NimStringDesc*) NIM_NIL));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	LA15_: ;
	acceptEx__qL9aOi8PWOvbR8SHPxunTBw = ((tyProc__jMtAEGtpoW3l9c2OBP7TLUg) (fun));
	{
		NIM_BOOL T20_;
		NI32 T23_;
		T20_ = (NIM_BOOL)0;
		T20_ = initPointer__rrU5asl0oI3yYPDxkwgTZg(dummySock, (&fun), (&WSAID_GETACCEPTEXSOCKADDRS__rSjtFMq7pCHQR2EQvcKbDg));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!!(T20_)) goto LA21_;
		T23_ = (NI32)0;
		T23_ = osLastError__9bUWNxbcGnToMWA9b79aTXLIw();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__CWyPYlyH9a6rAuZckFyVxPA(T23_, ((NimStringDesc*) NIM_NIL));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	LA21_: ;
	getAcceptExSockAddrs__f71GgXAuEzrmpDWPdU4pYg = ((tyProc__QyC5w14biZTJwNTa1s4BKg) (fun));
	close__6NjvlIELQKVp8O4T8sBSUg(dummySock);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_asyncdispatchInit000)(void) {
{
NIM_BOOL* nimErr_;

	nimRegisterThreadLocalMarker(TM__gfe9a52b5gJr8GSrnr883iA_5);

nimErr_ = nimErrorFlag();
	initAll__4E2MjiuuW9bb2xAhvUqWsoQ();
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	BeforeRet_: ;
}
}

N_LIB_PRIVATE N_NIMCALL(void, stdlib_asyncdispatchDatInit000)(void) {

/* section: NIM_merge_TYPE_INIT1 */
static TNimNode* TM__gfe9a52b5gJr8GSrnr883iA_2_2[2];
static TNimNode* TM__gfe9a52b5gJr8GSrnr883iA_3_2[2];
static TNimNode* TM__gfe9a52b5gJr8GSrnr883iA_4_2[2];
static TNimNode TM__gfe9a52b5gJr8GSrnr883iA_0[9];

/* section: NIM_merge_TYPE_INIT3 */
NTI__YNzlM8oq8NLlO720L2VFMw_.size = sizeof(tyObject_PDispatcherBasecolonObjectType___YNzlM8oq8NLlO720L2VFMw);
NTI__YNzlM8oq8NLlO720L2VFMw_.align = NIM_ALIGNOF(tyObject_PDispatcherBasecolonObjectType___YNzlM8oq8NLlO720L2VFMw);
NTI__YNzlM8oq8NLlO720L2VFMw_.kind = 17;
NTI__YNzlM8oq8NLlO720L2VFMw_.base = (&NTI__ytyiCJqK439aF9cIibuRVpAg_);
TM__gfe9a52b5gJr8GSrnr883iA_2_2[0] = &TM__gfe9a52b5gJr8GSrnr883iA_0[1];
NTI__5aoVPIWYzahUyBc9bMm0M5w_.size = sizeof(tyTuple__5aoVPIWYzahUyBc9bMm0M5w);
NTI__5aoVPIWYzahUyBc9bMm0M5w_.align = NIM_ALIGNOF(tyTuple__5aoVPIWYzahUyBc9bMm0M5w);
NTI__5aoVPIWYzahUyBc9bMm0M5w_.kind = 18;
NTI__5aoVPIWYzahUyBc9bMm0M5w_.base = 0;
TM__gfe9a52b5gJr8GSrnr883iA_3_2[0] = &TM__gfe9a52b5gJr8GSrnr883iA_0[3];
TM__gfe9a52b5gJr8GSrnr883iA_0[3].kind = 1;
TM__gfe9a52b5gJr8GSrnr883iA_0[3].offset = offsetof(tyTuple__5aoVPIWYzahUyBc9bMm0M5w, Field0);
TM__gfe9a52b5gJr8GSrnr883iA_0[3].typ = (&NTI__FEvFMlkqJiSSGVO6HgTv8w_);
TM__gfe9a52b5gJr8GSrnr883iA_0[3].name = "Field0";
TM__gfe9a52b5gJr8GSrnr883iA_3_2[1] = &TM__gfe9a52b5gJr8GSrnr883iA_0[4];
TM__gfe9a52b5gJr8GSrnr883iA_0[4].kind = 1;
TM__gfe9a52b5gJr8GSrnr883iA_0[4].offset = offsetof(tyTuple__5aoVPIWYzahUyBc9bMm0M5w, Field1);
TM__gfe9a52b5gJr8GSrnr883iA_0[4].typ = (&NTI__TjokxNjmnZmr9bygVDVC9bvg_);
TM__gfe9a52b5gJr8GSrnr883iA_0[4].name = "Field1";
TM__gfe9a52b5gJr8GSrnr883iA_0[2].len = 2; TM__gfe9a52b5gJr8GSrnr883iA_0[2].kind = 2; TM__gfe9a52b5gJr8GSrnr883iA_0[2].sons = &TM__gfe9a52b5gJr8GSrnr883iA_3_2[0];
NTI__5aoVPIWYzahUyBc9bMm0M5w_.node = &TM__gfe9a52b5gJr8GSrnr883iA_0[2];
TM__gfe9a52b5gJr8GSrnr883iA_0[1].kind = 1;
TM__gfe9a52b5gJr8GSrnr883iA_0[1].offset = offsetof(tyObject_PDispatcherBasecolonObjectType___YNzlM8oq8NLlO720L2VFMw, timers);
TM__gfe9a52b5gJr8GSrnr883iA_0[1].typ = (&NTI__mgfFdry9aKsRMW9au5u9bSpOQ_);
TM__gfe9a52b5gJr8GSrnr883iA_0[1].name = "timers";
TM__gfe9a52b5gJr8GSrnr883iA_2_2[1] = &TM__gfe9a52b5gJr8GSrnr883iA_0[5];
TM__gfe9a52b5gJr8GSrnr883iA_0[5].kind = 1;
TM__gfe9a52b5gJr8GSrnr883iA_0[5].offset = offsetof(tyObject_PDispatcherBasecolonObjectType___YNzlM8oq8NLlO720L2VFMw, callbacks);
TM__gfe9a52b5gJr8GSrnr883iA_0[5].typ = (&NTI__NuwIXbomwb0PtcywOgXRnA_);
TM__gfe9a52b5gJr8GSrnr883iA_0[5].name = "callbacks";
TM__gfe9a52b5gJr8GSrnr883iA_0[0].len = 2; TM__gfe9a52b5gJr8GSrnr883iA_0[0].kind = 2; TM__gfe9a52b5gJr8GSrnr883iA_0[0].sons = &TM__gfe9a52b5gJr8GSrnr883iA_2_2[0];
NTI__YNzlM8oq8NLlO720L2VFMw_.node = &TM__gfe9a52b5gJr8GSrnr883iA_0[0];
NTI__mNiwh37MfaAP9cG4kqT6kpg_.size = sizeof(tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg);
NTI__mNiwh37MfaAP9cG4kqT6kpg_.align = NIM_ALIGNOF(tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg);
NTI__mNiwh37MfaAP9cG4kqT6kpg_.kind = 17;
NTI__mNiwh37MfaAP9cG4kqT6kpg_.base = (&NTI__YNzlM8oq8NLlO720L2VFMw_);
TM__gfe9a52b5gJr8GSrnr883iA_4_2[0] = &TM__gfe9a52b5gJr8GSrnr883iA_0[7];
TM__gfe9a52b5gJr8GSrnr883iA_0[7].kind = 1;
TM__gfe9a52b5gJr8GSrnr883iA_0[7].offset = offsetof(tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg, ioPort);
TM__gfe9a52b5gJr8GSrnr883iA_0[7].typ = (&NTI__rR5Bzr1D5krxoo1NcNyeMA_);
TM__gfe9a52b5gJr8GSrnr883iA_0[7].name = "ioPort";
TM__gfe9a52b5gJr8GSrnr883iA_4_2[1] = &TM__gfe9a52b5gJr8GSrnr883iA_0[8];
TM__gfe9a52b5gJr8GSrnr883iA_0[8].kind = 1;
TM__gfe9a52b5gJr8GSrnr883iA_0[8].offset = offsetof(tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg, handles);
TM__gfe9a52b5gJr8GSrnr883iA_0[8].typ = (&NTI__bGAilYs5sUICRbD13gZaFg_);
TM__gfe9a52b5gJr8GSrnr883iA_0[8].name = "handles";
TM__gfe9a52b5gJr8GSrnr883iA_0[6].len = 2; TM__gfe9a52b5gJr8GSrnr883iA_0[6].kind = 2; TM__gfe9a52b5gJr8GSrnr883iA_0[6].sons = &TM__gfe9a52b5gJr8GSrnr883iA_4_2[0];
NTI__mNiwh37MfaAP9cG4kqT6kpg_.node = &TM__gfe9a52b5gJr8GSrnr883iA_0[6];
NTI__OGnyBMU9csFmaJm9bh2uOQiQ_.size = sizeof(tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg*);
NTI__OGnyBMU9csFmaJm9bh2uOQiQ_.align = NIM_ALIGNOF(tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg*);
NTI__OGnyBMU9csFmaJm9bh2uOQiQ_.kind = 22;
NTI__OGnyBMU9csFmaJm9bh2uOQiQ_.base = (&NTI__mNiwh37MfaAP9cG4kqT6kpg_);
NTI__OGnyBMU9csFmaJm9bh2uOQiQ_.marker = Marker_tyRef__OGnyBMU9csFmaJm9bh2uOQiQ;
}

