test_deflate:
   25|  2.45k|int test_deflate(unsigned char *compr, size_t comprLen) {
   26|  2.45k|  z_stream c_stream; /* compression stream */
   27|  2.45k|  int err;
   28|  2.45k|  unsigned long len = dataLen;
   29|       |
   30|  2.45k|  c_stream.zalloc = zalloc;
   31|  2.45k|  c_stream.zfree = zfree;
   32|  2.45k|  c_stream.opaque = (void *)0;
   33|       |
   34|  2.45k|  err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
  ------------------
  |  | 1943|  2.45k|          deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
  |  |  ------------------
  |  |  |  |   44|  2.45k|#define ZLIB_VERSION "1.4"
  |  |  ------------------
  ------------------
   35|  2.45k|  CHECK_ERR(err, "deflateInit");
  ------------------
  |  |   10|  2.45k|#define CHECK_ERR(err, msg) { \
  |  |   11|  2.45k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  4.91k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 2.45k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  2.45k|}
  ------------------
   36|       |
   37|  2.45k|  c_stream.next_in = (Bytef *)data;
   38|  2.45k|  c_stream.next_out = compr;
   39|       |
   40|   212M|  while (c_stream.total_in != len && c_stream.total_out < comprLen) {
  ------------------
  |  Branch (40:10): [True: 212M, False: 2.45k]
  |  Branch (40:38): [True: 212M, False: 0]
  ------------------
   41|   212M|    c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */
   42|   212M|    err = deflate(&c_stream, Z_NO_FLUSH);
  ------------------
  |  |  172|   212M|#define Z_NO_FLUSH      0
  ------------------
   43|   212M|    CHECK_ERR(err, "deflate small 1");
  ------------------
  |  |   10|   212M|#define CHECK_ERR(err, msg) { \
  |  |   11|   212M|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|   424M|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 212M]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|   212M|}
  ------------------
   44|   212M|  }
   45|       |  /* Finish the stream, still forcing small buffers: */
   46|  9.50M|  for (;;) {
   47|  9.50M|    c_stream.avail_out = 1;
   48|  9.50M|    err = deflate(&c_stream, Z_FINISH);
  ------------------
  |  |  176|  9.50M|#define Z_FINISH        4
  ------------------
   49|  9.50M|    if (err == Z_STREAM_END)
  ------------------
  |  |  182|  9.50M|#define Z_STREAM_END    1
  ------------------
  |  Branch (49:9): [True: 2.45k, False: 9.50M]
  ------------------
   50|  2.45k|      break;
   51|  9.50M|    CHECK_ERR(err, "deflate small 2");
  ------------------
  |  |   10|  9.50M|#define CHECK_ERR(err, msg) { \
  |  |   11|  9.50M|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  19.0M|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 9.50M]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  9.50M|}
  ------------------
   52|  9.50M|  }
   53|       |
   54|  2.45k|  err = deflateEnd(&c_stream);
   55|  2.45k|  CHECK_ERR(err, "deflateEnd");
  ------------------
  |  |   10|  2.45k|#define CHECK_ERR(err, msg) { \
  |  |   11|  2.45k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  4.91k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 2.45k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  2.45k|}
  ------------------
   56|  2.45k|  return 0;
   57|  2.45k|}
test_inflate:
   63|  2.45k|                  size_t uncomprLen) {
   64|  2.45k|  int err;
   65|  2.45k|  z_stream d_stream; /* decompression stream */
   66|       |
   67|  2.45k|  d_stream.zalloc = zalloc;
   68|  2.45k|  d_stream.zfree = zfree;
   69|  2.45k|  d_stream.opaque = (void *)0;
   70|       |
   71|  2.45k|  d_stream.next_in = compr;
   72|  2.45k|  d_stream.avail_in = 0;
   73|  2.45k|  d_stream.next_out = uncompr;
   74|       |
   75|  2.45k|  err = inflateInit(&d_stream);
  ------------------
  |  | 1945|  2.45k|          inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
  |  |  ------------------
  |  |  |  |   44|  2.45k|#define ZLIB_VERSION "1.4"
  |  |  ------------------
  ------------------
   76|  2.45k|  CHECK_ERR(err, "inflateInit");
  ------------------
  |  |   10|  2.45k|#define CHECK_ERR(err, msg) { \
  |  |   11|  2.45k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  4.91k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 2.45k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  2.45k|}
  ------------------
   77|       |
   78|   138M|  while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen) {
  ------------------
  |  Branch (78:10): [True: 138M, False: 2.45k]
  |  Branch (78:45): [True: 138M, False: 0]
  ------------------
   79|   138M|    d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */
   80|   138M|    err = inflate(&d_stream, Z_NO_FLUSH);
  ------------------
  |  |  172|   138M|#define Z_NO_FLUSH      0
  ------------------
   81|   138M|    if (err == Z_STREAM_END)
  ------------------
  |  |  182|   138M|#define Z_STREAM_END    1
  ------------------
  |  Branch (81:9): [True: 0, False: 138M]
  ------------------
   82|      0|      break;
   83|   138M|    CHECK_ERR(err, "inflate");
  ------------------
  |  |   10|   138M|#define CHECK_ERR(err, msg) { \
  |  |   11|   138M|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|   276M|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 138M]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|   138M|}
  ------------------
   84|   138M|  }
   85|       |
   86|  2.45k|  err = inflateEnd(&d_stream);
   87|  2.45k|  CHECK_ERR(err, "inflateEnd");
  ------------------
  |  |   10|  2.45k|#define CHECK_ERR(err, msg) { \
  |  |   11|  2.45k|    if (err != Z_OK) { \
  |  |  ------------------
  |  |  |  |  181|  4.91k|#define Z_OK            0
  |  |  ------------------
  |  |  |  Branch (11:9): [True: 0, False: 2.45k]
  |  |  ------------------
  |  |   12|      0|        fprintf(stderr, "%s error: %d\n", msg, err); \
  |  |   13|      0|        return 0; \
  |  |   14|      0|    } \
  |  |   15|  2.45k|}
  ------------------
   88|       |
   89|  2.45k|  if (memcmp(uncompr, data, dataLen)) {
  ------------------
  |  Branch (89:7): [True: 0, False: 2.45k]
  ------------------
   90|      0|    fprintf(stderr, "bad inflate\n");
   91|      0|    return 0;
   92|      0|  }
   93|  2.45k|  return 0;
   94|  2.45k|}
LLVMFuzzerTestOneInput:
   96|  2.45k|int LLVMFuzzerTestOneInput(const uint8_t *d, size_t size) {
   97|  2.45k|  size_t comprLen = compressBound(size);
   98|  2.45k|  size_t uncomprLen = size;
   99|  2.45k|  uint8_t *compr, *uncompr;
  100|       |
  101|       |  /* Discard inputs larger than 1Mb. */
  102|  2.45k|  static size_t kMaxSize = 1024 * 1024;
  103|       |
  104|  2.45k|  if (size < 1 || size > kMaxSize)
  ------------------
  |  Branch (104:7): [True: 0, False: 2.45k]
  |  Branch (104:19): [True: 0, False: 2.45k]
  ------------------
  105|      0|    return 0;
  106|       |
  107|  2.45k|  data = d;
  108|  2.45k|  dataLen = size;
  109|  2.45k|  compr = (uint8_t *)calloc(1, comprLen);
  110|  2.45k|  uncompr = (uint8_t *)calloc(1, uncomprLen);
  111|       |
  112|  2.45k|  test_deflate(compr, comprLen);
  113|  2.45k|  test_inflate(compr, comprLen, uncompr, uncomprLen);
  114|       |
  115|  2.45k|  free(compr);
  116|  2.45k|  free(uncompr);
  117|       |
  118|       |  /* This function must return 0. */
  119|  2.45k|  return 0;
  120|  2.45k|}

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

compressBound_z:
   91|  2.45k|z_size_t ZEXPORT compressBound_z(z_size_t sourceLen) {
   92|  2.45k|    z_size_t bound = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
   93|  2.45k|                     (sourceLen >> 25) + 13;
   94|  2.45k|    return bound < sourceLen ? (z_size_t)-1 : bound;
  ------------------
  |  Branch (94:12): [True: 0, False: 2.45k]
  ------------------
   95|  2.45k|}
compressBound:
   96|  2.45k|uLong ZEXPORT compressBound(uLong sourceLen) {
   97|  2.45k|    z_size_t bound = compressBound_z(sourceLen);
   98|  2.45k|    return (uLong)bound != bound ? (uLong)-1 : (uLong)bound;
  ------------------
  |  Branch (98:12): [True: 0, False: 2.45k]
  ------------------
   99|  2.45k|}

deflateInit_:
  380|  2.45k|                         int stream_size) {
  381|  2.45k|    return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
  ------------------
  |  |  213|  2.45k|#define Z_DEFLATED   8
  ------------------
                  return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
  ------------------
  |  |  287|  2.45k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
                  return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
  ------------------
  |  |   81|  2.45k|#  define DEF_MEM_LEVEL 8
  ------------------
  382|  2.45k|                         Z_DEFAULT_STRATEGY, version, stream_size);
  ------------------
  |  |  204|  2.45k|#define Z_DEFAULT_STRATEGY    0
  ------------------
  383|       |    /* To do: ignore strm->next_in if we use it as window */
  384|  2.45k|}
deflateInit2_:
  389|  2.45k|                          const char *version, int stream_size) {
  390|  2.45k|    deflate_state *s;
  391|  2.45k|    int wrap = 1;
  392|  2.45k|    static const char my_version[] = ZLIB_VERSION;
  ------------------
  |  |   44|  2.45k|#define ZLIB_VERSION "1.4"
  ------------------
  393|       |
  394|  2.45k|    if (version == Z_NULL || version[0] != my_version[0] ||
  ------------------
  |  |  216|  4.91k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (394:9): [True: 0, False: 2.45k]
  |  Branch (394:30): [True: 0, False: 2.45k]
  ------------------
  395|  2.45k|        stream_size != sizeof(z_stream)) {
  ------------------
  |  Branch (395:9): [True: 0, False: 2.45k]
  ------------------
  396|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  189|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  397|      0|    }
  398|  2.45k|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  216|  2.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (398:9): [True: 0, False: 2.45k]
  ------------------
  399|       |
  400|  2.45k|    strm->msg = Z_NULL;
  ------------------
  |  |  216|  2.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  401|  2.45k|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (401:9): [True: 2.45k, False: 0]
  ------------------
  402|       |#ifdef Z_SOLO
  403|       |        return Z_STREAM_ERROR;
  404|       |#else
  405|  2.45k|        strm->zalloc = zcalloc;
  406|  2.45k|        strm->opaque = (voidpf)0;
  407|  2.45k|#endif
  408|  2.45k|    }
  409|  2.45k|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (409:9): [True: 2.45k, False: 0]
  ------------------
  410|       |#ifdef Z_SOLO
  411|       |        return Z_STREAM_ERROR;
  412|       |#else
  413|  2.45k|        strm->zfree = zcfree;
  414|  2.45k|#endif
  415|       |
  416|       |#ifdef FASTEST
  417|       |    if (level != 0) level = 1;
  418|       |#else
  419|  2.45k|    if (level == Z_DEFAULT_COMPRESSION) level = 6;
  ------------------
  |  |  197|  2.45k|#define Z_DEFAULT_COMPRESSION  (-1)
  ------------------
  |  Branch (419:9): [True: 2.45k, False: 0]
  ------------------
  420|  2.45k|#endif
  421|       |
  422|  2.45k|    if (windowBits < 0) { /* suppress zlib wrapper */
  ------------------
  |  Branch (422:9): [True: 0, False: 2.45k]
  ------------------
  423|      0|        wrap = 0;
  424|      0|        if (windowBits < -15)
  ------------------
  |  Branch (424:13): [True: 0, False: 0]
  ------------------
  425|      0|            return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  426|      0|        windowBits = -windowBits;
  427|      0|    }
  428|  2.45k|#ifdef GZIP
  429|  2.45k|    else if (windowBits > 15) {
  ------------------
  |  Branch (429:14): [True: 0, False: 2.45k]
  ------------------
  430|      0|        wrap = 2;       /* write gzip wrapper instead */
  431|      0|        windowBits -= 16;
  432|      0|    }
  433|  2.45k|#endif
  434|  2.45k|    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  277|  4.91k|#    define MAX_MEM_LEVEL 9
  ------------------
                  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  213|  4.91k|#define Z_DEFLATED   8
  ------------------
  |  Branch (434:9): [True: 0, False: 2.45k]
  |  Branch (434:25): [True: 0, False: 2.45k]
  |  Branch (434:53): [True: 0, False: 2.45k]
  ------------------
  435|  2.45k|        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
  ------------------
  |  Branch (435:9): [True: 0, False: 2.45k]
  |  Branch (435:27): [True: 0, False: 2.45k]
  |  Branch (435:46): [True: 0, False: 2.45k]
  |  Branch (435:59): [True: 0, False: 2.45k]
  ------------------
  436|  2.45k|        strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) {
  ------------------
  |  |  203|  4.91k|#define Z_FIXED               4
  ------------------
  |  Branch (436:9): [True: 0, False: 2.45k]
  |  Branch (436:25): [True: 0, False: 2.45k]
  |  Branch (436:48): [True: 0, False: 2.45k]
  |  Branch (436:67): [True: 0, False: 0]
  ------------------
  437|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  438|      0|    }
  439|  2.45k|    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
  ------------------
  |  Branch (439:9): [True: 0, False: 2.45k]
  ------------------
  440|  2.45k|    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
  ------------------
  |  |  253|  2.45k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  441|  2.45k|    if (s == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  216|  2.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  |  Branch (441:9): [True: 0, False: 2.45k]
  ------------------
  442|  2.45k|    zmemzero(s, sizeof(deflate_state));
  ------------------
  |  |  218|  2.45k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  443|  2.45k|    strm->state = (struct internal_state FAR *)s;
  444|  2.45k|    s->strm = strm;
  445|  2.45k|    s->status = INIT_STATE;     /* to pass state test in deflateReset() */
  ------------------
  |  |   58|  2.45k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  446|       |
  447|  2.45k|    s->wrap = wrap;
  448|  2.45k|    s->w_bits = (uInt)windowBits;
  449|  2.45k|    s->w_size = 1 << s->w_bits;
  450|  2.45k|    s->w_mask = s->w_size - 1;
  451|       |
  452|  2.45k|    s->hash_bits = (uInt)memLevel + 7;
  453|  2.45k|    s->hash_size = 1 << s->hash_bits;
  454|  2.45k|    s->hash_mask = s->hash_size - 1;
  455|  2.45k|    s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   92|  2.45k|#define MIN_MATCH  3
  ------------------
                  s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   92|  2.45k|#define MIN_MATCH  3
  ------------------
  456|       |
  457|  2.45k|    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
  ------------------
  |  |  253|  2.45k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  458|  2.45k|    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
  ------------------
  |  |  253|  2.45k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  459|  2.45k|    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
  ------------------
  |  |  253|  2.45k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  460|       |
  461|  2.45k|    s->high_water = 0;      /* nothing written to s->window yet */
  462|       |
  463|  2.45k|    s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
  464|       |
  465|       |    /* We overlay pending_buf and sym_buf. This works since the average size
  466|       |     * for length/distance pairs over any compressed block is assured to be 31
  467|       |     * bits or less.
  468|       |     *
  469|       |     * Analysis: The longest fixed codes are a length code of 8 bits plus 5
  470|       |     * extra bits, for lengths 131 to 257. The longest fixed distance codes are
  471|       |     * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest
  472|       |     * possible fixed-codes length/distance pair is then 31 bits total.
  473|       |     *
  474|       |     * sym_buf starts one-fourth of the way into pending_buf. So there are
  475|       |     * three bytes in sym_buf for every four bytes in pending_buf. Each symbol
  476|       |     * in sym_buf is three bytes -- two for the distance and one for the
  477|       |     * literal/length. As each symbol is consumed, the pointer to the next
  478|       |     * sym_buf value to read moves forward three bytes. From that symbol, up to
  479|       |     * 31 bits are written to pending_buf. The closest the written pending_buf
  480|       |     * bits gets to the next sym_buf symbol to read is just before the last
  481|       |     * code is written. At that time, 31*(n - 2) bits have been written, just
  482|       |     * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at
  483|       |     * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1
  484|       |     * symbols are written.) The closest the writing gets to what is unread is
  485|       |     * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and
  486|       |     * can range from 128 to 32768.
  487|       |     *
  488|       |     * Therefore, at a minimum, there are 142 bits of space between what is
  489|       |     * written and what is read in the overlain buffers, so the symbols cannot
  490|       |     * be overwritten by the compressed data. That space is actually 139 bits,
  491|       |     * due to the three-bit fixed-code block header.
  492|       |     *
  493|       |     * That covers the case where either Z_FIXED is specified, forcing fixed
  494|       |     * codes, or when the use of fixed codes is chosen, because that choice
  495|       |     * results in a smaller compressed block than dynamic codes. That latter
  496|       |     * condition then assures that the above analysis also covers all dynamic
  497|       |     * blocks. A dynamic-code block will only be chosen to be emitted if it has
  498|       |     * fewer bits than a fixed-code block would for the same set of symbols.
  499|       |     * Therefore its average symbol length is assured to be less than 31. So
  500|       |     * the compressed data for a dynamic block also cannot overwrite the
  501|       |     * symbols from which it is being constructed.
  502|       |     */
  503|       |
  504|  2.45k|    s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS);
  ------------------
  |  |  253|  2.45k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  505|  2.45k|    s->pending_buf_size = (ulg)s->lit_bufsize * 4;
  506|       |
  507|  2.45k|    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  4.91k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  4.91k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  216|  4.91k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (507:9): [True: 0, False: 2.45k]
  |  Branch (507:32): [True: 0, False: 2.45k]
  |  Branch (507:53): [True: 0, False: 2.45k]
  ------------------
  508|  2.45k|        s->pending_buf == Z_NULL) {
  ------------------
  |  |  216|  2.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (508:9): [True: 0, False: 2.45k]
  ------------------
  509|      0|        s->status = FINISH_STATE;
  ------------------
  |  |   67|      0|#define FINISH_STATE 666    /* stream complete */
  ------------------
  510|      0|        strm->msg = ERR_MSG(Z_MEM_ERROR);
  ------------------
  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  ------------------
  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  ------------------
  ------------------
  511|      0|        deflateEnd (strm);
  512|      0|        return Z_MEM_ERROR;
  ------------------
  |  |  187|      0|#define Z_MEM_ERROR    (-4)
  ------------------
  513|      0|    }
  514|       |#ifdef LIT_MEM
  515|       |    s->d_buf = (ushf *)(s->pending_buf + (s->lit_bufsize << 1));
  516|       |    s->l_buf = s->pending_buf + (s->lit_bufsize << 2);
  517|       |    s->sym_end = s->lit_bufsize - 1;
  518|       |#else
  519|  2.45k|    s->sym_buf = s->pending_buf + s->lit_bufsize;
  520|  2.45k|    s->sym_end = (s->lit_bufsize - 1) * 3;
  521|  2.45k|#endif
  522|       |    /* We avoid equality with lit_bufsize*3 because of wraparound at 64K
  523|       |     * on 16 bit machines and because stored blocks are restricted to
  524|       |     * 64K-1 bytes.
  525|       |     */
  526|       |
  527|  2.45k|    s->level = level;
  528|  2.45k|    s->strategy = strategy;
  529|  2.45k|    s->method = (Byte)method;
  530|       |
  531|  2.45k|    return deflateReset(strm);
  532|  2.45k|}
