/* Generated by Nim Compiler v2.2.10 */
/* Compiled for: MacOSX, arm64, clang */
/* Command for C compiler:
   clang -c  -w -ferror-limit=3 -fno-strict-aliasing -pthread -isysroot /Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -target arm64-apple-darwin24.2.0 -O3   -I/Users/runner/work/nightlies/nightlies/nim-2.2.10/lib -I/Users/runner/work/nightlies/nightlies/nim-2.2.10/dist/atlas/src -o /Users/runner/work/nightlies/nightlies/nim-2.2.10/dist/atlas/.nimcache/@ptimes.nim.c.o /Users/runner/work/nightlies/nightlies/nim-2.2.10/dist/atlas/.nimcache/@ptimes.nim.c */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks

#include "nimbase.h"
#include <math.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
typedef struct tyObject_TimezonecolonObjectType___dZ3mUjFeIppMsEY9bYBSCMg tyObject_TimezonecolonObjectType___dZ3mUjFeIppMsEY9bYBSCMg;
typedef struct tyObject_Duration__IhPGomXjacpk8ChnxqMuoA tyObject_Duration__IhPGomXjacpk8ChnxqMuoA;
struct tyObject_Duration__IhPGomXjacpk8ChnxqMuoA {
	NI64 seconds;
	NI nanosecond;
};
typedef NU8 tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA;
typedef NI64 tyArray__PsWXBx5JAByzUdsc6tjJLg[8];
static N_INLINE(NI64, convert__pureZtimes_u501)(tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitFrom_p0, tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitTo_p1, NI64 quantity_p2);
N_LIB_PRIVATE N_NOINLINE(void, raiseDivByZero)(void);
static N_INLINE(NIM_BOOL, nimDivInt64)(NI64 a_p0, NI64 b_p1, NI64* res_p2);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
static N_INLINE(NIM_BOOL, nimMulInt64)(NI64 a_p0, NI64 b_p1, NI64* res_p2);
static N_INLINE(NF, toBiggestFloat__system_u1708)(NI64 i_p0);
static N_INLINE(NF, abs__system_u5188)(NF x_p0);
static N_INLINE(NIM_BOOL, nimAddInt64)(NI64 a_p0, NI64 b_p1, NI64* res_p2);
static N_INLINE(NI, convert__pureZtimes_u597)(tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitFrom_p0, tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitTo_p1, NI quantity_p2);
static N_INLINE(NIM_BOOL, nimSubInt)(NI a_p0, NI b_p1, NI* res_p2);
static N_INLINE(NIM_BOOL, nimSubInt64)(NI64 a_p0, NI64 b_p1, NI64* res_p2);
static N_INLINE(NI, convert__pureZtimes_u848)(tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitFrom_p0, tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitTo_p1, NI quantity_p2);
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA, ntAddDuration)(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA a_p0, tyObject_Duration__IhPGomXjacpk8ChnxqMuoA b_p1);
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__system_u2188)(void* a_p0, int v_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA, normalize__pureZtimes_u582)(NI64 seconds_p0, NI64 nanoseconds_p1);
static N_INLINE(NIM_BOOL, nimAddInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE NIM_CONST tyArray__PsWXBx5JAByzUdsc6tjJLg unitWeights__pureZtimes_u114 = {IL64(1),
IL64(1000),
IL64(1000000),
IL64(1000000000),
IL64(60000000000),
IL64(3600000000000),
IL64(86400000000000),
IL64(604800000000000)}
;
N_LIB_PRIVATE NIM_THREADVAR tyObject_TimezonecolonObjectType___dZ3mUjFeIppMsEY9bYBSCMg* utcInstance__pureZtimes_u2063;
N_LIB_PRIVATE NIM_THREADVAR tyObject_TimezonecolonObjectType___dZ3mUjFeIppMsEY9bYBSCMg* localInstance__pureZtimes_u2064;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4198;
static N_INLINE(NIM_BOOL, nimDivInt64)(NI64 a_p0, NI64 b_p1, NI64* res_p2) {
	NIM_BOOL result;
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (a_p0 == (IL64(-9223372036854775807) - IL64(1)));
		if (!(T3_)) goto LA4_;
		T3_ = (b_p1 == IL64(-1));
LA4_: ;
		if (!T3_) goto LA5_;
		result = NIM_TRUE;
	}
	goto LA1_;
LA5_: ;
	{
		result = NIM_FALSE;
		(*res_p2) = (NI64)(a_p0 / b_p1);
	}
LA1_: ;
	return result;
}
static N_INLINE(NF, toBiggestFloat__system_u1708)(NI64 i_p0) {
	NF result;
	result = ((NF) (i_p0));
	return result;
}
static N_INLINE(NF, abs__system_u5188)(NF x_p0) {
	NF result;
	result = (NF)0;
	result = fabs(x_p0);
	return result;
}
static N_INLINE(NIM_BOOL, nimMulInt64)(NI64 a_p0, NI64 b_p1, NI64* res_p2) {
	NIM_BOOL result;
	NI64 r_1;
	NF floatProd_1;
	NF T1_;
	NF T2_;
	NF resAsFloat_1;
	result = (NIM_BOOL)0;
	r_1 = ((NI64) ((NU64)((NU64)(((NU64) (a_p0))) * (NU64)(((NU64) (b_p1))))));
	T1_ = (NF)0;
	T1_ = toBiggestFloat__system_u1708(a_p0);
	T2_ = (NF)0;
	T2_ = toBiggestFloat__system_u1708(b_p1);
	floatProd_1 = ((NF)(T1_) * (NF)(T2_));
	resAsFloat_1 = toBiggestFloat__system_u1708(r_1);
	{
		if (!(resAsFloat_1 == floatProd_1)) goto LA5_;
		(*res_p2) = r_1;
	}
	goto LA3_;
LA5_: ;
	{
		{
			NF T10_;
			NF T11_;
			T10_ = (NF)0;
			T10_ = abs__system_u5188(((NF)(resAsFloat_1) - (NF)(floatProd_1)));
			T11_ = (NF)0;
			T11_ = abs__system_u5188(floatProd_1);
			if (!(((NF)(32.0) * (NF)(T10_)) <= T11_)) goto LA12_;
			(*res_p2) = r_1;
		}
		goto LA8_;
LA12_: ;
		{
			result = NIM_TRUE;
		}
LA8_: ;
	}
LA3_: ;
	return result;
}
static N_INLINE(NI64, convert__pureZtimes_u501)(tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitFrom_p0, tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitTo_p1, NI64 quantity_p2) {
	NI64 result;
	NI64 colontmpD_;
	NI64 colontmpD__2;
{	result = (NI64)0;
	colontmpD_ = (NI64)0;
	colontmpD__2 = (NI64)0;
	{
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_2;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_3;
		if (!(unitFrom_p0 < unitTo_p1)) goto LA3_;
		if (unitWeights__pureZtimes_u114[(unitFrom_p0)- 0] == 0){ raiseDivByZero(); goto BeforeRet_;
		}
		if (nimDivInt64(unitWeights__pureZtimes_u114[(unitTo_p1)- 0], unitWeights__pureZtimes_u114[(unitFrom_p0)- 0], &TM__6NbDwwj5FY059b1gz2AsAZQ_2)) { raiseOverflow(); goto BeforeRet_;
		};
		if ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_2) == 0){ raiseDivByZero(); goto BeforeRet_;
		}
		if (nimDivInt64(quantity_p2, (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_2), &TM__6NbDwwj5FY059b1gz2AsAZQ_3)) { raiseOverflow(); goto BeforeRet_;
		};
		colontmpD_ = (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_3);
		result = colontmpD_;
	}
	goto LA1_;
