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

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

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

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

_ZN8PipelineC2EPKcPS_:
    9|  4.38k|{
   10|  4.38k|}
_ZN8Pipeline7getNextEb:
   14|  7.77k|{
   15|  7.77k|    if ((this->next == nullptr) && (!allow_null)) {
  ------------------
  |  Branch (15:9): [True: 0, False: 7.77k]
  |  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.77k|    return this->next;
   20|  7.77k|}

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

_ZN8Pl_Flate7MembersC2EmNS_8action_eE:
   22|  2.19k|{
   23|  2.19k|    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.19k|    this->zdata = new z_stream;
   28|       |
   29|  2.19k|    if (out_bufsize > UINT_MAX) {
  ------------------
  |  Branch (29:9): [True: 0, False: 2.19k]
  ------------------
   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.19k|    z_stream& zstream = *(static_cast<z_stream*>(this->zdata));
   35|  2.19k|    zstream.zalloc = nullptr;
   36|  2.19k|    zstream.zfree = nullptr;
   37|  2.19k|    zstream.opaque = nullptr;
   38|  2.19k|    zstream.next_in = nullptr;
   39|  2.19k|    zstream.avail_in = 0;
   40|  2.19k|    zstream.next_out = this->outbuf.get();
   41|  2.19k|    zstream.avail_out = QIntC::to_uint(out_bufsize);
   42|  2.19k|}
_ZN8Pl_Flate7MembersD2Ev:
   45|  2.19k|{
   46|  2.19k|    if (this->initialized) {
  ------------------
  |  Branch (46:9): [True: 0, False: 2.19k]
  ------------------
   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.19k|    delete static_cast<z_stream*>(this->zdata);
   56|  2.19k|    this->zdata = nullptr;
   57|  2.19k|}
_ZN8Pl_FlateC2EPKcP8PipelineNS_8action_eEj:
   63|  2.19k|{
   64|  2.19k|}
_ZN8Pl_FlateD2Ev:
   67|  2.19k|{
   68|       |    // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
   69|  2.19k|}
_ZN8Pl_Flate5writeEPKhm:
   93|  2.19k|{
   94|  2.19k|    if (m->outbuf == nullptr) {
  ------------------
  |  Branch (94:9): [True: 0, False: 2.19k]
  ------------------
   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.19k|    static size_t const max_bytes = 1 << 30;
  101|  2.19k|    size_t bytes_left = len;
  102|  2.19k|    unsigned char const* buf = data;
  103|  4.38k|    while (bytes_left > 0) {
  ------------------
  |  Branch (103:12): [True: 2.19k, False: 2.19k]
  ------------------
  104|  2.19k|        size_t bytes = (bytes_left >= max_bytes ? max_bytes : bytes_left);
  ------------------
  |  Branch (104:25): [True: 0, False: 2.19k]
  ------------------
  105|  2.19k|        handleData(buf, bytes, (m->action == a_inflate ? Z_SYNC_FLUSH : Z_NO_FLUSH));
  ------------------
  |  Branch (105:33): [True: 0, False: 2.19k]
  ------------------
  106|  2.19k|        bytes_left -= bytes;
  107|  2.19k|        buf += bytes;
  108|  2.19k|    }
  109|  2.19k|}
_ZN8Pl_Flate10handleDataEPKhmi:
  113|  4.38k|{
  114|  4.38k|    if (len > UINT_MAX) {
  ------------------
  |  Branch (114:9): [True: 0, False: 4.38k]
  ------------------
  115|      0|        throw std::runtime_error("Pl_Flate: zlib doesn't support data blocks larger than int");
  116|      0|    }
  117|  4.38k|    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.38k|    zstream.next_in = const_cast<unsigned char*>(data);
  121|  4.38k|    zstream.avail_in = QIntC::to_uint(len);
  122|       |
  123|  4.38k|    if (!m->initialized) {
  ------------------
  |  Branch (123:9): [True: 2.19k, False: 2.19k]
  ------------------
  124|  2.19k|        int err = Z_OK;
  125|       |
  126|       |        // deflateInit and inflateInit are macros that use old-style casts.
  127|  2.19k|#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || defined(__clang__))
  128|  2.19k|# pragma GCC diagnostic push
  129|  2.19k|# pragma GCC diagnostic ignored "-Wold-style-cast"
  130|  2.19k|#endif
  131|  2.19k|        if (m->action == a_deflate) {
  ------------------
  |  Branch (131:13): [True: 2.19k, False: 0]
  ------------------
  132|  2.19k|            err = deflateInit(&zstream, compression_level);
  133|  2.19k|        } else {
  134|      0|            err = inflateInit(&zstream);
  135|      0|        }
  136|  2.19k|#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || defined(__clang__))
  137|  2.19k|# pragma GCC diagnostic pop
  138|  2.19k|#endif
  139|       |
  140|  2.19k|        checkError("Init", err);
  141|  2.19k|        m->initialized = true;
  142|  2.19k|    }
  143|       |
  144|  4.38k|    int err = Z_OK;
  145|       |
  146|  4.38k|    bool done = false;
  147|  9.96k|    while (!done) {
  ------------------
  |  Branch (147:12): [True: 5.58k, False: 4.38k]
  ------------------
  148|  5.58k|        if (m->action == a_deflate) {
  ------------------
  |  Branch (148:13): [True: 5.58k, False: 0]
  ------------------
  149|  5.58k|            err = deflate(&zstream, flush);
  150|  5.58k|        } else {
  151|      0|            err = inflate(&zstream, flush);
  152|      0|        }
  153|  5.58k|        if ((m->action == a_inflate) && (err != Z_OK) && zstream.msg &&
  ------------------
  |  Branch (153:13): [True: 0, False: 5.58k]
  |  Branch (153:41): [True: 0, False: 0]
  |  Branch (153:58): [True: 0, False: 0]
  ------------------
  154|  5.58k|            (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.58k|        switch (err) {
  160|      0|        case Z_BUF_ERROR:
  ------------------
  |  Branch (160:9): [True: 0, False: 5.58k]
  ------------------
  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.19k|        case Z_STREAM_END:
  ------------------
  |  Branch (171:9): [True: 2.19k, False: 3.39k]
  ------------------
  172|  2.19k|            done = true;
  173|       |            // fall through
  174|       |
  175|  5.58k|        case Z_OK:
  ------------------
  |  Branch (175:9): [True: 3.39k, False: 2.19k]
  ------------------
  176|  5.58k|            {
  177|  5.58k|                if ((zstream.avail_in == 0) && (zstream.avail_out > 0)) {
  ------------------
  |  Branch (177:21): [True: 4.52k, False: 1.06k]
  |  Branch (177:48): [True: 4.38k, False: 138]
  ------------------
  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.38k|                    done = true;
  181|  4.38k|                }
  182|  5.58k|                uLong ready = QIntC::to_ulong(m->out_bufsize - zstream.avail_out);
  183|  5.58k|                if (ready > 0) {
  ------------------
  |  Branch (183:21): [True: 5.58k, False: 3]
  ------------------
  184|  5.58k|                    if (memory_limit) {
  ------------------
  |  Branch (184:25): [True: 0, False: 5.58k]
  ------------------
  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.58k|                    this->getNext()->write(m->outbuf.get(), ready);
  191|  5.58k|                    zstream.next_out = m->outbuf.get();
  192|  5.58k|                    zstream.avail_out = QIntC::to_uint(m->out_bufsize);
  193|  5.58k|                }
  194|  5.58k|            }
  195|  5.58k|            break;
  196|       |
  197|  5.58k|        default:
  ------------------
  |  Branch (197:9): [True: 0, False: 5.58k]
  ------------------
  198|      0|            this->checkError("data", err);
  199|      0|            break;
  200|  5.58k|        }
  201|  5.58k|    }
  202|  4.38k|}
_ZN8Pl_Flate6finishEv:
  206|  2.19k|{
  207|  2.19k|    if (m->written > memory_limit) {
  ------------------
  |  Branch (207:9): [True: 0, False: 2.19k]
  ------------------
  208|      0|        return;
  209|      0|    }
  210|  2.19k|    try {
  211|  2.19k|        if (m->outbuf.get()) {
  ------------------
  |  Branch (211:13): [True: 2.19k, False: 0]
  ------------------
  212|  2.19k|            if (m->initialized) {
  ------------------
  |  Branch (212:17): [True: 2.19k, False: 0]
  ------------------
  213|  2.19k|                z_stream& zstream = *(static_cast<z_stream*>(m->zdata));
  214|  2.19k|                unsigned char buf[1];
  215|  2.19k|                buf[0] = '\0';
  216|  2.19k|                handleData(buf, 0, Z_FINISH);
  217|  2.19k|                int err = Z_OK;
  218|  2.19k|                if (m->action == a_deflate) {
  ------------------
  |  Branch (218:21): [True: 2.19k, False: 0]
  ------------------
  219|  2.19k|                    err = deflateEnd(&zstream);
  220|  2.19k|                } else {
  221|      0|                    err = inflateEnd(&zstream);
  222|      0|                }
  223|  2.19k|                m->initialized = false;
  224|  2.19k|                checkError("End", err);
  225|  2.19k|            }
  226|       |
  227|  2.19k|            m->outbuf = nullptr;
  228|  2.19k|        }
  229|  2.19k|    } 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.19k|    this->getNext()->finish();
  238|  2.19k|}
_ZN8Pl_Flate10checkErrorEPKci:
  248|  4.38k|{
  249|  4.38k|    z_stream& zstream = *(static_cast<z_stream*>(m->zdata));
  250|  4.38k|    if (error_code != Z_OK) {
  ------------------
  |  Branch (250:9): [True: 0, False: 4.38k]
  ------------------
  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.38k|}

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

deflateInit_:
  372|  2.19k|                         int stream_size) {
  373|  2.19k|    return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
  ------------------
  |  |  209|  2.19k|#define Z_DEFLATED   8
  ------------------
                  return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
  ------------------
  |  |  278|  2.19k|#  define MAX_WBITS   15 /* 32K LZ77 window */
  ------------------
                  return deflateInit2_(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL,
  ------------------
  |  |   75|  2.19k|#  define DEF_MEM_LEVEL 8
  ------------------
  374|  2.19k|                         Z_DEFAULT_STRATEGY, version, stream_size);
  ------------------
  |  |  200|  2.19k|#define Z_DEFAULT_STRATEGY    0
  ------------------
  375|       |    /* To do: ignore strm->next_in if we use it as window */
  376|  2.19k|}
deflateInit2_:
  381|  2.19k|                          const char *version, int stream_size) {
  382|  2.19k|    deflate_state *s;
  383|  2.19k|    int wrap = 1;
  384|  2.19k|    static const char my_version[] = ZLIB_VERSION;
  ------------------
  |  |   40|  2.19k|#define ZLIB_VERSION "1.3.1.1-motley"
  ------------------
  385|       |
  386|  2.19k|    if (version == Z_NULL || version[0] != my_version[0] ||
  ------------------
  |  |  212|  4.38k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (386:9): [True: 0, False: 2.19k]
  |  Branch (386:30): [True: 0, False: 2.19k]
  ------------------
  387|  2.19k|        stream_size != sizeof(z_stream)) {
  ------------------
  |  Branch (387:9): [True: 0, False: 2.19k]
  ------------------
  388|      0|        return Z_VERSION_ERROR;
  ------------------
  |  |  185|      0|#define Z_VERSION_ERROR (-6)
  ------------------
  389|      0|    }
  390|  2.19k|    if (strm == Z_NULL) return Z_STREAM_ERROR;
  ------------------
  |  |  212|  2.19k|#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.19k]
  ------------------
  391|       |
  392|  2.19k|    strm->msg = Z_NULL;
  ------------------
  |  |  212|  2.19k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  393|  2.19k|    if (strm->zalloc == (alloc_func)0) {
  ------------------
  |  Branch (393:9): [True: 2.19k, False: 0]
  ------------------
  394|       |#ifdef Z_SOLO
  395|       |        return Z_STREAM_ERROR;
  396|       |#else
  397|  2.19k|        strm->zalloc = zcalloc;
  398|  2.19k|        strm->opaque = (voidpf)0;
  399|  2.19k|#endif
  400|  2.19k|    }
  401|  2.19k|    if (strm->zfree == (free_func)0)
  ------------------
  |  Branch (401:9): [True: 2.19k, False: 0]
  ------------------
  402|       |#ifdef Z_SOLO
  403|       |        return Z_STREAM_ERROR;
  404|       |#else
  405|  2.19k|        strm->zfree = zcfree;
  406|  2.19k|#endif
  407|       |
  408|       |#ifdef FASTEST
  409|       |    if (level != 0) level = 1;
  410|       |#else
  411|  2.19k|    if (level == Z_DEFAULT_COMPRESSION) level = 6;
  ------------------
  |  |  193|  2.19k|#define Z_DEFAULT_COMPRESSION  (-1)
  ------------------
  |  Branch (411:9): [True: 2.19k, False: 0]
  ------------------
  412|  2.19k|#endif
  413|       |
  414|  2.19k|    if (windowBits < 0) { /* suppress zlib wrapper */
  ------------------
  |  Branch (414:9): [True: 0, False: 2.19k]
  ------------------
  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.19k|#ifdef GZIP
  421|  2.19k|    else if (windowBits > 15) {
  ------------------
  |  Branch (421:14): [True: 0, False: 2.19k]
  ------------------
  422|      0|        wrap = 2;       /* write gzip wrapper instead */
  423|      0|        windowBits -= 16;
  424|      0|    }
  425|  2.19k|#endif
  426|  2.19k|    if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  268|  4.38k|#    define MAX_MEM_LEVEL 9
  ------------------
                  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
  ------------------
  |  |  209|  4.38k|#define Z_DEFLATED   8
  ------------------
  |  Branch (426:9): [True: 0, False: 2.19k]
  |  Branch (426:25): [True: 0, False: 2.19k]
  |  Branch (426:53): [True: 0, False: 2.19k]
  ------------------
  427|  2.19k|        windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
  ------------------
  |  Branch (427:9): [True: 0, False: 2.19k]
  |  Branch (427:27): [True: 0, False: 2.19k]
  |  Branch (427:46): [True: 0, False: 2.19k]
  |  Branch (427:59): [True: 0, False: 2.19k]
  ------------------
  428|  2.19k|        strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) {
  ------------------
  |  |  199|  4.38k|#define Z_FIXED               4
  ------------------
  |  Branch (428:9): [True: 0, False: 2.19k]
  |  Branch (428:25): [True: 0, False: 2.19k]
  |  Branch (428:48): [True: 0, False: 2.19k]
  |  Branch (428:67): [True: 0, False: 0]
  ------------------
  429|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  430|      0|    }
  431|  2.19k|    if (windowBits == 8) windowBits = 9;  /* until 256-byte window bug fixed */
  ------------------
  |  Branch (431:9): [True: 0, False: 2.19k]
  ------------------
  432|  2.19k|    s = (deflate_state *) ZALLOC(strm, 1, sizeof(deflate_state));
  ------------------
  |  |  247|  2.19k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  433|  2.19k|    if (s == Z_NULL) return Z_MEM_ERROR;
  ------------------
  |  |  212|  2.19k|#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.19k]
  ------------------
  434|  2.19k|    strm->state = (struct internal_state FAR *)s;
  435|  2.19k|    s->strm = strm;
  436|  2.19k|    s->status = INIT_STATE;     /* to pass state test in deflateReset() */
  ------------------
  |  |   58|  2.19k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  437|       |
  438|  2.19k|    s->wrap = wrap;
  439|  2.19k|    s->gzhead = Z_NULL;
  ------------------
  |  |  212|  2.19k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  440|  2.19k|    s->w_bits = (uInt)windowBits;
  441|  2.19k|    s->w_size = 1 << s->w_bits;
  442|  2.19k|    s->w_mask = s->w_size - 1;
  443|       |
  444|  2.19k|    s->hash_bits = (uInt)memLevel + 7;
  445|  2.19k|    s->hash_size = 1 << s->hash_bits;
  446|  2.19k|    s->hash_mask = s->hash_size - 1;
  447|  2.19k|    s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   86|  2.19k|#define MIN_MATCH  3
  ------------------
                  s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
  ------------------
  |  |   86|  2.19k|#define MIN_MATCH  3
  ------------------
  448|       |
  449|  2.19k|    s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
  ------------------
  |  |  247|  2.19k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  450|  2.19k|    s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
  ------------------
  |  |  247|  2.19k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  451|  2.19k|    s->head   = (Posf *)  ZALLOC(strm, s->hash_size, sizeof(Pos));
  ------------------
  |  |  247|  2.19k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  452|       |
  453|  2.19k|    s->high_water = 0;      /* nothing written to s->window yet */
  454|       |
  455|  2.19k|    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.19k|    s->pending_buf = (uchf *) ZALLOC(strm, s->lit_bufsize, LIT_BUFS);
  ------------------
  |  |  247|  2.19k|           (*((strm)->zalloc))((strm)->opaque, (items), (size))
  ------------------
  497|  2.19k|    s->pending_buf_size = (ulg)s->lit_bufsize * 4;
  498|       |
  499|  2.19k|    if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  212|  4.38k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  212|  4.38k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
  ------------------
  |  |  212|  4.38k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (499:9): [True: 0, False: 2.19k]
  |  Branch (499:32): [True: 0, False: 2.19k]
  |  Branch (499:53): [True: 0, False: 2.19k]
  ------------------
  500|  2.19k|        s->pending_buf == Z_NULL) {
  ------------------
  |  |  212|  2.19k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (500:9): [True: 0, False: 2.19k]
  ------------------
  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.19k|    s->sym_buf = s->pending_buf + s->lit_bufsize;
  512|  2.19k|    s->sym_end = (s->lit_bufsize - 1) * 3;
  513|  2.19k|#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.19k|    s->level = level;
  520|  2.19k|    s->strategy = strategy;
  521|  2.19k|    s->method = (Byte)method;
  522|       |
  523|  2.19k|    return deflateReset(strm);
  524|  2.19k|}
deflateResetKeep:
  635|  2.19k|int ZEXPORT deflateResetKeep(z_streamp strm) {
  636|  2.19k|    deflate_state *s;
  637|       |
  638|  2.19k|    if (deflateStateCheck(strm)) {
  ------------------
  |  Branch (638:9): [True: 0, False: 2.19k]
  ------------------
  639|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  640|      0|    }
  641|       |
  642|  2.19k|    strm->total_in = strm->total_out = 0;
  643|  2.19k|    strm->msg = Z_NULL; /* use zfree if we ever allocate msg dynamically */
  ------------------
  |  |  212|  2.19k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  644|  2.19k|    strm->data_type = Z_UNKNOWN;
  ------------------
  |  |  206|  2.19k|#define Z_UNKNOWN  2
  ------------------
  645|       |
  646|  2.19k|    s = (deflate_state *)strm->state;
  647|  2.19k|    s->pending = 0;
  648|  2.19k|    s->pending_out = s->pending_buf;
  649|       |
  650|  2.19k|    if (s->wrap < 0) {
  ------------------
  |  Branch (650:9): [True: 0, False: 2.19k]
  ------------------
  651|      0|        s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */
  652|      0|    }
  653|  2.19k|    s->status =
  654|  2.19k|#ifdef GZIP
  655|  2.19k|        s->wrap == 2 ? GZIP_STATE :
  ------------------
  |  |   60|      0|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (655:9): [True: 0, False: 2.19k]
  ------------------
  656|  2.19k|#endif
  657|  2.19k|        INIT_STATE;
  ------------------
  |  |   58|  4.38k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  658|  2.19k|    strm->adler =
  659|  2.19k|#ifdef GZIP
  660|  2.19k|        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.19k]
  ------------------
  661|  2.19k|#endif
  662|  2.19k|        adler32(0L, Z_NULL, 0);
  ------------------
  |  |  212|  2.19k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  663|  2.19k|    s->last_flush = -2;
  664|       |
  665|  2.19k|    _tr_init(s);
  666|       |
  667|  2.19k|    return Z_OK;
  ------------------
  |  |  177|  2.19k|#define Z_OK            0
  ------------------
  668|  2.19k|}
deflateReset:
  695|  2.19k|int ZEXPORT deflateReset(z_streamp strm) {
  696|  2.19k|    int ret;
  697|       |
  698|  2.19k|    ret = deflateResetKeep(strm);
  699|  2.19k|    if (ret == Z_OK)
  ------------------
  |  |  177|  2.19k|#define Z_OK            0
  ------------------
  |  Branch (699:9): [True: 2.19k, False: 0]
  ------------------
  700|  2.19k|        lm_init(strm->state);
  701|  2.19k|    return ret;
  702|  2.19k|}
deflate:
  954|  5.58k|int ZEXPORT deflate(z_streamp strm, int flush) {
  955|  5.58k|    int old_flush; /* value of flush param for previous deflate call */
  956|  5.58k|    deflate_state *s;
  957|       |
  958|  5.58k|    if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) {
  ------------------
  |  |  173|  11.1k|#define Z_BLOCK         5
  ------------------
  |  Branch (958:9): [True: 0, False: 5.58k]
  |  Branch (958:36): [True: 0, False: 5.58k]
  |  Branch (958:55): [True: 0, False: 5.58k]
  ------------------
  959|      0|        return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  960|      0|    }
  961|  5.58k|    s = strm->state;
  962|       |
  963|  5.58k|    if (strm->next_out == Z_NULL ||
  ------------------
  |  |  212|  11.1k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (963:9): [True: 0, False: 5.58k]
  ------------------
  964|  5.58k|        (strm->avail_in != 0 && strm->next_in == Z_NULL) ||
  ------------------
  |  |  212|  3.25k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (964:10): [True: 3.25k, False: 2.32k]
  |  Branch (964:33): [True: 0, False: 3.25k]
  ------------------
  965|  5.58k|        (s->status == FINISH_STATE && flush != Z_FINISH)) {
  ------------------
  |  |   67|  11.1k|#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.58k]
  |  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.58k|    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.58k]
  ------------------
  969|       |
  970|  5.58k|    old_flush = s->last_flush;
  971|  5.58k|    s->last_flush = flush;
  972|       |
  973|       |    /* Flush as much pending output as possible */
  974|  5.58k|    if (s->pending != 0) {
  ------------------
  |  Branch (974:9): [True: 1.18k, False: 4.39k]
  ------------------
  975|  1.18k|        flush_pending(strm);
  976|  1.18k|        if (strm->avail_out == 0) {
  ------------------
  |  Branch (976:13): [True: 0, False: 1.18k]
  ------------------
  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.39k|    } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  2.19k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 2.19k]
  |  |  ------------------
  ------------------
                  } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
  ------------------
  |  |  133|  6.59k|#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
  |  |  ------------------
  |  |  |  Branch (133:31): [True: 0, False: 2.19k]
  |  |  ------------------
  ------------------
  |  Branch (991:16): [True: 2.19k, False: 2.20k]
  |  Branch (991:39): [True: 0, False: 2.19k]
  ------------------
  992|  4.39k|               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.58k|    if (s->status == FINISH_STATE && strm->avail_in != 0) {
  ------------------
  |  |   67|  11.1k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (997:9): [True: 0, False: 5.58k]
  |  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.58k|    if (s->status == INIT_STATE && s->wrap == 0)
  ------------------
  |  |   58|  11.1k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1002:9): [True: 2.19k, False: 3.39k]
  |  Branch (1002:36): [True: 0, False: 2.19k]
  ------------------
 1003|      0|        s->status = BUSY_STATE;
  ------------------
  |  |   66|      0|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1004|  5.58k|    if (s->status == INIT_STATE) {
  ------------------
  |  |   58|  5.58k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (1004:9): [True: 2.19k, False: 3.39k]
  ------------------
 1005|       |        /* zlib header */
 1006|  2.19k|        uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
  ------------------
  |  |  209|  2.19k|#define Z_DEFLATED   8
  ------------------
 1007|  2.19k|        uInt level_flags;
 1008|       |
 1009|  2.19k|        if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
  ------------------
  |  |  197|  4.38k|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1009:13): [True: 0, False: 2.19k]
  |  Branch (1009:46): [True: 0, False: 2.19k]
  ------------------
 1010|      0|            level_flags = 0;
 1011|  2.19k|        else if (s->level < 6)
  ------------------
  |  Branch (1011:18): [True: 0, False: 2.19k]
  ------------------
 1012|      0|            level_flags = 1;
 1013|  2.19k|        else if (s->level == 6)
  ------------------
  |  Branch (1013:18): [True: 2.19k, False: 0]
  ------------------
 1014|  2.19k|            level_flags = 2;
 1015|      0|        else
 1016|      0|            level_flags = 3;
 1017|  2.19k|        header |= (level_flags << 6);
 1018|  2.19k|        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.19k]
  ------------------
 1019|  2.19k|        header += 31 - (header % 31);
 1020|       |
 1021|  2.19k|        putShortMSB(s, header);
 1022|       |
 1023|       |        /* Save the adler32 of the preset dictionary: */
 1024|  2.19k|        if (s->strstart != 0) {
  ------------------
  |  Branch (1024:13): [True: 0, False: 2.19k]
  ------------------
 1025|      0|            putShortMSB(s, (uInt)(strm->adler >> 16));
 1026|      0|            putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1027|      0|        }
 1028|  2.19k|        strm->adler = adler32(0L, Z_NULL, 0);
  ------------------
  |  |  212|  2.19k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1029|  2.19k|        s->status = BUSY_STATE;
  ------------------
  |  |   66|  2.19k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
 1030|       |
 1031|       |        /* Compression must start with an empty pending buffer */
 1032|  2.19k|        flush_pending(strm);
 1033|  2.19k|        if (s->pending != 0) {
  ------------------
  |  Branch (1033:13): [True: 0, False: 2.19k]
  ------------------
 1034|      0|            s->last_flush = -1;
 1035|      0|            return Z_OK;
  ------------------
  |  |  177|      0|#define Z_OK            0
  ------------------
 1036|      0|        }
 1037|  2.19k|    }
 1038|  5.58k|#ifdef GZIP
 1039|  5.58k|    if (s->status == GZIP_STATE) {
  ------------------
  |  |   60|  5.58k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (1039:9): [True: 0, False: 5.58k]
  ------------------
 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.58k|    if (s->status == EXTRA_STATE) {
  ------------------
  |  |   62|  5.58k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (1090:9): [True: 0, False: 5.58k]
  ------------------
 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.58k|    if (s->status == NAME_STATE) {
  ------------------
  |  |   63|  5.58k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (1117:9): [True: 0, False: 5.58k]
  ------------------
 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.58k|    if (s->status == COMMENT_STATE) {
  ------------------
  |  |   64|  5.58k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (1139:9): [True: 0, False: 5.58k]
  ------------------
 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.58k|    if (s->status == HCRC_STATE) {
  ------------------
  |  |   65|  5.58k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (1160:9): [True: 0, False: 5.58k]
  ------------------
 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.58k|#endif
 1183|       |
 1184|       |    /* Start a new block or continue the current one.
 1185|       |     */
 1186|  5.58k|    if (strm->avail_in != 0 || s->lookahead != 0 ||
  ------------------
  |  Branch (1186:9): [True: 3.25k, False: 2.32k]
  |  Branch (1186:32): [True: 2.32k, False: 0]
  ------------------
 1187|  5.58k|        (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.58k|        block_state bstate;
 1189|       |
 1190|  5.58k|        bstate = s->level == 0 ? deflate_stored(s, flush) :
  ------------------
  |  Branch (1190:18): [True: 0, False: 5.58k]
  ------------------
 1191|  5.58k|                 s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) :
  ------------------
  |  |  197|  5.58k|#define Z_HUFFMAN_ONLY        2
  ------------------
  |  Branch (1191:18): [True: 0, False: 5.58k]
  ------------------
 1192|  5.58k|                 s->strategy == Z_RLE ? deflate_rle(s, flush) :
  ------------------
  |  |  198|  5.58k|#define Z_RLE                 3
  ------------------
  |  Branch (1192:18): [True: 0, False: 5.58k]
  ------------------
 1193|  5.58k|                 (*(configuration_table[s->level].func))(s, flush);
 1194|       |
 1195|  5.58k|        if (bstate == finish_started || bstate == finish_done) {
  ------------------
  |  Branch (1195:13): [True: 0, False: 5.58k]
  |  Branch (1195:41): [True: 2.19k, False: 3.39k]
  ------------------
 1196|  2.19k|            s->status = FINISH_STATE;
  ------------------
  |  |   67|  2.19k|#define FINISH_STATE 666    /* stream complete */
  ------------------
 1197|  2.19k|        }
 1198|  5.58k|        if (bstate == need_more || bstate == finish_started) {
  ------------------
  |  Branch (1198:13): [True: 3.39k, False: 2.19k]
  |  Branch (1198:36): [True: 0, False: 2.19k]
  ------------------
 1199|  3.39k|            if (strm->avail_out == 0) {
  ------------------
  |  Branch (1199:17): [True: 1.20k, False: 2.19k]
  ------------------
 1200|  1.20k|                s->last_flush = -1; /* avoid BUF_ERROR next call, see above */
 1201|  1.20k|            }
 1202|  3.39k|            return Z_OK;
  ------------------
  |  |  177|  3.39k|#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.39k|        }
 1211|  2.19k|        if (bstate == block_done) {
  ------------------
  |  Branch (1211:13): [True: 0, False: 2.19k]
  ------------------
 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.19k|    }
 1235|       |
 1236|  2.19k|    if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  172|  2.19k|#define Z_FINISH        4
  ------------------
                  if (flush != Z_FINISH) return Z_OK;
  ------------------
  |  |  177|      0|#define Z_OK            0
  ------------------
  |  Branch (1236:9): [True: 0, False: 2.19k]
  ------------------
 1237|  2.19k|    if (s->wrap <= 0) return Z_STREAM_END;
  ------------------
  |  |  178|      0|#define Z_STREAM_END    1
  ------------------
  |  Branch (1237:9): [True: 0, False: 2.19k]
  ------------------
 1238|       |
 1239|       |    /* Write the trailer */
 1240|  2.19k|#ifdef GZIP
 1241|  2.19k|    if (s->wrap == 2) {
  ------------------
  |  Branch (1241:9): [True: 0, False: 2.19k]
  ------------------
 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.19k|    else
 1252|  2.19k|#endif
 1253|  2.19k|    {
 1254|  2.19k|        putShortMSB(s, (uInt)(strm->adler >> 16));
 1255|  2.19k|        putShortMSB(s, (uInt)(strm->adler & 0xffff));
 1256|  2.19k|    }
 1257|  2.19k|    flush_pending(strm);
 1258|       |    /* If avail_out is zero, the application will call deflate again
 1259|       |     * to flush the rest.
 1260|       |     */
 1261|  2.19k|    if (s->wrap > 0) s->wrap = -s->wrap; /* write the trailer only once! */
  ------------------
  |  Branch (1261:9): [True: 2.19k, False: 0]
  ------------------
 1262|  2.19k|    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.19k|#define Z_STREAM_END    1
  ------------------
  |  Branch (1262:12): [True: 0, False: 2.19k]
  ------------------
 1263|  2.19k|}
deflateEnd:
 1266|  2.19k|int ZEXPORT deflateEnd(z_streamp strm) {
 1267|  2.19k|    int status;
 1268|       |
 1269|  2.19k|    if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
  ------------------
  |  |  181|      0|#define Z_STREAM_ERROR (-2)
  ------------------
  |  Branch (1269:9): [True: 0, False: 2.19k]
  ------------------
 1270|       |
 1271|  2.19k|    status = strm->state->status;
 1272|       |
 1273|       |    /* Deallocate in reverse order of allocations: */
 1274|  2.19k|    TRY_FREE(strm, strm->state->pending_buf);
  ------------------
  |  |  249|  2.19k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  248|  2.19k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (249:29): [True: 2.19k, False: 0]
  |  |  ------------------
  ------------------
 1275|  2.19k|    TRY_FREE(strm, strm->state->head);
  ------------------
  |  |  249|  2.19k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  248|  2.19k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (249:29): [True: 2.19k, False: 0]
  |  |  ------------------
  ------------------
 1276|  2.19k|    TRY_FREE(strm, strm->state->prev);
  ------------------
  |  |  249|  2.19k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  248|  2.19k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (249:29): [True: 2.19k, False: 0]
  |  |  ------------------
  ------------------
 1277|  2.19k|    TRY_FREE(strm, strm->state->window);
  ------------------
  |  |  249|  2.19k|#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
  |  |  ------------------
  |  |  |  |  248|  2.19k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  |  |  ------------------
  |  |  |  Branch (249:29): [True: 2.19k, False: 0]
  |  |  ------------------
  ------------------
 1278|       |
 1279|  2.19k|    ZFREE(strm, strm->state);
  ------------------
  |  |  248|  2.19k|#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
  ------------------
 1280|  2.19k|    strm->state = Z_NULL;
  ------------------
  |  |  212|  2.19k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
 1281|       |
 1282|  2.19k|    return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
  ------------------
  |  |   66|  2.19k|#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.19k|#define Z_OK            0
  ------------------
  |  Branch (1282:12): [True: 0, False: 2.19k]
  ------------------
 1283|  2.19k|}
deflate.c:deflateStateCheck:
  529|  9.96k|local int deflateStateCheck(z_streamp strm) {
  530|  9.96k|    deflate_state *s;
  531|  9.96k|    if (strm == Z_NULL ||
  ------------------
  |  |  212|  19.9k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
  |  Branch (531:9): [True: 0, False: 9.96k]
  ------------------
  532|  9.96k|        strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
  ------------------
  |  Branch (532:9): [True: 0, False: 9.96k]
  |  Branch (532:42): [True: 0, False: 9.96k]
  ------------------
  533|      0|        return 1;
  534|  9.96k|    s = strm->state;
  535|  9.96k|    if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |  212|  19.9k|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  ------------------
                  if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE &&
  ------------------
  |  |   58|  19.9k|#define INIT_STATE    42    /* zlib header -> BUSY_STATE */
  ------------------
  |  Branch (535:9): [True: 0, False: 9.96k]
  |  Branch (535:24): [True: 0, False: 9.96k]
  |  Branch (535:44): [True: 5.58k, False: 4.38k]
  ------------------
  536|  9.96k|#ifdef GZIP
  537|  9.96k|                                           s->status != GZIP_STATE &&
  ------------------
  |  |   60|  15.5k|#  define GZIP_STATE  57    /* gzip header -> BUSY_STATE | EXTRA_STATE */
  ------------------
  |  Branch (537:44): [True: 5.58k, False: 0]
  ------------------
  538|  9.96k|#endif
  539|  9.96k|                                           s->status != EXTRA_STATE &&
  ------------------
  |  |   62|  15.5k|#define EXTRA_STATE   69    /* gzip extra block -> NAME_STATE */
  ------------------
  |  Branch (539:44): [True: 5.58k, False: 0]
  ------------------
  540|  9.96k|                                           s->status != NAME_STATE &&
  ------------------
  |  |   63|  15.5k|#define NAME_STATE    73    /* gzip file name -> COMMENT_STATE */
  ------------------
  |  Branch (540:44): [True: 5.58k, False: 0]
  ------------------
  541|  9.96k|                                           s->status != COMMENT_STATE &&
  ------------------
  |  |   64|  15.5k|#define COMMENT_STATE 91    /* gzip comment -> HCRC_STATE */
  ------------------
  |  Branch (541:44): [True: 5.58k, False: 0]
  ------------------
  542|  9.96k|                                           s->status != HCRC_STATE &&
  ------------------
  |  |   65|  15.5k|#define HCRC_STATE   103    /* gzip header CRC -> BUSY_STATE */
  ------------------
  |  Branch (542:44): [True: 5.58k, False: 0]
  ------------------
  543|  9.96k|                                           s->status != BUSY_STATE &&
  ------------------
  |  |   66|  15.5k|#define BUSY_STATE   113    /* deflate -> FINISH_STATE */
  ------------------
  |  Branch (543:44): [True: 2.19k, False: 3.39k]
  ------------------
  544|  9.96k|                                           s->status != FINISH_STATE))
  ------------------
  |  |   67|  2.19k|#define FINISH_STATE 666    /* stream complete */
  ------------------
  |  Branch (544:44): [True: 0, False: 2.19k]
  ------------------
  545|      0|        return 1;
  546|  9.96k|    return 0;
  547|  9.96k|}
deflate.c:fill_window:
  251|   274k|local void fill_window(deflate_state *s) {
  252|   274k|    unsigned n;
  253|   274k|    unsigned more;    /* Amount of free space at the end of the window. */
  254|   274k|    uInt wsize = s->w_size;
  255|       |
  256|   274k|    Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
  257|       |
  258|   274k|    do {
  259|   274k|        more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
  260|       |
  261|       |        /* Deal with !@#$% 64K limit: */
  262|   274k|        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|   274k|        if (s->strstart >= wsize + MAX_DIST(s)) {
  ------------------
  |  |  298|   274k|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  293|   274k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|   274k|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|   274k|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (277:13): [True: 3.68k, False: 270k]
  ------------------
  278|       |
  279|  3.68k|            zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more);
  ------------------
  |  |  210|  3.68k|#    define zmemcpy memcpy
  ------------------
  280|  3.68k|            s->match_start -= wsize;
  281|  3.68k|            s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
  282|  3.68k|            s->block_start -= (long) wsize;
  283|  3.68k|            if (s->insert > s->strstart)
  ------------------
  |  Branch (283:17): [True: 0, False: 3.68k]
  ------------------
  284|      0|                s->insert = s->strstart;
  285|  3.68k|            slide_hash(s);
  286|  3.68k|            more += wsize;
  287|  3.68k|        }
  288|   274k|        if (s->strm->avail_in == 0) break;
  ------------------
  |  Branch (288:13): [True: 268k, False: 5.69k]
  ------------------
  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.69k|        Assert(more >= 2, "more < 2");
  302|       |
  303|  5.69k|        n = read_buf(s->strm, s->window + s->strstart + s->lookahead, more);
  304|  5.69k|        s->lookahead += n;
  305|       |
  306|       |        /* Initialize the hash value now that we have some input: */
  307|  5.69k|        if (s->lookahead + s->insert >= MIN_MATCH) {
  ------------------
  |  |   86|  5.69k|#define MIN_MATCH  3
  ------------------
  |  Branch (307:13): [True: 5.66k, False: 38]
  ------------------
  308|  5.66k|            uInt str = s->strstart - s->insert;
  309|  5.66k|            s->ins_h = s->window[str];
  310|  5.66k|            UPDATE_HASH(s, s->ins_h, s->window[str + 1]);
  ------------------
  |  |  141|  5.66k|#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.66k|            while (s->insert) {
  ------------------
  |  Branch (314:20): [True: 0, False: 5.66k]
  ------------------
  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.66k|        }
  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.69k|    } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
  ------------------
  |  |  293|  11.3k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   87|  5.69k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   86|  5.69k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (330:14): [True: 1.01k, False: 4.68k]
  |  Branch (330:46): [True: 0, False: 1.01k]
  ------------------
  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|   274k|    if (s->high_water < s->window_size) {
  ------------------
  |  Branch (339:9): [True: 169k, False: 104k]
  ------------------
  340|   169k|        ulg curr = s->strstart + (ulg)(s->lookahead);
  341|   169k|        ulg init;
  342|       |
  343|   169k|        if (s->high_water < curr) {
  ------------------
  |  Branch (343:13): [True: 2.19k, False: 167k]
  ------------------
  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.19k|            init = s->window_size - curr;
  348|  2.19k|            if (init > WIN_INIT)
  ------------------
  |  |  303|  2.19k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   87|  2.19k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (348:17): [True: 1.66k, False: 531]
  ------------------
  349|  1.66k|                init = WIN_INIT;
  ------------------
  |  |  303|  1.66k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   87|  1.66k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  350|  2.19k|            zmemzero(s->window + curr, (unsigned)init);
  ------------------
  |  |  212|  2.19k|#    define zmemzero(dest, len) memset(dest, 0, len)
  ------------------
  351|  2.19k|            s->high_water = curr + init;
  352|  2.19k|        }
  353|   167k|        else if (s->high_water < (ulg)curr + WIN_INIT) {
  ------------------
  |  |  303|   167k|#define WIN_INIT MAX_MATCH
  |  |  ------------------
  |  |  |  |   87|   167k|#define MAX_MATCH  258
  |  |  ------------------
  ------------------
  |  Branch (353:18): [True: 0, False: 167k]
  ------------------
  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|   169k|    }
  365|       |
  366|   274k|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
  367|   274k|           "not enough room for search");
  368|   274k|}
deflate.c:read_buf:
  218|  5.69k|local unsigned read_buf(z_streamp strm, Bytef *buf, unsigned size) {
  219|  5.69k|    unsigned len = strm->avail_in;
  220|       |
  221|  5.69k|    if (len > size) len = size;
  ------------------
  |  Branch (221:9): [True: 3.50k, False: 2.19k]
  ------------------
  222|  5.69k|    if (len == 0) return 0;
  ------------------
  |  Branch (222:9): [True: 0, False: 5.69k]
  ------------------
  223|       |
  224|  5.69k|    strm->avail_in  -= len;
  225|       |
  226|  5.69k|    zmemcpy(buf, strm->next_in, len);
  ------------------
  |  |  210|  5.69k|#    define zmemcpy memcpy
  ------------------
  227|  5.69k|    if (strm->state->wrap == 1) {
  ------------------
  |  Branch (227:9): [True: 5.69k, False: 0]
  ------------------
  228|  5.69k|        strm->adler = adler32(strm->adler, buf, len);
  229|  5.69k|    }
  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.69k|#endif
  235|  5.69k|    strm->next_in  += len;
  236|  5.69k|    strm->total_in += len;
  237|       |
  238|  5.69k|    return len;
  239|  5.69k|}
deflate.c:lm_init:
  673|  2.19k|local void lm_init(deflate_state *s) {
  674|  2.19k|    s->window_size = (ulg)2L*s->w_size;
  675|       |
  676|  2.19k|    CLEAR_HASH(s);
  ------------------
  |  |  171|  2.19k|    do { \
  |  |  172|  2.19k|        s->head[s->hash_size - 1] = NIL; \
  |  |  ------------------
  |  |  |  |   85|  2.19k|#define NIL 0
  |  |  ------------------
  |  |  173|  2.19k|        zmemzero((Bytef *)s->head, \
  |  |  ------------------
  |  |  |  |  212|  2.19k|#    define zmemzero(dest, len) memset(dest, 0, len)
  |  |  ------------------
  |  |  174|  2.19k|                 (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
  |  |  175|  2.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (175:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  677|       |
  678|       |    /* Set the default configuration parameters:
  679|       |     */
  680|  2.19k|    s->max_lazy_match   = configuration_table[s->level].max_lazy;
  681|  2.19k|    s->good_match       = configuration_table[s->level].good_length;
  682|  2.19k|    s->nice_match       = configuration_table[s->level].nice_length;
  683|  2.19k|    s->max_chain_length = configuration_table[s->level].max_chain;
  684|       |
  685|  2.19k|    s->strstart = 0;
  686|  2.19k|    s->block_start = 0L;
  687|  2.19k|    s->lookahead = 0;
  688|  2.19k|    s->insert = 0;
  689|  2.19k|    s->match_length = s->prev_length = MIN_MATCH-1;
  ------------------
  |  |   86|  2.19k|#define MIN_MATCH  3
  ------------------
  690|  2.19k|    s->match_available = 0;
  691|  2.19k|    s->ins_h = 0;
  692|  2.19k|}
deflate.c:longest_match:
 1356|  66.5M|local uInt longest_match(deflate_state *s, IPos cur_match) {
 1357|  66.5M|    unsigned chain_length = s->max_chain_length;/* max hash chain length */
 1358|  66.5M|    register Bytef *scan = s->window + s->strstart; /* current string */
 1359|  66.5M|    register Bytef *match;                      /* matched string */
 1360|  66.5M|    register int len;                           /* length of current match */
 1361|  66.5M|    int best_len = (int)s->prev_length;         /* best match length so far */
 1362|  66.5M|    int nice_match = s->nice_match;             /* stop if match long enough */
 1363|  66.5M|    IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
  ------------------
  |  |  298|  66.5M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  293|  66.5M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|  66.5M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|  66.5M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1363:18): [True: 58.7M, False: 7.84M]
  ------------------
 1364|  58.7M|        s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |  298|  58.7M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  293|  58.7M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|  58.7M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|  58.7M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      s->strstart - (IPos)MAX_DIST(s) : NIL;
  ------------------
  |  |   85|  7.84M|#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|  66.5M|    Posf *prev = s->prev;
 1369|  66.5M|    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|  66.5M|    register Bytef *strend = s->window + s->strstart + MAX_MATCH;
  ------------------
  |  |   87|  66.5M|#define MAX_MATCH  258
  ------------------
 1380|  66.5M|    register Byte scan_end1  = scan[best_len - 1];
 1381|  66.5M|    register Byte scan_end   = scan[best_len];
 1382|  66.5M|#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|  66.5M|    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|  66.5M|    if (s->prev_length >= s->good_match) {
  ------------------
  |  Branch (1390:9): [True: 299k, False: 66.2M]
  ------------------
 1391|   299k|        chain_length >>= 2;
 1392|   299k|    }
 1393|       |    /* Do not look for matches beyond the end of the input. This is necessary
 1394|       |     * to make deflate deterministic.
 1395|       |     */
 1396|  66.5M|    if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
  ------------------
  |  Branch (1396:9): [True: 56.4k, False: 66.5M]
  ------------------
 1397|       |
 1398|  66.5M|    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
 1399|  66.5M|           "need lookahead");
 1400|       |
 1401|   270M|    do {
 1402|   270M|        Assert(cur_match < s->strstart, "no future");
 1403|   270M|        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|   270M|        if (match[best_len]     != scan_end  ||
  ------------------
  |  Branch (1449:13): [True: 197M, False: 72.7M]
  ------------------
 1450|   270M|            match[best_len - 1] != scan_end1 ||
  ------------------
  |  Branch (1450:13): [True: 52.1M, False: 20.6M]
  ------------------
 1451|   270M|            *match              != *scan     ||
  ------------------
  |  Branch (1451:13): [True: 11.5M, False: 9.12M]
  ------------------
 1452|   270M|            *++match            != scan[1])      continue;
  ------------------
  |  Branch (1452:13): [True: 16.3k, False: 9.10M]
  ------------------
 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.10M|        scan += 2, match++;
 1461|  9.10M|        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|  16.9M|        do {
 1467|  16.9M|        } while (*++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1467:18): [True: 11.8M, False: 5.12M]
  |  Branch (1467:41): [True: 10.1M, False: 1.72M]
  ------------------
 1468|  16.9M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1468:18): [True: 9.53M, False: 588k]
  |  Branch (1468:41): [True: 9.05M, False: 478k]
  ------------------
 1469|  16.9M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1469:18): [True: 8.73M, False: 322k]
  |  Branch (1469:41): [True: 8.39M, False: 343k]
  ------------------
 1470|  16.9M|                 *++scan == *++match && *++scan == *++match &&
  ------------------
  |  Branch (1470:18): [True: 8.21M, False: 181k]
  |  Branch (1470:41): [True: 7.96M, False: 243k]
  ------------------
 1471|  16.9M|                 scan < strend);
  ------------------
  |  Branch (1471:18): [True: 7.87M, False: 96.1k]
  ------------------
 1472|       |
 1473|  9.10M|        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
 1474|  9.10M|               "wild scan");
 1475|       |
 1476|  9.10M|        len = MAX_MATCH - (int)(strend - scan);
  ------------------
  |  |   87|  9.10M|#define MAX_MATCH  258
  ------------------
 1477|  9.10M|        scan = strend - MAX_MATCH;
  ------------------
  |  |   87|  9.10M|#define MAX_MATCH  258
  ------------------
 1478|       |
 1479|  9.10M|#endif /* UNALIGNED_OK */
 1480|       |
 1481|  9.10M|        if (len > best_len) {
  ------------------
  |  Branch (1481:13): [True: 7.37M, False: 1.73M]
  ------------------
 1482|  7.37M|            s->match_start = cur_match;
 1483|  7.37M|            best_len = len;
 1484|  7.37M|            if (len >= nice_match) break;
  ------------------
  |  Branch (1484:17): [True: 114k, False: 7.25M]
  ------------------
 1485|       |#ifdef UNALIGNED_OK
 1486|       |            scan_end = *(ushf*)(scan + best_len - 1);
 1487|       |#else
 1488|  7.25M|            scan_end1  = scan[best_len - 1];
 1489|  7.25M|            scan_end   = scan[best_len];
 1490|  7.25M|#endif
 1491|  7.25M|        }
 1492|   270M|    } while ((cur_match = prev[cur_match & wmask]) > limit
  ------------------
  |  Branch (1492:14): [True: 204M, False: 65.9M]
  ------------------
 1493|   270M|             && --chain_length != 0);
  ------------------
  |  Branch (1493:17): [True: 203M, False: 521k]
  ------------------
 1494|       |
 1495|  66.5M|    if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
  ------------------
  |  Branch (1495:9): [True: 66.5M, False: 448]
  ------------------
 1496|    448|    return s->lookahead;
 1497|  66.5M|}
deflate.c:deflate_slow:
 1923|  5.58k|local block_state deflate_slow(deflate_state *s, int flush) {
 1924|  5.58k|    IPos hash_head;          /* head of hash chain */
 1925|  5.58k|    int bflush;              /* set if current block must be flushed */
 1926|       |
 1927|       |    /* Process the input block. */
 1928|   108M|    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|   108M|        if (s->lookahead < MIN_LOOKAHEAD) {
  ------------------
  |  |  293|   108M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   87|   108M|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   86|   108M|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
  |  Branch (1934:13): [True: 274k, False: 108M]
  ------------------
 1935|   274k|            fill_window(s);
 1936|   274k|            if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  293|   548k|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   87|   274k|#define MAX_MATCH  258
  |  |  ------------------
  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  ------------------
  |  |  |  |   86|   274k|#define MIN_MATCH  3
  |  |  ------------------
  ------------------
                          if (s->lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
  ------------------
  |  |  168|   269k|#define Z_NO_FLUSH      0
  ------------------
  |  Branch (1936:17): [True: 269k, False: 4.68k]
  |  Branch (1936:49): [True: 2.19k, False: 267k]
  ------------------
 1937|  2.19k|                return need_more;
 1938|  2.19k|            }
 1939|   272k|            if (s->lookahead == 0) break; /* flush the current block */
  ------------------
  |  Branch (1939:17): [True: 2.19k, False: 270k]
  ------------------
 1940|   272k|        }
 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|   108M|        hash_head = NIL;
  ------------------
  |  |   85|   108M|#define NIL 0
  ------------------
 1946|   108M|        if (s->lookahead >= MIN_MATCH) {
  ------------------
  |  |   86|   108M|#define MIN_MATCH  3
  ------------------
  |  Branch (1946:13): [True: 108M, False: 3.15k]
  ------------------
 1947|   108M|            INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|   108M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|   108M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|   108M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|   108M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 1948|   108M|        }
 1949|       |
 1950|       |        /* Find the longest match, discarding those <= prev_length.
 1951|       |         */
 1952|   108M|        s->prev_length = s->match_length, s->prev_match = s->match_start;
 1953|   108M|        s->match_length = MIN_MATCH-1;
  ------------------
  |  |   86|   108M|#define MIN_MATCH  3
  ------------------
 1954|       |
 1955|   108M|        if (hash_head != NIL && s->prev_length < s->max_lazy_match &&
  ------------------
  |  |   85|   217M|#define NIL 0
  ------------------
  |  Branch (1955:13): [True: 78.9M, False: 29.7M]
  |  Branch (1955:33): [True: 78.5M, False: 408k]
  ------------------
 1956|   108M|            s->strstart - hash_head <= MAX_DIST(s)) {
  ------------------
  |  |  298|  78.5M|#define MAX_DIST(s)  ((s)->w_size-MIN_LOOKAHEAD)
  |  |  ------------------
  |  |  |  |  293|  78.5M|#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|  78.5M|#define MAX_MATCH  258
  |  |  |  |  ------------------
  |  |  |  |               #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|  78.5M|#define MIN_MATCH  3
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1956:13): [True: 66.5M, False: 11.9M]
  ------------------
 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|  66.5M|            s->match_length = longest_match (s, hash_head);
 1962|       |            /* longest_match() sets match_start */
 1963|       |
 1964|  66.5M|            if (s->match_length <= 5 && (s->strategy == Z_FILTERED
  ------------------
  |  |  196|   129M|#define Z_FILTERED            1
  ------------------
  |  Branch (1964:17): [True: 64.9M, False: 1.60M]
  |  Branch (1964:42): [True: 0, False: 64.9M]
  ------------------
 1965|  64.9M|#if TOO_FAR <= 32767
 1966|  64.9M|                || (s->match_length == MIN_MATCH &&
  ------------------
  |  |   86|   129M|#define MIN_MATCH  3
  ------------------
  |  Branch (1966:21): [True: 4.36M, False: 60.6M]
  ------------------
 1967|  64.9M|                    s->strstart - s->match_start > TOO_FAR)
  ------------------
  |  |   89|  4.36M|#  define TOO_FAR 4096
  ------------------
  |  Branch (1967:21): [True: 2.44M, False: 1.92M]
  ------------------
 1968|  64.9M|#endif
 1969|  64.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|  2.44M|                s->match_length = MIN_MATCH-1;
  ------------------
  |  |   86|  2.44M|#define MIN_MATCH  3
  ------------------
 1975|  2.44M|            }
 1976|  66.5M|        }
 1977|       |        /* If there was a match at the previous step and the current
 1978|       |         * match is not better, output the previous match:
 1979|       |         */
 1980|   108M|        if (s->prev_length >= MIN_MATCH && s->match_length <= s->prev_length) {
  ------------------
  |  |   86|   217M|#define MIN_MATCH  3
  ------------------
  |  Branch (1980:13): [True: 3.49M, False: 105M]
  |  Branch (1980:44): [True: 3.20M, False: 286k]
  ------------------
 1981|  3.20M|            uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
  ------------------
  |  |   86|  3.20M|#define MIN_MATCH  3
  ------------------
 1982|       |            /* Do not insert strings in hash table beyond this. */
 1983|       |
 1984|  3.20M|            check_match(s, s->strstart - 1, s->prev_match, s->prev_length);
 1985|       |
 1986|  3.20M|            _tr_tally_dist(s, s->strstart - 1 - s->prev_match,
  ------------------
  |  |  363|  3.20M|  { uch len = (uch)(length); \
  |  |  364|  3.20M|    ush dist = (ush)(distance); \
  |  |  365|  3.20M|    s->sym_buf[s->sym_next++] = (uch)dist; \
  |  |  366|  3.20M|    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
  |  |  367|  3.20M|    s->sym_buf[s->sym_next++] = len; \
  |  |  368|  3.20M|    dist--; \
  |  |  369|  3.20M|    s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   37|  3.20M|#define LITERALS  256
  |  |  ------------------
  |  |                   s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  3.20M|#define Freq fc.freq
  |  |  ------------------
  |  |  370|  3.20M|    s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |  318|  3.20M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (318:5): [True: 942k, False: 2.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   s->dyn_dtree[d_code(dist)].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  3.20M|#define Freq fc.freq
  |  |  ------------------
  |  |  371|  3.20M|    flush = (s->sym_next == s->sym_end); \
  |  |  372|  3.20M|  }
  ------------------
 1987|  3.20M|                           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|  3.20M|            s->lookahead -= s->prev_length - 1;
 1995|  3.20M|            s->prev_length -= 2;
 1996|  43.6M|            do {
 1997|  43.6M|                if (++s->strstart <= max_insert) {
  ------------------
  |  Branch (1997:21): [True: 43.6M, False: 1.20k]
  ------------------
 1998|  43.6M|                    INSERT_STRING(s, s->strstart, hash_head);
  ------------------
  |  |  161|  43.6M|   (UPDATE_HASH(s, s->ins_h, s->window[(str) + (MIN_MATCH-1)]), \
  |  |  ------------------
  |  |  |  |  141|  43.6M|#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
  |  |  ------------------
  |  |  162|  43.6M|    match_head = s->prev[(str) & s->w_mask] = s->head[s->ins_h], \
  |  |  163|  43.6M|    s->head[s->ins_h] = (Pos)(str))
  ------------------
 1999|  43.6M|                }
 2000|  43.6M|            } while (--s->prev_length != 0);
  ------------------
  |  Branch (2000:22): [True: 40.4M, False: 3.20M]
  ------------------
 2001|  3.20M|            s->match_available = 0;
 2002|  3.20M|            s->match_length = MIN_MATCH-1;
  ------------------
  |  |   86|  3.20M|#define MIN_MATCH  3
  ------------------
 2003|  3.20M|            s->strstart++;
 2004|       |
 2005|  3.20M|            if (bflush) FLUSH_BLOCK(s, 0);
  ------------------
  |  | 1609|    364|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|    364|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|    364|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|    364|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 251, False: 113]
  |  |  |  |  ------------------
  |  |  |  | 1599|    364|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|    364|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  212|    113|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|    364|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|    364|                (last)); \
  |  |  |  | 1603|    364|   s->block_start = s->strstart; \
  |  |  |  | 1604|    364|   flush_pending(s->strm); \
  |  |  |  | 1605|    364|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|    364|}
  |  |  ------------------
  |  | 1611|    364|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 100, False: 264]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|    364|}
  ------------------
  |  Branch (2005:17): [True: 364, False: 3.20M]
  ------------------
 2006|       |
 2007|   105M|        } else if (s->match_available) {
  ------------------
  |  Branch (2007:20): [True: 102M, False: 3.21M]
  ------------------
 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|   102M|            Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2013|   102M|            _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  355|   102M|  { uch cc = (c); \
  |  |  356|   102M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  357|   102M|    s->sym_buf[s->sym_next++] = 0; \
  |  |  358|   102M|    s->sym_buf[s->sym_next++] = cc; \
  |  |  359|   102M|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|   102M|#define Freq fc.freq
  |  |  ------------------
  |  |  360|   102M|    flush = (s->sym_next == s->sym_end); \
  |  |  361|   102M|   }
  ------------------
 2014|   102M|            if (bflush) {
  ------------------
  |  Branch (2014:17): [True: 5.83k, False: 102M]
  ------------------
 2015|  5.83k|                FLUSH_BLOCK_ONLY(s, 0);
  ------------------
  |  | 1597|  5.83k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  | 1598|  5.83k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  ------------------
  |  |  |  Branch (1598:24): [True: 5.72k, False: 107]
  |  |  ------------------
  |  | 1599|  5.83k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  | 1600|  5.83k|                   (charf *)Z_NULL), \
  |  |  ------------------
  |  |  |  |  212|    107|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  ------------------
  |  | 1601|  5.83k|                (ulg)((long)s->strstart - s->block_start), \
  |  | 1602|  5.83k|                (last)); \
  |  | 1603|  5.83k|   s->block_start = s->strstart; \
  |  | 1604|  5.83k|   flush_pending(s->strm); \
  |  | 1605|  5.83k|   Tracev((stderr,"[FLUSH]")); \
  |  | 1606|  5.83k|}
  ------------------
 2016|  5.83k|            }
 2017|   102M|            s->strstart++;
 2018|   102M|            s->lookahead--;
 2019|   102M|            if (s->strm->avail_out == 0) return need_more;
  ------------------
  |  Branch (2019:17): [True: 1.10k, False: 102M]
  ------------------
 2020|   102M|        } else {
 2021|       |            /* There is no previous match to compare with, wait for
 2022|       |             * the next step to decide.
 2023|       |             */
 2024|  3.21M|            s->match_available = 1;
 2025|  3.21M|            s->strstart++;
 2026|  3.21M|            s->lookahead--;
 2027|  3.21M|        }
 2028|   108M|    }
 2029|  2.19k|    Assert (flush != Z_NO_FLUSH, "no flush?");
 2030|  2.19k|    if (s->match_available) {
  ------------------
  |  Branch (2030:9): [True: 1.57k, False: 619]
  ------------------
 2031|  1.57k|        Tracevv((stderr,"%c", s->window[s->strstart - 1]));
 2032|  1.57k|        _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
  ------------------
  |  |  355|  1.57k|  { uch cc = (c); \
  |  |  356|  1.57k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  357|  1.57k|    s->sym_buf[s->sym_next++] = 0; \
  |  |  358|  1.57k|    s->sym_buf[s->sym_next++] = cc; \
  |  |  359|  1.57k|    s->dyn_ltree[cc].Freq++; \
  |  |  ------------------
  |  |  |  |   83|  1.57k|#define Freq fc.freq
  |  |  ------------------
  |  |  360|  1.57k|    flush = (s->sym_next == s->sym_end); \
  |  |  361|  1.57k|   }
  ------------------
 2033|  1.57k|        s->match_available = 0;
 2034|  1.57k|    }
 2035|  2.19k|    s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   86|  2.19k|#define MIN_MATCH  3
  ------------------
                  s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
  ------------------
  |  |   86|  2.16k|#define MIN_MATCH  3
  ------------------
  |  Branch (2035:17): [True: 26, False: 2.16k]
  ------------------
 2036|  2.19k|    if (flush == Z_FINISH) {
  ------------------
  |  |  172|  2.19k|#define Z_FINISH        4
  ------------------
  |  Branch (2036:9): [True: 2.19k, False: 0]
  ------------------
 2037|  2.19k|        FLUSH_BLOCK(s, 1);
  ------------------
  |  | 1609|  2.19k|#define FLUSH_BLOCK(s, last) { \
  |  | 1610|  2.19k|   FLUSH_BLOCK_ONLY(s, last); \
  |  |  ------------------
  |  |  |  | 1597|  2.19k|#define FLUSH_BLOCK_ONLY(s, last) { \
  |  |  |  | 1598|  2.19k|   _tr_flush_block(s, (s->block_start >= 0L ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1598:24): [True: 2.09k, False: 98]
  |  |  |  |  ------------------
  |  |  |  | 1599|  2.19k|                   (charf *)&s->window[(unsigned)s->block_start] : \
  |  |  |  | 1600|  2.19k|                   (charf *)Z_NULL), \
  |  |  |  |  ------------------
  |  |  |  |  |  |  212|     98|#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
  |  |  |  |  ------------------
  |  |  |  | 1601|  2.19k|                (ulg)((long)s->strstart - s->block_start), \
  |  |  |  | 1602|  2.19k|                (last)); \
  |  |  |  | 1603|  2.19k|   s->block_start = s->strstart; \
  |  |  |  | 1604|  2.19k|   flush_pending(s->strm); \
  |  |  |  | 1605|  2.19k|   Tracev((stderr,"[FLUSH]")); \
  |  |  |  | 1606|  2.19k|}
  |  |  ------------------
  |  | 1611|  2.19k|   if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \
  |  |  ------------------
  |  |  |  Branch (1611:8): [True: 0, False: 2.19k]
  |  |  |  Branch (1611:40): [Folded - Ignored]
  |  |  ------------------
  |  | 1612|  2.19k|}
  ------------------
 2038|  2.19k|        return finish_done;
 2039|  2.19k|    }
 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.68k|local void slide_hash(deflate_state *s) {
  188|  3.68k|    unsigned n, m;
  189|  3.68k|    Posf *p;
  190|  3.68k|    uInt wsize = s->w_size;
  191|       |
  192|  3.68k|    n = s->hash_size;
  193|  3.68k|    p = &s->head[n];
  194|   120M|    do {
  195|   120M|        m = *--p;
  196|   120M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|  70.5M|#define NIL 0
  ------------------
  |  Branch (196:20): [True: 50.2M, False: 70.5M]
  ------------------
  197|   120M|    } while (--n);
  ------------------
  |  Branch (197:14): [True: 120M, False: 3.68k]
  ------------------
  198|  3.68k|    n = wsize;
  199|  3.68k|#ifndef FASTEST
  200|  3.68k|    p = &s->prev[n];
  201|   120M|    do {
  202|   120M|        m = *--p;
  203|   120M|        *p = (Pos)(m >= wsize ? m - wsize : NIL);
  ------------------
  |  |   85|  51.1M|#define NIL 0
  ------------------
  |  Branch (203:20): [True: 69.6M, False: 51.1M]
  ------------------
  204|       |        /* If n is not on any hash chain, prev[n] is garbage but
  205|       |         * its value will never be used.
  206|       |         */
  207|   120M|    } while (--n);
  ------------------
  |  Branch (207:14): [True: 120M, False: 3.68k]
  ------------------
  208|  3.68k|#endif
  209|  3.68k|}
