OpenCoverage

factor.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/factor.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10typedef unsigned char UQItype;-
11typedef long SItype;-
12typedef unsigned long int USItype;-
13-
14typedef long long int DItype;-
15typedef unsigned long long int UDItype;-
16-
17-
18-
19-
20-
21-
22-
23enum-
24{-
25 DEV_DEBUG_OPTION = 0x7f + 1-
26};-
27-
28static struct option const long_options[] =-
29{-
30 {"-debug", -
31 0-
32 , -
33 ((void *)0)-
34 , DEV_DEBUG_OPTION},-
35 {"help", -
36 0-
37 , -
38 ((void *)0)-
39 , GETOPT_HELP_CHAR},-
40 {"version", -
41 0-
42 , -
43 ((void *)0)-
44 , GETOPT_VERSION_CHAR},-
45 {-
46 ((void *)0)-
47 , 0, -
48 ((void *)0)-
49 , 0}-
50};-
51-
52struct factors-
53{-
54 uintmax_t plarge[2];-
55 uintmax_t p[26];-
56 unsigned char e[26];-
57 unsigned char nfactors;-
58};-
59static void factor (uintmax_t, uintmax_t, struct factors *);-
60static uintmax_t-
61mod2 (uintmax_t *r1, uintmax_t a1, uintmax_t a0, uintmax_t d1, uintmax_t d0)-
62{-
63 int cntd, cnta;-
64-
65 -
66 ((-
67 d1 != 0-
68 ) ? (void) (0) : __assert_fail (-
69 "d1 != 0"-
70 , "src/factor.c", 419, __PRETTY_FUNCTION__))-
71 ;-
72-
73 if (a1 == 0
a1 == 0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
)
0-3
74 {-
75 *r1 = 0;-
76 return
never executed: return a0;
a0;
never executed: return a0;
0
77 }-
78-
79 do { UDItype __cbtmp; ; __asm__ ("bsrq %1,%0" : "=r" (__cbtmp) : "rm" ((UDItype)(d1))); (cntd) = __cbtmp ^ 63; } while (0);-
80 do { UDItype __cbtmp; ; __asm__ ("bsrq %1,%0" : "=r" (__cbtmp) : "rm" ((UDItype)(a1))); (cnta) = __cbtmp ^ 63; } while (0);-
81 int cnt = cntd - cnta;-
82 do { (d1) = ((d1) << cnt) | ((d0) >> (64 - (cnt))); (d0) = (d0) << (cnt); } while (0);-
83 for (int i = 0; i < cnt
i < cntDescription
TRUEevaluated 35 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
; i++)
3-35
84 {-
85 if (((
(a1) > (d1)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 21 times by 1 test
Evaluated by:
  • factor
a1) > (d1)
(a1) > (d1)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 21 times by 1 test
Evaluated by:
  • factor
|| ((
(a1) == (d1)Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • factor
a1) == (d1)
(a1) == (d1)Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • factor
&& (
(a0) >= (d0)Description
TRUEnever evaluated
FALSEnever evaluated
a0) >= (d0)
(a0) >= (d0)Description
TRUEnever evaluated
FALSEnever evaluated
)))
0-21
86 __asm__
executed 14 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (a1), "=&r" (a0) : "0" ((UDItype)(a1)), "rme" ((UDItype)(d1)), "1" ((UDItype)(a0)), "rme" ((UDItype)(d0)));
Executed by:
  • factor
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (a1), "=&r" (a0) : "0" ((UDItype)(a1)), "rme" ((UDItype)(d1)), "1" ((UDItype)(a0)), "rme" ((UDItype)(d0)));
executed 14 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (a1), "=&r" (a0) : "0" ((UDItype)(a1)), "rme" ((UDItype)(d1)), "1" ((UDItype)(a0)), "rme" ((UDItype)(d0)));
Executed by:
  • factor
14
87 do { (d0) = ((d1) << (64 - (1))) | ((d0) >> (1)); (d1) = (d1) >> (1); } while (0);-
88 }
executed 35 times by 1 test: end of block
Executed by:
  • factor
35
89-
90 *r1 = a1;-
91 return
executed 3 times by 1 test: return a0;
Executed by:
  • factor
a0;
executed 3 times by 1 test: return a0;
Executed by:
  • factor
3
92}-
93-
94static uintmax_t __attribute__ ((__const__))-
95gcd_odd (uintmax_t a, uintmax_t b)-
96{-
97 if ( (
(b & 1) == 0Description
TRUEnever evaluated
FALSEevaluated 2445 times by 1 test
Evaluated by:
  • factor
b & 1) == 0
(b & 1) == 0Description
TRUEnever evaluated
FALSEevaluated 2445 times by 1 test
Evaluated by:
  • factor
)
0-2445
98 {-
99 uintmax_t t = b;-
100 b = a;-
101 a = t;-
102 }
never executed: end of block
0
103 if (a == 0
a == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2443 times by 1 test
Evaluated by:
  • factor
)
2-2443
104 return
executed 2 times by 1 test: return b;
Executed by:
  • factor
b;
executed 2 times by 1 test: return b;
Executed by:
  • factor
2
105-
106-
107 b >>= 1;-
108-
109 for (;;)-
110 {-
111 uintmax_t t;-
112 uintmax_t bgta;-
113-
114 while ((
(a & 1) == 0Description
TRUEevaluated 90823 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 95477 times by 1 test
Evaluated by:
  • factor
a & 1) == 0
(a & 1) == 0Description
TRUEevaluated 90823 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 95477 times by 1 test
Evaluated by:
  • factor
)
90823-95477
115 a >>= 1;
executed 90823 times by 1 test: a >>= 1;
Executed by:
  • factor
90823
116 a >>= 1;-
117-
118 t = a - b;-
119 if (t == 0
t == 0Description
TRUEevaluated 2443 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 93034 times by 1 test
Evaluated by:
  • factor
)
2443-93034
120 return
executed 2443 times by 1 test: return (a << 1) + 1;
Executed by:
  • factor
(a << 1) + 1;
executed 2443 times by 1 test: return (a << 1) + 1;
Executed by:
  • factor
2443
121-
122 bgta = (((
((intmax_t)-1 >> 1) < 0Description
TRUEevaluated 93034 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
intmax_t)-1 >> 1) < 0
((intmax_t)-1 >> 1) < 0Description
TRUEevaluated 93034 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
? (uintmax_t)((intmax_t)(t) >> (64 - 1)) : ((
(t) & ((uintma...1 << (64 - 1))Description
TRUEnever evaluated
FALSEnever evaluated
t) & ((uintmax_t) 1 << (64 - 1))
(t) & ((uintma...1 << (64 - 1))Description
TRUEnever evaluated
FALSEnever evaluated
?
0-93034
123 (18446744073709551615UL) -
124 : (uintmax_t) 0));-
125-
126-
127 b += (bgta & t);-
128-
129-
130 a = (t ^ bgta) - bgta;-
131 }
executed 93034 times by 1 test: end of block
Executed by:
  • factor
93034
132}
never executed: end of block
0
133-
134static uintmax_t-
135gcd2_odd (uintmax_t *r1, uintmax_t a1, uintmax_t a0, uintmax_t b1, uintmax_t b0)-
136{-
137 -
138 ((-
139 b0 & 1-
140 ) ? (void) (0) : __assert_fail (-
141 "b0 & 1"-
142 , "src/factor.c", 483, __PRETTY_FUNCTION__))-
143 ;-
144-
145 if ( (
(a0 | a1) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1747 times by 1 test
Evaluated by:
  • factor
a0 | a1) == 0
(a0 | a1) == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1747 times by 1 test
Evaluated by:
  • factor
)
4-1747
146 {-
147 *r1 = b1;-
148 return
executed 4 times by 1 test: return b0;
Executed by:
  • factor
b0;
executed 4 times by 1 test: return b0;
Executed by:
  • factor
4
149 }-
150-
151 while ((
(a0 & 1) == 0Description
TRUEevaluated 1730 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1747 times by 1 test
Evaluated by:
  • factor
a0 & 1) == 0
(a0 & 1) == 0Description
TRUEevaluated 1730 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1747 times by 1 test
Evaluated by:
  • factor
)
1730-1747
152 do { (a0) = ((a1) << (64 - (1))) | ((a0) >> (1)); (a1) = (a1) >> (1); }
executed 1730 times by 1 test: end of block
Executed by:
  • factor
while (0);
1730
153-
154 for (;;)-
155 {-
156 if ((
(b1 | a1) == 0Description
TRUEevaluated 1747 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2486 times by 1 test
Evaluated by:
  • factor
b1 | a1) == 0
(b1 | a1) == 0Description
TRUEevaluated 1747 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2486 times by 1 test
Evaluated by:
  • factor
)
1747-2486
157 {-
158 *r1 = 0;-
159 return
executed 1747 times by 1 test: return gcd_odd (b0, a0);
Executed by:
  • factor
gcd_odd (b0, a0);
executed 1747 times by 1 test: return gcd_odd (b0, a0);
Executed by:
  • factor
1747
160 }-
161-
162 if (((
(a1) > (b1)Description
TRUEevaluated 575 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • factor
a1) > (b1)
(a1) > (b1)Description
TRUEevaluated 575 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1911 times by 1 test
Evaluated by:
  • factor
|| ((
(a1) == (b1)Description
TRUEevaluated 400 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1511 times by 1 test
Evaluated by:
  • factor
a1) == (b1)
(a1) == (b1)Description
TRUEevaluated 400 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1511 times by 1 test
Evaluated by:
  • factor
&& (
(a0) > (b0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 393 times by 1 test
Evaluated by:
  • factor
a0) > (b0)
(a0) > (b0)Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 393 times by 1 test
Evaluated by:
  • factor
)))
7-1911
163 {-
164 __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (a1), "=&r" (a0) : "0" ((UDItype)(a1)), "rme" ((UDItype)(b1)), "1" ((UDItype)(a0)), "rme" ((UDItype)(b0)));-
165 do-
166 do { (a0) = ((a1) << (64 - (1))) | ((a0) >> (1)); (a1) = (a1) >> (1); }
executed 1126 times by 1 test: end of block
Executed by:
  • factor
while (0);
1126
167 while ((
(a0 & 1) == 0Description
TRUEevaluated 544 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 582 times by 1 test
Evaluated by:
  • factor
a0 & 1) == 0
(a0 & 1) == 0Description
TRUEevaluated 544 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 582 times by 1 test
Evaluated by:
  • factor
);
544-582
168 }
executed 582 times by 1 test: end of block
Executed by:
  • factor
582
169 else if (((
(b1) > (a1)Description
TRUEevaluated 1511 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 393 times by 1 test
Evaluated by:
  • factor
b1) > (a1)
(b1) > (a1)Description
TRUEevaluated 1511 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 393 times by 1 test
Evaluated by:
  • factor
|| ((
(b1) == (a1)Description
TRUEevaluated 393 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
b1) == (a1)
(b1) == (a1)Description
TRUEevaluated 393 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
&& (
(b0) > (a0)Description
TRUEevaluated 393 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
b0) > (a0)
(b0) > (a0)Description
TRUEevaluated 393 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
)))
0-1511
170 {-
171 __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (b1), "=&r" (b0) : "0" ((UDItype)(b1)), "rme" ((UDItype)(a1)), "1" ((UDItype)(b0)), "rme" ((UDItype)(a0)));-
172 do-
173 do { (b0) = ((b1) << (64 - (1))) | ((b0) >> (1)); (b1) = (b1) >> (1); }
executed 3830 times by 1 test: end of block
Executed by:
  • factor
while (0);
3830
174 while ((
(b0 & 1) == 0Description
TRUEevaluated 1926 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1904 times by 1 test
Evaluated by:
  • factor
b0 & 1) == 0
(b0 & 1) == 0Description
TRUEevaluated 1926 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1904 times by 1 test
Evaluated by:
  • factor
);
1904-1926
175 }
executed 1904 times by 1 test: end of block
Executed by:
  • factor
1904
176 else-
177 break;
never executed: break;
0
178 }-
179-
180 *r1 = a1;-
181 return
never executed: return a0;
a0;
never executed: return a0;
0
182}-
183-
184static void-
185factor_insert_multiplicity (struct factors *factors,-
186 uintmax_t prime, unsigned int m)-
187{-
188 unsigned int nfactors = factors->nfactors;-
189 uintmax_t *p = factors->p;-
190 unsigned char *e = factors->e;-
191-
192-
193 int i;-
194 for (i = nfactors - 1; i >= 0
i >= 0Description
TRUEevaluated 840182 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 500053 times by 1 test
Evaluated by:
  • factor
; i--)
500053-840182
195 {-
196 if (p[i] <= prime
p[i] <= primeDescription
TRUEevaluated 840169 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 13 times by 1 test
Evaluated by:
  • factor
)
13-840169
197 break;
executed 840169 times by 1 test: break;
Executed by:
  • factor
840169
198 }
executed 13 times by 1 test: end of block
Executed by:
  • factor
13
199-
200 if (i < 0
i < 0Description
TRUEevaluated 500053 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 840169 times by 1 test
Evaluated by:
  • factor
|| p[i] != prime
p[i] != primeDescription
TRUEevaluated 703635 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 136534 times by 1 test
Evaluated by:
  • factor
)
136534-840169
201 {-
202 for (int j = nfactors - 1; j > i
j > iDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1203688 times by 1 test
Evaluated by:
  • factor
; j--)
13-1203688
203 {-
204 p[j + 1] = p[j];-
205 e[j + 1] = e[j];-
206 }
executed 13 times by 1 test: end of block
Executed by:
  • factor
13
207 p[i + 1] = prime;-
208 e[i + 1] = m;-
209 factors->nfactors = nfactors + 1;-
210 }
executed 1203688 times by 1 test: end of block
Executed by:
  • factor
1203688
211 else-
212 {-
213 e[i] += m;-
214 }
executed 136534 times by 1 test: end of block
Executed by:
  • factor
136534
215}-
216-
217-
218-
219static void-
220factor_insert_large (struct factors *factors,-
221 uintmax_t p1, uintmax_t p0)-
222{-
223 if (p1 > 0
p1 > 0Description
TRUEnever evaluated
FALSEevaluated 486338 times by 1 test
Evaluated by:
  • factor
)
0-486338
224 {-
225 -
226 ((-
227 factors->plarge[1] == 0-
228 ) ? (void) (0) : __assert_fail (-
229 "factors->plarge[1] == 0"-
230 , "src/factor.c", 565, __PRETTY_FUNCTION__))-
231 ;-
232 factors->plarge[0] = p0;-
233 factors->plarge[1] = p1;-
234 }
never executed: end of block
0
235 else-
236 factor_insert_multiplicity (factors, p0, 1);
executed 486338 times by 1 test: factor_insert_multiplicity (factors, p0, 1);
Executed by:
  • factor
486338
237}-
238enum { W = sizeof (uintmax_t) * 8 };-
239-
240-
241_Static_assert (-
242(18446744073709551615UL) -
243>> (W - 1) == 1, "verify (" "UINTMAX_MAX >> (W - 1) == 1" ")");-
244-
245-
246static const unsigned char primes_diff[] = {-
2470,0,0,0,0,0,0-
248};-
249-
250-
251-
252-
253-
254-
255static const unsigned char primes_diff8[] = {-
2560,0,0,0,0,0,0-
257};-
258-
259-
260struct primes_dtab-
261{-
262 uintmax_t binv, lim;-
263};-
264-
265-
266static const struct primes_dtab primes_dtab[] = {-
267{1,0},{1,0},{1,0},{1,0},{1,0},{1,0},{1,0}-
268};-
269-
270-
271-
272-
273_Static_assert (W <= 128, "verify (" "W <= WIDE_UINT_BITS" ")");-
274-
275-
276-
277static -
278 _Bool -
279 dev_debug = -
280 0-
281 ;-
282-
283-
284static -
285 _Bool -
286 flag_prove_primality = 1;-
287-
288-
289-
290-
291static void-
292factor_insert_refind (struct factors *factors, uintmax_t p, unsigned int i,-
293 unsigned int off)-
294{-
295 for (unsigned int j = 0; j < off
j < offDescription
TRUEevaluated 1782039 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 853812 times by 1 test
Evaluated by:
  • factor
; j++)
853812-1782039
296 p += primes_diff[i + j];
executed 1782039 times by 1 test: p += primes_diff[i + j];
Executed by:
  • factor
1782039
297 factor_insert_multiplicity (factors, p, 1);-
298}
executed 853812 times by 1 test: end of block
Executed by:
  • factor
853812
299static uintmax_t-
300factor_using_division (uintmax_t *t1p, uintmax_t t1, uintmax_t t0,-
301 struct factors *factors)-
302{-
303 if (t0 % 2 == 0
t0 % 2 == 0Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 500031 times by 1 test
Evaluated by:
  • factor
)
12-500031
304 {-
305 unsigned int cnt;-
306-
307 if (t0 == 0
t0 == 0Description
TRUEnever evaluated
FALSEevaluated 12 times by 1 test
Evaluated by:
  • factor
)
0-12
308 {-
309 do { ; __asm__ ("bsfq %1,%q0" : "=r" (cnt) : "rm" ((UDItype)(t1))); } while (0);-
310 t0 = t1 >> cnt;-
311 t1 = 0;-
312 cnt += 64;-
313 }
never executed: end of block
0
314 else-
315 {-
316 do { ; __asm__ ("bsfq %1,%q0" : "=r" (cnt) : "rm" ((UDItype)(t0))); } while (0);-
317 do { (t0) = ((t1) << (64 - (cnt))) | ((t0) >> (cnt)); (t1) = (t1) >> (cnt); } while (0);-
318 }
executed 12 times by 1 test: end of block
Executed by:
  • factor
12
319-
320 factor_insert_multiplicity (factors, 2, cnt);-
321 }
executed 12 times by 1 test: end of block
Executed by:
  • factor
12
322-
323 uintmax_t p = 3;-
324 unsigned int i;-
325 for (i = 0; t1 > 0
t1 > 0Description
TRUEevaluated 2007 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 500040 times by 1 test
Evaluated by:
  • factor
&& i < (sizeof (primes_diff) / sizeof (primes_diff[0]) - 8 + 1)
i < (sizeof (p...f[0]) - 8 + 1)Description
TRUEevaluated 2004 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
; i++)
3-500040
326 {-
327 for (;;)-
328 {-
329 uintmax_t q1, q0, hi, lo __attribute__ ((__unused__));-
330-
331 q0 = t0 * primes_dtab[i].binv;-
332 __asm__ ("mulq %3" : "=a" (lo), "=d" (hi) : "%0" ((UDItype)(q0)), "rm" ((UDItype)(p)));-
333 if (hi > t1
hi > t1Description
TRUEevaluated 1313 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 693 times by 1 test
Evaluated by:
  • factor
)
693-1313
334 break;
executed 1313 times by 1 test: break;
Executed by:
  • factor
1313
335 hi = t1 - hi;-
336 q1 = hi * primes_dtab[i].binv;-
337 if (__builtin_expect ((q1 > primes_dtab[i].lim), 1)
__builtin_expe...ab[i].lim), 1)Description
TRUEevaluated 691 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2 times by 1 test
Evaluated by:
  • factor
)
2-691
338 break;
executed 691 times by 1 test: break;
Executed by:
  • factor
691
339 t1 = q1; t0 = q0;-
340 factor_insert_multiplicity (factors, p, 1);-
341 }
executed 2 times by 1 test: end of block
Executed by:
  • factor
2
342 p += primes_diff[i + 1];-
343 }
executed 2004 times by 1 test: end of block
Executed by:
  • factor
