csources_v2/c_code/5_17/@mint128.nim.c
2022-12-16 10:54:01 +08:00

1632 lines
59 KiB
C

/* Generated by Nim Compiler v1.9.0 */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks
#include "nimbase.h"
#include <string.h>
#include <math.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
#define nimfr_(x, y)
#define nimln_(x, y)
typedef struct tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyTuple__HVa32PrTYbu9ceK7jTbXR9aA tyTuple__HVa32PrTYbu9ceK7jTbXR9aA;
typedef NU32 tyArray__FleBT9cC2nxhgiXmSYYnEKA[4];
struct tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg {
tyArray__FleBT9cC2nxhgiXmSYYnEKA udata;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tyTuple__HVa32PrTYbu9ceK7jTbXR9aA {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg Field0;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg Field1;
};
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__int495056_283)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__int495056_287)(NI32 x, NI32 y);
N_LIB_PRIVATE N_NIMCALL(NI, cmp__int495056_293)(NU32 x, NU32 y);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__int495056_737)(NI64 arg);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq___int495056_317)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, plus___int495056_450)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, minus___int495056_473)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, bitnot__int495056_321)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a);
N_LIB_PRIVATE N_NIMCALL(void, inc__int495056_252)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg* a, NU32 y);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_224)(NimStringV2 msg);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, minus___int495056_476)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b);
N_LIB_PRIVATE N_NIMCALL(NU64, bitconcat__int495056_69)(NU32 a, NU32 b);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, star___int495056_489)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NU32 b);
N_LIB_PRIVATE N_NIMCALL(NI, abs__int495056_486)(NI32 a);
static N_INLINE(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, maskUInt8__int495056_859)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg);
static N_INLINE(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, maskUInt16__int495056_856)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg);
static N_INLINE(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, maskUInt32__int495056_853)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg);
static N_INLINE(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, maskUInt64__int495056_850)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, makeInt128__int495056_524)(NU64 high, NU64 low);
N_LIB_PRIVATE N_NIMCALL(NU64, high64__int495056_536)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a);
N_LIB_PRIVATE N_NIMCALL(NU64, low64__int495056_539)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a);
N_LIB_PRIVATE N_NIMCALL(void, pluseq___int495056_470)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg* a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, shl__int495056_381)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI b);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__int495056_550)(NU64 arg);
N_LIB_PRIVATE N_NIMCALL(void, divMod__int495056_595)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg dividend, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg divisor, tyTuple__HVa32PrTYbu9ceK7jTbXR9aA* Result);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, abs__int495056_483)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lt___int495056_309)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b);
N_LIB_PRIVATE N_NIMCALL(NI, fastLog2__int495056_569)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a);
static N_INLINE(NI, fastLog2__int495056_572)(NU32 x);
N_CDECL(int, __builtin_clz)(unsigned int x);
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lteq___int495056_313)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b);
N_LIB_PRIVATE N_NIMCALL(void, minuseq___int495056_480)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg* a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, bitor__int495056_328)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b);
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, shr__int495056_336)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI b);
N_NIMCALL(NimStringV2, rawNewString)(NI cap);
N_LIB_PRIVATE N_NIMCALL(void, addInt128__int495056_640)(NimStringV2* result, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg value);
static N_INLINE(void, nimAddCharV1)(NimStringV2* s, NIM_CHAR c);
N_LIB_PRIVATE N_NIMCALL(void, prepareAdd)(NimStringV2* s, NI addlen);
static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src);
static N_INLINE(void, copyMem__system_1719)(void* dest, void* source, NI size);
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size);
N_LIB_PRIVATE N_NIMCALL(NI64, toInt64__int495056_77)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg);
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s);
N_LIB_PRIVATE N_NIMCALL(void, nimPrepareStrMutationImpl__system_2301)(NimStringV2* s);
static N_INLINE(NF, abs__system_4699)(NF x);
static const struct {
NI cap; NIM_CHAR data[55+1];
} TM__j3e9cBE1r9bNswX4zGWzjSfQ_2 = { 55 | NIM_STRLIT_FLAG, "int128.nim(183, 17) `a.sdata(3) != low(int32)` overflow" };
static const NimStringV2 TM__j3e9cBE1r9bNswX4zGWzjSfQ_3 = {55, (NimStrPayload*)&TM__j3e9cBE1r9bNswX4zGWzjSfQ_2};
static const struct {
NI cap; NIM_CHAR data[40+1];
} TM__j3e9cBE1r9bNswX4zGWzjSfQ_4 = { 40 | NIM_STRLIT_FLAG, "-170141183460469231731687303715884105728" };
static const NimStringV2 TM__j3e9cBE1r9bNswX4zGWzjSfQ_5 = {40, (NimStrPayload*)&TM__j3e9cBE1r9bNswX4zGWzjSfQ_4};
static const struct {
NI cap; NIM_CHAR data[10+1];
} TM__j3e9cBE1r9bNswX4zGWzjSfQ_6 = { 10 | NIM_STRLIT_FLAG, "0123456789" };
static const NimStringV2 TM__j3e9cBE1r9bNswX4zGWzjSfQ_7 = {10, (NimStrPayload*)&TM__j3e9cBE1r9bNswX4zGWzjSfQ_6};
N_LIB_PRIVATE NIM_CONST tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg Zero__int495056_8 = {{((NU32)0),
((NU32)0),
((NU32)0),
((NU32)0)}
}
;
N_LIB_PRIVATE NIM_CONST tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg Max__int495056_28 = {{((NU32)IL64(4294967295)),
((NU32)IL64(4294967295)),
((NU32)IL64(4294967295)),
((NU32)2147483647)}
}
;
N_LIB_PRIVATE NIM_CONST tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg One__int495056_9 = {{((NU32)1),
((NU32)0),
((NU32)0),
((NU32)0)}
}
;
N_LIB_PRIVATE NIM_CONST tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg NegOne__int495056_29 = {{((NU32)IL64(4294967295)),
((NU32)IL64(4294967295)),
((NU32)IL64(4294967295)),
((NU32)IL64(4294967295))}
}
;
N_LIB_PRIVATE NIM_CONST tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg Min__int495056_11 = {{((NU32)0),
((NU32)0),
((NU32)0),
((NU32)IL64(2147483648))}
}
;
N_LIB_PRIVATE NIM_CONST tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg Ten__int495056_10 = {{((NU32)10),
((NU32)0),
((NU32)0),
((NU32)0)}
}
;
extern NIM_BOOL nimInErrorMode__system_3994;
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq___int495056_317)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
NIM_BOOL result;
{ result = (NIM_BOOL)0;
{
if (!!((a.udata[(((NI)0))- 0] == b.udata[(((NI)0))- 0]))) goto LA3_;
result = NIM_FALSE;
goto BeforeRet_;
}
LA3_: ;
{
if (!!((a.udata[(((NI)1))- 0] == b.udata[(((NI)1))- 0]))) goto LA7_;
result = NIM_FALSE;
goto BeforeRet_;
}
LA7_: ;
{
if (!!((a.udata[(((NI)2))- 0] == b.udata[(((NI)2))- 0]))) goto LA11_;
result = NIM_FALSE;
goto BeforeRet_;
}
LA11_: ;
{
if (!!((a.udata[(((NI)3))- 0] == b.udata[(((NI)3))- 0]))) goto LA15_;
result = NIM_FALSE;
goto BeforeRet_;
}
LA15_: ;
result = NIM_TRUE;
goto BeforeRet_;
}BeforeRet_: ;
return result;
}
static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__system_3994);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__systemZmemory_7(p, ((int)0), size);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__int495056_550)(NU64 arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = ((NU32) ((NU64)(arg & 4294967295ULL)));
result.udata[(((NI)1))- 0] = ((NU32) ((NU64)((NU64)(arg) >> (NU64)(((NI)32)))));
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__int495056_737)(NI64 arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NI64 tmp;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
tmp = arg;
result.udata[(((NI)0))- 0] = ((NU32) ((NI64)(tmp & IL64(4294967295))));
(*((NI32*) ((&result.udata[(((NI)1))- 0])))) = ((NI32) ((NI64)((NI64)(tmp) >> (NU64)(((NI)32)))));
{
if (!(arg < IL64(0))) goto LA3_;
(*((NI32*) ((&result.udata[(((NI)2))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)3))- 0])))) = ((NI32)-1);
}
LA3_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__types_1401)(NI arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NI64 tmp;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
tmp = ((NI64) (arg));
result.udata[(((NI)0))- 0] = ((NU32) ((NI64)(tmp & IL64(4294967295))));
(*((NI32*) ((&result.udata[(((NI)1))- 0])))) = ((NI32) ((NI64)((NI64)(tmp) >> (NU64)(((NI)32)))));
{
if (!(arg < ((NI)0))) goto LA3_;
(*((NI32*) ((&result.udata[(((NI)2))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)3))- 0])))) = ((NI32)-1);
}
LA3_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__types_1513)(NU arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = ((NU32) ((NU)(arg & ((NU)IL64(4294967295)))));
result.udata[(((NI)1))- 0] = ((NU32) ((NU)((NU64)(arg) >> (NU64)(((NI)32)))));
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, cmp__int495056_283)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
NI result;
NI tmp1;
NI tmp2;
NI tmp3;
NI tmp4;
{ result = (NI)0;
tmp1 = cmp__int495056_287((*((NI32*) ((&a.udata[(((NI)3))- 0])))), (*((NI32*) ((&b.udata[(((NI)3))- 0])))));
{
if (!!((tmp1 == ((NI)0)))) goto LA3_;
result = tmp1;
goto BeforeRet_;
}
LA3_: ;
tmp2 = cmp__int495056_293(a.udata[(((NI)2))- 0], b.udata[(((NI)2))- 0]);
{
if (!!((tmp2 == ((NI)0)))) goto LA7_;
result = tmp2;
goto BeforeRet_;
}
LA7_: ;
tmp3 = cmp__int495056_293(a.udata[(((NI)1))- 0], b.udata[(((NI)1))- 0]);
{
if (!!((tmp3 == ((NI)0)))) goto LA11_;
result = tmp3;
goto BeforeRet_;
}
LA11_: ;
tmp4 = cmp__int495056_293(a.udata[(((NI)0))- 0], b.udata[(((NI)0))- 0]);
result = tmp4;
goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lteq___int495056_313)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
NIM_BOOL result;
NI T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
T1_ = (NI)0;
T1_ = cmp__int495056_283(a, b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = (T1_ <= ((NI)0));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lteq___int495056_757)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI64 b) {
NIM_BOOL result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NI T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
T1_ = toInt128__int495056_737(b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T2_ = (NI)0;
T2_ = cmp__int495056_283(a, T1_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = (T2_ <= ((NI)0));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lteq___int495056_764)(NI64 a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
NIM_BOOL result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NI T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
T1_ = toInt128__int495056_737(a);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T2_ = (NI)0;
T2_ = cmp__int495056_283(T1_, b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = (T2_ <= ((NI)0));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq___int495056_771)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI64 b) {
NIM_BOOL result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
T1_ = toInt128__int495056_737(b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = eqeq___int495056_317(a, T1_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, plus___int495056_450)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NU64 tmp0;
NU64 tmp1;
NU64 tmp2;
NU64 tmp3;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
tmp0 = (NU64)((NU64)(((NU64) (a.udata[(((NI)0))- 0]))) + (NU64)(((NU64) (b.udata[(((NI)0))- 0]))));
result.udata[(((NI)0))- 0] = ((NU32) (tmp0));
tmp1 = (NU64)((NU64)((NU64)((NU64)(((NU64) (a.udata[(((NI)1))- 0]))) + (NU64)(((NU64) (b.udata[(((NI)1))- 0]))))) + (NU64)((NU64)((NU64)(tmp0) >> (NU64)(((NI)32)))));
result.udata[(((NI)1))- 0] = ((NU32) (tmp1));
tmp2 = (NU64)((NU64)((NU64)((NU64)(((NU64) (a.udata[(((NI)2))- 0]))) + (NU64)(((NU64) (b.udata[(((NI)2))- 0]))))) + (NU64)((NU64)((NU64)(tmp1) >> (NU64)(((NI)32)))));
result.udata[(((NI)2))- 0] = ((NU32) (tmp2));
tmp3 = (NU64)((NU64)((NU64)((NU64)(((NU64) (a.udata[(((NI)3))- 0]))) + (NU64)(((NU64) (b.udata[(((NI)3))- 0]))))) + (NU64)((NU64)((NU64)(tmp2) >> (NU64)(((NI)32)))));
result.udata[(((NI)3))- 0] = ((NU32) (tmp3));
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, bitnot__int495056_321)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = (NU32)((NU32) ~(a.udata[(((NI)0))- 0]));
result.udata[(((NI)1))- 0] = (NU32)((NU32) ~(a.udata[(((NI)1))- 0]));
result.udata[(((NI)2))- 0] = (NU32)((NU32) ~(a.udata[(((NI)2))- 0]));
result.udata[(((NI)3))- 0] = (NU32)((NU32) ~(a.udata[(((NI)3))- 0]));
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, inc__int495056_252)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg* a, NU32 y) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
(*a).udata[(((NI)0))- 0] += y;
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = NIM_UNLIKELY(((NU32)((*a).udata[(((NI)0))- 0]) < (NU32)(y)));
if (!T3_) goto LA4_;
(*a).udata[(((NI)1))- 0] += ((NI)1);
{
NIM_BOOL T8_;
T8_ = (NIM_BOOL)0;
T8_ = NIM_UNLIKELY(((*a).udata[(((NI)1))- 0] == ((NU32)0)));
if (!T8_) goto LA9_;
(*a).udata[(((NI)2))- 0] += ((NI)1);
{
NIM_BOOL T13_;
T13_ = (NIM_BOOL)0;
T13_ = NIM_UNLIKELY(((*a).udata[(((NI)2))- 0] == ((NU32)0)));
if (!T13_) goto LA14_;
(*a).udata[(((NI)3))- 0] += ((NI)1);
{
if (!!(!(((*((NI32*) ((&(*a).udata[(((NI)3))- 0])))) == ((NI32)(-2147483647 -1)))))) goto LA18_;
failedAssertImpl__stdZassertions_224(TM__j3e9cBE1r9bNswX4zGWzjSfQ_3);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA18_: ;
}
LA14_: ;
}
LA9_: ;
}
LA4_: ;
}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, minus___int495056_473)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result = bitnot__int495056_321(a);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
inc__int495056_252((&result), ((NU32)1));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, minus___int495056_476)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
T1_ = minus___int495056_473(b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = plus___int495056_450(a, T1_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, minus___int495056_792)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI64 b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
T1_ = toInt128__int495056_737(b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = minus___int495056_476(a, T1_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, plus___int495056_806)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI64 b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
T1_ = toInt128__int495056_737(b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = plus___int495056_450(a, T1_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NU64, bitconcat__int495056_69)(NU32 a, NU32 b) {
NU64 result;
result = (NU64)0;
result = (NU64)((NU64)((NU64)(((NU64) (a))) << (NU64)(((NI)32))) | ((NU64) (b)));
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, toInt64__int495056_77)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NI64 result;
NU64 T6_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NI64)0;
{
if (!((*((NI32*) ((&arg.udata[(((NI)3))- 0])))) < ((NI32)0))) goto LA3_;
}
goto LA1_;
LA3_: ;
{
}
LA1_: ;
T6_ = (NU64)0;
T6_ = bitconcat__int495056_69(arg.udata[(((NI)1))- 0], arg.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = ((NI64) (T6_));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lt___int495056_733)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI64 b) {
NIM_BOOL result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NI T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
T1_ = toInt128__int495056_737(b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T2_ = (NI)0;
T2_ = cmp__int495056_283(a, T1_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = (T2_ < ((NI)0));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, toInt64Checked__int495056_104)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg, NI64 onError) {
NI64 result;
NU64 T18_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NI64)0;
{
if (!((*((NI32*) ((&arg.udata[(((NI)3))- 0])))) < ((NI32)0))) goto LA3_;
{
NIM_BOOL T7_;
T7_ = (NIM_BOOL)0;
T7_ = !(((*((NI32*) ((&arg.udata[(((NI)3))- 0])))) == ((NI32)-1)));
if (T7_) goto LA8_;
T7_ = !(((*((NI32*) ((&arg.udata[(((NI)2))- 0])))) == ((NI32)-1)));
LA8_: ;
if (!T7_) goto LA9_;
result = onError;
goto BeforeRet_;
}
LA9_: ;
}
goto LA1_;
LA3_: ;
{
{
NIM_BOOL T14_;
T14_ = (NIM_BOOL)0;
T14_ = !(((*((NI32*) ((&arg.udata[(((NI)3))- 0])))) == ((NI32)0)));
if (T14_) goto LA15_;
T14_ = !(((*((NI32*) ((&arg.udata[(((NI)2))- 0])))) == ((NI32)0)));
LA15_: ;
if (!T14_) goto LA16_;
result = onError;
goto BeforeRet_;
}
LA16_: ;
}
LA1_: ;
T18_ = (NU64)0;
T18_ = bitconcat__int495056_69(arg.udata[(((NI)1))- 0], arg.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = ((NI64) (T18_));
goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, star___int495056_489)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NU32 b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NU64 tmp0;
NU64 tmp1;
NU64 tmp2;
NU64 tmp3;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
tmp0 = (NU64)((NU64)(((NU64) (a.udata[(((NI)0))- 0]))) * (NU64)(((NU64) (b))));
tmp1 = (NU64)((NU64)(((NU64) (a.udata[(((NI)1))- 0]))) * (NU64)(((NU64) (b))));
tmp2 = (NU64)((NU64)(((NU64) (a.udata[(((NI)2))- 0]))) * (NU64)(((NU64) (b))));
tmp3 = (NU64)((NU64)(((NU64) (a.udata[(((NI)3))- 0]))) * (NU64)(((NU64) (b))));
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = NIM_UNLIKELY(((NU64)(2147483647ULL) < (NU64)(tmp3)));
if (!T3_) goto LA4_;
}
LA4_: ;
result.udata[(((NI)0))- 0] = ((NU32) (tmp0));
result.udata[(((NI)1))- 0] = (NU32)((NU32)(((NU32) (tmp1))) + (NU32)(((NU32) ((NU64)((NU64)(tmp0) >> (NU64)(((NI)32)))))));
result.udata[(((NI)2))- 0] = (NU32)((NU32)(((NU32) (tmp2))) + (NU32)(((NU32) ((NU64)((NU64)(tmp1) >> (NU64)(((NI)32)))))));
result.udata[(((NI)3))- 0] = (NU32)((NU32)(((NU32) (tmp3))) + (NU32)(((NU32) ((NU64)((NU64)(tmp2) >> (NU64)(((NI)32)))))));
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, abs__int495056_486)(NI32 a) {
NI result;
NI32 colontmpD_;
NI32 colontmpD__2;
NI32 T1_;
result = (NI)0;
colontmpD_ = (NI32)0;
colontmpD__2 = (NI32)0;
T1_ = (NI32)0;
{
if (!(a < ((NI32)0))) goto LA4_;
colontmpD_ = ((NI32)-(a));
T1_ = colontmpD_;
}
goto LA2_;
LA4_: ;
{
colontmpD__2 = a;
T1_ = colontmpD__2;
}
LA2_: ;
result = ((NI) (T1_));
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, star___int495056_516)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI32 b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NI T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
T1_ = (NI)0;
T1_ = abs__int495056_486(b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = star___int495056_489(a, ((NU32) (T1_)));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
{
if (!(b < ((NI32)0))) goto LA4_;
result = minus___int495056_473(result);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA4_: ;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lt___int495056_309)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
NIM_BOOL result;
NI T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
T1_ = (NI)0;
T1_ = cmp__int495056_283(a, b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = (T1_ < ((NI)0));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, castToInt64__int495056_222)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NI64 result;
NU64 T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NI64)0;
T1_ = (NU64)0;
T1_ = bitconcat__int495056_69(arg.udata[(((NI)1))- 0], arg.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = ((NI64) (T1_));
}BeforeRet_: ;
return result;
}
static N_INLINE(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, maskUInt8__int495056_859)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
result.udata[(((NI)0))- 0] = (NU32)(arg.udata[(((NI)0))- 0] & ((NU32)255));
result.udata[(((NI)1))- 0] = ((NU32)0);
result.udata[(((NI)2))- 0] = ((NU32)0);
result.udata[(((NI)3))- 0] = ((NU32)0);
return result;
}
static N_INLINE(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, maskUInt16__int495056_856)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
result.udata[(((NI)0))- 0] = (NU32)(arg.udata[(((NI)0))- 0] & ((NU32)65535));
result.udata[(((NI)1))- 0] = ((NU32)0);
result.udata[(((NI)2))- 0] = ((NU32)0);
result.udata[(((NI)3))- 0] = ((NU32)0);
return result;
}
static N_INLINE(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, maskUInt32__int495056_853)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
result.udata[(((NI)0))- 0] = arg.udata[(((NI)0))- 0];
result.udata[(((NI)1))- 0] = ((NU32)0);
result.udata[(((NI)2))- 0] = ((NU32)0);
result.udata[(((NI)3))- 0] = ((NU32)0);
return result;
}
static N_INLINE(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, maskUInt64__int495056_850)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
result.udata[(((NI)0))- 0] = arg.udata[(((NI)0))- 0];
result.udata[(((NI)1))- 0] = arg.udata[(((NI)1))- 0];
result.udata[(((NI)2))- 0] = ((NU32)0);
result.udata[(((NI)3))- 0] = ((NU32)0);
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, maskBytes__int495056_862)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg, NI numbytes) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
switch (numbytes) {
case ((NI)1):
{
result = maskUInt8__int495056_859(arg);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
goto BeforeRet_;
}
break;
case ((NI)2):
{
result = maskUInt16__int495056_856(arg);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
goto BeforeRet_;
}
break;
case ((NI)4):
{
result = maskUInt32__int495056_853(arg);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
goto BeforeRet_;
}
break;
case ((NI)8):
{
result = maskUInt64__int495056_850(arg);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
goto BeforeRet_;
}
break;
default:
{
}
break;
}
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, abs__int495056_483)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg colontmpD_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg colontmpD__2;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
nimZeroMem((void*)(&colontmpD_), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
nimZeroMem((void*)(&colontmpD__2), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
{
if (!((*((NI32*) ((&a.udata[(((NI)3))- 0])))) < ((NI32)0))) goto LA3_;
colontmpD_ = minus___int495056_473(a);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = colontmpD_;
}
goto LA1_;
LA3_: ;
{
colontmpD__2 = a;
result = colontmpD__2;
}
LA1_: ;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, makeInt128__int495056_524)(NU64 high, NU64 low) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = ((NU32) (low));
result.udata[(((NI)1))- 0] = ((NU32) ((NU64)((NU64)(low) >> (NU64)(((NI)32)))));
result.udata[(((NI)2))- 0] = ((NU32) (high));
result.udata[(((NI)3))- 0] = ((NU32) ((NU64)((NU64)(high) >> (NU64)(((NI)32)))));
return result;
}
N_LIB_PRIVATE N_NIMCALL(NU64, high64__int495056_536)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a) {
NU64 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NU64)0;
result = bitconcat__int495056_69(a.udata[(((NI)3))- 0], a.udata[(((NI)2))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NU64, low64__int495056_539)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a) {
NU64 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NU64)0;
result = bitconcat__int495056_69(a.udata[(((NI)1))- 0], a.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, pluseq___int495056_470)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg* a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&T1_), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
T1_ = plus___int495056_450((*a), b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
(*a) = T1_;
}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, shl__int495056_381)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NI b_2;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
b_2 = (NI)(b & ((NI)127));
{
NU64 T5_;
NU64 T6_;
NU64 T7_;
if (!(b_2 < ((NI)32))) goto LA3_;
result.udata[(((NI)0))- 0] = (NU32)((NU64)(a.udata[(((NI)0))- 0]) << (NU64)(b_2));
T5_ = (NU64)0;
T5_ = bitconcat__int495056_69(a.udata[(((NI)1))- 0], a.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)1))- 0] = ((NU32) ((NU64)((NU64)((NU64)((NU64)(T5_) << (NU64)(b_2))) >> (NU64)(((NI)32)))));
T6_ = (NU64)0;
T6_ = bitconcat__int495056_69(a.udata[(((NI)2))- 0], a.udata[(((NI)1))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)2))- 0] = ((NU32) ((NU64)((NU64)((NU64)((NU64)(T6_) << (NU64)(b_2))) >> (NU64)(((NI)32)))));
T7_ = (NU64)0;
T7_ = bitconcat__int495056_69(a.udata[(((NI)3))- 0], a.udata[(((NI)2))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)3))- 0] = ((NU32) ((NU64)((NU64)((NU64)((NU64)(T7_) << (NU64)(b_2))) >> (NU64)(((NI)32)))));
}
goto LA1_;
LA3_: ;
{
NU64 T11_;
NU64 T12_;
if (!(b_2 < ((NI)64))) goto LA9_;
result.udata[(((NI)0))- 0] = ((NU32)0);
result.udata[(((NI)1))- 0] = (NU32)((NU64)(a.udata[(((NI)0))- 0]) << (NU64)((NI)(b_2 & ((NI)31))));
T11_ = (NU64)0;
T11_ = bitconcat__int495056_69(a.udata[(((NI)1))- 0], a.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)2))- 0] = ((NU32) ((NU64)((NU64)((NU64)((NU64)(T11_) << (NU64)((NI)(b_2 & ((NI)31))))) >> (NU64)(((NI)32)))));
T12_ = (NU64)0;
T12_ = bitconcat__int495056_69(a.udata[(((NI)2))- 0], a.udata[(((NI)1))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)3))- 0] = ((NU32) ((NU64)((NU64)((NU64)((NU64)(T12_) << (NU64)((NI)(b_2 & ((NI)31))))) >> (NU64)(((NI)32)))));
}
goto LA1_;
LA9_: ;
{
NU64 T16_;
if (!(b_2 < ((NI)96))) goto LA14_;
result.udata[(((NI)0))- 0] = ((NU32)0);
result.udata[(((NI)1))- 0] = ((NU32)0);
result.udata[(((NI)2))- 0] = (NU32)((NU64)(a.udata[(((NI)0))- 0]) << (NU64)((NI)(b_2 & ((NI)31))));
T16_ = (NU64)0;
T16_ = bitconcat__int495056_69(a.udata[(((NI)1))- 0], a.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)3))- 0] = ((NU32) ((NU64)((NU64)((NU64)((NU64)(T16_) << (NU64)((NI)(b_2 & ((NI)31))))) >> (NU64)(((NI)32)))));
}
goto LA1_;
LA14_: ;
{
result.udata[(((NI)0))- 0] = ((NU32)0);
result.udata[(((NI)1))- 0] = ((NU32)0);
result.udata[(((NI)2))- 0] = ((NU32)0);
result.udata[(((NI)3))- 0] = (NU32)((NU64)(a.udata[(((NI)0))- 0]) << (NU64)((NI)(b_2 & ((NI)31))));
}
LA1_: ;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, star___int495056_542)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg lhs, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg rhs) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NU64 a32;
NU64 a00;
NU64 b32;
NU64 b00;
NU64 T1_;
NU64 T2_;
NU64 T3_;
NU64 T4_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T5_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T6_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T7_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T8_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
a32 = ((NU64) (lhs.udata[(((NI)1))- 0]));
a00 = ((NU64) (lhs.udata[(((NI)0))- 0]));
b32 = ((NU64) (rhs.udata[(((NI)1))- 0]));
b00 = ((NU64) (rhs.udata[(((NI)0))- 0]));
T1_ = (NU64)0;
T1_ = high64__int495056_536(lhs);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T2_ = (NU64)0;
T2_ = low64__int495056_539(rhs);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T3_ = (NU64)0;
T3_ = low64__int495056_539(lhs);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T4_ = (NU64)0;
T4_ = high64__int495056_536(rhs);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = makeInt128__int495056_524((NU64)((NU64)((NU64)((NU64)((NU64)((NU64)(T1_) * (NU64)(T2_))) + (NU64)((NU64)((NU64)(T3_) * (NU64)(T4_))))) + (NU64)((NU64)((NU64)(a32) * (NU64)(b32)))), (NU64)((NU64)(a00) * (NU64)(b00)));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T5_ = toInt128__int495056_550((NU64)((NU64)(a32) * (NU64)(b00)));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T6_ = shl__int495056_381(T5_, ((NI)32));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
pluseq___int495056_470((&result), T6_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T7_ = toInt128__int495056_550((NU64)((NU64)(a00) * (NU64)(b32)));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T8_ = shl__int495056_381(T7_, ((NI)32));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
pluseq___int495056_470((&result), T8_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__semfold_280)(NI8 arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
(*((NI32*) ((&result.udata[(((NI)0))- 0])))) = ((NI32) (arg));
{
if (!(arg < ((NI8)0))) goto LA3_;
(*((NI32*) ((&result.udata[(((NI)1))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)2))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)3))- 0])))) = ((NI32)-1);
}
LA3_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI8, toInt8__int495056_150)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NI8 result;
result = (NI8)0;
{
if (!((*((NI32*) ((&arg.udata[(((NI)3))- 0])))) < ((NI32)0))) goto LA3_;
}
goto LA1_;
LA3_: ;
{
}
LA1_: ;
result = ((NI8) ((*((NI32*) ((&arg.udata[(((NI)0))- 0]))))));
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__semfold_292)(NI16 arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
(*((NI32*) ((&result.udata[(((NI)0))- 0])))) = ((NI32) (arg));
{
if (!(arg < ((NI16)0))) goto LA3_;
(*((NI32*) ((&result.udata[(((NI)1))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)2))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)3))- 0])))) = ((NI32)-1);
}
LA3_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI16, toInt16__int495056_129)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NI16 result;
result = (NI16)0;
{
if (!((*((NI32*) ((&arg.udata[(((NI)3))- 0])))) < ((NI32)0))) goto LA3_;
}
goto LA1_;
LA3_: ;
{
}
LA1_: ;
result = ((NI16) ((*((NI32*) ((&arg.udata[(((NI)0))- 0]))))));
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__semfold_304)(NI32 arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
(*((NI32*) ((&result.udata[(((NI)0))- 0])))) = arg;
{
if (!(arg < ((NI32)0))) goto LA3_;
(*((NI32*) ((&result.udata[(((NI)1))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)2))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)3))- 0])))) = ((NI32)-1);
}
LA3_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI32, toInt32__int495056_108)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NI32 result;
result = (NI32)0;
{
if (!((*((NI32*) ((&arg.udata[(((NI)3))- 0])))) < ((NI32)0))) goto LA3_;
}
goto LA1_;
LA3_: ;
{
}
LA1_: ;
result = (*((NI32*) ((&arg.udata[(((NI)0))- 0]))));
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__semfold_337)(NU8 arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = ((NU32) (arg));
return result;
}
N_LIB_PRIVATE N_NIMCALL(NU8, toUInt8__int495056_207)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NU8 result;
result = (NU8)0;
result = ((NU8) (arg.udata[(((NI)0))- 0]));
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__semfold_349)(NU16 arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = ((NU32) (arg));
return result;
}
N_LIB_PRIVATE N_NIMCALL(NU16, toUInt16__int495056_195)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NU16 result;
result = (NU16)0;
result = ((NU16) (arg.udata[(((NI)0))- 0]));
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__semfold_361)(NU32 arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = arg;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NU32, toUInt32__int495056_183)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NU32 result;
result = (NU32)0;
result = arg.udata[(((NI)0))- 0];
return result;
}
N_LIB_PRIVATE N_NIMCALL(NU64, toUInt64__int495056_174)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NU64 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NU64)0;
result = bitconcat__int495056_69(arg.udata[(((NI)1))- 0], arg.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
static N_INLINE(NI, fastLog2__int495056_572)(NU32 x) {
NI result;
NU32 x_2;
int T1_;
result = (NI)0;
x_2 = x;
T1_ = (int)0;
T1_ = __builtin_clz(x_2);
result = (NI)(((NI)31) - ((NI) (T1_)));
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, fastLog2__int495056_569)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a) {
NI result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NI)0;
{
NI T5_;
if (!!((a.udata[(((NI)3))- 0] == ((NU32)0)))) goto LA3_;
T5_ = (NI)0;
T5_ = fastLog2__int495056_572(a.udata[(((NI)3))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = (NI)(((NI)96) + T5_);
goto BeforeRet_;
}
LA3_: ;
{
NI T10_;
if (!!((a.udata[(((NI)2))- 0] == ((NU32)0)))) goto LA8_;
T10_ = (NI)0;
T10_ = fastLog2__int495056_572(a.udata[(((NI)2))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = (NI)(((NI)64) + T10_);
goto BeforeRet_;
}
LA8_: ;
{
NI T15_;
if (!!((a.udata[(((NI)1))- 0] == ((NU32)0)))) goto LA13_;
T15_ = (NI)0;
T15_ = fastLog2__int495056_572(a.udata[(((NI)1))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = (NI)(((NI)32) + T15_);
goto BeforeRet_;
}
LA13_: ;
{
if (!!((a.udata[(((NI)0))- 0] == ((NU32)0)))) goto LA18_;
result = fastLog2__int495056_572(a.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
goto BeforeRet_;
}
LA18_: ;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, minuseq___int495056_480)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg* a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&T1_), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
T1_ = minus___int495056_476((*a), b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
(*a) = T1_;
}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, bitor__int495056_328)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = (NU32)(a.udata[(((NI)0))- 0] | b.udata[(((NI)0))- 0]);
result.udata[(((NI)1))- 0] = (NU32)(a.udata[(((NI)1))- 0] | b.udata[(((NI)1))- 0]);
result.udata[(((NI)2))- 0] = (NU32)(a.udata[(((NI)2))- 0] | b.udata[(((NI)2))- 0]);
result.udata[(((NI)3))- 0] = (NU32)(a.udata[(((NI)3))- 0] | b.udata[(((NI)3))- 0]);
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, shr__int495056_336)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, NI b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NI b_2;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
b_2 = (NI)(b & ((NI)127));
{
NU64 T5_;
NU64 T6_;
NU64 T7_;
if (!(b_2 < ((NI)32))) goto LA3_;
(*((NI32*) ((&result.udata[(((NI)3))- 0])))) = (NI32)((NI64)((*((NI32*) ((&a.udata[(((NI)3))- 0]))))) >> (NU64)(b_2));
T5_ = (NU64)0;
T5_ = bitconcat__int495056_69(a.udata[(((NI)3))- 0], a.udata[(((NI)2))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)2))- 0] = ((NU32) ((NU64)((NU64)(T5_) >> (NU64)(b_2))));
T6_ = (NU64)0;
T6_ = bitconcat__int495056_69(a.udata[(((NI)2))- 0], a.udata[(((NI)1))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)1))- 0] = ((NU32) ((NU64)((NU64)(T6_) >> (NU64)(b_2))));
T7_ = (NU64)0;
T7_ = bitconcat__int495056_69(a.udata[(((NI)1))- 0], a.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)0))- 0] = ((NU32) ((NU64)((NU64)(T7_) >> (NU64)(b_2))));
}
goto LA1_;
LA3_: ;
{
NU64 T15_;
NU64 T16_;
if (!(b_2 < ((NI)64))) goto LA9_;
{
if (!((*((NI32*) ((&a.udata[(((NI)3))- 0])))) < ((NI32)0))) goto LA13_;
(*((NI32*) ((&result.udata[(((NI)3))- 0])))) = ((NI32)-1);
}
LA13_: ;
(*((NI32*) ((&result.udata[(((NI)2))- 0])))) = (NI32)((NI64)((*((NI32*) ((&a.udata[(((NI)3))- 0]))))) >> (NU64)((NI)(b_2 & ((NI)31))));
T15_ = (NU64)0;
T15_ = bitconcat__int495056_69(a.udata[(((NI)3))- 0], a.udata[(((NI)2))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)1))- 0] = ((NU32) ((NU64)((NU64)(T15_) >> (NU64)((NI)(b_2 & ((NI)31))))));
T16_ = (NU64)0;
T16_ = bitconcat__int495056_69(a.udata[(((NI)2))- 0], a.udata[(((NI)1))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)0))- 0] = ((NU32) ((NU64)((NU64)(T16_) >> (NU64)((NI)(b_2 & ((NI)31))))));
}
goto LA1_;
LA9_: ;
{
NU64 T24_;
if (!(b_2 < ((NI)96))) goto LA18_;
{
if (!((*((NI32*) ((&a.udata[(((NI)3))- 0])))) < ((NI32)0))) goto LA22_;
(*((NI32*) ((&result.udata[(((NI)3))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)2))- 0])))) = ((NI32)-1);
}
LA22_: ;
(*((NI32*) ((&result.udata[(((NI)1))- 0])))) = (NI32)((NI64)((*((NI32*) ((&a.udata[(((NI)3))- 0]))))) >> (NU64)((NI)(b_2 & ((NI)31))));
T24_ = (NU64)0;
T24_ = bitconcat__int495056_69(a.udata[(((NI)3))- 0], a.udata[(((NI)2))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result.udata[(((NI)0))- 0] = ((NU32) ((NU64)((NU64)(T24_) >> (NU64)((NI)(b_2 & ((NI)31))))));
}
goto LA1_;
LA18_: ;
{
{
if (!((*((NI32*) ((&a.udata[(((NI)3))- 0])))) < ((NI32)0))) goto LA28_;
(*((NI32*) ((&result.udata[(((NI)3))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)2))- 0])))) = ((NI32)-1);
(*((NI32*) ((&result.udata[(((NI)1))- 0])))) = ((NI32)-1);
}
LA28_: ;
(*((NI32*) ((&result.udata[(((NI)0))- 0])))) = (NI32)((NI64)((*((NI32*) ((&a.udata[(((NI)3))- 0]))))) >> (NU64)((NI)(b_2 & ((NI)31))));
}
LA1_: ;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(void, divMod__int495056_595)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg dividend, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg divisor, tyTuple__HVa32PrTYbu9ceK7jTbXR9aA* Result) {
NIM_BOOL isNegativeA;
NIM_BOOL isNegativeB;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg dividend_2;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg divisor_2;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg denominator;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg quotient;
NI shift;
NI T22_;
NI T23_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)Result, sizeof(tyTuple__HVa32PrTYbu9ceK7jTbXR9aA));
isNegativeA = ((*((NI32*) ((&dividend.udata[(((NI)3))- 0])))) < ((NI32)0));
isNegativeB = ((*((NI32*) ((&divisor.udata[(((NI)3))- 0])))) < ((NI32)0));
dividend_2 = abs__int495056_483(dividend);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
divisor_2 = abs__int495056_483(divisor);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = lt___int495056_309(dividend_2, divisor_2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (!T3_) goto LA4_;
(*Result).Field0 = Zero__int495056_8;
{
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T10_;
if (!isNegativeA) goto LA8_;
nimZeroMem((void*)(&T10_), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
T10_ = minus___int495056_473(dividend_2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
(*Result).Field1 = T10_;
}
goto LA6_;
LA8_: ;
{
(*Result).Field1 = dividend_2;
}
LA6_: ;
goto BeforeRet_;
}
LA4_: ;
{
NIM_BOOL T14_;
T14_ = (NIM_BOOL)0;
T14_ = eqeq___int495056_317(divisor_2, dividend_2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (!T14_) goto LA15_;
{
if (!(isNegativeA != isNegativeB)) goto LA19_;
(*Result).Field0 = NegOne__int495056_29;
}
goto LA17_;
LA19_: ;
{
(*Result).Field0 = One__int495056_9;
}
LA17_: ;
(*Result).Field1 = Zero__int495056_8;
goto BeforeRet_;
}
LA15_: ;
denominator = divisor_2;
quotient = Zero__int495056_8;
T22_ = (NI)0;
T22_ = fastLog2__int495056_569(dividend_2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T23_ = (NI)0;
T23_ = fastLog2__int495056_569(denominator);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
shift = (NI)(T22_ - T23_);
denominator = shl__int495056_381(denominator, shift);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
{
NI i;
NI res;
i = (NI)0;
res = ((NI)0);
{
while (1) {
if (!(res <= shift)) goto LA26 ;
i = res;
quotient = shl__int495056_381(quotient, ((NI)1));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
{
NIM_BOOL T29_;
T29_ = (NIM_BOOL)0;
T29_ = lteq___int495056_313(denominator, dividend_2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (!T29_) goto LA30_;
minuseq___int495056_480((&dividend_2), denominator);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
quotient = bitor__int495056_328(quotient, One__int495056_9);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}
LA30_: ;
denominator = shr__int495056_336(denominator, ((NI)1));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
res += ((NI)1);
} LA26: ;
}
}
{
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T36_;
if (!(isNegativeA != isNegativeB)) goto LA34_;
nimZeroMem((void*)(&T36_), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
T36_ = minus___int495056_473(quotient);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
(*Result).Field0 = T36_;
}
goto LA32_;
LA34_: ;
{
(*Result).Field0 = quotient;
}
LA32_: ;
{
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T42_;
if (!isNegativeA) goto LA40_;
nimZeroMem((void*)(&T42_), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
T42_ = minus___int495056_473(dividend_2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
(*Result).Field1 = T42_;
}
goto LA38_;
LA40_: ;
{
(*Result).Field1 = dividend_2;
}
LA38_: ;
}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, div__int495056_616)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
tyTuple__HVa32PrTYbu9ceK7jTbXR9aA T1_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a_2;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg _;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
nimZeroMem((void*)(&T1_), sizeof(tyTuple__HVa32PrTYbu9ceK7jTbXR9aA));
divMod__int495056_595(a, b, (&T1_));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
nimZeroMem((void*)(&a_2), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
a_2 = T1_.Field0;
nimZeroMem((void*)(&_), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
_ = T1_.Field1;
result = a_2;
goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, mod__int495056_634)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
tyTuple__HVa32PrTYbu9ceK7jTbXR9aA T1_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg _;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b_2;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
nimZeroMem((void*)(&T1_), sizeof(tyTuple__HVa32PrTYbu9ceK7jTbXR9aA));
divMod__int495056_595(a, b, (&T1_));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
nimZeroMem((void*)(&_), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
_ = T1_.Field0;
nimZeroMem((void*)(&b_2), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
b_2 = T1_.Field1;
result = b_2;
goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, bitand__int495056_324)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = (NU32)(a.udata[(((NI)0))- 0] & b.udata[(((NI)0))- 0]);
result.udata[(((NI)1))- 0] = (NU32)(a.udata[(((NI)1))- 0] & b.udata[(((NI)1))- 0]);
result.udata[(((NI)2))- 0] = (NU32)(a.udata[(((NI)2))- 0] & b.udata[(((NI)2))- 0]);
result.udata[(((NI)3))- 0] = (NU32)(a.udata[(((NI)3))- 0] & b.udata[(((NI)3))- 0]);
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, bitxor__int495056_332)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
result.udata[(((NI)0))- 0] = (NU32)(a.udata[(((NI)0))- 0] ^ b.udata[(((NI)0))- 0]);
result.udata[(((NI)1))- 0] = (NU32)(a.udata[(((NI)1))- 0] ^ b.udata[(((NI)1))- 0]);
result.udata[(((NI)2))- 0] = (NU32)(a.udata[(((NI)2))- 0] ^ b.udata[(((NI)2))- 0]);
result.udata[(((NI)3))- 0] = (NU32)(a.udata[(((NI)3))- 0] ^ b.udata[(((NI)3))- 0]);
return result;
}
static N_INLINE(void, nimAddCharV1)(NimStringV2* s, NIM_CHAR c) {
prepareAdd(s, ((NI)1));
(*(*s).p).data[(*s).len] = c;
(*(*s).p).data[(NI)((*s).len + ((NI)1))] = 0;
(*s).len += ((NI)1);
}
static N_INLINE(void, nimCopyMem)(void* dest, void* source, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memcpy(dest, source, ((size_t) (size)));
}
static N_INLINE(void, copyMem__system_1719)(void* dest, void* source, NI size) {
nimCopyMem(dest, source, size);
}
static N_INLINE(void, appendString)(NimStringV2* dest, NimStringV2 src) {
{
if (!(((NI)0) < src.len)) goto LA3_;
copyMem__system_1719(((void*) ((&(*(*dest).p).data[(*dest).len]))), ((void*) ((&(*src.p).data[((NI)0)]))), ((NI) ((NI)(src.len + ((NI)1)))));
(*dest).len += src.len;
}
LA3_: ;
}
static N_INLINE(void, nimPrepareStrMutationV2)(NimStringV2* s) {
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = !(((*s).p == ((NimStrPayload*) NIM_NIL)));
if (!(T3_)) goto LA4_;
T3_ = ((NI)((*(*s).p).cap & ((NI)IL64(4611686018427387904))) == ((NI)IL64(4611686018427387904)));
LA4_: ;
if (!T3_) goto LA5_;
nimPrepareStrMutationImpl__system_2301(s);
}
LA5_: ;
}
N_LIB_PRIVATE N_NIMCALL(void, addInt128__int495056_640)(NimStringV2* result, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg value) {
NI initialSize;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
initialSize = (*result).len;
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = eqeq___int495056_317(value, Zero__int495056_8);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (!T3_) goto LA4_;
nimAddCharV1((&(*result)), 48);
}
goto LA1_;
LA4_: ;
{
NIM_BOOL T7_;
T7_ = (NIM_BOOL)0;
T7_ = eqeq___int495056_317(value, Min__int495056_11);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (!T7_) goto LA8_;
prepareAdd((&(*result)), 40);
appendString((&(*result)), TM__j3e9cBE1r9bNswX4zGWzjSfQ_5);
}
goto LA1_;
LA8_: ;
{
NIM_BOOL isNegative;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg value_2;
NI i;
NI j;
isNegative = ((*((NI32*) ((&value.udata[(((NI)3))- 0])))) < ((NI32)0));
value_2 = abs__int495056_483(value);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
{
while (1) {
NIM_BOOL T13_;
tyTuple__HVa32PrTYbu9ceK7jTbXR9aA T14_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg quot;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg rem;
NI64 T15_;
T13_ = (NIM_BOOL)0;
T13_ = lt___int495056_309(Zero__int495056_8, value_2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (!T13_) goto LA12 ;
nimZeroMem((void*)(&T14_), sizeof(tyTuple__HVa32PrTYbu9ceK7jTbXR9aA));
divMod__int495056_595(value_2, Ten__int495056_10, (&T14_));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
nimZeroMem((void*)(&quot), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
quot = T14_.Field0;
nimZeroMem((void*)(&rem), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
rem = T14_.Field1;
T15_ = (NI64)0;
T15_ = toInt64__int495056_77(rem);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
nimAddCharV1((&(*result)), TM__j3e9cBE1r9bNswX4zGWzjSfQ_7.p->data[T15_]);
value_2 = quot;
} LA12: ;
}
{
if (!isNegative) goto LA18_;
nimAddCharV1((&(*result)), 45);
}
LA18_: ;
i = initialSize;
j = ((*result).len-1);
{
while (1) {
NIM_CHAR T22_;
if (!(i < j)) goto LA21 ;
nimPrepareStrMutationV2((&(*result)));
nimPrepareStrMutationV2((&(*result)));
T22_ = (NIM_CHAR)0;
T22_ = (*result).p->data[i];
(*result).p->data[i] = (*result).p->data[j];
(*result).p->data[j] = T22_;
i += ((NI)1);
j -= ((NI)1);
} LA21: ;
}
}
LA1_: ;
}BeforeRet_: ;
}
N_LIB_PRIVATE N_NIMCALL(NimStringV2, dollar___int495056_60)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg a) {
NimStringV2 result;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result.len = 0; result.p = NIM_NIL;
result = rawNewString(((NI)41));
addInt128__int495056_640((&result), a);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq___int495056_778)(NI64 a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
NIM_BOOL result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
T1_ = toInt128__int495056_737(a);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = eqeq___int495056_317(T1_, b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NF, toFloat64__int495056_813)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NF result;
NIM_BOOL isNegative;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg_2;
NF a;
NU64 T1_;
NF b;
NU64 T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NF)0;
isNegative = ((*((NI32*) ((&arg.udata[(((NI)3))- 0])))) < ((NI32)0));
arg_2 = abs__int495056_483(arg);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T1_ = (NU64)0;
T1_ = bitconcat__int495056_69(arg_2.udata[(((NI)1))- 0], arg_2.udata[(((NI)0))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
a = ((NF) (T1_));
T2_ = (NU64)0;
T2_ = bitconcat__int495056_69(arg_2.udata[(((NI)3))- 0], arg_2.udata[(((NI)2))- 0]);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
b = ((NF) (T2_));
result = ((NF)(a) + (NF)(((NF)(1.8446744073709552e+19) * (NF)(b))));
{
if (!isNegative) goto LA5_;
result = -(result);
}
LA5_: ;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__semfold_685)(NIM_BOOL arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
(*((NI32*) ((&result.udata[(((NI)0))- 0])))) = ((NI32) (arg));
return result;
}
static N_INLINE(NF, abs__system_4699)(NF x) {
NF result;
result = (NF)0;
result = fabs(x);
return result;
}
N_LIB_PRIVATE N_NIMCALL(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg, toInt128__int495056_827)(NF arg) {
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg result;
NIM_BOOL isNegative;
NF v0;
NF T1_;
NU64 w0;
NF T2_;
NF v1;
NU64 w1;
NF T3_;
NF v2;
NU64 w2;
NF T4_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg res;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T5_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T6_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T7_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T8_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T9_;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T10_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&result), sizeof(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg));
isNegative = (arg < 0.0);
T1_ = (NF)0;
T1_ = abs__system_4699(arg);
v0 = ldexp(T1_, ((int)-100));
T2_ = (NF)0;
T2_ = trunc(v0);
w0 = ((NU64) (T2_));
v1 = ldexp(((NF)(v0) - (NF)(((NF) (w0)))), ((int)50));
T3_ = (NF)0;
T3_ = trunc(v1);
w1 = ((NU64) (T3_));
v2 = ldexp(((NF)(v1) - (NF)(((NF) (w1)))), ((int)50));
T4_ = (NF)0;
T4_ = trunc(v2);
w2 = ((NU64) (T4_));
T5_ = toInt128__int495056_550(w0);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T6_ = shl__int495056_381(T5_, ((NI)100));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T7_ = toInt128__int495056_550(w1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T8_ = shl__int495056_381(T7_, ((NI)50));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T9_ = bitor__int495056_328(T6_, T8_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T10_ = toInt128__int495056_550(w2);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
res = bitor__int495056_328(T9_, T10_);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
{
if (!isNegative) goto LA13_;
result = minus___int495056_473(res);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
goto BeforeRet_;
}
goto LA11_;
LA13_: ;
{
result = res;
goto BeforeRet_;
}
LA11_: ;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI, toInt__int495056_171)(tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg arg) {
NI result;
NI64 T1_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NI)0;
T1_ = (NI64)0;
T1_ = toInt64__int495056_77(arg);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = ((NI) (T1_));
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, lt___int495056_750)(NI64 a, tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg b) {
NIM_BOOL result;
tyObject_Int128__o11U6O9aAgrfFG9bStrwmHkg T1_;
NI T2_;
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
result = (NIM_BOOL)0;
T1_ = toInt128__int495056_737(a);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
T2_ = (NI)0;
T2_ = cmp__int495056_283(T1_, b);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
result = (T2_ < ((NI)0));
}BeforeRet_: ;
return result;
}