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

_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.43k|    simdjson_inline simd8() : base8_numeric<uint8_t>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2Ev:
   93|  1.43k|    simdjson_inline base8_numeric() : base8<T>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2Ev:
   45|  1.43k|    simdjson_inline base8() : base<simd8<T>>() {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2Ev:
   17|  1.43k|    simdjson_inline base() : value{__m256i()} {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  304|   305k|    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|   671k|    static simdjson_inline simd8<T> load(const T values[32]) {
   78|   671k|      return _mm256_loadu_si256(reinterpret_cast<const __m256i *>(values));
   79|   671k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EDv4_x:
  227|  4.76M|    simdjson_inline simd8(const __m256i _value) : base8_numeric<uint8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhEC2EDv4_x:
   94|  4.76M|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2EDv4_x:
   46|  4.76M|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2EDv4_x:
   20|  4.76M|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  325|   305k|    simdjson_inline simd8<T> reduce_or() const {
  326|   305k|      return this->chunks[0] | this->chunks[1];
  327|   305k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   27|   791k|    simdjson_inline Child operator|(const Child other) const { return _mm256_or_si256(*this, other); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv4_xEv:
   23|  5.84M|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  278|   305k|    simdjson_inline bool is_ascii() const { return _mm256_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   31|   366k|    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|   119k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   119k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   119k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  284|   239k|    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|   359k|        L replace12, L replace13, L replace14, L replace15) const {
  173|   359k|      return lookup_16(simd8<L>::repeat_16(
  174|   359k|        replace0,  replace1,  replace2,  replace3,
  175|   359k|        replace4,  replace5,  replace6,  replace7,
  176|   359k|        replace8,  replace9,  replace10, replace11,
  177|   359k|        replace12, replace13, replace14, replace15
  178|   359k|      ));
  179|   359k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  110|   359k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  111|   359k|      return _mm256_shuffle_epi8(lookup_table, *this);
  112|   359k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv4_xEv:
   24|   479k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  248|   359k|    ) {
  249|   359k|      return simd8<uint8_t>(
  250|   359k|        v0, v1, v2, v3, v4, v5, v6, v7,
  251|   359k|        v8, v9, v10,v11,v12,v13,v14,v15,
  252|   359k|        v0, v1, v2, v3, v4, v5, v6, v7,
  253|   359k|        v8, v9, v10,v11,v12,v13,v14,v15
  254|   359k|      );
  255|   359k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh:
  243|   359k|    )) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   28|   719k|    simdjson_inline Child operator&(const Child other) const { return _mm256_and_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2Eh:
  229|   719k|    simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIhE5splatEh:
   75|   719k|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi2EEENS4_IhEES8_:
   53|   119k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   119k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   119k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   53|   119k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   54|   119k|      return _mm256_alignr_epi8(*this, _mm256_permute2x128_si256(prev_chunk, *this, 0x21), 16 - N);
   55|   119k|    }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  259|   299k|    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|   239k|    simdjson_inline simd8(const __m256i _value) : base8_numeric<int8_t>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIaEC2EDv4_x:
   94|   239k|    simdjson_inline base8_numeric(const __m256i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IaNS2_5simd8IbEEEC2EDv4_x:
   46|   239k|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IaEEEC2EDv4_x:
   20|   239k|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEgtES4_:
  219|   119k|    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|   239k|    simdjson_inline operator const __m256i&() const { return this->value; }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IbEC2EDv4_x:
   64|   119k|    simdjson_inline simd8<bool>(const __m256i _value) : base8<bool>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5base8IbNS2_5simd8IbEEEC2EDv4_x:
   46|   119k|    simdjson_inline base8(const __m256i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEC2EDv4_x:
   20|   119k|    simdjson_inline base(const __m256i _value) : value(_value) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IaEC2Ea:
  188|   119k|    simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd13base8_numericIaE5splatEa:
   75|   119k|    static simdjson_inline simd8<T> splat(T _value) { return _mm256_set1_epi8(_value); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRDv4_xEv:
   24|   119k|    simdjson_inline operator __m256i&() { return this->value; }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   29|   119k|    simdjson_inline Child operator^(const Child other) const { return _mm256_xor_si256(*this, other); }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  231|  59.9k|    simdjson_inline simd8(const uint8_t values[32]) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  265|  59.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:
  280|    478|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  279|    478|    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:
  151|      4|static inline uint32_t detect_supported_architectures() {
  152|      4|  uint32_t eax, ebx, ecx, edx;
  153|      4|  uint32_t host_isa = 0x0;
  154|       |
  155|       |  // EBX for EAX=0x1
  156|      4|  eax = 0x1;
  157|      4|  ecx = 0x0;
  158|      4|  cpuid(&eax, &ebx, &ecx, &edx);
  159|       |
  160|      4|  if (ecx & cpuid_sse42_bit) {
  ------------------
  |  Branch (160:7): [True: 4, False: 0]
  ------------------
  161|      4|    host_isa |= instruction_set::SSE42;
  162|      4|  } else {
  163|      0|    return host_isa; // everything after is redundant
  164|      0|  }
  165|       |
  166|      4|  if (ecx & cpuid_pclmulqdq_bit) {
  ------------------
  |  Branch (166:7): [True: 4, False: 0]
  ------------------
  167|      4|    host_isa |= instruction_set::PCLMULQDQ;
  168|      4|  }
  169|       |
  170|       |
  171|      4|  if ((ecx & cpuid_osxsave) != cpuid_osxsave) {
  ------------------
  |  Branch (171:7): [True: 0, False: 4]
  ------------------
  172|      0|    return host_isa;
  173|      0|  }
  174|       |
  175|       |  // xgetbv for checking if the OS saves registers
  176|      4|  uint64_t xcr0 = xgetbv();
  177|       |
  178|      4|  if ((xcr0 & cpuid_avx256_saved) == 0) {
  ------------------
  |  Branch (178:7): [True: 0, False: 4]
  ------------------
  179|      0|    return host_isa;
  180|      0|  }
  181|       |
  182|       |  // ECX for EAX=0x7
  183|      4|  eax = 0x7;
  184|      4|  ecx = 0x0;
  185|      4|  cpuid(&eax, &ebx, &ecx, &edx);
  186|      4|  if (ebx & cpuid_avx2_bit) {
  ------------------
  |  Branch (186:7): [True: 4, False: 0]
  ------------------
  187|      4|    host_isa |= instruction_set::AVX2;
  188|      4|  }
  189|      4|  if (ebx & cpuid_bmi1_bit) {
  ------------------
  |  Branch (189:7): [True: 4, False: 0]
  ------------------
  190|      4|    host_isa |= instruction_set::BMI1;
  191|      4|  }
  192|       |
  193|      4|  if (ebx & cpuid_bmi2_bit) {
  ------------------
  |  Branch (193:7): [True: 4, False: 0]
  ------------------
  194|      4|    host_isa |= instruction_set::BMI2;
  195|      4|  }
  196|       |
  197|      4|  if (!((xcr0 & cpuid_avx512_saved) == cpuid_avx512_saved)) {
  ------------------
  |  Branch (197:7): [True: 4, False: 0]
  ------------------
  198|      4|     return host_isa;
  199|      4|  }
  200|       |
  201|      0|  if (ebx & cpuid_avx512f_bit) {
  ------------------
  |  Branch (201:7): [True: 0, False: 0]
  ------------------
  202|      0|    host_isa |= instruction_set::AVX512F;
  203|      0|  }
  204|       |
  205|      0|  if (ebx & cpuid_avx512dq_bit) {
  ------------------
  |  Branch (205:7): [True: 0, False: 0]
  ------------------
  206|      0|    host_isa |= instruction_set::AVX512DQ;
  207|      0|  }
  208|       |
  209|      0|  if (ebx & cpuid_avx512ifma_bit) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    host_isa |= instruction_set::AVX512IFMA;
  211|      0|  }
  212|       |
  213|      0|  if (ebx & cpuid_avx512pf_bit) {
  ------------------
  |  Branch (213:7): [True: 0, False: 0]
  ------------------
  214|      0|    host_isa |= instruction_set::AVX512PF;
  215|      0|  }
  216|       |
  217|      0|  if (ebx & cpuid_avx512er_bit) {
  ------------------
  |  Branch (217:7): [True: 0, False: 0]
  ------------------
  218|      0|    host_isa |= instruction_set::AVX512ER;
  219|      0|  }
  220|       |
  221|      0|  if (ebx & cpuid_avx512cd_bit) {
  ------------------
  |  Branch (221:7): [True: 0, False: 0]
  ------------------
  222|      0|    host_isa |= instruction_set::AVX512CD;
  223|      0|  }
  224|       |
  225|      0|  if (ebx & cpuid_avx512bw_bit) {
  ------------------
  |  Branch (225:7): [True: 0, False: 0]
  ------------------
  226|      0|    host_isa |= instruction_set::AVX512BW;
  227|      0|  }
  228|       |
  229|      0|  if (ebx & cpuid_avx512vl_bit) {
  ------------------
  |  Branch (229:7): [True: 0, False: 0]
  ------------------
  230|      0|    host_isa |= instruction_set::AVX512VL;
  231|      0|  }
  232|       |
  233|      0|  if (ecx & cpuid_avx512vbmi2_bit) {
  ------------------
  |  Branch (233:7): [True: 0, False: 0]
  ------------------
  234|      0|    host_isa |= instruction_set::AVX512VBMI2;
  235|      0|  }
  236|       |
  237|      0|  return host_isa;
  238|      4|}
simdjson.cpp:_ZN8simdjson8internalL5cpuidEPjS1_S1_S1_:
  119|      8|                         uint32_t *edx) {
  120|       |#if defined(_MSC_VER)
  121|       |  int cpu_info[4];
  122|       |  __cpuidex(cpu_info, *eax, *ecx);
  123|       |  *eax = cpu_info[0];
  124|       |  *ebx = cpu_info[1];
  125|       |  *ecx = cpu_info[2];
  126|       |  *edx = cpu_info[3];
  127|       |#elif defined(HAVE_GCC_GET_CPUID) && defined(USE_GCC_GET_CPUID)
  128|       |  uint32_t level = *eax;
  129|       |  __get_cpuid(level, eax, ebx, ecx, edx);
  130|       |#else
  131|      8|  uint32_t a = *eax, b, c = *ecx, d;
  132|      8|  asm volatile("cpuid\n\t" : "+a"(a), "=b"(b), "+c"(c), "=d"(d));
  133|      8|  *eax = a;
  134|      8|  *ebx = b;
  135|      8|  *ecx = c;
  136|      8|  *edx = d;
  137|      8|#endif
  138|      8|}
simdjson.cpp:_ZN8simdjson8internalL6xgetbvEv:
  141|      4|static inline uint64_t xgetbv() {
  142|       |#if defined(_MSC_VER)
  143|       |  return _xgetbv(0);
  144|       |#else
  145|      4|  uint32_t xcr0_lo, xcr0_hi;
  146|      4|  asm volatile("xgetbv\n\t" : "=a" (xcr0_lo), "=d" (xcr0_hi) : "c" (0));
  147|      4|  return xcr0_lo | (uint64_t(xcr0_hi) << 32);
  148|      4|#endif
  149|      4|}

_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.43k|    simdjson_inline simd8() : base8_numeric<uint8_t>() {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhEC2Ev:
   90|  1.43k|    simdjson_inline base8_numeric() : base8<T>() {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2Ev:
   44|  1.43k|    simdjson_inline base8() : base<simd8<T>>() {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2Ev:
   16|  1.43k|    simdjson_inline base() : value{__m128i()} {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd8simd8x64IhEC2EPKh:
  274|   305k|    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.28M|    static simdjson_inline simd8<T> load(const T values[16]) {
   77|  1.28M|      return _mm_loadu_si128(reinterpret_cast<const __m128i *>(values));
   78|  1.28M|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2EDv2_x:
  203|  9.46M|    simdjson_inline simd8(const __m128i _value) : base8_numeric<uint8_t>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhEC2EDv2_x:
   91|  9.46M|    simdjson_inline base8_numeric(const __m128i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEEC2EDv2_x:
   45|  9.46M|    simdjson_inline base8(const __m128i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEC2EDv2_x:
   19|  9.46M|    simdjson_inline base(const __m128i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd8simd8x64IhE9reduce_orEv:
  283|   305k|    simdjson_inline simd8<T> reduce_or() const {
  284|   305k|      return (this->chunks[0] | this->chunks[1]) | (this->chunks[2] | this->chunks[3]);
  285|   305k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEorES5_:
   26|  1.64M|    simdjson_inline Child operator|(const Child other) const { return _mm_or_si128(*this, other); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRKDv2_xEv:
   22|  10.6M|    simdjson_inline operator const __m128i&() const { return this->value; }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE8is_asciiEv:
  248|   305k|    simdjson_inline bool is_ascii() const { return _mm_movemask_epi8(*this) == 0; }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEoRES5_:
   30|   486k|    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|   239k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   53|   239k|      return _mm_alignr_epi8(*this, prev_chunk, 16 - N);
   54|   239k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE3shrILi4EEES4_v:
  254|   479k|    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|   719k|        L replace12, L replace13, L replace14, L replace15) const {
  155|   719k|      return lookup_16(simd8<L>::repeat_16(
  156|   719k|        replace0,  replace1,  replace2,  replace3,
  157|   719k|        replace4,  replace5,  replace6,  replace7,
  158|   719k|        replace8,  replace9,  replace10, replace11,
  159|   719k|        replace12, replace13, replace14, replace15
  160|   719k|      ));
  161|   719k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhE9lookup_16IhEENS2_5simd8IT_EES8_:
  107|   719k|    simdjson_inline simd8<L> lookup_16(simd8<L> lookup_table) const {
  108|   719k|      return _mm_shuffle_epi8(lookup_table, *this);
  109|   719k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEcvRDv2_xEv:
   23|   959k|    simdjson_inline operator __m128i&() { return this->value; }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE9repeat_16Ehhhhhhhhhhhhhhhh:
  220|   719k|    ) {
  221|   719k|      return simd8<uint8_t>(
  222|   719k|        v0, v1, v2, v3, v4, v5, v6, v7,
  223|   719k|        v8, v9, v10,v11,v12,v13,v14,v15
  224|   719k|      );
  225|   719k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2Ehhhhhhhhhhhhhhhh:
  215|   719k|    )) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEanES5_:
   27|  1.43M|    simdjson_inline Child operator&(const Child other) const { return _mm_and_si128(*this, other); }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2Eh:
  205|  1.43M|    simdjson_inline simd8(uint8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIhE5splatEh:
   74|  1.43M|    static simdjson_inline simd8<T> splat(T _value) { return _mm_set1_epi8(_value); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi2EEENS4_IhEES8_:
   52|   239k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   53|   239k|      return _mm_alignr_epi8(*this, prev_chunk, 16 - N);
   54|   239k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5base8IhNS2_5simd8IbEEE4prevILi3EEENS4_IhEES8_:
   52|   239k|    simdjson_inline simd8<T> prev(const simd8<T> prev_chunk) const {
   53|   239k|      return _mm_alignr_epi8(*this, prev_chunk, 16 - N);
   54|   239k|    }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE14saturating_subES4_:
  229|   539k|    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|   479k|    simdjson_inline simd8(const __m128i _value) : base8_numeric<int8_t>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIaEC2EDv2_x:
   91|   479k|    simdjson_inline base8_numeric(const __m128i _value) : base8<T>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5base8IaNS2_5simd8IbEEEC2EDv2_x:
   45|   479k|    simdjson_inline base8(const __m128i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IaEEEC2EDv2_x:
   19|   479k|    simdjson_inline base(const __m128i _value) : value(_value) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IaEgtES4_:
  195|   239k|    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|   479k|    simdjson_inline operator const __m128i&() const { return this->value; }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IbEC2EDv2_x:
   63|   239k|    simdjson_inline simd8<bool>(const __m128i _value) : base8<bool>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5base8IbNS2_5simd8IbEEEC2EDv2_x:
   45|   239k|    simdjson_inline base8(const __m128i _value) : base<simd8<T>>(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEC2EDv2_x:
   19|   239k|    simdjson_inline base(const __m128i _value) : value(_value) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IaEC2Ea:
  170|   239k|    simdjson_inline simd8(int8_t _value) : simd8(splat(_value)) {}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd13base8_numericIaE5splatEa:
   74|   239k|    static simdjson_inline simd8<T> splat(T _value) { return _mm_set1_epi8(_value); }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IbEEEcvRDv2_xEv:
   23|   239k|    simdjson_inline operator __m128i&() { return this->value; }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd4baseINS2_5simd8IhEEEeoES5_:
   28|   239k|    simdjson_inline Child operator^(const Child other) const { return _mm_xor_si128(*this, other); }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_14simd5simd8IhEC2EPKh:
  207|  59.9k|    simdjson_inline simd8(const uint8_t* values) : simd8(load(values)) {}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE7gt_bitsES4_:
  235|  59.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|    478|    simdjson_inline bool any_bits_set_anywhere() const { return !bits_not_set_anywhere(); }
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_14simd5simd8IhE21bits_not_set_anywhereEv:
  249|    478|    simdjson_inline bool bits_not_set_anywhere() const { return _mm_testz_si128(*this, *this); }

_ZNK8simdjson8fallback14implementation13validate_utf8EPKcm:
  281|    478|simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
  282|    478|  const uint8_t *data = reinterpret_cast<const uint8_t *>(buf);
  283|    478|  uint64_t pos = 0;
  284|    478|  uint32_t code_point = 0;
  285|  1.54M|  while (pos < len) {
  ------------------
  |  Branch (285:10): [True: 1.54M, False: 146]
  ------------------
  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.45k]
  ------------------
  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: 742k, False: 802k]
  ------------------
  295|   742k|        pos = next_pos;
  296|   742k|        continue;
  297|   742k|      }
  298|  1.54M|    }
  299|   803k|    unsigned char byte = data[pos];
  300|   803k|    if (byte < 0x80) {
  ------------------
  |  Branch (300:9): [True: 680k, False: 123k]
  ------------------
  301|   680k|      pos++;
  302|   680k|      continue;
  303|   680k|    } else if ((byte & 0xe0) == 0xc0) {
  ------------------
  |  Branch (303:16): [True: 66.3k, False: 56.9k]
  ------------------
  304|  66.3k|      next_pos = pos + 2;
  305|  66.3k|      if (next_pos > len) { return false; }
  ------------------
  |  Branch (305:11): [True: 31, False: 66.2k]
  ------------------
  306|  66.2k|      if ((data[pos + 1] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (306:11): [True: 17, False: 66.2k]
  ------------------
  307|       |      // range check
  308|  66.2k|      code_point = (byte & 0x1f) << 6 | (data[pos + 1] & 0x3f);
  309|  66.2k|      if (code_point < 0x80 || 0x7ff < code_point) { return false; }
  ------------------
  |  Branch (309:11): [True: 1, False: 66.2k]
  |  Branch (309:32): [True: 0, False: 66.2k]
  ------------------
  310|  66.2k|    } else if ((byte & 0xf0) == 0xe0) {
  ------------------
  |  Branch (310:16): [True: 21.0k, False: 35.8k]
  ------------------
  311|  21.0k|      next_pos = pos + 3;
  312|  21.0k|      if (next_pos > len) { return false; }
  ------------------
  |  Branch (312:11): [True: 27, False: 21.0k]
  ------------------
  313|  21.0k|      if ((data[pos + 1] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (313:11): [True: 18, False: 21.0k]
  ------------------
  314|  21.0k|      if ((data[pos + 2] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (314:11): [True: 14, False: 21.0k]
  ------------------
  315|       |      // range check
  316|  21.0k|      code_point = (byte & 0x0f) << 12 |
  317|  21.0k|                   (data[pos + 1] & 0x3f) << 6 |
  318|  21.0k|                   (data[pos + 2] & 0x3f);
  319|  21.0k|      if (code_point < 0x800 || 0xffff < code_point ||
  ------------------
  |  Branch (319:11): [True: 13, False: 20.9k]
  |  Branch (319:33): [True: 0, False: 20.9k]
  ------------------
  320|  21.0k|          (0xd7ff < code_point && code_point < 0xe000)) {
  ------------------
  |  Branch (320:12): [True: 6.61k, False: 14.3k]
  |  Branch (320:35): [True: 17, False: 6.59k]
  ------------------
  321|     30|        return false;
  322|     30|      }
  323|  35.8k|    } else if ((byte & 0xf8) == 0xf0) { // 0b11110000
  ------------------
  |  Branch (323:16): [True: 35.7k, False: 112]
  ------------------
  324|  35.7k|      next_pos = pos + 4;
  325|  35.7k|      if (next_pos > len) { return false; }
  ------------------
  |  Branch (325:11): [True: 34, False: 35.7k]
  ------------------
  326|  35.7k|      if ((data[pos + 1] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (326:11): [True: 13, False: 35.7k]
  ------------------
  327|  35.7k|      if ((data[pos + 2] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (327:11): [True: 5, False: 35.7k]
  ------------------
  328|  35.7k|      if ((data[pos + 3] & 0xc0) != 0x80) { return false; }
  ------------------
  |  Branch (328:11): [True: 5, False: 35.7k]
  ------------------
  329|       |      // range check
  330|  35.7k|      code_point =
  331|  35.7k|          (byte & 0x07) << 18 | (data[pos + 1] & 0x3f) << 12 |
  332|  35.7k|          (data[pos + 2] & 0x3f) << 6 | (data[pos + 3] & 0x3f);
  333|  35.7k|      if (code_point <= 0xffff || 0x10ffff < code_point) { return false; }
  ------------------
  |  Branch (333:11): [True: 18, False: 35.7k]
  |  Branch (333:35): [True: 7, False: 35.7k]
  ------------------
  334|  35.7k|    } else {
  335|       |      // we may have a continuation
  336|    112|      return false;
  337|    112|    }
  338|   122k|    pos = next_pos;
  339|   122k|  }
  340|    146|  return true;
  341|    478|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm64EEC2EPKhm:
   62|    478|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|   305k|simdjson_inline bool buf_block_reader<STEP_SIZE>::has_full_block() const {
   69|   305k|  return idx < lenminusstep;
   70|   305k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm64EE10full_blockEv:
   73|   305k|simdjson_inline const uint8_t *buf_block_reader<STEP_SIZE>::full_block() const {
   74|   305k|  return &buf[idx];
   75|   305k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm64EE7advanceEv:
   86|   305k|simdjson_inline void buf_block_reader<STEP_SIZE>::advance() {
   87|   305k|  idx += STEP_SIZE;
   88|   305k|}
simdjson.cpp:_ZNK8simdjson7haswell12_GLOBAL__N_116buf_block_readerILm64EE13get_remainderEPh:
   78|    478|simdjson_inline size_t buf_block_reader<STEP_SIZE>::get_remainder(uint8_t *dst) const {
   79|    478|  if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers
  ------------------
  |  Branch (79:6): [True: 0, False: 478]
  ------------------
   80|    478|  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|    478|  std::memcpy(dst, buf + idx, len - idx);
   82|    478|  return len - idx;
   83|    478|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_116buf_block_readerILm64EEC2EPKhm:
   62|    478|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|   305k|simdjson_inline bool buf_block_reader<STEP_SIZE>::has_full_block() const {
   69|   305k|  return idx < lenminusstep;
   70|   305k|}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_116buf_block_readerILm64EE10full_blockEv:
   73|   305k|simdjson_inline const uint8_t *buf_block_reader<STEP_SIZE>::full_block() const {
   74|   305k|  return &buf[idx];
   75|   305k|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_116buf_block_readerILm64EE7advanceEv:
   86|   305k|simdjson_inline void buf_block_reader<STEP_SIZE>::advance() {
   87|   305k|  idx += STEP_SIZE;
   88|   305k|}
simdjson.cpp:_ZNK8simdjson8westmere12_GLOBAL__N_116buf_block_readerILm64EE13get_remainderEPh:
   78|    478|simdjson_inline size_t buf_block_reader<STEP_SIZE>::get_remainder(uint8_t *dst) const {
   79|    478|  if(len == idx) { return 0; } // memcpy(dst, null, 0) will trigger an error with some sanitizers
  ------------------
  |  Branch (79:6): [True: 0, False: 478]
  ------------------
   80|    478|  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|    478|  std::memcpy(dst, buf + idx, len - idx);
   82|    478|  return len - idx;
   83|    478|}

simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker16check_next_inputERKNS1_4simd8simd8x64IhEE:
  173|   305k|    simdjson_inline void check_next_input(const simd8x64<uint8_t>& input) {
  174|   305k|      if(simdjson_likely(is_ascii(input))) {
  ------------------
  |  |  117|   305k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (117:30): [True: 245k, False: 59.9k]
  |  |  ------------------
  ------------------
  175|   245k|        this->error |= this->prev_incomplete;
  176|   245k|      } else {
  177|       |        // you might think that a for-loop would work, but under Visual Studio, it is not good enough.
  178|  59.9k|        static_assert((simd8x64<uint8_t>::NUM_CHUNKS == 1)
  179|  59.9k|                ||(simd8x64<uint8_t>::NUM_CHUNKS == 2)
  180|  59.9k|                || (simd8x64<uint8_t>::NUM_CHUNKS == 4),
  181|  59.9k|                "We support one, two or four chunks per 64-byte block.");
  182|  59.9k|        SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 1) {
  ------------------
  |  |  167|  59.9k|#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|  59.9k|        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 2) {
  ------------------
  |  |  167|  59.9k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  |  Branch (184:39): [Folded - Ignored]
  ------------------
  185|  59.9k|          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  186|  59.9k|          this->check_utf8_bytes(input.chunks[1], input.chunks[0]);
  187|  59.9k|        } 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|  59.9k|        this->prev_incomplete = is_incomplete(input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1]);
  194|  59.9k|        this->prev_input_block = input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1];
  195|  59.9k|      }
  196|   305k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker16check_utf8_bytesENS1_4simd5simd8IhEES6_:
  148|   119k|    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|   119k|      simd8<uint8_t> prev1 = input.prev<1>(prev_input);
  152|   119k|      simd8<uint8_t> sc = check_special_cases(input, prev1);
  153|   119k|      this->error |= check_multibyte_lengths(input, prev_input, sc);
  154|   119k|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation19check_special_casesENS1_4simd5simd8IhEES5_:
    8|   119k|  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|   119k|    constexpr const uint8_t TOO_SHORT   = 1<<0; // 11______ 0_______
   16|       |                                                // 11______ 11______
   17|   119k|    constexpr const uint8_t TOO_LONG    = 1<<1; // 0_______ 10______
   18|   119k|    constexpr const uint8_t OVERLONG_3  = 1<<2; // 11100000 100_____
   19|   119k|    constexpr const uint8_t SURROGATE   = 1<<4; // 11101101 101_____
   20|   119k|    constexpr const uint8_t OVERLONG_2  = 1<<5; // 1100000_ 10______
   21|   119k|    constexpr const uint8_t TWO_CONTS   = 1<<7; // 10______ 10______
   22|   119k|    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|   119k|    constexpr const uint8_t TOO_LARGE_1000 = 1<<6;
   31|       |                                                // 11110101 1000____
   32|       |                                                // 1111011_ 1000____
   33|       |                                                // 11111___ 1000____
   34|   119k|    constexpr const uint8_t OVERLONG_4  = 1<<6; // 11110000 1000____
   35|       |
   36|   119k|    const simd8<uint8_t> byte_1_high = prev1.shr<4>().lookup_16<uint8_t>(
   37|       |      // 0_______ ________ <ASCII in byte 1>
   38|   119k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   39|   119k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   40|       |      // 10______ ________ <continuation in byte 1>
   41|   119k|      TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS,
   42|       |      // 1100____ ________ <two byte lead in byte 1>
   43|   119k|      TOO_SHORT | OVERLONG_2,
   44|       |      // 1101____ ________ <two byte lead in byte 1>
   45|   119k|      TOO_SHORT,
   46|       |      // 1110____ ________ <three byte lead in byte 1>
   47|   119k|      TOO_SHORT | OVERLONG_3 | SURROGATE,
   48|       |      // 1111____ ________ <four+ byte lead in byte 1>
   49|   119k|      TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4
   50|   119k|    );
   51|   119k|    constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 .
   52|   119k|    const simd8<uint8_t> byte_1_low = (prev1 & 0x0F).lookup_16<uint8_t>(
   53|       |      // ____0000 ________
   54|   119k|      CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4,
   55|       |      // ____0001 ________
   56|   119k|      CARRY | OVERLONG_2,
   57|       |      // ____001_ ________
   58|   119k|      CARRY,
   59|   119k|      CARRY,
   60|       |
   61|       |      // ____0100 ________
   62|   119k|      CARRY | TOO_LARGE,
   63|       |      // ____0101 ________
   64|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   65|       |      // ____011_ ________
   66|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   67|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   68|       |
   69|       |      // ____1___ ________
   70|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   71|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   72|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   73|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   74|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   75|       |      // ____1101 ________
   76|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE,
   77|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   78|   119k|      CARRY | TOO_LARGE | TOO_LARGE_1000
   79|   119k|    );
   80|   119k|    const simd8<uint8_t> byte_2_high = input.shr<4>().lookup_16<uint8_t>(
   81|       |      // ________ 0_______ <ASCII in byte 2>
   82|   119k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   83|   119k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   84|       |
   85|       |      // ________ 1000____
   86|   119k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4,
   87|       |      // ________ 1001____
   88|   119k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE,
   89|       |      // ________ 101_____
   90|   119k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   91|   119k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   92|       |
   93|       |      // ________ 11______
   94|   119k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT
   95|   119k|    );
   96|   119k|    return (byte_1_high & byte_1_low & byte_2_high);
   97|   119k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation23check_multibyte_lengthsENS1_4simd5simd8IhEES5_S5_:
   99|   119k|      const simd8<uint8_t> prev_input, const simd8<uint8_t> sc) {
  100|   119k|    simd8<uint8_t> prev2 = input.prev<2>(prev_input);
  101|   119k|    simd8<uint8_t> prev3 = input.prev<3>(prev_input);
  102|   119k|    simd8<uint8_t> must23 = simd8<uint8_t>(must_be_2_3_continuation(prev2, prev3));
  103|   119k|    simd8<uint8_t> must23_80 = must23 & uint8_t(0x80);
  104|   119k|    return must23_80 ^ sc;
  105|   119k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation13is_incompleteENS1_4simd5simd8IhEE:
  111|  59.9k|  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|  59.9k|#if SIMDJSON_IMPLEMENTATION_ICELAKE
  115|  59.9k|    static const uint8_t max_array[64] = {
  116|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  117|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  118|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  119|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  120|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  121|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  122|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  123|  59.9k|      255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1
  124|  59.9k|    };
  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|  59.9k|    const simd8<uint8_t> max_value(&max_array[sizeof(max_array)-sizeof(simd8<uint8_t>)]);
  134|  59.9k|    return input.gt_bits(max_value);
  135|  59.9k|  }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker9check_eofEv:
  159|    478|    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|    478|      this->error |= this->prev_incomplete;
  163|    478|    }
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_115utf8_validation12utf8_checker6errorsEv:
  198|    478|    simdjson_inline error_code errors() {
  199|    478|      return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS;
  ------------------
  |  Branch (199:14): [True: 332, False: 146]
  ------------------
  200|    478|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation12utf8_checker16check_next_inputERKNS1_4simd8simd8x64IhEE:
  173|   305k|    simdjson_inline void check_next_input(const simd8x64<uint8_t>& input) {
  174|   305k|      if(simdjson_likely(is_ascii(input))) {
  ------------------
  |  |  117|   305k|  #define simdjson_likely(x) __builtin_expect(!!(x), 1)
  |  |  ------------------
  |  |  |  Branch (117:30): [True: 245k, False: 59.9k]
  |  |  ------------------
  ------------------
  175|   245k|        this->error |= this->prev_incomplete;
  176|   245k|      } else {
  177|       |        // you might think that a for-loop would work, but under Visual Studio, it is not good enough.
  178|  59.9k|        static_assert((simd8x64<uint8_t>::NUM_CHUNKS == 1)
  179|  59.9k|                ||(simd8x64<uint8_t>::NUM_CHUNKS == 2)
  180|  59.9k|                || (simd8x64<uint8_t>::NUM_CHUNKS == 4),
  181|  59.9k|                "We support one, two or four chunks per 64-byte block.");
  182|  59.9k|        SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 1) {
  ------------------
  |  |  167|  59.9k|#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|  59.9k|        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 2) {
  ------------------
  |  |  167|  59.9k|#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|  59.9k|        } else SIMDJSON_IF_CONSTEXPR (simd8x64<uint8_t>::NUM_CHUNKS == 4) {
  ------------------
  |  |  167|  59.9k|#define SIMDJSON_IF_CONSTEXPR if constexpr
  ------------------
  |  Branch (187:39): [Folded - Ignored]
  ------------------
  188|  59.9k|          this->check_utf8_bytes(input.chunks[0], this->prev_input_block);
  189|  59.9k|          this->check_utf8_bytes(input.chunks[1], input.chunks[0]);
  190|  59.9k|          this->check_utf8_bytes(input.chunks[2], input.chunks[1]);
  191|  59.9k|          this->check_utf8_bytes(input.chunks[3], input.chunks[2]);
  192|  59.9k|        }
  193|  59.9k|        this->prev_incomplete = is_incomplete(input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1]);
  194|  59.9k|        this->prev_input_block = input.chunks[simd8x64<uint8_t>::NUM_CHUNKS-1];
  195|  59.9k|      }
  196|   305k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation12utf8_checker16check_utf8_bytesENS1_4simd5simd8IhEES6_:
  148|   239k|    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|   239k|      simd8<uint8_t> prev1 = input.prev<1>(prev_input);
  152|   239k|      simd8<uint8_t> sc = check_special_cases(input, prev1);
  153|   239k|      this->error |= check_multibyte_lengths(input, prev_input, sc);
  154|   239k|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation19check_special_casesENS1_4simd5simd8IhEES5_:
    8|   239k|  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|   239k|    constexpr const uint8_t TOO_SHORT   = 1<<0; // 11______ 0_______
   16|       |                                                // 11______ 11______
   17|   239k|    constexpr const uint8_t TOO_LONG    = 1<<1; // 0_______ 10______
   18|   239k|    constexpr const uint8_t OVERLONG_3  = 1<<2; // 11100000 100_____
   19|   239k|    constexpr const uint8_t SURROGATE   = 1<<4; // 11101101 101_____
   20|   239k|    constexpr const uint8_t OVERLONG_2  = 1<<5; // 1100000_ 10______
   21|   239k|    constexpr const uint8_t TWO_CONTS   = 1<<7; // 10______ 10______
   22|   239k|    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|   239k|    constexpr const uint8_t TOO_LARGE_1000 = 1<<6;
   31|       |                                                // 11110101 1000____
   32|       |                                                // 1111011_ 1000____
   33|       |                                                // 11111___ 1000____
   34|   239k|    constexpr const uint8_t OVERLONG_4  = 1<<6; // 11110000 1000____
   35|       |
   36|   239k|    const simd8<uint8_t> byte_1_high = prev1.shr<4>().lookup_16<uint8_t>(
   37|       |      // 0_______ ________ <ASCII in byte 1>
   38|   239k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   39|   239k|      TOO_LONG, TOO_LONG, TOO_LONG, TOO_LONG,
   40|       |      // 10______ ________ <continuation in byte 1>
   41|   239k|      TWO_CONTS, TWO_CONTS, TWO_CONTS, TWO_CONTS,
   42|       |      // 1100____ ________ <two byte lead in byte 1>
   43|   239k|      TOO_SHORT | OVERLONG_2,
   44|       |      // 1101____ ________ <two byte lead in byte 1>
   45|   239k|      TOO_SHORT,
   46|       |      // 1110____ ________ <three byte lead in byte 1>
   47|   239k|      TOO_SHORT | OVERLONG_3 | SURROGATE,
   48|       |      // 1111____ ________ <four+ byte lead in byte 1>
   49|   239k|      TOO_SHORT | TOO_LARGE | TOO_LARGE_1000 | OVERLONG_4
   50|   239k|    );
   51|   239k|    constexpr const uint8_t CARRY = TOO_SHORT | TOO_LONG | TWO_CONTS; // These all have ____ in byte 1 .
   52|   239k|    const simd8<uint8_t> byte_1_low = (prev1 & 0x0F).lookup_16<uint8_t>(
   53|       |      // ____0000 ________
   54|   239k|      CARRY | OVERLONG_3 | OVERLONG_2 | OVERLONG_4,
   55|       |      // ____0001 ________
   56|   239k|      CARRY | OVERLONG_2,
   57|       |      // ____001_ ________
   58|   239k|      CARRY,
   59|   239k|      CARRY,
   60|       |
   61|       |      // ____0100 ________
   62|   239k|      CARRY | TOO_LARGE,
   63|       |      // ____0101 ________
   64|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   65|       |      // ____011_ ________
   66|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   67|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   68|       |
   69|       |      // ____1___ ________
   70|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   71|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   72|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   73|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   74|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   75|       |      // ____1101 ________
   76|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000 | SURROGATE,
   77|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000,
   78|   239k|      CARRY | TOO_LARGE | TOO_LARGE_1000
   79|   239k|    );
   80|   239k|    const simd8<uint8_t> byte_2_high = input.shr<4>().lookup_16<uint8_t>(
   81|       |      // ________ 0_______ <ASCII in byte 2>
   82|   239k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   83|   239k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT,
   84|       |
   85|       |      // ________ 1000____
   86|   239k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE_1000 | OVERLONG_4,
   87|       |      // ________ 1001____
   88|   239k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | OVERLONG_3 | TOO_LARGE,
   89|       |      // ________ 101_____
   90|   239k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   91|   239k|      TOO_LONG | OVERLONG_2 | TWO_CONTS | SURROGATE  | TOO_LARGE,
   92|       |
   93|       |      // ________ 11______
   94|   239k|      TOO_SHORT, TOO_SHORT, TOO_SHORT, TOO_SHORT
   95|   239k|    );
   96|   239k|    return (byte_1_high & byte_1_low & byte_2_high);
   97|   239k|  }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation23check_multibyte_lengthsENS1_4simd5simd8IhEES5_S5_:
   99|   239k|      const simd8<uint8_t> prev_input, const simd8<uint8_t> sc) {
  100|   239k|    simd8<uint8_t> prev2 = input.prev<2>(prev_input);
  101|   239k|    simd8<uint8_t> prev3 = input.prev<3>(prev_input);
  102|   239k|    simd8<uint8_t> must23 = simd8<uint8_t>(must_be_2_3_continuation(prev2, prev3));
  103|   239k|    simd8<uint8_t> must23_80 = must23 & uint8_t(0x80);
  104|   239k|    return must23_80 ^ sc;
  105|   239k|  }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation13is_incompleteENS1_4simd5simd8IhEE:
  111|  59.9k|  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|  59.9k|#if SIMDJSON_IMPLEMENTATION_ICELAKE
  115|  59.9k|    static const uint8_t max_array[64] = {
  116|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  117|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  118|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  119|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  120|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  121|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  122|  59.9k|      255, 255, 255, 255, 255, 255, 255, 255,
  123|  59.9k|      255, 255, 255, 255, 255, 0xf0u-1, 0xe0u-1, 0xc0u-1
  124|  59.9k|    };
  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|  59.9k|    const simd8<uint8_t> max_value(&max_array[sizeof(max_array)-sizeof(simd8<uint8_t>)]);
  134|  59.9k|    return input.gt_bits(max_value);
  135|  59.9k|  }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation12utf8_checker9check_eofEv:
  159|    478|    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|    478|      this->error |= this->prev_incomplete;
  163|    478|    }
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_115utf8_validation12utf8_checker6errorsEv:
  198|    478|    simdjson_inline error_code errors() {
  199|    478|      return this->error.any_bits_set_anywhere() ? error_code::UTF8_ERROR : error_code::SUCCESS;
  ------------------
  |  Branch (199:14): [True: 332, False: 146]
  ------------------
  200|    478|    }

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

_ZNK8simdjson7haswell14implementation13validate_utf8EPKcm:
  144|    478|simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
  145|    478|  return haswell::stage1::generic_validate_utf8(buf,len);
  146|    478|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
   85|   305k|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
   86|   305k|  return input.reduce_or().is_ascii();
   87|   305k|}
simdjson.cpp:_ZN8simdjson7haswell12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
   97|   119k|simdjson_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
   98|   119k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0
   99|   119k|  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|   119k|  return simd8<int8_t>(is_third_byte | is_fourth_byte) > int8_t(0);
  102|   119k|}

_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|    478|simdjson_warn_unused bool implementation::validate_utf8(const char *buf, size_t len) const noexcept {
  144|    478|  return westmere::stage1::generic_validate_utf8(buf,len);
  145|    478|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_18is_asciiERKNS1_4simd8simd8x64IhEE:
   83|   305k|simdjson_inline bool is_ascii(const simd8x64<uint8_t>& input) {
   84|   305k|  return input.reduce_or().is_ascii();
   85|   305k|}
simdjson.cpp:_ZN8simdjson8westmere12_GLOBAL__N_124must_be_2_3_continuationENS1_4simd5simd8IhEES4_:
   95|   239k|simdjson_inline simd8<bool> must_be_2_3_continuation(const simd8<uint8_t> prev2, const simd8<uint8_t> prev3) {
   96|   239k|  simd8<uint8_t> is_third_byte  = prev2.saturating_sub(0xe0u-1); // Only 111_____ will be > 0
   97|   239k|  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|   239k|  return simd8<int8_t>(is_third_byte | is_fourth_byte) > int8_t(0);
  100|   239k|}

