test_dict_deflate:
   28|  4.17k|{
   29|  4.17k|    z_stream c_stream; /* compression stream */
   30|  4.17k|    int err;
   31|  4.17k|    int level = data[0] % 11 - 1; /* [-1..9]
   32|       |      compression levels
   33|       |      #define Z_NO_COMPRESSION         0
   34|       |      #define Z_BEST_SPEED             1
   35|       |      #define Z_BEST_COMPRESSION       9
   36|       |      #define Z_DEFAULT_COMPRESSION  (-1) */
   37|       |
   38|  4.17k|    int method = Z_DEFLATED; /* The deflate compression method (the only one
  ------------------
  |  |  213|  4.17k|#define Z_DEFLATED   8
  ------------------
   39|       |                                supported in this version) */
   40|  4.17k|    int windowBits = 8 + data[0] % 8; /* The windowBits parameter is the base
   41|       |      two logarithm of the window size (the size of the history buffer).  It
   42|       |      should be in the range 8..15 for this version of the library. */
   43|  4.17k|    int memLevel = 1 + data[0] % 9;   /* memLevel=1 uses minimum memory but is
   44|       |      slow and reduces compression ratio; memLevel=9 uses maximum memory for
   45|       |      optimal speed. */
   46|  4.17k|    int strategy = data[0] % 5;       /* [0..4]
   47|       |      #define Z_FILTERED            1
   48|       |      #define Z_HUFFMAN_ONLY        2
   49|       |      #define Z_RLE                 3
   50|       |      #define Z_FIXED               4
   51|       |      #define Z_DEFAULT_STRATEGY    0 */
   52|       |
   53|       |    /* deflate would fail for no-compression or for speed levels. */
   54|  4.17k|    if (level == 0 || level == 1)
  ------------------
  |  Branch (54:9): [True: 276, False: 3.89k]
  |  Branch (54:23): [True: 336, False: 3.55k]
  ------------------
   55|    612|      level = -1;
   56|       |
   57|  4.17k|    c_stream.zalloc = zalloc;
   58|  4.17k|    c_stream.zfree = zfree;
   59|  4.17k|    c_stream.opaque = (void *)0;
   60|       |
   61|  4.17k|    err = deflateInit2(&c_stream, level, method, windowBits, memLevel, strategy);
  ------------------
  |  | 1937|  4.17k|          deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
  |  | 1938|  4.17k|                        (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
  |  |  ------------------
  |  |  |  |   44|  4.17k|#define ZLIB_VERSION "1.3.2.1-motley"
  |  |  ------------------
  ------------------
   62|  4.17k|    CHECK_ERR(err, "deflateInit");
  ------------------
  |  |   10|  4.17k|#define CHECK_ERR(err, msg) { \
  |  |   11|  4.17k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  8.34k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 4.17k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  4.17k|}
  ------------------
   63|       |
   64|  4.17k|    err = deflateSetDictionary(
   65|  4.17k|        &c_stream, (const unsigned char *)data, dictionaryLen);
   66|  4.17k|    CHECK_ERR(err, "deflateSetDictionary");
  ------------------
  |  |   10|  4.17k|#define CHECK_ERR(err, msg) { \
  |  |   11|  4.17k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  8.34k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 4.17k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  4.17k|}
  ------------------
   67|       |
   68|       |    /* deflateBound does not provide enough space for low compression levels. */
   69|  4.17k|    *comprLen = 100 + 2 * deflateBound(&c_stream, dataLen);
   70|  4.17k|    *compr = (uint8_t *)calloc(1, *comprLen);
   71|       |
   72|  4.17k|    dictId = c_stream.adler;
   73|  4.17k|    c_stream.next_out = *compr;
   74|  4.17k|    c_stream.avail_out = (unsigned int)(*comprLen);
   75|       |
   76|  4.17k|    c_stream.next_in = (Bytef *)data;
   77|  4.17k|    c_stream.avail_in = dataLen;
   78|       |
   79|  4.17k|    err = deflate(&c_stream, Z_FINISH);
  ------------------
  |  |  176|  4.17k|#define Z_FINISH        4
  ------------------
   80|  4.17k|    if (err != Z_STREAM_END) {
  ------------------
  |  |  182|  4.17k|#define Z_STREAM_END    1
  ------------------
  |  Branch (80:9): [True: 0, False: 4.17k]
  ------------------
   81|      0|        fprintf(stderr, "deflate dict should report Z_STREAM_END\n");
   82|      0|        return 0;
   83|      0|    }
   84|  4.17k|    err = deflateEnd(&c_stream);
   85|  4.17k|    CHECK_ERR(err, "deflateEnd");
  ------------------
  |  |   10|  4.17k|#define CHECK_ERR(err, msg) { \
  |  |   11|  4.17k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  8.34k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 4.17k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  4.17k|}
  ------------------
   86|  4.17k|    return 0;
   87|  4.17k|}
test_dict_inflate:
   92|  4.17k|int test_dict_inflate(unsigned char *compr, size_t comprLen) {
   93|  4.17k|  int err;
   94|  4.17k|  z_stream d_stream; /* decompression stream */
   95|  4.17k|  unsigned char *uncompr;
   96|       |
   97|  4.17k|  d_stream.zalloc = zalloc;
   98|  4.17k|  d_stream.zfree = zfree;
   99|  4.17k|  d_stream.opaque = (void *)0;
  100|       |
  101|  4.17k|  d_stream.next_in = compr;
  102|  4.17k|  d_stream.avail_in = (unsigned int)comprLen;
  103|       |
  104|  4.17k|  err = inflateInit(&d_stream);
  ------------------
  |  | 1935|  4.17k|          inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
  |  |  ------------------
  |  |  |  |   44|  4.17k|#define ZLIB_VERSION "1.3.2.1-motley"
  |  |  ------------------
  ------------------
  105|  4.17k|  CHECK_ERR(err, "inflateInit");
  ------------------
  |  |   10|  4.17k|#define CHECK_ERR(err, msg) { \
  |  |   11|  4.17k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  8.34k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 4.17k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  4.17k|}
  ------------------
  106|       |
  107|  4.17k|  uncompr = (uint8_t *)calloc(1, dataLen);
  108|  4.17k|  d_stream.next_out = uncompr;
  109|  4.17k|  d_stream.avail_out = (unsigned int)dataLen;
  110|       |
  111|  8.06k|  for (;;) {
  112|  8.06k|    err = inflate(&d_stream, Z_NO_FLUSH);
  ------------------
  |  |  172|  8.06k|#define Z_NO_FLUSH      0
  ------------------
  113|  8.06k|    if (err == Z_STREAM_END)
  ------------------
  |  |  182|  8.06k|#define Z_STREAM_END    1
  ------------------
  |  Branch (113:9): [True: 4.17k, False: 3.89k]
  ------------------
  114|  4.17k|      break;
  115|  3.89k|    if (err == Z_NEED_DICT) {
  ------------------
  |  |  183|  3.89k|#define Z_NEED_DICT     2
  ------------------
  |  Branch (115:9): [True: 3.89k, False: 0]
  ------------------
  116|  3.89k|      if (d_stream.adler != dictId) {
  ------------------
  |  Branch (116:11): [True: 0, False: 3.89k]
  ------------------
  117|      0|        fprintf(stderr, "unexpected dictionary");
  118|      0|        return 0;
  119|      0|      }
  120|  3.89k|      err = inflateSetDictionary(
  121|  3.89k|          &d_stream, (const unsigned char *)data, dictionaryLen);
  122|  3.89k|    }
  123|  3.89k|    CHECK_ERR(err, "inflate with dict");
  ------------------
  |  |   10|  3.89k|#define CHECK_ERR(err, msg) { \
  |  |   11|  3.89k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  7.78k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 3.89k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  3.89k|}
  ------------------
  124|  3.89k|  }
  125|       |
  126|  4.17k|  err = inflateEnd(&d_stream);
  127|  4.17k|  CHECK_ERR(err, "inflateEnd");
  ------------------
  |  |   10|  4.17k|#define CHECK_ERR(err, msg) { \
  |  |   11|  4.17k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  8.34k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 4.17k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  4.17k|}
  ------------------
  128|       |
  129|  4.17k|  if (memcmp(uncompr, data, dataLen)) {
  ------------------
  |  Branch (129:7): [True: 0, False: 4.17k]
  ------------------
  130|      0|    fprintf(stderr, "bad inflate with dict\n");
  131|      0|    return 0;
  132|      0|  }
  133|       |
  134|  4.17k|  free(uncompr);
  135|  4.17k|  return 0;
  136|  4.17k|}
LLVMFuzzerTestOneInput:
  138|  4.18k|int LLVMFuzzerTestOneInput(const uint8_t *d, size_t size) {
  139|  4.18k|  size_t comprLen = 0;
  140|  4.18k|  uint8_t *compr;
  141|       |
  142|       |  /* Discard inputs larger than 100Kb. */
  143|  4.18k|  static size_t kMaxSize = 100 * 1024;
  144|       |
  145|  4.18k|  if (size < 1 || size > kMaxSize)
  ------------------
  |  Branch (145:7): [True: 0, False: 4.18k]
  |  Branch (145:19): [True: 10, False: 4.17k]
  ------------------
  146|     10|    return 0;
  147|       |
  148|  4.17k|  data = d;
  149|  4.17k|  dataLen = size;
  150|       |
  151|       |  /* Set up the contents of the dictionary.  The size of the dictionary is
  152|       |     intentionally selected to be of unusual size.  To help cover more corner
  153|       |     cases, the size of the dictionary is read from the input data.  */
  154|  4.17k|  dictionaryLen = data[0];
  155|  4.17k|  if (dictionaryLen > dataLen)
  ------------------
  |  Branch (155:7): [True: 1.15k, False: 3.02k]
  ------------------
  156|  1.15k|    dictionaryLen = dataLen;
  157|       |
  158|  4.17k|  test_dict_deflate(&compr, &comprLen);
  159|  4.17k|  test_dict_inflate(compr, comprLen);
  160|       |
  161|  4.17k|  free(compr);
  162|       |
  163|       |  /* This function must return 0. */
  164|  4.17k|  return 0;
  165|  4.18k|}

adler32_z:
   61|  55.3k|uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
   62|  55.3k|    unsigned long sum2;
   63|  55.3k|    unsigned n;
   64|       |
   65|       |    /* split Adler-32 into component sums */
   66|  55.3k|    sum2 = (adler >> 16) & 0xffff;
   67|  55.3k|    adler &= 0xffff;
   68|       |
   69|       |    /* in case user likes doing a byte at a time, keep it fast */
   70|  55.3k|    if (len == 1) {
  ------------------
  |  Branch (70:9): [True: 462, False: 54.9k]
  ------------------
   71|    462|        adler += buf[0];
   72|    462|        if (adler >= BASE)
  ------------------
  |  |   10|    462|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  |  Branch (72:13): [True: 5, False: 457]
  ------------------
   73|      5|            adler -= BASE;
  ------------------
  |  |   10|      5|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   74|    462|        sum2 += adler;
   75|    462|        if (sum2 >= BASE)
  ------------------
  |  |   10|    462|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  |  Branch (75:13): [True: 31, False: 431]
  ------------------
   76|     31|            sum2 -= BASE;
  ------------------
  |  |   10|     31|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   77|    462|        return adler | (sum2 << 16);
   78|    462|    }
   79|       |
   80|       |    /* initial Adler-32 value (deferred check for len == 1 speed) */
   81|  54.9k|    if (buf == Z_NULL)
  ------------------
  |  |  216|  54.9k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (81:9): [True: 20.3k, False: 34.6k]
  ------------------
   82|  20.3k|        return 1L;
   83|       |
   84|       |    /* in case short lengths are provided, keep it somewhat fast */
   85|  34.6k|    if (len < 16) {
  ------------------
  |  Branch (85:9): [True: 4.22k, False: 30.4k]
  ------------------
   86|  33.2k|        while (len--) {
  ------------------
  |  Branch (86:16): [True: 29.0k, False: 4.22k]
  ------------------
   87|  29.0k|            adler += *buf++;
   88|  29.0k|            sum2 += adler;
   89|  29.0k|        }
   90|  4.22k|        if (adler >= BASE)
  ------------------
  |  |   10|  4.22k|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
  |  Branch (90:13): [True: 4, False: 4.22k]
  ------------------
   91|      4|            adler -= BASE;
  ------------------
  |  |   10|      4|#define BASE 65521U     /* largest prime smaller than 65536 */
  ------------------
   92|  4.22k|        MOD28(sum2);            /* only added so many BASE's */
  ------------------
  |  |   56|  4.22k|#  define MOD28(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|  4.22k|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
   93|  4.22k|        return adler | (sum2 << 16);
   94|  4.22k|    }
   95|       |
   96|       |    /* do length NMAX blocks -- requires just one modulo operation */
   97|  34.3k|    while (len >= NMAX) {
  ------------------
  |  |   11|  34.3k|#define NMAX 5552
  ------------------
  |  Branch (97:12): [True: 3.98k, False: 30.4k]
  ------------------
   98|  3.98k|        len -= NMAX;
  ------------------
  |  |   11|  3.98k|#define NMAX 5552
  ------------------
   99|  3.98k|        n = NMAX / 16;          /* NMAX is divisible by 16 */
  ------------------
  |  |   11|  3.98k|#define NMAX 5552
  ------------------
  100|  1.38M|        do {
  101|  1.38M|            DO16(buf);          /* 16 sums unrolled */
  ------------------
  |  |   18|  1.38M|#define DO16(buf)   DO8(buf,0); DO8(buf,8);
  |  |  ------------------
  |  |  |  |   17|  1.38M|#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.38M|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.38M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.38M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.38M|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.38M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.38M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DO16(buf)   DO8(buf,0); DO8(buf,8);
  |  |  ------------------
  |  |  |  |   17|  1.38M|#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.38M|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.38M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.38M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.38M|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.38M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.38M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.38M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|  1.38M|            buf += 16;
  103|  1.38M|        } while (--n);
  ------------------
  |  Branch (103:18): [True: 1.37M, False: 3.98k]
  ------------------
  104|  3.98k|        MOD(adler);
  ------------------
  |  |   55|  3.98k|#  define MOD(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|  3.98k|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
  105|  3.98k|        MOD(sum2);
  ------------------
  |  |   55|  3.98k|#  define MOD(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|  3.98k|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
  106|  3.98k|    }
  107|       |
  108|       |    /* do remaining bytes (less than NMAX, still just one modulo) */
  109|  30.4k|    if (len) {                  /* avoid modulos if none remaining */
  ------------------
  |  Branch (109:9): [True: 30.3k, False: 17]
  ------------------
  110|  1.21M|        while (len >= 16) {
  ------------------
  |  Branch (110:16): [True: 1.18M, False: 30.3k]
  ------------------
  111|  1.18M|            len -= 16;
  112|  1.18M|            DO16(buf);
  ------------------
  |  |   18|  1.18M|#define DO16(buf)   DO8(buf,0); DO8(buf,8);
  |  |  ------------------
  |  |  |  |   17|  1.18M|#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.18M|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.18M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.18M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.18M|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.18M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.18M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DO16(buf)   DO8(buf,0); DO8(buf,8);
  |  |  ------------------
  |  |  |  |   17|  1.18M|#define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.18M|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.18M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.18M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define DO8(buf,i)  DO4(buf,i); DO4(buf,i+4);
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  1.18M|#define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.18M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define DO4(buf,i)  DO2(buf,i); DO2(buf,i+2);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   15|  1.18M|#define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define DO2(buf,i)  DO1(buf,i); DO1(buf,i+1);
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   14|  1.18M|#define DO1(buf,i)  {adler += (buf)[i]; sum2 += adler;}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  113|  1.18M|            buf += 16;
  114|  1.18M|        }
  115|   122k|        while (len--) {
  ------------------
  |  Branch (115:16): [True: 91.6k, False: 30.3k]
  ------------------
  116|  91.6k|            adler += *buf++;
  117|  91.6k|            sum2 += adler;
  118|  91.6k|        }
  119|  30.3k|        MOD(adler);
  ------------------
  |  |   55|  30.3k|#  define MOD(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|  30.3k|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
  120|  30.3k|        MOD(sum2);
  ------------------
  |  |   55|  30.3k|#  define MOD(a) a %= BASE
  |  |  ------------------
  |  |  |  |   10|  30.3k|#define BASE 65521U     /* largest prime smaller than 65536 */
  |  |  ------------------
  ------------------
  121|  30.3k|    }
  122|       |
  123|       |    /* return recombined sums */
  124|  30.4k|    return adler | (sum2 << 16);
  125|  34.6k|}
adler32:
  128|  55.3k|uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
  129|  55.3k|    return adler32_z(adler, buf, len);
  130|  55.3k|}

deflateInit2_:
  389|  4.17k|                          const char *version, int stream_size) {
  390|  4.17k|    deflate_state *s;
  391|  4.17k|    int wrap = 1;
  392|  4.17k|    static const char my_version[] = ZLIB_VERSION;
  ------------------
  |  |   44|  4.17k|#define ZLIB_VERSION "1.3.2.1-motley"
  ------------------
  393|       |
  394|  4.17k|    if (version == Z_NULL || version[0] != my_version[0] ||
  ------------------
  |  |  216|  8.34k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (394:9): [True: 0, False: 4.17k]
  |  Branch (394:30): [True: 0, False: 4.17k]
  ------------------
  395|  4.17k|        stream_size != sizeof(z_stream)) {
  ------------------
  |  Branch (395:9): [True: 0, False: 4.17k]
  ------------------
  396|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  189|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  397|      0|    }
  398|  4.17k|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (398:9): [True: 0, False: 4.17k]
  ------------------
  399|       |
  400|  4.17k|    strm->msg = Z_NULL;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  401|  4.17k|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (401:9): [True: 4.17k, False: 0]
  ------------------
  402|       |#ifdef Z_SOLO
  403|       |        return Z_STREAM_ERROR;
  404|       |#else
  405|  4.17k|        strm->zalloc = zcalloc;
  406|  4.17k|        strm->opaque = (voidpf)0;
  407|  4.17k|#endif
  408|  4.17k|    }
  409|  4.17k|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (409:9): [True: 4.17k, False: 0]
  ------------------
  410|       |#ifdef Z_SOLO
  411|       |        return Z_STREAM_ERROR;
  412|       |#else
  413|  4.17k|        strm->zfree = zcfree;
  414|  4.17k|#endif
  415|       |
  416|       |#ifdef FASTEST
  417|       |    if (level != 0) level = 1;
  418|       |#else
  419|  4.17k|    if (level == Z_DEFAULT_COMPRESSION) level = 6;
  ------------------
  |  |  197|  4.17k|#define Z_DEFAULT_COMPRESSION  (-1)
  ------------------
  |  Branch (419:9): [True: 1.21k, False: 2.95k]
  ------------------
  420|  4.17k|#endif
  421|       |
  422|  4.17k|    if (windowBits < 0) { /* suppress zlib wrapper */
  ------------------
  |  Branch (422:9): [True: 0, False: 4.17k]
  ------------------
  423|      0|        wrap = 0;
  424|      0|        if (windowBits < -15)
  ------------------
  |  Branch (424:13): [True: 0, False: 0]
  ------------------
  425|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  426|      0|        windowBits = -windowBits;
  427|      0|    }
  428|  4.17k|#ifdef GZIP
  429|  4.17k|    else if (windowBits > 15) {
  ------------------
  |  Branch (429:14): [True: 0, False: 4.17k]
  ------------------
  430|      0|        wrap = 2;       /* write gzip wrapper instead */
  431|      0|        windowBits -= 16;
  432|      0|    }
  433|  4.17k|#endif
  434|  4.17k|    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  277|  8.34k|#    define MAX_MEM_LEVEL 9
  ------------------
                  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  213|  8.34k|#define Z_DEFLATED   8
  ------------------
  |  Branch (434:9): [True: 0, False: 4.17k]
  |  Branch (434:25): [True: 0, False: 4.17k]
  |  Branch (434:53): [True: 0, False: 4.17k]
  ------------------
  435|  4.17k|        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
  ------------------
  |  Branch (435:9): [True: 0, False: 4.17k]
  |  Branch (435:27): [True: 0, False: 4.17k]
  |  Branch (435:46): [True: 0, False: 4.17k]
  |  Branch (435:59): [True: 0, False: 4.17k]
  ------------------
  436|  4.17k|        strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) {
  ------------------
  |  |  203|  8.34k|#define Z_FIXED               4
  ------------------
  |  Branch (436:9): [True: 0, False: 4.17k]
  |  Branch (436:25): [True: 0, False: 4.17k]
  |  Branch (436:48): [True: 760, False: 3.41k]
  |  Branch (436:67): [True: 0, False: 760]
  ------------------
  437|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  438|      0|    }
  439|  4.17k|    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
  ------------------
  |  Branch (439:9): [True: 760, False: 3.41k]
  ------------------
  440|  4.17k|    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
  ------------------
  |  |  253|  4.17k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  441|  4.17k|    if (s == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (441:9): [True: 0, False: 4.17k]
  ------------------
  442|  4.17k|    zmemzero(s, sizeof(deflate_state));
  ------------------
  |  |  218|  4.17k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  443|  4.17k|    strm->state = (struct internal_state FAR *)s;
  444|  4.17k|    s->strm = strm;
  445|  4.17k|    s->status = INIT_STATE;     /* to pass state test in deflateReset() */
  ------------------
  |  |   58|  4.17k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  446|       |
  447|  4.17k|    s->wrap = wrap;
  448|  4.17k|    s->gzhead = Z_NULL;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  449|  4.17k|    s->w_bits = (uInt)windowBits;
  450|  4.17k|    s->w_size = 1 << s->w_bits;
  451|  4.17k|    s->w_mask = s->w_size - 1;
  452|       |
  453|  4.17k|    s->hash_bits = (uInt)memLevel + 7;
  454|  4.17k|    s->hash_size = 1 << s->hash_bits;
  455|  4.17k|    s->hash_mask = s->hash_size - 1;
  456|  4.17k|    s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   92|  4.17k|#define MIN_MATCH  3
  ------------------
                  s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   92|  4.17k|#define MIN_MATCH  3
  ------------------
  457|       |
  458|  4.17k|    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
  ------------------
  |  |  253|  4.17k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  459|  4.17k|    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
  ------------------
  |  |  253|  4.17k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  460|  4.17k|    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
  ------------------
  |  |  253|  4.17k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  461|       |
  462|  4.17k|    s->high_water = 0;      /* nothing written to s->window yet */
  463|       |
  464|  4.17k|    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
  465|       |
  466|       |    /* We overlay pending_buf and sym_buf. This works since the average size
  467|       |     * for length/distance pairs over any compressed block is assured to be 31
  468|       |     * bits or less.
  469|       |     *
  470|       |     * Analysis: The longest fixed codes are a length code of 8 bits plus 5
  471|       |     * extra bits, for lengths 131 to 257. The longest fixed distance codes are
  472|       |     * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest
  473|       |     * possible fixed-codes length/distance pair is then 31 bits total.
  474|       |     *
  475|       |     * sym_buf starts one-fourth of the way into pending_buf. So there are
  476|       |     * three bytes in sym_buf for every four bytes in pending_buf. Each symbol
  477|       |     * in sym_buf is three bytes -- two for the distance and one for the
  478|       |     * literal/length. As each symbol is consumed, the pointer to the next
  479|       |     * sym_buf value to read moves forward three bytes. From that symbol, up to
  480|       |     * 31 bits are written to pending_buf. The closest the written pending_buf
  481|       |     * bits gets to the next sym_buf symbol to read is just before the last
  482|       |     * code is written. At that time, 31*(n - 2) bits have been written, just
  483|       |     * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at
  484|       |     * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1
  485|       |     * symbols are written.) The closest the writing gets to what is unread is
  486|       |     * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and
  487|       |     * can range from 128 to 32768.
  488|       |     *
  489|       |     * Therefore, at a minimum, there are 142 bits of space between what is
  490|       |     * written and what is read in the overlain buffers, so the symbols cannot
  491|       |     * be overwritten by the compressed data. That space is actually 139 bits,
  492|       |     * due to the three-bit fixed-code block header.
  493|       |     *
  494|       |     * That covers the case where either Z_FIXED is specified, forcing fixed
  495|       |     * codes, or when the use of fixed codes is chosen, because that choice
  496|       |     * results in a smaller compressed block than dynamic codes. That latter
  497|       |     * condition then assures that the above analysis also covers all dynamic
  498|       |     * blocks. A dynamic-code block will only be chosen to be emitted if it has
  499|       |     * fewer bits than a fixed-code block would for the same set of symbols.
  500|       |     * Therefore its average symbol length is assured to be less than 31. So
  501|       |     * the compressed data for a dynamic block also cannot overwrite the
  502|       |     * symbols from which it is being constructed.
  503|       |     */
  504|       |
  505|  4.17k|    s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS);
  ------------------
  |  |  253|  4.17k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  506|  4.17k|    s->pending_buf_size = (ulg)s->lit_bufsize * 4;
  507|       |
  508|  4.17k|    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  8.34k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  8.34k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  8.34k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (508:9): [True: 0, False: 4.17k]
  |  Branch (508:32): [True: 0, False: 4.17k]
  |  Branch (508:53): [True: 0, False: 4.17k]
  ------------------
  509|  4.17k|        s->pending_buf == Z_NULL) {
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (509:9): [True: 0, False: 4.17k]
  ------------------
  510|      0|        s->status = FINISH_STATE;
  ------------------
  |  |   67|      0|#define FINISH_STATE 666    /* stream complete */
  ------------------
  511|      0|        strm->msg = ERR_MSG(Z_MEM_ERROR);
  ------------------
  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  ------------------
  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  ------------------
  ------------------
  512|      0|        deflateEnd (strm);
  513|      0|        return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  514|      0|    }
  515|       |#ifdef LIT_MEM
  516|       |    s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1));
  517|       |    s->l_buf = s->pending_buf + (s->lit_bufsize << 2);
  518|       |    s->sym_end = s->lit_bufsize - 1;
  519|       |#else
  520|  4.17k|    s->sym_buf = s->pending_buf + s->lit_bufsize;
  521|  4.17k|    s->sym_end = (s->lit_bufsize - 1) * 3;
  522|  4.17k|#endif
  523|       |    /* We avoid equality with lit_bufsize*3 because of wraparound at 64K
  524|       |     * on 16 bit machines and because stored blocks are restricted to
  525|       |     * 64K-1 bytes.
  526|       |     */
  527|       |
  528|  4.17k|    s->level = level;
  529|  4.17k|    s->strategy = strategy;
  530|  4.17k|    s->method = (Byte)method;
  531|       |
  532|  4.17k|    return deflateReset(strm);
  533|  4.17k|}
