gz_compress:
  279|  4.22k|{
  280|  4.22k|    char buf[BUFLEN];
  281|  4.22k|    int len;
  282|  4.22k|    int err;
  283|       |
  284|       |#ifdef USE_MMAP
  285|       |    /* Try first compressing with mmap. If mmap fails (minigzip used in a
  286|       |     * pipe), use the normal fread loop.
  287|       |     */
  288|       |    if (gz_compress_mmap(in, out) == Z_OK) return;
  289|       |#endif
  290|       |    /* Clear out the contents of buf before reading from the file to avoid
  291|       |       MemorySanitizer: use-of-uninitialized-value warnings. */
  292|  4.22k|    memset(buf, 0, sizeof(buf));
  293|  23.0k|    for (;;) {
  294|  23.0k|        len = (int)fread(buf, 1, sizeof(buf), in);
  295|  23.0k|        if (ferror(in)) {
  ------------------
  |  Branch (295:13): [True: 0, False: 23.0k]
  ------------------
  296|      0|            perror("fread");
  297|      0|            return 0;
  298|      0|        }
  299|  23.0k|        if (len == 0) break;
  ------------------
  |  Branch (299:13): [True: 4.22k, False: 18.7k]
  ------------------
  300|       |
  301|  18.7k|        if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err));
  ------------------
  |  Branch (301:13): [True: 0, False: 18.7k]
  ------------------
  302|  18.7k|    }
  303|  4.22k|    fclose(in);
  304|  4.22k|    if (gzclose(out) != Z_OK) error("failed gzclose");
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  |  Branch (304:9): [True: 0, False: 4.22k]
  ------------------
  305|  4.22k|    return 0;
  306|  4.22k|}
gz_uncompress:
  347|  4.22k|{
  348|  4.22k|    char buf[BUFLENW];
  349|  4.22k|    int len;
  350|  4.22k|    int err;
  351|       |
  352|  12.7k|    for (;;) {
  353|  12.7k|        len = gzread(in, buf, sizeof(buf));
  354|  12.7k|        if (len < 0) error (gzerror(in, &err));
  ------------------
  |  Branch (354:13): [True: 0, False: 12.7k]
  ------------------
  355|  12.7k|        if (len == 0) break;
  ------------------
  |  Branch (355:13): [True: 4.22k, False: 8.54k]
  ------------------
  356|       |
  357|  8.54k|        if ((int)fwrite(buf, 1, (unsigned)len, out) != len) {
  ------------------
  |  Branch (357:13): [True: 0, False: 8.54k]
  ------------------
  358|      0|            error("failed fwrite");
  359|      0|        }
  360|  8.54k|    }
  361|  4.22k|    if (fclose(out)) error("failed fclose");
  ------------------
  |  Branch (361:9): [True: 0, False: 4.22k]
  ------------------
  362|       |
  363|  4.22k|    if (gzclose(in) != Z_OK) error("failed gzclose");
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  |  Branch (363:9): [True: 0, False: 4.22k]
  ------------------
  364|  4.22k|}
file_compress:
  372|  4.22k|{
  373|  4.22k|    char outfile[MAX_NAME_LEN];
  374|  4.22k|    FILE  *in;
  375|  4.22k|    gzFile out;
  376|       |
  377|  4.22k|    if (strlen(file) + strlen(GZ_SUFFIX) >= sizeof(outfile)) {
  ------------------
  |  |   53|  4.22k|#  define GZ_SUFFIX ".gz"
  ------------------
  |  Branch (377:9): [True: 0, False: 4.22k]
  ------------------
  378|      0|        fprintf(stderr, "%s: filename too long\n", prog);
  379|      0|        return 0;
  380|      0|    }
  381|       |
  382|  4.22k|    snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX);
  ------------------
  |  |   53|  4.22k|#  define GZ_SUFFIX ".gz"
  ------------------
  383|       |
  384|  4.22k|    in = fopen(file, "rb");
  385|  4.22k|    if (in == NULL) {
  ------------------
  |  Branch (385:9): [True: 0, False: 4.22k]
  ------------------
  386|      0|        perror(file);
  387|      0|        return 0;
  388|      0|    }
  389|  4.22k|    out = gzopen(outfile, mode);
  390|  4.22k|    if (out == NULL) {
  ------------------
  |  Branch (390:9): [True: 0, False: 4.22k]
  ------------------
  391|      0|        fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
  392|      0|        return 0;
  393|      0|    }
  394|  4.22k|    gz_compress(in, out);
  395|       |
  396|  4.22k|    unlink(file);
  397|  4.22k|    return 0;
  398|  4.22k|}
file_uncompress:
  405|  4.22k|{
  406|  4.22k|    char buf[MAX_NAME_LEN];
  407|  4.22k|    char *infile, *outfile;
  408|  4.22k|    FILE  *out;
  409|  4.22k|    gzFile in;
  410|  4.22k|    size_t len = strlen(file);
  411|       |
  412|  4.22k|    if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {
  ------------------
  |  |   53|  4.22k|#  define GZ_SUFFIX ".gz"
  ------------------
  |  Branch (412:9): [True: 0, False: 4.22k]
  ------------------
  413|      0|        fprintf(stderr, "%s: filename too long\n", prog);
  414|      0|        return 0;
  415|      0|    }
  416|       |
  417|  4.22k|    snprintf(buf, sizeof(buf), "%s", file);
  418|       |
  419|  4.22k|    if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
  ------------------
  |  |   55|  8.45k|#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
  |  |  ------------------
  |  |  |  |   53|  4.22k|#  define GZ_SUFFIX ".gz"
  |  |  ------------------
  ------------------
                  if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
  ------------------
  |  |   55|  4.22k|#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
  |  |  ------------------
  |  |  |  |   53|  4.22k|#  define GZ_SUFFIX ".gz"
  |  |  ------------------
  ------------------
                  if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
  ------------------
  |  |   53|  4.22k|#  define GZ_SUFFIX ".gz"
  ------------------
  |  Branch (419:9): [True: 4.22k, False: 0]
  |  Branch (419:29): [True: 4.22k, False: 0]
  ------------------
  420|  4.22k|        infile = file;
  421|  4.22k|        outfile = buf;
  422|  4.22k|        outfile[len-3] = '\0';
  423|  4.22k|    } else {
  424|      0|        outfile = file;
  425|      0|        infile = buf;
  426|      0|        snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX);
  ------------------
  |  |   53|      0|#  define GZ_SUFFIX ".gz"
  ------------------
  427|      0|    }
  428|  4.22k|    in = gzopen(infile, "rb");
  429|  4.22k|    if (in == NULL) {
  ------------------
  |  Branch (429:9): [True: 0, False: 4.22k]
  ------------------
  430|      0|        fprintf(stderr, "%s: can't gzopen %s\n", prog, infile);
  431|      0|        return 0;
  432|      0|    }
  433|  4.22k|    out = fopen(outfile, "wb");
  434|  4.22k|    if (out == NULL) {
  ------------------
  |  Branch (434:9): [True: 0, False: 4.22k]
  ------------------
  435|      0|        perror(file);
  436|      0|        return 0;
  437|      0|    }
  438|       |
  439|  4.22k|    gz_uncompress(in, out);
  440|       |
  441|  4.22k|    unlink(infile);
  442|  4.22k|    return 0;
  443|  4.22k|}
LLVMFuzzerTestOneInput:
  445|  4.22k|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t dataLen) {
  446|  4.22k|  char *inFileName = "/tmp/minigzip_fuzzer.out";
  447|  4.22k|  char *outFileName = "/tmp/minigzip_fuzzer.out.gz";
  448|  4.22k|  char outmode[20];
  449|  4.22k|  FILE *in;
  450|  4.22k|  char buf[BUFLEN];
  451|  4.22k|  uint32_t offset = 0;
  452|       |
  453|       |  /* Discard inputs larger than 1Mb. */
  454|  4.22k|  static size_t kMaxSize = 1024 * 1024;
  455|  4.22k|  if (dataLen < 1 || dataLen > kMaxSize)
  ------------------
  |  Branch (455:7): [True: 0, False: 4.22k]
  |  Branch (455:22): [True: 0, False: 4.22k]
  ------------------
  456|      0|    return 0;
  457|       |
  458|  4.22k|  in = fopen(inFileName, "w");
  459|  4.22k|  if (fwrite(data, 1, (unsigned)dataLen, in) != dataLen)
  ------------------
  |  Branch (459:7): [True: 0, False: 4.22k]
  ------------------
  460|      0|    error("failed fwrite");
  461|  4.22k|  if (fclose(in))
  ------------------
  |  Branch (461:7): [True: 0, False: 4.22k]
  ------------------
  462|      0|    error("failed fclose");
  463|       |
  464|  4.22k|  memset(outmode, 0, sizeof(outmode));
  465|  4.22k|  snprintf(outmode, sizeof(outmode), "%s", "wb");
  466|       |
  467|       |  /* Compression level: [0..9]. */
  468|  4.22k|  outmode[2] = data[0] % 10;
  469|       |
  470|  4.22k|  switch (data[0] % 4) {
  471|      0|  default:
  ------------------
  |  Branch (471:3): [True: 0, False: 4.22k]
  ------------------
  472|  1.34k|  case 0:
  ------------------
  |  Branch (472:3): [True: 1.34k, False: 2.88k]
  ------------------
  473|  1.34k|    outmode[3] = 0;
  474|  1.34k|    break;
  475|    767|  case 1:
  ------------------
  |  Branch (475:3): [True: 767, False: 3.46k]
  ------------------
  476|       |    /* compress with Z_FILTERED */
  477|    767|    outmode[3] = 'f';
  478|    767|    break;
  479|  1.05k|  case 2:
  ------------------
  |  Branch (479:3): [True: 1.05k, False: 3.17k]
  ------------------
  480|       |    /* compress with Z_HUFFMAN_ONLY */
  481|  1.05k|    outmode[3] = 'h';
  482|  1.05k|    break;
  483|  1.06k|  case 3:
  ------------------
  |  Branch (483:3): [True: 1.06k, False: 3.16k]
  ------------------
  484|       |    /* compress with Z_RLE */
  485|  1.06k|    outmode[3] = 'R';
  486|  1.06k|    break;
  487|  4.22k|  }
  488|       |
  489|  4.22k|  file_compress(inFileName, outmode);
  490|  4.22k|  file_uncompress(outFileName);
  491|       |
  492|       |  /* Check that the uncompressed file matches the input data. */
  493|  4.22k|  in = fopen(inFileName, "rb");
  494|  4.22k|  if (in == NULL) {
  ------------------
  |  Branch (494:7): [True: 0, False: 4.22k]
  ------------------
  495|      0|    perror(inFileName);
  496|      0|    return 0;
  497|      0|  }
  498|       |
  499|  4.22k|  memset(buf, 0, sizeof(buf));
  500|  23.0k|  for (;;) {
  501|  23.0k|    int len = (int)fread(buf, 1, sizeof(buf), in);
  502|  23.0k|    if (ferror(in)) {
  ------------------
  |  Branch (502:9): [True: 0, False: 23.0k]
  ------------------
  503|      0|      perror("fread");
  504|      0|      return 0;
  505|      0|    }
  506|  23.0k|    if (len == 0)
  ------------------
  |  Branch (506:9): [True: 4.22k, False: 18.7k]
  ------------------
  507|  4.22k|      break;
  508|  23.0k|    assert(0 == memcmp(data + offset, buf, len));
  ------------------
  |  Branch (508:5): [True: 0, False: 18.7k]
  |  Branch (508:5): [True: 18.7k, False: 0]
  ------------------
  509|  18.7k|    offset += len;
  510|  18.7k|  }
  511|       |
  512|  4.22k|  if (fclose(in))
  ------------------
  |  Branch (512:7): [True: 0, False: 4.22k]
  ------------------
  513|      0|    error("failed fclose");
  514|       |
  515|       |  /* This function must return 0. */
  516|  4.22k|  return 0;
  517|  4.22k|}

crc32_z:
 1559|  69.2k|uLong ZEXPORT crc32_z(uLong crc, const unsigned char FAR *buf, z_size_t len) {
 1560|  69.2k|#endif
 1561|       |    /* Return initial CRC, if requested. */
 1562|  69.2k|    if (buf == Z_NULL) return 0;
  ------------------
  |  |  216|  69.2k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1562:9): [True: 16.9k, False: 52.3k]
  ------------------
 1563|       |
 1564|       |#ifdef DYNAMIC_CRC_TABLE
 1565|       |    z_once(&made, make_crc_table);
 1566|       |#endif /* DYNAMIC_CRC_TABLE */
 1567|       |
 1568|       |    /* Pre-condition the CRC */
 1569|  52.3k|    crc = (~crc) & 0xffffffff;
 1570|       |
 1571|  52.3k|#ifdef W
 1572|       |
 1573|       |    /* If provided enough bytes, do a braided CRC calculation. */
 1574|  52.3k|    if (len >= NMIN * W + W - 1) {
  ------------------
  |  |  171|  52.3k|#  define NMIN NLOW     /* the fewest braids used */
  |  |  ------------------
  |  |  |  |  160|  52.3k|#    define NLOW DEF_NLOW
  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  52.3k|#  define DEF_NLOW 2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (len >= NMIN * W + W - 1) {
  ------------------
  |  |  210|  52.3k|#    define W 4
  ------------------
                  if (len >= NMIN * W + W - 1) {
  ------------------
  |  |  210|  52.3k|#    define W 4
  ------------------
  |  Branch (1574:9): [True: 46.4k, False: 5.94k]
  ------------------
 1575|  46.4k|        z_size_t blks;
 1576|  46.4k|        z_word_t const *words;
 1577|  46.4k|        unsigned endian;
 1578|       |
 1579|  46.4k|#ifdef BRAID_CUT
 1580|       |        /* For shorter lengths, use NLOW braids. */
 1581|  46.4k|        if (len < BRAID_CUT || len < N * W + W - 1)
  ------------------
  |  |  159|  46.4k|#    define BRAID_CUT DEF_CUT
  |  |  ------------------
  |  |  |  |  129|  92.8k|#  define DEF_CUT 320
  |  |  ------------------
  ------------------
                      if (len < BRAID_CUT || len < N * W + W - 1)
  ------------------
  |  |  146|  41.2k|#  define N DEF_N
  |  |  ------------------
  |  |  |  |  128|  41.2k|#  define DEF_N 5
  |  |  ------------------
  ------------------
                      if (len < BRAID_CUT || len < N * W + W - 1)
  ------------------
  |  |  210|  41.2k|#    define W 4
  ------------------
                      if (len < BRAID_CUT || len < N * W + W - 1)
  ------------------
  |  |  210|  41.2k|#    define W 4
  ------------------
  |  Branch (1581:13): [True: 5.20k, False: 41.2k]
  |  Branch (1581:32): [True: 0, False: 41.2k]
  ------------------
 1582|  5.20k|            return crc32_braid(crc, buf, len) ^ 0xffffffff;
 1583|  41.2k|#endif
 1584|       |
 1585|       |        /* Compute the CRC up to a z_word_t boundary. */
 1586|  66.4k|        while (len && ((z_size_t)buf & (W - 1)) != 0) {
  ------------------
  |  |  210|  66.4k|#    define W 4
  ------------------
  |  Branch (1586:16): [True: 66.4k, False: 0]
  |  Branch (1586:23): [True: 25.1k, False: 41.2k]
  ------------------
 1587|  25.1k|            len--;
 1588|  25.1k|            crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1589|  25.1k|        }
 1590|       |
 1591|       |        /* Compute the CRC on as many N z_word_t blocks as are available. */
 1592|  41.2k|        blks = len / (N * W);
  ------------------
  |  |  146|  41.2k|#  define N DEF_N
  |  |  ------------------
  |  |  |  |  128|  41.2k|#  define DEF_N 5
  |  |  ------------------
  ------------------
                      blks = len / (N * W);
  ------------------
  |  |  210|  41.2k|#    define W 4
  ------------------
 1593|  41.2k|        len -= blks * N * W;
  ------------------
  |  |  146|  41.2k|#  define N DEF_N
  |  |  ------------------
  |  |  |  |  128|  41.2k|#  define DEF_N 5
  |  |  ------------------
  ------------------
                      len -= blks * N * W;
  ------------------
  |  |  210|  41.2k|#    define W 4
  ------------------
 1594|  41.2k|        words = (z_word_t const *)buf;
 1595|       |
 1596|       |        /* Do endian check at execution time instead of compile time, since ARM
 1597|       |           processors can change the endianness at execution time. If the
 1598|       |           compiler knows what the endianness will be, it can optimize out the
 1599|       |           check and the unused branch. */
 1600|  41.2k|        endian = 1;
 1601|  41.2k|        if (*(unsigned char *)&endian) {
  ------------------
  |  Branch (1601:13): [True: 41.2k, False: 0]
  ------------------
 1602|       |            /* Little endian. */
 1603|       |
 1604|  41.2k|            z_crc_t crc0;
 1605|  41.2k|            z_word_t word0;
 1606|  41.2k|#if N > 1
 1607|  41.2k|            z_crc_t crc1;
 1608|  41.2k|            z_word_t word1;
 1609|  41.2k|#if N > 2
 1610|  41.2k|            z_crc_t crc2;
 1611|  41.2k|            z_word_t word2;
 1612|  41.2k|#if N > 3
 1613|  41.2k|            z_crc_t crc3;
 1614|  41.2k|            z_word_t word3;
 1615|  41.2k|#if N > 4
 1616|  41.2k|            z_crc_t crc4;
 1617|  41.2k|            z_word_t word4;
 1618|       |#if N > 5
 1619|       |            z_crc_t crc5;
 1620|       |            z_word_t word5;
 1621|       |#endif
 1622|  41.2k|#endif
 1623|  41.2k|#endif
 1624|  41.2k|#endif
 1625|  41.2k|#endif
 1626|       |
 1627|       |            /* Initialize the CRC for each braid. */
 1628|  41.2k|            crc0 = (z_crc_t)crc;
 1629|  41.2k|#if N > 1
 1630|  41.2k|            crc1 = 0;
 1631|  41.2k|#if N > 2
 1632|  41.2k|            crc2 = 0;
 1633|  41.2k|#if N > 3
 1634|  41.2k|            crc3 = 0;
 1635|  41.2k|#if N > 4
 1636|  41.2k|            crc4 = 0;
 1637|       |#if N > 5
 1638|       |            crc5 = 0;
 1639|       |#endif
 1640|  41.2k|#endif
 1641|  41.2k|#endif
 1642|  41.2k|#endif
 1643|  41.2k|#endif
 1644|       |
 1645|       |            /*
 1646|       |              Process the first blks-1 blocks, computing the CRCs on each braid
 1647|       |              independently.
 1648|       |             */
 1649|  25.6M|            while (--blks) {
  ------------------
  |  Branch (1649:20): [True: 25.5M, False: 41.2k]
  ------------------
 1650|       |                /* Load the word for each braid into registers. */
 1651|  25.5M|                word0 = crc0 ^ words[0];
 1652|  25.5M|#if N > 1
 1653|  25.5M|                word1 = crc1 ^ words[1];
 1654|  25.5M|#if N > 2
 1655|  25.5M|                word2 = crc2 ^ words[2];
 1656|  25.5M|#if N > 3
 1657|  25.5M|                word3 = crc3 ^ words[3];
 1658|  25.5M|#if N > 4
 1659|  25.5M|                word4 = crc4 ^ words[4];
 1660|       |#if N > 5
 1661|       |                word5 = crc5 ^ words[5];
 1662|       |#endif
 1663|  25.5M|#endif
 1664|  25.5M|#endif
 1665|  25.5M|#endif
 1666|  25.5M|#endif
 1667|  25.5M|                words += N;
  ------------------
  |  |  146|  25.5M|#  define N DEF_N
  |  |  ------------------
  |  |  |  |  128|  25.5M|#  define DEF_N 5
  |  |  ------------------
  ------------------
 1668|       |
 1669|       |                /* Compute and update the CRC for each word. */
 1670|  25.5M|                crc0 = CRCWORD(BRAID_TABLE(N), word0);
  ------------------
  |  | 1273|  25.5M|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|  25.5M|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1671|  25.5M|#if N > 1
 1672|  25.5M|                crc1 = CRCWORD(BRAID_TABLE(N), word1);
  ------------------
  |  | 1273|  25.5M|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|  25.5M|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1673|  25.5M|#if N > 2
 1674|  25.5M|                crc2 = CRCWORD(BRAID_TABLE(N), word2);
  ------------------
  |  | 1273|  25.5M|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|  25.5M|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1675|  25.5M|#if N > 3
 1676|  25.5M|                crc3 = CRCWORD(BRAID_TABLE(N), word3);
  ------------------
  |  | 1273|  25.5M|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|  25.5M|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1677|  25.5M|#if N > 4
 1678|  25.5M|                crc4 = CRCWORD(BRAID_TABLE(N), word4);
  ------------------
  |  | 1273|  25.5M|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|  25.5M|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  25.5M|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1679|       |#if N > 5
 1680|       |                crc5 = CRCWORD(BRAID_TABLE(N), word5);
 1681|       |#endif
 1682|  25.5M|#endif
 1683|  25.5M|#endif
 1684|  25.5M|#endif
 1685|  25.5M|#endif
 1686|  25.5M|            }
 1687|       |
 1688|       |            /*
 1689|       |              Process the last block, combining the CRCs of the N braids at the
 1690|       |              same time.
 1691|       |             */
 1692|  41.2k|            crc = crc_word(crc0 ^ words[0]);
 1693|  41.2k|#if N > 1
 1694|  41.2k|            crc = crc_word(crc1 ^ words[1] ^ crc);
 1695|  41.2k|#if N > 2
 1696|  41.2k|            crc = crc_word(crc2 ^ words[2] ^ crc);
 1697|  41.2k|#if N > 3
 1698|  41.2k|            crc = crc_word(crc3 ^ words[3] ^ crc);
 1699|  41.2k|#if N > 4
 1700|  41.2k|            crc = crc_word(crc4 ^ words[4] ^ crc);
 1701|       |#if N > 5
 1702|       |            crc = crc_word(crc5 ^ words[5] ^ crc);
 1703|       |#endif
 1704|  41.2k|#endif
 1705|  41.2k|#endif
 1706|  41.2k|#endif
 1707|  41.2k|#endif
 1708|  41.2k|            words += N;
  ------------------
  |  |  146|  41.2k|#  define N DEF_N
  |  |  ------------------
  |  |  |  |  128|  41.2k|#  define DEF_N 5
  |  |  ------------------
  ------------------
 1709|  41.2k|        }
 1710|      0|        else {
 1711|       |            /* Big endian. */
 1712|       |
 1713|      0|            z_word_t crc0, word0, comb;
 1714|      0|#if N > 1
 1715|      0|            z_word_t crc1, word1;
 1716|      0|#if N > 2
 1717|      0|            z_word_t crc2, word2;
 1718|      0|#if N > 3
 1719|      0|            z_word_t crc3, word3;
 1720|      0|#if N > 4
 1721|      0|            z_word_t crc4, word4;
 1722|       |#if N > 5
 1723|       |            z_word_t crc5, word5;
 1724|       |#endif
 1725|      0|#endif
 1726|      0|#endif
 1727|      0|#endif
 1728|      0|#endif
 1729|       |
 1730|       |            /* Initialize the CRC for each braid. */
 1731|      0|            crc0 = byte_swap(crc);
 1732|      0|#if N > 1
 1733|      0|            crc1 = 0;
 1734|      0|#if N > 2
 1735|      0|            crc2 = 0;
 1736|      0|#if N > 3
 1737|      0|            crc3 = 0;
 1738|      0|#if N > 4
 1739|      0|            crc4 = 0;
 1740|       |#if N > 5
 1741|       |            crc5 = 0;
 1742|       |#endif
 1743|      0|#endif
 1744|      0|#endif
 1745|      0|#endif
 1746|      0|#endif
 1747|       |
 1748|       |            /*
 1749|       |              Process the first blks-1 blocks, computing the CRCs on each braid
 1750|       |              independently.
 1751|       |             */
 1752|      0|            while (--blks) {
  ------------------
  |  Branch (1752:20): [True: 0, False: 0]
  ------------------
 1753|       |                /* Load the word for each braid into registers. */
 1754|      0|                word0 = crc0 ^ words[0];
 1755|      0|#if N > 1
 1756|      0|                word1 = crc1 ^ words[1];
 1757|      0|#if N > 2
 1758|      0|                word2 = crc2 ^ words[2];
 1759|      0|#if N > 3
 1760|      0|                word3 = crc3 ^ words[3];
 1761|      0|#if N > 4
 1762|      0|                word4 = crc4 ^ words[4];
 1763|       |#if N > 5
 1764|       |                word5 = crc5 ^ words[5];
 1765|       |#endif
 1766|      0|#endif
 1767|      0|#endif
 1768|      0|#endif
 1769|      0|#endif
 1770|      0|                words += N;
  ------------------
  |  |  146|      0|#  define N DEF_N
  |  |  ------------------
  |  |  |  |  128|      0|#  define DEF_N 5
  |  |  ------------------
  ------------------
 1771|       |
 1772|       |                /* Compute and update the CRC for each word. */
 1773|      0|                crc0 = CRCWORD(BRAID_BIG_TABLE(N), word0);
  ------------------
  |  | 1273|      0|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|      0|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1774|      0|#if N > 1
 1775|      0|                crc1 = CRCWORD(BRAID_BIG_TABLE(N), word1);
  ------------------
  |  | 1273|      0|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|      0|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1776|      0|#if N > 2
 1777|      0|                crc2 = CRCWORD(BRAID_BIG_TABLE(N), word2);
  ------------------
  |  | 1273|      0|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|      0|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1778|      0|#if N > 3
 1779|      0|                crc3 = CRCWORD(BRAID_BIG_TABLE(N), word3);
  ------------------
  |  | 1273|      0|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|      0|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1780|      0|#if N > 4
 1781|      0|                crc4 = CRCWORD(BRAID_BIG_TABLE(N), word4);
  ------------------
  |  | 1273|      0|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|      0|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1782|       |#if N > 5
 1783|       |                crc5 = CRCWORD(BRAID_BIG_TABLE(N), word5);
 1784|       |#endif
 1785|      0|#endif
 1786|      0|#endif
 1787|      0|#endif
 1788|      0|#endif
 1789|      0|            }
 1790|       |
 1791|       |            /*
 1792|       |              Process the last block, combining the CRCs of the N braids at the
 1793|       |              same time.
 1794|       |             */
 1795|      0|            comb = crc_word_big(crc0 ^ words[0]);
 1796|      0|#if N > 1
 1797|      0|            comb = crc_word_big(crc1 ^ words[1] ^ comb);
 1798|      0|#if N > 2
 1799|      0|            comb = crc_word_big(crc2 ^ words[2] ^ comb);
 1800|      0|#if N > 3
 1801|      0|            comb = crc_word_big(crc3 ^ words[3] ^ comb);
 1802|      0|#if N > 4
 1803|      0|            comb = crc_word_big(crc4 ^ words[4] ^ comb);
 1804|       |#if N > 5
 1805|       |            comb = crc_word_big(crc5 ^ words[5] ^ comb);
 1806|       |#endif
 1807|      0|#endif
 1808|      0|#endif
 1809|      0|#endif
 1810|      0|#endif
 1811|      0|            words += N;
  ------------------
  |  |  146|      0|#  define N DEF_N
  |  |  ------------------
  |  |  |  |  128|      0|#  define DEF_N 5
  |  |  ------------------
  ------------------
 1812|      0|            crc = byte_swap(comb);
 1813|      0|        }
 1814|       |
 1815|       |        /*
 1816|       |          Update the pointer to the remaining bytes to process.
 1817|       |         */
 1818|  41.2k|        buf = (unsigned char const *)words;
 1819|  41.2k|    }
 1820|       |
 1821|  47.1k|#endif /* W */
 1822|       |
 1823|       |    /* Complete the computation of the CRC on any remaining bytes. */
 1824|  67.6k|    while (len >= 8) {
  ------------------
  |  Branch (1824:12): [True: 20.4k, False: 47.1k]
  ------------------
 1825|  20.4k|        len -= 8;
 1826|  20.4k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1827|  20.4k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1828|  20.4k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1829|  20.4k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1830|  20.4k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1831|  20.4k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1832|  20.4k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1833|  20.4k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1834|  20.4k|    }
 1835|   199k|    while (len) {
  ------------------
  |  Branch (1835:12): [True: 152k, False: 47.1k]
  ------------------
 1836|   152k|        len--;
 1837|   152k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1838|   152k|    }
 1839|       |
 1840|       |    /* Return the CRC, post-conditioned. */
 1841|  47.1k|    return crc ^ 0xffffffff;
 1842|  52.3k|}
crc32:
 1879|  69.2k|uLong ZEXPORT crc32(uLong crc, const unsigned char FAR *buf, uInt len) {
 1880|       |    #ifdef HAVE_S390X_VX
 1881|       |    return crc32_z_hook(crc, buf, len);
 1882|       |    #endif
 1883|  69.2k|    return crc32_z(crc, buf, len);
 1884|  69.2k|}
crc32.c:crc32_braid:
 1288|  5.20k|                        z_size_t len) {
 1289|       |    /* If provided enough bytes, do a braided CRC calculation. */
 1290|  5.20k|    if (len >= NLOW * W + W - 1) {
  ------------------
  |  |  160|  5.20k|#    define NLOW DEF_NLOW
  |  |  ------------------
  |  |  |  |  130|  5.20k|#  define DEF_NLOW 2
  |  |  ------------------
  ------------------
                  if (len >= NLOW * W + W - 1) {
  ------------------
  |  |  210|  5.20k|#    define W 4
  ------------------
                  if (len >= NLOW * W + W - 1) {
  ------------------
  |  |  210|  5.20k|#    define W 4
  ------------------
  |  Branch (1290:9): [True: 5.20k, False: 0]
  ------------------
 1291|  5.20k|        z_size_t blks;
 1292|  5.20k|        z_word_t const *words;
 1293|  5.20k|        unsigned endian;
 1294|       |
 1295|       |        /* Compute the CRC up to a z_word_t boundary. */
 1296|  8.39k|        while (len && ((z_size_t)buf & (W - 1)) != 0) {
  ------------------
  |  |  210|  8.39k|#    define W 4
  ------------------
  |  Branch (1296:16): [True: 8.39k, False: 0]
  |  Branch (1296:23): [True: 3.18k, False: 5.20k]
  ------------------
 1297|  3.18k|            len--;
 1298|  3.18k|            crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1299|  3.18k|        }
 1300|       |
 1301|       |        /* Compute the CRC on as many NLOW z_word_t blocks as are available. */
 1302|  5.20k|        blks = len / (NLOW * W);
  ------------------
  |  |  160|  5.20k|#    define NLOW DEF_NLOW
  |  |  ------------------
  |  |  |  |  130|  5.20k|#  define DEF_NLOW 2
  |  |  ------------------
  ------------------
                      blks = len / (NLOW * W);
  ------------------
  |  |  210|  5.20k|#    define W 4
  ------------------
 1303|  5.20k|        len -= blks * NLOW * W;
  ------------------
  |  |  160|  5.20k|#    define NLOW DEF_NLOW
  |  |  ------------------
  |  |  |  |  130|  5.20k|#  define DEF_NLOW 2
  |  |  ------------------
  ------------------
                      len -= blks * NLOW * W;
  ------------------
  |  |  210|  5.20k|#    define W 4
  ------------------
 1304|  5.20k|        words = (z_word_t const *)buf;
 1305|       |
 1306|       |        /* Do endian check at execution time instead of compile time, since ARM
 1307|       |           processors can change the endianness at execution time. If the
 1308|       |           compiler knows what the endianness will be, it can optimize out the
 1309|       |           check and the unused branch. */
 1310|  5.20k|        endian = 1;
 1311|  5.20k|        if (*(unsigned char *)&endian) {
  ------------------
  |  Branch (1311:13): [True: 5.20k, False: 0]
  ------------------
 1312|       |            /* Little endian. */
 1313|       |
 1314|  5.20k|            z_crc_t crc0;
 1315|  5.20k|            z_word_t word0;
 1316|  5.20k|#if NLOW > 1
 1317|  5.20k|            z_crc_t crc1;
 1318|  5.20k|            z_word_t word1;
 1319|       |#if NLOW > 2
 1320|       |            z_crc_t crc2;
 1321|       |            z_word_t word2;
 1322|       |#if NLOW > 3
 1323|       |            z_crc_t crc3;
 1324|       |            z_word_t word3;
 1325|       |#if NLOW > 4
 1326|       |            z_crc_t crc4;
 1327|       |            z_word_t word4;
 1328|       |#if NLOW > 5
 1329|       |            z_crc_t crc5;
 1330|       |            z_word_t word5;
 1331|       |#endif
 1332|       |#endif
 1333|       |#endif
 1334|       |#endif
 1335|  5.20k|#endif
 1336|       |
 1337|       |            /* Initialize the CRC for each braid. */
 1338|  5.20k|            crc0 = (z_crc_t)crc;
 1339|  5.20k|#if NLOW > 1
 1340|  5.20k|            crc1 = 0;
 1341|       |#if NLOW > 2
 1342|       |            crc2 = 0;
 1343|       |#if NLOW > 3
 1344|       |            crc3 = 0;
 1345|       |#if NLOW > 4
 1346|       |            crc4 = 0;
 1347|       |#if NLOW > 5
 1348|       |            crc5 = 0;
 1349|       |#endif
 1350|       |#endif
 1351|       |#endif
 1352|       |#endif
 1353|  5.20k|#endif
 1354|       |
 1355|       |            /*
 1356|       |              Process the first blks-1 blocks, computing the CRCs on each braid
 1357|       |              independently.
 1358|       |             */
 1359|  50.3k|            while (--blks) {
  ------------------
  |  Branch (1359:20): [True: 45.1k, False: 5.20k]
  ------------------
 1360|       |                /* Load the word for each braid into registers. */
 1361|  45.1k|                word0 = crc0 ^ words[0];
 1362|  45.1k|#if NLOW > 1
 1363|  45.1k|                word1 = crc1 ^ words[1];
 1364|       |#if NLOW > 2
 1365|       |                word2 = crc2 ^ words[2];
 1366|       |#if NLOW > 3
 1367|       |                word3 = crc3 ^ words[3];
 1368|       |#if NLOW > 4
 1369|       |                word4 = crc4 ^ words[4];
 1370|       |#if NLOW > 5
 1371|       |                word5 = crc5 ^ words[5];
 1372|       |#endif
 1373|       |#endif
 1374|       |#endif
 1375|       |#endif
 1376|  45.1k|#endif
 1377|  45.1k|                words += NLOW;
  ------------------
  |  |  160|  45.1k|#    define NLOW DEF_NLOW
  |  |  ------------------
  |  |  |  |  130|  45.1k|#  define DEF_NLOW 2
  |  |  ------------------
  ------------------
 1378|       |
 1379|       |                /* Compute and update the CRC for each word. */
 1380|  45.1k|                crc0 = CRCWORD(BRAID_TABLE(NLOW), word0);
  ------------------
  |  | 1273|  45.1k|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  45.1k|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  45.1k|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|  45.1k|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  45.1k|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  45.1k|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1381|  45.1k|#if NLOW > 1
 1382|  45.1k|                crc1 = CRCWORD(BRAID_TABLE(NLOW), word1);
  ------------------
  |  | 1273|  45.1k|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  45.1k|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|  45.1k|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|  45.1k|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  45.1k|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|  45.1k|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1383|       |#if NLOW > 2
 1384|       |                crc2 = CRCWORD(BRAID_TABLE(NLOW), word2);
 1385|       |#if NLOW > 3
 1386|       |                crc3 = CRCWORD(BRAID_TABLE(NLOW), word3);
 1387|       |#if NLOW > 4
 1388|       |                crc4 = CRCWORD(BRAID_TABLE(NLOW), word4);
 1389|       |#if NLOW > 5
 1390|       |                crc5 = CRCWORD(BRAID_TABLE(NLOW), word5);
 1391|       |#endif
 1392|       |#endif
 1393|       |#endif
 1394|       |#endif
 1395|  45.1k|#endif
 1396|  45.1k|            }
 1397|       |
 1398|       |            /*
 1399|       |              Process the last block, combining the CRCs of the NLOW braids at
 1400|       |              the same time.
 1401|       |             */
 1402|  5.20k|            crc = crc_word(crc0 ^ words[0]);
 1403|  5.20k|#if NLOW > 1
 1404|  5.20k|            crc = crc_word(crc1 ^ words[1] ^ crc);
 1405|       |#if NLOW > 2
 1406|       |            crc = crc_word(crc2 ^ words[2] ^ crc);
 1407|       |#if NLOW > 3
 1408|       |            crc = crc_word(crc3 ^ words[3] ^ crc);
 1409|       |#if NLOW > 4
 1410|       |            crc = crc_word(crc4 ^ words[4] ^ crc);
 1411|       |#if NLOW > 5
 1412|       |            crc = crc_word(crc5 ^ words[5] ^ crc);
 1413|       |#endif
 1414|       |#endif
 1415|       |#endif
 1416|       |#endif
 1417|  5.20k|#endif
 1418|  5.20k|            words += NLOW;
  ------------------
  |  |  160|  5.20k|#    define NLOW DEF_NLOW
  |  |  ------------------
  |  |  |  |  130|  5.20k|#  define DEF_NLOW 2
  |  |  ------------------
  ------------------
 1419|  5.20k|        }
 1420|      0|        else {
 1421|       |            /* Big endian. */
 1422|       |
 1423|      0|            z_word_t crc0, word0, comb;
 1424|      0|#if NLOW > 1
 1425|      0|            z_word_t crc1, word1;
 1426|       |#if NLOW > 2
 1427|       |            z_word_t crc2, word2;
 1428|       |#if NLOW > 3
 1429|       |            z_word_t crc3, word3;
 1430|       |#if NLOW > 4
 1431|       |            z_word_t crc4, word4;
 1432|       |#if NLOW > 5
 1433|       |            z_word_t crc5, word5;
 1434|       |#endif
 1435|       |#endif
 1436|       |#endif
 1437|       |#endif
 1438|      0|#endif
 1439|       |
 1440|       |            /* Initialize the CRC for each braid. */
 1441|      0|            crc0 = byte_swap(crc);
 1442|      0|#if NLOW > 1
 1443|      0|            crc1 = 0;
 1444|       |#if NLOW > 2
 1445|       |            crc2 = 0;
 1446|       |#if NLOW > 3
 1447|       |            crc3 = 0;
 1448|       |#if NLOW > 4
 1449|       |            crc4 = 0;
 1450|       |#if NLOW > 5
 1451|       |            crc5 = 0;
 1452|       |#endif
 1453|       |#endif
 1454|       |#endif
 1455|       |#endif
 1456|      0|#endif
 1457|       |
 1458|       |            /*
 1459|       |              Process the first blks-1 blocks, computing the CRCs on each braid
 1460|       |              independently.
 1461|       |             */
 1462|      0|            while (--blks) {
  ------------------
  |  Branch (1462:20): [True: 0, False: 0]
  ------------------
 1463|       |                /* Load the word for each braid into registers. */
 1464|      0|                word0 = crc0 ^ words[0];
 1465|      0|#if NLOW > 1
 1466|      0|                word1 = crc1 ^ words[1];
 1467|       |#if NLOW > 2
 1468|       |                word2 = crc2 ^ words[2];
 1469|       |#if NLOW > 3
 1470|       |                word3 = crc3 ^ words[3];
 1471|       |#if NLOW > 4
 1472|       |                word4 = crc4 ^ words[4];
 1473|       |#if NLOW > 5
 1474|       |                word5 = crc5 ^ words[5];
 1475|       |#endif
 1476|       |#endif
 1477|       |#endif
 1478|       |#endif
 1479|      0|#endif
 1480|      0|                words += NLOW;
  ------------------
  |  |  160|      0|#    define NLOW DEF_NLOW
  |  |  ------------------
  |  |  |  |  130|      0|#  define DEF_NLOW 2
  |  |  ------------------
  ------------------
 1481|       |
 1482|       |                /* Compute and update the CRC for each word. */
 1483|      0|                crc0 = CRCWORD(BRAID_BIG_TABLE(NLOW), word0);
  ------------------
  |  | 1273|      0|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|      0|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1484|      0|#if NLOW > 1
 1485|      0|                crc1 = CRCWORD(BRAID_BIG_TABLE(NLOW), word1);
  ------------------
  |  | 1273|      0|#  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |               #  define CRCWORD(t, w) ((CRCB(t, w, 0) ^ CRCB(t, w, 1)) ^ \
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  | 1274|      0|                         (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  |  |                                        (CRCB(t, w, 2) ^ CRCB(t, w, 3)))
  |  |  ------------------
  |  |  |  | 1266|      0|#define CRCB(t, w, k) t[k][((w) >> ((k) << 3)) & 0xff]
  |  |  ------------------
  ------------------
 1486|       |#if NLOW > 2
 1487|       |                crc2 = CRCWORD(BRAID_BIG_TABLE(NLOW), word2);
 1488|       |#if NLOW > 3
 1489|       |                crc3 = CRCWORD(BRAID_BIG_TABLE(NLOW), word3);
 1490|       |#if NLOW > 4
 1491|       |                crc4 = CRCWORD(BRAID_BIG_TABLE(NLOW), word4);
 1492|       |#if NLOW > 5
 1493|       |                crc5 = CRCWORD(BRAID_BIG_TABLE(NLOW), word5);
 1494|       |#endif
 1495|       |#endif
 1496|       |#endif
 1497|       |#endif
 1498|      0|#endif
 1499|      0|            }
 1500|       |
 1501|       |            /*
 1502|       |              Process the last block, combining the CRCs of the NLOW braids at
 1503|       |              the same time.
 1504|       |             */
 1505|      0|            comb = crc_word_big(crc0 ^ words[0]);
 1506|      0|#if NLOW > 1
 1507|      0|            comb = crc_word_big(crc1 ^ words[1] ^ comb);
 1508|       |#if NLOW > 2
 1509|       |            comb = crc_word_big(crc2 ^ words[2] ^ comb);
 1510|       |#if NLOW > 3
 1511|       |            comb = crc_word_big(crc3 ^ words[3] ^ comb);
 1512|       |#if NLOW > 4
 1513|       |            comb = crc_word_big(crc4 ^ words[4] ^ comb);
 1514|       |#if NLOW > 5
 1515|       |            comb = crc_word_big(crc5 ^ words[5] ^ comb);
 1516|       |#endif
 1517|       |#endif
 1518|       |#endif
 1519|       |#endif
 1520|      0|#endif
 1521|      0|            words += NLOW;
  ------------------
  |  |  160|      0|#    define NLOW DEF_NLOW
  |  |  ------------------
  |  |  |  |  130|      0|#  define DEF_NLOW 2
  |  |  ------------------
  ------------------
 1522|      0|            crc = byte_swap(comb);
 1523|      0|        }
 1524|       |
 1525|       |        /*
 1526|       |          Update the pointer to the remaining bytes to process.
 1527|       |         */
 1528|  5.20k|        buf = (unsigned char const *)words;
 1529|  5.20k|    }
 1530|       |
 1531|       |    /* Complete the computation of the CRC on any remaining bytes. */
 1532|  5.20k|    while (len >= 8) {
  ------------------
  |  Branch (1532:12): [True: 0, False: 5.20k]
  ------------------
 1533|      0|        len -= 8;
 1534|      0|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1535|      0|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1536|      0|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1537|      0|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1538|      0|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1539|      0|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1540|      0|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1541|      0|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1542|      0|    }
 1543|  21.2k|    while (len) {
  ------------------
  |  Branch (1543:12): [True: 16.0k, False: 5.20k]
  ------------------
 1544|  16.0k|        len--;
 1545|  16.0k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1546|  16.0k|    }
 1547|       |
 1548|  5.20k|    return crc;
 1549|  5.20k|}
crc32.c:crc_word:
 1244|   216k|local z_crc_t crc_word(z_word_t data) {
 1245|   216k|    int k;
 1246|  1.08M|    for (k = 0; k < W; k++)
  ------------------
  |  |  210|  1.08M|#    define W 4
  ------------------
  |  Branch (1246:17): [True: 865k, False: 216k]
  ------------------
 1247|   865k|        data = (data >> 8) ^ crc_table[data & 0xff];
 1248|   216k|    return (z_crc_t)data;
 1249|   216k|}

deflateInit2_:
  389|  4.22k|                          const char *version, int stream_size) {
  390|  4.22k|    deflate_state *s;
  391|  4.22k|    int wrap = 1;
  392|  4.22k|    static const char my_version[] = ZLIB_VERSION;
  ------------------
  |  |   44|  4.22k|#define ZLIB_VERSION "1.4.0.1-motley"
  ------------------
  393|       |
  394|  4.22k|    if (version == Z_NULL || version[0] != my_version[0] ||
  ------------------
  |  |  216|  8.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (394:9): [True: 0, False: 4.22k]
  |  Branch (394:30): [True: 0, False: 4.22k]
  ------------------
  395|  4.22k|        stream_size != sizeof(z_stream)) {
  ------------------
  |  Branch (395:9): [True: 0, False: 4.22k]
  ------------------
  396|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  189|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  397|      0|    }
  398|  4.22k|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  216|  4.22k|#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.22k]
  ------------------
  399|       |
  400|  4.22k|    strm->msg = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  401|  4.22k|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (401:9): [True: 4.22k, False: 0]
  ------------------
  402|       |#ifdef Z_SOLO
  403|       |        return Z_STREAM_ERROR;
  404|       |#else
  405|  4.22k|        strm->zalloc = zcalloc;
  406|  4.22k|        strm->opaque = (voidpf)0;
  407|  4.22k|#endif
  408|  4.22k|    }
  409|  4.22k|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (409:9): [True: 4.22k, False: 0]
  ------------------
  410|       |#ifdef Z_SOLO
  411|       |        return Z_STREAM_ERROR;
  412|       |#else
  413|  4.22k|        strm->zfree = zcfree;
  414|  4.22k|#endif
  415|       |
  416|       |#ifdef FASTEST
  417|       |    if (level != 0) level = 1;
  418|       |#else
  419|  4.22k|    if (level == Z_DEFAULT_COMPRESSION) level = 6;
  ------------------
  |  |  197|  4.22k|#define Z_DEFAULT_COMPRESSION  (-1)
  ------------------
  |  Branch (419:9): [True: 4.22k, False: 0]
  ------------------
  420|  4.22k|#endif
  421|       |
  422|  4.22k|    if (windowBits < 0) { /* suppress zlib wrapper */
  ------------------
  |  Branch (422:9): [True: 0, False: 4.22k]
  ------------------
  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.22k|#ifdef GZIP
  429|  4.22k|    else if (windowBits > 15) {
  ------------------
  |  Branch (429:14): [True: 4.22k, False: 0]
  ------------------
  430|  4.22k|        wrap = 2;       /* write gzip wrapper instead */
  431|  4.22k|        windowBits -= 16;
  432|  4.22k|    }
  433|  4.22k|#endif
  434|  4.22k|    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  277|  8.45k|#    define MAX_MEM_LEVEL 9
  ------------------
                  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  213|  8.45k|#define Z_DEFLATED   8
  ------------------
  |  Branch (434:9): [True: 0, False: 4.22k]
  |  Branch (434:25): [True: 0, False: 4.22k]
  |  Branch (434:53): [True: 0, False: 4.22k]
  ------------------
  435|  4.22k|        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
  ------------------
  |  Branch (435:9): [True: 0, False: 4.22k]
  |  Branch (435:27): [True: 0, False: 4.22k]
  |  Branch (435:46): [True: 0, False: 4.22k]
  |  Branch (435:59): [True: 0, False: 4.22k]
  ------------------
  436|  4.22k|        strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) {
  ------------------
  |  |  203|  8.45k|#define Z_FIXED               4
  ------------------
  |  Branch (436:9): [True: 0, False: 4.22k]
  |  Branch (436:25): [True: 0, False: 4.22k]
  |  Branch (436:48): [True: 0, False: 4.22k]
  |  Branch (436:67): [True: 0, False: 0]
  ------------------
  437|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  438|      0|    }
  439|  4.22k|    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
  ------------------
  |  Branch (439:9): [True: 0, False: 4.22k]
  ------------------
  440|  4.22k|    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
  ------------------
  |  |  343|  4.22k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  441|  4.22k|    if (s == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  216|  4.22k|#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.22k]
  ------------------
  442|  4.22k|    zmemzero(s, sizeof(deflate_state));
  ------------------
  |  |  308|  4.22k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  443|  4.22k|    strm->state = (struct internal_state FAR *)s;
  444|  4.22k|    s->strm = strm;
  445|  4.22k|    s->status = INIT_STATE;     /* to pass state test in deflateReset() */
  ------------------
  |  |   58|  4.22k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  446|       |
  447|  4.22k|    s->wrap = wrap;
  448|  4.22k|    s->w_bits = (uInt)windowBits;
  449|  4.22k|    s->w_size = 1 << s->w_bits;
  450|  4.22k|    s->w_mask = s->w_size - 1;
  451|       |
  452|  4.22k|    s->hash_bits = (uInt)memLevel + 7;
  453|  4.22k|    s->hash_size = 1 << s->hash_bits;
  454|  4.22k|    s->hash_mask = s->hash_size - 1;
  455|  4.22k|    s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |  182|  4.22k|#define MIN_MATCH  3
  ------------------
                  s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |  182|  4.22k|#define MIN_MATCH  3
  ------------------
  456|       |
  457|  4.22k|    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
  ------------------
  |  |  343|  4.22k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  458|  4.22k|    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
  ------------------
  |  |  343|  4.22k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  459|  4.22k|    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
  ------------------
  |  |  343|  4.22k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  460|       |
  461|  4.22k|    s->high_water = 0;      /* nothing written to s->window yet */
  462|       |
  463|  4.22k|    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
  464|       |
  465|       |    /* We overlay pending_buf and sym_buf. This works since the average size
  466|       |     * for length/distance pairs over any compressed block is assured to be 31
  467|       |     * bits or less.
  468|       |     *
  469|       |     * Analysis: The longest fixed codes are a length code of 8 bits plus 5
  470|       |     * extra bits, for lengths 131 to 257. The longest fixed distance codes are
  471|       |     * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest
  472|       |     * possible fixed-codes length/distance pair is then 31 bits total.
  473|       |     *
  474|       |     * sym_buf starts one-fourth of the way into pending_buf. So there are
  475|       |     * three bytes in sym_buf for every four bytes in pending_buf. Each symbol
  476|       |     * in sym_buf is three bytes -- two for the distance and one for the
  477|       |     * literal/length. As each symbol is consumed, the pointer to the next
  478|       |     * sym_buf value to read moves forward three bytes. From that symbol, up to
  479|       |     * 31 bits are written to pending_buf. The closest the written pending_buf
  480|       |     * bits gets to the next sym_buf symbol to read is just before the last
  481|       |     * code is written. At that time, 31*(n - 2) bits have been written, just
  482|       |     * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at
  483|       |     * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1
  484|       |     * symbols are written.) The closest the writing gets to what is unread is
  485|       |     * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and
  486|       |     * can range from 128 to 32768.
  487|       |     *
  488|       |     * Therefore, at a minimum, there are 142 bits of space between what is
  489|       |     * written and what is read in the overlain buffers, so the symbols cannot
  490|       |     * be overwritten by the compressed data. That space is actually 139 bits,
  491|       |     * due to the three-bit fixed-code block header.
  492|       |     *
  493|       |     * That covers the case where either Z_FIXED is specified, forcing fixed
  494|       |     * codes, or when the use of fixed codes is chosen, because that choice
  495|       |     * results in a smaller compressed block than dynamic codes. That latter
  496|       |     * condition then assures that the above analysis also covers all dynamic
  497|       |     * blocks. A dynamic-code block will only be chosen to be emitted if it has
  498|       |     * fewer bits than a fixed-code block would for the same set of symbols.
  499|       |     * Therefore its average symbol length is assured to be less than 31. So
  500|       |     * the compressed data for a dynamic block also cannot overwrite the
  501|       |     * symbols from which it is being constructed.
  502|       |     */
  503|       |
  504|  4.22k|    s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS);
  ------------------
  |  |  343|  4.22k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  505|  4.22k|    s->pending_buf_size = (ulg)s->lit_bufsize * 4;
  506|       |
  507|  4.22k|    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  8.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  8.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  8.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (507:9): [True: 0, False: 4.22k]
  |  Branch (507:32): [True: 0, False: 4.22k]
  |  Branch (507:53): [True: 0, False: 4.22k]
  ------------------
  508|  4.22k|        s->pending_buf == Z_NULL) {
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (508:9): [True: 0, False: 4.22k]
  ------------------
  509|      0|        s->status = FINISH_STATE;
  ------------------
  |  |   67|      0|#define FINISH_STATE 666    /* stream complete */
  ------------------
  510|      0|        strm->msg = ERR_MSG(Z_MEM_ERROR);
  ------------------
  |  |  155|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  ------------------
  |  |  |  Branch (155:31): [Folded, False: 0]
  |  |  |  Branch (155:45): [Folded, False: 0]
  |  |  ------------------
  ------------------
  511|      0|        deflateEnd (strm);
  512|      0|        return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  513|      0|    }
  514|       |#ifdef LIT_MEM
  515|       |    s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1));
  516|       |    s->l_buf = s->pending_buf + (s->lit_bufsize << 2);
  517|       |    s->sym_end = s->lit_bufsize - 1;
  518|       |#else
  519|  4.22k|    s->sym_buf = s->pending_buf + s->lit_bufsize;
  520|  4.22k|    s->sym_end = (s->lit_bufsize - 1) * 3;
  521|  4.22k|#endif
  522|       |    /* We avoid equality with lit_bufsize*3 because of wraparound at 64K
  523|       |     * on 16 bit machines and because stored blocks are restricted to
  524|       |     * 64K-1 bytes.
  525|       |     */
  526|       |
  527|  4.22k|    s->level = level;
  528|  4.22k|    s->strategy = strategy;
  529|  4.22k|    s->method = (Byte)method;
  530|       |
  531|  4.22k|    return deflateReset(strm);
  532|  4.22k|}
deflateResetKeep:
  644|  4.22k|int ZEXPORT deflateResetKeep(z_streamp strm) {
  645|  4.22k|    deflate_state *s;
  646|       |
  647|  4.22k|    if (deflateStateCheck(strm)) {
  ------------------
  |  Branch (647:9): [True: 0, False: 4.22k]
  ------------------
  648|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  649|      0|    }
  650|       |
  651|  4.22k|    strm->total_in = strm->total_out = 0;
  652|  4.22k|    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  653|  4.22k|    strm->data_type = Z_UNKNOWN;
  ------------------
  |  |  210|  4.22k|#define Z_UNKNOWN  2
  ------------------
  654|       |
  655|  4.22k|    s = (deflate_state *)strm->state;
  656|  4.22k|    s->pending = 0;
  657|  4.22k|    s->pending_out = s->pending_buf;
  658|       |
  659|  4.22k|    if (s->wrap < 0) {
  ------------------
  |  Branch (659:9): [True: 0, False: 4.22k]
  ------------------
  660|      0|        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
  661|      0|    }
  662|  4.22k|    s->status =
  663|  4.22k|#ifdef GZIP
  664|  4.22k|        s->wrap == 2 ? GZIP_STATE :
  ------------------
  |  |   60|  4.22k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (664:9): [True: 4.22k, False: 0]
  ------------------
  665|  4.22k|#endif
  666|  4.22k|        INIT_STATE;
  ------------------
  |  |   58|  4.22k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  667|  4.22k|    strm->adler =
  668|  4.22k|#ifdef GZIP
  669|  4.22k|        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (669:9): [True: 4.22k, False: 0]
  ------------------
  670|  4.22k|#endif
  671|  4.22k|        adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  672|  4.22k|    s->last_flush = -2;
  673|       |
  674|  4.22k|    s->gzhead = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  675|       |
  676|  4.22k|    {
  677|       |        /* Retain the hash work done for level 0. */
  678|  4.22k|        uInt matches = s->level == 0 ? s->matches : 0;
  ------------------
  |  Branch (678:24): [True: 0, False: 4.22k]
  ------------------
  679|  4.22k|        _tr_init(s);
  680|  4.22k|        s->matches = matches;
  681|  4.22k|    }
  682|       |
  683|       |    /* Keep the window and the hash, but drop what was left unfinished */
  684|  4.22k|    s->block_start = (long)s->strstart;
  685|  4.22k|    s->lookahead = 0;
  686|  4.22k|    s->match_length = s->prev_length = MIN_MATCH-1;
  ------------------
  |  |  182|  4.22k|#define MIN_MATCH  3
  ------------------
  687|  4.22k|    s->match_available = 0;
  688|       |
  689|  4.22k|    return Z_OK;
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  690|  4.22k|}
deflateReset:
  718|  4.22k|int ZEXPORT deflateReset(z_streamp strm) {
  719|  4.22k|    int ret;
  720|       |
  721|  4.22k|    ret = deflateResetKeep(strm);
  722|  4.22k|    if (ret == Z_OK)
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  |  Branch (722:9): [True: 4.22k, False: 0]
  ------------------
  723|  4.22k|        lm_init(strm->state);
  724|  4.22k|    return ret;
  725|  4.22k|}
deflate:
 1000|  55.7k|int ZEXPORT deflate(z_streamp strm, int flush) {
 1001|  55.7k|    int old_flush; /* value of flush param for previous deflate call */
 1002|  55.7k|    deflate_state *s;
 1003|       |
 1004|  55.7k|    if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {
  ------------------
  |  |  177|   111k|#define Z_BLOCK         5
  ------------------
  |  Branch (1004:9): [True: 0, False: 55.7k]
  |  Branch (1004:36): [True: 0, False: 55.7k]
  |  Branch (1004:55): [True: 0, False: 55.7k]
  ------------------
 1005|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1006|      0|    }
 1007|  55.7k|    s = strm->state;
 1008|       |
 1009|  55.7k|    if (strm->next_out == Z_NULL ||
  ------------------
  |  |  216|   111k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1009:9): [True: 0, False: 55.7k]
  ------------------
 1010|  55.7k|        (strm->avail_in != 0 && strm->next_in == Z_NULL) ||
  ------------------
  |  |  216|  18.7k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1010:10): [True: 18.7k, False: 36.9k]
  |  Branch (1010:33): [True: 0, False: 18.7k]
  ------------------
 1011|  55.7k|        (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |   67|   111k|#define FINISH_STATE 666    /* stream complete */
  ------------------
                      (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |  176|  5.93k|#define Z_FINISH        4
  ------------------
  |  Branch (1011:10): [True: 5.93k, False: 49.8k]
  |  Branch (1011:39): [True: 0, False: 5.93k]
  ------------------
 1012|      0|        ERR_RETURN(strm, Z_STREAM_ERROR);
  ------------------
  |  |  158|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |  155|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:31): [Folded, False: 0]
  |  |  |  |  |  Branch (155:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1013|      0|    }
 1014|  55.7k|    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |  158|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |  155|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:31): [Folded, False: 0]
  |  |  |  |  |  Branch (155:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1014:9): [True: 0, False: 55.7k]
  ------------------
 1015|       |
 1016|  55.7k|    old_flush = s->last_flush;
 1017|  55.7k|    s->last_flush = flush;
 1018|       |
 1019|       |    /* Flush as much pending output as possible */
 1020|  55.7k|    if (s->pending != 0) {
  ------------------
  |  Branch (1020:9): [True: 19.3k, False: 36.3k]
  ------------------
 1021|  19.3k|        flush_pending(strm);
 1022|  19.3k|        if (strm->avail_out == 0) {
  ------------------
  |  Branch (1022:13): [True: 8.34k, False: 11.0k]
  ------------------
 1023|       |            /* Since avail_out is 0, deflate will be called again with
 1024|       |             * more output space, but possibly with both pending and
 1025|       |             * avail_in equal to zero. There won't be anything to do,
 1026|       |             * but this is not an error situation so make sure we
 1027|       |             * return OK instead of BUF_ERROR at next call of deflate:
 1028|       |             */
 1029|  8.34k|            s->last_flush = -1;
 1030|  8.34k|            return Z_OK;
  ------------------
  |  |  181|  8.34k|#define Z_OK            0
  ------------------
 1031|  8.34k|        }
 1032|       |
 1033|       |    /* Make sure there is something to do and avoid duplicate consecutive
 1034|       |     * flushes. For repeated and useless calls with Z_FINISH, we keep
 1035|       |     * returning Z_STREAM_END instead of Z_BUF_ERROR.
 1036|       |     */
 1037|  36.3k|    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  17.6k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
                  } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  53.9k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 17.6k]
  |  |  ------------------
  ------------------
  |  Branch (1037:16): [True: 17.6k, False: 18.7k]
  |  Branch (1037:39): [True: 16.3k, False: 1.24k]
  ------------------
 1038|  16.3k|               flush != Z_FINISH) {
  ------------------
  |  |  176|  16.3k|#define Z_FINISH        4
  ------------------
  |  Branch (1038:16): [True: 12.1k, False: 4.22k]
  ------------------
 1039|  12.1k|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |  158|  12.1k|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |  155|  12.1k|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:31): [Folded, False: 0]
  |  |  |  |  |  Branch (155:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1040|  12.1k|    }
 1041|       |
 1042|       |    /* User must not provide more input after the first FINISH: */
 1043|  35.2k|    if (s->status == FINISH_STATE && strm->avail_in != 0) {
  ------------------
  |  |   67|  70.5k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (1043:9): [True: 5.65k, False: 29.6k]
  |  Branch (1043:38): [True: 0, False: 5.65k]
  ------------------
 1044|      0|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |  158|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |  155|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (155:31): [Folded, False: 0]
  |  |  |  |  |  Branch (155:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1045|      0|    }
 1046|       |
 1047|       |    /* Write the header */
 1048|  35.2k|    if (s->status == INIT_STATE && s->wrap == 0)
  ------------------
  |  |   58|  70.5k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1048:9): [True: 0, False: 35.2k]
  |  Branch (1048:36): [True: 0, False: 0]
  ------------------
 1049|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1050|  35.2k|    if (s->status == INIT_STATE) {
  ------------------
  |  |   58|  35.2k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1050:9): [True: 0, False: 35.2k]
  ------------------
 1051|       |        /* zlib header */
 1052|      0|        uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
  ------------------
  |  |  213|      0|#define Z_DEFLATED   8
  ------------------
 1053|      0|        uInt level_flags;
 1054|       |
 1055|      0|        if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
  ------------------
  |  |  201|      0|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1055:13): [True: 0, False: 0]
  |  Branch (1055:46): [True: 0, False: 0]
  ------------------
 1056|      0|            level_flags = 0;
 1057|      0|        else if (s->level < 6)
  ------------------
  |  Branch (1057:18): [True: 0, False: 0]
  ------------------
 1058|      0|            level_flags = 1;
 1059|      0|        else if (s->level == 6)
  ------------------
  |  Branch (1059:18): [True: 0, False: 0]
  ------------------
 1060|      0|            level_flags = 2;
 1061|      0|        else
 1062|      0|            level_flags = 3;
 1063|      0|        header |= (level_flags << 6);
 1064|      0|        if (s->strstart != 0) header |= PRESET_DICT;
  ------------------
  |  |  186|      0|#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
  ------------------
  |  Branch (1064:13): [True: 0, False: 0]
  ------------------
 1065|      0|        header += 31 - (header % 31);
 1066|       |
 1067|      0|        putShortMSB(s, header);
 1068|       |
 1069|       |        /* Save the adler32 of the preset dictionary: */
 1070|      0|        if (s->strstart != 0) {
  ------------------
  |  Branch (1070:13): [True: 0, False: 0]
  ------------------
 1071|      0|            putShortMSB(s, (uInt)(strm->adler >> 16));
 1072|      0|            putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1073|      0|        }
 1074|      0|        strm->adler = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1075|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1076|       |
 1077|       |        /* Compression must start with an empty pending buffer */
 1078|      0|        flush_pending(strm);
 1079|      0|        if (s->pending != 0) {
  ------------------
  |  Branch (1079:13): [True: 0, False: 0]
  ------------------
 1080|      0|            s->last_flush = -1;
 1081|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1082|      0|        }
 1083|      0|    }
 1084|  35.2k|#ifdef GZIP
 1085|  35.2k|    if (s->status == GZIP_STATE) {
  ------------------
  |  |   60|  35.2k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (1085:9): [True: 4.22k, False: 31.0k]
  ------------------
 1086|       |        /* gzip header */
 1087|  4.22k|        strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1088|  4.22k|        put_byte(s, 31);
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1089|  4.22k|        put_byte(s, 139);
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1090|  4.22k|        put_byte(s, 8);
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1091|  4.22k|        if (s->gzhead == Z_NULL) {
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1091:13): [True: 4.22k, False: 0]
  ------------------
 1092|  4.22k|            put_byte(s, 0);
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1093|  4.22k|            put_byte(s, 0);
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1094|  4.22k|            put_byte(s, 0);
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1095|  4.22k|            put_byte(s, 0);
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1096|  4.22k|            put_byte(s, 0);
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1097|  4.22k|            put_byte(s, s->level == 9 ? 2 :
  ------------------
  |  |  293|  23.3k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (293:64): [True: 1.99k, False: 2.23k]
  |  |  |  Branch (293:64): [True: 0, False: 2.23k]
  |  |  |  Branch (293:64): [True: 0, False: 4.22k]
  |  |  ------------------
  ------------------
 1098|  4.22k|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1099|  4.22k|                      4 : 0));
 1100|  4.22k|            put_byte(s, OS_CODE);
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1101|  4.22k|            s->status = BUSY_STATE;
  ------------------
  |  |   66|  4.22k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1102|       |
 1103|       |            /* Compression must start with an empty pending buffer */
 1104|  4.22k|            flush_pending(strm);
 1105|  4.22k|            if (s->pending != 0) {
  ------------------
  |  Branch (1105:17): [True: 0, False: 4.22k]
  ------------------
 1106|      0|                s->last_flush = -1;
 1107|      0|                return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1108|      0|            }
 1109|  4.22k|        }
 1110|      0|        else {
 1111|      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]
  |  |  ------------------
  ------------------
 1112|      0|                     (s->gzhead->hcrc ? 2 : 0) +
 1113|      0|                     (s->gzhead->extra == Z_NULL ? 0 : 4) +
 1114|      0|                     (s->gzhead->name == Z_NULL ? 0 : 8) +
 1115|      0|                     (s->gzhead->comment == Z_NULL ? 0 : 16)
 1116|      0|                     );
 1117|      0|            put_byte(s, (Byte)(s->gzhead->time & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1118|      0|            put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1119|      0|            put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1120|      0|            put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1121|      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]
  |  |  ------------------
  ------------------
 1122|      0|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1123|      0|                      4 : 0));
 1124|      0|            put_byte(s, s->gzhead->os & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1125|      0|            if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1125:17): [True: 0, False: 0]
  ------------------
 1126|      0|                put_byte(s, s->gzhead->extra_len & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1127|      0|                put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1128|      0|            }
 1129|      0|            if (s->gzhead->hcrc)
  ------------------
  |  Branch (1129:17): [True: 0, False: 0]
  ------------------
 1130|      0|                strm->adler = crc32_z(strm->adler, s->pending_buf,
 1131|      0|                                      s->pending);
 1132|      0|            s->gzindex = 0;
 1133|      0|            s->status = EXTRA_STATE;
  ------------------
  |  |   62|      0|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
 1134|      0|        }
 1135|  4.22k|    }
 1136|  35.2k|    if (s->status == EXTRA_STATE) {
  ------------------
  |  |   62|  35.2k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (1136:9): [True: 0, False: 35.2k]
  ------------------
 1137|      0|        if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1137:13): [True: 0, False: 0]
  ------------------
 1138|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1139|      0|            ulg left = (s->gzhead->extra_len & 0xffff) - s->gzindex;
 1140|      0|            while (s->pending + left > s->pending_buf_size) {
  ------------------
  |  Branch (1140:20): [True: 0, False: 0]
  ------------------
 1141|      0|                ulg copy = s->pending_buf_size - s->pending;
 1142|      0|                zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  306|      0|#    define zmemcpy memcpy
  ------------------
 1143|      0|                        s->gzhead->extra + s->gzindex, copy);
 1144|      0|                s->pending = s->pending_buf_size;
 1145|      0|                HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1146|      0|                s->gzindex += copy;
 1147|      0|                flush_pending(strm);
 1148|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1148:21): [True: 0, False: 0]
  ------------------
 1149|      0|                    s->last_flush = -1;
 1150|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1151|      0|                }
 1152|      0|                beg = 0;
 1153|      0|                left -= copy;
 1154|      0|            }
 1155|      0|            zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  306|      0|#    define zmemcpy memcpy
  ------------------
 1156|      0|                    s->gzhead->extra + s->gzindex, left);
 1157|      0|            s->pending += left;
 1158|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1159|      0|            s->gzindex = 0;
 1160|      0|        }
 1161|      0|        s->status = NAME_STATE;
  ------------------
  |  |   63|      0|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
 1162|      0|    }
 1163|  35.2k|    if (s->status == NAME_STATE) {
  ------------------
  |  |   63|  35.2k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (1163:9): [True: 0, False: 35.2k]
  ------------------
 1164|      0|        if (s->gzhead->name != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1164:13): [True: 0, False: 0]
  ------------------
 1165|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1166|      0|            int val;
 1167|      0|            do {
 1168|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1168:21): [True: 0, False: 0]
  ------------------
 1169|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1170|      0|                    flush_pending(strm);
 1171|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1171:25): [True: 0, False: 0]
  ------------------
 1172|      0|                        s->last_flush = -1;
 1173|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1174|      0|                    }
 1175|      0|                    beg = 0;
 1176|      0|                }
 1177|      0|                val = s->gzhead->name[s->gzindex++];
 1178|      0|                put_byte(s, val);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1179|      0|            } while (val != 0);
  ------------------
  |  Branch (1179:22): [True: 0, False: 0]
  ------------------
 1180|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1181|      0|            s->gzindex = 0;
 1182|      0|        }
 1183|      0|        s->status = COMMENT_STATE;
  ------------------
  |  |   64|      0|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
 1184|      0|    }
 1185|  35.2k|    if (s->status == COMMENT_STATE) {
  ------------------
  |  |   64|  35.2k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (1185:9): [True: 0, False: 35.2k]
  ------------------
 1186|      0|        if (s->gzhead->comment != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1186:13): [True: 0, False: 0]
  ------------------
 1187|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1188|      0|            int val;
 1189|      0|            do {
 1190|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1190:21): [True: 0, False: 0]
  ------------------
 1191|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1192|      0|                    flush_pending(strm);
 1193|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1193:25): [True: 0, False: 0]
  ------------------
 1194|      0|                        s->last_flush = -1;
 1195|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1196|      0|                    }
 1197|      0|                    beg = 0;
 1198|      0|                }
 1199|      0|                val = s->gzhead->comment[s->gzindex++];
 1200|      0|                put_byte(s, val);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1201|      0|            } while (val != 0);
  ------------------
  |  Branch (1201:22): [True: 0, False: 0]
  ------------------
 1202|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1203|      0|        }
 1204|      0|        s->status = HCRC_STATE;
  ------------------
  |  |   65|      0|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
 1205|      0|    }
 1206|  35.2k|    if (s->status == HCRC_STATE) {
  ------------------
  |  |   65|  35.2k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (1206:9): [True: 0, False: 35.2k]
  ------------------
 1207|      0|        if (s->gzhead->hcrc) {
  ------------------
  |  Branch (1207:13): [True: 0, False: 0]
  ------------------
 1208|      0|            if (s->pending + 2 > s->pending_buf_size) {
  ------------------
  |  Branch (1208:17): [True: 0, False: 0]
  ------------------
 1209|      0|                flush_pending(strm);
 1210|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1210:21): [True: 0, False: 0]
  ------------------
 1211|      0|                    s->last_flush = -1;
 1212|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1213|      0|                }
 1214|      0|            }
 1215|      0|            put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1216|      0|            put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1217|      0|            strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1218|      0|        }
 1219|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1220|       |
 1221|       |        /* Compression must start with an empty pending buffer */
 1222|      0|        flush_pending(strm);
 1223|      0|        if (s->pending != 0) {
  ------------------
  |  Branch (1223:13): [True: 0, False: 0]
  ------------------
 1224|      0|            s->last_flush = -1;
 1225|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1226|      0|        }
 1227|      0|    }
 1228|  35.2k|#endif
 1229|       |
 1230|       |    /* Start a new block or continue the current one.
 1231|       |     */
 1232|  35.2k|    if (strm->avail_in != 0 || s->lookahead != 0 ||
  ------------------
  |  Branch (1232:9): [True: 18.7k, False: 16.5k]
  |  Branch (1232:32): [True: 10.4k, False: 6.09k]
  ------------------
 1233|  29.5k|        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |  172|  12.1k|#define Z_NO_FLUSH      0
  ------------------
                      (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |   67|  6.04k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (1233:10): [True: 6.04k, False: 50]
  |  Branch (1233:33): [True: 388, False: 5.65k]
  ------------------
 1234|  29.5k|        block_state bstate;
 1235|       |
 1236|  29.5k|        bstate = s->level == 0 ? deflate_stored(s, flush) :
  ------------------
  |  Branch (1236:18): [True: 0, False: 29.5k]
  ------------------
 1237|  29.5k|                 s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
  ------------------
  |  |  201|  29.5k|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1237:18): [True: 11.9k, False: 17.5k]
  ------------------
 1238|  29.5k|                 s->strategy == Z_RLE ? deflate_rle(s, flush) :
  ------------------
  |  |  202|  17.5k|#define Z_RLE                 3
  ------------------
  |  Branch (1238:18): [True: 6.21k, False: 11.3k]
  ------------------
 1239|  17.5k|                 (*(configuration_table[s->level].func))(s, flush);
 1240|       |
 1241|  29.5k|        if (bstate == finish_started || bstate == finish_done) {
  ------------------
  |  Branch (1241:13): [True: 1.28k, False: 28.2k]
  |  Branch (1241:41): [True: 2.94k, False: 25.3k]
  ------------------
 1242|  4.22k|            s->status = FINISH_STATE;
  ------------------
  |  |   67|  4.22k|#define FINISH_STATE 666    /* stream complete */
  ------------------
 1243|  4.22k|        }
 1244|  29.5k|        if (bstate == need_more || bstate == finish_started) {
  ------------------
  |  Branch (1244:13): [True: 25.3k, False: 4.22k]
  |  Branch (1244:36): [True: 1.28k, False: 2.94k]
  ------------------
 1245|  26.6k|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1245:17): [True: 11.0k, False: 15.5k]
  ------------------
 1246|  11.0k|                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
 1247|  11.0k|            }
 1248|  26.6k|            return Z_OK;
  ------------------
  |  |  181|  26.6k|#define Z_OK            0
  ------------------
 1249|       |            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
 1250|       |             * of deflate should use the same flush parameter to make sure
 1251|       |             * that the flush is complete. So we don't have to output an
 1252|       |             * empty block here, this will be done at next call. This also
 1253|       |             * ensures that for a very small output buffer, we emit at most
 1254|       |             * one empty block.
 1255|       |             */
 1256|  26.6k|        }
 1257|  2.94k|        if (bstate == block_done) {
  ------------------
  |  Branch (1257:13): [True: 0, False: 2.94k]
  ------------------
 1258|      0|            if (flush == Z_PARTIAL_FLUSH) {
  ------------------
  |  |  173|      0|#define Z_PARTIAL_FLUSH 1
  ------------------
  |  Branch (1258:17): [True: 0, False: 0]
  ------------------
 1259|      0|                _tr_align(s);
 1260|      0|            } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
  ------------------
  |  |  177|      0|#define Z_BLOCK         5
  ------------------
  |  Branch (1260:24): [True: 0, False: 0]
  ------------------
 1261|      0|                _tr_stored_block(s, (char*)0, 0L, 0);
 1262|       |                /* For a full flush, this empty block will be recognized
 1263|       |                 * as a special marker by inflate_sync().
 1264|       |                 */
 1265|      0|                if (flush == Z_FULL_FLUSH) {
  ------------------
  |  |  175|      0|#define Z_FULL_FLUSH    3
  ------------------
  |  Branch (1265:21): [True: 0, False: 0]
  ------------------
 1266|      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)); \
  |  |  ------------------
  |  |  |  |  308|      0|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|      0|        s->slid = 0; \
  |  |  175|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1267|      0|                    if (s->lookahead == 0) {
  ------------------
  |  Branch (1267:25): [True: 0, False: 0]
  ------------------
 1268|      0|                        s->strstart = 0;
 1269|      0|                        s->block_start = 0L;
 1270|      0|                        s->insert = 0;
 1271|      0|                    }
 1272|      0|                }
 1273|      0|            }
 1274|      0|            flush_pending(strm);
 1275|      0|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1275:17): [True: 0, False: 0]
  ------------------
 1276|      0|              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
 1277|      0|              return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1278|      0|            }
 1279|      0|        }
 1280|  2.94k|    }
 1281|       |
 1282|  8.65k|    if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  176|  8.65k|#define Z_FINISH        4
  ------------------
                  if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  181|     50|#define Z_OK            0
  ------------------
  |  Branch (1282:9): [True: 50, False: 8.60k]
  ------------------
 1283|  8.60k|    if (s->wrap <= 0) return Z_STREAM_END;
  ------------------
  |  |  182|  4.37k|#define Z_STREAM_END    1
  ------------------
  |  Branch (1283:9): [True: 4.37k, False: 4.22k]
  ------------------
 1284|       |
 1285|       |    /* Write the trailer */
 1286|  4.22k|#ifdef GZIP
 1287|  4.22k|    if (s->wrap == 2) {
  ------------------
  |  Branch (1287:9): [True: 4.22k, False: 0]
  ------------------
 1288|  4.22k|        put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1289|  4.22k|        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1290|  4.22k|        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1291|  4.22k|        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1292|  4.22k|        put_byte(s, (Byte)(strm->total_in & 0xff));
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1293|  4.22k|        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1294|  4.22k|        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1295|  4.22k|        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
  ------------------
  |  |  293|  4.22k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1296|  4.22k|    }
 1297|      0|    else
 1298|      0|#endif
 1299|      0|    {
 1300|      0|        putShortMSB(s, (uInt)(strm->adler >> 16));
 1301|      0|        putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1302|      0|    }
 1303|  4.22k|    flush_pending(strm);
 1304|       |    /* If avail_out is zero, the application will call deflate again
 1305|       |     * to flush the rest.
 1306|       |     */
 1307|  4.22k|    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
  ------------------
  |  Branch (1307:9): [True: 4.22k, False: 0]
  ------------------
 1308|  4.22k|    return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  181|    148|#define Z_OK            0
  ------------------
                  return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  182|  4.08k|#define Z_STREAM_END    1
  ------------------
  |  Branch (1308:12): [True: 148, False: 4.08k]
  ------------------
 1309|  8.60k|}
deflateEnd:
 1312|  4.22k|int ZEXPORT deflateEnd(z_streamp strm) {
 1313|  4.22k|    int status;
 1314|       |
 1315|  4.22k|    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (1315:9): [True: 0, False: 4.22k]
  ------------------
 1316|       |
 1317|  4.22k|    status = strm->state->status;
 1318|       |
 1319|       |    /* Deallocate in reverse order of allocations: */
 1320|  4.22k|    TRY_FREE(strm, strm->state->pending_buf);
  ------------------
  |  |  345|  4.22k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  344|  4.22k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (345:29): [True: 4.22k, False: 0]
  |  |  ------------------
  ------------------
 1321|  4.22k|    TRY_FREE(strm, strm->state->head);
  ------------------
  |  |  345|  4.22k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  344|  4.22k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (345:29): [True: 4.22k, False: 0]
  |  |  ------------------
  ------------------
 1322|  4.22k|    TRY_FREE(strm, strm->state->prev);
  ------------------
  |  |  345|  4.22k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  344|  4.22k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (345:29): [True: 4.22k, False: 0]
  |  |  ------------------
  ------------------
 1323|  4.22k|    TRY_FREE(strm, strm->state->window);
  ------------------
  |  |  345|  4.22k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  344|  4.22k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (345:29): [True: 4.22k, False: 0]
  |  |  ------------------
  ------------------
 1324|       |
 1325|  4.22k|    ZFREE(strm, strm->state);
  ------------------
  |  |  344|  4.22k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1326|  4.22k|    strm->state = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1327|       |
 1328|  4.22k|    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
  ------------------
  |  |   66|  4.22k|#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.22k|#define Z_OK            0
  ------------------
  |  Branch (1328:12): [True: 0, False: 4.22k]
  ------------------
 1329|  4.22k|}
deflate.c:deflateStateCheck:
  537|  64.2k|local int deflateStateCheck(z_streamp strm) {
  538|  64.2k|    deflate_state *s;
  539|  64.2k|    if (strm == Z_NULL ||
  ------------------
  |  |  216|   128k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (539:9): [True: 0, False: 64.2k]
  ------------------
  540|  64.2k|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (540:9): [True: 0, False: 64.2k]
  |  Branch (540:42): [True: 0, False: 64.2k]
  ------------------
  541|      0|        return 1;
  542|  64.2k|    s = strm->state;
  543|  64.2k|    if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |  216|   128k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |   58|   128k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (543:9): [True: 0, False: 64.2k]
  |  Branch (543:24): [True: 0, False: 64.2k]
  |  Branch (543:44): [True: 59.9k, False: 4.22k]
  ------------------
  544|  59.9k|#ifdef GZIP
  545|  59.9k|                                           s->status != GZIP_STATE &&
  ------------------
  |  |   60|   124k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (545:44): [True: 55.7k, False: 4.22k]
  ------------------
  546|  55.7k|#endif
  547|  55.7k|                                           s->status != EXTRA_STATE &&
  ------------------
  |  |   62|   119k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (547:44): [True: 55.7k, False: 0]
  ------------------
  548|  55.7k|                                           s->status != NAME_STATE &&
  ------------------
  |  |   63|   119k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (548:44): [True: 55.7k, False: 0]
  ------------------
  549|  55.7k|                                           s->status != COMMENT_STATE &&
  ------------------
  |  |   64|   119k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (549:44): [True: 55.7k, False: 0]
  ------------------
  550|  55.7k|                                           s->status != HCRC_STATE &&
  ------------------
  |  |   65|   119k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (550:44): [True: 55.7k, False: 0]
  ------------------
  551|  55.7k|                                           s->status != BUSY_STATE &&
  ------------------
  |  |   66|   119k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
  |  Branch (551:44): [True: 10.1k, False: 45.6k]
  ------------------
  552|  10.1k|                                           s->status != FINISH_STATE))
  ------------------
  |  |   67|  10.1k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (552:44): [True: 0, False: 10.1k]
  ------------------
  553|      0|        return 1;
  554|  64.2k|    return 0;
  555|  64.2k|}
deflate.c:fill_window:
  252|   472k|local void fill_window(deflate_state *s) {
  253|   472k|    unsigned n;
  254|   472k|    unsigned more;    /* Amount of free space at the end of the window. */
  255|   472k|    uInt wsize = s->w_size;
  256|       |
  257|   472k|    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
  258|       |
  259|   472k|    do {
  260|   472k|        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|   472k|        if (sizeof(int) <= 2) {
  ------------------
  |  Branch (267:13): [Folded, False: 472k]
  ------------------
  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|   472k|        if (s->strstart >= wsize + MAX_DIST(s)) {
  ------------------
  |  |  301|   472k|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|   472k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|   472k|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|   472k|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (285:13): [True: 5.90k, False: 466k]
  ------------------
  286|       |
  287|  5.90k|            zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more);
  ------------------
  |  |  306|  5.90k|#    define zmemcpy memcpy
  ------------------
  288|  5.90k|            s->match_start -= wsize;
  289|  5.90k|            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
  290|  5.90k|            s->block_start -= (long) wsize;
  291|  5.90k|            if (s->insert > s->strstart)
  ------------------
  |  Branch (291:17): [True: 0, False: 5.90k]
  ------------------
  292|      0|                s->insert = s->strstart;
  293|  5.90k|            slide_hash(s);
  294|  5.90k|            more += wsize;
  295|  5.90k|        }
  296|   472k|        if (s->strm->avail_in == 0) break;
  ------------------
  |  Branch (296:13): [True: 453k, False: 18.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|  18.7k|        Assert(more >= 2, "more < 2");
  310|       |
  311|  18.7k|        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
  312|  18.7k|        s->lookahead += n;
  313|       |
  314|       |        /* Initialize the hash value now that we have some input: */
  315|  18.7k|        if (s->lookahead + s->insert >= MIN_MATCH) {
  ------------------
  |  |  182|  18.7k|#define MIN_MATCH  3
  ------------------
  |  Branch (315:13): [True: 18.7k, False: 67]
  ------------------
  316|  18.7k|            uInt str = s->strstart - s->insert;
  317|  18.7k|            s->ins_h = s->window[str];
  318|  18.7k|            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
  ------------------
  |  |  141|  18.7k|#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|  18.7k|            while (s->insert) {
  ------------------
  |  Branch (322:20): [True: 0, False: 18.7k]
  ------------------
  323|      0|                UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
  ------------------
  |  |  141|      0|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  ------------------
  324|      0|#ifndef FASTEST
  325|      0|                s->prev[str & s->w_mask] = s->head[s->ins_h];
  326|      0|#endif
  327|      0|                s->head[s->ins_h] = (Pos)str;
  328|      0|                str++;
  329|      0|                s->insert--;
  330|      0|                if (s->lookahead + s->insert < MIN_MATCH)
  ------------------
  |  |  182|      0|#define MIN_MATCH  3
  ------------------
  |  Branch (330:21): [True: 0, False: 0]
  ------------------
  331|      0|                    break;
  332|      0|            }
  333|  18.7k|        }
  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|  18.7k|    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
  ------------------
  |  |  296|  37.5k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |  183|  18.7k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |  182|  18.7k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (338:14): [True: 1.74k, False: 17.0k]
  |  Branch (338:46): [True: 0, False: 1.74k]
  ------------------
  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|   472k|    if (s->high_water < s->window_size) {
  ------------------
  |  Branch (347:9): [True: 367k, False: 105k]
  ------------------
  348|   367k|        ulg curr = s->strstart + (ulg)(s->lookahead);
  349|   367k|        ulg init;
  350|       |
  351|   367k|        if (s->high_water < curr) {
  ------------------
  |  Branch (351:13): [True: 7.40k, False: 359k]
  ------------------
  352|       |            /* Previous high water mark below current data -- zero WIN_INIT
  353|       |             * bytes or up to end of window, whichever is less.
  354|       |             */
  355|  7.40k|            init = s->window_size - curr;
  356|  7.40k|            if (init > WIN_INIT)
  ------------------
  |  |  306|  7.40k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |  183|  7.40k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (356:17): [True: 6.68k, False: 713]
  ------------------
  357|  6.68k|                init = WIN_INIT;
  ------------------
  |  |  306|  6.68k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |  183|  6.68k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  358|  7.40k|            zmemzero(s->window + curr, (unsigned)init);
  ------------------
  |  |  308|  7.40k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  359|  7.40k|            s->high_water = curr + init;
  360|  7.40k|        }
  361|   359k|        else if (s->high_water < (ulg)curr + WIN_INIT) {
  ------------------
  |  |  306|   359k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |  183|   359k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (361:18): [True: 379, False: 359k]
  ------------------
  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|    379|            init = (ulg)curr + WIN_INIT - s->high_water;
  ------------------
  |  |  306|    379|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |  183|    379|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  367|    379|            if (init > s->window_size - s->high_water)
  ------------------
  |  Branch (367:17): [True: 0, False: 379]
  ------------------
  368|      0|                init = s->window_size - s->high_water;
  369|    379|            zmemzero(s->window + s->high_water, (unsigned)init);
  ------------------
  |  |  308|    379|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  370|    379|            s->high_water += init;
  371|    379|        }
  372|   367k|    }
  373|       |
  374|   472k|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
  375|   472k|           "not enough room for search");
  376|   472k|}
deflate.c:read_buf:
  219|  18.7k|local unsigned read_buf(z_streamp strm, Bytef *buf, unsigned size) {
  220|  18.7k|    unsigned len = strm->avail_in;
  221|       |
  222|  18.7k|    if (len > size) len = size;
  ------------------
  |  Branch (222:9): [True: 0, False: 18.7k]
  ------------------
  223|  18.7k|    if (len == 0) return 0;
  ------------------
  |  Branch (223:9): [True: 0, False: 18.7k]
  ------------------
  224|       |
  225|  18.7k|    strm->avail_in  -= len;
  226|       |
  227|  18.7k|    zmemcpy(buf, strm->next_in, len);
  ------------------
  |  |  306|  18.7k|#    define zmemcpy memcpy
  ------------------
  228|  18.7k|    if (strm->state->wrap == 1) {
  ------------------
  |  Branch (228:9): [True: 0, False: 18.7k]
  ------------------
  229|      0|        strm->adler = adler32(strm->adler, buf, len);
  230|      0|    }
  231|  18.7k|#ifdef GZIP
  232|  18.7k|    else if (strm->state->wrap == 2) {
  ------------------
  |  Branch (232:14): [True: 18.7k, False: 0]
  ------------------
  233|  18.7k|        strm->adler = crc32(strm->adler, buf, len);
  234|  18.7k|    }
  235|  18.7k|#endif
  236|  18.7k|    strm->next_in  += len;
  237|  18.7k|    strm->total_in += len;
  238|       |
  239|  18.7k|    return len;
  240|  18.7k|}
deflate.c:lm_init:
  695|  4.22k|local void lm_init(deflate_state *s) {
  696|  4.22k|    s->window_size = (ulg)2L*s->w_size;
  697|       |
  698|  4.22k|    CLEAR_HASH(s);
  ------------------
  |  |  171|  4.22k|    do { \
  |  |  172|  4.22k|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|  4.22k|#define NIL 0
  |  |  ------------------
  |  |  173|  4.22k|        zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  ------------------
  |  |  |  |  308|  4.22k|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|  4.22k|        s->slid = 0; \
  |  |  175|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  699|  4.22k|    s->matches = 0;             /* the hash is clear */
  700|       |
  701|       |    /* Set the default configuration parameters:
  702|       |     */
  703|  4.22k|    s->max_lazy_match   = configuration_table[s->level].max_lazy;
  704|  4.22k|    s->good_match       = configuration_table[s->level].good_length;
  705|  4.22k|    s->nice_match       = configuration_table[s->level].nice_length;
  706|  4.22k|    s->max_chain_length = configuration_table[s->level].max_chain;
  707|       |
  708|  4.22k|    s->strstart = 0;
  709|  4.22k|    s->block_start = 0L;
  710|  4.22k|    s->lookahead = 0;
  711|  4.22k|    s->insert = 0;
  712|  4.22k|    s->match_length = s->prev_length = MIN_MATCH-1;
  ------------------
  |  |  182|  4.22k|#define MIN_MATCH  3
  ------------------
  713|  4.22k|    s->match_available = 0;
  714|  4.22k|    s->ins_h = 0;
  715|  4.22k|}
deflate.c:longest_match:
 1418|  34.9M|local uInt longest_match(deflate_state *s, IPos cur_match) {
 1419|  34.9M|    unsigned chain_length = s->max_chain_length;/* max hash chain length */
 1420|  34.9M|    Bytef *scan = s->window + s->strstart;      /* current string */
 1421|  34.9M|    Bytef *match;                               /* matched string */
 1422|  34.9M|    int len;                                    /* length of current match */
 1423|  34.9M|    int best_len = (int)s->prev_length;         /* best match length so far */
 1424|  34.9M|    int nice_match = s->nice_match;             /* stop if match long enough */
 1425|  34.9M|    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
  ------------------
  |  |  301|  34.9M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  34.9M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|  34.9M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  34.9M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1425:18): [True: 28.0M, False: 6.86M]
  ------------------
 1426|  28.0M|        s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |  301|  28.0M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  28.0M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|  28.0M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  28.0M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |   85|  6.86M|#define NIL 0
  ------------------
 1427|       |    /* Stop when cur_match becomes <= limit. To simplify the code,
 1428|       |     * we prevent matches with the string of window index 0.
 1429|       |     */
 1430|  34.9M|    Posf *prev = s->prev;
 1431|  34.9M|    uInt wmask = s->w_mask;
 1432|       |
 1433|       |#ifdef UNALIGNED_OK
 1434|       |    /* Compare two bytes at a time. Note: this is not always beneficial.
 1435|       |     * Try with and without -DUNALIGNED_OK to check.
 1436|       |     */
 1437|       |    Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
 1438|       |    ush scan_start = *(ushf*)scan;
 1439|       |    ush scan_end   = *(ushf*)(scan + best_len - 1);
 1440|       |#else
 1441|  34.9M|    Bytef *strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |  183|  34.9M|#define MAX_MATCH  258
  ------------------
 1442|  34.9M|    Byte scan_end1  = scan[best_len - 1];
 1443|  34.9M|    Byte scan_end   = scan[best_len];
 1444|  34.9M|#endif
 1445|       |
 1446|       |    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
 1447|       |     * It is easy to get rid of this optimization if necessary.
 1448|       |     */
 1449|  34.9M|    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
 1450|       |
 1451|       |    /* Do not waste too much time if we already have a good match: */
 1452|  34.9M|    if (s->prev_length >= s->good_match) {
  ------------------
  |  Branch (1452:9): [True: 201k, False: 34.6M]
  ------------------
 1453|   201k|        chain_length >>= 2;
 1454|   201k|    }
 1455|       |    /* Do not look for matches beyond the end of the input. This is necessary
 1456|       |     * to make deflate deterministic.
 1457|       |     */
 1458|  34.9M|    if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
  ------------------
  |  Branch (1458:9): [True: 61.2k, False: 34.8M]
  ------------------
 1459|       |
 1460|  34.9M|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
 1461|  34.9M|           "need lookahead");
 1462|       |
 1463|   269M|    do {
 1464|   269M|        Assert(cur_match < s->strstart, "no future");
 1465|   269M|        match = s->window + cur_match;
 1466|       |
 1467|       |        /* Skip to next match if the match length cannot increase
 1468|       |         * or if the match length is less than 2.  Note that the checks below
 1469|       |         * for insufficient lookahead only occur occasionally for performance
 1470|       |         * reasons.  Therefore uninitialized memory will be accessed, and
 1471|       |         * conditional jumps will be made that depend on those values.
 1472|       |         * However the length of the match is limited to the lookahead, so
 1473|       |         * the output of deflate is not affected by the uninitialized values.
 1474|       |         */
 1475|       |#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
 1476|       |        /* This code assumes sizeof(unsigned short) == 2. Do not use
 1477|       |         * UNALIGNED_OK if your compiler uses a different size.
 1478|       |         */
 1479|       |        if (*(ushf*)(match + best_len - 1) != scan_end ||
 1480|       |            *(ushf*)match != scan_start) continue;
 1481|       |
 1482|       |        /* It is not necessary to compare scan[2] and match[2] since they are
 1483|       |         * always equal when the other bytes match, given that the hash keys
 1484|       |         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
 1485|       |         * strstart + 3, + 5, up to strstart + 257. We check for insufficient
 1486|       |         * lookahead only every 4th comparison; the 128th check will be made
 1487|       |         * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is
 1488|       |         * necessary to put more guard bytes at the end of the window, or
 1489|       |         * to check more often for insufficient lookahead.
 1490|       |         */
 1491|       |        Assert(scan[2] == match[2], "scan[2]?");
 1492|       |        scan++, match++;
 1493|       |        do {
 1494|       |        } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1495|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1496|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1497|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1498|       |                 scan < strend);
 1499|       |        /* The funny "do {}" generates better code on most compilers */
 1500|       |
 1501|       |        /* Here, scan <= window + strstart + 257 */
 1502|       |        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1503|       |               "wild scan");
 1504|       |        if (*scan == *match) scan++;
 1505|       |
 1506|       |        len = (MAX_MATCH - 1) - (int)(strend - scan);
 1507|       |        scan = strend - (MAX_MATCH-1);
 1508|       |
 1509|       |#else /* UNALIGNED_OK */
 1510|       |
 1511|   269M|        if (match[best_len]     != scan_end  ||
  ------------------
  |  Branch (1511:13): [True: 220M, False: 48.8M]
  ------------------
 1512|  48.8M|            match[best_len - 1] != scan_end1 ||
  ------------------
  |  Branch (1512:13): [True: 26.4M, False: 22.3M]
  ------------------
 1513|  22.3M|            *match              != *scan     ||
  ------------------
  |  Branch (1513:13): [True: 3.84M, False: 18.5M]
  ------------------
 1514|   251M|            *++match            != scan[1])      continue;
  ------------------
  |  Branch (1514:13): [True: 2.98k, False: 18.5M]
  ------------------
 1515|       |
 1516|       |        /* The check at best_len - 1 can be removed because it will be made
 1517|       |         * again later. (This heuristic is not always a win.)
 1518|       |         * It is not necessary to compare scan[2] and match[2] since they
 1519|       |         * are always equal when the other bytes match, given that
 1520|       |         * the hash keys are equal and that HASH_BITS >= 8.
 1521|       |         */
 1522|  18.5M|        scan += 2, match++;
 1523|  18.5M|        Assert(*scan == *match, "match[2]?");
 1524|       |
 1525|       |        /* We check for insufficient lookahead only every 8th comparison;
 1526|       |         * the 256th check will be made at strstart + 258.
 1527|       |         */
 1528|  28.4M|        do {
 1529|  28.4M|        } while (*++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1529:18): [True: 18.7M, False: 9.71M]
  |  Branch (1529:41): [True: 14.2M, False: 4.50M]
  ------------------
 1530|  14.2M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1530:18): [True: 12.2M, False: 1.92M]
  |  Branch (1530:41): [True: 11.3M, False: 944k]
  ------------------
 1531|  11.3M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1531:18): [True: 10.7M, False: 572k]
  |  Branch (1531:41): [True: 10.4M, False: 287k]
  ------------------
 1532|  10.4M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1532:18): [True: 10.1M, False: 309k]
  |  Branch (1532:41): [True: 9.95M, False: 207k]
  ------------------
 1533|  9.95M|                 scan < strend);
  ------------------
  |  Branch (1533:18): [True: 9.87M, False: 78.0k]
  ------------------
 1534|       |
 1535|  18.5M|        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1536|  18.5M|               "wild scan");
 1537|       |
 1538|  18.5M|        len = MAX_MATCH - (int)(strend - scan);
  ------------------
  |  |  183|  18.5M|#define MAX_MATCH  258
  ------------------
 1539|  18.5M|        scan = strend - MAX_MATCH;
  ------------------
  |  |  183|  18.5M|#define MAX_MATCH  258
  ------------------
 1540|       |
 1541|  18.5M|#endif /* UNALIGNED_OK */
 1542|       |
 1543|  18.5M|        if (len > best_len) {
  ------------------
  |  Branch (1543:13): [True: 14.3M, False: 4.18M]
  ------------------
 1544|  14.3M|            s->match_start = cur_match;
 1545|  14.3M|            best_len = len;
 1546|  14.3M|            if (len >= nice_match) break;
  ------------------
  |  Branch (1546:17): [True: 108k, False: 14.2M]
  ------------------
 1547|       |#ifdef UNALIGNED_OK
 1548|       |            scan_end = *(ushf*)(scan + best_len - 1);
 1549|       |#else
 1550|  14.2M|            scan_end1  = scan[best_len - 1];
 1551|  14.2M|            scan_end   = scan[best_len];
 1552|  14.2M|#endif
 1553|  14.2M|        }
 1554|   269M|    } while ((cur_match = prev[cur_match & wmask]) > limit
  ------------------
  |  Branch (1554:14): [True: 235M, False: 34.3M]
  ------------------
 1555|   235M|             && --chain_length != 0);
  ------------------
  |  Branch (1555:17): [True: 234M, False: 437k]
  ------------------
 1556|       |
 1557|  34.9M|    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
  ------------------
  |  Branch (1557:9): [True: 34.9M, False: 737]
  ------------------
 1558|    737|    return s->lookahead;
 1559|  34.9M|}
deflate.c:deflate_slow:
 1991|  11.3k|local block_state deflate_slow(deflate_state *s, int flush) {
 1992|  11.3k|    IPos hash_head;          /* head of hash chain */
 1993|  11.3k|    int bflush;              /* set if current block must be flushed */
 1994|       |
 1995|       |    /* Process the input block. */
 1996|  60.1M|    for (;;) {
 1997|       |        /* Make sure that we always have enough lookahead, except
 1998|       |         * at the end of the input file. We need MAX_MATCH bytes
 1999|       |         * for the next match, plus MIN_MATCH bytes to insert the
 2000|       |         * string following the next match.
 2001|       |         */
 2002|  60.1M|        if (s->lookahead < MIN_LOOKAHEAD) {
  ------------------
  |  |  296|  60.1M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |  183|  60.1M|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |  182|  60.1M|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (2002:13): [True: 299k, False: 59.8M]
  ------------------
 2003|   299k|            fill_window(s);
 2004|   299k|            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  296|   599k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |  183|   299k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |  182|   299k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
                          if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|   292k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2004:17): [True: 292k, False: 7.09k]
  |  Branch (2004:49): [True: 6.27k, False: 286k]
  ------------------
 2005|  6.27k|                return need_more;
 2006|  6.27k|            }
 2007|   293k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (2007:17): [True: 2.23k, False: 291k]
  ------------------
 2008|   293k|        }
 2009|       |
 2010|       |        /* Insert the string window[strstart .. strstart + 2] in the
 2011|       |         * dictionary, and set hash_head to the head of the hash chain:
 2012|       |         */
 2013|  60.1M|        hash_head = NIL;
  ------------------
  |  |   85|  60.1M|#define NIL 0
  ------------------
 2014|  60.1M|        if (s->lookahead >= MIN_MATCH) {
  ------------------
  |  |  182|  60.1M|#define MIN_MATCH  3
  ------------------
  |  Branch (2014:13): [True: 60.1M, False: 2.81k]
  ------------------
 2015|  60.1M|            INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  60.1M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  60.1M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  60.1M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  60.1M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 2016|  60.1M|        }
 2017|       |
 2018|       |        /* Find the longest match, discarding those <= prev_length.
 2019|       |         */
 2020|  60.1M|        s->prev_length = s->match_length, s->prev_match = s->match_start;
 2021|  60.1M|        s->match_length = MIN_MATCH-1;
  ------------------
  |  |  182|  60.1M|#define MIN_MATCH  3
  ------------------
 2022|       |
 2023|  60.1M|        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
  ------------------
  |  |   85|   120M|#define NIL 0
  ------------------
  |  Branch (2023:13): [True: 40.8M, False: 19.3M]
  |  Branch (2023:33): [True: 40.4M, False: 320k]
  ------------------
 2024|  40.4M|            s->strstart - hash_head <= MAX_DIST(s)) {
  ------------------
  |  |  301|  40.4M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  40.4M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|  40.4M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  40.4M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2024:13): [True: 34.9M, False: 5.59M]
  ------------------
 2025|       |            /* To simplify the code, we prevent matches with the string
 2026|       |             * of window index 0 (in particular we have to avoid a match
 2027|       |             * of the string with itself at the start of the input file).
 2028|       |             */
 2029|  34.9M|            s->match_length = longest_match (s, hash_head);
 2030|       |            /* longest_match() sets match_start */
 2031|       |
 2032|  34.9M|            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
  ------------------
  |  |  200|  65.3M|#define Z_FILTERED            1
  ------------------
  |  Branch (2032:17): [True: 32.6M, False: 2.20M]
  |  Branch (2032:42): [True: 12.9M, False: 19.7M]
  ------------------
 2033|  19.7M|#if TOO_FAR <= 32767
 2034|  19.7M|                || (s->match_length == MIN_MATCH &&
  ------------------
  |  |  182|  39.4M|#define MIN_MATCH  3
  ------------------
  |  Branch (2034:21): [True: 3.38M, False: 16.3M]
  ------------------
 2035|  3.38M|                    s->strstart - s->match_start > TOO_FAR)
  ------------------
  |  |   89|  3.38M|#  define TOO_FAR 4096
  ------------------
  |  Branch (2035:21): [True: 1.20M, False: 2.18M]
  ------------------
 2036|  32.6M|#endif
 2037|  32.6M|                )) {
 2038|       |
 2039|       |                /* If prev_match is also MIN_MATCH, match_start is garbage
 2040|       |                 * but we will ignore the current match anyway.
 2041|       |                 */
 2042|  14.1M|                s->match_length = MIN_MATCH-1;
  ------------------
  |  |  182|  14.1M|#define MIN_MATCH  3
  ------------------
 2043|  14.1M|            }
 2044|  34.9M|        }
 2045|       |        /* If there was a match at the previous step and the current
 2046|       |         * match is not better, output the previous match:
 2047|       |         */
 2048|  60.1M|        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
  ------------------
  |  |  182|   120M|#define MIN_MATCH  3
  ------------------
  |  Branch (2048:13): [True: 5.36M, False: 54.7M]
  |  Branch (2048:44): [True: 4.51M, False: 849k]
  ------------------
 2049|  4.51M|            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
  ------------------
  |  |  182|  4.51M|#define MIN_MATCH  3
  ------------------
 2050|       |            /* Do not insert strings in hash table beyond this. */
 2051|       |
 2052|  4.51M|            check_match(s, s->strstart - 1, s->prev_match,
 2053|  4.51M|                        (int)s->prev_length);
 2054|       |
 2055|  4.51M|            _tr_tally_dist(s, s->strstart - 1 - s->prev_match,
  ------------------
  |  |  366|  4.51M|  { uch len = (uch)(length); \
  |  |  367|  4.51M|    ush dist = (ush)(distance); \
  |  |  368|  4.51M|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  369|  4.51M|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  370|  4.51M|    s->sym_buf[s->sym_next++] = len; \
  |  |  371|  4.51M|    dist--; \
  |  |  372|  4.51M|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|  4.51M|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  4.51M|#define Freq fc.freq
  |  |  ------------------
  |  |  373|  4.51M|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  321|  4.51M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 987k, False: 3.52M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  4.51M|#define Freq fc.freq
  |  |  ------------------
  |  |  374|  4.51M|    flush = (s->sym_next == s->sym_end); \
  |  |  375|  4.51M|  }
  ------------------
 2056|  4.51M|                           s->prev_length - MIN_MATCH, bflush);
 2057|       |
 2058|       |            /* Insert in hash table all strings up to the end of the match.
 2059|       |             * strstart - 1 and strstart are already inserted. If there is not
 2060|       |             * enough lookahead, the last two strings are not inserted in
 2061|       |             * the hash table.
 2062|       |             */
 2063|  4.51M|            s->lookahead -= s->prev_length - 1;
 2064|  4.51M|            s->prev_length -= 2;
 2065|  42.9M|            do {
 2066|  42.9M|                if (++s->strstart <= max_insert) {
  ------------------
  |  Branch (2066:21): [True: 42.9M, False: 1.63k]
  ------------------
 2067|  42.9M|                    INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  42.9M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  42.9M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  42.9M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  42.9M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 2068|  42.9M|                }
 2069|  42.9M|            } while (--s->prev_length != 0);
  ------------------
  |  Branch (2069:22): [True: 38.4M, False: 4.51M]
  ------------------
 2070|  4.51M|            s->match_available = 0;
 2071|  4.51M|            s->match_length = MIN_MATCH-1;
  ------------------
  |  |  182|  4.51M|#define MIN_MATCH  3
  ------------------
 2072|  4.51M|            s->strstart++;
 2073|       |
 2074|  4.51M|            if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1671|    413|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|    413|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|    413|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|    413|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 310, False: 103]
  |  |  |  |  ------------------
  |  |  |  | 1661|    413|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|    413|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    103|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|    413|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|    413|                (last)); \
  |  |  |  | 1665|    413|   s->block_start = s->strstart; \
  |  |  |  | 1666|    413|   flush_pending(s->strm); \
  |  |  |  | 1667|    413|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|    413|}
  |  |  ------------------
  |  | 1673|    413|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 407, False: 6]
  |  |  ------------------
  |  | 1674|    407|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [True: 407, Folded]
  |  |  ------------------
  |  | 1675|    407|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 0, False: 0]
  |  |  |  Branch (1675:30): [True: 0, False: 0]
  |  |  ------------------
  |  | 1676|      0|   } \
  |  | 1677|    413|}
  ------------------
  |  Branch (2074:17): [True: 413, False: 4.51M]
  ------------------
 2075|       |
 2076|  55.6M|        } else if (s->match_available) {
  ------------------
  |  Branch (2076:20): [True: 51.1M, False: 4.51M]
  ------------------
 2077|       |            /* If there was no match at the previous position, output a
 2078|       |             * single literal. If there was a match but the current match
 2079|       |             * is longer, truncate the previous match to a single literal.
 2080|       |             */
 2081|  51.1M|            Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2082|  51.1M|            _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  358|  51.1M|  { uch cc = (c); \
  |  |  359|  51.1M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  51.1M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  51.1M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  51.1M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  51.1M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  51.1M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  51.1M|   }
  ------------------
 2083|  51.1M|            if (bflush) {
  ------------------
  |  Branch (2083:17): [True: 2.46k, False: 51.0M]
  ------------------
 2084|  2.46k|                FLUSH_BLOCK_ONLY(s, 0);
  ------------------
  |  | 1659|  2.46k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  | 1660|  2.46k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  ------------------
  |  |  |  Branch (1660:24): [True: 2.31k, False: 154]
  |  |  ------------------
  |  | 1661|  2.46k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  | 1662|  2.46k|                   (charf *)Z_NULL), \
  |  |  ------------------
  |  |  |  |  216|    154|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  ------------------
  |  | 1663|  2.46k|                (ulg)((long)s->strstart - s->block_start), \
  |  | 1664|  2.46k|                (last)); \
  |  | 1665|  2.46k|   s->block_start = s->strstart; \
  |  | 1666|  2.46k|   flush_pending(s->strm); \
  |  | 1667|  2.46k|   Tracev((stderr,"[FLUSH]")); \
  |  | 1668|  2.46k|}
  ------------------
 2085|  2.46k|            }
 2086|  51.1M|            s->strstart++;
 2087|  51.1M|            s->lookahead--;
 2088|  51.1M|            if (s->strm->avail_out == 0) return need_more;
  ------------------
  |  Branch (2088:17): [True: 2.45k, False: 51.0M]
  ------------------
 2089|  51.1M|        } else {
 2090|       |            /* There is no previous match to compare with, wait for
 2091|       |             * the next step to decide.
 2092|       |             */
 2093|  4.51M|            s->match_available = 1;
 2094|  4.51M|            s->strstart++;
 2095|  4.51M|            s->lookahead--;
 2096|  4.51M|        }
 2097|  60.1M|    }
 2098|  2.23k|    Assert (flush != Z_NO_FLUSH, "no flush?");
 2099|  2.23k|    if (s->match_available) {
  ------------------
  |  Branch (2099:9): [True: 1.39k, False: 836]
  ------------------
 2100|  1.39k|        Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2101|  1.39k|        _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  358|  1.39k|  { uch cc = (c); \
  |  |  359|  1.39k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  1.39k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  1.39k|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  1.39k|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  1.39k|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  1.39k|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  1.39k|   }
  ------------------
 2102|  1.39k|        s->match_available = 0;
 2103|  1.39k|    }
 2104|  2.23k|    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |  182|  2.23k|#define MIN_MATCH  3
  ------------------
                  s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |  182|  2.21k|#define MIN_MATCH  3
  ------------------
  |  Branch (2104:17): [True: 15, False: 2.21k]
  ------------------
 2105|  2.23k|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|  2.23k|#define Z_FINISH        4
  ------------------
  |  Branch (2105:9): [True: 2.23k, False: 0]
  ------------------
 2106|  2.23k|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1671|  2.23k|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|  2.23k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|  2.23k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|  2.23k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 2.15k, False: 72]
  |  |  |  |  ------------------
  |  |  |  | 1661|  2.23k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|  2.23k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     72|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|  2.23k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|  2.23k|                (last)); \
  |  |  |  | 1665|  2.23k|   s->block_start = s->strstart; \
  |  |  |  | 1666|  2.23k|   flush_pending(s->strm); \
  |  |  |  | 1667|  2.23k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|  2.23k|}
  |  |  ------------------
  |  | 1673|  2.23k|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 795, False: 1.43k]
  |  |  ------------------
  |  | 1674|    795|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [Folded, False: 795]
  |  |  ------------------
  |  | 1675|    795|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 780, False: 15]
  |  |  |  Branch (1675:30): [True: 15, False: 0]
  |  |  ------------------
  |  | 1676|    795|   } \
  |  | 1677|  2.23k|}
  ------------------
 2107|  1.43k|        return finish_done;
 2108|  2.23k|    }
 2109|      0|    if (s->sym_next)
  ------------------
  |  Branch (2109:9): [True: 0, False: 0]
  ------------------
 2110|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1671|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1661|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|      0|                (last)); \
  |  |  |  | 1665|      0|   s->block_start = s->strstart; \
  |  |  |  | 1666|      0|   flush_pending(s->strm); \
  |  |  |  | 1667|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|      0|}
  |  |  ------------------
  |  | 1673|      0|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1674|      0|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [True: 0, Folded]
  |  |  ------------------
  |  | 1675|      0|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 0, False: 0]
  |  |  |  Branch (1675:30): [True: 0, False: 0]
  |  |  ------------------
  |  | 1676|      0|   } \
  |  | 1677|      0|}
  ------------------
 2111|      0|    return block_done;
 2112|      0|}
deflate.c:slide_hash:
  187|  5.90k|local void slide_hash(deflate_state *s) {
  188|  5.90k|    unsigned n, m;
  189|  5.90k|    Posf *p;
  190|  5.90k|    uInt wsize = s->w_size;
  191|       |
  192|  5.90k|    n = s->hash_size;
  193|  5.90k|    p = &s->head[n];
  194|   193M|    do {
  195|   193M|        m = *--p;
  196|   193M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|   171M|#define NIL 0
  ------------------
  |  Branch (196:20): [True: 22.3M, False: 171M]
  ------------------
  197|   193M|    } while (--n);
  ------------------
  |  Branch (197:14): [True: 193M, False: 5.90k]
  ------------------
  198|  5.90k|#ifndef FASTEST
  199|  5.90k|    n = wsize;
  200|  5.90k|    p = &s->prev[n];
  201|   193M|    do {
  202|   193M|        m = *--p;
  203|   193M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|   145M|#define NIL 0
  ------------------
  |  Branch (203:20): [True: 47.9M, False: 145M]
  ------------------
  204|       |        /* If n is not on any hash chain, prev[n] is garbage but
  205|       |         * its value will never be used.
  206|       |         */
  207|   193M|    } while (--n);
  ------------------
  |  Branch (207:14): [True: 193M, False: 5.90k]
  ------------------
  208|  5.90k|#endif
  209|  5.90k|    s->slid = 1;
  210|  5.90k|}
deflate.c:flush_pending:
  969|  43.2k|local void flush_pending(z_streamp strm) {
  970|  43.2k|    unsigned len;
  971|  43.2k|    deflate_state *s = strm->state;
  972|       |
  973|  43.2k|    _tr_flush_bits(s);
  974|  43.2k|    len = s->pending > strm->avail_out ? strm->avail_out :
  ------------------
  |  Branch (974:11): [True: 19.3k, False: 23.8k]
  ------------------
  975|  43.2k|                                         (unsigned)s->pending;
  976|  43.2k|    if (len == 0) return;
  ------------------
  |  Branch (976:9): [True: 0, False: 43.2k]
  ------------------
  977|       |
  978|  43.2k|    zmemcpy(strm->next_out, s->pending_out, len);
  ------------------
  |  |  306|  43.2k|#    define zmemcpy memcpy
  ------------------
  979|  43.2k|    strm->next_out  += len;
  980|  43.2k|    s->pending_out  += len;
  981|  43.2k|    strm->total_out += len;
  982|  43.2k|    strm->avail_out -= len;
  983|  43.2k|    s->pending      -= len;
  984|  43.2k|    if (s->pending == 0) {
  ------------------
  |  Branch (984:9): [True: 23.8k, False: 19.3k]
  ------------------
  985|  23.8k|        s->pending_out = s->pending_buf;
  986|  23.8k|    }
  987|  43.2k|}
deflate.c:deflate_rle:
 2120|  6.21k|local block_state deflate_rle(deflate_state *s, int flush) {
 2121|  6.21k|    int bflush;             /* set if current block must be flushed */
 2122|  6.21k|    uInt prev;              /* byte at distance one to match */
 2123|  6.21k|    Bytef *scan, *strend;   /* scan goes up to strend for length of run */
 2124|       |
 2125|  43.8M|    for (;;) {
 2126|       |        /* Make sure that we always have enough lookahead, except
 2127|       |         * at the end of the input file. We need MAX_MATCH bytes
 2128|       |         * for the longest run, plus one for the unrolled loop.
 2129|       |         */
 2130|  43.8M|        if (s->lookahead <= MAX_MATCH) {
  ------------------
  |  |  183|  43.8M|#define MAX_MATCH  258
  ------------------
  |  Branch (2130:13): [True: 158k, False: 43.6M]
  ------------------
 2131|   158k|            fill_window(s);
 2132|   158k|            if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
  ------------------
  |  |  183|   317k|#define MAX_MATCH  258
  ------------------
                          if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|   155k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2132:17): [True: 155k, False: 3.72k]
  |  Branch (2132:46): [True: 3.35k, False: 151k]
  ------------------
 2133|  3.35k|                return need_more;
 2134|  3.35k|            }
 2135|   155k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (2135:17): [True: 1.06k, False: 154k]
  ------------------
 2136|   155k|        }
 2137|       |
 2138|       |        /* See how many times the previous byte repeats */
 2139|  43.8M|        s->match_length = 0;
 2140|  43.8M|        if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
  ------------------
  |  |  182|  87.6M|#define MIN_MATCH  3
  ------------------
  |  Branch (2140:13): [True: 43.8M, False: 1.50k]
  |  Branch (2140:42): [True: 43.8M, False: 1.05k]
  ------------------
 2141|  43.8M|            scan = s->window + s->strstart - 1;
 2142|  43.8M|            prev = *scan;
 2143|  43.8M|            if (prev == *++scan && prev == *++scan && prev == *++scan) {
  ------------------
  |  Branch (2143:17): [True: 7.90M, False: 35.9M]
  |  Branch (2143:36): [True: 1.33M, False: 6.57M]
  |  Branch (2143:55): [True: 732k, False: 598k]
  ------------------
 2144|   732k|                strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |  183|   732k|#define MAX_MATCH  258
  ------------------
 2145|  1.83M|                do {
 2146|  1.83M|                } while (prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2146:26): [True: 1.69M, False: 134k]
  |  Branch (2146:45): [True: 1.20M, False: 495k]
  ------------------
 2147|  1.20M|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2147:26): [True: 1.18M, False: 17.3k]
  |  Branch (2147:45): [True: 1.17M, False: 11.4k]
  ------------------
 2148|  1.17M|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2148:26): [True: 1.16M, False: 7.62k]
  |  Branch (2148:45): [True: 1.13M, False: 26.6k]
  ------------------
 2149|  1.13M|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2149:26): [True: 1.12M, False: 9.19k]
  |  Branch (2149:45): [True: 1.12M, False: 6.44k]
  ------------------
 2150|  1.12M|                         scan < strend);
  ------------------
  |  Branch (2150:26): [True: 1.09M, False: 24.1k]
  ------------------
 2151|   732k|                s->match_length = MAX_MATCH - (uInt)(strend - scan);
  ------------------
  |  |  183|   732k|#define MAX_MATCH  258
  ------------------
 2152|   732k|                if (s->match_length > s->lookahead)
  ------------------
  |  Branch (2152:21): [True: 84, False: 732k]
  ------------------
 2153|     84|                    s->match_length = s->lookahead;
 2154|   732k|            }
 2155|  43.8M|            Assert(scan <= s->window + (uInt)(s->window_size - 1),
 2156|  43.8M|                   "wild scan");
 2157|  43.8M|        }
 2158|       |
 2159|       |        /* Emit match if have run of MIN_MATCH or longer, else emit literal */
 2160|  43.8M|        if (s->match_length >= MIN_MATCH) {
  ------------------
  |  |  182|  43.8M|#define MIN_MATCH  3
  ------------------
  |  Branch (2160:13): [True: 732k, False: 43.1M]
  ------------------
 2161|   732k|            check_match(s, s->strstart, s->strstart - 1, (int)s->match_length);
 2162|       |
 2163|   732k|            _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
  ------------------
  |  |  366|   732k|  { uch len = (uch)(length); \
  |  |  367|   732k|    ush dist = (ush)(distance); \
  |  |  368|   732k|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  369|   732k|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  370|   732k|    s->sym_buf[s->sym_next++] = len; \
  |  |  371|   732k|    dist--; \
  |  |  372|   732k|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|   732k|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   732k|#define Freq fc.freq
  |  |  ------------------
  |  |  373|   732k|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  321|   732k|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 732k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   732k|#define Freq fc.freq
  |  |  ------------------
  |  |  374|   732k|    flush = (s->sym_next == s->sym_end); \
  |  |  375|   732k|  }
  ------------------
 2164|       |
 2165|   732k|            s->lookahead -= s->match_length;
 2166|   732k|            s->strstart += s->match_length;
 2167|   732k|            s->match_length = 0;
 2168|  43.1M|        } else {
 2169|       |            /* No match, output a literal byte */
 2170|  43.1M|            Tracevv((stderr,"%c", s->window[s->strstart]));
 2171|  43.1M|            _tr_tally_lit(s, s->window[s->strstart], bflush);
  ------------------
  |  |  358|  43.1M|  { uch cc = (c); \
  |  |  359|  43.1M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  43.1M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  43.1M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  43.1M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  43.1M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  43.1M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  43.1M|   }
  ------------------
 2172|  43.1M|            s->lookahead--;
 2173|  43.1M|            s->strstart++;
 2174|  43.1M|        }
 2175|  43.8M|        if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1671|  2.46k|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|  2.46k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|  2.46k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|  2.46k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 2.34k, False: 120]
  |  |  |  |  ------------------
  |  |  |  | 1661|  2.46k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|  2.46k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    120|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|  2.46k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|  2.46k|                (last)); \
  |  |  |  | 1665|  2.46k|   s->block_start = s->strstart; \
  |  |  |  | 1666|  2.46k|   flush_pending(s->strm); \
  |  |  |  | 1667|  2.46k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|  2.46k|}
  |  |  ------------------
  |  | 1673|  2.46k|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 1.80k, False: 663]
  |  |  ------------------
  |  | 1674|  1.80k|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [True: 1.80k, Folded]
  |  |  ------------------
  |  | 1675|  1.80k|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 0, False: 0]
  |  |  |  Branch (1675:30): [True: 0, False: 0]
  |  |  ------------------
  |  | 1676|      0|   } \
  |  | 1677|  2.46k|}
  ------------------
  |  Branch (2175:13): [True: 2.46k, False: 43.8M]
  ------------------
 2176|  43.8M|    }
 2177|  1.06k|    s->insert = 0;
 2178|  1.06k|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|  1.06k|#define Z_FINISH        4
  ------------------
  |  Branch (2178:9): [True: 1.06k, False: 0]
  ------------------
 2179|  1.06k|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1671|  1.06k|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|  1.06k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|  1.06k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|  1.06k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 1.03k, False: 30]
  |  |  |  |  ------------------
  |  |  |  | 1661|  1.06k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|  1.06k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     30|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|  1.06k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|  1.06k|                (last)); \
  |  |  |  | 1665|  1.06k|   s->block_start = s->strstart; \
  |  |  |  | 1666|  1.06k|   flush_pending(s->strm); \
  |  |  |  | 1667|  1.06k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|  1.06k|}
  |  |  ------------------
  |  | 1673|  1.06k|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 233, False: 829]
  |  |  ------------------
  |  | 1674|    233|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [Folded, False: 233]
  |  |  ------------------
  |  | 1675|    233|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 227, False: 6]
  |  |  |  Branch (1675:30): [True: 6, False: 0]
  |  |  ------------------
  |  | 1676|    233|   } \
  |  | 1677|  1.06k|}
  ------------------
 2180|    829|        return finish_done;
 2181|  1.06k|    }
 2182|      0|    if (s->sym_next)
  ------------------
  |  Branch (2182:9): [True: 0, False: 0]
  ------------------
 2183|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1671|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1661|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|      0|                (last)); \
  |  |  |  | 1665|      0|   s->block_start = s->strstart; \
  |  |  |  | 1666|      0|   flush_pending(s->strm); \
  |  |  |  | 1667|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|      0|}
  |  |  ------------------
  |  | 1673|      0|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1674|      0|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [True: 0, Folded]
  |  |  ------------------
  |  | 1675|      0|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 0, False: 0]
  |  |  |  Branch (1675:30): [True: 0, False: 0]
  |  |  ------------------
  |  | 1676|      0|   } \
  |  | 1677|      0|}
  ------------------
 2184|      0|    return block_done;
 2185|      0|}
deflate.c:deflate_huff:
 2191|  11.9k|local block_state deflate_huff(deflate_state *s, int flush) {
 2192|  11.9k|    int bflush;             /* set if current block must be flushed */
 2193|       |
 2194|  98.4M|    for (;;) {
 2195|       |        /* Make sure that we have a literal to write. */
 2196|  98.4M|        if (s->lookahead == 0) {
  ------------------
  |  Branch (2196:13): [True: 13.5k, False: 98.4M]
  ------------------
 2197|  13.5k|            fill_window(s);
 2198|  13.5k|            if (s->lookahead == 0) {
  ------------------
  |  Branch (2198:17): [True: 6.87k, False: 6.66k]
  ------------------
 2199|  6.87k|                if (flush == Z_NO_FLUSH)
  ------------------
  |  |  172|  6.87k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2199:21): [True: 5.93k, False: 935]
  ------------------
 2200|  5.93k|                    return need_more;
 2201|    935|                break;      /* flush the current block */
 2202|  6.87k|            }
 2203|  13.5k|        }
 2204|       |
 2205|       |        /* Output a literal byte */
 2206|  98.4M|        s->match_length = 0;
 2207|  98.4M|        Tracevv((stderr,"%c", s->window[s->strstart]));
 2208|  98.4M|        _tr_tally_lit(s, s->window[s->strstart], bflush);
  ------------------
  |  |  358|  98.4M|  { uch cc = (c); \
  |  |  359|  98.4M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  98.4M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  98.4M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  98.4M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  98.4M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  98.4M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  98.4M|   }
  ------------------
 2209|  98.4M|        s->lookahead--;
 2210|  98.4M|        s->strstart++;
 2211|  98.4M|        if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1671|  5.86k|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|  5.86k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|  5.86k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|  5.86k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 5.86k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1661|  5.86k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|  5.86k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|  5.86k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|  5.86k|                (last)); \
  |  |  |  | 1665|  5.86k|   s->block_start = s->strstart; \
  |  |  |  | 1666|  5.86k|   flush_pending(s->strm); \
  |  |  |  | 1667|  5.86k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|  5.86k|}
  |  |  ------------------
  |  | 1673|  5.86k|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 5.11k, False: 744]
  |  |  ------------------
  |  | 1674|  5.11k|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [True: 5.11k, Folded]
  |  |  ------------------
  |  | 1675|  5.11k|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 0, False: 0]
  |  |  |  Branch (1675:30): [True: 0, False: 0]
  |  |  ------------------
  |  | 1676|      0|   } \
  |  | 1677|  5.86k|}
  ------------------
  |  Branch (2211:13): [True: 5.86k, False: 98.4M]
  ------------------
 2212|  98.4M|    }
 2213|    935|    s->insert = 0;
 2214|    935|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|    935|#define Z_FINISH        4
  ------------------
  |  Branch (2214:9): [True: 935, False: 0]
  ------------------
 2215|    935|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1671|    935|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|    935|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|    935|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|    935|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 935, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1661|    935|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|    935|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|    935|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|    935|                (last)); \
  |  |  |  | 1665|    935|   s->block_start = s->strstart; \
  |  |  |  | 1666|    935|   flush_pending(s->strm); \
  |  |  |  | 1667|    935|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|    935|}
  |  |  ------------------
  |  | 1673|    935|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 252, False: 683]
  |  |  ------------------
  |  | 1674|    252|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [Folded, False: 252]
  |  |  ------------------
  |  | 1675|    252|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 236, False: 16]
  |  |  |  Branch (1675:30): [True: 16, False: 0]
  |  |  ------------------
  |  | 1676|    252|   } \
  |  | 1677|    935|}
  ------------------
 2216|    683|        return finish_done;
 2217|    935|    }
 2218|      0|    if (s->sym_next)
  ------------------
  |  Branch (2218:9): [True: 0, False: 0]
  ------------------
 2219|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1671|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1661|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|      0|                (last)); \
  |  |  |  | 1665|      0|   s->block_start = s->strstart; \
  |  |  |  | 1666|      0|   flush_pending(s->strm); \
  |  |  |  | 1667|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|      0|}
  |  |  ------------------
  |  | 1673|      0|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1674|      0|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [True: 0, Folded]
  |  |  ------------------
  |  | 1675|      0|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 0, False: 0]
  |  |  |  Branch (1675:30): [True: 0, False: 0]
  |  |  ------------------
  |  | 1676|      0|   } \
  |  | 1677|      0|}
  ------------------
 2220|      0|    return block_done;
 2221|      0|}

gzclose:
   11|  8.45k|int ZEXPORT gzclose(gzFile file) {
   12|  8.45k|#ifndef NO_GZCOMPRESS
   13|  8.45k|    gz_statep state;
   14|       |
   15|  8.45k|    if (file == NULL)
  ------------------
  |  Branch (15:9): [True: 0, False: 8.45k]
  ------------------
   16|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
   17|  8.45k|    state = (gz_statep)file;
   18|       |
   19|  8.45k|    return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
  ------------------
  |  |  176|  8.45k|#define GZ_READ 7247
  ------------------
  |  Branch (19:12): [True: 4.22k, False: 4.22k]
  ------------------
   20|       |#else
   21|       |    return gzclose_r(file);
   22|       |#endif
   23|  8.45k|}

gzopen:
  293|  8.45k|gzFile ZEXPORT gzopen(const char *path, const char *mode) {
  294|  8.45k|    return gz_open(path, -1, mode);
  295|  8.45k|}
gz_error:
  559|  35.6k|void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
  560|       |    /* free previously allocated message and clear */
  561|  35.6k|    if (state->msg != NULL) {
  ------------------
  |  Branch (561:9): [True: 0, False: 35.6k]
  ------------------
  562|      0|        if (state->err != Z_MEM_ERROR)
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (562:13): [True: 0, False: 0]
  ------------------
  563|      0|            free(state->msg);
  564|      0|        state->msg = NULL;
  565|      0|    }
  566|       |
  567|       |    /* set error code, and if no message, then done */
  568|  35.6k|    state->err = err;
  569|  35.6k|    if (msg == NULL)
  ------------------
  |  Branch (569:9): [True: 35.6k, False: 0]
  ------------------
  570|  35.6k|        return;
  571|       |
  572|       |    /* for an out of memory error, return literal string when requested */
  573|      0|    if (err == Z_MEM_ERROR)
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (573:9): [True: 0, False: 0]
  ------------------
  574|      0|        return;
  575|       |
  576|       |    /* construct error message with path */
  577|      0|    if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
  ------------------
  |  Branch (577:9): [True: 0, False: 0]
  ------------------
  578|      0|            NULL) {
  579|      0|        state->err = Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  580|      0|        return;
  581|      0|    }
  582|      0|#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
  583|      0|    (void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
  584|      0|                   "%s%s%s", state->path, ": ", msg);
  585|       |#else
  586|       |    strcpy(state->msg, state->path);
  587|       |    strcat(state->msg, ": ");
  588|       |    strcat(state->msg, msg);
  589|       |#endif
  590|      0|}
gzlib.c:gz_open:
   87|  8.45k|local gzFile gz_open(const void *path, int fd, const char *mode) {
   88|  8.45k|    gz_statep state;
   89|  8.45k|    z_size_t len;
   90|  8.45k|    int oflag = 0;
   91|  8.45k|    int exclusive = 0;
   92|       |
   93|       |    /* check input */
   94|  8.45k|    if (path == NULL || mode == NULL)
  ------------------
  |  Branch (94:9): [True: 0, False: 8.45k]
  |  Branch (94:25): [True: 0, False: 8.45k]
  ------------------
   95|      0|        return NULL;
   96|       |
   97|       |    /* allocate gzFile structure to return */
   98|  8.45k|    state = (gz_statep)malloc(sizeof(gz_state));
   99|  8.45k|    if (state == NULL)
  ------------------
  |  Branch (99:9): [True: 0, False: 8.45k]
  ------------------
  100|      0|        return NULL;
  101|  8.45k|    state->size = 0;            /* no buffers allocated yet */
  102|  8.45k|    state->want = GZBUFSIZE;    /* requested buffer size */
  ------------------
  |  |  172|  8.45k|#define GZBUFSIZE 8192
  ------------------
  103|  8.45k|    state->err = Z_OK;          /* no error yet */
  ------------------
  |  |  181|  8.45k|#define Z_OK            0
  ------------------
  104|  8.45k|    state->msg = NULL;          /* no error message yet */
  105|       |
  106|       |    /* interpret mode */
  107|  8.45k|    state->mode = GZ_NONE;
  ------------------
  |  |  175|  8.45k|#define GZ_NONE 0
  ------------------
  108|  8.45k|    state->level = Z_DEFAULT_COMPRESSION;
  ------------------
  |  |  197|  8.45k|#define Z_DEFAULT_COMPRESSION  (-1)
  ------------------
  109|  8.45k|    state->strategy = Z_DEFAULT_STRATEGY;
  ------------------
  |  |  204|  8.45k|#define Z_DEFAULT_STRATEGY    0
  ------------------
  110|  8.45k|    state->direct = 0;
  111|  31.7k|    while (*mode) {
  ------------------
  |  Branch (111:12): [True: 23.3k, False: 8.45k]
  ------------------
  112|  23.3k|        if (*mode >= '0' && *mode <= '9')
  ------------------
  |  Branch (112:13): [True: 19.6k, False: 3.62k]
  |  Branch (112:29): [True: 0, False: 19.6k]
  ------------------
  113|      0|            state->level = *mode - '0';
  114|  23.3k|        else
  115|  23.3k|            switch (*mode) {
  116|  4.22k|            case 'r':
  ------------------
  |  Branch (116:13): [True: 4.22k, False: 19.0k]
  ------------------
  117|  4.22k|                state->mode = GZ_READ;
  ------------------
  |  |  176|  4.22k|#define GZ_READ 7247
  ------------------
  118|  4.22k|                break;
  119|      0|#ifndef NO_GZCOMPRESS
  120|  4.22k|            case 'w':
  ------------------
  |  Branch (120:13): [True: 4.22k, False: 19.0k]
  ------------------
  121|  4.22k|                state->mode = GZ_WRITE;
  ------------------
  |  |  177|  4.22k|#define GZ_WRITE 31153
  ------------------
  122|  4.22k|                break;
  123|      0|            case 'a':
  ------------------
  |  Branch (123:13): [True: 0, False: 23.3k]
  ------------------
  124|      0|                state->mode = GZ_APPEND;
  ------------------
  |  |  178|      0|#define GZ_APPEND 1     /* mode set to GZ_WRITE after the file is opened */
  ------------------
  125|      0|                break;
  126|      0|#endif
  127|      0|            case '+':       /* can't read and write at the same time */
  ------------------
  |  Branch (127:13): [True: 0, False: 23.3k]
  ------------------
  128|      0|                free(state);
  129|      0|                return NULL;
  130|  8.45k|            case 'b':       /* ignore -- will request binary anyway */
  ------------------
  |  Branch (130:13): [True: 8.45k, False: 14.8k]
  ------------------
  131|  8.45k|                break;
  132|      0|#ifdef O_CLOEXEC
  133|      0|            case 'e':
  ------------------
  |  Branch (133:13): [True: 0, False: 23.3k]
  ------------------
  134|      0|                oflag |= O_CLOEXEC;
  135|      0|                break;
  136|      0|#endif
  137|      0|            case 'x':
  ------------------
  |  Branch (137:13): [True: 0, False: 23.3k]
  ------------------
  138|      0|                exclusive = 1;
  139|      0|                break;
  140|    767|            case 'f':
  ------------------
  |  Branch (140:13): [True: 767, False: 22.5k]
  ------------------
  141|    767|                state->strategy = Z_FILTERED;
  ------------------
  |  |  200|    767|#define Z_FILTERED            1
  ------------------
  142|    767|                break;
  143|    935|            case 'h':
  ------------------
  |  Branch (143:13): [True: 935, False: 22.3k]
  ------------------
  144|    935|                state->strategy = Z_HUFFMAN_ONLY;
  ------------------
  |  |  201|    935|#define Z_HUFFMAN_ONLY        2
  ------------------
  145|    935|                break;
  146|  1.06k|            case 'R':
  ------------------
  |  Branch (146:13): [True: 1.06k, False: 22.2k]
  ------------------
  147|  1.06k|                state->strategy = Z_RLE;
  ------------------
  |  |  202|  1.06k|#define Z_RLE                 3
  ------------------
  148|  1.06k|                break;
  149|      0|            case 'F':
  ------------------
  |  Branch (149:13): [True: 0, False: 23.3k]
  ------------------
  150|      0|                state->strategy = Z_FIXED;
  ------------------
  |  |  203|      0|#define Z_FIXED               4
  ------------------
  151|      0|                break;
  152|      0|            case 'G':
  ------------------
  |  Branch (152:13): [True: 0, False: 23.3k]
  ------------------
  153|      0|                state->direct = -1;
  154|      0|                break;
  155|      0|#ifdef O_NONBLOCK
  156|      0|            case 'N':
  ------------------
  |  Branch (156:13): [True: 0, False: 23.3k]
  ------------------
  157|      0|                oflag |= O_NONBLOCK;
  158|      0|                break;
  159|      0|#endif
  160|      0|            case 'T':
  ------------------
  |  Branch (160:13): [True: 0, False: 23.3k]
  ------------------
  161|      0|                state->direct = 1;
  162|      0|                break;
  163|  3.62k|            default:        /* could consider as an error, but just ignore */
  ------------------
  |  Branch (163:13): [True: 3.62k, False: 19.6k]
  ------------------
  164|  3.62k|                ;
  165|  23.3k|            }
  166|  23.3k|        mode++;
  167|  23.3k|    }
  168|       |
  169|       |    /* must provide an "r", "w", or "a" */
  170|  8.45k|    if (state->mode == GZ_NONE) {
  ------------------
  |  |  175|  8.45k|#define GZ_NONE 0
  ------------------
  |  Branch (170:9): [True: 0, False: 8.45k]
  ------------------
  171|      0|        free(state);
  172|      0|        return NULL;
  173|      0|    }
  174|       |
  175|       |    /* direct is 0, 1 if "T", or -1 if "G" (last "G" or "T" wins) */
  176|  8.45k|    if (state->mode == GZ_READ) {
  ------------------
  |  |  176|  8.45k|#define GZ_READ 7247
  ------------------
  |  Branch (176:9): [True: 4.22k, False: 4.22k]
  ------------------
  177|  4.22k|        if (state->direct == 1) {
  ------------------
  |  Branch (177:13): [True: 0, False: 4.22k]
  ------------------
  178|       |            /* can't force a transparent read */
  179|      0|            free(state);
  180|      0|            return NULL;
  181|      0|        }
  182|  4.22k|        if (state->direct == 0)
  ------------------
  |  Branch (182:13): [True: 4.22k, False: 0]
  ------------------
  183|       |            /* default when reading is auto-detect of gzip vs. transparent --
  184|       |               start with a transparent assumption in case of an empty file */
  185|  4.22k|            state->direct = 1;
  186|  4.22k|    }
  187|  4.22k|    else if (state->direct == -1) {
  ------------------
  |  Branch (187:14): [True: 0, False: 4.22k]
  ------------------
  188|       |        /* "G" has no meaning when writing -- disallow it */
  189|      0|        free(state);
  190|      0|        return NULL;
  191|      0|    }
  192|       |    /* if reading, direct == 1 for auto-detect, -1 for gzip only; if writing or
  193|       |       appending, direct == 0 for gzip, 1 for transparent (copy in to out) */
  194|       |
  195|       |#ifndef O_EXCL
  196|       |    if (exclusive && state->mode != GZ_READ && fd < 0) {
  197|       |        /* exclusive creation request can't be honored -- fail out */
  198|       |        free(state);
  199|       |        return NULL;
  200|       |    }
  201|       |#endif
  202|       |
  203|       |    /* save the path name for error messages */
  204|       |#ifdef WIDECHAR
  205|       |    if (fd == -2) {
  206|       |        len = wcstombs(NULL, path, 0);
  207|       |        if (len == (z_size_t)-1)
  208|       |            len = 0;            /* not representable in the current locale */
  209|       |    }
  210|       |    else
  211|       |#endif
  212|  8.45k|        len = strlen((const char *)path);
  213|  8.45k|    state->path = (char *)malloc(len + 1);
  214|  8.45k|    if (state->path == NULL) {
  ------------------
  |  Branch (214:9): [True: 0, False: 8.45k]
  ------------------
  215|      0|        free(state);
  216|      0|        return NULL;
  217|      0|    }
  218|       |#ifdef WIDECHAR
  219|       |    if (fd == -2) {
  220|       |        if (len == 0 || wcstombs(state->path, path, len + 1) != len)
  221|       |            *(state->path) = 0;
  222|       |    }
  223|       |    else
  224|       |#endif
  225|  8.45k|    {
  226|  8.45k|#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
  227|  8.45k|        (void)snprintf(state->path, len + 1, "%s", (const char *)path);
  228|       |#else
  229|       |        strcpy(state->path, (const char *)path);
  230|       |#endif
  231|  8.45k|    }
  232|       |
  233|       |    /* compute the flags for open() */
  234|  8.45k|    oflag |=
  235|  8.45k|#ifdef O_LARGEFILE
  236|  8.45k|        O_LARGEFILE |
  237|  8.45k|#endif
  238|       |#ifdef O_BINARY
  239|       |        O_BINARY |
  240|       |#endif
  241|  8.45k|        (state->mode == GZ_READ ?
  ------------------
  |  |  176|  8.45k|#define GZ_READ 7247
  ------------------
  |  Branch (241:10): [True: 4.22k, False: 4.22k]
  ------------------
  242|  8.45k|         O_RDONLY :
  243|  8.45k|         (O_WRONLY | O_CREAT |
  244|  4.22k|#ifdef O_EXCL
  245|  4.22k|          (exclusive ? O_EXCL : 0) |
  ------------------
  |  Branch (245:12): [True: 0, False: 4.22k]
  ------------------
  246|  4.22k|#endif
  247|  4.22k|          (state->mode == GZ_WRITE ?
  ------------------
  |  |  177|  4.22k|#define GZ_WRITE 31153
  ------------------
  |  Branch (247:12): [True: 4.22k, False: 0]
  ------------------
  248|  4.22k|           O_TRUNC :
  249|  4.22k|           O_APPEND)));
  250|       |
  251|       |    /* open the file with the appropriate flags (or just use fd) */
  252|  8.45k|    if (fd == -1)
  ------------------
  |  Branch (252:9): [True: 8.45k, False: 0]
  ------------------
  253|  8.45k|        state->fd = open((const char *)path, oflag, 0666);
  254|       |#ifdef WIDECHAR
  255|       |    else if (fd == -2)
  256|       |        state->fd = _wopen(path, oflag, _S_IREAD | _S_IWRITE);
  257|       |#endif
  258|      0|    else {
  259|      0|#ifdef O_NONBLOCK
  260|      0|        if (oflag & O_NONBLOCK)
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  ------------------
  261|      0|            fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
  262|      0|#endif
  263|      0|#if defined(O_CLOEXEC) && defined(FD_CLOEXEC)
  264|      0|        if (oflag & O_CLOEXEC)
  ------------------
  |  Branch (264:13): [True: 0, False: 0]
  ------------------
  265|      0|            fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
  266|      0|#endif
  267|      0|        state->fd = fd;
  268|      0|    }
  269|  8.45k|    if (state->fd == -1) {
  ------------------
  |  Branch (269:9): [True: 0, False: 8.45k]
  ------------------
  270|      0|        free(state->path);
  271|      0|        free(state);
  272|      0|        return NULL;
  273|      0|    }
  274|  8.45k|    if (state->mode == GZ_APPEND) {
  ------------------
  |  |  178|  8.45k|#define GZ_APPEND 1     /* mode set to GZ_WRITE after the file is opened */
  ------------------
  |  Branch (274:9): [True: 0, False: 8.45k]
  ------------------
  275|      0|        LSEEK(state->fd, 0, SEEK_END);  /* so gzoffset() is correct */
  ------------------
  |  |   13|      0|#  define LSEEK lseek64
  ------------------
  276|      0|        state->mode = GZ_WRITE;         /* simplify later checks */
  ------------------
  |  |  177|      0|#define GZ_WRITE 31153
  ------------------
  277|      0|    }
  278|       |
  279|       |    /* save the current position for rewinding (only if reading) */
  280|  8.45k|    if (state->mode == GZ_READ) {
  ------------------
  |  |  176|  8.45k|#define GZ_READ 7247
  ------------------
  |  Branch (280:9): [True: 4.22k, False: 4.22k]
  ------------------
  281|  4.22k|        state->start = LSEEK(state->fd, 0, SEEK_CUR);
  ------------------
  |  |   13|  4.22k|#  define LSEEK lseek64
  ------------------
  282|  4.22k|        if (state->start == -1) state->start = 0;
  ------------------
  |  Branch (282:13): [True: 0, False: 4.22k]
  ------------------
  283|  4.22k|    }
  284|       |
  285|       |    /* initialize stream */
  286|  8.45k|    gz_reset(state);
  287|       |
  288|       |    /* return stream */
  289|  8.45k|    return (gzFile)state;
  290|  8.45k|}
gzlib.c:gz_reset:
   69|  8.45k|local void gz_reset(gz_statep state) {
   70|  8.45k|    state->x.have = 0;              /* no output data available */
   71|  8.45k|    state->past = 0;                /* have not read past end yet */
   72|  8.45k|    if (state->mode == GZ_READ) {   /* for reading ... */
  ------------------
  |  |  176|  8.45k|#define GZ_READ 7247
  ------------------
  |  Branch (72:9): [True: 4.22k, False: 4.22k]
  ------------------
   73|  4.22k|        state->eof = 0;             /* not at end of file */
   74|  4.22k|        state->how = LOOK;          /* look for gzip header */
  ------------------
  |  |  181|  4.22k|#define LOOK 0      /* look for a gzip header */
  ------------------
   75|  4.22k|        state->junk = -1;           /* mark first member */
   76|  4.22k|    }
   77|  4.22k|    else                            /* for writing ... */
   78|  4.22k|        state->reset = 0;           /* no deflateReset pending */
   79|  8.45k|    state->again = 0;               /* no stalled i/o yet */
   80|  8.45k|    state->skip = 0;                /* no seek request pending */
   81|  8.45k|    gz_error(state, Z_OK, NULL);    /* clear error */
  ------------------
  |  |  181|  8.45k|#define Z_OK            0
  ------------------
   82|  8.45k|    state->x.pos = 0;               /* no uncompressed data yet */
   83|  8.45k|    state->strm.avail_in = 0;       /* no input data yet */
   84|  8.45k|}

gzread:
  425|  12.7k|int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) {
  426|  12.7k|    gz_statep state;
  427|       |
  428|       |    /* get internal structure and check that it's for reading */
  429|  12.7k|    if (file == NULL)
  ------------------
  |  Branch (429:9): [True: 0, False: 12.7k]
  ------------------
  430|      0|        return -1;
  431|  12.7k|    state = (gz_statep)file;
  432|  12.7k|    if (state->mode != GZ_READ)
  ------------------
  |  |  176|  12.7k|#define GZ_READ 7247
  ------------------
  |  Branch (432:9): [True: 0, False: 12.7k]
  ------------------
  433|      0|        return -1;
  434|       |
  435|       |    /* check that there was no (serious) error -- if there was, deliver any
  436|       |       data read before the error until it is exhausted, and only then return
  437|       |       the error */
  438|  12.7k|    if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again &&
  ------------------
  |  |  181|  25.5k|#define Z_OK            0
  ------------------
                  if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again &&
  ------------------
  |  |  188|  12.7k|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (438:9): [True: 0, False: 12.7k]
  |  Branch (438:31): [True: 0, False: 0]
  |  Branch (438:60): [True: 0, False: 0]
  ------------------
  439|      0|            state->x.have == 0)
  ------------------
  |  Branch (439:13): [True: 0, False: 0]
  ------------------
  440|      0|        return -1;
  441|  12.7k|    if (state->again)
  ------------------
  |  Branch (441:9): [True: 0, False: 12.7k]
  ------------------
  442|      0|        gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  443|       |
  444|       |    /* since an int is returned, make sure len fits in one, otherwise return
  445|       |       with an error (this avoids a flaw in the interface) -- keep a pending
  446|       |       serious error, which is the one the caller needs to see */
  447|  12.7k|    if ((int)len < 0) {
  ------------------
  |  Branch (447:9): [True: 0, False: 12.7k]
  ------------------
  448|      0|        if (state->err == Z_OK || state->err == Z_BUF_ERROR)
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
                      if (state->err == Z_OK || state->err == Z_BUF_ERROR)
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (448:13): [True: 0, False: 0]
  |  Branch (448:35): [True: 0, False: 0]
  ------------------
  449|      0|            gz_error(state, Z_STREAM_ERROR, "request does not fit in an int");
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  450|      0|        return -1;
  451|      0|    }
  452|       |
  453|       |    /* read len or fewer bytes to buf */
  454|  12.7k|    len = (unsigned)gz_read(state, buf, len);
  455|       |
  456|       |    /* check for an error */
  457|  12.7k|    if (len == 0) {
  ------------------
  |  Branch (457:9): [True: 4.22k, False: 8.54k]
  ------------------
  458|  4.22k|        if (state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  181|  8.45k|#define Z_OK            0
  ------------------
                      if (state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (458:13): [True: 0, False: 4.22k]
  |  Branch (458:35): [True: 0, False: 0]
  ------------------
  459|      0|            return -1;
  460|  4.22k|        if (state->again) {
  ------------------
  |  Branch (460:13): [True: 0, False: 4.22k]
  ------------------
  461|       |            /* non-blocking input stalled after some input was read, but no
  462|       |               uncompressed bytes were produced -- let the application know
  463|       |               this isn't EOF */
  464|      0|            gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
                          gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  135|      0|#    define zstrerror() strerror(errno)
  ------------------
  465|      0|            return -1;
  466|      0|        }
  467|  4.22k|    }
  468|       |
  469|       |    /* return the number of bytes read */
  470|  12.7k|    return (int)len;
  471|  12.7k|}
gzclose_r:
  704|  4.22k|int ZEXPORT gzclose_r(gzFile file) {
  705|  4.22k|    int ret, err;
  706|  4.22k|    gz_statep state;
  707|       |
  708|       |    /* get internal structure and check that it's for reading */
  709|  4.22k|    if (file == NULL)
  ------------------
  |  Branch (709:9): [True: 0, False: 4.22k]
  ------------------
  710|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  711|  4.22k|    state = (gz_statep)file;
  712|  4.22k|    if (state->mode != GZ_READ)
  ------------------
  |  |  176|  4.22k|#define GZ_READ 7247
  ------------------
  |  Branch (712:9): [True: 0, False: 4.22k]
  ------------------
  713|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  714|       |
  715|       |    /* free memory and close file */
  716|  4.22k|    if (state->size) {
  ------------------
  |  Branch (716:9): [True: 4.22k, False: 0]
  ------------------
  717|  4.22k|        inflateEnd(&(state->strm));
  718|  4.22k|        free(state->out);
  719|  4.22k|        free(state->in);
  720|  4.22k|    }
  721|  4.22k|    err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
  ------------------
  |  |  188|  4.22k|#define Z_BUF_ERROR    (-5)
  ------------------
                  err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
                  err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
  ------------------
  |  |  181|  8.45k|#define Z_OK            0
  ------------------
  |  Branch (721:11): [True: 0, False: 4.22k]
  ------------------
  722|  4.22k|    gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  723|  4.22k|    free(state->path);
  724|  4.22k|    ret = close(state->fd);
  725|  4.22k|    free(state);
  726|  4.22k|    return ret ? Z_ERRNO : err;
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
  |  Branch (726:12): [True: 0, False: 4.22k]
  ------------------
  727|  4.22k|}
gzread.c:gz_read:
  343|  12.7k|local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) {
  344|  12.7k|    z_size_t got;
  345|  12.7k|    unsigned n;
  346|  12.7k|    int err;
  347|       |
  348|       |    /* if len is zero, avoid unnecessary operations */
  349|  12.7k|    if (len == 0)
  ------------------
  |  Branch (349:9): [True: 0, False: 12.7k]
  ------------------
  350|      0|        return 0;
  351|       |
  352|       |    /* process a skip request */
  353|  12.7k|    if (state->skip && gz_skip(state) == -1)
  ------------------
  |  Branch (353:9): [True: 0, False: 12.7k]
  |  Branch (353:24): [True: 0, False: 0]
  ------------------
  354|      0|        return 0;
  355|       |
  356|       |    /* get len bytes to buf, or less than len if at the end */
  357|  12.7k|    got = 0;
  358|  12.7k|    err = 0;
  359|  22.7k|    do {
  360|       |        /* set n to the maximum amount of len that fits in an unsigned int */
  361|  22.7k|        n = (unsigned)-1;
  362|  22.7k|        if (n > len)
  ------------------
  |  Branch (362:13): [True: 22.7k, False: 0]
  ------------------
  363|  22.7k|            n = (unsigned)len;
  364|       |
  365|       |        /* first just try copying data from the output buffer */
  366|  22.7k|        if (state->x.have) {
  ------------------
  |  Branch (366:13): [True: 4.22k, False: 18.5k]
  ------------------
  367|  4.22k|            if (state->x.have < n)
  ------------------
  |  Branch (367:17): [True: 4.22k, False: 0]
  ------------------
  368|  4.22k|                n = state->x.have;
  369|  4.22k|            memcpy(buf, state->x.next, n);
  370|  4.22k|            state->x.next += n;
  371|  4.22k|            state->x.have -= n;
  372|  4.22k|            if (state->err != Z_OK)
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  |  Branch (372:17): [True: 0, False: 4.22k]
  ------------------
  373|       |                /* caught deferred error from gz_fetch() */
  374|      0|                err = -1;
  375|  4.22k|        }
  376|       |
  377|       |        /* output buffer empty -- return if we're at the end of the input */
  378|  18.5k|        else if (state->eof && state->strm.avail_in == 0) {
  ------------------
  |  Branch (378:18): [True: 9.02k, False: 9.52k]
  |  Branch (378:32): [True: 8.44k, False: 585]
  ------------------
  379|  8.44k|            if (state->how == GZIP && state->err == Z_OK)
  ------------------
  |  |  183|  16.8k|#define GZIP 2      /* decompress a gzip stream */
  ------------------
                          if (state->how == GZIP && state->err == Z_OK)
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  |  Branch (379:17): [True: 0, False: 8.44k]
  |  Branch (379:39): [True: 0, False: 0]
  ------------------
  380|      0|                gz_error(state, Z_BUF_ERROR, "unexpected end of file");
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  381|  8.44k|            break;
  382|  8.44k|        }
  383|       |
  384|       |        /* need output data -- for small len or new stream load up our output
  385|       |           buffer, so that gzgetc() can be fast */
  386|  10.1k|        else if (state->how == LOOK || n < (state->size << 1)) {
  ------------------
  |  |  181|  20.2k|#define LOOK 0      /* look for a gzip header */
  ------------------
  |  Branch (386:18): [True: 4.24k, False: 5.85k]
  |  Branch (386:40): [True: 0, False: 5.85k]
  ------------------
  387|       |            /* get more output, looking for header if required */
  388|  4.24k|            if (gz_fetch(state) == -1 && state->x.have == 0)
  ------------------
  |  Branch (388:17): [True: 0, False: 4.24k]
  |  Branch (388:42): [True: 0, False: 0]
  ------------------
  389|       |                /* if state->x.have != 0, error will be caught after copy */
  390|      0|                err = -1;
  391|  4.24k|            continue;       /* no progress yet -- go back to copy above */
  392|       |            /* the copy above assures that we will leave with space in the
  393|       |               output buffer, allowing at least one gzungetc() to succeed */
  394|  4.24k|        }
  395|       |
  396|       |        /* large len -- read directly into user buffer */
  397|  5.85k|        else if (state->how == COPY)        /* read directly */
  ------------------
  |  |  182|  5.85k|#define COPY 1      /* copy input directly */
  ------------------
  |  Branch (397:18): [True: 0, False: 5.85k]
  ------------------
  398|      0|            err = gz_load(state, (unsigned char *)buf, n, &n);
  399|       |
  400|       |        /* large len -- decompress directly into user buffer */
  401|  5.85k|        else {  /* state->how == GZIP */
  402|  5.85k|            state->strm.avail_out = n;
  403|  5.85k|            state->strm.next_out = (unsigned char *)buf;
  404|  5.85k|            err = gz_decomp(state);
  405|  5.85k|            n = state->x.have;
  406|  5.85k|            state->x.have = 0;
  407|  5.85k|        }
  408|       |
  409|       |        /* update progress */
  410|  10.0k|        len -= n;
  411|  10.0k|        buf = (char *)buf + n;
  412|  10.0k|        got += n;
  413|  10.0k|        state->x.pos += n;
  414|  14.3k|    } while (len && !err);
  ------------------
  |  Branch (414:14): [True: 10.0k, False: 4.32k]
  |  Branch (414:21): [True: 10.0k, False: 0]
  ------------------
  415|       |
  416|       |    /* note read past eof */
  417|  12.7k|    if (len && state->eof)
  ------------------
  |  Branch (417:9): [True: 8.44k, False: 4.32k]
  |  Branch (417:16): [True: 8.44k, False: 0]
  ------------------
  418|  8.44k|        state->past = 1;
  419|       |
  420|       |    /* return number of bytes read into user buffer */
  421|  12.7k|    return got;
  422|  12.7k|}
gzread.c:gz_load:
   19|  23.8k|                  unsigned *have) {
   20|  23.8k|    int ret;
   21|  23.8k|    unsigned get, max = ((unsigned)-1 >> 2) + 1;
   22|       |
   23|  23.8k|    state->again = 0;
   24|  23.8k|    errno = 0;
   25|  23.8k|    *have = 0;
   26|  28.0k|    do {
   27|  28.0k|        get = len - *have;
   28|  28.0k|        if (get > max)
  ------------------
  |  Branch (28:13): [True: 0, False: 28.0k]
  ------------------
   29|      0|            get = max;
   30|  28.0k|        ret = (int)read(state->fd, buf + *have, get);
   31|  28.0k|        if (ret <= 0)
  ------------------
  |  Branch (31:13): [True: 4.22k, False: 23.7k]
  ------------------
   32|  4.22k|            break;
   33|  23.7k|        *have += (unsigned)ret;
   34|  23.7k|    } while (*have < len);
  ------------------
  |  Branch (34:14): [True: 4.20k, False: 19.5k]
  ------------------
   35|  23.8k|    if (ret < 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 23.8k]
  ------------------
   36|      0|        if (BLOCKED(errno)) {
  ------------------
  |  |  143|      0|#    define BLOCKED(e) ((e) == EAGAIN || (e) == EWOULDBLOCK)
  |  |  ------------------
  |  |  |  Branch (143:25): [True: 0, False: 0]
  |  |  |  Branch (143:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   37|      0|            state->again = 1;
   38|      0|            if (*have != 0)
  ------------------
  |  Branch (38:17): [True: 0, False: 0]
  ------------------
   39|      0|                return 0;
   40|      0|        }
   41|      0|        gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
                      gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  135|      0|#    define zstrerror() strerror(errno)
  ------------------
   42|      0|        return -1;
   43|      0|    }
   44|  23.8k|    if (ret == 0)
  ------------------
  |  Branch (44:9): [True: 4.22k, False: 19.5k]
  ------------------
   45|  4.22k|        state->eof = 1;
   46|  23.8k|    return 0;
   47|  23.8k|}
gzread.c:gz_decomp:
  187|  10.0k|local int gz_decomp(gz_statep state) {
  188|  10.0k|    int ret = Z_OK;
  ------------------
  |  |  181|  10.0k|#define Z_OK            0
  ------------------
  189|  10.0k|    unsigned had;
  190|  10.0k|    z_streamp strm = &(state->strm);
  191|       |
  192|       |    /* fill output buffer up to end of deflate stream */
  193|  10.0k|    had = strm->avail_out;
  194|  29.6k|    do {
  195|       |        /* get more input for inflate() */
  196|  29.6k|        if (strm->avail_in == 0 && gz_avail(state) == -1) {
  ------------------
  |  Branch (196:13): [True: 19.5k, False: 10.0k]
  |  Branch (196:36): [True: 0, False: 19.5k]
  ------------------
  197|      0|            ret = state->err;
  198|      0|            break;
  199|      0|        }
  200|  29.6k|        if (strm->avail_in == 0) {
  ------------------
  |  Branch (200:13): [True: 0, False: 29.6k]
  ------------------
  201|      0|            if (!state->again)
  ------------------
  |  Branch (201:17): [True: 0, False: 0]
  ------------------
  202|      0|                gz_error(state, Z_BUF_ERROR, "unexpected end of file");
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  203|      0|            break;
  204|      0|        }
  205|       |
  206|       |        /* decompress and handle errors */
  207|  29.6k|        ret = inflate(strm, Z_NO_FLUSH);
  ------------------
  |  |  172|  29.6k|#define Z_NO_FLUSH      0
  ------------------
  208|  29.6k|        if (strm->avail_out < had)
  ------------------
  |  Branch (208:13): [True: 29.6k, False: 11]
  ------------------
  209|       |            /* any decompressed data marks this as a real gzip stream */
  210|  29.6k|            state->junk = 0;
  211|  29.6k|        if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
  ------------------
  |  |  185|  59.2k|#define Z_STREAM_ERROR (-2)
  ------------------
                      if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
  ------------------
  |  |  183|  29.6k|#define Z_NEED_DICT     2
  ------------------
  |  Branch (211:13): [True: 0, False: 29.6k]
  |  Branch (211:38): [True: 0, False: 29.6k]
  ------------------
  212|      0|            gz_error(state, Z_STREAM_ERROR,
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  213|      0|                     "internal error: inflate stream corrupt");
  214|      0|            break;
  215|      0|        }
  216|  29.6k|        if (ret == Z_MEM_ERROR) {
  ------------------
  |  |  187|  29.6k|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (216:13): [True: 0, False: 29.6k]
  ------------------
  217|      0|            gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  218|      0|            break;
  219|      0|        }
  220|  29.6k|        if (ret == Z_DATA_ERROR) {              /* deflate stream invalid */
  ------------------
  |  |  186|  29.6k|#define Z_DATA_ERROR   (-3)
  ------------------
  |  Branch (220:13): [True: 0, False: 29.6k]
  ------------------
  221|      0|            if (state->junk == 1) {             /* trailing garbage is ok */
  ------------------
  |  Branch (221:17): [True: 0, False: 0]
  ------------------
  222|      0|                strm->avail_in = 0;
  223|      0|                state->eof = 1;
  224|      0|                state->how = LOOK;
  ------------------
  |  |  181|      0|#define LOOK 0      /* look for a gzip header */
  ------------------
  225|      0|                ret = Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  226|      0|                break;
  227|      0|            }
  228|      0|            gz_error(state, Z_DATA_ERROR,
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
  229|      0|                     strm->msg == NULL ? "compressed data error" : strm->msg);
  ------------------
  |  Branch (229:22): [True: 0, False: 0]
  ------------------
  230|      0|            break;
  231|      0|        }
  232|  29.6k|    } while (strm->avail_out && ret != Z_STREAM_END);
  ------------------
  |  |  182|  23.7k|#define Z_STREAM_END    1
  ------------------
  |  Branch (232:14): [True: 23.7k, False: 5.86k]
  |  Branch (232:33): [True: 19.5k, False: 4.21k]
  ------------------
  233|       |
  234|       |    /* update available output */
  235|  10.0k|    state->x.have = had - strm->avail_out;
  236|  10.0k|    state->x.next = strm->next_out - state->x.have;
  237|       |
  238|       |    /* if the gzip stream completed successfully, look for another */
  239|  10.0k|    if (ret == Z_STREAM_END) {
  ------------------
  |  |  182|  10.0k|#define Z_STREAM_END    1
  ------------------
  |  Branch (239:9): [True: 4.22k, False: 5.85k]
  ------------------
  240|  4.22k|        state->junk = 0;
  241|  4.22k|        state->how = LOOK;
  ------------------
  |  |  181|  4.22k|#define LOOK 0      /* look for a gzip header */
  ------------------
  242|  4.22k|        return 0;
  243|  4.22k|    }
  244|       |
  245|       |    /* return decompression status */
  246|  5.85k|    return ret != Z_OK ? -1 : 0;
  ------------------
  |  |  181|  5.85k|#define Z_OK            0
  ------------------
  |  Branch (246:12): [True: 0, False: 5.85k]
  ------------------
  247|  10.0k|}
gzread.c:gz_avail:
   56|  23.8k|local int gz_avail(gz_statep state) {
   57|  23.8k|    unsigned got;
   58|  23.8k|    z_streamp strm = &(state->strm);
   59|       |
   60|  23.8k|    if (state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  181|  47.6k|#define Z_OK            0
  ------------------
                  if (state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (60:9): [True: 0, False: 23.8k]
  |  Branch (60:31): [True: 0, False: 0]
  ------------------
   61|      0|        return -1;
   62|  23.8k|    if (state->eof == 0) {
  ------------------
  |  Branch (62:9): [True: 23.8k, False: 0]
  ------------------
   63|  23.8k|        if (strm->avail_in) {       /* copy what's there to the start */
  ------------------
  |  Branch (63:13): [True: 0, False: 23.8k]
  ------------------
   64|      0|            unsigned char *p = state->in;
   65|      0|            unsigned const char *q = strm->next_in;
   66|       |
   67|      0|            if (q != p) {
  ------------------
  |  Branch (67:17): [True: 0, False: 0]
  ------------------
   68|      0|                unsigned n = strm->avail_in;
   69|       |
   70|      0|                do {
   71|      0|                    *p++ = *q++;
   72|      0|                } while (--n);
  ------------------
  |  Branch (72:26): [True: 0, False: 0]
  ------------------
   73|      0|            }
   74|      0|        }
   75|  23.8k|        if (gz_load(state, state->in + strm->avail_in,
  ------------------
  |  Branch (75:13): [True: 0, False: 23.8k]
  ------------------
   76|  23.8k|                    state->size - strm->avail_in, &got) == -1)
   77|      0|            return -1;
   78|  23.8k|        strm->avail_in += got;
   79|  23.8k|        strm->next_in = state->in;
   80|  23.8k|    }
   81|  23.8k|    return 0;
   82|  23.8k|}
gzread.c:gz_look:
   93|  4.24k|local int gz_look(gz_statep state) {
   94|  4.24k|    z_streamp strm = &(state->strm);
   95|       |
   96|       |    /* allocate read buffers and inflate memory */
   97|  4.24k|    if (state->size == 0) {
  ------------------
  |  Branch (97:9): [True: 4.22k, False: 20]
  ------------------
   98|       |        /* allocate buffers */
   99|  4.22k|        state->in = (unsigned char *)malloc(state->want);
  100|  4.22k|        state->out = (unsigned char *)malloc(state->want << 1);
  101|  4.22k|        if (state->in == NULL || state->out == NULL) {
  ------------------
  |  Branch (101:13): [True: 0, False: 4.22k]
  |  Branch (101:34): [True: 0, False: 4.22k]
  ------------------
  102|      0|            free(state->out);
  103|      0|            free(state->in);
  104|      0|            gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  105|      0|            return -1;
  106|      0|        }
  107|  4.22k|        state->size = state->want;
  108|       |
  109|       |        /* allocate inflate memory */
  110|  4.22k|        state->strm.zalloc = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  111|  4.22k|        state->strm.zfree = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  112|  4.22k|        state->strm.opaque = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  113|  4.22k|        state->strm.avail_in = 0;
  114|  4.22k|        state->strm.next_in = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  115|  4.22k|        if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */
  ------------------
  |  | 1950|  4.22k|          inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
  |  |  ------------------
  |  |  |  |   44|  4.22k|#define ZLIB_VERSION "1.4.0.1-motley"
  |  |  ------------------
  |  | 1951|  4.22k|                        (int)sizeof(z_stream))
  ------------------
                      if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  |  Branch (115:13): [True: 0, False: 4.22k]
  ------------------
  116|      0|            free(state->out);
  117|      0|            free(state->in);
  118|      0|            state->size = 0;
  119|      0|            gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  120|      0|            return -1;
  121|      0|        }
  122|  4.22k|    }
  123|       |
  124|       |    /* if transparent reading is disabled, which would only be at the start, or
  125|       |       if we're looking for a gzip member after the first one, which is not at
  126|       |       the start, then proceed directly to look for a gzip member next */
  127|  4.24k|    if (state->direct == -1 || state->junk == 0) {
  ------------------
  |  Branch (127:9): [True: 0, False: 4.24k]
  |  Branch (127:32): [True: 20, False: 4.22k]
  ------------------
  128|       |        /* wait for input before committing to another gzip member */
  129|     20|        if (state->junk == 0 && strm->avail_in == 0) {
  ------------------
  |  Branch (129:13): [True: 20, False: 0]
  |  Branch (129:33): [True: 20, False: 0]
  ------------------
  130|     20|            if (gz_avail(state) == -1)
  ------------------
  |  Branch (130:17): [True: 0, False: 20]
  ------------------
  131|      0|                return -1;
  132|     20|            if (strm->avail_in == 0)
  ------------------
  |  Branch (132:17): [True: 20, False: 0]
  ------------------
  133|     20|                return 0;
  134|     20|        }
  135|      0|        inflateReset(strm);
  136|      0|        state->how = GZIP;
  ------------------
  |  |  183|      0|#define GZIP 2      /* decompress a gzip stream */
  ------------------
  137|      0|        state->junk = state->junk != -1;
  138|      0|        state->direct = 0;
  139|      0|        return 0;
  140|     20|    }
  141|       |
  142|       |    /* otherwise we're at the start with auto-detect -- we check to see if the
  143|       |       first four bytes could be gzip header in order to decide whether or not
  144|       |       this will be a transparent read */
  145|       |
  146|       |    /* load any header bytes into the input buffer -- if the input is empty,
  147|       |       then it's not an error as this is a transparent read of zero bytes */
  148|  4.22k|    if (gz_avail(state) == -1)
  ------------------
  |  Branch (148:9): [True: 0, False: 4.22k]
  ------------------
  149|      0|        return -1;
  150|  4.22k|    if (strm->avail_in == 0 || (state->again && strm->avail_in < 4))
  ------------------
  |  Branch (150:9): [True: 0, False: 4.22k]
  |  Branch (150:33): [True: 0, False: 4.22k]
  |  Branch (150:49): [True: 0, False: 0]
  ------------------
  151|       |        /* if non-blocking input stalled before getting four bytes, then
  152|       |           return and wait until a later call has accumulated enough */
  153|      0|        return 0;
  154|       |
  155|       |    /* see if this is (likely) gzip input -- if the first four bytes are
  156|       |       consistent with a gzip header, then go look for the first gzip member,
  157|       |       otherwise proceed to copy the input transparently */
  158|  4.22k|    if (strm->avail_in > 3 &&
  ------------------
  |  Branch (158:9): [True: 4.22k, False: 0]
  ------------------
  159|  4.22k|            strm->next_in[0] == 31 && strm->next_in[1] == 139 &&
  ------------------
  |  Branch (159:13): [True: 4.22k, False: 0]
  |  Branch (159:39): [True: 4.22k, False: 0]
  ------------------
  160|  4.22k|            strm->next_in[2] == 8 && strm->next_in[3] < 32) {
  ------------------
  |  Branch (160:13): [True: 4.22k, False: 0]
  |  Branch (160:38): [True: 4.22k, False: 0]
  ------------------
  161|  4.22k|        inflateReset(strm);
  162|  4.22k|        state->how = GZIP;
  ------------------
  |  |  183|  4.22k|#define GZIP 2      /* decompress a gzip stream */
  ------------------
  163|  4.22k|        state->junk = 0;
  164|  4.22k|        state->direct = 0;
  165|  4.22k|        return 0;
  166|  4.22k|    }
  167|       |
  168|       |    /* doing raw i/o: copy any leftover input to output -- this assumes that
  169|       |       the output buffer is larger than the input buffer, which also assures
  170|       |       space for gzungetc() */
  171|      0|    state->x.next = state->out;
  172|      0|    memcpy(state->x.next, strm->next_in, strm->avail_in);
  173|      0|    state->x.have = strm->avail_in;
  174|      0|    strm->avail_in = 0;
  175|      0|    state->how = COPY;
  ------------------
  |  |  182|      0|#define COPY 1      /* copy input directly */
  ------------------
  176|      0|    return 0;
  177|  4.22k|}
gzread.c:gz_fetch:
  255|  4.24k|local int gz_fetch(gz_statep state) {
  256|  4.24k|    z_streamp strm = &(state->strm);
  257|       |
  258|       |    /* after a serious error, only what is already in the output buffer is
  259|       |       delivered -- don't try to decompress any more */
  260|  4.24k|    if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again)
  ------------------
  |  |  181|  8.49k|#define Z_OK            0
  ------------------
                  if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again)
  ------------------
  |  |  188|  4.24k|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (260:9): [True: 0, False: 4.24k]
  |  Branch (260:31): [True: 0, False: 0]
  |  Branch (260:60): [True: 0, False: 0]
  ------------------
  261|      0|        return -1;
  262|       |
  263|  8.47k|    do {
  264|  8.47k|        switch(state->how) {
  265|  4.24k|        case LOOK:      /* -> LOOK, COPY (only if never GZIP), or GZIP */
  ------------------
  |  |  181|  4.24k|#define LOOK 0      /* look for a gzip header */
  ------------------
  |  Branch (265:9): [True: 4.24k, False: 4.22k]
  ------------------
  266|  4.24k|            if (gz_look(state) == -1)
  ------------------
  |  Branch (266:17): [True: 0, False: 4.24k]
  ------------------
  267|      0|                return -1;
  268|  4.24k|            if (state->how == LOOK)
  ------------------
  |  |  181|  4.24k|#define LOOK 0      /* look for a gzip header */
  ------------------
  |  Branch (268:17): [True: 20, False: 4.22k]
  ------------------
  269|     20|                return 0;
  270|  4.22k|            break;
  271|  4.22k|        case COPY:      /* -> COPY */
  ------------------
  |  |  182|      0|#define COPY 1      /* copy input directly */
  ------------------
  |  Branch (271:9): [True: 0, False: 8.47k]
  ------------------
  272|      0|            if (gz_load(state, state->out, state->size << 1, &(state->x.have))
  ------------------
  |  Branch (272:17): [True: 0, False: 0]
  ------------------
  273|      0|                    == -1)
  274|      0|                return -1;
  275|      0|            state->x.next = state->out;
  276|      0|            return 0;
  277|  4.22k|        case GZIP:      /* -> GZIP or LOOK (if end of gzip stream) */
  ------------------
  |  |  183|  4.22k|#define GZIP 2      /* decompress a gzip stream */
  ------------------
  |  Branch (277:9): [True: 4.22k, False: 4.24k]
  ------------------
  278|  4.22k|            strm->avail_out = state->size << 1;
  279|  4.22k|            strm->next_out = state->out;
  280|  4.22k|            if (gz_decomp(state) == -1)
  ------------------
  |  Branch (280:17): [True: 0, False: 4.22k]
  ------------------
  281|      0|                return -1;
  282|  4.22k|            break;
  283|  4.22k|        default:
  ------------------
  |  Branch (283:9): [True: 0, False: 8.47k]
  ------------------
  284|      0|            gz_error(state, Z_STREAM_ERROR, "state corrupt");
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  285|      0|            return -1;
  286|  8.47k|        }
  287|  8.47k|    } while (state->x.have == 0 && (!state->eof || strm->avail_in));
  ------------------
  |  Branch (287:14): [True: 4.22k, False: 4.22k]
  |  Branch (287:37): [True: 2.05k, False: 2.17k]
  |  Branch (287:52): [True: 2.17k, False: 0]
  ------------------
  288|  4.22k|    return 0;
  289|  4.24k|}

gzwrite:
  270|  18.7k|int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len) {
  271|  18.7k|    gz_statep state;
  272|       |
  273|       |    /* get internal structure */
  274|  18.7k|    if (file == NULL)
  ------------------
  |  Branch (274:9): [True: 0, False: 18.7k]
  ------------------
  275|      0|        return 0;
  276|  18.7k|    state = (gz_statep)file;
  277|       |
  278|       |    /* check that we're writing and that there's no (serious) error */
  279|  18.7k|    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
  ------------------
  |  |  177|  37.5k|#define GZ_WRITE 31153
  ------------------
                  if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
  ------------------
  |  |  181|  37.5k|#define Z_OK            0
  ------------------
  |  Branch (279:9): [True: 0, False: 18.7k]
  |  Branch (279:37): [True: 0, False: 18.7k]
  |  Branch (279:59): [True: 0, False: 0]
  ------------------
  280|      0|        return 0;
  281|  18.7k|    gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|  18.7k|#define Z_OK            0
  ------------------
  282|       |
  283|       |    /* since an int is returned, make sure len fits in one, otherwise return
  284|       |       with an error (this avoids a flaw in the interface) */
  285|  18.7k|    if ((int)len < 0) {
  ------------------
  |  Branch (285:9): [True: 0, False: 18.7k]
  ------------------
  286|      0|        gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
  287|      0|        return 0;
  288|      0|    }
  289|       |
  290|       |    /* write len bytes from buf (the return value will fit in an int) */
  291|  18.7k|    return (int)gz_write(state, buf, len);
  292|  18.7k|}
gzclose_w:
  702|  4.22k|int ZEXPORT gzclose_w(gzFile file) {
  703|  4.22k|    int ret = Z_OK;
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  704|  4.22k|    gz_statep state;
  705|       |
  706|       |    /* get internal structure */
  707|  4.22k|    if (file == NULL)
  ------------------
  |  Branch (707:9): [True: 0, False: 4.22k]
  ------------------
  708|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  709|  4.22k|    state = (gz_statep)file;
  710|       |
  711|       |    /* check that we're writing */
  712|  4.22k|    if (state->mode != GZ_WRITE)
  ------------------
  |  |  177|  4.22k|#define GZ_WRITE 31153
  ------------------
  |  Branch (712:9): [True: 0, False: 4.22k]
  ------------------
  713|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  714|       |
  715|       |    /* check for seek request */
  716|  4.22k|    if (state->skip && gz_zero(state) == -1)
  ------------------
  |  Branch (716:9): [True: 0, False: 4.22k]
  |  Branch (716:24): [True: 0, False: 0]
  ------------------
  717|      0|        ret = state->err;
  718|       |
  719|       |    /* flush, free memory, and close file */
  720|  4.22k|    if (gz_comp(state, Z_FINISH) == -1)
  ------------------
  |  |  176|  4.22k|#define Z_FINISH        4
  ------------------
  |  Branch (720:9): [True: 0, False: 4.22k]
  ------------------
  721|      0|        ret = state->err;
  722|  4.22k|    if (state->size) {
  ------------------
  |  Branch (722:9): [True: 4.22k, False: 0]
  ------------------
  723|  4.22k|        if (!state->direct) {
  ------------------
  |  Branch (723:13): [True: 4.22k, False: 0]
  ------------------
  724|  4.22k|            (void)deflateEnd(&(state->strm));
  725|  4.22k|            free(state->out);
  726|  4.22k|        }
  727|  4.22k|        free(state->in);
  728|  4.22k|    }
  729|  4.22k|    gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  730|  4.22k|    free(state->path);
  731|  4.22k|    if (close(state->fd) == -1)
  ------------------
  |  Branch (731:9): [True: 0, False: 4.22k]
  ------------------
  732|      0|        ret = Z_ERRNO;
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
  733|  4.22k|    free(state);
  734|  4.22k|    return ret;
  735|  4.22k|}
gzwrite.c:gz_write:
  199|  18.7k|local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
  200|  18.7k|    z_size_t put = len;
  201|  18.7k|    int ret;
  202|       |
  203|       |    /* if len is zero, avoid unnecessary operations */
  204|  18.7k|    if (len == 0)
  ------------------
  |  Branch (204:9): [True: 0, False: 18.7k]
  ------------------
  205|      0|        return 0;
  206|       |
  207|       |    /* allocate memory if this is the first time through */
  208|  18.7k|    if (state->size == 0 && gz_init(state) == -1)
  ------------------
  |  Branch (208:9): [True: 4.22k, False: 14.5k]
  |  Branch (208:29): [True: 0, False: 4.22k]
  ------------------
  209|      0|        return 0;
  210|       |
  211|       |    /* check for seek request */
  212|  18.7k|    if (state->skip && gz_zero(state) == -1)
  ------------------
  |  Branch (212:9): [True: 0, False: 18.7k]
  |  Branch (212:24): [True: 0, False: 0]
  ------------------
  213|      0|        return 0;
  214|       |
  215|       |    /* for small len, copy to input buffer, otherwise compress directly */
  216|  18.7k|    if (len < state->size) {
  ------------------
  |  Branch (216:9): [True: 3.16k, False: 15.6k]
  ------------------
  217|       |        /* copy to input buffer, compress when full */
  218|  3.16k|        for (;;) {
  219|  3.16k|            unsigned have, copy;
  220|       |
  221|  3.16k|            if (state->strm.avail_in == 0)
  ------------------
  |  Branch (221:17): [True: 3.16k, False: 0]
  ------------------
  222|  3.16k|                state->strm.next_in = state->in;
  223|  3.16k|            have = (unsigned)((state->strm.next_in + state->strm.avail_in) -
  224|  3.16k|                              state->in);
  225|  3.16k|            copy = state->size - have;
  226|  3.16k|            if (copy > len)
  ------------------
  |  Branch (226:17): [True: 3.16k, False: 0]
  ------------------
  227|  3.16k|                copy = (unsigned)len;
  228|  3.16k|            memcpy(state->in + have, buf, copy);
  229|  3.16k|            state->strm.avail_in += copy;
  230|  3.16k|            state->x.pos += copy;
  231|  3.16k|            buf = (const char *)buf + copy;
  232|  3.16k|            len -= copy;
  233|  3.16k|            if (len == 0)
  ------------------
  |  Branch (233:17): [True: 3.16k, False: 0]
  ------------------
  234|  3.16k|                break;
  235|      0|            if (gz_comp(state, Z_NO_FLUSH) == -1)
  ------------------
  |  |  172|      0|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (235:17): [True: 0, False: 0]
  ------------------
  236|      0|                return state->again ? put - len : 0;
  ------------------
  |  Branch (236:24): [True: 0, False: 0]
  ------------------
  237|      0|        }
  238|  3.16k|    }
  239|  15.6k|    else {
  240|       |        /* consume whatever's left in the input buffer */
  241|  15.6k|        if (state->strm.avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
  ------------------
  |  |  172|      0|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (241:13): [True: 0, False: 15.6k]
  |  Branch (241:37): [True: 0, False: 0]
  ------------------
  242|      0|            return 0;
  243|       |
  244|       |        /* directly compress user buffer to file */
  245|  15.6k|        state->strm.next_in = (z_const Bytef *)buf;
  246|  15.6k|        do {
  247|  15.6k|            unsigned n = (unsigned)-1;
  248|       |
  249|  15.6k|            if (n > len)
  ------------------
  |  Branch (249:17): [True: 15.6k, False: 0]
  ------------------
  250|  15.6k|                n = (unsigned)len;
  251|  15.6k|            state->strm.avail_in = n;
  252|  15.6k|            ret = gz_comp(state, Z_NO_FLUSH);
  ------------------
  |  |  172|  15.6k|#define Z_NO_FLUSH      0
  ------------------
  253|  15.6k|            n -= state->strm.avail_in;
  254|  15.6k|            state->x.pos += n;
  255|  15.6k|            len -= n;
  256|  15.6k|            if (ret == -1) {
  ------------------
  |  Branch (256:17): [True: 0, False: 15.6k]
  ------------------
  257|      0|                state->strm.avail_in = 0;
  258|      0|                state->strm.next_in = state->in;
  259|      0|                return state->again ? put - len : 0;
  ------------------
  |  Branch (259:24): [True: 0, False: 0]
  ------------------
  260|      0|            }
  261|  15.6k|        } while (len);
  ------------------
  |  Branch (261:18): [True: 0, False: 15.6k]
  ------------------
  262|  15.6k|        state->strm.next_in = state->in;
  263|  15.6k|    }
  264|       |
  265|       |    /* input was all buffered or compressed */
  266|  18.7k|    return put;
  267|  18.7k|}
gzwrite.c:gz_init:
   11|  4.22k|local int gz_init(gz_statep state) {
   12|  4.22k|    int ret;
   13|  4.22k|    z_streamp strm = &(state->strm);
   14|       |
   15|       |    /* allocate input buffer (double size for gzprintf) */
   16|  4.22k|    state->in = (unsigned char *)malloc(state->want << 1);
   17|  4.22k|    if (state->in == NULL) {
  ------------------
  |  Branch (17:9): [True: 0, False: 4.22k]
  ------------------
   18|      0|        gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
   19|      0|        return -1;
   20|      0|    }
   21|       |
   22|       |    /* only need output buffer and deflate state if compressing */
   23|  4.22k|    if (!state->direct) {
  ------------------
  |  Branch (23:9): [True: 4.22k, False: 0]
  ------------------
   24|       |        /* allocate output buffer */
   25|  4.22k|        state->out = (unsigned char *)malloc(state->want);
   26|  4.22k|        if (state->out == NULL) {
  ------------------
  |  Branch (26:13): [True: 0, False: 4.22k]
  ------------------
   27|      0|            free(state->in);
   28|      0|            gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
   29|      0|            return -1;
   30|      0|        }
   31|       |
   32|       |        /* allocate deflate memory, set up for gzip compression */
   33|  4.22k|        strm->zalloc = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   34|  4.22k|        strm->zfree = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   35|  4.22k|        strm->opaque = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   36|  4.22k|        ret = deflateInit2(strm, state->level, Z_DEFLATED,
  ------------------
  |  | 1947|  4.22k|          deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
  |  | 1948|  4.22k|                        (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
  |  |  ------------------
  |  |  |  |   44|  4.22k|#define ZLIB_VERSION "1.4.0.1-motley"
  |  |  ------------------
  ------------------
   37|  4.22k|                           MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
   38|  4.22k|        if (ret != Z_OK) {
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  |  Branch (38:13): [True: 0, False: 4.22k]
  ------------------
   39|      0|            free(state->out);
   40|      0|            free(state->in);
   41|      0|            gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
   42|      0|            return -1;
   43|      0|        }
   44|  4.22k|    }
   45|  4.22k|    strm->next_in = NULL;
   46|       |
   47|       |    /* mark state as initialized */
   48|  4.22k|    state->size = state->want;
   49|       |
   50|       |    /* initialize write buffer if compressing */
   51|  4.22k|    if (!state->direct) {
  ------------------
  |  Branch (51:9): [True: 4.22k, False: 0]
  ------------------
   52|  4.22k|        strm->avail_out = state->size;
   53|  4.22k|        strm->next_out = state->out;
   54|  4.22k|        state->x.next = strm->next_out;
   55|  4.22k|    }
   56|  4.22k|    return 0;
   57|  4.22k|}
gzwrite.c:gz_comp:
   65|  19.8k|local int gz_comp(gz_statep state, int flush) {
   66|  19.8k|    int ret, writ;
   67|  19.8k|    unsigned have, put, max = ((unsigned)-1 >> 2) + 1;
   68|  19.8k|    z_streamp strm = &(state->strm);
   69|       |
   70|       |    /* allocate memory if this is the first time through */
   71|  19.8k|    if (state->size == 0 && gz_init(state) == -1)
  ------------------
  |  Branch (71:9): [True: 0, False: 19.8k]
  |  Branch (71:29): [True: 0, False: 0]
  ------------------
   72|      0|        return -1;
   73|       |
   74|       |    /* write directly if requested */
   75|  19.8k|    if (state->direct) {
  ------------------
  |  Branch (75:9): [True: 0, False: 19.8k]
  ------------------
   76|      0|        while (strm->avail_in) {
  ------------------
  |  Branch (76:16): [True: 0, False: 0]
  ------------------
   77|      0|            errno = 0;
   78|      0|            state->again = 0;
   79|      0|            put = strm->avail_in > max ? max : strm->avail_in;
  ------------------
  |  Branch (79:19): [True: 0, False: 0]
  ------------------
   80|      0|            writ = (int)write(state->fd, strm->next_in, put);
   81|      0|            if (writ < 0) {
  ------------------
  |  Branch (81:17): [True: 0, False: 0]
  ------------------
   82|      0|                if (BLOCKED(errno))
  ------------------
  |  |  143|      0|#    define BLOCKED(e) ((e) == EAGAIN || (e) == EWOULDBLOCK)
  |  |  ------------------
  |  |  |  Branch (143:25): [True: 0, False: 0]
  |  |  |  Branch (143:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   83|      0|                    state->again = 1;
   84|      0|                gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
                              gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  135|      0|#    define zstrerror() strerror(errno)
  ------------------
   85|      0|                return -1;
   86|      0|            }
   87|      0|            strm->avail_in -= (unsigned)writ;
   88|      0|            strm->next_in += writ;
   89|      0|        }
   90|      0|        return 0;
   91|      0|    }
   92|       |
   93|       |    /* check for a pending reset */
   94|  19.8k|    if (state->reset) {
  ------------------
  |  Branch (94:9): [True: 0, False: 19.8k]
  ------------------
   95|       |        /* don't start a new gzip member unless there is data to write and
   96|       |           we're not flushing */
   97|      0|        if (strm->avail_in == 0 && flush == Z_NO_FLUSH)
  ------------------
  |  |  172|      0|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (97:13): [True: 0, False: 0]
  |  Branch (97:36): [True: 0, False: 0]
  ------------------
   98|      0|            return 0;
   99|      0|        deflateReset(strm);
  100|      0|        state->reset = 0;
  101|      0|    }
  102|       |
  103|       |    /* run deflate() on provided input until it produces no more output */
  104|  19.8k|    ret = Z_OK;
  ------------------
  |  |  181|  19.8k|#define Z_OK            0
  ------------------
  105|  55.7k|    do {
  106|       |        /* write out current buffer contents if full, or if flushing, but if
  107|       |           doing Z_FINISH then don't write until we get to Z_STREAM_END */
  108|  55.7k|        if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
  ------------------
  |  |  172|  72.3k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (108:13): [True: 19.5k, False: 36.1k]
  |  Branch (108:38): [True: 8.43k, False: 27.7k]
  ------------------
  109|  23.7k|            (flush != Z_FINISH || ret == Z_STREAM_END))) {
  ------------------
  |  |  176|  16.8k|#define Z_FINISH        4
  ------------------
                          (flush != Z_FINISH || ret == Z_STREAM_END))) {
  ------------------
  |  |  182|  8.43k|#define Z_STREAM_END    1
  ------------------
  |  Branch (109:14): [True: 0, False: 8.43k]
  |  Branch (109:35): [True: 4.20k, False: 4.22k]
  ------------------
  110|  47.5k|            while (strm->next_out > state->x.next) {
  ------------------
  |  Branch (110:20): [True: 23.7k, False: 23.7k]
  ------------------
  111|  23.7k|                errno = 0;
  112|  23.7k|                state->again = 0;
  113|  23.7k|                put = strm->next_out - state->x.next > (int)max ? max :
  ------------------
  |  Branch (113:23): [True: 0, False: 23.7k]
  ------------------
  114|  23.7k|                      (unsigned)(strm->next_out - state->x.next);
  115|  23.7k|                writ = (int)write(state->fd, state->x.next, put);
  116|  23.7k|                if (writ < 0) {
  ------------------
  |  Branch (116:21): [True: 0, False: 23.7k]
  ------------------
  117|      0|                    if (BLOCKED(errno))
  ------------------
  |  |  143|      0|#    define BLOCKED(e) ((e) == EAGAIN || (e) == EWOULDBLOCK)
  |  |  ------------------
  |  |  |  Branch (143:25): [True: 0, False: 0]
  |  |  |  Branch (143:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  118|      0|                        state->again = 1;
  119|      0|                    gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
                                  gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  135|      0|#    define zstrerror() strerror(errno)
  ------------------
  120|      0|                    return -1;
  121|      0|                }
  122|  23.7k|                state->x.next += writ;
  123|  23.7k|            }
  124|  23.7k|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (124:17): [True: 19.5k, False: 4.20k]
  ------------------
  125|  19.5k|                strm->avail_out = state->size;
  126|  19.5k|                strm->next_out = state->out;
  127|  19.5k|                state->x.next = state->out;
  128|  19.5k|            }
  129|  23.7k|        }
  130|       |
  131|       |        /* compress */
  132|  55.7k|        have = strm->avail_out;
  133|  55.7k|        ret = deflate(strm, flush);
  134|  55.7k|        if (ret == Z_STREAM_ERROR) {
  ------------------
  |  |  185|  55.7k|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (134:13): [True: 0, False: 55.7k]
  ------------------
  135|      0|            gz_error(state, Z_STREAM_ERROR,
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  136|      0|                      "internal error: deflate stream corrupt");
  137|      0|            return -1;
  138|      0|        }
  139|  55.7k|        have -= strm->avail_out;
  140|  55.7k|    } while (have);
  ------------------
  |  Branch (140:14): [True: 35.9k, False: 19.8k]
  ------------------
  141|       |
  142|       |    /* if that completed a deflate stream, allow another to start */
  143|  19.8k|    if (flush == Z_FINISH)
  ------------------
  |  |  176|  19.8k|#define Z_FINISH        4
  ------------------
  |  Branch (143:9): [True: 4.22k, False: 15.6k]
  ------------------
  144|  4.22k|        state->reset = 1;
  145|       |
  146|       |    /* all done, no errors */
  147|  19.8k|    return 0;
  148|  19.8k|}

inflate_fast:
  215|  48.1k|void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
  216|  48.1k|    struct inflate_state FAR *state;
  217|  48.1k|    z_const unsigned char FAR *in;      /* local strm->next_in */
  218|  48.1k|    z_const unsigned char FAR *last;    /* have enough input while in < last */
  219|  48.1k|    unsigned char FAR *out;     /* local strm->next_out */
  220|  48.1k|    unsigned char FAR *beg;     /* inflate()'s initial strm->next_out */
  221|  48.1k|    unsigned char FAR *end;     /* while out < end, enough space available */
  222|       |#ifdef INFLATE_STRICT
  223|       |    unsigned dmax;              /* maximum distance from zlib header */
  224|       |#endif
  225|  48.1k|    unsigned wsize;             /* window size or zero if not using window */
  226|  48.1k|    unsigned whave;             /* valid bytes in the window */
  227|  48.1k|    unsigned wnext;             /* window write index */
  228|  48.1k|    unsigned char FAR *window;  /* allocated sliding window, if wsize != 0 */
  229|  48.1k|#if Z_INFLATE_FETCH != 8
  230|  48.1k|    int back;                   /* decoding into the window: inflateBack() */
  231|  48.1k|#endif
  232|  48.1k|    unsigned long hold;         /* local strm->hold */
  233|  48.1k|    unsigned bits;              /* local strm->bits */
  234|  48.1k|    code const FAR *lcode;      /* local strm->lencode */
  235|  48.1k|    code const FAR *dcode;      /* local strm->distcode */
  236|  48.1k|    unsigned lmask;             /* mask for first level of length codes */
  237|  48.1k|    unsigned dmask;             /* mask for first level of distance codes */
  238|  48.1k|    code const *here;           /* retrieved table entry */
  239|  48.1k|    unsigned op;                /* code bits, operation, extra bits, or */
  240|       |                                /*  window position, window bytes to copy */
  241|  48.1k|    unsigned len;               /* match length, unused bytes */
  242|  48.1k|    unsigned dist;              /* match distance */
  243|  48.1k|    unsigned char FAR *from;    /* where to copy match from */
  244|  48.1k|#if Z_INFLATE_FETCH == 64
  245|  48.1k|    Z_U8 hold8;                 /* 64-bit bit buffer of the fast loop */
  ------------------
  |  |   56|  48.1k|#    define Z_U8 unsigned long
  ------------------
  246|  48.1k|    z_const unsigned char FAR *last8;   /* two refills fit after in */
  247|  48.1k|    unsigned char FAR *end8;    /* room for two literals, a match, 15 more */
  248|  48.1k|#endif
  249|       |#if Z_INFLATE_FETCH == 32
  250|       |    Z_U4 hold4;                 /* 32-bit bit buffer of the fast loop */
  251|       |    z_const unsigned char FAR *last4;   /* three refills fit after in */
  252|       |    unsigned char FAR *end4;    /* room for a match and fifteen more */
  253|       |#endif
  254|       |
  255|       |    /* copy state to local variables */
  256|  48.1k|    state = (struct inflate_state FAR *)strm->state;
  257|  48.1k|    in = strm->next_in;
  258|  48.1k|    last = in + (strm->avail_in - 5);
  259|  48.1k|    out = strm->next_out;
  260|  48.1k|    beg = out - (start - strm->avail_out);
  261|  48.1k|    end = out + (strm->avail_out - 257);
  262|       |#ifdef INFLATE_STRICT
  263|       |    dmax = state->dmax;
  264|       |#endif
  265|  48.1k|    wsize = state->wsize;
  266|  48.1k|    whave = state->whave;
  267|  48.1k|    wnext = state->wnext;
  268|  48.1k|    window = state->window;
  269|  48.1k|#if Z_INFLATE_FETCH != 8
  270|       |    /* For inflateBack(), only use the loop at the end, which does not write
  271|       |       past the end of the copy. */
  272|  48.1k|    back = window != Z_NULL && out + strm->avail_out == window + wsize;
  ------------------
  |  |  216|  96.3k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (272:12): [True: 42.4k, False: 5.69k]
  |  Branch (272:32): [True: 0, False: 42.4k]
  ------------------
  273|  48.1k|#endif
  274|  48.1k|    hold = state->hold;
  275|  48.1k|    bits = state->bits;
  276|  48.1k|    lcode = state->lencode;
  277|  48.1k|    dcode = state->distcode;
  278|  48.1k|    lmask = (1U << state->lenbits) - 1;
  279|  48.1k|    dmask = (1U << state->distbits) - 1;
  280|       |
  281|  48.1k|#if Z_INFLATE_FETCH == 64
  282|       |    /* Fast loop, while sixteen bytes are available at in (two refills of eight
  283|       |       bytes, the first advancing in by up to seven) and the output has room
  284|       |       for the longest match plus 17 bytes (one iteration can write two
  285|       |       literals and then a match, and copy_back() may write 15 bytes past the
  286|       |       match). Each length/literal code starts with at least 56 bits in hold8,
  287|       |       enough for a length/distance pair (at most 48 bits). */
  288|  48.1k|    if (!back && strm->avail_in >= 16 && strm->avail_out >= 2 + 258 + 15) {
  ------------------
  |  Branch (288:9): [True: 48.1k, False: 0]
  |  Branch (288:18): [True: 23.7k, False: 24.4k]
  |  Branch (288:42): [True: 23.7k, False: 28]
  ------------------
  289|  23.7k|        last8 = in + (strm->avail_in - 16);
  290|  23.7k|        end8 = out + (strm->avail_out - (2 + 258 + 15));
  291|  23.7k|        hold8 = hold;
  292|  48.7M|        do {
  293|  48.7M|            hold8 |= load64(in) << bits;
  294|  48.7M|            in += (63 - bits) >> 3;
  295|  48.7M|            bits |= 56;
  296|  48.7M|            here = lcode + (hold8 & lmask);
  297|  48.7M|            if (here->op == 0) {        /* up to three literals a refill */
  ------------------
  |  Branch (297:17): [True: 45.8M, False: 2.90M]
  ------------------
  298|  45.8M|                hold8 >>= here->bits;
  299|  45.8M|                bits -= here->bits;
  300|  45.8M|                TRACE_LITERAL(here);
  301|  45.8M|                *out++ = (unsigned char)(here->val);
  302|  45.8M|                here = lcode + (hold8 & lmask);
  303|  45.8M|                if (here->op == 0) {
  ------------------
  |  Branch (303:21): [True: 44.1M, False: 1.67M]
  ------------------
  304|  44.1M|                    hold8 >>= here->bits;
  305|  44.1M|                    bits -= here->bits;
  306|  44.1M|                    TRACE_LITERAL(here);
  307|  44.1M|                    *out++ = (unsigned char)(here->val);
  308|  44.1M|                    here = lcode + (hold8 & lmask);
  309|  44.1M|                    if (here->op == 0) {
  ------------------
  |  Branch (309:25): [True: 42.8M, False: 1.31M]
  ------------------
  310|  42.8M|                        hold8 >>= here->bits;
  311|  42.8M|                        bits -= here->bits;
  312|  42.8M|                        TRACE_LITERAL(here);
  313|  42.8M|                        *out++ = (unsigned char)(here->val);
  314|  42.8M|                        continue;
  315|  42.8M|                    }
  316|  44.1M|                }
  317|  2.98M|                hold8 |= load64(in) << bits;    /* 56 bits for a pair */
  318|  2.98M|                in += (63 - bits) >> 3;
  319|  2.98M|                bits |= 56;
  320|  2.98M|            }
  321|  6.66M|          dolen8:
  322|  6.66M|            op = (unsigned)(here->bits);
  323|  6.66M|            hold8 >>= op;
  324|  6.66M|            bits -= op;
  325|  6.66M|            op = (unsigned)(here->op);
  326|  6.66M|            if (op == 0) {                      /* literal */
  ------------------
  |  Branch (326:17): [True: 690k, False: 5.97M]
  ------------------
  327|   690k|                TRACE_LITERAL(here);
  328|   690k|                *out++ = (unsigned char)(here->val);
  329|   690k|            }
  330|  5.97M|            else if (op & 16) {                 /* length base */
  ------------------
  |  Branch (330:22): [True: 5.19M, False: 782k]
  ------------------
  331|  5.19M|                len = (unsigned)(here->val);
  332|  5.19M|                op &= 15;                       /* number of extra bits */
  333|  5.19M|                len += (unsigned)hold8 & ((1U << op) - 1);
  334|  5.19M|                hold8 >>= op;
  335|  5.19M|                bits -= op;
  336|  5.19M|                Tracevv((stderr, "inflate:         length %u\n", len));
  337|  5.19M|                here = dcode + (hold8 & dmask);
  338|  5.20M|              dodist8:
  339|  5.20M|                op = (unsigned)(here->bits);
  340|  5.20M|                hold8 >>= op;
  341|  5.20M|                bits -= op;
  342|  5.20M|                op = (unsigned)(here->op);
  343|  5.20M|                if (op & 16) {                  /* distance base */
  ------------------
  |  Branch (343:21): [True: 5.19M, False: 12.6k]
  ------------------
  344|  5.19M|                    dist = (unsigned)(here->val);
  345|  5.19M|                    op &= 15;                   /* number of extra bits */
  346|  5.19M|                    dist += (unsigned)hold8 & ((1U << op) - 1);
  347|       |#ifdef INFLATE_STRICT
  348|       |                    if (dist > dmax) {
  349|       |                        strm->msg = (z_const char *)
  350|       |                            "invalid distance too far back";
  351|       |                        state->mode = BAD;
  352|       |                        break;
  353|       |                    }
  354|       |#endif
  355|  5.19M|                    hold8 >>= op;
  356|  5.19M|                    bits -= op;
  357|  5.19M|                    Tracevv((stderr, "inflate:         distance %u\n", dist));
  358|  5.19M|                    op = (unsigned)(out - beg); /* max distance in output */
  359|  5.19M|                    if (dist > op) {            /* see if copy from window */
  ------------------
  |  Branch (359:25): [True: 1.78M, False: 3.40M]
  ------------------
  360|  1.78M|                        op = dist - op;         /* distance back in window */
  361|  1.78M|                        if (op > whave) {
  ------------------
  |  Branch (361:29): [True: 0, False: 1.78M]
  ------------------
  362|      0|                            if (state->sane) {
  ------------------
  |  Branch (362:33): [True: 0, False: 0]
  ------------------
  363|      0|                                strm->msg = (z_const char *)
  364|      0|                                    "invalid distance too far back";
  365|      0|                                state->mode = BAD;
  366|      0|                                break;
  367|      0|                            }
  368|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  369|       |                            if (len <= op - whave) {
  370|       |                                do {
  371|       |                                    *out++ = 0;
  372|       |                                } while (--len);
  373|       |                                continue;
  374|       |                            }
  375|       |                            len -= op - whave;
  376|       |                            do {
  377|       |                                *out++ = 0;
  378|       |                            } while (--op > whave);
  379|       |                            if (op == 0) {
  380|       |                                out = copy_back(out, dist, len);
  381|       |                                continue;
  382|       |                            }
  383|       |#endif
  384|      0|                        }
  385|  1.78M|                        from = window;
  386|  1.78M|                        if (wnext == 0)         /* very common case */
  ------------------
  |  Branch (386:29): [True: 111k, False: 1.67M]
  ------------------
  387|   111k|                            from += wsize - op;
  388|  1.67M|                        else if (wnext < op) {  /* wrap around window */
  ------------------
  |  Branch (388:34): [True: 545k, False: 1.12M]
  ------------------
  389|   545k|                            from += wsize + wnext - op;
  390|   545k|                            op -= wnext;
  391|   545k|                            if (op < len) {     /* end of window, then start */
  ------------------
  |  Branch (391:33): [True: 343, False: 545k]
  ------------------
  392|    343|                                zmemcpy(out, from, op);
  ------------------
  |  |  306|    343|#    define zmemcpy memcpy
  ------------------
  393|    343|                                out += op;
  394|    343|                                len -= op;
  395|    343|                                from = window;
  396|    343|                                op = wnext;
  397|    343|                            }
  398|   545k|                        }
  399|  1.12M|                        else                    /* contiguous in window */
  400|  1.12M|                            from += wnext - op;
  401|  1.78M|                        if (op > len)
  ------------------
  |  Branch (401:29): [True: 1.78M, False: 1.95k]
  ------------------
  402|  1.78M|                            op = len;
  403|  1.78M|                        zmemcpy(out, from, op); /* from the window */
  ------------------
  |  |  306|  1.78M|#    define zmemcpy memcpy
  ------------------
  404|  1.78M|                        out += op;
  405|  1.78M|                        len -= op;
  406|  1.78M|                        if (len)                /* rest from output */
  ------------------
  |  Branch (406:29): [True: 1.61k, False: 1.78M]
  ------------------
  407|  1.61k|                            out = copy_back(out, dist, len);
  408|  1.78M|                    }
  409|  3.40M|                    else
  410|  3.40M|                        out = copy_back(out, dist, len);
  411|  5.19M|                }
  412|  12.6k|                else if ((op & 64) == 0) {      /* 2nd level distance code */
  ------------------
  |  Branch (412:26): [True: 12.6k, False: 0]
  ------------------
  413|  12.6k|                    here = dcode + here->val + (hold8 & ((1U << op) - 1));
  414|  12.6k|                    goto dodist8;
  415|  12.6k|                }
  416|      0|                else {
  417|      0|                    strm->msg = (z_const char *)"invalid distance code";
  418|      0|                    state->mode = BAD;
  419|      0|                    break;
  420|      0|                }
  421|  5.20M|            }
  422|   782k|            else if ((op & 64) == 0) {          /* 2nd level length code */
  ------------------
  |  Branch (422:22): [True: 776k, False: 5.35k]
  ------------------
  423|   776k|                here = lcode + here->val + (hold8 & ((1U << op) - 1));
  424|   776k|                goto dolen8;
  425|   776k|            }
  426|  5.35k|            else if (op & 32) {                 /* end-of-block */
  ------------------
  |  Branch (426:22): [True: 5.35k, False: 0]
  ------------------
  427|  5.35k|                Tracevv((stderr, "inflate:         end of block\n"));
  428|  5.35k|                state->mode = TYPE;
  429|  5.35k|                break;
  430|  5.35k|            }
  431|      0|            else {
  432|      0|                strm->msg = (z_const char *)"invalid literal/length code";
  433|      0|                state->mode = BAD;
  434|      0|                break;
  435|      0|            }
  436|  48.7M|        } while (in <= last8 && out <= end8);
  ------------------
  |  Branch (436:18): [True: 48.7M, False: 13.6k]
  |  Branch (436:33): [True: 48.7M, False: 4.75k]
  ------------------
  437|       |
  438|       |        /* return the whole bytes not used, leaving fewer than eight bits */
  439|  23.7k|        len = bits >> 3;
  440|  23.7k|        in -= len;
  441|  23.7k|        bits -= len << 3;
  442|  23.7k|        hold = (unsigned long)(hold8 & ((1U << bits) - 1));
  443|  23.7k|        if (state->mode != LEN || out >= end)
  ------------------
  |  Branch (443:13): [True: 5.35k, False: 18.3k]
  |  Branch (443:35): [True: 844, False: 17.5k]
  ------------------
  444|  6.19k|            goto leave;
  445|  23.7k|    }
  446|  41.9k|#endif
  447|       |#if Z_INFLATE_FETCH == 32
  448|       |    /* Fast loop with a 32-bit bit buffer, refilled four bytes at a time
  449|       |       without branches. This needs eleven bytes available at in (three refills
  450|       |       of four bytes, the first two advancing in by up to three each) and
  451|       |       enough room in the output for the longest match plus 15 bytes (an
  452|       |       iteration writes up to two literals or one match, which copy_back() may
  453|       |       overrun by fifteen bytes). A refill leaves at least 24 bits, enough for
  454|       |       a length/literal code and its extra bits (at most 20), or a distance
  455|       |       code (at most 15). The distance code gets its own refill, and its extra
  456|       |       bits another refill, when too few bits are left for them. */
  457|       |    if (!back && strm->avail_in >= 11 && strm->avail_out >= 258 + 15) {
  458|       |        last4 = in + (strm->avail_in - 11);
  459|       |        end4 = out + (strm->avail_out - (258 + 15));
  460|       |        hold4 = (Z_U4)hold;
  461|       |        do {
  462|       |            hold4 |= load32(in) << bits;
  463|       |            in += (31 - bits) >> 3;
  464|       |            bits |= 24;
  465|       |            here = lcode + (hold4 & lmask);
  466|       |            if (here->op == 0) {        /* a literal, and another */
  467|       |                hold4 >>= here->bits;
  468|       |                bits -= here->bits;
  469|       |                TRACE_LITERAL(here);
  470|       |                *out++ = (unsigned char)(here->val);
  471|       |                here = lcode + (hold4 & lmask);
  472|       |                if (here->op == 0 && (LENBITS <= 12 || here->bits <= bits)) {
  473|       |                    hold4 >>= here->bits;
  474|       |                    bits -= here->bits;
  475|       |                    TRACE_LITERAL(here);
  476|       |                    *out++ = (unsigned char)(here->val);
  477|       |                }
  478|       |                continue;
  479|       |            }
  480|       |          dolen4:
  481|       |            op = (unsigned)(here->bits);
  482|       |            hold4 >>= op;
  483|       |            bits -= op;
  484|       |            op = (unsigned)(here->op);
  485|       |            if (op == 0) {                      /* literal */
  486|       |                TRACE_LITERAL(here);
  487|       |                *out++ = (unsigned char)(here->val);
  488|       |            }
  489|       |            else if (op & 16) {                 /* length base */
  490|       |                len = (unsigned)(here->val);
  491|       |                op &= 15;                       /* number of extra bits */
  492|       |                len += (unsigned)hold4 & ((1U << op) - 1);
  493|       |                hold4 >>= op;
  494|       |                bits -= op;
  495|       |                Tracevv((stderr, "inflate:         length %u\n", len));
  496|       |                hold4 |= load32(in) << bits;    /* for the distance code */
  497|       |                in += (31 - bits) >> 3;
  498|       |                bits |= 24;
  499|       |                here = dcode + (hold4 & dmask);
  500|       |              dodist4:
  501|       |                op = (unsigned)(here->bits);
  502|       |                hold4 >>= op;
  503|       |                bits -= op;
  504|       |                op = (unsigned)(here->op);
  505|       |                if (op & 16) {                  /* distance base */
  506|       |                    dist = (unsigned)(here->val);
  507|       |                    op &= 15;                   /* number of extra bits */
  508|       |                    if (bits < op) {            /* for long distances */
  509|       |                        hold4 |= load32(in) << bits;
  510|       |                        in += (31 - bits) >> 3;
  511|       |                        bits |= 24;
  512|       |                    }
  513|       |                    dist += (unsigned)hold4 & ((1U << op) - 1);
  514|       |#ifdef INFLATE_STRICT
  515|       |                    if (dist > dmax) {
  516|       |                        strm->msg = (z_const char *)
  517|       |                            "invalid distance too far back";
  518|       |                        state->mode = BAD;
  519|       |                        break;
  520|       |                    }
  521|       |#endif
  522|       |                    hold4 >>= op;
  523|       |                    bits -= op;
  524|       |                    Tracevv((stderr, "inflate:         distance %u\n", dist));
  525|       |                    op = (unsigned)(out - beg); /* max distance in output */
  526|       |                    if (dist > op) {            /* see if copy from window */
  527|       |                        op = dist - op;         /* distance back in window */
  528|       |                        if (op > whave) {
  529|       |                            if (state->sane) {
  530|       |                                strm->msg = (z_const char *)
  531|       |                                    "invalid distance too far back";
  532|       |                                state->mode = BAD;
  533|       |                                break;
  534|       |                            }
  535|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  536|       |                            if (len <= op - whave) {
  537|       |                                do {
  538|       |                                    *out++ = 0;
  539|       |                                } while (--len);
  540|       |                                continue;
  541|       |                            }
  542|       |                            len -= op - whave;
  543|       |                            do {
  544|       |                                *out++ = 0;
  545|       |                            } while (--op > whave);
  546|       |                            if (op == 0) {
  547|       |                                out = copy_back(out, dist, len);
  548|       |                                continue;
  549|       |                            }
  550|       |#endif
  551|       |                        }
  552|       |                        from = window;
  553|       |                        if (wnext == 0)         /* very common case */
  554|       |                            from += wsize - op;
  555|       |                        else if (wnext < op) {  /* wrap around window */
  556|       |                            from += wsize + wnext - op;
  557|       |                            op -= wnext;
  558|       |                            if (op < len) {     /* end of window, then start */
  559|       |                                zmemcpy(out, from, op);
  560|       |                                out += op;
  561|       |                                len -= op;
  562|       |                                from = window;
  563|       |                                op = wnext;
  564|       |                            }
  565|       |                        }
  566|       |                        else                    /* contiguous in window */
  567|       |                            from += wnext - op;
  568|       |                        if (op > len)
  569|       |                            op = len;
  570|       |                        zmemcpy(out, from, op); /* from the window */
  571|       |                        out += op;
  572|       |                        len -= op;
  573|       |                        if (len)                /* rest from output */
  574|       |                            out = copy_back(out, dist, len);
  575|       |                    }
  576|       |                    else
  577|       |                        out = copy_back(out, dist, len);
  578|       |                }
  579|       |                else if ((op & 64) == 0) {      /* 2nd level distance code */
  580|       |                    here = dcode + here->val + (hold4 & ((1U << op) - 1));
  581|       |                    goto dodist4;
  582|       |                }
  583|       |                else {
  584|       |                    strm->msg = (z_const char *)"invalid distance code";
  585|       |                    state->mode = BAD;
  586|       |                    break;
  587|       |                }
  588|       |            }
  589|       |            else if ((op & 64) == 0) {          /* 2nd level length code */
  590|       |                here = lcode + here->val + (hold4 & ((1U << op) - 1));
  591|       |                goto dolen4;
  592|       |            }
  593|       |            else if (op & 32) {                 /* end-of-block */
  594|       |                Tracevv((stderr, "inflate:         end of block\n"));
  595|       |                state->mode = TYPE;
  596|       |                break;
  597|       |            }
  598|       |            else {
  599|       |                strm->msg = (z_const char *)"invalid literal/length code";
  600|       |                state->mode = BAD;
  601|       |                break;
  602|       |            }
  603|       |        } while (in <= last4 && out <= end4);
  604|       |
  605|       |        /* return the whole bytes not used, leaving fewer than eight bits */
  606|       |        len = bits >> 3;
  607|       |        in -= len;
  608|       |        bits -= len << 3;
  609|       |        hold = (unsigned long)(hold4 & ((1U << bits) - 1));
  610|       |        if (state->mode != LEN || in >= last || out >= end)
  611|       |            goto leave;
  612|       |    }
  613|       |#endif
  614|       |
  615|       |    /* decode literals and length/distances until end-of-block or not enough
  616|       |       input data or output space */
  617|   313k|    do {
  618|   313k|        if (bits < 15) {
  ------------------
  |  Branch (618:13): [True: 137k, False: 175k]
  ------------------
  619|   137k|            hold += (unsigned long)(*in++) << bits;
  620|   137k|            bits += 8;
  621|   137k|            hold += (unsigned long)(*in++) << bits;
  622|   137k|            bits += 8;
  623|   137k|        }
  624|   313k|        here = lcode + (hold & lmask);
  625|   317k|      dolen:
  626|   317k|        op = (unsigned)(here->bits);
  627|   317k|        hold >>= op;
  628|   317k|        bits -= op;
  629|   317k|        op = (unsigned)(here->op);
  630|   317k|        if (op == 0) {                          /* literal */
  ------------------
  |  Branch (630:13): [True: 292k, False: 24.4k]
  ------------------
  631|   292k|            Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
  632|   292k|                    "inflate:         literal '%c'\n" :
  633|   292k|                    "inflate:         literal 0x%02x\n", here->val));
  634|   292k|            *out++ = (unsigned char)(here->val);
  635|   292k|        }
  636|  24.4k|        else if (op & 16) {                     /* length base */
  ------------------
  |  Branch (636:18): [True: 16.5k, False: 7.89k]
  ------------------
  637|  16.5k|            len = (unsigned)(here->val);
  638|  16.5k|            op &= 15;                           /* number of extra bits */
  639|  16.5k|            if (op) {
  ------------------
  |  Branch (639:17): [True: 1.90k, False: 14.6k]
  ------------------
  640|  1.90k|                if (bits < op) {
  ------------------
  |  Branch (640:21): [True: 16, False: 1.89k]
  ------------------
  641|     16|                    hold += (unsigned long)(*in++) << bits;
  642|     16|                    bits += 8;
  643|     16|                }
  644|  1.90k|                len += (unsigned)hold & ((1U << op) - 1);
  645|  1.90k|                hold >>= op;
  646|  1.90k|                bits -= op;
  647|  1.90k|            }
  648|  16.5k|            Tracevv((stderr, "inflate:         length %u\n", len));
  649|  16.5k|            if (bits < 15) {
  ------------------
  |  Branch (649:17): [True: 4.91k, False: 11.6k]
  ------------------
  650|  4.91k|                hold += (unsigned long)(*in++) << bits;
  651|  4.91k|                bits += 8;
  652|  4.91k|                hold += (unsigned long)(*in++) << bits;
  653|  4.91k|                bits += 8;
  654|  4.91k|            }
  655|  16.5k|            here = dcode + (hold & dmask);
  656|  16.6k|          dodist:
  657|  16.6k|            op = (unsigned)(here->bits);
  658|  16.6k|            hold >>= op;
  659|  16.6k|            bits -= op;
  660|  16.6k|            op = (unsigned)(here->op);
  661|  16.6k|            if (op & 16) {                      /* distance base */
  ------------------
  |  Branch (661:17): [True: 16.5k, False: 75]
  ------------------
  662|  16.5k|                dist = (unsigned)(here->val);
  663|  16.5k|                op &= 15;                       /* number of extra bits */
  664|  16.5k|                if (bits < op) {
  ------------------
  |  Branch (664:21): [True: 324, False: 16.2k]
  ------------------
  665|    324|                    hold += (unsigned long)(*in++) << bits;
  666|    324|                    bits += 8;
  667|    324|                    if (bits < op) {
  ------------------
  |  Branch (667:25): [True: 3, False: 321]
  ------------------
  668|      3|                        hold += (unsigned long)(*in++) << bits;
  669|      3|                        bits += 8;
  670|      3|                    }
  671|    324|                }
  672|  16.5k|                dist += (unsigned)hold & ((1U << op) - 1);
  673|       |#ifdef INFLATE_STRICT
  674|       |                if (dist > dmax) {
  675|       |                    strm->msg = (z_const char *)
  676|       |                        "invalid distance too far back";
  677|       |                    state->mode = BAD;
  678|       |                    break;
  679|       |                }
  680|       |#endif
  681|  16.5k|                hold >>= op;
  682|  16.5k|                bits -= op;
  683|  16.5k|                Tracevv((stderr, "inflate:         distance %u\n", dist));
  684|  16.5k|                op = (unsigned)(out - beg);     /* max distance in output */
  685|  16.5k|                if (dist > op) {                /* see if copy from window */
  ------------------
  |  Branch (685:21): [True: 3.93k, False: 12.6k]
  ------------------
  686|  3.93k|                    op = dist - op;             /* distance back in window */
  687|  3.93k|                    if (op > whave) {
  ------------------
  |  Branch (687:25): [True: 0, False: 3.93k]
  ------------------
  688|      0|                        if (state->sane) {
  ------------------
  |  Branch (688:29): [True: 0, False: 0]
  ------------------
  689|      0|                            strm->msg = (z_const char *)
  690|      0|                                "invalid distance too far back";
  691|      0|                            state->mode = BAD;
  692|      0|                            break;
  693|      0|                        }
  694|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
  695|       |                        if (len <= op - whave) {
  696|       |                            do {
  697|       |                                *out++ = 0;
  698|       |                            } while (--len);
  699|       |                            continue;
  700|       |                        }
  701|       |                        len -= op - whave;
  702|       |                        do {
  703|       |                            *out++ = 0;
  704|       |                        } while (--op > whave);
  705|       |                        if (op == 0) {
  706|       |                            from = out - dist;
  707|       |                            do {
  708|       |                                *out++ = *from++;
  709|       |                            } while (--len);
  710|       |                            continue;
  711|       |                        }
  712|       |#endif
  713|      0|                    }
  714|  3.93k|                    from = window;
  715|  3.93k|                    if (wnext == 0) {           /* very common case */
  ------------------
  |  Branch (715:25): [True: 587, False: 3.34k]
  ------------------
  716|    587|                        from += wsize - op;
  717|    587|                        if (op < len) {         /* some from window */
  ------------------
  |  Branch (717:29): [True: 21, False: 566]
  ------------------
  718|     21|                            len -= op;
  719|    536|                            do {
  720|    536|                                *out++ = *from++;
  721|    536|                            } while (--op);
  ------------------
  |  Branch (721:38): [True: 515, False: 21]
  ------------------
  722|     21|                            from = out - dist;  /* rest from output */
  723|     21|                        }
  724|    587|                    }
  725|  3.34k|                    else if (wnext < op) {      /* wrap around window */
  ------------------
  |  Branch (725:30): [True: 908, False: 2.43k]
  ------------------
  726|    908|                        from += wsize + wnext - op;
  727|    908|                        op -= wnext;
  728|    908|                        if (op < len) {         /* some from end of window */
  ------------------
  |  Branch (728:29): [True: 65, False: 843]
  ------------------
  729|     65|                            len -= op;
  730|  1.28k|                            do {
  731|  1.28k|                                *out++ = *from++;
  732|  1.28k|                            } while (--op);
  ------------------
  |  Branch (732:38): [True: 1.21k, False: 65]
  ------------------
  733|     65|                            from = window;
  734|     65|                            if (wnext < len) {  /* some from start of window */
  ------------------
  |  Branch (734:33): [True: 21, False: 44]
  ------------------
  735|     21|                                op = wnext;
  736|     21|                                len -= op;
  737|    276|                                do {
  738|    276|                                    *out++ = *from++;
  739|    276|                                } while (--op);
  ------------------
  |  Branch (739:42): [True: 255, False: 21]
  ------------------
  740|     21|                                from = out - dist;      /* rest from output */
  741|     21|                            }
  742|     65|                        }
  743|    908|                    }
  744|  2.43k|                    else {                      /* contiguous in window */
  745|  2.43k|                        from += wnext - op;
  746|  2.43k|                        if (op < len) {         /* some from window */
  ------------------
  |  Branch (746:29): [True: 69, False: 2.36k]
  ------------------
  747|     69|                            len -= op;
  748|    720|                            do {
  749|    720|                                *out++ = *from++;
  750|    720|                            } while (--op);
  ------------------
  |  Branch (750:38): [True: 651, False: 69]
  ------------------
  751|     69|                            from = out - dist;  /* rest from output */
  752|     69|                        }
  753|  2.43k|                    }
  754|  14.5k|                    while (len > 2) {
  ------------------
  |  Branch (754:28): [True: 10.6k, False: 3.93k]
  ------------------
  755|  10.6k|                        *out++ = *from++;
  756|  10.6k|                        *out++ = *from++;
  757|  10.6k|                        *out++ = *from++;
  758|  10.6k|                        len -= 3;
  759|  10.6k|                    }
  760|  3.93k|                    if (len) {
  ------------------
  |  Branch (760:25): [True: 3.15k, False: 781]
  ------------------
  761|  3.15k|                        *out++ = *from++;
  762|  3.15k|                        if (len > 1)
  ------------------
  |  Branch (762:29): [True: 921, False: 2.23k]
  ------------------
  763|    921|                            *out++ = *from++;
  764|  3.15k|                    }
  765|  3.93k|                }
  766|  12.6k|                else {
  767|  12.6k|                    from = out - dist;          /* copy direct from output */
  768|   106k|                    do {                        /* minimum length is three */
  769|   106k|                        *out++ = *from++;
  770|   106k|                        *out++ = *from++;
  771|   106k|                        *out++ = *from++;
  772|   106k|                        len -= 3;
  773|   106k|                    } while (len > 2);
  ------------------
  |  Branch (773:30): [True: 94.2k, False: 12.6k]
  ------------------
  774|  12.6k|                    if (len) {
  ------------------
  |  Branch (774:25): [True: 6.65k, False: 6.00k]
  ------------------
  775|  6.65k|                        *out++ = *from++;
  776|  6.65k|                        if (len > 1)
  ------------------
  |  Branch (776:29): [True: 2.41k, False: 4.23k]
  ------------------
  777|  2.41k|                            *out++ = *from++;
  778|  6.65k|                    }
  779|  12.6k|                }
  780|  16.5k|            }
  781|     75|            else if ((op & 64) == 0) {          /* 2nd level distance code */
  ------------------
  |  Branch (781:22): [True: 75, False: 0]
  ------------------
  782|     75|                here = dcode + here->val + (hold & ((1U << op) - 1));
  783|     75|                goto dodist;
  784|     75|            }
  785|      0|            else {
  786|      0|                strm->msg = (z_const char *)"invalid distance code";
  787|      0|                state->mode = BAD;
  788|      0|                break;
  789|      0|            }
  790|  16.6k|        }
  791|  7.89k|        else if ((op & 64) == 0) {              /* 2nd level length code */
  ------------------
  |  Branch (791:18): [True: 4.13k, False: 3.76k]
  ------------------
  792|  4.13k|            here = lcode + here->val + (hold & ((1U << op) - 1));
  793|  4.13k|            goto dolen;
  794|  4.13k|        }
  795|  3.76k|        else if (op & 32) {                     /* end-of-block */
  ------------------
  |  Branch (795:18): [True: 3.76k, False: 0]
  ------------------
  796|  3.76k|            Tracevv((stderr, "inflate:         end of block\n"));
  797|  3.76k|            state->mode = TYPE;
  798|  3.76k|            break;
  799|  3.76k|        }
  800|      0|        else {
  801|      0|            strm->msg = (z_const char *)"invalid literal/length code";
  802|      0|            state->mode = BAD;
  803|      0|            break;
  804|      0|        }
  805|   317k|    } while (in < last && out < end);
  ------------------
  |  Branch (805:14): [True: 274k, False: 34.2k]
  |  Branch (805:27): [True: 271k, False: 3.96k]
  ------------------
  806|       |
  807|  41.9k|#if Z_INFLATE_FETCH != 8
  808|  48.1k|  leave:
  809|  48.1k|#endif
  810|       |    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  811|  48.1k|    len = bits >> 3;
  812|  48.1k|    in -= len;
  813|  48.1k|    bits -= len << 3;
  814|  48.1k|    hold &= (1U << bits) - 1;
  815|       |
  816|       |    /* update state and return */
  817|  48.1k|    strm->next_in = in;
  818|  48.1k|    strm->next_out = out;
  819|  48.1k|    strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
  ------------------
  |  Branch (819:33): [True: 37.0k, False: 11.1k]
  ------------------
  820|  48.1k|    strm->avail_out = (unsigned)(out < end ?
  ------------------
  |  Branch (820:34): [True: 43.3k, False: 4.80k]
  ------------------
  821|  43.3k|                                 257 + (end - out) : 257 - (out - end));
  822|  48.1k|    state->hold = hold;
  823|  48.1k|    state->bits = bits;
  824|  48.1k|    return;
  825|  41.9k|}
inffast.c:load64:
   76|  51.7M|local Z_U8 load64(z_const unsigned char FAR *p) {
   77|  51.7M|#ifndef Z_INFLATE_BYTES
   78|  51.7M|    Z_U8 v = 1;
  ------------------
  |  |   56|  51.7M|#    define Z_U8 unsigned long
  ------------------
   79|  51.7M|    if (*(unsigned char *)&v) {
  ------------------
  |  Branch (79:9): [True: 51.7M, False: 0]
  ------------------
   80|  51.7M|        zmemcpy(&v, p, 8);
  ------------------
  |  |  306|  51.7M|#    define zmemcpy memcpy
  ------------------
   81|  51.7M|        return v;
   82|  51.7M|    }
   83|      0|#  ifdef Z_BSWAP64
   84|      0|    zmemcpy(&v, p, 8);
  ------------------
  |  |  306|      0|#    define zmemcpy memcpy
  ------------------
   85|      0|    return Z_BSWAP64(v);
  ------------------
  |  |   65|      0|#    define Z_BSWAP64 __builtin_bswap64
  ------------------
   86|      0|#  endif
   87|      0|#endif
   88|      0|    return (Z_U8)p[0] | ((Z_U8)p[1] << 8) | ((Z_U8)p[2] << 16) |
   89|      0|           ((Z_U8)p[3] << 24) | ((Z_U8)p[4] << 32) | ((Z_U8)p[5] << 40) |
   90|      0|           ((Z_U8)p[6] << 48) | ((Z_U8)p[7] << 56);
   91|  51.7M|}
inffast.c:copy_back:
   98|  3.40M|                                   unsigned len) {
   99|  3.40M|    unsigned char FAR *from = out - dist;
  100|  3.40M|    unsigned char FAR *stop = out + len;
  101|       |
  102|  3.40M|    if (dist >= 16) {                   /* sixteen at a time, no overlap */
  ------------------
  |  Branch (102:9): [True: 2.41M, False: 987k]
  ------------------
  103|  3.22M|        do {
  104|  3.22M|            zmemcpy(out, from, 16);
  ------------------
  |  |  306|  3.22M|#    define zmemcpy memcpy
  ------------------
  105|  3.22M|            out += 16;
  106|  3.22M|            from += 16;
  107|  3.22M|        } while (out < stop);
  ------------------
  |  Branch (107:18): [True: 805k, False: 2.41M]
  ------------------
  108|  2.41M|        return stop;
  109|  2.41M|    }
  110|   987k|    if (dist >= 8) {                    /* eight at a time, no overlap */
  ------------------
  |  Branch (110:9): [True: 108k, False: 879k]
  ------------------
  111|   185k|        do {
  112|   185k|            zmemcpy(out, from, 8);
  ------------------
  |  |  306|   185k|#    define zmemcpy memcpy
  ------------------
  113|   185k|            out += 8;
  114|   185k|            from += 8;
  115|   185k|        } while (out < stop);
  ------------------
  |  Branch (115:18): [True: 77.8k, False: 108k]
  ------------------
  116|   108k|        return stop;
  117|   108k|    }
  118|   879k|    if (dist == 1) {                    /* a run of one byte, eight at once */
  ------------------
  |  Branch (118:9): [True: 783k, False: 95.2k]
  ------------------
  119|   783k|#ifdef Z_U8
  120|   783k|        Z_U8 run = *from;
  ------------------
  |  |   56|   783k|#    define Z_U8 unsigned long
  ------------------
  121|   783k|        run |= run << 8;
  122|   783k|        run |= run << 16;
  123|   783k|        run |= run << 32;
  124|  3.16M|        do {
  125|  3.16M|            zmemcpy(out, &run, 8);
  ------------------
  |  |  306|  3.16M|#    define zmemcpy memcpy
  ------------------
  126|  3.16M|            out += 8;
  127|  3.16M|        } while (out < stop);
  ------------------
  |  Branch (127:18): [True: 2.37M, False: 783k]
  ------------------
  128|       |#else
  129|       |        Z_U4 run = *from;
  130|       |        run |= run << 8;
  131|       |        run |= run << 16;
  132|       |        do {
  133|       |            zmemcpy(out, &run, 4);
  134|       |            zmemcpy(out + 4, &run, 4);
  135|       |            out += 8;
  136|       |        } while (out < stop);
  137|       |#endif
  138|   783k|        return stop;
  139|   783k|    }
  140|       |    /* dist 2..7: eight bytes per step, of which the first dist are right;
  141|       |       the next step rewrites the rest. All eight are read before any are
  142|       |       written, since they overlap. */
  143|   582k|    do {
  144|   582k|#ifdef Z_U8
  145|   582k|        Z_U8 v;
  ------------------
  |  |   56|   582k|#    define Z_U8 unsigned long
  ------------------
  146|   582k|        zmemcpy(&v, from, 8);
  ------------------
  |  |  306|   582k|#    define zmemcpy memcpy
  ------------------
  147|   582k|        zmemcpy(out, &v, 8);
  ------------------
  |  |  306|   582k|#    define zmemcpy memcpy
  ------------------
  148|       |#else
  149|       |        Z_U4 v0, v1;
  150|       |        zmemcpy(&v0, from, 4);
  151|       |        zmemcpy(&v1, from + 4, 4);
  152|       |        zmemcpy(out, &v0, 4);
  153|       |        zmemcpy(out + 4, &v1, 4);
  154|       |#endif
  155|   582k|        out += dist;
  156|   582k|        from += dist;
  157|   582k|    } while (out < stop);
  ------------------
  |  Branch (157:14): [True: 487k, False: 95.2k]
  ------------------
  158|  95.2k|    return stop;
  159|   879k|}

inflateResetKeep:
  100|  8.45k|int ZEXPORT inflateResetKeep(z_streamp strm) {
  101|  8.45k|    struct inflate_state FAR *state;
  102|       |
  103|  8.45k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (103:9): [True: 0, False: 8.45k]
  ------------------
  104|  8.45k|    state = (struct inflate_state FAR *)strm->state;
  105|  8.45k|    strm->total_in = strm->total_out = state->total = 0;
  106|  8.45k|    strm->msg = Z_NULL;
  ------------------
  |  |  216|  8.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  107|  8.45k|    strm->data_type = 0;
  108|  8.45k|    if (state->wrap)        /* to support ill-conceived Java test suite */
  ------------------
  |  Branch (108:9): [True: 8.45k, False: 0]
  ------------------
  109|  8.45k|        strm->adler = state->wrap & 1;
  110|  8.45k|    state->mode = HEAD;
  111|  8.45k|    state->last = 0;
  112|  8.45k|    state->havedict = 0;
  113|  8.45k|    state->flags = -1;
  114|  8.45k|    state->dmax = 32768U;
  115|  8.45k|    state->head = Z_NULL;
  ------------------
  |  |  216|  8.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  116|  8.45k|    state->hold = 0;
  117|  8.45k|    state->bits = 0;
  118|  8.45k|    state->lencode = state->distcode = state->next = state->codes;
  119|  8.45k|    state->sane = 1;
  120|  8.45k|    state->back = -1;
  121|  8.45k|    Tracev((stderr, "inflate: reset\n"));
  122|  8.45k|    return Z_OK;
  ------------------
  |  |  181|  8.45k|#define Z_OK            0
  ------------------
  123|  8.45k|}
inflateReset:
  125|  8.45k|int ZEXPORT inflateReset(z_streamp strm) {
  126|  8.45k|    struct inflate_state FAR *state;
  127|       |
  128|  8.45k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (128:9): [True: 0, False: 8.45k]
  ------------------
  129|  8.45k|    state = (struct inflate_state FAR *)strm->state;
  130|  8.45k|    if (state->wbits != state->reqbits) {
  ------------------
  |  Branch (130:9): [True: 0, False: 8.45k]
  ------------------
  131|      0|        if (state->window != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (131:13): [True: 0, False: 0]
  ------------------
  132|      0|            ZFREE(strm, state->window);
  ------------------
  |  |  344|      0|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  133|      0|            state->window = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  134|      0|        }
  135|      0|        state->wbits = state->reqbits;
  136|      0|    }
  137|  8.45k|    state->wrap = state->reqwrap;
  138|  8.45k|    state->wsize = 0;
  139|  8.45k|    state->whave = 0;
  140|  8.45k|    state->wnext = 0;
  141|  8.45k|    return inflateResetKeep(strm);
  142|  8.45k|}
inflateReset2:
  144|  4.22k|int ZEXPORT inflateReset2(z_streamp strm, int windowBits) {
  145|  4.22k|    int wrap;
  146|  4.22k|    struct inflate_state FAR *state;
  147|       |
  148|       |    /* get the state */
  149|  4.22k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (149:9): [True: 0, False: 4.22k]
  ------------------
  150|  4.22k|    state = (struct inflate_state FAR *)strm->state;
  151|       |
  152|       |    /* extract wrap request from windowBits parameter */
  153|  4.22k|    if (windowBits < 0) {
  ------------------
  |  Branch (153:9): [True: 0, False: 4.22k]
  ------------------
  154|      0|        if (windowBits < -15)
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  156|      0|        wrap = 0;
  157|      0|        windowBits = -windowBits;
  158|      0|    }
  159|  4.22k|    else {
  160|  4.22k|        wrap = (windowBits >> 4) + 5;
  161|  4.22k|#ifdef GUNZIP
  162|  4.22k|        if (windowBits < 48)
  ------------------
  |  Branch (162:13): [True: 4.22k, False: 0]
  ------------------
  163|  4.22k|            windowBits &= 15;
  164|  4.22k|#endif
  165|  4.22k|    }
  166|       |
  167|       |    /* set number of window bits, free window if different */
  168|  4.22k|    if (windowBits && (windowBits < 8 || windowBits > 15))
  ------------------
  |  Branch (168:9): [True: 4.22k, False: 0]
  |  Branch (168:24): [True: 0, False: 4.22k]
  |  Branch (168:42): [True: 0, False: 4.22k]
  ------------------
  169|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  170|  4.22k|    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
  ------------------
  |  |  216|  8.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (170:9): [True: 0, False: 4.22k]
  |  Branch (170:36): [True: 0, False: 0]
  ------------------
  171|      0|        ZFREE(strm, state->window);
  ------------------
  |  |  344|      0|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  172|      0|        state->window = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  173|      0|    }
  174|       |
  175|       |    /* update state and reset the rest of it */
  176|  4.22k|    state->reqwrap = state->wrap = wrap;
  177|  4.22k|    state->reqbits = state->wbits = (unsigned)windowBits;
  178|  4.22k|    return inflateReset(strm);
  179|  4.22k|}
inflateInit2_:
  182|  4.22k|                          const char *version, int stream_size) {
  183|  4.22k|    int ret;
  184|  4.22k|    struct inflate_state FAR *state;
  185|       |
  186|  4.22k|    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
  ------------------
  |  |  216|  8.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
  ------------------
  |  |   44|  4.22k|#define ZLIB_VERSION "1.4.0.1-motley"
  ------------------
  |  Branch (186:9): [True: 0, False: 4.22k]
  |  Branch (186:30): [True: 0, False: 4.22k]
  ------------------
  187|  4.22k|        stream_size != (int)(sizeof(z_stream)))
  ------------------
  |  Branch (187:9): [True: 0, False: 4.22k]
  ------------------
  188|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  189|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  189|  4.22k|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  216|  4.22k|#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 (189:9): [True: 0, False: 4.22k]
  ------------------
  190|  4.22k|    strm->msg = Z_NULL;                 /* in case we return an error */
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  191|  4.22k|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (191:9): [True: 4.22k, False: 0]
  ------------------
  192|       |#ifdef Z_SOLO
  193|       |        return Z_STREAM_ERROR;
  194|       |#else
  195|  4.22k|        strm->zalloc = zcalloc;
  196|  4.22k|        strm->opaque = (voidpf)0;
  197|  4.22k|#endif
  198|  4.22k|    }
  199|  4.22k|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (199:9): [True: 4.22k, False: 0]
  ------------------
  200|       |#ifdef Z_SOLO
  201|       |        return Z_STREAM_ERROR;
  202|       |#else
  203|  4.22k|        strm->zfree = zcfree;
  204|  4.22k|#endif
  205|  4.22k|    state = (struct inflate_state FAR *)
  206|  4.22k|            ZALLOC(strm, 1, sizeof(struct inflate_state));
  ------------------
  |  |  343|  4.22k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  207|  4.22k|    if (state == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  216|  4.22k|#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 (207:9): [True: 0, False: 4.22k]
  ------------------
  208|  4.22k|    zmemzero(state, sizeof(struct inflate_state));
  ------------------
  |  |  308|  4.22k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  209|  4.22k|    Tracev((stderr, "inflate: allocated\n"));
  210|  4.22k|    strm->state = (struct internal_state FAR *)state;
  211|  4.22k|    state->strm = strm;
  212|  4.22k|    state->window = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  213|  4.22k|    state->mode = HEAD;     /* to pass state test in inflateReset2() */
  214|  4.22k|    ret = inflateReset2(strm, windowBits);
  215|  4.22k|    if (ret != Z_OK) {
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
  |  Branch (215:9): [True: 0, False: 4.22k]
  ------------------
  216|      0|        ZFREE(strm, state);
  ------------------
  |  |  344|      0|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  217|      0|        strm->state = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  218|      0|    }
  219|  4.22k|    return ret;
  220|  4.22k|}
inflate:
  482|  29.6k|int ZEXPORT inflate(z_streamp strm, int flush) {
  483|  29.6k|    struct inflate_state FAR *state;
  484|  29.6k|    z_const unsigned char FAR *next;    /* next input */
  485|  29.6k|    unsigned char FAR *put;     /* next output */
  486|  29.6k|    unsigned have, left;        /* available input and output */
  487|  29.6k|    unsigned long hold;         /* bit buffer */
  488|  29.6k|    unsigned bits;              /* bits in bit buffer */
  489|  29.6k|    unsigned in, out;           /* save starting available input and output */
  490|  29.6k|    unsigned copy;              /* number of stored or match bytes to copy */
  491|  29.6k|    unsigned char FAR *from;    /* where to copy match bytes from */
  492|  29.6k|    code here;                  /* current decoding table entry */
  493|  29.6k|    code last;                  /* parent table entry */
  494|  29.6k|    unsigned len;               /* length to copy for repeats, bits to drop */
  495|  29.6k|    int ret;                    /* return code */
  496|  29.6k|#ifdef GUNZIP
  497|  29.6k|    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
  498|  29.6k|#endif
  499|  29.6k|    static const unsigned short order[19] = /* permutation of code lengths */
  500|  29.6k|        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
  501|       |
  502|  29.6k|    if (inflateStateCheck(strm) || strm->next_out == Z_NULL ||
  ------------------
  |  |  216|  59.2k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (502:9): [True: 0, False: 29.6k]
  |  Branch (502:36): [True: 0, False: 29.6k]
  ------------------
  503|  29.6k|        (strm->next_in == Z_NULL && strm->avail_in != 0))
  ------------------
  |  |  216|  59.2k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (503:10): [True: 0, False: 29.6k]
  |  Branch (503:37): [True: 0, False: 0]
  ------------------
  504|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  505|       |
  506|  29.6k|    state = (struct inflate_state FAR *)strm->state;
  507|  29.6k|    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
  ------------------
  |  Branch (507:9): [True: 92, False: 29.5k]
  ------------------
  508|  29.6k|    LOAD();
  ------------------
  |  |  337|  29.6k|    do { \
  |  |  338|  29.6k|        put = strm->next_out; \
  |  |  339|  29.6k|        left = strm->avail_out; \
  |  |  340|  29.6k|        next = strm->next_in; \
  |  |  341|  29.6k|        have = strm->avail_in; \
  |  |  342|  29.6k|        hold = state->hold; \
  |  |  343|  29.6k|        bits = state->bits; \
  |  |  344|  29.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (344:14): [Folded, False: 29.6k]
  |  |  ------------------
  ------------------
  509|  29.6k|    in = have;
  510|  29.6k|    out = left;
  511|  29.6k|    ret = Z_OK;
  ------------------
  |  |  181|  29.6k|#define Z_OK            0
  ------------------
  512|  29.6k|    for (;;)
  513|  1.94M|        switch (state->mode) {
  514|  4.22k|        case HEAD:
  ------------------
  |  Branch (514:9): [True: 4.22k, False: 1.93M]
  ------------------
  515|  4.22k|            if (state->wrap == 0) {
  ------------------
  |  Branch (515:17): [True: 0, False: 4.22k]
  ------------------
  516|      0|                state->mode = TYPEDO;
  517|      0|                break;
  518|      0|            }
  519|  4.22k|            NEEDBITS(16);
  ------------------
  |  |  377|  4.22k|    do { \
  |  |  378|  12.6k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 8.45k, False: 4.22k]
  |  |  ------------------
  |  |  379|  8.45k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  8.45k|    do { \
  |  |  |  |  368|  8.45k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 0, False: 8.45k]
  |  |  |  |  ------------------
  |  |  |  |  369|  8.45k|        have--; \
  |  |  |  |  370|  8.45k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  8.45k|        bits += 8; \
  |  |  |  |  372|  8.45k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 8.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  520|  4.22k|#ifdef GUNZIP
  521|  4.22k|            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
  ------------------
  |  Branch (521:17): [True: 4.22k, False: 0]
  |  Branch (521:38): [True: 4.22k, False: 0]
  ------------------
  522|  4.22k|                if (state->wbits == 0)
  ------------------
  |  Branch (522:21): [True: 0, False: 4.22k]
  ------------------
  523|      0|                    state->wbits = 15;
  524|  4.22k|                state->check = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  525|  4.22k|                CRC2(state->check, hold);
  ------------------
  |  |  319|  4.22k|    do { \
  |  |  320|  4.22k|        hbuf[0] = (unsigned char)(word); \
  |  |  321|  4.22k|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  322|  4.22k|        check = crc32(check, hbuf, 2); \
  |  |  323|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (323:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  526|  4.22k|                INITBITS();
  ------------------
  |  |  359|  4.22k|    do { \
  |  |  360|  4.22k|        hold = 0; \
  |  |  361|  4.22k|        bits = 0; \
  |  |  362|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  527|  4.22k|                state->mode = FLAGS;
  528|  4.22k|                break;
  529|  4.22k|            }
  530|      0|            if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (530:17): [True: 0, False: 0]
  ------------------
  531|      0|                state->head->done = -1;
  532|      0|            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
  ------------------
  |  Branch (532:17): [True: 0, False: 0]
  ------------------
  533|       |#else
  534|       |            if (
  535|       |#endif
  536|      0|                ((BITS(8) << 8) + (hold >> 8)) % 31) {
  ------------------
  |  |  384|      0|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  |  Branch (536:17): [True: 0, False: 0]
  ------------------
  537|      0|                strm->msg = (z_const char *)"incorrect header check";
  538|      0|                state->mode = BAD;
  539|      0|                break;
  540|      0|            }
  541|      0|            if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  384|      0|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
                          if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  213|      0|#define Z_DEFLATED   8
  ------------------
  |  Branch (541:17): [True: 0, False: 0]
  ------------------
  542|      0|                strm->msg = (z_const char *)"unknown compression method";
  543|      0|                state->mode = BAD;
  544|      0|                break;
  545|      0|            }
  546|      0|            DROPBITS(4);
  ------------------
  |  |  388|      0|    do { \
  |  |  389|      0|        hold >>= (n); \
  |  |  390|      0|        bits -= (unsigned)(n); \
  |  |  391|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  547|      0|            len = BITS(4) + 8;
  ------------------
  |  |  384|      0|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  548|      0|            if (len > 15 || (state->wbits != 0 && len > state->wbits)) {
  ------------------
  |  Branch (548:17): [True: 0, False: 0]
  |  Branch (548:30): [True: 0, False: 0]
  |  Branch (548:51): [True: 0, False: 0]
  ------------------
  549|      0|                strm->msg = (z_const char *)"invalid window size";
  550|      0|                state->mode = BAD;
  551|      0|                break;
  552|      0|            }
  553|      0|            if (state->wbits == 0)
  ------------------
  |  Branch (553:17): [True: 0, False: 0]
  ------------------
  554|      0|                state->wbits = len;
  555|      0|            state->dmax = 1U << len;
  556|      0|            state->flags = 0;               /* indicate zlib header */
  557|      0|            Tracev((stderr, "inflate:   zlib header ok\n"));
  558|      0|            strm->adler = state->check = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  559|      0|            state->mode = hold & 0x200 ? DICTID : TYPE;
  ------------------
  |  Branch (559:27): [True: 0, False: 0]
  ------------------
  560|      0|            INITBITS();
  ------------------
  |  |  359|      0|    do { \
  |  |  360|      0|        hold = 0; \
  |  |  361|      0|        bits = 0; \
  |  |  362|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  561|      0|            break;
  562|      0|#ifdef GUNZIP
  563|  4.22k|        case FLAGS:
  ------------------
  |  Branch (563:9): [True: 4.22k, False: 1.93M]
  ------------------
  564|  4.22k|            NEEDBITS(16);
  ------------------
  |  |  377|  4.22k|    do { \
  |  |  378|  12.6k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 8.45k, False: 4.22k]
  |  |  ------------------
  |  |  379|  8.45k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  8.45k|    do { \
  |  |  |  |  368|  8.45k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 0, False: 8.45k]
  |  |  |  |  ------------------
  |  |  |  |  369|  8.45k|        have--; \
  |  |  |  |  370|  8.45k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  8.45k|        bits += 8; \
  |  |  |  |  372|  8.45k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 8.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  565|  4.22k|            state->flags = (int)(hold);
  566|  4.22k|            if ((state->flags & 0xff) != Z_DEFLATED) {
  ------------------
  |  |  213|  4.22k|#define Z_DEFLATED   8
  ------------------
  |  Branch (566:17): [True: 0, False: 4.22k]
  ------------------
  567|      0|                strm->msg = (z_const char *)"unknown compression method";
  568|      0|                state->mode = BAD;
  569|      0|                break;
  570|      0|            }
  571|  4.22k|            if (state->flags & 0xe000) {
  ------------------
  |  Branch (571:17): [True: 0, False: 4.22k]
  ------------------
  572|      0|                strm->msg = (z_const char *)"unknown header flags set";
  573|      0|                state->mode = BAD;
  574|      0|                break;
  575|      0|            }
  576|  4.22k|            if (state->head != Z_NULL)
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (576:17): [True: 0, False: 4.22k]
  ------------------
  577|      0|                state->head->text = (int)((hold >> 8) & 1);
  578|  4.22k|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (578:17): [True: 0, False: 4.22k]
  |  Branch (578:44): [True: 0, False: 0]
  ------------------
  579|      0|                CRC2(state->check, hold);
  ------------------
  |  |  319|      0|    do { \
  |  |  320|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  321|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  322|      0|        check = crc32(check, hbuf, 2); \
  |  |  323|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (323:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  580|  4.22k|            INITBITS();
  ------------------
  |  |  359|  4.22k|    do { \
  |  |  360|  4.22k|        hold = 0; \
  |  |  361|  4.22k|        bits = 0; \
  |  |  362|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  581|  4.22k|            state->mode = TIME;
  582|       |                /* fallthrough */
  583|  4.22k|        case TIME:
  ------------------
  |  Branch (583:9): [True: 0, False: 1.94M]
  ------------------
  584|  4.22k|            NEEDBITS(32);
  ------------------
  |  |  377|  4.22k|    do { \
  |  |  378|  21.1k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 16.9k, False: 4.22k]
  |  |  ------------------
  |  |  379|  16.9k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  16.9k|    do { \
  |  |  |  |  368|  16.9k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 0, False: 16.9k]
  |  |  |  |  ------------------
  |  |  |  |  369|  16.9k|        have--; \
  |  |  |  |  370|  16.9k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  16.9k|        bits += 8; \
  |  |  |  |  372|  16.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 16.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  585|  4.22k|            if (state->head != Z_NULL)
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (585:17): [True: 0, False: 4.22k]
  ------------------
  586|      0|                state->head->time = hold;
  587|  4.22k|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (587:17): [True: 0, False: 4.22k]
  |  Branch (587:44): [True: 0, False: 0]
  ------------------
  588|      0|                CRC4(state->check, hold);
  ------------------
  |  |  326|      0|    do { \
  |  |  327|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  328|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  329|      0|        hbuf[2] = (unsigned char)((word) >> 16); \
  |  |  330|      0|        hbuf[3] = (unsigned char)((word) >> 24); \
  |  |  331|      0|        check = crc32(check, hbuf, 4); \
  |  |  332|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (332:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  589|  4.22k|            INITBITS();
  ------------------
  |  |  359|  4.22k|    do { \
  |  |  360|  4.22k|        hold = 0; \
  |  |  361|  4.22k|        bits = 0; \
  |  |  362|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  590|  4.22k|            state->mode = OS;
  591|       |                /* fallthrough */
  592|  4.22k|        case OS:
  ------------------
  |  Branch (592:9): [True: 0, False: 1.94M]
  ------------------
  593|  4.22k|            NEEDBITS(16);
  ------------------
  |  |  377|  4.22k|    do { \
  |  |  378|  12.6k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 8.45k, False: 4.22k]
  |  |  ------------------
  |  |  379|  8.45k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  8.45k|    do { \
  |  |  |  |  368|  8.45k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 0, False: 8.45k]
  |  |  |  |  ------------------
  |  |  |  |  369|  8.45k|        have--; \
  |  |  |  |  370|  8.45k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  8.45k|        bits += 8; \
  |  |  |  |  372|  8.45k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 8.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  594|  4.22k|            if (state->head != Z_NULL) {
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (594:17): [True: 0, False: 4.22k]
  ------------------
  595|      0|                state->head->xflags = (int)(hold & 0xff);
  596|      0|                state->head->os = (int)(hold >> 8);
  597|      0|            }
  598|  4.22k|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (598:17): [True: 0, False: 4.22k]
  |  Branch (598:44): [True: 0, False: 0]
  ------------------
  599|      0|                CRC2(state->check, hold);
  ------------------
  |  |  319|      0|    do { \
  |  |  320|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  321|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  322|      0|        check = crc32(check, hbuf, 2); \
  |  |  323|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (323:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  600|  4.22k|            INITBITS();
  ------------------
  |  |  359|  4.22k|    do { \
  |  |  360|  4.22k|        hold = 0; \
  |  |  361|  4.22k|        bits = 0; \
  |  |  362|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  601|  4.22k|            state->mode = EXLEN;
  602|       |                /* fallthrough */
  603|  4.22k|        case EXLEN:
  ------------------
  |  Branch (603:9): [True: 0, False: 1.94M]
  ------------------
  604|  4.22k|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (604:17): [True: 0, False: 4.22k]
  ------------------
  605|      0|                NEEDBITS(16);
  ------------------
  |  |  377|      0|    do { \
  |  |  378|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  379|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|      0|    do { \
  |  |  |  |  368|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  369|      0|        have--; \
  |  |  |  |  370|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|      0|        bits += 8; \
  |  |  |  |  372|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  606|      0|                state->length = (unsigned)(hold);
  607|      0|                if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (607:21): [True: 0, False: 0]
  ------------------
  608|      0|                    state->head->extra_len = (unsigned)hold;
  609|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (609:21): [True: 0, False: 0]
  |  Branch (609:48): [True: 0, False: 0]
  ------------------
  610|      0|                    CRC2(state->check, hold);
  ------------------
  |  |  319|      0|    do { \
  |  |  320|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  321|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  322|      0|        check = crc32(check, hbuf, 2); \
  |  |  323|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (323:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  611|      0|                INITBITS();
  ------------------
  |  |  359|      0|    do { \
  |  |  360|      0|        hold = 0; \
  |  |  361|      0|        bits = 0; \
  |  |  362|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  612|      0|            }
  613|  4.22k|            else if (state->head != Z_NULL)
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (613:22): [True: 0, False: 4.22k]
  ------------------
  614|      0|                state->head->extra = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  615|  4.22k|            state->mode = EXTRA;
  616|       |                /* fallthrough */
  617|  4.22k|        case EXTRA:
  ------------------
  |  Branch (617:9): [True: 0, False: 1.94M]
  ------------------
  618|  4.22k|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (618:17): [True: 0, False: 4.22k]
  ------------------
  619|      0|                copy = state->length;
  620|      0|                if (copy > have) copy = have;
  ------------------
  |  Branch (620:21): [True: 0, False: 0]
  ------------------
  621|      0|                if (copy) {
  ------------------
  |  Branch (621:21): [True: 0, False: 0]
  ------------------
  622|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (622:25): [True: 0, False: 0]
  ------------------
  623|      0|                        state->head->extra != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (623:25): [True: 0, False: 0]
  ------------------
  624|      0|                        (len = state->head->extra_len - state->length) <
  ------------------
  |  Branch (624:25): [True: 0, False: 0]
  ------------------
  625|      0|                            state->head->extra_max) {
  626|      0|                        zmemcpy(state->head->extra + len, next,
  ------------------
  |  |  306|      0|#    define zmemcpy memcpy
  ------------------
  627|      0|                                len + copy > state->head->extra_max ?
  ------------------
  |  Branch (627:33): [True: 0, False: 0]
  ------------------
  628|      0|                                state->head->extra_max - len : copy);
  629|      0|                    }
  630|      0|                    if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (630:25): [True: 0, False: 0]
  |  Branch (630:52): [True: 0, False: 0]
  ------------------
  631|      0|                        state->check = crc32(state->check, next, copy);
  632|      0|                    have -= copy;
  633|      0|                    next += copy;
  634|      0|                    state->length -= copy;
  635|      0|                }
  636|      0|                if (state->length) goto inf_leave;
  ------------------
  |  Branch (636:21): [True: 0, False: 0]
  ------------------
  637|      0|            }
  638|  4.22k|            state->length = 0;
  639|  4.22k|            state->mode = NAME;
  640|       |                /* fallthrough */
  641|  4.22k|        case NAME:
  ------------------
  |  Branch (641:9): [True: 0, False: 1.94M]
  ------------------
  642|  4.22k|            if (state->flags & 0x0800) {
  ------------------
  |  Branch (642:17): [True: 0, False: 4.22k]
  ------------------
  643|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (643:21): [True: 0, False: 0]
  ------------------
  644|      0|                copy = 0;
  645|      0|                do {
  646|      0|                    len = (unsigned)(next[copy++]);
  647|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (647:25): [True: 0, False: 0]
  ------------------
  648|      0|                            state->head->name != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (648:29): [True: 0, False: 0]
  ------------------
  649|      0|                            state->length < state->head->name_max)
  ------------------
  |  Branch (649:29): [True: 0, False: 0]
  ------------------
  650|      0|                        state->head->name[state->length++] = (Bytef)len;
  651|      0|                } while (len && copy < have);
  ------------------
  |  Branch (651:26): [True: 0, False: 0]
  |  Branch (651:33): [True: 0, False: 0]
  ------------------
  652|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (652:21): [True: 0, False: 0]
  |  Branch (652:48): [True: 0, False: 0]
  ------------------
  653|      0|                    state->check = crc32(state->check, next, copy);
  654|      0|                have -= copy;
  655|      0|                next += copy;
  656|      0|                if (len) goto inf_leave;
  ------------------
  |  Branch (656:21): [True: 0, False: 0]
  ------------------
  657|      0|            }
  658|  4.22k|            else if (state->head != Z_NULL)
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (658:22): [True: 0, False: 4.22k]
  ------------------
  659|      0|                state->head->name = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  660|  4.22k|            state->length = 0;
  661|  4.22k|            state->mode = COMMENT;
  662|       |                /* fallthrough */
  663|  4.22k|        case COMMENT:
  ------------------
  |  Branch (663:9): [True: 0, False: 1.94M]
  ------------------
  664|  4.22k|            if (state->flags & 0x1000) {
  ------------------
  |  Branch (664:17): [True: 0, False: 4.22k]
  ------------------
  665|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (665:21): [True: 0, False: 0]
  ------------------
  666|      0|                copy = 0;
  667|      0|                do {
  668|      0|                    len = (unsigned)(next[copy++]);
  669|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (669:25): [True: 0, False: 0]
  ------------------
  670|      0|                            state->head->comment != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (670:29): [True: 0, False: 0]
  ------------------
  671|      0|                            state->length < state->head->comm_max)
  ------------------
  |  Branch (671:29): [True: 0, False: 0]
  ------------------
  672|      0|                        state->head->comment[state->length++] = (Bytef)len;
  673|      0|                } while (len && copy < have);
  ------------------
  |  Branch (673:26): [True: 0, False: 0]
  |  Branch (673:33): [True: 0, False: 0]
  ------------------
  674|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (674:21): [True: 0, False: 0]
  |  Branch (674:48): [True: 0, False: 0]
  ------------------
  675|      0|                    state->check = crc32(state->check, next, copy);
  676|      0|                have -= copy;
  677|      0|                next += copy;
  678|      0|                if (len) goto inf_leave;
  ------------------
  |  Branch (678:21): [True: 0, False: 0]
  ------------------
  679|      0|            }
  680|  4.22k|            else if (state->head != Z_NULL)
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (680:22): [True: 0, False: 4.22k]
  ------------------
  681|      0|                state->head->comment = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  682|  4.22k|            state->mode = HCRC;
  683|       |                /* fallthrough */
  684|  4.22k|        case HCRC:
  ------------------
  |  Branch (684:9): [True: 0, False: 1.94M]
  ------------------
  685|  4.22k|            if (state->flags & 0x0200) {
  ------------------
  |  Branch (685:17): [True: 0, False: 4.22k]
  ------------------
  686|      0|                NEEDBITS(16);
  ------------------
  |  |  377|      0|    do { \
  |  |  378|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  379|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|      0|    do { \
  |  |  |  |  368|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  369|      0|        have--; \
  |  |  |  |  370|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|      0|        bits += 8; \
  |  |  |  |  372|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  687|      0|                if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
  ------------------
  |  Branch (687:21): [True: 0, False: 0]
  |  Branch (687:42): [True: 0, False: 0]
  ------------------
  688|      0|                    strm->msg = (z_const char *)"header crc mismatch";
  689|      0|                    state->mode = BAD;
  690|      0|                    break;
  691|      0|                }
  692|      0|                INITBITS();
  ------------------
  |  |  359|      0|    do { \
  |  |  360|      0|        hold = 0; \
  |  |  361|      0|        bits = 0; \
  |  |  362|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  693|      0|            }
  694|  4.22k|            if (state->head != Z_NULL) {
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (694:17): [True: 0, False: 4.22k]
  ------------------
  695|      0|                state->head->hcrc = (int)((state->flags >> 9) & 1);
  696|      0|                state->head->done = 1;
  697|      0|            }
  698|  4.22k|            strm->adler = state->check = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  699|  4.22k|            state->mode = TYPE;
  700|  4.22k|            break;
  701|      0|#endif
  702|      0|        case DICTID:
  ------------------
  |  Branch (702:9): [True: 0, False: 1.94M]
  ------------------
  703|      0|            NEEDBITS(32);
  ------------------
  |  |  377|      0|    do { \
  |  |  378|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  379|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|      0|    do { \
  |  |  |  |  368|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  369|      0|        have--; \
  |  |  |  |  370|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|      0|        bits += 8; \
  |  |  |  |  372|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  704|      0|            strm->adler = state->check = ZSWAP32(hold);
  ------------------
  |  |  348|      0|#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
  |  |  349|      0|                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
  ------------------
  705|      0|            INITBITS();
  ------------------
  |  |  359|      0|    do { \
  |  |  360|      0|        hold = 0; \
  |  |  361|      0|        bits = 0; \
  |  |  362|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  706|      0|            state->mode = DICT;
  707|       |                /* fallthrough */
  708|      0|        case DICT:
  ------------------
  |  Branch (708:9): [True: 0, False: 1.94M]
  ------------------
  709|      0|            if (state->havedict == 0) {
  ------------------
  |  Branch (709:17): [True: 0, False: 0]
  ------------------
  710|      0|                RESTORE();
  ------------------
  |  |  348|      0|    do { \
  |  |  349|      0|        strm->next_out = put; \
  |  |  350|      0|        strm->avail_out = left; \
  |  |  351|      0|        strm->next_in = next; \
  |  |  352|      0|        strm->avail_in = have; \
  |  |  353|      0|        state->hold = hold; \
  |  |  354|      0|        state->bits = bits; \
  |  |  355|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (355:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  711|      0|                strm->total_in += in - strm->avail_in;
  712|      0|                return Z_NEED_DICT;
  ------------------
  |  |  183|      0|#define Z_NEED_DICT     2
  ------------------
  713|      0|            }
  714|      0|            strm->adler = state->check = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  715|      0|            state->mode = TYPE;
  716|       |                /* fallthrough */
  717|  19.6k|        case TYPE:
  ------------------
  |  Branch (717:9): [True: 19.6k, False: 1.92M]
  ------------------
  718|  19.6k|            if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  177|  39.3k|#define Z_BLOCK         5
  ------------------
                          if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  178|  19.6k|#define Z_TREES         6
  ------------------
  |  Branch (718:17): [True: 0, False: 19.6k]
  |  Branch (718:37): [True: 0, False: 19.6k]
  ------------------
  719|       |                /* fallthrough */
  720|  19.7k|        case TYPEDO:
  ------------------
  |  Branch (720:9): [True: 92, False: 1.94M]
  ------------------
  721|  19.7k|            if (state->last) {
  ------------------
  |  Branch (721:17): [True: 4.22k, False: 15.5k]
  ------------------
  722|  4.22k|                BYTEBITS();
  ------------------
  |  |  395|  4.22k|    do { \
  |  |  396|  4.22k|        hold >>= bits & 7; \
  |  |  397|  4.22k|        bits -= bits & 7; \
  |  |  398|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (398:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  723|  4.22k|                state->mode = CHECK;
  724|  4.22k|                break;
  725|  4.22k|            }
  726|  15.5k|            NEEDBITS(3);
  ------------------
  |  |  377|  15.5k|    do { \
  |  |  378|  26.1k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 10.7k, False: 15.4k]
  |  |  ------------------
  |  |  379|  15.5k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  10.7k|    do { \
  |  |  |  |  368|  10.7k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 92, False: 10.6k]
  |  |  |  |  ------------------
  |  |  |  |  369|  10.7k|        have--; \
  |  |  |  |  370|  10.6k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  10.6k|        bits += 8; \
  |  |  |  |  372|  10.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  15.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 15.4k]
  |  |  ------------------
  ------------------
  727|  15.4k|            state->last = BITS(1);
  ------------------
  |  |  384|  15.4k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  728|  15.4k|            DROPBITS(1);
  ------------------
  |  |  388|  15.4k|    do { \
  |  |  389|  15.4k|        hold >>= (n); \
  |  |  390|  15.4k|        bits -= (unsigned)(n); \
  |  |  391|  15.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 15.4k]
  |  |  ------------------
  ------------------
  729|  15.4k|            switch (BITS(2)) {
  ------------------
  |  |  384|  15.4k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  730|  3.96k|            case 0:                             /* stored block */
  ------------------
  |  Branch (730:13): [True: 3.96k, False: 11.4k]
  ------------------
  731|  3.96k|                Tracev((stderr, "inflate:     stored block%s\n",
  732|  3.96k|                        state->last ? " (last)" : ""));
  733|  3.96k|                state->mode = STORED;
  734|  3.96k|                break;
  735|  1.56k|            case 1:                             /* fixed block */
  ------------------
  |  Branch (735:13): [True: 1.56k, False: 13.8k]
  ------------------
  736|  1.56k|                inflate_fixed(state);
  737|  1.56k|                Tracev((stderr, "inflate:     fixed codes block%s\n",
  738|  1.56k|                        state->last ? " (last)" : ""));
  739|  1.56k|                state->mode = LEN_;             /* decode codes */
  740|  1.56k|                if (flush == Z_TREES) {
  ------------------
  |  |  178|  1.56k|#define Z_TREES         6
  ------------------
  |  Branch (740:21): [True: 0, False: 1.56k]
  ------------------
  741|      0|                    DROPBITS(2);
  ------------------
  |  |  388|      0|    do { \
  |  |  389|      0|        hold >>= (n); \
  |  |  390|      0|        bits -= (unsigned)(n); \
  |  |  391|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  742|      0|                    goto inf_leave;
  743|      0|                }
  744|  1.56k|                break;
  745|  9.90k|            case 2:                             /* dynamic block */
  ------------------
  |  Branch (745:13): [True: 9.90k, False: 5.53k]
  ------------------
  746|  9.90k|                Tracev((stderr, "inflate:     dynamic codes block%s\n",
  747|  9.90k|                        state->last ? " (last)" : ""));
  748|  9.90k|                state->mode = TABLE;
  749|  9.90k|                break;
  750|      0|            default:
  ------------------
  |  Branch (750:13): [True: 0, False: 15.4k]
  ------------------
  751|      0|                strm->msg = (z_const char *)"invalid block type";
  752|      0|                state->mode = BAD;
  753|  15.4k|            }
  754|  15.4k|            DROPBITS(2);
  ------------------
  |  |  388|  15.4k|    do { \
  |  |  389|  15.4k|        hold >>= (n); \
  |  |  390|  15.4k|        bits -= (unsigned)(n); \
  |  |  391|  15.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 15.4k]
  |  |  ------------------
  ------------------
  755|  15.4k|            break;
  756|  4.06k|        case STORED:
  ------------------
  |  Branch (756:9): [True: 4.06k, False: 1.93M]
  ------------------
  757|  4.06k|            BYTEBITS();                         /* go to byte boundary */
  ------------------
  |  |  395|  4.06k|    do { \
  |  |  396|  4.06k|        hold >>= bits & 7; \
  |  |  397|  4.06k|        bits -= bits & 7; \
  |  |  398|  4.06k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (398:14): [Folded, False: 4.06k]
  |  |  ------------------
  ------------------
  758|  4.06k|            NEEDBITS(32);
  ------------------
  |  |  377|  4.06k|    do { \
  |  |  378|  19.9k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 15.9k, False: 3.96k]
  |  |  ------------------
  |  |  379|  15.9k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  15.9k|    do { \
  |  |  |  |  368|  15.9k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 100, False: 15.8k]
  |  |  |  |  ------------------
  |  |  |  |  369|  15.9k|        have--; \
  |  |  |  |  370|  15.8k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  15.8k|        bits += 8; \
  |  |  |  |  372|  15.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 15.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  4.06k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 3.96k]
  |  |  ------------------
  ------------------
  759|  3.96k|            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
  ------------------
  |  Branch (759:17): [True: 0, False: 3.96k]
  ------------------
  760|      0|                strm->msg = (z_const char *)"invalid stored block lengths";
  761|      0|                state->mode = BAD;
  762|      0|                break;
  763|      0|            }
  764|  3.96k|            state->length = (unsigned)hold & 0xffff;
  765|  3.96k|            Tracev((stderr, "inflate:       stored length %u\n",
  766|  3.96k|                    state->length));
  767|  3.96k|            INITBITS();
  ------------------
  |  |  359|  3.96k|    do { \
  |  |  360|  3.96k|        hold = 0; \
  |  |  361|  3.96k|        bits = 0; \
  |  |  362|  3.96k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 3.96k]
  |  |  ------------------
  ------------------
  768|  3.96k|            state->mode = COPY_;
  769|  3.96k|            if (flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  178|  3.96k|#define Z_TREES         6
  ------------------
  |  Branch (769:17): [True: 0, False: 3.96k]
  ------------------
  770|       |                /* fallthrough */
  771|  3.96k|        case COPY_:
  ------------------
  |  Branch (771:9): [True: 0, False: 1.94M]
  ------------------
  772|  3.96k|            state->mode = COPY;
  773|       |                /* fallthrough */
  774|  24.4k|        case COPY:
  ------------------
  |  Branch (774:9): [True: 20.4k, False: 1.92M]
  ------------------
  775|  24.4k|            copy = state->length;
  776|  24.4k|            if (copy) {
  ------------------
  |  Branch (776:17): [True: 20.4k, False: 3.96k]
  ------------------
  777|  20.4k|                if (copy > have) copy = have;
  ------------------
  |  Branch (777:21): [True: 15.7k, False: 4.73k]
  ------------------
  778|  20.4k|                if (copy > left) copy = left;
  ------------------
  |  Branch (778:21): [True: 2.61k, False: 17.8k]
  ------------------
  779|  20.4k|                if (copy == 0) goto inf_leave;
  ------------------
  |  Branch (779:21): [True: 8.25k, False: 12.1k]
  ------------------
  780|  12.1k|                zmemcpy(put, next, copy);
  ------------------
  |  |  306|  12.1k|#    define zmemcpy memcpy
  ------------------
  781|  12.1k|                have -= copy;
  782|  12.1k|                next += copy;
  783|  12.1k|                left -= copy;
  784|  12.1k|                put += copy;
  785|  12.1k|                state->length -= copy;
  786|  12.1k|                break;
  787|  20.4k|            }
  788|  3.96k|            Tracev((stderr, "inflate:       stored end\n"));
  789|  3.96k|            state->mode = TYPE;
  790|  3.96k|            break;
  791|  10.0k|        case TABLE:
  ------------------
  |  Branch (791:9): [True: 10.0k, False: 1.93M]
  ------------------
  792|  10.0k|            NEEDBITS(14);
  ------------------
  |  |  377|  10.0k|    do { \
  |  |  378|  28.1k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 18.2k, False: 9.90k]
  |  |  ------------------
  |  |  379|  18.2k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  18.2k|    do { \
  |  |  |  |  368|  18.2k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 138, False: 18.0k]
  |  |  |  |  ------------------
  |  |  |  |  369|  18.2k|        have--; \
  |  |  |  |  370|  18.0k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  18.0k|        bits += 8; \
  |  |  |  |  372|  18.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 18.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  10.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 9.90k]
  |  |  ------------------
  ------------------
  793|  9.90k|            state->nlen = BITS(5) + 257;
  ------------------
  |  |  384|  9.90k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  794|  9.90k|            DROPBITS(5);
  ------------------
  |  |  388|  9.90k|    do { \
  |  |  389|  9.90k|        hold >>= (n); \
  |  |  390|  9.90k|        bits -= (unsigned)(n); \
  |  |  391|  9.90k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 9.90k]
  |  |  ------------------
  ------------------
  795|  9.90k|            state->ndist = BITS(5) + 1;
  ------------------
  |  |  384|  9.90k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  796|  9.90k|            DROPBITS(5);
  ------------------
  |  |  388|  9.90k|    do { \
  |  |  389|  9.90k|        hold >>= (n); \
  |  |  390|  9.90k|        bits -= (unsigned)(n); \
  |  |  391|  9.90k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 9.90k]
  |  |  ------------------
  ------------------
  797|  9.90k|            state->ncode = BITS(4) + 4;
  ------------------
  |  |  384|  9.90k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  798|  9.90k|            DROPBITS(4);
  ------------------
  |  |  388|  9.90k|    do { \
  |  |  389|  9.90k|        hold >>= (n); \
  |  |  390|  9.90k|        bits -= (unsigned)(n); \
  |  |  391|  9.90k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 9.90k]
  |  |  ------------------
  ------------------
  799|  9.90k|#ifndef PKZIP_BUG_WORKAROUND
  800|  9.90k|            if (state->nlen > 286 || state->ndist > 30) {
  ------------------
  |  Branch (800:17): [True: 0, False: 9.90k]
  |  Branch (800:38): [True: 0, False: 9.90k]
  ------------------
  801|      0|                strm->msg = (z_const char *)
  802|      0|                    "too many length or distance symbols";
  803|      0|                state->mode = BAD;
  804|      0|                break;
  805|      0|            }
  806|  9.90k|#endif
  807|  9.90k|            Tracev((stderr, "inflate:       table sizes ok\n"));
  808|  9.90k|            state->have = 0;
  809|  9.90k|            state->mode = LENLENS;
  810|       |                /* fallthrough */
  811|  10.2k|        case LENLENS:
  ------------------
  |  Branch (811:9): [True: 299, False: 1.94M]
  ------------------
  812|   184k|            while (state->have < state->ncode) {
  ------------------
  |  Branch (812:20): [True: 174k, False: 9.90k]
  ------------------
  813|   174k|                NEEDBITS(3);
  ------------------
  |  |  377|   174k|    do { \
  |  |  378|   237k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 63.6k, False: 174k]
  |  |  ------------------
  |  |  379|   174k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  63.6k|    do { \
  |  |  |  |  368|  63.6k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 299, False: 63.3k]
  |  |  |  |  ------------------
  |  |  |  |  369|  63.6k|        have--; \
  |  |  |  |  370|  63.3k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  63.3k|        bits += 8; \
  |  |  |  |  372|  63.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 63.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|   174k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 174k]
  |  |  ------------------
  ------------------
  814|   174k|                state->lens[order[state->have++]] = (unsigned short)BITS(3);
  ------------------
  |  |  384|   174k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  815|   174k|                DROPBITS(3);
  ------------------
  |  |  388|   174k|    do { \
  |  |  389|   174k|        hold >>= (n); \
  |  |  390|   174k|        bits -= (unsigned)(n); \
  |  |  391|   174k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 174k]
  |  |  ------------------
  ------------------
  816|   174k|            }
  817|  23.9k|            while (state->have < 19)
  ------------------
  |  Branch (817:20): [True: 14.0k, False: 9.90k]
  ------------------
  818|  14.0k|                state->lens[order[state->have++]] = 0;
  819|  9.90k|            state->next = state->codes;
  820|  9.90k|            state->lencode = state->distcode = (const code FAR *)(state->next);
  821|  9.90k|            state->lenbits = 7;
  822|  9.90k|            ret = inflate_table(CODES, state->lens, 19, &(state->next),
  823|  9.90k|                                &(state->lenbits), state->work);
  824|  9.90k|            if (ret) {
  ------------------
  |  Branch (824:17): [True: 0, False: 9.90k]
  ------------------
  825|      0|                strm->msg = (z_const char *)"invalid code lengths set";
  826|      0|                state->mode = BAD;
  827|      0|                break;
  828|      0|            }
  829|  9.90k|            Tracev((stderr, "inflate:       code lengths ok\n"));
  830|  9.90k|            state->have = 0;
  831|  9.90k|            state->mode = CODELENS;
  832|       |                /* fallthrough */
  833|  10.4k|        case CODELENS:
  ------------------
  |  Branch (833:9): [True: 589, False: 1.94M]
  ------------------
  834|  1.28M|            while (state->have < state->nlen + state->ndist) {
  ------------------
  |  Branch (834:20): [True: 1.27M, False: 9.90k]
  ------------------
  835|  1.68M|                for (;;) {
  836|  1.68M|                    here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  384|  1.68M|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  837|  1.68M|                    if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (837:25): [True: 1.27M, False: 410k]
  ------------------
  838|   410k|                    PULLBYTE();
  ------------------
  |  |  367|   410k|    do { \
  |  |  368|   410k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (368:13): [True: 418, False: 409k]
  |  |  ------------------
  |  |  369|   410k|        have--; \
  |  |  370|   409k|        hold += (unsigned long)(*next++) << bits; \
  |  |  371|   409k|        bits += 8; \
  |  |  372|   409k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 409k]
  |  |  ------------------
  ------------------
  839|   410k|                }
  840|  1.27M|                if (here.val < 16) {
  ------------------
  |  Branch (840:21): [True: 1.04M, False: 226k]
  ------------------
  841|  1.04M|                    DROPBITS(here.bits);
  ------------------
  |  |  388|  1.04M|    do { \
  |  |  389|  1.04M|        hold >>= (n); \
  |  |  390|  1.04M|        bits -= (unsigned)(n); \
  |  |  391|  1.04M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 1.04M]
  |  |  ------------------
  ------------------
  842|  1.04M|                    state->lens[state->have++] = here.val;
  843|  1.04M|                }
  844|   226k|                else {
  845|   226k|                    if (here.val == 16) {
  ------------------
  |  Branch (845:25): [True: 176k, False: 49.9k]
  ------------------
  846|   176k|                        NEEDBITS(here.bits + 2);
  ------------------
  |  |  377|   176k|    do { \
  |  |  378|   220k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 44.2k, False: 176k]
  |  |  ------------------
  |  |  379|   176k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  44.2k|    do { \
  |  |  |  |  368|  44.2k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 123, False: 44.1k]
  |  |  |  |  ------------------
  |  |  |  |  369|  44.2k|        have--; \
  |  |  |  |  370|  44.1k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  44.1k|        bits += 8; \
  |  |  |  |  372|  44.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 44.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|   176k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 176k]
  |  |  ------------------
  ------------------
  847|   176k|                        DROPBITS(here.bits);
  ------------------
  |  |  388|   176k|    do { \
  |  |  389|   176k|        hold >>= (n); \
  |  |  390|   176k|        bits -= (unsigned)(n); \
  |  |  391|   176k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 176k]
  |  |  ------------------
  ------------------
  848|   176k|                        if (state->have == 0) {
  ------------------
  |  Branch (848:29): [True: 0, False: 176k]
  ------------------
  849|      0|                            strm->msg = (z_const char *)
  850|      0|                                "invalid bit length repeat";
  851|      0|                            state->mode = BAD;
  852|      0|                            break;
  853|      0|                        }
  854|   176k|                        len = state->lens[state->have - 1];
  855|   176k|                        copy = 3 + BITS(2);
  ------------------
  |  |  384|   176k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  856|   176k|                        DROPBITS(2);
  ------------------
  |  |  388|   176k|    do { \
  |  |  389|   176k|        hold >>= (n); \
  |  |  390|   176k|        bits -= (unsigned)(n); \
  |  |  391|   176k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 176k]
  |  |  ------------------
  ------------------
  857|   176k|                    }
  858|  49.9k|                    else if (here.val == 17) {
  ------------------
  |  Branch (858:30): [True: 33.7k, False: 16.2k]
  ------------------
  859|  33.7k|                        NEEDBITS(here.bits + 3);
  ------------------
  |  |  377|  33.7k|    do { \
  |  |  378|  46.5k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 12.8k, False: 33.6k]
  |  |  ------------------
  |  |  379|  33.7k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  12.8k|    do { \
  |  |  |  |  368|  12.8k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 24, False: 12.8k]
  |  |  |  |  ------------------
  |  |  |  |  369|  12.8k|        have--; \
  |  |  |  |  370|  12.8k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  12.8k|        bits += 8; \
  |  |  |  |  372|  12.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 12.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  33.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 33.6k]
  |  |  ------------------
  ------------------
  860|  33.6k|                        DROPBITS(here.bits);
  ------------------
  |  |  388|  33.6k|    do { \
  |  |  389|  33.6k|        hold >>= (n); \
  |  |  390|  33.6k|        bits -= (unsigned)(n); \
  |  |  391|  33.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 33.6k]
  |  |  ------------------
  ------------------
  861|  33.6k|                        len = 0;
  862|  33.6k|                        copy = 3 + BITS(3);
  ------------------
  |  |  384|  33.6k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  863|  33.6k|                        DROPBITS(3);
  ------------------
  |  |  388|  33.6k|    do { \
  |  |  389|  33.6k|        hold >>= (n); \
  |  |  390|  33.6k|        bits -= (unsigned)(n); \
  |  |  391|  33.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 33.6k]
  |  |  ------------------
  ------------------
  864|  33.6k|                    }
  865|  16.2k|                    else {
  866|  16.2k|                        NEEDBITS(here.bits + 7);
  ------------------
  |  |  377|  16.2k|    do { \
  |  |  378|  30.2k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 13.9k, False: 16.2k]
  |  |  ------------------
  |  |  379|  16.2k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  13.9k|    do { \
  |  |  |  |  368|  13.9k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 24, False: 13.9k]
  |  |  |  |  ------------------
  |  |  |  |  369|  13.9k|        have--; \
  |  |  |  |  370|  13.9k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  13.9k|        bits += 8; \
  |  |  |  |  372|  13.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 13.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  16.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 16.2k]
  |  |  ------------------
  ------------------
  867|  16.2k|                        DROPBITS(here.bits);
  ------------------
  |  |  388|  16.2k|    do { \
  |  |  389|  16.2k|        hold >>= (n); \
  |  |  390|  16.2k|        bits -= (unsigned)(n); \
  |  |  391|  16.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 16.2k]
  |  |  ------------------
  ------------------
  868|  16.2k|                        len = 0;
  869|  16.2k|                        copy = 11 + BITS(7);
  ------------------
  |  |  384|  16.2k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  870|  16.2k|                        DROPBITS(7);
  ------------------
  |  |  388|  16.2k|    do { \
  |  |  389|  16.2k|        hold >>= (n); \
  |  |  390|  16.2k|        bits -= (unsigned)(n); \
  |  |  391|  16.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 16.2k]
  |  |  ------------------
  ------------------
  871|  16.2k|                    }
  872|   226k|                    if (state->have + copy > state->nlen + state->ndist) {
  ------------------
  |  Branch (872:25): [True: 0, False: 226k]
  ------------------
  873|      0|                        strm->msg = (z_const char *)
  874|      0|                            "invalid bit length repeat";
  875|      0|                        state->mode = BAD;
  876|      0|                        break;
  877|      0|                    }
  878|  1.91M|                    while (copy--)
  ------------------
  |  Branch (878:28): [True: 1.68M, False: 226k]
  ------------------
  879|  1.68M|                        state->lens[state->have++] = (unsigned short)len;
  880|   226k|                }
  881|  1.27M|            }
  882|       |
  883|       |            /* handle error breaks in while */
  884|  9.90k|            if (state->mode == BAD) break;
  ------------------
  |  Branch (884:17): [True: 0, False: 9.90k]
  ------------------
  885|       |
  886|       |            /* check for end-of-block code (better have one) */
  887|  9.90k|            if (state->lens[256] == 0) {
  ------------------
  |  Branch (887:17): [True: 0, False: 9.90k]
  ------------------
  888|      0|                strm->msg = (z_const char *)
  889|      0|                    "invalid code -- missing end-of-block";
  890|      0|                state->mode = BAD;
  891|      0|                break;
  892|      0|            }
  893|       |
  894|       |            /* build code tables */
  895|  9.90k|            state->next = state->codes;
  896|  9.90k|            state->lencode = (const code FAR *)(state->next);
  897|  9.90k|            state->lenbits = LENBITS;
  ------------------
  |  |   47|  9.90k|#define LENBITS 10
  ------------------
  898|  9.90k|            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
  899|  9.90k|                                &(state->lenbits), state->work);
  900|  9.90k|            if (ret) {
  ------------------
  |  Branch (900:17): [True: 0, False: 9.90k]
  ------------------
  901|      0|                strm->msg = (z_const char *)"invalid literal/lengths set";
  902|      0|                state->mode = BAD;
  903|      0|                break;
  904|      0|            }
  905|  9.90k|            state->distcode = (const code FAR *)(state->next);
  906|  9.90k|            state->distbits = DISTBITS;
  ------------------
  |  |   48|  9.90k|#define DISTBITS 8
  ------------------
  907|  9.90k|            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
  908|  9.90k|                            &(state->next), &(state->distbits), state->work);
  909|  9.90k|            if (ret) {
  ------------------
  |  Branch (909:17): [True: 0, False: 9.90k]
  ------------------
  910|      0|                strm->msg = (z_const char *)"invalid distances set";
  911|      0|                state->mode = BAD;
  912|      0|                break;
  913|      0|            }
  914|  9.90k|            Tracev((stderr, "inflate:       codes ok\n"));
  915|  9.90k|            state->mode = LEN_;
  916|  9.90k|            if (flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  178|  9.90k|#define Z_TREES         6
  ------------------
  |  Branch (916:17): [True: 0, False: 9.90k]
  ------------------
  917|       |                /* fallthrough */
  918|  11.4k|        case LEN_:
  ------------------
  |  Branch (918:9): [True: 1.56k, False: 1.94M]
  ------------------
  919|  11.4k|            state->mode = LEN;
  920|       |                /* fallthrough */
  921|   987k|        case LEN:
  ------------------
  |  Branch (921:9): [True: 976k, False: 966k]
  ------------------
  922|   987k|            if (have >= 6 && left >= 258 && bits < 8) {
  ------------------
  |  Branch (922:17): [True: 897k, False: 90.4k]
  |  Branch (922:30): [True: 48.5k, False: 848k]
  |  Branch (922:45): [True: 48.1k, False: 336]
  ------------------
  923|  48.1k|                RESTORE();
  ------------------
  |  |  348|  48.1k|    do { \
  |  |  349|  48.1k|        strm->next_out = put; \
  |  |  350|  48.1k|        strm->avail_out = left; \
  |  |  351|  48.1k|        strm->next_in = next; \
  |  |  352|  48.1k|        strm->avail_in = have; \
  |  |  353|  48.1k|        state->hold = hold; \
  |  |  354|  48.1k|        state->bits = bits; \
  |  |  355|  48.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (355:14): [Folded, False: 48.1k]
  |  |  ------------------
  ------------------
  924|  48.1k|                inflate_fast(strm, out);
  925|  48.1k|                LOAD();
  ------------------
  |  |  337|  48.1k|    do { \
  |  |  338|  48.1k|        put = strm->next_out; \
  |  |  339|  48.1k|        left = strm->avail_out; \
  |  |  340|  48.1k|        next = strm->next_in; \
  |  |  341|  48.1k|        have = strm->avail_in; \
  |  |  342|  48.1k|        hold = state->hold; \
  |  |  343|  48.1k|        bits = state->bits; \
  |  |  344|  48.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (344:14): [Folded, False: 48.1k]
  |  |  ------------------
  ------------------
  926|  48.1k|                if (state->mode == TYPE)
  ------------------
  |  Branch (926:21): [True: 9.11k, False: 39.0k]
  ------------------
  927|  9.11k|                    state->back = -1;
  928|  48.1k|                break;
  929|  48.1k|            }
  930|   939k|            state->back = 0;
  931|  1.59M|            for (;;) {
  932|  1.59M|                here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  384|  1.59M|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  933|  1.59M|                if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (933:21): [True: 929k, False: 664k]
  ------------------
  934|   664k|                PULLBYTE();
  ------------------
  |  |  367|   664k|    do { \
  |  |  368|   664k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (368:13): [True: 9.97k, False: 654k]
  |  |  ------------------
  |  |  369|   664k|        have--; \
  |  |  370|   654k|        hold += (unsigned long)(*next++) << bits; \
  |  |  371|   654k|        bits += 8; \
  |  |  372|   654k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 654k]
  |  |  ------------------
  ------------------
  935|   664k|            }
  936|   929k|            if (here.op && (here.op & 0xf0) == 0) {
  ------------------
  |  Branch (936:17): [True: 51.6k, False: 877k]
  |  Branch (936:28): [True: 13.5k, False: 38.0k]
  ------------------
  937|  13.5k|                last = here;
  938|  16.4k|                for (;;) {
  939|  16.4k|                    here = state->lencode[last.val +
  940|  16.4k|                            (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  384|  16.4k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  941|  16.4k|                    if ((unsigned)(last.bits + here.bits) <= bits) break;
  ------------------
  |  Branch (941:25): [True: 13.4k, False: 2.99k]
  ------------------
  942|  2.99k|                    PULLBYTE();
  ------------------
  |  |  367|  2.99k|    do { \
  |  |  368|  2.99k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (368:13): [True: 69, False: 2.92k]
  |  |  ------------------
  |  |  369|  2.99k|        have--; \
  |  |  370|  2.92k|        hold += (unsigned long)(*next++) << bits; \
  |  |  371|  2.92k|        bits += 8; \
  |  |  372|  2.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 2.92k]
  |  |  ------------------
  ------------------
  943|  2.99k|                }
  944|  13.4k|                DROPBITS(last.bits);
  ------------------
  |  |  388|  13.4k|    do { \
  |  |  389|  13.4k|        hold >>= (n); \
  |  |  390|  13.4k|        bits -= (unsigned)(n); \
  |  |  391|  13.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 13.4k]
  |  |  ------------------
  ------------------
  945|  13.4k|                state->back += last.bits;
  946|  13.4k|            }
  947|   929k|            DROPBITS(here.bits);
  ------------------
  |  |  388|   929k|    do { \
  |  |  389|   929k|        hold >>= (n); \
  |  |  390|   929k|        bits -= (unsigned)(n); \
  |  |  391|   929k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 929k]
  |  |  ------------------
  ------------------
  948|   929k|            state->back += here.bits;
  949|   929k|            state->length = (unsigned)here.val;
  950|   929k|            if ((int)(here.op) == 0) {
  ------------------
  |  Branch (950:17): [True: 888k, False: 40.3k]
  ------------------
  951|   888k|                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
  952|   888k|                        "inflate:         literal '%c'\n" :
  953|   888k|                        "inflate:         literal 0x%02x\n", here.val));
  954|   888k|                state->mode = LIT;
  955|   888k|                break;
  956|   888k|            }
  957|  40.3k|            if (here.op & 32) {
  ------------------
  |  Branch (957:17): [True: 2.36k, False: 38.0k]
  ------------------
  958|  2.36k|                Tracevv((stderr, "inflate:         end of block\n"));
  959|  2.36k|                state->back = -1;
  960|  2.36k|                state->mode = TYPE;
  961|  2.36k|                break;
  962|  2.36k|            }
  963|  38.0k|            if (here.op & 64) {
  ------------------
  |  Branch (963:17): [True: 0, False: 38.0k]
  ------------------
  964|      0|                strm->msg = (z_const char *)"invalid literal/length code";
  965|      0|                state->mode = BAD;
  966|      0|                break;
  967|      0|            }
  968|  38.0k|            state->extra = (unsigned)(here.op) & 15;
  969|  38.0k|            state->mode = LENEXT;
  970|       |                /* fallthrough */
  971|  38.0k|        case LENEXT:
  ------------------
  |  Branch (971:9): [True: 53, False: 1.94M]
  ------------------
  972|  38.0k|            if (state->extra) {
  ------------------
  |  Branch (972:17): [True: 3.60k, False: 34.4k]
  ------------------
  973|  3.60k|                NEEDBITS(state->extra);
  ------------------
  |  |  377|  3.60k|    do { \
  |  |  378|  4.67k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 1.12k, False: 3.55k]
  |  |  ------------------
  |  |  379|  3.60k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  1.12k|    do { \
  |  |  |  |  368|  1.12k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 53, False: 1.07k]
  |  |  |  |  ------------------
  |  |  |  |  369|  1.12k|        have--; \
  |  |  |  |  370|  1.07k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  1.07k|        bits += 8; \
  |  |  |  |  372|  1.07k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 1.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  3.60k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 3.55k]
  |  |  ------------------
  ------------------
  974|  3.55k|                state->length += BITS(state->extra);
  ------------------
  |  |  384|  3.55k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  975|  3.55k|                DROPBITS(state->extra);
  ------------------
  |  |  388|  3.55k|    do { \
  |  |  389|  3.55k|        hold >>= (n); \
  |  |  390|  3.55k|        bits -= (unsigned)(n); \
  |  |  391|  3.55k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 3.55k]
  |  |  ------------------
  ------------------
  976|  3.55k|                state->back += state->extra;
  977|  3.55k|            }
  978|  38.0k|            Tracevv((stderr, "inflate:         length %u\n", state->length));
  979|  38.0k|            state->was = state->length;
  980|  38.0k|            state->mode = DIST;
  981|       |                /* fallthrough */
  982|  38.3k|        case DIST:
  ------------------
  |  Branch (982:9): [True: 357, False: 1.94M]
  ------------------
  983|  56.0k|            for (;;) {
  984|  56.0k|                here = state->distcode[BITS(state->distbits)];
  ------------------
  |  |  384|  56.0k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  985|  56.0k|                if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (985:21): [True: 38.0k, False: 18.0k]
  ------------------
  986|  18.0k|                PULLBYTE();
  ------------------
  |  |  367|  18.0k|    do { \
  |  |  368|  18.0k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (368:13): [True: 354, False: 17.6k]
  |  |  ------------------
  |  |  369|  18.0k|        have--; \
  |  |  370|  17.6k|        hold += (unsigned long)(*next++) << bits; \
  |  |  371|  17.6k|        bits += 8; \
  |  |  372|  17.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 17.6k]
  |  |  ------------------
  ------------------
  987|  18.0k|            }
  988|  38.0k|            if ((here.op & 0xf0) == 0) {
  ------------------
  |  Branch (988:17): [True: 235, False: 37.7k]
  ------------------
  989|    235|                last = here;
  990|    292|                for (;;) {
  991|    292|                    here = state->distcode[last.val +
  992|    292|                            (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  384|    292|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  993|    292|                    if ((unsigned)(last.bits + here.bits) <= bits) break;
  ------------------
  |  Branch (993:25): [True: 232, False: 60]
  ------------------
  994|     60|                    PULLBYTE();
  ------------------
  |  |  367|     60|    do { \
  |  |  368|     60|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (368:13): [True: 3, False: 57]
  |  |  ------------------
  |  |  369|     60|        have--; \
  |  |  370|     57|        hold += (unsigned long)(*next++) << bits; \
  |  |  371|     57|        bits += 8; \
  |  |  372|     57|    } while (0)
  |  |  ------------------
  |  |  |  Branch (372:14): [Folded, False: 57]
  |  |  ------------------
  ------------------
  995|     60|                }
  996|    232|                DROPBITS(last.bits);
  ------------------
  |  |  388|    232|    do { \
  |  |  389|    232|        hold >>= (n); \
  |  |  390|    232|        bits -= (unsigned)(n); \
  |  |  391|    232|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 232]
  |  |  ------------------
  ------------------
  997|    232|                state->back += last.bits;
  998|    232|            }
  999|  38.0k|            DROPBITS(here.bits);
  ------------------
  |  |  388|  38.0k|    do { \
  |  |  389|  38.0k|        hold >>= (n); \
  |  |  390|  38.0k|        bits -= (unsigned)(n); \
  |  |  391|  38.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 38.0k]
  |  |  ------------------
  ------------------
 1000|  38.0k|            state->back += here.bits;
 1001|  38.0k|            if (here.op & 64) {
  ------------------
  |  Branch (1001:17): [True: 0, False: 38.0k]
  ------------------
 1002|      0|                strm->msg = (z_const char *)"invalid distance code";
 1003|      0|                state->mode = BAD;
 1004|      0|                break;
 1005|      0|            }
 1006|  38.0k|            state->offset = (unsigned)here.val;
 1007|  38.0k|            state->extra = (unsigned)(here.op) & 15;
 1008|  38.0k|            state->mode = DISTEXT;
 1009|       |                /* fallthrough */
 1010|  38.7k|        case DISTEXT:
  ------------------
  |  Branch (1010:9): [True: 729, False: 1.94M]
  ------------------
 1011|  38.7k|            if (state->extra) {
  ------------------
  |  Branch (1011:17): [True: 31.9k, False: 6.85k]
  ------------------
 1012|  31.9k|                NEEDBITS(state->extra);
  ------------------
  |  |  377|  31.9k|    do { \
  |  |  378|  67.3k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 36.1k, False: 31.1k]
  |  |  ------------------
  |  |  379|  36.1k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  36.1k|    do { \
  |  |  |  |  368|  36.1k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 729, False: 35.4k]
  |  |  |  |  ------------------
  |  |  |  |  369|  36.1k|        have--; \
  |  |  |  |  370|  35.4k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  35.4k|        bits += 8; \
  |  |  |  |  372|  35.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 35.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  31.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
 1013|  31.1k|                state->offset += BITS(state->extra);
  ------------------
  |  |  384|  31.1k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1014|  31.1k|                DROPBITS(state->extra);
  ------------------
  |  |  388|  31.1k|    do { \
  |  |  389|  31.1k|        hold >>= (n); \
  |  |  390|  31.1k|        bits -= (unsigned)(n); \
  |  |  391|  31.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (391:14): [Folded, False: 31.1k]
  |  |  ------------------
  ------------------
 1015|  31.1k|                state->back += state->extra;
 1016|  31.1k|            }
 1017|       |#ifdef INFLATE_STRICT
 1018|       |            if (state->offset > state->dmax) {
 1019|       |                strm->msg = (z_const char *)"invalid distance too far back";
 1020|       |                state->mode = BAD;
 1021|       |                break;
 1022|       |            }
 1023|       |#endif
 1024|  38.0k|            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
 1025|  38.0k|            state->mode = MATCH;
 1026|       |                /* fallthrough */
 1027|  41.7k|        case MATCH:
  ------------------
  |  Branch (1027:9): [True: 3.68k, False: 1.93M]
  ------------------
 1028|  41.7k|            if (left == 0) goto inf_leave;
  ------------------
  |  Branch (1028:17): [True: 1.55k, False: 40.1k]
  ------------------
 1029|  40.1k|            copy = out - left;
 1030|  40.1k|            if (state->offset > copy) {         /* copy from window */
  ------------------
  |  Branch (1030:17): [True: 12.8k, False: 27.3k]
  ------------------
 1031|  12.8k|                copy = state->offset - copy;
 1032|  12.8k|                if (copy > state->whave) {
  ------------------
  |  Branch (1032:21): [True: 0, False: 12.8k]
  ------------------
 1033|      0|                    if (state->sane) {
  ------------------
  |  Branch (1033:25): [True: 0, False: 0]
  ------------------
 1034|      0|                        strm->msg = (z_const char *)
 1035|      0|                            "invalid distance too far back";
 1036|      0|                        state->mode = BAD;
 1037|      0|                        break;
 1038|      0|                    }
 1039|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
 1040|       |                    Trace((stderr, "inflate.c too far\n"));
 1041|       |                    copy -= state->whave;
 1042|       |                    if (copy > state->length) copy = state->length;
 1043|       |                    if (copy > left) copy = left;
 1044|       |                    left -= copy;
 1045|       |                    state->length -= copy;
 1046|       |                    do {
 1047|       |                        *put++ = 0;
 1048|       |                    } while (--copy);
 1049|       |                    if (state->length == 0) state->mode = LEN;
 1050|       |                    break;
 1051|       |#endif
 1052|      0|                }
 1053|  12.8k|                if (copy > state->wnext) {
  ------------------
  |  Branch (1053:21): [True: 3.93k, False: 8.91k]
  ------------------
 1054|  3.93k|                    copy -= state->wnext;
 1055|  3.93k|                    from = state->window + (state->wsize - copy);
 1056|  3.93k|                }
 1057|  8.91k|                else
 1058|  8.91k|                    from = state->window + (state->wnext - copy);
 1059|  12.8k|                if (copy > state->length) copy = state->length;
  ------------------
  |  Branch (1059:21): [True: 12.0k, False: 764]
  ------------------
 1060|  12.8k|            }
 1061|  27.3k|            else {                              /* copy from output */
 1062|  27.3k|                from = put - state->offset;
 1063|  27.3k|                copy = state->length;
 1064|  27.3k|            }
 1065|  40.1k|            if (copy > left) copy = left;
  ------------------
  |  Branch (1065:17): [True: 1.41k, False: 38.7k]
  ------------------
 1066|  40.1k|            left -= copy;
 1067|  40.1k|            state->length -= copy;
 1068|   442k|            do {
 1069|   442k|                *put++ = *from++;
 1070|   442k|            } while (--copy);
  ------------------
  |  Branch (1070:22): [True: 401k, False: 40.1k]
  ------------------
 1071|  40.1k|            if (state->length == 0) state->mode = LEN;
  ------------------
  |  Branch (1071:17): [True: 38.0k, False: 2.13k]
  ------------------
 1072|  40.1k|            break;
 1073|   891k|        case LIT:
  ------------------
  |  Branch (1073:9): [True: 891k, False: 1.05M]
  ------------------
 1074|   891k|            if (left == 0) goto inf_leave;
  ------------------
  |  Branch (1074:17): [True: 2.97k, False: 888k]
  ------------------
 1075|   888k|            *put++ = (unsigned char)(state->length);
 1076|   888k|            left--;
 1077|   888k|            state->mode = LEN;
 1078|   888k|            break;
 1079|  4.36k|        case CHECK:
  ------------------
  |  Branch (1079:9): [True: 4.36k, False: 1.93M]
  ------------------
 1080|  4.36k|            if (state->wrap) {
  ------------------
  |  Branch (1080:17): [True: 4.36k, False: 0]
  ------------------
 1081|  4.36k|                NEEDBITS(32);
  ------------------
  |  |  377|  4.36k|    do { \
  |  |  378|  21.2k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 17.0k, False: 4.22k]
  |  |  ------------------
  |  |  379|  17.0k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  17.0k|    do { \
  |  |  |  |  368|  17.0k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 138, False: 16.9k]
  |  |  |  |  ------------------
  |  |  |  |  369|  17.0k|        have--; \
  |  |  |  |  370|  16.9k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  16.9k|        bits += 8; \
  |  |  |  |  372|  16.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 16.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  4.36k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
 1082|  4.22k|                out -= left;
 1083|  4.22k|                strm->total_out += out;
 1084|  4.22k|                state->total += out;
 1085|  4.22k|                if ((state->wrap & 4) && out)
  ------------------
  |  Branch (1085:21): [True: 4.22k, False: 0]
  |  Branch (1085:42): [True: 4.02k, False: 202]
  ------------------
 1086|  4.02k|                    strm->adler = state->check =
 1087|  4.02k|                        UPDATE_CHECK(state->check, put - out, out);
  ------------------
  |  |  311|  4.02k|    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
  |  |  ------------------
  |  |  |  Branch (311:6): [True: 4.02k, False: 0]
  |  |  ------------------
  ------------------
 1088|  4.22k|                out = left;
 1089|  4.22k|                if ((state->wrap & 4) && (
  ------------------
  |  Branch (1089:21): [True: 4.22k, False: 0]
  |  Branch (1089:42): [True: 0, False: 4.22k]
  ------------------
 1090|  4.22k|#ifdef GUNZIP
 1091|  4.22k|                     state->flags ? hold :
  ------------------
  |  Branch (1091:22): [True: 4.22k, False: 0]
  ------------------
 1092|  4.22k|#endif
 1093|  4.22k|                     ZSWAP32(hold)) != state->check) {
  ------------------
  |  |  348|      0|#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
  |  |  349|      0|                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
  ------------------
 1094|      0|                    strm->msg = (z_const char *)"incorrect data check";
 1095|      0|                    state->mode = BAD;
 1096|      0|                    break;
 1097|      0|                }
 1098|  4.22k|                INITBITS();
  ------------------
  |  |  359|  4.22k|    do { \
  |  |  360|  4.22k|        hold = 0; \
  |  |  361|  4.22k|        bits = 0; \
  |  |  362|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
 1099|  4.22k|                Tracev((stderr, "inflate:   check matches trailer\n"));
 1100|  4.22k|            }
 1101|  4.22k|#ifdef GUNZIP
 1102|  4.22k|            state->mode = LENGTH;
 1103|       |                /* fallthrough */
 1104|  4.29k|        case LENGTH:
  ------------------
  |  Branch (1104:9): [True: 71, False: 1.94M]
  ------------------
 1105|  4.29k|            if (state->wrap && state->flags) {
  ------------------
  |  Branch (1105:17): [True: 4.29k, False: 0]
  |  Branch (1105:32): [True: 4.29k, False: 0]
  ------------------
 1106|  4.29k|                NEEDBITS(32);
  ------------------
  |  |  377|  4.29k|    do { \
  |  |  378|  21.2k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (378:16): [True: 16.9k, False: 4.22k]
  |  |  ------------------
  |  |  379|  16.9k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  367|  16.9k|    do { \
  |  |  |  |  368|  16.9k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (368:13): [True: 71, False: 16.9k]
  |  |  |  |  ------------------
  |  |  |  |  369|  16.9k|        have--; \
  |  |  |  |  370|  16.9k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  371|  16.9k|        bits += 8; \
  |  |  |  |  372|  16.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (372:14): [Folded, False: 16.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  380|  4.29k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (380:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
 1107|  4.22k|                if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
  ------------------
  |  Branch (1107:21): [True: 4.22k, False: 0]
  |  Branch (1107:42): [True: 0, False: 4.22k]
  ------------------
 1108|      0|                    strm->msg = (z_const char *)"incorrect length check";
 1109|      0|                    state->mode = BAD;
 1110|      0|                    break;
 1111|      0|                }
 1112|  4.22k|                INITBITS();
  ------------------
  |  |  359|  4.22k|    do { \
  |  |  360|  4.22k|        hold = 0; \
  |  |  361|  4.22k|        bits = 0; \
  |  |  362|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (362:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
 1113|  4.22k|                Tracev((stderr, "inflate:   length matches trailer\n"));
 1114|  4.22k|            }
 1115|  4.22k|#endif
 1116|  4.22k|            state->mode = DONE;
 1117|       |                /* fallthrough */
 1118|  4.22k|        case DONE:
  ------------------
  |  Branch (1118:9): [True: 0, False: 1.94M]
  ------------------
 1119|  4.22k|            ret = Z_STREAM_END;
  ------------------
  |  |  182|  4.22k|#define Z_STREAM_END    1
  ------------------
 1120|  4.22k|            goto inf_leave;
 1121|      0|        case BAD:
  ------------------
  |  Branch (1121:9): [True: 0, False: 1.94M]
  ------------------
 1122|      0|            ret = Z_DATA_ERROR;
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
 1123|      0|            goto inf_leave;
 1124|      0|        case MEM:
  ------------------
  |  Branch (1124:9): [True: 0, False: 1.94M]
  ------------------
 1125|      0|            return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
 1126|      0|        case SYNC:
  ------------------
  |  Branch (1126:9): [True: 0, False: 1.94M]
  ------------------
 1127|       |                /* fallthrough */
 1128|      0|        default:
  ------------------
  |  Branch (1128:9): [True: 0, False: 1.94M]
  ------------------
 1129|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1130|  1.94M|        }
 1131|       |
 1132|       |    /*
 1133|       |       Return from inflate(), updating the total counts and the check value.
 1134|       |       If there was no progress during the inflate() call, return a buffer
 1135|       |       error.  Call updatewindow() to create and/or update the window state.
 1136|       |       Note: a memory error from inflate() is non-recoverable.
 1137|       |     */
 1138|  29.6k|  inf_leave:
 1139|  29.6k|    RESTORE();
  ------------------
  |  |  348|  29.6k|    do { \
  |  |  349|  29.6k|        strm->next_out = put; \
  |  |  350|  29.6k|        strm->avail_out = left; \
  |  |  351|  29.6k|        strm->next_in = next; \
  |  |  352|  29.6k|        strm->avail_in = have; \
  |  |  353|  29.6k|        state->hold = hold; \
  |  |  354|  29.6k|        state->bits = bits; \
  |  |  355|  29.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (355:14): [Folded, False: 29.6k]
  |  |  ------------------
  ------------------
 1140|  29.6k|    if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
  ------------------
  |  Branch (1140:9): [True: 25.3k, False: 4.24k]
  |  Branch (1140:26): [True: 2.10k, False: 2.13k]
  |  Branch (1140:52): [True: 2.10k, False: 0]
  ------------------
 1141|  2.10k|            (state->mode < CHECK || flush != Z_FINISH)))
  ------------------
  |  |  176|     53|#define Z_FINISH        4
  ------------------
  |  Branch (1141:14): [True: 2.05k, False: 53]
  |  Branch (1141:37): [True: 53, False: 0]
  ------------------
 1142|  27.4k|        if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
  ------------------
  |  Branch (1142:13): [True: 0, False: 27.4k]
  ------------------
 1143|      0|            state->mode = MEM;
 1144|      0|            return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
 1145|      0|        }
 1146|  29.6k|    in -= strm->avail_in;
 1147|  29.6k|    out -= strm->avail_out;
 1148|  29.6k|    strm->total_in += in;
 1149|  29.6k|    strm->total_out += out;
 1150|  29.6k|    state->total += out;
 1151|  29.6k|    if ((state->wrap & 4) && out)
  ------------------
  |  Branch (1151:9): [True: 29.6k, False: 0]
  |  Branch (1151:30): [True: 25.3k, False: 4.29k]
  ------------------
 1152|  25.3k|        strm->adler = state->check =
 1153|  25.3k|            UPDATE_CHECK(state->check, strm->next_out - out, out);
  ------------------
  |  |  311|  25.3k|    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
  |  |  ------------------
  |  |  |  Branch (311:6): [True: 25.3k, False: 0]
  |  |  ------------------
  ------------------
 1154|  29.6k|    strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
  ------------------
  |  Branch (1154:43): [True: 6.79k, False: 22.8k]
  ------------------
 1155|  29.6k|                      (state->mode == TYPE ? 128 : 0) +
  ------------------
  |  Branch (1155:24): [True: 92, False: 29.5k]
  ------------------
 1156|  29.6k|                      (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
  ------------------
  |  Branch (1156:24): [True: 0, False: 29.6k]
  |  Branch (1156:47): [True: 0, False: 29.6k]
  ------------------
 1157|  29.6k|    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
  ------------------
  |  |  176|  29.6k|#define Z_FINISH        4
  ------------------
                  if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  |  Branch (1157:11): [True: 0, False: 29.6k]
  |  Branch (1157:22): [True: 0, False: 0]
  |  Branch (1157:35): [True: 0, False: 29.6k]
  |  Branch (1157:57): [True: 0, False: 0]
  ------------------
 1158|      0|        ret = Z_BUF_ERROR;
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
 1159|  29.6k|    return ret;
 1160|  29.6k|}
inflateEnd:
 1162|  4.22k|int ZEXPORT inflateEnd(z_streamp strm) {
 1163|  4.22k|    struct inflate_state FAR *state;
 1164|  4.22k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (1164:9): [True: 0, False: 4.22k]
  ------------------
 1165|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1166|  4.22k|    state = (struct inflate_state FAR *)strm->state;
 1167|  4.22k|    if (state->window != Z_NULL) ZFREE(strm, state->window);
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (state->window != Z_NULL) ZFREE(strm, state->window);
  ------------------
  |  |  344|  2.10k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  |  Branch (1167:9): [True: 2.10k, False: 2.12k]
  ------------------
 1168|  4.22k|    ZFREE(strm, strm->state);
  ------------------
  |  |  344|  4.22k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1169|  4.22k|    strm->state = Z_NULL;
  ------------------
  |  |  216|  4.22k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1170|  4.22k|    Tracev((stderr, "inflate: end\n"));
 1171|  4.22k|    return Z_OK;
  ------------------
  |  |  181|  4.22k|#define Z_OK            0
  ------------------
 1172|  4.22k|}
inflate.c:inflateStateCheck:
   88|  54.9k|local int inflateStateCheck(z_streamp strm) {
   89|  54.9k|    struct inflate_state FAR *state;
   90|  54.9k|    if (strm == Z_NULL ||
  ------------------
  |  |  216|   109k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (90:9): [True: 0, False: 54.9k]
  ------------------
   91|  54.9k|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (91:9): [True: 0, False: 54.9k]
  |  Branch (91:42): [True: 0, False: 54.9k]
  ------------------
   92|      0|        return 1;
   93|  54.9k|    state = (struct inflate_state FAR *)strm->state;
   94|  54.9k|    if (state == Z_NULL || state->strm != strm ||
  ------------------
  |  |  216|   109k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (94:9): [True: 0, False: 54.9k]
  |  Branch (94:28): [True: 0, False: 54.9k]
  ------------------
   95|  54.9k|        state->mode < HEAD || state->mode > SYNC)
  ------------------
  |  Branch (95:9): [True: 0, False: 54.9k]
  |  Branch (95:31): [True: 0, False: 54.9k]
  ------------------
   96|      0|        return 1;
   97|  54.9k|    return 0;
   98|  54.9k|}
inflate.c:updatewindow:
  260|  27.4k|local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) {
  261|  27.4k|    struct inflate_state FAR *state;
  262|  27.4k|    unsigned dist;
  263|       |
  264|  27.4k|    state = (struct inflate_state FAR *)strm->state;
  265|       |
  266|       |    /* if it hasn't been done already, allocate space for the window */
  267|  27.4k|    if (state->window == Z_NULL) {
  ------------------
  |  |  216|  27.4k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (267:9): [True: 2.10k, False: 25.3k]
  ------------------
  268|  2.10k|        state->window = (unsigned char FAR *)
  269|  2.10k|                        ZALLOC(strm, 1U << state->wbits,
  ------------------
  |  |  343|  2.10k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  270|  2.10k|                               sizeof(unsigned char));
  271|  2.10k|        if (state->window == Z_NULL) return 1;
  ------------------
  |  |  216|  2.10k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (271:13): [True: 0, False: 2.10k]
  ------------------
  272|  2.10k|    }
  273|       |
  274|       |    /* if window not in use yet, initialize */
  275|  27.4k|    if (state->wsize == 0) {
  ------------------
  |  Branch (275:9): [True: 2.10k, False: 25.3k]
  ------------------
  276|  2.10k|        state->wsize = 1U << state->wbits;
  277|  2.10k|        state->wnext = 0;
  278|  2.10k|        state->whave = 0;
  279|  2.10k|    }
  280|       |
  281|       |    /* copy state->wsize or less output bytes into the circular window */
  282|  27.4k|    if (copy >= state->wsize) {
  ------------------
  |  Branch (282:9): [True: 872, False: 26.6k]
  ------------------
  283|    872|        zmemcpy(state->window, end - state->wsize, state->wsize);
  ------------------
  |  |  306|    872|#    define zmemcpy memcpy
  ------------------
  284|    872|        state->wnext = 0;
  285|    872|        state->whave = state->wsize;
  286|    872|    }
  287|  26.6k|    else {
  288|  26.6k|        dist = state->wsize - state->wnext;
  289|  26.6k|        if (dist > copy) dist = copy;
  ------------------
  |  Branch (289:13): [True: 21.2k, False: 5.33k]
  ------------------
  290|  26.6k|        zmemcpy(state->window + state->wnext, end - copy, dist);
  ------------------
  |  |  306|  26.6k|#    define zmemcpy memcpy
  ------------------
  291|  26.6k|        copy -= dist;
  292|  26.6k|        if (copy) {
  ------------------
  |  Branch (292:13): [True: 3.85k, False: 22.7k]
  ------------------
  293|  3.85k|            zmemcpy(state->window, end - copy, copy);
  ------------------
  |  |  306|  3.85k|#    define zmemcpy memcpy
  ------------------
  294|  3.85k|            state->wnext = copy;
  295|  3.85k|            state->whave = state->wsize;
  296|  3.85k|        }
  297|  22.7k|        else {
  298|  22.7k|            state->wnext += dist;
  299|  22.7k|            if (state->wnext == state->wsize) state->wnext = 0;
  ------------------
  |  Branch (299:17): [True: 1.48k, False: 21.2k]
  ------------------
  300|  22.7k|            if (state->whave < state->wsize) state->whave += dist;
  ------------------
  |  Branch (300:17): [True: 6.10k, False: 16.6k]
  ------------------
  301|  22.7k|        }
  302|  26.6k|    }
  303|  27.4k|    return 0;
  304|  27.4k|}

inflate_table:
   48|  29.7k|                                unsigned FAR *bits, unsigned short FAR *work) {
   49|  29.7k|    unsigned len;               /* a code's length in bits */
   50|  29.7k|    unsigned sym;               /* index of code symbols */
   51|  29.7k|    unsigned min, max;          /* minimum and maximum code lengths */
   52|  29.7k|    unsigned root;              /* number of index bits for root table */
   53|  29.7k|    unsigned curr;              /* number of index bits for current table */
   54|  29.7k|    unsigned drop;              /* code bits to drop for sub-table */
   55|  29.7k|    int left;                   /* number of prefix codes available */
   56|  29.7k|    unsigned used;              /* code entries in table used */
   57|  29.7k|    unsigned huff;              /* Huffman code */
   58|  29.7k|    unsigned incr;              /* for incrementing code, index */
   59|  29.7k|    unsigned fill;              /* index for replicating entries */
   60|  29.7k|    unsigned low;               /* low bits for current root entry */
   61|  29.7k|    unsigned mask;              /* mask for low root bits */
   62|  29.7k|    code here;                  /* table entry for duplication */
   63|  29.7k|    code FAR *next;             /* next available space in table */
   64|  29.7k|    const unsigned short FAR *base = NULL;  /* base value table to use */
   65|  29.7k|    const unsigned short FAR *extra = NULL; /* extra bits table to use */
   66|  29.7k|    unsigned match = 0;         /* use base and extra for symbol >= match */
   67|  29.7k|    unsigned short count[MAXBITS+1];    /* number of codes of each length */
   68|  29.7k|    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
   69|  29.7k|    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
   70|  29.7k|        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
   71|  29.7k|        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
   72|  29.7k|    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
   73|  29.7k|        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
   74|  29.7k|        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 192};
   75|  29.7k|    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
   76|  29.7k|        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
   77|  29.7k|        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
   78|  29.7k|        8193, 12289, 16385, 24577, 0, 0};
   79|  29.7k|    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
   80|  29.7k|        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
   81|  29.7k|        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
   82|  29.7k|        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|   505k|    for (len = 0; len <= MAXBITS; len++)
  ------------------
  |  |   23|   505k|#define MAXBITS 15
  ------------------
  |  Branch (116:19): [True: 475k, False: 29.7k]
  ------------------
  117|   475k|        count[len] = 0;
  118|  2.94M|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (118:19): [True: 2.91M, False: 29.7k]
  ------------------
  119|  2.91M|        count[lens[sym]]++;
  120|       |
  121|       |    /* bound code lengths, force root to be within code lengths */
  122|  29.7k|    root = *bits;
  123|   286k|    for (max = MAXBITS; max >= 1; max--)
  ------------------
  |  |   23|  29.7k|#define MAXBITS 15
  ------------------
  |  Branch (123:25): [True: 286k, False: 0]
  ------------------
  124|   286k|        if (count[max] != 0) break;
  ------------------
  |  Branch (124:13): [True: 29.7k, False: 256k]
  ------------------
  125|  29.7k|    if (root > max) root = max;
  ------------------
  |  Branch (125:9): [True: 16.4k, False: 13.2k]
  ------------------
  126|  29.7k|    if (max == 0) {                     /* no symbols to code at all */
  ------------------
  |  Branch (126:9): [True: 0, False: 29.7k]
  ------------------
  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|  68.1k|    for (min = 1; min < max; min++)
  ------------------
  |  Branch (135:19): [True: 60.2k, False: 7.81k]
  ------------------
  136|  60.2k|        if (count[min] != 0) break;
  ------------------
  |  Branch (136:13): [True: 21.9k, False: 38.3k]
  ------------------
  137|  29.7k|    if (root < min) root = min;
  ------------------
  |  Branch (137:9): [True: 0, False: 29.7k]
  ------------------
  138|       |
  139|       |    /* check for an over-subscribed or incomplete set of lengths */
  140|  29.7k|    left = 1;
  141|   475k|    for (len = 1; len <= MAXBITS; len++) {
  ------------------
  |  |   23|   475k|#define MAXBITS 15
  ------------------
  |  Branch (141:19): [True: 445k, False: 29.7k]
  ------------------
  142|   445k|        left <<= 1;
  143|   445k|        left -= count[len];
  144|   445k|        if (left < 0) return -1;        /* over-subscribed */
  ------------------
  |  Branch (144:13): [True: 0, False: 445k]
  ------------------
  145|   445k|    }
  146|  29.7k|    if (left > 0 && (type == CODES || max != 1))
  ------------------
  |  Branch (146:9): [True: 0, False: 29.7k]
  |  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|  29.7k|    offs[1] = 0;
  151|   445k|    for (len = 1; len < MAXBITS; len++)
  ------------------
  |  |   23|   445k|#define MAXBITS 15
  ------------------
  |  Branch (151:19): [True: 416k, False: 29.7k]
  ------------------
  152|   416k|        offs[len + 1] = offs[len] + count[len];
  153|       |
  154|       |    /* sort symbols by length, by symbol order within each length */
  155|  2.94M|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (155:19): [True: 2.91M, False: 29.7k]
  ------------------
  156|  2.91M|        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
  ------------------
  |  Branch (156:13): [True: 1.96M, False: 952k]
  ------------------
  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|  29.7k|    switch (type) {
  ------------------
  |  Branch (190:13): [True: 29.7k, False: 0]
  ------------------
  191|  9.90k|    case CODES:
  ------------------
  |  Branch (191:5): [True: 9.90k, False: 19.8k]
  ------------------
  192|  9.90k|        match = 20;
  193|  9.90k|        break;
  194|  9.90k|    case LENS:
  ------------------
  |  Branch (194:5): [True: 9.90k, False: 19.8k]
  ------------------
  195|  9.90k|        base = lbase;
  196|  9.90k|        extra = lext;
  197|  9.90k|        match = 257;
  198|  9.90k|        break;
  199|  9.90k|    case DISTS:
  ------------------
  |  Branch (199:5): [True: 9.90k, False: 19.8k]
  ------------------
  200|  9.90k|        base = dbase;
  201|  9.90k|        extra = dext;
  202|  29.7k|    }
  203|       |
  204|       |    /* initialize state for loop */
  205|  29.7k|    huff = 0;                   /* starting code */
  206|  29.7k|    sym = 0;                    /* starting code symbol */
  207|  29.7k|    len = min;                  /* starting code length */
  208|  29.7k|    next = *table;              /* current table to fill in */
  209|  29.7k|    curr = root;                /* current table index bits */
  210|  29.7k|    drop = 0;                   /* current bits to drop from code for index */
  211|  29.7k|    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
  212|  29.7k|    used = 1U << root;          /* use root table entries */
  213|  29.7k|    mask = used - 1;            /* mask for comparing low */
  214|       |
  215|       |    /* check available table space */
  216|  29.7k|    if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   50|  9.90k|#  define ENOUGH_LENS 1332
  ------------------
  |  Branch (216:10): [True: 9.90k, False: 19.8k]
  |  Branch (216:26): [True: 0, False: 9.90k]
  ------------------
  217|  29.7k|        (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   51|  9.90k|#  define ENOUGH_DISTS 400
  ------------------
  |  Branch (217:10): [True: 9.90k, False: 19.8k]
  |  Branch (217:27): [True: 0, False: 9.90k]
  ------------------
  218|      0|        return 1;
  219|       |
  220|       |    /* process all codes and make table entries */
  221|  1.96M|    for (;;) {
  222|       |        /* create table entry */
  223|  1.96M|        here.bits = (unsigned char)(len - drop);
  224|  1.96M|        if (work[sym] + 1U < match) {
  ------------------
  |  Branch (224:13): [True: 1.83M, False: 129k]
  ------------------
  225|  1.83M|            here.op = (unsigned char)0;
  226|  1.83M|            here.val = work[sym];
  227|  1.83M|        }
  228|   129k|        else if (work[sym] >= match) {
  ------------------
  |  Branch (228:18): [True: 119k, False: 9.90k]
  ------------------
  229|   119k|            here.op = (unsigned char)(extra[work[sym] - match]);
  230|   119k|            here.val = base[work[sym] - match];
  231|   119k|        }
  232|  9.90k|        else {
  233|  9.90k|            here.op = (unsigned char)(32 + 64);         /* end of block */
  234|  9.90k|            here.val = 0;
  235|  9.90k|        }
  236|       |
  237|       |        /* replicate for those indices with low len bits equal to huff */
  238|  1.96M|        incr = 1U << (len - drop);
  239|  1.96M|        fill = 1U << curr;
  240|  1.96M|        min = fill;                 /* save offset to next table */
  241|  9.55M|        do {
  242|  9.55M|            fill -= incr;
  243|  9.55M|            next[(huff >> drop) + fill] = here;
  244|  9.55M|        } while (fill != 0);
  ------------------
  |  Branch (244:18): [True: 7.58M, False: 1.96M]
  ------------------
  245|       |
  246|       |        /* backwards increment the len-bit code huff */
  247|  1.96M|        incr = 1U << (len - 1);
  248|  3.90M|        while (huff & incr)
  ------------------
  |  Branch (248:16): [True: 1.93M, False: 1.96M]
  ------------------
  249|  1.93M|            incr >>= 1;
  250|  1.96M|        if (incr != 0) {
  ------------------
  |  Branch (250:13): [True: 1.93M, False: 29.7k]
  ------------------
  251|  1.93M|            huff &= incr - 1;
  252|  1.93M|            huff += incr;
  253|  1.93M|        }
  254|  29.7k|        else
  255|  29.7k|            huff = 0;
  256|       |
  257|       |        /* go to next symbol, update count, len */
  258|  1.96M|        sym++;
  259|  1.96M|        if (--(count[len]) == 0) {
  ------------------
  |  Branch (259:13): [True: 134k, False: 1.83M]
  ------------------
  260|   134k|            if (len == max) break;
  ------------------
  |  Branch (260:17): [True: 29.7k, False: 104k]
  ------------------
  261|   104k|            len = lens[work[sym]];
  262|   104k|        }
  263|       |
  264|       |        /* create new sub-table if needed */
  265|  1.93M|        if (len > root && (huff & mask) != low) {
  ------------------
  |  Branch (265:13): [True: 230k, False: 1.70M]
  |  Branch (265:27): [True: 54.3k, False: 176k]
  ------------------
  266|       |            /* if first time, transition to sub-tables */
  267|  54.3k|            if (drop == 0)
  ------------------
  |  Branch (267:17): [True: 7.69k, False: 46.6k]
  ------------------
  268|  7.69k|                drop = root;
  269|       |
  270|       |            /* increment past last table */
  271|  54.3k|            next += min;            /* here min is 1 << curr */
  272|       |
  273|       |            /* determine length of next table */
  274|  54.3k|            curr = len - drop;
  275|  54.3k|            left = (int)(1 << curr);
  276|  63.4k|            while (curr + drop < max) {
  ------------------
  |  Branch (276:20): [True: 49.9k, False: 13.4k]
  ------------------
  277|  49.9k|                left -= count[curr + drop];
  278|  49.9k|                if (left <= 0) break;
  ------------------
  |  Branch (278:21): [True: 40.8k, False: 9.15k]
  ------------------
  279|  9.15k|                curr++;
  280|  9.15k|                left <<= 1;
  281|  9.15k|            }
  282|       |
  283|       |            /* check for enough space */
  284|  54.3k|            used += 1U << curr;
  285|  54.3k|            if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   50|  52.8k|#  define ENOUGH_LENS 1332
  ------------------
  |  Branch (285:18): [True: 52.8k, False: 1.53k]
  |  Branch (285:34): [True: 0, False: 52.8k]
  ------------------
  286|  54.3k|                (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   51|  1.53k|#  define ENOUGH_DISTS 400
  ------------------
  |  Branch (286:18): [True: 1.53k, False: 52.8k]
  |  Branch (286:35): [True: 0, False: 1.53k]
  ------------------
  287|      0|                return 1;
  288|       |
  289|       |            /* point entry in root table to sub-table */
  290|  54.3k|            low = huff & mask;
  291|  54.3k|            (*table)[low].op = (unsigned char)curr;
  292|  54.3k|            (*table)[low].bits = (unsigned char)root;
  293|  54.3k|            (*table)[low].val = (unsigned short)(next - *table);
  294|  54.3k|        }
  295|  1.93M|    }
  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|  29.7k|    if (huff != 0) {
  ------------------
  |  Branch (300:9): [True: 0, False: 29.7k]
  ------------------
  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|  29.7k|    *table += used;
  309|  29.7k|    *bits = root;
  310|  29.7k|    return 0;
  311|  29.7k|}
inflate_fixed:
  364|  1.56k|void inflate_fixed(struct inflate_state FAR *state) {
  365|       |#ifdef BUILDFIXED
  366|       |    z_once(&built, buildtables);
  367|       |#endif /* BUILDFIXED */
  368|  1.56k|    state->lencode = lenfix;
  369|  1.56k|    state->lenbits = 9;
  370|  1.56k|    state->distcode = distfix;
  371|  1.56k|    state->distbits = 5;
  372|  1.56k|}

_tr_init:
  457|  4.22k|void ZLIB_INTERNAL _tr_init(deflate_state *s) {
  458|  4.22k|    tr_static_init();
  459|       |
  460|  4.22k|    s->l_desc.dyn_tree = s->dyn_ltree;
  461|  4.22k|    s->l_desc.stat_desc = &static_l_desc;
  462|       |
  463|  4.22k|    s->d_desc.dyn_tree = s->dyn_dtree;
  464|  4.22k|    s->d_desc.stat_desc = &static_d_desc;
  465|       |
  466|  4.22k|    s->bl_desc.dyn_tree = s->bl_tree;
  467|  4.22k|    s->bl_desc.stat_desc = &static_bl_desc;
  468|       |
  469|  4.22k|    s->bi_buf = 0;
  470|  4.22k|    s->bi_valid = 0;
  471|  4.22k|    s->bi_used = 0;
  472|       |#ifdef ZLIB_DEBUG
  473|       |    s->compressed_len = 0L;
  474|       |    s->bits_sent = 0L;
  475|       |#endif
  476|       |
  477|       |    /* Initialize the first block of the first file: */
  478|  4.22k|    init_block(s);
  479|  4.22k|}
_tr_stored_block:
  862|  3.96k|                                    ulg stored_len, int last) {
  863|  3.96k|    send_bits(s, (STORED_BLOCK<<1) + last, 3);  /* send block type */
  ------------------
  |  |  275|  3.96k|#define send_bits(s, value, length) \
  |  |  276|  3.96k|{ int len = length;\
  |  |  277|  3.96k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  3.96k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 0, False: 3.96k]
  |  |  ------------------
  |  |  278|      0|    int val = (int)value;\
  |  |  279|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|      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|}
  |  |  ------------------
  |  |  281|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  283|  3.96k|  } else {\
  |  |  284|  3.96k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|  3.96k|    s->bi_valid += len;\
  |  |  286|  3.96k|  }\
  |  |  287|  3.96k|}
  ------------------
  864|  3.96k|    bi_windup(s);        /* align on byte boundary */
  865|  3.96k|    put_short(s, (ush)stored_len);
  ------------------
  |  |  144|  3.96k|#define put_short(s, w) { \
  |  |  145|  3.96k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  3.96k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  3.96k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  3.96k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  3.96k|}
  ------------------
  866|  3.96k|    put_short(s, (ush)~stored_len);
  ------------------
  |  |  144|  3.96k|#define put_short(s, w) { \
  |  |  145|  3.96k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  3.96k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  3.96k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  3.96k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  3.96k|}
  ------------------
  867|  3.96k|    if (stored_len)
  ------------------
  |  Branch (867:9): [True: 3.96k, False: 0]
  ------------------
  868|  3.96k|        zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
  ------------------
  |  |  306|  3.96k|#    define zmemcpy memcpy
  ------------------
  869|  3.96k|    s->pending += stored_len;
  870|       |#ifdef ZLIB_DEBUG
  871|       |    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
  872|       |    s->compressed_len += (stored_len + 4) << 3;
  873|       |    s->bits_sent += 2*16;
  874|       |    s->bits_sent += stored_len << 3;
  875|       |#endif
  876|  3.96k|}
_tr_flush_bits:
  881|  43.2k|void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) {
  882|  43.2k|    bi_flush(s);
  883|  43.2k|}
_tr_flush_block:
  999|  15.4k|                                   ulg stored_len, int last) {
 1000|  15.4k|    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
 1001|  15.4k|    int max_blindex = 0;  /* index of last bit length code of non zero freq */
 1002|       |
 1003|       |    /* Build the Huffman trees unless a stored block is forced */
 1004|  15.4k|    if (s->level > 0) {
  ------------------
  |  Branch (1004:9): [True: 15.4k, False: 0]
  ------------------
 1005|       |
 1006|       |        /* Check if the file is binary or text */
 1007|  15.4k|        if (s->strm->data_type == Z_UNKNOWN)
  ------------------
  |  |  210|  15.4k|#define Z_UNKNOWN  2
  ------------------
  |  Branch (1007:13): [True: 4.22k, False: 11.2k]
  ------------------
 1008|  4.22k|            s->strm->data_type = detect_data_type(s);
 1009|       |
 1010|       |        /* Construct the literal and distance trees */
 1011|  15.4k|        build_tree(s, (tree_desc *)(&(s->l_desc)));
 1012|  15.4k|        Tracev((stderr, "\nlit data: dyn %lu, stat %lu", s->opt_len,
 1013|  15.4k|                s->static_len));
 1014|       |
 1015|  15.4k|        build_tree(s, (tree_desc *)(&(s->d_desc)));
 1016|  15.4k|        Tracev((stderr, "\ndist data: dyn %lu, stat %lu", s->opt_len,
 1017|  15.4k|                s->static_len));
 1018|       |        /* At this point, opt_len and static_len are the total bit lengths of
 1019|       |         * the compressed block data, excluding the tree representations.
 1020|       |         */
 1021|       |
 1022|       |        /* Build the bit length tree for the above two trees, and get the index
 1023|       |         * in bl_order of the last bit length code to send.
 1024|       |         */
 1025|  15.4k|        max_blindex = build_bl_tree(s);
 1026|       |
 1027|       |        /* Determine the best encoding. Compute the block lengths in bytes. */
 1028|  15.4k|        opt_lenb = (s->opt_len + 3 + 7) >> 3;
 1029|  15.4k|        static_lenb = (s->static_len + 3 + 7) >> 3;
 1030|       |
 1031|  15.4k|        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
 1032|  15.4k|                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
 1033|  15.4k|                s->sym_next / 3));
 1034|       |
 1035|  15.4k|#ifndef FORCE_STATIC
 1036|  15.4k|        if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
  ------------------
  |  |  203|  13.6k|#define Z_FIXED               4
  ------------------
  |  Branch (1036:13): [True: 1.83k, False: 13.6k]
  |  Branch (1036:40): [True: 0, False: 13.6k]
  ------------------
 1037|  1.83k|#endif
 1038|  1.83k|            opt_lenb = static_lenb;
 1039|       |
 1040|  15.4k|    } else {
 1041|      0|        Assert(buf != (char*)0, "lost buf");
 1042|      0|        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
 1043|      0|    }
 1044|       |
 1045|       |#ifdef FORCE_STORED
 1046|       |    if (buf != (char*)0) { /* force stored block */
 1047|       |#else
 1048|  15.4k|    if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
  ------------------
  |  Branch (1048:9): [True: 3.96k, False: 11.4k]
  |  Branch (1048:39): [True: 3.96k, False: 0]
  ------------------
 1049|       |                       /* 4: two words for the lengths */
 1050|  3.96k|#endif
 1051|       |        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
 1052|       |         * Otherwise we can't have processed more than WSIZE input bytes since
 1053|       |         * the last block flush, because compression would have been
 1054|       |         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
 1055|       |         * transform a block into a stored block.
 1056|       |         */
 1057|  3.96k|        _tr_stored_block(s, buf, stored_len, last);
 1058|       |
 1059|  11.4k|    } else if (static_lenb == opt_lenb) {
  ------------------
  |  Branch (1059:16): [True: 1.56k, False: 9.90k]
  ------------------
 1060|  1.56k|        send_bits(s, (STATIC_TREES<<1) + last, 3);
  ------------------
  |  |  275|  1.56k|#define send_bits(s, value, length) \
  |  |  276|  1.56k|{ int len = length;\
  |  |  277|  1.56k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  1.56k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 0, False: 1.56k]
  |  |  ------------------
  |  |  278|      0|    int val = (int)value;\
  |  |  279|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|      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|}
  |  |  ------------------
  |  |  281|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  283|  1.56k|  } else {\
  |  |  284|  1.56k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|  1.56k|    s->bi_valid += len;\
  |  |  286|  1.56k|  }\
  |  |  287|  1.56k|}
  ------------------
 1061|  1.56k|        compress_block(s, (const ct_data *)static_ltree,
 1062|  1.56k|                       (const ct_data *)static_dtree);
 1063|       |#ifdef ZLIB_DEBUG
 1064|       |        s->compressed_len += 3 + s->static_len;
 1065|       |#endif
 1066|  9.90k|    } else {
 1067|  9.90k|        send_bits(s, (DYN_TREES<<1) + last, 3);
  ------------------
  |  |  275|  9.90k|#define send_bits(s, value, length) \
  |  |  276|  9.90k|{ int len = length;\
  |  |  277|  9.90k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  9.90k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 0, False: 9.90k]
  |  |  ------------------
  |  |  278|      0|    int val = (int)value;\
  |  |  279|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|      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|}
  |  |  ------------------
  |  |  281|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  283|  9.90k|  } else {\
  |  |  284|  9.90k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|  9.90k|    s->bi_valid += len;\
  |  |  286|  9.90k|  }\
  |  |  287|  9.90k|}
  ------------------
 1068|  9.90k|        send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
 1069|  9.90k|                       max_blindex + 1);
 1070|  9.90k|        compress_block(s, (const ct_data *)s->dyn_ltree,
 1071|  9.90k|                       (const ct_data *)s->dyn_dtree);
 1072|       |#ifdef ZLIB_DEBUG
 1073|       |        s->compressed_len += 3 + s->opt_len;
 1074|       |#endif
 1075|  9.90k|    }
 1076|  15.4k|    Assert (s->compressed_len == s->bits_sent, "bad compressed size");
 1077|       |    /* The above check is made mod 2^32, for files larger than 512 MB
 1078|       |     * and uLong implemented on 32 bits.
 1079|       |     */
 1080|  15.4k|    init_block(s);
 1081|       |
 1082|  15.4k|    if (last) {
  ------------------
  |  Branch (1082:9): [True: 4.22k, False: 11.2k]
  ------------------
 1083|  4.22k|        bi_windup(s);
 1084|       |#ifdef ZLIB_DEBUG
 1085|       |        s->compressed_len += 7;  /* align on byte boundary */
 1086|       |#endif
 1087|  4.22k|    }
 1088|  15.4k|    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
 1089|  15.4k|           s->compressed_len - 7*(ulg)last));
 1090|  15.4k|}
trees.c:tr_static_init:
  296|  4.22k|local void tr_static_init(void) {
  297|       |#if defined(GEN_TREES_H) || !defined(STDC)
  298|       |    static int static_init_done = 0;
  299|       |    int n;        /* iterates over tree elements */
  300|       |    int bits;     /* bit counter */
  301|       |    int length;   /* length value */
  302|       |    int code;     /* code value */
  303|       |    int dist;     /* distance index */
  304|       |    ush bl_count[MAX_BITS+1];
  305|       |    /* number of codes at each bit length for an optimal tree */
  306|       |
  307|       |    if (static_init_done) return;
  308|       |
  309|       |    /* For some embedded targets, global variables are not initialized: */
  310|       |#ifdef NO_INIT_GLOBAL_POINTERS
  311|       |    static_l_desc.static_tree = static_ltree;
  312|       |    static_l_desc.extra_bits = extra_lbits;
  313|       |    static_d_desc.static_tree = static_dtree;
  314|       |    static_d_desc.extra_bits = extra_dbits;
  315|       |    static_bl_desc.extra_bits = extra_blbits;
  316|       |#endif
  317|       |
  318|       |    /* Initialize the mapping length (0..255) -> length code (0..28) */
  319|       |    length = 0;
  320|       |    for (code = 0; code < LENGTH_CODES-1; code++) {
  321|       |        base_length[code] = length;
  322|       |        for (n = 0; n < (1 << extra_lbits[code]); n++) {
  323|       |            _length_code[length++] = (uch)code;
  324|       |        }
  325|       |    }
  326|       |    Assert (length == 256, "tr_static_init: length != 256");
  327|       |    /* Note that the length 255 (match length 258) can be represented
  328|       |     * in two different ways: code 284 + 5 bits or code 285, so we
  329|       |     * overwrite length_code[255] to use the best encoding:
  330|       |     */
  331|       |    _length_code[length - 1] = (uch)code;
  332|       |
  333|       |    /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
  334|       |    dist = 0;
  335|       |    for (code = 0 ; code < 16; code++) {
  336|       |        base_dist[code] = dist;
  337|       |        for (n = 0; n < (1 << extra_dbits[code]); n++) {
  338|       |            _dist_code[dist++] = (uch)code;
  339|       |        }
  340|       |    }
  341|       |    Assert (dist == 256, "tr_static_init: dist != 256");
  342|       |    dist >>= 7; /* from now on, all distances are divided by 128 */
  343|       |    for ( ; code < D_CODES; code++) {
  344|       |        base_dist[code] = dist << 7;
  345|       |        for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
  346|       |            _dist_code[256 + dist++] = (uch)code;
  347|       |        }
  348|       |    }
  349|       |    Assert (dist == 256, "tr_static_init: 256 + dist != 512");
  350|       |
  351|       |    /* Construct the codes of the static literal tree */
  352|       |    for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
  353|       |    n = 0;
  354|       |    while (n <= 143) static_ltree[n++].Len = 8, bl_count[8]++;
  355|       |    while (n <= 255) static_ltree[n++].Len = 9, bl_count[9]++;
  356|       |    while (n <= 279) static_ltree[n++].Len = 7, bl_count[7]++;
  357|       |    while (n <= 287) static_ltree[n++].Len = 8, bl_count[8]++;
  358|       |    /* Codes 286 and 287 do not exist, but we must include them in the
  359|       |     * tree construction to get a canonical Huffman tree (longest code
  360|       |     * all ones)
  361|       |     */
  362|       |    gen_codes((ct_data *)static_ltree, L_CODES+1, bl_count);
  363|       |
  364|       |    /* The static distance tree is trivial: */
  365|       |    for (n = 0; n < D_CODES; n++) {
  366|       |        static_dtree[n].Len = 5;
  367|       |        static_dtree[n].Code = bi_reverse((unsigned)n, 5);
  368|       |    }
  369|       |    static_init_done = 1;
  370|       |
  371|       |#  ifdef GEN_TREES_H
  372|       |    gen_trees_header();
  373|       |#  endif
  374|       |#endif /* defined(GEN_TREES_H) || !defined(STDC) */
  375|  4.22k|}
trees.c:init_block:
  441|  19.6k|local void init_block(deflate_state *s) {
  442|  19.6k|    int n; /* iterates over tree elements */
  443|       |
  444|       |    /* Initialize the trees. */
  445|  5.64M|    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   40|  5.64M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   37|  5.64M|#define LITERALS  256
  |  |  ------------------
  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   34|  5.64M|#define LENGTH_CODES 29
  |  |  ------------------
  ------------------
                  for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   83|  5.62M|#define Freq fc.freq
  ------------------
  |  Branch (445:17): [True: 5.62M, False: 19.6k]
  ------------------
  446|   609k|    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   43|   609k|#define D_CODES   30
  ------------------
                  for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   83|   590k|#define Freq fc.freq
  ------------------
  |  Branch (446:17): [True: 590k, False: 19.6k]
  ------------------
  447|   393k|    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   46|   393k|#define BL_CODES  19
  ------------------
                  for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   83|   373k|#define Freq fc.freq
  ------------------
  |  Branch (447:17): [True: 373k, False: 19.6k]
  ------------------
  448|       |
  449|  19.6k|    s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   50|  19.6k|#define END_BLOCK 256
  ------------------
                  s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   83|  19.6k|#define Freq fc.freq
  ------------------
  450|  19.6k|    s->opt_len = s->static_len = 0L;
  451|  19.6k|    s->sym_next = s->matches = 0;
  452|  19.6k|}
trees.c:bi_windup:
  181|  8.19k|local void bi_windup(deflate_state *s) {
  182|  8.19k|    if (s->bi_valid > 8) {
  ------------------
  |  Branch (182:9): [True: 2.06k, False: 6.13k]
  ------------------
  183|  2.06k|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|  2.06k|#define put_short(s, w) { \
  |  |  145|  2.06k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  2.06k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  2.06k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  2.06k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  2.06k|}
  ------------------
  184|  6.13k|    } else if (s->bi_valid > 0) {
  ------------------
  |  Branch (184:16): [True: 5.52k, False: 609]
  ------------------
  185|  5.52k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  293|  5.52k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  186|  5.52k|    }
  187|  8.19k|    s->bi_used = ((s->bi_valid - 1) & 7) + 1;
  188|  8.19k|    s->bi_buf = 0;
  189|  8.19k|    s->bi_valid = 0;
  190|       |#ifdef ZLIB_DEBUG
  191|       |    s->bits_sent = (s->bits_sent + 7) & ~(ulg)7;
  192|       |#endif
  193|  8.19k|}
trees.c:bi_flush:
  166|  43.2k|local void bi_flush(deflate_state *s) {
  167|  43.2k|    if (s->bi_valid == 16) {
  ------------------
  |  Branch (167:9): [True: 564, False: 42.7k]
  ------------------
  168|    564|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|    564|#define put_short(s, w) { \
  |  |  145|    564|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|    564|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|    564|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|    564|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|    564|}
  ------------------
  169|    564|        s->bi_buf = 0;
  170|    564|        s->bi_valid = 0;
  171|  42.7k|    } else if (s->bi_valid >= 8) {
  ------------------
  |  Branch (171:16): [True: 3.75k, False: 38.9k]
  ------------------
  172|  3.75k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  293|  3.75k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  173|  3.75k|        s->bi_buf >>= 8;
  174|  3.75k|        s->bi_valid -= 8;
  175|  3.75k|    }
  176|  43.2k|}
trees.c:detect_data_type:
  967|  4.22k|local int detect_data_type(deflate_state *s) {
  968|       |    /* block_mask is the bit mask of block-listed bytes
  969|       |     * set bits 0..6, 14..25, and 28..31
  970|       |     * 0xf3ffc07f = binary 11110011111111111100000001111111
  971|       |     */
  972|  4.22k|    unsigned long block_mask = 0xf3ffc07fUL;
  973|  4.22k|    int n;
  974|       |
  975|       |    /* Check for non-textual ("block-listed") bytes. */
  976|  23.6k|    for (n = 0; n <= 31; n++, block_mask >>= 1)
  ------------------
  |  Branch (976:17): [True: 23.1k, False: 498]
  ------------------
  977|  23.1k|        if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
  ------------------
  |  |   83|  17.5k|#define Freq fc.freq
  ------------------
  |  Branch (977:13): [True: 17.5k, False: 5.57k]
  |  Branch (977:33): [True: 3.73k, False: 13.8k]
  ------------------
  978|  3.73k|            return Z_BINARY;
  ------------------
  |  |  207|  3.73k|#define Z_BINARY   0
  ------------------
  979|       |
  980|       |    /* Check for textual ("allow-listed") bytes. */
  981|    498|    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    498|#define Freq fc.freq
  ------------------
                  if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    478|#define Freq fc.freq
  ------------------
  |  Branch (981:9): [True: 20, False: 478]
  |  Branch (981:38): [True: 25, False: 453]
  ------------------
  982|    453|            || s->dyn_ltree[13].Freq != 0)
  ------------------
  |  |   83|    453|#define Freq fc.freq
  ------------------
  |  Branch (982:16): [True: 21, False: 432]
  ------------------
  983|     66|        return Z_TEXT;
  ------------------
  |  |  208|     66|#define Z_TEXT     1
  ------------------
  984|  42.0k|    for (n = 32; n < LITERALS; n++)
  ------------------
  |  |   37|  42.0k|#define LITERALS  256
  ------------------
  |  Branch (984:18): [True: 42.0k, False: 10]
  ------------------
  985|  42.0k|        if (s->dyn_ltree[n].Freq != 0)
  ------------------
  |  |   83|  42.0k|#define Freq fc.freq
  ------------------
  |  Branch (985:13): [True: 422, False: 41.6k]
  ------------------
  986|    422|            return Z_TEXT;
  ------------------
  |  |  208|    854|#define Z_TEXT     1
  ------------------
  987|       |
  988|       |    /* There are no "block-listed" or "allow-listed" bytes:
  989|       |     * this stream either is empty or has tolerated ("gray-listed") bytes only.
  990|       |     */
  991|     10|    return Z_BINARY;
  ------------------
  |  |  207|     10|#define Z_BINARY   0
  ------------------
  992|    432|}
trees.c:build_tree:
  628|  46.3k|local void build_tree(deflate_state *s, tree_desc *desc) {
  629|  46.3k|    ct_data *tree         = desc->dyn_tree;
  630|  46.3k|    const ct_data *stree  = desc->stat_desc->static_tree;
  631|  46.3k|    int elems             = desc->stat_desc->elems;
  632|  46.3k|    int n, m;          /* iterate over heap elements */
  633|  46.3k|    int max_code = -1; /* largest code with non zero frequency */
  634|  46.3k|    int node;          /* new node being created */
  635|       |
  636|       |    /* Construct the initial heap, with least frequent element in
  637|       |     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n + 1].
  638|       |     * heap[0] is not used.
  639|       |     */
  640|  46.3k|    s->heap_len = 0, s->heap_max = HEAP_SIZE;
  ------------------
  |  |   49|  46.3k|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  46.3k|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  46.3k|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  46.3k|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  641|       |
  642|  5.21M|    for (n = 0; n < elems; n++) {
  ------------------
  |  Branch (642:17): [True: 5.17M, False: 46.3k]
  ------------------
  643|  5.17M|        if (tree[n].Freq != 0) {
  ------------------
  |  |   83|  5.17M|#define Freq fc.freq
  ------------------
  |  Branch (643:13): [True: 2.99M, False: 2.17M]
  ------------------
  644|  2.99M|            s->heap[++(s->heap_len)] = max_code = n;
  645|  2.99M|            s->depth[n] = 0;
  646|  2.99M|        } else {
  647|  2.17M|            tree[n].Len = 0;
  ------------------
  |  |   86|  2.17M|#define Len  dl.len
  ------------------
  648|  2.17M|        }
  649|  5.17M|    }
  650|       |
  651|       |    /* The pkzip format requires that at least one distance code exists,
  652|       |     * and that at least one bit should be sent even if there is only one
  653|       |     * possible code. So to avoid special checks later on we force at least
  654|       |     * two codes of non zero frequency.
  655|       |     */
  656|  66.9k|    while (s->heap_len < 2) {
  ------------------
  |  Branch (656:12): [True: 20.6k, False: 46.3k]
  ------------------
  657|  20.6k|        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
  ------------------
  |  Branch (657:44): [True: 20.1k, False: 487]
  ------------------
  658|  20.6k|        tree[node].Freq = 1;
  ------------------
  |  |   83|  20.6k|#define Freq fc.freq
  ------------------
  659|  20.6k|        s->depth[node] = 0;
  660|  20.6k|        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
  ------------------
  |  |   86|  20.6k|#define Len  dl.len
  ------------------
  |  Branch (660:27): [True: 20.6k, False: 0]
  ------------------
  661|       |        /* node is 0 or 1 so it does not have extra bits */
  662|  20.6k|    }
  663|  46.3k|    desc->max_code = max_code;
  664|       |
  665|       |    /* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree,
  666|       |     * establish sub-heaps of increasing lengths:
  667|       |     */
  668|  1.54M|    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
  ------------------
  |  Branch (668:29): [True: 1.49M, False: 46.3k]
  ------------------
  669|       |
  670|       |    /* Construct the Huffman tree by repeatedly combining the least two
  671|       |     * frequent nodes.
  672|       |     */
  673|  46.3k|    node = elems;              /* next internal node of the tree */
  674|  2.97M|    do {
  675|  2.97M|        pqremove(s, tree, n);  /* n = node of least frequency */
  ------------------
  |  |  489|  2.97M|#define pqremove(s, tree, top) \
  |  |  490|  2.97M|{\
  |  |  491|  2.97M|    top = s->heap[SMALLEST]; \
  |  |  ------------------
  |  |  |  |  481|  2.97M|#define SMALLEST 1
  |  |  ------------------
  |  |  492|  2.97M|    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
  |  |  ------------------
  |  |  |  |  481|  2.97M|#define SMALLEST 1
  |  |  ------------------
  |  |  493|  2.97M|    pqdownheap(s, tree, SMALLEST); \
  |  |  ------------------
  |  |  |  |  481|  2.97M|#define SMALLEST 1
  |  |  ------------------
  |  |  494|  2.97M|}
  ------------------
  676|  2.97M|        m = s->heap[SMALLEST]; /* m = node of next least frequency */
  ------------------
  |  |  481|  2.97M|#define SMALLEST 1
  ------------------
  677|       |
  678|  2.97M|        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
  679|  2.97M|        s->heap[--(s->heap_max)] = m;
  680|       |
  681|       |        /* Create a new node father of n and m */
  682|  2.97M|        tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  2.97M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  2.97M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  2.97M|#define Freq fc.freq
  ------------------
  683|  2.97M|        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
  ------------------
  |  Branch (683:33): [True: 2.64M, False: 330k]
  ------------------
  684|  2.64M|                                s->depth[n] : s->depth[m]) + 1);
  685|  2.97M|        tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  2.97M|#define Dad  dl.dad
  ------------------
                      tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  2.97M|#define Dad  dl.dad
  ------------------
  686|       |#ifdef DUMP_BL_TREE
  687|       |        if (tree == s->bl_tree) {
  688|       |            fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
  689|       |                    node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
  690|       |        }
  691|       |#endif
  692|       |        /* and insert the new node in the heap */
  693|  2.97M|        s->heap[SMALLEST] = node++;
  ------------------
  |  |  481|  2.97M|#define SMALLEST 1
  ------------------
  694|  2.97M|        pqdownheap(s, tree, SMALLEST);
  ------------------
  |  |  481|  2.97M|#define SMALLEST 1
  ------------------
  695|       |
  696|  2.97M|    } while (s->heap_len >= 2);
  ------------------
  |  Branch (696:14): [True: 2.92M, False: 46.3k]
  ------------------
  697|       |
  698|  46.3k|    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
  ------------------
  |  |  481|  46.3k|#define SMALLEST 1
  ------------------
  699|       |
  700|       |    /* At this point, the fields freq and dad are set. We can now
  701|       |     * generate the bit lengths.
  702|       |     */
  703|  46.3k|    gen_bitlen(s, (tree_desc *)desc);
  704|       |
  705|       |    /* The field len is now set, we can generate the bit codes */
  706|  46.3k|    gen_codes ((ct_data *)tree, max_code, s->bl_count);
  707|  46.3k|}
trees.c:pqdownheap:
  510|  7.44M|local void pqdownheap(deflate_state *s, ct_data *tree, int k) {
  511|  7.44M|    int v = s->heap[k];
  512|  7.44M|    int j = k << 1;  /* left son of k */
  513|  39.4M|    while (j <= s->heap_len) {
  ------------------
  |  Branch (513:12): [True: 33.5M, False: 5.88M]
  ------------------
  514|       |        /* Set j to the smallest of the two sons: */
  515|  33.5M|        if (j < s->heap_len &&
  ------------------
  |  Branch (515:13): [True: 33.1M, False: 383k]
  ------------------
  516|  33.1M|            smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
  ------------------
  |  |  501|  33.1M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  33.1M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  66.3M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 10.0M, False: 23.1M]
  |  |  ------------------
  |  |  502|  33.1M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  23.1M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  46.2M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (502:5): [True: 6.55M, False: 16.5M]
  |  |  |  Branch (502:37): [True: 5.77M, False: 786k]
  |  |  ------------------
  ------------------
  517|  15.8M|            j++;
  518|  15.8M|        }
  519|       |        /* Exit if v is smaller than both sons */
  520|  33.5M|        if (smaller(tree, v, s->heap[j], s->depth)) break;
  ------------------
  |  |  501|  33.5M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  33.5M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  67.1M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 1.24M, False: 32.3M]
  |  |  ------------------
  |  |  502|  33.5M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  32.3M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  64.6M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (502:5): [True: 483k, False: 31.8M]
  |  |  |  Branch (502:37): [True: 314k, False: 168k]
  |  |  ------------------
  ------------------
  521|       |
  522|       |        /* Exchange v with the smallest son */
  523|  32.0M|        s->heap[k] = s->heap[j];  k = j;
  524|       |
  525|       |        /* And continue down the tree, setting j to the left son of k */
  526|  32.0M|        j <<= 1;
  527|  32.0M|    }
  528|  7.44M|    s->heap[k] = v;
  529|  7.44M|}
trees.c:gen_bitlen:
  541|  46.3k|local void gen_bitlen(deflate_state *s, tree_desc *desc) {
  542|  46.3k|    ct_data *tree        = desc->dyn_tree;
  543|  46.3k|    int max_code         = desc->max_code;
  544|  46.3k|    const ct_data *stree = desc->stat_desc->static_tree;
  545|  46.3k|    const intf *extra    = desc->stat_desc->extra_bits;
  546|  46.3k|    int base             = desc->stat_desc->extra_base;
  547|  46.3k|    int max_length       = desc->stat_desc->max_length;
  548|  46.3k|    int h;              /* heap index */
  549|  46.3k|    int n, m;           /* iterate over the tree elements */
  550|  46.3k|    int bits;           /* bit length */
  551|  46.3k|    int xbits;          /* extra bits */
  552|  46.3k|    ush f;              /* frequency */
  553|  46.3k|    int overflow = 0;   /* number of elements with bit length too large */
  554|       |
  555|   787k|    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
  ------------------
  |  |   52|   787k|#define MAX_BITS 15
  ------------------
  |  Branch (555:20): [True: 741k, False: 46.3k]
  ------------------
  556|       |
  557|       |    /* In a first pass, compute the optimal bit lengths (which may
  558|       |     * overflow in the case of the bit length tree).
  559|       |     */
  560|  46.3k|    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
  ------------------
  |  |   86|  46.3k|#define Len  dl.len
  ------------------
  561|       |
  562|  5.99M|    for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
  ------------------
  |  |   49|  5.99M|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  5.99M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  5.99M|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  5.99M|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (562:31): [True: 5.94M, False: 46.3k]
  ------------------
  563|  5.94M|        n = s->heap[h];
  564|  5.94M|        bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   85|  5.94M|#define Dad  dl.dad
  ------------------
                      bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   86|  5.94M|#define Len  dl.len
  ------------------
  565|  5.94M|        if (bits > max_length) bits = max_length, overflow++;
  ------------------
  |  Branch (565:13): [True: 14.8k, False: 5.92M]
  ------------------
  566|  5.94M|        tree[n].Len = (ush)bits;
  ------------------
  |  |   86|  5.94M|#define Len  dl.len
  ------------------
  567|       |        /* We overwrite tree[n].Dad which is no longer needed */
  568|       |
  569|  5.94M|        if (n > max_code) continue; /* not a leaf node */
  ------------------
  |  Branch (569:13): [True: 2.92M, False: 3.01M]
  ------------------
  570|       |
  571|  3.01M|        s->bl_count[bits]++;
  572|  3.01M|        xbits = 0;
  573|  3.01M|        if (n >= base) xbits = extra[n - base];
  ------------------
  |  Branch (573:13): [True: 270k, False: 2.74M]
  ------------------
  574|  3.01M|        f = tree[n].Freq;
  ------------------
  |  |   83|  3.01M|#define Freq fc.freq
  ------------------
  575|  3.01M|        s->opt_len += (ulg)f * (unsigned)(bits + xbits);
  576|  3.01M|        if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
  ------------------
  |  |   86|  2.88M|#define Len  dl.len
  ------------------
  |  Branch (576:13): [True: 2.88M, False: 133k]
  ------------------
  577|  3.01M|    }
  578|  46.3k|    if (overflow == 0) return;
  ------------------
  |  Branch (578:9): [True: 44.9k, False: 1.41k]
  ------------------
  579|       |
  580|  1.41k|    Tracev((stderr,"\nbit length overflow\n"));
  581|       |    /* This happens for example on obj2 and pic of the Calgary corpus */
  582|       |
  583|       |    /* Find the first bit length which could increase: */
  584|  7.44k|    do {
  585|  7.44k|        bits = max_length - 1;
  586|  10.7k|        while (s->bl_count[bits] == 0) bits--;
  ------------------
  |  Branch (586:16): [True: 3.26k, False: 7.44k]
  ------------------
  587|  7.44k|        s->bl_count[bits]--;        /* move one leaf down the tree */
  588|  7.44k|        s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
  589|  7.44k|        s->bl_count[max_length]--;
  590|       |        /* The brother of the overflow item also moves one step up,
  591|       |         * but this does not affect bl_count[max_length]
  592|       |         */
  593|  7.44k|        overflow -= 2;
  594|  7.44k|    } while (overflow > 0);
  ------------------
  |  Branch (594:14): [True: 6.03k, False: 1.41k]
  ------------------
  595|       |
  596|       |    /* Now recompute all bit lengths, scanning in increasing frequency.
  597|       |     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
  598|       |     * lengths instead of fixing only the wrong ones. This idea is taken
  599|       |     * from 'ar' written by Haruhiko Okumura.)
  600|       |     */
  601|  13.4k|    for (bits = max_length; bits != 0; bits--) {
  ------------------
  |  Branch (601:29): [True: 12.0k, False: 1.41k]
  ------------------
  602|  12.0k|        n = s->bl_count[bits];
  603|  91.3k|        while (n != 0) {
  ------------------
  |  Branch (603:16): [True: 79.3k, False: 12.0k]
  ------------------
  604|  79.3k|            m = s->heap[--h];
  605|  79.3k|            if (m > max_code) continue;
  ------------------
  |  Branch (605:17): [True: 36.3k, False: 43.0k]
  ------------------
  606|  43.0k|            if ((unsigned) tree[m].Len != (unsigned) bits) {
  ------------------
  |  |   86|  43.0k|#define Len  dl.len
  ------------------
  |  Branch (606:17): [True: 3.91k, False: 39.0k]
  ------------------
  607|  3.91k|                Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
  608|  3.91k|                s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   86|  3.91k|#define Len  dl.len
  ------------------
                              s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   83|  3.91k|#define Freq fc.freq
  ------------------
  609|  3.91k|                tree[m].Len = (ush)bits;
  ------------------
  |  |   86|  3.91k|#define Len  dl.len
  ------------------
  610|  3.91k|            }
  611|  43.0k|            n--;
  612|  43.0k|        }
  613|  12.0k|    }
  614|  1.41k|}
trees.c:gen_codes:
  203|  46.3k|local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) {
  204|  46.3k|    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
  205|  46.3k|    unsigned code = 0;         /* running code value */
  206|  46.3k|    int bits;                  /* bit index */
  207|  46.3k|    int n;                     /* code index */
  208|       |
  209|       |    /* The distribution counts are first used to generate the code values
  210|       |     * without bit reversal.
  211|       |     */
  212|   741k|    for (bits = 1; bits <= MAX_BITS; bits++) {
  ------------------
  |  |   52|   741k|#define MAX_BITS 15
  ------------------
  |  Branch (212:20): [True: 694k, False: 46.3k]
  ------------------
  213|   694k|        code = (code + bl_count[bits - 1]) << 1;
  214|   694k|        next_code[bits] = (ush)code;
  215|   694k|    }
  216|       |    /* Check that the bit counts in bl_count are consistent. The last code
  217|       |     * must be all ones.
  218|       |     */
  219|  46.3k|    Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
  220|  46.3k|            "inconsistent bit counts");
  221|  46.3k|    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
  222|       |
  223|  4.52M|    for (n = 0;  n <= max_code; n++) {
  ------------------
  |  Branch (223:18): [True: 4.47M, False: 46.3k]
  ------------------
  224|  4.47M|        int len = tree[n].Len;
  ------------------
  |  |   86|  4.47M|#define Len  dl.len
  ------------------
  225|  4.47M|        if (len == 0) continue;
  ------------------
  |  Branch (225:13): [True: 1.45M, False: 3.01M]
  ------------------
  226|       |        /* Now reverse the bits */
  227|  3.01M|        tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
  ------------------
  |  |   84|  3.01M|#define Code fc.code
  ------------------
  228|       |
  229|  3.01M|        Tracecv(tree != static_ltree,(stderr, "\nn %3d %c l %2d c %4x (%x) ",
  230|  3.01M|            n, (isgraph(n & 0xff) ? n : ' '), len, tree[n].Code,
  231|  3.01M|            next_code[len] - 1));
  232|  3.01M|    }
  233|  46.3k|}
trees.c:bi_reverse:
  154|  3.01M|local unsigned bi_reverse(unsigned code, int len) {
  155|  3.01M|    unsigned res = 0;
  156|  24.5M|    do {
  157|  24.5M|        res |= code & 1;
  158|  24.5M|        code >>= 1, res <<= 1;
  159|  24.5M|    } while (--len > 0);
  ------------------
  |  Branch (159:14): [True: 21.5M, False: 3.01M]
  ------------------
  160|  3.01M|    return res >> 1;
  161|  3.01M|}
trees.c:build_bl_tree:
  801|  15.4k|local int build_bl_tree(deflate_state *s) {
  802|  15.4k|    int max_blindex;  /* index of last bit length code of non zero freq */
  803|       |
  804|       |    /* Determine the bit length frequencies for literal and distance trees */
  805|  15.4k|    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
  806|  15.4k|    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
  807|       |
  808|       |    /* Build the bit length tree: */
  809|  15.4k|    build_tree(s, (tree_desc *)(&(s->bl_desc)));
  810|       |    /* opt_len now includes the length of the tree representations, except the
  811|       |     * lengths of the bit lengths codes and the 5 + 5 + 4 bits for the counts.
  812|       |     */
  813|       |
  814|       |    /* Determine the number of bit length codes to send. The pkzip format
  815|       |     * requires that at least 4 bit length codes be sent. (appnote.txt says
  816|       |     * 3 but the actual value used is 4.)
  817|       |     */
  818|  35.7k|    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
  ------------------
  |  |   46|  15.4k|#define BL_CODES  19
  ------------------
  |  Branch (818:36): [True: 35.7k, False: 0]
  ------------------
  819|  35.7k|        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
  ------------------
  |  |   86|  35.7k|#define Len  dl.len
  ------------------
  |  Branch (819:13): [True: 15.4k, False: 20.3k]
  ------------------
  820|  35.7k|    }
  821|       |    /* Update opt_len to include the bit length tree and counts */
  822|  15.4k|    s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
  823|  15.4k|    Tracev((stderr, "\ndyn trees: dyn %lu, stat %lu",
  824|  15.4k|            s->opt_len, s->static_len));
  825|       |
  826|  15.4k|    return max_blindex;
  827|  15.4k|}
trees.c:scan_tree:
  713|  30.8k|local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
  714|  30.8k|    int n;                     /* iterates over all tree elements */
  715|  30.8k|    int prevlen = -1;          /* last emitted length */
  716|  30.8k|    int curlen;                /* length of current code */
  717|  30.8k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  30.8k|#define Len  dl.len
  ------------------
  718|  30.8k|    int count = 0;             /* repeat count of the current code */
  719|  30.8k|    int max_count = 7;         /* max repeat count */
  720|  30.8k|    int min_count = 4;         /* min repeat count */
  721|       |
  722|  30.8k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (722:9): [True: 3.39k, False: 27.4k]
  ------------------
  723|  30.8k|    tree[max_code + 1].Len = (ush)0xffff; /* guard */
  ------------------
  |  |   86|  30.8k|#define Len  dl.len
  ------------------
  724|       |
  725|  4.22M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (725:17): [True: 4.19M, False: 30.8k]
  ------------------
  726|  4.19M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  4.19M|#define Len  dl.len
  ------------------
  727|  4.19M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (727:13): [True: 3.96M, False: 235k]
  |  Branch (727:36): [True: 2.96M, False: 994k]
  ------------------
  728|  2.96M|            continue;
  729|  2.96M|        } else if (count < min_count) {
  ------------------
  |  Branch (729:20): [True: 842k, False: 387k]
  ------------------
  730|   842k|            s->bl_tree[curlen].Freq += (ush)count;
  ------------------
  |  |   83|   842k|#define Freq fc.freq
  ------------------
  731|   842k|        } else if (curlen != 0) {
  ------------------
  |  Branch (731:20): [True: 323k, False: 64.4k]
  ------------------
  732|   323k|            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
  ------------------
  |  |   83|   135k|#define Freq fc.freq
  ------------------
  |  Branch (732:17): [True: 135k, False: 187k]
  ------------------
  733|   323k|            s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   53|   323k|#define REP_3_6      16
  ------------------
                          s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   83|   323k|#define Freq fc.freq
  ------------------
  734|   323k|        } else if (count <= 10) {
  ------------------
  |  Branch (734:20): [True: 41.2k, False: 23.2k]
  ------------------
  735|  41.2k|            s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   56|  41.2k|#define REPZ_3_10    17
  ------------------
                          s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   83|  41.2k|#define Freq fc.freq
  ------------------
  736|  41.2k|        } else {
  737|  23.2k|            s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   59|  23.2k|#define REPZ_11_138  18
  ------------------
                          s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   83|  23.2k|#define Freq fc.freq
  ------------------
  738|  23.2k|        }
  739|  1.23M|        count = 0; prevlen = curlen;
  740|  1.23M|        if (nextlen == 0) {
  ------------------
  |  Branch (740:13): [True: 133k, False: 1.09M]
  ------------------
  741|   133k|            max_count = 138, min_count = 3;
  742|  1.09M|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (742:20): [True: 213k, False: 883k]
  ------------------
  743|   213k|            max_count = 6, min_count = 3;
  744|   883k|        } else {
  745|   883k|            max_count = 7, min_count = 4;
  746|   883k|        }
  747|  1.23M|    }
  748|  30.8k|}
trees.c:compress_block:
  902|  11.4k|                          const ct_data *dtree) {
  903|  11.4k|    unsigned dist;      /* distance of matched string */
  904|  11.4k|    int lc;             /* match length or unmatched char (if dist == 0) */
  905|  11.4k|    unsigned sx = 0;    /* running index in symbol buffers */
  906|  11.4k|    unsigned code;      /* the code to send */
  907|  11.4k|    int extra;          /* number of extra bits to send */
  908|       |
  909|   139M|    if (s->sym_next != 0) do {
  ------------------
  |  Branch (909:9): [True: 11.3k, False: 172]
  ------------------
  910|       |#ifdef LIT_MEM
  911|       |        dist = s->d_buf[sx];
  912|       |        lc = s->l_buf[sx++];
  913|       |#else
  914|   139M|        dist = s->sym_buf[sx++] & 0xff;
  915|   139M|        dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
  916|   139M|        lc = s->sym_buf[sx++];
  917|   139M|#endif
  918|   139M|        if (dist == 0) {
  ------------------
  |  Branch (918:13): [True: 134M, False: 5.24M]
  ------------------
  919|   134M|            send_code(s, lc, ltree); /* send a literal byte */
  ------------------
  |  |  240|   134M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  275|   134M|#define send_bits(s, value, length) \
  |  |  |  |  276|   134M|{ int len = length;\
  |  |  |  |  277|   134M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   134M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:7): [True: 48.0M, False: 86.6M]
  |  |  |  |  ------------------
  |  |  |  |  278|  48.0M|    int val = (int)value;\
  |  |  |  |  279|  48.0M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  280|  48.0M|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  48.0M|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  48.0M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  48.0M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  48.0M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  48.0M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  48.0M|}
  |  |  |  |  ------------------
  |  |  |  |  281|  48.0M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  48.0M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  48.0M|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  48.0M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  283|  86.6M|  } else {\
  |  |  |  |  284|  86.6M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  285|  86.6M|    s->bi_valid += len;\
  |  |  |  |  286|  86.6M|  }\
  |  |  |  |  287|   134M|}
  |  |  ------------------
  ------------------
  920|   134M|            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
  921|   134M|        } else {
  922|       |            /* Here, lc is the match length - MIN_MATCH */
  923|  5.24M|            code = _length_code[lc];
  924|  5.24M|            send_code(s, code + LITERALS + 1, ltree);   /* send length code */
  ------------------
  |  |  240|  5.24M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  275|  5.24M|#define send_bits(s, value, length) \
  |  |  |  |  276|  5.24M|{ int len = length;\
  |  |  |  |  277|  5.24M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.24M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:7): [True: 1.26M, False: 3.97M]
  |  |  |  |  ------------------
  |  |  |  |  278|  1.26M|    int val = (int)value;\
  |  |  |  |  279|  1.26M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  280|  1.26M|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  1.26M|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  1.26M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  1.26M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.26M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  1.26M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.26M|}
  |  |  |  |  ------------------
  |  |  |  |  281|  1.26M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.26M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  1.26M|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.26M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  283|  3.97M|  } else {\
  |  |  |  |  284|  3.97M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  285|  3.97M|    s->bi_valid += len;\
  |  |  |  |  286|  3.97M|  }\
  |  |  |  |  287|  5.24M|}
  |  |  ------------------
  ------------------
  925|  5.24M|            extra = extra_lbits[code];
  926|  5.24M|            if (extra != 0) {
  ------------------
  |  Branch (926:17): [True: 474k, False: 4.77M]
  ------------------
  927|   474k|                lc -= base_length[code];
  928|   474k|                send_bits(s, lc, extra);       /* send the extra length bits */
  ------------------
  |  |  275|   474k|#define send_bits(s, value, length) \
  |  |  276|   474k|{ int len = length;\
  |  |  277|   474k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   474k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 60.2k, False: 414k]
  |  |  ------------------
  |  |  278|  60.2k|    int val = (int)value;\
  |  |  279|  60.2k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|  60.2k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  60.2k|#define put_short(s, w) { \
  |  |  |  |  145|  60.2k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  60.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  60.2k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  60.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  60.2k|}
  |  |  ------------------
  |  |  281|  60.2k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  60.2k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  60.2k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  60.2k|#define Buf_size 16
  |  |  ------------------
  |  |  283|   414k|  } else {\
  |  |  284|   414k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|   414k|    s->bi_valid += len;\
  |  |  286|   414k|  }\
  |  |  287|   474k|}
  ------------------
  929|   474k|            }
  930|  5.24M|            dist--; /* dist is now the match distance - 1 */
  931|  5.24M|            code = d_code(dist);
  ------------------
  |  |  321|  5.24M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  ------------------
  |  |  |  Branch (321:5): [True: 1.71M, False: 3.52M]
  |  |  ------------------
  ------------------
  932|  5.24M|            Assert (code < D_CODES, "bad d_code");
  933|       |
  934|  5.24M|            send_code(s, code, dtree);       /* send the distance code */
  ------------------
  |  |  240|  5.24M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  275|  5.24M|#define send_bits(s, value, length) \
  |  |  |  |  276|  5.24M|{ int len = length;\
  |  |  |  |  277|  5.24M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.24M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:7): [True: 1.19M, False: 4.05M]
  |  |  |  |  ------------------
  |  |  |  |  278|  1.19M|    int val = (int)value;\
  |  |  |  |  279|  1.19M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  280|  1.19M|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  1.19M|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  1.19M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  1.19M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.19M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  1.19M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.19M|}
  |  |  |  |  ------------------
  |  |  |  |  281|  1.19M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.19M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  1.19M|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.19M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  283|  4.05M|  } else {\
  |  |  |  |  284|  4.05M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  285|  4.05M|    s->bi_valid += len;\
  |  |  |  |  286|  4.05M|  }\
  |  |  |  |  287|  5.24M|}
  |  |  ------------------
  ------------------
  935|  5.24M|            extra = extra_dbits[code];
  936|  5.24M|            if (extra != 0) {
  ------------------
  |  Branch (936:17): [True: 4.36M, False: 879k]
  ------------------
  937|  4.36M|                dist -= (unsigned)base_dist[code];
  938|  4.36M|                send_bits(s, (int)dist, extra); /* send the extra bits */
  ------------------
  |  |  275|  4.36M|#define send_bits(s, value, length) \
  |  |  276|  4.36M|{ int len = length;\
  |  |  277|  4.36M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.36M|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 2.57M, False: 1.79M]
  |  |  ------------------
  |  |  278|  2.57M|    int val = (int)value;\
  |  |  279|  2.57M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|  2.57M|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.57M|#define put_short(s, w) { \
  |  |  |  |  145|  2.57M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.57M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.57M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.57M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.57M|}
  |  |  ------------------
  |  |  281|  2.57M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.57M|#define Buf_size 16
  |  |  ------------------
  |  |  282|  2.57M|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.57M|#define Buf_size 16
  |  |  ------------------
  |  |  283|  2.57M|  } else {\
  |  |  284|  1.79M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|  1.79M|    s->bi_valid += len;\
  |  |  286|  1.79M|  }\
  |  |  287|  4.36M|}
  ------------------
  939|  4.36M|            }
  940|  5.24M|        } /* literal or match pair ? */
  941|       |
  942|       |        /* Check for no overlay of pending_buf on needed symbols */
  943|       |#ifdef LIT_MEM
  944|       |        Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow");
  945|       |#else
  946|   139M|        Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
  947|   139M|#endif
  948|       |
  949|   139M|    } while (sx < s->sym_next);
  ------------------
  |  Branch (949:14): [True: 139M, False: 11.3k]
  ------------------
  950|       |
  951|  11.4k|    send_code(s, END_BLOCK, ltree);
  ------------------
  |  |  240|  11.4k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  275|  11.4k|#define send_bits(s, value, length) \
  |  |  |  |  276|  11.4k|{ int len = length;\
  |  |  |  |  277|  11.4k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  11.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:7): [True: 7.11k, False: 4.35k]
  |  |  |  |  ------------------
  |  |  |  |  278|  7.11k|    int val = (int)value;\
  |  |  |  |  279|  7.11k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  280|  7.11k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  7.11k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  7.11k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  7.11k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  7.11k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  7.11k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  7.11k|}
  |  |  |  |  ------------------
  |  |  |  |  281|  7.11k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  7.11k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  7.11k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  7.11k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  283|  7.11k|  } else {\
  |  |  |  |  284|  4.35k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  285|  4.35k|    s->bi_valid += len;\
  |  |  |  |  286|  4.35k|  }\
  |  |  |  |  287|  11.4k|}
  |  |  ------------------
  ------------------
  952|  11.4k|}
trees.c:send_all_trees:
  835|  9.90k|                          int blcodes) {
  836|  9.90k|    int rank;                    /* index in bl_order */
  837|       |
  838|  9.90k|    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  839|  9.90k|    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  840|  9.90k|            "too many codes");
  841|  9.90k|    Tracev((stderr, "\nbl counts: "));
  842|  9.90k|    send_bits(s, lcodes - 257, 5);  /* not +255 as stated in appnote.txt */
  ------------------
  |  |  275|  9.90k|#define send_bits(s, value, length) \
  |  |  276|  9.90k|{ int len = length;\
  |  |  277|  9.90k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  9.90k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 0, False: 9.90k]
  |  |  ------------------
  |  |  278|      0|    int val = (int)value;\
  |  |  279|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|      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|}
  |  |  ------------------
  |  |  281|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  283|  9.90k|  } else {\
  |  |  284|  9.90k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|  9.90k|    s->bi_valid += len;\
  |  |  286|  9.90k|  }\
  |  |  287|  9.90k|}
  ------------------
  843|  9.90k|    send_bits(s, dcodes - 1,   5);
  ------------------
  |  |  275|  9.90k|#define send_bits(s, value, length) \
  |  |  276|  9.90k|{ int len = length;\
  |  |  277|  9.90k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  9.90k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 3.28k, False: 6.62k]
  |  |  ------------------
  |  |  278|  3.28k|    int val = (int)value;\
  |  |  279|  3.28k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|  3.28k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  3.28k|#define put_short(s, w) { \
  |  |  |  |  145|  3.28k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  3.28k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  3.28k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  3.28k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  3.28k|}
  |  |  ------------------
  |  |  281|  3.28k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  3.28k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.28k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  3.28k|#define Buf_size 16
  |  |  ------------------
  |  |  283|  6.62k|  } else {\
  |  |  284|  6.62k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|  6.62k|    s->bi_valid += len;\
  |  |  286|  6.62k|  }\
  |  |  287|  9.90k|}
  ------------------
  844|  9.90k|    send_bits(s, blcodes - 4,  4);  /* not -3 as stated in appnote.txt */
  ------------------
  |  |  275|  9.90k|#define send_bits(s, value, length) \
  |  |  276|  9.90k|{ int len = length;\
  |  |  277|  9.90k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  9.90k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 6.62k, False: 3.28k]
  |  |  ------------------
  |  |  278|  6.62k|    int val = (int)value;\
  |  |  279|  6.62k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|  6.62k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  6.62k|#define put_short(s, w) { \
  |  |  |  |  145|  6.62k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  6.62k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  6.62k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  6.62k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  6.62k|}
  |  |  ------------------
  |  |  281|  6.62k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  6.62k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  6.62k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  6.62k|#define Buf_size 16
  |  |  ------------------
  |  |  283|  6.62k|  } else {\
  |  |  284|  3.28k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|  3.28k|    s->bi_valid += len;\
  |  |  286|  3.28k|  }\
  |  |  287|  9.90k|}
  ------------------
  845|   184k|    for (rank = 0; rank < blcodes; rank++) {
  ------------------
  |  Branch (845:20): [True: 174k, False: 9.90k]
  ------------------
  846|   174k|        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
  847|   174k|        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
  ------------------
  |  |  275|   174k|#define send_bits(s, value, length) \
  |  |  276|   174k|{ int len = length;\
  |  |  277|   174k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   174k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 29.2k, False: 144k]
  |  |  ------------------
  |  |  278|  29.2k|    int val = (int)value;\
  |  |  279|  29.2k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|  29.2k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  29.2k|#define put_short(s, w) { \
  |  |  |  |  145|  29.2k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  29.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  29.2k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  29.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  29.2k|}
  |  |  ------------------
  |  |  281|  29.2k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  29.2k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  29.2k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  29.2k|#define Buf_size 16
  |  |  ------------------
  |  |  283|   144k|  } else {\
  |  |  284|   144k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|   144k|    s->bi_valid += len;\
  |  |  286|   144k|  }\
  |  |  287|   174k|}
  ------------------
  848|   174k|    }
  849|  9.90k|    Tracev((stderr, "\nbl tree: sent %lu", s->bits_sent));
  850|       |
  851|  9.90k|    send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
  852|  9.90k|    Tracev((stderr, "\nlit tree: sent %lu", s->bits_sent));
  853|       |
  854|  9.90k|    send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
  855|  9.90k|    Tracev((stderr, "\ndist tree: sent %lu", s->bits_sent));
  856|  9.90k|}
trees.c:send_tree:
  754|  19.8k|local void send_tree(deflate_state *s, ct_data *tree, int max_code) {
  755|  19.8k|    int n;                     /* iterates over all tree elements */
  756|  19.8k|    int prevlen = -1;          /* last emitted length */
  757|  19.8k|    int curlen;                /* length of current code */
  758|  19.8k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  19.8k|#define Len  dl.len
  ------------------
  759|  19.8k|    int count = 0;             /* repeat count of the current code */
  760|  19.8k|    int max_count = 7;         /* max repeat count */
  761|  19.8k|    int min_count = 4;         /* min repeat count */
  762|       |
  763|       |    /* tree[max_code + 1].Len = -1; */  /* guard already set */
  764|  19.8k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (764:9): [True: 2.07k, False: 17.7k]
  ------------------
  765|       |
  766|  2.75M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (766:17): [True: 2.73M, False: 19.8k]
  ------------------
  767|  2.73M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  2.73M|#define Len  dl.len
  ------------------
  768|  2.73M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (768:13): [True: 2.62M, False: 105k]
  |  Branch (768:36): [True: 1.78M, False: 837k]
  ------------------
  769|  1.78M|            continue;
  770|  1.78M|        } else if (count < min_count) {
  ------------------
  |  Branch (770:20): [True: 716k, False: 226k]
  ------------------
  771|   938k|            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
  ------------------
  |  |  240|   938k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  275|   938k|#define send_bits(s, value, length) \
  |  |  |  |  276|   938k|{ int len = length;\
  |  |  |  |  277|   938k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   938k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:7): [True: 156k, False: 782k]
  |  |  |  |  ------------------
  |  |  |  |  278|   156k|    int val = (int)value;\
  |  |  |  |  279|   156k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  280|   156k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   156k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   156k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   156k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   156k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   156k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   156k|}
  |  |  |  |  ------------------
  |  |  |  |  281|   156k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   156k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|   156k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   156k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  283|   782k|  } else {\
  |  |  |  |  284|   782k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  285|   782k|    s->bi_valid += len;\
  |  |  |  |  286|   782k|  }\
  |  |  |  |  287|   938k|}
  |  |  ------------------
  ------------------
  |  Branch (771:61): [True: 221k, False: 716k]
  ------------------
  772|       |
  773|   716k|        } else if (curlen != 0) {
  ------------------
  |  Branch (773:20): [True: 176k, False: 49.9k]
  ------------------
  774|   176k|            if (curlen != prevlen) {
  ------------------
  |  Branch (774:17): [True: 104k, False: 71.5k]
  ------------------
  775|   104k|                send_code(s, curlen, s->bl_tree); count--;
  ------------------
  |  |  240|   104k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  275|   104k|#define send_bits(s, value, length) \
  |  |  |  |  276|   104k|{ int len = length;\
  |  |  |  |  277|   104k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   104k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:7): [True: 11.1k, False: 93.7k]
  |  |  |  |  ------------------
  |  |  |  |  278|  11.1k|    int val = (int)value;\
  |  |  |  |  279|  11.1k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  280|  11.1k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  11.1k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  11.1k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  11.1k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  11.1k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  11.1k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  11.1k|}
  |  |  |  |  ------------------
  |  |  |  |  281|  11.1k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  11.1k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  11.1k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  11.1k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  283|  93.7k|  } else {\
  |  |  |  |  284|  93.7k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  285|  93.7k|    s->bi_valid += len;\
  |  |  |  |  286|  93.7k|  }\
  |  |  |  |  287|   104k|}
  |  |  ------------------
  ------------------
  776|   104k|            }
  777|   176k|            Assert(count >= 3 && count <= 6, " 3_6?");
  778|   176k|            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  240|   176k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  275|   176k|#define send_bits(s, value, length) \
  |  |  |  |  276|   176k|{ int len = length;\
  |  |  |  |  277|   176k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   176k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:7): [True: 26.4k, False: 149k]
  |  |  |  |  ------------------
  |  |  |  |  278|  26.4k|    int val = (int)value;\
  |  |  |  |  279|  26.4k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  280|  26.4k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  26.4k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  26.4k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  26.4k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  26.4k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  26.4k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  26.4k|}
  |  |  |  |  ------------------
  |  |  |  |  281|  26.4k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  26.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  26.4k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  26.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  283|   149k|  } else {\
  |  |  |  |  284|   149k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  285|   149k|    s->bi_valid += len;\
  |  |  |  |  286|   149k|  }\
  |  |  |  |  287|   176k|}
  |  |  ------------------
  ------------------
                          send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  275|   176k|#define send_bits(s, value, length) \
  |  |  276|   176k|{ int len = length;\
  |  |  277|   176k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   176k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 21.7k, False: 154k]
  |  |  ------------------
  |  |  278|  21.7k|    int val = (int)value;\
  |  |  279|  21.7k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|  21.7k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  21.7k|#define put_short(s, w) { \
  |  |  |  |  145|  21.7k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  21.7k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  21.7k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  21.7k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  21.7k|}
  |  |  ------------------
  |  |  281|  21.7k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  21.7k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  21.7k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  21.7k|#define Buf_size 16
  |  |  ------------------
  |  |  283|   154k|  } else {\
  |  |  284|   154k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|   154k|    s->bi_valid += len;\
  |  |  286|   154k|  }\
  |  |  287|   176k|}
  ------------------
  779|       |
  780|   176k|        } else if (count <= 10) {
  ------------------
  |  Branch (780:20): [True: 33.6k, False: 16.2k]
  ------------------
  781|  33.6k|            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  240|  33.6k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  275|  33.6k|#define send_bits(s, value, length) \
  |  |  |  |  276|  33.6k|{ int len = length;\
  |  |  |  |  277|  33.6k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  33.6k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:7): [True: 7.59k, False: 26.0k]
  |  |  |  |  ------------------
  |  |  |  |  278|  7.59k|    int val = (int)value;\
  |  |  |  |  279|  7.59k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  280|  7.59k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  7.59k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  7.59k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  7.59k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  7.59k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  7.59k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  7.59k|}
  |  |  |  |  ------------------
  |  |  |  |  281|  7.59k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  7.59k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  7.59k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  7.59k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  283|  26.0k|  } else {\
  |  |  |  |  284|  26.0k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  285|  26.0k|    s->bi_valid += len;\
  |  |  |  |  286|  26.0k|  }\
  |  |  |  |  287|  33.6k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  275|  33.6k|#define send_bits(s, value, length) \
  |  |  276|  33.6k|{ int len = length;\
  |  |  277|  33.6k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  33.6k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 6.48k, False: 27.2k]
  |  |  ------------------
  |  |  278|  6.48k|    int val = (int)value;\
  |  |  279|  6.48k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|  6.48k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  6.48k|#define put_short(s, w) { \
  |  |  |  |  145|  6.48k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  6.48k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  6.48k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  6.48k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  6.48k|}
  |  |  ------------------
  |  |  281|  6.48k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  6.48k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  6.48k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  6.48k|#define Buf_size 16
  |  |  ------------------
  |  |  283|  27.2k|  } else {\
  |  |  284|  27.2k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|  27.2k|    s->bi_valid += len;\
  |  |  286|  27.2k|  }\
  |  |  287|  33.6k|}
  ------------------
  782|       |
  783|  33.6k|        } else {
  784|  16.2k|            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  240|  16.2k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  275|  16.2k|#define send_bits(s, value, length) \
  |  |  |  |  276|  16.2k|{ int len = length;\
  |  |  |  |  277|  16.2k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  16.2k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (277:7): [True: 3.30k, False: 12.9k]
  |  |  |  |  ------------------
  |  |  |  |  278|  3.30k|    int val = (int)value;\
  |  |  |  |  279|  3.30k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  280|  3.30k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  3.30k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  3.30k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  3.30k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  3.30k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  3.30k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  3.30k|}
  |  |  |  |  ------------------
  |  |  |  |  281|  3.30k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.30k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  3.30k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.30k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  283|  12.9k|  } else {\
  |  |  |  |  284|  12.9k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  285|  12.9k|    s->bi_valid += len;\
  |  |  |  |  286|  12.9k|  }\
  |  |  |  |  287|  16.2k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  275|  16.2k|#define send_bits(s, value, length) \
  |  |  276|  16.2k|{ int len = length;\
  |  |  277|  16.2k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  16.2k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (277:7): [True: 6.96k, False: 9.24k]
  |  |  ------------------
  |  |  278|  6.96k|    int val = (int)value;\
  |  |  279|  6.96k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  280|  6.96k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  6.96k|#define put_short(s, w) { \
  |  |  |  |  145|  6.96k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  6.96k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  6.96k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  6.96k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  6.96k|}
  |  |  ------------------
  |  |  281|  6.96k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  6.96k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  6.96k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  6.96k|#define Buf_size 16
  |  |  ------------------
  |  |  283|  9.24k|  } else {\
  |  |  284|  9.24k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  285|  9.24k|    s->bi_valid += len;\
  |  |  286|  9.24k|  }\
  |  |  287|  16.2k|}
  ------------------
  785|  16.2k|        }
  786|   943k|        count = 0; prevlen = curlen;
  787|   943k|        if (nextlen == 0) {
  ------------------
  |  Branch (787:13): [True: 107k, False: 835k]
  ------------------
  788|   107k|            max_count = 138, min_count = 3;
  789|   835k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (789:20): [True: 89.2k, False: 746k]
  ------------------
  790|  89.2k|            max_count = 6, min_count = 3;
  791|   746k|        } else {
  792|   746k|            max_count = 7, min_count = 4;
  793|   746k|        }
  794|   943k|    }
  795|  19.8k|}

zcalloc:
  324|  27.4k|voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
  325|  27.4k|    (void)opaque;
  326|  27.4k|    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
  ------------------
  |  Branch (326:12): [True: 27.4k, Folded]
  ------------------
  327|  27.4k|                              (voidpf)calloc(items, size);
  328|  27.4k|}
zcfree:
  330|  27.4k|void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
  331|  27.4k|    (void)opaque;
  332|  27.4k|    free(ptr);
  333|  27.4k|}

