LLVMFuzzerTestOneInput:
   35|    482|extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
   36|       |
   37|       |    // since this check is expensive, only do it once
   38|    482|    static const auto supported_implementations=get_runtime_supported_implementations();
   39|       |
   40|       |
   41|    482|    auto utf8verify=[Data,Size](const simdjson::implementation* impl) -> bool {
   42|    482|        return impl->validate_utf8((const char*)Data,Size);
   43|    482|    };
   44|       |
   45|       |
   46|    482|    auto first = supported_implementations.begin();
   47|    482|    auto last = supported_implementations.end();
   48|       |
   49|       |
   50|    482|    const bool reference=utf8verify(*first);
   51|       |
   52|    482|    bool failed=false;
   53|  1.44k|    for(auto it=first+1; it != last; ++it) {
  ------------------
  |  Branch (53:26): [True: 964, False: 482]
  ------------------
   54|    964|        const bool current=utf8verify(*it);
   55|    964|        if(current!=reference) {
  ------------------
  |  Branch (55:12): [True: 0, False: 964]
  ------------------
   56|      0|            failed=true;
   57|      0|        }
   58|    964|    }
   59|       |
   60|    482|    if(failed) {
  ------------------
  |  Branch (60:8): [True: 0, False: 482]
  ------------------
   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|    482|    return 0;
   80|    482|}
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:
   23|      1|  ) {}