2004
344 if (t1p
t1pDescription
TRUEevaluated 500043 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
)
0-500043
345 *
executed 500043 times by 1 test: *t1p = t1;
Executed by:
  • factor
t1p = t1;
executed 500043 times by 1 test: *t1p = t1;
Executed by:
  • factor
500043
346 for (; i < (sizeof (primes_diff) / sizeof (primes_diff[0]) - 8 + 1)
i < (sizeof (p...f[0]) - 8 + 1)Description
TRUEevaluated 3048788 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 29 times by 1 test
Evaluated by:
  • factor
; i += 8)
29-3048788
347 {-
348 uintmax_t q;-
349 const struct primes_dtab *pd = &primes_dtab[i];-
350 do { for (;;) { q = t0 * pd[0].binv; if (__builtin_expect ((q > pd[0].lim), 1)
__builtin_expe...pd[0].lim), 1)Description
TRUEevaluated 3048788 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 285614 times by 1 test
Evaluated by:
  • factor
) break;
executed 3048788 times by 1 test: break;
Executed by:
  • factor
t0 = q; factor_insert_refind (factors, p, i + 1, 0); }
executed 285614 times by 1 test: end of block
Executed by:
  • factor
} while (0);
285614-3048788
351 do { for (;;) { q = t0 * pd[1].binv; if (__builtin_expect ((q > pd[1].lim), 1)
__builtin_expe...pd[1].lim), 1)Description
TRUEevaluated 3048788 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 158282 times by 1 test
Evaluated by:
  • factor
) break;
executed 3048788 times by 1 test: break;
Executed by:
  • factor
t0 = q; factor_insert_refind (factors, p, i + 1, 1); }
executed 158282 times by 1 test: end of block
Executed by:
  • factor
} while (0);
158282-3048788
352 do { for (;;) { q = t0 * pd[2].binv; if (__builtin_expect ((q > pd[2].lim), 1)
__builtin_expe...pd[2].lim), 1)Description
TRUEevaluated 3048788 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 113202 times by 1 test
Evaluated by:
  • factor
) break;
executed 3048788 times by 1 test: break;
Executed by:
  • factor
t0 = q; factor_insert_refind (factors, p, i + 1, 2); }
executed 113202 times by 1 test: end of block
Executed by:
  • factor
} while (0);
113202-3048788
353 do { for (;;) { q = t0 * pd[3].binv; if (__builtin_expect ((q > pd[3].lim), 1)
__builtin_expe...pd[3].lim), 1)Description
TRUEevaluated 3048788 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 78057 times by 1 test
Evaluated by:
  • factor
) break;
executed 3048788 times by 1 test: break;
Executed by:
  • factor
t0 = q; factor_insert_refind (factors, p, i + 1, 3); }
executed 78057 times by 1 test: end of block
Executed by:
  • factor
} while (0);
78057-3048788
354 do { for (;;) { q = t0 * pd[4].binv; if (__builtin_expect ((q > pd[4].lim), 1)
__builtin_expe...pd[4].lim), 1)Description
TRUEevaluated 3048788 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 68318 times by 1 test
Evaluated by:
  • factor
) break;
executed 3048788 times by 1 test: break;
Executed by:
  • factor
t0 = q; factor_insert_refind (factors, p, i + 1, 4); }
executed 68318 times by 1 test: end of block
Executed by:
  • factor
} while (0);
68318-3048788
355 do { for (;;) { q = t0 * pd[5].binv; if (__builtin_expect ((q > pd[5].lim), 1)
__builtin_expe...pd[5].lim), 1)Description
TRUEevaluated 3048788 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 55954 times by 1 test
Evaluated by:
  • factor
) break;
executed 3048788 times by 1 test: break;
Executed by:
  • factor
t0 = q; factor_insert_refind (factors, p, i + 1, 5); }
executed 55954 times by 1 test: end of block
Executed by:
  • factor
} while (0);
55954-3048788
356 do { for (;;) { q = t0 * pd[6].binv; if (__builtin_expect ((q > pd[6].lim), 1)
__builtin_expe...pd[6].lim), 1)Description
TRUEevaluated 3048788 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 50555 times by 1 test
Evaluated by:
  • factor
) break;
executed 3048788 times by 1 test: break;
Executed by:
  • factor
t0 = q; factor_insert_refind (factors, p, i + 1, 6); }
executed 50555 times by 1 test: end of block
Executed by:
  • factor
} while (0);
50555-3048788
357 do { for (;;) { q = t0 * pd[7].binv; if (__builtin_expect ((q > pd[7].lim), 1)
__builtin_expe...pd[7].lim), 1)Description
TRUEevaluated 3048788 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 43830 times by 1 test
Evaluated by:
  • factor
) break;
executed 3048788 times by 1 test: break;
Executed by:
  • factor
t0 = q; factor_insert_refind (factors, p, i + 1, 7); }
executed 43830 times by 1 test: end of block
Executed by:
  • factor
} while (0);
43830-3048788
358-
359 p += primes_diff8[i];-
360 if (p * p > t0
p * p > t0Description
TRUEevaluated 500014 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2548774 times by 1 test
Evaluated by:
  • factor
)
500014-2548774
361 break;
executed 500014 times by 1 test: break;
Executed by:
  • factor
500014
362 }
executed 2548774 times by 1 test: end of block
Executed by:
  • factor
2548774
363-
364 return
executed 500043 times by 1 test: return t0;
Executed by:
  • factor
t0;
executed 500043 times by 1 test: return t0;
Executed by:
  • factor