LA3_: ;
	{
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_4;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_5;
		if (unitWeights__pureZtimes_u114[(unitTo_p1)- 0] == 0){ raiseDivByZero(); goto BeforeRet_;
		}
		if (nimDivInt64(unitWeights__pureZtimes_u114[(unitFrom_p0)- 0], unitWeights__pureZtimes_u114[(unitTo_p1)- 0], &TM__6NbDwwj5FY059b1gz2AsAZQ_4)) { raiseOverflow(); goto BeforeRet_;
		};
		if (nimMulInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_4), quantity_p2, &TM__6NbDwwj5FY059b1gz2AsAZQ_5)) { raiseOverflow(); goto BeforeRet_;
		};
		colontmpD__2 = (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_5);
		result = colontmpD__2;
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, nimAddInt64)(NI64 a_p0, NI64 b_p1, NI64* res_p2) {
	NIM_BOOL result;
	NI64 r_1;
	result = (NIM_BOOL)0;
	r_1 = ((NI64) ((NU64)((NU64)(((NU64) (a_p0))) + (NU64)(((NU64) (b_p1))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (IL64(0) <= (NI64)(r_1 ^ a_p0));
		if (T3_) goto LA4_;
		T3_ = (IL64(0) <= (NI64)(r_1 ^ b_p1));
LA4_: ;
		if (!T3_) goto LA5_;
		(*res_p2) = r_1;
	}
	goto LA1_;
LA5_: ;
	{
		result = NIM_TRUE;
	}
LA1_: ;
	return result;
}
static N_INLINE(NI, convert__pureZtimes_u597)(tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitFrom_p0, tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitTo_p1, NI quantity_p2) {
	NI result;
	NI colontmpD_;
	NI colontmpD__2;
{	result = (NI)0;
	colontmpD_ = (NI)0;
	colontmpD__2 = (NI)0;
	{
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_7;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_8;
		if (!(unitFrom_p0 < unitTo_p1)) goto LA3_;
		if (unitWeights__pureZtimes_u114[(unitFrom_p0)- 0] == 0){ raiseDivByZero(); goto BeforeRet_;
		}
		if (nimDivInt64(unitWeights__pureZtimes_u114[(unitTo_p1)- 0], unitWeights__pureZtimes_u114[(unitFrom_p0)- 0], &TM__6NbDwwj5FY059b1gz2AsAZQ_7)) { raiseOverflow(); goto BeforeRet_;
		};
		if ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_7) == 0){ raiseDivByZero(); goto BeforeRet_;
		}
		if (nimDivInt64(((NI64) (quantity_p2)), (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_7), &TM__6NbDwwj5FY059b1gz2AsAZQ_8)) { raiseOverflow(); goto BeforeRet_;
		};
		colontmpD_ = ((NI) ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_8)));
		result = colontmpD_;
	}
	goto LA1_;
LA3_: ;
	{
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_9;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_10;
		if (unitWeights__pureZtimes_u114[(unitTo_p1)- 0] == 0){ raiseDivByZero(); goto BeforeRet_;
		}
		if (nimDivInt64(unitWeights__pureZtimes_u114[(unitFrom_p0)- 0], unitWeights__pureZtimes_u114[(unitTo_p1)- 0], &TM__6NbDwwj5FY059b1gz2AsAZQ_9)) { raiseOverflow(); goto BeforeRet_;
		};
		if (nimMulInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_9), ((NI64) (quantity_p2)), &TM__6NbDwwj5FY059b1gz2AsAZQ_10)) { raiseOverflow(); goto BeforeRet_;
		};
		colontmpD__2 = ((NI) ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_10)));
		result = colontmpD__2;
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, nimSubInt)(NI a_p0, NI b_p1, NI* res_p2) {
	NIM_BOOL result;
	NI r_1;
	result = (NIM_BOOL)0;
	r_1 = ((NI) ((NU)((NU64)(((NU) (a_p0))) - (NU64)(((NU) (b_p1))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI)0) <= (NI)(r_1 ^ a_p0));
		if (T3_) goto LA4_;
		T3_ = (((NI)0) <= (NI)(r_1 ^ (NI)((NU64) ~(b_p1))));
LA4_: ;
		if (!T3_) goto LA5_;
		(*res_p2) = r_1;
	}
	goto LA1_;
LA5_: ;
	{
		result = NIM_TRUE;
	}
LA1_: ;
	return result;
}
static N_INLINE(NIM_BOOL, nimSubInt64)(NI64 a_p0, NI64 b_p1, NI64* res_p2) {
	NIM_BOOL result;
	NI64 r_1;
	result = (NIM_BOOL)0;
	r_1 = ((NI64) ((NU64)((NU64)(((NU64) (a_p0))) - (NU64)(((NU64) (b_p1))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (IL64(0) <= (NI64)(r_1 ^ a_p0));
		if (T3_) goto LA4_;
		T3_ = (IL64(0) <= (NI64)(r_1 ^ (NI64)((NU64) ~(b_p1))));
LA4_: ;
		if (!T3_) goto LA5_;
		(*res_p2) = r_1;
	}
	goto LA1_;
LA5_: ;
	{
		result = NIM_TRUE;
	}
LA1_: ;
	return result;
}
static N_INLINE(NI, convert__pureZtimes_u848)(tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitFrom_p0, tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA unitTo_p1, NI quantity_p2) {
	NI result;
	NI colontmpD_;
	NI colontmpD__2;
{	result = (NI)0;
	colontmpD_ = (NI)0;
	colontmpD__2 = (NI)0;
	{
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_13;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_14;
		if (!(unitFrom_p0 < unitTo_p1)) goto LA3_;
		if (unitWeights__pureZtimes_u114[(unitFrom_p0)- 0] == 0){ raiseDivByZero(); goto BeforeRet_;
		}
		if (nimDivInt64(unitWeights__pureZtimes_u114[(unitTo_p1)- 0], unitWeights__pureZtimes_u114[(unitFrom_p0)- 0], &TM__6NbDwwj5FY059b1gz2AsAZQ_13)) { raiseOverflow(); goto BeforeRet_;
		};
		if ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_13) == 0){ raiseDivByZero(); goto BeforeRet_;
		}
		if (nimDivInt64(((NI64) (quantity_p2)), (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_13), &TM__6NbDwwj5FY059b1gz2AsAZQ_14)) { raiseOverflow(); goto BeforeRet_;
		};
		if (((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_14)) < ((NI)0) || ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_14)) > ((NI)999999999)){ raiseRangeErrorI((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_14), ((NI)0), ((NI)999999999)); goto BeforeRet_;
		}
		colontmpD_ = ((NI) ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_14)));
		result = colontmpD_;
	}
	goto LA1_;