deflateResetKeep:
  644|  2.45k|int ZEXPORT deflateResetKeep(z_streamp strm) {
  645|  2.45k|    deflate_state *s;
  646|       |
  647|  2.45k|    if (deflateStateCheck(strm)) {
  ------------------
  |  Branch (647:9): [True: 0, False: 2.45k]
  ------------------
  648|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  649|      0|    }
  650|       |
  651|  2.45k|    strm->total_in = strm->total_out = 0;
  652|  2.45k|    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
  ------------------
  |  |  216|  2.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  653|  2.45k|    strm->data_type = Z_UNKNOWN;
  ------------------
  |  |  210|  2.45k|#define Z_UNKNOWN  2
  ------------------
  654|       |
  655|  2.45k|    s = (deflate_state *)strm->state;
  656|  2.45k|    s->pending = 0;
  657|  2.45k|    s->pending_out = s->pending_buf;
  658|       |
  659|  2.45k|    if (s->wrap < 0) {
  ------------------
  |  Branch (659:9): [True: 0, False: 2.45k]
  ------------------
  660|      0|        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
  661|      0|    }
  662|  2.45k|    s->status =
  663|  2.45k|#ifdef GZIP
  664|  2.45k|        s->wrap == 2 ? GZIP_STATE :
  ------------------
  |  |   60|      0|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (664:9): [True: 0, False: 2.45k]
  ------------------
  665|  2.45k|#endif
  666|  2.45k|        INIT_STATE;
  ------------------
  |  |   58|  4.91k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  667|  2.45k|    strm->adler =
  668|  2.45k|#ifdef GZIP
  669|  2.45k|        s->wrap == 2 ? crc32(0L, Z_NULL, 0) :
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (669:9): [True: 0, False: 2.45k]
  ------------------
  670|  2.45k|#endif
  671|  2.45k|        adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  2.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  672|  2.45k|    s->last_flush = -2;
  673|       |
  674|  2.45k|    s->gzhead = Z_NULL;
  ------------------
  |  |  216|  2.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  675|       |
  676|  2.45k|    {
  677|       |        /* Retain the hash work done for level 0. */
  678|  2.45k|        uInt matches = s->level == 0 ? s->matches : 0;
  ------------------
  |  Branch (678:24): [True: 0, False: 2.45k]
  ------------------
  679|  2.45k|        _tr_init(s);
  680|  2.45k|        s->matches = matches;
  681|  2.45k|    }
  682|       |
  683|       |    /* Keep the window and the hash, but drop what was left unfinished */
  684|  2.45k|    s->block_start = (long)s->strstart;
  685|  2.45k|    s->lookahead = 0;
  686|  2.45k|    s->match_length = s->prev_length = MIN_MATCH-1;
  ------------------
  |  |   92|  2.45k|#define MIN_MATCH  3
  ------------------
  687|  2.45k|    s->match_available = 0;
  688|       |
  689|  2.45k|    return Z_OK;
  ------------------
  |  |  181|  2.45k|#define Z_OK            0
  ------------------
  690|  2.45k|}
deflateReset:
  718|  2.45k|int ZEXPORT deflateReset(z_streamp strm) {
  719|  2.45k|    int ret;
  720|       |
  721|  2.45k|    ret = deflateResetKeep(strm);
  722|  2.45k|    if (ret == Z_OK)
  ------------------
  |  |  181|  2.45k|#define Z_OK            0
  ------------------
  |  Branch (722:9): [True: 2.45k, False: 0]
  ------------------
  723|  2.45k|        lm_init(strm->state);
  724|  2.45k|    return ret;
  725|  2.45k|}
