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

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

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

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

_ZN17Pl_ASCII85DecoderC2EPKcP8Pipeline:
   12|    146|    Pipeline(identifier, next)
   13|    146|{
   14|    146|    util::assertion(next, "Attempt to create Pl_ASCII85Decoder with nullptr as next");
   15|    146|}
_ZN17Pl_ASCII85Decoder5writeEPKhm:
   19|    146|{
   20|    146|    if (eod > 1) {
  ------------------
  |  Branch (20:9): [True: 0, False: 146]
  ------------------
   21|      0|        return;
   22|      0|    }
   23|  24.5k|    for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (23:24): [True: 24.4k, False: 113]
  ------------------
   24|  24.4k|        switch (buf[i]) {
  ------------------
  |  Branch (24:17): [True: 1.79k, False: 22.6k]
  ------------------
   25|    217|        case ' ':
  ------------------
  |  Branch (25:9): [True: 217, False: 24.2k]
  ------------------
   26|    486|        case '\f':
  ------------------
  |  Branch (26:9): [True: 269, False: 24.1k]
  ------------------
   27|    839|        case '\v':
  ------------------
  |  Branch (27:9): [True: 353, False: 24.0k]
  ------------------
   28|  1.09k|        case '\t':
  ------------------
  |  Branch (28:9): [True: 254, False: 24.1k]
  ------------------
   29|  1.53k|        case '\r':
  ------------------
  |  Branch (29:9): [True: 446, False: 23.9k]
  ------------------
   30|  1.79k|        case '\n':
  ------------------
  |  Branch (30:9): [True: 255, False: 24.1k]
  ------------------
   31|  1.79k|            QTC::TC("libtests", "Pl_ASCII85Decoder ignore space");
   32|       |            // ignore whitespace
   33|  1.79k|            continue;
   34|  24.4k|        }
   35|  22.6k|        if (eod > 1) {
  ------------------
  |  Branch (35:13): [True: 1, False: 22.6k]
  ------------------
   36|      1|            break;
   37|  22.6k|        } else if (eod == 1) {
  ------------------
  |  Branch (37:20): [True: 18, False: 22.6k]
  ------------------
   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|  22.6k|        } else {
   42|  22.6k|            switch (buf[i]) {
   43|     19|            case '~':
  ------------------
  |  Branch (43:13): [True: 19, False: 22.5k]
  ------------------
   44|     19|                eod = 1;
   45|     19|                break;
   46|       |
   47|    457|            case 'z':
  ------------------
  |  Branch (47:13): [True: 457, False: 22.1k]
  ------------------
   48|    457|                if (pos != 0) {
  ------------------
  |  Branch (48:21): [True: 2, False: 455]
  ------------------
   49|      2|                    throw std::runtime_error("unexpected z during base 85 decode");
   50|      2|                }
   51|    455|                unsigned char zeroes[4];
   52|    455|                memset(zeroes, '\0', 4);
   53|    455|                next()->write(zeroes, 4);
   54|    455|                break;
   55|       |
   56|  22.1k|            default:
  ------------------
  |  Branch (56:13): [True: 22.1k, False: 476]
  ------------------
   57|  22.1k|                if (buf[i] < 33 || buf[i] > 117) {
  ------------------
  |  Branch (57:21): [True: 16, False: 22.1k]
  |  Branch (57:36): [True: 14, False: 22.1k]
  ------------------
   58|     30|                    error = true;
   59|     30|                    throw std::runtime_error("character out of range during base 85 decode");
   60|  22.1k|                } else {
   61|  22.1k|                    this->inbuf[this->pos++] = buf[i];
   62|  22.1k|                    if (pos == 5) {
  ------------------
  |  Branch (62:25): [True: 4.40k, False: 17.7k]
  ------------------
   63|  4.40k|                        flush();
   64|  4.40k|                    }
   65|  22.1k|                }
   66|  22.1k|                break;
   67|  22.6k|            }
   68|  22.6k|        }
   69|  22.6k|    }
   70|    146|}
_ZN17Pl_ASCII85Decoder5flushEv:
   74|  4.51k|{
   75|  4.51k|    if (this->pos == 0) {
  ------------------
  |  Branch (75:9): [True: 81, False: 4.43k]
  ------------------
   76|     81|        return;
   77|     81|    }
   78|  4.43k|    unsigned long lval = 0;
   79|  26.5k|    for (int i = 0; i < 5; ++i) {
  ------------------
  |  Branch (79:21): [True: 22.1k, False: 4.43k]
  ------------------
   80|  22.1k|        lval *= 85;
   81|  22.1k|        lval += (this->inbuf[i] - 33U);
   82|  22.1k|    }
   83|       |
   84|  4.43k|    unsigned char outbuf[4];
   85|  4.43k|    memset(outbuf, 0, 4);
   86|  22.1k|    for (int i = 3; i >= 0; --i) {
  ------------------
  |  Branch (86:21): [True: 17.7k, False: 4.43k]
  ------------------
   87|  17.7k|        outbuf[i] = lval & 0xff;
   88|  17.7k|        lval >>= 8;
   89|  17.7k|    }
   90|       |
   91|  4.43k|    QTC::TC("libtests", "Pl_ASCII85Decoder partial flush", (this->pos == 5) ? 0 : 1);
  ------------------
  |  Branch (91:60): [True: 4.40k, False: 25]
  ------------------
   92|       |    // Reset before calling getNext()->write in case that throws an exception.
   93|  4.43k|    auto t = this->pos - 1;
   94|  4.43k|    this->pos = 0;
   95|  4.43k|    memset(this->inbuf, 117, 5);
   96|       |
   97|  4.43k|    next()->write(outbuf, t);
   98|  4.43k|}
_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|    146|    Pipeline("discard", nullptr)
   10|    146|{
   11|    146|}
_ZN10Pl_DiscardD2Ev:
   14|    146|Pl_Discard::~Pl_Discard() = default;
_ZN10Pl_Discard5writeEPKhm:
   18|  4.88k|{
   19|  4.88k|}
_ZN10Pl_Discard6finishEv:
   23|    101|{
   24|    101|}

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

