_ZN11flatbuffers10ReadScalarIhEET_PKv:
  427|   161k|T ReadScalar(const void *p) {
  428|   161k|  return EndianScalar(*reinterpret_cast<const T *>(p));
  429|   161k|}
_ZN11flatbuffers12EndianScalarIhEET_S1_:
  416|   161k|template<typename T> T EndianScalar(T t) {
  417|   161k|  #if FLATBUFFERS_LITTLEENDIAN
  418|   161k|    return t;
  419|       |  #else
  420|       |    return EndianSwap(t);
  421|       |  #endif
  422|   161k|}
_ZN11flatbuffers10ReadScalarItEET_PKv:
  427|   266k|T ReadScalar(const void *p) {
  428|   266k|  return EndianScalar(*reinterpret_cast<const T *>(p));
  429|   266k|}
_ZN11flatbuffers12EndianScalarItEET_S1_:
  416|   266k|template<typename T> T EndianScalar(T t) {
  417|   266k|  #if FLATBUFFERS_LITTLEENDIAN
  418|   266k|    return t;
  419|       |  #else
  420|       |    return EndianSwap(t);
  421|       |  #endif
  422|   266k|}
_ZN11flatbuffers10ReadScalarIjEET_PKv:
  427|  5.36k|T ReadScalar(const void *p) {
  428|  5.36k|  return EndianScalar(*reinterpret_cast<const T *>(p));
  429|  5.36k|}
_ZN11flatbuffers12EndianScalarIjEET_S1_:
  416|  5.36k|template<typename T> T EndianScalar(T t) {
  417|  5.36k|  #if FLATBUFFERS_LITTLEENDIAN
  418|  5.36k|    return t;
  419|       |  #else
  420|       |    return EndianSwap(t);
  421|       |  #endif
  422|  5.36k|}
_ZN11flatbuffers10ReadScalarImEET_PKv:
  427|  4.29k|T ReadScalar(const void *p) {
  428|  4.29k|  return EndianScalar(*reinterpret_cast<const T *>(p));
  429|  4.29k|}
_ZN11flatbuffers12EndianScalarImEET_S1_:
  416|  4.29k|template<typename T> T EndianScalar(T t) {
  417|  4.29k|  #if FLATBUFFERS_LITTLEENDIAN
  418|  4.29k|    return t;
  419|       |  #else
  420|       |    return EndianSwap(t);
  421|       |  #endif
  422|  4.29k|}

_ZN11flexbuffers12VerifyBufferEPKhmPNSt3__16vectorIhNS2_9allocatorIhEEEE:
 2075|  1.35k|                         std::vector<uint8_t>* reuse_tracker = nullptr) {
 2076|  1.35k|  Verifier verifier(buf, buf_len, reuse_tracker);
 2077|  1.35k|  return verifier.VerifyBuffer();
 2078|  1.35k|}
_ZN11flexbuffers8VerifierC2EPKhmPNSt3__16vectorIhNS3_9allocatorIhEEEEbm:
 1853|  1.35k|      : buf_(buf),
 1854|  1.35k|        size_(buf_len),
 1855|  1.35k|        depth_(0),
 1856|  1.35k|        max_depth_(max_depth),
 1857|  1.35k|        num_vectors_(0),
 1858|  1.35k|        max_vectors_(buf_len),
 1859|  1.35k|        check_alignment_(_check_alignment),
 1860|  1.35k|        reuse_tracker_(reuse_tracker) {
 1861|  1.35k|    FLATBUFFERS_ASSERT(static_cast<int32_t>(size_) <
 1862|  1.35k|                       FLATBUFFERS_MAX_BUFFER_SIZE);
 1863|  1.35k|    if (reuse_tracker_) {
  ------------------
  |  Branch (1863:9): [True: 1.35k, False: 0]
  ------------------
 1864|  1.35k|      reuse_tracker_->clear();
 1865|  1.35k|      reuse_tracker_->resize(size_, PackedType(BIT_WIDTH_8, FBT_NULL));
 1866|  1.35k|    }
 1867|  1.35k|  }
_ZN11flexbuffers10PackedTypeENS_8BitWidthENS_4TypeE:
  933|   164k|inline uint8_t PackedType(BitWidth bit_width, Type type) {
  934|   164k|  return static_cast<uint8_t>(bit_width | (type << 2));
  935|   164k|}