deflate:
 1000|   221M|int ZEXPORT deflate(z_streamp strm, int flush) {
 1001|   221M|    int old_flush; /* value of flush param for previous deflate call */
 1002|   221M|    deflate_state *s;
 1003|       |
 1004|   221M|    if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {
  ------------------
  |  |  177|   443M|#define Z_BLOCK         5
  ------------------
  |  Branch (1004:9): [True: 0, False: 221M]
  |  Branch (1004:36): [True: 0, False: 221M]
  |  Branch (1004:55): [True: 0, False: 221M]
  ------------------
 1005|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
 1006|      0|    }
 1007|   221M|    s = strm->state;
 1008|       |
 1009|   221M|    if (strm->next_out == Z_NULL ||
  ------------------
  |  |  216|   443M|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1009:9): [True: 0, False: 221M]
  ------------------
 1010|   221M|        (strm->avail_in != 0 && strm->next_in == Z_NULL) ||
  ------------------
  |  |  216|   212M|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1010:10): [True: 212M, False: 9.50M]
  |  Branch (1010:33): [True: 0, False: 212M]
  ------------------
 1011|   221M|        (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |   67|   443M|#define FINISH_STATE 666    /* stream complete */
  ------------------
                      (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |  176|  3.92M|#define Z_FINISH        4
  ------------------
  |  Branch (1011:10): [True: 3.92M, False: 217M]
  |  Branch (1011:39): [True: 0, False: 3.92M]
  ------------------
 1012|      0|        ERR_RETURN(strm, Z_STREAM_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1013|      0|    }
 1014|   221M|    if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1014:9): [True: 0, False: 221M]
  ------------------
 1015|       |
 1016|   221M|    old_flush = s->last_flush;
 1017|   221M|    s->last_flush = flush;
 1018|       |
 1019|       |    /* Flush as much pending output as possible */
 1020|   221M|    if (s->pending != 0) {
  ------------------
  |  Branch (1020:9): [True: 84.8M, False: 136M]
  ------------------
 1021|  84.8M|        flush_pending(strm);
 1022|  84.8M|        if (strm->avail_out == 0) {
  ------------------
  |  Branch (1022:13): [True: 84.8M, False: 0]
  ------------------
 1023|       |            /* Since avail_out is 0, deflate will be called again with
 1024|       |             * more output space, but possibly with both pending and
 1025|       |             * avail_in equal to zero. There won't be anything to do,
 1026|       |             * but this is not an error situation so make sure we
 1027|       |             * return OK instead of BUF_ERROR at next call of deflate:
 1028|       |             */
 1029|  84.8M|            s->last_flush = -1;
 1030|  84.8M|            return Z_OK;
  ------------------
  |  |  181|  84.8M|#define Z_OK            0
  ------------------
 1031|  84.8M|        }
 1032|       |
 1033|       |    /* Make sure there is something to do and avoid duplicate consecutive
 1034|       |     * flushes. For repeated and useless calls with Z_FINISH, we keep
 1035|       |     * returning Z_STREAM_END instead of Z_BUF_ERROR.
 1036|       |     */
 1037|   136M|    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  7.74k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 7.74k]
  |  |  ------------------
  ------------------
                  } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|   136M|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 7.74k]
  |  |  ------------------
  ------------------
  |  Branch (1037:16): [True: 7.74k, False: 136M]
  |  Branch (1037:39): [True: 0, False: 7.74k]
  ------------------
 1038|      0|               flush != Z_FINISH) {
  ------------------
  |  |  176|      0|#define Z_FINISH        4
  ------------------
  |  Branch (1038:16): [True: 0, False: 0]
  ------------------
 1039|      0|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1040|      0|    }
 1041|       |
 1042|       |    /* User must not provide more input after the first FINISH: */
 1043|   136M|    if (s->status == FINISH_STATE && strm->avail_in != 0) {
  ------------------
  |  |   67|   273M|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (1043:9): [True: 4.91k, False: 136M]
  |  Branch (1043:38): [True: 0, False: 4.91k]
  ------------------
 1044|      0|        ERR_RETURN(strm, Z_BUF_ERROR);
  ------------------
  |  |   68|      0|  return (strm->msg = ERR_MSG(err), (err))
  |  |  ------------------
  |  |  |  |   65|      0|#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (65:31): [Folded, False: 0]
  |  |  |  |  |  Branch (65:45): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1045|      0|    }
 1046|       |
 1047|       |    /* Write the header */
 1048|   136M|    if (s->status == INIT_STATE && s->wrap == 0)
  ------------------
  |  |   58|   273M|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1048:9): [True: 2.45k, False: 136M]
  |  Branch (1048:36): [True: 0, False: 2.45k]
  ------------------
 1049|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1050|   136M|    if (s->status == INIT_STATE) {
  ------------------
  |  |   58|   136M|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1050:9): [True: 2.45k, False: 136M]
  ------------------
 1051|       |        /* zlib header */
 1052|  2.45k|        uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
  ------------------
  |  |  213|  2.45k|#define Z_DEFLATED   8
  ------------------
 1053|  2.45k|        uInt level_flags;
 1054|       |
 1055|  2.45k|        if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
  ------------------
  |  |  201|  4.91k|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1055:13): [True: 0, False: 2.45k]
  |  Branch (1055:46): [True: 0, False: 2.45k]
  ------------------
 1056|      0|            level_flags = 0;
 1057|  2.45k|        else if (s->level < 6)
  ------------------
  |  Branch (1057:18): [True: 0, False: 2.45k]
  ------------------
 1058|      0|            level_flags = 1;
 1059|  2.45k|        else if (s->level == 6)
  ------------------
  |  Branch (1059:18): [True: 2.45k, False: 0]
  ------------------
 1060|  2.45k|            level_flags = 2;
 1061|      0|        else
 1062|      0|            level_flags = 3;
 1063|  2.45k|        header |= (level_flags << 6);
 1064|  2.45k|        if (s->strstart != 0) header |= PRESET_DICT;
  ------------------
  |  |   96|      0|#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
  ------------------
  |  Branch (1064:13): [True: 0, False: 2.45k]
  ------------------
 1065|  2.45k|        header += 31 - (header % 31);
 1066|       |
 1067|  2.45k|        putShortMSB(s, header);
 1068|       |
 1069|       |        /* Save the adler32 of the preset dictionary: */
 1070|  2.45k|        if (s->strstart != 0) {
  ------------------
  |  Branch (1070:13): [True: 0, False: 2.45k]
  ------------------
 1071|      0|            putShortMSB(s, (uInt)(strm->adler >> 16));
 1072|      0|            putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1073|      0|        }
 1074|  2.45k|        strm->adler = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  216|  2.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1075|  2.45k|        s->status = BUSY_STATE;
  ------------------
  |  |   66|  2.45k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1076|       |
 1077|       |        /* Compression must start with an empty pending buffer */
 1078|  2.45k|        flush_pending(strm);
 1079|  2.45k|        if (s->pending != 0) {
  ------------------
  |  Branch (1079:13): [True: 2.45k, False: 0]
  ------------------
 1080|  2.45k|            s->last_flush = -1;
 1081|  2.45k|            return Z_OK;
  ------------------
  |  |  181|  2.45k|#define Z_OK            0
  ------------------
 1082|  2.45k|        }
 1083|  2.45k|    }
 1084|   136M|#ifdef GZIP
 1085|   136M|    if (s->status == GZIP_STATE) {
  ------------------
  |  |   60|   136M|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (1085:9): [True: 0, False: 136M]
  ------------------
 1086|       |        /* gzip header */
 1087|      0|        strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1088|      0|        put_byte(s, 31);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1089|      0|        put_byte(s, 139);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1090|      0|        put_byte(s, 8);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1091|      0|        if (s->gzhead == Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1091:13): [True: 0, False: 0]
  ------------------
 1092|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1093|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1094|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1095|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1096|      0|            put_byte(s, 0);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1097|      0|            put_byte(s, s->level == 9 ? 2 :
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1098|      0|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1099|      0|                      4 : 0));
 1100|      0|            put_byte(s, OS_CODE);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1101|      0|            s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1102|       |
 1103|       |            /* Compression must start with an empty pending buffer */
 1104|      0|            flush_pending(strm);
 1105|      0|            if (s->pending != 0) {
  ------------------
  |  Branch (1105:17): [True: 0, False: 0]
  ------------------
 1106|      0|                s->last_flush = -1;
 1107|      0|                return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1108|      0|            }
 1109|      0|        }
 1110|      0|        else {
 1111|      0|            put_byte(s, (s->gzhead->text ? 1 : 0) +
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1112|      0|                     (s->gzhead->hcrc ? 2 : 0) +
 1113|      0|                     (s->gzhead->extra == Z_NULL ? 0 : 4) +
 1114|      0|                     (s->gzhead->name == Z_NULL ? 0 : 8) +
 1115|      0|                     (s->gzhead->comment == Z_NULL ? 0 : 16)
 1116|      0|                     );
 1117|      0|            put_byte(s, (Byte)(s->gzhead->time & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1118|      0|            put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1119|      0|            put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1120|      0|            put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1121|      0|            put_byte(s, s->level == 9 ? 2 :
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  |  Branch (293:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1122|      0|                     (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ?
 1123|      0|                      4 : 0));
 1124|      0|            put_byte(s, s->gzhead->os & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1125|      0|            if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1125:17): [True: 0, False: 0]
  ------------------
 1126|      0|                put_byte(s, s->gzhead->extra_len & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1127|      0|                put_byte(s, (s->gzhead->extra_len >> 8) & 0xff);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1128|      0|            }
 1129|      0|            if (s->gzhead->hcrc)
  ------------------
  |  Branch (1129:17): [True: 0, False: 0]
  ------------------
 1130|      0|                strm->adler = crc32_z(strm->adler, s->pending_buf,
 1131|      0|                                      s->pending);
 1132|      0|            s->gzindex = 0;
 1133|      0|            s->status = EXTRA_STATE;
  ------------------
  |  |   62|      0|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
 1134|      0|        }
 1135|      0|    }
 1136|   136M|    if (s->status == EXTRA_STATE) {
  ------------------
  |  |   62|   136M|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (1136:9): [True: 0, False: 136M]
  ------------------
 1137|      0|        if (s->gzhead->extra != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1137:13): [True: 0, False: 0]
  ------------------
 1138|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1139|      0|            ulg left = (s->gzhead->extra_len & 0xffff) - s->gzindex;
 1140|      0|            while (s->pending + left > s->pending_buf_size) {
  ------------------
  |  Branch (1140:20): [True: 0, False: 0]
  ------------------
 1141|      0|                ulg copy = s->pending_buf_size - s->pending;
 1142|      0|                zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  216|      0|#    define zmemcpy memcpy
  ------------------
 1143|      0|                        s->gzhead->extra + s->gzindex, copy);
 1144|      0|                s->pending = s->pending_buf_size;
 1145|      0|                HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1146|      0|                s->gzindex += copy;
 1147|      0|                flush_pending(strm);
 1148|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1148:21): [True: 0, False: 0]
  ------------------
 1149|      0|                    s->last_flush = -1;
 1150|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1151|      0|                }
 1152|      0|                beg = 0;
 1153|      0|                left -= copy;
 1154|      0|            }
 1155|      0|            zmemcpy(s->pending_buf + s->pending,
  ------------------
  |  |  216|      0|#    define zmemcpy memcpy
  ------------------
 1156|      0|                    s->gzhead->extra + s->gzindex, left);
 1157|      0|            s->pending += left;
 1158|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1159|      0|            s->gzindex = 0;
 1160|      0|        }
 1161|      0|        s->status = NAME_STATE;
  ------------------
  |  |   63|      0|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
 1162|      0|    }
 1163|   136M|    if (s->status == NAME_STATE) {
  ------------------
  |  |   63|   136M|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (1163:9): [True: 0, False: 136M]
  ------------------
 1164|      0|        if (s->gzhead->name != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1164:13): [True: 0, False: 0]
  ------------------
 1165|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1166|      0|            int val;
 1167|      0|            do {
 1168|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1168:21): [True: 0, False: 0]
  ------------------
 1169|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1170|      0|                    flush_pending(strm);
 1171|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1171:25): [True: 0, False: 0]
  ------------------
 1172|      0|                        s->last_flush = -1;
 1173|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1174|      0|                    }
 1175|      0|                    beg = 0;
 1176|      0|                }
 1177|      0|                val = s->gzhead->name[s->gzindex++];
 1178|      0|                put_byte(s, val);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1179|      0|            } while (val != 0);
  ------------------
  |  Branch (1179:22): [True: 0, False: 0]
  ------------------
 1180|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1181|      0|            s->gzindex = 0;
 1182|      0|        }
 1183|      0|        s->status = COMMENT_STATE;
  ------------------
  |  |   64|      0|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
 1184|      0|    }
 1185|   136M|    if (s->status == COMMENT_STATE) {
  ------------------
  |  |   64|   136M|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (1185:9): [True: 0, False: 136M]
  ------------------
 1186|      0|        if (s->gzhead->comment != Z_NULL) {
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (1186:13): [True: 0, False: 0]
  ------------------
 1187|      0|            ulg beg = s->pending;   /* start of bytes to update crc */
 1188|      0|            int val;
 1189|      0|            do {
 1190|      0|                if (s->pending == s->pending_buf_size) {
  ------------------
  |  Branch (1190:21): [True: 0, False: 0]
  ------------------
 1191|      0|                    HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1192|      0|                    flush_pending(strm);
 1193|      0|                    if (s->pending != 0) {
  ------------------
  |  Branch (1193:25): [True: 0, False: 0]
  ------------------
 1194|      0|                        s->last_flush = -1;
 1195|      0|                        return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1196|      0|                    }
 1197|      0|                    beg = 0;
 1198|      0|                }
 1199|      0|                val = s->gzhead->comment[s->gzindex++];
 1200|      0|                put_byte(s, val);
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1201|      0|            } while (val != 0);
  ------------------
  |  Branch (1201:22): [True: 0, False: 0]
  ------------------
 1202|      0|            HCRC_UPDATE(beg);
  ------------------
  |  |  993|      0|    do { \
  |  |  994|      0|        if (s->gzhead->hcrc && s->pending > (beg)) \
  |  |  ------------------
  |  |  |  Branch (994:13): [True: 0, False: 0]
  |  |  |  Branch (994:32): [True: 0, False: 0]
  |  |  ------------------
  |  |  995|      0|            strm->adler = crc32_z(strm->adler, s->pending_buf + (beg), \
  |  |  996|      0|                                  s->pending - (beg)); \
  |  |  997|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (997:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1203|      0|        }
 1204|      0|        s->status = HCRC_STATE;
  ------------------
  |  |   65|      0|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
 1205|      0|    }
 1206|   136M|    if (s->status == HCRC_STATE) {
  ------------------
  |  |   65|   136M|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (1206:9): [True: 0, False: 136M]
  ------------------
 1207|      0|        if (s->gzhead->hcrc) {
  ------------------
  |  Branch (1207:13): [True: 0, False: 0]
  ------------------
 1208|      0|            if (s->pending + 2 > s->pending_buf_size) {
  ------------------
  |  Branch (1208:17): [True: 0, False: 0]
  ------------------
 1209|      0|                flush_pending(strm);
 1210|      0|                if (s->pending != 0) {
  ------------------
  |  Branch (1210:21): [True: 0, False: 0]
  ------------------
 1211|      0|                    s->last_flush = -1;
 1212|      0|                    return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1213|      0|                }
 1214|      0|            }
 1215|      0|            put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1216|      0|            put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1217|      0|            strm->adler = crc32(0L, Z_NULL, 0);
  ------------------
  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1218|      0|        }
 1219|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1220|       |
 1221|       |        /* Compression must start with an empty pending buffer */
 1222|      0|        flush_pending(strm);
 1223|      0|        if (s->pending != 0) {
  ------------------
  |  Branch (1223:13): [True: 0, False: 0]
  ------------------
 1224|      0|            s->last_flush = -1;
 1225|      0|            return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1226|      0|        }
 1227|      0|    }
 1228|   136M|#endif
 1229|       |
 1230|       |    /* Start a new block or continue the current one.
 1231|       |     */
 1232|   136M|    if (strm->avail_in != 0 || s->lookahead != 0 ||
  ------------------
  |  Branch (1232:9): [True: 136M, False: 7.74k]
  |  Branch (1232:32): [True: 2.69k, False: 5.04k]
  ------------------
 1233|   136M|        (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |  172|  10.0k|#define Z_NO_FLUSH      0
  ------------------
                      (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) {
  ------------------
  |  |   67|  5.04k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (1233:10): [True: 5.04k, False: 0]
  |  Branch (1233:33): [True: 136, False: 4.91k]
  ------------------
 1234|   136M|        block_state bstate;
 1235|       |
 1236|   136M|        bstate = s->level == 0 ? deflate_stored(s, flush) :
  ------------------
  |  Branch (1236:18): [True: 0, False: 136M]
  ------------------
 1237|   136M|                 s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
  ------------------
  |  |  201|   136M|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1237:18): [True: 0, False: 136M]
  ------------------
 1238|   136M|                 s->strategy == Z_RLE ? deflate_rle(s, flush) :
  ------------------
  |  |  202|   136M|#define Z_RLE                 3
  ------------------
  |  Branch (1238:18): [True: 0, False: 136M]
  ------------------
 1239|   136M|                 (*(configuration_table[s->level].func))(s, flush);
 1240|       |
 1241|   136M|        if (bstate == finish_started || bstate == finish_done) {
  ------------------
  |  Branch (1241:13): [True: 2.45k, False: 136M]
  |  Branch (1241:41): [True: 0, False: 136M]
  ------------------
 1242|  2.45k|            s->status = FINISH_STATE;
  ------------------
  |  |   67|  2.45k|#define FINISH_STATE 666    /* stream complete */
  ------------------
 1243|  2.45k|        }
 1244|   136M|        if (bstate == need_more || bstate == finish_started) {
  ------------------
  |  Branch (1244:13): [True: 136M, False: 2.45k]
  |  Branch (1244:36): [True: 2.45k, False: 0]
  ------------------
 1245|   136M|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1245:17): [True: 8.24k, False: 136M]
  ------------------
 1246|  8.24k|                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
 1247|  8.24k|            }
 1248|   136M|            return Z_OK;
  ------------------
  |  |  181|   136M|#define Z_OK            0
  ------------------
 1249|       |            /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
 1250|       |             * of deflate should use the same flush parameter to make sure
 1251|       |             * that the flush is complete. So we don't have to output an
 1252|       |             * empty block here, this will be done at next call. This also
 1253|       |             * ensures that for a very small output buffer, we emit at most
 1254|       |             * one empty block.
 1255|       |             */
 1256|   136M|        }
 1257|      0|        if (bstate == block_done) {
  ------------------
  |  Branch (1257:13): [True: 0, False: 0]
  ------------------
 1258|      0|            if (flush == Z_PARTIAL_FLUSH) {
  ------------------
  |  |  173|      0|#define Z_PARTIAL_FLUSH 1
  ------------------
  |  Branch (1258:17): [True: 0, False: 0]
  ------------------
 1259|      0|                _tr_align(s);
 1260|      0|            } else if (flush != Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
  ------------------
  |  |  177|      0|#define Z_BLOCK         5
  ------------------
  |  Branch (1260:24): [True: 0, False: 0]
  ------------------
 1261|      0|                _tr_stored_block(s, (char*)0, 0L, 0);
 1262|       |                /* For a full flush, this empty block will be recognized
 1263|       |                 * as a special marker by inflate_sync().
 1264|       |                 */
 1265|      0|                if (flush == Z_FULL_FLUSH) {
  ------------------
  |  |  175|      0|#define Z_FULL_FLUSH    3
  ------------------
  |  Branch (1265:21): [True: 0, False: 0]
  ------------------
 1266|      0|                    CLEAR_HASH(s);             /* forget history */
  ------------------
  |  |  171|      0|    do { \
  |  |  172|      0|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|      0|#define NIL 0
  |  |  ------------------
  |  |  173|      0|        zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  ------------------
  |  |  |  |  218|      0|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|      0|        s->slid = 0; \
  |  |  175|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1267|      0|                    if (s->lookahead == 0) {
  ------------------
  |  Branch (1267:25): [True: 0, False: 0]
  ------------------
 1268|      0|                        s->strstart = 0;
 1269|      0|                        s->block_start = 0L;
 1270|      0|                        s->insert = 0;
 1271|      0|                    }
 1272|      0|                }
 1273|      0|            }
 1274|      0|            flush_pending(strm);
 1275|      0|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1275:17): [True: 0, False: 0]
  ------------------
 1276|      0|              s->last_flush = -1; /* avoid BUF_ERROR at next call, see above */
 1277|      0|              return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
 1278|      0|            }
 1279|      0|        }
 1280|      0|    }
 1281|       |
 1282|  4.91k|    if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  176|  4.91k|#define Z_FINISH        4
  ------------------
                  if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  181|      0|#define Z_OK            0
  ------------------
  |  Branch (1282:9): [True: 0, False: 4.91k]
  ------------------
 1283|  4.91k|    if (s->wrap <= 0) return Z_STREAM_END;
  ------------------
  |  |  182|  2.45k|#define Z_STREAM_END    1
  ------------------
  |  Branch (1283:9): [True: 2.45k, False: 2.45k]
  ------------------
 1284|       |
 1285|       |    /* Write the trailer */
 1286|  2.45k|#ifdef GZIP
 1287|  2.45k|    if (s->wrap == 2) {
  ------------------
  |  Branch (1287:9): [True: 0, False: 2.45k]
  ------------------
 1288|      0|        put_byte(s, (Byte)(strm->adler & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1289|      0|        put_byte(s, (Byte)((strm->adler >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1290|      0|        put_byte(s, (Byte)((strm->adler >> 16) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1291|      0|        put_byte(s, (Byte)((strm->adler >> 24) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1292|      0|        put_byte(s, (Byte)(strm->total_in & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1293|      0|        put_byte(s, (Byte)((strm->total_in >> 8) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1294|      0|        put_byte(s, (Byte)((strm->total_in >> 16) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1295|      0|        put_byte(s, (Byte)((strm->total_in >> 24) & 0xff));
  ------------------
  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
 1296|      0|    }
 1297|  2.45k|    else
 1298|  2.45k|#endif
 1299|  2.45k|    {
 1300|  2.45k|        putShortMSB(s, (uInt)(strm->adler >> 16));
 1301|  2.45k|        putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1302|  2.45k|    }
 1303|  2.45k|    flush_pending(strm);
 1304|       |    /* If avail_out is zero, the application will call deflate again
 1305|       |     * to flush the rest.
 1306|       |     */
 1307|  2.45k|    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
  ------------------
  |  Branch (1307:9): [True: 2.45k, False: 0]
  ------------------
 1308|  2.45k|    return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  181|  2.45k|#define Z_OK            0
  ------------------
                  return s->pending != 0 ? Z_OK : Z_STREAM_END;
  ------------------
  |  |  182|      0|#define Z_STREAM_END    1
  ------------------
  |  Branch (1308:12): [True: 2.45k, False: 0]
  ------------------
 1309|  4.91k|}
deflateEnd:
 1312|  2.45k|int ZEXPORT deflateEnd(z_streamp strm) {
 1313|  2.45k|    int status;
 1314|       |
 1315|  2.45k|    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  185|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (1315:9): [True: 0, False: 2.45k]
  ------------------
 1316|       |
 1317|  2.45k|    status = strm->state->status;
 1318|       |
 1319|       |    /* Deallocate in reverse order of allocations: */
 1320|  2.45k|    TRY_FREE(strm, strm->state->pending_buf);
  ------------------
  |  |  255|  2.45k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  2.45k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 2.45k, False: 0]
  |  |  ------------------
  ------------------
 1321|  2.45k|    TRY_FREE(strm, strm->state->head);
  ------------------
  |  |  255|  2.45k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  2.45k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 2.45k, False: 0]
  |  |  ------------------
  ------------------
 1322|  2.45k|    TRY_FREE(strm, strm->state->prev);
  ------------------
  |  |  255|  2.45k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  2.45k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 2.45k, False: 0]
  |  |  ------------------
  ------------------
 1323|  2.45k|    TRY_FREE(strm, strm->state->window);
  ------------------
  |  |  255|  2.45k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  254|  2.45k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (255:29): [True: 2.45k, False: 0]
  |  |  ------------------
  ------------------
 1324|       |
 1325|  2.45k|    ZFREE(strm, strm->state);
  ------------------
  |  |  254|  2.45k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1326|  2.45k|    strm->state = Z_NULL;
  ------------------
  |  |  216|  2.45k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1327|       |
 1328|  2.45k|    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
  ------------------
  |  |   66|  2.45k|#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|  2.45k|#define Z_OK            0
  ------------------
  |  Branch (1328:12): [True: 0, False: 2.45k]
  ------------------
 1329|  2.45k|}
deflate.c:deflateStateCheck:
  537|   221M|local int deflateStateCheck(z_streamp strm) {
  538|   221M|    deflate_state *s;
  539|   221M|    if (strm == Z_NULL ||
  ------------------
  |  |  216|   443M|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (539:9): [True: 0, False: 221M]
  ------------------
  540|   221M|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (540:9): [True: 0, False: 221M]
  |  Branch (540:42): [True: 0, False: 221M]
  ------------------
  541|      0|        return 1;
  542|   221M|    s = strm->state;
  543|   221M|    if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |  216|   443M|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |   58|   443M|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (543:9): [True: 0, False: 221M]
  |  Branch (543:24): [True: 0, False: 221M]
  |  Branch (543:44): [True: 221M, False: 4.91k]
  ------------------
  544|   221M|#ifdef GZIP
  545|   221M|                                           s->status != GZIP_STATE &&
  ------------------
  |  |   60|   443M|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (545:44): [True: 221M, False: 0]
  ------------------
  546|   221M|#endif
  547|   221M|                                           s->status != EXTRA_STATE &&
  ------------------
  |  |   62|   443M|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (547:44): [True: 221M, False: 0]
  ------------------
  548|   221M|                                           s->status != NAME_STATE &&
  ------------------
  |  |   63|   443M|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (548:44): [True: 221M, False: 0]
  ------------------
  549|   221M|                                           s->status != COMMENT_STATE &&
  ------------------
  |  |   64|   443M|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (549:44): [True: 221M, False: 0]
  ------------------
  550|   221M|                                           s->status != HCRC_STATE &&
  ------------------
  |  |   65|   443M|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (550:44): [True: 221M, False: 0]
  ------------------
  551|   221M|                                           s->status != BUSY_STATE &&
  ------------------
  |  |   66|   443M|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
  |  Branch (551:44): [True: 3.92M, False: 217M]
  ------------------
  552|  3.92M|                                           s->status != FINISH_STATE))
  ------------------
  |  |   67|  3.92M|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (552:44): [True: 0, False: 3.92M]
  ------------------
  553|      0|        return 1;
  554|   221M|    return 0;
  555|   221M|}
deflate.c:fill_window:
  252|   237M|local void fill_window(deflate_state *s) {
  253|   237M|    unsigned n;
  254|   237M|    unsigned more;    /* Amount of free space at the end of the window. */
  255|   237M|    uInt wsize = s->w_size;
  256|       |
  257|   237M|    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
  258|       |
  259|   237M|    do {
  260|   237M|        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
  261|       |
  262|       |        /* Deal with !@#$% 64K limit: */
  263|       |#ifdef _MSC_VER
  264|       |#pragma warning(push)
  265|       |#pragma warning(disable: 4127)
  266|       |#endif
  267|   237M|        if (sizeof(int) <= 2) {
  ------------------
  |  Branch (267:13): [Folded, False: 237M]
  ------------------
  268|       |#ifdef _MSC_VER
  269|       |#pragma warning(pop)
  270|       |#endif
  271|      0|            if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
  ------------------
  |  Branch (271:17): [True: 0, False: 0]
  |  Branch (271:30): [True: 0, False: 0]
  |  Branch (271:50): [True: 0, False: 0]
  ------------------
  272|      0|                more = wsize;
  273|       |
  274|      0|            } else if (more == (unsigned)(-1)) {
  ------------------
  |  Branch (274:24): [True: 0, False: 0]
  ------------------
  275|       |                /* Very unlikely, but possible on 16 bit machine if
  276|       |                 * strstart == 0 && lookahead == 1 (input done a byte at time)
  277|       |                 */
  278|      0|                more--;
  279|      0|            }
  280|      0|        }
  281|       |
  282|       |        /* If the window is almost full and there is insufficient lookahead,
  283|       |         * move the upper half to the lower one to make room in the upper half.
  284|       |         */
  285|   237M|        if (s->strstart >= wsize + MAX_DIST(s)) {
  ------------------
  |  |  301|   237M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|   237M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   237M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|   237M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (285:13): [True: 3.29k, False: 237M]
  ------------------
  286|       |
  287|  3.29k|            zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more);
  ------------------
  |  |  216|  3.29k|#    define zmemcpy memcpy
  ------------------
  288|  3.29k|            s->match_start -= wsize;
  289|  3.29k|            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
  290|  3.29k|            s->block_start -= (long) wsize;
  291|  3.29k|            if (s->insert > s->strstart)
  ------------------
  |  Branch (291:17): [True: 0, False: 3.29k]
  ------------------
  292|      0|                s->insert = s->strstart;
  293|  3.29k|            slide_hash(s);
  294|  3.29k|            more += wsize;
  295|  3.29k|        }
  296|   237M|        if (s->strm->avail_in == 0) break;
  ------------------
  |  Branch (296:13): [True: 100M, False: 136M]
  ------------------
  297|       |
  298|       |        /* If there was no sliding:
  299|       |         *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
  300|       |         *    more == window_size - lookahead - strstart
  301|       |         * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
  302|       |         * => more >= window_size - 2*WSIZE + 2
  303|       |         * In the BIG_MEM or MMAP case (not yet supported),
  304|       |         *   window_size == input_size + MIN_LOOKAHEAD  &&
  305|       |         *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
  306|       |         * Otherwise, window_size == 2*WSIZE so more >= 2.
  307|       |         * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
  308|       |         */
  309|   136M|        Assert(more >= 2, "more < 2");
  310|       |
  311|   136M|        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
  312|   136M|        s->lookahead += n;
  313|       |
  314|       |        /* Initialize the hash value now that we have some input: */
  315|   136M|        if (s->lookahead + s->insert >= MIN_MATCH) {
  ------------------
  |  |   92|   136M|#define MIN_MATCH  3
  ------------------
  |  Branch (315:13): [True: 136M, False: 4.88k]
  ------------------
  316|   136M|            uInt str = s->strstart - s->insert;
  317|   136M|            s->ins_h = s->window[str];
  318|   136M|            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
  ------------------
  |  |  141|   136M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  ------------------
  319|       |#if MIN_MATCH != 3
  320|       |            Call UPDATE_HASH() MIN_MATCH-3 more times
  321|       |#endif
  322|   136M|            while (s->insert) {
  ------------------
  |  Branch (322:20): [True: 0, False: 136M]
  ------------------
  323|      0|                UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]);
  ------------------
  |  |  141|      0|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  ------------------
  324|      0|#ifndef FASTEST
  325|      0|                s->prev[str & s->w_mask] = s->head[s->ins_h];
  326|      0|#endif
  327|      0|                s->head[s->ins_h] = (Pos)str;
  328|      0|                str++;
  329|      0|                s->insert--;
  330|      0|                if (s->lookahead + s->insert < MIN_MATCH)
  ------------------
  |  |   92|      0|#define MIN_MATCH  3
  ------------------
  |  Branch (330:21): [True: 0, False: 0]
  ------------------
  331|      0|                    break;
  332|      0|            }
  333|   136M|        }
  334|       |        /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
  335|       |         * but this is not important since only literal bytes will be emitted.
  336|       |         */
  337|       |
  338|   136M|    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
  ------------------
  |  |  296|   273M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|   136M|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|   136M|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (338:14): [True: 36.0M, False: 100M]
  |  Branch (338:46): [True: 0, False: 36.0M]
  ------------------
  339|       |
  340|       |    /* If the WIN_INIT bytes after the end of the current data have never been
  341|       |     * written, then zero those bytes in order to avoid memory check reports of
  342|       |     * the use of uninitialized (or uninitialised as Julian writes) bytes by
  343|       |     * the longest match routines.  Update the high water mark for the next
  344|       |     * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
  345|       |     * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
  346|       |     */
  347|   237M|    if (s->high_water < s->window_size) {
  ------------------
  |  Branch (347:9): [True: 67.7M, False: 169M]
  ------------------
  348|  67.7M|        ulg curr = s->strstart + (ulg)(s->lookahead);
  349|  67.7M|        ulg init;
  350|       |
  351|  67.7M|        if (s->high_water < curr) {
  ------------------
  |  Branch (351:13): [True: 2.45k, False: 67.7M]
  ------------------
  352|       |            /* Previous high water mark below current data -- zero WIN_INIT
  353|       |             * bytes or up to end of window, whichever is less.
  354|       |             */
  355|  2.45k|            init = s->window_size - curr;
  356|  2.45k|            if (init > WIN_INIT)
  ------------------
  |  |  306|  2.45k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|  2.45k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (356:17): [True: 2.45k, False: 0]
  ------------------
  357|  2.45k|                init = WIN_INIT;
  ------------------
  |  |  306|  2.45k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|  2.45k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  358|  2.45k|            zmemzero(s->window + curr, (unsigned)init);
  ------------------
  |  |  218|  2.45k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  359|  2.45k|            s->high_water = curr + init;
  360|  2.45k|        }
  361|  67.7M|        else if (s->high_water < (ulg)curr + WIN_INIT) {
  ------------------
  |  |  306|  67.7M|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|  67.7M|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (361:18): [True: 38.8M, False: 28.9M]
  ------------------
  362|       |            /* High water mark at or above current data, but below current data
  363|       |             * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
  364|       |             * to end of window, whichever is less.
  365|       |             */
  366|  38.8M|            init = (ulg)curr + WIN_INIT - s->high_water;
  ------------------
  |  |  306|  38.8M|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   93|  38.8M|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  367|  38.8M|            if (init > s->window_size - s->high_water)
  ------------------
  |  Branch (367:17): [True: 0, False: 38.8M]
  ------------------
  368|      0|                init = s->window_size - s->high_water;
  369|  38.8M|            zmemzero(s->window + s->high_water, (unsigned)init);
  ------------------
  |  |  218|  38.8M|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  370|  38.8M|            s->high_water += init;
  371|  38.8M|        }
  372|  67.7M|    }
  373|       |
  374|   237M|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
  375|   237M|           "not enough room for search");
  376|   237M|}
deflate.c:read_buf:
  219|   136M|local unsigned read_buf(z_streamp strm, Bytef *buf, unsigned size) {
  220|   136M|    unsigned len = strm->avail_in;
  221|       |
  222|   136M|    if (len > size) len = size;
  ------------------
  |  Branch (222:9): [True: 0, False: 136M]
  ------------------
  223|   136M|    if (len == 0) return 0;
  ------------------
  |  Branch (223:9): [True: 0, False: 136M]
  ------------------
  224|       |
  225|   136M|    strm->avail_in  -= len;
  226|       |
  227|   136M|    zmemcpy(buf, strm->next_in, len);
  ------------------
  |  |  216|   136M|#    define zmemcpy memcpy
  ------------------
  228|   136M|    if (strm->state->wrap == 1) {
  ------------------
  |  Branch (228:9): [True: 136M, False: 0]
  ------------------
  229|   136M|        strm->adler = adler32(strm->adler, buf, len);
  230|   136M|    }
  231|      0|#ifdef GZIP
  232|      0|    else if (strm->state->wrap == 2) {
  ------------------
  |  Branch (232:14): [True: 0, False: 0]
  ------------------
  233|      0|        strm->adler = crc32(strm->adler, buf, len);
  234|      0|    }
  235|   136M|#endif
  236|   136M|    strm->next_in  += len;
  237|   136M|    strm->total_in += len;
  238|       |
  239|   136M|    return len;
  240|   136M|}
deflate.c:lm_init:
  695|  2.45k|local void lm_init(deflate_state *s) {
  696|  2.45k|    s->window_size = (ulg)2L*s->w_size;
  697|       |
  698|  2.45k|    CLEAR_HASH(s);
  ------------------
  |  |  171|  2.45k|    do { \
  |  |  172|  2.45k|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|  2.45k|#define NIL 0
  |  |  ------------------
  |  |  173|  2.45k|        zmemzero(s->head, (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  ------------------
  |  |  |  |  218|  2.45k|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|  2.45k|        s->slid = 0; \
  |  |  175|  2.45k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded, False: 2.45k]
  |  |  ------------------
  ------------------
  699|  2.45k|    s->matches = 0;             /* the hash is clear */
  700|       |
  701|       |    /* Set the default configuration parameters:
  702|       |     */
  703|  2.45k|    s->max_lazy_match   = configuration_table[s->level].max_lazy;
  704|  2.45k|    s->good_match       = configuration_table[s->level].good_length;
  705|  2.45k|    s->nice_match       = configuration_table[s->level].nice_length;
  706|  2.45k|    s->max_chain_length = configuration_table[s->level].max_chain;
  707|       |
  708|  2.45k|    s->strstart = 0;
  709|  2.45k|    s->block_start = 0L;
  710|  2.45k|    s->lookahead = 0;
  711|  2.45k|    s->insert = 0;
  712|  2.45k|    s->match_length = s->prev_length = MIN_MATCH-1;
  ------------------
  |  |   92|  2.45k|#define MIN_MATCH  3
  ------------------
  713|  2.45k|    s->match_available = 0;
  714|  2.45k|    s->ins_h = 0;
  715|  2.45k|}
deflate.c:longest_match:
 1418|  74.7M|local uInt longest_match(deflate_state *s, IPos cur_match) {
 1419|  74.7M|    unsigned chain_length = s->max_chain_length;/* max hash chain length */
 1420|  74.7M|    Bytef *scan = s->window + s->strstart;      /* current string */
 1421|  74.7M|    Bytef *match;                               /* matched string */
 1422|  74.7M|    int len;                                    /* length of current match */
 1423|  74.7M|    int best_len = (int)s->prev_length;         /* best match length so far */
 1424|  74.7M|    int nice_match = s->nice_match;             /* stop if match long enough */
 1425|  74.7M|    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
  ------------------
  |  |  301|  74.7M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  74.7M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  74.7M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  74.7M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1425:18): [True: 64.0M, False: 10.7M]
  ------------------
 1426|  64.0M|        s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |  301|  64.0M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  64.0M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  64.0M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  64.0M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |   85|  10.7M|#define NIL 0
  ------------------
 1427|       |    /* Stop when cur_match becomes <= limit. To simplify the code,
 1428|       |     * we prevent matches with the string of window index 0.
 1429|       |     */
 1430|  74.7M|    Posf *prev = s->prev;
 1431|  74.7M|    uInt wmask = s->w_mask;
 1432|       |
 1433|       |#ifdef UNALIGNED_OK
 1434|       |    /* Compare two bytes at a time. Note: this is not always beneficial.
 1435|       |     * Try with and without -DUNALIGNED_OK to check.
 1436|       |     */
 1437|       |    Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
 1438|       |    ush scan_start = *(ushf*)scan;
 1439|       |    ush scan_end   = *(ushf*)(scan + best_len - 1);
 1440|       |#else
 1441|  74.7M|    Bytef *strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |   93|  74.7M|#define MAX_MATCH  258
  ------------------
 1442|  74.7M|    Byte scan_end1  = scan[best_len - 1];
 1443|  74.7M|    Byte scan_end   = scan[best_len];
 1444|  74.7M|#endif
 1445|       |
 1446|       |    /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
 1447|       |     * It is easy to get rid of this optimization if necessary.
 1448|       |     */
 1449|  74.7M|    Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
 1450|       |
 1451|       |    /* Do not waste too much time if we already have a good match: */
 1452|  74.7M|    if (s->prev_length >= s->good_match) {
  ------------------
  |  Branch (1452:9): [True: 189k, False: 74.5M]
  ------------------
 1453|   189k|        chain_length >>= 2;
 1454|   189k|    }
 1455|       |    /* Do not look for matches beyond the end of the input. This is necessary
 1456|       |     * to make deflate deterministic.
 1457|       |     */
 1458|  74.7M|    if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
  ------------------
  |  Branch (1458:9): [True: 64.6k, False: 74.7M]
  ------------------
 1459|       |
 1460|  74.7M|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
 1461|  74.7M|           "need lookahead");
 1462|       |
 1463|   603M|    do {
 1464|   603M|        Assert(cur_match < s->strstart, "no future");
 1465|   603M|        match = s->window + cur_match;
 1466|       |
 1467|       |        /* Skip to next match if the match length cannot increase
 1468|       |         * or if the match length is less than 2.  Note that the checks below
 1469|       |         * for insufficient lookahead only occur occasionally for performance
 1470|       |         * reasons.  Therefore uninitialized memory will be accessed, and
 1471|       |         * conditional jumps will be made that depend on those values.
 1472|       |         * However the length of the match is limited to the lookahead, so
 1473|       |         * the output of deflate is not affected by the uninitialized values.
 1474|       |         */
 1475|       |#if (defined(UNALIGNED_OK) && MAX_MATCH == 258)
 1476|       |        /* This code assumes sizeof(unsigned short) == 2. Do not use
 1477|       |         * UNALIGNED_OK if your compiler uses a different size.
 1478|       |         */
 1479|       |        if (*(ushf*)(match + best_len - 1) != scan_end ||
 1480|       |            *(ushf*)match != scan_start) continue;
 1481|       |
 1482|       |        /* It is not necessary to compare scan[2] and match[2] since they are
 1483|       |         * always equal when the other bytes match, given that the hash keys
 1484|       |         * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
 1485|       |         * strstart + 3, + 5, up to strstart + 257. We check for insufficient
 1486|       |         * lookahead only every 4th comparison; the 128th check will be made
 1487|       |         * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is
 1488|       |         * necessary to put more guard bytes at the end of the window, or
 1489|       |         * to check more often for insufficient lookahead.
 1490|       |         */
 1491|       |        Assert(scan[2] == match[2], "scan[2]?");
 1492|       |        scan++, match++;
 1493|       |        do {
 1494|       |        } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1495|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1496|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1497|       |                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
 1498|       |                 scan < strend);
 1499|       |        /* The funny "do {}" generates better code on most compilers */
 1500|       |
 1501|       |        /* Here, scan <= window + strstart + 257 */
 1502|       |        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1503|       |               "wild scan");
 1504|       |        if (*scan == *match) scan++;
 1505|       |
 1506|       |        len = (MAX_MATCH - 1) - (int)(strend - scan);
 1507|       |        scan = strend - (MAX_MATCH-1);
 1508|       |
 1509|       |#else /* UNALIGNED_OK */
 1510|       |
 1511|   603M|        if (match[best_len]     != scan_end  ||
  ------------------
  |  Branch (1511:13): [True: 219M, False: 383M]
  ------------------
 1512|   383M|            match[best_len - 1] != scan_end1 ||
  ------------------
  |  Branch (1512:13): [True: 282M, False: 101M]
  ------------------
 1513|   101M|            *match              != *scan     ||
  ------------------
  |  Branch (1513:13): [True: 95.3M, False: 6.27M]
  ------------------
 1514|   596M|            *++match            != scan[1])      continue;
  ------------------
  |  Branch (1514:13): [True: 8.77k, False: 6.26M]
  ------------------
 1515|       |
 1516|       |        /* The check at best_len - 1 can be removed because it will be made
 1517|       |         * again later. (This heuristic is not always a win.)
 1518|       |         * It is not necessary to compare scan[2] and match[2] since they
 1519|       |         * are always equal when the other bytes match, given that
 1520|       |         * the hash keys are equal and that HASH_BITS >= 8.
 1521|       |         */
 1522|  6.26M|        scan += 2, match++;
 1523|  6.26M|        Assert(*scan == *match, "match[2]?");
 1524|       |
 1525|       |        /* We check for insufficient lookahead only every 8th comparison;
 1526|       |         * the 256th check will be made at strstart + 258.
 1527|       |         */
 1528|  13.6M|        do {
 1529|  13.6M|        } while (*++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1529:18): [True: 11.2M, False: 2.42M]
  |  Branch (1529:41): [True: 9.79M, False: 1.41M]
  ------------------
 1530|  9.79M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1530:18): [True: 8.77M, False: 1.01M]
  |  Branch (1530:41): [True: 8.35M, False: 418k]
  ------------------
 1531|  8.35M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1531:18): [True: 8.05M, False: 304k]
  |  Branch (1531:41): [True: 7.84M, False: 208k]
  ------------------
 1532|  7.84M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1532:18): [True: 7.66M, False: 175k]
  |  Branch (1532:41): [True: 7.42M, False: 239k]
  ------------------
 1533|  7.42M|                 scan < strend);
  ------------------
  |  Branch (1533:18): [True: 7.36M, False: 60.9k]
  ------------------
 1534|       |
 1535|  6.26M|        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1536|  6.26M|               "wild scan");
 1537|       |
 1538|  6.26M|        len = MAX_MATCH - (int)(strend - scan);
  ------------------
  |  |   93|  6.26M|#define MAX_MATCH  258
  ------------------
 1539|  6.26M|        scan = strend - MAX_MATCH;
  ------------------
  |  |   93|  6.26M|#define MAX_MATCH  258
  ------------------
 1540|       |
 1541|  6.26M|#endif /* UNALIGNED_OK */
 1542|       |
 1543|  6.26M|        if (len > best_len) {
  ------------------
  |  Branch (1543:13): [True: 4.98M, False: 1.27M]
  ------------------
 1544|  4.98M|            s->match_start = cur_match;
 1545|  4.98M|            best_len = len;
 1546|  4.98M|            if (len >= nice_match) break;
  ------------------
  |  Branch (1546:17): [True: 82.6k, False: 4.90M]
  ------------------
 1547|       |#ifdef UNALIGNED_OK
 1548|       |            scan_end = *(ushf*)(scan + best_len - 1);
 1549|       |#else
 1550|  4.90M|            scan_end1  = scan[best_len - 1];
 1551|  4.90M|            scan_end   = scan[best_len];
 1552|  4.90M|#endif
 1553|  4.90M|        }
 1554|   603M|    } while ((cur_match = prev[cur_match & wmask]) > limit
  ------------------
  |  Branch (1554:14): [True: 528M, False: 74.2M]
  ------------------
 1555|   528M|             && --chain_length != 0);
  ------------------
  |  Branch (1555:17): [True: 528M, False: 398k]
  ------------------
 1556|       |
 1557|  74.7M|    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
  ------------------
  |  Branch (1557:9): [True: 74.7M, False: 443]
  ------------------
 1558|    443|    return s->lookahead;
 1559|  74.7M|}