deflate.c:flush_pending:
  923|  13.9k|local void flush_pending(z_streamp strm) {
  924|  13.9k|    unsigned len;
  925|  13.9k|    deflate_state *s = strm->state;
  926|       |
  927|  13.9k|    _tr_flush_bits(s);
  928|  13.9k|    len = s->pending;
  929|  13.9k|    if (len > strm->avail_out) len = strm->avail_out;
  ------------------
  |  Branch (929:9): [True: 1.18k, False: 12.7k]
  ------------------
  930|  13.9k|    if (len == 0) return;
  ------------------
  |  Branch (930:9): [True: 0, False: 13.9k]
  ------------------
  931|       |
  932|  13.9k|    zmemcpy(strm->next_out, s->pending_out, len);
  ------------------
  |  |  210|  13.9k|#    define zmemcpy memcpy
  ------------------
  933|  13.9k|    strm->next_out  += len;
  934|  13.9k|    s->pending_out  += len;
  935|  13.9k|    strm->total_out += len;
  936|  13.9k|    strm->avail_out -= len;
  937|  13.9k|    s->pending      -= len;
  938|  13.9k|    if (s->pending == 0) {
  ------------------
  |  Branch (938:9): [True: 12.7k, False: 1.18k]
  ------------------
  939|  12.7k|        s->pending_out = s->pending_buf;
  940|  12.7k|    }
  941|  13.9k|}
