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

crc32_z:
  626|  59.6k|uLong ZEXPORT crc32_z(uLong crc, const unsigned char FAR *buf, z_size_t len) {
  627|       |    /* Return initial CRC, if requested. */
  628|  59.6k|    if (buf == Z_NULL) return 0;
  ------------------
  |  |  216|  59.6k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (628:9): [True: 14.9k, False: 44.7k]
  ------------------
  629|       |
  630|       |#ifdef DYNAMIC_CRC_TABLE
  631|       |    z_once(&made, make_crc_table);
  632|       |#endif /* DYNAMIC_CRC_TABLE */
  633|       |
  634|       |    /* Pre-condition the CRC */
  635|  44.7k|    crc = (~crc) & 0xffffffff;
  636|       |
  637|  44.7k|#ifdef W
  638|       |
  639|       |    /* If provided enough bytes, do a braided CRC calculation. */
  640|  44.7k|    if (len >= N * W + W - 1) {
  ------------------
  |  |   64|  44.7k|#  define N 5
  ------------------
                  if (len >= N * W + W - 1) {
  ------------------
  |  |   90|  44.7k|#      define W 8
  ------------------
                  if (len >= N * W + W - 1) {
  ------------------
  |  |   90|  44.7k|#      define W 8
  ------------------
  |  Branch (640:9): [True: 36.9k, False: 7.78k]
  ------------------
  641|  36.9k|        z_size_t blks;
  642|  36.9k|        z_word_t const *words;
  643|  36.9k|        unsigned endian;
  644|  36.9k|        int k;
  645|       |
  646|       |        /* Compute the CRC up to a z_word_t boundary. */
  647|  89.4k|        while (len && ((z_size_t)buf & (W - 1)) != 0) {
  ------------------
  |  |   90|  89.4k|#      define W 8
  ------------------
  |  Branch (647:16): [True: 89.4k, False: 0]
  |  Branch (647:23): [True: 52.5k, False: 36.9k]
  ------------------
  648|  52.5k|            len--;
  649|  52.5k|            crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  650|  52.5k|        }
  651|       |
  652|       |        /* Compute the CRC on as many N z_word_t blocks as are available. */
  653|  36.9k|        blks = len / (N * W);
  ------------------
  |  |   64|  36.9k|#  define N 5
  ------------------
                      blks = len / (N * W);
  ------------------
  |  |   90|  36.9k|#      define W 8
  ------------------
  654|  36.9k|        len -= blks * N * W;
  ------------------
  |  |   64|  36.9k|#  define N 5
  ------------------
                      len -= blks * N * W;
  ------------------
  |  |   90|  36.9k|#      define W 8
  ------------------
  655|  36.9k|        words = (z_word_t const *)buf;
  656|       |
  657|       |        /* Do endian check at execution time instead of compile time, since ARM
  658|       |           processors can change the endianness at execution time. If the
  659|       |           compiler knows what the endianness will be, it can optimize out the
  660|       |           check and the unused branch. */
  661|  36.9k|        endian = 1;
  662|  36.9k|        if (*(unsigned char *)&endian) {
  ------------------
  |  Branch (662:13): [True: 36.9k, False: 0]
  ------------------
  663|       |            /* Little endian. */
  664|       |
  665|  36.9k|            z_crc_t crc0;
  666|  36.9k|            z_word_t word0;
  667|  36.9k|#if N > 1
  668|  36.9k|            z_crc_t crc1;
  669|  36.9k|            z_word_t word1;
  670|  36.9k|#if N > 2
  671|  36.9k|            z_crc_t crc2;
  672|  36.9k|            z_word_t word2;
  673|  36.9k|#if N > 3
  674|  36.9k|            z_crc_t crc3;
  675|  36.9k|            z_word_t word3;
  676|  36.9k|#if N > 4
  677|  36.9k|            z_crc_t crc4;
  678|  36.9k|            z_word_t word4;
  679|       |#if N > 5
  680|       |            z_crc_t crc5;
  681|       |            z_word_t word5;
  682|       |#endif
  683|  36.9k|#endif
  684|  36.9k|#endif
  685|  36.9k|#endif
  686|  36.9k|#endif
  687|       |
  688|       |            /* Initialize the CRC for each braid. */
  689|  36.9k|            crc0 = crc;
  690|  36.9k|#if N > 1
  691|  36.9k|            crc1 = 0;
  692|  36.9k|#if N > 2
  693|  36.9k|            crc2 = 0;
  694|  36.9k|#if N > 3
  695|  36.9k|            crc3 = 0;
  696|  36.9k|#if N > 4
  697|  36.9k|            crc4 = 0;
  698|       |#if N > 5
  699|       |            crc5 = 0;
  700|       |#endif
  701|  36.9k|#endif
  702|  36.9k|#endif
  703|  36.9k|#endif
  704|  36.9k|#endif
  705|       |
  706|       |            /*
  707|       |              Process the first blks-1 blocks, computing the CRCs on each braid
  708|       |              independently.
  709|       |             */
  710|  10.9M|            while (--blks) {
  ------------------
  |  Branch (710:20): [True: 10.8M, False: 36.9k]
  ------------------
  711|       |                /* Load the word for each braid into registers. */
  712|  10.8M|                word0 = crc0 ^ words[0];
  713|  10.8M|#if N > 1
  714|  10.8M|                word1 = crc1 ^ words[1];
  715|  10.8M|#if N > 2
  716|  10.8M|                word2 = crc2 ^ words[2];
  717|  10.8M|#if N > 3
  718|  10.8M|                word3 = crc3 ^ words[3];
  719|  10.8M|#if N > 4
  720|  10.8M|                word4 = crc4 ^ words[4];
  721|       |#if N > 5
  722|       |                word5 = crc5 ^ words[5];
  723|       |#endif
  724|  10.8M|#endif
  725|  10.8M|#endif
  726|  10.8M|#endif
  727|  10.8M|#endif
  728|  10.8M|                words += N;
  ------------------
  |  |   64|  10.8M|#  define N 5
  ------------------
  729|       |
  730|       |                /* Compute and update the CRC for each word. The loop should
  731|       |                   get unrolled. */
  732|  10.8M|                crc0 = crc_braid_table[0][word0 & 0xff];
  733|  10.8M|#if N > 1
  734|  10.8M|                crc1 = crc_braid_table[0][word1 & 0xff];
  735|  10.8M|#if N > 2
  736|  10.8M|                crc2 = crc_braid_table[0][word2 & 0xff];
  737|  10.8M|#if N > 3
  738|  10.8M|                crc3 = crc_braid_table[0][word3 & 0xff];
  739|  10.8M|#if N > 4
  740|  10.8M|                crc4 = crc_braid_table[0][word4 & 0xff];
  741|       |#if N > 5
  742|       |                crc5 = crc_braid_table[0][word5 & 0xff];
  743|       |#endif
  744|  10.8M|#endif
  745|  10.8M|#endif
  746|  10.8M|#endif
  747|  10.8M|#endif
  748|  86.9M|                for (k = 1; k < W; k++) {
  ------------------
  |  |   90|  86.9M|#      define W 8
  ------------------
  |  Branch (748:29): [True: 76.0M, False: 10.8M]
  ------------------
  749|  76.0M|                    crc0 ^= crc_braid_table[k][(word0 >> (k << 3)) & 0xff];
  750|  76.0M|#if N > 1
  751|  76.0M|                    crc1 ^= crc_braid_table[k][(word1 >> (k << 3)) & 0xff];
  752|  76.0M|#if N > 2
  753|  76.0M|                    crc2 ^= crc_braid_table[k][(word2 >> (k << 3)) & 0xff];
  754|  76.0M|#if N > 3
  755|  76.0M|                    crc3 ^= crc_braid_table[k][(word3 >> (k << 3)) & 0xff];
  756|  76.0M|#if N > 4
  757|  76.0M|                    crc4 ^= crc_braid_table[k][(word4 >> (k << 3)) & 0xff];
  758|       |#if N > 5
  759|       |                    crc5 ^= crc_braid_table[k][(word5 >> (k << 3)) & 0xff];
  760|       |#endif
  761|  76.0M|#endif
  762|  76.0M|#endif
  763|  76.0M|#endif
  764|  76.0M|#endif
  765|  76.0M|                }
  766|  10.8M|            }
  767|       |
  768|       |            /*
  769|       |              Process the last block, combining the CRCs of the N braids at the
  770|       |              same time.
  771|       |             */
  772|  36.9k|            crc = crc_word(crc0 ^ words[0]);
  773|  36.9k|#if N > 1
  774|  36.9k|            crc = crc_word(crc1 ^ words[1] ^ crc);
  775|  36.9k|#if N > 2
  776|  36.9k|            crc = crc_word(crc2 ^ words[2] ^ crc);
  777|  36.9k|#if N > 3
  778|  36.9k|            crc = crc_word(crc3 ^ words[3] ^ crc);
  779|  36.9k|#if N > 4
  780|  36.9k|            crc = crc_word(crc4 ^ words[4] ^ crc);
  781|       |#if N > 5
  782|       |            crc = crc_word(crc5 ^ words[5] ^ crc);
  783|       |#endif
  784|  36.9k|#endif
  785|  36.9k|#endif
  786|  36.9k|#endif
  787|  36.9k|#endif
  788|  36.9k|            words += N;
  ------------------
  |  |   64|  36.9k|#  define N 5
  ------------------
  789|  36.9k|        }
  790|      0|        else {
  791|       |            /* Big endian. */
  792|       |
  793|      0|            z_word_t crc0, word0, comb;
  794|      0|#if N > 1
  795|      0|            z_word_t crc1, word1;
  796|      0|#if N > 2
  797|      0|            z_word_t crc2, word2;
  798|      0|#if N > 3
  799|      0|            z_word_t crc3, word3;
  800|      0|#if N > 4
  801|      0|            z_word_t crc4, word4;
  802|       |#if N > 5
  803|       |            z_word_t crc5, word5;
  804|       |#endif
  805|      0|#endif
  806|      0|#endif
  807|      0|#endif
  808|      0|#endif
  809|       |
  810|       |            /* Initialize the CRC for each braid. */
  811|      0|            crc0 = byte_swap(crc);
  812|      0|#if N > 1
  813|      0|            crc1 = 0;
  814|      0|#if N > 2
  815|      0|            crc2 = 0;
  816|      0|#if N > 3
  817|      0|            crc3 = 0;
  818|      0|#if N > 4
  819|      0|            crc4 = 0;
  820|       |#if N > 5
  821|       |            crc5 = 0;
  822|       |#endif
  823|      0|#endif
  824|      0|#endif
  825|      0|#endif
  826|      0|#endif
  827|       |
  828|       |            /*
  829|       |              Process the first blks-1 blocks, computing the CRCs on each braid
  830|       |              independently.
  831|       |             */
  832|      0|            while (--blks) {
  ------------------
  |  Branch (832:20): [True: 0, False: 0]
  ------------------
  833|       |                /* Load the word for each braid into registers. */
  834|      0|                word0 = crc0 ^ words[0];
  835|      0|#if N > 1
  836|      0|                word1 = crc1 ^ words[1];
  837|      0|#if N > 2
  838|      0|                word2 = crc2 ^ words[2];
  839|      0|#if N > 3
  840|      0|                word3 = crc3 ^ words[3];
  841|      0|#if N > 4
  842|      0|                word4 = crc4 ^ words[4];
  843|       |#if N > 5
  844|       |                word5 = crc5 ^ words[5];
  845|       |#endif
  846|      0|#endif
  847|      0|#endif
  848|      0|#endif
  849|      0|#endif
  850|      0|                words += N;
  ------------------
  |  |   64|      0|#  define N 5
  ------------------
  851|       |
  852|       |                /* Compute and update the CRC for each word. The loop should
  853|       |                   get unrolled. */
  854|      0|                crc0 = crc_braid_big_table[0][word0 & 0xff];
  855|      0|#if N > 1
  856|      0|                crc1 = crc_braid_big_table[0][word1 & 0xff];
  857|      0|#if N > 2
  858|      0|                crc2 = crc_braid_big_table[0][word2 & 0xff];
  859|      0|#if N > 3
  860|      0|                crc3 = crc_braid_big_table[0][word3 & 0xff];
  861|      0|#if N > 4
  862|      0|                crc4 = crc_braid_big_table[0][word4 & 0xff];
  863|       |#if N > 5
  864|       |                crc5 = crc_braid_big_table[0][word5 & 0xff];
  865|       |#endif
  866|      0|#endif
  867|      0|#endif
  868|      0|#endif
  869|      0|#endif
  870|      0|                for (k = 1; k < W; k++) {
  ------------------
  |  |   90|      0|#      define W 8
  ------------------
  |  Branch (870:29): [True: 0, False: 0]
  ------------------
  871|      0|                    crc0 ^= crc_braid_big_table[k][(word0 >> (k << 3)) & 0xff];
  872|      0|#if N > 1
  873|      0|                    crc1 ^= crc_braid_big_table[k][(word1 >> (k << 3)) & 0xff];
  874|      0|#if N > 2
  875|      0|                    crc2 ^= crc_braid_big_table[k][(word2 >> (k << 3)) & 0xff];
  876|      0|#if N > 3
  877|      0|                    crc3 ^= crc_braid_big_table[k][(word3 >> (k << 3)) & 0xff];
  878|      0|#if N > 4
  879|      0|                    crc4 ^= crc_braid_big_table[k][(word4 >> (k << 3)) & 0xff];
  880|       |#if N > 5
  881|       |                    crc5 ^= crc_braid_big_table[k][(word5 >> (k << 3)) & 0xff];
  882|       |#endif
  883|      0|#endif
  884|      0|#endif
  885|      0|#endif
  886|      0|#endif
  887|      0|                }
  888|      0|            }
  889|       |
  890|       |            /*
  891|       |              Process the last block, combining the CRCs of the N braids at the
  892|       |              same time.
  893|       |             */
  894|      0|            comb = crc_word_big(crc0 ^ words[0]);
  895|      0|#if N > 1
  896|      0|            comb = crc_word_big(crc1 ^ words[1] ^ comb);
  897|      0|#if N > 2
  898|      0|            comb = crc_word_big(crc2 ^ words[2] ^ comb);
  899|      0|#if N > 3
  900|      0|            comb = crc_word_big(crc3 ^ words[3] ^ comb);
  901|      0|#if N > 4
  902|      0|            comb = crc_word_big(crc4 ^ words[4] ^ comb);
  903|       |#if N > 5
  904|       |            comb = crc_word_big(crc5 ^ words[5] ^ comb);
  905|       |#endif
  906|      0|#endif
  907|      0|#endif
  908|      0|#endif
  909|      0|#endif
  910|      0|            words += N;
  ------------------
  |  |   64|      0|#  define N 5
  ------------------
  911|      0|            crc = byte_swap(comb);
  912|      0|        }
  913|       |
  914|       |        /*
  915|       |          Update the pointer to the remaining bytes to process.
  916|       |         */
  917|  36.9k|        buf = (unsigned char const *)words;
  918|  36.9k|    }
  919|       |
  920|  44.7k|#endif /* W */
  921|       |
  922|       |    /* Complete the computation of the CRC on any remaining bytes. */
  923|   140k|    while (len >= 8) {
  ------------------
  |  Branch (923:12): [True: 96.2k, False: 44.7k]
  ------------------
  924|  96.2k|        len -= 8;
  925|  96.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  926|  96.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  927|  96.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  928|  96.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  929|  96.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  930|  96.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  931|  96.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  932|  96.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  933|  96.2k|    }
  934|   136k|    while (len) {
  ------------------
  |  Branch (934:12): [True: 91.8k, False: 44.7k]
  ------------------
  935|  91.8k|        len--;
  936|  91.8k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  937|  91.8k|    }
  938|       |
  939|       |    /* Return the CRC, post-conditioned. */
  940|  44.7k|    return crc ^ 0xffffffff;
  941|  59.6k|}
crc32:
  946|  59.6k|uLong ZEXPORT crc32(uLong crc, const unsigned char FAR *buf, uInt len) {
  947|       |    #ifdef HAVE_S390X_VX
  948|       |    return crc32_z_hook(crc, buf, len);
  949|       |    #endif
  950|  59.6k|    return crc32_z(crc, buf, len);
  951|  59.6k|}
crc32.c:crc_word:
  608|   184k|local z_crc_t crc_word(z_word_t data) {
  609|   184k|    int k;
  610|  1.66M|    for (k = 0; k < W; k++)
  ------------------
  |  |   90|  1.66M|#      define W 8
  ------------------
  |  Branch (610:17): [True: 1.47M, False: 184k]
  ------------------
  611|  1.47M|        data = (data >> 8) ^ crc_table[data & 0xff];
  612|   184k|    return (z_crc_t)data;
  613|   184k|}

deflateInit2_:
  389|  3.74k|                          const char *version, int stream_size) {
  390|  3.74k|    deflate_state *s;
  391|  3.74k|    int wrap = 1;
  392|  3.74k|    static const char my_version[] = ZLIB_VERSION;
  ------------------
  |  |   44|  3.74k|#define ZLIB_VERSION "1.3.2.1-motley"
  ------------------
  393|       |
  394|  3.74k|    if (version == Z_NULL || version[0] != my_version[0] ||
  ------------------
  |  |  216|  7.48k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (394:9): [True: 0, False: 3.74k]
  |  Branch (394:30): [True: 0, False: 3.74k]
  ------------------
  395|  3.74k|        stream_size != sizeof(z_stream)) {
  ------------------
  |  Branch (395:9): [True: 0, False: 3.74k]
  ------------------
  396|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  189|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  397|      0|    }
  398|  3.74k|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  216|  3.74k|#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: 3.74k]
  ------------------
  399|       |
  400|  3.74k|    strm->msg = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  401|  3.74k|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (401:9): [True: 3.74k, False: 0]
  ------------------
  402|       |#ifdef Z_SOLO
  403|       |        return Z_STREAM_ERROR;
  404|       |#else
  405|  3.74k|        strm->zalloc = zcalloc;
  406|  3.74k|        strm->opaque = (voidpf)0;
  407|  3.74k|#endif
  408|  3.74k|    }
  409|  3.74k|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (409:9): [True: 3.74k, False: 0]
  ------------------
  410|       |#ifdef Z_SOLO
  411|       |        return Z_STREAM_ERROR;
  412|       |#else
  413|  3.74k|        strm->zfree = zcfree;
  414|  3.74k|#endif
  415|       |
  416|       |#ifdef FASTEST
  417|       |    if (level != 0) level = 1;
  418|       |#else
  419|  3.74k|    if (level == Z_DEFAULT_COMPRESSION) level = 6;
  ------------------
  |  |  197|  3.74k|#define Z_DEFAULT_COMPRESSION  (-1)
  ------------------
  |  Branch (419:9): [True: 3.74k, False: 0]
  ------------------
  420|  3.74k|#endif
  421|       |
  422|  3.74k|    if (windowBits < 0) { /* suppress zlib wrapper */
  ------------------
  |  Branch (422:9): [True: 0, False: 3.74k]
  ------------------
  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|  3.74k|#ifdef GZIP
  429|  3.74k|    else if (windowBits > 15) {
  ------------------
  |  Branch (429:14): [True: 3.74k, False: 0]
  ------------------
  430|  3.74k|        wrap = 2;       /* write gzip wrapper instead */
  431|  3.74k|        windowBits -= 16;
  432|  3.74k|    }
  433|  3.74k|#endif
  434|  3.74k|    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  277|  7.48k|#    define MAX_MEM_LEVEL 9
  ------------------
                  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  213|  7.48k|#define Z_DEFLATED   8
  ------------------
  |  Branch (434:9): [True: 0, False: 3.74k]
  |  Branch (434:25): [True: 0, False: 3.74k]
  |  Branch (434:53): [True: 0, False: 3.74k]
  ------------------
  435|  3.74k|        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
  ------------------
  |  Branch (435:9): [True: 0, False: 3.74k]
  |  Branch (435:27): [True: 0, False: 3.74k]
  |  Branch (435:46): [True: 0, False: 3.74k]
  |  Branch (435:59): [True: 0, False: 3.74k]
  ------------------
  436|  3.74k|        strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) {
  ------------------
  |  |  203|  7.48k|#define Z_FIXED               4
  ------------------
  |  Branch (436:9): [True: 0, False: 3.74k]
  |  Branch (436:25): [True: 0, False: 3.74k]
  |  Branch (436:48): [True: 0, False: 3.74k]
  |  Branch (436:67): [True: 0, False: 0]
  ------------------
  437|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  438|      0|    }
  439|  3.74k|    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
  ------------------
  |  Branch (439:9): [True: 0, False: 3.74k]
  ------------------
  440|  3.74k|    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
  ------------------
  |  |  253|  3.74k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  441|  3.74k|    if (s == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  216|  3.74k|#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: 3.74k]
  ------------------
  442|  3.74k|    zmemzero(s, sizeof(deflate_state));
  ------------------
  |  |  218|  3.74k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  443|  3.74k|    strm->state = (struct internal_state FAR *)s;
  444|  3.74k|    s->strm = strm;
  445|  3.74k|    s->status = INIT_STATE;     /* to pass state test in deflateReset() */
  ------------------
  |  |   58|  3.74k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  446|       |
  447|  3.74k|    s->wrap = wrap;
  448|  3.74k|    s->w_bits = (uInt)windowBits;
  449|  3.74k|    s->w_size = 1 << s->w_bits;
  450|  3.74k|    s->w_mask = s->w_size - 1;
  451|       |
  452|  3.74k|    s->hash_bits = (uInt)memLevel + 7;
  453|  3.74k|    s->hash_size = 1 << s->hash_bits;
  454|  3.74k|    s->hash_mask = s->hash_size - 1;
  455|  3.74k|    s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   92|  3.74k|#define MIN_MATCH  3
  ------------------
                  s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   92|  3.74k|#define MIN_MATCH  3
  ------------------
  456|       |
  457|  3.74k|    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
  ------------------
  |  |  253|  3.74k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  458|  3.74k|    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
  ------------------
  |  |  253|  3.74k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  459|  3.74k|    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
  ------------------
  |  |  253|  3.74k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  460|       |
  461|  3.74k|    s->high_water = 0;      /* nothing written to s->window yet */
  462|       |
  463|  3.74k|    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|  3.74k|    s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS);
  ------------------
  |  |  253|  3.74k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  505|  3.74k|    s->pending_buf_size = (ulg)s->lit_bufsize * 4;
  506|       |
  507|  3.74k|    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  7.48k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  7.48k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  7.48k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (507:9): [True: 0, False: 3.74k]
  |  Branch (507:32): [True: 0, False: 3.74k]
  |  Branch (507:53): [True: 0, False: 3.74k]
  ------------------
  508|  3.74k|        s->pending_buf == Z_NULL) {
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (508:9): [True: 0, False: 3.74k]
  ------------------
  509|      0|        s->status = FINISH_STATE;
  ------------------
  |  |   67|      0|#define FINISH_STATE 666    /* stream complete */
  ------------------
  510|      0|        strm->msg = ERR_MSG(Z_MEM_ERROR);
  ------------------
  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  ------------------
  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  ------------------
  ------------------
  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|  3.74k|    s->sym_buf = s->pending_buf + s->lit_bufsize;
  520|  3.74k|    s->sym_end = (s->lit_bufsize - 1) * 3;
  521|  3.74k|#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|  3.74k|    s->level = level;
  528|  3.74k|    s->strategy = strategy;
  529|  3.74k|    s->method = (Byte)method;
  530|       |
  531|  3.74k|    return deflateReset(strm);
  532|  3.74k|}
