LLVMFuzzerTestOneInput:
   35|    481|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   36|       |
   37|       |    // since this check is expensive, only do it once
   38|    481|    static const auto supported_implementations=get_runtime_supported_implementations();
   39|       |
   40|       |
   41|    481|    auto utf8verify=[Data,Size](const simdjson::implementation* impl) -> bool {
   42|    481|        return impl->validate_utf8((const char*)Data,Size);
   43|    481|    };
   44|       |
   45|       |
   46|    481|    auto first = supported_implementations.begin();
   47|    481|    auto last = supported_implementations.end();
   48|       |
   49|       |
   50|    481|    const bool reference=utf8verify(*first);
   51|       |
   52|    481|    bool failed=false;
   53|  1.44k|    for(auto it=first+1; it != last; ++it) {
  ------------------
  |  Branch (53:26): [True: 962, False: 481]
  ------------------
   54|    962|        const bool current=utf8verify(*it);
   55|    962|        if(current!=reference) {
  ------------------
  |  Branch (55:12): [True: 0, False: 962]
  ------------------
   56|      0|            failed=true;
   57|      0|        }
   58|    962|    }
   59|       |
   60|    481|    if(failed) {
  ------------------
  |  Branch (60:8): [True: 0, False: 481]
  ------------------
   61|      0|        std::cerr<<std::boolalpha<<"Mismatch between implementations of validate_utf8() found:\n";
   62|      0|        for(const auto& e: supported_implementations) {
  ------------------
  |  Branch (62:26): [True: 0, False: 0]
  ------------------
   63|      0|            if(!e->supported_by_runtime_system()) { continue; }
  ------------------
  |  Branch (63:16): [True: 0, False: 0]
  ------------------
   64|      0|            const bool current=utf8verify(e);
   65|      0|            std::cerr<<e->name()<<" returns "<<current<<std::endl;
   66|      0|        }
   67|      0|        std::cerr << "Offending input: \"";
   68|      0|        for(size_t i = 0; i < Size; i++) {
  ------------------
  |  Branch (68:27): [True: 0, False: 0]
  ------------------
   69|      0|            std::cerr << "\\x" << std::hex << std::setw(2) << std::setfill('0')  << uint32_t(Data[i]);
   70|      0|        }
   71|      0|        std::cerr << "\"" <<std::endl;
   72|       |
   73|      0|        VerboseTestOneInput(Data, Size);
   74|       |
   75|      0|        std::abort();
   76|      0|    }
   77|       |
   78|       |    //all is well
   79|    481|    return 0;
   80|    481|}
fuzz_utf8.cpp:_ZZ22LLVMFuzzerTestOneInputENK3$_0clEPKN8simdjson14implementationE:
   41|  1.44k|    auto utf8verify=[Data,Size](const simdjson::implementation* impl) -> bool {
   42|  1.44k|        return impl->validate_utf8((const char*)Data,Size);
   43|  1.44k|    };

_Z37get_runtime_supported_implementationsv:
   18|      1|get_runtime_supported_implementations() {
   19|      1|    std::vector<const simdjson::implementation*> ret;
   20|      4|    for(auto& e: simdjson::get_available_implementations()) {
  ------------------
  |  Branch (20:16): [True: 4, False: 1]
  ------------------
   21|      4|        if(e->supported_by_runtime_system()) {
  ------------------
  |  Branch (21:12): [True: 3, False: 1]
  ------------------
   22|      3|            ret.emplace_back(e);
   23|      3|        }
   24|      4|    }
   25|      1|    if(ret.empty()) {
  ------------------
  |  Branch (25:8): [True: 0, False: 1]
  ------------------
   26|       |        // No implementations available, not even fallback, weird.
   27|      0|        std::abort();
   28|      0|    }
   29|      1|    return ret;
   30|      1|}

_ZN8simdjson8fallback14implementationC2Ev:
   17|      1|  simdjson_inline implementation() : simdjson::implementation(
   18|      1|      "fallback",
   19|      1|      "Generic fallback implementation",
   20|      1|      0
   21|      1|  ) {}

