_ZN10FuzzHelperC2EPKhm:
   22|  2.13k|{
   23|  2.13k|}
_ZN10FuzzHelper8doChecksEv:
   27|  2.13k|{
   28|  2.13k|    Pl_Discard discard;
   29|  2.13k|    Pl_Flate p("decode", &discard, Pl_Flate::a_deflate);
   30|  2.13k|    p.write(const_cast<unsigned char*>(data), size);
   31|  2.13k|    p.finish();
   32|  2.13k|}
_ZN10FuzzHelper3runEv:
   36|  2.13k|{
   37|  2.13k|    try {
   38|  2.13k|        doChecks();
   39|  2.13k|    } catch (std::runtime_error const& e) {
   40|      0|        std::cerr << "runtime_error: " << e.what() << std::endl;
   41|      0|    }
   42|  2.13k|}
LLVMFuzzerTestOneInput:
   46|  2.13k|{
   47|  2.13k|    FuzzHelper f(data, size);
   48|  2.13k|    f.run();
   49|  2.13k|    return 0;
   50|  2.13k|}

_ZN8PipelineD2Ev:
   53|  4.27k|    virtual ~Pipeline() = default;

_ZN5QIntC7to_uintImEEjRKT_:
  207|  11.6k|    {
  208|  11.6k|        return IntConverter<T, unsigned int>::convert(i);
  209|  11.6k|    }
_ZN5QIntC12IntConverterImjLb0ELb0EE7convertERKm:
   68|  11.6k|        {
   69|       |            // From and To are both unsigned.
   70|  11.6k|            if (i > std::numeric_limits<To>::max()) {
  ------------------
  |  Branch (70:17): [True: 0, False: 11.6k]
  ------------------
   71|      0|                error(i);
   72|      0|            }
   73|  11.6k|            return static_cast<To>(i);
   74|  11.6k|        }
_ZN5QIntC7to_sizeIjEEmRKT_:
  214|  2.13k|    {
  215|  2.13k|        return IntConverter<T, size_t>::convert(i);
  216|  2.13k|    }
_ZN5QIntC12IntConverterIjmLb0ELb0EE7convertERKj:
   68|  2.13k|        {
   69|       |            // From and To are both unsigned.
   70|  2.13k|            if (i > std::numeric_limits<To>::max()) {
  ------------------
  |  Branch (70:17): [True: 0, False: 2.13k]
  ------------------
   71|      0|                error(i);
   72|      0|            }
   73|  2.13k|            return static_cast<To>(i);
   74|  2.13k|        }
_ZN5QIntC8to_ulongImEEmRKT_:
  235|  5.24k|    {
  236|  5.24k|        return IntConverter<T, unsigned long>::convert(i);
  237|  5.24k|    }
_ZN5QIntC12IntConverterImmLb0ELb0EE7convertERKm:
   68|  5.24k|        {
   69|       |            // From and To are both unsigned.
   70|  5.24k|            if (i > std::numeric_limits<To>::max()) {
  ------------------
  |  Branch (70:17): [True: 0, False: 5.24k]
  ------------------
   71|      0|                error(i);
   72|      0|            }
   73|  5.24k|            return static_cast<To>(i);
   74|  5.24k|        }

_ZN5QUtil17make_shared_arrayIhEENSt3__110shared_ptrIT_EEm:
  181|  2.13k|    {
  182|  2.13k|        return std::shared_ptr<T>(new T[n], std::default_delete<T[]>());
  183|  2.13k|    }

_ZN8PipelineC2EPKcPS_:
    9|  4.27k|{
   10|  4.27k|}
_ZN8Pipeline7getNextEb:
   14|  7.38k|{
   15|  7.38k|    if ((this->next == nullptr) && (!allow_null)) {
  ------------------
  |  Branch (15:9): [True: 0, False: 7.38k]
  |  Branch (15:36): [True: 0, False: 0]
  ------------------
   16|      0|        throw std::logic_error(
   17|      0|            this->identifier + ": Pipeline::getNext() called on pipeline with no next");
   18|      0|    }
   19|  7.38k|    return this->next;
   20|  7.38k|}

_ZN10Pl_DiscardC2Ev:
    7|  2.13k|{
    8|  2.13k|}
_ZN10Pl_DiscardD2Ev:
   11|  2.13k|{
   12|       |    // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
   13|  2.13k|}
_ZN10Pl_Discard5writeEPKhm:
   17|  5.24k|{
   18|  5.24k|}
_ZN10Pl_Discard6finishEv:
   22|  2.13k|{
   23|  2.13k|}

_ZN8Pl_Flate7MembersC2EmNS_8action_eE:
   22|  2.13k|{
   23|  2.13k|    this->outbuf = QUtil::make_shared_array<unsigned char>(out_bufsize);
   24|       |    // Indirect through zdata to reach the z_stream so we don't have to include zlib.h in
   25|       |    // Pl_Flate.hh.  This means people using shared library versions of qpdf don't have to have zlib
   26|       |    // development files available, which particularly helps in a Windows environment.
   27|  2.13k|    this->zdata = new z_stream;
   28|       |
   29|  2.13k|    if (out_bufsize > UINT_MAX) {
  ------------------
  |  Branch (29:9): [True: 0, False: 2.13k]
  ------------------
   30|      0|        throw std::runtime_error(
   31|      0|            "Pl_Flate: zlib doesn't support buffer sizes larger than unsigned int");
   32|      0|    }
   33|       |
   34|  2.13k|    z_stream& zstream = *(static_cast<z_stream*>(this->zdata));
   35|  2.13k|    zstream.zalloc = nullptr;
   36|  2.13k|    zstream.zfree = nullptr;
   37|  2.13k|    zstream.opaque = nullptr;
   38|  2.13k|    zstream.next_in = nullptr;
   39|  2.13k|    zstream.avail_in = 0;
   40|  2.13k|    zstream.next_out = this->outbuf.get();
   41|  2.13k|    zstream.avail_out = QIntC::to_uint(out_bufsize);
   42|  2.13k|}
_ZN8Pl_Flate7MembersD2Ev:
   45|  2.13k|{
   46|  2.13k|    if (this->initialized) {
  ------------------
  |  Branch (46:9): [True: 0, False: 2.13k]
  ------------------
   47|      0|        z_stream& zstream = *(static_cast<z_stream*>(this->zdata));
   48|      0|        if (action == a_deflate) {
  ------------------
  |  Branch (48:13): [True: 0, False: 0]
  ------------------
   49|      0|            deflateEnd(&zstream);
   50|      0|        } else {
   51|      0|            inflateEnd(&zstream);
   52|      0|        }
   53|      0|    }
   54|       |
   55|  2.13k|    delete static_cast<z_stream*>(this->zdata);
   56|  2.13k|    this->zdata = nullptr;
   57|  2.13k|}
_ZN8Pl_FlateC2EPKcP8PipelineNS_8action_eEj:
   63|  2.13k|{
   64|  2.13k|}
_ZN8Pl_FlateD2Ev:
   67|  2.13k|{
   68|       |    // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
   69|  2.13k|}
_ZN8Pl_Flate5writeEPKhm:
   93|  2.13k|{
   94|  2.13k|    if (m->outbuf == nullptr) {
  ------------------
  |  Branch (94:9): [True: 0, False: 2.13k]
  ------------------
   95|      0|        throw std::logic_error(
   96|      0|            this->identifier + ": Pl_Flate: write() called after finish() called");
   97|      0|    }
   98|       |
   99|       |    // Write in chunks in case len is too big to fit in an int. Assume int is at least 32 bits.
  100|  2.13k|    static size_t const max_bytes = 1 << 30;
  101|  2.13k|    size_t bytes_left = len;
  102|  2.13k|    unsigned char const* buf = data;
  103|  4.27k|    while (bytes_left > 0) {
  ------------------
  |  Branch (103:12): [True: 2.13k, False: 2.13k]
  ------------------
  104|  2.13k|        size_t bytes = (bytes_left >= max_bytes ? max_bytes : bytes_left);
  ------------------
  |  Branch (104:25): [True: 0, False: 2.13k]
  ------------------
  105|  2.13k|        handleData(buf, bytes, (m->action == a_inflate ? Z_SYNC_FLUSH : Z_NO_FLUSH));
  ------------------
  |  Branch (105:33): [True: 0, False: 2.13k]
  ------------------
  106|  2.13k|        bytes_left -= bytes;
  107|  2.13k|        buf += bytes;
  108|  2.13k|    }
  109|  2.13k|}