LA3_: ;
	{
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_15;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_16;
		if (unitWeights__pureZtimes_u114[(unitTo_p1)- 0] == 0){ raiseDivByZero(); goto BeforeRet_;
		}
		if (nimDivInt64(unitWeights__pureZtimes_u114[(unitFrom_p0)- 0], unitWeights__pureZtimes_u114[(unitTo_p1)- 0], &TM__6NbDwwj5FY059b1gz2AsAZQ_15)) { raiseOverflow(); goto BeforeRet_;
		};
		if (nimMulInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_15), ((NI64) (quantity_p2)), &TM__6NbDwwj5FY059b1gz2AsAZQ_16)) { raiseOverflow(); goto BeforeRet_;
		};
		if (((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_16)) < ((NI)0) || ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_16)) > ((NI)999999999)){ raiseRangeErrorI((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_16), ((NI)0), ((NI)999999999)); goto BeforeRet_;
		}
		colontmpD__2 = ((NI) ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_16)));
		result = colontmpD__2;
	}
LA1_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4198);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, inMilliseconds__pureZtimes_u814)(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA dur_p0) {
	NI64 result;
	NI64 colontmpD_;
	NI64 colontmpD__2;
	NIM_BOOL correctionX60gensym29__1;
	NIM_BOOL T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI64)0;
	colontmpD_ = (NI64)0;
	colontmpD__2 = (NI64)0;
	T1_ = (NIM_BOOL)0;
	T1_ = (dur_p0.seconds < IL64(0));
	if (!(T1_)) goto LA2_;
	T1_ = (((NI)0) < dur_p0.nanosecond);
