_ZN5Botan13reverse_bytesEt:
   19|  9.57k|inline constexpr uint16_t reverse_bytes(uint16_t x) {
   20|  9.57k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap16)
   21|  9.57k|   return __builtin_bswap16(x);
   22|       |#else
   23|       |   return static_cast<uint16_t>((x << 8) | (x >> 8));
   24|       |#endif
   25|  9.57k|}
_ZN5Botan13reverse_bytesEj:
   33|    701|inline constexpr uint32_t reverse_bytes(uint32_t x) {
   34|    701|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap32)
   35|    701|   return __builtin_bswap32(x);
   36|       |#else
   37|       |   // MSVC at least recognizes this as a bswap
   38|       |   return ((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8) | ((x & 0xFF000000) >> 24);
   39|       |#endif
   40|    701|}

_ZN5Botan2CT4MaskIhEC2Eh:
  280|  23.5k|      Mask(T m) : m_mask(m) {}
_ZNK5Botan2CT4MaskIhE5valueEv:
  277|  23.5k|      T value() const { return m_mask; }
_ZN5Botan2CT4MaskIhE3setEv:
   99|  23.5k|      static Mask<T> set() { return Mask<T>(static_cast<T>(~0)); }
_ZNK5Botan2CT4MaskIhE7as_boolEv:
  272|  23.5k|      bool as_bool() const { return unpoisoned_value() != 0; }
_ZNK5Botan2CT4MaskIhE16unpoisoned_valueEv:
  263|  23.5k|      T unpoisoned_value() const {
  264|  23.5k|         T r = value();
  265|  23.5k|         CT::unpoison(r);
  266|  23.5k|         return r;
  267|  23.5k|      }
_ZN5Botan2CT8unpoisonIhEEvRT_:
   64|  23.5k|inline void unpoison(T& p) {
   65|       |#if defined(BOTAN_HAS_VALGRIND)
   66|       |   VALGRIND_MAKE_MEM_DEFINED(&p, sizeof(T));
   67|       |#else
   68|  23.5k|   BOTAN_UNUSED(p);
  ------------------
  |  |  118|  23.5k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
   69|  23.5k|#endif
   70|  23.5k|}

_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|  1.50k|inline void do_fmt(std::ostringstream& oss, std::string_view format) {
   21|  1.50k|   oss << format;
   22|  1.50k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|  1.17k|std::string fmt(std::string_view format, const T&... args) {
   54|  1.17k|   std::ostringstream oss;
   55|  1.17k|   oss.imbue(std::locale::classic());
   56|  1.17k|   fmt_detail::do_fmt(oss, format, args...);
   57|  1.17k|   return oss.str();
   58|  1.17k|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|  1.17k|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|  1.17k|   size_t i = 0;
   27|       |
   28|  7.05k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 7.05k, False: 0]
  ------------------
   29|  7.05k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 1.17k, False: 5.88k]
  |  Branch (29:30): [True: 1.17k, False: 0]
  |  Branch (29:59): [True: 1.17k, False: 0]
  ------------------
   30|  1.17k|         oss << val;
   31|  1.17k|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  5.88k|      } else {
   33|  5.88k|         oss << format[i];
   34|  5.88k|      }
   35|       |
   36|  5.88k|      i += 1;
   37|  5.88k|   }
   38|  1.17k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEjEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|     92|std::string fmt(std::string_view format, const T&... args) {
   54|     92|   std::ostringstream oss;
   55|     92|   oss.imbue(std::locale::classic());
   56|     92|   fmt_detail::do_fmt(oss, format, args...);
   57|     92|   return oss.str();
   58|     92|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJjEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|     92|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     92|   size_t i = 0;
   27|       |
   28|     92|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 92, False: 0]
  ------------------
   29|     92|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 92, False: 0]
  |  Branch (29:30): [True: 92, False: 0]
  |  Branch (29:59): [True: 92, False: 0]
  ------------------
   30|     92|         oss << val;
   31|     92|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|     92|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|     92|}
_ZN5Botan10fmt_detail6do_fmtIjJEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    324|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    324|   size_t i = 0;
   27|       |
   28|  8.16k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 8.16k, False: 0]
  ------------------
   29|  8.16k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 324, False: 7.84k]
  |  Branch (29:30): [True: 324, False: 0]
  |  Branch (29:59): [True: 324, False: 0]
  ------------------
   30|    324|         oss << val;
   31|    324|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  7.84k|      } else {
   33|  7.84k|         oss << format[i];
   34|  7.84k|      }
   35|       |
   36|  7.84k|      i += 1;
   37|  7.84k|   }
   38|    324|}
_ZN5Botan3fmtIJjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EEDpRKT_:
   53|    232|std::string fmt(std::string_view format, const T&... args) {
   54|    232|   std::ostringstream oss;
   55|    232|   oss.imbue(std::locale::classic());
   56|    232|   fmt_detail::do_fmt(oss, format, args...);
   57|    232|   return oss.str();
   58|    232|}

_ZN5Botan8get_byteILm0EmEEhT0_:
   39|    898|{
   40|    898|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   41|    898|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   42|    898|}
_ZN5Botan7load_beItEET_PKhm:
  226|  9.57k|inline constexpr T load_be(const uint8_t in[], size_t off) {
  227|       |   // asserts that *in points to the correct amount of memory
  228|  9.57k|   return load_be<T>(std::span<const uint8_t, sizeof(T)>(in + off * sizeof(T), sizeof(T)));
  229|  9.57k|}
_ZN5Botan7load_beItNSt3__14spanIKhLm2EEEEET_OT0_:
   92|  9.57k|inline constexpr T load_be(InR&& in_range) {
   93|  9.57k|   ranges::assert_exact_byte_length<sizeof(T)>(in_range);
   94|  9.57k|   std::span in{in_range};
   95|  9.57k|   if constexpr(sizeof(T) == 1) {
  ------------------
  |  Branch (95:17): [Folded - Ignored]
  ------------------
   96|  9.57k|      return static_cast<T>(in[0]);
   97|  9.57k|   } else {
   98|       |#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
   99|       |      return typecast_copy<T>(in);
  100|       |#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
  101|  9.57k|      return reverse_bytes(typecast_copy<T>(in));
  102|       |#else
  103|       |      return [&]<size_t... i>(std::index_sequence<i...>) {
  104|       |         return ((static_cast<T>(in[i]) << ((sizeof(T) - i - 1) * 8)) | ...);
  105|       |      }
  106|       |      (std::make_index_sequence<sizeof(T)>());
  107|       |#endif
  108|  9.57k|   }
  109|  9.57k|}
_ZN5Botan7load_beIjEET_PKhm:
  226|    701|inline constexpr T load_be(const uint8_t in[], size_t off) {
  227|       |   // asserts that *in points to the correct amount of memory
  228|    701|   return load_be<T>(std::span<const uint8_t, sizeof(T)>(in + off * sizeof(T), sizeof(T)));
  229|    701|}
_ZN5Botan7load_beIjNSt3__14spanIKhLm4EEEEET_OT0_:
   92|    701|inline constexpr T load_be(InR&& in_range) {
   93|    701|   ranges::assert_exact_byte_length<sizeof(T)>(in_range);
   94|    701|   std::span in{in_range};
   95|    701|   if constexpr(sizeof(T) == 1) {
  ------------------
  |  Branch (95:17): [Folded - Ignored]
  ------------------
   96|    701|      return static_cast<T>(in[0]);
   97|    701|   } else {
   98|       |#if defined(BOTAN_TARGET_CPU_IS_BIG_ENDIAN)
   99|       |      return typecast_copy<T>(in);
  100|       |#elif defined(BOTAN_TARGET_CPU_IS_LITTLE_ENDIAN)
  101|    701|      return reverse_bytes(typecast_copy<T>(in));
  102|       |#else
  103|       |      return [&]<size_t... i>(std::index_sequence<i...>) {
  104|       |         return ((static_cast<T>(in[i]) << ((sizeof(T) - i - 1) * 8)) | ...);
  105|       |      }
  106|       |      (std::make_index_sequence<sizeof(T)>());
  107|       |#endif
  108|    701|   }
  109|    701|}

_ZN5Botan11checked_addEmmPKci:
   30|   389k|inline size_t checked_add(size_t x, size_t y, const char* file, int line) {
   31|   389k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_add_overflow)
   32|   389k|   size_t z;
   33|   389k|   if(__builtin_add_overflow(x, y, &z)) [[unlikely]]
  ------------------
  |  Branch (33:7): [True: 0, False: 389k]
  ------------------
   34|       |#elif defined(_MSC_VER)
   35|       |   size_t z;
   36|       |   if(SizeTAdd(x, y, &z) != S_OK) [[unlikely]]
   37|       |#else
   38|       |   size_t z = x + y;
   39|       |   if(z < x) [[unlikely]]
   40|       |#endif
   41|      0|   {
   42|      0|      throw Integer_Overflow_Detected(file, line);
   43|      0|   }
   44|   389k|   return z;
   45|   389k|}
_ZN5Botan11checked_mulEmm:
   47|   124k|inline std::optional<size_t> checked_mul(size_t x, size_t y) {
   48|   124k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_add_overflow)
   49|   124k|   size_t z;
   50|   124k|   if(__builtin_mul_overflow(x, y, &z)) [[unlikely]]
  ------------------
  |  Branch (50:7): [True: 0, False: 124k]
  ------------------
   51|       |#elif defined(_MSC_VER)
   52|       |   size_t z;
   53|       |   if(SizeTMult(x, y, &z) != S_OK) [[unlikely]]
   54|       |#else
   55|       |   size_t z = x * y;
   56|       |   if(y && z / y != x) [[unlikely]]
   57|       |#endif
   58|      0|   {
   59|      0|      return std::nullopt;
   60|      0|   }
   61|   124k|   return z;
   62|   124k|}

_ZN5Botan15multimap_insertINS_3OIDENSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEvRNS2_8multimapIT_T0_NS2_4lessISA_EENS6_INS2_4pairIKSA_SB_EEEEEERSF_RKSB_:
  109|  52.1k|void multimap_insert(std::multimap<K, V>& multimap, const K& key, const V& value) {
  110|  52.1k|   multimap.insert(std::make_pair(key, value));
  111|  52.1k|}

_ZN5Botan11ASN1_ObjectC2Ev:
  117|  51.3k|      ASN1_Object() = default;
_ZN5Botan11ASN1_ObjectD2Ev:
  120|   286k|      virtual ~ASN1_Object() = default;
_ZN5Botan10BER_ObjectC2Ev:
  128|   119k|      BER_Object() : m_type_tag(ASN1_Type::NoObject), m_class_tag(ASN1_Class::Universal) {}
