_ZN7KCodecs5Codec12codecForNameE14QByteArrayView:
  520|  11.5k|{
  521|  11.5k|    struct CodecEntry {
  522|  11.5k|        const char *name;
  523|  11.5k|        std::unique_ptr<KCodecs::Codec> codec;
  524|  11.5k|    };
  525|       |    // ### has to be sorted by name!
  526|  11.5k|    static const std::array<CodecEntry, 6> s_codecs{{
  527|  11.5k|        {"b", std::make_unique<KCodecs::Rfc2047BEncodingCodec>()},
  528|  11.5k|        {"base64", std::make_unique<KCodecs::Base64Codec>()},
  529|  11.5k|        {"q", std::make_unique<KCodecs::Rfc2047QEncodingCodec>()},
  530|  11.5k|        {"quoted-printable", std::make_unique<KCodecs::QuotedPrintableCodec>()},
  531|  11.5k|        {"x-kmime-rfc2231", std::make_unique<KCodecs::Rfc2231EncodingCodec>()},
  532|  11.5k|        {"x-uuencode", std::make_unique<KCodecs::UUCodec>()},
  533|  11.5k|    }};
  534|       |
  535|  11.5k|    const auto it = std::lower_bound(s_codecs.begin(), s_codecs.end(), name, [](const auto &lhs, auto rhs) {
  536|  11.5k|        return rhs.compare(lhs.name, Qt::CaseInsensitive) > 0;
  537|  11.5k|    });
  538|  11.5k|    if (it == s_codecs.end() || name.compare((*it).name, Qt::CaseInsensitive) != 0) {
  ------------------
  |  Branch (538:9): [True: 0, False: 11.5k]
  |  Branch (538:33): [True: 0, False: 11.5k]
  ------------------
  539|      0|        qWarning() << "Unknown codec \"" << name << "\" requested!";
  540|      0|        return nullptr;
  541|      0|    }
  542|  11.5k|    return (*it).codec.get();
  543|  11.5k|}
_ZNK7KCodecs5Codec6encodeERPKcS2_RPcS2_NS0_11NewlineTypeE:
  546|  23.1k|{
  547|       |    // get an encoder:
  548|  23.1k|    std::unique_ptr<Encoder> enc(makeEncoder(newline));
  549|  23.1k|    if (!enc) {
  ------------------
  |  Branch (549:9): [True: 3.86k, False: 19.3k]
  ------------------
  550|  3.86k|        qWarning() << "makeEncoder failed for" << name();
  551|  3.86k|        return false;
  552|  3.86k|    }
  553|       |
  554|       |    // encode and check for output buffer overflow:
  555|  19.3k|    while (!enc->encode(scursor, send, dcursor, dend)) {
  ------------------
  |  Branch (555:12): [True: 0, False: 19.3k]
  ------------------
  556|      0|        if (dcursor == dend) {
  ------------------
  |  Branch (556:13): [True: 0, False: 0]
  ------------------
  557|      0|            return false; // not enough space in output buffer
  558|      0|        }
  559|      0|    }
  560|       |
  561|       |    // finish and check for output buffer overflow:
  562|  19.3k|    while (!enc->finish(dcursor, dend)) {
  ------------------
  |  Branch (562:12): [True: 1.29k, False: 18.0k]
  ------------------
  563|  1.29k|        if (dcursor == dend) {
  ------------------
  |  Branch (563:13): [True: 1.29k, False: 0]
  ------------------
  564|  1.29k|            return false; // not enough space in output buffer
  565|  1.29k|        }
  566|  1.29k|    }
  567|       |
  568|  18.0k|    return true; // successfully encoded.
  569|  19.3k|}
_ZNK7KCodecs5Codec6encodeE14QByteArrayViewNS0_11NewlineTypeE:
  572|  23.1k|{
  573|       |    // allocate buffer for the worst case:
  574|  23.1k|    QByteArray result;
  575|  23.1k|    result.resize(maxEncodedSizeFor(src.size(), newline));
  576|       |
  577|       |    // set up iterators:
  578|  23.1k|    QByteArray::ConstIterator iit = src.begin();
  579|  23.1k|    QByteArray::ConstIterator iend = src.end();
  580|  23.1k|    QByteArray::Iterator oit = result.begin();
  581|  23.1k|    QByteArray::ConstIterator oend = result.end();
  582|       |
  583|       |    // encode
  584|  23.1k|    if (!encode(iit, iend, oit, oend, newline)) {
  ------------------
  |  Branch (584:9): [True: 5.15k, False: 18.0k]
  ------------------
  585|  5.15k|        qCritical() << name() << "codec lies about it's mEncodedSizeFor()";
  586|  5.15k|    }
  587|       |
  588|       |    // shrink result to actual size:
  589|  23.1k|    result.truncate(oit - result.begin());
  590|       |
  591|  23.1k|    return result;
  592|  23.1k|}
_ZNK7KCodecs5Codec6decodeE14QByteArrayViewNS0_11NewlineTypeE:
  595|  23.1k|{
  596|       |    // allocate buffer for the worst case:
  597|  23.1k|    QByteArray result;
  598|  23.1k|    result.resize(maxDecodedSizeFor(src.size(), newline));
  599|       |
  600|       |    // set up iterators:
  601|  23.1k|    QByteArray::ConstIterator iit = src.begin();
  602|  23.1k|    QByteArray::ConstIterator iend = src.end();
  603|  23.1k|    QByteArray::Iterator oit = result.begin();
  604|  23.1k|    QByteArray::ConstIterator oend = result.end();
  605|       |
  606|       |    // decode
  607|  23.1k|    if (!decode(iit, iend, oit, oend, newline)) {
  ------------------
  |  Branch (607:9): [True: 0, False: 23.1k]
  ------------------
  608|      0|        qCritical() << name() << "codec lies about it's maxDecodedSizeFor()";
  609|      0|    }
  610|       |
  611|       |    // shrink result to actual size:
  612|  23.1k|    result.truncate(oit - result.begin());
  613|       |
  614|  23.1k|    return result;
  615|  23.1k|}
_ZNK7KCodecs5Codec6decodeERPKcS2_RPcS2_NS0_11NewlineTypeE:
  618|  23.1k|{
  619|       |    // get a decoder:
  620|  23.1k|    std::unique_ptr<Decoder> dec(makeDecoder(newline));
  621|  23.1k|    assert(dec);
  622|       |
  623|       |    // decode and check for output buffer overflow:
  624|   388k|    while (!dec->decode(scursor, send, dcursor, dend)) {
  ------------------
  |  Branch (624:12): [True: 365k, False: 23.1k]
  ------------------
  625|   365k|        if (dcursor == dend) {
  ------------------
  |  Branch (625:13): [True: 0, False: 365k]
  ------------------
  626|      0|            return false; // not enough space in output buffer
  627|      0|        }
  628|   365k|    }
  629|       |
  630|       |    // finish and check for output buffer overflow:
  631|  23.1k|    while (!dec->finish(dcursor, dend)) {
  ------------------
  |  Branch (631:12): [True: 0, False: 23.1k]
  ------------------
  632|      0|        if (dcursor == dend) {
  ------------------
  |  Branch (632:13): [True: 0, False: 0]
  ------------------
  633|      0|            return false; // not enough space in output buffer
  634|      0|        }
  635|      0|    }
  636|       |
  637|  23.1k|    return true; // successfully encoded.
  638|  23.1k|}
_ZN7KCodecs14EncoderPrivateC2ENS_5Codec11NewlineTypeE:
  644|  19.3k|    : outputBufferCursor(0)
  645|  19.3k|    , newline(newline)
  646|  19.3k|{
  647|  19.3k|}
_ZN7KCodecs7EncoderC2ENS_5Codec11NewlineTypeE:
  650|  19.3k|    : d(new KCodecs::EncoderPrivate(newline))
  651|  19.3k|{
  652|  19.3k|}
_ZN7KCodecs7EncoderD2Ev:
  654|  19.3k|KCodecs::Encoder::~Encoder() = default;
_ZN7KCodecs7Encoder5writeEcRPcPKc:
  657|   427M|{
  658|   427M|    if (dcursor != dend) {
  ------------------
  |  Branch (658:9): [True: 427M, False: 0]
  ------------------
  659|       |        // if there's space in the output stream, write there:
  660|   427M|        *dcursor++ = ch;
  661|   427M|        return true;
  662|   427M|    } else {
  663|       |        // else buffer the output:
  664|      0|        if (d->outputBufferCursor >= maxBufferedChars) {
  ------------------
  |  Branch (664:13): [True: 0, False: 0]
  ------------------
  665|      0|            qCritical() << "KCodecs::Encoder: internal buffer overflow!";
  666|      0|        } else {
  667|      0|            d->outputBuffer[d->outputBufferCursor++] = ch;
  668|      0|        }
  669|      0|        return false;
  670|      0|    }
  671|   427M|}
_ZN7KCodecs7Encoder17flushOutputBufferERPcPKc:
  676|  10.3k|{
  677|  10.3k|    int i;
  678|       |    // copy output buffer to output stream:
  679|  10.3k|    for (i = 0; dcursor != dend && i < d->outputBufferCursor; ++i) {
  ------------------
  |  Branch (679:17): [True: 2.67k, False: 7.63k]
  |  Branch (679:36): [True: 0, False: 2.67k]
  ------------------
  680|      0|        *dcursor++ = d->outputBuffer[i];
  681|      0|    }
  682|       |
  683|       |    // calculate the number of missing chars:
  684|  10.3k|    int numCharsLeft = d->outputBufferCursor - i;
  685|       |    // push the remaining chars to the beginning of the buffer:
  686|  10.3k|    if (numCharsLeft) {
  ------------------
  |  Branch (686:9): [True: 0, False: 10.3k]
  ------------------
  687|      0|        ::memmove(d->outputBuffer, d->outputBuffer + i, numCharsLeft);
  688|      0|    }
  689|       |    // adjust cursor:
  690|  10.3k|    d->outputBufferCursor = numCharsLeft;
  691|       |
  692|  10.3k|    return !numCharsLeft;
  693|  10.3k|}
_ZN7KCodecs7Encoder9writeCRLFERPcPKc:
  696|  6.40M|{
  697|  6.40M|    if (d->newline == Codec::NewlineCRLF) {
  ------------------
  |  Branch (697:9): [True: 3.20M, False: 3.20M]
  ------------------
  698|  3.20M|        write('\r', dcursor, dend);
  699|  3.20M|    }
  700|  6.40M|    return write('\n', dcursor, dend);
  701|  6.40M|}
_ZN7KCodecs14DecoderPrivateC2ENS_5Codec11NewlineTypeE:
  707|  23.1k|    : newline(newline)
  708|  23.1k|{
  709|  23.1k|}
_ZN7KCodecs7DecoderC2ENS_5Codec11NewlineTypeE:
  712|  23.1k|    : d(new KCodecs::DecoderPrivate(newline))
  713|  23.1k|{
  714|  23.1k|}
_ZN7KCodecs7DecoderD2Ev:
  716|  23.1k|KCodecs::Decoder::~Decoder() = default;
kcodecs.cpp:_ZZN7KCodecs5Codec12codecForNameE14QByteArrayViewENK3$_0clIZNS0_12codecForNameES1_E10CodecEntryS1_EEDaRKT_T0_:
  535|  34.7k|    const auto it = std::lower_bound(s_codecs.begin(), s_codecs.end(), name, [](const auto &lhs, auto rhs) {
  536|  34.7k|        return rhs.compare(lhs.name, Qt::CaseInsensitive) > 0;
  537|  34.7k|    });

_ZN7KCodecs5CodecD2Ev:
  485|      6|    {
  486|      6|    }
_ZN7KCodecs5CodecC2Ev:
  493|      6|    {
  494|      6|    }

_ZNK7KCodecs11Base64Codec11makeEncoderENS_5Codec11NewlineTypeE:
  138|  3.86k|{
  139|  3.86k|    return new Base64Encoder(newline);
  140|  3.86k|}
_ZNK7KCodecs11Base64Codec11makeDecoderENS_5Codec11NewlineTypeE:
  143|  7.73k|{
  144|  7.73k|    return new Base64Decoder(newline);
  145|  7.73k|}
_ZNK7KCodecs21Rfc2047BEncodingCodec11makeEncoderENS_5Codec11NewlineTypeE:
  148|  3.86k|{
  149|  3.86k|    return new Rfc2047BEncodingEncoder(newline);
  150|  3.86k|}
_ZN7KCodecs13Base64Decoder6decodeERPKcS2_RPcS2_:
  157|  29.6k|{
  158|   111M|    while (dcursor != dend && scursor != send) {
  ------------------
  |  Branch (158:12): [True: 111M, False: 57]
  |  Branch (158:31): [True: 111M, False: 6.63k]
  ------------------
  159|   111M|        uchar ch = *scursor++;
  160|   111M|        uchar value;
  161|       |
  162|       |        // try converting ch to a 6-bit value:
  163|   111M|        if (ch < 128) {
  ------------------
  |  Branch (163:13): [True: 21.2M, False: 89.9M]
  ------------------
  164|  21.2M|            value = base64DecodeMap[ch];
  165|  89.9M|        } else {
  166|  89.9M|            value = 64;
  167|  89.9M|        }
  168|       |
  169|       |        // ch isn't of the base64 alphabet, check for other significant chars:
  170|   111M|        if (value >= 64) {
  ------------------
  |  Branch (170:13): [True: 97.0M, False: 14.1M]
  ------------------
  171|  97.0M|            if (ch == '=') {
  ------------------
  |  Branch (171:17): [True: 22.1k, False: 97.0M]
  ------------------
  172|       |                // padding:
  173|  22.1k|                if (mStepNo == 0 || mStepNo == 1) {
  ------------------
  |  Branch (173:21): [True: 19.3k, False: 2.83k]
  |  Branch (173:37): [True: 1.88k, False: 952]
  ------------------
  174|  21.2k|                    if (!mSawPadding) {
  ------------------
  |  Branch (174:25): [True: 1.10k, False: 20.1k]
  ------------------
  175|       |                        // malformed
  176|       |                        // qWarning() << "Base64Decoder: unexpected padding"
  177|       |                        //              "character in input stream";
  178|  1.10k|                    }
  179|  21.2k|                    mSawPadding = true;
  180|  21.2k|                    break;
  181|  21.2k|                } else if (mStepNo == 2) {
  ------------------
  |  Branch (181:28): [True: 116, False: 836]
  ------------------
  182|       |                    // ok, there should be another one
  183|    836|                } else if (mStepNo == 3) {
  ------------------
  |  Branch (183:28): [True: 836, False: 0]
  ------------------
  184|       |                    // ok, end of encoded stream
  185|    836|                    mSawPadding = true;
  186|    836|                    break;
  187|    836|                }
  188|    116|                mSawPadding = true;
  189|    116|                mStepNo = (mStepNo + 1) % 4;
  190|    116|                continue;
  191|  97.0M|            } else {
  192|       |                // non-base64 alphabet
  193|  97.0M|                continue;
  194|  97.0M|            }
  195|  97.0M|        }
  196|       |
  197|  14.1M|        if (mSawPadding) {
  ------------------
  |  Branch (197:13): [True: 900, False: 14.1M]
  ------------------
  198|       |            // qWarning() << "Base64Decoder: Embedded padding character"
  199|       |            //              "encountered!";
  200|    900|            return true;
  201|    900|        }
  202|       |
  203|       |        // add the new bits to the output stream and flush full octets:
  204|  14.1M|        switch (mStepNo) {
  205|  3.53M|        case 0:
  ------------------
  |  Branch (205:9): [True: 3.53M, False: 10.6M]
  ------------------
  206|  3.53M|            mOutbits = value << 2;
  207|  3.53M|            break;
  208|  3.53M|        case 1:
  ------------------
  |  Branch (208:9): [True: 3.53M, False: 10.6M]
  ------------------
  209|  3.53M|            *dcursor++ = (char)(mOutbits | value >> 4);
  210|  3.53M|            mOutbits = value << 4;
  211|  3.53M|            break;
  212|  3.53M|        case 2:
  ------------------
  |  Branch (212:9): [True: 3.53M, False: 10.6M]
  ------------------
  213|  3.53M|            *dcursor++ = (char)(mOutbits | value >> 2);
  214|  3.53M|            mOutbits = value << 6;
  215|  3.53M|            break;
  216|  3.53M|        case 3:
  ------------------
  |  Branch (216:9): [True: 3.53M, False: 10.6M]
  ------------------
  217|  3.53M|            *dcursor++ = (char)(mOutbits | value);
  218|  3.53M|            mOutbits = 0;
  219|  3.53M|            break;
  220|      0|        default:
  ------------------
  |  Branch (220:9): [True: 0, False: 14.1M]
  ------------------
  221|      0|            assert(0);
  222|  14.1M|        }
  223|  14.1M|        mStepNo = (mStepNo + 1) % 4;
  224|  14.1M|    }
  225|       |
  226|       |    // return false when caller should call us again:
  227|  28.7k|    return scursor == send;
  228|  29.6k|} // Base64Decoder::decode()
_ZN7KCodecs13Base64Encoder6encodeERPKcS2_RPcS2_:
  231|  3.86k|{
  232|  3.86k|    const uint maxPacketsPerLine = 76 / 4;
  233|       |
  234|       |    // detect when the caller doesn't adhere to our rules:
  235|  3.86k|    if (mInsideFinishing) {
  ------------------
  |  Branch (235:9): [True: 0, False: 3.86k]
  ------------------
  236|      0|        return true;
  237|      0|    }
  238|       |
  239|  78.5M|    while (scursor != send && dcursor != dend) {
  ------------------
  |  Branch (239:12): [True: 78.5M, False: 3.86k]
  |  Branch (239:31): [True: 78.5M, False: 0]
  ------------------
  240|       |        // properly empty the output buffer before starting something new:
  241|       |        // ### fixme: we can optimize this away, since the buffer isn't
  242|       |        // written to anyway (most of the time)
  243|  78.5M|        if (d->outputBufferCursor && !flushOutputBuffer(dcursor, dend)) {
  ------------------
  |  Branch (243:13): [True: 0, False: 78.5M]
  |  Branch (243:38): [True: 0, False: 0]
  ------------------
  244|      0|            return scursor == send;
  245|      0|        }
  246|       |
  247|  78.5M|        uchar ch = *scursor++;
  248|       |        // mNextbits   // (part of) value of next sextet
  249|       |
  250|       |        // check for line length;
  251|  78.5M|        if (mStepNo == 0 && mWrittenPacketsOnThisLine >= maxPacketsPerLine) {
  ------------------
  |  Branch (251:13): [True: 26.1M, False: 52.3M]
  |  Branch (251:29): [True: 1.37M, False: 24.8M]
  ------------------
  252|  1.37M|            writeCRLF(dcursor, dend);
  253|  1.37M|            mWrittenPacketsOnThisLine = 0;
  254|  1.37M|        }
  255|       |
  256|       |        // depending on mStepNo, extract value and mNextbits from the
  257|       |        // octet stream:
  258|  78.5M|        switch (mStepNo) {
  259|  26.1M|        case 0:
  ------------------
  |  Branch (259:9): [True: 26.1M, False: 52.3M]
  ------------------
  260|  26.1M|            assert(mNextbits == 0);
  261|  26.1M|            writeBase64(ch >> 2, dcursor, dend); // top-most 6 bits -> output
  262|  26.1M|            mNextbits = (ch & 0x3) << 4; // 0..1 bits -> 4..5 in mNextbits
  263|  26.1M|            break;
  264|  26.1M|        case 1:
  ------------------
  |  Branch (264:9): [True: 26.1M, False: 52.3M]
  ------------------
  265|  26.1M|            assert((mNextbits & ~0x30) == 0);
  266|  26.1M|            writeBase64(mNextbits | ch >> 4, dcursor, dend); // 4..7 bits -> 0..3 in value
  267|  26.1M|            mNextbits = (ch & 0xf) << 2; // 0..3 bits -> 2..5 in mNextbits
  268|  26.1M|            break;
  269|  26.1M|        case 2:
  ------------------
  |  Branch (269:9): [True: 26.1M, False: 52.3M]
  ------------------
  270|  26.1M|            assert((mNextbits & ~0x3C) == 0);
  271|  26.1M|            writeBase64(mNextbits | ch >> 6, dcursor, dend); // 6..7 bits -> 0..1 in value
  272|  26.1M|            writeBase64(ch & 0x3F, dcursor, dend); // 0..5 bits -> output
  273|  26.1M|            mNextbits = 0;
  274|  26.1M|            mWrittenPacketsOnThisLine++;
  275|  26.1M|            break;
  276|      0|        default:
  ------------------
  |  Branch (276:9): [True: 0, False: 78.5M]
  ------------------
  277|      0|            assert(0);
  278|  78.5M|        }
  279|  78.5M|        mStepNo = (mStepNo + 1) % 3;
  280|  78.5M|    }
  281|       |
  282|  3.86k|    if (d->outputBufferCursor) {
  ------------------
  |  Branch (282:9): [True: 0, False: 3.86k]
  ------------------
  283|      0|        flushOutputBuffer(dcursor, dend);
  284|      0|    }
  285|       |
  286|  3.86k|    return scursor == send;
  287|  3.86k|}
_ZN7KCodecs23Rfc2047BEncodingEncoder6encodeERPKcS2_RPcS2_:
  290|  3.86k|{
  291|       |    // detect when the caller doesn't adhere to our rules:
  292|  3.86k|    if (mInsideFinishing) {
  ------------------
  |  Branch (292:9): [True: 0, False: 3.86k]
  ------------------
  293|      0|        return true;
  294|      0|    }
  295|       |
  296|  78.5M|    while (scursor != send && dcursor != dend) {
  ------------------
  |  Branch (296:12): [True: 78.5M, False: 3.86k]
  |  Branch (296:31): [True: 78.5M, False: 0]
  ------------------
  297|       |        // properly empty the output buffer before starting something new:
  298|       |        // ### fixme: we can optimize this away, since the buffer isn't
  299|       |        // written to anyway (most of the time)
  300|  78.5M|        if (d->outputBufferCursor && !flushOutputBuffer(dcursor, dend)) {
  ------------------
  |  Branch (300:13): [True: 0, False: 78.5M]
  |  Branch (300:38): [True: 0, False: 0]
  ------------------
  301|      0|            return scursor == send;
  302|      0|        }
  303|       |
  304|  78.5M|        uchar ch = *scursor++;
  305|       |        // mNextbits   // (part of) value of next sextet
  306|       |
  307|       |        // depending on mStepNo, extract value and mNextbits from the
  308|       |        // octet stream:
  309|  78.5M|        switch (mStepNo) {
  310|  26.1M|        case 0:
  ------------------
  |  Branch (310:9): [True: 26.1M, False: 52.3M]
  ------------------
  311|  26.1M|            assert(mNextbits == 0);
  312|  26.1M|            writeBase64(ch >> 2, dcursor, dend); // top-most 6 bits -> output
  313|  26.1M|            mNextbits = (ch & 0x3) << 4; // 0..1 bits -> 4..5 in mNextbits
  314|  26.1M|            break;
  315|  26.1M|        case 1:
  ------------------
  |  Branch (315:9): [True: 26.1M, False: 52.3M]
  ------------------
  316|  26.1M|            assert((mNextbits & ~0x30) == 0);
  317|  26.1M|            writeBase64(mNextbits | ch >> 4, dcursor, dend); // 4..7 bits -> 0..3 in value
  318|  26.1M|            mNextbits = (ch & 0xf) << 2; // 0..3 bits -> 2..5 in mNextbits
  319|  26.1M|            break;
  320|  26.1M|        case 2:
  ------------------
  |  Branch (320:9): [True: 26.1M, False: 52.3M]
  ------------------
  321|  26.1M|            assert((mNextbits & ~0x3C) == 0);
  322|  26.1M|            writeBase64(mNextbits | ch >> 6, dcursor, dend); // 6..7 bits -> 0..1 in value
  323|  26.1M|            writeBase64(ch & 0x3F, dcursor, dend); // 0..5 bits -> output
  324|  26.1M|            mNextbits = 0;
  325|  26.1M|            break;
  326|      0|        default:
  ------------------
  |  Branch (326:9): [True: 0, False: 78.5M]
  ------------------
  327|      0|            assert(0);
  328|  78.5M|        }
  329|  78.5M|        mStepNo = (mStepNo + 1) % 3;
  330|  78.5M|    }
  331|       |
  332|  3.86k|    if (d->outputBufferCursor) {
  ------------------
  |  Branch (332:9): [True: 0, False: 3.86k]
  ------------------
  333|      0|        flushOutputBuffer(dcursor, dend);
  334|      0|    }
  335|       |
  336|  3.86k|    return scursor == send;
  337|  3.86k|}
_ZN7KCodecs13Base64Encoder6finishERPcPKc:
  340|  3.86k|{
  341|  3.86k|    return generic_finish(dcursor, dend, true);
  342|  3.86k|}
_ZN7KCodecs23Rfc2047BEncodingEncoder6finishERPcPKc:
  345|  3.86k|{
  346|  3.86k|    return generic_finish(dcursor, dend, false);
  347|  3.86k|}
_ZN7KCodecs13Base64Encoder14generic_finishERPcPKcb:
  350|  7.73k|{
  351|  7.73k|    if (mInsideFinishing) {
  ------------------
  |  Branch (351:9): [True: 0, False: 7.73k]
  ------------------
  352|      0|        return flushOutputBuffer(dcursor, dend);
  353|      0|    }
  354|       |
  355|  7.73k|    if (d->outputBufferCursor && !flushOutputBuffer(dcursor, dend)) {
  ------------------
  |  Branch (355:9): [True: 0, False: 7.73k]
  |  Branch (355:34): [True: 0, False: 0]
  ------------------
  356|      0|        return false;
  357|      0|    }
  358|       |
  359|  7.73k|    mInsideFinishing = true;
  360|       |
  361|       |    //
  362|       |    // writing out the last mNextbits...
  363|       |    //
  364|  7.73k|    switch (mStepNo) {
  365|  2.44k|    case 1: // 2 mNextbits waiting to be written. Needs two padding chars:
  ------------------
  |  Branch (365:5): [True: 2.44k, False: 5.28k]
  ------------------
  366|  5.61k|    case 2: // 4 or 6 mNextbits waiting to be written. Completes a block
  ------------------
  |  Branch (366:5): [True: 3.17k, False: 4.56k]
  ------------------
  367|  5.61k|        writeBase64(mNextbits, dcursor, dend);
  368|  5.61k|        mNextbits = 0;
  369|  5.61k|        break;
  370|  2.11k|    case 0: // no padding, nothing to be written, except possibly the CRLF
  ------------------
  |  Branch (370:5): [True: 2.11k, False: 5.61k]
  ------------------
  371|  2.11k|        assert(mNextbits == 0);
  372|  2.11k|        break;
  373|  2.11k|    default:
  ------------------
  |  Branch (373:5): [True: 0, False: 7.73k]
  ------------------
  374|      0|        assert(0);
  375|  7.73k|    }
  376|       |
  377|       |    //
  378|       |    // adding padding...
  379|       |    //
  380|  7.73k|    switch (mStepNo) {
  381|  2.44k|    case 1:
  ------------------
  |  Branch (381:5): [True: 2.44k, False: 5.28k]
  ------------------
  382|  2.44k|        write('=', dcursor, dend);
  383|  2.44k|        Q_FALLTHROUGH();
  384|       |    // fall through:
  385|  5.61k|    case 2:
  ------------------
  |  Branch (385:5): [True: 3.17k, False: 4.56k]
  ------------------
  386|  5.61k|        write('=', dcursor, dend);
  387|  5.61k|        Q_FALLTHROUGH();
  388|       |    // fall through:
  389|  7.73k|    case 0: // completed a quartet - add CRLF
  ------------------
  |  Branch (389:5): [True: 2.11k, False: 5.61k]
  ------------------
  390|  7.73k|        if (withLFatEnd) {
  ------------------
  |  Branch (390:13): [True: 3.86k, False: 3.86k]
  ------------------
  391|  3.86k|            writeCRLF(dcursor, dend);
  392|  3.86k|        }
  393|  7.73k|        return flushOutputBuffer(dcursor, dend);
  394|      0|    default:
  ------------------
  |  Branch (394:5): [True: 0, False: 7.73k]
  ------------------
  395|      0|        assert(0);
  396|  7.73k|    }
  397|      0|    return true; // asserts get compiled out
  398|  7.73k|}
_ZN7KCodecs13Base64EncoderC2ENS_5Codec11NewlineTypeE:
   97|  7.73k|        : Encoder(newline)
   98|  7.73k|        , mStepNo(0)
   99|  7.73k|        , mWrittenPacketsOnThisLine(0)
  100|  7.73k|        , mNextbits(0)
  101|  7.73k|        , mInsideFinishing(false)
  102|  7.73k|    {
  103|  7.73k|    }
_ZN7KCodecs13Base64DecoderC2ENS_5Codec11NewlineTypeE:
   62|  7.73k|        : Decoder(newline)
   63|  7.73k|        , mStepNo(0)
   64|  7.73k|        , mOutbits(0)
   65|  7.73k|        , mSawPadding(false)
   66|  7.73k|    {
   67|  7.73k|    }
_ZN7KCodecs23Rfc2047BEncodingEncoderC2ENS_5Codec11NewlineTypeE:
  128|  3.86k|        : Base64Encoder(newline)
  129|  3.86k|    {
  130|  3.86k|    }
_ZN7KCodecs13Base64Encoder11writeBase64EhRPcPKc:
  118|   209M|    {
  119|   209M|        return write(base64EncodeMap[ch], dcursor, dend);
  120|   209M|    }
_ZN7KCodecs13Base64Decoder6finishERPcPKc:
   77|  7.73k|    {
   78|  7.73k|        Q_UNUSED(dcursor);
   79|  7.73k|        Q_UNUSED(dend);
   80|  7.73k|        return true;
   81|  7.73k|    }

_ZN7KCodecs21Rfc2047BEncodingCodecC2Ev:
  136|      1|        : Base64Codec()
  137|      1|    {
  138|      1|    }
_ZN7KCodecs11Base64CodecC2Ev:
   55|      2|        : Codec()
   56|      2|    {
   57|      2|    }
_ZNK7KCodecs11Base64Codec17maxEncodedSizeForExNS_5Codec11NewlineTypeE:
   80|  3.86k|    {
   81|       |        // first, the total number of 4-char packets will be:
   82|  3.86k|        qsizetype totalNumPackets = (insize + 2) / 3;
   83|       |        // now, after every 76/4'th packet there needs to be a linebreak:
   84|  3.86k|        qsizetype numLineBreaks = totalNumPackets / (76 / 4);
   85|       |        // and at the very end, too:
   86|  3.86k|        ++numLineBreaks;
   87|       |        // putting it all together, we have:
   88|  3.86k|        return 4 * totalNumPackets + (newline == Codec::NewlineCRLF ? 2 : 1) * numLineBreaks;
  ------------------
  |  Branch (88:39): [True: 1.93k, False: 1.93k]
  ------------------
   89|  3.86k|    }
_ZNK7KCodecs11Base64Codec17maxDecodedSizeForExNS_5Codec11NewlineTypeE:
   96|  3.86k|    {
   97|       |        // assuming all characters are part of the base64 stream (which
   98|       |        // does almost never hold due to required linebreaking; but
   99|       |        // additional non-base64 chars don't affect the output size), each
  100|       |        // 4-tupel of them becomes a 3-tupel in the decoded octet
  101|       |        // stream. So:
  102|  3.86k|        qsizetype result = ((insize + 3) / 4) * 3;
  103|       |        // but all of them may be \n, so
  104|  3.86k|        if (newline == Codec::NewlineCRLF) {
  ------------------
  |  Branch (104:13): [True: 1.93k, False: 1.93k]
  ------------------
  105|  1.93k|            result *= 2; // :-o
  106|  1.93k|        }
  107|       |
  108|  3.86k|        return result;
  109|  3.86k|    }
_ZNK7KCodecs21Rfc2047BEncodingCodec17maxEncodedSizeForExNS_5Codec11NewlineTypeE:
  161|  3.86k|    {
  162|  3.86k|        Q_UNUSED(newline);
  163|       |        // Each (begun) 3-octet triple becomes a 4 char quartet, so:
  164|  3.86k|        return ((insize + 2) / 3) * 4;
  165|  3.86k|    }
_ZNK7KCodecs21Rfc2047BEncodingCodec17maxDecodedSizeForExNS_5Codec11NewlineTypeE:
  172|  3.86k|    {
  173|  3.86k|        Q_UNUSED(newline);
  174|       |        // Each 4-char quartet becomes a 3-octet triple, the last one
  175|       |        // possibly even less. So:
  176|  3.86k|        return ((insize + 3) / 4) * 3;
  177|  3.86k|    }

_ZNK7KCodecs20QuotedPrintableCodec11makeEncoderENS_5Codec11NewlineTypeE:
  261|  3.86k|{
  262|  3.86k|    return new QuotedPrintableEncoder(newline);
  263|  3.86k|}
_ZNK7KCodecs20QuotedPrintableCodec11makeDecoderENS_5Codec11NewlineTypeE:
  266|  3.86k|{
  267|  3.86k|    return new QuotedPrintableDecoder(newline);
  268|  3.86k|}
_ZNK7KCodecs20QuotedPrintableCodec17maxDecodedSizeForExNS_5Codec11NewlineTypeE:
  271|  3.86k|{
  272|  3.86k|    return QuotedPrintableDecoder_maxDecodedSizeFor(insize, newline);
  273|  3.86k|}
_ZNK7KCodecs21Rfc2047QEncodingCodec11makeEncoderENS_5Codec11NewlineTypeE:
  276|  3.86k|{
  277|  3.86k|    return new Rfc2047QEncodingEncoder(newline);
  278|  3.86k|}
_ZNK7KCodecs21Rfc2047QEncodingCodec11makeDecoderENS_5Codec11NewlineTypeE:
  281|  3.86k|{
  282|  3.86k|    return new QuotedPrintableDecoder(newline, true);
  283|  3.86k|}
_ZNK7KCodecs21Rfc2047QEncodingCodec17maxDecodedSizeForExNS_5Codec11NewlineTypeE:
  286|  3.86k|{
  287|  3.86k|    return QuotedPrintableDecoder_maxDecodedSizeFor(insize, newline);
  288|  3.86k|}
_ZNK7KCodecs20Rfc2231EncodingCodec11makeEncoderENS_5Codec11NewlineTypeE:
  291|  3.86k|{
  292|  3.86k|    return new Rfc2047QEncodingEncoder(newline, '%');
  293|  3.86k|}
_ZNK7KCodecs20Rfc2231EncodingCodec11makeDecoderENS_5Codec11NewlineTypeE:
  296|  3.86k|{
  297|  3.86k|    return new QuotedPrintableDecoder(newline, true, '%');
  298|  3.86k|}
_ZNK7KCodecs20Rfc2231EncodingCodec17maxDecodedSizeForExNS_5Codec11NewlineTypeE:
  301|  3.86k|{
  302|  3.86k|    return QuotedPrintableDecoder_maxDecodedSizeFor(insize, newline);
  303|  3.86k|}
_ZN7KCodecs22QuotedPrintableDecoder6decodeERPKcS2_RPcS2_:
  310|   355k|{
  311|   355k|    if (d->newline == Codec::NewlineCRLF) {
  ------------------
  |  Branch (311:9): [True: 177k, False: 177k]
  ------------------
  312|   177k|        qWarning() << "CRLF output for decoders isn't yet supported!";
  313|   177k|    }
  314|       |
  315|   236M|    while (scursor != send && dcursor != dend) {
  ------------------
  |  Branch (315:12): [True: 236M, False: 11.5k]
  |  Branch (315:31): [True: 236M, False: 0]
  ------------------
  316|   236M|        if (mFlushing) {
  ------------------
  |  Branch (316:13): [True: 290k, False: 235M]
  ------------------
  317|       |            // we have to flush chars in the aftermath of a decoding
  318|       |            // error. The way to request a flush is to
  319|       |            // - store the offending character in mBadChar and
  320|       |            // - set mFlushing to true.
  321|       |            // The supported cases are (H: hexchar, X: bad char):
  322|       |            // =X, =HX, CR
  323|       |            // mBadChar is only written out if it is not by itself illegal in
  324|       |            // quoted-printable (e.g. CTLs, 8Bits).
  325|       |            // A fast way to suppress mBadChar output is to set it to NUL.
  326|   290k|            if (mInsideHexChar) {
  ------------------
  |  Branch (326:17): [True: 139k, False: 150k]
  ------------------
  327|       |                // output '='
  328|   139k|                *dcursor++ = mEscapeChar;
  329|   139k|                mInsideHexChar = false;
  330|   150k|            } else if (mHaveAccu) {
  ------------------
  |  Branch (330:24): [True: 10.9k, False: 139k]
  ------------------
  331|       |                // output the high nibble of the accumulator:
  332|  10.9k|                *dcursor++ = mLastChar;
  333|  10.9k|                mHaveAccu = false;
  334|  10.9k|                mAccu = 0;
  335|   139k|            } else {
  336|       |                // output mBadChar
  337|   139k|                assert(mAccu == 0);
  338|   139k|                if (mBadChar) {
  ------------------
  |  Branch (338:21): [True: 138k, False: 1.50k]
  ------------------
  339|   138k|                    if (mBadChar == '=') {
  ------------------
  |  Branch (339:25): [True: 118k, False: 20.0k]
  ------------------
  340|   118k|                        mInsideHexChar = true;
  341|   118k|                    } else {
  342|  20.0k|                        *dcursor++ = mBadChar;
  343|  20.0k|                    }
  344|   138k|                    mBadChar = 0;
  345|   138k|                }
  346|   139k|                mFlushing = false;
  347|   139k|            }
  348|   290k|            continue;
  349|   290k|        }
  350|   235M|        assert(mBadChar == 0);
  351|       |
  352|   235M|        uchar ch = *scursor++;
  353|       |
  354|   235M|        if (mExpectLF && ch != '\n') {
  ------------------
  |  Branch (354:13): [True: 7.03M, False: 228M]
  |  Branch (354:26): [True: 519k, False: 6.51M]
  ------------------
  355|       |            // qWarning() << "QuotedPrintableDecoder:"
  356|       |            //              "illegally formed soft linebreak or lonely CR!";
  357|   519k|            mInsideHexChar = false;
  358|   519k|            mExpectLF = false;
  359|   519k|            if (mAccu != 0) {
  ------------------
  |  Branch (359:17): [True: 343k, False: 176k]
  ------------------
  360|   343k|                return false;
  361|   343k|            }
  362|   519k|        }
  363|       |
  364|   235M|        if (mInsideHexChar) {
  ------------------
  |  Branch (364:13): [True: 239k, False: 235M]
  ------------------
  365|   239k|            uchar value = 255;
  366|       |            // next char(s) represent nibble instead of itself:
  367|   239k|            if (ch <= '9') {
  ------------------
  |  Branch (367:17): [True: 100k, False: 139k]
  ------------------
  368|   100k|                if (ch >= '0') {
  ------------------
  |  Branch (368:21): [True: 23.4k, False: 76.8k]
  ------------------
  369|  23.4k|                    value = ch - '0';
  370|  76.8k|                } else {
  371|  76.8k|                    switch (ch) {
  372|  60.6k|                    case '\r':
  ------------------
  |  Branch (372:21): [True: 60.6k, False: 16.2k]
  ------------------
  373|  60.6k|                        mExpectLF = true;
  374|  60.6k|                        break;
  375|  6.84k|                    case '\n':
  ------------------
  |  Branch (375:21): [True: 6.84k, False: 70.0k]
  ------------------
  376|       |                        // soft line break, but only if mAccu is NUL.
  377|  6.84k|                        if (!mHaveAccu) {
  ------------------
  |  Branch (377:29): [True: 5.60k, False: 1.23k]
  ------------------
  378|  5.60k|                            mExpectLF = false;
  379|  5.60k|                            mInsideHexChar = false;
  380|  5.60k|                            break;
  381|  5.60k|                        }
  382|       |                    // else fall through
  383|  10.6k|                    default:
  ------------------
  |  Branch (383:21): [True: 9.41k, False: 67.4k]
  ------------------
  384|       |                        // qWarning() << "QuotedPrintableDecoder:"
  385|       |                        //              "illegally formed hex char! Outputting verbatim.";
  386|  10.6k|                        mBadChar = ch;
  387|  10.6k|                        mFlushing = true;
  388|  76.8k|                    }
  389|  76.8k|                    continue;
  390|  76.8k|                }
  391|   139k|            } else { // ch > '9'
  392|   139k|                if (ch <= 'F') {
  ------------------
  |  Branch (392:21): [True: 121k, False: 17.4k]
  ------------------
  393|   121k|                    if (ch >= 'A') {
  ------------------
  |  Branch (393:25): [True: 3.21k, False: 118k]
  ------------------
  394|  3.21k|                        value = 10 + ch - 'A';
  395|   118k|                    } else { // [:-@]
  396|   118k|                        mBadChar = ch;
  397|   118k|                        mFlushing = true;
  398|   118k|                        continue;
  399|   118k|                    }
  400|   121k|                } else { // ch > 'F'
  401|  17.4k|                    if (ch <= 'f' && ch >= 'a') {
  ------------------
  |  Branch (401:25): [True: 10.3k, False: 7.15k]
  |  Branch (401:38): [True: 6.70k, False: 3.59k]
  ------------------
  402|  6.70k|                        value = 10 + ch - 'a';
  403|  10.7k|                    } else {
  404|  10.7k|                        mBadChar = ch;
  405|  10.7k|                        mFlushing = true;
  406|  10.7k|                        continue;
  407|  10.7k|                    }
  408|  17.4k|                }
  409|   139k|            }
  410|       |
  411|  33.3k|            assert(value < 16);
  412|  33.3k|            assert(mBadChar == 0);
  413|  33.3k|            assert(!mExpectLF);
  414|       |
  415|  33.3k|            if (mHaveAccu) {
  ------------------
  |  Branch (415:17): [True: 10.9k, False: 22.4k]
  ------------------
  416|  10.9k|                *dcursor++ = char(mAccu | value);
  417|  10.9k|                mAccu = 0;
  418|  10.9k|                mHaveAccu = false;
  419|  10.9k|                mInsideHexChar = false;
  420|  22.4k|            } else {
  421|  22.4k|                mHaveAccu = true;
  422|  22.4k|                mAccu = value << 4;
  423|  22.4k|                mLastChar = ch;
  424|  22.4k|            }
  425|   235M|        } else { // not mInsideHexChar
  426|   235M|            if ((ch <= '~' && ch >= ' ') || ch == '\t') {
  ------------------
  |  Branch (426:18): [True: 55.4M, False: 179M]
  |  Branch (426:31): [True: 25.2M, False: 30.2M]
  |  Branch (426:45): [True: 16.5k, False: 209M]
  ------------------
  427|  25.2M|                if (ch == mEscapeChar) {
  ------------------
  |  Branch (427:21): [True: 99.1k, False: 25.1M]
  ------------------
  428|  99.1k|                    mInsideHexChar = true;
  429|  25.1M|                } else if (mQEncoding && ch == '_') {
  ------------------
  |  Branch (429:28): [True: 16.8M, False: 8.36M]
  |  Branch (429:42): [True: 6.21k, False: 16.8M]
  ------------------
  430|  6.21k|                    *dcursor++ = char(0x20);
  431|  25.1M|                } else {
  432|  25.1M|                    *dcursor++ = char(ch);
  433|  25.1M|                }
  434|   209M|            } else if (ch == '\n') {
  ------------------
  |  Branch (434:24): [True: 6.86M, False: 203M]
  ------------------
  435|  6.86M|                *dcursor++ = '\n';
  436|  6.86M|                mExpectLF = false;
  437|   203M|            } else if (ch == '\r') {
  ------------------
  |  Branch (437:24): [True: 6.96M, False: 196M]
  ------------------
  438|  6.96M|                mExpectLF = true;
  439|   196M|            } else {
  440|       |                // qWarning() << "QuotedPrintableDecoder:" << ch <<
  441|       |                //  "illegal character in input stream!";
  442|   196M|                *dcursor++ = char(ch);
  443|   196M|            }
  444|   235M|        }
  445|   235M|    }
  446|       |
  447|  11.5k|    return scursor == send;
  448|   355k|}
_ZN7KCodecs22QuotedPrintableDecoder6finishERPcPKc:
  451|  11.5k|{
  452|  13.0k|    while ((mInsideHexChar || mHaveAccu || mFlushing) && dcursor != dend) {
  ------------------
  |  Branch (452:13): [True: 584, False: 12.4k]
  |  Branch (452:31): [True: 530, False: 11.9k]
  |  Branch (452:44): [True: 334, False: 11.5k]
  |  Branch (452:58): [True: 1.44k, False: 0]
  ------------------
  453|       |        // we have to flush chars
  454|  1.44k|        if (mInsideHexChar) {
  ------------------
  |  Branch (454:13): [True: 584, False: 864]
  ------------------
  455|       |            // output '='
  456|    584|            *dcursor++ = mEscapeChar;
  457|    584|            mInsideHexChar = false;
  458|    864|        } else if (mHaveAccu) {
  ------------------
  |  Branch (458:20): [True: 530, False: 334]
  ------------------
  459|       |            // output the high nibble of the accumulator:
  460|    530|            *dcursor++ = mLastChar;
  461|    530|            mHaveAccu = false;
  462|    530|            mAccu = 0;
  463|    530|        } else {
  464|       |            // output mBadChar
  465|    334|            assert(mAccu == 0);
  466|    334|            if (mBadChar) {
  ------------------
  |  Branch (466:17): [True: 318, False: 16]
  ------------------
  467|    318|                *dcursor++ = mBadChar;
  468|    318|                mBadChar = 0;
  469|    318|            }
  470|    334|            mFlushing = false;
  471|    334|        }
  472|  1.44k|    }
  473|       |
  474|       |    // return false if we are not finished yet; note that mInsideHexChar is always false
  475|  11.5k|    return !(mHaveAccu || mFlushing);
  ------------------
  |  Branch (475:14): [True: 0, False: 11.5k]
  |  Branch (475:27): [True: 0, False: 11.5k]
  ------------------
  476|  11.5k|}
_ZN7KCodecs22QuotedPrintableEncoder15fillInputBufferERPKcS2_:
  479|  76.3M|{
  480|       |    // Don't read more if there's still a tail of a line in the buffer:
  481|  76.3M|    if (mSawLineEnd) {
  ------------------
  |  Branch (481:9): [True: 178k, False: 76.1M]
  ------------------
  482|   178k|        return true;
  483|   178k|    }
  484|       |
  485|       |    // Read until the buffer is full or we have found CRLF or LF (which
  486|       |    // don't end up in the input buffer):
  487|   152M|    for (; (mInputBufferWriteCursor + 1) % 16 != mInputBufferReadCursor && scursor != send; mInputBufferWriteCursor++) {
  ------------------
  |  Branch (487:12): [True: 78.5M, False: 73.9M]
  |  Branch (487:76): [True: 78.5M, False: 2.07k]
  ------------------
  488|  78.5M|        char ch = *scursor++;
  489|  78.5M|        if (ch == '\r') {
  ------------------
  |  Branch (489:13): [True: 2.43M, False: 76.1M]
  ------------------
  490|  2.43M|            mSawCR = true;
  491|  76.1M|        } else if (ch == '\n') {
  ------------------
  |  Branch (491:20): [True: 2.29M, False: 73.8M]
  ------------------
  492|       |            // remove the CR from the input buffer (if any) and return that
  493|       |            // we found a line ending:
  494|  2.29M|            if (mSawCR) {
  ------------------
  |  Branch (494:17): [True: 2.17M, False: 120k]
  ------------------
  495|  2.17M|                mSawCR = false;
  496|  2.17M|                assert(mInputBufferWriteCursor != mInputBufferReadCursor);
  497|  2.17M|                mInputBufferWriteCursor--;
  498|  2.17M|            }
  499|  2.29M|            mSawLineEnd = true;
  500|  2.29M|            return true; // saw CRLF or LF
  501|  73.8M|        } else {
  502|  73.8M|            mSawCR = false;
  503|  73.8M|        }
  504|  76.2M|        mInputBuffer[mInputBufferWriteCursor] = ch;
  505|  76.2M|    }
  506|  73.9M|    mSawLineEnd = false;
  507|  73.9M|    return false; // didn't see a line ending...
  508|  76.1M|}
_ZN7KCodecs22QuotedPrintableEncoder15processNextCharEv:
  511|  76.4M|{
  512|       |    // If we process a buffer which doesn't end in a line break, we
  513|       |    // can't process all of it, since the next chars that will be read
  514|       |    // could be a line break. So we empty the buffer only until a fixed
  515|       |    // number of chars is left (except when mFinishing, which means that
  516|       |    // the data doesn't end in newline):
  517|  76.4M|    const int minBufferFillWithoutLineEnd = 4;
  518|       |
  519|  76.4M|    assert(d->outputBufferCursor == 0);
  520|       |
  521|  76.4M|    int bufferFill = int(mInputBufferWriteCursor) - int(mInputBufferReadCursor);
  522|  76.4M|    if (bufferFill < 0) {
  ------------------
  |  Branch (522:9): [True: 69.3M, False: 7.05M]
  ------------------
  523|  69.3M|        bufferFill += 16;
  524|  69.3M|    }
  525|       |
  526|  76.4M|    assert(bufferFill >= 0 && bufferFill <= 15);
  527|       |
  528|  76.4M|    if (!mFinishing //
  ------------------
  |  Branch (528:9): [True: 76.3M, False: 32.1k]
  ------------------
  529|  76.4M|        && !mSawLineEnd //
  ------------------
  |  Branch (529:12): [True: 73.9M, False: 2.46M]
  ------------------
  530|  76.4M|        && bufferFill < minBufferFillWithoutLineEnd) {
  ------------------
  |  Branch (530:12): [True: 1.34k, False: 73.9M]
  ------------------
  531|  1.34k|        return false;
  532|  1.34k|    }
  533|       |
  534|       |    // buffer is empty, return false:
  535|  76.4M|    if (mInputBufferReadCursor == mInputBufferWriteCursor) {
  ------------------
  |  Branch (535:9): [True: 2.29M, False: 74.1M]
  ------------------
  536|  2.29M|        return false;
  537|  2.29M|    }
  538|       |
  539|       |    // Real processing goes here:
  540|  74.1M|    mAccu = mInputBuffer[mInputBufferReadCursor++];
  541|  74.1M|    if (needsEncoding(mAccu)) { // always needs encoding or
  ------------------
  |  Branch (541:9): [True: 65.7M, False: 8.38M]
  ------------------
  542|  65.7M|        mAccuNeedsEncoding = Definitely;
  543|  65.7M|    } else if ((mSawLineEnd || mFinishing) // needs encoding at end of line
  ------------------
  |  Branch (543:17): [True: 88.0k, False: 8.29M]
  |  Branch (543:32): [True: 7.27k, False: 8.29M]
  ------------------
  544|  8.38M|               && bufferFill == 1 // or end of buffer
  ------------------
  |  Branch (544:19): [True: 33.6k, False: 61.6k]
  ------------------
  545|  8.38M|               && needsEncodingAtEOL(mAccu)) {
  ------------------
  |  Branch (545:19): [True: 3.22k, False: 30.4k]
  ------------------
  546|  3.22k|        mAccuNeedsEncoding = Definitely;
  547|  8.38M|    } else if (needsEncodingAtBOL(mAccu)) {
  ------------------
  |  Branch (547:16): [True: 39.6k, False: 8.34M]
  ------------------
  548|  39.6k|        mAccuNeedsEncoding = AtBOL;
  549|  8.34M|    } else {
  550|       |        // never needs encoding
  551|  8.34M|        mAccuNeedsEncoding = Never;
  552|  8.34M|    }
  553|       |
  554|  74.1M|    return true;
  555|  76.4M|}
_ZN7KCodecs22QuotedPrintableEncoder18createOutputBufferERPcPKc:
  562|  74.1M|{
  563|  74.1M|    const int maxLineLength = 76; // rfc 2045
  564|       |
  565|  74.1M|    assert(d->outputBufferCursor == 0);
  566|       |
  567|       |    /* clang-format off */
  568|  74.1M|    bool lastOneOnThisLine = mSawLineEnd
  ------------------
  |  Branch (568:30): [True: 179k, False: 73.9M]
  ------------------
  569|  74.1M|                             && mInputBufferReadCursor == mInputBufferWriteCursor;
  ------------------
  |  Branch (569:33): [True: 51.3k, False: 127k]
  ------------------
  570|       |    /* clang-format on */
  571|       |
  572|  74.1M|    int neededSpace = 1;
  573|  74.1M|    if (mAccuNeedsEncoding == Definitely) {
  ------------------
  |  Branch (573:9): [True: 65.7M, False: 8.38M]
  ------------------
  574|  65.7M|        neededSpace = 3;
  575|  65.7M|    }
  576|       |
  577|       |    // reserve space for the soft hyphen (=)
  578|  74.1M|    if (!lastOneOnThisLine) {
  ------------------
  |  Branch (578:9): [True: 74.0M, False: 51.3k]
  ------------------
  579|  74.0M|        neededSpace++;
  580|  74.0M|    }
  581|       |
  582|  74.1M|    if (mCurrentLineLength > maxLineLength - neededSpace) {
  ------------------
  |  Branch (582:9): [True: 2.73M, False: 71.3M]
  ------------------
  583|       |        // current line too short, insert soft line break:
  584|  2.73M|        write('=', dcursor, dend);
  585|  2.73M|        writeCRLF(dcursor, dend);
  586|  2.73M|        mCurrentLineLength = 0;
  587|  2.73M|    }
  588|       |
  589|  74.1M|    if (Never == mAccuNeedsEncoding //
  ------------------
  |  Branch (589:9): [True: 8.34M, False: 65.7M]
  ------------------
  590|  74.1M|        || (AtBOL == mAccuNeedsEncoding && mCurrentLineLength != 0)) {
  ------------------
  |  Branch (590:13): [True: 39.6k, False: 65.7M]
  |  Branch (590:44): [True: 33.6k, False: 5.95k]
  ------------------
  591|  8.37M|        write(mAccu, dcursor, dend);
  592|  8.37M|        mCurrentLineLength++;
  593|  65.7M|    } else {
  594|  65.7M|        write('=', dcursor, dend);
  595|  65.7M|        write(binToHex(highNibble(mAccu)), dcursor, dend);
  596|  65.7M|        write(binToHex(lowNibble(mAccu)), dcursor, dend);
  597|  65.7M|        mCurrentLineLength += 3;
  598|  65.7M|    }
  599|  74.1M|}
_ZN7KCodecs22QuotedPrintableEncoder6encodeERPKcS2_RPcS2_:
  602|  3.86k|{
  603|       |    // support probing by the caller:
  604|  3.86k|    if (mFinishing) {
  ------------------
  |  Branch (604:9): [True: 0, False: 3.86k]
  ------------------
  605|      0|        return true;
  606|      0|    }
  607|       |
  608|  76.3M|    while (scursor != send && dcursor != dend) {
  ------------------
  |  Branch (608:12): [True: 76.3M, False: 2.51k]
  |  Branch (608:31): [True: 76.3M, False: 0]
  ------------------
  609|  76.3M|        if (d->outputBufferCursor && !flushOutputBuffer(dcursor, dend)) {
  ------------------
  |  Branch (609:13): [True: 0, False: 76.3M]
  |  Branch (609:38): [True: 0, False: 0]
  ------------------
  610|      0|            return scursor == send;
  611|      0|        }
  612|       |
  613|  76.3M|        assert(d->outputBufferCursor == 0);
  614|       |
  615|       |        // fill input buffer until eol has been reached or until the
  616|       |        // buffer is full, whatever comes first:
  617|  76.3M|        fillInputBuffer(scursor, send);
  618|       |
  619|  76.3M|        if (processNextChar()) {
  ------------------
  |  Branch (619:13): [True: 74.0M, False: 2.29M]
  ------------------
  620|       |            // there was one...
  621|  74.0M|            createOutputBuffer(dcursor, dend);
  622|  74.0M|        } else if (mSawLineEnd && mInputBufferWriteCursor == mInputBufferReadCursor) {
  ------------------
  |  Branch (622:20): [True: 2.29M, False: 1.34k]
  |  Branch (622:35): [True: 2.29M, False: 0]
  ------------------
  623|       |            // load a hard line break into output buffer:
  624|  2.29M|            writeCRLF(dcursor, dend);
  625|       |            // signal fillInputBuffer() we are ready for the next line:
  626|  2.29M|            mSawLineEnd = false;
  627|  2.29M|            mCurrentLineLength = 0;
  628|  2.29M|        } else {
  629|       |            // we are supposedly finished with this input block:
  630|  1.34k|            break;
  631|  1.34k|        }
  632|  76.3M|    }
  633|       |
  634|       |    // make sure we write as much as possible and don't stop _writing_
  635|       |    // just because we have no more _input_:
  636|  3.86k|    if (d->outputBufferCursor) {
  ------------------
  |  Branch (636:9): [True: 0, False: 3.86k]
  ------------------
  637|      0|        flushOutputBuffer(dcursor, dend);
  638|      0|    }
  639|       |
  640|  3.86k|    return scursor == send;
  641|       |
  642|  3.86k|} // encode
_ZN7KCodecs22QuotedPrintableEncoder6finishERPcPKc:
  645|  3.86k|{
  646|  3.86k|    mFinishing = true;
  647|       |
  648|  3.86k|    if (mFinished) {
  ------------------
  |  Branch (648:9): [True: 0, False: 3.86k]
  ------------------
  649|      0|        return flushOutputBuffer(dcursor, dend);
  650|      0|    }
  651|       |
  652|  33.4k|    while (dcursor != dend) {
  ------------------
  |  Branch (652:12): [True: 32.1k, False: 1.29k]
  ------------------
  653|  32.1k|        if (d->outputBufferCursor && !flushOutputBuffer(dcursor, dend)) {
  ------------------
  |  Branch (653:13): [True: 0, False: 32.1k]
  |  Branch (653:38): [True: 0, False: 0]
  ------------------
  654|      0|            return false;
  655|      0|        }
  656|       |
  657|  32.1k|        assert(d->outputBufferCursor == 0);
  658|       |
  659|  32.1k|        if (processNextChar()) {
  ------------------
  |  Branch (659:13): [True: 29.4k, False: 2.67k]
  ------------------
  660|       |            // there was one...
  661|  29.4k|            createOutputBuffer(dcursor, dend);
  662|  29.4k|        } else if (mSawLineEnd && mInputBufferWriteCursor == mInputBufferReadCursor) {
  ------------------
  |  Branch (662:20): [True: 96, False: 2.57k]
  |  Branch (662:35): [True: 96, False: 0]
  ------------------
  663|       |            // load a hard line break into output buffer:
  664|     96|            writeCRLF(dcursor, dend);
  665|     96|            mSawLineEnd = false;
  666|     96|            mCurrentLineLength = 0;
  667|  2.57k|        } else {
  668|  2.57k|            mFinished = true;
  669|  2.57k|            return flushOutputBuffer(dcursor, dend);
  670|  2.57k|        }
  671|  32.1k|    }
  672|       |
  673|  1.29k|    return mFinished && !d->outputBufferCursor;
  ------------------
  |  Branch (673:12): [True: 0, False: 1.29k]
  |  Branch (673:25): [True: 0, False: 0]
  ------------------
  674|       |
  675|  3.86k|} // finish
_ZN7KCodecs23Rfc2047QEncodingEncoder6encodeERPKcS2_RPcS2_:
  678|  7.73k|{
  679|  7.73k|    if (mInsideFinishing) {
  ------------------
  |  Branch (679:9): [True: 0, False: 7.73k]
  ------------------
  680|      0|        return true;
  681|      0|    }
  682|       |
  683|   438M|    while (scursor != send && dcursor != dend) {
  ------------------
  |  Branch (683:12): [True: 438M, False: 7.73k]
  |  Branch (683:31): [True: 438M, False: 0]
  ------------------
  684|   438M|        uchar value = 0;
  685|   438M|        switch (mStepNo) {
  686|   157M|        case 0:
  ------------------
  |  Branch (686:9): [True: 157M, False: 281M]
  ------------------
  687|       |            // read the next char and decide if and how do encode:
  688|   157M|            mAccu = *scursor++;
  689|   157M|            if (!needsEncoding(mAccu)) {
  ------------------
  |  Branch (689:17): [True: 16.3M, False: 140M]
  ------------------
  690|  16.3M|                *dcursor++ = char(mAccu);
  691|   140M|            } else if (mEscapeChar == '=' && mAccu == 0x20) {
  ------------------
  |  Branch (691:24): [True: 70.3M, False: 70.4M]
  |  Branch (691:46): [True: 4.91k, False: 70.3M]
  ------------------
  692|       |                // shortcut encoding for 0x20 (latin-1/us-ascii SPACE)
  693|       |                // (not for rfc2231 encoding)
  694|  4.91k|                *dcursor++ = '_';
  695|   140M|            } else {
  696|       |                // needs =XY encoding - write escape char:
  697|   140M|                *dcursor++ = mEscapeChar;
  698|   140M|                mStepNo = 1;
  699|   140M|            }
  700|   157M|            continue;
  701|   140M|        case 1:
  ------------------
  |  Branch (701:9): [True: 140M, False: 297M]
  ------------------
  702|       |            // extract hi-nibble:
  703|   140M|            value = highNibble(mAccu);
  704|   140M|            mStepNo = 2;
  705|   140M|            break;
  706|   140M|        case 2:
  ------------------
  |  Branch (706:9): [True: 140M, False: 297M]
  ------------------
  707|       |            // extract lo-nibble:
  708|   140M|            value = lowNibble(mAccu);
  709|   140M|            mStepNo = 0;
  710|   140M|            break;
  711|      0|        default:
  ------------------
  |  Branch (711:9): [True: 0, False: 438M]
  ------------------
  712|      0|            assert(0);
  713|   438M|        }
  714|       |
  715|       |        // and write:
  716|   281M|        *dcursor++ = binToHex(value);
  717|   281M|    }
  718|       |
  719|  7.73k|    return scursor == send;
  720|  7.73k|} // encode
_ZN7KCodecs23Rfc2047QEncodingEncoder6finishERPcPKc:
  723|  7.73k|{
  724|  7.73k|    mInsideFinishing = true;
  725|       |
  726|       |    // write the last bits of mAccu, if any:
  727|  20.0k|    while (mStepNo != 0 && dcursor != dend) {
  ------------------
  |  Branch (727:12): [True: 12.3k, False: 7.73k]
  |  Branch (727:28): [True: 12.3k, False: 0]
  ------------------
  728|  12.3k|        uchar value = 0;
  729|  12.3k|        switch (mStepNo) {
  730|  6.15k|        case 1:
  ------------------
  |  Branch (730:9): [True: 6.15k, False: 6.15k]
  ------------------
  731|       |            // extract hi-nibble:
  732|  6.15k|            value = highNibble(mAccu);
  733|  6.15k|            mStepNo = 2;
  734|  6.15k|            break;
  735|  6.15k|        case 2:
  ------------------
  |  Branch (735:9): [True: 6.15k, False: 6.15k]
  ------------------
  736|       |            // extract lo-nibble:
  737|  6.15k|            value = lowNibble(mAccu);
  738|  6.15k|            mStepNo = 0;
  739|  6.15k|            break;
  740|      0|        default:
  ------------------
  |  Branch (740:9): [True: 0, False: 12.3k]
  ------------------
  741|      0|            assert(0);
  742|  12.3k|        }
  743|       |
  744|       |        // and write:
  745|  12.3k|        *dcursor++ = binToHex(value);
  746|  12.3k|    }
  747|       |
  748|  7.73k|    return mStepNo == 0;
  749|  7.73k|}
_ZN7KCodecs22QuotedPrintableEncoderC2ENS_5Codec11NewlineTypeE:
  103|  3.86k|        : Encoder(newline)
  104|  3.86k|        , mCurrentLineLength(0)
  105|  3.86k|        , mAccu(0)
  106|  3.86k|        , mInputBufferReadCursor(0)
  107|  3.86k|        , mInputBufferWriteCursor(0)
  108|  3.86k|        , mAccuNeedsEncoding(Never)
  109|  3.86k|        , mSawLineEnd(false)
  110|  3.86k|        , mSawCR(false)
  111|  3.86k|        , mFinishing(false)
  112|  3.86k|        , mFinished(false)
  113|  3.86k|    {
  114|  3.86k|    }
_ZN7KCodecs22QuotedPrintableDecoderC2ENS_5Codec11NewlineTypeEbc:
  171|  11.5k|        : Decoder(newline)
  172|  11.5k|        , mEscapeChar(aEscapeChar)
  173|  11.5k|        , mBadChar(0)
  174|  11.5k|        , mAccu(0)
  175|  11.5k|        , mQEncoding(aQEncoding)
  176|  11.5k|        , mInsideHexChar(false)
  177|  11.5k|        , mFlushing(false)
  178|  11.5k|        , mExpectLF(false)
  179|  11.5k|        , mHaveAccu(false)
  180|  11.5k|        , mLastChar(0)
  181|  11.5k|    {
  182|  11.5k|    }
kcodecsqp.cpp:_ZN7KCodecsL40QuotedPrintableDecoder_maxDecodedSizeForExNS_5Codec11NewlineTypeE:
  246|  11.5k|{
  247|       |    // all chars unencoded:
  248|  11.5k|    qsizetype result = insize;
  249|       |    // but maybe all of them are \n and we need to make them \r\n :-o
  250|  11.5k|    if (newline == Codec::NewlineCRLF) {
  ------------------
  |  Branch (250:9): [True: 5.79k, False: 5.79k]
  ------------------
  251|  5.79k|        result += insize;
  252|  5.79k|    }
  253|       |
  254|       |    // there might be an accu plus escape
  255|  11.5k|    result += 2;
  256|       |
  257|  11.5k|    return result;
  258|  11.5k|}
_ZN7KCodecs23Rfc2047QEncodingEncoderC2ENS_5Codec11NewlineTypeEc:
  204|  7.73k|        : Encoder(newline)
  205|  7.73k|        , mAccu(0)
  206|  7.73k|        , mStepNo(0)
  207|  7.73k|        , mEscapeChar(aEscapeChar)
  208|  7.73k|        , mInsideFinishing(false)
  209|  7.73k|    {
  210|       |        // else an optimization in ::encode might break.
  211|  7.73k|        assert(aEscapeChar == '=' || aEscapeChar == '%');
  212|  7.73k|    }
_ZN7KCodecs22QuotedPrintableEncoder13needsEncodingEh:
  117|  74.1M|    {
  118|  74.1M|        return ch > '~' || (ch < ' ' && ch != '\t') || ch == '=';
  ------------------
  |  Branch (118:16): [True: 59.8M, False: 14.2M]
  |  Branch (118:29): [True: 5.73M, False: 8.48M]
  |  Branch (118:41): [True: 5.72M, False: 5.52k]
  |  Branch (118:56): [True: 104k, False: 8.38M]
  ------------------
  119|  74.1M|    }
_ZN7KCodecs22QuotedPrintableEncoder18needsEncodingAtEOLEh:
  121|  33.6k|    {
  122|  33.6k|        return ch == ' ' || ch == '\t';
  ------------------
  |  Branch (122:16): [True: 2.69k, False: 30.9k]
  |  Branch (122:29): [True: 530, False: 30.4k]
  ------------------
  123|  33.6k|    }
_ZN7KCodecs22QuotedPrintableEncoder18needsEncodingAtBOLEh:
  125|  8.38M|    {
  126|  8.38M|        return ch == 'F' || ch == '.' || ch == '-';
  ------------------
  |  Branch (126:16): [True: 24.5k, False: 8.35M]
  |  Branch (126:29): [True: 2.39k, False: 8.35M]
  |  Branch (126:42): [True: 12.6k, False: 8.34M]
  ------------------
  127|  8.38M|    }
kcodecsqp.cpp:_ZN7KCodecsL8binToHexEh:
   42|   412M|{
   43|   412M|    if (value > 9) {
  ------------------
  |  Branch (43:9): [True: 363M, False: 49.1M]
  ------------------
   44|   363M|        return value + 'A' - 10;
   45|   363M|    } else {
   46|  49.1M|        return value + '0';
   47|  49.1M|    }
   48|   412M|}
kcodecsqp.cpp:_ZN7KCodecsL10highNibbleEh:
   55|   206M|{
   56|   206M|    return ch >> 4;
   57|   206M|}
kcodecsqp.cpp:_ZN7KCodecsL9lowNibbleEh:
   64|   206M|{
   65|   206M|    return ch & 0xF;
   66|   206M|}
_ZN7KCodecs23Rfc2047QEncodingEncoder13needsEncodingEh:
  221|   157M|    {
  222|   157M|        if (ch > 'z') {
  ------------------
  |  Branch (222:13): [True: 119M, False: 37.3M]
  ------------------
  223|   119M|            return true; // {|}~ DEL and 8bit chars need
  224|   119M|        }
  225|  37.3M|        if (!isEText(ch)) {
  ------------------
  |  Branch (225:13): [True: 20.8M, False: 16.4M]
  ------------------
  226|  20.8M|            return true; // all but a-zA-Z0-9!/*+- need, too
  227|  20.8M|        }
  228|  16.4M|        if (mEscapeChar == '%' && (ch == '*' || ch == '/')) {
  ------------------
  |  Branch (228:13): [True: 8.24M, False: 8.24M]
  |  Branch (228:36): [True: 79.1k, False: 8.16M]
  |  Branch (228:49): [True: 2.01k, False: 8.15M]
  ------------------
  229|  81.1k|            return true; // not allowed in rfc2231 encoding
  230|  81.1k|        }
  231|  16.3M|        return false;
  232|  16.4M|    }
_ZN7KCodecs23Rfc2047QEncodingEncoder7isETextEh:
  215|  37.3M|    {
  216|  37.3M|        return (ch < 128) && (eTextMap[ch / 8] & 0x80 >> ch % 8);
  ------------------
  |  Branch (216:16): [True: 37.3M, False: 0]
  |  Branch (216:30): [True: 16.4M, False: 20.8M]
  ------------------
  217|  37.3M|    }

_ZN7KCodecs21Rfc2047QEncodingCodecC2Ev:
  114|      1|        : Codec()
  115|      1|    {
  116|      1|    }
_ZN7KCodecs20QuotedPrintableCodecC2Ev:
   49|      1|        : Codec()
   50|      1|    {
   51|      1|    }
_ZN7KCodecs20Rfc2231EncodingCodecC2Ev:
  176|      1|        : Codec()
  177|      1|    {
  178|      1|    }
_ZNK7KCodecs20QuotedPrintableCodec4nameEv:
   65|  1.29k|    {
   66|  1.29k|        return "quoted-printable";
   67|  1.29k|    }
_ZNK7KCodecs20QuotedPrintableCodec17maxEncodedSizeForExNS_5Codec11NewlineTypeE:
   74|  3.86k|    {
   75|       |        // all chars encoded:
   76|  3.86k|        qsizetype result = 3 * insize;
   77|       |        // then after 25 hexchars comes a soft linebreak: =(\r)\n
   78|  3.86k|        result += (newline == Codec::NewlineCRLF ? 3 : 2) * (insize / 25);
  ------------------
  |  Branch (78:20): [True: 1.93k, False: 1.93k]
  ------------------
   79|       |
   80|  3.86k|        return result;
   81|  3.86k|    }
_ZNK7KCodecs21Rfc2047QEncodingCodec17maxEncodedSizeForExNS_5Codec11NewlineTypeE:
  139|  3.86k|    {
  140|  3.86k|        Q_UNUSED(newline);
  141|       |        // this one is simple: We don't do linebreaking, so all that can
  142|       |        // happen is that every char needs encoding, so:
  143|  3.86k|        return 3 * insize;
  144|  3.86k|    }
_ZNK7KCodecs20Rfc2231EncodingCodec17maxEncodedSizeForExNS_5Codec11NewlineTypeE:
  201|  3.86k|    {
  202|  3.86k|        Q_UNUSED(newline);
  203|       |        // same as for "q" encoding:
  204|  3.86k|        return 3 * insize;
  205|  3.86k|    }

_ZNK7KCodecs7UUCodec11makeEncoderENS_5Codec11NewlineTypeE:
   73|  3.86k|{
   74|  3.86k|    Q_UNUSED(newline)
   75|  3.86k|    return nullptr; // encoding not supported
   76|  3.86k|}
_ZNK7KCodecs7UUCodec11makeDecoderENS_5Codec11NewlineTypeE:
   79|  3.86k|{
   80|  3.86k|    return new UUDecoder(newline);
   81|  3.86k|}
_ZN7KCodecs9UUDecoder14searchForBeginERPKcS2_:
   88|  3.86k|{
   89|  3.86k|    static const char begin[] = "begin\n";
   90|  3.86k|    static const uint beginLength = 5; // sic!
   91|       |
   92|  3.86k|    assert(!mSawBegin || mIntoBeginLine > 0);
   93|       |
   94|  64.5M|    while (scursor != send) {
  ------------------
  |  Branch (94:12): [True: 64.5M, False: 3.38k]
  ------------------
   95|  64.5M|        uchar ch = *scursor++;
   96|  64.5M|        if (ch == begin[mIntoBeginLine]) {
  ------------------
  |  Branch (96:13): [True: 4.58k, False: 64.5M]
  ------------------
   97|  4.58k|            if (mIntoBeginLine < beginLength) {
  ------------------
  |  Branch (97:17): [True: 4.10k, False: 486]
  ------------------
   98|       |                // found another char
   99|  4.10k|                ++mIntoBeginLine;
  100|  4.10k|                if (mIntoBeginLine == beginLength) {
  ------------------
  |  Branch (100:21): [True: 518, False: 3.58k]
  ------------------
  101|    518|                    mSawBegin = true; // "begin" complete, now search the next \n...
  102|    518|                }
  103|  4.10k|            } else { // mIntoBeginLine == beginLength
  104|       |                // found '\n': begin line complete
  105|    486|                mLastWasCRLF = true;
  106|    486|                mIntoBeginLine = 0;
  107|    486|                return;
  108|    486|            }
  109|  64.5M|        } else if (mSawBegin) {
  ------------------
  |  Branch (109:20): [True: 1.03M, False: 63.5M]
  ------------------
  110|       |            // OK, skip stuff until the next \n
  111|  63.5M|        } else {
  112|       |            // qWarning() << "UUDecoder: garbage before \"begin\", resetting parser";
  113|  63.5M|            mIntoBeginLine = 0;
  114|  63.5M|        }
  115|  64.5M|    }
  116|  3.86k|}
_ZN7KCodecs9UUDecoder6decodeERPKcS2_RPcS2_:
  127|  3.86k|{
  128|       |    // First, check whether we still need to find the "begin" line:
  129|  3.86k|    if (!mSawBegin || mIntoBeginLine != 0) {
  ------------------
  |  Branch (129:9): [True: 3.86k, False: 0]
  |  Branch (129:23): [True: 0, False: 0]
  ------------------
  130|  3.86k|        searchForBegin(scursor, send);
  131|  3.86k|    } else if (mSawEnd) {
  ------------------
  |  Branch (131:16): [True: 0, False: 0]
  ------------------
  132|       |        // or if we are past the end line:
  133|      0|        scursor = send; // do nothing anymore...
  134|      0|        return true;
  135|      0|    }
  136|       |
  137|  13.3M|    while (dcursor != dend && scursor != send) {
  ------------------
  |  Branch (137:12): [True: 13.3M, False: 0]
  |  Branch (137:31): [True: 13.3M, False: 3.85k]
  ------------------
  138|  13.3M|        uchar ch = *scursor++;
  139|  13.3M|        uchar value;
  140|       |
  141|       |        // Check whether we need to look for the "end" line:
  142|  13.3M|        if (mIntoEndLine > 0) {
  ------------------
  |  Branch (142:13): [True: 13.9k, False: 13.3M]
  ------------------
  143|  13.9k|            static const char end[] = "end";
  144|  13.9k|            static const uint endLength = 3;
  145|       |
  146|  13.9k|            if (ch == end[mIntoEndLine]) {
  ------------------
  |  Branch (146:17): [True: 6.18k, False: 7.72k]
  ------------------
  147|  6.18k|                ++mIntoEndLine;
  148|  6.18k|                if (mIntoEndLine == endLength) {
  ------------------
  |  Branch (148:21): [True: 10, False: 6.17k]
  ------------------
  149|     10|                    mSawEnd = true;
  150|     10|                    scursor = send; // shortcut to the end
  151|     10|                    return true;
  152|     10|                }
  153|  6.17k|                continue;
  154|  7.72k|            } else {
  155|       |                // qWarning() << "UUDecoder: invalid line octet count looks like \"end\" (mIntoEndLine ="
  156|       |                //           << mIntoEndLine << ")!";
  157|  7.72k|                mIntoEndLine = 0;
  158|       |                // fall through...
  159|  7.72k|            }
  160|  13.9k|        }
  161|       |
  162|       |        // Normal parsing:
  163|       |
  164|       |        // The first char of a line is an encoding of the length of the
  165|       |        // current line. We simply ignore it:
  166|  13.3M|        if (mLastWasCRLF) {
  ------------------
  |  Branch (166:13): [True: 2.09M, False: 11.2M]
  ------------------
  167|       |            // reset char-per-line counter:
  168|  2.09M|            mLastWasCRLF = false;
  169|  2.09M|            mCurrentOctetCount = 0;
  170|       |
  171|       |            // try to decode the chars-on-this-line announcement:
  172|  2.09M|            if (ch == 'e') { // maybe the beginning of the "end"? ;-)
  ------------------
  |  Branch (172:17): [True: 7.75k, False: 2.08M]
  ------------------
  173|  7.75k|                mIntoEndLine = 1;
  174|  2.08M|            } else if (ch > 0x60) {
  ------------------
  |  Branch (174:24): [True: 3.58k, False: 2.08M]
  ------------------
  175|       |                // ### invalid line length char: what shall we do??
  176|  2.08M|            } else if (ch > ' ') {
  ------------------
  |  Branch (176:24): [True: 8.09k, False: 2.07M]
  ------------------
  177|  8.09k|                mAnnouncedOctetCount = uuDecode(ch);
  178|  2.07M|            } else if (ch == '\n') {
  ------------------
  |  Branch (178:24): [True: 60.4k, False: 2.01M]
  ------------------
  179|  60.4k|                mLastWasCRLF = true; // oops, empty line
  180|  60.4k|            }
  181|       |
  182|  2.09M|            continue;
  183|  2.09M|        }
  184|       |
  185|       |        // try converting ch to a 6-bit value:
  186|  11.2M|        if (ch > 0x60) {
  ------------------
  |  Branch (186:13): [True: 8.78M, False: 2.48M]
  ------------------
  187|  8.78M|            continue; // invalid char
  188|  8.78M|        } else if (ch > ' ') {
  ------------------
  |  Branch (188:20): [True: 253k, False: 2.23M]
  ------------------
  189|   253k|            value = uuDecode(ch);
  190|  2.23M|        } else if (ch == '\n') { // line end
  ------------------
  |  Branch (190:20): [True: 2.03M, False: 199k]
  ------------------
  191|  2.03M|            mLastWasCRLF = true;
  192|  2.03M|            continue;
  193|  2.03M|        } else {
  194|   199k|            continue;
  195|   199k|        }
  196|       |
  197|       |        // add the new bits to the output stream and flush full octets:
  198|   253k|        switch (mStepNo) {
  199|  63.5k|        case 0:
  ------------------
  |  Branch (199:9): [True: 63.5k, False: 190k]
  ------------------
  200|  63.5k|            mOutbits = value << 2;
  201|  63.5k|            break;
  202|  63.5k|        case 1:
  ------------------
  |  Branch (202:9): [True: 63.5k, False: 190k]
  ------------------
  203|  63.5k|            if (mCurrentOctetCount < mAnnouncedOctetCount) {
  ------------------
  |  Branch (203:17): [True: 19.7k, False: 43.7k]
  ------------------
  204|  19.7k|                *dcursor++ = (char)(mOutbits | value >> 4);
  205|  19.7k|            }
  206|  63.5k|            ++mCurrentOctetCount;
  207|  63.5k|            mOutbits = value << 4;
  208|  63.5k|            break;
  209|  63.4k|        case 2:
  ------------------
  |  Branch (209:9): [True: 63.4k, False: 190k]
  ------------------
  210|  63.4k|            if (mCurrentOctetCount < mAnnouncedOctetCount) {
  ------------------
  |  Branch (210:17): [True: 19.5k, False: 43.9k]
  ------------------
  211|  19.5k|                *dcursor++ = (char)(mOutbits | value >> 2);
  212|  19.5k|            }
  213|  63.4k|            ++mCurrentOctetCount;
  214|  63.4k|            mOutbits = value << 6;
  215|  63.4k|            break;
  216|  63.3k|        case 3:
  ------------------
  |  Branch (216:9): [True: 63.3k, False: 190k]
  ------------------
  217|  63.3k|            if (mCurrentOctetCount < mAnnouncedOctetCount) {
  ------------------
  |  Branch (217:17): [True: 19.3k, False: 44.0k]
  ------------------
  218|  19.3k|                *dcursor++ = (char)(mOutbits | value);
  219|  19.3k|            }
  220|  63.3k|            ++mCurrentOctetCount;
  221|  63.3k|            mOutbits = 0;
  222|  63.3k|            break;
  223|      0|        default:
  ------------------
  |  Branch (223:9): [True: 0, False: 253k]
  ------------------
  224|      0|            assert(0);
  225|   253k|        }
  226|   253k|        mStepNo = (mStepNo + 1) % 4;
  227|       |
  228|       |        // check whether we ran over the announced octet count for this line:
  229|   253k|        if (mCurrentOctetCount == mAnnouncedOctetCount + 1) {
  ------------------
  |  Branch (229:13): [True: 2.40k, False: 251k]
  ------------------
  230|       |            // qWarning()
  231|       |            //         << "UUDecoder: mismatch between announced ("
  232|       |            //         << mAnnouncedOctetCount << ") and actual line octet count!";
  233|  2.40k|        }
  234|   253k|    }
  235|       |
  236|       |    // return false when caller should call us again:
  237|  3.85k|    return scursor == send;
  238|  3.86k|} // UUDecoder::decode()
_ZN7KCodecs9UUDecoderC2ENS_5Codec11NewlineTypeE:
   44|  3.86k|        : Decoder(newline)
   45|  3.86k|        , mStepNo(0)
   46|  3.86k|        , mAnnouncedOctetCount(0)
   47|  3.86k|        , mCurrentOctetCount(0)
   48|  3.86k|        , mOutbits(0)
   49|  3.86k|        , mLastWasCRLF(true)
   50|  3.86k|        , mSawBegin(false)
   51|  3.86k|        , mIntoBeginLine(0)
   52|  3.86k|        , mSawEnd(false)
   53|  3.86k|        , mIntoEndLine(0)
   54|  3.86k|    {
   55|  3.86k|    }
kcodecsuuencode.cpp:_ZN7KCodecsL8uuDecodeEh:
  121|   262k|{
  122|   262k|    return (c - ' ') // undo shift and
  123|   262k|        & 0x3F; // map 0x40 (0x60-' ') to 0...
  124|   262k|}
_ZN7KCodecs9UUDecoder6finishERPcPKc:
   65|  3.86k|    {
   66|  3.86k|        Q_UNUSED(dcursor);
   67|  3.86k|        Q_UNUSED(dend);
   68|  3.86k|        return true;
   69|  3.86k|    }

_ZN7KCodecs7UUCodecC2Ev:
   39|      1|        : Codec()
   40|      1|    {
   41|      1|    }
_ZNK7KCodecs7UUCodec4nameEv:
   55|  7.73k|    {
   56|  7.73k|        return "x-uuencode";
   57|  7.73k|    }
_ZNK7KCodecs7UUCodec17maxEncodedSizeForExNS_5Codec11NewlineTypeE:
   64|  3.86k|    {
   65|  3.86k|        Q_UNUSED(newline);
   66|  3.86k|        return insize; // we have no encoder!
   67|  3.86k|    }
_ZNK7KCodecs7UUCodec17maxDecodedSizeForExNS_5Codec11NewlineTypeE:
   74|  3.86k|    {
   75|       |        // assuming all characters are part of the uuencode stream (which
   76|       |        // does almost never hold due to required linebreaking; but
   77|       |        // additional non-uu chars don't affect the output size), each
   78|       |        // 4-tupel of them becomes a 3-tupel in the decoded octet
   79|       |        // stream. So:
   80|  3.86k|        qsizetype result = ((insize + 3) / 4) * 3;
   81|       |        // but all of them may be \n, so
   82|  3.86k|        if (newline == Codec::NewlineCRLF) {
  ------------------
  |  Branch (82:13): [True: 1.93k, False: 1.93k]
  ------------------
   83|  1.93k|            result *= 2; // :-o
   84|  1.93k|        }
   85|  3.86k|        return result;
   86|  3.86k|    }

_ZN15kencodingprober24CharDistributionAnalysis13GetConfidenceEv:
   21|  1.29k|{
   22|       |    // if we didn't receive any character in our consideration range, return negative answer
   23|  1.29k|    if (mTotalChars == 0) {
  ------------------
  |  Branch (23:9): [True: 0, False: 1.29k]
  ------------------
   24|      0|        return SURE_NO;
  ------------------
  |  |   15|      0|#define SURE_NO 0.01f
  ------------------
   25|      0|    }
   26|       |
   27|  1.29k|    if (mTotalChars != mFreqChars) {
  ------------------
  |  Branch (27:9): [True: 1.22k, False: 70]
  ------------------
   28|  1.22k|        float r = mFreqChars / ((mTotalChars - mFreqChars) * mTypicalDistributionRatio);
   29|       |
   30|  1.22k|        if (r < SURE_YES) {
  ------------------
  |  |   14|  1.22k|#define SURE_YES 0.99f
  ------------------
  |  Branch (30:13): [True: 941, False: 288]
  ------------------
   31|    941|            return r;
   32|    941|        }
   33|  1.22k|    }
   34|       |    // normalize confidence, (we don't want to be 100% sure)
   35|    358|    return SURE_YES;
  ------------------
  |  |   14|    358|#define SURE_YES 0.99f
  ------------------
   36|  1.29k|}
_ZN15kencodingprober25EUCKRDistributionAnalysisC2Ev:
   39|  5.15k|{
   40|  5.15k|    mCharToFreqOrder = EUCKRCharToFreqOrder;
   41|  5.15k|    mTableSize = EUCKR_TABLE_SIZE;
  ------------------
  |  |   25|  5.15k|#define EUCKR_TABLE_SIZE  2352
  ------------------
   42|  5.15k|    mTypicalDistributionRatio = EUCKR_TYPICAL_DISTRIBUTION_RATIO;
  ------------------
  |  |   23|  5.15k|#define EUCKR_TYPICAL_DISTRIBUTION_RATIO (float) 6.0
  ------------------
   43|  5.15k|}
_ZN15kencodingprober26GB2312DistributionAnalysisC2Ev:
   46|  7.08k|{
   47|  7.08k|    mCharToFreqOrder = GB2312CharToFreqOrder;
   48|  7.08k|    mTableSize = GB2312_TABLE_SIZE;
  ------------------
  |  |   26|  7.08k|#define GB2312_TABLE_SIZE  3760
  ------------------
   49|  7.08k|    mTypicalDistributionRatio = GB2312_TYPICAL_DISTRIBUTION_RATIO;
  ------------------
  |  |   24|  7.08k|#define GB2312_TYPICAL_DISTRIBUTION_RATIO (float)0.9
  ------------------
   50|  7.08k|}
_ZN15kencodingprober24Big5DistributionAnalysisC2Ev:
   53|  7.08k|{
   54|  7.08k|    mCharToFreqOrder = Big5CharToFreqOrder;
   55|  7.08k|    mTableSize = BIG5_TABLE_SIZE;
  ------------------
  |  |   29|  7.08k|#define BIG5_TABLE_SIZE  5376
  ------------------
   56|  7.08k|    mTypicalDistributionRatio = BIG5_TYPICAL_DISTRIBUTION_RATIO;
  ------------------
  |  |   25|  7.08k|#define BIG5_TYPICAL_DISTRIBUTION_RATIO (float)0.75
  ------------------
   57|  7.08k|}
_ZN15kencodingprober24SJISDistributionAnalysisC2Ev:
   60|  7.08k|{
   61|  7.08k|    mCharToFreqOrder = JISCharToFreqOrder;
   62|  7.08k|    mTableSize = JIS_TABLE_SIZE;
  ------------------
  |  |   30|  7.08k|#define JIS_TABLE_SIZE  4368
  ------------------
   63|  7.08k|    mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO;
  ------------------
  |  |   26|  7.08k|#define JIS_TYPICAL_DISTRIBUTION_RATIO (float) 3.0
  ------------------
   64|  7.08k|}
_ZN15kencodingprober25EUCJPDistributionAnalysisC2Ev:
   67|  7.08k|{
   68|  7.08k|    mCharToFreqOrder = JISCharToFreqOrder;
   69|  7.08k|    mTableSize = JIS_TABLE_SIZE;
  ------------------
  |  |   30|  7.08k|#define JIS_TABLE_SIZE  4368
  ------------------
   70|  7.08k|    mTypicalDistributionRatio = JIS_TYPICAL_DISTRIBUTION_RATIO;
  ------------------
  |  |   26|  7.08k|#define JIS_TYPICAL_DISTRIBUTION_RATIO (float) 3.0
  ------------------
   71|  7.08k|}

_ZN15kencodingprober24CharDistributionAnalysisD2Ev:
   26|  33.4k|    {
   27|  33.4k|    }
_ZN15kencodingprober24CharDistributionAnalysisC2Ev:
   22|  33.4k|    {
   23|  33.4k|        Reset();
   24|  33.4k|    }
_ZN15kencodingprober24CharDistributionAnalysis13HandleOneCharEPKcj:
   36|   180M|    {
   37|   180M|        int order;
   38|       |
   39|       |        // we only care about 2-bytes character in our distribution analysis
   40|   180M|        order = (aCharLen == 2) ? GetOrder(aStr) : -1;
  ------------------
  |  Branch (40:17): [True: 97.5M, False: 82.5M]
  ------------------
   41|       |
   42|   180M|        if (order >= 0) {
  ------------------
  |  Branch (42:13): [True: 97.3M, False: 82.7M]
  ------------------
   43|  97.3M|            mTotalChars++;
   44|       |            // order is valid
   45|  97.3M|            if ((unsigned int)order < mTableSize) {
  ------------------
  |  Branch (45:17): [True: 96.9M, False: 344k]
  ------------------
   46|  96.9M|                if (512 > mCharToFreqOrder[order]) {
  ------------------
  |  Branch (46:21): [True: 418k, False: 96.5M]
  ------------------
   47|   418k|                    mFreqChars++;
   48|   418k|                }
   49|  96.9M|            }
   50|  97.3M|        }
   51|   180M|    }
_ZN15kencodingprober24CharDistributionAnalysis5ResetEv:
   58|  90.8k|    {
   59|  90.8k|        mDone = false;
   60|  90.8k|        mTotalChars = 0;
   61|  90.8k|        mFreqChars = 0;
   62|  90.8k|    }
_ZN15kencodingprober24CharDistributionAnalysis13GotEnoughDataEv:
   73|  11.6k|    {
   74|  11.6k|        return mTotalChars > ENOUGH_DATA_THRESHOLD;
  ------------------
  |  |   14|  11.6k|#define ENOUGH_DATA_THRESHOLD 256
  ------------------
   75|  11.6k|    }
_ZN15kencodingprober25EUCKRDistributionAnalysis8GetOrderEPKc:
  117|  14.9M|    {
  118|  14.9M|        if ((unsigned char)*str >= (unsigned char)0xb0) {
  ------------------
  |  Branch (118:13): [True: 14.8M, False: 40.8k]
  ------------------
  119|  14.8M|            return 94 * ((unsigned char)str[0] - (unsigned char)0xb0) + (unsigned char)str[1] - (unsigned char)0xa1;
  120|  14.8M|        } else {
  121|  40.8k|            return -1;
  122|  40.8k|        }
  123|  14.9M|    }
_ZN15kencodingprober26GB2312DistributionAnalysis8GetOrderEPKc:
  137|  31.8M|    {
  138|  31.8M|        if ((unsigned char)*str >= (unsigned char)0xb0 && (unsigned char)str[1] >= (unsigned char)0xa1) {
  ------------------
  |  Branch (138:13): [True: 31.7M, False: 149k]
  |  Branch (138:59): [True: 31.7M, False: 5.70k]
  ------------------
  139|  31.7M|            return 94 * ((unsigned char)str[0] - (unsigned char)0xb0) + (unsigned char)str[1] - (unsigned char)0xa1;
  140|  31.7M|        } else {
  141|   155k|            return -1;
  142|   155k|        }
  143|  31.8M|    }
_ZN15kencodingprober24Big5DistributionAnalysis8GetOrderEPKc:
  157|  29.8M|    {
  158|  29.8M|        if ((unsigned char)*str >= (unsigned char)0xa4)
  ------------------
  |  Branch (158:13): [True: 29.8M, False: 700]
  ------------------
  159|  29.8M|            if ((unsigned char)str[1] >= (unsigned char)0xa1) {
  ------------------
  |  Branch (159:17): [True: 29.8M, False: 2.14k]
  ------------------
  160|  29.8M|                return 157 * ((unsigned char)str[0] - (unsigned char)0xa4) + (unsigned char)str[1] - (unsigned char)0xa1 + 63;
  161|  29.8M|            } else {
  162|  2.14k|                return 157 * ((unsigned char)str[0] - (unsigned char)0xa4) + (unsigned char)str[1] - (unsigned char)0x40;
  163|  2.14k|            }
  164|    700|        else {
  165|    700|            return -1;
  166|    700|        }
  167|  29.8M|    }
_ZN15kencodingprober24SJISDistributionAnalysis8GetOrderEPKc:
  181|   286k|    {
  182|   286k|        int order;
  183|   286k|        if ((unsigned char)*str >= (unsigned char)0x81 && (unsigned char)*str <= (unsigned char)0x9f) {
  ------------------
  |  Branch (183:13): [True: 284k, False: 1.93k]
  |  Branch (183:59): [True: 205k, False: 79.2k]
  ------------------
  184|   205k|            order = 188 * ((unsigned char)str[0] - (unsigned char)0x81);
  185|   205k|        } else if ((unsigned char)*str >= (unsigned char)0xe0 && (unsigned char)*str <= (unsigned char)0xef) {
  ------------------
  |  Branch (185:20): [True: 79.2k, False: 1.93k]
  |  Branch (185:66): [True: 79.2k, False: 0]
  ------------------
  186|  79.2k|            order = 188 * ((unsigned char)str[0] - (unsigned char)0xe0 + 31);
  187|  79.2k|        } else {
  188|  1.93k|            return -1;
  189|  1.93k|        }
  190|   284k|        order += (unsigned char)*(str + 1) - 0x40;
  191|   284k|        if ((unsigned char)str[1] > (unsigned char)0x7f) {
  ------------------
  |  Branch (191:13): [True: 282k, False: 1.78k]
  ------------------
  192|   282k|            order--;
  193|   282k|        }
  194|   284k|        return order;
  195|   286k|    }
_ZN15kencodingprober25EUCJPDistributionAnalysis8GetOrderEPKc:
  209|  20.5M|    {
  210|  20.5M|        if ((unsigned char)*str >= (unsigned char)0xa0) {
  ------------------
  |  Branch (210:13): [True: 20.5M, False: 907]
  ------------------
  211|  20.5M|            return 94 * ((unsigned char)str[0] - (unsigned char)0xa1) + (unsigned char)str[1] - (unsigned char)0xa1;
  212|  20.5M|        } else {
  213|    907|            return -1;
  214|    907|        }
  215|  20.5M|    }

_ZN15kencodingprober18ChineseGroupProberC2Ev:
   28|  1.93k|{
   29|  1.93k|    mProbers[0] = new UnicodeGroupProber();
   30|  1.93k|    mProbers[1] = new nsGB18030Prober();
   31|  1.93k|    mProbers[2] = new nsBig5Prober();
   32|  1.93k|    Reset();
   33|  1.93k|}
_ZN15kencodingprober18ChineseGroupProberD2Ev:
   36|  1.93k|{
   37|  7.73k|    for (unsigned int i = 0; i < CN_NUM_OF_PROBERS; i++) {
  ------------------
  |  |   12|  7.73k|#define CN_NUM_OF_PROBERS 3
  ------------------
  |  Branch (37:30): [True: 5.79k, False: 1.93k]
  ------------------
   38|  5.79k|        delete mProbers[i];
   39|  5.79k|    }
   40|  1.93k|}
_ZN15kencodingprober18ChineseGroupProber5ResetEv:
   54|  1.93k|{
   55|  1.93k|    mActiveNum = 0;
   56|  7.73k|    for (unsigned int i = 0; i < CN_NUM_OF_PROBERS; i++) {
  ------------------
  |  |   12|  7.73k|#define CN_NUM_OF_PROBERS 3
  ------------------
  |  Branch (56:30): [True: 5.79k, False: 1.93k]
  ------------------
   57|  5.79k|        if (mProbers[i]) {
  ------------------
  |  Branch (57:13): [True: 5.79k, False: 0]
  ------------------
   58|  5.79k|            mProbers[i]->Reset();
   59|  5.79k|            mIsActive[i] = true;
   60|  5.79k|            ++mActiveNum;
   61|  5.79k|        } else {
   62|      0|            mIsActive[i] = false;
   63|      0|        }
   64|  5.79k|    }
   65|  1.93k|    mBestGuess = -1;
   66|  1.93k|    mState = eDetecting;
   67|  1.93k|}
_ZN15kencodingprober18ChineseGroupProber10HandleDataEPKcj:
   70|  1.93k|{
   71|  1.93k|    nsProbingState st;
   72|  1.93k|    unsigned int i;
   73|       |
   74|       |    // do filtering to reduce load to probers
   75|  1.93k|    char *highbyteBuf;
   76|  1.93k|    char *hptr;
   77|  1.93k|    bool keepNext = true; // assume previous is not ascii, it will do no harm except add some noise
   78|  1.93k|    hptr = highbyteBuf = (char *)malloc(aLen);
   79|  1.93k|    if (!hptr) {
  ------------------
  |  Branch (79:9): [True: 0, False: 1.93k]
  ------------------
   80|      0|        return mState;
   81|      0|    }
   82|  39.2M|    for (i = 0; i < aLen; ++i) {
  ------------------
  |  Branch (82:17): [True: 39.2M, False: 1.93k]
  ------------------
   83|  39.2M|        if (aBuf[i] & 0x80) {
  ------------------
  |  Branch (83:13): [True: 29.9M, False: 9.33M]
  ------------------
   84|  29.9M|            *hptr++ = aBuf[i];
   85|  29.9M|            keepNext = true;
   86|  29.9M|        } else {
   87|       |            // if previous is highbyte, keep this even it is an ASCII
   88|  9.33M|            if (keepNext) {
  ------------------
  |  Branch (88:17): [True: 1.62M, False: 7.71M]
  ------------------
   89|  1.62M|                *hptr++ = aBuf[i];
   90|  1.62M|                keepNext = false;
   91|  1.62M|            }
   92|  9.33M|        }
   93|  39.2M|    }
   94|       |
   95|  7.50k|    for (i = 0; i < CN_NUM_OF_PROBERS; ++i) {
  ------------------
  |  |   12|  7.50k|#define CN_NUM_OF_PROBERS 3
  ------------------
  |  Branch (95:17): [True: 5.76k, False: 1.73k]
  ------------------
   96|  5.76k|        if (!mIsActive[i]) {
  ------------------
  |  Branch (96:13): [True: 0, False: 5.76k]
  ------------------
   97|      0|            continue;
   98|      0|        }
   99|  5.76k|        st = mProbers[i]->HandleData(highbyteBuf, hptr - highbyteBuf);
  100|  5.76k|        if (st == eFoundIt) {
  ------------------
  |  Branch (100:13): [True: 61, False: 5.70k]
  ------------------
  101|     61|            mBestGuess = i;
  102|     61|            mState = eFoundIt;
  103|     61|            break;
  104|  5.70k|        } else if (st == eNotMe) {
  ------------------
  |  Branch (104:20): [True: 1.87k, False: 3.82k]
  ------------------
  105|  1.87k|            mIsActive[i] = false;
  106|  1.87k|            --mActiveNum;
  107|  1.87k|            if (mActiveNum == 0) {
  ------------------
  |  Branch (107:17): [True: 133, False: 1.74k]
  ------------------
  108|    133|                mState = eNotMe;
  109|    133|                break;
  110|    133|            }
  111|  1.87k|        }
  112|  5.76k|    }
  113|       |
  114|  1.93k|    free(highbyteBuf);
  115|       |
  116|  1.93k|    return mState;
  117|  1.93k|}

_ZN15kencodingprober19JapaneseGroupProberC2Ev:
   24|  1.93k|{
   25|  1.93k|    mProbers[0] = new UnicodeGroupProber();
   26|  1.93k|    mProbers[1] = new nsSJISProber();
   27|  1.93k|    mProbers[2] = new nsEUCJPProber();
   28|  1.93k|    Reset();
   29|  1.93k|}
_ZN15kencodingprober19JapaneseGroupProberD2Ev:
   32|  1.93k|{
   33|  7.73k|    for (unsigned int i = 0; i < JP_NUM_OF_PROBERS; i++) {
  ------------------
  |  |   15|  7.73k|#define JP_NUM_OF_PROBERS 3
  ------------------
  |  Branch (33:30): [True: 5.79k, False: 1.93k]
  ------------------
   34|  5.79k|        delete mProbers[i];
   35|  5.79k|    }
   36|  1.93k|}
_ZN15kencodingprober19JapaneseGroupProber5ResetEv:
   50|  1.93k|{
   51|  1.93k|    mActiveNum = 0;
   52|  7.73k|    for (unsigned int i = 0; i < JP_NUM_OF_PROBERS; i++) {
  ------------------
  |  |   15|  7.73k|#define JP_NUM_OF_PROBERS 3
  ------------------
  |  Branch (52:30): [True: 5.79k, False: 1.93k]
  ------------------
   53|  5.79k|        if (mProbers[i]) {
  ------------------
  |  Branch (53:13): [True: 5.79k, False: 0]
  ------------------
   54|  5.79k|            mProbers[i]->Reset();
   55|  5.79k|            mIsActive[i] = true;
   56|  5.79k|            ++mActiveNum;
   57|  5.79k|        } else {
   58|      0|            mIsActive[i] = false;
   59|      0|        }
   60|  5.79k|    }
   61|  1.93k|    mBestGuess = -1;
   62|  1.93k|    mState = eDetecting;
   63|  1.93k|}
_ZN15kencodingprober19JapaneseGroupProber10HandleDataEPKcj:
   66|  1.93k|{
   67|  1.93k|    nsProbingState st;
   68|  1.93k|    unsigned int i;
   69|       |
   70|       |    // do filtering to reduce load to probers
   71|  1.93k|    char *highbyteBuf;
   72|  1.93k|    char *hptr;
   73|  1.93k|    bool keepNext = true; // assume previous is not ascii, it will do no harm except add some noise
   74|  1.93k|    hptr = highbyteBuf = (char *)malloc(aLen);
   75|  1.93k|    if (!hptr) {
  ------------------
  |  Branch (75:9): [True: 0, False: 1.93k]
  ------------------
   76|      0|        return mState;
   77|      0|    }
   78|  39.2M|    for (i = 0; i < aLen; ++i) {
  ------------------
  |  Branch (78:17): [True: 39.2M, False: 1.93k]
  ------------------
   79|  39.2M|        if (aBuf[i] & 0x80) {
  ------------------
  |  Branch (79:13): [True: 29.9M, False: 9.33M]
  ------------------
   80|  29.9M|            *hptr++ = aBuf[i];
   81|  29.9M|            keepNext = true;
   82|  29.9M|        } else {
   83|       |            // if previous is highbyte, keep this even it is a ASCII
   84|  9.33M|            if (keepNext) {
  ------------------
  |  Branch (84:17): [True: 1.62M, False: 7.71M]
  ------------------
   85|  1.62M|                *hptr++ = aBuf[i];
   86|  1.62M|                keepNext = false;
   87|  1.62M|            }
   88|  9.33M|        }
   89|  39.2M|    }
   90|       |
   91|  7.46k|    for (i = 0; i < JP_NUM_OF_PROBERS; ++i) {
  ------------------
  |  |   15|  7.46k|#define JP_NUM_OF_PROBERS 3
  ------------------
  |  Branch (91:17): [True: 5.75k, False: 1.71k]
  ------------------
   92|  5.75k|        if (!mIsActive[i]) {
  ------------------
  |  Branch (92:13): [True: 0, False: 5.75k]
  ------------------
   93|      0|            continue;
   94|      0|        }
   95|  5.75k|        st = mProbers[i]->HandleData(highbyteBuf, hptr - highbyteBuf);
   96|  5.75k|        if (st == eFoundIt) {
  ------------------
  |  Branch (96:13): [True: 86, False: 5.67k]
  ------------------
   97|     86|            mBestGuess = i;
   98|     86|            mState = eFoundIt;
   99|     86|            break;
  100|  5.67k|        } else if (st == eNotMe) {
  ------------------
  |  Branch (100:20): [True: 2.10k, False: 3.56k]
  ------------------
  101|  2.10k|            mIsActive[i] = false;
  102|  2.10k|            --mActiveNum;
  103|  2.10k|            if (mActiveNum == 0) {
  ------------------
  |  Branch (103:17): [True: 137, False: 1.96k]
  ------------------
  104|    137|                mState = eNotMe;
  105|    137|                break;
  106|    137|            }
  107|  2.10k|        }
  108|  5.75k|    }
  109|       |
  110|  1.93k|    free(highbyteBuf);
  111|       |
  112|  1.93k|    return mState;
  113|  1.93k|}

_ZN15kencodingprober23JapaneseContextAnalysis5ResetEv:
  385|  38.6k|{
  386|  38.6k|    mTotalRel = 0;
  387|   270k|    for (unsigned int i = 0; i < NUM_OF_CATEGORY; i++) {
  ------------------
  |  |   14|   270k|#define NUM_OF_CATEGORY 6
  ------------------
  |  Branch (387:30): [True: 231k, False: 38.6k]
  ------------------
  388|   231k|        mRelSample[i] = 0;
  389|   231k|    }
  390|  38.6k|    mNeedToSkipCharNum = 0;
  391|  38.6k|    mLastCharOrder = -1;
  392|  38.6k|    mDone = false;
  393|  38.6k|}
_ZN15kencodingprober23JapaneseContextAnalysis13GetConfidenceEv:
  397|    357|{
  398|       |    // This is just one way to calculate confidence. It works well for me.
  399|    357|    if (mTotalRel > MINIMUM_DATA_THRESHOLD) {
  ------------------
  |  |  347|    357|#define MINIMUM_DATA_THRESHOLD 4
  ------------------
  |  Branch (399:9): [True: 357, False: 0]
  ------------------
  400|    357|        return ((float)(mTotalRel - mRelSample[0])) / mTotalRel;
  401|    357|    } else {
  402|      0|        return (float)DONT_KNOW;
  ------------------
  |  |  394|      0|#define DONT_KNOW (float)-1
  ------------------
  403|      0|    }
  404|    357|}

_ZN15kencodingprober23JapaneseContextAnalysisC2Ev:
   27|  14.1k|    {
   28|  14.1k|        Reset();
   29|  14.1k|    }
_ZN15kencodingprober23JapaneseContextAnalysisD2Ev:
   31|  14.1k|    {
   32|  14.1k|    }
_ZN15kencodingprober23JapaneseContextAnalysis13HandleOneCharEPKcj:
   37|  93.6M|    {
   38|  93.6M|        int order;
   39|       |
   40|       |        // if we received enough data, stop here
   41|  93.6M|        if (mTotalRel > MAX_REL_THRESHOLD) {
  ------------------
  |  |   17|  93.6M|#define MAX_REL_THRESHOLD 1000
  ------------------
  |  Branch (41:13): [True: 143k, False: 93.5M]
  ------------------
   42|   143k|            mDone = true;
   43|   143k|        }
   44|  93.6M|        if (mDone) {
  ------------------
  |  Branch (44:13): [True: 143k, False: 93.5M]
  ------------------
   45|   143k|            return;
   46|   143k|        }
   47|       |
   48|       |        // Only 2-bytes characters are of our interest
   49|  93.5M|        order = (aCharLen == 2) ? GetOrder(aStr) : -1;
  ------------------
  |  Branch (49:17): [True: 20.6M, False: 72.8M]
  ------------------
   50|  93.5M|        if (order != -1 && mLastCharOrder != -1) {
  ------------------
  |  Branch (50:13): [True: 199k, False: 93.3M]
  |  Branch (50:28): [True: 196k, False: 3.75k]
  ------------------
   51|   196k|            mTotalRel++;
   52|       |            // count this sequence to its category counter
   53|   196k|            mRelSample[(int)jp2CharContext[mLastCharOrder][order]]++;
   54|   196k|        }
   55|  93.5M|        mLastCharOrder = order;
   56|  93.5M|    }
_ZN15kencodingprober23JapaneseContextAnalysis13GotEnoughDataEv:
   64|  8.58k|    {
   65|  8.58k|        return mTotalRel > ENOUGH_REL_THRESHOLD;
  ------------------
  |  |   16|  8.58k|#define ENOUGH_REL_THRESHOLD 100
  ------------------
   66|  8.58k|    }
_ZN15kencodingprober19SJISContextAnalysis8GetOrderEPKc:
   96|   155k|    {
   97|       |        // We only interested in Hiragana, so first byte is '\202'
   98|   155k|        if (*str == '\202' && (unsigned char)*(str + 1) >= (unsigned char)0x9f && (unsigned char)*(str + 1) <= (unsigned char)0xf1) {
  ------------------
  |  Branch (98:13): [True: 96.7k, False: 58.5k]
  |  Branch (98:31): [True: 95.1k, False: 1.58k]
  |  Branch (98:83): [True: 93.9k, False: 1.20k]
  ------------------
   99|  93.9k|            return (unsigned char)*(str + 1) - (unsigned char)0x9f;
  100|  93.9k|        }
  101|  61.3k|        return -1;
  102|   155k|    }
_ZN15kencodingprober20EUCJPContextAnalysis8GetOrderEPKc:
  111|  20.4M|    {
  112|  20.4M|        if (*str == '\244' //
  ------------------
  |  Branch (112:13): [True: 106k, False: 20.3M]
  ------------------
  113|  20.4M|            && (unsigned char)*(str + 1) >= (unsigned char)0xa1 //
  ------------------
  |  Branch (113:16): [True: 106k, False: 0]
  ------------------
  114|  20.4M|            && (unsigned char)*(str + 1) <= (unsigned char)0xf3) {
  ------------------
  |  Branch (114:16): [True: 106k, False: 958]
  ------------------
  115|   106k|            return (unsigned char)*(str + 1) - (unsigned char)0xa1;
  116|   106k|        }
  117|  20.3M|        return -1;
  118|  20.4M|    }

_ZN15kencodingprober18UnicodeGroupProberC2Ev:
   15|  12.2k|{
   16|  12.2k|    mCodingSM[0] = new nsCodingStateMachine(&UTF8SMModel);
   17|  12.2k|    mCodingSM[1] = new nsCodingStateMachine(&UCS2LESMModel);
   18|  12.2k|    mCodingSM[2] = new nsCodingStateMachine(&UCS2BESMModel);
   19|  12.2k|    mActiveSM = NUM_OF_UNICODE_CHARSETS;
  ------------------
  |  |   13|  12.2k|#define NUM_OF_UNICODE_CHARSETS 3
  ------------------
   20|  12.2k|    mState = eDetecting;
   21|  12.2k|    mDetectedCharset = "UTF-8";
   22|  12.2k|}
_ZN15kencodingprober18UnicodeGroupProberD2Ev:
   25|  12.2k|{
   26|  48.9k|    for (unsigned int i = 0; i < NUM_OF_UNICODE_CHARSETS; i++) {
  ------------------
  |  |   13|  48.9k|#define NUM_OF_UNICODE_CHARSETS 3
  ------------------
  |  Branch (26:30): [True: 36.7k, False: 12.2k]
  ------------------
   27|  36.7k|        delete mCodingSM[i];
   28|  36.7k|    }
   29|  12.2k|}
_ZN15kencodingprober18UnicodeGroupProber5ResetEv:
   32|  10.3k|{
   33|  10.3k|    mState = eDetecting;
   34|  41.2k|    for (unsigned int i = 0; i < NUM_OF_UNICODE_CHARSETS; i++) {
  ------------------
  |  |   13|  41.2k|#define NUM_OF_UNICODE_CHARSETS 3
  ------------------
  |  Branch (34:30): [True: 30.9k, False: 10.3k]
  ------------------
   35|  30.9k|        mCodingSM[i]->Reset();
   36|  30.9k|    }
   37|  10.3k|    mActiveSM = NUM_OF_UNICODE_CHARSETS;
  ------------------
  |  |   13|  10.3k|#define NUM_OF_UNICODE_CHARSETS 3
  ------------------
   38|  10.3k|    mDetectedCharset = "UTF-8";
   39|  10.3k|}
_ZN15kencodingprober18UnicodeGroupProber10HandleDataEPKcj:
   42|  11.4k|{
   43|  11.4k|    nsSMState codingState;
   44|  11.4k|    static bool disableUTF16LE = false;
   45|  11.4k|    static bool disableUTF16BE = false;
   46|       |
   47|  11.4k|    if (mActiveSM == 0 || aLen < 2) {
  ------------------
  |  Branch (47:9): [True: 0, False: 11.4k]
  |  Branch (47:27): [True: 2.25k, False: 9.23k]
  ------------------
   48|  2.25k|        mState = eNotMe;
   49|  2.25k|        return mState;
   50|  2.25k|    }
   51|       |
   52|  9.23k|    if (!(disableUTF16LE || disableUTF16BE)) {
  ------------------
  |  Branch (52:11): [True: 9.23k, False: 1]
  |  Branch (52:29): [True: 0, False: 1]
  ------------------
   53|      1|        if (aLen % 2 != 0) {
  ------------------
  |  Branch (53:13): [True: 0, False: 1]
  ------------------
   54|      0|            disableUTF16LE = true;
   55|      0|            disableUTF16BE = true;
   56|      0|        }
   57|      1|        const uint weight_BOM = sqrt((double)aLen) + aLen / 10.0;
   58|      1|        uint counts[5] = {0, 0, 0, 0, 0};
   59|      6|        for (uint i = 0; i < 5; i++) {
  ------------------
  |  Branch (59:26): [True: 5, False: 1]
  ------------------
   60|      5|            counts[i] = std::count(aBuf, aBuf + aLen, char(i));
   61|      5|        }
   62|      1|        const double weight_zero = (2.0 * (counts[0] + counts[1] + counts[2] + counts[3] + counts[4]) + weight_BOM) / aLen;
   63|      1|        if (weight_zero < log(1.4142)) {
  ------------------
  |  Branch (63:13): [True: 0, False: 1]
  ------------------
   64|      0|            disableUTF16LE = true;
   65|      0|            disableUTF16BE = true;
   66|      0|        }
   67|      1|        if (4 >= aBuf[1] && aBuf[1] >= 0 && QChar::isPrint(static_cast<uint>(aBuf[0]))) {
  ------------------
  |  Branch (67:13): [True: 1, False: 0]
  |  Branch (67:29): [True: 0, False: 1]
  |  Branch (67:45): [True: 0, False: 0]
  ------------------
   68|      0|            disableUTF16BE = true;
   69|      1|        } else {
   70|      1|            disableUTF16LE = true;
   71|      1|        }
   72|      1|        if (disableUTF16BE) {
  ------------------
  |  Branch (72:13): [True: 0, False: 1]
  ------------------
   73|      0|            mActiveSM--;
   74|      0|        }
   75|      1|        if (disableUTF16LE) {
  ------------------
  |  Branch (75:13): [True: 1, False: 0]
  ------------------
   76|      1|            nsCodingStateMachine *t;
   77|      1|            t = mCodingSM[1];
   78|      1|            mCodingSM[1] = mCodingSM[2];
   79|      1|            mCodingSM[2] = t;
   80|      1|            mActiveSM--;
   81|      1|        }
   82|      1|    }
   83|       |
   84|   163M|    for (uint i = 0; i < aLen; ++i) {
  ------------------
  |  Branch (84:22): [True: 163M, False: 8.28k]
  ------------------
   85|   481M|        for (int j = mActiveSM - 1; j >= 0; --j) {
  ------------------
  |  Branch (85:37): [True: 317M, False: 163M]
  ------------------
   86|       |            // byte is feed to all active state machine
   87|   317M|            codingState = mCodingSM[j]->NextState(aBuf[i]);
   88|   317M|            if (codingState == eError) {
  ------------------
  |  Branch (88:17): [True: 10.7k, False: 317M]
  ------------------
   89|       |                // got negative answer for this state machine, make it inactive
   90|  10.7k|                mActiveSM--;
   91|  10.7k|                if (mActiveSM == 0) {
  ------------------
  |  Branch (91:21): [True: 917, False: 9.83k]
  ------------------
   92|    917|                    mState = eNotMe;
   93|    917|                    return mState;
   94|  9.83k|                } else if (j != (int)mActiveSM) {
  ------------------
  |  Branch (94:28): [True: 8.65k, False: 1.18k]
  ------------------
   95|  8.65k|                    nsCodingStateMachine *t;
   96|  8.65k|                    t = mCodingSM[mActiveSM];
   97|  8.65k|                    mCodingSM[mActiveSM] = mCodingSM[j];
   98|  8.65k|                    mCodingSM[j] = t;
   99|  8.65k|                }
  100|   317M|            } else if (codingState == eItsMe) {
  ------------------
  |  Branch (100:24): [True: 34, False: 317M]
  ------------------
  101|     34|                mState = eFoundIt;
  102|     34|                mDetectedCharset = mCodingSM[j]->GetCodingStateMachine();
  103|     34|                return mState;
  104|   317M|            } else if (mState == eDetecting) {
  ------------------
  |  Branch (104:24): [True: 317M, False: 0]
  ------------------
  105|   317M|                mDetectedCharset = mCodingSM[j]->GetCodingStateMachine();
  106|   317M|            };
  107|   317M|        }
  108|   163M|    }
  109|  8.28k|    return mState;
  110|  9.23k|}

_ZN15kencodingprober18UnicodeGroupProber14GetCharSetNameEv:
   23|     11|    {
   24|     11|        return mDetectedCharset;
   25|     11|    }

_ZN15kencodingprober12nsBig5Prober5ResetEv:
   12|  12.2k|{
   13|  12.2k|    mCodingSM->Reset();
   14|  12.2k|    mState = eDetecting;
   15|  12.2k|    mDistributionAnalyser.Reset();
   16|  12.2k|}
_ZN15kencodingprober12nsBig5Prober10HandleDataEPKcj:
   19|  6.83k|{
   20|  6.83k|    if (aLen == 0) {
  ------------------
  |  Branch (20:9): [True: 0, False: 6.83k]
  ------------------
   21|      0|        return mState;
   22|      0|    }
   23|       |
   24|  63.0M|    for (unsigned int i = 0; i < aLen; i++) {
  ------------------
  |  Branch (24:30): [True: 63.0M, False: 4.01k]
  ------------------
   25|  63.0M|        const nsSMState codingState = mCodingSM->NextState(aBuf[i]);
   26|  63.0M|        if (codingState == eError) {
  ------------------
  |  Branch (26:13): [True: 2.81k, False: 63.0M]
  ------------------
   27|  2.81k|            mState = eNotMe;
   28|  2.81k|            break;
   29|  2.81k|        }
   30|  63.0M|        if (codingState == eItsMe) {
  ------------------
  |  Branch (30:13): [True: 0, False: 63.0M]
  ------------------
   31|      0|            mState = eFoundIt;
   32|      0|            break;
   33|      0|        }
   34|  63.0M|        if (codingState == eStart) {
  ------------------
  |  Branch (34:13): [True: 33.1M, False: 29.8M]
  ------------------
   35|  33.1M|            unsigned int charLen = mCodingSM->GetCurrentCharLen();
   36|       |
   37|  33.1M|            if (i == 0) {
  ------------------
  |  Branch (37:17): [True: 3.19k, False: 33.1M]
  ------------------
   38|  3.19k|                mLastChar[1] = aBuf[0];
   39|  3.19k|                mDistributionAnalyser.HandleOneChar(mLastChar, charLen);
   40|  33.1M|            } else {
   41|  33.1M|                mDistributionAnalyser.HandleOneChar(aBuf + i - 1, charLen);
   42|  33.1M|            }
   43|  33.1M|        }
   44|  63.0M|    }
   45|       |
   46|  6.83k|    mLastChar[0] = aBuf[aLen - 1];
   47|       |
   48|  6.83k|    if (mState == eDetecting) {
  ------------------
  |  Branch (48:9): [True: 4.01k, False: 2.81k]
  ------------------
   49|  4.01k|        if (mDistributionAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) {
  ------------------
  |  |   20|    392|#define SHORTCUT_THRESHOLD (float)0.95
  ------------------
  |  Branch (49:13): [True: 392, False: 3.62k]
  |  Branch (49:54): [True: 61, False: 331]
  ------------------
   50|     61|            mState = eFoundIt;
   51|     61|        }
   52|  4.01k|    }
   53|       |
   54|  6.83k|    return mState;
   55|  6.83k|}
_ZN15kencodingprober12nsBig5Prober13GetConfidenceEv:
   58|    392|{
   59|    392|    float distribCf = mDistributionAnalyser.GetConfidence();
   60|       |
   61|    392|    return (float)distribCf;
   62|    392|}

_ZN15kencodingprober12nsBig5ProberC2Ev:
   19|  7.08k|    {
   20|  7.08k|        mCodingSM = new nsCodingStateMachine(&Big5SMModel);
   21|  7.08k|        Reset();
   22|  7.08k|    }
_ZN15kencodingprober12nsBig5ProberD2Ev:
   24|  7.08k|    {
   25|  7.08k|        delete mCodingSM;
   26|  7.08k|    }
_ZN15kencodingprober12nsBig5Prober14GetCharSetNameEv:
   29|      4|    {
   30|      4|        return "Big5";
   31|      4|    }

_ZN15kencodingprober15nsCharSetProber27FilterWithoutEnglishLettersEPKcjPPcRj:
   15|  3.22k|{
   16|  3.22k|    char *newptr;
   17|  3.22k|    char *prevPtr;
   18|  3.22k|    char *curPtr;
   19|       |
   20|  3.22k|    bool meetMSB = false;
   21|  3.22k|    newptr = *newBuf = (char *)malloc(aLen);
   22|  3.22k|    if (!newptr) {
  ------------------
  |  Branch (22:9): [True: 0, False: 3.22k]
  ------------------
   23|      0|        return false;
   24|      0|    }
   25|       |
   26|  75.4M|    for (curPtr = prevPtr = (char *)aBuf; curPtr < aBuf + aLen; ++curPtr) {
  ------------------
  |  Branch (26:43): [True: 75.4M, False: 3.22k]
  ------------------
   27|  75.4M|        if (*curPtr & 0x80) {
  ------------------
  |  Branch (27:13): [True: 59.8M, False: 15.5M]
  ------------------
   28|  59.8M|            meetMSB = true;
   29|  59.8M|        } else if (*curPtr < 'A' || (*curPtr > 'Z' && *curPtr < 'a') || *curPtr > 'z') {
  ------------------
  |  Branch (29:20): [True: 13.6M, False: 1.86M]
  |  Branch (29:38): [True: 1.53M, False: 334k]
  |  Branch (29:55): [True: 69.0k, False: 1.46M]
  |  Branch (29:73): [True: 8.39k, False: 1.79M]
  ------------------
   30|       |            // current char is a symbol, most likely a punctuation. we treat it as segment delimiter
   31|  13.7M|            if (meetMSB && curPtr > prevPtr)
  ------------------
  |  Branch (31:17): [True: 3.22M, False: 10.4M]
  |  Branch (31:28): [True: 3.22M, False: 0]
  ------------------
   32|       |            // this segment contains more than single symbol, and it has upper ASCII, we need to keep it
   33|  3.22M|            {
   34|  36.0M|                while (prevPtr < curPtr) {
  ------------------
  |  Branch (34:24): [True: 32.8M, False: 3.22M]
  ------------------
   35|  32.8M|                    *newptr++ = *prevPtr++;
   36|  32.8M|                }
   37|  3.22M|                prevPtr++;
   38|  3.22M|                *newptr++ = ' ';
   39|  3.22M|                meetMSB = false;
   40|  10.4M|            } else { // ignore current segment. (either because it is just a symbol or just an English word)
   41|  10.4M|                prevPtr = curPtr + 1;
   42|  10.4M|            }
   43|  13.7M|        }
   44|  75.4M|    }
   45|  3.22k|    if (meetMSB && curPtr > prevPtr) {
  ------------------
  |  Branch (45:9): [True: 1.90k, False: 1.31k]
  |  Branch (45:20): [True: 1.90k, False: 0]
  ------------------
   46|  28.5M|        while (prevPtr < curPtr) {
  ------------------
  |  Branch (46:16): [True: 28.5M, False: 1.90k]
  ------------------
   47|  28.5M|            *newptr++ = *prevPtr++;
   48|  28.5M|        }
   49|  1.90k|    }
   50|       |
   51|  3.22k|    newLen = newptr - *newBuf;
   52|       |
   53|  3.22k|    return true;
   54|  3.22k|}
_ZN15kencodingprober15nsCharSetProber24FilterWithEnglishLettersEPKcjPPcRj:
   58|  3.22k|{
   59|       |    // do filtering to reduce load to probers
   60|  3.22k|    char *newptr;
   61|  3.22k|    char *prevPtr;
   62|  3.22k|    char *curPtr;
   63|  3.22k|    bool isInTag = false;
   64|       |
   65|  3.22k|    newptr = *newBuf = (char *)malloc(aLen);
   66|  3.22k|    if (!newptr) {
  ------------------
  |  Branch (66:9): [True: 0, False: 3.22k]
  ------------------
   67|      0|        return false;
   68|      0|    }
   69|       |
   70|  75.4M|    for (curPtr = prevPtr = (char *)aBuf; curPtr < aBuf + aLen; ++curPtr) {
  ------------------
  |  Branch (70:43): [True: 75.4M, False: 3.22k]
  ------------------
   71|  75.4M|        if (*curPtr == '>') {
  ------------------
  |  Branch (71:13): [True: 3.25k, False: 75.4M]
  ------------------
   72|  3.25k|            isInTag = false;
   73|  75.4M|        } else if (*curPtr == '<') {
  ------------------
  |  Branch (73:20): [True: 1.01k, False: 75.4M]
  ------------------
   74|  1.01k|            isInTag = true;
   75|  1.01k|        }
   76|       |
   77|  75.4M|        if (!(*curPtr & 0x80) //
  ------------------
  |  Branch (77:13): [True: 15.5M, False: 59.8M]
  ------------------
   78|  75.4M|            && (*curPtr < 'A' || (*curPtr > 'Z' && *curPtr < 'a') || *curPtr > 'z')) {
  ------------------
  |  Branch (78:17): [True: 13.6M, False: 1.86M]
  |  Branch (78:35): [True: 1.53M, False: 334k]
  |  Branch (78:52): [True: 69.0k, False: 1.46M]
  |  Branch (78:70): [True: 8.39k, False: 1.79M]
  ------------------
   79|  13.7M|            if (curPtr > prevPtr && !isInTag) // Current segment contains more than just a symbol
  ------------------
  |  Branch (79:17): [True: 3.26M, False: 10.4M]
  |  Branch (79:37): [True: 3.20M, False: 64.7k]
  ------------------
   80|       |                                              // and it is not inside a tag, keep it.
   81|  3.20M|            {
   82|  35.2M|                while (prevPtr < curPtr) {
  ------------------
  |  Branch (82:24): [True: 32.0M, False: 3.20M]
  ------------------
   83|  32.0M|                    *newptr++ = *prevPtr++;
   84|  32.0M|                }
   85|  3.20M|                prevPtr++;
   86|  3.20M|                *newptr++ = ' ';
   87|  10.5M|            } else {
   88|  10.5M|                prevPtr = curPtr + 1;
   89|  10.5M|            }
   90|  13.7M|        }
   91|  75.4M|    }
   92|       |
   93|       |    // If the current segment contains more than just a symbol
   94|       |    // and it is not inside a tag then keep it.
   95|  3.22k|    if (!isInTag) {
  ------------------
  |  Branch (95:9): [True: 3.10k, False: 114]
  ------------------
   96|  28.2M|        while (prevPtr < curPtr) {
  ------------------
  |  Branch (96:16): [True: 28.2M, False: 3.10k]
  ------------------
   97|  28.2M|            *newptr++ = *prevPtr++;
   98|  28.2M|        }
   99|  3.10k|    }
  100|       |
  101|  3.22k|    newLen = newptr - *newBuf;
  102|       |
  103|  3.22k|    return true;
  104|  3.22k|}

_ZN15kencodingprober15nsCharSetProberD2Ev:
   26|   105k|    {
   27|   105k|    }

_ZN15kencodingprober20nsCodingStateMachineC2EPKNS_7SMModelE:
   39|  78.0k|    {
   40|  78.0k|        mCurrentState = eStart;
   41|  78.0k|        mModel = sm;
   42|  78.0k|    }
_ZN15kencodingprober20nsCodingStateMachine9NextStateEc:
   44|   608M|    {
   45|       |        // for each byte we get its class KCODECS_NO_EXPORT , if it is first byte, we also get byte length
   46|   608M|        unsigned int byteCls = GETCLASS(c);
  ------------------
  |  |   24|   608M|#define GETCLASS(c) GETFROMPCK(((unsigned char)(c)), mModel->classTable)
  |  |  ------------------
  |  |  |  |   52|   608M|#define GETFROMPCK(i, c) (((((c).data)[(i) >> (c).idxsft]) >> (((i) & (c).sftmsk) << (c).bitsft)) & (c).unitmsk)
  |  |  ------------------
  ------------------
   47|   608M|        if (mCurrentState == eStart) {
  ------------------
  |  Branch (47:13): [True: 196M, False: 412M]
  ------------------
   48|   196M|            mCurrentBytePos = 0;
   49|   196M|            mCurrentCharLen = mModel->charLenTable[byteCls];
   50|   196M|        }
   51|       |        // from byte's class KCODECS_NO_EXPORT and stateTable, we get its next state
   52|   608M|        mCurrentState = GETFROMPCK(mCurrentState * (mModel->classFactor) + byteCls, mModel->stateTable);
  ------------------
  |  |   52|   608M|#define GETFROMPCK(i, c) (((((c).data)[(i) >> (c).idxsft]) >> (((i) & (c).sftmsk) << (c).bitsft)) & (c).unitmsk)
  ------------------
   53|   608M|        mCurrentBytePos++;
   54|   608M|        return mCurrentState;
   55|   608M|    }
_ZN15kencodingprober20nsCodingStateMachine17GetCurrentCharLenEv:
   57|   180M|    {
   58|   180M|        return mCurrentCharLen;
   59|   180M|    }
_ZN15kencodingprober20nsCodingStateMachine5ResetEv:
   61|  88.2k|    {
   62|  88.2k|        mCurrentState = eStart;
   63|  88.2k|    }
_ZN15kencodingprober20nsCodingStateMachine21GetCodingStateMachineEv:
   65|   317M|    {
   66|   317M|        return mModel->name;
   67|   317M|    }

_ZN15kencodingprober13nsEUCJPProber5ResetEv:
   17|  12.2k|{
   18|  12.2k|    mCodingSM->Reset();
   19|  12.2k|    mState = eDetecting;
   20|  12.2k|    mContextAnalyser.Reset();
   21|  12.2k|    mDistributionAnalyser.Reset();
   22|  12.2k|}
_ZN15kencodingprober13nsEUCJPProber10HandleDataEPKcj:
   25|  6.97k|{
   26|  6.97k|    if (aLen == 0) {
  ------------------
  |  Branch (26:9): [True: 0, False: 6.97k]
  ------------------
   27|      0|        return mState;
   28|      0|    }
   29|       |
   30|  44.2M|    for (unsigned int i = 0; i < aLen; i++) {
  ------------------
  |  Branch (30:30): [True: 44.2M, False: 3.78k]
  ------------------
   31|  44.2M|        const nsSMState codingState = mCodingSM->NextState(aBuf[i]);
   32|  44.2M|        if (codingState == eError) {
  ------------------
  |  Branch (32:13): [True: 3.18k, False: 44.2M]
  ------------------
   33|  3.18k|            mState = eNotMe;
   34|  3.18k|            break;
   35|  3.18k|        }
   36|  44.2M|        if (codingState == eItsMe) {
  ------------------
  |  Branch (36:13): [True: 0, False: 44.2M]
  ------------------
   37|      0|            mState = eFoundIt;
   38|      0|            break;
   39|      0|        }
   40|  44.2M|        if (codingState == eStart) {
  ------------------
  |  Branch (40:13): [True: 23.7M, False: 20.5M]
  ------------------
   41|  23.7M|            unsigned int charLen = mCodingSM->GetCurrentCharLen();
   42|       |
   43|  23.7M|            if (i == 0) {
  ------------------
  |  Branch (43:17): [True: 3.21k, False: 23.7M]
  ------------------
   44|  3.21k|                mLastChar[1] = aBuf[0];
   45|  3.21k|                mContextAnalyser.HandleOneChar(mLastChar, charLen);
   46|  3.21k|                mDistributionAnalyser.HandleOneChar(mLastChar, charLen);
   47|  23.7M|            } else {
   48|  23.7M|                mContextAnalyser.HandleOneChar(aBuf + i - 1, charLen);
   49|  23.7M|                mDistributionAnalyser.HandleOneChar(aBuf + i - 1, charLen);
   50|  23.7M|            }
   51|  23.7M|        }
   52|  44.2M|    }
   53|       |
   54|  6.97k|    mLastChar[0] = aBuf[aLen - 1];
   55|       |
   56|  6.97k|    if (mState == eDetecting) {
  ------------------
  |  Branch (56:9): [True: 3.78k, False: 3.18k]
  ------------------
   57|  3.78k|        if (mContextAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) {
  ------------------
  |  |   20|    197|#define SHORTCUT_THRESHOLD (float)0.95
  ------------------
  |  Branch (57:13): [True: 197, False: 3.59k]
  |  Branch (57:49): [True: 186, False: 11]
  ------------------
   58|    186|            mState = eFoundIt;
   59|    186|        }
   60|  3.78k|    }
   61|       |
   62|  6.97k|    return mState;
   63|  6.97k|}
_ZN15kencodingprober13nsEUCJPProber13GetConfidenceEv:
   66|    197|{
   67|    197|    float contxtCf = mContextAnalyser.GetConfidence();
   68|    197|    float distribCf = mDistributionAnalyser.GetConfidence();
   69|       |
   70|    197|    return (contxtCf > distribCf ? contxtCf : distribCf);
  ------------------
  |  Branch (70:13): [True: 166, False: 31]
  ------------------
   71|    197|}

_ZN15kencodingprober13nsEUCJPProberC2Ev:
   25|  7.08k|    {
   26|  7.08k|        mCodingSM = new nsCodingStateMachine(&EUCJPSMModel);
   27|  7.08k|        Reset();
   28|  7.08k|    }
_ZN15kencodingprober13nsEUCJPProberD2Ev:
   30|  7.08k|    {
   31|  7.08k|        delete mCodingSM;
   32|  7.08k|    }
_ZN15kencodingprober13nsEUCJPProber14GetCharSetNameEv:
   35|     48|    {
   36|     48|        return "EUC-JP";
   37|     48|    }

_ZN15kencodingprober13nsEUCKRProber5ResetEv:
   12|  8.37k|{
   13|  8.37k|    mCodingSM->Reset();
   14|  8.37k|    mState = eDetecting;
   15|  8.37k|    mDistributionAnalyser.Reset();
   16|       |    // mContextAnalyser.Reset();
   17|  8.37k|}
_ZN15kencodingprober13nsEUCKRProber10HandleDataEPKcj:
   20|  4.93k|{
   21|  4.93k|    if (aLen == 0) {
  ------------------
  |  Branch (21:9): [True: 0, False: 4.93k]
  ------------------
   22|      0|        return mState;
   23|      0|    }
   24|       |
   25|  33.0M|    for (unsigned int i = 0; i < aLen; i++) {
  ------------------
  |  Branch (25:30): [True: 33.0M, False: 2.45k]
  ------------------
   26|  33.0M|        const nsSMState codingState = mCodingSM->NextState(aBuf[i]);
   27|  33.0M|        if (codingState == eError) {
  ------------------
  |  Branch (27:13): [True: 2.48k, False: 33.0M]
  ------------------
   28|  2.48k|            mState = eNotMe;
   29|  2.48k|            break;
   30|  2.48k|        }
   31|  33.0M|        if (codingState == eItsMe) {
  ------------------
  |  Branch (31:13): [True: 0, False: 33.0M]
  ------------------
   32|      0|            mState = eFoundIt;
   33|      0|            break;
   34|      0|        }
   35|  33.0M|        if (codingState == eStart) {
  ------------------
  |  Branch (35:13): [True: 18.1M, False: 14.9M]
  ------------------
   36|  18.1M|            unsigned int charLen = mCodingSM->GetCurrentCharLen();
   37|       |
   38|  18.1M|            if (i == 0) {
  ------------------
  |  Branch (38:17): [True: 2.24k, False: 18.1M]
  ------------------
   39|  2.24k|                mLastChar[1] = aBuf[0];
   40|  2.24k|                mDistributionAnalyser.HandleOneChar(mLastChar, charLen);
   41|  18.1M|            } else {
   42|  18.1M|                mDistributionAnalyser.HandleOneChar(aBuf + i - 1, charLen);
   43|  18.1M|            }
   44|  18.1M|        }
   45|  33.0M|    }
   46|       |
   47|  4.93k|    mLastChar[0] = aBuf[aLen - 1];
   48|       |
   49|  4.93k|    if (mState == eDetecting) {
  ------------------
  |  Branch (49:9): [True: 2.45k, False: 2.48k]
  ------------------
   50|  2.45k|        if (mDistributionAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) {
  ------------------
  |  |   20|    175|#define SHORTCUT_THRESHOLD (float)0.95
  ------------------
  |  Branch (50:13): [True: 175, False: 2.27k]
  |  Branch (50:54): [True: 8, False: 167]
  ------------------
   51|      8|            mState = eFoundIt;
   52|      8|        }
   53|  2.45k|    }
   54|       |    //    else
   55|       |    //      mDistributionAnalyser.HandleData(aBuf, aLen);
   56|       |
   57|  4.93k|    return mState;
   58|  4.93k|}
_ZN15kencodingprober13nsEUCKRProber13GetConfidenceEv:
   61|    175|{
   62|    175|    float distribCf = mDistributionAnalyser.GetConfidence();
   63|       |
   64|    175|    return (float)distribCf;
   65|    175|}

_ZN15kencodingprober13nsEUCKRProberC2Ev:
   19|  5.15k|    {
   20|  5.15k|        mCodingSM = new nsCodingStateMachine(&EUCKRSMModel);
   21|  5.15k|        Reset();
   22|  5.15k|    }
_ZN15kencodingprober13nsEUCKRProberD2Ev:
   24|  5.15k|    {
   25|  5.15k|        delete mCodingSM;
   26|  5.15k|    }
_ZN15kencodingprober13nsEUCKRProber14GetCharSetNameEv:
   29|      2|    {
   30|      2|        return "EUC-KR";
   31|      2|    }

_ZN15kencodingprober18nsEscCharSetProberC2Ev:
   12|  1.97k|{
   13|  1.97k|    mCodingSM[0] = new nsCodingStateMachine(&HZSMModel);
   14|  1.97k|    mCodingSM[1] = new nsCodingStateMachine(&ISO2022CNSMModel);
   15|  1.97k|    mCodingSM[2] = new nsCodingStateMachine(&ISO2022JPSMModel);
   16|  1.97k|    mCodingSM[3] = new nsCodingStateMachine(&ISO2022KRSMModel);
   17|  1.97k|    mActiveSM = NUM_OF_ESC_CHARSETS;
  ------------------
  |  |   13|  1.97k|#define NUM_OF_ESC_CHARSETS 4
  ------------------
   18|  1.97k|    mState = eDetecting;
   19|  1.97k|    mDetectedCharset = nullptr;
   20|  1.97k|}
_ZN15kencodingprober18nsEscCharSetProberD2Ev:
   23|  1.97k|{
   24|  9.85k|    for (unsigned int i = 0; i < NUM_OF_ESC_CHARSETS; i++) {
  ------------------
  |  |   13|  9.85k|#define NUM_OF_ESC_CHARSETS 4
  ------------------
  |  Branch (24:30): [True: 7.88k, False: 1.97k]
  ------------------
   25|  7.88k|        delete mCodingSM[i];
   26|  7.88k|    }
   27|  1.97k|}
_ZN15kencodingprober18nsEscCharSetProber10HandleDataEPKcj:
   40|  1.97k|{
   41|  1.97k|    nsSMState codingState;
   42|  1.97k|    int j;
   43|  1.97k|    unsigned int i;
   44|       |
   45|  3.20M|    for (i = 0; i < aLen && mState == eDetecting; i++) {
  ------------------
  |  Branch (45:17): [True: 3.20M, False: 581]
  |  Branch (45:29): [True: 3.20M, False: 0]
  ------------------
   46|  15.9M|        for (j = mActiveSM - 1; j >= 0; j--) {
  ------------------
  |  Branch (46:33): [True: 12.8M, False: 3.19M]
  ------------------
   47|       |            // byte is feed to all active state machine
   48|  12.8M|            codingState = mCodingSM[j]->NextState(aBuf[i]);
   49|  12.8M|            if (codingState == eError) {
  ------------------
  |  Branch (49:17): [True: 5.57k, False: 12.7M]
  ------------------
   50|       |                // got negative answer for this state machine, make it inactive
   51|  5.57k|                mActiveSM--;
   52|  5.57k|                if (mActiveSM == 0) {
  ------------------
  |  Branch (52:21): [True: 1.38k, False: 4.19k]
  ------------------
   53|  1.38k|                    mState = eNotMe;
   54|  1.38k|                    return mState;
   55|  4.19k|                } else if (j != (int)mActiveSM) {
  ------------------
  |  Branch (55:28): [True: 141, False: 4.05k]
  ------------------
   56|    141|                    nsCodingStateMachine *t;
   57|    141|                    t = mCodingSM[mActiveSM];
   58|    141|                    mCodingSM[mActiveSM] = mCodingSM[j];
   59|    141|                    mCodingSM[j] = t;
   60|    141|                }
   61|  12.7M|            } else if (codingState == eItsMe) {
  ------------------
  |  Branch (61:24): [True: 8, False: 12.7M]
  ------------------
   62|      8|                mState = eFoundIt;
   63|      8|                mDetectedCharset = mCodingSM[j]->GetCodingStateMachine();
   64|      8|                return mState;
   65|      8|            }
   66|  12.8M|        }
   67|  3.20M|    }
   68|       |
   69|    581|    return mState;
   70|  1.97k|}

_ZN15kencodingprober18nsEscCharSetProber14GetCharSetNameEv:
   23|      3|    {
   24|      3|        return mDetectedCharset;
   25|      3|    }

_ZN15kencodingprober15nsGB18030Prober5ResetEv:
   17|  12.2k|{
   18|  12.2k|    mCodingSM->Reset();
   19|  12.2k|    mState = eDetecting;
   20|  12.2k|    mDistributionAnalyser.Reset();
   21|       |    // mContextAnalyser.Reset();
   22|  12.2k|}
_ZN15kencodingprober15nsGB18030Prober10HandleDataEPKcj:
   25|  6.91k|{
   26|  6.91k|    if (aLen == 0) {
  ------------------
  |  Branch (26:9): [True: 0, False: 6.91k]
  ------------------
   27|      0|        return mState;
   28|      0|    }
   29|       |
   30|  67.0M|    for (unsigned int i = 0; i < aLen; i++) {
  ------------------
  |  Branch (30:30): [True: 67.0M, False: 5.18k]
  ------------------
   31|  67.0M|        const nsSMState codingState = mCodingSM->NextState(aBuf[i]);
   32|  67.0M|        if (codingState == eError) {
  ------------------
  |  Branch (32:13): [True: 1.65k, False: 67.0M]
  ------------------
   33|  1.65k|            mState = eNotMe;
   34|  1.65k|            break;
   35|  1.65k|        }
   36|  67.0M|        if (codingState == eItsMe) {
  ------------------
  |  Branch (36:13): [True: 80, False: 67.0M]
  ------------------
   37|     80|            mState = eFoundIt;
   38|     80|            break;
   39|     80|        }
   40|  67.0M|        if (codingState == eStart) {
  ------------------
  |  Branch (40:13): [True: 35.1M, False: 31.8M]
  ------------------
   41|  35.1M|            unsigned int charLen = mCodingSM->GetCurrentCharLen();
   42|       |
   43|  35.1M|            if (i == 0) {
  ------------------
  |  Branch (43:17): [True: 3.30k, False: 35.1M]
  ------------------
   44|  3.30k|                mLastChar[1] = aBuf[0];
   45|  3.30k|                mDistributionAnalyser.HandleOneChar(mLastChar, charLen);
   46|  35.1M|            } else {
   47|  35.1M|                mDistributionAnalyser.HandleOneChar(aBuf + i - 1, charLen);
   48|  35.1M|            }
   49|  35.1M|        }
   50|  67.0M|    }
   51|       |
   52|  6.91k|    mLastChar[0] = aBuf[aLen - 1];
   53|       |
   54|  6.91k|    if (mState == eDetecting) {
  ------------------
  |  Branch (54:9): [True: 5.18k, False: 1.73k]
  ------------------
   55|  5.18k|        if (mDistributionAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) {
  ------------------
  |  |   20|    375|#define SHORTCUT_THRESHOLD (float)0.95
  ------------------
  |  Branch (55:13): [True: 375, False: 4.80k]
  |  Branch (55:54): [True: 20, False: 355]
  ------------------
   56|     20|            mState = eFoundIt;
   57|     20|        }
   58|  5.18k|    }
   59|       |    //    else
   60|       |    //      mDistributionAnalyser.HandleData(aBuf, aLen);
   61|       |
   62|  6.91k|    return mState;
   63|  6.91k|}
_ZN15kencodingprober15nsGB18030Prober13GetConfidenceEv:
   66|    375|{
   67|    375|    float distribCf = mDistributionAnalyser.GetConfidence();
   68|       |
   69|    375|    return (float)distribCf;
   70|    375|}

_ZN15kencodingprober15nsGB18030ProberC2Ev:
   21|  7.08k|    {
   22|  7.08k|        mCodingSM = new nsCodingStateMachine(&GB18030SMModel);
   23|  7.08k|        Reset();
   24|  7.08k|    }
_ZN15kencodingprober15nsGB18030ProberD2Ev:
   26|  7.08k|    {
   27|  7.08k|        delete mCodingSM;
   28|  7.08k|    }
_ZN15kencodingprober15nsGB18030Prober14GetCharSetNameEv:
   31|     22|    {
   32|     22|        return "gb18030";
   33|     22|    }

_ZN15kencodingprober14nsHebrewProber7isFinalEc:
   36|  6.37M|{
   37|  6.37M|    return ((c == FINAL_KAF) || (c == FINAL_MEM) || (c == FINAL_NUN) || (c == FINAL_PE) || (c == FINAL_TSADI));
  ------------------
  |  |   11|  6.37M|#define FINAL_KAF ('\xea')
  ------------------
                  return ((c == FINAL_KAF) || (c == FINAL_MEM) || (c == FINAL_NUN) || (c == FINAL_PE) || (c == FINAL_TSADI));
  ------------------
  |  |   13|  3.32M|#define FINAL_MEM ('\xed')
  ------------------
                  return ((c == FINAL_KAF) || (c == FINAL_MEM) || (c == FINAL_NUN) || (c == FINAL_PE) || (c == FINAL_TSADI));
  ------------------
  |  |   15|  3.32M|#define FINAL_NUN ('\xef')
  ------------------
                  return ((c == FINAL_KAF) || (c == FINAL_MEM) || (c == FINAL_NUN) || (c == FINAL_PE) || (c == FINAL_TSADI));
  ------------------
  |  |   17|  3.26M|#define FINAL_PE ('\xf3')
  ------------------
                  return ((c == FINAL_KAF) || (c == FINAL_MEM) || (c == FINAL_NUN) || (c == FINAL_PE) || (c == FINAL_TSADI));
  ------------------
  |  |   19|  3.26M|#define FINAL_TSADI ('\xf5')
  ------------------
  |  Branch (37:13): [True: 3.05M, False: 3.32M]
  |  Branch (37:33): [True: 2.94k, False: 3.32M]
  |  Branch (37:53): [True: 56.8k, False: 3.26M]
  |  Branch (37:73): [True: 5.37k, False: 3.26M]
  |  Branch (37:92): [True: 606, False: 3.26M]
  ------------------
   38|  6.37M|}
_ZN15kencodingprober14nsHebrewProber10isNonFinalEc:
   41|  3.12M|{
   42|  3.12M|    return ((c == NORMAL_KAF) || (c == NORMAL_MEM) || (c == NORMAL_NUN) || (c == NORMAL_PE));
  ------------------
  |  |   12|  3.12M|#define NORMAL_KAF ('\xeb')
  ------------------
                  return ((c == NORMAL_KAF) || (c == NORMAL_MEM) || (c == NORMAL_NUN) || (c == NORMAL_PE));
  ------------------
  |  |   14|  83.1k|#define NORMAL_MEM ('\xee')
  ------------------
                  return ((c == NORMAL_KAF) || (c == NORMAL_MEM) || (c == NORMAL_NUN) || (c == NORMAL_PE));
  ------------------
  |  |   16|  81.1k|#define NORMAL_NUN ('\xf0')
  ------------------
                  return ((c == NORMAL_KAF) || (c == NORMAL_MEM) || (c == NORMAL_NUN) || (c == NORMAL_PE));
  ------------------
  |  |   18|  79.9k|#define NORMAL_PE ('\xf4')
  ------------------
  |  Branch (42:13): [True: 3.04M, False: 83.1k]
  |  Branch (42:34): [True: 1.96k, False: 81.1k]
  |  Branch (42:55): [True: 1.19k, False: 79.9k]
  |  Branch (42:76): [True: 314, False: 79.6k]
  ------------------
   43|       |    // The normal Tsadi is not a good Non-Final letter due to words like
   44|       |    // 'lechotet' (to chat) containing an apostrophe after the tsadi. This
   45|       |    // apostrophe is converted to a space in FilterWithoutEnglishLetters causing
   46|       |    // the Non-Final tsadi to appear at an end of a word even though this is not
   47|       |    // the case in the original text.
   48|       |    // The letters Pe and Kaf rarely display a related behavior of not being a
   49|       |    // good Non-Final letter. Words like 'Pop', 'Winamp' and 'Mubarak' for
   50|       |    // example legally end with a Non-Final Pe or Kaf. However, the benefit of
   51|       |    // these letters as Non-Final letters outweighs the damage since these words
   52|       |    // are quite rare.
   53|  3.12M|}
_ZN15kencodingprober14nsHebrewProber10HandleDataEPKcj:
   81|  2.59k|{
   82|       |    // Both model probers say it's not them. No reason to continue.
   83|  2.59k|    if (GetState() == eNotMe) {
  ------------------
  |  Branch (83:9): [True: 0, False: 2.59k]
  ------------------
   84|      0|        return eNotMe;
   85|      0|    }
   86|       |
   87|  2.59k|    const char *curPtr;
   88|  2.59k|    const char *endPtr = aBuf + aLen;
   89|       |
   90|  64.5M|    for (curPtr = (char *)aBuf; curPtr < endPtr; ++curPtr) {
  ------------------
  |  Branch (90:33): [True: 64.5M, False: 2.59k]
  ------------------
   91|  64.5M|        char cur = *curPtr;
   92|  64.5M|        if (cur == ' ') { // We stand on a space - a word just ended
  ------------------
  |  Branch (92:13): [True: 3.21M, False: 61.3M]
  ------------------
   93|  3.21M|            if (mBeforePrev != ' ') { // *(curPtr-2) was not a space so prev is not a 1 letter word
  ------------------
  |  Branch (93:17): [True: 3.18M, False: 28.2k]
  ------------------
   94|  3.18M|                if (isFinal(mPrev)) { // case (1) [-2:not space][-1:final letter][cur:space]
  ------------------
  |  Branch (94:21): [True: 62.9k, False: 3.12M]
  ------------------
   95|  62.9k|                    ++mFinalCharLogicalScore;
   96|  3.12M|                } else if (isNonFinal(mPrev)) { // case (2) [-2:not space][-1:Non-Final letter][cur:space]
  ------------------
  |  Branch (96:28): [True: 3.04M, False: 79.6k]
  ------------------
   97|  3.04M|                    ++mFinalCharVisualScore;
   98|  3.04M|                }
   99|  3.18M|            }
  100|  61.3M|        } else { // Not standing on a space
  101|  61.3M|            if ((mBeforePrev == ' ') && (isFinal(mPrev)) && (cur != ' ')) { // case (3) [-2:space][-1:final letter][cur:not space]
  ------------------
  |  Branch (101:17): [True: 3.19M, False: 58.1M]
  |  Branch (101:41): [True: 3.05M, False: 136k]
  |  Branch (101:61): [True: 3.05M, False: 0]
  ------------------
  102|  3.05M|                ++mFinalCharVisualScore;
  103|  3.05M|            }
  104|  61.3M|        }
  105|  64.5M|        mBeforePrev = mPrev;
  106|  64.5M|        mPrev = cur;
  107|  64.5M|    }
  108|       |
  109|       |    // Forever detecting, till the end or until both model probers return eNotMe (handled above).
  110|  2.59k|    return eDetecting;
  111|  2.59k|}
_ZN15kencodingprober14nsHebrewProber14GetCharSetNameEv:
  115|     63|{
  116|       |    // If the final letter score distance is dominant enough, rely on it.
  117|     63|    int finalsub = mFinalCharLogicalScore - mFinalCharVisualScore;
  118|     63|    if (finalsub >= MIN_FINAL_CHAR_DISTANCE) {
  ------------------
  |  |   24|     63|#define MIN_FINAL_CHAR_DISTANCE (5)
  ------------------
  |  Branch (118:9): [True: 7, False: 56]
  ------------------
  119|      7|        return LOGICAL_HEBREW_NAME;
  ------------------
  |  |   31|      7|#define LOGICAL_HEBREW_NAME ("windows-1255")
  ------------------
  120|      7|    }
  121|     56|    if (finalsub <= -(MIN_FINAL_CHAR_DISTANCE)) {
  ------------------
  |  |   24|     56|#define MIN_FINAL_CHAR_DISTANCE (5)
  ------------------
  |  Branch (121:9): [True: 41, False: 15]
  ------------------
  122|     41|        return VISUAL_HEBREW_NAME;
  ------------------
  |  |   30|     41|#define VISUAL_HEBREW_NAME ("ISO-8859-8")
  ------------------
  123|     41|    }
  124|       |
  125|       |    // It's not dominant enough, try to rely on the model scores instead.
  126|     15|    float modelsub = mLogicalProb->GetConfidence() - mVisualProb->GetConfidence();
  127|     15|    if (modelsub > MIN_MODEL_DISTANCE) {
  ------------------
  |  |   28|     15|#define MIN_MODEL_DISTANCE (0.01)
  ------------------
  |  Branch (127:9): [True: 7, False: 8]
  ------------------
  128|      7|        return LOGICAL_HEBREW_NAME;
  ------------------
  |  |   31|      7|#define LOGICAL_HEBREW_NAME ("windows-1255")
  ------------------
  129|      7|    }
  130|      8|    if (modelsub < -(MIN_MODEL_DISTANCE)) {
  ------------------
  |  |   28|      8|#define MIN_MODEL_DISTANCE (0.01)
  ------------------
  |  Branch (130:9): [True: 1, False: 7]
  ------------------
  131|      1|        return VISUAL_HEBREW_NAME;
  ------------------
  |  |   30|      1|#define VISUAL_HEBREW_NAME ("ISO-8859-8")
  ------------------
  132|      1|    }
  133|       |
  134|       |    // Still no good, back to final letter distance, maybe it'll save the day.
  135|      7|    if (finalsub < 0) {
  ------------------
  |  Branch (135:9): [True: 3, False: 4]
  ------------------
  136|      3|        return VISUAL_HEBREW_NAME;
  ------------------
  |  |   30|      3|#define VISUAL_HEBREW_NAME ("ISO-8859-8")
  ------------------
  137|      3|    }
  138|       |
  139|       |    // (finalsub > 0 - Logical) or (don't know what to do) default to Logical.
  140|      4|    return LOGICAL_HEBREW_NAME;
  ------------------
  |  |   31|      4|#define LOGICAL_HEBREW_NAME ("windows-1255")
  ------------------
  141|      7|}
_ZN15kencodingprober14nsHebrewProber5ResetEv:
  144|  6.44k|{
  145|  6.44k|    mFinalCharLogicalScore = 0;
  146|  6.44k|    mFinalCharVisualScore = 0;
  147|       |
  148|       |    // mPrev and mBeforePrev are initialized to space in order to simulate a word
  149|       |    // delimiter at the beginning of the data
  150|  6.44k|    mPrev = ' ';
  151|  6.44k|    mBeforePrev = ' ';
  152|  6.44k|}
_ZN15kencodingprober14nsHebrewProber8GetStateEv:
  155|  2.59k|{
  156|       |    // Remain active as long as any of the model probers are active.
  157|  2.59k|    if ((mLogicalProb->GetState() == eNotMe) && (mVisualProb->GetState() == eNotMe)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 2.59k]
  |  Branch (157:49): [True: 0, False: 0]
  ------------------
  158|      0|        return eNotMe;
  159|      0|    }
  160|  2.59k|    return eDetecting;
  161|  2.59k|}

_ZN15kencodingprober14nsHebrewProberC2Ev:
   19|  3.22k|        : mLogicalProb(nullptr)
   20|  3.22k|        , mVisualProb(nullptr)
   21|  3.22k|    {
   22|  3.22k|        Reset();
   23|  3.22k|    }
_ZN15kencodingprober14nsHebrewProber15SetModelProbersEPNS_15nsCharSetProberES2_:
   43|  3.22k|    {
   44|  3.22k|        mLogicalProb = logicalPrb;
   45|  3.22k|        mVisualProb = visualPrb;
   46|  3.22k|    }

_ZN15kencodingprober14nsLatin1Prober5ResetEv:
   76|  3.22k|{
   77|  3.22k|    mState = eDetecting;
   78|  3.22k|    mLastCharClass = OTH;
  ------------------
  |  |   12|  3.22k|#define OTH 1 // other
  ------------------
   79|  16.1k|    for (int i = 0; i < FREQ_CAT_NUM; i++) {
  ------------------
  |  |   12|  16.1k|#define FREQ_CAT_NUM 4
  ------------------
  |  Branch (79:21): [True: 12.8k, False: 3.22k]
  ------------------
   80|  12.8k|        mFreqCounter[i] = 0;
   81|  12.8k|    }
   82|  3.22k|}
_ZN15kencodingprober14nsLatin1Prober10HandleDataEPKcj:
   85|  3.22k|{
   86|  3.22k|    char *newBuf1 = nullptr;
   87|  3.22k|    unsigned int newLen1 = 0;
   88|       |
   89|  3.22k|    if (!FilterWithEnglishLetters(aBuf, aLen, &newBuf1, newLen1)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 3.22k]
  ------------------
   90|      0|        newBuf1 = (char *)aBuf;
   91|      0|        newLen1 = aLen;
   92|      0|    }
   93|       |
   94|  42.5M|    for (unsigned int i = 0; i < newLen1; i++) {
  ------------------
  |  Branch (94:30): [True: 42.5M, False: 2.92k]
  ------------------
   95|  42.5M|        const unsigned char charClass = Latin1_CharToClass[(unsigned char)newBuf1[i]];
   96|  42.5M|        const unsigned char freq = Latin1ClassModel[mLastCharClass * CLASS_NUM + charClass];
  ------------------
  |  |   19|  42.5M|#define CLASS_NUM 8 // total classes
  ------------------
   97|  42.5M|        if (freq == 0) {
  ------------------
  |  Branch (97:13): [True: 300, False: 42.5M]
  ------------------
   98|    300|            mState = eNotMe;
   99|    300|            break;
  100|    300|        }
  101|  42.5M|        mFreqCounter[freq]++;
  102|  42.5M|        mLastCharClass = charClass;
  103|  42.5M|    }
  104|       |
  105|  3.22k|    if (newBuf1 != aBuf) {
  ------------------
  |  Branch (105:9): [True: 3.22k, False: 0]
  ------------------
  106|  3.22k|        free(newBuf1);
  107|  3.22k|    }
  108|       |
  109|  3.22k|    return mState;
  110|  3.22k|}

_ZN15kencodingprober14nsLatin1ProberC2Ev:
   19|  3.22k|    {
   20|  3.22k|        Reset();
   21|  3.22k|    }

_ZN15kencodingprober17nsMBCSGroupProberC2Ev:
   27|  3.22k|{
   28|  3.22k|    mProbers[0] = new UnicodeGroupProber();
   29|  3.22k|    mProbers[1] = new nsSJISProber();
   30|  3.22k|    mProbers[2] = new nsEUCJPProber();
   31|  3.22k|    mProbers[3] = new nsGB18030Prober();
   32|  3.22k|    mProbers[4] = new nsEUCKRProber();
   33|  3.22k|    mProbers[5] = new nsBig5Prober();
   34|  3.22k|    Reset();
   35|  3.22k|}
_ZN15kencodingprober17nsMBCSGroupProberD2Ev:
   38|  3.22k|{
   39|  22.5k|    for (unsigned int i = 0; i < NUM_OF_PROBERS; i++) {
  ------------------
  |  |   17|  22.5k|#define NUM_OF_PROBERS 6
  ------------------
  |  Branch (39:30): [True: 19.3k, False: 3.22k]
  ------------------
   40|  19.3k|        delete mProbers[i];
   41|  19.3k|    }
   42|  3.22k|}
_ZN15kencodingprober17nsMBCSGroupProber14GetCharSetNameEv:
   45|    114|{
   46|    114|    if (mBestGuess == -1) {
  ------------------
  |  Branch (46:9): [True: 0, False: 114]
  ------------------
   47|      0|        GetConfidence();
   48|      0|        if (mBestGuess == -1) {
  ------------------
  |  Branch (48:13): [True: 0, False: 0]
  ------------------
   49|      0|            mBestGuess = 0;
   50|      0|        }
   51|      0|    }
   52|    114|    return mProbers[mBestGuess]->GetCharSetName();
   53|    114|}
_ZN15kencodingprober17nsMBCSGroupProber5ResetEv:
   56|  3.22k|{
   57|  3.22k|    mActiveNum = 0;
   58|  22.5k|    for (unsigned int i = 0; i < NUM_OF_PROBERS; i++) {
  ------------------
  |  |   17|  22.5k|#define NUM_OF_PROBERS 6
  ------------------
  |  Branch (58:30): [True: 19.3k, False: 3.22k]
  ------------------
   59|  19.3k|        if (mProbers[i]) {
  ------------------
  |  Branch (59:13): [True: 19.3k, False: 0]
  ------------------
   60|  19.3k|            mProbers[i]->Reset();
   61|  19.3k|            mIsActive[i] = true;
   62|  19.3k|            ++mActiveNum;
   63|  19.3k|        } else {
   64|      0|            mIsActive[i] = false;
   65|      0|        }
   66|  19.3k|    }
   67|  3.22k|    mBestGuess = -1;
   68|  3.22k|    mState = eDetecting;
   69|  3.22k|}
_ZN15kencodingprober17nsMBCSGroupProber10HandleDataEPKcj:
   72|  3.22k|{
   73|  3.22k|    nsProbingState st;
   74|  3.22k|    unsigned int i;
   75|       |
   76|       |    // do filtering to reduce load to probers
   77|  3.22k|    char *highbyteBuf;
   78|  3.22k|    char *hptr;
   79|  3.22k|    bool keepNext = true; // assume previous is not ascii, it will do no harm except add some noise
   80|  3.22k|    hptr = highbyteBuf = (char *)malloc(aLen);
   81|  3.22k|    if (!hptr) {
  ------------------
  |  Branch (81:9): [True: 0, False: 3.22k]
  ------------------
   82|      0|        return mState;
   83|      0|    }
   84|  75.4M|    for (i = 0; i < aLen; ++i) {
  ------------------
  |  Branch (84:17): [True: 75.4M, False: 3.22k]
  ------------------
   85|  75.4M|        if (aBuf[i] & 0x80) {
  ------------------
  |  Branch (85:13): [True: 59.8M, False: 15.5M]
  ------------------
   86|  59.8M|            *hptr++ = aBuf[i];
   87|  59.8M|            keepNext = true;
   88|  59.8M|        } else {
   89|       |            // if previous is highbyte, keep this even it is a ASCII
   90|  15.5M|            if (keepNext) {
  ------------------
  |  Branch (90:17): [True: 3.24M, False: 12.2M]
  ------------------
   91|  3.24M|                *hptr++ = aBuf[i];
   92|  3.24M|                keepNext = false;
   93|  3.24M|            }
   94|  15.5M|        }
   95|  75.4M|    }
   96|       |
   97|  21.3k|    for (i = 0; i < NUM_OF_PROBERS; ++i) {
  ------------------
  |  |   17|  21.3k|#define NUM_OF_PROBERS 6
  ------------------
  |  Branch (97:17): [True: 18.6k, False: 2.73k]
  ------------------
   98|  18.6k|        if (!mIsActive[i]) {
  ------------------
  |  Branch (98:13): [True: 0, False: 18.6k]
  ------------------
   99|      0|            continue;
  100|      0|        }
  101|  18.6k|        st = mProbers[i]->HandleData(highbyteBuf, hptr - highbyteBuf);
  102|  18.6k|        if (st == eFoundIt) {
  ------------------
  |  Branch (102:13): [True: 231, False: 18.3k]
  ------------------
  103|    231|            mBestGuess = i;
  104|    231|            mState = eFoundIt;
  105|    231|            break;
  106|  18.3k|        } else if (st == eNotMe) {
  ------------------
  |  Branch (106:20): [True: 7.16k, False: 11.2k]
  ------------------
  107|  7.16k|            mIsActive[i] = false;
  108|  7.16k|            mActiveNum--;
  109|  7.16k|            if (mActiveNum == 0) {
  ------------------
  |  Branch (109:17): [True: 253, False: 6.91k]
  ------------------
  110|    253|                mState = eNotMe;
  111|    253|                break;
  112|    253|            }
  113|  7.16k|        }
  114|  18.6k|    }
  115|       |
  116|  3.22k|    free(highbyteBuf);
  117|       |
  118|  3.22k|    return mState;
  119|  3.22k|}

_ZN15kencodingprober17nsSBCSGroupProberC2Ev:
   19|  3.22k|{
   20|  3.22k|    mProbers[0] = new nsSingleByteCharSetProber(&Win1251Model);
   21|  3.22k|    mProbers[1] = new nsSingleByteCharSetProber(&Koi8rModel);
   22|  3.22k|    mProbers[2] = new nsSingleByteCharSetProber(&Latin5Model);
   23|  3.22k|    mProbers[3] = new nsSingleByteCharSetProber(&MacCyrillicModel);
   24|  3.22k|    mProbers[4] = new nsSingleByteCharSetProber(&Ibm866Model);
   25|  3.22k|    mProbers[5] = new nsSingleByteCharSetProber(&Ibm855Model);
   26|  3.22k|    mProbers[6] = new nsSingleByteCharSetProber(&Latin7Model);
   27|  3.22k|    mProbers[7] = new nsSingleByteCharSetProber(&Win1253Model);
   28|  3.22k|    mProbers[8] = new nsSingleByteCharSetProber(&Latin5BulgarianModel);
   29|  3.22k|    mProbers[9] = new nsSingleByteCharSetProber(&Win1251BulgarianModel);
   30|       |
   31|  3.22k|    nsHebrewProber *hebprober = new nsHebrewProber();
   32|       |    // Notice: Any change in these indexes - 10,11,12 must be reflected
   33|       |    // in the code below as well.
   34|  3.22k|    mProbers[10] = hebprober;
   35|  3.22k|    mProbers[11] = new nsSingleByteCharSetProber(&Win1255Model, false, hebprober); // Logical Hebrew
   36|  3.22k|    mProbers[12] = new nsSingleByteCharSetProber(&Win1255Model, true, hebprober); // Visual Hebrew
   37|  3.22k|    mProbers[13] = new UnicodeGroupProber();
   38|       |
   39|       |    // Tell the Hebrew prober about the logical and visual probers
   40|  3.22k|    if (mProbers[10] && mProbers[11] && mProbers[12]) { // all are not null
  ------------------
  |  Branch (40:9): [True: 3.22k, False: 0]
  |  Branch (40:25): [True: 3.22k, False: 0]
  |  Branch (40:41): [True: 3.22k, False: 0]
  ------------------
   41|  3.22k|        hebprober->SetModelProbers(mProbers[11], mProbers[12]);
   42|  3.22k|    } else { // One or more is null. avoid any Hebrew probing, null them all
   43|      0|        for (unsigned int i = 10; i <= 12; ++i) {
  ------------------
  |  Branch (43:35): [True: 0, False: 0]
  ------------------
   44|      0|            delete mProbers[i];
   45|      0|            mProbers[i] = nullptr;
   46|      0|        }
   47|      0|    }
   48|       |
   49|       |    // disable latin2 before latin1 is available, otherwise all latin1
   50|       |    // will be detected as latin2 because of their similarity.
   51|       |    // mProbers[10] = new nsSingleByteCharSetProber(&Latin2HungarianModel);
   52|       |    // mProbers[11] = new nsSingleByteCharSetProber(&Win1250HungarianModel);
   53|       |
   54|  3.22k|    Reset();
   55|  3.22k|}
_ZN15kencodingprober17nsSBCSGroupProberD2Ev:
   58|  3.22k|{
   59|  48.3k|    for (unsigned int i = 0; i < NUM_OF_SBCS_PROBERS; i++) {
  ------------------
  |  |   15|  48.3k|#define NUM_OF_SBCS_PROBERS 14
  ------------------
  |  Branch (59:30): [True: 45.0k, False: 3.22k]
  ------------------
   60|  45.0k|        delete mProbers[i];
   61|  45.0k|    }
   62|  3.22k|}
_ZN15kencodingprober17nsSBCSGroupProber14GetCharSetNameEv:
   65|     78|{
   66|       |    // if we have no answer yet
   67|     78|    if (mBestGuess == -1) {
  ------------------
  |  Branch (67:9): [True: 0, False: 78]
  ------------------
   68|      0|        GetConfidence();
   69|       |        // no charset seems positive
   70|      0|        if (mBestGuess == -1)
  ------------------
  |  Branch (70:13): [True: 0, False: 0]
  ------------------
   71|       |        // we will use default.
   72|      0|        {
   73|      0|            mBestGuess = 0;
   74|      0|        }
   75|      0|    }
   76|     78|    return mProbers[mBestGuess]->GetCharSetName();
   77|     78|}
_ZN15kencodingprober17nsSBCSGroupProber5ResetEv:
   80|  3.22k|{
   81|  3.22k|    mActiveNum = 0;
   82|  48.3k|    for (unsigned int i = 0; i < NUM_OF_SBCS_PROBERS; i++) {
  ------------------
  |  |   15|  48.3k|#define NUM_OF_SBCS_PROBERS 14
  ------------------
  |  Branch (82:30): [True: 45.0k, False: 3.22k]
  ------------------
   83|  45.0k|        if (mProbers[i]) { // not null
  ------------------
  |  Branch (83:13): [True: 45.0k, False: 0]
  ------------------
   84|  45.0k|            mProbers[i]->Reset();
   85|  45.0k|            mIsActive[i] = true;
   86|  45.0k|            ++mActiveNum;
   87|  45.0k|        } else {
   88|      0|            mIsActive[i] = false;
   89|      0|        }
   90|  45.0k|    }
   91|  3.22k|    mBestGuess = -1;
   92|  3.22k|    mState = eDetecting;
   93|  3.22k|}
_ZN15kencodingprober17nsSBCSGroupProber10HandleDataEPKcj:
   96|  3.22k|{
   97|  3.22k|    nsProbingState st;
   98|  3.22k|    unsigned int i;
   99|  3.22k|    char *newBuf1 = nullptr;
  100|  3.22k|    unsigned int newLen1 = 0;
  101|       |
  102|       |    // apply filter to original buffer, and we got new buffer back
  103|       |    // depend on what script it is, we will feed them the new buffer
  104|       |    // we got after applying proper filter
  105|       |    // this is done without any consideration to KeepEnglishLetters
  106|       |    // of each prober since as of now, there are no probers here which
  107|       |    // recognize languages with English characters.
  108|  3.22k|    if (!FilterWithoutEnglishLetters(aBuf, aLen, &newBuf1, newLen1)) {
  ------------------
  |  Branch (108:9): [True: 0, False: 3.22k]
  ------------------
  109|      0|        goto done;
  110|      0|    }
  111|       |
  112|  3.22k|    if (newLen1 == 0) {
  ------------------
  |  Branch (112:9): [True: 607, False: 2.61k]
  ------------------
  113|    607|        goto done; // Nothing to see here, move on.
  114|    607|    }
  115|       |
  116|  38.7k|    for (i = 0; i < NUM_OF_SBCS_PROBERS; ++i) {
  ------------------
  |  |   15|  38.7k|#define NUM_OF_SBCS_PROBERS 14
  ------------------
  |  Branch (116:17): [True: 36.2k, False: 2.45k]
  ------------------
  117|  36.2k|        if (!mIsActive[i]) {
  ------------------
  |  Branch (117:13): [True: 0, False: 36.2k]
  ------------------
  118|      0|            continue;
  119|      0|        }
  120|  36.2k|        st = mProbers[i]->HandleData(newBuf1, newLen1);
  121|  36.2k|        if (st == eFoundIt) {
  ------------------
  |  Branch (121:13): [True: 156, False: 36.1k]
  ------------------
  122|    156|            mBestGuess = i;
  123|    156|            mState = eFoundIt;
  124|    156|            break;
  125|  36.1k|        } else if (st == eNotMe) {
  ------------------
  |  Branch (125:20): [True: 1.67k, False: 34.4k]
  ------------------
  126|  1.67k|            mIsActive[i] = false;
  127|  1.67k|            mActiveNum--;
  128|  1.67k|            if (mActiveNum == 0) {
  ------------------
  |  Branch (128:17): [True: 0, False: 1.67k]
  ------------------
  129|      0|                mState = eNotMe;
  130|      0|                break;
  131|      0|            }
  132|  1.67k|        }
  133|  36.2k|    }
  134|       |
  135|  3.22k|done:
  136|  3.22k|    free(newBuf1);
  137|       |
  138|  3.22k|    return mState;
  139|  2.61k|}

_ZN15kencodingprober25nsSingleByteCharSetProber10HandleDataEPKcj:
   14|  31.1k|{
   15|   774M|    for (unsigned int i = 0; i < aLen; i++) {
  ------------------
  |  Branch (15:30): [True: 774M, False: 31.1k]
  ------------------
   16|   774M|        const unsigned char order = mModel->charToOrderMap[(unsigned char)aBuf[i]];
   17|       |
   18|   774M|        if (order < SYMBOL_CAT_ORDER) {
  ------------------
  |  |   16|   774M|#define SYMBOL_CAT_ORDER 250
  ------------------
  |  Branch (18:13): [True: 629M, False: 145M]
  ------------------
   19|   629M|            mTotalChar++;
   20|   629M|        }
   21|   774M|        if (order < SAMPLE_SIZE) {
  ------------------
  |  |   12|   774M|#define SAMPLE_SIZE 64
  ------------------
  |  Branch (21:13): [True: 195M, False: 579M]
  ------------------
   22|   195M|            mFreqChar++;
   23|       |
   24|   195M|            if (mLastOrder < SAMPLE_SIZE) {
  ------------------
  |  |   12|   195M|#define SAMPLE_SIZE 64
  ------------------
  |  Branch (24:17): [True: 155M, False: 40.3M]
  ------------------
   25|   155M|                mTotalSeqs++;
   26|   155M|                if (!mReversed) {
  ------------------
  |  Branch (26:21): [True: 150M, False: 5.22M]
  ------------------
   27|   150M|                    ++(mSeqCounters[(int)mModel->precedenceMatrix[mLastOrder * SAMPLE_SIZE + order]]);
  ------------------
  |  |   12|   150M|#define SAMPLE_SIZE 64
  ------------------
   28|   150M|                } else { // reverse the order of the letters in the lookup
   29|  5.22M|                    ++(mSeqCounters[(int)mModel->precedenceMatrix[order * SAMPLE_SIZE + mLastOrder]]);
  ------------------
  |  |   12|  5.22M|#define SAMPLE_SIZE 64
  ------------------
   30|  5.22M|                }
   31|   155M|            }
   32|   195M|        }
   33|   774M|        mLastOrder = order;
   34|   774M|    }
   35|       |
   36|  31.1k|    if (mState == eDetecting) {
  ------------------
  |  Branch (36:9): [True: 31.1k, False: 0]
  ------------------
   37|  31.1k|        if (mTotalSeqs > SB_ENOUGH_REL_THRESHOLD) {
  ------------------
  |  |   13|  31.1k|#define SB_ENOUGH_REL_THRESHOLD 1024
  ------------------
  |  Branch (37:13): [True: 2.24k, False: 28.9k]
  ------------------
   38|  2.24k|            float cf = GetConfidence();
   39|  2.24k|            if (cf > POSITIVE_SHORTCUT_THRESHOLD) {
  ------------------
  |  |   14|  2.24k|#define POSITIVE_SHORTCUT_THRESHOLD (float)0.95
  ------------------
  |  Branch (39:17): [True: 142, False: 2.10k]
  ------------------
   40|    142|                mState = eFoundIt;
   41|  2.10k|            } else if (cf < NEGATIVE_SHORTCUT_THRESHOLD) {
  ------------------
  |  |   15|  2.10k|#define NEGATIVE_SHORTCUT_THRESHOLD (float)0.05
  ------------------
  |  Branch (41:24): [True: 1.32k, False: 782]
  ------------------
   42|  1.32k|                mState = eNotMe;
   43|  1.32k|            }
   44|  2.24k|        }
   45|  31.1k|    }
   46|       |
   47|  31.1k|    return mState;
   48|  31.1k|}
_ZN15kencodingprober25nsSingleByteCharSetProber5ResetEv:
   51|  77.2k|{
   52|  77.2k|    mState = eDetecting;
   53|  77.2k|    mLastOrder = 255;
   54|   386k|    for (unsigned int i = 0; i < NUMBER_OF_SEQ_CAT; i++) {
  ------------------
  |  |   17|   386k|#define NUMBER_OF_SEQ_CAT 4
  ------------------
  |  Branch (54:30): [True: 309k, False: 77.2k]
  ------------------
   55|   309k|        mSeqCounters[i] = 0;
   56|   309k|    }
   57|  77.2k|    mTotalSeqs = 0;
   58|  77.2k|    mTotalChar = 0;
   59|  77.2k|    mFreqChar = 0;
   60|  77.2k|}
_ZN15kencodingprober25nsSingleByteCharSetProber13GetConfidenceEv:
   65|  2.27k|{
   66|       |#ifdef NEGATIVE_APPROACH
   67|       |    if (mTotalSeqs > 0)
   68|       |        if (mTotalSeqs > mSeqCounters[NEGATIVE_CAT] * 10) {
   69|       |            return ((float)(mTotalSeqs - mSeqCounters[NEGATIVE_CAT] * 10)) / mTotalSeqs * mFreqChar / mTotalChar;
   70|       |        }
   71|       |    return (float)0.01;
   72|       |#else // POSITIVE_APPROACH
   73|  2.27k|    float r;
   74|       |
   75|  2.27k|    if (mTotalSeqs > 0) {
  ------------------
  |  Branch (75:9): [True: 2.26k, False: 7]
  ------------------
   76|  2.26k|        r = ((float)1.0) * mSeqCounters[POSITIVE_CAT] / mTotalSeqs / mModel->mTypicalPositiveRatio;
  ------------------
  |  |   18|  2.26k|#define POSITIVE_CAT (NUMBER_OF_SEQ_CAT - 1)
  |  |  ------------------
  |  |  |  |   17|  2.26k|#define NUMBER_OF_SEQ_CAT 4
  |  |  ------------------
  ------------------
   77|  2.26k|        r = r * mFreqChar / mTotalChar;
   78|  2.26k|        if (r >= (float)1.00) {
  ------------------
  |  Branch (78:13): [True: 58, False: 2.20k]
  ------------------
   79|     58|            r = (float)0.99;
   80|     58|        }
   81|  2.26k|        return r;
   82|  2.26k|    }
   83|      7|    return (float)0.01;
   84|  2.27k|#endif
   85|  2.27k|}
_ZN15kencodingprober25nsSingleByteCharSetProber14GetCharSetNameEv:
   88|     71|{
   89|     71|    if (!mNameProber) {
  ------------------
  |  Branch (89:9): [True: 8, False: 63]
  ------------------
   90|      8|        return mModel->charsetName;
   91|      8|    }
   92|     63|    return mNameProber->GetCharSetName();
   93|     71|}

_ZN15kencodingprober25nsSingleByteCharSetProberC2EPKNS_13SequenceModelE:
   35|  32.2k|        : mModel(model)
   36|  32.2k|        , mReversed(false)
   37|  32.2k|        , mNameProber(nullptr)
   38|  32.2k|    {
   39|  32.2k|        Reset();
   40|  32.2k|    }
_ZN15kencodingprober25nsSingleByteCharSetProberC2EPKNS_13SequenceModelEbPNS_15nsCharSetProberE:
   42|  6.44k|        : mModel(model)
   43|  6.44k|        , mReversed(reversed)
   44|  6.44k|        , mNameProber(nameProber)
   45|  6.44k|    {
   46|  6.44k|        Reset();
   47|  6.44k|    }
_ZN15kencodingprober25nsSingleByteCharSetProber8GetStateEv:
   52|  2.59k|    {
   53|  2.59k|        return mState;
   54|  2.59k|    }

_ZN15kencodingprober12nsSJISProber5ResetEv:
   17|  12.2k|{
   18|  12.2k|    mCodingSM->Reset();
   19|  12.2k|    mState = eDetecting;
   20|  12.2k|    mContextAnalyser.Reset();
   21|  12.2k|    mDistributionAnalyser.Reset();
   22|  12.2k|}
_ZN15kencodingprober12nsSJISProber10HandleDataEPKcj:
   25|  7.07k|{
   26|  7.07k|    if (aLen == 0) {
  ------------------
  |  Branch (26:9): [True: 0, False: 7.07k]
  ------------------
   27|      0|        return mState;
   28|      0|    }
   29|       |
   30|  70.2M|    for (unsigned int i = 0; i < aLen; i++) {
  ------------------
  |  Branch (30:30): [True: 70.2M, False: 4.79k]
  ------------------
   31|  70.2M|        const nsSMState codingState = mCodingSM->NextState(aBuf[i]);
   32|  70.2M|        if (codingState == eError) {
  ------------------
  |  Branch (32:13): [True: 2.27k, False: 70.2M]
  ------------------
   33|  2.27k|            mState = eNotMe;
   34|  2.27k|            break;
   35|  2.27k|        }
   36|  70.2M|        if (codingState == eItsMe) {
  ------------------
  |  Branch (36:13): [True: 0, False: 70.2M]
  ------------------
   37|      0|            mState = eFoundIt;
   38|      0|            break;
   39|      0|        }
   40|  70.2M|        if (codingState == eStart) {
  ------------------
  |  Branch (40:13): [True: 69.9M, False: 287k]
  ------------------
   41|  69.9M|            unsigned int charLen = mCodingSM->GetCurrentCharLen();
   42|  69.9M|            if (i == 0) {
  ------------------
  |  Branch (42:17): [True: 5.26k, False: 69.9M]
  ------------------
   43|  5.26k|                mLastChar[1] = aBuf[0];
   44|  5.26k|                mContextAnalyser.HandleOneChar(mLastChar + 2 - charLen, charLen);
   45|  5.26k|                mDistributionAnalyser.HandleOneChar(mLastChar, charLen);
   46|  69.9M|            } else {
   47|  69.9M|                mContextAnalyser.HandleOneChar(aBuf + i + 1 - charLen, charLen);
   48|  69.9M|                mDistributionAnalyser.HandleOneChar(aBuf + i - 1, charLen);
   49|  69.9M|            }
   50|  69.9M|        }
   51|  70.2M|    }
   52|       |
   53|  7.07k|    mLastChar[0] = aBuf[aLen - 1];
   54|       |
   55|  7.07k|    if (mState == eDetecting) {
  ------------------
  |  Branch (55:9): [True: 4.79k, False: 2.27k]
  ------------------
   56|  4.79k|        if (mContextAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD) {
  ------------------
  |  |   20|    160|#define SHORTCUT_THRESHOLD (float)0.95
  ------------------
  |  Branch (56:13): [True: 160, False: 4.63k]
  |  Branch (56:49): [True: 131, False: 29]
  ------------------
   57|    131|            mState = eFoundIt;
   58|    131|        }
   59|  4.79k|    }
   60|       |
   61|  7.07k|    return mState;
   62|  7.07k|}
_ZN15kencodingprober12nsSJISProber13GetConfidenceEv:
   65|    160|{
   66|    160|    float contxtCf = mContextAnalyser.GetConfidence();
   67|    160|    float distribCf = mDistributionAnalyser.GetConfidence();
   68|       |
   69|    160|    return (contxtCf > distribCf ? contxtCf : distribCf);
  ------------------
  |  Branch (69:13): [True: 37, False: 123]
  ------------------
   70|    160|}

_ZN15kencodingprober12nsSJISProberC2Ev:
   28|  7.08k|    {
   29|  7.08k|        mCodingSM = new nsCodingStateMachine(&SJISSMModel);
   30|  7.08k|        Reset();
   31|  7.08k|    }
_ZN15kencodingprober12nsSJISProberD2Ev:
   33|  7.08k|    {
   34|  7.08k|        delete mCodingSM;
   35|  7.08k|    }
_ZN15kencodingprober12nsSJISProber14GetCharSetNameEv:
   38|     34|    {
   39|     34|        return "Shift_JIS";
   40|     34|    }

_ZN15kencodingprober19nsUniversalDetectorC2Ev:
   18|  1.93k|{
   19|  1.93k|    mDone = false;
   20|  1.93k|    mBestGuess = -1; // illegal value as signal
   21|  1.93k|    mInTag = false;
   22|  1.93k|    mEscCharSetProber = nullptr;
   23|       |
   24|  1.93k|    mStart = true;
   25|  1.93k|    mDetectedCharset = nullptr;
   26|  1.93k|    mGotData = false;
   27|  1.93k|    mInputState = ePureAscii;
   28|  1.93k|    mLastChar = '\0';
   29|       |
   30|  1.93k|    unsigned int i;
   31|  7.73k|    for (i = 0; i < NUM_OF_CHARSET_PROBERS; i++) {
  ------------------
  |  |   13|  7.73k|#define NUM_OF_CHARSET_PROBERS 3
  ------------------
  |  Branch (31:17): [True: 5.79k, False: 1.93k]
  ------------------
   32|  5.79k|        mCharSetProbers[i] = nullptr;
   33|  5.79k|    }
   34|  1.93k|}
_ZN15kencodingprober19nsUniversalDetectorD2Ev:
   37|  1.93k|{
   38|  7.73k|    for (int i = 0; i < NUM_OF_CHARSET_PROBERS; i++) {
  ------------------
  |  |   13|  7.73k|#define NUM_OF_CHARSET_PROBERS 3
  ------------------
  |  Branch (38:21): [True: 5.79k, False: 1.93k]
  ------------------
   39|  5.79k|        delete mCharSetProbers[i];
   40|  5.79k|    }
   41|  1.93k|    delete mEscCharSetProber;
   42|  1.93k|}
_ZN15kencodingprober19nsUniversalDetector10HandleDataEPKcj:
   73|  1.93k|{
   74|  1.93k|    if (mDone) {
  ------------------
  |  Branch (74:9): [True: 0, False: 1.93k]
  ------------------
   75|      0|        return eFoundIt;
   76|      0|    }
   77|       |
   78|  1.93k|    if (aLen > 0) {
  ------------------
  |  Branch (78:9): [True: 1.93k, False: 0]
  ------------------
   79|  1.93k|        mGotData = true;
   80|  1.93k|    }
   81|       |
   82|  1.93k|    unsigned int i;
   83|  39.2M|    for (i = 0; i < aLen; i++) {
  ------------------
  |  Branch (83:17): [True: 39.2M, False: 1.93k]
  ------------------
   84|       |        // other than 0xa0, if every other character is ascii, the page is ascii
   85|  39.2M|        if (aBuf[i] & '\x80' && aBuf[i] != '\xA0') { // Since many Ascii only page contains NBSP
  ------------------
  |  Branch (85:13): [True: 29.9M, False: 9.33M]
  |  Branch (85:33): [True: 29.9M, False: 3.48k]
  ------------------
   86|       |            // we got a non-ascii byte (high-byte)
   87|  29.9M|            if (mInputState != eHighbyte) {
  ------------------
  |  Branch (87:17): [True: 1.28k, False: 29.9M]
  ------------------
   88|       |                // adjust state
   89|  1.28k|                mInputState = eHighbyte;
   90|       |
   91|       |                // kill mEscCharSetProber if it is active
   92|  1.28k|                delete mEscCharSetProber;
   93|  1.28k|                mEscCharSetProber = nullptr;
   94|       |
   95|       |                // start multibyte and singlebyte charset prober
   96|  1.28k|                if (nullptr == mCharSetProbers[0]) {
  ------------------
  |  Branch (96:21): [True: 1.28k, False: 0]
  ------------------
   97|  1.28k|                    mCharSetProbers[0] = new nsMBCSGroupProber;
   98|  1.28k|                }
   99|  1.28k|                if (nullptr == mCharSetProbers[1]) {
  ------------------
  |  Branch (99:21): [True: 1.28k, False: 0]
  ------------------
  100|  1.28k|                    mCharSetProbers[1] = new nsSBCSGroupProber;
  101|  1.28k|                }
  102|  1.28k|                if (nullptr == mCharSetProbers[2]) {
  ------------------
  |  Branch (102:21): [True: 1.28k, False: 0]
  ------------------
  103|  1.28k|                    mCharSetProbers[2] = new nsLatin1Prober;
  104|  1.28k|                }
  105|  1.28k|            }
  106|  29.9M|        } else {
  107|       |            // ok, just pure ascii so far
  108|  9.34M|            if (ePureAscii == mInputState && (aBuf[i] == '\033' || (aBuf[i] == '{' && mLastChar == '~'))) {
  ------------------
  |  Branch (108:17): [True: 3.17M, False: 6.16M]
  |  Branch (108:47): [True: 46, False: 3.17M]
  |  Branch (108:69): [True: 843, False: 3.17M]
  |  Branch (108:87): [True: 17, False: 826]
  ------------------
  109|       |                // found escape character or HZ "~{"
  110|     63|                mInputState = eEscAscii;
  111|     63|            }
  112|       |
  113|  9.34M|            mLastChar = aBuf[i];
  114|  9.34M|        }
  115|  39.2M|    }
  116|       |
  117|  1.93k|    nsProbingState st = eDetecting;
  118|  1.93k|    switch (mInputState) {
  119|     37|    case eEscAscii:
  ------------------
  |  Branch (119:5): [True: 37, False: 1.89k]
  ------------------
  120|     37|        if (nullptr == mEscCharSetProber) {
  ------------------
  |  Branch (120:13): [True: 37, False: 0]
  ------------------
  121|     37|            mEscCharSetProber = new nsEscCharSetProber;
  122|     37|        }
  123|     37|        st = mEscCharSetProber->HandleData(aBuf, aLen);
  124|     37|        if (st == eFoundIt) {
  ------------------
  |  Branch (124:13): [True: 3, False: 34]
  ------------------
  125|      3|            mDone = true;
  126|      3|            mDetectedCharset = mEscCharSetProber->GetCharSetName();
  127|      3|        }
  128|     37|        break;
  129|  1.28k|    case eHighbyte:
  ------------------
  |  Branch (129:5): [True: 1.28k, False: 646]
  ------------------
  130|  5.14k|        for (i = 0; i < NUM_OF_CHARSET_PROBERS; ++i) {
  ------------------
  |  |   13|  5.14k|#define NUM_OF_CHARSET_PROBERS 3
  ------------------
  |  Branch (130:21): [True: 3.86k, False: 1.28k]
  ------------------
  131|  3.86k|            st = mCharSetProbers[i]->HandleData(aBuf, aLen);
  132|  3.86k|            if (st == eFoundIt) {
  ------------------
  |  Branch (132:17): [True: 192, False: 3.66k]
  ------------------
  133|    192|                mDone = true;
  134|    192|                mDetectedCharset = mCharSetProbers[i]->GetCharSetName();
  135|    192|            }
  136|  3.86k|        }
  137|  1.28k|        break;
  138|       |
  139|    609|    default: // pure ascii
  ------------------
  |  Branch (139:5): [True: 609, False: 1.32k]
  ------------------
  140|    609|        mDetectedCharset = "UTF-8";
  141|  1.93k|    }
  142|  1.93k|    return st;
  143|  1.93k|}

LLVMFuzzerTestOneInput:
   46|  1.93k|{
   47|  1.93k|    int argc = 0;
   48|  1.93k|    QCoreApplication a(argc, nullptr);
   49|       |
   50|  1.93k|    const QVector<kencodingprober::nsCharSetProber*> probers = {
   51|  1.93k|        new kencodingprober::JapaneseGroupProber(),
   52|  1.93k|        new kencodingprober::nsBig5Prober(),
   53|  1.93k|        new kencodingprober::nsEUCJPProber(),
   54|  1.93k|        new kencodingprober::nsGB18030Prober(),
   55|  1.93k|        new kencodingprober::nsLatin1Prober(),
   56|  1.93k|        new kencodingprober::nsSBCSGroupProber(),
   57|  1.93k|        new kencodingprober::nsUniversalDetector(),
   58|  1.93k|        new kencodingprober::ChineseGroupProber(),
   59|  1.93k|        new kencodingprober::nsEscCharSetProber(),
   60|  1.93k|        new kencodingprober::nsEUCKRProber(),
   61|  1.93k|        new kencodingprober::nsMBCSGroupProber(),
   62|  1.93k|        new kencodingprober::nsSJISProber(),
   63|  1.93k|        new kencodingprober::UnicodeGroupProber()
   64|  1.93k|    };
   65|       |
   66|  25.1k|    for (kencodingprober::nsCharSetProber *p : probers) {
  ------------------
  |  Branch (66:46): [True: 25.1k, False: 1.93k]
  ------------------
   67|  25.1k|        p->HandleData((const char*)data, size);
   68|  25.1k|    }
   69|       |
   70|  1.93k|    qDeleteAll(probers);
   71|       |
   72|  1.93k|    const QByteArray ba((const char *)data, size);
   73|  1.93k|    const QVector<const char*> codecs = { "base64", "quoted-printable", "b", "q", "x-kmime-rfc2231", "x-uuencode" };
   74|  11.5k|    for (const char *codecName : codecs) {
  ------------------
  |  Branch (74:32): [True: 11.5k, False: 1.93k]
  ------------------
   75|  11.5k|        KCodecs::Codec *c = KCodecs::Codec::codecForName(codecName);
   76|  11.5k|        c->encode(ba, KCodecs::Codec::NewlineCRLF);
   77|  11.5k|        c->decode(ba, KCodecs::Codec::NewlineCRLF);
   78|  11.5k|        c->encode(ba, KCodecs::Codec::NewlineLF);
   79|  11.5k|        c->decode(ba, KCodecs::Codec::NewlineLF);
   80|  11.5k|    }
   81|       |
   82|  1.93k|    return 0;
   83|  1.93k|}

_ZN7QThread8finishedENS_14QPrivateSignalE:
  165|      1|{
  166|      1|    QMetaObject::activate<void>(this, &staticMetaObject, 1, nullptr, _t1);
  167|      1|}

_ZN9QtPrivate25CompareAgainstLiteralZeroC2EMS0_FvvE:
   24|      1|    Q_IMPLICIT constexpr CompareAgainstLiteralZero(SafeZero) noexcept {}

_Z14qFromUnalignedIjET_PKv:
   48|      6|{
   49|      6|    T dest;
   50|      6|    const size_t size = sizeof(T);
   51|      6|#if __has_builtin(__builtin_memcpy)
   52|      6|    __builtin_memcpy
   53|       |#else
   54|       |    memcpy
   55|       |#endif
   56|      6|            (&dest, src, size);
   57|      6|    return dest;
   58|      6|}
_Z14qFromUnalignedIN16QRandomGenerator17InitialRandomDataEET_PKv:
   48|      2|{
   49|      2|    T dest;
   50|      2|    const size_t size = sizeof(T);
   51|      2|#if __has_builtin(__builtin_memcpy)
   52|      2|    __builtin_memcpy
   53|       |#else
   54|       |    memcpy
   55|       |#endif
   56|      2|            (&dest, src, size);
   57|      2|    return dest;
   58|      2|}

_ZN9QInternal17activateCallbacksENS_8CallbackEPPv:
  156|  1.93k|{
  157|  1.93k|    Q_ASSERT_X(cb >= 0, "QInternal::activateCallback()", "Callback id must be a valid id");
  158|       |
  159|  1.93k|    if (!global_callback_table.exists())
  ------------------
  |  Branch (159:9): [True: 1.93k, False: 0]
  ------------------
  160|  1.93k|        return false;
  161|       |
  162|      0|    QInternal_CallBackTable *cbt = &(*global_callback_table);
  163|      0|    if (cbt && cb < cbt->callbacks.size()) {
  ------------------
  |  Branch (163:9): [True: 0, False: 0]
  |  Branch (163:16): [True: 0, False: 0]
  ------------------
  164|      0|        QList<qInternalCallback> callbacks = cbt->callbacks[cb];
  165|      0|        bool ret = false;
  166|      0|        for (int i = 0; i < callbacks.size(); ++i)
  ------------------
  |  Branch (166:25): [True: 0, False: 0]
  ------------------
  167|      0|            ret |= (callbacks.at(i))(parameters);
  168|      0|        return ret;
  169|      0|    }
  170|      0|    return false;
  171|      0|}

_ZN16QLibrarySettingsC2Ev:
   57|      1|QLibrarySettings::QLibrarySettings() : paths(false), reloadOnQAppAvailable(false)
   58|      1|{
   59|      1|    load();
   60|      1|}
_ZN16QLibrarySettings9havePathsEv:
   70|      2|{
   71|      2|    if (reloadOnQAppAvailable && QCoreApplication::instance() != nullptr)
  ------------------
  |  Branch (71:9): [True: 2, False: 0]
  |  Branch (71:34): [True: 0, False: 2]
  ------------------
   72|      0|        load();
   73|      2|    return paths;
   74|      2|}
_ZN16QLibrarySettings4loadEv:
   77|      1|{
   78|       |    // If we get any settings here, those won't change when the application shows up.
   79|      1|    settings = findConfiguration();
   80|      1|    reloadOnQAppAvailable = !settings && !QCoreApplication::instance();
  ------------------
  |  Branch (80:29): [True: 1, False: 0]
  |  Branch (80:42): [True: 1, False: 0]
  ------------------
   81|       |
   82|      1|    if (settings) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1]
  ------------------
   83|       |        // This code needs to be in the regular library, as otherwise a qt.conf that
   84|       |        // works for qmake would break things for dynamically built Qt tools.
   85|      0|        QStringList children = settings->childGroups();
   86|      0|        paths = !children.contains("Platforms"_L1)
  ------------------
  |  Branch (86:17): [True: 0, False: 0]
  ------------------
   87|      0|                || children.contains("Paths"_L1);
  ------------------
  |  Branch (87:20): [True: 0, False: 0]
  ------------------
   88|      0|    }
   89|      1|}
_ZN12QLibraryInfo4pathENS_11LibraryPathE:
  522|      1|{
  523|      1|    return QLibraryInfoPrivate::path(p);
  524|      1|}
_ZN19QLibraryInfoPrivate5pathsEN12QLibraryInfo11LibraryPathENS_9UsageModeE:
  605|      2|{
  606|      2|    const QLibraryInfo::LibraryPath loc = p;
  607|      2|    QList<QString> ret;
  608|      2|    bool fromConf = false;
  609|      2|#if QT_CONFIG(settings)
  610|      2|    if (havePaths()) {
  ------------------
  |  Branch (610:9): [True: 0, False: 2]
  ------------------
  611|      0|        fromConf = true;
  612|       |
  613|      0|        QVariant value = libraryPathToValue(loc);
  614|      0|        if (value.isValid()) {
  ------------------
  |  Branch (614:13): [True: 0, False: 0]
  ------------------
  615|       |
  616|      0|            if (auto *asList = get_if<QList<QString>>(&value))
  ------------------
  |  Branch (616:23): [True: 0, False: 0]
  ------------------
  617|      0|                ret = std::move(*asList);
  618|      0|            else
  619|      0|                ret = QList<QString>({ std::move(value).toString()});
  620|      0|            for (qsizetype i = 0, end = ret.size(); i < end; ++i)
  ------------------
  |  Branch (620:53): [True: 0, False: 0]
  ------------------
  621|      0|                ret[i] = normalizePath(ret[i]);
  622|      0|        }
  623|      0|    }
  624|      2|#endif // settings
  625|       |
  626|      2|    if (!fromConf || keepQtBuildDefaults()) {
  ------------------
  |  Branch (626:9): [True: 2, False: 0]
  |  Branch (626:22): [True: 0, False: 0]
  ------------------
  627|      2|        QString noConfResult;
  628|      2|        if (loc == QLibraryInfo::PrefixPath) {
  ------------------
  |  Branch (628:13): [True: 1, False: 1]
  ------------------
  629|      1|            noConfResult = getPrefix(usageMode);
  630|      1|        } else if (int(loc) <= qt_configure_strs.count()) {
  ------------------
  |  Branch (630:20): [True: 1, False: 0]
  ------------------
  631|      1|            noConfResult = QString::fromLocal8Bit(qt_configure_strs.viewAt(loc - 1));
  632|      1|#ifndef Q_OS_WIN // On Windows we use the registry
  633|      1|        } else if (loc == QLibraryInfo::SettingsPath) {
  ------------------
  |  Branch (633:20): [True: 0, False: 0]
  ------------------
  634|       |            // Use of volatile is a hack to discourage compilers from calling
  635|       |            // strlen(), in the inlined fromLocal8Bit(const char *)'s body, at
  636|       |            // compile-time, as Qt installers binary-patch the path, replacing
  637|       |            // the dummy path seen at compile-time, typically changing length.
  638|      0|            const char *volatile path = QT_CONFIGURE_SETTINGS_PATH;
  ------------------
  |  |   29|      0|#define QT_CONFIGURE_SETTINGS_PATH "etc/xdg"
  ------------------
  639|      0|            noConfResult = QString::fromLocal8Bit(path);
  640|      0|#endif
  641|      0|        }
  642|      2|        if (!noConfResult.isEmpty())
  ------------------
  |  Branch (642:13): [True: 2, False: 0]
  ------------------
  643|      2|            ret.push_back(std::move(noConfResult));
  644|      2|    }
  645|      2|    if (ret.isEmpty())
  ------------------
  |  Branch (645:9): [True: 0, False: 2]
  ------------------
  646|      0|        return ret;
  647|       |
  648|      2|    QString baseDir;
  649|      2|    if (loc == QLibraryInfo::PrefixPath) {
  ------------------
  |  Branch (649:9): [True: 1, False: 1]
  ------------------
  650|      1|        baseDir = prefixFromAppDirHelper();
  651|      1|    } else {
  652|       |        // we make any other path absolute to the prefix directory
  653|      1|        baseDir = QLibraryInfoPrivate::path(QLibraryInfo::PrefixPath, usageMode);
  654|      1|    }
  655|      4|    for (qsizetype i = 0, end = ret.size(); i < end; ++i)
  ------------------
  |  Branch (655:45): [True: 2, False: 2]
  ------------------
  656|      2|        if (QDir::isRelativePath(ret[i]))
  ------------------
  |  Branch (656:13): [True: 1, False: 1]
  ------------------
  657|      1|            ret[i] = QDir::cleanPath(baseDir + u'/' +  std::move(ret[i]));
  658|      2|    return ret;
  659|      2|}
_ZN19QLibraryInfoPrivate4pathEN12QLibraryInfo11LibraryPathENS_9UsageModeE:
  668|      2|{
  669|      2|    return paths(p, usageMode).value(0, QString());
  670|      2|}
qlibraryinfo.cpp:_ZL17findConfigurationv:
  101|      1|{
  102|      1|    if (qtconfManualPath)
  ------------------
  |  Branch (102:9): [True: 0, False: 1]
  ------------------
  103|      0|        return std::make_unique<QSettings>(*qtconfManualPath, QSettings::IniFormat);
  104|       |
  105|      1|    QString qtconfig = QStringLiteral(":/qt/etc/qt.conf");
  106|      1|    if (QFile::exists(qtconfig))
  ------------------
  |  Branch (106:9): [True: 0, False: 1]
  ------------------
  107|      0|        return std::make_unique<QSettings>(qtconfig, QSettings::IniFormat);
  108|       |#ifdef Q_OS_DARWIN
  109|       |    CFBundleRef bundleRef = CFBundleGetMainBundle();
  110|       |    if (bundleRef) {
  111|       |        QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef,
  112|       |                                                           QCFString("qt.conf"_L1),
  113|       |                                                           0,
  114|       |                                                           0);
  115|       |        if (urlRef) {
  116|       |            QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
  117|       |            qtconfig = QDir::cleanPath(path);
  118|       |            if (QFile::exists(qtconfig))
  119|       |                return std::make_unique<QSettings>(qtconfig, QSettings::IniFormat);
  120|       |        }
  121|       |    }
  122|       |#endif
  123|      1|    if (QCoreApplication::instance()) {
  ------------------
  |  Branch (123:9): [True: 0, False: 1]
  ------------------
  124|      0|        QDir pwd(QCoreApplication::applicationDirPath());
  125|      0|        qtconfig = pwd.filePath(u"qt" QT_STRINGIFY(QT_VERSION_MAJOR) ".conf"_s);
  126|      0|        if (QFile::exists(qtconfig))
  ------------------
  |  Branch (126:13): [True: 0, False: 0]
  ------------------
  127|      0|            return std::make_unique<QSettings>(qtconfig, QSettings::IniFormat);
  128|      0|        qtconfig = pwd.filePath("qt.conf"_L1);
  129|      0|        if (QFile::exists(qtconfig))
  ------------------
  |  Branch (129:13): [True: 0, False: 0]
  ------------------
  130|      0|            return std::make_unique<QSettings>(qtconfig, QSettings::IniFormat);
  131|      0|    }
  132|      1|    return nullptr;     //no luck
  133|      1|}
qlibraryinfo.cpp:_ZL9havePathsv:
  147|      2|static bool havePaths() {
  148|      2|    QLibrarySettings *ls = qt_library_settings();
  149|      2|    return ls && ls->havePaths();
  ------------------
  |  Branch (149:12): [True: 2, False: 0]
  |  Branch (149:18): [True: 0, False: 2]
  ------------------
  150|      2|}
qlibraryinfo.cpp:_ZL9getPrefixN19QLibraryInfoPrivate9UsageModeE:
  449|      1|{
  450|       |#if QT_CONFIG(relocatable)
  451|       |    return getRelocatablePrefix(usageMode);
  452|       |#else
  453|      1|    Q_UNUSED(usageMode);
  454|      1|    return QString::fromLocal8Bit(QT_CONFIGURE_PREFIX_PATH);
  ------------------
  |  |   31|      1|#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12
  ------------------
  455|      1|#endif
  456|      1|}
qlibraryinfo.cpp:_ZL22prefixFromAppDirHelperv:
  271|      1|{
  272|      1|    if (QCoreApplication::instance()) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1]
  ------------------
  273|       |#ifdef Q_OS_DARWIN
  274|       |        CFBundleRef bundleRef = CFBundleGetMainBundle();
  275|       |        if (bundleRef) {
  276|       |            QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef);
  277|       |            if (urlRef) {
  278|       |                QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
  279|       |#ifdef Q_OS_MACOS
  280|       |                QString bundleContentsDir = QString(path) + "/Contents/"_L1;
  281|       |                if (QDir(bundleContentsDir).exists())
  282|       |                    return QDir::cleanPath(bundleContentsDir);
  283|       |#else
  284|       |                return QDir::cleanPath(QString(path)); // iOS
  285|       |#endif // Q_OS_MACOS
  286|       |            }
  287|       |        }
  288|       |#endif // Q_OS_DARWIN
  289|       |        // We make the prefix path absolute to the executable's directory.
  290|      0|        return QCoreApplication::applicationDirPath();
  291|      1|    } else {
  292|      1|        return QDir::currentPath();
  293|      1|    }
  294|      1|}

_ZNK14QMessageLogger7warningEPKcz:
  577|      1|{
  578|      1|    QInternalMessageLogContext ctxt(context);
  579|      1|    va_list ap;
  580|      1|    va_start(ap, msg); // use variable arg list
  581|      1|    qt_message(QtWarningMsg, ctxt, msg, ap);
  582|      1|    va_end(ap);
  583|      1|}
_ZNK14QMessageLogger7warningEv:
  634|   181k|{
  635|   181k|    QDebug dbg = QDebug(QtWarningMsg);
  636|   181k|    QMessageLogContext &ctxt = dbg.stream->context;
  637|   181k|    ctxt.copyContextFrom(context);
  638|   181k|    return dbg;
  639|   181k|}
_ZNK14QMessageLogger8criticalEv:
  736|  5.15k|{
  737|  5.15k|    QDebug dbg = QDebug(QtCriticalMsg);
  738|  5.15k|    QMessageLogContext &ctxt = dbg.stream->context;
  739|  5.15k|    ctxt.copyContextFrom(context);
  740|  5.15k|    return dbg;
  741|  5.15k|}
_ZN15QMessagePatternC2Ev:
 1144|      1|{
 1145|      1|    const QString envPattern = qEnvironmentVariable("QT_MESSAGE_PATTERN");
 1146|      1|    if (envPattern.isEmpty()) {
  ------------------
  |  Branch (1146:9): [True: 1, False: 0]
  ------------------
 1147|      1|        setDefaultPattern();
 1148|      1|        fromEnvironment = false;
 1149|      1|    } else {
 1150|      0|        setPattern(envPattern);
 1151|      0|        fromEnvironment = true;
 1152|      0|    }
 1153|      1|}
_ZN15QMessagePatternD2Ev:
 1155|      1|QMessagePattern::~QMessagePattern() = default;
_Z17qt_message_output9QtMsgTypeRK18QMessageLogContextRK7QString:
 2069|   186k|{
 2070|   186k|    QInternalMessageLogContext ctx(context);
 2071|   186k|    qt_message_print(msgType, ctx, message);
 2072|   186k|    if (isFatal(msgType))
  ------------------
  |  Branch (2072:9): [True: 0, False: 186k]
  ------------------
 2073|      0|        qt_message_fatal(msgType, ctx, message);
 2074|   186k|}
_ZN26QInternalMessageLogContext8initFromERK18QMessageLogContext:
 2302|   373k|{
 2303|   373k|    version = CurrentVersion + 1;
 2304|   373k|    copyContextFrom(logContext);
 2305|       |
 2306|   373k|#ifdef QLOGGING_HAVE_BACKTRACE
 2307|   373k|    if (backtrace.has_value())
  ------------------
  |  Branch (2307:9): [True: 0, False: 373k]
  ------------------
 2308|      0|        return 0;       // we have a stored backtrace, no need to get it again
 2309|       |
 2310|       |    // initializes the message pattern, if needed
 2311|   373k|    if (auto pattern = qMessagePattern())
  ------------------
  |  Branch (2311:14): [True: 373k, False: 0]
  ------------------
 2312|   373k|        return pattern->maxBacktraceDepth;
 2313|      0|#endif
 2314|       |
 2315|      0|    return 0;
 2316|   373k|}
_ZN18QMessageLogContext15copyContextFromERKS_:
 2327|   559k|{
 2328|   559k|    this->category = logContext.category;
 2329|   559k|    this->file = logContext.file;
 2330|   559k|    this->line = logContext.line;
 2331|   559k|    this->function = logContext.function;
 2332|   559k|    if (Q_UNLIKELY(version == CurrentVersion + 1))
 2333|   373k|        copyInternalContext(static_cast<QInternalMessageLogContext *>(this), logContext);
 2334|   559k|    return *this;
 2335|   559k|}
qlogging.cpp:_ZL10qt_message9QtMsgTypeRK18QMessageLogContextPKcP13__va_list_tag:
  337|      1|{
  338|      1|    QString buf = QString::vasprintf(msg, ap);
  339|      1|    qt_message_print(msgType, context, buf);
  340|       |
  341|      1|    if (isFatal(msgType))
  ------------------
  |  Branch (341:9): [True: 0, False: 1]
  ------------------
  342|      0|        qt_message_fatal(msgType, context, buf);
  343|      1|}
_ZN15QMessagePattern17setDefaultPatternEv:
 1086|      1|    {
 1087|      1|        const char *const defaultTokens[] = {
 1088|      1|#ifndef Q_OS_ANDROID
 1089|       |            // "%{if-category}%{category}: %{endif}%{message}"
 1090|      1|            ifCategoryTokenC,
 1091|      1|            categoryTokenC,
 1092|      1|            ": ",   // won't point to literals[] but that's ok
 1093|      1|            endifTokenC,
 1094|      1|#endif
 1095|      1|            messageTokenC,
 1096|      1|        };
 1097|       |
 1098|       |        // we don't attempt to free the pointers, so only call from the ctor
 1099|      1|        Q_ASSERT(!tokens);
 1100|      1|        Q_ASSERT(!literals);
 1101|       |
 1102|      1|        auto ptr = new const char *[std::size(defaultTokens) + 1];
 1103|      1|        auto end = std::copy(std::begin(defaultTokens), std::end(defaultTokens), ptr);
 1104|      1|        *end = nullptr;
 1105|      1|        tokens.release();
 1106|      1|        tokens.reset(ptr);
 1107|      1|    }
qlogging.cpp:_ZL16formatLogMessage9QtMsgTypeRK18QMessageLogContextRK7QString:
 1564|   186k|{
 1565|   186k|    QString message;
 1566|       |
 1567|   186k|    const auto locker = qt_scoped_lock(QMessagePattern::mutex);
 1568|       |
 1569|   186k|    QMessagePattern *pattern = qMessagePattern();
 1570|   186k|    if (!pattern) {
  ------------------
  |  Branch (1570:9): [True: 0, False: 186k]
  ------------------
 1571|       |        // after destruction of static QMessagePattern instance
 1572|      0|        message.append(str);
 1573|      0|        return message;
 1574|      0|    }
 1575|       |
 1576|   186k|    bool skip = false;
 1577|       |
 1578|   186k|    int timeArgsIdx = 0;
 1579|   186k|#ifdef QLOGGING_HAVE_BACKTRACE
 1580|   186k|    int backtraceArgsIdx = 0;
 1581|   186k|#endif
 1582|       |
 1583|       |    // we do not convert file, function, line literals to local encoding due to overhead
 1584|  1.11M|    for (int i = 0; pattern->tokens[i]; ++i) {
  ------------------
  |  Branch (1584:21): [True: 933k, False: 186k]
  ------------------
 1585|   933k|        const char *token = pattern->tokens[i];
 1586|   933k|        if (token == endifTokenC) {
  ------------------
  |  Branch (1586:13): [True: 186k, False: 746k]
  ------------------
 1587|   186k|            skip = false;
 1588|   746k|        } else if (skip) {
  ------------------
  |  Branch (1588:20): [True: 373k, False: 373k]
  ------------------
 1589|       |            // we skip adding messages, but we have to iterate over
 1590|       |            // timeArgsIdx and backtraceArgsIdx anyway
 1591|   373k|            if (token == timeTokenC)
  ------------------
  |  Branch (1591:17): [True: 0, False: 373k]
  ------------------
 1592|      0|                timeArgsIdx++;
 1593|   373k|#ifdef QLOGGING_HAVE_BACKTRACE
 1594|   373k|            else if (token == backtraceTokenC)
  ------------------
  |  Branch (1594:22): [True: 0, False: 373k]
  ------------------
 1595|      0|                backtraceArgsIdx++;
 1596|   373k|#endif
 1597|   373k|        } else if (token == messageTokenC) {
  ------------------
  |  Branch (1597:20): [True: 186k, False: 186k]
  ------------------
 1598|   186k|            message.append(str);
 1599|   186k|        } else if (token == categoryTokenC) {
  ------------------
  |  Branch (1599:20): [True: 0, False: 186k]
  ------------------
 1600|      0|            message.append(QLatin1StringView(context.category));
 1601|   186k|        } else if (token == typeTokenC) {
  ------------------
  |  Branch (1601:20): [True: 0, False: 186k]
  ------------------
 1602|      0|            switch (type) {
  ------------------
  |  Branch (1602:21): [True: 0, False: 0]
  ------------------
 1603|      0|            case QtDebugMsg:   message.append("debug"_L1); break;
  ------------------
  |  Branch (1603:13): [True: 0, False: 0]
  ------------------
 1604|      0|            case QtInfoMsg:    message.append("info"_L1); break;
  ------------------
  |  Branch (1604:13): [True: 0, False: 0]
  ------------------
 1605|      0|            case QtWarningMsg: message.append("warning"_L1); break;
  ------------------
  |  Branch (1605:13): [True: 0, False: 0]
  ------------------
 1606|      0|            case QtCriticalMsg:message.append("critical"_L1); break;
  ------------------
  |  Branch (1606:13): [True: 0, False: 0]
  ------------------
 1607|      0|            case QtFatalMsg:   message.append("fatal"_L1); break;
  ------------------
  |  Branch (1607:13): [True: 0, False: 0]
  ------------------
 1608|      0|            }
 1609|   186k|        } else if (token == fileTokenC) {
  ------------------
  |  Branch (1609:20): [True: 0, False: 186k]
  ------------------
 1610|      0|            if (context.file)
  ------------------
  |  Branch (1610:17): [True: 0, False: 0]
  ------------------
 1611|      0|                message.append(QLatin1StringView(context.file));
 1612|      0|            else
 1613|      0|                message.append("unknown"_L1);
 1614|   186k|        } else if (token == lineTokenC) {
  ------------------
  |  Branch (1614:20): [True: 0, False: 186k]
  ------------------
 1615|      0|            message.append(QString::number(context.line));
 1616|   186k|        } else if (token == functionTokenC) {
  ------------------
  |  Branch (1616:20): [True: 0, False: 186k]
  ------------------
 1617|      0|            if (context.function)
  ------------------
  |  Branch (1617:17): [True: 0, False: 0]
  ------------------
 1618|      0|                message.append(QString::fromLatin1(qCleanupFuncinfo(context.function)));
 1619|      0|            else
 1620|      0|                message.append("unknown"_L1);
 1621|   186k|        } else if (token == pidTokenC) {
  ------------------
  |  Branch (1621:20): [True: 0, False: 186k]
  ------------------
 1622|      0|            message.append(QString::number(QCoreApplication::applicationPid()));
 1623|   186k|        } else if (token == appnameTokenC) {
  ------------------
  |  Branch (1623:20): [True: 0, False: 186k]
  ------------------
 1624|      0|            message.append(QCoreApplication::applicationName());
 1625|   186k|        } else if (token == threadidTokenC) {
  ------------------
  |  Branch (1625:20): [True: 0, False: 186k]
  ------------------
 1626|       |            // print the TID as decimal
 1627|      0|            message.append(QString::number(qt_gettid()));
 1628|   186k|        } else if (token == qthreadptrTokenC) {
  ------------------
  |  Branch (1628:20): [True: 0, False: 186k]
  ------------------
 1629|      0|            message.append("0x"_L1);
 1630|      0|            message.append(QString::number(qlonglong(QThread::currentThread()->currentThread()), 16));
 1631|      0|#ifdef QLOGGING_HAVE_BACKTRACE
 1632|   186k|        } else if (token == backtraceTokenC) {
  ------------------
  |  Branch (1632:20): [True: 0, False: 186k]
  ------------------
 1633|      0|            QMessagePattern::BacktraceParams backtraceParams = pattern->backtraceArgs.at(backtraceArgsIdx);
 1634|      0|            backtraceArgsIdx++;
 1635|      0|            message.append(formatBacktraceForLogMessage(backtraceParams, context));
 1636|      0|#endif
 1637|   186k|        } else if (token == timeTokenC) {
  ------------------
  |  Branch (1637:20): [True: 0, False: 186k]
  ------------------
 1638|      0|            using namespace std::chrono;
 1639|      0|            auto formatElapsedTime = [](steady_clock::duration time) {
 1640|       |                // we assume time > 0
 1641|      0|                auto ms = duration_cast<milliseconds>(time);
 1642|      0|                auto sec = duration_cast<seconds>(ms);
 1643|      0|                ms -= sec;
 1644|      0|                return QString::asprintf("%6lld.%03u", qint64(sec.count()), uint(ms.count()));
 1645|      0|            };
 1646|      0|            QString timeFormat = pattern->timeArgs.at(timeArgsIdx);
 1647|      0|            timeArgsIdx++;
 1648|      0|            if (timeFormat == "process"_L1) {
  ------------------
  |  Branch (1648:17): [True: 0, False: 0]
  ------------------
 1649|      0|                message += formatElapsedTime(steady_clock::now() - pattern->appStartTime);
 1650|      0|            } else if (timeFormat == "boot"_L1) {
  ------------------
  |  Branch (1650:24): [True: 0, False: 0]
  ------------------
 1651|       |                // just print the milliseconds since the elapsed timer reference
 1652|       |                // like the Linux kernel does
 1653|      0|                message += formatElapsedTime(steady_clock::now().time_since_epoch());
 1654|      0|#if QT_CONFIG(datestring)
 1655|      0|            } else if (timeFormat.isEmpty()) {
  ------------------
  |  Branch (1655:24): [True: 0, False: 0]
  ------------------
 1656|      0|                message.append(QDateTime::currentDateTime().toString(Qt::ISODate));
 1657|      0|            } else {
 1658|      0|                message.append(QDateTime::currentDateTime().toString(timeFormat));
 1659|      0|#endif // QT_CONFIG(datestring)
 1660|      0|            }
 1661|   186k|        } else if (token == ifCategoryTokenC) {
  ------------------
  |  Branch (1661:20): [True: 186k, False: 0]
  ------------------
 1662|   186k|            if (isDefaultCategory(context.category))
  ------------------
  |  Branch (1662:17): [True: 186k, False: 0]
  ------------------
 1663|   186k|                skip = true;
 1664|   186k|#define HANDLE_IF_TOKEN(LEVEL)  \
 1665|   186k|        } else if (token == if##LEVEL##TokenC) { \
 1666|   186k|            skip = type != Qt##LEVEL##Msg;
 1667|   186k|        HANDLE_IF_TOKEN(Debug)
  ------------------
  |  | 1665|   186k|        } else if (token == if##LEVEL##TokenC) { \
  |  |  ------------------
  |  |  |  Branch (1665:20): [True: 0, False: 0]
  |  |  ------------------
  |  | 1666|      0|            skip = type != Qt##LEVEL##Msg;
  ------------------
 1668|      0|        HANDLE_IF_TOKEN(Info)
  ------------------
  |  | 1665|      0|        } else if (token == if##LEVEL##TokenC) { \
  |  |  ------------------
  |  |  |  Branch (1665:20): [True: 0, False: 0]
  |  |  ------------------
  |  | 1666|      0|            skip = type != Qt##LEVEL##Msg;
  ------------------
 1669|      0|        HANDLE_IF_TOKEN(Warning)
  ------------------
  |  | 1665|      0|        } else if (token == if##LEVEL##TokenC) { \
  |  |  ------------------
  |  |  |  Branch (1665:20): [True: 0, False: 0]
  |  |  ------------------
  |  | 1666|      0|            skip = type != Qt##LEVEL##Msg;
  ------------------
 1670|      0|        HANDLE_IF_TOKEN(Critical)
  ------------------
  |  | 1665|      0|        } else if (token == if##LEVEL##TokenC) { \
  |  |  ------------------
  |  |  |  Branch (1665:20): [True: 0, False: 0]
  |  |  ------------------
  |  | 1666|      0|            skip = type != Qt##LEVEL##Msg;
  ------------------
 1671|      0|        HANDLE_IF_TOKEN(Fatal)
  ------------------
  |  | 1665|      0|        } else if (token == if##LEVEL##TokenC) { \
  |  |  ------------------
  |  |  |  Branch (1665:20): [True: 0, False: 0]
  |  |  ------------------
  |  | 1666|      0|            skip = type != Qt##LEVEL##Msg;
  ------------------
 1672|      0|#undef HANDLE_IF_TOKEN
 1673|      0|        } else {
 1674|      0|            message.append(QLatin1StringView(token));
 1675|      0|        }
 1676|   933k|    }
 1677|   186k|    return message;
 1678|   186k|}
qlogging.cpp:_ZL17isDefaultCategoryPKc:
  885|   373k|{
  886|   373k|    return !category || strcmp(category, "default") == 0;
  ------------------
  |  Branch (886:12): [True: 0, False: 373k]
  |  Branch (886:25): [True: 373k, False: 0]
  ------------------
  887|   373k|}
qlogging.cpp:_ZL26preformattedMessageHandler9QtMsgTypeRK18QMessageLogContextRK7QString:
 1967|   186k|{
 1968|   186k|QT_WARNING_PUSH
 1969|   186k|QT_WARNING_DISABLE_GCC("-Waddress") // "the address of ~~ will never be NULL
 1970|   186k|    if (systemMessageSink.sink && systemMessageSink.sink(type, context, formattedMessage))
  ------------------
  |  Branch (1970:9): [Folded - Ignored]
  |  Branch (1970:35): [True: 0, False: 0]
  ------------------
 1971|      0|        return;
 1972|   186k|QT_WARNING_POP
 1973|       |
 1974|   186k|    stderr_message_handler(type, context, formattedMessage);
 1975|   186k|}
qlogging.cpp:_ZL22stderr_message_handler9QtMsgTypeRK18QMessageLogContextRK7QString:
 1924|   186k|{
 1925|   186k|    Q_UNUSED(type);
 1926|   186k|    Q_UNUSED(context);
 1927|       |
 1928|       |    // print nothing if message pattern didn't apply / was empty.
 1929|       |    // (still print empty lines, e.g. because message itself was empty)
 1930|   186k|    if (formattedMessage.isNull())
  ------------------
  |  Branch (1930:9): [True: 0, False: 186k]
  ------------------
 1931|      0|        return;
 1932|   186k|    fprintf(stderr, "%s\n", formattedMessage.toLocal8Bit().constData());
 1933|   186k|    fflush(stderr);
 1934|   186k|}
qlogging.cpp:_ZL16qt_message_print9QtMsgTypeRK18QMessageLogContextRK7QString:
 2012|   186k|{
 2013|   186k|    Q_TRACE(qt_message_print, msgType, context.category, context.function, context.file, context.line, message);
 2014|       |
 2015|       |    // qDebug, qWarning, ... macros do not check whether category is enabledgc
 2016|   186k|    if (msgType != QtFatalMsg && isDefaultCategory(context.category)) {
  ------------------
  |  Branch (2016:9): [True: 186k, False: 0]
  |  Branch (2016:34): [True: 186k, False: 0]
  ------------------
 2017|   186k|        if (QLoggingCategory *defaultCategory = QLoggingCategory::defaultCategory()) {
  ------------------
  |  Branch (2017:31): [True: 186k, False: 0]
  ------------------
 2018|   186k|            if (!defaultCategory->isEnabled(msgType))
  ------------------
  |  Branch (2018:17): [True: 0, False: 186k]
  ------------------
 2019|      0|                return;
 2020|   186k|        }
 2021|   186k|    }
 2022|       |
 2023|       |    // prevent recursion in case the message handler generates messages
 2024|       |    // itself, e.g. by using Qt API
 2025|   186k|    if (grabMessageHandler()) {
  ------------------
  |  Branch (2025:9): [True: 186k, False: 0]
  ------------------
 2026|   186k|        const auto ungrab = qScopeGuard([]{ ungrabMessageHandler(); });
 2027|   186k|        auto msgHandler = messageHandler.loadAcquire();
 2028|   186k|        (msgHandler ? msgHandler : qDefaultMessageHandler)(msgType, context, message);
  ------------------
  |  Branch (2028:10): [True: 0, False: 186k]
  ------------------
 2029|   186k|    } else {
 2030|      0|        stderr_message_handler(msgType, context, message);
 2031|      0|    }
 2032|   186k|}
qlogging.cpp:_ZL18grabMessageHandlerv:
 1998|   186k|{
 1999|   186k|    if (msgHandlerGrabbed)
  ------------------
  |  Branch (1999:9): [True: 0, False: 186k]
  ------------------
 2000|      0|        return false;
 2001|       |
 2002|   186k|    msgHandlerGrabbed = true;
 2003|   186k|    return true;
 2004|   186k|}
qlogging.cpp:_ZZL16qt_message_print9QtMsgTypeRK18QMessageLogContextRK7QStringENK3$_0clEv:
 2026|   186k|        const auto ungrab = qScopeGuard([]{ ungrabMessageHandler(); });
qlogging.cpp:_ZL20ungrabMessageHandlerv:
 2007|   186k|{
 2008|   186k|    msgHandlerGrabbed = false;
 2009|   186k|}
qlogging.cpp:_ZL7isFatal9QtMsgType:
  165|   186k|{
  166|   186k|    if (msgType == QtFatalMsg)
  ------------------
  |  Branch (166:9): [True: 0, False: 186k]
  ------------------
  167|      0|        return true;
  168|       |
  169|   186k|    if (msgType == QtCriticalMsg) {
  ------------------
  |  Branch (169:9): [True: 5.15k, False: 181k]
  ------------------
  170|  5.15k|        static QAtomicInt fatalCriticals = checked_var_value("QT_FATAL_CRITICALS");
  171|  5.15k|        return is_fatal_count_down(fatalCriticals);
  172|  5.15k|    }
  173|       |
  174|   181k|    if (msgType == QtWarningMsg || msgType == QtCriticalMsg) {
  ------------------
  |  Branch (174:9): [True: 181k, False: 0]
  |  Branch (174:36): [True: 0, False: 0]
  ------------------
  175|   181k|        static QAtomicInt fatalWarnings = checked_var_value("QT_FATAL_WARNINGS");
  176|   181k|        return is_fatal_count_down(fatalWarnings);
  177|   181k|    }
  178|       |
  179|      0|    return false;
  180|   181k|}
qlogging.cpp:_ZL17checked_var_valuePKc:
  140|      2|{
  141|       |    // qEnvironmentVariableIntValue returns 0 on both parsing failure and on
  142|       |    // empty, but we need to distinguish between the two for backwards
  143|       |    // compatibility reasons.
  144|      2|    QByteArray str = qgetenv(varname);
  145|      2|    if (str.isEmpty())
  ------------------
  |  Branch (145:9): [True: 2, False: 0]
  ------------------
  146|      2|        return 0;
  147|       |
  148|      0|    bool ok;
  149|      0|    int value = str.toInt(&ok, 0);
  150|      0|    return ok ? value : 1;
  ------------------
  |  Branch (150:12): [True: 0, False: 0]
  ------------------
  151|      2|}
qlogging.cpp:_ZL19is_fatal_count_downR10QAtomicInt:
  154|   186k|{
  155|       |    // it's fatal if the current value is exactly 1,
  156|       |    // otherwise decrement if it's non-zero
  157|       |
  158|   186k|    int v = n.loadRelaxed();
  159|   186k|    while (v != 0 && !n.testAndSetRelaxed(v, v - 1, v))
  ------------------
  |  Branch (159:12): [True: 0, False: 186k]
  |  Branch (159:22): [True: 0, False: 0]
  ------------------
  160|      0|        qYieldCpu();
  161|   186k|    return v == 1; // we exited the loop, so either v == 0 or CAS succeeded to set n from v to v-1
  162|   186k|}
qlogging.cpp:_ZL22qDefaultMessageHandler9QtMsgTypeRK18QMessageLogContextRK7QString:
 1982|   186k|{
 1983|       |    // A message sink logs the message to a structured or unstructured destination,
 1984|       |    // optionally formatting the message if the latter, and returns true if the sink
 1985|       |    // handled stderr output as well, which will shortcut our default stderr output.
 1986|       |
 1987|   186k|    if (systemMessageSink.messageIsUnformatted) {
  ------------------
  |  Branch (1987:9): [Folded - Ignored]
  ------------------
 1988|      0|        if (systemMessageSink.sink(type, context, message))
  ------------------
  |  Branch (1988:13): [True: 0, False: 0]
  ------------------
 1989|      0|            return;
 1990|      0|    }
 1991|       |
 1992|   186k|    preformattedMessageHandler(type, context, formatLogMessage(type, context, message));
 1993|   186k|}
qlogging.cpp:_ZL19copyInternalContextP26QInternalMessageLogContextRK18QMessageLogContext:
 2289|   373k|{
 2290|   373k|    if (logContext.version == self->version) {
  ------------------
  |  Branch (2290:9): [True: 186k, False: 186k]
  ------------------
 2291|   186k|        auto other = static_cast<const QInternalMessageLogContext *>(&logContext);
 2292|   186k|        self->backtrace = other->backtrace;
 2293|   186k|    }
 2294|   373k|}

_ZN18QMessageLogContextC2EPKciS1_S1_:
   49|   186k|        : line(lineNumber), file(fileName), function(functionName), category(categoryName) {}
_ZN14QMessageLoggerC2EPKciS1_:
   78|   186k|        : context(file, line, function, "default") {}

_ZN26QInternalMessageLogContextC2ERK18QMessageLogContext:
   60|   373k|    {
   61|   373k|        int backtraceFrames = initFrom(logContext);
   62|   373k|        if (backtraceFrames)
  ------------------
  |  Branch (62:13): [True: 0, False: 373k]
  ------------------
   63|      0|            populateBacktrace(backtraceFrames);
   64|   373k|    }

_Z4qMaxIxERKT_S2_S2_:
   21|   188k|constexpr inline const T &qMax(const T &a, const T &b) { return (a < b) ? b : a; }
  ------------------
  |  Branch (21:65): [True: 1, False: 188k]
  ------------------
_Z4qMinIxERKT_S2_S2_:
   19|  92.7k|constexpr inline const T &qMin(const T &a, const T &b) { return (a < b) ? a : b; }
  ------------------
  |  Branch (19:65): [True: 15.4k, False: 77.3k]
  ------------------

_ZeqRK14QByteArrayViewS1_:
   72|   195k|#define QT_VA_ARGS_EXPAND(...) __VA_ARGS__ // Needed for MSVC

_Z23qt_initial_random_valuev:
 1289|      2|{
 1290|      2|#if QT_CONFIG(getauxval) && defined(AT_RANDOM)
 1291|      2|    auto at_random_ptr = reinterpret_cast<size_t *>(getauxval(AT_RANDOM));
 1292|      2|    if (at_random_ptr)
  ------------------
  |  Branch (1292:9): [True: 2, False: 0]
  ------------------
 1293|      2|        return qFromUnaligned<QRandomGenerator::InitialRandomData>(at_random_ptr);
 1294|      0|#endif
 1295|       |
 1296|       |    // bypass the hardware RNG, which would mean initializing qsimd.cpp
 1297|       |
 1298|      0|    QRandomGenerator::InitialRandomData v;
 1299|      0|    for (int attempts = 16; attempts; --attempts) {
  ------------------
  |  Branch (1299:29): [True: 0, False: 0]
  ------------------
 1300|      0|        using Generator = QRandomGenerator::SystemGenerator;
 1301|      0|        auto fillBuffer = &Generator::fillBuffer;
 1302|      0|        if (callFillBuffer<Generator>(fillBuffer, &v) != sizeof(v))
  ------------------
  |  Branch (1302:13): [True: 0, False: 0]
  ------------------
 1303|      0|            continue;
 1304|       |
 1305|      0|        return v;
 1306|      0|    }
 1307|       |
 1308|      0|    quint32 data[sizeof(v) / sizeof(quint32)];
 1309|      0|    fallback_fill(data, std::size(data));
 1310|      0|    memcpy(v.data, data, sizeof(v.data));
 1311|      0|    return v;
 1312|      0|}

qDetectCpuFeatures:
  637|      2|{
  638|      2|    auto minFeatureTest = minFeature;
  639|      2|#if defined(Q_PROCESSOR_X86_64) && defined(cpu_feature_shstk)
  640|       |    // Controlflow Enforcement Technology (CET) is an OS-assisted
  641|       |    // hardware-feature, meaning the CPUID bit may be disabled if the OS
  642|       |    // doesn't support it, but that's ok.
  643|      2|    minFeatureTest &= ~CpuFeatureSHSTK;
  644|      2|#endif
  645|      2|    QCpuFeatureType f = detectProcessorFeatures();
  646|       |
  647|       |    // Intentionally NOT qgetenv (this code runs too early)
  648|      2|    if (char *disable = getenv("QT_NO_CPU_FEATURE"); disable && *disable) {
  ------------------
  |  Branch (648:54): [True: 0, False: 2]
  |  Branch (648:65): [True: 0, False: 0]
  ------------------
  649|      0|#if _POSIX_C_SOURCE >= 200112L
  650|      0|        char *saveptr = nullptr;
  651|      0|        auto strtok = [&saveptr](char *str, const char *delim) {
  652|      0|            return ::strtok_r(str, delim, &saveptr);
  653|      0|        };
  654|      0|#endif
  655|      0|        while (char *token = strtok(disable, " ")) {
  ------------------
  |  Branch (655:22): [True: 0, False: 0]
  ------------------
  656|      0|            disable = nullptr;
  657|      0|            for (uint i = 0; i < arraysize(features_indices); ++i) {
  ------------------
  |  Branch (657:30): [True: 0, False: 0]
  ------------------
  658|      0|                if (strcmp(token, features_string + features_indices[i]) == 0)
  ------------------
  |  Branch (658:21): [True: 0, False: 0]
  ------------------
  659|      0|                    f &= ~(Q_UINT64_C(1) << i);
  ------------------
  |  |   60|      0|#  define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL) /* unsigned 64 bit constant */
  ------------------
  660|      0|            }
  661|      0|        }
  662|      0|    }
  663|       |
  664|      2|#ifdef RUNNING_ON_VALGRIND
  665|      2|    bool runningOnValgrind = RUNNING_ON_VALGRIND;
  ------------------
  |  | 6726|      2|    (unsigned)VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* if not */,         \
  |  |  ------------------
  |  |  |  |  426|      2|    __extension__                                                 \
  |  |  |  |  427|      2|    ({ volatile unsigned long int _zzq_args[6];                   \
  |  |  |  |  428|      2|    volatile unsigned long int _zzq_result;                       \
  |  |  |  |  429|      2|    _zzq_args[0] = (unsigned long int)(_zzq_request);             \
  |  |  |  |  430|      2|    _zzq_args[1] = (unsigned long int)(_zzq_arg1);                \
  |  |  |  |  431|      2|    _zzq_args[2] = (unsigned long int)(_zzq_arg2);                \
  |  |  |  |  432|      2|    _zzq_args[3] = (unsigned long int)(_zzq_arg3);                \
  |  |  |  |  433|      2|    _zzq_args[4] = (unsigned long int)(_zzq_arg4);                \
  |  |  |  |  434|      2|    _zzq_args[5] = (unsigned long int)(_zzq_arg5);                \
  |  |  |  |  435|      2|    __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE               \
  |  |  |  |  436|      2|                     /* %RDX = client_request ( %RAX ) */         \
  |  |  |  |  437|      2|                     "xchgq %%rbx,%%rbx"                          \
  |  |  |  |  438|      2|                     : "=d" (_zzq_result)                         \
  |  |  |  |  439|      2|                     : "a" (&_zzq_args[0]), "0" (_zzq_default)    \
  |  |  |  |  440|      2|                     : "cc", "memory"                             \
  |  |  |  |  441|      2|                    );                                            \
  |  |  |  |  442|      2|    _zzq_result;                                                  \
  |  |  |  |  443|      2|    })
  |  |  ------------------
  |  | 6727|      2|                                    VG_USERREQ__RUNNING_ON_VALGRIND,  \
  |  | 6728|      2|                                    0, 0, 0, 0, 0)                    \
  ------------------
  666|       |#else
  667|       |    bool runningOnValgrind = false;
  668|       |#endif
  669|      2|    if (Q_UNLIKELY(!runningOnValgrind && minFeatureTest != 0 && (f & minFeatureTest) != minFeatureTest)) {
  ------------------
  |  |  198|      8|#  define Q_UNLIKELY(expr)  __builtin_expect(!!(expr), false)
  |  |  ------------------
  |  |  |  Branch (198:29): [True: 0, False: 2]
  |  |  |  Branch (198:49): [True: 2, False: 0]
  |  |  |  Branch (198:49): [True: 2, False: 0]
  |  |  |  Branch (198:49): [True: 0, False: 2]
  |  |  ------------------
  ------------------
  670|      0|        quint64 missing = minFeatureTest & ~quint64(f);
  671|      0|        fprintf(stderr, "Incompatible processor. This Qt build requires the following features:\n   ");
  672|      0|        for (uint i = 0; i < arraysize(features_indices); ++i) {
  ------------------
  |  Branch (672:26): [True: 0, False: 0]
  ------------------
  673|      0|            if (missing & (Q_UINT64_C(1) << i))
  ------------------
  |  |   60|      0|#  define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL) /* unsigned 64 bit constant */
  ------------------
  |  Branch (673:17): [True: 0, False: 0]
  ------------------
  674|      0|                fprintf(stderr, "%s", features_string + features_indices[i]);
  675|      0|        }
  676|      0|        fprintf(stderr, "\n");
  677|      0|        fflush(stderr);
  678|      0|        qAbort();
  679|      0|    }
  680|       |
  681|      2|    assert((f & SimdInitialized) == 0);
  682|      2|    f |= SimdInitialized;
  683|      2|    std::atomic_store_explicit(QT_MANGLE_NAMESPACE(qt_cpu_features), f, std::memory_order_relaxed);
  ------------------
  |  |   91|      2|# define QT_MANGLE_NAMESPACE(name) name
  ------------------
  684|      2|    return f;
  685|      2|}
qsimd.cpp:_ZL23detectProcessorFeaturesv:
  427|      2|{
  428|      2|    quint64 features = 0;
  429|      2|    int cpuidLevel = maxBasicCpuidSupported();
  430|       |#if Q_PROCESSOR_X86 < 5
  431|       |    if (cpuidLevel < 1)
  432|       |        return 0;
  433|       |#else
  434|      2|    assert(cpuidLevel >= 1);
  435|      2|#endif
  436|       |
  437|      2|    uint results[X86CpuidMaxLeaf] = {};
  438|      2|    cpuidFeatures01(results[Leaf01ECX], results[Leaf01EDX]);
  439|      2|    if (cpuidLevel >= 7)
  ------------------
  |  Branch (439:9): [True: 2, False: 0]
  ------------------
  440|      2|        cpuidFeatures07_00(results[Leaf07_00EBX], results[Leaf07_00ECX], results[Leaf07_00EDX]);
  441|       |
  442|       |    // populate our feature list
  443|     78|    for (uint i = 0; i < arraysize(x86_locators); ++i) {
  ------------------
  |  Branch (443:22): [True: 76, False: 2]
  ------------------
  444|     76|        uint word = x86_locators[i] / 32;
  445|     76|        uint bit = 1U << (x86_locators[i] % 32);
  446|     76|        quint64 feature = Q_UINT64_C(1) << i;
  ------------------
  |  |   60|     76|#  define Q_UINT64_C(c) static_cast<unsigned long long>(c ## ULL) /* unsigned 64 bit constant */
  ------------------
  447|     76|        if (results[word] & bit)
  ------------------
  |  Branch (447:13): [True: 32, False: 44]
  ------------------
  448|     32|            features |= feature;
  449|     76|    }
  450|       |
  451|       |    // now check the AVX state
  452|      2|    quint64 xcr0 = 0;
  453|      2|    if (results[Leaf01ECX] & (1u << 27)) {
  ------------------
  |  Branch (453:9): [True: 2, False: 0]
  ------------------
  454|       |        // XGETBV enabled
  455|      2|        uint xgetbvA = 0, xgetbvD = 0;
  456|      2|        xgetbv(0, xgetbvA, xgetbvD);
  457|       |
  458|      2|        xcr0 = xgetbvA;
  459|      2|        if (sizeof(XSaveBits) > sizeof(xgetbvA))
  ------------------
  |  Branch (459:13): [Folded - Ignored]
  ------------------
  460|      0|            xcr0 |= quint64(xgetbvD) << 32;
  461|      2|        xcr0 = adjustedXcr0(xcr0);
  462|      2|    }
  463|       |
  464|      6|    for (auto req : xsave_requirements) {
  ------------------
  |  Branch (464:19): [True: 6, False: 2]
  ------------------
  465|      6|        if ((xcr0 & req.xsave_state) != req.xsave_state)
  ------------------
  |  Branch (465:13): [True: 4, False: 2]
  ------------------
  466|      4|            features &= ~req.cpu_features;
  467|      6|    }
  468|       |
  469|      2|    if (features & CpuFeatureRDRND && !checkRdrndWorks())
  ------------------
  |  Branch (469:9): [True: 2, False: 0]
  |  Branch (469:39): [True: 0, False: 2]
  ------------------
  470|      0|        features &= ~(CpuFeatureRDRND | CpuFeatureRDSEED);
  471|       |
  472|      2|    return features;
  473|      2|}
qsimd.cpp:_ZL22maxBasicCpuidSupportedv:
  267|      2|{
  268|       |#if defined(Q_CC_EMSCRIPTEN)
  269|       |    return 6; // All features supported by Emscripten
  270|       |#elif defined(Q_CC_GNU)
  271|       |    qregisterint tmp1;
  272|       |
  273|       |# if Q_PROCESSOR_X86 < 5
  274|       |    // check if the CPUID instruction is supported
  275|       |    long cpuid_supported;
  276|       |    asm ("pushf\n"
  277|       |         "pop %0\n"
  278|       |         "mov %0, %1\n"
  279|       |         "xor $0x00200000, %0\n"
  280|       |         "push %0\n"
  281|       |         "popf\n"
  282|       |         "pushf\n"
  283|       |         "pop %0\n"
  284|       |         "xor %1, %0\n" // %eax is now 0 if CPUID is not supported
  285|       |         : "=a" (cpuid_supported), "=r" (tmp1)
  286|       |         );
  287|       |    if (!cpuid_supported)
  288|       |        return 0;
  289|       |# endif
  290|       |
  291|      2|    int result;
  292|      2|    asm ("xchg " PICreg", %1\n"
  293|      2|         "cpuid\n"
  294|      2|         "xchg " PICreg", %1\n"
  295|      2|        : "=&a" (result), "=&r" (tmp1)
  296|      2|        : "0" (0)
  297|      2|        : "ecx", "edx");
  298|      2|    return result;
  299|       |#elif defined(Q_OS_WIN)
  300|       |    // Use the __cpuid function; if the CPUID instruction isn't supported, it will return 0
  301|       |    int info[4];
  302|       |    __cpuid(info, 0);
  303|       |    return info[0];
  304|       |#elif defined(Q_CC_GHS)
  305|       |    unsigned int info[4];
  306|       |    __CPUID(0, info);
  307|       |    return info[0];
  308|       |#else
  309|       |    return 0;
  310|       |#endif
  311|      2|}
qsimd.cpp:_ZL15cpuidFeatures01RjS_:
  315|      2|{
  316|      2|#if defined(Q_CC_GNU) && !defined(Q_CC_EMSCRIPTEN)
  317|      2|    qregisterint tmp1;
  318|      2|    asm ("xchg " PICreg", %2\n"
  319|      2|         "cpuid\n"
  320|      2|         "xchg " PICreg", %2\n"
  321|      2|        : "=&c" (ecx), "=&d" (edx), "=&r" (tmp1)
  322|      2|        : "a" (1));
  323|       |#elif defined(Q_OS_WIN)
  324|       |    int info[4];
  325|       |    __cpuid(info, 1);
  326|       |    ecx = info[2];
  327|       |    edx = info[3];
  328|       |#elif defined(Q_CC_GHS)
  329|       |    unsigned int info[4];
  330|       |    __CPUID(1, info);
  331|       |    ecx = info[2];
  332|       |    edx = info[3];
  333|       |#else
  334|       |    Q_UNUSED(ecx);
  335|       |    Q_UNUSED(edx);
  336|       |#endif
  337|      2|}
qsimd.cpp:_ZL18cpuidFeatures07_00RjS_S_:
  345|      2|{
  346|      2|#if defined(Q_CC_GNU) && !defined(Q_CC_EMSCRIPTEN)
  347|      2|    qregisteruint rbx; // in case it's 64-bit
  348|      2|    qregisteruint rcx = 0;
  349|      2|    qregisteruint rdx = 0;
  350|      2|    asm ("xchg " PICreg", %0\n"
  351|      2|         "cpuid\n"
  352|      2|         "xchg " PICreg", %0\n"
  353|      2|        : "=&r" (rbx), "+&c" (rcx), "+&d" (rdx)
  354|      2|        : "a" (7));
  355|      2|    ebx = rbx;
  356|      2|    ecx = rcx;
  357|      2|    edx = rdx;
  358|       |#elif defined(Q_OS_WIN)
  359|       |    int info[4];
  360|       |    __cpuidex(info, 7, 0);
  361|       |    ebx = info[1];
  362|       |    ecx = info[2];
  363|       |    edx = info[3];
  364|       |#elif defined(Q_CC_GHS)
  365|       |    unsigned int info[4];
  366|       |    __CPUIDEX(7, 0, info);
  367|       |    ebx = info[1];
  368|       |    ecx = info[2];
  369|       |    edx = info[3];
  370|       |#else
  371|       |    Q_UNUSED(ebx);
  372|       |    Q_UNUSED(ecx);
  373|       |    Q_UNUSED(edx);
  374|       |#endif
  375|      2|}
qsimd.cpp:_ZL6xgetbvjRjS_:
  383|      2|{
  384|      2|#if (defined(Q_CC_GNU) && !defined(Q_CC_EMSCRIPTEN)) || defined(Q_CC_GHS)
  385|      2|    asm (".byte 0x0F, 0x01, 0xD0" // xgetbv instruction
  386|      2|        : "=a" (eax), "=d" (edx)
  387|      2|        : "c" (in));
  388|       |#elif defined(Q_OS_WIN)
  389|       |    quint64 result = _xgetbv(in);
  390|       |    eax = result;
  391|       |    edx = result >> 32;
  392|       |#else
  393|       |    Q_UNUSED(in);
  394|       |    Q_UNUSED(eax);
  395|       |    Q_UNUSED(edx);
  396|       |#endif
  397|      2|}
qsimd.cpp:_ZL12adjustedXcr0y:
  401|      2|{
  402|       |    /*
  403|       |     * Some OSes hide their capability of context-switching the AVX512 state in
  404|       |     * the XCR0 register. They do that so the first time we execute an
  405|       |     * instruction that may access the AVX512 state (requiring the EVEX prefix)
  406|       |     * they allocate the necessary context switch space.
  407|       |     *
  408|       |     * This behavior is deprecated with the XFD (Extended Feature Disable)
  409|       |     * register, but we can't change existing OSes.
  410|       |     */
  411|       |#ifdef Q_OS_DARWIN
  412|       |    // from <machine/cpu_capabilities.h> in xnu
  413|       |    // <https://github.com/apple/darwin-xnu/blob/xnu-4903.221.2/osfmk/i386/cpu_capabilities.h>
  414|       |    constexpr quint64 kHasAVX512F = Q_UINT64_C(0x0000004000000000);
  415|       |    constexpr quintptr commpage = sizeof(void *) > 4 ? Q_UINT64_C(0x00007fffffe00000) : 0xffff0000;
  416|       |    constexpr quintptr cpu_capabilities64 = commpage + 0x10;
  417|       |    quint64 capab = *reinterpret_cast<quint64 *>(cpu_capabilities64);
  418|       |    if (capab & kHasAVX512F)
  419|       |        xcr0 |= XSave_Avx512State;
  420|       |#endif
  421|       |
  422|      2|    return xcr0;
  423|      2|}
qsimd.cpp:_ZL15checkRdrndWorksv:
  782|      2|{
  783|       |    /*
  784|       |     * Some AMD CPUs (e.g. AMD A4-6250J and AMD Ryzen 3000-series) have a
  785|       |     * failing random generation instruction, which always returns
  786|       |     * 0xffffffff, even when generation was "successful".
  787|       |     *
  788|       |     * This code checks if hardware random generator generates four consecutive
  789|       |     * equal numbers. If it does, then we probably have a failing one and
  790|       |     * should disable it completely.
  791|       |     *
  792|       |     * https://bugreports.qt.io/browse/QTBUG-69423
  793|       |     */
  794|      2|    constexpr qsizetype TestBufferSize = 4;
  795|      2|    unsigned testBuffer[TestBufferSize] = {};
  796|       |
  797|       |    // But if the RDRND feature was statically enabled by the compiler, we
  798|       |    // assume that the RNG works. That's because the calls to qRandomCpu() will
  799|       |    // be guarded by qCpuHasFeature(RDRND) and that will be a constant true.
  800|      2|    if (_compilerCpuFeatures & CpuFeatureRDRND)
  ------------------
  |  Branch (800:9): [Folded - Ignored]
  ------------------
  801|      0|        return true;
  802|       |
  803|      2|    unsigned *end = qt_random_rdrnd(testBuffer, testBuffer + TestBufferSize);
  804|      2|    if (end < testBuffer + 3) {
  ------------------
  |  Branch (804:9): [True: 0, False: 2]
  ------------------
  805|       |        // Random generation didn't produce enough data for us to make a
  806|       |        // determination whether it's working or not. Assume it isn't, but
  807|       |        // don't print a warning.
  808|      0|        return false;
  809|      0|    }
  810|       |
  811|       |    // Check the results for equality
  812|      2|    if (testBuffer[0] == testBuffer[1]
  ------------------
  |  Branch (812:9): [True: 0, False: 2]
  ------------------
  813|      2|        && testBuffer[0] == testBuffer[2]
  ------------------
  |  Branch (813:12): [True: 0, False: 0]
  ------------------
  814|      2|        && (end < testBuffer + TestBufferSize || testBuffer[0] == testBuffer[3])) {
  ------------------
  |  Branch (814:13): [True: 0, False: 0]
  |  Branch (814:50): [True: 0, False: 0]
  ------------------
  815|      0|        fprintf(stderr, "WARNING: CPU random generator seem to be failing, "
  816|      0|                        "disabling hardware random number generation\n"
  817|      0|                        "WARNING: RDRND generated:");
  818|      0|        for (unsigned *ptr = testBuffer; ptr < end; ++ptr)
  ------------------
  |  Branch (818:42): [True: 0, False: 0]
  ------------------
  819|      0|            fprintf(stderr, " 0x%x", *ptr);
  820|      0|        fprintf(stderr, "\n");
  821|      0|        return false;
  822|      0|    }
  823|       |
  824|       |    // We're good
  825|      2|    return true;
  826|      2|}
qsimd.cpp:_ZL15qt_random_rdrndPjS_:
  758|      2|{
  759|      2|    int retries = 10;
  760|      6|    while (ptr + sizeof(randuint)/sizeof(*ptr) <= end) {
  ------------------
  |  Branch (760:12): [True: 4, False: 2]
  ------------------
  761|      4|        if (_rdrandXX_step(reinterpret_cast<randuint *>(ptr)))
  ------------------
  |  |  711|      4|#    define _rdrandXX_step _rdrand64_step
  ------------------
  |  Branch (761:13): [True: 4, False: 0]
  ------------------
  762|      4|            ptr += sizeof(randuint)/sizeof(*ptr);
  763|      0|        else if (--retries == 0)
  ------------------
  |  Branch (763:18): [True: 0, False: 0]
  ------------------
  764|      0|            goto out;
  765|      4|    }
  766|       |
  767|      2|    while (sizeof(*ptr) != sizeof(randuint) && ptr != end) {
  ------------------
  |  Branch (767:12): [Folded - Ignored]
  |  Branch (767:48): [True: 0, False: 2]
  ------------------
  768|      0|        bool ok = _rdrand32_step(ptr);
  769|      0|        if (!ok && --retries)
  ------------------
  |  Branch (769:13): [True: 0, False: 0]
  |  Branch (769:20): [True: 0, False: 0]
  ------------------
  770|      0|            continue;
  771|      0|        if (ok)
  ------------------
  |  Branch (771:13): [True: 0, False: 0]
  ------------------
  772|      0|            ++ptr;
  773|      0|        break;
  774|      0|    }
  775|       |
  776|      2|out:
  777|      2|    return ptr;
  778|      2|}
qsimd.cpp:_ZN12_GLOBAL__N_116QSimdInitializerC2Ev:
  848|      2|    inline QSimdInitializer() { QT_MANGLE_NAMESPACE(qDetectCpuFeatures)(); }
  ------------------
  |  |   91|      2|# define QT_MANGLE_NAMESPACE(name) name
  ------------------
_Z9arraysizeIKtLj38EEjRAT0__T_:
   68|     78|{
   69|       |    // Same as std::size, but with QT_FUNCTION_TARGET_BASELIE,
   70|       |    // otherwise some versions of GCC fail to compile.
   71|     78|    return N;
   72|     78|}

_Z13qGetPtrHelperI14QScopedPointerI11QObjectData21QScopedPointerDeleterIS1_EEEDTcldtfp_3getEERT_:
  112|   400k|{ static_assert(noexcept(ptr.get()), "Smart d pointers for Q_DECLARE_PRIVATE must have noexcept get()"); return ptr.get(); }
_Z13qGetPtrHelperIK14QScopedPointerI11QObjectData21QScopedPointerDeleterIS1_EEEDTcldtfp_3getEERT_:
  112|  1.93k|{ static_assert(noexcept(ptr.get()), "Smart d pointers for Q_DECLARE_PRIVATE must have noexcept get()"); return ptr.get(); }

_Z7qgetenvPKc:
   44|     19|{
   45|     19|    const auto locker = qt_scoped_lock(environmentMutex);
   46|       |#ifdef Q_CC_MSVC
   47|       |    size_t requiredSize = 0;
   48|       |    QByteArray buffer;
   49|       |    getenv_s(&requiredSize, 0, 0, varName);
   50|       |    if (requiredSize == 0)
   51|       |        return buffer;
   52|       |    buffer.resize(qsizetype(requiredSize));
   53|       |    getenv_s(&requiredSize, buffer.data(), requiredSize, varName);
   54|       |    // requiredSize includes the terminating null, which we don't want.
   55|       |    Q_ASSERT(buffer.endsWith('\0'));
   56|       |    buffer.chop(1);
   57|       |    return buffer;
   58|       |#else
   59|     19|    return QByteArray(::getenv(varName));
   60|     19|#endif
   61|     19|}
_Z20qEnvironmentVariablePKcRK7QString:
  110|      8|{
  111|       |#if defined(Q_OS_WIN)
  112|       |    QVarLengthArray<wchar_t, 32> wname(qsizetype(strlen(varName)) + 1);
  113|       |    for (qsizetype i = 0; i < wname.size(); ++i) // wname.size() is correct: will copy terminating null
  114|       |        wname[i] = uchar(varName[i]);
  115|       |    size_t requiredSize = 0;
  116|       |    auto locker = qt_unique_lock(environmentMutex);
  117|       |    _wgetenv_s(&requiredSize, 0, 0, wname.data());
  118|       |    if (requiredSize == 0)
  119|       |        return defaultValue;
  120|       |    QString buffer(qsizetype(requiredSize), Qt::Uninitialized);
  121|       |    _wgetenv_s(&requiredSize, reinterpret_cast<wchar_t *>(buffer.data()), requiredSize,
  122|       |               wname.data());
  123|       |    locker.unlock();
  124|       |    // requiredSize includes the terminating null, which we don't want.
  125|       |    Q_ASSERT(buffer.endsWith(QChar(u'\0')));
  126|       |    buffer.chop(1);
  127|       |    return buffer;
  128|       |#else
  129|      8|    const auto locker = qt_scoped_lock(environmentMutex);
  130|      8|    const char *value = ::getenv(varName);
  131|      8|    if (!value)
  ------------------
  |  Branch (131:9): [True: 7, False: 1]
  ------------------
  132|      7|        return defaultValue;
  133|       |// duplicated in qfile.h (QFile::decodeName)
  134|       |#if defined(Q_OS_DARWIN)
  135|       |    return QString::fromUtf8(value).normalized(QString::NormalizationForm_C);
  136|       |#else // other Unix
  137|      1|    return QString::fromLocal8Bit(value);
  138|      8|#endif
  139|      8|#endif
  140|      8|}
_Z20qEnvironmentVariablePKc:
  143|      8|{
  144|      8|    return qEnvironmentVariable(varName, QString());
  145|      8|}
_Z25qEnvironmentVariableIsSetPKc:
  236|      1|{
  237|      1|    const auto locker = qt_scoped_lock(environmentMutex);
  238|       |#ifdef Q_CC_MSVC
  239|       |    size_t requiredSize = 0;
  240|       |    (void)getenv_s(&requiredSize, 0, 0, varName);
  241|       |    return requiredSize != 0;
  242|       |#else
  243|      1|    return ::getenv(varName) != nullptr;
  244|      1|#endif
  245|      1|}

_ZN26QAbstractFileEnginePrivateD2Ev:
   35|      2|QAbstractFileEnginePrivate::~QAbstractFileEnginePrivate()
_Z36qt_custom_file_engine_handler_createRK7QString:
  144|      7|{
  145|      7|    if (qt_file_engine_handlers_in_use.loadRelaxed()) {
  ------------------
  |  Branch (145:9): [True: 0, False: 7]
  ------------------
  146|      0|        QReadLocker locker(fileEngineHandlerMutex());
  147|       |
  148|       |        // check for registered handlers that can load the file
  149|      0|        for (QAbstractFileEngineHandler *handler : std::as_const(*fileEngineHandlers())) {
  ------------------
  |  Branch (149:50): [True: 0, False: 0]
  ------------------
  150|      0|            if (auto engine = handler->create(path))
  ------------------
  |  Branch (150:22): [True: 0, False: 0]
  ------------------
  151|      0|                return engine;
  152|      0|        }
  153|      0|    }
  154|       |
  155|      7|    return nullptr;
  156|      7|}
_ZN19QAbstractFileEngine6createERK7QString:
  186|      1|{
  187|      1|    QFileSystemEntry entry(fileName);
  188|      1|    QFileSystemMetaData metaData;
  189|      1|    auto engine = QFileSystemEngine::createLegacyEngine(entry, metaData);
  190|       |
  191|      1|#ifndef QT_NO_FSFILEENGINE
  192|      1|    if (!engine) // fall back to regular file engine
  ------------------
  |  Branch (192:9): [True: 1, False: 0]
  ------------------
  193|      1|        engine = std::make_unique<QFSFileEngine>(entry.filePath());
  194|      1|#endif
  195|       |
  196|      1|    return engine;
  197|      1|}
_ZN19QAbstractFileEngineC2ER26QAbstractFileEnginePrivate:
  333|      2|QAbstractFileEngine::QAbstractFileEngine(QAbstractFileEnginePrivate &dd) : d_ptr(&dd)
  334|      2|{
  335|      2|    Q_ASSERT(d_ptr->q_ptr == this);
  336|      2|}
_ZN19QAbstractFileEngineD2Ev:
  342|      2|{
  343|      2|}
_ZNK19QAbstractFileEngine5errorEv:
 1194|      1|{
 1195|      1|    Q_D(const QAbstractFileEngine);
 1196|      1|    return d->fileError;
 1197|      1|}
_ZNK19QAbstractFileEngine11errorStringEv:
 1207|      1|{
 1208|      1|    Q_D(const QAbstractFileEngine);
 1209|      1|    return d->errorString;
 1210|      1|}
_ZN19QAbstractFileEngine8setErrorEN11QFileDevice9FileErrorERK7QString:
 1220|      1|{
 1221|      1|    Q_D(QAbstractFileEngine);
 1222|      1|    d->fileError = error;
 1223|      1|    d->errorString = errorString;
 1224|      1|}

_ZN26QAbstractFileEnginePrivateC2EP19QAbstractFileEngine:
  248|      2|        : fileError(QFile::UnspecifiedError), q_ptr(q)
  249|      2|    {
  250|      2|    }

_ZN6QDebugD2Ev:
  156|   186k|{
  157|   186k|    if (stream && !--stream->ref) {
  ------------------
  |  Branch (157:9): [True: 186k, False: 0]
  |  Branch (157:19): [True: 186k, False: 0]
  ------------------
  158|   186k|        if (stream->space && stream->buffer.endsWith(u' '))
  ------------------
  |  Branch (158:13): [True: 186k, False: 0]
  |  Branch (158:30): [True: 186k, False: 0]
  ------------------
  159|   186k|            stream->buffer.chop(1);
  160|   186k|        if (stream->message_output) {
  ------------------
  |  Branch (160:13): [True: 186k, False: 0]
  ------------------
  161|   186k|            QInternalMessageLogContext ctxt(stream->context);
  162|   186k|            qt_message_output(stream->type,
  163|   186k|                              ctxt,
  164|   186k|                              stream->buffer);
  165|   186k|        }
  166|   186k|        delete stream;
  167|   186k|    }
  168|   186k|}

_ZN6QDebug10maybeSpaceEv:
  115|   195k|    inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; }
  ------------------
  |  Branch (115:39): [True: 195k, False: 0]
  ------------------

_ZN11QDirPrivateC2ERK7QStringRK5QListIS0_E6QFlagsIN4QDir8SortFlagEES7_INS8_6FilterEE:
   77|      1|    : QSharedData(), nameFilters(nameFilters_), sort(sort_), filters(filters_)
   78|      1|{
   79|      1|    setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
  ------------------
  |  Branch (79:13): [True: 0, False: 1]
  ------------------
   80|       |
   81|      1|    auto isEmpty = [](const auto &e) { return e.isEmpty(); };
   82|      1|    const bool empty = std::all_of(nameFilters.cbegin(), nameFilters.cend(), isEmpty);
   83|      1|    if (empty)
  ------------------
  |  Branch (83:9): [True: 1, False: 0]
  ------------------
   84|      1|        nameFilters = QStringList(QString::fromLatin1("*"));
   85|      1|}
_ZN4QDirC2ERK7QString:
  570|      1|QDir::QDir(const QString &path) : d_ptr(new QDirPrivate(path))
  571|      1|{
  572|      1|}
_ZN4QDirD2Ev:
  614|      1|{
  615|      1|}
_ZNK4QDir16absoluteFilePathERK7QString:
  805|      1|{
  806|      1|    if (treatAsAbsolute(fileName))
  ------------------
  |  Branch (806:9): [True: 0, False: 1]
  ------------------
  807|      0|        return fileName;
  808|       |
  809|      1|    Q_D(const QDir);
  810|      1|    QString absoluteDirPath = d->resolveAbsoluteEntry();
  811|      1|    if (fileName.isEmpty())
  ------------------
  |  Branch (811:9): [True: 0, False: 1]
  ------------------
  812|      0|        return absoluteDirPath;
  813|       |#ifdef Q_OS_WIN
  814|       |    // Handle the "absolute except for drive" case (i.e. \blah not c:\blah):
  815|       |    if (fileName.startsWith(u'/') || fileName.startsWith(u'\\')) {
  816|       |        // Combine absoluteDirPath's drive with fileName
  817|       |        const qsizetype drive = drivePrefixLength(absoluteDirPath);
  818|       |        if (Q_LIKELY(drive))
  819|       |            return QStringView{absoluteDirPath}.left(drive) % fileName;
  820|       |
  821|       |        qWarning("Base directory's drive is not a letter: %s",
  822|       |                 qUtf8Printable(QDir::toNativeSeparators(absoluteDirPath)));
  823|       |        return QString();
  824|       |    }
  825|       |#endif // Q_OS_WIN
  826|      1|    if (!absoluteDirPath.endsWith(u'/'))
  ------------------
  |  Branch (826:9): [True: 1, False: 0]
  ------------------
  827|      1|        return absoluteDirPath % u'/' % fileName;
  828|      0|    return absoluteDirPath % fileName;
  829|      1|}
_ZN4QDir18toNativeSeparatorsERK7QString:
  925|      3|{
  926|       |#if defined(Q_OS_WIN)
  927|       |    qsizetype i = pathName.indexOf(u'/');
  928|       |    if (i != -1) {
  929|       |        QString n(pathName);
  930|       |
  931|       |        QChar * const data = n.data();
  932|       |        data[i++] = u'\\';
  933|       |
  934|       |        for (; i < n.length(); ++i) {
  935|       |            if (data[i] == u'/')
  936|       |                data[i] = u'\\';
  937|       |        }
  938|       |
  939|       |        return n;
  940|       |    }
  941|       |#endif
  942|      3|    return pathName;
  943|      3|}
_ZN4QDir20fromNativeSeparatorsERK7QString:
  958|     13|{
  959|       |#if defined(Q_OS_WIN)
  960|       |    return QFileSystemEntry::removeUncOrLongPathPrefix(pathName).replace(u'\\', u'/');
  961|       |#else
  962|     13|    return pathName;
  963|     13|#endif
  964|     13|}
_ZN4QDir11currentPathEv:
 2051|      1|{
 2052|      1|    return QFileSystemEngine::currentPath().filePath();
 2053|      1|}
_ZN4QDir8homePathEv:
 2100|      1|{
 2101|      1|    return QFileSystemEngine::homePath();
 2102|      1|}
_Z24qt_normalizePathSegmentsP7QString6QFlagsIN11QDirPrivate17PathNormalizationEE:
 2218|      3|{
 2219|      3|    const bool isRemote = flags.testAnyFlag(QDirPrivate::RemotePath);
 2220|      3|    const qsizetype prefixLength = rootLength(*path);
 2221|       |
 2222|       |    // RFC 3986 says: "The input buffer is initialized with the now-appended
 2223|       |    // path components and the output buffer is initialized to the empty
 2224|       |    // string."
 2225|      3|    const QChar *in = path->constBegin();
 2226|       |
 2227|       |    // Scan the input for a "." or ".." segment. If there isn't any, we may not
 2228|       |    // need to modify this path at all. Also scan for "//" segments, which
 2229|       |    // will be normalized if the path is local.
 2230|      3|    qsizetype i = prefixLength;
 2231|      3|    qsizetype n = path->size();
 2232|     25|    for (bool lastWasSlash = true; i < n; ++i) {
  ------------------
  |  Branch (2232:36): [True: 23, False: 2]
  ------------------
 2233|     23|        if (lastWasSlash && in[i] == u'.') {
  ------------------
  |  Branch (2233:13): [True: 6, False: 17]
  |  Branch (2233:13): [True: 1, False: 22]
  |  Branch (2233:29): [True: 1, False: 5]
  ------------------
 2234|      1|            if (i + 1 == n || in[i + 1] == u'/')
  ------------------
  |  Branch (2234:17): [True: 1, False: 0]
  |  Branch (2234:17): [True: 1, False: 0]
  |  Branch (2234:31): [True: 0, False: 0]
  ------------------
 2235|      1|                break;
 2236|      0|            if (in[i + 1] == u'.' && (i + 2 == n || in[i + 2] == u'/'))
  ------------------
  |  Branch (2236:17): [True: 0, False: 0]
  |  Branch (2236:17): [True: 0, False: 0]
  |  Branch (2236:39): [True: 0, False: 0]
  |  Branch (2236:53): [True: 0, False: 0]
  ------------------
 2237|      0|                break;
 2238|      0|        }
 2239|     22|        if (!isRemote && lastWasSlash && in[i] == u'/' && i > 0) {
  ------------------
  |  Branch (2239:13): [True: 22, False: 0]
  |  Branch (2239:13): [True: 0, False: 22]
  |  Branch (2239:26): [True: 5, False: 17]
  |  Branch (2239:42): [True: 0, False: 5]
  |  Branch (2239:59): [True: 0, False: 0]
  ------------------
 2240|       |            // backtrack one, so the algorithm below gobbles up the remaining
 2241|       |            // slashes
 2242|      0|            --i;
 2243|      0|            break;
 2244|      0|        }
 2245|     22|        lastWasSlash = in[i] == u'/';
 2246|     22|    }
 2247|      3|    if (i == n)
  ------------------
  |  Branch (2247:9): [True: 2, False: 1]
  ------------------
 2248|      2|        return true;
 2249|       |
 2250|      1|    QChar *out = path->data();  // detaches
 2251|      1|    const QChar *start = out + prefixLength;
 2252|      1|    const QChar *end = out + path->size();
 2253|      1|    out += i;
 2254|      1|    in = out;
 2255|       |
 2256|       |    // We implement a modified algorithm compared to RFC 3986, for efficiency.
 2257|      1|    bool ok = true;
 2258|      1|    do {
 2259|       |#if 0   // to see in the debugger
 2260|       |        QString output = QStringView(path->constBegin(), out).toString();
 2261|       |        QStringView input(in, end);
 2262|       |#endif
 2263|       |
 2264|       |        // First, copy the preceding slashes, so we can look at the segment's
 2265|       |        // content. If the path is part of a URL, we copy all slashes, otherwise
 2266|       |        // just one.
 2267|      1|        if (in[0] == u'/') {
  ------------------
  |  Branch (2267:13): [True: 0, False: 1]
  ------------------
 2268|      0|            *out++ = *in++;
 2269|      0|            while (in < end && in[0] == u'/') {
  ------------------
  |  Branch (2269:20): [True: 0, False: 0]
  |  Branch (2269:20): [True: 0, False: 0]
  |  Branch (2269:32): [True: 0, False: 0]
  ------------------
 2270|      0|                if (isRemote)
  ------------------
  |  Branch (2270:21): [True: 0, False: 0]
  ------------------
 2271|      0|                    *out++ = *in++;
 2272|      0|                else
 2273|      0|                    ++in; // Skip multiple slashes for local URLs
 2274|       |
 2275|       |                // Note: we may exit this loop with in == end, in which case we
 2276|       |                // *shouldn't* dereference *in. But since we are pointing to a
 2277|       |                // detached, non-empty QString, we know there's a u'\0' at the
 2278|       |                // end, so dereferencing is safe.
 2279|      0|            }
 2280|      0|        }
 2281|       |
 2282|       |        // Is this path segment either "." or ".."?
 2283|      1|        enum { Nothing, Dot, DotDot } type = Nothing;
 2284|      1|        if (in[0] == u'.') {
  ------------------
  |  Branch (2284:13): [True: 1, False: 0]
  ------------------
 2285|      1|            if (in + 1 == end || in[1] == u'/')
  ------------------
  |  Branch (2285:17): [True: 1, False: 0]
  |  Branch (2285:17): [True: 1, False: 0]
  |  Branch (2285:34): [True: 0, False: 0]
  ------------------
 2286|      1|                type = Dot;
 2287|      0|            else if (in[1] == u'.' && (in + 2 == end || in[2] == u'/'))
  ------------------
  |  Branch (2287:22): [True: 0, False: 0]
  |  Branch (2287:22): [True: 0, False: 0]
  |  Branch (2287:40): [True: 0, False: 0]
  |  Branch (2287:57): [True: 0, False: 0]
  ------------------
 2288|      0|                type = DotDot;
 2289|      1|        }
 2290|      1|        if (type == Nothing) {
  ------------------
  |  Branch (2290:13): [True: 0, False: 1]
  ------------------
 2291|       |            // If it is neither, then we copy this segment.
 2292|      0|            while (in < end && in[0] != u'/')
  ------------------
  |  Branch (2292:20): [True: 0, False: 0]
  |  Branch (2292:20): [True: 0, False: 0]
  |  Branch (2292:32): [True: 0, False: 0]
  ------------------
 2293|      0|                *out++ = *in++;
 2294|      0|            continue;
 2295|      0|        }
 2296|       |
 2297|       |        // Otherwise, we skip it and remove preceding slashes (if
 2298|       |        // any, exactly one if part of a URL, all otherwise) from the
 2299|       |        // output. If it is "..", we remove the segment before that and
 2300|       |        // preceding slashes too in a similar fashion, if they are there.
 2301|      1|        if (type == DotDot) {
  ------------------
  |  Branch (2301:13): [True: 0, False: 1]
  ------------------
 2302|      0|            if (Q_UNLIKELY(out == start)) {
 2303|       |                // we can't go further up from here, so we "re-root"
 2304|       |                // without cleaning this segment
 2305|      0|                ok = false;
 2306|      0|                if (!isRemote) {
  ------------------
  |  Branch (2306:21): [True: 0, False: 0]
  ------------------
 2307|      0|                    *out++ = u'.';
 2308|      0|                    *out++ = u'.';
 2309|      0|                    if (in + 2 != end) {
  ------------------
  |  Branch (2309:25): [True: 0, False: 0]
  ------------------
 2310|      0|                        Q_ASSERT(in[2] == u'/');
 2311|      0|                        *out++ = u'/';
 2312|      0|                        ++in;
 2313|      0|                    }
 2314|      0|                    start = out;
 2315|      0|                    in += 2;
 2316|      0|                    continue;
 2317|      0|                }
 2318|      0|            }
 2319|       |
 2320|      0|            if (out > start)
  ------------------
  |  Branch (2320:17): [True: 0, False: 0]
  ------------------
 2321|      0|                --out; // backtrack the first dot
 2322|       |            // backtrack the previous path segment
 2323|      0|            while (out > start && out[-1] != u'/')
  ------------------
  |  Branch (2323:20): [True: 0, False: 0]
  |  Branch (2323:20): [True: 0, False: 0]
  |  Branch (2323:35): [True: 0, False: 0]
  ------------------
 2324|      0|                --out;
 2325|      0|            in += 2;    // the two dots
 2326|      1|        } else {
 2327|      1|            ++in;       // the one dot
 2328|      1|        }
 2329|       |
 2330|       |        // Not at 'end' yet, prepare for the next loop iteration by backtracking one slash.
 2331|       |        // E.g.: /a/b/../c    >>> /a/b/../c
 2332|       |        //          ^out            ^out
 2333|       |        // the next iteration will copy '/c' to the output buffer >>> /a/c
 2334|      1|        if (in != end && out > start && out[-1] == u'/')
  ------------------
  |  Branch (2334:13): [True: 0, False: 1]
  |  Branch (2334:13): [True: 0, False: 1]
  |  Branch (2334:26): [True: 0, False: 0]
  |  Branch (2334:41): [True: 0, False: 0]
  ------------------
 2335|      0|            --out;
 2336|      1|        if (out == start) {
  ------------------
  |  Branch (2336:13): [True: 0, False: 1]
  ------------------
 2337|       |            // We've reached the root. Make sure we don't turn a relative path
 2338|       |            // to absolute or, in the case of local paths that are already
 2339|       |            // absolute, into UNC.
 2340|       |            // Note: this will turn ".//a" into "a" even for URLs!
 2341|      0|            if (in != end && in[0] == u'/')
  ------------------
  |  Branch (2341:17): [True: 0, False: 0]
  |  Branch (2341:17): [True: 0, False: 0]
  |  Branch (2341:30): [True: 0, False: 0]
  ------------------
 2342|      0|                ++in;
 2343|      0|            while (prefixLength == 0 && in != end && in[0] == u'/')
  ------------------
  |  Branch (2343:20): [True: 0, False: 0]
  |  Branch (2343:20): [True: 0, False: 0]
  |  Branch (2343:41): [True: 0, False: 0]
  |  Branch (2343:54): [True: 0, False: 0]
  ------------------
 2344|      0|                ++in;
 2345|      0|        }
 2346|      1|    } while (in < end);
  ------------------
  |  Branch (2346:14): [True: 0, False: 1]
  ------------------
 2347|       |
 2348|      0|    path->truncate(out - path->constBegin());
 2349|      1|    if (!isRemote && path->isEmpty())
  ------------------
  |  Branch (2349:9): [True: 1, False: 0]
  |  Branch (2349:22): [True: 0, False: 1]
  ------------------
 2350|      0|        *path = u"."_s;
 2351|       |
 2352|       |    // we return false only if the path was absolute
 2353|      1|    return ok || prefixLength == 0;
  ------------------
  |  Branch (2353:12): [True: 1, False: 0]
  |  Branch (2353:18): [True: 0, False: 0]
  ------------------
 2354|      3|}
_ZN4QDir9cleanPathERK7QString:
 2389|      3|{
 2390|      3|    QString ret = path;
 2391|      3|    qt_cleanPath(&ret);
 2392|      3|    return ret;
 2393|      3|}
_ZN4QDir14isRelativePathERK7QString:
 2405|      2|{
 2406|      2|    return QFileInfo(path).isRelative();
 2407|      2|}
_ZN11QDirPrivate7setPathERK7QString:
  145|      1|{
  146|      1|    QString p = QDir::fromNativeSeparators(path);
  147|      1|    if (p.endsWith(u'/')
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      1|            && p.size() > 1
  ------------------
  |  Branch (148:16): [True: 0, False: 0]
  ------------------
  149|       |#if defined(Q_OS_WIN)
  150|       |        && (!(p.length() == 3 && p.at(1).unicode() == ':' && p.at(0).isLetter()))
  151|       |#endif
  152|      1|    ) {
  153|      0|            p.truncate(p.size() - 1);
  154|      0|    }
  155|      1|    dirEntry = QFileSystemEntry(p, QFileSystemEntry::FromInternalPath());
  156|      1|    clearCache(IncludingMetaData);
  157|      1|    fileCache.absoluteDirEntry = QFileSystemEntry();
  158|      1|}
_ZNK11QDirPrivate20resolveAbsoluteEntryEv:
  161|      1|{
  162|      1|    QMutexLocker locker(&fileCache.mutex);
  163|      1|    if (!fileCache.absoluteDirEntry.isEmpty())
  ------------------
  |  Branch (163:9): [True: 0, False: 1]
  ------------------
  164|      0|        return fileCache.absoluteDirEntry.filePath();
  165|       |
  166|      1|    if (dirEntry.isEmpty())
  ------------------
  |  Branch (166:9): [True: 0, False: 1]
  ------------------
  167|      0|        return dirEntry.filePath();
  168|       |
  169|      1|    QString absoluteName;
  170|      1|    if (!fileEngine) {
  ------------------
  |  Branch (170:9): [True: 1, False: 0]
  ------------------
  171|      1|        if (!dirEntry.isRelative() && dirEntry.isClean()) {
  ------------------
  |  Branch (171:13): [True: 1, False: 0]
  |  Branch (171:39): [True: 1, False: 0]
  ------------------
  172|      1|            fileCache.absoluteDirEntry = dirEntry;
  173|      1|            return dirEntry.filePath();
  174|      1|        }
  175|       |
  176|      0|        absoluteName = QFileSystemEngine::absoluteName(dirEntry).filePath();
  177|      0|    } else {
  178|      0|        absoluteName = fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
  179|      0|    }
  180|      0|    auto absoluteFileSystemEntry =
  181|      0|            QFileSystemEntry(QDir::cleanPath(absoluteName), QFileSystemEntry::FromInternalPath());
  182|      0|    fileCache.absoluteDirEntry = absoluteFileSystemEntry;
  183|      0|    return absoluteFileSystemEntry.filePath();
  184|      1|}
qdir.cpp:_ZL15treatAsAbsoluteRK7QString:
  750|      1|{
  751|       |    // ### Qt 6: be consistent about absolute paths
  752|       |
  753|       |    // QFileInfo will use the right FS-engine for virtual file-systems
  754|       |    // (e.g. resource paths).  Unfortunately, for real file-systems, it relies
  755|       |    // on QFileSystemEntry's isRelative(), which is flawed on MS-Win, ignoring
  756|       |    // its (correct) isAbsolute().  So only use that isAbsolute() unless there's
  757|       |    // a colon in the path.
  758|       |    // FIXME: relies on virtual file-systems having colons in their prefixes.
  759|       |    // The case of an MS-absolute C:/... path happens to work either way.
  760|      1|    return (path.contains(u':') && QFileInfo(path).isAbsolute())
  ------------------
  |  Branch (760:13): [True: 0, False: 1]
  |  Branch (760:36): [True: 0, False: 0]
  ------------------
  761|      1|        || QFileSystemEntry(path).isAbsolute();
  ------------------
  |  Branch (761:12): [True: 0, False: 1]
  ------------------
  762|      1|}
_ZN11QDirPrivate10clearCacheENS_16MetaDataClearingE:
  354|      1|{
  355|      1|    QMutexLocker locker(&fileCache.mutex);
  356|      1|    if (mode == IncludingMetaData)
  ------------------
  |  Branch (356:9): [True: 1, False: 0]
  ------------------
  357|      1|        fileCache.metaData.clear();
  358|      1|    fileCache.fileListsInitialized = false;
  359|      1|    fileCache.files.clear();
  360|      1|    fileCache.fileInfos.clear();
  361|      1|    fileEngine = QFileSystemEngine::createLegacyEngine(dirEntry, fileCache.metaData);
  362|      1|}
qdir.cpp:_ZL10rootLength11QStringView:
   56|      3|{
   57|       |#if defined(Q_OS_WIN)
   58|       |    const qsizetype len = name.size();
   59|       |    // Handle possible UNC paths which start with double slash
   60|       |    if (name.startsWith("//"_L1)) {
   61|       |        // Server name '//server/path' is part of the prefix.
   62|       |        const qsizetype nextSlash = name.indexOf(u'/', 2);
   63|       |        return nextSlash >= 0 ? nextSlash + 1 : len;
   64|       |    }
   65|       |    if (len >= 2 && name.at(1) == u':') {
   66|       |        // Handle a possible drive letter
   67|       |        return len > 2 && name.at(2) == u'/' ? 3 : 2;
   68|       |    }
   69|       |#endif
   70|       |
   71|      3|    return name.startsWith(u'/') ? 1 : 0;
  ------------------
  |  Branch (71:12): [True: 3, False: 0]
  ------------------
   72|      3|}
qdir.cpp:_ZL12qt_cleanPathP7QString:
 2357|      3|{
 2358|      3|    if (path->isEmpty())
  ------------------
  |  Branch (2358:9): [True: 0, False: 3]
  ------------------
 2359|      0|        return true;
 2360|       |
 2361|      3|    QString &ret = *path;
 2362|      3|    ret = QDir::fromNativeSeparators(ret);
 2363|      3|    bool ok = qt_normalizePathSegments(&ret, QDirPrivate::DefaultNormalization);
 2364|       |
 2365|       |    // Strip away last slash except for root directories
 2366|      3|    if (ret.size() > 1 && ret.endsWith(u'/')) {
  ------------------
  |  Branch (2366:9): [True: 3, False: 0]
  |  Branch (2366:27): [True: 1, False: 2]
  ------------------
 2367|       |#if defined (Q_OS_WIN)
 2368|       |        if (!(ret.length() == 3 && ret.at(1) == u':'))
 2369|       |#endif
 2370|      1|            ret.chop(1);
 2371|      1|    }
 2372|       |
 2373|      3|    return ok;
 2374|      3|}

_ZNK4QDir6d_funcEv:
  251|      1|    const QDirPrivate *d_func() const { return d_ptr.constData(); }

_ZN12QFilePrivateC2Ev:
   39|      1|{
   40|      1|}
_ZN12QFilePrivateD2Ev:
   43|      1|{
   44|      1|}
_ZNK12QFilePrivate6engineEv:
   77|      1|{
   78|      1|    if (!fileEngine)
  ------------------
  |  Branch (78:9): [True: 1, False: 0]
  ------------------
   79|      1|        fileEngine = QAbstractFileEngine::create(fileName);
   80|      1|    return fileEngine.get();
   81|      1|}
_ZN5QFileC2ERK7QString:
  240|      1|    : QFileDevice(*new QFilePrivate, nullptr)
  241|      1|{
  242|      1|    Q_D(QFile);
  243|      1|    d->fileName = name;
  244|      1|}
_ZN5QFileD2Ev:
  268|      1|{
  269|      1|}
_ZN5QFile6existsERK7QString:
  369|      1|{
  370|      1|    return QFileInfo::exists(fileName);
  371|      1|}
_ZN5QFile4openE6QFlagsIN13QIODeviceBase12OpenModeFlagEE:
  939|      1|{
  940|      1|    Q_D(QFile);
  941|      1|    if (isOpen())
  ------------------
  |  Branch (941:9): [True: 0, False: 1]
  ------------------
  942|      0|        return file_already_open(*this);
  943|       |    // Either Append or NewOnly implies WriteOnly
  944|      1|    if (mode & (Append | NewOnly))
  ------------------
  |  Branch (944:9): [True: 0, False: 1]
  ------------------
  945|      0|        mode |= WriteOnly;
  946|      1|    unsetError();
  947|      1|    if ((mode & (ReadOnly | WriteOnly)) == 0) {
  ------------------
  |  Branch (947:9): [True: 0, False: 1]
  ------------------
  948|      0|        qWarning("QIODevice::open: File access not specified");
  949|      0|        return false;
  950|      0|    }
  951|       |
  952|       |    // QIODevice provides the buffering, so there's no need to request it from the file engine.
  953|      1|    if (d->engine()->open(mode | QIODevice::Unbuffered)) {
  ------------------
  |  Branch (953:9): [True: 0, False: 1]
  ------------------
  954|      0|        QIODevice::open(mode);
  955|      0|        if (mode & Append)
  ------------------
  |  Branch (955:13): [True: 0, False: 0]
  ------------------
  956|      0|            seek(size());
  957|      0|        return true;
  958|      0|    }
  959|      1|    QFile::FileError err = d->fileEngine->error();
  960|      1|    if (err == QFile::UnspecifiedError)
  ------------------
  |  Branch (960:9): [True: 0, False: 1]
  ------------------
  961|      0|        err = QFile::OpenError;
  962|      1|    d->setError(err, d->fileEngine->errorString());
  963|      1|    return false;
  964|      1|}

_ZN5QFile10encodeNameERK7QString:
  159|      3|    {
  160|      3|        return fileName.toLocal8Bit();
  161|      3|    }
_ZN5QFile10decodeNameERK10QByteArray:
  163|      1|    {
  164|      1|        return QString::fromLocal8Bit(localFileName);
  165|      1|    }

_ZN18QFileDevicePrivateC2Ev:
   20|      1|    : cachedSize(0),
   21|      1|      error(QFile::NoError), lastWasWrite(false)
   22|      1|{
   23|      1|    writeBufferChunkSize = QFILE_WRITEBUFFER_SIZE;
  ------------------
  |  |   16|      1|#define QFILE_WRITEBUFFER_SIZE 16384
  ------------------
   24|      1|}
_ZN18QFileDevicePrivateD2Ev:
   26|      1|QFileDevicePrivate::~QFileDevicePrivate() = default;
_ZN18QFileDevicePrivate8setErrorEN11QFileDevice9FileErrorE:
   36|      1|{
   37|      1|    error = err;
   38|      1|    errorString.clear();
   39|      1|}
_ZN18QFileDevicePrivate8setErrorEN11QFileDevice9FileErrorERK7QString:
   42|      1|{
   43|      1|    error = err;
   44|      1|    errorString = errStr;
   45|      1|}
_ZN11QFileDeviceC2ER18QFileDevicePrivateP7QObject:
  228|      1|    : QIODevice(dd, parent)
  229|      1|{
  230|      1|}
_ZN11QFileDeviceD2Ev:
  237|      1|{
  238|      1|    close();
  239|      1|}
_ZN11QFileDevice5closeEv:
  327|      1|{
  328|      1|    Q_D(QFileDevice);
  329|      1|    if (!isOpen())
  ------------------
  |  Branch (329:9): [True: 1, False: 0]
  ------------------
  330|      1|        return;
  331|      0|    bool flushed = flush();
  332|      0|    QIODevice::close();
  333|       |
  334|       |    // reset write buffer
  335|      0|    d->lastWasWrite = false;
  336|      0|    d->writeBuffer.clear();
  337|       |
  338|       |    // reset cached size
  339|      0|    d->cachedSize = 0;
  340|       |
  341|       |    // If flush() succeeded but close() failed, copy its error condition;
  342|       |    // otherwise, keep the earlier flush() error.
  343|      0|    if (d->fileEngine->close() && flushed)
  ------------------
  |  Branch (343:9): [True: 0, False: 0]
  |  Branch (343:35): [True: 0, False: 0]
  ------------------
  344|      0|        unsetError();
  345|      0|    else if (flushed)
  ------------------
  |  Branch (345:14): [True: 0, False: 0]
  ------------------
  346|      0|        d->setError(d->fileEngine->error(), d->fileEngine->errorString());
  347|      0|}
_ZN11QFileDevice10unsetErrorEv:
  599|      1|{
  600|      1|    Q_D(QFileDevice);
  601|      1|    d->setError(QFileDevice::NoError);
  602|      1|}

_ZNK16QFileInfoPrivate12getFileFlagsE6QFlagsIN19QAbstractFileEngine8FileFlagEE:
  100|      1|{
  101|      1|    Q_ASSERT(fileEngine); // should never be called when using the native FS
  102|       |    // We split the testing into tests for for LinkType, BundleType, PermsMask
  103|       |    // and the rest.
  104|       |    // Tests for file permissions on Windows can be slow, especially on network
  105|       |    // paths and NTFS drives.
  106|       |    // In order to determine if a file is a symlink or not, we have to lstat().
  107|       |    // If we're not interested in that information, we might as well avoid one
  108|       |    // extra syscall. Bundle detecton on Mac can be slow, especially on network
  109|       |    // paths, so we separate out that as well.
  110|       |
  111|      1|    QAbstractFileEngine::FileFlags req;
  112|      1|    uint cachedFlags = 0;
  113|       |
  114|      1|    if (request & (QAbstractFileEngine::FlagsMask | QAbstractFileEngine::TypesMask)) {
  ------------------
  |  Branch (114:9): [True: 1, False: 0]
  ------------------
  115|      1|        if (!getCachedFlag(CachedFileFlags)) {
  ------------------
  |  Branch (115:13): [True: 1, False: 0]
  ------------------
  116|      1|            req |= QAbstractFileEngine::FlagsMask;
  117|      1|            req |= QAbstractFileEngine::TypesMask;
  118|      1|            req &= (~QAbstractFileEngine::LinkType);
  119|      1|            req &= (~QAbstractFileEngine::BundleType);
  120|       |
  121|      1|            cachedFlags |= CachedFileFlags;
  122|      1|        }
  123|       |
  124|      1|        if (request & QAbstractFileEngine::LinkType) {
  ------------------
  |  Branch (124:13): [True: 0, False: 1]
  ------------------
  125|      0|            if (!getCachedFlag(CachedLinkTypeFlag)) {
  ------------------
  |  Branch (125:17): [True: 0, False: 0]
  ------------------
  126|      0|                req |= QAbstractFileEngine::LinkType;
  127|      0|                cachedFlags |= CachedLinkTypeFlag;
  128|      0|            }
  129|      0|        }
  130|       |
  131|      1|        if (request & QAbstractFileEngine::BundleType) {
  ------------------
  |  Branch (131:13): [True: 0, False: 1]
  ------------------
  132|      0|            if (!getCachedFlag(CachedBundleTypeFlag)) {
  ------------------
  |  Branch (132:17): [True: 0, False: 0]
  ------------------
  133|      0|                req |= QAbstractFileEngine::BundleType;
  134|      0|                cachedFlags |= CachedBundleTypeFlag;
  135|      0|            }
  136|      0|        }
  137|      1|    }
  138|       |
  139|      1|    if (request & QAbstractFileEngine::PermsMask) {
  ------------------
  |  Branch (139:9): [True: 0, False: 1]
  ------------------
  140|      0|        if (!getCachedFlag(CachedPerms)) {
  ------------------
  |  Branch (140:13): [True: 0, False: 0]
  ------------------
  141|      0|            req |= QAbstractFileEngine::PermsMask;
  142|      0|            cachedFlags |= CachedPerms;
  143|      0|        }
  144|      0|    }
  145|       |
  146|      1|    if (req) {
  ------------------
  |  Branch (146:9): [True: 1, False: 0]
  ------------------
  147|      1|        if (cache_enabled)
  ------------------
  |  Branch (147:13): [True: 1, False: 0]
  ------------------
  148|      1|            req &= (~QAbstractFileEngine::Refresh);
  149|      0|        else
  150|      0|            req |= QAbstractFileEngine::Refresh;
  151|       |
  152|      1|        QAbstractFileEngine::FileFlags flags = fileEngine->fileFlags(req);
  153|      1|        fileFlags |= uint(flags.toInt());
  154|      1|        setCachedFlag(cachedFlags);
  155|      1|    }
  156|       |
  157|      1|    return fileFlags & request.toInt();
  158|      1|}
_ZN9QFileInfoC2EP16QFileInfoPrivate:
  346|      1|QFileInfo::QFileInfo(QFileInfoPrivate *p) : d_ptr(p)
  347|      1|{
  348|      1|}
_ZN9QFileInfoC2ERK7QString:
  370|      4|QFileInfo::QFileInfo(const QString &path) : d_ptr(new QFileInfoPrivate(path))
  371|      4|{
  372|      4|}
_ZN9QFileInfoD2Ev:
  420|      5|{
  421|      5|}
_ZNK9QFileInfo10isRelativeEv:
  687|      2|{
  688|      2|    Q_D(const QFileInfo);
  689|      2|    if (d->isDefaultConstructed)
  ------------------
  |  Branch (689:9): [True: 0, False: 2]
  ------------------
  690|      0|        return true;
  691|      2|    if (d->fileEngine == nullptr)
  ------------------
  |  Branch (691:9): [True: 2, False: 0]
  ------------------
  692|      2|        return d->fileEntry.isRelative();
  693|      0|    return d->fileEngine->isRelativePath();
  694|      2|}
_ZNK9QFileInfo6existsEv:
  721|      1|{
  722|      1|    Q_D(const QFileInfo);
  723|      1|    if (d->isDefaultConstructed)
  ------------------
  |  Branch (723:9): [True: 0, False: 1]
  ------------------
  724|      0|        return false;
  725|      1|    if (d->fileEngine == nullptr) {
  ------------------
  |  Branch (725:9): [True: 0, False: 1]
  ------------------
  726|      0|        if (!d->cache_enabled || !d->metaData.hasFlags(QFileSystemMetaData::ExistsAttribute))
  ------------------
  |  Branch (726:13): [True: 0, False: 0]
  |  Branch (726:34): [True: 0, False: 0]
  ------------------
  727|      0|            QFileSystemEngine::fillMetaData(d->fileEntry, d->metaData, QFileSystemMetaData::ExistsAttribute);
  728|      0|        return d->metaData.exists();
  729|      0|    }
  730|      1|    return d->getFileFlags(QAbstractFileEngine::ExistsFlag);
  731|      1|}
_ZN9QFileInfo6existsERK7QString:
  746|      1|{
  747|      1|    if (path.isEmpty())
  ------------------
  |  Branch (747:9): [True: 0, False: 1]
  ------------------
  748|      0|        return false;
  749|      1|    QFileSystemEntry entry(path);
  750|      1|    QFileSystemMetaData data;
  751|       |    // Expensive fallback to non-QFileSystemEngine implementation
  752|      1|    if (auto engine = QFileSystemEngine::createLegacyEngine(entry, data))
  ------------------
  |  Branch (752:14): [True: 1, False: 0]
  ------------------
  753|      1|        return QFileInfo(new QFileInfoPrivate(entry, data, std::move(engine))).exists();
  754|       |
  755|      0|    QFileSystemEngine::fillMetaData(entry, data, QFileSystemMetaData::ExistsAttribute);
  756|      0|    return data.exists();
  757|      1|}
_ZNK9QFileInfo6isFileEv:
 1072|      2|{
 1073|      2|    Q_D(const QFileInfo);
 1074|      2|    return d->checkAttribute<bool>(
 1075|      2|                QFileSystemMetaData::FileType,
 1076|      2|                [d]() { return d->metaData.isFile(); },
 1077|      2|                [d]() { return d->getFileFlags(QAbstractFileEngine::FileType); });
 1078|      2|}
qfileinfo.cpp:_ZZNK9QFileInfo6isFileEvENK3$_0clEv:
 1076|      2|                [d]() { return d->metaData.isFile(); },

_ZNK9QFileInfo6d_funcEv:
  183|      5|    {
  184|      5|        return d_ptr.constData();
  185|      5|    }

_ZN16QFileInfoPrivateC2ERK7QString:
   70|      4|        : fileEntry(file),
   71|      4|        fileEngine(QFileSystemEngine::createLegacyEngine(fileEntry, metaData)),
   72|      4|        cachedFlags(0),
   73|       |#ifndef QT_NO_FSFILEENGINE
   74|      4|        isDefaultConstructed(file.isEmpty()),
   75|       |#else
   76|       |        isDefaultConstructed(!fileEngine),
   77|       |#endif
   78|      4|        cache_enabled(true), fileFlags(0), fileSize(0)
   79|      4|    {
   80|      4|    }
_ZN16QFileInfoPrivateC2ERK16QFileSystemEntryRK19QFileSystemMetaDataNSt3__110unique_ptrI19QAbstractFileEngineNS6_14default_deleteIS8_EEEE:
   98|      1|        : fileEntry(file),
   99|      1|        metaData(data),
  100|      1|        fileEngine{std::move(engine)},
  101|      1|        cachedFlags(0),
  102|       |#ifndef QT_NO_FSFILEENGINE
  103|      1|        isDefaultConstructed(false),
  104|       |#else
  105|       |        isDefaultConstructed(!fileEngine),
  106|       |#endif
  107|      1|        cache_enabled(true), fileFlags(0), fileSize(0)
  108|      1|    {
  109|      1|    }
_ZNK16QFileInfoPrivate13getCachedFlagEj:
  146|      1|    { return cache_enabled ? (cachedFlags & c) : 0; }
  ------------------
  |  Branch (146:14): [True: 1, False: 0]
  ------------------
_ZNK16QFileInfoPrivate13setCachedFlagEj:
  148|      1|    { if (cache_enabled) cachedFlags |= c; }
  ------------------
  |  Branch (148:11): [True: 1, False: 0]
  ------------------
qfileinfo.cpp:_ZNK16QFileInfoPrivate14checkAttributeIbZNK9QFileInfo6isFileEvE3$_0ZNKS1_6isFileEvE3$_1EET_6QFlagsIN19QFileSystemMetaData12MetaDataFlagEET0_T1_:
  168|      2|    {
  169|      2|        return checkAttribute(Ret(), std::move(fsFlags), std::move(fsLambda), engineLambda);
  170|      2|    }
qfileinfo.cpp:_ZNK16QFileInfoPrivate14checkAttributeIbZNK9QFileInfo6isFileEvE3$_0ZNKS1_6isFileEvE3$_1EET_S4_6QFlagsIN19QFileSystemMetaData12MetaDataFlagEET0_T1_:
  153|      2|    {
  154|      2|        if (isDefaultConstructed)
  ------------------
  |  Branch (154:13): [True: 0, False: 2]
  ------------------
  155|      0|            return defaultValue;
  156|      2|        if (fileEngine)
  ------------------
  |  Branch (156:13): [True: 0, False: 2]
  ------------------
  157|      0|            return engineLambda();
  158|      2|        if (!cache_enabled || !metaData.hasFlags(fsFlags)) {
  ------------------
  |  Branch (158:13): [True: 0, False: 2]
  |  Branch (158:31): [True: 2, False: 0]
  ------------------
  159|      2|            QFileSystemEngine::fillMetaData(fileEntry, metaData, fsFlags);
  160|       |            // ignore errors, fillMetaData will have cleared the flags
  161|      2|        }
  162|      2|        return fsLambda();
  163|      2|    }

_ZN17QFileSystemEngine18createLegacyEngineER16QFileSystemEntryR19QFileSystemMetaData:
  179|      7|{
  180|      7|    QFileSystemEntry copy = entry;
  181|      7|    std::unique_ptr<QAbstractFileEngine> engine;
  182|       |
  183|      7|    if (_q_createLegacyEngine_recursive(copy, data, engine))
  ------------------
  |  Branch (183:9): [True: 7, False: 0]
  ------------------
  184|       |        // Reset entry to resolved copy.
  185|      7|        entry = copy;
  186|      0|    else
  187|      0|        data.clear();
  188|       |
  189|      7|    return engine;
  190|      7|}
qfilesystemengine.cpp:_ZL31_q_createLegacyEngine_recursiveR16QFileSystemEntryR19QFileSystemMetaDataRNSt3__110unique_ptrI19QAbstractFileEngineNS3_14default_deleteIS5_EEEEb:
  116|      7|{
  117|      7|    QString const &filePath = entry.filePath();
  118|      7|    if ((engine = qt_custom_file_engine_handler_create(filePath)))
  ------------------
  |  Branch (118:9): [True: 0, False: 7]
  ------------------
  119|      0|        return _q_checkEntry(engine, resolvingEntry);
  120|       |
  121|      7|#if defined(QT_BUILD_CORE_LIB)
  122|      8|    for (qsizetype prefixSeparator = 0; prefixSeparator < filePath.size(); ++prefixSeparator) {
  ------------------
  |  Branch (122:41): [True: 7, False: 1]
  ------------------
  123|      7|        QChar const ch = filePath[prefixSeparator];
  124|      7|        if (ch == u'/')
  ------------------
  |  Branch (124:13): [True: 5, False: 2]
  ------------------
  125|      5|            break;
  126|       |
  127|      2|        if (ch == u':') {
  ------------------
  |  Branch (127:13): [True: 1, False: 1]
  ------------------
  128|      1|            if (prefixSeparator == 0) {
  ------------------
  |  Branch (128:17): [True: 1, False: 0]
  ------------------
  129|      1|                engine = std::make_unique<QResourceFileEngine>(filePath);
  130|      1|                return _q_checkEntry(engine, resolvingEntry);
  131|      1|            }
  132|       |
  133|      0|            if (prefixSeparator == 1)
  ------------------
  |  Branch (133:17): [True: 0, False: 0]
  ------------------
  134|      0|                break;
  135|       |
  136|      0|            const QStringList &paths = QDir::searchPaths(filePath.left(prefixSeparator));
  137|      0|            for (int i = 0; i < paths.size(); i++) {
  ------------------
  |  Branch (137:29): [True: 0, False: 0]
  ------------------
  138|      0|                entry = QFileSystemEntry(QDir::cleanPath(
  139|      0|                        paths.at(i) % u'/' % QStringView{filePath}.mid(prefixSeparator + 1)));
  140|       |                // Recurse!
  141|      0|                if (_q_createLegacyEngine_recursive(entry, data, engine, true))
  ------------------
  |  Branch (141:21): [True: 0, False: 0]
  ------------------
  142|      0|                    return true;
  143|      0|            }
  144|       |
  145|       |            // entry may have been clobbered at this point.
  146|      0|            return false;
  147|      0|        }
  148|       |
  149|       |        //  There's no need to fully validate the prefix here. Consulting the
  150|       |        //  unicode tables could be expensive and validation is already
  151|       |        //  performed in QDir::setSearchPaths.
  152|       |        //
  153|       |        //  if (!ch.isLetterOrNumber())
  154|       |        //      break;
  155|      2|    }
  156|      6|#endif // defined(QT_BUILD_CORE_LIB)
  157|       |
  158|      6|    return _q_checkEntry(entry, data, resolvingEntry);
  159|      7|}
qfilesystemengine.cpp:_ZL13_q_checkEntryRNSt3__110unique_ptrI19QAbstractFileEngineNS_14default_deleteIS1_EEEEb:
  102|      1|{
  103|      1|    if (resolvingEntry) {
  ------------------
  |  Branch (103:9): [True: 0, False: 1]
  ------------------
  104|      0|        if (!(engine->fileFlags(QAbstractFileEngine::FlagsMask) & QAbstractFileEngine::ExistsFlag)) {
  ------------------
  |  Branch (104:13): [True: 0, False: 0]
  ------------------
  105|      0|            engine.reset();
  106|      0|            return false;
  107|      0|        }
  108|      0|    }
  109|       |
  110|      1|    return true;
  111|      1|}
qfilesystemengine.cpp:_ZL13_q_checkEntryR16QFileSystemEntryR19QFileSystemMetaDatab:
   89|      6|{
   90|      6|    if (resolvingEntry) {
  ------------------
  |  Branch (90:9): [True: 0, False: 6]
  ------------------
   91|      0|        if (!QFileSystemEngine::fillMetaData(entry, data, QFileSystemMetaData::ExistsAttribute)
  ------------------
  |  Branch (91:13): [True: 0, False: 0]
  ------------------
   92|      0|                || !data.exists()) {
  ------------------
  |  Branch (92:20): [True: 0, False: 0]
  ------------------
   93|      0|            data.clear();
   94|      0|            return false;
   95|      0|        }
   96|      0|    }
   97|       |
   98|      6|    return true;
   99|      6|}

_Z17qIsFilenameBrokenRK10QByteArray:
   36|      2|{
   37|      2|    return name.contains('\0');
   38|      2|}
_Z17qIsFilenameBrokenRK16QFileSystemEntry:
   46|      2|{
   47|      2|    return qIsFilenameBroken(entry.nativeFilePath());
   48|      2|}

_ZN17QFileSystemEngine12fillMetaDataERK16QFileSystemEntryR19QFileSystemMetaData6QFlagsINS3_12MetaDataFlagEE:
  881|      2|{
  882|      2|    Q_CHECK_FILE_NAME(entry, false);
  ------------------
  |  |   51|      2|    do { \
  |  |   52|      2|        if (Q_UNLIKELY((name).isEmpty())) \
  |  |   53|      2|            Q_RETURN_ON_INVALID_FILENAME("Empty filename passed to function", (result)); \
  |  |  ------------------
  |  |  |  |   29|      0|    { \
  |  |  |  |   30|      0|        qWarning(message); \
  |  |  |  |   31|      0|        errno = EINVAL; \
  |  |  |  |   32|      0|        return (result); \
  |  |  |  |   33|      0|    }
  |  |  ------------------
  |  |   54|      2|        if (Q_UNLIKELY(qIsFilenameBroken(name))) \
  |  |   55|      2|            Q_RETURN_ON_INVALID_FILENAME("Broken filename passed to function", (result)); \
  |  |  ------------------
  |  |  |  |   29|      0|    { \
  |  |  |  |   30|      0|        qWarning(message); \
  |  |  |  |   31|      0|        errno = EINVAL; \
  |  |  |  |   32|      0|        return (result); \
  |  |  |  |   33|      0|    }
  |  |  ------------------
  |  |   56|      2|    } while (false)
  |  |  ------------------
  |  |  |  Branch (56:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  883|       |
  884|       |#if defined(Q_OS_DARWIN)
  885|       |    if (what & (QFileSystemMetaData::BundleType | QFileSystemMetaData::CaseSensitive)) {
  886|       |        if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
  887|       |            what |= QFileSystemMetaData::DirectoryType;
  888|       |    }
  889|       |    if (what & QFileSystemMetaData::AliasType)
  890|       |        what |= QFileSystemMetaData::LinkType;
  891|       |#endif
  892|       |#ifdef UF_HIDDEN
  893|       |    if (what & QFileSystemMetaData::HiddenAttribute) {
  894|       |        // OS X >= 10.5: st_flags & UF_HIDDEN
  895|       |        what |= QFileSystemMetaData::PosixStatFlags;
  896|       |    }
  897|       |#endif // defined(Q_OS_DARWIN)
  898|       |
  899|       |    // if we're asking for any of the stat(2) flags, then we're getting them all
  900|      2|    if (what & QFileSystemMetaData::PosixStatFlags)
  ------------------
  |  Branch (900:9): [True: 2, False: 0]
  ------------------
  901|      2|        what |= QFileSystemMetaData::PosixStatFlags;
  902|       |
  903|      2|    data.entryFlags &= ~what;
  904|       |
  905|      2|    const QByteArray nativeFilePath = entry.nativeFilePath();
  906|      2|    int entryErrno = 0; // innocent until proven otherwise
  907|       |
  908|       |    // first, we may try lstat(2). Possible outcomes:
  909|       |    //  - success and is a symlink: filesystem entry exists, but we need stat(2)
  910|       |    //    -> statResult = -1;
  911|       |    //  - success and is not a symlink: filesystem entry exists and we're done
  912|       |    //    -> statResult = 0
  913|       |    //  - failure: really non-existent filesystem entry
  914|       |    //    -> entryExists = false; statResult = 0;
  915|       |    //    both stat(2) and lstat(2) may generate a number of different errno
  916|       |    //    conditions, but of those, the only ones that could happen and the
  917|       |    //    entry still exist are EACCES, EFAULT, ENOMEM and EOVERFLOW. If we get
  918|       |    //    EACCES or ENOMEM, then we have no choice on how to proceed, so we may
  919|       |    //    as well conclude it doesn't exist; EFAULT can't happen and EOVERFLOW
  920|       |    //    shouldn't happen because we build in _LARGEFIE64.
  921|      2|    union {
  922|      2|        QT_STATBUF statBuffer;
  923|      2|        struct statx statxBuffer;
  924|      2|    };
  925|      2|    int statResult = -1;
  926|      2|    if (what & QFileSystemMetaData::LinkType) {
  ------------------
  |  Branch (926:9): [True: 0, False: 2]
  ------------------
  927|      0|        mode_t mode = 0;
  928|      0|        statResult = qt_lstatx(nativeFilePath, &statxBuffer);
  929|      0|        if (statResult == -ENOSYS) {
  ------------------
  |  Branch (929:13): [True: 0, False: 0]
  ------------------
  930|       |            // use lstst(2)
  931|      0|            statResult = QT_LSTAT(nativeFilePath, &statBuffer);
  ------------------
  |  |   22|      0|#define QT_LSTAT                ::lstat64
  ------------------
  932|      0|            if (statResult == 0)
  ------------------
  |  Branch (932:17): [True: 0, False: 0]
  ------------------
  933|      0|                mode = statBuffer.st_mode;
  934|      0|        } else if (statResult == 0) {
  ------------------
  |  Branch (934:20): [True: 0, False: 0]
  ------------------
  935|      0|            statResult = 1; // record it was statx(2) that succeeded
  936|      0|            mode = statxBuffer.stx_mode;
  937|      0|        }
  938|       |
  939|      0|        if (statResult >= 0) {
  ------------------
  |  Branch (939:13): [True: 0, False: 0]
  ------------------
  940|      0|            if (S_ISLNK(mode)) {
  941|       |               // it's a symlink, we don't know if the file "exists"
  942|      0|                data.entryFlags |= QFileSystemMetaData::LinkType;
  943|      0|                statResult = -1;    // force stat(2) below
  944|      0|            } else {
  945|       |                // it's a reagular file and it exists
  946|      0|                if (statResult)
  ------------------
  |  Branch (946:21): [True: 0, False: 0]
  ------------------
  947|      0|                    data.fillFromStatxBuf(statxBuffer);
  948|      0|                else
  949|      0|                    data.fillFromStatBuf(statBuffer);
  950|      0|                data.knownFlagsMask |= QFileSystemMetaData::PosixStatFlags
  951|      0|                        | QFileSystemMetaData::ExistsAttribute;
  952|      0|                data.entryFlags |= QFileSystemMetaData::ExistsAttribute;
  953|      0|            }
  954|      0|        } else {
  955|       |            // it doesn't exist
  956|      0|            entryErrno = errno;
  957|      0|            data.knownFlagsMask |= QFileSystemMetaData::ExistsAttribute;
  958|      0|        }
  959|       |
  960|      0|        data.knownFlagsMask |= QFileSystemMetaData::LinkType;
  961|      0|    }
  962|       |
  963|       |    // second, we try a regular stat(2)
  964|      2|    if (statResult == -1 && (what & QFileSystemMetaData::PosixStatFlags)) {
  ------------------
  |  Branch (964:9): [True: 2, False: 0]
  |  Branch (964:9): [True: 2, False: 0]
  |  Branch (964:29): [True: 2, False: 0]
  ------------------
  965|      2|        if (entryErrno == 0 && statResult == -1) {
  ------------------
  |  Branch (965:13): [True: 2, False: 0]
  |  Branch (965:32): [True: 2, False: 0]
  ------------------
  966|      2|            data.entryFlags &= ~QFileSystemMetaData::PosixStatFlags;
  967|      2|            statResult = qt_statx(nativeFilePath, &statxBuffer);
  968|      2|            if (statResult == -ENOSYS) {
  ------------------
  |  Branch (968:17): [True: 0, False: 2]
  ------------------
  969|       |                // use stat(2)
  970|      0|                statResult = QT_STAT(nativeFilePath, &statBuffer);
  ------------------
  |  |   21|      0|#define QT_STAT                 ::stat64
  ------------------
  971|      0|                if (statResult == 0)
  ------------------
  |  Branch (971:21): [True: 0, False: 0]
  ------------------
  972|      0|                    data.fillFromStatBuf(statBuffer);
  973|      2|            } else if (statResult == 0) {
  ------------------
  |  Branch (973:24): [True: 0, False: 2]
  ------------------
  974|      0|                data.fillFromStatxBuf(statxBuffer);
  975|      0|            }
  976|      2|        }
  977|       |
  978|      2|        if (statResult != 0) {
  ------------------
  |  Branch (978:13): [True: 2, False: 0]
  ------------------
  979|      2|            entryErrno = errno;
  980|      2|            data.birthTime_ = 0;
  981|      2|            data.metadataChangeTime_ = 0;
  982|      2|            data.modificationTime_ = 0;
  983|      2|            data.accessTime_ = 0;
  984|      2|            data.size_ = 0;
  985|      2|            data.userId_ = (uint) -2;
  986|      2|            data.groupId_ = (uint) -2;
  987|      2|        }
  988|       |
  989|       |        // reset the mask
  990|      2|        data.knownFlagsMask |= QFileSystemMetaData::PosixStatFlags
  991|      2|            | QFileSystemMetaData::ExistsAttribute;
  992|      2|    }
  993|       |
  994|       |    // third, we try access(2)
  995|      2|    if (what & (QFileSystemMetaData::UserPermissions | QFileSystemMetaData::ExistsAttribute)) {
  ------------------
  |  Branch (995:9): [True: 0, False: 2]
  ------------------
  996|       |        // calculate user permissions
  997|      0|        auto checkAccess = [&](QFileSystemMetaData::MetaDataFlag flag, int mode) {
  998|      0|            if (entryErrno != 0 || (what & flag) == 0)
  999|      0|                return;
 1000|      0|            if (QT_ACCESS(nativeFilePath, mode) == 0) {
 1001|       |                // access ok (and file exists)
 1002|      0|                data.entryFlags |= flag | QFileSystemMetaData::ExistsAttribute;
 1003|      0|            } else if (errno != EACCES && errno != EROFS) {
 1004|      0|                entryErrno = errno;
 1005|      0|            }
 1006|      0|        };
 1007|       |
 1008|      0|        checkAccess(QFileSystemMetaData::UserReadPermission, R_OK);
 1009|      0|        checkAccess(QFileSystemMetaData::UserWritePermission, W_OK);
 1010|      0|        checkAccess(QFileSystemMetaData::UserExecutePermission, X_OK);
 1011|       |
 1012|       |        // if we still haven't found out if the file exists, try F_OK
 1013|      0|        if (entryErrno == 0 && (data.entryFlags & QFileSystemMetaData::ExistsAttribute) == 0) {
  ------------------
  |  Branch (1013:13): [True: 0, False: 0]
  |  Branch (1013:32): [True: 0, False: 0]
  ------------------
 1014|      0|            if (QT_ACCESS(nativeFilePath, F_OK) == -1)
  ------------------
  |  |   77|      0|#define QT_ACCESS               ::access
  ------------------
  |  Branch (1014:17): [True: 0, False: 0]
  ------------------
 1015|      0|                entryErrno = errno;
 1016|      0|            else
 1017|      0|                data.entryFlags |= QFileSystemMetaData::ExistsAttribute;
 1018|      0|        }
 1019|       |
 1020|      0|        data.knownFlagsMask |= (what & QFileSystemMetaData::UserPermissions) |
 1021|      0|                QFileSystemMetaData::ExistsAttribute;
 1022|      0|    }
 1023|       |
 1024|       |#if defined(Q_OS_DARWIN)
 1025|       |    if (what & QFileSystemMetaData::AliasType) {
 1026|       |        if (entryErrno == 0 && hasResourcePropertyFlag(data, entry, kCFURLIsAliasFileKey)) {
 1027|       |            // kCFURLIsAliasFileKey includes symbolic links, so filter those out
 1028|       |            if (!(data.entryFlags & QFileSystemMetaData::LinkType))
 1029|       |                data.entryFlags |= QFileSystemMetaData::AliasType;
 1030|       |        }
 1031|       |        data.knownFlagsMask |= QFileSystemMetaData::AliasType;
 1032|       |    }
 1033|       |
 1034|       |    if (what & QFileSystemMetaData::BundleType) {
 1035|       |        if (entryErrno == 0 && isPackage(data, entry))
 1036|       |            data.entryFlags |= QFileSystemMetaData::BundleType;
 1037|       |
 1038|       |        data.knownFlagsMask |= QFileSystemMetaData::BundleType;
 1039|       |    }
 1040|       |
 1041|       |    if (what & QFileSystemMetaData::CaseSensitive) {
 1042|       |        if (entryErrno == 0 && hasResourcePropertyFlag(
 1043|       |            data, entry, kCFURLVolumeSupportsCaseSensitiveNamesKey))
 1044|       |            data.entryFlags |= QFileSystemMetaData::CaseSensitive;
 1045|       |        data.knownFlagsMask |= QFileSystemMetaData::CaseSensitive;
 1046|       |    }
 1047|       |#endif
 1048|       |
 1049|      2|    if (what & QFileSystemMetaData::HiddenAttribute
  ------------------
  |  Branch (1049:9): [True: 0, False: 2]
  |  Branch (1049:9): [True: 0, False: 2]
  ------------------
 1050|      2|            && !data.isHidden()) {
  ------------------
  |  Branch (1050:16): [True: 0, False: 0]
  ------------------
 1051|      0|        QString fileName = entry.fileName();
 1052|      0|        if (fileName.startsWith(u'.')
  ------------------
  |  Branch (1052:13): [True: 0, False: 0]
  ------------------
 1053|       |#if defined(Q_OS_DARWIN)
 1054|       |                || (entryErrno == 0 && hasResourcePropertyFlag(data, entry, kCFURLIsHiddenKey))
 1055|       |#endif
 1056|      0|                )
 1057|      0|            data.entryFlags |= QFileSystemMetaData::HiddenAttribute;
 1058|      0|        data.knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
 1059|      0|    }
 1060|       |
 1061|      2|    if (entryErrno != 0) {
  ------------------
  |  Branch (1061:9): [True: 2, False: 0]
  ------------------
 1062|      2|        what &= ~QFileSystemMetaData::LinkType; // don't clear link: could be broken symlink
 1063|      2|        data.clearFlags(what);
 1064|      2|        return false;
 1065|      2|    }
 1066|      0|    return true;
 1067|      2|}
_ZN17QFileSystemEngine8homePathEv:
 1817|      1|{
 1818|      1|    QString home = qEnvironmentVariable("HOME");
 1819|      1|    if (home.isEmpty())
  ------------------
  |  Branch (1819:9): [True: 0, False: 1]
  ------------------
 1820|      0|        home = rootPath();
 1821|      1|    return QDir::cleanPath(home);
 1822|      1|}
_ZN17QFileSystemEngine11currentPathEv:
 1857|      1|{
 1858|      1|    QFileSystemEntry result;
 1859|       |#if defined(__GLIBC__) && !defined(PATH_MAX)
 1860|       |    char *currentName = ::get_current_dir_name();
 1861|       |    if (currentName) {
 1862|       |        result = QFileSystemEntry(QByteArray(currentName), QFileSystemEntry::FromNativePath());
 1863|       |        ::free(currentName);
 1864|       |    }
 1865|       |#else
 1866|      1|    char currentName[PATH_MAX+1];
 1867|      1|    if (::getcwd(currentName, PATH_MAX)) {
  ------------------
  |  Branch (1867:9): [True: 1, False: 0]
  ------------------
 1868|       |#if defined(Q_OS_VXWORKS) && defined(VXWORKS_VXSIM)
 1869|       |        QByteArray dir(currentName);
 1870|       |        if (dir.indexOf(':') < dir.indexOf('/'))
 1871|       |            dir.remove(0, dir.indexOf(':')+1);
 1872|       |
 1873|       |        qstrncpy(currentName, dir.constData(), PATH_MAX);
 1874|       |#endif
 1875|      1|        result = QFileSystemEntry(QByteArray(currentName), QFileSystemEntry::FromNativePath());
 1876|      1|    }
 1877|      1|# if defined(QT_DEBUG)
 1878|      1|    if (result.isEmpty())
  ------------------
  |  Branch (1878:9): [True: 0, False: 1]
  ------------------
 1879|      0|        qWarning("QFileSystemEngine::currentPath: getcwd() failed");
 1880|      1|# endif
 1881|      1|#endif
 1882|      1|    return result;
 1883|      1|}
qfilesystemengine_unix.cpp:_ZL13qt_real_statxiPKciP5statx:
  289|      2|{
  290|      2|    unsigned mask = STATX_BASIC_STATS | STATX_BTIME;
  291|      2|    int ret = statx(fd, pathname, flags | AT_NO_AUTOMOUNT, mask, statxBuffer);
  292|      2|    return ret == -1 ? -errno : 0;
  ------------------
  |  Branch (292:12): [True: 2, False: 0]
  ------------------
  293|      2|}
qfilesystemengine_unix.cpp:_ZL8qt_statxPKcP5statx:
  296|      2|{
  297|      2|    return qt_real_statx(AT_FDCWD, pathname, 0, statxBuffer);
  298|      2|}

_ZN16QFileSystemEntryC2Ev:
   45|      5|    : m_lastSeparator(-1),
   46|      5|    m_firstDotInFileName(-1),
   47|      5|    m_lastDotInFileName(-1)
   48|      5|{
   49|      5|}
_ZN16QFileSystemEntryC2ERK7QString:
   57|      8|    : m_filePath(QDir::fromNativeSeparators(filePath)),
   58|      8|    m_lastSeparator(Uninitialized),
   59|      8|    m_firstDotInFileName(Uninitialized),
   60|      8|    m_lastDotInFileName(0)
   61|      8|{
   62|      8|}
_ZN16QFileSystemEntryC2ERK7QStringNS_16FromInternalPathE:
   70|      1|    : m_filePath(filePath),
   71|      1|    m_lastSeparator(Uninitialized),
   72|      1|    m_firstDotInFileName(Uninitialized),
   73|      1|    m_lastDotInFileName(0)
   74|      1|{
   75|      1|}
_ZN16QFileSystemEntryC2ERK10QByteArrayNS_14FromNativePathE:
   82|      1|    : m_nativeFilePath(nativeFilePath),
   83|      1|    m_lastSeparator(Uninitialized),
   84|      1|    m_firstDotInFileName(Uninitialized),
   85|      1|    m_lastDotInFileName(0)
   86|      1|{
   87|      1|}
_ZNK16QFileSystemEntry8filePathEv:
   99|     10|{
  100|     10|    resolveFilePath();
  101|     10|    return m_filePath;
  102|     10|}
_ZNK16QFileSystemEntry14nativeFilePathEv:
  105|      5|{
  106|      5|    resolveNativeFilePath();
  107|      5|    return m_nativeFilePath;
  108|      5|}
_ZNK16QFileSystemEntry15resolveFilePathEv:
  111|     15|{
  112|     15|    if (m_filePath.isEmpty() && !m_nativeFilePath.isEmpty()) {
  ------------------
  |  Branch (112:9): [True: 1, False: 14]
  |  Branch (112:33): [True: 1, False: 0]
  ------------------
  113|       |#ifdef Q_OS_WIN
  114|       |        m_filePath = QDir::fromNativeSeparators(m_nativeFilePath);
  115|       |#else
  116|      1|        m_filePath = QDir::fromNativeSeparators(QFile::decodeName(m_nativeFilePath));
  117|      1|#endif
  118|      1|    }
  119|     15|}
_ZNK16QFileSystemEntry21resolveNativeFilePathEv:
  122|      5|{
  123|      5|    if (!m_filePath.isEmpty() && m_nativeFilePath.isEmpty()) {
  ------------------
  |  Branch (123:9): [True: 5, False: 0]
  |  Branch (123:34): [True: 3, False: 2]
  ------------------
  124|       |#ifdef Q_OS_WIN
  125|       |        QString filePath = m_filePath;
  126|       |        if (isRelative())
  127|       |            filePath = fixIfRelativeUncPath(m_filePath);
  128|       |        m_nativeFilePath = QFSFileEnginePrivate::longFileName(QDir::toNativeSeparators(filePath));
  129|       |#else
  130|      3|        m_nativeFilePath = QFile::encodeName(QDir::toNativeSeparators(m_filePath));
  131|      3|#endif
  132|      3|    }
  133|      5|}
_ZNK16QFileSystemEntry10isRelativeEv:
  237|      3|{
  238|      3|    return !isAbsolute();
  239|      3|}
_ZNK16QFileSystemEntry10isAbsoluteEv:
  242|      4|{
  243|      4|    resolveFilePath();
  244|      4|    return (!m_filePath.isEmpty() && (m_filePath.at(0).unicode() == '/'));
  ------------------
  |  Branch (244:13): [True: 4, False: 0]
  |  Branch (244:38): [True: 2, False: 2]
  ------------------
  245|      4|}
_ZNK16QFileSystemEntry7isEmptyEv:
  311|      6|{
  312|      6|    return m_filePath.isEmpty() && m_nativeFilePath.isEmpty();
  ------------------
  |  Branch (312:12): [True: 2, False: 4]
  |  Branch (312:36): [True: 1, False: 1]
  ------------------
  313|      6|}
_ZNK16QFileSystemEntry7isCleanEv:
  374|      1|{
  375|      1|    resolveFilePath();
  376|      1|    int dots = 0;
  377|      1|    bool dotok = true; // checking for ".." or "." starts to relative paths
  378|      1|    bool slashok = true;
  379|      5|    for (QString::const_iterator iter = m_filePath.constBegin(); iter != m_filePath.constEnd(); ++iter) {
  ------------------
  |  Branch (379:66): [True: 4, False: 1]
  ------------------
  380|      4|        if (*iter == u'/') {
  ------------------
  |  Branch (380:13): [True: 1, False: 3]
  ------------------
  381|      1|            if (dots == 1 || dots == 2)
  ------------------
  |  Branch (381:17): [True: 0, False: 1]
  |  Branch (381:30): [True: 0, False: 1]
  ------------------
  382|      0|                return false; // path contains "./" or "../"
  383|      1|            if (!slashok)
  ------------------
  |  Branch (383:17): [True: 0, False: 1]
  ------------------
  384|      0|                return false; // path contains "//"
  385|      1|            dots = 0;
  386|      1|            dotok = true;
  387|      1|            slashok = false;
  388|      3|        } else if (dotok) {
  ------------------
  |  Branch (388:20): [True: 1, False: 2]
  ------------------
  389|      1|            slashok = true;
  390|      1|            if (*iter == u'.') {
  ------------------
  |  Branch (390:17): [True: 0, False: 1]
  ------------------
  391|      0|                dots++;
  392|      0|                if (dots > 2)
  ------------------
  |  Branch (392:21): [True: 0, False: 0]
  ------------------
  393|      0|                    dotok = false;
  394|      1|            } else {
  395|       |                //path element contains a character other than '.', it's clean
  396|      1|                dots = 0;
  397|      1|                dotok = false;
  398|      1|            }
  399|      1|        }
  400|      4|    }
  401|      1|    return (dots != 1 && dots != 2); // clean if path doesn't end in . or ..
  ------------------
  |  Branch (401:13): [True: 1, False: 0]
  |  Branch (401:26): [True: 1, False: 0]
  ------------------
  402|      1|}

_ZN19QFileSystemMetaDataC2Ev:
   44|      8|        : size_(-1)
   45|      8|    {
   46|      8|    }
_ZNK19QFileSystemMetaData6isFileEv:
  166|      2|    bool isFile() const                     { return entryFlags.testAnyFlag(FileType); }
_ZNK19QFileSystemMetaData8hasFlagsE6QFlagsINS_12MetaDataFlagEE:
  144|      2|    {
  145|      2|        return ((knownFlagsMask & flags) == flags);
  146|      2|    }
_ZN19QFileSystemMetaData5clearEv:
  154|      1|    {
  155|      1|        knownFlagsMask = {};
  156|      1|    }
_ZN19QFileSystemMetaData10clearFlagsE6QFlagsINS_12MetaDataFlagEE:
  159|      2|    {
  160|      2|        knownFlagsMask &= ~flags;
  161|      2|    }

_ZN20QFSFileEnginePrivateC2EP19QAbstractFileEngine:
   80|      1|    : QAbstractFileEnginePrivate(q)
   81|      1|{
   82|      1|    init();
   83|      1|}
_ZN20QFSFileEnginePrivate4initEv:
   89|      1|{
   90|      1|    is_sequential = 0;
   91|      1|    tried_stat = 0;
   92|      1|    need_lstat = 1;
   93|      1|    is_link = 0;
   94|      1|    openMode = QIODevice::NotOpen;
   95|      1|    fd = -1;
   96|      1|    fh = nullptr;
   97|      1|    lastIOCommand = IOFlushCommand;
   98|      1|    lastFlushFailed = false;
   99|      1|    closeFileHandle = false;
  100|       |#ifdef Q_OS_WIN
  101|       |    fileAttrib = INVALID_FILE_ATTRIBUTES;
  102|       |    fileHandle = INVALID_HANDLE_VALUE;
  103|       |    mapHandle = NULL;
  104|       |    cachedFd = -1;
  105|       |#endif
  106|      1|}
_ZN13QFSFileEngineC2ERK7QString:
  112|      1|    : QAbstractFileEngine(*new QFSFileEnginePrivate(this))
  113|      1|{
  114|      1|    Q_D(QFSFileEngine);
  115|      1|    d->fileEntry = QFileSystemEntry(file);
  116|      1|}
_Z20processOpenModeFlags6QFlagsIN13QIODeviceBase12OpenModeFlagEE:
  137|      1|{
  138|      1|    ProcessOpenModeResult result;
  139|      1|    result.ok = false;
  140|      1|    if ((openMode & QFile::NewOnly) && (openMode & QFile::ExistingOnly)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  |  Branch (140:9): [True: 0, False: 1]
  |  Branch (140:40): [True: 0, False: 0]
  ------------------
  141|      0|        qWarning("NewOnly and ExistingOnly are mutually exclusive");
  142|      0|        result.error = "NewOnly and ExistingOnly are mutually exclusive"_L1;
  143|      0|        return result;
  144|      0|    }
  145|       |
  146|      1|    if ((openMode & QFile::ExistingOnly) && !(openMode & (QFile::ReadOnly | QFile::WriteOnly))) {
  ------------------
  |  Branch (146:9): [True: 0, False: 1]
  |  Branch (146:9): [True: 0, False: 1]
  |  Branch (146:45): [True: 0, False: 0]
  ------------------
  147|      0|        qWarning("ExistingOnly must be specified alongside ReadOnly, WriteOnly, or ReadWrite");
  148|      0|        result.error =
  149|      0|                    "ExistingOnly must be specified alongside ReadOnly, WriteOnly, or ReadWrite"_L1;
  150|      0|        return result;
  151|      0|    }
  152|       |
  153|       |    // Either Append or NewOnly implies WriteOnly
  154|      1|    if (openMode & (QFile::Append | QFile::NewOnly))
  ------------------
  |  Branch (154:9): [True: 0, False: 1]
  ------------------
  155|      0|        openMode |= QFile::WriteOnly;
  156|       |
  157|       |    // WriteOnly implies Truncate when ReadOnly, Append, and NewOnly are not set.
  158|      1|    if ((openMode & QFile::WriteOnly) && !(openMode & (QFile::ReadOnly | QFile::Append | QFile::NewOnly)))
  ------------------
  |  Branch (158:9): [True: 0, False: 1]
  |  Branch (158:9): [True: 0, False: 1]
  |  Branch (158:42): [True: 0, False: 0]
  ------------------
  159|      0|        openMode |= QFile::Truncate;
  160|       |
  161|      1|    result.ok = true;
  162|      1|    result.openMode = openMode;
  163|      1|    return result;
  164|      1|}
_ZN13QFSFileEngineD2Ev:
  170|      1|{
  171|      1|    Q_D(QFSFileEngine);
  172|      1|    if (d->closeFileHandle) {
  ------------------
  |  Branch (172:9): [True: 0, False: 1]
  ------------------
  173|      0|        if (d->fh) {
  ------------------
  |  Branch (173:13): [True: 0, False: 0]
  ------------------
  174|      0|            fclose(d->fh);
  175|      0|        } else if (d->fd != -1) {
  ------------------
  |  Branch (175:20): [True: 0, False: 0]
  ------------------
  176|      0|            QT_CLOSE(d->fd);
  ------------------
  |  |  377|      0|#define QT_CLOSE qt_safe_close
  ------------------
  177|      0|        }
  178|      0|    }
  179|      1|    d->unmapAll();
  180|      1|}
_ZN13QFSFileEngine4openE6QFlagsIN13QIODeviceBase12OpenModeFlagEENSt3__18optionalIS0_IN11QFileDevice10PermissionEEEE:
  197|      1|{
  198|      1|    Q_ASSERT_X(openMode & QIODevice::Unbuffered, "QFSFileEngine::open",
  199|      1|               "QFSFileEngine no longer supports buffered mode; upper layer must buffer");
  200|       |
  201|      1|    Q_D(QFSFileEngine);
  202|      1|    if (d->fileEntry.isEmpty()) {
  ------------------
  |  Branch (202:9): [True: 0, False: 1]
  ------------------
  203|      0|        qWarning("QFSFileEngine::open: No file name specified");
  204|      0|        setError(QFile::OpenError, "No file name specified"_L1);
  205|      0|        return false;
  206|      0|    }
  207|       |
  208|      1|    const ProcessOpenModeResult res = processOpenModeFlags(openMode);
  209|      1|    if (!res.ok) {
  ------------------
  |  Branch (209:9): [True: 0, False: 1]
  ------------------
  210|      0|        setError(QFileDevice::OpenError, res.error);
  211|      0|        return false;
  212|      0|    }
  213|       |
  214|      1|    d->openMode = res.openMode;
  215|      1|    d->lastFlushFailed = false;
  216|      1|    d->tried_stat = 0;
  217|      1|    d->fh = nullptr;
  218|      1|    d->fd = -1;
  219|       |
  220|      1|    return d->nativeOpen(d->openMode, permissions);
  221|      1|}
_ZN20QFSFileEnginePrivate8unmapAllEv:
  468|      1|{
  469|      1|    if (!maps.isEmpty()) {
  ------------------
  |  Branch (469:9): [True: 0, False: 1]
  ------------------
  470|      0|        const QList<uchar*> keys = maps.keys(); // Make a copy since unmap() modifies the map.
  471|      0|        for (int i = 0; i < keys.size(); ++i)
  ------------------
  |  Branch (471:25): [True: 0, False: 0]
  ------------------
  472|      0|            unmap(keys.at(i));
  473|      0|    }
  474|      1|}

_ZN20QFSFileEnginePrivate17openModeCanCreateE6QFlagsIN13QIODeviceBase12OpenModeFlagEE:
  217|      1|    {
  218|       |        // WriteOnly can create, but only when ExistingOnly isn't specified.
  219|       |        // ReadOnly by itself never creates.
  220|      1|        return (openMode & QFile::WriteOnly) && !(openMode & QFile::ExistingOnly);
  ------------------
  |  Branch (220:16): [True: 0, False: 1]
  |  Branch (220:49): [True: 0, False: 0]
  ------------------
  221|      1|    }

_ZN20QFSFileEnginePrivate10nativeOpenE6QFlagsIN13QIODeviceBase12OpenModeFlagEENSt3__18optionalIS0_IN11QFileDevice10PermissionEEEE:
   77|      1|{
   78|      1|    return nativeOpenImpl(openMode, permissions ? QtPrivate::toMode_t(*permissions) : 0666);
  ------------------
  |  Branch (78:37): [True: 0, False: 1]
  ------------------
   79|      1|}
_ZN20QFSFileEnginePrivate14nativeOpenImplE6QFlagsIN13QIODeviceBase12OpenModeFlagEEj:
   85|      1|{
   86|      1|    Q_Q(QFSFileEngine);
   87|       |
   88|      1|    Q_ASSERT_X(openMode & QIODevice::Unbuffered, "QFSFileEngine::open",
   89|      1|               "QFSFileEngine no longer supports buffered mode; upper layer must buffer");
   90|      1|    if (openMode & QIODevice::Unbuffered) {
  ------------------
  |  Branch (90:9): [True: 1, False: 0]
  ------------------
   91|      1|        int flags = openModeToOpenFlags(openMode);
   92|       |
   93|       |        // Try to open the file in unbuffered mode.
   94|      1|        do {
   95|      1|            fd = QT_OPEN(fileEntry.nativeFilePath().constData(), flags, mode);
  ------------------
  |  |  271|      1|#define QT_OPEN         qt_safe_open
  ------------------
   96|      1|        } while (fd == -1 && errno == EINTR);
  ------------------
  |  Branch (96:18): [True: 1, False: 0]
  |  Branch (96:30): [True: 0, False: 1]
  ------------------
   97|       |
   98|       |        // On failure, return and report the error.
   99|      1|        if (fd == -1) {
  ------------------
  |  Branch (99:13): [True: 1, False: 0]
  ------------------
  100|      1|            q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,
  ------------------
  |  Branch (100:25): [True: 0, False: 1]
  ------------------
  101|      1|                        qt_error_string(errno));
  102|      1|            return false;
  103|      1|        }
  104|       |
  105|      0|        if (!(openMode & QIODevice::WriteOnly)) {
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|       |            // we don't need this check if we tried to open for writing because then
  107|       |            // we had received EISDIR anyway.
  108|      0|            if (QFileSystemEngine::fillMetaData(fd, metaData)
  ------------------
  |  Branch (108:17): [True: 0, False: 0]
  ------------------
  109|      0|                    && metaData.isDirectory()) {
  ------------------
  |  Branch (109:24): [True: 0, False: 0]
  ------------------
  110|      0|                q->setError(QFile::OpenError, msgOpenDirectory());
  111|      0|                QT_CLOSE(fd);
  ------------------
  |  |  377|      0|#define QT_CLOSE qt_safe_close
  ------------------
  112|      0|                return false;
  113|      0|            }
  114|      0|        }
  115|       |
  116|       |        // Seek to the end when in Append mode.
  117|      0|        if (flags & QFile::Append) {
  ------------------
  |  Branch (117:13): [True: 0, False: 0]
  ------------------
  118|      0|            QT_OFF_T ret;
  ------------------
  |  |   19|      0|#define QT_OFF_T                off64_t
  ------------------
  119|      0|            do {
  120|      0|                ret = QT_LSEEK(fd, 0, SEEK_END);
  ------------------
  |  |   27|      0|#define QT_LSEEK                ::lseek64
  ------------------
  121|      0|            } while (ret == -1 && errno == EINTR);
  ------------------
  |  Branch (121:22): [True: 0, False: 0]
  |  Branch (121:35): [True: 0, False: 0]
  ------------------
  122|       |
  123|      0|            if (ret == -1) {
  ------------------
  |  Branch (123:17): [True: 0, False: 0]
  ------------------
  124|      0|                q->setError(errno == EMFILE ? QFile::ResourceError : QFile::OpenError,
  ------------------
  |  Branch (124:29): [True: 0, False: 0]
  ------------------
  125|      0|                            qt_error_string(errno));
  126|      0|                return false;
  127|      0|            }
  128|      0|        }
  129|       |
  130|      0|        fh = nullptr;
  131|      0|    }
  132|       |
  133|      0|    closeFileHandle = true;
  134|      0|    return true;
  135|      1|}
qfsfileengine_unix.cpp:_ZL19openModeToOpenFlags6QFlagsIN13QIODeviceBase12OpenModeFlagEE:
   36|      1|{
   37|      1|    int oflags = QT_OPEN_RDONLY;
  ------------------
  |  |   89|      1|#define QT_OPEN_RDONLY          O_RDONLY
  ------------------
   38|      1|#ifdef QT_LARGEFILE_SUPPORT
   39|      1|    oflags |= QT_OPEN_LARGEFILE;
  ------------------
  |  |   88|      1|#define QT_OPEN_LARGEFILE       O_LARGEFILE
  ------------------
   40|      1|#endif
   41|       |
   42|      1|    if ((mode & QFile::ReadWrite) == QFile::ReadWrite)
  ------------------
  |  Branch (42:9): [True: 0, False: 1]
  ------------------
   43|      0|        oflags = QT_OPEN_RDWR;
  ------------------
  |  |   91|      0|#define QT_OPEN_RDWR            O_RDWR
  ------------------
   44|      1|    else if (mode & QFile::WriteOnly)
  ------------------
  |  Branch (44:14): [True: 0, False: 1]
  ------------------
   45|      0|        oflags = QT_OPEN_WRONLY;
  ------------------
  |  |   90|      0|#define QT_OPEN_WRONLY          O_WRONLY
  ------------------
   46|       |
   47|      1|    if (QFSFileEnginePrivate::openModeCanCreate(mode))
  ------------------
  |  Branch (47:9): [True: 0, False: 1]
  ------------------
   48|      0|        oflags |= QT_OPEN_CREAT;
  ------------------
  |  |   92|      0|#define QT_OPEN_CREAT           O_CREAT
  ------------------
   49|       |
   50|      1|    if (mode & QFile::Truncate)
  ------------------
  |  Branch (50:9): [True: 0, False: 1]
  ------------------
   51|      0|        oflags |= QT_OPEN_TRUNC;
  ------------------
  |  |   93|      0|#define QT_OPEN_TRUNC           O_TRUNC
  ------------------
   52|       |
   53|      1|    if (mode & QFile::Append)
  ------------------
  |  Branch (53:9): [True: 0, False: 1]
  ------------------
   54|      0|        oflags |= QT_OPEN_APPEND;
  ------------------
  |  |   94|      0|#define QT_OPEN_APPEND          O_APPEND
  ------------------
   55|       |
   56|      1|    if (mode & QFile::NewOnly)
  ------------------
  |  Branch (56:9): [True: 0, False: 1]
  ------------------
   57|      0|        oflags |= QT_OPEN_EXCL;
  ------------------
  |  |   95|      0|#define QT_OPEN_EXCL            O_EXCL
  ------------------
   58|       |
   59|      1|    return oflags;
   60|      1|}

_ZN16QIODevicePrivateC2Ev:
  133|      1|{
  134|      1|}
_ZN16QIODevicePrivateD2Ev:
  140|      1|{
  141|      1|}
_ZN9QIODeviceC2ER16QIODevicePrivateP7QObject:
  456|      1|    : QObject(dd, parent)
  457|      1|{
  458|      1|}
_ZN9QIODeviceD2Ev:
  469|      1|{
  470|       |#if defined QIODEVICE_DEBUG
  471|       |    printf("%p QIODevice::~QIODevice()\n", this);
  472|       |#endif
  473|      1|}
_ZNK9QIODevice6isOpenEv:
  569|      2|{
  570|      2|    return d_func()->openMode != NotOpen;
  571|      2|}

_ZN16QIODevicePrivate14QRingBufferRefC2Ev:
   66|      2|        inline QRingBufferRef() : m_buf(nullptr) { }

_ZN16QLoggingCategoryC2EPKc9QtMsgType:
  173|      1|    : d(nullptr),
  174|      1|      name(nullptr)
  175|      1|{
  176|      1|    init(category, enableForLevel);
  177|      1|}
_ZN16QLoggingCategory4initEPKc9QtMsgType:
  180|      1|{
  181|      1|    enabled.storeRelaxed(0x01010101);   // enabledDebug = enabledWarning = enabledCritical = true;
  182|       |
  183|      1|    if (category)
  ------------------
  |  Branch (183:9): [True: 1, False: 0]
  ------------------
  184|      1|        name = category;
  185|      0|    else
  186|      0|        name = qtDefaultCategoryName;
  187|       |
  188|      1|    if (QLoggingRegistry *reg = QLoggingRegistry::instance())
  ------------------
  |  Branch (188:27): [True: 1, False: 0]
  ------------------
  189|      1|        reg->registerCategory(this, severityLevel);
  190|      1|}
_ZN16QLoggingCategoryD2Ev:
  196|      1|{
  197|      1|    if (QLoggingRegistry *reg = QLoggingRegistry::instance())
  ------------------
  |  Branch (197:27): [True: 1, False: 0]
  ------------------
  198|      1|        reg->unregisterCategory(this);
  199|      1|}
_ZNK16QLoggingCategory9isEnabledE9QtMsgType:
  260|   186k|{
  261|   186k|    switch (msgtype) {
  ------------------
  |  Branch (261:13): [True: 0, False: 186k]
  ------------------
  262|      0|    case QtDebugMsg: return isDebugEnabled();
  ------------------
  |  Branch (262:5): [True: 0, False: 186k]
  ------------------
  263|      0|    case QtInfoMsg: return isInfoEnabled();
  ------------------
  |  Branch (263:5): [True: 0, False: 186k]
  ------------------
  264|   181k|    case QtWarningMsg: return isWarningEnabled();
  ------------------
  |  Branch (264:5): [True: 181k, False: 5.15k]
  ------------------
  265|  5.15k|    case QtCriticalMsg: return isCriticalEnabled();
  ------------------
  |  Branch (265:5): [True: 5.15k, False: 181k]
  ------------------
  266|      0|    case QtFatalMsg: return true;
  ------------------
  |  Branch (266:5): [True: 0, False: 186k]
  ------------------
  267|   186k|    }
  268|      0|    return false;
  269|   186k|}
_ZN16QLoggingCategory10setEnabledE9QtMsgTypeb:
  281|      4|{
  282|      4|    switch (type) {
  ------------------
  |  Branch (282:13): [True: 0, False: 4]
  ------------------
  283|      1|    case QtDebugMsg: bools.enabledDebug.storeRelaxed(enable); break;
  ------------------
  |  Branch (283:5): [True: 1, False: 3]
  ------------------
  284|      1|    case QtInfoMsg: bools.enabledInfo.storeRelaxed(enable); break;
  ------------------
  |  Branch (284:5): [True: 1, False: 3]
  ------------------
  285|      1|    case QtWarningMsg: bools.enabledWarning.storeRelaxed(enable); break;
  ------------------
  |  Branch (285:5): [True: 1, False: 3]
  ------------------
  286|      1|    case QtCriticalMsg: bools.enabledCritical.storeRelaxed(enable); break;
  ------------------
  |  Branch (286:5): [True: 1, False: 3]
  ------------------
  287|      0|    case QtFatalMsg: break;
  ------------------
  |  Branch (287:5): [True: 0, False: 4]
  ------------------
  288|      4|    }
  289|      4|}
_ZN16QLoggingCategory15defaultCategoryEv:
  316|   186k|{
  317|   186k|    return qtDefaultCategory();
  318|   186k|}

_ZNK16QLoggingCategory12categoryNameEv:
   27|      2|    const char *categoryName() const { return name; }
_ZNK16QLoggingCategory16isWarningEnabledEv:
   24|   181k|    bool isWarningEnabled() const { return bools.enabledWarning.loadRelaxed(); }
_ZNK16QLoggingCategory17isCriticalEnabledEv:
   25|  5.15k|    bool isCriticalEnabled() const { return bools.enabledCritical.loadRelaxed(); }

_ZN16QLoggingRegistryC2Ev:
  228|      1|    : categoryFilter(defaultCategoryFilter)
  229|      1|{
  230|       |#if defined(Q_OS_ANDROID)
  231|       |    // Unless QCoreApplication has been constructed we can't be sure that
  232|       |    // we are on Qt's main thread. If we did allow logging here, we would
  233|       |    // potentially set Qt's main thread to Android's thread 0, which would
  234|       |    // confuse Qt later when running main().
  235|       |    if (!qApp)
  236|       |        return;
  237|       |#endif
  238|       |
  239|      1|    initializeRules(); // Init on first use
  240|      1|}
_ZN16QLoggingRegistry15initializeRulesEv:
  278|      1|{
  279|      1|    if (qtLoggingDebug()) {
  ------------------
  |  Branch (279:9): [True: 0, False: 1]
  ------------------
  280|      0|        debugMsg("Initializing the rules database ...");
  ------------------
  |  |   22|      0|#define debugMsg QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, "qt.core.logging").debug
  ------------------
  281|      0|        debugMsg("Checking %s environment variable", "QT_LOGGING_CONF");
  ------------------
  |  |   22|      0|#define debugMsg QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, "qt.core.logging").debug
  ------------------
  282|      0|    }
  283|      1|    QList<QLoggingRule> er, qr, cr;
  284|       |    // get rules from environment
  285|      1|    if (QString rulesFilePath = qEnvironmentVariable("QT_LOGGING_CONF"); !rulesFilePath.isEmpty())
  ------------------
  |  Branch (285:74): [True: 0, False: 1]
  ------------------
  286|      0|        er = loadRulesFromFile(rulesFilePath);
  287|       |
  288|      1|    if (qtLoggingDebug())
  ------------------
  |  Branch (288:9): [True: 0, False: 1]
  ------------------
  289|      0|        debugMsg("Checking %s environment variable", "QT_LOGGING_RULES");
  ------------------
  |  |   22|      0|#define debugMsg QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, "qt.core.logging").debug
  ------------------
  290|       |
  291|      1|    const QByteArray rulesSrc = qgetenv("QT_LOGGING_RULES").replace(';', '\n');
  292|      1|    if (!rulesSrc.isEmpty()) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1]
  ------------------
  293|      0|        QTextStream stream(rulesSrc);
  294|      0|        QLoggingSettingsParser parser;
  295|      0|        parser.setImplicitRulesSection(true);
  296|      0|        parser.setContent(stream);
  297|       |
  298|      0|        if (qtLoggingDebug())
  ------------------
  |  Branch (298:13): [True: 0, False: 0]
  ------------------
  299|      0|            debugMsg("Loaded %td rules", static_cast<ptrdiff_t>(parser.rules().size()));
  ------------------
  |  |   22|      0|#define debugMsg QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, "qt.core.logging").debug
  ------------------
  300|       |
  301|      0|        er += parser.rules();
  302|      0|    }
  303|       |
  304|      1|    const QString configFileName = QStringLiteral("qtlogging.ini");
  305|       |
  306|      1|#if !defined(QT_BOOTSTRAPPED)
  307|       |    // get rules from Qt data configuration path
  308|      1|    const QString qtConfigPath
  309|      1|            = QDir(QLibraryInfo::path(QLibraryInfo::DataPath)).absoluteFilePath(configFileName);
  310|      1|    qr = loadRulesFromFile(qtConfigPath);
  311|      1|#endif
  312|       |
  313|       |    // get rules from user's/system configuration
  314|      1|    const QString envPath = QStandardPaths::locate(QStandardPaths::GenericConfigLocation,
  315|      1|                                                   QString::fromLatin1("QtProject/") + configFileName);
  316|      1|    if (!envPath.isEmpty())
  ------------------
  |  Branch (316:9): [True: 0, False: 1]
  ------------------
  317|      0|        cr = loadRulesFromFile(envPath);
  318|       |
  319|      1|    const QMutexLocker locker(&registryMutex);
  320|       |
  321|      1|    ruleSets[EnvironmentRules] = std::move(er);
  322|      1|    ruleSets[QtConfigRules] = std::move(qr);
  323|      1|    ruleSets[ConfigRules] = std::move(cr);
  324|       |
  325|      1|    if (!ruleSets[EnvironmentRules].isEmpty() || !ruleSets[QtConfigRules].isEmpty() || !ruleSets[ConfigRules].isEmpty())
  ------------------
  |  Branch (325:9): [True: 0, False: 1]
  |  Branch (325:50): [True: 0, False: 1]
  |  Branch (325:88): [True: 0, False: 1]
  ------------------
  326|      0|        updateRules();
  327|      1|}
_ZN16QLoggingRegistry16registerCategoryEP16QLoggingCategory9QtMsgType:
  336|      1|{
  337|      1|    const auto locker = qt_scoped_lock(registryMutex);
  338|       |
  339|      1|    auto r = categories.tryEmplace(cat, enableForLevel);
  340|      1|    if (r.inserted) {
  ------------------
  |  Branch (340:9): [True: 1, False: 0]
  ------------------
  341|       |        // new entry
  342|      1|        (*categoryFilter)(cat);
  343|      1|    }
  344|      1|}
_ZN16QLoggingRegistry18unregisterCategoryEP16QLoggingCategory:
  351|      1|{
  352|      1|    const auto locker = qt_scoped_lock(registryMutex);
  353|      1|    categories.remove(cat);
  354|      1|}
_ZN16QLoggingRegistry8instanceEv:
  423|      3|{
  424|      3|    return qtLoggingRegistry();
  425|      3|}
_ZN16QLoggingRegistry21defaultCategoryFilterEP16QLoggingCategory:
  434|      1|{
  435|      1|    const QLoggingRegistry *reg = QLoggingRegistry::instance();
  436|      1|    Q_ASSERT(reg->categories.contains(cat));
  437|      1|    QtMsgType enableForLevel = reg->categories.value(cat);
  438|       |
  439|       |    // NB: note that the numeric values of the Qt*Msg constants are
  440|       |    //     not in severity order.
  441|      1|    bool debug = (enableForLevel == QtDebugMsg);
  442|      1|    bool info = debug || (enableForLevel == QtInfoMsg);
  ------------------
  |  Branch (442:17): [True: 1, False: 0]
  |  Branch (442:26): [True: 0, False: 0]
  ------------------
  443|      1|    bool warning = info || (enableForLevel == QtWarningMsg);
  ------------------
  |  Branch (443:20): [True: 1, False: 0]
  |  Branch (443:28): [True: 0, False: 0]
  ------------------
  444|      1|    bool critical = warning || (enableForLevel == QtCriticalMsg);
  ------------------
  |  Branch (444:21): [True: 1, False: 0]
  |  Branch (444:32): [True: 0, False: 0]
  ------------------
  445|       |
  446|       |    // hard-wired implementation of
  447|       |    //   qt.*.debug=false
  448|       |    //   qt.debug=false
  449|      1|    if (const char *categoryName = cat->categoryName()) {
  ------------------
  |  Branch (449:21): [True: 1, False: 0]
  ------------------
  450|       |        // == "qt" or startsWith("qt.")
  451|      1|        if (strcmp(categoryName, "qt") == 0) {
  ------------------
  |  Branch (451:13): [True: 0, False: 1]
  ------------------
  452|      0|            debug = false;
  453|      1|        } else if (strncmp(categoryName, "qt.", 3) == 0) {
  ------------------
  |  Branch (453:20): [True: 0, False: 1]
  ------------------
  454|       |            // may be overridden
  455|      0|            auto it = reg->qtCategoryEnvironmentOverrides.find(categoryName);
  456|      0|            if (it == reg->qtCategoryEnvironmentOverrides.end())
  ------------------
  |  Branch (456:17): [True: 0, False: 0]
  ------------------
  457|      0|                debug = false;
  458|      0|            else
  459|      0|                debug = qEnvironmentVariableIntValue(it->second);
  460|      0|        }
  461|      1|    }
  462|       |
  463|      1|    const auto categoryName = QLatin1StringView(cat->categoryName());
  464|       |
  465|      4|    for (const auto &ruleSet : reg->ruleSets) {
  ------------------
  |  Branch (465:30): [True: 4, False: 1]
  ------------------
  466|      4|        for (const auto &rule : ruleSet) {
  ------------------
  |  Branch (466:31): [True: 0, False: 4]
  ------------------
  467|      0|            int filterpass = rule.pass(categoryName, QtDebugMsg);
  468|      0|            if (filterpass != 0)
  ------------------
  |  Branch (468:17): [True: 0, False: 0]
  ------------------
  469|      0|                debug = (filterpass > 0);
  470|      0|            filterpass = rule.pass(categoryName, QtInfoMsg);
  471|      0|            if (filterpass != 0)
  ------------------
  |  Branch (471:17): [True: 0, False: 0]
  ------------------
  472|      0|                info = (filterpass > 0);
  473|      0|            filterpass = rule.pass(categoryName, QtWarningMsg);
  474|      0|            if (filterpass != 0)
  ------------------
  |  Branch (474:17): [True: 0, False: 0]
  ------------------
  475|      0|                warning = (filterpass > 0);
  476|      0|            filterpass = rule.pass(categoryName, QtCriticalMsg);
  477|      0|            if (filterpass != 0)
  ------------------
  |  Branch (477:17): [True: 0, False: 0]
  ------------------
  478|      0|                critical = (filterpass > 0);
  479|      0|        }
  480|      4|    }
  481|       |
  482|      1|    cat->setEnabled(QtDebugMsg, debug);
  483|      1|    cat->setEnabled(QtInfoMsg, info);
  484|      1|    cat->setEnabled(QtWarningMsg, warning);
  485|      1|    cat->setEnabled(QtCriticalMsg, critical);
  486|      1|}
qloggingregistry.cpp:_ZL14qtLoggingDebugv:
  243|      3|{
  244|      3|    static const bool debugEnv = [] {
  245|      3|        bool debug = qEnvironmentVariableIsSet("QT_LOGGING_DEBUG");
  246|      3|        if (debug)
  247|      3|            debugMsg("QT_LOGGING_DEBUG environment variable is set.");
  248|      3|        return debug;
  249|      3|    }();
  250|      3|    return debugEnv;
  251|      3|}
qloggingregistry.cpp:_ZZL14qtLoggingDebugvENK3$_0clEv:
  244|      1|    static const bool debugEnv = [] {
  245|      1|        bool debug = qEnvironmentVariableIsSet("QT_LOGGING_DEBUG");
  246|      1|        if (debug)
  ------------------
  |  Branch (246:13): [True: 0, False: 1]
  ------------------
  247|      0|            debugMsg("QT_LOGGING_DEBUG environment variable is set.");
  ------------------
  |  |   22|      0|#define debugMsg QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, "qt.core.logging").debug
  ------------------
  248|      1|        return debug;
  249|      1|    }();
qloggingregistry.cpp:_ZL17loadRulesFromFileRK7QString:
  254|      1|{
  255|      1|    if (qtLoggingDebug()) {
  ------------------
  |  Branch (255:9): [True: 0, False: 1]
  ------------------
  256|      0|        debugMsg("Checking \"%s\" for rules",
  ------------------
  |  |   22|      0|#define debugMsg QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, "qt.core.logging").debug
  ------------------
  257|      0|                 QDir::toNativeSeparators(filePath).toUtf8().constData());
  258|      0|    }
  259|       |
  260|      1|    QFile file(filePath);
  261|      1|    if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
  ------------------
  |  Branch (261:9): [True: 0, False: 1]
  ------------------
  262|      0|        QTextStream stream(&file);
  263|      0|        QLoggingSettingsParser parser;
  264|      0|        parser.setContent(stream);
  265|      0|        if (qtLoggingDebug())
  ------------------
  |  Branch (265:13): [True: 0, False: 0]
  ------------------
  266|      0|            debugMsg("Loaded %td rules", static_cast<ptrdiff_t>(parser.rules().size()));
  ------------------
  |  |   22|      0|#define debugMsg QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, "qt.core.logging").debug
  ------------------
  267|      0|        return parser.rules();
  268|      0|    }
  269|      1|    return QList<QLoggingRule>();
  270|      1|}

_ZN16QResourcePrivate5clearEv:
  314|      3|{
  315|      3|    absoluteFilePath.clear();
  316|      3|    compressionAlgo = QResource::NoCompression;
  317|      3|    data = nullptr;
  318|      3|    size = 0;
  319|      3|    children.clear();
  320|      3|    lastModified = 0;
  321|      3|    container = 0;
  322|      3|    for (int i = 0; i < related.size(); ++i) {
  ------------------
  |  Branch (322:21): [True: 0, False: 3]
  ------------------
  323|      0|        QResourceRoot *root = related.at(i);
  324|      0|        if (!root->ref.deref())
  ------------------
  |  Branch (324:13): [True: 0, False: 0]
  ------------------
  325|      0|            delete root;
  326|      0|    }
  327|      3|    related.clear();
  328|      3|}
_ZN16QResourcePrivate4loadERK7QString:
  331|      1|{
  332|      1|    related.clear();
  333|      1|    const auto locker = qt_scoped_lock(resourceMutex());
  334|      1|    const ResourceList *list = resourceList();
  335|      1|    QString cleaned = cleanPath(file);
  336|      1|    for (int i = 0; i < list->size(); ++i) {
  ------------------
  |  Branch (336:21): [True: 0, False: 1]
  ------------------
  337|      0|        QResourceRoot *res = list->at(i);
  338|      0|        const int node = res->findNode(cleaned, locale);
  339|      0|        if (node != -1) {
  ------------------
  |  Branch (339:13): [True: 0, False: 0]
  ------------------
  340|      0|            if (related.isEmpty()) {
  ------------------
  |  Branch (340:17): [True: 0, False: 0]
  ------------------
  341|      0|                container = res->isContainer(node);
  342|      0|                if (!container) {
  ------------------
  |  Branch (342:21): [True: 0, False: 0]
  ------------------
  343|      0|                    data = res->data(node, &size);
  344|      0|                    compressionAlgo = res->compressionAlgo(node);
  345|      0|                } else {
  346|      0|                    data = nullptr;
  347|      0|                    size = 0;
  348|      0|                    compressionAlgo = QResource::NoCompression;
  349|      0|                }
  350|      0|                lastModified = res->lastModified(node);
  351|      0|            } else if (res->isContainer(node) != container) {
  ------------------
  |  Branch (351:24): [True: 0, False: 0]
  ------------------
  352|      0|                qWarning("QResourceInfo: Resource [%s] has both data and children!",
  353|      0|                         file.toLatin1().constData());
  354|      0|            }
  355|      0|            res->ref.ref();
  356|      0|            related.append(res);
  357|      0|        } else if (res->mappingRootSubdir(file)) {
  ------------------
  |  Branch (357:20): [True: 0, False: 0]
  ------------------
  358|      0|            container = true;
  359|      0|            data = nullptr;
  360|      0|            size = 0;
  361|      0|            compressionAlgo = QResource::NoCompression;
  362|      0|            lastModified = 0;
  363|      0|            res->ref.ref();
  364|      0|            related.append(res);
  365|      0|        }
  366|      0|    }
  367|      1|    return !related.isEmpty();
  368|      1|}
_ZNK16QResourcePrivate17ensureInitializedEv:
  371|      1|{
  372|      1|    if (!related.isEmpty())
  ------------------
  |  Branch (372:9): [True: 0, False: 1]
  ------------------
  373|      0|        return;
  374|      1|    QResourcePrivate *that = const_cast<QResourcePrivate *>(this);
  375|      1|    if (fileName == ":"_L1)
  ------------------
  |  Branch (375:9): [True: 0, False: 1]
  ------------------
  376|      0|        that->fileName += u'/';
  377|      1|    that->absoluteFilePath = fileName;
  378|      1|    if (!that->absoluteFilePath.startsWith(u':'))
  ------------------
  |  Branch (378:9): [True: 0, False: 1]
  ------------------
  379|      0|        that->absoluteFilePath.prepend(u':');
  380|       |
  381|      1|    QStringView path(fileName);
  382|      1|    if (path.startsWith(u':'))
  ------------------
  |  Branch (382:9): [True: 1, False: 0]
  ------------------
  383|      1|        path = path.mid(1);
  384|       |
  385|      1|    if (path.startsWith(u'/')) {
  ------------------
  |  Branch (385:9): [True: 1, False: 0]
  ------------------
  386|      1|        that->load(path.toString());
  387|      1|    } else {
  388|       |        // Should we search QDir::searchPath() before falling back to root ?
  389|      0|        const QString searchPath(u'/' + path);
  390|      0|        if (that->load(searchPath))
  ------------------
  |  Branch (390:13): [True: 0, False: 0]
  ------------------
  391|      0|            that->absoluteFilePath = u':' + searchPath;
  392|      0|    }
  393|      1|}
_ZN9QResourceC2ERK7QStringRK7QLocale:
  507|      1|QResource::QResource(const QString &file, const QLocale &locale) : d_ptr(new QResourcePrivate(this))
  508|      1|{
  509|      1|    Q_D(QResource);
  510|      1|    d->fileName = file;
  511|      1|    d->locale = locale;
  512|      1|}
_ZN9QResourceD2Ev:
  518|      1|{
  519|      1|}
_ZN9QResource11setFileNameERK7QString:
  555|      1|{
  556|      1|    Q_D(QResource);
  557|      1|    d->clear();
  558|      1|    d->fileName = file;
  559|      1|}
_ZNK9QResource7isValidEv:
  596|      1|{
  597|      1|    Q_D(const QResource);
  598|      1|    d->ensureInitialized();
  599|      1|    return !d->related.isEmpty();
  600|      1|}
_ZN19QResourceFileEngineC2ERK7QString:
 1416|      1|    QAbstractFileEngine(*new QResourceFileEnginePrivate(this))
 1417|      1|{
 1418|      1|    Q_D(QResourceFileEngine);
 1419|      1|    d->resource.setFileName(file);
 1420|      1|}
_ZN19QResourceFileEngineD2Ev:
 1423|      1|{
 1424|      1|}
_ZNK19QResourceFileEngine9fileFlagsE6QFlagsIN19QAbstractFileEngine8FileFlagEE:
 1518|      1|{
 1519|      1|    Q_D(const QResourceFileEngine);
 1520|      1|    QAbstractFileEngine::FileFlags ret;
 1521|      1|    if (!d->resource.isValid())
  ------------------
  |  Branch (1521:9): [True: 1, False: 0]
  ------------------
 1522|      1|        return ret;
 1523|       |
 1524|      0|    if (type & PermsMask)
  ------------------
  |  Branch (1524:9): [True: 0, False: 0]
  ------------------
 1525|      0|        ret |= QAbstractFileEngine::FileFlags(ReadOwnerPerm | ReadUserPerm | ReadGroupPerm
 1526|      0|                                              | ReadOtherPerm);
 1527|      0|    if (type & TypesMask) {
  ------------------
  |  Branch (1527:9): [True: 0, False: 0]
  ------------------
 1528|      0|        if (d->resource.isDir())
  ------------------
  |  Branch (1528:13): [True: 0, False: 0]
  ------------------
 1529|      0|            ret |= DirectoryType;
 1530|      0|        else
 1531|      0|            ret |= FileType;
 1532|      0|    }
 1533|      0|    if (type & FlagsMask) {
  ------------------
  |  Branch (1533:9): [True: 0, False: 0]
  ------------------
 1534|      0|        ret |= ExistsFlag;
 1535|      0|        if (d->resource.absoluteFilePath() == ":/"_L1)
  ------------------
  |  Branch (1535:13): [True: 0, False: 0]
  ------------------
 1536|      0|            ret |= RootFlag;
 1537|      0|    }
 1538|      0|    return ret;
 1539|      1|}
qresource.cpp:_ZL13resourceMutexv:
  188|      1|{ return resourceGlobalData->resourceMutex; }
qresource.cpp:_ZL12resourceListv:
  191|      1|{ return &resourceGlobalData->resourceList; }
qresource.cpp:_ZN12_GLOBAL__N_19cleanPathERK7QString:
  165|      1|{
  166|      1|    QString path = QDir::cleanPath(_path);
  167|       |    // QDir::cleanPath does not remove two trailing slashes under _Windows_
  168|       |    // due to support for UNC paths. Remove those manually.
  169|      1|    if (path.startsWith("//"_L1))
  ------------------
  |  Branch (169:9): [True: 0, False: 1]
  ------------------
  170|      0|        path.remove(0, 1);
  171|      1|    return path;
  172|      1|}
_ZN16QResourcePrivateC2EP9QResource:
  285|      1|    inline QResourcePrivate(QResource *_q) : q_ptr(_q) { clear(); }
_ZN26QResourceFileEnginePrivateC2EP19QAbstractFileEngine:
 1401|      1|        QAbstractFileEnginePrivate(q) {}
_ZN26QResourceFileEnginePrivateD2Ev:
 1404|      1|    {
 1405|      1|        if (mustUnmap)
  ------------------
  |  Branch (1405:13): [True: 0, False: 1]
  ------------------
 1406|      0|            unmapUncompressed_sys();
 1407|      1|    }
_ZN16QResourcePrivateD2Ev:
  286|      1|    inline ~QResourcePrivate() { clear(); }

_ZN14QStandardPaths6locateENS_16StandardLocationERK7QString6QFlagsINS_12LocateOptionEE:
  403|      1|{
  404|      1|    const QStringList &dirs = standardLocations(type);
  405|      3|    for (QStringList::const_iterator dir = dirs.constBegin(); dir != dirs.constEnd(); ++dir) {
  ------------------
  |  Branch (405:63): [True: 2, False: 1]
  ------------------
  406|      2|        const QString path = *dir + u'/' + fileName;
  407|      2|        if (existsAsSpecified(path, options))
  ------------------
  |  Branch (407:13): [True: 0, False: 2]
  ------------------
  408|      0|            return path;
  409|      2|    }
  410|      1|    return QString();
  411|      1|}
_ZN14QStandardPaths17isTestModeEnabledEv:
  633|      1|{
  634|      1|    return qsp_testMode;
  635|      1|}
qstandardpaths.cpp:_ZL17existsAsSpecifiedRK7QString6QFlagsIN14QStandardPaths12LocateOptionEE:
  393|      2|{
  394|      2|    if (options & QStandardPaths::LocateDirectory)
  ------------------
  |  Branch (394:9): [True: 0, False: 2]
  ------------------
  395|      0|        return QDir(path).exists();
  396|      2|    return QFileInfo(path).isFile();
  397|      2|}

_ZN14QStandardPaths16writableLocationENS_16StandardLocationE:
  174|      1|{
  175|      1|    switch (type) {
  176|      0|    case HomeLocation:
  ------------------
  |  Branch (176:5): [True: 0, False: 1]
  ------------------
  177|      0|        return QDir::homePath();
  178|      0|    case TempLocation:
  ------------------
  |  Branch (178:5): [True: 0, False: 1]
  ------------------
  179|      0|        return QDir::tempPath();
  180|      0|    case CacheLocation:
  ------------------
  |  Branch (180:5): [True: 0, False: 1]
  ------------------
  181|      0|    case GenericCacheLocation:
  ------------------
  |  Branch (181:5): [True: 0, False: 1]
  ------------------
  182|      0|    {
  183|      0|        QString xdgCacheHome;
  184|      0|        if (isTestModeEnabled()) {
  ------------------
  |  Branch (184:13): [True: 0, False: 0]
  ------------------
  185|      0|            xdgCacheHome = QDir::homePath() + "/.qttest/cache"_L1;
  186|      0|        } else {
  187|       |            // http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
  188|      0|            xdgCacheHome = qEnvironmentVariable("XDG_CACHE_HOME");
  189|      0|            if (!xdgCacheHome.startsWith(u'/'))
  ------------------
  |  Branch (189:17): [True: 0, False: 0]
  ------------------
  190|      0|                xdgCacheHome.clear(); // spec says relative paths should be ignored
  191|       |
  192|      0|            if (xdgCacheHome.isEmpty())
  ------------------
  |  Branch (192:17): [True: 0, False: 0]
  ------------------
  193|      0|                xdgCacheHome = QDir::homePath() + "/.cache"_L1;
  194|      0|        }
  195|      0|        if (type == QStandardPaths::CacheLocation)
  ------------------
  |  Branch (195:13): [True: 0, False: 0]
  ------------------
  196|      0|            appendOrganizationAndApp(xdgCacheHome);
  197|      0|        return xdgCacheHome;
  198|      0|    }
  199|      0|    case StateLocation:
  ------------------
  |  Branch (199:5): [True: 0, False: 1]
  ------------------
  200|      0|    case GenericStateLocation:
  ------------------
  |  Branch (200:5): [True: 0, False: 1]
  ------------------
  201|      0|    {
  202|      0|        QString xdgStateHome;
  203|      0|        if (isTestModeEnabled()) {
  ------------------
  |  Branch (203:13): [True: 0, False: 0]
  ------------------
  204|      0|            xdgStateHome = QDir::homePath() + "/.qttest/state"_L1;
  205|      0|        } else {
  206|       |            // http://standards.freedesktop.org/basedir-spec/basedir-spec-0.8.html
  207|      0|            xdgStateHome = qEnvironmentVariable("XDG_STATE_HOME");
  208|      0|            if (!xdgStateHome.startsWith(u'/'))
  ------------------
  |  Branch (208:17): [True: 0, False: 0]
  ------------------
  209|      0|                xdgStateHome.clear(); // spec says relative paths should be ignored
  210|       |
  211|      0|            if (xdgStateHome.isEmpty())
  ------------------
  |  Branch (211:17): [True: 0, False: 0]
  ------------------
  212|      0|                xdgStateHome = QDir::homePath() + "/.local/state"_L1;
  213|      0|        }
  214|      0|        if (type == QStandardPaths::StateLocation)
  ------------------
  |  Branch (214:13): [True: 0, False: 0]
  ------------------
  215|      0|            appendOrganizationAndApp(xdgStateHome);
  216|      0|        return xdgStateHome;
  217|      0|    }
  218|      0|    case AppDataLocation:
  ------------------
  |  Branch (218:5): [True: 0, False: 1]
  ------------------
  219|      0|    case AppLocalDataLocation:
  ------------------
  |  Branch (219:5): [True: 0, False: 1]
  ------------------
  220|      0|    case GenericDataLocation:
  ------------------
  |  Branch (220:5): [True: 0, False: 1]
  ------------------
  221|      0|    {
  222|      0|        QString xdgDataHome;
  223|      0|        if (isTestModeEnabled()) {
  ------------------
  |  Branch (223:13): [True: 0, False: 0]
  ------------------
  224|      0|            xdgDataHome = QDir::homePath() + "/.qttest/share"_L1;
  225|      0|        } else {
  226|      0|            xdgDataHome = qEnvironmentVariable("XDG_DATA_HOME");
  227|      0|            if (!xdgDataHome.startsWith(u'/'))
  ------------------
  |  Branch (227:17): [True: 0, False: 0]
  ------------------
  228|      0|                xdgDataHome.clear(); // spec says relative paths should be ignored
  229|       |
  230|      0|            if (xdgDataHome.isEmpty())
  ------------------
  |  Branch (230:17): [True: 0, False: 0]
  ------------------
  231|      0|                xdgDataHome = QDir::homePath() + "/.local/share"_L1;
  232|      0|        }
  233|      0|        if (type == AppDataLocation || type == AppLocalDataLocation)
  ------------------
  |  Branch (233:13): [True: 0, False: 0]
  |  Branch (233:40): [True: 0, False: 0]
  ------------------
  234|      0|            appendOrganizationAndApp(xdgDataHome);
  235|      0|        return xdgDataHome;
  236|      0|    }
  237|      0|    case ConfigLocation:
  ------------------
  |  Branch (237:5): [True: 0, False: 1]
  ------------------
  238|      1|    case GenericConfigLocation:
  ------------------
  |  Branch (238:5): [True: 1, False: 0]
  ------------------
  239|      1|    case AppConfigLocation:
  ------------------
  |  Branch (239:5): [True: 0, False: 1]
  ------------------
  240|      1|    {
  241|      1|        QString xdgConfigHome;
  242|      1|        if (isTestModeEnabled()) {
  ------------------
  |  Branch (242:13): [True: 0, False: 1]
  ------------------
  243|      0|            xdgConfigHome = QDir::homePath() + "/.qttest/config"_L1;
  244|      1|        } else {
  245|       |            // http://standards.freedesktop.org/basedir-spec/latest/
  246|      1|            xdgConfigHome = qEnvironmentVariable("XDG_CONFIG_HOME");
  247|      1|            if (!xdgConfigHome.startsWith(u'/'))
  ------------------
  |  Branch (247:17): [True: 1, False: 0]
  ------------------
  248|      1|                xdgConfigHome.clear(); // spec says relative paths should be ignored
  249|       |
  250|      1|            if (xdgConfigHome.isEmpty())
  ------------------
  |  Branch (250:17): [True: 1, False: 0]
  ------------------
  251|      1|                xdgConfigHome = QDir::homePath() + "/.config"_L1;
  252|      1|        }
  253|      1|        if (type == AppConfigLocation)
  ------------------
  |  Branch (253:13): [True: 0, False: 1]
  ------------------
  254|      0|            appendOrganizationAndApp(xdgConfigHome);
  255|      1|        return xdgConfigHome;
  256|      1|    }
  257|      0|    case RuntimeLocation:
  ------------------
  |  Branch (257:5): [True: 0, False: 1]
  ------------------
  258|      0|    {
  259|      0|        QString xdgRuntimeDir = qEnvironmentVariable("XDG_RUNTIME_DIR");
  260|      0|        if (!xdgRuntimeDir.startsWith(u'/'))
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  ------------------
  261|      0|            xdgRuntimeDir.clear(); // spec says relative paths should be ignored
  262|       |
  263|      0|        bool fromEnv = !xdgRuntimeDir.isEmpty();
  264|      0|        if (xdgRuntimeDir.isEmpty() || !checkXdgRuntimeDir(xdgRuntimeDir)) {
  ------------------
  |  Branch (264:13): [True: 0, False: 0]
  |  Branch (264:40): [True: 0, False: 0]
  ------------------
  265|       |            // environment variable not set or is set to something unsuitable
  266|      0|            const uint myUid = uint(geteuid());
  267|      0|            const QString userName = QFileSystemEngine::resolveUserName(myUid);
  268|      0|            xdgRuntimeDir = QDir::tempPath() + "/runtime-"_L1 + userName;
  269|       |
  270|      0|            if (!fromEnv) {
  ------------------
  |  Branch (270:17): [True: 0, False: 0]
  ------------------
  271|      0|#ifndef Q_OS_WASM
  272|      0|                qWarning("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '%ls'", qUtf16Printable(xdgRuntimeDir));
  273|      0|#endif
  274|      0|            }
  275|       |
  276|      0|            if (!checkXdgRuntimeDir(xdgRuntimeDir))
  ------------------
  |  Branch (276:17): [True: 0, False: 0]
  ------------------
  277|      0|                xdgRuntimeDir.clear();
  278|      0|        }
  279|       |
  280|      0|        return xdgRuntimeDir;
  281|      1|    }
  282|      0|    default:
  ------------------
  |  Branch (282:5): [True: 0, False: 1]
  ------------------
  283|      0|        break;
  284|      1|    }
  285|       |
  286|      0|#if QT_CONFIG(regularexpression)
  287|       |    // http://www.freedesktop.org/wiki/Software/xdg-user-dirs
  288|      0|    QString xdgConfigHome = qEnvironmentVariable("XDG_CONFIG_HOME");
  289|      0|    if (!xdgConfigHome.startsWith(u'/'))
  ------------------
  |  Branch (289:9): [True: 0, False: 0]
  ------------------
  290|      0|        xdgConfigHome.clear(); // spec says relative paths should be ignored
  291|       |
  292|      0|    if (xdgConfigHome.isEmpty())
  ------------------
  |  Branch (292:9): [True: 0, False: 0]
  ------------------
  293|      0|        xdgConfigHome = QDir::homePath() + "/.config"_L1;
  294|      0|    QFile file(xdgConfigHome + "/user-dirs.dirs"_L1);
  295|      0|    const QLatin1StringView key = xdg_key_name(type);
  296|      0|    if (!key.isEmpty() && !isTestModeEnabled() && file.open(QIODevice::ReadOnly)) {
  ------------------
  |  Branch (296:9): [True: 0, False: 0]
  |  Branch (296:27): [True: 0, False: 0]
  |  Branch (296:51): [True: 0, False: 0]
  ------------------
  297|      0|        QTextStream stream(&file);
  298|       |        // Only look for lines like: XDG_DESKTOP_DIR="$HOME/Desktop"
  299|      0|        static const QRegularExpression exp(u"^XDG_(.*)_DIR=(.*)$"_s);
  300|      0|        QString result;
  301|      0|        while (!stream.atEnd()) {
  ------------------
  |  Branch (301:16): [True: 0, False: 0]
  ------------------
  302|      0|            const QString &line = stream.readLine();
  303|      0|            QRegularExpressionMatch match = exp.match(line);
  304|      0|            if (match.hasMatch() && match.capturedView(1) == key) {
  ------------------
  |  Branch (304:17): [True: 0, False: 0]
  |  Branch (304:17): [True: 0, False: 0]
  |  Branch (304:37): [True: 0, False: 0]
  ------------------
  305|      0|                QStringView value = match.capturedView(2);
  306|      0|                if (value.size() > 2
  ------------------
  |  Branch (306:21): [True: 0, False: 0]
  ------------------
  307|      0|                    && value.startsWith(u'\"')
  ------------------
  |  Branch (307:24): [True: 0, False: 0]
  ------------------
  308|      0|                    && value.endsWith(u'\"'))
  ------------------
  |  Branch (308:24): [True: 0, False: 0]
  ------------------
  309|      0|                    value = value.mid(1, value.size() - 2);
  310|       |                // value can start with $HOME
  311|      0|                if (value.startsWith("$HOME"_L1))
  ------------------
  |  Branch (311:21): [True: 0, False: 0]
  ------------------
  312|      0|                    result = QDir::homePath() + value.mid(5);
  313|      0|                else
  314|      0|                    result = value.toString();
  315|      0|                if (result.size() > 1 && result.endsWith(u'/'))
  ------------------
  |  Branch (315:21): [True: 0, False: 0]
  |  Branch (315:42): [True: 0, False: 0]
  ------------------
  316|      0|                    result.chop(1);
  317|      0|            }
  318|      0|        }
  319|      0|        if (!result.isNull())
  ------------------
  |  Branch (319:13): [True: 0, False: 0]
  ------------------
  320|      0|            return result;
  321|      0|    }
  322|      0|#endif // QT_CONFIG(regularexpression)
  323|       |
  324|      0|    QString path;
  325|      0|    switch (type) {
  326|      0|    case DesktopLocation:
  ------------------
  |  Branch (326:5): [True: 0, False: 0]
  ------------------
  327|      0|        path = QDir::homePath() + "/Desktop"_L1;
  328|      0|        break;
  329|      0|    case DocumentsLocation:
  ------------------
  |  Branch (329:5): [True: 0, False: 0]
  ------------------
  330|      0|        path = QDir::homePath() + "/Documents"_L1;
  331|      0|       break;
  332|      0|    case PicturesLocation:
  ------------------
  |  Branch (332:5): [True: 0, False: 0]
  ------------------
  333|      0|        path = QDir::homePath() + "/Pictures"_L1;
  334|      0|        break;
  335|       |
  336|      0|    case FontsLocation:
  ------------------
  |  Branch (336:5): [True: 0, False: 0]
  ------------------
  337|      0|        path = writableLocation(GenericDataLocation) + "/fonts"_L1;
  338|      0|        break;
  339|       |
  340|      0|    case MusicLocation:
  ------------------
  |  Branch (340:5): [True: 0, False: 0]
  ------------------
  341|      0|        path = QDir::homePath() + "/Music"_L1;
  342|      0|        break;
  343|       |
  344|      0|    case MoviesLocation:
  ------------------
  |  Branch (344:5): [True: 0, False: 0]
  ------------------
  345|      0|        path = QDir::homePath() + "/Videos"_L1;
  346|      0|        break;
  347|      0|    case DownloadLocation:
  ------------------
  |  Branch (347:5): [True: 0, False: 0]
  ------------------
  348|      0|        path = QDir::homePath() + "/Downloads"_L1;
  349|      0|        break;
  350|      0|    case ApplicationsLocation:
  ------------------
  |  Branch (350:5): [True: 0, False: 0]
  ------------------
  351|      0|        path = writableLocation(GenericDataLocation) + "/applications"_L1;
  352|      0|        break;
  353|       |
  354|      0|    case PublicShareLocation:
  ------------------
  |  Branch (354:5): [True: 0, False: 0]
  ------------------
  355|      0|        path = QDir::homePath() + "/Public"_L1;
  356|      0|        break;
  357|       |
  358|      0|    case TemplatesLocation:
  ------------------
  |  Branch (358:5): [True: 0, False: 0]
  ------------------
  359|      0|        path = QDir::homePath() + "/Templates"_L1;
  360|      0|        break;
  361|       |
  362|      0|    default:
  ------------------
  |  Branch (362:5): [True: 0, False: 0]
  ------------------
  363|      0|        break;
  364|      0|    }
  365|       |
  366|      0|    return path;
  367|      0|}
_ZN14QStandardPaths17standardLocationsENS_16StandardLocationE:
  415|      1|{
  416|      1|    QStringList dirs;
  417|      1|    switch (type) {
  418|      0|    case ConfigLocation:
  ------------------
  |  Branch (418:5): [True: 0, False: 1]
  ------------------
  419|      1|    case GenericConfigLocation:
  ------------------
  |  Branch (419:5): [True: 1, False: 0]
  ------------------
  420|      1|        dirs = xdgConfigDirs();
  421|      1|        break;
  422|      0|    case AppConfigLocation:
  ------------------
  |  Branch (422:5): [True: 0, False: 1]
  ------------------
  423|      0|        dirs = xdgConfigDirs();
  424|      0|        for (int i = 0; i < dirs.size(); ++i)
  ------------------
  |  Branch (424:25): [True: 0, False: 0]
  ------------------
  425|      0|            appendOrganizationAndApp(dirs[i]);
  426|      0|        break;
  427|      0|    case GenericDataLocation:
  ------------------
  |  Branch (427:5): [True: 0, False: 1]
  ------------------
  428|      0|        dirs = xdgDataDirs();
  429|      0|        break;
  430|      0|    case ApplicationsLocation:
  ------------------
  |  Branch (430:5): [True: 0, False: 1]
  ------------------
  431|      0|        dirs = xdgDataDirs();
  432|      0|        for (int i = 0; i < dirs.size(); ++i)
  ------------------
  |  Branch (432:25): [True: 0, False: 0]
  ------------------
  433|      0|            dirs[i].append("/applications"_L1);
  434|      0|        break;
  435|      0|    case AppDataLocation:
  ------------------
  |  Branch (435:5): [True: 0, False: 1]
  ------------------
  436|      0|    case AppLocalDataLocation:
  ------------------
  |  Branch (436:5): [True: 0, False: 1]
  ------------------
  437|      0|        dirs = xdgDataDirs();
  438|      0|        for (int i = 0; i < dirs.size(); ++i)
  ------------------
  |  Branch (438:25): [True: 0, False: 0]
  ------------------
  439|      0|            appendOrganizationAndApp(dirs[i]);
  440|      0|        break;
  441|      0|    case FontsLocation:
  ------------------
  |  Branch (441:5): [True: 0, False: 1]
  ------------------
  442|      0|        dirs += QDir::homePath() + "/.fonts"_L1;
  443|      0|        dirs += xdgDataDirs();
  444|      0|        for (int i = 1; i < dirs.size(); ++i)
  ------------------
  |  Branch (444:25): [True: 0, False: 0]
  ------------------
  445|      0|            dirs[i].append("/fonts"_L1);
  446|      0|        break;
  447|      0|    default:
  ------------------
  |  Branch (447:5): [True: 0, False: 1]
  ------------------
  448|      0|        break;
  449|      1|    }
  450|      1|    const QString localDir = writableLocation(type);
  451|      1|    dirs.prepend(localDir);
  452|      1|    return dirs;
  453|      1|}
qstandardpaths_unix.cpp:_ZL13xdgConfigDirsv:
  403|      1|{
  404|       |    // http://standards.freedesktop.org/basedir-spec/latest/
  405|      1|    const QString xdgConfigDirs = qEnvironmentVariable("XDG_CONFIG_DIRS");
  406|       |
  407|      1|    QStringList dirs = dirsList(xdgConfigDirs);
  408|      1|    if (dirs.isEmpty())
  ------------------
  |  Branch (408:9): [True: 1, False: 0]
  ------------------
  409|      1|        dirs.push_back(u"/etc/xdg"_s);
  410|       |
  411|      1|    return dirs;
  412|      1|}
qstandardpaths_unix.cpp:_ZL8dirsListRK7QString:
  370|      1|{
  371|      1|    QStringList dirs;
  372|       |    // http://standards.freedesktop.org/basedir-spec/latest/
  373|       |    // Normalize paths, skip relative paths (the spec says relative paths
  374|       |    // should be ignored)
  375|      1|    for (const auto dir : qTokenize(xdgEnvVar, u':'))
  ------------------
  |  Branch (375:25): [True: 1, False: 1]
  ------------------
  376|      1|        if (dir.startsWith(u'/'))
  ------------------
  |  Branch (376:13): [True: 0, False: 1]
  ------------------
  377|      0|            dirs.push_back(QDir::cleanPath(dir.toString()));
  378|       |
  379|       |    // Remove duplicates from the list, there's no use for duplicated paths
  380|       |    // in XDG_* env vars - if whatever is being looked for is not found in
  381|       |    // the given directory the first time, it won't be there the second time.
  382|       |    // Plus duplicate paths causes problems for example for mimetypes,
  383|       |    // where duplicate paths here lead to duplicated mime types returned
  384|       |    // for a file, eg "text/plain,text/plain" instead of "text/plain"
  385|      1|    dirs.removeDuplicates();
  386|       |
  387|      1|    return dirs;
  388|      1|}

_ZN31QAbstractEventDispatcherPrivateC2Ev:
   83|  1.93k|{
   84|       |    // Create the timer ID free list here to make sure that it is destroyed
   85|       |    // after any global static thread that may be using it.
   86|       |    // See also QTBUG-58732.
   87|  1.93k|    if (!timerIdFreeList.isDestroyed())
  ------------------
  |  Branch (87:9): [True: 1.93k, False: 0]
  ------------------
   88|  1.93k|        (void)timerIdFreeList();
   89|  1.93k|}
_ZN31QAbstractEventDispatcherPrivateD2Ev:
   91|  1.93k|QAbstractEventDispatcherPrivate::~QAbstractEventDispatcherPrivate()
_ZN24QAbstractEventDispatcherC2ER31QAbstractEventDispatcherPrivateP7QObject:
  172|  1.93k|    : QObject(dd, parent) {}
_ZN24QAbstractEventDispatcherD2Ev:
  178|  1.93k|{ }
_ZN24QAbstractEventDispatcher10startingUpEv:
  402|  1.93k|{ }
_ZN24QAbstractEventDispatcher11closingDownEv:
  408|  1.93k|{ }
_ZN26QAbstractEventDispatcherV2C2ER31QAbstractEventDispatcherPrivateP7QObject:
  652|  1.93k|    : QAbstractEventDispatcher((dd.isV2 = true, dd), parent)
  653|  1.93k|{
  654|  1.93k|}

qfsfileengine_unix.cpp:_ZL12qt_safe_openPKcij:
  256|      1|{
  257|      1|#ifdef O_CLOEXEC
  258|      1|    flags |= O_CLOEXEC;
  259|      1|#endif
  260|      1|    int fd;
  261|      1|    QT_EINTR_LOOP(fd, QT_OPEN(pathname, flags, mode));
  ------------------
  |  |   60|      1|    do {                                        \
  |  |   61|      1|        var = cmd;                              \
  |  |   62|      1|    } while (var == -1 && errno == EINTR)
  |  |  ------------------
  |  |  |  Branch (62:14): [True: 1, False: 0]
  |  |  |  Branch (62:27): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  262|       |
  263|       |#ifndef O_CLOEXEC
  264|       |    if (fd != -1)
  265|       |        ::fcntl(fd, F_SETFD, FD_CLOEXEC);
  266|       |#endif
  267|       |
  268|      1|    return fd;
  269|      1|}

_ZNK23QCoreApplicationPrivate7appNameEv:
  163|  1.93k|{
  164|  1.93k|    QString applicationName;
  165|       |#ifdef Q_OS_DARWIN
  166|       |    applicationName = infoDictionaryStringProperty(QStringLiteral("CFBundleName"));
  167|       |#endif
  168|  1.93k|    if (applicationName.isEmpty() && argv[0]) {
  ------------------
  |  Branch (168:9): [True: 1.93k, False: 0]
  |  Branch (168:38): [True: 1.93k, False: 0]
  ------------------
  169|  1.93k|        char *p = strrchr(argv[0], '/');
  170|  1.93k|        applicationName = QString::fromLocal8Bit(p ? p + 1 : argv[0]);
  ------------------
  |  Branch (170:50): [True: 0, False: 1.93k]
  ------------------
  171|  1.93k|    }
  172|       |
  173|  1.93k|    return applicationName;
  174|  1.93k|}
_ZNK23QCoreApplicationPrivate10appVersionEv:
  176|  1.93k|{
  177|  1.93k|    QString applicationVersion;
  178|       |#if defined(Q_OS_DARWIN)
  179|       |    applicationVersion = infoDictionaryStringProperty(QStringLiteral("CFBundleVersion"));
  180|       |#elif defined(Q_OS_ANDROID)
  181|       |    QJniObject context(QNativeInterface::QAndroidApplication::context());
  182|       |    if (context.isValid()) {
  183|       |        QJniObject pm = context.callObjectMethod(
  184|       |            "getPackageManager", "()Landroid/content/pm/PackageManager;");
  185|       |        QJniObject pn = context.callObjectMethod<jstring>("getPackageName");
  186|       |        if (pm.isValid() && pn.isValid()) {
  187|       |            QJniObject packageInfo = pm.callObjectMethod(
  188|       |                "getPackageInfo", "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;",
  189|       |                pn.object(), 0);
  190|       |            if (packageInfo.isValid()) {
  191|       |                QJniObject versionName = packageInfo.getObjectField(
  192|       |                    "versionName", "Ljava/lang/String;");
  193|       |                if (versionName.isValid())
  194|       |                    return versionName.toString();
  195|       |            }
  196|       |        }
  197|       |    }
  198|       |#endif
  199|  1.93k|    return applicationVersion;
  200|  1.93k|}
_ZN23QCoreApplicationPrivate27processCommandLineArgumentsEv:
  223|  1.93k|{
  224|  1.93k|    int j = argc ? 1 : 0;
  ------------------
  |  Branch (224:13): [True: 0, False: 1.93k]
  ------------------
  225|  1.93k|    for (int i = 1; i < argc; ++i) {
  ------------------
  |  Branch (225:21): [True: 0, False: 1.93k]
  ------------------
  226|      0|        if (!argv[i])
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|            continue;
  228|      0|        if (*argv[i] != '-') {
  ------------------
  |  Branch (228:13): [True: 0, False: 0]
  ------------------
  229|      0|            argv[j++] = argv[i];
  230|      0|            continue;
  231|      0|        }
  232|      0|        const char *arg = argv[i];
  233|      0|        if (arg[1] == '-') // startsWith("--")
  ------------------
  |  Branch (233:13): [True: 0, False: 0]
  ------------------
  234|      0|            ++arg;
  235|      0|        if (strncmp(arg, "-qmljsdebugger=", 15) == 0) {
  ------------------
  |  Branch (235:13): [True: 0, False: 0]
  ------------------
  236|      0|            qmljs_debug_arguments = QString::fromLocal8Bit(arg + 15);
  237|      0|        } else if (strcmp(arg, "-qmljsdebugger") == 0 && i < argc - 1) {
  ------------------
  |  Branch (237:20): [True: 0, False: 0]
  |  Branch (237:58): [True: 0, False: 0]
  ------------------
  238|      0|            ++i;
  239|      0|            qmljs_debug_arguments = QString::fromLocal8Bit(argv[i]);
  240|      0|        } else {
  241|      0|            argv[j++] = argv[i];
  242|      0|        }
  243|      0|    }
  244|       |
  245|  1.93k|    if (j < argc) {
  ------------------
  |  Branch (245:9): [True: 0, False: 1.93k]
  ------------------
  246|      0|        argv[j] = nullptr;
  247|      0|        argc = j;
  248|      0|    }
  249|  1.93k|}
qt_startup_hook:
  258|  1.93k|{
  259|  1.93k|}
_Z21qt_call_post_routinesv:
  330|  1.93k|{
  331|  1.93k|    if (!postRList.exists())
  ------------------
  |  Branch (331:9): [True: 1.93k, False: 0]
  ------------------
  332|  1.93k|        return;
  333|       |
  334|      0|    forever {
  335|      0|        QVFuncList list;
  336|      0|        {
  337|       |            // extract the current list and make the stored list empty
  338|      0|            const auto locker = qt_scoped_lock(globalRoutinesMutex);
  339|      0|            qSwap(*postRList, list);
  340|      0|        }
  341|       |
  342|      0|        if (list.isEmpty())
  ------------------
  |  Branch (342:13): [True: 0, False: 0]
  ------------------
  343|      0|            break;
  344|      0|        for (QtCleanUpFunction f : std::as_const(list))
  ------------------
  |  Branch (344:34): [True: 0, False: 0]
  ------------------
  345|      0|            f();
  346|      0|    }
  347|      0|}
_ZN23QCoreApplicationPrivateC2ERiPPc:
  433|  1.93k|    : argc(aargc), argv(aargv)
  434|  1.93k|{
  435|  1.93k|    static const char *const empty = "";
  436|  1.93k|    if (argc == 0 || argv == nullptr) {
  ------------------
  |  Branch (436:9): [True: 1.93k, False: 0]
  |  Branch (436:22): [True: 0, False: 0]
  ------------------
  437|  1.93k|        argc = 0;
  438|  1.93k|        argv = const_cast<char **>(&empty);
  439|  1.93k|    }
  440|       |#if defined(Q_OS_WIN)
  441|       |    if (!isArgvModified(argc, argv)) {
  442|       |        origArgc = argc;
  443|       |        origArgv = q20::make_unique_for_overwrite<char *[]>(argc);
  444|       |        std::copy(argv, argv + argc, origArgv.get());
  445|       |    }
  446|       |#endif // Q_OS_WIN
  447|       |
  448|  1.93k|#ifndef QT_NO_QOBJECT
  449|  1.93k|    QCoreApplicationPrivate::is_app_closing = false;
  450|       |
  451|  1.93k|#  if defined(Q_OS_UNIX)
  452|  1.93k|    if (Q_UNLIKELY(!setuidAllowed && (geteuid() != getuid())))
  453|      0|        qFatal("FATAL: The application binary appears to be running setuid, this is a security hole.");
  454|  1.93k|#  endif // Q_OS_UNIX
  455|       |
  456|  1.93k|    QThread *cur = QThread::currentThread(); // note: this may end up setting theMainThread!
  457|  1.93k|    if (cur != theMainThread.loadAcquire())
  ------------------
  |  Branch (457:9): [True: 0, False: 1.93k]
  ------------------
  458|      0|        qWarning("WARNING: QApplication was not created in the main() thread.");
  459|  1.93k|#endif
  460|  1.93k|}
_ZN23QCoreApplicationPrivateD2Ev:
  463|  1.93k|{
  464|  1.93k|#ifndef QT_NO_QOBJECT
  465|  1.93k|    cleanupThreadData();
  466|  1.93k|#endif
  467|       |#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
  468|       |    cleanupDebuggingConsole();
  469|       |#endif
  470|  1.93k|    QCoreApplicationPrivate::clearApplicationFilePath();
  471|  1.93k|}
_ZN23QCoreApplicationPrivate17cleanupThreadDataEv:
  476|  1.93k|{
  477|  1.93k|    auto thisThreadData = threadData.loadRelaxed();
  478|       |
  479|  1.93k|    if (thisThreadData && !threadData_clean) {
  ------------------
  |  Branch (479:9): [True: 1.93k, False: 0]
  |  Branch (479:27): [True: 1.93k, False: 0]
  ------------------
  480|  1.93k|#if QT_CONFIG(thread)
  481|  1.93k|        void *data = &thisThreadData->tls;
  482|  1.93k|        QThreadStorageData::finish((void **)data);
  483|  1.93k|#endif
  484|       |
  485|       |        // need to clear the state of the mainData, just in case a new QCoreApplication comes along.
  486|  1.93k|        const auto locker = qt_scoped_lock(thisThreadData->postEventList.mutex);
  487|  1.93k|        for (const QPostEvent &pe : std::as_const(thisThreadData->postEventList)) {
  ------------------
  |  Branch (487:35): [True: 0, False: 1.93k]
  ------------------
  488|      0|            if (pe.event) {
  ------------------
  |  Branch (488:17): [True: 0, False: 0]
  ------------------
  489|      0|                pe.receiver->d_func()->postedEvents.fetchAndSubAcquire(1);
  490|      0|                pe.event->m_posted = false;
  491|      0|                delete pe.event;
  492|      0|            }
  493|      0|        }
  494|  1.93k|        thisThreadData->postEventList.clear();
  495|  1.93k|        thisThreadData->postEventList.recursion = 0;
  496|  1.93k|        thisThreadData->quitNow = false;
  497|  1.93k|        threadData_clean = true;
  498|  1.93k|    }
  499|  1.93k|}
_ZN23QCoreApplicationPrivate21createEventDispatcherEv:
  502|  1.93k|{
  503|  1.93k|    Q_Q(QCoreApplication);
  504|  1.93k|    QThreadData *data = QThreadData::current();
  505|  1.93k|    Q_ASSERT(!data->hasEventDispatcher());
  506|  1.93k|    eventDispatcher = data->createEventDispatcher();
  507|  1.93k|    eventDispatcher->setParent(q);
  508|  1.93k|}
_ZN23QCoreApplicationPrivate20eventDispatcherReadyEv:
  511|  1.93k|{
  512|  1.93k|}
_ZN23QCoreApplicationPrivate19checkReceiverThreadEP7QObject:
  523|  1.93k|{
  524|  1.93k|    QThread *currentThread = QThread::currentThread();
  525|  1.93k|    QThread *thr = receiver->thread();
  526|  1.93k|    Q_ASSERT_X(currentThread == thr || !thr,
  527|  1.93k|               "QCoreApplication::sendEvent",
  528|  1.93k|               qPrintable(QString::fromLatin1("Cannot send events to objects owned by a different thread. "
  529|  1.93k|               "Current thread %1. Receiver '%2' was created in thread %3").arg(
  530|  1.93k|               QDebug::toString(currentThread), QDebug::toString(receiver), QDebug::toString(thr))));
  531|  1.93k|    Q_UNUSED(currentThread);
  532|  1.93k|    Q_UNUSED(thr);
  533|  1.93k|}
_ZN23QCoreApplicationPrivate10initLocaleEv:
  559|  1.93k|{
  560|       |#if defined(QT_BOOTSTRAPPED)
  561|       |    // Don't try to control bootstrap library locale or encoding.
  562|       |#elif defined(Q_OS_UNIX)
  563|       |    Q_CONSTINIT static bool qt_locale_initialized = false;
  564|  1.93k|    if (qt_locale_initialized)
  ------------------
  |  Branch (564:9): [True: 1.93k, False: 1]
  ------------------
  565|  1.93k|        return;
  566|      1|    qt_locale_initialized = true;
  567|       |
  568|       |    // By default the portable "C"/POSIX locale is selected and active.
  569|       |    // Apply the locale from the environment, via setlocale(), which will
  570|       |    // read LC_ALL, LC_<category>, and LANG, in order (for each category).
  571|      1|    setlocale(LC_ALL, "");
  572|       |
  573|       |    // Next, let's ensure that LC_CTYPE is UTF-8, since QStringConverter's
  574|       |    // QLocal8Bit hard-codes this, and we need to be consistent.
  575|       |#  if defined(Q_OS_INTEGRITY)
  576|       |    setlocale(LC_CTYPE, "UTF-8");
  577|       |#  elif defined(Q_OS_QNX)
  578|       |    // QNX has no nl_langinfo, so we can't check.
  579|       |    // FIXME: Shouldn't we still setlocale("UTF-8")?
  580|       |#  elif defined(Q_OS_ANDROID) && __ANDROID_API__ < __ANDROID_API_O__
  581|       |    // Android 6 still lacks nl_langinfo(), so we can't check.
  582|       |    // FIXME: Shouldn't we still setlocale("UTF-8")?
  583|       |#  elif defined(Q_OS_VXWORKS)
  584|       |    // VxWorks has no nl_langinfo, so we can't check.
  585|       |#  else
  586|       |    // std::string's SSO usually saves this the need to allocate:
  587|      1|    const std::string oldEncoding = nl_langinfo(CODESET);
  588|      1|    if (!Q_LIKELY(qstricmp(oldEncoding.data(), "UTF-8") == 0
  ------------------
  |  Branch (588:9): [True: 1, False: 0]
  ------------------
  589|      1|                  || qstricmp(oldEncoding.data(), "utf8") == 0)) {
  590|      1|        const QByteArray oldLocale = setlocale(LC_ALL, nullptr);
  591|      1|        QByteArray newLocale;
  592|      1|        bool warnOnOverride = true;
  593|       |#    if defined(Q_OS_DARWIN)
  594|       |        // Don't warn unless the char encoding has been changed from the
  595|       |        // default "C" encoding, or the user touched any of the locale
  596|       |        // environment variables to force the "C" char encoding.
  597|       |        warnOnOverride = qstrcmp(setlocale(LC_CTYPE, nullptr), "C") != 0
  598|       |            || getenv("LC_ALL") || getenv("LC_CTYPE") || getenv("LANG");
  599|       |
  600|       |        // No need to try language or region specific CTYPEs, as they
  601|       |        // all point back to the same generic UTF-8 CTYPE.
  602|       |        newLocale = setlocale(LC_CTYPE, "UTF-8");
  603|       |#    else
  604|      1|        newLocale = setlocale(LC_CTYPE, nullptr);
  605|      1|        if (qsizetype dot = newLocale.indexOf('.'); dot != -1)
  ------------------
  |  Branch (605:53): [True: 0, False: 1]
  ------------------
  606|      0|            newLocale.truncate(dot);    // remove encoding, if any
  607|      1|        if (qsizetype at = newLocale.indexOf('@'); at != -1)
  ------------------
  |  Branch (607:52): [True: 0, False: 1]
  ------------------
  608|      0|            newLocale.truncate(at);     // remove variant, as the old de_DE@euro
  609|      1|        newLocale += ".UTF-8";
  610|      1|        newLocale = setlocale(LC_CTYPE, newLocale);
  611|       |
  612|       |        // If that locale doesn't exist, try some fallbacks:
  613|      1|        if (newLocale.isEmpty())
  ------------------
  |  Branch (613:13): [True: 0, False: 1]
  ------------------
  614|      0|            newLocale = setlocale(LC_CTYPE, "C.UTF-8");
  615|      1|        if (newLocale.isEmpty())
  ------------------
  |  Branch (615:13): [True: 0, False: 1]
  ------------------
  616|      0|            newLocale = setlocale(LC_CTYPE, "C.utf8");
  617|      1|#    endif
  618|       |
  619|      1|        if (newLocale.isEmpty()) {
  ------------------
  |  Branch (619:13): [True: 0, False: 1]
  ------------------
  620|       |            // Failed to set a UTF-8 locale.
  621|      0|            qWarning("Detected locale \"%s\" with character encoding \"%s\", which is not UTF-8.\n"
  622|      0|                     "Qt depends on a UTF-8 locale, but has failed to switch to one.\n"
  623|      0|                     "If this causes problems, reconfigure your locale. See the locale(1) manual\n"
  624|      0|                     "for more information.", oldLocale.constData(), oldEncoding.data());
  625|      1|        } else if (warnOnOverride) {
  ------------------
  |  Branch (625:20): [True: 1, False: 0]
  ------------------
  626|       |            // Let the user know we over-rode their configuration.
  627|      1|            qWarning("Detected locale \"%s\" with character encoding \"%s\", which is not UTF-8.\n"
  628|      1|                     "Qt depends on a UTF-8 locale, and has switched to \"%s\" instead.\n"
  629|      1|                     "If this causes problems, reconfigure your locale. See the locale(1) manual\n"
  630|      1|                     "for more information.",
  631|      1|                     oldLocale.constData(), oldEncoding.data(), newLocale.constData());
  632|      1|        }
  633|      1|    }
  634|      1|#  endif // Platform choice
  635|      1|#endif // Unix
  636|      1|}
_ZN16QCoreApplicationC2ERiPPci:
  761|  1.93k|    : QObject(*new QCoreApplicationPrivate(argc, argv))
  762|       |#endif
  763|  1.93k|{
  764|  1.93k|    d_func()->q_ptr = this;
  765|  1.93k|    d_func()->init();
  766|  1.93k|#ifndef QT_NO_QOBJECT
  767|  1.93k|    QCoreApplicationPrivate::eventDispatcher->startingUp();
  768|  1.93k|#endif
  769|  1.93k|}
_ZN23QCoreApplicationPrivate4initEv:
  779|  1.93k|{
  780|  1.93k|    Q_TRACE_SCOPE(QCoreApplicationPrivate_init);
  781|       |
  782|       |#if defined(Q_OS_MACOS)
  783|       |    QMacAutoReleasePool pool;
  784|       |#endif
  785|       |
  786|  1.93k|    Q_Q(QCoreApplication);
  787|       |
  788|       |#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED)
  789|       |    initDebuggingConsole();
  790|       |#endif
  791|       |
  792|  1.93k|    initLocale();
  793|       |
  794|  1.93k|    Q_ASSERT_X(!QCoreApplication::self, "QCoreApplication", "there should be only one application object");
  795|  1.93k|#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
  796|  1.93k|    QCoreApplication::self = q;
  797|  1.93k|    g_self.storeRelaxed(q);
  798|       |#else
  799|       |    QCoreApplication::self.storeRelaxed(q);
  800|       |#endif
  801|       |
  802|  1.93k|#if QT_CONFIG(thread)
  803|       |#ifdef Q_OS_WASM
  804|       |    emscripten::val hardwareConcurrency = emscripten::val::global("navigator")["hardwareConcurrency"];
  805|       |    if (hardwareConcurrency.isUndefined())
  806|       |        QThreadPrivate::idealThreadCount = 2;
  807|       |    else
  808|       |        QThreadPrivate::idealThreadCount = hardwareConcurrency.as<int>();
  809|       |#endif
  810|  1.93k|#endif
  811|       |
  812|       |    // Store app name/version (so they're still available after QCoreApplication is destroyed)
  813|  1.93k|    if (!coreappdata()->applicationNameSet)
  ------------------
  |  Branch (813:9): [True: 1.93k, False: 0]
  ------------------
  814|  1.93k|        coreappdata()->application = appName();
  815|       |
  816|  1.93k|    if (!coreappdata()->applicationVersionSet)
  ------------------
  |  Branch (816:9): [True: 1.93k, False: 0]
  ------------------
  817|  1.93k|        coreappdata()->applicationVersion = appVersion();
  818|       |
  819|       |#if defined(Q_OS_ANDROID)
  820|       |    // We've deferred initializing the logging registry due to not being
  821|       |    // able to guarantee that logging happened on the same thread as the
  822|       |    // Qt main thread, but now that the Qt main thread is set up, we can
  823|       |    // enable categorized logging.
  824|       |    QLoggingRegistry::instance()->initializeRules();
  825|       |#endif
  826|       |
  827|  1.93k|#if QT_CONFIG(library)
  828|       |    // Reset the lib paths, so that they will be recomputed, taking the availability of argv[0]
  829|       |    // into account. If necessary, recompute right away and replay the manual changes on top of the
  830|       |    // new lib paths.
  831|  1.93k|    if (coreappdata->libPathsInitialized()) {
  ------------------
  |  Branch (831:9): [True: 0, False: 1.93k]
  ------------------
  832|      0|        const QStringList appPaths = std::move(coreappdata->app_libpaths);
  833|      0|        Q_ASSERT(!coreappdata->libPathsInitialized());
  834|       |
  835|      0|        if (coreappdata->libPathsManuallySet()) {
  ------------------
  |  Branch (835:13): [True: 0, False: 0]
  ------------------
  836|      0|            const QStringList manualPaths = std::move(coreappdata->manual_libpaths);
  837|      0|            Q_ASSERT(!coreappdata->libPathsManuallySet());
  838|       |
  839|       |            // Replay the delta. As paths can only be prepended to the front or removed from
  840|       |            // anywhere in the list, we can just linearly scan the lists and find the items that
  841|       |            // have been removed. Once the original list is exhausted we know all the remaining
  842|       |            // items have been added.
  843|      0|            QStringList newPaths(q->libraryPaths());
  844|      0|            for (qsizetype i = manualPaths.size(), j = appPaths.size(); i > 0 || j > 0; qt_noop()) {
  ------------------
  |  Branch (844:73): [True: 0, False: 0]
  |  Branch (844:82): [True: 0, False: 0]
  ------------------
  845|      0|                if (--j < 0) {
  ------------------
  |  Branch (845:21): [True: 0, False: 0]
  ------------------
  846|      0|                    newPaths.prepend(manualPaths[--i]);
  847|      0|                } else if (--i < 0) {
  ------------------
  |  Branch (847:28): [True: 0, False: 0]
  ------------------
  848|      0|                    newPaths.removeAll(appPaths[j]);
  849|      0|                } else if (manualPaths[i] != appPaths[j]) {
  ------------------
  |  Branch (849:28): [True: 0, False: 0]
  ------------------
  850|      0|                    newPaths.removeAll(appPaths[j]);
  851|      0|                    ++i; // try again with next item.
  852|      0|                }
  853|      0|            }
  854|      0|            coreappdata->manual_libpaths.swap(newPaths);
  855|      0|        }
  856|      0|    }
  857|  1.93k|#endif
  858|       |
  859|  1.93k|#ifndef QT_NO_QOBJECT
  860|       |    // use the event dispatcher created by the app programmer (if any)
  861|  1.93k|    Q_ASSERT(!eventDispatcher);
  862|  1.93k|    auto thisThreadData = threadData.loadRelaxed();
  863|  1.93k|    eventDispatcher = thisThreadData->eventDispatcher.loadRelaxed();
  864|       |
  865|       |    // otherwise we create one
  866|  1.93k|    if (!eventDispatcher)
  ------------------
  |  Branch (866:9): [True: 1.93k, False: 0]
  ------------------
  867|  1.93k|        createEventDispatcher();
  868|  1.93k|    Q_ASSERT(eventDispatcher);
  869|       |
  870|  1.93k|    if (!eventDispatcher->parent()) {
  ------------------
  |  Branch (870:9): [True: 0, False: 1.93k]
  ------------------
  871|      0|        eventDispatcher->moveToThread(thisThreadData->thread.loadAcquire());
  872|      0|        eventDispatcher->setParent(q);
  873|      0|    }
  874|       |
  875|  1.93k|    thisThreadData->eventDispatcher = eventDispatcher;
  876|  1.93k|    eventDispatcherReady();
  877|  1.93k|#endif
  878|       |
  879|  1.93k|    processCommandLineArguments();
  880|       |
  881|  1.93k|    qt_call_pre_routines();
  882|  1.93k|    qt_startup_hook();
  883|  1.93k|#ifndef QT_BOOTSTRAPPED
  884|  1.93k|    QtPrivate::initBindingStatusThreadId();
  885|  1.93k|    if (Q_UNLIKELY(qtHookData[QHooks::Startup]))
  886|      0|        reinterpret_cast<QHooks::StartupCallback>(qtHookData[QHooks::Startup])();
  887|  1.93k|#endif
  888|       |
  889|  1.93k|#ifndef QT_NO_QOBJECT
  890|  1.93k|    is_app_running = true; // No longer starting up.
  891|  1.93k|#endif
  892|  1.93k|}
_ZN16QCoreApplicationD2Ev:
  898|  1.93k|{
  899|  1.93k|    preRoutinesCalled = false;
  900|       |
  901|  1.93k|    qt_call_post_routines();
  902|       |
  903|  1.93k|#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
  904|  1.93k|    self = nullptr;
  905|  1.93k|    g_self.storeRelaxed(nullptr);
  906|       |#else
  907|       |    self.storeRelaxed(nullptr);
  908|       |#endif
  909|       |
  910|  1.93k|#ifndef QT_NO_QOBJECT
  911|  1.93k|    QCoreApplicationPrivate::is_app_closing = true;
  912|  1.93k|    QCoreApplicationPrivate::is_app_running = false;
  913|  1.93k|#endif
  914|       |
  915|  1.93k|#if QT_CONFIG(thread)
  916|       |    // Synchronize and stop the global thread pool threads.
  917|  1.93k|    QThreadPool *globalThreadPool = nullptr;
  918|  1.93k|    QT_TRY {
  919|  1.93k|        globalThreadPool = QThreadPool::globalInstance();
  920|  1.93k|    } QT_CATCH (...) {
  921|       |        // swallow the exception, since destructors shouldn't throw
  922|      0|    }
  923|  1.93k|    if (globalThreadPool) {
  ------------------
  |  Branch (923:9): [True: 0, False: 1.93k]
  ------------------
  924|      0|        globalThreadPool->waitForDone();
  925|      0|        delete globalThreadPool;
  926|      0|    }
  927|  1.93k|#endif
  928|       |
  929|  1.93k|#ifndef QT_NO_QOBJECT
  930|  1.93k|    d_func()->threadData.loadRelaxed()->eventDispatcher = nullptr;
  931|  1.93k|    if (QCoreApplicationPrivate::eventDispatcher)
  ------------------
  |  Branch (931:9): [True: 1.93k, False: 0]
  ------------------
  932|  1.93k|        QCoreApplicationPrivate::eventDispatcher->closingDown();
  933|  1.93k|    QCoreApplicationPrivate::eventDispatcher = nullptr;
  934|  1.93k|#endif
  935|       |
  936|  1.93k|#if QT_CONFIG(library)
  937|  1.93k|    if (coreappdata.exists()) {
  ------------------
  |  Branch (937:9): [True: 1.93k, False: 0]
  ------------------
  938|       |        // neither .clear(), .resize(), nor = {} will make isNull() == true
  939|  1.93k|        coreappdata->app_libpaths = QStringList();
  940|  1.93k|        coreappdata->manual_libpaths = QStringList();
  941|  1.93k|        Q_ASSERT(!coreappdata->libPathsManuallySet());
  942|  1.93k|        Q_ASSERT(!coreappdata->libPathsInitialized());
  943|  1.93k|    }
  944|  1.93k|#endif
  945|  1.93k|}
_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent:
 1085|  1.93k|{
 1086|       |    // Qt enforces the rule that events can only be sent to objects in
 1087|       |    // the current thread, so receiver->d_func()->threadData is
 1088|       |    // equivalent to QThreadData::current(), just without the function
 1089|       |    // call overhead.
 1090|  1.93k|    QObjectPrivate *d = receiver->d_func();
 1091|  1.93k|    QThreadData *threadData = d->threadData.loadAcquire();
 1092|  1.93k|    bool selfRequired = threadData->requiresCoreApplication;
 1093|  1.93k|    if (selfRequired && !qApp)
  ------------------
  |  |  146|  1.93k|#  define qApp g_self.loadRelaxed()
  ------------------
  |  Branch (1093:9): [True: 1.93k, False: 0]
  |  Branch (1093:25): [True: 0, False: 1.93k]
  ------------------
 1094|      0|        return false;
 1095|       |
 1096|       |    // Make it possible for Qt Script to hook into events even
 1097|       |    // though QApplication is subclassed...
 1098|  1.93k|    bool result = false;
 1099|  1.93k|    void *cbdata[] = { receiver, event, &result };
 1100|  1.93k|    if (QInternal::activateCallbacks(QInternal::EventNotifyCallback, cbdata)) {
  ------------------
  |  Branch (1100:9): [True: 0, False: 1.93k]
  ------------------
 1101|      0|        return result;
 1102|      0|    }
 1103|       |
 1104|  1.93k|    QScopedScopeLevelCounter scopeLevelCounter(threadData);
 1105|  1.93k|    if (!selfRequired)
  ------------------
  |  Branch (1105:9): [True: 0, False: 1.93k]
  ------------------
 1106|      0|        return doNotify(receiver, event);
 1107|       |
 1108|       |#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
 1109|       |    if (!QThread::isMainThread())
 1110|       |        return false;
 1111|       |#endif
 1112|  1.93k|    return qApp->notify(receiver, event);
  ------------------
  |  |  146|  1.93k|#  define qApp g_self.loadRelaxed()
  ------------------
 1113|  1.93k|}
_ZN16QCoreApplication6notifyEP7QObjectP6QEvent:
 1184|  1.93k|{
 1185|  1.93k|    Q_ASSERT(receiver);
 1186|  1.93k|    Q_ASSERT(event);
 1187|       |
 1188|       |#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0)
 1189|       |    Q_ASSERT(receiver->d_func()->threadData.loadAcquire()->thread.loadRelaxed()
 1190|       |             == QCoreApplicationPrivate::mainThread());
 1191|       |#endif
 1192|       |
 1193|       |    // no events are delivered after ~QCoreApplication() has started
 1194|  1.93k|    if (QCoreApplicationPrivate::is_app_closing)
  ------------------
  |  Branch (1194:9): [True: 0, False: 1.93k]
  ------------------
 1195|      0|        return true;
 1196|  1.93k|    return doNotify(receiver, event);
 1197|  1.93k|}
_ZN23QCoreApplicationPrivate34sendThroughApplicationEventFiltersEP7QObjectP6QEvent:
 1217|  1.93k|{
 1218|       |    // We can't access the application event filters outside of the main thread (race conditions)
 1219|  1.93k|    Q_ASSERT(QThread::isMainThread());
 1220|       |
 1221|  1.93k|    if (extraData) {
  ------------------
  |  Branch (1221:9): [True: 0, False: 1.93k]
  ------------------
 1222|       |        // application event filters are only called for objects in the GUI thread
 1223|      0|        for (qsizetype i = 0; i < extraData->eventFilters.size(); ++i) {
  ------------------
  |  Branch (1223:31): [True: 0, False: 0]
  ------------------
 1224|      0|            QObject *obj = extraData->eventFilters.at(i);
 1225|      0|            if (!obj)
  ------------------
  |  Branch (1225:17): [True: 0, False: 0]
  ------------------
 1226|      0|                continue;
 1227|      0|            if (obj->d_func()->threadData.loadRelaxed() != threadData.loadRelaxed()) {
  ------------------
  |  Branch (1227:17): [True: 0, False: 0]
  ------------------
 1228|      0|                qWarning("QCoreApplication: Application event filter cannot be in a different thread.");
 1229|      0|                continue;
 1230|      0|            }
 1231|      0|            if (obj->eventFilter(receiver, event))
  ------------------
  |  Branch (1231:17): [True: 0, False: 0]
  ------------------
 1232|      0|                return true;
 1233|      0|        }
 1234|      0|    }
 1235|  1.93k|    return false;
 1236|  1.93k|}
_ZN23QCoreApplicationPrivate29sendThroughObjectEventFiltersEP7QObjectP6QEvent:
 1239|  1.93k|{
 1240|  1.93k|    if (receiver != qApp && receiver->d_func()->extraData) {
  ------------------
  |  |  146|  3.86k|#  define qApp g_self.loadRelaxed()
  ------------------
  |  Branch (1240:9): [True: 0, False: 1.93k]
  |  Branch (1240:29): [True: 0, False: 0]
  ------------------
 1241|      0|        for (qsizetype i = 0; i < receiver->d_func()->extraData->eventFilters.size(); ++i) {
  ------------------
  |  Branch (1241:31): [True: 0, False: 0]
  ------------------
 1242|      0|            QObject *obj = receiver->d_func()->extraData->eventFilters.at(i);
 1243|      0|            if (!obj)
  ------------------
  |  Branch (1243:17): [True: 0, False: 0]
  ------------------
 1244|      0|                continue;
 1245|      0|            if (obj->d_func()->threadData.loadRelaxed() != receiver->d_func()->threadData.loadRelaxed()) {
  ------------------
  |  Branch (1245:17): [True: 0, False: 0]
  ------------------
 1246|      0|                qWarning("QCoreApplication: Object event filter cannot be in a different thread.");
 1247|      0|                continue;
 1248|      0|            }
 1249|      0|            if (obj->eventFilter(receiver, event))
  ------------------
  |  Branch (1249:17): [True: 0, False: 0]
  ------------------
 1250|      0|                return true;
 1251|      0|        }
 1252|      0|    }
 1253|  1.93k|    return false;
 1254|  1.93k|}
_ZN23QCoreApplicationPrivate13notify_helperEP7QObjectP6QEvent:
 1262|  1.93k|{
 1263|       |    // Note: when adjusting the tracepoints in here
 1264|       |    // consider adjusting QApplicationPrivate::notify_helper too.
 1265|  1.93k|    Q_TRACE(QCoreApplication_notify_entry, receiver, event, event->type());
 1266|  1.93k|    bool consumed = false;
 1267|  1.93k|    bool filtered = false;
 1268|  1.93k|    Q_TRACE_EXIT(QCoreApplication_notify_exit, consumed, filtered);
 1269|       |
 1270|       |    // send to all application event filters (only does anything in the main thread)
 1271|  1.93k|    if (QThread::isMainThread()
  ------------------
  |  Branch (1271:9): [True: 1.93k, False: 0]
  ------------------
 1272|  1.93k|            && QCoreApplication::self
  ------------------
  |  Branch (1272:16): [True: 1.93k, False: 0]
  ------------------
 1273|  1.93k|            && QCoreApplication::self->d_func()->sendThroughApplicationEventFilters(receiver, event)) {
  ------------------
  |  Branch (1273:16): [True: 0, False: 1.93k]
  ------------------
 1274|      0|        filtered = true;
 1275|      0|        return filtered;
 1276|      0|    }
 1277|       |    // send to all receiver event filters
 1278|  1.93k|    if (sendThroughObjectEventFilters(receiver, event)) {
  ------------------
  |  Branch (1278:9): [True: 0, False: 1.93k]
  ------------------
 1279|      0|        filtered = true;
 1280|      0|        return filtered;
 1281|      0|    }
 1282|       |
 1283|       |    // deliver the event
 1284|  1.93k|    consumed = receiver->event(event);
 1285|  1.93k|    return consumed;
 1286|  1.93k|}
_ZN16QCoreApplication11closingDownEv:
 1308|  1.93k|{
 1309|  1.93k|    return QCoreApplicationPrivate::is_app_closing;
 1310|  1.93k|}
_ZN16QCoreApplication9sendEventEP7QObjectP6QEvent:
 1545|  1.93k|{
 1546|  1.93k|    Q_ASSERT_X(receiver, "QCoreApplication::sendEvent", "Unexpected null receiver");
 1547|  1.93k|    Q_ASSERT_X(event, "QCoreApplication::sendEvent", "Unexpected null event");
 1548|       |
 1549|  1.93k|    Q_TRACE(QCoreApplication_sendEvent, receiver, event, event->type());
 1550|       |
 1551|  1.93k|    event->m_spont = false;
 1552|  1.93k|    return notifyInternal2(receiver, event);
 1553|  1.93k|}
_ZN16QCoreApplication16sendPostedEventsEP7QObjecti:
 1740|      1|{
 1741|       |    // ### TODO: consider splitting this method into a public and a private
 1742|       |    //           one, so that a user-invoked sendPostedEvents can be detected
 1743|       |    //           and handled properly.
 1744|      1|    QThreadData *data = QThreadData::current();
 1745|       |
 1746|      1|    QCoreApplicationPrivate::sendPostedEvents(receiver, event_type, data);
 1747|      1|}
_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData:
 1751|      1|{
 1752|      1|    if (event_type == -1) {
  ------------------
  |  Branch (1752:9): [True: 0, False: 1]
  ------------------
 1753|       |        // we were called by an obsolete event dispatcher.
 1754|      0|        event_type = 0;
 1755|      0|    }
 1756|       |
 1757|      1|    if (receiver && receiver->d_func()->threadData.loadRelaxed() != data) {
  ------------------
  |  Branch (1757:9): [True: 0, False: 1]
  |  Branch (1757:21): [True: 0, False: 0]
  ------------------
 1758|      0|        qWarning("QCoreApplication::sendPostedEvents: Cannot send "
 1759|      0|                 "posted events for objects in another thread");
 1760|      0|        return;
 1761|      0|    }
 1762|       |
 1763|      1|    ++data->postEventList.recursion;
 1764|       |
 1765|      1|    auto locker = qt_unique_lock(data->postEventList.mutex);
 1766|       |
 1767|       |    // by default, we assume that the event dispatcher can go to sleep after
 1768|       |    // processing all events. if any new events are posted while we send
 1769|       |    // events, canWait will be set to false.
 1770|      1|    data->canWait = (data->postEventList.size() == 0);
 1771|       |
 1772|      1|    if (data->postEventList.size() == 0
  ------------------
  |  Branch (1772:9): [True: 1, False: 0]
  ------------------
 1773|      1|            || (receiver && !receiver->d_func()->postedEvents.loadAcquire())) {
  ------------------
  |  Branch (1773:17): [True: 0, False: 0]
  |  Branch (1773:29): [True: 0, False: 0]
  ------------------
 1774|      1|        --data->postEventList.recursion;
 1775|      1|        return;
 1776|      1|    }
 1777|       |
 1778|      0|    data->canWait = true;
 1779|       |
 1780|       |    // okay. here is the tricky loop. be careful about optimizing
 1781|       |    // this, it looks the way it does for good reasons.
 1782|      0|    qsizetype startOffset = data->postEventList.startOffset;
 1783|      0|    qsizetype &i = (!event_type && !receiver) ? data->postEventList.startOffset : startOffset;
  ------------------
  |  Branch (1783:21): [True: 0, False: 0]
  |  Branch (1783:36): [True: 0, False: 0]
  ------------------
 1784|      0|    data->postEventList.insertionOffset = data->postEventList.size();
 1785|       |
 1786|       |    // Exception-safe cleaning up without the need for a try/catch block
 1787|      0|    struct CleanUp {
 1788|      0|        Q_DISABLE_COPY_MOVE(CleanUp)
 1789|       |
 1790|      0|        QObject *receiver;
 1791|      0|        int event_type;
 1792|      0|        QThreadData *data;
 1793|      0|        bool exceptionCaught;
 1794|       |
 1795|      0|        inline CleanUp(QObject *receiver, int event_type, QThreadData *data) :
 1796|      0|            receiver(receiver), event_type(event_type), data(data), exceptionCaught(true)
 1797|      0|        {}
 1798|      0|        inline ~CleanUp()
 1799|      0|        {
 1800|      0|            if (exceptionCaught) {
 1801|       |                // since we were interrupted, we need another pass to make sure we clean everything up
 1802|      0|                data->canWait = false;
 1803|      0|            }
 1804|       |
 1805|      0|            --data->postEventList.recursion;
 1806|      0|            if (!data->postEventList.recursion && !data->canWait && data->hasEventDispatcher())
 1807|      0|                data->eventDispatcher.loadRelaxed()->wakeUp();
 1808|       |
 1809|       |            // clear the global list, i.e. remove everything that was
 1810|       |            // delivered.
 1811|      0|            if (!event_type && !receiver && data->postEventList.startOffset >= 0) {
 1812|      0|                const QPostEventList::iterator it = data->postEventList.begin();
 1813|      0|                data->postEventList.erase(it, it + data->postEventList.startOffset);
 1814|      0|                data->postEventList.insertionOffset -= data->postEventList.startOffset;
 1815|      0|                Q_ASSERT(data->postEventList.insertionOffset >= 0);
 1816|      0|                data->postEventList.startOffset = 0;
 1817|      0|            }
 1818|      0|        }
 1819|      0|    };
 1820|      0|    CleanUp cleanup(receiver, event_type, data);
 1821|       |
 1822|      0|    while (i < data->postEventList.size()) {
  ------------------
  |  Branch (1822:12): [True: 0, False: 0]
  ------------------
 1823|       |        // avoid live-lock
 1824|      0|        if (i >= data->postEventList.insertionOffset)
  ------------------
  |  Branch (1824:13): [True: 0, False: 0]
  ------------------
 1825|      0|            break;
 1826|       |
 1827|      0|        const QPostEvent &pe = data->postEventList.at(i);
 1828|      0|        ++i;
 1829|       |
 1830|      0|        if (!pe.event)
  ------------------
  |  Branch (1830:13): [True: 0, False: 0]
  ------------------
 1831|      0|            continue;
 1832|      0|        if ((receiver && receiver != pe.receiver) || (event_type && event_type != pe.event->type())) {
  ------------------
  |  Branch (1832:14): [True: 0, False: 0]
  |  Branch (1832:26): [True: 0, False: 0]
  |  Branch (1832:55): [True: 0, False: 0]
  |  Branch (1832:69): [True: 0, False: 0]
  ------------------
 1833|      0|            data->canWait = false;
 1834|      0|            continue;
 1835|      0|        }
 1836|       |
 1837|      0|        if (pe.event->type() == QEvent::DeferredDelete) {
  ------------------
  |  Branch (1837:13): [True: 0, False: 0]
  ------------------
 1838|       |            // DeferredDelete events are sent either
 1839|       |            // 1) when the event loop that posted the event has returned; or
 1840|       |            // 2) if explicitly requested (with QEvent::DeferredDelete) for
 1841|       |            //    events posted by the current event loop; or
 1842|       |            // 3) if the event was posted before the outermost event loop.
 1843|       |
 1844|      0|            const int eventLoopLevel = static_cast<QDeferredDeleteEvent *>(pe.event)->loopLevel();
 1845|      0|            const int eventScopeLevel = static_cast<QDeferredDeleteEvent *>(pe.event)->scopeLevel();
 1846|       |
 1847|      0|            const bool postedBeforeOutermostLoop = eventLoopLevel == 0;
 1848|      0|            const bool allowDeferredDelete =
 1849|      0|                (eventLoopLevel + eventScopeLevel > data->loopLevel + data->scopeLevel
  ------------------
  |  Branch (1849:18): [True: 0, False: 0]
  ------------------
 1850|      0|                 || (postedBeforeOutermostLoop && data->loopLevel > 0)
  ------------------
  |  Branch (1850:22): [True: 0, False: 0]
  |  Branch (1850:51): [True: 0, False: 0]
  ------------------
 1851|      0|                 || (event_type == QEvent::DeferredDelete
  ------------------
  |  Branch (1851:22): [True: 0, False: 0]
  ------------------
 1852|      0|                     && eventLoopLevel + eventScopeLevel == data->loopLevel + data->scopeLevel));
  ------------------
  |  Branch (1852:25): [True: 0, False: 0]
  ------------------
 1853|      0|            if (!allowDeferredDelete) {
  ------------------
  |  Branch (1853:17): [True: 0, False: 0]
  ------------------
 1854|       |                // cannot send deferred delete
 1855|      0|                if (!event_type && !receiver) {
  ------------------
  |  Branch (1855:21): [True: 0, False: 0]
  |  Branch (1855:36): [True: 0, False: 0]
  ------------------
 1856|       |                    // we must copy it first; we want to re-post the event
 1857|       |                    // with the event pointer intact, but we can't delay
 1858|       |                    // nulling the event ptr until after re-posting, as
 1859|       |                    // addEvent may invalidate pe.
 1860|      0|                    QPostEvent pe_copy = pe;
 1861|       |
 1862|       |                    // null out the event so if sendPostedEvents recurses, it
 1863|       |                    // will ignore this one, as it's been re-posted.
 1864|      0|                    const_cast<QPostEvent &>(pe).event = nullptr;
 1865|       |
 1866|       |                    // re-post the copied event so it isn't lost
 1867|      0|                    data->postEventList.addEvent(pe_copy);
 1868|      0|                }
 1869|      0|                continue;
 1870|      0|            }
 1871|      0|        }
 1872|       |
 1873|       |        // first, we diddle the event so that we can deliver
 1874|       |        // it, and that no one will try to touch it later.
 1875|      0|        pe.event->m_posted = false;
 1876|      0|        QEvent *e = pe.event;
 1877|      0|        QObject * r = pe.receiver;
 1878|       |
 1879|      0|        r->d_func()->postedEvents.fetchAndSubAcquire(1);
 1880|      0|        Q_ASSERT(r->d_func()->postedEvents >= 0);
 1881|       |
 1882|       |        // next, update the data structure so that we're ready
 1883|       |        // for the next event.
 1884|      0|        const_cast<QPostEvent &>(pe).event = nullptr;
 1885|       |
 1886|      0|        locker.unlock();
 1887|      0|        const auto relocker = qScopeGuard([&locker] { locker.lock(); });
 1888|       |
 1889|      0|        const std::unique_ptr<QEvent> event_deleter(e); // will delete the event (with the mutex unlocked)
 1890|       |
 1891|       |        // after all that work, it's time to deliver the event.
 1892|      0|        QCoreApplication::sendEvent(r, e);
 1893|       |
 1894|       |        // careful when adding anything below this point - the
 1895|       |        // sendEvent() call might invalidate any invariants this
 1896|       |        // function depends on.
 1897|      0|    }
 1898|       |
 1899|      0|    cleanup.exceptionCaught = false;
 1900|      0|}
_ZN16QCoreApplication5eventEP6QEvent:
 2018|  1.93k|{
 2019|  1.93k|    if (e->type() == QEvent::Quit) {
  ------------------
  |  Branch (2019:9): [True: 0, False: 1.93k]
  ------------------
 2020|      0|        exit(0);
 2021|      0|        return true;
 2022|      0|    }
 2023|  1.93k|    return QObject::event(e);
 2024|  1.93k|}
_ZN16QCoreApplication9translateEPKcS1_S1_i:
 2298|      1|{
 2299|      1|    QString result;
 2300|       |
 2301|      1|    if (!sourceText)
  ------------------
  |  Branch (2301:9): [True: 0, False: 1]
  ------------------
 2302|      0|        return result;
 2303|       |
 2304|      1|    if (self) {
  ------------------
  |  Branch (2304:9): [True: 0, False: 1]
  ------------------
 2305|      0|        QCoreApplicationPrivate *d = self->d_func();
 2306|      0|        QReadLocker locker(&d->translateMutex);
 2307|      0|        if (!d->translators.isEmpty()) {
  ------------------
  |  Branch (2307:13): [True: 0, False: 0]
  ------------------
 2308|      0|            QList<QTranslator*>::ConstIterator it;
 2309|      0|            QTranslator *translationFile;
 2310|      0|            for (it = d->translators.constBegin(); it != d->translators.constEnd(); ++it) {
  ------------------
  |  Branch (2310:52): [True: 0, False: 0]
  ------------------
 2311|      0|                translationFile = *it;
 2312|      0|                result = translationFile->translate(context, sourceText, disambiguation, n);
 2313|      0|                if (!result.isNull())
  ------------------
  |  Branch (2313:21): [True: 0, False: 0]
  ------------------
 2314|      0|                    break;
 2315|      0|            }
 2316|      0|        }
 2317|      0|    }
 2318|       |
 2319|      1|    if (result.isNull())
  ------------------
  |  Branch (2319:9): [True: 1, False: 0]
  ------------------
 2320|      1|        result = QString::fromUtf8(sourceText);
 2321|       |
 2322|      1|    replacePercentN(&result, n);
 2323|      1|    return result;
 2324|      1|}
_ZNK20QCoreApplicationData19libPathsInitializedEv:
  387|  3.86k|    { return !app_libpaths.data_ptr().isNull(); }
_ZNK20QCoreApplicationData19libPathsManuallySetEv:
  389|  1.93k|    { return !manual_libpaths.data_ptr().isNull(); }
qcoreapplication.cpp:_ZL20qt_call_pre_routinesv:
  310|  1.93k|{
  311|       |    // After will be allowed invoke QtStartUpFunction when calling qAddPreRoutine
  312|  1.93k|    preRoutinesCalled = true;
  313|       |
  314|  1.93k|    if (!preRList.exists())
  ------------------
  |  Branch (314:9): [True: 1.93k, False: 0]
  ------------------
  315|  1.93k|        return;
  316|       |
  317|      0|    const QStartUpFuncList list = [] {
  318|      0|        const auto locker = qt_scoped_lock(globalRoutinesMutex);
  319|       |        // Unlike qt_call_post_routines, we don't empty the list, because
  320|       |        // Q_COREAPP_STARTUP_FUNCTION is a macro, so the user expects
  321|       |        // the function to be executed every time QCoreApplication is created.
  322|      0|        return *preRList;
  323|      0|    }();
  324|       |
  325|      0|    for (QtStartUpFunction f : list)
  ------------------
  |  Branch (325:30): [True: 0, False: 0]
  ------------------
  326|      0|        f();
  327|      0|}
qcoreapplication.cpp:_ZL8doNotifyP7QObjectP6QEvent:
 1200|  1.93k|{
 1201|  1.93k|    Q_ASSERT(event);
 1202|       |
 1203|       |    // ### Qt 7: turn into an assert
 1204|  1.93k|    if (receiver == nullptr) {                        // serious error
  ------------------
  |  Branch (1204:9): [True: 0, False: 1.93k]
  ------------------
 1205|      0|        qWarning("QCoreApplication::notify: Unexpected null receiver");
 1206|      0|        return true;
 1207|      0|    }
 1208|       |
 1209|  1.93k|#ifndef QT_NO_DEBUG
 1210|  1.93k|    QCoreApplicationPrivate::checkReceiverThread(receiver);
 1211|  1.93k|#endif
 1212|       |
 1213|  1.93k|    return receiver->isWidgetType() ? false : QCoreApplicationPrivate::notify_helper(receiver, event);
  ------------------
  |  Branch (1213:12): [True: 0, False: 1.93k]
  ------------------
 1214|  1.93k|}
qcoreapplication.cpp:_ZL15replacePercentNP7QStringi:
 2236|      1|{
 2237|      1|    if (n >= 0) {
  ------------------
  |  Branch (2237:9): [True: 0, False: 1]
  ------------------
 2238|      0|        qsizetype percentPos = 0;
 2239|      0|        qsizetype len = 0;
 2240|      0|        while ((percentPos = result->indexOf(u'%', percentPos + len)) != -1) {
  ------------------
  |  Branch (2240:16): [True: 0, False: 0]
  ------------------
 2241|      0|            len = 1;
 2242|      0|            if (percentPos + len == result->size())
  ------------------
  |  Branch (2242:17): [True: 0, False: 0]
  ------------------
 2243|      0|                break;
 2244|      0|            QString fmt;
 2245|      0|            if (result->at(percentPos + len) == u'L') {
  ------------------
  |  Branch (2245:17): [True: 0, False: 0]
  ------------------
 2246|      0|                ++len;
 2247|      0|                if (percentPos + len == result->size())
  ------------------
  |  Branch (2247:21): [True: 0, False: 0]
  ------------------
 2248|      0|                    break;
 2249|      0|                fmt = "%L1"_L1;
 2250|      0|            } else {
 2251|      0|                fmt = "%1"_L1;
 2252|      0|            }
 2253|      0|            if (result->at(percentPos + len) == u'n') {
  ------------------
  |  Branch (2253:17): [True: 0, False: 0]
  ------------------
 2254|      0|                fmt = fmt.arg(n);
 2255|      0|                ++len;
 2256|      0|                result->replace(percentPos, len, fmt);
 2257|      0|                len = fmt.size();
 2258|      0|            }
 2259|      0|        }
 2260|      0|    }
 2261|      1|}
_ZN20QCoreApplicationDataC2Ev:
  373|      1|    QCoreApplicationData() noexcept {
  374|      1|        applicationNameSet = false;
  375|      1|        applicationVersionSet = false;
  376|      1|    }

_ZN23QCoreApplicationPrivate24clearApplicationFilePathEv:
  142|  1.93k|    static inline void clearApplicationFilePath() { delete cachedApplicationFilePath; cachedApplicationFilePath = nullptr; }

_ZN6QEventC2ENS_4TypeE:
  278|  1.93k|    : t(type), m_reserved(0),
  279|  1.93k|      m_inputEvent(false), m_pointerEvent(false), m_singlePointEvent(false)
  280|  1.93k|{
  281|  1.93k|    Q_TRACE(QEvent_ctor, this, type);
  282|  1.93k|}
_ZN6QEventD2Ev:
  331|  1.93k|{
  332|  1.93k|    if (m_posted && QCoreApplication::instance())
  ------------------
  |  Branch (332:9): [True: 0, False: 1.93k]
  |  Branch (332:21): [True: 0, False: 0]
  ------------------
  333|      0|        QCoreApplicationPrivate::removePostedEvent(this);
  334|  1.93k|}
_ZN11QChildEventC2EN6QEvent4TypeEP7QObject:
  609|  1.93k|    : QEvent(type), c(child)
  610|  1.93k|{}

_ZNK6QEvent4typeEv:
  307|  3.86k|    inline Type type() const { return static_cast<Type>(t); }

_ZN14QDeadlineTimerC2ENS_15ForeverConstantEN2Qt9TimerTypeE:
   32|      6|        : t1((std::numeric_limits<qint64>::max)()), type(type_) {}

_ZN11QThreadPipeC2Ev:
   54|  1.93k|{
   55|  1.93k|}
_ZN11QThreadPipeD2Ev:
   58|  1.93k|{
   59|  1.93k|    if (fds[0] >= 0)
  ------------------
  |  Branch (59:9): [True: 1.93k, False: 0]
  ------------------
   60|  1.93k|        close(fds[0]);
   61|       |
   62|  1.93k|    if (!UsingEventfd && fds[1] >= 0)
  ------------------
  |  Branch (62:9): [Folded - Ignored]
  |  Branch (62:26): [True: 0, False: 0]
  ------------------
   63|      0|        close(fds[1]);
   64|       |
   65|       |#if defined(Q_OS_VXWORKS)
   66|       |    pipeDevDelete(name, true);
   67|       |#endif
   68|  1.93k|}
_ZN11QThreadPipe4initEv:
   88|  1.93k|{
   89|       |#if defined(Q_OS_WASM)
   90|       |    // do nothing.
   91|       |#elif defined(Q_OS_VXWORKS)
   92|       |    std::snprintf(name, sizeof(name), "/pipe/qt_%08x", int(taskIdSelf()));
   93|       |
   94|       |    // make sure there is no pipe with this name
   95|       |    pipeDevDelete(name, true);
   96|       |
   97|       |    // create the pipe
   98|       |    if (pipeDevCreate(name, 128 /*maxMsg*/, 1 /*maxLength*/) != OK) {
   99|       |        perror("QThreadPipe: Unable to create thread pipe device");
  100|       |        return false;
  101|       |    }
  102|       |
  103|       |    if ((fds[0] = open(name, O_RDWR, 0)) < 0) {
  104|       |        perror("QThreadPipe: Unable to open pipe device");
  105|       |        return false;
  106|       |    }
  107|       |
  108|       |    initThreadPipeFD(fds[0]);
  109|       |    fds[1] = fds[0];
  110|       |#else
  111|  1.93k|    int ret;
  112|  1.93k|#  ifdef EFD_CLOEXEC
  113|  1.93k|    ret = fds[0] = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
  114|  1.93k|#  endif
  115|  1.93k|    if (!UsingEventfd)
  ------------------
  |  Branch (115:9): [Folded - Ignored]
  ------------------
  116|      0|        ret = qt_safe_pipe(fds, O_NONBLOCK);
  117|  1.93k|    if (ret == -1) {
  ------------------
  |  Branch (117:9): [True: 0, False: 1.93k]
  ------------------
  118|      0|        perror("QThreadPipe: Unable to create pipe");
  119|      0|        return false;
  120|      0|    }
  121|  1.93k|#endif
  122|       |
  123|  1.93k|    return true;
  124|  1.93k|}
_ZN27QEventDispatcherUNIXPrivateC2Ev:
  176|  1.93k|{
  177|  1.93k|    if (Q_UNLIKELY(threadPipe.init() == false))
  178|      0|        qFatal("QEventDispatcherUNIXPrivate(): Cannot continue without a thread pipe");
  179|  1.93k|}
_ZN27QEventDispatcherUNIXPrivateD2Ev:
  182|  1.93k|{
  183|       |    // cleanup timers
  184|  1.93k|    timerList.clearTimers();
  185|  1.93k|}
_ZN20QEventDispatcherUNIXC2EP7QObject:
  262|  1.93k|    : QAbstractEventDispatcherV2(*new QEventDispatcherUNIXPrivate, parent)
  263|  1.93k|{ }
_ZN20QEventDispatcherUNIXD2Ev:
  270|  1.93k|{ }

_ZN18QMetaObjectPrivate12signalOffsetEPK11QMetaObject:
  156|      1|    {
  157|      1|        Q_ASSERT(m != nullptr);
  158|      1|        int offset = 0;
  159|      2|        for (m = m->d.superdata; m; m = m->d.superdata)
  ------------------
  |  Branch (159:34): [True: 1, False: 1]
  ------------------
  160|      1|            offset += reinterpret_cast<const QMetaObjectPrivate *>(m->d.data)->signalCount;
  161|      1|        return offset;
  162|      1|    }

_ZN11QObjectDataD2Ev:
  153|   190k|QObjectData::~QObjectData() {}
_ZN14QObjectPrivateC2E16QtPrivate_6_10_0:
  162|   190k|    : threadData(nullptr), currentChildBeingDeleted(nullptr)
  163|   190k|{
  164|       |    // QObjectData initialization
  165|   190k|    q_ptr = nullptr;
  166|   190k|    parent = nullptr;                           // no parent yet. It is set by setParent()
  167|   190k|    isWidget = false;                           // assume not a widget object
  168|   190k|    blockSig = false;                           // not blocking signals
  169|   190k|    wasDeleted = false;                         // double-delete catcher
  170|   190k|    isDeletingChildren = false;                 // set by deleteChildren()
  171|   190k|    sendChildEvents = true;                     // if we should send ChildAdded and ChildRemoved events to parent
  172|   190k|    receiveChildEvents = true;
  173|   190k|    postedEvents.storeRelaxed(0);
  174|   190k|    extraData = nullptr;
  175|   190k|    metaObject = nullptr;
  176|   190k|    isWindow = false;
  177|   190k|    deleteLaterCalled = false;
  178|   190k|    isQuickItem = false;
  179|   190k|    willBeWidget = false;
  180|   190k|    wasWidget = false;
  181|   190k|    receiveParentEvents = false;                // If object wants ParentAboutToChange and ParentChange
  182|   190k|}
_ZN14QObjectPrivateD2Ev:
  185|   190k|{
  186|   190k|    auto thisThreadData = threadData.loadRelaxed();
  187|   190k|    if (extraData && !extraData->runningTimers.isEmpty()) {
  ------------------
  |  Branch (187:9): [True: 1, False: 190k]
  |  Branch (187:22): [True: 0, False: 1]
  ------------------
  188|      0|        if (Q_LIKELY(thisThreadData->thread.loadAcquire() == QThread::currentThread())) {
  189|       |            // unregister pending timers
  190|      0|            if (thisThreadData->hasEventDispatcher())
  ------------------
  |  Branch (190:17): [True: 0, False: 0]
  ------------------
  191|      0|                thisThreadData->eventDispatcher.loadRelaxed()->unregisterTimers(q_ptr);
  192|       |
  193|       |            // release the timer ids back to the pool
  194|      0|            for (auto id : std::as_const(extraData->runningTimers))
  ------------------
  |  Branch (194:26): [True: 0, False: 0]
  ------------------
  195|      0|                QAbstractEventDispatcherPrivate::releaseTimerId(id);
  196|      0|        } else {
  197|      0|            qWarning("QObject::~QObject: Timers cannot be stopped from another thread");
  198|      0|        }
  199|      0|    }
  200|       |
  201|   190k|    if (postedEvents.loadRelaxed())
  ------------------
  |  Branch (201:9): [True: 0, False: 190k]
  ------------------
  202|      0|        QCoreApplication::removePostedEvents(q_ptr, 0);
  203|       |
  204|   190k|    thisThreadData->deref();
  205|       |
  206|   190k|    if (metaObject)
  ------------------
  |  Branch (206:9): [True: 0, False: 190k]
  ------------------
  207|      0|        metaObject->objectDestroyed(q_ptr);
  208|       |
  209|   190k|    delete extraData;
  210|   190k|}
_ZNK14QObjectPrivate17isSignalConnectedEjb:
  421|   190k|{
  422|   190k|    if (checkDeclarative && isDeclarativeSignalConnected(signalIndex))
  ------------------
  |  Branch (422:9): [True: 190k, False: 0]
  |  Branch (422:29): [True: 0, False: 190k]
  ------------------
  423|      0|        return true;
  424|       |
  425|   190k|    ConnectionData *cd = connections.loadAcquire();
  426|   190k|    if (!cd)
  ------------------
  |  Branch (426:9): [True: 190k, False: 0]
  ------------------
  427|   190k|        return false;
  428|      0|    SignalVector *signalVector = cd->signalVector.loadRelaxed();
  429|      0|    if (!signalVector)
  ------------------
  |  Branch (429:9): [True: 0, False: 0]
  ------------------
  430|      0|        return false;
  431|       |
  432|      0|    if (signalVector->at(-1).first.loadRelaxed())
  ------------------
  |  Branch (432:9): [True: 0, False: 0]
  ------------------
  433|      0|        return true;
  434|       |
  435|      0|    if (signalIndex < uint(cd->signalVectorCount())) {
  ------------------
  |  Branch (435:9): [True: 0, False: 0]
  ------------------
  436|      0|        const QObjectPrivate::Connection *c = signalVector->at(signalIndex).first.loadRelaxed();
  437|      0|        while (c) {
  ------------------
  |  Branch (437:16): [True: 0, False: 0]
  ------------------
  438|      0|            if (c->receiver.loadRelaxed())
  ------------------
  |  Branch (438:17): [True: 0, False: 0]
  ------------------
  439|      0|                return true;
  440|      0|            c = c->nextConnectionList.loadRelaxed();
  441|      0|        }
  442|      0|    }
  443|      0|    return false;
  444|      0|}
_ZNK14QObjectPrivate20maybeSignalConnectedEj:
  447|      1|{
  448|      1|    ConnectionData *cd = connections.loadAcquire();
  449|      1|    if (!cd)
  ------------------
  |  Branch (449:9): [True: 1, False: 0]
  ------------------
  450|      1|        return false;
  451|      0|    SignalVector *signalVector = cd->signalVector.loadRelaxed();
  452|      0|    if (!signalVector)
  ------------------
  |  Branch (452:9): [True: 0, False: 0]
  ------------------
  453|      0|        return false;
  454|       |
  455|      0|    if (signalVector->at(-1).first.loadAcquire())
  ------------------
  |  Branch (455:9): [True: 0, False: 0]
  ------------------
  456|      0|        return true;
  457|       |
  458|      0|    if (signalIndex < uint(cd->signalVectorCount())) {
  ------------------
  |  Branch (458:9): [True: 0, False: 0]
  ------------------
  459|      0|        const QObjectPrivate::Connection *c = signalVector->at(signalIndex).first.loadAcquire();
  460|      0|        return c != nullptr;
  461|      0|    }
  462|      0|    return false;
  463|      0|}
_ZN7QObjectC2EPS_:
  937|   186k|    : QObject(*new QObjectPrivate, parent)
  938|   186k|{
  939|   186k|}
_ZN7QObjectC2ER14QObjectPrivatePS_:
  945|   190k|    : d_ptr(&dd)
  946|   190k|{
  947|   190k|    Q_ASSERT_X(this != parent, Q_FUNC_INFO, "Cannot parent a QObject to itself");
  948|       |
  949|   190k|    Q_D(QObject);
  950|   190k|    d_ptr->q_ptr = this;
  951|   190k|    auto threadData = (parent && !parent->thread()) ? parent->d_func()->threadData.loadRelaxed() : QThreadData::current();
  ------------------
  |  Branch (951:24): [True: 0, False: 190k]
  |  Branch (951:34): [True: 0, False: 0]
  ------------------
  952|   190k|    threadData->ref();
  953|   190k|    d->threadData.storeRelaxed(threadData);
  954|   190k|    if (parent) {
  ------------------
  |  Branch (954:9): [True: 0, False: 190k]
  ------------------
  955|      0|        QT_TRY {
  956|      0|            if (!check_parent_thread(parent, parent ? parent->d_func()->threadData.loadRelaxed() : nullptr, threadData))
  ------------------
  |  Branch (956:17): [True: 0, False: 0]
  |  Branch (956:46): [True: 0, False: 0]
  ------------------
  957|      0|                parent = nullptr;
  958|      0|            if (d->willBeWidget) {
  ------------------
  |  Branch (958:17): [True: 0, False: 0]
  ------------------
  959|      0|                if (parent) {
  ------------------
  |  Branch (959:21): [True: 0, False: 0]
  ------------------
  960|      0|                    d->parent = parent;
  961|      0|                    d->parent->d_func()->children.append(this);
  962|      0|                }
  963|       |                // no events sent here, this is done at the end of the QWidget constructor
  964|      0|            } else {
  965|      0|                setParent(parent);
  966|      0|            }
  967|      0|        } QT_CATCH(...) {
  968|      0|            threadData->deref();
  969|      0|            QT_RETHROW;
  970|      0|        }
  971|      0|    }
  972|   190k|    if (Q_UNLIKELY(qtHookData[QHooks::AddQObject]))
  973|      0|        reinterpret_cast<QHooks::AddQObjectCallback>(qtHookData[QHooks::AddQObject])(this);
  974|   190k|    Q_TRACE(QObject_ctor, this);
  975|   190k|}
_ZN14QObjectPrivate19clearBindingStorageEv:
  978|   190k|{
  979|   190k|    bindingStorage.clear();
  980|   190k|}
_ZN7QObjectD2Ev:
 1007|   190k|{
 1008|   190k|    Q_D(QObject);
 1009|   190k|    d->wasDeleted = true;
 1010|   190k|    d->blockSig = 0; // unblock signals so we always emit destroyed()
 1011|       |
 1012|   190k|    if (!d->bindingStorage.isValid()) {
  ------------------
  |  Branch (1012:9): [True: 0, False: 190k]
  ------------------
 1013|       |        // this might be the case after an incomplete thread-move
 1014|       |        // remove this object from the pending list in that case
 1015|      0|        if (QThread *ownThread = thread()) {
  ------------------
  |  Branch (1015:22): [True: 0, False: 0]
  ------------------
 1016|      0|            auto *privThread = static_cast<QThreadPrivate *>(
 1017|      0|                        QObjectPrivate::get(ownThread));
 1018|      0|            privThread->removeObjectWithPendingBindingStatusChange(this);
 1019|      0|        }
 1020|      0|    }
 1021|       |
 1022|       |    // If we reached this point, we need to clear the binding data
 1023|       |    // as the corresponding properties are no longer useful
 1024|   190k|    d->clearBindingStorage();
 1025|       |
 1026|   190k|    QtSharedPointer::ExternalRefCountData *sharedRefcount = d->sharedRefcount.loadRelaxed();
 1027|   190k|    if (sharedRefcount) {
  ------------------
  |  Branch (1027:9): [True: 0, False: 190k]
  ------------------
 1028|      0|        if (sharedRefcount->strongref.loadRelaxed() > 0) {
  ------------------
  |  Branch (1028:13): [True: 0, False: 0]
  ------------------
 1029|      0|            qWarning("QObject: shared QObject was deleted directly. The program is malformed and may crash.");
 1030|       |            // but continue deleting, it's too late to stop anyway
 1031|      0|        }
 1032|       |
 1033|       |        // indicate to all QWeakPointers that this QObject has now been deleted
 1034|      0|        sharedRefcount->strongref.storeRelaxed(0);
 1035|      0|        if (!sharedRefcount->weakref.deref())
  ------------------
  |  Branch (1035:13): [True: 0, False: 0]
  ------------------
 1036|      0|            delete sharedRefcount;
 1037|      0|    }
 1038|       |
 1039|   190k|    if (!d->wasWidget && d->isSignalConnected(0)) {
  ------------------
  |  Branch (1039:9): [True: 190k, False: 0]
  |  Branch (1039:26): [True: 0, False: 190k]
  ------------------
 1040|      0|        emit destroyed(this);
 1041|      0|    }
 1042|       |
 1043|   190k|    if (!d->isDeletingChildren && d->declarativeData && QAbstractDeclarativeData::destroyed)
  ------------------
  |  Branch (1043:9): [True: 190k, False: 0]
  |  Branch (1043:35): [True: 0, False: 190k]
  |  Branch (1043:57): [True: 0, False: 0]
  ------------------
 1044|      0|        QAbstractDeclarativeData::destroyed(d->declarativeData, this);
 1045|       |
 1046|   190k|    QObjectPrivate::ConnectionData *cd = d->connections.loadAcquire();
 1047|   190k|    if (cd) {
  ------------------
  |  Branch (1047:9): [True: 0, False: 190k]
  ------------------
 1048|      0|        if (cd->currentSender) {
  ------------------
  |  Branch (1048:13): [True: 0, False: 0]
  ------------------
 1049|      0|            cd->currentSender->receiverDeleted();
 1050|      0|            cd->currentSender = nullptr;
 1051|      0|        }
 1052|       |
 1053|      0|        QBasicMutex *signalSlotMutex = signalSlotLock(this);
 1054|      0|        QMutexLocker locker(signalSlotMutex);
 1055|       |
 1056|       |        // disconnect all receivers
 1057|      0|        int receiverCount = cd->signalVectorCount();
 1058|      0|        for (int signal = -1; signal < receiverCount; ++signal) {
  ------------------
  |  Branch (1058:31): [True: 0, False: 0]
  ------------------
 1059|      0|            QObjectPrivate::ConnectionList &connectionList = cd->connectionsForSignal(signal);
 1060|       |
 1061|      0|            while (QObjectPrivate::Connection *c = connectionList.first.loadRelaxed()) {
  ------------------
  |  Branch (1061:48): [True: 0, False: 0]
  ------------------
 1062|      0|                Q_ASSERT(c->receiver.loadAcquire());
 1063|       |
 1064|      0|                QBasicMutex *m = signalSlotLock(c->receiver.loadRelaxed());
 1065|      0|                bool needToUnlock = QOrderedMutexLocker::relock(signalSlotMutex, m);
 1066|      0|                if (c == connectionList.first.loadAcquire() && c->receiver.loadAcquire()) {
  ------------------
  |  Branch (1066:21): [True: 0, False: 0]
  |  Branch (1066:64): [True: 0, False: 0]
  ------------------
 1067|      0|                    cd->removeConnection(c);
 1068|      0|                    Q_ASSERT(connectionList.first.loadRelaxed() != c);
 1069|      0|                }
 1070|      0|                if (needToUnlock)
  ------------------
  |  Branch (1070:21): [True: 0, False: 0]
  ------------------
 1071|      0|                    m->unlock();
 1072|      0|            }
 1073|      0|        }
 1074|       |
 1075|       |        /* Disconnect all senders:
 1076|       |         */
 1077|      0|        while (QObjectPrivate::Connection *node = cd->senders) {
  ------------------
  |  Branch (1077:44): [True: 0, False: 0]
  ------------------
 1078|      0|            Q_ASSERT(node->receiver.loadAcquire());
 1079|      0|            QObject *sender = node->sender;
 1080|       |            // Send disconnectNotify before removing the connection from sender's connection list.
 1081|       |            // This ensures any eventual destructor of sender will block on getting receiver's lock
 1082|       |            // and not finish until we release it.
 1083|      0|            sender->disconnectNotify(QMetaObjectPrivate::signal(sender->metaObject(), node->signal_index));
 1084|      0|            QBasicMutex *m = signalSlotLock(sender);
 1085|      0|            bool needToUnlock = QOrderedMutexLocker::relock(signalSlotMutex, m);
 1086|       |            //the node has maybe been removed while the mutex was unlocked in relock?
 1087|      0|            if (node != cd->senders) {
  ------------------
  |  Branch (1087:17): [True: 0, False: 0]
  ------------------
 1088|       |                // We hold the wrong mutex
 1089|      0|                Q_ASSERT(needToUnlock);
 1090|      0|                m->unlock();
 1091|      0|                continue;
 1092|      0|            }
 1093|       |
 1094|      0|            QObjectPrivate::ConnectionData *senderData = sender->d_func()->connections.loadRelaxed();
 1095|      0|            Q_ASSERT(senderData);
 1096|       |
 1097|      0|            QtPrivate::QSlotObjectBase *slotObj = nullptr;
 1098|      0|            if (node->isSlotObject) {
  ------------------
  |  Branch (1098:17): [True: 0, False: 0]
  ------------------
 1099|      0|                slotObj = node->slotObj;
 1100|      0|                node->isSlotObject = false;
 1101|      0|            }
 1102|       |
 1103|      0|            senderData->removeConnection(node);
 1104|       |            /*
 1105|       |              When we unlock, another thread has the chance to delete/modify sender data.
 1106|       |              Thus we need to call cleanOrphanedConnections before unlocking. We use the
 1107|       |              variant of the function which assumes that the lock is already held to avoid
 1108|       |              a deadlock.
 1109|       |              We need to hold m, the sender lock. Considering that we might execute arbitrary user
 1110|       |              code, we should already release the signalSlotMutex here – unless they are the same.
 1111|       |            */
 1112|      0|            const bool locksAreTheSame = signalSlotMutex == m;
 1113|      0|            if (!locksAreTheSame)
  ------------------
  |  Branch (1113:17): [True: 0, False: 0]
  ------------------
 1114|      0|                locker.unlock();
 1115|      0|            senderData->cleanOrphanedConnections(
 1116|      0|                        sender,
 1117|      0|                        QObjectPrivate::ConnectionData::AlreadyLockedAndTemporarilyReleasingLock
 1118|      0|                        );
 1119|      0|            if (needToUnlock)
  ------------------
  |  Branch (1119:17): [True: 0, False: 0]
  ------------------
 1120|      0|                m->unlock();
 1121|       |
 1122|      0|            if (locksAreTheSame) // otherwise already unlocked
  ------------------
  |  Branch (1122:17): [True: 0, False: 0]
  ------------------
 1123|      0|                locker.unlock();
 1124|      0|            if (slotObj)
  ------------------
  |  Branch (1124:17): [True: 0, False: 0]
  ------------------
 1125|      0|                slotObj->destroyIfLastRef();
 1126|      0|            locker.relock();
 1127|      0|        }
 1128|       |
 1129|       |        // invalidate all connections on the object and make sure
 1130|       |        // activate() will skip them
 1131|      0|        cd->currentConnectionId.storeRelaxed(0);
 1132|      0|    }
 1133|   190k|    if (cd && !cd->ref.deref())
  ------------------
  |  Branch (1133:9): [True: 0, False: 190k]
  |  Branch (1133:15): [True: 0, False: 0]
  ------------------
 1134|      0|        delete cd;
 1135|   190k|    d->connections.storeRelaxed(nullptr);
 1136|       |
 1137|   190k|    if (!d->children.isEmpty())
  ------------------
  |  Branch (1137:9): [True: 1.93k, False: 188k]
  ------------------
 1138|  1.93k|        d->deleteChildren();
 1139|       |
 1140|   190k|    if (Q_UNLIKELY(qtHookData[QHooks::RemoveQObject]))
 1141|      0|        reinterpret_cast<QHooks::RemoveQObjectCallback>(qtHookData[QHooks::RemoveQObject])(this);
 1142|       |
 1143|   190k|    Q_TRACE(QObject_dtor, this);
 1144|       |
 1145|   190k|    if (d->parent)        // remove it from parent object
  ------------------
  |  Branch (1145:9): [True: 1.93k, False: 188k]
  ------------------
 1146|  1.93k|        d->setParent_helper(nullptr);
 1147|   190k|}
_ZN14QObjectPrivate28setObjectNameWithoutBindingsERK7QString:
 1296|      1|{
 1297|      1|    ensureExtraData();
 1298|      1|    extraData->objectName.setValueBypassingBindings(name);
 1299|      1|}
_ZN7QObject5eventEP6QEvent:
 1401|  1.93k|{
 1402|  1.93k|    switch (e->type()) {
 1403|      0|    case QEvent::Timer:
  ------------------
  |  Branch (1403:5): [True: 0, False: 1.93k]
  ------------------
 1404|      0|        timerEvent((QTimerEvent *)e);
 1405|      0|        break;
 1406|       |
 1407|  1.93k|    case QEvent::ChildAdded:
  ------------------
  |  Branch (1407:5): [True: 1.93k, False: 0]
  ------------------
 1408|  1.93k|    case QEvent::ChildPolished:
  ------------------
  |  Branch (1408:5): [True: 0, False: 1.93k]
  ------------------
 1409|  1.93k|    case QEvent::ChildRemoved:
  ------------------
  |  Branch (1409:5): [True: 0, False: 1.93k]
  ------------------
 1410|  1.93k|        childEvent((QChildEvent *)e);
 1411|  1.93k|        break;
 1412|       |
 1413|      0|    case QEvent::DeferredDelete:
  ------------------
  |  Branch (1413:5): [True: 0, False: 1.93k]
  ------------------
 1414|      0|        delete this;
 1415|      0|        break;
 1416|       |
 1417|      0|    case QEvent::MetaCall:
  ------------------
  |  Branch (1417:5): [True: 0, False: 1.93k]
  ------------------
 1418|      0|        {
 1419|      0|            QAbstractMetaCallEvent *mce = static_cast<QAbstractMetaCallEvent*>(e);
 1420|       |
 1421|      0|            QObjectPrivate::ConnectionData *connections = d_func()->connections.loadAcquire();
 1422|      0|            if (!connections) {
  ------------------
  |  Branch (1422:17): [True: 0, False: 0]
  ------------------
 1423|      0|                QMutexLocker locker(signalSlotLock(this));
 1424|      0|                d_func()->ensureConnectionData();
 1425|      0|                connections = d_func()->connections.loadRelaxed();
 1426|      0|            }
 1427|      0|            QObjectPrivate::Sender sender(this, const_cast<QObject*>(mce->sender()), mce->signalId(), connections);
 1428|       |
 1429|      0|            mce->placeMetaCall(this);
 1430|      0|            break;
 1431|  1.93k|        }
 1432|       |
 1433|      0|    case QEvent::ThreadChange: {
  ------------------
  |  Branch (1433:5): [True: 0, False: 1.93k]
  ------------------
 1434|      0|        Q_D(QObject);
 1435|      0|        QThreadData *threadData = d->threadData.loadRelaxed();
 1436|      0|        QAbstractEventDispatcher *eventDispatcher = threadData->eventDispatcher.loadRelaxed();
 1437|      0|        if (eventDispatcher) {
  ------------------
  |  Branch (1437:13): [True: 0, False: 0]
  ------------------
 1438|      0|            QList<QAbstractEventDispatcher::TimerInfoV2> timers = eventDispatcher->timersForObject(this);
 1439|      0|            if (!timers.isEmpty()) {
  ------------------
  |  Branch (1439:17): [True: 0, False: 0]
  ------------------
 1440|      0|                const bool res = eventDispatcher->unregisterTimers(this);
 1441|       |                // do not to release our timer ids back to the pool (since the timer ids are moving to a new thread).
 1442|      0|                Q_ASSERT_X(res, Q_FUNC_INFO,
 1443|      0|                           "QAbstractEventDispatcher::unregisterTimers() returned false,"
 1444|      0|                           " but there are timers associated with this object.");
 1445|      0|                auto reRegisterTimers = [this, timers = std::move(timers)]() {
 1446|      0|                    QAbstractEventDispatcher *eventDispatcher =
 1447|      0|                            d_func()->threadData.loadRelaxed()->eventDispatcher.loadRelaxed();
 1448|      0|                    for (const auto &ti : timers)
 1449|      0|                        eventDispatcher->registerTimer(ti.timerId, ti.interval, ti.timerType, this);
 1450|      0|                };
 1451|      0|                QMetaObject::invokeMethod(this, std::move(reRegisterTimers), Qt::QueuedConnection);
 1452|      0|            }
 1453|      0|        }
 1454|      0|        break;
 1455|  1.93k|    }
 1456|       |
 1457|      0|    default:
  ------------------
  |  Branch (1457:5): [True: 0, False: 1.93k]
  ------------------
 1458|      0|        if (e->type() >= QEvent::User) {
  ------------------
  |  Branch (1458:13): [True: 0, False: 0]
  ------------------
 1459|      0|            customEvent(e);
 1460|      0|            break;
 1461|      0|        }
 1462|      0|        return false;
 1463|  1.93k|    }
 1464|  1.93k|    return true;
 1465|  1.93k|}
_ZN7QObject10childEventEP11QChildEvent:
 1519|  1.93k|{
 1520|  1.93k|}
_ZNK7QObject6threadEv:
 1609|  1.93k|{
 1610|  1.93k|    return d_func()->threadData.loadRelaxed()->thread.loadAcquire();
 1611|  1.93k|}
_ZN7QObject9setParentEPS_:
 2205|  1.93k|{
 2206|  1.93k|    Q_D(QObject);
 2207|  1.93k|    Q_ASSERT(!d->isWidget);
 2208|  1.93k|    d->setParent_helper(parent);
 2209|  1.93k|}
_ZN14QObjectPrivate14deleteChildrenEv:
 2212|  1.93k|{
 2213|  1.93k|    Q_ASSERT_X(!isDeletingChildren, "QObjectPrivate::deleteChildren()", "isDeletingChildren already set, did this function recurse?");
 2214|  1.93k|    isDeletingChildren = true;
 2215|       |    // delete children objects
 2216|       |    // don't use qDeleteAll as the destructor of the child might
 2217|       |    // delete siblings
 2218|  3.86k|    for (int i = 0; i < children.size(); ++i) {
  ------------------
  |  Branch (2218:21): [True: 1.93k, False: 1.93k]
  ------------------
 2219|  1.93k|        currentChildBeingDeleted = children.at(i);
 2220|  1.93k|        children[i] = nullptr;
 2221|  1.93k|        delete currentChildBeingDeleted;
 2222|  1.93k|    }
 2223|  1.93k|    children.clear();
 2224|  1.93k|    currentChildBeingDeleted = nullptr;
 2225|  1.93k|    isDeletingChildren = false;
 2226|  1.93k|}
_ZN14QObjectPrivate16setParent_helperEP7QObject:
 2229|  3.86k|{
 2230|  3.86k|    Q_Q(QObject);
 2231|  3.86k|    Q_ASSERT_X(q != o, Q_FUNC_INFO, "Cannot parent a QObject to itself");
 2232|  3.86k|#ifdef QT_DEBUG
 2233|  3.86k|    const auto checkForParentChildLoops = qScopeGuard([&](){
 2234|  3.86k|        int depth = 0;
 2235|  3.86k|        auto p = parent;
 2236|  3.86k|        while (p) {
 2237|  3.86k|            if (++depth == CheckForParentChildLoopsWarnDepth) {
 2238|  3.86k|                qWarning("QObject %p (class: '%s', object name: '%s') may have a loop in its parent-child chain; "
 2239|  3.86k|                         "this is undefined behavior",
 2240|  3.86k|                         q, q->metaObject()->className(), qPrintable(q->objectName()));
 2241|  3.86k|            }
 2242|  3.86k|            p = p->parent();
 2243|  3.86k|        }
 2244|  3.86k|    });
 2245|  3.86k|#endif
 2246|       |
 2247|  3.86k|    if (o == parent)
  ------------------
  |  Branch (2247:9): [True: 0, False: 3.86k]
  ------------------
 2248|      0|        return;
 2249|       |
 2250|  3.86k|    if (parent) {
  ------------------
  |  Branch (2250:9): [True: 1.93k, False: 1.93k]
  ------------------
 2251|  1.93k|        QObjectPrivate *parentD = parent->d_func();
 2252|  1.93k|        if (parentD->isDeletingChildren && wasDeleted
  ------------------
  |  Branch (2252:13): [True: 1.93k, False: 0]
  |  Branch (2252:44): [True: 1.93k, False: 0]
  ------------------
 2253|  1.93k|            && parentD->currentChildBeingDeleted == q) {
  ------------------
  |  Branch (2253:16): [True: 1.93k, False: 0]
  ------------------
 2254|       |            // don't do anything since QObjectPrivate::deleteChildren() already
 2255|       |            // cleared our entry in parentD->children.
 2256|  1.93k|        } else {
 2257|      0|            const int index = parentD->children.indexOf(q);
 2258|      0|            if (index < 0) {
  ------------------
  |  Branch (2258:17): [True: 0, False: 0]
  ------------------
 2259|       |                // we're probably recursing into setParent() from a ChildRemoved event, don't do anything
 2260|      0|            } else if (parentD->isDeletingChildren) {
  ------------------
  |  Branch (2260:24): [True: 0, False: 0]
  ------------------
 2261|      0|                parentD->children[index] = nullptr;
 2262|      0|            } else {
 2263|      0|                parentD->children.removeAt(index);
 2264|      0|                if (sendChildEvents && parentD->receiveChildEvents) {
  ------------------
  |  Branch (2264:21): [True: 0, False: 0]
  |  Branch (2264:40): [True: 0, False: 0]
  ------------------
 2265|      0|                    QChildEvent e(QEvent::ChildRemoved, q);
 2266|      0|                    QCoreApplication::sendEvent(parent, &e);
 2267|      0|                }
 2268|      0|            }
 2269|      0|        }
 2270|  1.93k|    }
 2271|       |
 2272|  3.86k|    if (receiveParentEvents) {
  ------------------
  |  Branch (2272:9): [True: 0, False: 3.86k]
  ------------------
 2273|      0|        Q_ASSERT(!isWidget); // Handled in QWidget
 2274|      0|        QEvent e(QEvent::ParentAboutToChange);
 2275|      0|        QCoreApplication::sendEvent(q, &e);
 2276|      0|    }
 2277|       |
 2278|  3.86k|    parent = o;
 2279|       |
 2280|  3.86k|    if (parent) {
  ------------------
  |  Branch (2280:9): [True: 1.93k, False: 1.93k]
  ------------------
 2281|       |        // object hierarchies are constrained to a single thread
 2282|  1.93k|        if (threadData.loadRelaxed() != parent->d_func()->threadData.loadRelaxed()) {
  ------------------
  |  Branch (2282:13): [True: 0, False: 1.93k]
  ------------------
 2283|      0|            qWarning("QObject::setParent: Cannot set parent, new parent is in a different thread");
 2284|      0|            parent = nullptr;
 2285|      0|            return;
 2286|      0|        }
 2287|  1.93k|        parent->d_func()->children.append(q);
 2288|  1.93k|        if (sendChildEvents && parent->d_func()->receiveChildEvents) {
  ------------------
  |  Branch (2288:13): [True: 1.93k, False: 0]
  |  Branch (2288:32): [True: 1.93k, False: 0]
  ------------------
 2289|  1.93k|            if (!isWidget) {
  ------------------
  |  Branch (2289:17): [True: 1.93k, False: 0]
  ------------------
 2290|  1.93k|                QChildEvent e(QEvent::ChildAdded, q);
 2291|  1.93k|                QCoreApplication::sendEvent(parent, &e);
 2292|  1.93k|            }
 2293|  1.93k|        }
 2294|  1.93k|    }
 2295|       |
 2296|  3.86k|    if (receiveParentEvents) {
  ------------------
  |  Branch (2296:9): [True: 0, False: 3.86k]
  ------------------
 2297|      0|        Q_ASSERT(!isWidget); // Handled in QWidget
 2298|      0|        QEvent e(QEvent::ParentChange);
 2299|      0|        QCoreApplication::sendEvent(q, &e);
 2300|      0|    }
 2301|  3.86k|}
_ZN11QMetaObject8activateEP7QObjectPKS_iPPv:
 4182|      1|{
 4183|      1|    int signal_index = local_signal_index + QMetaObjectPrivate::signalOffset(m);
 4184|       |
 4185|      1|    if (Q_UNLIKELY(qt_signal_spy_callback_set.loadRelaxed()))
 4186|      0|        doActivate<true>(sender, signal_index, argv);
 4187|      1|    else
 4188|      1|        doActivate<false>(sender, signal_index, argv);
 4189|      1|}
qobject.cpp:_ZZN14QObjectPrivate16setParent_helperEP7QObjectENK3$_0clEv:
 2233|  3.86k|    const auto checkForParentChildLoops = qScopeGuard([&](){
 2234|  3.86k|        int depth = 0;
 2235|  3.86k|        auto p = parent;
 2236|  5.79k|        while (p) {
  ------------------
  |  Branch (2236:16): [True: 1.93k, False: 3.86k]
  ------------------
 2237|  1.93k|            if (++depth == CheckForParentChildLoopsWarnDepth) {
  ------------------
  |  Branch (2237:17): [True: 0, False: 1.93k]
  ------------------
 2238|      0|                qWarning("QObject %p (class: '%s', object name: '%s') may have a loop in its parent-child chain; "
 2239|      0|                         "this is undefined behavior",
 2240|      0|                         q, q->metaObject()->className(), qPrintable(q->objectName()));
 2241|      0|            }
 2242|  1.93k|            p = p->parent();
 2243|  1.93k|        }
 2244|  3.86k|    });
_Z10doActivateILb0EEvP7QObjectiPPv:
 4007|      1|{
 4008|      1|    QObjectPrivate *sp = QObjectPrivate::get(sender);
 4009|       |
 4010|      1|    if (sp->blockSig)
  ------------------
  |  Branch (4010:9): [True: 0, False: 1]
  ------------------
 4011|      0|        return;
 4012|       |
 4013|      1|    Q_TRACE_SCOPE(QMetaObject_activate, sender, signal_index);
 4014|       |
 4015|      1|    if (sp->isDeclarativeSignalConnected(signal_index)
  ------------------
  |  Branch (4015:9): [True: 0, False: 1]
  ------------------
 4016|      1|            && QAbstractDeclarativeData::signalEmitted) {
  ------------------
  |  Branch (4016:16): [True: 0, False: 0]
  ------------------
 4017|      0|        Q_TRACE_SCOPE(QMetaObject_activate_declarative_signal, sender, signal_index);
 4018|      0|        QAbstractDeclarativeData::signalEmitted(sp->declarativeData, sender,
 4019|      0|                                                signal_index, argv);
 4020|      0|    }
 4021|       |
 4022|      1|    const QSignalSpyCallbackSet *signal_spy_set = callbacks_enabled ? qt_signal_spy_callback_set.loadAcquire() : nullptr;
  ------------------
  |  Branch (4022:51): [Folded - Ignored]
  ------------------
 4023|       |
 4024|      1|    void *empty_argv[] = { nullptr };
 4025|      1|    if (!argv)
  ------------------
  |  Branch (4025:9): [True: 0, False: 1]
  ------------------
 4026|      0|        argv = empty_argv;
 4027|       |
 4028|      1|    if (!sp->maybeSignalConnected(signal_index)) {
  ------------------
  |  Branch (4028:9): [True: 1, False: 0]
  ------------------
 4029|       |        // The possible declarative connection is done, and nothing else is connected
 4030|      1|        if (callbacks_enabled && signal_spy_set->signal_begin_callback != nullptr)
  ------------------
  |  Branch (4030:13): [Folded - Ignored]
  |  Branch (4030:34): [True: 0, False: 0]
  ------------------
 4031|      0|            signal_spy_set->signal_begin_callback(sender, signal_index, argv);
 4032|      1|        if (callbacks_enabled && signal_spy_set->signal_end_callback != nullptr)
  ------------------
  |  Branch (4032:13): [Folded - Ignored]
  |  Branch (4032:34): [True: 0, False: 0]
  ------------------
 4033|      0|            signal_spy_set->signal_end_callback(sender, signal_index);
 4034|      1|        return;
 4035|      1|    }
 4036|       |
 4037|      0|    if (callbacks_enabled && signal_spy_set->signal_begin_callback != nullptr)
  ------------------
  |  Branch (4037:9): [Folded - Ignored]
  |  Branch (4037:30): [True: 0, False: 0]
  ------------------
 4038|      0|        signal_spy_set->signal_begin_callback(sender, signal_index, argv);
 4039|       |
 4040|      0|    bool senderDeleted = false;
 4041|      0|    {
 4042|      0|    Q_ASSERT(sp->connections.loadRelaxed());
 4043|      0|    QObjectPrivate::ConnectionDataPointer connections(sp->connections.loadAcquire());
 4044|      0|    QObjectPrivate::SignalVector *signalVector = connections->signalVector.loadRelaxed();
 4045|       |
 4046|      0|    const QObjectPrivate::ConnectionList *list;
 4047|      0|    if (signal_index < signalVector->count())
  ------------------
  |  Branch (4047:9): [True: 0, False: 0]
  ------------------
 4048|      0|        list = &signalVector->at(signal_index);
 4049|      0|    else
 4050|      0|        list = &signalVector->at(-1);
 4051|       |
 4052|      0|    Qt::HANDLE currentThreadId = QThread::currentThreadId();
 4053|      0|    bool inSenderThread = currentThreadId == QObjectPrivate::get(sender)->threadData.loadRelaxed()->threadId.loadRelaxed();
 4054|       |
 4055|       |    // We need to check against the highest connection id to ensure that signals added
 4056|       |    // during the signal emission are not emitted in this emission.
 4057|      0|    uint highestConnectionId = connections->currentConnectionId.loadRelaxed();
 4058|      0|    do {
 4059|      0|        QObjectPrivate::Connection *c = list->first.loadRelaxed();
 4060|      0|        if (!c)
  ------------------
  |  Branch (4060:13): [True: 0, False: 0]
  ------------------
 4061|      0|            continue;
 4062|       |
 4063|      0|        do {
 4064|      0|            QObject * const receiver = c->receiver.loadRelaxed();
 4065|      0|            if (!receiver)
  ------------------
  |  Branch (4065:17): [True: 0, False: 0]
  ------------------
 4066|      0|                continue;
 4067|       |
 4068|      0|            QThreadData *td = c->receiverThreadData.loadRelaxed();
 4069|      0|            if (!td)
  ------------------
  |  Branch (4069:17): [True: 0, False: 0]
  ------------------
 4070|      0|                continue;
 4071|       |
 4072|      0|            bool receiverInSameThread;
 4073|      0|            if (inSenderThread) {
  ------------------
  |  Branch (4073:17): [True: 0, False: 0]
  ------------------
 4074|      0|                receiverInSameThread = currentThreadId == td->threadId.loadRelaxed();
 4075|      0|            } else {
 4076|       |                // need to lock before reading the threadId, because moveToThread() could interfere
 4077|      0|                QMutexLocker lock(signalSlotLock(receiver));
 4078|      0|                receiverInSameThread = currentThreadId == td->threadId.loadRelaxed();
 4079|      0|            }
 4080|       |
 4081|       |
 4082|       |            // determine if this connection should be sent immediately or
 4083|       |            // put into the event queue
 4084|      0|            if ((c->connectionType == Qt::AutoConnection && !receiverInSameThread)
  ------------------
  |  Branch (4084:18): [True: 0, False: 0]
  |  Branch (4084:61): [True: 0, False: 0]
  ------------------
 4085|      0|                || (c->connectionType == Qt::QueuedConnection)) {
  ------------------
  |  Branch (4085:20): [True: 0, False: 0]
  ------------------
 4086|      0|                queued_activate(sender, signal_index, c, argv);
 4087|      0|                continue;
 4088|      0|#if QT_CONFIG(thread)
 4089|      0|            } else if (c->connectionType == Qt::BlockingQueuedConnection) {
  ------------------
  |  Branch (4089:24): [True: 0, False: 0]
  ------------------
 4090|      0|                if (receiverInSameThread) {
  ------------------
  |  Branch (4090:21): [True: 0, False: 0]
  ------------------
 4091|      0|                    qWarning("Qt: Dead lock detected while activating a BlockingQueuedConnection: "
 4092|      0|                    "Sender is %s(%p), receiver is %s(%p)",
 4093|      0|                    sender->metaObject()->className(), sender,
 4094|      0|                    receiver->metaObject()->className(), receiver);
 4095|      0|                }
 4096|       |
 4097|      0|                if (c->isSingleShot && !QObjectPrivate::removeConnection(c))
  ------------------
  |  Branch (4097:21): [True: 0, False: 0]
  |  Branch (4097:40): [True: 0, False: 0]
  ------------------
 4098|      0|                    continue;
 4099|       |
 4100|      0|                QSemaphore semaphore;
 4101|      0|                {
 4102|      0|                    QMutexLocker locker(signalSlotLock(receiver));
 4103|      0|                    if (!c->isSingleShot && !c->receiver.loadAcquire())
  ------------------
  |  Branch (4103:25): [True: 0, False: 0]
  |  Branch (4103:45): [True: 0, False: 0]
  ------------------
 4104|      0|                        continue;
 4105|      0|                    QMetaCallEvent *ev = c->isSlotObject ?
  ------------------
  |  Branch (4105:42): [True: 0, False: 0]
  ------------------
 4106|      0|                        new QMetaCallEvent(c->slotObj, sender, signal_index, argv, &semaphore) :
 4107|      0|                        new QMetaCallEvent(c->method_offset, c->method_relative, c->callFunction,
 4108|      0|                                           sender, signal_index, argv, &semaphore);
 4109|      0|                    QCoreApplication::postEvent(receiver, ev);
 4110|      0|                }
 4111|      0|                semaphore.acquire();
 4112|      0|                continue;
 4113|      0|#endif
 4114|      0|            }
 4115|       |
 4116|      0|            if (c->isSingleShot && !QObjectPrivate::removeConnection(c))
  ------------------
  |  Branch (4116:17): [True: 0, False: 0]
  |  Branch (4116:36): [True: 0, False: 0]
  ------------------
 4117|      0|                continue;
 4118|       |
 4119|      0|            QObjectPrivate::Sender senderData(
 4120|      0|                    receiverInSameThread ? receiver : nullptr, sender, signal_index,
  ------------------
  |  Branch (4120:21): [True: 0, False: 0]
  ------------------
 4121|      0|                    receiverInSameThread ? QObjectPrivate::get(receiver)->connections.loadAcquire() : nullptr);
  ------------------
  |  Branch (4121:21): [True: 0, False: 0]
  ------------------
 4122|       |
 4123|      0|            if (c->isSlotObject) {
  ------------------
  |  Branch (4123:17): [True: 0, False: 0]
  ------------------
 4124|      0|                SlotObjectGuard obj{c->slotObj};
 4125|       |
 4126|      0|                {
 4127|      0|                    Q_TRACE_SCOPE(QMetaObject_activate_slot_functor, c->slotObj);
 4128|      0|                    obj->call(receiver, argv);
 4129|      0|                }
 4130|      0|            } else if (c->callFunction && c->method_offset <= receiver->metaObject()->methodOffset()) {
  ------------------
  |  Branch (4130:24): [True: 0, False: 0]
  |  Branch (4130:43): [True: 0, False: 0]
  ------------------
 4131|       |                //we compare the vtable to make sure we are not in the destructor of the object.
 4132|      0|                const int method_relative = c->method_relative;
 4133|      0|                const auto callFunction = c->callFunction;
 4134|      0|                const int methodIndex = (Q_HAS_TRACEPOINTS || callbacks_enabled) ? c->method() : 0;
  ------------------
  |  |  143|      0|#  define Q_HAS_TRACEPOINTS 0
  |  |  ------------------
  |  |  |  Branch (143:29): [Folded - Ignored]
  |  |  ------------------
  ------------------
  |  Branch (4134:63): [Folded - Ignored]
  ------------------
 4135|      0|                if (callbacks_enabled && signal_spy_set->slot_begin_callback != nullptr)
  ------------------
  |  Branch (4135:21): [Folded - Ignored]
  |  Branch (4135:42): [True: 0, False: 0]
  ------------------
 4136|      0|                    signal_spy_set->slot_begin_callback(receiver, methodIndex, argv);
 4137|       |
 4138|      0|                {
 4139|      0|                    Q_TRACE_SCOPE(QMetaObject_activate_slot, receiver, methodIndex);
 4140|      0|                    callFunction(receiver, QMetaObject::InvokeMetaMethod, method_relative, argv);
 4141|      0|                }
 4142|       |
 4143|      0|                if (callbacks_enabled && signal_spy_set->slot_end_callback != nullptr)
  ------------------
  |  Branch (4143:21): [Folded - Ignored]
  |  Branch (4143:42): [True: 0, False: 0]
  ------------------
 4144|      0|                    signal_spy_set->slot_end_callback(receiver, methodIndex);
 4145|      0|            } else {
 4146|      0|                const int method = c->method_relative + c->method_offset;
 4147|       |
 4148|      0|                if (callbacks_enabled && signal_spy_set->slot_begin_callback != nullptr) {
  ------------------
  |  Branch (4148:21): [Folded - Ignored]
  |  Branch (4148:42): [True: 0, False: 0]
  ------------------
 4149|      0|                    signal_spy_set->slot_begin_callback(receiver, method, argv);
 4150|      0|                }
 4151|       |
 4152|      0|                {
 4153|      0|                    Q_TRACE_SCOPE(QMetaObject_activate_slot, receiver, method);
 4154|      0|                    QMetaObject::metacall(receiver, QMetaObject::InvokeMetaMethod, method, argv);
 4155|      0|                }
 4156|       |
 4157|      0|                if (callbacks_enabled && signal_spy_set->slot_end_callback != nullptr)
  ------------------
  |  Branch (4157:21): [Folded - Ignored]
  |  Branch (4157:42): [True: 0, False: 0]
  ------------------
 4158|      0|                    signal_spy_set->slot_end_callback(receiver, method);
 4159|      0|            }
 4160|      0|        } while ((c = c->nextConnectionList.loadRelaxed()) != nullptr && c->id <= highestConnectionId);
  ------------------
  |  Branch (4160:18): [True: 0, False: 0]
  |  Branch (4160:74): [True: 0, False: 0]
  ------------------
 4161|       |
 4162|      0|    } while (list != &signalVector->at(-1) &&
  ------------------
  |  Branch (4162:14): [True: 0, False: 0]
  ------------------
 4163|       |        //start over for all signals;
 4164|      0|        ((list = &signalVector->at(-1)), true));
  ------------------
  |  Branch (4164:9): [True: 0, False: 0]
  ------------------
 4165|       |
 4166|      0|        if (connections->currentConnectionId.loadRelaxed() == 0)
  ------------------
  |  Branch (4166:13): [True: 0, False: 0]
  ------------------
 4167|      0|            senderDeleted = true;
 4168|      0|    }
 4169|      0|    if (!senderDeleted) {
  ------------------
  |  Branch (4169:9): [True: 0, False: 0]
  ------------------
 4170|      0|        sp->connections.loadAcquire()->cleanOrphanedConnections(sender);
 4171|       |
 4172|      0|        if (callbacks_enabled && signal_spy_set->signal_end_callback != nullptr)
  ------------------
  |  Branch (4172:13): [Folded - Ignored]
  |  Branch (4172:34): [True: 0, False: 0]
  ------------------
 4173|      0|            signal_spy_set->signal_end_callback(sender, signal_index);
 4174|      0|    }
 4175|      0|}

_ZN14QObjectPrivate9ExtraDataC2EPS_:
   91|      1|        ExtraData(QObjectPrivate *ptr) : parent(ptr) { }
_ZN14QObjectPrivate15ensureExtraDataEv:
  114|      1|    {
  115|      1|        if (!extraData)
  ------------------
  |  Branch (115:13): [True: 1, False: 0]
  ------------------
  116|      1|            extraData = new ExtraData(this);
  117|      1|    }
_ZN14QObjectPrivate3getEP7QObject:
  160|      2|    static QObjectPrivate *get(QObject *o) { return o->d_func(); }
_ZNK14QObjectPrivate28isDeclarativeSignalConnectedEj:
  229|   190k|{
  230|   190k|    return !isDeletingChildren && declarativeData && QAbstractDeclarativeData::isSignalConnected
  ------------------
  |  Branch (230:12): [True: 190k, False: 0]
  |  Branch (230:35): [True: 0, False: 190k]
  |  Branch (230:54): [True: 0, False: 0]
  ------------------
  231|   190k|            && QAbstractDeclarativeData::isSignalConnected(declarativeData, q_func(), signal_index);
  ------------------
  |  Branch (231:16): [True: 0, False: 0]
  ------------------
  232|   190k|}

_ZNK8QPointerI11QThreadPoolE6isNullEv:
   86|  1.93k|    { return wp.isNull(); }
_ZNK8QPointerI11QThreadPoolEcvPS0_Ev:
   83|  1.93k|    { return data(); }
_ZNK8QPointerI11QThreadPoolE4dataEv:
   75|  1.93k|    { return static_cast<T*>(wp.internalData()); }

_ZN15QBindingStorageC2Ev:
 2290|   190k|{
 2291|   190k|    bindingStatus = &QT_PREPEND_NAMESPACE(bindingStatus);
 2292|   190k|    Q_ASSERT(bindingStatus);
 2293|   190k|}
_ZN15QBindingStorageD2Ev:
 2296|   190k|{
 2297|   190k|    QBindingStoragePrivate(d).destroy();
 2298|   190k|}
_ZN15QBindingStorage5clearEv:
 2307|   190k|{
 2308|   190k|    QBindingStoragePrivate(d).destroy();
 2309|   190k|    d = nullptr;
 2310|   190k|    bindingStatus = nullptr;
 2311|   190k|}
_ZN9QtPrivate25initBindingStatusThreadIdEv:
 2358|  1.93k|{
 2359|  1.93k|    bindingStatus.threadId = QThread::currentThreadId();
 2360|  1.93k|}
_ZN9QtPrivate16getBindingStatusENS_25QBindingStatusAccessTokenE:
 2429|      1|QBindingStatus* getBindingStatus(QtPrivate::QBindingStatusAccessToken) { return &QT_PREPEND_NAMESPACE(bindingStatus); }
_ZN22QBindingStoragePrivateC2ERP19QBindingStorageData:
 2220|   380k|    QBindingStoragePrivate(QBindingStorageData *&_d) : d(_d) {}
_ZN22QBindingStoragePrivate7destroyEv:
 2264|   380k|    {
 2265|   380k|        if (!d)
  ------------------
  |  Branch (2265:13): [True: 380k, False: 0]
  ------------------
 2266|   380k|            return;
 2267|      0|        Pair *p = pairs(d);
 2268|      0|        for (size_t i = 0; i < d->size; ++i) {
  ------------------
  |  Branch (2268:28): [True: 0, False: 0]
  ------------------
 2269|      0|            if (p->data)
  ------------------
  |  Branch (2269:17): [True: 0, False: 0]
  ------------------
 2270|      0|                p->~Pair();
 2271|      0|            ++p;
 2272|      0|        }
 2273|      0|        free(d);
 2274|      0|    }

_ZN13QPropertyDataI7QStringED2Ev:
   87|      1|    ~QPropertyData() = default;
_ZN13QPropertyDataI7QStringEC2Ev:
   84|      1|    QPropertyData() = default;
_ZN13QPropertyDataI7QStringE25setValueBypassingBindingsERKS0_:
   90|      1|    void setValueBypassingBindings(parameter_type v) { val = v; }

_ZN21QObjectCompatPropertyIN14QObjectPrivate9ExtraDataE7QStringXadL_ZNS1_30_qt_property_objectName_offsetEvEEXadL_ZNS1_22setObjectNameForwarderERKS2_EEXadL_ZNS1_20nameChangedForwarderES4_EELDn0EEC2Ev:
  555|      1|    QObjectCompatProperty() = default;

_Z15qt_error_stringi:
  152|      1|{
  153|      1|    return standardLibraryErrorString(code == -1 ? errno : code);
  ------------------
  |  Branch (153:39): [True: 0, False: 1]
  ------------------
  154|      1|}
qsystemerror.cpp:_ZL26standardLibraryErrorStringi:
   72|      1|{
   73|      1|    const char *s = nullptr;
   74|      1|    QString ret;
   75|      1|    switch (errorCode) {
   76|      0|    case 0:
  ------------------
  |  Branch (76:5): [True: 0, False: 1]
  ------------------
   77|      0|        break;
   78|      0|    case EACCES:
  ------------------
  |  Branch (78:5): [True: 0, False: 1]
  ------------------
   79|      0|        s = QT_TRANSLATE_NOOP("QIODevice", "Permission denied");
   80|      0|        break;
   81|      0|    case EMFILE:
  ------------------
  |  Branch (81:5): [True: 0, False: 1]
  ------------------
   82|      0|        s = QT_TRANSLATE_NOOP("QIODevice", "Too many open files");
   83|      0|        break;
   84|      1|    case ENOENT:
  ------------------
  |  Branch (84:5): [True: 1, False: 0]
  ------------------
   85|      1|        s = QT_TRANSLATE_NOOP("QIODevice", "No such file or directory");
   86|      1|        break;
   87|      0|    case ENOSPC:
  ------------------
  |  Branch (87:5): [True: 0, False: 1]
  ------------------
   88|      0|        s = QT_TRANSLATE_NOOP("QIODevice", "No space left on device");
   89|      0|        break;
   90|      0|    default: {
  ------------------
  |  Branch (90:5): [True: 0, False: 1]
  ------------------
   91|       |      #if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX)
   92|       |            QByteArray buf(1024, Qt::Uninitialized);
   93|       |            ret = fromstrerror_helper(strerror_r(errorCode, buf.data(), buf.size()), buf);
   94|       |      #else
   95|      0|            ret = QString::fromLocal8Bit(strerror(errorCode));
   96|      0|      #endif
   97|      0|    break; }
   98|      1|    }
   99|      1|    if (s) {
  ------------------
  |  Branch (99:9): [True: 1, False: 0]
  ------------------
  100|      1|#ifndef QT_BOOTSTRAPPED
  101|      1|        ret = QCoreApplication::translate("QIODevice", s);
  102|       |#else
  103|       |        ret = QString::fromLatin1(s);
  104|       |#endif
  105|      1|    }
  106|      1|    return ret.trimmed();
  107|      1|}

_ZN14QTimerInfoListC2Ev:
   28|  1.93k|QTimerInfoList::QTimerInfoList() = default;

_ZN14QTimerInfoList11clearTimersEv:
   69|  1.93k|    {
   70|  1.93k|        qDeleteAll(timers);
   71|  1.93k|        timers.clear();
   72|  1.93k|    }

_ZN8QVariantD2Ev:
  518|     10|{
  519|     10|    if (!d.is_shared || !d.data.shared->ref.deref())
  ------------------
  |  Branch (519:9): [True: 10, False: 0]
  |  Branch (519:25): [True: 0, False: 0]
  ------------------
  520|     10|        customClear(&d);
  521|     10|}
_ZNK8QVariant6isNullEv:
 2495|      3|{
 2496|      3|    if (d.is_null || !metaType().isValid())
  ------------------
  |  Branch (2496:9): [True: 3, False: 0]
  |  Branch (2496:9): [True: 3, False: 0]
  |  Branch (2496:22): [True: 0, False: 0]
  ------------------
 2497|      3|        return true;
 2498|      0|    if (metaType().flags() & QMetaType::IsPointer)
  ------------------
  |  Branch (2498:9): [True: 0, False: 0]
  ------------------
 2499|      0|        return d.get<void *>() == nullptr;
 2500|      0|    return false;
 2501|      0|}
qvariant.cpp:_ZN12_GLOBAL__N_111customClearEPN8QVariant7PrivateE:
  278|     10|{
  279|     10|    const QtPrivate::QMetaTypeInterface *iface = d->typeInterface();
  280|     10|    if (!iface)
  ------------------
  |  Branch (280:9): [True: 10, False: 0]
  ------------------
  281|     10|        return;
  282|      0|    if (!d->is_shared) {
  ------------------
  |  Branch (282:9): [True: 0, False: 0]
  ------------------
  283|      0|        QtMetaTypePrivate::destruct(iface, d->data.data);
  284|      0|    } else {
  285|      0|        QtMetaTypePrivate::destruct(iface, d->data.shared->data());
  286|      0|        QVariant::PrivateShared::free(d->data.shared);
  287|      0|    }
  288|      0|}

_ZN8QVariantC2EOS_:
  329|      2|    inline QVariant(QVariant &&other) noexcept : d(other.d)
  330|      2|    { other.d = Private(); }
_ZN8QVariant7PrivateC2Ev:
  120|     10|        constexpr Private() noexcept : is_shared(false), is_null(true), packedType(0) {}

_ZN21QDeviceClosedNotifierD2Ev:
  253|   186k|QDeviceClosedNotifier::~QDeviceClosedNotifier()
_ZN18QTextStreamPrivateC2EP11QTextStream:
  263|   186k|    : readConverterSavedStateOffset(0),
  264|   186k|      locale(QLocale::c())
  265|   186k|{
  266|   186k|    this->q_ptr = q_ptr;
  267|   186k|    reset();
  268|   186k|}
_ZN18QTextStreamPrivateD2Ev:
  274|   186k|{
  275|   186k|    if (deleteDevice) {
  ------------------
  |  Branch (275:9): [True: 0, False: 186k]
  ------------------
  276|      0|#ifndef QT_NO_QOBJECT
  277|      0|        device->blockSignals(true);
  278|      0|#endif
  279|      0|        delete device;
  280|      0|    }
  281|   186k|}
_ZN18QTextStreamPrivate6Params5resetEv:
  284|   186k|{
  285|   186k|    realNumberPrecision = 6;
  286|   186k|    integerBase = 0;
  287|   186k|    fieldWidth = 0;
  288|   186k|    padChar = u' ';
  289|   186k|    fieldAlignment = QTextStream::AlignRight;
  290|   186k|    realNumberNotation = QTextStream::SmartNotation;
  291|   186k|    numberFlags = { };
  292|   186k|}
_ZN18QTextStreamPrivate5resetEv:
  298|   186k|{
  299|   186k|    params.reset();
  300|       |
  301|   186k|    device = nullptr;
  302|   186k|    deleteDevice = false;
  303|   186k|    string = nullptr;
  304|   186k|    stringOffset = 0;
  305|   186k|    stringOpenMode = QTextStream::NotOpen;
  306|       |
  307|   186k|    readBufferOffset = 0;
  308|   186k|    readBufferStartDevicePos = 0;
  309|   186k|    lastTokenSize = 0;
  310|       |
  311|   186k|    hasWrittenData = false;
  312|   186k|    generateBOM = false;
  313|   186k|    encoding = QStringConverter::Utf8;
  314|   186k|    toUtf16 = QStringDecoder(encoding);
  315|   186k|    fromUtf16 = QStringEncoder(encoding);
  316|   186k|    autoDetectUnicode = true;
  317|   186k|}
_ZN18QTextStreamPrivate5writeEPK5QCharx:
  693|   195k|{
  694|   195k|    if (string) {
  ------------------
  |  Branch (694:9): [True: 195k, False: 0]
  ------------------
  695|       |        // ### What about seek()??
  696|   195k|        string->append(data, len);
  697|   195k|    } else {
  698|      0|        writeBuffer.append(data, len);
  699|      0|        if (writeBuffer.size() > QTEXTSTREAM_BUFFERSIZE)
  ------------------
  |  Branch (699:13): [True: 0, False: 0]
  ------------------
  700|      0|            flushWriteBuffer();
  701|      0|    }
  702|   195k|}
_ZN18QTextStreamPrivate9putStringEPK5QCharxb:
  830|   195k|{
  831|   195k|    if (Q_UNLIKELY(params.fieldWidth > len)) {
  832|       |
  833|       |        // handle padding:
  834|       |
  835|      0|        const PaddingResult pad = padding(len);
  836|       |
  837|      0|        if (params.fieldAlignment == QTextStream::AlignAccountingStyle && number) {
  ------------------
  |  Branch (837:13): [True: 0, False: 0]
  |  Branch (837:75): [True: 0, False: 0]
  ------------------
  838|      0|            const QChar sign = len > 0 ? data[0] : QChar();
  ------------------
  |  Branch (838:32): [True: 0, False: 0]
  ------------------
  839|      0|            if (sign == locale.negativeSign() || sign == locale.positiveSign()) {
  ------------------
  |  Branch (839:17): [True: 0, False: 0]
  |  Branch (839:17): [True: 0, False: 0]
  |  Branch (839:50): [True: 0, False: 0]
  ------------------
  840|       |                // write the sign before the padding, then skip it later
  841|      0|                write(&sign, 1);
  842|      0|                ++data;
  843|      0|                --len;
  844|      0|            }
  845|      0|        }
  846|       |
  847|      0|        writePadding(pad.left);
  848|      0|        write(data, len);
  849|      0|        writePadding(pad.right);
  850|   195k|    } else {
  851|   195k|        write(data, len);
  852|   195k|    }
  853|   195k|}
_ZN11QTextStreamC2EP7QString6QFlagsIN13QIODeviceBase12OpenModeFlagEE:
  927|   186k|    : d_ptr(new QTextStreamPrivate(this))
  928|   186k|{
  929|       |#if defined (QTEXTSTREAM_DEBUG)
  930|       |    qDebug("QTextStream::QTextStream(QString *string == *%p, openMode = %d)",
  931|       |           string, int(openMode));
  932|       |#endif
  933|   186k|    Q_D(QTextStream);
  934|   186k|    d->string = string;
  935|   186k|    d->stringOpenMode = openMode;
  936|   186k|    d->status = Ok;
  937|   186k|}
_ZN11QTextStreamD2Ev:
 1033|   186k|{
 1034|   186k|    Q_D(QTextStream);
 1035|       |#if defined (QTEXTSTREAM_DEBUG)
 1036|       |    qDebug("QTextStream::~QTextStream()");
 1037|       |#endif
 1038|   186k|    if (!d->writeBuffer.isEmpty())
  ------------------
  |  Branch (1038:9): [True: 0, False: 186k]
  ------------------
 1039|      0|        d->flushWriteBuffer();
 1040|   186k|}
_ZN11QTextStreamlsEc:
 2271|   195k|{
 2272|   195k|    Q_D(QTextStream);
 2273|   195k|    CHECK_VALID_STREAM(*this);
  ------------------
  |  |  212|   195k|#define CHECK_VALID_STREAM(x) do { \
  |  |  213|   195k|    if (!d->string && !d->device) { \
  |  |  ------------------
  |  |  |  Branch (213:9): [True: 0, False: 195k]
  |  |  |  Branch (213:23): [True: 0, False: 0]
  |  |  ------------------
  |  |  214|      0|        qWarning("QTextStream: No device"); \
  |  |  215|      0|        return x; \
  |  |  216|   195k|    } } while (0)
  |  |  ------------------
  |  |  |  Branch (216:16): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2274|   195k|    d->putChar(QChar::fromLatin1(c));
 2275|   195k|    return *this;
 2276|   195k|}
_ZN11QTextStreamlsERK7QString:
 2470|   195k|{
 2471|   195k|    Q_D(QTextStream);
 2472|   195k|    CHECK_VALID_STREAM(*this);
  ------------------
  |  |  212|   195k|#define CHECK_VALID_STREAM(x) do { \
  |  |  213|   195k|    if (!d->string && !d->device) { \
  |  |  ------------------
  |  |  |  Branch (213:9): [True: 0, False: 195k]
  |  |  |  Branch (213:23): [True: 0, False: 0]
  |  |  ------------------
  |  |  214|      0|        qWarning("QTextStream: No device"); \
  |  |  215|      0|        return x; \
  |  |  216|   195k|    } } while (0)
  |  |  ------------------
  |  |  |  Branch (216:16): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2473|   195k|    d->putString(string);
 2474|   195k|    return *this;
 2475|   195k|}
_ZN18QTextStreamPrivate7putCharE5QChar:
  791|   195k|{
  792|   195k|    if (params.fieldWidth > 0)
  ------------------
  |  Branch (792:9): [True: 0, False: 195k]
  ------------------
  793|      0|        putString(&ch, 1);
  794|   195k|    else
  795|   195k|        write(ch);
  796|   195k|}
_ZN18QTextStreamPrivate5writeE5QChar:
  708|   195k|{
  709|   195k|    if (string) {
  ------------------
  |  Branch (709:9): [True: 195k, False: 0]
  ------------------
  710|       |        // ### What about seek()??
  711|   195k|        string->append(ch);
  712|   195k|    } else {
  713|      0|        writeBuffer += ch;
  714|      0|        if (writeBuffer.size() > QTEXTSTREAM_BUFFERSIZE)
  ------------------
  |  Branch (714:13): [True: 0, False: 0]
  ------------------
  715|      0|            flushWriteBuffer();
  716|      0|    }
  717|   195k|}

_ZN21QDeviceClosedNotifierC2Ev:
   33|   186k|    { }
_ZN18QTextStreamPrivate9putStringE11QStringViewb:
  149|   195k|    {
  150|   195k|        putString(string.constData(), string.size(), number);
  151|   195k|    }

_Z8qstricmpPKcS0_:
  254|      2|{
  255|      2|    const uchar *s1 = reinterpret_cast<const uchar *>(str1);
  256|      2|    const uchar *s2 = reinterpret_cast<const uchar *>(str2);
  257|      2|    if (!s1)
  ------------------
  |  Branch (257:9): [True: 0, False: 2]
  ------------------
  258|      0|        return s2 ? -1 : 0;
  ------------------
  |  Branch (258:16): [True: 0, False: 0]
  ------------------
  259|      2|    if (!s2)
  ------------------
  |  Branch (259:9): [True: 0, False: 2]
  ------------------
  260|      0|        return 1;
  261|       |
  262|      2|    enum { Incomplete = 256 };
  263|      2|    qptrdiff offset = 0;
  264|      2|    auto innerCompare = [=, &offset](qptrdiff max, bool unlimited) {
  265|      2|        max += offset;
  266|      2|        do {
  267|      2|            uchar c = s1[offset];
  268|      2|            if (int res = QtMiscUtils::caseCompareAscii(c, s2[offset]))
  269|      2|                return res;
  270|      2|            if (!c)
  271|      2|                return 0;
  272|      2|            ++offset;
  273|      2|        } while (unlimited || offset < max);
  274|      2|        return int(Incomplete);
  275|      2|    };
  276|       |
  277|       |#if defined(__SSE4_1__) && !(defined(__SANITIZE_ADDRESS__) || __has_feature(address_sanitizer))
  278|       |    enum { PageSize = 4096, PageMask = PageSize - 1 };
  279|       |    const __m128i zero = _mm_setzero_si128();
  280|       |    forever {
  281|       |        // Calculate how many bytes we can load until we cross a page boundary
  282|       |        // for either source. This isn't an exact calculation, just something
  283|       |        // very quick.
  284|       |        quintptr u1 = quintptr(s1 + offset);
  285|       |        quintptr u2 = quintptr(s2 + offset);
  286|       |        size_t n = PageSize - ((u1 | u2) & PageMask);
  287|       |
  288|       |        qptrdiff maxoffset = offset + n;
  289|       |        for ( ; offset + 16 <= maxoffset; offset += sizeof(__m128i)) {
  290|       |            // load 16 bytes from either source
  291|       |            __m128i a = _mm_loadu_si128(reinterpret_cast<const __m128i *>(s1 + offset));
  292|       |            __m128i b = _mm_loadu_si128(reinterpret_cast<const __m128i *>(s2 + offset));
  293|       |
  294|       |            // compare the two against each other
  295|       |            __m128i cmp = _mm_cmpeq_epi8(a, b);
  296|       |
  297|       |            // find NUL terminators too
  298|       |            cmp = _mm_min_epu8(cmp, a);
  299|       |            cmp = _mm_cmpeq_epi8(cmp, zero);
  300|       |
  301|       |            // was there any difference or a NUL?
  302|       |            uint mask = _mm_movemask_epi8(cmp);
  303|       |            if (mask) {
  304|       |                // yes, find out where
  305|       |                uint start = qCountTrailingZeroBits(mask);
  306|       |                uint end = sizeof(mask) * 8 - qCountLeadingZeroBits(mask);
  307|       |                Q_ASSERT(end >= start);
  308|       |                offset += start;
  309|       |                n = end - start;
  310|       |                break;
  311|       |            }
  312|       |        }
  313|       |
  314|       |        // using SIMD could cause a page fault, so iterate byte by byte
  315|       |        int res = innerCompare(n, false);
  316|       |        if (res != Incomplete)
  317|       |            return res;
  318|       |    }
  319|       |#endif
  320|       |
  321|      2|    return innerCompare(-1, true);
  322|      2|}
_Z9qstrnicmpPKcxS0_x:
  368|  46.3k|{
  369|  46.3k|    Q_ASSERT(len1 >= 0);
  370|  46.3k|    Q_ASSERT(len2 >= -1);
  371|  46.3k|    const uchar *s1 = reinterpret_cast<const uchar *>(str1);
  372|  46.3k|    const uchar *s2 = reinterpret_cast<const uchar *>(str2);
  373|  46.3k|    if (!s1 || !len1) {
  ------------------
  |  Branch (373:9): [True: 0, False: 46.3k]
  |  Branch (373:16): [True: 0, False: 46.3k]
  ------------------
  374|      0|        if (len2 == 0)
  ------------------
  |  Branch (374:13): [True: 0, False: 0]
  ------------------
  375|      0|            return 0;
  376|      0|        if (len2 == -1)
  ------------------
  |  Branch (376:13): [True: 0, False: 0]
  ------------------
  377|      0|            return (!s2 || !*s2) ? 0 : -1;
  ------------------
  |  Branch (377:21): [True: 0, False: 0]
  |  Branch (377:28): [True: 0, False: 0]
  ------------------
  378|      0|        Q_ASSERT(s2);
  379|      0|        return -1;
  380|      0|    }
  381|  46.3k|    if (!s2)
  ------------------
  |  Branch (381:9): [True: 0, False: 46.3k]
  ------------------
  382|      0|        return len1 == 0 ? 0 : 1;
  ------------------
  |  Branch (382:16): [True: 0, False: 0]
  ------------------
  383|       |
  384|  46.3k|    if (len2 == -1) {
  ------------------
  |  Branch (384:9): [True: 0, False: 46.3k]
  ------------------
  385|       |        // null-terminated str2
  386|      0|        qsizetype i;
  387|      0|        for (i = 0; i < len1; ++i) {
  ------------------
  |  Branch (387:21): [True: 0, False: 0]
  ------------------
  388|      0|            const uchar c = s2[i];
  389|      0|            if (!c)
  ------------------
  |  Branch (389:17): [True: 0, False: 0]
  ------------------
  390|      0|                return 1;
  391|       |
  392|      0|            if (int res = QtMiscUtils::caseCompareAscii(s1[i], c))
  ------------------
  |  Branch (392:21): [True: 0, False: 0]
  ------------------
  393|      0|                return res;
  394|      0|        }
  395|      0|        return s2[i] ? -1 : 0;
  ------------------
  |  Branch (395:16): [True: 0, False: 0]
  ------------------
  396|  46.3k|    } else {
  397|       |        // not null-terminated
  398|  46.3k|        const qsizetype len = qMin(len1, len2);
  399|   251k|        for (qsizetype i = 0; i < len; ++i) {
  ------------------
  |  Branch (399:31): [True: 220k, False: 30.9k]
  ------------------
  400|   220k|            if (int res = QtMiscUtils::caseCompareAscii(s1[i], s2[i]))
  ------------------
  |  Branch (400:21): [True: 15.4k, False: 204k]
  ------------------
  401|  15.4k|                return res;
  402|   220k|        }
  403|  30.9k|        if (len1 == len2)
  ------------------
  |  Branch (403:13): [True: 23.1k, False: 7.73k]
  ------------------
  404|  23.1k|            return 0;
  405|  7.73k|        return len1 < len2 ? -1 : 1;
  ------------------
  |  Branch (405:16): [True: 3.86k, False: 3.86k]
  ------------------
  406|  30.9k|    }
  407|  46.3k|}
_ZN10QByteArrayaSERKS_:
 1363|     20|{
 1364|     20|    d = other.d;
 1365|     20|    return *this;
 1366|     20|}
_ZN10QByteArrayaSEPKc:
 1379|      2|{
 1380|      2|    if (!str) {
  ------------------
  |  Branch (1380:9): [True: 0, False: 2]
  ------------------
 1381|      0|        d.clear();
 1382|      2|    } else if (!*str) {
  ------------------
  |  Branch (1382:16): [True: 0, False: 2]
  ------------------
 1383|      0|        d = DataPointer::fromRawData(&_empty, 0);
 1384|      2|    } else {
 1385|      2|        assign(str);
 1386|      2|    }
 1387|      2|    return *this;
 1388|      2|}
_ZN10QByteArray8truncateEx:
 1727|   419k|{
 1728|   419k|    if (pos < size())
  ------------------
  |  Branch (1728:9): [True: 406k, False: 12.8k]
  ------------------
 1729|   406k|        resize(pos);
 1730|   419k|}
_ZN10QByteArrayC2EPKcx:
 1834|  1.95k|{
 1835|  1.95k|    if (!data) {
  ------------------
  |  Branch (1835:9): [True: 19, False: 1.93k]
  ------------------
 1836|     19|        d = DataPointer();
 1837|  1.93k|    } else {
 1838|  1.93k|        if (size < 0)
  ------------------
  |  Branch (1838:13): [True: 4, False: 1.93k]
  ------------------
 1839|      4|            size = qstrlen(data);
 1840|  1.93k|        if (!size) {
  ------------------
  |  Branch (1840:13): [True: 0, False: 1.93k]
  ------------------
 1841|      0|            d = DataPointer::fromRawData(&_empty, 0);
 1842|  1.93k|        } else {
 1843|  1.93k|            d = DataPointer(size, size);
 1844|  1.93k|            Q_CHECK_PTR(d.data());
 1845|  1.93k|            memcpy(d.data(), data, size);
 1846|  1.93k|            d.data()[size] = '\0';
 1847|  1.93k|        }
 1848|  1.93k|    }
 1849|  1.95k|}
_ZN10QByteArrayC2ExN2Qt14InitializationE:
 1874|   373k|{
 1875|   373k|    if (size <= 0) {
  ------------------
  |  Branch (1875:9): [True: 0, False: 373k]
  ------------------
 1876|      0|        d = DataPointer::fromRawData(&_empty, 0);
 1877|   373k|    } else {
 1878|   373k|        d = DataPointer(size, size);
 1879|   373k|        Q_CHECK_PTR(d.data());
 1880|   373k|        d.data()[size] = '\0';
 1881|   373k|    }
 1882|   373k|}
_ZN10QByteArray6resizeEx:
 1900|   453k|{
 1901|   453k|    if (size < 0)
  ------------------
  |  Branch (1901:9): [True: 0, False: 453k]
  ------------------
 1902|      0|        size = 0;
 1903|       |
 1904|   453k|    const auto capacityAtEnd = capacity() - d.freeSpaceAtBegin();
 1905|   453k|    if (d->needsDetach() || size > capacityAtEnd)
  ------------------
  |  Branch (1905:9): [True: 46.3k, False: 406k]
  |  Branch (1905:29): [True: 0, False: 406k]
  ------------------
 1906|  46.3k|        reallocData(size, QArrayData::Grow);
 1907|   453k|    d.size = size;
 1908|   453k|    if (d->allocatedCapacity())
  ------------------
  |  Branch (1908:9): [True: 453k, False: 0]
  ------------------
 1909|   453k|        d.data()[size] = 0;
 1910|   453k|}
_ZN10QByteArray11reallocDataExN10QArrayData16AllocationOptionE:
 1971|  46.3k|{
 1972|  46.3k|    if (!alloc) {
  ------------------
  |  Branch (1972:9): [True: 0, False: 46.3k]
  ------------------
 1973|      0|        d = DataPointer::fromRawData(&_empty, 0);
 1974|      0|        return;
 1975|      0|    }
 1976|       |
 1977|       |    // don't use reallocate path when reducing capacity and there's free space
 1978|       |    // at the beginning: might shift data pointer outside of allocated space
 1979|  46.3k|    const bool cannotUseReallocate = d.freeSpaceAtBegin() > 0;
 1980|       |
 1981|  46.3k|    if (d->needsDetach() || cannotUseReallocate) {
  ------------------
  |  Branch (1981:9): [True: 46.3k, False: 0]
  |  Branch (1981:29): [True: 0, False: 0]
  ------------------
 1982|  46.3k|        DataPointer dd(alloc, qMin(alloc, d.size), option);
 1983|  46.3k|        Q_CHECK_PTR(dd.data());
 1984|  46.3k|        if (dd.size > 0)
  ------------------
  |  Branch (1984:13): [True: 0, False: 46.3k]
  ------------------
 1985|      0|            ::memcpy(dd.data(), d.data(), dd.size);
 1986|  46.3k|        dd.data()[dd.size] = 0;
 1987|  46.3k|        d = dd;
 1988|  46.3k|    } else {
 1989|      0|        d->reallocate(alloc, option);
 1990|      0|    }
 1991|  46.3k|}
_ZN10QByteArray6assignE14QByteArrayView:
 2246|      2|{
 2247|      2|    const auto len = v.size();
 2248|       |
 2249|      2|    if (len <= capacity() &&  isDetached()) {
  ------------------
  |  Branch (2249:9): [True: 1, False: 1]
  |  Branch (2249:31): [True: 1, False: 0]
  ------------------
 2250|      1|        const auto offset = d.freeSpaceAtBegin();
 2251|      1|        if (offset)
  ------------------
  |  Branch (2251:13): [True: 0, False: 1]
  ------------------
 2252|      0|            d.setBegin(d.begin() - offset);
 2253|      1|        std::memcpy(d.begin(), v.data(), len);
 2254|      1|        d.size = len;
 2255|      1|        d.data()[d.size] = '\0';
 2256|      1|    } else {
 2257|      1|        *this = v.toByteArray();
 2258|      1|    }
 2259|      2|    return *this;
 2260|      2|}
_ZN10QByteArray6insertEx14QByteArrayView:
 2283|      1|{
 2284|      1|    const char *str = data.data();
 2285|      1|    qsizetype size = data.size();
 2286|      1|    if (i < 0 || size <= 0)
  ------------------
  |  Branch (2286:9): [True: 0, False: 1]
  |  Branch (2286:18): [True: 0, False: 1]
  ------------------
 2287|      0|        return *this;
 2288|       |
 2289|       |    // handle this specially, as QArrayDataOps::insert() doesn't handle out of
 2290|       |    // bounds positions
 2291|      1|    if (i >= d->size) {
  ------------------
  |  Branch (2291:9): [True: 1, False: 0]
  ------------------
 2292|       |        // In case when data points into the range or is == *this, we need to
 2293|       |        // defer a call to free() so that it comes after we copied the data from
 2294|       |        // the old memory:
 2295|      1|        DataPointer detached{};  // construction is free
 2296|      1|        d.detachAndGrow(Data::GrowsAtEnd, (i - d.size) + size, &str, &detached);
 2297|      1|        Q_CHECK_PTR(d.data());
 2298|      1|        d->copyAppend(i - d->size, ' ');
 2299|      1|        d->copyAppend(str, str + size);
 2300|      1|        d.data()[d.size] = '\0';
 2301|      1|        return *this;
 2302|      1|    }
 2303|       |
 2304|      0|    if (!d->needsDetach() && QtPrivate::q_points_into_range(str, d)) {
  ------------------
  |  Branch (2304:9): [True: 0, False: 0]
  |  Branch (2304:30): [True: 0, False: 0]
  ------------------
 2305|      0|        QVarLengthArray a(str, str + size);
 2306|      0|        return insert(i, a);
 2307|      0|    }
 2308|       |
 2309|      0|    d->insert(i, str, size);
 2310|      0|    d.data()[d.size] = '\0';
 2311|      0|    return *this;
 2312|      0|}
_ZN10QByteArray7replaceEcc:
 2651|      1|{
 2652|      1|    if (before != after) {
  ------------------
  |  Branch (2652:9): [True: 1, False: 0]
  ------------------
 2653|      1|        if (const auto pos = indexOf(before); pos >= 0) {
  ------------------
  |  Branch (2653:47): [True: 0, False: 1]
  ------------------
 2654|      0|            const auto detachedData = data();
 2655|      0|            std::replace(detachedData + pos, detachedData + size(), before, after);
 2656|      0|        }
 2657|      1|    }
 2658|      1|    return *this;
 2659|      1|}
qbytearray.cpp:_ZZ8qstricmpPKcS0_ENK3$_0clExb:
  264|      2|    auto innerCompare = [=, &offset](qptrdiff max, bool unlimited) {
  265|      2|        max += offset;
  266|      2|        do {
  267|      2|            uchar c = s1[offset];
  268|      2|            if (int res = QtMiscUtils::caseCompareAscii(c, s2[offset]))
  ------------------
  |  Branch (268:21): [True: 2, False: 0]
  ------------------
  269|      2|                return res;
  270|      0|            if (!c)
  ------------------
  |  Branch (270:17): [True: 0, False: 0]
  ------------------
  271|      0|                return 0;
  272|      0|            ++offset;
  273|      0|        } while (unlimited || offset < max);
  ------------------
  |  Branch (273:18): [True: 0, False: 0]
  |  Branch (273:31): [True: 0, False: 0]
  ------------------
  274|      0|        return int(Incomplete);
  275|      2|    };

_ZNK10QByteArray7indexOfEcx:
  751|      5|{
  752|      5|    return qToByteArrayViewIgnoringNull(*this).indexOf(ch, from);
  753|      5|}
_ZNK10QByteArray9constDataEv:
  123|   559k|    const char *constData() const noexcept { return data(); }
_ZNK10QByteArray4sizeEv:
  498|   885k|    inline qsizetype size() const noexcept { return d.size; }
_ZN10QByteArrayD2Ev:
  626|   421k|inline QByteArray::~QByteArray() {}
_ZN10QByteArrayC2ERKS_:
  657|     15|inline QByteArray::QByteArray(const QByteArray &a) noexcept : d(a.d)
  658|     15|{}
_ZNK10QByteArray4dataEv:
  646|   559k|{
  647|   559k|#if QT5_NULL_STRINGS == 1
  648|   559k|    return d.data() ? d.data() : &_empty;
  ------------------
  |  Branch (648:12): [True: 559k, False: 0]
  ------------------
  649|       |#else
  650|       |    return d.data();
  651|       |#endif
  652|   559k|}
_ZNK10QByteArray5beginEv:
  444|  46.4k|    const_iterator begin() const noexcept { return d.data(); }
_ZN10QByteArrayC2Ev:
  625|  46.4k|inline constexpr QByteArray::QByteArray() noexcept {}

_ZNK14QByteArrayView7indexOfEcx:
  285|      5|    { return QtPrivate::findByteArray(*this, from, ch); }
_ZN9QtPrivate13findByteArrayE14QByteArrayViewxc:
  414|      5|{
  415|      5|    if (from < 0)
  ------------------
  |  Branch (415:9): [True: 0, False: 5]
  ------------------
  416|      0|        from = qMax(from + haystack.size(), qsizetype(0));
  417|      5|    if (from < haystack.size()) {
  ------------------
  |  Branch (417:9): [True: 4, False: 1]
  ------------------
  418|      4|        const char *const b = haystack.data();
  419|      4|        if (const auto n = static_cast<const char *>(
  ------------------
  |  Branch (419:24): [True: 0, False: 4]
  ------------------
  420|      4|                    memchr(b + from, needle, static_cast<size_t>(haystack.size() - from)))) {
  421|      0|            return n - b;
  422|      0|        }
  423|      4|    }
  424|      5|    return -1;
  425|      5|}
_ZNK14QByteArrayView4dataEv:
  193|   968k|    [[nodiscard]] constexpr const_pointer data() const noexcept { return m_data; }
_ZNK14QByteArrayView4sizeEv:
  192|  2.92M|    [[nodiscard]] constexpr qsizetype size() const noexcept { return m_size; }
_Z28qToByteArrayViewIgnoringNullI10QByteArrayTnNSt3__19enable_ifIXsr3stdE9is_same_vIT_S0_EEbE4typeELb1EE14QByteArrayViewRKS3_:
  398|      5|{ return QByteArrayView(b.begin(), b.size()); }
_ZN14QByteArrayViewC2IcTnNSt3__19enable_ifIXsr9QtPrivate20IsCompatibleByteTypeIT_EE5valueEbE4typeELb1EEEPKS3_x:
  147|   497k|        : m_size((Q_ASSERT(len >= 0), Q_ASSERT(data || !len), len)),
  ------------------
  |  |   31|   497k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:29): [True: 497k, False: 0]
  |  |  ------------------
  ------------------
                      : m_size((Q_ASSERT(len >= 0), Q_ASSERT(data || !len), len)),
  ------------------
  |  |   31|   497k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:30): [True: 497k, False: 1]
  |  |  |  Branch (31:30): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  148|   497k|          m_data(castHelper(data)) {}
_ZN14QByteArrayView10castHelperEPKc:
  137|   497k|    { return data; }
_ZN14QByteArrayViewC2I10QByteArrayTnNSt3__19enable_ifIXsr3stdE9is_same_vIT_S1_EEbE4typeELb1EEERKS4_:
  169|  46.4k|        : QByteArrayView{ba.begin(), ba.size()} {}
_Z13comparesEqualRK14QByteArrayViewS1_:
  357|   195k|    {
  358|   195k|        return lhs.size() == rhs.size()
  ------------------
  |  Branch (358:16): [True: 195k, False: 0]
  ------------------
  359|   195k|                && (!lhs.size() || memcmp(lhs.data(), rhs.data(), lhs.size()) == 0);
  ------------------
  |  Branch (359:21): [True: 0, False: 195k]
  |  Branch (359:36): [True: 0, False: 195k]
  ------------------
  360|   195k|    }
_ZN14QByteArrayViewC2IPKcTnNSt3__19enable_ifIXsr9QtPrivate28IsCompatibleByteArrayPointerIT_EE5valueEbE4typeELb1EEERKS5_:
  160|   253k|        : QByteArrayView(
  161|   253k|              data, data ? QtPrivate::lengthHelperPointer(data) : 0) {}
  ------------------
  |  Branch (161:21): [True: 253k, False: 0]
  ------------------

_ZN5QChar7unicodeEv:
  515|   195k|    constexpr inline char16_t &unicode() noexcept { return ucs; }
_ZN5QCharC2EDs:
  126|      1|    constexpr Q_IMPLICIT QChar(char16_t ch) noexcept : ucs(ch) {}

_ZNK13QLatin1String4dataEv:
   65|      1|    constexpr const char *data() const noexcept { return m_data; }
_ZNK13QLatin1String4sizeEv:
   64|      6|    constexpr qsizetype size() const noexcept { return m_size; }

_ZNK9QLocaleId22withLikelySubtagsAddedEv:
  321|      2|{
  322|       |    /* Each pattern that appears in a comments below, language_script_region and
  323|       |       similar, indicates which of this's fields (even if blank) are being
  324|       |       attended to in a given search; for fields left out of the pattern, the
  325|       |       search uses 0 regardless of whether this has specified the field.
  326|       |
  327|       |       If a key matches what we're searching for (possibly with a wildcard in
  328|       |       the key matching a non-wildcard in our search), the tags from this that
  329|       |       are specified in the key are replaced by the match (even if different);
  330|       |       but the other tags of this replace what's in the match (even when the
  331|       |       match does specify a value).
  332|       |
  333|       |       Keep QLocaleXmlReader.__fillLikely() in sync with this, to ensure
  334|       |       locale-appropriate time-zone naming works correctly.
  335|       |    */
  336|      2|    static_assert(std::size(likely_subtags) % 2 == 0);
  337|      2|    auto *pairs = reinterpret_cast<const LikelyPair *>(likely_subtags);
  338|      2|    auto *const afterPairs = pairs + std::size(likely_subtags) / 2;
  339|      2|    LikelyPair sought { *this };
  340|       |    // Our array is sorted in the order that puts all candidate matches in the
  341|       |    // order we would want them; ones we should prefer appear before the others.
  342|      2|    if (language_id) {
  ------------------
  |  Branch (342:9): [True: 2, False: 0]
  ------------------
  343|       |        // language_script_region, language_region, language_script, language:
  344|      2|        pairs = std::lower_bound(pairs, afterPairs, sought);
  345|       |        // Single language's block isn't long enough to warrant more binary
  346|       |        // chopping within it - just traverse it all:
  347|      2|        for (; pairs < afterPairs && pairs->key.language_id == language_id; ++pairs) {
  ------------------
  |  Branch (347:16): [True: 2, False: 0]
  |  Branch (347:38): [True: 0, False: 2]
  ------------------
  348|      0|            const QLocaleId &key = pairs->key;
  349|      0|            if (key.territory_id && key.territory_id != territory_id)
  ------------------
  |  Branch (349:17): [True: 0, False: 0]
  |  Branch (349:37): [True: 0, False: 0]
  ------------------
  350|      0|                continue;
  351|      0|            if (key.script_id && key.script_id != script_id)
  ------------------
  |  Branch (351:17): [True: 0, False: 0]
  |  Branch (351:34): [True: 0, False: 0]
  ------------------
  352|      0|                continue;
  353|      0|            QLocaleId value = pairs->value;
  354|      0|            if (territory_id && !key.territory_id)
  ------------------
  |  Branch (354:17): [True: 0, False: 0]
  |  Branch (354:33): [True: 0, False: 0]
  ------------------
  355|      0|                value.territory_id = territory_id;
  356|      0|            if (script_id && !key.script_id)
  ------------------
  |  Branch (356:17): [True: 0, False: 0]
  |  Branch (356:30): [True: 0, False: 0]
  ------------------
  357|      0|                value.script_id = script_id;
  358|      0|            return value;
  359|      0|        }
  360|      2|    }
  361|       |    // und_script_region or und_region (in that order):
  362|      2|    if (territory_id) {
  ------------------
  |  Branch (362:9): [True: 0, False: 2]
  ------------------
  363|      0|        sought.key = QLocaleId { 0, script_id, territory_id };
  364|      0|        pairs = std::lower_bound(pairs, afterPairs, sought);
  365|       |        // Again, individual und_?_region block isn't long enough to make binary
  366|       |        // chop a win:
  367|      0|        for (; pairs < afterPairs && pairs->key.territory_id == territory_id; ++pairs) {
  ------------------
  |  Branch (367:16): [True: 0, False: 0]
  |  Branch (367:38): [True: 0, False: 0]
  ------------------
  368|      0|            const QLocaleId &key = pairs->key;
  369|      0|            Q_ASSERT(!key.language_id);
  370|      0|            if (key.script_id && key.script_id != script_id)
  ------------------
  |  Branch (370:17): [True: 0, False: 0]
  |  Branch (370:34): [True: 0, False: 0]
  ------------------
  371|      0|                continue;
  372|      0|            QLocaleId value = pairs->value;
  373|      0|            if (language_id)
  ------------------
  |  Branch (373:17): [True: 0, False: 0]
  ------------------
  374|      0|                value.language_id = language_id;
  375|      0|            if (script_id && !key.script_id)
  ------------------
  |  Branch (375:17): [True: 0, False: 0]
  |  Branch (375:30): [True: 0, False: 0]
  ------------------
  376|      0|                value.script_id = script_id;
  377|      0|            return value;
  378|      0|        }
  379|      0|    }
  380|       |    // und_script:
  381|      2|    if (script_id) {
  ------------------
  |  Branch (381:9): [True: 0, False: 2]
  ------------------
  382|      0|        sought.key = QLocaleId { 0, script_id, 0 };
  383|      0|        pairs = std::lower_bound(pairs, afterPairs, sought);
  384|      0|        if (pairs < afterPairs && pairs->key.script_id == script_id) {
  ------------------
  |  Branch (384:13): [True: 0, False: 0]
  |  Branch (384:35): [True: 0, False: 0]
  ------------------
  385|      0|            Q_ASSERT(!pairs->key.language_id && !pairs->key.territory_id);
  386|      0|            QLocaleId value = pairs->value;
  387|      0|            if (language_id)
  ------------------
  |  Branch (387:17): [True: 0, False: 0]
  ------------------
  388|      0|                value.language_id = language_id;
  389|      0|            if (territory_id)
  ------------------
  |  Branch (389:17): [True: 0, False: 0]
  ------------------
  390|      0|                value.territory_id = territory_id;
  391|      0|            return value;
  392|      0|        }
  393|      0|    }
  394|       |    // Finally, fall back to the match-all rule (if there is one):
  395|      2|    pairs = afterPairs - 1; // All other keys are < match-all.
  396|      2|    if (pairs->key.matchesAll()) {
  ------------------
  |  Branch (396:9): [True: 2, False: 0]
  ------------------
  397|      2|        QLocaleId value = pairs->value;
  398|      2|        if (language_id)
  ------------------
  |  Branch (398:13): [True: 2, False: 0]
  ------------------
  399|      2|            value.language_id = language_id;
  400|      2|        if (territory_id)
  ------------------
  |  Branch (400:13): [True: 0, False: 2]
  ------------------
  401|      0|            value.territory_id = territory_id;
  402|      2|        if (script_id)
  ------------------
  |  Branch (402:13): [True: 0, False: 2]
  ------------------
  403|      0|            value.script_id = script_id;
  404|      2|        return value;
  405|      2|    }
  406|      0|    return *this;
  407|      2|}
_ZN11QLocaleData15findLocaleIndexE9QLocaleId:
  579|      2|{
  580|      2|    QLocaleId localeId = lid;
  581|      2|    QLocaleId likelyId = localeId.withLikelySubtagsAdded();
  582|      2|    const ushort fallback = likelyId.language_id;
  583|       |
  584|       |    // Try a straight match with the likely data:
  585|      2|    qsizetype index = findLocaleIndexById(likelyId);
  586|      2|    if (index >= 0)
  ------------------
  |  Branch (586:9): [True: 2, False: 0]
  ------------------
  587|      2|        return index;
  588|      0|    QVarLengthArray<QLocaleId, 6> tried;
  589|      0|    tried.push_back(likelyId);
  590|       |
  591|      0|#define CheckCandidate(id) do { \
  592|      0|        if (!tried.contains(id)) { \
  593|      0|            index = findLocaleIndexById(id); \
  594|      0|            if (index >= 0) \
  595|      0|                return index; \
  596|      0|            tried.push_back(id); \
  597|      0|        } \
  598|      0|    } while (false) // end CheckCandidate
  599|       |
  600|       |    // No match; try again with raw data:
  601|      0|    CheckCandidate(localeId);
  ------------------
  |  |  591|      0|#define CheckCandidate(id) do { \
  |  |  592|      0|        if (!tried.contains(id)) { \
  |  |  ------------------
  |  |  |  Branch (592:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  593|      0|            index = findLocaleIndexById(id); \
  |  |  594|      0|            if (index >= 0) \
  |  |  ------------------
  |  |  |  Branch (594:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  595|      0|                return index; \
  |  |  596|      0|            tried.push_back(id); \
  |  |  597|      0|        } \
  |  |  598|      0|    } while (false) // end CheckCandidate
  |  |  ------------------
  |  |  |  Branch (598:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  602|       |
  603|       |    // No match; try again with likely country for language_script
  604|      0|    if (lid.territory_id && (lid.language_id || lid.script_id)) {
  ------------------
  |  Branch (604:9): [True: 0, False: 0]
  |  Branch (604:30): [True: 0, False: 0]
  |  Branch (604:49): [True: 0, False: 0]
  ------------------
  605|      0|        localeId.territory_id = 0;
  606|      0|        likelyId = localeId.withLikelySubtagsAdded();
  607|      0|        CheckCandidate(likelyId);
  ------------------
  |  |  591|      0|#define CheckCandidate(id) do { \
  |  |  592|      0|        if (!tried.contains(id)) { \
  |  |  ------------------
  |  |  |  Branch (592:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  593|      0|            index = findLocaleIndexById(id); \
  |  |  594|      0|            if (index >= 0) \
  |  |  ------------------
  |  |  |  Branch (594:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  595|      0|                return index; \
  |  |  596|      0|            tried.push_back(id); \
  |  |  597|      0|        } \
  |  |  598|      0|    } while (false) // end CheckCandidate
  |  |  ------------------
  |  |  |  Branch (598:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  608|       |
  609|       |        // No match; try again with any country
  610|      0|        CheckCandidate(localeId);
  ------------------
  |  |  591|      0|#define CheckCandidate(id) do { \
  |  |  592|      0|        if (!tried.contains(id)) { \
  |  |  ------------------
  |  |  |  Branch (592:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  593|      0|            index = findLocaleIndexById(id); \
  |  |  594|      0|            if (index >= 0) \
  |  |  ------------------
  |  |  |  Branch (594:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  595|      0|                return index; \
  |  |  596|      0|            tried.push_back(id); \
  |  |  597|      0|        } \
  |  |  598|      0|    } while (false) // end CheckCandidate
  |  |  ------------------
  |  |  |  Branch (598:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  611|      0|    }
  612|       |
  613|       |    // No match; try again with likely script for language_region
  614|      0|    if (lid.script_id && (lid.language_id || lid.territory_id)) {
  ------------------
  |  Branch (614:9): [True: 0, False: 0]
  |  Branch (614:27): [True: 0, False: 0]
  |  Branch (614:46): [True: 0, False: 0]
  ------------------
  615|      0|        localeId = QLocaleId { lid.language_id, 0, lid.territory_id };
  616|      0|        likelyId = localeId.withLikelySubtagsAdded();
  617|      0|        CheckCandidate(likelyId);
  ------------------
  |  |  591|      0|#define CheckCandidate(id) do { \
  |  |  592|      0|        if (!tried.contains(id)) { \
  |  |  ------------------
  |  |  |  Branch (592:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  593|      0|            index = findLocaleIndexById(id); \
  |  |  594|      0|            if (index >= 0) \
  |  |  ------------------
  |  |  |  Branch (594:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  595|      0|                return index; \
  |  |  596|      0|            tried.push_back(id); \
  |  |  597|      0|        } \
  |  |  598|      0|    } while (false) // end CheckCandidate
  |  |  ------------------
  |  |  |  Branch (598:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  618|       |
  619|       |        // No match; try again with any script
  620|      0|        CheckCandidate(localeId);
  ------------------
  |  |  591|      0|#define CheckCandidate(id) do { \
  |  |  592|      0|        if (!tried.contains(id)) { \
  |  |  ------------------
  |  |  |  Branch (592:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  593|      0|            index = findLocaleIndexById(id); \
  |  |  594|      0|            if (index >= 0) \
  |  |  ------------------
  |  |  |  Branch (594:17): [True: 0, False: 0]
  |  |  ------------------
  |  |  595|      0|                return index; \
  |  |  596|      0|            tried.push_back(id); \
  |  |  597|      0|        } \
  |  |  598|      0|    } while (false) // end CheckCandidate
  |  |  ------------------
  |  |  |  Branch (598:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  621|      0|    }
  622|      0|#undef CheckCandidate
  623|       |
  624|       |    // No match; return base index for initial likely language:
  625|      0|    return locale_index[fallback];
  626|      0|}
_Z18qt_splitLocaleName11QStringViewPS_S0_S0_:
  650|      1|{
  651|       |    // Assume each of lang, script and land is nullptr or points to an empty QStringView.
  652|      1|    enum ParserState { NoState, LangState, ScriptState, CountryState };
  653|      1|    ParserState state = LangState;
  654|      1|    while (name.size() && state != NoState) {
  ------------------
  |  Branch (654:12): [True: 0, False: 1]
  |  Branch (654:27): [True: 0, False: 0]
  ------------------
  655|      0|        const QStringView tag = findTag(name);
  656|      0|        if (!validTag(tag))
  ------------------
  |  Branch (656:13): [True: 0, False: 0]
  ------------------
  657|      0|            break;
  658|      0|        name = name.sliced(tag.size());
  659|      0|        const bool sep = name.size() > 0;
  660|      0|        if (sep) // tag wasn't all that remained; there was a separator
  ------------------
  |  Branch (660:13): [True: 0, False: 0]
  ------------------
  661|      0|            name = name.sliced(1);
  662|       |
  663|      0|        switch (state) {
  ------------------
  |  Branch (663:17): [True: 0, False: 0]
  ------------------
  664|      0|        case LangState:
  ------------------
  |  Branch (664:9): [True: 0, False: 0]
  ------------------
  665|      0|            if (tag.size() != 2 && tag.size() != 3)
  ------------------
  |  Branch (665:17): [True: 0, False: 0]
  |  Branch (665:36): [True: 0, False: 0]
  ------------------
  666|      0|                return false;
  667|      0|            if (lang)
  ------------------
  |  Branch (667:17): [True: 0, False: 0]
  ------------------
  668|      0|                *lang = tag;
  669|      0|            state = sep ? ScriptState : NoState;
  ------------------
  |  Branch (669:21): [True: 0, False: 0]
  ------------------
  670|      0|            break;
  671|      0|        case ScriptState:
  ------------------
  |  Branch (671:9): [True: 0, False: 0]
  ------------------
  672|      0|            if (scriptIndex(tag, Qt::CaseSensitive) >= 0) {
  ------------------
  |  Branch (672:17): [True: 0, False: 0]
  ------------------
  673|      0|                if (script)
  ------------------
  |  Branch (673:21): [True: 0, False: 0]
  ------------------
  674|      0|                    *script = tag;
  675|      0|                state = sep ? CountryState : NoState;
  ------------------
  |  Branch (675:25): [True: 0, False: 0]
  ------------------
  676|      0|                break;
  677|      0|            }
  678|       |            // It wasn't a script, assume it's a country.
  679|      0|            Q_FALLTHROUGH();
  680|      0|        case CountryState:
  ------------------
  |  Branch (680:9): [True: 0, False: 0]
  ------------------
  681|      0|            if (land)
  ------------------
  |  Branch (681:17): [True: 0, False: 0]
  ------------------
  682|      0|                *land = tag;
  683|      0|            state = NoState;
  684|      0|            break;
  685|      0|        case NoState: // Precluded by loop condition !
  ------------------
  |  Branch (685:9): [True: 0, False: 0]
  ------------------
  686|      0|            Q_UNREACHABLE();
  687|      0|            break;
  688|      0|        }
  689|      0|    }
  690|      1|    return state != LangState;
  691|      1|}
_ZN9QLocaleId8fromNameE11QStringView:
  694|      1|{
  695|      1|    QStringView lang;
  696|      1|    QStringView script;
  697|      1|    QStringView land;
  698|      1|    if (!qt_splitLocaleName(name, &lang, &script, &land))
  ------------------
  |  Branch (698:9): [True: 1, False: 0]
  ------------------
  699|      1|        return { QLocale::C, 0, 0 };
  700|       |
  701|       |    // POSIX is a variant, but looks like a territory.
  702|      0|    if (land.compare("POSIX", Qt::CaseInsensitive) == 0)
  ------------------
  |  Branch (702:9): [True: 0, False: 0]
  ------------------
  703|      0|        return { QLocale::C, 0, 0 };
  704|       |
  705|      0|    QLocale::Language langId = QLocalePrivate::codeToLanguage(lang);
  706|      0|    if (langId == QLocale::AnyLanguage)
  ------------------
  |  Branch (706:9): [True: 0, False: 0]
  ------------------
  707|      0|        return { QLocale::C, 0, 0 };
  708|      0|    return { langId, QLocalePrivate::codeToScript(script), QLocalePrivate::codeToTerritory(land) };
  709|      0|}
_ZN13QSystemLocaleC2Ev:
  816|      1|QSystemLocale::QSystemLocale() : next(_systemLocale)
  817|      1|{
  818|      1|    _systemLocale = this;
  819|       |
  820|      1|    systemLocaleData.m_language_id = 0;
  821|      1|}
_ZN13QSystemLocaleD2Ev:
  828|      1|{
  829|      1|    if (_systemLocale == this) {
  ------------------
  |  Branch (829:9): [True: 1, False: 0]
  ------------------
  830|      1|        _systemLocale = next;
  831|       |
  832|       |        // Change to system locale => force refresh.
  833|      1|        systemLocaleData.m_language_id = 0;
  834|      1|    } else {
  835|      0|        for (QSystemLocale *p = _systemLocale; p; p = p->next) {
  ------------------
  |  Branch (835:48): [True: 0, False: 0]
  ------------------
  836|      0|            if (p->next == this)
  ------------------
  |  Branch (836:17): [True: 0, False: 0]
  ------------------
  837|      0|                p->next = next;
  838|      0|        }
  839|      0|    }
  840|      1|}
_ZN7QLocaleC2E11QStringView:
 1195|      9|    : d(localePrivateByName(name))
 1196|      9|{
 1197|      9|}
_ZN7QLocaleC2Ev:
 1214|      2|    : d(c_private())
 1215|      2|{
 1216|      2|    if (!defaultLocalePrivate.isDestroyed()) {
  ------------------
  |  Branch (1216:9): [True: 2, False: 0]
  ------------------
 1217|       |        // Make sure system data is up to date:
 1218|      2|        systemData();
 1219|      2|        d = *defaultLocalePrivate;
 1220|      2|    }
 1221|      2|}
_ZN7QLocaleC2ENS_8LanguageENS_6ScriptENS_7CountryE:
 1260|   186k|    : d(findLocalePrivate(language, script, territory))
 1261|   186k|{
 1262|   186k|}
_ZN7QLocaleD2Ev:
 1275|   186k|{
 1276|   186k|}
_ZN7QLocaleaSERKS_:
 1283|      1|QLocale &QLocale::operator=(const QLocale &other) noexcept = default;
qlocale.cpp:_ZL19findLocaleIndexById9QLocaleId:
  499|      2|{
  500|      2|    qsizetype idx = locale_index[localeId.language_id];
  501|       |    // If there are no locales for specified language (so we we've got the
  502|       |    // default language, which has no associated script or country), give up:
  503|      2|    if (localeId.language_id && idx == 0)
  ------------------
  |  Branch (503:9): [True: 2, False: 0]
  |  Branch (503:33): [True: 2, False: 0]
  ------------------
  504|      2|        return idx;
  505|       |
  506|      0|    Q_ASSERT(localeId.acceptLanguage(locale_data[idx].m_language_id));
  507|       |
  508|      0|    do {
  509|      0|        if (localeId.acceptScriptTerritory(locale_data[idx].id()))
  ------------------
  |  Branch (509:13): [True: 0, False: 0]
  ------------------
  510|      0|            return idx;
  511|      0|        ++idx;
  512|      0|    } while (localeId.acceptLanguage(locale_data[idx].m_language_id));
  ------------------
  |  Branch (512:14): [True: 0, False: 0]
  ------------------
  513|       |
  514|      0|    return -1;
  515|      0|}
qlocale.cpp:_ZL9c_privatev:
  776|   186k|{
  777|   186k|    Q_CONSTINIT static QLocalePrivate c_locale(locale_data, 0, QLocale::OmitGroupSeparator, 1);
  778|   186k|    return &c_locale;
  779|   186k|}
qlocale.cpp:_ZL11defaultDatav:
  930|      3|{
  931|      3|    if (!default_data)
  ------------------
  |  Branch (931:9): [True: 1, False: 2]
  ------------------
  932|      1|        default_data = systemData();
  933|      3|    return default_data;
  934|      3|}
qlocale.cpp:_ZL12systemLocalev:
  843|      1|{
  844|      1|    if (_systemLocale)
  ------------------
  |  Branch (844:9): [True: 0, False: 1]
  ------------------
  845|      0|        return _systemLocale;
  846|       |
  847|       |    // As this is only ever instantiated with _systemLocale null, it is
  848|       |    // necessarily the ->next-most in any chain that may subsequently develop;
  849|       |    // and it won't be destructed until exit()-time.
  850|      1|    static QSystemLocale globalInstance;
  851|      1|    return &globalInstance;
  852|      1|}
qlocale.cpp:_ZL19localePrivateByName11QStringView:
  979|      9|{
  980|      9|    if (name == u"C")
  ------------------
  |  Branch (980:9): [True: 8, False: 1]
  ------------------
  981|      8|        return c_private();
  982|      1|    const qsizetype index = QLocaleData::findLocaleIndex(QLocaleId::fromName(name));
  983|      1|    Q_ASSERT(index >= 0 && index < locale_data_size);
  984|      1|    return new QLocalePrivate(locale_data + index, index,
  985|      1|                              defaultNumberOptions(locale_data[index].m_language_id));
  986|      9|}
qlocale.cpp:_ZL10systemDataPx:
  890|      3|{
  891|      3|#ifndef QT_NO_SYSTEMLOCALE
  892|       |    /*
  893|       |      Copy over the information from the fallback locale and modify.
  894|       |
  895|       |      If sysIndex is passed, it should be the m_index of the system locale's
  896|       |      QLocalePrivate, which we'll update if it needs it.
  897|       |
  898|       |      This modifies (cross-thread) global state, so is mutex-protected.
  899|       |    */
  900|      3|    {
  901|      3|        Q_CONSTINIT static QLocaleId sysId;
  902|      3|        bool updated = false;
  903|       |
  904|      3|        Q_CONSTINIT static QBasicMutex systemDataMutex;
  905|      3|        systemDataMutex.lock();
  906|      3|        if (systemLocaleData.m_language_id == 0) {
  ------------------
  |  Branch (906:13): [True: 1, False: 2]
  ------------------
  907|      1|            updateSystemPrivate();
  908|      1|            updated = true;
  909|      1|        }
  910|       |        // Initialization of system private has *sysIndex == -1 to hit this.
  911|      3|        if (sysIndex && (updated || *sysIndex < 0)) {
  ------------------
  |  Branch (911:13): [True: 0, False: 3]
  |  Branch (911:26): [True: 0, False: 0]
  |  Branch (911:37): [True: 0, False: 0]
  ------------------
  912|      0|            const QLocaleId nowId = systemLocaleData.id();
  913|      0|            if (sysId != nowId || *sysIndex < 0) {
  ------------------
  |  Branch (913:17): [True: 0, False: 0]
  |  Branch (913:35): [True: 0, False: 0]
  ------------------
  914|       |                // This look-up may be expensive:
  915|      0|                *sysIndex = QLocaleData::findLocaleIndex(nowId);
  916|      0|                sysId = nowId;
  917|      0|            }
  918|      0|        }
  919|      3|        systemDataMutex.unlock();
  920|      3|    }
  921|       |
  922|      3|    return &systemLocaleData;
  923|       |#else
  924|       |    Q_UNUSED(sysIndex);
  925|       |    return locale_data;
  926|       |#endif
  927|      3|}
qlocale.cpp:_ZL19updateSystemPrivatev:
  855|      1|{
  856|       |    // This function is NOT thread-safe!
  857|       |    // It *should not* be called by anything but systemData()
  858|       |    // It *is* called before {system,default}LocalePrivate exist.
  859|      1|    const QSystemLocale *sys_locale = systemLocale();
  860|       |
  861|       |    // tell the object that the system locale has changed.
  862|      1|    sys_locale->query(QSystemLocale::LocaleChanged);
  863|       |
  864|       |    // Populate system locale with fallback as basis
  865|      1|    systemLocaleData = locale_data[sys_locale->fallbackLocaleIndex()];
  866|       |
  867|      1|    QVariant res = sys_locale->query(QSystemLocale::LanguageId);
  868|      1|    if (!res.isNull()) {
  ------------------
  |  Branch (868:9): [True: 0, False: 1]
  ------------------
  869|      0|        systemLocaleData.m_language_id = res.toInt();
  870|      0|        systemLocaleData.m_script_id = QLocale::AnyScript; // default for compatibility
  871|      0|    }
  872|      1|    res = sys_locale->query(QSystemLocale::TerritoryId);
  873|      1|    if (!res.isNull()) {
  ------------------
  |  Branch (873:9): [True: 0, False: 1]
  ------------------
  874|      0|        systemLocaleData.m_territory_id = res.toInt();
  875|      0|        systemLocaleData.m_script_id = QLocale::AnyScript; // default for compatibility
  876|      0|    }
  877|      1|    res = sys_locale->query(QSystemLocale::ScriptId);
  878|      1|    if (!res.isNull())
  ------------------
  |  Branch (878:9): [True: 0, False: 1]
  ------------------
  879|      0|        systemLocaleData.m_script_id = res.toInt();
  880|       |
  881|       |    // Should we replace Any values based on likely sub-tags ?
  882|       |
  883|       |    // If system locale is default locale, update the default collator's generation:
  884|      1|    if (default_data == &systemLocaleData)
  ------------------
  |  Branch (884:9): [True: 0, False: 1]
  ------------------
  885|      0|        QLocalePrivate::s_generation.fetchAndAddRelaxed(1);
  886|      1|}
qlocale.cpp:_ZL17findLocalePrivateN7QLocale8LanguageENS_6ScriptENS_7CountryE:
  990|   186k|{
  991|   186k|    if (language == QLocale::C)
  ------------------
  |  Branch (991:9): [True: 186k, False: 0]
  ------------------
  992|   186k|        return c_private();
  993|       |
  994|      0|    qsizetype index = QLocaleData::findLocaleIndex(QLocaleId { language, script, territory });
  995|      0|    Q_ASSERT(index >= 0 && index < locale_data_size);
  996|      0|    const QLocaleData *data = locale_data + index;
  997|       |
  998|      0|    QLocale::NumberOptions numberOptions = QLocale::DefaultNumberOptions;
  999|       |
 1000|       |    // If not found, should use default locale:
 1001|      0|    if (data->m_language_id == QLocale::C) {
  ------------------
  |  Branch (1001:9): [True: 0, False: 0]
  ------------------
 1002|      0|        if (defaultLocalePrivate.exists())
  ------------------
  |  Branch (1002:13): [True: 0, False: 0]
  ------------------
 1003|      0|            numberOptions = defaultLocalePrivate->data()->m_numberOptions;
 1004|      0|        data = defaultData();
 1005|      0|        index = defaultIndex();
 1006|      0|    }
 1007|      0|    return new QLocalePrivate(data, index, numberOptions);
 1008|   186k|}
qlocale.cpp:_ZL12defaultIndexv:
  937|      1|{
  938|      1|    const QLocaleData *const data = defaultData();
  939|      1|#ifndef QT_NO_SYSTEMLOCALE
  940|      1|    if (data == &systemLocaleData) {
  ------------------
  |  Branch (940:9): [True: 1, False: 0]
  ------------------
  941|       |        // Work out a suitable index matching the system data, for use when
  942|       |        // accessing calendar data, when not fetched from system.
  943|      1|        return QLocaleData::findLocaleIndex(data->id());
  944|      1|    }
  945|      0|#endif
  946|       |
  947|      0|    using QtPrivate::q_points_into_range;
  948|      0|    Q_ASSERT(q_points_into_range(data, locale_data));
  949|      0|    return data - locale_data;
  950|      1|}
qlocale.cpp:_ZL20defaultNumberOptionst:
  787|      2|{
  788|      2|    return defaultNumberOptions(QLocale::Language(forLanguage));
  789|      2|}
qlocale.cpp:_ZL20defaultNumberOptionsN7QLocale8LanguageE:
  782|      2|{
  783|      2|    return forLanguage == QLocale::C ? QLocale::OmitGroupSeparator : QLocale::DefaultNumberOptions;
  ------------------
  |  Branch (783:12): [True: 2, False: 0]
  ------------------
  784|      2|}
qlocale.cpp:_ZN12_GLOBAL__N_1ltENS_10LikelyPairES0_:
  278|     20|{
  279|       |    // Must match the comparison LocaleDataWriter.likelySubtags() uses when
  280|       |    // sorting, see qtbase/util/locale_database.qlocalexml2cpp.py
  281|     20|    const auto compare = [](int lhs, int rhs) {
  282|       |        // 0 sorts after all other values; lhs and rhs are passed ushort values.
  283|     20|        const int huge = 0x10000;
  284|     20|        return (lhs ? lhs : huge) - (rhs ? rhs : huge);
  285|     20|    };
  286|     20|    const auto &left = lhs.key;
  287|     20|    const auto &right = rhs.key;
  288|       |    // Comparison order: language, region, script:
  289|     20|    if (int cmp = compare(left.language_id, right.language_id))
  ------------------
  |  Branch (289:13): [True: 20, False: 0]
  ------------------
  290|     20|        return cmp < 0;
  291|      0|    if (int cmp = compare(left.territory_id, right.territory_id))
  ------------------
  |  Branch (291:13): [True: 0, False: 0]
  ------------------
  292|      0|        return cmp < 0;
  293|      0|    return compare(left.script_id, right.script_id) < 0;
  294|      0|}
qlocale.cpp:_ZZN12_GLOBAL__N_1ltENS_10LikelyPairES0_ENK3$_0clEii:
  281|     20|    const auto compare = [](int lhs, int rhs) {
  282|       |        // 0 sorts after all other values; lhs and rhs are passed ushort values.
  283|     20|        const int huge = 0x10000;
  284|     20|        return (lhs ? lhs : huge) - (rhs ? rhs : huge);
  ------------------
  |  Branch (284:17): [True: 20, False: 0]
  |  Branch (284:38): [True: 20, False: 0]
  ------------------
  285|     20|    };

_ZN7QLocale4swapERS_:
  930|      8|    void swap(QLocale &other) noexcept { d.swap(other.d); }
_ZN7QLocale1cEv:
 1149|   186k|    static QLocale c() { return QLocale(C); }
_ZN7QLocaleC2ERK7QString:
 1197|      9|    : QLocale(qToStringViewIgnoringNull(name)) {}

_ZNK9QLocaleId10matchesAllEv:
  202|      2|    {
  203|      2|        return !language_id && !script_id && !territory_id;
  ------------------
  |  Branch (203:16): [True: 2, False: 0]
  |  Branch (203:32): [True: 2, False: 0]
  |  Branch (203:46): [True: 2, False: 0]
  ------------------
  204|      2|    }
_ZNK11QLocaleData2idEv:
  397|      1|    { return QLocaleId { m_language_id, m_script_id, m_territory_id }; }
_ZN14QLocalePrivateC2EPK11QLocaleDatax6QFlagsIN7QLocale12NumberOptionEEi:
  523|      2|        : m_data(data), ref Q_BASIC_ATOMIC_INITIALIZER(refs),
  524|      2|          m_index(index), m_numberOptions(numberOptions) {}
_ZNK13QSystemLocale19fallbackLocaleIndexEv:
  568|      1|qsizetype QSystemLocale::fallbackLocaleIndex() const { return fallbackLocale().d->m_index; }

_ZN17QSystemLocaleData15readEnvironmentEv:
   43|      2|{
   44|      2|    QWriteLocker locker(&lock);
   45|       |
   46|       |    // See https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02
   47|       |    // for the semantics of each of these:
   48|      2|    QByteArray all = qgetenv("LC_ALL");
   49|      2|    QByteArray numeric  = all.isEmpty() ? qgetenv("LC_NUMERIC") : all;
  ------------------
  |  Branch (49:27): [True: 2, False: 0]
  ------------------
   50|      2|    QByteArray time     = all.isEmpty() ? qgetenv("LC_TIME") : all;
  ------------------
  |  Branch (50:27): [True: 2, False: 0]
  ------------------
   51|      2|    QByteArray monetary = all.isEmpty() ? qgetenv("LC_MONETARY") : all;
  ------------------
  |  Branch (51:27): [True: 2, False: 0]
  ------------------
   52|      2|    lc_messages_var     = all.isEmpty() ? qgetenv("LC_MESSAGES") : all;
  ------------------
  |  Branch (52:27): [True: 2, False: 0]
  ------------------
   53|      2|    lc_measurement_var  = all.isEmpty() ? qgetenv("LC_MEASUREMENT") : all;
  ------------------
  |  Branch (53:27): [True: 2, False: 0]
  ------------------
   54|      2|    lc_collate_var      = all.isEmpty() ? qgetenv("LC_COLLATE") : all;
  ------------------
  |  Branch (54:27): [True: 2, False: 0]
  ------------------
   55|      2|    QByteArray lang = qgetenv("LANG");
   56|      2|    if (lang.isEmpty())
  ------------------
  |  Branch (56:9): [True: 2, False: 0]
  ------------------
   57|      2|        lang = QByteArray("C");
   58|      2|    if (numeric.isEmpty())
  ------------------
  |  Branch (58:9): [True: 2, False: 0]
  ------------------
   59|      2|        numeric = lang;
   60|      2|    if (time.isEmpty())
  ------------------
  |  Branch (60:9): [True: 2, False: 0]
  ------------------
   61|      2|        time = lang;
   62|      2|    if (monetary.isEmpty())
  ------------------
  |  Branch (62:9): [True: 2, False: 0]
  ------------------
   63|      2|        monetary = lang;
   64|      2|    if (lc_messages_var.isEmpty())
  ------------------
  |  Branch (64:9): [True: 2, False: 0]
  ------------------
   65|      2|        lc_messages_var = lang;
   66|      2|    if (lc_measurement_var.isEmpty())
  ------------------
  |  Branch (66:9): [True: 2, False: 0]
  ------------------
   67|      2|        lc_measurement_var = lang;
   68|      2|    if (lc_collate_var.isEmpty())
  ------------------
  |  Branch (68:9): [True: 2, False: 0]
  ------------------
   69|      2|        lc_collate_var = lang;
   70|      2|    lc_numeric = QLocale(QString::fromLatin1(numeric));
   71|      2|    lc_time = QLocale(QString::fromLatin1(time));
   72|      2|    lc_monetary = QLocale(QString::fromLatin1(monetary));
   73|      2|    lc_messages = QLocale(QString::fromLatin1(lc_messages_var));
   74|      2|}
_ZNK13QSystemLocale14fallbackLocaleEv:
  105|      1|{
  106|       |    // See man 7 locale for precedence - LC_ALL beats LC_MESSAGES beats LANG:
  107|      1|    QString lang = qEnvironmentVariable("LC_ALL");
  108|      1|    if (lang.isEmpty())
  ------------------
  |  Branch (108:9): [True: 1, False: 0]
  ------------------
  109|      1|        lang = qEnvironmentVariable("LC_MESSAGES");
  110|      1|    if (lang.isEmpty())
  ------------------
  |  Branch (110:9): [True: 1, False: 0]
  ------------------
  111|      1|        lang = qEnvironmentVariable("LANG");
  112|       |    // if the locale is the "C" locale, then we can return the language we found here:
  113|      1|    if (lang.isEmpty() || lang == "C"_L1 || lang == "POSIX"_L1)
  ------------------
  |  Branch (113:9): [True: 1, False: 0]
  |  Branch (113:9): [True: 1, False: 0]
  |  Branch (113:27): [True: 0, False: 0]
  |  Branch (113:45): [True: 0, False: 0]
  ------------------
  114|      1|        return QLocale(lang);
  115|       |
  116|       |    // ... otherwise, if the first part of LANGUAGE says more than or
  117|       |    // contradicts what we have, use that:
  118|      0|    for (const auto &language : qEnvironmentVariable("LANGUAGE").tokenize(u':')) {
  ------------------
  |  Branch (118:31): [True: 0, False: 0]
  ------------------
  119|      0|        if (contradicts(language, lang))
  ------------------
  |  Branch (119:13): [True: 0, False: 0]
  ------------------
  120|      0|            return QLocale(language);
  121|      0|        break; // We only look at the first entry.
  122|      0|    }
  123|       |
  124|      0|    return QLocale(lang);
  125|      0|}
_ZNK13QSystemLocale5queryENS_9QueryTypeEO8QVariant:
  128|      4|{
  129|      4|    QSystemLocaleData *d = qSystemLocaleData();
  130|       |
  131|      4|    if (type == LocaleChanged) {
  ------------------
  |  Branch (131:9): [True: 1, False: 3]
  ------------------
  132|      1|        d->readEnvironment();
  133|      1|        return QVariant();
  134|      1|    }
  135|       |
  136|      3|    QReadLocker locker(&d->lock);
  137|       |
  138|      3|    const QLocale &lc_numeric = d->lc_numeric;
  139|      3|    const QLocale &lc_time = d->lc_time;
  140|      3|    const QLocale &lc_monetary = d->lc_monetary;
  141|      3|    const QLocale &lc_messages = d->lc_messages;
  142|       |
  143|      3|    switch (type) {
  144|      0|    case DecimalPoint:
  ------------------
  |  Branch (144:5): [True: 0, False: 3]
  ------------------
  145|      0|        return lc_numeric.decimalPoint();
  146|      0|    case Grouping:
  ------------------
  |  Branch (146:5): [True: 0, False: 3]
  ------------------
  147|      0|        return QVariant::fromValue(lc_numeric.d->m_data->groupSizes());
  148|      0|    case GroupSeparator:
  ------------------
  |  Branch (148:5): [True: 0, False: 3]
  ------------------
  149|      0|        return lc_numeric.groupSeparator();
  150|      0|    case ZeroDigit:
  ------------------
  |  Branch (150:5): [True: 0, False: 3]
  ------------------
  151|      0|        return lc_numeric.zeroDigit();
  152|      0|    case NegativeSign:
  ------------------
  |  Branch (152:5): [True: 0, False: 3]
  ------------------
  153|      0|        return lc_numeric.negativeSign();
  154|      0|    case DateFormatLong:
  ------------------
  |  Branch (154:5): [True: 0, False: 3]
  ------------------
  155|      0|        return lc_time.dateFormat(QLocale::LongFormat);
  156|      0|    case DateFormatShort:
  ------------------
  |  Branch (156:5): [True: 0, False: 3]
  ------------------
  157|      0|        return lc_time.dateFormat(QLocale::ShortFormat);
  158|      0|    case TimeFormatLong:
  ------------------
  |  Branch (158:5): [True: 0, False: 3]
  ------------------
  159|      0|        return lc_time.timeFormat(QLocale::LongFormat);
  160|      0|    case TimeFormatShort:
  ------------------
  |  Branch (160:5): [True: 0, False: 3]
  ------------------
  161|      0|        return lc_time.timeFormat(QLocale::ShortFormat);
  162|      0|    case DayNameLong:
  ------------------
  |  Branch (162:5): [True: 0, False: 3]
  ------------------
  163|      0|        return lc_time.dayName(in.toInt(), QLocale::LongFormat);
  164|      0|    case DayNameShort:
  ------------------
  |  Branch (164:5): [True: 0, False: 3]
  ------------------
  165|      0|        return lc_time.dayName(in.toInt(), QLocale::ShortFormat);
  166|      0|    case DayNameNarrow:
  ------------------
  |  Branch (166:5): [True: 0, False: 3]
  ------------------
  167|      0|        return lc_time.dayName(in.toInt(), QLocale::NarrowFormat);
  168|      0|    case StandaloneDayNameLong:
  ------------------
  |  Branch (168:5): [True: 0, False: 3]
  ------------------
  169|      0|        return lc_time.standaloneDayName(in.toInt(), QLocale::LongFormat);
  170|      0|    case StandaloneDayNameShort:
  ------------------
  |  Branch (170:5): [True: 0, False: 3]
  ------------------
  171|      0|        return lc_time.standaloneDayName(in.toInt(), QLocale::ShortFormat);
  172|      0|    case StandaloneDayNameNarrow:
  ------------------
  |  Branch (172:5): [True: 0, False: 3]
  ------------------
  173|      0|        return lc_time.standaloneDayName(in.toInt(), QLocale::NarrowFormat);
  174|      0|    case MonthNameLong:
  ------------------
  |  Branch (174:5): [True: 0, False: 3]
  ------------------
  175|      0|        return lc_time.monthName(in.toInt(), QLocale::LongFormat);
  176|      0|    case MonthNameShort:
  ------------------
  |  Branch (176:5): [True: 0, False: 3]
  ------------------
  177|      0|        return lc_time.monthName(in.toInt(), QLocale::ShortFormat);
  178|      0|    case MonthNameNarrow:
  ------------------
  |  Branch (178:5): [True: 0, False: 3]
  ------------------
  179|      0|        return lc_time.monthName(in.toInt(), QLocale::NarrowFormat);
  180|      0|    case StandaloneMonthNameLong:
  ------------------
  |  Branch (180:5): [True: 0, False: 3]
  ------------------
  181|      0|        return lc_time.standaloneMonthName(in.toInt(), QLocale::LongFormat);
  182|      0|    case StandaloneMonthNameShort:
  ------------------
  |  Branch (182:5): [True: 0, False: 3]
  ------------------
  183|      0|        return lc_time.standaloneMonthName(in.toInt(), QLocale::ShortFormat);
  184|      0|    case StandaloneMonthNameNarrow:
  ------------------
  |  Branch (184:5): [True: 0, False: 3]
  ------------------
  185|      0|        return lc_time.standaloneMonthName(in.toInt(), QLocale::NarrowFormat);
  186|      0|    case DateToStringLong:
  ------------------
  |  Branch (186:5): [True: 0, False: 3]
  ------------------
  187|      0|        return lc_time.toString(in.toDate(), QLocale::LongFormat);
  188|      0|    case DateToStringShort:
  ------------------
  |  Branch (188:5): [True: 0, False: 3]
  ------------------
  189|      0|        return lc_time.toString(in.toDate(), QLocale::ShortFormat);
  190|      0|    case TimeToStringLong:
  ------------------
  |  Branch (190:5): [True: 0, False: 3]
  ------------------
  191|      0|        return lc_time.toString(in.toTime(), QLocale::LongFormat);
  192|      0|    case TimeToStringShort:
  ------------------
  |  Branch (192:5): [True: 0, False: 3]
  ------------------
  193|      0|        return lc_time.toString(in.toTime(), QLocale::ShortFormat);
  194|      0|    case DateTimeFormatLong:
  ------------------
  |  Branch (194:5): [True: 0, False: 3]
  ------------------
  195|      0|        return lc_time.dateTimeFormat(QLocale::LongFormat);
  196|      0|    case DateTimeFormatShort:
  ------------------
  |  Branch (196:5): [True: 0, False: 3]
  ------------------
  197|      0|        return lc_time.dateTimeFormat(QLocale::ShortFormat);
  198|      0|    case DateTimeToStringLong:
  ------------------
  |  Branch (198:5): [True: 0, False: 3]
  ------------------
  199|      0|        return lc_time.toString(in.toDateTime(), QLocale::LongFormat);
  200|      0|    case DateTimeToStringShort:
  ------------------
  |  Branch (200:5): [True: 0, False: 3]
  ------------------
  201|      0|        return lc_time.toString(in.toDateTime(), QLocale::ShortFormat);
  202|      0|    case PositiveSign:
  ------------------
  |  Branch (202:5): [True: 0, False: 3]
  ------------------
  203|      0|        return lc_numeric.positiveSign();
  204|      0|    case AMText:
  ------------------
  |  Branch (204:5): [True: 0, False: 3]
  ------------------
  205|      0|        return lc_time.amText();
  206|      0|    case PMText:
  ------------------
  |  Branch (206:5): [True: 0, False: 3]
  ------------------
  207|      0|        return lc_time.pmText();
  208|      0|    case FirstDayOfWeek:
  ------------------
  |  Branch (208:5): [True: 0, False: 3]
  ------------------
  209|      0|        return lc_time.firstDayOfWeek();
  210|      0|    case CurrencySymbol:
  ------------------
  |  Branch (210:5): [True: 0, False: 3]
  ------------------
  211|      0|        return lc_monetary.currencySymbol(QLocale::CurrencySymbolFormat(in.toUInt()));
  212|      0|    case CurrencyToString: {
  ------------------
  |  Branch (212:5): [True: 0, False: 3]
  ------------------
  213|      0|        switch (in.userType()) {
  214|      0|        case QMetaType::Int:
  ------------------
  |  Branch (214:9): [True: 0, False: 0]
  ------------------
  215|      0|            return lc_monetary.toCurrencyString(in.toInt());
  216|      0|        case QMetaType::UInt:
  ------------------
  |  Branch (216:9): [True: 0, False: 0]
  ------------------
  217|      0|            return lc_monetary.toCurrencyString(in.toUInt());
  218|      0|        case QMetaType::Double:
  ------------------
  |  Branch (218:9): [True: 0, False: 0]
  ------------------
  219|      0|            return lc_monetary.toCurrencyString(in.toDouble());
  220|      0|        case QMetaType::LongLong:
  ------------------
  |  Branch (220:9): [True: 0, False: 0]
  ------------------
  221|      0|            return lc_monetary.toCurrencyString(in.toLongLong());
  222|      0|        case QMetaType::ULongLong:
  ------------------
  |  Branch (222:9): [True: 0, False: 0]
  ------------------
  223|      0|            return lc_monetary.toCurrencyString(in.toULongLong());
  224|      0|        default:
  ------------------
  |  Branch (224:9): [True: 0, False: 0]
  ------------------
  225|      0|            break;
  226|      0|        }
  227|      0|        return QString();
  228|      0|    }
  229|      0|    case MeasurementSystem: {
  ------------------
  |  Branch (229:5): [True: 0, False: 3]
  ------------------
  230|      0|        const QString meas_locale = QString::fromLatin1(d->lc_measurement_var);
  231|      0|        if (meas_locale.compare("Metric"_L1, Qt::CaseInsensitive) == 0)
  ------------------
  |  Branch (231:13): [True: 0, False: 0]
  ------------------
  232|      0|            return QLocale::MetricSystem;
  233|      0|        if (meas_locale.compare("Other"_L1, Qt::CaseInsensitive) == 0)
  ------------------
  |  Branch (233:13): [True: 0, False: 0]
  ------------------
  234|      0|            return QLocale::MetricSystem;
  235|      0|        return QVariant((int)QLocale(meas_locale).measurementSystem());
  236|      0|    }
  237|      0|    case Collation:
  ------------------
  |  Branch (237:5): [True: 0, False: 3]
  ------------------
  238|      0|        return QString::fromLatin1(d->lc_collate_var);
  239|      0|    case UILanguages: {
  ------------------
  |  Branch (239:5): [True: 0, False: 3]
  ------------------
  240|      0|        if (!d->uiLanguages.isEmpty())
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            return d->uiLanguages;
  242|      0|        QString languages = QString::fromLatin1(qgetenv("LANGUAGE"));
  243|      0|        QStringList lst;
  244|      0|        if (languages.isEmpty())
  ------------------
  |  Branch (244:13): [True: 0, False: 0]
  ------------------
  245|      0|            lst.append(QString::fromLatin1(d->lc_messages_var));
  246|      0|        else
  247|      0|            lst = languages.split(u':');
  248|       |
  249|      0|        for (const QString &e : std::as_const(lst)) {
  ------------------
  |  Branch (249:31): [True: 0, False: 0]
  ------------------
  250|      0|            QStringView language, script, territory;
  251|      0|            if (qt_splitLocaleName(e, &language, &script, &territory)) {
  ------------------
  |  Branch (251:17): [True: 0, False: 0]
  ------------------
  252|      0|                QString joined = language.isEmpty() ? u"und"_s : language.toString();
  ------------------
  |  Branch (252:34): [True: 0, False: 0]
  ------------------
  253|      0|                if (!script.isEmpty())
  ------------------
  |  Branch (253:21): [True: 0, False: 0]
  ------------------
  254|      0|                    joined += u'-' + script;
  255|      0|                if (!territory.isEmpty())
  ------------------
  |  Branch (255:21): [True: 0, False: 0]
  ------------------
  256|      0|                    joined += u'-' + territory;
  257|      0|                d->uiLanguages.append(joined);
  258|      0|            }
  259|      0|        }
  260|      0|        return d->uiLanguages.isEmpty() ? QVariant() : QVariant(d->uiLanguages);
  ------------------
  |  Branch (260:16): [True: 0, False: 0]
  ------------------
  261|      0|    }
  262|      0|    case StringToStandardQuotation:
  ------------------
  |  Branch (262:5): [True: 0, False: 3]
  ------------------
  263|      0|        return lc_messages.quoteString(qvariant_cast<QStringView>(std::move(in)));
  264|      0|    case StringToAlternateQuotation:
  ------------------
  |  Branch (264:5): [True: 0, False: 3]
  ------------------
  265|      0|        return lc_messages.quoteString(qvariant_cast<QStringView>(std::move(in)),
  266|      0|                                       QLocale::AlternateQuotation);
  267|      0|    case ListToSeparatedString:
  ------------------
  |  Branch (267:5): [True: 0, False: 3]
  ------------------
  268|      0|        return lc_messages.createSeparatedList(in.toStringList());
  269|      0|    case LocaleChanged:
  ------------------
  |  Branch (269:5): [True: 0, False: 3]
  ------------------
  270|      0|        Q_ASSERT(false);
  271|      0|        [[fallthrough]];
  272|      3|    default:
  ------------------
  |  Branch (272:5): [True: 3, False: 0]
  ------------------
  273|      3|        break;
  274|      3|    }
  275|      3|    return QVariant();
  276|      3|}
_ZN17QSystemLocaleDataC2Ev:
   20|      1|        : lc_numeric(QLocale::C)
   21|      1|         ,lc_time(QLocale::C)
   22|      1|         ,lc_monetary(QLocale::C)
   23|      1|         ,lc_messages(QLocale::C)
   24|      1|    {
   25|      1|        readEnvironment();
   26|      1|    }

_ZN9QtPrivate8qustrchrE11QStringViewDs:
  688|      1|{
  689|      1|    const char16_t *n = str.utf16();
  690|      1|    const char16_t *e = n + str.size();
  691|       |
  692|      1|#ifdef __SSE2__
  693|      1|    bool loops = true;
  694|       |    // Using the PMOVMSKB instruction, we get two bits for each character
  695|       |    // we compare.
  696|      1|    __m128i mch;
  697|       |    if constexpr (UseAvx2) {
  698|       |        // we're going to read n[0..15] (32 bytes)
  699|       |        __m256i mch256 = _mm256_set1_epi32(c | (c << 16));
  700|       |        for (const char16_t *next = n + 16; next <= e; n = next, next += 16) {
  701|       |            __m256i data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(n));
  702|       |            __m256i result = _mm256_cmpeq_epi16(data, mch256);
  703|       |            uint mask = uint(_mm256_movemask_epi8(result));
  704|       |            if (mask) {
  705|       |                uint idx = qCountTrailingZeroBits(mask);
  706|       |                return n + idx / 2;
  707|       |            }
  708|       |        }
  709|       |        loops = false;
  710|       |        mch = _mm256_castsi256_si128(mch256);
  711|      1|    } else {
  712|      1|        mch = _mm_set1_epi32(c | (c << 16));
  713|      1|    }
  714|       |
  715|      1|    auto hasMatch = [mch, &n](__m128i data, ushort validityMask) {
  716|      1|        __m128i result = _mm_cmpeq_epi16(data, mch);
  717|      1|        uint mask = uint(_mm_movemask_epi8(result));
  718|      1|        if ((mask & validityMask) == 0)
  719|      1|            return false;
  720|      1|        uint idx = qCountTrailingZeroBits(mask);
  721|      1|        n += idx / 2;
  722|      1|        return true;
  723|      1|    };
  724|       |
  725|       |    // we're going to read n[0..7] (16 bytes)
  726|      2|    for (const char16_t *next = n + 8; next <= e; n = next, next += 8) {
  ------------------
  |  Branch (726:40): [True: 1, False: 1]
  ------------------
  727|      1|        __m128i data = _mm_loadu_si128(reinterpret_cast<const __m128i *>(n));
  728|      1|        if (hasMatch(data, 0xffff))
  ------------------
  |  Branch (728:13): [True: 0, False: 1]
  ------------------
  729|      0|            return n;
  730|       |
  731|      1|        if (!loops) {
  ------------------
  |  Branch (731:13): [True: 0, False: 1]
  ------------------
  732|      0|            n += 8;
  733|      0|            break;
  734|      0|        }
  735|      1|    }
  736|       |
  737|      1|#  if !defined(__OPTIMIZE_SIZE__)
  738|       |    // we're going to read n[0..3] (8 bytes)
  739|      1|    if (e - n > 3) {
  ------------------
  |  Branch (739:9): [True: 1, False: 0]
  ------------------
  740|      1|        __m128i data = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(n));
  741|      1|        if (hasMatch(data, 0xff))
  ------------------
  |  Branch (741:13): [True: 0, False: 1]
  ------------------
  742|      0|            return n;
  743|       |
  744|      1|        n += 4;
  745|      1|    }
  746|       |
  747|      1|    return UnrollTailLoop<3>::exec(e - n, e,
  748|      1|                                   [=](qsizetype i) { return n[i] == c; },
  749|      1|                                   [=](qsizetype i) { return n + i; });
  750|      0|#  endif
  751|       |#elif defined(__ARM_NEON__)
  752|       |    const uint16x8_t vmask = qvsetq_n_u16(1, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7);
  753|       |    const uint16x8_t ch_vec = vdupq_n_u16(c);
  754|       |    for (const char16_t *next = n + 8; next <= e; n = next, next += 8) {
  755|       |        uint16x8_t data = vld1q_u16(reinterpret_cast<const uint16_t *>(n));
  756|       |        uint mask = vaddvq_u16(vandq_u16(vceqq_u16(data, ch_vec), vmask));
  757|       |        if (ushort(mask)) {
  758|       |            // found a match
  759|       |            return n + qCountTrailingZeroBits(mask);
  760|       |        }
  761|       |    }
  762|       |#endif // aarch64
  763|       |
  764|      0|    return std::find(n, e, c);
  765|      1|}
_Z14qt_from_latin1PDsPKcm:
  921|     11|{
  922|       |    /* SIMD:
  923|       |     * Unpacking with SSE has been shown to improve performance on recent CPUs
  924|       |     * The same method gives no improvement with NEON. On Aarch64, clang will do the vectorization
  925|       |     * itself in exactly the same way as one would do it with intrinsics.
  926|       |     */
  927|     11|#if defined(__SSE2__)
  928|       |    // we're going to read str[offset..offset+15] (16 bytes)
  929|     11|    const __m128i nullMask = _mm_setzero_si128();
  930|     11|    auto processOneChunk = [=](qptrdiff offset) {
  931|     11|        const __m128i chunk = _mm_loadu_si128((const __m128i*)(str + offset)); // load
  932|     11|        if constexpr (UseAvx2) {
  933|       |            // zero extend to an YMM register
  934|     11|            const __m256i extended = _mm256_cvtepu8_epi16(chunk);
  935|       |
  936|       |            // store
  937|     11|            _mm256_storeu_si256((__m256i*)(dst + offset), extended);
  938|     11|        } else {
  939|       |            // unpack the first 8 bytes, padding with zeros
  940|     11|            const __m128i firstHalf = _mm_unpacklo_epi8(chunk, nullMask);
  941|     11|            _mm_storeu_si128((__m128i*)(dst + offset), firstHalf); // store
  942|       |
  943|       |            // unpack the last 8 bytes, padding with zeros
  944|     11|            const __m128i secondHalf = _mm_unpackhi_epi8 (chunk, nullMask);
  945|     11|            _mm_storeu_si128((__m128i*)(dst + offset + 8), secondHalf); // store
  946|     11|        }
  947|     11|    };
  948|       |
  949|     11|    const char *e = str + size;
  950|     11|    if (size >= sizeof(__m128i)) {
  ------------------
  |  Branch (950:9): [True: 0, False: 11]
  ------------------
  951|      0|        qptrdiff offset = 0;
  952|      0|        for ( ; str + offset + sizeof(__m128i) <= e; offset += sizeof(__m128i))
  ------------------
  |  Branch (952:17): [True: 0, False: 0]
  ------------------
  953|      0|            processOneChunk(offset);
  954|      0|        if (str + offset < e)
  ------------------
  |  Branch (954:13): [True: 0, False: 0]
  ------------------
  955|      0|            processOneChunk(size - sizeof(__m128i));
  956|      0|        return;
  957|      0|    }
  958|       |
  959|     11|#  if !defined(__OPTIMIZE_SIZE__)
  960|     11|    if (size >= 4) {
  ------------------
  |  Branch (960:9): [True: 2, False: 9]
  ------------------
  961|       |        // two overlapped loads & stores, of either 64-bit or of 32-bit
  962|      2|        if (size >= 8) {
  ------------------
  |  Branch (962:13): [True: 2, False: 0]
  ------------------
  963|      2|            const __m128i unpacked1 = mm_load8_zero_extend(str);
  964|      2|            const __m128i unpacked2 = mm_load8_zero_extend(str + size - 8);
  965|      2|            _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), unpacked1);
  966|      2|            _mm_storeu_si128(reinterpret_cast<__m128i *>(dst + size -  8), unpacked2);
  967|      2|        } else {
  968|      0|            const __m128i chunk1 = _mm_cvtsi32_si128(qFromUnaligned<quint32>(str));
  969|      0|            const __m128i chunk2 = _mm_cvtsi32_si128(qFromUnaligned<quint32>(str + size - 4));
  970|      0|            const __m128i unpacked1 = _mm_unpacklo_epi8(chunk1, nullMask);
  971|      0|            const __m128i unpacked2 = _mm_unpacklo_epi8(chunk2, nullMask);
  972|      0|            _mm_storel_epi64(reinterpret_cast<__m128i *>(dst), unpacked1);
  973|      0|            _mm_storel_epi64(reinterpret_cast<__m128i *>(dst + size - 4), unpacked2);
  974|      0|        }
  975|      2|        return;
  976|      9|    } else {
  977|      9|        size = size % 4;
  978|      9|        return UnrollTailLoop<3>::exec(qsizetype(size), [=](qsizetype i) { dst[i] = uchar(str[i]); });
  979|      9|    }
  980|      0|#  endif
  981|      0|#endif
  982|       |#if defined(__mips_dsp)
  983|       |    static_assert(sizeof(qsizetype) == sizeof(int),
  984|       |                  "oops, the assembler implementation needs to be called in a loop");
  985|       |    if (size > 20)
  986|       |        qt_fromlatin1_mips_asm_unroll8(dst, str, size);
  987|       |    else
  988|       |        qt_fromlatin1_mips_asm_unroll4(dst, str, size);
  989|       |#else
  990|      0|    while (size--)
  ------------------
  |  Branch (990:12): [True: 0, False: 0]
  ------------------
  991|      0|        *dst++ = (uchar)*str++;
  992|      0|#endif
  993|      0|}
_ZN9QtPrivate12equalStringsE11QStringViewS0_:
 1386|      8|{
 1387|      8|    Q_ASSERT(lhs.size() == rhs.size());
 1388|      8|    return ucstreq(lhs.utf16(), lhs.size(), rhs.utf16());
 1389|      8|}
_ZN9QtPrivate14compareStringsE11QStringView13QLatin1StringN2Qt15CaseSensitivityE:
 1490|      1|{
 1491|      1|    if (cs == Qt::CaseSensitive)
  ------------------
  |  Branch (1491:9): [True: 1, False: 0]
  ------------------
 1492|      1|        return ucstrcmp(lhs.utf16(), lhs.size(), rhs.latin1(), rhs.size());
 1493|      0|    return ucstricmp(lhs.size(), lhs.utf16(), rhs.size(), rhs.latin1());
 1494|      1|}
_ZN7QStringC2EPK5QCharx:
 2489|      1|{
 2490|      1|    if (!unicode) {
  ------------------
  |  Branch (2490:9): [True: 0, False: 1]
  ------------------
 2491|      0|        d.clear();
 2492|      1|    } else {
 2493|      1|        if (size < 0)
  ------------------
  |  Branch (2493:13): [True: 0, False: 1]
  ------------------
 2494|      0|            size = QtPrivate::qustrlen(reinterpret_cast<const char16_t *>(unicode));
 2495|      1|        if (!size) {
  ------------------
  |  Branch (2495:13): [True: 0, False: 1]
  ------------------
 2496|      0|            d = DataPointer::fromRawData(&_empty, 0);
 2497|      1|        } else {
 2498|      1|            d = DataPointer(size, size);
 2499|      1|            Q_CHECK_PTR(d.data());
 2500|      1|            memcpy(d.data(), unicode, size * sizeof(QChar));
 2501|      1|            d.data()[size] = '\0';
 2502|      1|        }
 2503|      1|    }
 2504|      1|}
_ZN7QStringC2ExN2Qt14InitializationE:
 2534|   195k|{
 2535|   195k|    if (size <= 0) {
  ------------------
  |  Branch (2535:9): [True: 0, False: 195k]
  ------------------
 2536|      0|        d = DataPointer::fromRawData(&_empty, 0);
 2537|   195k|    } else {
 2538|   195k|        d = DataPointer(size, size);
 2539|   195k|        Q_CHECK_PTR(d.data());
 2540|   195k|        d.data()[size] = '\0';
 2541|   195k|    }
 2542|   195k|}
_ZN7QString6resizeEx:
 2662|   186k|{
 2663|   186k|    if (size < 0)
  ------------------
  |  Branch (2663:9): [True: 0, False: 186k]
  ------------------
 2664|      0|        size = 0;
 2665|       |
 2666|   186k|    if (d->needsDetach() || needsReallocate(*this, size))
  ------------------
  |  Branch (2666:9): [True: 1, False: 186k]
  |  Branch (2666:29): [True: 2, False: 186k]
  ------------------
 2667|      3|        reallocData(size, QArrayData::Grow);
 2668|   186k|    d.size = size;
 2669|   186k|    if (d->allocatedCapacity())
  ------------------
  |  Branch (2669:9): [True: 186k, False: 0]
  ------------------
 2670|   186k|        d.data()[size] = u'\0';
 2671|   186k|}
_ZN7QString11reallocDataExN10QArrayData16AllocationOptionE:
 2779|      4|{
 2780|      4|    if (!alloc) {
  ------------------
  |  Branch (2780:9): [True: 0, False: 4]
  ------------------
 2781|      0|        d = DataPointer::fromRawData(&_empty, 0);
 2782|      0|        return;
 2783|      0|    }
 2784|       |
 2785|       |    // don't use reallocate path when reducing capacity and there's free space
 2786|       |    // at the beginning: might shift data pointer outside of allocated space
 2787|      4|    const bool cannotUseReallocate = d.freeSpaceAtBegin() > 0;
 2788|       |
 2789|      4|    if (d->needsDetach() || cannotUseReallocate) {
  ------------------
  |  Branch (2789:9): [True: 2, False: 2]
  |  Branch (2789:29): [True: 0, False: 2]
  ------------------
 2790|      2|        DataPointer dd(alloc, qMin(alloc, d.size), option);
 2791|      2|        Q_CHECK_PTR(dd.data());
 2792|      2|        if (dd.size > 0)
  ------------------
  |  Branch (2792:13): [True: 1, False: 1]
  ------------------
 2793|      1|            ::memcpy(dd.data(), d.data(), dd.size * sizeof(QChar));
 2794|      2|        dd.data()[dd.size] = 0;
 2795|      2|        d = dd;
 2796|      2|    } else {
 2797|      2|        d->reallocate(alloc, option);
 2798|      2|    }
 2799|      4|}
_ZN7QStringaSERKS_:
 2831|   186k|{
 2832|   186k|    d = other.d;
 2833|   186k|    return *this;
 2834|   186k|}
_ZN7QString6appendERKS_:
 3151|   186k|{
 3152|   186k|    if (!str.isNull()) {
  ------------------
  |  Branch (3152:9): [True: 186k, False: 0]
  ------------------
 3153|   186k|        if (isNull()) {
  ------------------
  |  Branch (3153:13): [True: 186k, False: 3]
  ------------------
 3154|   186k|            if (Q_UNLIKELY(!str.d.isMutable()))
 3155|      0|                assign(str); // fromRawData, so we do a deep copy
 3156|   186k|            else
 3157|   186k|                operator=(str);
 3158|   186k|        } else if (str.size()) {
  ------------------
  |  Branch (3158:20): [True: 3, False: 0]
  ------------------
 3159|      3|            append(str.constData(), str.size());
 3160|      3|        }
 3161|   186k|    }
 3162|   186k|    return *this;
 3163|   186k|}
_ZN7QString6appendEPK5QCharx:
 3180|   195k|{
 3181|   195k|    if (str && len > 0) {
  ------------------
  |  Branch (3181:9): [True: 195k, False: 0]
  |  Branch (3181:16): [True: 195k, False: 0]
  ------------------
 3182|   195k|        static_assert(sizeof(QChar) == sizeof(char16_t), "Unexpected difference in sizes");
 3183|       |        // the following should be safe as QChar uses char16_t as underlying data
 3184|   195k|        const char16_t *char16String = reinterpret_cast<const char16_t *>(str);
 3185|   195k|        d->growAppend(char16String, char16String + len);
 3186|   195k|        d.data()[d.size] = u'\0';
 3187|   195k|    }
 3188|   195k|    return *this;
 3189|   195k|}
_ZN7QString6appendE5QChar:
 3246|   195k|{
 3247|   195k|    d.detachAndGrow(QArrayData::GrowsAtEnd, 1, nullptr, nullptr);
 3248|   195k|    d->copyAppend(1, ch.unicode());
 3249|   195k|    d.data()[d.size] = '\0';
 3250|   195k|    return *this;
 3251|   195k|}
_ZNK7QString10startsWithE13QLatin1StringN2Qt15CaseSensitivityE:
 5480|      1|{
 5481|      1|    return qt_starts_with_impl(QStringView(*this), s, cs);
 5482|      1|}
_ZNK7QString10startsWithE5QCharN2Qt15CaseSensitivityE:
 5491|      2|{
 5492|      2|    if (!size())
  ------------------
  |  Branch (5492:9): [True: 1, False: 1]
  ------------------
 5493|      1|        return false;
 5494|      1|    if (cs == Qt::CaseSensitive)
  ------------------
  |  Branch (5494:9): [True: 1, False: 0]
  ------------------
 5495|      1|        return at(0) == c;
 5496|      0|    return foldCase(at(0)) == foldCase(c);
 5497|      1|}
_ZNK7QString8endsWithE5QCharN2Qt15CaseSensitivityE:
 5554|   186k|{
 5555|   186k|    if (!size())
  ------------------
  |  Branch (5555:9): [True: 0, False: 186k]
  ------------------
 5556|      0|        return false;
 5557|   186k|    if (cs == Qt::CaseSensitive)
  ------------------
  |  Branch (5557:9): [True: 186k, False: 0]
  ------------------
 5558|   186k|        return at(size() - 1) == c;
 5559|      0|    return foldCase(at(size() - 1)) == foldCase(c);
 5560|   186k|}
_ZN7QString18toLocal8Bit_helperEPK5QCharx:
 5767|   186k|{
 5768|   186k|    return qt_convert_to_local_8bit(QStringView(data, size));
 5769|   186k|}
_ZN7QString10fromLatin1E14QByteArrayView:
 5908|     10|{
 5909|     10|    DataPointer d;
 5910|     10|    if (!ba.data()) {
  ------------------
  |  Branch (5910:9): [True: 0, False: 10]
  ------------------
 5911|       |        // nothing to do
 5912|     10|    } else if (ba.size() == 0) {
  ------------------
  |  Branch (5912:16): [True: 0, False: 10]
  ------------------
 5913|      0|        d = DataPointer::fromRawData(&_empty, 0);
 5914|     10|    } else {
 5915|     10|        d = DataPointer(ba.size(), ba.size());
 5916|     10|        Q_CHECK_PTR(d.data());
 5917|     10|        d.data()[ba.size()] = '\0';
 5918|     10|        char16_t *dst = d.data();
 5919|       |
 5920|     10|        qt_from_latin1(dst, ba.data(), size_t(ba.size()));
 5921|     10|    }
 5922|     10|    return QString(std::move(d));
 5923|     10|}
_ZN7QString13fromLocal8BitE14QByteArrayView:
 5986|  1.93k|{
 5987|  1.93k|    if (ba.isNull())
  ------------------
  |  Branch (5987:9): [True: 0, False: 1.93k]
  ------------------
 5988|      0|        return QString();
 5989|  1.93k|    if (ba.isEmpty())
  ------------------
  |  Branch (5989:9): [True: 1.93k, False: 4]
  ------------------
 5990|  1.93k|        return QString(DataPointer::fromRawData(&_empty, 0));
 5991|      4|    QStringDecoder toUtf16(QStringDecoder::System, QStringDecoder::Flag::Stateless);
 5992|      4|    return toUtf16(ba);
 5993|  1.93k|}
_ZN7QString8fromUtf8E14QByteArrayView:
 6055|   195k|{
 6056|   195k|    if (ba.isNull())
  ------------------
  |  Branch (6056:9): [True: 0, False: 195k]
  ------------------
 6057|      0|        return QString();
 6058|   195k|    if (ba.isEmpty())
  ------------------
  |  Branch (6058:9): [True: 0, False: 195k]
  ------------------
 6059|      0|        return QString(DataPointer::fromRawData(&_empty, 0));
 6060|   195k|    return QUtf8::convertToUnicode(ba);
 6061|   195k|}
_ZN7QString14trimmed_helperERKS_:
 6254|      1|{
 6255|      1|    return QStringAlgorithms<const QString>::trimmed_helper(str);
 6256|      1|}
_ZN7QString8truncateEx:
 6372|   195k|{
 6373|   195k|    if (pos < size())
  ------------------
  |  Branch (6373:9): [True: 9, False: 195k]
  ------------------
 6374|      9|        resize(pos);
 6375|   195k|}
_ZN7QString4chopEx:
 6393|   186k|{
 6394|   186k|    if (n > 0)
  ------------------
  |  Branch (6394:9): [True: 186k, False: 0]
  ------------------
 6395|   186k|        resize(d.size - n);
 6396|   186k|}
_ZNK7QString14rightJustifiedEx5QCharb:
 7149|      3|{
 7150|      3|    QString result;
 7151|      3|    qsizetype len = size();
 7152|      3|    qsizetype padlen = width - len;
 7153|      3|    if (padlen > 0) {
  ------------------
  |  Branch (7153:9): [True: 0, False: 3]
  ------------------
 7154|      0|        result.resize(len+padlen);
 7155|      0|        QChar *uc = (QChar*)result.d.data();
 7156|      0|        while (padlen--)
  ------------------
  |  Branch (7156:16): [True: 0, False: 0]
  ------------------
 7157|      0|           * uc++ = fill;
 7158|      0|        if (len)
  ------------------
  |  Branch (7158:13): [True: 0, False: 0]
  ------------------
 7159|      0|          memcpy(static_cast<void *>(uc), static_cast<const void *>(d.data()), sizeof(QChar)*len);
 7160|      3|    } else {
 7161|      3|        if (truncate)
  ------------------
  |  Branch (7161:13): [True: 0, False: 3]
  ------------------
 7162|      0|            result = left(width);
 7163|      3|        else
 7164|      3|            result = *this;
 7165|      3|    }
 7166|      3|    return result;
 7167|      3|}
_ZN7QString9vasprintfEPKcP13__va_list_tag:
 7448|      1|{
 7449|      1|    if (!cformat || !*cformat) {
  ------------------
  |  Branch (7449:9): [True: 0, False: 1]
  |  Branch (7449:21): [True: 0, False: 1]
  ------------------
 7450|       |        // Qt 1.x compat
 7451|      0|        return fromLatin1("");
 7452|      0|    }
 7453|       |
 7454|       |    // Parse cformat
 7455|       |
 7456|      1|    QString result;
 7457|      1|    const char *c = cformat;
 7458|      1|    const char *formatEnd = cformat + qstrlen(cformat);
 7459|      4|    for (;;) {
 7460|       |        // Copy non-escape chars to result
 7461|      4|        const char *cb = c;
 7462|    229|        while (*c != '\0' && *c != '%')
  ------------------
  |  Branch (7462:16): [True: 228, False: 1]
  |  Branch (7462:30): [True: 225, False: 3]
  ------------------
 7463|    225|            c++;
 7464|      4|        append_utf8(result, cb, qsizetype(c - cb));
 7465|       |
 7466|      4|        if (*c == '\0')
  ------------------
  |  Branch (7466:13): [True: 1, False: 3]
  ------------------
 7467|      1|            break;
 7468|       |
 7469|       |        // Found '%'
 7470|      3|        const char *escape_start = c;
 7471|      3|        ++c;
 7472|       |
 7473|      3|        if (*c == '\0') {
  ------------------
  |  Branch (7473:13): [True: 0, False: 3]
  ------------------
 7474|      0|            result.append(u'%'); // a % at the end of the string - treat as non-escape text
 7475|      0|            break;
 7476|      0|        }
 7477|      3|        if (*c == '%') {
  ------------------
  |  Branch (7477:13): [True: 0, False: 3]
  ------------------
 7478|      0|            result.append(u'%'); // %%
 7479|      0|            ++c;
 7480|      0|            continue;
 7481|      0|        }
 7482|       |
 7483|      3|        uint flags = parse_flag_characters(c);
 7484|       |
 7485|      3|        if (*c == '\0') {
  ------------------
  |  Branch (7485:13): [True: 0, False: 3]
  ------------------
 7486|      0|            result.append(QLatin1StringView(escape_start)); // incomplete escape, treat as non-escape text
 7487|      0|            break;
 7488|      0|        }
 7489|       |
 7490|       |        // Parse field width
 7491|      3|        int width = -1; // -1 means unspecified
 7492|      3|        if (isAsciiDigit(*c)) {
  ------------------
  |  Branch (7492:13): [True: 0, False: 3]
  ------------------
 7493|      0|            width = parse_field_width(c, formatEnd - c);
 7494|      3|        } else if (*c == '*') { // can't parse this in another function, not portably, at least
  ------------------
  |  Branch (7494:20): [True: 0, False: 3]
  ------------------
 7495|      0|            width = va_arg(ap, int);
 7496|      0|            if (width < 0)
  ------------------
  |  Branch (7496:17): [True: 0, False: 0]
  ------------------
 7497|      0|                width = -1; // treat all negative numbers as unspecified
 7498|      0|            ++c;
 7499|      0|        }
 7500|       |
 7501|      3|        if (*c == '\0') {
  ------------------
  |  Branch (7501:13): [True: 0, False: 3]
  ------------------
 7502|      0|            result.append(QLatin1StringView(escape_start)); // incomplete escape, treat as non-escape text
 7503|      0|            break;
 7504|      0|        }
 7505|       |
 7506|       |        // Parse precision
 7507|      3|        int precision = -1; // -1 means unspecified
 7508|      3|        if (*c == '.') {
  ------------------
  |  Branch (7508:13): [True: 0, False: 3]
  ------------------
 7509|      0|            ++c;
 7510|      0|            precision = 0;
 7511|      0|            if (isAsciiDigit(*c)) {
  ------------------
  |  Branch (7511:17): [True: 0, False: 0]
  ------------------
 7512|      0|                precision = parse_field_width(c, formatEnd - c);
 7513|      0|            } else if (*c == '*') { // can't parse this in another function, not portably, at least
  ------------------
  |  Branch (7513:24): [True: 0, False: 0]
  ------------------
 7514|      0|                precision = va_arg(ap, int);
 7515|      0|                if (precision < 0)
  ------------------
  |  Branch (7515:21): [True: 0, False: 0]
  ------------------
 7516|      0|                    precision = -1; // treat all negative numbers as unspecified
 7517|      0|                ++c;
 7518|      0|            }
 7519|      0|        }
 7520|       |
 7521|      3|        if (*c == '\0') {
  ------------------
  |  Branch (7521:13): [True: 0, False: 3]
  ------------------
 7522|      0|            result.append(QLatin1StringView(escape_start)); // incomplete escape, treat as non-escape text
 7523|      0|            break;
 7524|      0|        }
 7525|       |
 7526|      3|        const LengthMod length_mod = parse_length_modifier(c);
 7527|       |
 7528|      3|        if (*c == '\0') {
  ------------------
  |  Branch (7528:13): [True: 0, False: 3]
  ------------------
 7529|      0|            result.append(QLatin1StringView(escape_start)); // incomplete escape, treat as non-escape text
 7530|      0|            break;
 7531|      0|        }
 7532|       |
 7533|       |        // Parse the conversion specifier and do the conversion
 7534|      3|        QString subst;
 7535|      3|        switch (*c) {
 7536|      0|            case 'd':
  ------------------
  |  Branch (7536:13): [True: 0, False: 3]
  ------------------
 7537|      0|            case 'i': {
  ------------------
  |  Branch (7537:13): [True: 0, False: 3]
  ------------------
 7538|      0|                qint64 i;
 7539|      0|                switch (length_mod) {
 7540|      0|                    case lm_none: i = va_arg(ap, int); break;
  ------------------
  |  Branch (7540:21): [True: 0, False: 0]
  ------------------
 7541|      0|                    case lm_hh: i = va_arg(ap, int); break;
  ------------------
  |  Branch (7541:21): [True: 0, False: 0]
  ------------------
 7542|      0|                    case lm_h: i = va_arg(ap, int); break;
  ------------------
  |  Branch (7542:21): [True: 0, False: 0]
  ------------------
 7543|      0|                    case lm_l: i = va_arg(ap, long int); break;
  ------------------
  |  Branch (7543:21): [True: 0, False: 0]
  ------------------
 7544|      0|                    case lm_ll: i = va_arg(ap, qint64); break;
  ------------------
  |  Branch (7544:21): [True: 0, False: 0]
  ------------------
 7545|      0|                    case lm_j: i = va_arg(ap, long int); break;
  ------------------
  |  Branch (7545:21): [True: 0, False: 0]
  ------------------
 7546|       |
 7547|       |                    /* ptrdiff_t actually, but it should be the same for us */
 7548|      0|                    case lm_z: i = va_arg(ap, qsizetype); break;
  ------------------
  |  Branch (7548:21): [True: 0, False: 0]
  ------------------
 7549|      0|                    case lm_t: i = va_arg(ap, qsizetype); break;
  ------------------
  |  Branch (7549:21): [True: 0, False: 0]
  ------------------
 7550|      0|                    default: i = 0; break;
  ------------------
  |  Branch (7550:21): [True: 0, False: 0]
  ------------------
 7551|      0|                }
 7552|      0|                subst = QLocaleData::c()->longLongToString(i, precision, 10, width, flags);
 7553|      0|                ++c;
 7554|      0|                break;
 7555|      0|            }
 7556|      0|            case 'o':
  ------------------
  |  Branch (7556:13): [True: 0, False: 3]
  ------------------
 7557|      0|            case 'u':
  ------------------
  |  Branch (7557:13): [True: 0, False: 3]
  ------------------
 7558|      0|            case 'x':
  ------------------
  |  Branch (7558:13): [True: 0, False: 3]
  ------------------
 7559|      0|            case 'X': {
  ------------------
  |  Branch (7559:13): [True: 0, False: 3]
  ------------------
 7560|      0|                quint64 u;
 7561|      0|                switch (length_mod) {
 7562|      0|                    case lm_none: u = va_arg(ap, uint); break;
  ------------------
  |  Branch (7562:21): [True: 0, False: 0]
  ------------------
 7563|      0|                    case lm_hh: u = va_arg(ap, uint); break;
  ------------------
  |  Branch (7563:21): [True: 0, False: 0]
  ------------------
 7564|      0|                    case lm_h: u = va_arg(ap, uint); break;
  ------------------
  |  Branch (7564:21): [True: 0, False: 0]
  ------------------
 7565|      0|                    case lm_l: u = va_arg(ap, ulong); break;
  ------------------
  |  Branch (7565:21): [True: 0, False: 0]
  ------------------
 7566|      0|                    case lm_ll: u = va_arg(ap, quint64); break;
  ------------------
  |  Branch (7566:21): [True: 0, False: 0]
  ------------------
 7567|      0|                    case lm_t: u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (7567:21): [True: 0, False: 0]
  ------------------
 7568|      0|                    case lm_z: u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (7568:21): [True: 0, False: 0]
  ------------------
 7569|      0|                    default: u = 0; break;
  ------------------
  |  Branch (7569:21): [True: 0, False: 0]
  ------------------
 7570|      0|                }
 7571|       |
 7572|      0|                if (isAsciiUpper(*c))
  ------------------
  |  Branch (7572:21): [True: 0, False: 0]
  ------------------
 7573|      0|                    flags |= QLocaleData::CapitalEorX;
 7574|       |
 7575|      0|                int base = 10;
 7576|      0|                switch (QtMiscUtils::toAsciiLower(*c)) {
 7577|      0|                    case 'o':
  ------------------
  |  Branch (7577:21): [True: 0, False: 0]
  ------------------
 7578|      0|                        base = 8; break;
 7579|      0|                    case 'u':
  ------------------
  |  Branch (7579:21): [True: 0, False: 0]
  ------------------
 7580|      0|                        base = 10; break;
 7581|      0|                    case 'x':
  ------------------
  |  Branch (7581:21): [True: 0, False: 0]
  ------------------
 7582|      0|                        base = 16; break;
 7583|      0|                    default: break;
  ------------------
  |  Branch (7583:21): [True: 0, False: 0]
  ------------------
 7584|      0|                }
 7585|      0|                subst = QLocaleData::c()->unsLongLongToString(u, precision, base, width, flags);
 7586|      0|                ++c;
 7587|      0|                break;
 7588|      0|            }
 7589|      0|            case 'E':
  ------------------
  |  Branch (7589:13): [True: 0, False: 3]
  ------------------
 7590|      0|            case 'e':
  ------------------
  |  Branch (7590:13): [True: 0, False: 3]
  ------------------
 7591|      0|            case 'F':
  ------------------
  |  Branch (7591:13): [True: 0, False: 3]
  ------------------
 7592|      0|            case 'f':
  ------------------
  |  Branch (7592:13): [True: 0, False: 3]
  ------------------
 7593|      0|            case 'G':
  ------------------
  |  Branch (7593:13): [True: 0, False: 3]
  ------------------
 7594|      0|            case 'g':
  ------------------
  |  Branch (7594:13): [True: 0, False: 3]
  ------------------
 7595|      0|            case 'A':
  ------------------
  |  Branch (7595:13): [True: 0, False: 3]
  ------------------
 7596|      0|            case 'a': {
  ------------------
  |  Branch (7596:13): [True: 0, False: 3]
  ------------------
 7597|      0|                double d;
 7598|      0|                if (length_mod == lm_L)
  ------------------
  |  Branch (7598:21): [True: 0, False: 0]
  ------------------
 7599|      0|                    d = va_arg(ap, long double); // not supported - converted to a double
 7600|      0|                else
 7601|      0|                    d = va_arg(ap, double);
 7602|       |
 7603|      0|                if (isAsciiUpper(*c))
  ------------------
  |  Branch (7603:21): [True: 0, False: 0]
  ------------------
 7604|      0|                    flags |= QLocaleData::CapitalEorX;
 7605|       |
 7606|      0|                QLocaleData::DoubleForm form = QLocaleData::DFDecimal;
 7607|      0|                switch (QtMiscUtils::toAsciiLower(*c)) {
 7608|      0|                    case 'e': form = QLocaleData::DFExponent; break;
  ------------------
  |  Branch (7608:21): [True: 0, False: 0]
  ------------------
 7609|      0|                    case 'a':                             // not supported - decimal form used instead
  ------------------
  |  Branch (7609:21): [True: 0, False: 0]
  ------------------
 7610|      0|                    case 'f': form = QLocaleData::DFDecimal; break;
  ------------------
  |  Branch (7610:21): [True: 0, False: 0]
  ------------------
 7611|      0|                    case 'g': form = QLocaleData::DFSignificantDigits; break;
  ------------------
  |  Branch (7611:21): [True: 0, False: 0]
  ------------------
 7612|      0|                    default: break;
  ------------------
  |  Branch (7612:21): [True: 0, False: 0]
  ------------------
 7613|      0|                }
 7614|      0|                subst = QLocaleData::c()->doubleToString(d, precision, form, width, flags);
 7615|      0|                ++c;
 7616|      0|                break;
 7617|      0|            }
 7618|      0|            case 'c': {
  ------------------
  |  Branch (7618:13): [True: 0, False: 3]
  ------------------
 7619|      0|                if (length_mod == lm_l)
  ------------------
  |  Branch (7619:21): [True: 0, False: 0]
  ------------------
 7620|      0|                    subst = QChar::fromUcs2(va_arg(ap, int));
 7621|      0|                else
 7622|      0|                    subst = QLatin1Char((uchar) va_arg(ap, int));
 7623|      0|                ++c;
 7624|      0|                break;
 7625|      0|            }
 7626|      3|            case 's': {
  ------------------
  |  Branch (7626:13): [True: 3, False: 0]
  ------------------
 7627|      3|                if (length_mod == lm_l) {
  ------------------
  |  Branch (7627:21): [True: 0, False: 3]
  ------------------
 7628|      0|                    const char16_t *buff = va_arg(ap, const char16_t*);
 7629|      0|                    const auto *ch = buff;
 7630|      0|                    while (precision != 0 && *ch != 0) {
  ------------------
  |  Branch (7630:28): [True: 0, False: 0]
  |  Branch (7630:46): [True: 0, False: 0]
  ------------------
 7631|      0|                        ++ch;
 7632|      0|                        --precision;
 7633|      0|                    }
 7634|      0|                    subst.setUtf16(buff, ch - buff);
 7635|      3|                } else if (precision == -1) {
  ------------------
  |  Branch (7635:28): [True: 3, False: 0]
  ------------------
 7636|      3|                    subst = QString::fromUtf8(va_arg(ap, const char*));
 7637|      3|                } else {
 7638|      0|                    const char *buff = va_arg(ap, const char*);
 7639|      0|                    subst = QString::fromUtf8(buff, qstrnlen(buff, precision));
 7640|      0|                }
 7641|      3|                ++c;
 7642|      3|                break;
 7643|      0|            }
 7644|      0|            case 'p': {
  ------------------
  |  Branch (7644:13): [True: 0, False: 3]
  ------------------
 7645|      0|                void *arg = va_arg(ap, void*);
 7646|      0|                const quint64 i = reinterpret_cast<quintptr>(arg);
 7647|      0|                flags |= QLocaleData::ShowBase;
 7648|      0|                subst = QLocaleData::c()->unsLongLongToString(i, precision, 16, width, flags);
 7649|      0|                ++c;
 7650|      0|                break;
 7651|      0|            }
 7652|      0|            case 'n':
  ------------------
  |  Branch (7652:13): [True: 0, False: 3]
  ------------------
 7653|      0|                switch (length_mod) {
 7654|      0|                    case lm_hh: {
  ------------------
  |  Branch (7654:21): [True: 0, False: 0]
  ------------------
 7655|      0|                        signed char *n = va_arg(ap, signed char*);
 7656|      0|                        *n = result.size();
 7657|      0|                        break;
 7658|      0|                    }
 7659|      0|                    case lm_h: {
  ------------------
  |  Branch (7659:21): [True: 0, False: 0]
  ------------------
 7660|      0|                        short int *n = va_arg(ap, short int*);
 7661|      0|                        *n = result.size();
 7662|      0|                            break;
 7663|      0|                    }
 7664|      0|                    case lm_l: {
  ------------------
  |  Branch (7664:21): [True: 0, False: 0]
  ------------------
 7665|      0|                        long int *n = va_arg(ap, long int*);
 7666|      0|                        *n = result.size();
 7667|      0|                        break;
 7668|      0|                    }
 7669|      0|                    case lm_ll: {
  ------------------
  |  Branch (7669:21): [True: 0, False: 0]
  ------------------
 7670|      0|                        qint64 *n = va_arg(ap, qint64*);
 7671|      0|                        *n = result.size();
 7672|      0|                        break;
 7673|      0|                    }
 7674|      0|                    default: {
  ------------------
  |  Branch (7674:21): [True: 0, False: 0]
  ------------------
 7675|      0|                        int *n = va_arg(ap, int*);
 7676|      0|                        *n = int(result.size());
 7677|      0|                        break;
 7678|      0|                    }
 7679|      0|                }
 7680|      0|                ++c;
 7681|      0|                break;
 7682|       |
 7683|      0|            default: // bad escape, treat as non-escape text
  ------------------
  |  Branch (7683:13): [True: 0, False: 3]
  ------------------
 7684|      0|                for (const char *cc = escape_start; cc != c; ++cc)
  ------------------
  |  Branch (7684:53): [True: 0, False: 0]
  ------------------
 7685|      0|                    result.append(QLatin1Char(*cc));
 7686|      0|                continue;
 7687|      3|        }
 7688|       |
 7689|      3|        if (flags & QLocaleData::LeftAdjusted)
  ------------------
  |  Branch (7689:13): [True: 0, False: 3]
  ------------------
 7690|      0|            result.append(subst.leftJustified(width));
 7691|      3|        else
 7692|      3|            result.append(subst.rightJustified(width));
 7693|      3|    }
 7694|       |
 7695|      1|    return result;
 7696|      1|}
_ZN21QAbstractConcatenable14appendLatin1ToE13QLatin1StringP5QChar:
10222|      1|{
10223|      1|    qt_from_latin1(reinterpret_cast<char16_t *>(out), in.data(), size_t(in.size()));
10224|      1|}
qstring.cpp:_ZZN9QtPrivate8qustrchrE11QStringViewDsENK3$_0clEDv2_xt:
  715|      2|    auto hasMatch = [mch, &n](__m128i data, ushort validityMask) {
  716|      2|        __m128i result = _mm_cmpeq_epi16(data, mch);
  717|      2|        uint mask = uint(_mm_movemask_epi8(result));
  718|      2|        if ((mask & validityMask) == 0)
  ------------------
  |  Branch (718:13): [True: 2, False: 0]
  ------------------
  719|      2|            return false;
  720|      0|        uint idx = qCountTrailingZeroBits(mask);
  721|      0|        n += idx / 2;
  722|      0|        return true;
  723|      2|    };
qstring.cpp:_ZL20mm_load8_zero_extendPKv:
  376|      4|{
  377|      4|    const __m128i *dataptr = static_cast<const __m128i *>(ptr);
  378|       |    if constexpr (UseSse4_1) {
  379|       |        // use a MOVQ followed by PMOVZXBW
  380|       |        // if AVX2 is present, these should combine into a single VPMOVZXBW instruction
  381|       |        __m128i data = _mm_loadl_epi64(dataptr);
  382|       |        return _mm_cvtepu8_epi16(data);
  383|       |    }
  384|       |
  385|       |    // use MOVQ followed by PUNPCKLBW
  386|      4|    __m128i data = _mm_loadl_epi64(dataptr);
  387|      4|    return _mm_unpacklo_epi8(data, _mm_setzero_si128());
  388|      4|}
qstring.cpp:_ZL15needsReallocateRK7QStringx:
 2625|   186k|{
 2626|   186k|    const auto capacityAtEnd = str.capacity() - str.data_ptr().freeSpaceAtBegin();
 2627|   186k|    return newSize > capacityAtEnd;
 2628|   186k|}
qstring.cpp:_ZL24qt_convert_to_local_8bit11QStringView:
 5772|   186k|{
 5773|   186k|    if (string.isNull())
  ------------------
  |  Branch (5773:9): [True: 0, False: 186k]
  ------------------
 5774|      0|        return QByteArray();
 5775|   186k|    QStringEncoder fromUtf16(QStringEncoder::System, QStringEncoder::Flag::Stateless);
 5776|   186k|    return fromUtf16(string);
 5777|   186k|}
qstring.cpp:_ZL11append_utf8R7QStringPKcx:
 7363|      4|{
 7364|      4|    const qsizetype oldSize = qs.size();
 7365|      4|    qs.resize(oldSize + len);
 7366|      4|    const QChar *newEnd = QUtf8::convertToUnicode(qs.data() + oldSize, QByteArrayView(cs, len));
 7367|      4|    qs.resize(newEnd - qs.constData());
 7368|      4|}
qstring.cpp:_ZL21parse_flag_charactersRPKc:
 7371|      3|{
 7372|      3|    uint flags = QLocaleData::ZeroPadExponent;
 7373|      3|    while (true) {
  ------------------
  |  Branch (7373:12): [Folded - Ignored]
  ------------------
 7374|      3|        switch (*c) {
 7375|      0|        case '#':
  ------------------
  |  Branch (7375:9): [True: 0, False: 3]
  ------------------
 7376|      0|            flags |= QLocaleData::ShowBase | QLocaleData::AddTrailingZeroes
 7377|      0|                    | QLocaleData::ForcePoint;
 7378|      0|            break;
 7379|      0|        case '0': flags |= QLocaleData::ZeroPadded; break;
  ------------------
  |  Branch (7379:9): [True: 0, False: 3]
  ------------------
 7380|      0|        case '-': flags |= QLocaleData::LeftAdjusted; break;
  ------------------
  |  Branch (7380:9): [True: 0, False: 3]
  ------------------
 7381|      0|        case ' ': flags |= QLocaleData::BlankBeforePositive; break;
  ------------------
  |  Branch (7381:9): [True: 0, False: 3]
  ------------------
 7382|      0|        case '+': flags |= QLocaleData::AlwaysShowSign; break;
  ------------------
  |  Branch (7382:9): [True: 0, False: 3]
  ------------------
 7383|      0|        case '\'': flags |= QLocaleData::GroupDigits; break;
  ------------------
  |  Branch (7383:9): [True: 0, False: 3]
  ------------------
 7384|      3|        default: return flags;
  ------------------
  |  Branch (7384:9): [True: 3, False: 0]
  ------------------
 7385|      3|        }
 7386|      0|        ++c;
 7387|      0|    }
 7388|      3|}
qstring.cpp:_ZL21parse_length_modifierRPKc:
 7419|      3|{
 7420|      3|    switch (*c++) {
  ------------------
  |  Branch (7420:13): [True: 3, False: 0]
  ------------------
 7421|      0|    case 'h': return can_consume(c, 'h') ? lm_hh : lm_h;
  ------------------
  |  Branch (7421:5): [True: 0, False: 3]
  |  Branch (7421:22): [True: 0, False: 0]
  ------------------
 7422|      0|    case 'l': return can_consume(c, 'l') ? lm_ll : lm_l;
  ------------------
  |  Branch (7422:5): [True: 0, False: 3]
  |  Branch (7422:22): [True: 0, False: 0]
  ------------------
 7423|      0|    case 'L': return lm_L;
  ------------------
  |  Branch (7423:5): [True: 0, False: 3]
  ------------------
 7424|      0|    case 'j': return lm_j;
  ------------------
  |  Branch (7424:5): [True: 0, False: 3]
  ------------------
 7425|      0|    case 'z':
  ------------------
  |  Branch (7425:5): [True: 0, False: 3]
  ------------------
 7426|      0|    case 'Z': return lm_z;
  ------------------
  |  Branch (7426:5): [True: 0, False: 3]
  ------------------
 7427|      0|    case 't': return lm_t;
  ------------------
  |  Branch (7427:5): [True: 0, False: 3]
  ------------------
 7428|      3|    }
 7429|      3|    --c; // don't consume *c - it wasn't a flag
 7430|      3|    return lm_none;
 7431|      3|}
qstring.cpp:_ZN12_GLOBAL__N_114UnrollTailLoopILj3EE4execIPKDsZN9QtPrivate8qustrchrE11QStringViewDsE3$_1ZNS5_8qustrchrES6_DsE3$_2lEET_T2_S9_T0_T1_SA_:
  288|      1|    {
  289|       |        /* equivalent to:
  290|       |         *   while (count--) {
  291|       |         *       if (loopCheck(i))
  292|       |         *           return returnIfFailed(i);
  293|       |         *   }
  294|       |         *   return returnIfExited;
  295|       |         */
  296|       |
  297|      1|        if (!count)
  ------------------
  |  Branch (297:13): [True: 0, False: 1]
  ------------------
  298|      0|            return returnIfExited;
  299|       |
  300|      1|        bool check = loopCheck(i);
  301|      1|        if (check)
  ------------------
  |  Branch (301:13): [True: 0, False: 1]
  ------------------
  302|      0|            return returnIfFailed(i);
  303|       |
  304|      1|        return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
  305|      1|    }
qstring.cpp:_ZZN9QtPrivate8qustrchrE11QStringViewDsENK3$_1clEx:
  748|      1|                                   [=](qsizetype i) { return n[i] == c; },
qstring.cpp:_ZN12_GLOBAL__N_114UnrollTailLoopILj2EE4execIPKDsZN9QtPrivate8qustrchrE11QStringViewDsE3$_1ZNS5_8qustrchrES6_DsE3$_2lEET_T2_S9_T0_T1_SA_:
  288|      1|    {
  289|       |        /* equivalent to:
  290|       |         *   while (count--) {
  291|       |         *       if (loopCheck(i))
  292|       |         *           return returnIfFailed(i);
  293|       |         *   }
  294|       |         *   return returnIfExited;
  295|       |         */
  296|       |
  297|      1|        if (!count)
  ------------------
  |  Branch (297:13): [True: 1, False: 0]
  ------------------
  298|      1|            return returnIfExited;
  299|       |
  300|      0|        bool check = loopCheck(i);
  301|      0|        if (check)
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  ------------------
  302|      0|            return returnIfFailed(i);
  303|       |
  304|      0|        return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
  305|      0|    }
qstring.cpp:_ZN12_GLOBAL__N_114UnrollTailLoopILj3EE4execIZ14qt_from_latin1PDsPKcmE3$_1xEEvT0_T_:
  309|      9|    {
  310|       |        /* equivalent to:
  311|       |         *   for (Number i = 0; i < count; ++i)
  312|       |         *       code(i);
  313|       |         */
  314|      9|        exec(count, 0, [=](Number i) -> bool { code(i); return false; }, [](Number) { return 0; });
  315|      9|    }
qstring.cpp:_ZN12_GLOBAL__N_114UnrollTailLoopILj3EE4execIiZNS1_4execIZ14qt_from_latin1PDsPKcmE3$_1xEEvT0_T_EUlxE_ZNS3_IS7_xEEvS8_S9_EUlxE0_xEES9_T2_S9_S8_T1_SC_:
  288|      9|    {
  289|       |        /* equivalent to:
  290|       |         *   while (count--) {
  291|       |         *       if (loopCheck(i))
  292|       |         *           return returnIfFailed(i);
  293|       |         *   }
  294|       |         *   return returnIfExited;
  295|       |         */
  296|       |
  297|      9|        if (!count)
  ------------------
  |  Branch (297:13): [True: 0, False: 9]
  ------------------
  298|      0|            return returnIfExited;
  299|       |
  300|      9|        bool check = loopCheck(i);
  301|      9|        if (check)
  ------------------
  |  Branch (301:13): [True: 0, False: 9]
  ------------------
  302|      0|            return returnIfFailed(i);
  303|       |
  304|      9|        return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
  305|      9|    }
qstring.cpp:_ZZN12_GLOBAL__N_114UnrollTailLoopILj3EE4execIZ14qt_from_latin1PDsPKcmE3$_1xEEvT0_T_ENKUlxE_clEx:
  314|      9|        exec(count, 0, [=](Number i) -> bool { code(i); return false; }, [](Number) { return 0; });
qstring.cpp:_ZZ14qt_from_latin1PDsPKcmENK3$_1clEx:
  978|      9|        return UnrollTailLoop<3>::exec(qsizetype(size), [=](qsizetype i) { dst[i] = uchar(str[i]); });
qstring.cpp:_ZN12_GLOBAL__N_114UnrollTailLoopILj2EE4execIiZNS0_ILj3EE4execIZ14qt_from_latin1PDsPKcmE3$_1xEEvT0_T_EUlxE_ZNS4_IS8_xEEvS9_SA_EUlxE0_xEESA_T2_SA_S9_T1_SD_:
  288|      9|    {
  289|       |        /* equivalent to:
  290|       |         *   while (count--) {
  291|       |         *       if (loopCheck(i))
  292|       |         *           return returnIfFailed(i);
  293|       |         *   }
  294|       |         *   return returnIfExited;
  295|       |         */
  296|       |
  297|      9|        if (!count)
  ------------------
  |  Branch (297:13): [True: 9, False: 0]
  ------------------
  298|      9|            return returnIfExited;
  299|       |
  300|      0|        bool check = loopCheck(i);
  301|      0|        if (check)
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  ------------------
  302|      0|            return returnIfFailed(i);
  303|       |
  304|      0|        return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
  305|      0|    }
qstring.cpp:_ZL7ucstreqIDsEbPKDsmPKT_:
 1352|      8|{
 1353|      8|    return ucstrncmp<CompareStringsForEquality>(a, b, alen) == 0;
 1354|      8|}
qstring.cpp:_ZL9ucstrncmpILN12_GLOBAL__N_120StringComparisonModeE0EEiPKDsS3_m:
 1277|      8|{
 1278|       |    // This function isn't memcmp() because that can return the wrong sorting
 1279|       |    // result in little-endian architectures: 0x00ff must sort before 0x0100,
 1280|       |    // but the bytes in memory are FF 00 and 00 01.
 1281|       |
 1282|      8|#ifndef __OPTIMIZE_SIZE__
 1283|       |#  if defined(__mips_dsp)
 1284|       |    static_assert(sizeof(uint) == sizeof(size_t));
 1285|       |    if (l >= 8) {
 1286|       |        return qt_ucstrncmp_mips_dsp_asm(a, b, l);
 1287|       |    }
 1288|       |#  elif defined(__SSE2__)
 1289|       |    return ucstrncmp_sse2<Mode>(a, b, l);
 1290|       |#  elif defined(__ARM_NEON__)
 1291|       |    if (l >= 8) {
 1292|       |        const char16_t *end = a + l;
 1293|       |        const uint16x8_t mask = qvsetq_n_u16( 1, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7 );
 1294|       |        while (end - a > 7) {
 1295|       |            uint16x8_t da = vld1q_u16(reinterpret_cast<const uint16_t *>(a));
 1296|       |            uint16x8_t db = vld1q_u16(reinterpret_cast<const uint16_t *>(b));
 1297|       |
 1298|       |            uint8_t r = ~(uint8_t)vaddvq_u16(vandq_u16(vceqq_u16(da, db), mask));
 1299|       |            if (r) {
 1300|       |                // found a different QChar
 1301|       |                if (Mode == CompareStringsForEquality)
 1302|       |                    return 1;
 1303|       |                uint idx = qCountTrailingZeroBits(r);
 1304|       |                return a[idx] - b[idx];
 1305|       |            }
 1306|       |            a += 8;
 1307|       |            b += 8;
 1308|       |        }
 1309|       |        l &= 7;
 1310|       |    }
 1311|       |    const auto lambda = [=](size_t i) -> int {
 1312|       |        return a[i] - b[i];
 1313|       |    };
 1314|       |    return UnrollTailLoop<7>::exec(l, 0, lambda, lambda);
 1315|       |#  endif // MIPS DSP or __SSE2__ or __ARM_NEON__
 1316|      0|#endif // __OPTIMIZE_SIZE__
 1317|       |
 1318|      0|    if (Mode == CompareStringsForEquality || QSysInfo::ByteOrder == QSysInfo::BigEndian)
  ------------------
  |  Branch (1318:9): [Folded - Ignored]
  |  Branch (1318:46): [Folded - Ignored]
  ------------------
 1319|      0|        return memcmp(a, b, l * sizeof(char16_t));
 1320|       |
 1321|      0|    for (size_t i = 0; i < l; ++i) {
  ------------------
  |  Branch (1321:24): [True: 0, False: 0]
  ------------------
 1322|      0|        if (int diff = a[i] - b[i])
  ------------------
  |  Branch (1322:17): [True: 0, False: 0]
  ------------------
 1323|      0|            return diff;
 1324|      0|    }
 1325|      0|    return 0;
 1326|      0|}
qstring.cpp:_ZL14ucstrncmp_sse2ILN12_GLOBAL__N_120StringComparisonModeE0EDsEiPKDsPKT0_m:
  532|      8|{
  533|      8|    static_assert(std::is_unsigned_v<Char>);
  534|       |
  535|       |    // Using the PMOVMSKB instruction, we get two bits for each UTF-16 character
  536|       |    // we compare. This lambda helps extract the code unit.
  537|      8|    static const auto codeUnitAt = [](const auto *n, qptrdiff idx) -> int {
  538|      8|        constexpr int Stride = 2;
  539|       |        // this is the same as:
  540|       |        //    return n[idx / Stride];
  541|       |        // but using pointer arithmetic to avoid the compiler dividing by two
  542|       |        // and multiplying by two in the case of char16_t (we know idx is even,
  543|       |        // but the compiler does not). This is not UB.
  544|       |
  545|      8|        auto ptr = reinterpret_cast<const uchar *>(n);
  546|      8|        ptr += idx / (Stride / sizeof(*n));
  547|      8|        return *reinterpret_cast<decltype(n)>(ptr);
  548|      8|    };
  549|      8|    auto difference = [a, b](uint mask, qptrdiff offset) {
  550|      8|        if (Mode == CompareStringsForEquality)
  551|      8|            return 1;
  552|      8|        uint idx = qCountTrailingZeroBits(mask);
  553|      8|        return codeUnitAt(a + offset, idx) - codeUnitAt(b + offset, idx);
  554|      8|    };
  555|       |
  556|      8|    static const auto load8Chars = [](const auto *ptr) {
  557|      8|        if (sizeof(*ptr) == 2)
  558|      8|            return _mm_loadu_si128(reinterpret_cast<const __m128i *>(ptr));
  559|      8|        __m128i chunk = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(ptr));
  560|      8|        return _mm_unpacklo_epi8(chunk, _mm_setzero_si128());
  561|      8|    };
  562|      8|    static const auto load4Chars = [](const auto *ptr) {
  563|      8|        if (sizeof(*ptr) == 2)
  564|      8|            return _mm_loadl_epi64(reinterpret_cast<const __m128i *>(ptr));
  565|      8|        __m128i chunk = _mm_cvtsi32_si128(qFromUnaligned<quint32>(ptr));
  566|      8|        return _mm_unpacklo_epi8(chunk, _mm_setzero_si128());
  567|      8|    };
  568|       |
  569|       |    // we're going to read a[0..15] and b[0..15] (32 bytes)
  570|      8|    auto processChunk16Chars = [a, b](qptrdiff offset) -> uint {
  571|      8|        if constexpr (UseAvx2) {
  572|      8|            __m256i a_data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(a + offset));
  573|      8|            __m256i b_data;
  574|      8|            if (sizeof(Char) == 1) {
  575|       |                // expand to UTF-16 via zero-extension
  576|      8|                __m128i chunk = _mm_loadu_si128(reinterpret_cast<const __m128i *>(b + offset));
  577|      8|                b_data = _mm256_cvtepu8_epi16(chunk);
  578|      8|            } else {
  579|      8|                b_data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(b + offset));
  580|      8|            }
  581|      8|            __m256i result = _mm256_cmpeq_epi16(a_data, b_data);
  582|      8|            return _mm256_movemask_epi8(result);
  583|      8|        }
  584|       |
  585|      8|        __m128i a_data1 = load8Chars(a + offset);
  586|      8|        __m128i a_data2 = load8Chars(a + offset + 8);
  587|      8|        __m128i b_data1, b_data2;
  588|      8|        if (sizeof(Char) == 1) {
  589|       |            // expand to UTF-16 via unpacking
  590|      8|            __m128i b_data = _mm_loadu_si128(reinterpret_cast<const __m128i *>(b + offset));
  591|      8|            b_data1 = _mm_unpacklo_epi8(b_data, _mm_setzero_si128());
  592|      8|            b_data2 = _mm_unpackhi_epi8(b_data, _mm_setzero_si128());
  593|      8|        } else {
  594|      8|            b_data1 = load8Chars(b + offset);
  595|      8|            b_data2 = load8Chars(b + offset + 8);
  596|      8|        }
  597|      8|        __m128i result1 = _mm_cmpeq_epi16(a_data1, b_data1);
  598|      8|        __m128i result2 = _mm_cmpeq_epi16(a_data2, b_data2);
  599|      8|        return _mm_movemask_epi8(result1) | _mm_movemask_epi8(result2) << 16;
  600|      8|    };
  601|       |
  602|      8|    if (l >= sizeof(__m256i) / sizeof(char16_t)) {
  ------------------
  |  Branch (602:9): [True: 0, False: 8]
  ------------------
  603|      0|        qptrdiff offset = 0;
  604|      0|        for ( ; l >= offset + sizeof(__m256i) / sizeof(char16_t); offset += sizeof(__m256i) / sizeof(char16_t)) {
  ------------------
  |  Branch (604:17): [True: 0, False: 0]
  ------------------
  605|      0|            uint mask = ~processChunk16Chars(offset);
  606|      0|            if (mask)
  ------------------
  |  Branch (606:17): [True: 0, False: 0]
  ------------------
  607|      0|                return difference(mask, offset);
  608|      0|        }
  609|       |
  610|       |        // maybe overlap the last 32 bytes
  611|      0|        if (size_t(offset) < l) {
  ------------------
  |  Branch (611:13): [True: 0, False: 0]
  ------------------
  612|      0|            offset = l - sizeof(__m256i) / sizeof(char16_t);
  613|      0|            uint mask = ~processChunk16Chars(offset);
  614|      0|            return mask ? difference(mask, offset) : 0;
  ------------------
  |  Branch (614:20): [True: 0, False: 0]
  ------------------
  615|      0|        }
  616|      8|    } else if (l >= 4) {
  ------------------
  |  Branch (616:16): [True: 0, False: 8]
  ------------------
  617|      0|        __m128i a_data1, b_data1;
  618|      0|        __m128i a_data2, b_data2;
  619|      0|        int width;
  620|      0|        if (l >= 8) {
  ------------------
  |  Branch (620:13): [True: 0, False: 0]
  ------------------
  621|      0|            width = 8;
  622|      0|            a_data1 = load8Chars(a);
  623|      0|            b_data1 = load8Chars(b);
  624|      0|            a_data2 = load8Chars(a + l - width);
  625|      0|            b_data2 = load8Chars(b + l - width);
  626|      0|        } else {
  627|       |            // we're going to read a[0..3] and b[0..3] (8 bytes)
  628|      0|            width = 4;
  629|      0|            a_data1 = load4Chars(a);
  630|      0|            b_data1 = load4Chars(b);
  631|      0|            a_data2 = load4Chars(a + l - width);
  632|      0|            b_data2 = load4Chars(b + l - width);
  633|      0|        }
  634|       |
  635|      0|        __m128i result = _mm_cmpeq_epi16(a_data1, b_data1);
  636|      0|        ushort mask = ~_mm_movemask_epi8(result);
  637|      0|        if (mask)
  ------------------
  |  Branch (637:13): [True: 0, False: 0]
  ------------------
  638|      0|            return difference(mask, 0);
  639|       |
  640|      0|        result = _mm_cmpeq_epi16(a_data2, b_data2);
  641|      0|        mask = ~_mm_movemask_epi8(result);
  642|      0|        if (mask)
  ------------------
  |  Branch (642:13): [True: 0, False: 0]
  ------------------
  643|      0|            return difference(mask, l - width);
  644|      8|    } else {
  645|       |        // reset l
  646|      8|        l &= 3;
  647|       |
  648|      8|        const auto lambda = [=](size_t i) -> int {
  649|      8|            return a[i] - b[i];
  650|      8|        };
  651|      8|        return UnrollTailLoop<3>::exec(l, 0, lambda, lambda);
  652|      8|    }
  653|      0|    return 0;
  654|      8|}
qstring.cpp:_ZN12_GLOBAL__N_114UnrollTailLoopILj3EE4execIiZL14ucstrncmp_sse2ILNS_20StringComparisonModeE0EDsEiPKDsPKT0_mEUlmE_SA_mEET_T2_SB_S7_T1_SC_:
  288|      8|    {
  289|       |        /* equivalent to:
  290|       |         *   while (count--) {
  291|       |         *       if (loopCheck(i))
  292|       |         *           return returnIfFailed(i);
  293|       |         *   }
  294|       |         *   return returnIfExited;
  295|       |         */
  296|       |
  297|      8|        if (!count)
  ------------------
  |  Branch (297:13): [True: 0, False: 8]
  ------------------
  298|      0|            return returnIfExited;
  299|       |
  300|      8|        bool check = loopCheck(i);
  301|      8|        if (check)
  ------------------
  |  Branch (301:13): [True: 0, False: 8]
  ------------------
  302|      0|            return returnIfFailed(i);
  303|       |
  304|      8|        return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
  305|      8|    }
qstring.cpp:_ZZL14ucstrncmp_sse2ILN12_GLOBAL__N_120StringComparisonModeE0EDsEiPKDsPKT0_mENKUlmE_clEm:
  648|      8|        const auto lambda = [=](size_t i) -> int {
  649|      8|            return a[i] - b[i];
  650|      8|        };
qstring.cpp:_ZN12_GLOBAL__N_114UnrollTailLoopILj2EE4execIiZL14ucstrncmp_sse2ILNS_20StringComparisonModeE0EDsEiPKDsPKT0_mEUlmE_SA_mEET_T2_SB_S7_T1_SC_:
  288|      8|    {
  289|       |        /* equivalent to:
  290|       |         *   while (count--) {
  291|       |         *       if (loopCheck(i))
  292|       |         *           return returnIfFailed(i);
  293|       |         *   }
  294|       |         *   return returnIfExited;
  295|       |         */
  296|       |
  297|      8|        if (!count)
  ------------------
  |  Branch (297:13): [True: 8, False: 0]
  ------------------
  298|      8|            return returnIfExited;
  299|       |
  300|      0|        bool check = loopCheck(i);
  301|      0|        if (check)
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  ------------------
  302|      0|            return returnIfFailed(i);
  303|       |
  304|      0|        return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
  305|      0|    }
qstring.cpp:_ZL8ucstrcmpIcEiPKDsmPKT_m:
 1359|      1|{
 1360|      1|    const size_t l = qMin(alen, blen);
 1361|      1|    int cmp = ucstrncmp<CompareStringsForOrdering>(a, b, l);
 1362|      1|    return cmp ? cmp : qt_lencmp(alen, blen);
  ------------------
  |  Branch (1362:12): [True: 1, False: 0]
  ------------------
 1363|      1|}
qstring.cpp:_ZL9ucstrncmpILN12_GLOBAL__N_120StringComparisonModeE1EEiPKDsPKcm:
 1330|      1|{
 1331|      1|    const uchar *c = reinterpret_cast<const uchar *>(b);
 1332|      1|    const char16_t *uc = a;
 1333|      1|    const char16_t *e = uc + l;
 1334|       |
 1335|      1|#if defined(__SSE2__) && !defined(__OPTIMIZE_SIZE__)
 1336|      1|    return ucstrncmp_sse2<Mode>(uc, c, l);
 1337|      0|#endif
 1338|       |
 1339|      0|    while (uc < e) {
  ------------------
  |  Branch (1339:12): [True: 0, False: 0]
  ------------------
 1340|      0|        int diff = *uc - *c;
 1341|      0|        if (diff)
  ------------------
  |  Branch (1341:13): [True: 0, False: 0]
  ------------------
 1342|      0|            return diff;
 1343|      0|        uc++, c++;
 1344|      0|    }
 1345|       |
 1346|      0|    return 0;
 1347|      0|}
qstring.cpp:_ZL14ucstrncmp_sse2ILN12_GLOBAL__N_120StringComparisonModeE1EhEiPKDsPKT0_m:
  532|      1|{
  533|      1|    static_assert(std::is_unsigned_v<Char>);
  534|       |
  535|       |    // Using the PMOVMSKB instruction, we get two bits for each UTF-16 character
  536|       |    // we compare. This lambda helps extract the code unit.
  537|      1|    static const auto codeUnitAt = [](const auto *n, qptrdiff idx) -> int {
  538|      1|        constexpr int Stride = 2;
  539|       |        // this is the same as:
  540|       |        //    return n[idx / Stride];
  541|       |        // but using pointer arithmetic to avoid the compiler dividing by two
  542|       |        // and multiplying by two in the case of char16_t (we know idx is even,
  543|       |        // but the compiler does not). This is not UB.
  544|       |
  545|      1|        auto ptr = reinterpret_cast<const uchar *>(n);
  546|      1|        ptr += idx / (Stride / sizeof(*n));
  547|      1|        return *reinterpret_cast<decltype(n)>(ptr);
  548|      1|    };
  549|      1|    auto difference = [a, b](uint mask, qptrdiff offset) {
  550|      1|        if (Mode == CompareStringsForEquality)
  551|      1|            return 1;
  552|      1|        uint idx = qCountTrailingZeroBits(mask);
  553|      1|        return codeUnitAt(a + offset, idx) - codeUnitAt(b + offset, idx);
  554|      1|    };
  555|       |
  556|      1|    static const auto load8Chars = [](const auto *ptr) {
  557|      1|        if (sizeof(*ptr) == 2)
  558|      1|            return _mm_loadu_si128(reinterpret_cast<const __m128i *>(ptr));
  559|      1|        __m128i chunk = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(ptr));
  560|      1|        return _mm_unpacklo_epi8(chunk, _mm_setzero_si128());
  561|      1|    };
  562|      1|    static const auto load4Chars = [](const auto *ptr) {
  563|      1|        if (sizeof(*ptr) == 2)
  564|      1|            return _mm_loadl_epi64(reinterpret_cast<const __m128i *>(ptr));
  565|      1|        __m128i chunk = _mm_cvtsi32_si128(qFromUnaligned<quint32>(ptr));
  566|      1|        return _mm_unpacklo_epi8(chunk, _mm_setzero_si128());
  567|      1|    };
  568|       |
  569|       |    // we're going to read a[0..15] and b[0..15] (32 bytes)
  570|      1|    auto processChunk16Chars = [a, b](qptrdiff offset) -> uint {
  571|      1|        if constexpr (UseAvx2) {
  572|      1|            __m256i a_data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(a + offset));
  573|      1|            __m256i b_data;
  574|      1|            if (sizeof(Char) == 1) {
  575|       |                // expand to UTF-16 via zero-extension
  576|      1|                __m128i chunk = _mm_loadu_si128(reinterpret_cast<const __m128i *>(b + offset));
  577|      1|                b_data = _mm256_cvtepu8_epi16(chunk);
  578|      1|            } else {
  579|      1|                b_data = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(b + offset));
  580|      1|            }
  581|      1|            __m256i result = _mm256_cmpeq_epi16(a_data, b_data);
  582|      1|            return _mm256_movemask_epi8(result);
  583|      1|        }
  584|       |
  585|      1|        __m128i a_data1 = load8Chars(a + offset);
  586|      1|        __m128i a_data2 = load8Chars(a + offset + 8);
  587|      1|        __m128i b_data1, b_data2;
  588|      1|        if (sizeof(Char) == 1) {
  589|       |            // expand to UTF-16 via unpacking
  590|      1|            __m128i b_data = _mm_loadu_si128(reinterpret_cast<const __m128i *>(b + offset));
  591|      1|            b_data1 = _mm_unpacklo_epi8(b_data, _mm_setzero_si128());
  592|      1|            b_data2 = _mm_unpackhi_epi8(b_data, _mm_setzero_si128());
  593|      1|        } else {
  594|      1|            b_data1 = load8Chars(b + offset);
  595|      1|            b_data2 = load8Chars(b + offset + 8);
  596|      1|        }
  597|      1|        __m128i result1 = _mm_cmpeq_epi16(a_data1, b_data1);
  598|      1|        __m128i result2 = _mm_cmpeq_epi16(a_data2, b_data2);
  599|      1|        return _mm_movemask_epi8(result1) | _mm_movemask_epi8(result2) << 16;
  600|      1|    };
  601|       |
  602|      1|    if (l >= sizeof(__m256i) / sizeof(char16_t)) {
  ------------------
  |  Branch (602:9): [True: 0, False: 1]
  ------------------
  603|      0|        qptrdiff offset = 0;
  604|      0|        for ( ; l >= offset + sizeof(__m256i) / sizeof(char16_t); offset += sizeof(__m256i) / sizeof(char16_t)) {
  ------------------
  |  Branch (604:17): [True: 0, False: 0]
  ------------------
  605|      0|            uint mask = ~processChunk16Chars(offset);
  606|      0|            if (mask)
  ------------------
  |  Branch (606:17): [True: 0, False: 0]
  ------------------
  607|      0|                return difference(mask, offset);
  608|      0|        }
  609|       |
  610|       |        // maybe overlap the last 32 bytes
  611|      0|        if (size_t(offset) < l) {
  ------------------
  |  Branch (611:13): [True: 0, False: 0]
  ------------------
  612|      0|            offset = l - sizeof(__m256i) / sizeof(char16_t);
  613|      0|            uint mask = ~processChunk16Chars(offset);
  614|      0|            return mask ? difference(mask, offset) : 0;
  ------------------
  |  Branch (614:20): [True: 0, False: 0]
  ------------------
  615|      0|        }
  616|      1|    } else if (l >= 4) {
  ------------------
  |  Branch (616:16): [True: 0, False: 1]
  ------------------
  617|      0|        __m128i a_data1, b_data1;
  618|      0|        __m128i a_data2, b_data2;
  619|      0|        int width;
  620|      0|        if (l >= 8) {
  ------------------
  |  Branch (620:13): [True: 0, False: 0]
  ------------------
  621|      0|            width = 8;
  622|      0|            a_data1 = load8Chars(a);
  623|      0|            b_data1 = load8Chars(b);
  624|      0|            a_data2 = load8Chars(a + l - width);
  625|      0|            b_data2 = load8Chars(b + l - width);
  626|      0|        } else {
  627|       |            // we're going to read a[0..3] and b[0..3] (8 bytes)
  628|      0|            width = 4;
  629|      0|            a_data1 = load4Chars(a);
  630|      0|            b_data1 = load4Chars(b);
  631|      0|            a_data2 = load4Chars(a + l - width);
  632|      0|            b_data2 = load4Chars(b + l - width);
  633|      0|        }
  634|       |
  635|      0|        __m128i result = _mm_cmpeq_epi16(a_data1, b_data1);
  636|      0|        ushort mask = ~_mm_movemask_epi8(result);
  637|      0|        if (mask)
  ------------------
  |  Branch (637:13): [True: 0, False: 0]
  ------------------
  638|      0|            return difference(mask, 0);
  639|       |
  640|      0|        result = _mm_cmpeq_epi16(a_data2, b_data2);
  641|      0|        mask = ~_mm_movemask_epi8(result);
  642|      0|        if (mask)
  ------------------
  |  Branch (642:13): [True: 0, False: 0]
  ------------------
  643|      0|            return difference(mask, l - width);
  644|      1|    } else {
  645|       |        // reset l
  646|      1|        l &= 3;
  647|       |
  648|      1|        const auto lambda = [=](size_t i) -> int {
  649|      1|            return a[i] - b[i];
  650|      1|        };
  651|      1|        return UnrollTailLoop<3>::exec(l, 0, lambda, lambda);
  652|      1|    }
  653|      0|    return 0;
  654|      1|}
qstring.cpp:_ZN12_GLOBAL__N_114UnrollTailLoopILj3EE4execIiZL14ucstrncmp_sse2ILNS_20StringComparisonModeE1EhEiPKDsPKT0_mEUlmE_SA_mEET_T2_SB_S7_T1_SC_:
  288|      1|    {
  289|       |        /* equivalent to:
  290|       |         *   while (count--) {
  291|       |         *       if (loopCheck(i))
  292|       |         *           return returnIfFailed(i);
  293|       |         *   }
  294|       |         *   return returnIfExited;
  295|       |         */
  296|       |
  297|      1|        if (!count)
  ------------------
  |  Branch (297:13): [True: 0, False: 1]
  ------------------
  298|      0|            return returnIfExited;
  299|       |
  300|      1|        bool check = loopCheck(i);
  301|      1|        if (check)
  ------------------
  |  Branch (301:13): [True: 0, False: 1]
  ------------------
  302|      0|            return returnIfFailed(i);
  303|       |
  304|      1|        return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
  305|      1|    }
qstring.cpp:_ZZL14ucstrncmp_sse2ILN12_GLOBAL__N_120StringComparisonModeE1EhEiPKDsPKT0_mENKUlmE_clEm:
  648|      3|        const auto lambda = [=](size_t i) -> int {
  649|      3|            return a[i] - b[i];
  650|      3|        };
qstring.cpp:_ZN12_GLOBAL__N_114UnrollTailLoopILj2EE4execIiZL14ucstrncmp_sse2ILNS_20StringComparisonModeE1EhEiPKDsPKT0_mEUlmE_SA_mEET_T2_SB_S7_T1_SC_:
  288|      1|    {
  289|       |        /* equivalent to:
  290|       |         *   while (count--) {
  291|       |         *       if (loopCheck(i))
  292|       |         *           return returnIfFailed(i);
  293|       |         *   }
  294|       |         *   return returnIfExited;
  295|       |         */
  296|       |
  297|      1|        if (!count)
  ------------------
  |  Branch (297:13): [True: 0, False: 1]
  ------------------
  298|      0|            return returnIfExited;
  299|       |
  300|      1|        bool check = loopCheck(i);
  301|      1|        if (check)
  ------------------
  |  Branch (301:13): [True: 1, False: 0]
  ------------------
  302|      1|            return returnIfFailed(i);
  303|       |
  304|      0|        return UnrollTailLoop<MaxCount - 1>::exec(count - 1, returnIfExited, loopCheck, returnIfFailed, i + 1);
  305|      1|    }
qstring.cpp:_ZN12_GLOBAL__N_119qt_starts_with_implI11QStringView13QLatin1StringEEbT_T0_N2Qt15CaseSensitivityE:
  227|      1|{
  228|      1|    if (haystack.isNull())
  ------------------
  |  Branch (228:9): [True: 0, False: 1]
  ------------------
  229|      0|        return needle.isNull();
  230|      1|    const auto haystackLen = haystack.size();
  231|      1|    const auto needleLen = needle.size();
  232|      1|    if (haystackLen == 0)
  ------------------
  |  Branch (232:9): [True: 0, False: 1]
  ------------------
  233|      0|        return needleLen == 0;
  234|      1|    if (needleLen > haystackLen)
  ------------------
  |  Branch (234:9): [True: 0, False: 1]
  ------------------
  235|      0|        return false;
  236|       |
  237|      1|    return QtPrivate::compareStrings(haystack.first(needleLen), needle, cs) == 0;
  238|      1|}

_ZNK7QString7indexOfE5QCharxN2Qt15CaseSensitivityE:
 1635|      1|{
 1636|      1|    return qToStringViewIgnoringNull(*this).indexOf(ch, from, cs);
 1637|      1|}
_ZN7QStringD2Ev:
 1433|   951k|QString::~QString() {}
_ZNK7QString5beginEv:
 1460|   195k|{ return reinterpret_cast<const QChar*>(d.data()); }
_ZNK7QString4sizeEv:
  235|   951k|    inline qsizetype size() const noexcept { return d.size; }
_ZN7QStringC2ERKS_:
 1362|     52|QString::QString(const QString &other) noexcept : d(other.d)
 1363|     52|{ }
_ZNK7QString9constDataEv:
 1355|   382k|{ return data(); }
_ZNK7QString4dataEv:
 1341|   382k|{
 1342|   382k|#if QT5_NULL_STRINGS == 1
 1343|   382k|    return reinterpret_cast<const QChar *>(d.data() ? d.data() : &_empty);
  ------------------
  |  Branch (1343:44): [True: 382k, False: 0]
  ------------------
 1344|       |#else
 1345|       |    return reinterpret_cast<const QChar *>(d.data());
 1346|       |#endif
 1347|   382k|}
_ZN7QStringC2Ev:
 1432|   754k|constexpr QString::QString() noexcept {}
_ZN7QStringC2EO17QArrayDataPointerIDsE:
 1107|  1.94k|    explicit QString(DataPointer &&dd) : d(std::move(dd)) {}

_ZN17QStringAlgorithmsIK7QStringE7isSpaceE5QChar:
   31|      2|    static inline bool isSpace(QChar ch) { return ch.isSpace(); }
_ZN17QStringAlgorithmsIK7QStringE14trimmed_helperERS1_:
   76|      1|    {
   77|      1|        const auto [begin, end] = trimmed_helper_positions(str);
   78|      1|        if (begin == str.cbegin() && end == str.cend())
  ------------------
  |  Branch (78:13): [True: 1, False: 0]
  |  Branch (78:38): [True: 1, False: 0]
  ------------------
   79|      1|            return str;
   80|      0|        if (!isConst && str.isDetached())
  ------------------
  |  Branch (80:13): [Folded - Ignored]
  |  Branch (80:25): [True: 0, False: 0]
  ------------------
   81|      0|            return trimmed_helper_inplace(str, begin, end);
   82|      0|        return StringType(begin, end - begin);
   83|      0|    }
_ZN17QStringAlgorithmsIK7QStringE24trimmed_helper_positionsERS1_:
   63|      1|    {
   64|      1|        const Char *begin = str.cbegin();
   65|      1|        const Char *end = str.cend();
   66|       |        // skip white space from end
   67|      1|        while (begin < end && isSpace(end[-1]))
  ------------------
  |  Branch (67:16): [True: 1, False: 0]
  |  Branch (67:31): [True: 0, False: 1]
  ------------------
   68|      0|            --end;
   69|       |        // skip white space from start
   70|      1|        while (begin < end && isSpace(*begin))
  ------------------
  |  Branch (70:16): [True: 1, False: 0]
  |  Branch (70:31): [True: 0, False: 1]
  ------------------
   71|      0|            begin++;
   72|      1|        return {begin, end};
   73|      1|    }

_ZN5QUtf818convertFromUnicodeE11QStringViewPN20QStringConverterBase5StateE:
  711|   186k|{
  712|   186k|    QByteArray ba(3*in.size() +3, Qt::Uninitialized);
  713|   186k|    char *end = convertFromUnicode(ba.data(), in, state);
  714|   186k|    ba.truncate(end - ba.data());
  715|   186k|    return ba;
  716|   186k|}
_ZN5QUtf818convertFromUnicodeEPc11QStringViewPN20QStringConverterBase5StateE:
  719|   186k|{
  720|   186k|    Q_ASSERT(state);
  721|   186k|    qsizetype len = in.size();
  722|   186k|    if (!len)
  ------------------
  |  Branch (722:9): [True: 0, False: 186k]
  ------------------
  723|      0|        return out;
  724|       |
  725|   186k|    auto appendReplacementChar = [state](uchar *cursor) -> uchar * {
  726|   186k|        if (state->flags & QStringConverter::Flag::ConvertInvalidToNull) {
  727|   186k|            *cursor++ = 0;
  728|   186k|        } else {
  729|       |            // QChar::replacement encoded in utf8
  730|   186k|            *cursor++ = 0xef;
  731|   186k|            *cursor++ = 0xbf;
  732|   186k|            *cursor++ = 0xbd;
  733|   186k|        }
  734|   186k|        return cursor;
  735|   186k|    };
  736|       |
  737|   186k|    uchar *cursor = reinterpret_cast<uchar *>(out);
  738|   186k|    const char16_t *src = in.utf16();
  739|   186k|    const char16_t *const end = src + len;
  740|       |
  741|   186k|    if (!(state->flags & QStringDecoder::Flag::Stateless)) {
  ------------------
  |  Branch (741:9): [True: 0, False: 186k]
  ------------------
  742|      0|        if (state->remainingChars) {
  ------------------
  |  Branch (742:13): [True: 0, False: 0]
  ------------------
  743|      0|            int res = QUtf8Functions::toUtf8<QUtf8BaseTraits>(state->state_data[0], cursor, src, end);
  744|      0|            if (res < 0)
  ------------------
  |  Branch (744:17): [True: 0, False: 0]
  ------------------
  745|      0|                cursor = appendReplacementChar(cursor);
  746|      0|            state->state_data[0] = 0;
  747|      0|            state->remainingChars = 0;
  748|      0|        } else if (!(state->internalState & HeaderDone) && state->flags & QStringConverter::Flag::WriteBom) {
  ------------------
  |  Branch (748:20): [True: 0, False: 0]
  |  Branch (748:20): [True: 0, False: 0]
  |  Branch (748:60): [True: 0, False: 0]
  ------------------
  749|       |            // append UTF-8 BOM
  750|      0|            *cursor++ = utf8bom[0];
  751|      0|            *cursor++ = utf8bom[1];
  752|      0|            *cursor++ = utf8bom[2];
  753|      0|            state->internalState |= HeaderDone;
  754|      0|        }
  755|      0|    }
  756|       |
  757|   186k|    out = reinterpret_cast<char *>(cursor);
  758|   186k|    return convertFromUnicode(out, { src, end }, [&](uchar *&cursor, char16_t uc, int res) {
  759|   186k|        if (res == QUtf8BaseTraits::Error) {
  760|       |            // encoding error
  761|   186k|            ++state->invalidChars;
  762|   186k|            cursor = appendReplacementChar(cursor);
  763|   186k|        } else if (res == QUtf8BaseTraits::EndOfString) {
  764|   186k|            if (state->flags & QStringConverter::Flag::Stateless) {
  765|   186k|                ++state->invalidChars;
  766|   186k|                cursor = appendReplacementChar(cursor);
  767|   186k|            } else {
  768|   186k|                state->remainingChars = 1;
  769|   186k|                state->state_data[0] = uc;
  770|   186k|            }
  771|   186k|        }
  772|   186k|    });
  773|   186k|}
_ZN5QUtf816convertToUnicodeE14QByteArrayView:
  791|   195k|{
  792|       |    // UTF-8 to UTF-16 always needs the exact same number of words or less:
  793|       |    //    UTF-8     UTF-16
  794|       |    //   1 byte     1 word
  795|       |    //   2 bytes    1 word
  796|       |    //   3 bytes    1 word
  797|       |    //   4 bytes    2 words (one surrogate pair)
  798|       |    // That is, we'll use the full buffer if the input is US-ASCII (1-byte UTF-8),
  799|       |    // half the buffer for U+0080-U+07FF text (e.g., Greek, Cyrillic, Arabic) or
  800|       |    // non-BMP text, and one third of the buffer for U+0800-U+FFFF text (e.g, CJK).
  801|       |    //
  802|       |    // The table holds for invalid sequences too: we'll insert one replacement char
  803|       |    // per invalid byte.
  804|   195k|    QString result(in.size(), Qt::Uninitialized);
  805|   195k|    QChar *data = const_cast<QChar*>(result.constData()); // we know we're not shared
  806|   195k|    const QChar *end = convertToUnicode(data, in);
  807|   195k|    result.truncate(end - data);
  808|   195k|    return result;
  809|   195k|}
_ZN5QUtf816convertToUnicodeEPDs14QByteArrayView:
  831|   195k|{
  832|       |    // check if have to skip a BOM
  833|   195k|    auto bom = QByteArrayView::fromArray(utf8bom);
  834|   195k|    if (in.size() >= bom.size() && in.first(bom.size()) == bom)
  ------------------
  |  Branch (834:9): [True: 195k, False: 1]
  |  Branch (834:9): [True: 0, False: 195k]
  |  Branch (834:36): [True: 0, False: 195k]
  ------------------
  835|      0|        in.slice(sizeof(utf8bom));
  836|       |
  837|   195k|    return convertToUnicode(dst, in, [](char16_t *&dst, ...) {
  838|       |        // decoding error
  839|   195k|        *dst++ = QChar::ReplacementCharacter;
  840|   195k|        return true;        // continue decoding
  841|   195k|    });
  842|   195k|}
_ZN5QUtf816convertToUnicodeE14QByteArrayViewPN20QStringConverterBase5StateE:
  873|      4|{
  874|       |    // See above for buffer requirements for stateless decoding. However, that
  875|       |    // fails if the state is not empty. The following situations can add to the
  876|       |    // requirements:
  877|       |    //  state contains      chars starts with           requirement
  878|       |    //   1 of 2 bytes       valid continuation          0
  879|       |    //   2 of 3 bytes       same                        0
  880|       |    //   3 bytes of 4       same                        +1 (need to insert surrogate pair)
  881|       |    //   1 of 2 bytes       invalid continuation        +1 (need to insert replacement and restart)
  882|       |    //   2 of 3 bytes       same                        +1 (same)
  883|       |    //   3 of 4 bytes       same                        +1 (same)
  884|      4|    QString result(in.size() + 1, Qt::Uninitialized);
  885|      4|    QChar *end = convertToUnicode(result.data(), in, state);
  886|      4|    result.truncate(end - result.constData());
  887|      4|    return result;
  888|      4|}
_ZN5QUtf816convertToUnicodeEPDs14QByteArrayViewPN20QStringConverterBase5StateE:
  891|      4|{
  892|      4|    qsizetype len = in.size();
  893|       |
  894|      4|    Q_ASSERT(state);
  895|      4|    if (!len)
  ------------------
  |  Branch (895:9): [True: 0, False: 4]
  ------------------
  896|      0|        return dst;
  897|       |
  898|       |
  899|      4|    char16_t replacement = QChar::ReplacementCharacter;
  900|      4|    if (state->flags & QStringConverter::Flag::ConvertInvalidToNull)
  ------------------
  |  Branch (900:9): [True: 0, False: 4]
  ------------------
  901|      0|        replacement = QChar::Null;
  902|       |
  903|      4|    qsizetype res;
  904|       |
  905|      4|    const uchar *src = reinterpret_cast<const uchar *>(in.data());
  906|      4|    const uchar *end = src + len;
  907|       |
  908|      4|    if (!(state->flags & QStringConverter::Flag::Stateless)) {
  ------------------
  |  Branch (908:9): [True: 0, False: 4]
  ------------------
  909|      0|        bool headerdone = state->internalState & HeaderDone || state->flags & QStringConverter::Flag::ConvertInitialBom;
  ------------------
  |  Branch (909:27): [True: 0, False: 0]
  |  Branch (909:64): [True: 0, False: 0]
  ------------------
  910|      0|        if (state->remainingChars || !headerdone) {
  ------------------
  |  Branch (910:13): [True: 0, False: 0]
  |  Branch (910:38): [True: 0, False: 0]
  ------------------
  911|       |            // handle incoming state first
  912|      0|            uchar remainingCharsData[4]; // longest UTF-8 sequence possible
  913|      0|            qsizetype remainingCharsCount = state->remainingChars;
  914|      0|            qsizetype newCharsToCopy = qMin<qsizetype>(sizeof(remainingCharsData) - remainingCharsCount, end - src);
  915|       |
  916|      0|            memset(remainingCharsData, 0, sizeof(remainingCharsData));
  917|      0|            memcpy(remainingCharsData, &state->state_data[0], remainingCharsCount);
  918|      0|            memcpy(remainingCharsData + remainingCharsCount, src, newCharsToCopy);
  919|       |
  920|      0|            const uchar *begin = &remainingCharsData[1];
  921|      0|            res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(remainingCharsData[0], dst, begin,
  922|      0|                    static_cast<const uchar *>(remainingCharsData) + remainingCharsCount + newCharsToCopy);
  923|      0|            if (res == QUtf8BaseTraits::Error) {
  ------------------
  |  Branch (923:17): [True: 0, False: 0]
  ------------------
  924|      0|                ++state->invalidChars;
  925|      0|                *dst++ = replacement;
  926|      0|                ++src;
  927|      0|            } else if (res == QUtf8BaseTraits::EndOfString) {
  ------------------
  |  Branch (927:24): [True: 0, False: 0]
  ------------------
  928|       |                // if we got EndOfString again, then there were too few bytes in src;
  929|       |                // copy to our state and return
  930|      0|                state->remainingChars = remainingCharsCount + newCharsToCopy;
  931|      0|                memcpy(&state->state_data[0], remainingCharsData, state->remainingChars);
  932|      0|                return dst;
  933|      0|            } else if (!headerdone) {
  ------------------
  |  Branch (933:24): [True: 0, False: 0]
  ------------------
  934|       |                // eat the UTF-8 BOM
  935|      0|                if (dst[-1] == 0xfeff)
  ------------------
  |  Branch (935:21): [True: 0, False: 0]
  ------------------
  936|      0|                    --dst;
  937|      0|            }
  938|      0|            state->internalState |= HeaderDone;
  939|       |
  940|       |            // adjust src now that we have maybe consumed a few chars
  941|      0|            if (res >= 0) {
  ------------------
  |  Branch (941:17): [True: 0, False: 0]
  ------------------
  942|      0|                Q_ASSERT(res > remainingCharsCount);
  943|      0|                src += res - remainingCharsCount;
  944|      0|            }
  945|      0|        }
  946|      4|    } else if (!(state->flags & QStringConverter::Flag::ConvertInitialBom)) {
  ------------------
  |  Branch (946:16): [True: 4, False: 0]
  ------------------
  947|       |        // stateless, remove initial BOM
  948|      4|        if (len > 2 && src[0] == utf8bom[0] && src[1] == utf8bom[1] && src[2] == utf8bom[2])
  ------------------
  |  Branch (948:13): [True: 3, False: 1]
  |  Branch (948:24): [True: 0, False: 3]
  |  Branch (948:48): [True: 0, False: 0]
  |  Branch (948:72): [True: 0, False: 0]
  ------------------
  949|       |            // skip BOM
  950|      0|            src += 3;
  951|      4|    }
  952|       |
  953|       |    // main body, stateless decoding
  954|      4|    res = 0;
  955|      4|    dst = convertToUnicode(dst, { src, end }, [&](char16_t *&dst, const uchar *src_, int res_) {
  956|      4|        res = res_;
  957|      4|        src = src_;
  958|      4|        if (res == QUtf8BaseTraits::Error) {
  959|      4|            res = 0;
  960|      4|            ++state->invalidChars;
  961|      4|            *dst++ = replacement;
  962|      4|        }
  963|      4|        return res == 0;    // continue if plain decoding error
  964|      4|    });
  965|       |
  966|      4|    if (res == QUtf8BaseTraits::EndOfString) {
  ------------------
  |  Branch (966:9): [True: 0, False: 4]
  ------------------
  967|       |        // unterminated UTF sequence
  968|      0|        if (state->flags & QStringConverter::Flag::Stateless) {
  ------------------
  |  Branch (968:13): [True: 0, False: 0]
  ------------------
  969|      0|            *dst++ = QChar::ReplacementCharacter;
  970|      0|            ++state->invalidChars;
  971|      0|            while (src++ < end) {
  ------------------
  |  Branch (971:20): [True: 0, False: 0]
  ------------------
  972|      0|                *dst++ = QChar::ReplacementCharacter;
  973|      0|                ++state->invalidChars;
  974|      0|            }
  975|      0|            state->remainingChars = 0;
  976|      0|        } else {
  977|      0|            --src; // unread the byte in ch
  978|      0|            state->remainingChars = end - src;
  979|      0|            memcpy(&state->state_data[0], src, end - src);
  980|      0|        }
  981|      4|    } else {
  982|      4|        state->remainingChars = 0;
  983|      4|    }
  984|       |
  985|      4|    return dst;
  986|      4|}
_ZN20QStringConverterBase5State5clearEv:
 1822|  1.49M|{
 1823|  1.49M|    if (clearFn)
  ------------------
  |  Branch (1823:9): [True: 0, False: 1.49M]
  ------------------
 1824|      0|        clearFn(this);
 1825|  1.49M|    else
 1826|  1.49M|        state_data[0] = state_data[1] = state_data[2] = state_data[3] = 0;
 1827|  1.49M|    remainingChars = 0;
 1828|  1.49M|    invalidChars = 0;
 1829|  1.49M|    internalState = 0;
 1830|  1.49M|}
qstringconverter.cpp:_ZL11fromUtf8Lenx:
 1946|      4|static qsizetype fromUtf8Len(qsizetype l) { return l + 1; }
qstringconverter.cpp:_ZL9toUtf8Lenx:
 1947|   186k|static qsizetype toUtf8Len(qsizetype l) { return 3*(l + 1); }
qstringconverter.cpp:_ZL13fromLocal8BitP5QChar14QByteArrayViewPN20QStringConverterBase5StateE:
 1932|      4|{
 1933|      4|    QString s = QLocal8Bit::convertToUnicode(in, state);
 1934|      4|    memcpy(out, s.constData(), s.size()*sizeof(QChar));
 1935|      4|    return out + s.size();
 1936|      4|}
qstringconverter.cpp:_ZL11toLocal8BitPc11QStringViewPN20QStringConverterBase5StateE:
 1939|   186k|{
 1940|   186k|    QByteArray s = QLocal8Bit::convertFromUnicode(in, state);
 1941|   186k|    memcpy(out, s.constData(), s.size());
 1942|   186k|    return out + s.size();
 1943|   186k|}
qstringconverter.cpp:_ZL15simdEncodeAsciiILm1EEbRPhRPKDsS4_S3_:
   74|   186k|{
   75|   186k|    size_t sizeBytes = reinterpret_cast<const char *>(end) - reinterpret_cast<const char *>(src);
   76|       |
   77|       |    // do sixteen characters at a time
   78|   186k|    auto process16Chars = [](uchar *dst, const char16_t *src) {
   79|   186k|        __m128i data1 = _mm_loadu_si128((const __m128i*)src);
   80|   186k|        __m128i data2 = _mm_loadu_si128(1+(const __m128i*)src);
   81|       |
   82|       |        // check if everything is ASCII
   83|       |        // the highest ASCII value is U+007F
   84|       |        // Do the packing directly:
   85|       |        // The PACKUSWB instruction has packs a signed 16-bit integer to an unsigned 8-bit
   86|       |        // with saturation. That is, anything from 0x0100 to 0x7fff is saturated to 0xff,
   87|       |        // while all negatives (0x8000 to 0xffff) get saturated to 0x00. To detect non-ASCII,
   88|       |        // we simply do a signed greater-than comparison to 0x00. That means we detect NULs as
   89|       |        // "non-ASCII", but it's an acceptable compromise.
   90|   186k|        __m128i packed = _mm_packus_epi16(data1, data2);
   91|   186k|        __m128i nonAscii = _mm_cmpgt_epi8(packed, _mm_setzero_si128());
   92|       |
   93|       |        // store, even if there are non-ASCII characters here
   94|   186k|        _mm_storeu_si128((__m128i*)dst, packed);
   95|       |
   96|       |        // n will contain 1 bit set per character in [data1, data2] that is non-ASCII (or NUL)
   97|   186k|        ushort n = ~_mm_movemask_epi8(nonAscii);
   98|   186k|        return n;
   99|   186k|    };
  100|   186k|    auto maybeFoundNonAscii = [&](auto n, qptrdiff offset = 0) {
  101|   186k|        if (n) {
  102|       |            // find the next probable ASCII character
  103|       |            // we don't want to load 32 bytes again in this loop if we know there are non-ASCII
  104|       |            // characters still coming
  105|   186k|            src += offset;
  106|   186k|            dst += offset;
  107|   186k|            nextAscii = src + qBitScanReverse(n) + 1;
  108|       |
  109|   186k|            n = qCountTrailingZeroBits(n);
  110|   186k|            dst += n;
  111|   186k|            src += n;
  112|   186k|            return false;
  113|   186k|        }
  114|   186k|        return src == end;
  115|   186k|    };
  116|   186k|    auto adjustToEnd = [&] {
  117|   186k|        dst += sizeBytes / sizeof(char16_t);
  118|   186k|        src = end;
  119|   186k|    };
  120|       |
  121|       |    if constexpr (Cpu & CpuFeatureAVX2) {
  122|       |        // The 256-bit VPACKUSWB[1] instruction interleaves the two input
  123|       |        // operands, so we need an extra permutation to get them back in-order.
  124|       |        // VPERMW takes 2 cyles to run while VPERMQ takes only 1.
  125|       |        // [1] https://www.felixcloutier.com/x86/PACKUSWB.html
  126|       |        constexpr size_t Step = 32;
  127|       |        auto process32Chars = [](const char16_t *src, uchar *dst) {
  128|       |            __m256i data1 = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(src));
  129|       |            __m256i data2 = _mm256_loadu_si256(reinterpret_cast<const __m256i *>(src) + 1);
  130|       |            __m256i packed = _mm256_packus_epi16(data1, data2); // will be [A, B, A, B]
  131|       |            __m256i permuted = _mm256_permute4x64_epi64(packed, _MM_SHUFFLE(3, 1, 2, 0));
  132|       |            __m256i nonAscii = _mm256_cmpgt_epi8(permuted, _mm256_setzero_si256());
  133|       |
  134|       |            // store, even if there are non-ASCII characters here
  135|       |            _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst), permuted);
  136|       |
  137|       |            return ~_mm256_movemask_epi8(nonAscii);
  138|       |        };
  139|       |
  140|       |        if constexpr (Cpu & CpuFeatureAVX512VL) {
  141|       |            // with AVX512/AXV10, we always process everything
  142|       |            if (sizeBytes <= Step * sizeof(char16_t)) {
  143|       |                uint mask = _bzhi_u32(-1, uint(sizeBytes / 2));
  144|       |                __m256i data1 = _mm256_maskz_loadu_epi16(mask, src);
  145|       |                __m256i data2 = _mm256_maskz_loadu_epi16(mask >> 16, src + Step / 2);
  146|       |                __m256i packed = _mm256_packus_epi16(data1, data2);
  147|       |                __m256i permuted = _mm256_permute4x64_epi64(packed, _MM_SHUFFLE(3, 1, 2, 0));
  148|       |                __mmask32 nonAscii = _mm256_mask_cmple_epi8_mask(mask, permuted, _mm256_setzero_si256());
  149|       |
  150|       |                // store, even if there are non-ASCII characters here
  151|       |                _mm256_mask_storeu_epi8(dst, mask, permuted);
  152|       |                if (nonAscii)
  153|       |                    return maybeFoundNonAscii(nonAscii);
  154|       |                adjustToEnd();
  155|       |                return true;
  156|       |            }
  157|       |        }
  158|       |
  159|       |        if (sizeBytes >= Step * sizeof(char16_t)) {
  160|       |            // do 32 characters at a time
  161|       |            qptrdiff offset = 0;
  162|       |            for ( ; (offset + Step) * sizeof(char16_t) < sizeBytes; offset += Step) {
  163|       |                if (uint n = process32Chars(src + offset, dst + offset))
  164|       |                    return maybeFoundNonAscii(n, offset);
  165|       |            }
  166|       |
  167|       |            // do 32 characters again, possibly overlapping with the loop above
  168|       |            adjustToEnd();
  169|       |            uint n = process32Chars(src - Step, dst - Step);
  170|       |            return maybeFoundNonAscii(n, -int(Step));
  171|       |        }
  172|       |    }
  173|       |
  174|   186k|    constexpr size_t Step = 16;
  175|   186k|    if (sizeBytes >= Step * sizeof(char16_t)) {
  ------------------
  |  Branch (175:9): [True: 186k, False: 0]
  ------------------
  176|       |
  177|   186k|        qptrdiff offset = 0;
  178|   565k|        for ( ; (offset + Step) * sizeof(char16_t) < sizeBytes; offset += Step) {
  ------------------
  |  Branch (178:17): [True: 378k, False: 186k]
  ------------------
  179|   378k|            ushort n = process16Chars(dst + offset, src + offset);
  180|   378k|            if (n)
  ------------------
  |  Branch (180:17): [True: 0, False: 378k]
  ------------------
  181|      0|                return maybeFoundNonAscii(n, offset);
  182|   378k|            if (Cpu & CpuFeatureAVX2)
  ------------------
  |  Branch (182:17): [Folded - Ignored]
  ------------------
  183|      0|                break;      // we can only ever loop once because of the code above
  184|   378k|        }
  185|       |
  186|       |        // do sixteen characters again, possibly overlapping with the loop above
  187|   186k|        adjustToEnd();
  188|   186k|        ushort n = process16Chars(dst - Step, src - Step);
  189|   186k|        return maybeFoundNonAscii(n, -int(Step));
  190|   186k|    }
  191|       |
  192|      0|#  if !defined(__OPTIMIZE_SIZE__)
  193|      0|    if (sizeBytes >= 8 * sizeof(char16_t)) {
  ------------------
  |  Branch (193:9): [True: 0, False: 0]
  ------------------
  194|       |        // do eight characters at a time
  195|      0|        __m128i data = _mm_loadu_si128(reinterpret_cast<const __m128i *>(src));
  196|      0|        __m128i data2 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(end - 8));
  197|      0|        __m128i packed = _mm_packus_epi16(data, data);
  198|      0|        __m128i nonAscii = _mm_cmpgt_epi8(packed, _mm_setzero_si128());
  199|       |
  200|       |        // store even non-ASCII
  201|      0|        _mm_storel_epi64(reinterpret_cast<__m128i *>(dst), packed);
  202|       |
  203|      0|        uchar n = ~_mm_movemask_epi8(nonAscii);
  204|      0|        if (n)
  ------------------
  |  Branch (204:13): [True: 0, False: 0]
  ------------------
  205|      0|            return maybeFoundNonAscii(n);
  206|       |
  207|      0|        adjustToEnd();
  208|      0|        packed = _mm_packus_epi16(data2, data2);
  209|      0|        nonAscii = _mm_cmpgt_epi8(packed, _mm_setzero_si128());
  210|      0|        _mm_storel_epi64(reinterpret_cast<__m128i *>(dst - 8), packed);
  211|      0|        n = ~_mm_movemask_epi8(nonAscii);
  212|      0|        return maybeFoundNonAscii(n, -8);
  213|      0|    } else if (sizeBytes >= 4 * sizeof(char16_t)) {
  ------------------
  |  Branch (213:16): [True: 0, False: 0]
  ------------------
  214|       |        // do four characters at a time
  215|      0|        __m128i data1 = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(src));
  216|      0|        __m128i data2 = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(end - 4));
  217|      0|        __m128i packed = _mm_packus_epi16(data1, data1);
  218|      0|        __m128i nonAscii = _mm_cmpgt_epi8(packed, _mm_setzero_si128());
  219|       |
  220|       |        // store even non-ASCII
  221|      0|        qToUnaligned(_mm_cvtsi128_si32(packed), dst);
  222|       |
  223|      0|        uchar n = uchar(_mm_movemask_epi8(nonAscii) ^ 0xf);
  224|      0|        if (n)
  ------------------
  |  Branch (224:13): [True: 0, False: 0]
  ------------------
  225|      0|            return maybeFoundNonAscii(n);
  226|       |
  227|      0|        adjustToEnd();
  228|      0|        packed = _mm_packus_epi16(data2, data2);
  229|      0|        nonAscii = _mm_cmpgt_epi8(packed, _mm_setzero_si128());
  230|      0|        qToUnaligned(_mm_cvtsi128_si32(packed), dst - 4);
  231|      0|        n = uchar(_mm_movemask_epi8(nonAscii) ^ 0xf);
  232|      0|        return maybeFoundNonAscii(n, -4);
  233|      0|    }
  234|      0|#endif
  235|       |
  236|      0|    return src == end;
  237|      0|}
qstringconverter.cpp:_ZZL15simdEncodeAsciiILm1EEbRPhRPKDsS4_S3_ENKUlS0_S3_E_clES0_S3_:
   78|   565k|    auto process16Chars = [](uchar *dst, const char16_t *src) {
   79|   565k|        __m128i data1 = _mm_loadu_si128((const __m128i*)src);
   80|   565k|        __m128i data2 = _mm_loadu_si128(1+(const __m128i*)src);
   81|       |
   82|       |        // check if everything is ASCII
   83|       |        // the highest ASCII value is U+007F
   84|       |        // Do the packing directly:
   85|       |        // The PACKUSWB instruction has packs a signed 16-bit integer to an unsigned 8-bit
   86|       |        // with saturation. That is, anything from 0x0100 to 0x7fff is saturated to 0xff,
   87|       |        // while all negatives (0x8000 to 0xffff) get saturated to 0x00. To detect non-ASCII,
   88|       |        // we simply do a signed greater-than comparison to 0x00. That means we detect NULs as
   89|       |        // "non-ASCII", but it's an acceptable compromise.
   90|   565k|        __m128i packed = _mm_packus_epi16(data1, data2);
   91|   565k|        __m128i nonAscii = _mm_cmpgt_epi8(packed, _mm_setzero_si128());
   92|       |
   93|       |        // store, even if there are non-ASCII characters here
   94|   565k|        _mm_storeu_si128((__m128i*)dst, packed);
   95|       |
   96|       |        // n will contain 1 bit set per character in [data1, data2] that is non-ASCII (or NUL)
   97|   565k|        ushort n = ~_mm_movemask_epi8(nonAscii);
   98|   565k|        return n;
   99|   565k|    };
qstringconverter.cpp:_ZZL15simdEncodeAsciiILm1EEbRPhRPKDsS4_S3_ENKUlT_xE_clItEEDaS5_x:
  100|   186k|    auto maybeFoundNonAscii = [&](auto n, qptrdiff offset = 0) {
  101|   186k|        if (n) {
  ------------------
  |  Branch (101:13): [True: 0, False: 186k]
  ------------------
  102|       |            // find the next probable ASCII character
  103|       |            // we don't want to load 32 bytes again in this loop if we know there are non-ASCII
  104|       |            // characters still coming
  105|      0|            src += offset;
  106|      0|            dst += offset;
  107|      0|            nextAscii = src + qBitScanReverse(n) + 1;
  108|       |
  109|      0|            n = qCountTrailingZeroBits(n);
  110|      0|            dst += n;
  111|      0|            src += n;
  112|      0|            return false;
  113|      0|        }
  114|   186k|        return src == end;
  115|   186k|    };
qstringconverter.cpp:_ZZL15simdEncodeAsciiILm1EEbRPhRPKDsS4_S3_ENKUlvE_clEv:
  116|   186k|    auto adjustToEnd = [&] {
  117|   186k|        dst += sizeBytes / sizeof(char16_t);
  118|   186k|        src = end;
  119|   186k|    };
qstringconverter.cpp:_ZN5QUtf818convertFromUnicodeIZNS_18convertFromUnicodeEPc11QStringViewPN20QStringConverterBase5StateEE3$_1EES1_S1_S2_OT_:
  671|   186k|{
  672|   186k|    qsizetype len = in.size();
  673|       |
  674|   186k|    uchar *dst = reinterpret_cast<uchar *>(out);
  675|   186k|    const char16_t *src = reinterpret_cast<const char16_t *>(in.data());
  676|   186k|    const char16_t *const end = src + len;
  677|       |
  678|   186k|    while (src != end) {
  ------------------
  |  Branch (678:12): [True: 186k, False: 0]
  ------------------
  679|   186k|        const char16_t *nextAscii = end;
  680|   186k|        if (simdEncodeAscii(dst, nextAscii, src, end))
  ------------------
  |  Branch (680:13): [True: 186k, False: 0]
  ------------------
  681|   186k|            break;
  682|       |
  683|      0|        do {
  684|      0|            char16_t u = *src++;
  685|      0|            int res = QUtf8Functions::toUtf8<QUtf8BaseTraits>(u, dst, src, end);
  686|      0|            if (Q_UNLIKELY(res < 0))
  687|      0|                onError(dst, u, res);
  688|      0|        } while (src < nextAscii);
  ------------------
  |  Branch (688:18): [True: 0, False: 0]
  ------------------
  689|      0|    }
  690|       |
  691|   186k|    return reinterpret_cast<char *>(dst);
  692|   186k|}
qstringconverter.cpp:_ZN5QUtf816convertToUnicodeIZNS_16convertToUnicodeEPDs14QByteArrayViewE3$_0EES1_S1_S2_OT_:
  846|   195k|{
  847|   195k|    const uchar *const start = reinterpret_cast<const uchar *>(in.data());
  848|   195k|    const uchar *src = start;
  849|   195k|    const uchar *end = src + in.size();
  850|       |
  851|       |    // attempt to do a full decoding in SIMD
  852|   195k|    const uchar *nextAscii = end;
  853|   195k|    while (src < end) {
  ------------------
  |  Branch (853:12): [True: 195k, False: 1]
  ------------------
  854|   195k|        nextAscii = end;
  855|   195k|        if (simdDecodeAscii(dst, nextAscii, src, end))
  ------------------
  |  Branch (855:13): [True: 195k, False: 1]
  ------------------
  856|   195k|            break;
  857|       |
  858|      1|        do {
  859|      1|            uchar b = *src++;
  860|      1|            const qsizetype res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(b, dst, src, end);
  861|      1|            if (Q_LIKELY(res >= 0))
  862|      1|                continue;
  863|       |            // decoding error
  864|      0|            if (!onError(dst, src, res))
  ------------------
  |  Branch (864:17): [True: 0, False: 0]
  ------------------
  865|      0|                return dst;
  866|      1|        } while (src < nextAscii);
  ------------------
  |  Branch (866:18): [True: 0, False: 1]
  ------------------
  867|      1|    }
  868|       |
  869|   195k|    return dst;
  870|   195k|}
qstringconverter.cpp:_ZL15simdDecodeAsciiILm1EEbRPDsRPKhS4_S3_:
  241|   195k|{
  242|       |    // do sixteen characters at a time
  243|   195k|    auto process16Chars = [](char16_t *dst, const uchar *src) {
  244|   195k|        __m128i data = _mm_loadu_si128((const __m128i*)src);
  245|       |
  246|       |        // check if everything is ASCII
  247|       |        // movemask extracts the high bit of every byte, so n is non-zero if something isn't ASCII
  248|   195k|        uint n = _mm_movemask_epi8(data);
  249|       |
  250|       |        // store everything, even mojibake
  251|   195k|        _mm_storeu_si128((__m128i*)dst, _mm_unpacklo_epi8(data, _mm_setzero_si128()));
  252|   195k|        _mm_storeu_si128(1+(__m128i*)dst, _mm_unpackhi_epi8(data, _mm_setzero_si128()));
  253|   195k|        return ushort(n);
  254|   195k|    };
  255|   195k|    auto maybeFoundNonAscii = [&](uint n, qptrdiff offset = 0) {
  256|       |        // find the next probable ASCII character
  257|       |        // we don't want to load 16 bytes again in this loop if we know there are non-ASCII
  258|       |        // characters still coming
  259|   195k|        if (n) {
  260|   195k|            uint c = qCountTrailingZeroBits(n);
  261|   195k|            src += offset;
  262|   195k|            dst += offset;
  263|   195k|            n = qBitScanReverse(n);
  264|   195k|            nextAscii = src + n + 1;
  265|   195k|            src += c;
  266|   195k|            dst += c;
  267|   195k|        }
  268|   195k|        return src == end;
  269|   195k|    };
  270|   195k|    auto adjustToEnd = [&] {
  271|   195k|        dst += end - src;
  272|   195k|        src = end;
  273|   195k|    };
  274|       |
  275|       |    if constexpr (Cpu & CpuFeatureAVX2) {
  276|       |        constexpr qsizetype Step = 32;
  277|       |        auto process32Chars = [](char16_t *dst, const uchar *src) {
  278|       |            __m128i data1 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(src));
  279|       |            __m128i data2 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(src) + 1);
  280|       |
  281|       |            // the processor can execute this VPOR (dispatches 3/cycle) faster
  282|       |            // than waiting for the VPMOVMSKB (1/cycle) of both data to check
  283|       |            // their masks
  284|       |            __m128i ored = _mm_or_si128(data1, data2);
  285|       |            bool any = _mm_movemask_epi8(ored);
  286|       |
  287|       |            // store everything, even mojibake
  288|       |            __m256i extended1 = _mm256_cvtepu8_epi16(data1);
  289|       |            __m256i extended2 = _mm256_cvtepu8_epi16(data2);
  290|       |            _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst), extended1);
  291|       |            _mm256_storeu_si256(reinterpret_cast<__m256i *>(dst) + 1, extended2);
  292|       |
  293|       |            uint n1 = _mm_movemask_epi8(data1);
  294|       |            uint n2 = _mm_movemask_epi8(data2);
  295|       |            struct R {
  296|       |                uint n1, n2;
  297|       |                bool any;
  298|       |                operator bool() const { return any; }
  299|       |                operator uint() const { return n1|(n2 << 16); }
  300|       |            };
  301|       |            return R{ n1, n2, any };
  302|       |        };
  303|       |
  304|       |        if constexpr (Cpu & CpuFeatureAVX512VL) {
  305|       |            // with AVX512/AXV10, we always process everything
  306|       |            if (end - src <= Step) {
  307|       |                __mmask32 mask = _bzhi_u32(-1, uint(end - src));
  308|       |                __m256i data = _mm256_maskz_loadu_epi8(mask, src);
  309|       |                __mmask32 nonAscii = _mm256_mask_cmple_epi8_mask(mask, data, _mm256_setzero_si256());
  310|       |
  311|       |                // store everything, even mojibake
  312|       |                __m256i extended1 = _mm256_cvtepu8_epi16(_mm256_castsi256_si128(data));
  313|       |                __m256i extended2 = _mm256_cvtepu8_epi16(_mm256_extracti64x2_epi64(data, 1));
  314|       |                _mm256_mask_storeu_epi16(dst, mask, extended1);
  315|       |                _mm256_mask_storeu_epi16(dst + Step/2, mask >> 16, extended2);
  316|       |                if (nonAscii)
  317|       |                    return maybeFoundNonAscii(nonAscii);
  318|       |                adjustToEnd();
  319|       |                return true;
  320|       |            }
  321|       |        }
  322|       |
  323|       |        if (end - src >= Step) {
  324|       |            // do 32 characters at a time
  325|       |            qptrdiff offset = 0;
  326|       |            for ( ; offset + Step < end - src; offset += Step) {
  327|       |                auto r = process32Chars(dst + offset, src + offset);
  328|       |                if (r)
  329|       |                    return maybeFoundNonAscii(r, offset);
  330|       |            }
  331|       |
  332|       |            // do 32 characters again, possibly overlapping with the loop above
  333|       |            adjustToEnd();
  334|       |            auto r = process32Chars(dst - Step, src - Step);
  335|       |            return maybeFoundNonAscii(r, -Step);
  336|       |        }
  337|       |    }
  338|       |
  339|   195k|    constexpr qsizetype Step = 16;
  340|   195k|    if (end - src >= Step) {
  ------------------
  |  Branch (340:9): [True: 187k, False: 7.73k]
  ------------------
  341|   187k|        qptrdiff offset = 0;
  342|   557k|        for ( ; offset + Step < end - src; offset += Step) {
  ------------------
  |  Branch (342:17): [True: 369k, False: 187k]
  ------------------
  343|   369k|            ushort n = process16Chars(dst + offset, src + offset);
  344|   369k|            if (n)
  ------------------
  |  Branch (344:17): [True: 0, False: 369k]
  ------------------
  345|      0|                return maybeFoundNonAscii(n, offset);
  346|   369k|            if (Cpu & CpuFeatureAVX2)
  ------------------
  |  Branch (346:17): [Folded - Ignored]
  ------------------
  347|      0|                break;      // we can only ever loop once because of the code above
  348|   369k|        }
  349|       |
  350|       |        // do one chunk again, possibly overlapping with the loop above
  351|   187k|        adjustToEnd();
  352|   187k|        return maybeFoundNonAscii(process16Chars(dst - Step, src - Step), -Step);
  353|   187k|    }
  354|       |
  355|  7.73k|#  if !defined(__OPTIMIZE_SIZE__)
  356|  7.73k|    if (end - src >= 8) {
  ------------------
  |  Branch (356:9): [True: 7.73k, False: 5]
  ------------------
  357|  7.73k|        __m128i data = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(src));
  358|  7.73k|        __m128i data2 = _mm_loadl_epi64(reinterpret_cast<const __m128i *>(end - 8));
  359|  7.73k|        uint n = _mm_movemask_epi8(data) & 0xff;
  360|       |        // store everything, even mojibake
  361|  7.73k|        _mm_storeu_si128(reinterpret_cast<__m128i *>(dst), _mm_unpacklo_epi8(data, _mm_setzero_si128()));
  362|  7.73k|        if (n)
  ------------------
  |  Branch (362:13): [True: 0, False: 7.73k]
  ------------------
  363|      0|            return maybeFoundNonAscii(n);
  364|       |
  365|       |        // do one chunk again, possibly overlapping the above
  366|  7.73k|        adjustToEnd();
  367|  7.73k|        n = _mm_movemask_epi8(data2) & 0xff;
  368|  7.73k|        data2 = _mm_unpacklo_epi8(data2, _mm_setzero_si128());
  369|  7.73k|        _mm_storeu_si128(reinterpret_cast<__m128i *>(dst - 8), data2);
  370|  7.73k|        return maybeFoundNonAscii(n, -8);
  371|  7.73k|    }
  372|      5|    if (end - src >= 4) {
  ------------------
  |  Branch (372:9): [True: 3, False: 2]
  ------------------
  373|      3|        __m128i data = _mm_cvtsi32_si128(qFromUnaligned<quint32>(src));
  374|      3|        __m128i data2 = _mm_cvtsi32_si128(qFromUnaligned<quint32>(end - 4));
  375|      3|        uchar n = uchar(_mm_movemask_epi8(data) & 0xf);
  376|       |        // store everything, even mojibake
  377|      3|        data = _mm_unpacklo_epi8(data, _mm_setzero_si128());
  378|      3|        _mm_storel_epi64(reinterpret_cast<__m128i *>(dst), data);
  379|      3|        if (n)
  ------------------
  |  Branch (379:13): [True: 0, False: 3]
  ------------------
  380|      0|            return maybeFoundNonAscii(n);
  381|       |
  382|       |        // do one chunk again, possibly overlapping the above
  383|      3|        adjustToEnd();
  384|      3|        n = uchar(_mm_movemask_epi8(data2) & 0xf);
  385|      3|        data2 = _mm_unpacklo_epi8(data2, _mm_setzero_si128());
  386|      3|        _mm_storel_epi64(reinterpret_cast<__m128i *>(dst - 4), data2);
  387|      3|        return maybeFoundNonAscii(n, -4);
  388|      3|    }
  389|      2|#endif
  390|       |
  391|      2|    return src == end;
  392|      5|}
qstringconverter.cpp:_ZZL15simdDecodeAsciiILm1EEbRPDsRPKhS4_S3_ENKUlS0_S3_E_clES0_S3_:
  243|   557k|    auto process16Chars = [](char16_t *dst, const uchar *src) {
  244|   557k|        __m128i data = _mm_loadu_si128((const __m128i*)src);
  245|       |
  246|       |        // check if everything is ASCII
  247|       |        // movemask extracts the high bit of every byte, so n is non-zero if something isn't ASCII
  248|   557k|        uint n = _mm_movemask_epi8(data);
  249|       |
  250|       |        // store everything, even mojibake
  251|   557k|        _mm_storeu_si128((__m128i*)dst, _mm_unpacklo_epi8(data, _mm_setzero_si128()));
  252|   557k|        _mm_storeu_si128(1+(__m128i*)dst, _mm_unpackhi_epi8(data, _mm_setzero_si128()));
  253|   557k|        return ushort(n);
  254|   557k|    };
qstringconverter.cpp:_ZZL15simdDecodeAsciiILm1EEbRPDsRPKhS4_S3_ENKUljxE_clEjx:
  255|   195k|    auto maybeFoundNonAscii = [&](uint n, qptrdiff offset = 0) {
  256|       |        // find the next probable ASCII character
  257|       |        // we don't want to load 16 bytes again in this loop if we know there are non-ASCII
  258|       |        // characters still coming
  259|   195k|        if (n) {
  ------------------
  |  Branch (259:13): [True: 0, False: 195k]
  ------------------
  260|      0|            uint c = qCountTrailingZeroBits(n);
  261|      0|            src += offset;
  262|      0|            dst += offset;
  263|      0|            n = qBitScanReverse(n);
  264|      0|            nextAscii = src + n + 1;
  265|      0|            src += c;
  266|      0|            dst += c;
  267|      0|        }
  268|   195k|        return src == end;
  269|   195k|    };
qstringconverter.cpp:_ZZL15simdDecodeAsciiILm1EEbRPDsRPKhS4_S3_ENKUlvE_clEv:
  270|   195k|    auto adjustToEnd = [&] {
  271|   195k|        dst += end - src;
  272|   195k|        src = end;
  273|   195k|    };
qstringconverter.cpp:_ZN5QUtf816convertToUnicodeIZNS_16convertToUnicodeEPDs14QByteArrayViewPN20QStringConverterBase5StateEE3$_0EES1_S1_S2_OT_:
  846|      4|{
  847|      4|    const uchar *const start = reinterpret_cast<const uchar *>(in.data());
  848|      4|    const uchar *src = start;
  849|      4|    const uchar *end = src + in.size();
  850|       |
  851|       |    // attempt to do a full decoding in SIMD
  852|      4|    const uchar *nextAscii = end;
  853|      5|    while (src < end) {
  ------------------
  |  Branch (853:12): [True: 4, False: 1]
  ------------------
  854|      4|        nextAscii = end;
  855|      4|        if (simdDecodeAscii(dst, nextAscii, src, end))
  ------------------
  |  Branch (855:13): [True: 3, False: 1]
  ------------------
  856|      3|            break;
  857|       |
  858|      1|        do {
  859|      1|            uchar b = *src++;
  860|      1|            const qsizetype res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(b, dst, src, end);
  861|      1|            if (Q_LIKELY(res >= 0))
  862|      1|                continue;
  863|       |            // decoding error
  864|      0|            if (!onError(dst, src, res))
  ------------------
  |  Branch (864:17): [True: 0, False: 0]
  ------------------
  865|      0|                return dst;
  866|      1|        } while (src < nextAscii);
  ------------------
  |  Branch (866:18): [True: 0, False: 1]
  ------------------
  867|      1|    }
  868|       |
  869|      4|    return dst;
  870|      4|}

_ZN15QUtf8BaseTraits11appendUtf16ERPDsDs:
  102|      2|    { *ptr++ = char16_t(uc); }
_ZN5QUtf816convertToUnicodeEP5QChar14QByteArrayView:
  304|   195k|    {
  305|   195k|        char16_t *dst = reinterpret_cast<char16_t *>(buffer);
  306|   195k|        dst = QUtf8::convertToUnicode(dst, in);
  307|   195k|        return reinterpret_cast<QChar *>(dst);
  308|   195k|    }
_ZN5QUtf816convertToUnicodeEP5QChar14QByteArrayViewPN20QStringConverterBase5StateE:
  315|      4|    {
  316|      4|        char16_t *buffer = reinterpret_cast<char16_t *>(out);
  317|      4|        buffer = convertToUnicode(buffer, in, state);
  318|      4|        return reinterpret_cast<QChar *>(buffer);
  319|      4|    }
_ZN10QLocal8Bit16convertToUnicodeE14QByteArrayViewPN20QStringConverterBase5StateE:
  366|      4|    { return QUtf8::convertToUnicode(in, state); }
_ZN10QLocal8Bit18convertFromUnicodeE11QStringViewPN20QStringConverterBase5StateE:
  368|   186k|    { return QUtf8::convertFromUnicode(in, state); }
_ZN14QUtf8Functions8fromUtf8I15QUtf8BaseTraitsPDsPKhEExhRT0_RT1_S7_:
  200|      2|    {
  201|      2|        qsizetype charsNeeded;
  202|      2|        char32_t min_uc;
  203|      2|        char32_t uc;
  204|       |
  205|      2|        if (!Traits::skipAsciiHandling && b < 0x80) {
  ------------------
  |  Branch (205:13): [Folded - Ignored]
  |  Branch (205:43): [True: 2, False: 0]
  ------------------
  206|       |            // US-ASCII
  207|      2|            Traits::appendUtf16(dst, b);
  208|      2|            return 1;
  209|      2|        }
  210|       |
  211|      0|        if (!Traits::isTrusted && Q_UNLIKELY(b <= 0xC1)) {
  ------------------
  |  Branch (211:13): [Folded - Ignored]
  ------------------
  212|       |            // an UTF-8 first character must be at least 0xC0
  213|       |            // however, all 0xC0 and 0xC1 first bytes can only produce overlong sequences
  214|      0|            return Traits::Error;
  215|      0|        } else if (b < 0xe0) {
  ------------------
  |  Branch (215:20): [True: 0, False: 0]
  ------------------
  216|      0|            charsNeeded = 2;
  217|      0|            min_uc = 0x80;
  218|      0|            uc = b & 0x1f;
  219|      0|        } else if (b < 0xf0) {
  ------------------
  |  Branch (219:20): [True: 0, False: 0]
  ------------------
  220|      0|            charsNeeded = 3;
  221|      0|            min_uc = 0x800;
  222|      0|            uc = b & 0x0f;
  223|      0|        } else if (b < 0xf5) {
  ------------------
  |  Branch (223:20): [True: 0, False: 0]
  ------------------
  224|      0|            charsNeeded = 4;
  225|      0|            min_uc = 0x10000;
  226|      0|            uc = b & 0x07;
  227|      0|        } else {
  228|       |            // the last Unicode character is U+10FFFF
  229|       |            // it's encoded in UTF-8 as "\xF4\x8F\xBF\xBF"
  230|       |            // therefore, a byte higher than 0xF4 is not the UTF-8 first byte
  231|      0|            return Traits::Error;
  232|      0|        }
  233|       |
  234|      0|        qptrdiff bytesAvailable = Traits::availableBytes(src, end);
  235|      0|        if (Q_UNLIKELY(bytesAvailable < charsNeeded - 1)) {
  236|       |            // it's possible that we have an error instead of just unfinished bytes
  237|      0|            if (bytesAvailable > 0 && !isContinuationByte(Traits::peekByte(src, 0)))
  ------------------
  |  Branch (237:17): [True: 0, False: 0]
  |  Branch (237:39): [True: 0, False: 0]
  ------------------
  238|      0|                return Traits::Error;
  239|      0|            if (bytesAvailable > 1 && !isContinuationByte(Traits::peekByte(src, 1)))
  ------------------
  |  Branch (239:17): [True: 0, False: 0]
  |  Branch (239:39): [True: 0, False: 0]
  ------------------
  240|      0|                return Traits::Error;
  241|      0|            return Traits::EndOfString;
  242|      0|        }
  243|       |
  244|       |        // first continuation character
  245|      0|        b = Traits::peekByte(src, 0);
  246|      0|        if (!isContinuationByte(b))
  ------------------
  |  Branch (246:13): [True: 0, False: 0]
  ------------------
  247|      0|            return Traits::Error;
  248|      0|        uc <<= 6;
  249|      0|        uc |= b & 0x3f;
  250|       |
  251|      0|        if (charsNeeded > 2) {
  ------------------
  |  Branch (251:13): [True: 0, False: 0]
  ------------------
  252|       |            // second continuation character
  253|      0|            b = Traits::peekByte(src, 1);
  254|      0|            if (!isContinuationByte(b))
  ------------------
  |  Branch (254:17): [True: 0, False: 0]
  ------------------
  255|      0|                return Traits::Error;
  256|      0|            uc <<= 6;
  257|      0|            uc |= b & 0x3f;
  258|       |
  259|      0|            if (charsNeeded > 3) {
  ------------------
  |  Branch (259:17): [True: 0, False: 0]
  ------------------
  260|       |                // third continuation character
  261|      0|                b = Traits::peekByte(src, 2);
  262|      0|                if (!isContinuationByte(b))
  ------------------
  |  Branch (262:21): [True: 0, False: 0]
  ------------------
  263|      0|                    return Traits::Error;
  264|      0|                uc <<= 6;
  265|      0|                uc |= b & 0x3f;
  266|      0|            }
  267|      0|        }
  268|       |
  269|       |        // we've decoded something; safety-check it
  270|      0|        if (!Traits::isTrusted) {
  ------------------
  |  Branch (270:13): [Folded - Ignored]
  ------------------
  271|      0|            if (uc < min_uc)
  ------------------
  |  Branch (271:17): [True: 0, False: 0]
  ------------------
  272|      0|                return Traits::Error;
  273|      0|            if (QChar::isSurrogate(uc) || uc > QChar::LastValidCodePoint)
  ------------------
  |  Branch (273:17): [True: 0, False: 0]
  |  Branch (273:43): [True: 0, False: 0]
  ------------------
  274|      0|                return Traits::Error;
  275|      0|            if (!Traits::allowNonCharacters && QChar::isNonCharacter(uc))
  ------------------
  |  Branch (275:17): [Folded - Ignored]
  |  Branch (275:48): [True: 0, False: 0]
  ------------------
  276|      0|                return Traits::Error;
  277|      0|        }
  278|       |
  279|       |        // write the UTF-16 sequence
  280|      0|        if (!QChar::requiresSurrogates(uc)) {
  ------------------
  |  Branch (280:13): [True: 0, False: 0]
  ------------------
  281|       |            // UTF-8 decoded and no surrogates are required
  282|       |            // detach if necessary
  283|      0|            Traits::appendUtf16(dst, char16_t(uc));
  284|      0|        } else {
  285|       |            // UTF-8 decoded to something that requires a surrogate pair
  286|      0|            Traits::appendUcs4(dst, uc);
  287|      0|        }
  288|       |
  289|      0|        Traits::advanceByte(src, charsNeeded - 1);
  290|      0|        return charsNeeded;
  291|      0|    }

_ZN9QtPrivate28QStringList_removeDuplicatesEP5QListI7QStringE:
  778|      1|{
  779|      1|    QDuplicateTracker<QString> seen(that->size());
  780|      1|    return that->removeIf([&](const QString &s) { return seen.hasSeen(s); });
  781|      1|}

_ZNK11QStringView7indexOfE5QCharxN2Qt15CaseSensitivityE:
  281|      2|    { return QtPrivate::findString(*this, from, c.unicode(), cs); }
_ZN9QtPrivate10findStringE11QStringViewx5QCharN2Qt15CaseSensitivityE:
  495|      2|{
  496|      2|    if (from < -str.size()) // from < 0 && abs(from) > str.size(), avoiding overflow
  ------------------
  |  Branch (496:9): [True: 0, False: 2]
  ------------------
  497|      0|        return -1;
  498|      2|    if (from < 0)
  ------------------
  |  Branch (498:9): [True: 0, False: 2]
  ------------------
  499|      0|        from = qMax(from + str.size(), qsizetype(0));
  500|      2|    if (from < str.size()) {
  ------------------
  |  Branch (500:9): [True: 1, False: 1]
  ------------------
  501|      1|        const char16_t *s = str.utf16();
  502|      1|        char16_t c = ch.unicode();
  503|      1|        const char16_t *n = s + from;
  504|      1|        const char16_t *e = s + str.size();
  505|      1|        if (cs == Qt::CaseSensitive)
  ------------------
  |  Branch (505:13): [True: 1, False: 0]
  ------------------
  506|      1|            n = qustrchr(QStringView(n, e), c);
  507|      0|        else
  508|      0|            n = qustrcasechr(QStringView(n, e), c);
  509|      1|        if (n != e)
  ------------------
  |  Branch (509:13): [True: 0, False: 1]
  ------------------
  510|      0|            return n - s;
  511|      1|    }
  512|      2|    return -1;
  513|      2|}
_ZNK11QStringView4sizeEv:
  183|   942k|    [[nodiscard]] constexpr qsizetype size() const noexcept { return m_size; }
_ZNK11QStringView5utf16Ev:
  186|   186k|    [[nodiscard]] constexpr const storage_type *utf16() const noexcept { return m_data; }
_ZN11QStringViewC2IDsTnNSt3__19enable_ifIXsr9QtPrivate20IsCompatibleCharTypeIT_EE5valueEbE4typeELb1EEEPKS3_S7_:
  142|   186k|        : QStringView(f, l - f) {}
_ZN11QStringViewC2IDsTnNSt3__19enable_ifIXsr9QtPrivate20IsCompatibleCharTypeIT_EE5valueEbE4typeELb1EEEPKS3_x:
  135|   186k|        : m_size((Q_ASSERT(len >= 0), Q_ASSERT(str || !len), len)),
  ------------------
  |  |   31|   186k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:29): [True: 186k, False: 0]
  |  |  ------------------
  ------------------
                      : m_size((Q_ASSERT(len >= 0), Q_ASSERT(str || !len), len)),
  ------------------
  |  |   31|   186k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:30): [True: 186k, False: 1]
  |  |  |  Branch (31:30): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  136|   186k|          m_data(castHelper(str))
  137|       |#endif
  138|   186k|    {}
_ZN11QStringView10castHelperEPKDs:
  122|   186k|    { return str; }
_ZNK11QStringView4dataEv:
  184|   382k|    [[nodiscard]] const_pointer data() const noexcept { return reinterpret_cast<const_pointer>(m_data); }
_ZN11QStringViewC2I7QStringTnNSt3__19enable_ifIXsr3std7is_sameIT_S1_EE5valueEbE4typeELb1EEERKS4_:
  165|   195k|        : QStringView{str.begin(), str.size()} {}
_ZN11QStringViewC2I5QCharTnNSt3__19enable_ifIXsr9QtPrivate20IsCompatibleCharTypeIT_EE5valueEbE4typeELb1EEEPKS4_x:
  135|   382k|        : m_size((Q_ASSERT(len >= 0), Q_ASSERT(str || !len), len)),
  ------------------
  |  |   31|   382k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:29): [True: 382k, False: 0]
  |  |  ------------------
  ------------------
                      : m_size((Q_ASSERT(len >= 0), Q_ASSERT(str || !len), len)),
  ------------------
  |  |   31|   382k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:30): [True: 382k, False: 2]
  |  |  |  Branch (31:30): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  136|   382k|          m_data(castHelper(str))
  137|       |#endif
  138|   382k|    {}
_ZN11QStringView10castHelperI5QCharEEPKDsPKT_:
  120|   382k|    { return reinterpret_cast<const storage_type*>(str); }
_Z25qToStringViewIgnoringNullI7QStringTnNSt3__19enable_ifIXsr3std7is_sameIT_S0_EE5valueEbE4typeELb1EE11QStringViewRKS3_:
  476|     10|{ return QStringView(s.begin(), s.size()); }

_ZN14QAtomicPointerI21QReadWriteLockPrivateEC2EPS0_:
  125|  1.93k|    constexpr QAtomicPointer(T *value = nullptr) noexcept : QBasicAtomicPointer<T>(value) {}

_ZN10QAtomicOpsIiE11loadRelaxedIiEET_RKNSt3__16atomicIS2_EE:
  201|  3.30M|    {
  202|  3.30M|        return _q_value.load(std::memory_order_relaxed);
  203|  3.30M|    }
_ZN10QAtomicOpsIiE3refIiEEbRNSt3__16atomicIT_EE:
  245|   610k|    {
  246|       |        /* Conceptually, we want to
  247|       |         *    return ++_q_value != 0;
  248|       |         * However, that would be sequentially consistent, and thus stronger
  249|       |         * than what we need. Based on
  250|       |         * http://eel.is/c++draft/atomics.types.memop#6, we know that
  251|       |         * pre-increment is equivalent to fetch_add(1) + 1. Unlike
  252|       |         * pre-increment, fetch_add takes a memory order argument, so we can get
  253|       |         * the desired acquire-release semantics.
  254|       |         * One last gotcha is that fetch_add(1) + 1 would need to be converted
  255|       |         * back to T, because it's susceptible to integer promotion. To sidestep
  256|       |         * this issue and to avoid UB on signed overflow, we rewrite the
  257|       |         * expression to:
  258|       |         */
  259|   610k|        return _q_value.fetch_add(1, std::memory_order_acq_rel) != T(-1);
  260|   610k|    }
_ZN10QAtomicOpsIiE5derefIiEEbRNSt3__16atomicIT_EE:
  264|  1.41M|    {
  265|       |        // compare with ref
  266|  1.41M|        return _q_value.fetch_sub(1, std::memory_order_acq_rel) != T(1);
  267|  1.41M|    }
_ZN10QAtomicOpsIP21QReadWriteLockPrivateE11loadAcquireIS1_EET_RKNSt3__16atomicIS4_EE:
  213|  1.93k|    {
  214|  1.93k|        return _q_value.load(std::memory_order_acquire);
  215|  1.93k|    }
_ZN10QAtomicOpsIP13QMutexPrivateE11loadRelaxedIS1_EET_RKNSt3__16atomicIS4_EE:
  201|   381k|    {
  202|   381k|        return _q_value.load(std::memory_order_relaxed);
  203|   381k|    }
_ZN10QAtomicOpsIP13QMutexPrivateE17testAndSetAcquireIS1_EEbRNSt3__16atomicIT_EES6_S6_PS6_:
  284|   190k|    {
  285|   190k|        bool tmp = _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acquire, std::memory_order_acquire);
  286|   190k|        if (currentValue)
  ------------------
  |  Branch (286:13): [True: 0, False: 190k]
  ------------------
  287|      0|            *currentValue = expectedValue;
  288|   190k|        return tmp;
  289|   190k|    }
_ZN10QAtomicOpsIP13QMutexPrivateE20fetchAndStoreReleaseIS1_EET_RNSt3__16atomicIS4_EES4_:
  326|   190k|    {
  327|   190k|        return _q_value.exchange(newValue, std::memory_order_release);
  328|   190k|    }
_ZN10QAtomicOpsIP24QAbstractEventDispatcherE11loadRelaxedIS1_EET_RKNSt3__16atomicIS4_EE:
  201|  3.86k|    {
  202|  3.86k|        return _q_value.load(std::memory_order_relaxed);
  203|  3.86k|    }
_ZN10QAtomicOpsIP11QThreadDataE11loadRelaxedIS1_EET_RKNSt3__16atomicIS4_EE:
  201|   202k|    {
  202|   202k|        return _q_value.load(std::memory_order_relaxed);
  203|   202k|    }

_ZNK19QBasicAtomicIntegerIiE11loadRelaxedEv:
   36|  3.30M|    T loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); }
_ZN19QBasicAtomicPointerI21QReadWriteLockPrivateEC2EPS0_:
  248|  1.93k|    constexpr QBasicAtomicPointer(Type value) noexcept : _q_value(value) {}
_ZN19QBasicAtomicIntegerIiE3refEv:
   47|   610k|    bool ref() noexcept { return Ops::ref(_q_value); }
_ZN19QBasicAtomicIntegerIiE5derefEv:
   48|  1.41M|    bool deref() noexcept { return Ops::deref(_q_value); }
_ZNK19QBasicAtomicPointerI21QReadWriteLockPrivateE11loadAcquireEv:
  177|  1.93k|    Type loadAcquire() const noexcept { return Ops::loadAcquire(_q_value); }
_ZNK19QBasicAtomicPointerI13QMutexPrivateE11loadRelaxedEv:
  170|   381k|    Type loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); }
_ZN19QBasicAtomicPointerI13QMutexPrivateE17testAndSetAcquireEPS0_S2_:
  186|   190k|    { return Ops::testAndSetAcquire(_q_value, expectedValue, newValue); }
_ZN19QBasicAtomicPointerI13QMutexPrivateE20fetchAndStoreReleaseEPS0_:
  209|   190k|    { return Ops::fetchAndStoreRelease(_q_value, newValue); }
_ZNK19QBasicAtomicPointerI24QAbstractEventDispatcherE11loadRelaxedEv:
  170|  3.86k|    Type loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); }
_ZNK19QBasicAtomicPointerI11QThreadDataE11loadRelaxedEv:
  170|   202k|    Type loadRelaxed() const noexcept { return Ops::loadRelaxed(_q_value); }

qlogging.cpp:_ZN12_GLOBAL__N_114qt_scoped_lockI11QBasicMutexNSt3__111scoped_lockIJS1_EEEEET0_RT_:
   59|   186k|{
   60|   186k|    return Lock(mutex);
   61|   186k|}
qtenvironmentvariables.cpp:_ZN12_GLOBAL__N_114qt_scoped_lockI11QBasicMutexNSt3__111scoped_lockIJS1_EEEEET0_RT_:
   59|     28|{
   60|     28|    return Lock(mutex);
   61|     28|}
qloggingregistry.cpp:_ZN12_GLOBAL__N_114qt_scoped_lockI6QMutexNSt3__111scoped_lockIJS1_EEEEET0_RT_:
   59|      2|{
   60|      2|    return Lock(mutex);
   61|      2|}
qcoreapplication.cpp:_ZN12_GLOBAL__N_114qt_scoped_lockI6QMutexNSt3__111scoped_lockIJS1_EEEEET0_RT_:
   59|  1.93k|{
   60|  1.93k|    return Lock(mutex);
   61|  1.93k|}
qcoreapplication.cpp:_ZN12_GLOBAL__N_114qt_unique_lockI6QMutexNSt3__111unique_lockIS1_EEEET0_RT_:
   65|      1|{
   66|      1|    return Lock(mutex);
   67|      1|}
qresource.cpp:_ZN12_GLOBAL__N_114qt_scoped_lockI15QRecursiveMutexNSt3__111scoped_lockIJS1_EEEEET0_RT_:
   59|      1|{
   60|      1|    return Lock(mutex);
   61|      1|}

_ZN15QRecursiveMutexD2Ev:
  284|      2|{
  285|      2|}
_ZN15QRecursiveMutex7tryLockE14QDeadlineTimer:
  336|      1|{
  337|      1|    unsigned tsanFlags = QtTsan::MutexWriteReentrant | QtTsan::TryLock;
  338|      1|    QtTsan::mutexPreLock(this, tsanFlags);
  339|       |
  340|      1|    Qt::HANDLE self = QThread::currentThreadId();
  341|      1|    if (owner.loadRelaxed() == self) {
  ------------------
  |  Branch (341:9): [True: 0, False: 1]
  ------------------
  342|      0|        ++count;
  343|      0|        Q_ASSERT_X(count != 0, "QMutex::lock", "Overflow in recursion counter");
  344|      0|        QtTsan::mutexPostLock(this, tsanFlags, 0);
  345|      0|        return true;
  346|      0|    }
  347|      1|    bool success = true;
  348|      1|    if (timeout.isForever()) {
  ------------------
  |  Branch (348:9): [True: 1, False: 0]
  ------------------
  349|      1|        mutex.lock();
  350|      1|    } else {
  351|      0|        success = mutex.tryLock(timeout);
  352|      0|    }
  353|       |
  354|      1|    if (success)
  ------------------
  |  Branch (354:9): [True: 1, False: 0]
  ------------------
  355|      1|        owner.storeRelaxed(self);
  356|      0|    else
  357|      0|        tsanFlags |= QtTsan::TryLockFailed;
  358|       |
  359|      1|    QtTsan::mutexPostLock(this, tsanFlags, 0);
  360|       |
  361|      1|    return success;
  362|      1|}
_ZN15QRecursiveMutex6unlockEv:
  422|      1|{
  423|      1|    Q_ASSERT(owner.loadRelaxed() == QThread::currentThreadId());
  424|      1|    QtTsan::mutexPreUnlock(this, 0u);
  425|       |
  426|      1|    if (count > 0) {
  ------------------
  |  Branch (426:9): [True: 0, False: 1]
  ------------------
  427|      0|        count--;
  428|      1|    } else {
  429|      1|        owner.storeRelaxed(nullptr);
  430|      1|        mutex.unlock();
  431|      1|    }
  432|       |
  433|      1|    QtTsan::mutexPostUnlock(this, 0u);
  434|      1|}

_ZN11QBasicMutex4lockEv:
   40|   190k|    inline void lock() noexcept(FutexAlwaysAvailable) {
   41|   190k|        QtTsan::mutexPreLock(this, 0u);
   42|       |
   43|   190k|        if (!fastTryLock())
  ------------------
  |  Branch (43:13): [True: 0, False: 190k]
  ------------------
   44|      0|            lockInternal();
   45|       |
   46|   190k|        QtTsan::mutexPostLock(this, 0u, 0);
   47|   190k|    }
_ZN11QBasicMutex11fastTryLockEv:
   86|   190k|    {
   87|   190k|        if (d_ptr.loadRelaxed() != nullptr)
  ------------------
  |  Branch (87:13): [True: 0, False: 190k]
  ------------------
   88|      0|            return false;
   89|   190k|        return d_ptr.testAndSetAcquire(nullptr, dummyLocked());
   90|   190k|    }
_ZN11QBasicMutex11dummyLockedEv:
  106|   381k|    static inline QMutexPrivate *dummyLocked() {
  107|   381k|        return reinterpret_cast<QMutexPrivate *>(quintptr(1));
  108|   381k|    }
_ZN11QBasicMutex6unlockEv:
   50|   190k|    inline void unlock() noexcept {
   51|   190k|        Q_ASSERT(d_ptr.loadRelaxed()); //mutex must be locked
   52|       |
   53|   190k|        QtTsan::mutexPreUnlock(this, 0u);
   54|       |
   55|   190k|        if constexpr (FutexAlwaysAvailable) {
   56|       |            // we always unlock if we have futexes
   57|   190k|            if (QMutexPrivate *d = d_ptr.fetchAndStoreRelease(nullptr); d != dummyLocked())
  ------------------
  |  Branch (57:73): [True: 0, False: 190k]
  ------------------
   58|      0|                unlockInternalFutex(d);     // was contended
   59|       |        } else {
   60|       |            // if we don't have futexes, we can only unlock if not contended
   61|       |            if (QMutexPrivate *d; !d_ptr.testAndSetRelease(dummyLocked(), nullptr, d))
   62|       |                unlockInternal(d);          // was contended
   63|       |        }
   64|       |
   65|   190k|        QtTsan::mutexPostUnlock(this, 0u);
   66|   190k|    }
_ZN11QBasicMutexC2Ev:
   36|      6|        : d_ptr(nullptr)
   37|      6|    {}
_ZN6QMutexD2Ev:
  119|      6|    {
  120|      6|        QMutexPrivate *d = d_ptr.loadRelaxed();
  121|      6|        if (d)
  ------------------
  |  Branch (121:13): [True: 0, False: 6]
  ------------------
  122|      0|            destroyInternal(d);
  123|      6|    }
_ZN15QRecursiveMutex4lockEv:
  195|      1|    { tryLock(QDeadlineTimer(QDeadlineTimer::Forever)); }
_ZN6QMutexC2Ev:
  117|      6|    constexpr QMutex() = default;
_ZN12QMutexLockerI6QMutexEC2EPS0_:
  239|      6|    {
  240|      6|        m_mutex = mutex;
  241|      6|        if (Q_LIKELY(mutex)) {
  242|      6|            mutex->lock();
  243|      6|            m_isLocked = true;
  244|      6|        }
  245|      6|    }
_ZN12QMutexLockerI6QMutexED2Ev:
  256|      6|    {
  257|      6|        if (m_isLocked)
  ------------------
  |  Branch (257:13): [True: 5, False: 1]
  ------------------
  258|      5|            unlock();
  259|      6|    }
_ZN12QMutexLockerI6QMutexE6unlockEv:
  267|      6|    {
  268|      6|        Q_ASSERT(m_isLocked);
  269|      6|        m_mutex->unlock();
  270|      6|        m_isLocked = false;
  271|      6|    }
_ZN15QRecursiveMutexC2Ev:
  189|      2|    constexpr QRecursiveMutex() = default;
_ZN12QMutexLockerI11QBasicMutexEC2EPS0_:
  239|  1.93k|    {
  240|  1.93k|        m_mutex = mutex;
  241|  1.93k|        if (Q_LIKELY(mutex)) {
  242|  1.93k|            mutex->lock();
  243|  1.93k|            m_isLocked = true;
  244|  1.93k|        }
  245|  1.93k|    }
_ZN12QMutexLockerI11QBasicMutexED2Ev:
  256|  1.93k|    {
  257|  1.93k|        if (m_isLocked)
  ------------------
  |  Branch (257:13): [True: 1.93k, False: 0]
  ------------------
  258|  1.93k|            unlock();
  259|  1.93k|    }
_ZN12QMutexLockerI11QBasicMutexE6unlockEv:
  267|  1.93k|    {
  268|  1.93k|        Q_ASSERT(m_isLocked);
  269|  1.93k|        m_mutex->unlock();
  270|  1.93k|        m_isLocked = false;
  271|  1.93k|    }

_ZN14QReadWriteLock14tryLockForReadE14QDeadlineTimer:
  185|      3|{
  186|       |    // Fast case: non contended:
  187|      3|    QReadWriteLockPrivate *d = d_ptr.loadRelaxed();
  188|      3|    if (d == nullptr && d_ptr.testAndSetAcquire(nullptr, dummyLockedForRead, d))
  ------------------
  |  Branch (188:9): [True: 3, False: 0]
  |  Branch (188:25): [True: 3, False: 0]
  ------------------
  189|      3|        return true;
  190|      0|    return contendedTryLockForRead(d_ptr, timeout, d);
  191|      3|}
_ZN14QReadWriteLock15tryLockForWriteE14QDeadlineTimer:
  300|      2|{
  301|       |    // Fast case: non contended:
  302|      2|    QReadWriteLockPrivate *d = d_ptr.loadRelaxed();
  303|      2|    if (d == nullptr && d_ptr.testAndSetAcquire(nullptr, dummyLockedForWrite, d))
  ------------------
  |  Branch (303:9): [True: 2, False: 0]
  |  Branch (303:25): [True: 2, False: 0]
  ------------------
  304|      2|        return true;
  305|      0|    return contendedTryLockForWrite(d_ptr, timeout, d);
  306|      2|}
_ZN14QReadWriteLock6unlockEv:
  362|      5|{
  363|      5|    QReadWriteLockPrivate *d = d_ptr.loadAcquire();
  364|      5|    while (true) {
  ------------------
  |  Branch (364:12): [Folded - Ignored]
  ------------------
  365|      5|        Q_ASSERT_X(d, "QReadWriteLock::unlock()", "Cannot unlock an unlocked lock");
  366|       |
  367|       |        // Fast case: no contention: (no waiters, no other readers)
  368|      5|        if (quintptr(d) <= 2) { // 1 or 2 (StateLockedForRead or StateLockedForWrite)
  ------------------
  |  Branch (368:13): [True: 5, False: 0]
  ------------------
  369|      5|            if (!d_ptr.testAndSetOrdered(d, nullptr, d))
  ------------------
  |  Branch (369:17): [True: 0, False: 5]
  ------------------
  370|      0|                continue;
  371|      5|            return;
  372|      5|        }
  373|       |
  374|      0|        if ((quintptr(d) & StateMask) == StateLockedForRead) {
  ------------------
  |  Branch (374:13): [True: 0, False: 0]
  ------------------
  375|      0|            Q_ASSERT(quintptr(d) > (1U<<4)); //otherwise that would be the fast case
  376|       |            // Just decrease the reader's count.
  377|      0|            auto val = reinterpret_cast<QReadWriteLockPrivate *>(quintptr(d) - (1U<<4));
  378|      0|            if (!d_ptr.testAndSetOrdered(d, val, d))
  ------------------
  |  Branch (378:17): [True: 0, False: 0]
  ------------------
  379|      0|                continue;
  380|      0|            return;
  381|      0|        }
  382|       |
  383|      0|        Q_ASSERT(!isUncontendedLocked(d));
  384|       |
  385|      0|        if (d->recursive) {
  ------------------
  |  Branch (385:13): [True: 0, False: 0]
  ------------------
  386|      0|            d->recursiveUnlock();
  387|      0|            return;
  388|      0|        }
  389|       |
  390|      0|        const auto lock = qt_scoped_lock(d->mutex);
  391|      0|        if (d->writerCount) {
  ------------------
  |  Branch (391:13): [True: 0, False: 0]
  ------------------
  392|      0|            Q_ASSERT(d->writerCount == 1);
  393|      0|            Q_ASSERT(d->readerCount == 0);
  394|      0|            d->writerCount = 0;
  395|      0|        } else {
  396|      0|            Q_ASSERT(d->readerCount > 0);
  397|      0|            d->readerCount--;
  398|      0|            if (d->readerCount > 0)
  ------------------
  |  Branch (398:17): [True: 0, False: 0]
  ------------------
  399|      0|                return;
  400|      0|        }
  401|       |
  402|      0|        if (d->waitingReaders || d->waitingWriters) {
  ------------------
  |  Branch (402:13): [True: 0, False: 0]
  |  Branch (402:34): [True: 0, False: 0]
  ------------------
  403|      0|            d->unlock();
  404|      0|        } else {
  405|      0|            Q_ASSERT(d_ptr.loadRelaxed() == d); // should not change when we still hold the mutex
  406|      0|            d_ptr.storeRelease(nullptr);
  407|      0|            d->release();
  408|      0|        }
  409|      0|        return;
  410|      0|    }
  411|      5|}

_ZN11QReadLockerD2Ev:
   99|      3|    { unlock(); }
_ZN11QReadLocker6unlockEv:
  102|      3|    {
  103|      3|        if (q_val) {
  ------------------
  |  Branch (103:13): [True: 3, False: 0]
  ------------------
  104|      3|            if ((q_val & quintptr(1u)) == quintptr(1u)) {
  ------------------
  |  Branch (104:17): [True: 3, False: 0]
  ------------------
  105|      3|                q_val &= ~quintptr(1u);
  106|      3|                readWriteLock()->unlock();
  107|      3|            }
  108|      3|        }
  109|      3|    }
_ZN11QReadLocker6relockEv:
  112|      3|    {
  113|      3|        if (q_val) {
  ------------------
  |  Branch (113:13): [True: 3, False: 0]
  ------------------
  114|      3|            if ((q_val & quintptr(1u)) == quintptr(0u)) {
  ------------------
  |  Branch (114:17): [True: 3, False: 0]
  ------------------
  115|      3|                readWriteLock()->lockForRead();
  116|      3|                q_val |= quintptr(1u);
  117|      3|            }
  118|      3|        }
  119|      3|    }
_ZNK11QReadLocker13readWriteLockEv:
  122|      6|    { return reinterpret_cast<QReadWriteLock *>(q_val & ~quintptr(1u)); }
_ZN12QWriteLockerD2Ev:
  144|      2|    { unlock(); }
_ZN12QWriteLocker6unlockEv:
  147|      2|    {
  148|      2|        if (q_val) {
  ------------------
  |  Branch (148:13): [True: 2, False: 0]
  ------------------
  149|      2|            if ((q_val & quintptr(1u)) == quintptr(1u)) {
  ------------------
  |  Branch (149:17): [True: 2, False: 0]
  ------------------
  150|      2|                q_val &= ~quintptr(1u);
  151|      2|                readWriteLock()->unlock();
  152|      2|            }
  153|      2|        }
  154|      2|    }
_ZN12QWriteLocker6relockEv:
  157|      2|    {
  158|      2|        if (q_val) {
  ------------------
  |  Branch (158:13): [True: 2, False: 0]
  ------------------
  159|      2|            if ((q_val & quintptr(1u)) == quintptr(0u)) {
  ------------------
  |  Branch (159:17): [True: 2, False: 0]
  ------------------
  160|      2|                readWriteLock()->lockForWrite();
  161|      2|                q_val |= quintptr(1u);
  162|      2|            }
  163|      2|        }
  164|      2|    }
_ZNK12QWriteLocker13readWriteLockEv:
  167|      4|    { return reinterpret_cast<QReadWriteLock *>(q_val & ~quintptr(1u)); }
_ZN12QWriteLockerC2EP14QReadWriteLock:
  176|      2|    : q_val(reinterpret_cast<quintptr>(areadWriteLock))
  177|      2|{
  178|      2|    Q_ASSERT_X((q_val & quintptr(1u)) == quintptr(0),
  179|      2|               "QWriteLocker", "QReadWriteLock pointer is misaligned");
  180|      2|    relock();
  181|      2|}
_ZN11QReadLockerC2EP14QReadWriteLock:
  130|      3|    : q_val(reinterpret_cast<quintptr>(areadWriteLock))
  131|      3|{
  132|      3|    Q_ASSERT_X((q_val & quintptr(1u)) == quintptr(0),
  133|      3|               "QReadLocker", "QReadWriteLock pointer is misaligned");
  134|      3|    relock();
  135|      3|}
_ZN14QReadWriteLockC2ENS_13RecursionModeE:
   56|  1.93k|    : d_ptr(recursionMode == Recursive ? initRecursive() : nullptr)
  ------------------
  |  Branch (56:13): [True: 0, False: 1.93k]
  ------------------
   57|  1.93k|{
   58|  1.93k|}
_ZN14QReadWriteLockD2Ev:
   61|  1.93k|{
   62|  1.93k|    if (auto d = d_ptr.loadAcquire())
  ------------------
  |  Branch (62:14): [True: 0, False: 1.93k]
  ------------------
   63|      0|        destroyRecursive(d);
   64|  1.93k|}
_ZN14QReadWriteLock11lockForReadEv:
   67|      3|{
   68|      3|    tryLockForRead(QDeadlineTimer(QDeadlineTimer::Forever));
   69|      3|}
_ZN14QReadWriteLock12lockForWriteEv:
   77|      2|{
   78|      2|    tryLockForWrite(QDeadlineTimer(QDeadlineTimer::Forever));
   79|      2|}

_ZN11QThreadDataD2Ev:
   46|      1|{
   47|      1|#if QT_CONFIG(thread)
   48|      1|    Q_ASSERT(_ref.loadRelaxed() == 0);
   49|      1|#endif
   50|       |
   51|      1|    if (threadId.loadAcquire() == QCoreApplicationPrivate::theMainThreadId.loadAcquire()) {
  ------------------
  |  Branch (51:9): [True: 1, False: 0]
  ------------------
   52|      1|        QCoreApplicationPrivate::theMainThread.storeRelease(nullptr);
   53|      1|        QCoreApplicationPrivate::theMainThreadId.storeRelaxed(nullptr);
   54|      1|        QThreadData::clearCurrentThreadData();
   55|      1|    }
   56|       |
   57|       |    // ~QThread() sets thread to nullptr, so if it isn't null here, it's
   58|       |    // because we're being run before the main object itself. This can only
   59|       |    // happen for QAdoptedThread. Note that both ~QThreadPrivate() and
   60|       |    // ~QObjectPrivate() will deref this object again, but that is acceptable
   61|       |    // because this destructor is still running (the _ref sub-object has not
   62|       |    // been destroyed) and there's no reentrancy. The refcount will become
   63|       |    // negative, but that's acceptable.
   64|      1|    QThread *t = thread.loadAcquire();
   65|      1|    thread.storeRelease(nullptr);
   66|      1|    delete t;
   67|       |
   68|      1|    for (qsizetype i = 0; i < postEventList.size(); ++i) {
  ------------------
  |  Branch (68:27): [True: 0, False: 1]
  ------------------
   69|      0|        const QPostEvent &pe = postEventList.at(i);
   70|      0|        if (pe.event) {
  ------------------
  |  Branch (70:13): [True: 0, False: 0]
  ------------------
   71|      0|            pe.receiver->d_func()->postedEvents.fetchAndSubRelaxed(1);
   72|      0|            pe.event->m_posted = false;
   73|      0|            delete pe.event;
   74|      0|        }
   75|      0|    }
   76|       |
   77|       |    // fprintf(stderr, "QThreadData %p destroyed\n", this);
   78|      1|}
_ZN11QThreadData21createEventDispatcherEv:
   81|  1.93k|{
   82|  1.93k|    QAbstractEventDispatcher *ed = QThreadPrivate::createEventDispatcher(this);
   83|  1.93k|    eventDispatcher.storeRelease(ed);
   84|  1.93k|    return ed;
   85|  1.93k|}
_ZN14QAdoptedThreadC2EP11QThreadData:
   92|      1|    : QThread(*new QThreadPrivate(data))
   93|      1|{
   94|       |    // avoid a cyclic reference count: QThreadData owns this QAdoptedThread
   95|       |    // object but QObject's constructor increased the count
   96|      1|    data->deref();
   97|       |
   98|      1|    data->isAdopted = true;
   99|      1|    Qt::HANDLE id = QThread::currentThreadId();
  100|      1|    data->threadId.storeRelaxed(id);
  101|      1|    if (!QCoreApplicationPrivate::theMainThreadId.loadAcquire()) {
  ------------------
  |  Branch (101:9): [True: 1, False: 0]
  ------------------
  102|       |        // we are the main thread
  103|      1|        QCoreApplicationPrivate::theMainThread.storeRelease(this);
  104|      1|        QCoreApplicationPrivate::theMainThreadId.storeRelaxed(id);
  105|       |
  106|       |        // bypass the bindings because nothing can be listening yet
  107|      1|        d_func()->setObjectNameWithoutBindings(u"Qt mainThread"_s);
  108|      1|    }
  109|       |
  110|       |    // thread should be running and not finished for the lifetime
  111|       |    // of the application (even if QCoreApplication goes away)
  112|      1|#if QT_CONFIG(thread)
  113|      1|    d_func()->threadState = QThreadPrivate::Running;
  114|      1|    init();
  115|      1|    d_func()->m_statusOrPendingObjects.setStatusAndClearList(
  116|      1|                QtPrivate::getBindingStatus({}));
  117|      1|#endif
  118|       |    // fprintf(stderr, "new QAdoptedThread = %p\n", this);
  119|      1|}
_ZN14QAdoptedThreadD2Ev:
  122|      1|{
  123|       |    // fprintf(stderr, "~QAdoptedThread = %p\n", this);
  124|      1|}
_ZN14QThreadPrivateC2EP11QThreadData:
  140|      1|    : QObjectPrivate(), data(d)
  141|      1|{
  142|       |
  143|       |// INTEGRITY doesn't support self-extending stack. The default stack size for
  144|       |// a pthread on INTEGRITY is too small so we have to increase the default size
  145|       |// to 128K.
  146|       |#ifdef Q_OS_INTEGRITY
  147|       |    stackSize = 128 * 1024;
  148|       |#elif defined(Q_OS_RTEMS)
  149|       |    Q_CONSTINIT static bool envStackSizeOk = false;
  150|       |    static const int envStackSize = qEnvironmentVariableIntValue("QT_DEFAULT_THREAD_STACK_SIZE", &envStackSizeOk);
  151|       |    if (envStackSizeOk)
  152|       |        stackSize = envStackSize;
  153|       |#endif
  154|       |
  155|       |#if defined (Q_OS_WIN)
  156|       |    handle = 0;
  157|       |    terminationEnabled = true;
  158|       |    terminatePending = false;
  159|       |#endif
  160|       |
  161|      1|    if (!data)
  ------------------
  |  Branch (161:9): [True: 0, False: 1]
  ------------------
  162|      0|        data = new QThreadData;
  163|      1|}
_ZN14QThreadPrivateD2Ev:
  166|      1|{
  167|       |    // access to m_statusOrPendingObjects cannot race with anything
  168|       |    // unless there is already a potential use-after-free bug, as the
  169|       |    // thread is in the process of being destroyed
  170|      1|    delete m_statusOrPendingObjects.list();
  171|      1|    data->deref();
  172|      1|}
_ZN7QThread13currentThreadEv:
  388|  3.86k|{
  389|  3.86k|    QThreadData *data = QThreadData::current();
  390|  3.86k|    Q_ASSERT(data != nullptr);
  391|  3.86k|    return data->thread.loadAcquire();
  392|  3.86k|}
_ZN7QThread12isMainThreadEv:
  407|  3.86k|{
  408|  3.86k|    return currentThreadId() == QCoreApplicationPrivate::theMainThreadId.loadRelaxed();
  409|  3.86k|}
_ZN7QThreadC2ER14QThreadPrivateP7QObject:
  430|      1|    : QObject(dd, parent)
  431|      1|{
  432|      1|    Q_D(QThread);
  433|       |    // fprintf(stderr, "QThreadData %p taken from private data for thread %p\n", d->data, this);
  434|      1|    d->data->thread.storeRelaxed(this);
  435|      1|}
_ZN7QThreadD2Ev:
  456|      1|{
  457|      1|    Q_D(QThread);
  458|      1|    {
  459|      1|        QMutexLocker locker(&d->mutex);
  460|      1|        if (d->threadState == QThreadPrivate::Finishing)
  ------------------
  |  Branch (460:13): [True: 0, False: 1]
  ------------------
  461|      0|            d->wait(locker, QDeadlineTimer::Forever);
  462|      1|        if (d->threadState == QThreadPrivate::Running && !d->data->isAdopted)
  ------------------
  |  Branch (462:13): [True: 0, False: 1]
  |  Branch (462:58): [True: 0, False: 0]
  ------------------
  463|      0|            qFatal("QThread: Destroyed while thread '%ls' is still running", qUtf16Printable(objectName()));
  464|       |
  465|      1|        d->data->thread.storeRelease(nullptr);
  466|      1|    }
  467|      1|}
_ZN9QtPrivate19BindingStatusOrList21setStatusAndClearListEP14QBindingStatus:
  605|      1|{
  606|       |
  607|      1|    if (auto pendingObjects = list()) {
  ------------------
  |  Branch (607:14): [True: 0, False: 1]
  ------------------
  608|      0|        for (auto obj: *pendingObjects)
  ------------------
  |  Branch (608:22): [True: 0, False: 0]
  ------------------
  609|      0|            QObjectPrivate::get(obj)->reinitBindingStorageAfterThreadMove();
  610|      0|        delete pendingObjects;
  611|      0|    }
  612|       |    // synchronizes-with the load-acquire in bindingStatus():
  613|      1|    data.store(encodeBindingStatus(status), std::memory_order_release);
  614|      1|}

_ZN7QThread15currentThreadIdEv:
  160|  5.80k|{
  161|       |    // define is undefed if we have to fall back to currentThreadIdImpl
  162|  5.80k|#define QT_HAS_FAST_CURRENT_THREAD_ID
  163|  5.80k|    Qt::HANDLE tid; // typedef to void*
  164|  5.80k|    static_assert(sizeof(tid) == sizeof(void*));
  165|       |    // See https://akkadia.org/drepper/tls.pdf for x86 ABI
  166|       |#if defined(Q_PROCESSOR_X86_32) && ((defined(Q_OS_LINUX) && defined(__GLIBC__)) || defined(Q_OS_FREEBSD)) // x86 32-bit always uses GS
  167|       |    __asm__("mov %%gs:%c1, %0" : "=r" (tid) : "i" (2 * sizeof(void*)) : );
  168|       |#elif defined(Q_PROCESSOR_X86_64) && defined(Q_OS_DARWIN)
  169|       |    // 64bit macOS uses GS, see https://github.com/apple/darwin-xnu/blob/master/libsyscall/os/tsd.h
  170|       |    __asm__("mov %%gs:0, %0" : "=r" (tid) : : );
  171|       |#elif defined(Q_PROCESSOR_X86_64) && ((defined(Q_OS_LINUX) && defined(__GLIBC__)) || defined(Q_OS_FREEBSD))
  172|       |    // x86_64 Linux, BSD uses FS
  173|  5.80k|    __asm__("mov %%fs:%c1, %0" : "=r" (tid) : "i" (2 * sizeof(void*)) : );
  174|       |#elif defined(Q_PROCESSOR_X86_64) && defined(Q_OS_WIN)
  175|       |    // See https://en.wikipedia.org/wiki/Win32_Thread_Information_Block
  176|       |    // First get the pointer to the TIB
  177|       |    quint8 *tib;
  178|       |# if defined(Q_CC_MINGW) // internal compiler error when using the intrinsics
  179|       |    __asm__("movq %%gs:0x30, %0" : "=r" (tib) : :);
  180|       |# else
  181|       |    tib = reinterpret_cast<quint8 *>(__readgsqword(0x30));
  182|       |# endif
  183|       |    // Then read the thread ID
  184|       |    tid = *reinterpret_cast<Qt::HANDLE *>(tib + 0x48);
  185|       |#elif defined(Q_PROCESSOR_X86_32) && defined(Q_OS_WIN)
  186|       |    // First get the pointer to the TIB
  187|       |    quint8 *tib;
  188|       |# if defined(Q_CC_MINGW) // internal compiler error when using the intrinsics
  189|       |    __asm__("movl %%fs:0x18, %0" : "=r" (tib) : :);
  190|       |# else
  191|       |    tib = reinterpret_cast<quint8 *>(__readfsdword(0x18));
  192|       |# endif
  193|       |    // Then read the thread ID
  194|       |    tid = *reinterpret_cast<Qt::HANDLE *>(tib + 0x24);
  195|       |#else
  196|       |#undef QT_HAS_FAST_CURRENT_THREAD_ID
  197|       |    tid = currentThreadIdImpl();
  198|       |#endif
  199|  5.80k|    return tid;
  200|  5.80k|}

_ZN11QThreadData7currentEv:
  313|   196k|    {
  314|   196k|        if (QThreadData *data = currentThreadData()) Q_LIKELY_BRANCH
  ------------------
  |  Branch (314:26): [True: 196k, False: 1]
  ------------------
  315|   196k|            return data;
  316|      1|        return createCurrentThreadData();
  317|   196k|    }
_ZNK11QThreadData18hasEventDispatcherEv:
  338|  1.93k|    { return eventDispatcher.loadRelaxed() != nullptr; }
_ZN24QScopedScopeLevelCounterC2EP11QThreadData:
  383|  1.93k|        : threadData(threadData)
  384|  1.93k|    { ++threadData->scopeLevel; }
_ZN24QScopedScopeLevelCounterD2Ev:
  386|  1.93k|    { --threadData->scopeLevel; }
_ZN14QPostEventListC2Ev:
   76|      1|    inline QPostEventList() : QList<QPostEvent>(), recursion(0), startOffset(0), insertionOffset(0) { }
_ZN9QtPrivate19BindingStatusOrListC2Ev:
  106|      1|    constexpr BindingStatusOrList() noexcept : data(0) {}
_ZN9QtPrivate19BindingStatusOrList6isListEy:
  121|      2|    static bool isList(quintptr data) noexcept { return data & 1; }
_ZNK9QtPrivate19BindingStatusOrList4listEv:
  137|      2|    {
  138|      2|        return decodeList(data.load(std::memory_order_relaxed));
  139|      2|    }
_ZN9QtPrivate19BindingStatusOrList10decodeListEy:
  143|      2|    {
  144|      2|        if (isList(ptr))
  ------------------
  |  Branch (144:13): [True: 0, False: 2]
  ------------------
  145|      0|            return reinterpret_cast<List *>(ptr & ~1);
  146|      2|        else
  147|      2|            return nullptr;
  148|      2|    }
_ZN9QtPrivate19BindingStatusOrList19encodeBindingStatusEP14QBindingStatus:
  151|      1|    {
  152|      1|        return quintptr(status);
  153|      1|    }
_ZN11QThreadDataC2Ei:
  306|      1|        : _ref(initialRefCount)
  307|      1|    {
  308|       |        // fprintf(stderr, "QThreadData %p created\n", this);
  309|      1|    }
_ZN11QThreadData3refEv:
  324|   190k|    {
  325|   190k|        (void) _ref.ref();
  326|   190k|        Q_ASSERT(_ref.loadRelaxed() != 0);
  327|   190k|    }
_ZN11QThreadData5derefEv:
  329|   190k|    {
  330|   190k|        if (!_ref.deref())
  ------------------
  |  Branch (330:13): [True: 1, False: 190k]
  ------------------
  331|      1|            delete this;
  332|   190k|    }

_ZN11QThreadData22clearCurrentThreadDataEv:
  237|      1|{
  238|      1|    set_thread_data(nullptr);
  239|      1|}
_ZN11QThreadData17currentThreadDataEv:
  242|   196k|{
  243|   196k|    return get_thread_data();
  244|   196k|}
_ZN11QThreadData23createCurrentThreadDataEv:
  247|      1|{
  248|      1|    Q_ASSERT(!currentThreadData());
  249|      1|    std::unique_ptr data = std::make_unique<QThreadData>();
  250|       |
  251|       |    // This needs to be called prior to new QAdoptedThread() to avoid
  252|       |    // recursion (see qobject.cpp).
  253|      1|    set_thread_data(data.get());
  254|       |
  255|      1|    QT_TRY {
  256|      1|        data->thread.storeRelease(new QAdoptedThread(data.get()));
  257|      1|    } QT_CATCH(...) {
  258|      0|        clearCurrentThreadData();
  259|      0|        QT_RETHROW;
  260|      0|    }
  261|      1|    return data.release();
  262|      1|}
_ZN14QAdoptedThread4initEv:
  265|      1|{
  266|      1|}
_ZN14QThreadPrivate21createEventDispatcherEP11QThreadData:
  279|  1.93k|{
  280|  1.93k|    Q_UNUSED(data);
  281|       |#if defined(Q_OS_DARWIN)
  282|       |    bool ok = false;
  283|       |    int value = qEnvironmentVariableIntValue("QT_EVENT_DISPATCHER_CORE_FOUNDATION", &ok);
  284|       |    if (ok && value > 0)
  285|       |        return new QEventDispatcherCoreFoundation;
  286|       |    else
  287|       |        return new QEventDispatcherUNIX;
  288|       |#elif defined(Q_OS_WASM)
  289|       |    return new QEventDispatcherWasm();
  290|       |#elif !defined(QT_NO_GLIB)
  291|       |    const bool isQtMainThread = data->thread.loadAcquire() == QCoreApplicationPrivate::mainThread();
  292|       |    if (qEnvironmentVariableIsEmpty("QT_NO_GLIB")
  293|       |        && (isQtMainThread || qEnvironmentVariableIsEmpty("QT_NO_THREADED_GLIB"))
  294|       |        && QEventDispatcherGlib::versionSupported())
  295|       |        return new QEventDispatcherGlib;
  296|       |    else
  297|       |        return new QEventDispatcherUNIX;
  298|       |#else
  299|  1.93k|    return new QEventDispatcherUNIX;
  300|  1.93k|#endif
  301|  1.93k|}
_ZN14QThreadPrivate6finishEv:
  403|      1|{
  404|      1|    terminate_on_exception([&] {
  405|      1|        QThreadPrivate *d = this;
  406|      1|        QThread *thr = q_func();
  407|       |
  408|       |        // Disable cancellation; we're already in the finishing touches of this
  409|       |        // thread, and we don't want cleanup to be disturbed by
  410|       |        // abi::__forced_unwind being thrown from all kinds of functions.
  411|      1|#ifdef PTHREAD_CANCEL_DISABLE
  412|      1|        pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, nullptr);
  413|      1|#endif
  414|       |
  415|      1|        QMutexLocker locker(&d->mutex);
  416|       |
  417|      1|        d->threadState = QThreadPrivate::Finishing;
  418|      1|        locker.unlock();
  419|      1|        emit thr->finished(QThread::QPrivateSignal());
  420|      1|        QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
  421|       |
  422|      1|        void *data = &d->data->tls;
  423|      1|        QThreadStorageData::finish((void **)data);
  424|      1|    });
  425|       |
  426|       |    if constexpr (QT_CONFIG(broken_threadlocal_dtors))
  427|       |        cleanup();
  428|      1|}
_ZN14QThreadPrivate7cleanupEv:
  431|      1|{
  432|      1|    terminate_on_exception([&] {
  433|      1|        QThreadPrivate *d = this;
  434|       |
  435|       |        // Disable cancellation again: we did it above, but some user code
  436|       |        // running between finish() and cleanup() may have turned them back on.
  437|      1|#ifdef PTHREAD_CANCEL_DISABLE
  438|      1|        pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, nullptr);
  439|      1|#endif
  440|       |
  441|      1|        QMutexLocker locker(&d->mutex);
  442|      1|        d->priority = QThread::InheritPriority;
  443|       |
  444|      1|        QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher.loadRelaxed();
  445|      1|        if (eventDispatcher) {
  446|      1|            d->data->eventDispatcher = nullptr;
  447|      1|            locker.unlock();
  448|      1|            eventDispatcher->closingDown();
  449|      1|            delete eventDispatcher;
  450|      1|            locker.relock();
  451|      1|        }
  452|       |
  453|      1|        d->interruptionRequested.store(false, std::memory_order_relaxed);
  454|       |
  455|      1|        d->wakeAll();
  456|      1|    });
  457|      1|}
qthread_unix.cpp:_ZN12_GLOBAL__N_113PThreadTlsKeyC2Ev:
  186|      2|    PThreadTlsKey() noexcept { pthread_key_create(&key, destroy_current_thread_data); }
qthread_unix.cpp:_ZL27destroy_current_thread_dataPv:
  139|      1|{
  140|      1|    QThreadData *data = static_cast<QThreadData *>(p);
  141|      1|    QThread *thread = data->thread.loadAcquire();
  142|       |
  143|       |#ifdef Q_OS_APPLE
  144|       |    // apparent runtime bug: the trivial has been cleared and we end up
  145|       |    // recreating the QThreadData
  146|       |    currentThreadData = data;
  147|       |#endif
  148|       |
  149|      1|    if (data->isAdopted) {
  ------------------
  |  Branch (149:9): [True: 1, False: 0]
  ------------------
  150|       |        // If this is an adopted thread, then QThreadData owns the QThread and
  151|       |        // this is very likely the last reference. These pointers cannot be
  152|       |        // null and there is no race.
  153|      1|        QThreadPrivate *thread_p = static_cast<QThreadPrivate *>(QObjectPrivate::get(thread));
  154|      1|        thread_p->finish();
  155|       |        if constexpr (!QT_CONFIG(broken_threadlocal_dtors))
  156|      1|            thread_p->cleanup();
  157|      1|    } else if constexpr (!QT_CONFIG(broken_threadlocal_dtors)) {
  158|       |        // We may be racing the QThread destructor in another thread. With
  159|       |        // two-phase clean-up enabled, there's also no race because it will
  160|       |        // stop in a call to QThread::wait() until we call cleanup().
  161|      0|        QThreadPrivate *thread_p = static_cast<QThreadPrivate *>(QObjectPrivate::get(thread));
  162|      0|        thread_p->cleanup();
  163|       |    } else {
  164|       |        // We may be racing the QThread destructor in another thread and it may
  165|       |        // have begun destruction; we must not dereference the QThread pointer.
  166|       |    }
  167|       |
  168|       |    // the QThread object may still have a reference, so this may not delete
  169|      1|    data->deref();
  170|       |
  171|       |    // ... but we must reset it to zero before returning so we aren't
  172|       |    // leaving a dangling pointer.
  173|      1|    currentThreadData = nullptr;
  174|      1|}
qthread_unix.cpp:_ZL15set_thread_dataP11QThreadData:
  196|      2|{
  197|      2|    if (data) {
  ------------------
  |  Branch (197:9): [True: 1, False: 1]
  ------------------
  198|       |        // As noted above: one global static for the thread that called
  199|       |        // ::exit() (which may not be a Qt thread) and the pthread_key_t for
  200|       |        // all others.
  201|      1|        static struct Cleanup {
  202|      1|            ~Cleanup() {
  203|      1|                if (QThreadData *data = get_thread_data())
  204|      1|                    destroy_current_thread_data(data);
  205|      1|            }
  206|      1|        } currentThreadCleanup;
  207|      1|        pthread_setspecific(pthreadTlsKey.key, data);
  208|      1|    }
  209|      2|    currentThreadData = data;
  210|      2|}
qthread_unix.cpp:_ZZL15set_thread_dataP11QThreadDataEN7CleanupD2Ev:
  202|      1|            ~Cleanup() {
  203|      1|                if (QThreadData *data = get_thread_data())
  ------------------
  |  Branch (203:34): [True: 1, False: 0]
  ------------------
  204|      1|                    destroy_current_thread_data(data);
  205|      1|            }
qthread_unix.cpp:_ZL15get_thread_datav:
  178|   196k|{
  179|   196k|    return currentThreadData;
  180|   196k|}
qthread_unix.cpp:_ZL15wakeAllInternalP14QThreadPrivate:
  862|      1|{
  863|      1|    d->threadState = QThreadPrivate::Finished;
  864|      1|    if (d->waiters)
  ------------------
  |  Branch (864:9): [True: 0, False: 1]
  ------------------
  865|      0|        d->thread_done.wakeAll();
  866|      1|}
qthread_unix.cpp:_ZN12_GLOBAL__N_122terminate_on_exceptionIZN14QThreadPrivate6finishEvE3$_0EEvOT_:
  321|      1|{
  322|      1|#ifndef QT_NO_EXCEPTIONS
  323|      1|    try {
  324|      1|#endif
  325|      1|        std::forward<T>(t)();
  326|      1|#ifndef QT_NO_EXCEPTIONS
  327|       |#ifdef __GLIBCXX__
  328|       |    // POSIX thread cancellation under glibc is implemented by throwing an exception
  329|       |    // of this type. Do what libstdc++ is doing and handle it specially in order not to
  330|       |    // abort the application if user's code calls a cancellation function.
  331|       |    } catch (abi::__forced_unwind &) {
  332|       |        throw;
  333|       |#endif // __GLIBCXX__
  334|      1|    } catch (...) {
  335|      0|        std::terminate();
  336|      0|    }
  337|      1|#endif // QT_NO_EXCEPTIONS
  338|      1|}
qthread_unix.cpp:_ZZN14QThreadPrivate6finishEvENK3$_0clEv:
  404|      1|    terminate_on_exception([&] {
  405|      1|        QThreadPrivate *d = this;
  406|      1|        QThread *thr = q_func();
  407|       |
  408|       |        // Disable cancellation; we're already in the finishing touches of this
  409|       |        // thread, and we don't want cleanup to be disturbed by
  410|       |        // abi::__forced_unwind being thrown from all kinds of functions.
  411|      1|#ifdef PTHREAD_CANCEL_DISABLE
  412|      1|        pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, nullptr);
  413|      1|#endif
  414|       |
  415|      1|        QMutexLocker locker(&d->mutex);
  416|       |
  417|      1|        d->threadState = QThreadPrivate::Finishing;
  418|      1|        locker.unlock();
  419|      1|        emit thr->finished(QThread::QPrivateSignal());
  420|      1|        QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete);
  421|       |
  422|      1|        void *data = &d->data->tls;
  423|      1|        QThreadStorageData::finish((void **)data);
  424|      1|    });
qthread_unix.cpp:_ZN12_GLOBAL__N_122terminate_on_exceptionIZN14QThreadPrivate7cleanupEvE3$_0EEvOT_:
  321|      1|{
  322|      1|#ifndef QT_NO_EXCEPTIONS
  323|      1|    try {
  324|      1|#endif
  325|      1|        std::forward<T>(t)();
  326|      1|#ifndef QT_NO_EXCEPTIONS
  327|       |#ifdef __GLIBCXX__
  328|       |    // POSIX thread cancellation under glibc is implemented by throwing an exception
  329|       |    // of this type. Do what libstdc++ is doing and handle it specially in order not to
  330|       |    // abort the application if user's code calls a cancellation function.
  331|       |    } catch (abi::__forced_unwind &) {
  332|       |        throw;
  333|       |#endif // __GLIBCXX__
  334|      1|    } catch (...) {
  335|      0|        std::terminate();
  336|      0|    }
  337|      1|#endif // QT_NO_EXCEPTIONS
  338|      1|}
qthread_unix.cpp:_ZZN14QThreadPrivate7cleanupEvENK3$_0clEv:
  432|      1|    terminate_on_exception([&] {
  433|      1|        QThreadPrivate *d = this;
  434|       |
  435|       |        // Disable cancellation again: we did it above, but some user code
  436|       |        // running between finish() and cleanup() may have turned them back on.
  437|      1|#ifdef PTHREAD_CANCEL_DISABLE
  438|      1|        pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, nullptr);
  439|      1|#endif
  440|       |
  441|      1|        QMutexLocker locker(&d->mutex);
  442|      1|        d->priority = QThread::InheritPriority;
  443|       |
  444|      1|        QAbstractEventDispatcher *eventDispatcher = d->data->eventDispatcher.loadRelaxed();
  445|      1|        if (eventDispatcher) {
  ------------------
  |  Branch (445:13): [True: 0, False: 1]
  ------------------
  446|      0|            d->data->eventDispatcher = nullptr;
  447|      0|            locker.unlock();
  448|      0|            eventDispatcher->closingDown();
  449|      0|            delete eventDispatcher;
  450|      0|            locker.relock();
  451|      0|        }
  452|       |
  453|      1|        d->interruptionRequested.store(false, std::memory_order_relaxed);
  454|       |
  455|      1|        d->wakeAll();
  456|      1|    });
_ZN14QThreadPrivate7wakeAllEv:
  869|      1|{
  870|      1|    if (data->isAdopted || !UsingPThreadTimedJoin)
  ------------------
  |  Branch (870:9): [True: 1, False: 0]
  |  Branch (870:28): [Folded - Ignored]
  ------------------
  871|      1|        wakeAllInternal(this);
  872|      1|}

_ZN11QThreadPool14globalInstanceEv:
  468|  1.93k|{
  469|  1.93k|    Q_CONSTINIT static QPointer<QThreadPool> theInstance;
  470|  1.93k|    Q_CONSTINIT static QBasicMutex theMutex;
  471|       |
  472|  1.93k|    const QMutexLocker locker(&theMutex);
  473|  1.93k|    if (theInstance.isNull() && !QCoreApplication::closingDown())
  ------------------
  |  Branch (473:9): [True: 1.93k, False: 0]
  |  Branch (473:33): [True: 0, False: 1.93k]
  ------------------
  474|      0|        theInstance = new QThreadPool();
  475|  1.93k|    return theInstance;
  476|  1.93k|}

_ZN18QThreadStorageData6finishEPPv:
  136|  1.93k|{
  137|  1.93k|    QList<void *> *tls = reinterpret_cast<QList<void *> *>(p);
  138|  1.93k|    if (!tls || tls->isEmpty() || !destructors())
  ------------------
  |  Branch (138:9): [True: 0, False: 1.93k]
  |  Branch (138:17): [True: 1.93k, False: 0]
  |  Branch (138:35): [True: 0, False: 0]
  ------------------
  139|  1.93k|        return; // nothing to do
  140|       |
  141|      0|    DEBUG_MSG("QThreadStorageData: Destroying storage for thread %p", QThread::currentThread());
  ------------------
  |  |   32|      0|#  define DEBUG_MSG if (false)qDebug
  |  |  ------------------
  |  |  |  Branch (32:25): [Folded - Ignored]
  |  |  ------------------
  ------------------
  142|      0|    while (!tls->isEmpty()) {
  ------------------
  |  Branch (142:12): [True: 0, False: 0]
  ------------------
  143|      0|        void *&value = tls->last();
  144|      0|        void *q = value;
  145|      0|        value = nullptr;
  146|      0|        int i = tls->size() - 1;
  147|      0|        tls->resize(i);
  148|       |
  149|      0|        if (!q) {
  ------------------
  |  Branch (149:13): [True: 0, False: 0]
  ------------------
  150|       |            // data already deleted
  151|      0|            continue;
  152|      0|        }
  153|       |
  154|      0|        QMutexLocker locker(&destructorsMutex);
  155|      0|        void (*destructor)(void *) = destructors()->value(i);
  156|      0|        locker.unlock();
  157|       |
  158|      0|        if (!destructor) {
  ------------------
  |  Branch (158:13): [True: 0, False: 0]
  ------------------
  159|      0|            if (QThread::currentThread())
  ------------------
  |  Branch (159:17): [True: 0, False: 0]
  ------------------
  160|      0|                qWarning("QThreadStorage: Thread %p exited after QThreadStorage %d destroyed",
  161|      0|                         QThread::currentThread(), i);
  162|      0|            continue;
  163|      0|        }
  164|      0|        destructor(q); //crash here might mean the thread exited after qthreadstorage was destroyed
  165|       |
  166|      0|        if (tls->size() > i) {
  ------------------
  |  Branch (166:13): [True: 0, False: 0]
  ------------------
  167|       |            //re reset the tls in case it has been recreated by its own destructor.
  168|      0|            (*tls)[i] = nullptr;
  169|      0|        }
  170|      0|    }
  171|      0|    tls->clear();
  172|      0|}

_ZN6QtTsan12mutexPreLockEPvj:
   70|   190k|inline void mutexPreLock(void *, unsigned) {}
_ZN6QtTsan13mutexPostLockEPvji:
   71|   190k|inline void mutexPostLock(void *, unsigned, int) {}
_ZN6QtTsan14mutexPreUnlockEPvj:
   72|   190k|inline void mutexPreUnlock(void *, unsigned) {}
_ZN6QtTsan15mutexPostUnlockEPvj:
   73|   190k|inline void mutexPostUnlock(void *, unsigned) {}

_ZN14QWaitConditionC2Ev:
   93|      1|{
   94|      1|    d = new QWaitConditionPrivate;
   95|      1|    qt_report_pthread_error(pthread_mutex_init(&d->mutex, nullptr), "QWaitCondition", "mutex init");
   96|      1|    qt_initialize_pthread_cond(&d->cond, "QWaitCondition");
   97|      1|    d->waiters = d->wakeups = 0;
   98|      1|}
_ZN14QWaitConditionD2Ev:
  101|      1|{
  102|      1|    qt_report_pthread_error(pthread_cond_destroy(&d->cond), "QWaitCondition", "cv destroy");
  103|      1|    qt_report_pthread_error(pthread_mutex_destroy(&d->mutex), "QWaitCondition", "mutex destroy");
  104|      1|    delete d;
  105|      1|}
qwaitcondition_unix.cpp:_ZL23qt_report_pthread_erroriPKcS0_:
   24|      4|{
   25|      4|    if (code != 0)
  ------------------
  |  Branch (25:9): [True: 0, False: 4]
  ------------------
   26|      0|        qErrnoWarning(code, "%s: %s failure", where, what);
   27|      4|}
qwaitcondition_unix.cpp:_ZL26qt_initialize_pthread_condP14pthread_cond_tPKc:
   30|      1|{
   31|      1|    pthread_condattr_t *attrp = nullptr;
   32|       |
   33|      1|#if QT_CONFIG(pthread_condattr_setclock)
   34|      1|    pthread_condattr_t condattr;
   35|      1|    attrp = &condattr;
   36|       |
   37|      1|    pthread_condattr_init(&condattr);
   38|      1|    auto destroy = qScopeGuard([&] { pthread_condattr_destroy(&condattr); });
   39|      1|    if (QWaitConditionClockId != CLOCK_REALTIME)
  ------------------
  |  Branch (39:9): [Folded - Ignored]
  ------------------
   40|      1|        pthread_condattr_setclock(&condattr, QWaitConditionClockId);
   41|      1|#endif
   42|       |
   43|      1|    qt_report_pthread_error(pthread_cond_init(cond, attrp), where, "cv init");
   44|      1|}
qwaitcondition_unix.cpp:_ZZL26qt_initialize_pthread_condP14pthread_cond_tPKcENK3$_0clEv:
   38|      1|    auto destroy = qScopeGuard([&] { pthread_condattr_destroy(&condattr); });

_ZN9QDateTimeC2Ev:
 3972|     20|{
 3973|     20|#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED) || QT_POINTER_SIZE == 8
 3974|     20|    static_assert(sizeof(ShortData) == sizeof(qint64));
 3975|     20|    static_assert(sizeof(Data) == sizeof(qint64));
 3976|     20|#endif
 3977|     20|    static_assert(sizeof(ShortData) >= sizeof(void*), "oops, Data::swap() is broken!");
 3978|     20|}
_ZN9QDateTimeD2Ev:
 4070|     20|{
 4071|     20|}
qdatetime.cpp:_ZL9mergeSpec6QFlagsIN16QDateTimePrivate10StatusFlagEEN2Qt8TimeSpecE:
 3084|     20|{
 3085|     20|    status &= ~QDateTimePrivate::TimeSpecMask;
 3086|     20|    status |= QDateTimePrivate::StatusFlags::fromInt(int(spec) << QDateTimePrivate::TimeSpecShift);
 3087|     20|    return status;
 3088|     20|}
_ZN9QDateTime4DataD2Ev:
 3483|     20|{
 3484|     20|    if (!isShort() && !d->ref.deref())
  ------------------
  |  Branch (3484:9): [True: 0, False: 20]
  |  Branch (3484:23): [True: 0, False: 0]
  ------------------
 3485|      0|        delete d;
 3486|     20|}
_ZN9QDateTime4DataC2Ev:
 3403|     20|{
 3404|       |    // default-constructed data has a special exception:
 3405|       |    // it can be small even if CanBeSmall == false
 3406|       |    // (optimization so we don't allocate memory in the default constructor)
 3407|     20|    quintptr value = mergeSpec(QDateTimePrivate::ShortData, Qt::LocalTime).toInt();
 3408|     20|    d = reinterpret_cast<QDateTimePrivate *>(value);
 3409|     20|}
_ZNK9QDateTime4Data7isShortEv:
 3489|     20|{
 3490|     20|    bool b = quintptr(d) & QDateTimePrivate::ShortData;
 3491|       |
 3492|       |    // sanity check:
 3493|     20|    Q_ASSERT(b || !d->m_status.testFlag(QDateTimePrivate::ShortData));
 3494|       |
 3495|       |    // even if CanBeSmall = false, we have short data for a default-constructed
 3496|       |    // QDateTime object. But it's unlikely.
 3497|       |    if constexpr (CanBeSmall)
 3498|     20|        return Q_LIKELY(b);
 3499|      0|    return Q_UNLIKELY(b);
 3500|     20|}

_Z19qCalculateBlockSizexxx:
   53|   818k|{
   54|   818k|    Q_ASSERT(elementSize);
   55|       |
   56|   818k|    size_t bytes;
   57|   818k|    if (Q_UNLIKELY(qMulOverflow(size_t(elementSize), size_t(elementCount), &bytes)) ||
   58|   818k|            Q_UNLIKELY(qAddOverflow(bytes, size_t(headerSize), &bytes)))
   59|      0|        return -1;
   60|   818k|    if (Q_UNLIKELY(qsizetype(bytes) < 0))
   61|      0|        return -1;
   62|       |
   63|   818k|    return qsizetype(bytes);
   64|   818k|}
_Z26qCalculateGrowingBlockSizexxx:
   86|   243k|{
   87|   243k|    CalculateGrowingBlockSizeResult result = {
   88|   243k|        qsizetype(-1), qsizetype(-1)
   89|   243k|    };
   90|       |
   91|   243k|    qsizetype bytes = qCalculateBlockSize(elementCount, elementSize, headerSize);
   92|   243k|    if (bytes < 0)
  ------------------
  |  Branch (92:9): [True: 0, False: 243k]
  ------------------
   93|      0|        return result;
   94|       |
   95|   243k|    size_t morebytes = static_cast<size_t>(qNextPowerOfTwo(quint64(bytes)));
   96|   243k|    if (Q_UNLIKELY(qsizetype(morebytes) < 0)) {
   97|       |        // grow by half the difference between bytes and morebytes
   98|       |        // this slows the growth and avoids trying to allocate exactly
   99|       |        // 2G of memory (on 32bit), something that many OSes can't deliver
  100|      0|        bytes += (morebytes - bytes) / 2;
  101|   243k|    } else {
  102|   243k|        bytes = qsizetype(morebytes);
  103|   243k|    }
  104|       |
  105|   243k|    result.elementCount = (bytes - headerSize) / elementSize;
  106|   243k|    result.size = result.elementCount * elementSize + headerSize;
  107|   243k|    return result;
  108|   243k|}
_ZN10QArrayData8allocateEPPS_xxxNS_16AllocationOptionE:
  195|  5.80k|{
  196|  5.80k|    Q_ASSERT(dptr);
  197|       |    // Alignment is a power of two
  198|  5.80k|    Q_ASSERT(alignment >= qsizetype(alignof(QArrayData))
  199|  5.80k|            && !(alignment & (alignment - 1)));
  200|       |
  201|  5.80k|    auto r = allocateHelper(objectSize, alignment, capacity, option);
  202|  5.80k|    *dptr = r.header;
  203|  5.80k|    return r.data;
  204|  5.80k|}
_ZN10QArrayData9allocate1EPPS_xNS_16AllocationOptionE:
  208|   421k|{
  209|   421k|    Q_ASSERT(dptr);
  210|       |
  211|   421k|    auto r = allocateHelper(1, alignof(AlignedQArrayData), capacity, option);
  212|   421k|    *dptr = r.header;
  213|   421k|    return r.data;
  214|   421k|}
_ZN10QArrayData9allocate2EPPS_xNS_16AllocationOptionE:
  217|   382k|{
  218|   382k|    Q_ASSERT(dptr);
  219|       |
  220|   382k|    auto r = allocateHelper(2, alignof(AlignedQArrayData), capacity, option);
  221|   382k|    *dptr = r.header;
  222|   382k|    return r.data;
  223|   382k|}
_ZN10QArrayData19reallocateUnalignedEPS_PvxxNS_16AllocationOptionE:
  228|  9.02k|{
  229|  9.02k|    Q_ASSERT(!data || !data->isShared());
  230|       |
  231|  9.02k|    const qsizetype headerSize = sizeof(AlignedQArrayData);
  232|  9.02k|    auto r = calculateBlockSize(capacity, objectSize, headerSize, option);
  233|  9.02k|    qsizetype allocSize = r.size;
  234|  9.02k|    capacity = r.elementCount;
  235|  9.02k|    if (Q_UNLIKELY(allocSize < 0))
  236|      0|        return {};
  237|       |
  238|  9.02k|    const qptrdiff offset = dataPointer
  ------------------
  |  Branch (238:29): [True: 9.02k, False: 0]
  ------------------
  239|  9.02k|            ? reinterpret_cast<char *>(dataPointer) - reinterpret_cast<char *>(data)
  240|  9.02k|            : headerSize;
  241|  9.02k|    Q_ASSERT(offset > 0);
  242|  9.02k|    Q_ASSERT(offset <= allocSize); // equals when all free space is at the beginning
  243|       |
  244|  9.02k|    QArrayData *header = static_cast<QArrayData *>(::realloc(data, size_t(allocSize)));
  245|  9.02k|    if (header) {
  ------------------
  |  Branch (245:9): [True: 9.02k, False: 0]
  ------------------
  246|  9.02k|        header->alloc = capacity;
  247|  9.02k|        dataPointer = reinterpret_cast<char *>(header) + offset;
  248|  9.02k|    } else {
  249|      0|        dataPointer = nullptr;
  250|      0|    }
  251|  9.02k|    return {header, dataPointer};
  252|  9.02k|}
qarraydata.cpp:_ZL14allocateHelperxxxN10QArrayData16AllocationOptionE:
  159|   809k|{
  160|   809k|    if (capacity == 0)
  ------------------
  |  Branch (160:9): [True: 0, False: 809k]
  ------------------
  161|      0|        return {};
  162|       |
  163|   809k|    qsizetype headerSize = sizeof(AlignedQArrayData);
  164|   809k|    const qsizetype headerAlignment = alignof(AlignedQArrayData);
  165|       |
  166|   809k|    if (alignment > headerAlignment) {
  ------------------
  |  Branch (166:9): [True: 0, False: 809k]
  ------------------
  167|       |        // Allocate extra (alignment - Q_ALIGNOF(AlignedQArrayData)) padding
  168|       |        // bytes so we can properly align the data array. This assumes malloc is
  169|       |        // able to provide appropriate alignment for the header -- as it should!
  170|       |        // Effectively, we allocate one QTypedArrayData<T>::AlignmentDummy.
  171|      0|        headerSize += alignment - headerAlignment;
  172|      0|    }
  173|   809k|    Q_ASSERT(headerSize > 0);
  174|       |
  175|   809k|    auto blockSize = calculateBlockSize(capacity, objectSize, headerSize, option);
  176|   809k|    capacity = blockSize.elementCount;
  177|   809k|    qsizetype allocSize = blockSize.size;
  178|   809k|    if (Q_UNLIKELY(allocSize < 0))      // handle overflow. cannot allocate reliably
  179|      0|        return {};
  180|       |
  181|   809k|    QArrayData *header = allocateData(allocSize);
  182|   809k|    void *data = nullptr;
  183|   809k|    if (header) {
  ------------------
  |  Branch (183:9): [True: 809k, False: 0]
  ------------------
  184|       |        // find where offset should point to so that data() is aligned to alignment bytes
  185|   809k|        data = QTypedArrayData<void>::dataStart(header, alignment);
  186|   809k|        header->alloc = qsizetype(capacity);
  187|   809k|    }
  188|       |
  189|   809k|    return { data, header };
  190|   809k|}
qarraydata.cpp:_ZL12allocateDatax:
  138|   809k|{
  139|   809k|    QArrayData *header = static_cast<QArrayData *>(::malloc(size_t(allocSize)));
  140|   809k|    if (header) {
  ------------------
  |  Branch (140:9): [True: 809k, False: 0]
  ------------------
  141|   809k|        header->ref_.storeRelaxed(1);
  142|   809k|        header->flags = {};
  143|   809k|        header->alloc = 0;
  144|   809k|    }
  145|   809k|    return header;
  146|   809k|}
qarraydata.cpp:_ZL18calculateBlockSizexxxN10QArrayData16AllocationOptionE:
  120|   818k|{
  121|       |    // Adjust the header size up to account for the trailing null for QString
  122|       |    // and QByteArray. This is not checked for overflow because headers sizes
  123|       |    // should not be anywhere near the overflow limit.
  124|   818k|    constexpr qsizetype FooterSize = qMax(sizeof(QString::value_type), sizeof(QByteArray::value_type));
  125|   818k|    if (objectSize <= FooterSize)
  ------------------
  |  Branch (125:9): [True: 812k, False: 5.80k]
  ------------------
  126|   812k|        headerSize += FooterSize;
  127|       |
  128|       |    // allocSize = objectSize * capacity + headerSize, but checked for overflow
  129|       |    // plus padded to grow in size
  130|   818k|    if (option == QArrayData::Grow) {
  ------------------
  |  Branch (130:9): [True: 243k, False: 574k]
  ------------------
  131|   243k|        return qCalculateGrowingBlockSize(capacity, objectSize, headerSize);
  132|   574k|    } else {
  133|   574k|        return { qCalculateBlockSize(capacity, objectSize, headerSize), capacity };
  134|   574k|    }
  135|   818k|}

_ZN10QArrayData3refEv:
   58|   233k|    {
   59|   233k|        ref_.ref();
   60|   233k|        return true;
   61|   233k|    }
_ZN9QtPrivate20QContainerImplHelper3midExPxS1_:
  190|      1|    {
  191|      1|        qsizetype &position = *_position;
  192|      1|        qsizetype &length = *_length;
  193|      1|        if (position > originalLength) {
  ------------------
  |  Branch (193:13): [True: 0, False: 1]
  ------------------
  194|      0|            position = 0;
  195|      0|            length = 0;
  196|      0|            return Null;
  197|      0|        }
  198|       |
  199|      1|        if (position < 0) {
  ------------------
  |  Branch (199:13): [True: 0, False: 1]
  ------------------
  200|      0|            if (length < 0 || length + position >= originalLength) {
  ------------------
  |  Branch (200:17): [True: 0, False: 0]
  |  Branch (200:31): [True: 0, False: 0]
  ------------------
  201|      0|                position = 0;
  202|      0|                length = originalLength;
  203|      0|                return Full;
  204|      0|            }
  205|      0|            if (length + position <= 0) {
  ------------------
  |  Branch (205:17): [True: 0, False: 0]
  ------------------
  206|      0|                position = length = 0;
  207|      0|                return Null;
  208|      0|            }
  209|      0|            length += position;
  210|      0|            position = 0;
  211|      1|        } else if (size_t(length) > size_t(originalLength - position)) {
  ------------------
  |  Branch (211:20): [True: 1, False: 0]
  ------------------
  212|      1|            length = originalLength - position;
  213|      1|        }
  214|       |
  215|      1|        if (position == 0 && length == originalLength)
  ------------------
  |  Branch (215:13): [True: 0, False: 1]
  |  Branch (215:30): [True: 0, False: 0]
  ------------------
  216|      0|            return Full;
  217|       |
  218|      1|        return length > 0 ? Subset : Empty;
  ------------------
  |  Branch (218:16): [True: 1, False: 0]
  ------------------
  219|      1|    }
_ZN10QArrayData5derefEv:
   65|  1.04M|    {
   66|  1.04M|        return ref_.deref();
   67|  1.04M|    }

_ZN9QtPrivate12QPodArrayOpsIcE10destroyAllEv:
   83|   421k|    {
   84|   421k|        Q_ASSERT(this->d);
  ------------------
  |  |   31|   421k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:29): [True: 421k, False: 0]
  |  |  ------------------
  ------------------
   85|   421k|        Q_ASSERT(this->d->ref_.loadRelaxed() == 0);
  ------------------
  |  |   31|   421k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:29): [True: 421k, False: 0]
  |  |  ------------------
  ------------------
   86|       |
   87|       |        // As this is to be called only from destructor, it doesn't need to be
   88|       |        // exception safe; size not updated.
   89|   421k|    }
_ZN9QtPrivate12QPodArrayOpsIDsE10destroyAllEv:
   83|   382k|    {
   84|   382k|        Q_ASSERT(this->d);
  ------------------
  |  |   31|   382k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:29): [True: 382k, False: 0]
  |  |  ------------------
  ------------------
   85|   382k|        Q_ASSERT(this->d->ref_.loadRelaxed() == 0);
  ------------------
  |  |   31|   382k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:29): [True: 382k, False: 0]
  |  |  ------------------
  ------------------
   86|       |
   87|       |        // As this is to be called only from destructor, it doesn't need to be
   88|       |        // exception safe; size not updated.
   89|   382k|    }

_ZN17QArrayDataPointerIcEC2ERKS0_:
   38|  46.4k|        : d(other.d), ptr(other.ptr), size(other.size)
   39|  46.4k|    {
   40|  46.4k|        ref();
   41|  46.4k|    }
_ZN17QArrayDataPointerIcE3refEv:
  451|  46.4k|    void ref() noexcept { if (d) d->ref(); }
  ------------------
  |  Branch (451:31): [True: 46.4k, False: 17]
  ------------------
_ZN17QArrayDataPointerIcEC2Ev:
   32|   421k|        : d(nullptr), ptr(nullptr), size(0)
   33|   421k|    {
   34|   421k|    }
_ZN17QArrayDataPointerIcEC2EOS0_:
   78|   375k|        : d(std::exchange(other.d, nullptr)),
   79|   375k|          ptr(std::exchange(other.ptr, nullptr)),
   80|   375k|          size(std::exchange(other.size, 0))
   81|   375k|    {
   82|   375k|    }
_ZN17QArrayDataPointerIDsEC2ERKS0_:
   38|   186k|        : d(other.d), ptr(other.ptr), size(other.size)
   39|   186k|    {
   40|   186k|        ref();
   41|   186k|    }
_ZN17QArrayDataPointerIDsE3refEv:
  451|   186k|    void ref() noexcept { if (d) d->ref(); }
  ------------------
  |  Branch (451:31): [True: 186k, False: 17]
  ------------------
_ZN17QArrayDataPointerIDsEC2Ev:
   32|  1.14M|        : d(nullptr), ptr(nullptr), size(0)
   33|  1.14M|    {
   34|  1.14M|    }
_ZN17QArrayDataPointerIDsEC2EOS0_:
   78|   197k|        : d(std::exchange(other.d, nullptr)),
   79|   197k|          ptr(std::exchange(other.ptr, nullptr)),
   80|   197k|          size(std::exchange(other.size, 0))
   81|   197k|    {
   82|   197k|    }
_ZN17QArrayDataPointerIcED2Ev:
  107|  1.26M|    {
  108|  1.26M|        if (!deref()) {
  ------------------
  |  Branch (108:13): [True: 421k, False: 843k]
  ------------------
  109|   421k|            (*this)->destroyAll();
  110|   421k|            free(d);
  111|   421k|        }
  112|  1.26M|    }
_ZN17QArrayDataPointerIcE5derefEv:
  452|  1.26M|    bool deref() noexcept { return !d || d->deref(); }
  ------------------
  |  Branch (452:36): [True: 796k, False: 467k]
  |  Branch (452:42): [True: 46.4k, False: 421k]
  ------------------
_ZN17QArrayDataPointerIcEptEv:
   92|  1.37M|    {
   93|  1.37M|        return static_cast<DataOps *>(this);
   94|  1.37M|    }
_ZNK17QArrayDataPointerIcE4dataEv:
  120|  1.16M|    const T *data() const noexcept { return ptr; }
_ZN17QArrayDataPointerIDsED2Ev:
  107|  1.91M|    {
  108|  1.91M|        if (!deref()) {
  ------------------
  |  Branch (108:13): [True: 382k, False: 1.53M]
  ------------------
  109|   382k|            (*this)->destroyAll();
  110|   382k|            free(d);
  111|   382k|        }
  112|  1.91M|    }
_ZN17QArrayDataPointerIDsE5derefEv:
  452|  1.91M|    bool deref() noexcept { return !d || d->deref(); }
  ------------------
  |  Branch (452:36): [True: 1.34M, False: 568k]
  |  Branch (452:42): [True: 186k, False: 382k]
  ------------------
_ZN17QArrayDataPointerIDsEptEv:
   92|  1.15M|    {
   93|  1.15M|        return static_cast<DataOps *>(this);
   94|  1.15M|    }
_ZNK17QArrayDataPointerIDsE4dataEv:
  120|  1.92M|    const T *data() const noexcept { return ptr; }
_ZN17QArrayDataPointerIcEC2EP15QTypedArrayDataIcEPcx:
   45|      1|        : d(header), ptr(adata), size(n)
   46|      1|    {
   47|      1|    }
_ZN17QArrayDataPointerIDsE11fromRawDataEPKDsx:
   64|  1.93k|    {
   65|  1.93k|        Q_ASSERT(rawData || !length);
  ------------------
  |  |   31|  1.93k|#    define Q_ASSERT(cond) ((cond) ? static_cast<void>(0) : qt_assert(#cond, __FILE__, __LINE__))
  |  |  ------------------
  |  |  |  Branch (31:30): [True: 1.93k, False: 0]
  |  |  |  Branch (31:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   66|  1.93k|        return { nullptr, const_cast<T *>(rawData), length };
   67|  1.93k|    }
_ZN17QArrayDataPointerIDsEC2EP15QTypedArrayDataIDsEPDsx:
   45|   188k|        : d(header), ptr(adata), size(n)
   46|   188k|    {
   47|   188k|    }

_ZN17QDuplicateTrackerI7QStringLm32EEC2Ex:
   82|      1|        : set{size_t(n), &res}
   83|       |#else
   84|       |        : set{n}
   85|       |#endif
   86|      1|    {}

_ZN9QFreeListIv26QtTimerIdFreeListConstantsEC2Ev:
  174|      1|      _v{}, // uniform initialization required
  175|      1|      _next(ConstantsType::InitialNextValue)
  176|      1|{ }
_ZN9QFreeListIv26QtTimerIdFreeListConstantsED2Ev:
  180|      1|{
  181|      7|    for (int i = 0; i < ConstantsType::BlockCount; ++i)
  ------------------
  |  Branch (181:21): [True: 6, False: 1]
  ------------------
  182|      6|        delete [] _v[i].loadAcquire();
  183|      1|}

_ZN9QHashSeed10globalSeedEv:
  978|      2|{
  979|      2|    return qt_qhash_seed.currentSeed(0);
  980|      2|}
qhash.cpp:_ZN12_GLOBAL__N_115HashSeedStorageC2Ev:
   70|      2|    HashSeedStorage() { initialize(0); }
qhash.cpp:_ZN12_GLOBAL__N_115HashSeedStorage10initializeEi:
  113|      2|{
  114|      2|    StateResult result = { 0, OverriddenByEnvironment };
  115|       |#ifdef QT_BOOTSTRAPPED
  116|       |    Q_UNUSED(which);
  117|       |    Q_UNREACHABLE_RETURN(result);
  118|       |#else
  119|       |    // can't use qEnvironmentVariableIntValue (reentrancy)
  120|      2|    const char *seedstr = getenv("QT_HASH_SEED");
  121|      2|    if (seedstr) {
  ------------------
  |  Branch (121:9): [True: 0, False: 2]
  ------------------
  122|      0|        auto r = qstrntoll(seedstr, strlen(seedstr), 10);
  123|      0|        if (r.used > 0 && size_t(r.used) == strlen(seedstr)) {
  ------------------
  |  Branch (123:13): [True: 0, False: 0]
  |  Branch (123:27): [True: 0, False: 0]
  ------------------
  124|      0|            if (r.result) {
  ------------------
  |  Branch (124:17): [True: 0, False: 0]
  ------------------
  125|       |                // can't use qWarning here (reentrancy)
  126|      0|                fprintf(stderr, "QT_HASH_SEED: forced seed value is not 0; ignored.\n");
  127|      0|            }
  128|       |
  129|       |            // we don't have to store to the seed, since it's pre-initialized by
  130|       |            // the compiler to zero
  131|      0|            return result;
  132|      0|        }
  133|      0|    }
  134|       |
  135|       |    // update the full seed
  136|      2|    auto x = qt_initial_random_value();
  137|      6|    for (int i = 0; i < SeedCount; ++i) {
  ------------------
  |  Branch (137:21): [True: 4, False: 2]
  ------------------
  138|      4|        seeds[i].storeRelaxed(x.data[i]);
  139|      4|        if (which == i)
  ------------------
  |  Branch (139:13): [True: 2, False: 2]
  ------------------
  140|      2|            result.requestedSeed = x.data[i];
  141|      4|    }
  142|      2|    result.state = JustInitialized;
  143|      2|    return result;
  144|      2|#endif
  145|      2|}
qhash.cpp:_ZN12_GLOBAL__N_115HashSeedStorage11currentSeedEi:
   85|      2|    {
   86|      2|        return { state(which).requestedSeed };
   87|      2|    }
qhash.cpp:_ZN12_GLOBAL__N_115HashSeedStorage5stateEi:
  148|      2|{
  149|      2|    constexpr quintptr BadSeed = quintptr(Q_UINT64_C(0x5555'5555'5555'5555));
  150|      2|    StateResult result = { BadSeed, AlreadyInitialized };
  151|       |
  152|       |#if defined(QT_BOOTSTRAPPED)
  153|       |    result = { 0, OverriddenByEnvironment };
  154|       |#elif !QT_SUPPORTS_INIT_PRIORITY
  155|       |    // dynamic initialization
  156|       |    static auto once = [&]() {
  157|       |        result = initialize(which);
  158|       |        return true;
  159|       |    }();
  160|       |    Q_UNUSED(once);
  161|       |#endif
  162|       |
  163|      2|    if (result.state == AlreadyInitialized && which >= 0)
  ------------------
  |  Branch (163:9): [True: 2, False: 0]
  |  Branch (163:47): [True: 2, False: 0]
  ------------------
  164|      2|        return { seeds[which].loadRelaxed(), AlreadyInitialized };
  165|      0|    return result;
  166|      2|}

_ZN12QHashPrivate12GrowthPolicy18bucketsForCapacityEm:
  420|      1|{
  421|      1|    constexpr int SizeDigits = std::numeric_limits<size_t>::digits;
  422|       |
  423|       |    // We want to use at minimum a full span (128 entries), so we hardcode it for any requested
  424|       |    // capacity <= 64. Any capacity above that gets rounded to a later power of two.
  425|      1|    if (requestedCapacity <= 64)
  ------------------
  |  Branch (425:9): [True: 1, False: 0]
  ------------------
  426|      1|        return SpanConstants::NEntries;
  427|       |
  428|       |    // Same as
  429|       |    //    qNextPowerOfTwo(2 * requestedCapacity);
  430|       |    //
  431|       |    // but ensuring neither our multiplication nor the function overflow.
  432|       |    // Additionally, the maximum memory allocation is 2^31-1 or 2^63-1 bytes
  433|       |    // (limited by qsizetype and ptrdiff_t).
  434|      0|    int count = qCountLeadingZeroBits(requestedCapacity);
  435|      0|    if (count < 2)
  ------------------
  |  Branch (435:9): [True: 0, False: 0]
  ------------------
  436|      0|        return (std::numeric_limits<size_t>::max)();    // will cause std::bad_alloc
  437|      0|    return size_t(1) << (SizeDigits - count + 1);
  438|      0|}
_ZN12QHashPrivate12GrowthPolicy13bucketForHashEmm:
  440|      4|{
  441|      4|    return hash & (nBuckets - 1);
  442|      4|}
_ZN5QHashIP16QLoggingCategory9QtMsgTypeEC2Ev:
  849|      2|    inline QHash() noexcept = default;
_ZN5QHashIP16QLoggingCategory9QtMsgTypeED2Ev:
  863|      2|    {
  864|      2|        static_assert(std::is_nothrow_destructible_v<Key>, "Types with throwing destructors are not supported in Qt containers.");
  865|      2|        static_assert(std::is_nothrow_destructible_v<T>, "Types with throwing destructors are not supported in Qt containers.");
  866|       |
  867|      2|        if (d && !d->ref.deref())
  ------------------
  |  Branch (867:13): [True: 1, False: 1]
  |  Branch (867:18): [True: 1, False: 0]
  ------------------
  868|      1|            delete d;
  869|      2|    }
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEED2Ev:
  777|      1|    {
  778|      1|        delete [] spans;
  779|      1|    }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEED2Ev:
  264|      1|    {
  265|      1|        freeData();
  266|      1|    }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE8freeDataEv:
  268|      1|    {
  269|      1|        if (entries) {
  ------------------
  |  Branch (269:13): [True: 1, False: 0]
  ------------------
  270|       |            if constexpr (!std::is_trivially_destructible<Node>::value) {
  271|       |                for (auto o : offsets) {
  272|       |                    if (o != SpanConstants::UnusedEntry)
  273|       |                        entries[o].node().~Node();
  274|       |                }
  275|       |            }
  276|      1|            delete[] entries;
  277|      1|            entries = nullptr;
  278|      1|        }
  279|      1|    }
_ZN5QHashIP16QLoggingCategory9QtMsgTypeE10tryEmplaceIJRS2_EEENS3_16TryEmplaceResultERKS1_DpOT_:
 1395|      1|    {
 1396|      1|        return tryEmplace_impl(key, std::forward<Args>(args)...);
 1397|      1|    }
_ZN5QHashIP16QLoggingCategory9QtMsgTypeE15tryEmplace_implIRKS1_JRS2_EEENS3_16TryEmplaceResultEOT_DpOT0_:
 1433|      1|    {
 1434|      1|        if (!d)
  ------------------
  |  Branch (1434:13): [True: 1, False: 0]
  ------------------
 1435|      1|            detach();
 1436|      1|        QHash detachGuard;
 1437|       |
 1438|      1|        typename Data::Bucket bucket = d->findBucket(key);
 1439|      1|        const bool shouldInsert = bucket.isUnused();
 1440|       |
 1441|       |        // Even if we don't insert we may have to detach because we are
 1442|       |        // returning a non-const iterator:
 1443|      1|        if (!isDetached() || (shouldInsert && d->shouldGrow())) {
  ------------------
  |  Branch (1443:13): [True: 0, False: 1]
  |  Branch (1443:31): [True: 1, False: 0]
  |  Branch (1443:47): [True: 0, False: 1]
  ------------------
 1444|      0|            detachGuard = *this;
 1445|      0|            const bool resized = shouldInsert && d->shouldGrow();
  ------------------
  |  Branch (1445:34): [True: 0, False: 0]
  |  Branch (1445:50): [True: 0, False: 0]
  ------------------
 1446|      0|            const size_t bucketIndex = bucket.toBucketIndex(d);
 1447|       |
 1448|       |            // Must detach from detachGuard
 1449|      0|            d = resized ? Data::detached(d, d->size + 1) : Data::detached(d);
  ------------------
  |  Branch (1449:17): [True: 0, False: 0]
  ------------------
 1450|      0|            bucket = resized ? d->findBucket(key) : typename Data::Bucket(d, bucketIndex);
  ------------------
  |  Branch (1450:22): [True: 0, False: 0]
  ------------------
 1451|      0|        }
 1452|      1|        if (shouldInsert) {
  ------------------
  |  Branch (1452:13): [True: 1, False: 0]
  ------------------
 1453|      1|            Node *n = bucket.insert();
 1454|      1|            using ConstructProxy = typename QHashPrivate::HeterogenousConstructProxy<Key, K>;
 1455|      1|            Node::createInPlace(n, ConstructProxy(std::forward<K>(key)),
 1456|      1|                                std::forward<Args>(args)...);
 1457|      1|            ++d->size;
 1458|      1|        }
 1459|      1|        return {iterator(bucket.toIterator(d)), shouldInsert};
 1460|      1|    }
_ZN5QHashIP16QLoggingCategory9QtMsgTypeE6detachEv:
  973|      2|    inline void detach() { if (!d || d->ref.isShared()) d = Data::detached(d); }
  ------------------
  |  Branch (973:32): [True: 1, False: 1]
  |  Branch (973:38): [True: 0, False: 1]
  ------------------
_ZNK12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE10findBucketIS3_EENS6_6BucketERKT_:
  687|      4|    {
  688|      4|        static_assert(std::is_same_v<std::remove_cv_t<Key>, K> ||
  689|      4|                QHashHeterogeneousSearch<std::remove_cv_t<Key>, K>::value);
  690|      4|        Q_ASSERT(numBuckets > 0);
  691|      4|        size_t hash = QHashPrivate::calculateHash(key, seed);
  692|      4|        Bucket bucket(this, GrowthPolicy::bucketForHash(numBuckets, hash));
  693|       |        // loop over the buckets until we find the entry we search for
  694|       |        // or an empty slot, in which case we know the entry doesn't exist
  695|      4|        while (true) {
  ------------------
  |  Branch (695:16): [Folded - Ignored]
  ------------------
  696|      4|            size_t offset = bucket.offset();
  697|      4|            if (offset == SpanConstants::UnusedEntry) {
  ------------------
  |  Branch (697:17): [True: 1, False: 3]
  ------------------
  698|      1|                return bucket;
  699|      3|            } else {
  700|      3|                Node &n = bucket.nodeAtOffset(offset);
  701|      3|                if (qHashEquals(n.key, key))
  ------------------
  |  Branch (701:21): [True: 3, False: 0]
  ------------------
  702|      3|                    return bucket;
  703|      3|            }
  704|      0|            bucket.advanceWrapped(this);
  705|      0|        }
  706|      4|    }
_ZN12QHashPrivate13calculateHashIP16QLoggingCategoryEEmRKT_m:
   57|      4|{
   58|      4|    if constexpr (HasQHashOverload<T>) {
   59|      4|        return qHash(t, seed);
   60|       |    } else if constexpr (HasStdHashSpecializationWithSeed<T>) {
   61|       |        return std::hash<T>()(t, seed);
   62|       |    } else if constexpr (HasStdHashSpecializationWithoutSeed<T>) {
   63|       |        Q_UNUSED(seed);
   64|       |        return std::hash<T>()(t);
   65|       |    } else {
   66|       |        static_assert(QtPrivate::type_dependent_false<T>(), "The key type must have a qHash overload or a std::hash specialization");
   67|       |        return 0;
   68|       |    }
   69|      4|}
_ZNK12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6Bucket6offsetEv:
  500|      5|        {
  501|      5|            return span->offset(index);
  502|      5|        }
_ZNK12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6offsetEm:
  305|      5|    {
  306|      5|        return offsets[i];
  307|      5|    }
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6Bucket12nodeAtOffsetEm:
  504|      3|        {
  505|      3|            return span->atOffset(offset);
  506|      3|        }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE8atOffsetEm:
  327|      3|    {
  328|      3|        Q_ASSERT(o < allocated);
  329|       |
  330|      3|        return entries[o].node();
  331|      3|    }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE5Entry4nodeEv:
  252|      7|        Node &node() { return *reinterpret_cast<Node *>(&storage); }
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6Bucket14advanceWrappedEPKS6_:
  488|      1|        {
  489|      1|            advance_impl(d, d->spans);
  490|      1|        }
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6Bucket12advance_implEPKS6_PNS_4SpanIS5_EE:
  524|      1|        {
  525|      1|            Q_ASSERT(span);
  526|      1|            ++index;
  527|      1|            if (Q_UNLIKELY(index == SpanConstants::NEntries)) {
  528|      0|                index = 0;
  529|      0|                ++span;
  530|      0|                if (span - d->spans == ptrdiff_t(d->numBuckets >> SpanConstants::SpanShift))
  ------------------
  |  Branch (530:21): [True: 0, False: 0]
  ------------------
  531|      0|                    span = whenAtEnd;
  532|      0|            }
  533|      1|        }
_ZNK12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6Bucket8isUnusedEv:
  496|      4|        {
  497|      4|            return !span->hasNode(index);
  498|      4|        }
_ZNK12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE7hasNodeEm:
  309|      5|    {
  310|      5|        return (offsets[i] != SpanConstants::UnusedEntry);
  311|      5|    }
_ZNK5QHashIP16QLoggingCategory9QtMsgTypeE10isDetachedEv:
  974|      1|    inline bool isDetached() const noexcept { return d && !d->ref.isShared(); }
  ------------------
  |  Branch (974:54): [True: 1, False: 0]
  |  Branch (974:59): [True: 1, False: 0]
  ------------------
_ZNK12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE10shouldGrowEv:
  682|      1|    {
  683|      1|        return size >= (numBuckets >> 1);
  684|      1|    }
_ZNK12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6Bucket13toBucketIndexEPKS6_:
  483|      2|        {
  484|      2|            return ((span - d->spans) << SpanConstants::SpanShift) | index;
  485|      2|        }
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEEC2Em:
  556|      1|    {
  557|      1|        numBuckets = GrowthPolicy::bucketsForCapacity(reserve);
  558|      1|        spans = allocateSpans(numBuckets).spans;
  559|      1|        seed = QHashSeed::globalSeed();
  560|      1|    }
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE13allocateSpansEm:
  537|      1|    {
  538|      1|        struct R {
  539|      1|            Span *spans;
  540|      1|            size_t nSpans;
  541|      1|        };
  542|       |
  543|      1|        constexpr qptrdiff MaxSpanCount = (std::numeric_limits<qptrdiff>::max)() / sizeof(Span);
  544|      1|        constexpr size_t MaxBucketCount = MaxSpanCount << SpanConstants::SpanShift;
  545|       |
  546|      1|        if (numBuckets > MaxBucketCount) {
  ------------------
  |  Branch (546:13): [True: 0, False: 1]
  ------------------
  547|      0|            Q_CHECK_PTR(false);
  548|      0|            Q_UNREACHABLE();    // no exceptions and no assertions -> no error reporting
  549|      0|        }
  550|       |
  551|      1|        size_t nSpans = numBuckets >> SpanConstants::SpanShift;
  552|      1|        return R{ new Span[nSpans], nSpans };
  553|      1|    }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEEC2Ev:
  260|      1|    {
  261|      1|        memset(offsets, SpanConstants::UnusedEntry, sizeof(offsets));
  262|      1|    }
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE8detachedEPS6_:
  597|      1|    {
  598|      1|        if (!d)
  ------------------
  |  Branch (598:13): [True: 1, False: 0]
  ------------------
  599|      1|            return new Data;
  600|      0|        Data *dd = new Data(*d);
  601|      0|        if (!d->ref.deref())
  ------------------
  |  Branch (601:13): [True: 0, False: 0]
  ------------------
  602|      0|            delete d;
  603|      0|        return dd;
  604|      1|    }
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6BucketC2EPKS6_m:
  475|      5|            : span(d->spans + (bucket >> SpanConstants::SpanShift)),
  476|      5|            index(bucket & SpanConstants::LocalBucketMask)
  477|      5|        {}
_ZNK12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6Bucket6insertEv:
  512|      1|        {
  513|      1|            return span->insert(index);
  514|      1|        }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6insertEm:
  281|      1|    {
  282|      1|        Q_ASSERT(i < SpanConstants::NEntries);
  283|      1|        Q_ASSERT(offsets[i] == SpanConstants::UnusedEntry);
  284|      1|        if (nextFree == allocated)
  ------------------
  |  Branch (284:13): [True: 1, False: 0]
  ------------------
  285|      1|            addStorage();
  286|      1|        unsigned char entry = nextFree;
  287|      1|        Q_ASSERT(entry < allocated);
  288|      1|        nextFree = entries[entry].nextFree();
  289|      1|        offsets[i] = entry;
  290|      1|        return &entries[entry].node();
  291|      1|    }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE10addStorageEv:
  373|      1|    {
  374|      1|        Q_ASSERT(allocated < SpanConstants::NEntries);
  375|      1|        Q_ASSERT(nextFree == allocated);
  376|       |        // the hash table should always be between 25 and 50% full
  377|       |        // this implies that we on average have between 32 and 64 entries
  378|       |        // in here. More exactly, we have a binominal distribution of the amount of
  379|       |        // occupied entries.
  380|       |        // For a 25% filled table, the average is 32 entries, with a 95% chance that we have between
  381|       |        // 23 and 41 entries.
  382|       |        // For a 50% filled table, the average is 64 entries, with a 95% chance that we have between
  383|       |        // 53 and 75 entries.
  384|       |        // Since we only resize the table once it's 50% filled and we want to avoid copies of
  385|       |        // data where possible, we initially allocate 48 entries, then resize to 80 entries, after that
  386|       |        // resize by increments of 16. That way, we usually only get one resize of the table
  387|       |        // while filling it.
  388|      1|        size_t alloc;
  389|      1|        static_assert(SpanConstants::NEntries % 8 == 0);
  390|      1|        if (!allocated)
  ------------------
  |  Branch (390:13): [True: 1, False: 0]
  ------------------
  391|      1|            alloc = SpanConstants::NEntries / 8 * 3;
  392|      0|        else if (allocated == SpanConstants::NEntries / 8 * 3)
  ------------------
  |  Branch (392:18): [True: 0, False: 0]
  ------------------
  393|      0|            alloc = SpanConstants::NEntries / 8 * 5;
  394|      0|        else
  395|      0|            alloc = allocated + SpanConstants::NEntries/8;
  396|      1|        Entry *newEntries = new Entry[alloc];
  397|       |        // we only add storage if the previous storage was fully filled, so
  398|       |        // simply copy the old data over
  399|      1|        if constexpr (isRelocatable<Node>()) {
  400|      1|            if (allocated)
  ------------------
  |  Branch (400:17): [True: 0, False: 1]
  ------------------
  401|      0|                memcpy(newEntries, entries, allocated * sizeof(Entry));
  402|       |        } else {
  403|       |            for (size_t i = 0; i < allocated; ++i) {
  404|       |                new (&newEntries[i].node()) Node(std::move(entries[i].node()));
  405|       |                entries[i].node().~Node();
  406|       |            }
  407|       |        }
  408|     49|        for (size_t i = allocated; i < alloc; ++i) {
  ------------------
  |  Branch (408:36): [True: 48, False: 1]
  ------------------
  409|     48|            newEntries[i].nextFree() = uchar(i + 1);
  410|     48|        }
  411|      1|        delete[] entries;
  412|      1|        entries = newEntries;
  413|      1|        allocated = uchar(alloc);
  414|      1|    }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE5Entry8nextFreeEv:
  251|     50|        unsigned char &nextFree() { return *reinterpret_cast<unsigned char *>(&storage); }
_ZN12QHashPrivate4NodeIP16QLoggingCategory9QtMsgTypeE13createInPlaceIJRS3_EEEvPS4_RKS2_DpOT_:
   84|      1|    { new (n) Node{ Key(k), T(std::forward<Args>(args)...) }; }
_ZNK12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6Bucket10toIteratorEPKS6_:
  486|      1|        iterator toIterator(const Data *d) const noexcept { return iterator{d, toBucketIndex(d)}; }
_ZN5QHashIP16QLoggingCategory9QtMsgTypeE8iteratorC2EN12QHashPrivate8iteratorINS5_4NodeIS1_S2_EEEE:
 1134|      1|        explicit inline iterator(piter it) noexcept : i(it) { }
_ZN5QHashIP16QLoggingCategory9QtMsgTypeE16TryEmplaceResultC2ENS3_8iteratorEb:
 1266|      1|            : iterator(it), inserted(b)
 1267|      1|        {
 1268|      1|        }
_ZN5QHashIP16QLoggingCategory9QtMsgTypeE6removeERKS1_:
  985|      1|    {
  986|      1|        return removeImpl(key);
  987|      1|    }
_ZN5QHashIP16QLoggingCategory9QtMsgTypeE10removeImplIS1_EEbRKT_:
  990|      1|    {
  991|      1|        if (isEmpty()) // prevents detaching shared null
  ------------------
  |  Branch (991:13): [True: 0, False: 1]
  ------------------
  992|      0|            return false;
  993|      1|        auto it = d->findBucket(key);
  994|      1|        size_t bucket = it.toBucketIndex(d);
  995|      1|        detach();
  996|      1|        it = typename Data::Bucket(d, bucket); // reattach in case of detach
  997|       |
  998|      1|        if (it.isUnused())
  ------------------
  |  Branch (998:13): [True: 0, False: 1]
  ------------------
  999|      0|            return false;
 1000|      1|        d->erase(it);
 1001|      1|        return true;
 1002|      1|    }
_ZNK5QHashIP16QLoggingCategory9QtMsgTypeE7isEmptyEv:
  954|      1|    inline bool isEmpty() const noexcept { return !d || d->size == 0; }
  ------------------
  |  Branch (954:51): [True: 0, False: 1]
  |  Branch (954:57): [True: 0, False: 1]
  ------------------
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE5eraseENS6_6BucketE:
  742|      1|    {
  743|      1|        Q_ASSERT(bucket.span->hasNode(bucket.index));
  744|      1|        bucket.span->erase(bucket.index);
  745|      1|        --size;
  746|       |
  747|       |        // re-insert the following entries to avoid holes
  748|      1|        Bucket next = bucket;
  749|      1|        while (true) {
  ------------------
  |  Branch (749:16): [Folded - Ignored]
  ------------------
  750|      1|            next.advanceWrapped(this);
  751|      1|            size_t offset = next.offset();
  752|      1|            if (offset == SpanConstants::UnusedEntry)
  ------------------
  |  Branch (752:17): [True: 1, False: 0]
  ------------------
  753|      1|                return;
  754|      0|            size_t hash = QHashPrivate::calculateHash(next.nodeAtOffset(offset).key, seed);
  755|      0|            Bucket newBucket(this, GrowthPolicy::bucketForHash(numBuckets, hash));
  756|      0|            while (true) {
  ------------------
  |  Branch (756:20): [Folded - Ignored]
  ------------------
  757|      0|                if (newBucket == next) {
  ------------------
  |  Branch (757:21): [True: 0, False: 0]
  ------------------
  758|       |                    // nothing to do, item is at the right plae
  759|      0|                    break;
  760|      0|                } else if (newBucket == bucket) {
  ------------------
  |  Branch (760:28): [True: 0, False: 0]
  ------------------
  761|       |                    // move into the hole we created earlier
  762|      0|                    if (next.span == bucket.span) {
  ------------------
  |  Branch (762:25): [True: 0, False: 0]
  ------------------
  763|      0|                        bucket.span->moveLocal(next.index, bucket.index);
  764|      0|                    } else {
  765|       |                        // move between spans, more expensive
  766|      0|                        bucket.span->moveFromSpan(*next.span, next.index, bucket.index);
  767|      0|                    }
  768|      0|                    bucket = next;
  769|      0|                    break;
  770|      0|                }
  771|      0|                newBucket.advanceWrapped(this);
  772|      0|            }
  773|      0|        }
  774|      1|    }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE5eraseEm:
  293|      1|    {
  294|      1|        Q_ASSERT(bucket < SpanConstants::NEntries);
  295|      1|        Q_ASSERT(offsets[bucket] != SpanConstants::UnusedEntry);
  296|       |
  297|      1|        unsigned char entry = offsets[bucket];
  298|      1|        offsets[bucket] = SpanConstants::UnusedEntry;
  299|       |
  300|      1|        entries[entry].node().~Node();
  301|      1|        entries[entry].nextFree() = nextFree;
  302|      1|        nextFree = entry;
  303|      1|    }
_ZN12QHashPrivate4SpanINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE2atEm:
  313|      2|    {
  314|      2|        Q_ASSERT(i < SpanConstants::NEntries);
  315|      2|        Q_ASSERT(offsets[i] != SpanConstants::UnusedEntry);
  316|       |
  317|      2|        return entries[offsets[i]].node();
  318|      2|    }
_ZNK5QHashIP16QLoggingCategory9QtMsgTypeE8containsERKS1_:
 1034|      1|    {
 1035|      1|        if (!d)
  ------------------
  |  Branch (1035:13): [True: 0, False: 1]
  ------------------
 1036|      0|            return false;
 1037|      1|        return d->findNode(key) != nullptr;
 1038|      1|    }
_ZNK12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE8findNodeIS3_EEPS5_RKT_:
  709|      2|    {
  710|      2|        auto bucket = findBucket(key);
  711|      2|        if (bucket.isUnused())
  ------------------
  |  Branch (711:13): [True: 0, False: 2]
  ------------------
  712|      0|            return nullptr;
  713|      2|        return bucket.node();
  714|      2|    }
_ZN12QHashPrivate4DataINS_4NodeIP16QLoggingCategory9QtMsgTypeEEE6Bucket4nodeEv:
  508|      2|        {
  509|      2|            return &span->at(index);
  510|      2|        }
_ZNK5QHashIP16QLoggingCategory9QtMsgTypeE5valueERKS1_:
 1088|      1|    {
 1089|      1|        if (T *v = valueImpl(key))
  ------------------
  |  Branch (1089:16): [True: 1, False: 0]
  ------------------
 1090|      1|            return *v;
 1091|      0|        else
 1092|      0|            return T();
 1093|      1|    }
_ZNK5QHashIP16QLoggingCategory9QtMsgTypeE9valueImplIS1_EEPS2_RKT_:
 1078|      1|    {
 1079|      1|        if (d) {
  ------------------
  |  Branch (1079:13): [True: 1, False: 0]
  ------------------
 1080|      1|            Node *n = d->findNode(key);
 1081|      1|            if (n)
  ------------------
  |  Branch (1081:17): [True: 1, False: 0]
  ------------------
 1082|      1|                return &n->value;
 1083|      1|        }
 1084|      0|        return nullptr;
 1085|      1|    }
_ZN5QHashIi22QSocketNotifierSetUNIXEC2Ev:
  849|  1.93k|    inline QHash() noexcept = default;
_ZN5QHashIi22QSocketNotifierSetUNIXED2Ev:
  863|  1.93k|    {
  864|  1.93k|        static_assert(std::is_nothrow_destructible_v<Key>, "Types with throwing destructors are not supported in Qt containers.");
  865|  1.93k|        static_assert(std::is_nothrow_destructible_v<T>, "Types with throwing destructors are not supported in Qt containers.");
  866|       |
  867|  1.93k|        if (d && !d->ref.deref())
  ------------------
  |  Branch (867:13): [True: 0, False: 1.93k]
  |  Branch (867:18): [True: 0, False: 0]
  ------------------
  868|      0|            delete d;
  869|  1.93k|    }
_ZN5QHashIPhN20QFSFileEnginePrivate14StartAndLengthEEC2Ev:
  849|      1|    inline QHash() noexcept = default;
_ZN5QHashIPhN20QFSFileEnginePrivate14StartAndLengthEED2Ev:
  863|      1|    {
  864|      1|        static_assert(std::is_nothrow_destructible_v<Key>, "Types with throwing destructors are not supported in Qt containers.");
  865|      1|        static_assert(std::is_nothrow_destructible_v<T>, "Types with throwing destructors are not supported in Qt containers.");
  866|       |
  867|      1|        if (d && !d->ref.deref())
  ------------------
  |  Branch (867:13): [True: 0, False: 1]
  |  Branch (867:18): [True: 0, False: 0]
  ------------------
  868|      0|            delete d;
  869|      1|    }
_ZNK5QHashIPhN20QFSFileEnginePrivate14StartAndLengthEE7isEmptyEv:
  954|      1|    inline bool isEmpty() const noexcept { return !d || d->size == 0; }
  ------------------
  |  Branch (954:51): [True: 1, False: 0]
  |  Branch (954:57): [True: 0, False: 0]
  ------------------

_ZNK18QOffsetStringArrayINSt3__15arrayIcLm73EEENS1_IhLm13EEEE5countEv:
   85|      1|    constexpr int count() const { return int(m_offsets.size()) - 1; }
_ZNK18QOffsetStringArrayINSt3__15arrayIcLm73EEENS1_IhLm13EEEE6viewAtEx:
   80|      1|    {
   81|      1|        return { m_string.data() + m_offsets[index],
   82|      1|                    qsizetype(m_offsets[index + 1]) - qsizetype(m_offsets[index]) - 1 };
   83|      1|    }

_ZNK14QScopedPointerI11QObjectData21QScopedPointerDeleterIS0_EE3getEv:
  111|   402k|    {
  112|   402k|        return d;
  113|   402k|    }
_ZNK14QScopedPointerI11QObjectData21QScopedPointerDeleterIS0_EEptEv:
   91|   196k|    {
   92|   196k|        return d;
   93|   196k|    }

_ZN12QWeakPointerI7QObjectED2Ev:
  618|      1|    inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; }
  ------------------
  |  Branch (618:34): [True: 0, False: 1]
  |  Branch (618:39): [True: 0, False: 0]
  ------------------
_ZNK12QWeakPointerI7QObjectE12internalDataEv:
  791|  1.93k|    {
  792|  1.93k|        return d == nullptr || d->strongref.loadRelaxed() == 0 ? nullptr : value;
  ------------------
  |  Branch (792:16): [True: 1.93k, False: 0]
  |  Branch (792:32): [True: 0, False: 0]
  ------------------
  793|  1.93k|    }

_ZN11QtMiscUtils12isAsciiDigitEDi:
   68|      3|{
   69|      3|    return c >= '0' && c <= '9';
  ------------------
  |  Branch (69:12): [True: 3, False: 0]
  |  Branch (69:24): [True: 0, False: 3]
  ------------------
   70|      3|}
_ZN11QtMiscUtils12isAsciiUpperEDi:
   73|   440k|{
   74|   440k|    return c >= 'A' && c <= 'Z';
  ------------------
  |  Branch (74:12): [True: 355k, False: 85.0k]
  |  Branch (74:24): [True: 3, False: 355k]
  ------------------
   75|   440k|}
_ZN11QtMiscUtils12toAsciiLowerEc:
   88|   440k|{
   89|   440k|    return isAsciiUpper(ch) ? ch - 'A' + 'a' : ch;
  ------------------
  |  Branch (89:12): [True: 3, False: 440k]
  ------------------
   90|   440k|}
_ZN11QtMiscUtils16caseCompareAsciiEcc:
   98|   220k|{
   99|   220k|    const char lhsLower = QtMiscUtils::toAsciiLower(lhs);
  100|   220k|    const char rhsLower = QtMiscUtils::toAsciiLower(rhs);
  101|   220k|    return int(uchar(lhsLower)) - int(uchar(rhsLower));
  102|   220k|}

_ZNK12QVLABaseBase4sizeEv:
   75|      2|    constexpr size_type size() const noexcept { return s; }
_ZN8QVLABaseI11QRingBufferE4dataEv:
   86|      4|    T *data() noexcept { return static_cast<T *>(ptr); }
_ZN15QVarLengthArrayI11QRingBufferLx2EEC2Ev:
  309|      1|    {
  310|      1|        this->a = Prealloc;
  311|      1|        this->s = 0;
  312|      1|        this->ptr = this->array;
  313|      1|    }
_ZN15QVarLengthArrayI11QRingBufferLx1EEC2Ev:
  309|      1|    {
  310|      1|        this->a = Prealloc;
  311|      1|        this->s = 0;
  312|      1|        this->ptr = this->array;
  313|      1|    }
_ZN15QVarLengthArrayI11QRingBufferLx2EED2Ev:
  364|      1|    {
  365|       |        if constexpr (QTypeInfo<T>::isComplex)
  366|      1|            std::destroy_n(data(), size());
  367|      1|        if (data() != reinterpret_cast<T *>(this->array))
  ------------------
  |  Branch (367:13): [True: 0, False: 1]
  ------------------
  368|      0|            free(data());
  369|      1|    }
_ZN15QVarLengthArrayI11QRingBufferLx1EED2Ev:
  364|      1|    {
  365|       |        if constexpr (QTypeInfo<T>::isComplex)
  366|      1|            std::destroy_n(data(), size());
  367|      1|        if (data() != reinterpret_cast<T *>(this->array))
  ------------------
  |  Branch (367:13): [True: 0, False: 1]
  ------------------
  368|      0|            free(data());
  369|      1|    }