LA2_: ;
	correctionX60gensym29__1 = T1_;
	{
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_6;
		NI64 T7_;
		NI T8_;
		NI TM__6NbDwwj5FY059b1gz2AsAZQ_11;
		NI T9_;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_12;
		if (!correctionX60gensym29__1) goto LA5_;
		if (nimAddInt64(dur_p0.seconds, IL64(1), &TM__6NbDwwj5FY059b1gz2AsAZQ_6)) { raiseOverflow(); goto BeforeRet_;
		};
		T7_ = (NI64)0;
		T7_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)2), (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_6));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T8_ = (NI)0;
		T8_ = convert__pureZtimes_u597(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)0), ((NI)1));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (nimSubInt(T8_, dur_p0.nanosecond, &TM__6NbDwwj5FY059b1gz2AsAZQ_11)) { raiseOverflow(); goto BeforeRet_;
		};
		T9_ = (NI)0;
		T9_ = convert__pureZtimes_u597(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)0), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)2), (NI)(TM__6NbDwwj5FY059b1gz2AsAZQ_11));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (nimSubInt64(T7_, ((NI64) (T9_)), &TM__6NbDwwj5FY059b1gz2AsAZQ_12)) { raiseOverflow(); goto BeforeRet_;
		};
		colontmpD_ = (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_12);
		result = colontmpD_;
	}
	goto LA3_;
LA5_: ;
	{
		NI64 T11_;
		NI T12_;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_17;
		T11_ = (NI64)0;
		T11_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)2), dur_p0.seconds);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T12_ = (NI)0;
		T12_ = convert__pureZtimes_u848(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)0), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)2), dur_p0.nanosecond);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (nimAddInt64(T11_, ((NI64) (T12_)), &TM__6NbDwwj5FY059b1gz2AsAZQ_17)) { raiseOverflow(); goto BeforeRet_;
		};
		colontmpD__2 = (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_17);
		result = colontmpD__2;
	}