500043
365}-
366static const unsigned char binvert_table[128] =-
367{-
368 0x01, 0xAB, 0xCD, 0xB7, 0x39, 0xA3, 0xC5, 0xEF,-
369 0xF1, 0x1B, 0x3D, 0xA7, 0x29, 0x13, 0x35, 0xDF,-
370 0xE1, 0x8B, 0xAD, 0x97, 0x19, 0x83, 0xA5, 0xCF,-
371 0xD1, 0xFB, 0x1D, 0x87, 0x09, 0xF3, 0x15, 0xBF,-
372 0xC1, 0x6B, 0x8D, 0x77, 0xF9, 0x63, 0x85, 0xAF,-
373 0xB1, 0xDB, 0xFD, 0x67, 0xE9, 0xD3, 0xF5, 0x9F,-
374 0xA1, 0x4B, 0x6D, 0x57, 0xD9, 0x43, 0x65, 0x8F,-
375 0x91, 0xBB, 0xDD, 0x47, 0xC9, 0xB3, 0xD5, 0x7F,-
376 0x81, 0x2B, 0x4D, 0x37, 0xB9, 0x23, 0x45, 0x6F,-
377 0x71, 0x9B, 0xBD, 0x27, 0xA9, 0x93, 0xB5, 0x5F,-
378 0x61, 0x0B, 0x2D, 0x17, 0x99, 0x03, 0x25, 0x4F,-
379 0x51, 0x7B, 0x9D, 0x07, 0x89, 0x73, 0x95, 0x3F,-
380 0x41, 0xEB, 0x0D, 0xF7, 0x79, 0xE3, 0x05, 0x2F,-
381 0x31, 0x5B, 0x7D, 0xE7, 0x69, 0x53, 0x75, 0x1F,-
382 0x21, 0xCB, 0xED, 0xD7, 0x59, 0xC3, 0xE5, 0x0F,-
383 0x11, 0x3B, 0x5D, 0xC7, 0x49, 0x33, 0x55, 0xFF-
384};-
385static inline uintmax_t-
386mulredc (uintmax_t a, uintmax_t b, uintmax_t m, uintmax_t mi)-
387{-
388 uintmax_t rh, rl, q, th, tl __attribute__ ((__unused__)), xh;-
389-
390 __asm__ ("mulq %3" : "=a" (rl), "=d" (rh) : "%0" ((UDItype)(a)), "rm" ((UDItype)(b)));-
391 q = rl * mi;-
392 __asm__ ("mulq %3" : "=a" (tl), "=d" (th) : "%0" ((UDItype)(q)), "rm" ((UDItype)(m)));-
393 xh = rh - th;-
394 if (rh < th
rh < thDescription
TRUEevaluated 24969 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 29 times by 1 test
Evaluated by:
  • factor
)
29-24969
395 xh += m;
executed 24969 times by 1 test: xh += m;
Executed by:
  • factor
24969
396-
397 return
executed 24998 times by 1 test: return xh;
Executed by:
  • factor
xh;
executed 24998 times by 1 test: return xh;
Executed by:
  • factor
24998
398}-
399-
400-
401-
402-
403static uintmax_t-
404mulredc2 (uintmax_t *r1p,-
405 uintmax_t a1, uintmax_t a0, uintmax_t b1, uintmax_t b0,-
406 uintmax_t m1, uintmax_t m0, uintmax_t mi)-
407{-
408 uintmax_t r1, r0, q, p1, p0 __attribute__ ((__unused__)), t1, t0, s1, s0;-
409 mi = -mi;-
410 -
411 ((-
412 (a1 >> (64 - 1)) == 0-
413 ) ? (void) (0) : __assert_fail (-
414 "(a1 >> (W_TYPE_SIZE - 1)) == 0"-
415 , "src/factor.c", 999, __PRETTY_FUNCTION__))-
416 ;-
417 -
418 ((-
419 (b1 >> (64 - 1)) == 0-
420 ) ? (void) (0) : __assert_fail (-
421 "(b1 >> (W_TYPE_SIZE - 1)) == 0"-
422 , "src/factor.c", 1000, __PRETTY_FUNCTION__))-
423 ;-
424 -
425 ((-
426 (m1 >> (64 - 1)) == 0-
427 ) ? (void) (0) : __assert_fail (-
428 "(m1 >> (W_TYPE_SIZE - 1)) == 0"-
429 , "src/factor.c", 1001, __PRETTY_FUNCTION__))-
430 ;-
431 __asm__ ("mulq %3" : "=a" (t0), "=d" (t1) : "%0" ((UDItype)(a0)), "rm" ((UDItype)(b0)));-
432 __asm__ ("mulq %3" : "=a" (r0), "=d" (r1) : "%0" ((UDItype)(a0)), "rm" ((UDItype)(b1)));-
433 q = mi * t0;-
434 __asm__ ("mulq %3" : "=a" (p0), "=d" (p1) : "%0" ((UDItype)(q)), "rm" ((UDItype)(m0)));-
435 __asm__ ("mulq %3" : "=a" (s0), "=d" (s1) : "%0" ((UDItype)(q)), "rm" ((UDItype)(m1)));-
436 r0 += (t0 != 0);-
437 __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(0)), "%1" ((UDItype)(r0)), "rme" ((UDItype)(p1)));-
438 __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(0)), "%1" ((UDItype)(r0)), "rme" ((UDItype)(t1)));-
439 __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(s1)), "%1" ((UDItype)(r0)), "rme" ((UDItype)(s0)));-
440 __asm__ ("mulq %3" : "=a" (t0), "=d" (t1) : "%0" ((UDItype)(a1)), "rm" ((UDItype)(b0)));-
441 __asm__ ("mulq %3" : "=a" (s0), "=d" (s1) : "%0" ((UDItype)(a1)), "rm" ((UDItype)(b1)));-
442 __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" (t1), "=&r" (t0) : "0" ((UDItype)(t1)), "rme" ((UDItype)(0)), "%1" ((UDItype)(t0)), "rme" ((UDItype)(r0)));-
443 q = mi * t0;-
444 __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(s1)), "rme" ((UDItype)(0)), "%1" ((UDItype)(s0)), "rme" ((UDItype)(r1)));-
445 __asm__ ("mulq %3" : "=a" (p0), "=d" (p1) : "%0" ((UDItype)(q)), "rm" ((UDItype)(m0)));-
446 __asm__ ("mulq %3" : "=a" (s0), "=d" (s1) : "%0" ((UDItype)(q)), "rm" ((UDItype)(m1)));-
447 r0 += (t0 != 0);-
448 __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(0)), "%1" ((UDItype)(r0)), "rme" ((UDItype)(p1)));-
449 __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(0)), "%1" ((UDItype)(r0)), "rme" ((UDItype)(t1)));-
450 __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(s1)), "%1" ((UDItype)(r0)), "rme" ((UDItype)(s0)));-
451-
452 if (((
(r1) > (m1)Description
TRUEnever evaluated
FALSEevaluated 177451 times by 1 test
Evaluated by:
  • factor
r1) > (m1)
(r1) > (m1)Description
TRUEnever evaluated
FALSEevaluated 177451 times by 1 test
Evaluated by:
  • factor
|| ((
(r1) == (m1)Description
TRUEevaluated 76941 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 100510 times by 1 test
Evaluated by:
  • factor
r1) == (m1)
(r1) == (m1)Description
TRUEevaluated 76941 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 100510 times by 1 test
Evaluated by:
  • factor
&& (
(r0) >= (m0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 76939 times by 1 test
Evaluated by:
  • factor
r0) >= (m0)
(r0) >= (m0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 76939 times by 1 test
Evaluated by:
  • factor
)))
0-177451
453 __asm__
executed 2 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(m1)), "1" ((UDItype)(r0)), "rme" ((UDItype)(m0)));
Executed by:
  • factor
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(m1)), "1" ((UDItype)(r0)), "rme" ((UDItype)(m0)));
executed 2 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(m1)), "1" ((UDItype)(r0)), "rme" ((UDItype)(m0)));
Executed by:
  • factor
2
454-
455 *r1p = r1;-
456 return
executed 177451 times by 1 test: return r0;
Executed by:
  • factor
r0;
executed 177451 times by 1 test: return r0;
Executed by:
  • factor
177451
457}-
458-
459static uintmax_t __attribute__ ((__const__))-
460powm (uintmax_t b, uintmax_t e, uintmax_t n, uintmax_t ni, uintmax_t one)-
461{-
462 uintmax_t y = one;-
463-
464 if (e & 1
e & 1Description
TRUEevaluated 59 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 51 times by 1 test
Evaluated by:
  • factor
)
51-59
465 y = b;
executed 59 times by 1 test: y = b;
Executed by:
  • factor
59
466-
467 while (e != 0
e != 0Description
TRUEevaluated 3116 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 110 times by 1 test
Evaluated by:
  • factor
)
110-3116
468 {-
469 b = mulredc (b, b, n, ni);-
470 e >>= 1;-
471-
472 if (e & 1
e & 1Description
TRUEevaluated 1955 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1161 times by 1 test
Evaluated by:
  • factor
)
1161-1955
473 y = mulredc (y, b, n, ni);
executed 1955 times by 1 test: y = mulredc (y, b, n, ni);
Executed by:
  • factor
1955
474 }
executed 3116 times by 1 test: end of block
Executed by:
  • factor
3116
475-
476 return
executed 110 times by 1 test: return y;
Executed by:
  • factor
y;
executed 110 times by 1 test: return y;
Executed by:
  • factor
110
477}-
478-
479static uintmax_t-
480powm2 (uintmax_t *r1m,-
481 const uintmax_t *bp, const uintmax_t *ep, const uintmax_t *np,-
482 uintmax_t ni, const uintmax_t *one)-
483{-
484 uintmax_t r1, r0, b1, b0, n1, n0;-
485 unsigned int i;-
486 uintmax_t e;-
487-
488 b0 = bp[0];-
489 b1 = bp[1];-
490 n0 = np[0];-
491 n1 = np[1];-
492-
493 r0 = one[0];-
494 r1 = one[1];-
495-
496 for (e = ep[0], i = 64; i > 0
i > 0Description
TRUEevaluated 256 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
; i--, e >>= 1)
4-256
497 {-
498 if (e & 1
e & 1Description
TRUEevaluated 117 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 139 times by 1 test
Evaluated by:
  • factor
)
117-139
499 {-
500 r0 = mulredc2 (r1m, r1, r0, b1, b0, n1, n0, ni);-
501 r1 = *r1m;-
502 }
executed 117 times by 1 test: end of block
Executed by:
  • factor
117
503 b0 = mulredc2 (r1m, b1, b0, b1, b0, n1, n0, ni);-
504 b1 = *r1m;-
505 }
executed 256 times by 1 test: end of block
Executed by:
  • factor
256
506 for (e = ep[1]; e > 0
e > 0Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
; e >>= 1)
4-19
507 {-
508 if (e & 1
e & 1Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 9 times by 1 test
Evaluated by:
  • factor
)
9-10
509 {-
510 r0 = mulredc2 (r1m, r1, r0, b1, b0, n1, n0, ni);-
511 r1 = *r1m;-
512 }
executed 10 times by 1 test: end of block
Executed by:
  • factor
10
513 b0 = mulredc2 (r1m, b1, b0, b1, b0, n1, n0, ni);-
514 b1 = *r1m;-
515 }
executed 19 times by 1 test: end of block
Executed by:
  • factor
19
516 *r1m = r1;-
517 return
executed 4 times by 1 test: return r0;
Executed by:
  • factor
r0;
executed 4 times by 1 test: return r0;
Executed by:
  • factor
4
518}-
519-
520static -
521 _Bool -
522 __attribute__ ((__const__))-
523millerrabin (uintmax_t n, uintmax_t ni, uintmax_t b, uintmax_t q,-
524 unsigned int k, uintmax_t one)-
525{-
526 uintmax_t y = powm (b, q, n, ni, one);-
527-
528 uintmax_t nm1 = n - one;-
529-
530 if (y == one
y == oneDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 51 times by 1 test
Evaluated by:
  • factor
|| y == nm1
y == nm1Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 43 times by 1 test
Evaluated by:
  • factor
)
3-51
531 return
executed 11 times by 1 test: return 1 ;
Executed by:
  • factor
executed 11 times by 1 test: return 1 ;
Executed by:
  • factor
11
532 1
executed 11 times by 1 test: return 1 ;
Executed by:
  • factor
11
533 ;
executed 11 times by 1 test: return 1 ;
Executed by:
  • factor
11
534-
535 for (unsigned int i = 1; i < k
i < kDescription
TRUEevaluated 49 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 26 times by 1 test
Evaluated by:
  • factor
; i++)
26-49
536 {-
537 y = mulredc (y, y, n, ni);-
538-
539 if (y == nm1
y == nm1Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 33 times by 1 test
Evaluated by:
  • factor
)
16-33
540 return
executed 16 times by 1 test: return 1 ;
Executed by:
  • factor
executed 16 times by 1 test: return 1 ;
Executed by:
  • factor
16
541 1
executed 16 times by 1 test: return 1 ;
Executed by:
  • factor
16
542 ;
executed 16 times by 1 test: return 1 ;
Executed by:
  • factor
16
543 if (y == one
y == oneDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 32 times by 1 test
Evaluated by:
  • factor
)
1-32
544 return
executed 1 time by 1 test: return 0 ;
Executed by:
  • factor
executed 1 time by 1 test: return 0 ;
Executed by:
  • factor
1
545 0
executed 1 time by 1 test: return 0 ;
Executed by:
  • factor
1
546 ;
executed 1 time by 1 test: return 0 ;
Executed by:
  • factor
1
547 }
executed 32 times by 1 test: end of block
Executed by:
  • factor
32
548 return
executed 26 times by 1 test: return 0 ;
Executed by:
  • factor
executed 26 times by 1 test: return 0 ;
Executed by:
  • factor
26
549 0
executed 26 times by 1 test: return 0 ;
Executed by:
  • factor
26
550 ;
executed 26 times by 1 test: return 0 ;
Executed by:
  • factor
26
551}-
552-
553static -
554 _Bool-
555-
556millerrabin2 (const uintmax_t *np, uintmax_t ni, const uintmax_t *bp,-
557 const uintmax_t *qp, unsigned int k, const uintmax_t *one)-
558{-
559 uintmax_t y1, y0, nm1_1, nm1_0, r1m;-
560-
561 y0 = powm2 (&r1m, bp, qp, np, ni, one);-
562 y1 = r1m;-
563-
564 if (y0 == one[0]
y0 == one[0]Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
&& y1 == one[1]
y1 == one[1]Description
TRUEnever evaluated
FALSEnever evaluated
)
0-4
565 return
never executed: return 1 ;
never executed: return 1 ;
0
566 1
never executed: return 1 ;
0
567 ;
never executed: return 1 ;
0
568-
569 __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (nm1_1), "=&r" (nm1_0) : "0" ((UDItype)(np[1])), "rme" ((UDItype)(one[1])), "1" ((UDItype)(np[0])), "rme" ((UDItype)(one[0])));-
570-
571 if (y0 == nm1_0
y0 == nm1_0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
&& y1 == nm1_1
y1 == nm1_1Description
TRUEnever evaluated
FALSEnever evaluated
)
0-4
572 return
never executed: return 1 ;
never executed: return 1 ;
0
573 1
never executed: return 1 ;
0
574 ;
never executed: return 1 ;
0
575-
576 for (unsigned int i = 1; i < k
i < kDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
; i++)
3-4
577 {-
578 y0 = mulredc2 (&r1m, y1, y0, y1, y0, np[1], np[0], ni);-
579 y1 = r1m;-
580-
581 if (y0 == nm1_0
y0 == nm1_0Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
&& y1 == nm1_1
y1 == nm1_1Description
TRUEnever evaluated
FALSEnever evaluated
)
0-3
582 return
never executed: return 1 ;
never executed: return 1 ;
0
583 1
never executed: return 1 ;
0
584 ;
never executed: return 1 ;
0
585 if (y0 == one[0]
y0 == one[0]Description
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
&& y1 == one[1]
y1 == one[1]Description
TRUEnever evaluated
FALSEnever evaluated
)
0-3
586 return
never executed: return 0 ;
never executed: return 0 ;
0
587 0
never executed: return 0 ;
0
588 ;
never executed: return 0 ;
0
589 }
executed 3 times by 1 test: end of block
Executed by:
  • factor
3
590 return
executed 4 times by 1 test: return 0 ;
Executed by:
  • factor
executed 4 times by 1 test: return 0 ;
Executed by:
  • factor
4
591 0
executed 4 times by 1 test: return 0 ;
Executed by:
  • factor
4
592 ;
executed 4 times by 1 test: return 0 ;
Executed by:
  • factor