_ZNK5Botan10BER_Object6is_setEv:
  138|   173k|      bool is_set() const { return m_type_tag != ASN1_Type::NoObject; }
_ZNK5Botan10BER_Object7taggingEv:
  140|   105k|      uint32_t tagging() const { return type_tag() | class_tag(); }
_ZNK5Botan10BER_Object8type_tagEv:
  142|   105k|      ASN1_Type type_tag() const { return m_type_tag; }
_ZNK5Botan10BER_Object9class_tagEv:
  144|   105k|      ASN1_Class class_tag() const { return m_class_tag; }
_ZNK5Botan10BER_Object4typeEv:
  146|  46.5k|      ASN1_Type type() const { return m_type_tag; }
_ZNK5Botan10BER_Object4bitsEv:
  150|   831k|      const uint8_t* bits() const { return m_value.data(); }
_ZNK5Botan10BER_Object6lengthEv:
  152|  1.76M|      size_t length() const { return m_value.size(); }
_ZN5Botan10BER_Object12mutable_bitsEm:
  169|  82.3k|      uint8_t* mutable_bits(size_t length) {
  170|  82.3k|         m_value.resize(length);
  171|  82.3k|         return m_value.data();
  172|  82.3k|      }
_ZNK5Botan3OID14get_componentsEv:
  277|   928k|      const std::vector<uint32_t>& get_components() const { return m_id; }
_ZNK5Botan3OIDeqERKS0_:
  309|  1.80k|      bool operator==(const OID& other) const { return m_id == other.m_id; }
_ZNK5Botan11ASN1_String5valueEv:
  415|  52.1k|      const std::string& value() const { return m_utf8_str; }
_ZNK5Botan11ASN1_String5emptyEv:
  419|  22.9k|      bool empty() const { return m_utf8_str.empty(); }
_ZN5BotanorENS_10ASN1_ClassES0_:
   78|  34.2k|inline ASN1_Class operator|(ASN1_Class x, ASN1_Class y) {
   79|  34.2k|   return static_cast<ASN1_Class>(static_cast<uint32_t>(x) | static_cast<uint32_t>(y));
   80|  34.2k|}
_ZN5BotanorENS_9ASN1_TypeENS_10ASN1_ClassE:
   82|   105k|inline uint32_t operator|(ASN1_Type x, ASN1_Class y) {
   83|   105k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   84|   105k|}
_ZN5BotanorENS_10ASN1_ClassENS_9ASN1_TypeE:
   86|  23.3k|inline uint32_t operator|(ASN1_Class x, ASN1_Type y) {
   87|  23.3k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
   88|  23.3k|}
_ZN5BotanneERKNS_3OIDES2_:
  326|  1.80k|inline bool operator!=(const OID& a, const OID& b) {
  327|  1.80k|   return !(a == b);
  328|  1.80k|}
_ZN5Botan10BER_ObjectC2EOS0_:
  134|  33.5k|      BER_Object(BER_Object&& other) = default;
_ZN5Botan11ASN1_ObjectC2ERKS0_:
  118|   235k|      ASN1_Object(const ASN1_Object&) = default;
_ZN5Botan3OIDC2Ev:
  218|  23.5k|      explicit OID() = default;

_ZN5Botan13ignore_paramsIJRhEEEvDpOT_:
  114|  23.5k|void ignore_params(T&&... args) {
  115|  23.5k|   (ignore_param(args), ...);
  116|  23.5k|}
_ZN5Botan12ignore_paramIRhEEvOT_:
  111|  23.5k|void ignore_param(T&&) {}

