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

crc32_z:
  695|  61.3k|                              z_size_t len) {
  696|       |    /* Return initial CRC, if requested. */
  697|  61.3k|    if (buf == Z_NULL) return 0;
  ------------------
  |  |  216|  61.3k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (697:9): [True: 15.4k, False: 45.9k]
  ------------------
  698|       |
  699|       |#ifdef DYNAMIC_CRC_TABLE
  700|       |    once(&made, make_crc_table);
  701|       |#endif /* DYNAMIC_CRC_TABLE */
  702|       |
  703|       |    /* Pre-condition the CRC */
  704|  45.9k|    crc = (~crc) & 0xffffffff;
  705|       |
  706|  45.9k|#ifdef W
  707|       |
  708|       |    /* If provided enough bytes, do a braided CRC calculation. */
  709|  45.9k|    if (len >= N * W + W - 1) {
  ------------------
  |  |   57|  45.9k|#  define N 5
  ------------------
                  if (len >= N * W + W - 1) {
  ------------------
  |  |   83|  45.9k|#      define W 8
  ------------------
                  if (len >= N * W + W - 1) {
  ------------------
  |  |   83|  45.9k|#      define W 8
  ------------------
  |  Branch (709:9): [True: 38.0k, False: 7.89k]
  ------------------
  710|  38.0k|        z_size_t blks;
  711|  38.0k|        z_word_t const *words;
  712|  38.0k|        unsigned endian;
  713|  38.0k|        int k;
  714|       |
  715|       |        /* Compute the CRC up to a z_word_t boundary. */
  716|  91.9k|        while (len && ((z_size_t)buf & (W - 1)) != 0) {
  ------------------
  |  |   83|  91.9k|#      define W 8
  ------------------
  |  Branch (716:16): [True: 91.9k, False: 0]
  |  Branch (716:23): [True: 53.9k, False: 38.0k]
  ------------------
  717|  53.9k|            len--;
  718|  53.9k|            crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  719|  53.9k|        }
  720|       |
  721|       |        /* Compute the CRC on as many N z_word_t blocks as are available. */
  722|  38.0k|        blks = len / (N * W);
  ------------------
  |  |   57|  38.0k|#  define N 5
  ------------------
                      blks = len / (N * W);
  ------------------
  |  |   83|  38.0k|#      define W 8
  ------------------
  723|  38.0k|        len -= blks * N * W;
  ------------------
  |  |   57|  38.0k|#  define N 5
  ------------------
                      len -= blks * N * W;
  ------------------
  |  |   83|  38.0k|#      define W 8
  ------------------
  724|  38.0k|        words = (z_word_t const *)buf;
  725|       |
  726|       |        /* Do endian check at execution time instead of compile time, since ARM
  727|       |           processors can change the endianness at execution time. If the
  728|       |           compiler knows what the endianness will be, it can optimize out the
  729|       |           check and the unused branch. */
  730|  38.0k|        endian = 1;
  731|  38.0k|        if (*(unsigned char *)&endian) {
  ------------------
  |  Branch (731:13): [True: 38.0k, False: 0]
  ------------------
  732|       |            /* Little endian. */
  733|       |
  734|  38.0k|            z_crc_t crc0;
  735|  38.0k|            z_word_t word0;
  736|  38.0k|#if N > 1
  737|  38.0k|            z_crc_t crc1;
  738|  38.0k|            z_word_t word1;
  739|  38.0k|#if N > 2
  740|  38.0k|            z_crc_t crc2;
  741|  38.0k|            z_word_t word2;
  742|  38.0k|#if N > 3
  743|  38.0k|            z_crc_t crc3;
  744|  38.0k|            z_word_t word3;
  745|  38.0k|#if N > 4
  746|  38.0k|            z_crc_t crc4;
  747|  38.0k|            z_word_t word4;
  748|       |#if N > 5
  749|       |            z_crc_t crc5;
  750|       |            z_word_t word5;
  751|       |#endif
  752|  38.0k|#endif
  753|  38.0k|#endif
  754|  38.0k|#endif
  755|  38.0k|#endif
  756|       |
  757|       |            /* Initialize the CRC for each braid. */
  758|  38.0k|            crc0 = crc;
  759|  38.0k|#if N > 1
  760|  38.0k|            crc1 = 0;
  761|  38.0k|#if N > 2
  762|  38.0k|            crc2 = 0;
  763|  38.0k|#if N > 3
  764|  38.0k|            crc3 = 0;
  765|  38.0k|#if N > 4
  766|  38.0k|            crc4 = 0;
  767|       |#if N > 5
  768|       |            crc5 = 0;
  769|       |#endif
  770|  38.0k|#endif
  771|  38.0k|#endif
  772|  38.0k|#endif
  773|  38.0k|#endif
  774|       |
  775|       |            /*
  776|       |              Process the first blks-1 blocks, computing the CRCs on each braid
  777|       |              independently.
  778|       |             */
  779|  11.2M|            while (--blks) {
  ------------------
  |  Branch (779:20): [True: 11.1M, False: 38.0k]
  ------------------
  780|       |                /* Load the word for each braid into registers. */
  781|  11.1M|                word0 = crc0 ^ words[0];
  782|  11.1M|#if N > 1
  783|  11.1M|                word1 = crc1 ^ words[1];
  784|  11.1M|#if N > 2
  785|  11.1M|                word2 = crc2 ^ words[2];
  786|  11.1M|#if N > 3
  787|  11.1M|                word3 = crc3 ^ words[3];
  788|  11.1M|#if N > 4
  789|  11.1M|                word4 = crc4 ^ words[4];
  790|       |#if N > 5
  791|       |                word5 = crc5 ^ words[5];
  792|       |#endif
  793|  11.1M|#endif
  794|  11.1M|#endif
  795|  11.1M|#endif
  796|  11.1M|#endif
  797|  11.1M|                words += N;
  ------------------
  |  |   57|  11.1M|#  define N 5
  ------------------
  798|       |
  799|       |                /* Compute and update the CRC for each word. The loop should
  800|       |                   get unrolled. */
  801|  11.1M|                crc0 = crc_braid_table[0][word0 & 0xff];
  802|  11.1M|#if N > 1
  803|  11.1M|                crc1 = crc_braid_table[0][word1 & 0xff];
  804|  11.1M|#if N > 2
  805|  11.1M|                crc2 = crc_braid_table[0][word2 & 0xff];
  806|  11.1M|#if N > 3
  807|  11.1M|                crc3 = crc_braid_table[0][word3 & 0xff];
  808|  11.1M|#if N > 4
  809|  11.1M|                crc4 = crc_braid_table[0][word4 & 0xff];
  810|       |#if N > 5
  811|       |                crc5 = crc_braid_table[0][word5 & 0xff];
  812|       |#endif
  813|  11.1M|#endif
  814|  11.1M|#endif
  815|  11.1M|#endif
  816|  11.1M|#endif
  817|  89.4M|                for (k = 1; k < W; k++) {
  ------------------
  |  |   83|  89.4M|#      define W 8
  ------------------
  |  Branch (817:29): [True: 78.2M, False: 11.1M]
  ------------------
  818|  78.2M|                    crc0 ^= crc_braid_table[k][(word0 >> (k << 3)) & 0xff];
  819|  78.2M|#if N > 1
  820|  78.2M|                    crc1 ^= crc_braid_table[k][(word1 >> (k << 3)) & 0xff];
  821|  78.2M|#if N > 2
  822|  78.2M|                    crc2 ^= crc_braid_table[k][(word2 >> (k << 3)) & 0xff];
  823|  78.2M|#if N > 3
  824|  78.2M|                    crc3 ^= crc_braid_table[k][(word3 >> (k << 3)) & 0xff];
  825|  78.2M|#if N > 4
  826|  78.2M|                    crc4 ^= crc_braid_table[k][(word4 >> (k << 3)) & 0xff];
  827|       |#if N > 5
  828|       |                    crc5 ^= crc_braid_table[k][(word5 >> (k << 3)) & 0xff];
  829|       |#endif
  830|  78.2M|#endif
  831|  78.2M|#endif
  832|  78.2M|#endif
  833|  78.2M|#endif
  834|  78.2M|                }
  835|  11.1M|            }
  836|       |
  837|       |            /*
  838|       |              Process the last block, combining the CRCs of the N braids at the
  839|       |              same time.
  840|       |             */
  841|  38.0k|            crc = crc_word(crc0 ^ words[0]);
  842|  38.0k|#if N > 1
  843|  38.0k|            crc = crc_word(crc1 ^ words[1] ^ crc);
  844|  38.0k|#if N > 2
  845|  38.0k|            crc = crc_word(crc2 ^ words[2] ^ crc);
  846|  38.0k|#if N > 3
  847|  38.0k|            crc = crc_word(crc3 ^ words[3] ^ crc);
  848|  38.0k|#if N > 4
  849|  38.0k|            crc = crc_word(crc4 ^ words[4] ^ crc);
  850|       |#if N > 5
  851|       |            crc = crc_word(crc5 ^ words[5] ^ crc);
  852|       |#endif
  853|  38.0k|#endif
  854|  38.0k|#endif
  855|  38.0k|#endif
  856|  38.0k|#endif
  857|  38.0k|            words += N;
  ------------------
  |  |   57|  38.0k|#  define N 5
  ------------------
  858|  38.0k|        }
  859|      0|        else {
  860|       |            /* Big endian. */
  861|       |
  862|      0|            z_word_t crc0, word0, comb;
  863|      0|#if N > 1
  864|      0|            z_word_t crc1, word1;
  865|      0|#if N > 2
  866|      0|            z_word_t crc2, word2;
  867|      0|#if N > 3
  868|      0|            z_word_t crc3, word3;
  869|      0|#if N > 4
  870|      0|            z_word_t crc4, word4;
  871|       |#if N > 5
  872|       |            z_word_t crc5, word5;
  873|       |#endif
  874|      0|#endif
  875|      0|#endif
  876|      0|#endif
  877|      0|#endif
  878|       |
  879|       |            /* Initialize the CRC for each braid. */
  880|      0|            crc0 = byte_swap(crc);
  881|      0|#if N > 1
  882|      0|            crc1 = 0;
  883|      0|#if N > 2
  884|      0|            crc2 = 0;
  885|      0|#if N > 3
  886|      0|            crc3 = 0;
  887|      0|#if N > 4
  888|      0|            crc4 = 0;
  889|       |#if N > 5
  890|       |            crc5 = 0;
  891|       |#endif
  892|      0|#endif
  893|      0|#endif
  894|      0|#endif
  895|      0|#endif
  896|       |
  897|       |            /*
  898|       |              Process the first blks-1 blocks, computing the CRCs on each braid
  899|       |              independently.
  900|       |             */
  901|      0|            while (--blks) {
  ------------------
  |  Branch (901:20): [True: 0, False: 0]
  ------------------
  902|       |                /* Load the word for each braid into registers. */
  903|      0|                word0 = crc0 ^ words[0];
  904|      0|#if N > 1
  905|      0|                word1 = crc1 ^ words[1];
  906|      0|#if N > 2
  907|      0|                word2 = crc2 ^ words[2];
  908|      0|#if N > 3
  909|      0|                word3 = crc3 ^ words[3];
  910|      0|#if N > 4
  911|      0|                word4 = crc4 ^ words[4];
  912|       |#if N > 5
  913|       |                word5 = crc5 ^ words[5];
  914|       |#endif
  915|      0|#endif
  916|      0|#endif
  917|      0|#endif
  918|      0|#endif
  919|      0|                words += N;
  ------------------
  |  |   57|      0|#  define N 5
  ------------------
  920|       |
  921|       |                /* Compute and update the CRC for each word. The loop should
  922|       |                   get unrolled. */
  923|      0|                crc0 = crc_braid_big_table[0][word0 & 0xff];
  924|      0|#if N > 1
  925|      0|                crc1 = crc_braid_big_table[0][word1 & 0xff];
  926|      0|#if N > 2
  927|      0|                crc2 = crc_braid_big_table[0][word2 & 0xff];
  928|      0|#if N > 3
  929|      0|                crc3 = crc_braid_big_table[0][word3 & 0xff];
  930|      0|#if N > 4
  931|      0|                crc4 = crc_braid_big_table[0][word4 & 0xff];
  932|       |#if N > 5
  933|       |                crc5 = crc_braid_big_table[0][word5 & 0xff];
  934|       |#endif
  935|      0|#endif
  936|      0|#endif
  937|      0|#endif
  938|      0|#endif
  939|      0|                for (k = 1; k < W; k++) {
  ------------------
  |  |   83|      0|#      define W 8
  ------------------
  |  Branch (939:29): [True: 0, False: 0]
  ------------------
  940|      0|                    crc0 ^= crc_braid_big_table[k][(word0 >> (k << 3)) & 0xff];
  941|      0|#if N > 1
  942|      0|                    crc1 ^= crc_braid_big_table[k][(word1 >> (k << 3)) & 0xff];
  943|      0|#if N > 2
  944|      0|                    crc2 ^= crc_braid_big_table[k][(word2 >> (k << 3)) & 0xff];
  945|      0|#if N > 3
  946|      0|                    crc3 ^= crc_braid_big_table[k][(word3 >> (k << 3)) & 0xff];
  947|      0|#if N > 4
  948|      0|                    crc4 ^= crc_braid_big_table[k][(word4 >> (k << 3)) & 0xff];
  949|       |#if N > 5
  950|       |                    crc5 ^= crc_braid_big_table[k][(word5 >> (k << 3)) & 0xff];
  951|       |#endif
  952|      0|#endif
  953|      0|#endif
  954|      0|#endif
  955|      0|#endif
  956|      0|                }
  957|      0|            }
  958|       |
  959|       |            /*
  960|       |              Process the last block, combining the CRCs of the N braids at the
  961|       |              same time.
  962|       |             */
  963|      0|            comb = crc_word_big(crc0 ^ words[0]);
  964|      0|#if N > 1
  965|      0|            comb = crc_word_big(crc1 ^ words[1] ^ comb);
  966|      0|#if N > 2
  967|      0|            comb = crc_word_big(crc2 ^ words[2] ^ comb);
  968|      0|#if N > 3
  969|      0|            comb = crc_word_big(crc3 ^ words[3] ^ comb);
  970|      0|#if N > 4
  971|      0|            comb = crc_word_big(crc4 ^ words[4] ^ comb);
  972|       |#if N > 5
  973|       |            comb = crc_word_big(crc5 ^ words[5] ^ comb);
  974|       |#endif
  975|      0|#endif
  976|      0|#endif
  977|      0|#endif
  978|      0|#endif
  979|      0|            words += N;
  ------------------
  |  |   57|      0|#  define N 5
  ------------------
  980|      0|            crc = byte_swap(comb);
  981|      0|        }
  982|       |
  983|       |        /*
  984|       |          Update the pointer to the remaining bytes to process.
  985|       |         */
  986|  38.0k|        buf = (unsigned char const *)words;
  987|  38.0k|    }
  988|       |
  989|  45.9k|#endif /* W */
  990|       |
  991|       |    /* Complete the computation of the CRC on any remaining bytes. */
  992|   145k|    while (len >= 8) {
  ------------------
  |  Branch (992:12): [True: 99.2k, False: 45.9k]
  ------------------
  993|  99.2k|        len -= 8;
  994|  99.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  995|  99.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  996|  99.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  997|  99.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  998|  99.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
  999|  99.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1000|  99.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1001|  99.2k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1002|  99.2k|    }
 1003|   139k|    while (len) {
  ------------------
  |  Branch (1003:12): [True: 93.7k, False: 45.9k]
  ------------------
 1004|  93.7k|        len--;
 1005|  93.7k|        crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
 1006|  93.7k|    }
 1007|       |
 1008|       |    /* Return the CRC, post-conditioned. */
 1009|  45.9k|    return crc ^ 0xffffffff;
 1010|  61.3k|}
crc32:
 1016|  61.3k|                            uInt len) {
 1017|  61.3k|    return crc32_z(crc, buf, len);
 1018|  61.3k|}
crc32.c:crc_word:
  676|   190k|local z_crc_t crc_word(z_word_t data) {
  677|   190k|    int k;
  678|  1.71M|    for (k = 0; k < W; k++)
  ------------------
  |  |   83|  1.71M|#      define W 8
  ------------------
  |  Branch (678:17): [True: 1.52M, False: 190k]
  ------------------
  679|  1.52M|        data = (data >> 8) ^ crc_table[data & 0xff];
  680|   190k|    return (z_crc_t)data;
  681|   190k|}

deflateInit2_:
  381|  3.86k|                          const char *version, int stream_size) {
  382|  3.86k|    deflate_state *s;
  383|  3.86k|    int wrap = 1;
  384|  3.86k|    static const char my_version[] = ZLIB_VERSION;
  ------------------
  |  |   44|  3.86k|#define ZLIB_VERSION "1.3.1.1-motley"
  ------------------
  385|       |
  386|  3.86k|    if (version == Z_NULL || version[0] != my_version[0] ||
  ------------------
  |  |  216|  7.72k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (386:9): [True: 0, False: 3.86k]
  |  Branch (386:30): [True: 0, False: 3.86k]
  ------------------
  387|  3.86k|        stream_size != sizeof(z_stream)) {
  ------------------
  |  Branch (387:9): [True: 0, False: 3.86k]
  ------------------
  388|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  189|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  389|      0|    }
  390|  3.86k|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  216|  3.86k|#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 (390:9): [True: 0, False: 3.86k]
  ------------------
  391|       |
  392|  3.86k|    strm->msg = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  393|  3.86k|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (393:9): [True: 3.86k, False: 0]
  ------------------
  394|       |#ifdef Z_SOLO
  395|       |        return Z_STREAM_ERROR;
  396|       |#else
  397|  3.86k|        strm->zalloc = zcalloc;
  398|  3.86k|        strm->opaque = (voidpf)0;
  399|  3.86k|#endif
  400|  3.86k|    }
  401|  3.86k|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (401:9): [True: 3.86k, False: 0]
  ------------------
  402|       |#ifdef Z_SOLO
  403|       |        return Z_STREAM_ERROR;
  404|       |#else
  405|  3.86k|        strm->zfree = zcfree;
  406|  3.86k|#endif
  407|       |
  408|       |#ifdef FASTEST
  409|       |    if (level != 0) level = 1;
  410|       |#else
  411|  3.86k|    if (level == Z_DEFAULT_COMPRESSION) level = 6;
  ------------------
  |  |  197|  3.86k|#define Z_DEFAULT_COMPRESSION  (-1)
  ------------------
  |  Branch (411:9): [True: 3.86k, False: 0]
  ------------------
  412|  3.86k|#endif
  413|       |
  414|  3.86k|    if (windowBits < 0) { /* suppress zlib wrapper */
  ------------------
  |  Branch (414:9): [True: 0, False: 3.86k]
  ------------------
  415|      0|        wrap = 0;
  416|      0|        if (windowBits < -15)
  ------------------
  |  Branch (416:13): [True: 0, False: 0]
  ------------------
  417|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  418|      0|        windowBits = -windowBits;
  419|      0|    }
  420|  3.86k|#ifdef GZIP
  421|  3.86k|    else if (windowBits > 15) {
  ------------------
  |  Branch (421:14): [True: 3.86k, False: 0]
  ------------------
  422|  3.86k|        wrap = 2;       /* write gzip wrapper instead */
  423|  3.86k|        windowBits -= 16;
  424|  3.86k|    }
  425|  3.86k|#endif
  426|  3.86k|    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  270|  7.72k|#    define MAX_MEM_LEVEL 9
  ------------------
                  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  213|  7.72k|#define Z_DEFLATED   8
  ------------------
  |  Branch (426:9): [True: 0, False: 3.86k]
  |  Branch (426:25): [True: 0, False: 3.86k]
  |  Branch (426:53): [True: 0, False: 3.86k]
  ------------------
  427|  3.86k|        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
  ------------------
  |  Branch (427:9): [True: 0, False: 3.86k]
  |  Branch (427:27): [True: 0, False: 3.86k]
  |  Branch (427:46): [True: 0, False: 3.86k]
  |  Branch (427:59): [True: 0, False: 3.86k]
  ------------------
  428|  3.86k|        strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) {
  ------------------
  |  |  203|  7.72k|#define Z_FIXED               4
  ------------------
  |  Branch (428:9): [True: 0, False: 3.86k]
  |  Branch (428:25): [True: 0, False: 3.86k]
  |  Branch (428:48): [True: 0, False: 3.86k]
  |  Branch (428:67): [True: 0, False: 0]
  ------------------
  429|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  430|      0|    }
  431|  3.86k|    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
  ------------------
  |  Branch (431:9): [True: 0, False: 3.86k]
  ------------------
  432|  3.86k|    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
  ------------------
  |  |  249|  3.86k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  433|  3.86k|    if (s == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  216|  3.86k|#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 (433:9): [True: 0, False: 3.86k]
  ------------------
  434|  3.86k|    strm->state = (struct internal_state FAR *)s;
  435|  3.86k|    s->strm = strm;
  436|  3.86k|    s->status = INIT_STATE;     /* to pass state test in deflateReset() */
  ------------------
  |  |   58|  3.86k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  437|       |
  438|  3.86k|    s->wrap = wrap;
  439|  3.86k|    s->gzhead = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  440|  3.86k|    s->w_bits = (uInt)windowBits;
  441|  3.86k|    s->w_size = 1 << s->w_bits;
  442|  3.86k|    s->w_mask = s->w_size - 1;
  443|       |
  444|  3.86k|    s->hash_bits = (uInt)memLevel + 7;
  445|  3.86k|    s->hash_size = 1 << s->hash_bits;
  446|  3.86k|    s->hash_mask = s->hash_size - 1;
  447|  3.86k|    s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   88|  3.86k|#define MIN_MATCH  3
  ------------------
                  s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   88|  3.86k|#define MIN_MATCH  3
  ------------------
  448|       |
  449|  3.86k|    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
  ------------------
  |  |  249|  3.86k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  450|  3.86k|    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
  ------------------
  |  |  249|  3.86k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  451|  3.86k|    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
  ------------------
  |  |  249|  3.86k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  452|       |
  453|  3.86k|    s->high_water = 0;      /* nothing written to s->window yet */
  454|       |
  455|  3.86k|    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
  456|       |
  457|       |    /* We overlay pending_buf and sym_buf. This works since the average size
  458|       |     * for length/distance pairs over any compressed block is assured to be 31
  459|       |     * bits or less.
  460|       |     *
  461|       |     * Analysis: The longest fixed codes are a length code of 8 bits plus 5
  462|       |     * extra bits, for lengths 131 to 257. The longest fixed distance codes are
  463|       |     * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest
  464|       |     * possible fixed-codes length/distance pair is then 31 bits total.
  465|       |     *
  466|       |     * sym_buf starts one-fourth of the way into pending_buf. So there are
  467|       |     * three bytes in sym_buf for every four bytes in pending_buf. Each symbol
  468|       |     * in sym_buf is three bytes -- two for the distance and one for the
  469|       |     * literal/length. As each symbol is consumed, the pointer to the next
  470|       |     * sym_buf value to read moves forward three bytes. From that symbol, up to
  471|       |     * 31 bits are written to pending_buf. The closest the written pending_buf
  472|       |     * bits gets to the next sym_buf symbol to read is just before the last
  473|       |     * code is written. At that time, 31*(n - 2) bits have been written, just
  474|       |     * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at
  475|       |     * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1
  476|       |     * symbols are written.) The closest the writing gets to what is unread is
  477|       |     * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and
  478|       |     * can range from 128 to 32768.
  479|       |     *
  480|       |     * Therefore, at a minimum, there are 142 bits of space between what is
  481|       |     * written and what is read in the overlain buffers, so the symbols cannot
  482|       |     * be overwritten by the compressed data. That space is actually 139 bits,
  483|       |     * due to the three-bit fixed-code block header.
  484|       |     *
  485|       |     * That covers the case where either Z_FIXED is specified, forcing fixed
  486|       |     * codes, or when the use of fixed codes is chosen, because that choice
  487|       |     * results in a smaller compressed block than dynamic codes. That latter
  488|       |     * condition then assures that the above analysis also covers all dynamic
  489|       |     * blocks. A dynamic-code block will only be chosen to be emitted if it has
  490|       |     * fewer bits than a fixed-code block would for the same set of symbols.
  491|       |     * Therefore its average symbol length is assured to be less than 31. So
  492|       |     * the compressed data for a dynamic block also cannot overwrite the
  493|       |     * symbols from which it is being constructed.
  494|       |     */
  495|       |
  496|  3.86k|    s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS);
  ------------------
  |  |  249|  3.86k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  497|  3.86k|    s->pending_buf_size = (ulg)s->lit_bufsize * 4;
  498|       |
  499|  3.86k|    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  7.72k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  7.72k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  7.72k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (499:9): [True: 0, False: 3.86k]
  |  Branch (499:32): [True: 0, False: 3.86k]
  |  Branch (499:53): [True: 0, False: 3.86k]
  ------------------
  500|  3.86k|        s->pending_buf == Z_NULL) {
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (500:9): [True: 0, False: 3.86k]
  ------------------
  501|      0|        s->status = FINISH_STATE;
  ------------------
  |  |   67|      0|#define FINISH_STATE 666    /* stream complete */
  ------------------
  502|      0|        strm->msg = ERR_MSG(Z_MEM_ERROR);
  ------------------
  |  |   61|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  ------------------
  |  |  |  Branch (61:31): [Folded - Ignored]
  |  |  |  Branch (61:45): [Folded - Ignored]
  |  |  ------------------
  ------------------
  503|      0|        deflateEnd (strm);
  504|      0|        return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  505|      0|    }
  506|       |#ifdef LIT_MEM
  507|       |    s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1));
  508|       |    s->l_buf = s->pending_buf + (s->lit_bufsize << 2);
  509|       |    s->sym_end = s->lit_bufsize - 1;
  510|       |#else
  511|  3.86k|    s->sym_buf = s->pending_buf + s->lit_bufsize;
  512|  3.86k|    s->sym_end = (s->lit_bufsize - 1) * 3;
  513|  3.86k|#endif
  514|       |    /* We avoid equality with lit_bufsize*3 because of wraparound at 64K
  515|       |     * on 16 bit machines and because stored blocks are restricted to
  516|       |     * 64K-1 bytes.
  517|       |     */
  518|       |
  519|  3.86k|    s->level = level;
  520|  3.86k|    s->strategy = strategy;
  521|  3.86k|    s->method = (Byte)method;
  522|       |
  523|  3.86k|    return deflateReset(strm);
  524|  3.86k|}
deflateResetKeep:
  635|  3.86k|int ZEXPORT deflateResetKeep(z_streamp strm) {
  636|  3.86k|    deflate_state *s;
  637|       |
  638|  3.86k|    if (deflateStateCheck(strm)) {
  ------------------
  |  Branch (638:9): [True: 0, False: 3.86k]
  ------------------
  639|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  640|      0|    }
  641|       |
  642|  3.86k|    strm->total_in = strm->total_out = 0;
  643|  3.86k|    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  644|  3.86k|    strm->data_type = Z_UNKNOWN;
  ------------------
  |  |  210|  3.86k|#define Z_UNKNOWN  2
  ------------------
  645|       |
  646|  3.86k|    s = (deflate_state *)strm->state;
  647|  3.86k|    s->pending = 0;
  648|  3.86k|    s->pending_out = s->pending_buf;
  649|       |
  650|  3.86k|    if (s->wrap < 0) {
  ------------------
  |  Branch (650:9): [True: 0, False: 3.86k]
  ------------------
  651|      0|        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
  652|      0|    }
  653|  3.86k|    s->status =
  654|  3.86k|#ifdef GZIP
  655|  3.86k|        s->wrap == 2 ? GZIP_STATE :
  ------------------
  |  |   60|  3.86k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (655:9): [True: 3.86k, False: 0]
  ------------------
  656|  3.86k|#endif
  657|  3.86k|        INIT_STATE;
  ------------------
  |  |   58|  3.86k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  658|  3.86k|    strm->adler =
  659|  3.86k|#ifdef GZIP
  660|  3.86k|        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (660:9): [True: 3.86k, False: 0]
  ------------------
  661|  3.86k|#endif
  662|  3.86k|        adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  663|  3.86k|    s->last_flush = -2;
  664|       |
  665|  3.86k|    _tr_init(s);
  666|       |
  667|  3.86k|    return Z_OK;
  ------------------
  |  |  181|  3.86k|#define Z_OK            0
  ------------------
  668|  3.86k|}
deflateReset:
  695|  3.86k|int ZEXPORT deflateReset(z_streamp strm) {
  696|  3.86k|    int ret;
  697|       |
  698|  3.86k|    ret = deflateResetKeep(strm);
  699|  3.86k|    if (ret == Z_OK)
  ------------------
  |  |  181|  3.86k|#define Z_OK            0
  ------------------
  |  Branch (699:9): [True: 3.86k, False: 0]
  ------------------
  700|  3.86k|        lm_init(strm->state);
  701|  3.86k|    return ret;
  702|  3.86k|}
