/* 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/@mbasic@snimblechecksums.nim.c.o /Users/runner/work/nightlies/nightlies/nim-2.2.10/dist/atlas/.nimcache/@mbasic@snimblechecksums.nim.c */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks

#include "nimbase.h"
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ tySequence__sM4lkSb7zS6F7OVMvW9cffQ;
typedef struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content;
typedef struct tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
typedef struct tySequence__3EvzHGO0xyXGnJBUggwfKQ tySequence__3EvzHGO0xyXGnJBUggwfKQ;
typedef struct tySequence__3EvzHGO0xyXGnJBUggwfKQ_Content tySequence__3EvzHGO0xyXGnJBUggwfKQ_Content;
typedef struct tyObject_StackTraceEntry__lcKzdyiD6sm3eeh28rx7fw tyObject_StackTraceEntry__lcKzdyiD6sm3eeh28rx7fw;
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
typedef NimStringV2 tyArray__YgExxhfgKcesA5EOUj1MOA[1];
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ {
  NI len; tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content* p;
};
typedef NU8 tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw;
typedef NU32 tyArray__qEmXVe9a9cxQumtG9bM0PNunQ[5];
typedef NU8 tyArray__cPt4wmOc2JydnlcujLtYUg[64];
struct tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ {
	NI count;
	tyArray__qEmXVe9a9cxQumtG9bM0PNunQ state;
	tyArray__cPt4wmOc2JydnlcujLtYUg buf;
};
struct TNimTypeV2 {
	void* destructor;
	NI size;
	NI16 align;
	NI16 depth;
	NU32* display;
	void* traceImpl;
	void* typeInfoV1;
	NI flags;
	void* vTable[SEQ_DECL_SIZE];
};
struct RootObj {
	TNimTypeV2* m_type;
};
struct tySequence__3EvzHGO0xyXGnJBUggwfKQ {
  NI len; tySequence__3EvzHGO0xyXGnJBUggwfKQ_Content* p;
};
struct Exception {
	RootObj Sup;
	Exception* parent;
	NCSTRING name;
	NimStringV2 message;
	tySequence__3EvzHGO0xyXGnJBUggwfKQ trace;
	Exception* up;
};
typedef NU8 tyEnum_FileMode__wjF0STQGT1PBuQEl3p0tng;
typedef NU8 tyArray__9amPDC9cslxc3W1WNI8aK5gA[20];
struct tySequence__sM4lkSb7zS6F7OVMvW9cffQ_Content { NI cap; NimStringV2 data[SEQ_DECL_SIZE]; };
struct tyObject_StackTraceEntry__lcKzdyiD6sm3eeh28rx7fw {
	NCSTRING procname;
	NI line;
	NCSTRING filename;
};
struct tySequence__3EvzHGO0xyXGnJBUggwfKQ_Content { NI cap; tyObject_StackTraceEntry__lcKzdyiD6sm3eeh28rx7fw data[SEQ_DECL_SIZE]; };
static N_INLINE(NimStringV2, getCurrentDir__stdZpaths_u191)(void);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nosgetCurrentDir)(void);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, trace__basicZgitops_u1078)(NimStringV2 p_p0, NimStringV2* args_p1, NI args_p1Len_0);
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1);
static N_INLINE(void, copyMem__system_u1755)(void* dest_p0, void* source_p1, NI size_p2);
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, rawNewString)(NI space_p0);
static N_INLINE(void, setCurrentDir__stdZprivateZosdirs_u506)(NimStringV2 newDir_p0);
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NOINLINE(void, raiseOSError__stdZoserrors_u119)(NI32 errorCode_p0, NimStringV2 additionalInfo_p1);
N_LIB_PRIVATE N_NIMCALL(NI32, osLastError__stdZoserrors_u122)(void);
N_LIB_PRIVATE N_NIMCALL(tySequence__sM4lkSb7zS6F7OVMvW9cffQ, listFiles__basicZgitops_u863)(NimStringV2 path_p0);
N_LIB_PRIVATE N_NIMCALL(void, error__basicZgitops_u1259)(NimStringV2 p_p0, NimStringV2* args_p1, NI args_p1Len_0);
N_LIB_PRIVATE N_NIMCALL(void, sort__depgraphs_u1434)(NimStringV2* a_p0, NI a_p0Len_0, tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw order_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, newSha1State__stdZsha1_u10)(tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ* Result);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError2)(NI i_p0, NI n_p1);
N_LIB_PRIVATE N_NIMCALL(void, updateSecureHash__basicZnimblechecksums_u8)(tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ* checksum_p0, NimStringV2 name_p1, NimStringV2 path_p2);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nosfileExists)(NimStringV2 filename_p0);
N_LIB_PRIVATE N_NIMCALL(void, update__stdZsha1_u788)(tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ* ctx_p0, NIM_CHAR* data_p1, NI data_p1Len_0);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, nossymlinkExists)(NimStringV2 link_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, expandSymlink__stdZprivateZossymlinks_u16)(NimStringV2 symlinkPath_p0);
static N_INLINE(void, eqdestroy___system_u281)(NimStringV2 x_p0);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
static N_INLINE(NIM_BOOL, isObjDisplayCheck)(TNimTypeV2* source_p0, NI16 targetDepth_p1, NU32 token_p2);
static N_INLINE(Exception*, nimBorrowCurrentException)(void);
N_LIB_PRIVATE N_NIMCALL(void, error__basicZconfigutils_u107)(NimStringV2 p_p0, NimStringV2* args_p1, NI args_p1Len_0);
static N_INLINE(void, popCurrentException)(void);
N_LIB_PRIVATE N_NIMCALL(void, eqcopy___system_u3719)(Exception** dest_p0, Exception* src_p1, NIM_BOOL cyclic_p2);
N_LIB_PRIVATE N_NIMCALL(FILE*, open__stdZsyncio_u492)(NimStringV2 filename_p0, tyEnum_FileMode__wjF0STQGT1PBuQEl3p0tng mode_p1, NI bufSize_p2);
N_NIMCALL(NimStringV2, mnewString)(NI len_p0);
N_LIB_PRIVATE N_NIMCALL(NI, readChars__stdZsyncio_u177)(FILE* f_p0, NIM_CHAR* a_p1, NI a_p1Len_0);
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimPrepareStrMutationImpl__system_u2493)(NimStringV2* s_p0);
static N_INLINE(NIM_BOOL, nimSubInt)(NI a_p0, NI b_p1, NI* res_p2);
N_LIB_PRIVATE N_NOINLINE(void, raiseOverflow)(void);
N_LIB_PRIVATE N_NOINLINE(void, raiseIndexError4)(NI l1_p0, NI h1_p1, NI h2_p2);
N_LIB_PRIVATE N_NIMCALL(void, close__stdZsyncio_u269)(FILE* f_p0);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u95)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nsuToLowerAsciiStr)(NimStringV2 s_p0);
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___stdZsha1_u934)(tyArray__9amPDC9cslxc3W1WNI8aK5gA self_p0);
N_LIB_PRIVATE N_NIMCALL(void, finalize__stdZsha1_u835)(tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ* ctx_p0, tyArray__9amPDC9cslxc3W1WNI8aK5gA Result);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___system_u5582)(tySequence__sM4lkSb7zS6F7OVMvW9cffQ dest_p0);
static const struct {
  NI cap; NIM_CHAR data[26+1];
} TM__75NNnwTxG7l139c84Kv8WqA_2 = { 26 | NIM_STRLIT_FLAG, "Current directory is now: " };
static const NimStringV2 TM__75NNnwTxG7l139c84Kv8WqA_3 = {26, (NimStrPayload*)&TM__75NNnwTxG7l139c84Kv8WqA_2};
static const struct {
  NI cap; NIM_CHAR data[19+1];
} TM__75NNnwTxG7l139c84Kv8WqA_5 = { 19 | NIM_STRLIT_FLAG, "couldn\'t list files" };
static const struct {
  NI cap; NIM_CHAR data[28+1];
} TM__75NNnwTxG7l139c84Kv8WqA_6 = { 28 | NIM_STRLIT_FLAG, "cannot follow symbolic link " };
static const NimStringV2 TM__75NNnwTxG7l139c84Kv8WqA_7 = {28, (NimStrPayload*)&TM__75NNnwTxG7l139c84Kv8WqA_6};
static const struct {
  NI cap; NIM_CHAR data[19+1];
} TM__75NNnwTxG7l139c84Kv8WqA_9 = { 19 | NIM_STRLIT_FLAG, "error opening file " };
static const NimStringV2 TM__75NNnwTxG7l139c84Kv8WqA_10 = {19, (NimStrPayload*)&TM__75NNnwTxG7l139c84Kv8WqA_9};
static const struct {
  NI cap; NIM_CHAR data[90+1];
} TM__75NNnwTxG7l139c84Kv8WqA_11 = { 90 | NIM_STRLIT_FLAG, "iterators.nim(254, 11) `len(a) == L` the length of the seq changed while iterating over it" };
static const NimStringV2 TM__75NNnwTxG7l139c84Kv8WqA_12 = {90, (NimStrPayload*)&TM__75NNnwTxG7l139c84Kv8WqA_11};
static NIM_CONST tyArray__YgExxhfgKcesA5EOUj1MOA TM__75NNnwTxG7l139c84Kv8WqA_4 = {{19, (NimStrPayload*)&TM__75NNnwTxG7l139c84Kv8WqA_5}}
;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4198;
extern NIM_THREADVAR Exception* currException__system_u3686;
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
	NIM_BOOL* result;
	result = (&nimInErrorMode__system_u4198);
	return result;
}
static N_INLINE(NimStringV2, getCurrentDir__stdZpaths_u191)(void) {
	NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	result = nosgetCurrentDir();
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2) {
	void* T1_;
	T1_ = (void*)0;
	T1_ = memcpy(dest_p0, source_p1, ((size_t) (size_p2)));
}
static N_INLINE(void, copyMem__system_u1755)(void* dest_p0, void* source_p1, NI size_p2) {
	nimCopyMem(dest_p0, source_p1, size_p2);
}
static N_INLINE(void, appendString)(NimStringV2* dest_p0, NimStringV2 src_p1) {
	{
		if (!(((NI)0) < src_p1.len)) goto LA3_;
		copyMem__system_u1755(((void*) ((&(*(*dest_p0).p).data[(*dest_p0).len]))), ((void*) ((&(*src_p1.p).data[((NI)0)]))), (src_p1.len));
		(*dest_p0).len += src_p1.len;
		(*(*dest_p0).p).data[(*dest_p0).len] = 0;
	}
LA3_: ;
}
static N_INLINE(NCSTRING, nimToCStringConv)(NimStringV2 s_p0) {
	NCSTRING result;
	{
		if (!(s_p0.len == ((NI)0))) goto LA3_;
		result = "";
	}
	goto LA1_;
LA3_: ;
	{
		result = ((NCSTRING) ((*s_p0.p).data));
	}
LA1_: ;
	return result;
}
static N_INLINE(void, setCurrentDir__stdZprivateZosdirs_u506)(NimStringV2 newDir_p0) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		int T3_;
		NI32 T6_;
		T3_ = (int)0;
		T3_ = chdir(nimToCStringConv(newDir_p0));
		if (!!((T3_ == ((NI32)0)))) goto LA4_;
		T6_ = (NI32)0;
		T6_ = osLastError__stdZoserrors_u122();
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		raiseOSError__stdZoserrors_u119(T6_, newDir_p0);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA4_: ;
	}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);
}
static N_INLINE(void, eqdestroy___system_u281)(NimStringV2 x_p0) {
}
static N_INLINE(NIM_BOOL, isObjDisplayCheck)(TNimTypeV2* source_p0, NI16 targetDepth_p1, NU32 token_p2) {
	NIM_BOOL result;
	NIM_BOOL T1_;
	T1_ = (NIM_BOOL)0;
	T1_ = (targetDepth_p1 <= (*source_p0).depth);
	if (!(T1_)) goto LA2_;
	T1_ = ((*source_p0).display[targetDepth_p1] == token_p2);
LA2_: ;
	result = T1_;
	return result;
}
static N_INLINE(Exception*, nimBorrowCurrentException)(void) {
	Exception* result;
	result = currException__system_u3686;
	return result;
}
static N_INLINE(void, popCurrentException)(void) {
	eqcopy___system_u3719(&currException__system_u3686, (*currException__system_u3686).up, NIM_FALSE);
}
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s_p0) {
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = !(((*s_p0).p == ((NimStrPayload*) NIM_NIL)));
		if (!(T3_)) goto LA4_;
		T3_ = ((NI)((*(*s_p0).p).cap & ((NI)IL64(4611686018427387904))) == ((NI)IL64(4611686018427387904)));
LA4_: ;
		if (!T3_) goto LA5_;
		nimPrepareStrMutationImpl__system_u2493(s_p0);
	}