_ZN11flexbuffers8Verifier12VerifyBufferEv:
 2052|  1.35k|  bool VerifyBuffer() {
 2053|  1.35k|    if (!Check(size_ >= 3)) return false;
  ------------------
  |  Branch (2053:9): [True: 2, False: 1.35k]
  ------------------
 2054|  1.35k|    auto end = buf_ + size_;
 2055|  1.35k|    auto byte_width = *--end;
 2056|  1.35k|    auto packed_type = *--end;
 2057|  1.35k|    return VerifyByteWidth(byte_width) && Check(end - buf_ >= byte_width) &&
  ------------------
  |  Branch (2057:12): [True: 1.31k, False: 32]
  |  Branch (2057:43): [True: 1.31k, False: 5]
  ------------------
 2058|  1.31k|           VerifyRef(Reference(end - byte_width, byte_width, packed_type));
  ------------------
  |  Branch (2058:12): [True: 257, False: 1.05k]
  ------------------
 2059|  1.35k|  }
_ZNK11flexbuffers8Verifier5CheckEb:
 1871|  1.55M|  bool Check(bool ok) const {
 1872|       |    // clang-format off
 1873|       |    #ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE
 1874|       |      FLATBUFFERS_ASSERT(ok);
 1875|       |    #endif
 1876|       |    // clang-format on
 1877|  1.55M|    return ok;
 1878|  1.55M|  }
_ZN11flexbuffers8Verifier15VerifyByteWidthEm:
 1897|   370k|  bool VerifyByteWidth(size_t width) {
 1898|   370k|    return Check(width == 1 || width == 2 || width == 4 || width == 8);
  ------------------
  |  Branch (1898:18): [True: 355k, False: 14.6k]
  |  Branch (1898:32): [True: 5.70k, False: 8.96k]
  |  Branch (1898:46): [True: 4.42k, False: 4.54k]
  |  Branch (1898:60): [True: 4.44k, False: 93]
  ------------------
 1899|   370k|  }
