/* 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 <string.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_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw;
typedef struct tyObject_ZonedTime__WigfH9apQAxJ69bBPh3wB8RQ tyObject_ZonedTime__WigfH9apQAxJ69bBPh3wB8RQ;
typedef struct tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyTuple__JfHvHzMrhKkWAUvQKe0i1A tyTuple__JfHvHzMrhKkWAUvQKe0i1A;
typedef struct tyObject_Env_timesdotnim___diB2NTuAIWY0FO9c5IUJRGg tyObject_Env_timesdotnim___diB2NTuAIWY0FO9c5IUJRGg;
typedef struct tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg;
typedef struct tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw;
typedef struct Exception Exception;
typedef struct tySequence__aNpJjaoUowCQc7fBn3wtDQ tySequence__aNpJjaoUowCQc7fBn3wtDQ;
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 tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg tyObject_PDispatchercolonObjectType___mNiwh37MfaAP9cG4kqT6kpg;
typedef struct tyObject_SslContextcolonObjectType___nNdejAl9bbVbX7sP6RJ4h0w tyObject_SslContextcolonObjectType___nNdejAl9bbVbX7sP6RJ4h0w;

/* section: NIM_merge_TYPES */
struct tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q {
NI64 seconds;
NI nanosecond;
};
struct tyObject_ZonedTime__WigfH9apQAxJ69bBPh3wB8RQ {
tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q time;
NI utcOffset;
NIM_BOOL isDst;
};
typedef struct {
N_NIMCALL_PTR(tyObject_ZonedTime__WigfH9apQAxJ69bBPh3wB8RQ, ClP_0) (tyObject_Time__3y2ZpqsTJLqdZvpC9a0rU2Q x, void* ClE_0);
void* ClE_0;
} tyProc__7xnKxEC24cr3qZyj3gX32w;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
  TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw {
tyProc__7xnKxEC24cr3qZyj3gX32w zonedTimeFromTimeImpl;
tyProc__7xnKxEC24cr3qZyj3gX32w zonedTimeFromAdjTimeImpl;
NimStringDesc* name;
};
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;
};
struct tyTuple__JfHvHzMrhKkWAUvQKe0i1A {
void* Field0;
tyObject_Env_timesdotnim___diB2NTuAIWY0FO9c5IUJRGg* Field1;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef NF tyArray__iV2wVpdhi9coq9cstlcqapXg[2001];
struct tyObject_GcThread__hgJQSlfXDOK3SwSHjeZBXg {
tyArray__iV2wVpdhi9coq9cstlcqapXg tls;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw {
NI64 seconds;
NI nanosecond;
};
typedef NU8 tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ;
typedef NI64 tyArray__pDfjTbtkTNjmi9bTcaNV32Q[8];
typedef N_NIMCALL_PTR(NIM_BOOL, tyProc__9axCnCRMUx32AHzFgBrzSMg) (Exception* e);
typedef struct {
N_NIMCALL_PTR(void, ClP_0) (void* ClE_0);
void* ClE_0;
} tyProc__HzVCwACFYM9cx9aV62PdjtuA;
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__aNpJjaoUowCQc7fBn3wtDQ {
  TGenericSeq Sup;
  tyProc__HzVCwACFYM9cx9aV62PdjtuA 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__9a5v4OQPlGqsA25ioN8hFYA)(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__6NbDwwj5FY059b1gz2AsAZQ_4)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimRegisterThreadLocalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
static N_NIMCALL(void, TM__6NbDwwj5FY059b1gz2AsAZQ_5)(void);
static N_INLINE(NI64, convert__2z1a0DRE31bT73xgVvBfQAtimes)(tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitFrom, tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitTo, NI64 quantity);
static N_INLINE(NI, convert__vsrmXCcg8GubJb67VXeq4wtimes)(tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitFrom, tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitTo, NI quantity);
static N_INLINE(NI, convert__bBJ7N1GpubC85YlnXz3nHgtimes)(tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitFrom, tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitTo, NI quantity);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw, ntAddDuration)(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw a, tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw b);
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(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw, normalize__JK8O6vJVu4WsESmu0kL4aQ)(NI64 seconds, NI64 nanoseconds);

/* section: NIM_merge_DATA */
N_LIB_PRIVATE TNimType NTI__F8OvqlxXyGXRSiK9c1fCDVw_;
N_LIB_PRIVATE TNimType NTI__7xnKxEC24cr3qZyj3gX32w_;
extern TNimType NTI__vr5DoT1jILTGdRlYv1OYpw_;
extern TNimType NTI__HsJiUUcO9cHBdUCi0HwkSTA_;
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
N_LIB_PRIVATE TNimType NTI__9a5v4OQPlGqsA25ioN8hFYA_;
N_LIB_PRIVATE NIM_CONST tyArray__pDfjTbtkTNjmi9bTcaNV32Q unitWeights__cpugRVHYEC9bUpLa71eZMsQ = {IL64(1),
IL64(1000),
IL64(1000000),
IL64(1000000000),
IL64(60000000000),
IL64(3600000000000),
IL64(86400000000000),
IL64(604800000000000)}
;

/* section: NIM_merge_VARS */
extern NI32 globalsSlot__ciXDZu9c27pHpCRMoz4RIgw;

/* section: NIM_merge_PROCS */
static N_NIMCALL(void, Marker_tyRef__9a5v4OQPlGqsA25ioN8hFYA)(void* p, NI op) {
	tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw* a;
	a = (tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw*)p;
	nimGCvisit((void*)(*a).zonedTimeFromTimeImpl.ClE_0, op);
	nimGCvisit((void*)(*a).zonedTimeFromAdjTimeImpl.ClE_0, op);
	nimGCvisit((void*)(*a).name, 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__6NbDwwj5FY059b1gz2AsAZQ_4)(void) {
	NimThreadVars* NimTV_;
	NimTV_ = (NimThreadVars*) GetThreadLocalVars();
	nimGCvisit((void*)NimTV_->utcInstance__oeKVHn4dFpBJO35HhEkelw, 0);
}
static N_NIMCALL(void, TM__6NbDwwj5FY059b1gz2AsAZQ_5)(void) {
	NimThreadVars* NimTV_;
	NimTV_ = (NimThreadVars*) GetThreadLocalVars();
	nimGCvisit((void*)NimTV_->localInstance__cLtN9cK9bCe6IPhJ3UFNLNKA, 0);
}
static N_INLINE(NI64, convert__2z1a0DRE31bT73xgVvBfQAtimes)(tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitFrom, tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitTo, NI64 quantity) {
	NI64 result;
	result = (NI64)0;
	{
		if (!(unitFrom < unitTo)) goto LA3_;
		result = (NI64)(quantity / (NI64)(unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitTo)- 0] / unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitFrom)- 0]));
	}
	goto LA1_;
	LA3_: ;
	{
		result = (NI64)((NI64)(unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitFrom)- 0] / unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitTo)- 0]) * quantity);
	}
	LA1_: ;
	return result;
}
static N_INLINE(NI, convert__vsrmXCcg8GubJb67VXeq4wtimes)(tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitFrom, tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitTo, NI quantity) {
	NI result;
	result = (NI)0;
	{
		if (!(unitFrom < unitTo)) goto LA3_;
		result = ((NI) ((NI64)(((NI64) (quantity)) / (NI64)(unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitTo)- 0] / unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitFrom)- 0]))));
	}
	goto LA1_;
	LA3_: ;
	{
		result = ((NI) ((NI64)((NI64)(unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitFrom)- 0] / unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitTo)- 0]) * ((NI64) (quantity)))));
	}
	LA1_: ;
	return result;
}
static N_INLINE(NI, convert__bBJ7N1GpubC85YlnXz3nHgtimes)(tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitFrom, tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ unitTo, NI quantity) {
	NI result;
	result = (NI)0;
	{
		if (!(unitFrom < unitTo)) goto LA3_;
		result = ((NI) ((NI64)(((NI64) (quantity)) / (NI64)(unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitTo)- 0] / unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitFrom)- 0]))));
	}
	goto LA1_;
	LA3_: ;
	{
		result = ((NI) ((NI64)((NI64)(unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitFrom)- 0] / unitWeights__cpugRVHYEC9bUpLa71eZMsQ[(unitTo)- 0]) * ((NI64) (quantity)))));
	}
	LA1_: ;
	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(NI64, inMilliseconds__df0d89cDnRIju9aB6p1W1qVA)(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw dur) {
	NI64 result;
	NIM_BOOL correctionX60gensym23_;
	NIM_BOOL T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI64)0;
	T1_ = (NIM_BOOL)0;
	T1_ = (dur.seconds < IL64(0));
	if (!(T1_)) goto LA2_;
	T1_ = (((NI) 0) < ((NI) (dur.nanosecond)));
	LA2_: ;
	correctionX60gensym23_ = T1_;
	{
		NI64 T7_;
		NI T8_;
		NI T9_;
		if (!correctionX60gensym23_) goto LA5_;
		T7_ = (NI64)0;
		T7_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 2), (NI64)(dur.seconds + IL64(1)));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T8_ = (NI)0;
		T8_ = convert__vsrmXCcg8GubJb67VXeq4wtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 0), ((NI) 1));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T9_ = (NI)0;
		T9_ = convert__vsrmXCcg8GubJb67VXeq4wtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 0), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 2), (NI)(T8_ - ((NI) (dur.nanosecond))));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		result = (NI64)(T7_ - ((NI64) (T9_)));
	}
	goto LA3_;
	LA5_: ;
	{
		NI64 T11_;
		NI T12_;
		T11_ = (NI64)0;
		T11_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 2), dur.seconds);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T12_ = (NI)0;
		T12_ = convert__bBJ7N1GpubC85YlnXz3nHgtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 0), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 2), dur.nanosecond);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		result = (NI64)(T11_ + ((NI64) (T12_)));
	}
	LA3_: ;
	}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(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw, normalize__JK8O6vJVu4WsESmu0kL4aQ)(NI64 seconds, NI64 nanoseconds) {
	tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw result;
	NI64 T1_;
	NI64 nanosecond;
	NI T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw));
	T1_ = (NI64)0;
	T1_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 0), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), nanoseconds);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	result.seconds = (NI64)(seconds + T1_);
	T2_ = (NI)0;
	T2_ = convert__vsrmXCcg8GubJb67VXeq4wtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 0), ((NI) 1));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	nanosecond = (NI64)(nanoseconds % ((NI64) (T2_)));
	{
		NI T7_;
		if (!(nanosecond < IL64(0))) goto LA5_;
		T7_ = (NI)0;
		T7_ = convert__vsrmXCcg8GubJb67VXeq4wtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 0), ((NI) 1));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		nanosecond += ((NI64) (T7_));
		result.seconds -= ((NI) 1);
	}
	LA5_: ;
	result.nanosecond = ((NI) (((NI) (nanosecond))));
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw, ntAddDuration)(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw a, tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw b) {
	tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw result;
	NI64 T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw));
	T1_ = (NI64)0;
	T1_ = (NI64)(a.seconds + b.seconds);
	result = normalize__JK8O6vJVu4WsESmu0kL4aQ(T1_, ((NI64) ((NI)(((NI) (a.nanosecond)) + ((NI) (b.nanosecond))))));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, pluseq___x4VoYzJQBbk9bAft9bFS7fyA)(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw* d1, tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw d2) {
	tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&T1_), sizeof(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw));
	T1_ = ntAddDuration((*d1), d2);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	(*d1) = T1_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw, initDuration__wcR3zetvspAUsyuvWZ07Xg)(NI64 nanoseconds, NI64 microseconds, NI64 milliseconds, NI64 seconds, NI64 minutes, NI64 hours, NI64 days, NI64 weeks) {
	tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw result;
	NI64 seconds_2;
	NI64 T1_;
	NI64 T2_;
	NI64 T3_;
	NI64 T4_;
	NI64 T5_;
	NI64 T6_;
	NI64 T7_;
	NI64 T8_;
	NI nanoseconds_2;
	NI64 T9_;
	NI64 T10_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw));
	T1_ = (NI64)0;
	T1_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 7), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), weeks);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T2_ = (NI64)0;
	T2_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 6), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), days);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T3_ = (NI64)0;
	T3_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 4), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), minutes);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T4_ = (NI64)0;
	T4_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 5), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), hours);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T5_ = (NI64)0;
	T5_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), seconds);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T6_ = (NI64)0;
	T6_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 2), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), milliseconds);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T7_ = (NI64)0;
	T7_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 1), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), microseconds);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T8_ = (NI64)0;
	T8_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 0), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), nanoseconds);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	seconds_2 = (NI64)((NI64)((NI64)((NI64)((NI64)((NI64)((NI64)(T1_ + T2_) + T3_) + T4_) + T5_) + T6_) + T7_) + T8_);
	T9_ = (NI64)0;
	T9_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 2), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 0), (NI64)(milliseconds % IL64(1000)));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T10_ = (NI64)0;
	T10_ = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 1), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 0), (NI64)(microseconds % IL64(1000000)));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	nanoseconds_2 = ((NI) ((NI64)((NI64)(T9_ + T10_) + (NI64)(nanoseconds % IL64(1000000000)))));
	result = normalize__JK8O6vJVu4WsESmu0kL4aQ(seconds_2, ((NI64) (nanoseconds_2)));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, inSeconds__df0d89cDnRIju9aB6p1W1qVA_2)(tyObject_Duration__lj9ar6Co3fgk6NgGnVaNpJw dur) {
	NI64 result;
	NIM_BOOL correctionX60gensym20_;
	NIM_BOOL T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI64)0;
	T1_ = (NIM_BOOL)0;
	T1_ = (dur.seconds < IL64(0));
	if (!(T1_)) goto LA2_;
	T1_ = (((NI) 0) < ((NI) (dur.nanosecond)));
	LA2_: ;
	correctionX60gensym20_ = T1_;
	result = convert__2z1a0DRE31bT73xgVvBfQAtimes(((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), ((tyEnum_TimeUnit__52alPn04ElUUbqLeok9b3PQ) 3), (NI64)(dur.seconds + ((NI64) (correctionX60gensym20_))));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesInit000)(void) {
{

	nimRegisterThreadLocalMarker(TM__6NbDwwj5FY059b1gz2AsAZQ_4);


	nimRegisterThreadLocalMarker(TM__6NbDwwj5FY059b1gz2AsAZQ_5);

}
}