deflate.c:putShortMSB:
  912|  6.57k|local void putShortMSB(deflate_state *s, uInt b) {
  913|  6.57k|    put_byte(s, (Byte)(b >> 8));
  ------------------
  |  |  290|  6.57k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  914|  6.57k|    put_byte(s, (Byte)(b & 0xff));
  ------------------
  |  |  290|  6.57k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  915|  6.57k|}

_tr_init:
  456|  2.19k|void ZLIB_INTERNAL _tr_init(deflate_state *s) {
  457|  2.19k|    tr_static_init();
  458|       |
  459|  2.19k|    s->l_desc.dyn_tree = s->dyn_ltree;
  460|  2.19k|    s->l_desc.stat_desc = &static_l_desc;
  461|       |
  462|  2.19k|    s->d_desc.dyn_tree = s->dyn_dtree;
  463|  2.19k|    s->d_desc.stat_desc = &static_d_desc;
  464|       |
  465|  2.19k|    s->bl_desc.dyn_tree = s->bl_tree;
  466|  2.19k|    s->bl_desc.stat_desc = &static_bl_desc;
  467|       |
  468|  2.19k|    s->bi_buf = 0;
  469|  2.19k|    s->bi_valid = 0;
  470|  2.19k|    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.19k|    init_block(s);
  478|  2.19k|}
_tr_stored_block:
  861|  2.39k|                                    ulg stored_len, int last) {
  862|  2.39k|    send_bits(s, (STORED_BLOCK<<1) + last, 3);  /* send block type */
  ------------------
  |  |  274|  2.39k|#define send_bits(s, value, length) \
  |  |  275|  2.39k|{ int len = length;\
  |  |  276|  2.39k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  2.39k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 2.39k]
  |  |  ------------------
  |  |  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|  2.39k|  } else {\
  |  |  283|  2.39k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  2.39k|    s->bi_valid += len;\
  |  |  285|  2.39k|  }\
  |  |  286|  2.39k|}
  ------------------
  863|  2.39k|    bi_windup(s);        /* align on byte boundary */
  864|  2.39k|    put_short(s, (ush)stored_len);
  ------------------
  |  |  144|  2.39k|#define put_short(s, w) { \
  |  |  145|  2.39k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|  2.39k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  2.39k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|  2.39k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  2.39k|}
  ------------------
  865|  2.39k|    put_short(s, (ush)~stored_len);
  ------------------
  |  |  144|  2.39k|#define put_short(s, w) { \
  |  |  145|  2.39k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|  2.39k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  2.39k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|  2.39k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  2.39k|}
  ------------------
  866|  2.39k|    if (stored_len)
  ------------------
  |  Branch (866:9): [True: 2.39k, False: 0]
  ------------------
  867|  2.39k|        zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
  ------------------
  |  |  210|  2.39k|#    define zmemcpy memcpy
  ------------------
  868|  2.39k|    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|  2.39k|}
_tr_flush_bits:
  880|  13.9k|void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) {
  881|  13.9k|    bi_flush(s);
  882|  13.9k|}
_tr_flush_block:
  998|  8.39k|                                   ulg stored_len, int last) {
  999|  8.39k|    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
 1000|  8.39k|    int max_blindex = 0;  /* index of last bit length code of non zero freq */
 1001|       |
 1002|       |    /* Build the Huffman trees unless a stored block is forced */
 1003|  8.39k|    if (s->level > 0) {
  ------------------
  |  Branch (1003:9): [True: 8.39k, False: 0]
  ------------------
 1004|       |
 1005|       |        /* Check if the file is binary or text */
 1006|  8.39k|        if (s->strm->data_type == Z_UNKNOWN)
  ------------------
  |  |  206|  8.39k|#define Z_UNKNOWN  2
  ------------------
  |  Branch (1006:13): [True: 2.19k, False: 6.20k]
  ------------------
 1007|  2.19k|            s->strm->data_type = detect_data_type(s);
 1008|       |
 1009|       |        /* Construct the literal and distance trees */
 1010|  8.39k|        build_tree(s, (tree_desc *)(&(s->l_desc)));
 1011|  8.39k|        Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
 1012|  8.39k|                s->static_len));
 1013|       |
 1014|  8.39k|        build_tree(s, (tree_desc *)(&(s->d_desc)));
 1015|  8.39k|        Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
 1016|  8.39k|                s->static_len));
 1017|       |        /* At this point, opt_len and static_len are the total bit lengths of
 1018|       |         * the compressed block data, excluding the tree representations.
 1019|       |         */
 1020|       |
 1021|       |        /* Build the bit length tree for the above two trees, and get the index
 1022|       |         * in bl_order of the last bit length code to send.
 1023|       |         */
 1024|  8.39k|        max_blindex = build_bl_tree(s);
 1025|       |
 1026|       |        /* Determine the best encoding. Compute the block lengths in bytes. */
 1027|  8.39k|        opt_lenb = (s->opt_len + 3 + 7) >> 3;
 1028|  8.39k|        static_lenb = (s->static_len + 3 + 7) >> 3;
 1029|       |
 1030|  8.39k|        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
 1031|  8.39k|                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
 1032|  8.39k|                s->sym_next / 3));
 1033|       |
 1034|  8.39k|#ifndef FORCE_STATIC
 1035|  8.39k|        if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
  ------------------
  |  |  199|  7.08k|#define Z_FIXED               4
  ------------------
  |  Branch (1035:13): [True: 1.30k, False: 7.08k]
  |  Branch (1035:40): [True: 0, False: 7.08k]
  ------------------
 1036|  1.30k|#endif
 1037|  1.30k|            opt_lenb = static_lenb;
 1038|       |
 1039|  8.39k|    } else {
 1040|      0|        Assert(buf != (char*)0, "lost buf");
 1041|      0|        opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
 1042|      0|    }
 1043|       |
 1044|       |#ifdef FORCE_STORED
 1045|       |    if (buf != (char*)0) { /* force stored block */
 1046|       |#else
 1047|  8.39k|    if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
  ------------------
  |  Branch (1047:9): [True: 2.39k, False: 5.99k]
  |  Branch (1047:39): [True: 2.39k, False: 0]
  ------------------
 1048|       |                       /* 4: two words for the lengths */
 1049|  2.39k|#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|  2.39k|        _tr_stored_block(s, buf, stored_len, last);
 1057|       |
 1058|  5.99k|    } else if (static_lenb == opt_lenb) {
  ------------------
  |  Branch (1058:16): [True: 1.03k, False: 4.96k]
  ------------------
 1059|  1.03k|        send_bits(s, (STATIC_TREES<<1) + last, 3);
  ------------------
  |  |  274|  1.03k|#define send_bits(s, value, length) \
  |  |  275|  1.03k|{ int len = length;\
  |  |  276|  1.03k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  1.03k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 1.03k]
  |  |  ------------------
  |  |  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.03k|  } else {\
  |  |  283|  1.03k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.03k|    s->bi_valid += len;\
  |  |  285|  1.03k|  }\
  |  |  286|  1.03k|}
  ------------------
 1060|  1.03k|        compress_block(s, (const ct_data *)static_ltree,
 1061|  1.03k|                       (const ct_data *)static_dtree);
 1062|       |#ifdef ZLIB_DEBUG
 1063|       |        s->compressed_len += 3 + s->static_len;
 1064|       |#endif
 1065|  4.96k|    } else {
 1066|  4.96k|        send_bits(s, (DYN_TREES<<1) + last, 3);
  ------------------
  |  |  274|  4.96k|#define send_bits(s, value, length) \
  |  |  275|  4.96k|{ int len = length;\
  |  |  276|  4.96k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.96k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 4.96k]
  |  |  ------------------
  |  |  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.96k|  } else {\
  |  |  283|  4.96k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  4.96k|    s->bi_valid += len;\
  |  |  285|  4.96k|  }\
  |  |  286|  4.96k|}
  ------------------
 1067|  4.96k|        send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
 1068|  4.96k|                       max_blindex + 1);
 1069|  4.96k|        compress_block(s, (const ct_data *)s->dyn_ltree,
 1070|  4.96k|                       (const ct_data *)s->dyn_dtree);
 1071|       |#ifdef ZLIB_DEBUG
 1072|       |        s->compressed_len += 3 + s->opt_len;
 1073|       |#endif
 1074|  4.96k|    }
 1075|  8.39k|    Assert (s->compressed_len == s->bits_sent, "bad compressed size");
 1076|       |    /* The above check is made mod 2^32, for files larger than 512 MB
 1077|       |     * and uLong implemented on 32 bits.
 1078|       |     */
 1079|  8.39k|    init_block(s);
 1080|       |
 1081|  8.39k|    if (last) {
  ------------------
  |  Branch (1081:9): [True: 2.19k, False: 6.20k]
  ------------------
 1082|  2.19k|        bi_windup(s);
 1083|       |#ifdef ZLIB_DEBUG
 1084|       |        s->compressed_len += 7;  /* align on byte boundary */
 1085|       |#endif
 1086|  2.19k|    }
 1087|  8.39k|    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
 1088|  8.39k|           s->compressed_len - 7*last));
 1089|  8.39k|}