deflateSetDictionary:
  560|  4.17k|                                 uInt  dictLength) {
  561|  4.17k|    deflate_state *s;
  562|  4.17k|    uInt str, n;
  563|  4.17k|    int wrap;
  564|  4.17k|    unsigned avail;
  565|  4.17k|    z_const unsigned char *next;
  566|       |
  567|  4.17k|    if (deflateStateCheck(strm) || dictionary == Z_NULL)
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (567:9): [True: 0, False: 4.17k]
  |  Branch (567:36): [True: 0, False: 4.17k]
  ------------------
  568|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  569|  4.17k|    s = strm->state;
  570|  4.17k|    wrap = s->wrap;
  571|  4.17k|    if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
  ------------------
  |  |   58|  4.17k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (571:9): [True: 0, False: 4.17k]
  |  Branch (571:23): [True: 4.17k, False: 0]
  |  Branch (571:36): [True: 0, False: 4.17k]
  |  Branch (571:64): [True: 0, False: 4.17k]
  ------------------
  572|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  573|       |
  574|       |    /* when using zlib wrappers, compute Adler-32 for provided dictionary */
  575|  4.17k|    if (wrap == 1)
  ------------------
  |  Branch (575:9): [True: 4.17k, False: 0]
  ------------------
  576|  4.17k|        strm->adler = adler32(strm->adler, dictionary, dictLength);
  577|  4.17k|    s->wrap = 0;                    /* avoid computing Adler-32 in read_buf */
  578|       |
  579|       |    /* if dictionary would fill window, just replace the history */
  580|  4.17k|    if (dictLength >= s->w_size) {
  ------------------
  |  Branch (580:9): [True: 0, False: 4.17k]
  ------------------
  581|      0|        if (wrap == 0) {            /* already empty otherwise */
  ------------------
  |  Branch (581:13): [True: 0, False: 0]
  ------------------
  582|      0|            CLEAR_HASH(s);
  ------------------
  |  |  171|      0|    do { \
  |  |  172|      0|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|      0|#define NIL 0
  |  |  ------------------
  |  |  173|      0|        zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  ------------------
  |  |  |  |  218|      0|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|      0|        s->slid = 0; \
  |  |  175|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  583|      0|            s->strstart = 0;
  584|      0|            s->block_start = 0L;
  585|      0|            s->insert = 0;
  586|      0|        }
  587|      0|        dictionary += dictLength - s->w_size;  /* use the tail */
  588|      0|        dictLength = s->w_size;
  589|      0|    }
  590|       |
  591|       |    /* insert dictionary into window and hash */
  592|  4.17k|    avail = strm->avail_in;
  593|  4.17k|    next = strm->next_in;
  594|  4.17k|    strm->avail_in = dictLength;
  595|  4.17k|    strm->next_in = (z_const Bytef *)dictionary;
  596|  4.17k|    fill_window(s);
  597|  7.88k|    while (s->lookahead >= MIN_MATCH) {
  ------------------
  |  |   92|  7.88k|#define MIN_MATCH  3
  ------------------
  |  Branch (597:12): [True: 3.71k, False: 4.17k]
  ------------------
  598|  3.71k|        str = s->strstart;
  599|  3.71k|        n = s->lookahead - (MIN_MATCH-1);
  ------------------
  |  |   92|  3.71k|#define MIN_MATCH  3
  ------------------
  600|   350k|        do {
  601|   350k|            UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
  ------------------
  |  |  141|   350k|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  ------------------
  602|   350k|#ifndef FASTEST
  603|   350k|            s->prev[str & s->w_mask] = s->head[s->ins_h];
  604|   350k|#endif
  605|   350k|            s->head[s->ins_h] = (Pos)str;
  606|   350k|            str++;
  607|   350k|        } while (--n);
  ------------------
  |  Branch (607:18): [True: 346k, False: 3.71k]
  ------------------
  608|  3.71k|        s->strstart = str;
  609|  3.71k|        s->lookahead = MIN_MATCH-1;
  ------------------
  |  |   92|  3.71k|#define MIN_MATCH  3
  ------------------
  610|  3.71k|        fill_window(s);
  611|  3.71k|    }
  612|  4.17k|    s->strstart += s->lookahead;
  613|  4.17k|    s->block_start = (long)s->strstart;
  614|  4.17k|    s->insert = s->lookahead;
  615|  4.17k|    s->lookahead = 0;
  616|  4.17k|    s->match_length = s->prev_length = MIN_MATCH-1;
  ------------------
  |  |   92|  4.17k|#define MIN_MATCH  3
  ------------------
  617|  4.17k|    s->match_available = 0;
  618|  4.17k|    strm->next_in = next;
  619|  4.17k|    strm->avail_in = avail;
  620|  4.17k|    s->wrap = wrap;
  621|  4.17k|    return Z_OK;
  ------------------
  |  |  181|  4.17k|#define Z_OK            0
  ------------------
  622|  4.17k|}
deflateResetKeep:
  644|  4.17k|int ZEXPORT deflateResetKeep(z_streamp strm) {
  645|  4.17k|    deflate_state *s;
  646|       |
  647|  4.17k|    if (deflateStateCheck(strm)) {
  ------------------
  |  Branch (647:9): [True: 0, False: 4.17k]
  ------------------
  648|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  649|      0|    }
  650|       |
  651|  4.17k|    strm->total_in = strm->total_out = 0;
  652|  4.17k|    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  653|  4.17k|    strm->data_type = Z_UNKNOWN;
  ------------------
  |  |  210|  4.17k|#define Z_UNKNOWN  2
  ------------------
  654|       |
  655|  4.17k|    s = (deflate_state *)strm->state;
  656|  4.17k|    s->pending = 0;
  657|  4.17k|    s->pending_out = s->pending_buf;
  658|       |
  659|  4.17k|    if (s->wrap < 0) {
  ------------------
  |  Branch (659:9): [True: 0, False: 4.17k]
  ------------------
  660|      0|        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
  661|      0|    }
  662|  4.17k|    s->status =
  663|  4.17k|#ifdef GZIP
  664|  4.17k|        s->wrap == 2 ? GZIP_STATE :
  ------------------
  |  |   60|      0|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (664:9): [True: 0, False: 4.17k]
  ------------------
  665|  4.17k|#endif
  666|  4.17k|        INIT_STATE;
  ------------------
  |  |   58|  8.34k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  667|  4.17k|    strm->adler =
  668|  4.17k|#ifdef GZIP
  669|  4.17k|        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (669:9): [True: 0, False: 4.17k]
  ------------------
  670|  4.17k|#endif
  671|  4.17k|        adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  672|  4.17k|    s->last_flush = -2;
  673|       |
  674|  4.17k|    _tr_init(s);
  675|       |
  676|  4.17k|    return Z_OK;
  ------------------
  |  |  181|  4.17k|#define Z_OK            0
  ------------------
  677|  4.17k|}
deflateReset:
  704|  4.17k|int ZEXPORT deflateReset(z_streamp strm) {
  705|  4.17k|    int ret;
  706|       |
  707|  4.17k|    ret = deflateResetKeep(strm);
  708|  4.17k|    if (ret == Z_OK)
  ------------------
  |  |  181|  4.17k|#define Z_OK            0
  ------------------
  |  Branch (708:9): [True: 4.17k, False: 0]
  ------------------
  709|  4.17k|        lm_init(strm->state);
  710|  4.17k|    return ret;
  711|  4.17k|}
deflateBound_z:
  856|  4.17k|z_size_t ZEXPORT deflateBound_z(z_streamp strm, z_size_t sourceLen) {
  857|  4.17k|    deflate_state *s;
  858|  4.17k|    z_size_t fixedlen, storelen, wraplen, bound;
  859|       |
  860|       |    /* upper bound for fixed blocks with 9-bit literals and length 255
  861|       |       (memLevel == 2, which is the lowest that may not use stored blocks) --
  862|       |       ~13% overhead plus a small constant */
  863|  4.17k|    fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) +
  864|  4.17k|               (sourceLen >> 9) + 4;
  865|  4.17k|    if (fixedlen < sourceLen)
  ------------------
  |  Branch (865:9): [True: 0, False: 4.17k]
  ------------------
  866|      0|        fixedlen = (z_size_t)-1;
  867|       |
  868|       |    /* upper bound for stored blocks with length 127 (memLevel == 1) --
  869|       |       ~4% overhead plus a small constant */
  870|  4.17k|    storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) +
  871|  4.17k|               (sourceLen >> 11) + 7;
  872|  4.17k|    if (storelen < sourceLen)
  ------------------
  |  Branch (872:9): [True: 0, False: 4.17k]
  ------------------
  873|      0|        storelen = (z_size_t)-1;
  874|       |
  875|       |    /* if can't get parameters, return larger bound plus a wrapper */
  876|  4.17k|    if (deflateStateCheck(strm)) {
  ------------------
  |  Branch (876:9): [True: 0, False: 4.17k]
  ------------------
  877|      0|        bound = fixedlen > storelen ? fixedlen : storelen;
  ------------------
  |  Branch (877:17): [True: 0, False: 0]
  ------------------
  878|      0|        return bound + 18 < bound ? (z_size_t)-1 : bound + 18;
  ------------------
  |  Branch (878:16): [True: 0, False: 0]
  ------------------
  879|      0|    }
  880|       |
  881|       |    /* compute wrapper length */
  882|  4.17k|    s = strm->state;
  883|  4.17k|    switch (s->wrap < 0 ? -s->wrap : s->wrap) {
  ------------------
  |  Branch (883:13): [True: 0, False: 4.17k]
  ------------------
  884|      0|    case 0:                                 /* raw deflate */
  ------------------
  |  Branch (884:5): [True: 0, False: 4.17k]
  ------------------
  885|      0|        wraplen = 0;
  886|      0|        break;
  887|  4.17k|    case 1:                                 /* zlib wrapper */
  ------------------
  |  Branch (887:5): [True: 4.17k, False: 0]
  ------------------
  888|  4.17k|        wraplen = 6 + (s->strstart ? 4 : 0);
  ------------------
  |  Branch (888:24): [True: 3.89k, False: 277]
  ------------------
  889|  4.17k|        break;
  890|      0|#ifdef GZIP
  891|      0|    case 2:                                 /* gzip wrapper */
  ------------------
  |  Branch (891:5): [True: 0, False: 4.17k]
  ------------------
  892|      0|        wraplen = 18;
  893|      0|        if (s->gzhead != Z_NULL) {          /* user-supplied gzip header */
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (893:13): [True: 0, False: 0]
  ------------------
  894|      0|            Bytef *str;
  895|      0|            if (s->gzhead->extra != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (895:17): [True: 0, False: 0]
  ------------------
  896|      0|                wraplen += 2 + s->gzhead->extra_len;
  897|      0|            str = s->gzhead->name;
  898|      0|            if (str != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (898:17): [True: 0, False: 0]
  ------------------
  899|      0|                do {
  900|      0|                    wraplen++;
  901|      0|                } while (*str++);
  ------------------
  |  Branch (901:26): [True: 0, False: 0]
  ------------------
  902|      0|            str = s->gzhead->comment;
  903|      0|            if (str != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (903:17): [True: 0, False: 0]
  ------------------
  904|      0|                do {
  905|      0|                    wraplen++;
  906|      0|                } while (*str++);
  ------------------
  |  Branch (906:26): [True: 0, False: 0]
  ------------------
  907|      0|            if (s->gzhead->hcrc)
  ------------------
  |  Branch (907:17): [True: 0, False: 0]
  ------------------
  908|      0|                wraplen += 2;
  909|      0|        }
  910|      0|        break;
  911|      0|#endif
  912|      0|    default:                                /* for compiler happiness */
  ------------------
  |  Branch (912:5): [True: 0, False: 4.17k]
  ------------------
  913|      0|        wraplen = 18;
  914|  4.17k|    }
  915|       |
  916|       |    /* if not default parameters, return one of the conservative bounds */
  917|  4.17k|    if (s->w_bits != 15 || s->hash_bits != 8 + 7) {
  ------------------
  |  Branch (917:9): [True: 3.57k, False: 594]
  |  Branch (917:28): [True: 530, False: 64]
  ------------------
  918|  4.10k|        bound = s->w_bits <= s->hash_bits && s->level ? fixedlen :
  ------------------
  |  Branch (918:17): [True: 1.98k, False: 2.12k]
  |  Branch (918:46): [True: 1.98k, False: 0]
  ------------------
  919|  4.10k|                                                        storelen;
  920|  4.10k|        return bound + wraplen < bound ? (z_size_t)-1 : bound + wraplen;
  ------------------
  |  Branch (920:16): [True: 0, False: 4.10k]
  ------------------
  921|  4.10k|    }
  922|       |
  923|       |    /* default settings: return tight bound for that case -- ~0.03% overhead
  924|       |       plus a small constant */
  925|     64|    bound = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
  926|     64|            (sourceLen >> 25) + 13 - 6 + wraplen;
  927|     64|    return bound < sourceLen ? (z_size_t)-1 : bound;
  ------------------
  |  Branch (927:12): [True: 0, False: 64]
  ------------------
  928|  4.17k|}
deflateBound:
  929|  4.17k|uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) {
  930|  4.17k|    z_size_t bound = deflateBound_z(strm, sourceLen);
  931|  4.17k|    return (uLong)bound != bound ? (uLong)-1 : (uLong)bound;
  ------------------
  |  Branch (931:12): [True: 0, False: 4.17k]
  ------------------
  932|  4.17k|}
deflate:
  981|  4.17k|int ZEXPORT deflate(z_streamp strm, int flush) {
  982|  4.17k|    int old_flush; /* value of flush param for previous deflate call */
  983|  4.17k|    deflate_state *s;
  984|       |
  985|  4.17k|    if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {
  ------------------
  |  |  177|  8.34k|#define Z_BLOCK         5
  ------------------
  |  Branch (985:9): [True: 0, False: 4.17k]
  |  Branch (985:36): [True: 0, False: 4.17k]
  |  Branch (985:55): [True: 0, False: 4.17k]
  ------------------
  986|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  987|      0|    }
  988|  4.17k|    s = strm->state;
  989|       |
  990|  4.17k|    if (strm->next_out == Z_NULL ||
  ------------------
  |  |  216|  8.34k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (990:9): [True: 0, False: 4.17k]
  ------------------
  991|  4.17k|        (strm->avail_in != 0 && strm->next_in == Z_NULL) ||
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (991:10): [True: 4.17k, False: 0]
  |  Branch (991:33): [True: 0, False: 4.17k]
  ------------------
  992|  4.17k|        (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |   67|  8.34k|#define FINISH_STATE 666    /* stream complete */
  ------------------
                      (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |  176|      0|#define Z_FINISH        4
  ------------------
  |  Branch (992:10): [True: 0, False: 4.17k]
  |  Branch (992:39): [True: 0, False: 0]
  ------------------
  993|      0|        ERR_RETURN(strm, Z_STREAM_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|      0|    }
  995|  4.17k|    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (995:9): [True: 0, False: 4.17k]
  ------------------
  996|       |
  997|  4.17k|    old_flush = s->last_flush;
  998|  4.17k|    s->last_flush = flush;
  999|       |
 1000|       |    /* Flush as much pending output as possible */
 1001|  4.17k|    if (s->pending != 0) {
  ------------------
  |  Branch (1001:9): [True: 0, False: 4.17k]
  ------------------
 1002|      0|        flush_pending(strm);
 1003|      0|        if (strm->avail_out == 0) {
  ------------------
  |  Branch (1003:13): [True: 0, False: 0]
  ------------------
 1004|       |            /* Since avail_out is 0, deflate will be called again with
 1005|       |             * more output space, but possibly with both pending and
 1006|       |             * avail_in equal to zero. There won't be anything to do,
 1007|       |             * but this is not an error situation so make sure we
 1008|       |             * return OK instead of BUF_ERROR at next call of deflate:
 1009|       |             */
 1010|      0|            s->last_flush = -1;
 1011|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1012|      0|        }
 1013|       |
 1014|       |    /* Make sure there is something to do and avoid duplicate consecutive
 1015|       |     * flushes. For repeated and useless calls with Z_FINISH, we keep
 1016|       |     * returning Z_STREAM_END instead of Z_BUF_ERROR.
 1017|       |     */
 1018|  4.17k|    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|      0|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                  } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  4.17k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1018:16): [True: 0, False: 4.17k]
  |  Branch (1018:39): [True: 0, False: 0]
  ------------------
 1019|      0|               flush != Z_FINISH) {
  ------------------
  |  |  176|      0|#define Z_FINISH        4
  ------------------
  |  Branch (1019:16): [True: 0, False: 0]
  ------------------
 1020|      0|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1021|      0|    }
 1022|       |
 1023|       |    /* User must not provide more input after the first FINISH: */
 1024|  4.17k|    if (s->status == FINISH_STATE && strm->avail_in != 0) {
  ------------------
  |  |   67|  8.34k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (1024:9): [True: 0, False: 4.17k]
  |  Branch (1024:38): [True: 0, False: 0]
  ------------------
 1025|      0|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1026|      0|    }
 1027|       |
 1028|       |    /* Write the header */
 1029|  4.17k|    if (s->status == INIT_STATE && s->wrap == 0)
  ------------------
  |  |   58|  8.34k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1029:9): [True: 4.17k, False: 0]
  |  Branch (1029:36): [True: 0, False: 4.17k]
  ------------------
 1030|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1031|  4.17k|    if (s->status == INIT_STATE) {
  ------------------
  |  |   58|  4.17k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1031:9): [True: 4.17k, False: 0]
  ------------------
 1032|       |        /* zlib header */
 1033|  4.17k|        uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
  ------------------
  |  |  213|  4.17k|#define Z_DEFLATED   8
  ------------------
 1034|  4.17k|        uInt level_flags;
 1035|       |
 1036|  4.17k|        if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
  ------------------
  |  |  201|  8.34k|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1036:13): [True: 2.58k, False: 1.59k]
  |  Branch (1036:46): [True: 0, False: 1.59k]
  ------------------
 1037|  2.58k|            level_flags = 0;
 1038|  1.59k|        else if (s->level < 6)
  ------------------
  |  Branch (1038:18): [True: 831, False: 759]
  ------------------
 1039|    831|            level_flags = 1;
 1040|    759|        else if (s->level == 6)
  ------------------
  |  Branch (1040:18): [True: 598, False: 161]
  ------------------
 1041|    598|            level_flags = 2;
 1042|    161|        else
 1043|    161|            level_flags = 3;
 1044|  4.17k|        header |= (level_flags << 6);
 1045|  4.17k|        if (s->strstart != 0) header |= PRESET_DICT;
  ------------------
  |  |   96|  3.89k|#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
  ------------------
  |  Branch (1045:13): [True: 3.89k, False: 277]
  ------------------
 1046|  4.17k|        header += 31 - (header % 31);
 1047|       |
 1048|  4.17k|        putShortMSB(s, header);
 1049|       |
 1050|       |        /* Save the adler32 of the preset dictionary: */
 1051|  4.17k|        if (s->strstart != 0) {
  ------------------
  |  Branch (1051:13): [True: 3.89k, False: 277]
  ------------------
 1052|  3.89k|            putShortMSB(s, (uInt)(strm->adler >> 16));
 1053|  3.89k|            putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1054|  3.89k|        }
 1055|  4.17k|        strm->adler = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1056|  4.17k|        s->status = BUSY_STATE;
  ------------------
  |  |   66|  4.17k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1057|       |
 1058|       |        /* Compression must start with an empty pending buffer */
 1059|  4.17k|        flush_pending(strm);
 1060|  4.17k|        if (s->pending != 0) {
  ------------------
  |  Branch (1060:13): [True: 0, False: 4.17k]
  ------------------
 1061|      0|            s->last_flush = -1;
 1062|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1063|      0|        }
 1064|  4.17k|    }
 1065|  4.17k|#ifdef GZIP
 1066|  4.17k|    if (s->status == GZIP_STATE) {
  ------------------
  |  |   60|  4.17k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (1066:9): [True: 0, False: 4.17k]
  ------------------
 1067|       |        /* gzip header */
 1068|      0|        strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1069|      0|        put_byte(s, 31);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1070|      0|        put_byte(s, 139);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1071|      0|        put_byte(s, 8);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1072|      0|        if (s->gzhead == Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1072:13): [True: 0, False: 0]
  ------------------
 1073|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1074|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1075|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1076|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1077|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1078|      0|            put_byte(s, s->level == 9 ? 2 :
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1079|      0|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1080|      0|                      4 : 0));
 1081|      0|            put_byte(s, OS_CODE);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1082|      0|            s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1083|       |
 1084|       |            /* Compression must start with an empty pending buffer */
 1085|      0|            flush_pending(strm);
 1086|      0|            if (s->pending != 0) {
  ------------------
  |  Branch (1086:17): [True: 0, False: 0]
  ------------------
 1087|      0|                s->last_flush = -1;
 1088|      0|                return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1089|      0|            }
 1090|      0|        }
 1091|      0|        else {
 1092|      0|            put_byte(s, (s->gzhead->text ? 1 : 0) +
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1093|      0|                     (s->gzhead->hcrc ? 2 : 0) +
 1094|      0|                     (s->gzhead->extra == Z_NULL ? 0 : 4) +
 1095|      0|                     (s->gzhead->name == Z_NULL ? 0 : 8) +
 1096|      0|                     (s->gzhead->comment == Z_NULL ? 0 : 16)
 1097|      0|                     );
 1098|      0|            put_byte(s, (Byte)(s->gzhead->time & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1099|      0|            put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1100|      0|            put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1101|      0|            put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1102|      0|            put_byte(s, s->level == 9 ? 2 :
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1103|      0|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1104|      0|                      4 : 0));
 1105|      0|            put_byte(s, s->gzhead->os & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1106|      0|            if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1106:17): [True: 0, False: 0]
  ------------------
 1107|      0|                put_byte(s, s->gzhead->extra_len & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1108|      0|                put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1109|      0|            }
 1110|      0|            if (s->gzhead->hcrc)
  ------------------
  |  Branch (1110:17): [True: 0, False: 0]
  ------------------
 1111|      0|                strm->adler = crc32_z(strm->adler, s->pending_buf,
 1112|      0|                                      s->pending);
 1113|      0|            s->gzindex = 0;
 1114|      0|            s->status = EXTRA_STATE;
  ------------------
  |  |   62|      0|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
 1115|      0|        }
 1116|      0|    }
 1117|  4.17k|    if (s->status == EXTRA_STATE) {
  ------------------
  |  |   62|  4.17k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (1117:9): [True: 0, False: 4.17k]
  ------------------
 1118|      0|        if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1118:13): [True: 0, False: 0]
  ------------------
 1119|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1120|      0|            ulg left = (s->gzhead->extra_len & 0xffff) - s->gzindex;
 1121|      0|            while (s->pending + left > s->pending_buf_size) {
  ------------------
  |  Branch (1121:20): [True: 0, False: 0]
  ------------------
 1122|      0|                ulg copy = s->pending_buf_size - s->pending;
 1123|      0|                zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  216|      0|#    define zmemcpy memcpy
  ------------------
 1124|      0|                        s->gzhead->extra + s->gzindex, copy);
 1125|      0|                s->pending = s->pending_buf_size;
 1126|      0|                HCRC_UPDATE(beg);
  ------------------
  |  |  974|      0|    do { \
  |  |  975|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (975:13): [True: 0, False: 0]
  |  |  |  Branch (975:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  976|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  977|      0|                                  s->pending - (beg)); \
  |  |  978|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (978:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1127|      0|                s->gzindex += copy;
 1128|      0|                flush_pending(strm);
 1129|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1129:21): [True: 0, False: 0]
  ------------------
 1130|      0|                    s->last_flush = -1;
 1131|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1132|      0|                }
 1133|      0|                beg = 0;
 1134|      0|                left -= copy;
 1135|      0|            }
 1136|      0|            zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  216|      0|#    define zmemcpy memcpy
  ------------------
 1137|      0|                    s->gzhead->extra + s->gzindex, left);
 1138|      0|            s->pending += left;
 1139|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  974|      0|    do { \
  |  |  975|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (975:13): [True: 0, False: 0]
  |  |  |  Branch (975:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  976|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  977|      0|                                  s->pending - (beg)); \
  |  |  978|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (978:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1140|      0|            s->gzindex = 0;
 1141|      0|        }
 1142|      0|        s->status = NAME_STATE;
  ------------------
  |  |   63|      0|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
 1143|      0|    }
 1144|  4.17k|    if (s->status == NAME_STATE) {
  ------------------
  |  |   63|  4.17k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (1144:9): [True: 0, False: 4.17k]
  ------------------
 1145|      0|        if (s->gzhead->name != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1145:13): [True: 0, False: 0]
  ------------------
 1146|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1147|      0|            int val;
 1148|      0|            do {
 1149|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1149:21): [True: 0, False: 0]
  ------------------
 1150|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  974|      0|    do { \
  |  |  975|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (975:13): [True: 0, False: 0]
  |  |  |  Branch (975:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  976|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  977|      0|                                  s->pending - (beg)); \
  |  |  978|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (978:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1151|      0|                    flush_pending(strm);
 1152|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1152:25): [True: 0, False: 0]
  ------------------
 1153|      0|                        s->last_flush = -1;
 1154|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1155|      0|                    }
 1156|      0|                    beg = 0;
 1157|      0|                }
 1158|      0|                val = s->gzhead->name[s->gzindex++];
 1159|      0|                put_byte(s, val);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1160|      0|            } while (val != 0);
  ------------------
  |  Branch (1160:22): [True: 0, False: 0]
  ------------------
 1161|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  974|      0|    do { \
  |  |  975|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (975:13): [True: 0, False: 0]
  |  |  |  Branch (975:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  976|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  977|      0|                                  s->pending - (beg)); \
  |  |  978|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (978:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1162|      0|            s->gzindex = 0;
 1163|      0|        }
 1164|      0|        s->status = COMMENT_STATE;
  ------------------
  |  |   64|      0|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
 1165|      0|    }
 1166|  4.17k|    if (s->status == COMMENT_STATE) {
  ------------------
  |  |   64|  4.17k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (1166:9): [True: 0, False: 4.17k]
  ------------------
 1167|      0|        if (s->gzhead->comment != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1167:13): [True: 0, False: 0]
  ------------------
 1168|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1169|      0|            int val;
 1170|      0|            do {
 1171|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1171:21): [True: 0, False: 0]
  ------------------
 1172|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  974|      0|    do { \
  |  |  975|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (975:13): [True: 0, False: 0]
  |  |  |  Branch (975:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  976|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  977|      0|                                  s->pending - (beg)); \
  |  |  978|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (978:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1173|      0|                    flush_pending(strm);
 1174|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1174:25): [True: 0, False: 0]
  ------------------
 1175|      0|                        s->last_flush = -1;
 1176|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1177|      0|                    }
 1178|      0|                    beg = 0;
 1179|      0|                }
 1180|      0|                val = s->gzhead->comment[s->gzindex++];
 1181|      0|                put_byte(s, val);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1182|      0|            } while (val != 0);
  ------------------
  |  Branch (1182:22): [True: 0, False: 0]
  ------------------
 1183|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  974|      0|    do { \
  |  |  975|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (975:13): [True: 0, False: 0]
  |  |  |  Branch (975:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  976|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  977|      0|                                  s->pending - (beg)); \
  |  |  978|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (978:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1184|      0|        }
 1185|      0|        s->status = HCRC_STATE;
  ------------------
  |  |   65|      0|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
 1186|      0|    }
 1187|  4.17k|    if (s->status == HCRC_STATE) {
  ------------------
  |  |   65|  4.17k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (1187:9): [True: 0, False: 4.17k]
  ------------------
 1188|      0|        if (s->gzhead->hcrc) {
  ------------------
  |  Branch (1188:13): [True: 0, False: 0]
  ------------------
 1189|      0|            if (s->pending + 2 > s->pending_buf_size) {
  ------------------
  |  Branch (1189:17): [True: 0, False: 0]
  ------------------
 1190|      0|                flush_pending(strm);
 1191|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1191:21): [True: 0, False: 0]
  ------------------
 1192|      0|                    s->last_flush = -1;
 1193|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1194|      0|                }
 1195|      0|            }
 1196|      0|            put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1197|      0|            put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1198|      0|            strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1199|      0|        }
 1200|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1201|       |
 1202|       |        /* Compression must start with an empty pending buffer */
 1203|      0|        flush_pending(strm);
 1204|      0|        if (s->pending != 0) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 0]
  ------------------
 1205|      0|            s->last_flush = -1;
 1206|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1207|      0|        }
 1208|      0|    }
 1209|  4.17k|#endif
 1210|       |
 1211|       |    /* Start a new block or continue the current one.
 1212|       |     */
 1213|  4.17k|    if (strm->avail_in != 0 || s->lookahead != 0 ||
  ------------------
  |  Branch (1213:9): [True: 4.17k, False: 0]
  |  Branch (1213:32): [True: 0, False: 0]
  ------------------
 1214|  4.17k|        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |  172|      0|#define Z_NO_FLUSH      0
  ------------------
                      (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |   67|      0|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (1214:10): [True: 0, False: 0]
  |  Branch (1214:33): [True: 0, False: 0]
  ------------------
 1215|  4.17k|        block_state bstate;
 1216|       |
 1217|  4.17k|        bstate = s->level == 0 ? deflate_stored(s, flush) :
  ------------------
  |  Branch (1217:18): [True: 0, False: 4.17k]
  ------------------
 1218|  4.17k|                 s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
  ------------------
  |  |  201|  4.17k|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1218:18): [True: 1.08k, False: 3.08k]
  ------------------
 1219|  4.17k|                 s->strategy == Z_RLE ? deflate_rle(s, flush) :
  ------------------
  |  |  202|  3.08k|#define Z_RLE                 3
  ------------------
  |  Branch (1219:18): [True: 903, False: 2.18k]
  ------------------
 1220|  3.08k|                 (*(configuration_table[s->level].func))(s, flush);
 1221|       |
 1222|  4.17k|        if (bstate == finish_started || bstate == finish_done) {
  ------------------
  |  Branch (1222:13): [True: 0, False: 4.17k]
  |  Branch (1222:41): [True: 4.17k, False: 0]
  ------------------
 1223|  4.17k|            s->status = FINISH_STATE;
  ------------------
  |  |   67|  4.17k|#define FINISH_STATE 666    /* stream complete */
  ------------------
 1224|  4.17k|        }
 1225|  4.17k|        if (bstate == need_more || bstate == finish_started) {
  ------------------
  |  Branch (1225:13): [True: 0, False: 4.17k]
  |  Branch (1225:36): [True: 0, False: 4.17k]
  ------------------
 1226|      0|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1226:17): [True: 0, False: 0]
  ------------------
 1227|      0|                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
 1228|      0|            }
 1229|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1230|       |            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
 1231|       |             * of deflate should use the same flush parameter to make sure
 1232|       |             * that the flush is complete. So we don't have to output an
 1233|       |             * empty block here, this will be done at next call. This also
 1234|       |             * ensures that for a very small output buffer, we emit at most
 1235|       |             * one empty block.
 1236|       |             */
 1237|      0|        }
 1238|  4.17k|        if (bstate == block_done) {
  ------------------
  |  Branch (1238:13): [True: 0, False: 4.17k]
  ------------------
 1239|      0|            if (flush == Z_PARTIAL_FLUSH) {
  ------------------
  |  |  173|      0|#define Z_PARTIAL_FLUSH 1
  ------------------
  |  Branch (1239:17): [True: 0, False: 0]
  ------------------
 1240|      0|                _tr_align(s);
 1241|      0|            } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
  ------------------
  |  |  177|      0|#define Z_BLOCK         5
  ------------------
  |  Branch (1241:24): [True: 0, False: 0]
  ------------------
 1242|      0|                _tr_stored_block(s, (char*)0, 0L, 0);
 1243|       |                /* For a full flush, this empty block will be recognized
 1244|       |                 * as a special marker by inflate_sync().
 1245|       |                 */
 1246|      0|                if (flush == Z_FULL_FLUSH) {
  ------------------
  |  |  175|      0|#define Z_FULL_FLUSH    3
  ------------------
  |  Branch (1246:21): [True: 0, False: 0]
  ------------------
 1247|      0|                    CLEAR_HASH(s);             /* forget history */
  ------------------
  |  |  171|      0|    do { \
  |  |  172|      0|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|      0|#define NIL 0
  |  |  ------------------
  |  |  173|      0|        zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  ------------------
  |  |  |  |  218|      0|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|      0|        s->slid = 0; \
  |  |  175|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1248|      0|                    if (s->lookahead == 0) {
  ------------------
  |  Branch (1248:25): [True: 0, False: 0]
  ------------------
 1249|      0|                        s->strstart = 0;
 1250|      0|                        s->block_start = 0L;
 1251|      0|                        s->insert = 0;
 1252|      0|                    }
 1253|      0|                }
 1254|      0|            }
 1255|      0|            flush_pending(strm);
 1256|      0|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1256:17): [True: 0, False: 0]
  ------------------
 1257|      0|              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
 1258|      0|              return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1259|      0|            }
 1260|      0|        }
 1261|  4.17k|    }
 1262|       |
 1263|  4.17k|    if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  176|  4.17k|#define Z_FINISH        4
  ------------------
                  if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  |  Branch (1263:9): [True: 0, False: 4.17k]
  ------------------
 1264|  4.17k|    if (s->wrap <= 0) return Z_STREAM_END;
  ------------------
  |  |  182|      0|#define Z_STREAM_END    1
  ------------------
  |  Branch (1264:9): [True: 0, False: 4.17k]
  ------------------
 1265|       |
 1266|       |    /* Write the trailer */
 1267|  4.17k|#ifdef GZIP
 1268|  4.17k|    if (s->wrap == 2) {
  ------------------
  |  Branch (1268:9): [True: 0, False: 4.17k]
  ------------------
 1269|      0|        put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1270|      0|        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1271|      0|        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1272|      0|        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1273|      0|        put_byte(s, (Byte)(strm->total_in & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1274|      0|        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1275|      0|        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1276|      0|        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1277|      0|    }
 1278|  4.17k|    else
 1279|  4.17k|#endif
 1280|  4.17k|    {
 1281|  4.17k|        putShortMSB(s, (uInt)(strm->adler >> 16));
 1282|  4.17k|        putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1283|  4.17k|    }
 1284|  4.17k|    flush_pending(strm);
 1285|       |    /* If avail_out is zero, the application will call deflate again
 1286|       |     * to flush the rest.
 1287|       |     */
 1288|  4.17k|    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
  ------------------
  |  Branch (1288:9): [True: 4.17k, False: 0]
  ------------------
 1289|  4.17k|    return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
                  return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  182|  4.17k|#define Z_STREAM_END    1
  ------------------
  |  Branch (1289:12): [True: 0, False: 4.17k]
  ------------------
 1290|  4.17k|}
deflateEnd:
 1293|  4.17k|int ZEXPORT deflateEnd(z_streamp strm) {
 1294|  4.17k|    int status;
 1295|       |
 1296|  4.17k|    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (1296:9): [True: 0, False: 4.17k]
  ------------------
 1297|       |
 1298|  4.17k|    status = strm->state->status;
 1299|       |
 1300|       |    /* Deallocate in reverse order of allocations: */
 1301|  4.17k|    TRY_FREE(strm, strm->state->pending_buf);
  ------------------
  |  |  255|  4.17k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  4.17k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 4.17k, False: 0]
  |  |  ------------------
  ------------------
 1302|  4.17k|    TRY_FREE(strm, strm->state->head);
  ------------------
  |  |  255|  4.17k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  4.17k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 4.17k, False: 0]
  |  |  ------------------
  ------------------
 1303|  4.17k|    TRY_FREE(strm, strm->state->prev);
  ------------------
  |  |  255|  4.17k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  4.17k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 4.17k, False: 0]
  |  |  ------------------
  ------------------
 1304|  4.17k|    TRY_FREE(strm, strm->state->window);
  ------------------
  |  |  255|  4.17k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  4.17k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 4.17k, False: 0]
  |  |  ------------------
  ------------------
 1305|       |
 1306|  4.17k|    ZFREE(strm, strm->state);
  ------------------
  |  |  254|  4.17k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1307|  4.17k|    strm->state = Z_NULL;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1308|       |
 1309|  4.17k|    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
  ------------------
  |  |   66|  4.17k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
                  return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
                  return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
  ------------------
  |  |  181|  4.17k|#define Z_OK            0
  ------------------
  |  Branch (1309:12): [True: 0, False: 4.17k]
  ------------------
 1310|  4.17k|}
deflate.c:deflateStateCheck:
  538|  20.8k|local int deflateStateCheck(z_streamp strm) {
  539|  20.8k|    deflate_state *s;
  540|  20.8k|    if (strm == Z_NULL ||
  ------------------
  |  |  216|  41.7k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (540:9): [True: 0, False: 20.8k]
  ------------------
  541|  20.8k|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (541:9): [True: 0, False: 20.8k]
  |  Branch (541:42): [True: 0, False: 20.8k]
  ------------------
  542|      0|        return 1;
  543|  20.8k|    s = strm->state;
  544|  20.8k|    if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |  216|  41.7k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |   58|  41.7k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (544:9): [True: 0, False: 20.8k]
  |  Branch (544:24): [True: 0, False: 20.8k]
  |  Branch (544:44): [True: 4.17k, False: 16.6k]
  ------------------
  545|  4.17k|#ifdef GZIP
  546|  4.17k|                                           s->status != GZIP_STATE &&
  ------------------
  |  |   60|  25.0k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (546:44): [True: 4.17k, False: 0]
  ------------------
  547|  4.17k|#endif
  548|  4.17k|                                           s->status != EXTRA_STATE &&
  ------------------
  |  |   62|  25.0k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (548:44): [True: 4.17k, False: 0]
  ------------------
  549|  4.17k|                                           s->status != NAME_STATE &&
  ------------------
  |  |   63|  25.0k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (549:44): [True: 4.17k, False: 0]
  ------------------
  550|  4.17k|                                           s->status != COMMENT_STATE &&
  ------------------
  |  |   64|  25.0k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (550:44): [True: 4.17k, False: 0]
  ------------------
  551|  4.17k|                                           s->status != HCRC_STATE &&
  ------------------
  |  |   65|  25.0k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (551:44): [True: 4.17k, False: 0]
  ------------------
  552|  4.17k|                                           s->status != BUSY_STATE &&
  ------------------
  |  |   66|  25.0k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
  |  Branch (552:44): [True: 4.17k, False: 0]
  ------------------
  553|  4.17k|                                           s->status != FINISH_STATE))
  ------------------
  |  |   67|  4.17k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (553:44): [True: 0, False: 4.17k]
  ------------------
  554|      0|        return 1;
  555|  20.8k|    return 0;
  556|  20.8k|}
deflate.c:fill_window:
  252|   287k|local void fill_window(deflate_state *s) {
  253|   287k|    unsigned n;
  254|   287k|    unsigned more;    /* Amount of free space at the end of the window. */
  255|   287k|    uInt wsize = s->w_size;
  256|       |
  257|   287k|    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
  258|       |
  259|   287k|    do {
  260|   287k|        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
  261|       |
  262|       |        /* Deal with !@#$% 64K limit: */
  263|       |#ifdef _MSC_VER
  264|       |#pragma warning(push)
  265|       |#pragma warning(disable: 4127)
  266|       |#endif
  267|   287k|        if (sizeof(int) <= 2) {
  ------------------
  |  Branch (267:13): [Folded, False: 287k]
  ------------------
  268|       |#ifdef _MSC_VER
  269|       |#pragma warning(pop)
  270|       |#endif
  271|      0|            if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
  ------------------
  |  Branch (271:17): [True: 0, False: 0]
  |  Branch (271:30): [True: 0, False: 0]
  |  Branch (271:50): [True: 0, False: 0]
  ------------------
  272|      0|                more = wsize;
  273|       |
  274|      0|            } else if (more == (unsigned)(-1)) {
  ------------------
  |  Branch (274:24): [True: 0, False: 0]
  ------------------
  275|       |                /* Very unlikely, but possible on 16 bit machine if
  276|       |                 * strstart == 0 && lookahead == 1 (input done a byte at time)
  277|       |                 */
  278|      0|                more--;
  279|      0|            }
  280|      0|        }
  281|       |
  282|       |        /* If the window is almost full and there is insufficient lookahead,
  283|       |         * move the upper half to the lower one to make room in the upper half.
  284|       |         */
  285|   287k|        if (s->strstart >= wsize + MAX_DIST(s)) {
  ------------------
  |  |  301|   287k|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|   287k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   287k|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|   287k|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (285:13): [True: 19.2k, False: 268k]
  ------------------
  286|       |
  287|  19.2k|            zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more);
  ------------------
  |  |  216|  19.2k|#    define zmemcpy memcpy
  ------------------
  288|  19.2k|            s->match_start -= wsize;
  289|  19.2k|            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
  290|  19.2k|            s->block_start -= (long) wsize;
  291|  19.2k|            if (s->insert > s->strstart)
  ------------------
  |  Branch (291:17): [True: 0, False: 19.2k]
  ------------------
  292|      0|                s->insert = s->strstart;
  293|  19.2k|            slide_hash(s);
  294|  19.2k|            more += wsize;
  295|  19.2k|        }
  296|   287k|        if (s->strm->avail_in == 0) break;
  ------------------
  |  Branch (296:13): [True: 261k, False: 26.7k]
  ------------------
  297|       |
  298|       |        /* If there was no sliding:
  299|       |         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
  300|       |         *    more == window_size - lookahead - strstart
  301|       |         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
  302|       |         * => more >= window_size - 2*WSIZE + 2
  303|       |         * In the BIG_MEM or MMAP case (not yet supported),
  304|       |         *   window_size == input_size + MIN_LOOKAHEAD  &&
  305|       |         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
  306|       |         * Otherwise, window_size == 2*WSIZE so more >= 2.
  307|       |         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
  308|       |         */
  309|  26.7k|        Assert(more >= 2, "more < 2");
  310|       |
  311|  26.7k|        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
  312|  26.7k|        s->lookahead += n;
  313|       |
  314|       |        /* Initialize the hash value now that we have some input: */
  315|  26.7k|        if (s->lookahead + s->insert >= MIN_MATCH) {
  ------------------
  |  |   92|  26.7k|#define MIN_MATCH  3
  ------------------
  |  Branch (315:13): [True: 26.5k, False: 251]
  ------------------
  316|  26.5k|            uInt str = s->strstart - s->insert;
  317|  26.5k|            s->ins_h = s->window[str];
  318|  26.5k|            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
  ------------------
  |  |  141|  26.5k|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  ------------------
  319|       |#if MIN_MATCH != 3
  320|       |            Call UPDATE_HASH() MIN_MATCH-3 more times
  321|       |#endif
  322|  34.0k|            while (s->insert) {
  ------------------
  |  Branch (322:20): [True: 7.59k, False: 26.4k]
  ------------------
  323|  7.59k|                UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
  ------------------
  |  |  141|  7.59k|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  ------------------
  324|  7.59k|#ifndef FASTEST
  325|  7.59k|                s->prev[str & s->w_mask] = s->head[s->ins_h];
  326|  7.59k|#endif
  327|  7.59k|                s->head[s->ins_h] = (Pos)str;
  328|  7.59k|                str++;
  329|  7.59k|                s->insert--;
  330|  7.59k|                if (s->lookahead + s->insert < MIN_MATCH)
  ------------------
  |  |   92|  7.59k|#define MIN_MATCH  3
  ------------------
  |  Branch (330:21): [True: 25, False: 7.57k]
  ------------------
  331|     25|                    break;
  332|  7.59k|            }
  333|  26.5k|        }
  334|       |        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
  335|       |         * but this is not important since only literal bytes will be emitted.
  336|       |         */
  337|       |
  338|  26.7k|    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
  ------------------
  |  |  296|  53.5k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|  26.7k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|  26.7k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (338:14): [True: 6.27k, False: 20.4k]
  |  Branch (338:46): [True: 0, False: 6.27k]
  ------------------
  339|       |
  340|       |    /* If the WIN_INIT bytes after the end of the current data have never been
  341|       |     * written, then zero those bytes in order to avoid memory check reports of
  342|       |     * the use of uninitialized (or uninitialised as Julian writes) bytes by
  343|       |     * the longest match routines.  Update the high water mark for the next
  344|       |     * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
  345|       |     * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
  346|       |     */
  347|   287k|    if (s->high_water < s->window_size) {
  ------------------
  |  Branch (347:9): [True: 172k, False: 115k]
  ------------------
  348|   172k|        ulg curr = s->strstart + (ulg)(s->lookahead);
  349|   172k|        ulg init;
  350|       |
  351|   172k|        if (s->high_water < curr) {
  ------------------
  |  Branch (351:13): [True: 5.93k, False: 166k]
  ------------------
  352|       |            /* Previous high water mark below current data -- zero WIN_INIT
  353|       |             * bytes or up to end of window, whichever is less.
  354|       |             */
  355|  5.93k|            init = s->window_size - curr;
  356|  5.93k|            if (init > WIN_INIT)
  ------------------
  |  |  306|  5.93k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|  5.93k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (356:17): [True: 5.02k, False: 907]
  ------------------
  357|  5.02k|                init = WIN_INIT;
  ------------------
  |  |  306|  5.02k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|  5.02k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  358|  5.93k|            zmemzero(s->window + curr, (unsigned)init);
  ------------------
  |  |  218|  5.93k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  359|  5.93k|            s->high_water = curr + init;
  360|  5.93k|        }
  361|   166k|        else if (s->high_water < (ulg)curr + WIN_INIT) {
  ------------------
  |  |  306|   166k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|   166k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (361:18): [True: 2.40k, False: 163k]
  ------------------
  362|       |            /* High water mark at or above current data, but below current data
  363|       |             * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
  364|       |             * to end of window, whichever is less.
  365|       |             */
  366|  2.40k|            init = (ulg)curr + WIN_INIT - s->high_water;
  ------------------
  |  |  306|  2.40k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|  2.40k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  367|  2.40k|            if (init > s->window_size - s->high_water)
  ------------------
  |  Branch (367:17): [True: 0, False: 2.40k]
  ------------------
  368|      0|                init = s->window_size - s->high_water;
  369|  2.40k|            zmemzero(s->window + s->high_water, (unsigned)init);
  ------------------
  |  |  218|  2.40k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  370|  2.40k|            s->high_water += init;
  371|  2.40k|        }
  372|   172k|    }
  373|       |
  374|   287k|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
  375|   287k|           "not enough room for search");
  376|   287k|}
deflate.c:read_buf:
  219|  26.7k|local unsigned read_buf(z_streamp strm, Bytef *buf, unsigned size) {
  220|  26.7k|    unsigned len = strm->avail_in;
  221|       |
  222|  26.7k|    if (len > size) len = size;
  ------------------
  |  Branch (222:9): [True: 18.6k, False: 8.06k]
  ------------------
  223|  26.7k|    if (len == 0) return 0;
  ------------------
  |  Branch (223:9): [True: 0, False: 26.7k]
  ------------------
  224|       |
  225|  26.7k|    strm->avail_in  -= len;
  226|       |
  227|  26.7k|    zmemcpy(buf, strm->next_in, len);
  ------------------
  |  |  216|  26.7k|#    define zmemcpy memcpy
  ------------------
  228|  26.7k|    if (strm->state->wrap == 1) {
  ------------------
  |  Branch (228:9): [True: 22.8k, False: 3.89k]
  ------------------
  229|  22.8k|        strm->adler = adler32(strm->adler, buf, len);
  230|  22.8k|    }
  231|  3.89k|#ifdef GZIP
  232|  3.89k|    else if (strm->state->wrap == 2) {
  ------------------
  |  Branch (232:14): [True: 0, False: 3.89k]
  ------------------
  233|      0|        strm->adler = crc32(strm->adler, buf, len);
  234|      0|    }
  235|  26.7k|#endif
  236|  26.7k|    strm->next_in  += len;
  237|  26.7k|    strm->total_in += len;
  238|       |
  239|  26.7k|    return len;
  240|  26.7k|}
deflate.c:lm_init:
  682|  4.17k|local void lm_init(deflate_state *s) {
  683|  4.17k|    s->window_size = (ulg)2L*s->w_size;
  684|       |
  685|  4.17k|    CLEAR_HASH(s);
  ------------------
  |  |  171|  4.17k|    do { \
  |  |  172|  4.17k|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|  4.17k|#define NIL 0
  |  |  ------------------
  |  |  173|  4.17k|        zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  ------------------
  |  |  |  |  218|  4.17k|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|  4.17k|        s->slid = 0; \
  |  |  175|  4.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded, False: 4.17k]
  |  |  ------------------
  ------------------
  686|       |
  687|       |    /* Set the default configuration parameters:
  688|       |     */
  689|  4.17k|    s->max_lazy_match   = configuration_table[s->level].max_lazy;
  690|  4.17k|    s->good_match       = configuration_table[s->level].good_length;
  691|  4.17k|    s->nice_match       = configuration_table[s->level].nice_length;
  692|  4.17k|    s->max_chain_length = configuration_table[s->level].max_chain;
  693|       |
  694|  4.17k|    s->strstart = 0;
  695|  4.17k|    s->block_start = 0L;
  696|  4.17k|    s->lookahead = 0;
  697|  4.17k|    s->insert = 0;
  698|  4.17k|    s->match_length = s->prev_length = MIN_MATCH-1;
  ------------------
  |  |   92|  4.17k|#define MIN_MATCH  3
  ------------------
  699|  4.17k|    s->match_available = 0;
  700|  4.17k|    s->ins_h = 0;
  701|  4.17k|}