4
593}-
594static -
595 _Bool-
596-
597prime_p (uintmax_t n)-
598{-
599 int k;-
600 -
601 _Bool -
602 is_prime;-
603 uintmax_t a_prim, one, ni;-
604 struct factors factors;-
605-
606 if (n <= 1
n <= 1Description
TRUEnever evaluated
FALSEevaluated 486423 times by 1 test
Evaluated by:
  • factor
)
0-486423
607 return
never executed: return 0 ;
never executed: return 0 ;
0
608 0
never executed: return 0 ;
0
609 ;
never executed: return 0 ;
0
610-
611-
612 if (n < (uintmax_t) 5003 * 5003
n < (uintmax_t) 5003 * 5003Description
TRUEevaluated 486392 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 31 times by 1 test
Evaluated by:
  • factor
)
31-486392
613 return
executed 486392 times by 1 test: return 1 ;
Executed by:
  • factor
executed 486392 times by 1 test: return 1 ;
Executed by:
  • factor
486392
614 1
executed 486392 times by 1 test: return 1 ;
Executed by:
  • factor
486392
615 ;
executed 486392 times by 1 test: return 1 ;
Executed by:
  • factor
486392
616-
617-
618 uintmax_t q = n - 1;-
619 for (k = 0; (
(q & 1) == 0Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 31 times by 1 test
Evaluated by:
  • factor
q & 1) == 0
(q & 1) == 0Description
TRUEevaluated 61 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 31 times by 1 test
Evaluated by:
  • factor
; k++)
31-61
620 q >>= 1;
executed 61 times by 1 test: q >>= 1;
Executed by:
  • factor
61
621-
622 uintmax_t a = 2;-
623 do { uintmax_t __n = (n); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
64 > 8Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 31 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 16
64 > 16Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 31 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 32
64 > 32Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 31 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 64
64 > 64Description
TRUEnever evaluated
FALSEevaluated 31 times by 1 test
Evaluated by:
  • factor
) { int __invbits = 64; do { __inv = 2 * __inv - __inv * __inv * __n; __invbits *= 2; }
never executed: end of block
while (__invbits < 64
__invbits < 64Description
TRUEnever evaluated
FALSEnever evaluated
); }
never executed: end of block
(ni) = __inv; } while (0);
0-31
624 do { uintmax_t _redcify_q __attribute__ ((__unused__)); do { uintmax_t __d1, __d0, __q, __r1, __r0; -
625 ((-
626 (1) < (n)-
627 ) ? (void) (0) : __assert_fail (-
628 "(1) < (n)"-
629 , "src/factor.c", 1220, __PRETTY_FUNCTION__))-
630 ; __d1 = (n); __d0 = 0; __r1 = (1); __r0 = (0); __q = 0; for (unsigned int __i = 64; __i > 0
__i > 0Description
TRUEevaluated 1984 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 31 times by 1 test
Evaluated by:
  • factor
; __i--) { do { (__d0) = ((__d1) << (64 - (1))) | ((__d0) >> (1)); (__d1) = (__d1) >> (1); } while (0); __q <<= 1; if (((
(__r1) > (__d1)Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1953 times by 1 test
Evaluated by:
  • factor
__r1) > (__d1)
(__r1) > (__d1)Description
TRUEevaluated 31 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1953 times by 1 test
Evaluated by:
  • factor
|| ((
(__r1) == (__d1)Description
TRUEevaluated 993 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 960 times by 1 test
Evaluated by:
  • factor
__r1) == (__d1)
(__r1) == (__d1)Description
TRUEevaluated 993 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 960 times by 1 test
Evaluated by:
  • factor
&& (
(__r0) >= (__d0)Description
TRUEevaluated 240 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 753 times by 1 test
Evaluated by:
  • factor
__r0) >= (__d0)
(__r0) >= (__d0)Description
TRUEevaluated 240 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 753 times by 1 test
Evaluated by:
  • factor
))) { __q++; __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (__r1), "=&r" (__r0) : "0" ((UDItype)(__r1)), "rme" ((UDItype)(__d1)), "1" ((UDItype)(__r0)), "rme" ((UDItype)(__d0))); }
executed 271 times by 1 test: end of block
Executed by:
  • factor
}
executed 1984 times by 1 test: end of block
Executed by:
  • factor
(one) = __r0; (_redcify_q) = __q; } while (0); } while (0);
31-1984
631 do { uintmax_t _t = - (uintmax_t) ((one) < ((n) - (one))); ((a_prim)) = (((n)) & _t) + ((one)) - (((n) - (one))); } while (0);-
632-
633-
634 if (!millerrabin (n, ni, a_prim, q, k, one)
!millerrabin (...im, q, k, one)Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
)
4-27
635 return
executed 27 times by 1 test: return 0 ;
Executed by:
  • factor
executed 27 times by 1 test: return 0 ;
Executed by:
  • factor
27
636 0
executed 27 times by 1 test: return 0 ;
Executed by:
  • factor
27
637 ;
executed 27 times by 1 test: return 0 ;
Executed by:
  • factor
27
638-
639 if (flag_prove_primality
flag_prove_primalityDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
)
0-4
640 {-
641-
642 factor (0, n - 1, &factors);-
643 }
executed 4 times by 1 test: end of block
Executed by:
  • factor
4
644-
645-
646-
647 for (unsigned int r = 0; r < (sizeof (primes_diff) / sizeof (primes_diff[0]) - 8 + 1)
r < (sizeof (p...f[0]) - 8 + 1)Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
; r++)
0-27
648 {-
649 if (flag_prove_primality
flag_prove_primalityDescription
TRUEevaluated 27 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
)
0-27
650 {-
651 is_prime = -
652 1-
653 ;-
654 for (unsigned int i = 0; i < factors.nfactors
i < factors.nfactorsDescription
TRUEevaluated 79 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
&& is_prime
is_primeDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 23 times by 1 test
Evaluated by:
  • factor
; i++)
4-79
655 {-
656 is_prime-
657 = powm (a_prim, (n - 1) / factors.p[i], n, ni, one) != one;-
658 }
executed 56 times by 1 test: end of block
Executed by:
  • factor
56
659 }
executed 27 times by 1 test: end of block
Executed by:
  • factor
27
660 else-
661 {-
662-
663 is_prime = (r == 25 - 1);-
664 }
never executed: end of block
0
665-
666 if (is_prime
is_primeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 23 times by 1 test
Evaluated by:
  • factor
)
4-23
667 return
executed 4 times by 1 test: return 1 ;
Executed by:
  • factor
executed 4 times by 1 test: return 1 ;
Executed by:
  • factor
4
668 1
executed 4 times by 1 test: return 1 ;
Executed by:
  • factor
4
669 ;
executed 4 times by 1 test: return 1 ;
Executed by:
  • factor
4
670-
671 a += primes_diff[r];-
672-
673-
674-
675-
676 {-
677 uintmax_t s1, s0;-
678 __asm__ ("mulq %3" : "=a" (s0), "=d" (s1) : "%0" ((UDItype)(one)), "rm" ((UDItype)(a)));-
679 if (__builtin_expect ((s1 == 0), 1)
__builtin_expe...((s1 == 0), 1)Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
)
0-23
680 a_prim = s0 % n;
executed 23 times by 1 test: a_prim = s0 % n;
Executed by:
  • factor
23
681 else-
682 {-
683 uintmax_t dummy __attribute__ ((__unused__));-
684 do { uintmax_t __d1, __d0, __q, __r1, __r0; -
685 ((-
686 (s1) < (n)-
687 ) ? (void) (0) : __assert_fail (-
688 "(s1) < (n)"-
689 , "src/factor.c", 1268, __PRETTY_FUNCTION__))-
690 ; __d1 = (n); __d0 = 0; __r1 = (s1); __r0 = (s0); __q = 0; for (unsigned int __i = 64; __i > 0
__i > 0Description
TRUEnever evaluated
FALSEnever evaluated
; __i--) { do { (__d0) = ((__d1) << (64 - (1))) | ((__d0) >> (1)); (__d1) = (__d1) >> (1); } while (0); __q <<= 1; if (((
(__r1) > (__d1)Description
TRUEnever evaluated
FALSEnever evaluated
__r1) > (__d1)
(__r1) > (__d1)Description
TRUEnever evaluated
FALSEnever evaluated
|| ((
(__r1) == (__d1)Description
TRUEnever evaluated
FALSEnever evaluated
__r1) == (__d1)
(__r1) == (__d1)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(__r0) >= (__d0)Description
TRUEnever evaluated
FALSEnever evaluated
__r0) >= (__d0)
(__r0) >= (__d0)Description
TRUEnever evaluated
FALSEnever evaluated
))) { __q++; __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (__r1), "=&r" (__r0) : "0" ((UDItype)(__r1)), "rme" ((UDItype)(__d1)), "1" ((UDItype)(__r0)), "rme" ((UDItype)(__d0))); }
never executed: end of block
}
never executed: end of block
(a_prim) = __r0; (dummy) = __q; } while (0);
0
691 }
never executed: end of block
0
692 }-
693-
694 if (!millerrabin (n, ni, a_prim, q, k, one)
!millerrabin (...im, q, k, one)Description
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • factor
)
0-23
695 return
never executed: return 0 ;
never executed: return 0 ;
0
696 0
never executed: return 0 ;
0
697 ;
never executed: return 0 ;
0
698 }
executed 23 times by 1 test: end of block
Executed by:
  • factor
23
699-
700 error (0, 0, -
701 dcgettext (((void *)0), -
702 "Lucas prime test failure. This should not happen"-
703 , 5)-
704 );-
705 abort ();
never executed: abort ();
0
706}-
707-
708static -
709 _Bool-
710-
711prime2_p (uintmax_t n1, uintmax_t n0)-
712{-
713 uintmax_t q[2], nm1[2];-
714 uintmax_t a_prim[2];-
715 uintmax_t one[2];-
716 uintmax_t na[2];-
717 uintmax_t ni;-
718 unsigned int k;-
719 struct factors factors;-
720-
721 if (n1 == 0
n1 == 0Description
TRUEevaluated 486362 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
)
4-486362
722 return
executed 486362 times by 1 test: return prime_p (n0);
Executed by:
  • factor
prime_p (n0);
executed 486362 times by 1 test: return prime_p (n0);
Executed by:
  • factor
486362
723-
724 nm1[1] = n1 - (n0 == 0);-
725 nm1[0] = n0 - 1;-
726 if (nm1[0] == 0
nm1[0] == 0Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
)
0-4
727 {-
728 do { ; __asm__ ("bsfq %1,%q0" : "=r" (k) : "rm" ((UDItype)(nm1[1]))); } while (0);-
729-
730 q[0] = nm1[1] >> k;-
731 q[1] = 0;-
732 k += 64;-
733 }
never executed: end of block
0
734 else-
735 {-
736 do { ; __asm__ ("bsfq %1,%q0" : "=r" (k) : "rm" ((UDItype)(nm1[0]))); } while (0);-
737 do { (q[0]) = ((nm1[1]) << (64 - (k))) | ((nm1[0]) >> (k)); (q[1]) = (nm1[1]) >> (k); } while (0);-
738 }
executed 4 times by 1 test: end of block
Executed by:
  • factor
4
739-
740 uintmax_t a = 2;-
741 do { uintmax_t __n = (n0); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
64 > 8Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 4 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 16
64 > 16Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 4 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 32
64 > 32Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 4 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 64
64 > 64Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
) { int __invbits = 64; do { __inv = 2 * __inv - __inv * __inv * __n; __invbits *= 2; }
never executed: end of block
while (__invbits < 64
__invbits < 64Description
TRUEnever evaluated
FALSEnever evaluated
); }
never executed: end of block
(ni) = __inv; } while (0);
0-4
742 do { uintmax_t _r1, _r0, _i; if ((
(1) < (n1)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
1) < (n1)
(1) < (n1)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
) { _r1 = (1); _r0 = 0; _i = 64; }
executed 3 times by 1 test: end of block
Executed by:
  • factor
else { _r1 = 0; _r0 = (1); _i = 2*64; }
executed 1 time by 1 test: end of block
Executed by:
  • factor
while (_i-- > 0
_i-- > 0Description
TRUEevaluated 320 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
) { do { (_r1) = ((_r1) << 1) | ((_r0) >> (64 - (1))); (_r0) = (_r0) << (1); } while (0); if (((
(_r1) > ((n1))Description
TRUEevaluated 129 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 191 times by 1 test
Evaluated by:
  • factor
_r1) > ((n1))
(_r1) > ((n1))Description
TRUEevaluated 129 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 191 times by 1 test
Evaluated by:
  • factor
|| ((
(_r1) == ((n1))Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 165 times by 1 test
Evaluated by:
  • factor
_r1) == ((n1))
(_r1) == ((n1))Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 165 times by 1 test
Evaluated by:
  • factor
&& (
(_r0) >= ((n0))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 21 times by 1 test
Evaluated by:
  • factor
_r0) >= ((n0))
(_r0) >= ((n0))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 21 times by 1 test
Evaluated by:
  • factor
))) __asm__
executed 134 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));
Executed by:
  • factor
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));
executed 134 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));
Executed by:
  • factor
}
executed 320 times by 1 test: end of block
Executed by:
  • factor
(one[1]) = _r1; (one[0]) = _r0; } while (0);
1-320
743 do { __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((a_prim[1])), "=&r" ((a_prim[0])) : "0" ((UDItype)((one[1]))), "rme" ((UDItype)((one[1]))), "%1" ((UDItype)((one[0]))), "rme" ((UDItype)((one[0])))); if ((((
((a_prim[1])) > ((n1))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2 times by 1 test
Evaluated by:
  • factor
a_prim[1])) > ((n1))
((a_prim[1])) > ((n1))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2 times by 1 test
Evaluated by:
  • factor
|| (((
((a_prim[1])) == ((n1))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
a_prim[1])) == ((n1))
((a_prim[1])) == ((n1))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
&& ((
((a_prim[0])) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
a_prim[0])) >= ((n0))
((a_prim[0])) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
))) __asm__
executed 2 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((a_prim[1])), "=&r" ((a_prim[0])) : "0" ((UDItype)((a_prim[1]))), "rme" ((UDItype)((n1))), "1" ((UDItype)((a_prim[0]))), "rme" ((UDItype)((n0))));
Executed by:
  • factor
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((a_prim[1])), "=&r" ((a_prim[0])) : "0" ((UDItype)((a_prim[1]))), "rme" ((UDItype)((n1))), "1" ((UDItype)((a_prim[0]))), "rme" ((UDItype)((n0))));
executed 2 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((a_prim[1])), "=&r" ((a_prim[0])) : "0" ((UDItype)((a_prim[1]))), "rme" ((UDItype)((n1))), "1" ((UDItype)((a_prim[0]))), "rme" ((UDItype)((n0))));
Executed by:
  • factor
} while (0);
0-2
744-
745-
746 na[0] = n0;-
747 na[1] = n1;-
748-
749 if (!millerrabin2 (na, ni, a_prim, q, k, one)
!millerrabin2 ...im, q, k, one)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
)
0-4
750 return
executed 4 times by 1 test: return 0 ;
Executed by:
  • factor
