/* 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/@palgorithm.nim.c.o /Users/runner/work/nightlies/nightlies/nim-2.2.10/dist/atlas/.nimcache/@palgorithm.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_VersionTag__io9bcihbopiwucKorobyKdg tyObject_VersionTag__io9bcihbopiwucKorobyKdg;
typedef struct tySequence__ROG4zVH2lrODohp66awvUw tySequence__ROG4zVH2lrODohp66awvUw;
typedef struct tySequence__ROG4zVH2lrODohp66awvUw_Content tySequence__ROG4zVH2lrODohp66awvUw_Content;
typedef struct tyObject_CommitHash__ENSoVMeDKmDIP8obk69cDaA tyObject_CommitHash__ENSoVMeDKmDIP8obk69cDaA;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tySequence__48JTohSgTy339bRxHzUD8KA tySequence__48JTohSgTy339bRxHzUD8KA;
typedef struct tySequence__48JTohSgTy339bRxHzUD8KA_Content tySequence__48JTohSgTy339bRxHzUD8KA_Content;
typedef struct tyTuple__J4qYjN1oh0iSNXduwGtAfg tyTuple__J4qYjN1oh0iSNXduwGtAfg;
typedef struct tySequence__fUCMBHW75OZPJePoPhOXNA tySequence__fUCMBHW75OZPJePoPhOXNA;
typedef struct tySequence__fUCMBHW75OZPJePoPhOXNA_Content tySequence__fUCMBHW75OZPJePoPhOXNA_Content;
typedef struct tyObject_PackageVersioncolonObjectType___nkWxN1qoImjRSFLA34DlGg tyObject_PackageVersioncolonObjectType___nkWxN1qoImjRSFLA34DlGg;
typedef struct tyObject_NimbleReleasecolonObjectType___Cd1woUEuIWSParVQIsOkuw tyObject_NimbleReleasecolonObjectType___Cd1woUEuIWSParVQIsOkuw;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content;
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyObject_VersionTag__io9bcihbopiwucKorobyKdg* x_p0, tyObject_VersionTag__io9bcihbopiwucKorobyKdg* y_p1, void* ClE_0);
void* ClE_0;
} tyProc__VRpJfpeaZqlQGq4cCdLVCA;
typedef NU8 tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw;
struct tySequence__ROG4zVH2lrODohp66awvUw {
  NI len; tySequence__ROG4zVH2lrODohp66awvUw_Content* p;
};
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
typedef NU8 tyEnum_CommitOrigin__tDM8mWEQT3dZtKoOj7Mgww;
struct tyObject_CommitHash__ENSoVMeDKmDIP8obk69cDaA {
	NimStringV2 h;
	tyEnum_CommitOrigin__tDM8mWEQT3dZtKoOj7Mgww orig;
};
struct tyObject_VersionTag__io9bcihbopiwucKorobyKdg {
	tyObject_CommitHash__ENSoVMeDKmDIP8obk69cDaA c;
	NimStringV2 v;
	NIM_BOOL isTip;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_8) (tyObject_VersionTag__io9bcihbopiwucKorobyKdg* x_p0, tyObject_VersionTag__io9bcihbopiwucKorobyKdg* y_p1);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_13) (tyObject_VersionTag__io9bcihbopiwucKorobyKdg* x_p0, tyObject_VersionTag__io9bcihbopiwucKorobyKdg* y_p1);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (NI32 x_p0, NI32 y_p1, void* ClE_0);
void* ClE_0;
} tyProc__CBoNLvw7Pjo72NRN8hQDEA;
struct tySequence__48JTohSgTy339bRxHzUD8KA {
  NI len; tySequence__48JTohSgTy339bRxHzUD8KA_Content* p;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_30) (NI32 x_p0, NI32 y_p1);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_34) (NI32 x_p0, NI32 y_p1);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (tyTuple__J4qYjN1oh0iSNXduwGtAfg x_p0, tyTuple__J4qYjN1oh0iSNXduwGtAfg y_p1, void* ClE_0);
void* ClE_0;
} tyProc__eqFE5VT3oFJNevHXF9bTkjw;
struct tySequence__fUCMBHW75OZPJePoPhOXNA {
  NI len; tySequence__fUCMBHW75OZPJePoPhOXNA_Content* p;
};
struct tyTuple__J4qYjN1oh0iSNXduwGtAfg {
	tyObject_PackageVersioncolonObjectType___nkWxN1qoImjRSFLA34DlGg* Field0;
	tyObject_NimbleReleasecolonObjectType___Cd1woUEuIWSParVQIsOkuw* Field1;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_49) (tyTuple__J4qYjN1oh0iSNXduwGtAfg x_p0, tyTuple__J4qYjN1oh0iSNXduwGtAfg y_p1);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_53) (tyTuple__J4qYjN1oh0iSNXduwGtAfg x_p0, tyTuple__J4qYjN1oh0iSNXduwGtAfg y_p1);
typedef struct {
N_NIMCALL_PTR(NI, ClP_0) (NimStringV2 x_p0, NimStringV2 y_p1, void* ClE_0);
void* ClE_0;
} tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA;
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  NI len; tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content* p;
};
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_68) (NimStringV2 x_p0, NimStringV2 y_p1);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_72) (NimStringV2 x_p0, NimStringV2 y_p1);
typedef N_CLOSURE_PTR(NI, TM__JdC9c6SaUkvO1XjYuWP1JWQ_84) (NimStringV2 x_p0, NimStringV2 y_p1, void* ClE_0);
struct tySequence__ROG4zVH2lrODohp66awvUw_Content { NI cap; tyObject_VersionTag__io9bcihbopiwucKorobyKdg data[SEQ_DECL_SIZE]; };
struct tySequence__48JTohSgTy339bRxHzUD8KA_Content { NI cap; NI32 data[SEQ_DECL_SIZE]; };
struct tySequence__fUCMBHW75OZPJePoPhOXNA_Content { NI cap; tyTuple__J4qYjN1oh0iSNXduwGtAfg data[SEQ_DECL_SIZE]; };
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE]; };
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
static N_INLINE(NIM_BOOL, nimAddInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NIMCALL(tySequence__ROG4zVH2lrODohp66awvUw, newSeq__basicZversions_u4680)(NI len_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseRangeErrorI)(NI64 i_p0, NI64 a_p1, NI64 b_p2);
static N_INLINE(NIM_BOOL, nimSubInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__basicZversions_u4822)(tyObject_VersionTag__io9bcihbopiwucKorobyKdg* a_p0, NI a_p0Len_0, tyObject_VersionTag__io9bcihbopiwucKorobyKdg* b_p1, NI b_p1Len_0, NI lo_p2, NI m_p3, NI hi_p4, tyProc__VRpJfpeaZqlQGq4cCdLVCA cmp_p5, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p6);
static N_INLINE(NI, star___pureZalgorithm_u8)(NI x_p0, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p1);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u95)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___basicZversions_u3518)(tyObject_VersionTag__io9bcihbopiwucKorobyKdg* dest_p0, tyObject_VersionTag__io9bcihbopiwucKorobyKdg* src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___basicZversions_u3506)(tyObject_VersionTag__io9bcihbopiwucKorobyKdg* dest_p0);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
static N_INLINE(NIM_BOOL, nimMulInt)(NI a_p0, NI b_p1, NI* res_p2);
static N_INLINE(NF, toFloat__system_u1705)(NI i_p0);
static N_INLINE(NF, abs__system_u5188)(NF x_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___basicZversions_u4782)(tySequence__ROG4zVH2lrODohp66awvUw dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, reverse__dependencies_u45)(tyObject_VersionTag__io9bcihbopiwucKorobyKdg* a_p0, NI a_p0Len_0, NI first_p1, NI last_p2);
N_LIB_PRIVATE N_NIMCALL(tySequence__48JTohSgTy339bRxHzUD8KA, newSeq__depgraphs_u13160)(NI len_p0);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__depgraphs_u13180)(NI32* a_p0, NI a_p0Len_0, NI32* b_p1, NI b_p1Len_0, NI lo_p2, NI m_p3, NI hi_p4, tyProc__CBoNLvw7Pjo72NRN8hQDEA cmp_p5, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p6);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___OOZdistZsatZsrcZsatZsatvars_u223)(NI32* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___depgraphs_u588)(tySequence__48JTohSgTy339bRxHzUD8KA dest_p0);
N_LIB_PRIVATE N_NIMCALL(tySequence__fUCMBHW75OZPJePoPhOXNA, newSeq__depgraphs_u18619)(NI len_p0);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__depgraphs_u18639)(tyTuple__J4qYjN1oh0iSNXduwGtAfg* a_p0, NI a_p0Len_0, tyTuple__J4qYjN1oh0iSNXduwGtAfg* b_p1, NI b_p1Len_0, NI lo_p2, NI m_p3, NI hi_p4, tyProc__eqFE5VT3oFJNevHXF9bTkjw cmp_p5, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p6);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___basicZdeptypes_u2011)(tyTuple__J4qYjN1oh0iSNXduwGtAfg* dest_p0, tyTuple__J4qYjN1oh0iSNXduwGtAfg src_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(void, eqwasMoved___basicZdeptypes_u1999)(tyTuple__J4qYjN1oh0iSNXduwGtAfg* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___dependencies_u12042)(tySequence__fUCMBHW75OZPJePoPhOXNA dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, sort__depgraphs_u1488)(NimStringV2* a_p0, NI a_p0Len_0, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp_p1, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p2);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, newSeq__stdZsyncio_u578)(NI len_p0);
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__depgraphs_u1535)(NimStringV2* a_p0, NI a_p0Len_0, NimStringV2* b_p1, NI b_p1Len_0, NI lo_p2, NI m_p3, NI hi_p4, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp_p5, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p6);
N_LIB_PRIVATE N_NIMCALL(void, eqsink___system_u2760)(NimStringV2* dest_p0, NimStringV2 src_p1);
N_LIB_PRIVATE N_NIMCALL(void, eqwasMoved___system_u2751)(NimStringV2* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u5582)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ dest_p0);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__depgraphs_u1463)(NimStringV2 x_p0, NimStringV2 y_p1);
static const struct {
  NI cap; NIM_CHAR data[31+1];
} TM__JdC9c6SaUkvO1XjYuWP1JWQ_9 = { 31 | NIM_STRLIT_FLAG, "algorithm.nim(338, 3) `j <= m` " };
static const NimStringV2 TM__JdC9c6SaUkvO1XjYuWP1JWQ_10 = {31, (NimStrPayload*)&TM__JdC9c6SaUkvO1XjYuWP1JWQ_9};
static const NimStringV2 TM__JdC9c6SaUkvO1XjYuWP1JWQ_31 = {31, (NimStrPayload*)&TM__JdC9c6SaUkvO1XjYuWP1JWQ_9};
static const NimStringV2 TM__JdC9c6SaUkvO1XjYuWP1JWQ_50 = {31, (NimStrPayload*)&TM__JdC9c6SaUkvO1XjYuWP1JWQ_9};
static const NimStringV2 TM__JdC9c6SaUkvO1XjYuWP1JWQ_69 = {31, (NimStrPayload*)&TM__JdC9c6SaUkvO1XjYuWP1JWQ_9};
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4198;
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(void, fill__pureZstrutils_u1634)(NI* a_p0, NI a_p0Len_0, NI value_p1) {
	NI xX60gensym170__1;
{	xX60gensym170__1 = ((NI)0);
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_2;
			if (!(xX60gensym170__1 <= (a_p0Len_0-1))) goto LA2;
			if (xX60gensym170__1 < 0 || xX60gensym170__1 >= a_p0Len_0){ raiseIndexError2(xX60gensym170__1,a_p0Len_0-1); goto BeforeRet_;
			}
			a_p0[xX60gensym170__1] = value_p1;
			if (nimAddInt(xX60gensym170__1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_2)) { raiseOverflow(); goto BeforeRet_;
			};
			xX60gensym170__1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_2);
		} LA2: ;
	}
	}BeforeRet_: ;
}
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(NI, star___pureZalgorithm_u8)(NI x_p0, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p1) {
	NI result;
	NI y_1;
	NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_5;
	NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_6;
{	result = (NI)0;
	if (nimSubInt(order_p1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_5)) { raiseOverflow(); goto BeforeRet_;
	};
	y_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_5);
	if (nimSubInt((NI)(x_p0 ^ y_1), y_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_6)) { raiseOverflow(); goto BeforeRet_;
	};
	result = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_6);
	}BeforeRet_: ;
	return result;
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4198);
	return result;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__basicZversions_u4822)(tyObject_VersionTag__io9bcihbopiwucKorobyKdg* a_p0, NI a_p0Len_0, tyObject_VersionTag__io9bcihbopiwucKorobyKdg* b_p1, NI b_p1Len_0, NI lo_p2, NI m_p3, NI hi_p4, tyProc__VRpJfpeaZqlQGq4cCdLVCA cmp_p5, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p6) {
	NI j_1;
	NI bb_1;
	NI i_1;
	NI k_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_7;
		NI T3_;
		NI T4_;
		if (m_p3 < 0 || m_p3 >= a_p0Len_0){ raiseIndexError2(m_p3,a_p0Len_0-1); goto BeforeRet_;
		}
		if (nimAddInt(m_p3, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_7)) { raiseOverflow(); goto BeforeRet_;
		};
		if ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_7) < 0 || (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_7) >= a_p0Len_0){ raiseIndexError2((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_7),a_p0Len_0-1); goto BeforeRet_;
		}
		T3_ = (NI)0;
		T3_ = cmp_p5.ClE_0? cmp_p5.ClP_0((&a_p0[m_p3]), (&a_p0[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_7)]), cmp_p5.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_8)(cmp_p5.ClP_0))((&a_p0[m_p3]), (&a_p0[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_7)]));
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_u8(T3_, order_p6);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!(T4_ <= ((NI)0))) goto LA5_;
		goto BeforeRet_;
	}
LA5_: ;
	j_1 = lo_p2;
	{
		if (!!((j_1 <= m_p3))) goto LA9_;
		failedAssertImpl__stdZassertions_u95(TM__JdC9c6SaUkvO1XjYuWP1JWQ_10);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA9_: ;
	bb_1 = ((NI)0);
	{
		while (1) {
			tyObject_VersionTag__io9bcihbopiwucKorobyKdg T13_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_11;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_12;
			if (!(j_1 <= m_p3)) goto LA12;
			if (bb_1 < 0 || bb_1 >= b_p1Len_0){ raiseIndexError2(bb_1,b_p1Len_0-1); goto BeforeRet_;
			}
			if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
			}
			T13_ = a_p0[j_1];
			eqwasMoved___basicZversions_u3506((&a_p0[j_1]));
			eqsink___basicZversions_u3518((&b_p1[bb_1]), (&T13_));
			if (nimAddInt(bb_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_11)) { raiseOverflow(); goto BeforeRet_;
			};
			bb_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_11);
			if (nimAddInt(j_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_12)) { raiseOverflow(); goto BeforeRet_;
			};
			j_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_12);
		} LA12: ;
	}
	i_1 = ((NI)0);
	k_1 = lo_p2;
	{
		while (1) {
			NIM_BOOL T16_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_16;
			T16_ = (NIM_BOOL)0;
			T16_ = (k_1 < j_1);
			if (!(T16_)) goto LA17_;
			T16_ = (j_1 <= hi_p4);
LA17_: ;
			if (!T16_) goto LA15;
			{
				NI T20_;
				NI T21_;
				tyObject_VersionTag__io9bcihbopiwucKorobyKdg T24_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_14;
				if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
				}
				if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
				}
				T20_ = (NI)0;
				T20_ = cmp_p5.ClE_0? cmp_p5.ClP_0((&b_p1[i_1]), (&a_p0[j_1]), cmp_p5.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_13)(cmp_p5.ClP_0))((&b_p1[i_1]), (&a_p0[j_1]));
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				T21_ = (NI)0;
				T21_ = star___pureZalgorithm_u8(T20_, order_p6);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				if (!(T21_ <= ((NI)0))) goto LA22_;
				if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
				}
				if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
				}
				T24_ = b_p1[i_1];
				eqwasMoved___basicZversions_u3506((&b_p1[i_1]));
				eqsink___basicZversions_u3518((&a_p0[k_1]), (&T24_));
				if (nimAddInt(i_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_14)) { raiseOverflow(); goto BeforeRet_;
				};
				i_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_14);
			}
			goto LA18_;
LA22_: ;
			{
				tyObject_VersionTag__io9bcihbopiwucKorobyKdg T26_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_15;
				if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
				}
				if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
				}
				T26_ = a_p0[j_1];
				eqwasMoved___basicZversions_u3506((&a_p0[j_1]));
				eqsink___basicZversions_u3518((&a_p0[k_1]), (&T26_));
				if (nimAddInt(j_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_15)) { raiseOverflow(); goto BeforeRet_;
				};
				j_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_15);
			}
LA18_: ;
			if (nimAddInt(k_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_16)) { raiseOverflow(); goto BeforeRet_;
			};
			k_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_16);
		} LA15: ;
	}
	{
		while (1) {
			tyObject_VersionTag__io9bcihbopiwucKorobyKdg T29_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_17;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_18;
			if (!(k_1 < j_1)) goto LA28;
			if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
			}
			if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
			}
			T29_ = b_p1[i_1];
			eqwasMoved___basicZversions_u3506((&b_p1[i_1]));
			eqsink___basicZversions_u3518((&a_p0[k_1]), (&T29_));
			if (nimAddInt(k_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_17)) { raiseOverflow(); goto BeforeRet_;
			};
			k_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_17);
			if (nimAddInt(i_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_18)) { raiseOverflow(); goto BeforeRet_;
			};
			i_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_18);
		} LA28: ;
	}
	}BeforeRet_: ;
}
static N_INLINE(NF, toFloat__system_u1705)(NI 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, nimMulInt)(NI a_p0, NI b_p1, NI* res_p2) {
	NIM_BOOL result;
	NI r_1;
	NF floatProd_1;
	NF T1_;
	NF T2_;
	NF resAsFloat_1;
	result = (NIM_BOOL)0;
	r_1 = ((NI) ((NU)((NU64)(((NU) (a_p0))) * (NU64)(((NU) (b_p1))))));
	T1_ = (NF)0;
	T1_ = toFloat__system_u1705(a_p0);
	T2_ = (NF)0;
	T2_ = toFloat__system_u1705(b_p1);
	floatProd_1 = ((NF)(T1_) * (NF)(T2_));
	resAsFloat_1 = toFloat__system_u1705(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;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__basicZversions_u4639)(tyObject_VersionTag__io9bcihbopiwucKorobyKdg* a_p0, NI a_p0Len_0, tyProc__VRpJfpeaZqlQGq4cCdLVCA cmp_p1, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p2) {
	tySequence__ROG4zVH2lrODohp66awvUw b_1;
	NI n_1;
	NI s_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	b_1.len = 0; b_1.p = NIM_NIL;
	n_1 = a_p0Len_0;
	if (((NI)((n_1) / (((NI)2)))) < ((NI)0) || ((NI)((n_1) / (((NI)2)))) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)((n_1) / (((NI)2))), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	b_1 = newSeq__basicZversions_u4680(((NI)((n_1) / (((NI)2)))));
	s_1 = ((NI)1);
	{
		while (1) {
			NI m_1;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_3;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_4;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_24;
			if (!(s_1 < n_1)) goto LA2;
			if (nimSubInt(n_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_3)) { raiseOverflow(); goto BeforeRet_;
			};
			if (nimSubInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_3), s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_4)) { raiseOverflow(); goto BeforeRet_;
			};
			m_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_4);
			{
				while (1) {
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_19;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_20;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_21;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_22;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_23;
					if (!(((NI)0) <= m_1)) goto LA4;
					if (nimSubInt(m_1, s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_19)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimAddInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_19), ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_20)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimAddInt(m_1, s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_21)) { raiseOverflow(); goto BeforeRet_;
					};
					mergeAlt__basicZversions_u4822(a_p0, a_p0Len_0, ((b_1).p) ? (b_1.p->data) : NIM_NIL, b_1.len, (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_20) >= ((NI)0)) ? (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_20) : ((NI)0)), m_1, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_21), cmp_p1, order_p2);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					if (nimMulInt(s_1, ((NI)2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_22)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimSubInt(m_1, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_22), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_23)) { raiseOverflow(); goto BeforeRet_;
					};
					m_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_23);
				} LA4: ;
			}
			if (nimMulInt(s_1, ((NI)2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_24)) { raiseOverflow(); goto BeforeRet_;
			};
			s_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_24);
		} LA2: ;
	}
	eqdestroy___basicZversions_u4782(b_1);
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, reverse__dependencies_u45)(tyObject_VersionTag__io9bcihbopiwucKorobyKdg* a_p0, NI a_p0Len_0, NI first_p1, NI last_p2) {
	NI x_1;
	NI y_1;
{	x_1 = first_p1;
	y_1 = last_p2;
	{
		while (1) {
			tyObject_VersionTag__io9bcihbopiwucKorobyKdg T3_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_25;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_26;
			if (!(x_1 < y_1)) goto LA2;
			if (x_1 < 0 || x_1 >= a_p0Len_0){ raiseIndexError2(x_1,a_p0Len_0-1); goto BeforeRet_;
			}
			if (y_1 < 0 || y_1 >= a_p0Len_0){ raiseIndexError2(y_1,a_p0Len_0-1); goto BeforeRet_;
			}
			T3_ = a_p0[x_1];
			a_p0[x_1] = a_p0[y_1];
			a_p0[y_1] = T3_;
			if (nimSubInt(y_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_25)) { raiseOverflow(); goto BeforeRet_;
			};
			if (TM__JdC9c6SaUkvO1XjYuWP1JWQ_25 < 0 || TM__JdC9c6SaUkvO1XjYuWP1JWQ_25 > IL64(9223372036854775807)){ raiseOverflow(); goto BeforeRet_;
			}
			y_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_25);
			if (nimAddInt(x_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_26)) { raiseOverflow(); goto BeforeRet_;
			};
			if (TM__JdC9c6SaUkvO1XjYuWP1JWQ_26 < 0 || TM__JdC9c6SaUkvO1XjYuWP1JWQ_26 > IL64(9223372036854775807)){ raiseOverflow(); goto BeforeRet_;
			}
			x_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_26);
		} LA2: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, reverse__dependencies_u39)(tyObject_VersionTag__io9bcihbopiwucKorobyKdg* a_p0, NI a_p0Len_0) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	if ((((((NI)0) >= (a_p0Len_0-1)) ? ((NI)0) : (a_p0Len_0-1))) < ((NI)0) || (((((NI)0) >= (a_p0Len_0-1)) ? ((NI)0) : (a_p0Len_0-1))) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI(((((NI)0) >= (a_p0Len_0-1)) ? ((NI)0) : (a_p0Len_0-1)), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	reverse__dependencies_u45(a_p0, a_p0Len_0, ((NI)0), (((((NI)0) >= (a_p0Len_0-1)) ? ((NI)0) : (a_p0Len_0-1))));
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__depgraphs_u13180)(NI32* a_p0, NI a_p0Len_0, NI32* b_p1, NI b_p1Len_0, NI lo_p2, NI m_p3, NI hi_p4, tyProc__CBoNLvw7Pjo72NRN8hQDEA cmp_p5, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p6) {
	NI j_1;
	NI bb_1;
	NI i_1;
	NI k_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_29;
		NI T3_;
		NI T4_;
		if (m_p3 < 0 || m_p3 >= a_p0Len_0){ raiseIndexError2(m_p3,a_p0Len_0-1); goto BeforeRet_;
		}
		if (nimAddInt(m_p3, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_29)) { raiseOverflow(); goto BeforeRet_;
		};
		if ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_29) < 0 || (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_29) >= a_p0Len_0){ raiseIndexError2((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_29),a_p0Len_0-1); goto BeforeRet_;
		}
		T3_ = (NI)0;
		T3_ = cmp_p5.ClE_0? cmp_p5.ClP_0(a_p0[m_p3], a_p0[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_29)], cmp_p5.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_30)(cmp_p5.ClP_0))(a_p0[m_p3], a_p0[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_29)]);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_u8(T3_, order_p6);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!(T4_ <= ((NI)0))) goto LA5_;
		goto BeforeRet_;
	}
LA5_: ;
	j_1 = lo_p2;
	{
		if (!!((j_1 <= m_p3))) goto LA9_;
		failedAssertImpl__stdZassertions_u95(TM__JdC9c6SaUkvO1XjYuWP1JWQ_31);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA9_: ;
	bb_1 = ((NI)0);
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_32;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_33;
			if (!(j_1 <= m_p3)) goto LA12;
			if (bb_1 < 0 || bb_1 >= b_p1Len_0){ raiseIndexError2(bb_1,b_p1Len_0-1); goto BeforeRet_;
			}
			if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
			}
			b_p1[bb_1] = a_p0[j_1];
			eqwasMoved___OOZdistZsatZsrcZsatZsatvars_u223((&a_p0[j_1]));
			if (nimAddInt(bb_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_32)) { raiseOverflow(); goto BeforeRet_;
			};
			bb_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_32);
			if (nimAddInt(j_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_33)) { raiseOverflow(); goto BeforeRet_;
			};
			j_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_33);
		} LA12: ;
	}
	i_1 = ((NI)0);
	k_1 = lo_p2;
	{
		while (1) {
			NIM_BOOL T15_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_37;
			T15_ = (NIM_BOOL)0;
			T15_ = (k_1 < j_1);
			if (!(T15_)) goto LA16_;
			T15_ = (j_1 <= hi_p4);
LA16_: ;
			if (!T15_) goto LA14;
			{
				NI T19_;
				NI T20_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_35;
				if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
				}
				if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
				}
				T19_ = (NI)0;
				T19_ = cmp_p5.ClE_0? cmp_p5.ClP_0(b_p1[i_1], a_p0[j_1], cmp_p5.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_34)(cmp_p5.ClP_0))(b_p1[i_1], a_p0[j_1]);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				T20_ = (NI)0;
				T20_ = star___pureZalgorithm_u8(T19_, order_p6);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				if (!(T20_ <= ((NI)0))) goto LA21_;
				if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
				}
				if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
				}
				a_p0[k_1] = b_p1[i_1];
				eqwasMoved___OOZdistZsatZsrcZsatZsatvars_u223((&b_p1[i_1]));
				if (nimAddInt(i_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_35)) { raiseOverflow(); goto BeforeRet_;
				};
				i_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_35);
			}
			goto LA17_;
LA21_: ;
			{
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_36;
				if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
				}
				if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
				}
				a_p0[k_1] = a_p0[j_1];
				eqwasMoved___OOZdistZsatZsrcZsatZsatvars_u223((&a_p0[j_1]));
				if (nimAddInt(j_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_36)) { raiseOverflow(); goto BeforeRet_;
				};
				j_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_36);
			}
LA17_: ;
			if (nimAddInt(k_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_37)) { raiseOverflow(); goto BeforeRet_;
			};
			k_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_37);
		} LA14: ;
	}
	{
		while (1) {
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_38;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_39;
			if (!(k_1 < j_1)) goto LA25;
			if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
			}
			if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
			}
			a_p0[k_1] = b_p1[i_1];
			eqwasMoved___OOZdistZsatZsrcZsatZsatvars_u223((&b_p1[i_1]));
			if (nimAddInt(k_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_38)) { raiseOverflow(); goto BeforeRet_;
			};
			k_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_38);
			if (nimAddInt(i_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_39)) { raiseOverflow(); goto BeforeRet_;
			};
			i_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_39);
		} LA25: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__depgraphs_u13119)(NI32* a_p0, NI a_p0Len_0, tyProc__CBoNLvw7Pjo72NRN8hQDEA cmp_p1, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p2) {
	tySequence__48JTohSgTy339bRxHzUD8KA b_1;
	NI n_1;
	NI s_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	b_1.len = 0; b_1.p = NIM_NIL;
	n_1 = a_p0Len_0;
	if (((NI)((n_1) / (((NI)2)))) < ((NI)0) || ((NI)((n_1) / (((NI)2)))) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)((n_1) / (((NI)2))), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	b_1 = newSeq__depgraphs_u13160(((NI)((n_1) / (((NI)2)))));
	s_1 = ((NI)1);
	{
		while (1) {
			NI m_1;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_27;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_28;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_45;
			if (!(s_1 < n_1)) goto LA2;
			if (nimSubInt(n_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_27)) { raiseOverflow(); goto BeforeRet_;
			};
			if (nimSubInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_27), s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_28)) { raiseOverflow(); goto BeforeRet_;
			};
			m_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_28);
			{
				while (1) {
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_40;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_41;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_42;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_43;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_44;
					if (!(((NI)0) <= m_1)) goto LA4;
					if (nimSubInt(m_1, s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_40)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimAddInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_40), ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_41)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimAddInt(m_1, s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_42)) { raiseOverflow(); goto BeforeRet_;
					};
					mergeAlt__depgraphs_u13180(a_p0, a_p0Len_0, ((b_1).p) ? (b_1.p->data) : NIM_NIL, b_1.len, (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_41) >= ((NI)0)) ? (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_41) : ((NI)0)), m_1, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_42), cmp_p1, order_p2);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					if (nimMulInt(s_1, ((NI)2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_43)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimSubInt(m_1, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_43), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_44)) { raiseOverflow(); goto BeforeRet_;
					};
					m_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_44);
				} LA4: ;
			}
			if (nimMulInt(s_1, ((NI)2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_45)) { raiseOverflow(); goto BeforeRet_;
			};
			s_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_45);
		} LA2: ;
	}
	eqdestroy___depgraphs_u588(b_1);
	}BeforeRet_: ;
}
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(void, mergeAlt__depgraphs_u18639)(tyTuple__J4qYjN1oh0iSNXduwGtAfg* a_p0, NI a_p0Len_0, tyTuple__J4qYjN1oh0iSNXduwGtAfg* b_p1, NI b_p1Len_0, NI lo_p2, NI m_p3, NI hi_p4, tyProc__eqFE5VT3oFJNevHXF9bTkjw cmp_p5, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p6) {
	NI j_1;
	NI bb_1;
	NI i_1;
	NI k_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_48;
		NI T3_;
		NI T4_;
		if (m_p3 < 0 || m_p3 >= a_p0Len_0){ raiseIndexError2(m_p3,a_p0Len_0-1); goto BeforeRet_;
		}
		if (nimAddInt(m_p3, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_48)) { raiseOverflow(); goto BeforeRet_;
		};
		if ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_48) < 0 || (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_48) >= a_p0Len_0){ raiseIndexError2((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_48),a_p0Len_0-1); goto BeforeRet_;
		}
		T3_ = (NI)0;
		T3_ = cmp_p5.ClE_0? cmp_p5.ClP_0(a_p0[m_p3], a_p0[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_48)], cmp_p5.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_49)(cmp_p5.ClP_0))(a_p0[m_p3], a_p0[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_48)]);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_u8(T3_, order_p6);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!(T4_ <= ((NI)0))) goto LA5_;
		goto BeforeRet_;
	}
LA5_: ;
	j_1 = lo_p2;
	{
		if (!!((j_1 <= m_p3))) goto LA9_;
		failedAssertImpl__stdZassertions_u95(TM__JdC9c6SaUkvO1XjYuWP1JWQ_50);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA9_: ;
	bb_1 = ((NI)0);
	{
		while (1) {
			tyTuple__J4qYjN1oh0iSNXduwGtAfg T13_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_51;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_52;
			if (!(j_1 <= m_p3)) goto LA12;
			if (bb_1 < 0 || bb_1 >= b_p1Len_0){ raiseIndexError2(bb_1,b_p1Len_0-1); goto BeforeRet_;
			}
			if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
			}
			nimZeroMem((void*)(&T13_), sizeof(tyTuple__J4qYjN1oh0iSNXduwGtAfg));
			T13_.Field0 = a_p0[j_1].Field0;
			T13_.Field1 = a_p0[j_1].Field1;
			eqwasMoved___basicZdeptypes_u1999((&a_p0[j_1]));
			eqsink___basicZdeptypes_u2011((&b_p1[bb_1]), T13_);
			if (nimAddInt(bb_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_51)) { raiseOverflow(); goto BeforeRet_;
			};
			bb_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_51);
			if (nimAddInt(j_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_52)) { raiseOverflow(); goto BeforeRet_;
			};
			j_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_52);
		} LA12: ;
	}
	i_1 = ((NI)0);
	k_1 = lo_p2;
	{
		while (1) {
			NIM_BOOL T16_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_56;
			T16_ = (NIM_BOOL)0;
			T16_ = (k_1 < j_1);
			if (!(T16_)) goto LA17_;
			T16_ = (j_1 <= hi_p4);
LA17_: ;
			if (!T16_) goto LA15;
			{
				NI T20_;
				NI T21_;
				tyTuple__J4qYjN1oh0iSNXduwGtAfg T24_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_54;
				if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
				}
				if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
				}
				T20_ = (NI)0;
				T20_ = cmp_p5.ClE_0? cmp_p5.ClP_0(b_p1[i_1], a_p0[j_1], cmp_p5.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_53)(cmp_p5.ClP_0))(b_p1[i_1], a_p0[j_1]);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				T21_ = (NI)0;
				T21_ = star___pureZalgorithm_u8(T20_, order_p6);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				if (!(T21_ <= ((NI)0))) goto LA22_;
				if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
				}
				if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
				}
				nimZeroMem((void*)(&T24_), sizeof(tyTuple__J4qYjN1oh0iSNXduwGtAfg));
				T24_.Field0 = b_p1[i_1].Field0;
				T24_.Field1 = b_p1[i_1].Field1;
				eqwasMoved___basicZdeptypes_u1999((&b_p1[i_1]));
				eqsink___basicZdeptypes_u2011((&a_p0[k_1]), T24_);
				if (nimAddInt(i_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_54)) { raiseOverflow(); goto BeforeRet_;
				};
				i_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_54);
			}
			goto LA18_;
LA22_: ;
			{
				tyTuple__J4qYjN1oh0iSNXduwGtAfg T26_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_55;
				if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
				}
				if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
				}
				nimZeroMem((void*)(&T26_), sizeof(tyTuple__J4qYjN1oh0iSNXduwGtAfg));
				T26_.Field0 = a_p0[j_1].Field0;
				T26_.Field1 = a_p0[j_1].Field1;
				eqwasMoved___basicZdeptypes_u1999((&a_p0[j_1]));
				eqsink___basicZdeptypes_u2011((&a_p0[k_1]), T26_);
				if (nimAddInt(j_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_55)) { raiseOverflow(); goto BeforeRet_;
				};
				j_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_55);
			}
LA18_: ;
			if (nimAddInt(k_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_56)) { raiseOverflow(); goto BeforeRet_;
			};
			k_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_56);
		} LA15: ;
	}
	{
		while (1) {
			tyTuple__J4qYjN1oh0iSNXduwGtAfg T29_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_57;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_58;
			if (!(k_1 < j_1)) goto LA28;
			if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
			}
			if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
			}
			nimZeroMem((void*)(&T29_), sizeof(tyTuple__J4qYjN1oh0iSNXduwGtAfg));
			T29_.Field0 = b_p1[i_1].Field0;
			T29_.Field1 = b_p1[i_1].Field1;
			eqwasMoved___basicZdeptypes_u1999((&b_p1[i_1]));
			eqsink___basicZdeptypes_u2011((&a_p0[k_1]), T29_);
			if (nimAddInt(k_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_57)) { raiseOverflow(); goto BeforeRet_;
			};
			k_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_57);
			if (nimAddInt(i_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_58)) { raiseOverflow(); goto BeforeRet_;
			};
			i_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_58);
		} LA28: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__depgraphs_u18579)(tyTuple__J4qYjN1oh0iSNXduwGtAfg* a_p0, NI a_p0Len_0, tyProc__eqFE5VT3oFJNevHXF9bTkjw cmp_p1, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p2) {
	tySequence__fUCMBHW75OZPJePoPhOXNA b_1;
	NI n_1;
	NI s_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	b_1.len = 0; b_1.p = NIM_NIL;
	n_1 = a_p0Len_0;
	if (((NI)((n_1) / (((NI)2)))) < ((NI)0) || ((NI)((n_1) / (((NI)2)))) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)((n_1) / (((NI)2))), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	b_1 = newSeq__depgraphs_u18619(((NI)((n_1) / (((NI)2)))));
	s_1 = ((NI)1);
	{
		while (1) {
			NI m_1;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_46;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_47;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_64;
			if (!(s_1 < n_1)) goto LA2;
			if (nimSubInt(n_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_46)) { raiseOverflow(); goto BeforeRet_;
			};
			if (nimSubInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_46), s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_47)) { raiseOverflow(); goto BeforeRet_;
			};
			m_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_47);
			{
				while (1) {
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_59;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_60;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_61;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_62;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_63;
					if (!(((NI)0) <= m_1)) goto LA4;
					if (nimSubInt(m_1, s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_59)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimAddInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_59), ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_60)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimAddInt(m_1, s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_61)) { raiseOverflow(); goto BeforeRet_;
					};
					mergeAlt__depgraphs_u18639(a_p0, a_p0Len_0, ((b_1).p) ? (b_1.p->data) : NIM_NIL, b_1.len, (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_60) >= ((NI)0)) ? (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_60) : ((NI)0)), m_1, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_61), cmp_p1, order_p2);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					if (nimMulInt(s_1, ((NI)2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_62)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimSubInt(m_1, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_62), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_63)) { raiseOverflow(); goto BeforeRet_;
					};
					m_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_63);
				} LA4: ;
			}
			if (nimMulInt(s_1, ((NI)2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_64)) { raiseOverflow(); goto BeforeRet_;
			};
			s_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_64);
		} LA2: ;
	}
	eqdestroy___dependencies_u12042(b_1);
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, mergeAlt__depgraphs_u1535)(NimStringV2* a_p0, NI a_p0Len_0, NimStringV2* b_p1, NI b_p1Len_0, NI lo_p2, NI m_p3, NI hi_p4, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp_p5, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p6) {
	NI j_1;
	NI bb_1;
	NI i_1;
	NI k_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_67;
		NI T3_;
		NI T4_;
		if (m_p3 < 0 || m_p3 >= a_p0Len_0){ raiseIndexError2(m_p3,a_p0Len_0-1); goto BeforeRet_;
		}
		if (nimAddInt(m_p3, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_67)) { raiseOverflow(); goto BeforeRet_;
		};
		if ((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_67) < 0 || (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_67) >= a_p0Len_0){ raiseIndexError2((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_67),a_p0Len_0-1); goto BeforeRet_;
		}
		T3_ = (NI)0;
		T3_ = cmp_p5.ClE_0? cmp_p5.ClP_0(a_p0[m_p3], a_p0[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_67)], cmp_p5.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_68)(cmp_p5.ClP_0))(a_p0[m_p3], a_p0[(NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_67)]);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		T4_ = (NI)0;
		T4_ = star___pureZalgorithm_u8(T3_, order_p6);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!(T4_ <= ((NI)0))) goto LA5_;
		goto BeforeRet_;
	}
LA5_: ;
	j_1 = lo_p2;
	{
		if (!!((j_1 <= m_p3))) goto LA9_;
		failedAssertImpl__stdZassertions_u95(TM__JdC9c6SaUkvO1XjYuWP1JWQ_69);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA9_: ;
	bb_1 = ((NI)0);
	{
		while (1) {
			NimStringV2 T13_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_70;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_71;
			if (!(j_1 <= m_p3)) goto LA12;
			if (bb_1 < 0 || bb_1 >= b_p1Len_0){ raiseIndexError2(bb_1,b_p1Len_0-1); goto BeforeRet_;
			}
			if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
			}
			T13_.len = 0; T13_.p = NIM_NIL;
			T13_ = a_p0[j_1];
			eqwasMoved___system_u2751((&a_p0[j_1]));
			eqsink___system_u2760((&b_p1[bb_1]), T13_);
			if (nimAddInt(bb_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_70)) { raiseOverflow(); goto BeforeRet_;
			};
			bb_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_70);
			if (nimAddInt(j_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_71)) { raiseOverflow(); goto BeforeRet_;
			};
			j_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_71);
		} LA12: ;
	}
	i_1 = ((NI)0);
	k_1 = lo_p2;
	{
		while (1) {
			NIM_BOOL T16_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_75;
			T16_ = (NIM_BOOL)0;
			T16_ = (k_1 < j_1);
			if (!(T16_)) goto LA17_;
			T16_ = (j_1 <= hi_p4);
LA17_: ;
			if (!T16_) goto LA15;
			{
				NI T20_;
				NI T21_;
				NimStringV2 T24_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_73;
				if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
				}
				if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
				}
				T20_ = (NI)0;
				T20_ = cmp_p5.ClE_0? cmp_p5.ClP_0(b_p1[i_1], a_p0[j_1], cmp_p5.ClE_0):((TM__JdC9c6SaUkvO1XjYuWP1JWQ_72)(cmp_p5.ClP_0))(b_p1[i_1], a_p0[j_1]);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				T21_ = (NI)0;
				T21_ = star___pureZalgorithm_u8(T20_, order_p6);
				if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
				if (!(T21_ <= ((NI)0))) goto LA22_;
				if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
				}
				if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
				}
				T24_.len = 0; T24_.p = NIM_NIL;
				T24_ = b_p1[i_1];
				eqwasMoved___system_u2751((&b_p1[i_1]));
				eqsink___system_u2760((&a_p0[k_1]), T24_);
				if (nimAddInt(i_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_73)) { raiseOverflow(); goto BeforeRet_;
				};
				i_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_73);
			}
			goto LA18_;
LA22_: ;
			{
				NimStringV2 T26_;
				NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_74;
				if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
				}
				if (j_1 < 0 || j_1 >= a_p0Len_0){ raiseIndexError2(j_1,a_p0Len_0-1); goto BeforeRet_;
				}
				T26_.len = 0; T26_.p = NIM_NIL;
				T26_ = a_p0[j_1];
				eqwasMoved___system_u2751((&a_p0[j_1]));
				eqsink___system_u2760((&a_p0[k_1]), T26_);
				if (nimAddInt(j_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_74)) { raiseOverflow(); goto BeforeRet_;
				};
				j_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_74);
			}
LA18_: ;
			if (nimAddInt(k_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_75)) { raiseOverflow(); goto BeforeRet_;
			};
			k_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_75);
		} LA15: ;
	}
	{
		while (1) {
			NimStringV2 T29_;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_76;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_77;
			if (!(k_1 < j_1)) goto LA28;
			if (k_1 < 0 || k_1 >= a_p0Len_0){ raiseIndexError2(k_1,a_p0Len_0-1); goto BeforeRet_;
			}
			if (i_1 < 0 || i_1 >= b_p1Len_0){ raiseIndexError2(i_1,b_p1Len_0-1); goto BeforeRet_;
			}
			T29_.len = 0; T29_.p = NIM_NIL;
			T29_ = b_p1[i_1];
			eqwasMoved___system_u2751((&b_p1[i_1]));
			eqsink___system_u2760((&a_p0[k_1]), T29_);
			if (nimAddInt(k_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_76)) { raiseOverflow(); goto BeforeRet_;
			};
			k_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_76);
			if (nimAddInt(i_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_77)) { raiseOverflow(); goto BeforeRet_;
			};
			i_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_77);
		} LA28: ;
	}
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__depgraphs_u1488)(NimStringV2* a_p0, NI a_p0Len_0, tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA cmp_p1, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p2) {
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ b_1;
	NI n_1;
	NI s_1;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	b_1.len = 0; b_1.p = NIM_NIL;
	n_1 = a_p0Len_0;
	if (((NI)((n_1) / (((NI)2)))) < ((NI)0) || ((NI)((n_1) / (((NI)2)))) > ((NI)IL64(9223372036854775807))){ raiseRangeErrorI((NI)((n_1) / (((NI)2))), ((NI)0), ((NI)IL64(9223372036854775807))); goto BeforeRet_;
	}
	b_1 = newSeq__stdZsyncio_u578(((NI)((n_1) / (((NI)2)))));
	s_1 = ((NI)1);
	{
		while (1) {
			NI m_1;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_65;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_66;
			NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_83;
			if (!(s_1 < n_1)) goto LA2;
			if (nimSubInt(n_1, ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_65)) { raiseOverflow(); goto BeforeRet_;
			};
			if (nimSubInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_65), s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_66)) { raiseOverflow(); goto BeforeRet_;
			};
			m_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_66);
			{
				while (1) {
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_78;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_79;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_80;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_81;
					NI TM__JdC9c6SaUkvO1XjYuWP1JWQ_82;
					if (!(((NI)0) <= m_1)) goto LA4;
					if (nimSubInt(m_1, s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_78)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimAddInt((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_78), ((NI)1), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_79)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimAddInt(m_1, s_1, &TM__JdC9c6SaUkvO1XjYuWP1JWQ_80)) { raiseOverflow(); goto BeforeRet_;
					};
					mergeAlt__depgraphs_u1535(a_p0, a_p0Len_0, ((b_1).p) ? (b_1.p->data) : NIM_NIL, b_1.len, (((NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_79) >= ((NI)0)) ? (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_79) : ((NI)0)), m_1, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_80), cmp_p1, order_p2);
					if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
					if (nimMulInt(s_1, ((NI)2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_81)) { raiseOverflow(); goto BeforeRet_;
					};
					if (nimSubInt(m_1, (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_81), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_82)) { raiseOverflow(); goto BeforeRet_;
					};
					m_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_82);
				} LA4: ;
			}
			if (nimMulInt(s_1, ((NI)2), &TM__JdC9c6SaUkvO1XjYuWP1JWQ_83)) { raiseOverflow(); goto BeforeRet_;
			};
			s_1 = (NI)(TM__JdC9c6SaUkvO1XjYuWP1JWQ_83);
		} LA2: ;
	}
	eqdestroy___system_u5582(b_1);
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, sort__depgraphs_u1434)(NimStringV2* a_p0, NI a_p0Len_0, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_p1) {
	tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	nimZeroMem((void*)(&T1_), sizeof(tyProc__3pmh9bG9bLpdxUjFu9cDtbZaA));
	T1_.ClP_0 = ((TM__JdC9c6SaUkvO1XjYuWP1JWQ_84) (cmp__depgraphs_u1463)); T1_.ClE_0 = NIM_NIL;
	sort__depgraphs_u1488(a_p0, a_p0Len_0, T1_, order_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
}