deflate.c:deflate_slow:
 1991|   136M|local block_state deflate_slow(deflate_state *s, int flush) {
 1992|   136M|    IPos hash_head;          /* head of hash chain */
 1993|   136M|    int bflush;              /* set if current block must be flushed */
 1994|       |
 1995|       |    /* Process the input block. */
 1996|   237M|    for (;;) {
 1997|       |        /* Make sure that we always have enough lookahead, except
 1998|       |         * at the end of the input file. We need MAX_MATCH bytes
 1999|       |         * for the next match, plus MIN_MATCH bytes to insert the
 2000|       |         * string following the next match.
 2001|       |         */
 2002|   237M|        if (s->lookahead < MIN_LOOKAHEAD) {
  ------------------
  |  |  296|   237M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|   237M|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|   237M|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (2002:13): [True: 237M, False: 0]
  ------------------
 2003|   237M|            fill_window(s);
 2004|   237M|            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  296|   475M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   93|   237M|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   92|   237M|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
                          if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  172|   137M|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (2004:17): [True: 137M, False: 100M]
  |  Branch (2004:49): [True: 136M, False: 289k]
  ------------------
 2005|   136M|                return need_more;
 2006|   136M|            }
 2007|   100M|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (2007:17): [True: 2.45k, False: 100M]
  ------------------
 2008|   100M|        }
 2009|       |
 2010|       |        /* Insert the string window[strstart .. strstart + 2] in the
 2011|       |         * dictionary, and set hash_head to the head of the hash chain:
 2012|       |         */
 2013|   100M|        hash_head = NIL;
  ------------------
  |  |   85|   100M|#define NIL 0
  ------------------
 2014|   100M|        if (s->lookahead >= MIN_MATCH) {
  ------------------
  |  |   92|   100M|#define MIN_MATCH  3
  ------------------
  |  Branch (2014:13): [True: 100M, False: 3.53k]
  ------------------
 2015|   100M|            INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|   100M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|   100M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|   100M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|   100M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 2016|   100M|        }
 2017|       |
 2018|       |        /* Find the longest match, discarding those <= prev_length.
 2019|       |         */
 2020|   100M|        s->prev_length = s->match_length, s->prev_match = s->match_start;
 2021|   100M|        s->match_length = MIN_MATCH-1;
  ------------------
  |  |   92|   100M|#define MIN_MATCH  3
  ------------------
 2022|       |
 2023|   100M|        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
  ------------------
  |  |   85|   201M|#define NIL 0
  ------------------
  |  Branch (2023:13): [True: 83.3M, False: 17.5M]
  |  Branch (2023:33): [True: 82.9M, False: 387k]
  ------------------
 2024|  82.9M|            s->strstart - hash_head <= MAX_DIST(s)) {
  ------------------
  |  |  301|  82.9M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  296|  82.9M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  82.9M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  82.9M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2024:13): [True: 74.7M, False: 8.22M]
  ------------------
 2025|       |            /* To simplify the code, we prevent matches with the string
 2026|       |             * of window index 0 (in particular we have to avoid a match
 2027|       |             * of the string with itself at the start of the input file).
 2028|       |             */
 2029|  74.7M|            s->match_length = longest_match (s, hash_head);
 2030|       |            /* longest_match() sets match_start */
 2031|       |
 2032|  74.7M|            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
  ------------------
  |  |  200|   147M|#define Z_FILTERED            1
  ------------------
  |  Branch (2032:17): [True: 73.7M, False: 1.01M]
  |  Branch (2032:42): [True: 0, False: 73.7M]
  ------------------
 2033|  73.7M|#if TOO_FAR <= 32767
 2034|  73.7M|                || (s->match_length == MIN_MATCH &&
  ------------------
  |  |   92|   147M|#define MIN_MATCH  3
  ------------------
  |  Branch (2034:21): [True: 1.68M, False: 72.0M]
  ------------------
 2035|  1.68M|                    s->strstart - s->match_start > TOO_FAR)
  ------------------
  |  |   89|  1.68M|#  define TOO_FAR 4096
  ------------------
  |  Branch (2035:21): [True: 816k, False: 868k]
  ------------------
 2036|  73.7M|#endif
 2037|  73.7M|                )) {
 2038|       |
 2039|       |                /* If prev_match is also MIN_MATCH, match_start is garbage
 2040|       |                 * but we will ignore the current match anyway.
 2041|       |                 */
 2042|   816k|                s->match_length = MIN_MATCH-1;
  ------------------
  |  |   92|   816k|#define MIN_MATCH  3
  ------------------
 2043|   816k|            }
 2044|  74.7M|        }
 2045|       |        /* If there was a match at the previous step and the current
 2046|       |         * match is not better, output the previous match:
 2047|       |         */
 2048|   100M|        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
  ------------------
  |  |   92|   201M|#define MIN_MATCH  3
  ------------------
  |  Branch (2048:13): [True: 2.94M, False: 98.0M]
  |  Branch (2048:44): [True: 2.33M, False: 604k]
  ------------------
 2049|  2.33M|            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
  ------------------
  |  |   92|  2.33M|#define MIN_MATCH  3
  ------------------
 2050|       |            /* Do not insert strings in hash table beyond this. */
 2051|       |
 2052|  2.33M|            check_match(s, s->strstart - 1, s->prev_match,
 2053|  2.33M|                        (int)s->prev_length);
 2054|       |
 2055|  2.33M|            _tr_tally_dist(s, s->strstart - 1 - s->prev_match,
  ------------------
  |  |  366|  2.33M|  { uch len = (uch)(length); \
  |  |  367|  2.33M|    ush dist = (ush)(distance); \
  |  |  368|  2.33M|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  369|  2.33M|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  370|  2.33M|    s->sym_buf[s->sym_next++] = len; \
  |  |  371|  2.33M|    dist--; \
  |  |  372|  2.33M|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|  2.33M|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  2.33M|#define Freq fc.freq
  |  |  ------------------
  |  |  373|  2.33M|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  321|  2.33M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (321:5): [True: 547k, False: 1.79M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  2.33M|#define Freq fc.freq
  |  |  ------------------
  |  |  374|  2.33M|    flush = (s->sym_next == s->sym_end); \
  |  |  375|  2.33M|  }
  ------------------
 2056|  2.33M|                           s->prev_length - MIN_MATCH, bflush);
 2057|       |
 2058|       |            /* Insert in hash table all strings up to the end of the match.
 2059|       |             * strstart - 1 and strstart are already inserted. If there is not
 2060|       |             * enough lookahead, the last two strings are not inserted in
 2061|       |             * the hash table.
 2062|       |             */
 2063|  2.33M|            s->lookahead -= s->prev_length - 1;
 2064|  2.33M|            s->prev_length -= 2;
 2065|  35.7M|            do {
 2066|  35.7M|                if (++s->strstart <= max_insert) {
  ------------------
  |  Branch (2066:21): [True: 35.7M, False: 1.34k]
  ------------------
 2067|  35.7M|                    INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  35.7M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  35.7M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  35.7M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  35.7M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 2068|  35.7M|                }
 2069|  35.7M|            } while (--s->prev_length != 0);
  ------------------
  |  Branch (2069:22): [True: 33.4M, False: 2.33M]
  ------------------
 2070|  2.33M|            s->match_available = 0;
 2071|  2.33M|            s->match_length = MIN_MATCH-1;
  ------------------
  |  |   92|  2.33M|#define MIN_MATCH  3
  ------------------
 2072|  2.33M|            s->strstart++;
 2073|       |
 2074|  2.33M|            if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1671|    238|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|    238|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|    238|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|    238|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 158, False: 80]
  |  |  |  |  ------------------
  |  |  |  | 1661|    238|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|    238|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     80|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|    238|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|    238|                (last)); \
  |  |  |  | 1665|    238|   s->block_start = s->strstart; \
  |  |  |  | 1666|    238|   flush_pending(s->strm); \
  |  |  |  | 1667|    238|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|    238|}
  |  |  ------------------
  |  | 1673|    238|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 238, False: 0]
  |  |  ------------------
  |  | 1674|    238|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [True: 238, Folded]
  |  |  ------------------
  |  | 1675|    238|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 0, False: 0]
  |  |  |  Branch (1675:30): [True: 0, False: 0]
  |  |  ------------------
  |  | 1676|      0|   } \
  |  | 1677|    238|}
  ------------------
  |  Branch (2074:17): [True: 238, False: 2.33M]
  ------------------
 2075|       |
 2076|  98.6M|        } else if (s->match_available) {
  ------------------
  |  Branch (2076:20): [True: 96.2M, False: 2.34M]
  ------------------
 2077|       |            /* If there was no match at the previous position, output a
 2078|       |             * single literal. If there was a match but the current match
 2079|       |             * is longer, truncate the previous match to a single literal.
 2080|       |             */
 2081|  96.2M|            Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2082|  96.2M|            _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  358|  96.2M|  { uch cc = (c); \
  |  |  359|  96.2M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  96.2M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  96.2M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  96.2M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  96.2M|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  96.2M|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  96.2M|   }
  ------------------
 2083|  96.2M|            if (bflush) {
  ------------------
  |  Branch (2083:17): [True: 5.54k, False: 96.2M]
  ------------------
 2084|  5.54k|                FLUSH_BLOCK_ONLY(s, 0);
  ------------------
  |  | 1659|  5.54k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  | 1660|  5.54k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  ------------------
  |  |  |  Branch (1660:24): [True: 5.42k, False: 122]
  |  |  ------------------
  |  | 1661|  5.54k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  | 1662|  5.54k|                   (charf *)Z_NULL), \
  |  |  ------------------
  |  |  |  |  216|    122|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  ------------------
  |  | 1663|  5.54k|                (ulg)((long)s->strstart - s->block_start), \
  |  | 1664|  5.54k|                (last)); \
  |  | 1665|  5.54k|   s->block_start = s->strstart; \
  |  | 1666|  5.54k|   flush_pending(s->strm); \
  |  | 1667|  5.54k|   Tracev((stderr,"[FLUSH]")); \
  |  | 1668|  5.54k|}
  ------------------
 2085|  5.54k|            }
 2086|  96.2M|            s->strstart++;
 2087|  96.2M|            s->lookahead--;
 2088|  96.2M|            if (s->strm->avail_out == 0) return need_more;
  ------------------
  |  Branch (2088:17): [True: 5.54k, False: 96.2M]
  ------------------
 2089|  96.2M|        } else {
 2090|       |            /* There is no previous match to compare with, wait for
 2091|       |             * the next step to decide.
 2092|       |             */
 2093|  2.34M|            s->match_available = 1;
 2094|  2.34M|            s->strstart++;
 2095|  2.34M|            s->lookahead--;
 2096|  2.34M|        }
 2097|   100M|    }
 2098|  2.45k|    Assert (flush != Z_NO_FLUSH, "no flush?");
 2099|  2.45k|    if (s->match_available) {
  ------------------
  |  Branch (2099:9): [True: 1.72k, False: 734]
  ------------------
 2100|  1.72k|        Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2101|  1.72k|        _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  358|  1.72k|  { uch cc = (c); \
  |  |  359|  1.72k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  360|  1.72k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  361|  1.72k|    s->sym_buf[s->sym_next++] = cc; \
  |  |  362|  1.72k|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  1.72k|#define Freq fc.freq
  |  |  ------------------
  |  |  363|  1.72k|    flush = (s->sym_next == s->sym_end); \
  |  |  364|  1.72k|   }
  ------------------
 2102|  1.72k|        s->match_available = 0;
 2103|  1.72k|    }
 2104|  2.45k|    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   92|  2.45k|#define MIN_MATCH  3
  ------------------
                  s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   92|  2.42k|#define MIN_MATCH  3
  ------------------
  |  Branch (2104:17): [True: 30, False: 2.42k]
  ------------------
 2105|  2.45k|    if (flush == Z_FINISH) {
  ------------------
  |  |  176|  2.45k|#define Z_FINISH        4
  ------------------
  |  Branch (2105:9): [True: 2.45k, False: 0]
  ------------------
 2106|  2.45k|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1671|  2.45k|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|  2.45k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|  2.45k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|  2.45k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 2.38k, False: 69]
  |  |  |  |  ------------------
  |  |  |  | 1661|  2.45k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|  2.45k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     69|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|  2.45k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|  2.45k|                (last)); \
  |  |  |  | 1665|  2.45k|   s->block_start = s->strstart; \
  |  |  |  | 1666|  2.45k|   flush_pending(s->strm); \
  |  |  |  | 1667|  2.45k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|  2.45k|}
  |  |  ------------------
  |  | 1673|  2.45k|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 2.45k, False: 0]
  |  |  ------------------
  |  | 1674|  2.45k|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [Folded, False: 2.45k]
  |  |  ------------------
  |  | 1675|  2.45k|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 2.45k, False: 0]
  |  |  |  Branch (1675:30): [True: 0, False: 0]
  |  |  ------------------
  |  | 1676|  2.45k|   } \
  |  | 1677|  2.45k|}
  ------------------
 2107|      0|        return finish_done;
 2108|  2.45k|    }
 2109|      0|    if (s->sym_next)
  ------------------
  |  Branch (2109:9): [True: 0, False: 0]
  ------------------
 2110|      0|        FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1671|      0|#define FLUSH_BLOCK(s, last) { \
  |  | 1672|      0|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1659|      0|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1660|      0|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1660:24): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1661|      0|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1662|      0|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|      0|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1663|      0|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1664|      0|                (last)); \
  |  |  |  | 1665|      0|   s->block_start = s->strstart; \
  |  |  |  | 1666|      0|   flush_pending(s->strm); \
  |  |  |  | 1667|      0|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1668|      0|}
  |  |  ------------------
  |  | 1673|      0|   if (s->strm->avail_out == 0) { \
  |  |  ------------------
  |  |  |  Branch (1673:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1674|      0|      if (!(last)) return need_more; \
  |  |  ------------------
  |  |  |  Branch (1674:11): [True: 0, Folded]
  |  |  ------------------
  |  | 1675|      0|      if (s->pending != 0 || s->wrap != 0) return finish_started; \
  |  |  ------------------
  |  |  |  Branch (1675:11): [True: 0, False: 0]
  |  |  |  Branch (1675:30): [True: 0, False: 0]
  |  |  ------------------
  |  | 1676|      0|   } \
  |  | 1677|      0|}
  ------------------
 2111|      0|    return block_done;
 2112|      0|}