executed 4 times by 1 test: return 0 ;
Executed by:
  • factor
4
751 0
executed 4 times by 1 test: return 0 ;
Executed by:
  • factor
4
752 ;
executed 4 times by 1 test: return 0 ;
Executed by:
  • factor
4
753-
754 if (flag_prove_primality
flag_prove_primalityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
755 {-
756-
757 factor (nm1[1], nm1[0], &factors);-
758 }
never executed: end of block
0
759-
760-
761-
762 for (unsigned int r = 0; r < (sizeof (primes_diff) / sizeof (primes_diff[0]) - 8 + 1)
r < (sizeof (p...f[0]) - 8 + 1)Description
TRUEnever evaluated
FALSEnever evaluated
; r++)
0
763 {-
764 -
765 _Bool -
766 is_prime;-
767 uintmax_t e[2], y[2];-
768-
769 if (flag_prove_primality
flag_prove_primalityDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
770 {-
771 is_prime = -
772 1-
773 ;-
774 if (factors.plarge[1]
factors.plarge[1]Description
TRUEnever evaluated
FALSEnever evaluated
)
0
775 {-
776 uintmax_t pi;-
777 do { uintmax_t __n = (factors.plarge[0]); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
64 > 8Description
TRUEnever evaluated
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
never executed: __inv = 2 * __inv - __inv * __inv * __n;
if (64 > 16
64 > 16Description
TRUEnever evaluated
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
never executed: __inv = 2 * __inv - __inv * __inv * __n;
if (64 > 32
64 > 32Description
TRUEnever evaluated
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
never executed: __inv = 2 * __inv - __inv * __inv * __n;
if (64 > 64
64 > 64Description
TRUEnever evaluated
FALSEnever evaluated
) { int __invbits = 64; do { __inv = 2 * __inv - __inv * __inv * __n; __invbits *= 2; }
never executed: end of block
while (__invbits < 64
__invbits < 64Description
TRUEnever evaluated
FALSEnever evaluated
); }
never executed: end of block
(pi) = __inv; } while (0);
0
778 e[0] = pi * nm1[0];-
779 e[1] = 0;-
780 y[0] = powm2 (&y[1], a_prim, e, na, ni, one);-
781 is_prime = (y[0] != one[0]
y[0] != one[0]Description
TRUEnever evaluated
FALSEnever evaluated
|| y[1] != one[1]
y[1] != one[1]Description
TRUEnever evaluated
FALSEnever evaluated
);
0
782 }
never executed: end of block
0
783 for (unsigned int i = 0; i < factors.nfactors
i < factors.nfactorsDescription
TRUEnever evaluated
FALSEnever evaluated
&& is_prime
is_primeDescription
TRUEnever evaluated
FALSEnever evaluated
; i++)
0
784 {-
785-
786-
787-
788 if (factors.p[i] == 2
factors.p[i] == 2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
789 do { (e[0]) = ((nm1[1]) << (64 - (1))) | ((nm1[0]) >> (1)); (e[1]) = (nm1[1]) >> (1); }
never executed: end of block
while (0);
0
790 else-
791 do { uintmax_t _di, _q0; do { uintmax_t __n = ((factors.p[i])); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
64 > 8Description
TRUEnever evaluated
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
never executed: __inv = 2 * __inv - __inv * __inv * __n;
if (64 > 16
64 > 16Description
TRUEnever evaluated
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
never executed: __inv = 2 * __inv - __inv * __inv * __n;
if (64 > 32
64 > 32Description
TRUEnever evaluated
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
never executed: __inv = 2 * __inv - __inv * __inv * __n;
if (64 > 64
64 > 64Description
TRUEnever evaluated
FALSEnever evaluated
) { int __invbits = 64; do { __inv = 2 * __inv - __inv * __inv * __n; __invbits *= 2; }
never executed: end of block
while (__invbits < 64
__invbits < 64Description
TRUEnever evaluated
FALSEnever evaluated
); }
never executed: end of block
(_di) = __inv; } while (0); _q0 = (nm1[0]) * _di; if ((
(nm1[1]) >= (factors.p[i])Description
TRUEnever evaluated
FALSEnever evaluated
nm1[1]) >= (factors.p[i])
(nm1[1]) >= (factors.p[i])Description
TRUEnever evaluated
FALSEnever evaluated
) { uintmax_t _p1, _p0 __attribute__ ((__unused__)); __asm__ ("mulq %3" : "=a" (_p0), "=d" (_p1) : "%0" ((UDItype)(_q0)), "rm" ((UDItype)(factors.p[i]))); (e[1]) = ((nm1[1]) - _p1) * _di; (e[0]) = _q0; }
never executed: end of block
else { (e[0]) = _q0; (e[1]) = 0; }
never executed: end of block
}
never executed: end of block
while (0);
0
792 y[0] = powm2 (&y[1], a_prim, e, na, ni, one);-
793 is_prime = (y[0] != one[0]
y[0] != one[0]Description
TRUEnever evaluated
FALSEnever evaluated
|| y[1] != one[1]
y[1] != one[1]Description
TRUEnever evaluated
FALSEnever evaluated
);
0
794 }
never executed: end of block
0
795 }
never executed: end of block
0
796 else-
797 {-
798-
799 is_prime = (r == 25 - 1);-
800 }
never executed: end of block
0
801-
802 if (is_prime
is_primeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
803 return
never executed: return 1 ;
never executed: return 1 ;
0
804 1
never executed: return 1 ;
0
805 ;
never executed: return 1 ;
0
806-
807 a += primes_diff[r];-
808 do { uintmax_t _r1, _r0, _i; if ((
(a) < (n1)Description
TRUEnever evaluated
FALSEnever evaluated
a) < (n1)
(a) < (n1)Description
TRUEnever evaluated
FALSEnever evaluated
) { _r1 = (a); _r0 = 0; _i = 64; }
never executed: end of block
else { _r1 = 0; _r0 = (a); _i = 2*64; }
never executed: end of block
while (_i-- > 0
_i-- > 0Description
TRUEnever evaluated
FALSEnever evaluated
) { do { (_r1) = ((_r1) << 1) | ((_r0) >> (64 - (1))); (_r0) = (_r0) << (1); } while (0); if (((
(_r1) > ((n1))Description
TRUEnever evaluated
FALSEnever evaluated
_r1) > ((n1))
(_r1) > ((n1))Description
TRUEnever evaluated
FALSEnever evaluated
|| ((
(_r1) == ((n1))Description
TRUEnever evaluated
FALSEnever evaluated
_r1) == ((n1))
(_r1) == ((n1))Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(_r0) >= ((n0))Description
TRUEnever evaluated
FALSEnever evaluated
_r0) >= ((n0))
(_r0) >= ((n0))Description
TRUEnever evaluated
FALSEnever evaluated
))) __asm__
never executed: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));
never executed: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));
}
never executed: end of block
(a_prim[1]) = _r1; (a_prim[0]) = _r0; } while (0);
0
809-
810 if (!millerrabin2 (na, ni, a_prim, q, k, one)
!millerrabin2 ...im, q, k, one)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
811 return
never executed: return 0 ;
never executed: return 0 ;
0
812 0
never executed: return 0 ;
0
813 ;
never executed: return 0 ;
0
814 }
never executed: end of block
0
815-
816 error (0, 0, -
817 dcgettext (((void *)0), -
818 "Lucas prime test failure. This should not happen"-
819 , 5)-
820 );-
821 abort ();
never executed: abort ();
0
822}-
823static void-
824factor_using_pollard_rho (uintmax_t n, unsigned long int a,-
825 struct factors *factors)-
826{-
827 uintmax_t x, z, y, P, t, ni, g;-
828-
829 unsigned long int k = 1;-
830 unsigned long int l = 1;-
831-
832 do { uintmax_t _redcify_q __attribute__ ((__unused__)); do { uintmax_t __d1, __d0, __q, __r1, __r0; -
833 ((-
834 (1) < (n)-
835 ) ? (void) (0) : __assert_fail (-
836 "(1) < (n)"-
837 , "src/factor.c", 1474, __PRETTY_FUNCTION__))-
838 ; __d1 = (n); __d0 = 0; __r1 = (1); __r0 = (0); __q = 0; for (unsigned int __i = 64; __i > 0
__i > 0Description
TRUEevaluated 1664 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 26 times by 1 test
Evaluated by:
  • factor
; __i--) { do { (__d0) = ((__d1) << (64 - (1))) | ((__d0) >> (1)); (__d1) = (__d1) >> (1); } while (0); __q <<= 1; if (((
(__r1) > (__d1)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1638 times by 1 test
Evaluated by:
  • factor
__r1) > (__d1)
(__r1) > (__d1)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1638 times by 1 test
Evaluated by:
  • factor
|| ((
(__r1) == (__d1)Description
TRUEevaluated 828 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 810 times by 1 test
Evaluated by:
  • factor
__r1) == (__d1)
(__r1) == (__d1)Description
TRUEevaluated 828 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 810 times by 1 test
Evaluated by:
  • factor
&& (
(__r0) >= (__d0)Description
TRUEevaluated 195 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 633 times by 1 test
Evaluated by:
  • factor
__r0) >= (__d0)
(__r0) >= (__d0)Description
TRUEevaluated 195 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 633 times by 1 test
Evaluated by:
  • factor
))) { __q++; __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (__r1), "=&r" (__r0) : "0" ((UDItype)(__r1)), "rme" ((UDItype)(__d1)), "1" ((UDItype)(__r0)), "rme" ((UDItype)(__d0))); }
executed 221 times by 1 test: end of block
Executed by:
  • factor
}
executed 1664 times by 1 test: end of block
Executed by:
  • factor
(P) = __r0; (_redcify_q) = __q; } while (0); } while (0);
26-1664
839 do { uintmax_t _t = - (uintmax_t) ((P) < ((n) - (P))); ((x)) = (((n)) & _t) + ((P)) - (((n) - (P))); } while (0);-
840 y = z = x;-
841-
842 while (n != 1
n != 1Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
)
0-27
843 {-
844 -
845 ((-
846 a < n-
847 ) ? (void) (0) : __assert_fail (-
848 "a < n"-
849 , "src/factor.c", 1480, __PRETTY_FUNCTION__))-
850 ;-
851-
852 do { uintmax_t __n = (n); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
64 > 8Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 27 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 16
64 > 16Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 27 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 32
64 > 32Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 27 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 64
64 > 64Description
TRUEnever evaluated
FALSEevaluated 27 times by 1 test
Evaluated by:
  • factor
) { int __invbits = 64; do { __inv = 2 * __inv - __inv * __inv * __n; __invbits *= 2; }
never executed: end of block
while (__invbits < 64
__invbits < 64Description
TRUEnever evaluated
FALSEnever evaluated
); }
never executed: end of block
(ni) = __inv; } while (0);
0-27
853-
854 for (;;)-
855 {-
856 do-
857 {-
858 x = mulredc (x, x, n, ni);-
859 do { uintmax_t _t = - (uintmax_t) ((x) < ((n) - (a))); ((x)) = (((n)) & _t) + ((x)) - (((n) - (a))); } while (0);-
860-
861 do { uintmax_t _t = - (uintmax_t) (z < x); (t) = ((n) & _t) + (z) - (x); } while (0);-
862 P = mulredc (P, t, n, ni);-
863-
864 if (k % 32 == 1
k % 32 == 1Description
TRUEevaluated 316 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 5605 times by 1 test
Evaluated by:
  • factor
)
316-5605
865 {-
866 if (gcd_odd (P, n) != 1
gcd_odd (P, n) != 1Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 289 times by 1 test
Evaluated by:
  • factor
)
27-289
867 goto
executed 27 times by 1 test: goto factor_found;
Executed by:
  • factor
factor_found;
executed 27 times by 1 test: goto factor_found;
Executed by:
  • factor
27
868 y = x;-
869 }
executed 289 times by 1 test: end of block
Executed by:
  • factor
289
870 }
executed 5894 times by 1 test: end of block
Executed by:
  • factor
5894
871 while (--
--k != 0Description
TRUEevaluated 5697 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 197 times by 1 test
Evaluated by:
  • factor
k != 0
--k != 0Description
TRUEevaluated 5697 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 197 times by 1 test
Evaluated by:
  • factor
);
197-5697
872-
873 z = x;-
874 k = l;-
875 l = 2 * l;-
876 for (unsigned long int i = 0; i < k
i < kDescription
TRUEevaluated 7654 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 197 times by 1 test
Evaluated by:
  • factor
; i++)
197-7654
877 {-
878 x = mulredc (x, x, n, ni);-
879 do { uintmax_t _t = - (uintmax_t) ((x) < ((n) - (a))); ((x)) = (((n)) & _t) + ((x)) - (((n) - (a))); } while (0);-
880 }
executed 7654 times by 1 test: end of block
Executed by:
  • factor
7654
881 y = x;-
882 }
executed 197 times by 1 test: end of block
Executed by:
  • factor
197
883-
884 factor_found:
code before this statement never executed: factor_found:
0
885 do-
886 {-
887 y = mulredc (y, y, n, ni);-
888 do { uintmax_t _t = - (uintmax_t) ((y) < ((n) - (a))); ((y)) = (((n)) & _t) + ((y)) - (((n) - (a))); } while (0);-
889-
890 do { uintmax_t _t = - (uintmax_t) (z < y); (t) = ((n) & _t) + (z) - (y); } while (0);-
891 g = gcd_odd (t, n);-
892 }
executed 382 times by 1 test: end of block
Executed by:
  • factor
382
893 while (g == 1
g == 1Description
TRUEevaluated 355 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 27 times by 1 test
Evaluated by:
  • factor
);
27-355
894-
895 if (n == g
n == gDescription
TRUEnever evaluated
FALSEevaluated 27 times by 1 test
Evaluated by:
  • factor
)
0-27
896 {-
897-
898 factor_using_pollard_rho (n, a + 1, factors);-
899 return;
never executed: return;
0
900 }-
901-
902 n = n / g;-
903-
904 if (!prime_p (g)
!prime_p (g)Description
TRUEnever evaluated
FALSEevaluated 27 times by 1 test
Evaluated by:
  • factor
)
0-27
905 factor_using_pollard_rho (g, a + 1, factors);
never executed: factor_using_pollard_rho (g, a + 1, factors);
0
906 else-
907 factor_insert_multiplicity (factors, g, 1);
executed 27 times by 1 test: factor_insert_multiplicity (factors, g, 1);
Executed by:
  • factor
27
908-
909 if (prime_p (n)
prime_p (n)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
)
1-26
910 {-
911 factor_insert_multiplicity (factors, n, 1);-
912 break;
executed 26 times by 1 test: break;
Executed by:
  • factor
26
913 }-
914-
915 x = x % n;-
916 z = z % n;-
917 y = y % n;-
918 }
executed 1 time by 1 test: end of block
Executed by:
  • factor
1
919}
executed 26 times by 1 test: end of block
Executed by:
  • factor