_ZN11flexbuffers8Verifier9VerifyRefENS_9ReferenceE:
 1990|   366k|  bool VerifyRef(Reference r) {
 1991|       |    // r.parent_width_ and r.data_ already verified.
 1992|   366k|    if (!VerifyByteWidth(r.byte_width_) || !VerifyType(r.type_)) {
  ------------------
  |  Branch (1992:9): [True: 0, False: 366k]
  |  Branch (1992:44): [True: 21, False: 365k]
  ------------------
 1993|     21|      return false;
 1994|     21|    }
 1995|   365k|    if (IsInline(r.type_)) {
  ------------------
  |  Branch (1995:9): [True: 191k, False: 174k]
  ------------------
 1996|       |      // Inline scalars, don't require further verification.
 1997|   191k|      return true;
 1998|   191k|    }
 1999|       |    // All remaining types are an offset.
 2000|   174k|    auto off = ReadUInt64(r.data_, r.parent_width_);
 2001|   174k|    if (!VerifyOffset(off, r.data_)) return false;
  ------------------
  |  Branch (2001:9): [True: 218, False: 174k]
  ------------------
 2002|   174k|    auto p = r.Indirect();
 2003|   174k|    if (!VerifyAlignment(p, r.byte_width_)) return false;
  ------------------
  |  Branch (2003:9): [True: 35, False: 174k]
  ------------------
 2004|   174k|    switch (r.type_) {
 2005|    801|      case FBT_INDIRECT_INT:
  ------------------
  |  Branch (2005:7): [True: 801, False: 173k]
  ------------------
 2006|  2.53k|      case FBT_INDIRECT_UINT:
  ------------------
  |  Branch (2006:7): [True: 1.73k, False: 172k]
  ------------------
 2007|  6.88k|      case FBT_INDIRECT_FLOAT:
  ------------------
  |  Branch (2007:7): [True: 4.34k, False: 170k]
  ------------------
 2008|  6.88k|        return VerifyFromPointer(p, r.byte_width_);
 2009|  90.8k|      case FBT_KEY:
  ------------------
  |  Branch (2009:7): [True: 90.8k, False: 83.5k]
  ------------------
 2010|  90.8k|        return VerifyKey(p);
 2011|  4.97k|      case FBT_MAP:
  ------------------
  |  Branch (2011:7): [True: 4.97k, False: 169k]
  ------------------
 2012|  4.97k|        return VerifyVector(r, p, FBT_NULL) && VerifyKeys(p, r.byte_width_);
  ------------------
  |  Branch (2012:16): [True: 3.31k, False: 1.66k]
  |  Branch (2012:48): [True: 2.91k, False: 397]
  ------------------
 2013|  6.68k|      case FBT_VECTOR:
  ------------------
  |  Branch (2013:7): [True: 6.68k, False: 167k]
  ------------------
 2014|  6.68k|        return VerifyVector(r, p, FBT_NULL);
 2015|    333|      case FBT_VECTOR_INT:
  ------------------
  |  Branch (2015:7): [True: 333, False: 174k]
  ------------------
 2016|    333|        return VerifyVector(r, p, FBT_INT);
 2017|    220|      case FBT_VECTOR_BOOL:
  ------------------
  |  Branch (2017:7): [True: 220, False: 174k]
  ------------------
 2018|  45.7k|      case FBT_VECTOR_UINT:
  ------------------
  |  Branch (2018:7): [True: 45.5k, False: 128k]
  ------------------
 2019|  45.7k|        return VerifyVector(r, p, FBT_UINT);
 2020|  7.57k|      case FBT_VECTOR_FLOAT:
  ------------------
  |  Branch (2020:7): [True: 7.57k, False: 166k]
  ------------------
 2021|  7.57k|        return VerifyVector(r, p, FBT_FLOAT);
 2022|    482|      case FBT_VECTOR_KEY:
  ------------------
  |  Branch (2022:7): [True: 482, False: 173k]
  ------------------
 2023|    482|        return VerifyVector(r, p, FBT_KEY);
 2024|    780|      case FBT_VECTOR_STRING_DEPRECATED:
  ------------------
  |  Branch (2024:7): [True: 780, False: 173k]
  ------------------
 2025|       |        // Use of FBT_KEY here intentional, see elsewhere.
 2026|    780|        return VerifyVector(r, p, FBT_KEY);
 2027|    552|      case FBT_BLOB:
  ------------------
  |  Branch (2027:7): [True: 552, False: 173k]
  ------------------
 2028|    552|        return VerifyVector(r, p, FBT_UINT);
 2029|  2.18k|      case FBT_STRING:
  ------------------
  |  Branch (2029:7): [True: 2.18k, False: 172k]
  ------------------
 2030|  2.18k|        return VerifyVector(r, p, FBT_UINT) &&
  ------------------
  |  Branch (2030:16): [True: 2.11k, False: 66]
  ------------------
 2031|  2.11k|               VerifyTerminator(String(p, r.byte_width_));
  ------------------
  |  Branch (2031:16): [True: 2.11k, False: 4]
  ------------------
 2032|    642|      case FBT_VECTOR_INT2:
  ------------------
  |  Branch (2032:7): [True: 642, False: 173k]
  ------------------
 2033|  1.31k|      case FBT_VECTOR_UINT2:
  ------------------
  |  Branch (2033:7): [True: 669, False: 173k]
  ------------------
 2034|  3.42k|      case FBT_VECTOR_FLOAT2:
  ------------------
  |  Branch (2034:7): [True: 2.11k, False: 172k]
  ------------------
 2035|  4.01k|      case FBT_VECTOR_INT3:
  ------------------
  |  Branch (2035:7): [True: 587, False: 173k]
  ------------------
 2036|  4.33k|      case FBT_VECTOR_UINT3:
  ------------------
  |  Branch (2036:7): [True: 316, False: 174k]
  ------------------
 2037|  4.97k|      case FBT_VECTOR_FLOAT3:
  ------------------
  |  Branch (2037:7): [True: 648, False: 173k]
  ------------------
 2038|  5.83k|      case FBT_VECTOR_INT4:
  ------------------
  |  Branch (2038:7): [True: 856, False: 173k]
  ------------------
 2039|  6.16k|      case FBT_VECTOR_UINT4:
  ------------------
  |  Branch (2039:7): [True: 331, False: 174k]
  ------------------
 2040|  7.35k|      case FBT_VECTOR_FLOAT4: {
  ------------------
  |  Branch (2040:7): [True: 1.18k, False: 173k]
  ------------------
 2041|  7.35k|        uint8_t len = 0;
 2042|  7.35k|        auto vtype = ToFixedTypedVectorElementType(r.type_, &len);
 2043|  7.35k|        if (!VerifyType(vtype)) return false;
  ------------------
  |  Branch (2043:13): [True: 0, False: 7.35k]
  ------------------
 2044|  7.35k|        return VerifyFromPointer(p, static_cast<size_t>(r.byte_width_) * len);
 2045|  7.35k|      }
 2046|      7|      default:
  ------------------
  |  Branch (2046:7): [True: 7, False: 174k]
  ------------------
 2047|      7|        return false;
 2048|   174k|    }
 2049|   174k|  }
