1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
/* Generated by Nim Compiler v1.6.14 */
#define NIM_INTBITS 64
#include "nimbase.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)
static N_INLINE(NI64, pluspercent___system_712)(NI64 x, NI64 y);
static N_INLINE(NI64, starpercent___system_752)(NI64 x, NI64 y);
static N_INLINE(NF, toBiggestFloat__system_1705)(NI64 i);
static N_INLINE(NF, abs__pureZmath_150)(NF x);
static N_INLINE(NI64, minuspercent___system_732)(NI64 x, NI64 y);
static N_INLINE(NI64, pluspercent___system_712)(NI64 x, NI64 y) {
NI64 result;
result = (NI64)0;
result = ((NI64) ((NU64)((NU64)(((NU64) (x))) + (NU64)(((NU64) (y))))));
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, barplusbar___saturate_1)(NI64 a, NI64 b) {
NI64 result;
{ result = (NI64)0;
result = pluspercent___system_712(a, b);
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = (IL64(0) <= (NI64)(result ^ a));
if (T3_) goto LA4_;
T3_ = (IL64(0) <= (NI64)(result ^ b));
LA4_: ;
if (!T3_) goto LA5_;
goto BeforeRet_;
}
LA5_: ;
{
NIM_BOOL T9_;
T9_ = (NIM_BOOL)0;
T9_ = (a < IL64(0));
if (T9_) goto LA10_;
T9_ = (b < IL64(0));
LA10_: ;
if (!T9_) goto LA11_;
result = (IL64(-9223372036854775807) - IL64(1));
}
goto LA7_;
LA11_: ;
{
result = IL64(9223372036854775807);
}
LA7_: ;
}BeforeRet_: ;
return result;
}
static N_INLINE(NI64, starpercent___system_752)(NI64 x, NI64 y) {
NI64 result;
result = (NI64)0;
result = ((NI64) ((NU64)((NU64)(((NU64) (x))) * (NU64)(((NU64) (y))))));
return result;
}
static N_INLINE(NF, toBiggestFloat__system_1705)(NI64 i) {
NF result;
result = (NF)0;
result = ((NF) (i));
return result;
}
static N_INLINE(NF, abs__pureZmath_150)(NF x) {
NF result;
result = (NF)0;
result = fabs(x);
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, barstarbar___saturate_52)(NI64 a, NI64 b) {
NI64 result;
NF resAsFloat;
NF floatProd;
NF T1_;
{ result = (NI64)0;
resAsFloat = (NF)0;
floatProd = (NF)0;
result = starpercent___system_752(a, b);
floatProd = toBiggestFloat__system_1705(a);
T1_ = (NF)0;
T1_ = toBiggestFloat__system_1705(b);
floatProd = ((NF)(floatProd) * (NF)(T1_));
resAsFloat = toBiggestFloat__system_1705(result);
{
if (!(resAsFloat == floatProd)) goto LA4_;
goto BeforeRet_;
}
LA4_: ;
{
NF T8_;
NF T9_;
T8_ = (NF)0;
T8_ = abs__pureZmath_150(((NF)(resAsFloat) - (NF)(floatProd)));
T9_ = (NF)0;
T9_ = abs__pureZmath_150(floatProd);
if (!(((NF)(32.0) * (NF)(T8_)) <= T9_)) goto LA10_;
goto BeforeRet_;
}
LA10_: ;
{
if (!(0.0 <= floatProd)) goto LA14_;
result = IL64(9223372036854775807);
}
goto LA12_;
LA14_: ;
{
result = (IL64(-9223372036854775807) - IL64(1));
}
LA12_: ;
}BeforeRet_: ;
return result;
}
static N_INLINE(NI64, minuspercent___system_732)(NI64 x, NI64 y) {
NI64 result;
result = (NI64)0;
result = ((NI64) ((NU64)((NU64)(((NU64) (x))) - (NU64)(((NU64) (y))))));
return result;
}
N_LIB_PRIVATE N_NIMCALL(NI64, barminusbar___saturate_13)(NI64 a, NI64 b) {
NI64 result;
{ result = (NI64)0;
result = minuspercent___system_732(a, b);
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = (IL64(0) <= (NI64)(result ^ a));
if (T3_) goto LA4_;
T3_ = (IL64(0) <= (NI64)(result ^ (NI64)((NU64) ~(b))));
LA4_: ;
if (!T3_) goto LA5_;
goto BeforeRet_;
}
LA5_: ;
{
if (!(IL64(0) < b)) goto LA9_;
result = (IL64(-9223372036854775807) - IL64(1));
}
goto LA7_;
LA9_: ;
{
result = IL64(9223372036854775807);
}
LA7_: ;
}BeforeRet_: ;
return result;
}
|