LLVMFuzzerTestOneInput:
   39|  2.25k|{
   40|  2.25k|    FuzzHelper f(data, size);
   41|  2.25k|    f.run();
   42|  2.25k|    return 0;
   43|  2.25k|}
_ZN10FuzzHelperC2EPKhm:
   12|  2.25k|        data(data),
   13|  2.25k|        size(size)
   14|  2.25k|    {
   15|  2.25k|    }
_ZN10FuzzHelper3runEv:
   19|  2.25k|    {
   20|  2.25k|        qpdf::global::options::fuzz_mode(true);
   21|       |
   22|  2.25k|        Pl_Discard discard;
   23|  2.25k|        Pl_Flate p("decode", &discard, Pl_Flate::a_deflate);
   24|  2.25k|        try {
   25|  2.25k|            p.write(data, size);
   26|  2.25k|            p.finish();
   27|  2.25k|        } catch (std::runtime_error const& e) {
   28|      0|            std::cerr << "runtime_error: " << e.what() << '\n';
   29|      0|        }
   30|  2.25k|    }

_ZNK8Pipeline4nextEv:
  103|  7.97k|    {
  104|  7.97k|        return next_;
  105|  7.97k|    }
_ZN8PipelineD2Ev:
   52|  4.50k|    virtual ~Pipeline() = default;

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

_ZN5QUtil17make_shared_arrayIhEENSt3__110shared_ptrIT_EEm:
  183|  2.25k|    {
  184|  2.25k|        return std::shared_ptr<T>(new T[n], std::default_delete<T[]>());
  185|  2.25k|    }

_ZN4qpdf6global7options9fuzz_modeEb:
  132|  2.25k|        {
  133|  2.25k|            set_uint32(qpdf_p_fuzz_mode, value ? QPDF_TRUE : QPDF_FALSE);
  ------------------
  |  |  142|  2.25k|#define QPDF_TRUE 1
  ------------------
                          set_uint32(qpdf_p_fuzz_mode, value ? QPDF_TRUE : QPDF_FALSE);
  ------------------
  |  |  143|  2.25k|#define QPDF_FALSE 0
  ------------------
  |  Branch (133:42): [True: 2.25k, False: 0]
  ------------------
  134|  2.25k|        }
_ZN4qpdf6global10set_uint32E12qpdf_param_ej:
   53|  2.25k|    {
   54|  2.25k|        handle_result(qpdf_global_set_uint32(param, value));
   55|  2.25k|    }
_ZN4qpdf6global13handle_resultE13qpdf_result_e:
   35|  2.25k|    {
   36|  2.25k|        if (result != qpdf_r_ok) {
  ------------------
  |  Branch (36:13): [True: 0, False: 2.25k]
  ------------------
   37|      0|            QUtil::handle_result_code(result, "qpdf::global");
   38|      0|        }
   39|  2.25k|    }

_ZN8PipelineC2EPKcPS_:
   11|  4.50k|    identifier(identifier),
   12|  4.50k|    next_(next)
   13|  4.50k|{
   14|  4.50k|}

_ZN10Pl_DiscardC2Ev:
    9|  2.25k|    Pipeline("discard", nullptr)
   10|  2.25k|{
   11|  2.25k|}
_ZN10Pl_DiscardD2Ev:
   14|  2.25k|Pl_Discard::~Pl_Discard() = default;
_ZN10Pl_Discard5writeEPKhm:
   18|  5.72k|{
   19|  5.72k|}
_ZN10Pl_Discard6finishEv:
   23|  2.25k|{
   24|  2.25k|}

_ZN8Pl_Flate7MembersC2EmNS_8action_eE:
   27|  2.25k|    out_bufsize(out_bufsize),
   28|  2.25k|    action(action),
   29|  2.25k|    initialized(false),
   30|  2.25k|    zdata(nullptr)
   31|  2.25k|{
   32|  2.25k|    this->outbuf = QUtil::make_shared_array<unsigned char>(out_bufsize);
   33|       |    // Indirect through zdata to reach the z_stream so we don't have to include zlib.h in
   34|       |    // Pl_Flate.hh.  This means people using shared library versions of qpdf don't have to have zlib
   35|       |    // development files available, which particularly helps in a Windows environment.
   36|  2.25k|    zdata = new z_stream;
   37|       |
   38|  2.25k|    util::no_ci_rt_error_if(
   39|  2.25k|        out_bufsize > UINT_MAX,
   40|  2.25k|        "Pl_Flate: zlib doesn't support buffer sizes larger than unsigned int");
   41|       |
   42|  2.25k|    z_stream& zstream = *(static_cast<z_stream*>(this->zdata));
   43|  2.25k|    zstream.zalloc = nullptr;
   44|  2.25k|    zstream.zfree = nullptr;
   45|  2.25k|    zstream.opaque = nullptr;
   46|  2.25k|    zstream.next_in = nullptr;
   47|  2.25k|    zstream.avail_in = 0;
   48|  2.25k|    zstream.next_out = this->outbuf.get();
   49|  2.25k|    zstream.avail_out = QIntC::to_uint(out_bufsize);
   50|       |
   51|  2.25k|    if (action == a_deflate && Pl_Flate::zopfli_enabled()) {
  ------------------
  |  Branch (51:9): [True: 2.25k, False: 0]
  |  Branch (51:32): [True: 0, False: 2.25k]
  ------------------
   52|      0|        zopfli_buf = std::make_unique<std::string>();
   53|      0|    }
   54|  2.25k|}
_ZN8Pl_Flate7MembersD2Ev:
   57|  2.25k|{
   58|  2.25k|    if (initialized) {
  ------------------
  |  Branch (58:9): [True: 0, False: 2.25k]
  ------------------
   59|      0|        z_stream& zstream = *(static_cast<z_stream*>(zdata));
   60|      0|        if (action == a_deflate) {
  ------------------
  |  Branch (60:13): [True: 0, False: 0]
  ------------------
   61|      0|            deflateEnd(&zstream);
   62|      0|        } else {
   63|      0|            inflateEnd(&zstream);
   64|      0|        }
   65|      0|    }
   66|       |
   67|  2.25k|    delete static_cast<z_stream*>(this->zdata);
   68|  2.25k|    zdata = nullptr;
   69|  2.25k|}
_ZN8Pl_FlateC2EPKcP8PipelineNS_8action_eEj:
   73|  2.25k|    Pipeline(identifier, next),
   74|  2.25k|    m(std::make_unique<Members>(QIntC::to_size(out_bufsize_int), action))
   75|  2.25k|{
   76|  2.25k|    util::assertion(next, "Attempt to create Pl_Flate with nullptr as next");
   77|  2.25k|}
_ZN8Pl_FlateD2Ev:
   80|  2.25k|Pl_Flate::~Pl_Flate() = default;
_ZN8Pl_Flate5writeEPKhm:
  110|  2.25k|{
  111|  2.25k|    util::assertion(
  112|  2.25k|        m->outbuf.get(), identifier + ": Pl_Flate: write() called after finish() called");
  113|  2.25k|    if (m->zopfli_buf) {
  ------------------
  |  Branch (113:9): [True: 0, False: 2.25k]
  ------------------
  114|      0|        m->zopfli_buf->append(reinterpret_cast<char const*>(data), len);
  115|      0|        return;
  116|      0|    }
  117|       |
  118|       |    // Write in chunks in case len is too big to fit in an int. Assume int is at least 32 bits.
  119|  2.25k|    static size_t const max_bytes = 1 << 30;
  120|  2.25k|    size_t bytes_left = len;
  121|  2.25k|    unsigned char const* buf = data;
  122|  4.50k|    while (bytes_left > 0) {
  ------------------
  |  Branch (122:12): [True: 2.25k, False: 2.25k]
  ------------------
  123|  2.25k|        size_t bytes = (bytes_left >= max_bytes ? max_bytes : bytes_left);
  ------------------
  |  Branch (123:25): [True: 0, False: 2.25k]
  ------------------
  124|  2.25k|        handleData(buf, bytes, (m->action == a_inflate ? Z_SYNC_FLUSH : Z_NO_FLUSH));
  ------------------
  |  Branch (124:33): [True: 0, False: 2.25k]
  ------------------
  125|  2.25k|        bytes_left -= bytes;
  126|  2.25k|        buf += bytes;
  127|  2.25k|    }
  128|  2.25k|}
_ZN8Pl_Flate10handleDataEPKhmi:
  132|  4.50k|{
  133|  4.50k|    util::no_ci_rt_error_if(
  134|  4.50k|        len > UINT_MAX, "Pl_Flate: zlib doesn't support data blocks larger than int");
  135|  4.50k|    z_stream& zstream = *(static_cast<z_stream*>(m->zdata));
  136|       |    // zlib is known not to modify the data pointed to by next_in but doesn't declare the field
  137|       |    // value const unless compiled to do so.
  138|  4.50k|    zstream.next_in = const_cast<unsigned char*>(data);
  139|  4.50k|    zstream.avail_in = QIntC::to_uint(len);
  140|       |
  141|  4.50k|    if (!m->initialized) {
  ------------------
  |  Branch (141:9): [True: 2.25k, False: 2.25k]
  ------------------
  142|  2.25k|        int err = Z_OK;
  143|       |
  144|       |        // deflateInit and inflateInit are macros that use old-style casts.
  145|  2.25k|#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || defined(__clang__))
  146|  2.25k|# pragma GCC diagnostic push
  147|  2.25k|# pragma GCC diagnostic ignored "-Wold-style-cast"
  148|  2.25k|#endif
  149|  2.25k|        if (m->action == a_deflate) {
  ------------------
  |  Branch (149:13): [True: 2.25k, False: 0]
  ------------------
  150|  2.25k|            err = deflateInit(&zstream, compression_level);
  151|  2.25k|        } else {
  152|      0|            err = inflateInit(&zstream);
  153|      0|        }
  154|  2.25k|#if ((defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || defined(__clang__))
  155|  2.25k|# pragma GCC diagnostic pop
  156|  2.25k|#endif
  157|       |
  158|  2.25k|        checkError("Init", err);
  159|  2.25k|        m->initialized = true;
  160|  2.25k|    }
  161|       |
  162|  4.50k|    int err = Z_OK;
  163|       |
  164|  4.50k|    bool done = false;
  165|  10.2k|    while (!done) {
  ------------------
  |  Branch (165:12): [True: 5.72k, False: 4.50k]
  ------------------
  166|  5.72k|        if (m->action == a_deflate) {
  ------------------
  |  Branch (166:13): [True: 5.72k, False: 0]
  ------------------
  167|  5.72k|            err = deflate(&zstream, flush);
  168|  5.72k|        } else {
  169|      0|            err = inflate(&zstream, flush);
  170|      0|        }
  171|  5.72k|        if ((m->action == a_inflate) && (err != Z_OK) && zstream.msg &&
  ------------------
  |  Branch (171:13): [True: 0, False: 5.72k]
  |  Branch (171:41): [True: 0, False: 0]
  |  Branch (171:58): [True: 0, False: 0]
  ------------------
  172|      0|            (strcmp(zstream.msg, "incorrect data check") == 0)) {
  ------------------
  |  Branch (172:13): [True: 0, False: 0]
  ------------------
  173|       |            // Other PDF readers ignore this specific error. Combining this with Z_SYNC_FLUSH
  174|       |            // enables qpdf to handle some broken zlib streams without losing data.
  175|      0|            err = Z_STREAM_END;
  176|      0|        }
  177|  5.72k|        switch (err) {
  178|      0|        case Z_BUF_ERROR:
  ------------------
  |  Branch (178:9): [True: 0, False: 5.72k]
  ------------------
  179|       |            // Probably shouldn't be able to happen, but possible as a boundary condition: if the
  180|       |            // last call to inflate exactly filled the output buffer, it's possible that the next
  181|       |            // call to inflate could have nothing to do. There are PDF files in the wild that have
  182|       |            // this error (including at least one in qpdf's test suite). In some cases, we want to
  183|       |            // know about this, because it indicates incorrect compression, so call a callback if
  184|       |            // provided.
  185|      0|            warn("input stream is complete but output may still be valid", err);
  186|      0|            done = true;
  187|      0|            break;
  188|       |
  189|  2.25k|        case Z_STREAM_END:
  ------------------
  |  Branch (189:9): [True: 2.25k, False: 3.47k]
  ------------------
  190|  2.25k|            done = true;
  191|       |            // fall through
  192|       |
  193|  5.72k|        case Z_OK:
  ------------------
  |  Branch (193:9): [True: 3.47k, False: 2.25k]
  ------------------
  194|  5.72k|            {
  195|  5.72k|                if ((zstream.avail_in == 0) && (zstream.avail_out > 0)) {
  ------------------
  |  Branch (195:21): [True: 4.63k, False: 1.09k]
  |  Branch (195:48): [True: 4.50k, False: 136]
  ------------------
  196|       |                    // There is nothing left to read, and there was sufficient buffer space to write
  197|       |                    // everything we needed, so we're done for now.
  198|  4.50k|                    done = true;
  199|  4.50k|                }
  200|  5.72k|                uLong ready = QIntC::to_ulong(m->out_bufsize - zstream.avail_out);
  201|  5.72k|                if (ready > 0) {
  ------------------
  |  Branch (201:21): [True: 5.72k, False: 5]
  ------------------
  202|  5.72k|                    if (::memory_limit && m->action != a_deflate) {
  ------------------
  |  Branch (202:25): [True: 5.72k, False: 0]
  |  Branch (202:43): [True: 0, False: 5.72k]
  ------------------
  203|      0|                        m->written += ready;
  204|      0|                        if (m->written > ::memory_limit) {
  ------------------
  |  Branch (204:29): [True: 0, False: 0]
  ------------------
  205|      0|                            throw std::runtime_error("PL_Flate memory limit exceeded");
  206|      0|                        }
  207|      0|                    }
  208|  5.72k|                    next()->write(m->outbuf.get(), ready);
  209|  5.72k|                    zstream.next_out = m->outbuf.get();
  210|  5.72k|                    zstream.avail_out = QIntC::to_uint(m->out_bufsize);
  211|  5.72k|                }
  212|  5.72k|            }
  213|  5.72k|            break;
  214|       |
  215|  5.72k|        default:
  ------------------
  |  Branch (215:9): [True: 0, False: 5.72k]
  ------------------
  216|      0|            checkError("data", err);
  217|  5.72k|        }
  218|  5.72k|    }
  219|  4.50k|}
_ZN8Pl_Flate6finishEv:
  223|  2.25k|{
  224|  2.25k|    if (m->written > ::memory_limit) {
  ------------------
  |  Branch (224:9): [True: 0, False: 2.25k]
  ------------------
  225|      0|        throw std::runtime_error("PL_Flate memory limit exceeded");
  226|      0|    }
  227|  2.25k|    try {
  228|  2.25k|        if (m->zopfli_buf) {
  ------------------
  |  Branch (228:13): [True: 0, False: 2.25k]
  ------------------
  229|      0|            finish_zopfli();
  230|  2.25k|        } else if (m->outbuf.get()) {
  ------------------
  |  Branch (230:20): [True: 2.25k, False: 0]
  ------------------
  231|  2.25k|            if (m->initialized) {
  ------------------
  |  Branch (231:17): [True: 2.25k, False: 0]
  ------------------
  232|  2.25k|                z_stream& zstream = *(static_cast<z_stream*>(m->zdata));
  233|  2.25k|                unsigned char buf[1];
  234|  2.25k|                buf[0] = '\0';
  235|  2.25k|                handleData(buf, 0, Z_FINISH);
  236|  2.25k|                int err = Z_OK;
  237|  2.25k|                if (m->action == a_deflate) {
  ------------------
  |  Branch (237:21): [True: 2.25k, False: 0]
  ------------------
  238|  2.25k|                    err = deflateEnd(&zstream);
  239|  2.25k|                } else {
  240|      0|                    err = inflateEnd(&zstream);
  241|      0|                }
  242|  2.25k|                m->initialized = false;
  243|  2.25k|                checkError("End", err);
  244|  2.25k|            }
  245|       |
  246|  2.25k|            m->outbuf = nullptr;
  247|  2.25k|        }
  248|  2.25k|    } catch (std::exception& e) {
  249|      0|        try {
  250|      0|            next()->finish();
  251|      0|        } catch (...) {
  252|       |            // ignore secondary exception
  253|      0|        }
  254|      0|        throw std::runtime_error(e.what());
  255|      0|    }
  256|  2.25k|    next()->finish();
  257|  2.25k|}
_ZN8Pl_Flate10checkErrorEPKci:
  267|  4.50k|{
  268|  4.50k|    z_stream& zstream = *(static_cast<z_stream*>(m->zdata));
  269|  4.50k|    if (error_code != Z_OK) {
  ------------------
  |  Branch (269:9): [True: 0, False: 4.50k]
  ------------------
  270|      0|        char const* action_str = (m->action == a_deflate ? "deflate" : "inflate");
  ------------------
  |  Branch (270:35): [True: 0, False: 0]
  ------------------
  271|      0|        std::string msg = identifier + ": " + action_str + ": " + prefix + ": ";
  272|       |
  273|      0|        if (zstream.msg) {
  ------------------
  |  Branch (273:13): [True: 0, False: 0]
  ------------------
  274|      0|            msg += zstream.msg;
  275|      0|        } else {
  276|      0|            switch (error_code) {
  277|      0|            case Z_ERRNO:
  ------------------
  |  Branch (277:13): [True: 0, False: 0]
  ------------------
  278|      0|                msg += "zlib system error";
  279|      0|                break;
  280|       |
  281|      0|            case Z_STREAM_ERROR:
  ------------------
  |  Branch (281:13): [True: 0, False: 0]
  ------------------
  282|      0|                msg += "zlib stream error";
  283|      0|                break;
  284|       |
  285|      0|            case Z_DATA_ERROR:
  ------------------
  |  Branch (285:13): [True: 0, False: 0]
  ------------------
  286|      0|                msg += "zlib data error";
  287|      0|                break;
  288|       |
  289|      0|            case Z_MEM_ERROR:
  ------------------
  |  Branch (289:13): [True: 0, False: 0]
  ------------------
  290|      0|                msg += "zlib memory error";
  291|      0|                break;
  292|       |
  293|      0|            case Z_BUF_ERROR:
  ------------------
  |  Branch (293:13): [True: 0, False: 0]
  ------------------
  294|      0|                msg += "zlib buffer error";
  295|      0|                break;
  296|       |
  297|      0|            case Z_VERSION_ERROR:
  ------------------
  |  Branch (297:13): [True: 0, False: 0]
  ------------------
  298|      0|                msg += "zlib version error";
  299|      0|                break;
  300|       |
  301|      0|            default:
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  ------------------
  302|      0|                msg += std::string("zlib unknown error (") + std::to_string(error_code) + ")";
  303|      0|                break;
  304|      0|            }
  305|      0|        }
  306|       |
  307|      0|        throw std::runtime_error(msg);
  308|      0|    }
  309|  4.50k|}
_ZN8Pl_Flate16zopfli_supportedEv:
  338|  2.25k|{
  339|       |#ifdef ZOPFLI
  340|       |    return true;
  341|       |#else
  342|  2.25k|    return false;
  343|  2.25k|#endif
  344|  2.25k|}
_ZN8Pl_Flate14zopfli_enabledEv:
  348|  2.25k|{
  349|  2.25k|    if (zopfli_supported()) {
  ------------------
  |  Branch (349:9): [True: 0, False: 2.25k]
  ------------------
  350|      0|        std::string value;
  351|      0|        static bool enabled = QUtil::get_env("QPDF_ZOPFLI", &value) && value != "disabled";
  ------------------
  |  Branch (351:31): [True: 0, False: 0]
  |  Branch (351:72): [True: 0, False: 0]
  ------------------
  352|      0|        return enabled;
  353|  2.25k|    } else {
  354|  2.25k|        return false;
  355|  2.25k|    }
  356|  2.25k|}

_ZN4qpdf6global7Options9fuzz_modeEb:
   13|  2.25k|{
   14|  2.25k|    if (value) {
  ------------------
  |  Branch (14:9): [True: 2.25k, False: 0]
  ------------------
   15|  2.25k|        o.fuzz_mode_ = true;
   16|       |        // Limit the memory used to decompress JPEG files during fuzzing. Excessive memory use
   17|       |        // during fuzzing is due to corrupt JPEG data which sometimes cannot be detected before
   18|       |        // jpeg_start_decompress is called. During normal use of qpdf very large JPEGs can
   19|       |        // occasionally occur legitimately and therefore must be allowed during normal operations.
   20|  2.25k|        Limits::dct_max_memory(10'000'000);
   21|  2.25k|        Limits::dct_max_progressive_scans(50);
   22|       |        // Do not decompress corrupt data. This may cause extended runtime within jpeglib without
   23|       |        // exercising additional code paths in qpdf.
   24|  2.25k|        dct_throw_on_corrupt_data(true);
   25|  2.25k|        Limits::png_max_memory(1'000'000);
   26|  2.25k|        Limits::flate_max_memory(200'000);
   27|  2.25k|        Limits::run_length_max_memory(1'000'000);
   28|  2.25k|        Limits::tiff_max_memory(1'000'000);
   29|       |        // Set a reasonable default maximum warnings per document for fuzzing to avoid time-outs due
   30|       |        // to extensive recovery efforts.
   31|  2.25k|        Limits::doc_max_warnings(200);
   32|  2.25k|    }
   33|  2.25k|}
qpdf_global_set_uint32:
  129|  2.25k|{
  130|  2.25k|    switch (param) {
  131|      0|    case qpdf_p_inspection_mode:
  ------------------
  |  Branch (131:5): [True: 0, False: 2.25k]
  ------------------
  132|      0|        Options::inspection_mode(value);
  133|      0|        return qpdf_r_ok;
  134|  2.25k|    case qpdf_p_fuzz_mode:
  ------------------
  |  Branch (134:5): [True: 2.25k, False: 0]
  ------------------
  135|  2.25k|        Options::fuzz_mode(value);
  136|  2.25k|        return qpdf_r_ok;
  137|      0|    case qpdf_p_default_limits:
  ------------------
  |  Branch (137:5): [True: 0, False: 2.25k]
  ------------------
  138|      0|        Options::default_limits(value);
  139|      0|        return qpdf_r_ok;
  140|      0|    case qpdf_p_dct_throw_on_corrupt_data:
  ------------------
  |  Branch (140:5): [True: 0, False: 2.25k]
  ------------------
  141|      0|        Options::dct_throw_on_corrupt_data(value);
  142|      0|        return qpdf_r_ok;
  143|      0|    case qpdf_p_doc_max_warnings:
  ------------------
  |  Branch (143:5): [True: 0, False: 2.25k]
  ------------------
  144|      0|        Limits::doc_max_warnings(value);
  145|      0|        return qpdf_r_ok;
  146|      0|    case qpdf_p_parser_max_nesting:
  ------------------
  |  Branch (146:5): [True: 0, False: 2.25k]
  ------------------
  147|      0|        Limits::parser_max_nesting(value);
  148|      0|        return qpdf_r_ok;
  149|      0|    case qpdf_p_parser_max_errors:
  ------------------
  |  Branch (149:5): [True: 0, False: 2.25k]
  ------------------
  150|      0|        Limits::parser_max_errors(value);
  151|      0|        return qpdf_r_ok;
  152|      0|    case qpdf_p_parser_max_container_size:
  ------------------
  |  Branch (152:5): [True: 0, False: 2.25k]
  ------------------
  153|      0|        Limits::parser_max_container_size(false, value);
  154|      0|        return qpdf_r_ok;
  155|      0|    case qpdf_p_parser_max_container_size_damaged:
  ------------------
  |  Branch (155:5): [True: 0, False: 2.25k]
  ------------------
  156|      0|        Limits::parser_max_container_size(true, value);
  157|      0|        return qpdf_r_ok;
  158|      0|    case qpdf_p_max_stream_filters:
  ------------------
  |  Branch (158:5): [True: 0, False: 2.25k]
  ------------------
  159|      0|        Limits::max_stream_filters(value);
  160|      0|        return qpdf_r_ok;
  161|      0|    case qpdf_p_dct_max_memory:
  ------------------
  |  Branch (161:5): [True: 0, False: 2.25k]
  ------------------
  162|      0|        Limits::dct_max_memory(util::fits<long>(value) ? static_cast<long>(value) : 0);
  ------------------
  |  Branch (162:32): [True: 0, False: 0]
  ------------------
  163|      0|        return qpdf_r_ok;
  164|      0|    case qpdf_p_dct_max_progressive_scans:
  ------------------
  |  Branch (164:5): [True: 0, False: 2.25k]
  ------------------
  165|      0|        Limits::dct_max_progressive_scans(util::fits<int>(value) ? static_cast<int>(value) : 0);
  ------------------
  |  Branch (165:43): [True: 0, False: 0]
  ------------------
  166|      0|        return qpdf_r_ok;
  167|      0|    case qpdf_p_flate_max_memory:
  ------------------
  |  Branch (167:5): [True: 0, False: 2.25k]
  ------------------
  168|      0|        Limits::flate_max_memory(value);
  169|      0|        return qpdf_r_ok;
  170|      0|    case qpdf_p_png_max_memory:
  ------------------
  |  Branch (170:5): [True: 0, False: 2.25k]
  ------------------
  171|      0|        Limits::png_max_memory(value);
  172|      0|        return qpdf_r_ok;
  173|      0|    case qpdf_p_run_length_max_memory:
  ------------------
  |  Branch (173:5): [True: 0, False: 2.25k]
  ------------------
  174|      0|        Limits::run_length_max_memory(value);
  175|      0|        return qpdf_r_ok;
  176|      0|    case qpdf_p_tiff_max_memory:
  ------------------
  |  Branch (176:5): [True: 0, False: 2.25k]
  ------------------
  177|      0|        Limits::tiff_max_memory(value);
  178|      0|        return qpdf_r_ok;
  179|      0|    default:
  ------------------
  |  Branch (179:5): [True: 0, False: 2.25k]
  ------------------
  180|      0|        return qpdf_r_bad_parameter;
  181|  2.25k|    }
  182|  2.25k|}

_ZN4qpdf4util4fitsIjTkNSt3__18integralEyQsr3stdE8integralIT_EEEbT0_:
   63|  9.00k|    {
   64|       |        if constexpr (std::cmp_less(
   65|       |                          std::numeric_limits<decltype(val)>::min(),
   66|       |                          std::numeric_limits<T>::min())) {
   67|       |            if (std::cmp_less(val, std::numeric_limits<T>::min())) {
   68|       |                return false;
   69|       |            }
   70|       |        }
   71|       |        if constexpr (std::cmp_greater(
   72|       |                          std::numeric_limits<decltype(val)>::max(),
   73|  9.00k|                          std::numeric_limits<T>::max())) {
   74|  9.00k|            if (std::cmp_greater(val, std::numeric_limits<T>::max())) {
  ------------------
  |  Branch (74:17): [True: 0, False: 9.00k]
  ------------------
   75|      0|                return false;
   76|      0|            }
   77|  9.00k|        }
   78|  9.00k|        return true;
   79|  9.00k|    }
_ZN4qpdf4util17no_ci_rt_error_ifIRA69_KcEEvbOT_:
   48|  2.25k|    {
   49|  2.25k|        if (cond) {
  ------------------
  |  Branch (49:13): [True: 0, False: 2.25k]
  ------------------
   50|      0|            throw std::runtime_error(std::forward<T>(msg));
   51|      0|        }
   52|  2.25k|    }
_ZN4qpdf4util9assertionIRA48_KcEEvbOT_:
   27|  2.25k|    {
   28|  2.25k|        if (!cond) {
  ------------------
  |  Branch (28:13): [True: 0, False: 2.25k]
  ------------------
   29|      0|            throw std::logic_error(std::forward<T>(msg));
   30|      0|        }
   31|  2.25k|    }
_ZN4qpdf4util9assertionINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEvbOT_:
   27|  2.25k|    {
   28|  2.25k|        if (!cond) {
  ------------------
  |  Branch (28:13): [True: 0, False: 2.25k]
  ------------------
   29|      0|            throw std::logic_error(std::forward<T>(msg));
   30|      0|        }
   31|  2.25k|    }
_ZN4qpdf4util17no_ci_rt_error_ifIRA59_KcEEvbOT_:
   48|  4.50k|    {
   49|  4.50k|        if (cond) {
  ------------------
  |  Branch (49:13): [True: 0, False: 4.50k]
  ------------------
   50|      0|            throw std::runtime_error(std::forward<T>(msg));
   51|      0|        }
   52|  4.50k|    }
_ZN4qpdf4util4fitsIjTkNSt3__18integralElQsr3stdE8integralIT_EEEbT0_:
   63|  2.25k|    {
   64|       |        if constexpr (std::cmp_less(
   65|       |                          std::numeric_limits<decltype(val)>::min(),
   66|  2.25k|                          std::numeric_limits<T>::min())) {
   67|  2.25k|            if (std::cmp_less(val, std::numeric_limits<T>::min())) {
  ------------------
  |  Branch (67:17): [True: 0, False: 2.25k]
  ------------------
   68|      0|                return false;
   69|      0|            }
   70|  2.25k|        }
   71|       |        if constexpr (std::cmp_greater(
   72|       |                          std::numeric_limits<decltype(val)>::max(),
   73|  2.25k|                          std::numeric_limits<T>::max())) {
   74|  2.25k|            if (std::cmp_greater(val, std::numeric_limits<T>::max())) {
  ------------------
  |  Branch (74:17): [True: 0, False: 2.25k]
  ------------------
   75|      0|                return false;
   76|      0|            }
   77|  2.25k|        }
   78|  2.25k|        return true;
   79|  2.25k|    }
_ZN4qpdf4util4fitsIjTkNSt3__18integralEiQsr3stdE8integralIT_EEEbT0_:
   63|  2.25k|    {
   64|       |        if constexpr (std::cmp_less(
   65|       |                          std::numeric_limits<decltype(val)>::min(),
   66|  2.25k|                          std::numeric_limits<T>::min())) {
   67|  2.25k|            if (std::cmp_less(val, std::numeric_limits<T>::min())) {
  ------------------
  |  Branch (67:17): [True: 0, False: 2.25k]
  ------------------
   68|      0|                return false;
   69|      0|            }
   70|  2.25k|        }
   71|       |        if constexpr (std::cmp_greater(
   72|       |                          std::numeric_limits<decltype(val)>::max(),
   73|       |                          std::numeric_limits<T>::max())) {
   74|       |            if (std::cmp_greater(val, std::numeric_limits<T>::max())) {
   75|       |                return false;
   76|       |            }
   77|       |        }
   78|  2.25k|        return true;
   79|  2.25k|    }

_ZN4qpdf6global6Limits16flate_max_memoryEv:
  104|      2|        {
  105|      2|            return l.flate_max_memory_;
  106|      2|        }
_ZN4qpdf6global6Limits16flate_max_memoryEy:
  110|  2.25k|        {
  111|  2.25k|            l.flate_max_memory_ = util::fits<uint32_t>(value) ? value : 0;
  ------------------
  |  Branch (111:35): [True: 2.25k, False: 0]
  ------------------
  112|  2.25k|        }
_ZN4qpdf6global6Limits16doc_max_warningsEj:
   28|  2.25k|        {
   29|  2.25k|            l.doc_max_warnings_ = value;
   30|  2.25k|        }
_ZN4qpdf6global6Limits14dct_max_memoryEl:
   86|  2.25k|        {
   87|  2.25k|            l.dct_max_memory_ = util::fits<uint32_t>(value) ? value : 0;
  ------------------
  |  Branch (87:33): [True: 2.25k, False: 0]
  ------------------
   88|  2.25k|        }
_ZN4qpdf6global6Limits25dct_max_progressive_scansEi:
   98|  2.25k|        {
   99|  2.25k|            l.dct_max_progressive_scans_ = util::fits<uint32_t>(value) ? value : 0;
  ------------------
  |  Branch (99:44): [True: 2.25k, False: 0]
  ------------------
  100|  2.25k|        }
_ZN4qpdf6global6Limits14png_max_memoryEy:
  122|  2.25k|        {
  123|  2.25k|            l.png_max_memory_ = util::fits<uint32_t>(value) ? value : 0;
  ------------------
  |  Branch (123:33): [True: 2.25k, False: 0]
  ------------------
  124|  2.25k|        }
_ZN4qpdf6global6Limits21run_length_max_memoryEy:
  134|  2.25k|        {
  135|  2.25k|            l.run_length_max_memory_ = util::fits<uint32_t>(value) ? value : 0;
  ------------------
  |  Branch (135:40): [True: 2.25k, False: 0]
  ------------------
  136|  2.25k|        }
_ZN4qpdf6global6Limits15tiff_max_memoryEy:
  146|  2.25k|        {
  147|  2.25k|            l.tiff_max_memory_ = util::fits<uint32_t>(value) ? value : 0;
  ------------------
  |  Branch (147:34): [True: 2.25k, False: 0]
  ------------------
  148|  2.25k|        }
_ZN4qpdf6global7Options25dct_throw_on_corrupt_dataEb:
  240|  2.25k|        {
  241|  2.25k|            o.dct_throw_on_corrupt_data_ = value;
  242|  2.25k|        }

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

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

_tr_init:
  456|  2.25k|void ZLIB_INTERNAL _tr_init(deflate_state *s) {
  457|  2.25k|    tr_static_init();
  458|       |
  459|  2.25k|    s->l_desc.dyn_tree = s->dyn_ltree;
  460|  2.25k|    s->l_desc.stat_desc = &static_l_desc;
  461|       |
  462|  2.25k|    s->d_desc.dyn_tree = s->dyn_dtree;
  463|  2.25k|    s->d_desc.stat_desc = &static_d_desc;
  464|       |
  465|  2.25k|    s->bl_desc.dyn_tree = s->bl_tree;
  466|  2.25k|    s->bl_desc.stat_desc = &static_bl_desc;
  467|       |
  468|  2.25k|    s->bi_buf = 0;
  469|  2.25k|    s->bi_valid = 0;
  470|  2.25k|    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.25k|    init_block(s);
  478|  2.25k|}
_tr_stored_block:
  861|  1.81k|                                    ulg stored_len, int last) {
  862|  1.81k|    send_bits(s, (STORED_BLOCK<<1) + last, 3);  /* send block type */
  ------------------
  |  |  274|  1.81k|#define send_bits(s, value, length) \
  |  |  275|  1.81k|{ int len = length;\
  |  |  276|  1.81k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  1.81k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 1.81k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.81k|  } else {\
  |  |  283|  1.81k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.81k|    s->bi_valid += len;\
  |  |  285|  1.81k|  }\
  |  |  286|  1.81k|}
  ------------------
  863|  1.81k|    bi_windup(s);        /* align on byte boundary */
  864|  1.81k|    put_short(s, (ush)stored_len);
  ------------------
  |  |  144|  1.81k|#define put_short(s, w) { \
  |  |  145|  1.81k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  1.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  1.81k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  1.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  1.81k|}
  ------------------
  865|  1.81k|    put_short(s, (ush)~stored_len);
  ------------------
  |  |  144|  1.81k|#define put_short(s, w) { \
  |  |  145|  1.81k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  1.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  1.81k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  1.81k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  1.81k|}
  ------------------
  866|  1.81k|    if (stored_len)
  ------------------
  |  Branch (866:9): [True: 1.81k, False: 0]
  ------------------
  867|  1.81k|        zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len);
  ------------------
  |  |  216|  1.81k|#    define zmemcpy memcpy
  ------------------
  868|  1.81k|    s->pending += stored_len;
  869|       |#ifdef ZLIB_DEBUG
  870|       |    s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
  871|       |    s->compressed_len += (stored_len + 4) << 3;
  872|       |    s->bits_sent += 2*16;
  873|       |    s->bits_sent += stored_len << 3;
  874|       |#endif
  875|  1.81k|}
_tr_flush_bits:
  880|  14.4k|void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) {
  881|  14.4k|    bi_flush(s);
  882|  14.4k|}
_tr_flush_block:
  998|  8.75k|                                   ulg stored_len, int last) {
  999|  8.75k|    ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
 1000|  8.75k|    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.75k|    if (s->level > 0) {
  ------------------
  |  Branch (1003:9): [True: 8.75k, False: 0]
  ------------------
 1004|       |
 1005|       |        /* Check if the file is binary or text */
 1006|  8.75k|        if (s->strm->data_type == Z_UNKNOWN)
  ------------------
  |  |  210|  8.75k|#define Z_UNKNOWN  2
  ------------------
  |  Branch (1006:13): [True: 2.25k, False: 6.50k]
  ------------------
 1007|  2.25k|            s->strm->data_type = detect_data_type(s);
 1008|       |
 1009|       |        /* Construct the literal and distance trees */
 1010|  8.75k|        build_tree(s, (tree_desc *)(&(s->l_desc)));
 1011|  8.75k|        Tracev((stderr, "\nlit data: dyn %lu, stat %lu", s->opt_len,
 1012|  8.75k|                s->static_len));
 1013|       |
 1014|  8.75k|        build_tree(s, (tree_desc *)(&(s->d_desc)));
 1015|  8.75k|        Tracev((stderr, "\ndist data: dyn %lu, stat %lu", s->opt_len,
 1016|  8.75k|                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.75k|        max_blindex = build_bl_tree(s);
 1025|       |
 1026|       |        /* Determine the best encoding. Compute the block lengths in bytes. */
 1027|  8.75k|        opt_lenb = (s->opt_len + 3 + 7) >> 3;
 1028|  8.75k|        static_lenb = (s->static_len + 3 + 7) >> 3;
 1029|       |
 1030|  8.75k|        Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
 1031|  8.75k|                opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
 1032|  8.75k|                s->sym_next / 3));
 1033|       |
 1034|  8.75k|#ifndef FORCE_STATIC
 1035|  8.75k|        if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
  ------------------
  |  |  203|  7.39k|#define Z_FIXED               4
  ------------------
  |  Branch (1035:13): [True: 1.35k, False: 7.39k]
  |  Branch (1035:40): [True: 0, False: 7.39k]
  ------------------
 1036|  1.35k|#endif
 1037|  1.35k|            opt_lenb = static_lenb;
 1038|       |
 1039|  8.75k|    } 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.75k|    if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
  ------------------
  |  Branch (1047:9): [True: 1.81k, False: 6.94k]
  |  Branch (1047:39): [True: 1.81k, False: 0]
  ------------------
 1048|       |                       /* 4: two words for the lengths */
 1049|  1.81k|#endif
 1050|       |        /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
 1051|       |         * Otherwise we can't have processed more than WSIZE input bytes since
 1052|       |         * the last block flush, because compression would have been
 1053|       |         * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
 1054|       |         * transform a block into a stored block.
 1055|       |         */
 1056|  1.81k|        _tr_stored_block(s, buf, stored_len, last);
 1057|       |
 1058|  6.94k|    } else if (static_lenb == opt_lenb) {
  ------------------
  |  Branch (1058:16): [True: 1.15k, False: 5.78k]
  ------------------
 1059|  1.15k|        send_bits(s, (STATIC_TREES<<1) + last, 3);
  ------------------
  |  |  274|  1.15k|#define send_bits(s, value, length) \
  |  |  275|  1.15k|{ int len = length;\
  |  |  276|  1.15k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  1.15k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 1.15k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.15k|  } else {\
  |  |  283|  1.15k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.15k|    s->bi_valid += len;\
  |  |  285|  1.15k|  }\
  |  |  286|  1.15k|}
  ------------------
 1060|  1.15k|        compress_block(s, (const ct_data *)static_ltree,
 1061|  1.15k|                       (const ct_data *)static_dtree);
 1062|       |#ifdef ZLIB_DEBUG
 1063|       |        s->compressed_len += 3 + s->static_len;
 1064|       |#endif
 1065|  5.78k|    } else {
 1066|  5.78k|        send_bits(s, (DYN_TREES<<1) + last, 3);
  ------------------
  |  |  274|  5.78k|#define send_bits(s, value, length) \
  |  |  275|  5.78k|{ int len = length;\
  |  |  276|  5.78k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  5.78k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 5.78k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  5.78k|  } else {\
  |  |  283|  5.78k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  5.78k|    s->bi_valid += len;\
  |  |  285|  5.78k|  }\
  |  |  286|  5.78k|}
  ------------------
 1067|  5.78k|        send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
 1068|  5.78k|                       max_blindex + 1);
 1069|  5.78k|        compress_block(s, (const ct_data *)s->dyn_ltree,
 1070|  5.78k|                       (const ct_data *)s->dyn_dtree);
 1071|       |#ifdef ZLIB_DEBUG
 1072|       |        s->compressed_len += 3 + s->opt_len;
 1073|       |#endif
 1074|  5.78k|    }
 1075|  8.75k|    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.75k|    init_block(s);
 1080|       |
 1081|  8.75k|    if (last) {
  ------------------
  |  Branch (1081:9): [True: 2.25k, False: 6.50k]
  ------------------
 1082|  2.25k|        bi_windup(s);
 1083|       |#ifdef ZLIB_DEBUG
 1084|       |        s->compressed_len += 7;  /* align on byte boundary */
 1085|       |#endif
 1086|  2.25k|    }
 1087|  8.75k|    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
 1088|  8.75k|           s->compressed_len - 7*(ulg)last));
 1089|  8.75k|}
trees.c:tr_static_init:
  295|  2.25k|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.25k|}
trees.c:init_block:
  440|  11.0k|local void init_block(deflate_state *s) {
  441|  11.0k|    int n; /* iterates over tree elements */
  442|       |
  443|       |    /* Initialize the trees. */
  444|  3.15M|    for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   40|  3.15M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   37|  3.15M|#define LITERALS  256
  |  |  ------------------
  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  ------------------
  |  |  |  |   34|  3.15M|#define LENGTH_CODES 29
  |  |  ------------------
  ------------------
                  for (n = 0; n < L_CODES;  n++) s->dyn_ltree[n].Freq = 0;
  ------------------
  |  |   83|  3.14M|#define Freq fc.freq
  ------------------
  |  Branch (444:17): [True: 3.14M, False: 11.0k]
  ------------------
  445|   341k|    for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   43|   341k|#define D_CODES   30
  ------------------
                  for (n = 0; n < D_CODES;  n++) s->dyn_dtree[n].Freq = 0;
  ------------------
  |  |   83|   330k|#define Freq fc.freq
  ------------------
  |  Branch (445:17): [True: 330k, False: 11.0k]
  ------------------
  446|   220k|    for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   46|   220k|#define BL_CODES  19
  ------------------
                  for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
  ------------------
  |  |   83|   209k|#define Freq fc.freq
  ------------------
  |  Branch (446:17): [True: 209k, False: 11.0k]
  ------------------
  447|       |
  448|  11.0k|    s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   50|  11.0k|#define END_BLOCK 256
  ------------------
                  s->dyn_ltree[END_BLOCK].Freq = 1;
  ------------------
  |  |   83|  11.0k|#define Freq fc.freq
  ------------------
  449|  11.0k|    s->opt_len = s->static_len = 0L;
  450|  11.0k|    s->sym_next = s->matches = 0;
  451|  11.0k|}
trees.c:bi_windup:
  181|  4.06k|local void bi_windup(deflate_state *s) {
  182|  4.06k|    if (s->bi_valid > 8) {
  ------------------
  |  Branch (182:9): [True: 1.12k, False: 2.93k]
  ------------------
  183|  1.12k|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|  1.12k|#define put_short(s, w) { \
  |  |  145|  1.12k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|  1.12k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|  1.12k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|  1.12k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|  1.12k|}
  ------------------
  184|  2.93k|    } else if (s->bi_valid > 0) {
  ------------------
  |  Branch (184:16): [True: 2.69k, False: 246]
  ------------------
  185|  2.69k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  293|  2.69k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  186|  2.69k|    }
  187|  4.06k|    s->bi_used = ((s->bi_valid - 1) & 7) + 1;
  188|  4.06k|    s->bi_buf = 0;
  189|  4.06k|    s->bi_valid = 0;
  190|       |#ifdef ZLIB_DEBUG
  191|       |    s->bits_sent = (s->bits_sent + 7) & ~(ulg)7;
  192|       |#endif
  193|  4.06k|}
trees.c:bi_flush:
  166|  14.4k|local void bi_flush(deflate_state *s) {
  167|  14.4k|    if (s->bi_valid == 16) {
  ------------------
  |  Branch (167:9): [True: 369, False: 14.0k]
  ------------------
  168|    369|        put_short(s, s->bi_buf);
  ------------------
  |  |  144|    369|#define put_short(s, w) { \
  |  |  145|    369|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  ------------------
  |  |  |  |  293|    369|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  146|    369|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  ------------------
  |  |  |  |  293|    369|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  ------------------
  |  |  147|    369|}
  ------------------
  169|    369|        s->bi_buf = 0;
  170|    369|        s->bi_valid = 0;
  171|  14.0k|    } else if (s->bi_valid >= 8) {
  ------------------
  |  Branch (171:16): [True: 2.43k, False: 11.6k]
  ------------------
  172|  2.43k|        put_byte(s, (Byte)s->bi_buf);
  ------------------
  |  |  293|  2.43k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  ------------------
  173|  2.43k|        s->bi_buf >>= 8;
  174|  2.43k|        s->bi_valid -= 8;
  175|  2.43k|    }
  176|  14.4k|}
trees.c:detect_data_type:
  966|  2.25k|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.25k|    unsigned long block_mask = 0xf3ffc07fUL;
  972|  2.25k|    int n;
  973|       |
  974|       |    /* Check for non-textual ("block-listed") bytes. */
  975|  13.0k|    for (n = 0; n <= 31; n++, block_mask >>= 1)
  ------------------
  |  Branch (975:17): [True: 12.7k, False: 302]
  ------------------
  976|  12.7k|        if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
  ------------------
  |  |   83|  9.74k|#define Freq fc.freq
  ------------------
  |  Branch (976:13): [True: 9.74k, False: 2.99k]
  |  Branch (976:33): [True: 1.94k, False: 7.79k]
  ------------------
  977|  1.94k|            return Z_BINARY;
  ------------------
  |  |  207|  1.94k|#define Z_BINARY   0
  ------------------
  978|       |
  979|       |    /* Check for textual ("allow-listed") bytes. */
  980|    302|    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    302|#define Freq fc.freq
  ------------------
                  if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
  ------------------
  |  |   83|    293|#define Freq fc.freq
  ------------------
  |  Branch (980:9): [True: 9, False: 293]
  |  Branch (980:38): [True: 18, False: 275]
  ------------------
  981|    275|            || s->dyn_ltree[13].Freq != 0)
  ------------------
  |  |   83|    275|#define Freq fc.freq
  ------------------
  |  Branch (981:16): [True: 25, False: 250]
  ------------------
  982|     52|        return Z_TEXT;
  ------------------
  |  |  208|     52|#define Z_TEXT     1
  ------------------
  983|  32.8k|    for (n = 32; n < LITERALS; n++)
  ------------------
  |  |   37|  32.8k|#define LITERALS  256
  ------------------
  |  Branch (983:18): [True: 32.8k, False: 7]
  ------------------
  984|  32.8k|        if (s->dyn_ltree[n].Freq != 0)
  ------------------
  |  |   83|  32.8k|#define Freq fc.freq
  ------------------
  |  Branch (984:13): [True: 243, False: 32.6k]
  ------------------
  985|    243|            return Z_TEXT;
  ------------------
  |  |  208|    493|#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|      7|    return Z_BINARY;
  ------------------
  |  |  207|      7|#define Z_BINARY   0
  ------------------
  991|    250|}
trees.c:build_tree:
  627|  26.2k|local void build_tree(deflate_state *s, tree_desc *desc) {
  628|  26.2k|    ct_data *tree         = desc->dyn_tree;
  629|  26.2k|    const ct_data *stree  = desc->stat_desc->static_tree;
  630|  26.2k|    int elems             = desc->stat_desc->elems;
  631|  26.2k|    int n, m;          /* iterate over heap elements */
  632|  26.2k|    int max_code = -1; /* largest code with non zero frequency */
  633|  26.2k|    int node;          /* new node being created */
  634|       |
  635|       |    /* Construct the initial heap, with least frequent element in
  636|       |     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n + 1].
  637|       |     * heap[0] is not used.
  638|       |     */
  639|  26.2k|    s->heap_len = 0, s->heap_max = HEAP_SIZE;
  ------------------
  |  |   49|  26.2k|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  26.2k|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  26.2k|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  26.2k|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  640|       |
  641|  2.95M|    for (n = 0; n < elems; n++) {
  ------------------
  |  Branch (641:17): [True: 2.93M, False: 26.2k]
  ------------------
  642|  2.93M|        if (tree[n].Freq != 0) {
  ------------------
  |  |   83|  2.93M|#define Freq fc.freq
  ------------------
  |  Branch (642:13): [True: 1.86M, False: 1.06M]
  ------------------
  643|  1.86M|            s->heap[++(s->heap_len)] = max_code = n;
  644|  1.86M|            s->depth[n] = 0;
  645|  1.86M|        } else {
  646|  1.06M|            tree[n].Len = 0;
  ------------------
  |  |   86|  1.06M|#define Len  dl.len
  ------------------
  647|  1.06M|        }
  648|  2.93M|    }
  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|  31.1k|    while (s->heap_len < 2) {
  ------------------
  |  Branch (655:12): [True: 4.88k, False: 26.2k]
  ------------------
  656|  4.88k|        node = s->heap[++(s->heap_len)] = (max_code < 2 ? ++max_code : 0);
  ------------------
  |  Branch (656:44): [True: 4.27k, False: 618]
  ------------------
  657|  4.88k|        tree[node].Freq = 1;
  ------------------
  |  |   83|  4.88k|#define Freq fc.freq
  ------------------
  658|  4.88k|        s->depth[node] = 0;
  659|  4.88k|        s->opt_len--; if (stree) s->static_len -= stree[node].Len;
  ------------------
  |  |   86|  4.88k|#define Len  dl.len
  ------------------
  |  Branch (659:27): [True: 4.88k, False: 0]
  ------------------
  660|       |        /* node is 0 or 1 so it does not have extra bits */
  661|  4.88k|    }
  662|  26.2k|    desc->max_code = max_code;
  663|       |
  664|       |    /* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree,
  665|       |     * establish sub-heaps of increasing lengths:
  666|       |     */
  667|   957k|    for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
  ------------------
  |  Branch (667:29): [True: 931k, False: 26.2k]
  ------------------
  668|       |
  669|       |    /* Construct the Huffman tree by repeatedly combining the least two
  670|       |     * frequent nodes.
  671|       |     */
  672|  26.2k|    node = elems;              /* next internal node of the tree */
  673|  1.84M|    do {
  674|  1.84M|        pqremove(s, tree, n);  /* n = node of least frequency */
  ------------------
  |  |  488|  1.84M|#define pqremove(s, tree, top) \
  |  |  489|  1.84M|{\
  |  |  490|  1.84M|    top = s->heap[SMALLEST]; \
  |  |  ------------------
  |  |  |  |  480|  1.84M|#define SMALLEST 1
  |  |  ------------------
  |  |  491|  1.84M|    s->heap[SMALLEST] = s->heap[s->heap_len--]; \
  |  |  ------------------
  |  |  |  |  480|  1.84M|#define SMALLEST 1
  |  |  ------------------
  |  |  492|  1.84M|    pqdownheap(s, tree, SMALLEST); \
  |  |  ------------------
  |  |  |  |  480|  1.84M|#define SMALLEST 1
  |  |  ------------------
  |  |  493|  1.84M|}
  ------------------
  675|  1.84M|        m = s->heap[SMALLEST]; /* m = node of next least frequency */
  ------------------
  |  |  480|  1.84M|#define SMALLEST 1
  ------------------
  676|       |
  677|  1.84M|        s->heap[--(s->heap_max)] = n; /* keep the nodes sorted by frequency */
  678|  1.84M|        s->heap[--(s->heap_max)] = m;
  679|       |
  680|       |        /* Create a new node father of n and m */
  681|  1.84M|        tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.84M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.84M|#define Freq fc.freq
  ------------------
                      tree[node].Freq = tree[n].Freq + tree[m].Freq;
  ------------------
  |  |   83|  1.84M|#define Freq fc.freq
  ------------------
  682|  1.84M|        s->depth[node] = (uch)((s->depth[n] >= s->depth[m] ?
  ------------------
  |  Branch (682:33): [True: 1.63M, False: 217k]
  ------------------
  683|  1.63M|                                s->depth[n] : s->depth[m]) + 1);
  684|  1.84M|        tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  1.84M|#define Dad  dl.dad
  ------------------
                      tree[n].Dad = tree[m].Dad = (ush)node;
  ------------------
  |  |   85|  1.84M|#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.84M|        s->heap[SMALLEST] = node++;
  ------------------
  |  |  480|  1.84M|#define SMALLEST 1
  ------------------
  693|  1.84M|        pqdownheap(s, tree, SMALLEST);
  ------------------
  |  |  480|  1.84M|#define SMALLEST 1
  ------------------
  694|       |
  695|  1.84M|    } while (s->heap_len >= 2);
  ------------------
  |  Branch (695:14): [True: 1.82M, False: 26.2k]
  ------------------
  696|       |
  697|  26.2k|    s->heap[--(s->heap_max)] = s->heap[SMALLEST];
  ------------------
  |  |  480|  26.2k|#define SMALLEST 1
  ------------------
  698|       |
  699|       |    /* At this point, the fields freq and dad are set. We can now
  700|       |     * generate the bit lengths.
  701|       |     */
  702|  26.2k|    gen_bitlen(s, (tree_desc *)desc);
  703|       |
  704|       |    /* The field len is now set, we can generate the bit codes */
  705|  26.2k|    gen_codes ((ct_data *)tree, max_code, s->bl_count);
  706|  26.2k|}
trees.c:pqdownheap:
  509|  4.62M|local void pqdownheap(deflate_state *s, ct_data *tree, int k) {
  510|  4.62M|    int v = s->heap[k];
  511|  4.62M|    int j = k << 1;  /* left son of k */
  512|  23.8M|    while (j <= s->heap_len) {
  ------------------
  |  Branch (512:12): [True: 20.2M, False: 3.56M]
  ------------------
  513|       |        /* Set j to the smallest of the two sons: */
  514|  20.2M|        if (j < s->heap_len &&
  ------------------
  |  Branch (514:13): [True: 20.0M, False: 254k]
  ------------------
  515|  20.0M|            smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
  ------------------
  |  |  500|  20.0M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  20.0M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  40.0M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 5.76M, False: 14.2M]
  |  |  ------------------
  |  |  501|  20.0M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  14.2M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  28.5M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 4.29M, False: 9.96M]
  |  |  |  Branch (501:37): [True: 3.87M, False: 419k]
  |  |  ------------------
  ------------------
  516|  9.64M|            j++;
  517|  9.64M|        }
  518|       |        /* Exit if v is smaller than both sons */
  519|  20.2M|        if (smaller(tree, v, s->heap[j], s->depth)) break;
  ------------------
  |  |  500|  20.2M|   (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  20.2M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq < tree[m].Freq || \
  |  |  ------------------
  |  |  |  |   83|  40.5M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (500:5): [True: 779k, False: 19.4M]
  |  |  ------------------
  |  |  501|  20.2M|   (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  19.4M|#define Freq fc.freq
  |  |  ------------------
  |  |                  (tree[n].Freq == tree[m].Freq && depth[n] <= depth[m]))
  |  |  ------------------
  |  |  |  |   83|  38.9M|#define Freq fc.freq
  |  |  ------------------
  |  |  |  Branch (501:5): [True: 387k, False: 19.1M]
  |  |  |  Branch (501:37): [True: 281k, False: 106k]
  |  |  ------------------
  ------------------
  520|       |
  521|       |        /* Exchange v with the smallest son */
  522|  19.2M|        s->heap[k] = s->heap[j];  k = j;
  523|       |
  524|       |        /* And continue down the tree, setting j to the left son of k */
  525|  19.2M|        j <<= 1;
  526|  19.2M|    }
  527|  4.62M|    s->heap[k] = v;
  528|  4.62M|}
trees.c:gen_bitlen:
  540|  26.2k|local void gen_bitlen(deflate_state *s, tree_desc *desc) {
  541|  26.2k|    ct_data *tree        = desc->dyn_tree;
  542|  26.2k|    int max_code         = desc->max_code;
  543|  26.2k|    const ct_data *stree = desc->stat_desc->static_tree;
  544|  26.2k|    const intf *extra    = desc->stat_desc->extra_bits;
  545|  26.2k|    int base             = desc->stat_desc->extra_base;
  546|  26.2k|    int max_length       = desc->stat_desc->max_length;
  547|  26.2k|    int h;              /* heap index */
  548|  26.2k|    int n, m;           /* iterate over the tree elements */
  549|  26.2k|    int bits;           /* bit length */
  550|  26.2k|    int xbits;          /* extra bits */
  551|  26.2k|    ush f;              /* frequency */
  552|  26.2k|    int overflow = 0;   /* number of elements with bit length too large */
  553|       |
  554|   446k|    for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
  ------------------
  |  |   52|   446k|#define MAX_BITS 15
  ------------------
  |  Branch (554:20): [True: 420k, False: 26.2k]
  ------------------
  555|       |
  556|       |    /* In a first pass, compute the optimal bit lengths (which may
  557|       |     * overflow in the case of the bit length tree).
  558|       |     */
  559|  26.2k|    tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
  ------------------
  |  |   86|  26.2k|#define Len  dl.len
  ------------------
  560|       |
  561|  3.72M|    for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
  ------------------
  |  |   49|  3.72M|#define HEAP_SIZE (2*L_CODES+1)
  |  |  ------------------
  |  |  |  |   40|  3.72M|#define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  3.72M|#define LITERALS  256
  |  |  |  |  ------------------
  |  |  |  |               #define L_CODES (LITERALS+1+LENGTH_CODES)
  |  |  |  |  ------------------
  |  |  |  |  |  |   34|  3.72M|#define LENGTH_CODES 29
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (561:31): [True: 3.69M, False: 26.2k]
  ------------------
  562|  3.69M|        n = s->heap[h];
  563|  3.69M|        bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   85|  3.69M|#define Dad  dl.dad
  ------------------
                      bits = tree[tree[n].Dad].Len + 1;
  ------------------
  |  |   86|  3.69M|#define Len  dl.len
  ------------------
  564|  3.69M|        if (bits > max_length) bits = max_length, overflow++;
  ------------------
  |  Branch (564:13): [True: 8.29k, False: 3.68M]
  ------------------
  565|  3.69M|        tree[n].Len = (ush)bits;
  ------------------
  |  |   86|  3.69M|#define Len  dl.len
  ------------------
  566|       |        /* We overwrite tree[n].Dad which is no longer needed */
  567|       |
  568|  3.69M|        if (n > max_code) continue; /* not a leaf node */
  ------------------
  |  Branch (568:13): [True: 1.82M, False: 1.87M]
  ------------------
  569|       |
  570|  1.87M|        s->bl_count[bits]++;
  571|  1.87M|        xbits = 0;
  572|  1.87M|        if (n >= base) xbits = extra[n - base];
  ------------------
  |  Branch (572:13): [True: 222k, False: 1.65M]
  ------------------
  573|  1.87M|        f = tree[n].Freq;
  ------------------
  |  |   83|  1.87M|#define Freq fc.freq
  ------------------
  574|  1.87M|        s->opt_len += (ulg)f * (unsigned)(bits + xbits);
  575|  1.87M|        if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
  ------------------
  |  |   86|  1.78M|#define Len  dl.len
  ------------------
  |  Branch (575:13): [True: 1.78M, False: 93.8k]
  ------------------
  576|  1.87M|    }
  577|  26.2k|    if (overflow == 0) return;
  ------------------
  |  Branch (577:9): [True: 23.7k, False: 2.55k]
  ------------------
  578|       |
  579|  2.55k|    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|  4.14k|    do {
  584|  4.14k|        bits = max_length - 1;
  585|  5.52k|        while (s->bl_count[bits] == 0) bits--;
  ------------------
  |  Branch (585:16): [True: 1.37k, False: 4.14k]
  ------------------
  586|  4.14k|        s->bl_count[bits]--;        /* move one leaf down the tree */
  587|  4.14k|        s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
  588|  4.14k|        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|  4.14k|        overflow -= 2;
  593|  4.14k|    } while (overflow > 0);
  ------------------
  |  Branch (593:14): [True: 1.59k, False: 2.55k]
  ------------------
  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|  21.2k|    for (bits = max_length; bits != 0; bits--) {
  ------------------
  |  Branch (600:29): [True: 18.6k, False: 2.55k]
  ------------------
  601|  18.6k|        n = s->bl_count[bits];
  602|   122k|        while (n != 0) {
  ------------------
  |  Branch (602:16): [True: 104k, False: 18.6k]
  ------------------
  603|   104k|            m = s->heap[--h];
  604|   104k|            if (m > max_code) continue;
  ------------------
  |  Branch (604:17): [True: 45.7k, False: 58.3k]
  ------------------
  605|  58.3k|            if ((unsigned) tree[m].Len != (unsigned) bits) {
  ------------------
  |  |   86|  58.3k|#define Len  dl.len
  ------------------
  |  Branch (605:17): [True: 4.00k, False: 54.3k]
  ------------------
  606|  4.00k|                Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
  607|  4.00k|                s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   86|  4.00k|#define Len  dl.len
  ------------------
                              s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq;
  ------------------
  |  |   83|  4.00k|#define Freq fc.freq
  ------------------
  608|  4.00k|                tree[m].Len = (ush)bits;
  ------------------
  |  |   86|  4.00k|#define Len  dl.len
  ------------------
  609|  4.00k|            }
  610|  58.3k|            n--;
  611|  58.3k|        }
  612|  18.6k|    }
  613|  2.55k|}
trees.c:gen_codes:
  203|  26.2k|local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) {
  204|  26.2k|    ush next_code[MAX_BITS+1]; /* next code value for each bit length */
  205|  26.2k|    unsigned code = 0;         /* running code value */
  206|  26.2k|    int bits;                  /* bit index */
  207|  26.2k|    int n;                     /* code index */
  208|       |
  209|       |    /* The distribution counts are first used to generate the code values
  210|       |     * without bit reversal.
  211|       |     */
  212|   420k|    for (bits = 1; bits <= MAX_BITS; bits++) {
  ------------------
  |  |   52|   420k|#define MAX_BITS 15
  ------------------
  |  Branch (212:20): [True: 394k, False: 26.2k]
  ------------------
  213|   394k|        code = (code + bl_count[bits - 1]) << 1;
  214|   394k|        next_code[bits] = (ush)code;
  215|   394k|    }
  216|       |    /* Check that the bit counts in bl_count are consistent. The last code
  217|       |     * must be all ones.
  218|       |     */
  219|  26.2k|    Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
  220|  26.2k|            "inconsistent bit counts");
  221|  26.2k|    Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
  222|       |
  223|  2.68M|    for (n = 0;  n <= max_code; n++) {
  ------------------
  |  Branch (223:18): [True: 2.65M, False: 26.2k]
  ------------------
  224|  2.65M|        int len = tree[n].Len;
  ------------------
  |  |   86|  2.65M|#define Len  dl.len
  ------------------
  225|  2.65M|        if (len == 0) continue;
  ------------------
  |  Branch (225:13): [True: 781k, False: 1.87M]
  ------------------
  226|       |        /* Now reverse the bits */
  227|  1.87M|        tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
  ------------------
  |  |   84|  1.87M|#define Code fc.code
  ------------------
  228|       |
  229|  1.87M|        Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
  230|  1.87M|            n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1));
  231|  1.87M|    }
  232|  26.2k|}
trees.c:bi_reverse:
  154|  1.87M|local unsigned bi_reverse(unsigned code, int len) {
  155|  1.87M|    unsigned res = 0;
  156|  14.9M|    do {
  157|  14.9M|        res |= code & 1;
  158|  14.9M|        code >>= 1, res <<= 1;
  159|  14.9M|    } while (--len > 0);
  ------------------
  |  Branch (159:14): [True: 13.1M, False: 1.87M]
  ------------------
  160|  1.87M|    return res >> 1;
  161|  1.87M|}
trees.c:build_bl_tree:
  800|  8.75k|local int build_bl_tree(deflate_state *s) {
  801|  8.75k|    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.75k|    scan_tree(s, (ct_data *)s->dyn_ltree, s->l_desc.max_code);
  805|  8.75k|    scan_tree(s, (ct_data *)s->dyn_dtree, s->d_desc.max_code);
  806|       |
  807|       |    /* Build the bit length tree: */
  808|  8.75k|    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|  24.1k|    for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
  ------------------
  |  |   46|  8.75k|#define BL_CODES  19
  ------------------
  |  Branch (817:36): [True: 24.1k, False: 0]
  ------------------
  818|  24.1k|        if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
  ------------------
  |  |   86|  24.1k|#define Len  dl.len
  ------------------
  |  Branch (818:13): [True: 8.75k, False: 15.3k]
  ------------------
  819|  24.1k|    }
  820|       |    /* Update opt_len to include the bit length tree and counts */
  821|  8.75k|    s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
  822|  8.75k|    Tracev((stderr, "\ndyn trees: dyn %lu, stat %lu",
  823|  8.75k|            s->opt_len, s->static_len));
  824|       |
  825|  8.75k|    return max_blindex;
  826|  8.75k|}
trees.c:scan_tree:
  712|  17.5k|local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
  713|  17.5k|    int n;                     /* iterates over all tree elements */
  714|  17.5k|    int prevlen = -1;          /* last emitted length */
  715|  17.5k|    int curlen;                /* length of current code */
  716|  17.5k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  17.5k|#define Len  dl.len
  ------------------
  717|  17.5k|    int count = 0;             /* repeat count of the current code */
  718|  17.5k|    int max_count = 7;         /* max repeat count */
  719|  17.5k|    int min_count = 4;         /* min repeat count */
  720|       |
  721|  17.5k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (721:9): [True: 4.09k, False: 13.4k]
  ------------------
  722|  17.5k|    tree[max_code + 1].Len = (ush)0xffff; /* guard */
  ------------------
  |  |   86|  17.5k|#define Len  dl.len
  ------------------
  723|       |
  724|  2.51M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (724:17): [True: 2.49M, False: 17.5k]
  ------------------
  725|  2.49M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  2.49M|#define Len  dl.len
  ------------------
  726|  2.49M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (726:13): [True: 2.38M, False: 108k]
  |  Branch (726:36): [True: 1.36M, False: 1.02M]
  ------------------
  727|  1.36M|            continue;
  728|  1.36M|        } else if (count < min_count) {
  ------------------
  |  Branch (728:20): [True: 943k, False: 185k]
  ------------------
  729|   943k|            s->bl_tree[curlen].Freq += (ush)count;
  ------------------
  |  |   83|   943k|#define Freq fc.freq
  ------------------
  730|   943k|        } else if (curlen != 0) {
  ------------------
  |  Branch (730:20): [True: 152k, False: 33.0k]
  ------------------
  731|   152k|            if (curlen != prevlen) s->bl_tree[curlen].Freq++;
  ------------------
  |  |   83|  65.2k|#define Freq fc.freq
  ------------------
  |  Branch (731:17): [True: 65.2k, False: 87.4k]
  ------------------
  732|   152k|            s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   53|   152k|#define REP_3_6      16
  ------------------
                          s->bl_tree[REP_3_6].Freq++;
  ------------------
  |  |   83|   152k|#define Freq fc.freq
  ------------------
  733|   152k|        } else if (count <= 10) {
  ------------------
  |  Branch (733:20): [True: 22.7k, False: 10.2k]
  ------------------
  734|  22.7k|            s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   56|  22.7k|#define REPZ_3_10    17
  ------------------
                          s->bl_tree[REPZ_3_10].Freq++;
  ------------------
  |  |   83|  22.7k|#define Freq fc.freq
  ------------------
  735|  22.7k|        } else {
  736|  10.2k|            s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   59|  10.2k|#define REPZ_11_138  18
  ------------------
                          s->bl_tree[REPZ_11_138].Freq++;
  ------------------
  |  |   83|  10.2k|#define Freq fc.freq
  ------------------
  737|  10.2k|        }
  738|  1.12M|        count = 0; prevlen = curlen;
  739|  1.12M|        if (nextlen == 0) {
  ------------------
  |  Branch (739:13): [True: 232k, False: 896k]
  ------------------
  740|   232k|            max_count = 138, min_count = 3;
  741|   896k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (741:20): [True: 99.1k, False: 797k]
  ------------------
  742|  99.1k|            max_count = 6, min_count = 3;
  743|   797k|        } else {
  744|   797k|            max_count = 7, min_count = 4;
  745|   797k|        }
  746|  1.12M|    }
  747|  17.5k|}
trees.c:compress_block:
  901|  6.94k|                          const ct_data *dtree) {
  902|  6.94k|    unsigned dist;      /* distance of matched string */
  903|  6.94k|    int lc;             /* match length or unmatched char (if dist == 0) */
  904|  6.94k|    unsigned sx = 0;    /* running index in symbol buffers */
  905|  6.94k|    unsigned code;      /* the code to send */
  906|  6.94k|    int extra;          /* number of extra bits to send */
  907|       |
  908|  84.6M|    if (s->sym_next != 0) do {
  ------------------
  |  Branch (908:9): [True: 6.90k, False: 39]
  ------------------
  909|       |#ifdef LIT_MEM
  910|       |        dist = s->d_buf[sx];
  911|       |        lc = s->l_buf[sx++];
  912|       |#else
  913|  84.6M|        dist = s->sym_buf[sx++] & 0xff;
  914|  84.6M|        dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
  915|  84.6M|        lc = s->sym_buf[sx++];
  916|  84.6M|#endif
  917|  84.6M|        if (dist == 0) {
  ------------------
  |  Branch (917:13): [True: 80.5M, False: 4.12M]
  ------------------
  918|  80.5M|            send_code(s, lc, ltree); /* send a literal byte */
  ------------------
  |  |  239|  80.5M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  80.5M|#define send_bits(s, value, length) \
  |  |  |  |  275|  80.5M|{ int len = length;\
  |  |  |  |  276|  80.5M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  80.5M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 34.7M, False: 45.8M]
  |  |  |  |  ------------------
  |  |  |  |  277|  34.7M|    int val = (int)value;\
  |  |  |  |  278|  34.7M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  34.7M|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  34.7M|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  34.7M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  34.7M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  34.7M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  34.7M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  34.7M|}
  |  |  |  |  ------------------
  |  |  |  |  280|  34.7M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  34.7M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  34.7M|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  34.7M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  45.8M|  } else {\
  |  |  |  |  283|  45.8M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  45.8M|    s->bi_valid += len;\
  |  |  |  |  285|  45.8M|  }\
  |  |  |  |  286|  80.5M|}
  |  |  ------------------
  ------------------
  919|  80.5M|            Tracecv(isgraph(lc), (stderr," '%c' ", lc));
  920|  80.5M|        } else {
  921|       |            /* Here, lc is the match length - MIN_MATCH */
  922|  4.12M|            code = _length_code[lc];
  923|  4.12M|            send_code(s, code + LITERALS + 1, ltree);   /* send length code */
  ------------------
  |  |  239|  4.12M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  4.12M|#define send_bits(s, value, length) \
  |  |  |  |  275|  4.12M|{ int len = length;\
  |  |  |  |  276|  4.12M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.12M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 910k, False: 3.21M]
  |  |  |  |  ------------------
  |  |  |  |  277|   910k|    int val = (int)value;\
  |  |  |  |  278|   910k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   910k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   910k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   910k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   910k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   910k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   910k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   910k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   910k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   910k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   910k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   910k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  3.21M|  } else {\
  |  |  |  |  283|  3.21M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  3.21M|    s->bi_valid += len;\
  |  |  |  |  285|  3.21M|  }\
  |  |  |  |  286|  4.12M|}
  |  |  ------------------
  ------------------
  924|  4.12M|            extra = extra_lbits[code];
  925|  4.12M|            if (extra != 0) {
  ------------------
  |  Branch (925:17): [True: 510k, False: 3.61M]
  ------------------
  926|   510k|                lc -= base_length[code];
  927|   510k|                send_bits(s, lc, extra);       /* send the extra length bits */
  ------------------
  |  |  274|   510k|#define send_bits(s, value, length) \
  |  |  275|   510k|{ int len = length;\
  |  |  276|   510k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|   510k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 75.8k, False: 435k]
  |  |  ------------------
  |  |  277|  75.8k|    int val = (int)value;\
  |  |  278|  75.8k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  75.8k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  75.8k|#define put_short(s, w) { \
  |  |  |  |  145|  75.8k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  75.8k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  75.8k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  75.8k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  75.8k|}
  |  |  ------------------
  |  |  280|  75.8k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  75.8k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  75.8k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  75.8k|#define Buf_size 16
  |  |  ------------------
  |  |  282|   435k|  } else {\
  |  |  283|   435k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|   435k|    s->bi_valid += len;\
  |  |  285|   435k|  }\
  |  |  286|   510k|}
  ------------------
  928|   510k|            }
  929|  4.12M|            dist--; /* dist is now the match distance - 1 */
  930|  4.12M|            code = d_code(dist);
  ------------------
  |  |  321|  4.12M|   ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
  |  |  ------------------
  |  |  |  Branch (321:5): [True: 1.93M, False: 2.19M]
  |  |  ------------------
  ------------------
  931|  4.12M|            Assert (code < D_CODES, "bad d_code");
  932|       |
  933|  4.12M|            send_code(s, code, dtree);       /* send the distance code */
  ------------------
  |  |  239|  4.12M|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  4.12M|#define send_bits(s, value, length) \
  |  |  |  |  275|  4.12M|{ int len = length;\
  |  |  |  |  276|  4.12M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.12M|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 857k, False: 3.26M]
  |  |  |  |  ------------------
  |  |  |  |  277|   857k|    int val = (int)value;\
  |  |  |  |  278|   857k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   857k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   857k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   857k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   857k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   857k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   857k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   857k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   857k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   857k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   857k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   857k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  3.26M|  } else {\
  |  |  |  |  283|  3.26M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  3.26M|    s->bi_valid += len;\
  |  |  |  |  285|  3.26M|  }\
  |  |  |  |  286|  4.12M|}
  |  |  ------------------
  ------------------
  934|  4.12M|            extra = extra_dbits[code];
  935|  4.12M|            if (extra != 0) {
  ------------------
  |  Branch (935:17): [True: 2.89M, False: 1.23M]
  ------------------
  936|  2.89M|                dist -= (unsigned)base_dist[code];
  937|  2.89M|                send_bits(s, (int)dist, extra); /* send the extra bits */
  ------------------
  |  |  274|  2.89M|#define send_bits(s, value, length) \
  |  |  275|  2.89M|{ int len = length;\
  |  |  276|  2.89M|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  2.89M|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.55M, False: 1.33M]
  |  |  ------------------
  |  |  277|  1.55M|    int val = (int)value;\
  |  |  278|  1.55M|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  1.55M|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  1.55M|#define put_short(s, w) { \
  |  |  |  |  145|  1.55M|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  1.55M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.55M|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  1.55M|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  1.55M|}
  |  |  ------------------
  |  |  280|  1.55M|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  1.55M|#define Buf_size 16
  |  |  ------------------
  |  |  281|  1.55M|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  1.55M|#define Buf_size 16
  |  |  ------------------
  |  |  282|  1.55M|  } else {\
  |  |  283|  1.33M|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  1.33M|    s->bi_valid += len;\
  |  |  285|  1.33M|  }\
  |  |  286|  2.89M|}
  ------------------
  938|  2.89M|            }
  939|  4.12M|        } /* 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|  84.6M|        Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
  946|  84.6M|#endif
  947|       |
  948|  84.6M|    } while (sx < s->sym_next);
  ------------------
  |  Branch (948:14): [True: 84.6M, False: 6.90k]
  ------------------
  949|       |
  950|  6.94k|    send_code(s, END_BLOCK, ltree);
  ------------------
  |  |  239|  6.94k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  6.94k|#define send_bits(s, value, length) \
  |  |  |  |  275|  6.94k|{ int len = length;\
  |  |  |  |  276|  6.94k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.94k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 4.84k, False: 2.10k]
  |  |  |  |  ------------------
  |  |  |  |  277|  4.84k|    int val = (int)value;\
  |  |  |  |  278|  4.84k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  4.84k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  4.84k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  4.84k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  4.84k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  4.84k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  4.84k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  4.84k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  4.84k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.84k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  4.84k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.84k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  4.84k|  } else {\
  |  |  |  |  283|  2.10k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.10k|    s->bi_valid += len;\
  |  |  |  |  285|  2.10k|  }\
  |  |  |  |  286|  6.94k|}
  |  |  ------------------
  ------------------
  951|  6.94k|}
trees.c:send_all_trees:
  834|  5.78k|                          int blcodes) {
  835|  5.78k|    int rank;                    /* index in bl_order */
  836|       |
  837|  5.78k|    Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  838|  5.78k|    Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  839|  5.78k|            "too many codes");
  840|  5.78k|    Tracev((stderr, "\nbl counts: "));
  841|  5.78k|    send_bits(s, lcodes - 257, 5);  /* not +255 as stated in appnote.txt */
  ------------------
  |  |  274|  5.78k|#define send_bits(s, value, length) \
  |  |  275|  5.78k|{ int len = length;\
  |  |  276|  5.78k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  5.78k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 0, False: 5.78k]
  |  |  ------------------
  |  |  277|      0|    int val = (int)value;\
  |  |  278|      0|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|      0|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|      0|#define put_short(s, w) { \
  |  |  |  |  145|      0|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|      0|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|      0|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|      0|}
  |  |  ------------------
  |  |  280|      0|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  281|      0|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|      0|#define Buf_size 16
  |  |  ------------------
  |  |  282|  5.78k|  } else {\
  |  |  283|  5.78k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  5.78k|    s->bi_valid += len;\
  |  |  285|  5.78k|  }\
  |  |  286|  5.78k|}
  ------------------
  842|  5.78k|    send_bits(s, dcodes - 1,   5);
  ------------------
  |  |  274|  5.78k|#define send_bits(s, value, length) \
  |  |  275|  5.78k|{ int len = length;\
  |  |  276|  5.78k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  5.78k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 2.16k, False: 3.62k]
  |  |  ------------------
  |  |  277|  2.16k|    int val = (int)value;\
  |  |  278|  2.16k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  2.16k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.16k|#define put_short(s, w) { \
  |  |  |  |  145|  2.16k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.16k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.16k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.16k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.16k|}
  |  |  ------------------
  |  |  280|  2.16k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.16k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  2.16k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.16k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.62k|  } else {\
  |  |  283|  3.62k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  3.62k|    s->bi_valid += len;\
  |  |  285|  3.62k|  }\
  |  |  286|  5.78k|}
  ------------------
  843|  5.78k|    send_bits(s, blcodes - 4,  4);  /* not -3 as stated in appnote.txt */
  ------------------
  |  |  274|  5.78k|#define send_bits(s, value, length) \
  |  |  275|  5.78k|{ int len = length;\
  |  |  276|  5.78k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  5.78k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 3.62k, False: 2.16k]
  |  |  ------------------
  |  |  277|  3.62k|    int val = (int)value;\
  |  |  278|  3.62k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  3.62k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  3.62k|#define put_short(s, w) { \
  |  |  |  |  145|  3.62k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  3.62k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  3.62k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  3.62k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  3.62k|}
  |  |  ------------------
  |  |  280|  3.62k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  3.62k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  3.62k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  3.62k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  3.62k|  } else {\
  |  |  283|  2.16k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  2.16k|    s->bi_valid += len;\
  |  |  285|  2.16k|  }\
  |  |  286|  5.78k|}
  ------------------
  844|   104k|    for (rank = 0; rank < blcodes; rank++) {
  ------------------
  |  Branch (844:20): [True: 98.9k, False: 5.78k]
  ------------------
  845|  98.9k|        Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
  846|  98.9k|        send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
  ------------------
  |  |  274|  98.9k|#define send_bits(s, value, length) \
  |  |  275|  98.9k|{ int len = length;\
  |  |  276|  98.9k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  98.9k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 17.1k, False: 81.8k]
  |  |  ------------------
  |  |  277|  17.1k|    int val = (int)value;\
  |  |  278|  17.1k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  17.1k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  17.1k|#define put_short(s, w) { \
  |  |  |  |  145|  17.1k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  17.1k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  17.1k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  17.1k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  17.1k|}
  |  |  ------------------
  |  |  280|  17.1k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  17.1k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  17.1k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  17.1k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  81.8k|  } else {\
  |  |  283|  81.8k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  81.8k|    s->bi_valid += len;\
  |  |  285|  81.8k|  }\
  |  |  286|  98.9k|}
  ------------------
  847|  98.9k|    }
  848|  5.78k|    Tracev((stderr, "\nbl tree: sent %lu", s->bits_sent));
  849|       |
  850|  5.78k|    send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
  851|  5.78k|    Tracev((stderr, "\nlit tree: sent %lu", s->bits_sent));
  852|       |
  853|  5.78k|    send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
  854|  5.78k|    Tracev((stderr, "\ndist tree: sent %lu", s->bits_sent));
  855|  5.78k|}
trees.c:send_tree:
  753|  11.5k|local void send_tree(deflate_state *s, ct_data *tree, int max_code) {
  754|  11.5k|    int n;                     /* iterates over all tree elements */
  755|  11.5k|    int prevlen = -1;          /* last emitted length */
  756|  11.5k|    int curlen;                /* length of current code */
  757|  11.5k|    int nextlen = tree[0].Len; /* length of next code */
  ------------------
  |  |   86|  11.5k|#define Len  dl.len
  ------------------
  758|  11.5k|    int count = 0;             /* repeat count of the current code */
  759|  11.5k|    int max_count = 7;         /* max repeat count */
  760|  11.5k|    int min_count = 4;         /* min repeat count */
  761|       |
  762|       |    /* tree[max_code + 1].Len = -1; */  /* guard already set */
  763|  11.5k|    if (nextlen == 0) max_count = 138, min_count = 3;
  ------------------
  |  Branch (763:9): [True: 2.37k, False: 9.19k]
  ------------------
  764|       |
  765|  1.68M|    for (n = 0; n <= max_code; n++) {
  ------------------
  |  Branch (765:17): [True: 1.67M, False: 11.5k]
  ------------------
  766|  1.67M|        curlen = nextlen; nextlen = tree[n + 1].Len;
  ------------------
  |  |   86|  1.67M|#define Len  dl.len
  ------------------
  767|  1.67M|        if (++count < max_count && curlen == nextlen) {
  ------------------
  |  Branch (767:13): [True: 1.62M, False: 51.7k]
  |  Branch (767:36): [True: 715k, False: 910k]
  ------------------
  768|   715k|            continue;
  769|   962k|        } else if (count < min_count) {
  ------------------
  |  Branch (769:20): [True: 854k, False: 107k]
  ------------------
  770|   996k|            do { send_code(s, curlen, s->bl_tree); } while (--count != 0);
  ------------------
  |  |  239|   996k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|   996k|#define send_bits(s, value, length) \
  |  |  |  |  275|   996k|{ int len = length;\
  |  |  |  |  276|   996k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   996k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 159k, False: 837k]
  |  |  |  |  ------------------
  |  |  |  |  277|   159k|    int val = (int)value;\
  |  |  |  |  278|   159k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|   159k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|   159k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|   159k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   159k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   159k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|   159k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   159k|}
  |  |  |  |  ------------------
  |  |  |  |  280|   159k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   159k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|   159k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   159k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|   837k|  } else {\
  |  |  |  |  283|   837k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|   837k|    s->bi_valid += len;\
  |  |  |  |  285|   837k|  }\
  |  |  |  |  286|   996k|}
  |  |  ------------------
  ------------------
  |  Branch (770:61): [True: 142k, False: 854k]
  ------------------
  771|       |
  772|   854k|        } else if (curlen != 0) {
  ------------------
  |  Branch (772:20): [True: 88.3k, False: 19.4k]
  ------------------
  773|  88.3k|            if (curlen != prevlen) {
  ------------------
  |  Branch (773:17): [True: 52.3k, False: 35.9k]
  ------------------
  774|  52.3k|                send_code(s, curlen, s->bl_tree); count--;
  ------------------
  |  |  239|  52.3k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  52.3k|#define send_bits(s, value, length) \
  |  |  |  |  275|  52.3k|{ int len = length;\
  |  |  |  |  276|  52.3k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  52.3k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 6.90k, False: 45.4k]
  |  |  |  |  ------------------
  |  |  |  |  277|  6.90k|    int val = (int)value;\
  |  |  |  |  278|  6.90k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  6.90k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  6.90k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  6.90k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  6.90k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  6.90k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  6.90k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  6.90k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  6.90k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.90k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  6.90k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  6.90k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  45.4k|  } else {\
  |  |  |  |  283|  45.4k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  45.4k|    s->bi_valid += len;\
  |  |  |  |  285|  45.4k|  }\
  |  |  |  |  286|  52.3k|}
  |  |  ------------------
  ------------------
  775|  52.3k|            }
  776|  88.3k|            Assert(count >= 3 && count <= 6, " 3_6?");
  777|  88.3k|            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  239|  88.3k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  88.3k|#define send_bits(s, value, length) \
  |  |  |  |  275|  88.3k|{ int len = length;\
  |  |  |  |  276|  88.3k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  88.3k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 16.0k, False: 72.3k]
  |  |  |  |  ------------------
  |  |  |  |  277|  16.0k|    int val = (int)value;\
  |  |  |  |  278|  16.0k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  16.0k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  16.0k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  16.0k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  16.0k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  16.0k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  16.0k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  16.0k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  16.0k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  16.0k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  16.0k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  16.0k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  72.3k|  } else {\
  |  |  |  |  283|  72.3k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  72.3k|    s->bi_valid += len;\
  |  |  |  |  285|  72.3k|  }\
  |  |  |  |  286|  88.3k|}
  |  |  ------------------
  ------------------
                          send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
  ------------------
  |  |  274|  88.3k|#define send_bits(s, value, length) \
  |  |  275|  88.3k|{ int len = length;\
  |  |  276|  88.3k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  88.3k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 11.2k, False: 77.1k]
  |  |  ------------------
  |  |  277|  11.2k|    int val = (int)value;\
  |  |  278|  11.2k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  11.2k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  11.2k|#define put_short(s, w) { \
  |  |  |  |  145|  11.2k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  11.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  11.2k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  11.2k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  11.2k|}
  |  |  ------------------
  |  |  280|  11.2k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  11.2k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  11.2k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  11.2k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  77.1k|  } else {\
  |  |  283|  77.1k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  77.1k|    s->bi_valid += len;\
  |  |  285|  77.1k|  }\
  |  |  286|  88.3k|}
  ------------------
  778|       |
  779|  88.3k|        } else if (count <= 10) {
  ------------------
  |  Branch (779:20): [True: 15.1k, False: 4.38k]
  ------------------
  780|  15.1k|            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  239|  15.1k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  15.1k|#define send_bits(s, value, length) \
  |  |  |  |  275|  15.1k|{ int len = length;\
  |  |  |  |  276|  15.1k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  15.1k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 3.98k, False: 11.1k]
  |  |  |  |  ------------------
  |  |  |  |  277|  3.98k|    int val = (int)value;\
  |  |  |  |  278|  3.98k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  3.98k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  3.98k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  3.98k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  3.98k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  3.98k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  3.98k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  3.98k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  3.98k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.98k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  3.98k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  3.98k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  11.1k|  } else {\
  |  |  |  |  283|  11.1k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  11.1k|    s->bi_valid += len;\
  |  |  |  |  285|  11.1k|  }\
  |  |  |  |  286|  15.1k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
  ------------------
  |  |  274|  15.1k|#define send_bits(s, value, length) \
  |  |  275|  15.1k|{ int len = length;\
  |  |  276|  15.1k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  15.1k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 2.84k, False: 12.2k]
  |  |  ------------------
  |  |  277|  2.84k|    int val = (int)value;\
  |  |  278|  2.84k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  2.84k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  2.84k|#define put_short(s, w) { \
  |  |  |  |  145|  2.84k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.84k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  2.84k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  2.84k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  2.84k|}
  |  |  ------------------
  |  |  280|  2.84k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  2.84k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  2.84k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  2.84k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  12.2k|  } else {\
  |  |  283|  12.2k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  12.2k|    s->bi_valid += len;\
  |  |  285|  12.2k|  }\
  |  |  286|  15.1k|}
  ------------------
  781|       |
  782|  15.1k|        } else {
  783|  4.38k|            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  239|  4.38k|#  define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len)
  |  |  ------------------
  |  |  |  |  274|  4.38k|#define send_bits(s, value, length) \
  |  |  |  |  275|  4.38k|{ int len = length;\
  |  |  |  |  276|  4.38k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  4.38k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (276:7): [True: 1.41k, False: 2.96k]
  |  |  |  |  ------------------
  |  |  |  |  277|  1.41k|    int val = (int)value;\
  |  |  |  |  278|  1.41k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  |  |  279|  1.41k|    put_short(s, s->bi_buf);\
  |  |  |  |  ------------------
  |  |  |  |  |  |  144|  1.41k|#define put_short(s, w) { \
  |  |  |  |  |  |  145|  1.41k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  1.41k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.41k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  293|  1.41k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.41k|}
  |  |  |  |  ------------------
  |  |  |  |  280|  1.41k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.41k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  281|  1.41k|    s->bi_valid += len - Buf_size;\
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  1.41k|#define Buf_size 16
  |  |  |  |  ------------------
  |  |  |  |  282|  2.96k|  } else {\
  |  |  |  |  283|  2.96k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  |  |  284|  2.96k|    s->bi_valid += len;\
  |  |  |  |  285|  2.96k|  }\
  |  |  |  |  286|  4.38k|}
  |  |  ------------------
  ------------------
                          send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
  ------------------
  |  |  274|  4.38k|#define send_bits(s, value, length) \
  |  |  275|  4.38k|{ int len = length;\
  |  |  276|  4.38k|  if (s->bi_valid > (int)Buf_size - len) {\
  |  |  ------------------
  |  |  |  |   55|  4.38k|#define Buf_size 16
  |  |  ------------------
  |  |  |  Branch (276:7): [True: 1.83k, False: 2.54k]
  |  |  ------------------
  |  |  277|  1.83k|    int val = (int)value;\
  |  |  278|  1.83k|    s->bi_buf |= (ush)val << s->bi_valid;\
  |  |  279|  1.83k|    put_short(s, s->bi_buf);\
  |  |  ------------------
  |  |  |  |  144|  1.83k|#define put_short(s, w) { \
  |  |  |  |  145|  1.83k|    put_byte(s, (uch)((w) & 0xff)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  1.83k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  146|  1.83k|    put_byte(s, (uch)((ush)(w) >> 8)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  293|  1.83k|#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);}
  |  |  |  |  ------------------
  |  |  |  |  147|  1.83k|}
  |  |  ------------------
  |  |  280|  1.83k|    s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\
  |  |  ------------------
  |  |  |  |   55|  1.83k|#define Buf_size 16
  |  |  ------------------
  |  |  281|  1.83k|    s->bi_valid += len - Buf_size;\
  |  |  ------------------
  |  |  |  |   55|  1.83k|#define Buf_size 16
  |  |  ------------------
  |  |  282|  2.54k|  } else {\
  |  |  283|  2.54k|    s->bi_buf |= (ush)(value) << s->bi_valid;\
  |  |  284|  2.54k|    s->bi_valid += len;\
  |  |  285|  2.54k|  }\
  |  |  286|  4.38k|}
  ------------------
  784|  4.38k|        }
  785|   962k|        count = 0; prevlen = curlen;
  786|   962k|        if (nextlen == 0) {
  ------------------
  |  Branch (786:13): [True: 206k, False: 755k]
  ------------------
  787|   206k|            max_count = 138, min_count = 3;
  788|   755k|        } else if (curlen == nextlen) {
  ------------------
  |  Branch (788:20): [True: 44.7k, False: 710k]
  ------------------
  789|  44.7k|            max_count = 6, min_count = 3;
  790|   710k|        } else {
  791|   710k|            max_count = 7, min_count = 4;
  792|   710k|        }
  793|   962k|    }
  794|  11.5k|}

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