26
920-
921static void-
922factor_using_pollard_rho2 (uintmax_t n1, uintmax_t n0, unsigned long int a,-
923 struct factors *factors)-
924{-
925 uintmax_t x1, x0, z1, z0, y1, y0, P1, P0, t1, t0, ni, g1, g0, r1m;-
926-
927 unsigned long int k = 1;-
928 unsigned long int l = 1;-
929-
930 do { uintmax_t _r1, _r0, _i; if ((
(1) < (n1)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
1) < (n1)
(1) < (n1)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
) { _r1 = (1); _r0 = 0; _i = 64; }
executed 3 times by 1 test: end of block
Executed by:
  • factor
else { _r1 = 0; _r0 = (1); _i = 2*64; }
executed 1 time by 1 test: end of block
Executed by:
  • factor
while (_i-- > 0
_i-- > 0Description
TRUEevaluated 320 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
) { do { (_r1) = ((_r1) << 1) | ((_r0) >> (64 - (1))); (_r0) = (_r0) << (1); } while (0); if (((
(_r1) > ((n1))Description
TRUEevaluated 129 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 191 times by 1 test
Evaluated by:
  • factor
_r1) > ((n1))
(_r1) > ((n1))Description
TRUEevaluated 129 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 191 times by 1 test
Evaluated by:
  • factor
|| ((
(_r1) == ((n1))Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 165 times by 1 test
Evaluated by:
  • factor
_r1) == ((n1))
(_r1) == ((n1))Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 165 times by 1 test
Evaluated by:
  • factor
&& (
(_r0) >= ((n0))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 21 times by 1 test
Evaluated by:
  • factor
_r0) >= ((n0))
(_r0) >= ((n0))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 21 times by 1 test
Evaluated by:
  • factor
))) __asm__
executed 134 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));
Executed by:
  • factor
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));
executed 134 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));
Executed by:
  • factor
}
executed 320 times by 1 test: end of block
Executed by:
  • factor
(P1) = _r1; (P0) = _r0; } while (0);
1-320
931 do { __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((P1))), "rme" ((UDItype)((P1))), "%1" ((UDItype)((P0))), "rme" ((UDItype)((P0)))); if ((((
((x1)) > ((n1))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2 times by 1 test
Evaluated by:
  • factor
x1)) > ((n1))
((x1)) > ((n1))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2 times by 1 test
Evaluated by:
  • factor
|| (((
((x1)) == ((n1))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
x1)) == ((n1))
((x1)) == ((n1))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
&& ((
((x0)) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
x0)) >= ((n0))
((x0)) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
))) __asm__
executed 2 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));
Executed by:
  • factor
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));
executed 2 times by 1 test: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));
Executed by:
  • factor
} while (0);
0-2
932 y1 = z1 = x1;-
933 y0 = z0 = x0;-
934-
935 while (n1 != 0
n1 != 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
|| n0 != 1
n0 != 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0-5
936 {-
937 do { uintmax_t __n = (n0); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
64 > 8Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 5 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 16
64 > 16Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 5 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 32
64 > 32Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 5 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 64
64 > 64Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • factor
) { int __invbits = 64; do { __inv = 2 * __inv - __inv * __inv * __n; __invbits *= 2; }
never executed: end of block
while (__invbits < 64
__invbits < 64Description
TRUEnever evaluated
FALSEnever evaluated
); }
never executed: end of block
(ni) = __inv; } while (0);
0-5
938-
939 for (;;)-
940 {-
941 do-
942 {-
943 x0 = mulredc2 (&r1m, x1, x0, x1, x0, n1, n0, ni);-
944 x1 = r1m;-
945 do { __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((0))), "%1" ((UDItype)((x0))), "rme" ((UDItype)(((uintmax_t) a)))); if ((((
((x1)) > ((n1))Description
TRUEnever evaluated
FALSEevaluated 54593 times by 1 test
Evaluated by:
  • factor
x1)) > ((n1))
((x1)) > ((n1))Description
TRUEnever evaluated
FALSEevaluated 54593 times by 1 test
Evaluated by:
  • factor
|| (((
((x1)) == ((n1))Description
TRUEevaluated 23595 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 30998 times by 1 test
Evaluated by:
  • factor
x1)) == ((n1))
((x1)) == ((n1))Description
TRUEevaluated 23595 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 30998 times by 1 test
Evaluated by:
  • factor
&& ((
((x0)) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 23595 times by 1 test
Evaluated by:
  • factor
x0)) >= ((n0))
((x0)) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 23595 times by 1 test
Evaluated by:
  • factor
))) __asm__
never executed: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));
never executed: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));
} while (0);
0-54593
946-
947 do { __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((z1))), "rme" ((UDItype)((x1))), "1" ((UDItype)((z0))), "rme" ((UDItype)((x0)))); if ((
(intmax_t) (t1) < 0Description
TRUEevaluated 31697 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 22896 times by 1 test
Evaluated by:
  • factor
intmax_t) (t1) < 0
(intmax_t) (t1) < 0Description
TRUEevaluated 31697 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 22896 times by 1 test
Evaluated by:
  • factor
) __asm__
executed 31697 times by 1 test: __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((t1))), "rme" ((UDItype)((n1))), "%1" ((UDItype)((t0))), "rme" ((UDItype)((n0))));
Executed by:
  • factor
("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((t1))), "rme" ((UDItype)((n1))), "%1" ((UDItype)((t0))), "rme" ((UDItype)((n0))));
executed 31697 times by 1 test: __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((t1))), "rme" ((UDItype)((n1))), "%1" ((UDItype)((t0))), "rme" ((UDItype)((n0))));
Executed by:
  • factor
} while (0);
22896-31697
948 P0 = mulredc2 (&r1m, P1, P0, t1, t0, n1, n0, ni);-
949 P1 = r1m;-
950-
951 if (k % 32 == 1
k % 32 == 1Description
TRUEevaluated 1727 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 52866 times by 1 test
Evaluated by:
  • factor
)
1727-52866
952 {-
953 g0 = gcd2_odd (&g1, P1, P0, n1, n0);-
954 if (g1 != 0
g1 != 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1724 times by 1 test
Evaluated by:
  • factor
|| g0 != 1
g0 != 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1722 times by 1 test
Evaluated by:
  • factor
)
2-1724
955 goto
executed 5 times by 1 test: goto factor_found;
Executed by:
  • factor
factor_found;
executed 5 times by 1 test: goto factor_found;
Executed by:
  • factor
5
956 y1 = x1; y0 = x0;-
957 }
executed 1722 times by 1 test: end of block
Executed by:
  • factor
1722
958 }
executed 54588 times by 1 test: end of block
Executed by:
  • factor
54588
959 while (--
--k != 0Description
TRUEevaluated 54539 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 49 times by 1 test
Evaluated by:
  • factor
k != 0
--k != 0Description
TRUEevaluated 54539 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 49 times by 1 test
Evaluated by:
  • factor
);
49-54539
960-
961 z1 = x1; z0 = x0;-
962 k = l;-
963 l = 2 * l;-
964 for (unsigned long int i = 0; i < k
i < kDescription
TRUEevaluated 67836 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 49 times by 1 test
Evaluated by:
  • factor
; i++)
49-67836
965 {-
966 x0 = mulredc2 (&r1m, x1, x0, x1, x0, n1, n0, ni);-
967 x1 = r1m;-
968 do { __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((0))), "%1" ((UDItype)((x0))), "rme" ((UDItype)(((uintmax_t) a)))); if ((((
((x1)) > ((n1))Description
TRUEnever evaluated
FALSEevaluated 67836 times by 1 test
Evaluated by:
  • factor
x1)) > ((n1))
((x1)) > ((n1))Description
TRUEnever evaluated
FALSEevaluated 67836 times by 1 test
Evaluated by:
  • factor
|| (((
((x1)) == ((n1))Description
TRUEevaluated 29562 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 38274 times by 1 test
Evaluated by:
  • factor
x1)) == ((n1))
((x1)) == ((n1))Description
TRUEevaluated 29562 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 38274 times by 1 test
Evaluated by:
  • factor
&& ((
((x0)) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 29562 times by 1 test
Evaluated by:
  • factor
x0)) >= ((n0))
((x0)) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 29562 times by 1 test
Evaluated by:
  • factor
))) __asm__
never executed: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));
never executed: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));
} while (0);
0-67836
969 }
executed 67836 times by 1 test: end of block
Executed by:
  • factor
67836
970 y1 = x1; y0 = x0;-
971 }
executed 49 times by 1 test: end of block
Executed by:
  • factor
49
972-
973 factor_found:
code before this statement never executed: factor_found:
0
974 do-
975 {-
976 y0 = mulredc2 (&r1m, y1, y0, y1, y0, n1, n0, ni);-
977 y1 = r1m;-
978 do { __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((y1)), "=&r" ((y0)) : "0" ((UDItype)((y1))), "rme" ((UDItype)((0))), "%1" ((UDItype)((y0))), "rme" ((UDItype)(((uintmax_t) a)))); if ((((
((y1)) > ((n1))Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • factor
y1)) > ((n1))
((y1)) > ((n1))Description
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • factor
|| (((
((y1)) == ((n1))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 22 times by 1 test
Evaluated by:
  • factor
y1)) == ((n1))
((y1)) == ((n1))Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 22 times by 1 test
Evaluated by:
  • factor
&& ((
((y0)) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • factor
y0)) >= ((n0))
((y0)) >= ((n0))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • factor
))) __asm__
never executed: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((y1)), "=&r" ((y0)) : "0" ((UDItype)((y1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((y0))), "rme" ((UDItype)((n0))));
("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((y1)), "=&r" ((y0)) : "0" ((UDItype)((y1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((y0))), "rme" ((UDItype)((n0))));
never executed: __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((y1)), "=&r" ((y0)) : "0" ((UDItype)((y1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((y0))), "rme" ((UDItype)((n0))));
} while (0);
0-24
979-
980 do { __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((z1))), "rme" ((UDItype)((y1))), "1" ((UDItype)((z0))), "rme" ((UDItype)((y0)))); if ((
(intmax_t) (t1) < 0Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 5 times by 1 test
Evaluated by:
  • factor
intmax_t) (t1) < 0
(intmax_t) (t1) < 0Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 5 times by 1 test
Evaluated by:
  • factor
) __asm__
executed 19 times by 1 test: __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((t1))), "rme" ((UDItype)((n1))), "%1" ((UDItype)((t0))), "rme" ((UDItype)((n0))));
Executed by:
  • factor
("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((t1))), "rme" ((UDItype)((n1))), "%1" ((UDItype)((t0))), "rme" ((UDItype)((n0))));
executed 19 times by 1 test: __asm__ ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((t1))), "rme" ((UDItype)((n1))), "%1" ((UDItype)((t0))), "rme" ((UDItype)((n0))));
Executed by:
  • factor
} while (0);
5-19
981 g0 = gcd2_odd (&g1, t1, t0, n1, n0);-
982 }
executed 24 times by 1 test: end of block
Executed by:
  • factor