deflateResetKeep:
  643|  3.74k|int ZEXPORT deflateResetKeep(z_streamp strm) {
  644|  3.74k|    deflate_state *s;
  645|       |
  646|  3.74k|    if (deflateStateCheck(strm)) {
  ------------------
  |  Branch (646:9): [True: 0, False: 3.74k]
  ------------------
  647|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  648|      0|    }
  649|       |
  650|  3.74k|    strm->total_in = strm->total_out = 0;
  651|  3.74k|    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  652|  3.74k|    strm->data_type = Z_UNKNOWN;
  ------------------
  |  |  210|  3.74k|#define Z_UNKNOWN  2
  ------------------
  653|       |
  654|  3.74k|    s = (deflate_state *)strm->state;
  655|  3.74k|    s->pending = 0;
  656|  3.74k|    s->pending_out = s->pending_buf;
  657|       |
  658|  3.74k|    if (s->wrap < 0) {
  ------------------
  |  Branch (658:9): [True: 0, False: 3.74k]
  ------------------
  659|      0|        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
  660|      0|    }
  661|  3.74k|    s->status =
  662|  3.74k|#ifdef GZIP
  663|  3.74k|        s->wrap == 2 ? GZIP_STATE :
  ------------------
  |  |   60|  3.74k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (663:9): [True: 3.74k, False: 0]
  ------------------
  664|  3.74k|#endif
  665|  3.74k|        INIT_STATE;
  ------------------
  |  |   58|  3.74k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  666|  3.74k|    strm->adler =
  667|  3.74k|#ifdef GZIP
  668|  3.74k|        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (668:9): [True: 3.74k, False: 0]
  ------------------
  669|  3.74k|#endif
  670|  3.74k|        adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  671|  3.74k|    s->last_flush = -2;
  672|       |
  673|  3.74k|    s->gzhead = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  674|       |
  675|  3.74k|    _tr_init(s);
  676|       |
  677|  3.74k|    return Z_OK;
  ------------------
  |  |  181|  3.74k|#define Z_OK            0
  ------------------
  678|  3.74k|}
deflateReset:
  705|  3.74k|int ZEXPORT deflateReset(z_streamp strm) {
  706|  3.74k|    int ret;
  707|       |
  708|  3.74k|    ret = deflateResetKeep(strm);
  709|  3.74k|    if (ret == Z_OK)
  ------------------
  |  |  181|  3.74k|#define Z_OK            0
  ------------------
  |  Branch (709:9): [True: 3.74k, False: 0]
  ------------------
  710|  3.74k|        lm_init(strm->state);
  711|  3.74k|    return ret;
  712|  3.74k|}
deflate:
  982|  47.6k|int ZEXPORT deflate(z_streamp strm, int flush) {
  983|  47.6k|    int old_flush; /* value of flush param for previous deflate call */
  984|  47.6k|    deflate_state *s;
  985|       |
  986|  47.6k|    if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {
  ------------------
  |  |  177|  95.3k|#define Z_BLOCK         5
  ------------------
  |  Branch (986:9): [True: 0, False: 47.6k]
  |  Branch (986:36): [True: 0, False: 47.6k]
  |  Branch (986:55): [True: 0, False: 47.6k]
  ------------------
  987|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  988|      0|    }
  989|  47.6k|    s = strm->state;
  990|       |
  991|  47.6k|    if (strm->next_out == Z_NULL ||
  ------------------
  |  |  216|  95.3k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (991:9): [True: 0, False: 47.6k]
  ------------------
  992|  47.6k|        (strm->avail_in != 0 && strm->next_in == Z_NULL) ||
  ------------------
  |  |  216|  16.1k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (992:10): [True: 16.1k, False: 31.5k]
  |  Branch (992:33): [True: 0, False: 16.1k]
  ------------------
  993|  47.6k|        (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |   67|  95.3k|#define FINISH_STATE 666    /* stream complete */
  ------------------
                      (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |  176|  5.12k|#define Z_FINISH        4
  ------------------
  |  Branch (993:10): [True: 5.12k, False: 42.5k]
  |  Branch (993:39): [True: 0, False: 5.12k]
  ------------------
  994|      0|        ERR_RETURN(strm, Z_STREAM_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  995|      0|    }
  996|  47.6k|    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (996:9): [True: 0, False: 47.6k]
  ------------------
  997|       |
  998|  47.6k|    old_flush = s->last_flush;
  999|  47.6k|    s->last_flush = flush;
 1000|       |
 1001|       |    /* Flush as much pending output as possible */
 1002|  47.6k|    if (s->pending != 0) {
  ------------------
  |  Branch (1002:9): [True: 16.2k, False: 31.4k]
  ------------------
 1003|  16.2k|        flush_pending(strm);
 1004|  16.2k|        if (strm->avail_out == 0) {
  ------------------
  |  Branch (1004:13): [True: 6.82k, False: 9.41k]
  ------------------
 1005|       |            /* Since avail_out is 0, deflate will be called again with
 1006|       |             * more output space, but possibly with both pending and
 1007|       |             * avail_in equal to zero. There won't be anything to do,
 1008|       |             * but this is not an error situation so make sure we
 1009|       |             * return OK instead of BUF_ERROR at next call of deflate:
 1010|       |             */
 1011|  6.82k|            s->last_flush = -1;
 1012|  6.82k|            return Z_OK;
  ------------------
  |  |  181|  6.82k|#define Z_OK            0
  ------------------
 1013|  6.82k|        }
 1014|       |
 1015|       |    /* Make sure there is something to do and avoid duplicate consecutive
 1016|       |     * flushes. For repeated and useless calls with Z_FINISH, we keep
 1017|       |     * returning Z_STREAM_END instead of Z_BUF_ERROR.
 1018|       |     */
 1019|  31.4k|    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  15.3k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 15.3k]
  |  |  ------------------
  ------------------
                  } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  46.8k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 15.3k]
  |  |  ------------------
  ------------------
  |  Branch (1019:16): [True: 15.3k, False: 16.1k]
  |  Branch (1019:39): [True: 14.2k, False: 1.05k]
  ------------------
 1020|  14.2k|               flush != Z_FINISH) {
  ------------------
  |  |  176|  14.2k|#define Z_FINISH        4
  ------------------
  |  Branch (1020:16): [True: 10.5k, False: 3.74k]
  ------------------
 1021|  10.5k|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   68|  10.5k|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|  10.5k|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1022|  10.5k|    }
 1023|       |
 1024|       |    /* User must not provide more input after the first FINISH: */
 1025|  30.3k|    if (s->status == FINISH_STATE && strm->avail_in != 0) {
  ------------------
  |  |   67|  60.6k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (1025:9): [True: 4.90k, False: 25.4k]
  |  Branch (1025:38): [True: 0, False: 4.90k]
  ------------------
 1026|      0|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1027|      0|    }
 1028|       |
 1029|       |    /* Write the header */
 1030|  30.3k|    if (s->status == INIT_STATE && s->wrap == 0)
  ------------------
  |  |   58|  60.6k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1030:9): [True: 0, False: 30.3k]
  |  Branch (1030:36): [True: 0, False: 0]
  ------------------
 1031|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1032|  30.3k|    if (s->status == INIT_STATE) {
  ------------------
  |  |   58|  30.3k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1032:9): [True: 0, False: 30.3k]
  ------------------
 1033|       |        /* zlib header */
 1034|      0|        uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
  ------------------
  |  |  213|      0|#define Z_DEFLATED   8
  ------------------
 1035|      0|        uInt level_flags;
 1036|       |
 1037|      0|        if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
  ------------------
  |  |  201|      0|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1037:13): [True: 0, False: 0]
  |  Branch (1037:46): [True: 0, False: 0]
  ------------------
 1038|      0|            level_flags = 0;
 1039|      0|        else if (s->level < 6)
  ------------------
  |  Branch (1039:18): [True: 0, False: 0]
  ------------------
 1040|      0|            level_flags = 1;
 1041|      0|        else if (s->level == 6)
  ------------------
  |  Branch (1041:18): [True: 0, False: 0]
  ------------------
 1042|      0|            level_flags = 2;
 1043|      0|        else
 1044|      0|            level_flags = 3;
 1045|      0|        header |= (level_flags << 6);
 1046|      0|        if (s->strstart != 0) header |= PRESET_DICT;
  ------------------
  |  |   96|      0|#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
  ------------------
  |  Branch (1046:13): [True: 0, False: 0]
  ------------------
 1047|      0|        header += 31 - (header % 31);
 1048|       |
 1049|      0|        putShortMSB(s, header);
 1050|       |
 1051|       |        /* Save the adler32 of the preset dictionary: */
 1052|      0|        if (s->strstart != 0) {
  ------------------
  |  Branch (1052:13): [True: 0, False: 0]
  ------------------
 1053|      0|            putShortMSB(s, (uInt)(strm->adler >> 16));
 1054|      0|            putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1055|      0|        }
 1056|      0|        strm->adler = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1057|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1058|       |
 1059|       |        /* Compression must start with an empty pending buffer */
 1060|      0|        flush_pending(strm);
 1061|      0|        if (s->pending != 0) {
  ------------------
  |  Branch (1061:13): [True: 0, False: 0]
  ------------------
 1062|      0|            s->last_flush = -1;
 1063|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1064|      0|        }
 1065|      0|    }
 1066|  30.3k|#ifdef GZIP
 1067|  30.3k|    if (s->status == GZIP_STATE) {
  ------------------
  |  |   60|  30.3k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (1067:9): [True: 3.74k, False: 26.5k]
  ------------------
 1068|       |        /* gzip header */
 1069|  3.74k|        strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1070|  3.74k|        put_byte(s, 31);
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1071|  3.74k|        put_byte(s, 139);
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1072|  3.74k|        put_byte(s, 8);
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1073|  3.74k|        if (s->gzhead == Z_NULL) {
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1073:13): [True: 3.74k, False: 0]
  ------------------
 1074|  3.74k|            put_byte(s, 0);
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1075|  3.74k|            put_byte(s, 0);
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1076|  3.74k|            put_byte(s, 0);
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1077|  3.74k|            put_byte(s, 0);
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1078|  3.74k|            put_byte(s, 0);
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1079|  3.74k|            put_byte(s, s->level == 9 ? 2 :
  ------------------
  |  |  293|  20.6k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (293:64): [True: 1.82k, False: 1.91k]
  |  |  |  Branch (293:64): [True: 0, False: 1.91k]
  |  |  |  Branch (293:64): [True: 0, False: 3.74k]
  |  |  ------------------
  ------------------
 1080|  3.74k|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1081|  3.74k|                      4 : 0));
 1082|  3.74k|            put_byte(s, OS_CODE);
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1083|  3.74k|            s->status = BUSY_STATE;
  ------------------
  |  |   66|  3.74k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1084|       |
 1085|       |            /* Compression must start with an empty pending buffer */
 1086|  3.74k|            flush_pending(strm);
 1087|  3.74k|            if (s->pending != 0) {
  ------------------
  |  Branch (1087:17): [True: 0, False: 3.74k]
  ------------------
 1088|      0|                s->last_flush = -1;
 1089|      0|                return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1090|      0|            }
 1091|  3.74k|        }
 1092|      0|        else {
 1093|      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]
  |  |  ------------------
  ------------------
 1094|      0|                     (s->gzhead->hcrc ? 2 : 0) +
 1095|      0|                     (s->gzhead->extra == Z_NULL ? 0 : 4) +
 1096|      0|                     (s->gzhead->name == Z_NULL ? 0 : 8) +
 1097|      0|                     (s->gzhead->comment == Z_NULL ? 0 : 16)
 1098|      0|                     );
 1099|      0|            put_byte(s, (Byte)(s->gzhead->time & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1100|      0|            put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1101|      0|            put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1102|      0|            put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1103|      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]
  |  |  ------------------
  ------------------
 1104|      0|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1105|      0|                      4 : 0));
 1106|      0|            put_byte(s, s->gzhead->os & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1107|      0|            if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1107:17): [True: 0, False: 0]
  ------------------
 1108|      0|                put_byte(s, s->gzhead->extra_len & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1109|      0|                put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1110|      0|            }
 1111|      0|            if (s->gzhead->hcrc)
  ------------------
  |  Branch (1111:17): [True: 0, False: 0]
  ------------------
 1112|      0|                strm->adler = crc32_z(strm->adler, s->pending_buf,
 1113|      0|                                      s->pending);
 1114|      0|            s->gzindex = 0;
 1115|      0|            s->status = EXTRA_STATE;
  ------------------
  |  |   62|      0|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
 1116|      0|        }
 1117|  3.74k|    }
 1118|  30.3k|    if (s->status == EXTRA_STATE) {
  ------------------
  |  |   62|  30.3k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (1118:9): [True: 0, False: 30.3k]
  ------------------
 1119|      0|        if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1119:13): [True: 0, False: 0]
  ------------------
 1120|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1121|      0|            ulg left = (s->gzhead->extra_len & 0xffff) - s->gzindex;
 1122|      0|            while (s->pending + left > s->pending_buf_size) {
  ------------------
  |  Branch (1122:20): [True: 0, False: 0]
  ------------------
 1123|      0|                ulg copy = s->pending_buf_size - s->pending;
 1124|      0|                zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  216|      0|#    define zmemcpy memcpy
  ------------------
 1125|      0|                        s->gzhead->extra + s->gzindex, copy);
 1126|      0|                s->pending = s->pending_buf_size;
 1127|      0|                HCRC_UPDATE(beg);
  ------------------
  |  |  975|      0|    do { \
  |  |  976|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (976:13): [True: 0, False: 0]
  |  |  |  Branch (976:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  977|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  978|      0|                                  s->pending - (beg)); \
  |  |  979|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (979:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1128|      0|                s->gzindex += copy;
 1129|      0|                flush_pending(strm);
 1130|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1130:21): [True: 0, False: 0]
  ------------------
 1131|      0|                    s->last_flush = -1;
 1132|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1133|      0|                }
 1134|      0|                beg = 0;
 1135|      0|                left -= copy;
 1136|      0|            }
 1137|      0|            zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  216|      0|#    define zmemcpy memcpy
  ------------------
 1138|      0|                    s->gzhead->extra + s->gzindex, left);
 1139|      0|            s->pending += left;
 1140|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  975|      0|    do { \
  |  |  976|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (976:13): [True: 0, False: 0]
  |  |  |  Branch (976:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  977|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  978|      0|                                  s->pending - (beg)); \
  |  |  979|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (979:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1141|      0|            s->gzindex = 0;
 1142|      0|        }
 1143|      0|        s->status = NAME_STATE;
  ------------------
  |  |   63|      0|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
 1144|      0|    }
 1145|  30.3k|    if (s->status == NAME_STATE) {
  ------------------
  |  |   63|  30.3k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (1145:9): [True: 0, False: 30.3k]
  ------------------
 1146|      0|        if (s->gzhead->name != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1146:13): [True: 0, False: 0]
  ------------------
 1147|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1148|      0|            int val;
 1149|      0|            do {
 1150|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1150:21): [True: 0, False: 0]
  ------------------
 1151|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  975|      0|    do { \
  |  |  976|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (976:13): [True: 0, False: 0]
  |  |  |  Branch (976:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  977|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  978|      0|                                  s->pending - (beg)); \
  |  |  979|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (979:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1152|      0|                    flush_pending(strm);
 1153|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1153:25): [True: 0, False: 0]
  ------------------
 1154|      0|                        s->last_flush = -1;
 1155|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1156|      0|                    }
 1157|      0|                    beg = 0;
 1158|      0|                }
 1159|      0|                val = s->gzhead->name[s->gzindex++];
 1160|      0|                put_byte(s, val);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1161|      0|            } while (val != 0);
  ------------------
  |  Branch (1161:22): [True: 0, False: 0]
  ------------------
 1162|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  975|      0|    do { \
  |  |  976|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (976:13): [True: 0, False: 0]
  |  |  |  Branch (976:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  977|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  978|      0|                                  s->pending - (beg)); \
  |  |  979|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (979:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1163|      0|            s->gzindex = 0;
 1164|      0|        }
 1165|      0|        s->status = COMMENT_STATE;
  ------------------
  |  |   64|      0|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
 1166|      0|    }
 1167|  30.3k|    if (s->status == COMMENT_STATE) {
  ------------------
  |  |   64|  30.3k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (1167:9): [True: 0, False: 30.3k]
  ------------------
 1168|      0|        if (s->gzhead->comment != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1168:13): [True: 0, False: 0]
  ------------------
 1169|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1170|      0|            int val;
 1171|      0|            do {
 1172|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1172:21): [True: 0, False: 0]
  ------------------
 1173|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  975|      0|    do { \
  |  |  976|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (976:13): [True: 0, False: 0]
  |  |  |  Branch (976:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  977|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  978|      0|                                  s->pending - (beg)); \
  |  |  979|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (979:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1174|      0|                    flush_pending(strm);
 1175|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1175:25): [True: 0, False: 0]
  ------------------
 1176|      0|                        s->last_flush = -1;
 1177|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1178|      0|                    }
 1179|      0|                    beg = 0;
 1180|      0|                }
 1181|      0|                val = s->gzhead->comment[s->gzindex++];
 1182|      0|                put_byte(s, val);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1183|      0|            } while (val != 0);
  ------------------
  |  Branch (1183:22): [True: 0, False: 0]
  ------------------
 1184|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  975|      0|    do { \
  |  |  976|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (976:13): [True: 0, False: 0]
  |  |  |  Branch (976:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  977|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  978|      0|                                  s->pending - (beg)); \
  |  |  979|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (979:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1185|      0|        }
 1186|      0|        s->status = HCRC_STATE;
  ------------------
  |  |   65|      0|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
 1187|      0|    }
 1188|  30.3k|    if (s->status == HCRC_STATE) {
  ------------------
  |  |   65|  30.3k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (1188:9): [True: 0, False: 30.3k]
  ------------------
 1189|      0|        if (s->gzhead->hcrc) {
  ------------------
  |  Branch (1189:13): [True: 0, False: 0]
  ------------------
 1190|      0|            if (s->pending + 2 > s->pending_buf_size) {
  ------------------
  |  Branch (1190:17): [True: 0, False: 0]
  ------------------
 1191|      0|                flush_pending(strm);
 1192|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1192:21): [True: 0, False: 0]
  ------------------
 1193|      0|                    s->last_flush = -1;
 1194|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1195|      0|                }
 1196|      0|            }
 1197|      0|            put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1198|      0|            put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1199|      0|            strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1200|      0|        }
 1201|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1202|       |
 1203|       |        /* Compression must start with an empty pending buffer */
 1204|      0|        flush_pending(strm);
 1205|      0|        if (s->pending != 0) {
  ------------------
  |  Branch (1205:13): [True: 0, False: 0]
  ------------------
 1206|      0|            s->last_flush = -1;
 1207|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1208|      0|        }
 1209|      0|    }
 1210|  30.3k|#endif
 1211|       |
 1212|       |    /* Start a new block or continue the current one.
 1213|       |     */
 1214|  30.3k|    if (strm->avail_in != 0 || s->lookahead != 0 ||
  ------------------
  |  Branch (1214:9): [True: 16.1k, False: 14.2k]
  |  Branch (1214:32): [True: 8.87k, False: 5.33k]
  ------------------
 1215|  25.3k|        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |  172|  10.6k|#define Z_NO_FLUSH      0
  ------------------
                      (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |   67|  5.28k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (1215:10): [True: 5.28k, False: 52]
  |  Branch (1215:33): [True: 384, False: 4.90k]
  ------------------
 1216|  25.3k|        block_state bstate;
 1217|       |
 1218|  25.3k|        bstate = s->level == 0 ? deflate_stored(s, flush) :
  ------------------
  |  Branch (1218:18): [True: 0, False: 25.3k]
  ------------------
 1219|  25.3k|                 s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
  ------------------
  |  |  201|  25.3k|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1219:18): [True: 10.5k, False: 14.8k]
  ------------------
 1220|  25.3k|                 s->strategy == Z_RLE ? deflate_rle(s, flush) :
  ------------------
  |  |  202|  14.8k|#define Z_RLE                 3
  ------------------
  |  Branch (1220:18): [True: 5.63k, False: 9.23k]
  ------------------
 1221|  14.8k|                 (*(configuration_table[s->level].func))(s, flush);
 1222|       |
 1223|  25.3k|        if (bstate == finish_started || bstate == finish_done) {
  ------------------
  |  Branch (1223:13): [True: 1.00k, False: 24.3k]
  |  Branch (1223:41): [True: 2.73k, False: 21.6k]
  ------------------
 1224|  3.74k|            s->status = FINISH_STATE;
  ------------------
  |  |   67|  3.74k|#define FINISH_STATE 666    /* stream complete */
  ------------------
 1225|  3.74k|        }
 1226|  25.3k|        if (bstate == need_more || bstate == finish_started) {
  ------------------
  |  Branch (1226:13): [True: 21.6k, False: 3.74k]
  |  Branch (1226:36): [True: 1.00k, False: 2.73k]
  ------------------
 1227|  22.6k|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1227:17): [True: 9.44k, False: 13.2k]
  ------------------
 1228|  9.44k|                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
 1229|  9.44k|            }
 1230|  22.6k|            return Z_OK;
  ------------------
  |  |  181|  22.6k|#define Z_OK            0
  ------------------
 1231|       |            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
 1232|       |             * of deflate should use the same flush parameter to make sure
 1233|       |             * that the flush is complete. So we don't have to output an
 1234|       |             * empty block here, this will be done at next call. This also
 1235|       |             * ensures that for a very small output buffer, we emit at most
 1236|       |             * one empty block.
 1237|       |             */
 1238|  22.6k|        }
 1239|  2.73k|        if (bstate == block_done) {
  ------------------
  |  Branch (1239:13): [True: 0, False: 2.73k]
  ------------------
 1240|      0|            if (flush == Z_PARTIAL_FLUSH) {
  ------------------
  |  |  173|      0|#define Z_PARTIAL_FLUSH 1
  ------------------
  |  Branch (1240:17): [True: 0, False: 0]
  ------------------
 1241|      0|                _tr_align(s);
 1242|      0|            } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
  ------------------
  |  |  177|      0|#define Z_BLOCK         5
  ------------------
  |  Branch (1242:24): [True: 0, False: 0]
  ------------------
 1243|      0|                _tr_stored_block(s, (char*)0, 0L, 0);
 1244|       |                /* For a full flush, this empty block will be recognized
 1245|       |                 * as a special marker by inflate_sync().
 1246|       |                 */
 1247|      0|                if (flush == Z_FULL_FLUSH) {
  ------------------
  |  |  175|      0|#define Z_FULL_FLUSH    3
  ------------------
  |  Branch (1247:21): [True: 0, False: 0]
  ------------------
 1248|      0|                    CLEAR_HASH(s);             /* forget history */
  ------------------
  |  |  171|      0|    do { \
  |  |  172|      0|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|      0|#define NIL 0
  |  |  ------------------
  |  |  173|      0|        zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  ------------------
  |  |  |  |  218|      0|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|      0|        s->slid = 0; \
  |  |  175|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1249|      0|                    if (s->lookahead == 0) {
  ------------------
  |  Branch (1249:25): [True: 0, False: 0]
  ------------------
 1250|      0|                        s->strstart = 0;
 1251|      0|                        s->block_start = 0L;
 1252|      0|                        s->insert = 0;
 1253|      0|                    }
 1254|      0|                }
 1255|      0|            }
 1256|      0|            flush_pending(strm);
 1257|      0|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1257:17): [True: 0, False: 0]
  ------------------
 1258|      0|              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
 1259|      0|              return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1260|      0|            }
 1261|      0|        }
 1262|  2.73k|    }
 1263|       |
 1264|  7.68k|    if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  176|  7.68k|#define Z_FINISH        4
  ------------------
                  if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  181|     52|#define Z_OK            0
  ------------------
  |  Branch (1264:9): [True: 52, False: 7.63k]
  ------------------
 1265|  7.63k|    if (s->wrap <= 0) return Z_STREAM_END;
  ------------------
  |  |  182|  3.89k|#define Z_STREAM_END    1
  ------------------
  |  Branch (1265:9): [True: 3.89k, False: 3.74k]
  ------------------
 1266|       |
 1267|       |    /* Write the trailer */
 1268|  3.74k|#ifdef GZIP
 1269|  3.74k|    if (s->wrap == 2) {
  ------------------
  |  Branch (1269:9): [True: 3.74k, False: 0]
  ------------------
 1270|  3.74k|        put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1271|  3.74k|        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1272|  3.74k|        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1273|  3.74k|        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1274|  3.74k|        put_byte(s, (Byte)(strm->total_in & 0xff));
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1275|  3.74k|        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1276|  3.74k|        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1277|  3.74k|        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
  ------------------
  |  |  293|  3.74k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1278|  3.74k|    }
 1279|      0|    else
 1280|      0|#endif
 1281|      0|    {
 1282|      0|        putShortMSB(s, (uInt)(strm->adler >> 16));
 1283|      0|        putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1284|      0|    }
 1285|  3.74k|    flush_pending(strm);
 1286|       |    /* If avail_out is zero, the application will call deflate again
 1287|       |     * to flush the rest.
 1288|       |     */
 1289|  3.74k|    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
  ------------------
  |  Branch (1289:9): [True: 3.74k, False: 0]
  ------------------
 1290|  3.74k|    return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  181|    149|#define Z_OK            0
  ------------------
                  return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  182|  3.59k|#define Z_STREAM_END    1
  ------------------
  |  Branch (1290:12): [True: 149, False: 3.59k]
  ------------------
 1291|  7.63k|}