deflate:
  954|  48.7k|int ZEXPORT deflate(z_streamp strm, int flush) {
  955|  48.7k|    int old_flush; /* value of flush param for previous deflate call */
  956|  48.7k|    deflate_state *s;
  957|       |
  958|  48.7k|    if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {
  ------------------
  |  |  177|  97.5k|#define Z_BLOCK         5
  ------------------
  |  Branch (958:9): [True: 0, False: 48.7k]
  |  Branch (958:36): [True: 0, False: 48.7k]
  |  Branch (958:55): [True: 0, False: 48.7k]
  ------------------
  959|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  960|      0|    }
  961|  48.7k|    s = strm->state;
  962|       |
  963|  48.7k|    if (strm->next_out == Z_NULL ||
  ------------------
  |  |  216|  97.5k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (963:9): [True: 0, False: 48.7k]
  ------------------
  964|  48.7k|        (strm->avail_in != 0 && strm->next_in == Z_NULL) ||
  ------------------
  |  |  216|  16.5k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (964:10): [True: 16.5k, False: 32.2k]
  |  Branch (964:33): [True: 0, False: 16.5k]
  ------------------
  965|  48.7k|        (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |   67|  97.5k|#define FINISH_STATE 666    /* stream complete */
  ------------------
                      (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |  176|  5.22k|#define Z_FINISH        4
  ------------------
  |  Branch (965:10): [True: 5.22k, False: 43.5k]
  |  Branch (965:39): [True: 0, False: 5.22k]
  ------------------
  966|      0|        ERR_RETURN(strm, Z_STREAM_ERROR);
  ------------------
  |  |   64|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   61|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:31): [Folded - Ignored]
  |  |  |  |  |  Branch (61:45): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  967|      0|    }
  968|  48.7k|    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   64|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   61|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:31): [Folded - Ignored]
  |  |  |  |  |  Branch (61:45): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (968:9): [True: 0, False: 48.7k]
  ------------------
  969|       |
  970|  48.7k|    old_flush = s->last_flush;
  971|  48.7k|    s->last_flush = flush;
  972|       |
  973|       |    /* Flush as much pending output as possible */
  974|  48.7k|    if (s->pending != 0) {
  ------------------
  |  Branch (974:9): [True: 16.5k, False: 32.1k]
  ------------------
  975|  16.5k|        flush_pending(strm);
  976|  16.5k|        if (strm->avail_out == 0) {
  ------------------
  |  Branch (976:13): [True: 7.07k, False: 9.50k]
  ------------------
  977|       |            /* Since avail_out is 0, deflate will be called again with
  978|       |             * more output space, but possibly with both pending and
  979|       |             * avail_in equal to zero. There won't be anything to do,
  980|       |             * but this is not an error situation so make sure we
  981|       |             * return OK instead of BUF_ERROR at next call of deflate:
  982|       |             */
  983|  7.07k|            s->last_flush = -1;
  984|  7.07k|            return Z_OK;
  ------------------
  |  |  181|  7.07k|#define Z_OK            0
  ------------------
  985|  7.07k|        }
  986|       |
  987|       |    /* Make sure there is something to do and avoid duplicate consecutive
  988|       |     * flushes. For repeated and useless calls with Z_FINISH, we keep
  989|       |     * returning Z_STREAM_END instead of Z_BUF_ERROR.
  990|       |     */
  991|  32.1k|    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  15.6k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 15.6k]
  |  |  ------------------
  ------------------
                  } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  47.7k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 15.6k]
  |  |  ------------------
  ------------------
  |  Branch (991:16): [True: 15.6k, False: 16.5k]
  |  Branch (991:39): [True: 14.4k, False: 1.13k]
  ------------------
  992|  32.1k|               flush != Z_FINISH) {
  ------------------
  |  |  176|  14.4k|#define Z_FINISH        4
  ------------------
  |  Branch (992:16): [True: 10.6k, False: 3.86k]
  ------------------
  993|  10.6k|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   64|  10.6k|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   61|  10.6k|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:31): [Folded - Ignored]
  |  |  |  |  |  Branch (61:45): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  994|  10.6k|    }
  995|       |
  996|       |    /* User must not provide more input after the first FINISH: */
  997|  31.0k|    if (s->status == FINISH_STATE && strm->avail_in != 0) {
  ------------------
  |  |   67|  62.0k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (997:9): [True: 4.98k, False: 26.0k]
  |  Branch (997:38): [True: 0, False: 4.98k]
  ------------------
  998|      0|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   64|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   61|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (61:31): [Folded - Ignored]
  |  |  |  |  |  Branch (61:45): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  999|      0|    }
 1000|       |
 1001|       |    /* Write the header */
 1002|  31.0k|    if (s->status == INIT_STATE && s->wrap == 0)
  ------------------
  |  |   58|  62.0k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1002:9): [True: 0, False: 31.0k]
  |  Branch (1002:36): [True: 0, False: 0]
  ------------------
 1003|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1004|  31.0k|    if (s->status == INIT_STATE) {
  ------------------
  |  |   58|  31.0k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1004:9): [True: 0, False: 31.0k]
  ------------------
 1005|       |        /* zlib header */
 1006|      0|        uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
  ------------------
  |  |  213|      0|#define Z_DEFLATED   8
  ------------------
 1007|      0|        uInt level_flags;
 1008|       |
 1009|      0|        if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
  ------------------
  |  |  201|      0|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1009:13): [True: 0, False: 0]
  |  Branch (1009:46): [True: 0, False: 0]
  ------------------
 1010|      0|            level_flags = 0;
 1011|      0|        else if (s->level < 6)
  ------------------
  |  Branch (1011:18): [True: 0, False: 0]
  ------------------
 1012|      0|            level_flags = 1;
 1013|      0|        else if (s->level == 6)
  ------------------
  |  Branch (1013:18): [True: 0, False: 0]
  ------------------
 1014|      0|            level_flags = 2;
 1015|      0|        else
 1016|      0|            level_flags = 3;
 1017|      0|        header |= (level_flags << 6);
 1018|      0|        if (s->strstart != 0) header |= PRESET_DICT;
  ------------------
  |  |   92|      0|#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
  ------------------
  |  Branch (1018:13): [True: 0, False: 0]
  ------------------
 1019|      0|        header += 31 - (header % 31);
 1020|       |
 1021|      0|        putShortMSB(s, header);
 1022|       |
 1023|       |        /* Save the adler32 of the preset dictionary: */
 1024|      0|        if (s->strstart != 0) {
  ------------------
  |  Branch (1024:13): [True: 0, False: 0]
  ------------------
 1025|      0|            putShortMSB(s, (uInt)(strm->adler >> 16));
 1026|      0|            putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1027|      0|        }
 1028|      0|        strm->adler = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1029|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1030|       |
 1031|       |        /* Compression must start with an empty pending buffer */
 1032|      0|        flush_pending(strm);
 1033|      0|        if (s->pending != 0) {
  ------------------
  |  Branch (1033:13): [True: 0, False: 0]
  ------------------
 1034|      0|            s->last_flush = -1;
 1035|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1036|      0|        }
 1037|      0|    }
 1038|  31.0k|#ifdef GZIP
 1039|  31.0k|    if (s->status == GZIP_STATE) {
  ------------------
  |  |   60|  31.0k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (1039:9): [True: 3.86k, False: 27.1k]
  ------------------
 1040|       |        /* gzip header */
 1041|  3.86k|        strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1042|  3.86k|        put_byte(s, 31);
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1043|  3.86k|        put_byte(s, 139);
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1044|  3.86k|        put_byte(s, 8);
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1045|  3.86k|        if (s->gzhead == Z_NULL) {
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1045:13): [True: 3.86k, False: 0]
  ------------------
 1046|  3.86k|            put_byte(s, 0);
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1047|  3.86k|            put_byte(s, 0);
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1048|  3.86k|            put_byte(s, 0);
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1049|  3.86k|            put_byte(s, 0);
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1050|  3.86k|            put_byte(s, 0);
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1051|  3.86k|            put_byte(s, s->level == 9 ? 2 :
  ------------------
  |  |  290|  21.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (290:64): [True: 1.87k, False: 1.98k]
  |  |  |  Branch (290:64): [True: 0, False: 1.98k]
  |  |  |  Branch (290:64): [True: 0, False: 3.86k]
  |  |  ------------------
  ------------------
 1052|  3.86k|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1053|  3.86k|                      4 : 0));
 1054|  3.86k|            put_byte(s, OS_CODE);
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1055|  3.86k|            s->status = BUSY_STATE;
  ------------------
  |  |   66|  3.86k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1056|       |
 1057|       |            /* Compression must start with an empty pending buffer */
 1058|  3.86k|            flush_pending(strm);
 1059|  3.86k|            if (s->pending != 0) {
  ------------------
  |  Branch (1059:17): [True: 0, False: 3.86k]
  ------------------
 1060|      0|                s->last_flush = -1;
 1061|      0|                return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1062|      0|            }
 1063|  3.86k|        }
 1064|      0|        else {
 1065|      0|            put_byte(s, (s->gzhead->text ? 1 : 0) +
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (290:64): [True: 0, False: 0]
  |  |  |  Branch (290:64): [True: 0, False: 0]
  |  |  |  Branch (290:64): [True: 0, False: 0]
  |  |  |  Branch (290:64): [True: 0, False: 0]
  |  |  |  Branch (290:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1066|      0|                     (s->gzhead->hcrc ? 2 : 0) +
 1067|      0|                     (s->gzhead->extra == Z_NULL ? 0 : 4) +
 1068|      0|                     (s->gzhead->name == Z_NULL ? 0 : 8) +
 1069|      0|                     (s->gzhead->comment == Z_NULL ? 0 : 16)
 1070|      0|                     );
 1071|      0|            put_byte(s, (Byte)(s->gzhead->time & 0xff));
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1072|      0|            put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1073|      0|            put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1074|      0|            put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1075|      0|            put_byte(s, s->level == 9 ? 2 :
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (290:64): [True: 0, False: 0]
  |  |  |  Branch (290:64): [True: 0, False: 0]
  |  |  |  Branch (290:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1076|      0|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1077|      0|                      4 : 0));
 1078|      0|            put_byte(s, s->gzhead->os & 0xff);
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1079|      0|            if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1079:17): [True: 0, False: 0]
  ------------------
 1080|      0|                put_byte(s, s->gzhead->extra_len & 0xff);
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1081|      0|                put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1082|      0|            }
 1083|      0|            if (s->gzhead->hcrc)
  ------------------
  |  Branch (1083:17): [True: 0, False: 0]
  ------------------
 1084|      0|                strm->adler = crc32(strm->adler, s->pending_buf,
 1085|      0|                                    s->pending);
 1086|      0|            s->gzindex = 0;
 1087|      0|            s->status = EXTRA_STATE;
  ------------------
  |  |   62|      0|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
 1088|      0|        }
 1089|  3.86k|    }
 1090|  31.0k|    if (s->status == EXTRA_STATE) {
  ------------------
  |  |   62|  31.0k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (1090:9): [True: 0, False: 31.0k]
  ------------------
 1091|      0|        if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1091:13): [True: 0, False: 0]
  ------------------
 1092|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1093|      0|            uInt left = (s->gzhead->extra_len & 0xffff) - s->gzindex;
 1094|      0|            while (s->pending + left > s->pending_buf_size) {
  ------------------
  |  Branch (1094:20): [True: 0, False: 0]
  ------------------
 1095|      0|                uInt copy = s->pending_buf_size - s->pending;
 1096|      0|                zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  212|      0|#    define zmemcpy memcpy
  ------------------
 1097|      0|                        s->gzhead->extra + s->gzindex, copy);
 1098|      0|                s->pending = s->pending_buf_size;
 1099|      0|                HCRC_UPDATE(beg);
  ------------------
  |  |  947|      0|    do { \
  |  |  948|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (948:13): [True: 0, False: 0]
  |  |  |  Branch (948:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  949|      0|            strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
  |  |  950|      0|                                s->pending - (beg)); \
  |  |  951|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (951:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1100|      0|                s->gzindex += copy;
 1101|      0|                flush_pending(strm);
 1102|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1102:21): [True: 0, False: 0]
  ------------------
 1103|      0|                    s->last_flush = -1;
 1104|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1105|      0|                }
 1106|      0|                beg = 0;
 1107|      0|                left -= copy;
 1108|      0|            }
 1109|      0|            zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  212|      0|#    define zmemcpy memcpy
  ------------------
 1110|      0|                    s->gzhead->extra + s->gzindex, left);
 1111|      0|            s->pending += left;
 1112|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  947|      0|    do { \
  |  |  948|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (948:13): [True: 0, False: 0]
  |  |  |  Branch (948:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  949|      0|            strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
  |  |  950|      0|                                s->pending - (beg)); \
  |  |  951|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (951:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1113|      0|            s->gzindex = 0;
 1114|      0|        }
 1115|      0|        s->status = NAME_STATE;
  ------------------
  |  |   63|      0|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
 1116|      0|    }
 1117|  31.0k|    if (s->status == NAME_STATE) {
  ------------------
  |  |   63|  31.0k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (1117:9): [True: 0, False: 31.0k]
  ------------------
 1118|      0|        if (s->gzhead->name != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1118:13): [True: 0, False: 0]
  ------------------
 1119|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1120|      0|            int val;
 1121|      0|            do {
 1122|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1122:21): [True: 0, False: 0]
  ------------------
 1123|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  947|      0|    do { \
  |  |  948|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (948:13): [True: 0, False: 0]
  |  |  |  Branch (948:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  949|      0|            strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
  |  |  950|      0|                                s->pending - (beg)); \
  |  |  951|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (951:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1124|      0|                    flush_pending(strm);
 1125|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1125:25): [True: 0, False: 0]
  ------------------
 1126|      0|                        s->last_flush = -1;
 1127|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1128|      0|                    }
 1129|      0|                    beg = 0;
 1130|      0|                }
 1131|      0|                val = s->gzhead->name[s->gzindex++];
 1132|      0|                put_byte(s, val);
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1133|      0|            } while (val != 0);
  ------------------
  |  Branch (1133:22): [True: 0, False: 0]
  ------------------
 1134|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  947|      0|    do { \
  |  |  948|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (948:13): [True: 0, False: 0]
  |  |  |  Branch (948:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  949|      0|            strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
  |  |  950|      0|                                s->pending - (beg)); \
  |  |  951|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (951:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1135|      0|            s->gzindex = 0;
 1136|      0|        }
 1137|      0|        s->status = COMMENT_STATE;
  ------------------
  |  |   64|      0|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
 1138|      0|    }
 1139|  31.0k|    if (s->status == COMMENT_STATE) {
  ------------------
  |  |   64|  31.0k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (1139:9): [True: 0, False: 31.0k]
  ------------------
 1140|      0|        if (s->gzhead->comment != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1140:13): [True: 0, False: 0]
  ------------------
 1141|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1142|      0|            int val;
 1143|      0|            do {
 1144|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1144:21): [True: 0, False: 0]
  ------------------
 1145|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  947|      0|    do { \
  |  |  948|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (948:13): [True: 0, False: 0]
  |  |  |  Branch (948:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  949|      0|            strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
  |  |  950|      0|                                s->pending - (beg)); \
  |  |  951|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (951:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1146|      0|                    flush_pending(strm);
 1147|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1147:25): [True: 0, False: 0]
  ------------------
 1148|      0|                        s->last_flush = -1;
 1149|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1150|      0|                    }
 1151|      0|                    beg = 0;
 1152|      0|                }
 1153|      0|                val = s->gzhead->comment[s->gzindex++];
 1154|      0|                put_byte(s, val);
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1155|      0|            } while (val != 0);
  ------------------
  |  Branch (1155:22): [True: 0, False: 0]
  ------------------
 1156|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  947|      0|    do { \
  |  |  948|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (948:13): [True: 0, False: 0]
  |  |  |  Branch (948:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  949|      0|            strm->adler = crc32(strm->adler, s->pending_buf + (beg), \
  |  |  950|      0|                                s->pending - (beg)); \
  |  |  951|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (951:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1157|      0|        }
 1158|      0|        s->status = HCRC_STATE;
  ------------------
  |  |   65|      0|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
 1159|      0|    }
 1160|  31.0k|    if (s->status == HCRC_STATE) {
  ------------------
  |  |   65|  31.0k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (1160:9): [True: 0, False: 31.0k]
  ------------------
 1161|      0|        if (s->gzhead->hcrc) {
  ------------------
  |  Branch (1161:13): [True: 0, False: 0]
  ------------------
 1162|      0|            if (s->pending + 2 > s->pending_buf_size) {
  ------------------
  |  Branch (1162:17): [True: 0, False: 0]
  ------------------
 1163|      0|                flush_pending(strm);
 1164|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1164:21): [True: 0, False: 0]
  ------------------
 1165|      0|                    s->last_flush = -1;
 1166|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1167|      0|                }
 1168|      0|            }
 1169|      0|            put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1170|      0|            put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1171|      0|            strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1172|      0|        }
 1173|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1174|       |
 1175|       |        /* Compression must start with an empty pending buffer */
 1176|      0|        flush_pending(strm);
 1177|      0|        if (s->pending != 0) {
  ------------------
  |  Branch (1177:13): [True: 0, False: 0]
  ------------------
 1178|      0|            s->last_flush = -1;
 1179|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1180|      0|        }
 1181|      0|    }
 1182|  31.0k|#endif
 1183|       |
 1184|       |    /* Start a new block or continue the current one.
 1185|       |     */
 1186|  31.0k|    if (strm->avail_in != 0 || s->lookahead != 0 ||
  ------------------
  |  Branch (1186:9): [True: 16.5k, False: 14.4k]
  |  Branch (1186:32): [True: 9.07k, False: 5.41k]
  ------------------
 1187|  31.0k|        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |  172|  10.8k|#define Z_NO_FLUSH      0
  ------------------
                      (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |   67|  5.36k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (1187:10): [True: 5.36k, False: 50]
  |  Branch (1187:33): [True: 380, False: 4.98k]
  ------------------
 1188|  26.0k|        block_state bstate;
 1189|       |
 1190|  26.0k|        bstate = s->level == 0 ? deflate_stored(s, flush) :
  ------------------
  |  Branch (1190:18): [True: 0, False: 26.0k]
  ------------------
 1191|  26.0k|                 s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
  ------------------
  |  |  201|  26.0k|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1191:18): [True: 10.3k, False: 15.6k]
  ------------------
 1192|  26.0k|                 s->strategy == Z_RLE ? deflate_rle(s, flush) :
  ------------------
  |  |  202|  15.6k|#define Z_RLE                 3
  ------------------
  |  Branch (1192:18): [True: 6.11k, False: 9.58k]
  ------------------
 1193|  15.6k|                 (*(configuration_table[s->level].func))(s, flush);
 1194|       |
 1195|  26.0k|        if (bstate == finish_started || bstate == finish_done) {
  ------------------
  |  Branch (1195:13): [True: 988, False: 25.0k]
  |  Branch (1195:41): [True: 2.87k, False: 22.1k]
  ------------------
 1196|  3.86k|            s->status = FINISH_STATE;
  ------------------
  |  |   67|  3.86k|#define FINISH_STATE 666    /* stream complete */
  ------------------
 1197|  3.86k|        }
 1198|  26.0k|        if (bstate == need_more || bstate == finish_started) {
  ------------------
  |  Branch (1198:13): [True: 22.1k, False: 3.86k]
  |  Branch (1198:36): [True: 988, False: 2.87k]
  ------------------
 1199|  23.1k|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1199:17): [True: 9.54k, False: 13.5k]
  ------------------
 1200|  9.54k|                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
 1201|  9.54k|            }
 1202|  23.1k|            return Z_OK;
  ------------------
  |  |  181|  23.1k|#define Z_OK            0
  ------------------
 1203|       |            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
 1204|       |             * of deflate should use the same flush parameter to make sure
 1205|       |             * that the flush is complete. So we don't have to output an
 1206|       |             * empty block here, this will be done at next call. This also
 1207|       |             * ensures that for a very small output buffer, we emit at most
 1208|       |             * one empty block.
 1209|       |             */
 1210|  23.1k|        }
 1211|  2.87k|        if (bstate == block_done) {
  ------------------
  |  Branch (1211:13): [True: 0, False: 2.87k]
  ------------------
 1212|      0|            if (flush == Z_PARTIAL_FLUSH) {
  ------------------
  |  |  173|      0|#define Z_PARTIAL_FLUSH 1
  ------------------
  |  Branch (1212:17): [True: 0, False: 0]
  ------------------
 1213|      0|                _tr_align(s);
 1214|      0|            } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
  ------------------
  |  |  177|      0|#define Z_BLOCK         5
  ------------------
  |  Branch (1214:24): [True: 0, False: 0]
  ------------------
 1215|      0|                _tr_stored_block(s, (char*)0, 0L, 0);
 1216|       |                /* For a full flush, this empty block will be recognized
 1217|       |                 * as a special marker by inflate_sync().
 1218|       |                 */
 1219|      0|                if (flush == Z_FULL_FLUSH) {
  ------------------
  |  |  175|      0|#define Z_FULL_FLUSH    3
  ------------------
  |  Branch (1219:21): [True: 0, False: 0]
  ------------------
 1220|      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((Bytef *)s->head, \
  |  |  ------------------
  |  |  |  |  214|      0|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|      0|                 (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  175|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1221|      0|                    if (s->lookahead == 0) {
  ------------------
  |  Branch (1221:25): [True: 0, False: 0]
  ------------------
 1222|      0|                        s->strstart = 0;
 1223|      0|                        s->block_start = 0L;
 1224|      0|                        s->insert = 0;
 1225|      0|                    }
 1226|      0|                }
 1227|      0|            }
 1228|      0|            flush_pending(strm);
 1229|      0|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1229:17): [True: 0, False: 0]
  ------------------
 1230|      0|              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
 1231|      0|              return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1232|      0|            }
 1233|      0|        }
 1234|  2.87k|    }
 1235|       |
 1236|  7.90k|    if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  176|  7.90k|#define Z_FINISH        4
  ------------------
                  if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  181|     50|#define Z_OK            0
  ------------------
  |  Branch (1236:9): [True: 50, False: 7.85k]
  ------------------
 1237|  7.85k|    if (s->wrap <= 0) return Z_STREAM_END;
  ------------------
  |  |  182|  3.99k|#define Z_STREAM_END    1
  ------------------
  |  Branch (1237:9): [True: 3.99k, False: 3.86k]
  ------------------
 1238|       |
 1239|       |    /* Write the trailer */
 1240|  3.86k|#ifdef GZIP
 1241|  3.86k|    if (s->wrap == 2) {
  ------------------
  |  Branch (1241:9): [True: 3.86k, False: 0]
  ------------------
 1242|  3.86k|        put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1243|  3.86k|        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1244|  3.86k|        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1245|  3.86k|        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1246|  3.86k|        put_byte(s, (Byte)(strm->total_in & 0xff));
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1247|  3.86k|        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1248|  3.86k|        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1249|  3.86k|        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
  ------------------
  |  |  290|  3.86k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1250|  3.86k|    }
 1251|      0|    else
 1252|      0|#endif
 1253|      0|    {
 1254|      0|        putShortMSB(s, (uInt)(strm->adler >> 16));
 1255|      0|        putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1256|      0|    }
 1257|  3.86k|    flush_pending(strm);
 1258|       |    /* If avail_out is zero, the application will call deflate again
 1259|       |     * to flush the rest.
 1260|       |     */
 1261|  3.86k|    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
  ------------------
  |  Branch (1261:9): [True: 3.86k, False: 0]
  ------------------
 1262|  3.86k|    return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  181|    138|#define Z_OK            0
  ------------------
                  return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  182|  3.72k|#define Z_STREAM_END    1
  ------------------
  |  Branch (1262:12): [True: 138, False: 3.72k]
  ------------------
 1263|  7.85k|}
deflateEnd:
 1266|  3.86k|int ZEXPORT deflateEnd(z_streamp strm) {
 1267|  3.86k|    int status;
 1268|       |
 1269|  3.86k|    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (1269:9): [True: 0, False: 3.86k]
  ------------------
 1270|       |
 1271|  3.86k|    status = strm->state->status;
 1272|       |
 1273|       |    /* Deallocate in reverse order of allocations: */
 1274|  3.86k|    TRY_FREE(strm, strm->state->pending_buf);
  ------------------
  |  |  251|  3.86k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  250|  3.86k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (251:29): [True: 3.86k, False: 0]
  |  |  ------------------
  ------------------
 1275|  3.86k|    TRY_FREE(strm, strm->state->head);
  ------------------
  |  |  251|  3.86k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  250|  3.86k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (251:29): [True: 3.86k, False: 0]
  |  |  ------------------
  ------------------
 1276|  3.86k|    TRY_FREE(strm, strm->state->prev);
  ------------------
  |  |  251|  3.86k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  250|  3.86k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (251:29): [True: 3.86k, False: 0]
  |  |  ------------------
  ------------------
 1277|  3.86k|    TRY_FREE(strm, strm->state->window);
  ------------------
  |  |  251|  3.86k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  250|  3.86k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (251:29): [True: 3.86k, False: 0]
  |  |  ------------------
  ------------------
 1278|       |
 1279|  3.86k|    ZFREE(strm, strm->state);
  ------------------
  |  |  250|  3.86k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1280|  3.86k|    strm->state = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1281|       |
 1282|  3.86k|    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
  ------------------
  |  |   66|  3.86k|#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.86k|#define Z_OK            0
  ------------------
  |  Branch (1282:12): [True: 0, False: 3.86k]
  ------------------
 1283|  3.86k|}
deflate.c:deflateStateCheck:
  529|  56.4k|local int deflateStateCheck(z_streamp strm) {
  530|  56.4k|    deflate_state *s;
  531|  56.4k|    if (strm == Z_NULL ||
  ------------------
  |  |  216|   112k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (531:9): [True: 0, False: 56.4k]
  ------------------
  532|  56.4k|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (532:9): [True: 0, False: 56.4k]
  |  Branch (532:42): [True: 0, False: 56.4k]
  ------------------
  533|      0|        return 1;
  534|  56.4k|    s = strm->state;
  535|  56.4k|    if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |  216|   112k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |   58|   112k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (535:9): [True: 0, False: 56.4k]
  |  Branch (535:24): [True: 0, False: 56.4k]
  |  Branch (535:44): [True: 52.6k, False: 3.86k]
  ------------------
  536|  56.4k|#ifdef GZIP
  537|  56.4k|                                           s->status != GZIP_STATE &&
  ------------------
  |  |   60|   109k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (537:44): [True: 48.7k, False: 3.86k]
  ------------------
  538|  56.4k|#endif
  539|  56.4k|                                           s->status != EXTRA_STATE &&
  ------------------
  |  |   62|   105k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (539:44): [True: 48.7k, False: 0]
  ------------------
  540|  56.4k|                                           s->status != NAME_STATE &&
  ------------------
  |  |   63|   105k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (540:44): [True: 48.7k, False: 0]
  ------------------
  541|  56.4k|                                           s->status != COMMENT_STATE &&
  ------------------
  |  |   64|   105k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (541:44): [True: 48.7k, False: 0]
  ------------------
  542|  56.4k|                                           s->status != HCRC_STATE &&
  ------------------
  |  |   65|   105k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (542:44): [True: 48.7k, False: 0]
  ------------------
  543|  56.4k|                                           s->status != BUSY_STATE &&
  ------------------
  |  |   66|   105k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
  |  Branch (543:44): [True: 9.08k, False: 39.6k]
  ------------------
  544|  56.4k|                                           s->status != FINISH_STATE))
  ------------------
  |  |   67|  9.08k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (544:44): [True: 0, False: 9.08k]
  ------------------
  545|      0|        return 1;
  546|  56.4k|    return 0;
  547|  56.4k|}
deflate.c:fill_window:
  251|   425k|local void fill_window(deflate_state *s) {
  252|   425k|    unsigned n;
  253|   425k|    unsigned more;    /* Amount of free space at the end of the window. */
  254|   425k|    uInt wsize = s->w_size;
  255|       |
  256|   425k|    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
  257|       |
  258|   425k|    do {
  259|   425k|        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
  260|       |
  261|       |        /* Deal with !@#$% 64K limit: */
  262|   425k|        if (sizeof(int) <= 2) {
  ------------------
  |  Branch (262:13): [Folded - Ignored]
  ------------------
  263|      0|            if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
  ------------------
  |  Branch (263:17): [True: 0, False: 0]
  |  Branch (263:30): [True: 0, False: 0]
  |  Branch (263:50): [True: 0, False: 0]
  ------------------
  264|      0|                more = wsize;
  265|       |
  266|      0|            } else if (more == (unsigned)(-1)) {
  ------------------
  |  Branch (266:24): [True: 0, False: 0]
  ------------------
  267|       |                /* Very unlikely, but possible on 16 bit machine if
  268|       |                 * strstart == 0 && lookahead == 1 (input done a byte at time)
  269|       |                 */
  270|      0|                more--;
  271|      0|            }
  272|      0|        }
  273|       |
  274|       |        /* If the window is almost full and there is insufficient lookahead,
  275|       |         * move the upper half to the lower one to make room in the upper half.
  276|       |         */
  277|   425k|        if (s->strstart >= wsize + MAX_DIST(s)) {
  ------------------
  |  |  298|   425k|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  293|   425k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|   425k|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|   425k|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (277:13): [True: 5.16k, False: 420k]
  ------------------
  278|       |
  279|  5.16k|            zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more);
  ------------------
  |  |  212|  5.16k|#    define zmemcpy memcpy
  ------------------
  280|  5.16k|            s->match_start -= wsize;
  281|  5.16k|            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
  282|  5.16k|            s->block_start -= (long) wsize;
  283|  5.16k|            if (s->insert > s->strstart)
  ------------------
  |  Branch (283:17): [True: 0, False: 5.16k]
  ------------------
  284|      0|                s->insert = s->strstart;
  285|  5.16k|            slide_hash(s);
  286|  5.16k|            more += wsize;
  287|  5.16k|        }
  288|   425k|        if (s->strm->avail_in == 0) break;
  ------------------
  |  Branch (288:13): [True: 408k, False: 16.5k]
  ------------------
  289|       |
  290|       |        /* If there was no sliding:
  291|       |         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
  292|       |         *    more == window_size - lookahead - strstart
  293|       |         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
  294|       |         * => more >= window_size - 2*WSIZE + 2
  295|       |         * In the BIG_MEM or MMAP case (not yet supported),
  296|       |         *   window_size == input_size + MIN_LOOKAHEAD  &&
  297|       |         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
  298|       |         * Otherwise, window_size == 2*WSIZE so more >= 2.
  299|       |         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
  300|       |         */
  301|  16.5k|        Assert(more >= 2, "more < 2");
  302|       |
  303|  16.5k|        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
  304|  16.5k|        s->lookahead += n;
  305|       |
  306|       |        /* Initialize the hash value now that we have some input: */
  307|  16.5k|        if (s->lookahead + s->insert >= MIN_MATCH) {
  ------------------
  |  |   88|  16.5k|#define MIN_MATCH  3
  ------------------
  |  Branch (307:13): [True: 16.4k, False: 61]
  ------------------
  308|  16.4k|            uInt str = s->strstart - s->insert;
  309|  16.4k|            s->ins_h = s->window[str];
  310|  16.4k|            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
  ------------------
  |  |  141|  16.4k|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  ------------------
  311|       |#if MIN_MATCH != 3
  312|       |            Call UPDATE_HASH() MIN_MATCH-3 more times
  313|       |#endif
  314|  16.4k|            while (s->insert) {
  ------------------
  |  Branch (314:20): [True: 0, False: 16.4k]
  ------------------
  315|      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)
  ------------------
  316|      0|#ifndef FASTEST
  317|      0|                s->prev[str & s->w_mask] = s->head[s->ins_h];
  318|      0|#endif
  319|      0|                s->head[s->ins_h] = (Pos)str;
  320|      0|                str++;
  321|      0|                s->insert--;
  322|      0|                if (s->lookahead + s->insert < MIN_MATCH)
  ------------------
  |  |   88|      0|#define MIN_MATCH  3
  ------------------
  |  Branch (322:21): [True: 0, False: 0]
  ------------------
  323|      0|                    break;
  324|      0|            }
  325|  16.4k|        }
  326|       |        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
  327|       |         * but this is not important since only literal bytes will be emitted.
  328|       |         */
  329|       |
  330|  16.5k|    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
  ------------------
  |  |  293|  33.1k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   89|  16.5k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   88|  16.5k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (330:14): [True: 1.65k, False: 14.8k]
  |  Branch (330:46): [True: 0, False: 1.65k]
  ------------------
  331|       |
  332|       |    /* If the WIN_INIT bytes after the end of the current data have never been
  333|       |     * written, then zero those bytes in order to avoid memory check reports of
  334|       |     * the use of uninitialized (or uninitialised as Julian writes) bytes by
  335|       |     * the longest match routines.  Update the high water mark for the next
  336|       |     * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
  337|       |     * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
  338|       |     */
  339|   425k|    if (s->high_water < s->window_size) {
  ------------------
  |  Branch (339:9): [True: 337k, False: 87.9k]
  ------------------
  340|   337k|        ulg curr = s->strstart + (ulg)(s->lookahead);
  341|   337k|        ulg init;
  342|       |
  343|   337k|        if (s->high_water < curr) {
  ------------------
  |  Branch (343:13): [True: 6.68k, False: 330k]
  ------------------
  344|       |            /* Previous high water mark below current data -- zero WIN_INIT
  345|       |             * bytes or up to end of window, whichever is less.
  346|       |             */
  347|  6.68k|            init = s->window_size - curr;
  348|  6.68k|            if (init > WIN_INIT)
  ------------------
  |  |  303|  6.68k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   89|  6.68k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (348:17): [True: 6.07k, False: 611]
  ------------------
  349|  6.07k|                init = WIN_INIT;
  ------------------
  |  |  303|  6.07k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   89|  6.07k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  350|  6.68k|            zmemzero(s->window + curr, (unsigned)init);
  ------------------
  |  |  214|  6.68k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  351|  6.68k|            s->high_water = curr + init;
  352|  6.68k|        }
  353|   330k|        else if (s->high_water < (ulg)curr + WIN_INIT) {
  ------------------
  |  |  303|   330k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   89|   330k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (353:18): [True: 336, False: 330k]
  ------------------
  354|       |            /* High water mark at or above current data, but below current data
  355|       |             * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
  356|       |             * to end of window, whichever is less.
  357|       |             */
  358|    336|            init = (ulg)curr + WIN_INIT - s->high_water;
  ------------------
  |  |  303|    336|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   89|    336|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  359|    336|            if (init > s->window_size - s->high_water)
  ------------------
  |  Branch (359:17): [True: 0, False: 336]
  ------------------
  360|      0|                init = s->window_size - s->high_water;
  361|    336|            zmemzero(s->window + s->high_water, (unsigned)init);
  ------------------
  |  |  214|    336|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  362|    336|            s->high_water += init;
  363|    336|        }
  364|   337k|    }
  365|       |
  366|   425k|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
  367|   425k|           "not enough room for search");
  368|   425k|}
deflate.c:read_buf:
  218|  16.5k|local unsigned read_buf(z_streamp strm, Bytef *buf, unsigned size) {
  219|  16.5k|    unsigned len = strm->avail_in;
  220|       |
  221|  16.5k|    if (len > size) len = size;
  ------------------
  |  Branch (221:9): [True: 0, False: 16.5k]
  ------------------
  222|  16.5k|    if (len == 0) return 0;
  ------------------
  |  Branch (222:9): [True: 0, False: 16.5k]
  ------------------
  223|       |
  224|  16.5k|    strm->avail_in  -= len;
  225|       |
  226|  16.5k|    zmemcpy(buf, strm->next_in, len);
  ------------------
  |  |  212|  16.5k|#    define zmemcpy memcpy
  ------------------
  227|  16.5k|    if (strm->state->wrap == 1) {
  ------------------
  |  Branch (227:9): [True: 0, False: 16.5k]
  ------------------
  228|      0|        strm->adler = adler32(strm->adler, buf, len);
  229|      0|    }
  230|  16.5k|#ifdef GZIP
  231|  16.5k|    else if (strm->state->wrap == 2) {
  ------------------
  |  Branch (231:14): [True: 16.5k, False: 0]
  ------------------
  232|  16.5k|        strm->adler = crc32(strm->adler, buf, len);
  233|  16.5k|    }
  234|  16.5k|#endif
  235|  16.5k|    strm->next_in  += len;
  236|  16.5k|    strm->total_in += len;
  237|       |
  238|  16.5k|    return len;
  239|  16.5k|}
deflate.c:lm_init:
  673|  3.86k|local void lm_init(deflate_state *s) {
  674|  3.86k|    s->window_size = (ulg)2L*s->w_size;
  675|       |
  676|  3.86k|    CLEAR_HASH(s);
  ------------------
  |  |  171|  3.86k|    do { \
  |  |  172|  3.86k|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|  3.86k|#define NIL 0
  |  |  ------------------
  |  |  173|  3.86k|        zmemzero((Bytef *)s->head, \
  |  |  ------------------
  |  |  |  |  214|  3.86k|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|  3.86k|                 (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  175|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  677|       |
  678|       |    /* Set the default configuration parameters:
  679|       |     */
  680|  3.86k|    s->max_lazy_match   = configuration_table[s->level].max_lazy;
  681|  3.86k|    s->good_match       = configuration_table[s->level].good_length;
  682|  3.86k|    s->nice_match       = configuration_table[s->level].nice_length;
  683|  3.86k|    s->max_chain_length = configuration_table[s->level].max_chain;
  684|       |
  685|  3.86k|    s->strstart = 0;
  686|  3.86k|    s->block_start = 0L;
  687|  3.86k|    s->lookahead = 0;
  688|  3.86k|    s->insert = 0;
  689|  3.86k|    s->match_length = s->prev_length = MIN_MATCH-1;
  ------------------
  |  |   88|  3.86k|#define MIN_MATCH  3
  ------------------
  690|  3.86k|    s->match_available = 0;
  691|  3.86k|    s->ins_h = 0;
  692|  3.86k|}
deflate.c:longest_match:
 1356|  27.9M|local uInt longest_match(deflate_state *s, IPos cur_match) {
 1357|  27.9M|    unsigned chain_length = s->max_chain_length;/* max hash chain length */
 1358|  27.9M|    register Bytef *scan = s->window + s->strstart; /* current string */
 1359|  27.9M|    register Bytef *match;                      /* matched string */
 1360|  27.9M|    register int len;                           /* length of current match */
 1361|  27.9M|    int best_len = (int)s->prev_length;         /* best match length so far */
 1362|  27.9M|    int nice_match = s->nice_match;             /* stop if match long enough */
 1363|  27.9M|    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
  ------------------
  |  |  298|  27.9M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  293|  27.9M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|  27.9M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|  27.9M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1363:18): [True: 21.8M, False: 6.10M]
  ------------------
 1364|  21.8M|        s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |  298|  21.8M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  293|  21.8M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|  21.8M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|  21.8M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |   85|  6.10M|#define NIL 0
  ------------------
 1365|       |    /* Stop when cur_match becomes <= limit. To simplify the code,
 1366|       |     * we prevent matches with the string of window index 0.
 1367|       |     */
 1368|  27.9M|    Posf *prev = s->prev;
 1369|  27.9M|    uInt wmask = s->w_mask;
 1370|       |
 1371|       |#ifdef UNALIGNED_OK
 1372|       |    /* Compare two bytes at a time. Note: this is not always beneficial.
 1373|       |     * Try with and without -DUNALIGNED_OK to check.
 1374|       |     */
 1375|       |    register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
 1376|       |    register ush scan_start = *(ushf*)scan;
 1377|       |    register ush scan_end   = *(ushf*)(scan + best_len - 1);
 1378|       |#else
 1379|  27.9M|    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |   89|  27.9M|#define MAX_MATCH  258
  ------------------
 1380|  27.9M|    register Byte scan_end1  = scan[best_len - 1];
 1381|  27.9M|    register Byte scan_end   = scan[best_len];
 1382|  27.9M|#endif
 1383|       |
 1384|       |    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
 1385|       |     * It is easy to get rid of this optimization if necessary.
 1386|       |     */
 1387|  27.9M|    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
 1388|       |
 1389|       |    /* Do not waste too much time if we already have a good match: */
 1390|  27.9M|    if (s->prev_length >= s->good_match) {
  ------------------
  |  Branch (1390:9): [True: 164k, False: 27.7M]
  ------------------
 1391|   164k|        chain_length >>= 2;
 1392|   164k|    }
 1393|       |    /* Do not look for matches beyond the end of the input. This is necessary
 1394|       |     * to make deflate deterministic.
 1395|       |     */
 1396|  27.9M|    if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
  ------------------
  |  Branch (1396:9): [True: 54.6k, False: 27.9M]
  ------------------
 1397|       |
 1398|  27.9M|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
 1399|  27.9M|           "need lookahead");
 1400|       |
 1401|   205M|    do {
 1402|   205M|        Assert(cur_match < s->strstart, "no future");
 1403|   205M|        match = s->window + cur_match;
 1404|       |
 1405|       |        /* Skip to next match if the match length cannot increase
 1406|       |         * or if the match length is less than 2.  Note that the checks below
 1407|       |         * for insufficient lookahead only occur occasionally for performance
 1408|       |         * reasons.  Therefore uninitialized memory will be accessed, and
 1409|       |         * conditional jumps will be made that depend on those values.
 1410|       |         * However the length of the match is limited to the lookahead, so
 1411|       |         * the output of deflate is not affected by the uninitialized values.
 1412|       |         */
 1413|       |#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
 1414|       |        /* This code assumes sizeof(unsigned short) == 2. Do not use
 1415|       |         * UNALIGNED_OK if your compiler uses a different size.
 1416|       |         */
 1417|       |        if (*(ushf*)(match + best_len - 1) != scan_end ||
 1418|       |            *(ushf*)match != scan_start) continue;
 1419|       |
 1420|       |        /* It is not necessary to compare scan[2] and match[2] since they are
 1421|       |         * always equal when the other bytes match, given that the hash keys
 1422|       |         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
 1423|       |         * strstart + 3, + 5, up to strstart + 257. We check for insufficient
 1424|       |         * lookahead only every 4th comparison; the 128th check will be made
 1425|       |         * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is
 1426|       |         * necessary to put more guard bytes at the end of the window, or
 1427|       |         * to check more often for insufficient lookahead.
 1428|       |         */
 1429|       |        Assert(scan[2] == match[2], "scan[2]?");
 1430|       |        scan++, match++;
 1431|       |        do {
 1432|       |        } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1433|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1434|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1435|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1436|       |                 scan < strend);
 1437|       |        /* The funny "do {}" generates better code on most compilers */
 1438|       |
 1439|       |        /* Here, scan <= window + strstart + 257 */
 1440|       |        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1441|       |               "wild scan");
 1442|       |        if (*scan == *match) scan++;
 1443|       |
 1444|       |        len = (MAX_MATCH - 1) - (int)(strend - scan);
 1445|       |        scan = strend - (MAX_MATCH-1);
 1446|       |
 1447|       |#else /* UNALIGNED_OK */
 1448|       |
 1449|   205M|        if (match[best_len]     != scan_end  ||
  ------------------
  |  Branch (1449:13): [True: 169M, False: 36.8M]
  ------------------
 1450|   205M|            match[best_len - 1] != scan_end1 ||
  ------------------
  |  Branch (1450:13): [True: 20.9M, False: 15.9M]
  ------------------
 1451|   205M|            *match              != *scan     ||
  ------------------
  |  Branch (1451:13): [True: 2.67M, False: 13.2M]
  ------------------
 1452|   205M|            *++match            != scan[1])      continue;
  ------------------
  |  Branch (1452:13): [True: 3.07k, False: 13.2M]
  ------------------
 1453|       |
 1454|       |        /* The check at best_len - 1 can be removed because it will be made
 1455|       |         * again later. (This heuristic is not always a win.)
 1456|       |         * It is not necessary to compare scan[2] and match[2] since they
 1457|       |         * are always equal when the other bytes match, given that
 1458|       |         * the hash keys are equal and that HASH_BITS >= 8.
 1459|       |         */
 1460|  13.2M|        scan += 2, match++;
 1461|  13.2M|        Assert(*scan == *match, "match[2]?");
 1462|       |
 1463|       |        /* We check for insufficient lookahead only every 8th comparison;
 1464|       |         * the 256th check will be made at strstart + 258.
 1465|       |         */
 1466|  21.4M|        do {
 1467|  21.4M|        } while (*++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1467:18): [True: 14.5M, False: 6.86M]
  |  Branch (1467:41): [True: 11.4M, False: 3.14M]
  ------------------
 1468|  21.4M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1468:18): [True: 10.0M, False: 1.39M]
  |  Branch (1468:41): [True: 9.27M, False: 734k]
  ------------------
 1469|  21.4M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1469:18): [True: 8.82M, False: 449k]
  |  Branch (1469:41): [True: 8.60M, False: 221k]
  ------------------
 1470|  21.4M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1470:18): [True: 8.36M, False: 234k]
  |  Branch (1470:41): [True: 8.22M, False: 142k]
  ------------------
 1471|  21.4M|                 scan < strend);
  ------------------
  |  Branch (1471:18): [True: 8.14M, False: 77.0k]
  ------------------
 1472|       |
 1473|  13.2M|        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1474|  13.2M|               "wild scan");
 1475|       |
 1476|  13.2M|        len = MAX_MATCH - (int)(strend - scan);
  ------------------
  |  |   89|  13.2M|#define MAX_MATCH  258
  ------------------
 1477|  13.2M|        scan = strend - MAX_MATCH;
  ------------------
  |  |   89|  13.2M|#define MAX_MATCH  258
  ------------------
 1478|       |
 1479|  13.2M|#endif /* UNALIGNED_OK */
 1480|       |
 1481|  13.2M|        if (len > best_len) {
  ------------------
  |  Branch (1481:13): [True: 9.72M, False: 3.55M]
  ------------------
 1482|  9.72M|            s->match_start = cur_match;
 1483|  9.72M|            best_len = len;
 1484|  9.72M|            if (len >= nice_match) break;
  ------------------
  |  Branch (1484:17): [True: 100k, False: 9.62M]
  ------------------
 1485|       |#ifdef UNALIGNED_OK
 1486|       |            scan_end = *(ushf*)(scan + best_len - 1);
 1487|       |#else
 1488|  9.62M|            scan_end1  = scan[best_len - 1];
 1489|  9.62M|            scan_end   = scan[best_len];
 1490|  9.62M|#endif
 1491|  9.62M|        }
 1492|   205M|    } while ((cur_match = prev[cur_match & wmask]) > limit
  ------------------
  |  Branch (1492:14): [True: 178M, False: 27.4M]
  ------------------
 1493|   205M|             && --chain_length != 0);
  ------------------
  |  Branch (1493:17): [True: 178M, False: 379k]
  ------------------
 1494|       |
 1495|  27.9M|    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
  ------------------
  |  Branch (1495:9): [True: 27.9M, False: 675]
  ------------------
 1496|    675|    return s->lookahead;
 1497|  27.9M|}