24
983 while (g1 == 0
g1 == 0Description
TRUEevaluated 23 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
&& g0 == 1
g0 == 1Description
TRUEevaluated 19 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
);
1-23
984-
985 if (g1 == 0
g1 == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
)
1-4
986 {-
987-
988 do { uintmax_t _di, _q0; do { uintmax_t __n = ((g0)); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
64 > 8Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 4 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 16
64 > 16Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 4 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 32
64 > 32Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
executed 4 times by 1 test: __inv = 2 * __inv - __inv * __inv * __n;
Executed by:
  • factor
if (64 > 64
64 > 64Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
) { int __invbits = 64; do { __inv = 2 * __inv - __inv * __inv * __n; __invbits *= 2; }
never executed: end of block
while (__invbits < 64
__invbits < 64Description
TRUEnever evaluated
FALSEnever evaluated
); }
never executed: end of block
(_di) = __inv; } while (0); _q0 = (n0) * _di; if ((
(n1) >= (g0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
n1) >= (g0)
(n1) >= (g0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
) { uintmax_t _p1, _p0 __attribute__ ((__unused__)); __asm__ ("mulq %3" : "=a" (_p0), "=d" (_p1) : "%0" ((UDItype)(_q0)), "rm" ((UDItype)(g0))); (n1) = ((n1) - _p1) * _di; (n0) = _q0; }
executed 1 time by 1 test: end of block
Executed by:
  • factor
else { (n0) = _q0; (n1) = 0; }
executed 3 times by 1 test: end of block
Executed by:
  • factor
} while (0);
0-4
989-
990 if (!prime_p (g0)
!prime_p (g0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • factor
)
0-4
991 factor_using_pollard_rho (g0, a + 1, factors);
never executed: factor_using_pollard_rho (g0, a + 1, factors);
0
992 else-
993 factor_insert_multiplicity (factors, g0, 1);
executed 4 times by 1 test: factor_insert_multiplicity (factors, g0, 1);
Executed by:
  • factor
4
994 }-
995 else-
996 {-
997-
998-
999 uintmax_t ginv;-
1000-
1001 if (n1 == g1
n1 == g1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
&& n0 == g0
n0 == g0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
)
0-1
1002 {-
1003-
1004 factor_using_pollard_rho2 (n1, n0, a + 1, factors);-
1005 return;
executed 1 time by 1 test: return;
Executed by:
  • factor
1
1006 }-
1007-
1008 do { uintmax_t __n = (g0); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
64 > 8Description
TRUEnever evaluated
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
never executed: __inv = 2 * __inv - __inv * __inv * __n;
if (64 > 16
64 > 16Description
TRUEnever evaluated
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
never executed: __inv = 2 * __inv - __inv * __inv * __n;
if (64 > 32
64 > 32Description
TRUEnever evaluated
FALSEnever evaluated
) __inv = 2 * __inv - __inv * __inv * __n;
never executed: __inv = 2 * __inv - __inv * __inv * __n;
if (64 > 64
64 > 64Description
TRUEnever evaluated
FALSEnever evaluated
) { int __invbits = 64; do { __inv = 2 * __inv - __inv * __inv * __n; __invbits *= 2; }
never executed: end of block
while (__invbits < 64
__invbits < 64Description
TRUEnever evaluated
FALSEnever evaluated
); }
never executed: end of block
(ginv) = __inv; } while (0);
0
1009 n0 = ginv * n0;-
1010 n1 = 0;-
1011-
1012 if (!prime2_p (g1, g0)
!prime2_p (g1, g0)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1013 factor_using_pollard_rho2 (g1, g0, a + 1, factors);
never executed: factor_using_pollard_rho2 (g1, g0, a + 1, factors);
0
1014 else-
1015 factor_insert_large (factors, g1, g0);
never executed: factor_insert_large (factors, g1, g0);
0
1016 }-
1017-
1018 if (n1 == 0
n1 == 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
)
1-3
1019 {-
1020 if (prime_p (n0)
prime_p (n0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 2 times by 1 test
Evaluated by:
  • factor
)
1-2
1021 {-
1022 factor_insert_multiplicity (factors, n0, 1);-
1023 break;
executed 1 time by 1 test: break;
Executed by:
  • factor
1
1024 }-
1025-
1026 factor_using_pollard_rho (n0, a, factors);-
1027 return;
executed 2 times by 1 test: return;
Executed by:
  • factor
2
1028 }-
1029-
1030 if (prime2_p (n1, n0)
prime2_p (n1, n0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
)
0-1
1031 {-
1032 factor_insert_large (factors, n1, n0);-
1033 break;
never executed: break;
0
1034 }-
1035-
1036 x0 = mod2 (&x1, x1, x0, n1, n0);-
1037 z0 = mod2 (&z1, z1, z0, n1, n0);-
1038 y0 = mod2 (&y1, y1, y0, n1, n0);-
1039 }
executed 1 time by 1 test: end of block
Executed by:
  • factor
1
1040}
executed 1 time by 1 test: end of block
Executed by:
  • factor
1
1041static void-
1042factor (uintmax_t t1, uintmax_t t0, struct factors *factors)-
1043{-
1044 factors->nfactors = 0;-
1045 factors->plarge[1] = 0;-
1046-
1047 if (t1 == 0
t1 == 0Description
TRUEevaluated 500042 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
&& t0 < 2
t0 < 2Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 500040 times by 1 test
Evaluated by:
  • factor
)
2-500042
1048 return;
executed 2 times by 1 test: return;
Executed by:
  • factor
2
1049-
1050 t0 = factor_using_division (&t1, t1, t0, factors);-
1051-
1052 if (t1 == 0
t1 == 0Description
TRUEevaluated 500040 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
&& t0 < 2
t0 < 2Description
TRUEevaluated 13678 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 486362 times by 1 test
Evaluated by:
  • factor
)
3-500040
1053 return;
executed 13678 times by 1 test: return;
Executed by:
  • factor
13678
1054-
1055 if (prime2_p (t1, t0)
prime2_p (t1, t0)Description
TRUEevaluated 486338 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 27 times by 1 test
Evaluated by:
  • factor
)
27-486338
1056 factor_insert_large (factors, t1, t0);
executed 486338 times by 1 test: factor_insert_large (factors, t1, t0);
Executed by:
  • factor
486338
1057 else-
1058 {-
1059-
1060-
1061-
1062-
1063-
1064 if (t1 == 0
t1 == 0Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
)
3-24
1065 factor_using_pollard_rho (t0, 1, factors);
executed 24 times by 1 test: factor_using_pollard_rho (t0, 1, factors);
Executed by:
  • factor
24
1066 else-
1067 factor_using_pollard_rho2 (t1, t0, 1, factors);
executed 3 times by 1 test: factor_using_pollard_rho2 (t1, t0, 1, factors);
Executed by:
  • factor
3
1068 }-
1069}-
1070static strtol_error-
1071strto2uintmax (uintmax_t *hip, uintmax_t *lop, const char *s)-
1072{-
1073 unsigned int lo_carry;-
1074 uintmax_t hi = 0, lo = 0;-
1075-
1076 strtol_error err = LONGINT_INVALID;-
1077-
1078-
1079 for (;;)-
1080 {-
1081 char c = *s;-
1082 if (c == ' '
c == ' 'Description
TRUEnever evaluated
FALSEevaluated 500042 times by 1 test
Evaluated by:
  • factor
)
0-500042
1083 s++;
never executed: s++;
0
1084 else if (c == '+'
c == '+'Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 500041 times by 1 test
Evaluated by:
  • factor
)
1-500041
1085 {-
1086 s++;-
1087 break;
executed 1 time by 1 test: break;
Executed by:
  • factor
1
1088 }-
1089 else-
1090 break;
executed 500041 times by 1 test: break;
Executed by:
  • factor
500041
1091 }-
1092-
1093-
1094 const char *p = s;-
1095 for (;;)-
1096 {-
1097 unsigned int c = *p++;-
1098 if (c == 0
c == 0Description
TRUEevaluated 500041 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2944853 times by 1 test
Evaluated by:
  • factor
)
500041-2944853
1099 break;
executed 500041 times by 1 test: break;
Executed by:
  • factor
500041
1100-
1101 if (__builtin_expect ((!((unsigned int) (c) - '0' <= 9)), 0)
__builtin_expe...'0' <= 9)), 0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 2944852 times by 1 test
Evaluated by:
  • factor
)
1-2944852
1102 {-
1103 err = LONGINT_INVALID;-
1104 break;
executed 1 time by 1 test: break;
Executed by:
  • factor
1
1105 }-
1106-
1107 err = LONGINT_OK;-
1108 }
executed 2944852 times by 1 test: end of block
Executed by:
  • factor
2944852
1109-
1110 for (;err == LONGINT_OK
err == LONGINT_OKDescription
TRUEevaluated 3444893 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1 time by 1 test
Evaluated by:
  • factor
;)
1-3444893
1111 {-
1112 unsigned int c = *s++;-
1113 if (c == 0
c == 0Description
TRUEevaluated 500041 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 2944852 times by 1 test
Evaluated by:
  • factor
)
500041-2944852
1114 break;
executed 500041 times by 1 test: break;
Executed by:
  • factor
500041
1115-
1116 c -= '0';-
1117-
1118 if (__builtin_expect ((hi > ~(uintmax_t)0 / 10), 0)
__builtin_expe..._t)0 / 10), 0)Description
TRUEnever evaluated
FALSEevaluated 2944852 times by 1 test
Evaluated by:
  • factor
)
0-2944852
1119 {-
1120 err = LONGINT_OVERFLOW;-
1121 break;
never executed: break;
0
1122 }-
1123 hi = 10 * hi;-
1124-
1125 lo_carry = (lo >> (64 - 3)) + (lo >> (64 - 1));-
1126 lo_carry += 10 * lo < 2 * lo;-
1127-
1128 lo = 10 * lo;-
1129 lo += c;-
1130-
1131 lo_carry += lo < c;-
1132 hi += lo_carry;-
1133 if (__builtin_expect ((hi < lo_carry), 0)
__builtin_expe... lo_carry), 0)Description
TRUEnever evaluated
FALSEevaluated 2944852 times by 1 test
Evaluated by:
  • factor
)
0-2944852
1134 {-
1135 err = LONGINT_OVERFLOW;-
1136 break;
never executed: break;
0
1137 }-
1138 }
executed 2944852 times by 1 test: end of block
Executed by:
  • factor
2944852
1139-
1140 *hip = hi;-
1141 *lop = lo;-
1142-
1143 return
executed 500042 times by 1 test: return err;
Executed by:
  • factor
err;
executed 500042 times by 1 test: return err;
Executed by:
  • factor
500042
1144}-
1145-
1146-
1147-
1148static struct lbuf_-
1149{-
1150 char *buf;-
1151 char *end;-
1152} lbuf;-
1153static void-
1154lbuf_alloc (void)-
1155{-
1156 if (lbuf.buf
lbuf.bufDescription
TRUEnever evaluated
FALSEevaluated 56 times by 1 test
Evaluated by:
  • factor
)
0-56
1157 return;
never executed: return;
0
1158-
1159-
1160-
1161 lbuf.buf = xmalloc (512 * 2);-
1162 lbuf.end = lbuf.buf;-
1163}
executed 56 times by 1 test: end of block
Executed by:
  • factor
56
1164-
1165-
1166static void-
1167lbuf_flush (void)-
1168{-
1169 size_t size = lbuf.end - lbuf.buf;-
1170 if (full_write (
full_write ( 1... size) != sizeDescription
TRUEnever evaluated
FALSEevaluated 17390 times by 1 test
Evaluated by:
  • factor
0-17390
1171 1
full_write ( 1... size) != sizeDescription
TRUEnever evaluated
FALSEevaluated 17390 times by 1 test
Evaluated by:
  • factor
0-17390
1172 , lbuf.buf, size) != size
full_write ( 1... size) != sizeDescription
TRUEnever evaluated
FALSEevaluated 17390 times by 1 test
Evaluated by:
  • factor
)
0-17390
1173 ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
!!sizeof (struct { _Static_assert (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1174 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1175 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1176 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1177 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1178 (*__errno_location ())
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1179 , "%s",
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1180 dcgettext (((void *)0),
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1181 "write error"
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1182 , 5)
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1183 ), ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1184 0
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1185 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1186 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1187 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1188 (*__errno_location ())
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1189 , "%s",
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1190 dcgettext (((void *)0),
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1191 "write error"
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1192 , 5)
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1193 ), ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1194 0
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1195 ) ? (void) 0 : __builtin_unreachable ()))));
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), \"%s\", dcgettext (((void *)0), \"write error\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , "%s", dcgettext (((void *)0), "write error" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1196 lbuf.end = lbuf.buf;-
1197}
executed 17390 times by 1 test: end of block
Executed by:
  • factor
17390
1198-
1199-
1200-
1201-
1202static void-
1203lbuf_putc (char c)-
1204{-
1205 *lbuf.end++ = c;-
1206-
1207 if (c == '\n'
c == '\n'Description
TRUEevaluated 500041 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1840266 times by 1 test
Evaluated by:
  • factor
)
500041-1840266
1208 {-
1209 size_t buffered = lbuf.end - lbuf.buf;-
1210-
1211-
1212 static int line_buffered = -1;-
1213 if (line_buffered == -1
line_buffered == -1Description
TRUEevaluated 44 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 499997 times by 1 test
Evaluated by:
  • factor
)
44-499997
1214 line_buffered = isatty (
executed 44 times by 1 test: line_buffered = isatty ( 0 );
Executed by:
  • factor
44
1215 0
executed 44 times by 1 test: line_buffered = isatty ( 0 );
Executed by:
  • factor
44
1216 );
executed 44 times by 1 test: line_buffered = isatty ( 0 );
Executed by:
  • factor
44
1217 if (line_buffered
line_bufferedDescription
TRUEnever evaluated
FALSEevaluated 500041 times by 1 test
Evaluated by:
  • factor
)
0-500041
1218 lbuf_flush ();
never executed: lbuf_flush ();
0
1219 else if (buffered >= 512
buffered >= 512Description
TRUEevaluated 17334 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 482707 times by 1 test
Evaluated by:
  • factor
)
17334-482707
1220 {-
1221-
1222-
1223 char const *tend = lbuf.end;-
1224-
1225-
1226-
1227 char *tlend = lbuf.buf + 512;-
1228 while (*--
*--tlend != '\n'Description
TRUEevaluated 148903 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 17334 times by 1 test
Evaluated by:
  • factor
tlend != '\n'
*--tlend != '\n'Description
TRUEevaluated 148903 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 17334 times by 1 test
Evaluated by:
  • factor
);
executed 148903 times by 1 test: ;
Executed by:
  • factor
17334-148903
1229 tlend++;-
1230-
1231 lbuf.end = tlend;-
1232 lbuf_flush ();-
1233-
1234-
1235 memcpy (lbuf.buf, tlend, tend - tlend);-
1236 lbuf.end = lbuf.buf + (tend - tlend);-
1237 }
executed 17334 times by 1 test: end of block
Executed by:
  • factor
17334
1238 }
executed 500041 times by 1 test: end of block
Executed by:
  • factor
500041
1239}
executed 2340307 times by 1 test: end of block
Executed by:
  • factor
2340307
1240-
1241-
1242static void-
1243lbuf_putint (uintmax_t i, size_t min_width)-
1244{-
1245 char buf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)];-
1246 char const *umaxstr = umaxtostr (i, buf);-
1247 size_t width = sizeof (buf) - (umaxstr - buf) - 1;-
1248 size_t z = width;-
1249-
1250 for (; z < min_width
z < min_widthDescription
TRUEnever evaluated
FALSEevaluated 1840269 times by 1 test
Evaluated by:
  • factor
; z++)
0-1840269
1251 *
never executed: *lbuf.end++ = '0';
lbuf.end++ = '0';
never executed: *lbuf.end++ = '0';
0
1252-
1253 memcpy (lbuf.end, umaxstr, width);-
1254 lbuf.end += width;-
1255}
executed 1840269 times by 1 test: end of block
Executed by:
  • factor