_ZN11flexbuffers8Verifier10VerifyTypeEi:
 1901|   373k|  bool VerifyType(int type) { return Check(type >= 0 && type < FBT_MAX_TYPE); }
  ------------------
  |  Branch (1901:44): [True: 373k, False: 0]
  |  Branch (1901:57): [True: 373k, False: 21]
  ------------------
_ZN11flexbuffers8IsInlineENS_4TypeE:
   89|   420k|inline bool IsInline(Type t) { return t <= FBT_FLOAT || t == FBT_BOOL; }
  ------------------
  |  Branch (89:39): [True: 245k, False: 175k]
  |  Branch (89:57): [True: 428, False: 174k]
  ------------------
_ZN11flexbuffers10ReadUInt64EPKhh:
  160|   437k|inline uint64_t ReadUInt64(const uint8_t* data, uint8_t byte_width) {
  161|       |  // This is the "hottest" function (all offset lookups use this), so worth
  162|       |  // optimizing if possible.
  163|       |  // TODO: GCC apparently replaces memcpy by a rep movsb, but only if count is a
  164|       |  // constant, which here it isn't. Test if memcpy is still faster than
  165|       |  // the conditionals in ReadSizedScalar. Can also use inline asm.
  166|       |
  167|       |  // clang-format off
  168|       |  #if defined(_MSC_VER) && defined(_M_X64) && !defined(_M_ARM64EC)
  169|       |  // This is 64-bit Windows only, __movsb does not work on 32-bit Windows.
  170|       |    uint64_t u = 0;
  171|       |    __movsb(reinterpret_cast<uint8_t *>(&u),
  172|       |            reinterpret_cast<const uint8_t *>(data), byte_width);
  173|       |    return flatbuffers::EndianScalar(u);
  174|       |  #else
  175|   437k|    return ReadSizedScalar<uint64_t, uint8_t, uint16_t, uint32_t, uint64_t>(
  176|   437k|             data, byte_width);
  177|   437k|  #endif
  178|       |  // clang-format on
  179|   437k|}
_ZN11flexbuffers15ReadSizedScalarImhtjmEET_PKhh:
  145|   437k|R ReadSizedScalar(const uint8_t* data, uint8_t byte_width) {
  146|   437k|  return byte_width < 4
  ------------------
  |  Branch (146:10): [True: 428k, False: 9.65k]
  ------------------
  147|   437k|             ? (byte_width < 2
  ------------------
  |  Branch (147:17): [True: 161k, False: 266k]
  ------------------
  148|   428k|                    ? static_cast<R>(flatbuffers::ReadScalar<T1>(data))
  149|   428k|                    : static_cast<R>(flatbuffers::ReadScalar<T2>(data)))
  150|   437k|             : (byte_width < 8
  ------------------
  |  Branch (150:17): [True: 5.36k, False: 4.29k]
  ------------------
  151|  9.65k|                    ? static_cast<R>(flatbuffers::ReadScalar<T4>(data))
  152|  9.65k|                    : static_cast<R>(flatbuffers::ReadScalar<T8>(data)));
  153|   437k|}
_ZN11flexbuffers8Verifier12VerifyOffsetEmPKh:
 1903|   177k|  bool VerifyOffset(uint64_t off, const uint8_t* p) {
 1904|   177k|    return Check(off <= static_cast<uint64_t>(size_)) &&
  ------------------
  |  Branch (1904:12): [True: 177k, False: 262]
  ------------------
 1905|   177k|           off <= static_cast<uint64_t>(p - buf_);
  ------------------
  |  Branch (1905:12): [True: 177k, False: 122]
  ------------------
 1906|   177k|  }
_ZNK11flexbuffers9Reference8IndirectEv:
  819|   174k|  const uint8_t* Indirect() const {
  820|   174k|    return flexbuffers::Indirect(data_, parent_width_);
  821|   174k|  }