deflateEnd:
 1294|  3.74k|int ZEXPORT deflateEnd(z_streamp strm) {
 1295|  3.74k|    int status;
 1296|       |
 1297|  3.74k|    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (1297:9): [True: 0, False: 3.74k]
  ------------------
 1298|       |
 1299|  3.74k|    status = strm->state->status;
 1300|       |
 1301|       |    /* Deallocate in reverse order of allocations: */
 1302|  3.74k|    TRY_FREE(strm, strm->state->pending_buf);
  ------------------
  |  |  255|  3.74k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  3.74k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
 1303|  3.74k|    TRY_FREE(strm, strm->state->head);
  ------------------
  |  |  255|  3.74k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  3.74k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
 1304|  3.74k|    TRY_FREE(strm, strm->state->prev);
  ------------------
  |  |  255|  3.74k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  3.74k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
 1305|  3.74k|    TRY_FREE(strm, strm->state->window);
  ------------------
  |  |  255|  3.74k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  3.74k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
 1306|       |
 1307|  3.74k|    ZFREE(strm, strm->state);
  ------------------
  |  |  254|  3.74k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1308|  3.74k|    strm->state = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1309|       |
 1310|  3.74k|    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
  ------------------
  |  |   66|  3.74k|#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|  3.74k|#define Z_OK            0
  ------------------
  |  Branch (1310:12): [True: 0, False: 3.74k]
  ------------------
 1311|  3.74k|}
deflate.c:deflateStateCheck:
  537|  55.1k|local int deflateStateCheck(z_streamp strm) {
  538|  55.1k|    deflate_state *s;
  539|  55.1k|    if (strm == Z_NULL ||
  ------------------
  |  |  216|   110k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (539:9): [True: 0, False: 55.1k]
  ------------------
  540|  55.1k|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (540:9): [True: 0, False: 55.1k]
  |  Branch (540:42): [True: 0, False: 55.1k]
  ------------------
  541|      0|        return 1;
  542|  55.1k|    s = strm->state;
  543|  55.1k|    if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |  216|   110k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |   58|   110k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (543:9): [True: 0, False: 55.1k]
  |  Branch (543:24): [True: 0, False: 55.1k]
  |  Branch (543:44): [True: 51.4k, False: 3.74k]
  ------------------
  544|  51.4k|#ifdef GZIP
  545|  51.4k|                                           s->status != GZIP_STATE &&
  ------------------
  |  |   60|   106k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (545:44): [True: 47.6k, False: 3.74k]
  ------------------
  546|  47.6k|#endif
  547|  47.6k|                                           s->status != EXTRA_STATE &&
  ------------------
  |  |   62|   102k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (547:44): [True: 47.6k, False: 0]
  ------------------
  548|  47.6k|                                           s->status != NAME_STATE &&
  ------------------
  |  |   63|   102k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (548:44): [True: 47.6k, False: 0]
  ------------------
  549|  47.6k|                                           s->status != COMMENT_STATE &&
  ------------------
  |  |   64|   102k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (549:44): [True: 47.6k, False: 0]
  ------------------
  550|  47.6k|                                           s->status != HCRC_STATE &&
  ------------------
  |  |   65|   102k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (550:44): [True: 47.6k, False: 0]
  ------------------
  551|  47.6k|                                           s->status != BUSY_STATE &&
  ------------------
  |  |   66|   102k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
  |  Branch (551:44): [True: 8.86k, False: 38.8k]
  ------------------
  552|  8.86k|                                           s->status != FINISH_STATE))
  ------------------
  |  |   67|  8.86k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (552:44): [True: 0, False: 8.86k]
  ------------------
  553|      0|        return 1;
  554|  55.1k|    return 0;
  555|  55.1k|}
deflate.c:fill_window:
  252|   398k|local void fill_window(deflate_state *s) {
  253|   398k|    unsigned n;
  254|   398k|    unsigned more;    /* Amount of free space at the end of the window. */
  255|   398k|    uInt wsize = s->w_size;
  256|       |
  257|   398k|    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
  258|       |
  259|   398k|    do {
  260|   398k|        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|   398k|        if (sizeof(int) <= 2) {
  ------------------
  |  Branch (267:13): [Folded, False: 398k]
  ------------------
  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|   398k|        if (s->strstart >= wsize + MAX_DIST(s)) {
  ------------------
  |  |  301|   398k|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|   398k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   398k|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|   398k|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (285:13): [True: 5.04k, False: 393k]
  ------------------
  286|       |
  287|  5.04k|            zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more);
  ------------------
  |  |  216|  5.04k|#    define zmemcpy memcpy
  ------------------
  288|  5.04k|            s->match_start -= wsize;
  289|  5.04k|            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
  290|  5.04k|            s->block_start -= (long) wsize;
  291|  5.04k|            if (s->insert > s->strstart)
  ------------------
  |  Branch (291:17): [True: 0, False: 5.04k]
  ------------------
  292|      0|                s->insert = s->strstart;
  293|  5.04k|            slide_hash(s);
  294|  5.04k|            more += wsize;
  295|  5.04k|        }
  296|   398k|        if (s->strm->avail_in == 0) break;
  ------------------
  |  Branch (296:13): [True: 382k, False: 16.1k]
  ------------------
  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|  16.1k|        Assert(more >= 2, "more < 2");
  310|       |
  311|  16.1k|        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
  312|  16.1k|        s->lookahead += n;
  313|       |
  314|       |        /* Initialize the hash value now that we have some input: */
  315|  16.1k|        if (s->lookahead + s->insert >= MIN_MATCH) {
  ------------------
  |  |   92|  16.1k|#define MIN_MATCH  3
  ------------------
  |  Branch (315:13): [True: 16.0k, False: 67]
  ------------------
  316|  16.0k|            uInt str = s->strstart - s->insert;
  317|  16.0k|            s->ins_h = s->window[str];
  318|  16.0k|            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
  ------------------
  |  |  141|  16.0k|#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|  16.0k|            while (s->insert) {
  ------------------
  |  Branch (322:20): [True: 0, False: 16.0k]
  ------------------
  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)
  ------------------
  |  |   92|      0|#define MIN_MATCH  3
  ------------------
  |  Branch (330:21): [True: 0, False: 0]
  ------------------
  331|      0|                    break;
  332|      0|            }
  333|  16.0k|        }
  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|  16.1k|    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
  ------------------
  |  |  296|  32.2k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|  16.1k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|  16.1k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (338:14): [True: 1.65k, False: 14.4k]
  |  Branch (338:46): [True: 0, False: 1.65k]
  ------------------
  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|   398k|    if (s->high_water < s->window_size) {
  ------------------
  |  Branch (347:9): [True: 316k, False: 81.8k]
  ------------------
  348|   316k|        ulg curr = s->strstart + (ulg)(s->lookahead);
  349|   316k|        ulg init;
  350|       |
  351|   316k|        if (s->high_water < curr) {
  ------------------
  |  Branch (351:13): [True: 6.39k, False: 310k]
  ------------------
  352|       |            /* Previous high water mark below current data -- zero WIN_INIT
  353|       |             * bytes or up to end of window, whichever is less.
  354|       |             */
  355|  6.39k|            init = s->window_size - curr;
  356|  6.39k|            if (init > WIN_INIT)
  ------------------
  |  |  306|  6.39k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|  6.39k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (356:17): [True: 5.81k, False: 587]
  ------------------
  357|  5.81k|                init = WIN_INIT;
  ------------------
  |  |  306|  5.81k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|  5.81k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  358|  6.39k|            zmemzero(s->window + curr, (unsigned)init);
  ------------------
  |  |  218|  6.39k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  359|  6.39k|            s->high_water = curr + init;
  360|  6.39k|        }
  361|   310k|        else if (s->high_water < (ulg)curr + WIN_INIT) {
  ------------------
  |  |  306|   310k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|   310k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (361:18): [True: 315, False: 310k]
  ------------------
  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|    315|            init = (ulg)curr + WIN_INIT - s->high_water;
  ------------------
  |  |  306|    315|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|    315|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  367|    315|            if (init > s->window_size - s->high_water)
  ------------------
  |  Branch (367:17): [True: 0, False: 315]
  ------------------
  368|      0|                init = s->window_size - s->high_water;
  369|    315|            zmemzero(s->window + s->high_water, (unsigned)init);
  ------------------
  |  |  218|    315|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  370|    315|            s->high_water += init;
  371|    315|        }
  372|   316k|    }
  373|       |
  374|   398k|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
  375|   398k|           "not enough room for search");
  376|   398k|}