_ZN8Pl_Flate10handleDataEPKhmi:
  113|  4.27k|{
  114|  4.27k|    if (len > UINT_MAX) {
  ------------------
  |  Branch (114:9): [True: 0, False: 4.27k]
  ------------------
  115|      0|        throw std::runtime_error("Pl_Flate: zlib doesn't support data blocks larger than int");
  116|      0|    }
  117|  4.27k|    z_stream& zstream = *(static_cast<z_stream*>(m->zdata));
  118|       |    // zlib is known not to modify the data pointed to by next_in but doesn't declare the field
  119|       |    // value const unless compiled to do so.
  120|  4.27k|    zstream.next_in = const_cast<unsigned char*>(data);
  121|  4.27k|    zstream.avail_in = QIntC::to_uint(len);
  122|       |
  123|  4.27k|    if (!m->initialized) {
  ------------------
  |  Branch (123:9): [True: 2.13k, False: 2.13k]
  ------------------
  124|  2.13k|        int err = Z_OK;
  125|       |
  126|       |        // deflateInit and inflateInit are macros that use old-style casts.
  127|  2.13k|#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || defined(__clang__))
  128|  2.13k|# pragma GCC diagnostic push
  129|  2.13k|# pragma GCC diagnostic ignored "-Wold-style-cast"
  130|  2.13k|#endif
  131|  2.13k|        if (m->action == a_deflate) {
  ------------------
  |  Branch (131:13): [True: 2.13k, False: 0]
  ------------------
  132|  2.13k|            err = deflateInit(&zstream, compression_level);
  133|  2.13k|        } else {
  134|      0|            err = inflateInit(&zstream);
  135|      0|        }
  136|  2.13k|#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || defined(__clang__))
  137|  2.13k|# pragma GCC diagnostic pop
  138|  2.13k|#endif
  139|       |
  140|  2.13k|        checkError("Init", err);
  141|  2.13k|        m->initialized = true;
  142|  2.13k|    }
  143|       |
  144|  4.27k|    int err = Z_OK;
  145|       |
  146|  4.27k|    bool done = false;
  147|  9.52k|    while (!done) {
  ------------------
  |  Branch (147:12): [True: 5.24k, False: 4.27k]
  ------------------
  148|  5.24k|        if (m->action == a_deflate) {
  ------------------
  |  Branch (148:13): [True: 5.24k, False: 0]
  ------------------
  149|  5.24k|            err = deflate(&zstream, flush);
  150|  5.24k|        } else {
  151|      0|            err = inflate(&zstream, flush);
  152|      0|        }
  153|  5.24k|        if ((m->action == a_inflate) && (err != Z_OK) && zstream.msg &&
  ------------------
  |  Branch (153:13): [True: 0, False: 5.24k]
  |  Branch (153:41): [True: 0, False: 0]
  |  Branch (153:58): [True: 0, False: 0]
  ------------------
  154|  5.24k|            (strcmp(zstream.msg, "incorrect data check") == 0)) {
  ------------------
  |  Branch (154:13): [True: 0, False: 0]
  ------------------
  155|       |            // Other PDF readers ignore this specific error. Combining this with Z_SYNC_FLUSH
  156|       |            // enables qpdf to handle some broken zlib streams without losing data.
  157|      0|            err = Z_STREAM_END;
  158|      0|        }
  159|  5.24k|        switch (err) {
  160|      0|        case Z_BUF_ERROR:
  ------------------
  |  Branch (160:9): [True: 0, False: 5.24k]
  ------------------
  161|       |            // Probably shouldn't be able to happen, but possible as a boundary condition: if the
  162|       |            // last call to inflate exactly filled the output buffer, it's possible that the next
  163|       |            // call to inflate could have nothing to do. There are PDF files in the wild that have
  164|       |            // this error (including at least one in qpdf's test suite). In some cases, we want to
  165|       |            // know about this, because it indicates incorrect compression, so call a callback if
  166|       |            // provided.
  167|      0|            this->warn("input stream is complete but output may still be valid", err);
  168|      0|            done = true;
  169|      0|            break;
  170|       |
  171|  2.13k|        case Z_STREAM_END:
  ------------------
  |  Branch (171:9): [True: 2.13k, False: 3.10k]
  ------------------
  172|  2.13k|            done = true;
  173|       |            // fall through
  174|       |
  175|  5.24k|        case Z_OK:
  ------------------
  |  Branch (175:9): [True: 3.10k, False: 2.13k]
  ------------------
  176|  5.24k|            {
  177|  5.24k|                if ((zstream.avail_in == 0) && (zstream.avail_out > 0)) {
  ------------------
  |  Branch (177:21): [True: 4.41k, False: 834]
  |  Branch (177:48): [True: 4.27k, False: 135]
  ------------------
  178|       |                    // There is nothing left to read, and there was sufficient buffer space to write
  179|       |                    // everything we needed, so we're done for now.
  180|  4.27k|                    done = true;
  181|  4.27k|                }
  182|  5.24k|                uLong ready = QIntC::to_ulong(m->out_bufsize - zstream.avail_out);
  183|  5.24k|                if (ready > 0) {
  ------------------
  |  Branch (183:21): [True: 5.24k, False: 4]
  ------------------
  184|  5.24k|                    if (memory_limit) {
  ------------------
  |  Branch (184:25): [True: 0, False: 5.24k]
  ------------------
  185|      0|                        m->written += ready;
  186|      0|                        if (m->written > memory_limit) {
  ------------------
  |  Branch (186:29): [True: 0, False: 0]
  ------------------
  187|      0|                            throw std::runtime_error("PL_Flate memory limit exceeded");
  188|      0|                        }
  189|      0|                    }
  190|  5.24k|                    this->getNext()->write(m->outbuf.get(), ready);
  191|  5.24k|                    zstream.next_out = m->outbuf.get();
  192|  5.24k|                    zstream.avail_out = QIntC::to_uint(m->out_bufsize);
  193|  5.24k|                }
  194|  5.24k|            }
  195|  5.24k|            break;
  196|       |
  197|  5.24k|        default:
  ------------------
  |  Branch (197:9): [True: 0, False: 5.24k]
  ------------------
  198|      0|            this->checkError("data", err);
  199|      0|            break;
  200|  5.24k|        }
  201|  5.24k|    }
  202|  4.27k|}
_ZN8Pl_Flate6finishEv:
  206|  2.13k|{
  207|  2.13k|    if (m->written > memory_limit) {
  ------------------
  |  Branch (207:9): [True: 0, False: 2.13k]
  ------------------
  208|      0|        return;
  209|      0|    }
  210|  2.13k|    try {
  211|  2.13k|        if (m->outbuf.get()) {
  ------------------
  |  Branch (211:13): [True: 2.13k, False: 0]
  ------------------
  212|  2.13k|            if (m->initialized) {
  ------------------
  |  Branch (212:17): [True: 2.13k, False: 0]
  ------------------
  213|  2.13k|                z_stream& zstream = *(static_cast<z_stream*>(m->zdata));
  214|  2.13k|                unsigned char buf[1];
  215|  2.13k|                buf[0] = '\0';
  216|  2.13k|                handleData(buf, 0, Z_FINISH);
  217|  2.13k|                int err = Z_OK;
  218|  2.13k|                if (m->action == a_deflate) {
  ------------------
  |  Branch (218:21): [True: 2.13k, False: 0]
  ------------------
  219|  2.13k|                    err = deflateEnd(&zstream);
  220|  2.13k|                } else {
  221|      0|                    err = inflateEnd(&zstream);
  222|      0|                }
  223|  2.13k|                m->initialized = false;
  224|  2.13k|                checkError("End", err);
  225|  2.13k|            }
  226|       |
  227|  2.13k|            m->outbuf = nullptr;
  228|  2.13k|        }
  229|  2.13k|    } catch (std::exception& e) {
  230|      0|        try {
  231|      0|            this->getNext()->finish();
  232|      0|        } catch (...) {
  233|       |            // ignore secondary exception
  234|      0|        }
  235|      0|        throw std::runtime_error(e.what());
  236|      0|    }
  237|  2.13k|    this->getNext()->finish();
  238|  2.13k|}
_ZN8Pl_Flate10checkErrorEPKci:
  248|  4.27k|{
  249|  4.27k|    z_stream& zstream = *(static_cast<z_stream*>(m->zdata));
  250|  4.27k|    if (error_code != Z_OK) {
  ------------------
  |  Branch (250:9): [True: 0, False: 4.27k]
  ------------------
  251|      0|        char const* action_str = (m->action == a_deflate ? "deflate" : "inflate");
  ------------------
  |  Branch (251:35): [True: 0, False: 0]
  ------------------
  252|      0|        std::string msg = this->identifier + ": " + action_str + ": " + prefix + ": ";
  253|       |
  254|      0|        if (zstream.msg) {
  ------------------
  |  Branch (254:13): [True: 0, False: 0]
  ------------------
  255|      0|            msg += zstream.msg;
  256|      0|        } else {
  257|      0|            switch (error_code) {
  258|      0|            case Z_ERRNO:
  ------------------
  |  Branch (258:13): [True: 0, False: 0]
  ------------------
  259|      0|                msg += "zlib system error";
  260|      0|                break;
  261|       |
  262|      0|            case Z_STREAM_ERROR:
  ------------------
  |  Branch (262:13): [True: 0, False: 0]
  ------------------
  263|      0|                msg += "zlib stream error";
  264|      0|                break;
  265|       |
  266|      0|            case Z_DATA_ERROR:
  ------------------
  |  Branch (266:13): [True: 0, False: 0]
  ------------------
  267|      0|                msg += "zlib data error";
  268|      0|                break;
  269|       |
  270|      0|            case Z_MEM_ERROR:
  ------------------
  |  Branch (270:13): [True: 0, False: 0]
  ------------------
  271|      0|                msg += "zlib memory error";
  272|      0|                break;
  273|       |
  274|      0|            case Z_BUF_ERROR:
  ------------------
  |  Branch (274:13): [True: 0, False: 0]
  ------------------
  275|      0|                msg += "zlib buffer error";
  276|      0|                break;
  277|       |
  278|      0|            case Z_VERSION_ERROR:
  ------------------
  |  Branch (278:13): [True: 0, False: 0]
  ------------------
  279|      0|                msg += "zlib version error";
  280|      0|                break;
  281|       |
  282|      0|            default:
  ------------------
  |  Branch (282:13): [True: 0, False: 0]
  ------------------
  283|      0|                msg += std::string("zlib unknown error (") + std::to_string(error_code) + ")";
  284|      0|                break;
  285|      0|            }
  286|      0|        }
  287|       |
  288|      0|        throw std::runtime_error(msg);
  289|      0|    }
  290|  4.27k|}

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

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