deflate.c:deflate_slow:
 1923|  9.58k|local block_state deflate_slow(deflate_state *s, int flush) {
 1924|  9.58k|    IPos hash_head;          /* head of hash chain */
 1925|  9.58k|    int bflush;              /* set if current block must be flushed */
 1926|       |
 1927|       |    /* Process the input block. */
 1928|  49.9M|    for (;;) {
 1929|       |        /* Make sure that we always have enough lookahead, except
 1930|       |         * at the end of the input file. We need MAX_MATCH bytes
 1931|       |         * for the next match, plus MIN_MATCH bytes to insert the
 1932|       |         * string following the next match.
 1933|       |         */
 1934|  49.9M|        if (s->lookahead < MIN_LOOKAHEAD) {
  ------------------
  |  |  293|  49.9M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   89|  49.9M|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   88|  49.9M|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (1934:13): [True: 267k, False: 49.6M]
  ------------------
 1935|   267k|            fill_window(s);
 1936|   267k|            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  293|   534k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   89|   267k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   88|   267k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
                          if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|   261k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (1936:17): [True: 261k, False: 5.90k]
  |  Branch (1936:49): [True: 5.16k, False: 256k]
  ------------------
 1937|  5.16k|                return need_more;
 1938|  5.16k|            }
 1939|   261k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (1939:17): [True: 1.98k, False: 259k]
  ------------------
 1940|   261k|        }
 1941|       |
 1942|       |        /* Insert the string window[strstart .. strstart + 2] in the
 1943|       |         * dictionary, and set hash_head to the head of the hash chain:
 1944|       |         */
 1945|  49.9M|        hash_head = NIL;
  ------------------
  |  |   85|  49.9M|#define NIL 0
  ------------------
 1946|  49.9M|        if (s->lookahead >= MIN_MATCH) {
  ------------------
  |  |   88|  49.9M|#define MIN_MATCH  3
  ------------------
  |  Branch (1946:13): [True: 49.9M, False: 2.49k]
  ------------------
 1947|  49.9M|            INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  49.9M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  49.9M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  49.9M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  49.9M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 1948|  49.9M|        }
 1949|       |
 1950|       |        /* Find the longest match, discarding those <= prev_length.
 1951|       |         */
 1952|  49.9M|        s->prev_length = s->match_length, s->prev_match = s->match_start;
 1953|  49.9M|        s->match_length = MIN_MATCH-1;
  ------------------
  |  |   88|  49.9M|#define MIN_MATCH  3
  ------------------
 1954|       |
 1955|  49.9M|        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
  ------------------
  |  |   85|  99.8M|#define NIL 0
  ------------------
  |  Branch (1955:13): [True: 32.7M, False: 17.1M]
  |  Branch (1955:33): [True: 32.5M, False: 233k]
  ------------------
 1956|  49.9M|            s->strstart - hash_head <= MAX_DIST(s)) {
  ------------------
  |  |  298|  32.5M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  293|  32.5M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|  32.5M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|  32.5M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1956:13): [True: 27.9M, False: 4.57M]
  ------------------
 1957|       |            /* To simplify the code, we prevent matches with the string
 1958|       |             * of window index 0 (in particular we have to avoid a match
 1959|       |             * of the string with itself at the start of the input file).
 1960|       |             */
 1961|  27.9M|            s->match_length = longest_match (s, hash_head);
 1962|       |            /* longest_match() sets match_start */
 1963|       |
 1964|  27.9M|            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
  ------------------
  |  |  200|  52.4M|#define Z_FILTERED            1
  ------------------
  |  Branch (1964:17): [True: 26.2M, False: 1.74M]
  |  Branch (1964:42): [True: 12.4M, False: 13.7M]
  ------------------
 1965|  26.2M|#if TOO_FAR <= 32767
 1966|  26.2M|                || (s->match_length == MIN_MATCH &&
  ------------------
  |  |   88|  27.5M|#define MIN_MATCH  3
  ------------------
  |  Branch (1966:21): [True: 1.76M, False: 11.9M]
  ------------------
 1967|  13.7M|                    s->strstart - s->match_start > TOO_FAR)
  ------------------
  |  |   89|  1.76M|#  define TOO_FAR 4096
  ------------------
  |  Branch (1967:21): [True: 585k, False: 1.18M]
  ------------------
 1968|  26.2M|#endif
 1969|  26.2M|                )) {
 1970|       |
 1971|       |                /* If prev_match is also MIN_MATCH, match_start is garbage
 1972|       |                 * but we will ignore the current match anyway.
 1973|       |                 */
 1974|  13.0M|                s->match_length = MIN_MATCH-1;
  ------------------
  |  |   88|  13.0M|#define MIN_MATCH  3
  ------------------
 1975|  13.0M|            }
 1976|  27.9M|        }
 1977|       |        /* If there was a match at the previous step and the current
 1978|       |         * match is not better, output the previous match:
 1979|       |         */
 1980|  49.9M|        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
  ------------------
  |  |   88|  99.8M|#define MIN_MATCH  3
  ------------------
  |  Branch (1980:13): [True: 3.43M, False: 46.4M]
  |  Branch (1980:44): [True: 2.83M, False: 598k]
  ------------------
 1981|  2.83M|            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
  ------------------
  |  |   88|  2.83M|#define MIN_MATCH  3
  ------------------
 1982|       |            /* Do not insert strings in hash table beyond this. */
 1983|       |
 1984|  2.83M|            check_match(s, s->strstart - 1, s->prev_match, s->prev_length);
 1985|       |
 1986|  2.83M|            _tr_tally_dist(s, s->strstart - 1 - s->prev_match,
  ------------------
  |  |  363|  2.83M|  { uch len = (uch)(length); \
  |  |  364|  2.83M|    ush dist = (ush)(distance); \
  |  |  365|  2.83M|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  366|  2.83M|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  367|  2.83M|    s->sym_buf[s->sym_next++] = len; \
  |  |  368|  2.83M|    dist--; \
  |  |  369|  2.83M|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|  2.83M|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  2.83M|#define Freq fc.freq
  |  |  ------------------
  |  |  370|  2.83M|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  318|  2.83M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (318:5): [True: 756k, False: 2.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  2.83M|#define Freq fc.freq
  |  |  ------------------
  |  |  371|  2.83M|    flush = (s->sym_next == s->sym_end); \
  |  |  372|  2.83M|  }
  ------------------
 1987|  2.83M|                           s->prev_length - MIN_MATCH, bflush);
 1988|       |
 1989|       |            /* Insert in hash table all strings up to the end of the match.
 1990|       |             * strstart - 1 and strstart are already inserted. If there is not
 1991|       |             * enough lookahead, the last two strings are not inserted in
 1992|       |             * the hash table.
 1993|       |             */
 1994|  2.83M|            s->lookahead -= s->prev_length - 1;
 1995|  2.83M|            s->prev_length -= 2;
 1996|  35.6M|            do {
 1997|  35.6M|                if (++s->strstart <= max_insert) {
  ------------------
  |  Branch (1997:21): [True: 35.6M, False: 1.47k]
  ------------------
 1998|  35.6M|                    INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  35.6M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  35.6M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  35.6M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  35.6M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 1999|  35.6M|                }
 2000|  35.6M|            } while (--s->prev_length != 0);
  ------------------
  |  Branch (2000:22): [True: 32.7M, False: 2.83M]
  ------------------
 2001|  2.83M|            s->match_available = 0;
 2002|  2.83M|            s->match_length = MIN_MATCH-1;
  ------------------
  |  |   88|  2.83M|#define MIN_MATCH  3
  ------------------
 2003|  2.83M|            s->strstart++;
 2004|       |
 2005|  2.83M|            if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1609|    270|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|    270|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|    270|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|    270|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 184, False: 86]
  |  |  |  |  ------------------
  |  |  |  | 1599|    270|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|    270|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     86|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|    270|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|    270|                (last)); \
  |  |  |  | 1603|    270|   s->block_start = s->strstart; \
  |  |  |  | 1604|    270|   flush_pending(s->strm); \
  |  |  |  | 1605|    270|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|    270|}
  |  |  ------------------
  |  | 1611|    270|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 257, False: 13]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|    270|}
  ------------------
  |  Branch (2005:17): [True: 270, False: 2.83M]
  ------------------
 2006|       |
 2007|  47.0M|        } else if (s->match_available) {
  ------------------
  |  Branch (2007:20): [True: 44.2M, False: 2.83M]
  ------------------
 2008|       |            /* If there was no match at the previous position, output a
 2009|       |             * single literal. If there was a match but the current match
 2010|       |             * is longer, truncate the previous match to a single literal.
 2011|       |             */
 2012|  44.2M|            Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2013|  44.2M|            _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  355|  44.2M|  { uch cc = (c); \
  |  |  356|  44.2M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  357|  44.2M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  358|  44.2M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  359|  44.2M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  44.2M|#define Freq fc.freq
  |  |  ------------------
  |  |  360|  44.2M|    flush = (s->sym_next == s->sym_end); \
  |  |  361|  44.2M|   }
  ------------------
 2014|  44.2M|            if (bflush) {
  ------------------
  |  Branch (2014:17): [True: 2.18k, False: 44.2M]
  ------------------
 2015|  2.18k|                FLUSH_BLOCK_ONLY(s, 0);
  ------------------
  |  | 1597|  2.18k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  | 1598|  2.18k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  ------------------
  |  |  |  Branch (1598:24): [True: 2.07k, False: 116]
  |  |  ------------------
  |  | 1599|  2.18k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  | 1600|  2.18k|                   (charf *)Z_NULL), \
  |  |  ------------------
  |  |  |  |  216|    116|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  ------------------
  |  | 1601|  2.18k|                (ulg)((long)s->strstart - s->block_start), \
  |  | 1602|  2.18k|                (last)); \
  |  | 1603|  2.18k|   s->block_start = s->strstart; \
  |  | 1604|  2.18k|   flush_pending(s->strm); \
  |  | 1605|  2.18k|   Tracev((stderr,"[FLUSH]")); \
  |  | 1606|  2.18k|}
  ------------------
 2016|  2.18k|            }
 2017|  44.2M|            s->strstart++;
 2018|  44.2M|            s->lookahead--;
 2019|  44.2M|            if (s->strm->avail_out == 0) return need_more;
  ------------------
  |  Branch (2019:17): [True: 2.16k, False: 44.2M]
  ------------------
 2020|  44.2M|        } else {
 2021|       |            /* There is no previous match to compare with, wait for
 2022|       |             * the next step to decide.
 2023|       |             */
 2024|  2.83M|            s->match_available = 1;
 2025|  2.83M|            s->strstart++;
 2026|  2.83M|            s->lookahead--;
 2027|  2.83M|        }
 2028|  49.9M|    }
 2029|  1.98k|    Assert (flush != Z_NO_FLUSH, "no flush?");
 2030|  1.98k|    if (s->match_available) {
  ------------------
  |  Branch (2030:9): [True: 1.21k, False: 776]
  ------------------
 2031|  1.21k|        Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2032|  1.21k|        _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  355|  1.21k|  { uch cc = (c); \
  |  |  356|  1.21k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  357|  1.21k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  358|  1.21k|    s->sym_buf[s->sym_next++] = cc; \
  |  |  359|  1.21k|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  1.21k|#define Freq fc.freq
  |  |  ------------------
  |  |  360|  1.21k|    flush = (s->sym_next == s->sym_end); \
  |  |  361|  1.21k|   }
  ------------------
 2033|  1.21k|        s->match_available = 0;
 2034|  1.21k|    }
 2035|  1.98k|    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   88|  1.98k|#define MIN_MATCH  3
  ------------------
                  s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   88|  1.97k|#define MIN_MATCH  3
  ------------------
  |  Branch (2035:17): [True: 13, False: 1.97k]
  ------------------
 2036|  1.98k|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|  1.98k|#define Z_FINISH        4
  ------------------
  |  Branch (2036:9): [True: 1.98k, False: 0]
  ------------------
 2037|  1.98k|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1609|  1.98k|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|  1.98k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|  1.98k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|  1.98k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 1.91k, False: 69]
  |  |  |  |  ------------------
  |  |  |  | 1599|  1.98k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|  1.98k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     69|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|  1.98k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|  1.98k|                (last)); \
  |  |  |  | 1603|  1.98k|   s->block_start = s->strstart; \
  |  |  |  | 1604|  1.98k|   flush_pending(s->strm); \
  |  |  |  | 1605|  1.98k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|  1.98k|}
  |  |  ------------------
  |  | 1611|  1.98k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 598, False: 1.39k]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|  1.98k|}
  ------------------
 2038|  1.39k|        return finish_done;
 2039|  1.98k|    }
 2040|      0|    if (s->sym_next)
  ------------------
  |  Branch (2040:9): [True: 0, False: 0]
  ------------------
 2041|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1609|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1599|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|      0|                (last)); \
  |  |  |  | 1603|      0|   s->block_start = s->strstart; \
  |  |  |  | 1604|      0|   flush_pending(s->strm); \
  |  |  |  | 1605|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|      0|}
  |  |  ------------------
  |  | 1611|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 0, False: 0]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|      0|}
  ------------------
 2042|      0|    return block_done;
 2043|      0|}
deflate.c:slide_hash:
  187|  5.16k|local void slide_hash(deflate_state *s) {
  188|  5.16k|    unsigned n, m;
  189|  5.16k|    Posf *p;
  190|  5.16k|    uInt wsize = s->w_size;
  191|       |
  192|  5.16k|    n = s->hash_size;
  193|  5.16k|    p = &s->head[n];
  194|   169M|    do {
  195|   169M|        m = *--p;
  196|   169M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|   150M|#define NIL 0
  ------------------
  |  Branch (196:20): [True: 18.4M, False: 150M]
  ------------------
  197|   169M|    } while (--n);
  ------------------
  |  Branch (197:14): [True: 169M, False: 5.16k]
  ------------------
  198|  5.16k|    n = wsize;
  199|  5.16k|#ifndef FASTEST
  200|  5.16k|    p = &s->prev[n];
  201|   169M|    do {
  202|   169M|        m = *--p;
  203|   169M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|   130M|#define NIL 0
  ------------------
  |  Branch (203:20): [True: 38.8M, False: 130M]
  ------------------
  204|       |        /* If n is not on any hash chain, prev[n] is garbage but
  205|       |         * its value will never be used.
  206|       |         */
  207|   169M|    } while (--n);
  ------------------
  |  Branch (207:14): [True: 169M, False: 5.16k]
  ------------------
  208|  5.16k|#endif
  209|  5.16k|}
deflate.c:flush_pending:
  923|  38.0k|local void flush_pending(z_streamp strm) {
  924|  38.0k|    unsigned len;
  925|  38.0k|    deflate_state *s = strm->state;
  926|       |
  927|  38.0k|    _tr_flush_bits(s);
  928|  38.0k|    len = s->pending;
  929|  38.0k|    if (len > strm->avail_out) len = strm->avail_out;
  ------------------
  |  Branch (929:9): [True: 16.5k, False: 21.4k]
  ------------------
  930|  38.0k|    if (len == 0) return;
  ------------------
  |  Branch (930:9): [True: 0, False: 38.0k]
  ------------------
  931|       |
  932|  38.0k|    zmemcpy(strm->next_out, s->pending_out, len);
  ------------------
  |  |  212|  38.0k|#    define zmemcpy memcpy
  ------------------
  933|  38.0k|    strm->next_out  += len;
  934|  38.0k|    s->pending_out  += len;
  935|  38.0k|    strm->total_out += len;
  936|  38.0k|    strm->avail_out -= len;
  937|  38.0k|    s->pending      -= len;
  938|  38.0k|    if (s->pending == 0) {
  ------------------
  |  Branch (938:9): [True: 21.4k, False: 16.5k]
  ------------------
  939|  21.4k|        s->pending_out = s->pending_buf;
  940|  21.4k|    }
  941|  38.0k|}
deflate.c:deflate_rle:
 2051|  6.11k|local block_state deflate_rle(deflate_state *s, int flush) {
 2052|  6.11k|    int bflush;             /* set if current block must be flushed */
 2053|  6.11k|    uInt prev;              /* byte at distance one to match */
 2054|  6.11k|    Bytef *scan, *strend;   /* scan goes up to strend for length of run */
 2055|       |
 2056|  42.8M|    for (;;) {
 2057|       |        /* Make sure that we always have enough lookahead, except
 2058|       |         * at the end of the input file. We need MAX_MATCH bytes
 2059|       |         * for the longest run, plus one for the unrolled loop.
 2060|       |         */
 2061|  42.8M|        if (s->lookahead <= MAX_MATCH) {
  ------------------
  |  |   89|  42.8M|#define MAX_MATCH  258
  ------------------
  |  Branch (2061:13): [True: 146k, False: 42.6M]
  ------------------
 2062|   146k|            fill_window(s);
 2063|   146k|            if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
  ------------------
  |  |   89|   292k|#define MAX_MATCH  258
  ------------------
                          if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|   142k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2063:17): [True: 142k, False: 3.65k]
  |  Branch (2063:46): [True: 3.32k, False: 139k]
  ------------------
 2064|  3.32k|                return need_more;
 2065|  3.32k|            }
 2066|   143k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (2066:17): [True: 982, False: 142k]
  ------------------
 2067|   143k|        }
 2068|       |
 2069|       |        /* See how many times the previous byte repeats */
 2070|  42.8M|        s->match_length = 0;
 2071|  42.8M|        if (s->lookahead >= MIN_MATCH && s->strstart > 0) {
  ------------------
  |  |   88|  85.6M|#define MIN_MATCH  3
  ------------------
  |  Branch (2071:13): [True: 42.8M, False: 1.36k]
  |  Branch (2071:42): [True: 42.8M, False: 970]
  ------------------
 2072|  42.8M|            scan = s->window + s->strstart - 1;
 2073|  42.8M|            prev = *scan;
 2074|  42.8M|            if (prev == *++scan && prev == *++scan && prev == *++scan) {
  ------------------
  |  Branch (2074:17): [True: 7.32M, False: 35.4M]
  |  Branch (2074:36): [True: 1.06M, False: 6.26M]
  |  Branch (2074:55): [True: 524k, False: 539k]
  ------------------
 2075|   524k|                strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |   89|   524k|#define MAX_MATCH  258
  ------------------
 2076|  1.76M|                do {
 2077|  1.76M|                } while (prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2077:26): [True: 1.72M, False: 38.4k]
  |  Branch (2077:45): [True: 1.35M, False: 370k]
  ------------------
 2078|  1.76M|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2078:26): [True: 1.34M, False: 11.8k]
  |  Branch (2078:45): [True: 1.33M, False: 9.87k]
  ------------------
 2079|  1.76M|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2079:26): [True: 1.31M, False: 13.5k]
  |  Branch (2079:45): [True: 1.28M, False: 31.1k]
  ------------------
 2080|  1.76M|                         prev == *++scan && prev == *++scan &&
  ------------------
  |  Branch (2080:26): [True: 1.27M, False: 11.2k]
  |  Branch (2080:45): [True: 1.26M, False: 11.5k]
  ------------------
 2081|  1.76M|                         scan < strend);
  ------------------
  |  Branch (2081:26): [True: 1.23M, False: 25.9k]
  ------------------
 2082|   524k|                s->match_length = MAX_MATCH - (uInt)(strend - scan);
  ------------------
  |  |   89|   524k|#define MAX_MATCH  258
  ------------------
 2083|   524k|                if (s->match_length > s->lookahead)
  ------------------
  |  Branch (2083:21): [True: 85, False: 523k]
  ------------------
 2084|     85|                    s->match_length = s->lookahead;
 2085|   524k|            }
 2086|  42.8M|            Assert(scan <= s->window + (uInt)(s->window_size - 1),
 2087|  42.8M|                   "wild scan");
 2088|  42.8M|        }
 2089|       |
 2090|       |        /* Emit match if have run of MIN_MATCH or longer, else emit literal */
 2091|  42.8M|        if (s->match_length >= MIN_MATCH) {
  ------------------
  |  |   88|  42.8M|#define MIN_MATCH  3
  ------------------
  |  Branch (2091:13): [True: 524k, False: 42.2M]
  ------------------
 2092|   524k|            check_match(s, s->strstart, s->strstart - 1, s->match_length);
 2093|       |
 2094|   524k|            _tr_tally_dist(s, 1, s->match_length - MIN_MATCH, bflush);
  ------------------
  |  |  363|   524k|  { uch len = (uch)(length); \
  |  |  364|   524k|    ush dist = (ush)(distance); \
  |  |  365|   524k|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  366|   524k|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  367|   524k|    s->sym_buf[s->sym_next++] = len; \
  |  |  368|   524k|    dist--; \
  |  |  369|   524k|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|   524k|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   524k|#define Freq fc.freq
  |  |  ------------------
  |  |  370|   524k|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  318|   524k|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (318:5): [True: 524k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   524k|#define Freq fc.freq
  |  |  ------------------
  |  |  371|   524k|    flush = (s->sym_next == s->sym_end); \
  |  |  372|   524k|  }
  ------------------
 2095|       |
 2096|   524k|            s->lookahead -= s->match_length;
 2097|   524k|            s->strstart += s->match_length;
 2098|   524k|            s->match_length = 0;
 2099|  42.2M|        } else {
 2100|       |            /* No match, output a literal byte */
 2101|  42.2M|            Tracevv((stderr,"%c", s->window[s->strstart]));
 2102|  42.2M|            _tr_tally_lit(s, s->window[s->strstart], bflush);
  ------------------
  |  |  355|  42.2M|  { uch cc = (c); \
  |  |  356|  42.2M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  357|  42.2M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  358|  42.2M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  359|  42.2M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  42.2M|#define Freq fc.freq
  |  |  ------------------
  |  |  360|  42.2M|    flush = (s->sym_next == s->sym_end); \
  |  |  361|  42.2M|   }
  ------------------
 2103|  42.2M|            s->lookahead--;
 2104|  42.2M|            s->strstart++;
 2105|  42.2M|        }
 2106|  42.8M|        if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1609|  2.41k|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|  2.41k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|  2.41k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|  2.41k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 2.30k, False: 115]
  |  |  |  |  ------------------
  |  |  |  | 1599|  2.41k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|  2.41k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|    115|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|  2.41k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|  2.41k|                (last)); \
  |  |  |  | 1603|  2.41k|   s->block_start = s->strstart; \
  |  |  |  | 1604|  2.41k|   flush_pending(s->strm); \
  |  |  |  | 1605|  2.41k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|  2.41k|}
  |  |  ------------------
  |  | 1611|  2.41k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 1.80k, False: 606]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|  2.41k|}
  ------------------
  |  Branch (2106:13): [True: 2.41k, False: 42.8M]
  ------------------
 2107|  42.8M|    }
 2108|    982|    s->insert = 0;
 2109|    982|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|    982|#define Z_FINISH        4
  ------------------
  |  Branch (2109:9): [True: 982, False: 0]
  ------------------
 2110|    982|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1609|    982|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|    982|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|    982|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|    982|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 941, False: 41]
  |  |  |  |  ------------------
  |  |  |  | 1599|    982|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|    982|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     41|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|    982|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|    982|                (last)); \
  |  |  |  | 1603|    982|   s->block_start = s->strstart; \
  |  |  |  | 1604|    982|   flush_pending(s->strm); \
  |  |  |  | 1605|    982|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|    982|}
  |  |  ------------------
  |  | 1611|    982|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 184, False: 798]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|    982|}
  ------------------
 2111|    798|        return finish_done;
 2112|    982|    }
 2113|      0|    if (s->sym_next)
  ------------------
  |  Branch (2113:9): [True: 0, False: 0]
  ------------------
 2114|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1609|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1599|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|      0|                (last)); \
  |  |  |  | 1603|      0|   s->block_start = s->strstart; \
  |  |  |  | 1604|      0|   flush_pending(s->strm); \
  |  |  |  | 1605|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|      0|}
  |  |  ------------------
  |  | 1611|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 0, False: 0]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|      0|}
  ------------------
 2115|      0|    return block_done;
 2116|      0|}
deflate.c:deflate_huff:
 2122|  10.3k|local block_state deflate_huff(deflate_state *s, int flush) {
 2123|  10.3k|    int bflush;             /* set if current block must be flushed */
 2124|       |
 2125|  84.6M|    for (;;) {
 2126|       |        /* Make sure that we have a literal to write. */
 2127|  84.6M|        if (s->lookahead == 0) {
  ------------------
  |  Branch (2127:13): [True: 11.7k, False: 84.6M]
  ------------------
 2128|  11.7k|            fill_window(s);
 2129|  11.7k|            if (s->lookahead == 0) {
  ------------------
  |  Branch (2129:17): [True: 5.98k, False: 5.79k]
  ------------------
 2130|  5.98k|                if (flush == Z_NO_FLUSH)
  ------------------
  |  |  172|  5.98k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2130:21): [True: 5.09k, False: 890]
  ------------------
 2131|  5.09k|                    return need_more;
 2132|    890|                break;      /* flush the current block */
 2133|  5.98k|            }
 2134|  11.7k|        }
 2135|       |
 2136|       |        /* Output a literal byte */
 2137|  84.6M|        s->match_length = 0;
 2138|  84.6M|        Tracevv((stderr,"%c", s->window[s->strstart]));
 2139|  84.6M|        _tr_tally_lit(s, s->window[s->strstart], bflush);
  ------------------
  |  |  355|  84.6M|  { uch cc = (c); \
  |  |  356|  84.6M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  357|  84.6M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  358|  84.6M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  359|  84.6M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  84.6M|#define Freq fc.freq
  |  |  ------------------
  |  |  360|  84.6M|    flush = (s->sym_next == s->sym_end); \
  |  |  361|  84.6M|   }
  ------------------
 2140|  84.6M|        s->lookahead--;
 2141|  84.6M|        s->strstart++;
 2142|  84.6M|        if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1609|  5.03k|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|  5.03k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|  5.03k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|  5.03k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 5.03k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1599|  5.03k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|  5.03k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|  5.03k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|  5.03k|                (last)); \
  |  |  |  | 1603|  5.03k|   s->block_start = s->strstart; \
  |  |  |  | 1604|  5.03k|   flush_pending(s->strm); \
  |  |  |  | 1605|  5.03k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|  5.03k|}
  |  |  ------------------
  |  | 1611|  5.03k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 4.32k, False: 705]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|  5.03k|}
  ------------------
  |  Branch (2142:13): [True: 5.03k, False: 84.6M]
  ------------------
 2143|  84.6M|    }
 2144|    890|    s->insert = 0;
 2145|    890|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|    890|#define Z_FINISH        4
  ------------------
  |  Branch (2145:9): [True: 890, False: 0]
  ------------------
 2146|    890|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1609|    890|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|    890|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|    890|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|    890|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 890, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1599|    890|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|    890|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|    890|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|    890|                (last)); \
  |  |  |  | 1603|    890|   s->block_start = s->strstart; \
  |  |  |  | 1604|    890|   flush_pending(s->strm); \
  |  |  |  | 1605|    890|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|    890|}
  |  |  ------------------
  |  | 1611|    890|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 206, False: 684]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|    890|}
  ------------------
 2147|    684|        return finish_done;
 2148|    890|    }
 2149|      0|    if (s->sym_next)
  ------------------
  |  Branch (2149:9): [True: 0, False: 0]
  ------------------
 2150|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1609|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1599|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|      0|                (last)); \
  |  |  |  | 1603|      0|   s->block_start = s->strstart; \
  |  |  |  | 1604|      0|   flush_pending(s->strm); \
  |  |  |  | 1605|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|      0|}
  |  |  ------------------
  |  | 1611|      0|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 0, False: 0]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|      0|}
  ------------------
 2151|      0|    return block_done;
 2152|      0|}

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

gzopen:
  263|  7.72k|gzFile ZEXPORT gzopen(const char *path, const char *mode) {
  264|  7.72k|    return gz_open(path, -1, mode);
  265|  7.72k|}
gz_error:
  532|  15.4k|void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
  533|       |    /* free previously allocated message and clear */
  534|  15.4k|    if (state->msg != NULL) {
  ------------------
  |  Branch (534:9): [True: 0, False: 15.4k]
  ------------------
  535|      0|        if (state->err != Z_MEM_ERROR)
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (535:13): [True: 0, False: 0]
  ------------------
  536|      0|            free(state->msg);
  537|      0|        state->msg = NULL;
  538|      0|    }
  539|       |
  540|       |    /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
  541|  15.4k|    if (err != Z_OK && err != Z_BUF_ERROR)
  ------------------
  |  |  181|  30.8k|#define Z_OK            0
  ------------------
                  if (err != Z_OK && err != Z_BUF_ERROR)
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (541:9): [True: 0, False: 15.4k]
  |  Branch (541:24): [True: 0, False: 0]
  ------------------
  542|      0|        state->x.have = 0;
  543|       |
  544|       |    /* set error code, and if no message, then done */
  545|  15.4k|    state->err = err;
  546|  15.4k|    if (msg == NULL)
  ------------------
  |  Branch (546:9): [True: 15.4k, False: 0]
  ------------------
  547|  15.4k|        return;
  548|       |
  549|       |    /* for an out of memory error, return literal string when requested */
  550|      0|    if (err == Z_MEM_ERROR)
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (550:9): [True: 0, False: 0]
  ------------------
  551|      0|        return;
  552|       |
  553|       |    /* construct error message with path */
  554|      0|    if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
  ------------------
  |  Branch (554:9): [True: 0, False: 0]
  ------------------
  555|      0|            NULL) {
  556|      0|        state->err = Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  557|      0|        return;
  558|      0|    }
  559|      0|#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
  560|      0|    (void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
  561|      0|                   "%s%s%s", state->path, ": ", msg);
  562|       |#else
  563|       |    strcpy(state->msg, state->path);
  564|       |    strcat(state->msg, ": ");
  565|       |    strcat(state->msg, msg);
  566|       |#endif
  567|      0|}
