_ZN10FuzzHelperC2EPKhm:
   22|    135|{
   23|    135|}
_ZN10FuzzHelper8doChecksEv:
   27|    135|{
   28|    135|    Pl_Discard discard;
   29|    135|    Pl_ASCIIHexDecoder p("decode", &discard);
   30|    135|    p.write(const_cast<unsigned char*>(data), size);
   31|    135|    p.finish();
   32|    135|}
_ZN10FuzzHelper3runEv:
   36|    135|{
   37|    135|    try {
   38|    135|        doChecks();
   39|    135|    } catch (std::runtime_error const& e) {
   40|     34|        std::cerr << "runtime_error: " << e.what() << std::endl;
   41|     34|    }
   42|    135|}
LLVMFuzzerTestOneInput:
   46|    135|{
   47|    135|    FuzzHelper f(data, size);
   48|    135|    f.run();
   49|    135|    return 0;
   50|    135|}

_ZN8PipelineD2Ev:
   53|    270|    virtual ~Pipeline() = default;

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

_ZN8PipelineC2EPKcPS_:
    9|    270|{
   10|    270|}
_ZN8Pipeline7getNextEb:
   14|  1.17k|{
   15|  1.17k|    if ((this->next == nullptr) && (!allow_null)) {
  ------------------
  |  Branch (15:9): [True: 0, False: 1.17k]
  |  Branch (15:36): [True: 0, False: 0]
  ------------------
   16|      0|        throw std::logic_error(
   17|      0|            this->identifier + ": Pipeline::getNext() called on pipeline with no next");
   18|      0|    }
   19|  1.17k|    return this->next;
   20|  1.17k|}

_ZN18Pl_ASCIIHexDecoderC2EPKcP8Pipeline:
   11|    135|{
   12|    135|    this->inbuf[0] = '0';
   13|    135|    this->inbuf[1] = '0';
   14|    135|    this->inbuf[2] = '\0';
   15|    135|}
_ZN18Pl_ASCIIHexDecoder5writeEPKhm:
   19|    135|{
   20|    135|    if (this->eod) {
  ------------------
  |  Branch (20:9): [True: 0, False: 135]
  ------------------
   21|      0|        return;
   22|      0|    }
   23|  3.56k|    for (size_t i = 0; i < len; ++i) {
  ------------------
  |  Branch (23:24): [True: 3.46k, False: 92]
  ------------------
   24|  3.46k|        char ch = static_cast<char>(toupper(buf[i]));
   25|  3.46k|        switch (ch) {
   26|    226|        case ' ':
  ------------------
  |  Branch (26:9): [True: 226, False: 3.24k]
  ------------------
   27|    420|        case '\f':
  ------------------
  |  Branch (27:9): [True: 194, False: 3.27k]
  ------------------
   28|    614|        case '\v':
  ------------------
  |  Branch (28:9): [True: 194, False: 3.27k]
  ------------------
   29|    890|        case '\t':
  ------------------
  |  Branch (29:9): [True: 276, False: 3.19k]
  ------------------
   30|  1.08k|        case '\r':
  ------------------
  |  Branch (30:9): [True: 196, False: 3.27k]
  ------------------
   31|  1.30k|        case '\n':
  ------------------
  |  Branch (31:9): [True: 214, False: 3.25k]
  ------------------
   32|  1.30k|            QTC::TC("libtests", "Pl_ASCIIHexDecoder ignore space");
   33|       |            // ignore whitespace
   34|  1.30k|            break;
   35|       |
   36|      9|        case '>':
  ------------------
  |  Branch (36:9): [True: 9, False: 3.46k]
  ------------------
   37|      9|            this->eod = true;
   38|      9|            flush();
   39|      9|            break;
   40|       |
   41|  2.16k|        default:
  ------------------
  |  Branch (41:9): [True: 2.16k, False: 1.30k]
  ------------------
   42|  2.16k|            if (((ch >= '0') && (ch <= '9')) || ((ch >= 'A') && (ch <= 'F'))) {
  ------------------
  |  Branch (42:18): [True: 2.14k, False: 18]
  |  Branch (42:33): [True: 947, False: 1.19k]
  |  Branch (42:50): [True: 1.18k, False: 24]
  |  Branch (42:65): [True: 1.17k, False: 10]
  ------------------
   43|  2.12k|                this->inbuf[this->pos++] = ch;
   44|  2.12k|                if (this->pos == 2) {
  ------------------
  |  Branch (44:21): [True: 1.04k, False: 1.07k]
  ------------------
   45|  1.04k|                    flush();
   46|  1.04k|                }
   47|  2.12k|            } else {
   48|     34|                char t[2];
   49|     34|                t[0] = ch;
   50|     34|                t[1] = 0;
   51|     34|                throw std::runtime_error(
   52|     34|                    std::string("character out of range"
   53|     34|                                " during base Hex decode: ") +
   54|     34|                    t);
   55|     34|            }
   56|  2.12k|            break;
   57|  3.46k|        }
   58|  3.43k|        if (this->eod) {
  ------------------
  |  Branch (58:13): [True: 9, False: 3.42k]
  ------------------
   59|      9|            break;
   60|      9|        }
   61|  3.43k|    }
   62|    135|}
_ZN18Pl_ASCIIHexDecoder5flushEv:
   66|  1.15k|{
   67|  1.15k|    if (this->pos == 0) {
  ------------------
  |  Branch (67:9): [True: 82, False: 1.07k]
  ------------------
   68|     82|        QTC::TC("libtests", "Pl_ASCIIHexDecoder no-op flush");
   69|     82|        return;
   70|     82|    }
   71|  1.07k|    int b[2];
   72|  3.22k|    for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (72:21): [True: 2.15k, False: 1.07k]
  ------------------
   73|  2.15k|        if (this->inbuf[i] >= 'A') {
  ------------------
  |  Branch (73:13): [True: 1.17k, False: 973]
  ------------------
   74|  1.17k|            b[i] = this->inbuf[i] - 'A' + 10;
   75|  1.17k|        } else {
   76|    973|            b[i] = this->inbuf[i] - '0';
   77|    973|        }
   78|  2.15k|    }
   79|  1.07k|    auto ch = static_cast<unsigned char>((b[0] << 4) + b[1]);
   80|       |
   81|  1.07k|    QTC::TC("libtests", "Pl_ASCIIHexDecoder partial flush", (this->pos == 2) ? 0 : 1);
  ------------------
  |  Branch (81:61): [True: 1.04k, False: 28]
  ------------------
   82|       |    // Reset before calling getNext()->write in case that throws an exception.
   83|  1.07k|    this->pos = 0;
   84|  1.07k|    this->inbuf[0] = '0';
   85|  1.07k|    this->inbuf[1] = '0';
   86|  1.07k|    this->inbuf[2] = '\0';
   87|       |
   88|  1.07k|    getNext()->write(&ch, 1);
   89|  1.07k|}
_ZN18Pl_ASCIIHexDecoder6finishEv:
   93|    101|{
   94|    101|    flush();
   95|    101|    getNext()->finish();
   96|    101|}

_ZN10Pl_DiscardC2Ev:
    7|    135|{
    8|    135|}
_ZN10Pl_DiscardD2Ev:
   11|    135|{
   12|       |    // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
   13|    135|}
_ZN10Pl_Discard5writeEPKhm:
   17|  1.07k|{
   18|  1.07k|}
_ZN10Pl_Discard6finishEv:
   22|    101|{
   23|    101|}