deflate.c:read_buf:
  219|  16.1k|local unsigned read_buf(z_streamp strm, Bytef *buf, unsigned size) {
  220|  16.1k|    unsigned len = strm->avail_in;
  221|       |
  222|  16.1k|    if (len > size) len = size;
  ------------------
  |  Branch (222:9): [True: 0, False: 16.1k]
  ------------------
  223|  16.1k|    if (len == 0) return 0;
  ------------------
  |  Branch (223:9): [True: 0, False: 16.1k]
  ------------------
  224|       |
  225|  16.1k|    strm->avail_in  -= len;
  226|       |
  227|  16.1k|    zmemcpy(buf, strm->next_in, len);
  ------------------
  |  |  216|  16.1k|#    define zmemcpy memcpy
  ------------------
  228|  16.1k|    if (strm->state->wrap == 1) {
  ------------------
  |  Branch (228:9): [True: 0, False: 16.1k]
  ------------------
  229|      0|        strm->adler = adler32(strm->adler, buf, len);
  230|      0|    }
  231|  16.1k|#ifdef GZIP
  232|  16.1k|    else if (strm->state->wrap == 2) {
  ------------------
  |  Branch (232:14): [True: 16.1k, False: 0]
  ------------------
  233|  16.1k|        strm->adler = crc32(strm->adler, buf, len);
  234|  16.1k|    }
  235|  16.1k|#endif
  236|  16.1k|    strm->next_in  += len;
  237|  16.1k|    strm->total_in += len;
  238|       |
  239|  16.1k|    return len;
  240|  16.1k|}
deflate.c:lm_init:
  683|  3.74k|local void lm_init(deflate_state *s) {
  684|  3.74k|    s->window_size = (ulg)2L*s->w_size;
  685|       |
  686|  3.74k|    CLEAR_HASH(s);
  ------------------
  |  |  171|  3.74k|    do { \
  |  |  172|  3.74k|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|  3.74k|#define NIL 0
  |  |  ------------------
  |  |  173|  3.74k|        zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  ------------------
  |  |  |  |  218|  3.74k|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|  3.74k|        s->slid = 0; \
  |  |  175|  3.74k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded, False: 3.74k]
  |  |  ------------------
  ------------------
  687|       |
  688|       |    /* Set the default configuration parameters:
  689|       |     */
  690|  3.74k|    s->max_lazy_match   = configuration_table[s->level].max_lazy;
  691|  3.74k|    s->good_match       = configuration_table[s->level].good_length;
  692|  3.74k|    s->nice_match       = configuration_table[s->level].nice_length;
  693|  3.74k|    s->max_chain_length = configuration_table[s->level].max_chain;
  694|       |
  695|  3.74k|    s->strstart = 0;
  696|  3.74k|    s->block_start = 0L;
  697|  3.74k|    s->lookahead = 0;
  698|  3.74k|    s->insert = 0;
  699|  3.74k|    s->match_length = s->prev_length = MIN_MATCH-1;
  ------------------
  |  |   92|  3.74k|#define MIN_MATCH  3
  ------------------
  700|  3.74k|    s->match_available = 0;
  701|  3.74k|    s->ins_h = 0;
  702|  3.74k|}
deflate.c:longest_match:
 1390|  28.1M|local uInt longest_match(deflate_state *s, IPos cur_match) {
 1391|  28.1M|    unsigned chain_length = s->max_chain_length;/* max hash chain length */
 1392|  28.1M|    Bytef *scan = s->window + s->strstart;      /* current string */
 1393|  28.1M|    Bytef *match;                               /* matched string */
 1394|  28.1M|    int len;                                    /* length of current match */
 1395|  28.1M|    int best_len = (int)s->prev_length;         /* best match length so far */
 1396|  28.1M|    int nice_match = s->nice_match;             /* stop if match long enough */
 1397|  28.1M|    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
  ------------------
  |  |  301|  28.1M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  28.1M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  28.1M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  28.1M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1397:18): [True: 22.3M, False: 5.79M]
  ------------------
 1398|  22.3M|        s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |  301|  22.3M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  22.3M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  22.3M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  22.3M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |   85|  5.79M|#define NIL 0
  ------------------
 1399|       |    /* Stop when cur_match becomes <= limit. To simplify the code,
 1400|       |     * we prevent matches with the string of window index 0.
 1401|       |     */
 1402|  28.1M|    Posf *prev = s->prev;
 1403|  28.1M|    uInt wmask = s->w_mask;
 1404|       |
 1405|       |#ifdef UNALIGNED_OK
 1406|       |    /* Compare two bytes at a time. Note: this is not always beneficial.
 1407|       |     * Try with and without -DUNALIGNED_OK to check.
 1408|       |     */
 1409|       |    Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
 1410|       |    ush scan_start = *(ushf*)scan;
 1411|       |    ush scan_end   = *(ushf*)(scan + best_len - 1);
 1412|       |#else
 1413|  28.1M|    Bytef *strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |   93|  28.1M|#define MAX_MATCH  258
  ------------------
 1414|  28.1M|    Byte scan_end1  = scan[best_len - 1];
 1415|  28.1M|    Byte scan_end   = scan[best_len];
 1416|  28.1M|#endif
 1417|       |
 1418|       |    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
 1419|       |     * It is easy to get rid of this optimization if necessary.
 1420|       |     */
 1421|  28.1M|    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
 1422|       |
 1423|       |    /* Do not waste too much time if we already have a good match: */
 1424|  28.1M|    if (s->prev_length >= s->good_match) {
  ------------------
  |  Branch (1424:9): [True: 162k, False: 27.9M]
  ------------------
 1425|   162k|        chain_length >>= 2;
 1426|   162k|    }
 1427|       |    /* Do not look for matches beyond the end of the input. This is necessary
 1428|       |     * to make deflate deterministic.
 1429|       |     */
 1430|  28.1M|    if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
  ------------------
  |  Branch (1430:9): [True: 52.3k, False: 28.1M]
  ------------------
 1431|       |
 1432|  28.1M|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
 1433|  28.1M|           "need lookahead");
 1434|       |
 1435|   203M|    do {
 1436|   203M|        Assert(cur_match < s->strstart, "no future");
 1437|   203M|        match = s->window + cur_match;
 1438|       |
 1439|       |        /* Skip to next match if the match length cannot increase
 1440|       |         * or if the match length is less than 2.  Note that the checks below
 1441|       |         * for insufficient lookahead only occur occasionally for performance
 1442|       |         * reasons.  Therefore uninitialized memory will be accessed, and
 1443|       |         * conditional jumps will be made that depend on those values.
 1444|       |         * However the length of the match is limited to the lookahead, so
 1445|       |         * the output of deflate is not affected by the uninitialized values.
 1446|       |         */
 1447|       |#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
 1448|       |        /* This code assumes sizeof(unsigned short) == 2. Do not use
 1449|       |         * UNALIGNED_OK if your compiler uses a different size.
 1450|       |         */
 1451|       |        if (*(ushf*)(match + best_len - 1) != scan_end ||
 1452|       |            *(ushf*)match != scan_start) continue;
 1453|       |
 1454|       |        /* It is not necessary to compare scan[2] and match[2] since they are
 1455|       |         * always equal when the other bytes match, given that the hash keys
 1456|       |         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
 1457|       |         * strstart + 3, + 5, up to strstart + 257. We check for insufficient
 1458|       |         * lookahead only every 4th comparison; the 128th check will be made
 1459|       |         * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is
 1460|       |         * necessary to put more guard bytes at the end of the window, or
 1461|       |         * to check more often for insufficient lookahead.
 1462|       |         */
 1463|       |        Assert(scan[2] == match[2], "scan[2]?");
 1464|       |        scan++, match++;
 1465|       |        do {
 1466|       |        } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1467|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1468|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1469|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1470|       |                 scan < strend);
 1471|       |        /* The funny "do {}" generates better code on most compilers */
 1472|       |
 1473|       |        /* Here, scan <= window + strstart + 257 */
 1474|       |        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1475|       |               "wild scan");
 1476|       |        if (*scan == *match) scan++;
 1477|       |
 1478|       |        len = (MAX_MATCH - 1) - (int)(strend - scan);
 1479|       |        scan = strend - (MAX_MATCH-1);
 1480|       |
 1481|       |#else /* UNALIGNED_OK */
 1482|       |
 1483|   203M|        if (match[best_len]     != scan_end  ||
  ------------------
  |  Branch (1483:13): [True: 168M, False: 35.5M]
  ------------------
 1484|  35.5M|            match[best_len - 1] != scan_end1 ||
  ------------------
  |  Branch (1484:13): [True: 19.1M, False: 16.3M]
  ------------------
 1485|  16.3M|            *match              != *scan     ||
  ------------------
  |  Branch (1485:13): [True: 2.90M, False: 13.4M]
  ------------------
 1486|   190M|            *++match            != scan[1])      continue;
  ------------------
  |  Branch (1486:13): [True: 2.41k, False: 13.4M]
  ------------------
 1487|       |
 1488|       |        /* The check at best_len - 1 can be removed because it will be made
 1489|       |         * again later. (This heuristic is not always a win.)
 1490|       |         * It is not necessary to compare scan[2] and match[2] since they
 1491|       |         * are always equal when the other bytes match, given that
 1492|       |         * the hash keys are equal and that HASH_BITS >= 8.
 1493|       |         */
 1494|  13.4M|        scan += 2, match++;
 1495|  13.4M|        Assert(*scan == *match, "match[2]?");
 1496|       |
 1497|       |        /* We check for insufficient lookahead only every 8th comparison;
 1498|       |         * the 256th check will be made at strstart + 258.
 1499|       |         */
 1500|  20.8M|        do {
 1501|  20.8M|        } while (*++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1501:18): [True: 13.7M, False: 7.07M]
  |  Branch (1501:41): [True: 10.4M, False: 3.25M]
  ------------------
 1502|  10.4M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1502:18): [True: 9.09M, False: 1.38M]
  |  Branch (1502:41): [True: 8.39M, False: 702k]
  ------------------
 1503|  8.39M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1503:18): [True: 7.96M, False: 427k]
  |  Branch (1503:41): [True: 7.74M, False: 221k]
  ------------------
 1504|  7.74M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1504:18): [True: 7.54M, False: 196k]
  |  Branch (1504:41): [True: 7.38M, False: 163k]
  ------------------
 1505|  7.38M|                 scan < strend);
  ------------------
  |  Branch (1505:18): [True: 7.32M, False: 59.8k]
  ------------------
 1506|       |
 1507|  13.4M|        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1508|  13.4M|               "wild scan");
 1509|       |
 1510|  13.4M|        len = MAX_MATCH - (int)(strend - scan);
  ------------------
  |  |   93|  13.4M|#define MAX_MATCH  258
  ------------------
 1511|  13.4M|        scan = strend - MAX_MATCH;
  ------------------
  |  |   93|  13.4M|#define MAX_MATCH  258
  ------------------
 1512|       |
 1513|  13.4M|#endif /* UNALIGNED_OK */
 1514|       |
 1515|  13.4M|        if (len > best_len) {
  ------------------
  |  Branch (1515:13): [True: 10.3M, False: 3.12M]
  ------------------
 1516|  10.3M|            s->match_start = cur_match;
 1517|  10.3M|            best_len = len;
 1518|  10.3M|            if (len >= nice_match) break;
  ------------------
  |  Branch (1518:17): [True: 81.8k, False: 10.2M]
  ------------------
 1519|       |#ifdef UNALIGNED_OK
 1520|       |            scan_end = *(ushf*)(scan + best_len - 1);
 1521|       |#else
 1522|  10.2M|            scan_end1  = scan[best_len - 1];
 1523|  10.2M|            scan_end   = scan[best_len];
 1524|  10.2M|#endif
 1525|  10.2M|        }
 1526|   203M|    } while ((cur_match = prev[cur_match & wmask]) > limit
  ------------------
  |  Branch (1526:14): [True: 176M, False: 27.7M]
  ------------------
 1527|   176M|             && --chain_length != 0);
  ------------------
  |  Branch (1527:17): [True: 175M, False: 364k]
  ------------------
 1528|       |
 1529|  28.1M|    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
  ------------------
  |  Branch (1529:9): [True: 28.1M, False: 619]
  ------------------
 1530|    619|    return s->lookahead;
 1531|  28.1M|}
deflate.c:deflate_slow:
 1957|  9.23k|local block_state deflate_slow(deflate_state *s, int flush) {
 1958|  9.23k|    IPos hash_head;          /* head of hash chain */
 1959|  9.23k|    int bflush;              /* set if current block must be flushed */
 1960|       |
 1961|       |    /* Process the input block. */
 1962|  49.3M|    for (;;) {
 1963|       |        /* Make sure that we always have enough lookahead, except
 1964|       |         * at the end of the input file. We need MAX_MATCH bytes
 1965|       |         * for the next match, plus MIN_MATCH bytes to insert the
 1966|       |         * string following the next match.
 1967|       |         */
 1968|  49.3M|        if (s->lookahead < MIN_LOOKAHEAD) {
  ------------------
  |  |  296|  49.3M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|  49.3M|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|  49.3M|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (1968:13): [True: 251k, False: 49.0M]
  ------------------
 1969|   251k|            fill_window(s);
 1970|   251k|            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  296|   503k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|   251k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|   251k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
                          if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|   246k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (1970:17): [True: 246k, False: 5.61k]
  |  Branch (1970:49): [True: 4.90k, False: 241k]
  ------------------
 1971|  4.90k|                return need_more;
 1972|  4.90k|            }
 1973|   246k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (1973:17): [True: 1.91k, False: 245k]
  ------------------
 1974|   246k|        }
 1975|       |
 1976|       |        /* Insert the string window[strstart .. strstart + 2] in the
 1977|       |         * dictionary, and set hash_head to the head of the hash chain:
 1978|       |         */
 1979|  49.3M|        hash_head = NIL;
  ------------------
  |  |   85|  49.3M|#define NIL 0
  ------------------
 1980|  49.3M|        if (s->lookahead >= MIN_MATCH) {
  ------------------
  |  |   92|  49.3M|#define MIN_MATCH  3
  ------------------
  |  Branch (1980:13): [True: 49.3M, False: 2.41k]
  ------------------
 1981|  49.3M|            INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  49.3M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  49.3M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  49.3M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  49.3M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 1982|  49.3M|        }
 1983|       |
 1984|       |        /* Find the longest match, discarding those <= prev_length.
 1985|       |         */
 1986|  49.3M|        s->prev_length = s->match_length, s->prev_match = s->match_start;
 1987|  49.3M|        s->match_length = MIN_MATCH-1;
  ------------------
  |  |   92|  49.3M|#define MIN_MATCH  3
  ------------------
 1988|       |
 1989|  49.3M|        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
  ------------------
  |  |   85|  98.6M|#define NIL 0
  ------------------
  |  Branch (1989:13): [True: 33.2M, False: 16.0M]
  |  Branch (1989:33): [True: 32.9M, False: 252k]
  ------------------
 1990|  32.9M|            s->strstart - hash_head <= MAX_DIST(s)) {
  ------------------
  |  |  301|  32.9M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  32.9M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  32.9M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  32.9M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1990:13): [True: 28.1M, False: 4.82M]
  ------------------
 1991|       |            /* To simplify the code, we prevent matches with the string
 1992|       |             * of window index 0 (in particular we have to avoid a match
 1993|       |             * of the string with itself at the start of the input file).
 1994|       |             */
 1995|  28.1M|            s->match_length = longest_match (s, hash_head);
 1996|       |            /* longest_match() sets match_start */
 1997|       |
 1998|  28.1M|            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
  ------------------
  |  |  200|  52.9M|#define Z_FILTERED            1
  ------------------
  |  Branch (1998:17): [True: 26.4M, False: 1.68M]
  |  Branch (1998:42): [True: 11.5M, False: 14.8M]
  ------------------
 1999|  14.8M|#if TOO_FAR <= 32767
 2000|  14.8M|                || (s->match_length == MIN_MATCH &&
  ------------------
  |  |   92|  29.7M|#define MIN_MATCH  3
  ------------------
  |  Branch (2000:21): [True: 1.88M, False: 13.0M]
  ------------------
 2001|  1.88M|                    s->strstart - s->match_start > TOO_FAR)
  ------------------
  |  |   89|  1.88M|#  define TOO_FAR 4096
  ------------------
  |  Branch (2001:21): [True: 663k, False: 1.21M]
  ------------------
 2002|  26.4M|#endif
 2003|  26.4M|                )) {
 2004|       |
 2005|       |                /* If prev_match is also MIN_MATCH, match_start is garbage
 2006|       |                 * but we will ignore the current match anyway.
 2007|       |                 */
 2008|  12.2M|                s->match_length = MIN_MATCH-1;
  ------------------
  |  |   92|  12.2M|#define MIN_MATCH  3
  ------------------
 2009|  12.2M|            }
 2010|  28.1M|        }
 2011|       |        /* If there was a match at the previous step and the current
 2012|       |         * match is not better, output the previous match:
 2013|       |         */
 2014|  49.3M|        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
  ------------------
  |  |   92|  98.6M|#define MIN_MATCH  3
  ------------------
  |  Branch (2014:13): [True: 3.30M, False: 46.0M]
  |  Branch (2014:44): [True: 2.77M, False: 522k]
  ------------------
 2015|  2.77M|            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
  ------------------
  |  |   92|  2.77M|#define MIN_MATCH  3
  ------------------
 2016|       |            /* Do not insert strings in hash table beyond this. */
 2017|       |
 2018|  2.77M|            check_match(s, s->strstart - 1, s->prev_match, (int)s->prev_length);
 2019|       |
 2020|  2.77M|            _tr_tally_dist(s, s->strstart - 1 - s->prev_match,
  ------------------
  |  |  366|  2.77M|  { uch len = (uch)(length); \
  |  |  367|  2.77M|    ush dist = (ush)(distance); \
  |  |  368|  2.77M|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  369|  2.77M|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  370|  2.77M|    s->sym_buf[s->sym_next++] = len; \
  |  |  371|  2.77M|    dist--; \
  |  |  372|  2.77M|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|  2.77M|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  2.77M|#define Freq fc.freq
  |  |  ------------------
  |  |  373|  2.77M|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  321|  2.77M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 662k, False: 2.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  2.77M|#define Freq fc.freq
  |  |  ------------------
  |  |  374|  2.77M|    flush = (s->sym_next == s->sym_end); \
  |  |  375|  2.77M|  }
  ------------------
 2021|  2.77M|                           s->prev_length - MIN_MATCH, bflush);
 2022|       |
 2023|       |            /* Insert in hash table all strings up to the end of the match.
 2024|       |             * strstart - 1 and strstart are already inserted. If there is not
 2025|       |             * enough lookahead, the last two strings are not inserted in
 2026|       |             * the hash table.
 2027|       |             */
 2028|  2.77M|            s->lookahead -= s->prev_length - 1;
 2029|  2.77M|            s->prev_length -= 2;
 2030|  31.7M|            do {
 2031|  31.7M|                if (++s->strstart <= max_insert) {
  ------------------
  |  Branch (2031:21): [True: 31.7M, False: 1.39k]
  ------------------
 2032|  31.7M|                    INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  31.7M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  31.7M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  31.7M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  31.7M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 2033|  31.7M|                }
 2034|  31.7M|            } while (--s->prev_length != 0);
  ------------------
  |  Branch (2034:22): [True: 29.0M, False: 2.77M]
  ------------------
 2035|  2.77M|            s->match_available = 0;
 2036|  2.77M|            s->match_length = MIN_MATCH-1;
  ------------------
  |  |   92|  2.77M|#define MIN_MATCH  3
  ------------------
 2037|  2.77M|            s->strstart++;
 2038|       |
 2039|  2.77M|            if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1643|    299|#define FLUSH_BLOCK(s, last) { \
  |  | 1644|    299|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1631|    299|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1632|    299|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1632:24): [True: 237, False: 62]
  |  |  |  |  ------------------
  |  |  |  | 1633|    299|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1634|    299|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     62|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1635|    299|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1636|    299|                (last)); \
  |  |  |  | 1637|    299|   s->block_start = s->strstart; \
  |  |  |  | 1638|    299|   flush_pending(s->strm); \
  |  |  |  | 1639|    299|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1640|    299|}
  |  |  ------------------
  |  | 1645|    299|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1645:8): [True: 287, False: 12]
  |  |  |  Branch (1645:40): [Folded, False: 287]
  |  |  ------------------
  |  | 1646|    299|}
  ------------------
  |  Branch (2039:17): [True: 299, False: 2.77M]
  ------------------
 2040|       |
 2041|  46.5M|        } else if (s->match_available) {
  ------------------
  |  Branch (2041:20): [True: 43.7M, False: 2.78M]
  ------------------
 2042|       |            /* If there was no match at the previous position, output a
 2043|       |             * single literal. If there was a match but the current match
 2044|       |             * is longer, truncate the previous match to a single literal.
 2045|       |             */
 2046|  43.7M|            Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2047|  43.7M|            _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  358|  43.7M|  { uch cc = (c); \
  |  |  359|  43.7M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  43.7M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  43.7M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  43.7M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  43.7M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  43.7M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  43.7M|   }
  ------------------
 2048|  43.7M|            if (bflush) {
  ------------------
  |  Branch (2048:17): [True: 2.14k, False: 43.7M]
  ------------------
 2049|  2.14k|                FLUSH_BLOCK_ONLY(s, 0);
  ------------------
  |  | 1631|  2.14k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  | 1632|  2.14k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  ------------------
  |  |  |  Branch (1632:24): [True: 2.04k, False: 99]
  |  |  ------------------
  |  | 1633|  2.14k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  | 1634|  2.14k|                   (charf *)Z_NULL), \
  |  |  ------------------
  |  |  |  |  216|     99|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  ------------------
  |  | 1635|  2.14k|                (ulg)((long)s->strstart - s->block_start), \
  |  | 1636|  2.14k|                (last)); \
  |  | 1637|  2.14k|   s->block_start = s->strstart; \
  |  | 1638|  2.14k|   flush_pending(s->strm); \
  |  | 1639|  2.14k|   Tracev((stderr,"[FLUSH]")); \
  |  | 1640|  2.14k|}
  ------------------
 2050|  2.14k|            }
 2051|  43.7M|            s->strstart++;
 2052|  43.7M|            s->lookahead--;
 2053|  43.7M|            if (s->strm->avail_out == 0) return need_more;
  ------------------
  |  Branch (2053:17): [True: 2.12k, False: 43.7M]
  ------------------
 2054|  43.7M|        } else {
 2055|       |            /* There is no previous match to compare with, wait for
 2056|       |             * the next step to decide.
 2057|       |             */
 2058|  2.78M|            s->match_available = 1;
 2059|  2.78M|            s->strstart++;
 2060|  2.78M|            s->lookahead--;
 2061|  2.78M|        }
 2062|  49.3M|    }
 2063|  1.91k|    Assert (flush != Z_NO_FLUSH, "no flush?");
 2064|  1.91k|    if (s->match_available) {
  ------------------
  |  Branch (2064:9): [True: 1.18k, False: 725]
  ------------------
 2065|  1.18k|        Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2066|  1.18k|        _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  358|  1.18k|  { uch cc = (c); \
  |  |  359|  1.18k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  1.18k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  1.18k|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  1.18k|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  1.18k|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  1.18k|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  1.18k|   }
  ------------------
 2067|  1.18k|        s->match_available = 0;
 2068|  1.18k|    }
 2069|  1.91k|    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   92|  1.91k|#define MIN_MATCH  3
  ------------------
                  s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   92|  1.90k|#define MIN_MATCH  3
  ------------------
  |  Branch (2069:17): [True: 13, False: 1.90k]
  ------------------
 2070|  1.91k|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|  1.91k|#define Z_FINISH        4
  ------------------
  |  Branch (2070:9): [True: 1.91k, False: 0]
  ------------------
 2071|  1.91k|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1643|  1.91k|#define FLUSH_BLOCK(s, last) { \
  |  | 1644|  1.91k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1631|  1.91k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1632|  1.91k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1632:24): [True: 1.86k, False: 51]
  |  |  |  |  ------------------
  |  |  |  | 1633|  1.91k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1634|  1.91k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     51|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1635|  1.91k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1636|  1.91k|                (last)); \
  |  |  |  | 1637|  1.91k|   s->block_start = s->strstart; \
  |  |  |  | 1638|  1.91k|   flush_pending(s->strm); \
  |  |  |  | 1639|  1.91k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1640|  1.91k|}
  |  |  ------------------
  |  | 1645|  1.91k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1645:8): [True: 595, False: 1.31k]
  |  |  |  Branch (1645:40): [True: 595, Folded]
  |  |  ------------------
  |  | 1646|  1.91k|}
  ------------------
 2072|  1.31k|        return finish_done;
 2073|  1.91k|    }
 2074|      0|    if (s->sym_next)
  ------------------
  |  Branch (2074:9): [True: 0, False: 0]
  ------------------
 2075|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1643|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1644|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1631|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1632|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1632:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1633|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1634|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1635|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1636|      0|                (last)); \
  |  |  |  | 1637|      0|   s->block_start = s->strstart; \
  |  |  |  | 1638|      0|   flush_pending(s->strm); \
  |  |  |  | 1639|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1640|      0|}
  |  |  ------------------
  |  | 1645|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1645:8): [True: 0, False: 0]
  |  |  |  Branch (1645:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1646|      0|}
  ------------------
 2076|      0|    return block_done;
 2077|      0|}
