Branch Coverage

blocksort.c
Criterion Covered Total %
branch 267 328 81.4


line true false branch
40 217 6228 if (lo == hi) return;
42 2802 3426 if (hi - lo > 3) {
43 8821 2802 for ( i = hi-4; i >= lo; i-- ) {
46 9155 1898 for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 )
2232 6923 for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 )
52 18802 6228 for ( i = hi-1; i >= lo; i-- ) {
55 25354 1644 for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ )
8196 17158 for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ )
109 12144 1590 while (sp > 0) {
111 0 12144 AssertH ( sp < FALLBACK_QSORT_STACK_SIZE - 1, 1004 );
114 6445 5699 if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) {
128 1036 4663 if (r3 == 0) med = eclass[fmap[lo]]; else
129 2687 1976 if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else
137 2499 1081573 if (unLo > unHi) break;
139 972041 109532 if (n == 0) {
144 22379 87153 if (n > 0) break;
148 5699 96764 if (unLo > unHi) break;
150 6763 90001 if (n == 0) {
155 19179 70822 if (n < 0) break;
158 5699 19179 if (unLo > unHi) break;
164 422 5277 if (gtHi < ltLo) continue;
166 22334 5277 n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n);
167 4765 5277 m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m);
172 2009 3268 if (n - lo > hi - m) {
231 5140 20 for (i = 0; i < 257; i++) ftab[i] = 0;
232 75395 20 for (i = 0; i < nblock; i++) ftab[eclass8[i]]++;
233 5120 20 for (i = 0; i < 256; i++) ftabCopy[i] = ftab[i];
234 5120 20 for (i = 1; i < 257; i++) ftab[i] += ftab[i-1];
236 75395 20 for (i = 0; i < nblock; i++) {
244 2383 20 for (i = 0; i < nBhtab; i++) bhtab[i] = 0;
245 5120 20 for (i = 0; i < 256; i++) SET_BH(ftab[i]);
254 640 20 for (i = 0; i < 32; i++) {
267 1054633 82 for (i = 0; i < nblock; i++) {
268 54616 1000017 if (ISSET_BH(i)) j = i;
269 98418 956215 k = fmap[i] - H; if (k < 0) k += nblock;
279 7672 1239 while (ISSET_BH(k) && UNALIGNED_BH(k)) k++;
7239 433 while (ISSET_BH(k) && UNALIGNED_BH(k)) k++;
280 433 1239 if (ISSET_BH(k)) {
281 1327 433 while (WORD_BH(k) == 0xffffffff) k += 32;
282 4995 433 while (ISSET_BH(k)) k++;
285 82 1590 if (l >= nblock) break;
286 18241 651 while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++;
17302 939 while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++;
287 939 651 if (!ISSET_BH(k)) {
288 30312 939 while (WORD_BH(k) == 0x00000000) k += 32;
289 12731 939 while (!ISSET_BH(k)) k++;
292 0 1590 if (r >= nblock) break;
295 1590 0 if (r > l) {
301 1001607 1590 for (i = l; i <= r; i++) {
303 28207 973400 if (cc != cc1) { SET_BH(i); cc = cc1; };
312 80 2 if (H > nblock || nNotDone == 0) break;
62 18 if (H > nblock || nNotDone == 0) break;
323 75395 20 for (i = 0; i < nblock; i++) {
324 2550 75395 while (ftabCopy[j] == 0) j++;
328 0 20 AssertH ( j < 256, 1005 );
361 8759 243 if (c1 != c2) return (c1 > c2);
365 42 201 if (c1 != c2) return (c1 > c2);
369 0 201 if (c1 != c2) return (c1 > c2);
373 0 201 if (c1 != c2) return (c1 > c2);
377 0 201 if (c1 != c2) return (c1 > c2);
381 0 201 if (c1 != c2) return (c1 > c2);
385 0 201 if (c1 != c2) return (c1 > c2);
389 0 201 if (c1 != c2) return (c1 > c2);
393 0 201 if (c1 != c2) return (c1 > c2);
397 0 201 if (c1 != c2) return (c1 > c2);
401 0 201 if (c1 != c2) return (c1 > c2);
405 0 201 if (c1 != c2) return (c1 > c2);
413 16 588781 if (c1 != c2) return (c1 > c2);
415 0 588781 if (s1 != s2) return (s1 > s2);
419 17 588764 if (c1 != c2) return (c1 > c2);
421 0 588764 if (s1 != s2) return (s1 > s2);
425 16 588748 if (c1 != c2) return (c1 > c2);
427 0 588748 if (s1 != s2) return (s1 > s2);
431 16 588732 if (c1 != c2) return (c1 > c2);
433 0 588732 if (s1 != s2) return (s1 > s2);
437 16 588716 if (c1 != c2) return (c1 > c2);
439 0 588716 if (s1 != s2) return (s1 > s2);
443 16 588700 if (c1 != c2) return (c1 > c2);
445 0 588700 if (s1 != s2) return (s1 > s2);
449 16 588684 if (c1 != c2) return (c1 > c2);
451 0 588684 if (s1 != s2) return (s1 > s2);
455 16 588668 if (c1 != c2) return (c1 > c2);
457 0 588668 if (s1 != s2) return (s1 > s2);
460 72 588596 if (i1 >= nblock) i1 -= nblock;
461 72 588596 if (i2 >= nblock) i2 -= nblock;
466 588596 72 while (k >= 0);
498 0 5767 if (bigN < 2) return;
501 5811 5767 while (incs[hp] < bigN) hp++;
504 5800 5765 for (; hp >= 0; hp--) {
511 226 5898 if (i > hi) break;
514 2907 3028 while ( mainGtU (
519 2870 37 if (j <= (lo + h - 1)) break;
525 4391 1507 if (i > hi) break;
528 1451 993 while ( mainGtU (
533 514 937 if (j <= (lo + h - 1)) break;
539 1181 326 if (i > hi) break;
542 396 227 while ( mainGtU (
547 99 297 if (j <= (lo + h - 1)) break;
552 2 324 if (*budget < 0) return;
586 0 26 if (a > b) { t = a; a = b; b = t; };
587 0 26 if (b > c) {
589 0 0 if (a > b) b = a;
644 5793 5765 while (sp > 0) {
646 0 5793 AssertH ( sp < MAIN_QSORT_STACK_SIZE - 2, 1001 );
649 28 5765 if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
2 26 if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
652 2 5765 if (*budget < 0) return;
666 26 39013 if (unLo > unHi) break;
668 39013 0 if (n == 0) {
672 0 0 if (n > 0) break;
676 26 0 if (unLo > unHi) break;
678 0 0 if (n == 0) {
682 0 0 if (n < 0) break;
685 26 0 if (unLo > unHi) break;
691 26 0 if (gtHi < ltLo) {
696 0 0 n = mmin(ltLo-lo, unLo-ltLo); mvswap(lo, unLo-n, n);
697 0 0 m = mmin(hi-gtHi, gtHi-unHi); mvswap(unLo, hi-m+1, m);
706 0 0 if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);
707 0 0 if (mnextsize(1) < mnextsize(2)) mnextswap(1,2);
708 0 0 if (mnextsize(0) < mnextsize(1)) mnextswap(0,1);
770 196611 3 for (i = 65536; i >= 0; i--) ftab[i] = 0;
774 28759 3 for (; i >= 3; i -= 4) {
788 1 3 for (; i >= 0; i--) {
795 102 3 for (i = 0; i < BZ_N_OVERSHOOT; i++) {
803 196608 3 for (i = 1; i <= 65536; i++) ftab[i] += ftab[i-1];
807 28759 3 for (; i >= 3; i -= 4) {
825 1 3 for (; i >= 0; i--) {
837 768 3 for (i = 0; i <= 255; i++) {
845 12 3 do h = 3 * h + 1; while (h <= 256);
848 3303 15 for (i = h; i <= 255; i++) {
851 1433 3161 while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) {
854 142 1291 if (j <= (h - 1)) goto zero;
859 12 3 } while (h != 1);
868 737 1 for (i = 0; i <= 255; i++) {
886 188377 735 for (j = 0; j <= 255; j++) {
887 187640 737 if (j != ss) {
889 97680 89960 if ( ! (ftab[sb] & SETMASK) ) {
892 5767 91913 if (hi > lo) {
902 2 5765 if (*budget < 0) return;
909 0 735 AssertH ( !bigDone[ss], 1006 );
919 188160 735 for (j = 0; j <= 255; j++) {
923 25024 735 for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) {
924 0 25024 k = ptr[j]-1; if (k < 0) k += nblock;
926 12544 12480 if (!bigDone[c1])
929 24980 735 for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) {
930 1 24979 k = ptr[j]-1; if (k < 0) k += nblock;
932 12544 12436 if (!bigDone[c1])
937 0 735 AssertH ( (copyStart[ss]-1 == copyEnd[ss])
0 0 AssertH ( (copyStart[ss]-1 == copyEnd[ss])
0 0 AssertH ( (copyStart[ss]-1 == copyEnd[ss])
946 188160 735 for (j = 0; j <= 255; j++) ftab[(j << 8) + ss] |= SETMASK;
989 734 1 if (i < 255) {
994 0 734 while ((bbSize >> shifts) > 65534) shifts++;
996 49772 734 for (j = bbSize-1; j >= 0; j--) {
1000 34 49738 if (a2update < BZ_N_OVERSHOOT)
1003 0 734 AssertH ( ((bbSize-1) >> shifts) <= 65535, 1002 );
1044 18 3 if (nblock < 10000) {
1053 1 2 if (i & 1) i++;
1063 0 3 if (wfact < 1 ) wfact = 1;
1064 0 3 if (wfact > 100) wfact = 100;
1075 2 1 if (budget < 0) {
1084 31171 0 for (i = 0; i < s->nblock; i++)
1085 21 31150 if (ptr[i] == 0)
1088 0 21 AssertH( s->origPtr != -1, 1003 );