gzlib.c:gz_open:
   85|  7.72k|local gzFile gz_open(const void *path, int fd, const char *mode) {
   86|  7.72k|    gz_statep state;
   87|  7.72k|    z_size_t len;
   88|  7.72k|    int oflag;
   89|  7.72k|#ifdef O_CLOEXEC
   90|  7.72k|    int cloexec = 0;
   91|  7.72k|#endif
   92|  7.72k|#ifdef O_EXCL
   93|  7.72k|    int exclusive = 0;
   94|  7.72k|#endif
   95|       |
   96|       |    /* check input */
   97|  7.72k|    if (path == NULL)
  ------------------
  |  Branch (97:9): [True: 0, False: 7.72k]
  ------------------
   98|      0|        return NULL;
   99|       |
  100|       |    /* allocate gzFile structure to return */
  101|  7.72k|    state = (gz_statep)malloc(sizeof(gz_state));
  102|  7.72k|    if (state == NULL)
  ------------------
  |  Branch (102:9): [True: 0, False: 7.72k]
  ------------------
  103|      0|        return NULL;
  104|  7.72k|    state->size = 0;            /* no buffers allocated yet */
  105|  7.72k|    state->want = GZBUFSIZE;    /* requested buffer size */
  ------------------
  |  |  156|  7.72k|#define GZBUFSIZE 8192
  ------------------
  106|  7.72k|    state->msg = NULL;          /* no error message yet */
  107|       |
  108|       |    /* interpret mode */
  109|  7.72k|    state->mode = GZ_NONE;
  ------------------
  |  |  159|  7.72k|#define GZ_NONE 0
  ------------------
  110|  7.72k|    state->level = Z_DEFAULT_COMPRESSION;
  ------------------
  |  |  197|  7.72k|#define Z_DEFAULT_COMPRESSION  (-1)
  ------------------
  111|  7.72k|    state->strategy = Z_DEFAULT_STRATEGY;
  ------------------
  |  |  204|  7.72k|#define Z_DEFAULT_STRATEGY    0
  ------------------
  112|  7.72k|    state->direct = 0;
  113|  29.1k|    while (*mode) {
  ------------------
  |  Branch (113:12): [True: 21.3k, False: 7.72k]
  ------------------
  114|  21.3k|        if (*mode >= '0' && *mode <= '9')
  ------------------
  |  Branch (114:13): [True: 18.0k, False: 3.32k]
  |  Branch (114:29): [True: 0, False: 18.0k]
  ------------------
  115|      0|            state->level = *mode - '0';
  116|  21.3k|        else
  117|  21.3k|            switch (*mode) {
  118|  3.86k|            case 'r':
  ------------------
  |  Branch (118:13): [True: 3.86k, False: 17.5k]
  ------------------
  119|  3.86k|                state->mode = GZ_READ;
  ------------------
  |  |  160|  3.86k|#define GZ_READ 7247
  ------------------
  120|  3.86k|                break;
  121|      0|#ifndef NO_GZCOMPRESS
  122|  3.86k|            case 'w':
  ------------------
  |  Branch (122:13): [True: 3.86k, False: 17.5k]
  ------------------
  123|  3.86k|                state->mode = GZ_WRITE;
  ------------------
  |  |  161|  3.86k|#define GZ_WRITE 31153
  ------------------
  124|  3.86k|                break;
  125|      0|            case 'a':
  ------------------
  |  Branch (125:13): [True: 0, False: 21.3k]
  ------------------
  126|      0|                state->mode = GZ_APPEND;
  ------------------
  |  |  162|      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: 21.3k]
  ------------------
  130|      0|                free(state);
  131|      0|                return NULL;
  132|  7.72k|            case 'b':       /* ignore -- will request binary anyway */
  ------------------
  |  Branch (132:13): [True: 7.72k, False: 13.6k]
  ------------------
  133|  7.72k|                break;
  134|      0|#ifdef O_CLOEXEC
  135|      0|            case 'e':
  ------------------
  |  Branch (135:13): [True: 0, False: 21.3k]
  ------------------
  136|      0|                cloexec = 1;
  137|      0|                break;
  138|      0|#endif
  139|      0|#ifdef O_EXCL
  140|      0|            case 'x':
  ------------------
  |  Branch (140:13): [True: 0, False: 21.3k]
  ------------------
  141|      0|                exclusive = 1;
  142|      0|                break;
  143|      0|#endif
  144|    743|            case 'f':
  ------------------
  |  Branch (144:13): [True: 743, False: 20.6k]
  ------------------
  145|    743|                state->strategy = Z_FILTERED;
  ------------------
  |  |  200|    743|#define Z_FILTERED            1
  ------------------
  146|    743|                break;
  147|    890|            case 'h':
  ------------------
  |  Branch (147:13): [True: 890, False: 20.4k]
  ------------------
  148|    890|                state->strategy = Z_HUFFMAN_ONLY;
  ------------------
  |  |  201|    890|#define Z_HUFFMAN_ONLY        2
  ------------------
  149|    890|                break;
  150|    982|            case 'R':
  ------------------
  |  Branch (150:13): [True: 982, False: 20.4k]
  ------------------
  151|    982|                state->strategy = Z_RLE;
  ------------------
  |  |  202|    982|#define Z_RLE                 3
  ------------------
  152|    982|                break;
  153|      0|            case 'F':
  ------------------
  |  Branch (153:13): [True: 0, False: 21.3k]
  ------------------
  154|      0|                state->strategy = Z_FIXED;
  ------------------
  |  |  203|      0|#define Z_FIXED               4
  ------------------
  155|      0|                break;
  156|      0|            case 'T':
  ------------------
  |  Branch (156:13): [True: 0, False: 21.3k]
  ------------------
  157|      0|                state->direct = 1;
  158|      0|                break;
  159|  3.32k|            default:        /* could consider as an error, but just ignore */
  ------------------
  |  Branch (159:13): [True: 3.32k, False: 18.0k]
  ------------------
  160|  3.32k|                ;
  161|  21.3k|            }
  162|  21.3k|        mode++;
  163|  21.3k|    }
  164|       |
  165|       |    /* must provide an "r", "w", or "a" */
  166|  7.72k|    if (state->mode == GZ_NONE) {
  ------------------
  |  |  159|  7.72k|#define GZ_NONE 0
  ------------------
  |  Branch (166:9): [True: 0, False: 7.72k]
  ------------------
  167|      0|        free(state);
  168|      0|        return NULL;
  169|      0|    }
  170|       |
  171|       |    /* can't force transparent read */
  172|  7.72k|    if (state->mode == GZ_READ) {
  ------------------
  |  |  160|  7.72k|#define GZ_READ 7247
  ------------------
  |  Branch (172:9): [True: 3.86k, False: 3.86k]
  ------------------
  173|  3.86k|        if (state->direct) {
  ------------------
  |  Branch (173:13): [True: 0, False: 3.86k]
  ------------------
  174|      0|            free(state);
  175|      0|            return NULL;
  176|      0|        }
  177|  3.86k|        state->direct = 1;      /* for empty file */
  178|  3.86k|    }
  179|       |
  180|       |    /* save the path name for error messages */
  181|       |#ifdef WIDECHAR
  182|       |    if (fd == -2)
  183|       |        len = wcstombs(NULL, path, 0);
  184|       |    else
  185|       |#endif
  186|  7.72k|        len = strlen((const char *)path);
  187|  7.72k|    state->path = (char *)malloc(len + 1);
  188|  7.72k|    if (state->path == NULL) {
  ------------------
  |  Branch (188:9): [True: 0, False: 7.72k]
  ------------------
  189|      0|        free(state);
  190|      0|        return NULL;
  191|      0|    }
  192|       |#ifdef WIDECHAR
  193|       |    if (fd == -2) {
  194|       |        if (len)
  195|       |            wcstombs(state->path, path, len + 1);
  196|       |        else
  197|       |            *(state->path) = 0;
  198|       |    }
  199|       |    else
  200|       |#endif
  201|  7.72k|    {
  202|  7.72k|#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
  203|  7.72k|        (void)snprintf(state->path, len + 1, "%s", (const char *)path);
  204|       |#else
  205|       |        strcpy(state->path, path);
  206|       |#endif
  207|  7.72k|    }
  208|       |
  209|       |    /* compute the flags for open() */
  210|  7.72k|    oflag =
  211|  7.72k|#ifdef O_LARGEFILE
  212|  7.72k|        O_LARGEFILE |
  213|  7.72k|#endif
  214|       |#ifdef O_BINARY
  215|       |        O_BINARY |
  216|       |#endif
  217|  7.72k|#ifdef O_CLOEXEC
  218|  7.72k|        (cloexec ? O_CLOEXEC : 0) |
  ------------------
  |  Branch (218:10): [True: 0, False: 7.72k]
  ------------------
  219|  7.72k|#endif
  220|  7.72k|        (state->mode == GZ_READ ?
  ------------------
  |  |  160|  7.72k|#define GZ_READ 7247
  ------------------
  |  Branch (220:10): [True: 3.86k, False: 3.86k]
  ------------------
  221|  3.86k|         O_RDONLY :
  222|  7.72k|         (O_WRONLY | O_CREAT |
  223|  3.86k|#ifdef O_EXCL
  224|  3.86k|          (exclusive ? O_EXCL : 0) |
  ------------------
  |  Branch (224:12): [True: 0, False: 3.86k]
  ------------------
  225|  3.86k|#endif
  226|  3.86k|          (state->mode == GZ_WRITE ?
  ------------------
  |  |  161|  3.86k|#define GZ_WRITE 31153
  ------------------
  |  Branch (226:12): [True: 3.86k, False: 0]
  ------------------
  227|  3.86k|           O_TRUNC :
  228|  3.86k|           O_APPEND)));
  229|       |
  230|       |    /* open the file with the appropriate flags (or just use fd) */
  231|  7.72k|    if (fd == -1)
  ------------------
  |  Branch (231:9): [True: 7.72k, False: 0]
  ------------------
  232|  7.72k|        state->fd = open((const char *)path, oflag, 0666);
  233|       |#ifdef WIDECHAR
  234|       |    else if (fd == -2)
  235|       |        state->fd = _wopen(path, oflag, _S_IREAD | _S_IWRITE);
  236|       |#endif
  237|      0|    else
  238|      0|        state->fd = fd;
  239|  7.72k|    if (state->fd == -1) {
  ------------------
  |  Branch (239:9): [True: 0, False: 7.72k]
  ------------------
  240|      0|        free(state->path);
  241|      0|        free(state);
  242|      0|        return NULL;
  243|      0|    }
  244|  7.72k|    if (state->mode == GZ_APPEND) {
  ------------------
  |  |  162|  7.72k|#define GZ_APPEND 1     /* mode set to GZ_WRITE after the file is opened */
  ------------------
  |  Branch (244:9): [True: 0, False: 7.72k]
  ------------------
  245|      0|        LSEEK(state->fd, 0, SEEK_END);  /* so gzoffset() is correct */
  ------------------
  |  |   13|      0|#  define LSEEK lseek64
  ------------------
  246|      0|        state->mode = GZ_WRITE;         /* simplify later checks */
  ------------------
  |  |  161|      0|#define GZ_WRITE 31153
  ------------------
  247|      0|    }
  248|       |
  249|       |    /* save the current position for rewinding (only if reading) */
  250|  7.72k|    if (state->mode == GZ_READ) {
  ------------------
  |  |  160|  7.72k|#define GZ_READ 7247
  ------------------
  |  Branch (250:9): [True: 3.86k, False: 3.86k]
  ------------------
  251|  3.86k|        state->start = LSEEK(state->fd, 0, SEEK_CUR);
  ------------------
  |  |   13|  3.86k|#  define LSEEK lseek64
  ------------------
  252|  3.86k|        if (state->start == -1) state->start = 0;
  ------------------
  |  Branch (252:13): [True: 0, False: 3.86k]
  ------------------
  253|  3.86k|    }
  254|       |
  255|       |    /* initialize stream */
  256|  7.72k|    gz_reset(state);
  257|       |
  258|       |    /* return stream */
  259|  7.72k|    return (gzFile)state;
  260|  7.72k|}
gzlib.c:gz_reset:
   69|  7.72k|local void gz_reset(gz_statep state) {
   70|  7.72k|    state->x.have = 0;              /* no output data available */
   71|  7.72k|    if (state->mode == GZ_READ) {   /* for reading ... */
  ------------------
  |  |  160|  7.72k|#define GZ_READ 7247
  ------------------
  |  Branch (71:9): [True: 3.86k, False: 3.86k]
  ------------------
   72|  3.86k|        state->eof = 0;             /* not at end of file */
   73|  3.86k|        state->past = 0;            /* have not read past end yet */
   74|  3.86k|        state->how = LOOK;          /* look for gzip header */
  ------------------
  |  |  165|  3.86k|#define LOOK 0      /* look for a gzip header */
  ------------------
   75|  3.86k|    }
   76|  3.86k|    else                            /* for writing ... */
   77|  3.86k|        state->reset = 0;           /* no deflateReset pending */
   78|  7.72k|    state->seek = 0;                /* no seek request pending */
   79|  7.72k|    gz_error(state, Z_OK, NULL);    /* clear error */
  ------------------
  |  |  181|  7.72k|#define Z_OK            0
  ------------------
   80|  7.72k|    state->x.pos = 0;               /* no uncompressed data yet */
   81|  7.72k|    state->strm.avail_in = 0;       /* no input data yet */
   82|  7.72k|}

gzread:
  345|  11.4k|int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) {
  346|  11.4k|    gz_statep state;
  347|       |
  348|       |    /* get internal structure */
  349|  11.4k|    if (file == NULL)
  ------------------
  |  Branch (349:9): [True: 0, False: 11.4k]
  ------------------
  350|      0|        return -1;
  351|  11.4k|    state = (gz_statep)file;
  352|       |
  353|       |    /* check that we're reading and that there's no (serious) error */
  354|  11.4k|    if (state->mode != GZ_READ ||
  ------------------
  |  |  160|  22.9k|#define GZ_READ 7247
  ------------------
  |  Branch (354:9): [True: 0, False: 11.4k]
  ------------------
  355|  11.4k|            (state->err != Z_OK && state->err != Z_BUF_ERROR))
  ------------------
  |  |  181|  22.9k|#define Z_OK            0
  ------------------
                          (state->err != Z_OK && state->err != Z_BUF_ERROR))
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (355:14): [True: 0, False: 11.4k]
  |  Branch (355:36): [True: 0, False: 0]
  ------------------
  356|      0|        return -1;
  357|       |
  358|       |    /* since an int is returned, make sure len fits in one, otherwise return
  359|       |       with an error (this avoids a flaw in the interface) */
  360|  11.4k|    if ((int)len < 0) {
  ------------------
  |  Branch (360:9): [True: 0, False: 11.4k]
  ------------------
  361|      0|        gz_error(state, Z_STREAM_ERROR, "request does not fit in an int");
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  362|      0|        return -1;
  363|      0|    }
  364|       |
  365|       |    /* read len or fewer bytes to buf */
  366|  11.4k|    len = (unsigned)gz_read(state, buf, len);
  367|       |
  368|       |    /* check for an error */
  369|  11.4k|    if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  181|  15.3k|#define Z_OK            0
  ------------------
                  if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (369:9): [True: 3.86k, False: 7.62k]
  |  Branch (369:21): [True: 0, False: 3.86k]
  |  Branch (369:43): [True: 0, False: 0]
  ------------------
  370|      0|        return -1;
  371|       |
  372|       |    /* return the number of bytes read (this is assured to fit in an int) */
  373|  11.4k|    return (int)len;
  374|  11.4k|}
gzclose_r:
  578|  3.86k|int ZEXPORT gzclose_r(gzFile file) {
  579|  3.86k|    int ret, err;
  580|  3.86k|    gz_statep state;
  581|       |
  582|       |    /* get internal structure */
  583|  3.86k|    if (file == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 3.86k]
  ------------------
  584|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  585|  3.86k|    state = (gz_statep)file;
  586|       |
  587|       |    /* check that we're reading */
  588|  3.86k|    if (state->mode != GZ_READ)
  ------------------
  |  |  160|  3.86k|#define GZ_READ 7247
  ------------------
  |  Branch (588:9): [True: 0, False: 3.86k]
  ------------------
  589|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  590|       |
  591|       |    /* free memory and close file */
  592|  3.86k|    if (state->size) {
  ------------------
  |  Branch (592:9): [True: 3.86k, False: 0]
  ------------------
  593|  3.86k|        inflateEnd(&(state->strm));
  594|  3.86k|        free(state->out);
  595|  3.86k|        free(state->in);
  596|  3.86k|    }
  597|  3.86k|    err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
  ------------------
  |  |  188|  3.86k|#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.72k|#define Z_OK            0
  ------------------
  |  Branch (597:11): [True: 0, False: 3.86k]
  ------------------
  598|  3.86k|    gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|  3.86k|#define Z_OK            0
  ------------------
  599|  3.86k|    free(state->path);
  600|  3.86k|    ret = close(state->fd);
  601|  3.86k|    free(state);
  602|  3.86k|    return ret ? Z_ERRNO : err;
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
  |  Branch (602:12): [True: 0, False: 3.86k]
  ------------------
  603|  3.86k|}
gzread.c:gz_read:
  268|  11.4k|local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) {
  269|  11.4k|    z_size_t got;
  270|  11.4k|    unsigned n;
  271|       |
  272|       |    /* if len is zero, avoid unnecessary operations */
  273|  11.4k|    if (len == 0)
  ------------------
  |  Branch (273:9): [True: 0, False: 11.4k]
  ------------------
  274|      0|        return 0;
  275|       |
  276|       |    /* process a skip request */
  277|  11.4k|    if (state->seek) {
  ------------------
  |  Branch (277:9): [True: 0, False: 11.4k]
  ------------------
  278|      0|        state->seek = 0;
  279|      0|        if (gz_skip(state, state->skip) == -1)
  ------------------
  |  Branch (279:13): [True: 0, False: 0]
  ------------------
  280|      0|            return 0;
  281|      0|    }
  282|       |
  283|       |    /* get len bytes to buf, or less than len if at the end */
  284|  11.4k|    got = 0;
  285|  20.5k|    do {
  286|       |        /* set n to the maximum amount of len that fits in an unsigned int */
  287|  20.5k|        n = (unsigned)-1;
  288|  20.5k|        if (n > len)
  ------------------
  |  Branch (288:13): [True: 20.5k, False: 0]
  ------------------
  289|  20.5k|            n = (unsigned)len;
  290|       |
  291|       |        /* first just try copying data from the output buffer */
  292|  20.5k|        if (state->x.have) {
  ------------------
  |  Branch (292:13): [True: 3.86k, False: 16.7k]
  ------------------
  293|  3.86k|            if (state->x.have < n)
  ------------------
  |  Branch (293:17): [True: 3.86k, False: 0]
  ------------------
  294|  3.86k|                n = state->x.have;
  295|  3.86k|            memcpy(buf, state->x.next, n);
  296|  3.86k|            state->x.next += n;
  297|  3.86k|            state->x.have -= n;
  298|  3.86k|        }
  299|       |
  300|       |        /* output buffer empty -- return if we're at the end of the input */
  301|  16.7k|        else if (state->eof && state->strm.avail_in == 0) {
  ------------------
  |  Branch (301:18): [True: 8.27k, False: 8.46k]
  |  Branch (301:32): [True: 7.70k, False: 565]
  ------------------
  302|  7.70k|            state->past = 1;        /* tried to read past end */
  303|  7.70k|            break;
  304|  7.70k|        }
  305|       |
  306|       |        /* need output data -- for small len or new stream load up our output
  307|       |           buffer */
  308|  9.02k|        else if (state->how == LOOK || n < (state->size << 1)) {
  ------------------
  |  |  165|  18.0k|#define LOOK 0      /* look for a gzip header */
  ------------------
  |  Branch (308:18): [True: 3.88k, False: 5.14k]
  |  Branch (308:40): [True: 0, False: 5.14k]
  ------------------
  309|       |            /* get more output, looking for header if required */
  310|  3.88k|            if (gz_fetch(state) == -1)
  ------------------
  |  Branch (310:17): [True: 0, False: 3.88k]
  ------------------
  311|      0|                return 0;
  312|  3.88k|            continue;       /* no progress yet -- go back to copy above */
  313|       |            /* the copy above assures that we will leave with space in the
  314|       |               output buffer, allowing at least one gzungetc() to succeed */
  315|  3.88k|        }
  316|       |
  317|       |        /* large len -- read directly into user buffer */
  318|  5.14k|        else if (state->how == COPY) {      /* read directly */
  ------------------
  |  |  166|  5.14k|#define COPY 1      /* copy input directly */
  ------------------
  |  Branch (318:18): [True: 0, False: 5.14k]
  ------------------
  319|      0|            if (gz_load(state, (unsigned char *)buf, n, &n) == -1)
  ------------------
  |  Branch (319:17): [True: 0, False: 0]
  ------------------
  320|      0|                return 0;
  321|      0|        }
  322|       |
  323|       |        /* large len -- decompress directly into user buffer */
  324|  5.14k|        else {  /* state->how == GZIP */
  325|  5.14k|            state->strm.avail_out = n;
  326|  5.14k|            state->strm.next_out = (unsigned char *)buf;
  327|  5.14k|            if (gz_decomp(state) == -1)
  ------------------
  |  Branch (327:17): [True: 0, False: 5.14k]
  ------------------
  328|      0|                return 0;
  329|  5.14k|            n = state->x.have;
  330|  5.14k|            state->x.have = 0;
  331|  5.14k|        }
  332|       |
  333|       |        /* update progress */
  334|  9.00k|        len -= n;
  335|  9.00k|        buf = (char *)buf + n;
  336|  9.00k|        got += n;
  337|  9.00k|        state->x.pos += n;
  338|  12.8k|    } while (len);
  ------------------
  |  Branch (338:14): [True: 9.11k, False: 3.77k]
  ------------------
  339|       |
  340|       |    /* return number of bytes read into user buffer */
  341|  11.4k|    return got;
  342|  11.4k|}
gzread.c:gz_load:
   13|  20.6k|                  unsigned *have) {
   14|  20.6k|    int ret;
   15|  20.6k|    unsigned get, max = ((unsigned)-1 >> 2) + 1;
   16|       |
   17|  20.6k|    *have = 0;
   18|  24.4k|    do {
   19|  24.4k|        get = len - *have;
   20|  24.4k|        if (get > max)
  ------------------
  |  Branch (20:13): [True: 0, False: 24.4k]
  ------------------
   21|      0|            get = max;
   22|  24.4k|        ret = read(state->fd, buf + *have, get);
   23|  24.4k|        if (ret <= 0)
  ------------------
  |  Branch (23:13): [True: 3.86k, False: 20.6k]
  ------------------
   24|  3.86k|            break;
   25|  20.6k|        *have += (unsigned)ret;
   26|  20.6k|    } while (*have < len);
  ------------------
  |  Branch (26:14): [True: 3.83k, False: 16.7k]
  ------------------
   27|  20.6k|    if (ret < 0) {
  ------------------
  |  Branch (27:9): [True: 0, False: 20.6k]
  ------------------
   28|      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)
  ------------------
   29|      0|        return -1;
   30|      0|    }
   31|  20.6k|    if (ret == 0)
  ------------------
  |  Branch (31:9): [True: 3.86k, False: 16.7k]
  ------------------
   32|  3.86k|        state->eof = 1;
   33|  20.6k|    return 0;
   34|  20.6k|}
gzread.c:gz_decomp:
  156|  9.00k|local int gz_decomp(gz_statep state) {
  157|  9.00k|    int ret = Z_OK;
  ------------------
  |  |  181|  9.00k|#define Z_OK            0
  ------------------
  158|  9.00k|    unsigned had;
  159|  9.00k|    z_streamp strm = &(state->strm);
  160|       |
  161|       |    /* fill output buffer up to end of deflate stream */
  162|  9.00k|    had = strm->avail_out;
  163|  25.7k|    do {
  164|       |        /* get more input for inflate() */
  165|  25.7k|        if (strm->avail_in == 0 && gz_avail(state) == -1)
  ------------------
  |  Branch (165:13): [True: 16.7k, False: 8.98k]
  |  Branch (165:36): [True: 0, False: 16.7k]
  ------------------
  166|      0|            return -1;
  167|  25.7k|        if (strm->avail_in == 0) {
  ------------------
  |  Branch (167:13): [True: 0, False: 25.7k]
  ------------------
  168|      0|            gz_error(state, Z_BUF_ERROR, "unexpected end of file");
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  169|      0|            break;
  170|      0|        }
  171|       |
  172|       |        /* decompress and handle errors */
  173|  25.7k|        ret = inflate(strm, Z_NO_FLUSH);
  ------------------
  |  |  172|  25.7k|#define Z_NO_FLUSH      0
  ------------------
  174|  25.7k|        if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
  ------------------
  |  |  185|  51.5k|#define Z_STREAM_ERROR (-2)
  ------------------
                      if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) {
  ------------------
  |  |  183|  25.7k|#define Z_NEED_DICT     2
  ------------------
  |  Branch (174:13): [True: 0, False: 25.7k]
  |  Branch (174:38): [True: 0, False: 25.7k]
  ------------------
  175|      0|            gz_error(state, Z_STREAM_ERROR,
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  176|      0|                     "internal error: inflate stream corrupt");
  177|      0|            return -1;
  178|      0|        }
  179|  25.7k|        if (ret == Z_MEM_ERROR) {
  ------------------
  |  |  187|  25.7k|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (179:13): [True: 0, False: 25.7k]
  ------------------
  180|      0|            gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  181|      0|            return -1;
  182|      0|        }
  183|  25.7k|        if (ret == Z_DATA_ERROR) {              /* deflate stream invalid */
  ------------------
  |  |  186|  25.7k|#define Z_DATA_ERROR   (-3)
  ------------------
  |  Branch (183:13): [True: 0, False: 25.7k]
  ------------------
  184|      0|            gz_error(state, Z_DATA_ERROR,
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
  185|      0|                     strm->msg == NULL ? "compressed data error" : strm->msg);
  ------------------
  |  Branch (185:22): [True: 0, False: 0]
  ------------------
  186|      0|            return -1;
  187|      0|        }
  188|  25.7k|    } while (strm->avail_out && ret != Z_STREAM_END);
  ------------------
  |  |  182|  20.5k|#define Z_STREAM_END    1
  ------------------
  |  Branch (188:14): [True: 20.5k, False: 5.15k]
  |  Branch (188:33): [True: 16.7k, False: 3.84k]
  ------------------
  189|       |
  190|       |    /* update available output */
  191|  9.00k|    state->x.have = had - strm->avail_out;
  192|  9.00k|    state->x.next = strm->next_out - state->x.have;
  193|       |
  194|       |    /* if the gzip stream completed successfully, look for another */
  195|  9.00k|    if (ret == Z_STREAM_END)
  ------------------
  |  |  182|  9.00k|#define Z_STREAM_END    1
  ------------------
  |  Branch (195:9): [True: 3.86k, False: 5.14k]
  ------------------
  196|  3.86k|        state->how = LOOK;
  ------------------
  |  |  165|  3.86k|#define LOOK 0      /* look for a gzip header */
  ------------------
  197|       |
  198|       |    /* good decompression */
  199|  9.00k|    return 0;
  200|  9.00k|}
gzread.c:gz_avail:
   43|  20.6k|local int gz_avail(gz_statep state) {
   44|  20.6k|    unsigned got;
   45|  20.6k|    z_streamp strm = &(state->strm);
   46|       |
   47|  20.6k|    if (state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  181|  41.2k|#define Z_OK            0
  ------------------
                  if (state->err != Z_OK && state->err != Z_BUF_ERROR)
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
  |  Branch (47:9): [True: 0, False: 20.6k]
  |  Branch (47:31): [True: 0, False: 0]
  ------------------
   48|      0|        return -1;
   49|  20.6k|    if (state->eof == 0) {
  ------------------
  |  Branch (49:9): [True: 20.6k, False: 0]
  ------------------
   50|  20.6k|        if (strm->avail_in) {       /* copy what's there to the start */
  ------------------
  |  Branch (50:13): [True: 0, False: 20.6k]
  ------------------
   51|      0|            unsigned char *p = state->in;
   52|      0|            unsigned const char *q = strm->next_in;
   53|      0|            unsigned n = strm->avail_in;
   54|      0|            do {
   55|      0|                *p++ = *q++;
   56|      0|            } while (--n);
  ------------------
  |  Branch (56:22): [True: 0, False: 0]
  ------------------
   57|      0|        }
   58|  20.6k|        if (gz_load(state, state->in + strm->avail_in,
  ------------------
  |  Branch (58:13): [True: 0, False: 20.6k]
  ------------------
   59|  20.6k|                    state->size - strm->avail_in, &got) == -1)
   60|      0|            return -1;
   61|  20.6k|        strm->avail_in += got;
   62|  20.6k|        strm->next_in = state->in;
   63|  20.6k|    }
   64|  20.6k|    return 0;
   65|  20.6k|}
gzread.c:gz_look:
   76|  3.88k|local int gz_look(gz_statep state) {
   77|  3.88k|    z_streamp strm = &(state->strm);
   78|       |
   79|       |    /* allocate read buffers and inflate memory */
   80|  3.88k|    if (state->size == 0) {
  ------------------
  |  Branch (80:9): [True: 3.86k, False: 23]
  ------------------
   81|       |        /* allocate buffers */
   82|  3.86k|        state->in = (unsigned char *)malloc(state->want);
   83|  3.86k|        state->out = (unsigned char *)malloc(state->want << 1);
   84|  3.86k|        if (state->in == NULL || state->out == NULL) {
  ------------------
  |  Branch (84:13): [True: 0, False: 3.86k]
  |  Branch (84:34): [True: 0, False: 3.86k]
  ------------------
   85|      0|            free(state->out);
   86|      0|            free(state->in);
   87|      0|            gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
   88|      0|            return -1;
   89|      0|        }
   90|  3.86k|        state->size = state->want;
   91|       |
   92|       |        /* allocate inflate memory */
   93|  3.86k|        state->strm.zalloc = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   94|  3.86k|        state->strm.zfree = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   95|  3.86k|        state->strm.opaque = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   96|  3.86k|        state->strm.avail_in = 0;
   97|  3.86k|        state->strm.next_in = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   98|  3.86k|        if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */
  ------------------
  |  | 1840|  3.86k|          inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
  |  |  ------------------
  |  |  |  |   44|  3.86k|#define ZLIB_VERSION "1.3.1.1-motley"
  |  |  ------------------
  |  | 1841|  3.86k|                        (int)sizeof(z_stream))
  ------------------
                      if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) {    /* gunzip */
  ------------------
  |  |  181|  3.86k|#define Z_OK            0
  ------------------
  |  Branch (98:13): [True: 0, False: 3.86k]
  ------------------
   99|      0|            free(state->out);
  100|      0|            free(state->in);
  101|      0|            state->size = 0;
  102|      0|            gz_error(state, Z_MEM_ERROR, "out of memory");
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  103|      0|            return -1;
  104|      0|        }
  105|  3.86k|    }
  106|       |
  107|       |    /* get at least the magic bytes in the input buffer */
  108|  3.88k|    if (strm->avail_in < 2) {
  ------------------
  |  Branch (108:9): [True: 3.88k, False: 0]
  ------------------
  109|  3.88k|        if (gz_avail(state) == -1)
  ------------------
  |  Branch (109:13): [True: 0, False: 3.88k]
  ------------------
  110|      0|            return -1;
  111|  3.88k|        if (strm->avail_in == 0)
  ------------------
  |  Branch (111:13): [True: 23, False: 3.86k]
  ------------------
  112|     23|            return 0;
  113|  3.88k|    }
  114|       |
  115|       |    /* look for gzip magic bytes -- if there, do gzip decoding (note: there is
  116|       |       a logical dilemma here when considering the case of a partially written
  117|       |       gzip file, to wit, if a single 31 byte is written, then we cannot tell
  118|       |       whether this is a single-byte file, or just a partially written gzip
  119|       |       file -- for here we assume that if a gzip file is being written, then
  120|       |       the header will be written in a single operation, so that reading a
  121|       |       single byte is sufficient indication that it is not a gzip file) */
  122|  3.86k|    if (strm->avail_in > 1 &&
  ------------------
  |  Branch (122:9): [True: 3.86k, False: 0]
  ------------------
  123|  3.86k|            strm->next_in[0] == 31 && strm->next_in[1] == 139) {
  ------------------
  |  Branch (123:13): [True: 3.86k, False: 0]
  |  Branch (123:39): [True: 3.86k, False: 0]
  ------------------
  124|  3.86k|        inflateReset(strm);
  125|  3.86k|        state->how = GZIP;
  ------------------
  |  |  167|  3.86k|#define GZIP 2      /* decompress a gzip stream */
  ------------------
  126|  3.86k|        state->direct = 0;
  127|  3.86k|        return 0;
  128|  3.86k|    }
  129|       |
  130|       |    /* no gzip header -- if we were decoding gzip before, then this is trailing
  131|       |       garbage.  Ignore the trailing garbage and finish. */
  132|      0|    if (state->direct == 0) {
  ------------------
  |  Branch (132:9): [True: 0, False: 0]
  ------------------
  133|      0|        strm->avail_in = 0;
  134|      0|        state->eof = 1;
  135|      0|        state->x.have = 0;
  136|      0|        return 0;
  137|      0|    }
  138|       |
  139|       |    /* doing raw i/o, copy any leftover input to output -- this assumes that
  140|       |       the output buffer is larger than the input buffer, which also assures
  141|       |       space for gzungetc() */
  142|      0|    state->x.next = state->out;
  143|      0|    memcpy(state->x.next, strm->next_in, strm->avail_in);
  144|      0|    state->x.have = strm->avail_in;
  145|      0|    strm->avail_in = 0;
  146|      0|    state->how = COPY;
  ------------------
  |  |  166|      0|#define COPY 1      /* copy input directly */
  ------------------
  147|      0|    state->direct = 1;
  148|      0|    return 0;
  149|      0|}
gzread.c:gz_fetch:
  208|  3.88k|local int gz_fetch(gz_statep state) {
  209|  3.88k|    z_streamp strm = &(state->strm);
  210|       |
  211|  7.74k|    do {
  212|  7.74k|        switch(state->how) {
  ------------------
  |  Branch (212:16): [True: 0, False: 7.74k]
  ------------------
  213|  3.88k|        case LOOK:      /* -> LOOK, COPY (only if never GZIP), or GZIP */
  ------------------
  |  |  165|  3.88k|#define LOOK 0      /* look for a gzip header */
  ------------------
  |  Branch (213:9): [True: 3.88k, False: 3.86k]
  ------------------
  214|  3.88k|            if (gz_look(state) == -1)
  ------------------
  |  Branch (214:17): [True: 0, False: 3.88k]
  ------------------
  215|      0|                return -1;
  216|  3.88k|            if (state->how == LOOK)
  ------------------
  |  |  165|  3.88k|#define LOOK 0      /* look for a gzip header */
  ------------------
  |  Branch (216:17): [True: 23, False: 3.86k]
  ------------------
  217|     23|                return 0;
  218|  3.86k|            break;
  219|  3.86k|        case COPY:      /* -> COPY */
  ------------------
  |  |  166|      0|#define COPY 1      /* copy input directly */
  ------------------
  |  Branch (219:9): [True: 0, False: 7.74k]
  ------------------
  220|      0|            if (gz_load(state, state->out, state->size << 1, &(state->x.have))
  ------------------
  |  Branch (220:17): [True: 0, False: 0]
  ------------------
  221|      0|                    == -1)
  222|      0|                return -1;
  223|      0|            state->x.next = state->out;
  224|      0|            return 0;
  225|  3.86k|        case GZIP:      /* -> GZIP or LOOK (if end of gzip stream) */
  ------------------
  |  |  167|  3.86k|#define GZIP 2      /* decompress a gzip stream */
  ------------------
  |  Branch (225:9): [True: 3.86k, False: 3.88k]
  ------------------
  226|  3.86k|            strm->avail_out = state->size << 1;
  227|  3.86k|            strm->next_out = state->out;
  228|  3.86k|            if (gz_decomp(state) == -1)
  ------------------
  |  Branch (228:17): [True: 0, False: 3.86k]
  ------------------
  229|      0|                return -1;
  230|  7.74k|        }
  231|  7.74k|    } while (state->x.have == 0 && (!state->eof || strm->avail_in));
  ------------------
  |  Branch (231:14): [True: 3.86k, False: 3.86k]
  |  Branch (231:37): [True: 1.73k, False: 2.12k]
  |  Branch (231:52): [True: 2.12k, False: 0]
  ------------------
  232|  3.86k|    return 0;
  233|  3.88k|}

gzwrite:
  237|  16.5k|int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len) {
  238|  16.5k|    gz_statep state;
  239|       |
  240|       |    /* get internal structure */
  241|  16.5k|    if (file == NULL)
  ------------------
  |  Branch (241:9): [True: 0, False: 16.5k]
  ------------------
  242|      0|        return 0;
  243|  16.5k|    state = (gz_statep)file;
  244|       |
  245|       |    /* check that we're writing and that there's no error */
  246|  16.5k|    if (state->mode != GZ_WRITE || state->err != Z_OK)
  ------------------
  |  |  161|  33.1k|#define GZ_WRITE 31153
  ------------------
                  if (state->mode != GZ_WRITE || state->err != Z_OK)
  ------------------
  |  |  181|  16.5k|#define Z_OK            0
  ------------------
  |  Branch (246:9): [True: 0, False: 16.5k]
  |  Branch (246:36): [True: 0, False: 16.5k]
  ------------------
  247|      0|        return 0;
  248|       |
  249|       |    /* since an int is returned, make sure len fits in one, otherwise return
  250|       |       with an error (this avoids a flaw in the interface) */
  251|  16.5k|    if ((int)len < 0) {
  ------------------
  |  Branch (251:9): [True: 0, False: 16.5k]
  ------------------
  252|      0|        gz_error(state, Z_DATA_ERROR, "requested length does not fit in int");
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
  253|      0|        return 0;
  254|      0|    }
  255|       |
  256|       |    /* write len bytes from buf (the return value will fit in an int) */
  257|  16.5k|    return (int)gz_write(state, buf, len);
  258|  16.5k|}
gzclose_w:
  595|  3.86k|int ZEXPORT gzclose_w(gzFile file) {
  596|  3.86k|    int ret = Z_OK;
  ------------------
  |  |  181|  3.86k|#define Z_OK            0
  ------------------
  597|  3.86k|    gz_statep state;
  598|       |
  599|       |    /* get internal structure */
  600|  3.86k|    if (file == NULL)
  ------------------
  |  Branch (600:9): [True: 0, False: 3.86k]
  ------------------
  601|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  602|  3.86k|    state = (gz_statep)file;
  603|       |
  604|       |    /* check that we're writing */
  605|  3.86k|    if (state->mode != GZ_WRITE)
  ------------------
  |  |  161|  3.86k|#define GZ_WRITE 31153
  ------------------
  |  Branch (605:9): [True: 0, False: 3.86k]
  ------------------
  606|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  607|       |
  608|       |    /* check for seek request */
  609|  3.86k|    if (state->seek) {
  ------------------
  |  Branch (609:9): [True: 0, False: 3.86k]
  ------------------
  610|      0|        state->seek = 0;
  611|      0|        if (gz_zero(state, state->skip) == -1)
  ------------------
  |  Branch (611:13): [True: 0, False: 0]
  ------------------
  612|      0|            ret = state->err;
  613|      0|    }
  614|       |
  615|       |    /* flush, free memory, and close file */
  616|  3.86k|    if (gz_comp(state, Z_FINISH) == -1)
  ------------------
  |  |  176|  3.86k|#define Z_FINISH        4
  ------------------
  |  Branch (616:9): [True: 0, False: 3.86k]
  ------------------
  617|      0|        ret = state->err;
  618|  3.86k|    if (state->size) {
  ------------------
  |  Branch (618:9): [True: 3.86k, False: 0]
  ------------------
  619|  3.86k|        if (!state->direct) {
  ------------------
  |  Branch (619:13): [True: 3.86k, False: 0]
  ------------------
  620|  3.86k|            (void)deflateEnd(&(state->strm));
  621|  3.86k|            free(state->out);
  622|  3.86k|        }
  623|  3.86k|        free(state->in);
  624|  3.86k|    }
  625|  3.86k|    gz_error(state, Z_OK, NULL);
  ------------------
  |  |  181|  3.86k|#define Z_OK            0
  ------------------
  626|  3.86k|    free(state->path);
  627|  3.86k|    if (close(state->fd) == -1)
  ------------------
  |  Branch (627:9): [True: 0, False: 3.86k]
  ------------------
  628|      0|        ret = Z_ERRNO;
  ------------------
  |  |  184|      0|#define Z_ERRNO        (-1)
  ------------------
  629|  3.86k|    free(state);
  630|  3.86k|    return ret;
  631|  3.86k|}
gzwrite.c:gz_write:
  173|  16.5k|local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
  174|  16.5k|    z_size_t put = len;
  175|       |
  176|       |    /* if len is zero, avoid unnecessary operations */
  177|  16.5k|    if (len == 0)
  ------------------
  |  Branch (177:9): [True: 0, False: 16.5k]
  ------------------
  178|      0|        return 0;
  179|       |
  180|       |    /* allocate memory if this is the first time through */
  181|  16.5k|    if (state->size == 0 && gz_init(state) == -1)
  ------------------
  |  Branch (181:9): [True: 3.86k, False: 12.6k]
  |  Branch (181:29): [True: 0, False: 3.86k]
  ------------------
  182|      0|        return 0;
  183|       |
  184|       |    /* check for seek request */
  185|  16.5k|    if (state->seek) {
  ------------------
  |  Branch (185:9): [True: 0, False: 16.5k]
  ------------------
  186|      0|        state->seek = 0;
  187|      0|        if (gz_zero(state, state->skip) == -1)
  ------------------
  |  Branch (187:13): [True: 0, False: 0]
  ------------------
  188|      0|            return 0;
  189|      0|    }
  190|       |
  191|       |    /* for small len, copy to input buffer, otherwise compress directly */
  192|  16.5k|    if (len < state->size) {
  ------------------
  |  Branch (192:9): [True: 2.91k, False: 13.6k]
  ------------------
  193|       |        /* copy to input buffer, compress when full */
  194|  2.91k|        do {
  195|  2.91k|            unsigned have, copy;
  196|       |
  197|  2.91k|            if (state->strm.avail_in == 0)
  ------------------
  |  Branch (197:17): [True: 2.91k, False: 0]
  ------------------
  198|  2.91k|                state->strm.next_in = state->in;
  199|  2.91k|            have = (unsigned)((state->strm.next_in + state->strm.avail_in) -
  200|  2.91k|                              state->in);
  201|  2.91k|            copy = state->size - have;
  202|  2.91k|            if (copy > len)
  ------------------
  |  Branch (202:17): [True: 2.91k, False: 0]
  ------------------
  203|  2.91k|                copy = (unsigned)len;
  204|  2.91k|            memcpy(state->in + have, buf, copy);
  205|  2.91k|            state->strm.avail_in += copy;
  206|  2.91k|            state->x.pos += copy;
  207|  2.91k|            buf = (const char *)buf + copy;
  208|  2.91k|            len -= copy;
  209|  2.91k|            if (len && gz_comp(state, Z_NO_FLUSH) == -1)
  ------------------
  |  |  172|      0|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (209:17): [True: 0, False: 2.91k]
  |  Branch (209:24): [True: 0, False: 0]
  ------------------
  210|      0|                return 0;
  211|  2.91k|        } while (len);
  ------------------
  |  Branch (211:18): [True: 0, False: 2.91k]
  ------------------
  212|  2.91k|    }
  213|  13.6k|    else {
  214|       |        /* consume whatever's left in the input buffer */
  215|  13.6k|        if (state->strm.avail_in && gz_comp(state, Z_NO_FLUSH) == -1)
  ------------------
  |  |  172|      0|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (215:13): [True: 0, False: 13.6k]
  |  Branch (215:37): [True: 0, False: 0]
  ------------------
  216|      0|            return 0;
  217|       |
  218|       |        /* directly compress user buffer to file */
  219|  13.6k|        state->strm.next_in = (z_const Bytef *)buf;
  220|  13.6k|        do {
  221|  13.6k|            unsigned n = (unsigned)-1;
  222|  13.6k|            if (n > len)
  ------------------
  |  Branch (222:17): [True: 13.6k, False: 0]
  ------------------
  223|  13.6k|                n = (unsigned)len;
  224|  13.6k|            state->strm.avail_in = n;
  225|  13.6k|            state->x.pos += n;
  226|  13.6k|            if (gz_comp(state, Z_NO_FLUSH) == -1)
  ------------------
  |  |  172|  13.6k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (226:17): [True: 0, False: 13.6k]
  ------------------
  227|      0|                return 0;
  228|  13.6k|            len -= n;
  229|  13.6k|        } while (len);
  ------------------
  |  Branch (229:18): [True: 0, False: 13.6k]
  ------------------
  230|  13.6k|    }
  231|       |
  232|       |    /* input was all buffered or compressed */
  233|  16.5k|    return put;
  234|  16.5k|}