deflate.c:slide_hash:
  187|  3.29k|local void slide_hash(deflate_state *s) {
  188|  3.29k|    unsigned n, m;
  189|  3.29k|    Posf *p;
  190|  3.29k|    uInt wsize = s->w_size;
  191|       |
  192|  3.29k|    n = s->hash_size;
  193|  3.29k|    p = &s->head[n];
  194|   107M|    do {
  195|   107M|        m = *--p;
  196|   107M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|  79.9M|#define NIL 0
  ------------------
  |  Branch (196:20): [True: 27.9M, False: 79.9M]
  ------------------
  197|   107M|    } while (--n);
  ------------------
  |  Branch (197:14): [True: 107M, False: 3.29k]
  ------------------
  198|  3.29k|#ifndef FASTEST
  199|  3.29k|    n = wsize;
  200|  3.29k|    p = &s->prev[n];
  201|   107M|    do {
  202|   107M|        m = *--p;
  203|   107M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|  28.7M|#define NIL 0
  ------------------
  |  Branch (203:20): [True: 79.1M, False: 28.7M]
  ------------------
  204|       |        /* If n is not on any hash chain, prev[n] is garbage but
  205|       |         * its value will never be used.
  206|       |         */
  207|   107M|    } while (--n);
  ------------------
  |  Branch (207:14): [True: 107M, False: 3.29k]
  ------------------
  208|  3.29k|#endif
  209|  3.29k|    s->slid = 1;
  210|  3.29k|}
deflate.c:flush_pending:
  969|  84.8M|local void flush_pending(z_streamp strm) {
  970|  84.8M|    unsigned len;
  971|  84.8M|    deflate_state *s = strm->state;
  972|       |
  973|  84.8M|    _tr_flush_bits(s);
  974|  84.8M|    len = s->pending > strm->avail_out ? strm->avail_out :
  ------------------
  |  Branch (974:11): [True: 84.8M, False: 13.1k]
  ------------------
  975|  84.8M|                                         (unsigned)s->pending;
  976|  84.8M|    if (len == 0) return;
  ------------------
  |  Branch (976:9): [True: 0, False: 84.8M]
  ------------------
  977|       |
  978|  84.8M|    zmemcpy(strm->next_out, s->pending_out, len);
  ------------------
  |  |  216|  84.8M|#    define zmemcpy memcpy
  ------------------
  979|  84.8M|    strm->next_out  += len;
  980|  84.8M|    s->pending_out  += len;
  981|  84.8M|    strm->total_out += len;
  982|  84.8M|    strm->avail_out -= len;
  983|  84.8M|    s->pending      -= len;
  984|  84.8M|    if (s->pending == 0) {
  ------------------
  |  Branch (984:9): [True: 13.1k, False: 84.8M]
  ------------------
  985|  13.1k|        s->pending_out = s->pending_buf;
  986|  13.1k|    }
  987|  84.8M|}
deflate.c:putShortMSB:
  958|  7.36k|local void putShortMSB(deflate_state *s, uInt b) {
  959|  7.36k|    put_byte(s, (Byte)(b >> 8));
  ------------------
  |  |  293|  7.36k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  960|  7.36k|    put_byte(s, (Byte)(b & 0xff));
  ------------------
  |  |  293|  7.36k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  961|  7.36k|}

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

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

_tr_init:
  456|  2.45k|void ZLIB_INTERNAL _tr_init(deflate_state *s) {
  457|  2.45k|    tr_static_init();
  458|       |
  459|  2.45k|    s->l_desc.dyn_tree = s->dyn_ltree;
  460|  2.45k|    s->l_desc.stat_desc = &static_l_desc;
  461|       |
  462|  2.45k|    s->d_desc.dyn_tree = s->dyn_dtree;
  463|  2.45k|    s->d_desc.stat_desc = &static_d_desc;
  464|       |
  465|  2.45k|    s->bl_desc.dyn_tree = s->bl_tree;
  466|  2.45k|    s->bl_desc.stat_desc = &static_bl_desc;
  467|       |
  468|  2.45k|    s->bi_buf = 0;
  469|  2.45k|    s->bi_valid = 0;
  470|  2.45k|    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|  2.45k|    init_block(s);
  478|  2.45k|}
