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

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

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

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

_ZN17Pl_ASCII85DecoderC2EPKcP8Pipeline:
   12|    141|    Pipeline(identifier, next)
   13|    141|{
   14|    141|    util::assertion(next, "Attempt to create Pl_ASCII85Decoder with nullptr as next");
   15|    141|}
_ZN17Pl_ASCII85Decoder5writeEPKhm:
   19|    141|{
   20|    141|    if (eod > 1) {
  ------------------
  |  Branch (20:9): [True: 0, False: 141]
  ------------------
   21|      0|        return;
   22|      0|    }
   23|  7.35k|    for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (23:24): [True: 7.24k, False: 110]
  ------------------
   24|  7.24k|        switch (buf[i]) {
  ------------------
  |  Branch (24:17): [True: 2.74k, False: 4.50k]
  ------------------
   25|    281|        case ' ':
  ------------------
  |  Branch (25:9): [True: 281, False: 6.96k]
  ------------------
   26|    550|        case '\f':
  ------------------
  |  Branch (26:9): [True: 269, False: 6.97k]
  ------------------
   27|    862|        case '\v':
  ------------------
  |  Branch (27:9): [True: 312, False: 6.93k]
  ------------------
   28|  1.13k|        case '\t':
  ------------------
  |  Branch (28:9): [True: 268, False: 6.98k]
  ------------------
   29|  2.52k|        case '\r':
  ------------------
  |  Branch (29:9): [True: 1.39k, False: 5.85k]
  ------------------
   30|  2.74k|        case '\n':
  ------------------
  |  Branch (30:9): [True: 217, False: 7.03k]
  ------------------
   31|  2.74k|            QTC::TC("libtests", "Pl_ASCII85Decoder ignore space");
   32|       |            // ignore whitespace
   33|  2.74k|            continue;
   34|  7.24k|        }
   35|  4.50k|        if (eod > 1) {
  ------------------
  |  Branch (35:13): [True: 1, False: 4.50k]
  ------------------
   36|      1|            break;
   37|  4.50k|        } else if (eod == 1) {
  ------------------
  |  Branch (37:20): [True: 15, False: 4.48k]
  ------------------
   38|     15|            util::no_ci_rt_error_if(buf[i] != '>', "broken end-of-data sequence in base 85 data");
   39|     15|            flush();
   40|     15|            eod = 2;
   41|  4.48k|        } else {
   42|  4.48k|            switch (buf[i]) {
   43|     17|            case '~':
  ------------------
  |  Branch (43:13): [True: 17, False: 4.47k]
  ------------------
   44|     17|                eod = 1;
   45|     17|                break;
   46|       |
   47|    455|            case 'z':
  ------------------
  |  Branch (47:13): [True: 455, False: 4.03k]
  ------------------
   48|    455|                if (pos != 0) {
  ------------------
  |  Branch (48:21): [True: 2, False: 453]
  ------------------
   49|      2|                    throw std::runtime_error("unexpected z during base 85 decode");
   50|      2|                }
   51|    453|                unsigned char zeroes[4];
   52|    453|                memset(zeroes, '\0', 4);
   53|    453|                next()->write(zeroes, 4);
   54|    453|                break;
   55|       |
   56|  4.01k|            default:
  ------------------
  |  Branch (56:13): [True: 4.01k, False: 472]
  ------------------
   57|  4.01k|                if (buf[i] < 33 || buf[i] > 117) {
  ------------------
  |  Branch (57:21): [True: 15, False: 4.00k]
  |  Branch (57:36): [True: 13, False: 3.98k]
  ------------------
   58|     28|                    error = true;
   59|     28|                    throw std::runtime_error("character out of range during base 85 decode");
   60|  3.98k|                } else {
   61|  3.98k|                    this->inbuf[this->pos++] = buf[i];
   62|  3.98k|                    if (pos == 5) {
  ------------------
  |  Branch (62:25): [True: 786, False: 3.20k]
  ------------------
   63|    786|                        flush();
   64|    786|                    }
   65|  3.98k|                }
   66|  3.98k|                break;
   67|  4.48k|            }
   68|  4.48k|        }
   69|  4.50k|    }
   70|    141|}
_ZN17Pl_ASCII85Decoder5flushEv:
   74|    890|{
   75|    890|    if (this->pos == 0) {
  ------------------
  |  Branch (75:9): [True: 81, False: 809]
  ------------------
   76|     81|        return;
   77|     81|    }
   78|    809|    unsigned long lval = 0;
   79|  4.85k|    for (int i = 0; i < 5; ++i) {
  ------------------
  |  Branch (79:21): [True: 4.04k, False: 809]
  ------------------
   80|  4.04k|        lval *= 85;
   81|  4.04k|        lval += (this->inbuf[i] - 33U);
   82|  4.04k|    }
   83|       |
   84|    809|    unsigned char outbuf[4];
   85|    809|    memset(outbuf, 0, 4);
   86|  4.04k|    for (int i = 3; i >= 0; --i) {
  ------------------
  |  Branch (86:21): [True: 3.23k, False: 809]
  ------------------
   87|  3.23k|        outbuf[i] = lval & 0xff;
   88|  3.23k|        lval >>= 8;
   89|  3.23k|    }
   90|       |
   91|    809|    QTC::TC("libtests", "Pl_ASCII85Decoder partial flush", (this->pos == 5) ? 0 : 1);
  ------------------
  |  Branch (91:60): [True: 786, False: 23]
  ------------------
   92|       |    // Reset before calling getNext()->write in case that throws an exception.
   93|    809|    auto t = this->pos - 1;
   94|    809|    this->pos = 0;
   95|    809|    memset(this->inbuf, 117, 5);
   96|       |
   97|    809|    next()->write(outbuf, t);
   98|    809|}
_ZN17Pl_ASCII85Decoder6finishEv:
  102|    100|{
  103|    100|    if (error) {
  ------------------
  |  Branch (103:9): [True: 0, False: 100]
  ------------------
  104|      0|        return;
  105|      0|    }
  106|    100|    flush();
  107|    100|    next()->finish();
  108|    100|}

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

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

