/* Generated by Nim Compiler v2.2.0 */ #define NIM_INTBITS 64 #include "nimbase.h" #include #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__PbS9a6gkxCuxWEnFq4lOU9aw[24]; typedef NIM_CHAR tyArray__38Z69amCaoywES5tRmClBSw[200]; 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_u175)(NimStringV2* result_p0, NU64 x_p1); static N_INLINE(void, addIntImpl__stdZprivateZdigitsutils_u55)(NimStringV2* result_p0, NU64 x_p1); static N_INLINE(void, addChars__stdZprivateZdigitsutils_u98)(NimStringV2* result_p0, tyArray__PbS9a6gkxCuxWEnFq4lOU9aw 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_u1726)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(void, nimCopyMem)(void* dest_p0, void* source_p1, NI size_p2); static N_INLINE(NIM_BOOL*, nimErrorFlag)(void); N_LIB_PRIVATE NIM_CONST tyArray__38Z69amCaoywES5tRmClBSw 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} ; extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u3579; 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_u1726)(void* dest_p0, void* source_p1, NI size_p2) { nimCopyMem(dest_p0, source_p1, size_p2); } static N_INLINE(void, addChars__stdZprivateZdigitsutils_u98)(NimStringV2* result_p0, tyArray__PbS9a6gkxCuxWEnFq4lOU9aw x_p1, NI start_p2, NI n_p3) { NI old; old = (*result_p0).len; setLengthStrV2((&(*result_p0)), ((NI)(old + n_p3))); copyMem__system_u1726(((void*) ((&(*result_p0).p->data[old]))), ((void*) ((&x_p1[(start_p2)- 0]))), (n_p3)); } static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) { NIM_BOOL* result; result = (&nimInErrorMode__system_u3579); return result; } static N_INLINE(void, addIntImpl__stdZprivateZdigitsutils_u55)(NimStringV2* result_p0, NU64 x_p1) { tyArray__PbS9a6gkxCuxWEnFq4lOU9aw tmp; NU64 num; NI next; NIM_BOOL* nimErr_; {nimErr_ = nimErrorFlag(); num = x_p1; next = ((NI)23); { while (1) { NU64 originNum; NI16 index; if (!((NU64)(100ULL) <= (NU64)(num))) goto LA2; originNum = num; num = (NU64)((NU64)(num) / (NU64)(100ULL)); index = ((NI16) ((NU64)((NU64)((NU64)((NU64)(originNum) - (NU64)((NU64)((NU64)(num) * (NU64)(100ULL))))) << (NU64)(((NI)1))))); tmp[(next)- 0] = digits100__stdZprivateZdigitsutils_u2[((NI16)(index + ((NI16)1)))- 0]; tmp[((NI)(next - ((NI)1)))- 0] = digits100__stdZprivateZdigitsutils_u2[(index)- 0]; next -= ((NI)2); } LA2: ; } { if (!((NU64)(num) < (NU64)(10ULL))) goto LA5_; tmp[(next)- 0] = ((NIM_CHAR) (((NI) ((NU8)((NU8)(((NU8)48)) + (NU8)(((NU8) (num)))))))); } goto LA3_; LA5_: ; { NU64 index_2; index_2 = (NU64)((NU64)(num) * (NU64)(2ULL)); tmp[(next)- 0] = digits100__stdZprivateZdigitsutils_u2[((NU64)((NU64)(index_2) + (NU64)(1ULL)))- 0]; tmp[((NI)(next - ((NI)1)))- 0] = digits100__stdZprivateZdigitsutils_u2[(index_2)- 0]; next -= ((NI)1); } LA3_: ; addChars__stdZprivateZdigitsutils_u98(result_p0, tmp, next, (NI)(((NI)24) - next)); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; } N_LIB_PRIVATE N_NIMCALL(void, addInt__stdZprivateZdigitsutils_u175)(NimStringV2* result_p0, NU64 x_p1) { NIM_BOOL* nimErr_; {nimErr_ = nimErrorFlag(); addIntImpl__stdZprivateZdigitsutils_u55(result_p0, x_p1); if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_; }BeforeRet_: ; } N_LIB_PRIVATE N_NIMCALL(void, addInt__stdZprivateZdigitsutils_u178)(NimStringV2* result_p0, NI64 x_p1) { NU64 numX60gensym3_; numX60gensym3_ = (NU64)0; { if (!(x_p1 < IL64(0))) goto LA3_; { if (!(x_p1 == (IL64(-9223372036854775807) - IL64(1)))) goto LA7_; numX60gensym3_ = ((NU64) (x_p1)); } goto LA5_; LA7_: ; { numX60gensym3_ = ((NU64) (-(x_p1))); } LA5_: ; nimAddCharV1((&(*result_p0)), 45); } goto LA1_; LA3_: ; { numX60gensym3_ = ((NU64) (x_p1)); } LA1_: ; addInt__stdZprivateZdigitsutils_u175(result_p0, numX60gensym3_); }