LA5_: ;
}
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;
}
N_LIB_PRIVATE N_NIMCALL(void, updateSecureHash__basicZnimblechecksums_u8)(tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ* checksum_p0, NimStringV2 name_p1, NimStringV2 path_p2) {
NIM_BOOL oldNimErrFin25_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = nosfileExists(path_p2);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!!(T3_)) goto LA4_;
		goto BeforeRet_;
	}
LA4_: ;
	update__stdZsha1_u788(checksum_p0, ((name_p1).p) ? (name_p1.p->data) : NIM_NIL, name_p1.len);
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	{
		NIM_BOOL T8_;
		NimStringV2 path_2;
		NimStringV2 T13_;
		T8_ = (NIM_BOOL)0;
		T8_ = nossymlinkExists(path_p2);
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
		if (!T8_) goto LA9_;
		path_2.len = 0; path_2.p = NIM_NIL;
		T13_.len = 0; T13_.p = NIM_NIL;
		T13_ = expandSymlink__stdZprivateZossymlinks_u16(path_p2);
		if (NIM_UNLIKELY(*nimErr_)) {eqdestroy___system_u281(T13_); goto LA12_;}
		path_2 = T13_;
		update__stdZsha1_u788(checksum_p0, ((path_2).p) ? (path_2.p->data) : NIM_NIL, path_2.len);
		if (NIM_UNLIKELY(*nimErr_)) goto LA12_;
		{
			LA12_:;
		}
		{
			if (path_2.p && !(path_2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(path_2.p);
}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto LA11_;
		if (NIM_UNLIKELY(*nimErr_)) {
			LA11_:;
			if (isObjDisplayCheck(nimBorrowCurrentException()->Sup.m_type, 3, 1079566592)) {
				NimStringV2 colontmpD_;
				tyArray__YgExxhfgKcesA5EOUj1MOA T20_;
				NimStringV2 T21_;
				*nimErr_ = NIM_FALSE;
				colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
				T21_.len = 0; T21_.p = NIM_NIL;
				T21_ = rawNewString(path_p2.len + 28);
appendString((&T21_), TM__75NNnwTxG7l139c84Kv8WqA_7);
appendString((&T21_), path_p2);
				colontmpD_ = T21_;
				T20_[0] = colontmpD_;
				error__basicZconfigutils_u107(name_p1, T20_, 1);
				if (NIM_UNLIKELY(*nimErr_)) goto LA19_;
				{
					LA19_:;
				}
				{
					if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
				}
				if (NIM_UNLIKELY(*nimErr_)) goto LA17_;
				popCurrentException();
				LA17_:;
			}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
	goto LA6_;
LA9_: ;
	{
		FILE* file_1;
		NimStringV2 buffer_1;
		FILE* T27_;
		file_1 = (FILE*)0;
		buffer_1.len = 0; buffer_1.p = NIM_NIL;
		T27_ = (FILE*)0;
		T27_ = open__stdZsyncio_u492(path_p2, ((tyEnum_FileMode__wjF0STQGT1PBuQEl3p0tng)0), ((NI)-1));
		if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
		file_1 = T27_;
		buffer_1 = mnewString(((NI)8192));
		{
			while (1) {
				NI bytesRead_1;
				NI T30_;
				NI TM__75NNnwTxG7l139c84Kv8WqA_8;
				nimPrepareStrMutationV2((&buffer_1));
				T30_ = (NI)0;
				T30_ = readChars__stdZsyncio_u177(file_1, ((buffer_1).p) ? (buffer_1.p->data) : NIM_NIL, buffer_1.len);
				if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
				bytesRead_1 = T30_;
				{
					if (!(bytesRead_1 == ((NI)0))) goto LA33_;
					goto LA28;
				}
LA33_: ;
				if (nimSubInt(bytesRead_1, ((NI)1), &TM__75NNnwTxG7l139c84Kv8WqA_8)) { raiseOverflow(); goto LA26_;
				};
				if ((NI)(TM__75NNnwTxG7l139c84Kv8WqA_8)-((NI)0) != -1 && (((NI)0) < 0 || ((NI)0) >= buffer_1.len || (NI)(TM__75NNnwTxG7l139c84Kv8WqA_8) < 0 || (NI)(TM__75NNnwTxG7l139c84Kv8WqA_8) >= buffer_1.len)){ raiseIndexError4(((NI)0), (NI)(TM__75NNnwTxG7l139c84Kv8WqA_8), buffer_1.len); goto LA26_;
				}
				update__stdZsha1_u788(checksum_p0, (((buffer_1).p) ? ((NIM_CHAR*)buffer_1.p->data+(((NI)0))) : NIM_NIL), ((NI)(TM__75NNnwTxG7l139c84Kv8WqA_8))-(((NI)0))+1);
				if (NIM_UNLIKELY(*nimErr_)) goto LA26_;
			}
		} LA28: ;
		{
			LA26_:;
		}
		{
			if (buffer_1.p && !(buffer_1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(buffer_1.p);
}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto LA25_;
		if (NIM_UNLIKELY(*nimErr_)) {
			LA25_:;
			if (isObjDisplayCheck(nimBorrowCurrentException()->Sup.m_type, 3, 3275107584)) {
				NimStringV2 colontmpD__2;
				tyArray__YgExxhfgKcesA5EOUj1MOA T41_;
				NimStringV2 T42_;
				*nimErr_ = NIM_FALSE;
				colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
				T42_.len = 0; T42_.p = NIM_NIL;
				T42_ = rawNewString(path_p2.len + 19);
appendString((&T42_), TM__75NNnwTxG7l139c84Kv8WqA_10);
appendString((&T42_), path_p2);
				colontmpD__2 = T42_;
				T41_[0] = colontmpD__2;
				error__basicZconfigutils_u107(name_p1, T41_, 1);
				if (NIM_UNLIKELY(*nimErr_)) goto LA40_;
				{
					LA40_:;
				}
				{
					if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD__2.p);
}
				}
				if (NIM_UNLIKELY(*nimErr_)) goto LA38_;
				popCurrentException();
				LA38_:;
			}
		}
		{
			oldNimErrFin25_ = *nimErr_; *nimErr_ = NIM_FALSE;
			close__stdZsyncio_u269(file_1);
			if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
			*nimErr_ = oldNimErrFin25_;
		}
		if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}
LA6_: ;
	}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, nimbleChecksum__basicZnimblechecksums_u25)(NimStringV2 name_p0, NimStringV2 path_p1) {
	NimStringV2 result;
	NimStringV2 oldDirX60gensym0__1;
	NimStringV2 colontmpD_;
	tyArray__YgExxhfgKcesA5EOUj1MOA T2_;
	NimStringV2 T3_;
	tySequence__sM4lkSb7zS6F7OVMvW9cffQ files_1;
NIM_BOOL oldNimErrFin4_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
	result.len = 0; result.p = NIM_NIL;
	oldDirX60gensym0__1.len = 0; oldDirX60gensym0__1.p = NIM_NIL;
	colontmpD_.len = 0; colontmpD_.p = NIM_NIL;
	oldDirX60gensym0__1 = getCurrentDir__stdZpaths_u191();
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	T3_.len = 0; T3_.p = NIM_NIL;
	T3_ = rawNewString(path_p1.len + 26);
appendString((&T3_), TM__75NNnwTxG7l139c84Kv8WqA_3);
appendString((&T3_), path_p1);
	colontmpD_ = T3_;
	T2_[0] = colontmpD_;
	trace__basicZgitops_u1078(path_p1, T2_, 1);
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	files_1.len = 0; files_1.p = NIM_NIL;
	setCurrentDir__stdZprivateZosdirs_u506(path_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
	files_1 = listFiles__basicZgitops_u863(path_p1);
	if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
	{
		NI T8_;
		T8_ = files_1.len;
		if (!(T8_ == ((NI)0))) goto LA9_;
		error__basicZgitops_u1259(path_p1, TM__75NNnwTxG7l139c84Kv8WqA_4, 1);
		if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
	}
	goto LA6_;
LA9_: ;
	{
		NimStringV2 colontmpD__2;
		tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ checksum_1;
		tyArray__9amPDC9cslxc3W1WNI8aK5gA T22_;
		colontmpD__2.len = 0; colontmpD__2.p = NIM_NIL;
		sort__depgraphs_u1434(((files_1).p) ? (files_1.p->data) : NIM_NIL, files_1.len, ((tyEnum_SortOrder__9arxXsrA69cTRa9cGZkutSbcw)1));
		if (NIM_UNLIKELY(*nimErr_)) goto LA12_;
		nimZeroMem((void*)(&checksum_1), sizeof(tyObject_Sha1State__JIoJIk9cyhLcV9appRPaP4dQ));
		newSha1State__stdZsha1_u10((&checksum_1));
		if (NIM_UNLIKELY(*nimErr_)) goto LA12_;
		{
			NimStringV2* file_1;
			NI i_1;
			NI L_1;
			NI T14_;
			file_1 = (NimStringV2*)0;
			i_1 = ((NI)0);
			T14_ = files_1.len;
			L_1 = T14_;
			{
				while (1) {
					if (!(i_1 < L_1)) goto LA16;
					if (i_1 < 0 || i_1 >= files_1.len){ raiseIndexError2(i_1,files_1.len-1); goto LA12_;
					}
					file_1 = (&files_1.p->data[i_1]);
					updateSecureHash__basicZnimblechecksums_u8((&checksum_1), name_p0, (*file_1));
					if (NIM_UNLIKELY(*nimErr_)) goto LA12_;
					i_1 += ((NI)1);
					{
						NI T19_;
						T19_ = files_1.len;
						if (!!((T19_ == L_1))) goto LA20_;
						failedAssertImpl__stdZassertions_u95(TM__75NNnwTxG7l139c84Kv8WqA_12);
						if (NIM_UNLIKELY(*nimErr_)) goto LA12_;
					}
LA20_: ;
				} LA16: ;
			}
		}
		nimZeroMem((void*)T22_, sizeof(tyArray__9amPDC9cslxc3W1WNI8aK5gA));
		finalize__stdZsha1_u835((&checksum_1), T22_);
		if (NIM_UNLIKELY(*nimErr_)) goto LA12_;
		colontmpD__2 = dollar___stdZsha1_u934(T22_);
		if (NIM_UNLIKELY(*nimErr_)) goto LA12_;
		result = nsuToLowerAsciiStr(colontmpD__2);
		if (NIM_UNLIKELY(*nimErr_)) goto LA12_;
		{
			LA12_:;
		}
		{
			if (colontmpD__2.p && !(colontmpD__2.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD__2.p);
}
		}
		if (NIM_UNLIKELY(*nimErr_)) goto LA5_;
	}
LA6_: ;
	{
		LA5_:;
	}
	{
		eqdestroy___system_u5582(files_1);
	}
	if (NIM_UNLIKELY(*nimErr_)) goto LA4_;
	{
		LA4_:;
	}
	{
		oldNimErrFin4_ = *nimErr_; *nimErr_ = NIM_FALSE;
		setCurrentDir__stdZprivateZosdirs_u506(oldDirX60gensym0__1);
		if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
		*nimErr_ = oldNimErrFin4_;
	}
	if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
	{
		LA1_:;
	}
	{
		if (colontmpD_.p && !(colontmpD_.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(colontmpD_.p);
}
		if (oldDirX60gensym0__1.p && !(oldDirX60gensym0__1.p->cap & NIM_STRLIT_FLAG)) {
 deallocShared(oldDirX60gensym0__1.p);
}
	}
	if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
	}BeforeRet_: ;
	return result;
}