_tr_init:
  456|  2.13k|void ZLIB_INTERNAL _tr_init(deflate_state *s) {
  457|  2.13k|    tr_static_init();
  458|       |
  459|  2.13k|    s->l_desc.dyn_tree = s->dyn_ltree;
  460|  2.13k|    s->l_desc.stat_desc = &static_l_desc;
  461|       |
  462|  2.13k|    s->d_desc.dyn_tree = s->dyn_dtree;
  463|  2.13k|    s->d_desc.stat_desc = &static_d_desc;
  464|       |
  465|  2.13k|    s->bl_desc.dyn_tree = s->bl_tree;
  466|  2.13k|    s->bl_desc.stat_desc = &static_bl_desc;
  467|       |
  468|  2.13k|    s->bi_buf = 0;
  469|  2.13k|    s->bi_valid = 0;
  470|  2.13k|    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.13k|    init_block(s);
  478|  2.13k|}
_tr_stored_block:
  861|  1.68k|                                    ulg stored_len, int last) {
  862|  1.68k|    send_bits(s, (STORED_BLOCK<<1) + last, 3);  /* send block type */
  ------------------
  |  |  274|  1.68k|#define send_bits(s, value, length) \
  |  |  275|  1.68k|{ int len = length;\
  |  |  276|  1.68k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  1.68k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 1.68k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.68k|  } else {\
  |  |  283|  1.68k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.68k|    s->bi_valid += len;\
  |  |  285|  1.68k|  }\
  |  |  286|  1.68k|}
  ------------------
  863|  1.68k|    bi_windup(s);        /* align on byte boundary */
  864|  1.68k|    put_short(s, (ush)stored_len);
  ------------------
  |  |  144|  1.68k|#define put_short(s, w) { \
  |  |  145|  1.68k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|  1.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  1.68k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|  1.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  1.68k|}
  ------------------
  865|  1.68k|    put_short(s, (ush)~stored_len);
  ------------------
  |  |  144|  1.68k|#define put_short(s, w) { \
  |  |  145|  1.68k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|  1.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  1.68k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|  1.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  1.68k|}
  ------------------
  866|  1.68k|    if (stored_len)
  ------------------
  |  Branch (866:9): [True: 1.68k, False: 0]
  ------------------
  867|  1.68k|        zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
  ------------------
  |  |  210|  1.68k|#    define zmemcpy memcpy
  ------------------
  868|  1.68k|    s->pending += stored_len;
  869|       |#ifdef ZLIB_DEBUG
  870|       |    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
  871|       |    s->compressed_len += (stored_len + 4) << 3;
  872|       |    s->bits_sent += 2*16;
  873|       |    s->bits_sent += stored_len << 3;
  874|       |#endif
  875|  1.68k|}
_tr_flush_bits:
  880|  12.9k|void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) {
  881|  12.9k|    bi_flush(s);
  882|  12.9k|}
_tr_flush_block:
  998|  7.71k|                                   ulg stored_len, int last) {
  999|  7.71k|    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
 1000|  7.71k|    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|  7.71k|    if (s->level > 0) {
  ------------------
  |  Branch (1003:9): [True: 7.71k, False: 0]
  ------------------
 1004|       |
 1005|       |        /* Check if the file is binary or text */
 1006|  7.71k|        if (s->strm->data_type == Z_UNKNOWN)
  ------------------
  |  |  206|  7.71k|#define Z_UNKNOWN  2
  ------------------
  |  Branch (1006:13): [True: 2.13k, False: 5.57k]
  ------------------
 1007|  2.13k|            s->strm->data_type = detect_data_type(s);
 1008|       |
 1009|       |        /* Construct the literal and distance trees */
 1010|  7.71k|        build_tree(s, (tree_desc *)(&(s->l_desc)));
 1011|  7.71k|        Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
 1012|  7.71k|                s->static_len));
 1013|       |
 1014|  7.71k|        build_tree(s, (tree_desc *)(&(s->d_desc)));
 1015|  7.71k|        Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
 1016|  7.71k|                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|  7.71k|        max_blindex = build_bl_tree(s);
 1025|       |
 1026|       |        /* Determine the best encoding. Compute the block lengths in bytes. */
 1027|  7.71k|        opt_lenb = (s->opt_len + 3 + 7) >> 3;
 1028|  7.71k|        static_lenb = (s->static_len + 3 + 7) >> 3;
 1029|       |
 1030|  7.71k|        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
 1031|  7.71k|                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
 1032|  7.71k|                s->sym_next / 3));
 1033|       |
 1034|  7.71k|#ifndef FORCE_STATIC
 1035|  7.71k|        if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
  ------------------
  |  |  199|  6.40k|#define Z_FIXED               4
  ------------------
  |  Branch (1035:13): [True: 1.30k, False: 6.40k]
  |  Branch (1035:40): [True: 0, False: 6.40k]
  ------------------
 1036|  1.30k|#endif
 1037|  1.30k|            opt_lenb = static_lenb;
 1038|       |
 1039|  7.71k|    } 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|  7.71k|    if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
  ------------------
  |  Branch (1047:9): [True: 1.68k, False: 6.03k]
  |  Branch (1047:39): [True: 1.68k, False: 0]
  ------------------
 1048|       |                       /* 4: two words for the lengths */
 1049|  1.68k|#endif
 1050|       |        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
 1051|       |         * Otherwise we can't have processed more than WSIZE input bytes since
 1052|       |         * the last block flush, because compression would have been
 1053|       |         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
 1054|       |         * transform a block into a stored block.
 1055|       |         */
 1056|  1.68k|        _tr_stored_block(s, buf, stored_len, last);
 1057|       |
 1058|  6.03k|    } else if (static_lenb == opt_lenb) {
  ------------------
  |  Branch (1058:16): [True: 1.10k, False: 4.93k]
  ------------------
 1059|  1.10k|        send_bits(s, (STATIC_TREES<<1) + last, 3);
  ------------------
  |  |  274|  1.10k|#define send_bits(s, value, length) \
  |  |  275|  1.10k|{ int len = length;\
  |  |  276|  1.10k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  1.10k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 1.10k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.10k|  } else {\
  |  |  283|  1.10k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.10k|    s->bi_valid += len;\
  |  |  285|  1.10k|  }\
  |  |  286|  1.10k|}
  ------------------
 1060|  1.10k|        compress_block(s, (const ct_data *)static_ltree,
 1061|  1.10k|                       (const ct_data *)static_dtree);
 1062|       |#ifdef ZLIB_DEBUG
 1063|       |        s->compressed_len += 3 + s->static_len;
 1064|       |#endif
 1065|  4.93k|    } else {
 1066|  4.93k|        send_bits(s, (DYN_TREES<<1) + last, 3);
  ------------------
  |  |  274|  4.93k|#define send_bits(s, value, length) \
  |  |  275|  4.93k|{ int len = length;\
  |  |  276|  4.93k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.93k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 4.93k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  4.93k|  } else {\
  |  |  283|  4.93k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  4.93k|    s->bi_valid += len;\
  |  |  285|  4.93k|  }\
  |  |  286|  4.93k|}
  ------------------
 1067|  4.93k|        send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
 1068|  4.93k|                       max_blindex + 1);
 1069|  4.93k|        compress_block(s, (const ct_data *)s->dyn_ltree,
 1070|  4.93k|                       (const ct_data *)s->dyn_dtree);
 1071|       |#ifdef ZLIB_DEBUG
 1072|       |        s->compressed_len += 3 + s->opt_len;
 1073|       |#endif
 1074|  4.93k|    }
 1075|  7.71k|    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|  7.71k|    init_block(s);
 1080|       |
 1081|  7.71k|    if (last) {
  ------------------
  |  Branch (1081:9): [True: 2.13k, False: 5.57k]
  ------------------
 1082|  2.13k|        bi_windup(s);
 1083|       |#ifdef ZLIB_DEBUG
 1084|       |        s->compressed_len += 7;  /* align on byte boundary */
 1085|       |#endif
 1086|  2.13k|    }
 1087|  7.71k|    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
 1088|  7.71k|           s->compressed_len - 7*last));
 1089|  7.71k|}
trees.c:tr_static_init:
  295|  2.13k|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.13k|}