_ZN11flexbuffers8IndirectEPKhh:
  186|   174k|inline const uint8_t* Indirect(const uint8_t* offset, uint8_t byte_width) {
  187|   174k|  return offset - ReadUInt64(offset, byte_width);
  188|   174k|}
_ZNK11flexbuffers8Verifier15VerifyAlignmentEPKhm:
 1908|   174k|  bool VerifyAlignment(const uint8_t* p, size_t size) const {
 1909|   174k|    auto o = static_cast<size_t>(p - buf_);
 1910|   174k|    return Check((o & (size - 1)) == 0 || !check_alignment_);
  ------------------
  |  Branch (1910:18): [True: 174k, False: 35]
  |  Branch (1910:43): [True: 0, False: 35]
  ------------------
 1911|   174k|  }
_ZN11flexbuffers8Verifier17VerifyFromPointerEPKhm:
 1888|  93.3k|  bool VerifyFromPointer(const uint8_t* p, size_t len) {
 1889|  93.3k|    auto o = static_cast<size_t>(p - buf_);
 1890|  93.3k|    return VerifyFrom(o, len);
 1891|  93.3k|  }
_ZNK11flexbuffers8Verifier10VerifyFromEmm:
 1881|  93.3k|  bool VerifyFrom(size_t elem, size_t elem_len) const {
 1882|  93.3k|    return Check(elem_len < size_ && elem <= size_ - elem_len);
  ------------------
  |  Branch (1882:18): [True: 93.0k, False: 219]
  |  Branch (1882:38): [True: 93.0k, False: 86]
  ------------------
 1883|  93.3k|  }
_ZN11flexbuffers8Verifier9VerifyKeyEPKh:
 1976|  90.8k|  bool VerifyKey(const uint8_t* p) {
 1977|  90.8k|    FLEX_CHECK_VERIFIED(p, PackedType(BIT_WIDTH_8, FBT_KEY));
  ------------------
  |  | 1915|  90.8k|  if (reuse_tracker_) {                                         \
  |  |  ------------------
  |  |  |  Branch (1915:7): [True: 90.8k, False: 0]
  |  |  ------------------
  |  | 1916|  90.8k|    auto packed_type = PACKED_TYPE;                             \
  |  | 1917|  90.8k|    auto existing = (*reuse_tracker_)[P - buf_];                \
  |  | 1918|  90.8k|    if (existing == packed_type) return true;                   \
  |  |  ------------------
  |  |  |  Branch (1918:9): [True: 14.1k, False: 76.7k]
  |  |  ------------------
  |  | 1919|  90.8k|    /* Fail verification if already set with different type! */ \
  |  | 1920|  90.8k|    if (!Check(existing == 0)) return false;                    \
  |  |  ------------------
  |  |  |  Branch (1920:9): [True: 14, False: 76.7k]
  |  |  ------------------
  |  | 1921|  76.7k|    (*reuse_tracker_)[P - buf_] = packed_type;                  \
  |  | 1922|  76.7k|  }
  ------------------
 1978|  1.94M|    while (p < buf_ + size_)
  ------------------
  |  Branch (1978:12): [True: 1.94M, False: 11]
  ------------------
 1979|  1.94M|      if (!*p++) return true;
  ------------------
  |  Branch (1979:11): [True: 76.7k, False: 1.86M]
  ------------------
 1980|     11|    return false;
 1981|  76.7k|  }