_ZN5Botan11BER_Decoder14start_sequenceEv:
  113|  26.7k|      BER_Decoder start_sequence() { return start_cons(ASN1_Type::Sequence, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9start_setEv:
  115|  7.94k|      BER_Decoder start_set() { return start_cons(ASN1_Type::Set, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9raw_bytesINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EE:
  162|  2.28k|      BER_Decoder& raw_bytes(std::vector<uint8_t, Alloc>& out) {
  163|  2.28k|         out.clear();
  164|  2.28k|         uint8_t buf;
  165|   532k|         while(m_source->read_byte(buf)) {
  ------------------
  |  Branch (165:16): [True: 530k, False: 2.28k]
  ------------------
  166|   530k|            out.push_back(buf);
  167|   530k|         }
  168|  2.28k|         return (*this);
  169|  2.28k|      }

_ZN5Botan6ranges24assert_exact_byte_lengthILm2ERNSt3__14spanIKhLm2EEEEEvOT0_:
   86|  19.1k|inline constexpr void assert_exact_byte_length(R&& r) {
   87|  19.1k|   const std::span s{r};
   88|  19.1k|   if constexpr(decltype(s)::extent != std::dynamic_extent) {
  ------------------
  |  Branch (88:17): [Folded - Ignored]
  ------------------
   89|  19.1k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   90|  19.1k|   } else {
   91|  19.1k|      BOTAN_ASSERT(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   92|  19.1k|   }
   93|  19.1k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsIRNSt3__14spanItLm1EEEJRNS3_IKhLm2EEEEEEvOT_DpOT0_:
  107|  9.57k|{
  108|  9.57k|   const std::span s0{r0};
  109|       |
  110|  9.57k|   if constexpr(decltype(s0)::extent != std::dynamic_extent) {
  ------------------
  |  Branch (110:17): [Folded - Ignored]
  ------------------
  111|  9.57k|      constexpr size_t expected_size = s0.size_bytes();
  112|  9.57k|      (assert_exact_byte_length<expected_size>(rs), ...);
  113|  9.57k|   } else {
  114|  9.57k|      const size_t expected_size = s0.size_bytes();
  115|  9.57k|      BOTAN_ARG_CHECK(((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...),
  116|  9.57k|                      "memory regions don't have equal lengths");
  117|  9.57k|   }
  118|  9.57k|}
_ZN5Botan6ranges10size_bytesIRNSt3__14spanItLm1EEEEEmOT_:
   73|  9.57k|inline constexpr size_t size_bytes(spanable_range auto&& r) {
   74|  9.57k|   return std::span{r}.size_bytes();
   75|  9.57k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ERNSt3__14spanIKhLm4EEEEEvOT0_:
   86|  1.40k|inline constexpr void assert_exact_byte_length(R&& r) {
   87|  1.40k|   const std::span s{r};
   88|  1.40k|   if constexpr(decltype(s)::extent != std::dynamic_extent) {
  ------------------
  |  Branch (88:17): [Folded - Ignored]
  ------------------
   89|  1.40k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   90|  1.40k|   } else {
   91|  1.40k|      BOTAN_ASSERT(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   92|  1.40k|   }
   93|  1.40k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsIRNSt3__14spanIjLm1EEEJRNS3_IKhLm4EEEEEEvOT_DpOT0_:
  107|    701|{
  108|    701|   const std::span s0{r0};
  109|       |
  110|    701|   if constexpr(decltype(s0)::extent != std::dynamic_extent) {
  ------------------
  |  Branch (110:17): [Folded - Ignored]
  ------------------
  111|    701|      constexpr size_t expected_size = s0.size_bytes();
  112|    701|      (assert_exact_byte_length<expected_size>(rs), ...);
  113|    701|   } else {
  114|    701|      const size_t expected_size = s0.size_bytes();
  115|    701|      BOTAN_ARG_CHECK(((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...),
  116|    701|                      "memory regions don't have equal lengths");
  117|    701|   }
  118|    701|}
_ZN5Botan6ranges10size_bytesIRNSt3__14spanIjLm1EEEEEmOT_:
   73|    701|inline constexpr size_t size_bytes(spanable_range auto&& r) {
   74|    701|   return std::span{r}.size_bytes();
   75|    701|}

_ZN5Botan17DataSource_MemoryC2EPKhm:
  118|  4.45k|      DataSource_Memory(const uint8_t in[], size_t length) : m_source(in, in + length), m_offset(0) {}
_ZN5Botan17DataSource_MemoryC2ENSt3__16vectorIhNS_16secure_allocatorIhEEEE:
  124|  18.4k|      explicit DataSource_Memory(secure_vector<uint8_t> in) : m_source(std::move(in)), m_offset(0) {}
_ZN5Botan10DataSourceC2Ev:
   91|  56.4k|      DataSource() = default;
_ZN5Botan10DataSourceD2Ev:
   92|  56.4k|      virtual ~DataSource() = default;

_ZN5Botan22cast_uint8_ptr_to_charEPKh:
  276|  14.1k|inline const char* cast_uint8_ptr_to_char(const uint8_t* b) {
  277|  14.1k|   return reinterpret_cast<const char*>(b);
  278|  14.1k|}
_ZN5Botan8copy_memIhEEvPT_PKS1_m:
  146|  1.36M|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  147|  1.36M|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |   78|  1.36M|   do {                                                                                          \
  |  |   79|  2.68M|      if((expr1) && !(expr2))                                                                    \
  |  |  ------------------
  |  |  |  Branch (79:10): [True: 1.34M, False: 26.8k]
  |  |  |  Branch (79:23): [True: 1.34M, False: 0]
  |  |  |  Branch (79:23): [True: 1.34M, False: 0]
  |  |  ------------------
  |  |   80|  1.36M|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |   81|  1.36M|   } while(0)
  |  |  ------------------
  |  |  |  Branch (81:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  148|       |
  149|  1.36M|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (149:7): [True: 1.36M, False: 4.41k]
  |  Branch (149:24): [True: 1.35M, False: 9.31k]
  |  Branch (149:42): [True: 1.34M, False: 13.1k]
  ------------------
  150|  1.34M|      std::memmove(out, in, sizeof(T) * n);
  151|  1.34M|   }
  152|  1.36M|}
_ZN5Botan13typecast_copyItRNSt3__14spanIKhLm2EEEEET_OT0_:
  209|  9.57k|inline constexpr ToT typecast_copy(FromR&& src) noexcept {
  210|  9.57k|   ToT dst;
  211|  9.57k|   typecast_copy(dst, src);
  212|  9.57k|   return dst;
  213|  9.57k|}
_ZN5Botan13typecast_copyItRNSt3__14spanIKhLm2EEEEEvRT_OT0_:
  188|  9.57k|inline constexpr void typecast_copy(ToT& out, FromR&& in) noexcept {
  189|  9.57k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  9.57k|}
_ZN5Botan13typecast_copyINSt3__14spanItLm1EEERNS2_IKhLm2EEEEEvOT_OT0_:
  176|  9.57k|inline constexpr void typecast_copy(ToR&& out, FromR&& in) {
  177|  9.57k|   ranges::assert_equal_byte_lengths(out, in);
  178|  9.57k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  9.57k|}
_ZN5Botan13typecast_copyIjRNSt3__14spanIKhLm4EEEEET_OT0_:
  209|    701|inline constexpr ToT typecast_copy(FromR&& src) noexcept {
  210|    701|   ToT dst;
  211|    701|   typecast_copy(dst, src);
  212|    701|   return dst;
  213|    701|}
_ZN5Botan13typecast_copyIjRNSt3__14spanIKhLm4EEEEEvRT_OT0_:
  188|    701|inline constexpr void typecast_copy(ToT& out, FromR&& in) noexcept {
  189|    701|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|    701|}
_ZN5Botan13typecast_copyINSt3__14spanIjLm1EEERNS2_IKhLm4EEEEEvOT_OT0_:
  176|    701|inline constexpr void typecast_copy(ToR&& out, FromR&& in) {
  177|    701|   ranges::assert_equal_byte_lengths(out, in);
  178|    701|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|    701|}

_ZN5Botan7X509_DNC2Ev:
   39|  4.32k|      X509_DN() = default;

_ZN5Botan16secure_allocatorIhE10deallocateEPhm:
   47|   124k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorIhE8allocateEm:
   45|   124k|      T* allocate(std::size_t n) { return static_cast<T*>(allocate_memory(n, sizeof(T))); }
_ZN5BotanpLIhNS_16secure_allocatorIhEEmEERNSt3__16vectorIT_T0_EES8_RKNS3_4pairIPS5_T1_EE:
   98|  15.2k|std::vector<T, Alloc>& operator+=(std::vector<T, Alloc>& out, const std::pair<T*, L>& in) {
   99|  15.2k|   out.insert(out.end(), in.first, in.first + in.second);
  100|  15.2k|   return out;
  101|  15.2k|}

LLVMFuzzerInitialize:
   24|      2|extern "C" int LLVMFuzzerInitialize(int*, char***) {
   25|       |   /*
   26|       |   * This disables the mlock pool, as overwrites within the pool are
   27|       |   * opaque to ASan or other instrumentation.
   28|       |   */
   29|      2|   ::setenv("BOTAN_MLOCK_POOL_SIZE", "0", 1);
   30|      2|   return 0;
   31|      2|}
LLVMFuzzerTestOneInput:
   34|  2.17k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t in[], size_t len) {
   35|  2.17k|   if(len <= max_fuzzer_input_size) {
  ------------------
  |  Branch (35:7): [True: 2.16k, False: 9]
  ------------------
   36|  2.16k|      fuzz(in, len);
   37|  2.16k|   }
   38|  2.17k|   return 0;
   39|  2.17k|}

_Z4fuzzPKhm:
   13|  2.16k|void fuzz(const uint8_t in[], size_t len) {
   14|  2.16k|   Botan::X509_DN dn1;
   15|  2.16k|   Botan::X509_DN dn2;
   16|       |
   17|  2.16k|   try {
   18|  2.16k|      Botan::BER_Decoder ber(in, len);
   19|  2.16k|      dn1.decode_from(ber);
   20|  2.16k|      dn2.decode_from(ber);
   21|  2.16k|   } catch(...) {
   22|  1.53k|      return;
   23|  1.53k|   }
   24|       |
   25|    623|   const bool eq = dn1 == dn2;
   26|    623|   const bool lt1 = dn1 < dn2;
   27|    623|   const bool lt2 = dn2 < dn1;
   28|       |
   29|    623|   if(lt1 == false && lt2 == false) {
  ------------------
  |  Branch (29:7): [True: 221, False: 402]
  |  Branch (29:23): [True: 63, False: 158]
  ------------------
   30|     63|      FUZZER_ASSERT_TRUE(eq);
  ------------------
  |  |   67|     63|   do {                                                               \
  |  |   68|     63|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (68:10): [True: 0, False: 63]
  |  |  ------------------
  |  |   69|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   54|      0|   do {                                                                          \
  |  |  |  |   55|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; \
  |  |  |  |   56|      0|      abort();                                                                   \
  |  |  |  |   57|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   70|      0|      }                                                               \
  |  |   71|     63|   } while(0)
  |  |  ------------------
  |  |  |  Branch (71:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   31|    560|   } else {
   32|       |      // one is less than the other
   33|    560|      FUZZER_ASSERT_TRUE(lt1 || lt2);
  ------------------
  |  |   67|    560|   do {                                                               \
  |  |   68|    718|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (68:12): [True: 402, False: 158]
  |  |  |  Branch (68:12): [True: 158, False: 0]
  |  |  ------------------
  |  |   69|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   54|      0|   do {                                                                          \
  |  |  |  |   55|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; \
  |  |  |  |   56|      0|      abort();                                                                   \
  |  |  |  |   57|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   70|      0|      }                                                               \
  |  |   71|    560|   } while(0)
  |  |  ------------------
  |  |  |  Branch (71:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   34|       |
   35|       |      // it is not the case that both are less than the other
   36|    560|      FUZZER_ASSERT_TRUE(!lt1 || !lt2);
  ------------------
  |  |   67|    560|   do {                                                               \
  |  |   68|    962|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (68:12): [True: 158, False: 402]
  |  |  |  Branch (68:12): [True: 402, False: 0]
  |  |  ------------------
  |  |   69|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   54|      0|   do {                                                                          \
  |  |  |  |   55|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; \
  |  |  |  |   56|      0|      abort();                                                                   \
  |  |  |  |   57|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (57:12): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   70|      0|      }                                                               \
  |  |   71|    560|   } while(0)
  |  |  ------------------
  |  |  |  Branch (71:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
   37|    560|   }
   38|    623|}

_ZNK5Botan10BER_Object11assert_is_aENS_9ASN1_TypeENS_10ASN1_ClassENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   29|  34.2k|void BER_Object::assert_is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag, std::string_view descr) const {
   30|  34.2k|   if(this->is_a(expected_type_tag, expected_class_tag) == false) {
  ------------------
  |  Branch (30:7): [True: 708, False: 33.5k]
  ------------------
   31|    708|      std::stringstream msg;
   32|       |
   33|    708|      msg << "Tag mismatch when decoding " << descr << " got ";
   34|       |
   35|    708|      if(m_class_tag == ASN1_Class::NoObject && m_type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (35:10): [True: 440, False: 268]
  |  Branch (35:49): [True: 440, False: 0]
  ------------------
   36|    440|         msg << "EOF";
   37|    440|      } else {
   38|    268|         if(m_class_tag == ASN1_Class::Universal || m_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (38:13): [True: 69, False: 199]
  |  Branch (38:53): [True: 130, False: 69]
  ------------------
   39|    199|            msg << asn1_tag_to_string(m_type_tag);
   40|    199|         } else {
   41|     69|            msg << std::to_string(static_cast<uint32_t>(m_type_tag));
   42|     69|         }
   43|       |
   44|    268|         msg << "/" << asn1_class_to_string(m_class_tag);
   45|    268|      }
   46|       |
   47|    708|      msg << " expected ";
   48|       |
   49|    708|      if(expected_class_tag == ASN1_Class::Universal || expected_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (49:10): [True: 0, False: 708]
  |  Branch (49:57): [True: 708, False: 0]
  ------------------
   50|    708|         msg << asn1_tag_to_string(expected_type_tag);
   51|    708|      } else {
   52|      0|         msg << std::to_string(static_cast<uint32_t>(expected_type_tag));
   53|      0|      }
   54|       |
   55|    708|      msg << "/" << asn1_class_to_string(expected_class_tag);
   56|       |
   57|    708|      throw BER_Decoding_Error(msg.str());
   58|    708|   }
   59|  34.2k|}
_ZNK5Botan10BER_Object4is_aENS_9ASN1_TypeENS_10ASN1_ClassE:
   61|  34.2k|bool BER_Object::is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag) const {
   62|  34.2k|   return (m_type_tag == expected_type_tag && m_class_tag == expected_class_tag);
  ------------------
  |  Branch (62:12): [True: 33.5k, False: 701]
  |  Branch (62:47): [True: 33.5k, False: 7]
  ------------------
   63|  34.2k|}
_ZN5Botan10BER_Object11set_taggingENS_9ASN1_TypeENS_10ASN1_ClassE:
   69|  83.3k|void BER_Object::set_tagging(ASN1_Type type_tag, ASN1_Class class_tag) {
   70|  83.3k|   m_type_tag = type_tag;
   71|  83.3k|   m_class_tag = class_tag;
   72|  83.3k|}
_ZN5Botan20asn1_class_to_stringENS_10ASN1_ClassE:
   74|    976|std::string asn1_class_to_string(ASN1_Class type) {
   75|    976|   switch(type) {
   76|     69|      case ASN1_Class::Universal:
  ------------------
  |  Branch (76:7): [True: 69, False: 907]
  ------------------
   77|     69|         return "UNIVERSAL";
   78|    838|      case ASN1_Class::Constructed:
  ------------------
  |  Branch (78:7): [True: 838, False: 138]
  ------------------
   79|    838|         return "CONSTRUCTED";
   80|     16|      case ASN1_Class::ContextSpecific:
  ------------------
  |  Branch (80:7): [True: 16, False: 960]
  ------------------
   81|     16|         return "CONTEXT_SPECIFIC";
   82|      4|      case ASN1_Class::Application:
  ------------------
  |  Branch (82:7): [True: 4, False: 972]
  ------------------
   83|      4|         return "APPLICATION";
   84|     10|      case ASN1_Class::Private:
  ------------------
  |  Branch (84:7): [True: 10, False: 966]
  ------------------
   85|     10|         return "PRIVATE";
   86|      0|      case ASN1_Class::NoObject:
  ------------------
  |  Branch (86:7): [True: 0, False: 976]
  ------------------
   87|      0|         return "NO_OBJECT";
   88|     39|      default:
  ------------------
  |  Branch (88:7): [True: 39, False: 937]
  ------------------
   89|     39|         return "CLASS(" + std::to_string(static_cast<size_t>(type)) + ")";
   90|    976|   }
   91|    976|}
_ZN5Botan18asn1_tag_to_stringENS_9ASN1_TypeE:
   93|    907|std::string asn1_tag_to_string(ASN1_Type type) {
   94|    907|   switch(type) {
   95|    673|      case ASN1_Type::Sequence:
  ------------------
  |  Branch (95:7): [True: 673, False: 234]
  ------------------
   96|    673|         return "SEQUENCE";
   97|       |
   98|     50|      case ASN1_Type::Set:
  ------------------
  |  Branch (98:7): [True: 50, False: 857]
  ------------------
   99|     50|         return "SET";
  100|       |
  101|      4|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (101:7): [True: 4, False: 903]
  ------------------
  102|      4|         return "PRINTABLE STRING";
  103|       |
  104|      6|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (104:7): [True: 6, False: 901]
  ------------------
  105|      6|         return "NUMERIC STRING";
  106|       |
  107|      3|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (107:7): [True: 3, False: 904]
  ------------------
  108|      3|         return "IA5 STRING";
  109|       |
  110|      4|      case ASN1_Type::TeletexString:
  ------------------
  |  Branch (110:7): [True: 4, False: 903]
  ------------------
  111|      4|         return "T61 STRING";
  112|       |
  113|      1|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (113:7): [True: 1, False: 906]
  ------------------
  114|      1|         return "UTF8 STRING";
  115|       |
  116|      2|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (116:7): [True: 2, False: 905]
  ------------------
  117|      2|         return "VISIBLE STRING";
  118|       |
  119|      2|      case ASN1_Type::BmpString:
  ------------------
  |  Branch (119:7): [True: 2, False: 905]
  ------------------
  120|      2|         return "BMP STRING";
  121|       |
  122|      2|      case ASN1_Type::UniversalString:
  ------------------
  |  Branch (122:7): [True: 2, False: 905]
  ------------------
  123|      2|         return "UNIVERSAL STRING";
  124|       |
  125|      2|      case ASN1_Type::UtcTime:
  ------------------
  |  Branch (125:7): [True: 2, False: 905]
  ------------------
  126|      2|         return "UTC TIME";
  127|       |
  128|      2|      case ASN1_Type::GeneralizedTime:
  ------------------
  |  Branch (128:7): [True: 2, False: 905]
  ------------------
  129|      2|         return "GENERALIZED TIME";
  130|       |
  131|      1|      case ASN1_Type::OctetString:
  ------------------
  |  Branch (131:7): [True: 1, False: 906]
  ------------------
  132|      1|         return "OCTET STRING";
  133|       |
  134|      2|      case ASN1_Type::BitString:
  ------------------
  |  Branch (134:7): [True: 2, False: 905]
  ------------------
  135|      2|         return "BIT STRING";
  136|       |
  137|      3|      case ASN1_Type::Enumerated:
  ------------------
  |  Branch (137:7): [True: 3, False: 904]
  ------------------
  138|      3|         return "ENUMERATED";
  139|       |
  140|      9|      case ASN1_Type::Integer:
  ------------------
  |  Branch (140:7): [True: 9, False: 898]
  ------------------
  141|      9|         return "INTEGER";
  142|       |
  143|      2|      case ASN1_Type::Null:
  ------------------
  |  Branch (143:7): [True: 2, False: 905]
  ------------------
  144|      2|         return "NULL";
  145|       |
  146|      6|      case ASN1_Type::ObjectId:
  ------------------
  |  Branch (146:7): [True: 6, False: 901]
  ------------------
  147|      6|         return "OBJECT";
  148|       |
  149|     19|      case ASN1_Type::Boolean:
  ------------------
  |  Branch (149:7): [True: 19, False: 888]
  ------------------
  150|     19|         return "BOOLEAN";
  151|       |
  152|      5|      case ASN1_Type::NoObject:
  ------------------
  |  Branch (152:7): [True: 5, False: 902]
  ------------------
  153|      5|         return "NO_OBJECT";
  154|       |
  155|    109|      default:
  ------------------
  |  Branch (155:7): [True: 109, False: 798]
  ------------------
  156|    109|         return "TAG(" + std::to_string(static_cast<uint32_t>(type)) + ")";
  157|    907|   }
  158|    907|}
_ZN5Botan18BER_Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  163|  1.17k|BER_Decoding_Error::BER_Decoding_Error(std::string_view str) : Decoding_Error(fmt("BER: {}", str)) {}
_ZN5Botan11BER_Bad_TagC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEj:
  165|     92|BER_Bad_Tag::BER_Bad_Tag(std::string_view str, uint32_t tagging) : BER_Decoding_Error(fmt("{}: {}", str, tagging)) {}
_ZN5Botan4ASN19to_stringERKNS_10BER_ObjectE:
  185|  14.1k|std::string to_string(const BER_Object& obj) {
  186|  14.1k|   return std::string(cast_uint8_ptr_to_char(obj.bits()), obj.length());
  187|  14.1k|}

_ZN5BotanltERKNS_3OIDES2_:
  133|   464k|bool operator<(const OID& a, const OID& b) {
  134|   464k|   const std::vector<uint32_t>& oid1 = a.get_components();
  135|   464k|   const std::vector<uint32_t>& oid2 = b.get_components();
  136|       |
  137|   464k|   return std::lexicographical_compare(oid1.begin(), oid1.end(), oid2.begin(), oid2.end());
  138|   464k|}
_ZN5Botan3OID11decode_fromERNS_11BER_DecoderE:
  191|  23.4k|void OID::decode_from(BER_Decoder& decoder) {
  192|  23.4k|   BER_Object obj = decoder.get_next_object();
  193|  23.4k|   if(obj.tagging() != (ASN1_Class::Universal | ASN1_Type::ObjectId)) {
  ------------------
  |  Branch (193:7): [True: 92, False: 23.3k]
  ------------------
  194|     92|      throw BER_Bad_Tag("Error decoding OID, unknown tag", obj.tagging());
  195|     92|   }
  196|       |
  197|  23.3k|   const size_t length = obj.length();
  198|  23.3k|   const uint8_t* bits = obj.bits();
  199|       |
  200|  23.3k|   if(length < 2 && !(length == 1 && bits[0] == 0)) {
  ------------------
  |  Branch (200:7): [True: 20.1k, False: 3.15k]
  |  Branch (200:23): [True: 20.1k, False: 2]
  |  Branch (200:38): [True: 20.1k, False: 8]
  ------------------
  201|     10|      throw BER_Decoding_Error("OID encoding is too short");
  202|     10|   }
  203|       |
  204|  23.3k|   m_id.clear();
  205|  23.3k|   m_id.push_back(bits[0] / 40);
  206|  23.3k|   m_id.push_back(bits[0] % 40);
  207|       |
  208|  23.3k|   size_t i = 0;
  209|   107k|   while(i != length - 1) {
  ------------------
  |  Branch (209:10): [True: 84.2k, False: 23.2k]
  ------------------
  210|  84.2k|      uint32_t component = 0;
  211|  92.4k|      while(i != length - 1) {
  ------------------
  |  Branch (211:13): [True: 91.3k, False: 1.14k]
  ------------------
  212|  91.3k|         ++i;
  213|       |
  214|  91.3k|         if(component >> (32 - 7)) {
  ------------------
  |  Branch (214:13): [True: 24, False: 91.3k]
  ------------------
  215|     24|            throw Decoding_Error("OID component overflow");
  216|     24|         }
  217|       |
  218|  91.3k|         component = (component << 7) + (bits[i] & 0x7F);
  219|       |
  220|  91.3k|         if(!(bits[i] & 0x80)) {
  ------------------
  |  Branch (220:13): [True: 83.0k, False: 8.22k]
  ------------------
  221|  83.0k|            break;
  222|  83.0k|         }
  223|  91.3k|      }
  224|  84.2k|      m_id.push_back(component);
  225|  84.2k|   }
  226|  23.3k|}

_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
   64|  23.5k|ASN1_String::ASN1_String(std::string_view str, ASN1_Type t) : m_utf8_str(str), m_tag(t) {
   65|  23.5k|   if(!is_utf8_subset_string_type(m_tag)) {
  ------------------
  |  Branch (65:7): [True: 0, False: 23.5k]
  ------------------
   66|      0|      throw Invalid_Argument("ASN1_String only supports encoding to UTF-8 or a UTF-8 subset");
   67|      0|   }
   68|  23.5k|}
_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   70|  23.5k|ASN1_String::ASN1_String(std::string_view str) : ASN1_String(str, choose_encoding(str)) {}
_ZN5Botan11ASN1_String11decode_fromERNS_11BER_DecoderE:
   88|  23.2k|void ASN1_String::decode_from(BER_Decoder& source) {
   89|  23.2k|   BER_Object obj = source.get_next_object();
   90|       |
   91|  23.2k|   if(!is_asn1_string_type(obj.type())) {
  ------------------
  |  Branch (91:7): [True: 232, False: 23.0k]
  ------------------
   92|    232|      auto typ = static_cast<uint32_t>(obj.type());
   93|    232|      throw Decoding_Error(fmt("ASN1_String: Unknown string type {}", typ));
   94|    232|   }
   95|       |
   96|  23.0k|   m_tag = obj.type();
   97|  23.0k|   m_data.assign(obj.bits(), obj.bits() + obj.length());
   98|       |
   99|  23.0k|   if(m_tag == ASN1_Type::BmpString) {
  ------------------
  |  Branch (99:7): [True: 948, False: 22.0k]
  ------------------
  100|    948|      m_utf8_str = ucs2_to_utf8(m_data.data(), m_data.size());
  101|  22.0k|   } else if(m_tag == ASN1_Type::UniversalString) {
  ------------------
  |  Branch (101:14): [True: 962, False: 21.1k]
  ------------------
  102|    962|      m_utf8_str = ucs4_to_utf8(m_data.data(), m_data.size());
  103|  21.1k|   } else if(m_tag == ASN1_Type::TeletexString) {
  ------------------
  |  Branch (103:14): [True: 6.96k, False: 14.1k]
  ------------------
  104|       |      /*
  105|       |      TeletexString is nominally ITU T.61 not ISO-8859-1 but it seems
  106|       |      the majority of implementations actually used that charset here.
  107|       |      */
  108|  6.96k|      m_utf8_str = latin1_to_utf8(m_data.data(), m_data.size());
  109|  14.1k|   } else {
  110|       |      // All other supported string types are UTF-8 or some subset thereof
  111|  14.1k|      m_utf8_str = ASN1::to_string(obj);
  112|  14.1k|   }
  113|  23.0k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_119is_asn1_string_typeENS_9ASN1_TypeE:
   52|  23.2k|bool is_asn1_string_type(ASN1_Type tag) {
   53|  23.2k|   return (is_utf8_subset_string_type(tag) || tag == ASN1_Type::TeletexString || tag == ASN1_Type::BmpString ||
  ------------------
  |  Branch (53:12): [True: 14.1k, False: 9.10k]
  |  Branch (53:47): [True: 6.96k, False: 2.14k]
  |  Branch (53:82): [True: 948, False: 1.19k]
  ------------------
   54|  23.2k|           tag == ASN1_Type::UniversalString);
  ------------------
  |  Branch (54:12): [True: 962, False: 232]
  ------------------
   55|  23.2k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_126is_utf8_subset_string_typeENS_9ASN1_TypeE:
   47|  46.7k|bool is_utf8_subset_string_type(ASN1_Type tag) {
   48|  46.7k|   return (tag == ASN1_Type::NumericString || tag == ASN1_Type::PrintableString || tag == ASN1_Type::VisibleString ||
  ------------------
  |  Branch (48:12): [True: 5.58k, False: 41.2k]
  |  Branch (48:47): [True: 26.0k, False: 15.1k]
  |  Branch (48:84): [True: 3.52k, False: 11.6k]
  ------------------
   49|  46.7k|           tag == ASN1_Type::Ia5String || tag == ASN1_Type::Utf8String);
  ------------------
  |  Branch (49:12): [True: 2.21k, False: 9.40k]
  |  Branch (49:43): [True: 299, False: 9.10k]
  ------------------
   50|  46.7k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_115choose_encodingENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   23|  23.5k|ASN1_Type choose_encoding(std::string_view str) {
   24|  23.5k|   auto all_printable = CT::Mask<uint8_t>::set();
   25|       |
   26|  23.5k|   for(size_t i = 0; i != str.size(); ++i) {
  ------------------
  |  Branch (26:22): [True: 0, False: 23.5k]
  ------------------
   27|      0|      const uint8_t c = static_cast<uint8_t>(str[i]);
   28|       |
   29|      0|      auto is_alpha_lower = CT::Mask<uint8_t>::is_within_range(c, 'a', 'z');
   30|      0|      auto is_alpha_upper = CT::Mask<uint8_t>::is_within_range(c, 'A', 'Z');
   31|      0|      auto is_decimal = CT::Mask<uint8_t>::is_within_range(c, '0', '9');
   32|       |
   33|      0|      auto is_print_punc = CT::Mask<uint8_t>::is_any_of(c, {' ', '(', ')', '+', ',', '-', '.', '/', ':', '=', '?'});
   34|       |
   35|      0|      auto is_printable = is_alpha_lower | is_alpha_upper | is_decimal | is_print_punc;
   36|       |
   37|      0|      all_printable &= is_printable;
   38|      0|   }
   39|       |
   40|  23.5k|   if(all_printable.as_bool()) {
  ------------------
  |  Branch (40:7): [True: 23.5k, False: 0]
  ------------------
   41|  23.5k|      return ASN1_Type::PrintableString;
   42|  23.5k|   } else {
   43|      0|      return ASN1_Type::Utf8String;
   44|      0|   }
   45|  23.5k|}

_ZNK5Botan11BER_Decoder10more_itemsEv:
  195|  40.4k|bool BER_Decoder::more_items() const {
  196|  40.4k|   if(m_source->end_of_data() && !m_pushed.is_set()) {
  ------------------
  |  Branch (196:7): [True: 8.95k, False: 31.4k]
  |  Branch (196:34): [True: 8.95k, False: 0]
  ------------------
  197|  8.95k|      return false;
  198|  8.95k|   }
  199|  31.4k|   return true;
  200|  40.4k|}
_ZN5Botan11BER_Decoder15get_next_objectEv:
  231|  81.3k|BER_Object BER_Decoder::get_next_object() {
  232|  81.3k|   BER_Object next;
  233|       |
  234|  81.3k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (234:7): [True: 0, False: 81.3k]
  ------------------
  235|      0|      std::swap(next, m_pushed);
  236|      0|      return next;
  237|      0|   }
  238|       |
  239|  83.3k|   for(;;) {
  240|  83.3k|      ASN1_Type type_tag;
  241|  83.3k|      ASN1_Class class_tag;
  242|  83.3k|      decode_tag(m_source, type_tag, class_tag);
  243|  83.3k|      next.set_tagging(type_tag, class_tag);
  244|  83.3k|      if(next.is_set() == false) {  // no more objects
  ------------------
  |  Branch (244:10): [True: 598, False: 82.7k]
  ------------------
  245|    598|         return next;
  246|    598|      }
  247|       |
  248|  82.7k|      size_t field_size;
  249|  82.7k|      const size_t length = decode_length(m_source, field_size, ALLOWED_EOC_NESTINGS);
  250|  82.7k|      if(!m_source->check_available(length)) {
  ------------------
  |  Branch (250:10): [True: 138, False: 82.5k]
  ------------------
  251|    138|         throw BER_Decoding_Error("Value truncated");
  252|    138|      }
  253|       |
  254|  82.5k|      uint8_t* out = next.mutable_bits(length);
  255|  82.5k|      if(m_source->read(out, length) != length) {
  ------------------
  |  Branch (255:10): [True: 0, False: 82.5k]
  ------------------
  256|      0|         throw BER_Decoding_Error("Value truncated");
  257|      0|      }
  258|       |
  259|  82.5k|      if(next.tagging() == static_cast<uint32_t>(ASN1_Type::Eoc)) {
  ------------------
  |  Branch (259:10): [True: 1.99k, False: 80.5k]
  ------------------
  260|  1.99k|         continue;
  261|  80.5k|      } else {
  262|  80.5k|         break;
  263|  80.5k|      }
  264|  82.5k|   }
  265|       |
  266|  80.5k|   return next;
  267|  81.3k|}
_ZN5Botan11BER_Decoder10start_consENS_9ASN1_TypeENS_10ASN1_ClassE:
  286|  34.6k|BER_Decoder BER_Decoder::start_cons(ASN1_Type type_tag, ASN1_Class class_tag) {
  287|  34.6k|   BER_Object obj = get_next_object();
  288|  34.6k|   obj.assert_is_a(type_tag, class_tag | ASN1_Class::Constructed);
  289|  34.6k|   return BER_Decoder(std::move(obj), this);
  290|  34.6k|}
_ZN5Botan11BER_Decoder8end_consEv:
  295|  25.2k|BER_Decoder& BER_Decoder::end_cons() {
  296|  25.2k|   if(!m_parent) {
  ------------------
  |  Branch (296:7): [True: 0, False: 25.2k]
  ------------------
  297|      0|      throw Invalid_State("BER_Decoder::end_cons called with null parent");
  298|      0|   }
  299|  25.2k|   if(!m_source->end_of_data()) {
  ------------------
  |  Branch (299:7): [True: 14, False: 25.2k]
  ------------------
  300|     14|      throw Decoding_Error("BER_Decoder::end_cons called with data left");
  301|     14|   }
  302|  25.2k|   return (*m_parent);
  303|  25.2k|}
_ZN5Botan11BER_DecoderC2EONS_10BER_ObjectEPS0_:
  305|  33.5k|BER_Decoder::BER_Decoder(BER_Object&& obj, BER_Decoder* parent) {
  306|  33.5k|   m_data_src = std::make_unique<DataSource_BERObject>(std::move(obj));
  307|  33.5k|   m_source = m_data_src.get();
  308|  33.5k|   m_parent = parent;
  309|  33.5k|}
_ZN5Botan11BER_DecoderC2EPKhm:
  321|  2.16k|BER_Decoder::BER_Decoder(const uint8_t data[], size_t length) {
  322|  2.16k|   m_data_src = std::make_unique<DataSource_Memory>(data, length);
  323|  2.16k|   m_source = m_data_src.get();
  324|  2.16k|}
_ZN5Botan11BER_DecoderC2ERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
  337|  2.28k|BER_Decoder::BER_Decoder(const std::vector<uint8_t>& data) {
  338|  2.28k|   m_data_src = std::make_unique<DataSource_Memory>(data.data(), data.size());
  339|  2.28k|   m_source = m_data_src.get();
  340|  2.28k|}
_ZN5Botan11BER_Decoder6decodeERNS_11ASN1_ObjectENS_9ASN1_TypeENS_10ASN1_ClassE:
  356|  46.6k|BER_Decoder& BER_Decoder::decode(ASN1_Object& obj, ASN1_Type /*unused*/, ASN1_Class /*unused*/) {
  357|  46.6k|   obj.decode_from(*this);
  358|  46.6k|   return (*this);
  359|  46.6k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_110decode_tagEPNS_10DataSourceERNS_9ASN1_TypeERNS_10ASN1_ClassE:
   29|   227k|size_t decode_tag(DataSource* ber, ASN1_Type& type_tag, ASN1_Class& class_tag) {
   30|   227k|   uint8_t b;
   31|   227k|   if(!ber->read_byte(b)) {
  ------------------
  |  Branch (31:7): [True: 14.3k, False: 212k]
  ------------------
   32|  14.3k|      type_tag = ASN1_Type::NoObject;
   33|  14.3k|      class_tag = ASN1_Class::NoObject;
   34|  14.3k|      return 0;
   35|  14.3k|   }
   36|       |
   37|   212k|   if((b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (37:7): [True: 210k, False: 2.04k]
  ------------------
   38|   210k|      type_tag = ASN1_Type(b & 0x1F);
   39|   210k|      class_tag = ASN1_Class(b & 0xE0);
   40|   210k|      return 1;
   41|   210k|   }
   42|       |
   43|  2.04k|   size_t tag_bytes = 1;
   44|  2.04k|   class_tag = ASN1_Class(b & 0xE0);
   45|       |
   46|  2.04k|   size_t tag_buf = 0;
   47|   105k|   while(true) {
  ------------------
  |  Branch (47:10): [Folded - Ignored]
  ------------------
   48|   105k|      if(!ber->read_byte(b)) {
  ------------------
  |  Branch (48:10): [True: 10, False: 105k]
  ------------------
   49|     10|         throw BER_Decoding_Error("Long-form tag truncated");
   50|     10|      }
   51|   105k|      if(tag_buf & 0xFF000000) {
  ------------------
  |  Branch (51:10): [True: 12, False: 105k]
  ------------------
   52|     12|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
   53|     12|      }
   54|   105k|      ++tag_bytes;
   55|   105k|      tag_buf = (tag_buf << 7) | (b & 0x7F);
   56|   105k|      if((b & 0x80) == 0) {
  ------------------
  |  Branch (56:10): [True: 2.02k, False: 103k]
  ------------------
   57|  2.02k|         break;
   58|  2.02k|      }
   59|   105k|   }
   60|  2.02k|   type_tag = ASN1_Type(tag_buf);
   61|  2.02k|   return tag_bytes;
   62|  2.04k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_113decode_lengthEPNS_10DataSourceERmm:
   72|   212k|size_t decode_length(DataSource* ber, size_t& field_size, size_t allow_indef) {
   73|   212k|   uint8_t b;
   74|   212k|   if(!ber->read_byte(b)) {
  ------------------
  |  Branch (74:7): [True: 155, False: 212k]
  ------------------
   75|    155|      throw BER_Decoding_Error("Length field not found");
   76|    155|   }
   77|   212k|   field_size = 1;
   78|   212k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (78:7): [True: 193k, False: 18.9k]
  ------------------
   79|   193k|      return b;
   80|   193k|   }
   81|       |
   82|  18.9k|   field_size += (b & 0x7F);
   83|  18.9k|   if(field_size > 5) {
  ------------------
  |  Branch (83:7): [True: 22, False: 18.9k]
  ------------------
   84|     22|      throw BER_Decoding_Error("Length field is too large");
   85|     22|   }
   86|       |
   87|  18.9k|   if(field_size == 1) {
  ------------------
  |  Branch (87:7): [True: 18.4k, False: 491]
  ------------------
   88|  18.4k|      if(allow_indef == 0) {
  ------------------
  |  Branch (88:10): [True: 2, False: 18.4k]
  ------------------
   89|      2|         throw BER_Decoding_Error("Nested EOC markers too deep, rejecting to avoid stack exhaustion");
   90|  18.4k|      } else {
   91|  18.4k|         return find_eoc(ber, allow_indef - 1);
   92|  18.4k|      }
   93|  18.4k|   }
   94|       |
   95|    491|   size_t length = 0;
   96|       |
   97|  1.36k|   for(size_t i = 0; i != field_size - 1; ++i) {
  ------------------
  |  Branch (97:22): [True: 898, False: 464]
  ------------------
   98|    898|      if(get_byte<0>(length) != 0) {
  ------------------
  |  Branch (98:10): [True: 0, False: 898]
  ------------------
   99|      0|         throw BER_Decoding_Error("Field length overflow");
  100|      0|      }
  101|    898|      if(!ber->read_byte(b)) {
  ------------------
  |  Branch (101:10): [True: 27, False: 871]
  ------------------
  102|     27|         throw BER_Decoding_Error("Corrupted length field");
  103|     27|      }
  104|    871|      length = (length << 8) | b;
  105|    871|   }
  106|    464|   return length;
  107|    491|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_18find_eocEPNS_10DataSourceEm:
  112|  18.4k|size_t find_eoc(DataSource* ber, size_t allow_indef) {
  113|  18.4k|   secure_vector<uint8_t> buffer(BOTAN_DEFAULT_BUFFER_SIZE), data;
  ------------------
  |  |  388|  18.4k|#define BOTAN_DEFAULT_BUFFER_SIZE 4096
  ------------------
  114|       |
  115|  33.7k|   while(true) {
  ------------------
  |  Branch (115:10): [Folded - Ignored]
  ------------------
  116|  33.7k|      const size_t got = ber->peek(buffer.data(), buffer.size(), data.size());
  117|  33.7k|      if(got == 0) {
  ------------------
  |  Branch (117:10): [True: 18.4k, False: 15.2k]
  ------------------
  118|  18.4k|         break;
  119|  18.4k|      }
  120|       |
  121|  15.2k|      data += std::make_pair(buffer.data(), got);
  122|  15.2k|   }
  123|       |
  124|  18.4k|   DataSource_Memory source(data);
  125|  18.4k|   data.clear();
  126|       |
  127|  18.4k|   size_t length = 0;
  128|   144k|   while(true) {
  ------------------
  |  Branch (128:10): [Folded - Ignored]
  ------------------
  129|   143k|      ASN1_Type type_tag;
  130|   143k|      ASN1_Class class_tag;
  131|   143k|      size_t tag_size = decode_tag(&source, type_tag, class_tag);
  132|   143k|      if(type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (132:10): [True: 13.8k, False: 130k]
  ------------------
  133|  13.8k|         break;
  134|  13.8k|      }
  135|       |
  136|   130k|      size_t length_size = 0;
  137|   130k|      size_t item_size = decode_length(&source, length_size, allow_indef);
  138|   130k|      source.discard_next(item_size);
  139|       |
  140|   130k|      length = BOTAN_CHECKED_ADD(length, item_size);
  ------------------
  |  |   73|   130k|#define BOTAN_CHECKED_ADD(x, y) checked_add(x, y, __FILE__, __LINE__)
  ------------------
  141|   130k|      length = BOTAN_CHECKED_ADD(length, tag_size);
  ------------------
  |  |   73|   130k|#define BOTAN_CHECKED_ADD(x, y) checked_add(x, y, __FILE__, __LINE__)
  ------------------
  142|   130k|      length = BOTAN_CHECKED_ADD(length, length_size);
  ------------------
  |  |   73|   130k|#define BOTAN_CHECKED_ADD(x, y) checked_add(x, y, __FILE__, __LINE__)
  ------------------
  143|       |
  144|   130k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal) {
  ------------------
  |  Branch (144:10): [True: 7.60k, False: 122k]
  |  Branch (144:40): [True: 4.30k, False: 3.30k]
  ------------------
  145|  4.30k|         break;
  146|  4.30k|      }
  147|   130k|   }
  148|  18.4k|   return length;
  149|  18.4k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObjectC2EONS_10BER_ObjectE:
  183|  33.5k|      explicit DataSource_BERObject(BER_Object&& obj) : m_obj(std::move(obj)), m_offset(0) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject4readEPhm:
  153|   746k|      size_t read(uint8_t out[], size_t length) override {
  154|   746k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   60|   746k|   do {                                                                     \
  |  |   61|   746k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 746k]
  |  |  ------------------
  |  |   62|   746k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|   746k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  155|   746k|         const size_t got = std::min<size_t>(m_obj.length() - m_offset, length);
  156|   746k|         copy_mem(out, m_obj.bits() + m_offset, got);
  157|   746k|         m_offset += got;
  158|   746k|         return got;
  159|   746k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject15check_availableEm:
  174|  70.9k|      bool check_available(size_t n) override {
  175|  70.9k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   60|  70.9k|   do {                                                                     \
  |  |   61|  70.9k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 70.9k]
  |  |  ------------------
  |  |   62|  70.9k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  70.9k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  176|  70.9k|         return (n <= (m_obj.length() - m_offset));
  177|  70.9k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject4peekEPhmm:
  161|  6.49k|      size_t peek(uint8_t out[], size_t length, size_t peek_offset) const override {
  162|  6.49k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   60|  6.49k|   do {                                                                     \
  |  |   61|  6.49k|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 6.49k]
  |  |  ------------------
  |  |   62|  6.49k|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|  6.49k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  163|  6.49k|         const size_t bytes_left = m_obj.length() - m_offset;
  164|       |
  165|  6.49k|         if(peek_offset >= bytes_left) {
  ------------------
  |  Branch (165:13): [True: 4.66k, False: 1.82k]
  ------------------
  166|  4.66k|            return 0;
  167|  4.66k|         }
  168|       |
  169|  1.82k|         const size_t got = std::min(bytes_left - peek_offset, length);
  170|  1.82k|         copy_mem(out, m_obj.bits() + m_offset + peek_offset, got);
  171|  1.82k|         return got;
  172|  6.49k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject11end_of_dataEv:
  179|  56.0k|      bool end_of_data() const override { return get_bytes_read() == m_obj.length(); }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject14get_bytes_readEv:
  181|  56.0k|      size_t get_bytes_read() const override { return m_offset; }

_ZN5Botan15allocate_memoryEmm:
   20|   124k|BOTAN_MALLOC_FN void* allocate_memory(size_t elems, size_t elem_size) {
   21|   124k|   if(elems == 0 || elem_size == 0) {
  ------------------
  |  Branch (21:7): [True: 0, False: 124k]
  |  Branch (21:21): [True: 0, False: 124k]
  ------------------
   22|      0|      return nullptr;
   23|      0|   }
   24|       |
   25|       |   // Some calloc implementations do not check for overflow (?!?)
   26|       |
   27|   124k|   if(!BOTAN_CHECKED_MUL(elems, elem_size).has_value()) {
  ------------------
  |  |   74|   124k|#define BOTAN_CHECKED_MUL(x, y) checked_mul(x, y)
  ------------------
  |  Branch (27:7): [True: 0, False: 124k]
  ------------------
   28|      0|      throw std::bad_alloc();
   29|      0|   }
   30|       |
   31|       |#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
   32|       |   if(void* p = mlock_allocator::instance().allocate(elems, elem_size)) {
   33|       |      return p;
   34|       |   }
   35|       |#endif
   36|       |
   37|       |#if defined(BOTAN_TARGET_OS_HAS_ALLOC_CONCEAL)
   38|       |   void* ptr = ::calloc_conceal(elems, elem_size);
   39|       |#else
   40|   124k|   void* ptr = std::calloc(elems, elem_size);  // NOLINT(*-no-malloc)
   41|   124k|#endif
   42|   124k|   if(!ptr) {
  ------------------
  |  Branch (42:7): [True: 0, False: 124k]
  ------------------
   43|      0|      [[unlikely]] throw std::bad_alloc();
   44|      0|   }
   45|   124k|   return ptr;
   46|   124k|}
_ZN5Botan17deallocate_memoryEPvmm:
   48|   124k|void deallocate_memory(void* p, size_t elems, size_t elem_size) {
   49|   124k|   if(p == nullptr) {
  ------------------
  |  Branch (49:7): [True: 0, False: 124k]
  ------------------
   50|      0|      [[unlikely]] return;
   51|      0|   }
   52|       |
   53|   124k|   secure_scrub_memory(p, elems * elem_size);
   54|       |
   55|       |#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
   56|       |   if(mlock_allocator::instance().deallocate(p, elems, elem_size)) {
   57|       |      return;
   58|       |   }
   59|       |#endif
   60|       |
   61|   124k|   std::free(p);  // NOLINT(*-no-malloc)
   62|   124k|}

_ZN5Botan12ucs2_to_utf8EPKhm:
   54|    948|std::string ucs2_to_utf8(const uint8_t ucs2[], size_t len) {
   55|    948|   if(len % 2 != 0) {
  ------------------
  |  Branch (55:7): [True: 8, False: 940]
  ------------------
   56|      8|      throw Decoding_Error("Invalid length for UCS-2 string");
   57|      8|   }
   58|       |
   59|    940|   const size_t chars = len / 2;
   60|       |
   61|    940|   std::string s;
   62|  10.5k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (62:22): [True: 9.57k, False: 940]
  ------------------
   63|  9.57k|      const uint32_t c = load_be<uint16_t>(ucs2, i);
   64|  9.57k|      append_utf8_for(s, c);
   65|  9.57k|   }
   66|       |
   67|    940|   return s;
   68|    948|}
_ZN5Botan12ucs4_to_utf8EPKhm:
   70|    962|std::string ucs4_to_utf8(const uint8_t ucs4[], size_t len) {
   71|    962|   if(len % 4 != 0) {
  ------------------
  |  Branch (71:7): [True: 2, False: 960]
  ------------------
   72|      2|      throw Decoding_Error("Invalid length for UCS-4 string");
   73|      2|   }
   74|       |
   75|    960|   const size_t chars = len / 4;
   76|       |
   77|    960|   std::string s;
   78|  1.66k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (78:22): [True: 701, False: 960]
  ------------------
   79|    701|      const uint32_t c = load_be<uint32_t>(ucs4, i);
   80|    701|      append_utf8_for(s, c);
   81|    701|   }
   82|       |
   83|    960|   return s;
   84|    962|}
_ZN5Botan14latin1_to_utf8EPKhm:
   89|  6.96k|std::string latin1_to_utf8(const uint8_t chars[], size_t len) {
   90|  6.96k|   std::string s;
   91|  62.2k|   for(size_t i = 0; i != len; ++i) {
  ------------------
  |  Branch (91:22): [True: 55.2k, False: 6.96k]
  ------------------
   92|  55.2k|      const uint32_t c = static_cast<uint8_t>(chars[i]);
   93|  55.2k|      append_utf8_for(s, c);
   94|  55.2k|   }
   95|  6.96k|   return s;
   96|  6.96k|}
charset.cpp:_ZN5Botan12_GLOBAL__N_115append_utf8_forERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEj:
   18|  65.5k|void append_utf8_for(std::string& s, uint32_t c) {
   19|  65.5k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (19:7): [True: 1.20k, False: 64.3k]
  |  Branch (19:22): [True: 23, False: 1.17k]
  ------------------
   20|     23|      throw Decoding_Error("Invalid Unicode character");
   21|     23|   }
   22|       |
   23|  65.5k|   if(c <= 0x7F) {
  ------------------
  |  Branch (23:7): [True: 17.0k, False: 48.4k]
  ------------------
   24|  17.0k|      const uint8_t b0 = static_cast<uint8_t>(c);
   25|  17.0k|      s.push_back(static_cast<char>(b0));
   26|  48.4k|   } else if(c <= 0x7FF) {
  ------------------
  |  Branch (26:14): [True: 42.2k, False: 6.20k]
  ------------------
   27|  42.2k|      const uint8_t b0 = 0xC0 | static_cast<uint8_t>(c >> 6);
   28|  42.2k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   29|  42.2k|      s.push_back(static_cast<char>(b0));
   30|  42.2k|      s.push_back(static_cast<char>(b1));
   31|  42.2k|   } else if(c <= 0xFFFF) {
  ------------------
  |  Branch (31:14): [True: 5.64k, False: 565]
  ------------------
   32|  5.64k|      const uint8_t b0 = 0xE0 | static_cast<uint8_t>(c >> 12);
   33|  5.64k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   34|  5.64k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   35|  5.64k|      s.push_back(static_cast<char>(b0));
   36|  5.64k|      s.push_back(static_cast<char>(b1));
   37|  5.64k|      s.push_back(static_cast<char>(b2));
   38|  5.64k|   } else if(c <= 0x10FFFF) {
  ------------------
  |  Branch (38:14): [True: 505, False: 60]
  ------------------
   39|    505|      const uint8_t b0 = 0xF0 | static_cast<uint8_t>(c >> 18);
   40|    505|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 12) & 0x3F);
   41|    505|      const uint8_t b2 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   42|    505|      const uint8_t b3 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   43|    505|      s.push_back(static_cast<char>(b0));
   44|    505|      s.push_back(static_cast<char>(b1));
   45|    505|      s.push_back(static_cast<char>(b2));
   46|    505|      s.push_back(static_cast<char>(b3));
   47|    505|   } else {
   48|     60|      throw Decoding_Error("Invalid Unicode character");
   49|     60|   }
   50|  65.5k|}

_ZN5Botan10DataSource9read_byteERh:
   26|  1.07M|size_t DataSource::read_byte(uint8_t& out) {
   27|  1.07M|   return read(&out, 1);
   28|  1.07M|}
_ZN5Botan10DataSource12discard_nextEm:
   40|   129k|size_t DataSource::discard_next(size_t n) {
   41|   129k|   uint8_t buf[64] = {0};
   42|   129k|   size_t discarded = 0;
   43|       |
   44|   322k|   while(n) {
  ------------------
  |  Branch (44:10): [True: 192k, False: 129k]
  ------------------
   45|   192k|      const size_t got = this->read(buf, std::min(n, sizeof(buf)));
   46|   192k|      discarded += got;
   47|   192k|      n -= got;
   48|       |
   49|   192k|      if(got == 0) {
  ------------------
  |  Branch (49:10): [True: 132, False: 192k]
  ------------------
   50|    132|         break;
   51|    132|      }
   52|   192k|   }
   53|       |
   54|   129k|   return discarded;
   55|   129k|}
_ZN5Botan17DataSource_Memory4readEPhm:
   60|   607k|size_t DataSource_Memory::read(uint8_t out[], size_t length) {
   61|   607k|   const size_t got = std::min<size_t>(m_source.size() - m_offset, length);
   62|   607k|   copy_mem(out, m_source.data() + m_offset, got);
   63|   607k|   m_offset += got;
   64|   607k|   return got;
   65|   607k|}
_ZN5Botan17DataSource_Memory15check_availableEm:
   67|  11.5k|bool DataSource_Memory::check_available(size_t n) {
   68|  11.5k|   return (n <= (m_source.size() - m_offset));
   69|  11.5k|}
_ZNK5Botan17DataSource_Memory4peekEPhmm:
   74|  27.2k|size_t DataSource_Memory::peek(uint8_t out[], size_t length, size_t peek_offset) const {
   75|  27.2k|   const size_t bytes_left = m_source.size() - m_offset;
   76|  27.2k|   if(peek_offset >= bytes_left) {
  ------------------
  |  Branch (76:7): [True: 13.7k, False: 13.4k]
  ------------------
   77|  13.7k|      return 0;
   78|  13.7k|   }
   79|       |
   80|  13.4k|   const size_t got = std::min(bytes_left - peek_offset, length);
   81|  13.4k|   copy_mem(out, &m_source[m_offset + peek_offset], got);
   82|  13.4k|   return got;
   83|  27.2k|}
_ZNK5Botan17DataSource_Memory11end_of_dataEv:
   88|  9.59k|bool DataSource_Memory::end_of_data() const {
   89|  9.59k|   return (m_offset == m_source.size());
   90|  9.59k|}

_ZN5Botan9ExceptionC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   71|  1.53k|Exception::Exception(std::string_view msg) : m_msg(msg) {}
_ZN5Botan14Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  125|  1.53k|Decoding_Error::Decoding_Error(std::string_view name) : Exception(name) {}

_ZN5Botan19secure_scrub_memoryEPvm:
   87|   124k|void secure_scrub_memory(void* ptr, size_t n) {
   88|       |#if defined(BOTAN_TARGET_OS_HAS_RTLSECUREZEROMEMORY)
   89|       |   ::RtlSecureZeroMemory(ptr, n);
   90|       |
   91|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_BZERO)
   92|   124k|   ::explicit_bzero(ptr, n);
   93|       |
   94|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_MEMSET)
   95|       |   (void)::explicit_memset(ptr, 0, n);
   96|       |
   97|       |#elif defined(BOTAN_USE_VOLATILE_MEMSET_FOR_ZERO) && (BOTAN_USE_VOLATILE_MEMSET_FOR_ZERO == 1)
   98|       |   /*
   99|       |   Call memset through a static volatile pointer, which the compiler
  100|       |   should not elide. This construct should be safe in conforming
  101|       |   compilers, but who knows. I did confirm that on x86-64 GCC 6.1 and
  102|       |   Clang 3.8 both create code that saves the memset address in the
  103|       |   data segment and unconditionally loads and jumps to that address.
  104|       |   */
  105|       |   static void* (*const volatile memset_ptr)(void*, int, size_t) = std::memset;
  106|       |   (memset_ptr)(ptr, 0, n);
  107|       |#else
  108|       |
  109|       |   volatile uint8_t* p = reinterpret_cast<volatile uint8_t*>(ptr);
  110|       |
  111|       |   for(size_t i = 0; i != n; ++i)
  112|       |      p[i] = 0;
  113|       |#endif
  114|   124k|}

_ZN5Botan7X509_DN13add_attributeERKNS_3OIDERKNS_11ASN1_StringE:
  100|  22.9k|void X509_DN::add_attribute(const OID& oid, const ASN1_String& str) {
  101|  22.9k|   if(str.empty()) {
  ------------------
  |  Branch (101:7): [True: 3.05k, False: 19.8k]
  ------------------
  102|  3.05k|      return;
  103|  3.05k|   }
  104|       |
  105|  19.8k|   m_rdn.push_back(std::make_pair(oid, str));
  106|  19.8k|   m_dn_bits.clear();
  107|  19.8k|}
_ZNK5Botan7X509_DN14get_attributesEv:
  112|  3.73k|std::multimap<OID, std::string> X509_DN::get_attributes() const {
  113|  3.73k|   std::multimap<OID, std::string> retval;
  114|       |
  115|  52.1k|   for(auto& i : m_rdn) {
  ------------------
  |  Branch (115:16): [True: 52.1k, False: 3.73k]
  ------------------
  116|  52.1k|      multimap_insert(retval, i.first, i.second.value());
  117|  52.1k|   }
  118|  3.73k|   return retval;
  119|  3.73k|}
_ZN5BotaneqERKNS_7X509_DNES2_:
  220|    623|bool operator==(const X509_DN& dn1, const X509_DN& dn2) {
  221|    623|   auto attr1 = dn1.get_attributes();
  222|    623|   auto attr2 = dn2.get_attributes();
  223|       |
  224|    623|   if(attr1.size() != attr2.size()) {
  ------------------
  |  Branch (224:7): [True: 284, False: 339]
  ------------------
  225|    284|      return false;
  226|    284|   }
  227|       |
  228|    339|   auto p1 = attr1.begin();
  229|    339|   auto p2 = attr2.begin();
  230|       |
  231|    635|   while(true) {
  ------------------
  |  Branch (231:10): [Folded - Ignored]
  ------------------
  232|    635|      if(p1 == attr1.end() && p2 == attr2.end()) {
  ------------------
  |  Branch (232:10): [True: 63, False: 572]
  |  Branch (232:10): [True: 63, False: 572]
  |  Branch (232:31): [True: 63, False: 0]
  ------------------
  233|     63|         break;
  234|     63|      }
  235|    572|      if(p1 == attr1.end()) {
  ------------------
  |  Branch (235:10): [True: 0, False: 572]
  ------------------
  236|      0|         return false;
  237|      0|      }
  238|    572|      if(p2 == attr2.end()) {
  ------------------
  |  Branch (238:10): [True: 0, False: 572]
  ------------------
  239|      0|         return false;
  240|      0|      }
  241|    572|      if(p1->first != p2->first) {
  ------------------
  |  Branch (241:10): [True: 44, False: 528]
  ------------------
  242|     44|         return false;
  243|     44|      }
  244|    528|      if(!x500_name_cmp(p1->second, p2->second)) {
  ------------------
  |  Branch (244:10): [True: 232, False: 296]
  ------------------
  245|    232|         return false;
  246|    232|      }
  247|    296|      ++p1;
  248|    296|      ++p2;
  249|    296|   }
  250|     63|   return true;
  251|    339|}
_ZN5BotanltERKNS_7X509_DNES2_:
  263|  1.24k|bool operator<(const X509_DN& dn1, const X509_DN& dn2) {
  264|  1.24k|   auto attr1 = dn1.get_attributes();
  265|  1.24k|   auto attr2 = dn2.get_attributes();
  266|       |
  267|       |   // If they are not the same size, choose the smaller as the "lessor"
  268|  1.24k|   if(attr1.size() < attr2.size()) {
  ------------------
  |  Branch (268:7): [True: 284, False: 962]
  ------------------
  269|    284|      return true;
  270|    284|   }
  271|    962|   if(attr1.size() > attr2.size()) {
  ------------------
  |  Branch (271:7): [True: 284, False: 678]
  ------------------
  272|    284|      return false;
  273|    284|   }
  274|       |
  275|       |   // We know they are the same # of elements, now compare the OIDs:
  276|    678|   auto p1 = attr1.begin();
  277|    678|   auto p2 = attr2.begin();
  278|       |
  279|  1.80k|   while(p1 != attr1.end() && p2 != attr2.end()) {
  ------------------
  |  Branch (279:10): [True: 1.23k, False: 578]
  |  Branch (279:10): [True: 1.23k, False: 578]
  |  Branch (279:31): [True: 1.23k, False: 0]
  ------------------
  280|  1.23k|      if(p1->first != p2->first) {
  ------------------
  |  Branch (280:10): [True: 100, False: 1.13k]
  ------------------
  281|    100|         return (p1->first < p2->first);
  282|    100|      }
  283|       |
  284|  1.13k|      ++p1;
  285|  1.13k|      ++p2;
  286|  1.13k|   }
  287|       |
  288|       |   // We know this is true because maps have the same size
  289|    578|   BOTAN_ASSERT_NOMSG(p1 == attr1.end());
  ------------------
  |  |   60|    578|   do {                                                                     \
  |  |   61|    578|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 578]
  |  |  ------------------
  |  |   62|    578|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|    578|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  290|    578|   BOTAN_ASSERT_NOMSG(p2 == attr2.end());
  ------------------
  |  |   60|    578|   do {                                                                     \
  |  |   61|    578|      if(!(expr))                                                           \
  |  |  ------------------
  |  |  |  Branch (61:10): [True: 0, False: 578]
  |  |  ------------------
  |  |   62|    578|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   63|    578|   } while(0)
  |  |  ------------------
  |  |  |  Branch (63:12): [Folded - Ignored]
  |  |  ------------------
  ------------------
  291|       |
  292|       |   // Now we know all elements have the same OIDs, compare
  293|       |   // their string values:
  294|       |
  295|    578|   p1 = attr1.begin();
  296|    578|   p2 = attr2.begin();
  297|  1.08k|   while(p1 != attr1.end() && p2 != attr2.end()) {
  ------------------
  |  Branch (297:10): [True: 958, False: 126]
  |  Branch (297:10): [True: 958, False: 126]
  |  Branch (297:31): [True: 958, False: 0]
  ------------------
  298|    958|      BOTAN_DEBUG_ASSERT(p1->first == p2->first);
  ------------------
  |  |   99|    958|      do {                          \
  |  |  100|    958|      } while(0)
  |  |  ------------------
  |  |  |  Branch (100:15): [Folded - Ignored]
  |  |  ------------------
  ------------------
  299|       |
  300|       |      // They may be binary different but same by X.500 rules, check this
  301|    958|      if(!x500_name_cmp(p1->second, p2->second)) {
  ------------------
  |  Branch (301:10): [True: 452, False: 506]
  ------------------
  302|       |         // If they are not (by X.500) the same string, pick the
  303|       |         // lexicographic first as the lessor
  304|    452|         return (p1->second < p2->second);
  305|    452|      }
  306|       |
  307|    506|      ++p1;
  308|    506|      ++p2;
  309|    506|   }
  310|       |
  311|       |   // if we reach here, then the DNs should be identical
  312|    126|   BOTAN_DEBUG_ASSERT(dn1 == dn2);
  ------------------
  |  |   99|    126|      do {                          \
  |  |  100|    126|      } while(0)
  |  |  ------------------
  |  |  |  Branch (100:15): [Folded - Ignored]
  |  |  ------------------
  ------------------
  313|    126|   return false;
  314|    578|}
_ZN5Botan7X509_DN11decode_fromERNS_11BER_DecoderE:
  347|  3.18k|void X509_DN::decode_from(BER_Decoder& source) {
  348|  3.18k|   std::vector<uint8_t> bits;
  349|       |
  350|  3.18k|   source.start_sequence().raw_bytes(bits).end_cons();
  351|       |
  352|  3.18k|   BER_Decoder sequence(bits);
  353|       |
  354|  3.18k|   m_rdn.clear();
  355|       |
  356|  11.1k|   while(sequence.more_items()) {
  ------------------
  |  Branch (356:10): [True: 7.94k, False: 3.18k]
  ------------------
  357|  7.94k|      BER_Decoder rdn = sequence.start_set();
  358|       |
  359|  31.4k|      while(rdn.more_items()) {
  ------------------
  |  Branch (359:13): [True: 23.5k, False: 7.94k]
  ------------------
  360|  23.5k|         OID oid;
  361|  23.5k|         ASN1_String str;
  362|       |
  363|  23.5k|         rdn.start_sequence()
  364|  23.5k|            .decode(oid)
  365|  23.5k|            .decode(str)  // TODO support Any
  366|  23.5k|            .end_cons();
  367|       |
  368|  23.5k|         add_attribute(oid, str);
  369|  23.5k|      }
  370|  7.94k|   }
  371|       |
  372|       |   // Have to assign last as add_attribute zaps m_dn_bits
  373|  3.18k|   m_dn_bits = bits;
  374|  3.18k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_113x500_name_cmpENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_:
   36|  1.48k|bool x500_name_cmp(std::string_view name1, std::string_view name2) {
   37|  1.48k|   auto p1 = name1.begin();
   38|  1.48k|   auto p2 = name2.begin();
   39|       |
   40|  1.97k|   while((p1 != name1.end()) && is_space(*p1)) {
  ------------------
  |  Branch (40:10): [True: 1.81k, False: 162]
  |  Branch (40:33): [True: 490, False: 1.32k]
  ------------------
   41|    490|      ++p1;
   42|    490|   }
   43|  1.99k|   while((p2 != name2.end()) && is_space(*p2)) {
  ------------------
  |  Branch (43:10): [True: 1.82k, False: 167]
  |  Branch (43:33): [True: 510, False: 1.31k]
  ------------------
   44|    510|      ++p2;
   45|    510|   }
   46|       |
   47|  6.31k|   while(p1 != name1.end() && p2 != name2.end()) {
  ------------------
  |  Branch (47:10): [True: 5.47k, False: 835]
  |  Branch (47:31): [True: 5.38k, False: 94]
  ------------------
   48|  5.38k|      if(is_space(*p1)) {
  ------------------
  |  Branch (48:10): [True: 180, False: 5.20k]
  ------------------
   49|    180|         if(!is_space(*p2)) {
  ------------------
  |  Branch (49:13): [True: 13, False: 167]
  ------------------
   50|     13|            return false;
   51|     13|         }
   52|       |
   53|    656|         while((p1 != name1.end()) && is_space(*p1)) {
  ------------------
  |  Branch (53:16): [True: 605, False: 51]
  |  Branch (53:39): [True: 489, False: 116]
  ------------------
   54|    489|            ++p1;
   55|    489|         }
   56|    648|         while((p2 != name2.end()) && is_space(*p2)) {
  ------------------
  |  Branch (56:16): [True: 600, False: 48]
  |  Branch (56:39): [True: 481, False: 119]
  ------------------
   57|    481|            ++p2;
   58|    481|         }
   59|       |
   60|    167|         if(p1 == name1.end() && p2 == name2.end()) {
  ------------------
  |  Branch (60:13): [True: 51, False: 116]
  |  Branch (60:34): [True: 39, False: 12]
  ------------------
   61|     39|            return true;
   62|     39|         }
   63|    128|         if(p1 == name1.end() || p2 == name2.end()) {
  ------------------
  |  Branch (63:13): [True: 12, False: 116]
  |  Branch (63:34): [True: 9, False: 107]
  ------------------
   64|     21|            return false;
   65|     21|         }
   66|    128|      }
   67|       |
   68|  5.30k|      if(!caseless_cmp(*p1, *p2)) {
  ------------------
  |  Branch (68:10): [True: 484, False: 4.82k]
  ------------------
   69|    484|         return false;
   70|    484|      }
   71|  4.82k|      ++p1;
   72|  4.82k|      ++p2;
   73|  4.82k|   }
   74|       |
   75|  1.26k|   while((p1 != name1.end()) && is_space(*p1)) {
  ------------------
  |  Branch (75:10): [True: 413, False: 852]
  |  Branch (75:33): [True: 336, False: 77]
  ------------------
   76|    336|      ++p1;
   77|    336|   }
   78|  1.26k|   while((p2 != name2.end()) && is_space(*p2)) {
  ------------------
  |  Branch (78:10): [True: 429, False: 840]
  |  Branch (78:33): [True: 340, False: 89]
  ------------------
   79|    340|      ++p2;
   80|    340|   }
   81|       |
   82|    929|   if((p1 != name1.end()) || (p2 != name2.end())) {
  ------------------
  |  Branch (82:7): [True: 77, False: 852]
  |  Branch (82:30): [True: 89, False: 763]
  ------------------
   83|    166|      return false;
   84|    166|   }
   85|    763|   return true;
   86|    929|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_112_GLOBAL__N_18is_spaceEc:
   27|  11.2k|bool is_space(char c) {
   28|  11.2k|   return std::isspace(static_cast<unsigned char>(c));
   29|  11.2k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_112_GLOBAL__N_112caseless_cmpEcc:
   23|  5.30k|bool caseless_cmp(char a, char b) {
   24|  5.30k|   return (std::tolower(static_cast<unsigned char>(a)) == std::tolower(static_cast<unsigned char>(b)));
   25|  5.30k|}