1840269
1256-
1257static void-
1258print_uintmaxes (uintmax_t t1, uintmax_t t0)-
1259{-
1260 uintmax_t q, r;-
1261-
1262 if (t1 == 0
t1 == 0Description
TRUEevaluated 1840266 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
)
3-1840266
1263 lbuf_putint (t0, 0);
executed 1840266 times by 1 test: lbuf_putint (t0, 0);
Executed by:
  • factor
1840266
1264 else-
1265 {-
1266-
1267-
1268 q = t1 / 1000000000;-
1269 r = t1 % 1000000000;-
1270 do { uintmax_t __d1, __d0, __q, __r1, __r0; -
1271 ((-
1272 (r) < (1000000000)-
1273 ) ? (void) (0) : __assert_fail (-
1274 "(r) < (1000000000)"-
1275 , "src/factor.c", 2460, __PRETTY_FUNCTION__))-
1276 ; __d1 = (1000000000); __d0 = 0; __r1 = (r); __r0 = (t0); __q = 0; for (unsigned int __i = 64; __i > 0
__i > 0Description
TRUEevaluated 192 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
; __i--) { do { (__d0) = ((__d1) << (64 - (1))) | ((__d0) >> (1)); (__d1) = (__d1) >> (1); } while (0); __q <<= 1; if (((
(__r1) > (__d1)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 172 times by 1 test
Evaluated by:
  • factor
__r1) > (__d1)
(__r1) > (__d1)Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 172 times by 1 test
Evaluated by:
  • factor
|| ((
(__r1) == (__d1)Description
TRUEevaluated 105 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 67 times by 1 test
Evaluated by:
  • factor
__r1) == (__d1)
(__r1) == (__d1)Description
TRUEevaluated 105 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 67 times by 1 test
Evaluated by:
  • factor
&& (
(__r0) >= (__d0)Description
TRUEevaluated 67 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 38 times by 1 test
Evaluated by:
  • factor
__r0) >= (__d0)
(__r0) >= (__d0)Description
TRUEevaluated 67 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 38 times by 1 test
Evaluated by:
  • factor
))) { __q++; __asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (__r1), "=&r" (__r0) : "0" ((UDItype)(__r1)), "rme" ((UDItype)(__d1)), "1" ((UDItype)(__r0)), "rme" ((UDItype)(__d0))); }
executed 87 times by 1 test: end of block
Executed by:
  • factor
}
executed 192 times by 1 test: end of block
Executed by:
  • factor
(r) = __r0; (t0) = __q; } while (0);
3-192
1277 print_uintmaxes (q, t0);-
1278 lbuf_putint (r, 9);-
1279 }
executed 3 times by 1 test: end of block
Executed by:
  • factor
3
1280}-
1281-
1282-
1283static void-
1284print_factors_single (uintmax_t t1, uintmax_t t0)-
1285{-
1286 struct factors factors;-
1287-
1288 print_uintmaxes (t1, t0);-
1289 lbuf_putc (':');-
1290-
1291 factor (t1, t0, &factors);-
1292-
1293 for (unsigned int j = 0; j < factors.nfactors
j < factors.nfactorsDescription
TRUEevaluated 1203667 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 500041 times by 1 test
Evaluated by:
  • factor
; j++)
500041-1203667
1294 for (unsigned int k = 0; k < factors.e[j]
k < factors.e[j]Description
TRUEevaluated 1340225 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 1203667 times by 1 test
Evaluated by:
  • factor
; k++)
1203667-1340225
1295 {-
1296 lbuf_putc (' ');-
1297 print_uintmaxes (0, factors.p[j]);-
1298 }
executed 1340225 times by 1 test: end of block
Executed by:
  • factor
1340225
1299-
1300 if (factors.plarge[1]
factors.plarge[1]Description
TRUEnever evaluated
FALSEevaluated 500041 times by 1 test
Evaluated by:
  • factor
)
0-500041
1301 {-
1302 lbuf_putc (' ');-
1303 print_uintmaxes (factors.plarge[1], factors.plarge[0]);-
1304 }
never executed: end of block
0
1305-
1306 lbuf_putc ('\n');-
1307}
executed 500041 times by 1 test: end of block
Executed by:
  • factor
500041
1308-
1309-
1310-
1311-
1312-
1313-
1314static -
1315 _Bool-
1316-
1317print_factors (const char *input)-
1318{-
1319 uintmax_t t1, t0;-
1320-
1321-
1322-
1323-
1324-
1325 strtol_error err = strto2uintmax (&t1, &t0, input);-
1326-
1327 switch (err)-
1328 {-
1329 case
executed 500041 times by 1 test: case LONGINT_OK:
Executed by:
  • factor
LONGINT_OK:
executed 500041 times by 1 test: case LONGINT_OK:
Executed by:
  • factor
500041
1330 if (((
((t1 << 1) >> 1) == t1Description
TRUEevaluated 500041 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
t1 << 1) >> 1) == t1
((t1 << 1) >> 1) == t1Description
TRUEevaluated 500041 times by 1 test
Evaluated by:
  • factor
FALSEnever evaluated
)
0-500041
1331 {-
1332 do { if (dev_debug
dev_debugDescription
TRUEnever evaluated
FALSEevaluated 500041 times by 1 test
Evaluated by:
  • factor
) fprintf (
never executed: fprintf ( stderr , "[using single-precision arithmetic] ");
0-500041
1333 stderr
never executed: fprintf ( stderr , "[using single-precision arithmetic] ");
0
1334 , "[using single-precision arithmetic] ");
never executed: fprintf ( stderr , "[using single-precision arithmetic] ");
} while (0);
0
1335 print_factors_single (t1, t0);-
1336 return
executed 500041 times by 1 test: return 1 ;
Executed by:
  • factor
executed 500041 times by 1 test: return 1 ;
Executed by:
  • factor
500041
1337 1
executed 500041 times by 1 test: return 1 ;
Executed by:
  • factor
500041
1338 ;
executed 500041 times by 1 test: return 1 ;
Executed by:
  • factor
500041
1339 }-
1340 break;
never executed: break;
0
1341-
1342 case
never executed: case LONGINT_OVERFLOW:
LONGINT_OVERFLOW:
never executed: case LONGINT_OVERFLOW:
0
1343-
1344 break;
never executed: break;
0
1345-
1346 default
executed 1 time by 1 test: default:
Executed by:
  • factor
:
executed 1 time by 1 test: default:
Executed by:
  • factor
1
1347 error (0, 0, -
1348 dcgettext (((void *)0), -
1349 "%s is not a valid positive integer"-
1350 , 5)-
1351 , quote (input));-
1352 return
executed 1 time by 1 test: return 0 ;
Executed by:
  • factor
executed 1 time by 1 test: return 0 ;
Executed by:
  • factor
1
1353 0
executed 1 time by 1 test: return 0 ;
Executed by:
  • factor
1
1354 ;
executed 1 time by 1 test: return 0 ;
Executed by:
  • factor
1
1355 }-
1356 error (0, 0, -
1357 dcgettext (((void *)0), -
1358 "%s is too large"-
1359 , 5)-
1360 , quote (input));-
1361 return
never executed: return 0 ;
never executed: return 0 ;
0
1362 0
never executed: return 0 ;
0
1363 ;
never executed: return 0 ;
0
1364-
1365}-
1366-
1367void-
1368usage (int status)-
1369{-
1370 if (status !=
status != 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
3-4
1371 0
status != 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 3 times by 1 test
Evaluated by:
  • factor
3-4
1372 )-
1373 do { fprintf (-
1374 stderr-
1375 , -
1376 dcgettext (((void *)0), -
1377 "Try '%s --help' for more information.\n"-
1378 , 5)-
1379 , program_name); }
executed 4 times by 1 test: end of block
Executed by:
  • factor
while (0);
4
1380 else-
1381 {-
1382 printf (-
1383 dcgettext (((void *)0), -
1384 "Usage: %s [NUMBER]...\n or: %s OPTION\n"-
1385 , 5)-
1386-
1387-
1388 -
1389 ,-
1390 program_name, program_name);-
1391 fputs_unlocked (-
1392 dcgettext (((void *)0), -
1393 "Print the prime factors of each specified integer NUMBER. If none\nare specified on the command line, read them from standard input.\n\n"-
1394 , 5)-
1395 ,-
1396 stdout-
1397 )-
1398-
1399-
1400-
1401 ;-
1402 fputs_unlocked (-
1403 dcgettext (((void *)0), -
1404 " --help display this help and exit\n"-
1405 , 5)-
1406 ,-
1407 stdout-
1408 );-
1409 fputs_unlocked (-
1410 dcgettext (((void *)0), -
1411 " --version output version information and exit\n"-
1412 , 5)-
1413 ,-
1414 stdout-
1415 );-
1416 emit_ancillary_info ("factor");-
1417 }
executed 3 times by 1 test: end of block
Executed by:
  • factor
3
1418 exit (status);
executed 7 times by 1 test: exit (status);
Executed by:
  • factor
7
1419}-
1420-
1421static -
1422 _Bool-
1423-
1424do_stdin (void)-
1425{-
1426 -
1427 _Bool -
1428 ok = -
1429 1-
1430 ;-
1431 token_buffer tokenbuffer;-
1432-
1433 init_tokenbuffer (&tokenbuffer);-
1434-
1435 while (-
1436 1-
1437 )-
1438 {-
1439 size_t token_length = readtoken (-
1440 stdin-
1441 , "\n\t ", sizeof ("\n\t ") - 1,-
1442 &tokenbuffer);-
1443 if (token_length == (size_t) -1
token_length == (size_t) -1Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 500002 times by 1 test
Evaluated by:
  • factor
)
5-500002
1444 break;
executed 5 times by 1 test: break;
Executed by:
  • factor
5
1445 ok &= print_factors (tokenbuffer.buffer);-
1446 }
executed 500002 times by 1 test: end of block
Executed by:
  • factor
500002
1447 free (tokenbuffer.buffer);-
1448-
1449 return
executed 5 times by 1 test: return ok;
Executed by:
  • factor
ok;
executed 5 times by 1 test: return ok;
Executed by:
  • factor
5
1450}-
1451-
1452int-
1453main (int argc, char **argv)-
1454{-
1455 ;-
1456 set_program_name (argv[0]);-
1457 setlocale (-
1458 6-
1459 , "");-
1460 bindtextdomain ("coreutils", "/usr/local/share/locale");-
1461 textdomain ("coreutils");-
1462-
1463 lbuf_alloc ();-
1464 atexit (close_stdout);-
1465 atexit (lbuf_flush);-
1466-
1467 int c;-
1468 while ((
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 44 times by 1 test
Evaluated by:
  • factor
c = getopt_long (argc, argv, "", long_options,
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 44 times by 1 test
Evaluated by:
  • factor
12-44
1469 ((void *)0)
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 44 times by 1 test
Evaluated by:
  • factor
12-44
1470 )) != -1
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 44 times by 1 test
Evaluated by:
  • factor
)
12-44
1471 {-
1472 switch (c)-
1473 {-
1474 case
never executed: case DEV_DEBUG_OPTION:
DEV_DEBUG_OPTION:
never executed: case DEV_DEBUG_OPTION:
0
1475 dev_debug = -
1476 1-
1477 ;-
1478 break;
never executed: break;
0
1479-
1480 case
executed 3 times by 1 test: case GETOPT_HELP_CHAR:
Executed by:
  • factor
GETOPT_HELP_CHAR:
executed 3 times by 1 test: case GETOPT_HELP_CHAR:
Executed by:
  • factor
usage (
3
1481 0-
1482 ); break;
never executed: break;
;
0
1483-
1484 case
executed 5 times by 1 test: case GETOPT_VERSION_CHAR:
Executed by:
  • factor
GETOPT_VERSION_CHAR:
executed 5 times by 1 test: case GETOPT_VERSION_CHAR:
Executed by:
  • factor
version_etc (
5
1485 stdout-
1486 , "factor", "GNU coreutils", Version, ("Paul Rubin"), proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), proper_name_utf8 ("Niels Moller", "Niels M\303\266ller"), (char *) -
1487 ((void *)0)-
1488 ); exit (
executed 5 times by 1 test: exit ( 0 );
Executed by:
  • factor
5
1489 0
executed 5 times by 1 test: exit ( 0 );
Executed by:
  • factor
5
1490 );
executed 5 times by 1 test: exit ( 0 );
Executed by:
  • factor
break;
never executed: break;
;
0-5
1491-
1492 default
executed 4 times by 1 test: default:
Executed by:
  • factor
:
executed 4 times by 1 test: default:
Executed by:
  • factor
4
1493 usage (-
1494 1-
1495 );-
1496 }
never executed: end of block
0
1497 }-
1498-
1499-
1500-
1501-
1502-
1503 -
1504 _Bool -
1505 ok;-
1506 if (argc <= optind
argc <= optindDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 39 times by 1 test
Evaluated by:
  • factor
)
5-39
1507 ok = do_stdin ();
executed 5 times by 1 test: ok = do_stdin ();
Executed by:
  • factor
5
1508 else-
1509 {-
1510 ok = -
1511 1-
1512 ;-
1513 for (int i = optind; i < argc
i < argcDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • factor
FALSEevaluated 39 times by 1 test
Evaluated by:
  • factor
; i++)
39-40
1514 if (! print_factors (argv[i])
! print_factors (argv[i])Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • factor
FALSEevaluated 39 times by 1 test
Evaluated by:
  • factor
)
1-39
1515 ok =
executed 1 time by 1 test: ok = 0 ;
Executed by:
  • factor
1
1516 0
executed 1 time by 1 test: ok = 0 ;
Executed by:
  • factor
1
1517 ;
executed 1 time by 1 test: ok = 0 ;
Executed by:
  • factor
1
1518 }
executed 39 times by 1 test: end of block
Executed by:
  • factor
39
1519 return
executed 44 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • factor
ok ?
executed 44 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • factor
44
1520 0
executed 44 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • factor
44
1521 :
executed 44 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • factor
44
1522 1
executed 44 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • factor
44
1523 ;
executed 44 times by 1 test: return ok ? 0 : 1 ;
Executed by:
  • factor
44
1524}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2