deflate.c:deflate_fast:
 1857|    829|local block_state deflate_fast(deflate_state *s, int flush) {
 1858|    829|    IPos hash_head;       /* head of the hash chain */
 1859|    829|    int bflush;           /* set if current block must be flushed */
 1860|       |
 1861|  1.26M|    for (;;) {
 1862|       |        /* Make sure that we always have enough lookahead, except
 1863|       |         * at the end of the input file. We need MAX_MATCH bytes
 1864|       |         * for the next match, plus MIN_MATCH bytes to insert the
 1865|       |         * string following the next match.
 1866|       |         */
 1867|  1.26M|        if (s->lookahead < MIN_LOOKAHEAD) {
  ------------------
  |  |  296|  1.26M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|  1.26M|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|  1.26M|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (1867:13): [True: 61.7k, False: 1.20M]
  ------------------
 1868|  61.7k|            fill_window(s);
 1869|  61.7k|            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  296|   123k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|  61.7k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|  61.7k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
                          if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|  57.8k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (1869:17): [True: 57.8k, False: 3.87k]
  |  Branch (1869:49): [True: 0, False: 57.8k]
  ------------------
 1870|      0|                return need_more;
 1871|      0|            }
 1872|  61.7k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (1872:17): [True: 829, False: 60.8k]
  ------------------
 1873|  61.7k|        }
 1874|       |
 1875|       |        /* Insert the string window[strstart .. strstart + 2] in the
 1876|       |         * dictionary, and set hash_head to the head of the hash chain:
 1877|       |         */
 1878|  1.26M|        hash_head = NIL;
  ------------------
  |  |   85|  1.26M|#define NIL 0
  ------------------
 1879|  1.26M|        if (s->lookahead >= MIN_MATCH) {
  ------------------
  |  |   92|  1.26M|#define MIN_MATCH  3
  ------------------
  |  Branch (1879:13): [True: 1.26M, False: 773]
  ------------------
 1880|  1.26M|            INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  1.26M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  1.26M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  1.26M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  1.26M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 1881|  1.26M|        }
 1882|       |
 1883|       |        /* Find the longest match, discarding those <= prev_length.
 1884|       |         * At this point we have always match_length < MIN_MATCH
 1885|       |         */
 1886|  1.26M|        if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
  ------------------
  |  |   85|  2.52M|#define NIL 0
  ------------------
                      if (hash_head != NIL && s->strstart - hash_head <= MAX_DIST(s)) {
  ------------------
  |  |  301|   532k|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|   532k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   532k|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|   532k|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1886:13): [True: 532k, False: 729k]
  |  Branch (1886:33): [True: 419k, False: 112k]
  ------------------
 1887|       |            /* To simplify the code, we prevent matches with the string
 1888|       |             * of window index 0 (in particular we have to avoid a match
 1889|       |             * of the string with itself at the start of the input file).
 1890|       |             */
 1891|   419k|            s->match_length = longest_match (s, hash_head);
 1892|       |            /* longest_match() sets match_start */
 1893|   419k|        }
 1894|  1.26M|        if (s->match_length >= MIN_MATCH) {
  ------------------
  |  |   92|  1.26M|#define MIN_MATCH  3
  ------------------
  |  Branch (1894:13): [True: 146k, False: 1.11M]
  ------------------
 1895|   146k|            check_match(s, s->strstart, s->match_start, (int)s->match_length);
 1896|       |
 1897|   146k|            _tr_tally_dist(s, s->strstart - s->match_start,
  ------------------
  |  |  366|   146k|  { uch len = (uch)(length); \
  |  |  367|   146k|    ush dist = (ush)(distance); \
  |  |  368|   146k|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  369|   146k|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  370|   146k|    s->sym_buf[s->sym_next++] = len; \
  |  |  371|   146k|    dist--; \
  |  |  372|   146k|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|   146k|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   146k|#define Freq fc.freq
  |  |  ------------------
  |  |  373|   146k|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  321|   146k|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 77.8k, False: 69.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   146k|#define Freq fc.freq
  |  |  ------------------
  |  |  374|   146k|    flush = (s->sym_next == s->sym_end); \
  |  |  375|   146k|  }
  ------------------
 1898|   146k|                           s->match_length - MIN_MATCH, bflush);
 1899|       |
 1900|   146k|            s->lookahead -= s->match_length;
 1901|       |
 1902|       |            /* Insert new strings in the hash table only if the match length
 1903|       |             * is not too large. This saves time but degrades compression.
 1904|       |             */
 1905|   146k|#ifndef FASTEST
 1906|   146k|            if (s->match_length <= s->max_insert_length &&
  ------------------
  |  |  186|   293k|#   define max_insert_length  max_lazy_match
  ------------------
  |  Branch (1906:17): [True: 85.4k, False: 61.5k]
  ------------------
 1907|  85.4k|                s->lookahead >= MIN_MATCH) {
  ------------------
  |  |   92|  85.4k|#define MIN_MATCH  3
  ------------------
  |  Branch (1907:17): [True: 85.1k, False: 348]
  ------------------
 1908|  85.1k|                s->match_length--; /* string at strstart already in table */
 1909|   224k|                do {
 1910|   224k|                    s->strstart++;
 1911|   224k|                    INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|   224k|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|   224k|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|   224k|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|   224k|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 1912|       |                    /* strstart never exceeds WSIZE-MAX_MATCH, so there are
 1913|       |                     * always MIN_MATCH bytes ahead.
 1914|       |                     */
 1915|   224k|                } while (--s->match_length != 0);
  ------------------
  |  Branch (1915:26): [True: 139k, False: 85.1k]
  ------------------
 1916|  85.1k|                s->strstart++;
 1917|  85.1k|            } else
 1918|  61.8k|#endif
 1919|  61.8k|            {
 1920|  61.8k|                s->strstart += s->match_length;
 1921|  61.8k|                s->match_length = 0;
 1922|  61.8k|                s->ins_h = s->window[s->strstart];
 1923|  61.8k|                UPDATE_HASH(s, s->ins_h, s->window[s->strstart + 1]);
  ------------------
  |  |  141|  61.8k|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  ------------------
 1924|       |#if MIN_MATCH != 3
 1925|       |                Call UPDATE_HASH() MIN_MATCH-3 more times
 1926|       |#endif
 1927|       |                /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
 1928|       |                 * matter since it will be recomputed at next deflate call.
 1929|       |                 */
 1930|  61.8k|            }
 1931|  1.11M|        } else {
 1932|       |            /* No match, output a literal byte */
 1933|  1.11M|            Tracevv((stderr,"%c", s->window[s->strstart]));
 1934|  1.11M|            _tr_tally_lit(s, s->window[s->strstart], bflush);
  ------------------
  |  |  358|  1.11M|  { uch cc = (c); \
  |  |  359|  1.11M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  1.11M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  1.11M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  1.11M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  1.11M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  1.11M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  1.11M|   }
  ------------------
 1935|  1.11M|            s->lookahead--;
 1936|  1.11M|            s->strstart++;
 1937|  1.11M|        }
 1938|  1.26M|        if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1642|  2.15k|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|  2.15k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|  2.15k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|  2.15k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 1.81k, False: 339]
  |  |  |  |  ------------------
  |  |  |  | 1632|  2.15k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|  2.15k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    339|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|  2.15k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|  2.15k|                (last)); \
  |  |  |  | 1636|  2.15k|   s->block_start = s->strstart; \
  |  |  |  | 1637|  2.15k|   flush_pending(s->strm); \
  |  |  |  | 1638|  2.15k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|  2.15k|}
  |  |  ------------------
  |  | 1644|  2.15k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 2.15k]
  |  |  |  Branch (1644:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1645|  2.15k|}
  ------------------
  |  Branch (1938:13): [True: 2.15k, False: 1.25M]
  ------------------
 1939|  1.26M|    }
 1940|    829|    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   92|    829|#define MIN_MATCH  3
  ------------------
                  s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   92|    829|#define MIN_MATCH  3
  ------------------
  |  Branch (1940:17): [True: 0, False: 829]
  ------------------
 1941|    829|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|    829|#define Z_FINISH        4
  ------------------
  |  Branch (1941:9): [True: 829, False: 0]
  ------------------
 1942|    829|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1642|    829|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|    829|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|    829|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|    829|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 754, False: 75]
  |  |  |  |  ------------------
  |  |  |  | 1632|    829|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|    829|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     75|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|    829|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|    829|                (last)); \
  |  |  |  | 1636|    829|   s->block_start = s->strstart; \
  |  |  |  | 1637|    829|   flush_pending(s->strm); \
  |  |  |  | 1638|    829|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|    829|}
  |  |  ------------------
  |  | 1644|    829|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 829]
  |  |  |  Branch (1644:40): [True: 0, Folded]
  |  |  ------------------
  |  | 1645|    829|}
  ------------------
 1943|    829|        return finish_done;
 1944|    829|    }
 1945|      0|    if (s->sym_next)
  ------------------
  |  Branch (1945:9): [True: 0, False: 0]
  ------------------
 1946|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1642|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1632|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|      0|                (last)); \
  |  |  |  | 1636|      0|   s->block_start = s->strstart; \
  |  |  |  | 1637|      0|   flush_pending(s->strm); \
  |  |  |  | 1638|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|      0|}
  |  |  ------------------
  |  | 1644|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 0]
  |  |  |  Branch (1644:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1645|      0|}
  ------------------
 1947|      0|    return block_done;
 1948|      0|}
deflate.c:longest_match:
 1389|  1.46M|local uInt longest_match(deflate_state *s, IPos cur_match) {
 1390|  1.46M|    unsigned chain_length = s->max_chain_length;/* max hash chain length */
 1391|  1.46M|    Bytef *scan = s->window + s->strstart;      /* current string */
 1392|  1.46M|    Bytef *match;                               /* matched string */
 1393|  1.46M|    int len;                                    /* length of current match */
 1394|  1.46M|    int best_len = (int)s->prev_length;         /* best match length so far */
 1395|  1.46M|    int nice_match = s->nice_match;             /* stop if match long enough */
 1396|  1.46M|    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
  ------------------
  |  |  301|  1.46M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  1.46M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  1.46M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  1.46M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1396:18): [True: 995k, False: 468k]
  ------------------
 1397|   995k|        s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |  301|   995k|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|   995k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   995k|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|   995k|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |   85|   468k|#define NIL 0
  ------------------
 1398|       |    /* Stop when cur_match becomes <= limit. To simplify the code,
 1399|       |     * we prevent matches with the string of window index 0.
 1400|       |     */
 1401|  1.46M|    Posf *prev = s->prev;
 1402|  1.46M|    uInt wmask = s->w_mask;
 1403|       |
 1404|       |#ifdef UNALIGNED_OK
 1405|       |    /* Compare two bytes at a time. Note: this is not always beneficial.
 1406|       |     * Try with and without -DUNALIGNED_OK to check.
 1407|       |     */
 1408|       |    Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
 1409|       |    ush scan_start = *(ushf*)scan;
 1410|       |    ush scan_end   = *(ushf*)(scan + best_len - 1);
 1411|       |#else
 1412|  1.46M|    Bytef *strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |   93|  1.46M|#define MAX_MATCH  258
  ------------------
 1413|  1.46M|    Byte scan_end1  = scan[best_len - 1];
 1414|  1.46M|    Byte scan_end   = scan[best_len];
 1415|  1.46M|#endif
 1416|       |
 1417|       |    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
 1418|       |     * It is easy to get rid of this optimization if necessary.
 1419|       |     */
 1420|  1.46M|    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
 1421|       |
 1422|       |    /* Do not waste too much time if we already have a good match: */
 1423|  1.46M|    if (s->prev_length >= s->good_match) {
  ------------------
  |  Branch (1423:9): [True: 33.7k, False: 1.42M]
  ------------------
 1424|  33.7k|        chain_length >>= 2;
 1425|  33.7k|    }
 1426|       |    /* Do not look for matches beyond the end of the input. This is necessary
 1427|       |     * to make deflate deterministic.
 1428|       |     */
 1429|  1.46M|    if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
  ------------------
  |  Branch (1429:9): [True: 31.2k, False: 1.43M]
  ------------------
 1430|       |
 1431|  1.46M|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
 1432|  1.46M|           "need lookahead");
 1433|       |
 1434|  13.8M|    do {
 1435|  13.8M|        Assert(cur_match < s->strstart, "no future");
 1436|  13.8M|        match = s->window + cur_match;
 1437|       |
 1438|       |        /* Skip to next match if the match length cannot increase
 1439|       |         * or if the match length is less than 2.  Note that the checks below
 1440|       |         * for insufficient lookahead only occur occasionally for performance
 1441|       |         * reasons.  Therefore uninitialized memory will be accessed, and
 1442|       |         * conditional jumps will be made that depend on those values.
 1443|       |         * However the length of the match is limited to the lookahead, so
 1444|       |         * the output of deflate is not affected by the uninitialized values.
 1445|       |         */
 1446|       |#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
 1447|       |        /* This code assumes sizeof(unsigned short) == 2. Do not use
 1448|       |         * UNALIGNED_OK if your compiler uses a different size.
 1449|       |         */
 1450|       |        if (*(ushf*)(match + best_len - 1) != scan_end ||
 1451|       |            *(ushf*)match != scan_start) continue;
 1452|       |
 1453|       |        /* It is not necessary to compare scan[2] and match[2] since they are
 1454|       |         * always equal when the other bytes match, given that the hash keys
 1455|       |         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
 1456|       |         * strstart + 3, + 5, up to strstart + 257. We check for insufficient
 1457|       |         * lookahead only every 4th comparison; the 128th check will be made
 1458|       |         * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is
 1459|       |         * necessary to put more guard bytes at the end of the window, or
 1460|       |         * to check more often for insufficient lookahead.
 1461|       |         */
 1462|       |        Assert(scan[2] == match[2], "scan[2]?");
 1463|       |        scan++, match++;
 1464|       |        do {
 1465|       |        } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1466|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1467|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1468|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1469|       |                 scan < strend);
 1470|       |        /* The funny "do {}" generates better code on most compilers */
 1471|       |
 1472|       |        /* Here, scan <= window + strstart + 257 */
 1473|       |        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1474|       |               "wild scan");
 1475|       |        if (*scan == *match) scan++;
 1476|       |
 1477|       |        len = (MAX_MATCH - 1) - (int)(strend - scan);
 1478|       |        scan = strend - (MAX_MATCH-1);
 1479|       |
 1480|       |#else /* UNALIGNED_OK */
 1481|       |
 1482|  13.8M|        if (match[best_len]     != scan_end  ||
  ------------------
  |  Branch (1482:13): [True: 10.5M, False: 3.33M]
  ------------------
 1483|  3.33M|            match[best_len - 1] != scan_end1 ||
  ------------------
  |  Branch (1483:13): [True: 1.10M, False: 2.23M]
  ------------------
 1484|  2.23M|            *match              != *scan     ||
  ------------------
  |  Branch (1484:13): [True: 1.19M, False: 1.03M]
  ------------------
 1485|  12.8M|            *++match            != scan[1])      continue;
  ------------------
  |  Branch (1485:13): [True: 6.45k, False: 1.02M]
  ------------------
 1486|       |
 1487|       |        /* The check at best_len - 1 can be removed because it will be made
 1488|       |         * again later. (This heuristic is not always a win.)
 1489|       |         * It is not necessary to compare scan[2] and match[2] since they
 1490|       |         * are always equal when the other bytes match, given that
 1491|       |         * the hash keys are equal and that HASH_BITS >= 8.
 1492|       |         */
 1493|  1.02M|        scan += 2, match++;
 1494|  1.02M|        Assert(*scan == *match, "match[2]?");
 1495|       |
 1496|       |        /* We check for insufficient lookahead only every 8th comparison;
 1497|       |         * the 256th check will be made at strstart + 258.
 1498|       |         */
 1499|  3.38M|        do {
 1500|  3.38M|        } while (*++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1500:18): [True: 3.06M, False: 318k]
  |  Branch (1500:41): [True: 2.90M, False: 161k]
  ------------------
 1501|  2.90M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1501:18): [True: 2.78M, False: 116k]
  |  Branch (1501:41): [True: 2.68M, False: 101k]
  ------------------
 1502|  2.68M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1502:18): [True: 2.57M, False: 107k]
  |  Branch (1502:41): [True: 2.49M, False: 84.9k]
  ------------------
 1503|  2.49M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1503:18): [True: 2.42M, False: 65.9k]
  |  Branch (1503:41): [True: 2.36M, False: 62.3k]
  ------------------
 1504|  2.36M|                 scan < strend);
  ------------------
  |  Branch (1504:18): [True: 2.35M, False: 10.7k]
  ------------------
 1505|       |
 1506|  1.02M|        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1507|  1.02M|               "wild scan");
 1508|       |
 1509|  1.02M|        len = MAX_MATCH - (int)(strend - scan);
  ------------------
  |  |   93|  1.02M|#define MAX_MATCH  258
  ------------------
 1510|  1.02M|        scan = strend - MAX_MATCH;
  ------------------
  |  |   93|  1.02M|#define MAX_MATCH  258
  ------------------
 1511|       |
 1512|  1.02M|#endif /* UNALIGNED_OK */
 1513|       |
 1514|  1.02M|        if (len > best_len) {
  ------------------
  |  Branch (1514:13): [True: 862k, False: 167k]
  ------------------
 1515|   862k|            s->match_start = cur_match;
 1516|   862k|            best_len = len;
 1517|   862k|            if (len >= nice_match) break;
  ------------------
  |  Branch (1517:17): [True: 32.1k, False: 830k]
  ------------------
 1518|       |#ifdef UNALIGNED_OK
 1519|       |            scan_end = *(ushf*)(scan + best_len - 1);
 1520|       |#else
 1521|   830k|            scan_end1  = scan[best_len - 1];
 1522|   830k|            scan_end   = scan[best_len];
 1523|   830k|#endif
 1524|   830k|        }
 1525|  13.8M|    } while ((cur_match = prev[cur_match & wmask]) > limit
  ------------------
  |  Branch (1525:14): [True: 12.5M, False: 1.27M]
  ------------------
 1526|  12.5M|             && --chain_length != 0);
  ------------------
  |  Branch (1526:17): [True: 12.4M, False: 158k]
  ------------------
 1527|       |
 1528|  1.46M|    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
  ------------------
  |  Branch (1528:9): [True: 1.46M, False: 578]
  ------------------
 1529|    578|    return s->lookahead;
 1530|  1.46M|}
deflate.c:deflate_slow:
 1956|  1.35k|local block_state deflate_slow(deflate_state *s, int flush) {
 1957|  1.35k|    IPos hash_head;          /* head of hash chain */
 1958|  1.35k|    int bflush;              /* set if current block must be flushed */
 1959|       |
 1960|       |    /* Process the input block. */
 1961|  2.52M|    for (;;) {
 1962|       |        /* Make sure that we always have enough lookahead, except
 1963|       |         * at the end of the input file. We need MAX_MATCH bytes
 1964|       |         * for the next match, plus MIN_MATCH bytes to insert the
 1965|       |         * string following the next match.
 1966|       |         */
 1967|  2.52M|        if (s->lookahead < MIN_LOOKAHEAD) {
  ------------------
  |  |  296|  2.52M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|  2.52M|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|  2.52M|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (1967:13): [True: 122k, False: 2.40M]
  ------------------
 1968|   122k|            fill_window(s);
 1969|   122k|            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  296|   244k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|   122k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|   122k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
                          if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|   114k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (1969:17): [True: 114k, False: 7.54k]
  |  Branch (1969:49): [True: 0, False: 114k]
  ------------------
 1970|      0|                return need_more;
 1971|      0|            }
 1972|   122k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (1972:17): [True: 1.35k, False: 120k]
  ------------------
 1973|   122k|        }
 1974|       |
 1975|       |        /* Insert the string window[strstart .. strstart + 2] in the
 1976|       |         * dictionary, and set hash_head to the head of the hash chain:
 1977|       |         */
 1978|  2.52M|        hash_head = NIL;
  ------------------
  |  |   85|  2.52M|#define NIL 0
  ------------------
 1979|  2.52M|        if (s->lookahead >= MIN_MATCH) {
  ------------------
  |  |   92|  2.52M|#define MIN_MATCH  3
  ------------------
  |  Branch (1979:13): [True: 2.52M, False: 1.40k]
  ------------------
 1980|  2.52M|            INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  2.52M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  2.52M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  2.52M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  2.52M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 1981|  2.52M|        }
 1982|       |
 1983|       |        /* Find the longest match, discarding those <= prev_length.
 1984|       |         */
 1985|  2.52M|        s->prev_length = s->match_length, s->prev_match = s->match_start;
 1986|  2.52M|        s->match_length = MIN_MATCH-1;
  ------------------
  |  |   92|  2.52M|#define MIN_MATCH  3
  ------------------
 1987|       |
 1988|  2.52M|        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
  ------------------
  |  |   85|  5.04M|#define NIL 0
  ------------------
  |  Branch (1988:13): [True: 1.45M, False: 1.06M]
  |  Branch (1988:33): [True: 1.41M, False: 44.3k]
  ------------------
 1989|  1.41M|            s->strstart - hash_head <= MAX_DIST(s)) {
  ------------------
  |  |  301|  1.41M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  1.41M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  1.41M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  1.41M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1989:13): [True: 1.04M, False: 366k]
  ------------------
 1990|       |            /* To simplify the code, we prevent matches with the string
 1991|       |             * of window index 0 (in particular we have to avoid a match
 1992|       |             * of the string with itself at the start of the input file).
 1993|       |             */
 1994|  1.04M|            s->match_length = longest_match (s, hash_head);
 1995|       |            /* longest_match() sets match_start */
 1996|       |
 1997|  1.04M|            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
  ------------------
  |  |  200|  1.76M|#define Z_FILTERED            1
  ------------------
  |  Branch (1997:17): [True: 884k, False: 160k]
  |  Branch (1997:42): [True: 104k, False: 779k]
  ------------------
 1998|   779k|#if TOO_FAR <= 32767
 1999|   779k|                || (s->match_length == MIN_MATCH &&
  ------------------
  |  |   92|  1.55M|#define MIN_MATCH  3
  ------------------
  |  Branch (1999:21): [True: 111k, False: 668k]
  ------------------
 2000|   111k|                    s->strstart - s->match_start > TOO_FAR)
  ------------------
  |  |   89|   111k|#  define TOO_FAR 4096
  ------------------
  |  Branch (2000:21): [True: 3.82k, False: 107k]
  ------------------
 2001|   884k|#endif
 2002|   884k|                )) {
 2003|       |
 2004|       |                /* If prev_match is also MIN_MATCH, match_start is garbage
 2005|       |                 * but we will ignore the current match anyway.
 2006|       |                 */
 2007|   108k|                s->match_length = MIN_MATCH-1;
  ------------------
  |  |   92|   108k|#define MIN_MATCH  3
  ------------------
 2008|   108k|            }
 2009|  1.04M|        }
 2010|       |        /* If there was a match at the previous step and the current
 2011|       |         * match is not better, output the previous match:
 2012|       |         */
 2013|  2.52M|        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
  ------------------
  |  |   92|  5.04M|#define MIN_MATCH  3
  ------------------
  |  Branch (2013:13): [True: 213k, False: 2.30M]
  |  Branch (2013:44): [True: 198k, False: 14.5k]
  ------------------
 2014|   198k|            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
  ------------------
  |  |   92|   198k|#define MIN_MATCH  3
  ------------------
 2015|       |            /* Do not insert strings in hash table beyond this. */
 2016|       |
 2017|   198k|            check_match(s, s->strstart - 1, s->prev_match, (int)s->prev_length);
 2018|       |
 2019|   198k|            _tr_tally_dist(s, s->strstart - 1 - s->prev_match,
  ------------------
  |  |  366|   198k|  { uch len = (uch)(length); \
  |  |  367|   198k|    ush dist = (ush)(distance); \
  |  |  368|   198k|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  369|   198k|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  370|   198k|    s->sym_buf[s->sym_next++] = len; \
  |  |  371|   198k|    dist--; \
  |  |  372|   198k|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|   198k|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   198k|#define Freq fc.freq
  |  |  ------------------
  |  |  373|   198k|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  321|   198k|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 152k, False: 46.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   198k|#define Freq fc.freq
  |  |  ------------------
  |  |  374|   198k|    flush = (s->sym_next == s->sym_end); \
  |  |  375|   198k|  }
  ------------------
 2020|   198k|                           s->prev_length - MIN_MATCH, bflush);
 2021|       |
 2022|       |            /* Insert in hash table all strings up to the end of the match.
 2023|       |             * strstart - 1 and strstart are already inserted. If there is not
 2024|       |             * enough lookahead, the last two strings are not inserted in
 2025|       |             * the hash table.
 2026|       |             */
 2027|   198k|            s->lookahead -= s->prev_length - 1;
 2028|   198k|            s->prev_length -= 2;
 2029|  4.07M|            do {
 2030|  4.07M|                if (++s->strstart <= max_insert) {
  ------------------
  |  Branch (2030:21): [True: 4.07M, False: 1.27k]
  ------------------
 2031|  4.07M|                    INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  4.07M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  4.07M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  4.07M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  4.07M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 2032|  4.07M|                }
 2033|  4.07M|            } while (--s->prev_length != 0);
  ------------------
  |  Branch (2033:22): [True: 3.88M, False: 198k]
  ------------------
 2034|   198k|            s->match_available = 0;
 2035|   198k|            s->match_length = MIN_MATCH-1;
  ------------------
  |  |   92|   198k|#define MIN_MATCH  3
  ------------------
 2036|   198k|            s->strstart++;
 2037|       |
 2038|   198k|            if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1642|    875|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|    875|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|    875|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|    875|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 674, False: 201]
  |  |  |  |  ------------------
  |  |  |  | 1632|    875|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|    875|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    201|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|    875|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|    875|                (last)); \
  |  |  |  | 1636|    875|   s->block_start = s->strstart; \
  |  |  |  | 1637|    875|   flush_pending(s->strm); \
  |  |  |  | 1638|    875|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|    875|}
  |  |  ------------------
  |  | 1644|    875|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 875]
  |  |  |  Branch (1644:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1645|    875|}
  ------------------
  |  Branch (2038:17): [True: 875, False: 197k]
  ------------------
 2039|       |
 2040|  2.32M|        } else if (s->match_available) {
  ------------------
  |  Branch (2040:20): [True: 2.12M, False: 199k]
  ------------------
 2041|       |            /* If there was no match at the previous position, output a
 2042|       |             * single literal. If there was a match but the current match
 2043|       |             * is longer, truncate the previous match to a single literal.
 2044|       |             */
 2045|  2.12M|            Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2046|  2.12M|            _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  358|  2.12M|  { uch cc = (c); \
  |  |  359|  2.12M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  2.12M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  2.12M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  2.12M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  2.12M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  2.12M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  2.12M|   }
  ------------------
 2047|  2.12M|            if (bflush) {
  ------------------
  |  Branch (2047:17): [True: 5.97k, False: 2.11M]
  ------------------
 2048|  5.97k|                FLUSH_BLOCK_ONLY(s, 0);
  ------------------
  |  | 1630|  5.97k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  | 1631|  5.97k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  ------------------
  |  |  |  Branch (1631:24): [True: 5.04k, False: 925]
  |  |  ------------------
  |  | 1632|  5.97k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  | 1633|  5.97k|                   (charf *)Z_NULL), \
  |  |  ------------------
  |  |  |  |  216|    925|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  ------------------
  |  | 1634|  5.97k|                (ulg)((long)s->strstart - s->block_start), \
  |  | 1635|  5.97k|                (last)); \
  |  | 1636|  5.97k|   s->block_start = s->strstart; \
  |  | 1637|  5.97k|   flush_pending(s->strm); \
  |  | 1638|  5.97k|   Tracev((stderr,"[FLUSH]")); \
  |  | 1639|  5.97k|}
  ------------------
 2049|  5.97k|            }
 2050|  2.12M|            s->strstart++;
 2051|  2.12M|            s->lookahead--;
 2052|  2.12M|            if (s->strm->avail_out == 0) return need_more;
  ------------------
  |  Branch (2052:17): [True: 0, False: 2.12M]
  ------------------
 2053|  2.12M|        } else {
 2054|       |            /* There is no previous match to compare with, wait for
 2055|       |             * the next step to decide.
 2056|       |             */
 2057|   199k|            s->match_available = 1;
 2058|   199k|            s->strstart++;
 2059|   199k|            s->lookahead--;
 2060|   199k|        }
 2061|  2.52M|    }
 2062|  1.35k|    Assert (flush != Z_NO_FLUSH, "no flush?");
 2063|  1.35k|    if (s->match_available) {
  ------------------
  |  Branch (2063:9): [True: 698, False: 657]
  ------------------
 2064|    698|        Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2065|    698|        _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  358|    698|  { uch cc = (c); \
  |  |  359|    698|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|    698|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|    698|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|    698|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|    698|#define Freq fc.freq
  |  |  ------------------
  |  |  363|    698|    flush = (s->sym_next == s->sym_end); \
  |  |  364|    698|   }
  ------------------
 2066|    698|        s->match_available = 0;
 2067|    698|    }
 2068|  1.35k|    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   92|  1.35k|#define MIN_MATCH  3
  ------------------
                  s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   92|  1.35k|#define MIN_MATCH  3
  ------------------
  |  Branch (2068:17): [True: 1, False: 1.35k]
  ------------------
 2069|  1.35k|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|  1.35k|#define Z_FINISH        4
  ------------------
  |  Branch (2069:9): [True: 1.35k, False: 0]
  ------------------
 2070|  1.35k|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1642|  1.35k|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|  1.35k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|  1.35k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|  1.35k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 1.14k, False: 215]
  |  |  |  |  ------------------
  |  |  |  | 1632|  1.35k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|  1.35k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    215|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|  1.35k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|  1.35k|                (last)); \
  |  |  |  | 1636|  1.35k|   s->block_start = s->strstart; \
  |  |  |  | 1637|  1.35k|   flush_pending(s->strm); \
  |  |  |  | 1638|  1.35k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|  1.35k|}
  |  |  ------------------
  |  | 1644|  1.35k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 1.35k]
  |  |  |  Branch (1644:40): [True: 0, Folded]
  |  |  ------------------
  |  | 1645|  1.35k|}
  ------------------
 2071|  1.35k|        return finish_done;
 2072|  1.35k|    }
 2073|      0|    if (s->sym_next)
  ------------------
  |  Branch (2073:9): [True: 0, False: 0]
  ------------------
 2074|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1642|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1632|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|      0|                (last)); \
  |  |  |  | 1636|      0|   s->block_start = s->strstart; \
  |  |  |  | 1637|      0|   flush_pending(s->strm); \
  |  |  |  | 1638|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|      0|}
  |  |  ------------------
  |  | 1644|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 0]
  |  |  |  Branch (1644:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1645|      0|}
  ------------------
 2075|      0|    return block_done;
 2076|      0|}
deflate.c:slide_hash:
  187|  19.2k|local void slide_hash(deflate_state *s) {
  188|  19.2k|    unsigned n, m;
  189|  19.2k|    Posf *p;
  190|  19.2k|    uInt wsize = s->w_size;
  191|       |
  192|  19.2k|    n = s->hash_size;
  193|  19.2k|    p = &s->head[n];
  194|   342M|    do {
  195|   342M|        m = *--p;
  196|   342M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|   341M|#define NIL 0
  ------------------
  |  Branch (196:20): [True: 1.40M, False: 341M]
  ------------------
  197|   342M|    } while (--n);
  ------------------
  |  Branch (197:14): [True: 342M, False: 19.2k]
  ------------------
  198|  19.2k|#ifndef FASTEST
  199|  19.2k|    n = wsize;
  200|  19.2k|    p = &s->prev[n];
  201|  13.0M|    do {
  202|  13.0M|        m = *--p;
  203|  13.0M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|  10.5M|#define NIL 0
  ------------------
  |  Branch (203:20): [True: 2.51M, False: 10.5M]
  ------------------
  204|       |        /* If n is not on any hash chain, prev[n] is garbage but
  205|       |         * its value will never be used.
  206|       |         */
  207|  13.0M|    } while (--n);
  ------------------
  |  Branch (207:14): [True: 13.0M, False: 19.2k]
  ------------------
  208|  19.2k|#endif
  209|  19.2k|    s->slid = 1;
  210|  19.2k|}
deflate.c:flush_pending:
  950|  38.1k|local void flush_pending(z_streamp strm) {
  951|  38.1k|    unsigned len;
  952|  38.1k|    deflate_state *s = strm->state;
  953|       |
  954|  38.1k|    _tr_flush_bits(s);
  955|  38.1k|    len = s->pending > strm->avail_out ? strm->avail_out :
  ------------------
  |  Branch (955:11): [True: 0, False: 38.1k]
  ------------------
  956|  38.1k|                                         (unsigned)s->pending;
  957|  38.1k|    if (len == 0) return;
  ------------------
  |  Branch (957:9): [True: 0, False: 38.1k]
  ------------------
  958|       |
  959|  38.1k|    zmemcpy(strm->next_out, s->pending_out, len);
  ------------------
  |  |  216|  38.1k|#    define zmemcpy memcpy
  ------------------
  960|  38.1k|    strm->next_out  += len;
  961|  38.1k|    s->pending_out  += len;
  962|  38.1k|    strm->total_out += len;
  963|  38.1k|    strm->avail_out -= len;
  964|  38.1k|    s->pending      -= len;
  965|  38.1k|    if (s->pending == 0) {
  ------------------
  |  Branch (965:9): [True: 38.1k, False: 0]
  ------------------
  966|  38.1k|        s->pending_out = s->pending_buf;
  967|  38.1k|    }
  968|  38.1k|}
deflate.c:putShortMSB:
  939|  20.3k|local void putShortMSB(deflate_state *s, uInt b) {
  940|  20.3k|    put_byte(s, (Byte)(b >> 8));
  ------------------
  |  |  293|  20.3k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  941|  20.3k|    put_byte(s, (Byte)(b & 0xff));
  ------------------
  |  |  293|  20.3k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  942|  20.3k|}