LA3_: ;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, nimSetMem__system_u2188)(void* a_p0, int v_p1, NI size_p2) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
	nimSetMem__system_u2188(p_p0, ((int)0), size_p1);
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA, normalize__pureZtimes_u582)(NI64 seconds_p0, NI64 nanoseconds_p1) {
	tyObject_Duration__IhPGomXjacpk8ChnxqMuoA result;
	NI64 T1_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_18;
	NI64 nanosecond_1;
	NI T2_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_19;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA));
	T1_ = (NI64)0;
	T1_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)0), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), nanoseconds_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt64(seconds_p0, T1_, &TM__6NbDwwj5FY059b1gz2AsAZQ_18)) { raiseOverflow(); goto BeforeRet_;
	};
	result.seconds = (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_18);
	T2_ = (NI)0;
	T2_ = convert__pureZtimes_u597(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)0), ((NI)1));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (((NI64) (T2_)) == 0){ raiseDivByZero(); goto BeforeRet_;
	}
	if (nimModInt64(nanoseconds_p1, ((NI64) (T2_)), &TM__6NbDwwj5FY059b1gz2AsAZQ_19)) { raiseOverflow(); goto BeforeRet_;
	};
	nanosecond_1 = (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_19);
	{
		NI T7_;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_20;
		NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_21;
		if (!(nanosecond_1 < IL64(0))) goto LA5_;
		T7_ = (NI)0;
		T7_ = convert__pureZtimes_u597(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)0), ((NI)1));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (nimAddInt64(nanosecond_1, ((NI64) (T7_)), &TM__6NbDwwj5FY059b1gz2AsAZQ_20)) { raiseOverflow(); goto BeforeRet_;
		};
		nanosecond_1 = (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_20);
		if (nimSubInt64(result.seconds, IL64(1), &TM__6NbDwwj5FY059b1gz2AsAZQ_21)) { raiseOverflow(); goto BeforeRet_;
		};
		result.seconds = (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_21);
	}
LA5_: ;
	if ((((NI) (nanosecond_1))) < ((NI)0) || (((NI) (nanosecond_1))) > ((NI)999999999)){ raiseRangeErrorI(((NI) (nanosecond_1)), ((NI)0), ((NI)999999999)); goto BeforeRet_;
	}
	result.nanosecond = (((NI) (nanosecond_1)));
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL, nimAddInt)(NI a_p0, NI b_p1, NI* res_p2) {
	NIM_BOOL result;
	NI r_1;
	result = (NIM_BOOL)0;
	r_1 = ((NI) ((NU)((NU64)(((NU) (a_p0))) + (NU64)(((NU) (b_p1))))));
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = (((NI)0) <= (NI)(r_1 ^ a_p0));
		if (T3_) goto LA4_;
		T3_ = (((NI)0) <= (NI)(r_1 ^ b_p1));
LA4_: ;
		if (!T3_) goto LA5_;
		(*res_p2) = r_1;
	}
	goto LA1_;
LA5_: ;
	{
		result = NIM_TRUE;
	}
