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

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

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

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

_ZN17Pl_ASCII85DecoderC2EPKcP8Pipeline:
   12|    139|    Pipeline(identifier, next)
   13|    139|{
   14|    139|    util::assertion(next, "Attempt to create Pl_ASCII85Decoder with nullptr as next");
   15|    139|}
_ZN17Pl_ASCII85Decoder5writeEPKhm:
   19|    139|{
   20|    139|    if (eod > 1) {
  ------------------
  |  Branch (20:9): [True: 0, False: 139]
  ------------------
   21|      0|        return;
   22|      0|    }
   23|  10.7k|    for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (23:24): [True: 10.6k, False: 109]
  ------------------
   24|  10.6k|        switch (buf[i]) {
  ------------------
  |  Branch (24:17): [True: 2.75k, False: 7.88k]
  ------------------
   25|    299|        case ' ':
  ------------------
  |  Branch (25:9): [True: 299, False: 10.3k]
  ------------------
   26|    560|        case '\f':
  ------------------
  |  Branch (26:9): [True: 261, False: 10.3k]
  ------------------
   27|    877|        case '\v':
  ------------------
  |  Branch (27:9): [True: 317, False: 10.3k]
  ------------------
   28|  1.25k|        case '\t':
  ------------------
  |  Branch (28:9): [True: 379, False: 10.2k]
  ------------------
   29|  2.53k|        case '\r':
  ------------------
  |  Branch (29:9): [True: 1.28k, False: 9.35k]
  ------------------
   30|  2.75k|        case '\n':
  ------------------
  |  Branch (30:9): [True: 218, False: 10.4k]
  ------------------
   31|  2.75k|            QTC::TC("libtests", "Pl_ASCII85Decoder ignore space");
   32|       |            // ignore whitespace
   33|  2.75k|            continue;
   34|  10.6k|        }
   35|  7.88k|        if (eod > 1) {
  ------------------
  |  Branch (35:13): [True: 1, False: 7.88k]
  ------------------
   36|      1|            break;
   37|  7.88k|        } else if (eod == 1) {
  ------------------
  |  Branch (37:20): [True: 15, False: 7.86k]
  ------------------
   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|  7.86k|        } else {
   42|  7.86k|            switch (buf[i]) {
   43|     16|            case '~':
  ------------------
  |  Branch (43:13): [True: 16, False: 7.85k]
  ------------------
   44|     16|                eod = 1;
   45|     16|                break;
   46|       |
   47|    228|            case 'z':
  ------------------
  |  Branch (47:13): [True: 228, False: 7.63k]
  ------------------
   48|    228|                if (pos != 0) {
  ------------------
  |  Branch (48:21): [True: 2, False: 226]
  ------------------
   49|      2|                    throw std::runtime_error("unexpected z during base 85 decode");
   50|      2|                }
   51|    226|                unsigned char zeroes[4];
   52|    226|                memset(zeroes, '\0', 4);
   53|    226|                next()->write(zeroes, 4);
   54|    226|                break;
   55|       |
   56|  7.62k|            default:
  ------------------
  |  Branch (56:13): [True: 7.62k, False: 244]
  ------------------
   57|  7.62k|                if (buf[i] < 33 || buf[i] > 117) {
  ------------------
  |  Branch (57:21): [True: 14, False: 7.60k]
  |  Branch (57:36): [True: 13, False: 7.59k]
  ------------------
   58|     27|                    error = true;
   59|     27|                    throw std::runtime_error("character out of range during base 85 decode");
   60|  7.59k|                } else {
   61|  7.59k|                    this->inbuf[this->pos++] = buf[i];
   62|  7.59k|                    if (pos == 5) {
  ------------------
  |  Branch (62:25): [True: 1.50k, False: 6.09k]
  ------------------
   63|  1.50k|                        flush();
   64|  1.50k|                    }
   65|  7.59k|                }
   66|  7.59k|                break;
   67|  7.86k|            }
   68|  7.86k|        }
   69|  7.88k|    }
   70|    139|}
_ZN17Pl_ASCII85Decoder5flushEv:
   74|  1.60k|{
   75|  1.60k|    if (this->pos == 0) {
  ------------------
  |  Branch (75:9): [True: 81, False: 1.52k]
  ------------------
   76|     81|        return;
   77|     81|    }
   78|  1.52k|    unsigned long lval = 0;
   79|  9.16k|    for (int i = 0; i < 5; ++i) {
  ------------------
  |  Branch (79:21): [True: 7.63k, False: 1.52k]
  ------------------
   80|  7.63k|        lval *= 85;
   81|  7.63k|        lval += (this->inbuf[i] - 33U);
   82|  7.63k|    }
   83|       |
   84|  1.52k|    unsigned char outbuf[4];
   85|  1.52k|    memset(outbuf, 0, 4);
   86|  7.63k|    for (int i = 3; i >= 0; --i) {
  ------------------
  |  Branch (86:21): [True: 6.10k, False: 1.52k]
  ------------------
   87|  6.10k|        outbuf[i] = lval & 0xff;
   88|  6.10k|        lval >>= 8;
   89|  6.10k|    }
   90|       |
   91|  1.52k|    QTC::TC("libtests", "Pl_ASCII85Decoder partial flush", (this->pos == 5) ? 0 : 1);
  ------------------
  |  Branch (91:60): [True: 1.50k, False: 22]
  ------------------
   92|       |    // Reset before calling getNext()->write in case that throws an exception.
   93|  1.52k|    auto t = this->pos - 1;
   94|  1.52k|    this->pos = 0;
   95|  1.52k|    memset(this->inbuf, 117, 5);
   96|       |
   97|  1.52k|    next()->write(outbuf, t);
   98|  1.52k|}
_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|    139|    Pipeline("discard", nullptr)
   10|    139|{
   11|    139|}
_ZN10Pl_DiscardD2Ev:
   14|    139|Pl_Discard::~Pl_Discard() = default;
_ZN10Pl_Discard5writeEPKhm:
   18|  1.75k|{
   19|  1.75k|}
_ZN10Pl_Discard6finishEv:
   23|     99|{
   24|     99|}

_ZN4qpdf4util9assertionIRA57_KcEEvbOT_:
   29|    139|    {
   30|    139|        if (!cond) {
  ------------------
  |  Branch (30:13): [True: 0, False: 139]
  ------------------
   31|      0|            throw std::logic_error(std::forward<T>(msg));
   32|      0|        }
   33|    139|    }
_ZN4qpdf4util17no_ci_rt_error_ifIRA44_KcEEvbOT_:
   50|     15|    {
   51|     15|        if (cond) {
  ------------------
  |  Branch (51:13): [True: 11, False: 4]
  ------------------
   52|     11|            throw std::runtime_error(std::forward<T>(msg));
   53|     11|        }
   54|     15|    }