_ZN11flexbuffers8Verifier12VerifyVectorENS_9ReferenceEPKhNS_4TypeE:
 1924|  72.3k|  bool VerifyVector(Reference r, const uint8_t* p, Type elem_type) {
 1925|       |    // Any kind of nesting goes thru this function, so guard against that
 1926|       |    // here, both with simple nesting checks, and the reuse tracker if on.
 1927|  72.3k|    depth_++;
 1928|  72.3k|    num_vectors_++;
 1929|  72.3k|    if (!Check(depth_ <= max_depth_ && num_vectors_ <= max_vectors_))
  ------------------
  |  Branch (1929:9): [True: 69, False: 72.3k]
  |  Branch (1929:16): [True: 72.3k, False: 29]
  |  Branch (1929:40): [True: 72.3k, False: 40]
  ------------------
 1930|     69|      return false;
 1931|  72.3k|    auto size_byte_width = r.byte_width_;
 1932|  72.3k|    if (!VerifyBeforePointer(p, size_byte_width)) return false;
  ------------------
  |  Branch (1932:9): [True: 38, False: 72.2k]
  ------------------
 1933|  72.2k|    FLEX_CHECK_VERIFIED(p - size_byte_width,
  ------------------
  |  | 1915|  72.2k|  if (reuse_tracker_) {                                         \
  |  |  ------------------
  |  |  |  Branch (1915:7): [True: 72.2k, False: 0]
  |  |  ------------------
  |  | 1916|  72.2k|    auto packed_type = PACKED_TYPE;                             \
  |  | 1917|  72.2k|    auto existing = (*reuse_tracker_)[P - buf_];                \
  |  | 1918|  72.2k|    if (existing == packed_type) return true;                   \
  |  |  ------------------
  |  |  |  Branch (1918:9): [True: 4.57k, False: 67.6k]
  |  |  ------------------
  |  | 1919|  72.2k|    /* Fail verification if already set with different type! */ \
  |  | 1920|  72.2k|    if (!Check(existing == 0)) return false;                    \
  |  |  ------------------
  |  |  |  Branch (1920:9): [True: 44, False: 67.6k]
  |  |  ------------------
  |  | 1921|  67.6k|    (*reuse_tracker_)[P - buf_] = packed_type;                  \
  |  | 1922|  67.6k|  }
  ------------------
 1934|  72.2k|                        PackedType(Builder::WidthB(size_byte_width), r.type_));
 1935|  67.6k|    auto sized = Sized(p, size_byte_width);
 1936|  67.6k|    auto num_elems = sized.size();
 1937|  67.6k|    auto elem_byte_width = r.type_ == FBT_STRING || r.type_ == FBT_BLOB
  ------------------
  |  Branch (1937:28): [True: 1.67k, False: 65.9k]
  |  Branch (1937:53): [True: 427, False: 65.5k]
  ------------------
 1938|  67.6k|                               ? uint8_t(1)
 1939|  67.6k|                               : r.byte_width_;
 1940|  67.6k|    auto max_elems = SIZE_MAX / elem_byte_width;
 1941|  67.6k|    if (!Check(num_elems < max_elems))
  ------------------
  |  Branch (1941:9): [True: 14, False: 67.6k]
  ------------------
 1942|     14|      return false;  // Protect against byte_size overflowing.
 1943|  67.6k|    auto byte_size = num_elems * elem_byte_width;
 1944|  67.6k|    if (!VerifyFromPointer(p, byte_size)) return false;
  ------------------
  |  Branch (1944:9): [True: 220, False: 67.4k]
  ------------------
 1945|  67.4k|    if (elem_type == FBT_NULL) {
  ------------------
  |  Branch (1945:9): [True: 9.33k, False: 58.0k]
  ------------------
 1946|       |      // Verify type bytes after the vector.
 1947|  9.33k|      if (!VerifyFromPointer(p + byte_size, num_elems)) return false;
  ------------------
  |  Branch (1947:11): [True: 48, False: 9.28k]
  ------------------
 1948|  9.28k|      auto v = Vector(p, size_byte_width);
 1949|   279k|      for (size_t i = 0; i < num_elems; i++)
  ------------------
  |  Branch (1949:26): [True: 273k, False: 6.13k]
  ------------------
 1950|   273k|        if (!VerifyRef(v[i])) return false;
  ------------------
  |  Branch (1950:13): [True: 3.15k, False: 270k]
  ------------------
 1951|  58.0k|    } else if (elem_type == FBT_KEY) {
  ------------------
  |  Branch (1951:16): [True: 3.23k, False: 54.8k]
  ------------------
 1952|  3.23k|      auto v = TypedVector(p, elem_byte_width, FBT_KEY);
 1953|  94.0k|      for (size_t i = 0; i < num_elems; i++)
  ------------------
  |  Branch (1953:26): [True: 90.8k, False: 3.16k]
  ------------------
 1954|  90.8k|        if (!VerifyRef(v[i])) return false;
  ------------------
  |  Branch (1954:13): [True: 65, False: 90.7k]
  ------------------
 1955|  54.8k|    } else {
 1956|  54.8k|      FLATBUFFERS_ASSERT(IsInline(elem_type));
 1957|  54.8k|    }
 1958|  64.1k|    depth_--;
 1959|  64.1k|    return true;
 1960|  67.4k|  }