_tr_stored_block:
  861|    892|                                    ulg stored_len, int last) {
  862|    892|    send_bits(s, (STORED_BLOCK<<1) + last, 3);  /* send block type */
  ------------------
  |  |  274|    892|#define send_bits(s, value, length) \
  |  |  275|    892|{ int len = length;\
  |  |  276|    892|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|    892|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 892]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|    892|  } else {\
  |  |  283|    892|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|    892|    s->bi_valid += len;\
  |  |  285|    892|  }\
  |  |  286|    892|}
  ------------------
  863|    892|    bi_windup(s);        /* align on byte boundary */
  864|    892|    put_short(s, (ush)stored_len);
  ------------------
  |  |  144|    892|#define put_short(s, w) { \
  |  |  145|    892|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|    892|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|    892|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|    892|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|    892|}
  ------------------
  865|    892|    put_short(s, (ush)~stored_len);
  ------------------
  |  |  144|    892|#define put_short(s, w) { \
  |  |  145|    892|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|    892|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|    892|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|    892|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|    892|}
  ------------------
  866|    892|    if (stored_len)
  ------------------
  |  Branch (866:9): [True: 892, False: 0]
  ------------------
  867|    892|        zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
  ------------------
  |  |  216|    892|#    define zmemcpy memcpy
  ------------------
  868|    892|    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|    892|}
_tr_flush_bits:
  880|  84.8M|void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) {
  881|  84.8M|    bi_flush(s);
  882|  84.8M|}
_tr_flush_block:
  998|  8.24k|                                   ulg stored_len, int last) {
  999|  8.24k|    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
 1000|  8.24k|    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|  8.24k|    if (s->level > 0) {
  ------------------
  |  Branch (1003:9): [True: 8.24k, False: 0]
  ------------------
 1004|       |
 1005|       |        /* Check if the file is binary or text */
 1006|  8.24k|        if (s->strm->data_type == Z_UNKNOWN)
  ------------------
  |  |  210|  8.24k|#define Z_UNKNOWN  2
  ------------------
  |  Branch (1006:13): [True: 2.45k, False: 5.78k]
  ------------------
 1007|  2.45k|            s->strm->data_type = detect_data_type(s);
 1008|       |
 1009|       |        /* Construct the literal and distance trees */
 1010|  8.24k|        build_tree(s, (tree_desc *)(&(s->l_desc)));
 1011|  8.24k|        Tracev((stderr, "\nlit data: dyn %lu, stat %lu", s->opt_len,
 1012|  8.24k|                s->static_len));
 1013|       |
 1014|  8.24k|        build_tree(s, (tree_desc *)(&(s->d_desc)));
 1015|  8.24k|        Tracev((stderr, "\ndist data: dyn %lu, stat %lu", s->opt_len,
 1016|  8.24k|                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|  8.24k|        max_blindex = build_bl_tree(s);
 1025|       |
 1026|       |        /* Determine the best encoding. Compute the block lengths in bytes. */
 1027|  8.24k|        opt_lenb = (s->opt_len + 3 + 7) >> 3;
 1028|  8.24k|        static_lenb = (s->static_len + 3 + 7) >> 3;
 1029|       |
 1030|  8.24k|        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
 1031|  8.24k|                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
 1032|  8.24k|                s->sym_next / 3));
 1033|       |
 1034|  8.24k|#ifndef FORCE_STATIC
 1035|  8.24k|        if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
  ------------------
  |  |  203|  6.90k|#define Z_FIXED               4
  ------------------
  |  Branch (1035:13): [True: 1.33k, False: 6.90k]
  |  Branch (1035:40): [True: 0, False: 6.90k]
  ------------------
 1036|  1.33k|#endif
 1037|  1.33k|            opt_lenb = static_lenb;
 1038|       |
 1039|  8.24k|    } 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|  8.24k|    if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
  ------------------
  |  Branch (1047:9): [True: 892, False: 7.35k]
  |  Branch (1047:39): [True: 892, False: 0]
  ------------------
 1048|       |                       /* 4: two words for the lengths */
 1049|    892|#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|    892|        _tr_stored_block(s, buf, stored_len, last);
 1057|       |
 1058|  7.35k|    } else if (static_lenb == opt_lenb) {
  ------------------
  |  Branch (1058:16): [True: 1.11k, False: 6.23k]
  ------------------
 1059|  1.11k|        send_bits(s, (STATIC_TREES<<1) + last, 3);
  ------------------
  |  |  274|  1.11k|#define send_bits(s, value, length) \
  |  |  275|  1.11k|{ int len = length;\
  |  |  276|  1.11k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  1.11k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 1.11k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.11k|  } else {\
  |  |  283|  1.11k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.11k|    s->bi_valid += len;\
  |  |  285|  1.11k|  }\
  |  |  286|  1.11k|}
  ------------------
 1060|  1.11k|        compress_block(s, (const ct_data *)static_ltree,
 1061|  1.11k|                       (const ct_data *)static_dtree);
 1062|       |#ifdef ZLIB_DEBUG
 1063|       |        s->compressed_len += 3 + s->static_len;
 1064|       |#endif
 1065|  6.23k|    } else {
 1066|  6.23k|        send_bits(s, (DYN_TREES<<1) + last, 3);
  ------------------
  |  |  274|  6.23k|#define send_bits(s, value, length) \
  |  |  275|  6.23k|{ int len = length;\
  |  |  276|  6.23k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  6.23k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 6.23k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  6.23k|  } else {\
  |  |  283|  6.23k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  6.23k|    s->bi_valid += len;\
  |  |  285|  6.23k|  }\
  |  |  286|  6.23k|}
  ------------------
 1067|  6.23k|        send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
 1068|  6.23k|                       max_blindex + 1);
 1069|  6.23k|        compress_block(s, (const ct_data *)s->dyn_ltree,
 1070|  6.23k|                       (const ct_data *)s->dyn_dtree);
 1071|       |#ifdef ZLIB_DEBUG
 1072|       |        s->compressed_len += 3 + s->opt_len;
 1073|       |#endif
 1074|  6.23k|    }
 1075|  8.24k|    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|  8.24k|    init_block(s);
 1080|       |
 1081|  8.24k|    if (last) {
  ------------------
  |  Branch (1081:9): [True: 2.45k, False: 5.78k]
  ------------------
 1082|  2.45k|        bi_windup(s);
 1083|       |#ifdef ZLIB_DEBUG
 1084|       |        s->compressed_len += 7;  /* align on byte boundary */
 1085|       |#endif
 1086|  2.45k|    }
 1087|  8.24k|    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
 1088|  8.24k|           s->compressed_len - 7*(ulg)last));
 1089|  8.24k|}
trees.c:tr_static_init:
  295|  2.45k|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|  2.45k|}
trees.c:init_block:
  440|  10.6k|local void init_block(deflate_state *s) {
  441|  10.6k|    int n; /* iterates over tree elements */
  442|       |
  443|       |    /* Initialize the trees. */
  444|  3.07M|    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   40|  3.07M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   37|  3.07M|#define LITERALS  256
  |  |  ------------------
  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   34|  3.07M|#define LENGTH_CODES 29
  |  |  ------------------
  ------------------
                  for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   83|  3.05M|#define Freq fc.freq
  ------------------
  |  Branch (444:17): [True: 3.05M, False: 10.6k]
  ------------------
  445|   331k|    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   43|   331k|#define D_CODES   30
  ------------------
                  for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   83|   320k|#define Freq fc.freq
  ------------------
  |  Branch (445:17): [True: 320k, False: 10.6k]
  ------------------
  446|   213k|    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   46|   213k|#define BL_CODES  19
  ------------------
                  for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   83|   203k|#define Freq fc.freq
  ------------------
  |  Branch (446:17): [True: 203k, False: 10.6k]
  ------------------
  447|       |
  448|  10.6k|    s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   50|  10.6k|#define END_BLOCK 256
  ------------------
                  s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   83|  10.6k|#define Freq fc.freq
  ------------------
  449|  10.6k|    s->opt_len = s->static_len = 0L;
  450|  10.6k|    s->sym_next = s->matches = 0;
  451|  10.6k|}
trees.c:bi_windup:
  181|  3.34k|local void bi_windup(deflate_state *s) {
  182|  3.34k|    if (s->bi_valid > 8) {
  ------------------
  |  Branch (182:9): [True: 1.07k, False: 2.27k]
  ------------------
  183|  1.07k|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|  1.07k|#define put_short(s, w) { \
  |  |  145|  1.07k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  1.07k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  1.07k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  1.07k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  1.07k|}
  ------------------
  184|  2.27k|    } else if (s->bi_valid > 0) {
  ------------------
  |  Branch (184:16): [True: 1.97k, False: 300]
  ------------------
  185|  1.97k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  293|  1.97k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  186|  1.97k|    }
  187|  3.34k|    s->bi_used = ((s->bi_valid - 1) & 7) + 1;
  188|  3.34k|    s->bi_buf = 0;
  189|  3.34k|    s->bi_valid = 0;
  190|       |#ifdef ZLIB_DEBUG
  191|       |    s->bits_sent = (s->bits_sent + 7) & ~(ulg)7;
  192|       |#endif
  193|  3.34k|}
trees.c:bi_flush:
  166|  84.8M|local void bi_flush(deflate_state *s) {
  167|  84.8M|    if (s->bi_valid == 16) {
  ------------------
  |  Branch (167:9): [True: 367, False: 84.8M]
  ------------------
  168|    367|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|    367|#define put_short(s, w) { \
  |  |  145|    367|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|    367|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|    367|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|    367|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|    367|}
  ------------------
  169|    367|        s->bi_buf = 0;
  170|    367|        s->bi_valid = 0;
  171|  84.8M|    } else if (s->bi_valid >= 8) {
  ------------------
  |  Branch (171:16): [True: 2.60k, False: 84.8M]
  ------------------
  172|  2.60k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  293|  2.60k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  173|  2.60k|        s->bi_buf >>= 8;
  174|  2.60k|        s->bi_valid -= 8;
  175|  2.60k|    }
  176|  84.8M|}
trees.c:detect_data_type:
  966|  2.45k|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|  2.45k|    unsigned long block_mask = 0xf3ffc07fUL;
  972|  2.45k|    int n;
  973|       |
  974|       |    /* Check for non-textual ("block-listed") bytes. */
  975|  17.1k|    for (n = 0; n <= 31; n++, block_mask >>= 1)
  ------------------
  |  Branch (975:17): [True: 16.7k, False: 417]
  ------------------
  976|  16.7k|        if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
  ------------------
  |  |   83|  12.6k|#define Freq fc.freq
  ------------------
  |  Branch (976:13): [True: 12.6k, False: 4.13k]
  |  Branch (976:33): [True: 2.03k, False: 10.5k]
  ------------------
  977|  2.03k|            return Z_BINARY;
  ------------------
  |  |  207|  2.03k|#define Z_BINARY   0
  ------------------
  978|       |
  979|       |    /* Check for textual ("allow-listed") bytes. */
  980|    417|    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    417|#define Freq fc.freq
  ------------------
                  if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    403|#define Freq fc.freq
  ------------------
  |  Branch (980:9): [True: 14, False: 403]
  |  Branch (980:38): [True: 27, False: 376]
  ------------------
  981|    376|            || s->dyn_ltree[13].Freq != 0)
  ------------------
  |  |   83|    376|#define Freq fc.freq
  ------------------
  |  Branch (981:16): [True: 17, False: 359]
  ------------------
  982|     58|        return Z_TEXT;
  ------------------
  |  |  208|     58|#define Z_TEXT     1
  ------------------
  983|  47.5k|    for (n = 32; n < LITERALS; n++)
  ------------------
  |  |   37|  47.5k|#define LITERALS  256
  ------------------
  |  Branch (983:18): [True: 47.5k, False: 11]
  ------------------
  984|  47.5k|        if (s->dyn_ltree[n].Freq != 0)
  ------------------
  |  |   83|  47.5k|#define Freq fc.freq
  ------------------
  |  Branch (984:13): [True: 348, False: 47.1k]
  ------------------
  985|    348|            return Z_TEXT;
  ------------------
  |  |  208|    707|#define Z_TEXT     1
  ------------------
  986|       |
  987|       |    /* There are no "block-listed" or "allow-listed" bytes:
  988|       |     * this stream either is empty or has tolerated ("gray-listed") bytes only.
  989|       |     */
  990|     11|    return Z_BINARY;
  ------------------
  |  |  207|     11|#define Z_BINARY   0
  ------------------
  991|    359|}
trees.c:build_tree:
  627|  24.7k|local void build_tree(deflate_state *s, tree_desc *desc) {
  628|  24.7k|    ct_data *tree         = desc->dyn_tree;
  629|  24.7k|    const ct_data *stree  = desc->stat_desc->static_tree;
  630|  24.7k|    int elems             = desc->stat_desc->elems;
  631|  24.7k|    int n, m;          /* iterate over heap elements */
  632|  24.7k|    int max_code = -1; /* largest code with non zero frequency */
  633|  24.7k|    int node;          /* new node being created */
  634|       |
  635|       |    /* Construct the initial heap, with least frequent element in
  636|       |     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n + 1].
  637|       |     * heap[0] is not used.
  638|       |     */
  639|  24.7k|    s->heap_len = 0, s->heap_max = HEAP_SIZE;
  ------------------
  |  |   49|  24.7k|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  24.7k|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  24.7k|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  24.7k|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|       |
  641|  2.78M|    for (n = 0; n < elems; n++) {
  ------------------
  |  Branch (641:17): [True: 2.76M, False: 24.7k]
  ------------------
  642|  2.76M|        if (tree[n].Freq != 0) {
  ------------------
  |  |   83|  2.76M|#define Freq fc.freq
  ------------------
  |  Branch (642:13): [True: 1.56M, False: 1.19M]
  ------------------
  643|  1.56M|            s->heap[++(s->heap_len)] = max_code = n;
  644|  1.56M|            s->depth[n] = 0;
  645|  1.56M|        } else {
  646|  1.19M|            tree[n].Len = 0;
  ------------------
  |  |   86|  1.19M|#define Len  dl.len
  ------------------
  647|  1.19M|        }
  648|  2.76M|    }
  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|  30.1k|    while (s->heap_len < 2) {
  ------------------
  |  Branch (655:12): [True: 5.37k, False: 24.7k]
  ------------------
  656|  5.37k|        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
  ------------------
  |  Branch (656:44): [True: 4.63k, False: 741]
  ------------------
  657|  5.37k|        tree[node].Freq = 1;
  ------------------
  |  |   83|  5.37k|#define Freq fc.freq
  ------------------
  658|  5.37k|        s->depth[node] = 0;
  659|  5.37k|        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
  ------------------
  |  |   86|  5.37k|#define Len  dl.len
  ------------------
  |  Branch (659:27): [True: 5.37k, False: 0]
  ------------------
  660|       |        /* node is 0 or 1 so it does not have extra bits */
  661|  5.37k|    }
  662|  24.7k|    desc->max_code = max_code;
  663|       |
  664|       |    /* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree,
  665|       |     * establish sub-heaps of increasing lengths:
  666|       |     */
  667|   806k|    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
  ------------------
  |  Branch (667:29): [True: 781k, False: 24.7k]
  ------------------
  668|       |
  669|       |    /* Construct the Huffman tree by repeatedly combining the least two
  670|       |     * frequent nodes.
  671|       |     */
  672|  24.7k|    node = elems;              /* next internal node of the tree */
  673|  1.54M|    do {
  674|  1.54M|        pqremove(s, tree, n);  /* n = node of least frequency */
  ------------------
  |  |  488|  1.54M|#define pqremove(s, tree, top) \
  |  |  489|  1.54M|{\
  |  |  490|  1.54M|    top = s->heap[SMALLEST]; \
  |  |  ------------------
  |  |  |  |  480|  1.54M|#define SMALLEST 1
  |  |  ------------------
  |  |  491|  1.54M|    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
  |  |  ------------------
  |  |  |  |  480|  1.54M|#define SMALLEST 1
  |  |  ------------------
  |  |  492|  1.54M|    pqdownheap(s, tree, SMALLEST); \
  |  |  ------------------
  |  |  |  |  480|  1.54M|#define SMALLEST 1
  |  |  ------------------
  |  |  493|  1.54M|}
  ------------------
  675|  1.54M|        m = s->heap[SMALLEST]; /* m = node of next least frequency */
  ------------------
  |  |  480|  1.54M|#define SMALLEST 1
  ------------------
  676|       |
  677|  1.54M|        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
  678|  1.54M|        s->heap[--(s->heap_max)] = m;
  679|       |
  680|       |        /* Create a new node father of n and m */
  681|  1.54M|        tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.54M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.54M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.54M|#define Freq fc.freq
  ------------------
  682|  1.54M|        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
  ------------------
  |  Branch (682:33): [True: 1.36M, False: 185k]
  ------------------
  683|  1.36M|                                s->depth[n] : s->depth[m]) + 1);
  684|  1.54M|        tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  1.54M|#define Dad  dl.dad
  ------------------
                      tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  1.54M|#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|  1.54M|        s->heap[SMALLEST] = node++;
  ------------------
  |  |  480|  1.54M|#define SMALLEST 1
  ------------------
  693|  1.54M|        pqdownheap(s, tree, SMALLEST);
  ------------------
  |  |  480|  1.54M|#define SMALLEST 1
  ------------------
  694|       |
  695|  1.54M|    } while (s->heap_len >= 2);
  ------------------
  |  Branch (695:14): [True: 1.52M, False: 24.7k]
  ------------------
  696|       |
  697|  24.7k|    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
  ------------------
  |  |  480|  24.7k|#define SMALLEST 1
  ------------------
  698|       |
  699|       |    /* At this point, the fields freq and dad are set. We can now
  700|       |     * generate the bit lengths.
  701|       |     */
  702|  24.7k|    gen_bitlen(s, (tree_desc *)desc);
  703|       |
  704|       |    /* The field len is now set, we can generate the bit codes */
  705|  24.7k|    gen_codes ((ct_data *)tree, max_code, s->bl_count);
  706|  24.7k|}