_ZN8simdjson7haswell14implementationC2Ev:
   19|      1|  simdjson_inline implementation() : simdjson::implementation(
   20|      1|      "haswell",
   21|      1|      "Intel/AMD AVX2",
   22|      1|      internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2
   23|      1|  ) {}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ev:
  231|  1.44k|    simdjson_inline simd8() : base8_numeric<uint8_t>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2Ev:
   98|  1.44k|    simdjson_inline base8_numeric() : base8<T>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2Ev:
   50|  1.44k|    simdjson_inline base8() : base<simd8<T>>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2Ev:
   22|  1.44k|    simdjson_inline base() : value{__m256i()} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  309|   367k|    simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8<T>::load(ptr), simd8<T>::load(ptr+32)} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE4loadEPKh:
   82|   814k|    static simdjson_inline simd8<T> load(const T values[32]) {
   83|   814k|      return _mm256_loadu_si256(reinterpret_cast<const __m256i *>(values));
   84|   814k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EDv4_x:
  232|  6.08M|    simdjson_inline simd8(const __m256i _value) : base8_numeric<uint8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2EDv4_x:
   99|  6.08M|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2EDv4_x:
   51|  6.08M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2EDv4_x:
   25|  6.08M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  330|   367k|    simdjson_inline simd8<T> reduce_or() const {
  331|   367k|      return this->chunks[0] | this->chunks[1];
  332|   367k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   32|   977k|    simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv4_xEv:
   28|  7.66M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  283|   367k|    simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   36|   448k|    simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast<Child*>(this); *this_cast = *this_cast | other; return *this_cast; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi1EEENS4_IhEES8_:
   58|   161k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   59|   161k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   60|   161k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  289|   323k|    simdjson_inline simd8<uint8_t> shr() const { return simd8<uint8_t>(_mm256_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_:
  177|   485k|        L replace12, L replace13, L replace14, L replace15) const {
  178|   485k|      return lookup_16(simd8<L>::repeat_16(
  179|   485k|        replace0,  replace1,  replace2,  replace3,
  180|   485k|        replace4,  replace5,  replace6,  replace7,
  181|   485k|        replace8,  replace9,  replace10, replace11,
  182|   485k|        replace12, replace13, replace14, replace15
  183|   485k|      ));
  184|   485k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  115|   485k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  116|   485k|      return _mm256_shuffle_epi8(lookup_table, *this);
  117|   485k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv4_xEv:
   29|   485k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  253|   485k|    ) {
  254|   485k|      return simd8<uint8_t>(
  255|   485k|        v0, v1, v2, v3, v4, v5, v6, v7,
  256|   485k|        v8, v9, v10,v11,v12,v13,v14,v15,
  257|   485k|        v0, v1, v2, v3, v4, v5, v6, v7,
  258|   485k|        v8, v9, v10,v11,v12,v13,v14,v15
  259|   485k|      );
  260|   485k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh:
  243|   485k|    ) : simd8(_mm256_setr_epi8(
  244|   485k|      v0, v1, v2, v3, v4, v5, v6, v7,
  245|   485k|      v8, v9, v10,v11,v12,v13,v14,v15,
  246|   485k|      v16,v17,v18,v19,v20,v21,v22,v23,
  247|   485k|      v24,v25,v26,v27,v28,v29,v30,v31
  248|   485k|    )) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   33|   970k|    simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Eh:
  234|   970k|    simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5splatEh:
   80|   970k|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi2EEENS4_IhEES8_:
   58|   161k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   59|   161k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   60|   161k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   58|   161k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   59|   161k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   60|   161k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  264|   404k|    simdjson_inline simd8<uint8_t> saturating_sub(const simd8<uint8_t> other) const { return _mm256_subs_epu8(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   34|   161k|    simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  236|  80.9k|    simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  270|  80.9k|    simdjson_inline simd8<uint8_t> gt_bits(const simd8<uint8_t> other) const { return this->saturating_sub(other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21any_bits_set_anywhereEv:
  285|    481|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  284|    481|    simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); }

_ZN8simdjson7icelake14implementationC2Ev:
   19|      1|  simdjson_inline implementation() : simdjson::implementation(
   20|      1|      "icelake",
   21|      1|      "Intel/AMD AVX512",
   22|      1|      internal::instruction_set::AVX2 | internal::instruction_set::PCLMULQDQ | internal::instruction_set::BMI1 | internal::instruction_set::BMI2 | internal::instruction_set::AVX512F | internal::instruction_set::AVX512DQ | internal::instruction_set::AVX512CD | internal::instruction_set::AVX512BW | internal::instruction_set::AVX512VL | internal::instruction_set::AVX512VBMI2
   23|      1|  ) {}

_ZNK8simdjson14implementation25required_instruction_setsEv:
   84|      4|  virtual uint32_t required_instruction_sets() const { return _required_instruction_sets; }
_ZN8simdjson14implementationC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_j:
  137|      4|    _name(name),
  138|      4|    _description(description),
  139|      4|    _required_instruction_sets(required_instruction_sets)
  140|      4|  {
  141|      4|  }
_ZN8simdjson8internal29available_implementation_listC2Ev:
  171|      1|  simdjson_inline available_implementation_list() {}

_ZN8simdjson8westmere14implementationC2Ev:
   19|      1|  simdjson_inline implementation() : simdjson::implementation("westmere", "Intel/AMD SSE4.2", internal::instruction_set::SSE42 | internal::instruction_set::PCLMULQDQ) {}

simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2Ev:
  202|  1.44k|    simdjson_inline simd8() : base8_numeric<uint8_t>() {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhEC2Ev:
   90|  1.44k|    simdjson_inline base8_numeric() : base8<T>() {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2Ev:
   44|  1.44k|    simdjson_inline base8() : base<simd8<T>>() {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2Ev:
   20|  1.44k|    simdjson_inline base() : value{__m128i()} {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  274|   367k|    simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8<T>::load(ptr), simd8<T>::load(ptr+16), simd8<T>::load(ptr+32), simd8<T>::load(ptr+48)} {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhE4loadEPKh:
   76|  1.54M|    static simdjson_inline simd8<T> load(const T values[16]) {
   77|  1.54M|      return _mm_loadu_si128(reinterpret_cast<const __m128i *>(values));
   78|  1.54M|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2EDv2_x:
  203|  12.0M|    simdjson_inline simd8(const __m128i _value) : base8_numeric<uint8_t>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhEC2EDv2_x:
   91|  12.0M|    simdjson_inline base8_numeric(const __m128i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2EDv2_x:
   45|  12.0M|    simdjson_inline base8(const __m128i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2EDv2_x:
   23|  12.0M|    simdjson_inline base(const __m128i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  283|   367k|    simdjson_inline simd8<T> reduce_or() const {
  284|   367k|      return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]);
  285|   367k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   30|  2.03M|    simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv2_xEv:
   26|  13.9M|    simdjson_inline operator const __m128i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  248|   367k|    simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   34|   610k|    simdjson_inline Child& operator|=(const Child other) { auto this_cast = static_cast<Child*>(this); *this_cast = *this_cast | other; return *this_cast; }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi1EEENS4_IhEES8_:
   52|   323k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   53|   323k|      return _mm_alignr_epi8(*this, prev_chunk, 16 - N);
   54|   323k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  254|   647k|    simdjson_inline simd8<uint8_t> shr() const { return simd8<uint8_t>(_mm_srli_epi16(*this, N)) & uint8_t(0xFFu >> N); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_S7_:
  154|   970k|        L replace12, L replace13, L replace14, L replace15) const {
  155|   970k|      return lookup_16(simd8<L>::repeat_16(
  156|   970k|        replace0,  replace1,  replace2,  replace3,
  157|   970k|        replace4,  replace5,  replace6,  replace7,
  158|   970k|        replace8,  replace9,  replace10, replace11,
  159|   970k|        replace12, replace13, replace14, replace15
  160|   970k|      ));
  161|   970k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  107|   970k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  108|   970k|      return _mm_shuffle_epi8(lookup_table, *this);
  109|   970k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv2_xEv:
   27|   970k|    simdjson_inline operator __m128i&() { return this->value; }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  220|   970k|    ) {
  221|   970k|      return simd8<uint8_t>(
  222|   970k|        v0, v1, v2, v3, v4, v5, v6, v7,
  223|   970k|        v8, v9, v10,v11,v12,v13,v14,v15
  224|   970k|      );
  225|   970k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhh:
  212|   970k|    ) : simd8(_mm_setr_epi8(
  213|   970k|      v0, v1, v2, v3, v4, v5, v6, v7,
  214|   970k|      v8, v9, v10,v11,v12,v13,v14,v15
  215|   970k|    )) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   31|  1.94M|    simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2Eh:
  205|  1.94M|    simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhE5splatEh:
   74|  1.94M|    static simdjson_inline simd8<T> splat(T _value) { return _mm_set1_epi8(_value); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi2EEENS4_IhEES8_:
   52|   323k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   53|   323k|      return _mm_alignr_epi8(*this, prev_chunk, 16 - N);
   54|   323k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   52|   323k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   53|   323k|      return _mm_alignr_epi8(*this, prev_chunk, 16 - N);
   54|   323k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  229|   728k|    simdjson_inline simd8<uint8_t> saturating_sub(const simd8<uint8_t> other) const { return _mm_subs_epu8(*this, other); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   32|   323k|    simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  207|  80.9k|    simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  235|  80.9k|    simdjson_inline simd8<uint8_t> gt_bits(const simd8<uint8_t> other) const { return this->saturating_sub(other); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE21any_bits_set_anywhereEv:
  250|    481|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  249|    481|    simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); }

_ZNK8simdjson8fallback14implementation13validate_utf8EPKcm:
  311|    481|simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
  312|    481|  const uint8_t *data = reinterpret_cast<const uint8_t *>(buf);
  313|    481|  uint64_t pos = 0;
  314|    481|  uint32_t code_point = 0;
  315|  1.22M|  while (pos < len) {
  ------------------
  |  Branch (315:10): [True: 1.22M, False: 154]
  ------------------
  316|       |    // check of the next 8 bytes are ascii.
  317|  1.22M|    uint64_t next_pos = pos + 16;
  318|  1.22M|    if (next_pos <= len) { // if it is safe to read 8 more bytes, check that they are ascii
  ------------------
  |  Branch (318:9): [True: 1.21M, False: 1.51k]
  ------------------
  319|  1.21M|      uint64_t v1;
  320|  1.21M|      memcpy(&v1, data + pos, sizeof(uint64_t));
  321|  1.21M|      uint64_t v2;
  322|  1.21M|      memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t));
  323|  1.21M|      uint64_t v{v1 | v2};
  324|  1.21M|      if ((v & 0x8080808080808080) == 0) {
  ------------------
  |  Branch (324:11): [True: 789k, False: 429k]
  ------------------
  325|   789k|        pos = next_pos;
  326|   789k|        continue;
  327|   789k|      }
  328|  1.21M|    }
  329|   431k|    unsigned char byte = data[pos];
  330|   431k|    if (byte < 0x80) {
  ------------------
  |  Branch (330:9): [True: 366k, False: 64.5k]
  ------------------
  331|   366k|      pos++;
  332|   366k|      continue;
  333|   366k|    } else if ((byte & 0xe0) == 0xc0) {
  ------------------
  |  Branch (333:16): [True: 35.6k, False: 28.8k]
  ------------------
  334|  35.6k|      next_pos = pos + 2;
  335|  35.6k|      if (next_pos > len) { return false; }
  ------------------
  |  Branch (335:11): [True: 36, False: 35.6k]
  ------------------
  336|  35.6k|      if ((data[pos + 1] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (336:11): [True: 28, False: 35.6k]
  ------------------
  337|       |      // range check
  338|  35.6k|      code_point = (byte & 0x1f) << 6 | (data[pos + 1] & 0x3f);
  339|  35.6k|      if (code_point < 0x80 || 0x7ff < code_point) { return false; }
  ------------------
  |  Branch (339:11): [True: 6, False: 35.6k]
  |  Branch (339:32): [True: 0, False: 35.6k]
  ------------------
  340|  35.6k|    } else if ((byte & 0xf0) == 0xe0) {
  ------------------
  |  Branch (340:16): [True: 10.2k, False: 18.6k]
  ------------------
  341|  10.2k|      next_pos = pos + 3;
  342|  10.2k|      if (next_pos > len) { return false; }
  ------------------
  |  Branch (342:11): [True: 25, False: 10.1k]
  ------------------
  343|  10.1k|      if ((data[pos + 1] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (343:11): [True: 24, False: 10.1k]
  ------------------
  344|  10.1k|      if ((data[pos + 2] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (344:11): [True: 14, False: 10.1k]
  ------------------
  345|       |      // range check
  346|  10.1k|      code_point = (byte & 0x0f) << 12 |
  347|  10.1k|                   (data[pos + 1] & 0x3f) << 6 |
  348|  10.1k|                   (data[pos + 2] & 0x3f);
  349|  10.1k|      if (code_point < 0x800 || 0xffff < code_point ||
  ------------------
  |  Branch (349:11): [True: 16, False: 10.1k]
  |  Branch (349:33): [True: 0, False: 10.1k]
  ------------------
  350|  10.1k|          (0xd7ff < code_point && code_point < 0xe000)) {
  ------------------
  |  Branch (350:12): [True: 3.20k, False: 6.94k]
  |  Branch (350:35): [True: 13, False: 3.18k]
  ------------------
  351|     29|        return false;
  352|     29|      }
  353|  18.6k|    } else if ((byte & 0xf8) == 0xf0) { // 0b11110000
  ------------------
  |  Branch (353:16): [True: 18.5k, False: 70]
  ------------------
  354|  18.5k|      next_pos = pos + 4;
  355|  18.5k|      if (next_pos > len) { return false; }
  ------------------
  |  Branch (355:11): [True: 26, False: 18.5k]
  ------------------
  356|  18.5k|      if ((data[pos + 1] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (356:11): [True: 20, False: 18.5k]
  ------------------
  357|  18.5k|      if ((data[pos + 2] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (357:11): [True: 10, False: 18.5k]
  ------------------
  358|  18.5k|      if ((data[pos + 3] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (358:11): [True: 10, False: 18.5k]
  ------------------
  359|       |      // range check
  360|  18.5k|      code_point =
  361|  18.5k|          (byte & 0x07) << 18 | (data[pos + 1] & 0x3f) << 12 |
  362|  18.5k|          (data[pos + 2] & 0x3f) << 6 | (data[pos + 3] & 0x3f);
  363|  18.5k|      if (code_point <= 0xffff || 0x10ffff < code_point) { return false; }
  ------------------
  |  Branch (363:11): [True: 20, False: 18.4k]
  |  Branch (363:35): [True: 9, False: 18.4k]
  ------------------
  364|  18.5k|    } else {
  365|       |      // we may have a continuation
  366|     70|      return false;
  367|     70|    }
  368|  64.2k|    pos = next_pos;
  369|  64.2k|  }
  370|    154|  return true;
  371|    481|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm64EEC2EPKhm:
   83|    481|simdjson_inline buf_block_reader<STEP_SIZE>::buf_block_reader(const uint8_t *_buf, size_t _len) : buf{_buf}, len{_len}, lenminusstep{len < STEP_SIZE ? 0 : len - STEP_SIZE}, idx{0} {}
  ------------------
  |  Branch (83:134): [True: 282, False: 199]
  ------------------
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm64EE14has_full_blockEv:
   89|   367k|simdjson_inline bool buf_block_reader<STEP_SIZE>::has_full_block() const {
   90|   367k|  return idx < lenminusstep;
   91|   367k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm64EE10full_blockEv:
   94|   366k|simdjson_inline const uint8_t *buf_block_reader<STEP_SIZE>::full_block() const {
   95|   366k|  return &buf[idx];
   96|   366k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm64EE7advanceEv:
  107|   367k|simdjson_inline void buf_block_reader<STEP_SIZE>::advance() {
  108|   367k|  idx += STEP_SIZE;
  109|   367k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_16stage116buf_block_readerILm64EE13get_remainderEPh:
   99|    481|simdjson_inline size_t buf_block_reader<STEP_SIZE>::get_remainder(uint8_t *dst) const {
  100|    481|  if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers
  ------------------
  |  Branch (100:6): [True: 0, False: 481]
  ------------------
  101|    481|  std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once.
  102|    481|  std::memcpy(dst, buf + idx, len - idx);
  103|    481|  return len - idx;
  104|    481|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_16stage116buf_block_readerILm64EEC2EPKhm:
   83|    481|simdjson_inline buf_block_reader<STEP_SIZE>::buf_block_reader(const uint8_t *_buf, size_t _len) : buf{_buf}, len{_len}, lenminusstep{len < STEP_SIZE ? 0 : len - STEP_SIZE}, idx{0} {}
  ------------------
  |  Branch (83:134): [True: 282, False: 199]
  ------------------
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_16stage116buf_block_readerILm64EE14has_full_blockEv:
   89|   367k|simdjson_inline bool buf_block_reader<STEP_SIZE>::has_full_block() const {
   90|   367k|  return idx < lenminusstep;
   91|   367k|}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_16stage116buf_block_readerILm64EE10full_blockEv:
   94|   366k|simdjson_inline const uint8_t *buf_block_reader<STEP_SIZE>::full_block() const {
   95|   366k|  return &buf[idx];
   96|   366k|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_16stage116buf_block_readerILm64EE7advanceEv:
  107|   367k|simdjson_inline void buf_block_reader<STEP_SIZE>::advance() {
  108|   367k|  idx += STEP_SIZE;
  109|   367k|}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_16stage116buf_block_readerILm64EE13get_remainderEPh:
   99|    481|simdjson_inline size_t buf_block_reader<STEP_SIZE>::get_remainder(uint8_t *dst) const {
  100|    481|  if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers
  ------------------
  |  Branch (100:6): [True: 0, False: 481]
  ------------------
  101|    481|  std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once.
  102|    481|  std::memcpy(dst, buf + idx, len - idx);
  103|    481|  return len - idx;
  104|    481|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker16check_next_inputERKNS1_4simd8simd8x64IhEE:
  173|   367k|    simdjson_inline void check_next_input(const simd8x64<uint8_t>& input) {
  174|   367k|      if(simdjson_likely(is_ascii(input))) {
  ------------------
  |  |  103|   367k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (103:30): [True: 286k, False: 80.9k]
  |  |  ------------------
  ------------------
  175|   286k|        this->error |= this->prev_incomplete;
  176|   286k|      } else {
  177|       |        // you might think that a for-loop would work, but under Visual Studio, it is not good enough.
  178|  80.9k|        static_assert((simd8x64<uint8_t>::NUM_CHUNKS == 1)
  179|  80.9k|                ||(simd8x64<uint8_t>::NUM_CHUNKS == 2)
  180|  80.9k|                || (simd8x64<uint8_t>::NUM_CHUNKS == 4),
  181|  80.9k|                "We support one, two or four chunks per 64-byte block.");
  182|  80.9k|        SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 1) {
  ------------------
  |  |   47|  80.9k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  183|       |          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  184|  80.9k|        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 2) {
  ------------------
  |  |   47|  80.9k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  185|  80.9k|          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  186|  80.9k|          this->check_utf8_bytes(input.chunks[1], input.chunks[0]);
  187|       |        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 4) {
  188|       |          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  189|       |          this->check_utf8_bytes(input.chunks[1], input.chunks[0]);
  190|       |          this->check_utf8_bytes(input.chunks[2], input.chunks[1]);
  191|       |          this->check_utf8_bytes(input.chunks[3], input.chunks[2]);
  192|       |        }
  193|  80.9k|        this->prev_incomplete = is_incomplete(input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1]);
  194|  80.9k|        this->prev_input_block = input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1];
  195|  80.9k|      }
  196|   367k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker16check_utf8_bytesENS1_4simd5simd8IhEES6_:
  156|   161k|    simdjson_inline void check_utf8_bytes(const simd8<uint8_t> input, const simd8<uint8_t> prev_input) {
  157|       |      // Flip prev1...prev3 so we can easily determine if they are 2+, 3+ or 4+ lead bytes
  158|       |      // (2, 3, 4-byte leads become large positive numbers instead of small negative numbers)
  159|   161k|      simd8<uint8_t> prev1 = input.prev<1>(prev_input);
  160|   161k|      simd8<uint8_t> sc = check_special_cases(input, prev1);
  161|   161k|      this->error |= check_multibyte_lengths(input, prev_input, sc);
  162|   161k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation19check_special_casesENS1_4simd5simd8IhEES5_:
   16|   161k|  simdjson_inline simd8<uint8_t> check_special_cases(const simd8<uint8_t> input, const simd8<uint8_t> prev1) {
   17|       |// Bit 0 = Too Short (lead byte/ASCII followed by lead byte/ASCII)
   18|       |// Bit 1 = Too Long (ASCII followed by continuation)
   19|       |// Bit 2 = Overlong 3-byte
   20|       |// Bit 4 = Surrogate
   21|       |// Bit 5 = Overlong 2-byte
   22|       |// Bit 7 = Two Continuations
   23|   161k|    constexpr const uint8_t TOO_SHORT   = 1<<0; // 11______ 0_______
   24|       |                                                // 11______ 11______
   25|   161k|    constexpr const uint8_t TOO_LONG    = 1<<1; // 0_______ 10______
   26|   161k|    constexpr const uint8_t OVERLONG_3  = 1<<2; // 11100000 100_____
   27|   161k|    constexpr const uint8_t SURROGATE   = 1<<4; // 11101101 101_____
   28|   161k|    constexpr const uint8_t OVERLONG_2  = 1<<5; // 1100000_ 10______
   29|   161k|    constexpr const uint8_t TWO_CONTS   = 1<<7; // 10______ 10______
   30|   161k|    constexpr const uint8_t TOO_LARGE   = 1<<3; // 11110100 1001____
   31|       |                                                // 11110100 101_____
   32|       |                                                // 11110101 1001____
   33|       |                                                // 11110101 101_____
   34|       |                                                // 1111011_ 1001____
   35|       |                                                // 1111011_ 101_____
   36|       |                                                // 11111___ 1001____
   37|       |                                                // 11111___ 101_____
   38|   161k|    constexpr const uint8_t TOO_LARGE_1000 = 1<<6;
   39|       |                                                // 11110101 1000____
   40|       |                                                // 1111011_ 1000____
   41|       |                                                // 11111___ 1000____
   42|   161k|    constexpr const uint8_t OVERLONG_4  = 1<<6; // 11110000 1000____
   43|       |
   44|   161k|    const simd8<uint8_t> byte_1_high = prev1.shr<4>().lookup_16<uint8_t>(
   45|       |      // 0_______ ________ <ASCII in byte 1>
   46|   161k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   47|   161k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   48|       |      // 10______ ________ <continuation in byte 1>
   49|   161k|      TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS,
   50|       |      // 1100____ ________ <two byte lead in byte 1>
   51|   161k|      TOO_SHORT | OVERLONG_2,
   52|       |      // 1101____ ________ <two byte lead in byte 1>
   53|   161k|      TOO_SHORT,
   54|       |      // 1110____ ________ <three byte lead in byte 1>
   55|   161k|      TOO_SHORT | OVERLONG_3 | SURROGATE,
   56|       |      // 1111____ ________ <four+ byte lead in byte 1>
   57|   161k|      TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4
   58|   161k|    );
   59|   161k|    constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 .
   60|   161k|    const simd8<uint8_t> byte_1_low = (prev1 & 0x0F).lookup_16<uint8_t>(
   61|       |      // ____0000 ________
   62|   161k|      CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4,
   63|       |      // ____0001 ________
   64|   161k|      CARRY | OVERLONG_2,
   65|       |      // ____001_ ________
   66|   161k|      CARRY,
   67|   161k|      CARRY,
   68|       |
   69|       |      // ____0100 ________
   70|   161k|      CARRY | TOO_LARGE,
   71|       |      // ____0101 ________
   72|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   73|       |      // ____011_ ________
   74|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   75|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   76|       |
   77|       |      // ____1___ ________
   78|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   79|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   80|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   81|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   82|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   83|       |      // ____1101 ________
   84|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE,
   85|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   86|   161k|      CARRY | TOO_LARGE | TOO_LARGE_1000
   87|   161k|    );
   88|   161k|    const simd8<uint8_t> byte_2_high = input.shr<4>().lookup_16<uint8_t>(
   89|       |      // ________ 0_______ <ASCII in byte 2>
   90|   161k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   91|   161k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   92|       |
   93|       |      // ________ 1000____
   94|   161k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4,
   95|       |      // ________ 1001____
   96|   161k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE,
   97|       |      // ________ 101_____
   98|   161k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   99|   161k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
  100|       |
  101|       |      // ________ 11______
  102|   161k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT
  103|   161k|    );
  104|   161k|    return (byte_1_high & byte_1_low & byte_2_high);
  105|   161k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation23check_multibyte_lengthsENS1_4simd5simd8IhEES5_S5_:
  107|   161k|      const simd8<uint8_t> prev_input, const simd8<uint8_t> sc) {
  108|   161k|    simd8<uint8_t> prev2 = input.prev<2>(prev_input);
  109|   161k|    simd8<uint8_t> prev3 = input.prev<3>(prev_input);
  110|   161k|    simd8<uint8_t> must23 = must_be_2_3_continuation(prev2, prev3);
  111|   161k|    simd8<uint8_t> must23_80 = must23 & uint8_t(0x80);
  112|   161k|    return must23_80 ^ sc;
  113|   161k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation13is_incompleteENS1_4simd5simd8IhEE:
  119|  80.9k|  simdjson_inline simd8<uint8_t> is_incomplete(const simd8<uint8_t> input) {
  120|       |    // If the previous input's last 3 bytes match this, they're too short (they ended at EOF):
  121|       |    // ... 1111____ 111_____ 11______
  122|  80.9k|#if SIMDJSON_IMPLEMENTATION_ICELAKE
  123|  80.9k|    static const uint8_t max_array[64] = {
  124|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  125|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  126|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  127|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  128|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  129|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  130|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  131|  80.9k|      255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1
  132|  80.9k|    };
  133|       |#else
  134|       |    static const uint8_t max_array[32] = {
  135|       |      255, 255, 255, 255, 255, 255, 255, 255,
  136|       |      255, 255, 255, 255, 255, 255, 255, 255,
  137|       |      255, 255, 255, 255, 255, 255, 255, 255,
  138|       |      255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1
  139|       |    };
  140|       |#endif
  141|  80.9k|    const simd8<uint8_t> max_value(&max_array[sizeof(max_array)-sizeof(simd8<uint8_t>)]);
  142|  80.9k|    return input.gt_bits(max_value);
  143|  80.9k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker9check_eofEv:
  167|    481|    simdjson_inline void check_eof() {
  168|       |      // If the previous block had incomplete UTF-8 characters at the end, an ASCII block can't
  169|       |      // possibly finish them.
  170|    481|      this->error |= this->prev_incomplete;
  171|    481|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker6errorsEv:
  198|    481|    simdjson_inline error_code errors() {
  199|    481|      return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS;
  ------------------
  |  Branch (199:14): [True: 327, False: 154]
  ------------------
  200|    481|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation12utf8_checker16check_next_inputERKNS1_4simd8simd8x64IhEE:
  173|   367k|    simdjson_inline void check_next_input(const simd8x64<uint8_t>& input) {
  174|   367k|      if(simdjson_likely(is_ascii(input))) {
  ------------------
  |  |  103|   367k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (103:30): [True: 286k, False: 80.9k]
  |  |  ------------------
  ------------------
  175|   286k|        this->error |= this->prev_incomplete;
  176|   286k|      } else {
  177|       |        // you might think that a for-loop would work, but under Visual Studio, it is not good enough.
  178|  80.9k|        static_assert((simd8x64<uint8_t>::NUM_CHUNKS == 1)
  179|  80.9k|                ||(simd8x64<uint8_t>::NUM_CHUNKS == 2)
  180|  80.9k|                || (simd8x64<uint8_t>::NUM_CHUNKS == 4),
  181|  80.9k|                "We support one, two or four chunks per 64-byte block.");
  182|  80.9k|        SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 1) {
  ------------------
  |  |   47|  80.9k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  183|       |          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  184|  80.9k|        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 2) {
  ------------------
  |  |   47|  80.9k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  185|  80.9k|          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  186|  80.9k|          this->check_utf8_bytes(input.chunks[1], input.chunks[0]);
  187|  80.9k|        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 4) {
  ------------------
  |  |   47|  80.9k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  188|  80.9k|          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  189|  80.9k|          this->check_utf8_bytes(input.chunks[1], input.chunks[0]);
  190|  80.9k|          this->check_utf8_bytes(input.chunks[2], input.chunks[1]);
  191|  80.9k|          this->check_utf8_bytes(input.chunks[3], input.chunks[2]);
  192|  80.9k|        }
  193|  80.9k|        this->prev_incomplete = is_incomplete(input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1]);
  194|  80.9k|        this->prev_input_block = input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1];
  195|  80.9k|      }
  196|   367k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation12utf8_checker16check_utf8_bytesENS1_4simd5simd8IhEES6_:
  156|   323k|    simdjson_inline void check_utf8_bytes(const simd8<uint8_t> input, const simd8<uint8_t> prev_input) {
  157|       |      // Flip prev1...prev3 so we can easily determine if they are 2+, 3+ or 4+ lead bytes
  158|       |      // (2, 3, 4-byte leads become large positive numbers instead of small negative numbers)
  159|   323k|      simd8<uint8_t> prev1 = input.prev<1>(prev_input);
  160|   323k|      simd8<uint8_t> sc = check_special_cases(input, prev1);
  161|   323k|      this->error |= check_multibyte_lengths(input, prev_input, sc);
  162|   323k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation19check_special_casesENS1_4simd5simd8IhEES5_:
   16|   323k|  simdjson_inline simd8<uint8_t> check_special_cases(const simd8<uint8_t> input, const simd8<uint8_t> prev1) {
   17|       |// Bit 0 = Too Short (lead byte/ASCII followed by lead byte/ASCII)
   18|       |// Bit 1 = Too Long (ASCII followed by continuation)
   19|       |// Bit 2 = Overlong 3-byte
   20|       |// Bit 4 = Surrogate
   21|       |// Bit 5 = Overlong 2-byte
   22|       |// Bit 7 = Two Continuations
   23|   323k|    constexpr const uint8_t TOO_SHORT   = 1<<0; // 11______ 0_______
   24|       |                                                // 11______ 11______
   25|   323k|    constexpr const uint8_t TOO_LONG    = 1<<1; // 0_______ 10______
   26|   323k|    constexpr const uint8_t OVERLONG_3  = 1<<2; // 11100000 100_____
   27|   323k|    constexpr const uint8_t SURROGATE   = 1<<4; // 11101101 101_____
   28|   323k|    constexpr const uint8_t OVERLONG_2  = 1<<5; // 1100000_ 10______
   29|   323k|    constexpr const uint8_t TWO_CONTS   = 1<<7; // 10______ 10______
   30|   323k|    constexpr const uint8_t TOO_LARGE   = 1<<3; // 11110100 1001____
   31|       |                                                // 11110100 101_____
   32|       |                                                // 11110101 1001____
   33|       |                                                // 11110101 101_____
   34|       |                                                // 1111011_ 1001____
   35|       |                                                // 1111011_ 101_____
   36|       |                                                // 11111___ 1001____
   37|       |                                                // 11111___ 101_____
   38|   323k|    constexpr const uint8_t TOO_LARGE_1000 = 1<<6;
   39|       |                                                // 11110101 1000____
   40|       |                                                // 1111011_ 1000____
   41|       |                                                // 11111___ 1000____
   42|   323k|    constexpr const uint8_t OVERLONG_4  = 1<<6; // 11110000 1000____
   43|       |
   44|   323k|    const simd8<uint8_t> byte_1_high = prev1.shr<4>().lookup_16<uint8_t>(
   45|       |      // 0_______ ________ <ASCII in byte 1>
   46|   323k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   47|   323k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   48|       |      // 10______ ________ <continuation in byte 1>
   49|   323k|      TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS,
   50|       |      // 1100____ ________ <two byte lead in byte 1>
   51|   323k|      TOO_SHORT | OVERLONG_2,
   52|       |      // 1101____ ________ <two byte lead in byte 1>
   53|   323k|      TOO_SHORT,
   54|       |      // 1110____ ________ <three byte lead in byte 1>
   55|   323k|      TOO_SHORT | OVERLONG_3 | SURROGATE,
   56|       |      // 1111____ ________ <four+ byte lead in byte 1>
   57|   323k|      TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4
   58|   323k|    );
   59|   323k|    constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 .
   60|   323k|    const simd8<uint8_t> byte_1_low = (prev1 & 0x0F).lookup_16<uint8_t>(
   61|       |      // ____0000 ________
   62|   323k|      CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4,
   63|       |      // ____0001 ________
   64|   323k|      CARRY | OVERLONG_2,
   65|       |      // ____001_ ________
   66|   323k|      CARRY,
   67|   323k|      CARRY,
   68|       |
   69|       |      // ____0100 ________
   70|   323k|      CARRY | TOO_LARGE,
   71|       |      // ____0101 ________
   72|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   73|       |      // ____011_ ________
   74|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   75|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   76|       |
   77|       |      // ____1___ ________
   78|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   79|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   80|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   81|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   82|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   83|       |      // ____1101 ________
   84|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE,
   85|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   86|   323k|      CARRY | TOO_LARGE | TOO_LARGE_1000
   87|   323k|    );
   88|   323k|    const simd8<uint8_t> byte_2_high = input.shr<4>().lookup_16<uint8_t>(
   89|       |      // ________ 0_______ <ASCII in byte 2>
   90|   323k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   91|   323k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   92|       |
   93|       |      // ________ 1000____
   94|   323k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4,
   95|       |      // ________ 1001____
   96|   323k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE,
   97|       |      // ________ 101_____
   98|   323k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   99|   323k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
  100|       |
  101|       |      // ________ 11______
  102|   323k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT
  103|   323k|    );
  104|   323k|    return (byte_1_high & byte_1_low & byte_2_high);
  105|   323k|  }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation23check_multibyte_lengthsENS1_4simd5simd8IhEES5_S5_:
  107|   323k|      const simd8<uint8_t> prev_input, const simd8<uint8_t> sc) {
  108|   323k|    simd8<uint8_t> prev2 = input.prev<2>(prev_input);
  109|   323k|    simd8<uint8_t> prev3 = input.prev<3>(prev_input);
  110|   323k|    simd8<uint8_t> must23 = must_be_2_3_continuation(prev2, prev3);
  111|   323k|    simd8<uint8_t> must23_80 = must23 & uint8_t(0x80);
  112|   323k|    return must23_80 ^ sc;
  113|   323k|  }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation13is_incompleteENS1_4simd5simd8IhEE:
  119|  80.9k|  simdjson_inline simd8<uint8_t> is_incomplete(const simd8<uint8_t> input) {
  120|       |    // If the previous input's last 3 bytes match this, they're too short (they ended at EOF):
  121|       |    // ... 1111____ 111_____ 11______
  122|  80.9k|#if SIMDJSON_IMPLEMENTATION_ICELAKE
  123|  80.9k|    static const uint8_t max_array[64] = {
  124|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  125|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  126|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  127|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  128|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  129|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  130|  80.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  131|  80.9k|      255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1
  132|  80.9k|    };
  133|       |#else
  134|       |    static const uint8_t max_array[32] = {
  135|       |      255, 255, 255, 255, 255, 255, 255, 255,
  136|       |      255, 255, 255, 255, 255, 255, 255, 255,
  137|       |      255, 255, 255, 255, 255, 255, 255, 255,
  138|       |      255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1
  139|       |    };
  140|       |#endif
  141|  80.9k|    const simd8<uint8_t> max_value(&max_array[sizeof(max_array)-sizeof(simd8<uint8_t>)]);
  142|  80.9k|    return input.gt_bits(max_value);
  143|  80.9k|  }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation12utf8_checker9check_eofEv:
  167|    481|    simdjson_inline void check_eof() {
  168|       |      // If the previous block had incomplete UTF-8 characters at the end, an ASCII block can't
  169|       |      // possibly finish them.
  170|    481|      this->error |= this->prev_incomplete;
  171|    481|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation12utf8_checker6errorsEv:
  198|    481|    simdjson_inline error_code errors() {
  199|    481|      return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS;
  ------------------
  |  Branch (199:14): [True: 327, False: 154]
  ------------------
  200|    481|    }

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage121generic_validate_utf8EPKcm:
   36|    481|bool generic_validate_utf8(const char * input, size_t length) {
   37|    481|    return generic_validate_utf8<utf8_checker>(reinterpret_cast<const uint8_t *>(input),length);
   38|    481|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage121generic_validate_utf8INS1_15utf8_validation12utf8_checkerEEEbPKhm:
   19|    481|bool generic_validate_utf8(const uint8_t * input, size_t length) {
   20|    481|    checker c{};
   21|    481|    buf_block_reader<64> reader(input, length);
   22|   367k|    while (reader.has_full_block()) {
  ------------------
  |  Branch (22:12): [True: 366k, False: 481]
  ------------------
   23|   366k|      simd::simd8x64<uint8_t> in(reader.full_block());
   24|   366k|      c.check_next_input(in);
   25|   366k|      reader.advance();
   26|   366k|    }
   27|    481|    uint8_t block[64]{};
   28|    481|    reader.get_remainder(block);
   29|    481|    simd::simd8x64<uint8_t> in(block);
   30|    481|    c.check_next_input(in);
   31|    481|    reader.advance();
   32|    481|    c.check_eof();
   33|    481|    return c.errors() == error_code::SUCCESS;
   34|    481|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_16stage121generic_validate_utf8EPKcm:
   36|    481|bool generic_validate_utf8(const char * input, size_t length) {
   37|    481|    return generic_validate_utf8<utf8_checker>(reinterpret_cast<const uint8_t *>(input),length);
   38|    481|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_16stage121generic_validate_utf8INS1_15utf8_validation12utf8_checkerEEEbPKhm:
   19|    481|bool generic_validate_utf8(const uint8_t * input, size_t length) {
   20|    481|    checker c{};
   21|    481|    buf_block_reader<64> reader(input, length);
   22|   367k|    while (reader.has_full_block()) {
  ------------------
  |  Branch (22:12): [True: 366k, False: 481]
  ------------------
   23|   366k|      simd::simd8x64<uint8_t> in(reader.full_block());
   24|   366k|      c.check_next_input(in);
   25|   366k|      reader.advance();
   26|   366k|    }
   27|    481|    uint8_t block[64]{};
   28|    481|    reader.get_remainder(block);
   29|    481|    simd::simd8x64<uint8_t> in(block);
   30|    481|    c.check_next_input(in);
   31|    481|    reader.advance();
   32|    481|    c.check_eof();
   33|    481|    return c.errors() == error_code::SUCCESS;
   34|    481|}

_ZNK8simdjson7haswell14implementation13validate_utf8EPKcm:
  138|    481|simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
  139|    481|  return haswell::stage1::generic_validate_utf8(buf,len);
  140|    481|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
   96|   367k|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
   97|   367k|  return input.reduce_or().is_ascii();
   98|   367k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
  108|   161k|simdjson_inline simd8<uint8_t> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
  109|   161k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-0x80); // Only 111_____ will be >= 0x80
  110|   161k|  simd8<uint8_t> is_fourth_byte = prev3.saturating_sub(0xf0u-0x80); // Only 1111____ will be >= 0x80
  111|   161k|  return is_third_byte | is_fourth_byte;
  112|   161k|}

_ZNK8simdjson14implementation27supported_by_runtime_systemEv:
   14|      4|bool implementation::supported_by_runtime_system() const {
   15|      4|  uint32_t required_instruction_sets = this->required_instruction_sets();
   16|      4|  uint32_t supported_instruction_sets = internal::detect_supported_architectures();
   17|      4|  return ((supported_instruction_sets & required_instruction_sets) == required_instruction_sets);
   18|      4|}
_ZNK8simdjson8internal29available_implementation_list5beginEv:
  262|      1|const implementation * const *available_implementation_list::begin() const noexcept {
  263|      1|  return internal::get_available_implementation_pointers().begin();
  264|      1|}
_ZNK8simdjson8internal29available_implementation_list3endEv:
  265|      1|const implementation * const *available_implementation_list::end() const noexcept {
  266|      1|  return internal::get_available_implementation_pointers().end();
  267|      1|}
_ZN8simdjson29get_available_implementationsEv:
  298|      1|SIMDJSON_DLLIMPORTEXPORT const internal::available_implementation_list& get_available_implementations() {
  299|      1|  static const internal::available_implementation_list available_implementations{};
  300|      1|  return available_implementations;
  301|      1|}
simdjson.cpp:_ZN8simdjson8internalL37get_available_implementation_pointersEv:
  196|      2|static const std::initializer_list<const implementation *>& get_available_implementation_pointers() {
  197|      2|  static const std::initializer_list<const implementation *> available_implementation_pointers {
  198|      2|#if SIMDJSON_IMPLEMENTATION_ICELAKE
  199|      2|    get_icelake_singleton(),
  200|      2|#endif
  201|      2|#if SIMDJSON_IMPLEMENTATION_HASWELL
  202|      2|    get_haswell_singleton(),
  203|      2|#endif
  204|      2|#if SIMDJSON_IMPLEMENTATION_WESTMERE
  205|      2|    get_westmere_singleton(),
  206|      2|#endif
  207|       |#if SIMDJSON_IMPLEMENTATION_ARM64
  208|       |    get_arm64_singleton(),
  209|       |#endif
  210|       |#if SIMDJSON_IMPLEMENTATION_PPC64
  211|       |    get_ppc64_singleton(),
  212|       |#endif
  213|       |#if SIMDJSON_IMPLEMENTATION_LSX
  214|       |    get_lsx_singleton(),
  215|       |#endif
  216|       |#if SIMDJSON_IMPLEMENTATION_LASX
  217|       |    get_lasx_singleton(),
  218|       |#endif
  219|      2|#if SIMDJSON_IMPLEMENTATION_FALLBACK
  220|      2|    get_fallback_singleton(),
  221|      2|#endif
  222|      2|  }; // available_implementation_pointers
  223|      2|  return available_implementation_pointers;
  224|      2|}
simdjson.cpp:_ZN8simdjson8internalL21get_icelake_singletonEv:
   65|      1|static const icelake::implementation* get_icelake_singleton() {
   66|      1|  static const icelake::implementation icelake_singleton{};
   67|      1|  return &icelake_singleton;
   68|      1|}
simdjson.cpp:_ZN8simdjson8internalL21get_haswell_singletonEv:
   53|      1|static const haswell::implementation* get_haswell_singleton() {
   54|      1|  static const haswell::implementation haswell_singleton{};
   55|      1|  return &haswell_singleton;
   56|      1|}
simdjson.cpp:_ZN8simdjson8internalL22get_westmere_singletonEv:
   89|      1|static const simdjson::westmere::implementation* get_westmere_singleton() {
   90|      1|  static const simdjson::westmere::implementation westmere_singleton{};
   91|      1|  return &westmere_singleton;
   92|      1|}
simdjson.cpp:_ZN8simdjson8internalL22get_fallback_singletonEv:
   40|      1|static const fallback::implementation* get_fallback_singleton() {
   41|      1|  static const fallback::implementation fallback_singleton{};
   42|      1|  return &fallback_singleton;
   43|      1|}

simdjson.cpp:_ZN8simdjson8internalL30detect_supported_architecturesEv:
  133|      4|static inline uint32_t detect_supported_architectures() {
  134|      4|  uint32_t eax, ebx, ecx, edx;
  135|      4|  uint32_t host_isa = 0x0;
  136|       |
  137|       |  // EBX for EAX=0x1
  138|      4|  eax = 0x1;
  139|      4|  ecx = 0x0;
  140|      4|  cpuid(&eax, &ebx, &ecx, &edx);
  141|       |
  142|      4|  if (ecx & cpuid_sse42_bit) {
  ------------------
  |  Branch (142:7): [True: 4, False: 0]
  ------------------
  143|      4|    host_isa |= instruction_set::SSE42;
  144|      4|  } else {
  145|      0|    return host_isa; // everything after is redundant
  146|      0|  }
  147|       |
  148|      4|  if (ecx & cpuid_pclmulqdq_bit) {
  ------------------
  |  Branch (148:7): [True: 4, False: 0]
  ------------------
  149|      4|    host_isa |= instruction_set::PCLMULQDQ;
  150|      4|  }
  151|       |
  152|       |
  153|      4|  if ((ecx & cpuid_osxsave) != cpuid_osxsave) {
  ------------------
  |  Branch (153:7): [True: 0, False: 4]
  ------------------
  154|      0|    return host_isa;
  155|      0|  }
  156|       |
  157|       |  // xgetbv for checking if the OS saves registers
  158|      4|  uint64_t xcr0 = xgetbv();
  159|       |
  160|      4|  if ((xcr0 & cpuid_avx256_saved) == 0) {
  ------------------
  |  Branch (160:7): [True: 0, False: 4]
  ------------------
  161|      0|    return host_isa;
  162|      0|  }
  163|       |
  164|       |  // ECX for EAX=0x7
  165|      4|  eax = 0x7;
  166|      4|  ecx = 0x0;
  167|      4|  cpuid(&eax, &ebx, &ecx, &edx);
  168|      4|  if (ebx & cpuid_avx2_bit) {
  ------------------
  |  Branch (168:7): [True: 4, False: 0]
  ------------------
  169|      4|    host_isa |= instruction_set::AVX2;
  170|      4|  }
  171|      4|  if (ebx & cpuid_bmi1_bit) {
  ------------------
  |  Branch (171:7): [True: 4, False: 0]
  ------------------
  172|      4|    host_isa |= instruction_set::BMI1;
  173|      4|  }
  174|       |
  175|      4|  if (ebx & cpuid_bmi2_bit) {
  ------------------
  |  Branch (175:7): [True: 4, False: 0]
  ------------------
  176|      4|    host_isa |= instruction_set::BMI2;
  177|      4|  }
  178|       |
  179|      4|  if (!((xcr0 & cpuid_avx512_saved) == cpuid_avx512_saved)) {
  ------------------
  |  Branch (179:7): [True: 4, False: 0]
  ------------------
  180|      4|     return host_isa;
  181|      4|  }
  182|       |
  183|      0|  if (ebx & cpuid_avx512f_bit) {
  ------------------
  |  Branch (183:7): [True: 0, False: 0]
  ------------------
  184|      0|    host_isa |= instruction_set::AVX512F;
  185|      0|  }
  186|       |
  187|      0|  if (ebx & cpuid_avx512dq_bit) {
  ------------------
  |  Branch (187:7): [True: 0, False: 0]
  ------------------
  188|      0|    host_isa |= instruction_set::AVX512DQ;
  189|      0|  }
  190|       |
  191|      0|  if (ebx & cpuid_avx512ifma_bit) {
  ------------------
  |  Branch (191:7): [True: 0, False: 0]
  ------------------
  192|      0|    host_isa |= instruction_set::AVX512IFMA;
  193|      0|  }
  194|       |
  195|      0|  if (ebx & cpuid_avx512pf_bit) {
  ------------------
  |  Branch (195:7): [True: 0, False: 0]
  ------------------
  196|      0|    host_isa |= instruction_set::AVX512PF;
  197|      0|  }
  198|       |
  199|      0|  if (ebx & cpuid_avx512er_bit) {
  ------------------
  |  Branch (199:7): [True: 0, False: 0]
  ------------------
  200|      0|    host_isa |= instruction_set::AVX512ER;
  201|      0|  }
  202|       |
  203|      0|  if (ebx & cpuid_avx512cd_bit) {
  ------------------
  |  Branch (203:7): [True: 0, False: 0]
  ------------------
  204|      0|    host_isa |= instruction_set::AVX512CD;
  205|      0|  }
  206|       |
  207|      0|  if (ebx & cpuid_avx512bw_bit) {
  ------------------
  |  Branch (207:7): [True: 0, False: 0]
  ------------------
  208|      0|    host_isa |= instruction_set::AVX512BW;
  209|      0|  }
  210|       |
  211|      0|  if (ebx & cpuid_avx512vl_bit) {
  ------------------
  |  Branch (211:7): [True: 0, False: 0]
  ------------------
  212|      0|    host_isa |= instruction_set::AVX512VL;
  213|      0|  }
  214|       |
  215|      0|  if (ecx & cpuid_avx512vbmi2_bit) {
  ------------------
  |  Branch (215:7): [True: 0, False: 0]
  ------------------
  216|      0|    host_isa |= instruction_set::AVX512VBMI2;
  217|      0|  }
  218|       |
  219|      0|  return host_isa;
  220|      4|}
simdjson.cpp:_ZN8simdjson8internalL5cpuidEPjS1_S1_S1_:
  101|      8|                         uint32_t *edx) {
  102|       |#if defined(_MSC_VER)
  103|       |  int cpu_info[4];
  104|       |  __cpuidex(cpu_info, *eax, *ecx);
  105|       |  *eax = cpu_info[0];
  106|       |  *ebx = cpu_info[1];
  107|       |  *ecx = cpu_info[2];
  108|       |  *edx = cpu_info[3];
  109|       |#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID)
  110|       |  uint32_t level = *eax;
  111|       |  __get_cpuid(level, eax, ebx, ecx, edx);
  112|       |#else
  113|      8|  uint32_t a = *eax, b, c = *ecx, d;
  114|      8|  asm volatile("cpuid\n\t" : "+a"(a), "=b"(b), "+c"(c), "=d"(d));
  115|      8|  *eax = a;
  116|      8|  *ebx = b;
  117|      8|  *ecx = c;
  118|      8|  *edx = d;
  119|      8|#endif
  120|      8|}
simdjson.cpp:_ZN8simdjson8internalL6xgetbvEv:
  123|      4|static inline uint64_t xgetbv() {
  124|       |#if defined(_MSC_VER)
  125|       |  return _xgetbv(0);
  126|       |#else
  127|      4|  uint32_t xcr0_lo, xcr0_hi;
  128|      4|  asm volatile("xgetbv\n\t" : "=a" (xcr0_lo), "=d" (xcr0_hi) : "c" (0));
  129|      4|  return xcr0_lo | (uint64_t(xcr0_hi) << 32);
  130|      4|#endif
  131|      4|}

_ZNK8simdjson8westmere14implementation13validate_utf8EPKcm:
  143|    481|simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
  144|    481|  return westmere::stage1::generic_validate_utf8(buf,len);
  145|    481|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
  100|   367k|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
  101|   367k|  return input.reduce_or().is_ascii();
  102|   367k|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
  112|   323k|simdjson_inline simd8<uint8_t> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
  113|   323k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-0x80); // Only 111_____ will be >= 0x80
  114|   323k|  simd8<uint8_t> is_fourth_byte = prev3.saturating_sub(0xf0u-0x80); // Only 1111____ will be >= 0x80
  115|   323k|  return is_third_byte | is_fourth_byte;
  116|   323k|}