deflate.c:deflate_rle:
 2084|    903|local block_state deflate_rle(deflate_state *s, int flush) {
 2085|    903|    int bflush;             /* set if current block must be flushed */
 2086|    903|    uInt prev;              /* byte at distance one to match */
 2087|    903|    Bytef *scan, *strend;   /* scan goes up to strend for length of run */
 2088|       |
 2089|  2.48M|    for (;;) {
 2090|       |        /* Make sure that we always have enough lookahead, except
 2091|       |         * at the end of the input file. We need MAX_MATCH bytes
 2092|       |         * for the longest run, plus one for the unrolled loop.
 2093|       |         */
 2094|  2.48M|        if (s->lookahead <= MAX_MATCH) {
  ------------------
  |  |   93|  2.48M|#define MAX_MATCH  258
  ------------------
  |  Branch (2094:13): [True: 88.6k, False: 2.39M]
  ------------------
 2095|  88.6k|            fill_window(s);
 2096|  88.6k|            if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
  ------------------
  |  |   93|   177k|#define MAX_MATCH  258
  ------------------
                          if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|  85.1k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2096:17): [True: 85.1k, False: 3.50k]
  |  Branch (2096:46): [True: 0, False: 85.1k]
  ------------------
 2097|      0|                return need_more;
 2098|      0|            }
 2099|  88.6k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (2099:17): [True: 903, False: 87.7k]
  ------------------
 2100|  88.6k|        }
 2101|       |
 2102|       |        /* See how many times the previous byte repeats */
 2103|  2.48M|        s->match_length = 0;
 2104|  2.48M|        if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
  ------------------
  |  |   92|  4.96M|#define MIN_MATCH  3
  ------------------
  |  Branch (2104:13): [True: 2.47M, False: 1.26k]
  |  Branch (2104:42): [True: 2.47M, False: 0]
  ------------------
 2105|  2.47M|            scan = s->window + s->strstart - 1;
 2106|  2.47M|            prev = *scan;
 2107|  2.47M|            if (prev == *++scan && prev == *++scan && prev == *++scan) {
  ------------------
  |  Branch (2107:17): [True: 184k, False: 2.29M]
  |  Branch (2107:36): [True: 81.3k, False: 103k]
  |  Branch (2107:55): [True: 59.5k, False: 21.7k]
  ------------------
 2108|  59.5k|                strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |   93|  59.5k|#define MAX_MATCH  258
  ------------------
 2109|   257k|                do {
 2110|   257k|                } while (prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2110:26): [True: 235k, False: 21.8k]
  |  Branch (2110:45): [True: 226k, False: 9.12k]
  ------------------
 2111|   226k|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2111:26): [True: 221k, False: 5.40k]
  |  Branch (2111:45): [True: 216k, False: 4.87k]
  ------------------
 2112|   216k|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2112:26): [True: 212k, False: 3.33k]
  |  Branch (2112:45): [True: 210k, False: 2.68k]
  ------------------
 2113|   210k|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2113:26): [True: 207k, False: 2.31k]
  |  Branch (2113:45): [True: 202k, False: 5.39k]
  ------------------
 2114|   202k|                         scan < strend);
  ------------------
  |  Branch (2114:26): [True: 197k, False: 4.52k]
  ------------------
 2115|  59.5k|                s->match_length = MAX_MATCH - (uInt)(strend - scan);
  ------------------
  |  |   93|  59.5k|#define MAX_MATCH  258
  ------------------
 2116|  59.5k|                if (s->match_length > s->lookahead)
  ------------------
  |  Branch (2116:21): [True: 47, False: 59.4k]
  ------------------
 2117|     47|                    s->match_length = s->lookahead;
 2118|  59.5k|            }
 2119|  2.47M|            Assert(scan <= s->window + (uInt)(s->window_size - 1),
 2120|  2.47M|                   "wild scan");
 2121|  2.47M|        }
 2122|       |
 2123|       |        /* Emit match if have run of MIN_MATCH or longer, else emit literal */
 2124|  2.48M|        if (s->match_length >= MIN_MATCH) {
  ------------------
  |  |   92|  2.48M|#define MIN_MATCH  3
  ------------------
  |  Branch (2124:13): [True: 59.5k, False: 2.42M]
  ------------------
 2125|  59.5k|            check_match(s, s->strstart, s->strstart - 1, (int)s->match_length);
 2126|       |
 2127|  59.5k|            _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
  ------------------
  |  |  366|  59.5k|  { uch len = (uch)(length); \
  |  |  367|  59.5k|    ush dist = (ush)(distance); \
  |  |  368|  59.5k|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  369|  59.5k|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  370|  59.5k|    s->sym_buf[s->sym_next++] = len; \
  |  |  371|  59.5k|    dist--; \
  |  |  372|  59.5k|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|  59.5k|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  59.5k|#define Freq fc.freq
  |  |  ------------------
  |  |  373|  59.5k|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  321|  59.5k|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 59.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  59.5k|#define Freq fc.freq
  |  |  ------------------
  |  |  374|  59.5k|    flush = (s->sym_next == s->sym_end); \
  |  |  375|  59.5k|  }
  ------------------
 2128|       |
 2129|  59.5k|            s->lookahead -= s->match_length;
 2130|  59.5k|            s->strstart += s->match_length;
 2131|  59.5k|            s->match_length = 0;
 2132|  2.42M|        } else {
 2133|       |            /* No match, output a literal byte */
 2134|  2.42M|            Tracevv((stderr,"%c", s->window[s->strstart]));
 2135|  2.42M|            _tr_tally_lit(s, s->window[s->strstart], bflush);
  ------------------
  |  |  358|  2.42M|  { uch cc = (c); \
  |  |  359|  2.42M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  2.42M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  2.42M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  2.42M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  2.42M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  2.42M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  2.42M|   }
  ------------------
 2136|  2.42M|            s->lookahead--;
 2137|  2.42M|            s->strstart++;
 2138|  2.42M|        }
 2139|  2.48M|        if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1642|  4.02k|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|  4.02k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|  4.02k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|  4.02k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 3.56k, False: 462]
  |  |  |  |  ------------------
  |  |  |  | 1632|  4.02k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|  4.02k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    462|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|  4.02k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|  4.02k|                (last)); \
  |  |  |  | 1636|  4.02k|   s->block_start = s->strstart; \
  |  |  |  | 1637|  4.02k|   flush_pending(s->strm); \
  |  |  |  | 1638|  4.02k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|  4.02k|}
  |  |  ------------------
  |  | 1644|  4.02k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 4.02k]
  |  |  |  Branch (1644:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1645|  4.02k|}
  ------------------
  |  Branch (2139:13): [True: 4.02k, False: 2.47M]
  ------------------
 2140|  2.48M|    }
 2141|    903|    s->insert = 0;
 2142|    903|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|    903|#define Z_FINISH        4
  ------------------
  |  Branch (2142:9): [True: 903, False: 0]
  ------------------
 2143|    903|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1642|    903|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|    903|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|    903|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|    903|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 798, False: 105]
  |  |  |  |  ------------------
  |  |  |  | 1632|    903|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|    903|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    105|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|    903|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|    903|                (last)); \
  |  |  |  | 1636|    903|   s->block_start = s->strstart; \
  |  |  |  | 1637|    903|   flush_pending(s->strm); \
  |  |  |  | 1638|    903|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|    903|}
  |  |  ------------------
  |  | 1644|    903|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 903]
  |  |  |  Branch (1644:40): [True: 0, Folded]
  |  |  ------------------
  |  | 1645|    903|}
  ------------------
 2144|    903|        return finish_done;
 2145|    903|    }
 2146|      0|    if (s->sym_next)
  ------------------
  |  Branch (2146:9): [True: 0, False: 0]
  ------------------
 2147|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1642|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1632|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|      0|                (last)); \
  |  |  |  | 1636|      0|   s->block_start = s->strstart; \
  |  |  |  | 1637|      0|   flush_pending(s->strm); \
  |  |  |  | 1638|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|      0|}
  |  |  ------------------
  |  | 1644|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 0]
  |  |  |  Branch (1644:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1645|      0|}
  ------------------
 2148|      0|    return block_done;
 2149|      0|}
deflate.c:deflate_huff:
 2155|  1.08k|local block_state deflate_huff(deflate_state *s, int flush) {
 2156|  1.08k|    int bflush;             /* set if current block must be flushed */
 2157|       |
 2158|  5.40M|    for (;;) {
 2159|       |        /* Make sure that we have a literal to write. */
 2160|  5.40M|        if (s->lookahead == 0) {
  ------------------
  |  Branch (2160:13): [True: 7.31k, False: 5.39M]
  ------------------
 2161|  7.31k|            fill_window(s);
 2162|  7.31k|            if (s->lookahead == 0) {
  ------------------
  |  Branch (2162:17): [True: 1.08k, False: 6.23k]
  ------------------
 2163|  1.08k|                if (flush == Z_NO_FLUSH)
  ------------------
  |  |  172|  1.08k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2163:21): [True: 0, False: 1.08k]
  ------------------
 2164|      0|                    return need_more;
 2165|  1.08k|                break;      /* flush the current block */
 2166|  1.08k|            }
 2167|  7.31k|        }
 2168|       |
 2169|       |        /* Output a literal byte */
 2170|  5.39M|        s->match_length = 0;
 2171|  5.39M|        Tracevv((stderr,"%c", s->window[s->strstart]));
 2172|  5.39M|        _tr_tally_lit(s, s->window[s->strstart], bflush);
  ------------------
  |  |  358|  5.39M|  { uch cc = (c); \
  |  |  359|  5.39M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  5.39M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  5.39M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  5.39M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  5.39M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  5.39M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  5.39M|   }
  ------------------
 2173|  5.39M|        s->lookahead--;
 2174|  5.39M|        s->strstart++;
 2175|  5.39M|        if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1642|  12.6k|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|  12.6k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|  12.6k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|  12.6k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 11.7k, False: 870]
  |  |  |  |  ------------------
  |  |  |  | 1632|  12.6k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|  12.6k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    870|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|  12.6k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|  12.6k|                (last)); \
  |  |  |  | 1636|  12.6k|   s->block_start = s->strstart; \
  |  |  |  | 1637|  12.6k|   flush_pending(s->strm); \
  |  |  |  | 1638|  12.6k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|  12.6k|}
  |  |  ------------------
  |  | 1644|  12.6k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 12.6k]
  |  |  |  Branch (1644:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1645|  12.6k|}
  ------------------
  |  Branch (2175:13): [True: 12.6k, False: 5.38M]
  ------------------
 2176|  5.39M|    }
 2177|  1.08k|    s->insert = 0;
 2178|  1.08k|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|  1.08k|#define Z_FINISH        4
  ------------------
  |  Branch (2178:9): [True: 1.08k, False: 0]
  ------------------
 2179|  1.08k|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1642|  1.08k|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|  1.08k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|  1.08k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|  1.08k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 964, False: 120]
  |  |  |  |  ------------------
  |  |  |  | 1632|  1.08k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|  1.08k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    120|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|  1.08k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|  1.08k|                (last)); \
  |  |  |  | 1636|  1.08k|   s->block_start = s->strstart; \
  |  |  |  | 1637|  1.08k|   flush_pending(s->strm); \
  |  |  |  | 1638|  1.08k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|  1.08k|}
  |  |  ------------------
  |  | 1644|  1.08k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 1.08k]
  |  |  |  Branch (1644:40): [True: 0, Folded]
  |  |  ------------------
  |  | 1645|  1.08k|}
  ------------------
 2180|  1.08k|        return finish_done;
 2181|  1.08k|    }
 2182|      0|    if (s->sym_next)
  ------------------
  |  Branch (2182:9): [True: 0, False: 0]
  ------------------
 2183|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1642|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1643|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1630|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1631|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1631:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1632|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1633|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1634|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1635|      0|                (last)); \
  |  |  |  | 1636|      0|   s->block_start = s->strstart; \
  |  |  |  | 1637|      0|   flush_pending(s->strm); \
  |  |  |  | 1638|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1639|      0|}
  |  |  ------------------
  |  | 1644|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1644:8): [True: 0, False: 0]
  |  |  |  Branch (1644:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1645|      0|}
  ------------------
 2184|      0|    return block_done;
 2185|      0|}

inflate_fast:
   50|  19.6k|void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
   51|  19.6k|    struct inflate_state FAR *state;
   52|  19.6k|    z_const unsigned char FAR *in;      /* local strm->next_in */
   53|  19.6k|    z_const unsigned char FAR *last;    /* have enough input while in < last */
   54|  19.6k|    unsigned char FAR *out;     /* local strm->next_out */
   55|  19.6k|    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
   56|  19.6k|    unsigned char FAR *end;     /* while out < end, enough space available */
   57|       |#ifdef INFLATE_STRICT
   58|       |    unsigned dmax;              /* maximum distance from zlib header */
   59|       |#endif
   60|  19.6k|    unsigned wsize;             /* window size or zero if not using window */
   61|  19.6k|    unsigned whave;             /* valid bytes in the window */
   62|  19.6k|    unsigned wnext;             /* window write index */
   63|  19.6k|    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
   64|  19.6k|    unsigned long hold;         /* local strm->hold */
   65|  19.6k|    unsigned bits;              /* local strm->bits */
   66|  19.6k|    code const FAR *lcode;      /* local strm->lencode */
   67|  19.6k|    code const FAR *dcode;      /* local strm->distcode */
   68|  19.6k|    unsigned lmask;             /* mask for first level of length codes */
   69|  19.6k|    unsigned dmask;             /* mask for first level of distance codes */
   70|  19.6k|    code const *here;           /* retrieved table entry */
   71|  19.6k|    unsigned op;                /* code bits, operation, extra bits, or */
   72|       |                                /*  window position, window bytes to copy */
   73|  19.6k|    unsigned len;               /* match length, unused bytes */
   74|  19.6k|    unsigned dist;              /* match distance */
   75|  19.6k|    unsigned char FAR *from;    /* where to copy match from */
   76|       |
   77|       |    /* copy state to local variables */
   78|  19.6k|    state = (struct inflate_state FAR *)strm->state;
   79|  19.6k|    in = strm->next_in;
   80|  19.6k|    last = in + (strm->avail_in - 5);
   81|  19.6k|    out = strm->next_out;
   82|  19.6k|    beg = out - (start - strm->avail_out);
   83|  19.6k|    end = out + (strm->avail_out - 257);
   84|       |#ifdef INFLATE_STRICT
   85|       |    dmax = state->dmax;
   86|       |#endif
   87|  19.6k|    wsize = state->wsize;
   88|  19.6k|    whave = state->whave;
   89|  19.6k|    wnext = state->wnext;
   90|  19.6k|    window = state->window;
   91|  19.6k|    hold = state->hold;
   92|  19.6k|    bits = state->bits;
   93|  19.6k|    lcode = state->lencode;
   94|  19.6k|    dcode = state->distcode;
   95|  19.6k|    lmask = (1U << state->lenbits) - 1;
   96|  19.6k|    dmask = (1U << state->distbits) - 1;
   97|       |
   98|       |    /* decode literals and length/distances until end-of-block or not enough
   99|       |       input data or output space */
  100|  9.79M|    do {
  101|  9.79M|        if (bits < 15) {
  ------------------
  |  Branch (101:13): [True: 3.51M, False: 6.28M]
  ------------------
  102|  3.51M|            hold += (unsigned long)(*in++) << bits;
  103|  3.51M|            bits += 8;
  104|  3.51M|            hold += (unsigned long)(*in++) << bits;
  105|  3.51M|            bits += 8;
  106|  3.51M|        }
  107|  9.79M|        here = lcode + (hold & lmask);
  108|  9.95M|      dolen:
  109|  9.95M|        op = (unsigned)(here->bits);
  110|  9.95M|        hold >>= op;
  111|  9.95M|        bits -= op;
  112|  9.95M|        op = (unsigned)(here->op);
  113|  9.95M|        if (op == 0) {                          /* literal */
  ------------------
  |  Branch (113:13): [True: 9.39M, False: 559k]
  ------------------
  114|  9.39M|            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
  115|  9.39M|                    "inflate:         literal '%c'\n" :
  116|  9.39M|                    "inflate:         literal 0x%02x\n", here->val));
  117|  9.39M|            *out++ = (unsigned char)(here->val);
  118|  9.39M|        }
  119|   559k|        else if (op & 16) {                     /* length base */
  ------------------
  |  Branch (119:18): [True: 381k, False: 177k]
  ------------------
  120|   381k|            len = (unsigned)(here->val);
  121|   381k|            op &= 15;                           /* number of extra bits */
  122|   381k|            if (op) {
  ------------------
  |  Branch (122:17): [True: 82.2k, False: 299k]
  ------------------
  123|  82.2k|                if (bits < op) {
  ------------------
  |  Branch (123:21): [True: 336, False: 81.9k]
  ------------------
  124|    336|                    hold += (unsigned long)(*in++) << bits;
  125|    336|                    bits += 8;
  126|    336|                }
  127|  82.2k|                len += (unsigned)hold & ((1U << op) - 1);
  128|  82.2k|                hold >>= op;
  129|  82.2k|                bits -= op;
  130|  82.2k|            }
  131|   381k|            Tracevv((stderr, "inflate:         length %u\n", len));
  132|   381k|            if (bits < 15) {
  ------------------
  |  Branch (132:17): [True: 149k, False: 232k]
  ------------------
  133|   149k|                hold += (unsigned long)(*in++) << bits;
  134|   149k|                bits += 8;
  135|   149k|                hold += (unsigned long)(*in++) << bits;
  136|   149k|                bits += 8;
  137|   149k|            }
  138|   381k|            here = dcode + (hold & dmask);
  139|   386k|          dodist:
  140|   386k|            op = (unsigned)(here->bits);
  141|   386k|            hold >>= op;
  142|   386k|            bits -= op;
  143|   386k|            op = (unsigned)(here->op);
  144|   386k|            if (op & 16) {                      /* distance base */
  ------------------
  |  Branch (144:17): [True: 381k, False: 5.24k]
  ------------------
  145|   381k|                dist = (unsigned)(here->val);
  146|   381k|                op &= 15;                       /* number of extra bits */
  147|   381k|                if (bits < op) {
  ------------------
  |  Branch (147:21): [True: 1.40k, False: 380k]
  ------------------
  148|  1.40k|                    hold += (unsigned long)(*in++) << bits;
  149|  1.40k|                    bits += 8;
  150|  1.40k|                    if (bits < op) {
  ------------------
  |  Branch (150:25): [True: 11, False: 1.39k]
  ------------------
  151|     11|                        hold += (unsigned long)(*in++) << bits;
  152|     11|                        bits += 8;
  153|     11|                    }
  154|  1.40k|                }
  155|   381k|                dist += (unsigned)hold & ((1U << op) - 1);
  156|       |#ifdef INFLATE_STRICT
  157|       |                if (dist > dmax) {
  158|       |                    strm->msg = (z_const char *)
  159|       |                        "invalid distance too far back";
  160|       |                    state->mode = BAD;
  161|       |                    break;
  162|       |                }
  163|       |#endif
  164|   381k|                hold >>= op;
  165|   381k|                bits -= op;
  166|   381k|                Tracevv((stderr, "inflate:         distance %u\n", dist));
  167|   381k|                op = (unsigned)(out - beg);     /* max distance in output */
  168|   381k|                if (dist > op) {                /* see if copy from window */
  ------------------
  |  Branch (168:21): [True: 4.16k, False: 377k]
  ------------------
  169|  4.16k|                    op = dist - op;             /* distance back in window */
  170|  4.16k|                    if (op > whave) {
  ------------------
  |  Branch (170:25): [True: 0, False: 4.16k]
  ------------------
  171|      0|                        if (state->sane) {
  ------------------
  |  Branch (171:29): [True: 0, False: 0]
  ------------------
  172|      0|                            strm->msg = (z_const char *)
  173|      0|                                "invalid distance too far back";
  174|      0|                            state->mode = BAD;
  175|      0|                            break;
  176|      0|                        }
  177|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  178|       |                        if (len <= op - whave) {
  179|       |                            do {
  180|       |                                *out++ = 0;
  181|       |                            } while (--len);
  182|       |                            continue;
  183|       |                        }
  184|       |                        len -= op - whave;
  185|       |                        do {
  186|       |                            *out++ = 0;
  187|       |                        } while (--op > whave);
  188|       |                        if (op == 0) {
  189|       |                            from = out - dist;
  190|       |                            do {
  191|       |                                *out++ = *from++;
  192|       |                            } while (--len);
  193|       |                            continue;
  194|       |                        }
  195|       |#endif
  196|      0|                    }
  197|  4.16k|                    from = window;
  198|  4.16k|                    if (wnext == 0) {           /* very common case */
  ------------------
  |  Branch (198:25): [True: 0, False: 4.16k]
  ------------------
  199|      0|                        from += wsize - op;
  200|      0|                        if (op < len) {         /* some from window */
  ------------------
  |  Branch (200:29): [True: 0, False: 0]
  ------------------
  201|      0|                            len -= op;
  202|      0|                            do {
  203|      0|                                *out++ = *from++;
  204|      0|                            } while (--op);
  ------------------
  |  Branch (204:38): [True: 0, False: 0]
  ------------------
  205|      0|                            from = out - dist;  /* rest from output */
  206|      0|                        }
  207|      0|                    }
  208|  4.16k|                    else if (wnext < op) {      /* wrap around window */
  ------------------
  |  Branch (208:30): [True: 0, False: 4.16k]
  ------------------
  209|      0|                        from += wsize + wnext - op;
  210|      0|                        op -= wnext;
  211|      0|                        if (op < len) {         /* some from end of window */
  ------------------
  |  Branch (211:29): [True: 0, False: 0]
  ------------------
  212|      0|                            len -= op;
  213|      0|                            do {
  214|      0|                                *out++ = *from++;
  215|      0|                            } while (--op);
  ------------------
  |  Branch (215:38): [True: 0, False: 0]
  ------------------
  216|      0|                            from = window;
  217|      0|                            if (wnext < len) {  /* some from start of window */
  ------------------
  |  Branch (217:33): [True: 0, False: 0]
  ------------------
  218|      0|                                op = wnext;
  219|      0|                                len -= op;
  220|      0|                                do {
  221|      0|                                    *out++ = *from++;
  222|      0|                                } while (--op);
  ------------------
  |  Branch (222:42): [True: 0, False: 0]
  ------------------
  223|      0|                                from = out - dist;      /* rest from output */
  224|      0|                            }
  225|      0|                        }
  226|      0|                    }
  227|  4.16k|                    else {                      /* contiguous in window */
  228|  4.16k|                        from += wnext - op;
  229|  4.16k|                        if (op < len) {         /* some from window */
  ------------------
  |  Branch (229:29): [True: 262, False: 3.90k]
  ------------------
  230|    262|                            len -= op;
  231|  4.12k|                            do {
  232|  4.12k|                                *out++ = *from++;
  233|  4.12k|                            } while (--op);
  ------------------
  |  Branch (233:38): [True: 3.86k, False: 262]
  ------------------
  234|    262|                            from = out - dist;  /* rest from output */
  235|    262|                        }
  236|  4.16k|                    }
  237|  57.2k|                    while (len > 2) {
  ------------------
  |  Branch (237:28): [True: 53.0k, False: 4.16k]
  ------------------
  238|  53.0k|                        *out++ = *from++;
  239|  53.0k|                        *out++ = *from++;
  240|  53.0k|                        *out++ = *from++;
  241|  53.0k|                        len -= 3;
  242|  53.0k|                    }
  243|  4.16k|                    if (len) {
  ------------------
  |  Branch (243:25): [True: 1.85k, False: 2.31k]
  ------------------
  244|  1.85k|                        *out++ = *from++;
  245|  1.85k|                        if (len > 1)
  ------------------
  |  Branch (245:29): [True: 1.01k, False: 838]
  ------------------
  246|  1.01k|                            *out++ = *from++;
  247|  1.85k|                    }
  248|  4.16k|                }
  249|   377k|                else {
  250|   377k|                    from = out - dist;          /* copy direct from output */
  251|  2.83M|                    do {                        /* minimum length is three */
  252|  2.83M|                        *out++ = *from++;
  253|  2.83M|                        *out++ = *from++;
  254|  2.83M|                        *out++ = *from++;
  255|  2.83M|                        len -= 3;
  256|  2.83M|                    } while (len > 2);
  ------------------
  |  Branch (256:30): [True: 2.45M, False: 377k]
  ------------------
  257|   377k|                    if (len) {
  ------------------
  |  Branch (257:25): [True: 174k, False: 202k]
  ------------------
  258|   174k|                        *out++ = *from++;
  259|   174k|                        if (len > 1)
  ------------------
  |  Branch (259:29): [True: 75.6k, False: 99.0k]
  ------------------
  260|  75.6k|                            *out++ = *from++;
  261|   174k|                    }
  262|   377k|                }
  263|   381k|            }
  264|  5.24k|            else if ((op & 64) == 0) {          /* 2nd level distance code */
  ------------------
  |  Branch (264:22): [True: 5.24k, False: 0]
  ------------------
  265|  5.24k|                here = dcode + here->val + (hold & ((1U << op) - 1));
  266|  5.24k|                goto dodist;
  267|  5.24k|            }
  268|      0|            else {
  269|      0|                strm->msg = (z_const char *)"invalid distance code";
  270|      0|                state->mode = BAD;
  271|      0|                break;
  272|      0|            }
  273|   386k|        }
  274|   177k|        else if ((op & 64) == 0) {              /* 2nd level length code */
  ------------------
  |  Branch (274:18): [True: 159k, False: 17.7k]
  ------------------
  275|   159k|            here = lcode + here->val + (hold & ((1U << op) - 1));
  276|   159k|            goto dolen;
  277|   159k|        }
  278|  17.7k|        else if (op & 32) {                     /* end-of-block */
  ------------------
  |  Branch (278:18): [True: 17.7k, False: 0]
  ------------------
  279|  17.7k|            Tracevv((stderr, "inflate:         end of block\n"));
  280|  17.7k|            state->mode = TYPE;
  281|  17.7k|            break;
  282|  17.7k|        }
  283|      0|        else {
  284|      0|            strm->msg = (z_const char *)"invalid literal/length code";
  285|      0|            state->mode = BAD;
  286|      0|            break;
  287|      0|        }
  288|  9.95M|    } while (in < last && out < end);
  ------------------
  |  Branch (288:14): [True: 9.77M, False: 0]
  |  Branch (288:27): [True: 9.77M, False: 1.89k]
  ------------------
  289|       |
  290|       |    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  291|  19.6k|    len = bits >> 3;
  292|  19.6k|    in -= len;
  293|  19.6k|    bits -= len << 3;
  294|  19.6k|    hold &= (1U << bits) - 1;
  295|       |
  296|       |    /* update state and return */
  297|  19.6k|    strm->next_in = in;
  298|  19.6k|    strm->next_out = out;
  299|  19.6k|    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
  ------------------
  |  Branch (299:33): [True: 19.6k, False: 0]
  ------------------
  300|  19.6k|    strm->avail_out = (unsigned)(out < end ?
  ------------------
  |  Branch (300:34): [True: 17.7k, False: 1.89k]
  ------------------
  301|  17.7k|                                 257 + (end - out) : 257 - (out - end));
  302|  19.6k|    state->hold = hold;
  303|  19.6k|    state->bits = bits;
  304|  19.6k|    return;
  305|  19.6k|}

inflateResetKeep:
  100|  4.17k|int ZEXPORT inflateResetKeep(z_streamp strm) {
  101|  4.17k|    struct inflate_state FAR *state;
  102|       |
  103|  4.17k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (103:9): [True: 0, False: 4.17k]
  ------------------
  104|  4.17k|    state = (struct inflate_state FAR *)strm->state;
  105|  4.17k|    strm->total_in = strm->total_out = state->total = 0;
  106|  4.17k|    strm->msg = Z_NULL;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  107|  4.17k|    strm->data_type = 0;
  108|  4.17k|    if (state->wrap)        /* to support ill-conceived Java test suite */
  ------------------
  |  Branch (108:9): [True: 4.17k, False: 0]
  ------------------
  109|  4.17k|        strm->adler = state->wrap & 1;
  110|  4.17k|    state->mode = HEAD;
  111|  4.17k|    state->last = 0;
  112|  4.17k|    state->havedict = 0;
  113|  4.17k|    state->flags = -1;
  114|  4.17k|    state->dmax = 32768U;
  115|  4.17k|    state->head = Z_NULL;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  116|  4.17k|    state->hold = 0;
  117|  4.17k|    state->bits = 0;
  118|  4.17k|    state->lencode = state->distcode = state->next = state->codes;
  119|  4.17k|    state->sane = 1;
  120|  4.17k|    state->back = -1;
  121|  4.17k|    Tracev((stderr, "inflate: reset\n"));
  122|  4.17k|    return Z_OK;
  ------------------
  |  |  181|  4.17k|#define Z_OK            0
  ------------------
  123|  4.17k|}
inflateReset:
  125|  4.17k|int ZEXPORT inflateReset(z_streamp strm) {
  126|  4.17k|    struct inflate_state FAR *state;
  127|       |
  128|  4.17k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (128:9): [True: 0, False: 4.17k]
  ------------------
  129|  4.17k|    state = (struct inflate_state FAR *)strm->state;
  130|  4.17k|    state->wsize = 0;
  131|  4.17k|    state->whave = 0;
  132|  4.17k|    state->wnext = 0;
  133|  4.17k|    return inflateResetKeep(strm);
  134|  4.17k|}
inflateReset2:
  136|  4.17k|int ZEXPORT inflateReset2(z_streamp strm, int windowBits) {
  137|  4.17k|    int wrap;
  138|  4.17k|    struct inflate_state FAR *state;
  139|       |
  140|       |    /* get the state */
  141|  4.17k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (141:9): [True: 0, False: 4.17k]
  ------------------
  142|  4.17k|    state = (struct inflate_state FAR *)strm->state;
  143|       |
  144|       |    /* extract wrap request from windowBits parameter */
  145|  4.17k|    if (windowBits < 0) {
  ------------------
  |  Branch (145:9): [True: 0, False: 4.17k]
  ------------------
  146|      0|        if (windowBits < -15)
  ------------------
  |  Branch (146:13): [True: 0, False: 0]
  ------------------
  147|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  148|      0|        wrap = 0;
  149|      0|        windowBits = -windowBits;
  150|      0|    }
  151|  4.17k|    else {
  152|  4.17k|        wrap = (windowBits >> 4) + 5;
  153|  4.17k|#ifdef GUNZIP
  154|  4.17k|        if (windowBits < 48)
  ------------------
  |  Branch (154:13): [True: 4.17k, False: 0]
  ------------------
  155|  4.17k|            windowBits &= 15;
  156|  4.17k|#endif
  157|  4.17k|    }
  158|       |
  159|       |    /* set number of window bits, free window if different */
  160|  4.17k|    if (windowBits && (windowBits < 8 || windowBits > 15))
  ------------------
  |  Branch (160:9): [True: 4.17k, False: 0]
  |  Branch (160:24): [True: 0, False: 4.17k]
  |  Branch (160:42): [True: 0, False: 4.17k]
  ------------------
  161|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  162|  4.17k|    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
  ------------------
  |  |  216|  8.34k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (162:9): [True: 0, False: 4.17k]
  |  Branch (162:36): [True: 0, False: 0]
  ------------------
  163|      0|        ZFREE(strm, state->window);
  ------------------
  |  |  254|      0|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  164|      0|        state->window = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  165|      0|    }
  166|       |
  167|       |    /* update state and reset the rest of it */
  168|  4.17k|    state->wrap = wrap;
  169|  4.17k|    state->wbits = (unsigned)windowBits;
  170|  4.17k|    return inflateReset(strm);
  171|  4.17k|}
inflateInit2_:
  174|  4.17k|                          const char *version, int stream_size) {
  175|  4.17k|    int ret;
  176|  4.17k|    struct inflate_state FAR *state;
  177|       |
  178|  4.17k|    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
  ------------------
  |  |  216|  8.34k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
  ------------------
  |  |   44|  4.17k|#define ZLIB_VERSION "1.3.2.1-motley"
  ------------------
  |  Branch (178:9): [True: 0, False: 4.17k]
  |  Branch (178:30): [True: 0, False: 4.17k]
  ------------------
  179|  4.17k|        stream_size != (int)(sizeof(z_stream)))
  ------------------
  |  Branch (179:9): [True: 0, False: 4.17k]
  ------------------
  180|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  189|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  181|  4.17k|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (181:9): [True: 0, False: 4.17k]
  ------------------
  182|  4.17k|    strm->msg = Z_NULL;                 /* in case we return an error */
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  183|  4.17k|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (183:9): [True: 4.17k, False: 0]
  ------------------
  184|       |#ifdef Z_SOLO
  185|       |        return Z_STREAM_ERROR;
  186|       |#else
  187|  4.17k|        strm->zalloc = zcalloc;
  188|  4.17k|        strm->opaque = (voidpf)0;
  189|  4.17k|#endif
  190|  4.17k|    }
  191|  4.17k|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (191:9): [True: 4.17k, False: 0]
  ------------------
  192|       |#ifdef Z_SOLO
  193|       |        return Z_STREAM_ERROR;
  194|       |#else
  195|  4.17k|        strm->zfree = zcfree;
  196|  4.17k|#endif
  197|  4.17k|    state = (struct inflate_state FAR *)
  198|  4.17k|            ZALLOC(strm, 1, sizeof(struct inflate_state));
  ------------------
  |  |  253|  4.17k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  199|  4.17k|    if (state == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (state == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (199:9): [True: 0, False: 4.17k]
  ------------------
  200|  4.17k|    zmemzero(state, sizeof(struct inflate_state));
  ------------------
  |  |  218|  4.17k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  201|  4.17k|    Tracev((stderr, "inflate: allocated\n"));
  202|  4.17k|    strm->state = (struct internal_state FAR *)state;
  203|  4.17k|    state->strm = strm;
  204|  4.17k|    state->window = Z_NULL;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  205|  4.17k|    state->mode = HEAD;     /* to pass state test in inflateReset2() */
  206|  4.17k|    ret = inflateReset2(strm, windowBits);
  207|  4.17k|    if (ret != Z_OK) {
  ------------------
  |  |  181|  4.17k|#define Z_OK            0
  ------------------
  |  Branch (207:9): [True: 0, False: 4.17k]
  ------------------
  208|      0|        ZFREE(strm, state);
  ------------------
  |  |  254|      0|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  209|      0|        strm->state = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  210|      0|    }
  211|  4.17k|    return ret;
  212|  4.17k|}
inflateInit_:
  215|  4.17k|                         int stream_size) {
  216|  4.17k|    return inflateInit2_(strm, DEF_WBITS, version, stream_size);
  ------------------
  |  |   76|  4.17k|#  define DEF_WBITS MAX_WBITS
  |  |  ------------------
  |  |  |  |  287|  4.17k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  |  |  ------------------
  ------------------
  217|  4.17k|}