trees.c:init_block:
  440|  9.84k|local void init_block(deflate_state *s) {
  441|  9.84k|    int n; /* iterates over tree elements */
  442|       |
  443|       |    /* Initialize the trees. */
  444|  2.82M|    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   40|  2.82M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   37|  2.82M|#define LITERALS  256
  |  |  ------------------
  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   34|  2.82M|#define LENGTH_CODES 29
  |  |  ------------------
  ------------------
                  for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   83|  2.81M|#define Freq fc.freq
  ------------------
  |  Branch (444:17): [True: 2.81M, False: 9.84k]
  ------------------
  445|   305k|    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   43|   305k|#define D_CODES   30
  ------------------
                  for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   83|   295k|#define Freq fc.freq
  ------------------
  |  Branch (445:17): [True: 295k, False: 9.84k]
  ------------------
  446|   196k|    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   46|   196k|#define BL_CODES  19
  ------------------
                  for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   83|   187k|#define Freq fc.freq
  ------------------
  |  Branch (446:17): [True: 187k, False: 9.84k]
  ------------------
  447|       |
  448|  9.84k|    s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   50|  9.84k|#define END_BLOCK 256
  ------------------
                  s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   83|  9.84k|#define Freq fc.freq
  ------------------
  449|  9.84k|    s->opt_len = s->static_len = 0L;
  450|  9.84k|    s->sym_next = s->matches = 0;
  451|  9.84k|}
trees.c:bi_windup:
  181|  3.81k|local void bi_windup(deflate_state *s) {
  182|  3.81k|    if (s->bi_valid > 8) {
  ------------------
  |  Branch (182:9): [True: 966, False: 2.85k]
  ------------------
  183|    966|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|    966|#define put_short(s, w) { \
  |  |  145|    966|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|    966|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|    966|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|    966|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|    966|}
  ------------------
  184|  2.85k|    } else if (s->bi_valid > 0) {
  ------------------
  |  Branch (184:16): [True: 2.59k, False: 254]
  ------------------
  185|  2.59k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  290|  2.59k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  186|  2.59k|    }
  187|  3.81k|    s->bi_used = ((s->bi_valid - 1) & 7) + 1;
  188|  3.81k|    s->bi_buf = 0;
  189|  3.81k|    s->bi_valid = 0;
  190|       |#ifdef ZLIB_DEBUG
  191|       |    s->bits_sent = (s->bits_sent + 7) & ~7;
  192|       |#endif
  193|  3.81k|}
trees.c:bi_flush:
  166|  12.9k|local void bi_flush(deflate_state *s) {
  167|  12.9k|    if (s->bi_valid == 16) {
  ------------------
  |  Branch (167:9): [True: 303, False: 12.6k]
  ------------------
  168|    303|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|    303|#define put_short(s, w) { \
  |  |  145|    303|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|    303|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|    303|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|    303|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|    303|}
  ------------------
  169|    303|        s->bi_buf = 0;
  170|    303|        s->bi_valid = 0;
  171|  12.6k|    } else if (s->bi_valid >= 8) {
  ------------------
  |  Branch (171:16): [True: 2.11k, False: 10.5k]
  ------------------
  172|  2.11k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  290|  2.11k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  173|  2.11k|        s->bi_buf >>= 8;
  174|  2.11k|        s->bi_valid -= 8;
  175|  2.11k|    }
  176|  12.9k|}
trees.c:detect_data_type:
  966|  2.13k|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.13k|    unsigned long block_mask = 0xf3ffc07fUL;
  972|  2.13k|    int n;
  973|       |
  974|       |    /* Check for non-textual ("block-listed") bytes. */
  975|  13.3k|    for (n = 0; n <= 31; n++, block_mask >>= 1)
  ------------------
  |  Branch (975:17): [True: 13.0k, False: 324]
  ------------------
  976|  13.0k|        if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
  ------------------
  |  |   83|  9.91k|#define Freq fc.freq
  ------------------
  |  Branch (976:13): [True: 9.91k, False: 3.10k]
  |  Branch (976:33): [True: 1.81k, False: 8.10k]
  ------------------
  977|  1.81k|            return Z_BINARY;
  ------------------
  |  |  203|  1.81k|#define Z_BINARY   0
  ------------------
  978|       |
  979|       |    /* Check for textual ("allow-listed") bytes. */
  980|    324|    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    324|#define Freq fc.freq
  ------------------
                  if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    311|#define Freq fc.freq
  ------------------
  |  Branch (980:9): [True: 13, False: 311]
  |  Branch (980:38): [True: 23, False: 288]
  ------------------
  981|    324|            || s->dyn_ltree[13].Freq != 0)
  ------------------
  |  |   83|    288|#define Freq fc.freq
  ------------------
  |  Branch (981:16): [True: 14, False: 274]
  ------------------
  982|     50|        return Z_TEXT;
  ------------------
  |  |  204|     50|#define Z_TEXT     1
  ------------------
  983|  36.3k|    for (n = 32; n < LITERALS; n++)
  ------------------
  |  |   37|  36.3k|#define LITERALS  256
  ------------------
  |  Branch (983:18): [True: 36.2k, False: 9]
  ------------------
  984|  36.2k|        if (s->dyn_ltree[n].Freq != 0)
  ------------------
  |  |   83|  36.2k|#define Freq fc.freq
  ------------------
  |  Branch (984:13): [True: 265, False: 36.0k]
  ------------------
  985|    265|            return Z_TEXT;
  ------------------
  |  |  204|    539|#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|      9|    return Z_BINARY;
  ------------------
  |  |  203|      9|#define Z_BINARY   0
  ------------------
  991|    274|}
trees.c:build_tree:
  627|  23.1k|local void build_tree(deflate_state *s, tree_desc *desc) {
  628|  23.1k|    ct_data *tree         = desc->dyn_tree;
  629|  23.1k|    const ct_data *stree  = desc->stat_desc->static_tree;
  630|  23.1k|    int elems             = desc->stat_desc->elems;
  631|  23.1k|    int n, m;          /* iterate over heap elements */
  632|  23.1k|    int max_code = -1; /* largest code with non zero frequency */
  633|  23.1k|    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|  23.1k|    s->heap_len = 0, s->heap_max = HEAP_SIZE;
  ------------------
  |  |   49|  23.1k|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  23.1k|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  23.1k|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  23.1k|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|       |
  641|  2.60M|    for (n = 0; n < elems; n++) {
  ------------------
  |  Branch (641:17): [True: 2.58M, False: 23.1k]
  ------------------
  642|  2.58M|        if (tree[n].Freq != 0) {
  ------------------
  |  |   83|  2.58M|#define Freq fc.freq
  ------------------
  |  Branch (642:13): [True: 1.58M, False: 994k]
  ------------------
  643|  1.58M|            s->heap[++(s->heap_len)] = max_code = n;
  644|  1.58M|            s->depth[n] = 0;
  645|  1.58M|        } else {
  646|   994k|            tree[n].Len = 0;
  ------------------
  |  |   86|   994k|#define Len  dl.len
  ------------------
  647|   994k|        }
  648|  2.58M|    }
  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|  28.3k|    while (s->heap_len < 2) {
  ------------------
  |  Branch (655:12): [True: 5.22k, False: 23.1k]
  ------------------
  656|  5.22k|        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
  ------------------
  |  Branch (656:44): [True: 4.48k, False: 737]
  ------------------
  657|  5.22k|        tree[node].Freq = 1;
  ------------------
  |  |   83|  5.22k|#define Freq fc.freq
  ------------------
  658|  5.22k|        s->depth[node] = 0;
  659|  5.22k|        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
  ------------------
  |  |   86|  5.22k|#define Len  dl.len
  ------------------
  |  Branch (659:27): [True: 5.22k, False: 0]
  ------------------
  660|       |        /* node is 0 or 1 so it does not have extra bits */
  661|  5.22k|    }
  662|  23.1k|    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|   815k|    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
  ------------------
  |  Branch (667:29): [True: 792k, False: 23.1k]
  ------------------
  668|       |
  669|       |    /* Construct the Huffman tree by repeatedly combining the least two
  670|       |     * frequent nodes.
  671|       |     */
  672|  23.1k|    node = elems;              /* next internal node of the tree */
  673|  1.57M|    do {
  674|  1.57M|        pqremove(s, tree, n);  /* n = node of least frequency */
  ------------------
  |  |  488|  1.57M|#define pqremove(s, tree, top) \
  |  |  489|  1.57M|{\
  |  |  490|  1.57M|    top = s->heap[SMALLEST]; \
  |  |  ------------------
  |  |  |  |  480|  1.57M|#define SMALLEST 1
  |  |  ------------------
  |  |  491|  1.57M|    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
  |  |  ------------------
  |  |  |  |  480|  1.57M|#define SMALLEST 1
  |  |  ------------------
  |  |  492|  1.57M|    pqdownheap(s, tree, SMALLEST); \
  |  |  ------------------
  |  |  |  |  480|  1.57M|#define SMALLEST 1
  |  |  ------------------
  |  |  493|  1.57M|}
  ------------------
  675|  1.57M|        m = s->heap[SMALLEST]; /* m = node of next least frequency */
  ------------------
  |  |  480|  1.57M|#define SMALLEST 1
  ------------------
  676|       |
  677|  1.57M|        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
  678|  1.57M|        s->heap[--(s->heap_max)] = m;
  679|       |
  680|       |        /* Create a new node father of n and m */
  681|  1.57M|        tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.57M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.57M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.57M|#define Freq fc.freq
  ------------------
  682|  1.57M|        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
  ------------------
  |  Branch (682:33): [True: 1.41M, False: 159k]
  ------------------
  683|  1.41M|                                s->depth[n] : s->depth[m]) + 1);
  684|  1.57M|        tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  1.57M|#define Dad  dl.dad
  ------------------
                      tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  1.57M|#define Dad  dl.dad
  ------------------
  685|       |#ifdef DUMP_BL_TREE
  686|       |        if (tree == s->bl_tree) {
  687|       |            fprintf(stderr,"\nnode %d(%d), sons %d(%d) %d(%d)",
  688|       |                    node, tree[node].Freq, n, tree[n].Freq, m, tree[m].Freq);
  689|       |        }
  690|       |#endif
  691|       |        /* and insert the new node in the heap */
  692|  1.57M|        s->heap[SMALLEST] = node++;
  ------------------
  |  |  480|  1.57M|#define SMALLEST 1
  ------------------
  693|  1.57M|        pqdownheap(s, tree, SMALLEST);
  ------------------
  |  |  480|  1.57M|#define SMALLEST 1
  ------------------
  694|       |
  695|  1.57M|    } while (s->heap_len >= 2);
  ------------------
  |  Branch (695:14): [True: 1.54M, False: 23.1k]
  ------------------
  696|       |
  697|  23.1k|    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
  ------------------
  |  |  480|  23.1k|#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|  23.1k|    gen_bitlen(s, (tree_desc *)desc);
  703|       |
  704|       |    /* The field len is now set, we can generate the bit codes */
  705|  23.1k|    gen_codes ((ct_data *)tree, max_code, s->bl_count);
  706|  23.1k|}