_ZN11flexbuffers8Verifier19VerifyBeforePointerEPKhm:
 1892|  75.6k|  bool VerifyBeforePointer(const uint8_t* p, size_t len) {
 1893|  75.6k|    auto o = static_cast<size_t>(p - buf_);
 1894|  75.6k|    return VerifyBefore(o, len);
 1895|  75.6k|  }
_ZNK11flexbuffers8Verifier12VerifyBeforeEmm:
 1884|  75.6k|  bool VerifyBefore(size_t elem, size_t elem_len) const {
 1885|  75.6k|    return Check(elem_len <= elem);
 1886|  75.6k|  }
_ZN11flexbuffers7Builder6WidthBEm:
 1584|  72.2k|  static BitWidth WidthB(size_t byte_width) {
 1585|  72.2k|    switch (byte_width) {
 1586|  66.3k|      case 1:
  ------------------
  |  Branch (1586:7): [True: 66.3k, False: 5.94k]
  ------------------
 1587|  66.3k|        return BIT_WIDTH_8;
 1588|  2.29k|      case 2:
  ------------------
  |  Branch (1588:7): [True: 2.29k, False: 69.9k]
  ------------------
 1589|  2.29k|        return BIT_WIDTH_16;
 1590|  2.10k|      case 4:
  ------------------
  |  Branch (1590:7): [True: 2.10k, False: 70.1k]
  ------------------
 1591|  2.10k|        return BIT_WIDTH_32;
 1592|  1.53k|      case 8:
  ------------------
  |  Branch (1592:7): [True: 1.53k, False: 70.7k]
  ------------------
 1593|  1.53k|        return BIT_WIDTH_64;
 1594|      0|      default:
  ------------------
  |  Branch (1594:7): [True: 0, False: 72.2k]
  ------------------
 1595|      0|        FLATBUFFERS_ASSERT(false);
 1596|      0|        return BIT_WIDTH_64;
 1597|  72.2k|    }
 1598|  72.2k|  }
_ZN11flexbuffers5SizedC2EPKhh:
  234|  82.2k|      : Object(data, byte_width), size_(read_size()) {}
_ZN11flexbuffers6ObjectC2EPKhh:
  222|  82.2k|      : data_(data), byte_width_(byte_width) {}
_ZNK11flexbuffers5Sized9read_sizeEv:
  240|  82.2k|  size_t read_size() const {
  241|  82.2k|    return static_cast<size_t>(ReadUInt64(data_ - byte_width_, byte_width_));
  242|  82.2k|  }
_ZNK11flexbuffers5Sized4sizeEv:
  238|   434k|  size_t size() const { return size_; }
_ZN11flexbuffers6VectorC2EPKhh:
  282|  9.28k|  Vector(const uint8_t* data, uint8_t byte_width) : Sized(data, byte_width) {}
_ZNK11flexbuffers6VectorixEm:
  946|   273k|inline Reference Vector::operator[](size_t i) const {
  947|   273k|  auto len = size();
  948|   273k|  if (i >= len) return Reference(nullptr, 1, NullPackedType());
  ------------------
  |  Branch (948:7): [True: 0, False: 273k]
  ------------------
  949|   273k|  auto packed_type = (data_ + len * byte_width_)[i];
  950|   273k|  auto elem = data_ + i * byte_width_;
  951|   273k|  return Reference(elem, byte_width_, packed_type);
  952|   273k|}
_ZN11flexbuffers11TypedVectorC2EPKhhNS_4TypeE:
  296|  3.23k|      : Sized(data, byte_width), type_(element_type) {}
_ZNK11flexbuffers11TypedVectorixEm:
  954|  90.8k|inline Reference TypedVector::operator[](size_t i) const {
  955|  90.8k|  auto len = size();
  956|  90.8k|  if (i >= len) return Reference(nullptr, 1, NullPackedType());
  ------------------
  |  Branch (956:7): [True: 0, False: 90.8k]
  ------------------
  957|  90.8k|  auto elem = data_ + i * byte_width_;
  958|  90.8k|  return Reference(elem, byte_width_, 1, type_);
  959|  90.8k|}
_ZN11flexbuffers9ReferenceC2EPKhhhNS_4TypeE:
  411|  93.8k|      : data_(data),
  412|  93.8k|        parent_width_(parent_width),
  413|  93.8k|        byte_width_(byte_width),
  414|  93.8k|        type_(type) {}