inflate:
  474|  8.06k|int ZEXPORT inflate(z_streamp strm, int flush) {
  475|  8.06k|    struct inflate_state FAR *state;
  476|  8.06k|    z_const unsigned char FAR *next;    /* next input */
  477|  8.06k|    unsigned char FAR *put;     /* next output */
  478|  8.06k|    unsigned have, left;        /* available input and output */
  479|  8.06k|    unsigned long hold;         /* bit buffer */
  480|  8.06k|    unsigned bits;              /* bits in bit buffer */
  481|  8.06k|    unsigned in, out;           /* save starting available input and output */
  482|  8.06k|    unsigned copy;              /* number of stored or match bytes to copy */
  483|  8.06k|    unsigned char FAR *from;    /* where to copy match bytes from */
  484|  8.06k|    code here;                  /* current decoding table entry */
  485|  8.06k|    code last;                  /* parent table entry */
  486|  8.06k|    unsigned len;               /* length to copy for repeats, bits to drop */
  487|  8.06k|    int ret;                    /* return code */
  488|  8.06k|#ifdef GUNZIP
  489|  8.06k|    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
  490|  8.06k|#endif
  491|  8.06k|    static const unsigned short order[19] = /* permutation of code lengths */
  492|  8.06k|        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
  493|       |
  494|  8.06k|    if (inflateStateCheck(strm) || strm->next_out == Z_NULL ||
  ------------------
  |  |  216|  16.1k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (494:9): [True: 0, False: 8.06k]
  |  Branch (494:36): [True: 0, False: 8.06k]
  ------------------
  495|  8.06k|        (strm->next_in == Z_NULL && strm->avail_in != 0))
  ------------------
  |  |  216|  16.1k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (495:10): [True: 0, False: 8.06k]
  |  Branch (495:37): [True: 0, False: 0]
  ------------------
  496|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  497|       |
  498|  8.06k|    state = (struct inflate_state FAR *)strm->state;
  499|  8.06k|    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
  ------------------
  |  Branch (499:9): [True: 0, False: 8.06k]
  ------------------
  500|  8.06k|    LOAD();
  ------------------
  |  |  329|  8.06k|    do { \
  |  |  330|  8.06k|        put = strm->next_out; \
  |  |  331|  8.06k|        left = strm->avail_out; \
  |  |  332|  8.06k|        next = strm->next_in; \
  |  |  333|  8.06k|        have = strm->avail_in; \
  |  |  334|  8.06k|        hold = state->hold; \
  |  |  335|  8.06k|        bits = state->bits; \
  |  |  336|  8.06k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (336:14): [Folded, False: 8.06k]
  |  |  ------------------
  ------------------
  501|  8.06k|    in = have;
  502|  8.06k|    out = left;
  503|  8.06k|    ret = Z_OK;
  ------------------
  |  |  181|  8.06k|#define Z_OK            0
  ------------------
  504|  8.06k|    for (;;)
  505|   788k|        switch (state->mode) {
  506|  4.17k|        case HEAD:
  ------------------
  |  Branch (506:9): [True: 4.17k, False: 784k]
  ------------------
  507|  4.17k|            if (state->wrap == 0) {
  ------------------
  |  Branch (507:17): [True: 0, False: 4.17k]
  ------------------
  508|      0|                state->mode = TYPEDO;
  509|      0|                break;
  510|      0|            }
  511|  4.17k|            NEEDBITS(16);
  ------------------
  |  |  369|  4.17k|    do { \
  |  |  370|  12.5k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 8.34k, False: 4.17k]
  |  |  ------------------
  |  |  371|  8.34k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  8.34k|    do { \
  |  |  |  |  360|  8.34k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 8.34k]
  |  |  |  |  ------------------
  |  |  |  |  361|  8.34k|        have--; \
  |  |  |  |  362|  8.34k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  8.34k|        bits += 8; \
  |  |  |  |  364|  8.34k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 8.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  4.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 4.17k]
  |  |  ------------------
  ------------------
  512|  4.17k|#ifdef GUNZIP
  513|  4.17k|            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
  ------------------
  |  Branch (513:17): [True: 0, False: 4.17k]
  |  Branch (513:38): [True: 0, False: 0]
  ------------------
  514|      0|                if (state->wbits == 0)
  ------------------
  |  Branch (514:21): [True: 0, False: 0]
  ------------------
  515|      0|                    state->wbits = 15;
  516|      0|                state->check = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  517|      0|                CRC2(state->check, hold);
  ------------------
  |  |  311|      0|    do { \
  |  |  312|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  313|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  314|      0|        check = crc32(check, hbuf, 2); \
  |  |  315|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (315:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  518|      0|                INITBITS();
  ------------------
  |  |  351|      0|    do { \
  |  |  352|      0|        hold = 0; \
  |  |  353|      0|        bits = 0; \
  |  |  354|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  519|      0|                state->mode = FLAGS;
  520|      0|                break;
  521|      0|            }
  522|  4.17k|            if (state->head != Z_NULL)
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (522:17): [True: 0, False: 4.17k]
  ------------------
  523|      0|                state->head->done = -1;
  524|  4.17k|            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
  ------------------
  |  Branch (524:17): [True: 0, False: 4.17k]
  ------------------
  525|       |#else
  526|       |            if (
  527|       |#endif
  528|  4.17k|                ((BITS(8) << 8) + (hold >> 8)) % 31) {
  ------------------
  |  |  376|  4.17k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  |  Branch (528:17): [True: 0, False: 4.17k]
  ------------------
  529|      0|                strm->msg = (z_const char *)"incorrect header check";
  530|      0|                state->mode = BAD;
  531|      0|                break;
  532|      0|            }
  533|  4.17k|            if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  376|  4.17k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
                          if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  213|  4.17k|#define Z_DEFLATED   8
  ------------------
  |  Branch (533:17): [True: 0, False: 4.17k]
  ------------------
  534|      0|                strm->msg = (z_const char *)"unknown compression method";
  535|      0|                state->mode = BAD;
  536|      0|                break;
  537|      0|            }
  538|  4.17k|            DROPBITS(4);
  ------------------
  |  |  380|  4.17k|    do { \
  |  |  381|  4.17k|        hold >>= (n); \
  |  |  382|  4.17k|        bits -= (unsigned)(n); \
  |  |  383|  4.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 4.17k]
  |  |  ------------------
  ------------------
  539|  4.17k|            len = BITS(4) + 8;
  ------------------
  |  |  376|  4.17k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  540|  4.17k|            if (state->wbits == 0)
  ------------------
  |  Branch (540:17): [True: 0, False: 4.17k]
  ------------------
  541|      0|                state->wbits = len;
  542|  4.17k|            if (len > 15 || len > state->wbits) {
  ------------------
  |  Branch (542:17): [True: 0, False: 4.17k]
  |  Branch (542:29): [True: 0, False: 4.17k]
  ------------------
  543|      0|                strm->msg = (z_const char *)"invalid window size";
  544|      0|                state->mode = BAD;
  545|      0|                break;
  546|      0|            }
  547|  4.17k|            state->dmax = 1U << len;
  548|  4.17k|            state->flags = 0;               /* indicate zlib header */
  549|  4.17k|            Tracev((stderr, "inflate:   zlib header ok\n"));
  550|  4.17k|            strm->adler = state->check = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  551|  4.17k|            state->mode = hold & 0x200 ? DICTID : TYPE;
  ------------------
  |  Branch (551:27): [True: 3.89k, False: 277]
  ------------------
  552|  4.17k|            INITBITS();
  ------------------
  |  |  351|  4.17k|    do { \
  |  |  352|  4.17k|        hold = 0; \
  |  |  353|  4.17k|        bits = 0; \
  |  |  354|  4.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 4.17k]
  |  |  ------------------
  ------------------
  553|  4.17k|            break;
  554|      0|#ifdef GUNZIP
  555|      0|        case FLAGS:
  ------------------
  |  Branch (555:9): [True: 0, False: 788k]
  ------------------
  556|      0|            NEEDBITS(16);
  ------------------
  |  |  369|      0|    do { \
  |  |  370|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  371|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|      0|    do { \
  |  |  |  |  360|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        have--; \
  |  |  |  |  362|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|      0|        bits += 8; \
  |  |  |  |  364|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  557|      0|            state->flags = (int)(hold);
  558|      0|            if ((state->flags & 0xff) != Z_DEFLATED) {
  ------------------
  |  |  213|      0|#define Z_DEFLATED   8
  ------------------
  |  Branch (558:17): [True: 0, False: 0]
  ------------------
  559|      0|                strm->msg = (z_const char *)"unknown compression method";
  560|      0|                state->mode = BAD;
  561|      0|                break;
  562|      0|            }
  563|      0|            if (state->flags & 0xe000) {
  ------------------
  |  Branch (563:17): [True: 0, False: 0]
  ------------------
  564|      0|                strm->msg = (z_const char *)"unknown header flags set";
  565|      0|                state->mode = BAD;
  566|      0|                break;
  567|      0|            }
  568|      0|            if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (568:17): [True: 0, False: 0]
  ------------------
  569|      0|                state->head->text = (int)((hold >> 8) & 1);
  570|      0|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (570:17): [True: 0, False: 0]
  |  Branch (570:44): [True: 0, False: 0]
  ------------------
  571|      0|                CRC2(state->check, hold);
  ------------------
  |  |  311|      0|    do { \
  |  |  312|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  313|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  314|      0|        check = crc32(check, hbuf, 2); \
  |  |  315|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (315:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  572|      0|            INITBITS();
  ------------------
  |  |  351|      0|    do { \
  |  |  352|      0|        hold = 0; \
  |  |  353|      0|        bits = 0; \
  |  |  354|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  573|      0|            state->mode = TIME;
  574|       |                /* fallthrough */
  575|      0|        case TIME:
  ------------------
  |  Branch (575:9): [True: 0, False: 788k]
  ------------------
  576|      0|            NEEDBITS(32);
  ------------------
  |  |  369|      0|    do { \
  |  |  370|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  371|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|      0|    do { \
  |  |  |  |  360|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        have--; \
  |  |  |  |  362|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|      0|        bits += 8; \
  |  |  |  |  364|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  577|      0|            if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (577:17): [True: 0, False: 0]
  ------------------
  578|      0|                state->head->time = hold;
  579|      0|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (579:17): [True: 0, False: 0]
  |  Branch (579:44): [True: 0, False: 0]
  ------------------
  580|      0|                CRC4(state->check, hold);
  ------------------
  |  |  318|      0|    do { \
  |  |  319|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  320|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  321|      0|        hbuf[2] = (unsigned char)((word) >> 16); \
  |  |  322|      0|        hbuf[3] = (unsigned char)((word) >> 24); \
  |  |  323|      0|        check = crc32(check, hbuf, 4); \
  |  |  324|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (324:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  581|      0|            INITBITS();
  ------------------
  |  |  351|      0|    do { \
  |  |  352|      0|        hold = 0; \
  |  |  353|      0|        bits = 0; \
  |  |  354|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  582|      0|            state->mode = OS;
  583|       |                /* fallthrough */
  584|      0|        case OS:
  ------------------
  |  Branch (584:9): [True: 0, False: 788k]
  ------------------
  585|      0|            NEEDBITS(16);
  ------------------
  |  |  369|      0|    do { \
  |  |  370|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  371|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|      0|    do { \
  |  |  |  |  360|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        have--; \
  |  |  |  |  362|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|      0|        bits += 8; \
  |  |  |  |  364|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  586|      0|            if (state->head != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (586:17): [True: 0, False: 0]
  ------------------
  587|      0|                state->head->xflags = (int)(hold & 0xff);
  588|      0|                state->head->os = (int)(hold >> 8);
  589|      0|            }
  590|      0|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (590:17): [True: 0, False: 0]
  |  Branch (590:44): [True: 0, False: 0]
  ------------------
  591|      0|                CRC2(state->check, hold);
  ------------------
  |  |  311|      0|    do { \
  |  |  312|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  313|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  314|      0|        check = crc32(check, hbuf, 2); \
  |  |  315|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (315:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  592|      0|            INITBITS();
  ------------------
  |  |  351|      0|    do { \
  |  |  352|      0|        hold = 0; \
  |  |  353|      0|        bits = 0; \
  |  |  354|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  593|      0|            state->mode = EXLEN;
  594|       |                /* fallthrough */
  595|      0|        case EXLEN:
  ------------------
  |  Branch (595:9): [True: 0, False: 788k]
  ------------------
  596|      0|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (596:17): [True: 0, False: 0]
  ------------------
  597|      0|                NEEDBITS(16);
  ------------------
  |  |  369|      0|    do { \
  |  |  370|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  371|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|      0|    do { \
  |  |  |  |  360|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        have--; \
  |  |  |  |  362|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|      0|        bits += 8; \
  |  |  |  |  364|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  598|      0|                state->length = (unsigned)(hold);
  599|      0|                if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (599:21): [True: 0, False: 0]
  ------------------
  600|      0|                    state->head->extra_len = (unsigned)hold;
  601|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (601:21): [True: 0, False: 0]
  |  Branch (601:48): [True: 0, False: 0]
  ------------------
  602|      0|                    CRC2(state->check, hold);
  ------------------
  |  |  311|      0|    do { \
  |  |  312|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  313|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  314|      0|        check = crc32(check, hbuf, 2); \
  |  |  315|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (315:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  603|      0|                INITBITS();
  ------------------
  |  |  351|      0|    do { \
  |  |  352|      0|        hold = 0; \
  |  |  353|      0|        bits = 0; \
  |  |  354|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  604|      0|            }
  605|      0|            else if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (605:22): [True: 0, False: 0]
  ------------------
  606|      0|                state->head->extra = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  607|      0|            state->mode = EXTRA;
  608|       |                /* fallthrough */
  609|      0|        case EXTRA:
  ------------------
  |  Branch (609:9): [True: 0, False: 788k]
  ------------------
  610|      0|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (610:17): [True: 0, False: 0]
  ------------------
  611|      0|                copy = state->length;
  612|      0|                if (copy > have) copy = have;
  ------------------
  |  Branch (612:21): [True: 0, False: 0]
  ------------------
  613|      0|                if (copy) {
  ------------------
  |  Branch (613:21): [True: 0, False: 0]
  ------------------
  614|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (614:25): [True: 0, False: 0]
  ------------------
  615|      0|                        state->head->extra != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (615:25): [True: 0, False: 0]
  ------------------
  616|      0|                        (len = state->head->extra_len - state->length) <
  ------------------
  |  Branch (616:25): [True: 0, False: 0]
  ------------------
  617|      0|                            state->head->extra_max) {
  618|      0|                        zmemcpy(state->head->extra + len, next,
  ------------------
  |  |  216|      0|#    define zmemcpy memcpy
  ------------------
  619|      0|                                len + copy > state->head->extra_max ?
  ------------------
  |  Branch (619:33): [True: 0, False: 0]
  ------------------
  620|      0|                                state->head->extra_max - len : copy);
  621|      0|                    }
  622|      0|                    if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (622:25): [True: 0, False: 0]
  |  Branch (622:52): [True: 0, False: 0]
  ------------------
  623|      0|                        state->check = crc32(state->check, next, copy);
  624|      0|                    have -= copy;
  625|      0|                    next += copy;
  626|      0|                    state->length -= copy;
  627|      0|                }
  628|      0|                if (state->length) goto inf_leave;
  ------------------
  |  Branch (628:21): [True: 0, False: 0]
  ------------------
  629|      0|            }
  630|      0|            state->length = 0;
  631|      0|            state->mode = NAME;
  632|       |                /* fallthrough */
  633|      0|        case NAME:
  ------------------
  |  Branch (633:9): [True: 0, False: 788k]
  ------------------
  634|      0|            if (state->flags & 0x0800) {
  ------------------
  |  Branch (634:17): [True: 0, False: 0]
  ------------------
  635|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (635:21): [True: 0, False: 0]
  ------------------
  636|      0|                copy = 0;
  637|      0|                do {
  638|      0|                    len = (unsigned)(next[copy++]);
  639|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (639:25): [True: 0, False: 0]
  ------------------
  640|      0|                            state->head->name != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (640:29): [True: 0, False: 0]
  ------------------
  641|      0|                            state->length < state->head->name_max)
  ------------------
  |  Branch (641:29): [True: 0, False: 0]
  ------------------
  642|      0|                        state->head->name[state->length++] = (Bytef)len;
  643|      0|                } while (len && copy < have);
  ------------------
  |  Branch (643:26): [True: 0, False: 0]
  |  Branch (643:33): [True: 0, False: 0]
  ------------------
  644|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (644:21): [True: 0, False: 0]
  |  Branch (644:48): [True: 0, False: 0]
  ------------------
  645|      0|                    state->check = crc32(state->check, next, copy);
  646|      0|                have -= copy;
  647|      0|                next += copy;
  648|      0|                if (len) goto inf_leave;
  ------------------
  |  Branch (648:21): [True: 0, False: 0]
  ------------------
  649|      0|            }
  650|      0|            else if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (650:22): [True: 0, False: 0]
  ------------------
  651|      0|                state->head->name = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  652|      0|            state->length = 0;
  653|      0|            state->mode = COMMENT;
  654|       |                /* fallthrough */
  655|      0|        case COMMENT:
  ------------------
  |  Branch (655:9): [True: 0, False: 788k]
  ------------------
  656|      0|            if (state->flags & 0x1000) {
  ------------------
  |  Branch (656:17): [True: 0, False: 0]
  ------------------
  657|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (657:21): [True: 0, False: 0]
  ------------------
  658|      0|                copy = 0;
  659|      0|                do {
  660|      0|                    len = (unsigned)(next[copy++]);
  661|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (661:25): [True: 0, False: 0]
  ------------------
  662|      0|                            state->head->comment != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (662:29): [True: 0, False: 0]
  ------------------
  663|      0|                            state->length < state->head->comm_max)
  ------------------
  |  Branch (663:29): [True: 0, False: 0]
  ------------------
  664|      0|                        state->head->comment[state->length++] = (Bytef)len;
  665|      0|                } while (len && copy < have);
  ------------------
  |  Branch (665:26): [True: 0, False: 0]
  |  Branch (665:33): [True: 0, False: 0]
  ------------------
  666|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (666:21): [True: 0, False: 0]
  |  Branch (666:48): [True: 0, False: 0]
  ------------------
  667|      0|                    state->check = crc32(state->check, next, copy);
  668|      0|                have -= copy;
  669|      0|                next += copy;
  670|      0|                if (len) goto inf_leave;
  ------------------
  |  Branch (670:21): [True: 0, False: 0]
  ------------------
  671|      0|            }
  672|      0|            else if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (672:22): [True: 0, False: 0]
  ------------------
  673|      0|                state->head->comment = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  674|      0|            state->mode = HCRC;
  675|       |                /* fallthrough */
  676|      0|        case HCRC:
  ------------------
  |  Branch (676:9): [True: 0, False: 788k]
  ------------------
  677|      0|            if (state->flags & 0x0200) {
  ------------------
  |  Branch (677:17): [True: 0, False: 0]
  ------------------
  678|      0|                NEEDBITS(16);
  ------------------
  |  |  369|      0|    do { \
  |  |  370|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  371|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|      0|    do { \
  |  |  |  |  360|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        have--; \
  |  |  |  |  362|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|      0|        bits += 8; \
  |  |  |  |  364|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  679|      0|                if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
  ------------------
  |  Branch (679:21): [True: 0, False: 0]
  |  Branch (679:42): [True: 0, False: 0]
  ------------------
  680|      0|                    strm->msg = (z_const char *)"header crc mismatch";
  681|      0|                    state->mode = BAD;
  682|      0|                    break;
  683|      0|                }
  684|      0|                INITBITS();
  ------------------
  |  |  351|      0|    do { \
  |  |  352|      0|        hold = 0; \
  |  |  353|      0|        bits = 0; \
  |  |  354|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  685|      0|            }
  686|      0|            if (state->head != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (686:17): [True: 0, False: 0]
  ------------------
  687|      0|                state->head->hcrc = (int)((state->flags >> 9) & 1);
  688|      0|                state->head->done = 1;
  689|      0|            }
  690|      0|            strm->adler = state->check = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  691|      0|            state->mode = TYPE;
  692|      0|            break;
  693|      0|#endif
  694|  3.89k|        case DICTID:
  ------------------
  |  Branch (694:9): [True: 3.89k, False: 784k]
  ------------------
  695|  3.89k|            NEEDBITS(32);
  ------------------
  |  |  369|  3.89k|    do { \
  |  |  370|  19.4k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 15.5k, False: 3.89k]
  |  |  ------------------
  |  |  371|  15.5k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  15.5k|    do { \
  |  |  |  |  360|  15.5k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 15.5k]
  |  |  |  |  ------------------
  |  |  |  |  361|  15.5k|        have--; \
  |  |  |  |  362|  15.5k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  15.5k|        bits += 8; \
  |  |  |  |  364|  15.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 15.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  3.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 3.89k]
  |  |  ------------------
  ------------------
  696|  3.89k|            strm->adler = state->check = ZSWAP32(hold);
  ------------------
  |  |  258|  3.89k|#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
  |  |  259|  3.89k|                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
  ------------------
  697|  3.89k|            INITBITS();
  ------------------
  |  |  351|  3.89k|    do { \
  |  |  352|  3.89k|        hold = 0; \
  |  |  353|  3.89k|        bits = 0; \
  |  |  354|  3.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 3.89k]
  |  |  ------------------
  ------------------
  698|  3.89k|            state->mode = DICT;
  699|       |                /* fallthrough */
  700|  7.78k|        case DICT:
  ------------------
  |  Branch (700:9): [True: 3.89k, False: 784k]
  ------------------
  701|  7.78k|            if (state->havedict == 0) {
  ------------------
  |  Branch (701:17): [True: 3.89k, False: 3.89k]
  ------------------
  702|  3.89k|                RESTORE();
  ------------------
  |  |  340|  3.89k|    do { \
  |  |  341|  3.89k|        strm->next_out = put; \
  |  |  342|  3.89k|        strm->avail_out = left; \
  |  |  343|  3.89k|        strm->next_in = next; \
  |  |  344|  3.89k|        strm->avail_in = have; \
  |  |  345|  3.89k|        state->hold = hold; \
  |  |  346|  3.89k|        state->bits = bits; \
  |  |  347|  3.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (347:14): [Folded, False: 3.89k]
  |  |  ------------------
  ------------------
  703|  3.89k|                return Z_NEED_DICT;
  ------------------
  |  |  183|  3.89k|#define Z_NEED_DICT     2
  ------------------
  704|  3.89k|            }
  705|  3.89k|            strm->adler = state->check = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  3.89k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  706|  3.89k|            state->mode = TYPE;
  707|       |                /* fallthrough */
  708|  34.0k|        case TYPE:
  ------------------
  |  Branch (708:9): [True: 30.1k, False: 758k]
  ------------------
  709|  34.0k|            if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  177|  68.0k|#define Z_BLOCK         5
  ------------------
                          if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  178|  34.0k|#define Z_TREES         6
  ------------------
  |  Branch (709:17): [True: 0, False: 34.0k]
  |  Branch (709:37): [True: 0, False: 34.0k]
  ------------------
  710|       |                /* fallthrough */
  711|  34.0k|        case TYPEDO:
  ------------------
  |  Branch (711:9): [True: 0, False: 788k]
  ------------------
  712|  34.0k|            if (state->last) {
  ------------------
  |  Branch (712:17): [True: 4.17k, False: 29.8k]
  ------------------
  713|  4.17k|                BYTEBITS();
  ------------------
  |  |  387|  4.17k|    do { \
  |  |  388|  4.17k|        hold >>= bits & 7; \
  |  |  389|  4.17k|        bits -= bits & 7; \
  |  |  390|  4.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (390:14): [Folded, False: 4.17k]
  |  |  ------------------
  ------------------
  714|  4.17k|                state->mode = CHECK;
  715|  4.17k|                break;
  716|  4.17k|            }
  717|  29.8k|            NEEDBITS(3);
  ------------------
  |  |  369|  29.8k|    do { \
  |  |  370|  48.3k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 18.4k, False: 29.8k]
  |  |  ------------------
  |  |  371|  29.8k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  18.4k|    do { \
  |  |  |  |  360|  18.4k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 18.4k]
  |  |  |  |  ------------------
  |  |  |  |  361|  18.4k|        have--; \
  |  |  |  |  362|  18.4k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  18.4k|        bits += 8; \
  |  |  |  |  364|  18.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  29.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 29.8k]
  |  |  ------------------
  ------------------
  718|  29.8k|            state->last = BITS(1);
  ------------------
  |  |  376|  29.8k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  719|  29.8k|            DROPBITS(1);
  ------------------
  |  |  380|  29.8k|    do { \
  |  |  381|  29.8k|        hold >>= (n); \
  |  |  382|  29.8k|        bits -= (unsigned)(n); \
  |  |  383|  29.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 29.8k]
  |  |  ------------------
  ------------------
  720|  29.8k|            switch (BITS(2)) {
  ------------------
  |  |  376|  29.8k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  721|  6.88k|            case 0:                             /* stored block */
  ------------------
  |  Branch (721:13): [True: 6.88k, False: 22.9k]
  ------------------
  722|  6.88k|                Tracev((stderr, "inflate:     stored block%s\n",
  723|  6.88k|                        state->last ? " (last)" : ""));
  724|  6.88k|                state->mode = STORED;
  725|  6.88k|                break;
  726|  8.60k|            case 1:                             /* fixed block */
  ------------------
  |  Branch (726:13): [True: 8.60k, False: 21.2k]
  ------------------
  727|  8.60k|                inflate_fixed(state);
  728|  8.60k|                Tracev((stderr, "inflate:     fixed codes block%s\n",
  729|  8.60k|                        state->last ? " (last)" : ""));
  730|  8.60k|                state->mode = LEN_;             /* decode codes */
  731|  8.60k|                if (flush == Z_TREES) {
  ------------------
  |  |  178|  8.60k|#define Z_TREES         6
  ------------------
  |  Branch (731:21): [True: 0, False: 8.60k]
  ------------------
  732|      0|                    DROPBITS(2);
  ------------------
  |  |  380|      0|    do { \
  |  |  381|      0|        hold >>= (n); \
  |  |  382|      0|        bits -= (unsigned)(n); \
  |  |  383|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  733|      0|                    goto inf_leave;
  734|      0|                }
  735|  8.60k|                break;
  736|  14.3k|            case 2:                             /* dynamic block */
  ------------------
  |  Branch (736:13): [True: 14.3k, False: 15.4k]
  ------------------
  737|  14.3k|                Tracev((stderr, "inflate:     dynamic codes block%s\n",
  738|  14.3k|                        state->last ? " (last)" : ""));
  739|  14.3k|                state->mode = TABLE;
  740|  14.3k|                break;
  741|      0|            default:
  ------------------
  |  Branch (741:13): [True: 0, False: 29.8k]
  ------------------
  742|      0|                strm->msg = (z_const char *)"invalid block type";
  743|      0|                state->mode = BAD;
  744|  29.8k|            }
  745|  29.8k|            DROPBITS(2);
  ------------------
  |  |  380|  29.8k|    do { \
  |  |  381|  29.8k|        hold >>= (n); \
  |  |  382|  29.8k|        bits -= (unsigned)(n); \
  |  |  383|  29.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 29.8k]
  |  |  ------------------
  ------------------
  746|  29.8k|            break;
  747|  6.88k|        case STORED:
  ------------------
  |  Branch (747:9): [True: 6.88k, False: 781k]
  ------------------
  748|  6.88k|            BYTEBITS();                         /* go to byte boundary */
  ------------------
  |  |  387|  6.88k|    do { \
  |  |  388|  6.88k|        hold >>= bits & 7; \
  |  |  389|  6.88k|        bits -= bits & 7; \
  |  |  390|  6.88k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (390:14): [Folded, False: 6.88k]
  |  |  ------------------
  ------------------
  749|  6.88k|            NEEDBITS(32);
  ------------------
  |  |  369|  6.88k|    do { \
  |  |  370|  34.4k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 27.5k, False: 6.88k]
  |  |  ------------------
  |  |  371|  27.5k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  27.5k|    do { \
  |  |  |  |  360|  27.5k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 27.5k]
  |  |  |  |  ------------------
  |  |  |  |  361|  27.5k|        have--; \
  |  |  |  |  362|  27.5k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  27.5k|        bits += 8; \
  |  |  |  |  364|  27.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 27.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  6.88k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 6.88k]
  |  |  ------------------
  ------------------
  750|  6.88k|            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
  ------------------
  |  Branch (750:17): [True: 0, False: 6.88k]
  ------------------
  751|      0|                strm->msg = (z_const char *)"invalid stored block lengths";
  752|      0|                state->mode = BAD;
  753|      0|                break;
  754|      0|            }
  755|  6.88k|            state->length = (unsigned)hold & 0xffff;
  756|  6.88k|            Tracev((stderr, "inflate:       stored length %u\n",
  757|  6.88k|                    state->length));
  758|  6.88k|            INITBITS();
  ------------------
  |  |  351|  6.88k|    do { \
  |  |  352|  6.88k|        hold = 0; \
  |  |  353|  6.88k|        bits = 0; \
  |  |  354|  6.88k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 6.88k]
  |  |  ------------------
  ------------------
  759|  6.88k|            state->mode = COPY_;
  760|  6.88k|            if (flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  178|  6.88k|#define Z_TREES         6
  ------------------
  |  Branch (760:17): [True: 0, False: 6.88k]
  ------------------
  761|       |                /* fallthrough */
  762|  6.88k|        case COPY_:
  ------------------
  |  Branch (762:9): [True: 0, False: 788k]
  ------------------
  763|  6.88k|            state->mode = COPY;
  764|       |                /* fallthrough */
  765|  13.7k|        case COPY:
  ------------------
  |  Branch (765:9): [True: 6.88k, False: 781k]
  ------------------
  766|  13.7k|            copy = state->length;
  767|  13.7k|            if (copy) {
  ------------------
  |  Branch (767:17): [True: 6.88k, False: 6.88k]
  ------------------
  768|  6.88k|                if (copy > have) copy = have;
  ------------------
  |  Branch (768:21): [True: 0, False: 6.88k]
  ------------------
  769|  6.88k|                if (copy > left) copy = left;
  ------------------
  |  Branch (769:21): [True: 0, False: 6.88k]
  ------------------
  770|  6.88k|                if (copy == 0) goto inf_leave;
  ------------------
  |  Branch (770:21): [True: 0, False: 6.88k]
  ------------------
  771|  6.88k|                zmemcpy(put, next, copy);
  ------------------
  |  |  216|  6.88k|#    define zmemcpy memcpy
  ------------------
  772|  6.88k|                have -= copy;
  773|  6.88k|                next += copy;
  774|  6.88k|                left -= copy;
  775|  6.88k|                put += copy;
  776|  6.88k|                state->length -= copy;
  777|  6.88k|                break;
  778|  6.88k|            }
  779|  6.88k|            Tracev((stderr, "inflate:       stored end\n"));
  780|  6.88k|            state->mode = TYPE;
  781|  6.88k|            break;
  782|  14.3k|        case TABLE:
  ------------------
  |  Branch (782:9): [True: 14.3k, False: 773k]
  ------------------
  783|  14.3k|            NEEDBITS(14);
  ------------------
  |  |  369|  14.3k|    do { \
  |  |  370|  40.1k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 25.7k, False: 14.3k]
  |  |  ------------------
  |  |  371|  25.7k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  25.7k|    do { \
  |  |  |  |  360|  25.7k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 25.7k]
  |  |  |  |  ------------------
  |  |  |  |  361|  25.7k|        have--; \
  |  |  |  |  362|  25.7k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  25.7k|        bits += 8; \
  |  |  |  |  364|  25.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 25.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  14.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
  784|  14.3k|            state->nlen = BITS(5) + 257;
  ------------------
  |  |  376|  14.3k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  785|  14.3k|            DROPBITS(5);
  ------------------
  |  |  380|  14.3k|    do { \
  |  |  381|  14.3k|        hold >>= (n); \
  |  |  382|  14.3k|        bits -= (unsigned)(n); \
  |  |  383|  14.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
  786|  14.3k|            state->ndist = BITS(5) + 1;
  ------------------
  |  |  376|  14.3k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  787|  14.3k|            DROPBITS(5);
  ------------------
  |  |  380|  14.3k|    do { \
  |  |  381|  14.3k|        hold >>= (n); \
  |  |  382|  14.3k|        bits -= (unsigned)(n); \
  |  |  383|  14.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
  788|  14.3k|            state->ncode = BITS(4) + 4;
  ------------------
  |  |  376|  14.3k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  789|  14.3k|            DROPBITS(4);
  ------------------
  |  |  380|  14.3k|    do { \
  |  |  381|  14.3k|        hold >>= (n); \
  |  |  382|  14.3k|        bits -= (unsigned)(n); \
  |  |  383|  14.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 14.3k]
  |  |  ------------------
  ------------------
  790|  14.3k|#ifndef PKZIP_BUG_WORKAROUND
  791|  14.3k|            if (state->nlen > 286 || state->ndist > 30) {
  ------------------
  |  Branch (791:17): [True: 0, False: 14.3k]
  |  Branch (791:38): [True: 0, False: 14.3k]
  ------------------
  792|      0|                strm->msg = (z_const char *)
  793|      0|                    "too many length or distance symbols";
  794|      0|                state->mode = BAD;
  795|      0|                break;
  796|      0|            }
  797|  14.3k|#endif
  798|  14.3k|            Tracev((stderr, "inflate:       table sizes ok\n"));
  799|  14.3k|            state->have = 0;
  800|  14.3k|            state->mode = LENLENS;
  801|       |                /* fallthrough */
  802|  14.3k|        case LENLENS:
  ------------------
  |  Branch (802:9): [True: 0, False: 788k]
  ------------------
  803|   270k|            while (state->have < state->ncode) {
  ------------------
  |  Branch (803:20): [True: 255k, False: 14.3k]
  ------------------
  804|   255k|                NEEDBITS(3);
  ------------------
  |  |  369|   255k|    do { \
  |  |  370|   350k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 94.2k, False: 255k]
  |  |  ------------------
  |  |  371|   255k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  94.2k|    do { \
  |  |  |  |  360|  94.2k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 94.2k]
  |  |  |  |  ------------------
  |  |  |  |  361|  94.2k|        have--; \
  |  |  |  |  362|  94.2k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  94.2k|        bits += 8; \
  |  |  |  |  364|  94.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 94.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|   255k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 255k]
  |  |  ------------------
  ------------------
  805|   255k|                state->lens[order[state->have++]] = (unsigned short)BITS(3);
  ------------------
  |  |  376|   255k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  806|   255k|                DROPBITS(3);
  ------------------
  |  |  380|   255k|    do { \
  |  |  381|   255k|        hold >>= (n); \
  |  |  382|   255k|        bits -= (unsigned)(n); \
  |  |  383|   255k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 255k]
  |  |  ------------------
  ------------------
  807|   255k|            }
  808|  31.3k|            while (state->have < 19)
  ------------------
  |  Branch (808:20): [True: 16.9k, False: 14.3k]
  ------------------
  809|  16.9k|                state->lens[order[state->have++]] = 0;
  810|  14.3k|            state->next = state->codes;
  811|  14.3k|            state->lencode = state->distcode = (const code FAR *)(state->next);
  812|  14.3k|            state->lenbits = 7;
  813|  14.3k|            ret = inflate_table(CODES, state->lens, 19, &(state->next),
  814|  14.3k|                                &(state->lenbits), state->work);
  815|  14.3k|            if (ret) {
  ------------------
  |  Branch (815:17): [True: 0, False: 14.3k]
  ------------------
  816|      0|                strm->msg = (z_const char *)"invalid code lengths set";
  817|      0|                state->mode = BAD;
  818|      0|                break;
  819|      0|            }
  820|  14.3k|            Tracev((stderr, "inflate:       code lengths ok\n"));
  821|  14.3k|            state->have = 0;
  822|  14.3k|            state->mode = CODELENS;
  823|       |                /* fallthrough */
  824|  14.3k|        case CODELENS:
  ------------------
  |  Branch (824:9): [True: 0, False: 788k]
  ------------------
  825|  1.02M|            while (state->have < state->nlen + state->ndist) {
  ------------------
  |  Branch (825:20): [True: 1.01M, False: 14.3k]
  ------------------
  826|  1.34M|                for (;;) {
  827|  1.34M|                    here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  376|  1.34M|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  828|  1.34M|                    if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (828:25): [True: 1.01M, False: 337k]
  ------------------
  829|   337k|                    PULLBYTE();
  ------------------
  |  |  359|   337k|    do { \
  |  |  360|   337k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (360:13): [True: 0, False: 337k]
  |  |  ------------------
  |  |  361|   337k|        have--; \
  |  |  362|   337k|        hold += (unsigned long)(*next++) << bits; \
  |  |  363|   337k|        bits += 8; \
  |  |  364|   337k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (364:14): [Folded, False: 337k]
  |  |  ------------------
  ------------------
  830|   337k|                }
  831|  1.01M|                if (here.val < 16) {
  ------------------
  |  Branch (831:21): [True: 817k, False: 193k]
  ------------------
  832|   817k|                    DROPBITS(here.bits);
  ------------------
  |  |  380|   817k|    do { \
  |  |  381|   817k|        hold >>= (n); \
  |  |  382|   817k|        bits -= (unsigned)(n); \
  |  |  383|   817k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 817k]
  |  |  ------------------
  ------------------
  833|   817k|                    state->lens[state->have++] = here.val;
  834|   817k|                }
  835|   193k|                else {
  836|   193k|                    if (here.val == 16) {
  ------------------
  |  Branch (836:25): [True: 21.4k, False: 171k]
  ------------------
  837|  21.4k|                        NEEDBITS(here.bits + 2);
  ------------------
  |  |  369|  21.4k|    do { \
  |  |  370|  26.9k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 5.51k, False: 21.4k]
  |  |  ------------------
  |  |  371|  21.4k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  5.51k|    do { \
  |  |  |  |  360|  5.51k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 5.51k]
  |  |  |  |  ------------------
  |  |  |  |  361|  5.51k|        have--; \
  |  |  |  |  362|  5.51k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  5.51k|        bits += 8; \
  |  |  |  |  364|  5.51k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 5.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  21.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 21.4k]
  |  |  ------------------
  ------------------
  838|  21.4k|                        DROPBITS(here.bits);
  ------------------
  |  |  380|  21.4k|    do { \
  |  |  381|  21.4k|        hold >>= (n); \
  |  |  382|  21.4k|        bits -= (unsigned)(n); \
  |  |  383|  21.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 21.4k]
  |  |  ------------------
  ------------------
  839|  21.4k|                        if (state->have == 0) {
  ------------------
  |  Branch (839:29): [True: 0, False: 21.4k]
  ------------------
  840|      0|                            strm->msg = (z_const char *)
  841|      0|                                "invalid bit length repeat";
  842|      0|                            state->mode = BAD;
  843|      0|                            break;
  844|      0|                        }
  845|  21.4k|                        len = state->lens[state->have - 1];
  846|  21.4k|                        copy = 3 + BITS(2);
  ------------------
  |  |  376|  21.4k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  847|  21.4k|                        DROPBITS(2);
  ------------------
  |  |  380|  21.4k|    do { \
  |  |  381|  21.4k|        hold >>= (n); \
  |  |  382|  21.4k|        bits -= (unsigned)(n); \
  |  |  383|  21.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 21.4k]
  |  |  ------------------
  ------------------
  848|  21.4k|                    }
  849|   171k|                    else if (here.val == 17) {
  ------------------
  |  Branch (849:30): [True: 105k, False: 66.4k]
  ------------------
  850|   105k|                        NEEDBITS(here.bits + 3);
  ------------------
  |  |  369|   105k|    do { \
  |  |  370|   144k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 39.2k, False: 105k]
  |  |  ------------------
  |  |  371|   105k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  39.2k|    do { \
  |  |  |  |  360|  39.2k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 39.2k]
  |  |  |  |  ------------------
  |  |  |  |  361|  39.2k|        have--; \
  |  |  |  |  362|  39.2k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  39.2k|        bits += 8; \
  |  |  |  |  364|  39.2k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 39.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|   105k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  851|   105k|                        DROPBITS(here.bits);
  ------------------
  |  |  380|   105k|    do { \
  |  |  381|   105k|        hold >>= (n); \
  |  |  382|   105k|        bits -= (unsigned)(n); \
  |  |  383|   105k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  852|   105k|                        len = 0;
  853|   105k|                        copy = 3 + BITS(3);
  ------------------
  |  |  376|   105k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  854|   105k|                        DROPBITS(3);
  ------------------
  |  |  380|   105k|    do { \
  |  |  381|   105k|        hold >>= (n); \
  |  |  382|   105k|        bits -= (unsigned)(n); \
  |  |  383|   105k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  855|   105k|                    }
  856|  66.4k|                    else {
  857|  66.4k|                        NEEDBITS(here.bits + 7);
  ------------------
  |  |  369|  66.4k|    do { \
  |  |  370|   124k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 57.6k, False: 66.4k]
  |  |  ------------------
  |  |  371|  66.4k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  57.6k|    do { \
  |  |  |  |  360|  57.6k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 57.6k]
  |  |  |  |  ------------------
  |  |  |  |  361|  57.6k|        have--; \
  |  |  |  |  362|  57.6k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  57.6k|        bits += 8; \
  |  |  |  |  364|  57.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 57.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  66.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 66.4k]
  |  |  ------------------
  ------------------
  858|  66.4k|                        DROPBITS(here.bits);
  ------------------
  |  |  380|  66.4k|    do { \
  |  |  381|  66.4k|        hold >>= (n); \
  |  |  382|  66.4k|        bits -= (unsigned)(n); \
  |  |  383|  66.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 66.4k]
  |  |  ------------------
  ------------------
  859|  66.4k|                        len = 0;
  860|  66.4k|                        copy = 11 + BITS(7);
  ------------------
  |  |  376|  66.4k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  861|  66.4k|                        DROPBITS(7);
  ------------------
  |  |  380|  66.4k|    do { \
  |  |  381|  66.4k|        hold >>= (n); \
  |  |  382|  66.4k|        bits -= (unsigned)(n); \
  |  |  383|  66.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 66.4k]
  |  |  ------------------
  ------------------
  862|  66.4k|                    }
  863|   193k|                    if (state->have + copy > state->nlen + state->ndist) {
  ------------------
  |  Branch (863:25): [True: 0, False: 193k]
  ------------------
  864|      0|                        strm->msg = (z_const char *)
  865|      0|                            "invalid bit length repeat";
  866|      0|                        state->mode = BAD;
  867|      0|                        break;
  868|      0|                    }
  869|  3.17M|                    while (copy--)
  ------------------
  |  Branch (869:28): [True: 2.98M, False: 193k]
  ------------------
  870|  2.98M|                        state->lens[state->have++] = (unsigned short)len;
  871|   193k|                }
  872|  1.01M|            }
  873|       |
  874|       |            /* handle error breaks in while */
  875|  14.3k|            if (state->mode == BAD) break;
  ------------------
  |  Branch (875:17): [True: 0, False: 14.3k]
  ------------------
  876|       |
  877|       |            /* check for end-of-block code (better have one) */
  878|  14.3k|            if (state->lens[256] == 0) {
  ------------------
  |  Branch (878:17): [True: 0, False: 14.3k]
  ------------------
  879|      0|                strm->msg = (z_const char *)
  880|      0|                    "invalid code -- missing end-of-block";
  881|      0|                state->mode = BAD;
  882|      0|                break;
  883|      0|            }
  884|       |
  885|       |            /* build code tables -- note: do not change the lenbits or distbits
  886|       |               values here (9 and 6) without reading the comments in inftrees.h
  887|       |               concerning the ENOUGH constants, which depend on those values */
  888|  14.3k|            state->next = state->codes;
  889|  14.3k|            state->lencode = (const code FAR *)(state->next);
  890|  14.3k|            state->lenbits = 9;
  891|  14.3k|            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
  892|  14.3k|                                &(state->lenbits), state->work);
  893|  14.3k|            if (ret) {
  ------------------
  |  Branch (893:17): [True: 0, False: 14.3k]
  ------------------
  894|      0|                strm->msg = (z_const char *)"invalid literal/lengths set";
  895|      0|                state->mode = BAD;
  896|      0|                break;
  897|      0|            }
  898|  14.3k|            state->distcode = (const code FAR *)(state->next);
  899|  14.3k|            state->distbits = 6;
  900|  14.3k|            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
  901|  14.3k|                            &(state->next), &(state->distbits), state->work);
  902|  14.3k|            if (ret) {
  ------------------
  |  Branch (902:17): [True: 0, False: 14.3k]
  ------------------
  903|      0|                strm->msg = (z_const char *)"invalid distances set";
  904|      0|                state->mode = BAD;
  905|      0|                break;
  906|      0|            }
  907|  14.3k|            Tracev((stderr, "inflate:       codes ok\n"));
  908|  14.3k|            state->mode = LEN_;
  909|  14.3k|            if (flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  178|  14.3k|#define Z_TREES         6
  ------------------
  |  Branch (909:17): [True: 0, False: 14.3k]
  ------------------
  910|       |                /* fallthrough */
  911|  22.9k|        case LEN_:
  ------------------
  |  Branch (911:9): [True: 8.60k, False: 779k]
  ------------------
  912|  22.9k|            state->mode = LEN;
  913|       |                /* fallthrough */
  914|   387k|        case LEN:
  ------------------
  |  Branch (914:9): [True: 364k, False: 423k]
  ------------------
  915|   387k|            if (have >= 6 && left >= 258) {
  ------------------
  |  Branch (915:17): [True: 387k, False: 0]
  |  Branch (915:30): [True: 19.6k, False: 367k]
  ------------------
  916|  19.6k|                RESTORE();
  ------------------
  |  |  340|  19.6k|    do { \
  |  |  341|  19.6k|        strm->next_out = put; \
  |  |  342|  19.6k|        strm->avail_out = left; \
  |  |  343|  19.6k|        strm->next_in = next; \
  |  |  344|  19.6k|        strm->avail_in = have; \
  |  |  345|  19.6k|        state->hold = hold; \
  |  |  346|  19.6k|        state->bits = bits; \
  |  |  347|  19.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (347:14): [Folded, False: 19.6k]
  |  |  ------------------
  ------------------
  917|  19.6k|                inflate_fast(strm, out);
  918|  19.6k|                LOAD();
  ------------------
  |  |  329|  19.6k|    do { \
  |  |  330|  19.6k|        put = strm->next_out; \
  |  |  331|  19.6k|        left = strm->avail_out; \
  |  |  332|  19.6k|        next = strm->next_in; \
  |  |  333|  19.6k|        have = strm->avail_in; \
  |  |  334|  19.6k|        hold = state->hold; \
  |  |  335|  19.6k|        bits = state->bits; \
  |  |  336|  19.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (336:14): [Folded, False: 19.6k]
  |  |  ------------------
  ------------------
  919|  19.6k|                if (state->mode == TYPE)
  ------------------
  |  Branch (919:21): [True: 17.7k, False: 1.89k]
  ------------------
  920|  17.7k|                    state->back = -1;
  921|  19.6k|                break;
  922|  19.6k|            }
  923|   367k|            state->back = 0;
  924|   613k|            for (;;) {
  925|   613k|                here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  376|   613k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  926|   613k|                if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (926:21): [True: 367k, False: 245k]
  ------------------
  927|   245k|                PULLBYTE();
  ------------------
  |  |  359|   245k|    do { \
  |  |  360|   245k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (360:13): [True: 0, False: 245k]
  |  |  ------------------
  |  |  361|   245k|        have--; \
  |  |  362|   245k|        hold += (unsigned long)(*next++) << bits; \
  |  |  363|   245k|        bits += 8; \
  |  |  364|   245k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (364:14): [Folded, False: 245k]
  |  |  ------------------
  ------------------
  928|   245k|            }
  929|   367k|            if (here.op && (here.op & 0xf0) == 0) {
  ------------------
  |  Branch (929:17): [True: 33.7k, False: 334k]
  |  Branch (929:28): [True: 6.46k, False: 27.2k]
  ------------------
  930|  6.46k|                last = here;
  931|  8.04k|                for (;;) {
  932|  8.04k|                    here = state->lencode[last.val +
  933|  8.04k|                            (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  376|  8.04k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  934|  8.04k|                    if ((unsigned)(last.bits + here.bits) <= bits) break;
  ------------------
  |  Branch (934:25): [True: 6.46k, False: 1.57k]
  ------------------
  935|  1.57k|                    PULLBYTE();
  ------------------
  |  |  359|  1.57k|    do { \
  |  |  360|  1.57k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (360:13): [True: 0, False: 1.57k]
  |  |  ------------------
  |  |  361|  1.57k|        have--; \
  |  |  362|  1.57k|        hold += (unsigned long)(*next++) << bits; \
  |  |  363|  1.57k|        bits += 8; \
  |  |  364|  1.57k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (364:14): [Folded, False: 1.57k]
  |  |  ------------------
  ------------------
  936|  1.57k|                }
  937|  6.46k|                DROPBITS(last.bits);
  ------------------
  |  |  380|  6.46k|    do { \
  |  |  381|  6.46k|        hold >>= (n); \
  |  |  382|  6.46k|        bits -= (unsigned)(n); \
  |  |  383|  6.46k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 6.46k]
  |  |  ------------------
  ------------------
  938|  6.46k|                state->back += last.bits;
  939|  6.46k|            }
  940|   367k|            DROPBITS(here.bits);
  ------------------
  |  |  380|   367k|    do { \
  |  |  381|   367k|        hold >>= (n); \
  |  |  382|   367k|        bits -= (unsigned)(n); \
  |  |  383|   367k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 367k]
  |  |  ------------------
  ------------------
  941|   367k|            state->back += here.bits;
  942|   367k|            state->length = (unsigned)here.val;
  943|   367k|            if ((int)(here.op) == 0) {
  ------------------
  |  Branch (943:17): [True: 340k, False: 27.9k]
  ------------------
  944|   340k|                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  945|   340k|                        "inflate:         literal '%c'\n" :
  946|   340k|                        "inflate:         literal 0x%02x\n", here.val));
  947|   340k|                state->mode = LIT;
  948|   340k|                break;
  949|   340k|            }
  950|  27.9k|            if (here.op & 32) {
  ------------------
  |  Branch (950:17): [True: 5.21k, False: 22.7k]
  ------------------
  951|  5.21k|                Tracevv((stderr, "inflate:         end of block\n"));
  952|  5.21k|                state->back = -1;
  953|  5.21k|                state->mode = TYPE;
  954|  5.21k|                break;
  955|  5.21k|            }
  956|  22.7k|            if (here.op & 64) {
  ------------------
  |  Branch (956:17): [True: 0, False: 22.7k]
  ------------------
  957|      0|                strm->msg = (z_const char *)"invalid literal/length code";
  958|      0|                state->mode = BAD;
  959|      0|                break;
  960|      0|            }
  961|  22.7k|            state->extra = (unsigned)(here.op) & 15;
  962|  22.7k|            state->mode = LENEXT;
  963|       |                /* fallthrough */
  964|  22.7k|        case LENEXT:
  ------------------
  |  Branch (964:9): [True: 0, False: 788k]
  ------------------
  965|  22.7k|            if (state->extra) {
  ------------------
  |  Branch (965:17): [True: 3.94k, False: 18.7k]
  ------------------
  966|  3.94k|                NEEDBITS(state->extra);
  ------------------
  |  |  369|  3.94k|    do { \
  |  |  370|  4.89k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 952, False: 3.94k]
  |  |  ------------------
  |  |  371|  3.94k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|    952|    do { \
  |  |  |  |  360|    952|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 952]
  |  |  |  |  ------------------
  |  |  |  |  361|    952|        have--; \
  |  |  |  |  362|    952|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|    952|        bits += 8; \
  |  |  |  |  364|    952|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 952]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  3.94k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 3.94k]
  |  |  ------------------
  ------------------
  967|  3.94k|                state->length += BITS(state->extra);
  ------------------
  |  |  376|  3.94k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  968|  3.94k|                DROPBITS(state->extra);
  ------------------
  |  |  380|  3.94k|    do { \
  |  |  381|  3.94k|        hold >>= (n); \
  |  |  382|  3.94k|        bits -= (unsigned)(n); \
  |  |  383|  3.94k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 3.94k]
  |  |  ------------------
  ------------------
  969|  3.94k|                state->back += state->extra;
  970|  3.94k|            }
  971|  22.7k|            Tracevv((stderr, "inflate:         length %u\n", state->length));
  972|  22.7k|            state->was = state->length;
  973|  22.7k|            state->mode = DIST;
  974|       |                /* fallthrough */
  975|  22.7k|        case DIST:
  ------------------
  |  Branch (975:9): [True: 0, False: 788k]
  ------------------
  976|  32.8k|            for (;;) {
  977|  32.8k|                here = state->distcode[BITS(state->distbits)];
  ------------------
  |  |  376|  32.8k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  978|  32.8k|                if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (978:21): [True: 22.7k, False: 10.1k]
  ------------------
  979|  10.1k|                PULLBYTE();
  ------------------
  |  |  359|  10.1k|    do { \
  |  |  360|  10.1k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (360:13): [True: 0, False: 10.1k]
  |  |  ------------------
  |  |  361|  10.1k|        have--; \
  |  |  362|  10.1k|        hold += (unsigned long)(*next++) << bits; \
  |  |  363|  10.1k|        bits += 8; \
  |  |  364|  10.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (364:14): [Folded, False: 10.1k]
  |  |  ------------------
  ------------------
  980|  10.1k|            }
  981|  22.7k|            if ((here.op & 0xf0) == 0) {
  ------------------
  |  Branch (981:17): [True: 448, False: 22.2k]
  ------------------
  982|    448|                last = here;
  983|    583|                for (;;) {
  984|    583|                    here = state->distcode[last.val +
  985|    583|                            (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  376|    583|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  986|    583|                    if ((unsigned)(last.bits + here.bits) <= bits) break;
  ------------------
  |  Branch (986:25): [True: 448, False: 135]
  ------------------
  987|    135|                    PULLBYTE();
  ------------------
  |  |  359|    135|    do { \
  |  |  360|    135|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (360:13): [True: 0, False: 135]
  |  |  ------------------
  |  |  361|    135|        have--; \
  |  |  362|    135|        hold += (unsigned long)(*next++) << bits; \
  |  |  363|    135|        bits += 8; \
  |  |  364|    135|    } while (0)
  |  |  ------------------
  |  |  |  Branch (364:14): [Folded, False: 135]
  |  |  ------------------
  ------------------
  988|    135|                }
  989|    448|                DROPBITS(last.bits);
  ------------------
  |  |  380|    448|    do { \
  |  |  381|    448|        hold >>= (n); \
  |  |  382|    448|        bits -= (unsigned)(n); \
  |  |  383|    448|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 448]
  |  |  ------------------
  ------------------
  990|    448|                state->back += last.bits;
  991|    448|            }
  992|  22.7k|            DROPBITS(here.bits);
  ------------------
  |  |  380|  22.7k|    do { \
  |  |  381|  22.7k|        hold >>= (n); \
  |  |  382|  22.7k|        bits -= (unsigned)(n); \
  |  |  383|  22.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 22.7k]
  |  |  ------------------
  ------------------
  993|  22.7k|            state->back += here.bits;
  994|  22.7k|            if (here.op & 64) {
  ------------------
  |  Branch (994:17): [True: 0, False: 22.7k]
  ------------------
  995|      0|                strm->msg = (z_const char *)"invalid distance code";
  996|      0|                state->mode = BAD;
  997|      0|                break;
  998|      0|            }
  999|  22.7k|            state->offset = (unsigned)here.val;
 1000|  22.7k|            state->extra = (unsigned)(here.op) & 15;
 1001|  22.7k|            state->mode = DISTEXT;
 1002|       |                /* fallthrough */
 1003|  22.7k|        case DISTEXT:
  ------------------
  |  Branch (1003:9): [True: 0, False: 788k]
  ------------------
 1004|  22.7k|            if (state->extra) {
  ------------------
  |  Branch (1004:17): [True: 15.5k, False: 7.11k]
  ------------------
 1005|  15.5k|                NEEDBITS(state->extra);
  ------------------
  |  |  369|  15.5k|    do { \
  |  |  370|  24.5k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 8.92k, False: 15.5k]
  |  |  ------------------
  |  |  371|  15.5k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  8.92k|    do { \
  |  |  |  |  360|  8.92k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 8.92k]
  |  |  |  |  ------------------
  |  |  |  |  361|  8.92k|        have--; \
  |  |  |  |  362|  8.92k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  8.92k|        bits += 8; \
  |  |  |  |  364|  8.92k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 8.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  15.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 1006|  15.5k|                state->offset += BITS(state->extra);
  ------------------
  |  |  376|  15.5k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1007|  15.5k|                DROPBITS(state->extra);
  ------------------
  |  |  380|  15.5k|    do { \
  |  |  381|  15.5k|        hold >>= (n); \
  |  |  382|  15.5k|        bits -= (unsigned)(n); \
  |  |  383|  15.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (383:14): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 1008|  15.5k|                state->back += state->extra;
 1009|  15.5k|            }
 1010|       |#ifdef INFLATE_STRICT
 1011|       |            if (state->offset > state->dmax) {
 1012|       |                strm->msg = (z_const char *)"invalid distance too far back";
 1013|       |                state->mode = BAD;
 1014|       |                break;
 1015|       |            }
 1016|       |#endif
 1017|  22.7k|            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
 1018|  22.7k|            state->mode = MATCH;
 1019|       |                /* fallthrough */
 1020|  23.2k|        case MATCH:
  ------------------
  |  Branch (1020:9): [True: 589, False: 787k]
  ------------------
 1021|  23.2k|            if (left == 0) goto inf_leave;
  ------------------
  |  Branch (1021:17): [True: 0, False: 23.2k]
  ------------------
 1022|  23.2k|            copy = out - left;
 1023|  23.2k|            if (state->offset > copy) {         /* copy from window */
  ------------------
  |  Branch (1023:17): [True: 2.39k, False: 20.8k]
  ------------------
 1024|  2.39k|                copy = state->offset - copy;
 1025|  2.39k|                if (copy > state->whave) {
  ------------------
  |  Branch (1025:21): [True: 0, False: 2.39k]
  ------------------
 1026|      0|                    if (state->sane) {
  ------------------
  |  Branch (1026:25): [True: 0, False: 0]
  ------------------
 1027|      0|                        strm->msg = (z_const char *)
 1028|      0|                            "invalid distance too far back";
 1029|      0|                        state->mode = BAD;
 1030|      0|                        break;
 1031|      0|                    }
 1032|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
 1033|       |                    Trace((stderr, "inflate.c too far\n"));
 1034|       |                    copy -= state->whave;
 1035|       |                    if (copy > state->length) copy = state->length;
 1036|       |                    if (copy > left) copy = left;
 1037|       |                    left -= copy;
 1038|       |                    state->length -= copy;
 1039|       |                    do {
 1040|       |                        *put++ = 0;
 1041|       |                    } while (--copy);
 1042|       |                    if (state->length == 0) state->mode = LEN;
 1043|       |                    break;
 1044|       |#endif
 1045|      0|                }
 1046|  2.39k|                if (copy > state->wnext) {
  ------------------
  |  Branch (1046:21): [True: 0, False: 2.39k]
  ------------------
 1047|      0|                    copy -= state->wnext;
 1048|      0|                    from = state->window + (state->wsize - copy);
 1049|      0|                }
 1050|  2.39k|                else
 1051|  2.39k|                    from = state->window + (state->wnext - copy);
 1052|  2.39k|                if (copy > state->length) copy = state->length;
  ------------------
  |  Branch (1052:21): [True: 1.26k, False: 1.13k]
  ------------------
 1053|  2.39k|            }
 1054|  20.8k|            else {                              /* copy from output */
 1055|  20.8k|                from = put - state->offset;
 1056|  20.8k|                copy = state->length;
 1057|  20.8k|            }
 1058|  23.2k|            if (copy > left) copy = left;
  ------------------
  |  Branch (1058:17): [True: 0, False: 23.2k]
  ------------------
 1059|  23.2k|            left -= copy;
 1060|  23.2k|            state->length -= copy;
 1061|   215k|            do {
 1062|   215k|                *put++ = *from++;
 1063|   215k|            } while (--copy);
  ------------------
  |  Branch (1063:22): [True: 192k, False: 23.2k]
  ------------------
 1064|  23.2k|            if (state->length == 0) state->mode = LEN;
  ------------------
  |  Branch (1064:17): [True: 22.7k, False: 589]
  ------------------
 1065|  23.2k|            break;
 1066|   340k|        case LIT:
  ------------------
  |  Branch (1066:9): [True: 340k, False: 448k]
  ------------------
 1067|   340k|            if (left == 0) goto inf_leave;
  ------------------
  |  Branch (1067:17): [True: 0, False: 340k]
  ------------------
 1068|   340k|            *put++ = (unsigned char)(state->length);
 1069|   340k|            left--;
 1070|   340k|            state->mode = LEN;
 1071|   340k|            break;
 1072|  4.17k|        case CHECK:
  ------------------
  |  Branch (1072:9): [True: 4.17k, False: 784k]
  ------------------
 1073|  4.17k|            if (state->wrap) {
  ------------------
  |  Branch (1073:17): [True: 4.17k, False: 0]
  ------------------
 1074|  4.17k|                NEEDBITS(32);
  ------------------
  |  |  369|  4.17k|    do { \
  |  |  370|  20.8k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 16.6k, False: 4.17k]
  |  |  ------------------
  |  |  371|  16.6k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|  16.6k|    do { \
  |  |  |  |  360|  16.6k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 16.6k]
  |  |  |  |  ------------------
  |  |  |  |  361|  16.6k|        have--; \
  |  |  |  |  362|  16.6k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|  16.6k|        bits += 8; \
  |  |  |  |  364|  16.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 16.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|  4.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 4.17k]
  |  |  ------------------
  ------------------
 1075|  4.17k|                out -= left;
 1076|  4.17k|                strm->total_out += out;
 1077|  4.17k|                state->total += out;
 1078|  4.17k|                if ((state->wrap & 4) && out)
  ------------------
  |  Branch (1078:21): [True: 4.17k, False: 0]
  |  Branch (1078:42): [True: 4.17k, False: 0]
  ------------------
 1079|  4.17k|                    strm->adler = state->check =
 1080|  4.17k|                        UPDATE_CHECK(state->check, put - out, out);
  ------------------
  |  |  303|  4.17k|    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
  |  |  ------------------
  |  |  |  Branch (303:6): [True: 0, False: 4.17k]
  |  |  ------------------
  ------------------
 1081|  4.17k|                out = left;
 1082|  4.17k|                if ((state->wrap & 4) && (
  ------------------
  |  Branch (1082:21): [True: 4.17k, False: 0]
  |  Branch (1082:42): [True: 0, False: 4.17k]
  ------------------
 1083|  4.17k|#ifdef GUNZIP
 1084|  4.17k|                     state->flags ? hold :
  ------------------
  |  Branch (1084:22): [True: 0, False: 4.17k]
  ------------------
 1085|  4.17k|#endif
 1086|  4.17k|                     ZSWAP32(hold)) != state->check) {
  ------------------
  |  |  258|  4.17k|#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
  |  |  259|  4.17k|                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
  ------------------
 1087|      0|                    strm->msg = (z_const char *)"incorrect data check";
 1088|      0|                    state->mode = BAD;
 1089|      0|                    break;
 1090|      0|                }
 1091|  4.17k|                INITBITS();
  ------------------
  |  |  351|  4.17k|    do { \
  |  |  352|  4.17k|        hold = 0; \
  |  |  353|  4.17k|        bits = 0; \
  |  |  354|  4.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 4.17k]
  |  |  ------------------
  ------------------
 1092|  4.17k|                Tracev((stderr, "inflate:   check matches trailer\n"));
 1093|  4.17k|            }
 1094|  4.17k|#ifdef GUNZIP
 1095|  4.17k|            state->mode = LENGTH;
 1096|       |                /* fallthrough */
 1097|  4.17k|        case LENGTH:
  ------------------
  |  Branch (1097:9): [True: 0, False: 788k]
  ------------------
 1098|  4.17k|            if (state->wrap && state->flags) {
  ------------------
  |  Branch (1098:17): [True: 4.17k, False: 0]
  |  Branch (1098:32): [True: 0, False: 4.17k]
  ------------------
 1099|      0|                NEEDBITS(32);
  ------------------
  |  |  369|      0|    do { \
  |  |  370|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (370:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  371|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  359|      0|    do { \
  |  |  |  |  360|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (360:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  361|      0|        have--; \
  |  |  |  |  362|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  363|      0|        bits += 8; \
  |  |  |  |  364|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (364:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  372|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1100|      0|                if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
  ------------------
  |  Branch (1100:21): [True: 0, False: 0]
  |  Branch (1100:42): [True: 0, False: 0]
  ------------------
 1101|      0|                    strm->msg = (z_const char *)"incorrect length check";
 1102|      0|                    state->mode = BAD;
 1103|      0|                    break;
 1104|      0|                }
 1105|      0|                INITBITS();
  ------------------
  |  |  351|      0|    do { \
  |  |  352|      0|        hold = 0; \
  |  |  353|      0|        bits = 0; \
  |  |  354|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (354:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1106|      0|                Tracev((stderr, "inflate:   length matches trailer\n"));
 1107|      0|            }
 1108|  4.17k|#endif
 1109|  4.17k|            state->mode = DONE;
 1110|       |                /* fallthrough */
 1111|  4.17k|        case DONE:
  ------------------
  |  Branch (1111:9): [True: 0, False: 788k]
  ------------------
 1112|  4.17k|            ret = Z_STREAM_END;
  ------------------
  |  |  182|  4.17k|#define Z_STREAM_END    1
  ------------------
 1113|  4.17k|            goto inf_leave;
 1114|      0|        case BAD:
  ------------------
  |  Branch (1114:9): [True: 0, False: 788k]
  ------------------
 1115|      0|            ret = Z_DATA_ERROR;
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
 1116|      0|            goto inf_leave;
 1117|      0|        case MEM:
  ------------------
  |  Branch (1117:9): [True: 0, False: 788k]
  ------------------
 1118|      0|            return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
 1119|      0|        case SYNC:
  ------------------
  |  Branch (1119:9): [True: 0, False: 788k]
  ------------------
 1120|       |                /* fallthrough */
 1121|      0|        default:
  ------------------
  |  Branch (1121:9): [True: 0, False: 788k]
  ------------------
 1122|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1123|   788k|        }
 1124|       |
 1125|       |    /*
 1126|       |       Return from inflate(), updating the total counts and the check value.
 1127|       |       If there was no progress during the inflate() call, return a buffer
 1128|       |       error.  Call updatewindow() to create and/or update the window state.
 1129|       |       Note: a memory error from inflate() is non-recoverable.
 1130|       |     */
 1131|  4.17k|  inf_leave:
 1132|  4.17k|    RESTORE();
  ------------------
  |  |  340|  4.17k|    do { \
  |  |  341|  4.17k|        strm->next_out = put; \
  |  |  342|  4.17k|        strm->avail_out = left; \
  |  |  343|  4.17k|        strm->next_in = next; \
  |  |  344|  4.17k|        strm->avail_in = have; \
  |  |  345|  4.17k|        state->hold = hold; \
  |  |  346|  4.17k|        state->bits = bits; \
  |  |  347|  4.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (347:14): [Folded, False: 4.17k]
  |  |  ------------------
  ------------------
 1133|  4.17k|    if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
  ------------------
  |  Branch (1133:9): [True: 3.89k, False: 277]
  |  Branch (1133:26): [True: 0, False: 277]
  |  Branch (1133:52): [True: 0, False: 0]
  ------------------
 1134|      0|            (state->mode < CHECK || flush != Z_FINISH)))
  ------------------
  |  |  176|      0|#define Z_FINISH        4
  ------------------
  |  Branch (1134:14): [True: 0, False: 0]
  |  Branch (1134:37): [True: 0, False: 0]
  ------------------
 1135|  3.89k|        if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
  ------------------
  |  Branch (1135:13): [True: 0, False: 3.89k]
  ------------------
 1136|      0|            state->mode = MEM;
 1137|      0|            return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
 1138|      0|        }
 1139|  4.17k|    in -= strm->avail_in;
 1140|  4.17k|    out -= strm->avail_out;
 1141|  4.17k|    strm->total_in += in;
 1142|  4.17k|    strm->total_out += out;
 1143|  4.17k|    state->total += out;
 1144|  4.17k|    if ((state->wrap & 4) && out)
  ------------------
  |  Branch (1144:9): [True: 4.17k, False: 0]
  |  Branch (1144:30): [True: 0, False: 4.17k]
  ------------------
 1145|      0|        strm->adler = state->check =
 1146|      0|            UPDATE_CHECK(state->check, strm->next_out - out, out);
  ------------------
  |  |  303|      0|    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
  |  |  ------------------
  |  |  |  Branch (303:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1147|  4.17k|    strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
  ------------------
  |  Branch (1147:43): [True: 4.17k, False: 0]
  ------------------
 1148|  4.17k|                      (state->mode == TYPE ? 128 : 0) +
  ------------------
  |  Branch (1148:24): [True: 0, False: 4.17k]
  ------------------
 1149|  4.17k|                      (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
  ------------------
  |  Branch (1149:24): [True: 0, False: 4.17k]
  |  Branch (1149:47): [True: 0, False: 4.17k]
  ------------------
 1150|  4.17k|    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
  ------------------
  |  |  176|  4.17k|#define Z_FINISH        4
  ------------------
                  if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  |  Branch (1150:11): [True: 0, False: 4.17k]
  |  Branch (1150:22): [True: 0, False: 0]
  |  Branch (1150:35): [True: 0, False: 4.17k]
  |  Branch (1150:57): [True: 0, False: 0]
  ------------------
 1151|      0|        ret = Z_BUF_ERROR;
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
 1152|  4.17k|    return ret;
 1153|  4.17k|}
inflateEnd:
 1155|  4.17k|int ZEXPORT inflateEnd(z_streamp strm) {
 1156|  4.17k|    struct inflate_state FAR *state;
 1157|  4.17k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (1157:9): [True: 0, False: 4.17k]
  ------------------
 1158|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1159|  4.17k|    state = (struct inflate_state FAR *)strm->state;
 1160|  4.17k|    if (state->window != Z_NULL) ZFREE(strm, state->window);
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (state->window != Z_NULL) ZFREE(strm, state->window);
  ------------------
  |  |  254|  3.89k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  |  Branch (1160:9): [True: 3.89k, False: 277]
  ------------------
 1161|  4.17k|    ZFREE(strm, strm->state);
  ------------------
  |  |  254|  4.17k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1162|  4.17k|    strm->state = Z_NULL;
  ------------------
  |  |  216|  4.17k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1163|  4.17k|    Tracev((stderr, "inflate: end\n"));
 1164|  4.17k|    return Z_OK;
  ------------------
  |  |  181|  4.17k|#define Z_OK            0
  ------------------
 1165|  4.17k|}
inflateSetDictionary:
 1188|  3.89k|                                 uInt dictLength) {
 1189|  3.89k|    struct inflate_state FAR *state;
 1190|  3.89k|    unsigned long dictid;
 1191|  3.89k|    int ret;
 1192|       |
 1193|       |    /* check state */
 1194|  3.89k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (1194:9): [True: 0, False: 3.89k]
  ------------------
 1195|  3.89k|    state = (struct inflate_state FAR *)strm->state;
 1196|  3.89k|    if (state->wrap != 0 && state->mode != DICT)
  ------------------
  |  Branch (1196:9): [True: 3.89k, False: 0]
  |  Branch (1196:29): [True: 0, False: 3.89k]
  ------------------
 1197|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1198|       |
 1199|       |    /* check for correct dictionary identifier */
 1200|  3.89k|    if (state->mode == DICT) {
  ------------------
  |  Branch (1200:9): [True: 3.89k, False: 0]
  ------------------
 1201|  3.89k|        dictid = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  3.89k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1202|  3.89k|        dictid = adler32(dictid, dictionary, dictLength);
 1203|  3.89k|        if (dictid != state->check)
  ------------------
  |  Branch (1203:13): [True: 0, False: 3.89k]
  ------------------
 1204|      0|            return Z_DATA_ERROR;
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
 1205|  3.89k|    }
 1206|       |
 1207|       |    /* copy dictionary to window using updatewindow(), which will amend the
 1208|       |       existing dictionary if appropriate */
 1209|  3.89k|    ret = updatewindow(strm, dictionary + dictLength, dictLength);
 1210|  3.89k|    if (ret) {
  ------------------
  |  Branch (1210:9): [True: 0, False: 3.89k]
  ------------------
 1211|      0|        state->mode = MEM;
 1212|      0|        return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
 1213|      0|    }
 1214|  3.89k|    state->havedict = 1;
 1215|  3.89k|    Tracev((stderr, "inflate:   dictionary set\n"));
 1216|  3.89k|    return Z_OK;
  ------------------
  |  |  181|  3.89k|#define Z_OK            0
  ------------------
 1217|  3.89k|}
inflate.c:inflateStateCheck:
   88|  28.6k|local int inflateStateCheck(z_streamp strm) {
   89|  28.6k|    struct inflate_state FAR *state;
   90|  28.6k|    if (strm == Z_NULL ||
  ------------------
  |  |  216|  57.2k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (90:9): [True: 0, False: 28.6k]
  ------------------
   91|  28.6k|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (91:9): [True: 0, False: 28.6k]
  |  Branch (91:42): [True: 0, False: 28.6k]
  ------------------
   92|      0|        return 1;
   93|  28.6k|    state = (struct inflate_state FAR *)strm->state;
   94|  28.6k|    if (state == Z_NULL || state->strm != strm ||
  ------------------
  |  |  216|  57.2k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (94:9): [True: 0, False: 28.6k]
  |  Branch (94:28): [True: 0, False: 28.6k]
  ------------------
   95|  28.6k|        state->mode < HEAD || state->mode > SYNC)
  ------------------
  |  Branch (95:9): [True: 0, False: 28.6k]
  |  Branch (95:31): [True: 0, False: 28.6k]
  ------------------
   96|      0|        return 1;
   97|  28.6k|    return 0;
   98|  28.6k|}
inflate.c:updatewindow:
  252|  7.78k|local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) {
  253|  7.78k|    struct inflate_state FAR *state;
  254|  7.78k|    unsigned dist;
  255|       |
  256|  7.78k|    state = (struct inflate_state FAR *)strm->state;
  257|       |
  258|       |    /* if it hasn't been done already, allocate space for the window */
  259|  7.78k|    if (state->window == Z_NULL) {
  ------------------
  |  |  216|  7.78k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (259:9): [True: 3.89k, False: 3.89k]
  ------------------
  260|  3.89k|        state->window = (unsigned char FAR *)
  261|  3.89k|                        ZALLOC(strm, 1U << state->wbits,
  ------------------
  |  |  253|  3.89k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  262|  3.89k|                               sizeof(unsigned char));
  263|  3.89k|        if (state->window == Z_NULL) return 1;
  ------------------
  |  |  216|  3.89k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (263:13): [True: 0, False: 3.89k]
  ------------------
  264|  3.89k|    }
  265|       |
  266|       |    /* if window not in use yet, initialize */
  267|  7.78k|    if (state->wsize == 0) {
  ------------------
  |  Branch (267:9): [True: 3.89k, False: 3.89k]
  ------------------
  268|  3.89k|        state->wsize = 1U << state->wbits;
  269|  3.89k|        state->wnext = 0;
  270|  3.89k|        state->whave = 0;
  271|  3.89k|    }
  272|       |
  273|       |    /* copy state->wsize or less output bytes into the circular window */
  274|  7.78k|    if (copy >= state->wsize) {
  ------------------
  |  Branch (274:9): [True: 0, False: 7.78k]
  ------------------
  275|      0|        zmemcpy(state->window, end - state->wsize, state->wsize);
  ------------------
  |  |  216|      0|#    define zmemcpy memcpy
  ------------------
  276|      0|        state->wnext = 0;
  277|      0|        state->whave = state->wsize;
  278|      0|    }
  279|  7.78k|    else {
  280|  7.78k|        dist = state->wsize - state->wnext;
  281|  7.78k|        if (dist > copy) dist = copy;
  ------------------
  |  Branch (281:13): [True: 7.78k, False: 0]
  ------------------
  282|  7.78k|        zmemcpy(state->window + state->wnext, end - copy, dist);
  ------------------
  |  |  216|  7.78k|#    define zmemcpy memcpy
  ------------------
  283|  7.78k|        copy -= dist;
  284|  7.78k|        if (copy) {
  ------------------
  |  Branch (284:13): [True: 0, False: 7.78k]
  ------------------
  285|      0|            zmemcpy(state->window, end - copy, copy);
  ------------------
  |  |  216|      0|#    define zmemcpy memcpy
  ------------------
  286|      0|            state->wnext = copy;
  287|      0|            state->whave = state->wsize;
  288|      0|        }
  289|  7.78k|        else {
  290|  7.78k|            state->wnext += dist;
  291|  7.78k|            if (state->wnext == state->wsize) state->wnext = 0;
  ------------------
  |  Branch (291:17): [True: 0, False: 7.78k]
  ------------------
  292|  7.78k|            if (state->whave < state->wsize) state->whave += dist;
  ------------------
  |  Branch (292:17): [True: 7.78k, False: 0]
  ------------------
  293|  7.78k|        }
  294|  7.78k|    }
  295|  7.78k|    return 0;
  296|  7.78k|}

inflate_table:
   48|  43.0k|                                unsigned FAR *bits, unsigned short FAR *work) {
   49|  43.0k|    unsigned len;               /* a code's length in bits */
   50|  43.0k|    unsigned sym;               /* index of code symbols */
   51|  43.0k|    unsigned min, max;          /* minimum and maximum code lengths */
   52|  43.0k|    unsigned root;              /* number of index bits for root table */
   53|  43.0k|    unsigned curr;              /* number of index bits for current table */
   54|  43.0k|    unsigned drop;              /* code bits to drop for sub-table */
   55|  43.0k|    int left;                   /* number of prefix codes available */
   56|  43.0k|    unsigned used;              /* code entries in table used */
   57|  43.0k|    unsigned huff;              /* Huffman code */
   58|  43.0k|    unsigned incr;              /* for incrementing code, index */
   59|  43.0k|    unsigned fill;              /* index for replicating entries */
   60|  43.0k|    unsigned low;               /* low bits for current root entry */
   61|  43.0k|    unsigned mask;              /* mask for low root bits */
   62|  43.0k|    code here;                  /* table entry for duplication */
   63|  43.0k|    code FAR *next;             /* next available space in table */
   64|  43.0k|    const unsigned short FAR *base = NULL;  /* base value table to use */
   65|  43.0k|    const unsigned short FAR *extra = NULL; /* extra bits table to use */
   66|  43.0k|    unsigned match = 0;         /* use base and extra for symbol >= match */
   67|  43.0k|    unsigned short count[MAXBITS+1];    /* number of codes of each length */
   68|  43.0k|    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
   69|  43.0k|    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
   70|  43.0k|        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
   71|  43.0k|        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
   72|  43.0k|    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
   73|  43.0k|        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
   74|  43.0k|        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 68, 193};
   75|  43.0k|    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
   76|  43.0k|        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
   77|  43.0k|        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
   78|  43.0k|        8193, 12289, 16385, 24577, 0, 0};
   79|  43.0k|    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
   80|  43.0k|        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
   81|  43.0k|        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
   82|  43.0k|        28, 28, 29, 29, 64, 64};
   83|       |
   84|       |    /*
   85|       |       Process a set of code lengths to create a canonical Huffman code.  The
   86|       |       code lengths are lens[0..codes-1].  Each length corresponds to the
   87|       |       symbols 0..codes-1.  The Huffman code is generated by first sorting the
   88|       |       symbols by length from short to long, and retaining the symbol order
   89|       |       for codes with equal lengths.  Then the code starts with all zero bits
   90|       |       for the first code of the shortest length, and the codes are integer
   91|       |       increments for the same length, and zeros are appended as the length
   92|       |       increases.  For the deflate format, these bits are stored backwards
   93|       |       from their more natural integer increment ordering, and so when the
   94|       |       decoding tables are built in the large loop below, the integer codes
   95|       |       are incremented backwards.
   96|       |
   97|       |       This routine assumes, but does not check, that all of the entries in
   98|       |       lens[] are in the range 0..MAXBITS.  The caller must assure this.
   99|       |       1..MAXBITS is interpreted as that code length.  zero means that that
  100|       |       symbol does not occur in this code.
  101|       |
  102|       |       The codes are sorted by computing a count of codes for each length,
  103|       |       creating from that a table of starting indices for each length in the
  104|       |       sorted table, and then entering the symbols in order in the sorted
  105|       |       table.  The sorted table is work[], with that space being provided by
  106|       |       the caller.
  107|       |
  108|       |       The length counts are used for other purposes as well, i.e. finding
  109|       |       the minimum and maximum length codes, determining if there are any
  110|       |       codes at all, checking for a valid set of lengths, and looking ahead
  111|       |       at length counts to determine sub-table sizes when building the
  112|       |       decoding tables.
  113|       |     */
  114|       |
  115|       |    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
  116|   732k|    for (len = 0; len <= MAXBITS; len++)
  ------------------
  |  |   23|   732k|#define MAXBITS 15
  ------------------
  |  Branch (116:19): [True: 689k, False: 43.0k]
  ------------------
  117|   689k|        count[len] = 0;
  118|  4.11M|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (118:19): [True: 4.07M, False: 43.0k]
  ------------------
  119|  4.07M|        count[lens[sym]]++;
  120|       |
  121|       |    /* bound code lengths, force root to be within code lengths */
  122|  43.0k|    root = *bits;
  123|   507k|    for (max = MAXBITS; max >= 1; max--)
  ------------------
  |  |   23|  43.0k|#define MAXBITS 15
  ------------------
  |  Branch (123:25): [True: 507k, False: 0]
  ------------------
  124|   507k|        if (count[max] != 0) break;
  ------------------
  |  Branch (124:13): [True: 43.0k, False: 464k]
  ------------------
  125|  43.0k|    if (root > max) root = max;
  ------------------
  |  Branch (125:9): [True: 38.4k, False: 4.63k]
  ------------------
  126|  43.0k|    if (max == 0) {                     /* no symbols to code at all */
  ------------------
  |  Branch (126:9): [True: 0, False: 43.0k]
  ------------------
  127|      0|        here.op = (unsigned char)64;    /* invalid code marker */
  128|      0|        here.bits = (unsigned char)1;
  129|      0|        here.val = (unsigned short)0;
  130|      0|        *(*table)++ = here;             /* make a table to force an error */
  131|      0|        *(*table)++ = here;
  132|      0|        *bits = 1;
  133|      0|        return 0;     /* no symbols, but wait for decoding to report error */
  134|      0|    }
  135|  71.6k|    for (min = 1; min < max; min++)
  ------------------
  |  Branch (135:19): [True: 55.9k, False: 15.7k]
  ------------------
  136|  55.9k|        if (count[min] != 0) break;
  ------------------
  |  Branch (136:13): [True: 27.3k, False: 28.5k]
  ------------------
  137|  43.0k|    if (root < min) root = min;
  ------------------
  |  Branch (137:9): [True: 0, False: 43.0k]
  ------------------
  138|       |
  139|       |    /* check for an over-subscribed or incomplete set of lengths */
  140|  43.0k|    left = 1;
  141|   689k|    for (len = 1; len <= MAXBITS; len++) {
  ------------------
  |  |   23|   689k|#define MAXBITS 15
  ------------------
  |  Branch (141:19): [True: 646k, False: 43.0k]
  ------------------
  142|   646k|        left <<= 1;
  143|   646k|        left -= count[len];
  144|   646k|        if (left < 0) return -1;        /* over-subscribed */
  ------------------
  |  Branch (144:13): [True: 0, False: 646k]
  ------------------
  145|   646k|    }
  146|  43.0k|    if (left > 0 && (type == CODES || max != 1))
  ------------------
  |  Branch (146:9): [True: 0, False: 43.0k]
  |  Branch (146:22): [True: 0, False: 0]
  |  Branch (146:39): [True: 0, False: 0]
  ------------------
  147|      0|        return -1;                      /* incomplete set */
  148|       |
  149|       |    /* generate offsets into symbol table for each length for sorting */
  150|  43.0k|    offs[1] = 0;
  151|   646k|    for (len = 1; len < MAXBITS; len++)
  ------------------
  |  |   23|   646k|#define MAXBITS 15
  ------------------
  |  Branch (151:19): [True: 603k, False: 43.0k]
  ------------------
  152|   603k|        offs[len + 1] = offs[len] + count[len];
  153|       |
  154|       |    /* sort symbols by length, by symbol order within each length */
  155|  4.11M|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (155:19): [True: 4.07M, False: 43.0k]
  ------------------
  156|  4.07M|        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
  ------------------
  |  Branch (156:13): [True: 863k, False: 3.21M]
  ------------------
  157|       |
  158|       |    /*
  159|       |       Create and fill in decoding tables.  In this loop, the table being
  160|       |       filled is at next and has curr index bits.  The code being used is huff
  161|       |       with length len.  That code is converted to an index by dropping drop
  162|       |       bits off of the bottom.  For codes where len is less than drop + curr,
  163|       |       those top drop + curr - len bits are incremented through all values to
  164|       |       fill the table with replicated entries.
  165|       |
  166|       |       root is the number of index bits for the root table.  When len exceeds
  167|       |       root, sub-tables are created pointed to by the root entry with an index
  168|       |       of the low root bits of huff.  This is saved in low to check for when a
  169|       |       new sub-table should be started.  drop is zero when the root table is
  170|       |       being filled, and drop is root when sub-tables are being filled.
  171|       |
  172|       |       When a new sub-table is needed, it is necessary to look ahead in the
  173|       |       code lengths to determine what size sub-table is needed.  The length
  174|       |       counts are used for this, and so count[] is decremented as codes are
  175|       |       entered in the tables.
  176|       |
  177|       |       used keeps track of how many table entries have been allocated from the
  178|       |       provided *table space.  It is checked for LENS and DIST tables against
  179|       |       the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
  180|       |       the initial root table size constants.  See the comments in inftrees.h
  181|       |       for more information.
  182|       |
  183|       |       sym increments through all symbols, and the loop terminates when
  184|       |       all codes of length max, i.e. all codes, have been processed.  This
  185|       |       routine permits incomplete codes, so another loop after this one fills
  186|       |       in the rest of the decoding tables with invalid code markers.
  187|       |     */
  188|       |
  189|       |    /* set up for code type */
  190|  43.0k|    switch (type) {
  ------------------
  |  Branch (190:13): [True: 43.0k, False: 0]
  ------------------
  191|  14.3k|    case CODES:
  ------------------
  |  Branch (191:5): [True: 14.3k, False: 28.7k]
  ------------------
  192|  14.3k|        match = 20;
  193|  14.3k|        break;
  194|  14.3k|    case LENS:
  ------------------
  |  Branch (194:5): [True: 14.3k, False: 28.7k]
  ------------------
  195|  14.3k|        base = lbase;
  196|  14.3k|        extra = lext;
  197|  14.3k|        match = 257;
  198|  14.3k|        break;
  199|  14.3k|    case DISTS:
  ------------------
  |  Branch (199:5): [True: 14.3k, False: 28.7k]
  ------------------
  200|  14.3k|        base = dbase;
  201|  14.3k|        extra = dext;
  202|  43.0k|    }
  203|       |
  204|       |    /* initialize state for loop */
  205|  43.0k|    huff = 0;                   /* starting code */
  206|  43.0k|    sym = 0;                    /* starting code symbol */
  207|  43.0k|    len = min;                  /* starting code length */
  208|  43.0k|    next = *table;              /* current table to fill in */
  209|  43.0k|    curr = root;                /* current table index bits */
  210|  43.0k|    drop = 0;                   /* current bits to drop from code for index */
  211|  43.0k|    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
  212|  43.0k|    used = 1U << root;          /* use root table entries */
  213|  43.0k|    mask = used - 1;            /* mask for comparing low */
  214|       |
  215|       |    /* check available table space */
  216|  43.0k|    if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   50|  14.3k|#  define ENOUGH_LENS 852
  ------------------
  |  Branch (216:10): [True: 14.3k, False: 28.7k]
  |  Branch (216:26): [True: 0, False: 14.3k]
  ------------------
  217|  43.0k|        (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   51|  14.3k|#  define ENOUGH_DISTS 592
  ------------------
  |  Branch (217:10): [True: 14.3k, False: 28.7k]
  |  Branch (217:27): [True: 0, False: 14.3k]
  ------------------
  218|      0|        return 1;
  219|       |
  220|       |    /* process all codes and make table entries */
  221|   863k|    for (;;) {
  222|       |        /* create table entry */
  223|   863k|        here.bits = (unsigned char)(len - drop);
  224|   863k|        if (work[sym] + 1U < match) {
  ------------------
  |  Branch (224:13): [True: 779k, False: 83.9k]
  ------------------
  225|   779k|            here.op = (unsigned char)0;
  226|   779k|            here.val = work[sym];
  227|   779k|        }
  228|  83.9k|        else if (work[sym] >= match) {
  ------------------
  |  Branch (228:18): [True: 69.5k, False: 14.3k]
  ------------------
  229|  69.5k|            here.op = (unsigned char)(extra[work[sym] - match]);
  230|  69.5k|            here.val = base[work[sym] - match];
  231|  69.5k|        }
  232|  14.3k|        else {
  233|  14.3k|            here.op = (unsigned char)(32 + 64);         /* end of block */
  234|  14.3k|            here.val = 0;
  235|  14.3k|        }
  236|       |
  237|       |        /* replicate for those indices with low len bits equal to huff */
  238|   863k|        incr = 1U << (len - drop);
  239|   863k|        fill = 1U << curr;
  240|   863k|        min = fill;                 /* save offset to next table */
  241|  3.17M|        do {
  242|  3.17M|            fill -= incr;
  243|  3.17M|            next[(huff >> drop) + fill] = here;
  244|  3.17M|        } while (fill != 0);
  ------------------
  |  Branch (244:18): [True: 2.31M, False: 863k]
  ------------------
  245|       |
  246|       |        /* backwards increment the len-bit code huff */
  247|   863k|        incr = 1U << (len - 1);
  248|  1.68M|        while (huff & incr)
  ------------------
  |  Branch (248:16): [True: 820k, False: 863k]
  ------------------
  249|   820k|            incr >>= 1;
  250|   863k|        if (incr != 0) {
  ------------------
  |  Branch (250:13): [True: 820k, False: 43.0k]
  ------------------
  251|   820k|            huff &= incr - 1;
  252|   820k|            huff += incr;
  253|   820k|        }
  254|  43.0k|        else
  255|  43.0k|            huff = 0;
  256|       |
  257|       |        /* go to next symbol, update count, len */
  258|   863k|        sym++;
  259|   863k|        if (--(count[len]) == 0) {
  ------------------
  |  Branch (259:13): [True: 136k, False: 727k]
  ------------------
  260|   136k|            if (len == max) break;
  ------------------
  |  Branch (260:17): [True: 43.0k, False: 93.1k]
  ------------------
  261|  93.1k|            len = lens[work[sym]];
  262|  93.1k|        }
  263|       |
  264|       |        /* create new sub-table if needed */
  265|   820k|        if (len > root && (huff & mask) != low) {
  ------------------
  |  Branch (265:13): [True: 66.2k, False: 754k]
  |  Branch (265:27): [True: 25.9k, False: 40.3k]
  ------------------
  266|       |            /* if first time, transition to sub-tables */
  267|  25.9k|            if (drop == 0)
  ------------------
  |  Branch (267:17): [True: 2.02k, False: 23.9k]
  ------------------
  268|  2.02k|                drop = root;
  269|       |
  270|       |            /* increment past last table */
  271|  25.9k|            next += min;            /* here min is 1 << curr */
  272|       |
  273|       |            /* determine length of next table */
  274|  25.9k|            curr = len - drop;
  275|  25.9k|            left = (int)(1 << curr);
  276|  26.9k|            while (curr + drop < max) {
  ------------------
  |  Branch (276:20): [True: 8.19k, False: 18.7k]
  ------------------
  277|  8.19k|                left -= count[curr + drop];
  278|  8.19k|                if (left <= 0) break;
  ------------------
  |  Branch (278:21): [True: 7.16k, False: 1.03k]
  ------------------
  279|  1.03k|                curr++;
  280|  1.03k|                left <<= 1;
  281|  1.03k|            }
  282|       |
  283|       |            /* check for enough space */
  284|  25.9k|            used += 1U << curr;
  285|  25.9k|            if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   50|  24.9k|#  define ENOUGH_LENS 852
  ------------------
  |  Branch (285:18): [True: 24.9k, False: 969]
  |  Branch (285:34): [True: 0, False: 24.9k]
  ------------------
  286|  25.9k|                (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   51|    969|#  define ENOUGH_DISTS 592
  ------------------
  |  Branch (286:18): [True: 969, False: 24.9k]
  |  Branch (286:35): [True: 0, False: 969]
  ------------------
  287|      0|                return 1;
  288|       |
  289|       |            /* point entry in root table to sub-table */
  290|  25.9k|            low = huff & mask;
  291|  25.9k|            (*table)[low].op = (unsigned char)curr;
  292|  25.9k|            (*table)[low].bits = (unsigned char)root;
  293|  25.9k|            (*table)[low].val = (unsigned short)(next - *table);
  294|  25.9k|        }
  295|   820k|    }
  296|       |
  297|       |    /* fill in remaining table entry if code is incomplete (guaranteed to have
  298|       |       at most one remaining entry, since if the code is incomplete, the
  299|       |       maximum code length that was allowed to get this far is one bit) */
  300|  43.0k|    if (huff != 0) {
  ------------------
  |  Branch (300:9): [True: 0, False: 43.0k]
  ------------------
  301|      0|        here.op = (unsigned char)64;            /* invalid code marker */
  302|      0|        here.bits = (unsigned char)(len - drop);
  303|      0|        here.val = (unsigned short)0;
  304|      0|        next[huff] = here;
  305|      0|    }
  306|       |
  307|       |    /* set return parameters */
  308|  43.0k|    *table += used;
  309|  43.0k|    *bits = root;
  310|  43.0k|    return 0;
  311|  43.0k|}
inflate_fixed:
  364|  8.60k|void inflate_fixed(struct inflate_state FAR *state) {
  365|       |#ifdef BUILDFIXED
  366|       |    z_once(&built, buildtables);
  367|       |#endif /* BUILDFIXED */
  368|  8.60k|    state->lencode = lenfix;
  369|  8.60k|    state->lenbits = 9;
  370|  8.60k|    state->distcode = distfix;
  371|  8.60k|    state->distbits = 5;
  372|  8.60k|}

_tr_init:
  456|  4.17k|void ZLIB_INTERNAL _tr_init(deflate_state *s) {
  457|  4.17k|    tr_static_init();
  458|       |
  459|  4.17k|    s->l_desc.dyn_tree = s->dyn_ltree;
  460|  4.17k|    s->l_desc.stat_desc = &static_l_desc;
  461|       |
  462|  4.17k|    s->d_desc.dyn_tree = s->dyn_dtree;
  463|  4.17k|    s->d_desc.stat_desc = &static_d_desc;
  464|       |
  465|  4.17k|    s->bl_desc.dyn_tree = s->bl_tree;
  466|  4.17k|    s->bl_desc.stat_desc = &static_bl_desc;
  467|       |
  468|  4.17k|    s->bi_buf = 0;
  469|  4.17k|    s->bi_valid = 0;
  470|  4.17k|    s->bi_used = 0;
  471|       |#ifdef ZLIB_DEBUG
  472|       |    s->compressed_len = 0L;
  473|       |    s->bits_sent = 0L;
  474|       |#endif
  475|       |
  476|       |    /* Initialize the first block of the first file: */
  477|  4.17k|    init_block(s);
  478|  4.17k|}
_tr_stored_block:
  861|  6.88k|                                    ulg stored_len, int last) {
  862|  6.88k|    send_bits(s, (STORED_BLOCK<<1) + last, 3);  /* send block type */
  ------------------
  |  |  274|  6.88k|#define send_bits(s, value, length) \
  |  |  275|  6.88k|{ int len = length;\
  |  |  276|  6.88k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  6.88k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 6.88k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  6.88k|  } else {\
  |  |  283|  6.88k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  6.88k|    s->bi_valid += len;\
  |  |  285|  6.88k|  }\
  |  |  286|  6.88k|}
  ------------------
  863|  6.88k|    bi_windup(s);        /* align on byte boundary */
  864|  6.88k|    put_short(s, (ush)stored_len);
  ------------------
  |  |  144|  6.88k|#define put_short(s, w) { \
  |  |  145|  6.88k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  6.88k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  6.88k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  6.88k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  6.88k|}
  ------------------
  865|  6.88k|    put_short(s, (ush)~stored_len);
  ------------------
  |  |  144|  6.88k|#define put_short(s, w) { \
  |  |  145|  6.88k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  6.88k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  6.88k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  6.88k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  6.88k|}
  ------------------
  866|  6.88k|    if (stored_len)
  ------------------
  |  Branch (866:9): [True: 6.88k, False: 0]
  ------------------
  867|  6.88k|        zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
  ------------------
  |  |  216|  6.88k|#    define zmemcpy memcpy
  ------------------
  868|  6.88k|    s->pending += stored_len;
  869|       |#ifdef ZLIB_DEBUG
  870|       |    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
  871|       |    s->compressed_len += (stored_len + 4) << 3;
  872|       |    s->bits_sent += 2*16;
  873|       |    s->bits_sent += stored_len << 3;
  874|       |#endif
  875|  6.88k|}
_tr_flush_bits:
  880|  38.1k|void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) {
  881|  38.1k|    bi_flush(s);
  882|  38.1k|}
_tr_flush_block:
  998|  29.8k|                                   ulg stored_len, int last) {
  999|  29.8k|    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
 1000|  29.8k|    int max_blindex = 0;  /* index of last bit length code of non zero freq */
 1001|       |
 1002|       |    /* Build the Huffman trees unless a stored block is forced */
 1003|  29.8k|    if (s->level > 0) {
  ------------------
  |  Branch (1003:9): [True: 29.8k, False: 0]
  ------------------
 1004|       |
 1005|       |        /* Check if the file is binary or text */
 1006|  29.8k|        if (s->strm->data_type == Z_UNKNOWN)
  ------------------
  |  |  210|  29.8k|#define Z_UNKNOWN  2
  ------------------
  |  Branch (1006:13): [True: 4.17k, False: 25.6k]
  ------------------
 1007|  4.17k|            s->strm->data_type = detect_data_type(s);
 1008|       |
 1009|       |        /* Construct the literal and distance trees */
 1010|  29.8k|        build_tree(s, (tree_desc *)(&(s->l_desc)));
 1011|  29.8k|        Tracev((stderr, "\nlit data: dyn %lu, stat %lu", s->opt_len,
 1012|  29.8k|                s->static_len));
 1013|       |
 1014|  29.8k|        build_tree(s, (tree_desc *)(&(s->d_desc)));
 1015|  29.8k|        Tracev((stderr, "\ndist data: dyn %lu, stat %lu", s->opt_len,
 1016|  29.8k|                s->static_len));
 1017|       |        /* At this point, opt_len and static_len are the total bit lengths of
 1018|       |         * the compressed block data, excluding the tree representations.
 1019|       |         */
 1020|       |
 1021|       |        /* Build the bit length tree for the above two trees, and get the index
 1022|       |         * in bl_order of the last bit length code to send.
 1023|       |         */
 1024|  29.8k|        max_blindex = build_bl_tree(s);
 1025|       |
 1026|       |        /* Determine the best encoding. Compute the block lengths in bytes. */
 1027|  29.8k|        opt_lenb = (s->opt_len + 3 + 7) >> 3;
 1028|  29.8k|        static_lenb = (s->static_len + 3 + 7) >> 3;
 1029|       |
 1030|  29.8k|        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
 1031|  29.8k|                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
 1032|  29.8k|                s->sym_next / 3));
 1033|       |
 1034|  29.8k|#ifndef FORCE_STATIC
 1035|  29.8k|        if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
  ------------------
  |  |  203|  15.2k|#define Z_FIXED               4
  ------------------
  |  Branch (1035:13): [True: 14.5k, False: 15.2k]
  |  Branch (1035:40): [True: 396, False: 14.8k]
  ------------------
 1036|  14.9k|#endif
 1037|  14.9k|            opt_lenb = static_lenb;
 1038|       |
 1039|  29.8k|    } else {
 1040|      0|        Assert(buf != (char*)0, "lost buf");
 1041|      0|        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
 1042|      0|    }
 1043|       |
 1044|       |#ifdef FORCE_STORED
 1045|       |    if (buf != (char*)0) { /* force stored block */
 1046|       |#else
 1047|  29.8k|    if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
  ------------------
  |  Branch (1047:9): [True: 7.91k, False: 21.9k]
  |  Branch (1047:39): [True: 6.88k, False: 1.03k]
  ------------------
 1048|       |                       /* 4: two words for the lengths */
 1049|  6.88k|#endif
 1050|       |        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
 1051|       |         * Otherwise we can't have processed more than WSIZE input bytes since
 1052|       |         * the last block flush, because compression would have been
 1053|       |         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
 1054|       |         * transform a block into a stored block.
 1055|       |         */
 1056|  6.88k|        _tr_stored_block(s, buf, stored_len, last);
 1057|       |
 1058|  22.9k|    } else if (static_lenb == opt_lenb) {
  ------------------
  |  Branch (1058:16): [True: 8.60k, False: 14.3k]
  ------------------
 1059|  8.60k|        send_bits(s, (STATIC_TREES<<1) + last, 3);
  ------------------
  |  |  274|  8.60k|#define send_bits(s, value, length) \
  |  |  275|  8.60k|{ int len = length;\
  |  |  276|  8.60k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  8.60k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 8.60k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  8.60k|  } else {\
  |  |  283|  8.60k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  8.60k|    s->bi_valid += len;\
  |  |  285|  8.60k|  }\
  |  |  286|  8.60k|}
  ------------------
 1060|  8.60k|        compress_block(s, (const ct_data *)static_ltree,
 1061|  8.60k|                       (const ct_data *)static_dtree);
 1062|       |#ifdef ZLIB_DEBUG
 1063|       |        s->compressed_len += 3 + s->static_len;
 1064|       |#endif
 1065|  14.3k|    } else {
 1066|  14.3k|        send_bits(s, (DYN_TREES<<1) + last, 3);
  ------------------
  |  |  274|  14.3k|#define send_bits(s, value, length) \
  |  |  275|  14.3k|{ int len = length;\
  |  |  276|  14.3k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  14.3k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 14.3k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  14.3k|  } else {\
  |  |  283|  14.3k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  14.3k|    s->bi_valid += len;\
  |  |  285|  14.3k|  }\
  |  |  286|  14.3k|}
  ------------------
 1067|  14.3k|        send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
 1068|  14.3k|                       max_blindex + 1);
 1069|  14.3k|        compress_block(s, (const ct_data *)s->dyn_ltree,
 1070|  14.3k|                       (const ct_data *)s->dyn_dtree);
 1071|       |#ifdef ZLIB_DEBUG
 1072|       |        s->compressed_len += 3 + s->opt_len;
 1073|       |#endif
 1074|  14.3k|    }
 1075|  29.8k|    Assert (s->compressed_len == s->bits_sent, "bad compressed size");
 1076|       |    /* The above check is made mod 2^32, for files larger than 512 MB
 1077|       |     * and uLong implemented on 32 bits.
 1078|       |     */
 1079|  29.8k|    init_block(s);
 1080|       |
 1081|  29.8k|    if (last) {
  ------------------
  |  Branch (1081:9): [True: 4.17k, False: 25.6k]
  ------------------
 1082|  4.17k|        bi_windup(s);
 1083|       |#ifdef ZLIB_DEBUG
 1084|       |        s->compressed_len += 7;  /* align on byte boundary */
 1085|       |#endif
 1086|  4.17k|    }
 1087|  29.8k|    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
 1088|  29.8k|           s->compressed_len - 7*(ulg)last));
 1089|  29.8k|}
trees.c:tr_static_init:
  295|  4.17k|local void tr_static_init(void) {
  296|       |#if defined(GEN_TREES_H) || !defined(STDC)
  297|       |    static int static_init_done = 0;
  298|       |    int n;        /* iterates over tree elements */
  299|       |    int bits;     /* bit counter */
  300|       |    int length;   /* length value */
  301|       |    int code;     /* code value */
  302|       |    int dist;     /* distance index */
  303|       |    ush bl_count[MAX_BITS+1];
  304|       |    /* number of codes at each bit length for an optimal tree */
  305|       |
  306|       |    if (static_init_done) return;
  307|       |
  308|       |    /* For some embedded targets, global variables are not initialized: */
  309|       |#ifdef NO_INIT_GLOBAL_POINTERS
  310|       |    static_l_desc.static_tree = static_ltree;
  311|       |    static_l_desc.extra_bits = extra_lbits;
  312|       |    static_d_desc.static_tree = static_dtree;
  313|       |    static_d_desc.extra_bits = extra_dbits;
  314|       |    static_bl_desc.extra_bits = extra_blbits;
  315|       |#endif
  316|       |
  317|       |    /* Initialize the mapping length (0..255) -> length code (0..28) */
  318|       |    length = 0;
  319|       |    for (code = 0; code < LENGTH_CODES-1; code++) {
  320|       |        base_length[code] = length;
  321|       |        for (n = 0; n < (1 << extra_lbits[code]); n++) {
  322|       |            _length_code[length++] = (uch)code;
  323|       |        }
  324|       |    }
  325|       |    Assert (length == 256, "tr_static_init: length != 256");
  326|       |    /* Note that the length 255 (match length 258) can be represented
  327|       |     * in two different ways: code 284 + 5 bits or code 285, so we
  328|       |     * overwrite length_code[255] to use the best encoding:
  329|       |     */
  330|       |    _length_code[length - 1] = (uch)code;
  331|       |
  332|       |    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
  333|       |    dist = 0;
  334|       |    for (code = 0 ; code < 16; code++) {
  335|       |        base_dist[code] = dist;
  336|       |        for (n = 0; n < (1 << extra_dbits[code]); n++) {
  337|       |            _dist_code[dist++] = (uch)code;
  338|       |        }
  339|       |    }
  340|       |    Assert (dist == 256, "tr_static_init: dist != 256");
  341|       |    dist >>= 7; /* from now on, all distances are divided by 128 */
  342|       |    for ( ; code < D_CODES; code++) {
  343|       |        base_dist[code] = dist << 7;
  344|       |        for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
  345|       |            _dist_code[256 + dist++] = (uch)code;
  346|       |        }
  347|       |    }
  348|       |    Assert (dist == 256, "tr_static_init: 256 + dist != 512");
  349|       |
  350|       |    /* Construct the codes of the static literal tree */
  351|       |    for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
  352|       |    n = 0;
  353|       |    while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
  354|       |    while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
  355|       |    while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
  356|       |    while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
  357|       |    /* Codes 286 and 287 do not exist, but we must include them in the
  358|       |     * tree construction to get a canonical Huffman tree (longest code
  359|       |     * all ones)
  360|       |     */
  361|       |    gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
  362|       |
  363|       |    /* The static distance tree is trivial: */
  364|       |    for (n = 0; n < D_CODES; n++) {
  365|       |        static_dtree[n].Len = 5;
  366|       |        static_dtree[n].Code = bi_reverse((unsigned)n, 5);
  367|       |    }
  368|       |    static_init_done = 1;
  369|       |
  370|       |#  ifdef GEN_TREES_H
  371|       |    gen_trees_header();
  372|       |#  endif
  373|       |#endif /* defined(GEN_TREES_H) || !defined(STDC) */
  374|  4.17k|}
trees.c:init_block:
  440|  34.0k|local void init_block(deflate_state *s) {
  441|  34.0k|    int n; /* iterates over tree elements */
  442|       |
  443|       |    /* Initialize the trees. */
  444|  9.76M|    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   40|  9.76M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   37|  9.76M|#define LITERALS  256
  |  |  ------------------
  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   34|  9.76M|#define LENGTH_CODES 29
  |  |  ------------------
  ------------------
                  for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   83|  9.73M|#define Freq fc.freq
  ------------------
  |  Branch (444:17): [True: 9.73M, False: 34.0k]
  ------------------
  445|  1.05M|    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   43|  1.05M|#define D_CODES   30
  ------------------
                  for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   83|  1.02M|#define Freq fc.freq
  ------------------
  |  Branch (445:17): [True: 1.02M, False: 34.0k]
  ------------------
  446|   680k|    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   46|   680k|#define BL_CODES  19
  ------------------
                  for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   83|   646k|#define Freq fc.freq
  ------------------
  |  Branch (446:17): [True: 646k, False: 34.0k]
  ------------------
  447|       |
  448|  34.0k|    s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   50|  34.0k|#define END_BLOCK 256
  ------------------
                  s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   83|  34.0k|#define Freq fc.freq
  ------------------
  449|  34.0k|    s->opt_len = s->static_len = 0L;
  450|  34.0k|    s->sym_next = s->matches = 0;
  451|  34.0k|}
trees.c:bi_windup:
  181|  11.0k|local void bi_windup(deflate_state *s) {
  182|  11.0k|    if (s->bi_valid > 8) {
  ------------------
  |  Branch (182:9): [True: 2.41k, False: 8.64k]
  ------------------
  183|  2.41k|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|  2.41k|#define put_short(s, w) { \
  |  |  145|  2.41k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  2.41k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  2.41k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  2.41k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  2.41k|}
  ------------------
  184|  8.64k|    } else if (s->bi_valid > 0) {
  ------------------
  |  Branch (184:16): [True: 8.38k, False: 255]
  ------------------
  185|  8.38k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  293|  8.38k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  186|  8.38k|    }
  187|  11.0k|    s->bi_used = ((s->bi_valid - 1) & 7) + 1;
  188|  11.0k|    s->bi_buf = 0;
  189|  11.0k|    s->bi_valid = 0;
  190|       |#ifdef ZLIB_DEBUG
  191|       |    s->bits_sent = (s->bits_sent + 7) & ~(ulg)7;
  192|       |#endif
  193|  11.0k|}
trees.c:bi_flush:
  166|  38.1k|local void bi_flush(deflate_state *s) {
  167|  38.1k|    if (s->bi_valid == 16) {
  ------------------
  |  Branch (167:9): [True: 1.74k, False: 36.4k]
  ------------------
  168|  1.74k|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|  1.74k|#define put_short(s, w) { \
  |  |  145|  1.74k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  1.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  1.74k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  1.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  1.74k|}
  ------------------
  169|  1.74k|        s->bi_buf = 0;
  170|  1.74k|        s->bi_valid = 0;
  171|  36.4k|    } else if (s->bi_valid >= 8) {
  ------------------
  |  Branch (171:16): [True: 9.39k, False: 27.0k]
  ------------------
  172|  9.39k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  293|  9.39k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  173|  9.39k|        s->bi_buf >>= 8;
  174|  9.39k|        s->bi_valid -= 8;
  175|  9.39k|    }
  176|  38.1k|}
trees.c:detect_data_type:
  966|  4.17k|local int detect_data_type(deflate_state *s) {
  967|       |    /* block_mask is the bit mask of block-listed bytes
  968|       |     * set bits 0..6, 14..25, and 28..31
  969|       |     * 0xf3ffc07f = binary 11110011111111111100000001111111
  970|       |     */
  971|  4.17k|    unsigned long block_mask = 0xf3ffc07fUL;
  972|  4.17k|    int n;
  973|       |
  974|       |    /* Check for non-textual ("block-listed") bytes. */
  975|  45.0k|    for (n = 0; n <= 31; n++, block_mask >>= 1)
  ------------------
  |  Branch (975:17): [True: 43.9k, False: 1.13k]
  ------------------
  976|  43.9k|        if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
  ------------------
  |  |   83|  32.4k|#define Freq fc.freq
  ------------------
  |  Branch (976:13): [True: 32.4k, False: 11.4k]
  |  Branch (976:33): [True: 3.03k, False: 29.4k]
  ------------------
  977|  3.03k|            return Z_BINARY;
  ------------------
  |  |  207|  3.03k|#define Z_BINARY   0
  ------------------
  978|       |
  979|       |    /* Check for textual ("allow-listed") bytes. */
  980|  1.13k|    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|  1.13k|#define Freq fc.freq
  ------------------
                  if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|  1.09k|#define Freq fc.freq
  ------------------
  |  Branch (980:9): [True: 36, False: 1.09k]
  |  Branch (980:38): [True: 71, False: 1.02k]
  ------------------
  981|  1.02k|            || s->dyn_ltree[13].Freq != 0)
  ------------------
  |  |   83|  1.02k|#define Freq fc.freq
  ------------------
  |  Branch (981:16): [True: 34, False: 994]
  ------------------
  982|    141|        return Z_TEXT;
  ------------------
  |  |  208|    141|#define Z_TEXT     1
  ------------------
  983|   135k|    for (n = 32; n < LITERALS; n++)
  ------------------
  |  |   37|   135k|#define LITERALS  256
  ------------------
  |  Branch (983:18): [True: 135k, False: 295]
  ------------------
  984|   135k|        if (s->dyn_ltree[n].Freq != 0)
  ------------------
  |  |   83|   135k|#define Freq fc.freq
  ------------------
  |  Branch (984:13): [True: 699, False: 134k]
  ------------------
  985|    699|            return Z_TEXT;
  ------------------
  |  |  208|  1.69k|#define Z_TEXT     1
  ------------------
  986|       |
  987|       |    /* There are no "block-listed" or "allow-listed" bytes:
  988|       |     * this stream either is empty or has tolerated ("gray-listed") bytes only.
  989|       |     */
  990|    295|    return Z_BINARY;
  ------------------
  |  |  207|    295|#define Z_BINARY   0
  ------------------
  991|    994|}
trees.c:build_tree:
  627|  89.5k|local void build_tree(deflate_state *s, tree_desc *desc) {
  628|  89.5k|    ct_data *tree         = desc->dyn_tree;
  629|  89.5k|    const ct_data *stree  = desc->stat_desc->static_tree;
  630|  89.5k|    int elems             = desc->stat_desc->elems;
  631|  89.5k|    int n, m;          /* iterate over heap elements */
  632|  89.5k|    int max_code = -1; /* largest code with non zero frequency */
  633|  89.5k|    int node;          /* new node being created */
  634|       |
  635|       |    /* Construct the initial heap, with least frequent element in
  636|       |     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n + 1].
  637|       |     * heap[0] is not used.
  638|       |     */
  639|  89.5k|    s->heap_len = 0, s->heap_max = HEAP_SIZE;
  ------------------
  |  |   49|  89.5k|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  89.5k|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  89.5k|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  89.5k|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|       |
  641|  10.0M|    for (n = 0; n < elems; n++) {
  ------------------
  |  Branch (641:17): [True: 10.0M, False: 89.5k]
  ------------------
  642|  10.0M|        if (tree[n].Freq != 0) {
  ------------------
  |  |   83|  10.0M|#define Freq fc.freq
  ------------------
  |  Branch (642:13): [True: 2.39M, False: 7.61M]
  ------------------
  643|  2.39M|            s->heap[++(s->heap_len)] = max_code = n;
  644|  2.39M|            s->depth[n] = 0;
  645|  7.61M|        } else {
  646|  7.61M|            tree[n].Len = 0;
  ------------------
  |  |   86|  7.61M|#define Len  dl.len
  ------------------
  647|  7.61M|        }
  648|  10.0M|    }
  649|       |
  650|       |    /* The pkzip format requires that at least one distance code exists,
  651|       |     * and that at least one bit should be sent even if there is only one
  652|       |     * possible code. So to avoid special checks later on we force at least
  653|       |     * two codes of non zero frequency.
  654|       |     */
  655|   131k|    while (s->heap_len < 2) {
  ------------------
  |  Branch (655:12): [True: 42.1k, False: 89.5k]
  ------------------
  656|  42.1k|        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
  ------------------
  |  Branch (656:44): [True: 40.6k, False: 1.47k]
  ------------------
  657|  42.1k|        tree[node].Freq = 1;
  ------------------
  |  |   83|  42.1k|#define Freq fc.freq
  ------------------
  658|  42.1k|        s->depth[node] = 0;
  659|  42.1k|        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
  ------------------
  |  |   86|  42.1k|#define Len  dl.len
  ------------------
  |  Branch (659:27): [True: 42.1k, False: 0]
  ------------------
  660|       |        /* node is 0 or 1 so it does not have extra bits */
  661|  42.1k|    }
  662|  89.5k|    desc->max_code = max_code;
  663|       |
  664|       |    /* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree,
  665|       |     * establish sub-heaps of increasing lengths:
  666|       |     */
  667|  1.28M|    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
  ------------------
  |  Branch (667:29): [True: 1.19M, False: 89.5k]
  ------------------
  668|       |
  669|       |    /* Construct the Huffman tree by repeatedly combining the least two
  670|       |     * frequent nodes.
  671|       |     */
  672|  89.5k|    node = elems;              /* next internal node of the tree */
  673|  2.34M|    do {
  674|  2.34M|        pqremove(s, tree, n);  /* n = node of least frequency */
  ------------------
  |  |  488|  2.34M|#define pqremove(s, tree, top) \
  |  |  489|  2.34M|{\
  |  |  490|  2.34M|    top = s->heap[SMALLEST]; \
  |  |  ------------------
  |  |  |  |  480|  2.34M|#define SMALLEST 1
  |  |  ------------------
  |  |  491|  2.34M|    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
  |  |  ------------------
  |  |  |  |  480|  2.34M|#define SMALLEST 1
  |  |  ------------------
  |  |  492|  2.34M|    pqdownheap(s, tree, SMALLEST); \
  |  |  ------------------
  |  |  |  |  480|  2.34M|#define SMALLEST 1
  |  |  ------------------
  |  |  493|  2.34M|}
  ------------------
  675|  2.34M|        m = s->heap[SMALLEST]; /* m = node of next least frequency */
  ------------------
  |  |  480|  2.34M|#define SMALLEST 1
  ------------------
  676|       |
  677|  2.34M|        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
  678|  2.34M|        s->heap[--(s->heap_max)] = m;
  679|       |
  680|       |        /* Create a new node father of n and m */
  681|  2.34M|        tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  2.34M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  2.34M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  2.34M|#define Freq fc.freq
  ------------------
  682|  2.34M|        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
  ------------------
  |  Branch (682:33): [True: 2.06M, False: 278k]
  ------------------
  683|  2.06M|                                s->depth[n] : s->depth[m]) + 1);
  684|  2.34M|        tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  2.34M|#define Dad  dl.dad
  ------------------
                      tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  2.34M|#define Dad  dl.dad
  ------------------
  685|       |#ifdef DUMP_BL_TREE
  686|       |        if (tree == s->bl_tree) {
  687|       |            fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
  688|       |                    node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
  689|       |        }
  690|       |#endif
  691|       |        /* and insert the new node in the heap */
  692|  2.34M|        s->heap[SMALLEST] = node++;
  ------------------
  |  |  480|  2.34M|#define SMALLEST 1
  ------------------
  693|  2.34M|        pqdownheap(s, tree, SMALLEST);
  ------------------
  |  |  480|  2.34M|#define SMALLEST 1
  ------------------
  694|       |
  695|  2.34M|    } while (s->heap_len >= 2);
  ------------------
  |  Branch (695:14): [True: 2.25M, False: 89.5k]
  ------------------
  696|       |
  697|  89.5k|    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
  ------------------
  |  |  480|  89.5k|#define SMALLEST 1
  ------------------
  698|       |
  699|       |    /* At this point, the fields freq and dad are set. We can now
  700|       |     * generate the bit lengths.
  701|       |     */
  702|  89.5k|    gen_bitlen(s, (tree_desc *)desc);
  703|       |
  704|       |    /* The field len is now set, we can generate the bit codes */
  705|  89.5k|    gen_codes ((ct_data *)tree, max_code, s->bl_count);
  706|  89.5k|}
trees.c:pqdownheap:
  509|  5.88M|local void pqdownheap(deflate_state *s, ct_data *tree, int k) {
  510|  5.88M|    int v = s->heap[k];
  511|  5.88M|    int j = k << 1;  /* left son of k */
  512|  23.0M|    while (j <= s->heap_len) {
  ------------------
  |  Branch (512:12): [True: 19.2M, False: 3.82M]
  ------------------
  513|       |        /* Set j to the smallest of the two sons: */
  514|  19.2M|        if (j < s->heap_len &&
  ------------------
  |  Branch (514:13): [True: 18.6M, False: 570k]
  ------------------
  515|  18.6M|            smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
  ------------------
  |  |  500|  18.6M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  18.6M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  37.2M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 1.94M, False: 16.6M]
  |  |  ------------------
  |  |  501|  18.6M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  16.6M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  33.3M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 9.53M, False: 7.15M]
  |  |  |  Branch (501:37): [True: 7.66M, False: 1.87M]
  |  |  ------------------
  ------------------
  516|  9.60M|            j++;
  517|  9.60M|        }
  518|       |        /* Exit if v is smaller than both sons */
  519|  19.2M|        if (smaller(tree, v, s->heap[j], s->depth)) break;
  ------------------
  |  |  500|  19.2M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  19.2M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  38.4M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 546k, False: 18.6M]
  |  |  ------------------
  |  |  501|  19.2M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  18.6M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  37.3M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 2.68M, False: 15.9M]
  |  |  |  Branch (501:37): [True: 1.51M, False: 1.17M]
  |  |  ------------------
  ------------------
  520|       |
  521|       |        /* Exchange v with the smallest son */
  522|  17.1M|        s->heap[k] = s->heap[j];  k = j;
  523|       |
  524|       |        /* And continue down the tree, setting j to the left son of k */
  525|  17.1M|        j <<= 1;
  526|  17.1M|    }
  527|  5.88M|    s->heap[k] = v;
  528|  5.88M|}
trees.c:gen_bitlen:
  540|  89.5k|local void gen_bitlen(deflate_state *s, tree_desc *desc) {
  541|  89.5k|    ct_data *tree        = desc->dyn_tree;
  542|  89.5k|    int max_code         = desc->max_code;
  543|  89.5k|    const ct_data *stree = desc->stat_desc->static_tree;
  544|  89.5k|    const intf *extra    = desc->stat_desc->extra_bits;
  545|  89.5k|    int base             = desc->stat_desc->extra_base;
  546|  89.5k|    int max_length       = desc->stat_desc->max_length;
  547|  89.5k|    int h;              /* heap index */
  548|  89.5k|    int n, m;           /* iterate over the tree elements */
  549|  89.5k|    int bits;           /* bit length */
  550|  89.5k|    int xbits;          /* extra bits */
  551|  89.5k|    ush f;              /* frequency */
  552|  89.5k|    int overflow = 0;   /* number of elements with bit length too large */
  553|       |
  554|  1.52M|    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
  ------------------
  |  |   52|  1.52M|#define MAX_BITS 15
  ------------------
  |  Branch (554:20): [True: 1.43M, False: 89.5k]
  ------------------
  555|       |
  556|       |    /* In a first pass, compute the optimal bit lengths (which may
  557|       |     * overflow in the case of the bit length tree).
  558|       |     */
  559|  89.5k|    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
  ------------------
  |  |   86|  89.5k|#define Len  dl.len
  ------------------
  560|       |
  561|  4.77M|    for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
  ------------------
  |  |   49|  4.77M|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  4.77M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  4.77M|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  4.77M|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (561:31): [True: 4.68M, False: 89.5k]
  ------------------
  562|  4.68M|        n = s->heap[h];
  563|  4.68M|        bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   85|  4.68M|#define Dad  dl.dad
  ------------------
                      bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   86|  4.68M|#define Len  dl.len
  ------------------
  564|  4.68M|        if (bits > max_length) bits = max_length, overflow++;
  ------------------
  |  Branch (564:13): [True: 6.63k, False: 4.67M]
  ------------------
  565|  4.68M|        tree[n].Len = (ush)bits;
  ------------------
  |  |   86|  4.68M|#define Len  dl.len
  ------------------
  566|       |        /* We overwrite tree[n].Dad which is no longer needed */
  567|       |
  568|  4.68M|        if (n > max_code) continue; /* not a leaf node */
  ------------------
  |  Branch (568:13): [True: 2.25M, False: 2.43M]
  ------------------
  569|       |
  570|  2.43M|        s->bl_count[bits]++;
  571|  2.43M|        xbits = 0;
  572|  2.43M|        if (n >= base) xbits = extra[n - base];
  ------------------
  |  Branch (572:13): [True: 400k, False: 2.03M]
  ------------------
  573|  2.43M|        f = tree[n].Freq;
  ------------------
  |  |   83|  2.43M|#define Freq fc.freq
  ------------------
  574|  2.43M|        s->opt_len += (ulg)f * (unsigned)(bits + xbits);
  575|  2.43M|        if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
  ------------------
  |  |   86|  2.19M|#define Len  dl.len
  ------------------
  |  Branch (575:13): [True: 2.19M, False: 237k]
  ------------------
  576|  2.43M|    }
  577|  89.5k|    if (overflow == 0) return;
  ------------------
  |  Branch (577:9): [True: 87.2k, False: 2.28k]
  ------------------
  578|       |
  579|  2.28k|    Tracev((stderr,"\nbit length overflow\n"));
  580|       |    /* This happens for example on obj2 and pic of the Calgary corpus */
  581|       |
  582|       |    /* Find the first bit length which could increase: */
  583|  3.31k|    do {
  584|  3.31k|        bits = max_length - 1;
  585|  4.82k|        while (s->bl_count[bits] == 0) bits--;
  ------------------
  |  Branch (585:16): [True: 1.50k, False: 3.31k]
  ------------------
  586|  3.31k|        s->bl_count[bits]--;        /* move one leaf down the tree */
  587|  3.31k|        s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
  588|  3.31k|        s->bl_count[max_length]--;
  589|       |        /* The brother of the overflow item also moves one step up,
  590|       |         * but this does not affect bl_count[max_length]
  591|       |         */
  592|  3.31k|        overflow -= 2;
  593|  3.31k|    } while (overflow > 0);
  ------------------
  |  Branch (593:14): [True: 1.03k, False: 2.28k]
  ------------------
  594|       |
  595|       |    /* Now recompute all bit lengths, scanning in increasing frequency.
  596|       |     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
  597|       |     * lengths instead of fixing only the wrong ones. This idea is taken
  598|       |     * from 'ar' written by Haruhiko Okumura.)
  599|       |     */
  600|  18.3k|    for (bits = max_length; bits != 0; bits--) {
  ------------------
  |  Branch (600:29): [True: 16.0k, False: 2.28k]
  ------------------
  601|  16.0k|        n = s->bl_count[bits];
  602|  60.4k|        while (n != 0) {
  ------------------
  |  Branch (602:16): [True: 44.4k, False: 16.0k]
  ------------------
  603|  44.4k|            m = s->heap[--h];
  604|  44.4k|            if (m > max_code) continue;
  ------------------
  |  Branch (604:17): [True: 18.5k, False: 25.8k]
  ------------------
  605|  25.8k|            if ((unsigned) tree[m].Len != (unsigned) bits) {
  ------------------
  |  |   86|  25.8k|#define Len  dl.len
  ------------------
  |  Branch (605:17): [True: 3.55k, False: 22.3k]
  ------------------
  606|  3.55k|                Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
  607|  3.55k|                s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   86|  3.55k|#define Len  dl.len
  ------------------
                              s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   83|  3.55k|#define Freq fc.freq
  ------------------
  608|  3.55k|                tree[m].Len = (ush)bits;
  ------------------
  |  |   86|  3.55k|#define Len  dl.len
  ------------------
  609|  3.55k|            }
  610|  25.8k|            n--;
  611|  25.8k|        }
  612|  16.0k|    }
  613|  2.28k|}
trees.c:gen_codes:
  203|  89.5k|local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) {
  204|  89.5k|    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
  205|  89.5k|    unsigned code = 0;         /* running code value */
  206|  89.5k|    int bits;                  /* bit index */
  207|  89.5k|    int n;                     /* code index */
  208|       |
  209|       |    /* The distribution counts are first used to generate the code values
  210|       |     * without bit reversal.
  211|       |     */
  212|  1.43M|    for (bits = 1; bits <= MAX_BITS; bits++) {
  ------------------
  |  |   52|  1.43M|#define MAX_BITS 15
  ------------------
  |  Branch (212:20): [True: 1.34M, False: 89.5k]
  ------------------
  213|  1.34M|        code = (code + bl_count[bits - 1]) << 1;
  214|  1.34M|        next_code[bits] = (ush)code;
  215|  1.34M|    }
  216|       |    /* Check that the bit counts in bl_count are consistent. The last code
  217|       |     * must be all ones.
  218|       |     */
  219|  89.5k|    Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
  220|  89.5k|            "inconsistent bit counts");
  221|  89.5k|    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
  222|       |
  223|  8.60M|    for (n = 0;  n <= max_code; n++) {
  ------------------
  |  Branch (223:18): [True: 8.51M, False: 89.5k]
  ------------------
  224|  8.51M|        int len = tree[n].Len;
  ------------------
  |  |   86|  8.51M|#define Len  dl.len
  ------------------
  225|  8.51M|        if (len == 0) continue;
  ------------------
  |  Branch (225:13): [True: 6.08M, False: 2.43M]
  ------------------
  226|       |        /* Now reverse the bits */
  227|  2.43M|        tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
  ------------------
  |  |   84|  2.43M|#define Code fc.code
  ------------------
  228|       |
  229|  2.43M|        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
  230|  2.43M|            n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1));
  231|  2.43M|    }
  232|  89.5k|}