trees.c:pqdownheap:
  509|  3.87M|local void pqdownheap(deflate_state *s, ct_data *tree, int k) {
  510|  3.87M|    int v = s->heap[k];
  511|  3.87M|    int j = k << 1;  /* left son of k */
  512|  19.2M|    while (j <= s->heap_len) {
  ------------------
  |  Branch (512:12): [True: 16.4M, False: 2.83M]
  ------------------
  513|       |        /* Set j to the smallest of the two sons: */
  514|  16.4M|        if (j < s->heap_len &&
  ------------------
  |  Branch (514:13): [True: 16.2M, False: 222k]
  ------------------
  515|  16.2M|            smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
  ------------------
  |  |  500|  16.2M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  16.2M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  32.4M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 4.22M, False: 11.9M]
  |  |  ------------------
  |  |  501|  16.2M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  11.9M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  23.9M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 4.03M, False: 7.94M]
  |  |  |  Branch (501:37): [True: 3.65M, False: 373k]
  |  |  ------------------
  ------------------
  516|  7.88M|            j++;
  517|  7.88M|        }
  518|       |        /* Exit if v is smaller than both sons */
  519|  16.4M|        if (smaller(tree, v, s->heap[j], s->depth)) break;
  ------------------
  |  |  500|  16.4M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  16.4M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  32.8M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 720k, False: 15.7M]
  |  |  ------------------
  |  |  501|  16.4M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  15.7M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  31.4M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 435k, False: 15.2M]
  |  |  |  Branch (501:37): [True: 325k, False: 110k]
  |  |  ------------------
  ------------------
  520|       |
  521|       |        /* Exchange v with the smallest son */
  522|  15.3M|        s->heap[k] = s->heap[j];  k = j;
  523|       |
  524|       |        /* And continue down the tree, setting j to the left son of k */
  525|  15.3M|        j <<= 1;
  526|  15.3M|    }
  527|  3.87M|    s->heap[k] = v;
  528|  3.87M|}
trees.c:gen_bitlen:
  540|  24.7k|local void gen_bitlen(deflate_state *s, tree_desc *desc) {
  541|  24.7k|    ct_data *tree        = desc->dyn_tree;
  542|  24.7k|    int max_code         = desc->max_code;
  543|  24.7k|    const ct_data *stree = desc->stat_desc->static_tree;
  544|  24.7k|    const intf *extra    = desc->stat_desc->extra_bits;
  545|  24.7k|    int base             = desc->stat_desc->extra_base;
  546|  24.7k|    int max_length       = desc->stat_desc->max_length;
  547|  24.7k|    int h;              /* heap index */
  548|  24.7k|    int n, m;           /* iterate over the tree elements */
  549|  24.7k|    int bits;           /* bit length */
  550|  24.7k|    int xbits;          /* extra bits */
  551|  24.7k|    ush f;              /* frequency */
  552|  24.7k|    int overflow = 0;   /* number of elements with bit length too large */
  553|       |
  554|   420k|    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
  ------------------
  |  |   52|   420k|#define MAX_BITS 15
  ------------------
  |  Branch (554:20): [True: 395k, False: 24.7k]
  ------------------
  555|       |
  556|       |    /* In a first pass, compute the optimal bit lengths (which may
  557|       |     * overflow in the case of the bit length tree).
  558|       |     */
  559|  24.7k|    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
  ------------------
  |  |   86|  24.7k|#define Len  dl.len
  ------------------
  560|       |
  561|  3.12M|    for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
  ------------------
  |  |   49|  3.12M|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  3.12M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  3.12M|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.12M|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (561:31): [True: 3.09M, False: 24.7k]
  ------------------
  562|  3.09M|        n = s->heap[h];
  563|  3.09M|        bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   85|  3.09M|#define Dad  dl.dad
  ------------------
                      bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   86|  3.09M|#define Len  dl.len
  ------------------
  564|  3.09M|        if (bits > max_length) bits = max_length, overflow++;
  ------------------
  |  Branch (564:13): [True: 10.1k, False: 3.08M]
  ------------------
  565|  3.09M|        tree[n].Len = (ush)bits;
  ------------------
  |  |   86|  3.09M|#define Len  dl.len
  ------------------
  566|       |        /* We overwrite tree[n].Dad which is no longer needed */
  567|       |
  568|  3.09M|        if (n > max_code) continue; /* not a leaf node */
  ------------------
  |  Branch (568:13): [True: 1.52M, False: 1.57M]
  ------------------
  569|       |
  570|  1.57M|        s->bl_count[bits]++;
  571|  1.57M|        xbits = 0;
  572|  1.57M|        if (n >= base) xbits = extra[n - base];
  ------------------
  |  Branch (572:13): [True: 210k, False: 1.36M]
  ------------------
  573|  1.57M|        f = tree[n].Freq;
  ------------------
  |  |   83|  1.57M|#define Freq fc.freq
  ------------------
  574|  1.57M|        s->opt_len += (ulg)f * (unsigned)(bits + xbits);
  575|  1.57M|        if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
  ------------------
  |  |   86|  1.48M|#define Len  dl.len
  ------------------
  |  Branch (575:13): [True: 1.48M, False: 90.6k]
  ------------------
  576|  1.57M|    }
  577|  24.7k|    if (overflow == 0) return;
  ------------------
  |  Branch (577:9): [True: 21.6k, False: 3.02k]
  ------------------
  578|       |
  579|  3.02k|    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|  5.08k|    do {
  584|  5.08k|        bits = max_length - 1;
  585|  6.66k|        while (s->bl_count[bits] == 0) bits--;
  ------------------
  |  Branch (585:16): [True: 1.57k, False: 5.08k]
  ------------------
  586|  5.08k|        s->bl_count[bits]--;        /* move one leaf down the tree */
  587|  5.08k|        s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
  588|  5.08k|        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|  5.08k|        overflow -= 2;
  593|  5.08k|    } while (overflow > 0);
  ------------------
  |  Branch (593:14): [True: 2.05k, False: 3.02k]
  ------------------
  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|  25.1k|    for (bits = max_length; bits != 0; bits--) {
  ------------------
  |  Branch (600:29): [True: 22.0k, False: 3.02k]
  ------------------
  601|  22.0k|        n = s->bl_count[bits];
  602|   142k|        while (n != 0) {
  ------------------
  |  Branch (602:16): [True: 119k, False: 22.0k]
  ------------------
  603|   119k|            m = s->heap[--h];
  604|   119k|            if (m > max_code) continue;
  ------------------
  |  Branch (604:17): [True: 52.3k, False: 67.6k]
  ------------------
  605|  67.6k|            if ((unsigned) tree[m].Len != (unsigned) bits) {
  ------------------
  |  |   86|  67.6k|#define Len  dl.len
  ------------------
  |  Branch (605:17): [True: 4.58k, False: 63.0k]
  ------------------
  606|  4.58k|                Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
  607|  4.58k|                s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   86|  4.58k|#define Len  dl.len
  ------------------
                              s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   83|  4.58k|#define Freq fc.freq
  ------------------
  608|  4.58k|                tree[m].Len = (ush)bits;
  ------------------
  |  |   86|  4.58k|#define Len  dl.len
  ------------------
  609|  4.58k|            }
  610|  67.6k|            n--;
  611|  67.6k|        }
  612|  22.0k|    }
  613|  3.02k|}
trees.c:gen_codes:
  203|  24.7k|local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) {
  204|  24.7k|    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
  205|  24.7k|    unsigned code = 0;         /* running code value */
  206|  24.7k|    int bits;                  /* bit index */
  207|  24.7k|    int n;                     /* code index */
  208|       |
  209|       |    /* The distribution counts are first used to generate the code values
  210|       |     * without bit reversal.
  211|       |     */
  212|   395k|    for (bits = 1; bits <= MAX_BITS; bits++) {
  ------------------
  |  |   52|   395k|#define MAX_BITS 15
  ------------------
  |  Branch (212:20): [True: 370k, False: 24.7k]
  ------------------
  213|   370k|        code = (code + bl_count[bits - 1]) << 1;
  214|   370k|        next_code[bits] = (ush)code;
  215|   370k|    }
  216|       |    /* Check that the bit counts in bl_count are consistent. The last code
  217|       |     * must be all ones.
  218|       |     */
  219|  24.7k|    Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
  220|  24.7k|            "inconsistent bit counts");
  221|  24.7k|    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
  222|       |
  223|  2.51M|    for (n = 0;  n <= max_code; n++) {
  ------------------
  |  Branch (223:18): [True: 2.49M, False: 24.7k]
  ------------------
  224|  2.49M|        int len = tree[n].Len;
  ------------------
  |  |   86|  2.49M|#define Len  dl.len
  ------------------
  225|  2.49M|        if (len == 0) continue;
  ------------------
  |  Branch (225:13): [True: 920k, False: 1.57M]
  ------------------
  226|       |        /* Now reverse the bits */
  227|  1.57M|        tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
  ------------------
  |  |   84|  1.57M|#define Code fc.code
  ------------------
  228|       |
  229|  1.57M|        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
  230|  1.57M|            n, (isgraph(n & 0xff) ? n : ' '), len, tree[n].Code, next_code[len] - 1));
  231|  1.57M|    }
  232|  24.7k|}
trees.c:bi_reverse:
  154|  1.57M|local unsigned bi_reverse(unsigned code, int len) {
  155|  1.57M|    unsigned res = 0;
  156|  12.6M|    do {
  157|  12.6M|        res |= code & 1;
  158|  12.6M|        code >>= 1, res <<= 1;
  159|  12.6M|    } while (--len > 0);
  ------------------
  |  Branch (159:14): [True: 11.0M, False: 1.57M]
  ------------------
  160|  1.57M|    return res >> 1;
  161|  1.57M|}
trees.c:build_bl_tree:
  800|  8.24k|local int build_bl_tree(deflate_state *s) {
  801|  8.24k|    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|  8.24k|    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
  805|  8.24k|    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
  806|       |
  807|       |    /* Build the bit length tree: */
  808|  8.24k|    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|  20.9k|    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
  ------------------
  |  |   46|  8.24k|#define BL_CODES  19
  ------------------
  |  Branch (817:36): [True: 20.9k, False: 0]
  ------------------
  818|  20.9k|        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
  ------------------
  |  |   86|  20.9k|#define Len  dl.len
  ------------------
  |  Branch (818:13): [True: 8.24k, False: 12.7k]
  ------------------
  819|  20.9k|    }
  820|       |    /* Update opt_len to include the bit length tree and counts */
  821|  8.24k|    s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
  822|  8.24k|    Tracev((stderr, "\ndyn trees: dyn %lu, stat %lu",
  823|  8.24k|            s->opt_len, s->static_len));
  824|       |
  825|  8.24k|    return max_blindex;
  826|  8.24k|}
trees.c:scan_tree:
  712|  16.4k|local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
  713|  16.4k|    int n;                     /* iterates over all tree elements */
  714|  16.4k|    int prevlen = -1;          /* last emitted length */
  715|  16.4k|    int curlen;                /* length of current code */
  716|  16.4k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  16.4k|#define Len  dl.len
  ------------------
  717|  16.4k|    int count = 0;             /* repeat count of the current code */
  718|  16.4k|    int max_count = 7;         /* max repeat count */
  719|  16.4k|    int min_count = 4;         /* min repeat count */
  720|       |
  721|  16.4k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (721:9): [True: 2.99k, False: 13.4k]
  ------------------
  722|  16.4k|    tree[max_code + 1].Len = (ush)0xffff; /* guard */
  ------------------
  |  |   86|  16.4k|#define Len  dl.len
  ------------------
  723|       |
  724|  2.35M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (724:17): [True: 2.34M, False: 16.4k]
  ------------------
  725|  2.34M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  2.34M|#define Len  dl.len
  ------------------
  726|  2.34M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (726:13): [True: 2.27M, False: 66.6k]
  |  Branch (726:36): [True: 1.09M, False: 1.18M]
  ------------------
  727|  1.09M|            continue;
  728|  1.25M|        } else if (count < min_count) {
  ------------------
  |  Branch (728:20): [True: 1.12M, False: 127k]
  ------------------
  729|  1.12M|            s->bl_tree[curlen].Freq += (ush)count;
  ------------------
  |  |   83|  1.12M|#define Freq fc.freq
  ------------------
  730|  1.12M|        } else if (curlen != 0) {
  ------------------
  |  Branch (730:20): [True: 96.4k, False: 31.0k]
  ------------------
  731|  96.4k|            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
  ------------------
  |  |   83|  44.1k|#define Freq fc.freq
  ------------------
  |  Branch (731:17): [True: 44.1k, False: 52.2k]
  ------------------
  732|  96.4k|            s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   53|  96.4k|#define REP_3_6      16
  ------------------
                          s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   83|  96.4k|#define Freq fc.freq
  ------------------
  733|  96.4k|        } else if (count <= 10) {
  ------------------
  |  Branch (733:20): [True: 20.3k, False: 10.7k]
  ------------------
  734|  20.3k|            s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   56|  20.3k|#define REPZ_3_10    17
  ------------------
                          s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   83|  20.3k|#define Freq fc.freq
  ------------------
  735|  20.3k|        } else {
  736|  10.7k|            s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   59|  10.7k|#define REPZ_11_138  18
  ------------------
                          s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   83|  10.7k|#define Freq fc.freq
  ------------------
  737|  10.7k|        }
  738|  1.25M|        count = 0; prevlen = curlen;
  739|  1.25M|        if (nextlen == 0) {
  ------------------
  |  Branch (739:13): [True: 341k, False: 910k]
  ------------------
  740|   341k|            max_count = 138, min_count = 3;
  741|   910k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (741:20): [True: 59.5k, False: 851k]
  ------------------
  742|  59.5k|            max_count = 6, min_count = 3;
  743|   851k|        } else {
  744|   851k|            max_count = 7, min_count = 4;
  745|   851k|        }
  746|  1.25M|    }
  747|  16.4k|}