deflate.c:slide_hash:
  187|  5.04k|local void slide_hash(deflate_state *s) {
  188|  5.04k|    unsigned n, m;
  189|  5.04k|    Posf *p;
  190|  5.04k|    uInt wsize = s->w_size;
  191|       |
  192|  5.04k|    n = s->hash_size;
  193|  5.04k|    p = &s->head[n];
  194|   165M|    do {
  195|   165M|        m = *--p;
  196|   165M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|   146M|#define NIL 0
  ------------------
  |  Branch (196:20): [True: 18.5M, False: 146M]
  ------------------
  197|   165M|    } while (--n);
  ------------------
  |  Branch (197:14): [True: 165M, False: 5.04k]
  ------------------
  198|  5.04k|#ifndef FASTEST
  199|  5.04k|    n = wsize;
  200|  5.04k|    p = &s->prev[n];
  201|   165M|    do {
  202|   165M|        m = *--p;
  203|   165M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|   129M|#define NIL 0
  ------------------
  |  Branch (203:20): [True: 36.0M, False: 129M]
  ------------------
  204|       |        /* If n is not on any hash chain, prev[n] is garbage but
  205|       |         * its value will never be used.
  206|       |         */
  207|   165M|    } while (--n);
  ------------------
  |  Branch (207:14): [True: 165M, False: 5.04k]
  ------------------
  208|  5.04k|#endif
  209|  5.04k|    s->slid = 1;
  210|  5.04k|}
deflate.c:flush_pending:
  951|  37.3k|local void flush_pending(z_streamp strm) {
  952|  37.3k|    unsigned len;
  953|  37.3k|    deflate_state *s = strm->state;
  954|       |
  955|  37.3k|    _tr_flush_bits(s);
  956|  37.3k|    len = s->pending > strm->avail_out ? strm->avail_out :
  ------------------
  |  Branch (956:11): [True: 16.2k, False: 21.0k]
  ------------------
  957|  37.3k|                                         (unsigned)s->pending;
  958|  37.3k|    if (len == 0) return;
  ------------------
  |  Branch (958:9): [True: 0, False: 37.3k]
  ------------------
  959|       |
  960|  37.3k|    zmemcpy(strm->next_out, s->pending_out, len);
  ------------------
  |  |  216|  37.3k|#    define zmemcpy memcpy
  ------------------
  961|  37.3k|    strm->next_out  += len;
  962|  37.3k|    s->pending_out  += len;
  963|  37.3k|    strm->total_out += len;
  964|  37.3k|    strm->avail_out -= len;
  965|  37.3k|    s->pending      -= len;
  966|  37.3k|    if (s->pending == 0) {
  ------------------
  |  Branch (966:9): [True: 21.0k, False: 16.2k]
  ------------------
  967|  21.0k|        s->pending_out = s->pending_buf;
  968|  21.0k|    }
  969|  37.3k|}
deflate.c:deflate_rle:
 2085|  5.63k|local block_state deflate_rle(deflate_state *s, int flush) {
 2086|  5.63k|    int bflush;             /* set if current block must be flushed */
 2087|  5.63k|    uInt prev;              /* byte at distance one to match */
 2088|  5.63k|    Bytef *scan, *strend;   /* scan goes up to strend for length of run */
 2089|       |
 2090|  39.9M|    for (;;) {
 2091|       |        /* Make sure that we always have enough lookahead, except
 2092|       |         * at the end of the input file. We need MAX_MATCH bytes
 2093|       |         * for the longest run, plus one for the unrolled loop.
 2094|       |         */
 2095|  39.9M|        if (s->lookahead <= MAX_MATCH) {
  ------------------
  |  |   93|  39.9M|#define MAX_MATCH  258
  ------------------
  |  Branch (2095:13): [True: 134k, False: 39.7M]
  ------------------
 2096|   134k|            fill_window(s);
 2097|   134k|            if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
  ------------------
  |  |   93|   269k|#define MAX_MATCH  258
  ------------------
                          if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|   131k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2097:17): [True: 131k, False: 3.38k]
  |  Branch (2097:46): [True: 3.08k, False: 128k]
  ------------------
 2098|  3.08k|                return need_more;
 2099|  3.08k|            }
 2100|   131k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (2100:17): [True: 922, False: 130k]
  ------------------
 2101|   131k|        }
 2102|       |
 2103|       |        /* See how many times the previous byte repeats */
 2104|  39.8M|        s->match_length = 0;
 2105|  39.8M|        if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
  ------------------
  |  |   92|  79.7M|#define MIN_MATCH  3
  ------------------
  |  Branch (2105:13): [True: 39.8M, False: 1.22k]
  |  Branch (2105:42): [True: 39.8M, False: 913]
  ------------------
 2106|  39.8M|            scan = s->window + s->strstart - 1;
 2107|  39.8M|            prev = *scan;
 2108|  39.8M|            if (prev == *++scan && prev == *++scan && prev == *++scan) {
  ------------------
  |  Branch (2108:17): [True: 7.75M, False: 32.1M]
  |  Branch (2108:36): [True: 1.06M, False: 6.68M]
  |  Branch (2108:55): [True: 495k, False: 573k]
  ------------------
 2109|   495k|                strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |   93|   495k|#define MAX_MATCH  258
  ------------------
 2110|  1.62M|                do {
 2111|  1.62M|                } while (prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2111:26): [True: 1.59M, False: 34.5k]
  |  Branch (2111:45): [True: 1.23M, False: 362k]
  ------------------
 2112|  1.23M|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2112:26): [True: 1.21M, False: 11.8k]
  |  Branch (2112:45): [True: 1.20M, False: 9.54k]
  ------------------
 2113|  1.20M|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2113:26): [True: 1.19M, False: 9.13k]
  |  Branch (2113:45): [True: 1.17M, False: 26.2k]
  ------------------
 2114|  1.17M|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2114:26): [True: 1.16M, False: 9.13k]
  |  Branch (2114:45): [True: 1.15M, False: 6.21k]
  ------------------
 2115|  1.15M|                         scan < strend);
  ------------------
  |  Branch (2115:26): [True: 1.13M, False: 27.1k]
  ------------------
 2116|   495k|                s->match_length = MAX_MATCH - (uInt)(strend - scan);
  ------------------
  |  |   93|   495k|#define MAX_MATCH  258
  ------------------
 2117|   495k|                if (s->match_length > s->lookahead)
  ------------------
  |  Branch (2117:21): [True: 89, False: 495k]
  ------------------
 2118|     89|                    s->match_length = s->lookahead;
 2119|   495k|            }
 2120|  39.8M|            Assert(scan <= s->window + (uInt)(s->window_size - 1),
 2121|  39.8M|                   "wild scan");
 2122|  39.8M|        }
 2123|       |
 2124|       |        /* Emit match if have run of MIN_MATCH or longer, else emit literal */
 2125|  39.8M|        if (s->match_length >= MIN_MATCH) {
  ------------------
  |  |   92|  39.8M|#define MIN_MATCH  3
  ------------------
  |  Branch (2125:13): [True: 495k, False: 39.4M]
  ------------------
 2126|   495k|            check_match(s, s->strstart, s->strstart - 1, (int)s->match_length);
 2127|       |
 2128|   495k|            _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
  ------------------
  |  |  366|   495k|  { uch len = (uch)(length); \
  |  |  367|   495k|    ush dist = (ush)(distance); \
  |  |  368|   495k|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  369|   495k|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  370|   495k|    s->sym_buf[s->sym_next++] = len; \
  |  |  371|   495k|    dist--; \
  |  |  372|   495k|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|   495k|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   495k|#define Freq fc.freq
  |  |  ------------------
  |  |  373|   495k|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  321|   495k|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 495k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   495k|#define Freq fc.freq
  |  |  ------------------
  |  |  374|   495k|    flush = (s->sym_next == s->sym_end); \
  |  |  375|   495k|  }
  ------------------
 2129|       |
 2130|   495k|            s->lookahead -= s->match_length;
 2131|   495k|            s->strstart += s->match_length;
 2132|   495k|            s->match_length = 0;
 2133|  39.4M|        } else {
 2134|       |            /* No match, output a literal byte */
 2135|  39.4M|            Tracevv((stderr,"%c", s->window[s->strstart]));
 2136|  39.4M|            _tr_tally_lit(s, s->window[s->strstart], bflush);
  ------------------
  |  |  358|  39.4M|  { uch cc = (c); \
  |  |  359|  39.4M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  39.4M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  39.4M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  39.4M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  39.4M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  39.4M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  39.4M|   }
  ------------------
 2137|  39.4M|            s->lookahead--;
 2138|  39.4M|            s->strstart++;
 2139|  39.4M|        }
 2140|  39.8M|        if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1643|  2.25k|#define FLUSH_BLOCK(s, last) { \
  |  | 1644|  2.25k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1631|  2.25k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1632|  2.25k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1632:24): [True: 2.15k, False: 101]
  |  |  |  |  ------------------
  |  |  |  | 1633|  2.25k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1634|  2.25k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    101|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1635|  2.25k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1636|  2.25k|                (last)); \
  |  |  |  | 1637|  2.25k|   s->block_start = s->strstart; \
  |  |  |  | 1638|  2.25k|   flush_pending(s->strm); \
  |  |  |  | 1639|  2.25k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1640|  2.25k|}
  |  |  ------------------
  |  | 1645|  2.25k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1645:8): [True: 1.62k, False: 628]
  |  |  |  Branch (1645:40): [Folded, False: 1.62k]
  |  |  ------------------
  |  | 1646|  2.25k|}
  ------------------
  |  Branch (2140:13): [True: 2.25k, False: 39.8M]
  ------------------
 2141|  39.8M|    }
 2142|    922|    s->insert = 0;
 2143|    922|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|    922|#define Z_FINISH        4
  ------------------
  |  Branch (2143:9): [True: 922, False: 0]
  ------------------
 2144|    922|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1643|    922|#define FLUSH_BLOCK(s, last) { \
  |  | 1644|    922|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1631|    922|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1632|    922|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1632:24): [True: 895, False: 27]
  |  |  |  |  ------------------
  |  |  |  | 1633|    922|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1634|    922|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     27|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1635|    922|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1636|    922|                (last)); \
  |  |  |  | 1637|    922|   s->block_start = s->strstart; \
  |  |  |  | 1638|    922|   flush_pending(s->strm); \
  |  |  |  | 1639|    922|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1640|    922|}
  |  |  ------------------
  |  | 1645|    922|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1645:8): [True: 180, False: 742]
  |  |  |  Branch (1645:40): [True: 180, Folded]
  |  |  ------------------
  |  | 1646|    922|}
  ------------------
 2145|    742|        return finish_done;
 2146|    922|    }
 2147|      0|    if (s->sym_next)
  ------------------
  |  Branch (2147:9): [True: 0, False: 0]
  ------------------
 2148|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1643|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1644|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1631|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1632|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1632:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1633|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1634|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1635|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1636|      0|                (last)); \
  |  |  |  | 1637|      0|   s->block_start = s->strstart; \
  |  |  |  | 1638|      0|   flush_pending(s->strm); \
  |  |  |  | 1639|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1640|      0|}
  |  |  ------------------
  |  | 1645|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1645:8): [True: 0, False: 0]
  |  |  |  Branch (1645:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1646|      0|}
  ------------------
 2149|      0|    return block_done;
 2150|      0|}
deflate.c:deflate_huff:
 2156|  10.5k|local block_state deflate_huff(deflate_state *s, int flush) {
 2157|  10.5k|    int bflush;             /* set if current block must be flushed */
 2158|       |
 2159|  86.5M|    for (;;) {
 2160|       |        /* Make sure that we have a literal to write. */
 2161|  86.5M|        if (s->lookahead == 0) {
  ------------------
  |  Branch (2161:13): [True: 12.0k, False: 86.5M]
  ------------------
 2162|  12.0k|            fill_window(s);
 2163|  12.0k|            if (s->lookahead == 0) {
  ------------------
  |  Branch (2163:17): [True: 6.11k, False: 5.91k]
  ------------------
 2164|  6.11k|                if (flush == Z_NO_FLUSH)
  ------------------
  |  |  172|  6.11k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2164:21): [True: 5.21k, False: 907]
  ------------------
 2165|  5.21k|                    return need_more;
 2166|    907|                break;      /* flush the current block */
 2167|  6.11k|            }
 2168|  12.0k|        }
 2169|       |
 2170|       |        /* Output a literal byte */
 2171|  86.5M|        s->match_length = 0;
 2172|  86.5M|        Tracevv((stderr,"%c", s->window[s->strstart]));
 2173|  86.5M|        _tr_tally_lit(s, s->window[s->strstart], bflush);
  ------------------
  |  |  358|  86.5M|  { uch cc = (c); \
  |  |  359|  86.5M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  86.5M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  86.5M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  86.5M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  86.5M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  86.5M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  86.5M|   }
  ------------------
 2174|  86.5M|        s->lookahead--;
 2175|  86.5M|        s->strstart++;
 2176|  86.5M|        if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1643|  5.13k|#define FLUSH_BLOCK(s, last) { \
  |  | 1644|  5.13k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1631|  5.13k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1632|  5.13k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1632:24): [True: 5.13k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1633|  5.13k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1634|  5.13k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1635|  5.13k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1636|  5.13k|                (last)); \
  |  |  |  | 1637|  5.13k|   s->block_start = s->strstart; \
  |  |  |  | 1638|  5.13k|   flush_pending(s->strm); \
  |  |  |  | 1639|  5.13k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1640|  5.13k|}
  |  |  ------------------
  |  | 1645|  5.13k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1645:8): [True: 4.39k, False: 746]
  |  |  |  Branch (1645:40): [Folded, False: 4.39k]
  |  |  ------------------
  |  | 1646|  5.13k|}
  ------------------
  |  Branch (2176:13): [True: 5.13k, False: 86.5M]
  ------------------
 2177|  86.5M|    }
 2178|    907|    s->insert = 0;
 2179|    907|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|    907|#define Z_FINISH        4
  ------------------
  |  Branch (2179:9): [True: 907, False: 0]
  ------------------
 2180|    907|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1643|    907|#define FLUSH_BLOCK(s, last) { \
  |  | 1644|    907|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1631|    907|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1632|    907|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1632:24): [True: 907, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1633|    907|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1634|    907|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1635|    907|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1636|    907|                (last)); \
  |  |  |  | 1637|    907|   s->block_start = s->strstart; \
  |  |  |  | 1638|    907|   flush_pending(s->strm); \
  |  |  |  | 1639|    907|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1640|    907|}
  |  |  ------------------
  |  | 1645|    907|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1645:8): [True: 233, False: 674]
  |  |  |  Branch (1645:40): [True: 233, Folded]
  |  |  ------------------
  |  | 1646|    907|}
  ------------------
 2181|    674|        return finish_done;
 2182|    907|    }
 2183|      0|    if (s->sym_next)
  ------------------
  |  Branch (2183:9): [True: 0, False: 0]
  ------------------
 2184|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1643|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1644|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1631|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1632|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1632:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1633|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1634|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1635|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1636|      0|                (last)); \
  |  |  |  | 1637|      0|   s->block_start = s->strstart; \
  |  |  |  | 1638|      0|   flush_pending(s->strm); \
  |  |  |  | 1639|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1640|      0|}
  |  |  ------------------
  |  | 1645|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1645:8): [True: 0, False: 0]
  |  |  |  Branch (1645:40): [Folded, False: 0]
  |  |  ------------------
  |  | 1646|      0|}
  ------------------
 2185|      0|    return block_done;
 2186|      0|}

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

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

