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

#include "nimbase.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 NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
struct NimStrPayload {
	NI cap;
	NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
	NI len;
	NimStrPayload* p;
};
typedef NIM_CHAR tyArray__7IqFqNilWasFWkDLjLKhqA[24];
typedef NIM_CHAR tyArray__wibmvjQ1EeuLKBPCOArWYQ[200];
typedef NI8 tyArray__XOZrHQUSCUwLl7PTrQGETw[100];
static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1);
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s_p0, NI addLen_p1);
N_LIB_PRIVATE N_NIMCALL(void, addInt__stdZprivateZdigitsutils_u184)(NimStringV2* result_p0, NU64 x_p1);
static N_INLINE(void, addIntImpl__stdZprivateZdigitsutils_u61)(NimStringV2* result_p0, NU64 x_p1);
static N_INLINE(void, addChars__stdZprivateZdigitsutils_u104)(NimStringV2* result_p0, tyArray__7IqFqNilWasFWkDLjLKhqA x_p1, NI start_p2, NI n_p3);
N_LIB_PRIVATE N_NIMCALL(void, setLengthStrV2)(NimStringV2* s_p0, NI newLen_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 NIM_CONST tyArray__wibmvjQ1EeuLKBPCOArWYQ digits100__stdZprivateZdigitsutils_u2 = {48,
48,
48,
49,
48,
50,
48,
51,
48,
52,
48,
53,
48,
54,
48,
55,
48,
56,
48,
57,
49,
48,
49,
49,
49,
50,
49,
51,
49,
52,
49,
53,
49,
54,
49,
55,
49,
56,
49,
57,
50,
48,
50,
49,
50,
50,
50,
51,
50,
52,
50,
53,
50,
54,
50,
55,
50,
56,
50,
57,
51,
48,
51,
49,
51,
50,
51,
51,
51,
52,
51,
53,
51,
54,
51,
55,
51,
56,
51,
57,
52,
48,
52,
49,
52,
50,
52,
51,
52,
52,
52,
53,
52,
54,
52,
55,
52,
56,
52,
57,
53,
48,
53,
49,
53,
50,
53,
51,
53,
52,
53,
53,
53,
54,
53,
55,
53,
56,
53,
57,
54,
48,
54,
49,
54,
50,
54,
51,
54,
52,
54,
53,
54,
54,
54,
55,
54,
56,
54,
57,
55,
48,
55,
49,
55,
50,
55,
51,
55,
52,
55,
53,
55,
54,
55,
55,
55,
56,
55,
57,
56,
48,
56,
49,
56,
50,
56,
51,
56,
52,
56,
53,
56,
54,
56,
55,
56,
56,
56,
57,
57,
48,
57,
49,
57,
50,
57,
51,
57,
52,
57,
53,
57,
54,
57,
55,
57,
56,
57,
57}
;
N_LIB_PRIVATE NIM_CONST tyArray__XOZrHQUSCUwLl7PTrQGETw trailingZeros100__stdZprivateZdigitsutils_u1 = {((NI8)2),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)1),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)1),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)1),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)1),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)1),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)1),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)1),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)1),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)1),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0),
((NI8)0)}
;
static N_INLINE(void, nimAddCharV1)(NimStringV2* s_p0, NIM_CHAR c_p1) {
	prepareAdd(s_p0, ((NI)1));
	(*(*s_p0).p).data[(*s_p0).len] = c_p1;
	(*s_p0).len += ((NI)1);
	(*(*s_p0).p).data[(*s_p0).len] = 0;
}
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, addChars__stdZprivateZdigitsutils_u104)(NimStringV2* result_p0, tyArray__7IqFqNilWasFWkDLjLKhqA x_p1, NI start_p2, NI n_p3) {
	NI old_1;
	old_1 = (*result_p0).len;
	setLengthStrV2((&(*result_p0)), ((NI)(old_1 + n_p3)));
	copyMem__system_u1755(((void*) ((&(*result_p0).p->data[old_1]))), ((void*) ((&x_p1[(start_p2)- 0]))), (n_p3));
}
static N_INLINE(void, addIntImpl__stdZprivateZdigitsutils_u61)(NimStringV2* result_p0, NU64 x_p1) {
	tyArray__7IqFqNilWasFWkDLjLKhqA tmp_1;
	NU64 num_1;
	NI next_1;
	num_1 = x_p1;
	next_1 = ((NI)23);
	{
		while (1) {
			NU64 originNum_1;
			NI16 index_1;
			if (!((NU64)(100ULL) <= (NU64)(num_1))) goto LA2;
			originNum_1 = num_1;
			num_1 = (NU64)((NU64)(num_1) / (NU64)(100ULL));
			index_1 = ((NI16) ((NU64)((NU64)((NU64)((NU64)(originNum_1) - (NU64)((NU64)((NU64)(num_1) * (NU64)(100ULL))))) << (NU64)(((NI)1) & (64 - 1)))));
			tmp_1[(next_1)- 0] = digits100__stdZprivateZdigitsutils_u2[((NI16)(index_1 + ((NI16)1)))- 0];
			tmp_1[((NI)(next_1 - ((NI)1)))- 0] = digits100__stdZprivateZdigitsutils_u2[(index_1)- 0];
			next_1 -= ((NI)2);
		} LA2: ;
	}
	{
		if (!((NU64)(num_1) < (NU64)(10ULL))) goto LA5_;
		tmp_1[(next_1)- 0] = ((NIM_CHAR) (((NI) ((NU8)((NU8)(((NU8)48)) + (NU8)(((NU8) (num_1))))))));
	}
	goto LA3_;
LA5_: ;
	{
		NU64 index_2;
		index_2 = (NU64)((NU64)(num_1) * (NU64)(2ULL));
		tmp_1[(next_1)- 0] = digits100__stdZprivateZdigitsutils_u2[((NU64)((NU64)(index_2) + (NU64)(1ULL)))- 0];
		tmp_1[((NI)(next_1 - ((NI)1)))- 0] = digits100__stdZprivateZdigitsutils_u2[(index_2)- 0];
		next_1 -= ((NI)1);
	}
LA3_: ;
	addChars__stdZprivateZdigitsutils_u104(result_p0, tmp_1, next_1, (NI)(((NI)24) - next_1));
}
N_LIB_PRIVATE N_NIMCALL(void, addInt__stdZprivateZdigitsutils_u184)(NimStringV2* result_p0, NU64 x_p1) {
	addIntImpl__stdZprivateZdigitsutils_u61(result_p0, x_p1);
}
N_LIB_PRIVATE N_NIMCALL(void, addInt__stdZprivateZdigitsutils_u187)(NimStringV2* result_p0, NI64 x_p1) {
	NU64 numX60gensym3__1;
	numX60gensym3__1 = (NU64)0;
	{
		if (!(x_p1 < IL64(0))) goto LA3_;
		{
			if (!(x_p1 == (IL64(-9223372036854775807) - IL64(1)))) goto LA7_;
			numX60gensym3__1 = ((NU64) (x_p1));
		}
		goto LA5_;
LA7_: ;
		{
			numX60gensym3__1 = ((NU64) (-(x_p1)));
		}
LA5_: ;
		nimAddCharV1((&(*result_p0)), 45);
	}
	goto LA1_;
LA3_: ;
	{
		numX60gensym3__1 = ((NU64) (x_p1));
	}
LA1_: ;
	addInt__stdZprivateZdigitsutils_u184(result_p0, numX60gensym3__1);
}