trees.c:pqdownheap:
  509|  3.93M|local void pqdownheap(deflate_state *s, ct_data *tree, int k) {
  510|  3.93M|    int v = s->heap[k];
  511|  3.93M|    int j = k << 1;  /* left son of k */
  512|  20.1M|    while (j <= s->heap_len) {
  ------------------
  |  Branch (512:12): [True: 17.1M, False: 3.00M]
  ------------------
  513|       |        /* Set j to the smallest of the two sons: */
  514|  17.1M|        if (j < s->heap_len &&
  ------------------
  |  Branch (514:13): [True: 16.9M, False: 217k]
  ------------------
  515|  17.1M|            smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
  ------------------
  |  |  500|  16.9M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  16.9M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  33.8M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 4.66M, False: 12.2M]
  |  |  ------------------
  |  |  501|  16.9M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  12.2M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  24.5M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 3.85M, False: 8.41M]
  |  |  |  Branch (501:37): [True: 3.52M, False: 332k]
  |  |  ------------------
  ------------------
  516|  8.18M|            j++;
  517|  8.18M|        }
  518|       |        /* Exit if v is smaller than both sons */
  519|  17.1M|        if (smaller(tree, v, s->heap[j], s->depth)) break;
  ------------------
  |  |  500|  17.1M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  17.1M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  34.3M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 665k, False: 16.4M]
  |  |  ------------------
  |  |  501|  17.1M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  16.4M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  32.9M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 361k, False: 16.1M]
  |  |  |  Branch (501:37): [True: 260k, False: 100k]
  |  |  ------------------
  ------------------
  520|       |
  521|       |        /* Exchange v with the smallest son */
  522|  16.2M|        s->heap[k] = s->heap[j];  k = j;
  523|       |
  524|       |        /* And continue down the tree, setting j to the left son of k */
  525|  16.2M|        j <<= 1;
  526|  16.2M|    }
  527|  3.93M|    s->heap[k] = v;
  528|  3.93M|}
trees.c:gen_bitlen:
  540|  23.1k|local void gen_bitlen(deflate_state *s, tree_desc *desc) {
  541|  23.1k|    ct_data *tree        = desc->dyn_tree;
  542|  23.1k|    int max_code         = desc->max_code;
  543|  23.1k|    const ct_data *stree = desc->stat_desc->static_tree;
  544|  23.1k|    const intf *extra    = desc->stat_desc->extra_bits;
  545|  23.1k|    int base             = desc->stat_desc->extra_base;
  546|  23.1k|    int max_length       = desc->stat_desc->max_length;
  547|  23.1k|    int h;              /* heap index */
  548|  23.1k|    int n, m;           /* iterate over the tree elements */
  549|  23.1k|    int bits;           /* bit length */
  550|  23.1k|    int xbits;          /* extra bits */
  551|  23.1k|    ush f;              /* frequency */
  552|  23.1k|    int overflow = 0;   /* number of elements with bit length too large */
  553|       |
  554|   393k|    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
  ------------------
  |  |   52|   393k|#define MAX_BITS 15
  ------------------
  |  Branch (554:20): [True: 370k, False: 23.1k]
  ------------------
  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|  23.1k|    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
  ------------------
  |  |   86|  23.1k|#define Len  dl.len
  ------------------
  560|       |
  561|  3.16M|    for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
  ------------------
  |  |   49|  3.16M|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  3.16M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  3.16M|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.16M|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (561:31): [True: 3.14M, False: 23.1k]
  ------------------
  562|  3.14M|        n = s->heap[h];
  563|  3.14M|        bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   85|  3.14M|#define Dad  dl.dad
  ------------------
                      bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   86|  3.14M|#define Len  dl.len
  ------------------
  564|  3.14M|        if (bits > max_length) bits = max_length, overflow++;
  ------------------
  |  Branch (564:13): [True: 7.29k, False: 3.13M]
  ------------------
  565|  3.14M|        tree[n].Len = (ush)bits;
  ------------------
  |  |   86|  3.14M|#define Len  dl.len
  ------------------
  566|       |        /* We overwrite tree[n].Dad which is no longer needed */
  567|       |
  568|  3.14M|        if (n > max_code) continue; /* not a leaf node */
  ------------------
  |  Branch (568:13): [True: 1.54M, False: 1.59M]
  ------------------
  569|       |
  570|  1.59M|        s->bl_count[bits]++;
  571|  1.59M|        xbits = 0;
  572|  1.59M|        if (n >= base) xbits = extra[n - base];
  ------------------
  |  Branch (572:13): [True: 192k, False: 1.40M]
  ------------------
  573|  1.59M|        f = tree[n].Freq;
  ------------------
  |  |   83|  1.59M|#define Freq fc.freq
  ------------------
  574|  1.59M|        s->opt_len += (ulg)f * (unsigned)(bits + xbits);
  575|  1.59M|        if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
  ------------------
  |  |   86|  1.51M|#define Len  dl.len
  ------------------
  |  Branch (575:13): [True: 1.51M, False: 80.3k]
  ------------------
  576|  1.59M|    }
  577|  23.1k|    if (overflow == 0) return;
  ------------------
  |  Branch (577:9): [True: 20.8k, False: 2.27k]
  ------------------
  578|       |
  579|  2.27k|    Tracev((stderr,"\nbit length overflow\n"));
  580|       |    /* This happens for example on obj2 and pic of the Calgary corpus */
  581|       |
  582|       |    /* Find the first bit length which could increase: */
  583|  3.64k|    do {
  584|  3.64k|        bits = max_length - 1;
  585|  4.69k|        while (s->bl_count[bits] == 0) bits--;
  ------------------
  |  Branch (585:16): [True: 1.04k, False: 3.64k]
  ------------------
  586|  3.64k|        s->bl_count[bits]--;        /* move one leaf down the tree */
  587|  3.64k|        s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
  588|  3.64k|        s->bl_count[max_length]--;
  589|       |        /* The brother of the overflow item also moves one step up,
  590|       |         * but this does not affect bl_count[max_length]
  591|       |         */
  592|  3.64k|        overflow -= 2;
  593|  3.64k|    } while (overflow > 0);
  ------------------
  |  Branch (593:14): [True: 1.36k, False: 2.27k]
  ------------------
  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|  19.1k|    for (bits = max_length; bits != 0; bits--) {
  ------------------
  |  Branch (600:29): [True: 16.8k, False: 2.27k]
  ------------------
  601|  16.8k|        n = s->bl_count[bits];
  602|   122k|        while (n != 0) {
  ------------------
  |  Branch (602:16): [True: 105k, False: 16.8k]
  ------------------
  603|   105k|            m = s->heap[--h];
  604|   105k|            if (m > max_code) continue;
  ------------------
  |  Branch (604:17): [True: 46.7k, False: 59.1k]
  ------------------
  605|  59.1k|            if ((unsigned) tree[m].Len != (unsigned) bits) {
  ------------------
  |  |   86|  59.1k|#define Len  dl.len
  ------------------
  |  Branch (605:17): [True: 3.65k, False: 55.5k]
  ------------------
  606|  3.65k|                Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
  607|  3.65k|                s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   86|  3.65k|#define Len  dl.len
  ------------------
                              s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   83|  3.65k|#define Freq fc.freq
  ------------------
  608|  3.65k|                tree[m].Len = (ush)bits;
  ------------------
  |  |   86|  3.65k|#define Len  dl.len
  ------------------
  609|  3.65k|            }
  610|  59.1k|            n--;
  611|  59.1k|        }
  612|  16.8k|    }
  613|  2.27k|}
