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

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

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

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

_ZN17Pl_ASCII85DecoderC2EPKcP8Pipeline:
   12|    143|    Pipeline(identifier, next)
   13|    143|{
   14|    143|    util::assertion(next, "Attempt to create Pl_ASCII85Decoder with nullptr as next");
   15|    143|}
_ZN17Pl_ASCII85Decoder5writeEPKhm:
   19|    143|{
   20|    143|    if (eod > 1) {
  ------------------
  |  Branch (20:9): [True: 0, False: 143]
  ------------------
   21|      0|        return;
   22|      0|    }
   23|  6.76k|    for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (23:24): [True: 6.65k, False: 114]
  ------------------
   24|  6.65k|        switch (buf[i]) {
  ------------------
  |  Branch (24:17): [True: 3.13k, False: 3.51k]
  ------------------
   25|    194|        case ' ':
  ------------------
  |  Branch (25:9): [True: 194, False: 6.45k]
  ------------------
   26|    479|        case '\f':
  ------------------
  |  Branch (26:9): [True: 285, False: 6.36k]
  ------------------
   27|    690|        case '\v':
  ------------------
  |  Branch (27:9): [True: 211, False: 6.44k]
  ------------------
   28|  1.09k|        case '\t':
  ------------------
  |  Branch (28:9): [True: 406, False: 6.24k]
  ------------------
   29|  2.67k|        case '\r':
  ------------------
  |  Branch (29:9): [True: 1.58k, False: 5.07k]
  ------------------
   30|  3.13k|        case '\n':
  ------------------
  |  Branch (30:9): [True: 463, False: 6.19k]
  ------------------
   31|  3.13k|            QTC::TC("libtests", "Pl_ASCII85Decoder ignore space");
   32|       |            // ignore whitespace
   33|  3.13k|            continue;
   34|  6.65k|        }
   35|  3.51k|        if (eod > 1) {
  ------------------
  |  Branch (35:13): [True: 1, False: 3.51k]
  ------------------
   36|      1|            break;
   37|  3.51k|        } else if (eod == 1) {
  ------------------
  |  Branch (37:20): [True: 18, False: 3.49k]
  ------------------
   38|     18|            util::no_ci_rt_error_if(buf[i] != '>', "broken end-of-data sequence in base 85 data");
   39|     18|            flush();
   40|     18|            eod = 2;
   41|  3.49k|        } else {
   42|  3.49k|            switch (buf[i]) {
   43|     20|            case '~':
  ------------------
  |  Branch (43:13): [True: 20, False: 3.47k]
  ------------------
   44|     20|                eod = 1;
   45|     20|                break;
   46|       |
   47|    335|            case 'z':
  ------------------
  |  Branch (47:13): [True: 335, False: 3.16k]
  ------------------
   48|    335|                if (pos != 0) {
  ------------------
  |  Branch (48:21): [True: 2, False: 333]
  ------------------
   49|      2|                    throw std::runtime_error("unexpected z during base 85 decode");
   50|      2|                }
   51|    333|                unsigned char zeroes[4];
   52|    333|                memset(zeroes, '\0', 4);
   53|    333|                next()->write(zeroes, 4);
   54|    333|                break;
   55|       |
   56|  3.14k|            default:
  ------------------
  |  Branch (56:13): [True: 3.14k, False: 355]
  ------------------
   57|  3.14k|                if (buf[i] < 33 || buf[i] > 117) {
  ------------------
  |  Branch (57:21): [True: 11, False: 3.12k]
  |  Branch (57:36): [True: 15, False: 3.11k]
  ------------------
   58|     26|                    error = true;
   59|     26|                    throw std::runtime_error("character out of range during base 85 decode");
   60|  3.11k|                } else {
   61|  3.11k|                    this->inbuf[this->pos++] = buf[i];
   62|  3.11k|                    if (pos == 5) {
  ------------------
  |  Branch (62:25): [True: 610, False: 2.50k]
  ------------------
   63|    610|                        flush();
   64|    610|                    }
   65|  3.11k|                }
   66|  3.11k|                break;
   67|  3.49k|            }
   68|  3.49k|        }
   69|  3.51k|    }
   70|    143|}
_ZN17Pl_ASCII85Decoder5flushEv:
   74|    715|{
   75|    715|    if (this->pos == 0) {
  ------------------
  |  Branch (75:9): [True: 80, False: 635]
  ------------------
   76|     80|        return;
   77|     80|    }
   78|    635|    unsigned long lval = 0;
   79|  3.81k|    for (int i = 0; i < 5; ++i) {
  ------------------
  |  Branch (79:21): [True: 3.17k, False: 635]
  ------------------
   80|  3.17k|        lval *= 85;
   81|  3.17k|        lval += (this->inbuf[i] - 33U);
   82|  3.17k|    }
   83|       |
   84|    635|    unsigned char outbuf[4];
   85|    635|    memset(outbuf, 0, 4);
   86|  3.17k|    for (int i = 3; i >= 0; --i) {
  ------------------
  |  Branch (86:21): [True: 2.54k, False: 635]
  ------------------
   87|  2.54k|        outbuf[i] = lval & 0xff;
   88|  2.54k|        lval >>= 8;
   89|  2.54k|    }
   90|       |
   91|    635|    QTC::TC("libtests", "Pl_ASCII85Decoder partial flush", (this->pos == 5) ? 0 : 1);
  ------------------
  |  Branch (91:60): [True: 610, False: 25]
  ------------------
   92|       |    // Reset before calling getNext()->write in case that throws an exception.
   93|    635|    auto t = this->pos - 1;
   94|    635|    this->pos = 0;
   95|    635|    memset(this->inbuf, 117, 5);
   96|       |
   97|    635|    next()->write(outbuf, t);
   98|    635|}
_ZN17Pl_ASCII85Decoder6finishEv:
  102|    101|{
  103|    101|    if (error) {
  ------------------
  |  Branch (103:9): [True: 0, False: 101]
  ------------------
  104|      0|        return;
  105|      0|    }
  106|    101|    flush();
  107|    101|    next()->finish();
  108|    101|}

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

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

