| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/factor.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | typedef unsigned char UQItype; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | typedef long SItype; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | typedef unsigned long int USItype; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | typedef long long int DItype; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | typedef unsigned long long int UDItype; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | enum | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | DEV_DEBUG_OPTION = 0x7f + 1 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | static 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | struct factors | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | uintmax_t plarge[2]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | uintmax_t p[26]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | unsigned char e[26]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | unsigned char nfactors; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | static void factor (uintmax_t, uintmax_t, struct factors *); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | static uintmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | mod2 (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
| 0-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | *r1 = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | return never executed: a0;return 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
| 3-35 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | if (((
| 0-21 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | __asm__ executed 14 times by 1 test: ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (a1), "=&r" (a0) : "0" ((UDItype)(a1)), "rme" ((UDItype)(d1)), "1" ((UDItype)(a0)), "rme" ((UDItype)(d0)));__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:
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:
| 14 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | do { (d0) = ((d1) << (64 - (1))) | ((d0) >> (1)); (d1) = (d1) >> (1); } while (0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | } executed 35 times by 1 test: end of blockExecuted by:
| 35 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | *r1 = a1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | return executed 3 times by 1 test: a0;return a0;Executed by:
executed 3 times by 1 test: return a0;Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | static uintmax_t __attribute__ ((__const__)) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | gcd_odd (uintmax_t a, uintmax_t b) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | if ( (
| 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
| 2-2443 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | return executed 2 times by 1 test: b;return b;Executed by:
executed 2 times by 1 test: return b;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | b >>= 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | for (;;) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | uintmax_t t; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | uintmax_t bgta; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | while ((
| 90823-95477 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | a >>= 1; executed 90823 times by 1 test: a >>= 1;Executed by:
| 90823 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | a >>= 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | t = a - b; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | if (t == 0
| 2443-93034 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | return executed 2443 times by 1 test: (a << 1) + 1;return (a << 1) + 1;Executed by:
executed 2443 times by 1 test: return (a << 1) + 1;Executed by:
| 2443 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | bgta = (((
| 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 blockExecuted by:
| 93034 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | static uintmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | gcd2_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 ( (
| 4-1747 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | *r1 = b1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | return executed 4 times by 1 test: b0;return b0;Executed by:
executed 4 times by 1 test: return b0;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | while ((
| 1730-1747 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | do { (a0) = ((a1) << (64 - (1))) | ((a0) >> (1)); (a1) = (a1) >> (1); } executed 1730 times by 1 test: while (0);end of blockExecuted by:
| 1730 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | for (;;) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | if ((
| 1747-2486 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | *r1 = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | return executed 1747 times by 1 test: gcd_odd (b0, a0);return gcd_odd (b0, a0);Executed by:
executed 1747 times by 1 test: return gcd_odd (b0, a0);Executed by:
| 1747 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | if (((
| 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: while (0);end of blockExecuted by:
| 1126 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | while ((
| 544-582 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | } executed 582 times by 1 test: end of blockExecuted by:
| 582 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | else if (((
| 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: while (0);end of blockExecuted by:
| 3830 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | while ((
| 1904-1926 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | } executed 1904 times by 1 test: end of blockExecuted by:
| 1904 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | *r1 = a1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | return never executed: a0;return a0;never executed: return a0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | factor_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
| 500053-840182 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | if (p[i] <= prime
| 13-840169 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | break; executed 840169 times by 1 test: break;Executed by:
| 840169 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | } executed 13 times by 1 test: end of blockExecuted by:
| 13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | if (i < 0
| 136534-840169 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | for (int j = nfactors - 1; j > i
| 13-1203688 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | p[j + 1] = p[j]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | e[j + 1] = e[j]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | } executed 13 times by 1 test: end of blockExecuted by:
| 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 blockExecuted by:
| 1203688 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | e[i] += m; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } executed 136534 times by 1 test: end of blockExecuted by:
| 136534 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | factor_insert_large (struct factors *factors, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | uintmax_t p1, uintmax_t p0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | if (p1 > 0
| 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:
| 486338 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | enum { W = sizeof (uintmax_t) * 8 }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | _Static_assert ( | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | (18446744073709551615UL) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | >> (W - 1) == 1, "verify (" "UINTMAX_MAX >> (W - 1) == 1" ")"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | static const unsigned char primes_diff[] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0,0,0,0,0,0,0 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | static const unsigned char primes_diff8[] = { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 0,0,0,0,0,0,0 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | struct primes_dtab | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | uintmax_t binv, lim; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | static 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | static | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | _Bool | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | dev_debug = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | static | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | _Bool | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | flag_prove_primality = 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | factor_insert_refind (struct factors *factors, uintmax_t p, unsigned int i, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | unsigned int off) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | for (unsigned int j = 0; j < off
| 853812-1782039 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | p += primes_diff[i + j]; executed 1782039 times by 1 test: p += primes_diff[i + j];Executed by:
| 1782039 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | factor_insert_multiplicity (factors, p, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | } executed 853812 times by 1 test: end of blockExecuted by:
| 853812 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | static uintmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | factor_using_division (uintmax_t *t1p, uintmax_t t1, uintmax_t t0, | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | struct factors *factors) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | if (t0 % 2 == 0
| 12-500031 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | unsigned int cnt; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | if (t0 == 0
| 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 blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | factor_insert_multiplicity (factors, 2, cnt); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | uintmax_t p = 3; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | unsigned int i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | for (i = 0; t1 > 0
| 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
| 693-1313 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | break; executed 1313 times by 1 test: break;Executed by:
| 1313 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | hi = t1 - hi; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | q1 = hi * primes_dtab[i].binv; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | if (__builtin_expect ((q1 > primes_dtab[i].lim), 1)
| 2-691 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | break; executed 691 times by 1 test: break;Executed by:
| 691 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | t1 = q1; t0 = q0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | factor_insert_multiplicity (factors, p, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | p += primes_diff[i + 1]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | } executed 2004 times by 1 test: end of blockExecuted by:
| 2004 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | if (t1p
| 0-500043 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | * executed 500043 times by 1 test: t1p = t1;*t1p = t1;Executed by:
executed 500043 times by 1 test: *t1p = t1;Executed by:
| 500043 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | for (; i < (sizeof (primes_diff) / sizeof (primes_diff[0]) - 8 + 1)
| 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)
executed 3048788 times by 1 test: t0 = q; factor_insert_refind (factors, p, i + 1, 0); }break;Executed by:
executed 285614 times by 1 test: } while (0);end of blockExecuted by:
| 285614-3048788 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | do { for (;;) { q = t0 * pd[1].binv; if (__builtin_expect ((q > pd[1].lim), 1)
executed 3048788 times by 1 test: t0 = q; factor_insert_refind (factors, p, i + 1, 1); }break;Executed by:
executed 158282 times by 1 test: } while (0);end of blockExecuted by:
| 158282-3048788 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | do { for (;;) { q = t0 * pd[2].binv; if (__builtin_expect ((q > pd[2].lim), 1)
executed 3048788 times by 1 test: t0 = q; factor_insert_refind (factors, p, i + 1, 2); }break;Executed by:
executed 113202 times by 1 test: } while (0);end of blockExecuted by:
| 113202-3048788 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | do { for (;;) { q = t0 * pd[3].binv; if (__builtin_expect ((q > pd[3].lim), 1)
executed 3048788 times by 1 test: t0 = q; factor_insert_refind (factors, p, i + 1, 3); }break;Executed by:
executed 78057 times by 1 test: } while (0);end of blockExecuted by:
| 78057-3048788 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | do { for (;;) { q = t0 * pd[4].binv; if (__builtin_expect ((q > pd[4].lim), 1)
executed 3048788 times by 1 test: t0 = q; factor_insert_refind (factors, p, i + 1, 4); }break;Executed by:
executed 68318 times by 1 test: } while (0);end of blockExecuted by:
| 68318-3048788 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | do { for (;;) { q = t0 * pd[5].binv; if (__builtin_expect ((q > pd[5].lim), 1)
executed 3048788 times by 1 test: t0 = q; factor_insert_refind (factors, p, i + 1, 5); }break;Executed by:
executed 55954 times by 1 test: } while (0);end of blockExecuted by:
| 55954-3048788 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | do { for (;;) { q = t0 * pd[6].binv; if (__builtin_expect ((q > pd[6].lim), 1)
executed 3048788 times by 1 test: t0 = q; factor_insert_refind (factors, p, i + 1, 6); }break;Executed by:
executed 50555 times by 1 test: } while (0);end of blockExecuted by:
| 50555-3048788 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | do { for (;;) { q = t0 * pd[7].binv; if (__builtin_expect ((q > pd[7].lim), 1)
executed 3048788 times by 1 test: t0 = q; factor_insert_refind (factors, p, i + 1, 7); }break;Executed by:
executed 43830 times by 1 test: } while (0);end of blockExecuted by:
| 43830-3048788 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | p += primes_diff8[i]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | if (p * p > t0
| 500014-2548774 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | break; executed 500014 times by 1 test: break;Executed by:
| 500014 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | } executed 2548774 times by 1 test: end of blockExecuted by:
| 2548774 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | return executed 500043 times by 1 test: t0;return t0;Executed by:
executed 500043 times by 1 test: return t0;Executed by:
| 500043 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | static 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 | }; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | static inline uintmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | mulredc (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
| 29-24969 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | xh += m; executed 24969 times by 1 test: xh += m;Executed by:
| 24969 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | return executed 24998 times by 1 test: xh;return xh;Executed by:
executed 24998 times by 1 test: return xh;Executed by:
| 24998 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | static uintmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | mulredc2 (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 (((
| 0-177451 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | __asm__ executed 2 times by 1 test: ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (r1), "=&r" (r0) : "0" ((UDItype)(r1)), "rme" ((UDItype)(m1)), "1" ((UDItype)(r0)), "rme" ((UDItype)(m0)));__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:
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:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | *r1p = r1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | return executed 177451 times by 1 test: r0;return r0;Executed by:
executed 177451 times by 1 test: return r0;Executed by:
| 177451 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | static uintmax_t __attribute__ ((__const__)) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | powm (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
| 51-59 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | y = b; executed 59 times by 1 test: y = b;Executed by:
| 59 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | while (e != 0
| 110-3116 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | b = mulredc (b, b, n, ni); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | e >>= 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | if (e & 1
| 1161-1955 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | y = mulredc (y, b, n, ni); executed 1955 times by 1 test: y = mulredc (y, b, n, ni);Executed by:
| 1955 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | } executed 3116 times by 1 test: end of blockExecuted by:
| 3116 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | return executed 110 times by 1 test: y;return y;Executed by:
executed 110 times by 1 test: return y;Executed by:
| 110 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | static uintmax_t | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | powm2 (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
| 4-256 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | if (e & 1
| 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 blockExecuted by:
| 117 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | b0 = mulredc2 (r1m, b1, b0, b1, b0, n1, n0, ni); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | b1 = *r1m; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | } executed 256 times by 1 test: end of blockExecuted by:
| 256 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | for (e = ep[1]; e > 0
| 4-19 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | if (e & 1
| 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 blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | b0 = mulredc2 (r1m, b1, b0, b1, b0, n1, n0, ni); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | b1 = *r1m; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | } executed 19 times by 1 test: end of blockExecuted by:
| 19 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | *r1m = r1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | return executed 4 times by 1 test: r0;return r0;Executed by:
executed 4 times by 1 test: return r0;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | static | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | _Bool | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | __attribute__ ((__const__)) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | millerrabin (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
| 3-51 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | return executed 11 times by 1 test: return 1 ;Executed by:
executed 11 times by 1 test: return 1 ;Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | 1 executed 11 times by 1 test: return 1 ;Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | ; executed 11 times by 1 test: return 1 ;Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | for (unsigned int i = 1; i < k
| 26-49 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | y = mulredc (y, y, n, ni); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | if (y == nm1
| 16-33 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | return executed 16 times by 1 test: return 1 ;Executed by:
executed 16 times by 1 test: return 1 ;Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | 1 executed 16 times by 1 test: return 1 ;Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | ; executed 16 times by 1 test: return 1 ;Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | if (y == one
| 1-32 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | return executed 1 time by 1 test: return 0 ;Executed by:
executed 1 time by 1 test: return 0 ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | 0 executed 1 time by 1 test: return 0 ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | ; executed 1 time by 1 test: return 0 ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | } executed 32 times by 1 test: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | return executed 26 times by 1 test: return 0 ;Executed by:
executed 26 times by 1 test: return 0 ;Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 0 executed 26 times by 1 test: return 0 ;Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | ; executed 26 times by 1 test: return 0 ;Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | static | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | _Bool | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | millerrabin2 (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]
| 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
| 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
| 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
| 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]
| 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 blockExecuted by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | return executed 4 times by 1 test: return 0 ;Executed by:
executed 4 times by 1 test: return 0 ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | 0 executed 4 times by 1 test: return 0 ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | ; executed 4 times by 1 test: return 0 ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | static | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | _Bool | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | prime_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
| 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
| 31-486392 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | return executed 486392 times by 1 test: return 1 ;Executed by:
executed 486392 times by 1 test: return 1 ;Executed by:
| 486392 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | 1 executed 486392 times by 1 test: return 1 ;Executed by:
| 486392 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | ; executed 486392 times by 1 test: return 1 ;Executed by:
| 486392 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | uintmax_t q = n - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | for (k = 0; (
| 31-61 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | q >>= 1; executed 61 times by 1 test: q >>= 1;Executed by:
| 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
executed 31 times by 1 test: if (64 > 16__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 31 times by 1 test: if (64 > 32__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 31 times by 1 test: if (64 > 64__inv = 2 * __inv - __inv * __inv * __n;Executed by:
never executed: while (__invbits < 64end of block
never executed: (ni) = __inv; } while (0);end of block | 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
executed 271 times by 1 test: }end of blockExecuted by:
executed 1984 times by 1 test: (one) = __r0; (_redcify_q) = __q; } while (0); } while (0);end of blockExecuted by:
| 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)
| 4-27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | return executed 27 times by 1 test: return 0 ;Executed by:
executed 27 times by 1 test: return 0 ;Executed by:
| 27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | 0 executed 27 times by 1 test: return 0 ;Executed by:
| 27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | ; executed 27 times by 1 test: return 0 ;Executed by:
| 27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | if (flag_prove_primality
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | factor (0, n - 1, &factors); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | for (unsigned int r = 0; r < (sizeof (primes_diff) / sizeof (primes_diff[0]) - 8 + 1)
| 0-27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | if (flag_prove_primality
| 0-27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | is_prime = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | 1 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | for (unsigned int i = 0; i < factors.nfactors
| 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 blockExecuted by:
| 56 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | } executed 27 times by 1 test: end of blockExecuted by:
| 27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | is_prime = (r == 25 - 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | if (is_prime
| 4-23 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | return executed 4 times by 1 test: return 1 ;Executed by:
executed 4 times by 1 test: return 1 ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | 1 executed 4 times by 1 test: return 1 ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | ; executed 4 times by 1 test: return 1 ;Executed by:
| 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)
| 0-23 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | a_prim = s0 % n; executed 23 times by 1 test: a_prim = s0 % n;Executed by:
| 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
never executed: }end of blocknever executed: (a_prim) = __r0; (dummy) = __q; } while (0);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 691 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 692 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 693 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 694 | if (!millerrabin (n, ni, a_prim, q, k, one)
| 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 blockExecuted by:
| 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 708 | static | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 709 | _Bool | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 711 | prime2_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
| 4-486362 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 722 | return executed 486362 times by 1 test: prime_p (n0);return prime_p (n0);Executed by:
executed 486362 times by 1 test: return prime_p (n0);Executed by:
| 486362 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 723 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 724 | nm1[1] = n1 - (n0 == 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 725 | nm1[0] = n0 - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 726 | if (nm1[0] == 0
| 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 blockExecuted by:
| 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
executed 4 times by 1 test: if (64 > 16__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 4 times by 1 test: if (64 > 32__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 4 times by 1 test: if (64 > 64__inv = 2 * __inv - __inv * __inv * __n;Executed by:
never executed: while (__invbits < 64end of block
never executed: (ni) = __inv; } while (0);end of block | 0-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 742 | do { uintmax_t _r1, _r0, _i; if ((
executed 3 times by 1 test: else { _r1 = 0; _r0 = (1); _i = 2*64; }end of blockExecuted by:
executed 1 time by 1 test: while (_i-- > 0end of blockExecuted by:
executed 134 times by 1 test: ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));__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:
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:
executed 320 times by 1 test: (one[1]) = _r1; (one[0]) = _r0; } while (0);end of blockExecuted by:
| 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 ((((
executed 2 times by 1 test: ("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))));__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:
executed 2 times by 1 test: } while (0);__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:
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 744 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 745 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 746 | na[0] = n0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 747 | na[1] = n1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 748 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 749 | if (!millerrabin2 (na, ni, a_prim, q, k, one)
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 750 | return executed 4 times by 1 test: return 0 ;Executed by:
executed 4 times by 1 test: return 0 ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 751 | 0 executed 4 times by 1 test: return 0 ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 752 | ; executed 4 times by 1 test: return 0 ;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 753 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 754 | if (flag_prove_primality
| 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)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | _Bool | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | is_prime; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | uintmax_t e[2], y[2]; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | if (flag_prove_primality
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | is_prime = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | 1 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | if (factors.plarge[1]
| 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
never executed: if (64 > 16__inv = 2 * __inv - __inv * __inv * __n;
never executed: if (64 > 32__inv = 2 * __inv - __inv * __inv * __n;
never executed: if (64 > 64__inv = 2 * __inv - __inv * __inv * __n;
never executed: while (__invbits < 64end of block
never executed: (pi) = __inv; } while (0);end of block | 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]
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | for (unsigned int i = 0; i < factors.nfactors
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | if (factors.p[i] == 2
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | do { (e[0]) = ((nm1[1]) << (64 - (1))) | ((nm1[0]) >> (1)); (e[1]) = (nm1[1]) >> (1); } never executed: while (0);end of block | 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
never executed: if (64 > 16__inv = 2 * __inv - __inv * __inv * __n;
never executed: if (64 > 32__inv = 2 * __inv - __inv * __inv * __n;
never executed: if (64 > 64__inv = 2 * __inv - __inv * __inv * __n;
never executed: while (__invbits < 64end of block
never executed: (_di) = __inv; } while (0); _q0 = (nm1[0]) * _di; if ((end of block
never executed: else { (e[0]) = _q0; (e[1]) = 0; }end of blocknever executed: }end of blocknever executed: while (0);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | y[0] = powm2 (&y[1], a_prim, e, na, ni, one); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | is_prime = (y[0] != one[0]
| 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
| 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 ((
never executed: else { _r1 = 0; _r0 = (a); _i = 2*64; }end of blocknever executed: while (_i-- > 0end of block
never executed: ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));__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: }__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: (a_prim[1]) = _r1; (a_prim[0]) = _r0; } while (0);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | if (!millerrabin2 (na, ni, a_prim, q, k, one)
| 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 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | factor_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
executed 221 times by 1 test: }end of blockExecuted by:
executed 1664 times by 1 test: (P) = __r0; (_redcify_q) = __q; } while (0); } while (0);end of blockExecuted by:
| 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
| 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
executed 27 times by 1 test: if (64 > 16__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 27 times by 1 test: if (64 > 32__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 27 times by 1 test: if (64 > 64__inv = 2 * __inv - __inv * __inv * __n;Executed by:
never executed: while (__invbits < 64end of block
never executed: (ni) = __inv; } while (0);end of block | 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
| 316-5605 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | if (gcd_odd (P, n) != 1
| 27-289 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | goto executed 27 times by 1 test: factor_found;goto factor_found;Executed by:
executed 27 times by 1 test: goto factor_found;Executed by:
| 27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | y = x; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | } executed 289 times by 1 test: end of blockExecuted by:
| 289 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | } executed 5894 times by 1 test: end of blockExecuted by:
| 5894 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | while (--
| 197-5697 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | z = x; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | k = l; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | l = 2 * l; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | for (unsigned long int i = 0; i < k
| 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 blockExecuted by:
| 7654 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 881 | y = x; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 882 | } executed 197 times by 1 test: end of blockExecuted by:
| 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 blockExecuted by:
| 382 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 893 | while (g == 1
| 27-355 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 894 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 895 | if (n == g
| 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)
| 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:
| 27 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 908 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 909 | if (prime_p (n)
| 1-26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 910 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 911 | factor_insert_multiplicity (factors, n, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 912 | break; executed 26 times by 1 test: break;Executed by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 913 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 914 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 915 | x = x % n; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 916 | z = z % n; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 917 | y = y % n; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 918 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 919 | } executed 26 times by 1 test: end of blockExecuted by:
| 26 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 920 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 921 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 922 | factor_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 ((
executed 3 times by 1 test: else { _r1 = 0; _r0 = (1); _i = 2*64; }end of blockExecuted by:
executed 1 time by 1 test: while (_i-- > 0end of blockExecuted by:
executed 134 times by 1 test: ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" (_r1), "=&r" (_r0) : "0" ((UDItype)(_r1)), "rme" ((UDItype)((n1))), "1" ((UDItype)(_r0)), "rme" ((UDItype)((n0))));__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:
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:
executed 320 times by 1 test: (P1) = _r1; (P0) = _r0; } while (0);end of blockExecuted by:
| 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 ((((
executed 2 times by 1 test: ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));__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:
executed 2 times by 1 test: } while (0);__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:
| 0-2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 932 | y1 = z1 = x1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 933 | y0 = z0 = x0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 934 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 935 | while (n1 != 0
| 0-5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 936 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 937 | do { uintmax_t __n = (n0); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
executed 5 times by 1 test: if (64 > 16__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 5 times by 1 test: if (64 > 32__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 5 times by 1 test: if (64 > 64__inv = 2 * __inv - __inv * __inv * __n;Executed by:
never executed: while (__invbits < 64end of block
never executed: (ni) = __inv; } while (0);end of block | 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 ((((
never executed: ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));__asm__ ("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: } while (0);__asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0)))); | 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 ((
executed 31697 times by 1 test: ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((t1))), "rme" ((UDItype)((n1))), "%1" ((UDItype)((t0))), "rme" ((UDItype)((n0))));__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:
executed 31697 times by 1 test: } while (0);__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:
| 22896-31697 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 948 | P0 = mulredc2 (&r1m, P1, P0, t1, t0, n1, n0, ni); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 949 | P1 = r1m; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 950 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 951 | if (k % 32 == 1
| 1727-52866 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 952 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 953 | g0 = gcd2_odd (&g1, P1, P0, n1, n0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 954 | if (g1 != 0
| 2-1724 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 955 | goto executed 5 times by 1 test: factor_found;goto factor_found;Executed by:
executed 5 times by 1 test: goto factor_found;Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 956 | y1 = x1; y0 = x0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 957 | } executed 1722 times by 1 test: end of blockExecuted by:
| 1722 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 958 | } executed 54588 times by 1 test: end of blockExecuted by:
| 54588 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 959 | while (--
| 49-54539 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 960 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 961 | z1 = x1; z0 = x0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 962 | k = l; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 963 | l = 2 * l; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 964 | for (unsigned long int i = 0; i < k
| 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 ((((
never executed: ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0))));__asm__ ("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: } while (0);__asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((x1)), "=&r" ((x0)) : "0" ((UDItype)((x1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((x0))), "rme" ((UDItype)((n0)))); | 0-67836 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 969 | } executed 67836 times by 1 test: end of blockExecuted by:
| 67836 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 970 | y1 = x1; y0 = x0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 971 | } executed 49 times by 1 test: end of blockExecuted by:
| 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 ((((
never executed: ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((y1)), "=&r" ((y0)) : "0" ((UDItype)((y1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((y0))), "rme" ((UDItype)((n0))));__asm__ ("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: } while (0);__asm__ ("subq %5,%q1\n\tsbbq %3,%q0" : "=r" ((y1)), "=&r" ((y0)) : "0" ((UDItype)((y1))), "rme" ((UDItype)((n1))), "1" ((UDItype)((y0))), "rme" ((UDItype)((n0)))); | 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 ((
executed 19 times by 1 test: ("addq %5,%q1\n\tadcq %3,%q0" : "=r" ((t1)), "=&r" ((t0)) : "0" ((UDItype)((t1))), "rme" ((UDItype)((n1))), "%1" ((UDItype)((t0))), "rme" ((UDItype)((n0))));__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:
executed 19 times by 1 test: } while (0);__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:
| 5-19 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 981 | g0 = gcd2_odd (&g1, t1, t0, n1, n0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 982 | } executed 24 times by 1 test: end of blockExecuted by:
| 24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 983 | while (g1 == 0
| 1-23 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 984 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 985 | if (g1 == 0
| 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
executed 4 times by 1 test: if (64 > 16__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 4 times by 1 test: if (64 > 32__inv = 2 * __inv - __inv * __inv * __n;Executed by:
executed 4 times by 1 test: if (64 > 64__inv = 2 * __inv - __inv * __inv * __n;Executed by:
never executed: while (__invbits < 64end of block
never executed: (_di) = __inv; } while (0); _q0 = (n0) * _di; if ((end of block
executed 1 time by 1 test: else { (n0) = _q0; (n1) = 0; }end of blockExecuted by:
executed 3 times by 1 test: } while (0);end of blockExecuted by:
| 0-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 989 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 990 | if (!prime_p (g0)
| 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:
| 4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 994 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 995 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 996 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 997 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 998 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 999 | uintmax_t ginv; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1000 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1001 | if (n1 == g1
| 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:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1006 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1007 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1008 | do { uintmax_t __n = (g0); uintmax_t __inv; __inv = binvert_table[(__n / 2) & 0x7F]; if (64 > 8
never executed: if (64 > 16__inv = 2 * __inv - __inv * __inv * __n;
never executed: if (64 > 32__inv = 2 * __inv - __inv * __inv * __n;
never executed: if (64 > 64__inv = 2 * __inv - __inv * __inv * __n;
never executed: while (__invbits < 64end of block
never executed: (ginv) = __inv; } while (0);end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1009 | n0 = ginv * n0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1010 | n1 = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1011 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1012 | if (!prime2_p (g1, g0)
| 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
| 1-3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1019 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1020 | if (prime_p (n0)
| 1-2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1021 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1022 | factor_insert_multiplicity (factors, n0, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1023 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1024 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1025 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1026 | factor_using_pollard_rho (n0, a, factors); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1027 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1028 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1030 | if (prime2_p (n1, n0)
| 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 blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1040 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1041 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1042 | factor (uintmax_t t1, uintmax_t t0, struct factors *factors) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1043 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1044 | factors->nfactors = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1045 | factors->plarge[1] = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1046 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1047 | if (t1 == 0
| 2-500042 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1048 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1049 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1050 | t0 = factor_using_division (&t1, t1, t0, factors); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1051 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1052 | if (t1 == 0
| 3-500040 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1053 | return; executed 13678 times by 1 test: return;Executed by:
| 13678 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1054 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1055 | if (prime2_p (t1, t0)
| 27-486338 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1056 | factor_insert_large (factors, t1, t0); executed 486338 times by 1 test: factor_insert_large (factors, t1, t0);Executed by:
| 486338 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1057 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1058 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1059 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1060 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1061 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1062 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1063 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1064 | if (t1 == 0
| 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:
| 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:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1068 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1069 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1070 | static strtol_error | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1071 | strto2uintmax (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 == ' '
| 0-500042 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1083 | s++; never executed: s++; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1084 | else if (c == '+'
| 1-500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1085 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1086 | s++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1087 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1088 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1089 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1090 | break; executed 500041 times by 1 test: break;Executed by:
| 500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1091 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1092 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1093 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1094 | const char *p = s; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1095 | for (;;) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1096 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1097 | unsigned int c = *p++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1098 | if (c == 0
| 500041-2944853 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1099 | break; executed 500041 times by 1 test: break;Executed by:
| 500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1100 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1101 | if (__builtin_expect ((!((unsigned int) (c) - '0' <= 9)), 0)
| 1-2944852 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1102 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1103 | err = LONGINT_INVALID; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1104 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1105 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1106 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1107 | err = LONGINT_OK; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1108 | } executed 2944852 times by 1 test: end of blockExecuted by:
| 2944852 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1109 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1110 | for (;err == LONGINT_OK
| 1-3444893 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1111 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1112 | unsigned int c = *s++; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1113 | if (c == 0
| 500041-2944852 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1114 | break; executed 500041 times by 1 test: break;Executed by:
| 500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1115 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1116 | c -= '0'; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1117 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1118 | if (__builtin_expect ((hi > ~(uintmax_t)0 / 10), 0)
| 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)
| 0-2944852 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1134 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1135 | err = LONGINT_OVERFLOW; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1136 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1137 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1138 | } executed 2944852 times by 1 test: end of blockExecuted by:
| 2944852 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1139 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1140 | *hip = hi; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1141 | *lop = lo; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1142 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1143 | return executed 500042 times by 1 test: err;return err;Executed by:
executed 500042 times by 1 test: return err;Executed by:
| 500042 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1144 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1145 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1146 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1147 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1148 | static struct lbuf_ | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1149 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1150 | char *buf; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1151 | char *end; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1152 | } lbuf; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1153 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1154 | lbuf_alloc (void) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1155 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1156 | if (lbuf.buf
| 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 blockExecuted by:
| 56 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1164 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1165 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1166 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1167 | lbuf_flush (void) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1168 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1169 | size_t size = lbuf.end - lbuf.buf; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1170 | if (full_write (
| 0-17390 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1171 | 1
| 0-17390 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1172 | , lbuf.buf, size) != size
| 0-17390 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1173 | (( never executed: !!sizeof (struct { _Static_assert (((!!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 ()))));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 blockExecuted by:
| 17390 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1198 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1199 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1200 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1201 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1202 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1203 | lbuf_putc (char c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1204 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1205 | *lbuf.end++ = c; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1206 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1207 | if (c == '\n'
| 500041-1840266 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1208 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1209 | size_t buffered = lbuf.end - lbuf.buf; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1210 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1211 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1212 | static int line_buffered = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1213 | if (line_buffered == -1
| 44-499997 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1214 | line_buffered = isatty ( executed 44 times by 1 test: line_buffered = isatty ( 0 );Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1215 | 0 executed 44 times by 1 test: line_buffered = isatty ( 0 );Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1216 | ); executed 44 times by 1 test: line_buffered = isatty ( 0 );Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1217 | if (line_buffered
| 0-500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1218 | lbuf_flush (); never executed: lbuf_flush (); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1219 | else if (buffered >= 512
| 17334-482707 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1220 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1221 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1222 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1223 | char const *tend = lbuf.end; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1225 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1226 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1227 | char *tlend = lbuf.buf + 512; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1228 | while (*--
executed 148903 times by 1 test: ;Executed by:
| 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 blockExecuted by:
| 17334 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1238 | } executed 500041 times by 1 test: end of blockExecuted by:
| 500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1239 | } executed 2340307 times by 1 test: end of blockExecuted by:
| 2340307 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1240 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1241 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1242 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1243 | lbuf_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
| 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 blockExecuted by:
| 1840269 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1256 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1257 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1258 | print_uintmaxes (uintmax_t t1, uintmax_t t0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1259 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1260 | uintmax_t q, r; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1261 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1262 | if (t1 == 0
| 3-1840266 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1263 | lbuf_putint (t0, 0); executed 1840266 times by 1 test: lbuf_putint (t0, 0);Executed by:
| 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
executed 87 times by 1 test: }end of blockExecuted by:
executed 192 times by 1 test: (r) = __r0; (t0) = __q; } while (0);end of blockExecuted by:
| 3-192 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1277 | print_uintmaxes (q, t0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1278 | lbuf_putint (r, 9); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1279 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1280 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1281 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1282 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1283 | static void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1284 | print_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
| 500041-1203667 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1294 | for (unsigned int k = 0; k < factors.e[j]
| 1203667-1340225 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1295 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1296 | lbuf_putc (' '); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1297 | print_uintmaxes (0, factors.p[j]); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1298 | } executed 1340225 times by 1 test: end of blockExecuted by:
| 1340225 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1299 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1300 | if (factors.plarge[1]
| 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 blockExecuted by:
| 500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1308 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1309 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1310 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1311 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1312 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1313 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1314 | static | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1315 | _Bool | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1316 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1317 | print_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: LONGINT_OK:case LONGINT_OK:Executed by:
executed 500041 times by 1 test: case LONGINT_OK:Executed by:
| 500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1330 | if (((
| 0-500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1331 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1332 | do { if (dev_debug
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: } while (0);fprintf ( stderr , "[using single-precision arithmetic] "); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1335 | print_factors_single (t1, t0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1336 | return executed 500041 times by 1 test: return 1 ;Executed by:
executed 500041 times by 1 test: return 1 ;Executed by:
| 500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1337 | 1 executed 500041 times by 1 test: return 1 ;Executed by:
| 500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1338 | ; executed 500041 times by 1 test: return 1 ;Executed by:
| 500041 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1339 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1340 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1341 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1342 | case never executed: LONGINT_OVERFLOW:case 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:
executed 1 time by 1 test: default:Executed by:
| 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:
executed 1 time by 1 test: return 0 ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1353 | 0 executed 1 time by 1 test: return 0 ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1354 | ; executed 1 time by 1 test: return 0 ;Executed by:
| 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1367 | void | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1368 | usage (int status) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1369 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1370 | if (status !=
| 3-4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1371 | 0
| 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: while (0);end of blockExecuted by:
| 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 blockExecuted by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1418 | exit (status); executed 7 times by 1 test: exit (status);Executed by:
| 7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1419 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1420 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1421 | static | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1422 | _Bool | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1423 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1424 | do_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
| 5-500002 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1444 | break; executed 5 times by 1 test: break;Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1445 | ok &= print_factors (tokenbuffer.buffer); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1446 | } executed 500002 times by 1 test: end of blockExecuted by:
| 500002 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1447 | free (tokenbuffer.buffer); | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1448 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1449 | return executed 5 times by 1 test: ok;return ok;Executed by:
executed 5 times by 1 test: return ok;Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1450 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1451 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1452 | int | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1453 | main (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 ((
| 12-44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1469 | ((void *)0)
| 12-44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1470 | )) != -1
| 12-44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1471 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1472 | switch (c) | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1473 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1474 | case never executed: DEV_DEBUG_OPTION:case 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: GETOPT_HELP_CHAR:case GETOPT_HELP_CHAR:Executed by:
executed 3 times by 1 test: usage (case GETOPT_HELP_CHAR:Executed by:
| 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1481 | 0 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1482 | ); break; never executed: ;break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1483 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1484 | case executed 5 times by 1 test: GETOPT_VERSION_CHAR:case GETOPT_VERSION_CHAR:Executed by:
executed 5 times by 1 test: version_etc (case GETOPT_VERSION_CHAR:Executed by:
| 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:
| 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1489 | 0 executed 5 times by 1 test: exit ( 0 );Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1490 | ); executed 5 times by 1 test: break;exit ( 0 );Executed by:
never executed: ;break; | 0-5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1491 | - | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1492 | default executed 4 times by 1 test: :default:Executed by:
executed 4 times by 1 test: default:Executed by:
| 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
| 5-39 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1507 | ok = do_stdin (); executed 5 times by 1 test: ok = do_stdin ();Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1508 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1509 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1510 | ok = | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1511 | 1 | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1512 | ; | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1513 | for (int i = optind; i < argc
| 39-40 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1514 | if (! print_factors (argv[i])
| 1-39 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1515 | ok = executed 1 time by 1 test: ok = 0 ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1516 | 0 executed 1 time by 1 test: ok = 0 ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1517 | ; executed 1 time by 1 test: ok = 0 ;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1518 | } executed 39 times by 1 test: end of blockExecuted by:
| 39 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1519 | return executed 44 times by 1 test: ok ? return ok ? 0 : 1 ;Executed by:
executed 44 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1520 | 0 executed 44 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1521 | : executed 44 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1522 | 1 executed 44 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1523 | ; executed 44 times by 1 test: return ok ? 0 : 1 ;Executed by:
| 44 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1524 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |