LLVMFuzzerTestOneInput:
   35|    138|{
   36|    138|    FuzzHelper f(data, size);
   37|    138|    f.run();
   38|    138|    return 0;
   39|    138|}
_ZN10FuzzHelperC2EPKhm:
   10|    138|        data(data),
   11|    138|        size(size)
   12|    138|    {
   13|    138|    }
_ZN10FuzzHelper3runEv:
   17|    138|    {
   18|    138|        Pl_Discard discard;
   19|    138|        Pl_ASCII85Decoder p("decode", &discard);
   20|    138|        try {
   21|    138|            p.write(data, size);
   22|    138|            p.finish();
   23|    138|        } catch (std::runtime_error const& e) {
   24|     39|            std::cerr << "runtime_error: " << e.what() << '\n';
   25|     39|        }
   26|    138|    }

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

_ZN3QTC2TCEPKcS1_i:
   36|  4.36k|    {
   37|       |#ifndef QPDF_DISABLE_QTC
   38|       |        TC_real(scope, ccase, n);
   39|       |#endif // QPDF_DISABLE_QTC
   40|  4.36k|    }

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

_ZN17Pl_ASCII85DecoderC2EPKcP8Pipeline:
   12|    138|    Pipeline(identifier, next)
   13|    138|{
   14|    138|    util::assertion(next, "Attempt to create Pl_ASCII85Decoder with nullptr as next");
   15|    138|}
_ZN17Pl_ASCII85Decoder5writeEPKhm:
   19|    138|{
   20|    138|    if (eod > 1) {
  ------------------
  |  Branch (20:9): [True: 0, False: 138]
  ------------------
   21|      0|        return;
   22|      0|    }
   23|  8.07k|    for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (23:24): [True: 7.96k, False: 111]
  ------------------
   24|  7.96k|        switch (buf[i]) {
  ------------------
  |  Branch (24:17): [True: 3.54k, False: 4.42k]
  ------------------
   25|    305|        case ' ':
  ------------------
  |  Branch (25:9): [True: 305, False: 7.66k]
  ------------------
   26|    698|        case '\f':
  ------------------
  |  Branch (26:9): [True: 393, False: 7.57k]
  ------------------
   27|  1.06k|        case '\v':
  ------------------
  |  Branch (27:9): [True: 362, False: 7.60k]
  ------------------
   28|  1.36k|        case '\t':
  ------------------
  |  Branch (28:9): [True: 301, False: 7.66k]
  ------------------
   29|  3.18k|        case '\r':
  ------------------
  |  Branch (29:9): [True: 1.82k, False: 6.14k]
  ------------------
   30|  3.54k|        case '\n':
  ------------------
  |  Branch (30:9): [True: 361, False: 7.60k]
  ------------------
   31|  3.54k|            QTC::TC("libtests", "Pl_ASCII85Decoder ignore space");
   32|       |            // ignore whitespace
   33|  3.54k|            continue;
   34|  7.96k|        }
   35|  4.42k|        if (eod > 1) {
  ------------------
  |  Branch (35:13): [True: 1, False: 4.42k]
  ------------------
   36|      1|            break;
   37|  4.42k|        } else if (eod == 1) {
  ------------------
  |  Branch (37:20): [True: 17, False: 4.40k]
  ------------------
   38|     17|            util::no_ci_rt_error_if(buf[i] != '>', "broken end-of-data sequence in base 85 data");
   39|     17|            flush();
   40|     17|            eod = 2;
   41|  4.40k|        } else {
   42|  4.40k|            switch (buf[i]) {
   43|     18|            case '~':
  ------------------
  |  Branch (43:13): [True: 18, False: 4.38k]
  ------------------
   44|     18|                eod = 1;
   45|     18|                break;
   46|       |
   47|    325|            case 'z':
  ------------------
  |  Branch (47:13): [True: 325, False: 4.08k]
  ------------------
   48|    325|                if (pos != 0) {
  ------------------
  |  Branch (48:21): [True: 2, False: 323]
  ------------------
   49|      2|                    throw std::runtime_error("unexpected z during base 85 decode");
   50|      2|                }
   51|    323|                unsigned char zeroes[4];
   52|    323|                memset(zeroes, '\0', 4);
   53|    323|                next()->write(zeroes, 4);
   54|    323|                break;
   55|       |
   56|  4.06k|            default:
  ------------------
  |  Branch (56:13): [True: 4.06k, False: 343]
  ------------------
   57|  4.06k|                if (buf[i] < 33 || buf[i] > 117) {
  ------------------
  |  Branch (57:21): [True: 15, False: 4.04k]
  |  Branch (57:36): [True: 9, False: 4.03k]
  ------------------
   58|     24|                    error = true;
   59|     24|                    throw std::runtime_error("character out of range during base 85 decode");
   60|  4.03k|                } else {
   61|  4.03k|                    this->inbuf[this->pos++] = buf[i];
   62|  4.03k|                    if (pos == 5) {
  ------------------
  |  Branch (62:25): [True: 797, False: 3.24k]
  ------------------
   63|    797|                        flush();
   64|    797|                    }
   65|  4.03k|                }
   66|  4.03k|                break;
   67|  4.40k|            }
   68|  4.40k|        }
   69|  4.42k|    }
   70|    138|}