gzwrite.c:gz_init:
   11|  3.86k|local int gz_init(gz_statep state) {
   12|  3.86k|    int ret;
   13|  3.86k|    z_streamp strm = &(state->strm);
   14|       |
   15|       |    /* allocate input buffer (double size for gzprintf) */
   16|  3.86k|    state->in = (unsigned char *)malloc(state->want << 1);
   17|  3.86k|    if (state->in == NULL) {
  ------------------
  |  Branch (17:9): [True: 0, False: 3.86k]
  ------------------
   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.86k|    if (!state->direct) {
  ------------------
  |  Branch (23:9): [True: 3.86k, False: 0]
  ------------------
   24|       |        /* allocate output buffer */
   25|  3.86k|        state->out = (unsigned char *)malloc(state->want);
   26|  3.86k|        if (state->out == NULL) {
  ------------------
  |  Branch (26:13): [True: 0, False: 3.86k]
  ------------------
   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.86k|        strm->zalloc = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   34|  3.86k|        strm->zfree = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   35|  3.86k|        strm->opaque = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
   36|  3.86k|        ret = deflateInit2(strm, state->level, Z_DEFLATED,
  ------------------
  |  | 1837|  3.86k|          deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
  |  | 1838|  3.86k|                        (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
  |  |  ------------------
  |  |  |  |   44|  3.86k|#define ZLIB_VERSION "1.3.1.1-motley"
  |  |  ------------------
  ------------------
   37|  3.86k|                           MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
   38|  3.86k|        if (ret != Z_OK) {
  ------------------
  |  |  181|  3.86k|#define Z_OK            0
  ------------------
  |  Branch (38:13): [True: 0, False: 3.86k]
  ------------------
   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.86k|        strm->next_in = NULL;
   45|  3.86k|    }
   46|       |
   47|       |    /* mark state as initialized */
   48|  3.86k|    state->size = state->want;
   49|       |
   50|       |    /* initialize write buffer if compressing */
   51|  3.86k|    if (!state->direct) {
  ------------------
  |  Branch (51:9): [True: 3.86k, False: 0]
  ------------------
   52|  3.86k|        strm->avail_out = state->size;
   53|  3.86k|        strm->next_out = state->out;
   54|  3.86k|        state->x.next = strm->next_out;
   55|  3.86k|    }
   56|  3.86k|    return 0;
   57|  3.86k|}
gzwrite.c:gz_comp:
   65|  17.4k|local int gz_comp(gz_statep state, int flush) {
   66|  17.4k|    int ret, writ;
   67|  17.4k|    unsigned have, put, max = ((unsigned)-1 >> 2) + 1;
   68|  17.4k|    z_streamp strm = &(state->strm);
   69|       |
   70|       |    /* allocate memory if this is the first time through */
   71|  17.4k|    if (state->size == 0 && gz_init(state) == -1)
  ------------------
  |  Branch (71:9): [True: 0, False: 17.4k]
  |  Branch (71:29): [True: 0, False: 0]
  ------------------
   72|      0|        return -1;
   73|       |
   74|       |    /* write directly if requested */
   75|  17.4k|    if (state->direct) {
  ------------------
  |  Branch (75:9): [True: 0, False: 17.4k]
  ------------------
   76|      0|        while (strm->avail_in) {
  ------------------
  |  Branch (76:16): [True: 0, False: 0]
  ------------------
   77|      0|            put = strm->avail_in > max ? max : strm->avail_in;
  ------------------
  |  Branch (77:19): [True: 0, False: 0]
  ------------------
   78|      0|            writ = write(state->fd, strm->next_in, put);
   79|      0|            if (writ < 0) {
  ------------------
  |  Branch (79:17): [True: 0, False: 0]
  ------------------
   80|      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)
  ------------------
   81|      0|                return -1;
   82|      0|            }
   83|      0|            strm->avail_in -= (unsigned)writ;
   84|      0|            strm->next_in += writ;
   85|      0|        }
   86|      0|        return 0;
   87|      0|    }
   88|       |
   89|       |    /* check for a pending reset */
   90|  17.4k|    if (state->reset) {
  ------------------
  |  Branch (90:9): [True: 0, False: 17.4k]
  ------------------
   91|       |        /* don't start a new gzip member unless there is data to write */
   92|      0|        if (strm->avail_in == 0)
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  ------------------
   93|      0|            return 0;
   94|      0|        deflateReset(strm);
   95|      0|        state->reset = 0;
   96|      0|    }
   97|       |
   98|       |    /* run deflate() on provided input until it produces no more output */
   99|  17.4k|    ret = Z_OK;
  ------------------
  |  |  181|  17.4k|#define Z_OK            0
  ------------------
  100|  48.7k|    do {
  101|       |        /* write out current buffer contents if full, or if flushing, but if
  102|       |           doing Z_FINISH then don't write until we get to Z_STREAM_END */
  103|  48.7k|        if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
  ------------------
  |  |  172|  63.9k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (103:13): [True: 16.7k, False: 31.9k]
  |  Branch (103:38): [True: 7.69k, False: 24.2k]
  ------------------
  104|  31.9k|            (flush != Z_FINISH || ret == Z_STREAM_END))) {
  ------------------
  |  |  176|  15.3k|#define Z_FINISH        4
  ------------------
                          (flush != Z_FINISH || ret == Z_STREAM_END))) {
  ------------------
  |  |  182|  7.69k|#define Z_STREAM_END    1
  ------------------
  |  Branch (104:14): [True: 0, False: 7.69k]
  |  Branch (104:35): [True: 3.83k, False: 3.86k]
  ------------------
  105|  41.2k|            while (strm->next_out > state->x.next) {
  ------------------
  |  Branch (105:20): [True: 20.6k, False: 20.6k]
  ------------------
  106|  20.6k|                put = strm->next_out - state->x.next > (int)max ? max :
  ------------------
  |  Branch (106:23): [True: 0, False: 20.6k]
  ------------------
  107|  20.6k|                      (unsigned)(strm->next_out - state->x.next);
  108|  20.6k|                writ = write(state->fd, state->x.next, put);
  109|  20.6k|                if (writ < 0) {
  ------------------
  |  Branch (109:21): [True: 0, False: 20.6k]
  ------------------
  110|      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)
  ------------------
  111|      0|                    return -1;
  112|      0|                }
  113|  20.6k|                state->x.next += writ;
  114|  20.6k|            }
  115|  20.6k|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (115:17): [True: 16.7k, False: 3.83k]
  ------------------
  116|  16.7k|                strm->avail_out = state->size;
  117|  16.7k|                strm->next_out = state->out;
  118|  16.7k|                state->x.next = state->out;
  119|  16.7k|            }
  120|  20.6k|        }
  121|       |
  122|       |        /* compress */
  123|  48.7k|        have = strm->avail_out;
  124|  48.7k|        ret = deflate(strm, flush);
  125|  48.7k|        if (ret == Z_STREAM_ERROR) {
  ------------------
  |  |  185|  48.7k|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (125:13): [True: 0, False: 48.7k]
  ------------------
  126|      0|            gz_error(state, Z_STREAM_ERROR,
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  127|      0|                      "internal error: deflate stream corrupt");
  128|      0|            return -1;
  129|      0|        }
  130|  48.7k|        have -= strm->avail_out;
  131|  48.7k|    } while (have);
  ------------------
  |  Branch (131:14): [True: 31.2k, False: 17.4k]
  ------------------
  132|       |
  133|       |    /* if that completed a deflate stream, allow another to start */
  134|  17.4k|    if (flush == Z_FINISH)
  ------------------
  |  |  176|  17.4k|#define Z_FINISH        4
  ------------------
  |  Branch (134:9): [True: 3.86k, False: 13.6k]
  ------------------
  135|  3.86k|        state->reset = 1;
  136|       |
  137|       |    /* all done, no errors */
  138|  17.4k|    return 0;
  139|  17.4k|}

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

inflateResetKeep:
  106|  7.72k|int ZEXPORT inflateResetKeep(z_streamp strm) {
  107|  7.72k|    struct inflate_state FAR *state;
  108|       |
  109|  7.72k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (109:9): [True: 0, False: 7.72k]
  ------------------
  110|  7.72k|    state = (struct inflate_state FAR *)strm->state;
  111|  7.72k|    strm->total_in = strm->total_out = state->total = 0;
  112|  7.72k|    strm->msg = Z_NULL;
  ------------------
  |  |  216|  7.72k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  113|  7.72k|    if (state->wrap)        /* to support ill-conceived Java test suite */
  ------------------
  |  Branch (113:9): [True: 7.72k, False: 0]
  ------------------
  114|  7.72k|        strm->adler = state->wrap & 1;
  115|  7.72k|    state->mode = HEAD;
  116|  7.72k|    state->last = 0;
  117|  7.72k|    state->havedict = 0;
  118|  7.72k|    state->flags = -1;
  119|  7.72k|    state->dmax = 32768U;
  120|  7.72k|    state->head = Z_NULL;
  ------------------
  |  |  216|  7.72k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  121|  7.72k|    state->hold = 0;
  122|  7.72k|    state->bits = 0;
  123|  7.72k|    state->lencode = state->distcode = state->next = state->codes;
  124|  7.72k|    state->sane = 1;
  125|  7.72k|    state->back = -1;
  126|  7.72k|    Tracev((stderr, "inflate: reset\n"));
  127|  7.72k|    return Z_OK;
  ------------------
  |  |  181|  7.72k|#define Z_OK            0
  ------------------
  128|  7.72k|}
inflateReset:
  130|  7.72k|int ZEXPORT inflateReset(z_streamp strm) {
  131|  7.72k|    struct inflate_state FAR *state;
  132|       |
  133|  7.72k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (133:9): [True: 0, False: 7.72k]
  ------------------
  134|  7.72k|    state = (struct inflate_state FAR *)strm->state;
  135|  7.72k|    state->wsize = 0;
  136|  7.72k|    state->whave = 0;
  137|  7.72k|    state->wnext = 0;
  138|  7.72k|    return inflateResetKeep(strm);
  139|  7.72k|}
inflateReset2:
  141|  3.86k|int ZEXPORT inflateReset2(z_streamp strm, int windowBits) {
  142|  3.86k|    int wrap;
  143|  3.86k|    struct inflate_state FAR *state;
  144|       |
  145|       |    /* get the state */
  146|  3.86k|    if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (146:9): [True: 0, False: 3.86k]
  ------------------
  147|  3.86k|    state = (struct inflate_state FAR *)strm->state;
  148|       |
  149|       |    /* extract wrap request from windowBits parameter */
  150|  3.86k|    if (windowBits < 0) {
  ------------------
  |  Branch (150:9): [True: 0, False: 3.86k]
  ------------------
  151|      0|        if (windowBits < -15)
  ------------------
  |  Branch (151:13): [True: 0, False: 0]
  ------------------
  152|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  153|      0|        wrap = 0;
  154|      0|        windowBits = -windowBits;
  155|      0|    }
  156|  3.86k|    else {
  157|  3.86k|        wrap = (windowBits >> 4) + 5;
  158|  3.86k|#ifdef GUNZIP
  159|  3.86k|        if (windowBits < 48)
  ------------------
  |  Branch (159:13): [True: 3.86k, False: 0]
  ------------------
  160|  3.86k|            windowBits &= 15;
  161|  3.86k|#endif
  162|  3.86k|    }
  163|       |
  164|       |    /* set number of window bits, free window if different */
  165|  3.86k|    if (windowBits && (windowBits < 8 || windowBits > 15))
  ------------------
  |  Branch (165:9): [True: 3.86k, False: 0]
  |  Branch (165:24): [True: 0, False: 3.86k]
  |  Branch (165:42): [True: 0, False: 3.86k]
  ------------------
  166|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  167|  3.86k|    if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
  ------------------
  |  |  216|  7.72k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (167:9): [True: 0, False: 3.86k]
  |  Branch (167:36): [True: 0, False: 0]
  ------------------
  168|      0|        ZFREE(strm, state->window);
  ------------------
  |  |  250|      0|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  169|      0|        state->window = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  170|      0|    }
  171|       |
  172|       |    /* update state and reset the rest of it */
  173|  3.86k|    state->wrap = wrap;
  174|  3.86k|    state->wbits = (unsigned)windowBits;
  175|  3.86k|    return inflateReset(strm);
  176|  3.86k|}
inflateInit2_:
  179|  3.86k|                          const char *version, int stream_size) {
  180|  3.86k|    int ret;
  181|  3.86k|    struct inflate_state FAR *state;
  182|       |
  183|  3.86k|    if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
  ------------------
  |  |  216|  7.72k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
  ------------------
  |  |   44|  3.86k|#define ZLIB_VERSION "1.3.1.1-motley"
  ------------------
  |  Branch (183:9): [True: 0, False: 3.86k]
  |  Branch (183:30): [True: 0, False: 3.86k]
  ------------------
  184|  3.86k|        stream_size != (int)(sizeof(z_stream)))
  ------------------
  |  Branch (184:9): [True: 0, False: 3.86k]
  ------------------
  185|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  189|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  186|  3.86k|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  216|  3.86k|#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 (186:9): [True: 0, False: 3.86k]
  ------------------
  187|  3.86k|    strm->msg = Z_NULL;                 /* in case we return an error */
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  188|  3.86k|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (188:9): [True: 3.86k, False: 0]
  ------------------
  189|       |#ifdef Z_SOLO
  190|       |        return Z_STREAM_ERROR;
  191|       |#else
  192|  3.86k|        strm->zalloc = zcalloc;
  193|  3.86k|        strm->opaque = (voidpf)0;
  194|  3.86k|#endif
  195|  3.86k|    }
  196|  3.86k|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (196:9): [True: 3.86k, False: 0]
  ------------------
  197|       |#ifdef Z_SOLO
  198|       |        return Z_STREAM_ERROR;
  199|       |#else
  200|  3.86k|        strm->zfree = zcfree;
  201|  3.86k|#endif
  202|  3.86k|    state = (struct inflate_state FAR *)
  203|  3.86k|            ZALLOC(strm, 1, sizeof(struct inflate_state));
  ------------------
  |  |  249|  3.86k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  204|  3.86k|    if (state == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  216|  3.86k|#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 (204:9): [True: 0, False: 3.86k]
  ------------------
  205|  3.86k|    Tracev((stderr, "inflate: allocated\n"));
  206|  3.86k|    strm->state = (struct internal_state FAR *)state;
  207|  3.86k|    state->strm = strm;
  208|  3.86k|    state->window = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  209|  3.86k|    state->mode = HEAD;     /* to pass state test in inflateReset2() */
  210|  3.86k|    ret = inflateReset2(strm, windowBits);
  211|  3.86k|    if (ret != Z_OK) {
  ------------------
  |  |  181|  3.86k|#define Z_OK            0
  ------------------
  |  Branch (211:9): [True: 0, False: 3.86k]
  ------------------
  212|      0|        ZFREE(strm, state);
  ------------------
  |  |  250|      0|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  213|      0|        strm->state = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  214|      0|    }
  215|  3.86k|    return ret;
  216|  3.86k|}
inflate:
  590|  25.7k|int ZEXPORT inflate(z_streamp strm, int flush) {
  591|  25.7k|    struct inflate_state FAR *state;
  592|  25.7k|    z_const unsigned char FAR *next;    /* next input */
  593|  25.7k|    unsigned char FAR *put;     /* next output */
  594|  25.7k|    unsigned have, left;        /* available input and output */
  595|  25.7k|    unsigned long hold;         /* bit buffer */
  596|  25.7k|    unsigned bits;              /* bits in bit buffer */
  597|  25.7k|    unsigned in, out;           /* save starting available input and output */
  598|  25.7k|    unsigned copy;              /* number of stored or match bytes to copy */
  599|  25.7k|    unsigned char FAR *from;    /* where to copy match bytes from */
  600|  25.7k|    code here;                  /* current decoding table entry */
  601|  25.7k|    code last;                  /* parent table entry */
  602|  25.7k|    unsigned len;               /* length to copy for repeats, bits to drop */
  603|  25.7k|    int ret;                    /* return code */
  604|  25.7k|#ifdef GUNZIP
  605|  25.7k|    unsigned char hbuf[4];      /* buffer for gzip header crc calculation */
  606|  25.7k|#endif
  607|  25.7k|    static const unsigned short order[19] = /* permutation of code lengths */
  608|  25.7k|        {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
  609|       |
  610|  25.7k|    if (inflateStateCheck(strm) || strm->next_out == Z_NULL ||
  ------------------
  |  |  216|  51.5k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (610:9): [True: 0, False: 25.7k]
  |  Branch (610:36): [True: 0, False: 25.7k]
  ------------------
  611|  25.7k|        (strm->next_in == Z_NULL && strm->avail_in != 0))
  ------------------
  |  |  216|  51.5k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (611:10): [True: 0, False: 25.7k]
  |  Branch (611:37): [True: 0, False: 0]
  ------------------
  612|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  613|       |
  614|  25.7k|    state = (struct inflate_state FAR *)strm->state;
  615|  25.7k|    if (state->mode == TYPE) state->mode = TYPEDO;      /* skip check */
  ------------------
  |  Branch (615:9): [True: 95, False: 25.6k]
  ------------------
  616|  25.7k|    LOAD();
  ------------------
  |  |  445|  25.7k|    do { \
  |  |  446|  25.7k|        put = strm->next_out; \
  |  |  447|  25.7k|        left = strm->avail_out; \
  |  |  448|  25.7k|        next = strm->next_in; \
  |  |  449|  25.7k|        have = strm->avail_in; \
  |  |  450|  25.7k|        hold = state->hold; \
  |  |  451|  25.7k|        bits = state->bits; \
  |  |  452|  25.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (452:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  617|  25.7k|    in = have;
  618|  25.7k|    out = left;
  619|  25.7k|    ret = Z_OK;
  ------------------
  |  |  181|  25.7k|#define Z_OK            0
  ------------------
  620|  25.7k|    for (;;)
  621|  1.70M|        switch (state->mode) {
  622|  3.86k|        case HEAD:
  ------------------
  |  Branch (622:9): [True: 3.86k, False: 1.69M]
  ------------------
  623|  3.86k|            if (state->wrap == 0) {
  ------------------
  |  Branch (623:17): [True: 0, False: 3.86k]
  ------------------
  624|      0|                state->mode = TYPEDO;
  625|      0|                break;
  626|      0|            }
  627|  3.86k|            NEEDBITS(16);
  ------------------
  |  |  485|  3.86k|    do { \
  |  |  486|  11.5k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 7.72k, False: 3.86k]
  |  |  ------------------
  |  |  487|  7.72k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  7.72k|    do { \
  |  |  |  |  476|  7.72k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 7.72k]
  |  |  |  |  ------------------
  |  |  |  |  477|  7.72k|        have--; \
  |  |  |  |  478|  7.72k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  7.72k|        bits += 8; \
  |  |  |  |  480|  7.72k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  628|  3.86k|#ifdef GUNZIP
  629|  3.86k|            if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
  ------------------
  |  Branch (629:17): [True: 3.86k, False: 0]
  |  Branch (629:38): [True: 3.86k, False: 0]
  ------------------
  630|  3.86k|                if (state->wbits == 0)
  ------------------
  |  Branch (630:21): [True: 0, False: 3.86k]
  ------------------
  631|      0|                    state->wbits = 15;
  632|  3.86k|                state->check = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  633|  3.86k|                CRC2(state->check, hold);
  ------------------
  |  |  427|  3.86k|    do { \
  |  |  428|  3.86k|        hbuf[0] = (unsigned char)(word); \
  |  |  429|  3.86k|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  430|  3.86k|        check = crc32(check, hbuf, 2); \
  |  |  431|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (431:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  634|  3.86k|                INITBITS();
  ------------------
  |  |  467|  3.86k|    do { \
  |  |  468|  3.86k|        hold = 0; \
  |  |  469|  3.86k|        bits = 0; \
  |  |  470|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  635|  3.86k|                state->mode = FLAGS;
  636|  3.86k|                break;
  637|  3.86k|            }
  638|      0|            if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (638:17): [True: 0, False: 0]
  ------------------
  639|      0|                state->head->done = -1;
  640|      0|            if (!(state->wrap & 1) ||   /* check if zlib header allowed */
  ------------------
  |  Branch (640:17): [True: 0, False: 0]
  ------------------
  641|       |#else
  642|       |            if (
  643|       |#endif
  644|      0|                ((BITS(8) << 8) + (hold >> 8)) % 31) {
  ------------------
  |  |  492|      0|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  |  Branch (644:17): [True: 0, False: 0]
  ------------------
  645|      0|                strm->msg = (z_const char *)"incorrect header check";
  646|      0|                state->mode = BAD;
  647|      0|                break;
  648|      0|            }
  649|      0|            if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  492|      0|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
                          if (BITS(4) != Z_DEFLATED) {
  ------------------
  |  |  213|      0|#define Z_DEFLATED   8
  ------------------
  |  Branch (649:17): [True: 0, False: 0]
  ------------------
  650|      0|                strm->msg = (z_const char *)"unknown compression method";
  651|      0|                state->mode = BAD;
  652|      0|                break;
  653|      0|            }
  654|      0|            DROPBITS(4);
  ------------------
  |  |  496|      0|    do { \
  |  |  497|      0|        hold >>= (n); \
  |  |  498|      0|        bits -= (unsigned)(n); \
  |  |  499|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  655|      0|            len = BITS(4) + 8;
  ------------------
  |  |  492|      0|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  656|      0|            if (state->wbits == 0)
  ------------------
  |  Branch (656:17): [True: 0, False: 0]
  ------------------
  657|      0|                state->wbits = len;
  658|      0|            if (len > 15 || len > state->wbits) {
  ------------------
  |  Branch (658:17): [True: 0, False: 0]
  |  Branch (658:29): [True: 0, False: 0]
  ------------------
  659|      0|                strm->msg = (z_const char *)"invalid window size";
  660|      0|                state->mode = BAD;
  661|      0|                break;
  662|      0|            }
  663|      0|            state->dmax = 1U << len;
  664|      0|            state->flags = 0;               /* indicate zlib header */
  665|      0|            Tracev((stderr, "inflate:   zlib header ok\n"));
  666|      0|            strm->adler = state->check = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  667|      0|            state->mode = hold & 0x200 ? DICTID : TYPE;
  ------------------
  |  Branch (667:27): [True: 0, False: 0]
  ------------------
  668|      0|            INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  669|      0|            break;
  670|      0|#ifdef GUNZIP
  671|  3.86k|        case FLAGS:
  ------------------
  |  Branch (671:9): [True: 3.86k, False: 1.69M]
  ------------------
  672|  3.86k|            NEEDBITS(16);
  ------------------
  |  |  485|  3.86k|    do { \
  |  |  486|  11.5k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 7.72k, False: 3.86k]
  |  |  ------------------
  |  |  487|  7.72k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  7.72k|    do { \
  |  |  |  |  476|  7.72k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 7.72k]
  |  |  |  |  ------------------
  |  |  |  |  477|  7.72k|        have--; \
  |  |  |  |  478|  7.72k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  7.72k|        bits += 8; \
  |  |  |  |  480|  7.72k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  673|  3.86k|            state->flags = (int)(hold);
  674|  3.86k|            if ((state->flags & 0xff) != Z_DEFLATED) {
  ------------------
  |  |  213|  3.86k|#define Z_DEFLATED   8
  ------------------
  |  Branch (674:17): [True: 0, False: 3.86k]
  ------------------
  675|      0|                strm->msg = (z_const char *)"unknown compression method";
  676|      0|                state->mode = BAD;
  677|      0|                break;
  678|      0|            }
  679|  3.86k|            if (state->flags & 0xe000) {
  ------------------
  |  Branch (679:17): [True: 0, False: 3.86k]
  ------------------
  680|      0|                strm->msg = (z_const char *)"unknown header flags set";
  681|      0|                state->mode = BAD;
  682|      0|                break;
  683|      0|            }
  684|  3.86k|            if (state->head != Z_NULL)
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (684:17): [True: 0, False: 3.86k]
  ------------------
  685|      0|                state->head->text = (int)((hold >> 8) & 1);
  686|  3.86k|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (686:17): [True: 0, False: 3.86k]
  |  Branch (686:44): [True: 0, False: 0]
  ------------------
  687|      0|                CRC2(state->check, hold);
  ------------------
  |  |  427|      0|    do { \
  |  |  428|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  429|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  430|      0|        check = crc32(check, hbuf, 2); \
  |  |  431|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (431:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  688|  3.86k|            INITBITS();
  ------------------
  |  |  467|  3.86k|    do { \
  |  |  468|  3.86k|        hold = 0; \
  |  |  469|  3.86k|        bits = 0; \
  |  |  470|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  689|  3.86k|            state->mode = TIME;
  690|       |                /* fallthrough */
  691|  3.86k|        case TIME:
  ------------------
  |  Branch (691:9): [True: 0, False: 1.70M]
  ------------------
  692|  3.86k|            NEEDBITS(32);
  ------------------
  |  |  485|  3.86k|    do { \
  |  |  486|  19.3k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 15.4k, False: 3.86k]
  |  |  ------------------
  |  |  487|  15.4k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  15.4k|    do { \
  |  |  |  |  476|  15.4k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 15.4k]
  |  |  |  |  ------------------
  |  |  |  |  477|  15.4k|        have--; \
  |  |  |  |  478|  15.4k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  15.4k|        bits += 8; \
  |  |  |  |  480|  15.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  693|  3.86k|            if (state->head != Z_NULL)
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (693:17): [True: 0, False: 3.86k]
  ------------------
  694|      0|                state->head->time = hold;
  695|  3.86k|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (695:17): [True: 0, False: 3.86k]
  |  Branch (695:44): [True: 0, False: 0]
  ------------------
  696|      0|                CRC4(state->check, hold);
  ------------------
  |  |  434|      0|    do { \
  |  |  435|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  436|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  437|      0|        hbuf[2] = (unsigned char)((word) >> 16); \
  |  |  438|      0|        hbuf[3] = (unsigned char)((word) >> 24); \
  |  |  439|      0|        check = crc32(check, hbuf, 4); \
  |  |  440|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (440:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  697|  3.86k|            INITBITS();
  ------------------
  |  |  467|  3.86k|    do { \
  |  |  468|  3.86k|        hold = 0; \
  |  |  469|  3.86k|        bits = 0; \
  |  |  470|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  698|  3.86k|            state->mode = OS;
  699|       |                /* fallthrough */
  700|  3.86k|        case OS:
  ------------------
  |  Branch (700:9): [True: 0, False: 1.70M]
  ------------------
  701|  3.86k|            NEEDBITS(16);
  ------------------
  |  |  485|  3.86k|    do { \
  |  |  486|  11.5k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 7.72k, False: 3.86k]
  |  |  ------------------
  |  |  487|  7.72k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  7.72k|    do { \
  |  |  |  |  476|  7.72k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 7.72k]
  |  |  |  |  ------------------
  |  |  |  |  477|  7.72k|        have--; \
  |  |  |  |  478|  7.72k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  7.72k|        bits += 8; \
  |  |  |  |  480|  7.72k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  702|  3.86k|            if (state->head != Z_NULL) {
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (702:17): [True: 0, False: 3.86k]
  ------------------
  703|      0|                state->head->xflags = (int)(hold & 0xff);
  704|      0|                state->head->os = (int)(hold >> 8);
  705|      0|            }
  706|  3.86k|            if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (706:17): [True: 0, False: 3.86k]
  |  Branch (706:44): [True: 0, False: 0]
  ------------------
  707|      0|                CRC2(state->check, hold);
  ------------------
  |  |  427|      0|    do { \
  |  |  428|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  429|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  430|      0|        check = crc32(check, hbuf, 2); \
  |  |  431|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (431:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  708|  3.86k|            INITBITS();
  ------------------
  |  |  467|  3.86k|    do { \
  |  |  468|  3.86k|        hold = 0; \
  |  |  469|  3.86k|        bits = 0; \
  |  |  470|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  709|  3.86k|            state->mode = EXLEN;
  710|       |                /* fallthrough */
  711|  3.86k|        case EXLEN:
  ------------------
  |  Branch (711:9): [True: 0, False: 1.70M]
  ------------------
  712|  3.86k|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (712:17): [True: 0, False: 3.86k]
  ------------------
  713|      0|                NEEDBITS(16);
  ------------------
  |  |  485|      0|    do { \
  |  |  486|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  487|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|      0|    do { \
  |  |  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  477|      0|        have--; \
  |  |  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|      0|        bits += 8; \
  |  |  |  |  480|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  714|      0|                state->length = (unsigned)(hold);
  715|      0|                if (state->head != Z_NULL)
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (715:21): [True: 0, False: 0]
  ------------------
  716|      0|                    state->head->extra_len = (unsigned)hold;
  717|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (717:21): [True: 0, False: 0]
  |  Branch (717:48): [True: 0, False: 0]
  ------------------
  718|      0|                    CRC2(state->check, hold);
  ------------------
  |  |  427|      0|    do { \
  |  |  428|      0|        hbuf[0] = (unsigned char)(word); \
  |  |  429|      0|        hbuf[1] = (unsigned char)((word) >> 8); \
  |  |  430|      0|        check = crc32(check, hbuf, 2); \
  |  |  431|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (431:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  719|      0|                INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  720|      0|            }
  721|  3.86k|            else if (state->head != Z_NULL)
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (721:22): [True: 0, False: 3.86k]
  ------------------
  722|      0|                state->head->extra = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  723|  3.86k|            state->mode = EXTRA;
  724|       |                /* fallthrough */
  725|  3.86k|        case EXTRA:
  ------------------
  |  Branch (725:9): [True: 0, False: 1.70M]
  ------------------
  726|  3.86k|            if (state->flags & 0x0400) {
  ------------------
  |  Branch (726:17): [True: 0, False: 3.86k]
  ------------------
  727|      0|                copy = state->length;
  728|      0|                if (copy > have) copy = have;
  ------------------
  |  Branch (728:21): [True: 0, False: 0]
  ------------------
  729|      0|                if (copy) {
  ------------------
  |  Branch (729:21): [True: 0, False: 0]
  ------------------
  730|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (730:25): [True: 0, False: 0]
  ------------------
  731|      0|                        state->head->extra != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (731:25): [True: 0, False: 0]
  ------------------
  732|      0|                        (len = state->head->extra_len - state->length) <
  ------------------
  |  Branch (732:25): [True: 0, False: 0]
  ------------------
  733|      0|                            state->head->extra_max) {
  734|      0|                        zmemcpy(state->head->extra + len, next,
  ------------------
  |  |  212|      0|#    define zmemcpy memcpy
  ------------------
  735|      0|                                len + copy > state->head->extra_max ?
  ------------------
  |  Branch (735:33): [True: 0, False: 0]
  ------------------
  736|      0|                                state->head->extra_max - len : copy);
  737|      0|                    }
  738|      0|                    if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (738:25): [True: 0, False: 0]
  |  Branch (738:52): [True: 0, False: 0]
  ------------------
  739|      0|                        state->check = crc32(state->check, next, copy);
  740|      0|                    have -= copy;
  741|      0|                    next += copy;
  742|      0|                    state->length -= copy;
  743|      0|                }
  744|      0|                if (state->length) goto inf_leave;
  ------------------
  |  Branch (744:21): [True: 0, False: 0]
  ------------------
  745|      0|            }
  746|  3.86k|            state->length = 0;
  747|  3.86k|            state->mode = NAME;
  748|       |                /* fallthrough */
  749|  3.86k|        case NAME:
  ------------------
  |  Branch (749:9): [True: 0, False: 1.70M]
  ------------------
  750|  3.86k|            if (state->flags & 0x0800) {
  ------------------
  |  Branch (750:17): [True: 0, False: 3.86k]
  ------------------
  751|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (751:21): [True: 0, False: 0]
  ------------------
  752|      0|                copy = 0;
  753|      0|                do {
  754|      0|                    len = (unsigned)(next[copy++]);
  755|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (755:25): [True: 0, False: 0]
  ------------------
  756|      0|                            state->head->name != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (756:29): [True: 0, False: 0]
  ------------------
  757|      0|                            state->length < state->head->name_max)
  ------------------
  |  Branch (757:29): [True: 0, False: 0]
  ------------------
  758|      0|                        state->head->name[state->length++] = (Bytef)len;
  759|      0|                } while (len && copy < have);
  ------------------
  |  Branch (759:26): [True: 0, False: 0]
  |  Branch (759:33): [True: 0, False: 0]
  ------------------
  760|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (760:21): [True: 0, False: 0]
  |  Branch (760:48): [True: 0, False: 0]
  ------------------
  761|      0|                    state->check = crc32(state->check, next, copy);
  762|      0|                have -= copy;
  763|      0|                next += copy;
  764|      0|                if (len) goto inf_leave;
  ------------------
  |  Branch (764:21): [True: 0, False: 0]
  ------------------
  765|      0|            }
  766|  3.86k|            else if (state->head != Z_NULL)
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (766:22): [True: 0, False: 3.86k]
  ------------------
  767|      0|                state->head->name = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  768|  3.86k|            state->length = 0;
  769|  3.86k|            state->mode = COMMENT;
  770|       |                /* fallthrough */
  771|  3.86k|        case COMMENT:
  ------------------
  |  Branch (771:9): [True: 0, False: 1.70M]
  ------------------
  772|  3.86k|            if (state->flags & 0x1000) {
  ------------------
  |  Branch (772:17): [True: 0, False: 3.86k]
  ------------------
  773|      0|                if (have == 0) goto inf_leave;
  ------------------
  |  Branch (773:21): [True: 0, False: 0]
  ------------------
  774|      0|                copy = 0;
  775|      0|                do {
  776|      0|                    len = (unsigned)(next[copy++]);
  777|      0|                    if (state->head != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (777:25): [True: 0, False: 0]
  ------------------
  778|      0|                            state->head->comment != Z_NULL &&
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (778:29): [True: 0, False: 0]
  ------------------
  779|      0|                            state->length < state->head->comm_max)
  ------------------
  |  Branch (779:29): [True: 0, False: 0]
  ------------------
  780|      0|                        state->head->comment[state->length++] = (Bytef)len;
  781|      0|                } while (len && copy < have);
  ------------------
  |  Branch (781:26): [True: 0, False: 0]
  |  Branch (781:33): [True: 0, False: 0]
  ------------------
  782|      0|                if ((state->flags & 0x0200) && (state->wrap & 4))
  ------------------
  |  Branch (782:21): [True: 0, False: 0]
  |  Branch (782:48): [True: 0, False: 0]
  ------------------
  783|      0|                    state->check = crc32(state->check, next, copy);
  784|      0|                have -= copy;
  785|      0|                next += copy;
  786|      0|                if (len) goto inf_leave;
  ------------------
  |  Branch (786:21): [True: 0, False: 0]
  ------------------
  787|      0|            }
  788|  3.86k|            else if (state->head != Z_NULL)
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (788:22): [True: 0, False: 3.86k]
  ------------------
  789|      0|                state->head->comment = Z_NULL;
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  790|  3.86k|            state->mode = HCRC;
  791|       |                /* fallthrough */
  792|  3.86k|        case HCRC:
  ------------------
  |  Branch (792:9): [True: 0, False: 1.70M]
  ------------------
  793|  3.86k|            if (state->flags & 0x0200) {
  ------------------
  |  Branch (793:17): [True: 0, False: 3.86k]
  ------------------
  794|      0|                NEEDBITS(16);
  ------------------
  |  |  485|      0|    do { \
  |  |  486|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  487|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|      0|    do { \
  |  |  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  477|      0|        have--; \
  |  |  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|      0|        bits += 8; \
  |  |  |  |  480|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  795|      0|                if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
  ------------------
  |  Branch (795:21): [True: 0, False: 0]
  |  Branch (795:42): [True: 0, False: 0]
  ------------------
  796|      0|                    strm->msg = (z_const char *)"header crc mismatch";
  797|      0|                    state->mode = BAD;
  798|      0|                    break;
  799|      0|                }
  800|      0|                INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  801|      0|            }
  802|  3.86k|            if (state->head != Z_NULL) {
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (802:17): [True: 0, False: 3.86k]
  ------------------
  803|      0|                state->head->hcrc = (int)((state->flags >> 9) & 1);
  804|      0|                state->head->done = 1;
  805|      0|            }
  806|  3.86k|            strm->adler = state->check = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  807|  3.86k|            state->mode = TYPE;
  808|  3.86k|            break;
  809|      0|#endif
  810|      0|        case DICTID:
  ------------------
  |  Branch (810:9): [True: 0, False: 1.70M]
  ------------------
  811|      0|            NEEDBITS(32);
  ------------------
  |  |  485|      0|    do { \
  |  |  486|      0|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  487|      0|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|      0|    do { \
  |  |  |  |  476|      0|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  477|      0|        have--; \
  |  |  |  |  478|      0|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|      0|        bits += 8; \
  |  |  |  |  480|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  812|      0|            strm->adler = state->check = ZSWAP32(hold);
  ------------------
  |  |  254|      0|#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
  |  |  255|      0|                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
  ------------------
  813|      0|            INITBITS();
  ------------------
  |  |  467|      0|    do { \
  |  |  468|      0|        hold = 0; \
  |  |  469|      0|        bits = 0; \
  |  |  470|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  814|      0|            state->mode = DICT;
  815|       |                /* fallthrough */
  816|      0|        case DICT:
  ------------------
  |  Branch (816:9): [True: 0, False: 1.70M]
  ------------------
  817|      0|            if (state->havedict == 0) {
  ------------------
  |  Branch (817:17): [True: 0, False: 0]
  ------------------
  818|      0|                RESTORE();
  ------------------
  |  |  456|      0|    do { \
  |  |  457|      0|        strm->next_out = put; \
  |  |  458|      0|        strm->avail_out = left; \
  |  |  459|      0|        strm->next_in = next; \
  |  |  460|      0|        strm->avail_in = have; \
  |  |  461|      0|        state->hold = hold; \
  |  |  462|      0|        state->bits = bits; \
  |  |  463|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (463:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  819|      0|                return Z_NEED_DICT;
  ------------------
  |  |  183|      0|#define Z_NEED_DICT     2
  ------------------
  820|      0|            }
  821|      0|            strm->adler = state->check = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  822|      0|            state->mode = TYPE;
  823|       |                /* fallthrough */
  824|  17.6k|        case TYPE:
  ------------------
  |  Branch (824:9): [True: 17.6k, False: 1.68M]
  ------------------
  825|  17.6k|            if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  177|  35.2k|#define Z_BLOCK         5
  ------------------
                          if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  178|  17.6k|#define Z_TREES         6
  ------------------
  |  Branch (825:17): [True: 0, False: 17.6k]
  |  Branch (825:37): [True: 0, False: 17.6k]
  ------------------
  826|       |                /* fallthrough */
  827|  17.7k|        case TYPEDO:
  ------------------
  |  Branch (827:9): [True: 95, False: 1.70M]
  ------------------
  828|  17.7k|            if (state->last) {
  ------------------
  |  Branch (828:17): [True: 3.86k, False: 13.8k]
  ------------------
  829|  3.86k|                BYTEBITS();
  ------------------
  |  |  503|  3.86k|    do { \
  |  |  504|  3.86k|        hold >>= bits & 7; \
  |  |  505|  3.86k|        bits -= bits & 7; \
  |  |  506|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (506:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  830|  3.86k|                state->mode = CHECK;
  831|  3.86k|                break;
  832|  3.86k|            }
  833|  13.8k|            NEEDBITS(3);
  ------------------
  |  |  485|  13.8k|    do { \
  |  |  486|  23.4k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 9.68k, False: 13.7k]
  |  |  ------------------
  |  |  487|  13.8k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  9.68k|    do { \
  |  |  |  |  476|  9.68k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 95, False: 9.58k]
  |  |  |  |  ------------------
  |  |  |  |  477|  9.68k|        have--; \
  |  |  |  |  478|  9.58k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  9.58k|        bits += 8; \
  |  |  |  |  480|  9.58k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  13.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  834|  13.7k|            state->last = BITS(1);
  ------------------
  |  |  492|  13.7k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  835|  13.7k|            DROPBITS(1);
  ------------------
  |  |  496|  13.7k|    do { \
  |  |  497|  13.7k|        hold >>= (n); \
  |  |  498|  13.7k|        bits -= (unsigned)(n); \
  |  |  499|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  836|  13.7k|            switch (BITS(2)) {
  ------------------
  |  |  492|  13.7k|    ((unsigned)hold & ((1U << (n)) - 1))
  |  |  ------------------
  |  |  |  Branch (492:5): [True: 0, False: 13.7k]
  |  |  ------------------
  ------------------
  837|  3.68k|            case 0:                             /* stored block */
  ------------------
  |  Branch (837:13): [True: 3.68k, False: 10.0k]
  ------------------
  838|  3.68k|                Tracev((stderr, "inflate:     stored block%s\n",
  839|  3.68k|                        state->last ? " (last)" : ""));
  840|  3.68k|                state->mode = STORED;
  841|  3.68k|                break;
  842|  1.43k|            case 1:                             /* fixed block */
  ------------------
  |  Branch (842:13): [True: 1.43k, False: 12.3k]
  ------------------
  843|  1.43k|                fixedtables(state);
  844|  1.43k|                Tracev((stderr, "inflate:     fixed codes block%s\n",
  845|  1.43k|                        state->last ? " (last)" : ""));
  846|  1.43k|                state->mode = LEN_;             /* decode codes */
  847|  1.43k|                if (flush == Z_TREES) {
  ------------------
  |  |  178|  1.43k|#define Z_TREES         6
  ------------------
  |  Branch (847:21): [True: 0, False: 1.43k]
  ------------------
  848|      0|                    DROPBITS(2);
  ------------------
  |  |  496|      0|    do { \
  |  |  497|      0|        hold >>= (n); \
  |  |  498|      0|        bits -= (unsigned)(n); \
  |  |  499|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  849|      0|                    goto inf_leave;
  850|      0|                }
  851|  1.43k|                break;
  852|  8.65k|            case 2:                             /* dynamic block */
  ------------------
  |  Branch (852:13): [True: 8.65k, False: 5.11k]
  ------------------
  853|  8.65k|                Tracev((stderr, "inflate:     dynamic codes block%s\n",
  854|  8.65k|                        state->last ? " (last)" : ""));
  855|  8.65k|                state->mode = TABLE;
  856|  8.65k|                break;
  857|      0|            case 3:
  ------------------
  |  Branch (857:13): [True: 0, False: 13.7k]
  ------------------
  858|      0|                strm->msg = (z_const char *)"invalid block type";
  859|      0|                state->mode = BAD;
  860|  13.7k|            }
  861|  13.7k|            DROPBITS(2);
  ------------------
  |  |  496|  13.7k|    do { \
  |  |  497|  13.7k|        hold >>= (n); \
  |  |  498|  13.7k|        bits -= (unsigned)(n); \
  |  |  499|  13.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  862|  13.7k|            break;
  863|  3.80k|        case STORED:
  ------------------
  |  Branch (863:9): [True: 3.80k, False: 1.69M]
  ------------------
  864|  3.80k|            BYTEBITS();                         /* go to byte boundary */
  ------------------
  |  |  503|  3.80k|    do { \
  |  |  504|  3.80k|        hold >>= bits & 7; \
  |  |  505|  3.80k|        bits -= bits & 7; \
  |  |  506|  3.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (506:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  865|  3.80k|            NEEDBITS(32);
  ------------------
  |  |  485|  3.80k|    do { \
  |  |  486|  18.5k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 14.8k, False: 3.68k]
  |  |  ------------------
  |  |  487|  14.8k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  14.8k|    do { \
  |  |  |  |  476|  14.8k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 127, False: 14.7k]
  |  |  |  |  ------------------
  |  |  |  |  477|  14.8k|        have--; \
  |  |  |  |  478|  14.7k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  14.7k|        bits += 8; \
  |  |  |  |  480|  14.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  3.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  866|  3.68k|            if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
  ------------------
  |  Branch (866:17): [True: 0, False: 3.68k]
  ------------------
  867|      0|                strm->msg = (z_const char *)"invalid stored block lengths";
  868|      0|                state->mode = BAD;
  869|      0|                break;
  870|      0|            }
  871|  3.68k|            state->length = (unsigned)hold & 0xffff;
  872|  3.68k|            Tracev((stderr, "inflate:       stored length %u\n",
  873|  3.68k|                    state->length));
  874|  3.68k|            INITBITS();
  ------------------
  |  |  467|  3.68k|    do { \
  |  |  468|  3.68k|        hold = 0; \
  |  |  469|  3.68k|        bits = 0; \
  |  |  470|  3.68k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  875|  3.68k|            state->mode = COPY_;
  876|  3.68k|            if (flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  178|  3.68k|#define Z_TREES         6
  ------------------
  |  Branch (876:17): [True: 0, False: 3.68k]
  ------------------
  877|       |                /* fallthrough */
  878|  3.68k|        case COPY_:
  ------------------
  |  Branch (878:9): [True: 0, False: 1.70M]
  ------------------
  879|  3.68k|            state->mode = COPY;
  880|       |                /* fallthrough */
  881|  22.4k|        case COPY:
  ------------------
  |  Branch (881:9): [True: 18.7k, False: 1.68M]
  ------------------
  882|  22.4k|            copy = state->length;
  883|  22.4k|            if (copy) {
  ------------------
  |  Branch (883:17): [True: 18.7k, False: 3.68k]
  ------------------
  884|  18.7k|                if (copy > have) copy = have;
  ------------------
  |  Branch (884:21): [True: 14.3k, False: 4.45k]
  ------------------
  885|  18.7k|                if (copy > left) copy = left;
  ------------------
  |  Branch (885:21): [True: 2.38k, False: 16.4k]
  ------------------
  886|  18.7k|                if (copy == 0) goto inf_leave;
  ------------------
  |  Branch (886:21): [True: 7.57k, False: 11.2k]
  ------------------
  887|  11.2k|                zmemcpy(put, next, copy);
  ------------------
  |  |  212|  11.2k|#    define zmemcpy memcpy
  ------------------
  888|  11.2k|                have -= copy;
  889|  11.2k|                next += copy;
  890|  11.2k|                left -= copy;
  891|  11.2k|                put += copy;
  892|  11.2k|                state->length -= copy;
  893|  11.2k|                break;
  894|  18.7k|            }
  895|  3.68k|            Tracev((stderr, "inflate:       stored end\n"));
  896|  3.68k|            state->mode = TYPE;
  897|  3.68k|            break;
  898|  8.79k|        case TABLE:
  ------------------
  |  Branch (898:9): [True: 8.79k, False: 1.69M]
  ------------------
  899|  8.79k|            NEEDBITS(14);
  ------------------
  |  |  485|  8.79k|    do { \
  |  |  486|  24.6k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 16.0k, False: 8.65k]
  |  |  ------------------
  |  |  487|  16.0k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  16.0k|    do { \
  |  |  |  |  476|  16.0k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 144, False: 15.8k]
  |  |  |  |  ------------------
  |  |  |  |  477|  16.0k|        have--; \
  |  |  |  |  478|  15.8k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  15.8k|        bits += 8; \
  |  |  |  |  480|  15.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  8.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  900|  8.65k|            state->nlen = BITS(5) + 257;
  ------------------
  |  |  492|  8.65k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  901|  8.65k|            DROPBITS(5);
  ------------------
  |  |  496|  8.65k|    do { \
  |  |  497|  8.65k|        hold >>= (n); \
  |  |  498|  8.65k|        bits -= (unsigned)(n); \
  |  |  499|  8.65k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  902|  8.65k|            state->ndist = BITS(5) + 1;
  ------------------
  |  |  492|  8.65k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  903|  8.65k|            DROPBITS(5);
  ------------------
  |  |  496|  8.65k|    do { \
  |  |  497|  8.65k|        hold >>= (n); \
  |  |  498|  8.65k|        bits -= (unsigned)(n); \
  |  |  499|  8.65k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  904|  8.65k|            state->ncode = BITS(4) + 4;
  ------------------
  |  |  492|  8.65k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  905|  8.65k|            DROPBITS(4);
  ------------------
  |  |  496|  8.65k|    do { \
  |  |  497|  8.65k|        hold >>= (n); \
  |  |  498|  8.65k|        bits -= (unsigned)(n); \
  |  |  499|  8.65k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  906|  8.65k|#ifndef PKZIP_BUG_WORKAROUND
  907|  8.65k|            if (state->nlen > 286 || state->ndist > 30) {
  ------------------
  |  Branch (907:17): [True: 0, False: 8.65k]
  |  Branch (907:38): [True: 0, False: 8.65k]
  ------------------
  908|      0|                strm->msg = (z_const char *)"too many length or distance symbols";
  909|      0|                state->mode = BAD;
  910|      0|                break;
  911|      0|            }
  912|  8.65k|#endif
  913|  8.65k|            Tracev((stderr, "inflate:       table sizes ok\n"));
  914|  8.65k|            state->have = 0;
  915|  8.65k|            state->mode = LENLENS;
  916|       |                /* fallthrough */
  917|  8.87k|        case LENLENS:
  ------------------
  |  Branch (917:9): [True: 229, False: 1.70M]
  ------------------
  918|   160k|            while (state->have < state->ncode) {
  ------------------
  |  Branch (918:20): [True: 152k, False: 8.65k]
  ------------------
  919|   152k|                NEEDBITS(3);
  ------------------
  |  |  485|   152k|    do { \
  |  |  486|   207k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 55.3k, False: 151k]
  |  |  ------------------
  |  |  487|   152k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  55.3k|    do { \
  |  |  |  |  476|  55.3k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 229, False: 55.1k]
  |  |  |  |  ------------------
  |  |  |  |  477|  55.3k|        have--; \
  |  |  |  |  478|  55.1k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  55.1k|        bits += 8; \
  |  |  |  |  480|  55.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|   152k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  920|   151k|                state->lens[order[state->have++]] = (unsigned short)BITS(3);
  ------------------
  |  |  492|   151k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  921|   151k|                DROPBITS(3);
  ------------------
  |  |  496|   151k|    do { \
  |  |  497|   151k|        hold >>= (n); \
  |  |  498|   151k|        bits -= (unsigned)(n); \
  |  |  499|   151k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  922|   151k|            }
  923|  21.1k|            while (state->have < 19)
  ------------------
  |  Branch (923:20): [True: 12.4k, False: 8.65k]
  ------------------
  924|  12.4k|                state->lens[order[state->have++]] = 0;
  925|  8.65k|            state->next = state->codes;
  926|  8.65k|            state->lencode = state->distcode = (const code FAR *)(state->next);
  927|  8.65k|            state->lenbits = 7;
  928|  8.65k|            ret = inflate_table(CODES, state->lens, 19, &(state->next),
  929|  8.65k|                                &(state->lenbits), state->work);
  930|  8.65k|            if (ret) {
  ------------------
  |  Branch (930:17): [True: 0, False: 8.65k]
  ------------------
  931|      0|                strm->msg = (z_const char *)"invalid code lengths set";
  932|      0|                state->mode = BAD;
  933|      0|                break;
  934|      0|            }
  935|  8.65k|            Tracev((stderr, "inflate:       code lengths ok\n"));
  936|  8.65k|            state->have = 0;
  937|  8.65k|            state->mode = CODELENS;
  938|       |                /* fallthrough */
  939|  9.28k|        case CODELENS:
  ------------------
  |  Branch (939:9): [True: 633, False: 1.70M]
  ------------------
  940|  1.09M|            while (state->have < state->nlen + state->ndist) {
  ------------------
  |  Branch (940:20): [True: 1.08M, False: 8.65k]
  ------------------
  941|  1.43M|                for (;;) {
  942|  1.43M|                    here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  492|  1.43M|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  943|  1.43M|                    if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (943:25): [True: 1.08M, False: 348k]
  ------------------
  944|   348k|                    PULLBYTE();
  ------------------
  |  |  475|   348k|    do { \
  |  |  476|   348k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 464, False: 347k]
  |  |  ------------------
  |  |  477|   348k|        have--; \
  |  |  478|   347k|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|   347k|        bits += 8; \
  |  |  480|   347k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  945|   348k|                }
  946|  1.08M|                if (here.val < 16) {
  ------------------
  |  Branch (946:21): [True: 897k, False: 188k]
  ------------------
  947|   897k|                    DROPBITS(here.bits);
  ------------------
  |  |  496|   897k|    do { \
  |  |  497|   897k|        hold >>= (n); \
  |  |  498|   897k|        bits -= (unsigned)(n); \
  |  |  499|   897k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  948|   897k|                    state->lens[state->have++] = here.val;
  949|   897k|                }
  950|   188k|                else {
  951|   188k|                    if (here.val == 16) {
  ------------------
  |  Branch (951:25): [True: 143k, False: 45.0k]
  ------------------
  952|   143k|                        NEEDBITS(here.bits + 2);
  ------------------
  |  |  485|   143k|    do { \
  |  |  486|   179k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 36.1k, False: 143k]
  |  |  ------------------
  |  |  487|   143k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  36.1k|    do { \
  |  |  |  |  476|  36.1k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 118, False: 36.0k]
  |  |  |  |  ------------------
  |  |  |  |  477|  36.1k|        have--; \
  |  |  |  |  478|  36.0k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  36.0k|        bits += 8; \
  |  |  |  |  480|  36.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|   143k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  953|   143k|                        DROPBITS(here.bits);
  ------------------
  |  |  496|   143k|    do { \
  |  |  497|   143k|        hold >>= (n); \
  |  |  498|   143k|        bits -= (unsigned)(n); \
  |  |  499|   143k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  954|   143k|                        if (state->have == 0) {
  ------------------
  |  Branch (954:29): [True: 0, False: 143k]
  ------------------
  955|      0|                            strm->msg = (z_const char *)"invalid bit length repeat";
  956|      0|                            state->mode = BAD;
  957|      0|                            break;
  958|      0|                        }
  959|   143k|                        len = state->lens[state->have - 1];
  960|   143k|                        copy = 3 + BITS(2);
  ------------------
  |  |  492|   143k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  961|   143k|                        DROPBITS(2);
  ------------------
  |  |  496|   143k|    do { \
  |  |  497|   143k|        hold >>= (n); \
  |  |  498|   143k|        bits -= (unsigned)(n); \
  |  |  499|   143k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  962|   143k|                    }
  963|  45.0k|                    else if (here.val == 17) {
  ------------------
  |  Branch (963:30): [True: 30.6k, False: 14.4k]
  ------------------
  964|  30.6k|                        NEEDBITS(here.bits + 3);
  ------------------
  |  |  485|  30.6k|    do { \
  |  |  486|  42.0k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 11.4k, False: 30.5k]
  |  |  ------------------
  |  |  487|  30.6k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  11.4k|    do { \
  |  |  |  |  476|  11.4k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 26, False: 11.4k]
  |  |  |  |  ------------------
  |  |  |  |  477|  11.4k|        have--; \
  |  |  |  |  478|  11.4k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  11.4k|        bits += 8; \
  |  |  |  |  480|  11.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  30.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  965|  30.5k|                        DROPBITS(here.bits);
  ------------------
  |  |  496|  30.5k|    do { \
  |  |  497|  30.5k|        hold >>= (n); \
  |  |  498|  30.5k|        bits -= (unsigned)(n); \
  |  |  499|  30.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  966|  30.5k|                        len = 0;
  967|  30.5k|                        copy = 3 + BITS(3);
  ------------------
  |  |  492|  30.5k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  968|  30.5k|                        DROPBITS(3);
  ------------------
  |  |  496|  30.5k|    do { \
  |  |  497|  30.5k|        hold >>= (n); \
  |  |  498|  30.5k|        bits -= (unsigned)(n); \
  |  |  499|  30.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  969|  30.5k|                    }
  970|  14.4k|                    else {
  971|  14.4k|                        NEEDBITS(here.bits + 7);
  ------------------
  |  |  485|  14.4k|    do { \
  |  |  486|  26.9k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 12.4k, False: 14.4k]
  |  |  ------------------
  |  |  487|  14.4k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  12.4k|    do { \
  |  |  |  |  476|  12.4k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 25, False: 12.4k]
  |  |  |  |  ------------------
  |  |  |  |  477|  12.4k|        have--; \
  |  |  |  |  478|  12.4k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  12.4k|        bits += 8; \
  |  |  |  |  480|  12.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  14.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  972|  14.4k|                        DROPBITS(here.bits);
  ------------------
  |  |  496|  14.4k|    do { \
  |  |  497|  14.4k|        hold >>= (n); \
  |  |  498|  14.4k|        bits -= (unsigned)(n); \
  |  |  499|  14.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  973|  14.4k|                        len = 0;
  974|  14.4k|                        copy = 11 + BITS(7);
  ------------------
  |  |  492|  14.4k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
  975|  14.4k|                        DROPBITS(7);
  ------------------
  |  |  496|  14.4k|    do { \
  |  |  497|  14.4k|        hold >>= (n); \
  |  |  498|  14.4k|        bits -= (unsigned)(n); \
  |  |  499|  14.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  976|  14.4k|                    }
  977|   188k|                    if (state->have + copy > state->nlen + state->ndist) {
  ------------------
  |  Branch (977:25): [True: 0, False: 188k]
  ------------------
  978|      0|                        strm->msg = (z_const char *)"invalid bit length repeat";
  979|      0|                        state->mode = BAD;
  980|      0|                        break;
  981|      0|                    }
  982|  1.66M|                    while (copy--)
  ------------------
  |  Branch (982:28): [True: 1.47M, False: 188k]
  ------------------
  983|  1.47M|                        state->lens[state->have++] = (unsigned short)len;
  984|   188k|                }
  985|  1.08M|            }
  986|       |
  987|       |            /* handle error breaks in while */
  988|  8.65k|            if (state->mode == BAD) break;
  ------------------
  |  Branch (988:17): [True: 0, False: 8.65k]
  ------------------
  989|       |
  990|       |            /* check for end-of-block code (better have one) */
  991|  8.65k|            if (state->lens[256] == 0) {
  ------------------
  |  Branch (991:17): [True: 0, False: 8.65k]
  ------------------
  992|      0|                strm->msg = (z_const char *)"invalid code -- missing end-of-block";
  993|      0|                state->mode = BAD;
  994|      0|                break;
  995|      0|            }
  996|       |
  997|       |            /* build code tables -- note: do not change the lenbits or distbits
  998|       |               values here (9 and 6) without reading the comments in inftrees.h
  999|       |               concerning the ENOUGH constants, which depend on those values */
 1000|  8.65k|            state->next = state->codes;
 1001|  8.65k|            state->lencode = (const code FAR *)(state->next);
 1002|  8.65k|            state->lenbits = 9;
 1003|  8.65k|            ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
 1004|  8.65k|                                &(state->lenbits), state->work);
 1005|  8.65k|            if (ret) {
  ------------------
  |  Branch (1005:17): [True: 0, False: 8.65k]
  ------------------
 1006|      0|                strm->msg = (z_const char *)"invalid literal/lengths set";
 1007|      0|                state->mode = BAD;
 1008|      0|                break;
 1009|      0|            }
 1010|  8.65k|            state->distcode = (const code FAR *)(state->next);
 1011|  8.65k|            state->distbits = 6;
 1012|  8.65k|            ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
 1013|  8.65k|                            &(state->next), &(state->distbits), state->work);
 1014|  8.65k|            if (ret) {
  ------------------
  |  Branch (1014:17): [True: 0, False: 8.65k]
  ------------------
 1015|      0|                strm->msg = (z_const char *)"invalid distances set";
 1016|      0|                state->mode = BAD;
 1017|      0|                break;
 1018|      0|            }
 1019|  8.65k|            Tracev((stderr, "inflate:       codes ok\n"));
 1020|  8.65k|            state->mode = LEN_;
 1021|  8.65k|            if (flush == Z_TREES) goto inf_leave;
  ------------------
  |  |  178|  8.65k|#define Z_TREES         6
  ------------------
  |  Branch (1021:17): [True: 0, False: 8.65k]
  ------------------
 1022|       |                /* fallthrough */
 1023|  10.0k|        case LEN_:
  ------------------
  |  Branch (1023:9): [True: 1.43k, False: 1.70M]
  ------------------
 1024|  10.0k|            state->mode = LEN;
 1025|       |                /* fallthrough */
 1026|   858k|        case LEN:
  ------------------
  |  Branch (1026:9): [True: 848k, False: 853k]
  ------------------
 1027|   858k|            if (have >= 6 && left >= 258) {
  ------------------
  |  Branch (1027:17): [True: 782k, False: 76.3k]
  |  Branch (1027:30): [True: 39.6k, False: 742k]
  ------------------
 1028|  39.6k|                RESTORE();
  ------------------
  |  |  456|  39.6k|    do { \
  |  |  457|  39.6k|        strm->next_out = put; \
  |  |  458|  39.6k|        strm->avail_out = left; \
  |  |  459|  39.6k|        strm->next_in = next; \
  |  |  460|  39.6k|        strm->avail_in = have; \
  |  |  461|  39.6k|        state->hold = hold; \
  |  |  462|  39.6k|        state->bits = bits; \
  |  |  463|  39.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (463:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1029|  39.6k|                inflate_fast(strm, out);
 1030|  39.6k|                LOAD();
  ------------------
  |  |  445|  39.6k|    do { \
  |  |  446|  39.6k|        put = strm->next_out; \
  |  |  447|  39.6k|        left = strm->avail_out; \
  |  |  448|  39.6k|        next = strm->next_in; \
  |  |  449|  39.6k|        have = strm->avail_in; \
  |  |  450|  39.6k|        hold = state->hold; \
  |  |  451|  39.6k|        bits = state->bits; \
  |  |  452|  39.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (452:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1031|  39.6k|                if (state->mode == TYPE)
  ------------------
  |  Branch (1031:21): [True: 7.89k, False: 31.7k]
  ------------------
 1032|  7.89k|                    state->back = -1;
 1033|  39.6k|                break;
 1034|  39.6k|            }
 1035|   818k|            state->back = 0;
 1036|  1.37M|            for (;;) {
 1037|  1.37M|                here = state->lencode[BITS(state->lenbits)];
  ------------------
  |  |  492|  1.37M|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1038|  1.37M|                if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (1038:21): [True: 810k, False: 561k]
  ------------------
 1039|   561k|                PULLBYTE();
  ------------------
  |  |  475|   561k|    do { \
  |  |  476|   561k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 8.06k, False: 553k]
  |  |  ------------------
  |  |  477|   561k|        have--; \
  |  |  478|   553k|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|   553k|        bits += 8; \
  |  |  480|   553k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1040|   561k|            }
 1041|   810k|            if (here.op && (here.op & 0xf0) == 0) {
  ------------------
  |  Branch (1041:17): [True: 43.8k, False: 766k]
  |  Branch (1041:28): [True: 20.0k, False: 23.8k]
  ------------------
 1042|  20.0k|                last = here;
 1043|  24.9k|                for (;;) {
 1044|  24.9k|                    here = state->lencode[last.val +
 1045|  24.9k|                            (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  492|  24.9k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1046|  24.9k|                    if ((unsigned)(last.bits + here.bits) <= bits) break;
  ------------------
  |  Branch (1046:25): [True: 19.8k, False: 5.09k]
  ------------------
 1047|  5.09k|                    PULLBYTE();
  ------------------
  |  |  475|  5.09k|    do { \
  |  |  476|  5.09k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 142, False: 4.95k]
  |  |  ------------------
  |  |  477|  5.09k|        have--; \
  |  |  478|  4.95k|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|  4.95k|        bits += 8; \
  |  |  480|  4.95k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1048|  5.09k|                }
 1049|  19.8k|                DROPBITS(last.bits);
  ------------------
  |  |  496|  19.8k|    do { \
  |  |  497|  19.8k|        hold >>= (n); \
  |  |  498|  19.8k|        bits -= (unsigned)(n); \
  |  |  499|  19.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1050|  19.8k|                state->back += last.bits;
 1051|  19.8k|            }
 1052|   810k|            DROPBITS(here.bits);
  ------------------
  |  |  496|   810k|    do { \
  |  |  497|   810k|        hold >>= (n); \
  |  |  498|   810k|        bits -= (unsigned)(n); \
  |  |  499|   810k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1053|   810k|            state->back += here.bits;
 1054|   810k|            state->length = (unsigned)here.val;
 1055|   810k|            if ((int)(here.op) == 0) {
  ------------------
  |  Branch (1055:17): [True: 784k, False: 26.6k]
  ------------------
 1056|   784k|                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
 1057|   784k|                        "inflate:         literal '%c'\n" :
 1058|   784k|                        "inflate:         literal 0x%02x\n", here.val));
 1059|   784k|                state->mode = LIT;
 1060|   784k|                break;
 1061|   784k|            }
 1062|  26.6k|            if (here.op & 32) {
  ------------------
  |  Branch (1062:17): [True: 2.18k, False: 24.4k]
  ------------------
 1063|  2.18k|                Tracevv((stderr, "inflate:         end of block\n"));
 1064|  2.18k|                state->back = -1;
 1065|  2.18k|                state->mode = TYPE;
 1066|  2.18k|                break;
 1067|  2.18k|            }
 1068|  24.4k|            if (here.op & 64) {
  ------------------
  |  Branch (1068:17): [True: 0, False: 24.4k]
  ------------------
 1069|      0|                strm->msg = (z_const char *)"invalid literal/length code";
 1070|      0|                state->mode = BAD;
 1071|      0|                break;
 1072|      0|            }
 1073|  24.4k|            state->extra = (unsigned)(here.op) & 15;
 1074|  24.4k|            state->mode = LENEXT;
 1075|       |                /* fallthrough */
 1076|  24.4k|        case LENEXT:
  ------------------
  |  Branch (1076:9): [True: 49, False: 1.70M]
  ------------------
 1077|  24.4k|            if (state->extra) {
  ------------------
  |  Branch (1077:17): [True: 2.60k, False: 21.8k]
  ------------------
 1078|  2.60k|                NEEDBITS(state->extra);
  ------------------
  |  |  485|  2.60k|    do { \
  |  |  486|  3.46k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 910, False: 2.55k]
  |  |  ------------------
  |  |  487|  2.60k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|    910|    do { \
  |  |  |  |  476|    910|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 49, False: 861]
  |  |  |  |  ------------------
  |  |  |  |  477|    910|        have--; \
  |  |  |  |  478|    861|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|    861|        bits += 8; \
  |  |  |  |  480|    861|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  2.60k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1079|  2.55k|                state->length += BITS(state->extra);
  ------------------
  |  |  492|  2.55k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1080|  2.55k|                DROPBITS(state->extra);
  ------------------
  |  |  496|  2.55k|    do { \
  |  |  497|  2.55k|        hold >>= (n); \
  |  |  498|  2.55k|        bits -= (unsigned)(n); \
  |  |  499|  2.55k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1081|  2.55k|                state->back += state->extra;
 1082|  2.55k|            }
 1083|  24.4k|            Tracevv((stderr, "inflate:         length %u\n", state->length));
 1084|  24.4k|            state->was = state->length;
 1085|  24.4k|            state->mode = DIST;
 1086|       |                /* fallthrough */
 1087|  24.7k|        case DIST:
  ------------------
  |  Branch (1087:9): [True: 288, False: 1.70M]
  ------------------
 1088|  36.0k|            for (;;) {
 1089|  36.0k|                here = state->distcode[BITS(state->distbits)];
  ------------------
  |  |  492|  36.0k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1090|  36.0k|                if ((unsigned)(here.bits) <= bits) break;
  ------------------
  |  Branch (1090:21): [True: 24.4k, False: 11.5k]
  ------------------
 1091|  11.5k|                PULLBYTE();
  ------------------
  |  |  475|  11.5k|    do { \
  |  |  476|  11.5k|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 265, False: 11.3k]
  |  |  ------------------
  |  |  477|  11.5k|        have--; \
  |  |  478|  11.3k|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|  11.3k|        bits += 8; \
  |  |  480|  11.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1092|  11.5k|            }
 1093|  24.4k|            if ((here.op & 0xf0) == 0) {
  ------------------
  |  Branch (1093:17): [True: 1.32k, False: 23.1k]
  ------------------
 1094|  1.32k|                last = here;
 1095|  1.56k|                for (;;) {
 1096|  1.56k|                    here = state->distcode[last.val +
 1097|  1.56k|                            (BITS(last.bits + last.op) >> last.bits)];
  ------------------
  |  |  492|  1.56k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1098|  1.56k|                    if ((unsigned)(last.bits + here.bits) <= bits) break;
  ------------------
  |  Branch (1098:25): [True: 1.30k, False: 266]
  ------------------
 1099|    266|                    PULLBYTE();
  ------------------
  |  |  475|    266|    do { \
  |  |  476|    266|        if (have == 0) goto inf_leave; \
  |  |  ------------------
  |  |  |  Branch (476:13): [True: 23, False: 243]
  |  |  ------------------
  |  |  477|    266|        have--; \
  |  |  478|    243|        hold += (unsigned long)(*next++) << bits; \
  |  |  479|    243|        bits += 8; \
  |  |  480|    243|    } while (0)
  |  |  ------------------
  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1100|    266|                }
 1101|  1.30k|                DROPBITS(last.bits);
  ------------------
  |  |  496|  1.30k|    do { \
  |  |  497|  1.30k|        hold >>= (n); \
  |  |  498|  1.30k|        bits -= (unsigned)(n); \
  |  |  499|  1.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1102|  1.30k|                state->back += last.bits;
 1103|  1.30k|            }
 1104|  24.4k|            DROPBITS(here.bits);
  ------------------
  |  |  496|  24.4k|    do { \
  |  |  497|  24.4k|        hold >>= (n); \
  |  |  498|  24.4k|        bits -= (unsigned)(n); \
  |  |  499|  24.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1105|  24.4k|            state->back += here.bits;
 1106|  24.4k|            if (here.op & 64) {
  ------------------
  |  Branch (1106:17): [True: 0, False: 24.4k]
  ------------------
 1107|      0|                strm->msg = (z_const char *)"invalid distance code";
 1108|      0|                state->mode = BAD;
 1109|      0|                break;
 1110|      0|            }
 1111|  24.4k|            state->offset = (unsigned)here.val;
 1112|  24.4k|            state->extra = (unsigned)(here.op) & 15;
 1113|  24.4k|            state->mode = DISTEXT;
 1114|       |                /* fallthrough */
 1115|  24.8k|        case DISTEXT:
  ------------------
  |  Branch (1115:9): [True: 428, False: 1.70M]
  ------------------
 1116|  24.8k|            if (state->extra) {
  ------------------
  |  Branch (1116:17): [True: 20.1k, False: 4.71k]
  ------------------
 1117|  20.1k|                NEEDBITS(state->extra);
  ------------------
  |  |  485|  20.1k|    do { \
  |  |  486|  41.8k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 22.1k, False: 19.7k]
  |  |  ------------------
  |  |  487|  22.1k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  22.1k|    do { \
  |  |  |  |  476|  22.1k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 428, False: 21.7k]
  |  |  |  |  ------------------
  |  |  |  |  477|  22.1k|        have--; \
  |  |  |  |  478|  21.7k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  21.7k|        bits += 8; \
  |  |  |  |  480|  21.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  20.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1118|  19.7k|                state->offset += BITS(state->extra);
  ------------------
  |  |  492|  19.7k|    ((unsigned)hold & ((1U << (n)) - 1))
  ------------------
 1119|  19.7k|                DROPBITS(state->extra);
  ------------------
  |  |  496|  19.7k|    do { \
  |  |  497|  19.7k|        hold >>= (n); \
  |  |  498|  19.7k|        bits -= (unsigned)(n); \
  |  |  499|  19.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (499:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1120|  19.7k|                state->back += state->extra;
 1121|  19.7k|            }
 1122|       |#ifdef INFLATE_STRICT
 1123|       |            if (state->offset > state->dmax) {
 1124|       |                strm->msg = (z_const char *)"invalid distance too far back";
 1125|       |                state->mode = BAD;
 1126|       |                break;
 1127|       |            }
 1128|       |#endif
 1129|  24.4k|            Tracevv((stderr, "inflate:         distance %u\n", state->offset));
 1130|  24.4k|            state->mode = MATCH;
 1131|       |                /* fallthrough */
 1132|  27.6k|        case MATCH:
  ------------------
  |  Branch (1132:9): [True: 3.19k, False: 1.69M]
  ------------------
 1133|  27.6k|            if (left == 0) goto inf_leave;
  ------------------
  |  Branch (1133:17): [True: 1.29k, False: 26.3k]
  ------------------
 1134|  26.3k|            copy = out - left;
 1135|  26.3k|            if (state->offset > copy) {         /* copy from window */
  ------------------
  |  Branch (1135:17): [True: 7.90k, False: 18.4k]
  ------------------
 1136|  7.90k|                copy = state->offset - copy;
 1137|  7.90k|                if (copy > state->whave) {
  ------------------
  |  Branch (1137:21): [True: 0, False: 7.90k]
  ------------------
 1138|      0|                    if (state->sane) {
  ------------------
  |  Branch (1138:25): [True: 0, False: 0]
  ------------------
 1139|      0|                        strm->msg = (z_const char *)"invalid distance too far back";
 1140|      0|                        state->mode = BAD;
 1141|      0|                        break;
 1142|      0|                    }
 1143|       |#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
 1144|       |                    Trace((stderr, "inflate.c too far\n"));
 1145|       |                    copy -= state->whave;
 1146|       |                    if (copy > state->length) copy = state->length;
 1147|       |                    if (copy > left) copy = left;
 1148|       |                    left -= copy;
 1149|       |                    state->length -= copy;
 1150|       |                    do {
 1151|       |                        *put++ = 0;
 1152|       |                    } while (--copy);
 1153|       |                    if (state->length == 0) state->mode = LEN;
 1154|       |                    break;
 1155|       |#endif
 1156|      0|                }
 1157|  7.90k|                if (copy > state->wnext) {
  ------------------
  |  Branch (1157:21): [True: 2.34k, False: 5.56k]
  ------------------
 1158|  2.34k|                    copy -= state->wnext;
 1159|  2.34k|                    from = state->window + (state->wsize - copy);
 1160|  2.34k|                }
 1161|  5.56k|                else
 1162|  5.56k|                    from = state->window + (state->wnext - copy);
 1163|  7.90k|                if (copy > state->length) copy = state->length;
  ------------------
  |  Branch (1163:21): [True: 7.16k, False: 739]
  ------------------
 1164|  7.90k|            }
 1165|  18.4k|            else {                              /* copy from output */
 1166|  18.4k|                from = put - state->offset;
 1167|  18.4k|                copy = state->length;
 1168|  18.4k|            }
 1169|  26.3k|            if (copy > left) copy = left;
  ------------------
  |  Branch (1169:17): [True: 1.19k, False: 25.1k]
  ------------------
 1170|  26.3k|            left -= copy;
 1171|  26.3k|            state->length -= copy;
 1172|   360k|            do {
 1173|   360k|                *put++ = *from++;
 1174|   360k|            } while (--copy);
  ------------------
  |  Branch (1174:22): [True: 334k, False: 26.3k]
  ------------------
 1175|  26.3k|            if (state->length == 0) state->mode = LEN;
  ------------------
  |  Branch (1175:17): [True: 24.4k, False: 1.90k]
  ------------------
 1176|  26.3k|            break;
 1177|   786k|        case LIT:
  ------------------
  |  Branch (1177:9): [True: 786k, False: 915k]
  ------------------
 1178|   786k|            if (left == 0) goto inf_leave;
  ------------------
  |  Branch (1178:17): [True: 2.64k, False: 784k]
  ------------------
 1179|   784k|            *put++ = (unsigned char)(state->length);
 1180|   784k|            left--;
 1181|   784k|            state->mode = LEN;
 1182|   784k|            break;
 1183|  3.98k|        case CHECK:
  ------------------
  |  Branch (1183:9): [True: 3.98k, False: 1.69M]
  ------------------
 1184|  3.98k|            if (state->wrap) {
  ------------------
  |  Branch (1184:17): [True: 3.98k, False: 0]
  ------------------
 1185|  3.98k|                NEEDBITS(32);
  ------------------
  |  |  485|  3.98k|    do { \
  |  |  486|  19.4k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 15.5k, False: 3.86k]
  |  |  ------------------
  |  |  487|  15.5k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  15.5k|    do { \
  |  |  |  |  476|  15.5k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 124, False: 15.4k]
  |  |  |  |  ------------------
  |  |  |  |  477|  15.5k|        have--; \
  |  |  |  |  478|  15.4k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  15.4k|        bits += 8; \
  |  |  |  |  480|  15.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  3.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1186|  3.86k|                out -= left;
 1187|  3.86k|                strm->total_out += out;
 1188|  3.86k|                state->total += out;
 1189|  3.86k|                if ((state->wrap & 4) && out)
  ------------------
  |  Branch (1189:21): [True: 3.86k, False: 0]
  |  Branch (1189:42): [True: 3.68k, False: 180]
  ------------------
 1190|  3.68k|                    strm->adler = state->check =
 1191|  3.68k|                        UPDATE_CHECK(state->check, put - out, out);
  ------------------
  |  |  419|  3.68k|    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
  |  |  ------------------
  |  |  |  Branch (419:6): [True: 3.68k, False: 0]
  |  |  ------------------
  ------------------
 1192|  3.86k|                out = left;
 1193|  3.86k|                if ((state->wrap & 4) && (
  ------------------
  |  Branch (1193:21): [True: 3.86k, False: 0]
  |  Branch (1193:42): [True: 0, False: 3.86k]
  ------------------
 1194|  3.86k|#ifdef GUNZIP
 1195|  3.86k|                     state->flags ? hold :
  ------------------
  |  Branch (1195:22): [True: 3.86k, False: 0]
  ------------------
 1196|  3.86k|#endif
 1197|  3.86k|                     ZSWAP32(hold)) != state->check) {
  ------------------
  |  |  254|      0|#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
  |  |  255|      0|                    (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
  ------------------
 1198|      0|                    strm->msg = (z_const char *)"incorrect data check";
 1199|      0|                    state->mode = BAD;
 1200|      0|                    break;
 1201|      0|                }
 1202|  3.86k|                INITBITS();
  ------------------
  |  |  467|  3.86k|    do { \
  |  |  468|  3.86k|        hold = 0; \
  |  |  469|  3.86k|        bits = 0; \
  |  |  470|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1203|  3.86k|                Tracev((stderr, "inflate:   check matches trailer\n"));
 1204|  3.86k|            }
 1205|  3.86k|#ifdef GUNZIP
 1206|  3.86k|            state->mode = LENGTH;
 1207|       |                /* fallthrough */
 1208|  3.92k|        case LENGTH:
  ------------------
  |  Branch (1208:9): [True: 66, False: 1.70M]
  ------------------
 1209|  3.92k|            if (state->wrap && state->flags) {
  ------------------
  |  Branch (1209:17): [True: 3.92k, False: 0]
  |  Branch (1209:32): [True: 3.92k, False: 0]
  ------------------
 1210|  3.92k|                NEEDBITS(32);
  ------------------
  |  |  485|  3.92k|    do { \
  |  |  486|  19.3k|        while (bits < (unsigned)(n)) \
  |  |  ------------------
  |  |  |  Branch (486:16): [True: 15.5k, False: 3.86k]
  |  |  ------------------
  |  |  487|  15.5k|            PULLBYTE(); \
  |  |  ------------------
  |  |  |  |  475|  15.5k|    do { \
  |  |  |  |  476|  15.5k|        if (have == 0) goto inf_leave; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (476:13): [True: 66, False: 15.4k]
  |  |  |  |  ------------------
  |  |  |  |  477|  15.5k|        have--; \
  |  |  |  |  478|  15.4k|        hold += (unsigned long)(*next++) << bits; \
  |  |  |  |  479|  15.4k|        bits += 8; \
  |  |  |  |  480|  15.4k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (480:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  488|  3.92k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (488:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1211|  3.86k|                if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
  ------------------
  |  Branch (1211:21): [True: 3.86k, False: 0]
  |  Branch (1211:42): [True: 0, False: 3.86k]
  ------------------
 1212|      0|                    strm->msg = (z_const char *)"incorrect length check";
 1213|      0|                    state->mode = BAD;
 1214|      0|                    break;
 1215|      0|                }
 1216|  3.86k|                INITBITS();
  ------------------
  |  |  467|  3.86k|    do { \
  |  |  468|  3.86k|        hold = 0; \
  |  |  469|  3.86k|        bits = 0; \
  |  |  470|  3.86k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (470:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1217|  3.86k|                Tracev((stderr, "inflate:   length matches trailer\n"));
 1218|  3.86k|            }
 1219|  3.86k|#endif
 1220|  3.86k|            state->mode = DONE;
 1221|       |                /* fallthrough */
 1222|  3.86k|        case DONE:
  ------------------
  |  Branch (1222:9): [True: 0, False: 1.70M]
  ------------------
 1223|  3.86k|            ret = Z_STREAM_END;
  ------------------
  |  |  182|  3.86k|#define Z_STREAM_END    1
  ------------------
 1224|  3.86k|            goto inf_leave;
 1225|      0|        case BAD:
  ------------------
  |  Branch (1225:9): [True: 0, False: 1.70M]
  ------------------
 1226|      0|            ret = Z_DATA_ERROR;
  ------------------
  |  |  186|      0|#define Z_DATA_ERROR   (-3)
  ------------------
 1227|      0|            goto inf_leave;
 1228|      0|        case MEM:
  ------------------
  |  Branch (1228:9): [True: 0, False: 1.70M]
  ------------------
 1229|      0|            return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
 1230|      0|        case SYNC:
  ------------------
  |  Branch (1230:9): [True: 0, False: 1.70M]
  ------------------
 1231|       |                /* fallthrough */
 1232|      0|        default:
  ------------------
  |  Branch (1232:9): [True: 0, False: 1.70M]
  ------------------
 1233|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1234|  1.70M|        }
 1235|       |
 1236|       |    /*
 1237|       |       Return from inflate(), updating the total counts and the check value.
 1238|       |       If there was no progress during the inflate() call, return a buffer
 1239|       |       error.  Call updatewindow() to create and/or update the window state.
 1240|       |       Note: a memory error from inflate() is non-recoverable.
 1241|       |     */
 1242|  25.7k|  inf_leave:
 1243|  25.7k|    RESTORE();
  ------------------
  |  |  456|  25.7k|    do { \
  |  |  457|  25.7k|        strm->next_out = put; \
  |  |  458|  25.7k|        strm->avail_out = left; \
  |  |  459|  25.7k|        strm->next_in = next; \
  |  |  460|  25.7k|        strm->avail_in = have; \
  |  |  461|  25.7k|        state->hold = hold; \
  |  |  462|  25.7k|        state->bits = bits; \
  |  |  463|  25.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (463:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1244|  25.7k|    if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
  ------------------
  |  Branch (1244:9): [True: 21.8k, False: 3.87k]
  |  Branch (1244:26): [True: 1.81k, False: 2.05k]
  |  Branch (1244:52): [True: 1.81k, False: 0]
  ------------------
 1245|  3.87k|            (state->mode < CHECK || flush != Z_FINISH)))
  ------------------
  |  |  176|     62|#define Z_FINISH        4
  ------------------
  |  Branch (1245:14): [True: 1.75k, False: 62]
  |  Branch (1245:37): [True: 62, False: 0]
  ------------------
 1246|  23.6k|        if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
  ------------------
  |  Branch (1246:13): [True: 0, False: 23.6k]
  ------------------
 1247|      0|            state->mode = MEM;
 1248|      0|            return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
 1249|      0|        }
 1250|  25.7k|    in -= strm->avail_in;
 1251|  25.7k|    out -= strm->avail_out;
 1252|  25.7k|    strm->total_in += in;
 1253|  25.7k|    strm->total_out += out;
 1254|  25.7k|    state->total += out;
 1255|  25.7k|    if ((state->wrap & 4) && out)
  ------------------
  |  Branch (1255:9): [True: 25.7k, False: 0]
  |  Branch (1255:30): [True: 21.8k, False: 3.92k]
  ------------------
 1256|  21.8k|        strm->adler = state->check =
 1257|  21.8k|            UPDATE_CHECK(state->check, strm->next_out - out, out);
  ------------------
  |  |  419|  21.8k|    (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
  |  |  ------------------
  |  |  |  Branch (419:6): [True: 21.8k, False: 0]
  |  |  ------------------
  ------------------
 1258|  25.7k|    strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
  ------------------
  |  Branch (1258:43): [True: 6.02k, False: 19.7k]
  ------------------
 1259|  25.7k|                      (state->mode == TYPE ? 128 : 0) +
  ------------------
  |  Branch (1259:24): [True: 95, False: 25.6k]
  ------------------
 1260|  25.7k|                      (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
  ------------------
  |  Branch (1260:24): [True: 0, False: 25.7k]
  |  Branch (1260:47): [True: 0, False: 25.7k]
  ------------------
 1261|  25.7k|    if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
  ------------------
  |  |  176|  25.7k|#define Z_FINISH        4
  ------------------
                  if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  |  Branch (1261:11): [True: 0, False: 25.7k]
  |  Branch (1261:22): [True: 0, False: 0]
  |  Branch (1261:35): [True: 0, False: 25.7k]
  |  Branch (1261:57): [True: 0, False: 0]
  ------------------
 1262|      0|        ret = Z_BUF_ERROR;
  ------------------
  |  |  188|      0|#define Z_BUF_ERROR    (-5)
  ------------------
 1263|  25.7k|    return ret;
 1264|  25.7k|}
inflateEnd:
 1266|  3.86k|int ZEXPORT inflateEnd(z_streamp strm) {
 1267|  3.86k|    struct inflate_state FAR *state;
 1268|  3.86k|    if (inflateStateCheck(strm))
  ------------------
  |  Branch (1268:9): [True: 0, False: 3.86k]
  ------------------
 1269|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1270|  3.86k|    state = (struct inflate_state FAR *)strm->state;
 1271|  3.86k|    if (state->window != Z_NULL) ZFREE(strm, state->window);
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (state->window != Z_NULL) ZFREE(strm, state->window);
  ------------------
  |  |  250|  1.81k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
  |  Branch (1271:9): [True: 1.81k, False: 2.04k]
  ------------------
 1272|  3.86k|    ZFREE(strm, strm->state);
  ------------------
  |  |  250|  3.86k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1273|  3.86k|    strm->state = Z_NULL;
  ------------------
  |  |  216|  3.86k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1274|  3.86k|    Tracev((stderr, "inflate: end\n"));
 1275|  3.86k|    return Z_OK;
  ------------------
  |  |  181|  3.86k|#define Z_OK            0
  ------------------
 1276|  3.86k|}
inflate.c:inflateStateCheck:
   94|  48.9k|local int inflateStateCheck(z_streamp strm) {
   95|  48.9k|    struct inflate_state FAR *state;
   96|  48.9k|    if (strm == Z_NULL ||
  ------------------
  |  |  216|  97.8k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (96:9): [True: 0, False: 48.9k]
  ------------------
   97|  48.9k|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (97:9): [True: 0, False: 48.9k]
  |  Branch (97:42): [True: 0, False: 48.9k]
  ------------------
   98|      0|        return 1;
   99|  48.9k|    state = (struct inflate_state FAR *)strm->state;
  100|  48.9k|    if (state == Z_NULL || state->strm != strm ||
  ------------------
  |  |  216|  97.8k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (100:9): [True: 0, False: 48.9k]
  |  Branch (100:28): [True: 0, False: 48.9k]
  ------------------
  101|  48.9k|        state->mode < HEAD || state->mode > SYNC)
  ------------------
  |  Branch (101:9): [True: 0, False: 48.9k]
  |  Branch (101:31): [True: 0, False: 48.9k]
  ------------------
  102|      0|        return 1;
  103|  48.9k|    return 0;
  104|  48.9k|}
inflate.c:fixedtables:
  252|  1.43k|local void fixedtables(struct inflate_state FAR *state) {
  253|       |#ifdef BUILDFIXED
  254|       |    static int virgin = 1;
  255|       |    static code *lenfix, *distfix;
  256|       |    static code fixed[544];
  257|       |
  258|       |    /* build fixed huffman tables if first call (may not be thread safe) */
  259|       |    if (virgin) {
  260|       |        unsigned sym, bits;
  261|       |        static code *next;
  262|       |
  263|       |        /* literal/length table */
  264|       |        sym = 0;
  265|       |        while (sym < 144) state->lens[sym++] = 8;
  266|       |        while (sym < 256) state->lens[sym++] = 9;
  267|       |        while (sym < 280) state->lens[sym++] = 7;
  268|       |        while (sym < 288) state->lens[sym++] = 8;
  269|       |        next = fixed;
  270|       |        lenfix = next;
  271|       |        bits = 9;
  272|       |        inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
  273|       |
  274|       |        /* distance table */
  275|       |        sym = 0;
  276|       |        while (sym < 32) state->lens[sym++] = 5;
  277|       |        distfix = next;
  278|       |        bits = 5;
  279|       |        inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
  280|       |
  281|       |        /* do this just once */
  282|       |        virgin = 0;
  283|       |    }
  284|       |#else /* !BUILDFIXED */
  285|  1.43k|#   include "inffixed.h"
  ------------------
  |  |    1|       |    /* inffixed.h -- table for decoding fixed codes
  |  |    2|       |     * Generated automatically by makefixed().
  |  |    3|       |     */
  |  |    4|       |
  |  |    5|       |    /* WARNING: this file should *not* be used by applications.
  |  |    6|       |       It is part of the implementation of this library and is
  |  |    7|       |       subject to change. Applications should only use zlib.h.
  |  |    8|       |     */
  |  |    9|       |
  |  |   10|  1.43k|    static const code lenfix[512] = {
  |  |   11|  1.43k|        {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
  |  |   12|  1.43k|        {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
  |  |   13|  1.43k|        {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
  |  |   14|  1.43k|        {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
  |  |   15|  1.43k|        {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
  |  |   16|  1.43k|        {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
  |  |   17|  1.43k|        {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
  |  |   18|  1.43k|        {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
  |  |   19|  1.43k|        {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
  |  |   20|  1.43k|        {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
  |  |   21|  1.43k|        {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
  |  |   22|  1.43k|        {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
  |  |   23|  1.43k|        {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
  |  |   24|  1.43k|        {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
  |  |   25|  1.43k|        {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
  |  |   26|  1.43k|        {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
  |  |   27|  1.43k|        {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
  |  |   28|  1.43k|        {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
  |  |   29|  1.43k|        {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
  |  |   30|  1.43k|        {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
  |  |   31|  1.43k|        {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
  |  |   32|  1.43k|        {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
  |  |   33|  1.43k|        {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
  |  |   34|  1.43k|        {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
  |  |   35|  1.43k|        {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
  |  |   36|  1.43k|        {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
  |  |   37|  1.43k|        {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
  |  |   38|  1.43k|        {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
  |  |   39|  1.43k|        {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
  |  |   40|  1.43k|        {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
  |  |   41|  1.43k|        {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
  |  |   42|  1.43k|        {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
  |  |   43|  1.43k|        {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
  |  |   44|  1.43k|        {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
  |  |   45|  1.43k|        {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
  |  |   46|  1.43k|        {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
  |  |   47|  1.43k|        {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
  |  |   48|  1.43k|        {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
  |  |   49|  1.43k|        {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
  |  |   50|  1.43k|        {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
  |  |   51|  1.43k|        {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
  |  |   52|  1.43k|        {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
  |  |   53|  1.43k|        {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
  |  |   54|  1.43k|        {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
  |  |   55|  1.43k|        {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
  |  |   56|  1.43k|        {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
  |  |   57|  1.43k|        {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
  |  |   58|  1.43k|        {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
  |  |   59|  1.43k|        {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
  |  |   60|  1.43k|        {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
  |  |   61|  1.43k|        {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
  |  |   62|  1.43k|        {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
  |  |   63|  1.43k|        {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
  |  |   64|  1.43k|        {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
  |  |   65|  1.43k|        {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
  |  |   66|  1.43k|        {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
  |  |   67|  1.43k|        {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
  |  |   68|  1.43k|        {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
  |  |   69|  1.43k|        {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
  |  |   70|  1.43k|        {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
  |  |   71|  1.43k|        {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
  |  |   72|  1.43k|        {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
  |  |   73|  1.43k|        {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
  |  |   74|  1.43k|        {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
  |  |   75|  1.43k|        {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
  |  |   76|  1.43k|        {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
  |  |   77|  1.43k|        {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
  |  |   78|  1.43k|        {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
  |  |   79|  1.43k|        {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
  |  |   80|  1.43k|        {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
  |  |   81|  1.43k|        {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
  |  |   82|  1.43k|        {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
  |  |   83|  1.43k|        {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
  |  |   84|  1.43k|        {0,9,255}
  |  |   85|  1.43k|    };
  |  |   86|       |
  |  |   87|  1.43k|    static const code distfix[32] = {
  |  |   88|  1.43k|        {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
  |  |   89|  1.43k|        {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
  |  |   90|  1.43k|        {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
  |  |   91|  1.43k|        {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
  |  |   92|  1.43k|        {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
  |  |   93|  1.43k|        {22,5,193},{64,5,0}
  |  |   94|  1.43k|    };
  ------------------
  286|  1.43k|#endif /* BUILDFIXED */
  287|  1.43k|    state->lencode = lenfix;
  288|  1.43k|    state->lenbits = 9;
  289|  1.43k|    state->distcode = distfix;
  290|  1.43k|    state->distbits = 5;
  291|  1.43k|}
inflate.c:updatewindow:
  368|  23.6k|local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) {
  369|  23.6k|    struct inflate_state FAR *state;
  370|  23.6k|    unsigned dist;
  371|       |
  372|  23.6k|    state = (struct inflate_state FAR *)strm->state;
  373|       |
  374|       |    /* if it hasn't been done already, allocate space for the window */
  375|  23.6k|    if (state->window == Z_NULL) {
  ------------------
  |  |  216|  23.6k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (375:9): [True: 1.81k, False: 21.8k]
  ------------------
  376|  1.81k|        state->window = (unsigned char FAR *)
  377|  1.81k|                        ZALLOC(strm, 1U << state->wbits,
  ------------------
  |  |  249|  1.81k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  378|  1.81k|                               sizeof(unsigned char));
  379|  1.81k|        if (state->window == Z_NULL) return 1;
  ------------------
  |  |  216|  1.81k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (379:13): [True: 0, False: 1.81k]
  ------------------
  380|  1.81k|    }
  381|       |
  382|       |    /* if window not in use yet, initialize */
  383|  23.6k|    if (state->wsize == 0) {
  ------------------
  |  Branch (383:9): [True: 1.81k, False: 21.8k]
  ------------------
  384|  1.81k|        state->wsize = 1U << state->wbits;
  385|  1.81k|        state->wnext = 0;
  386|  1.81k|        state->whave = 0;
  387|  1.81k|    }
  388|       |
  389|       |    /* copy state->wsize or less output bytes into the circular window */
  390|  23.6k|    if (copy >= state->wsize) {
  ------------------
  |  Branch (390:9): [True: 808, False: 22.8k]
  ------------------
  391|    808|        zmemcpy(state->window, end - state->wsize, state->wsize);
  ------------------
  |  |  212|    808|#    define zmemcpy memcpy
  ------------------
  392|    808|        state->wnext = 0;
  393|    808|        state->whave = state->wsize;
  394|    808|    }
  395|  22.8k|    else {
  396|  22.8k|        dist = state->wsize - state->wnext;
  397|  22.8k|        if (dist > copy) dist = copy;
  ------------------
  |  Branch (397:13): [True: 18.3k, False: 4.56k]
  ------------------
  398|  22.8k|        zmemcpy(state->window + state->wnext, end - copy, dist);
  ------------------
  |  |  212|  22.8k|#    define zmemcpy memcpy
  ------------------
  399|  22.8k|        copy -= dist;
  400|  22.8k|        if (copy) {
  ------------------
  |  Branch (400:13): [True: 3.30k, False: 19.5k]
  ------------------
  401|  3.30k|            zmemcpy(state->window, end - copy, copy);
  ------------------
  |  |  212|  3.30k|#    define zmemcpy memcpy
  ------------------
  402|  3.30k|            state->wnext = copy;
  403|  3.30k|            state->whave = state->wsize;
  404|  3.30k|        }
  405|  19.5k|        else {
  406|  19.5k|            state->wnext += dist;
  407|  19.5k|            if (state->wnext == state->wsize) state->wnext = 0;
  ------------------
  |  Branch (407:17): [True: 1.26k, False: 18.3k]
  ------------------
  408|  19.5k|            if (state->whave < state->wsize) state->whave += dist;
  ------------------
  |  Branch (408:17): [True: 5.34k, False: 14.2k]
  ------------------
  409|  19.5k|        }
  410|  22.8k|    }
  411|  23.6k|    return 0;
  412|  23.6k|}

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

_tr_init:
  456|  3.86k|void ZLIB_INTERNAL _tr_init(deflate_state *s) {
  457|  3.86k|    tr_static_init();
  458|       |
  459|  3.86k|    s->l_desc.dyn_tree = s->dyn_ltree;
  460|  3.86k|    s->l_desc.stat_desc = &static_l_desc;
  461|       |
  462|  3.86k|    s->d_desc.dyn_tree = s->dyn_dtree;
  463|  3.86k|    s->d_desc.stat_desc = &static_d_desc;
  464|       |
  465|  3.86k|    s->bl_desc.dyn_tree = s->bl_tree;
  466|  3.86k|    s->bl_desc.stat_desc = &static_bl_desc;
  467|       |
  468|  3.86k|    s->bi_buf = 0;
  469|  3.86k|    s->bi_valid = 0;
  470|  3.86k|    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.86k|    init_block(s);
  478|  3.86k|}
_tr_stored_block:
  861|  3.68k|                                    ulg stored_len, int last) {
  862|  3.68k|    send_bits(s, (STORED_BLOCK<<1) + last, 3);  /* send block type */
  ------------------
  |  |  274|  3.68k|#define send_bits(s, value, length) \
  |  |  275|  3.68k|{ int len = length;\
  |  |  276|  3.68k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  3.68k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 3.68k]
  |  |  ------------------
  |  |  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)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      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.68k|  } else {\
  |  |  283|  3.68k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  3.68k|    s->bi_valid += len;\
  |  |  285|  3.68k|  }\
  |  |  286|  3.68k|}
  ------------------
  863|  3.68k|    bi_windup(s);        /* align on byte boundary */
  864|  3.68k|    put_short(s, (ush)stored_len);
  ------------------
  |  |  144|  3.68k|#define put_short(s, w) { \
  |  |  145|  3.68k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|  3.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  3.68k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|  3.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  3.68k|}
  ------------------
  865|  3.68k|    put_short(s, (ush)~stored_len);
  ------------------
  |  |  144|  3.68k|#define put_short(s, w) { \
  |  |  145|  3.68k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|  3.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  3.68k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|  3.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  3.68k|}
  ------------------
  866|  3.68k|    if (stored_len)
  ------------------
  |  Branch (866:9): [True: 3.68k, False: 0]
  ------------------
  867|  3.68k|        zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
  ------------------
  |  |  212|  3.68k|#    define zmemcpy memcpy
  ------------------
  868|  3.68k|    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.68k|}
_tr_flush_bits:
  880|  38.0k|void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) {
  881|  38.0k|    bi_flush(s);
  882|  38.0k|}
_tr_flush_block:
  998|  13.7k|                                   ulg stored_len, int last) {
  999|  13.7k|    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
 1000|  13.7k|    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.7k|    if (s->level > 0) {
  ------------------
  |  Branch (1003:9): [True: 13.7k, False: 0]
  ------------------
 1004|       |
 1005|       |        /* Check if the file is binary or text */
 1006|  13.7k|        if (s->strm->data_type == Z_UNKNOWN)
  ------------------
  |  |  210|  13.7k|#define Z_UNKNOWN  2
  ------------------
  |  Branch (1006:13): [True: 3.86k, False: 9.90k]
  ------------------
 1007|  3.86k|            s->strm->data_type = detect_data_type(s);
 1008|       |
 1009|       |        /* Construct the literal and distance trees */
 1010|  13.7k|        build_tree(s, (tree_desc *)(&(s->l_desc)));
 1011|  13.7k|        Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
 1012|  13.7k|                s->static_len));
 1013|       |
 1014|  13.7k|        build_tree(s, (tree_desc *)(&(s->d_desc)));
 1015|  13.7k|        Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
 1016|  13.7k|                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.7k|        max_blindex = build_bl_tree(s);
 1025|       |
 1026|       |        /* Determine the best encoding. Compute the block lengths in bytes. */
 1027|  13.7k|        opt_lenb = (s->opt_len + 3 + 7) >> 3;
 1028|  13.7k|        static_lenb = (s->static_len + 3 + 7) >> 3;
 1029|       |
 1030|  13.7k|        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
 1031|  13.7k|                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
 1032|  13.7k|                s->sym_next / 3));
 1033|       |
 1034|  13.7k|#ifndef FORCE_STATIC
 1035|  13.7k|        if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
  ------------------
  |  |  203|  12.0k|#define Z_FIXED               4
  ------------------
  |  Branch (1035:13): [True: 1.68k, False: 12.0k]
  |  Branch (1035:40): [True: 0, False: 12.0k]
  ------------------
 1036|  1.68k|#endif
 1037|  1.68k|            opt_lenb = static_lenb;
 1038|       |
 1039|  13.7k|    } 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.7k|    if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
  ------------------
  |  Branch (1047:9): [True: 3.68k, False: 10.0k]
  |  Branch (1047:39): [True: 3.68k, False: 0]
  ------------------
 1048|       |                       /* 4: two words for the lengths */
 1049|  3.68k|#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.68k|        _tr_stored_block(s, buf, stored_len, last);
 1057|       |
 1058|  10.0k|    } else if (static_lenb == opt_lenb) {
  ------------------
  |  Branch (1058:16): [True: 1.43k, False: 8.65k]
  ------------------
 1059|  1.43k|        send_bits(s, (STATIC_TREES<<1) + last, 3);
  ------------------
  |  |  274|  1.43k|#define send_bits(s, value, length) \
  |  |  275|  1.43k|{ int len = length;\
  |  |  276|  1.43k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  1.43k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 1.43k]
  |  |  ------------------
  |  |  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)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      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.43k|  } else {\
  |  |  283|  1.43k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.43k|    s->bi_valid += len;\
  |  |  285|  1.43k|  }\
  |  |  286|  1.43k|}
  ------------------
 1060|  1.43k|        compress_block(s, (const ct_data *)static_ltree,
 1061|  1.43k|                       (const ct_data *)static_dtree);
 1062|       |#ifdef ZLIB_DEBUG
 1063|       |        s->compressed_len += 3 + s->static_len;
 1064|       |#endif
 1065|  8.65k|    } else {
 1066|  8.65k|        send_bits(s, (DYN_TREES<<1) + last, 3);
  ------------------
  |  |  274|  8.65k|#define send_bits(s, value, length) \
  |  |  275|  8.65k|{ int len = length;\
  |  |  276|  8.65k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  8.65k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 8.65k]
  |  |  ------------------
  |  |  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)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      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.65k|  } else {\
  |  |  283|  8.65k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  8.65k|    s->bi_valid += len;\
  |  |  285|  8.65k|  }\
  |  |  286|  8.65k|}
  ------------------
 1067|  8.65k|        send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
 1068|  8.65k|                       max_blindex + 1);
 1069|  8.65k|        compress_block(s, (const ct_data *)s->dyn_ltree,
 1070|  8.65k|                       (const ct_data *)s->dyn_dtree);
 1071|       |#ifdef ZLIB_DEBUG
 1072|       |        s->compressed_len += 3 + s->opt_len;
 1073|       |#endif
 1074|  8.65k|    }
 1075|  13.7k|    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.7k|    init_block(s);
 1080|       |
 1081|  13.7k|    if (last) {
  ------------------
  |  Branch (1081:9): [True: 3.86k, False: 9.90k]
  ------------------
 1082|  3.86k|        bi_windup(s);
 1083|       |#ifdef ZLIB_DEBUG
 1084|       |        s->compressed_len += 7;  /* align on byte boundary */
 1085|       |#endif
 1086|  3.86k|    }
 1087|  13.7k|    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
 1088|  13.7k|           s->compressed_len - 7*last));
 1089|  13.7k|}
trees.c:tr_static_init:
  295|  3.86k|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.86k|}
trees.c:init_block:
  440|  17.6k|local void init_block(deflate_state *s) {
  441|  17.6k|    int n; /* iterates over tree elements */
  442|       |
  443|       |    /* Initialize the trees. */
  444|  5.05M|    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   40|  5.05M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   37|  5.05M|#define LITERALS  256
  |  |  ------------------
  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   34|  5.05M|#define LENGTH_CODES 29
  |  |  ------------------
  ------------------
                  for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   83|  5.04M|#define Freq fc.freq
  ------------------
  |  Branch (444:17): [True: 5.04M, False: 17.6k]
  ------------------
  445|   546k|    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   43|   546k|#define D_CODES   30
  ------------------
                  for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   83|   528k|#define Freq fc.freq
  ------------------
  |  Branch (445:17): [True: 528k, False: 17.6k]
  ------------------
  446|   352k|    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   46|   352k|#define BL_CODES  19
  ------------------
                  for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   83|   334k|#define Freq fc.freq
  ------------------
  |  Branch (446:17): [True: 334k, False: 17.6k]
  ------------------
  447|       |
  448|  17.6k|    s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   50|  17.6k|#define END_BLOCK 256
  ------------------
                  s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   83|  17.6k|#define Freq fc.freq
  ------------------
  449|  17.6k|    s->opt_len = s->static_len = 0L;
  450|  17.6k|    s->sym_next = s->matches = 0;
  451|  17.6k|}
trees.c:bi_windup:
  181|  7.54k|local void bi_windup(deflate_state *s) {
  182|  7.54k|    if (s->bi_valid > 8) {
  ------------------
  |  Branch (182:9): [True: 1.88k, False: 5.65k]
  ------------------
  183|  1.88k|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|  1.88k|#define put_short(s, w) { \
  |  |  145|  1.88k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|  1.88k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  1.88k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|  1.88k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  1.88k|}
  ------------------
  184|  5.65k|    } else if (s->bi_valid > 0) {
  ------------------
  |  Branch (184:16): [True: 5.07k, False: 583]
  ------------------
  185|  5.07k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  290|  5.07k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  186|  5.07k|    }
  187|  7.54k|    s->bi_used = ((s->bi_valid - 1) & 7) + 1;
  188|  7.54k|    s->bi_buf = 0;
  189|  7.54k|    s->bi_valid = 0;
  190|       |#ifdef ZLIB_DEBUG
  191|       |    s->bits_sent = (s->bits_sent + 7) & ~7;
  192|       |#endif
  193|  7.54k|}
trees.c:bi_flush:
  166|  38.0k|local void bi_flush(deflate_state *s) {
  167|  38.0k|    if (s->bi_valid == 16) {
  ------------------
  |  Branch (167:9): [True: 541, False: 37.5k]
  ------------------
  168|    541|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|    541|#define put_short(s, w) { \
  |  |  145|    541|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|    541|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|    541|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|    541|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|    541|}
  ------------------
  169|    541|        s->bi_buf = 0;
  170|    541|        s->bi_valid = 0;
  171|  37.5k|    } else if (s->bi_valid >= 8) {
  ------------------
  |  Branch (171:16): [True: 3.11k, False: 34.4k]
  ------------------
  172|  3.11k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  290|  3.11k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  173|  3.11k|        s->bi_buf >>= 8;
  174|  3.11k|        s->bi_valid -= 8;
  175|  3.11k|    }
  176|  38.0k|}
trees.c:detect_data_type:
  966|  3.86k|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.86k|    unsigned long block_mask = 0xf3ffc07fUL;
  972|  3.86k|    int n;
  973|       |
  974|       |    /* Check for non-textual ("block-listed") bytes. */
  975|  23.3k|    for (n = 0; n <= 31; n++, block_mask >>= 1)
  ------------------
  |  Branch (975:17): [True: 22.8k, False: 521]
  ------------------
  976|  22.8k|        if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
  ------------------
  |  |   83|  17.2k|#define Freq fc.freq
  ------------------
  |  Branch (976:13): [True: 17.2k, False: 5.55k]
  |  Branch (976:33): [True: 3.33k, False: 13.9k]
  ------------------
  977|  3.33k|            return Z_BINARY;
  ------------------
  |  |  207|  3.33k|#define Z_BINARY   0
  ------------------
  978|       |
  979|       |    /* Check for textual ("allow-listed") bytes. */
  980|    521|    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    521|#define Freq fc.freq
  ------------------
                  if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    488|#define Freq fc.freq
  ------------------
  |  Branch (980:9): [True: 33, False: 488]
  |  Branch (980:38): [True: 35, False: 453]
  ------------------
  981|    521|            || s->dyn_ltree[13].Freq != 0)
  ------------------
  |  |   83|    453|#define Freq fc.freq
  ------------------
  |  Branch (981:16): [True: 22, False: 431]
  ------------------
  982|     90|        return Z_TEXT;
  ------------------
  |  |  208|     90|#define Z_TEXT     1
  ------------------
  983|  39.7k|    for (n = 32; n < LITERALS; n++)
  ------------------
  |  |   37|  39.7k|#define LITERALS  256
  ------------------
  |  Branch (983:18): [True: 39.7k, False: 13]
  ------------------
  984|  39.7k|        if (s->dyn_ltree[n].Freq != 0)
  ------------------
  |  |   83|  39.7k|#define Freq fc.freq
  ------------------
  |  Branch (984:13): [True: 418, False: 39.3k]
  ------------------
  985|    418|            return Z_TEXT;
  ------------------
  |  |  208|    849|#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|     13|    return Z_BINARY;
  ------------------
  |  |  207|     13|#define Z_BINARY   0
  ------------------
  991|    431|}
trees.c:build_tree:
  627|  41.2k|local void build_tree(deflate_state *s, tree_desc *desc) {
  628|  41.2k|    ct_data *tree         = desc->dyn_tree;
  629|  41.2k|    const ct_data *stree  = desc->stat_desc->static_tree;
  630|  41.2k|    int elems             = desc->stat_desc->elems;
  631|  41.2k|    int n, m;          /* iterate over heap elements */
  632|  41.2k|    int max_code = -1; /* largest code with non zero frequency */
  633|  41.2k|    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|  41.2k|    s->heap_len = 0, s->heap_max = HEAP_SIZE;
  ------------------
  |  |   49|  41.2k|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  41.2k|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  41.2k|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  41.2k|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|       |
  641|  4.65M|    for (n = 0; n < elems; n++) {
  ------------------
  |  Branch (641:17): [True: 4.61M, False: 41.2k]
  ------------------
  642|  4.61M|        if (tree[n].Freq != 0) {
  ------------------
  |  |   83|  4.61M|#define Freq fc.freq
  ------------------
  |  Branch (642:13): [True: 2.59M, False: 2.01M]
  ------------------
  643|  2.59M|            s->heap[++(s->heap_len)] = max_code = n;
  644|  2.59M|            s->depth[n] = 0;
  645|  2.59M|        } else {
  646|  2.01M|            tree[n].Len = 0;
  ------------------
  |  |   86|  2.01M|#define Len  dl.len
  ------------------
  647|  2.01M|        }
  648|  4.61M|    }
  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|  60.2k|    while (s->heap_len < 2) {
  ------------------
  |  Branch (655:12): [True: 18.9k, False: 41.2k]
  ------------------
  656|  18.9k|        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
  ------------------
  |  Branch (656:44): [True: 18.5k, False: 470]
  ------------------
  657|  18.9k|        tree[node].Freq = 1;
  ------------------
  |  |   83|  18.9k|#define Freq fc.freq
  ------------------
  658|  18.9k|        s->depth[node] = 0;
  659|  18.9k|        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
  ------------------
  |  |   86|  18.9k|#define Len  dl.len
  ------------------
  |  Branch (659:27): [True: 18.9k, False: 0]
  ------------------
  660|       |        /* node is 0 or 1 so it does not have extra bits */
  661|  18.9k|    }
  662|  41.2k|    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.33M|    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
  ------------------
  |  Branch (667:29): [True: 1.29M, False: 41.2k]
  ------------------
  668|       |
  669|       |    /* Construct the Huffman tree by repeatedly combining the least two
  670|       |     * frequent nodes.
  671|       |     */
  672|  41.2k|    node = elems;              /* next internal node of the tree */
  673|  2.57M|    do {
  674|  2.57M|        pqremove(s, tree, n);  /* n = node of least frequency */
  ------------------
  |  |  488|  2.57M|#define pqremove(s, tree, top) \
  |  |  489|  2.57M|{\
  |  |  490|  2.57M|    top = s->heap[SMALLEST]; \
  |  |  ------------------
  |  |  |  |  480|  2.57M|#define SMALLEST 1
  |  |  ------------------
  |  |  491|  2.57M|    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
  |  |  ------------------
  |  |  |  |  480|  2.57M|#define SMALLEST 1
  |  |  ------------------
  |  |  492|  2.57M|    pqdownheap(s, tree, SMALLEST); \
  |  |  ------------------
  |  |  |  |  480|  2.57M|#define SMALLEST 1
  |  |  ------------------
  |  |  493|  2.57M|}
  ------------------
  675|  2.57M|        m = s->heap[SMALLEST]; /* m = node of next least frequency */
  ------------------
  |  |  480|  2.57M|#define SMALLEST 1
  ------------------
  676|       |
  677|  2.57M|        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
  678|  2.57M|        s->heap[--(s->heap_max)] = m;
  679|       |
  680|       |        /* Create a new node father of n and m */
  681|  2.57M|        tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  2.57M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  2.57M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  2.57M|#define Freq fc.freq
  ------------------
  682|  2.57M|        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
  ------------------
  |  Branch (682:33): [True: 2.29M, False: 274k]
  ------------------
  683|  2.29M|                                s->depth[n] : s->depth[m]) + 1);
  684|  2.57M|        tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  2.57M|#define Dad  dl.dad
  ------------------
                      tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  2.57M|#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.57M|        s->heap[SMALLEST] = node++;
  ------------------
  |  |  480|  2.57M|#define SMALLEST 1
  ------------------
  693|  2.57M|        pqdownheap(s, tree, SMALLEST);
  ------------------
  |  |  480|  2.57M|#define SMALLEST 1
  ------------------
  694|       |
  695|  2.57M|    } while (s->heap_len >= 2);
  ------------------
  |  Branch (695:14): [True: 2.52M, False: 41.2k]
  ------------------
  696|       |
  697|  41.2k|    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
  ------------------
  |  |  480|  41.2k|#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|  41.2k|    gen_bitlen(s, (tree_desc *)desc);
  703|       |
  704|       |    /* The field len is now set, we can generate the bit codes */
  705|  41.2k|    gen_codes ((ct_data *)tree, max_code, s->bl_count);
  706|  41.2k|}
trees.c:pqdownheap:
  509|  6.43M|local void pqdownheap(deflate_state *s, ct_data *tree, int k) {
  510|  6.43M|    int v = s->heap[k];
  511|  6.43M|    int j = k << 1;  /* left son of k */
  512|  34.1M|    while (j <= s->heap_len) {
  ------------------
  |  Branch (512:12): [True: 29.0M, False: 5.08M]
  ------------------
  513|       |        /* Set j to the smallest of the two sons: */
  514|  29.0M|        if (j < s->heap_len &&
  ------------------
  |  Branch (514:13): [True: 28.7M, False: 334k]
  ------------------
  515|  29.0M|            smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
  ------------------
  |  |  500|  28.7M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  28.7M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  57.4M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 8.62M, False: 20.0M]
  |  |  ------------------
  |  |  501|  28.7M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  20.0M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  40.1M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 5.73M, False: 14.3M]
  |  |  |  Branch (501:37): [True: 5.05M, False: 681k]
  |  |  ------------------
  ------------------
  516|  13.6M|            j++;
  517|  13.6M|        }
  518|       |        /* Exit if v is smaller than both sons */
  519|  29.0M|        if (smaller(tree, v, s->heap[j], s->depth)) break;
  ------------------
  |  |  500|  29.0M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  29.0M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  58.0M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 1.06M, False: 27.9M]
  |  |  ------------------
  |  |  501|  29.0M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  27.9M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  55.9M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 428k, False: 27.5M]
  |  |  |  Branch (501:37): [True: 280k, False: 147k]
  |  |  ------------------
  ------------------
  520|       |
  521|       |        /* Exchange v with the smallest son */
  522|  27.6M|        s->heap[k] = s->heap[j];  k = j;
  523|       |
  524|       |        /* And continue down the tree, setting j to the left son of k */
  525|  27.6M|        j <<= 1;
  526|  27.6M|    }
  527|  6.43M|    s->heap[k] = v;
  528|  6.43M|}
trees.c:gen_bitlen:
  540|  41.2k|local void gen_bitlen(deflate_state *s, tree_desc *desc) {
  541|  41.2k|    ct_data *tree        = desc->dyn_tree;
  542|  41.2k|    int max_code         = desc->max_code;
  543|  41.2k|    const ct_data *stree = desc->stat_desc->static_tree;
  544|  41.2k|    const intf *extra    = desc->stat_desc->extra_bits;
  545|  41.2k|    int base             = desc->stat_desc->extra_base;
  546|  41.2k|    int max_length       = desc->stat_desc->max_length;
  547|  41.2k|    int h;              /* heap index */
  548|  41.2k|    int n, m;           /* iterate over the tree elements */
  549|  41.2k|    int bits;           /* bit length */
  550|  41.2k|    int xbits;          /* extra bits */
  551|  41.2k|    ush f;              /* frequency */
  552|  41.2k|    int overflow = 0;   /* number of elements with bit length too large */
  553|       |
  554|   701k|    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
  ------------------
  |  |   52|   701k|#define MAX_BITS 15
  ------------------
  |  Branch (554:20): [True: 660k, False: 41.2k]
  ------------------
  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|  41.2k|    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
  ------------------
  |  |   86|  41.2k|#define Len  dl.len
  ------------------
  560|       |
  561|  5.18M|    for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
  ------------------
  |  |   49|  5.18M|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  5.18M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  5.18M|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  5.18M|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (561:31): [True: 5.14M, False: 41.2k]
  ------------------
  562|  5.14M|        n = s->heap[h];
  563|  5.14M|        bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   85|  5.14M|#define Dad  dl.dad
  ------------------
                      bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   86|  5.14M|#define Len  dl.len
  ------------------
  564|  5.14M|        if (bits > max_length) bits = max_length, overflow++;
  ------------------
  |  Branch (564:13): [True: 13.5k, False: 5.12M]
  ------------------
  565|  5.14M|        tree[n].Len = (ush)bits;
  ------------------
  |  |   86|  5.14M|#define Len  dl.len
  ------------------
  566|       |        /* We overwrite tree[n].Dad which is no longer needed */
  567|       |
  568|  5.14M|        if (n > max_code) continue; /* not a leaf node */
  ------------------
  |  Branch (568:13): [True: 2.52M, False: 2.61M]
  ------------------
  569|       |
  570|  2.61M|        s->bl_count[bits]++;
  571|  2.61M|        xbits = 0;
  572|  2.61M|        if (n >= base) xbits = extra[n - base];
  ------------------
  |  Branch (572:13): [True: 227k, False: 2.38M]
  ------------------
  573|  2.61M|        f = tree[n].Freq;
  ------------------
  |  |   83|  2.61M|#define Freq fc.freq
  ------------------
  574|  2.61M|        s->opt_len += (ulg)f * (unsigned)(bits + xbits);
  575|  2.61M|        if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
  ------------------
  |  |   86|  2.49M|#define Len  dl.len
  ------------------
  |  Branch (575:13): [True: 2.49M, False: 116k]
  ------------------
  576|  2.61M|    }
  577|  41.2k|    if (overflow == 0) return;
  ------------------
  |  Branch (577:9): [True: 40.0k, False: 1.21k]
  ------------------
  578|       |
  579|  1.21k|    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|  6.77k|    do {
  584|  6.77k|        bits = max_length - 1;
  585|  9.97k|        while (s->bl_count[bits] == 0) bits--;
  ------------------
  |  Branch (585:16): [True: 3.20k, False: 6.77k]
  ------------------
  586|  6.77k|        s->bl_count[bits]--;        /* move one leaf down the tree */
  587|  6.77k|        s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
  588|  6.77k|        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|  6.77k|        overflow -= 2;
  593|  6.77k|    } while (overflow > 0);
  ------------------
  |  Branch (593:14): [True: 5.55k, False: 1.21k]
  ------------------
  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|  11.3k|    for (bits = max_length; bits != 0; bits--) {
  ------------------
  |  Branch (600:29): [True: 10.1k, False: 1.21k]
  ------------------
  601|  10.1k|        n = s->bl_count[bits];
  602|  80.3k|        while (n != 0) {
  ------------------
  |  Branch (602:16): [True: 70.1k, False: 10.1k]
  ------------------
  603|  70.1k|            m = s->heap[--h];
  604|  70.1k|            if (m > max_code) continue;
  ------------------
  |  Branch (604:17): [True: 32.1k, False: 37.9k]
  ------------------
  605|  37.9k|            if ((unsigned) tree[m].Len != (unsigned) bits) {
  ------------------
  |  |   86|  37.9k|#define Len  dl.len
  ------------------
  |  Branch (605:17): [True: 3.29k, False: 34.6k]
  ------------------
  606|  3.29k|                Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
  607|  3.29k|                s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   86|  3.29k|#define Len  dl.len
  ------------------
                              s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   83|  3.29k|#define Freq fc.freq
  ------------------
  608|  3.29k|                tree[m].Len = (ush)bits;
  ------------------
  |  |   86|  3.29k|#define Len  dl.len
  ------------------
  609|  3.29k|            }
  610|  37.9k|            n--;
  611|  37.9k|        }
  612|  10.1k|    }
  613|  1.21k|}
trees.c:gen_codes:
  203|  41.2k|local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) {
  204|  41.2k|    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
  205|  41.2k|    unsigned code = 0;         /* running code value */
  206|  41.2k|    int bits;                  /* bit index */
  207|  41.2k|    int n;                     /* code index */
  208|       |
  209|       |    /* The distribution counts are first used to generate the code values
  210|       |     * without bit reversal.
  211|       |     */
  212|   660k|    for (bits = 1; bits <= MAX_BITS; bits++) {
  ------------------
  |  |   52|   660k|#define MAX_BITS 15
  ------------------
  |  Branch (212:20): [True: 619k, False: 41.2k]
  ------------------
  213|   619k|        code = (code + bl_count[bits - 1]) << 1;
  214|   619k|        next_code[bits] = (ush)code;
  215|   619k|    }
  216|       |    /* Check that the bit counts in bl_count are consistent. The last code
  217|       |     * must be all ones.
  218|       |     */
  219|  41.2k|    Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
  220|  41.2k|            "inconsistent bit counts");
  221|  41.2k|    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
  222|       |
  223|  4.01M|    for (n = 0;  n <= max_code; n++) {
  ------------------
  |  Branch (223:18): [True: 3.97M, False: 41.2k]
  ------------------
  224|  3.97M|        int len = tree[n].Len;
  ------------------
  |  |   86|  3.97M|#define Len  dl.len
  ------------------
  225|  3.97M|        if (len == 0) continue;
  ------------------
  |  Branch (225:13): [True: 1.36M, False: 2.61M]
  ------------------
  226|       |        /* Now reverse the bits */
  227|  2.61M|        tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
  ------------------
  |  |   84|  2.61M|#define Code fc.code
  ------------------
  228|       |
  229|  2.61M|        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
  230|  2.61M|            n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1));
  231|  2.61M|    }
  232|  41.2k|}
trees.c:bi_reverse:
  154|  2.61M|local unsigned bi_reverse(unsigned code, int len) {
  155|  2.61M|    register unsigned res = 0;
  156|  21.2M|    do {
  157|  21.2M|        res |= code & 1;
  158|  21.2M|        code >>= 1, res <<= 1;
  159|  21.2M|    } while (--len > 0);
  ------------------
  |  Branch (159:14): [True: 18.5M, False: 2.61M]
  ------------------
  160|  2.61M|    return res >> 1;
  161|  2.61M|}
trees.c:build_bl_tree:
  800|  13.7k|local int build_bl_tree(deflate_state *s) {
  801|  13.7k|    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.7k|    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
  805|  13.7k|    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
  806|       |
  807|       |    /* Build the bit length tree: */
  808|  13.7k|    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.9k|    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
  ------------------
  |  |   46|  13.7k|#define BL_CODES  19
  ------------------
  |  Branch (817:36): [True: 31.9k, False: 0]
  ------------------
  818|  31.9k|        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
  ------------------
  |  |   86|  31.9k|#define Len  dl.len
  ------------------
  |  Branch (818:13): [True: 13.7k, False: 18.1k]
  ------------------
  819|  31.9k|    }
  820|       |    /* Update opt_len to include the bit length tree and counts */
  821|  13.7k|    s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
  822|  13.7k|    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
  823|  13.7k|            s->opt_len, s->static_len));
  824|       |
  825|  13.7k|    return max_blindex;
  826|  13.7k|}
trees.c:scan_tree:
  712|  27.5k|local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
  713|  27.5k|    int n;                     /* iterates over all tree elements */
  714|  27.5k|    int prevlen = -1;          /* last emitted length */
  715|  27.5k|    int curlen;                /* length of current code */
  716|  27.5k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  27.5k|#define Len  dl.len
  ------------------
  717|  27.5k|    int count = 0;             /* repeat count of the current code */
  718|  27.5k|    int max_count = 7;         /* max repeat count */
  719|  27.5k|    int min_count = 4;         /* min repeat count */
  720|       |
  721|  27.5k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (721:9): [True: 3.03k, False: 24.4k]
  ------------------
  722|  27.5k|    tree[max_code + 1].Len = (ush)0xffff; /* guard */
  ------------------
  |  |   86|  27.5k|#define Len  dl.len
  ------------------
  723|       |
  724|  3.75M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (724:17): [True: 3.72M, False: 27.5k]
  ------------------
  725|  3.72M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  3.72M|#define Len  dl.len
  ------------------
  726|  3.72M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (726:13): [True: 3.51M, False: 206k]
  |  Branch (726:36): [True: 2.65M, False: 860k]
  ------------------
  727|  2.65M|            continue;
  728|  2.65M|        } else if (count < min_count) {
  ------------------
  |  Branch (728:20): [True: 729k, False: 338k]
  ------------------
  729|   729k|            s->bl_tree[curlen].Freq += (ush)count;
  ------------------
  |  |   83|   729k|#define Freq fc.freq
  ------------------
  730|   729k|        } else if (curlen != 0) {
  ------------------
  |  Branch (730:20): [True: 280k, False: 57.7k]
  ------------------
  731|   280k|            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
  ------------------
  |  |   83|   113k|#define Freq fc.freq
  ------------------
  |  Branch (731:17): [True: 113k, False: 167k]
  ------------------
  732|   280k|            s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   53|   280k|#define REP_3_6      16
  ------------------
                          s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   83|   280k|#define Freq fc.freq
  ------------------
  733|   280k|        } else if (count <= 10) {
  ------------------
  |  Branch (733:20): [True: 37.0k, False: 20.6k]
  ------------------
  734|  37.0k|            s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   56|  37.0k|#define REPZ_3_10    17
  ------------------
                          s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   83|  37.0k|#define Freq fc.freq
  ------------------
  735|  37.0k|        } else {
  736|  20.6k|            s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   59|  20.6k|#define REPZ_11_138  18
  ------------------
                          s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   83|  20.6k|#define Freq fc.freq
  ------------------
  737|  20.6k|        }
  738|  1.06M|        count = 0; prevlen = curlen;
  739|  1.06M|        if (nextlen == 0) {
  ------------------
  |  Branch (739:13): [True: 120k, False: 947k]
  ------------------
  740|   120k|            max_count = 138, min_count = 3;
  741|   947k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (741:20): [True: 188k, False: 758k]
  ------------------
  742|   188k|            max_count = 6, min_count = 3;
  743|   758k|        } else {
  744|   758k|            max_count = 7, min_count = 4;
  745|   758k|        }
  746|  1.06M|    }
  747|  27.5k|}
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|   120M|    if (s->sym_next != 0) do {
  ------------------
  |  Branch (908:9): [True: 9.89k, False: 184]
  ------------------
  909|       |#ifdef LIT_MEM
  910|       |        dist = s->d_buf[sx];
  911|       |        lc = s->l_buf[sx++];
  912|       |#else
  913|   120M|        dist = s->sym_buf[sx++] & 0xff;
  914|   120M|        dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
  915|   120M|        lc = s->sym_buf[sx++];
  916|   120M|#endif
  917|   120M|        if (dist == 0) {
  ------------------
  |  Branch (917:13): [True: 117M, False: 3.35M]
  ------------------
  918|   117M|            send_code(s, lc, ltree); /* send a literal byte */
  ------------------
  |  |  239|   117M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   117M|#define send_bits(s, value, length) \
  |  |  |  |  275|   117M|{ int len = length;\
  |  |  |  |  276|   117M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   117M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 40.7M, False: 76.8M]
  |  |  |  |  ------------------
  |  |  |  |  277|  40.7M|    int val = (int)value;\
  |  |  |  |  278|  40.7M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  40.7M|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  40.7M|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  40.7M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  40.7M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  40.7M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  40.7M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  40.7M|}
  |  |  |  |  ------------------
  |  |  |  |  280|  40.7M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  40.7M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  40.7M|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  40.7M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  76.8M|  } else {\
  |  |  |  |  283|  76.8M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  76.8M|    s->bi_valid += len;\
  |  |  |  |  285|  76.8M|  }\
  |  |  |  |  286|   117M|}
  |  |  ------------------
  ------------------
  919|   117M|            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
  920|   117M|        } else {
  921|       |            /* Here, lc is the match length - MIN_MATCH */
  922|  3.35M|            code = _length_code[lc];
  923|  3.35M|            send_code(s, code + LITERALS + 1, ltree);   /* send length code */
  ------------------
  |  |  239|  3.35M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  3.35M|#define send_bits(s, value, length) \
  |  |  |  |  275|  3.35M|{ int len = length;\
  |  |  |  |  276|  3.35M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.35M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 859k, False: 2.49M]
  |  |  |  |  ------------------
  |  |  |  |  277|   859k|    int val = (int)value;\
  |  |  |  |  278|   859k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   859k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   859k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   859k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   859k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   859k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   859k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   859k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   859k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   859k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   859k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   859k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  2.49M|  } else {\
  |  |  |  |  283|  2.49M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.49M|    s->bi_valid += len;\
  |  |  |  |  285|  2.49M|  }\
  |  |  |  |  286|  3.35M|}
  |  |  ------------------
  ------------------
  924|  3.35M|            extra = extra_lbits[code];
  925|  3.35M|            if (extra != 0) {
  ------------------
  |  Branch (925:17): [True: 338k, False: 3.01M]
  ------------------
  926|   338k|                lc -= base_length[code];
  927|   338k|                send_bits(s, lc, extra);       /* send the extra length bits */
  ------------------
  |  |  274|   338k|#define send_bits(s, value, length) \
  |  |  275|   338k|{ int len = length;\
  |  |  276|   338k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   338k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 44.1k, False: 294k]
  |  |  ------------------
  |  |  277|  44.1k|    int val = (int)value;\
  |  |  278|  44.1k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  44.1k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  44.1k|#define put_short(s, w) { \
  |  |  |  |  145|  44.1k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  44.1k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  44.1k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  44.1k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  44.1k|}
  |  |  ------------------
  |  |  280|  44.1k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  44.1k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  44.1k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  44.1k|#define Buf_size 16
  |  |  ------------------
  |  |  282|   294k|  } else {\
  |  |  283|   294k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   294k|    s->bi_valid += len;\
  |  |  285|   294k|  }\
  |  |  286|   338k|}
  ------------------
  928|   338k|            }
  929|  3.35M|            dist--; /* dist is now the match distance - 1 */
  930|  3.35M|            code = d_code(dist);
  ------------------
  |  |  318|  3.35M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  ------------------
  |  |  |  Branch (318:5): [True: 1.27M, False: 2.07M]
  |  |  ------------------
  ------------------
  931|  3.35M|            Assert (code < D_CODES, "bad d_code");
  932|       |
  933|  3.35M|            send_code(s, code, dtree);       /* send the distance code */
  ------------------
  |  |  239|  3.35M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  3.35M|#define send_bits(s, value, length) \
  |  |  |  |  275|  3.35M|{ int len = length;\
  |  |  |  |  276|  3.35M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.35M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 767k, False: 2.58M]
  |  |  |  |  ------------------
  |  |  |  |  277|   767k|    int val = (int)value;\
  |  |  |  |  278|   767k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   767k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   767k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   767k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   767k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   767k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   767k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   767k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   767k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   767k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   767k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   767k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  2.58M|  } else {\
  |  |  |  |  283|  2.58M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.58M|    s->bi_valid += len;\
  |  |  |  |  285|  2.58M|  }\
  |  |  |  |  286|  3.35M|}
  |  |  ------------------
  ------------------
  934|  3.35M|            extra = extra_dbits[code];
  935|  3.35M|            if (extra != 0) {
  ------------------
  |  Branch (935:17): [True: 2.71M, False: 634k]
  ------------------
  936|  2.71M|                dist -= (unsigned)base_dist[code];
  937|  2.71M|                send_bits(s, dist, extra);   /* send the extra distance bits */
  ------------------
  |  |  274|  2.71M|#define send_bits(s, value, length) \
  |  |  275|  2.71M|{ int len = length;\
  |  |  276|  2.71M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  2.71M|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.52M, False: 1.19M]
  |  |  ------------------
  |  |  277|  1.52M|    int val = (int)value;\
  |  |  278|  1.52M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  1.52M|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  1.52M|#define put_short(s, w) { \
  |  |  |  |  145|  1.52M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.52M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.52M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.52M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  1.52M|}
  |  |  ------------------
  |  |  280|  1.52M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  1.52M|#define Buf_size 16
  |  |  ------------------
  |  |  281|  1.52M|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  1.52M|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.52M|  } else {\
  |  |  283|  1.19M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.19M|    s->bi_valid += len;\
  |  |  285|  1.19M|  }\
  |  |  286|  2.71M|}
  ------------------
  938|  2.71M|            }
  939|  3.35M|        } /* 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|   120M|        Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
  946|   120M|#endif
  947|       |
  948|   120M|    } while (sx < s->sym_next);
  ------------------
  |  Branch (948:14): [True: 120M, False: 9.89k]
  ------------------
  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.06k, False: 4.02k]
  |  |  |  |  ------------------
  |  |  |  |  277|  6.06k|    int val = (int)value;\
  |  |  |  |  278|  6.06k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  6.06k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  6.06k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  6.06k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  6.06k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  6.06k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  6.06k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  6.06k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  6.06k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.06k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  6.06k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.06k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  6.06k|  } else {\
  |  |  |  |  283|  4.02k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  4.02k|    s->bi_valid += len;\
  |  |  |  |  285|  4.02k|  }\
  |  |  |  |  286|  10.0k|}
  |  |  ------------------
  ------------------
  951|  10.0k|}
trees.c:send_all_trees:
  834|  8.65k|                          int blcodes) {
  835|  8.65k|    int rank;                    /* index in bl_order */
  836|       |
  837|  8.65k|    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  838|  8.65k|    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  839|  8.65k|            "too many codes");
  840|  8.65k|    Tracev((stderr, "\nbl counts: "));
  841|  8.65k|    send_bits(s, lcodes - 257, 5);  /* not +255 as stated in appnote.txt */
  ------------------
  |  |  274|  8.65k|#define send_bits(s, value, length) \
  |  |  275|  8.65k|{ int len = length;\
  |  |  276|  8.65k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  8.65k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 8.65k]
  |  |  ------------------
  |  |  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)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      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.65k|  } else {\
  |  |  283|  8.65k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  8.65k|    s->bi_valid += len;\
  |  |  285|  8.65k|  }\
  |  |  286|  8.65k|}
  ------------------
  842|  8.65k|    send_bits(s, dcodes - 1,   5);
  ------------------
  |  |  274|  8.65k|#define send_bits(s, value, length) \
  |  |  275|  8.65k|{ int len = length;\
  |  |  276|  8.65k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  8.65k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 2.75k, False: 5.89k]
  |  |  ------------------
  |  |  277|  2.75k|    int val = (int)value;\
  |  |  278|  2.75k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  2.75k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.75k|#define put_short(s, w) { \
  |  |  |  |  145|  2.75k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  2.75k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.75k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  2.75k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.75k|}
  |  |  ------------------
  |  |  280|  2.75k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.75k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  2.75k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.75k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  5.89k|  } else {\
  |  |  283|  5.89k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  5.89k|    s->bi_valid += len;\
  |  |  285|  5.89k|  }\
  |  |  286|  8.65k|}
  ------------------
  843|  8.65k|    send_bits(s, blcodes - 4,  4);  /* not -3 as stated in appnote.txt */
  ------------------
  |  |  274|  8.65k|#define send_bits(s, value, length) \
  |  |  275|  8.65k|{ int len = length;\
  |  |  276|  8.65k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  8.65k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 5.89k, False: 2.75k]
  |  |  ------------------
  |  |  277|  5.89k|    int val = (int)value;\
  |  |  278|  5.89k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  5.89k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  5.89k|#define put_short(s, w) { \
  |  |  |  |  145|  5.89k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  5.89k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  5.89k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  5.89k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  5.89k|}
  |  |  ------------------
  |  |  280|  5.89k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  5.89k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  5.89k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  5.89k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  5.89k|  } else {\
  |  |  283|  2.75k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  2.75k|    s->bi_valid += len;\
  |  |  285|  2.75k|  }\
  |  |  286|  8.65k|}
  ------------------
  844|   160k|    for (rank = 0; rank < blcodes; rank++) {
  ------------------
  |  Branch (844:20): [True: 151k, False: 8.65k]
  ------------------
  845|   151k|        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
  846|   151k|        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
  ------------------
  |  |  274|   151k|#define send_bits(s, value, length) \
  |  |  275|   151k|{ int len = length;\
  |  |  276|   151k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   151k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 25.5k, False: 126k]
  |  |  ------------------
  |  |  277|  25.5k|    int val = (int)value;\
  |  |  278|  25.5k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  25.5k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  25.5k|#define put_short(s, w) { \
  |  |  |  |  145|  25.5k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  25.5k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  25.5k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  25.5k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  25.5k|}
  |  |  ------------------
  |  |  280|  25.5k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  25.5k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  25.5k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  25.5k|#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|   151k|}
  ------------------
  847|   151k|    }
  848|  8.65k|    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
  849|       |
  850|  8.65k|    send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
  851|  8.65k|    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
  852|       |
  853|  8.65k|    send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
  854|  8.65k|    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
  855|  8.65k|}
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.87k, False: 15.4k]
  ------------------
  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.28M, False: 84.0k]
  |  Branch (767:36): [True: 1.56M, False: 724k]
  ------------------
  768|  1.56M|            continue;
  769|  1.56M|        } else if (count < min_count) {
  ------------------
  |  Branch (769:20): [True: 619k, False: 188k]
  ------------------
  770|   810k|            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
  ------------------
  |  |  239|   810k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   810k|#define send_bits(s, value, length) \
  |  |  |  |  275|   810k|{ int len = length;\
  |  |  |  |  276|   810k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   810k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 133k, False: 677k]
  |  |  |  |  ------------------
  |  |  |  |  277|   133k|    int val = (int)value;\
  |  |  |  |  278|   133k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   133k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   133k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   133k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   133k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   133k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   133k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   133k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   133k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   133k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   133k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   133k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|   677k|  } else {\
  |  |  |  |  283|   677k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|   677k|    s->bi_valid += len;\
  |  |  |  |  285|   677k|  }\
  |  |  |  |  286|   810k|}
  |  |  ------------------
  ------------------
  |  Branch (770:61): [True: 190k, False: 619k]
  ------------------
  771|       |
  772|   619k|        } else if (curlen != 0) {
  ------------------
  |  Branch (772:20): [True: 143k, False: 45.0k]
  ------------------
  773|   143k|            if (curlen != prevlen) {
  ------------------
  |  Branch (773:17): [True: 87.2k, False: 56.4k]
  ------------------
  774|  87.2k|                send_code(s, curlen, s->bl_tree); count--;
  ------------------
  |  |  239|  87.2k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  87.2k|#define send_bits(s, value, length) \
  |  |  |  |  275|  87.2k|{ int len = length;\
  |  |  |  |  276|  87.2k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  87.2k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 8.98k, False: 78.2k]
  |  |  |  |  ------------------
  |  |  |  |  277|  8.98k|    int val = (int)value;\
  |  |  |  |  278|  8.98k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  8.98k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  8.98k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  8.98k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  8.98k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  8.98k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  8.98k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  8.98k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  8.98k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  8.98k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  8.98k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  8.98k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  78.2k|  } else {\
  |  |  |  |  283|  78.2k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  78.2k|    s->bi_valid += len;\
  |  |  |  |  285|  78.2k|  }\
  |  |  |  |  286|  87.2k|}
  |  |  ------------------
  ------------------
  775|  87.2k|            }
  776|   143k|            Assert(count >= 3 && count <= 6, " 3_6?");
  777|   143k|            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  239|   143k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   143k|#define send_bits(s, value, length) \
  |  |  |  |  275|   143k|{ int len = length;\
  |  |  |  |  276|   143k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   143k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 21.9k, False: 121k]
  |  |  |  |  ------------------
  |  |  |  |  277|  21.9k|    int val = (int)value;\
  |  |  |  |  278|  21.9k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  21.9k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  21.9k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  21.9k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  21.9k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  21.9k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  21.9k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  21.9k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  21.9k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  21.9k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  21.9k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  21.9k|#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|   143k|}
  |  |  ------------------
  ------------------
                          send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  274|   143k|#define send_bits(s, value, length) \
  |  |  275|   143k|{ int len = length;\
  |  |  276|   143k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   143k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 18.0k, False: 125k]
  |  |  ------------------
  |  |  277|  18.0k|    int val = (int)value;\
  |  |  278|  18.0k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  18.0k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  18.0k|#define put_short(s, w) { \
  |  |  |  |  145|  18.0k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  18.0k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  18.0k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  18.0k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  18.0k|}
  |  |  ------------------
  |  |  280|  18.0k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  18.0k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  18.0k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  18.0k|#define Buf_size 16
  |  |  ------------------
  |  |  282|   125k|  } else {\
  |  |  283|   125k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   125k|    s->bi_valid += len;\
  |  |  285|   125k|  }\
  |  |  286|   143k|}
  ------------------
  778|       |
  779|   143k|        } else if (count <= 10) {
  ------------------
  |  Branch (779:20): [True: 30.5k, False: 14.4k]
  ------------------
  780|  30.5k|            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  239|  30.5k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  30.5k|#define send_bits(s, value, length) \
  |  |  |  |  275|  30.5k|{ int len = length;\
  |  |  |  |  276|  30.5k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  30.5k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 6.81k, False: 23.7k]
  |  |  |  |  ------------------
  |  |  |  |  277|  6.81k|    int val = (int)value;\
  |  |  |  |  278|  6.81k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  6.81k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  6.81k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  6.81k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  6.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  6.81k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  6.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  6.81k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  6.81k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.81k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  6.81k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.81k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  23.7k|  } else {\
  |  |  |  |  283|  23.7k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  23.7k|    s->bi_valid += len;\
  |  |  |  |  285|  23.7k|  }\
  |  |  |  |  286|  30.5k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  274|  30.5k|#define send_bits(s, value, length) \
  |  |  275|  30.5k|{ int len = length;\
  |  |  276|  30.5k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  30.5k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 5.77k, False: 24.8k]
  |  |  ------------------
  |  |  277|  5.77k|    int val = (int)value;\
  |  |  278|  5.77k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  5.77k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  5.77k|#define put_short(s, w) { \
  |  |  |  |  145|  5.77k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  5.77k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  5.77k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  5.77k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  5.77k|}
  |  |  ------------------
  |  |  280|  5.77k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  5.77k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  5.77k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  5.77k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  24.8k|  } else {\
  |  |  283|  24.8k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  24.8k|    s->bi_valid += len;\
  |  |  285|  24.8k|  }\
  |  |  286|  30.5k|}
  ------------------
  781|       |
  782|  30.5k|        } else {
  783|  14.4k|            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  239|  14.4k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  14.4k|#define send_bits(s, value, length) \
  |  |  |  |  275|  14.4k|{ int len = length;\
  |  |  |  |  276|  14.4k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  14.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 2.78k, False: 11.6k]
  |  |  |  |  ------------------
  |  |  |  |  277|  2.78k|    int val = (int)value;\
  |  |  |  |  278|  2.78k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  2.78k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  2.78k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  2.78k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  2.78k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.78k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  2.78k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.78k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  2.78k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.78k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  2.78k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.78k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  11.6k|  } else {\
  |  |  |  |  283|  11.6k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  11.6k|    s->bi_valid += len;\
  |  |  |  |  285|  11.6k|  }\
  |  |  |  |  286|  14.4k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  274|  14.4k|#define send_bits(s, value, length) \
  |  |  275|  14.4k|{ int len = length;\
  |  |  276|  14.4k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  14.4k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 6.26k, False: 8.19k]
  |  |  ------------------
  |  |  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)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  6.26k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  6.26k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  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|  8.19k|  } else {\
  |  |  283|  8.19k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  8.19k|    s->bi_valid += len;\
  |  |  285|  8.19k|  }\
  |  |  286|  14.4k|}
  ------------------
  784|  14.4k|        }
  785|   808k|        count = 0; prevlen = curlen;
  786|   808k|        if (nextlen == 0) {
  ------------------
  |  Branch (786:13): [True: 97.5k, False: 711k]
  ------------------
  787|  97.5k|            max_count = 138, min_count = 3;
  788|   711k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (788:20): [True: 70.9k, False: 640k]
  ------------------
  789|  70.9k|            max_count = 6, min_count = 3;
  790|   640k|        } else {
  791|   640k|            max_count = 7, min_count = 4;
  792|   640k|        }
  793|   808k|    }
  794|  17.3k|}

zcalloc:
  286|  24.9k|voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
  287|  24.9k|    (void)opaque;
  288|  24.9k|    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
  ------------------
  |  Branch (288:12): [Folded - Ignored]
  ------------------
  289|  24.9k|                              (voidpf)calloc(items, size);
  290|  24.9k|}
zcfree:
  292|  24.9k|void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
  293|  24.9k|    (void)opaque;
  294|  24.9k|    free(ptr);
  295|  24.9k|}