trees.c:gen_codes:
  203|  23.1k|local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) {
  204|  23.1k|    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
  205|  23.1k|    unsigned code = 0;         /* running code value */
  206|  23.1k|    int bits;                  /* bit index */
  207|  23.1k|    int n;                     /* code index */
  208|       |
  209|       |    /* The distribution counts are first used to generate the code values
  210|       |     * without bit reversal.
  211|       |     */
  212|   370k|    for (bits = 1; bits <= MAX_BITS; bits++) {
  ------------------
  |  |   52|   370k|#define MAX_BITS 15
  ------------------
  |  Branch (212:20): [True: 346k, False: 23.1k]
  ------------------
  213|   346k|        code = (code + bl_count[bits - 1]) << 1;
  214|   346k|        next_code[bits] = (ush)code;
  215|   346k|    }
  216|       |    /* Check that the bit counts in bl_count are consistent. The last code
  217|       |     * must be all ones.
  218|       |     */
  219|  23.1k|    Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
  220|  23.1k|            "inconsistent bit counts");
  221|  23.1k|    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
  222|       |
  223|  2.35M|    for (n = 0;  n <= max_code; n++) {
  ------------------
  |  Branch (223:18): [True: 2.33M, False: 23.1k]
  ------------------
  224|  2.33M|        int len = tree[n].Len;
  ------------------
  |  |   86|  2.33M|#define Len  dl.len
  ------------------
  225|  2.33M|        if (len == 0) continue;
  ------------------
  |  Branch (225:13): [True: 737k, False: 1.59M]
  ------------------
  226|       |        /* Now reverse the bits */
  227|  1.59M|        tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
  ------------------
  |  |   84|  1.59M|#define Code fc.code
  ------------------
  228|       |
  229|  1.59M|        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
  230|  1.59M|            n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1));
  231|  1.59M|    }
  232|  23.1k|}
trees.c:bi_reverse:
  154|  1.59M|local unsigned bi_reverse(unsigned code, int len) {
  155|  1.59M|    register unsigned res = 0;
  156|  12.7M|    do {
  157|  12.7M|        res |= code & 1;
  158|  12.7M|        code >>= 1, res <<= 1;
  159|  12.7M|    } while (--len > 0);
  ------------------
  |  Branch (159:14): [True: 11.1M, False: 1.59M]
  ------------------
  160|  1.59M|    return res >> 1;
  161|  1.59M|}
trees.c:build_bl_tree:
  800|  7.71k|local int build_bl_tree(deflate_state *s) {
  801|  7.71k|    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|  7.71k|    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
  805|  7.71k|    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
  806|       |
  807|       |    /* Build the bit length tree: */
  808|  7.71k|    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.0k|    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
  ------------------
  |  |   46|  7.71k|#define BL_CODES  19
  ------------------
  |  Branch (817:36): [True: 20.0k, False: 0]
  ------------------
  818|  20.0k|        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
  ------------------
  |  |   86|  20.0k|#define Len  dl.len
  ------------------
  |  Branch (818:13): [True: 7.71k, False: 12.3k]
  ------------------
  819|  20.0k|    }
  820|       |    /* Update opt_len to include the bit length tree and counts */
  821|  7.71k|    s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
  822|  7.71k|    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
  823|  7.71k|            s->opt_len, s->static_len));
  824|       |
  825|  7.71k|    return max_blindex;
  826|  7.71k|}
trees.c:scan_tree:
  712|  15.4k|local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
  713|  15.4k|    int n;                     /* iterates over all tree elements */
  714|  15.4k|    int prevlen = -1;          /* last emitted length */
  715|  15.4k|    int curlen;                /* length of current code */
  716|  15.4k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  15.4k|#define Len  dl.len
  ------------------
  717|  15.4k|    int count = 0;             /* repeat count of the current code */
  718|  15.4k|    int max_count = 7;         /* max repeat count */
  719|  15.4k|    int min_count = 4;         /* min repeat count */
  720|       |
  721|  15.4k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (721:9): [True: 3.06k, False: 12.3k]
  ------------------
  722|  15.4k|    tree[max_code + 1].Len = (ush)0xffff; /* guard */
  ------------------
  |  |   86|  15.4k|#define Len  dl.len
  ------------------
  723|       |
  724|  2.20M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (724:17): [True: 2.19M, False: 15.4k]
  ------------------
  725|  2.19M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  2.19M|#define Len  dl.len
  ------------------
  726|  2.19M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (726:13): [True: 2.09M, False: 100k]
  |  Branch (726:36): [True: 1.19M, False: 900k]
  ------------------
  727|  1.19M|            continue;
  728|  1.19M|        } else if (count < min_count) {
  ------------------
  |  Branch (728:20): [True: 842k, False: 157k]
  ------------------
  729|   842k|            s->bl_tree[curlen].Freq += (ush)count;
  ------------------
  |  |   83|   842k|#define Freq fc.freq
  ------------------
  730|   842k|        } else if (curlen != 0) {
  ------------------
  |  Branch (730:20): [True: 131k, False: 26.6k]
  ------------------
  731|   131k|            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
  ------------------
  |  |   83|  45.6k|#define Freq fc.freq
  ------------------
  |  Branch (731:17): [True: 45.6k, False: 85.4k]
  ------------------
  732|   131k|            s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   53|   131k|#define REP_3_6      16
  ------------------
                          s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   83|   131k|#define Freq fc.freq
  ------------------
  733|   131k|        } else if (count <= 10) {
  ------------------
  |  Branch (733:20): [True: 17.5k, False: 9.15k]
  ------------------
  734|  17.5k|            s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   56|  17.5k|#define REPZ_3_10    17
  ------------------
                          s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   83|  17.5k|#define Freq fc.freq
  ------------------
  735|  17.5k|        } else {
  736|  9.15k|            s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   59|  9.15k|#define REPZ_11_138  18
  ------------------
                          s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   83|  9.15k|#define Freq fc.freq
  ------------------
  737|  9.15k|        }
  738|  1.00M|        count = 0; prevlen = curlen;
  739|  1.00M|        if (nextlen == 0) {
  ------------------
  |  Branch (739:13): [True: 230k, False: 769k]
  ------------------
  740|   230k|            max_count = 138, min_count = 3;
  741|   769k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (741:20): [True: 93.2k, False: 676k]
  ------------------
  742|  93.2k|            max_count = 6, min_count = 3;
  743|   676k|        } else {
  744|   676k|            max_count = 7, min_count = 4;
  745|   676k|        }
  746|  1.00M|    }
  747|  15.4k|}