gzread:
  409|  11.1k|int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) {
  410|  11.1k|    gz_statep state;
  411|       |
  412|       |    /* get internal structure and check that it's for reading */
  413|  11.1k|    if (file == NULL)
  ------------------
  |  Branch (413:9): [True: 0, False: 11.1k]
  ------------------
  414|      0|        return -1;
  415|  11.1k|    state = (gz_statep)file;
  416|  11.1k|    if (state->mode != GZ_READ)
  ------------------
  |  |  174|  11.1k|#define GZ_READ 7247
  ------------------
  |  Branch (416:9): [True: 0, False: 11.1k]
  ------------------
  417|      0|        return -1;
  418|       |
  419|       |    /* check that there was no (serious) error */
  420|  11.1k|    if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again)
  ------------------
  |  |  181|  22.3k|#define Z_OK            0
  ------------------
                  if (state->err != Z_OK && state->err != Z_BUF_ERROR && !state->again)
  ------------------
  |  |  188|  11.1k|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (420:9): [True: 0, False: 11.1k]
  |  Branch (420:31): [True: 0, False: 0]
  |  Branch (420:60): [True: 0, False: 0]
  ------------------
  421|      0|        return -1;
  422|  11.1k|    if (state->again)
  ------------------
  |  Branch (422:9): [True: 0, False: 11.1k]
  ------------------
  423|      0|        gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  424|       |
  425|       |    /* since an int is returned, make sure len fits in one, otherwise return
  426|       |       with an error (this avoids a flaw in the interface) */
  427|  11.1k|    if ((int)len < 0) {
  ------------------
  |  Branch (427:9): [True: 0, False: 11.1k]
  ------------------
  428|      0|        gz_error(state, Z_STREAM_ERROR, "request does not fit in an int");
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  429|      0|        return -1;
  430|      0|    }
  431|       |
  432|       |    /* read len or fewer bytes to buf */
  433|  11.1k|    len = (unsigned)gz_read(state, buf, len);
  434|       |
  435|       |    /* check for an error */
  436|  11.1k|    if (len == 0) {
  ------------------
  |  Branch (436:9): [True: 3.74k, False: 7.40k]
  ------------------
  437|  3.74k|        if (state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  181|  7.48k|#define Z_OK            0
  ------------------
                      if (state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (437:13): [True: 0, False: 3.74k]
  |  Branch (437:35): [True: 0, False: 0]
  ------------------
  438|      0|            return -1;
  439|  3.74k|        if (state->again) {
  ------------------
  |  Branch (439:13): [True: 0, False: 3.74k]
  ------------------
  440|       |            /* non-blocking input stalled after some input was read, but no
  441|       |               uncompressed bytes were produced -- let the application know
  442|       |               this isn't EOF */
  443|      0|            gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
                          gz_error(state, Z_ERRNO, zstrerror());
  ------------------
  |  |  133|      0|#    define zstrerror() strerror(errno)
  ------------------
  444|      0|            return -1;
  445|      0|        }
  446|  3.74k|    }
  447|       |
  448|       |    /* return the number of bytes read */
  449|  11.1k|    return (int)len;
  450|  11.1k|}
gzclose_r:
  663|  3.74k|int ZEXPORT gzclose_r(gzFile file) {
  664|  3.74k|    int ret, err;
  665|  3.74k|    gz_statep state;
  666|       |
  667|       |    /* get internal structure and check that it's for reading */
  668|  3.74k|    if (file == NULL)
  ------------------
  |  Branch (668:9): [True: 0, False: 3.74k]
  ------------------
  669|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  670|  3.74k|    state = (gz_statep)file;
  671|  3.74k|    if (state->mode != GZ_READ)
  ------------------
  |  |  174|  3.74k|#define GZ_READ 7247
  ------------------
  |  Branch (671:9): [True: 0, False: 3.74k]
  ------------------
  672|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  673|       |
  674|       |    /* free memory and close file */
  675|  3.74k|    if (state->size) {
  ------------------
  |  Branch (675:9): [True: 3.74k, False: 0]
  ------------------
  676|  3.74k|        inflateEnd(&(state->strm));
  677|  3.74k|        free(state->out);
  678|  3.74k|        free(state->in);
  679|  3.74k|    }
  680|  3.74k|    err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
  ------------------
  |  |  188|  3.74k|#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|  7.48k|#define Z_OK            0
  ------------------
  |  Branch (680:11): [True: 0, False: 3.74k]
  ------------------
  681|  3.74k|    gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|  3.74k|#define Z_OK            0
  ------------------
  682|  3.74k|    free(state->path);
  683|  3.74k|    ret = close(state->fd);
  684|  3.74k|    free(state);
  685|  3.74k|    return ret ? Z_ERRNO : err;
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
  |  Branch (685:12): [True: 0, False: 3.74k]
  ------------------
  686|  3.74k|}
gzread.c:gz_read:
  327|  11.1k|local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) {
  328|  11.1k|    z_size_t got;
  329|  11.1k|    unsigned n;
  330|  11.1k|    int err;
  331|       |
  332|       |    /* if len is zero, avoid unnecessary operations */
  333|  11.1k|    if (len == 0)
  ------------------
  |  Branch (333:9): [True: 0, False: 11.1k]
  ------------------
  334|      0|        return 0;
  335|       |
  336|       |    /* process a skip request */
  337|  11.1k|    if (state->skip && gz_skip(state) == -1)
  ------------------
  |  Branch (337:9): [True: 0, False: 11.1k]
  |  Branch (337:24): [True: 0, False: 0]
  ------------------
  338|      0|        return 0;
  339|       |
  340|       |    /* get len bytes to buf, or less than len if at the end */
  341|  11.1k|    got = 0;
  342|  11.1k|    err = 0;
  343|  19.9k|    do {
  344|       |        /* set n to the maximum amount of len that fits in an unsigned int */
  345|  19.9k|        n = (unsigned)-1;
  346|  19.9k|        if (n > len)
  ------------------
  |  Branch (346:13): [True: 19.9k, False: 0]
  ------------------
  347|  19.9k|            n = (unsigned)len;
  348|       |
  349|       |        /* first just try copying data from the output buffer */
  350|  19.9k|        if (state->x.have) {
  ------------------
  |  Branch (350:13): [True: 3.74k, False: 16.2k]
  ------------------
  351|  3.74k|            if (state->x.have < n)
  ------------------
  |  Branch (351:17): [True: 3.74k, False: 0]
  ------------------
  352|  3.74k|                n = state->x.have;
  353|  3.74k|            memcpy(buf, state->x.next, n);
  354|  3.74k|            state->x.next += n;
  355|  3.74k|            state->x.have -= n;
  356|  3.74k|            if (state->err != Z_OK)
  ------------------
  |  |  181|  3.74k|#define Z_OK            0
  ------------------
  |  Branch (356:17): [True: 0, False: 3.74k]
  ------------------
  357|       |                /* caught deferred error from gz_fetch() */
  358|      0|                err = -1;
  359|  3.74k|        }
  360|       |
  361|       |        /* output buffer empty -- return if we're at the end of the input */
  362|  16.2k|        else if (state->eof && state->strm.avail_in == 0) {
  ------------------
  |  Branch (362:18): [True: 7.99k, False: 8.23k]
  |  Branch (362:32): [True: 7.47k, False: 522]
  ------------------
  363|  7.47k|            if (state->how == GZIP && state->err == Z_OK)
  ------------------
  |  |  181|  14.9k|#define GZIP 2      /* decompress a gzip stream */
  ------------------
                          if (state->how == GZIP && state->err == Z_OK)
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  |  Branch (363:17): [True: 0, False: 7.47k]
  |  Branch (363:39): [True: 0, False: 0]
  ------------------
  364|      0|                gz_error(state, Z_BUF_ERROR, "unexpected end of file");
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  365|  7.47k|            break;
  366|  7.47k|        }
  367|       |
  368|       |        /* need output data -- for small len or new stream load up our output
  369|       |           buffer, so that gzgetc() can be fast */
  370|  8.75k|        else if (state->how == LOOK || n < (state->size << 1)) {
  ------------------
  |  |  179|  17.5k|#define LOOK 0      /* look for a gzip header */
  ------------------
  |  Branch (370:18): [True: 3.76k, False: 4.99k]
  |  Branch (370:40): [True: 0, False: 4.99k]
  ------------------
  371|       |            /* get more output, looking for header if required */
  372|  3.76k|            if (gz_fetch(state) == -1 && state->x.have == 0)
  ------------------
  |  Branch (372:17): [True: 0, False: 3.76k]
  |  Branch (372:42): [True: 0, False: 0]
  ------------------
  373|       |                /* if state->x.have != 0, error will be caught after copy */
  374|      0|                err = -1;
  375|  3.76k|            continue;       /* no progress yet -- go back to copy above */
  376|       |            /* the copy above assures that we will leave with space in the
  377|       |               output buffer, allowing at least one gzungetc() to succeed */
  378|  3.76k|        }
  379|       |
  380|       |        /* large len -- read directly into user buffer */
  381|  4.99k|        else if (state->how == COPY)        /* read directly */
  ------------------
  |  |  180|  4.99k|#define COPY 1      /* copy input directly */
  ------------------
  |  Branch (381:18): [True: 0, False: 4.99k]
  ------------------
  382|      0|            err = gz_load(state, (unsigned char *)buf, n, &n);
  383|       |
  384|       |        /* large len -- decompress directly into user buffer */
  385|  4.99k|        else {  /* state->how == GZIP */
  386|  4.99k|            state->strm.avail_out = n;
  387|  4.99k|            state->strm.next_out = (unsigned char *)buf;
  388|  4.99k|            err = gz_decomp(state);
  389|  4.99k|            n = state->x.have;
  390|  4.99k|            state->x.have = 0;
  391|  4.99k|        }
  392|       |
  393|       |        /* update progress */
  394|  8.73k|        len -= n;
  395|  8.73k|        buf = (char *)buf + n;
  396|  8.73k|        got += n;
  397|  8.73k|        state->x.pos += n;
  398|  12.4k|    } while (len && !err);
  ------------------
  |  Branch (398:14): [True: 8.82k, False: 3.67k]
  |  Branch (398:21): [True: 8.82k, False: 0]
  ------------------
  399|       |
  400|       |    /* note read past eof */
  401|  11.1k|    if (len && state->eof)
  ------------------
  |  Branch (401:9): [True: 7.47k, False: 3.67k]
  |  Branch (401:16): [True: 7.47k, False: 0]
  ------------------
  402|  7.47k|        state->past = 1;
  403|       |
  404|       |    /* return number of bytes read into user buffer */
  405|  11.1k|    return got;
  406|  11.1k|}
gzread.c:gz_load:
   19|  20.1k|                  unsigned *have) {
   20|  20.1k|    int ret;
   21|  20.1k|    unsigned get, max = ((unsigned)-1 >> 2) + 1;
   22|       |
   23|  20.1k|    state->again = 0;
   24|  20.1k|    errno = 0;
   25|  20.1k|    *have = 0;
   26|  23.9k|    do {
   27|  23.9k|        get = len - *have;
   28|  23.9k|        if (get > max)
  ------------------
  |  Branch (28:13): [True: 0, False: 23.9k]
  ------------------
   29|      0|            get = max;
   30|  23.9k|        ret = (int)read(state->fd, buf + *have, get);
   31|  23.9k|        if (ret <= 0)
  ------------------
  |  Branch (31:13): [True: 3.74k, False: 20.1k]
  ------------------
   32|  3.74k|            break;
   33|  20.1k|        *have += (unsigned)ret;
   34|  20.1k|    } while (*have < len);
  ------------------
  |  Branch (34:14): [True: 3.72k, False: 16.4k]
  ------------------
   35|  20.1k|    if (ret < 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 20.1k]
  ------------------
   36|      0|        if (BLOCKED(errno)) {
  ------------------
  |  |  141|      0|#    define BLOCKED(e) ((e) == EAGAIN || (e) == EWOULDBLOCK)
  |  |  ------------------
  |  |  |  Branch (141:25): [True: 0, False: 0]
  |  |  |  Branch (141: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());
  ------------------
  |  |  133|      0|#    define zstrerror() strerror(errno)
  ------------------
   42|      0|        return -1;
   43|      0|    }
   44|  20.1k|    if (ret == 0)
  ------------------
  |  Branch (44:9): [True: 3.74k, False: 16.4k]
  ------------------
   45|  3.74k|        state->eof = 1;
   46|  20.1k|    return 0;
   47|  20.1k|}