trees.c:tr_static_init:
  295|  2.19k|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.19k|}
trees.c:init_block:
  440|  10.5k|local void init_block(deflate_state *s) {
  441|  10.5k|    int n; /* iterates over tree elements */
  442|       |
  443|       |    /* Initialize the trees. */
  444|  3.03M|    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   40|  3.03M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   37|  3.03M|#define LITERALS  256
  |  |  ------------------
  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   34|  3.03M|#define LENGTH_CODES 29
  |  |  ------------------
  ------------------
                  for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   83|  3.02M|#define Freq fc.freq
  ------------------
  |  Branch (444:17): [True: 3.02M, False: 10.5k]
  ------------------
  445|   328k|    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   43|   328k|#define D_CODES   30
  ------------------
                  for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   83|   317k|#define Freq fc.freq
  ------------------
  |  Branch (445:17): [True: 317k, False: 10.5k]
  ------------------
  446|   211k|    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   46|   211k|#define BL_CODES  19
  ------------------
                  for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   83|   201k|#define Freq fc.freq
  ------------------
  |  Branch (446:17): [True: 201k, False: 10.5k]
  ------------------
  447|       |
  448|  10.5k|    s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   50|  10.5k|#define END_BLOCK 256
  ------------------
                  s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   83|  10.5k|#define Freq fc.freq
  ------------------
  449|  10.5k|    s->opt_len = s->static_len = 0L;
  450|  10.5k|    s->sym_next = s->matches = 0;
  451|  10.5k|}
trees.c:bi_windup:
  181|  4.58k|local void bi_windup(deflate_state *s) {
  182|  4.58k|    if (s->bi_valid > 8) {
  ------------------
  |  Branch (182:9): [True: 1.01k, False: 3.57k]
  ------------------
  183|  1.01k|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|  1.01k|#define put_short(s, w) { \
  |  |  145|  1.01k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|  1.01k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  1.01k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|  1.01k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  1.01k|}
  ------------------
  184|  3.57k|    } else if (s->bi_valid > 0) {
  ------------------
  |  Branch (184:16): [True: 3.21k, False: 353]
  ------------------
  185|  3.21k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  290|  3.21k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  186|  3.21k|    }
  187|  4.58k|    s->bi_used = ((s->bi_valid - 1) & 7) + 1;
  188|  4.58k|    s->bi_buf = 0;
  189|  4.58k|    s->bi_valid = 0;
  190|       |#ifdef ZLIB_DEBUG
  191|       |    s->bits_sent = (s->bits_sent + 7) & ~7;
  192|       |#endif
  193|  4.58k|}
trees.c:bi_flush:
  166|  13.9k|local void bi_flush(deflate_state *s) {
  167|  13.9k|    if (s->bi_valid == 16) {
  ------------------
  |  Branch (167:9): [True: 286, False: 13.6k]
  ------------------
  168|    286|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|    286|#define put_short(s, w) { \
  |  |  145|    286|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  290|    286|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|    286|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  290|    286|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|    286|}
  ------------------
  169|    286|        s->bi_buf = 0;
  170|    286|        s->bi_valid = 0;
  171|  13.6k|    } else if (s->bi_valid >= 8) {
  ------------------
  |  Branch (171:16): [True: 2.11k, False: 11.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|  13.9k|}
trees.c:detect_data_type:
  966|  2.19k|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.19k|    unsigned long block_mask = 0xf3ffc07fUL;
  972|  2.19k|    int n;
  973|       |
  974|       |    /* Check for non-textual ("block-listed") bytes. */
  975|  10.9k|    for (n = 0; n <= 31; n++, block_mask >>= 1)
  ------------------
  |  Branch (975:17): [True: 10.7k, False: 237]
  ------------------
  976|  10.7k|        if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
  ------------------
  |  |   83|  8.24k|#define Freq fc.freq
  ------------------
  |  Branch (976:13): [True: 8.24k, False: 2.47k]
  |  Branch (976:33): [True: 1.95k, False: 6.29k]
  ------------------
  977|  1.95k|            return Z_BINARY;
  ------------------
  |  |  203|  1.95k|#define Z_BINARY   0
  ------------------
  978|       |
  979|       |    /* Check for textual ("allow-listed") bytes. */
  980|    237|    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    237|#define Freq fc.freq
  ------------------
                  if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    230|#define Freq fc.freq
  ------------------
  |  Branch (980:9): [True: 7, False: 230]
  |  Branch (980:38): [True: 35, False: 195]
  ------------------
  981|    237|            || s->dyn_ltree[13].Freq != 0)
  ------------------
  |  |   83|    195|#define Freq fc.freq
  ------------------
  |  Branch (981:16): [True: 15, False: 180]
  ------------------
  982|     57|        return Z_TEXT;
  ------------------
  |  |  204|     57|#define Z_TEXT     1
  ------------------
  983|  20.7k|    for (n = 32; n < LITERALS; n++)
  ------------------
  |  |   37|  20.7k|#define LITERALS  256
  ------------------
  |  Branch (983:18): [True: 20.7k, False: 1]
  ------------------
  984|  20.7k|        if (s->dyn_ltree[n].Freq != 0)
  ------------------
  |  |   83|  20.7k|#define Freq fc.freq
  ------------------
  |  Branch (984:13): [True: 179, False: 20.5k]
  ------------------
  985|    179|            return Z_TEXT;
  ------------------
  |  |  204|    359|#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|      1|    return Z_BINARY;
  ------------------
  |  |  203|      1|#define Z_BINARY   0
  ------------------
  991|    180|}
trees.c:build_tree:
  627|  25.1k|local void build_tree(deflate_state *s, tree_desc *desc) {
  628|  25.1k|    ct_data *tree         = desc->dyn_tree;
  629|  25.1k|    const ct_data *stree  = desc->stat_desc->static_tree;
  630|  25.1k|    int elems             = desc->stat_desc->elems;
  631|  25.1k|    int n, m;          /* iterate over heap elements */
  632|  25.1k|    int max_code = -1; /* largest code with non zero frequency */
  633|  25.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|  25.1k|    s->heap_len = 0, s->heap_max = HEAP_SIZE;
  ------------------
  |  |   49|  25.1k|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  25.1k|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  25.1k|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  25.1k|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|       |
  641|  2.83M|    for (n = 0; n < elems; n++) {
  ------------------
  |  Branch (641:17): [True: 2.81M, False: 25.1k]
  ------------------
  642|  2.81M|        if (tree[n].Freq != 0) {
  ------------------
  |  |   83|  2.81M|#define Freq fc.freq
  ------------------
  |  Branch (642:13): [True: 1.95M, False: 857k]
  ------------------
  643|  1.95M|            s->heap[++(s->heap_len)] = max_code = n;
  644|  1.95M|            s->depth[n] = 0;
  645|  1.95M|        } else {
  646|   857k|            tree[n].Len = 0;
  ------------------
  |  |   86|   857k|#define Len  dl.len
  ------------------
  647|   857k|        }
  648|  2.81M|    }
  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|  27.8k|    while (s->heap_len < 2) {
  ------------------
  |  Branch (655:12): [True: 2.66k, False: 25.1k]
  ------------------
  656|  2.66k|        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
  ------------------
  |  Branch (656:44): [True: 2.20k, False: 456]
  ------------------
  657|  2.66k|        tree[node].Freq = 1;
  ------------------
  |  |   83|  2.66k|#define Freq fc.freq
  ------------------
  658|  2.66k|        s->depth[node] = 0;
  659|  2.66k|        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
  ------------------
  |  |   86|  2.66k|#define Len  dl.len
  ------------------
  |  Branch (659:27): [True: 2.66k, False: 0]
  ------------------
  660|       |        /* node is 0 or 1 so it does not have extra bits */
  661|  2.66k|    }
  662|  25.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|   997k|    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
  ------------------
  |  Branch (667:29): [True: 972k, False: 25.1k]
  ------------------
  668|       |
  669|       |    /* Construct the Huffman tree by repeatedly combining the least two
  670|       |     * frequent nodes.
  671|       |     */
  672|  25.1k|    node = elems;              /* next internal node of the tree */
  673|  1.93M|    do {
  674|  1.93M|        pqremove(s, tree, n);  /* n = node of least frequency */
  ------------------
  |  |  488|  1.93M|#define pqremove(s, tree, top) \
  |  |  489|  1.93M|{\
  |  |  490|  1.93M|    top = s->heap[SMALLEST]; \
  |  |  ------------------
  |  |  |  |  480|  1.93M|#define SMALLEST 1
  |  |  ------------------
  |  |  491|  1.93M|    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
  |  |  ------------------
  |  |  |  |  480|  1.93M|#define SMALLEST 1
  |  |  ------------------
  |  |  492|  1.93M|    pqdownheap(s, tree, SMALLEST); \
  |  |  ------------------
  |  |  |  |  480|  1.93M|#define SMALLEST 1
  |  |  ------------------
  |  |  493|  1.93M|}
  ------------------
  675|  1.93M|        m = s->heap[SMALLEST]; /* m = node of next least frequency */
  ------------------
  |  |  480|  1.93M|#define SMALLEST 1
  ------------------
  676|       |
  677|  1.93M|        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
  678|  1.93M|        s->heap[--(s->heap_max)] = m;
  679|       |
  680|       |        /* Create a new node father of n and m */
  681|  1.93M|        tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.93M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.93M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.93M|#define Freq fc.freq
  ------------------
  682|  1.93M|        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
  ------------------
  |  Branch (682:33): [True: 1.73M, False: 198k]
  ------------------
  683|  1.73M|                                s->depth[n] : s->depth[m]) + 1);
  684|  1.93M|        tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  1.93M|#define Dad  dl.dad
  ------------------
                      tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  1.93M|#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.93M|        s->heap[SMALLEST] = node++;
  ------------------
  |  |  480|  1.93M|#define SMALLEST 1
  ------------------
  693|  1.93M|        pqdownheap(s, tree, SMALLEST);
  ------------------
  |  |  480|  1.93M|#define SMALLEST 1
  ------------------
  694|       |
  695|  1.93M|    } while (s->heap_len >= 2);
  ------------------
  |  Branch (695:14): [True: 1.90M, False: 25.1k]
  ------------------
  696|       |
  697|  25.1k|    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
  ------------------
  |  |  480|  25.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|  25.1k|    gen_bitlen(s, (tree_desc *)desc);
  703|       |
  704|       |    /* The field len is now set, we can generate the bit codes */
  705|  25.1k|    gen_codes ((ct_data *)tree, max_code, s->bl_count);
  706|  25.1k|}
trees.c:pqdownheap:
  509|  4.83M|local void pqdownheap(deflate_state *s, ct_data *tree, int k) {
  510|  4.83M|    int v = s->heap[k];
  511|  4.83M|    int j = k << 1;  /* left son of k */
  512|  25.5M|    while (j <= s->heap_len) {
  ------------------
  |  Branch (512:12): [True: 21.7M, False: 3.87M]
  ------------------
  513|       |        /* Set j to the smallest of the two sons: */
  514|  21.7M|        if (j < s->heap_len &&
  ------------------
  |  Branch (514:13): [True: 21.4M, False: 261k]
  ------------------
  515|  21.7M|            smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
  ------------------
  |  |  500|  21.4M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  21.4M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  42.9M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 6.46M, False: 14.9M]
  |  |  ------------------
  |  |  501|  21.4M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  14.9M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  29.9M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 4.14M, False: 10.8M]
  |  |  |  Branch (501:37): [True: 3.74M, False: 405k]
  |  |  ------------------
  ------------------
  516|  10.2M|            j++;
  517|  10.2M|        }
  518|       |        /* Exit if v is smaller than both sons */
  519|  21.7M|        if (smaller(tree, v, s->heap[j], s->depth)) break;
  ------------------
  |  |  500|  21.7M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  21.7M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  43.4M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 762k, False: 20.9M]
  |  |  ------------------
  |  |  501|  21.7M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  20.9M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  41.9M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 304k, False: 20.6M]
  |  |  |  Branch (501:37): [True: 193k, False: 110k]
  |  |  ------------------
  ------------------
  520|       |
  521|       |        /* Exchange v with the smallest son */
  522|  20.7M|        s->heap[k] = s->heap[j];  k = j;
  523|       |
  524|       |        /* And continue down the tree, setting j to the left son of k */
  525|  20.7M|        j <<= 1;
  526|  20.7M|    }
  527|  4.83M|    s->heap[k] = v;
  528|  4.83M|}