trees.c:compress_block:
  901|  6.03k|                          const ct_data *dtree) {
  902|  6.03k|    unsigned dist;      /* distance of matched string */
  903|  6.03k|    int lc;             /* match length or unmatched char (if dist == 0) */
  904|  6.03k|    unsigned sx = 0;    /* running index in symbol buffers */
  905|  6.03k|    unsigned code;      /* the code to send */
  906|  6.03k|    int extra;          /* number of extra bits to send */
  907|       |
  908|  71.2M|    if (s->sym_next != 0) do {
  ------------------
  |  Branch (908:9): [True: 5.97k, False: 51]
  ------------------
  909|       |#ifdef LIT_MEM
  910|       |        dist = s->d_buf[sx];
  911|       |        lc = s->l_buf[sx++];
  912|       |#else
  913|  71.2M|        dist = s->sym_buf[sx++] & 0xff;
  914|  71.2M|        dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
  915|  71.2M|        lc = s->sym_buf[sx++];
  916|  71.2M|#endif
  917|  71.2M|        if (dist == 0) {
  ------------------
  |  Branch (917:13): [True: 68.3M, False: 2.85M]
  ------------------
  918|  68.3M|            send_code(s, lc, ltree); /* send a literal byte */
  ------------------
  |  |  239|  68.3M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  68.3M|#define send_bits(s, value, length) \
  |  |  |  |  275|  68.3M|{ int len = length;\
  |  |  |  |  276|  68.3M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  68.3M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 28.4M, False: 39.8M]
  |  |  |  |  ------------------
  |  |  |  |  277|  28.4M|    int val = (int)value;\
  |  |  |  |  278|  28.4M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  28.4M|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  28.4M|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  28.4M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  28.4M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  28.4M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  28.4M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  28.4M|}
  |  |  |  |  ------------------
  |  |  |  |  280|  28.4M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  28.4M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  28.4M|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  28.4M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  39.8M|  } else {\
  |  |  |  |  283|  39.8M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  39.8M|    s->bi_valid += len;\
  |  |  |  |  285|  39.8M|  }\
  |  |  |  |  286|  68.3M|}
  |  |  ------------------
  ------------------
  919|  68.3M|            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
  920|  68.3M|        } else {
  921|       |            /* Here, lc is the match length - MIN_MATCH */
  922|  2.85M|            code = _length_code[lc];
  923|  2.85M|            send_code(s, code + LITERALS + 1, ltree);   /* send length code */
  ------------------
  |  |  239|  2.85M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  2.85M|#define send_bits(s, value, length) \
  |  |  |  |  275|  2.85M|{ int len = length;\
  |  |  |  |  276|  2.85M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.85M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 745k, False: 2.10M]
  |  |  |  |  ------------------
  |  |  |  |  277|   745k|    int val = (int)value;\
  |  |  |  |  278|   745k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   745k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   745k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   745k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   745k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   745k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   745k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   745k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   745k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   745k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   745k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   745k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  2.10M|  } else {\
  |  |  |  |  283|  2.10M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.10M|    s->bi_valid += len;\
  |  |  |  |  285|  2.10M|  }\
  |  |  |  |  286|  2.85M|}
  |  |  ------------------
  ------------------
  924|  2.85M|            extra = extra_lbits[code];
  925|  2.85M|            if (extra != 0) {
  ------------------
  |  Branch (925:17): [True: 482k, False: 2.37M]
  ------------------
  926|   482k|                lc -= base_length[code];
  927|   482k|                send_bits(s, lc, extra);       /* send the extra length bits */
  ------------------
  |  |  274|   482k|#define send_bits(s, value, length) \
  |  |  275|   482k|{ int len = length;\
  |  |  276|   482k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   482k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 70.6k, False: 411k]
  |  |  ------------------
  |  |  277|  70.6k|    int val = (int)value;\
  |  |  278|  70.6k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  70.6k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  70.6k|#define put_short(s, w) { \
  |  |  |  |  145|  70.6k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  70.6k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  70.6k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  70.6k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  70.6k|}
  |  |  ------------------
  |  |  280|  70.6k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  70.6k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  70.6k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  70.6k|#define Buf_size 16
  |  |  ------------------
  |  |  282|   411k|  } else {\
  |  |  283|   411k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   411k|    s->bi_valid += len;\
  |  |  285|   411k|  }\
  |  |  286|   482k|}
  ------------------
  928|   482k|            }
  929|  2.85M|            dist--; /* dist is now the match distance - 1 */
  930|  2.85M|            code = d_code(dist);
  ------------------
  |  |  318|  2.85M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  ------------------
  |  |  |  Branch (318:5): [True: 907k, False: 1.94M]
  |  |  ------------------
  ------------------
  931|  2.85M|            Assert (code < D_CODES, "bad d_code");
  932|       |
  933|  2.85M|            send_code(s, code, dtree);       /* send the distance code */
  ------------------
  |  |  239|  2.85M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  2.85M|#define send_bits(s, value, length) \
  |  |  |  |  275|  2.85M|{ int len = length;\
  |  |  |  |  276|  2.85M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  2.85M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 723k, False: 2.12M]
  |  |  |  |  ------------------
  |  |  |  |  277|   723k|    int val = (int)value;\
  |  |  |  |  278|   723k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   723k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   723k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   723k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   723k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   723k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   723k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   723k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   723k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   723k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   723k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   723k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  2.12M|  } else {\
  |  |  |  |  283|  2.12M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.12M|    s->bi_valid += len;\
  |  |  |  |  285|  2.12M|  }\
  |  |  |  |  286|  2.85M|}
  |  |  ------------------
  ------------------
  934|  2.85M|            extra = extra_dbits[code];
  935|  2.85M|            if (extra != 0) {
  ------------------
  |  Branch (935:17): [True: 2.61M, False: 239k]
  ------------------
  936|  2.61M|                dist -= (unsigned)base_dist[code];
  937|  2.61M|                send_bits(s, dist, extra);   /* send the extra distance bits */
  ------------------
  |  |  274|  2.61M|#define send_bits(s, value, length) \
  |  |  275|  2.61M|{ int len = length;\
  |  |  276|  2.61M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  2.61M|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.39M, False: 1.22M]
  |  |  ------------------
  |  |  277|  1.39M|    int val = (int)value;\
  |  |  278|  1.39M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  1.39M|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  1.39M|#define put_short(s, w) { \
  |  |  |  |  145|  1.39M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.39M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.39M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.39M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  1.39M|}
  |  |  ------------------
  |  |  280|  1.39M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  1.39M|#define Buf_size 16
  |  |  ------------------
  |  |  281|  1.39M|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  1.39M|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.39M|  } else {\
  |  |  283|  1.22M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.22M|    s->bi_valid += len;\
  |  |  285|  1.22M|  }\
  |  |  286|  2.61M|}
  ------------------
  938|  2.61M|            }
  939|  2.85M|        } /* 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|  71.2M|        Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
  946|  71.2M|#endif
  947|       |
  948|  71.2M|    } while (sx < s->sym_next);
  ------------------
  |  Branch (948:14): [True: 71.2M, False: 5.97k]
  ------------------
  949|       |
  950|  6.03k|    send_code(s, END_BLOCK, ltree);
  ------------------
  |  |  239|  6.03k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  6.03k|#define send_bits(s, value, length) \
  |  |  |  |  275|  6.03k|{ int len = length;\
  |  |  |  |  276|  6.03k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.03k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 4.24k, False: 1.78k]
  |  |  |  |  ------------------
  |  |  |  |  277|  4.24k|    int val = (int)value;\
  |  |  |  |  278|  4.24k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  4.24k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  4.24k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  4.24k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  4.24k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  4.24k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  4.24k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  4.24k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  4.24k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.24k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  4.24k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.24k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  4.24k|  } else {\
  |  |  |  |  283|  1.78k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  1.78k|    s->bi_valid += len;\
  |  |  |  |  285|  1.78k|  }\
  |  |  |  |  286|  6.03k|}
  |  |  ------------------
  ------------------
  951|  6.03k|}
trees.c:send_all_trees:
  834|  4.93k|                          int blcodes) {
  835|  4.93k|    int rank;                    /* index in bl_order */
  836|       |
  837|  4.93k|    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  838|  4.93k|    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  839|  4.93k|            "too many codes");
  840|  4.93k|    Tracev((stderr, "\nbl counts: "));
  841|  4.93k|    send_bits(s, lcodes - 257, 5);  /* not +255 as stated in appnote.txt */
  ------------------
  |  |  274|  4.93k|#define send_bits(s, value, length) \
  |  |  275|  4.93k|{ int len = length;\
  |  |  276|  4.93k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.93k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 4.93k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  4.93k|  } else {\
  |  |  283|  4.93k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  4.93k|    s->bi_valid += len;\
  |  |  285|  4.93k|  }\
  |  |  286|  4.93k|}
  ------------------
  842|  4.93k|    send_bits(s, dcodes - 1,   5);
  ------------------
  |  |  274|  4.93k|#define send_bits(s, value, length) \
  |  |  275|  4.93k|{ int len = length;\
  |  |  276|  4.93k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.93k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.72k, False: 3.20k]
  |  |  ------------------
  |  |  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)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.72k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.72k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  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.20k|  } else {\
  |  |  283|  3.20k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  3.20k|    s->bi_valid += len;\
  |  |  285|  3.20k|  }\
  |  |  286|  4.93k|}
  ------------------
  843|  4.93k|    send_bits(s, blcodes - 4,  4);  /* not -3 as stated in appnote.txt */
  ------------------
  |  |  274|  4.93k|#define send_bits(s, value, length) \
  |  |  275|  4.93k|{ int len = length;\
  |  |  276|  4.93k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.93k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 3.20k, False: 1.72k]
  |  |  ------------------
  |  |  277|  3.20k|    int val = (int)value;\
  |  |  278|  3.20k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  3.20k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  3.20k|#define put_short(s, w) { \
  |  |  |  |  145|  3.20k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  3.20k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  3.20k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  3.20k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  3.20k|}
  |  |  ------------------
  |  |  280|  3.20k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  3.20k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  3.20k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  3.20k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.20k|  } else {\
  |  |  283|  1.72k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.72k|    s->bi_valid += len;\
  |  |  285|  1.72k|  }\
  |  |  286|  4.93k|}
  ------------------
  844|  89.9k|    for (rank = 0; rank < blcodes; rank++) {
  ------------------
  |  Branch (844:20): [True: 84.9k, False: 4.93k]
  ------------------
  845|  84.9k|        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
  846|  84.9k|        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
  ------------------
  |  |  274|  84.9k|#define send_bits(s, value, length) \
  |  |  275|  84.9k|{ int len = length;\
  |  |  276|  84.9k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  84.9k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 14.6k, False: 70.3k]
  |  |  ------------------
  |  |  277|  14.6k|    int val = (int)value;\
  |  |  278|  14.6k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  14.6k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  14.6k|#define put_short(s, w) { \
  |  |  |  |  145|  14.6k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  14.6k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  14.6k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  14.6k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  14.6k|}
  |  |  ------------------
  |  |  280|  14.6k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  14.6k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  14.6k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  14.6k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  70.3k|  } else {\
  |  |  283|  70.3k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  70.3k|    s->bi_valid += len;\
  |  |  285|  70.3k|  }\
  |  |  286|  84.9k|}
  ------------------
  847|  84.9k|    }
  848|  4.93k|    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
  849|       |
  850|  4.93k|    send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
  851|  4.93k|    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
  852|       |
  853|  4.93k|    send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
  854|  4.93k|    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
  855|  4.93k|}