_ZN11flexbuffers8Verifier10VerifyKeysEPKhh:
 1962|  3.31k|  bool VerifyKeys(const uint8_t* p, uint8_t byte_width) {
 1963|       |    // The vector part of the map has already been verified.
 1964|  3.31k|    const size_t num_prefixed_fields = 3;
 1965|  3.31k|    if (!VerifyBeforePointer(p, byte_width * num_prefixed_fields)) return false;
  ------------------
  |  Branch (1965:9): [True: 53, False: 3.25k]
  ------------------
 1966|  3.25k|    p -= byte_width * num_prefixed_fields;
 1967|  3.25k|    auto off = ReadUInt64(p, byte_width);
 1968|  3.25k|    if (!VerifyOffset(off, p)) return false;
  ------------------
  |  Branch (1968:9): [True: 166, False: 3.09k]
  ------------------
 1969|  3.09k|    auto key_byte_with =
 1970|  3.09k|        static_cast<uint8_t>(ReadUInt64(p + byte_width, byte_width));
 1971|  3.09k|    if (!VerifyByteWidth(key_byte_with)) return false;
  ------------------
  |  Branch (1971:9): [True: 61, False: 3.03k]
  ------------------
 1972|  3.03k|    return VerifyVector(Reference(p, byte_width, key_byte_with, FBT_VECTOR_KEY),
 1973|  3.03k|                        p - off, FBT_KEY);
 1974|  3.09k|  }
_ZN11flexbuffers8Verifier16VerifyTerminatorERKNS_6StringE:
 1985|  2.11k|  bool VerifyTerminator(const String& s) {
 1986|  2.11k|    return VerifyFromPointer(reinterpret_cast<const uint8_t*>(s.c_str()),
 1987|  2.11k|                             s.size() + 1);
 1988|  2.11k|  }
_ZNK11flexbuffers6String5c_strEv:
  257|  2.11k|  const char* c_str() const { return reinterpret_cast<const char*>(data_); }
_ZN11flexbuffers6StringC2EPKhh:
  251|  2.11k|  String(const uint8_t* data, uint8_t byte_width) : Sized(data, byte_width) {}
_ZN11flexbuffers29ToFixedTypedVectorElementTypeENS_4TypeEPh:
  126|  7.35k|inline Type ToFixedTypedVectorElementType(Type t, uint8_t* len) {
  127|  7.35k|  FLATBUFFERS_ASSERT(IsFixedTypedVector(t));
  128|  7.35k|  auto fixed_type = t - FBT_VECTOR_INT2;
  129|  7.35k|  *len = static_cast<uint8_t>(fixed_type / 3 +
  130|  7.35k|                              2);  // 3 types each, starting from length 2.
  131|  7.35k|  return static_cast<Type>(fixed_type % 3 + FBT_INT);
  132|  7.35k|}
_ZN11flexbuffers18IsFixedTypedVectorENS_4TypeE:
  100|  7.35k|inline bool IsFixedTypedVector(Type t) {
  101|  7.35k|  return t >= FBT_VECTOR_INT2 && t <= FBT_VECTOR_FLOAT4;
  ------------------
  |  Branch (101:10): [True: 7.35k, False: 0]
  |  Branch (101:34): [True: 7.35k, False: 0]
  ------------------
  102|  7.35k|}
_ZN11flexbuffers9ReferenceC2EPKhhh:
  417|   275k|      : data_(data),
  418|   275k|        parent_width_(parent_width),
  419|   275k|        byte_width_(static_cast<uint8_t>(1 << (packed_type & 3))),
  420|   275k|        type_(static_cast<Type>(packed_type >> 2)) {}

LLVMFuzzerTestOneInput:
   11|  1.35k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   12|  1.35k|  std::vector<uint8_t> reuse_tracker;
   13|       |  // Check both with and without reuse tracker paths.
   14|  1.35k|  flexbuffers::VerifyBuffer(data, size, &reuse_tracker);
   15|       |  // FIXME: we can't really verify this path, because the fuzzer will
   16|       |  // construct buffers that time out.
   17|       |  // Add a simple #define to bound the number of steps just for the fuzzer?
   18|       |  // flexbuffers::VerifyBuffer(data, size, nullptr);
   19|  1.35k|  return 0;
   20|  1.35k|}