trees.c:gen_bitlen:
  540|  25.1k|local void gen_bitlen(deflate_state *s, tree_desc *desc) {
  541|  25.1k|    ct_data *tree        = desc->dyn_tree;
  542|  25.1k|    int max_code         = desc->max_code;
  543|  25.1k|    const ct_data *stree = desc->stat_desc->static_tree;
  544|  25.1k|    const intf *extra    = desc->stat_desc->extra_bits;
  545|  25.1k|    int base             = desc->stat_desc->extra_base;
  546|  25.1k|    int max_length       = desc->stat_desc->max_length;
  547|  25.1k|    int h;              /* heap index */
  548|  25.1k|    int n, m;           /* iterate over the tree elements */
  549|  25.1k|    int bits;           /* bit length */
  550|  25.1k|    int xbits;          /* extra bits */
  551|  25.1k|    ush f;              /* frequency */
  552|  25.1k|    int overflow = 0;   /* number of elements with bit length too large */
  553|       |
  554|   427k|    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
  ------------------
  |  |   52|   427k|#define MAX_BITS 15
  ------------------
  |  Branch (554:20): [True: 402k, False: 25.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|  25.1k|    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
  ------------------
  |  |   86|  25.1k|#define Len  dl.len
  ------------------
  560|       |
  561|  3.88M|    for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
  ------------------
  |  |   49|  3.88M|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  3.88M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  3.88M|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.88M|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (561:31): [True: 3.86M, False: 25.1k]
  ------------------
  562|  3.86M|        n = s->heap[h];
  563|  3.86M|        bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   85|  3.86M|#define Dad  dl.dad
  ------------------
                      bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   86|  3.86M|#define Len  dl.len
  ------------------
  564|  3.86M|        if (bits > max_length) bits = max_length, overflow++;
  ------------------
  |  Branch (564:13): [True: 4.77k, False: 3.85M]
  ------------------
  565|  3.86M|        tree[n].Len = (ush)bits;
  ------------------
  |  |   86|  3.86M|#define Len  dl.len
  ------------------
  566|       |        /* We overwrite tree[n].Dad which is no longer needed */
  567|       |
  568|  3.86M|        if (n > max_code) continue; /* not a leaf node */
  ------------------
  |  Branch (568:13): [True: 1.90M, False: 1.95M]
  ------------------
  569|       |
  570|  1.95M|        s->bl_count[bits]++;
  571|  1.95M|        xbits = 0;
  572|  1.95M|        if (n >= base) xbits = extra[n - base];
  ------------------
  |  Branch (572:13): [True: 228k, False: 1.72M]
  ------------------
  573|  1.95M|        f = tree[n].Freq;
  ------------------
  |  |   83|  1.95M|#define Freq fc.freq
  ------------------
  574|  1.95M|        s->opt_len += (ulg)f * (unsigned)(bits + xbits);
  575|  1.95M|        if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
  ------------------
  |  |   86|  1.86M|#define Len  dl.len
  ------------------
  |  Branch (575:13): [True: 1.86M, False: 90.1k]
  ------------------
  576|  1.95M|    }
  577|  25.1k|    if (overflow == 0) return;
  ------------------
  |  Branch (577:9): [True: 23.7k, False: 1.46k]
  ------------------
  578|       |
  579|  1.46k|    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|  2.38k|    do {
  584|  2.38k|        bits = max_length - 1;
  585|  2.81k|        while (s->bl_count[bits] == 0) bits--;
  ------------------
  |  Branch (585:16): [True: 425, False: 2.38k]
  ------------------
  586|  2.38k|        s->bl_count[bits]--;        /* move one leaf down the tree */
  587|  2.38k|        s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
  588|  2.38k|        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|  2.38k|        overflow -= 2;
  593|  2.38k|    } while (overflow > 0);
  ------------------
  |  Branch (593:14): [True: 922, False: 1.46k]
  ------------------
  594|       |
  595|       |    /* Now recompute all bit lengths, scanning in increasing frequency.
  596|       |     * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
  597|       |     * lengths instead of fixing only the wrong ones. This idea is taken
  598|       |     * from 'ar' written by Haruhiko Okumura.)
  599|       |     */
  600|  11.8k|    for (bits = max_length; bits != 0; bits--) {
  ------------------
  |  Branch (600:29): [True: 10.4k, False: 1.46k]
  ------------------
  601|  10.4k|        n = s->bl_count[bits];
  602|  55.4k|        while (n != 0) {
  ------------------
  |  Branch (602:16): [True: 45.0k, False: 10.4k]
  ------------------
  603|  45.0k|            m = s->heap[--h];
  604|  45.0k|            if (m > max_code) continue;
  ------------------
  |  Branch (604:17): [True: 19.4k, False: 25.5k]
  ------------------
  605|  25.5k|            if ((unsigned) tree[m].Len != (unsigned) bits) {
  ------------------
  |  |   86|  25.5k|#define Len  dl.len
  ------------------
  |  Branch (605:17): [True: 2.30k, False: 23.2k]
  ------------------
  606|  2.30k|                Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
  607|  2.30k|                s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   86|  2.30k|#define Len  dl.len
  ------------------
                              s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   83|  2.30k|#define Freq fc.freq
  ------------------
  608|  2.30k|                tree[m].Len = (ush)bits;
  ------------------
  |  |   86|  2.30k|#define Len  dl.len
  ------------------
  609|  2.30k|            }
  610|  25.5k|            n--;
  611|  25.5k|        }
  612|  10.4k|    }
  613|  1.46k|}
trees.c:gen_codes:
  203|  25.1k|local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) {
  204|  25.1k|    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
  205|  25.1k|    unsigned code = 0;         /* running code value */
  206|  25.1k|    int bits;                  /* bit index */
  207|  25.1k|    int n;                     /* code index */
  208|       |
  209|       |    /* The distribution counts are first used to generate the code values
  210|       |     * without bit reversal.
  211|       |     */
  212|   402k|    for (bits = 1; bits <= MAX_BITS; bits++) {
  ------------------
  |  |   52|   402k|#define MAX_BITS 15
  ------------------
  |  Branch (212:20): [True: 377k, False: 25.1k]
  ------------------
  213|   377k|        code = (code + bl_count[bits - 1]) << 1;
  214|   377k|        next_code[bits] = (ush)code;
  215|   377k|    }
  216|       |    /* Check that the bit counts in bl_count are consistent. The last code
  217|       |     * must be all ones.
  218|       |     */
  219|  25.1k|    Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
  220|  25.1k|            "inconsistent bit counts");
  221|  25.1k|    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
  222|       |
  223|  2.61M|    for (n = 0;  n <= max_code; n++) {
  ------------------
  |  Branch (223:18): [True: 2.58M, False: 25.1k]
  ------------------
  224|  2.58M|        int len = tree[n].Len;
  ------------------
  |  |   86|  2.58M|#define Len  dl.len
  ------------------
  225|  2.58M|        if (len == 0) continue;
  ------------------
  |  Branch (225:13): [True: 631k, False: 1.95M]
  ------------------
  226|       |        /* Now reverse the bits */
  227|  1.95M|        tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
  ------------------
  |  |   84|  1.95M|#define Code fc.code
  ------------------
  228|       |
  229|  1.95M|        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
  230|  1.95M|            n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1));
  231|  1.95M|    }
  232|  25.1k|}
trees.c:bi_reverse:
  154|  1.95M|local unsigned bi_reverse(unsigned code, int len) {
  155|  1.95M|    register unsigned res = 0;
  156|  15.5M|    do {
  157|  15.5M|        res |= code & 1;
  158|  15.5M|        code >>= 1, res <<= 1;
  159|  15.5M|    } while (--len > 0);
  ------------------
  |  Branch (159:14): [True: 13.5M, False: 1.95M]
  ------------------
  160|  1.95M|    return res >> 1;
  161|  1.95M|}
trees.c:build_bl_tree:
  800|  8.39k|local int build_bl_tree(deflate_state *s) {
  801|  8.39k|    int max_blindex;  /* index of last bit length code of non zero freq */
  802|       |
  803|       |    /* Determine the bit length frequencies for literal and distance trees */
  804|  8.39k|    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
  805|  8.39k|    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
  806|       |
  807|       |    /* Build the bit length tree: */
  808|  8.39k|    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|  25.3k|    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
  ------------------
  |  |   46|  8.39k|#define BL_CODES  19
  ------------------
  |  Branch (817:36): [True: 25.3k, False: 0]
  ------------------
  818|  25.3k|        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
  ------------------
  |  |   86|  25.3k|#define Len  dl.len
  ------------------
  |  Branch (818:13): [True: 8.39k, False: 16.9k]
  ------------------
  819|  25.3k|    }
  820|       |    /* Update opt_len to include the bit length tree and counts */
  821|  8.39k|    s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
  822|  8.39k|    Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
  823|  8.39k|            s->opt_len, s->static_len));
  824|       |
  825|  8.39k|    return max_blindex;
  826|  8.39k|}
trees.c:scan_tree:
  712|  16.7k|local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
  713|  16.7k|    int n;                     /* iterates over all tree elements */
  714|  16.7k|    int prevlen = -1;          /* last emitted length */
  715|  16.7k|    int curlen;                /* length of current code */
  716|  16.7k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  16.7k|#define Len  dl.len
  ------------------
  717|  16.7k|    int count = 0;             /* repeat count of the current code */
  718|  16.7k|    int max_count = 7;         /* max repeat count */
  719|  16.7k|    int min_count = 4;         /* min repeat count */
  720|       |
  721|  16.7k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (721:9): [True: 4.11k, False: 12.6k]
  ------------------
  722|  16.7k|    tree[max_code + 1].Len = (ush)0xffff; /* guard */
  ------------------
  |  |   86|  16.7k|#define Len  dl.len
  ------------------
  723|       |
  724|  2.44M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (724:17): [True: 2.43M, False: 16.7k]
  ------------------
  725|  2.43M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  2.43M|#define Len  dl.len
  ------------------
  726|  2.43M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (726:13): [True: 2.28M, False: 149k]
  |  Branch (726:36): [True: 1.66M, False: 621k]
  ------------------
  727|  1.66M|            continue;
  728|  1.66M|        } else if (count < min_count) {
  ------------------
  |  Branch (728:20): [True: 528k, False: 241k]
  ------------------
  729|   528k|            s->bl_tree[curlen].Freq += (ush)count;
  ------------------
  |  |   83|   528k|#define Freq fc.freq
  ------------------
  730|   528k|        } else if (curlen != 0) {
  ------------------
  |  Branch (730:20): [True: 206k, False: 35.2k]
  ------------------
  731|   206k|            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
  ------------------
  |  |   83|  84.9k|#define Freq fc.freq
  ------------------
  |  Branch (731:17): [True: 84.9k, False: 121k]
  ------------------
  732|   206k|            s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   53|   206k|#define REP_3_6      16
  ------------------
                          s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   83|   206k|#define Freq fc.freq
  ------------------
  733|   206k|        } else if (count <= 10) {
  ------------------
  |  Branch (733:20): [True: 23.5k, False: 11.7k]
  ------------------
  734|  23.5k|            s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   56|  23.5k|#define REPZ_3_10    17
  ------------------
                          s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   83|  23.5k|#define Freq fc.freq
  ------------------
  735|  23.5k|        } else {
  736|  11.7k|            s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   59|  11.7k|#define REPZ_11_138  18
  ------------------
                          s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   83|  11.7k|#define Freq fc.freq
  ------------------
  737|  11.7k|        }
  738|   770k|        count = 0; prevlen = curlen;
  739|   770k|        if (nextlen == 0) {
  ------------------
  |  Branch (739:13): [True: 71.4k, False: 699k]
  ------------------
  740|  71.4k|            max_count = 138, min_count = 3;
  741|   699k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (741:20): [True: 137k, False: 561k]
  ------------------
  742|   137k|            max_count = 6, min_count = 3;
  743|   561k|        } else {
  744|   561k|            max_count = 7, min_count = 4;
  745|   561k|        }
  746|   770k|    }
  747|  16.7k|}