_ZN8simdjson7haswell14implementationC2Ev:
   21|      1|  ) {}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ev:
  226|  1.44k|    simdjson_inline simd8() : base8_numeric<uint8_t>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2Ev:
   93|  1.44k|    simdjson_inline base8_numeric() : base8<T>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2Ev:
   45|  1.44k|    simdjson_inline base8() : base<simd8<T>>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2Ev:
   17|  1.44k|    simdjson_inline base() : value{__m256i()} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  304|   323k|    simdjson_inline simd8x64(const T ptr[64]) : chunks{simd8<T>::load(ptr), simd8<T>::load(ptr+32)} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE4loadEPKh:
   77|   728k|    static simdjson_inline simd8<T> load(const T values[32]) {
   78|   728k|      return _mm256_loadu_si256(reinterpret_cast<const __m256i *>(values));
   79|   728k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EDv4_x:
  227|  6.07M|    simdjson_inline simd8(const __m256i _value) : base8_numeric<uint8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2EDv4_x:
   94|  6.07M|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2EDv4_x:
   46|  6.07M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2EDv4_x:
   20|  6.07M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  325|   323k|    simdjson_inline simd8<T> reduce_or() const {
  326|   323k|      return this->chunks[0] | this->chunks[1];
  327|   323k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   27|   890k|    simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv4_xEv:
   23|  7.45M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  278|   323k|    simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   31|   405k|    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_:
   53|   162k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   162k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   162k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  284|   324k|    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_:
  172|   486k|        L replace12, L replace13, L replace14, L replace15) const {
  173|   486k|      return lookup_16(simd8<L>::repeat_16(
  174|   486k|        replace0,  replace1,  replace2,  replace3,
  175|   486k|        replace4,  replace5,  replace6,  replace7,
  176|   486k|        replace8,  replace9,  replace10, replace11,
  177|   486k|        replace12, replace13, replace14, replace15
  178|   486k|      ));
  179|   486k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  110|   486k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  111|   486k|      return _mm256_shuffle_epi8(lookup_table, *this);
  112|   486k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv4_xEv:
   24|   648k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  248|   486k|    ) {
  249|   486k|      return simd8<uint8_t>(
  250|   486k|        v0, v1, v2, v3, v4, v5, v6, v7,
  251|   486k|        v8, v9, v10,v11,v12,v13,v14,v15,
  252|   486k|        v0, v1, v2, v3, v4, v5, v6, v7,
  253|   486k|        v8, v9, v10,v11,v12,v13,v14,v15
  254|   486k|      );
  255|   486k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh:
  243|   486k|    )) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   28|   972k|    simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Eh:
  229|   972k|    simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5splatEh:
   75|   972k|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi2EEENS4_IhEES8_:
   53|   162k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   162k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   162k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   53|   162k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   162k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   162k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  259|   405k|    simdjson_inline simd8<uint8_t> saturating_sub(const simd8<uint8_t> other) const { return _mm256_subs_epu8(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEC2EDv4_x:
  186|   324k|    simdjson_inline simd8(const __m256i _value) : base8_numeric<int8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIaEC2EDv4_x:
   94|   324k|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IaNS2_5simd8IbEEEC2EDv4_x:
   46|   324k|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IaEEEC2EDv4_x:
   20|   324k|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEgtES4_:
  219|   162k|    simdjson_inline simd8<bool> operator>(const simd8<int8_t> other) const { return _mm256_cmpgt_epi8(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IaEEEcvRKDv4_xEv:
   23|   324k|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IbEC2EDv4_x:
   64|   162k|    simdjson_inline simd8<bool>(const __m256i _value) : base8<bool>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IbNS2_5simd8IbEEEC2EDv4_x:
   46|   162k|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEC2EDv4_x:
   20|   162k|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEC2Ea:
  188|   162k|    simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIaE5splatEa:
   75|   162k|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRDv4_xEv:
   24|   162k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   29|   162k|    simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  231|  81.0k|    simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  265|  81.0k|    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:
  280|    482|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  279|    482|    simdjson_inline bool bits_not_set_anywhere() const { return _mm256_testz_si256(*this, *this); }

_ZN8simdjson7icelake14implementationC2Ev:
   21|      1|  ) {}

_ZNK8simdjson14implementation25required_instruction_setsEv:
   90|      4|  virtual uint32_t required_instruction_sets() const { return _required_instruction_sets; }
_ZN8simdjson14implementationC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_j:
  146|      4|  {
  147|      4|  }
_ZN8simdjson8internal29available_implementation_listC2Ev:
  176|      1|  simdjson_inline available_implementation_list() {}
_ZN8simdjson14implementationD2Ev:
  148|      4|  virtual ~implementation()=default;

simdjson.cpp:_ZN8simdjson8internalL30detect_supported_architecturesEv:
  138|      4|static inline uint32_t detect_supported_architectures() {
  139|      4|  uint32_t eax, ebx, ecx, edx;
  140|      4|  uint32_t host_isa = 0x0;
  141|       |
  142|       |  // ECX for EAX=0x7
  143|      4|  eax = 0x7;
  144|      4|  ecx = 0x0;
  145|      4|  cpuid(&eax, &ebx, &ecx, &edx);
  146|      4|  if (ebx & cpuid_avx2_bit) {
  ------------------
  |  Branch (146:7): [True: 4, False: 0]
  ------------------
  147|      4|    host_isa |= instruction_set::AVX2;
  148|      4|  }
  149|      4|  if (ebx & cpuid_bmi1_bit) {
  ------------------
  |  Branch (149:7): [True: 4, False: 0]
  ------------------
  150|      4|    host_isa |= instruction_set::BMI1;
  151|      4|  }
  152|       |
  153|      4|  if (ebx & cpuid_bmi2_bit) {
  ------------------
  |  Branch (153:7): [True: 4, False: 0]
  ------------------
  154|      4|    host_isa |= instruction_set::BMI2;
  155|      4|  }
  156|       |
  157|      4|  if (ebx & cpuid_avx512f_bit) {
  ------------------
  |  Branch (157:7): [True: 0, False: 4]
  ------------------
  158|      0|    host_isa |= instruction_set::AVX512F;
  159|      0|  }
  160|       |
  161|      4|  if (ebx & cpuid_avx512dq_bit) {
  ------------------
  |  Branch (161:7): [True: 0, False: 4]
  ------------------
  162|      0|    host_isa |= instruction_set::AVX512DQ;
  163|      0|  }
  164|       |
  165|      4|  if (ebx & cpuid_avx512ifma_bit) {
  ------------------
  |  Branch (165:7): [True: 0, False: 4]
  ------------------
  166|      0|    host_isa |= instruction_set::AVX512IFMA;
  167|      0|  }
  168|       |
  169|      4|  if (ebx & cpuid_avx512pf_bit) {
  ------------------
  |  Branch (169:7): [True: 0, False: 4]
  ------------------
  170|      0|    host_isa |= instruction_set::AVX512PF;
  171|      0|  }
  172|       |
  173|      4|  if (ebx & cpuid_avx512er_bit) {
  ------------------
  |  Branch (173:7): [True: 0, False: 4]
  ------------------
  174|      0|    host_isa |= instruction_set::AVX512ER;
  175|      0|  }
  176|       |
  177|      4|  if (ebx & cpuid_avx512cd_bit) {
  ------------------
  |  Branch (177:7): [True: 0, False: 4]
  ------------------
  178|      0|    host_isa |= instruction_set::AVX512CD;
  179|      0|  }
  180|       |
  181|      4|  if (ebx & cpuid_avx512bw_bit) {
  ------------------
  |  Branch (181:7): [True: 0, False: 4]
  ------------------
  182|      0|    host_isa |= instruction_set::AVX512BW;
  183|      0|  }
  184|       |
  185|      4|  if (ebx & cpuid_avx512vl_bit) {
  ------------------
  |  Branch (185:7): [True: 0, False: 4]
  ------------------
  186|      0|    host_isa |= instruction_set::AVX512VL;
  187|      0|  }
  188|       |
  189|      4|  if (ecx & cpuid_avx512vbmi2_bit) {
  ------------------
  |  Branch (189:7): [True: 0, False: 4]
  ------------------
  190|      0|    host_isa |= instruction_set::AVX512VBMI2;
  191|      0|  }
  192|       |
  193|       |  // EBX for EAX=0x1
  194|      4|  eax = 0x1;
  195|      4|  cpuid(&eax, &ebx, &ecx, &edx);
  196|       |
  197|      4|  if (ecx & cpuid_sse42_bit) {
  ------------------
  |  Branch (197:7): [True: 4, False: 0]
  ------------------
  198|      4|    host_isa |= instruction_set::SSE42;
  199|      4|  }
  200|       |
  201|      4|  if (ecx & cpuid_pclmulqdq_bit) {
  ------------------
  |  Branch (201:7): [True: 4, False: 0]
  ------------------
  202|      4|    host_isa |= instruction_set::PCLMULQDQ;
  203|      4|  }
  204|       |
  205|      4|  return host_isa;
  206|      4|}
simdjson.cpp:_ZN8simdjson8internalL5cpuidEPjS1_S1_S1_:
  117|      8|                         uint32_t *edx) {
  118|       |#if defined(_MSC_VER)
  119|       |  int cpu_info[4];
  120|       |  __cpuid(cpu_info, *eax);
  121|       |  *eax = cpu_info[0];
  122|       |  *ebx = cpu_info[1];
  123|       |  *ecx = cpu_info[2];
  124|       |  *edx = cpu_info[3];
  125|       |#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID)
  126|       |  uint32_t level = *eax;
  127|       |  __get_cpuid(level, eax, ebx, ecx, edx);
  128|       |#else
  129|      8|  uint32_t a = *eax, b, c = *ecx, d;
  130|      8|  asm volatile("cpuid\n\t" : "+a"(a), "=b"(b), "+c"(c), "=d"(d));
  131|      8|  *eax = a;
  132|      8|  *ebx = b;
  133|      8|  *ecx = c;
  134|      8|  *edx = d;
  135|      8|#endif
  136|      8|}

_ZN8simdjson8westmere14implementationC2Ev:
   20|      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:
   16|  1.44k|    simdjson_inline base() : value{__m128i()} {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  274|   323k|    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.37M|    static simdjson_inline simd8<T> load(const T values[16]) {
   77|  1.37M|      return _mm_loadu_si128(reinterpret_cast<const __m128i *>(values));
   78|  1.37M|    }
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:
   19|  12.0M|    simdjson_inline base(const __m128i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  283|   323k|    simdjson_inline simd8<T> reduce_or() const {
  284|   323k|      return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]);
  285|   323k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   26|  1.86M|    simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv2_xEv:
   22|  13.6M|    simdjson_inline operator const __m128i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  248|   323k|    simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   30|   567k|    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|   324k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   53|   324k|      return _mm_alignr_epi8(*this, prev_chunk, 16 - N);
   54|   324k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  254|   648k|    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|   972k|        L replace12, L replace13, L replace14, L replace15) const {
  155|   972k|      return lookup_16(simd8<L>::repeat_16(
  156|   972k|        replace0,  replace1,  replace2,  replace3,
  157|   972k|        replace4,  replace5,  replace6,  replace7,
  158|   972k|        replace8,  replace9,  replace10, replace11,
  159|   972k|        replace12, replace13, replace14, replace15
  160|   972k|      ));
  161|   972k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  107|   972k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  108|   972k|      return _mm_shuffle_epi8(lookup_table, *this);
  109|   972k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv2_xEv:
   23|  1.29M|    simdjson_inline operator __m128i&() { return this->value; }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  220|   972k|    ) {
  221|   972k|      return simd8<uint8_t>(
  222|   972k|        v0, v1, v2, v3, v4, v5, v6, v7,
  223|   972k|        v8, v9, v10,v11,v12,v13,v14,v15
  224|   972k|      );
  225|   972k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhh:
  215|   972k|    )) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   27|  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|   324k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   53|   324k|      return _mm_alignr_epi8(*this, prev_chunk, 16 - N);
   54|   324k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   52|   324k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   53|   324k|      return _mm_alignr_epi8(*this, prev_chunk, 16 - N);
   54|   324k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  229|   729k|    simdjson_inline simd8<uint8_t> saturating_sub(const simd8<uint8_t> other) const { return _mm_subs_epu8(*this, other); }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IaEC2EDv2_x:
  168|   648k|    simdjson_inline simd8(const __m128i _value) : base8_numeric<int8_t>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIaEC2EDv2_x:
   91|   648k|    simdjson_inline base8_numeric(const __m128i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5base8IaNS2_5simd8IbEEEC2EDv2_x:
   45|   648k|    simdjson_inline base8(const __m128i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IaEEEC2EDv2_x:
   19|   648k|    simdjson_inline base(const __m128i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IaEgtES4_:
  195|   324k|    simdjson_inline simd8<bool> operator>(const simd8<int8_t> other) const { return _mm_cmpgt_epi8(*this, other); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IaEEEcvRKDv2_xEv:
   22|   648k|    simdjson_inline operator const __m128i&() const { return this->value; }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IbEC2EDv2_x:
   63|   324k|    simdjson_inline simd8<bool>(const __m128i _value) : base8<bool>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5base8IbNS2_5simd8IbEEEC2EDv2_x:
   45|   324k|    simdjson_inline base8(const __m128i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEC2EDv2_x:
   19|   324k|    simdjson_inline base(const __m128i _value) : value(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IaEC2Ea:
  170|   324k|    simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIaE5splatEa:
   74|   324k|    static simdjson_inline simd8<T> splat(T _value) { return _mm_set1_epi8(_value); }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRDv2_xEv:
   23|   324k|    simdjson_inline operator __m128i&() { return this->value; }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   28|   324k|    simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  207|  81.0k|    simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  235|  81.0k|    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|    482|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  249|    482|    simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); }

_ZNK8simdjson8fallback14implementation13validate_utf8EPKcm:
  281|    482|simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
  282|    482|  const uint8_t *data = reinterpret_cast<const uint8_t *>(buf);
  283|    482|  uint64_t pos = 0;
  284|    482|  uint32_t code_point = 0;
  285|  1.54M|  while (pos < len) {
  ------------------
  |  Branch (285:10): [True: 1.54M, False: 157]
  ------------------
  286|       |    // check of the next 8 bytes are ascii.
  287|  1.54M|    uint64_t next_pos = pos + 16;
  288|  1.54M|    if (next_pos <= len) { // if it is safe to read 8 more bytes, check that they are ascii
  ------------------
  |  Branch (288:9): [True: 1.54M, False: 1.50k]
  ------------------
  289|  1.54M|      uint64_t v1;
  290|  1.54M|      memcpy(&v1, data + pos, sizeof(uint64_t));
  291|  1.54M|      uint64_t v2;
  292|  1.54M|      memcpy(&v2, data + pos + sizeof(uint64_t), sizeof(uint64_t));
  293|  1.54M|      uint64_t v{v1 | v2};
  294|  1.54M|      if ((v & 0x8080808080808080) == 0) {
  ------------------
  |  Branch (294:11): [True: 674k, False: 872k]
  ------------------
  295|   674k|        pos = next_pos;
  296|   674k|        continue;
  297|   674k|      }
  298|  1.54M|    }
  299|   873k|    unsigned char byte = data[pos];
  300|   873k|    if (byte < 0x80) {
  ------------------
  |  Branch (300:9): [True: 730k, False: 143k]
  ------------------
  301|   730k|      pos++;
  302|   730k|      continue;
  303|   730k|    } else if ((byte & 0xe0) == 0xc0) {
  ------------------
  |  Branch (303:16): [True: 61.5k, False: 81.7k]
  ------------------
  304|  61.5k|      next_pos = pos + 2;
  305|  61.5k|      if (next_pos > len) { return false; }
  ------------------
  |  Branch (305:11): [True: 28, False: 61.4k]
  ------------------
  306|  61.4k|      if ((data[pos + 1] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (306:11): [True: 21, False: 61.4k]
  ------------------
  307|       |      // range check
  308|  61.4k|      code_point = (byte & 0x1f) << 6 | (data[pos + 1] & 0x3f);
  309|  61.4k|      if (code_point < 0x80 || 0x7ff < code_point) { return false; }
  ------------------
  |  Branch (309:11): [True: 3, False: 61.4k]
  |  Branch (309:32): [True: 0, False: 61.4k]
  ------------------
  310|  81.7k|    } else if ((byte & 0xf0) == 0xe0) {
  ------------------
  |  Branch (310:16): [True: 44.9k, False: 36.8k]
  ------------------
  311|  44.9k|      next_pos = pos + 3;
  312|  44.9k|      if (next_pos > len) { return false; }
  ------------------
  |  Branch (312:11): [True: 29, False: 44.9k]
  ------------------
  313|  44.9k|      if ((data[pos + 1] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (313:11): [True: 24, False: 44.9k]
  ------------------
  314|  44.9k|      if ((data[pos + 2] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (314:11): [True: 15, False: 44.8k]
  ------------------
  315|       |      // range check
  316|  44.8k|      code_point = (byte & 0x0f) << 12 |
  317|  44.8k|                   (data[pos + 1] & 0x3f) << 6 |
  318|  44.8k|                   (data[pos + 2] & 0x3f);
  319|  44.8k|      if (code_point < 0x800 || 0xffff < code_point ||
  ------------------
  |  Branch (319:11): [True: 13, False: 44.8k]
  |  Branch (319:33): [True: 0, False: 44.8k]
  ------------------
  320|  44.8k|          (0xd7ff < code_point && code_point < 0xe000)) {
  ------------------
  |  Branch (320:12): [True: 15.6k, False: 29.2k]
  |  Branch (320:35): [True: 15, False: 15.6k]
  ------------------
  321|     28|        return false;
  322|     28|      }
  323|  44.8k|    } else if ((byte & 0xf8) == 0xf0) { // 0b11110000
  ------------------
  |  Branch (323:16): [True: 36.7k, False: 88]
  ------------------
  324|  36.7k|      next_pos = pos + 4;
  325|  36.7k|      if (next_pos > len) { return false; }
  ------------------
  |  Branch (325:11): [True: 29, False: 36.6k]
  ------------------
  326|  36.6k|      if ((data[pos + 1] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (326:11): [True: 9, False: 36.6k]
  ------------------
  327|  36.6k|      if ((data[pos + 2] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (327:11): [True: 9, False: 36.6k]
  ------------------
  328|  36.6k|      if ((data[pos + 3] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (328:11): [True: 13, False: 36.6k]
  ------------------
  329|       |      // range check
  330|  36.6k|      code_point =
  331|  36.6k|          (byte & 0x07) << 18 | (data[pos + 1] & 0x3f) << 12 |
  332|  36.6k|          (data[pos + 2] & 0x3f) << 6 | (data[pos + 3] & 0x3f);
  333|  36.6k|      if (code_point <= 0xffff || 0x10ffff < code_point) { return false; }
  ------------------
  |  Branch (333:11): [True: 21, False: 36.6k]
  |  Branch (333:35): [True: 8, False: 36.6k]
  ------------------
  334|  36.6k|    } else {
  335|       |      // we may have a continuation
  336|     88|      return false;
  337|     88|    }
  338|   142k|    pos = next_pos;
  339|   142k|  }
  340|    157|  return true;
  341|    482|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm64EEC2EPKhm:
   62|    482|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} {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm64EE14has_full_blockEv:
   68|   323k|simdjson_inline bool buf_block_reader<STEP_SIZE>::has_full_block() const {
   69|   323k|  return idx < lenminusstep;
   70|   323k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm64EE10full_blockEv:
   73|   322k|simdjson_inline const uint8_t *buf_block_reader<STEP_SIZE>::full_block() const {
   74|   322k|  return &buf[idx];
   75|   322k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm64EE7advanceEv:
   86|   323k|simdjson_inline void buf_block_reader<STEP_SIZE>::advance() {
   87|   323k|  idx += STEP_SIZE;
   88|   323k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm64EE13get_remainderEPh:
   78|    482|simdjson_inline size_t buf_block_reader<STEP_SIZE>::get_remainder(uint8_t *dst) const {
   79|    482|  if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers
  ------------------
  |  Branch (79:6): [True: 0, False: 482]
  ------------------
   80|    482|  std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once.
   81|    482|  std::memcpy(dst, buf + idx, len - idx);
   82|    482|  return len - idx;
   83|    482|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_116buf_block_readerILm64EEC2EPKhm:
   62|    482|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} {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_116buf_block_readerILm64EE14has_full_blockEv:
   68|   323k|simdjson_inline bool buf_block_reader<STEP_SIZE>::has_full_block() const {
   69|   323k|  return idx < lenminusstep;
   70|   323k|}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_116buf_block_readerILm64EE10full_blockEv:
   73|   322k|simdjson_inline const uint8_t *buf_block_reader<STEP_SIZE>::full_block() const {
   74|   322k|  return &buf[idx];
   75|   322k|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_116buf_block_readerILm64EE7advanceEv:
   86|   323k|simdjson_inline void buf_block_reader<STEP_SIZE>::advance() {
   87|   323k|  idx += STEP_SIZE;
   88|   323k|}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_116buf_block_readerILm64EE13get_remainderEPh:
   78|    482|simdjson_inline size_t buf_block_reader<STEP_SIZE>::get_remainder(uint8_t *dst) const {
   79|    482|  if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers
  ------------------
  |  Branch (79:6): [True: 0, False: 482]
  ------------------
   80|    482|  std::memset(dst, 0x20, STEP_SIZE); // std::memset STEP_SIZE because it's more efficient to write out 8 or 16 bytes at once.
   81|    482|  std::memcpy(dst, buf + idx, len - idx);
   82|    482|  return len - idx;
   83|    482|}

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

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage121generic_validate_utf8EPKcm:
   27|    482|bool generic_validate_utf8(const char * input, size_t length) {
   28|    482|    return generic_validate_utf8<utf8_checker>(reinterpret_cast<const uint8_t *>(input),length);
   29|    482|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_16stage121generic_validate_utf8INS1_15utf8_validation12utf8_checkerEEEbPKhm:
   10|    482|bool generic_validate_utf8(const uint8_t * input, size_t length) {
   11|    482|    checker c{};
   12|    482|    buf_block_reader<64> reader(input, length);
   13|   323k|    while (reader.has_full_block()) {
  ------------------
  |  Branch (13:12): [True: 322k, False: 482]
  ------------------
   14|   322k|      simd::simd8x64<uint8_t> in(reader.full_block());
   15|   322k|      c.check_next_input(in);
   16|   322k|      reader.advance();
   17|   322k|    }
   18|    482|    uint8_t block[64]{};
   19|    482|    reader.get_remainder(block);
   20|    482|    simd::simd8x64<uint8_t> in(block);
   21|    482|    c.check_next_input(in);
   22|    482|    reader.advance();
   23|    482|    c.check_eof();
   24|    482|    return c.errors() == error_code::SUCCESS;
   25|    482|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_16stage121generic_validate_utf8EPKcm:
   27|    482|bool generic_validate_utf8(const char * input, size_t length) {
   28|    482|    return generic_validate_utf8<utf8_checker>(reinterpret_cast<const uint8_t *>(input),length);
   29|    482|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_16stage121generic_validate_utf8INS1_15utf8_validation12utf8_checkerEEEbPKhm:
   10|    482|bool generic_validate_utf8(const uint8_t * input, size_t length) {
   11|    482|    checker c{};
   12|    482|    buf_block_reader<64> reader(input, length);
   13|   323k|    while (reader.has_full_block()) {
  ------------------
  |  Branch (13:12): [True: 322k, False: 482]
  ------------------
   14|   322k|      simd::simd8x64<uint8_t> in(reader.full_block());
   15|   322k|      c.check_next_input(in);
   16|   322k|      reader.advance();
   17|   322k|    }
   18|    482|    uint8_t block[64]{};
   19|    482|    reader.get_remainder(block);
   20|    482|    simd::simd8x64<uint8_t> in(block);
   21|    482|    c.check_next_input(in);
   22|    482|    reader.advance();
   23|    482|    c.check_eof();
   24|    482|    return c.errors() == error_code::SUCCESS;
   25|    482|}

_ZNK8simdjson7haswell14implementation13validate_utf8EPKcm:
  144|    482|simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
  145|    482|  return haswell::stage1::generic_validate_utf8(buf,len);
  146|    482|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
   85|   323k|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
   86|   323k|  return input.reduce_or().is_ascii();
   87|   323k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
   97|   162k|simdjson_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
   98|   162k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0
   99|   162k|  simd8<uint8_t> is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0
  100|       |  // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine.
  101|   162k|  return simd8<int8_t>(is_third_byte | is_fourth_byte) > int8_t(0);
  102|   162k|}

_ZNK8simdjson14implementation27supported_by_runtime_systemEv:
    6|      4|bool implementation::supported_by_runtime_system() const {
    7|      4|  uint32_t required_instruction_sets = this->required_instruction_sets();
    8|      4|  uint32_t supported_instruction_sets = internal::detect_supported_architectures();
    9|      4|  return ((supported_instruction_sets & required_instruction_sets) == required_instruction_sets);
   10|      4|}
_ZNK8simdjson8internal29available_implementation_list5beginEv:
  138|      1|const implementation * const *available_implementation_list::begin() const noexcept {
  139|      1|  return internal::get_available_implementation_pointers().begin();
  140|      1|}
_ZNK8simdjson8internal29available_implementation_list3endEv:
  141|      1|const implementation * const *available_implementation_list::end() const noexcept {
  142|      1|  return internal::get_available_implementation_pointers().end();
  143|      1|}
_ZN8simdjson29get_available_implementationsEv:
  174|      1|SIMDJSON_DLLIMPORTEXPORT const internal::available_implementation_list& get_available_implementations() {
  175|      1|  static const internal::available_implementation_list available_implementations{};
  176|      1|  return available_implementations;
  177|      1|}
simdjson.cpp:_ZN8simdjson8internalL37get_available_implementation_pointersEv:
   80|      2|static const std::initializer_list<const implementation *>& get_available_implementation_pointers() {
   81|      2|  static const std::initializer_list<const implementation *> available_implementation_pointers {
   82|      2|#if SIMDJSON_IMPLEMENTATION_ICELAKE
   83|      2|    get_icelake_singleton(),
   84|      2|#endif
   85|      2|#if SIMDJSON_IMPLEMENTATION_HASWELL
   86|      2|    get_haswell_singleton(),
   87|      2|#endif
   88|      2|#if SIMDJSON_IMPLEMENTATION_WESTMERE
   89|      2|    get_westmere_singleton(),
   90|      2|#endif
   91|       |#if SIMDJSON_IMPLEMENTATION_ARM64
   92|       |    get_arm64_singleton(),
   93|       |#endif
   94|       |#if SIMDJSON_IMPLEMENTATION_PPC64
   95|       |    get_ppc64_singleton(),
   96|       |#endif
   97|      2|#if SIMDJSON_IMPLEMENTATION_FALLBACK
   98|      2|    get_fallback_singleton(),
   99|      2|#endif
  100|      2|  }; // available_implementation_pointers
  101|      2|  return available_implementation_pointers;
  102|      2|}
simdjson.cpp:_ZN8simdjson8internalL21get_icelake_singletonEv:
   18|      1|static const icelake::implementation* get_icelake_singleton() {
   19|      1|  static const icelake::implementation icelake_singleton{};
   20|      1|  return &icelake_singleton;
   21|      1|}
simdjson.cpp:_ZN8simdjson8internalL21get_haswell_singletonEv:
   24|      1|static const haswell::implementation* get_haswell_singleton() {
   25|      1|  static const haswell::implementation haswell_singleton{};
   26|      1|  return &haswell_singleton;
   27|      1|}
simdjson.cpp:_ZN8simdjson8internalL22get_westmere_singletonEv:
   30|      1|static const westmere::implementation* get_westmere_singleton() {
   31|      1|  static const westmere::implementation westmere_singleton{};
   32|      1|  return &westmere_singleton;
   33|      1|}
simdjson.cpp:_ZN8simdjson8internalL22get_fallback_singletonEv:
   48|      1|static const fallback::implementation* get_fallback_singleton() {
   49|      1|  static const fallback::implementation fallback_singleton{};
   50|      1|  return &fallback_singleton;
   51|      1|}

_ZNK8simdjson8westmere14implementation13validate_utf8EPKcm:
  143|    482|simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
  144|    482|  return westmere::stage1::generic_validate_utf8(buf,len);
  145|    482|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
   83|   323k|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
   84|   323k|  return input.reduce_or().is_ascii();
   85|   323k|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
   95|   324k|simdjson_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
   96|   324k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0
   97|   324k|  simd8<uint8_t> is_fourth_byte = prev3.saturating_sub(0xf0u-1); // Only 1111____ will be > 0
   98|       |  // Caller requires a bool (all 1's). All values resulting from the subtraction will be <= 64, so signed comparison is fine.
   99|   324k|  return simd8<int8_t>(is_third_byte | is_fourth_byte) > int8_t(0);
  100|   324k|}