trees.c:bi_reverse:
  154|  2.43M|local unsigned bi_reverse(unsigned code, int len) {
  155|  2.43M|    unsigned res = 0;
  156|  15.9M|    do {
  157|  15.9M|        res |= code & 1;
  158|  15.9M|        code >>= 1, res <<= 1;
  159|  15.9M|    } while (--len > 0);
  ------------------
  |  Branch (159:14): [True: 13.5M, False: 2.43M]
  ------------------
  160|  2.43M|    return res >> 1;
  161|  2.43M|}
trees.c:build_bl_tree:
  800|  29.8k|local int build_bl_tree(deflate_state *s) {
  801|  29.8k|    int max_blindex;  /* index of last bit length code of non zero freq */
  802|       |
  803|       |    /* Determine the bit length frequencies for literal and distance trees */
  804|  29.8k|    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
  805|  29.8k|    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
  806|       |
  807|       |    /* Build the bit length tree: */
  808|  29.8k|    build_tree(s, (tree_desc *)(&(s->bl_desc)));
  809|       |    /* opt_len now includes the length of the tree representations, except the
  810|       |     * lengths of the bit lengths codes and the 5 + 5 + 4 bits for the counts.
  811|       |     */
  812|       |
  813|       |    /* Determine the number of bit length codes to send. The pkzip format
  814|       |     * requires that at least 4 bit length codes be sent. (appnote.txt says
  815|       |     * 3 but the actual value used is 4.)
  816|       |     */
  817|  69.9k|    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
  ------------------
  |  |   46|  29.8k|#define BL_CODES  19
  ------------------
  |  Branch (817:36): [True: 69.9k, False: 0]
  ------------------
  818|  69.9k|        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
  ------------------
  |  |   86|  69.9k|#define Len  dl.len
  ------------------
  |  Branch (818:13): [True: 29.8k, False: 40.0k]
  ------------------
  819|  69.9k|    }
  820|       |    /* Update opt_len to include the bit length tree and counts */
  821|  29.8k|    s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
  822|  29.8k|    Tracev((stderr, "\ndyn trees: dyn %lu, stat %lu",
  823|  29.8k|            s->opt_len, s->static_len));
  824|       |
  825|  29.8k|    return max_blindex;
  826|  29.8k|}