N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesDatInit000)(void) {

/* section: NIM_merge_TYPE_INIT1 */
static TNimNode* TM__6NbDwwj5FY059b1gz2AsAZQ_2_3[3];
static TNimNode* TM__6NbDwwj5FY059b1gz2AsAZQ_3_2[2];
static TNimNode TM__6NbDwwj5FY059b1gz2AsAZQ_0[7];

/* section: NIM_merge_TYPE_INIT3 */
NTI__F8OvqlxXyGXRSiK9c1fCDVw_.size = sizeof(tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw);
NTI__F8OvqlxXyGXRSiK9c1fCDVw_.align = NIM_ALIGNOF(tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw);
NTI__F8OvqlxXyGXRSiK9c1fCDVw_.kind = 18;
NTI__F8OvqlxXyGXRSiK9c1fCDVw_.base = 0;
TM__6NbDwwj5FY059b1gz2AsAZQ_2_3[0] = &TM__6NbDwwj5FY059b1gz2AsAZQ_0[1];
NTI__7xnKxEC24cr3qZyj3gX32w_.size = sizeof(tyTuple__JfHvHzMrhKkWAUvQKe0i1A);
NTI__7xnKxEC24cr3qZyj3gX32w_.align = NIM_ALIGNOF(tyTuple__JfHvHzMrhKkWAUvQKe0i1A);
NTI__7xnKxEC24cr3qZyj3gX32w_.kind = 18;
NTI__7xnKxEC24cr3qZyj3gX32w_.base = 0;
TM__6NbDwwj5FY059b1gz2AsAZQ_3_2[0] = &TM__6NbDwwj5FY059b1gz2AsAZQ_0[3];
TM__6NbDwwj5FY059b1gz2AsAZQ_0[3].kind = 1;
TM__6NbDwwj5FY059b1gz2AsAZQ_0[3].offset = offsetof(tyTuple__JfHvHzMrhKkWAUvQKe0i1A, Field0);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[3].typ = (&NTI__vr5DoT1jILTGdRlYv1OYpw_);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[3].name = "Field0";
TM__6NbDwwj5FY059b1gz2AsAZQ_3_2[1] = &TM__6NbDwwj5FY059b1gz2AsAZQ_0[4];
TM__6NbDwwj5FY059b1gz2AsAZQ_0[4].kind = 1;
TM__6NbDwwj5FY059b1gz2AsAZQ_0[4].offset = offsetof(tyTuple__JfHvHzMrhKkWAUvQKe0i1A, Field1);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[4].typ = (&NTI__HsJiUUcO9cHBdUCi0HwkSTA_);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[4].name = "Field1";
TM__6NbDwwj5FY059b1gz2AsAZQ_0[2].len = 2; TM__6NbDwwj5FY059b1gz2AsAZQ_0[2].kind = 2; TM__6NbDwwj5FY059b1gz2AsAZQ_0[2].sons = &TM__6NbDwwj5FY059b1gz2AsAZQ_3_2[0];
NTI__7xnKxEC24cr3qZyj3gX32w_.node = &TM__6NbDwwj5FY059b1gz2AsAZQ_0[2];
TM__6NbDwwj5FY059b1gz2AsAZQ_0[1].kind = 1;
TM__6NbDwwj5FY059b1gz2AsAZQ_0[1].offset = offsetof(tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw, zonedTimeFromTimeImpl);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[1].typ = (&NTI__7xnKxEC24cr3qZyj3gX32w_);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[1].name = "zonedTimeFromTimeImpl";
TM__6NbDwwj5FY059b1gz2AsAZQ_2_3[1] = &TM__6NbDwwj5FY059b1gz2AsAZQ_0[5];
TM__6NbDwwj5FY059b1gz2AsAZQ_0[5].kind = 1;
TM__6NbDwwj5FY059b1gz2AsAZQ_0[5].offset = offsetof(tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw, zonedTimeFromAdjTimeImpl);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[5].typ = (&NTI__7xnKxEC24cr3qZyj3gX32w_);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[5].name = "zonedTimeFromAdjTimeImpl";
TM__6NbDwwj5FY059b1gz2AsAZQ_2_3[2] = &TM__6NbDwwj5FY059b1gz2AsAZQ_0[6];
TM__6NbDwwj5FY059b1gz2AsAZQ_0[6].kind = 1;
TM__6NbDwwj5FY059b1gz2AsAZQ_0[6].offset = offsetof(tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw, name);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[6].typ = (&NTI__77mFvmsOLKik79ci2hXkHEg_);
TM__6NbDwwj5FY059b1gz2AsAZQ_0[6].name = "name";
TM__6NbDwwj5FY059b1gz2AsAZQ_0[0].len = 3; TM__6NbDwwj5FY059b1gz2AsAZQ_0[0].kind = 2; TM__6NbDwwj5FY059b1gz2AsAZQ_0[0].sons = &TM__6NbDwwj5FY059b1gz2AsAZQ_2_3[0];
NTI__F8OvqlxXyGXRSiK9c1fCDVw_.node = &TM__6NbDwwj5FY059b1gz2AsAZQ_0[0];
NTI__9a5v4OQPlGqsA25ioN8hFYA_.size = sizeof(tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw*);
NTI__9a5v4OQPlGqsA25ioN8hFYA_.align = NIM_ALIGNOF(tyObject_TimezonecolonObjectType___F8OvqlxXyGXRSiK9c1fCDVw*);
NTI__9a5v4OQPlGqsA25ioN8hFYA_.kind = 22;
NTI__9a5v4OQPlGqsA25ioN8hFYA_.base = (&NTI__F8OvqlxXyGXRSiK9c1fCDVw_);
NTI__9a5v4OQPlGqsA25ioN8hFYA_.marker = Marker_tyRef__9a5v4OQPlGqsA25ioN8hFYA;
}