trees.c:compress_block:
  901|  5.99k|                          const ct_data *dtree) {
  902|  5.99k|    unsigned dist;      /* distance of matched string */
  903|  5.99k|    int lc;             /* match length or unmatched char (if dist == 0) */
  904|  5.99k|    unsigned sx = 0;    /* running index in symbol buffers */
  905|  5.99k|    unsigned code;      /* the code to send */
  906|  5.99k|    int extra;          /* number of extra bits to send */
  907|       |
  908|  71.4M|    if (s->sym_next != 0) do {
  ------------------
  |  Branch (908:9): [True: 5.98k, False: 8]
  ------------------
  909|       |#ifdef LIT_MEM
  910|       |        dist = s->d_buf[sx];
  911|       |        lc = s->l_buf[sx++];
  912|       |#else
  913|  71.4M|        dist = s->sym_buf[sx++] & 0xff;
  914|  71.4M|        dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
  915|  71.4M|        lc = s->sym_buf[sx++];
  916|  71.4M|#endif
  917|  71.4M|        if (dist == 0) {
  ------------------
  |  Branch (917:13): [True: 68.2M, False: 3.19M]
  ------------------
  918|  68.2M|            send_code(s, lc, ltree); /* send a literal byte */
  ------------------
  |  |  239|  68.2M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  68.2M|#define send_bits(s, value, length) \
  |  |  |  |  275|  68.2M|{ int len = length;\
  |  |  |  |  276|  68.2M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  68.2M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 31.8M, False: 36.4M]
  |  |  |  |  ------------------
  |  |  |  |  277|  31.8M|    int val = (int)value;\
  |  |  |  |  278|  31.8M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  31.8M|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  31.8M|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  31.8M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  31.8M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  31.8M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  31.8M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  31.8M|}
  |  |  |  |  ------------------
  |  |  |  |  280|  31.8M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  31.8M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  31.8M|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  31.8M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  36.4M|  } else {\
  |  |  |  |  283|  36.4M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  36.4M|    s->bi_valid += len;\
  |  |  |  |  285|  36.4M|  }\
  |  |  |  |  286|  68.2M|}
  |  |  ------------------
  ------------------
  919|  68.2M|            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
  920|  68.2M|        } else {
  921|       |            /* Here, lc is the match length - MIN_MATCH */
  922|  3.19M|            code = _length_code[lc];
  923|  3.19M|            send_code(s, code + LITERALS + 1, ltree);   /* send length code */
  ------------------
  |  |  239|  3.19M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  3.19M|#define send_bits(s, value, length) \
  |  |  |  |  275|  3.19M|{ int len = length;\
  |  |  |  |  276|  3.19M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.19M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 897k, False: 2.29M]
  |  |  |  |  ------------------
  |  |  |  |  277|   897k|    int val = (int)value;\
  |  |  |  |  278|   897k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   897k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   897k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   897k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   897k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   897k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   897k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   897k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   897k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   897k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   897k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   897k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  2.29M|  } else {\
  |  |  |  |  283|  2.29M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.29M|    s->bi_valid += len;\
  |  |  |  |  285|  2.29M|  }\
  |  |  |  |  286|  3.19M|}
  |  |  ------------------
  ------------------
  924|  3.19M|            extra = extra_lbits[code];
  925|  3.19M|            if (extra != 0) {
  ------------------
  |  Branch (925:17): [True: 428k, False: 2.76M]
  ------------------
  926|   428k|                lc -= base_length[code];
  927|   428k|                send_bits(s, lc, extra);       /* send the extra length bits */
  ------------------
  |  |  274|   428k|#define send_bits(s, value, length) \
  |  |  275|   428k|{ int len = length;\
  |  |  276|   428k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   428k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 51.7k, False: 376k]
  |  |  ------------------
  |  |  277|  51.7k|    int val = (int)value;\
  |  |  278|  51.7k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  51.7k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  51.7k|#define put_short(s, w) { \
  |  |  |  |  145|  51.7k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  51.7k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  51.7k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  51.7k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  51.7k|}
  |  |  ------------------
  |  |  280|  51.7k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  51.7k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  51.7k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  51.7k|#define Buf_size 16
  |  |  ------------------
  |  |  282|   376k|  } else {\
  |  |  283|   376k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   376k|    s->bi_valid += len;\
  |  |  285|   376k|  }\
  |  |  286|   428k|}
  ------------------
  928|   428k|            }
  929|  3.19M|            dist--; /* dist is now the match distance - 1 */
  930|  3.19M|            code = d_code(dist);
  ------------------
  |  |  318|  3.19M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  ------------------
  |  |  |  Branch (318:5): [True: 940k, False: 2.25M]
  |  |  ------------------
  ------------------
  931|  3.19M|            Assert (code < D_CODES, "bad d_code");
  932|       |
  933|  3.19M|            send_code(s, code, dtree);       /* send the distance code */
  ------------------
  |  |  239|  3.19M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  3.19M|#define send_bits(s, value, length) \
  |  |  |  |  275|  3.19M|{ int len = length;\
  |  |  |  |  276|  3.19M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.19M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 804k, False: 2.39M]
  |  |  |  |  ------------------
  |  |  |  |  277|   804k|    int val = (int)value;\
  |  |  |  |  278|   804k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   804k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   804k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   804k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   804k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   804k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   804k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   804k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   804k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   804k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   804k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   804k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  2.39M|  } else {\
  |  |  |  |  283|  2.39M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.39M|    s->bi_valid += len;\
  |  |  |  |  285|  2.39M|  }\
  |  |  |  |  286|  3.19M|}
  |  |  ------------------
  ------------------
  934|  3.19M|            extra = extra_dbits[code];
  935|  3.19M|            if (extra != 0) {
  ------------------
  |  Branch (935:17): [True: 2.95M, False: 245k]
  ------------------
  936|  2.95M|                dist -= (unsigned)base_dist[code];
  937|  2.95M|                send_bits(s, dist, extra);   /* send the extra distance bits */
  ------------------
  |  |  274|  2.95M|#define send_bits(s, value, length) \
  |  |  275|  2.95M|{ int len = length;\
  |  |  276|  2.95M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  2.95M|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.59M, False: 1.35M]
  |  |  ------------------
  |  |  277|  1.59M|    int val = (int)value;\
  |  |  278|  1.59M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  1.59M|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  1.59M|#define put_short(s, w) { \
  |  |  |  |  145|  1.59M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.59M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.59M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.59M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  1.59M|}
  |  |  ------------------
  |  |  280|  1.59M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  1.59M|#define Buf_size 16
  |  |  ------------------
  |  |  281|  1.59M|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  1.59M|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.59M|  } else {\
  |  |  283|  1.35M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.35M|    s->bi_valid += len;\
  |  |  285|  1.35M|  }\
  |  |  286|  2.95M|}
  ------------------
  938|  2.95M|            }
  939|  3.19M|        } /* 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.4M|        Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
  946|  71.4M|#endif
  947|       |
  948|  71.4M|    } while (sx < s->sym_next);
  ------------------
  |  Branch (948:14): [True: 71.4M, False: 5.98k]
  ------------------
  949|       |
  950|  5.99k|    send_code(s, END_BLOCK, ltree);
  ------------------
  |  |  239|  5.99k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  5.99k|#define send_bits(s, value, length) \
  |  |  |  |  275|  5.99k|{ int len = length;\
  |  |  |  |  276|  5.99k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.99k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 4.06k, False: 1.93k]
  |  |  |  |  ------------------
  |  |  |  |  277|  4.06k|    int val = (int)value;\
  |  |  |  |  278|  4.06k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  4.06k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  4.06k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  4.06k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  4.06k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  4.06k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  4.06k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  4.06k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  4.06k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.06k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  4.06k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.06k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  4.06k|  } else {\
  |  |  |  |  283|  1.93k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  1.93k|    s->bi_valid += len;\
  |  |  |  |  285|  1.93k|  }\
  |  |  |  |  286|  5.99k|}
  |  |  ------------------
  ------------------
  951|  5.99k|}
trees.c:send_all_trees:
  834|  4.96k|                          int blcodes) {
  835|  4.96k|    int rank;                    /* index in bl_order */
  836|       |
  837|  4.96k|    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  838|  4.96k|    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  839|  4.96k|            "too many codes");
  840|  4.96k|    Tracev((stderr, "\nbl counts: "));
  841|  4.96k|    send_bits(s, lcodes - 257, 5);  /* not +255 as stated in appnote.txt */
  ------------------
  |  |  274|  4.96k|#define send_bits(s, value, length) \
  |  |  275|  4.96k|{ int len = length;\
  |  |  276|  4.96k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.96k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 4.96k]
  |  |  ------------------
  |  |  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.96k|  } else {\
  |  |  283|  4.96k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  4.96k|    s->bi_valid += len;\
  |  |  285|  4.96k|  }\
  |  |  286|  4.96k|}
  ------------------
  842|  4.96k|    send_bits(s, dcodes - 1,   5);
  ------------------
  |  |  274|  4.96k|#define send_bits(s, value, length) \
  |  |  275|  4.96k|{ int len = length;\
  |  |  276|  4.96k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.96k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.81k, False: 3.14k]
  |  |  ------------------
  |  |  277|  1.81k|    int val = (int)value;\
  |  |  278|  1.81k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  1.81k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  1.81k|#define put_short(s, w) { \
  |  |  |  |  145|  1.81k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.81k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  1.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  1.81k|}
  |  |  ------------------
  |  |  280|  1.81k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  1.81k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  1.81k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  1.81k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.14k|  } else {\
  |  |  283|  3.14k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  3.14k|    s->bi_valid += len;\
  |  |  285|  3.14k|  }\
  |  |  286|  4.96k|}
  ------------------
  843|  4.96k|    send_bits(s, blcodes - 4,  4);  /* not -3 as stated in appnote.txt */
  ------------------
  |  |  274|  4.96k|#define send_bits(s, value, length) \
  |  |  275|  4.96k|{ int len = length;\
  |  |  276|  4.96k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.96k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 3.14k, False: 1.81k]
  |  |  ------------------
  |  |  277|  3.14k|    int val = (int)value;\
  |  |  278|  3.14k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  3.14k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  3.14k|#define put_short(s, w) { \
  |  |  |  |  145|  3.14k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  3.14k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  3.14k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  3.14k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  3.14k|}
  |  |  ------------------
  |  |  280|  3.14k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  3.14k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  3.14k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  3.14k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.14k|  } else {\
  |  |  283|  1.81k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.81k|    s->bi_valid += len;\
  |  |  285|  1.81k|  }\
  |  |  286|  4.96k|}
  ------------------
  844|  87.3k|    for (rank = 0; rank < blcodes; rank++) {
  ------------------
  |  Branch (844:20): [True: 82.3k, False: 4.96k]
  ------------------
  845|  82.3k|        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
  846|  82.3k|        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
  ------------------
  |  |  274|  82.3k|#define send_bits(s, value, length) \
  |  |  275|  82.3k|{ int len = length;\
  |  |  276|  82.3k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  82.3k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 14.5k, False: 67.7k]
  |  |  ------------------
  |  |  277|  14.5k|    int val = (int)value;\
  |  |  278|  14.5k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  14.5k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  14.5k|#define put_short(s, w) { \
  |  |  |  |  145|  14.5k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  14.5k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  14.5k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  14.5k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  14.5k|}
  |  |  ------------------
  |  |  280|  14.5k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  14.5k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  14.5k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  14.5k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  67.7k|  } else {\
  |  |  283|  67.7k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  67.7k|    s->bi_valid += len;\
  |  |  285|  67.7k|  }\
  |  |  286|  82.3k|}
  ------------------
  847|  82.3k|    }
  848|  4.96k|    Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
  849|       |
  850|  4.96k|    send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
  851|  4.96k|    Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
  852|       |
  853|  4.96k|    send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
  854|  4.96k|    Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
  855|  4.96k|}
trees.c:send_tree:
  753|  9.92k|local void send_tree(deflate_state *s, ct_data *tree, int max_code) {
  754|  9.92k|    int n;                     /* iterates over all tree elements */
  755|  9.92k|    int prevlen = -1;          /* last emitted length */
  756|  9.92k|    int curlen;                /* length of current code */
  757|  9.92k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  9.92k|#define Len  dl.len
  ------------------
  758|  9.92k|    int count = 0;             /* repeat count of the current code */
  759|  9.92k|    int max_count = 7;         /* max repeat count */
  760|  9.92k|    int min_count = 4;         /* min repeat count */
  761|       |
  762|       |    /* tree[max_code + 1].Len = -1; */  /* guard already set */
  763|  9.92k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (763:9): [True: 2.21k, False: 7.71k]
  ------------------
  764|       |
  765|  1.49M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (765:17): [True: 1.48M, False: 9.92k]
  ------------------
  766|  1.48M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  1.48M|#define Len  dl.len
  ------------------
  767|  1.48M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (767:13): [True: 1.41M, False: 67.3k]
  |  Branch (767:36): [True: 907k, False: 510k]
  ------------------
  768|   907k|            continue;
  769|   907k|        } else if (count < min_count) {
  ------------------
  |  Branch (769:20): [True: 439k, False: 138k]
  ------------------
  770|   608k|            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
  ------------------
  |  |  239|   608k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   608k|#define send_bits(s, value, length) \
  |  |  |  |  275|   608k|{ int len = length;\
  |  |  |  |  276|   608k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   608k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 103k, False: 504k]
  |  |  |  |  ------------------
  |  |  |  |  277|   103k|    int val = (int)value;\
  |  |  |  |  278|   103k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   103k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   103k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   103k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   103k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   103k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|   103k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   103k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   103k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   103k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   103k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   103k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|   504k|  } else {\
  |  |  |  |  283|   504k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|   504k|    s->bi_valid += len;\
  |  |  |  |  285|   504k|  }\
  |  |  |  |  286|   608k|}
  |  |  ------------------
  ------------------
  |  Branch (770:61): [True: 168k, False: 439k]
  ------------------
  771|       |
  772|   439k|        } else if (curlen != 0) {
  ------------------
  |  Branch (772:20): [True: 118k, False: 20.2k]
  ------------------
  773|   118k|            if (curlen != prevlen) {
  ------------------
  |  Branch (773:17): [True: 73.9k, False: 44.2k]
  ------------------
  774|  73.9k|                send_code(s, curlen, s->bl_tree); count--;
  ------------------
  |  |  239|  73.9k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  73.9k|#define send_bits(s, value, length) \
  |  |  |  |  275|  73.9k|{ int len = length;\
  |  |  |  |  276|  73.9k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  73.9k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 8.35k, False: 65.5k]
  |  |  |  |  ------------------
  |  |  |  |  277|  8.35k|    int val = (int)value;\
  |  |  |  |  278|  8.35k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  8.35k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  8.35k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  8.35k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  8.35k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  8.35k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  8.35k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  8.35k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  8.35k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  8.35k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  8.35k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  8.35k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  65.5k|  } else {\
  |  |  |  |  283|  65.5k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  65.5k|    s->bi_valid += len;\
  |  |  |  |  285|  65.5k|  }\
  |  |  |  |  286|  73.9k|}
  |  |  ------------------
  ------------------
  775|  73.9k|            }
  776|   118k|            Assert(count >= 3 && count <= 6, " 3_6?");
  777|   118k|            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  239|   118k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   118k|#define send_bits(s, value, length) \
  |  |  |  |  275|   118k|{ int len = length;\
  |  |  |  |  276|   118k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   118k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 18.6k, False: 99.4k]
  |  |  |  |  ------------------
  |  |  |  |  277|  18.6k|    int val = (int)value;\
  |  |  |  |  278|  18.6k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  18.6k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  18.6k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  18.6k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  18.6k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  18.6k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  18.6k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  18.6k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  18.6k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  18.6k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  18.6k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  18.6k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  99.4k|  } else {\
  |  |  |  |  283|  99.4k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  99.4k|    s->bi_valid += len;\
  |  |  |  |  285|  99.4k|  }\
  |  |  |  |  286|   118k|}
  |  |  ------------------
  ------------------
                          send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  274|   118k|#define send_bits(s, value, length) \
  |  |  275|   118k|{ int len = length;\
  |  |  276|   118k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   118k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 14.9k, False: 103k]
  |  |  ------------------
  |  |  277|  14.9k|    int val = (int)value;\
  |  |  278|  14.9k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  14.9k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  14.9k|#define put_short(s, w) { \
  |  |  |  |  145|  14.9k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  14.9k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  14.9k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  14.9k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  14.9k|}
  |  |  ------------------
  |  |  280|  14.9k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  14.9k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  14.9k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  14.9k|#define Buf_size 16
  |  |  ------------------
  |  |  282|   103k|  } else {\
  |  |  283|   103k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   103k|    s->bi_valid += len;\
  |  |  285|   103k|  }\
  |  |  286|   118k|}
  ------------------
  778|       |
  779|   118k|        } else if (count <= 10) {
  ------------------
  |  Branch (779:20): [True: 14.8k, False: 5.38k]
  ------------------
  780|  14.8k|            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  239|  14.8k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  14.8k|#define send_bits(s, value, length) \
  |  |  |  |  275|  14.8k|{ int len = length;\
  |  |  |  |  276|  14.8k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  14.8k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 4.20k, False: 10.6k]
  |  |  |  |  ------------------
  |  |  |  |  277|  4.20k|    int val = (int)value;\
  |  |  |  |  278|  4.20k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  4.20k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  4.20k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  4.20k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  4.20k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  4.20k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  4.20k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  4.20k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  4.20k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.20k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  4.20k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.20k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  10.6k|  } else {\
  |  |  |  |  283|  10.6k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  10.6k|    s->bi_valid += len;\
  |  |  |  |  285|  10.6k|  }\
  |  |  |  |  286|  14.8k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  274|  14.8k|#define send_bits(s, value, length) \
  |  |  275|  14.8k|{ int len = length;\
  |  |  276|  14.8k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  14.8k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 2.81k, False: 12.0k]
  |  |  ------------------
  |  |  277|  2.81k|    int val = (int)value;\
  |  |  278|  2.81k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  2.81k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.81k|#define put_short(s, w) { \
  |  |  |  |  145|  2.81k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  2.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.81k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  2.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.81k|}
  |  |  ------------------
  |  |  280|  2.81k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.81k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  2.81k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.81k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  12.0k|  } else {\
  |  |  283|  12.0k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  12.0k|    s->bi_valid += len;\
  |  |  285|  12.0k|  }\
  |  |  286|  14.8k|}
  ------------------
  781|       |
  782|  14.8k|        } else {
  783|  5.38k|            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  239|  5.38k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  5.38k|#define send_bits(s, value, length) \
  |  |  |  |  275|  5.38k|{ int len = length;\
  |  |  |  |  276|  5.38k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  5.38k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 1.65k, False: 3.73k]
  |  |  |  |  ------------------
  |  |  |  |  277|  1.65k|    int val = (int)value;\
  |  |  |  |  278|  1.65k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  1.65k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  1.65k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  1.65k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  1.65k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.65k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  290|  1.65k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.65k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  1.65k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.65k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  1.65k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.65k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  3.73k|  } else {\
  |  |  |  |  283|  3.73k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  3.73k|    s->bi_valid += len;\
  |  |  |  |  285|  3.73k|  }\
  |  |  |  |  286|  5.38k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  274|  5.38k|#define send_bits(s, value, length) \
  |  |  275|  5.38k|{ int len = length;\
  |  |  276|  5.38k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  5.38k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 2.37k, False: 3.01k]
  |  |  ------------------
  |  |  277|  2.37k|    int val = (int)value;\
  |  |  278|  2.37k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  2.37k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.37k|#define put_short(s, w) { \
  |  |  |  |  145|  2.37k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  2.37k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.37k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  290|  2.37k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.37k|}
  |  |  ------------------
  |  |  280|  2.37k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.37k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  2.37k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.37k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.01k|  } else {\
  |  |  283|  3.01k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  3.01k|    s->bi_valid += len;\
  |  |  285|  3.01k|  }\
  |  |  286|  5.38k|}
  ------------------
  784|  5.38k|        }
  785|   577k|        count = 0; prevlen = curlen;
  786|   577k|        if (nextlen == 0) {
  ------------------
  |  Branch (786:13): [True: 42.0k, False: 535k]
  ------------------
  787|  42.0k|            max_count = 138, min_count = 3;
  788|   535k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (788:20): [True: 57.5k, False: 478k]
  ------------------
  789|  57.5k|            max_count = 6, min_count = 3;
  790|   478k|        } else {
  791|   478k|            max_count = 7, min_count = 4;
  792|   478k|        }
  793|   577k|    }
  794|  9.92k|}

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

