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|     37|            std::cerr << "runtime_error: " << e.what() << '\n';
   25|     37|        }
   26|    139|    }

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

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

_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|  8.83k|    for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (23:24): [True: 8.71k, False: 112]
  ------------------
   24|  8.71k|        switch (buf[i]) {
  ------------------
  |  Branch (24:17): [True: 1.83k, False: 6.88k]
  ------------------
   25|    195|        case ' ':
  ------------------
  |  Branch (25:9): [True: 195, False: 8.52k]
  ------------------
   26|    647|        case '\f':
  ------------------
  |  Branch (26:9): [True: 452, False: 8.26k]
  ------------------
   27|    971|        case '\v':
  ------------------
  |  Branch (27:9): [True: 324, False: 8.39k]
  ------------------
   28|  1.23k|        case '\t':
  ------------------
  |  Branch (28:9): [True: 262, False: 8.45k]
  ------------------
   29|  1.49k|        case '\r':
  ------------------
  |  Branch (29:9): [True: 264, False: 8.45k]
  ------------------
   30|  1.83k|        case '\n':
  ------------------
  |  Branch (30:9): [True: 340, False: 8.37k]
  ------------------
   31|  1.83k|            QTC::TC("libtests", "Pl_ASCII85Decoder ignore space");
   32|       |            // ignore whitespace
   33|  1.83k|            continue;
   34|  8.71k|        }
   35|  6.88k|        if (eod > 1) {
  ------------------
  |  Branch (35:13): [True: 1, False: 6.88k]
  ------------------
   36|      1|            break;
   37|  6.88k|        } else if (eod == 1) {
  ------------------
  |  Branch (37:20): [True: 15, False: 6.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|  6.86k|        } else {
   42|  6.86k|            switch (buf[i]) {
   43|     17|            case '~':
  ------------------
  |  Branch (43:13): [True: 17, False: 6.84k]
  ------------------
   44|     17|                eod = 1;
   45|     17|                break;
   46|       |
   47|    340|            case 'z':
  ------------------
  |  Branch (47:13): [True: 340, False: 6.52k]
  ------------------
   48|    340|                if (pos != 0) {
  ------------------
  |  Branch (48:21): [True: 2, False: 338]
  ------------------
   49|      2|                    throw std::runtime_error("unexpected z during base 85 decode");
   50|      2|                }
   51|    338|                unsigned char zeroes[4];
   52|    338|                memset(zeroes, '\0', 4);
   53|    338|                next()->write(zeroes, 4);
   54|    338|                break;
   55|       |
   56|  6.50k|            default:
  ------------------
  |  Branch (56:13): [True: 6.50k, False: 357]
  ------------------
   57|  6.50k|                if (buf[i] < 33 || buf[i] > 117) {
  ------------------
  |  Branch (57:21): [True: 16, False: 6.49k]
  |  Branch (57:36): [True: 8, False: 6.48k]
  ------------------
   58|     24|                    error = true;
   59|     24|                    throw std::runtime_error("character out of range during base 85 decode");
   60|  6.48k|                } else {
   61|  6.48k|                    this->inbuf[this->pos++] = buf[i];
   62|  6.48k|                    if (pos == 5) {
  ------------------
  |  Branch (62:25): [True: 1.28k, False: 5.20k]
  ------------------
   63|  1.28k|                        flush();
   64|  1.28k|                    }
   65|  6.48k|                }
   66|  6.48k|                break;
   67|  6.86k|            }
   68|  6.86k|        }
   69|  6.88k|    }
   70|    139|}
_ZN17Pl_ASCII85Decoder5flushEv:
   74|  1.38k|{
   75|  1.38k|    if (this->pos == 0) {
  ------------------
  |  Branch (75:9): [True: 80, False: 1.30k]
  ------------------
   76|     80|        return;
   77|     80|    }
   78|  1.30k|    unsigned long lval = 0;
   79|  7.85k|    for (int i = 0; i < 5; ++i) {
  ------------------
  |  Branch (79:21): [True: 6.54k, False: 1.30k]
  ------------------
   80|  6.54k|        lval *= 85;
   81|  6.54k|        lval += (this->inbuf[i] - 33U);
   82|  6.54k|    }
   83|       |
   84|  1.30k|    unsigned char outbuf[4];
   85|  1.30k|    memset(outbuf, 0, 4);
   86|  6.54k|    for (int i = 3; i >= 0; --i) {
  ------------------
  |  Branch (86:21): [True: 5.23k, False: 1.30k]
  ------------------
   87|  5.23k|        outbuf[i] = lval & 0xff;
   88|  5.23k|        lval >>= 8;
   89|  5.23k|    }
   90|       |
   91|  1.30k|    QTC::TC("libtests", "Pl_ASCII85Decoder partial flush", (this->pos == 5) ? 0 : 1);
  ------------------
  |  Branch (91:60): [True: 1.28k, False: 26]
  ------------------
   92|       |    // Reset before calling getNext()->write in case that throws an exception.
   93|  1.30k|    auto t = this->pos - 1;
   94|  1.30k|    this->pos = 0;
   95|  1.30k|    memset(this->inbuf, 117, 5);
   96|       |
   97|  1.30k|    next()->write(outbuf, t);
   98|  1.30k|}
_ZN17Pl_ASCII85Decoder6finishEv:
  102|    102|{
  103|    102|    if (error) {
  ------------------
  |  Branch (103:9): [True: 0, False: 102]
  ------------------
  104|      0|        return;
  105|      0|    }
  106|    102|    flush();
  107|    102|    next()->finish();
  108|    102|}

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

_ZN4qpdf4util9assertionIRA57_KcEEvbOT_:
   27|    139|    {
   28|    139|        if (!cond) {
  ------------------
  |  Branch (28:13): [True: 0, False: 139]
  ------------------
   29|      0|            throw std::logic_error(std::forward<T>(msg));
   30|      0|        }
   31|    139|    }
_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|    }