trees.c:scan_tree:
  712|  59.7k|local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
  713|  59.7k|    int n;                     /* iterates over all tree elements */
  714|  59.7k|    int prevlen = -1;          /* last emitted length */
  715|  59.7k|    int curlen;                /* length of current code */
  716|  59.7k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  59.7k|#define Len  dl.len
  ------------------
  717|  59.7k|    int count = 0;             /* repeat count of the current code */
  718|  59.7k|    int max_count = 7;         /* max repeat count */
  719|  59.7k|    int min_count = 4;         /* min repeat count */
  720|       |
  721|  59.7k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (721:9): [True: 9.58k, False: 50.1k]
  ------------------
  722|  59.7k|    tree[max_code + 1].Len = (ush)0xffff; /* guard */
  ------------------
  |  |   86|  59.7k|#define Len  dl.len
  ------------------
  723|       |
  724|  8.01M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (724:17): [True: 7.95M, False: 59.7k]
  ------------------
  725|  7.95M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  7.95M|#define Len  dl.len
  ------------------
  726|  7.95M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (726:13): [True: 7.94M, False: 13.5k]
  |  Branch (726:36): [True: 5.35M, False: 2.58M]
  ------------------
  727|  5.35M|            continue;
  728|  5.35M|        } else if (count < min_count) {
  ------------------
  |  Branch (728:20): [True: 2.10M, False: 487k]
  ------------------
  729|  2.10M|            s->bl_tree[curlen].Freq += (ush)count;
  ------------------
  |  |   83|  2.10M|#define Freq fc.freq
  ------------------
  730|  2.10M|        } else if (curlen != 0) {
  ------------------
  |  Branch (730:20): [True: 47.3k, False: 440k]
  ------------------
  731|  47.3k|            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
  ------------------
  |  |   83|  43.2k|#define Freq fc.freq
  ------------------
  |  Branch (731:17): [True: 43.2k, False: 4.08k]
  ------------------
  732|  47.3k|            s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   53|  47.3k|#define REP_3_6      16
  ------------------
                          s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   83|  47.3k|#define Freq fc.freq
  ------------------
  733|   440k|        } else if (count <= 10) {
  ------------------
  |  Branch (733:20): [True: 336k, False: 103k]
  ------------------
  734|   336k|            s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   56|   336k|#define REPZ_3_10    17
  ------------------
                          s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   83|   336k|#define Freq fc.freq
  ------------------
  735|   336k|        } else {
  736|   103k|            s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   59|   103k|#define REPZ_11_138  18
  ------------------
                          s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   83|   103k|#define Freq fc.freq
  ------------------
  737|   103k|        }
  738|  2.59M|        count = 0; prevlen = curlen;
  739|  2.59M|        if (nextlen == 0) {
  ------------------
  |  Branch (739:13): [True: 951k, False: 1.64M]
  ------------------
  740|   951k|            max_count = 138, min_count = 3;
  741|  1.64M|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (741:20): [True: 6.46k, False: 1.63M]
  ------------------
  742|  6.46k|            max_count = 6, min_count = 3;
  743|  1.63M|        } else {
  744|  1.63M|            max_count = 7, min_count = 4;
  745|  1.63M|        }
  746|  2.59M|    }
  747|  59.7k|}