_ZN17Pl_ASCII85Decoder5flushEv:
   74|    900|{
   75|    900|    if (this->pos == 0) {
  ------------------
  |  Branch (75:9): [True: 81, False: 819]
  ------------------
   76|     81|        return;
   77|     81|    }
   78|    819|    unsigned long lval = 0;
   79|  4.91k|    for (int i = 0; i < 5; ++i) {
  ------------------
  |  Branch (79:21): [True: 4.09k, False: 819]
  ------------------
   80|  4.09k|        lval *= 85;
   81|  4.09k|        lval += (this->inbuf[i] - 33U);
   82|  4.09k|    }
   83|       |
   84|    819|    unsigned char outbuf[4];
   85|    819|    memset(outbuf, 0, 4);
   86|  4.09k|    for (int i = 3; i >= 0; --i) {
  ------------------
  |  Branch (86:21): [True: 3.27k, False: 819]
  ------------------
   87|  3.27k|        outbuf[i] = lval & 0xff;
   88|  3.27k|        lval >>= 8;
   89|  3.27k|    }
   90|       |
   91|    819|    QTC::TC("libtests", "Pl_ASCII85Decoder partial flush", (this->pos == 5) ? 0 : 1);
  ------------------
  |  Branch (91:60): [True: 797, False: 22]
  ------------------
   92|       |    // Reset before calling getNext()->write in case that throws an exception.
   93|    819|    auto t = this->pos - 1;
   94|    819|    this->pos = 0;
   95|    819|    memset(this->inbuf, 117, 5);
   96|       |
   97|    819|    next()->write(outbuf, t);
   98|    819|}
_ZN17Pl_ASCII85Decoder6finishEv:
  102|     99|{
  103|     99|    if (error) {
  ------------------
  |  Branch (103:9): [True: 0, False: 99]
  ------------------
  104|      0|        return;
  105|      0|    }
  106|     99|    flush();
  107|     99|    next()->finish();
  108|     99|}

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

_ZN4qpdf4util9assertionIRA57_KcEEvbOT_:
   27|    138|    {
   28|    138|        if (!cond) {
  ------------------
  |  Branch (28:13): [True: 0, False: 138]
  ------------------
   29|      0|            throw std::logic_error(std::forward<T>(msg));
   30|      0|        }
   31|    138|    }
_ZN4qpdf4util17no_ci_rt_error_ifIRA44_KcEEvbOT_:
   48|     17|    {
   49|     17|        if (cond) {
  ------------------
  |  Branch (49:13): [True: 13, False: 4]
  ------------------
   50|     13|            throw std::runtime_error(std::forward<T>(msg));
   51|     13|        }
   52|     17|    }