trees.c:send_tree:
  753|  9.86k|local void send_tree(deflate_state *s, ct_data *tree, int max_code) {
  754|  9.86k|    int n;                     /* iterates over all tree elements */
  755|  9.86k|    int prevlen = -1;          /* last emitted length */
  756|  9.86k|    int curlen;                /* length of current code */
  757|  9.86k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  9.86k|#define Len  dl.len
  ------------------
  758|  9.86k|    int count = 0;             /* repeat count of the current code */
  759|  9.86k|    int max_count = 7;         /* max repeat count */
  760|  9.86k|    int min_count = 4;         /* min repeat count */
  761|       |
  762|       |    /* tree[max_code + 1].Len = -1; */  /* guard already set */
  763|  9.86k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (763:9): [True: 1.73k, False: 8.12k]
  ------------------
  764|       |
  765|  1.44M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (765:17): [True: 1.43M, False: 9.86k]
  ------------------
  766|  1.43M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  1.43M|#define Len  dl.len
  ------------------
  767|  1.43M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (767:13): [True: 1.38M, False: 41.2k]
  |  Branch (767:36): [True: 571k, False: 818k]
  ------------------
  768|   571k|            continue;
  769|   859k|        } else if (count < min_count) {
  ------------------
  |  Branch (769:20): [True: 776k, False: 82.6k]
  ------------------
  770|   883k|            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
  ------------------
  |  |  239|   883k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   883k|#define send_bits(s, value, length) \
  |  |  |  |  275|   883k|{ int len = length;\
  |  |  |  |  276|   883k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   883k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 141k, False: 741k]
  |  |  |  |  ------------------
  |  |  |  |  277|   141k|    int val = (int)value;\
  |  |  |  |  278|   141k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   141k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   141k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   141k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   141k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   141k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   141k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   141k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   141k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   141k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   141k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   141k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|   741k|  } else {\
  |  |  |  |  283|   741k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|   741k|    s->bi_valid += len;\
  |  |  |  |  285|   741k|  }\
  |  |  |  |  286|   883k|}
  |  |  ------------------
  ------------------
  |  Branch (770:61): [True: 106k, False: 776k]
  ------------------
  771|       |
  772|   776k|        } else if (curlen != 0) {
  ------------------
  |  Branch (772:20): [True: 68.2k, False: 14.3k]
  ------------------
  773|  68.2k|            if (curlen != prevlen) {
  ------------------
  |  Branch (773:17): [True: 38.6k, False: 29.6k]
  ------------------
  774|  38.6k|                send_code(s, curlen, s->bl_tree); count--;
  ------------------
  |  |  239|  38.6k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  38.6k|#define send_bits(s, value, length) \
  |  |  |  |  275|  38.6k|{ int len = length;\
  |  |  |  |  276|  38.6k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  38.6k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 5.68k, False: 32.9k]
  |  |  |  |  ------------------
  |  |  |  |  277|  5.68k|    int val = (int)value;\
  |  |  |  |  278|  5.68k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  5.68k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  5.68k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  5.68k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  5.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  5.68k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  5.68k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  5.68k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  5.68k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.68k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  5.68k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.68k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  32.9k|  } else {\
  |  |  |  |  283|  32.9k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  32.9k|    s->bi_valid += len;\
  |  |  |  |  285|  32.9k|  }\
  |  |  |  |  286|  38.6k|}
  |  |  ------------------
  ------------------
  775|  38.6k|            }
  776|  68.2k|            Assert(count >= 3 && count <= 6, " 3_6?");
  777|  68.2k|            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  239|  68.2k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  68.2k|#define send_bits(s, value, length) \
  |  |  |  |  275|  68.2k|{ int len = length;\
  |  |  |  |  276|  68.2k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  68.2k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 12.4k, False: 55.8k]
  |  |  |  |  ------------------
  |  |  |  |  277|  12.4k|    int val = (int)value;\
  |  |  |  |  278|  12.4k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  12.4k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  12.4k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  12.4k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  12.4k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  12.4k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  12.4k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  12.4k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  12.4k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  12.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  12.4k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  12.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  55.8k|  } else {\
  |  |  |  |  283|  55.8k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  55.8k|    s->bi_valid += len;\
  |  |  |  |  285|  55.8k|  }\
  |  |  |  |  286|  68.2k|}
  |  |  ------------------
  ------------------
                          send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  274|  68.2k|#define send_bits(s, value, length) \
  |  |  275|  68.2k|{ int len = length;\
  |  |  276|  68.2k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  68.2k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 8.59k, False: 59.6k]
  |  |  ------------------
  |  |  277|  8.59k|    int val = (int)value;\
  |  |  278|  8.59k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  8.59k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  8.59k|#define put_short(s, w) { \
  |  |  |  |  145|  8.59k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  8.59k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  8.59k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  8.59k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  8.59k|}
  |  |  ------------------
  |  |  280|  8.59k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  8.59k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  8.59k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  8.59k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  59.6k|  } else {\
  |  |  283|  59.6k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  59.6k|    s->bi_valid += len;\
  |  |  285|  59.6k|  }\
  |  |  286|  68.2k|}
  ------------------
  778|       |
  779|  68.2k|        } else if (count <= 10) {
  ------------------
  |  Branch (779:20): [True: 10.4k, False: 3.90k]
  ------------------
  780|  10.4k|            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  239|  10.4k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  10.4k|#define send_bits(s, value, length) \
  |  |  |  |  275|  10.4k|{ int len = length;\
  |  |  |  |  276|  10.4k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  10.4k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 3.21k, False: 7.25k]
  |  |  |  |  ------------------
  |  |  |  |  277|  3.21k|    int val = (int)value;\
  |  |  |  |  278|  3.21k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  3.21k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  3.21k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  3.21k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  3.21k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  3.21k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  3.21k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  3.21k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  3.21k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.21k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  3.21k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.21k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  7.25k|  } else {\
  |  |  |  |  283|  7.25k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  7.25k|    s->bi_valid += len;\
  |  |  |  |  285|  7.25k|  }\
  |  |  |  |  286|  10.4k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  274|  10.4k|#define send_bits(s, value, length) \
  |  |  275|  10.4k|{ int len = length;\
  |  |  276|  10.4k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  10.4k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.99k, False: 8.47k]
  |  |  ------------------
  |  |  277|  1.99k|    int val = (int)value;\
  |  |  278|  1.99k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  1.99k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  1.99k|#define put_short(s, w) { \
  |  |  |  |  145|  1.99k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.99k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.99k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.99k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  1.99k|}
  |  |  ------------------
  |  |  280|  1.99k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  1.99k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  1.99k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  1.99k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  8.47k|  } else {\
  |  |  283|  8.47k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  8.47k|    s->bi_valid += len;\
  |  |  285|  8.47k|  }\
  |  |  286|  10.4k|}
  ------------------
  781|       |
  782|  10.4k|        } else {
  783|  3.90k|            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  239|  3.90k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  3.90k|#define send_bits(s, value, length) \
  |  |  |  |  275|  3.90k|{ int len = length;\
  |  |  |  |  276|  3.90k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.90k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 1.24k, False: 2.65k]
  |  |  |  |  ------------------
  |  |  |  |  277|  1.24k|    int val = (int)value;\
  |  |  |  |  278|  1.24k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  1.24k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  1.24k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  1.24k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  1.24k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.24k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  1.24k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.24k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  1.24k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.24k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  1.24k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.24k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  2.65k|  } else {\
  |  |  |  |  283|  2.65k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.65k|    s->bi_valid += len;\
  |  |  |  |  285|  2.65k|  }\
  |  |  |  |  286|  3.90k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  274|  3.90k|#define send_bits(s, value, length) \
  |  |  275|  3.90k|{ int len = length;\
  |  |  276|  3.90k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  3.90k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.61k, False: 2.28k]
  |  |  ------------------
  |  |  277|  1.61k|    int val = (int)value;\
  |  |  278|  1.61k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  1.61k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  1.61k|#define put_short(s, w) { \
  |  |  |  |  145|  1.61k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.61k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.61k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.61k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  1.61k|}
  |  |  ------------------
  |  |  280|  1.61k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  1.61k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  1.61k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  1.61k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  2.28k|  } else {\
  |  |  283|  2.28k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  2.28k|    s->bi_valid += len;\
  |  |  285|  2.28k|  }\
  |  |  286|  3.90k|}
  ------------------
  784|  3.90k|        }
  785|   859k|        count = 0; prevlen = curlen;
  786|   859k|        if (nextlen == 0) {
  ------------------
  |  Branch (786:13): [True: 206k, False: 653k]
  ------------------
  787|   206k|            max_count = 138, min_count = 3;
  788|   653k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (788:20): [True: 35.8k, False: 617k]
  ------------------
  789|  35.8k|            max_count = 6, min_count = 3;
  790|   617k|        } else {
  791|   617k|            max_count = 7, min_count = 4;
  792|   617k|        }
  793|   859k|    }
  794|  9.86k|}

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