trees.c:compress_block:
  901|  22.9k|                          const ct_data *dtree) {
  902|  22.9k|    unsigned dist;      /* distance of matched string */
  903|  22.9k|    int lc;             /* match length or unmatched char (if dist == 0) */
  904|  22.9k|    unsigned sx = 0;    /* running index in symbol buffers */
  905|  22.9k|    unsigned code;      /* the code to send */
  906|  22.9k|    int extra;          /* number of extra bits to send */
  907|       |
  908|  10.1M|    if (s->sym_next != 0) do {
  ------------------
  |  Branch (908:9): [True: 22.6k, False: 324]
  ------------------
  909|       |#ifdef LIT_MEM
  910|       |        dist = s->d_buf[sx];
  911|       |        lc = s->l_buf[sx++];
  912|       |#else
  913|  10.1M|        dist = s->sym_buf[sx++] & 0xff;
  914|  10.1M|        dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
  915|  10.1M|        lc = s->sym_buf[sx++];
  916|  10.1M|#endif
  917|  10.1M|        if (dist == 0) {
  ------------------
  |  Branch (917:13): [True: 9.73M, False: 404k]
  ------------------
  918|  9.73M|            send_code(s, lc, ltree); /* send a literal byte */
  ------------------
  |  |  239|  9.73M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  9.73M|#define send_bits(s, value, length) \
  |  |  |  |  275|  9.73M|{ int len = length;\
  |  |  |  |  276|  9.73M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  9.73M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 3.40M, False: 6.33M]
  |  |  |  |  ------------------
  |  |  |  |  277|  3.40M|    int val = (int)value;\
  |  |  |  |  278|  3.40M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  3.40M|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  3.40M|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  3.40M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  3.40M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  3.40M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  3.40M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  3.40M|}
  |  |  |  |  ------------------
  |  |  |  |  280|  3.40M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.40M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  3.40M|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.40M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  6.33M|  } else {\
  |  |  |  |  283|  6.33M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  6.33M|    s->bi_valid += len;\
  |  |  |  |  285|  6.33M|  }\
  |  |  |  |  286|  9.73M|}
  |  |  ------------------
  ------------------
  919|  9.73M|            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
  920|  9.73M|        } else {
  921|       |            /* Here, lc is the match length - MIN_MATCH */
  922|   404k|            code = _length_code[lc];
  923|   404k|            send_code(s, code + LITERALS + 1, ltree);   /* send length code */
  ------------------
  |  |  239|   404k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   404k|#define send_bits(s, value, length) \
  |  |  |  |  275|   404k|{ int len = length;\
  |  |  |  |  276|   404k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   404k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 146k, False: 258k]
  |  |  |  |  ------------------
  |  |  |  |  277|   146k|    int val = (int)value;\
  |  |  |  |  278|   146k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   146k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   146k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   146k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   146k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   146k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   146k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   146k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   146k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   146k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   146k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   146k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|   258k|  } else {\
  |  |  |  |  283|   258k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|   258k|    s->bi_valid += len;\
  |  |  |  |  285|   258k|  }\
  |  |  |  |  286|   404k|}
  |  |  ------------------
  ------------------
  924|   404k|            extra = extra_lbits[code];
  925|   404k|            if (extra != 0) {
  ------------------
  |  Branch (925:17): [True: 86.2k, False: 318k]
  ------------------
  926|  86.2k|                lc -= base_length[code];
  927|  86.2k|                send_bits(s, lc, extra);       /* send the extra length bits */
  ------------------
  |  |  274|  86.2k|#define send_bits(s, value, length) \
  |  |  275|  86.2k|{ int len = length;\
  |  |  276|  86.2k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  86.2k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 12.2k, False: 73.9k]
  |  |  ------------------
  |  |  277|  12.2k|    int val = (int)value;\
  |  |  278|  12.2k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  12.2k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  12.2k|#define put_short(s, w) { \
  |  |  |  |  145|  12.2k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  12.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  12.2k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  12.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  12.2k|}
  |  |  ------------------
  |  |  280|  12.2k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  12.2k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  12.2k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  12.2k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  73.9k|  } else {\
  |  |  283|  73.9k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  73.9k|    s->bi_valid += len;\
  |  |  285|  73.9k|  }\
  |  |  286|  86.2k|}
  ------------------
  928|  86.2k|            }
  929|   404k|            dist--; /* dist is now the match distance - 1 */
  930|   404k|            code = d_code(dist);
  ------------------
  |  |  321|   404k|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  ------------------
  |  |  |  Branch (321:5): [True: 288k, False: 115k]
  |  |  ------------------
  ------------------
  931|   404k|            Assert (code < D_CODES, "bad d_code");
  932|       |
  933|   404k|            send_code(s, code, dtree);       /* send the distance code */
  ------------------
  |  |  239|   404k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   404k|#define send_bits(s, value, length) \
  |  |  |  |  275|   404k|{ int len = length;\
  |  |  |  |  276|   404k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   404k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 94.5k, False: 309k]
  |  |  |  |  ------------------
  |  |  |  |  277|  94.5k|    int val = (int)value;\
  |  |  |  |  278|  94.5k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  94.5k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  94.5k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  94.5k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  94.5k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  94.5k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  94.5k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  94.5k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  94.5k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  94.5k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  94.5k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  94.5k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|   309k|  } else {\
  |  |  |  |  283|   309k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|   309k|    s->bi_valid += len;\
  |  |  |  |  285|   309k|  }\
  |  |  |  |  286|   404k|}
  |  |  ------------------
  ------------------
  934|   404k|            extra = extra_dbits[code];
  935|   404k|            if (extra != 0) {
  ------------------
  |  Branch (935:17): [True: 297k, False: 106k]
  ------------------
  936|   297k|                dist -= (unsigned)base_dist[code];
  937|   297k|                send_bits(s, (int)dist, extra); /* send the extra bits */
  ------------------
  |  |  274|   297k|#define send_bits(s, value, length) \
  |  |  275|   297k|{ int len = length;\
  |  |  276|   297k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   297k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 115k, False: 181k]
  |  |  ------------------
  |  |  277|   115k|    int val = (int)value;\
  |  |  278|   115k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|   115k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|   115k|#define put_short(s, w) { \
  |  |  |  |  145|   115k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|   115k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|   115k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|   115k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|   115k|}
  |  |  ------------------
  |  |  280|   115k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|   115k|#define Buf_size 16
  |  |  ------------------
  |  |  281|   115k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|   115k|#define Buf_size 16
  |  |  ------------------
  |  |  282|   181k|  } else {\
  |  |  283|   181k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   181k|    s->bi_valid += len;\
  |  |  285|   181k|  }\
  |  |  286|   297k|}
  ------------------
  938|   297k|            }
  939|   404k|        } /* literal or match pair ? */
  940|       |
  941|       |        /* Check for no overlay of pending_buf on needed symbols */
  942|       |#ifdef LIT_MEM
  943|       |        Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow");
  944|       |#else
  945|  10.1M|        Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
  946|  10.1M|#endif
  947|       |
  948|  10.1M|    } while (sx < s->sym_next);
  ------------------
  |  Branch (948:14): [True: 10.1M, False: 22.6k]
  ------------------
  949|       |
  950|  22.9k|    send_code(s, END_BLOCK, ltree);
  ------------------
  |  |  239|  22.9k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  22.9k|#define send_bits(s, value, length) \
  |  |  |  |  275|  22.9k|{ int len = length;\
  |  |  |  |  276|  22.9k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  22.9k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 9.20k, False: 13.7k]
  |  |  |  |  ------------------
  |  |  |  |  277|  9.20k|    int val = (int)value;\
  |  |  |  |  278|  9.20k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  9.20k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  9.20k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  9.20k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  9.20k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  9.20k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  9.20k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  9.20k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  9.20k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  9.20k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  9.20k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  9.20k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  13.7k|  } else {\
  |  |  |  |  283|  13.7k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  13.7k|    s->bi_valid += len;\
  |  |  |  |  285|  13.7k|  }\
  |  |  |  |  286|  22.9k|}
  |  |  ------------------
  ------------------
  951|  22.9k|}
trees.c:send_all_trees:
  834|  14.3k|                          int blcodes) {
  835|  14.3k|    int rank;                    /* index in bl_order */
  836|       |
  837|  14.3k|    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  838|  14.3k|    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  839|  14.3k|            "too many codes");
  840|  14.3k|    Tracev((stderr, "\nbl counts: "));
  841|  14.3k|    send_bits(s, lcodes - 257, 5);  /* not +255 as stated in appnote.txt */
  ------------------
  |  |  274|  14.3k|#define send_bits(s, value, length) \
  |  |  275|  14.3k|{ int len = length;\
  |  |  276|  14.3k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  14.3k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 14.3k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  14.3k|  } else {\
  |  |  283|  14.3k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  14.3k|    s->bi_valid += len;\
  |  |  285|  14.3k|  }\
  |  |  286|  14.3k|}
  ------------------
  842|  14.3k|    send_bits(s, dcodes - 1,   5);
  ------------------
  |  |  274|  14.3k|#define send_bits(s, value, length) \
  |  |  275|  14.3k|{ int len = length;\
  |  |  276|  14.3k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  14.3k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 5.81k, False: 8.54k]
  |  |  ------------------
  |  |  277|  5.81k|    int val = (int)value;\
  |  |  278|  5.81k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  5.81k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  5.81k|#define put_short(s, w) { \
  |  |  |  |  145|  5.81k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  5.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  5.81k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  5.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  5.81k|}
  |  |  ------------------
  |  |  280|  5.81k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  5.81k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  5.81k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  5.81k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  8.54k|  } else {\
  |  |  283|  8.54k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  8.54k|    s->bi_valid += len;\
  |  |  285|  8.54k|  }\
  |  |  286|  14.3k|}
  ------------------
  843|  14.3k|    send_bits(s, blcodes - 4,  4);  /* not -3 as stated in appnote.txt */
  ------------------
  |  |  274|  14.3k|#define send_bits(s, value, length) \
  |  |  275|  14.3k|{ int len = length;\
  |  |  276|  14.3k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  14.3k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 8.54k, False: 5.81k]
  |  |  ------------------
  |  |  277|  8.54k|    int val = (int)value;\
  |  |  278|  8.54k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  8.54k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  8.54k|#define put_short(s, w) { \
  |  |  |  |  145|  8.54k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  8.54k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  8.54k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  8.54k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  8.54k|}
  |  |  ------------------
  |  |  280|  8.54k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  8.54k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  8.54k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  8.54k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  8.54k|  } else {\
  |  |  283|  5.81k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  5.81k|    s->bi_valid += len;\
  |  |  285|  5.81k|  }\
  |  |  286|  14.3k|}
  ------------------
  844|   270k|    for (rank = 0; rank < blcodes; rank++) {
  ------------------
  |  Branch (844:20): [True: 255k, False: 14.3k]
  ------------------
  845|   255k|        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
  846|   255k|        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
  ------------------
  |  |  274|   255k|#define send_bits(s, value, length) \
  |  |  275|   255k|{ int len = length;\
  |  |  276|   255k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   255k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 42.8k, False: 213k]
  |  |  ------------------
  |  |  277|  42.8k|    int val = (int)value;\
  |  |  278|  42.8k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  42.8k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  42.8k|#define put_short(s, w) { \
  |  |  |  |  145|  42.8k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  42.8k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  42.8k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  42.8k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  42.8k|}
  |  |  ------------------
  |  |  280|  42.8k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  42.8k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  42.8k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  42.8k|#define Buf_size 16
  |  |  ------------------
  |  |  282|   213k|  } else {\
  |  |  283|   213k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   213k|    s->bi_valid += len;\
  |  |  285|   213k|  }\
  |  |  286|   255k|}
  ------------------
  847|   255k|    }
  848|  14.3k|    Tracev((stderr, "\nbl tree: sent %lu", s->bits_sent));
  849|       |
  850|  14.3k|    send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
  851|  14.3k|    Tracev((stderr, "\nlit tree: sent %lu", s->bits_sent));
  852|       |
  853|  14.3k|    send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
  854|  14.3k|    Tracev((stderr, "\ndist tree: sent %lu", s->bits_sent));
  855|  14.3k|}
trees.c:send_tree:
  753|  28.7k|local void send_tree(deflate_state *s, ct_data *tree, int max_code) {
  754|  28.7k|    int n;                     /* iterates over all tree elements */
  755|  28.7k|    int prevlen = -1;          /* last emitted length */
  756|  28.7k|    int curlen;                /* length of current code */
  757|  28.7k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  28.7k|#define Len  dl.len
  ------------------
  758|  28.7k|    int count = 0;             /* repeat count of the current code */
  759|  28.7k|    int max_count = 7;         /* max repeat count */
  760|  28.7k|    int min_count = 4;         /* min repeat count */
  761|       |
  762|       |    /* tree[max_code + 1].Len = -1; */  /* guard already set */
  763|  28.7k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (763:9): [True: 4.16k, False: 24.5k]
  ------------------
  764|       |
  765|  3.82M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (765:17): [True: 3.80M, False: 28.7k]
  ------------------
  766|  3.80M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  3.80M|#define Len  dl.len
  ------------------
  767|  3.80M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (767:13): [True: 3.79M, False: 8.34k]
  |  Branch (767:36): [True: 2.96M, False: 831k]
  ------------------
  768|  2.96M|            continue;
  769|  2.96M|        } else if (count < min_count) {
  ------------------
  |  Branch (769:20): [True: 647k, False: 193k]
  ------------------
  770|   798k|            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
  ------------------
  |  |  239|   798k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   798k|#define send_bits(s, value, length) \
  |  |  |  |  275|   798k|{ int len = length;\
  |  |  |  |  276|   798k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   798k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 130k, False: 668k]
  |  |  |  |  ------------------
  |  |  |  |  277|   130k|    int val = (int)value;\
  |  |  |  |  278|   130k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   130k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   130k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   130k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   130k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   130k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   130k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   130k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   130k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   130k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   130k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   130k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|   668k|  } else {\
  |  |  |  |  283|   668k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|   668k|    s->bi_valid += len;\
  |  |  |  |  285|   668k|  }\
  |  |  |  |  286|   798k|}
  |  |  ------------------
  ------------------
  |  Branch (770:61): [True: 151k, False: 647k]
  ------------------
  771|       |
  772|   647k|        } else if (curlen != 0) {
  ------------------
  |  Branch (772:20): [True: 21.4k, False: 171k]
  ------------------
  773|  21.4k|            if (curlen != prevlen) {
  ------------------
  |  Branch (773:17): [True: 19.0k, False: 2.40k]
  ------------------
  774|  19.0k|                send_code(s, curlen, s->bl_tree); count--;
  ------------------
  |  |  239|  19.0k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  19.0k|#define send_bits(s, value, length) \
  |  |  |  |  275|  19.0k|{ int len = length;\
  |  |  |  |  276|  19.0k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  19.0k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 2.30k, False: 16.7k]
  |  |  |  |  ------------------
  |  |  |  |  277|  2.30k|    int val = (int)value;\
  |  |  |  |  278|  2.30k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  2.30k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  2.30k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  2.30k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  2.30k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.30k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  2.30k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.30k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  2.30k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.30k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  2.30k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.30k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  16.7k|  } else {\
  |  |  |  |  283|  16.7k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  16.7k|    s->bi_valid += len;\
  |  |  |  |  285|  16.7k|  }\
  |  |  |  |  286|  19.0k|}
  |  |  ------------------
  ------------------
  775|  19.0k|            }
  776|  21.4k|            Assert(count >= 3 && count <= 6, " 3_6?");
  777|  21.4k|            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  239|  21.4k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  21.4k|#define send_bits(s, value, length) \
  |  |  |  |  275|  21.4k|{ int len = length;\
  |  |  |  |  276|  21.4k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  21.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 5.12k, False: 16.3k]
  |  |  |  |  ------------------
  |  |  |  |  277|  5.12k|    int val = (int)value;\
  |  |  |  |  278|  5.12k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  5.12k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  5.12k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  5.12k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  5.12k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  5.12k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  5.12k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  5.12k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  5.12k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.12k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  5.12k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.12k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  16.3k|  } else {\
  |  |  |  |  283|  16.3k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  16.3k|    s->bi_valid += len;\
  |  |  |  |  285|  16.3k|  }\
  |  |  |  |  286|  21.4k|}
  |  |  ------------------
  ------------------
                          send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  274|  21.4k|#define send_bits(s, value, length) \
  |  |  275|  21.4k|{ int len = length;\
  |  |  276|  21.4k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  21.4k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 2.77k, False: 18.6k]
  |  |  ------------------
  |  |  277|  2.77k|    int val = (int)value;\
  |  |  278|  2.77k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  2.77k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.77k|#define put_short(s, w) { \
  |  |  |  |  145|  2.77k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.77k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.77k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.77k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.77k|}
  |  |  ------------------
  |  |  280|  2.77k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.77k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  2.77k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.77k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  18.6k|  } else {\
  |  |  283|  18.6k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  18.6k|    s->bi_valid += len;\
  |  |  285|  18.6k|  }\
  |  |  286|  21.4k|}
  ------------------
  778|       |
  779|   171k|        } else if (count <= 10) {
  ------------------
  |  Branch (779:20): [True: 105k, False: 66.4k]
  ------------------
  780|   105k|            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  239|   105k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   105k|#define send_bits(s, value, length) \
  |  |  |  |  275|   105k|{ int len = length;\
  |  |  |  |  276|   105k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   105k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 19.2k, False: 85.7k]
  |  |  |  |  ------------------
  |  |  |  |  277|  19.2k|    int val = (int)value;\
  |  |  |  |  278|  19.2k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  19.2k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  19.2k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  19.2k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  19.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  19.2k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  19.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  19.2k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  19.2k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  19.2k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  19.2k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  19.2k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  85.7k|  } else {\
  |  |  |  |  283|  85.7k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  85.7k|    s->bi_valid += len;\
  |  |  |  |  285|  85.7k|  }\
  |  |  |  |  286|   105k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  274|   105k|#define send_bits(s, value, length) \
  |  |  275|   105k|{ int len = length;\
  |  |  276|   105k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   105k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 20.0k, False: 84.9k]
  |  |  ------------------
  |  |  277|  20.0k|    int val = (int)value;\
  |  |  278|  20.0k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  20.0k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  20.0k|#define put_short(s, w) { \
  |  |  |  |  145|  20.0k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  20.0k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  20.0k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  20.0k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  20.0k|}
  |  |  ------------------
  |  |  280|  20.0k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  20.0k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  20.0k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  20.0k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  84.9k|  } else {\
  |  |  283|  84.9k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  84.9k|    s->bi_valid += len;\
  |  |  285|  84.9k|  }\
  |  |  286|   105k|}
  ------------------
  781|       |
  782|   105k|        } else {
  783|  66.4k|            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  239|  66.4k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  66.4k|#define send_bits(s, value, length) \
  |  |  |  |  275|  66.4k|{ int len = length;\
  |  |  |  |  276|  66.4k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  66.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 12.0k, False: 54.4k]
  |  |  |  |  ------------------
  |  |  |  |  277|  12.0k|    int val = (int)value;\
  |  |  |  |  278|  12.0k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  12.0k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  12.0k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  12.0k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  12.0k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  12.0k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  12.0k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  12.0k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  12.0k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  12.0k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  12.0k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  12.0k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  54.4k|  } else {\
  |  |  |  |  283|  54.4k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  54.4k|    s->bi_valid += len;\
  |  |  |  |  285|  54.4k|  }\
  |  |  |  |  286|  66.4k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  274|  66.4k|#define send_bits(s, value, length) \
  |  |  275|  66.4k|{ int len = length;\
  |  |  276|  66.4k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  66.4k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 28.9k, False: 37.5k]
  |  |  ------------------
  |  |  277|  28.9k|    int val = (int)value;\
  |  |  278|  28.9k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  28.9k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  28.9k|#define put_short(s, w) { \
  |  |  |  |  145|  28.9k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  28.9k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  28.9k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  28.9k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  28.9k|}
  |  |  ------------------
  |  |  280|  28.9k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  28.9k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  28.9k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  28.9k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  37.5k|  } else {\
  |  |  283|  37.5k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  37.5k|    s->bi_valid += len;\
  |  |  285|  37.5k|  }\
  |  |  286|  66.4k|}
  ------------------
  784|  66.4k|        }
  785|   840k|        count = 0; prevlen = curlen;
  786|   840k|        if (nextlen == 0) {
  ------------------
  |  Branch (786:13): [True: 285k, False: 554k]
  ------------------
  787|   285k|            max_count = 138, min_count = 3;
  788|   554k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (788:20): [True: 3.71k, False: 550k]
  ------------------
  789|  3.71k|            max_count = 6, min_count = 3;
  790|   550k|        } else {
  791|   550k|            max_count = 7, min_count = 4;
  792|   550k|        }
  793|   840k|    }
  794|  28.7k|}

zcalloc:
  299|  28.9k|voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
  300|  28.9k|    (void)opaque;
  301|  28.9k|    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
  ------------------
  |  Branch (301:12): [True: 28.9k, Folded]
  ------------------
  302|  28.9k|                              (voidpf)calloc(items, size);
  303|  28.9k|}
zcfree:
  305|  28.9k|void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
  306|  28.9k|    (void)opaque;
  307|  28.9k|    free(ptr);
  308|  28.9k|}