trees.c:compress_block:
  901|  7.35k|                          const ct_data *dtree) {
  902|  7.35k|    unsigned dist;      /* distance of matched string */
  903|  7.35k|    int lc;             /* match length or unmatched char (if dist == 0) */
  904|  7.35k|    unsigned sx = 0;    /* running index in symbol buffers */
  905|  7.35k|    unsigned code;      /* the code to send */
  906|  7.35k|    int extra;          /* number of extra bits to send */
  907|       |
  908|  88.3M|    if (s->sym_next != 0) do {
  ------------------
  |  Branch (908:9): [True: 7.31k, False: 36]
  ------------------
  909|       |#ifdef LIT_MEM
  910|       |        dist = s->d_buf[sx];
  911|       |        lc = s->l_buf[sx++];
  912|       |#else
  913|  88.3M|        dist = s->sym_buf[sx++] & 0xff;
  914|  88.3M|        dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
  915|  88.3M|        lc = s->sym_buf[sx++];
  916|  88.3M|#endif
  917|  88.3M|        if (dist == 0) {
  ------------------
  |  Branch (917:13): [True: 86.0M, False: 2.33M]
  ------------------
  918|  86.0M|            send_code(s, lc, ltree); /* send a literal byte */
  ------------------
  |  |  239|  86.0M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  86.0M|#define send_bits(s, value, length) \
  |  |  |  |  275|  86.0M|{ int len = length;\
  |  |  |  |  276|  86.0M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  86.0M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 34.5M, False: 51.4M]
  |  |  |  |  ------------------
  |  |  |  |  277|  34.5M|    int val = (int)value;\
  |  |  |  |  278|  34.5M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  34.5M|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  34.5M|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  34.5M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  34.5M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  34.5M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  34.5M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  34.5M|}
  |  |  |  |  ------------------
  |  |  |  |  280|  34.5M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  34.5M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  34.5M|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  34.5M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  51.4M|  } else {\
  |  |  |  |  283|  51.4M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  51.4M|    s->bi_valid += len;\
  |  |  |  |  285|  51.4M|  }\
  |  |  |  |  286|  86.0M|}
  |  |  ------------------
  ------------------
  919|  86.0M|            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
  920|  86.0M|        } else {
  921|       |            /* Here, lc is the match length - MIN_MATCH */
  922|  2.33M|            code = _length_code[lc];
  923|  2.33M|            send_code(s, code + LITERALS + 1, ltree);   /* send length code */
  ------------------
  |  |  239|  2.33M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  2.33M|#define send_bits(s, value, length) \
  |  |  |  |  275|  2.33M|{ int len = length;\
  |  |  |  |  276|  2.33M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.33M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 635k, False: 1.70M]
  |  |  |  |  ------------------
  |  |  |  |  277|   635k|    int val = (int)value;\
  |  |  |  |  278|   635k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   635k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   635k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   635k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   635k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   635k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   635k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   635k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   635k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   635k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   635k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   635k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  1.70M|  } else {\
  |  |  |  |  283|  1.70M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  1.70M|    s->bi_valid += len;\
  |  |  |  |  285|  1.70M|  }\
  |  |  |  |  286|  2.33M|}
  |  |  ------------------
  ------------------
  924|  2.33M|            extra = extra_lbits[code];
  925|  2.33M|            if (extra != 0) {
  ------------------
  |  Branch (925:17): [True: 413k, False: 1.92M]
  ------------------
  926|   413k|                lc -= base_length[code];
  927|   413k|                send_bits(s, lc, extra);       /* send the extra length bits */
  ------------------
  |  |  274|   413k|#define send_bits(s, value, length) \
  |  |  275|   413k|{ int len = length;\
  |  |  276|   413k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   413k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 59.3k, False: 353k]
  |  |  ------------------
  |  |  277|  59.3k|    int val = (int)value;\
  |  |  278|  59.3k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  59.3k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  59.3k|#define put_short(s, w) { \
  |  |  |  |  145|  59.3k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  59.3k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  59.3k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  59.3k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  59.3k|}
  |  |  ------------------
  |  |  280|  59.3k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  59.3k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  59.3k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  59.3k|#define Buf_size 16
  |  |  ------------------
  |  |  282|   353k|  } else {\
  |  |  283|   353k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   353k|    s->bi_valid += len;\
  |  |  285|   353k|  }\
  |  |  286|   413k|}
  ------------------
  928|   413k|            }
  929|  2.33M|            dist--; /* dist is now the match distance - 1 */
  930|  2.33M|            code = d_code(dist);
  ------------------
  |  |  321|  2.33M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  ------------------
  |  |  |  Branch (321:5): [True: 546k, False: 1.79M]
  |  |  ------------------
  ------------------
  931|  2.33M|            Assert (code < D_CODES, "bad d_code");
  932|       |
  933|  2.33M|            send_code(s, code, dtree);       /* send the distance code */
  ------------------
  |  |  239|  2.33M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  2.33M|#define send_bits(s, value, length) \
  |  |  |  |  275|  2.33M|{ int len = length;\
  |  |  |  |  276|  2.33M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.33M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 523k, False: 1.81M]
  |  |  |  |  ------------------
  |  |  |  |  277|   523k|    int val = (int)value;\
  |  |  |  |  278|   523k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   523k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   523k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   523k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   523k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   523k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   523k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   523k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   523k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   523k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   523k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   523k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  1.81M|  } else {\
  |  |  |  |  283|  1.81M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  1.81M|    s->bi_valid += len;\
  |  |  |  |  285|  1.81M|  }\
  |  |  |  |  286|  2.33M|}
  |  |  ------------------
  ------------------
  934|  2.33M|            extra = extra_dbits[code];
  935|  2.33M|            if (extra != 0) {
  ------------------
  |  Branch (935:17): [True: 2.23M, False: 106k]
  ------------------
  936|  2.23M|                dist -= (unsigned)base_dist[code];
  937|  2.23M|                send_bits(s, (int)dist, extra); /* send the extra bits */
  ------------------
  |  |  274|  2.23M|#define send_bits(s, value, length) \
  |  |  275|  2.23M|{ int len = length;\
  |  |  276|  2.23M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  2.23M|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.25M, False: 979k]
  |  |  ------------------
  |  |  277|  1.25M|    int val = (int)value;\
  |  |  278|  1.25M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  1.25M|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  1.25M|#define put_short(s, w) { \
  |  |  |  |  145|  1.25M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  1.25M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.25M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  1.25M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  1.25M|}
  |  |  ------------------
  |  |  280|  1.25M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  1.25M|#define Buf_size 16
  |  |  ------------------
  |  |  281|  1.25M|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  1.25M|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.25M|  } else {\
  |  |  283|   979k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   979k|    s->bi_valid += len;\
  |  |  285|   979k|  }\
  |  |  286|  2.23M|}
  ------------------
  938|  2.23M|            }
  939|  2.33M|        } /* 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|  88.3M|        Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
  946|  88.3M|#endif
  947|       |
  948|  88.3M|    } while (sx < s->sym_next);
  ------------------
  |  Branch (948:14): [True: 88.3M, False: 7.31k]
  ------------------
  949|       |
  950|  7.35k|    send_code(s, END_BLOCK, ltree);
  ------------------
  |  |  239|  7.35k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  7.35k|#define send_bits(s, value, length) \
  |  |  |  |  275|  7.35k|{ int len = length;\
  |  |  |  |  276|  7.35k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  7.35k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 5.25k, False: 2.09k]
  |  |  |  |  ------------------
  |  |  |  |  277|  5.25k|    int val = (int)value;\
  |  |  |  |  278|  5.25k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  5.25k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  5.25k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  5.25k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  5.25k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  5.25k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  5.25k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  5.25k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  5.25k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.25k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  5.25k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.25k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  5.25k|  } else {\
  |  |  |  |  283|  2.09k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.09k|    s->bi_valid += len;\
  |  |  |  |  285|  2.09k|  }\
  |  |  |  |  286|  7.35k|}
  |  |  ------------------
  ------------------
  951|  7.35k|}
trees.c:send_all_trees:
  834|  6.23k|                          int blcodes) {
  835|  6.23k|    int rank;                    /* index in bl_order */
  836|       |
  837|  6.23k|    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  838|  6.23k|    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  839|  6.23k|            "too many codes");
  840|  6.23k|    Tracev((stderr, "\nbl counts: "));
  841|  6.23k|    send_bits(s, lcodes - 257, 5);  /* not +255 as stated in appnote.txt */
  ------------------
  |  |  274|  6.23k|#define send_bits(s, value, length) \
  |  |  275|  6.23k|{ int len = length;\
  |  |  276|  6.23k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  6.23k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 6.23k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  6.23k|  } else {\
  |  |  283|  6.23k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  6.23k|    s->bi_valid += len;\
  |  |  285|  6.23k|  }\
  |  |  286|  6.23k|}
  ------------------
  842|  6.23k|    send_bits(s, dcodes - 1,   5);
  ------------------
  |  |  274|  6.23k|#define send_bits(s, value, length) \
  |  |  275|  6.23k|{ int len = length;\
  |  |  276|  6.23k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  6.23k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 2.41k, False: 3.82k]
  |  |  ------------------
  |  |  277|  2.41k|    int val = (int)value;\
  |  |  278|  2.41k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  2.41k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.41k|#define put_short(s, w) { \
  |  |  |  |  145|  2.41k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.41k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.41k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.41k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.41k|}
  |  |  ------------------
  |  |  280|  2.41k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.41k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  2.41k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.41k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.82k|  } else {\
  |  |  283|  3.82k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  3.82k|    s->bi_valid += len;\
  |  |  285|  3.82k|  }\
  |  |  286|  6.23k|}
  ------------------
  843|  6.23k|    send_bits(s, blcodes - 4,  4);  /* not -3 as stated in appnote.txt */
  ------------------
  |  |  274|  6.23k|#define send_bits(s, value, length) \
  |  |  275|  6.23k|{ int len = length;\
  |  |  276|  6.23k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  6.23k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 3.82k, False: 2.41k]
  |  |  ------------------
  |  |  277|  3.82k|    int val = (int)value;\
  |  |  278|  3.82k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  3.82k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  3.82k|#define put_short(s, w) { \
  |  |  |  |  145|  3.82k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  3.82k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  3.82k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  3.82k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  3.82k|}
  |  |  ------------------
  |  |  280|  3.82k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  3.82k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  3.82k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  3.82k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.82k|  } else {\
  |  |  283|  2.41k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  2.41k|    s->bi_valid += len;\
  |  |  285|  2.41k|  }\
  |  |  286|  6.23k|}
  ------------------
  844|   114k|    for (rank = 0; rank < blcodes; rank++) {
  ------------------
  |  Branch (844:20): [True: 108k, False: 6.23k]
  ------------------
  845|   108k|        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
  846|   108k|        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
  ------------------
  |  |  274|   108k|#define send_bits(s, value, length) \
  |  |  275|   108k|{ int len = length;\
  |  |  276|   108k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   108k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 18.5k, False: 89.9k]
  |  |  ------------------
  |  |  277|  18.5k|    int val = (int)value;\
  |  |  278|  18.5k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  18.5k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  18.5k|#define put_short(s, w) { \
  |  |  |  |  145|  18.5k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  18.5k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  18.5k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  18.5k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  18.5k|}
  |  |  ------------------
  |  |  280|  18.5k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  18.5k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  18.5k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  18.5k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  89.9k|  } else {\
  |  |  283|  89.9k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  89.9k|    s->bi_valid += len;\
  |  |  285|  89.9k|  }\
  |  |  286|   108k|}
  ------------------
  847|   108k|    }
  848|  6.23k|    Tracev((stderr, "\nbl tree: sent %lu", s->bits_sent));
  849|       |
  850|  6.23k|    send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
  851|  6.23k|    Tracev((stderr, "\nlit tree: sent %lu", s->bits_sent));
  852|       |
  853|  6.23k|    send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
  854|  6.23k|    Tracev((stderr, "\ndist tree: sent %lu", s->bits_sent));
  855|  6.23k|}
trees.c:send_tree:
  753|  12.4k|local void send_tree(deflate_state *s, ct_data *tree, int max_code) {
  754|  12.4k|    int n;                     /* iterates over all tree elements */
  755|  12.4k|    int prevlen = -1;          /* last emitted length */
  756|  12.4k|    int curlen;                /* length of current code */
  757|  12.4k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  12.4k|#define Len  dl.len
  ------------------
  758|  12.4k|    int count = 0;             /* repeat count of the current code */
  759|  12.4k|    int max_count = 7;         /* max repeat count */
  760|  12.4k|    int min_count = 4;         /* min repeat count */
  761|       |
  762|       |    /* tree[max_code + 1].Len = -1; */  /* guard already set */
  763|  12.4k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (763:9): [True: 1.85k, False: 10.6k]
  ------------------
  764|       |
  765|  1.81M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (765:17): [True: 1.79M, False: 12.4k]
  ------------------
  766|  1.79M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  1.79M|#define Len  dl.len
  ------------------
  767|  1.79M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (767:13): [True: 1.76M, False: 39.1k]
  |  Branch (767:36): [True: 633k, False: 1.12M]
  ------------------
  768|   633k|            continue;
  769|  1.16M|        } else if (count < min_count) {
  ------------------
  |  Branch (769:20): [True: 1.07M, False: 87.7k]
  ------------------
  770|  1.19M|            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
  ------------------
  |  |  239|  1.19M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  1.19M|#define send_bits(s, value, length) \
  |  |  |  |  275|  1.19M|{ int len = length;\
  |  |  |  |  276|  1.19M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.19M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 190k, False: 1.00M]
  |  |  |  |  ------------------
  |  |  |  |  277|   190k|    int val = (int)value;\
  |  |  |  |  278|   190k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   190k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   190k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   190k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   190k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   190k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   190k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   190k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   190k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   190k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   190k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   190k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  1.00M|  } else {\
  |  |  |  |  283|  1.00M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  1.00M|    s->bi_valid += len;\
  |  |  |  |  285|  1.00M|  }\
  |  |  |  |  286|  1.19M|}
  |  |  ------------------
  ------------------
  |  Branch (770:61): [True: 117k, False: 1.07M]
  ------------------
  771|       |
  772|  1.07M|        } else if (curlen != 0) {
  ------------------
  |  Branch (772:20): [True: 67.2k, False: 20.4k]
  ------------------
  773|  67.2k|            if (curlen != prevlen) {
  ------------------
  |  Branch (773:17): [True: 40.5k, False: 26.6k]
  ------------------
  774|  40.5k|                send_code(s, curlen, s->bl_tree); count--;
  ------------------
  |  |  239|  40.5k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  40.5k|#define send_bits(s, value, length) \
  |  |  |  |  275|  40.5k|{ int len = length;\
  |  |  |  |  276|  40.5k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  40.5k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 6.80k, False: 33.7k]
  |  |  |  |  ------------------
  |  |  |  |  277|  6.80k|    int val = (int)value;\
  |  |  |  |  278|  6.80k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  6.80k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  6.80k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  6.80k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  6.80k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  6.80k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  6.80k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  6.80k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  6.80k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.80k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  6.80k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.80k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  33.7k|  } else {\
  |  |  |  |  283|  33.7k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  33.7k|    s->bi_valid += len;\
  |  |  |  |  285|  33.7k|  }\
  |  |  |  |  286|  40.5k|}
  |  |  ------------------
  ------------------
  775|  40.5k|            }
  776|  67.2k|            Assert(count >= 3 && count <= 6, " 3_6?");
  777|  67.2k|            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  239|  67.2k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  67.2k|#define send_bits(s, value, length) \
  |  |  |  |  275|  67.2k|{ int len = length;\
  |  |  |  |  276|  67.2k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  67.2k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 13.4k, False: 53.7k]
  |  |  |  |  ------------------
  |  |  |  |  277|  13.4k|    int val = (int)value;\
  |  |  |  |  278|  13.4k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  13.4k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  13.4k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  13.4k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  13.4k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  13.4k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  13.4k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  13.4k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  13.4k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  13.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  13.4k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  13.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  53.7k|  } else {\
  |  |  |  |  283|  53.7k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  53.7k|    s->bi_valid += len;\
  |  |  |  |  285|  53.7k|  }\
  |  |  |  |  286|  67.2k|}
  |  |  ------------------
  ------------------
                          send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  274|  67.2k|#define send_bits(s, value, length) \
  |  |  275|  67.2k|{ int len = length;\
  |  |  276|  67.2k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  67.2k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 8.55k, False: 58.6k]
  |  |  ------------------
  |  |  277|  8.55k|    int val = (int)value;\
  |  |  278|  8.55k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  8.55k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  8.55k|#define put_short(s, w) { \
  |  |  |  |  145|  8.55k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  8.55k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  8.55k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  8.55k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  8.55k|}
  |  |  ------------------
  |  |  280|  8.55k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  8.55k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  8.55k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  8.55k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  58.6k|  } else {\
  |  |  283|  58.6k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  58.6k|    s->bi_valid += len;\
  |  |  285|  58.6k|  }\
  |  |  286|  67.2k|}
  ------------------
  778|       |
  779|  67.2k|        } else if (count <= 10) {
  ------------------
  |  Branch (779:20): [True: 15.0k, False: 5.47k]
  ------------------
  780|  15.0k|            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  239|  15.0k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  15.0k|#define send_bits(s, value, length) \
  |  |  |  |  275|  15.0k|{ int len = length;\
  |  |  |  |  276|  15.0k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  15.0k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 4.25k, False: 10.7k]
  |  |  |  |  ------------------
  |  |  |  |  277|  4.25k|    int val = (int)value;\
  |  |  |  |  278|  4.25k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  4.25k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  4.25k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  4.25k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  4.25k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  4.25k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  4.25k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  4.25k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  4.25k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.25k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  4.25k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.25k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  10.7k|  } else {\
  |  |  |  |  283|  10.7k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  10.7k|    s->bi_valid += len;\
  |  |  |  |  285|  10.7k|  }\
  |  |  |  |  286|  15.0k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  274|  15.0k|#define send_bits(s, value, length) \
  |  |  275|  15.0k|{ int len = length;\
  |  |  276|  15.0k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  15.0k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 2.80k, False: 12.2k]
  |  |  ------------------
  |  |  277|  2.80k|    int val = (int)value;\
  |  |  278|  2.80k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  2.80k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.80k|#define put_short(s, w) { \
  |  |  |  |  145|  2.80k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.80k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.80k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.80k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.80k|}
  |  |  ------------------
  |  |  280|  2.80k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.80k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  2.80k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.80k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  12.2k|  } else {\
  |  |  283|  12.2k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  12.2k|    s->bi_valid += len;\
  |  |  285|  12.2k|  }\
  |  |  286|  15.0k|}
  ------------------
  781|       |
  782|  15.0k|        } else {
  783|  5.47k|            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  239|  5.47k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  5.47k|#define send_bits(s, value, length) \
  |  |  |  |  275|  5.47k|{ int len = length;\
  |  |  |  |  276|  5.47k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.47k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 1.72k, False: 3.74k]
  |  |  |  |  ------------------
  |  |  |  |  277|  1.72k|    int val = (int)value;\
  |  |  |  |  278|  1.72k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  1.72k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  1.72k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  1.72k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  1.72k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.72k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  1.72k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.72k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  1.72k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.72k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  1.72k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.72k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  3.74k|  } else {\
  |  |  |  |  283|  3.74k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  3.74k|    s->bi_valid += len;\
  |  |  |  |  285|  3.74k|  }\
  |  |  |  |  286|  5.47k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  274|  5.47k|#define send_bits(s, value, length) \
  |  |  275|  5.47k|{ int len = length;\
  |  |  276|  5.47k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  5.47k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 2.37k, False: 3.10k]
  |  |  ------------------
  |  |  277|  2.37k|    int val = (int)value;\
  |  |  278|  2.37k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  2.37k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.37k|#define put_short(s, w) { \
  |  |  |  |  145|  2.37k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.37k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.37k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.37k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.37k|}
  |  |  ------------------
  |  |  280|  2.37k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.37k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  2.37k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.37k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.10k|  } else {\
  |  |  283|  3.10k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  3.10k|    s->bi_valid += len;\
  |  |  285|  3.10k|  }\
  |  |  286|  5.47k|}
  ------------------
  784|  5.47k|        }
  785|  1.16M|        count = 0; prevlen = curlen;
  786|  1.16M|        if (nextlen == 0) {
  ------------------
  |  Branch (786:13): [True: 322k, False: 844k]
  ------------------
  787|   322k|            max_count = 138, min_count = 3;
  788|   844k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (788:20): [True: 33.2k, False: 810k]
  ------------------
  789|  33.2k|            max_count = 6, min_count = 3;
  790|   810k|        } else {
  791|   810k|            max_count = 7, min_count = 4;
  792|   810k|        }
  793|  1.16M|    }
  794|  12.4k|}

zcalloc:
  303|  17.1k|voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
  304|  17.1k|    (void)opaque;
  305|  17.1k|    return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
  ------------------
  |  Branch (305:12): [True: 17.1k, Folded]
  ------------------
  306|  17.1k|                              (voidpf)calloc(items, size);
  307|  17.1k|}
zcfree:
  309|  17.1k|void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
  310|  17.1k|    (void)opaque;
  311|  17.1k|    free(ptr);
  312|  17.1k|}

