1 /* Generated by Nim Compiler v1.6.2 */
2 #define NIM_INTBITS 32
3
4 #include "nimbase.h"
5 #include <string.h>
6 #include <stdio.h>
7 #undef LANGUAGE_C
8 #undef MIPSEB
9 #undef MIPSEL
10 #undef PPC
11 #undef R3000
12 #undef R4000
13 #undef i386
14 #undef linux
15 #undef mips
16 #undef near
17 #undef far
18 #undef powerpc
19 #undef unix
20 #define nimfr_(x, y)
21 #define nimln_(x, y)
22 typedef struct tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw;
23 typedef struct tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg;
24 typedef struct tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw;
25 typedef struct tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA;
26 typedef struct NimStringDesc NimStringDesc;
27 typedef struct TGenericSeq TGenericSeq;
28 typedef struct tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ;
29 typedef struct tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg;
30 struct tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw {
31 NU64 bits;
32 };
33 struct tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg {
34 NU64 significand;
35 NI32 exponent;
36 };
37 struct tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw {
38 NU64 hi;
39 NU64 lo;
40 };
41 typedef tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw tyArray__YxVLJbmWgWA9aXEi5wDoQhA[619];
42 struct tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA {
43 NU64 mul;
44 NU64 cmp;
45 };
46 typedef tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA tyArray__9apbx8OXkiOk9cnMKRpy11KQ[25];
47 typedef NIM_CHAR tyArray__38Z69amCaoywES5tRmClBSw[200];
48 typedef NI8 tyArray__k7wgHIN8mKeRF236nmwvnQ[100];
49 typedef NIM_CHAR tyArray__Wfh9bjgBQ4UqJsyISUuDSuA[16];
50 struct TGenericSeq {
51 NI len;
52 NI reserved;
53 };
54 struct NimStringDesc {
55 TGenericSeq Sup;
56 NIM_CHAR data[SEQ_DECL_SIZE];
57 };
58 typedef NIM_CHAR tyArray__eVNFTutn6un5gcq48fQLdg[65];
59 struct tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ {
60 NU32 bits;
61 };
62 struct tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg {
63 NU32 digits;
64 NI32 exponent;
65 };
66 typedef NU64 tyArray__ocdlWeLAycDNOOtB9cadACA[77];
67 static N_INLINE(NI, toChars__systemZdragonbox_672)(NIM_CHAR* buffer, NI bufferLen_0, NF v, NIM_BOOL forceTrailingDotZero);
68 N_LIB_PRIVATE N_NIMCALL(NU64, physicalSignificand__systemZdragonbox_34)(tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw this_0);
69 N_LIB_PRIVATE N_NIMCALL(tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw, constructDouble__systemZdragonbox_31)(NF value);
70 N_LIB_PRIVATE N_NIMCALL(NU64, physicalExponent__systemZdragonbox_37)(tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw this_0);
71 N_LIB_PRIVATE N_NIMCALL(NI, signBit__systemZdragonbox_56)(tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw this_0);
72 static N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg, toDecimal64__systemZdragonbox_336)(NU64 ieeeSignificand, NU64 ieeeExponent);
73 static N_INLINE(void, nimZeroMem)(void* p, NI size);
74 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size);
75 static N_INLINE(NIM_BOOL, multipleOfPow2__systemZdragonbox_139)(NU64 value, NI32 e2);
76 static N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg, toDecimal64AsymmetricInterval__systemZdragonbox_195)(NI32 e2);
77 static N_INLINE(NI32, floorLog10ThreeQuartersPow2__systemZdragonbox_88)(NI32 e);
78 static N_INLINE(NI32, floorDivPow2__systemZdragonbox_62)(NI32 x, NI32 n);
79 static N_INLINE(NI32, floorLog2Pow10__systemZdragonbox_70)(NI32 e);
80 static N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw, computePow10__systemZdragonbox_100)(NI32 k);
81 static N_INLINE(NI32, floorLog10Pow2__systemZdragonbox_79)(NI32 e);
82 static N_INLINE(NU32, computeDelta__systemZdragonbox_251)(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10, NI32 betaMinus1);
83 static N_INLINE(NU64, mulShift__systemZdragonbox_291)(NU64 x, tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw y);
84 static N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw, mul128__systemZdragonbox_275)(NU64 a, NU64 b);
85 static N_INLINE(NU32, lo32__systemZdragonbox_265)(NU64 x);
86 static N_INLINE(NU32, hi32__systemZdragonbox_268)(NU64 x);
87 static N_INLINE(NIM_BOOL, isIntegralEndpoint__systemZdragonbox_326)(NU64 twoF, NI32 e2, NI32 minusK);
88 static N_INLINE(NIM_BOOL, multipleOfPow5__systemZdragonbox_150)(NU64 value, NI32 e5);
89 static N_INLINE(NIM_BOOL, mulParity__systemZdragonbox_308)(NU64 twoF, tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10, NI32 betaMinus1);
90 static N_INLINE(NIM_BOOL, isIntegralMidpoint__systemZdragonbox_331)(NU64 twoF, NI32 e2, NI32 minusK);
91 static N_INLINE(NI, formatDigits__systemZdragonbox_548)(NIM_CHAR* buffer, NI bufferLen_0, NI pos, NU64 digits, NI32 decimalExponent, NIM_BOOL forceTrailingDotZero);
92 static N_INLINE(NI32, decimalLength__systemZdragonbox_534)(NU64 v);
93 static N_INLINE(NI32, printDecimalDigitsBackwards__systemZdragonbox_417)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU64 output64);
94 static N_INLINE(NI32, utoa8DigitsSkipTrailingZeros__systemZdragonbox_400)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 digits);
95 static N_INLINE(void, utoa2Digits__stdZprivateZdigitsutils_21)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 digits);
96 static N_INLINE(NI32, trailingZeros2Digits__stdZprivateZdigitsutils_34)(NU32 digits);
97 N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, setLengthStr)(NimStringDesc* s, NI newLen);
98 N_LIB_PRIVATE N_NIMCALL(void, unsureAsgnRef)(void** dest, void* src);
99 N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferSprintf__systemZformatfloat_59)(NIM_CHAR* buf, NF value);
100 N_LIB_PRIVATE N_NIMCALL(void, writeToBuffer__systemZformatfloat_51)(NIM_CHAR* buf, NCSTRING value);
101 N_LIB_PRIVATE N_NIMCALL(void, addCstringN__systemZformatfloat_5)(NimStringDesc** result, NCSTRING buf, NI buflen);
102 static N_INLINE(NI, float32ToChars__systemZschubfach_387)(NIM_CHAR* buffer, NI bufferLen_0, NF32 v, NIM_BOOL forceTrailingDotZero);
103 N_LIB_PRIVATE N_NIMCALL(NU32, physicalSignificand__systemZschubfach_34)(tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ this_0);
104 N_LIB_PRIVATE N_NIMCALL(tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ, constructSingle__systemZschubfach_31)(NF32 value);
105 N_LIB_PRIVATE N_NIMCALL(NU32, physicalExponent__systemZschubfach_37)(tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ this_0);
106 N_LIB_PRIVATE N_NIMCALL(NI, signBit__systemZschubfach_56)(tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ this_0);
107 static N_INLINE(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg, toDecimal32__systemZschubfach_142)(NU32 ieeeSignificand, NU32 ieeeExponent);
108 static N_INLINE(NIM_BOOL, multipleOfPow2__systemZschubfach_125)(NU32 value, NI32 e2);
109 static N_INLINE(NI32, floorDivPow2__systemZschubfach_59)(NI32 x, NI32 n);
110 static N_INLINE(NI32, floorLog2Pow10__systemZschubfach_67)(NI32 e);
111 static N_INLINE(NU64, computePow10Single__systemZschubfach_88)(NI32 k);
112 static N_INLINE(NU32, roundToOdd__systemZschubfach_116)(NU64 g, NU32 cp);
113 static N_INLINE(NU32, lo32__systemZschubfach_106)(NU64 x);
114 static N_INLINE(NU32, hi32__systemZschubfach_109)(NU64 x);
115 static N_INLINE(NI, formatDigits__systemZschubfach_286)(NIM_CHAR* buffer, NI bufferLen_0, NI pos, NU32 digits, NI32 decimalExponent, NIM_BOOL forceTrailingDotZero);
116 static N_INLINE(NI32, decimalLength__systemZschubfach_277)(NU32 v);
117 static N_INLINE(NI32, printDecimalDigitsBackwards__systemZschubfach_206)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 output);
118 extern NIM_CONST tyArray__YxVLJbmWgWA9aXEi5wDoQhA pow10__systemZdragonbox_105;
119 extern NIM_CONST tyArray__9apbx8OXkiOk9cnMKRpy11KQ mod5__systemZdragonbox_157;
120 extern NIM_CONST tyArray__38Z69amCaoywES5tRmClBSw digits100__stdZprivateZdigitsutils_2;
121 extern NIM_CONST tyArray__k7wgHIN8mKeRF236nmwvnQ trailingZeros100__stdZprivateZdigitsutils_1;
122 extern NIM_CONST tyArray__ocdlWeLAycDNOOtB9cadACA g__systemZschubfach_78;
N_INLINE(void,nimSetMem__systemZmemory_7)123 static N_INLINE(void, nimSetMem__systemZmemory_7)(void* a, int v, NI size) {
124 void* T1_;
125 T1_ = (void*)0;
126 T1_ = memset(a, v, ((size_t) (size)));
127 }
N_INLINE(void,nimZeroMem)128 static N_INLINE(void, nimZeroMem)(void* p, NI size) {
129 nimSetMem__systemZmemory_7(p, ((int) 0), size);
130 }
N_INLINE(NIM_BOOL,multipleOfPow2__systemZdragonbox_139)131 static N_INLINE(NIM_BOOL, multipleOfPow2__systemZdragonbox_139)(NU64 value, NI32 e2) {
132 NIM_BOOL result;
133 NIM_BOOL T1_;
134 { result = (NIM_BOOL)0;
135 T1_ = (NIM_BOOL)0;
136 T1_ = (e2 < ((NI32) 64));
137 if (!(T1_)) goto LA2_;
138 T1_ = ((NU64)(value & (NU64)((NU64)((NU64)((NU64)(1ULL) << (NU64)(e2))) - (NU64)(1ULL))) == 0ULL);
139 LA2_: ;
140 result = T1_;
141 goto BeforeRet_;
142 }BeforeRet_: ;
143 return result;
144 }
N_INLINE(NI32,floorDivPow2__systemZdragonbox_62)145 static N_INLINE(NI32, floorDivPow2__systemZdragonbox_62)(NI32 x, NI32 n) {
146 NI32 result;
147 { result = (NI32)0;
148 result = (NI32)((NI32)(x) >> (NU32)(n));
149 goto BeforeRet_;
150 }BeforeRet_: ;
151 return result;
152 }
N_INLINE(NI32,floorLog10ThreeQuartersPow2__systemZdragonbox_88)153 static N_INLINE(NI32, floorLog10ThreeQuartersPow2__systemZdragonbox_88)(NI32 e) {
154 NI32 result;
155 { result = (NI32)0;
156 result = floorDivPow2__systemZdragonbox_62((NI32)((NI32)(e * ((NI32) 1262611)) - ((NI32) 524031)), ((NI32) 22));
157 goto BeforeRet_;
158 }BeforeRet_: ;
159 return result;
160 }
N_INLINE(NI32,floorLog2Pow10__systemZdragonbox_70)161 static N_INLINE(NI32, floorLog2Pow10__systemZdragonbox_70)(NI32 e) {
162 NI32 result;
163 { result = (NI32)0;
164 result = floorDivPow2__systemZdragonbox_62((NI32)(e * ((NI32) 1741647)), ((NI32) 19));
165 goto BeforeRet_;
166 }BeforeRet_: ;
167 return result;
168 }
N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw,computePow10__systemZdragonbox_100)169 static N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw, computePow10__systemZdragonbox_100)(NI32 k) {
170 tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw result;
171 { nimZeroMem((void*)(&result), sizeof(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw));
172 result = pow10__systemZdragonbox_105[((NI32)(k - ((NI32) -292)))- 0];
173 goto BeforeRet_;
174 }BeforeRet_: ;
175 return result;
176 }
N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg,toDecimal64AsymmetricInterval__systemZdragonbox_195)177 static N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg, toDecimal64AsymmetricInterval__systemZdragonbox_195)(NI32 e2) {
178 tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg result;
179 NI32 minusK;
180 NI32 betaMinus1;
181 NI32 T1_;
182 tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10;
183 NU64 lowerEndpoint;
184 NU64 upperEndpoint;
185 NIM_BOOL lowerEndpointIsInteger;
186 NIM_BOOL T2_;
187 NU64 xi;
188 NU64 zi;
189 NU64 q;
190 { nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
191 minusK = floorLog10ThreeQuartersPow2__systemZdragonbox_88(e2);
192 T1_ = (NI32)0;
193 T1_ = floorLog2Pow10__systemZdragonbox_70(((NI32)-(minusK)));
194 betaMinus1 = (NI32)(e2 + T1_);
195 pow10 = computePow10__systemZdragonbox_100(((NI32)-(minusK)));
196 lowerEndpoint = (NU64)((NU64)((NU64)((NU64)(pow10.hi) - (NU64)((NU64)((NU64)(pow10.hi) >> (NU64)(((NI32) 54)))))) >> (NU64)((NI32)(((NI32) 11) - betaMinus1)));
197 upperEndpoint = (NU64)((NU64)((NU64)((NU64)(pow10.hi) + (NU64)((NU64)((NU64)(pow10.hi) >> (NU64)(((NI32) 53)))))) >> (NU64)((NI32)(((NI32) 11) - betaMinus1)));
198 T2_ = (NIM_BOOL)0;
199 T2_ = (((NI32) 2) <= e2);
200 if (!(T2_)) goto LA3_;
201 T2_ = (e2 <= ((NI32) 3));
202 LA3_: ;
203 lowerEndpointIsInteger = T2_;
204 xi = (NU64)((NU64)(lowerEndpoint) + (NU64)(((NU64) (!(lowerEndpointIsInteger)))));
205 zi = upperEndpoint;
206 q = (NU64)((NU64)(zi) / (NU64)(10ULL));
207 {
208 if (!((NU64)(xi) <= (NU64)((NU64)((NU64)(q) * (NU64)(10ULL))))) goto LA6_;
209 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
210 result.significand = q;
211 result.exponent = (NI32)(minusK + ((NI32) 1));
212 goto BeforeRet_;
213 }
214 LA6_: ;
215 q = (NU64)((NU64)((NU64)((NU64)((NU64)((NU64)(pow10.hi) >> (NU64)((NI32)(((NI32) 10) - betaMinus1)))) + (NU64)(1ULL))) / (NU64)(2ULL));
216 {
217 if (!(e2 == ((NI32) -77))) goto LA10_;
218 q -= !(((NU64)((NU64)(q) % (NU64)(2ULL)) == 0ULL));
219 }
220 goto LA8_;
221 LA10_: ;
222 {
223 q += ((NU64)(q) < (NU64)(xi));
224 }
225 LA8_: ;
226 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
227 result.significand = q;
228 result.exponent = minusK;
229 goto BeforeRet_;
230 }BeforeRet_: ;
231 return result;
232 }
N_INLINE(NI32,floorLog10Pow2__systemZdragonbox_79)233 static N_INLINE(NI32, floorLog10Pow2__systemZdragonbox_79)(NI32 e) {
234 NI32 result;
235 { result = (NI32)0;
236 result = floorDivPow2__systemZdragonbox_62((NI32)(e * ((NI32) 1262611)), ((NI32) 22));
237 goto BeforeRet_;
238 }BeforeRet_: ;
239 return result;
240 }
N_INLINE(NU32,computeDelta__systemZdragonbox_251)241 static N_INLINE(NU32, computeDelta__systemZdragonbox_251)(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10, NI32 betaMinus1) {
242 NU32 result;
243 { result = (NU32)0;
244 result = ((NU32) ((NU64)((NU64)(pow10.hi) >> (NU64)((NI32)(((NI32) 63) - betaMinus1)))));
245 goto BeforeRet_;
246 }BeforeRet_: ;
247 return result;
248 }
N_INLINE(NU32,lo32__systemZdragonbox_265)249 static N_INLINE(NU32, lo32__systemZdragonbox_265)(NU64 x) {
250 NU32 result;
251 { result = (NU32)0;
252 result = ((NU32) (x));
253 goto BeforeRet_;
254 }BeforeRet_: ;
255 return result;
256 }
N_INLINE(NU32,hi32__systemZdragonbox_268)257 static N_INLINE(NU32, hi32__systemZdragonbox_268)(NU64 x) {
258 NU32 result;
259 { result = (NU32)0;
260 result = ((NU32) ((NU64)((NU64)(x) >> (NU64)(((NI) 32)))));
261 goto BeforeRet_;
262 }BeforeRet_: ;
263 return result;
264 }
N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw,mul128__systemZdragonbox_275)265 static N_INLINE(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw, mul128__systemZdragonbox_275)(NU64 a, NU64 b) {
266 tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw result;
267 NU64 b00;
268 NU32 T1_;
269 NU32 T2_;
270 NU64 b01;
271 NU32 T3_;
272 NU32 T4_;
273 NU64 b10;
274 NU32 T5_;
275 NU32 T6_;
276 NU64 b11;
277 NU32 T7_;
278 NU32 T8_;
279 NU64 mid1;
280 NU32 T9_;
281 NU64 mid2;
282 NU32 T10_;
283 NU64 hi;
284 NU32 T11_;
285 NU32 T12_;
286 NU64 lo;
287 NU32 T13_;
288 NU32 T14_;
289 { nimZeroMem((void*)(&result), sizeof(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw));
290 T1_ = (NU32)0;
291 T1_ = lo32__systemZdragonbox_265(a);
292 T2_ = (NU32)0;
293 T2_ = lo32__systemZdragonbox_265(b);
294 b00 = (NU64)((NU64)(((NU64) (T1_))) * (NU64)(((NU64) (T2_))));
295 T3_ = (NU32)0;
296 T3_ = lo32__systemZdragonbox_265(a);
297 T4_ = (NU32)0;
298 T4_ = hi32__systemZdragonbox_268(b);
299 b01 = (NU64)((NU64)(((NU64) (T3_))) * (NU64)(((NU64) (T4_))));
300 T5_ = (NU32)0;
301 T5_ = hi32__systemZdragonbox_268(a);
302 T6_ = (NU32)0;
303 T6_ = lo32__systemZdragonbox_265(b);
304 b10 = (NU64)((NU64)(((NU64) (T5_))) * (NU64)(((NU64) (T6_))));
305 T7_ = (NU32)0;
306 T7_ = hi32__systemZdragonbox_268(a);
307 T8_ = (NU32)0;
308 T8_ = hi32__systemZdragonbox_268(b);
309 b11 = (NU64)((NU64)(((NU64) (T7_))) * (NU64)(((NU64) (T8_))));
310 T9_ = (NU32)0;
311 T9_ = hi32__systemZdragonbox_268(b00);
312 mid1 = (NU64)((NU64)(b10) + (NU64)(((NU64) (T9_))));
313 T10_ = (NU32)0;
314 T10_ = lo32__systemZdragonbox_265(mid1);
315 mid2 = (NU64)((NU64)(b01) + (NU64)(((NU64) (T10_))));
316 T11_ = (NU32)0;
317 T11_ = hi32__systemZdragonbox_268(mid1);
318 T12_ = (NU32)0;
319 T12_ = hi32__systemZdragonbox_268(mid2);
320 hi = (NU64)((NU64)((NU64)((NU64)(b11) + (NU64)(((NU64) (T11_))))) + (NU64)(((NU64) (T12_))));
321 T13_ = (NU32)0;
322 T13_ = lo32__systemZdragonbox_265(b00);
323 T14_ = (NU32)0;
324 T14_ = lo32__systemZdragonbox_265(mid2);
325 lo = (NU64)(((NU64) (T13_)) | (NU64)((NU64)(((NU64) (T14_))) << (NU64)(((NI) 32))));
326 nimZeroMem((void*)(&result), sizeof(tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw));
327 result.hi = hi;
328 result.lo = lo;
329 goto BeforeRet_;
330 }BeforeRet_: ;
331 return result;
332 }
N_INLINE(NU64,mulShift__systemZdragonbox_291)333 static N_INLINE(NU64, mulShift__systemZdragonbox_291)(NU64 x, tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw y) {
334 NU64 result;
335 tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw p1;
336 tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw p0;
337 { result = (NU64)0;
338 p1 = mul128__systemZdragonbox_275(x, y.hi);
339 p0 = mul128__systemZdragonbox_275(x, y.lo);
340 p1.lo += p0.hi;
341 p1.hi += ((NU64)(p1.lo) < (NU64)(p0.hi));
342 result = p1.hi;
343 goto BeforeRet_;
344 }BeforeRet_: ;
345 return result;
346 }
N_INLINE(NIM_BOOL,multipleOfPow5__systemZdragonbox_150)347 static N_INLINE(NIM_BOOL, multipleOfPow5__systemZdragonbox_150)(NU64 value, NI32 e5) {
348 NIM_BOOL result;
349 tyObject_MulCmp__tPF4ETaAdtVLNu8l2IurgA m5;
350 { result = (NIM_BOOL)0;
351 m5 = mod5__systemZdragonbox_157[(e5)- 0];
352 result = ((NU64)((NU64)((NU64)(value) * (NU64)(m5.mul))) <= (NU64)(m5.cmp));
353 goto BeforeRet_;
354 }BeforeRet_: ;
355 return result;
356 }
N_INLINE(NIM_BOOL,isIntegralEndpoint__systemZdragonbox_326)357 static N_INLINE(NIM_BOOL, isIntegralEndpoint__systemZdragonbox_326)(NU64 twoF, NI32 e2, NI32 minusK) {
358 NIM_BOOL result;
359 { result = (NIM_BOOL)0;
360 {
361 if (!(e2 < ((NI32) -2))) goto LA3_;
362 result = NIM_FALSE;
363 goto BeforeRet_;
364 }
365 LA3_: ;
366 {
367 if (!(e2 <= ((NI32) 9))) goto LA7_;
368 result = NIM_TRUE;
369 goto BeforeRet_;
370 }
371 LA7_: ;
372 {
373 if (!(e2 <= ((NI32) 86))) goto LA11_;
374 result = multipleOfPow5__systemZdragonbox_150(twoF, minusK);
375 goto BeforeRet_;
376 }
377 LA11_: ;
378 result = NIM_FALSE;
379 goto BeforeRet_;
380 }BeforeRet_: ;
381 return result;
382 }
N_INLINE(NIM_BOOL,mulParity__systemZdragonbox_308)383 static N_INLINE(NIM_BOOL, mulParity__systemZdragonbox_308)(NU64 twoF, tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10, NI32 betaMinus1) {
384 NIM_BOOL result;
385 NU64 p01;
386 NU64 p10;
387 tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw T1_;
388 NU64 mid;
389 { result = (NIM_BOOL)0;
390 p01 = (NU64)((NU64)(twoF) * (NU64)(pow10.hi));
391 T1_ = mul128__systemZdragonbox_275(twoF, pow10.lo);
392 p10 = T1_.hi;
393 mid = (NU64)((NU64)(p01) + (NU64)(p10));
394 result = !(((NU64)(mid & (NU64)((NU64)(1ULL) << (NU64)((NI32)(((NI32) 64) - betaMinus1)))) == 0ULL));
395 goto BeforeRet_;
396 }BeforeRet_: ;
397 return result;
398 }
N_INLINE(NIM_BOOL,isIntegralMidpoint__systemZdragonbox_331)399 static N_INLINE(NIM_BOOL, isIntegralMidpoint__systemZdragonbox_331)(NU64 twoF, NI32 e2, NI32 minusK) {
400 NIM_BOOL result;
401 { result = (NIM_BOOL)0;
402 {
403 if (!(e2 < ((NI32) -4))) goto LA3_;
404 result = multipleOfPow2__systemZdragonbox_139(twoF, (NI32)((NI32)(minusK - e2) + ((NI32) 1)));
405 goto BeforeRet_;
406 }
407 LA3_: ;
408 {
409 if (!(e2 <= ((NI32) 9))) goto LA7_;
410 result = NIM_TRUE;
411 goto BeforeRet_;
412 }
413 LA7_: ;
414 {
415 if (!(e2 <= ((NI32) 86))) goto LA11_;
416 result = multipleOfPow5__systemZdragonbox_150(twoF, minusK);
417 goto BeforeRet_;
418 }
419 LA11_: ;
420 result = NIM_FALSE;
421 goto BeforeRet_;
422 }BeforeRet_: ;
423 return result;
424 }
N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg,toDecimal64__systemZdragonbox_336)425 static N_INLINE(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg, toDecimal64__systemZdragonbox_336)(NU64 ieeeSignificand, NU64 ieeeExponent) {
426 tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg result;
427 NU64 m2;
428 NI32 e2;
429 NIM_BOOL isEven;
430 NIM_BOOL acceptLower;
431 NIM_BOOL acceptUpper;
432 NI32 minusK;
433 NI32 T20_;
434 NI32 betaMinus1;
435 NI32 T21_;
436 tyObject_uint64x2__L25w5SFALWmTH9b30NrjeJw pow10;
437 NU32 delta;
438 NU64 twoFl;
439 NU64 twoFc;
440 NU64 twoFr;
441 NU64 zi;
442 NU64 q;
443 NU32 r;
444 NU32 dist;
445 NU32 distQ;
446 { nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
447 m2 = (NU64)0;
448 e2 = (NI32)0;
449 {
450 if (!!((ieeeExponent == 0ULL))) goto LA3_;
451 m2 = (NU64)(4503599627370496ULL | ieeeSignificand);
452 e2 = (NI32)(((NI32) (ieeeExponent)) - ((NI32) 1075));
453 {
454 NIM_BOOL T7_;
455 NIM_BOOL T8_;
456 T7_ = (NIM_BOOL)0;
457 T8_ = (NIM_BOOL)0;
458 T8_ = (((NI32) 0) <= ((NI32)-(e2)));
459 if (!(T8_)) goto LA9_;
460 T8_ = (((NI32)-(e2)) < ((NI32) 53));
461 LA9_: ;
462 T7_ = T8_;
463 if (!(T7_)) goto LA10_;
464 T7_ = multipleOfPow2__systemZdragonbox_139(m2, ((NI32)-(e2)));
465 LA10_: ;
466 if (!T7_) goto LA11_;
467 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
468 result.significand = (NU64)((NU64)(m2) >> (NU64)(((NI32)-(e2))));
469 result.exponent = ((NI32) 0);
470 goto BeforeRet_;
471 }
472 LA11_: ;
473 {
474 NIM_BOOL T15_;
475 T15_ = (NIM_BOOL)0;
476 T15_ = (ieeeSignificand == 0ULL);
477 if (!(T15_)) goto LA16_;
478 T15_ = ((NU64)(1ULL) < (NU64)(ieeeExponent));
479 LA16_: ;
480 if (!T15_) goto LA17_;
481 result = toDecimal64AsymmetricInterval__systemZdragonbox_195(e2);
482 goto BeforeRet_;
483 }
484 LA17_: ;
485 }
486 goto LA1_;
487 LA3_: ;
488 {
489 m2 = ieeeSignificand;
490 e2 = ((NI32) -1074);
491 }
492 LA1_: ;
493 isEven = ((NU64)((NU64)(m2) % (NU64)(2ULL)) == 0ULL);
494 acceptLower = isEven;
495 acceptUpper = isEven;
496 T20_ = (NI32)0;
497 T20_ = floorLog10Pow2__systemZdragonbox_79(e2);
498 minusK = (NI32)(T20_ - ((NI32) 2));
499 T21_ = (NI32)0;
500 T21_ = floorLog2Pow10__systemZdragonbox_70(((NI32)-(minusK)));
501 betaMinus1 = (NI32)(e2 + T21_);
502 pow10 = computePow10__systemZdragonbox_100(((NI32)-(minusK)));
503 delta = computeDelta__systemZdragonbox_251(pow10, betaMinus1);
504 twoFl = (NU64)((NU64)((NU64)((NU64)(2ULL) * (NU64)(m2))) - (NU64)(1ULL));
505 twoFc = (NU64)((NU64)(2ULL) * (NU64)(m2));
506 twoFr = (NU64)((NU64)((NU64)((NU64)(2ULL) * (NU64)(m2))) + (NU64)(1ULL));
507 zi = mulShift__systemZdragonbox_291((NU64)((NU64)(twoFr) << (NU64)(betaMinus1)), pow10);
508 q = (NU64)((NU64)(zi) / (NU64)(1000ULL));
509 r = (NU32)((NU32)(((NU32) (zi))) - (NU32)((NU32)((NU32)(((NU32) 1000)) * (NU32)(((NU32) (q))))));
510 {
511 if (!((NU32)(r) < (NU32)(delta))) goto LA24_;
512 {
513 NIM_BOOL T28_;
514 NIM_BOOL T29_;
515 NIM_BOOL T32_;
516 T28_ = (NIM_BOOL)0;
517 T29_ = (NIM_BOOL)0;
518 T29_ = !((r == ((NU32) 0)));
519 if (T29_) goto LA30_;
520 T29_ = acceptUpper;
521 LA30_: ;
522 T28_ = T29_;
523 if (T28_) goto LA31_;
524 T32_ = (NIM_BOOL)0;
525 T32_ = isIntegralEndpoint__systemZdragonbox_326(twoFr, e2, minusK);
526 T28_ = !(T32_);
527 LA31_: ;
528 if (!T28_) goto LA33_;
529 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
530 result.significand = q;
531 result.exponent = (NI32)((NI32)(minusK + ((NI32) 2)) + ((NI32) 1));
532 goto BeforeRet_;
533 }
534 LA33_: ;
535 q -= ((NI) 1);
536 r = ((NU32) 1000);
537 }
538 goto LA22_;
539 LA24_: ;
540 {
541 if (!(r == delta)) goto LA36_;
542 {
543 NIM_BOOL T40_;
544 NIM_BOOL T41_;
545 T40_ = (NIM_BOOL)0;
546 T41_ = (NIM_BOOL)0;
547 T41_ = acceptLower;
548 if (!(T41_)) goto LA42_;
549 T41_ = isIntegralEndpoint__systemZdragonbox_326(twoFl, e2, minusK);
550 LA42_: ;
551 T40_ = T41_;
552 if (T40_) goto LA43_;
553 T40_ = mulParity__systemZdragonbox_308(twoFl, pow10, betaMinus1);
554 LA43_: ;
555 if (!T40_) goto LA44_;
556 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
557 result.significand = q;
558 result.exponent = (NI32)((NI32)(minusK + ((NI32) 2)) + ((NI32) 1));
559 goto BeforeRet_;
560 }
561 LA44_: ;
562 }
563 goto LA22_;
564 LA36_: ;
565 {
566 }
567 LA22_: ;
568 q = (NU64)((NU64)(q) * (NU64)(10ULL));
569 dist = (NU32)((NU32)((NU32)((NU32)(r) - (NU32)((NU32)((NU32)(delta) / (NU32)(((NU32) 2)))))) + (NU32)(((NU32) 50)));
570 distQ = (NU32)((NU32)(dist) / (NU32)(((NU32) 100)));
571 q += ((NU64) (distQ));
572 {
573 NIM_BOOL approxYParity;
574 if (!(dist == (NU32)((NU32)(distQ) * (NU32)(((NU32) 100))))) goto LA49_;
575 approxYParity = !(((NU32)(dist & ((NU32) 1)) == ((NU32) 0)));
576 {
577 NIM_BOOL T53_;
578 T53_ = (NIM_BOOL)0;
579 T53_ = mulParity__systemZdragonbox_308(twoFc, pow10, betaMinus1);
580 if (!!((T53_ == approxYParity))) goto LA54_;
581 q -= ((NI) 1);
582 }
583 goto LA51_;
584 LA54_: ;
585 {
586 NIM_BOOL T57_;
587 T57_ = (NIM_BOOL)0;
588 T57_ = !(((NU64)((NU64)(q) % (NU64)(2ULL)) == 0ULL));
589 if (!(T57_)) goto LA58_;
590 T57_ = isIntegralMidpoint__systemZdragonbox_331(twoFc, e2, minusK);
591 LA58_: ;
592 if (!T57_) goto LA59_;
593 q -= ((NI) 1);
594 }
595 goto LA51_;
596 LA59_: ;
597 LA51_: ;
598 }
599 LA49_: ;
600 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg));
601 result.significand = q;
602 result.exponent = (NI32)(minusK + ((NI32) 2));
603 goto BeforeRet_;
604 }BeforeRet_: ;
605 return result;
606 }
N_INLINE(NI32,decimalLength__systemZdragonbox_534)607 static N_INLINE(NI32, decimalLength__systemZdragonbox_534)(NU64 v) {
608 NI32 result;
609 NU32 v32;
610 { result = (NI32)0;
611 {
612 if (!!((((NU32) ((NU64)((NU64)(v) >> (NU64)(((NI) 32))))) == ((NU32) 0)))) goto LA3_;
613 {
614 if (!((NU64)(10000000000000000ULL) <= (NU64)(v))) goto LA7_;
615 result = ((NI32) 17);
616 goto BeforeRet_;
617 }
618 LA7_: ;
619 {
620 if (!((NU64)(1000000000000000ULL) <= (NU64)(v))) goto LA11_;
621 result = ((NI32) 16);
622 goto BeforeRet_;
623 }
624 LA11_: ;
625 {
626 if (!((NU64)(100000000000000ULL) <= (NU64)(v))) goto LA15_;
627 result = ((NI32) 15);
628 goto BeforeRet_;
629 }
630 LA15_: ;
631 {
632 if (!((NU64)(10000000000000ULL) <= (NU64)(v))) goto LA19_;
633 result = ((NI32) 14);
634 goto BeforeRet_;
635 }
636 LA19_: ;
637 {
638 if (!((NU64)(1000000000000ULL) <= (NU64)(v))) goto LA23_;
639 result = ((NI32) 13);
640 goto BeforeRet_;
641 }
642 LA23_: ;
643 {
644 if (!((NU64)(100000000000ULL) <= (NU64)(v))) goto LA27_;
645 result = ((NI32) 12);
646 goto BeforeRet_;
647 }
648 LA27_: ;
649 {
650 if (!((NU64)(10000000000ULL) <= (NU64)(v))) goto LA31_;
651 result = ((NI32) 11);
652 goto BeforeRet_;
653 }
654 LA31_: ;
655 result = ((NI32) 10);
656 goto BeforeRet_;
657 }
658 LA3_: ;
659 v32 = ((NU32) (v));
660 {
661 if (!((NU32)(((NU) 1000000000)) <= (NU32)(((NU) (v32))))) goto LA35_;
662 result = ((NI32) 10);
663 goto BeforeRet_;
664 }
665 LA35_: ;
666 {
667 if (!((NU32)(((NU) 100000000)) <= (NU32)(((NU) (v32))))) goto LA39_;
668 result = ((NI32) 9);
669 goto BeforeRet_;
670 }
671 LA39_: ;
672 {
673 if (!((NU32)(((NU) 10000000)) <= (NU32)(((NU) (v32))))) goto LA43_;
674 result = ((NI32) 8);
675 goto BeforeRet_;
676 }
677 LA43_: ;
678 {
679 if (!((NU32)(((NU) 1000000)) <= (NU32)(((NU) (v32))))) goto LA47_;
680 result = ((NI32) 7);
681 goto BeforeRet_;
682 }
683 LA47_: ;
684 {
685 if (!((NU32)(((NU) 100000)) <= (NU32)(((NU) (v32))))) goto LA51_;
686 result = ((NI32) 6);
687 goto BeforeRet_;
688 }
689 LA51_: ;
690 {
691 if (!((NU32)(((NU) 10000)) <= (NU32)(((NU) (v32))))) goto LA55_;
692 result = ((NI32) 5);
693 goto BeforeRet_;
694 }
695 LA55_: ;
696 {
697 if (!((NU32)(((NU) 1000)) <= (NU32)(((NU) (v32))))) goto LA59_;
698 result = ((NI32) 4);
699 goto BeforeRet_;
700 }
701 LA59_: ;
702 {
703 if (!((NU32)(((NU) 100)) <= (NU32)(((NU) (v32))))) goto LA63_;
704 result = ((NI32) 3);
705 goto BeforeRet_;
706 }
707 LA63_: ;
708 {
709 if (!((NU32)(((NU) 10)) <= (NU32)(((NU) (v32))))) goto LA67_;
710 result = ((NI32) 2);
711 goto BeforeRet_;
712 }
713 LA67_: ;
714 result = ((NI32) 1);
715 goto BeforeRet_;
716 }BeforeRet_: ;
717 return result;
718 }
N_INLINE(void,utoa2Digits__stdZprivateZdigitsutils_21)719 static N_INLINE(void, utoa2Digits__stdZprivateZdigitsutils_21)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 digits) {
720 buf[pos] = digits100__stdZprivateZdigitsutils_2[((NU32)((NU32)(((NU32) 2)) * (NU32)(digits)))- 0];
721 buf[(NI)(pos + ((NI) 1))] = digits100__stdZprivateZdigitsutils_2[((NU32)((NU32)((NU32)((NU32)(((NU32) 2)) * (NU32)(digits))) + (NU32)(((NU32) 1))))- 0];
722 }
N_INLINE(NI32,trailingZeros2Digits__stdZprivateZdigitsutils_34)723 static N_INLINE(NI32, trailingZeros2Digits__stdZprivateZdigitsutils_34)(NU32 digits) {
724 NI32 result;
725 { result = (NI32)0;
726 result = ((NI32) (trailingZeros100__stdZprivateZdigitsutils_1[(digits)- 0]));
727 goto BeforeRet_;
728 }BeforeRet_: ;
729 return result;
730 }
N_INLINE(NI32,utoa8DigitsSkipTrailingZeros__systemZdragonbox_400)731 static N_INLINE(NI32, utoa8DigitsSkipTrailingZeros__systemZdragonbox_400)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 digits) {
732 NI32 result;
733 NU32 q;
734 NU32 r;
735 NU32 qH;
736 NU32 qL;
737 { result = (NI32)0;
738 q = (NU32)((NU32)(digits) / (NU32)(((NU32) 10000)));
739 r = (NU32)((NU32)(digits) % (NU32)(((NU32) 10000)));
740 qH = (NU32)((NU32)(q) / (NU32)(((NU32) 100)));
741 qL = (NU32)((NU32)(q) % (NU32)(((NU32) 100)));
742 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, pos, qH);
743 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, (NI)(pos + ((NI) 2)), qL);
744 {
745 NU32 T5_;
746 NI32 T11_;
747 NI T12_;
748 if (!(r == ((NU32) 0))) goto LA3_;
749 T5_ = (NU32)0;
750 {
751 if (!(qL == ((NU32) 0))) goto LA8_;
752 T5_ = qH;
753 }
754 goto LA6_;
755 LA8_: ;
756 {
757 T5_ = qL;
758 }
759 LA6_: ;
760 T11_ = (NI32)0;
761 T11_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(T5_);
762 T12_ = (NI)0;
763 {
764 if (!(qL == ((NU32) 0))) goto LA15_;
765 T12_ = ((NI) 6);
766 }
767 goto LA13_;
768 LA15_: ;
769 {
770 T12_ = ((NI) 4);
771 }
772 LA13_: ;
773 result = (NI32)(T11_ + ((NI32) (T12_)));
774 goto BeforeRet_;
775 }
776 goto LA1_;
777 LA3_: ;
778 {
779 NU32 rH;
780 NU32 rL;
781 NU32 T19_;
782 NI32 T25_;
783 NI T26_;
784 rH = (NU32)((NU32)(r) / (NU32)(((NU32) 100)));
785 rL = (NU32)((NU32)(r) % (NU32)(((NU32) 100)));
786 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, (NI)(pos + ((NI) 4)), rH);
787 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, (NI)(pos + ((NI) 6)), rL);
788 T19_ = (NU32)0;
789 {
790 if (!(rL == ((NU32) 0))) goto LA22_;
791 T19_ = rH;
792 }
793 goto LA20_;
794 LA22_: ;
795 {
796 T19_ = rL;
797 }
798 LA20_: ;
799 T25_ = (NI32)0;
800 T25_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(T19_);
801 T26_ = (NI)0;
802 {
803 if (!(rL == ((NU32) 0))) goto LA29_;
804 T26_ = ((NI) 2);
805 }
806 goto LA27_;
807 LA29_: ;
808 {
809 T26_ = ((NI) 0);
810 }
811 LA27_: ;
812 result = (NI32)(T25_ + ((NI32) (T26_)));
813 goto BeforeRet_;
814 }
815 LA1_: ;
816 }BeforeRet_: ;
817 return result;
818 }
N_INLINE(NI32,printDecimalDigitsBackwards__systemZdragonbox_417)819 static N_INLINE(NI32, printDecimalDigitsBackwards__systemZdragonbox_417)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU64 output64) {
820 NI32 result;
821 NI pos_2;
822 NU64 output64_2;
823 NI32 tz;
824 NI32 nd;
825 NU32 output;
826 { result = (NI32)0;
827 pos_2 = pos;
828 output64_2 = output64;
829 tz = ((NI32) 0);
830 nd = ((NI32) 0);
831 {
832 NU64 q;
833 NU32 r;
834 if (!((NU64)(100000000ULL) <= (NU64)(output64_2))) goto LA3_;
835 q = (NU64)((NU64)(output64_2) / (NU64)(100000000ULL));
836 r = ((NU32) ((NU64)((NU64)(output64_2) % (NU64)(100000000ULL))));
837 output64_2 = q;
838 pos_2 -= ((NI) 8);
839 {
840 if (!!((r == ((NU32) 0)))) goto LA7_;
841 tz = utoa8DigitsSkipTrailingZeros__systemZdragonbox_400(buf, bufLen_0, pos_2, r);
842 }
843 goto LA5_;
844 LA7_: ;
845 {
846 tz = ((NI32) 8);
847 }
848 LA5_: ;
849 nd = ((NI32) 8);
850 }
851 LA3_: ;
852 output = ((NU32) (output64_2));
853 {
854 NU32 q_2;
855 NU32 r_2;
856 if (!((NU32)(((NU32) 10000)) <= (NU32)(output))) goto LA12_;
857 q_2 = (NU32)((NU32)(output) / (NU32)(((NU32) 10000)));
858 r_2 = (NU32)((NU32)(output) % (NU32)(((NU32) 10000)));
859 output = q_2;
860 pos_2 -= ((NI) 4);
861 {
862 NU32 rH;
863 NU32 rL;
864 if (!!((r_2 == ((NU32) 0)))) goto LA16_;
865 rH = (NU32)((NU32)(r_2) / (NU32)(((NU32) 100)));
866 rL = (NU32)((NU32)(r_2) % (NU32)(((NU32) 100)));
867 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, pos_2, rH);
868 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, (NI)(pos_2 + ((NI) 2)), rL);
869 {
870 NU32 T22_;
871 NI32 T28_;
872 NI T29_;
873 if (!(tz == nd)) goto LA20_;
874 T22_ = (NU32)0;
875 {
876 if (!(rL == ((NU32) 0))) goto LA25_;
877 T22_ = rH;
878 }
879 goto LA23_;
880 LA25_: ;
881 {
882 T22_ = rL;
883 }
884 LA23_: ;
885 T28_ = (NI32)0;
886 T28_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(T22_);
887 T29_ = (NI)0;
888 {
889 if (!(rL == ((NU32) 0))) goto LA32_;
890 T29_ = ((NI) 2);
891 }
892 goto LA30_;
893 LA32_: ;
894 {
895 T29_ = ((NI) 0);
896 }
897 LA30_: ;
898 tz += ((NI) ((NI32)(T28_ + ((NI32) (T29_)))));
899 }
900 LA20_: ;
901 }
902 goto LA14_;
903 LA16_: ;
904 {
905 {
906 if (!(tz == nd)) goto LA38_;
907 tz += ((NI) 4);
908 }
909 goto LA36_;
910 LA38_: ;
911 {
912 {
913 NI i;
914 NI res;
915 i = (NI)0;
916 res = ((NI) 0);
917 {
918 while (1) {
919 if (!(res <= ((NI) 3))) goto LA43;
920 i = res;
921 buf[(NI)(pos_2 + i)] = 48;
922 res += ((NI) 1);
923 } LA43: ;
924 }
925 }
926 }
927 LA36_: ;
928 }
929 LA14_: ;
930 nd += ((NI) 4);
931 }
932 LA12_: ;
933 {
934 NU32 q_3;
935 NU32 r_3;
936 if (!((NU32)(((NU32) 100)) <= (NU32)(output))) goto LA46_;
937 q_3 = (NU32)((NU32)(output) / (NU32)(((NU32) 100)));
938 r_3 = (NU32)((NU32)(output) % (NU32)(((NU32) 100)));
939 output = q_3;
940 pos_2 -= ((NI) 2);
941 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, pos_2, r_3);
942 {
943 NI32 T52_;
944 if (!(tz == nd)) goto LA50_;
945 T52_ = (NI32)0;
946 T52_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(r_3);
947 tz += ((NI) (T52_));
948 }
949 LA50_: ;
950 nd += ((NI) 2);
951 {
952 NU32 q2;
953 NU32 r2;
954 if (!((NU32)(((NU32) 100)) <= (NU32)(output))) goto LA55_;
955 q2 = (NU32)((NU32)(output) / (NU32)(((NU32) 100)));
956 r2 = (NU32)((NU32)(output) % (NU32)(((NU32) 100)));
957 output = q2;
958 pos_2 -= ((NI) 2);
959 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, pos_2, r2);
960 {
961 NI32 T61_;
962 if (!(tz == nd)) goto LA59_;
963 T61_ = (NI32)0;
964 T61_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(r2);
965 tz += ((NI) (T61_));
966 }
967 LA59_: ;
968 nd += ((NI) 2);
969 }
970 LA55_: ;
971 }
972 LA46_: ;
973 {
974 NU32 q_4;
975 if (!((NU32)(((NU32) 10)) <= (NU32)(output))) goto LA64_;
976 q_4 = output;
977 pos_2 -= ((NI) 2);
978 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, pos_2, q_4);
979 {
980 NI32 T70_;
981 if (!(tz == nd)) goto LA68_;
982 T70_ = (NI32)0;
983 T70_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(q_4);
984 tz += ((NI) (T70_));
985 }
986 LA68_: ;
987 }
988 goto LA62_;
989 LA64_: ;
990 {
991 NU32 q_5;
992 q_5 = output;
993 pos_2 -= ((NI) 1);
994 buf[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32) 48)) + (NU32)(q_5))))));
995 }
996 LA62_: ;
997 result = tz;
998 goto BeforeRet_;
999 }BeforeRet_: ;
1000 return result;
1001 }
N_INLINE(NI,formatDigits__systemZdragonbox_548)1002 static N_INLINE(NI, formatDigits__systemZdragonbox_548)(NIM_CHAR* buffer, NI bufferLen_0, NI pos, NU64 digits, NI32 decimalExponent, NIM_BOOL forceTrailingDotZero) {
1003 NI result;
1004 NI pos_2;
1005 NI32 numDigits;
1006 NI32 decimalPoint;
1007 NIM_BOOL useFixed;
1008 NIM_BOOL T1_;
1009 NI32 decimalDigitsPosition;
1010 NI digitsEnd;
1011 NI32 tz;
1012 { result = (NI)0;
1013 pos_2 = pos;
1014 numDigits = decimalLength__systemZdragonbox_534(digits);
1015 decimalPoint = (NI32)(numDigits + decimalExponent);
1016 T1_ = (NIM_BOOL)0;
1017 T1_ = (((NI32) -6) <= decimalPoint);
1018 if (!(T1_)) goto LA2_;
1019 T1_ = (decimalPoint <= ((NI32) 17));
1020 LA2_: ;
1021 useFixed = T1_;
1022 {
1023 NI i;
1024 NI i_2;
1025 i = (NI)0;
1026 i_2 = ((NI) 0);
1027 {
1028 while (1) {
1029 if (!(i_2 < ((NI) 32))) goto LA5;
1030 i = i_2;
1031 buffer[(NI)(pos_2 + i)] = 48;
1032 i_2 += ((NI) 1);
1033 } LA5: ;
1034 }
1035 }
1036 decimalDigitsPosition = (NI32)0;
1037 {
1038 if (!useFixed) goto LA8_;
1039 {
1040 if (!(decimalPoint <= ((NI32) 0))) goto LA12_;
1041 decimalDigitsPosition = (NI32)(((NI32) 2) - decimalPoint);
1042 }
1043 goto LA10_;
1044 LA12_: ;
1045 {
1046 decimalDigitsPosition = ((NI32) 0);
1047 }
1048 LA10_: ;
1049 }
1050 goto LA6_;
1051 LA8_: ;
1052 {
1053 decimalDigitsPosition = ((NI32) 1);
1054 }
1055 LA6_: ;
1056 digitsEnd = (NI)(pos_2 + ((NI) ((NI32)(decimalDigitsPosition + numDigits))));
1057 tz = printDecimalDigitsBackwards__systemZdragonbox_417(buffer, bufferLen_0, digitsEnd, digits);
1058 digitsEnd -= ((NI) (tz));
1059 numDigits -= ((NI) (tz));
1060 {
1061 if (!useFixed) goto LA18_;
1062 {
1063 if (!(decimalPoint <= ((NI32) 0))) goto LA22_;
1064 buffer[(NI)(pos_2 + ((NI) 1))] = 46;
1065 pos_2 = digitsEnd;
1066 }
1067 goto LA20_;
1068 LA22_: ;
1069 {
1070 tyArray__Wfh9bjgBQ4UqJsyISUuDSuA tmp;
1071 if (!(decimalPoint < numDigits)) goto LA25_;
1072 nimZeroMem((void*)tmp, sizeof(tyArray__Wfh9bjgBQ4UqJsyISUuDSuA));
1073 {
1074 NI i_3;
1075 NI i_4;
1076 i_3 = (NI)0;
1077 i_4 = ((NI) 0);
1078 {
1079 while (1) {
1080 if (!(i_4 < ((NI) 16))) goto LA29;
1081 i_3 = i_4;
1082 tmp[(i_3)- 0] = buffer[(NI)((NI)(i_3 + pos_2) + ((NI) (decimalPoint)))];
1083 i_4 += ((NI) 1);
1084 } LA29: ;
1085 }
1086 }
1087 {
1088 NI i_5;
1089 NI i_6;
1090 i_5 = (NI)0;
1091 i_6 = ((NI) 0);
1092 {
1093 while (1) {
1094 if (!(i_6 < ((NI) 16))) goto LA32;
1095 i_5 = i_6;
1096 buffer[(NI)((NI)((NI)(i_5 + pos_2) + ((NI) (decimalPoint))) + ((NI) 1))] = tmp[(i_5)- 0];
1097 i_6 += ((NI) 1);
1098 } LA32: ;
1099 }
1100 }
1101 buffer[(NI)(pos_2 + ((NI) (decimalPoint)))] = 46;
1102 pos_2 = (NI)(digitsEnd + ((NI) 1));
1103 }
1104 goto LA20_;
1105 LA25_: ;
1106 {
1107 pos_2 += ((NI) (decimalPoint));
1108 {
1109 if (!forceTrailingDotZero) goto LA36_;
1110 buffer[pos_2] = 46;
1111 buffer[(NI)(pos_2 + ((NI) 1))] = 48;
1112 pos_2 += ((NI) 2);
1113 }
1114 LA36_: ;
1115 }
1116 LA20_: ;
1117 }
1118 goto LA16_;
1119 LA18_: ;
1120 {
1121 NI32 scientificExponent;
1122 NU32 k;
1123 NI32 T49_;
1124 buffer[pos_2] = buffer[(NI)(pos_2 + ((NI) 1))];
1125 {
1126 if (!(numDigits == ((NI32) 1))) goto LA41_;
1127 pos_2 += ((NI) 1);
1128 }
1129 goto LA39_;
1130 LA41_: ;
1131 {
1132 buffer[(NI)(pos_2 + ((NI) 1))] = 46;
1133 pos_2 = digitsEnd;
1134 }
1135 LA39_: ;
1136 scientificExponent = (NI32)(decimalPoint - ((NI32) 1));
1137 buffer[pos_2] = 101;
1138 {
1139 if (!(scientificExponent < ((NI32) 0))) goto LA46_;
1140 buffer[(NI)(pos_2 + ((NI) 1))] = 45;
1141 }
1142 goto LA44_;
1143 LA46_: ;
1144 {
1145 buffer[(NI)(pos_2 + ((NI) 1))] = 43;
1146 }
1147 LA44_: ;
1148 pos_2 += ((NI) 2);
1149 T49_ = (NI32)0;
1150 {
1151 if (!(scientificExponent < ((NI32) 0))) goto LA52_;
1152 T49_ = ((NI32)-(scientificExponent));
1153 }
1154 goto LA50_;
1155 LA52_: ;
1156 {
1157 T49_ = scientificExponent;
1158 }
1159 LA50_: ;
1160 k = ((NU32) (T49_));
1161 {
1162 if (!((NU32)(k) < (NU32)(((NU32) 10)))) goto LA57_;
1163 buffer[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32) 48)) + (NU32)(k))))));
1164 pos_2 += ((NI) 1);
1165 }
1166 goto LA55_;
1167 LA57_: ;
1168 {
1169 if (!((NU32)(k) < (NU32)(((NU32) 100)))) goto LA60_;
1170 utoa2Digits__stdZprivateZdigitsutils_21(buffer, bufferLen_0, pos_2, k);
1171 pos_2 += ((NI) 2);
1172 }
1173 goto LA55_;
1174 LA60_: ;
1175 {
1176 NU32 q;
1177 NU32 r;
1178 q = (NU32)((NU32)(k) / (NU32)(((NU32) 100)));
1179 r = (NU32)((NU32)(k) % (NU32)(((NU32) 100)));
1180 buffer[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32) 48)) + (NU32)(q))))));
1181 pos_2 += ((NI) 1);
1182 utoa2Digits__stdZprivateZdigitsutils_21(buffer, bufferLen_0, pos_2, r);
1183 pos_2 += ((NI) 2);
1184 }
1185 LA55_: ;
1186 }
1187 LA16_: ;
1188 result = pos_2;
1189 goto BeforeRet_;
1190 }BeforeRet_: ;
1191 return result;
1192 }
N_INLINE(NI,toChars__systemZdragonbox_672)1193 static N_INLINE(NI, toChars__systemZdragonbox_672)(NIM_CHAR* buffer, NI bufferLen_0, NF v, NIM_BOOL forceTrailingDotZero) {
1194 NI result;
1195 NI pos;
1196 NU64 significand;
1197 tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw T1_;
1198 NU64 exponent;
1199 tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw T2_;
1200 { result = (NI)0;
1201 pos = ((NI) 0);
1202 T1_ = constructDouble__systemZdragonbox_31(v);
1203 significand = physicalSignificand__systemZdragonbox_34(T1_);
1204 T2_ = constructDouble__systemZdragonbox_31(v);
1205 exponent = physicalExponent__systemZdragonbox_37(T2_);
1206 {
1207 tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw T7_;
1208 NI T8_;
1209 if (!!((exponent == 2047ULL))) goto LA5_;
1210 buffer[pos] = 45;
1211 T7_ = constructDouble__systemZdragonbox_31(v);
1212 T8_ = (NI)0;
1213 T8_ = signBit__systemZdragonbox_56(T7_);
1214 pos += T8_;
1215 {
1216 NIM_BOOL T11_;
1217 tyObject_FloatingDecimal64__vQfQtj1GrzWru758F3GQIg dec;
1218 T11_ = (NIM_BOOL)0;
1219 T11_ = !((exponent == 0ULL));
1220 if (T11_) goto LA12_;
1221 T11_ = !((significand == 0ULL));
1222 LA12_: ;
1223 if (!T11_) goto LA13_;
1224 dec = toDecimal64__systemZdragonbox_336(significand, exponent);
1225 result = formatDigits__systemZdragonbox_548(buffer, bufferLen_0, pos, dec.significand, dec.exponent, forceTrailingDotZero);
1226 goto BeforeRet_;
1227 }
1228 goto LA9_;
1229 LA13_: ;
1230 {
1231 NI T16_;
1232 buffer[pos] = 48;
1233 buffer[(NI)(pos + ((NI) 1))] = 46;
1234 buffer[(NI)(pos + ((NI) 2))] = 48;
1235 buffer[(NI)(pos + ((NI) 3))] = 32;
1236 T16_ = (NI)0;
1237 {
1238 if (!forceTrailingDotZero) goto LA19_;
1239 T16_ = ((NI) 3);
1240 }
1241 goto LA17_;
1242 LA19_: ;
1243 {
1244 T16_ = ((NI) 1);
1245 }
1246 LA17_: ;
1247 pos += T16_;
1248 result = pos;
1249 goto BeforeRet_;
1250 }
1251 LA9_: ;
1252 }
1253 LA5_: ;
1254 {
1255 tyObject_Double__IoVNMXAH9aQnPnWZZsWMVxw T26_;
1256 NI T27_;
1257 if (!(significand == 0ULL)) goto LA24_;
1258 buffer[pos] = 45;
1259 T26_ = constructDouble__systemZdragonbox_31(v);
1260 T27_ = (NI)0;
1261 T27_ = signBit__systemZdragonbox_56(T26_);
1262 pos += T27_;
1263 buffer[pos] = 105;
1264 buffer[(NI)(pos + ((NI) 1))] = 110;
1265 buffer[(NI)(pos + ((NI) 2))] = 102;
1266 buffer[(NI)(pos + ((NI) 3))] = 32;
1267 result = (NI)(pos + ((NI) 3));
1268 goto BeforeRet_;
1269 }
1270 goto LA22_;
1271 LA24_: ;
1272 {
1273 buffer[pos] = 110;
1274 buffer[(NI)(pos + ((NI) 1))] = 97;
1275 buffer[(NI)(pos + ((NI) 2))] = 110;
1276 buffer[(NI)(pos + ((NI) 3))] = 32;
1277 result = (NI)(pos + ((NI) 3));
1278 goto BeforeRet_;
1279 }
1280 LA22_: ;
1281 }BeforeRet_: ;
1282 return result;
1283 }
N_NIMCALL(NI,writeFloatToBufferRoundtrip__systemZformatfloat_13)1284 N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferRoundtrip__systemZformatfloat_13)(NIM_CHAR* buf, NF value) {
1285 NI result;
1286 result = (NI)0;
1287 result = toChars__systemZdragonbox_672(buf, 65, value, NIM_TRUE);
1288 buf[(result)- 0] = 0;
1289 return result;
1290 }
N_NIMCALL(void,addCstringN__systemZformatfloat_5)1291 N_LIB_PRIVATE N_NIMCALL(void, addCstringN__systemZformatfloat_5)(NimStringDesc** result, NCSTRING buf, NI buflen) {
1292 NI oldLen;
1293 NI newLen;
1294 void* T1_;
1295 oldLen = ((*result) ? (*result)->Sup.len : 0);
1296 newLen = (NI)(oldLen + buflen);
1297 unsureAsgnRef((void**) (&(*result)), setLengthStr((*result), ((NI) (newLen))));
1298 T1_ = (void*)0;
1299 T1_ = memcpy(((void*) ((&(*result)->data[oldLen]))), ((void*) (buf)), ((size_t) (buflen)));
1300 }
N_NIMCALL(void,writeToBuffer__systemZformatfloat_51)1301 N_LIB_PRIVATE N_NIMCALL(void, writeToBuffer__systemZformatfloat_51)(NIM_CHAR* buf, NCSTRING value) {
1302 NI i;
1303 i = ((NI) 0);
1304 {
1305 while (1) {
1306 if (!!(((NU8)(value[i]) == (NU8)(0)))) goto LA2;
1307 buf[(i)- 0] = value[i];
1308 i += ((NI) 1);
1309 } LA2: ;
1310 }
1311 }
N_NIMCALL(NI,writeFloatToBufferSprintf__systemZformatfloat_59)1312 N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferSprintf__systemZformatfloat_59)(NIM_CHAR* buf, NF value) {
1313 NI result;
1314 NI n;
1315 int T1_;
1316 NIM_BOOL hasDot;
1317 result = (NI)0;
1318 T1_ = (int)0;
1319 T1_ = sprintf(((NCSTRING) (buf)), "%.16g", value);
1320 n = ((NI) (T1_));
1321 hasDot = NIM_FALSE;
1322 {
1323 NI i;
1324 NI colontmp_;
1325 NI res;
1326 i = (NI)0;
1327 colontmp_ = (NI)0;
1328 colontmp_ = (NI)(n - ((NI) 1));
1329 res = ((NI) 0);
1330 {
1331 while (1) {
1332 if (!(res <= colontmp_)) goto LA4;
1333 i = res;
1334 {
1335 if (!((NU8)(buf[(i)- 0]) == (NU8)(44))) goto LA7_;
1336 buf[(i)- 0] = 46;
1337 hasDot = NIM_TRUE;
1338 }
1339 goto LA5_;
1340 LA7_: ;
1341 {
1342 if (!(((NU8)(buf[(i)- 0])) >= ((NU8)(97)) && ((NU8)(buf[(i)- 0])) <= ((NU8)(122)) || ((NU8)(buf[(i)- 0])) >= ((NU8)(65)) && ((NU8)(buf[(i)- 0])) <= ((NU8)(90)) || ((NU8)(buf[(i)- 0])) == ((NU8)(46)))) goto LA10_;
1343 hasDot = NIM_TRUE;
1344 }
1345 goto LA5_;
1346 LA10_: ;
1347 LA5_: ;
1348 res += ((NI) 1);
1349 } LA4: ;
1350 }
1351 }
1352 {
1353 if (!!(hasDot)) goto LA14_;
1354 buf[(n)- 0] = 46;
1355 buf[((NI)(n + ((NI) 1)))- 0] = 48;
1356 buf[((NI)(n + ((NI) 2)))- 0] = 0;
1357 result = (NI)(n + ((NI) 2));
1358 }
1359 goto LA12_;
1360 LA14_: ;
1361 {
1362 result = n;
1363 }
1364 LA12_: ;
1365 {
1366 if (!(((NU8)(buf[((NI)(n - ((NI) 1)))- 0])) == ((NU8)(110)) || ((NU8)(buf[((NI)(n - ((NI) 1)))- 0])) == ((NU8)(78)) || ((NU8)(buf[((NI)(n - ((NI) 1)))- 0])) == ((NU8)(68)) || ((NU8)(buf[((NI)(n - ((NI) 1)))- 0])) == ((NU8)(100)) || ((NU8)(buf[((NI)(n - ((NI) 1)))- 0])) == ((NU8)(41)))) goto LA19_;
1367 writeToBuffer__systemZformatfloat_51(buf, "nan");
1368 result = ((NI) 3);
1369 }
1370 goto LA17_;
1371 LA19_: ;
1372 {
1373 if (!((NU8)(buf[((NI)(n - ((NI) 1)))- 0]) == (NU8)(70))) goto LA22_;
1374 {
1375 if (!((NU8)(buf[(((NI) 0))- 0]) == (NU8)(45))) goto LA26_;
1376 writeToBuffer__systemZformatfloat_51(buf, "-inf");
1377 result = ((NI) 4);
1378 }
1379 goto LA24_;
1380 LA26_: ;
1381 {
1382 writeToBuffer__systemZformatfloat_51(buf, "inf");
1383 result = ((NI) 3);
1384 }
1385 LA24_: ;
1386 }
1387 goto LA17_;
1388 LA22_: ;
1389 LA17_: ;
1390 return result;
1391 }
N_NIMCALL(void,addFloatSprintf__systemZformatfloat_99)1392 N_LIB_PRIVATE N_NIMCALL(void, addFloatSprintf__systemZformatfloat_99)(NimStringDesc** result, NF x) {
1393 tyArray__eVNFTutn6un5gcq48fQLdg buffer;
1394 NI n;
1395 n = writeFloatToBufferSprintf__systemZformatfloat_59(buffer, x);
1396 addCstringN__systemZformatfloat_5(result, ((NCSTRING) ((&buffer[(((NI) 0))- 0]))), n);
1397 }
N_INLINE(NIM_BOOL,multipleOfPow2__systemZschubfach_125)1398 static N_INLINE(NIM_BOOL, multipleOfPow2__systemZschubfach_125)(NU32 value, NI32 e2) {
1399 NIM_BOOL result;
1400 { result = (NIM_BOOL)0;
1401 result = ((NU32)(value & (NU32)((NU32)((NU32)((NU32)(((NU32) 1)) << (NU32)(e2))) - (NU32)(((NU32) 1)))) == ((NU32) 0));
1402 goto BeforeRet_;
1403 }BeforeRet_: ;
1404 return result;
1405 }
N_INLINE(NI32,floorDivPow2__systemZschubfach_59)1406 static N_INLINE(NI32, floorDivPow2__systemZschubfach_59)(NI32 x, NI32 n) {
1407 NI32 result;
1408 { result = (NI32)0;
1409 result = (NI32)((NI32)(x) >> (NU32)(n));
1410 goto BeforeRet_;
1411 }BeforeRet_: ;
1412 return result;
1413 }
N_INLINE(NI32,floorLog2Pow10__systemZschubfach_67)1414 static N_INLINE(NI32, floorLog2Pow10__systemZschubfach_67)(NI32 e) {
1415 NI32 result;
1416 { result = (NI32)0;
1417 result = floorDivPow2__systemZschubfach_59((NI32)(e * ((NI32) 1741647)), ((NI32) 19));
1418 goto BeforeRet_;
1419 }BeforeRet_: ;
1420 return result;
1421 }
N_INLINE(NU64,computePow10Single__systemZschubfach_88)1422 static N_INLINE(NU64, computePow10Single__systemZschubfach_88)(NI32 k) {
1423 NU64 result;
1424 { result = (NU64)0;
1425 result = g__systemZschubfach_78[((NI32)(k - ((NI32) -31)))- 0];
1426 goto BeforeRet_;
1427 }BeforeRet_: ;
1428 return result;
1429 }
N_INLINE(NU32,lo32__systemZschubfach_106)1430 static N_INLINE(NU32, lo32__systemZschubfach_106)(NU64 x) {
1431 NU32 result;
1432 { result = (NU32)0;
1433 result = ((NU32) (x));
1434 goto BeforeRet_;
1435 }BeforeRet_: ;
1436 return result;
1437 }
N_INLINE(NU32,hi32__systemZschubfach_109)1438 static N_INLINE(NU32, hi32__systemZschubfach_109)(NU64 x) {
1439 NU32 result;
1440 { result = (NU32)0;
1441 result = ((NU32) ((NU64)((NU64)(x) >> (NU64)(((NI) 32)))));
1442 goto BeforeRet_;
1443 }BeforeRet_: ;
1444 return result;
1445 }
N_INLINE(NU32,roundToOdd__systemZschubfach_116)1446 static N_INLINE(NU32, roundToOdd__systemZschubfach_116)(NU64 g, NU32 cp) {
1447 NU32 result;
1448 NU64 b01;
1449 NU32 T1_;
1450 NU64 b11;
1451 NU32 T2_;
1452 NU64 hi;
1453 NU32 T3_;
1454 NU32 y1;
1455 NU32 y0;
1456 { result = (NU32)0;
1457 T1_ = (NU32)0;
1458 T1_ = lo32__systemZschubfach_106(g);
1459 b01 = (NU64)((NU64)(((NU64) (T1_))) * (NU64)(((NU64) (cp))));
1460 T2_ = (NU32)0;
1461 T2_ = hi32__systemZschubfach_109(g);
1462 b11 = (NU64)((NU64)(((NU64) (T2_))) * (NU64)(((NU64) (cp))));
1463 T3_ = (NU32)0;
1464 T3_ = hi32__systemZschubfach_109(b01);
1465 hi = (NU64)((NU64)(b11) + (NU64)(((NU64) (T3_))));
1466 y1 = hi32__systemZschubfach_109(hi);
1467 y0 = lo32__systemZschubfach_106(hi);
1468 result = (NU32)(y1 | ((NU32) (((NU32)(((NU32) 1)) < (NU32)(y0)))));
1469 goto BeforeRet_;
1470 }BeforeRet_: ;
1471 return result;
1472 }
N_INLINE(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg,toDecimal32__systemZschubfach_142)1473 static N_INLINE(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg, toDecimal32__systemZschubfach_142)(NU32 ieeeSignificand, NU32 ieeeExponent) {
1474 tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg result;
1475 NU32 c;
1476 NI32 q;
1477 NIM_BOOL isEven;
1478 NIM_BOOL lowerBoundaryIsCloser;
1479 NIM_BOOL T14_;
1480 NU32 cbl;
1481 NU32 cb;
1482 NU32 cbr;
1483 NI32 k;
1484 NI T16_;
1485 NI32 h;
1486 NI32 T22_;
1487 NU64 pow10;
1488 NU32 vbl;
1489 NU32 vb;
1490 NU32 vbr;
1491 NU32 lower;
1492 NU32 upper;
1493 NU32 s;
1494 NIM_BOOL uInside;
1495 NIM_BOOL wInside;
1496 NU32 mid;
1497 NIM_BOOL roundUp;
1498 NIM_BOOL T35_;
1499 NIM_BOOL T37_;
1500 { nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
1501 c = (NU32)0;
1502 q = (NI32)0;
1503 {
1504 if (!!((ieeeExponent == ((NU32) 0)))) goto LA3_;
1505 c = (NU32)(((NU32) 8388608) | ieeeSignificand);
1506 q = (NI32)(((NI32) (ieeeExponent)) - ((NI32) 150));
1507 {
1508 NIM_BOOL T7_;
1509 NIM_BOOL T8_;
1510 T7_ = (NIM_BOOL)0;
1511 T8_ = (NIM_BOOL)0;
1512 T8_ = (((NI32) 0) <= ((NI32)-(q)));
1513 if (!(T8_)) goto LA9_;
1514 T8_ = (((NI32)-(q)) < ((NI32) 24));
1515 LA9_: ;
1516 T7_ = T8_;
1517 if (!(T7_)) goto LA10_;
1518 T7_ = multipleOfPow2__systemZschubfach_125(c, ((NI32)-(q)));
1519 LA10_: ;
1520 if (!T7_) goto LA11_;
1521 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
1522 result.digits = (NU32)((NU32)(c) >> (NU32)(((NI32)-(q))));
1523 result.exponent = ((NI32) 0);
1524 goto BeforeRet_;
1525 }
1526 LA11_: ;
1527 }
1528 goto LA1_;
1529 LA3_: ;
1530 {
1531 c = ieeeSignificand;
1532 q = ((NI32) -149);
1533 }
1534 LA1_: ;
1535 isEven = ((NU32)((NU32)(c) % (NU32)(((NU32) 2))) == ((NU32) 0));
1536 T14_ = (NIM_BOOL)0;
1537 T14_ = (ieeeSignificand == ((NU32) 0));
1538 if (!(T14_)) goto LA15_;
1539 T14_ = ((NU32)(((NU32) 1)) < (NU32)(ieeeExponent));
1540 LA15_: ;
1541 lowerBoundaryIsCloser = T14_;
1542 cbl = (NU32)((NU32)((NU32)((NU32)((NU32)((NU32)(((NU32) 4)) * (NU32)(c))) - (NU32)(((NU32) 2)))) + (NU32)(((NU32) (lowerBoundaryIsCloser))));
1543 cb = (NU32)((NU32)(((NU32) 4)) * (NU32)(c));
1544 cbr = (NU32)((NU32)((NU32)((NU32)(((NU32) 4)) * (NU32)(c))) + (NU32)(((NU32) 2)));
1545 T16_ = (NI)0;
1546 {
1547 if (!lowerBoundaryIsCloser) goto LA19_;
1548 T16_ = ((NI) 524031);
1549 }
1550 goto LA17_;
1551 LA19_: ;
1552 {
1553 T16_ = ((NI) 0);
1554 }
1555 LA17_: ;
1556 k = floorDivPow2__systemZschubfach_59((NI32)((NI32)(q * ((NI32) 1262611)) - ((NI32) (T16_))), ((NI32) 22));
1557 T22_ = (NI32)0;
1558 T22_ = floorLog2Pow10__systemZschubfach_67(((NI32)-(k)));
1559 h = (NI32)((NI32)(q + T22_) + ((NI32) 1));
1560 pow10 = computePow10Single__systemZschubfach_88(((NI32)-(k)));
1561 vbl = roundToOdd__systemZschubfach_116(pow10, (NU32)((NU32)(cbl) << (NU32)(h)));
1562 vb = roundToOdd__systemZschubfach_116(pow10, (NU32)((NU32)(cb) << (NU32)(h)));
1563 vbr = roundToOdd__systemZschubfach_116(pow10, (NU32)((NU32)(cbr) << (NU32)(h)));
1564 lower = (NU32)((NU32)(vbl) + (NU32)(((NU32) (!(isEven)))));
1565 upper = (NU32)((NU32)(vbr) - (NU32)(((NU32) (!(isEven)))));
1566 s = (NU32)((NU32)(vb) / (NU32)(((NU32) 4)));
1567 {
1568 NU32 sp;
1569 NIM_BOOL upInside;
1570 NIM_BOOL wpInside;
1571 if (!((NU32)(((NU32) 10)) <= (NU32)(s))) goto LA25_;
1572 sp = (NU32)((NU32)(s) / (NU32)(((NU32) 10)));
1573 upInside = ((NU32)(lower) <= (NU32)((NU32)((NU32)(((NU32) 40)) * (NU32)(sp))));
1574 wpInside = ((NU32)((NU32)((NU32)((NU32)((NU32)(((NU32) 40)) * (NU32)(sp))) + (NU32)(((NU32) 40)))) <= (NU32)(upper));
1575 {
1576 if (!!((upInside == wpInside))) goto LA29_;
1577 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
1578 result.digits = (NU32)((NU32)(sp) + (NU32)(((NU32) (wpInside))));
1579 result.exponent = (NI32)(k + ((NI32) 1));
1580 goto BeforeRet_;
1581 }
1582 LA29_: ;
1583 }
1584 LA25_: ;
1585 uInside = ((NU32)(lower) <= (NU32)((NU32)((NU32)(((NU32) 4)) * (NU32)(s))));
1586 wInside = ((NU32)((NU32)((NU32)((NU32)((NU32)(((NU32) 4)) * (NU32)(s))) + (NU32)(((NU32) 4)))) <= (NU32)(upper));
1587 {
1588 if (!!((uInside == wInside))) goto LA33_;
1589 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
1590 result.digits = (NU32)((NU32)(s) + (NU32)(((NU32) (wInside))));
1591 result.exponent = k;
1592 goto BeforeRet_;
1593 }
1594 LA33_: ;
1595 mid = (NU32)((NU32)((NU32)((NU32)(((NU32) 4)) * (NU32)(s))) + (NU32)(((NU32) 2)));
1596 T35_ = (NIM_BOOL)0;
1597 T35_ = ((NU32)(mid) < (NU32)(vb));
1598 if (T35_) goto LA36_;
1599 T37_ = (NIM_BOOL)0;
1600 T37_ = (vb == mid);
1601 if (!(T37_)) goto LA38_;
1602 T37_ = !(((NU32)(s & ((NU32) 1)) == ((NU32) 0)));
1603 LA38_: ;
1604 T35_ = T37_;
1605 LA36_: ;
1606 roundUp = T35_;
1607 nimZeroMem((void*)(&result), sizeof(tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg));
1608 result.digits = (NU32)((NU32)(s) + (NU32)(((NU32) (roundUp))));
1609 result.exponent = k;
1610 goto BeforeRet_;
1611 }BeforeRet_: ;
1612 return result;
1613 }
N_INLINE(NI32,decimalLength__systemZschubfach_277)1614 static N_INLINE(NI32, decimalLength__systemZschubfach_277)(NU32 v) {
1615 NI32 result;
1616 { result = (NI32)0;
1617 {
1618 if (!((NU32)(((NU) 100000000)) <= (NU32)(((NU) (v))))) goto LA3_;
1619 result = ((NI32) 9);
1620 goto BeforeRet_;
1621 }
1622 LA3_: ;
1623 {
1624 if (!((NU32)(((NU) 10000000)) <= (NU32)(((NU) (v))))) goto LA7_;
1625 result = ((NI32) 8);
1626 goto BeforeRet_;
1627 }
1628 LA7_: ;
1629 {
1630 if (!((NU32)(((NU) 1000000)) <= (NU32)(((NU) (v))))) goto LA11_;
1631 result = ((NI32) 7);
1632 goto BeforeRet_;
1633 }
1634 LA11_: ;
1635 {
1636 if (!((NU32)(((NU) 100000)) <= (NU32)(((NU) (v))))) goto LA15_;
1637 result = ((NI32) 6);
1638 goto BeforeRet_;
1639 }
1640 LA15_: ;
1641 {
1642 if (!((NU32)(((NU) 10000)) <= (NU32)(((NU) (v))))) goto LA19_;
1643 result = ((NI32) 5);
1644 goto BeforeRet_;
1645 }
1646 LA19_: ;
1647 {
1648 if (!((NU32)(((NU) 1000)) <= (NU32)(((NU) (v))))) goto LA23_;
1649 result = ((NI32) 4);
1650 goto BeforeRet_;
1651 }
1652 LA23_: ;
1653 {
1654 if (!((NU32)(((NU) 100)) <= (NU32)(((NU) (v))))) goto LA27_;
1655 result = ((NI32) 3);
1656 goto BeforeRet_;
1657 }
1658 LA27_: ;
1659 {
1660 if (!((NU32)(((NU) 10)) <= (NU32)(((NU) (v))))) goto LA31_;
1661 result = ((NI32) 2);
1662 goto BeforeRet_;
1663 }
1664 LA31_: ;
1665 result = ((NI32) 1);
1666 goto BeforeRet_;
1667 }BeforeRet_: ;
1668 return result;
1669 }
N_INLINE(NI32,printDecimalDigitsBackwards__systemZschubfach_206)1670 static N_INLINE(NI32, printDecimalDigitsBackwards__systemZschubfach_206)(NIM_CHAR* buf, NI bufLen_0, NI pos, NU32 output) {
1671 NI32 result;
1672 NU32 output_2;
1673 NI pos_2;
1674 NI32 tz;
1675 NI32 nd;
1676 { result = (NI32)0;
1677 output_2 = output;
1678 pos_2 = pos;
1679 tz = ((NI32) 0);
1680 nd = ((NI32) 0);
1681 {
1682 NU32 q;
1683 NU32 r;
1684 if (!((NU32)(((NU32) 10000)) <= (NU32)(output_2))) goto LA3_;
1685 q = (NU32)((NU32)(output_2) / (NU32)(((NU32) 10000)));
1686 r = (NU32)((NU32)(output_2) % (NU32)(((NU32) 10000)));
1687 output_2 = q;
1688 pos_2 -= ((NI) 4);
1689 {
1690 NU32 rH;
1691 NU32 rL;
1692 NU32 T9_;
1693 NI32 T15_;
1694 NI T16_;
1695 if (!!((r == ((NU32) 0)))) goto LA7_;
1696 rH = (NU32)((NU32)(r) / (NU32)(((NU32) 100)));
1697 rL = (NU32)((NU32)(r) % (NU32)(((NU32) 100)));
1698 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, pos_2, rH);
1699 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, (NI)(pos_2 + ((NI) 2)), rL);
1700 T9_ = (NU32)0;
1701 {
1702 if (!(rL == ((NU32) 0))) goto LA12_;
1703 T9_ = rH;
1704 }
1705 goto LA10_;
1706 LA12_: ;
1707 {
1708 T9_ = rL;
1709 }
1710 LA10_: ;
1711 T15_ = (NI32)0;
1712 T15_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(T9_);
1713 T16_ = (NI)0;
1714 {
1715 if (!(rL == ((NU32) 0))) goto LA19_;
1716 T16_ = ((NI) 2);
1717 }
1718 goto LA17_;
1719 LA19_: ;
1720 {
1721 T16_ = ((NI) 0);
1722 }
1723 LA17_: ;
1724 tz = (NI32)(T15_ + ((NI32) (T16_)));
1725 }
1726 goto LA5_;
1727 LA7_: ;
1728 {
1729 tz = ((NI32) 4);
1730 }
1731 LA5_: ;
1732 nd = ((NI32) 4);
1733 }
1734 LA3_: ;
1735 {
1736 NU32 q_2;
1737 NU32 r_2;
1738 if (!((NU32)(((NU32) 100)) <= (NU32)(output_2))) goto LA25_;
1739 q_2 = (NU32)((NU32)(output_2) / (NU32)(((NU32) 100)));
1740 r_2 = (NU32)((NU32)(output_2) % (NU32)(((NU32) 100)));
1741 output_2 = q_2;
1742 pos_2 -= ((NI) 2);
1743 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, pos_2, r_2);
1744 {
1745 NI32 T31_;
1746 if (!(tz == nd)) goto LA29_;
1747 T31_ = (NI32)0;
1748 T31_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(r_2);
1749 tz += ((NI) (T31_));
1750 }
1751 LA29_: ;
1752 nd += ((NI) 2);
1753 {
1754 NU32 q2;
1755 NU32 r2;
1756 if (!((NU32)(((NU32) 100)) <= (NU32)(output_2))) goto LA34_;
1757 q2 = (NU32)((NU32)(output_2) / (NU32)(((NU32) 100)));
1758 r2 = (NU32)((NU32)(output_2) % (NU32)(((NU32) 100)));
1759 output_2 = q2;
1760 pos_2 -= ((NI) 2);
1761 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, pos_2, r2);
1762 {
1763 NI32 T40_;
1764 if (!(tz == nd)) goto LA38_;
1765 T40_ = (NI32)0;
1766 T40_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(r2);
1767 tz += ((NI) (T40_));
1768 }
1769 LA38_: ;
1770 nd += ((NI) 2);
1771 }
1772 LA34_: ;
1773 }
1774 LA25_: ;
1775 {
1776 NU32 q_3;
1777 if (!((NU32)(((NU32) 10)) <= (NU32)(output_2))) goto LA43_;
1778 q_3 = output_2;
1779 pos_2 -= ((NI) 2);
1780 utoa2Digits__stdZprivateZdigitsutils_21(buf, bufLen_0, pos_2, q_3);
1781 {
1782 NI32 T49_;
1783 if (!(tz == nd)) goto LA47_;
1784 T49_ = (NI32)0;
1785 T49_ = trailingZeros2Digits__stdZprivateZdigitsutils_34(q_3);
1786 tz += ((NI) (T49_));
1787 }
1788 LA47_: ;
1789 }
1790 goto LA41_;
1791 LA43_: ;
1792 {
1793 NU32 q_4;
1794 q_4 = output_2;
1795 pos_2 -= ((NI) 1);
1796 buf[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32) 48)) + (NU32)(q_4))))));
1797 }
1798 LA41_: ;
1799 result = tz;
1800 goto BeforeRet_;
1801 }BeforeRet_: ;
1802 return result;
1803 }
N_INLINE(NI,formatDigits__systemZschubfach_286)1804 static N_INLINE(NI, formatDigits__systemZschubfach_286)(NIM_CHAR* buffer, NI bufferLen_0, NI pos, NU32 digits, NI32 decimalExponent, NIM_BOOL forceTrailingDotZero) {
1805 NI result;
1806 NI pos_2;
1807 NI32 numDigits;
1808 NI32 decimalPoint;
1809 NIM_BOOL useFixed;
1810 NIM_BOOL T1_;
1811 NI32 decimalDigitsPosition;
1812 NI digitsEnd;
1813 NI32 tz;
1814 { result = (NI)0;
1815 pos_2 = pos;
1816 numDigits = decimalLength__systemZschubfach_277(digits);
1817 decimalPoint = (NI32)(numDigits + decimalExponent);
1818 T1_ = (NIM_BOOL)0;
1819 T1_ = (((NI32) -4) <= decimalPoint);
1820 if (!(T1_)) goto LA2_;
1821 T1_ = (decimalPoint <= ((NI32) 9));
1822 LA2_: ;
1823 useFixed = T1_;
1824 {
1825 NI i;
1826 NI i_2;
1827 i = (NI)0;
1828 i_2 = ((NI) 0);
1829 {
1830 while (1) {
1831 if (!(i_2 < ((NI) 32))) goto LA5;
1832 i = i_2;
1833 buffer[(NI)(pos_2 + i)] = 48;
1834 i_2 += ((NI) 1);
1835 } LA5: ;
1836 }
1837 }
1838 decimalDigitsPosition = (NI32)0;
1839 {
1840 if (!useFixed) goto LA8_;
1841 {
1842 if (!(decimalPoint <= ((NI32) 0))) goto LA12_;
1843 decimalDigitsPosition = (NI32)(((NI32) 2) - decimalPoint);
1844 }
1845 goto LA10_;
1846 LA12_: ;
1847 {
1848 decimalDigitsPosition = ((NI32) 0);
1849 }
1850 LA10_: ;
1851 }
1852 goto LA6_;
1853 LA8_: ;
1854 {
1855 decimalDigitsPosition = ((NI32) 1);
1856 }
1857 LA6_: ;
1858 digitsEnd = (NI)((NI)(pos_2 + ((NI) (decimalDigitsPosition))) + ((NI) (numDigits)));
1859 tz = printDecimalDigitsBackwards__systemZschubfach_206(buffer, bufferLen_0, digitsEnd, digits);
1860 digitsEnd -= ((NI) (tz));
1861 numDigits -= ((NI) (tz));
1862 {
1863 if (!useFixed) goto LA18_;
1864 {
1865 if (!(decimalPoint <= ((NI32) 0))) goto LA22_;
1866 buffer[(NI)(pos_2 + ((NI) 1))] = 46;
1867 pos_2 = digitsEnd;
1868 }
1869 goto LA20_;
1870 LA22_: ;
1871 {
1872 if (!(decimalPoint < numDigits)) goto LA25_;
1873 {
1874 NI i_3;
1875 NI res;
1876 i_3 = (NI)0;
1877 res = ((NI) 7);
1878 {
1879 while (1) {
1880 if (!(((NI) 0) <= res)) goto LA29;
1881 i_3 = res;
1882 buffer[(NI)((NI)(i_3 + ((NI) (decimalPoint))) + ((NI) 1))] = buffer[(NI)(i_3 + ((NI) (decimalPoint)))];
1883 res -= ((NI) 1);
1884 } LA29: ;
1885 }
1886 }
1887 buffer[(NI)(pos_2 + ((NI) (decimalPoint)))] = 46;
1888 pos_2 = (NI)(digitsEnd + ((NI) 1));
1889 }
1890 goto LA20_;
1891 LA25_: ;
1892 {
1893 pos_2 += ((NI) (decimalPoint));
1894 {
1895 if (!forceTrailingDotZero) goto LA33_;
1896 buffer[pos_2] = 46;
1897 buffer[(NI)(pos_2 + ((NI) 1))] = 48;
1898 pos_2 += ((NI) 2);
1899 }
1900 LA33_: ;
1901 }
1902 LA20_: ;
1903 }
1904 goto LA16_;
1905 LA18_: ;
1906 {
1907 NI32 scientificExponent;
1908 NU32 k;
1909 NI32 T46_;
1910 buffer[pos_2] = buffer[(NI)(pos_2 + ((NI) 1))];
1911 {
1912 if (!(numDigits == ((NI32) 1))) goto LA38_;
1913 pos_2 += ((NI) 1);
1914 }
1915 goto LA36_;
1916 LA38_: ;
1917 {
1918 buffer[(NI)(pos_2 + ((NI) 1))] = 46;
1919 pos_2 = digitsEnd;
1920 }
1921 LA36_: ;
1922 scientificExponent = (NI32)(decimalPoint - ((NI32) 1));
1923 buffer[pos_2] = 101;
1924 {
1925 if (!(scientificExponent < ((NI32) 0))) goto LA43_;
1926 buffer[(NI)(pos_2 + ((NI) 1))] = 45;
1927 }
1928 goto LA41_;
1929 LA43_: ;
1930 {
1931 buffer[(NI)(pos_2 + ((NI) 1))] = 43;
1932 }
1933 LA41_: ;
1934 pos_2 += ((NI) 2);
1935 T46_ = (NI32)0;
1936 {
1937 if (!(scientificExponent < ((NI32) 0))) goto LA49_;
1938 T46_ = ((NI32)-(scientificExponent));
1939 }
1940 goto LA47_;
1941 LA49_: ;
1942 {
1943 T46_ = scientificExponent;
1944 }
1945 LA47_: ;
1946 k = ((NU32) (T46_));
1947 {
1948 if (!((NU32)(k) < (NU32)(((NU32) 10)))) goto LA54_;
1949 buffer[pos_2] = ((NIM_CHAR) (((NI) ((NU32)((NU32)(((NU32) 48)) + (NU32)(k))))));
1950 pos_2 += ((NI) 1);
1951 }
1952 goto LA52_;
1953 LA54_: ;
1954 {
1955 utoa2Digits__stdZprivateZdigitsutils_21(buffer, bufferLen_0, pos_2, k);
1956 pos_2 += ((NI) 2);
1957 }
1958 LA52_: ;
1959 }
1960 LA16_: ;
1961 result = pos_2;
1962 goto BeforeRet_;
1963 }BeforeRet_: ;
1964 return result;
1965 }
N_INLINE(NI,float32ToChars__systemZschubfach_387)1966 static N_INLINE(NI, float32ToChars__systemZschubfach_387)(NIM_CHAR* buffer, NI bufferLen_0, NF32 v, NIM_BOOL forceTrailingDotZero) {
1967 NI result;
1968 NU32 significand;
1969 tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ T1_;
1970 NU32 exponent;
1971 tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ T2_;
1972 NI pos;
1973 { result = (NI)0;
1974 T1_ = constructSingle__systemZschubfach_31(v);
1975 significand = physicalSignificand__systemZschubfach_34(T1_);
1976 T2_ = constructSingle__systemZschubfach_31(v);
1977 exponent = physicalExponent__systemZschubfach_37(T2_);
1978 pos = ((NI) 0);
1979 {
1980 tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ T7_;
1981 NI T8_;
1982 if (!!((exponent == ((NU32) 255)))) goto LA5_;
1983 buffer[pos] = 45;
1984 T7_ = constructSingle__systemZschubfach_31(v);
1985 T8_ = (NI)0;
1986 T8_ = signBit__systemZschubfach_56(T7_);
1987 pos += T8_;
1988 {
1989 NIM_BOOL T11_;
1990 tyObject_FloatingDecimal32__AcbjRnPoMG8Pkr9bMFAoLNg dec;
1991 T11_ = (NIM_BOOL)0;
1992 T11_ = !((exponent == ((NU32) 0)));
1993 if (T11_) goto LA12_;
1994 T11_ = !((significand == ((NU32) 0)));
1995 LA12_: ;
1996 if (!T11_) goto LA13_;
1997 dec = toDecimal32__systemZschubfach_142(significand, exponent);
1998 result = formatDigits__systemZschubfach_286(buffer, bufferLen_0, pos, dec.digits, dec.exponent, forceTrailingDotZero);
1999 goto BeforeRet_;
2000 }
2001 goto LA9_;
2002 LA13_: ;
2003 {
2004 NI T16_;
2005 buffer[pos] = 48;
2006 buffer[(NI)(pos + ((NI) 1))] = 46;
2007 buffer[(NI)(pos + ((NI) 2))] = 48;
2008 buffer[(NI)(pos + ((NI) 3))] = 32;
2009 T16_ = (NI)0;
2010 {
2011 if (!forceTrailingDotZero) goto LA19_;
2012 T16_ = ((NI) 3);
2013 }
2014 goto LA17_;
2015 LA19_: ;
2016 {
2017 T16_ = ((NI) 1);
2018 }
2019 LA17_: ;
2020 pos += T16_;
2021 result = pos;
2022 goto BeforeRet_;
2023 }
2024 LA9_: ;
2025 }
2026 LA5_: ;
2027 {
2028 tyObject_Single__d6NidTbsj2ZAh9ao1GJW9aXQ T26_;
2029 NI T27_;
2030 if (!(significand == ((NU32) 0))) goto LA24_;
2031 buffer[pos] = 45;
2032 T26_ = constructSingle__systemZschubfach_31(v);
2033 T27_ = (NI)0;
2034 T27_ = signBit__systemZschubfach_56(T26_);
2035 pos += T27_;
2036 buffer[pos] = 105;
2037 buffer[(NI)(pos + ((NI) 1))] = 110;
2038 buffer[(NI)(pos + ((NI) 2))] = 102;
2039 buffer[(NI)(pos + ((NI) 3))] = 32;
2040 result = (NI)(pos + ((NI) 3));
2041 goto BeforeRet_;
2042 }
2043 goto LA22_;
2044 LA24_: ;
2045 {
2046 buffer[pos] = 110;
2047 buffer[(NI)(pos + ((NI) 1))] = 97;
2048 buffer[(NI)(pos + ((NI) 2))] = 110;
2049 buffer[(NI)(pos + ((NI) 3))] = 32;
2050 result = (NI)(pos + ((NI) 3));
2051 goto BeforeRet_;
2052 }
2053 LA22_: ;
2054 }BeforeRet_: ;
2055 return result;
2056 }
N_NIMCALL(NI,writeFloatToBufferRoundtrip__systemZformatfloat_44)2057 N_LIB_PRIVATE N_NIMCALL(NI, writeFloatToBufferRoundtrip__systemZformatfloat_44)(NIM_CHAR* buf, NF32 value) {
2058 NI result;
2059 result = (NI)0;
2060 result = float32ToChars__systemZschubfach_387(buf, 65, value, NIM_TRUE);
2061 buf[(result)- 0] = 0;
2062 return result;
2063 }
2064