gzread.c:gz_decomp:
  187|  8.73k|local int gz_decomp(gz_statep state) {
  188|  8.73k|    int ret = Z_OK;
  ------------------
  |  |  181|  8.73k|#define Z_OK            0
  ------------------
  189|  8.73k|    unsigned had;
  190|  8.73k|    z_streamp strm = &(state->strm);
  191|       |
  192|       |    /* fill output buffer up to end of deflate stream */
  193|  8.73k|    had = strm->avail_out;
  194|  25.1k|    do {
  195|       |        /* get more input for inflate() */
  196|  25.1k|        if (strm->avail_in == 0 && gz_avail(state) == -1) {
  ------------------
  |  Branch (196:13): [True: 16.4k, False: 8.71k]
  |  Branch (196:36): [True: 0, False: 16.4k]
  ------------------
  197|      0|            ret = state->err;
  198|      0|            break;
  199|      0|        }
  200|  25.1k|        if (strm->avail_in == 0) {
  ------------------
  |  Branch (200:13): [True: 0, False: 25.1k]
  ------------------
  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|  25.1k|        ret = inflate(strm, Z_NO_FLUSH);
  ------------------
  |  |  172|  25.1k|#define Z_NO_FLUSH      0
  ------------------
  208|  25.1k|        if (strm->avail_out < had)
  ------------------
  |  Branch (208:13): [True: 25.1k, False: 14]
  ------------------
  209|       |            /* any decompressed data marks this as a real gzip stream */
  210|  25.1k|            state->junk = 0;
  211|  25.1k|        if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
  ------------------
  |  |  185|  50.2k|#define Z_STREAM_ERROR (-2)
  ------------------
                      if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
  ------------------
  |  |  183|  25.1k|#define Z_NEED_DICT     2
  ------------------
  |  Branch (211:13): [True: 0, False: 25.1k]
  |  Branch (211:38): [True: 0, False: 25.1k]
  ------------------
  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|  25.1k|        if (ret == Z_MEM_ERROR) {
  ------------------
  |  |  187|  25.1k|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (216:13): [True: 0, False: 25.1k]
  ------------------
  217|      0|            gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  218|      0|            break;
  219|      0|        }
  220|  25.1k|        if (ret == Z_DATA_ERROR) {              /* deflate stream invalid */
  ------------------
  |  |  186|  25.1k|#define Z_DATA_ERROR   (-3)
  ------------------
  |  Branch (220:13): [True: 0, False: 25.1k]
  ------------------
  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;
  ------------------
  |  |  179|      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|  25.1k|    } while (strm->avail_out && ret != Z_STREAM_END);
  ------------------
  |  |  182|  20.1k|#define Z_STREAM_END    1
  ------------------
  |  Branch (232:14): [True: 20.1k, False: 5.00k]
  |  Branch (232:33): [True: 16.3k, False: 3.73k]
  ------------------
  233|       |
  234|       |    /* update available output */
  235|  8.73k|    state->x.have = had - strm->avail_out;
  236|  8.73k|    state->x.next = strm->next_out - state->x.have;
  237|       |
  238|       |    /* if the gzip stream completed successfully, look for another */
  239|  8.73k|    if (ret == Z_STREAM_END) {
  ------------------
  |  |  182|  8.73k|#define Z_STREAM_END    1
  ------------------
  |  Branch (239:9): [True: 3.74k, False: 4.99k]
  ------------------
  240|  3.74k|        state->junk = 0;
  241|  3.74k|        state->how = LOOK;
  ------------------
  |  |  179|  3.74k|#define LOOK 0      /* look for a gzip header */
  ------------------
  242|  3.74k|        return 0;
  243|  3.74k|    }
  244|       |
  245|       |    /* return decompression status */
  246|  4.99k|    return ret != Z_OK ? -1 : 0;
  ------------------
  |  |  181|  4.99k|#define Z_OK            0
  ------------------
  |  Branch (246:12): [True: 0, False: 4.99k]
  ------------------
  247|  8.73k|}
gzread.c:gz_avail:
   56|  20.1k|local int gz_avail(gz_statep state) {
   57|  20.1k|    unsigned got;
   58|  20.1k|    z_streamp strm = &(state->strm);
   59|       |
   60|  20.1k|    if (state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  181|  40.3k|#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: 20.1k]
  |  Branch (60:31): [True: 0, False: 0]
  ------------------
   61|      0|        return -1;
   62|  20.1k|    if (state->eof == 0) {
  ------------------
  |  Branch (62:9): [True: 20.1k, False: 0]
  ------------------
   63|  20.1k|        if (strm->avail_in) {       /* copy what's there to the start */
  ------------------
  |  Branch (63:13): [True: 0, False: 20.1k]
  ------------------
   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|  20.1k|        if (gz_load(state, state->in + strm->avail_in,
  ------------------
  |  Branch (75:13): [True: 0, False: 20.1k]
  ------------------
   76|  20.1k|                    state->size - strm->avail_in, &got) == -1)
   77|      0|            return -1;
   78|  20.1k|        strm->avail_in += got;
   79|  20.1k|        strm->next_in = state->in;
   80|  20.1k|    }
   81|  20.1k|    return 0;
   82|  20.1k|}
gzread.c:gz_look:
   93|  3.76k|local int gz_look(gz_statep state) {
   94|  3.76k|    z_streamp strm = &(state->strm);
   95|       |
   96|       |    /* allocate read buffers and inflate memory */
   97|  3.76k|    if (state->size == 0) {
  ------------------
  |  Branch (97:9): [True: 3.74k, False: 22]
  ------------------
   98|       |        /* allocate buffers */
   99|  3.74k|        state->in = (unsigned char *)malloc(state->want);
  100|  3.74k|        state->out = (unsigned char *)malloc(state->want << 1);
  101|  3.74k|        if (state->in == NULL || state->out == NULL) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.74k]
  |  Branch (101:34): [True: 0, False: 3.74k]
  ------------------
  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|  3.74k|        state->size = state->want;
  108|       |
  109|       |        /* allocate inflate memory */
  110|  3.74k|        state->strm.zalloc = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  111|  3.74k|        state->strm.zfree = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  112|  3.74k|        state->strm.opaque = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  113|  3.74k|        state->strm.avail_in = 0;
  114|  3.74k|        state->strm.next_in = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  115|  3.74k|        if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */
  ------------------
  |  | 1942|  3.74k|          inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
  |  |  ------------------
  |  |  |  |   44|  3.74k|#define ZLIB_VERSION "1.3.2.1-motley"
  |  |  ------------------
  |  | 1943|  3.74k|                        (int)sizeof(z_stream))
  ------------------
                      if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */
  ------------------
  |  |  181|  3.74k|#define Z_OK            0
  ------------------
  |  Branch (115:13): [True: 0, False: 3.74k]
  ------------------
  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|  3.74k|    }
  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|  3.76k|    if (state->direct == -1 || state->junk == 0) {
  ------------------
  |  Branch (127:9): [True: 0, False: 3.76k]
  |  Branch (127:32): [True: 22, False: 3.74k]
  ------------------
  128|       |        /* wait for input before committing to another gzip member */
  129|     22|        if (state->junk == 0 && strm->avail_in == 0) {
  ------------------
  |  Branch (129:13): [True: 22, False: 0]
  |  Branch (129:33): [True: 22, False: 0]
  ------------------
  130|     22|            if (gz_avail(state) == -1)
  ------------------
  |  Branch (130:17): [True: 0, False: 22]
  ------------------
  131|      0|                return -1;
  132|     22|            if (strm->avail_in == 0)
  ------------------
  |  Branch (132:17): [True: 22, False: 0]
  ------------------
  133|     22|                return 0;
  134|     22|        }
  135|      0|        inflateReset(strm);
  136|      0|        state->how = GZIP;
  ------------------
  |  |  181|      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|     22|    }
  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|  3.74k|    if (gz_avail(state) == -1)
  ------------------
  |  Branch (148:9): [True: 0, False: 3.74k]
  ------------------
  149|      0|        return -1;
  150|  3.74k|    if (strm->avail_in == 0 || (state->again && strm->avail_in < 4))
  ------------------
  |  Branch (150:9): [True: 0, False: 3.74k]
  |  Branch (150:33): [True: 0, False: 3.74k]
  |  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|  3.74k|    if (strm->avail_in > 3 &&
  ------------------
  |  Branch (158:9): [True: 3.74k, False: 0]
  ------------------
  159|  3.74k|            strm->next_in[0] == 31 && strm->next_in[1] == 139 &&
  ------------------
  |  Branch (159:13): [True: 3.74k, False: 0]
  |  Branch (159:39): [True: 3.74k, False: 0]
  ------------------
  160|  3.74k|            strm->next_in[2] == 8 && strm->next_in[3] < 32) {
  ------------------
  |  Branch (160:13): [True: 3.74k, False: 0]
  |  Branch (160:38): [True: 3.74k, False: 0]
  ------------------
  161|  3.74k|        inflateReset(strm);
  162|  3.74k|        state->how = GZIP;
  ------------------
  |  |  181|  3.74k|#define GZIP 2      /* decompress a gzip stream */
  ------------------
  163|  3.74k|        state->junk = 1;
  164|  3.74k|        state->direct = 0;
  165|  3.74k|        return 0;
  166|  3.74k|    }
  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;
  ------------------
  |  |  180|      0|#define COPY 1      /* copy input directly */
  ------------------
  176|      0|    return 0;
  177|  3.74k|}
gzread.c:gz_fetch:
  255|  3.76k|local int gz_fetch(gz_statep state) {
  256|  3.76k|    z_streamp strm = &(state->strm);
  257|       |
  258|  7.50k|    do {
  259|  7.50k|        switch(state->how) {
  260|  3.76k|        case LOOK:      /* -> LOOK, COPY (only if never GZIP), or GZIP */
  ------------------
  |  |  179|  3.76k|#define LOOK 0      /* look for a gzip header */
  ------------------
  |  Branch (260:9): [True: 3.76k, False: 3.74k]
  ------------------
  261|  3.76k|            if (gz_look(state) == -1)
  ------------------
  |  Branch (261:17): [True: 0, False: 3.76k]
  ------------------
  262|      0|                return -1;
  263|  3.76k|            if (state->how == LOOK)
  ------------------
  |  |  179|  3.76k|#define LOOK 0      /* look for a gzip header */
  ------------------
  |  Branch (263:17): [True: 22, False: 3.74k]
  ------------------
  264|     22|                return 0;
  265|  3.74k|            break;
  266|  3.74k|        case COPY:      /* -> COPY */
  ------------------
  |  |  180|      0|#define COPY 1      /* copy input directly */
  ------------------
  |  Branch (266:9): [True: 0, False: 7.50k]
  ------------------
  267|      0|            if (gz_load(state, state->out, state->size << 1, &(state->x.have))
  ------------------
  |  Branch (267:17): [True: 0, False: 0]
  ------------------
  268|      0|                    == -1)
  269|      0|                return -1;
  270|      0|            state->x.next = state->out;
  271|      0|            return 0;
  272|  3.74k|        case GZIP:      /* -> GZIP or LOOK (if end of gzip stream) */
  ------------------
  |  |  181|  3.74k|#define GZIP 2      /* decompress a gzip stream */
  ------------------
  |  Branch (272:9): [True: 3.74k, False: 3.76k]
  ------------------
  273|  3.74k|            strm->avail_out = state->size << 1;
  274|  3.74k|            strm->next_out = state->out;
  275|  3.74k|            if (gz_decomp(state) == -1)
  ------------------
  |  Branch (275:17): [True: 0, False: 3.74k]
  ------------------
  276|      0|                return -1;
  277|  3.74k|            break;
  278|  3.74k|        default:
  ------------------
  |  Branch (278:9): [True: 0, False: 7.50k]
  ------------------
  279|      0|            gz_error(state, Z_STREAM_ERROR, "state corrupt");
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  280|      0|            return -1;
  281|  7.50k|        }
  282|  7.50k|    } while (state->x.have == 0 && (!state->eof || strm->avail_in));
  ------------------
  |  Branch (282:14): [True: 3.74k, False: 3.74k]
  |  Branch (282:37): [True: 1.69k, False: 2.04k]
  |  Branch (282:52): [True: 2.04k, False: 0]
  ------------------
  283|  3.74k|    return 0;
  284|  3.76k|}

gzwrite:
  258|  16.1k|int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len) {
  259|  16.1k|    gz_statep state;
  260|       |
  261|       |    /* get internal structure */
  262|  16.1k|    if (file == NULL)
  ------------------
  |  Branch (262:9): [True: 0, False: 16.1k]
  ------------------
  263|      0|        return 0;
  264|  16.1k|    state = (gz_statep)file;
  265|       |
  266|       |    /* check that we're writing and that there's no (serious) error */
  267|  16.1k|    if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
  ------------------
  |  |  175|  32.2k|#define GZ_WRITE 31153
  ------------------
                  if (state->mode != GZ_WRITE || (state->err != Z_OK && !state->again))
  ------------------
  |  |  181|  32.2k|#define Z_OK            0
  ------------------
  |  Branch (267:9): [True: 0, False: 16.1k]
  |  Branch (267:37): [True: 0, False: 16.1k]
  |  Branch (267:59): [True: 0, False: 0]
  ------------------
  268|      0|        return 0;
  269|  16.1k|    gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|  16.1k|#define Z_OK            0
  ------------------
  270|       |
  271|       |    /* since an int is returned, make sure len fits in one, otherwise return
  272|       |       with an error (this avoids a flaw in the interface) */
  273|  16.1k|    if ((int)len < 0) {
  ------------------
  |  Branch (273:9): [True: 0, False: 16.1k]
  ------------------
  274|      0|        gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
  275|      0|        return 0;
  276|      0|    }
  277|       |
  278|       |    /* write len bytes from buf (the return value will fit in an int) */
  279|  16.1k|    return (int)gz_write(state, buf, len);
  280|  16.1k|}
gzclose_w:
  689|  3.74k|int ZEXPORT gzclose_w(gzFile file) {
  690|  3.74k|    int ret = Z_OK;
  ------------------
  |  |  181|  3.74k|#define Z_OK            0
  ------------------
  691|  3.74k|    gz_statep state;
  692|       |
  693|       |    /* get internal structure */
  694|  3.74k|    if (file == NULL)
  ------------------
  |  Branch (694:9): [True: 0, False: 3.74k]
  ------------------
  695|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  696|  3.74k|    state = (gz_statep)file;
  697|       |
  698|       |    /* check that we're writing */
  699|  3.74k|    if (state->mode != GZ_WRITE)
  ------------------
  |  |  175|  3.74k|#define GZ_WRITE 31153
  ------------------
  |  Branch (699:9): [True: 0, False: 3.74k]
  ------------------
  700|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  701|       |
  702|       |    /* check for seek request */
  703|  3.74k|    if (state->skip && gz_zero(state) == -1)
  ------------------
  |  Branch (703:9): [True: 0, False: 3.74k]
  |  Branch (703:24): [True: 0, False: 0]
  ------------------
  704|      0|        ret = state->err;
  705|       |
  706|       |    /* flush, free memory, and close file */
  707|  3.74k|    if (gz_comp(state, Z_FINISH) == -1)
  ------------------
  |  |  176|  3.74k|#define Z_FINISH        4
  ------------------
  |  Branch (707:9): [True: 0, False: 3.74k]
  ------------------
  708|      0|        ret = state->err;
  709|  3.74k|    if (state->size) {
  ------------------
  |  Branch (709:9): [True: 3.74k, False: 0]
  ------------------
  710|  3.74k|        if (!state->direct) {
  ------------------
  |  Branch (710:13): [True: 3.74k, False: 0]
  ------------------
  711|  3.74k|            (void)deflateEnd(&(state->strm));
  712|  3.74k|            free(state->out);
  713|  3.74k|        }
  714|  3.74k|        free(state->in);
  715|  3.74k|    }
  716|  3.74k|    gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|  3.74k|#define Z_OK            0
  ------------------
  717|  3.74k|    free(state->path);
  718|  3.74k|    if (close(state->fd) == -1)
  ------------------
  |  Branch (718:9): [True: 0, False: 3.74k]
  ------------------
  719|      0|        ret = Z_ERRNO;
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
  720|  3.74k|    free(state);
  721|  3.74k|    return ret;
  722|  3.74k|}
gzwrite.c:gz_write:
  188|  16.1k|local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
  189|  16.1k|    z_size_t put = len;
  190|  16.1k|    int ret;
  191|       |
  192|       |    /* if len is zero, avoid unnecessary operations */
  193|  16.1k|    if (len == 0)
  ------------------
  |  Branch (193:9): [True: 0, False: 16.1k]
  ------------------
  194|      0|        return 0;
  195|       |
  196|       |    /* allocate memory if this is the first time through */
  197|  16.1k|    if (state->size == 0 && gz_init(state) == -1)
  ------------------
  |  Branch (197:9): [True: 3.74k, False: 12.3k]
  |  Branch (197:29): [True: 0, False: 3.74k]
  ------------------
  198|      0|        return 0;
  199|       |
  200|       |    /* check for seek request */
  201|  16.1k|    if (state->skip && gz_zero(state) == -1)
  ------------------
  |  Branch (201:9): [True: 0, False: 16.1k]
  |  Branch (201:24): [True: 0, False: 0]
  ------------------
  202|      0|        return 0;
  203|       |
  204|       |    /* for small len, copy to input buffer, otherwise compress directly */
  205|  16.1k|    if (len < state->size) {
  ------------------
  |  Branch (205:9): [True: 2.86k, False: 13.2k]
  ------------------
  206|       |        /* copy to input buffer, compress when full */
  207|  2.86k|        for (;;) {
  208|  2.86k|            unsigned have, copy;
  209|       |
  210|  2.86k|            if (state->strm.avail_in == 0)
  ------------------
  |  Branch (210:17): [True: 2.86k, False: 0]
  ------------------
  211|  2.86k|                state->strm.next_in = state->in;
  212|  2.86k|            have = (unsigned)((state->strm.next_in + state->strm.avail_in) -
  213|  2.86k|                              state->in);
  214|  2.86k|            copy = state->size - have;
  215|  2.86k|            if (copy > len)
  ------------------
  |  Branch (215:17): [True: 2.86k, False: 0]
  ------------------
  216|  2.86k|                copy = (unsigned)len;
  217|  2.86k|            memcpy(state->in + have, buf, copy);
  218|  2.86k|            state->strm.avail_in += copy;
  219|  2.86k|            state->x.pos += copy;
  220|  2.86k|            buf = (const char *)buf + copy;
  221|  2.86k|            len -= copy;
  222|  2.86k|            if (len == 0)
  ------------------
  |  Branch (222:17): [True: 2.86k, False: 0]
  ------------------
  223|  2.86k|                break;
  224|      0|            if (gz_comp(state, Z_NO_FLUSH) == -1)
  ------------------
  |  |  172|      0|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (224:17): [True: 0, False: 0]
  ------------------
  225|      0|                return state->again ? put - len : 0;
  ------------------
  |  Branch (225:24): [True: 0, False: 0]
  ------------------
  226|      0|        }
  227|  2.86k|    }
  228|  13.2k|    else {
  229|       |        /* consume whatever's left in the input buffer */
  230|  13.2k|        if (state->strm.avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
  ------------------
  |  |  172|      0|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (230:13): [True: 0, False: 13.2k]
  |  Branch (230:37): [True: 0, False: 0]
  ------------------
  231|      0|            return 0;
  232|       |
  233|       |        /* directly compress user buffer to file */
  234|  13.2k|        state->strm.next_in = (z_const Bytef *)buf;
  235|  13.2k|        do {
  236|  13.2k|            unsigned n = (unsigned)-1;
  237|       |
  238|  13.2k|            if (n > len)
  ------------------
  |  Branch (238:17): [True: 13.2k, False: 0]
  ------------------
  239|  13.2k|                n = (unsigned)len;
  240|  13.2k|            state->strm.avail_in = n;
  241|  13.2k|            ret = gz_comp(state, Z_NO_FLUSH);
  ------------------
  |  |  172|  13.2k|#define Z_NO_FLUSH      0
  ------------------
  242|  13.2k|            n -= state->strm.avail_in;
  243|  13.2k|            state->x.pos += n;
  244|  13.2k|            len -= n;
  245|  13.2k|            if (ret == -1) {
  ------------------
  |  Branch (245:17): [True: 0, False: 13.2k]
  ------------------
  246|      0|                state->strm.avail_in = 0;
  247|      0|                state->strm.next_in = state->in;
  248|      0|                return state->again ? put - len : 0;
  ------------------
  |  Branch (248:24): [True: 0, False: 0]
  ------------------
  249|      0|            }
  250|  13.2k|        } while (len);
  ------------------
  |  Branch (250:18): [True: 0, False: 13.2k]
  ------------------
  251|  13.2k|    }
  252|       |
  253|       |    /* input was all buffered or compressed */
  254|  16.1k|    return put;
  255|  16.1k|}
gzwrite.c:gz_init:
   11|  3.74k|local int gz_init(gz_statep state) {
   12|  3.74k|    int ret;
   13|  3.74k|    z_streamp strm = &(state->strm);
   14|       |
   15|       |    /* allocate input buffer (double size for gzprintf) */
   16|  3.74k|    state->in = (unsigned char *)malloc(state->want << 1);
   17|  3.74k|    if (state->in == NULL) {
  ------------------
  |  Branch (17:9): [True: 0, False: 3.74k]
  ------------------
   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|  3.74k|    if (!state->direct) {
  ------------------
  |  Branch (23:9): [True: 3.74k, False: 0]
  ------------------
   24|       |        /* allocate output buffer */
   25|  3.74k|        state->out = (unsigned char *)malloc(state->want);
   26|  3.74k|        if (state->out == NULL) {
  ------------------
  |  Branch (26:13): [True: 0, False: 3.74k]
  ------------------
   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|  3.74k|        strm->zalloc = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   34|  3.74k|        strm->zfree = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   35|  3.74k|        strm->opaque = Z_NULL;
  ------------------
  |  |  216|  3.74k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   36|  3.74k|        ret = deflateInit2(strm, state->level, Z_DEFLATED,
  ------------------
  |  | 1939|  3.74k|          deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
  |  | 1940|  3.74k|                        (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
  |  |  ------------------
  |  |  |  |   44|  3.74k|#define ZLIB_VERSION "1.3.2.1-motley"
  |  |  ------------------
  ------------------
   37|  3.74k|                           MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
   38|  3.74k|        if (ret != Z_OK) {
  ------------------
  |  |  181|  3.74k|#define Z_OK            0
  ------------------
  |  Branch (38:13): [True: 0, False: 3.74k]
  ------------------
   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|  3.74k|        strm->next_in = NULL;
   45|  3.74k|    }
   46|       |
   47|       |    /* mark state as initialized */
   48|  3.74k|    state->size = state->want;
   49|       |
   50|       |    /* initialize write buffer if compressing */
   51|  3.74k|    if (!state->direct) {
  ------------------
  |  Branch (51:9): [True: 3.74k, False: 0]
  ------------------
   52|  3.74k|        strm->avail_out = state->size;
   53|  3.74k|        strm->next_out = state->out;
   54|  3.74k|        state->x.next = strm->next_out;
   55|  3.74k|    }
   56|  3.74k|    return 0;
   57|  3.74k|}
gzwrite.c:gz_comp:
   65|  16.9k|local int gz_comp(gz_statep state, int flush) {
   66|  16.9k|    int ret, writ;
   67|  16.9k|    unsigned have, put, max = ((unsigned)-1 >> 2) + 1;
   68|  16.9k|    z_streamp strm = &(state->strm);
   69|       |
   70|       |    /* allocate memory if this is the first time through */
   71|  16.9k|    if (state->size == 0 && gz_init(state) == -1)
  ------------------
  |  Branch (71:9): [True: 0, False: 16.9k]
  |  Branch (71:29): [True: 0, False: 0]
  ------------------
   72|      0|        return -1;
   73|       |
   74|       |    /* write directly if requested */
   75|  16.9k|    if (state->direct) {
  ------------------
  |  Branch (75:9): [True: 0, False: 16.9k]
  ------------------
   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))
  ------------------
  |  |  141|      0|#    define BLOCKED(e) ((e) == EAGAIN || (e) == EWOULDBLOCK)
  |  |  ------------------
  |  |  |  Branch (141:25): [True: 0, False: 0]
  |  |  |  Branch (141: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());
  ------------------
  |  |  133|      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|  16.9k|    if (state->reset) {
  ------------------
  |  Branch (94:9): [True: 0, False: 16.9k]
  ------------------
   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|  16.9k|    ret = Z_OK;
  ------------------
  |  |  181|  16.9k|#define Z_OK            0
  ------------------
  105|  47.6k|    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|  47.6k|        if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
  ------------------
  |  |  172|  62.5k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (108:13): [True: 16.4k, False: 31.2k]
  |  Branch (108:38): [True: 7.46k, False: 23.7k]
  ------------------
  109|  20.1k|            (flush != Z_FINISH || ret == Z_STREAM_END))) {
  ------------------
  |  |  176|  14.9k|#define Z_FINISH        4
  ------------------
                          (flush != Z_FINISH || ret == Z_STREAM_END))) {
  ------------------
  |  |  182|  7.46k|#define Z_STREAM_END    1
  ------------------
  |  Branch (109:14): [True: 0, False: 7.46k]
  |  Branch (109:35): [True: 3.72k, False: 3.74k]
  ------------------
  110|  40.3k|            while (strm->next_out > state->x.next) {
  ------------------
  |  Branch (110:20): [True: 20.1k, False: 20.1k]
  ------------------
  111|  20.1k|                errno = 0;
  112|  20.1k|                state->again = 0;
  113|  20.1k|                put = strm->next_out - state->x.next > (int)max ? max :
  ------------------
  |  Branch (113:23): [True: 0, False: 20.1k]
  ------------------
  114|  20.1k|                      (unsigned)(strm->next_out - state->x.next);
  115|  20.1k|                writ = (int)write(state->fd, state->x.next, put);
  116|  20.1k|                if (writ < 0) {
  ------------------
  |  Branch (116:21): [True: 0, False: 20.1k]
  ------------------
  117|      0|                    if (BLOCKED(errno))
  ------------------
  |  |  141|      0|#    define BLOCKED(e) ((e) == EAGAIN || (e) == EWOULDBLOCK)
  |  |  ------------------
  |  |  |  Branch (141:25): [True: 0, False: 0]
  |  |  |  Branch (141: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());
  ------------------
  |  |  133|      0|#    define zstrerror() strerror(errno)
  ------------------
  120|      0|                    return -1;
  121|      0|                }
  122|  20.1k|                state->x.next += writ;
  123|  20.1k|            }
  124|  20.1k|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (124:17): [True: 16.4k, False: 3.72k]
  ------------------
  125|  16.4k|                strm->avail_out = state->size;
  126|  16.4k|                strm->next_out = state->out;
  127|  16.4k|                state->x.next = state->out;
  128|  16.4k|            }
  129|  20.1k|        }
  130|       |
  131|       |        /* compress */
  132|  47.6k|        have = strm->avail_out;
  133|  47.6k|        ret = deflate(strm, flush);
  134|  47.6k|        if (ret == Z_STREAM_ERROR) {
  ------------------
  |  |  185|  47.6k|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (134:13): [True: 0, False: 47.6k]
  ------------------
  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|  47.6k|        have -= strm->avail_out;
  140|  47.6k|    } while (have);
  ------------------
  |  Branch (140:14): [True: 30.6k, False: 16.9k]
  ------------------
  141|       |
  142|       |    /* if that completed a deflate stream, allow another to start */
  143|  16.9k|    if (flush == Z_FINISH)
  ------------------
  |  |  176|  16.9k|#define Z_FINISH        4
  ------------------
  |  Branch (143:9): [True: 3.74k, False: 13.2k]
  ------------------
  144|  3.74k|        state->reset = 1;
  145|       |
  146|       |    /* all done, no errors */
  147|  16.9k|    return 0;
  148|  16.9k|}

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

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

inflate_table:
   48|  26.0k|                                unsigned FAR *bits, unsigned short FAR *work) {
   49|  26.0k|    unsigned len;               /* a code's length in bits */
   50|  26.0k|    unsigned sym;               /* index of code symbols */
   51|  26.0k|    unsigned min, max;          /* minimum and maximum code lengths */
   52|  26.0k|    unsigned root;              /* number of index bits for root table */
   53|  26.0k|    unsigned curr;              /* number of index bits for current table */
   54|  26.0k|    unsigned drop;              /* code bits to drop for sub-table */
   55|  26.0k|    int left;                   /* number of prefix codes available */
   56|  26.0k|    unsigned used;              /* code entries in table used */
   57|  26.0k|    unsigned huff;              /* Huffman code */
   58|  26.0k|    unsigned incr;              /* for incrementing code, index */
   59|  26.0k|    unsigned fill;              /* index for replicating entries */
   60|  26.0k|    unsigned low;               /* low bits for current root entry */
   61|  26.0k|    unsigned mask;              /* mask for low root bits */
   62|  26.0k|    code here;                  /* table entry for duplication */
   63|  26.0k|    code FAR *next;             /* next available space in table */
   64|  26.0k|    const unsigned short FAR *base = NULL;  /* base value table to use */
   65|  26.0k|    const unsigned short FAR *extra = NULL; /* extra bits table to use */
   66|  26.0k|    unsigned match = 0;         /* use base and extra for symbol >= match */
   67|  26.0k|    unsigned short count[MAXBITS+1];    /* number of codes of each length */
   68|  26.0k|    unsigned short offs[MAXBITS+1];     /* offsets in table for each length */
   69|  26.0k|    static const unsigned short lbase[31] = { /* Length codes 257..285 base */
   70|  26.0k|        3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
   71|  26.0k|        35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
   72|  26.0k|    static const unsigned short lext[31] = { /* Length codes 257..285 extra */
   73|  26.0k|        16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
   74|  26.0k|        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 68, 193};
   75|  26.0k|    static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
   76|  26.0k|        1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
   77|  26.0k|        257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
   78|  26.0k|        8193, 12289, 16385, 24577, 0, 0};
   79|  26.0k|    static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
   80|  26.0k|        16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
   81|  26.0k|        23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
   82|  26.0k|        28, 28, 29, 29, 64, 64};
   83|       |
   84|       |    /*
   85|       |       Process a set of code lengths to create a canonical Huffman code.  The
   86|       |       code lengths are lens[0..codes-1].  Each length corresponds to the
   87|       |       symbols 0..codes-1.  The Huffman code is generated by first sorting the
   88|       |       symbols by length from short to long, and retaining the symbol order
   89|       |       for codes with equal lengths.  Then the code starts with all zero bits
   90|       |       for the first code of the shortest length, and the codes are integer
   91|       |       increments for the same length, and zeros are appended as the length
   92|       |       increases.  For the deflate format, these bits are stored backwards
   93|       |       from their more natural integer increment ordering, and so when the
   94|       |       decoding tables are built in the large loop below, the integer codes
   95|       |       are incremented backwards.
   96|       |
   97|       |       This routine assumes, but does not check, that all of the entries in
   98|       |       lens[] are in the range 0..MAXBITS.  The caller must assure this.
   99|       |       1..MAXBITS is interpreted as that code length.  zero means that that
  100|       |       symbol does not occur in this code.
  101|       |
  102|       |       The codes are sorted by computing a count of codes for each length,
  103|       |       creating from that a table of starting indices for each length in the
  104|       |       sorted table, and then entering the symbols in order in the sorted
  105|       |       table.  The sorted table is work[], with that space being provided by
  106|       |       the caller.
  107|       |
  108|       |       The length counts are used for other purposes as well, i.e. finding
  109|       |       the minimum and maximum length codes, determining if there are any
  110|       |       codes at all, checking for a valid set of lengths, and looking ahead
  111|       |       at length counts to determine sub-table sizes when building the
  112|       |       decoding tables.
  113|       |     */
  114|       |
  115|       |    /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
  116|   442k|    for (len = 0; len <= MAXBITS; len++)
  ------------------
  |  |   23|   442k|#define MAXBITS 15
  ------------------
  |  Branch (116:19): [True: 416k, False: 26.0k]
  ------------------
  117|   416k|        count[len] = 0;
  118|  2.57M|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (118:19): [True: 2.54M, False: 26.0k]
  ------------------
  119|  2.54M|        count[lens[sym]]++;
  120|       |
  121|       |    /* bound code lengths, force root to be within code lengths */
  122|  26.0k|    root = *bits;
  123|   254k|    for (max = MAXBITS; max >= 1; max--)
  ------------------
  |  |   23|  26.0k|#define MAXBITS 15
  ------------------
  |  Branch (123:25): [True: 254k, False: 0]
  ------------------
  124|   254k|        if (count[max] != 0) break;
  ------------------
  |  Branch (124:13): [True: 26.0k, False: 228k]
  ------------------
  125|  26.0k|    if (root > max) root = max;
  ------------------
  |  Branch (125:9): [True: 14.2k, False: 11.7k]
  ------------------
  126|  26.0k|    if (max == 0) {                     /* no symbols to code at all */
  ------------------
  |  Branch (126:9): [True: 0, False: 26.0k]
  ------------------
  127|      0|        here.op = (unsigned char)64;    /* invalid code marker */
  128|      0|        here.bits = (unsigned char)1;
  129|      0|        here.val = (unsigned short)0;
  130|      0|        *(*table)++ = here;             /* make a table to force an error */
  131|      0|        *(*table)++ = here;
  132|      0|        *bits = 1;
  133|      0|        return 0;     /* no symbols, but wait for decoding to report error */
  134|      0|    }
  135|  57.8k|    for (min = 1; min < max; min++)
  ------------------
  |  Branch (135:19): [True: 50.6k, False: 7.16k]
  ------------------
  136|  50.6k|        if (count[min] != 0) break;
  ------------------
  |  Branch (136:13): [True: 18.8k, False: 31.8k]
  ------------------
  137|  26.0k|    if (root < min) root = min;
  ------------------
  |  Branch (137:9): [True: 0, False: 26.0k]
  ------------------
  138|       |
  139|       |    /* check for an over-subscribed or incomplete set of lengths */
  140|  26.0k|    left = 1;
  141|   416k|    for (len = 1; len <= MAXBITS; len++) {
  ------------------
  |  |   23|   416k|#define MAXBITS 15
  ------------------
  |  Branch (141:19): [True: 390k, False: 26.0k]
  ------------------
  142|   390k|        left <<= 1;
  143|   390k|        left -= count[len];
  144|   390k|        if (left < 0) return -1;        /* over-subscribed */
  ------------------
  |  Branch (144:13): [True: 0, False: 390k]
  ------------------
  145|   390k|    }
  146|  26.0k|    if (left > 0 && (type == CODES || max != 1))
  ------------------
  |  Branch (146:9): [True: 0, False: 26.0k]
  |  Branch (146:22): [True: 0, False: 0]
  |  Branch (146:39): [True: 0, False: 0]
  ------------------
  147|      0|        return -1;                      /* incomplete set */
  148|       |
  149|       |    /* generate offsets into symbol table for each length for sorting */
  150|  26.0k|    offs[1] = 0;
  151|   390k|    for (len = 1; len < MAXBITS; len++)
  ------------------
  |  |   23|   390k|#define MAXBITS 15
  ------------------
  |  Branch (151:19): [True: 364k, False: 26.0k]
  ------------------
  152|   364k|        offs[len + 1] = offs[len] + count[len];
  153|       |
  154|       |    /* sort symbols by length, by symbol order within each length */
  155|  2.57M|    for (sym = 0; sym < codes; sym++)
  ------------------
  |  Branch (155:19): [True: 2.54M, False: 26.0k]
  ------------------
  156|  2.54M|        if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
  ------------------
  |  Branch (156:13): [True: 1.62M, False: 922k]
  ------------------
  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|  26.0k|    switch (type) {
  ------------------
  |  Branch (190:13): [True: 26.0k, False: 0]
  ------------------
  191|  8.66k|    case CODES:
  ------------------
  |  Branch (191:5): [True: 8.66k, False: 17.3k]
  ------------------
  192|  8.66k|        match = 20;
  193|  8.66k|        break;
  194|  8.66k|    case LENS:
  ------------------
  |  Branch (194:5): [True: 8.66k, False: 17.3k]
  ------------------
  195|  8.66k|        base = lbase;
  196|  8.66k|        extra = lext;
  197|  8.66k|        match = 257;
  198|  8.66k|        break;
  199|  8.66k|    case DISTS:
  ------------------
  |  Branch (199:5): [True: 8.66k, False: 17.3k]
  ------------------
  200|  8.66k|        base = dbase;
  201|  8.66k|        extra = dext;
  202|  26.0k|    }
  203|       |
  204|       |    /* initialize state for loop */
  205|  26.0k|    huff = 0;                   /* starting code */
  206|  26.0k|    sym = 0;                    /* starting code symbol */
  207|  26.0k|    len = min;                  /* starting code length */
  208|  26.0k|    next = *table;              /* current table to fill in */
  209|  26.0k|    curr = root;                /* current table index bits */
  210|  26.0k|    drop = 0;                   /* current bits to drop from code for index */
  211|  26.0k|    low = (unsigned)(-1);       /* trigger new sub-table when len > root */
  212|  26.0k|    used = 1U << root;          /* use root table entries */
  213|  26.0k|    mask = used - 1;            /* mask for comparing low */
  214|       |
  215|       |    /* check available table space */
  216|  26.0k|    if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   50|  8.66k|#  define ENOUGH_LENS 852
  ------------------
  |  Branch (216:10): [True: 8.66k, False: 17.3k]
  |  Branch (216:26): [True: 0, False: 8.66k]
  ------------------
  217|  26.0k|        (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   51|  8.66k|#  define ENOUGH_DISTS 592
  ------------------
  |  Branch (217:10): [True: 8.66k, False: 17.3k]
  |  Branch (217:27): [True: 0, False: 8.66k]
  ------------------
  218|      0|        return 1;
  219|       |
  220|       |    /* process all codes and make table entries */
  221|  1.62M|    for (;;) {
  222|       |        /* create table entry */
  223|  1.62M|        here.bits = (unsigned char)(len - drop);
  224|  1.62M|        if (work[sym] + 1U < match) {
  ------------------
  |  Branch (224:13): [True: 1.51M, False: 104k]
  ------------------
  225|  1.51M|            here.op = (unsigned char)0;
  226|  1.51M|            here.val = work[sym];
  227|  1.51M|        }
  228|   104k|        else if (work[sym] >= match) {
  ------------------
  |  Branch (228:18): [True: 95.4k, False: 8.66k]
  ------------------
  229|  95.4k|            here.op = (unsigned char)(extra[work[sym] - match]);
  230|  95.4k|            here.val = base[work[sym] - match];
  231|  95.4k|        }
  232|  8.66k|        else {
  233|  8.66k|            here.op = (unsigned char)(32 + 64);         /* end of block */
  234|  8.66k|            here.val = 0;
  235|  8.66k|        }
  236|       |
  237|       |        /* replicate for those indices with low len bits equal to huff */
  238|  1.62M|        incr = 1U << (len - drop);
  239|  1.62M|        fill = 1U << curr;
  240|  1.62M|        min = fill;                 /* save offset to next table */
  241|  4.61M|        do {
  242|  4.61M|            fill -= incr;
  243|  4.61M|            next[(huff >> drop) + fill] = here;
  244|  4.61M|        } while (fill != 0);
  ------------------
  |  Branch (244:18): [True: 2.99M, False: 1.62M]
  ------------------
  245|       |
  246|       |        /* backwards increment the len-bit code huff */
  247|  1.62M|        incr = 1U << (len - 1);
  248|  3.21M|        while (huff & incr)
  ------------------
  |  Branch (248:16): [True: 1.59M, False: 1.62M]
  ------------------
  249|  1.59M|            incr >>= 1;
  250|  1.62M|        if (incr != 0) {
  ------------------
  |  Branch (250:13): [True: 1.59M, False: 26.0k]
  ------------------
  251|  1.59M|            huff &= incr - 1;
  252|  1.59M|            huff += incr;
  253|  1.59M|        }
  254|  26.0k|        else
  255|  26.0k|            huff = 0;
  256|       |
  257|       |        /* go to next symbol, update count, len */
  258|  1.62M|        sym++;
  259|  1.62M|        if (--(count[len]) == 0) {
  ------------------
  |  Branch (259:13): [True: 114k, False: 1.50M]
  ------------------
  260|   114k|            if (len == max) break;
  ------------------
  |  Branch (260:17): [True: 26.0k, False: 88.9k]
  ------------------
  261|  88.9k|            len = lens[work[sym]];
  262|  88.9k|        }
  263|       |
  264|       |        /* create new sub-table if needed */
  265|  1.59M|        if (len > root && (huff & mask) != low) {
  ------------------
  |  Branch (265:13): [True: 306k, False: 1.28M]
  |  Branch (265:27): [True: 70.5k, False: 235k]
  ------------------
  266|       |            /* if first time, transition to sub-tables */
  267|  70.5k|            if (drop == 0)
  ------------------
  |  Branch (267:17): [True: 7.93k, False: 62.6k]
  ------------------
  268|  7.93k|                drop = root;
  269|       |
  270|       |            /* increment past last table */
  271|  70.5k|            next += min;            /* here min is 1 << curr */
  272|       |
  273|       |            /* determine length of next table */
  274|  70.5k|            curr = len - drop;
  275|  70.5k|            left = (int)(1 << curr);
  276|  85.3k|            while (curr + drop < max) {
  ------------------
  |  Branch (276:20): [True: 73.0k, False: 12.3k]
  ------------------
  277|  73.0k|                left -= count[curr + drop];
  278|  73.0k|                if (left <= 0) break;
  ------------------
  |  Branch (278:21): [True: 58.2k, False: 14.8k]
  ------------------
  279|  14.8k|                curr++;
  280|  14.8k|                left <<= 1;
  281|  14.8k|            }
  282|       |
  283|       |            /* check for enough space */
  284|  70.5k|            used += 1U << curr;
  285|  70.5k|            if ((type == LENS && used > ENOUGH_LENS) ||
  ------------------
  |  |   50|  67.4k|#  define ENOUGH_LENS 852
  ------------------
  |  Branch (285:18): [True: 67.4k, False: 3.07k]
  |  Branch (285:34): [True: 0, False: 67.4k]
  ------------------
  286|  70.5k|                (type == DISTS && used > ENOUGH_DISTS))
  ------------------
  |  |   51|  3.07k|#  define ENOUGH_DISTS 592
  ------------------
  |  Branch (286:18): [True: 3.07k, False: 67.4k]
  |  Branch (286:35): [True: 0, False: 3.07k]
  ------------------
  287|      0|                return 1;
  288|       |
  289|       |            /* point entry in root table to sub-table */
  290|  70.5k|            low = huff & mask;
  291|  70.5k|            (*table)[low].op = (unsigned char)curr;
  292|  70.5k|            (*table)[low].bits = (unsigned char)root;
  293|  70.5k|            (*table)[low].val = (unsigned short)(next - *table);
  294|  70.5k|        }
  295|  1.59M|    }
  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|  26.0k|    if (huff != 0) {
  ------------------
  |  Branch (300:9): [True: 0, False: 26.0k]
  ------------------
  301|      0|        here.op = (unsigned char)64;            /* invalid code marker */
  302|      0|        here.bits = (unsigned char)(len - drop);
  303|      0|        here.val = (unsigned short)0;
  304|      0|        next[huff] = here;
  305|      0|    }
  306|       |
  307|       |    /* set return parameters */
  308|  26.0k|    *table += used;
  309|  26.0k|    *bits = root;
  310|  26.0k|    return 0;
  311|  26.0k|}
inflate_fixed:
  364|  1.37k|void inflate_fixed(struct inflate_state FAR *state) {
  365|       |#ifdef BUILDFIXED
  366|       |    z_once(&built, buildtables);
  367|       |#endif /* BUILDFIXED */
  368|  1.37k|    state->lencode = lenfix;
  369|  1.37k|    state->lenbits = 9;
  370|  1.37k|    state->distcode = distfix;
  371|  1.37k|    state->distbits = 5;
  372|  1.37k|}

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

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

