Branch Coverage

blocksort.c
Criterion Covered Total %
branch 267 328 81.4


line true false branch
40 231 6188 if (lo == hi) return;
42 2819 3369 if (hi - lo > 3) {
43 8815 2819 for ( i = hi-4; i >= lo; i-- ) {
46 9126 1878 for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 )
2189 6937 for ( j = i+4; j <= hi && ec_tmp > eclass[fmap[j]]; j += 4 )
52 18784 6188 for ( i = hi-1; i >= lo; i-- ) {
55 25313 1657 for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ )
8186 17127 for ( j = i+1; j <= hi && ec_tmp > eclass[fmap[j]]; j++ )
109 12112 1570 while (sp > 0) {
111 0 12112 AssertH ( sp < FALLBACK_QSORT_STACK_SIZE - 1, 1004 );
114 6419 5693 if (hi - lo < FALLBACK_QSORT_SMALL_THRESH) {
128 1036 4657 if (r3 == 0) med = eclass[fmap[lo]]; else
129 2690 1967 if (r3 == 1) med = eclass[fmap[(lo+hi)>>1]]; else
137 2487 1081338 if (unLo > unHi) break;
139 972035 109303 if (n == 0) {
144 22404 86899 if (n > 0) break;
148 5693 96839 if (unLo > unHi) break;
150 6756 90083 if (n == 0) {
155 19198 70885 if (n < 0) break;
158 5693 19198 if (unLo > unHi) break;
164 422 5271 if (gtHi < ltLo) continue;
166 22326 5271 n = fmin(ltLo-lo, unLo-ltLo); fvswap(lo, unLo-n, n);
167 4758 5271 m = fmin(hi-gtHi, gtHi-unHi); fvswap(unLo, hi-m+1, m);
172 1989 3282 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 54639 999994 if (ISSET_BH(i)) j = i;
269 98418 956215 k = fmap[i] - H; if (k < 0) k += nblock;
279 7505 1226 while (ISSET_BH(k) && UNALIGNED_BH(k)) k++;
7079 426 while (ISSET_BH(k) && UNALIGNED_BH(k)) k++;
280 426 1226 if (ISSET_BH(k)) {
281 1332 426 while (WORD_BH(k) == 0xffffffff) k += 32;
282 5018 426 while (ISSET_BH(k)) k++;
285 82 1570 if (l >= nblock) break;
286 18128 635 while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++;
17193 935 while (!ISSET_BH(k) && UNALIGNED_BH(k)) k++;
287 935 635 if (!ISSET_BH(k)) {
288 30312 935 while (WORD_BH(k) == 0x00000000) k += 32;
289 12817 935 while (!ISSET_BH(k)) k++;
292 0 1570 if (r >= nblock) break;
295 1570 0 if (r > l) {
301 1001564 1570 for (i = l; i <= r; i++) {
303 28187 973377 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 8826 242 if (c1 != c2) return (c1 > c2);
365 41 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 5805 if (bigN < 2) return;
501 5858 5805 while (incs[hp] < bigN) hp++;
504 5847 5803 for (; hp >= 0; hp--) {
511 222 5954 if (i > hi) break;
514 2954 3048 while ( mainGtU (
519 2906 48 if (j <= (lo + h - 1)) break;
525 4478 1476 if (i > hi) break;
528 1454 958 while ( mainGtU (
533 518 936 if (j <= (lo + h - 1)) break;
539 1145 331 if (i > hi) break;
542 430 224 while ( mainGtU (
547 107 323 if (j <= (lo + h - 1)) break;
552 2 329 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 5831 5803 while (sp > 0) {
646 0 5831 AssertH ( sp < MAIN_QSORT_STACK_SIZE - 2, 1001 );
649 28 5803 if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
2 26 if (hi - lo < MAIN_QSORT_SMALL_THRESH ||
652 2 5803 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 1337 3154 while ( BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv) ) {
854 149 1188 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 5805 91875 if (hi > lo) {
902 2 5803 if (*budget < 0) return;
909 0 735 AssertH ( !bigDone[ss], 1006 );
919 188160 735 for (j = 0; j <= 255; j++) {
923 25016 735 for (j = ftab[ss << 8] & CLEARMASK; j < copyStart[ss]; j++) {
924 1 25015 k = ptr[j]-1; if (k < 0) k += nblock;
926 12126 12890 if (!bigDone[c1])
929 24988 735 for (j = (ftab[(ss+1) << 8] & CLEARMASK) - 1; j > copyEnd[ss]; j--) {
930 0 24988 k = ptr[j]-1; if (k < 0) k += nblock;
932 12970 12018 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 49768 734 for (j = bbSize-1; j >= 0; j--) {
1000 34 49734 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 64990 0 for (i = 0; i < s->nblock; i++)
1085 21 64969 if (ptr[i] == 0)
1088 0 21 AssertH( s->origPtr != -1, 1003 );