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