LA1_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA, ntAddDuration)(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA a_p0, tyObject_Duration__IhPGomXjacpk8ChnxqMuoA b_p1) {
	tyObject_Duration__IhPGomXjacpk8ChnxqMuoA result;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_22;
	NI TM__6NbDwwj5FY059b1gz2AsAZQ_23;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA));
	if (nimAddInt64(a_p0.seconds, b_p1.seconds, &TM__6NbDwwj5FY059b1gz2AsAZQ_22)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt(a_p0.nanosecond, b_p1.nanosecond, &TM__6NbDwwj5FY059b1gz2AsAZQ_23)) { raiseOverflow(); goto BeforeRet_;
	};
	result = normalize__pureZtimes_u582((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_22), ((NI64) ((NI)(TM__6NbDwwj5FY059b1gz2AsAZQ_23))));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, pluseq___pureZtimes_u1156)(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA* d1_p0, tyObject_Duration__IhPGomXjacpk8ChnxqMuoA d2_p1) {
	tyObject_Duration__IhPGomXjacpk8ChnxqMuoA T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&T1_), sizeof(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA));
	T1_ = ntAddDuration((*d1_p0), d2_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	(*d1_p0) = T1_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA, initDuration__pureZtimes_u491)(NI64 nanoseconds_p0, NI64 microseconds_p1, NI64 milliseconds_p2, NI64 seconds_p3, NI64 minutes_p4, NI64 hours_p5, NI64 days_p6, NI64 weeks_p7) {
	tyObject_Duration__IhPGomXjacpk8ChnxqMuoA result;
	NI64 seconds_2;
	NI64 T1_;
	NI64 T2_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_24;
	NI64 T3_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_25;
	NI64 T4_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_26;
	NI64 T5_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_27;
	NI64 T6_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_28;
	NI64 T7_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_29;
	NI64 T8_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_30;
	NI nanoseconds_2;
	NI64 T9_;
	NI64 T10_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_31;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_32;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&result), sizeof(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA));
	T1_ = (NI64)0;
	T1_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)7), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), weeks_p7);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T2_ = (NI64)0;
	T2_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)6), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), days_p6);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt64(T1_, T2_, &TM__6NbDwwj5FY059b1gz2AsAZQ_24)) { raiseOverflow(); goto BeforeRet_;
	};
	T3_ = (NI64)0;
	T3_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)4), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), minutes_p4);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_24), T3_, &TM__6NbDwwj5FY059b1gz2AsAZQ_25)) { raiseOverflow(); goto BeforeRet_;
	};
	T4_ = (NI64)0;
	T4_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)5), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), hours_p5);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_25), T4_, &TM__6NbDwwj5FY059b1gz2AsAZQ_26)) { raiseOverflow(); goto BeforeRet_;
	};
	T5_ = (NI64)0;
	T5_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), seconds_p3);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_26), T5_, &TM__6NbDwwj5FY059b1gz2AsAZQ_27)) { raiseOverflow(); goto BeforeRet_;
	};
	T6_ = (NI64)0;
	T6_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)2), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), milliseconds_p2);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_27), T6_, &TM__6NbDwwj5FY059b1gz2AsAZQ_28)) { raiseOverflow(); goto BeforeRet_;
	};
	T7_ = (NI64)0;
	T7_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)1), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), microseconds_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_28), T7_, &TM__6NbDwwj5FY059b1gz2AsAZQ_29)) { raiseOverflow(); goto BeforeRet_;
	};
	T8_ = (NI64)0;
	T8_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)0), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), nanoseconds_p0);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_29), T8_, &TM__6NbDwwj5FY059b1gz2AsAZQ_30)) { raiseOverflow(); goto BeforeRet_;
	};
	seconds_2 = (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_30);
	T9_ = (NI64)0;
	T9_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)2), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)0), (NI64)((milliseconds_p2) % (IL64(1000))));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	T10_ = (NI64)0;
	T10_ = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)1), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)0), (NI64)((microseconds_p1) % (IL64(1000000))));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	if (nimAddInt64(T9_, T10_, &TM__6NbDwwj5FY059b1gz2AsAZQ_31)) { raiseOverflow(); goto BeforeRet_;
	};
	if (nimAddInt64((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_31), (NI64)((nanoseconds_p0) % (IL64(1000000000))), &TM__6NbDwwj5FY059b1gz2AsAZQ_32)) { raiseOverflow(); goto BeforeRet_;
	};
	nanoseconds_2 = ((NI) ((NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_32)));
	result = normalize__pureZtimes_u582(seconds_2, ((NI64) (nanoseconds_2)));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, inSeconds__pureZtimes_u792)(tyObject_Duration__IhPGomXjacpk8ChnxqMuoA dur_p0) {
	NI64 result;
	NIM_BOOL correctionX60gensym26__1;
	NIM_BOOL T1_;
	NI64 TM__6NbDwwj5FY059b1gz2AsAZQ_33;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result = (NI64)0;
	T1_ = (NIM_BOOL)0;
	T1_ = (dur_p0.seconds < IL64(0));
	if (!(T1_)) goto LA2_;
	T1_ = (((NI)0) < dur_p0.nanosecond);
LA2_: ;
	correctionX60gensym26__1 = T1_;
	if (nimAddInt64(dur_p0.seconds, ((NI64) (correctionX60gensym26__1)), &TM__6NbDwwj5FY059b1gz2AsAZQ_33)) { raiseOverflow(); goto BeforeRet_;
	};
	result = convert__pureZtimes_u501(((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), ((tyEnum_TimeUnit__d8rFExAPBSRPjecRziKvPA)3), (NI64)(TM__6NbDwwj5FY059b1gz2AsAZQ_33));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
