_ZN5Botan17ct_if_is_zero_retITkNSt3__117unsigned_integralEmEEmT_m:
   45|    501|BOTAN_FORCE_INLINE constexpr size_t ct_if_is_zero_ret(T x, size_t s) {
   46|       |   /*
   47|       |   Similar to `return ct_is_zero(x) & s` but has to account for possibility that
   48|       |   sizeof(T) is smaller than sizeof(size_t) which would lead to incomplete masking
   49|       |   */
   50|    501|   const T a = ~x & (x - 1);
   51|    501|   const size_t a_top = static_cast<size_t>(CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1)));
   52|    501|   const size_t mask = static_cast<size_t>(0) - a_top;
   53|    501|   return mask & s;
   54|    501|}
_ZN5Botan8high_bitITkNSt3__117unsigned_integralEjEEmT_:
   73|  9.94k|BOTAN_FORCE_INLINE constexpr size_t high_bit(T n) {
   74|  9.94k|   size_t hb = 0;
   75|       |
   76|  59.6k|   for(size_t s = 8 * sizeof(T) / 2; s > 0; s /= 2) {
  ------------------
  |  Branch (76:38): [True: 49.7k, False: 9.94k]
  ------------------
   77|       |      // Equivalent to: ((n >> s) == 0) ? 0 : s;
   78|  49.7k|      const size_t z = s - ct_if_is_zero_ret<T>(n >> s, s);
   79|  49.7k|      hb += z;
   80|  49.7k|      n >>= z;
   81|  49.7k|   }
   82|       |
   83|  9.94k|   hb += static_cast<size_t>(n);
   84|       |
   85|  9.94k|   return hb;
   86|  9.94k|}
_ZN5Botan17ct_if_is_zero_retITkNSt3__117unsigned_integralEjEEmT_m:
   45|  49.7k|BOTAN_FORCE_INLINE constexpr size_t ct_if_is_zero_ret(T x, size_t s) {
   46|       |   /*
   47|       |   Similar to `return ct_is_zero(x) & s` but has to account for possibility that
   48|       |   sizeof(T) is smaller than sizeof(size_t) which would lead to incomplete masking
   49|       |   */
   50|  49.7k|   const T a = ~x & (x - 1);
   51|  49.7k|   const size_t a_top = static_cast<size_t>(CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1)));
   52|  49.7k|   const size_t mask = static_cast<size_t>(0) - a_top;
   53|  49.7k|   return mask & s;
   54|  49.7k|}
_ZN5Botan17significant_bytesITkNSt3__117unsigned_integralEmEEmT_:
   94|    167|BOTAN_FORCE_INLINE constexpr size_t significant_bytes(T n) {
   95|    167|   size_t b = 0;
   96|       |
   97|    668|   for(size_t s = 8 * sizeof(T) / 2; s >= 8; s /= 2) {
  ------------------
  |  Branch (97:38): [True: 501, False: 167]
  ------------------
   98|       |      // Equivalent to: ((n >> s) == 0) ? 0 : s;
   99|    501|      const size_t z = s - ct_if_is_zero_ret<T>(n >> s, s);
  100|    501|      b += z / 8;
  101|    501|      n >>= z;
  102|    501|   }
  103|       |
  104|    167|   b += (n != 0);
  105|       |
  106|    167|   return b;
  107|    167|}

_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEtQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   25|  26.2k|inline constexpr T reverse_bytes(T x) {
   26|       |   if constexpr(sizeof(T) == 1) {
   27|       |      return x;
   28|  26.2k|   } else if constexpr(sizeof(T) == 2) {
   29|  26.2k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap16)
   30|  26.2k|      return static_cast<T>(__builtin_bswap16(x));
   31|       |#else
   32|       |      return static_cast<T>((x << 8) | (x >> 8));
   33|       |#endif
   34|       |   } else if constexpr(sizeof(T) == 4) {
   35|       |#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap32)
   36|       |      return static_cast<T>(__builtin_bswap32(x));
   37|       |#else
   38|       |      // MSVC at least recognizes this as a bswap
   39|       |      return static_cast<T>(((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8) |
   40|       |                            ((x & 0xFF000000) >> 24));
   41|       |#endif
   42|       |   } else if constexpr(sizeof(T) == 8) {
   43|       |#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap64)
   44|       |      return static_cast<T>(__builtin_bswap64(x));
   45|       |#else
   46|       |      uint32_t hi = static_cast<uint32_t>(x >> 32);
   47|       |      uint32_t lo = static_cast<uint32_t>(x);
   48|       |
   49|       |      hi = reverse_bytes(hi);
   50|       |      lo = reverse_bytes(lo);
   51|       |
   52|       |      return (static_cast<T>(lo) << 32) | hi;
   53|       |#endif
   54|       |   }
   55|  26.2k|}
_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEjQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   25|  2.16k|inline constexpr T reverse_bytes(T x) {
   26|       |   if constexpr(sizeof(T) == 1) {
   27|       |      return x;
   28|       |   } else if constexpr(sizeof(T) == 2) {
   29|       |#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap16)
   30|       |      return static_cast<T>(__builtin_bswap16(x));
   31|       |#else
   32|       |      return static_cast<T>((x << 8) | (x >> 8));
   33|       |#endif
   34|  2.16k|   } else if constexpr(sizeof(T) == 4) {
   35|  2.16k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap32)
   36|  2.16k|      return static_cast<T>(__builtin_bswap32(x));
   37|       |#else
   38|       |      // MSVC at least recognizes this as a bswap
   39|       |      return static_cast<T>(((x & 0x000000FF) << 24) | ((x & 0x0000FF00) << 8) | ((x & 0x00FF0000) >> 8) |
   40|       |                            ((x & 0xFF000000) >> 24));
   41|       |#endif
   42|       |   } else if constexpr(sizeof(T) == 8) {
   43|       |#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap64)
   44|       |      return static_cast<T>(__builtin_bswap64(x));
   45|       |#else
   46|       |      uint32_t hi = static_cast<uint32_t>(x >> 32);
   47|       |      uint32_t lo = static_cast<uint32_t>(x);
   48|       |
   49|       |      hi = reverse_bytes(hi);
   50|       |      lo = reverse_bytes(lo);
   51|       |
   52|       |      return (static_cast<T>(lo) << 32) | hi;
   53|       |#endif
   54|       |   }
   55|  2.16k|}

_ZN5Botan12BufferSlicerC2ENSt3__14spanIKhLm18446744073709551615EEE:
   25|  72.2k|      explicit BufferSlicer(std::span<const uint8_t> buffer) : m_remaining(buffer) {}
_ZNK5Botan12BufferSlicer5emptyEv:
   75|   457k|      bool empty() const { return m_remaining.empty(); }
_ZN5Botan12BufferSlicer9take_byteEv:
   57|   200k|      uint8_t take_byte() { return take(1)[0]; }
_ZN5Botan12BufferSlicer4takeEm:
   37|   200k|      std::span<const uint8_t> take(const size_t count) {
   38|   200k|         BOTAN_STATE_CHECK(remaining() >= count);
  ------------------
  |  |   51|   200k|   do {                                                         \
  |  |   52|   200k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */             \
  |  |   53|   200k|      if(!(expr)) {                                             \
  |  |  ------------------
  |  |  |  Branch (53:10): [True: 0, False: 200k]
  |  |  ------------------
  |  |   54|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */    \
  |  |   55|      0|         Botan::throw_invalid_state(#expr, __func__, __FILE__); \
  |  |   56|      0|      }                                                         \
  |  |   57|   200k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (57:12): [Folded, False: 200k]
  |  |  ------------------
  ------------------
   39|   200k|         const auto result = m_remaining.first(count);
   40|   200k|         m_remaining = m_remaining.subspan(count);
   41|   200k|         return result;
   42|   200k|      }
_ZNK5Botan12BufferSlicer9remainingEv:
   73|   200k|      size_t remaining() const { return m_remaining.size(); }

_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|  3.00k|inline void do_fmt(std::ostringstream& oss, std::string_view format) {
   21|  3.00k|   oss << format;
   22|  3.00k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|  2.65k|std::string fmt(std::string_view format, const T&... args) {
   54|  2.65k|   std::ostringstream oss;
   55|  2.65k|   oss.imbue(std::locale::classic());
   56|  2.65k|   fmt_detail::do_fmt(oss, format, args...);
   57|  2.65k|   return oss.str();
   58|  2.65k|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|  2.65k|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|  2.65k|   size_t i = 0;
   27|       |
   28|  15.9k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 15.9k, False: 0]
  ------------------
   29|  15.9k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 2.65k, False: 13.2k]
  |  Branch (29:30): [True: 2.65k, False: 0]
  |  Branch (29:59): [True: 2.65k, False: 0]
  ------------------
   30|  2.65k|         oss << val;
   31|  2.65k|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  13.2k|      } else {
   33|  13.2k|         oss << format[i];
   34|  13.2k|      }
   35|       |
   36|  13.2k|      i += 1;
   37|  13.2k|   }
   38|  2.65k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEjEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|    104|std::string fmt(std::string_view format, const T&... args) {
   54|    104|   std::ostringstream oss;
   55|    104|   oss.imbue(std::locale::classic());
   56|    104|   fmt_detail::do_fmt(oss, format, args...);
   57|    104|   return oss.str();
   58|    104|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJjEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|    104|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    104|   size_t i = 0;
   27|       |
   28|    104|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 104, False: 0]
  ------------------
   29|    104|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 104, False: 0]
  |  Branch (29:30): [True: 104, False: 0]
  |  Branch (29:59): [True: 104, False: 0]
  ------------------
   30|    104|         oss << val;
   31|    104|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    104|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|    104|}
_ZN5Botan10fmt_detail6do_fmtIjJEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    260|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    260|   size_t i = 0;
   27|       |
   28|    624|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 624, False: 0]
  ------------------
   29|    624|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 260, False: 364]
  |  Branch (29:30): [True: 260, False: 0]
  |  Branch (29:59): [True: 260, False: 0]
  ------------------
   30|    260|         oss << val;
   31|    260|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    364|      } else {
   33|    364|         oss << format[i];
   34|    364|      }
   35|       |
   36|    364|      i += 1;
   37|    364|   }
   38|    260|}
_ZN5Botan3fmtIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS1_17basic_string_viewIcS4_EEDpRKT_:
   53|     95|std::string fmt(std::string_view format, const T&... args) {
   54|     95|   std::ostringstream oss;
   55|     95|   oss.imbue(std::locale::classic());
   56|     95|   fmt_detail::do_fmt(oss, format, args...);
   57|     95|   return oss.str();
   58|     95|}
_ZN5Botan10fmt_detail6do_fmtINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_S7_EENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|     95|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|     95|   size_t i = 0;
   27|       |
   28|  2.09k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 2.09k, False: 0]
  ------------------
   29|  2.09k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 95, False: 1.99k]
  |  Branch (29:30): [True: 95, False: 0]
  |  Branch (29:59): [True: 95, False: 0]
  ------------------
   30|     95|         oss << val;
   31|     95|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  1.99k|      } else {
   33|  1.99k|         oss << format[i];
   34|  1.99k|      }
   35|       |
   36|  1.99k|      i += 1;
   37|  1.99k|   }
   38|     95|}
_ZN5Botan3fmtIJjjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EEDpRKT_:
   53|    156|std::string fmt(std::string_view format, const T&... args) {
   54|    156|   std::ostringstream oss;
   55|    156|   oss.imbue(std::locale::classic());
   56|    156|   fmt_detail::do_fmt(oss, format, args...);
   57|    156|   return oss.str();
   58|    156|}
_ZN5Botan10fmt_detail6do_fmtIjJjEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    156|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    156|   size_t i = 0;
   27|       |
   28|  5.30k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 5.30k, False: 0]
  ------------------
   29|  5.30k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 156, False: 5.14k]
  |  Branch (29:30): [True: 156, False: 0]
  |  Branch (29:59): [True: 156, False: 0]
  ------------------
   30|    156|         oss << val;
   31|    156|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  5.14k|      } else {
   33|  5.14k|         oss << format[i];
   34|  5.14k|      }
   35|       |
   36|  5.14k|      i += 1;
   37|  5.14k|   }
   38|    156|}

_ZN5Botan11checked_addITkNSt3__117unsigned_integralEmTpTkNS1_17unsigned_integralEJmmEQ10all_same_vIT_DpT0_EEENS1_8optionalIS2_EES2_S2_S4_:
   37|   564k|constexpr inline std::optional<T> checked_add(T a, T b, Ts... rest) {
   38|   564k|   if(auto r = checked_add(a, b)) {
  ------------------
  |  Branch (38:12): [True: 564k, False: 0]
  ------------------
   39|   564k|      return checked_add(r.value(), rest...);
   40|   564k|   } else {
   41|      0|      return {};
   42|      0|   }
   43|   564k|}
_ZN5Botan11checked_addITkNSt3__117unsigned_integralEmEENS1_8optionalIT_EES3_S3_:
   19|  1.69M|constexpr inline std::optional<T> checked_add(T a, T b) {
   20|  1.69M|   const T r = a + b;
   21|  1.69M|   if(r < a || r < b) {
  ------------------
  |  Branch (21:7): [True: 0, False: 1.69M]
  |  Branch (21:16): [True: 0, False: 1.69M]
  ------------------
   22|      0|      return {};
   23|      0|   }
   24|  1.69M|   return r;
   25|  1.69M|}
_ZN5Botan11checked_addITkNSt3__117unsigned_integralEmTpTkNS1_17unsigned_integralEJmEQ10all_same_vIT_DpT0_EEENS1_8optionalIS2_EES2_S2_S4_:
   37|   564k|constexpr inline std::optional<T> checked_add(T a, T b, Ts... rest) {
   38|   564k|   if(auto r = checked_add(a, b)) {
  ------------------
  |  Branch (38:12): [True: 564k, False: 0]
  ------------------
   39|   564k|      return checked_add(r.value(), rest...);
   40|   564k|   } else {
   41|      0|      return {};
   42|      0|   }
   43|   564k|}
_ZN5Botan11checked_mulITkNSt3__117unsigned_integralEmEENS1_8optionalIT_EES3_S3_:
   46|  5.95k|constexpr inline std::optional<T> checked_mul(T a, T b) {
   47|       |   // Multiplication by 1U is a hack to work around C's insane
   48|       |   // integer promotion rules.
   49|       |   // https://stackoverflow.com/questions/24795651
   50|  5.95k|   const T r = (1U * a) * b;
   51|       |   // If a == 0 then the multiply certainly did not overflow
   52|       |   // Otherwise r / a == b unless overflow occurred
   53|  5.95k|   if(a != 0 && r / a != b) {
  ------------------
  |  Branch (53:7): [True: 5.95k, False: 0]
  |  Branch (53:17): [True: 0, False: 5.95k]
  ------------------
   54|      0|      return {};
   55|      0|   }
   56|  5.95k|   return r;
   57|  5.95k|}
_ZN5Botan11checked_addITkNSt3__117unsigned_integralEjEENS1_8optionalIT_EES3_S3_:
   19|  68.8k|constexpr inline std::optional<T> checked_add(T a, T b) {
   20|  68.8k|   const T r = a + b;
   21|  68.8k|   if(r < a || r < b) {
  ------------------
  |  Branch (21:7): [True: 0, False: 68.8k]
  |  Branch (21:16): [True: 0, False: 68.8k]
  ------------------
   22|      0|      return {};
   23|      0|   }
   24|  68.8k|   return r;
   25|  68.8k|}

_ZN5Botan8get_byteILm0EmEEhT0_QltT_stS1_:
   81|  8.76k|{
   82|  8.76k|   const size_t shift = ((~B) & (sizeof(T) - 1)) << 3;
   83|  8.76k|   return static_cast<uint8_t>((input >> shift) & 0xFF);
   84|  8.76k|}
_ZN5Botan12get_byte_varImEEhmT_:
   69|    254|inline constexpr uint8_t get_byte_var(size_t byte_num, T input) {
   70|    254|   return static_cast<uint8_t>(input >> (((~byte_num) & (sizeof(T) - 1)) << 3));
   71|    254|}
_ZN5Botan8store_leINS_6detail10AutoDetectEJmEEEDaDpOT0_:
  736|   149k|inline constexpr auto store_le(ParamTs&&... params) {
  737|   149k|   return detail::store_any<std::endian::little, ModifierT>(std::forward<ParamTs>(params)...);
  738|   149k|}
_ZN5Botan6detail9store_anyILNSt3__16endianE57005ENS0_10AutoDetectETpTkNS0_20unsigned_integralishEJmEQ10all_same_vIDpT1_EEEDaS6_:
  696|   149k|inline constexpr auto store_any(Ts... ins) {
  697|   149k|   return store_any<endianness, OutR>(std::array{ins...});
  698|   149k|}
_ZN5Botan6detail9store_anyILNSt3__16endianE57005ENS0_10AutoDetectETkNS_6ranges14spanable_rangeENS2_5arrayImLm1EEEQoooosr3stdE7same_asIS4_T0_Eaasr6rangesE25statically_spanable_rangeIS8_Esr3stdE21default_initializableIS8_Esr8conceptsE21resizable_byte_bufferIS8_EEEDaOT1_:
  663|   149k|inline constexpr auto store_any(InR&& in_range) {
  664|   149k|   auto out = []([[maybe_unused]] const auto& in) {
  665|   149k|      if constexpr(std::same_as<AutoDetect, OutR>) {
  666|   149k|         if constexpr(ranges::statically_spanable_range<InR>) {
  667|   149k|            constexpr size_t bytes = decltype(std::span{in})::extent * sizeof(std::ranges::range_value_t<InR>);
  668|   149k|            return std::array<uint8_t, bytes>();
  669|   149k|         } else {
  670|   149k|            static_assert(
  671|   149k|               !std::same_as<AutoDetect, OutR>,
  672|   149k|               "cannot infer a suitable result container type from the given parameters at compile time, please specify it explicitly");
  673|   149k|         }
  674|   149k|      } else if constexpr(concepts::resizable_byte_buffer<OutR>) {
  675|   149k|         return OutR(std::span{in}.size_bytes());
  676|   149k|      } else {
  677|   149k|         return OutR{};
  678|   149k|      }
  679|   149k|   }(in_range);
  680|       |
  681|   149k|   store_any<endianness, std::ranges::range_value_t<InR>>(out, std::forward<InR>(in_range));
  682|   149k|   return out;
  683|   149k|}
_ZZN5Botan6detail9store_anyILNSt3__16endianE57005ENS0_10AutoDetectETkNS_6ranges14spanable_rangeENS2_5arrayImLm1EEEQoooosr3stdE7same_asIS4_T0_Eaasr6rangesE25statically_spanable_rangeIS8_Esr3stdE21default_initializableIS8_Esr8conceptsE21resizable_byte_bufferIS8_EEEDaOT1_ENKUlRKT_E_clIS7_EEDaSD_:
  664|   149k|   auto out = []([[maybe_unused]] const auto& in) {
  665|   149k|      if constexpr(std::same_as<AutoDetect, OutR>) {
  666|   149k|         if constexpr(ranges::statically_spanable_range<InR>) {
  667|   149k|            constexpr size_t bytes = decltype(std::span{in})::extent * sizeof(std::ranges::range_value_t<InR>);
  668|   149k|            return std::array<uint8_t, bytes>();
  669|       |         } else {
  670|       |            static_assert(
  671|       |               !std::same_as<AutoDetect, OutR>,
  672|       |               "cannot infer a suitable result container type from the given parameters at compile time, please specify it explicitly");
  673|       |         }
  674|       |      } else if constexpr(concepts::resizable_byte_buffer<OutR>) {
  675|       |         return OutR(std::span{in}.size_bytes());
  676|       |      } else {
  677|       |         return OutR{};
  678|       |      }
  679|   149k|   }(in_range);
_ZN5Botan6detail9store_anyILNSt3__16endianE57005EmTkNS_6ranges23contiguous_output_rangeIhEERNS2_5arrayIhLm8EEETkNS4_14spanable_rangeENS6_ImLm1EEEQoosr3stdE7same_asINS0_10AutoDetectET0_Esr3stdE7same_asISB_NS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT2_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISJ_EESK_E4type10value_typeEEEEvOT1_RKSG_:
  603|   149k|inline constexpr void store_any(OutR&& out /* NOLINT(*-std-forward) */, const InR& in) {
  604|   149k|   ranges::assert_equal_byte_lengths(out, in);
  605|   149k|   using element_type = std::ranges::range_value_t<InR>;
  606|       |
  607|   149k|   const auto store_elementwise = [&] {
  608|   149k|      constexpr size_t bytes_per_element = sizeof(element_type);
  609|   149k|      std::span<uint8_t> out_s(out);
  610|   149k|      for(const auto in_elem : in) {
  611|   149k|         store_any<endianness, element_type>(out_s.template first<bytes_per_element>(), in_elem);
  612|   149k|         out_s = out_s.subspan(bytes_per_element);
  613|   149k|      }
  614|   149k|   };
  615|       |
  616|       |   // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  617|       |   // internally to copy ranges on a byte-by-byte basis, which is not allowed
  618|       |   // in a `constexpr` context.
  619|   149k|   if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (619:7): [Folded, False: 149k]
  ------------------
  620|      0|      store_elementwise();
  621|   149k|   } else {
  622|   149k|      if constexpr(endianness == std::endian::native && !custom_storable<element_type>) {
  623|   149k|         typecast_copy(out, in);
  624|       |      } else {
  625|       |         store_elementwise();
  626|       |      }
  627|   149k|   }
  628|   149k|}
_ZN5Botan7load_beItJPKhRmEEEDaDpOT0_:
  504|  26.2k|inline constexpr auto load_be(ParamTs&&... params) {
  505|  26.2k|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|  26.2k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtEET0_PKhm:
  454|  26.2k|inline constexpr OutT load_any(const uint8_t in[], size_t off) {
  455|       |   // asserts that *in points to enough bytes to read at offset off
  456|  26.2k|   constexpr size_t out_size = sizeof(OutT);
  457|  26.2k|   return load_any<endianness, OutT>(std::span<const uint8_t, out_size>(in + off * out_size, out_size));
  458|  26.2k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm2EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|  26.2k|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|  26.2k|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|  26.2k|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|  26.2k|   return detail::wrap_strong_type_or_enum<WrappedOutT>([&]() -> OutT {
  283|       |      // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  284|       |      // internally to copy ranges on a byte-by-byte basis, which is not allowed
  285|       |      // in a `constexpr` context.
  286|  26.2k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|  26.2k|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  26.2k|      } else {
  289|  26.2k|         const std::span in{in_range};
  290|  26.2k|         if constexpr(sizeof(OutT) == 1) {
  291|  26.2k|            return static_cast<OutT>(in[0]);
  292|  26.2k|         } else if constexpr(endianness == std::endian::native) {
  293|  26.2k|            return typecast_copy<OutT>(in);
  294|  26.2k|         } else {
  295|  26.2k|            static_assert(opposite(endianness) == std::endian::native);
  296|  26.2k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  26.2k|         }
  298|  26.2k|      }
  299|  26.2k|   }());
  300|  26.2k|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEtTkNSt3__117unsigned_integralEtEEDaT0_:
  200|  26.2k|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|  26.2k|   } else {
  204|  26.2k|      return Botan::wrap_strong_type<OutT>(t);
  205|  26.2k|   }
  206|  26.2k|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEtTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm2EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|  26.2k|   return detail::wrap_strong_type_or_enum<WrappedOutT>([&]() -> OutT {
  283|       |      // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  284|       |      // internally to copy ranges on a byte-by-byte basis, which is not allowed
  285|       |      // in a `constexpr` context.
  286|  26.2k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 26.2k]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  26.2k|      } else {
  289|  26.2k|         const std::span in{in_range};
  290|       |         if constexpr(sizeof(OutT) == 1) {
  291|       |            return static_cast<OutT>(in[0]);
  292|       |         } else if constexpr(endianness == std::endian::native) {
  293|       |            return typecast_copy<OutT>(in);
  294|  26.2k|         } else {
  295|  26.2k|            static_assert(opposite(endianness) == std::endian::native);
  296|  26.2k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  26.2k|         }
  298|  26.2k|      }
  299|  26.2k|   }());
_ZN5Botan7load_beIjJPKhRmEEEDaDpOT0_:
  504|  2.16k|inline constexpr auto load_be(ParamTs&&... params) {
  505|  2.16k|   return detail::load_any<std::endian::big, OutT>(std::forward<ParamTs>(params)...);
  506|  2.16k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjEET0_PKhm:
  454|  2.16k|inline constexpr OutT load_any(const uint8_t in[], size_t off) {
  455|       |   // asserts that *in points to enough bytes to read at offset off
  456|  2.16k|   constexpr size_t out_size = sizeof(OutT);
  457|  2.16k|   return load_any<endianness, OutT>(std::span<const uint8_t, out_size>(in + off * out_size, out_size));
  458|  2.16k|}
_ZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm4EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_:
  278|  2.16k|inline constexpr WrappedOutT load_any(InR&& in_range) {
  279|  2.16k|   using OutT = detail::wrapped_type<WrappedOutT>;
  280|  2.16k|   ranges::assert_exact_byte_length<sizeof(OutT)>(in_range);
  281|       |
  282|  2.16k|   return detail::wrap_strong_type_or_enum<WrappedOutT>([&]() -> OutT {
  283|       |      // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  284|       |      // internally to copy ranges on a byte-by-byte basis, which is not allowed
  285|       |      // in a `constexpr` context.
  286|  2.16k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  287|  2.16k|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  2.16k|      } else {
  289|  2.16k|         const std::span in{in_range};
  290|  2.16k|         if constexpr(sizeof(OutT) == 1) {
  291|  2.16k|            return static_cast<OutT>(in[0]);
  292|  2.16k|         } else if constexpr(endianness == std::endian::native) {
  293|  2.16k|            return typecast_copy<OutT>(in);
  294|  2.16k|         } else {
  295|  2.16k|            static_assert(opposite(endianness) == std::endian::native);
  296|  2.16k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  2.16k|         }
  298|  2.16k|      }
  299|  2.16k|   }());
  300|  2.16k|}
_ZN5Botan6detail24wrap_strong_type_or_enumITkNS0_20unsigned_integralishEjTkNSt3__117unsigned_integralEjEEDaT0_:
  200|  2.16k|constexpr auto wrap_strong_type_or_enum(T t) {
  201|       |   if constexpr(std::is_enum_v<OutT>) {
  202|       |      return static_cast<OutT>(t);
  203|  2.16k|   } else {
  204|  2.16k|      return Botan::wrap_strong_type<OutT>(t);
  205|  2.16k|   }
  206|  2.16k|}
_ZZN5Botan6detail8load_anyILNSt3__16endianE64206ETkNS0_20unsigned_integralishEjTkNS_6ranges16contiguous_rangeIhEENS2_4spanIKhLm4EEEQnt15custom_loadableINS0_19wrapped_type_helperIu14__remove_cvrefIT0_EE4typeEEEESA_OT1_ENKUlvE_clEv:
  282|  2.16k|   return detail::wrap_strong_type_or_enum<WrappedOutT>([&]() -> OutT {
  283|       |      // At compile time we cannot use `typecast_copy` as it uses `std::memcpy`
  284|       |      // internally to copy ranges on a byte-by-byte basis, which is not allowed
  285|       |      // in a `constexpr` context.
  286|  2.16k|      if(std::is_constant_evaluated()) /* TODO: C++23: if consteval {} */ {
  ------------------
  |  Branch (286:10): [Folded, False: 2.16k]
  ------------------
  287|      0|         return fallback_load_any<endianness, OutT>(std::forward<InR>(in_range));
  288|  2.16k|      } else {
  289|  2.16k|         const std::span in{in_range};
  290|       |         if constexpr(sizeof(OutT) == 1) {
  291|       |            return static_cast<OutT>(in[0]);
  292|       |         } else if constexpr(endianness == std::endian::native) {
  293|       |            return typecast_copy<OutT>(in);
  294|  2.16k|         } else {
  295|  2.16k|            static_assert(opposite(endianness) == std::endian::native);
  296|  2.16k|            return reverse_bytes(typecast_copy<OutT>(in));
  297|  2.16k|         }
  298|  2.16k|      }
  299|  2.16k|   }());

_ZN5Botan15bytes_to_stringENSt3__14spanIKhLm18446744073709551615EEE:
   76|  32.5k|inline std::string bytes_to_string(std::span<const uint8_t> bytes) {
   77|  32.5k|   return std::string(reinterpret_cast<const char*>(bytes.data()), bytes.size());
   78|  32.5k|}

_ZN5Botan2CT13value_barrierITkNSt3__117unsigned_integralEmQntsr3stdE7same_asIbT_EEES3_S3_:
   43|    501|constexpr inline T value_barrier(T x) {
   44|    501|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (44:7): [Folded, False: 501]
  ------------------
   45|      0|      return x;
   46|    501|   } else {
   47|    501|#if defined(BOTAN_CT_VALUE_BARRIER_USE_ASM)
   48|       |      /*
   49|       |      * We may want a "stronger" statement such as
   50|       |      *     asm volatile("" : "+r,m"(x) : : "memory);
   51|       |      * (see https://theunixzoo.co.uk/blog/2021-10-14-preventing-optimisations.html)
   52|       |      * however the current approach seems sufficient with current compilers,
   53|       |      * and is minimally damaging with regards to degrading code generation.
   54|       |      */
   55|    501|      asm("" : "+r"(x) : /* no input */);  // NOLINT(*-no-assembler)
   56|    501|      return x;
   57|       |#elif defined(BOTAN_CT_VALUE_BARRIER_USE_VOLATILE)
   58|       |      volatile T vx = x;
   59|       |      return vx;
   60|       |#else
   61|       |      return x;
   62|       |#endif
   63|    501|   }
   64|    501|}
_ZN5Botan2CT13value_barrierITkNSt3__117unsigned_integralEjQntsr3stdE7same_asIbT_EEES3_S3_:
   43|  49.7k|constexpr inline T value_barrier(T x) {
   44|  49.7k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (44:7): [Folded, False: 49.7k]
  ------------------
   45|      0|      return x;
   46|  49.7k|   } else {
   47|  49.7k|#if defined(BOTAN_CT_VALUE_BARRIER_USE_ASM)
   48|       |      /*
   49|       |      * We may want a "stronger" statement such as
   50|       |      *     asm volatile("" : "+r,m"(x) : : "memory);
   51|       |      * (see https://theunixzoo.co.uk/blog/2021-10-14-preventing-optimisations.html)
   52|       |      * however the current approach seems sufficient with current compilers,
   53|       |      * and is minimally damaging with regards to degrading code generation.
   54|       |      */
   55|  49.7k|      asm("" : "+r"(x) : /* no input */);  // NOLINT(*-no-assembler)
   56|  49.7k|      return x;
   57|       |#elif defined(BOTAN_CT_VALUE_BARRIER_USE_VOLATILE)
   58|       |      volatile T vx = x;
   59|       |      return vx;
   60|       |#else
   61|       |      return x;
   62|       |#endif
   63|  49.7k|   }
   64|  49.7k|}

_ZN5Botan11ASN1_ObjectC2Ev:
  146|   154k|      ASN1_Object() = default;
_ZN5Botan11ASN1_ObjectD2Ev:
  168|   560k|      virtual ~ASN1_Object() = default;
_ZNK5Botan10BER_Object6is_setEv:
  267|   563k|      bool is_set() const { return m_type_tag != ASN1_Type::NoObject; }
_ZNK5Botan10BER_Object7taggingEv:
  272|   306k|      uint32_t tagging() const { return type_tag() | class_tag(); }
_ZNK5Botan10BER_Object8type_tagEv:
  277|   306k|      ASN1_Type type_tag() const { return m_type_tag; }
_ZNK5Botan10BER_Object9class_tagEv:
  282|   306k|      ASN1_Class class_tag() const { return m_class_tag; }
_ZNK5Botan10BER_Object4typeEv:
  287|   144k|      ASN1_Type type() const { return m_type_tag; }
_ZNK5Botan10BER_Object9get_classEv:
  292|  72.3k|      ASN1_Class get_class() const { return m_class_tag; }
_ZNK5Botan10BER_Object4bitsEv:
  298|  1.11M|      const uint8_t* bits() const { return m_value.data(); }
_ZNK5Botan10BER_Object6lengthEv:
  303|  2.75M|      size_t length() const { return m_value.size(); }
_ZNK5Botan10BER_Object4dataEv:
  308|   104k|      std::span<const uint8_t> data() const { return std::span{m_value}; }
_ZN5Botan10BER_Object12mutable_bitsEm:
  344|   234k|      uint8_t* mutable_bits(size_t length) {
  345|   234k|         m_value.resize(length);
  346|   234k|         return m_value.data();
  347|   234k|      }
_ZNK5Botan3OID14get_componentsEv:
  530|   655k|      const std::vector<uint32_t>& get_components() const {
  531|   655k|         return m_id;
  532|   655k|      }
_ZNK5Botan11ASN1_String5valueEv:
  590|  68.8k|      const std::string& value() const { return m_utf8_str; }
_ZN5BotanorENS_10ASN1_ClassES0_:
   91|  90.9k|inline ASN1_Class operator|(ASN1_Class x, ASN1_Class y) {
   92|  90.9k|   return static_cast<ASN1_Class>(static_cast<uint32_t>(x) | static_cast<uint32_t>(y));
   93|  90.9k|}
_ZN5BotanorENS_9ASN1_TypeENS_10ASN1_ClassE:
   98|   306k|inline uint32_t operator|(ASN1_Type x, ASN1_Class y) {
   99|   306k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
  100|   306k|}
_ZN5BotanorENS_10ASN1_ClassENS_9ASN1_TypeE:
  105|  72.3k|inline uint32_t operator|(ASN1_Class x, ASN1_Type y) {
  106|  72.3k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
  107|  72.3k|}
_ZN5Botan10BER_ObjectC2Ev:
  239|   331k|      BER_Object() = default;
_ZN5Botan10BER_ObjectC2EOS0_:
  249|  89.3k|      BER_Object(BER_Object&& other) = default;
_ZN5Botan11ASN1_ObjectC2ERKS0_:
  151|  68.8k|      ASN1_Object(const ASN1_Object&) = default;
_ZN5Botan11ASN1_ObjectC2EOS0_:
  161|   337k|      ASN1_Object(ASN1_Object&&) = default;
_ZN5Botan11ASN1_ObjectaSEOS0_:
  166|   125k|      ASN1_Object& operator=(ASN1_Object&&) = default;
_ZN5Botan3OIDC2Ev:
  423|  72.4k|      explicit OID() = default;

_ZN5Botan13ignore_paramsIJjEEEvDpRKT_:
  149|  25.9k|constexpr void ignore_params([[maybe_unused]] const T&... args) {}

_ZN5Botan11BER_Decoder6Limits3BEREm:
   51|  3.18k|            static Limits BER(size_t max_nested_indef = 16) {
   52|  3.18k|               return Limits(true, max_nested_indef, false, DefaultMaxObjectSize, false);
   53|  3.18k|            }
_ZN5Botan11BER_Decoder6LimitsC2EbmbNSt3__18optionalImEEb:
  135|  3.18k|                  m_allow_ber(allow_ber),
  136|  3.18k|                  m_max_nested_indef(max_nested_indef),
  137|  3.18k|                  m_allow_standalone_eoc(allow_standalone_eoc),
  138|  3.18k|                  m_max_object_size(max_object_size),
  139|  3.18k|                  m_reject_default_value_encoding(reject_default_value_encoding) {}
_ZNK5Botan11BER_Decoder6Limits18allow_ber_encodingEv:
   58|   559k|            bool allow_ber_encoding() const { return m_allow_ber; }
_ZNK5Botan11BER_Decoder6Limits20require_der_encodingEv:
   63|   324k|            bool require_der_encoding() const { return !allow_ber_encoding(); }
_ZNK5Botan11BER_Decoder6Limits28max_nested_indefinite_lengthEv:
   68|   234k|            size_t max_nested_indefinite_length() const { return m_max_nested_indef; }
_ZNK5Botan11BER_Decoder6Limits20allow_standalone_eocEv:
   76|     70|            bool allow_standalone_eoc() const { return m_allow_standalone_eoc; }
_ZNK5Botan11BER_Decoder6Limits15max_object_sizeEv:
   82|   234k|            std::optional<size_t> max_object_size() const { return m_max_object_size; }
_ZNK5Botan11BER_Decoder6limitsEv:
  199|  92.2k|      Limits limits() const { return m_limits; }
_ZN5Botan11BER_Decoder14start_sequenceEv:
  277|  77.7k|      BER_Decoder start_sequence() { return start_cons(ASN1_Type::Sequence, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9start_setEv:
  283|  14.0k|      BER_Decoder start_set() { return start_cons(ASN1_Type::Set, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9raw_bytesINSt3__16vectorIhNS2_9allocatorIhEEEEQsr8conceptsE20ordinary_byte_vectorINS_6detail19wrapped_type_helperIu14__remove_cvrefIT_EE4typeEEEERS0_RS9_:
  341|  2.92k|      BER_Decoder& raw_bytes(T& out_wrapped) {
  342|  2.92k|         auto& out = unwrap_strong_type(out_wrapped);
  343|  2.92k|         out.clear();
  344|  2.92k|         uint8_t buf[64];
  345|  23.7k|         while(const size_t got = this->read_bytes(std::span{buf})) {
  ------------------
  |  Branch (345:29): [True: 20.8k, False: 2.92k]
  ------------------
  346|  20.8k|            out.insert(out.end(), buf, buf + got);
  347|  20.8k|         }
  348|  2.92k|         return (*this);
  349|  2.92k|      }

_ZN5Botan10DataSourceC2Ev:
  107|  95.4k|      DataSource() = default;
_ZN5Botan10DataSourceD2Ev:
  109|  95.4k|      virtual ~DataSource() = default;
_ZN5Botan17DataSource_MemoryC2ENSt3__14spanIKhLm18446744073709551615EEE:
  181|  6.11k|      explicit DataSource_Memory(std::span<const uint8_t> in) : m_offset(0) {
  182|       |         // Guard against forming a range from a null pointer (eg an empty span)
  183|  6.11k|         if(!in.empty()) {
  ------------------
  |  Branch (183:13): [True: 5.95k, False: 163]
  ------------------
  184|  5.95k|            m_source.assign(in.begin(), in.end());
  185|  5.95k|         }
  186|  6.11k|      }

_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassENSt3__14spanIKhLm18446744073709551615EEE:
  410|  68.8k|      DER_Encoder& add_object(ASN1_Type type_tag, ASN1_Class class_tag, std::span<const uint8_t> rep) {
  411|  68.8k|         return add_object(type_tag, class_tag, rep.data(), rep.size());
  412|  68.8k|      }
_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassERKNSt3__16vectorIhNS3_9allocatorIhEEEE:
  421|  68.8k|      DER_Encoder& add_object(ASN1_Type type_tag, ASN1_Class class_tag, const std::vector<uint8_t>& rep) {
  422|  68.8k|         return add_object(type_tag, class_tag, std::span{rep});
  423|  68.8k|      }

_ZN5Botan8copy_memIhQsr3stdE12is_trivial_vIu7__decayIT_EEEEvPS1_PKS1_m:
  144|  1.93M|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  145|  1.93M|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |  110|  1.93M|   do {                                                                                          \
  |  |  111|  1.93M|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                              \
  |  |  112|  3.73M|      if((expr1) && !(expr2)) {                                                                  \
  |  |  ------------------
  |  |  |  Branch (112:10): [True: 1.86M, False: 62.7k]
  |  |  |  Branch (112:23): [True: 1.86M, False: 0]
  |  |  |  Branch (112:23): [True: 1.86M, False: 0]
  |  |  ------------------
  |  |  113|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                                     \
  |  |  114|      0|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |  115|      0|      }                                                                                          \
  |  |  116|  1.93M|   } while(0)
  |  |  ------------------
  |  |  |  Branch (116:12): [Folded, False: 1.93M]
  |  |  ------------------
  ------------------
  146|       |
  147|  1.93M|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (147:7): [True: 1.92M, False: 181]
  |  Branch (147:24): [True: 1.87M, False: 58.2k]
  |  Branch (147:42): [True: 1.86M, False: 4.41k]
  ------------------
  148|  1.86M|      std::memmove(out, in, sizeof(T) * n);
  149|  1.86M|   }
  150|  1.93M|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeERNSt3__15arrayIhLm8EEETkNS1_16contiguous_rangeENS3_ImLm1EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEEEvOSL_RKSB_:
  176|   149k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|   149k|   ranges::assert_equal_byte_lengths(out, in);
  178|   149k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|   149k|}
_ZN5Botan19secure_scrub_memoryITkNS_6ranges23contiguous_output_rangeERNSt3__16vectorIhNS2_9allocatorIhEEEEEEvOT_:
   59|   421k|void secure_scrub_memory(ranges::contiguous_output_range auto&& data) {
   60|   421k|   secure_scrub_memory(std::ranges::data(data), ranges::size_bytes(data));
   61|   421k|}
_ZN5Botan13typecast_copyItTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm2EEEQaaaasr3stdE26is_default_constructible_vIT_Esr3stdE23is_trivially_copyable_vIS6_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEEES6_RKSB_:
  210|  26.2k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  26.2k|   ToT dst;  // NOLINT(*-member-init)
  212|  26.2k|   typecast_copy(dst, src);
  213|  26.2k|   return dst;
  214|  26.2k|}
_ZN5Botan13typecast_copyItTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm2EEEQaaaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIT_Entsr3std6rangesE5rangeISK_EEEvRSK_RKSA_:
  188|  26.2k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  26.2k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  26.2k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanItLm1EEETkNS1_16contiguous_rangeENS3_IKhLm2EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEEEvOSL_RKSB_:
  176|  26.2k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  26.2k|   ranges::assert_equal_byte_lengths(out, in);
  178|  26.2k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  26.2k|}
_ZN5Botan13typecast_copyIjTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm4EEEQaaaasr3stdE26is_default_constructible_vIT_Esr3stdE23is_trivially_copyable_vIS6_Esr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEEES6_RKSB_:
  210|  2.16k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  2.16k|   ToT dst;  // NOLINT(*-member-init)
  212|  2.16k|   typecast_copy(dst, src);
  213|  2.16k|   return dst;
  214|  2.16k|}
_ZN5Botan13typecast_copyIjTkNS_6ranges16contiguous_rangeENSt3__14spanIKhLm4EEEQaaaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISD_EESE_E4type10value_typeEEsr3stdE23is_trivially_copyable_vIT_Entsr3std6rangesE5rangeISK_EEEvRSK_RKSA_:
  188|  2.16k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  2.16k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  2.16k|}
_ZN5Botan13typecast_copyITkNS_6ranges23contiguous_output_rangeENSt3__14spanIjLm1EEETkNS1_16contiguous_rangeENS3_IKhLm4EEEQaasr3stdE23is_trivially_copyable_vINS2_11conditionalIXsr21__is_primary_templateINS2_15iterator_traitsIu14__remove_cvrefIDTclL_ZNS2_6ranges5__cpo5beginEEclsr3stdE7declvalIRT0_EEEEEEEEE5valueENS2_26indirectly_readable_traitsISE_EESF_E4type10value_typeEEsr3stdE23is_trivially_copyable_vINS7_IXsr21__is_primary_templateINS8_Iu14__remove_cvrefIDTclL_ZNSA_5beginEEclsr3stdE7declvalIRT_EEEEEEEEE5valueENSG_ISO_EESP_E4type10value_typeEEEEvOSL_RKSB_:
  176|  2.16k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  2.16k|   ranges::assert_equal_byte_lengths(out, in);
  178|  2.16k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  2.16k|}

_ZN5Botan7X509_DNC2Ev:
  159|  9.56k|      X509_DN() = default;
_ZNK5Botan7X509_DN16_canonical_bytesEv:
  274|  7.45k|      const std::vector<uint8_t>& _canonical_bytes() const { return m_canonical_dn_bits; }

_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__15arrayIhLm8EEETpTkNS0_14spanable_rangeEJNS3_ImLm1EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|   299k|{
  101|   299k|   const std::span s0{r0};
  102|       |
  103|   299k|   if constexpr(statically_spanable_range<R0>) {
  104|   299k|      constexpr size_t expected_size = s0.size_bytes();
  105|   299k|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|   299k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__15arrayImLm1EEEEEvRKT0_:
   77|   299k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|   299k|   const std::span s{r};
   79|   299k|   if constexpr(statically_spanable_range<R>) {
   80|   299k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|   299k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__15arrayIhLm8EEEEEmRKT_:
   59|   149k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   149k|   return std::span{r}.size_bytes();
   61|   149k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__16vectorIhNS2_9allocatorIhEEEEEEmRKT_:
   59|   421k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   421k|   return std::span{r}.size_bytes();
   61|   421k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm2ETkNS0_14spanable_rangeENSt3__14spanIKhLm2EEEEEvRKT0_:
   77|  52.5k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  52.5k|   const std::span s{r};
   79|  52.5k|   if constexpr(statically_spanable_range<R>) {
   80|  52.5k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|  52.5k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanItLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm2EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  26.2k|{
  101|  26.2k|   const std::span s0{r0};
  102|       |
  103|  26.2k|   if constexpr(statically_spanable_range<R0>) {
  104|  26.2k|      constexpr size_t expected_size = s0.size_bytes();
  105|  26.2k|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|  26.2k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanItLm1EEEEEmRKT_:
   59|  26.2k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  26.2k|   return std::span{r}.size_bytes();
   61|  26.2k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ETkNS0_14spanable_rangeENSt3__14spanIKhLm4EEEEEvRKT0_:
   77|  4.33k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  4.33k|   const std::span s{r};
   79|  4.33k|   if constexpr(statically_spanable_range<R>) {
   80|  4.33k|      static_assert(s.size_bytes() == expected, "memory region does not have expected byte lengths");
   81|       |   } else {
   82|       |      if(s.size_bytes() != expected) {
   83|       |         memory_region_size_violation();
   84|       |      }
   85|       |   }
   86|  4.33k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIjLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm4EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  2.16k|{
  101|  2.16k|   const std::span s0{r0};
  102|       |
  103|  2.16k|   if constexpr(statically_spanable_range<R0>) {
  104|  2.16k|      constexpr size_t expected_size = s0.size_bytes();
  105|  2.16k|      (assert_exact_byte_length<expected_size>(rs), ...);
  106|       |   } else {
  107|       |      const size_t expected_size = s0.size_bytes();
  108|       |      const bool correct_size =
  109|       |         ((std::span<const std::ranges::range_value_t<Rs>>{rs}.size_bytes() == expected_size) && ...);
  110|       |
  111|       |      if(!correct_size) {
  112|       |         memory_region_size_violation();
  113|       |      }
  114|       |   }
  115|  2.16k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIjLm1EEEEEmRKT_:
   59|  2.16k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  2.16k|   return std::span{r}.size_bytes();
   61|  2.16k|}

_ZN5Botan16secure_allocatorIhE10deallocateEPhm:
  102|  5.95k|      void deallocate(T* p, std::size_t n) { deallocate_memory(p, n, sizeof(T)); }
_ZN5Botan16secure_allocatorIhE8allocateEm:
   95|  5.95k|      T* allocate(std::size_t n) { return static_cast<T*>(allocate_memory(n, sizeof(T))); }

_ZN5Botan18unwrap_strong_typeIRNSt3__16vectorIhNS1_9allocatorIhEEEEEEDcOT_:
  119|  2.92k|[[nodiscard]] constexpr decltype(auto) unwrap_strong_type(T&& t) {
  120|  2.92k|   if constexpr(!concepts::strong_type<std::remove_cvref_t<T>>) {
  121|       |      // If the parameter type isn't a strong type, return it as is.
  122|  2.92k|      return std::forward<T>(t);
  123|       |   } else {
  124|       |      // Unwrap the strong type and return the underlying value.
  125|       |      return std::forward<T>(t).get();
  126|       |   }
  127|  2.92k|}
_ZN5Botan16wrap_strong_typeItRtQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  144|  26.2k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  145|  26.2k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  146|       |      // Noop, if the parameter type already is the desired return type.
  147|  26.2k|      return std::forward<ParamT>(t);
  148|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  149|       |      // Implicit conversion from the parameter type to the return type.
  150|       |      return T{std::forward<ParamT>(t)};
  151|       |   } else {
  152|       |      // Explicitly calling the wrapped type's constructor to support
  153|       |      // implicit conversions on types that mark their constructors as explicit.
  154|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  155|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  156|       |   }
  157|  26.2k|}
_ZN5Botan16wrap_strong_typeIjRjQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  144|  2.16k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  145|  2.16k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  146|       |      // Noop, if the parameter type already is the desired return type.
  147|  2.16k|      return std::forward<ParamT>(t);
  148|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  149|       |      // Implicit conversion from the parameter type to the return type.
  150|       |      return T{std::forward<ParamT>(t)};
  151|       |   } else {
  152|       |      // Explicitly calling the wrapped type's constructor to support
  153|       |      // implicit conversions on types that mark their constructors as explicit.
  154|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  155|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  156|       |   }
  157|  2.16k|}

LLVMFuzzerInitialize:
   28|      2|extern "C" int LLVMFuzzerInitialize(int* /*argc*/, char*** /*argv*/) {
   29|       |   /*
   30|       |   * This disables the mlock pool, as overwrites within the pool are
   31|       |   * opaque to ASan or other instrumentation.
   32|       |   */
   33|      2|   ::setenv("BOTAN_MLOCK_POOL_SIZE", "0", 1);
   34|      2|   return 0;
   35|      2|}
LLVMFuzzerTestOneInput:
   39|  3.18k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t in[], size_t len) {
   40|  3.18k|   if(len <= max_fuzzer_input_size) {
  ------------------
  |  Branch (40:7): [True: 3.18k, False: 1]
  ------------------
   41|  3.18k|      try {
   42|  3.18k|         fuzz(std::span<const uint8_t>(in, len));
   43|  3.18k|      } catch(const std::exception& e) {
   44|      0|         std::cerr << "Uncaught exception from fuzzer driver " << e.what() << "\n";
   45|      0|         abort();
   46|      0|      } catch(...) {
   47|      0|         std::cerr << "Uncaught exception from fuzzer driver (unknown type)\n";
   48|      0|         abort();
   49|      0|      }
   50|  3.18k|   }
   51|  3.18k|   return 0;
   52|  3.18k|}

_Z4fuzzNSt3__14spanIKhLm18446744073709551615EEE:
   64|  3.18k|void fuzz(std::span<const uint8_t> in) {
   65|  3.18k|   Botan::X509_DN dn1;
   66|  3.18k|   Botan::X509_DN dn2;
   67|  3.18k|   Botan::X509_DN dn3;
   68|       |
   69|  3.18k|   try {
   70|  3.18k|      Botan::BER_Decoder ber(in);
   71|  3.18k|      dn1.decode_from(ber);
   72|  3.18k|      dn2.decode_from(ber);
   73|  3.18k|      dn3.decode_from(ber);
   74|  3.18k|   } catch(...) {
   75|  3.05k|      return;
   76|  3.05k|   }
   77|       |
   78|       |   // Pairwise consistency of < and ==
   79|    138|   check_pairwise(dn1, dn2);
   80|    138|   check_pairwise(dn1, dn3);
   81|    138|   check_pairwise(dn2, dn3);
   82|       |
   83|       |   // Transitivity across all three
   84|    138|   check_transitivity(dn1, dn2, dn3);
   85|    138|   check_transitivity(dn1, dn3, dn2);
   86|    138|   check_transitivity(dn2, dn1, dn3);
   87|    138|}
x509_dn.cpp:_ZN12_GLOBAL__N_114check_pairwiseERKN5Botan7X509_DNES3_:
   14|    414|void check_pairwise(const Botan::X509_DN& a, const Botan::X509_DN& b) {
   15|    414|   const bool eq = a == b;
   16|    414|   const bool lt1 = a < b;
   17|    414|   const bool lt2 = b < a;
   18|       |
   19|    414|   if(lt1 == false && lt2 == false) {
  ------------------
  |  Branch (19:7): [True: 241, False: 173]
  |  Branch (19:23): [True: 48, False: 193]
  ------------------
   20|     48|      FUZZER_ASSERT_TRUE(eq);
  ------------------
  |  |   89|     48|   do {                                                               \
  |  |   90|     48|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     48|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 48]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|     48|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 48]
  |  |  ------------------
  ------------------
   21|    366|   } else {
   22|    366|      FUZZER_ASSERT_TRUE(!eq);
  ------------------
  |  |   89|    366|   do {                                                               \
  |  |   90|    366|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    366|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 366]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|    366|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 366]
  |  |  ------------------
  ------------------
   23|    366|      FUZZER_ASSERT_TRUE(!lt1 || !lt2);
  ------------------
  |  |   89|    366|   do {                                                               \
  |  |   90|    366|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    539|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:12): [True: 193, False: 173]
  |  |  |  Branch (91:12): [True: 173, False: 0]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|    366|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 366]
  |  |  ------------------
  ------------------
   24|    366|   }
   25|    414|}
x509_dn.cpp:_ZN12_GLOBAL__N_118check_transitivityERKN5Botan7X509_DNES3_S3_:
   27|    414|void check_transitivity(const Botan::X509_DN& a, const Botan::X509_DN& b, const Botan::X509_DN& c) {
   28|    414|   const bool ab = a < b;
   29|    414|   const bool ba = b < a;
   30|    414|   const bool bc = b < c;
   31|    414|   const bool cb = c < b;
   32|    414|   const bool ac = a < c;
   33|    414|   const bool ca = c < a;
   34|       |
   35|       |   // a < b && b < c => a < c
   36|    414|   if(ab && bc) {
  ------------------
  |  Branch (36:7): [True: 186, False: 228]
  |  Branch (36:13): [True: 54, False: 132]
  ------------------
   37|     54|      FUZZER_ASSERT_TRUE(ac);
  ------------------
  |  |   89|     54|   do {                                                               \
  |  |   90|     54|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     54|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 54]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|     54|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 54]
  |  |  ------------------
  ------------------
   38|     54|   }
   39|    414|   if(cb && ba) {
  ------------------
  |  Branch (39:7): [True: 180, False: 234]
  |  Branch (39:13): [True: 44, False: 136]
  ------------------
   40|     44|      FUZZER_ASSERT_TRUE(ca);
  ------------------
  |  |   89|     44|   do {                                                               \
  |  |   90|     44|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     44|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 44]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|     44|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 44]
  |  |  ------------------
  ------------------
   41|     44|   }
   42|    414|   if(ac && cb) {
  ------------------
  |  Branch (42:7): [True: 173, False: 241]
  |  Branch (42:13): [True: 61, False: 112]
  ------------------
   43|     61|      FUZZER_ASSERT_TRUE(ab);
  ------------------
  |  |   89|     61|   do {                                                               \
  |  |   90|     61|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     61|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 61]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|     61|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 61]
  |  |  ------------------
  ------------------
   44|     61|   }
   45|       |
   46|       |   // equivalence: !(a<b) && !(b<a) means a~b
   47|       |   // a~b && b<c => a<c
   48|    414|   if(!ab && !ba && bc) {
  ------------------
  |  Branch (48:7): [True: 228, False: 186]
  |  Branch (48:14): [True: 37, False: 191]
  |  Branch (48:21): [True: 16, False: 21]
  ------------------
   49|     16|      FUZZER_ASSERT_TRUE(ac);
  ------------------
  |  |   89|     16|   do {                                                               \
  |  |   90|     16|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     16|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 16]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|     16|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 16]
  |  |  ------------------
  ------------------
   50|     16|   }
   51|    414|   if(!ab && !ba && cb) {
  ------------------
  |  Branch (51:7): [True: 228, False: 186]
  |  Branch (51:14): [True: 37, False: 191]
  |  Branch (51:21): [True: 9, False: 28]
  ------------------
   52|      9|      FUZZER_ASSERT_TRUE(ca);
  ------------------
  |  |   89|      9|   do {                                                               \
  |  |   90|      9|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|      9|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 9]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|      9|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 9]
  |  |  ------------------
  ------------------
   53|      9|   }
   54|    414|   if(!bc && !cb && ab) {
  ------------------
  |  Branch (54:7): [True: 239, False: 175]
  |  Branch (54:14): [True: 59, False: 180]
  |  Branch (54:21): [True: 5, False: 54]
  ------------------
   55|      5|      FUZZER_ASSERT_TRUE(ac);
  ------------------
  |  |   89|      5|   do {                                                               \
  |  |   90|      5|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|      5|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 5]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|      5|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
   56|      5|   }
   57|    414|   if(!bc && !cb && ca) {
  ------------------
  |  Branch (57:7): [True: 239, False: 175]
  |  Branch (57:14): [True: 59, False: 180]
  |  Branch (57:21): [True: 42, False: 17]
  ------------------
   58|     42|      FUZZER_ASSERT_TRUE(ba);
  ------------------
  |  |   89|     42|   do {                                                               \
  |  |   90|     42|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     42|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 42]
  |  |  ------------------
  |  |   92|      0|         FUZZER_WRITE_AND_CRASH("Expression " << #e << " was false"); \
  |  |  ------------------
  |  |  |  |   70|      0|   do {                                                                                                       \
  |  |  |  |   71|      0|      std::cerr << expr << " @ Line " << __LINE__ << " in " << __FILE__ << "\n"; /* NOLINT(*-macro-paren*) */ \
  |  |  |  |   72|      0|      abort();                                                                                                \
  |  |  |  |   73|      0|   } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (73:12): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   93|      0|      }                                                               \
  |  |   94|     42|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 42]
  |  |  ------------------
  ------------------
   59|     42|   }
   60|    414|}

_ZNK5Botan11ASN1_Object10BER_encodeEv:
   21|  68.8k|std::vector<uint8_t> ASN1_Object::BER_encode() const {
   22|  68.8k|   std::vector<uint8_t> output;
   23|  68.8k|   DER_Encoder der(output);
   24|  68.8k|   this->encode_into(der);
   25|  68.8k|   return output;
   26|  68.8k|}
_ZN5Botan10BER_ObjectD2Ev:
   58|   421k|BER_Object::~BER_Object() {
   59|   421k|   secure_scrub_memory(m_value);
   60|   421k|}
_ZNK5Botan10BER_Object11assert_is_aENS_9ASN1_TypeENS_10ASN1_ClassENSt3__117basic_string_viewIcNS3_11char_traitsIcEEEE:
   65|  90.9k|void BER_Object::assert_is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag, std::string_view descr) const {
   66|  90.9k|   if(!this->is_a(expected_type_tag, expected_class_tag)) {
  ------------------
  |  Branch (66:7): [True: 1.59k, False: 89.3k]
  ------------------
   67|  1.59k|      std::stringstream msg;
   68|       |
   69|  1.59k|      msg << "Tag mismatch when decoding " << descr << " got ";
   70|       |
   71|  1.59k|      if(m_class_tag == ASN1_Class::NoObject && m_type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (71:10): [True: 1.35k, False: 243]
  |  Branch (71:49): [True: 1.35k, False: 0]
  ------------------
   72|  1.35k|         msg << "EOF";
   73|  1.35k|      } else {
   74|    243|         if(m_class_tag == ASN1_Class::Universal || m_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (74:13): [True: 108, False: 135]
  |  Branch (74:53): [True: 89, False: 46]
  ------------------
   75|    197|            msg << asn1_tag_to_string(m_type_tag);
   76|    197|         } else {
   77|     46|            msg << std::to_string(static_cast<uint32_t>(m_type_tag));
   78|     46|         }
   79|       |
   80|    243|         msg << "/" << asn1_class_to_string(m_class_tag);
   81|    243|      }
   82|       |
   83|  1.59k|      msg << " expected ";
   84|       |
   85|  1.59k|      if(expected_class_tag == ASN1_Class::Universal || expected_class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (85:10): [True: 0, False: 1.59k]
  |  Branch (85:57): [True: 1.59k, False: 0]
  ------------------
   86|  1.59k|         msg << asn1_tag_to_string(expected_type_tag);
   87|  1.59k|      } else {
   88|      0|         msg << std::to_string(static_cast<uint32_t>(expected_type_tag));
   89|      0|      }
   90|       |
   91|  1.59k|      msg << "/" << asn1_class_to_string(expected_class_tag);
   92|       |
   93|  1.59k|      throw BER_Decoding_Error(msg.str());
   94|  1.59k|   }
   95|  90.9k|}
_ZNK5Botan10BER_Object4is_aENS_9ASN1_TypeENS_10ASN1_ClassE:
   97|  90.9k|bool BER_Object::is_a(ASN1_Type expected_type_tag, ASN1_Class expected_class_tag) const {
   98|  90.9k|   return (m_type_tag == expected_type_tag && m_class_tag == expected_class_tag);
  ------------------
  |  Branch (98:12): [True: 89.3k, False: 1.58k]
  |  Branch (98:47): [True: 89.3k, False: 12]
  ------------------
   99|  90.9k|}
_ZN5Botan10BER_Object11set_taggingENS_9ASN1_TypeENS_10ASN1_ClassE:
  105|   236k|void BER_Object::set_tagging(ASN1_Type type_tag, ASN1_Class class_tag) {
  106|   236k|   m_type_tag = type_tag;
  107|   236k|   m_class_tag = class_tag;
  108|   236k|}
_ZN5Botan20asn1_class_to_stringENS_10ASN1_ClassE:
  110|  1.83k|std::string asn1_class_to_string(ASN1_Class type) {
  111|  1.83k|   switch(type) {
  112|    108|      case ASN1_Class::Universal:
  ------------------
  |  Branch (112:7): [True: 108, False: 1.73k]
  ------------------
  113|    108|         return "UNIVERSAL";
  114|  1.68k|      case ASN1_Class::Constructed:
  ------------------
  |  Branch (114:7): [True: 1.68k, False: 154]
  ------------------
  115|  1.68k|         return "CONSTRUCTED";
  116|     12|      case ASN1_Class::ContextSpecific:
  ------------------
  |  Branch (116:7): [True: 12, False: 1.82k]
  ------------------
  117|     12|         return "CONTEXT_SPECIFIC";
  118|      3|      case ASN1_Class::Application:
  ------------------
  |  Branch (118:7): [True: 3, False: 1.83k]
  ------------------
  119|      3|         return "APPLICATION";
  120|      5|      case ASN1_Class::Private:
  ------------------
  |  Branch (120:7): [True: 5, False: 1.83k]
  ------------------
  121|      5|         return "PRIVATE";
  122|      0|      case ASN1_Class::NoObject:
  ------------------
  |  Branch (122:7): [True: 0, False: 1.83k]
  ------------------
  123|      0|         return "NO_OBJECT";
  124|     26|      default:
  ------------------
  |  Branch (124:7): [True: 26, False: 1.81k]
  ------------------
  125|     26|         return "CLASS(" + std::to_string(static_cast<size_t>(type)) + ")";
  126|  1.83k|   }
  127|  1.83k|}
_ZN5Botan18asn1_tag_to_stringENS_9ASN1_TypeE:
  129|  1.88k|std::string asn1_tag_to_string(ASN1_Type type) {
  130|  1.88k|   switch(type) {
  131|  1.57k|      case ASN1_Type::Sequence:
  ------------------
  |  Branch (131:7): [True: 1.57k, False: 309]
  ------------------
  132|  1.57k|         return "SEQUENCE";
  133|       |
  134|     35|      case ASN1_Type::Set:
  ------------------
  |  Branch (134:7): [True: 35, False: 1.85k]
  ------------------
  135|     35|         return "SET";
  136|       |
  137|     14|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (137:7): [True: 14, False: 1.87k]
  ------------------
  138|     14|         return "PRINTABLE STRING";
  139|       |
  140|     10|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (140:7): [True: 10, False: 1.87k]
  ------------------
  141|     10|         return "NUMERIC STRING";
  142|       |
  143|      6|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (143:7): [True: 6, False: 1.88k]
  ------------------
  144|      6|         return "IA5 STRING";
  145|       |
  146|      3|      case ASN1_Type::TeletexString:
  ------------------
  |  Branch (146:7): [True: 3, False: 1.88k]
  ------------------
  147|      3|         return "T61 STRING";
  148|       |
  149|     68|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (149:7): [True: 68, False: 1.81k]
  ------------------
  150|     68|         return "UTF8 STRING";
  151|       |
  152|     16|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (152:7): [True: 16, False: 1.87k]
  ------------------
  153|     16|         return "VISIBLE STRING";
  154|       |
  155|      3|      case ASN1_Type::BmpString:
  ------------------
  |  Branch (155:7): [True: 3, False: 1.88k]
  ------------------
  156|      3|         return "BMP STRING";
  157|       |
  158|      8|      case ASN1_Type::UniversalString:
  ------------------
  |  Branch (158:7): [True: 8, False: 1.87k]
  ------------------
  159|      8|         return "UNIVERSAL STRING";
  160|       |
  161|      4|      case ASN1_Type::UtcTime:
  ------------------
  |  Branch (161:7): [True: 4, False: 1.88k]
  ------------------
  162|      4|         return "UTC TIME";
  163|       |
  164|      3|      case ASN1_Type::GeneralizedTime:
  ------------------
  |  Branch (164:7): [True: 3, False: 1.88k]
  ------------------
  165|      3|         return "GENERALIZED TIME";
  166|       |
  167|      3|      case ASN1_Type::OctetString:
  ------------------
  |  Branch (167:7): [True: 3, False: 1.88k]
  ------------------
  168|      3|         return "OCTET STRING";
  169|       |
  170|      1|      case ASN1_Type::BitString:
  ------------------
  |  Branch (170:7): [True: 1, False: 1.88k]
  ------------------
  171|      1|         return "BIT STRING";
  172|       |
  173|      2|      case ASN1_Type::Enumerated:
  ------------------
  |  Branch (173:7): [True: 2, False: 1.88k]
  ------------------
  174|      2|         return "ENUMERATED";
  175|       |
  176|      3|      case ASN1_Type::Integer:
  ------------------
  |  Branch (176:7): [True: 3, False: 1.88k]
  ------------------
  177|      3|         return "INTEGER";
  178|       |
  179|      2|      case ASN1_Type::Null:
  ------------------
  |  Branch (179:7): [True: 2, False: 1.88k]
  ------------------
  180|      2|         return "NULL";
  181|       |
  182|      8|      case ASN1_Type::ObjectId:
  ------------------
  |  Branch (182:7): [True: 8, False: 1.87k]
  ------------------
  183|      8|         return "OBJECT";
  184|       |
  185|      7|      case ASN1_Type::Boolean:
  ------------------
  |  Branch (185:7): [True: 7, False: 1.88k]
  ------------------
  186|      7|         return "BOOLEAN";
  187|       |
  188|      0|      case ASN1_Type::NoObject:
  ------------------
  |  Branch (188:7): [True: 0, False: 1.88k]
  ------------------
  189|      0|         return "NO_OBJECT";
  190|       |
  191|    113|      default:
  ------------------
  |  Branch (191:7): [True: 113, False: 1.77k]
  ------------------
  192|    113|         return "TAG(" + std::to_string(static_cast<uint32_t>(type)) + ")";
  193|  1.88k|   }
  194|  1.88k|}
_ZN5Botan18BER_Decoding_ErrorC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  199|  2.65k|BER_Decoding_Error::BER_Decoding_Error(std::string_view err) : Decoding_Error(fmt("BER: {}", err)) {}
_ZN5Botan11BER_Bad_TagC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEj:
  201|    104|BER_Bad_Tag::BER_Bad_Tag(std::string_view str, uint32_t tagging) : BER_Decoding_Error(fmt("{}: {}", str, tagging)) {}
_ZN5Botan4ASN19to_stringERKNS_10BER_ObjectE:
  224|  32.5k|std::string to_string(const BER_Object& obj) {
  225|  32.5k|   return bytes_to_string(obj.data());
  226|  32.5k|}

_ZN5BotanltERKNS_3OIDES2_:
  175|   327k|bool operator<(const OID& a, const OID& b) {
  176|   327k|   const std::vector<uint32_t>& oid1 = a.get_components();
  177|   327k|   const std::vector<uint32_t>& oid2 = b.get_components();
  178|       |
  179|   327k|   return std::lexicographical_compare(oid1.begin(), oid1.end(), oid2.begin(), oid2.end());
  180|   327k|}
_ZNK5Botan3OID11encode_intoERNS_11DER_EncoderE:
  185|  68.8k|void OID::encode_into(DER_Encoder& der) const {
  186|  68.8k|   if(m_id.size() < 2) {
  ------------------
  |  Branch (186:7): [True: 0, False: 68.8k]
  ------------------
  187|      0|      throw Invalid_Argument("OID::encode_into: OID is invalid");
  188|      0|   }
  189|       |
  190|  68.8k|   const auto append = [](std::vector<uint8_t>& encoding, uint32_t z) {
  191|  68.8k|      if(z <= 0x7F) {
  192|  68.8k|         encoding.push_back(static_cast<uint8_t>(z));
  193|  68.8k|      } else {
  194|  68.8k|         const size_t z7 = (high_bit(z) + 7 - 1) / 7;
  195|       |
  196|  68.8k|         for(size_t j = 0; j != z7; ++j) {
  197|  68.8k|            uint8_t zp = static_cast<uint8_t>(z >> (7 * (z7 - j - 1)) & 0x7F);
  198|       |
  199|  68.8k|            if(j != z7 - 1) {
  200|  68.8k|               zp |= 0x80;
  201|  68.8k|            }
  202|       |
  203|  68.8k|            encoding.push_back(zp);
  204|  68.8k|         }
  205|  68.8k|      }
  206|  68.8k|   };
  207|       |
  208|  68.8k|   std::vector<uint8_t> encoding;
  209|       |
  210|       |   // We know 40 * root can't overflow because root is between 0 and 2
  211|  68.8k|   auto first = checked_add(40 * m_id[0], m_id[1]);
  212|  68.8k|   BOTAN_ASSERT_NOMSG(first.has_value());
  ------------------
  |  |   84|  68.8k|   do {                                                                     \
  |  |   85|  68.8k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|  68.8k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 68.8k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|  68.8k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 68.8k]
  |  |  ------------------
  ------------------
  213|       |
  214|  68.8k|   append(encoding, *first);
  215|       |
  216|   165k|   for(size_t i = 2; i != m_id.size(); ++i) {
  ------------------
  |  Branch (216:22): [True: 96.8k, False: 68.8k]
  ------------------
  217|  96.8k|      append(encoding, m_id[i]);
  218|  96.8k|   }
  219|  68.8k|   der.add_object(ASN1_Type::ObjectId, ASN1_Class::Universal, encoding);
  220|  68.8k|}
_ZN5Botan3OID11decode_fromERNS_11BER_DecoderE:
  225|  72.3k|void OID::decode_from(BER_Decoder& decoder) {
  226|  72.3k|   const BER_Object obj = decoder.get_next_object();
  227|  72.3k|   if(obj.tagging() != (ASN1_Class::Universal | ASN1_Type::ObjectId)) {
  ------------------
  |  Branch (227:7): [True: 104, False: 72.2k]
  ------------------
  228|    104|      throw BER_Bad_Tag("Error decoding OID, unknown tag", obj.tagging());
  229|    104|   }
  230|       |
  231|  72.2k|   if(obj.length() == 0) {
  ------------------
  |  Branch (231:7): [True: 5, False: 72.2k]
  ------------------
  232|      5|      throw BER_Decoding_Error("OID encoding is too short");
  233|      5|   }
  234|       |
  235|  72.2k|   const auto consume = [](BufferSlicer& data) -> uint32_t {
  236|  72.2k|      BOTAN_ASSERT_NOMSG(!data.empty());
  237|  72.2k|      uint32_t b = data.take_byte();
  238|       |
  239|  72.2k|      if(b > 0x7F) {
  240|  72.2k|         b &= 0x7F;
  241|       |
  242|       |         // Even BER requires that the OID have minimal length, ie that
  243|       |         // the first byte of a multibyte encoding cannot be zero
  244|       |         // See X.690 section 8.19.2
  245|  72.2k|         if(b == 0) {
  246|  72.2k|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  247|  72.2k|         }
  248|       |
  249|  72.2k|         while(true) {
  250|  72.2k|            if(data.empty()) {
  251|  72.2k|               throw Decoding_Error("Truncated OID value");
  252|  72.2k|            }
  253|       |
  254|  72.2k|            const uint8_t next = data.take_byte();
  255|  72.2k|            const bool more = (next & 0x80) == 0x80;
  256|  72.2k|            const uint8_t value = next & 0x7F;
  257|       |
  258|  72.2k|            if((b >> (32 - 7)) != 0) {
  259|  72.2k|               throw Decoding_Error("OID component overflow");
  260|  72.2k|            }
  261|       |
  262|  72.2k|            b = (b << 7) | value;
  263|       |
  264|  72.2k|            if(!more) {
  265|  72.2k|               break;
  266|  72.2k|            }
  267|  72.2k|         }
  268|  72.2k|      }
  269|       |
  270|  72.2k|      return b;
  271|  72.2k|   };
  272|       |
  273|  72.2k|   BufferSlicer data(obj.data());
  274|  72.2k|   std::vector<uint32_t> parts;
  275|       |
  276|       |   // Each byte of the DER encoding can result in at most one additional arc,
  277|       |   // except the first byte which always encodes two. Don't reserve for more than
  278|       |   // 16 arcs though; the longest OID in our current table has just 13 arcs.
  279|  72.2k|   parts.reserve(std::min<size_t>(16, obj.length() + 1));
  280|       |
  281|   256k|   while(!data.empty()) {
  ------------------
  |  Branch (281:10): [True: 184k, False: 72.2k]
  ------------------
  282|   184k|      const uint32_t comp = consume(data);
  283|       |
  284|   184k|      if(parts.empty()) {
  ------------------
  |  Branch (284:10): [True: 72.2k, False: 111k]
  ------------------
  285|       |         // divide into root and second arc
  286|       |
  287|  72.2k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  288|  72.2k|            if(b0 < 40) {
  289|  72.2k|               return 0;
  290|  72.2k|            } else if(b0 < 80) {
  291|  72.2k|               return 1;
  292|  72.2k|            } else {
  293|  72.2k|               return 2;
  294|  72.2k|            }
  295|  72.2k|         }(comp);
  296|       |
  297|  72.2k|         parts.push_back(root_arc);
  298|  72.2k|         BOTAN_ASSERT_NOMSG(comp >= 40 * root_arc);
  ------------------
  |  |   84|  72.2k|   do {                                                                     \
  |  |   85|  72.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|  72.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 72.2k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|  72.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 72.2k]
  |  |  ------------------
  ------------------
  299|  72.2k|         parts.push_back(comp - 40 * root_arc);
  300|   111k|      } else {
  301|   111k|         parts.push_back(comp);
  302|   111k|      }
  303|   184k|   }
  304|       |
  305|  72.2k|   m_id = std::move(parts);
  306|  72.2k|}
asn1_oid.cpp:_ZZNK5Botan3OID11encode_intoERNS_11DER_EncoderEENK3$_0clERNSt3__16vectorIhNS4_9allocatorIhEEEEj:
  190|   165k|   const auto append = [](std::vector<uint8_t>& encoding, uint32_t z) {
  191|   165k|      if(z <= 0x7F) {
  ------------------
  |  Branch (191:10): [True: 155k, False: 9.94k]
  ------------------
  192|   155k|         encoding.push_back(static_cast<uint8_t>(z));
  193|   155k|      } else {
  194|  9.94k|         const size_t z7 = (high_bit(z) + 7 - 1) / 7;
  195|       |
  196|  34.3k|         for(size_t j = 0; j != z7; ++j) {
  ------------------
  |  Branch (196:28): [True: 24.3k, False: 9.94k]
  ------------------
  197|  24.3k|            uint8_t zp = static_cast<uint8_t>(z >> (7 * (z7 - j - 1)) & 0x7F);
  198|       |
  199|  24.3k|            if(j != z7 - 1) {
  ------------------
  |  Branch (199:16): [True: 14.4k, False: 9.94k]
  ------------------
  200|  14.4k|               zp |= 0x80;
  201|  14.4k|            }
  202|       |
  203|  24.3k|            encoding.push_back(zp);
  204|  24.3k|         }
  205|  9.94k|      }
  206|   165k|   };
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_0clERNS_12BufferSlicerE:
  235|   184k|   const auto consume = [](BufferSlicer& data) -> uint32_t {
  236|   184k|      BOTAN_ASSERT_NOMSG(!data.empty());
  ------------------
  |  |   84|   184k|   do {                                                                     \
  |  |   85|   184k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   184k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 184k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   184k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 184k]
  |  |  ------------------
  ------------------
  237|   184k|      uint32_t b = data.take_byte();
  238|       |
  239|   184k|      if(b > 0x7F) {
  ------------------
  |  Branch (239:10): [True: 11.5k, False: 172k]
  ------------------
  240|  11.5k|         b &= 0x7F;
  241|       |
  242|       |         // Even BER requires that the OID have minimal length, ie that
  243|       |         // the first byte of a multibyte encoding cannot be zero
  244|       |         // See X.690 section 8.19.2
  245|  11.5k|         if(b == 0) {
  ------------------
  |  Branch (245:13): [True: 13, False: 11.5k]
  ------------------
  246|     13|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  247|     13|         }
  248|       |
  249|  16.7k|         while(true) {
  ------------------
  |  Branch (249:16): [True: 16.7k, Folded]
  ------------------
  250|  16.7k|            if(data.empty()) {
  ------------------
  |  Branch (250:16): [True: 20, False: 16.7k]
  ------------------
  251|     20|               throw Decoding_Error("Truncated OID value");
  252|     20|            }
  253|       |
  254|  16.7k|            const uint8_t next = data.take_byte();
  255|  16.7k|            const bool more = (next & 0x80) == 0x80;
  256|  16.7k|            const uint8_t value = next & 0x7F;
  257|       |
  258|  16.7k|            if((b >> (32 - 7)) != 0) {
  ------------------
  |  Branch (258:16): [True: 27, False: 16.6k]
  ------------------
  259|     27|               throw Decoding_Error("OID component overflow");
  260|     27|            }
  261|       |
  262|  16.6k|            b = (b << 7) | value;
  263|       |
  264|  16.6k|            if(!more) {
  ------------------
  |  Branch (264:16): [True: 11.4k, False: 5.18k]
  ------------------
  265|  11.4k|               break;
  266|  11.4k|            }
  267|  16.6k|         }
  268|  11.5k|      }
  269|       |
  270|   184k|      return b;
  271|   184k|   };
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_1clEj:
  287|  72.2k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  288|  72.2k|            if(b0 < 40) {
  ------------------
  |  Branch (288:16): [True: 57.1k, False: 15.0k]
  ------------------
  289|  57.1k|               return 0;
  290|  57.1k|            } else if(b0 < 80) {
  ------------------
  |  Branch (290:23): [True: 10.7k, False: 4.32k]
  ------------------
  291|  10.7k|               return 1;
  292|  10.7k|            } else {
  293|  4.32k|               return 2;
  294|  4.32k|            }
  295|  72.2k|         }(comp);

_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
  135|  72.4k|ASN1_String::ASN1_String(std::string_view str, ASN1_Type t) : m_utf8_str(str), m_tag(t) {
  136|  72.4k|   if(!is_utf8_subset_string_type(m_tag)) {
  ------------------
  |  Branch (136:7): [True: 0, False: 72.4k]
  ------------------
  137|      0|      throw Invalid_Argument("ASN1_String only supports encoding to UTF-8 or a UTF-8 subset");
  138|      0|   }
  139|       |
  140|  72.4k|   if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (140:7): [True: 0, False: 72.4k]
  ------------------
  141|      0|      throw Invalid_Argument(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  142|      0|   }
  143|  72.4k|}
_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  145|  72.4k|ASN1_String::ASN1_String(std::string_view str) : ASN1_String(str, choose_encoding(str)) {}
_ZN5Botan11ASN1_String11decode_fromERNS_11BER_DecoderE:
  162|  72.1k|void ASN1_String::decode_from(BER_Decoder& source) {
  163|  72.1k|   const BER_Object obj = source.get_next_object();
  164|       |
  165|  72.1k|   if(obj.get_class() != ASN1_Class::Universal || !is_asn1_string_type(obj.type())) {
  ------------------
  |  Branch (165:7): [True: 82, False: 72.0k]
  |  Branch (165:51): [True: 86, False: 72.0k]
  ------------------
  166|    156|      auto typ = static_cast<uint32_t>(obj.type());
  167|    156|      auto cls = static_cast<uint32_t>(obj.get_class());
  168|    156|      throw Decoding_Error(fmt("ASN1_String: Unknown string type {}/{}", typ, cls));
  169|    156|   }
  170|       |
  171|  72.0k|   m_tag = obj.type();
  172|  72.0k|   m_data.assign(obj.bits(), obj.bits() + obj.length());
  173|       |
  174|  72.0k|   if(m_tag == ASN1_Type::BmpString) {
  ------------------
  |  Branch (174:7): [True: 20.7k, False: 51.2k]
  ------------------
  175|  20.7k|      m_utf8_str = ucs2_to_utf8(m_data);
  176|  51.2k|   } else if(m_tag == ASN1_Type::UniversalString) {
  ------------------
  |  Branch (176:14): [True: 4.75k, False: 46.5k]
  ------------------
  177|  4.75k|      m_utf8_str = ucs4_to_utf8(m_data);
  178|  46.5k|   } else if(m_tag == ASN1_Type::TeletexString) {
  ------------------
  |  Branch (178:14): [True: 13.9k, False: 32.5k]
  ------------------
  179|       |      /*
  180|       |      TeletexString is nominally ITU T.61 not ISO-8859-1 but it seems
  181|       |      the majority of implementations actually used that charset here.
  182|       |      */
  183|  13.9k|      m_utf8_str = latin1_to_utf8(m_data);
  184|  32.5k|   } else {
  185|       |      // All other supported string types are UTF-8 or some subset thereof
  186|  32.5k|      m_utf8_str = ASN1::to_string(obj);
  187|       |
  188|  32.5k|      if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (188:10): [True: 95, False: 32.4k]
  ------------------
  189|     95|         throw Decoding_Error(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  190|     95|      }
  191|  32.5k|   }
  192|  72.0k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_119is_asn1_string_typeENS_9ASN1_TypeE:
   99|  72.0k|bool is_asn1_string_type(ASN1_Type tag) {
  100|  72.0k|   return (is_utf8_subset_string_type(tag) || tag == ASN1_Type::TeletexString || tag == ASN1_Type::BmpString ||
  ------------------
  |  Branch (100:12): [True: 32.5k, False: 39.5k]
  |  Branch (100:47): [True: 13.9k, False: 25.5k]
  |  Branch (100:82): [True: 20.7k, False: 4.83k]
  ------------------
  101|  4.83k|           tag == ASN1_Type::UniversalString);
  ------------------
  |  Branch (101:12): [True: 4.75k, False: 86]
  ------------------
  102|  72.0k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_126is_utf8_subset_string_typeENS_9ASN1_TypeE:
   94|   249k|bool is_utf8_subset_string_type(ASN1_Type tag) {
   95|   249k|   return (tag == ASN1_Type::NumericString || tag == ASN1_Type::PrintableString || tag == ASN1_Type::VisibleString ||
  ------------------
  |  Branch (95:12): [True: 2.26k, False: 247k]
  |  Branch (95:47): [True: 190k, False: 57.1k]
  |  Branch (95:84): [True: 2.41k, False: 54.6k]
  ------------------
   96|  54.6k|           tag == ASN1_Type::Ia5String || tag == ASN1_Type::Utf8String);
  ------------------
  |  Branch (96:12): [True: 6.10k, False: 48.5k]
  |  Branch (96:43): [True: 9.02k, False: 39.5k]
  ------------------
   97|   249k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_128is_valid_asn1_string_contentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_9ASN1_TypeE:
  104|   105k|bool is_valid_asn1_string_content(const std::string& str, ASN1_Type tag) {
  105|   105k|   BOTAN_ASSERT_NOMSG(is_utf8_subset_string_type(tag));
  ------------------
  |  |   84|   105k|   do {                                                                     \
  |  |   85|   105k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   105k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 105k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   105k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
  106|       |
  107|   105k|   switch(tag) {
  108|  4.51k|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (108:7): [True: 4.51k, False: 100k]
  ------------------
  109|  4.51k|         return is_valid_utf8(str);
  110|  1.13k|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (110:7): [True: 1.13k, False: 103k]
  ------------------
  111|  96.2k|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (111:7): [True: 95.1k, False: 9.90k]
  ------------------
  112|  99.3k|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 3.05k, False: 101k]
  ------------------
  113|   100k|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (113:7): [True: 1.20k, False: 103k]
  ------------------
  114|   100k|         return g_char_validator.valid_encoding(str, tag);
  115|      0|      default:
  ------------------
  |  Branch (115:7): [True: 0, False: 105k]
  ------------------
  116|      0|         return false;
  117|   105k|   }
  118|   105k|}
asn1_str.cpp:_ZNK5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator14valid_encodingENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_9ASN1_TypeE:
   25|   173k|      constexpr bool valid_encoding(std::string_view str, ASN1_Type tag) const {
   26|   173k|         const uint8_t mask = mask_for(tag);
   27|   173k|         for(const char c : str) {
  ------------------
  |  Branch (27:27): [True: 7.39k, False: 172k]
  ------------------
   28|  7.39k|            const uint8_t codepoint = static_cast<uint8_t>(c);
   29|  7.39k|            const bool is_valid = (m_table[codepoint] & mask) != 0;
   30|       |
   31|  7.39k|            if(!is_valid) {
  ------------------
  |  Branch (31:16): [True: 29, False: 7.36k]
  ------------------
   32|     29|               return false;
   33|     29|            }
   34|  7.39k|         }
   35|       |
   36|   172k|         return true;
   37|   173k|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator8mask_forENS_9ASN1_TypeE:
   45|   173k|      static constexpr uint8_t mask_for(ASN1_Type tag) {
   46|   173k|         switch(tag) {
   47|  1.13k|            case ASN1_Type::NumericString:
  ------------------
  |  Branch (47:13): [True: 1.13k, False: 171k]
  ------------------
   48|  1.13k|               return Numeric_String;
   49|   167k|            case ASN1_Type::PrintableString:
  ------------------
  |  Branch (49:13): [True: 167k, False: 5.39k]
  ------------------
   50|   167k|               return Printable_String;
   51|  3.05k|            case ASN1_Type::Ia5String:
  ------------------
  |  Branch (51:13): [True: 3.05k, False: 169k]
  ------------------
   52|  3.05k|               return IA5_String;
   53|  1.20k|            case ASN1_Type::VisibleString:
  ------------------
  |  Branch (53:13): [True: 1.20k, False: 171k]
  ------------------
   54|  1.20k|               return Visible_String;
   55|      0|            default:
  ------------------
  |  Branch (55:13): [True: 0, False: 173k]
  ------------------
   56|      0|               return 0;
   57|   173k|         }
   58|   173k|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_115choose_encodingENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  120|  72.4k|ASN1_Type choose_encoding(std::string_view str) {
  121|  72.4k|   if(g_char_validator.valid_encoding(str, ASN1_Type::PrintableString)) {
  ------------------
  |  Branch (121:7): [True: 72.4k, False: 0]
  ------------------
  122|  72.4k|      return ASN1_Type::PrintableString;
  123|  72.4k|   } else {
  124|      0|      return ASN1_Type::Utf8String;
  125|      0|   }
  126|  72.4k|}

_ZN5Botan11BER_DecoderD2Ev:
  456|  95.4k|BER_Decoder::~BER_Decoder() = default;
_ZNK5Botan11BER_Decoder10more_itemsEv:
  461|   102k|bool BER_Decoder::more_items() const {
  462|   102k|   if(m_source->end_of_data() && !m_pushed.is_set()) {
  ------------------
  |  Branch (462:7): [True: 15.5k, False: 86.5k]
  |  Branch (462:34): [True: 15.5k, False: 0]
  ------------------
  463|  15.5k|      return false;
  464|  15.5k|   }
  465|  86.5k|   return true;
  466|   102k|}
_ZN5Botan11BER_Decoder10read_bytesENSt3__14spanIhLm18446744073709551615EEE:
  505|  23.7k|size_t BER_Decoder::read_bytes(std::span<uint8_t> out) {
  506|  23.7k|   BOTAN_ASSERT_NOMSG(m_source != nullptr);
  ------------------
  |  |   84|  23.7k|   do {                                                                     \
  |  |   85|  23.7k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|  23.7k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 23.7k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|  23.7k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 23.7k]
  |  |  ------------------
  ------------------
  507|  23.7k|   return m_source->read(out.data(), out.size());
  508|  23.7k|}
_ZN5Botan11BER_Decoder15get_next_objectEv:
  521|   236k|BER_Object BER_Decoder::get_next_object() {
  522|   236k|   BER_Object next;
  523|       |
  524|   236k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (524:7): [True: 0, False: 236k]
  ------------------
  525|      0|      std::swap(next, m_pushed);
  526|      0|      return next;
  527|      0|   }
  528|       |
  529|   236k|   for(;;) {
  530|   236k|      ASN1_Type type_tag = ASN1_Type::NoObject;
  531|   236k|      ASN1_Class class_tag = ASN1_Class::NoObject;
  532|   236k|      decode_tag(m_source, type_tag, class_tag);
  533|   236k|      next.set_tagging(type_tag, class_tag);
  534|   236k|      if(next.is_set() == false) {  // no more objects
  ------------------
  |  Branch (534:10): [True: 1.42k, False: 234k]
  ------------------
  535|  1.42k|         return next;
  536|  1.42k|      }
  537|       |
  538|   234k|      const size_t allow_indef = m_limits.allow_ber_encoding() ? m_limits.max_nested_indefinite_length() : 0;
  ------------------
  |  Branch (538:34): [True: 234k, False: 46]
  ------------------
  539|   234k|      const bool der_mode = m_limits.require_der_encoding();
  540|   234k|      const auto dl = decode_length(m_source, allow_indef, der_mode, is_constructed(class_tag));
  541|       |
  542|       |      // Per X.690 8.1.5 the only valid EOC encoding is the two-octet
  543|       |      // sequence 0x00 0x00. Reject any other length encoding on a tag of
  544|       |      // (Eoc, Universal) before we consume the "content" bytes.
  545|   234k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal &&
  ------------------
  |  Branch (545:10): [True: 145, False: 234k]
  |  Branch (545:40): [True: 123, False: 22]
  ------------------
  546|    123|         (dl.content_length() != 0 || dl.indefinite_length())) {
  ------------------
  |  Branch (546:11): [True: 53, False: 70]
  |  Branch (546:39): [True: 0, False: 70]
  ------------------
  547|     53|         throw BER_Decoding_Error("EOC marker with non-zero length");
  548|     53|      }
  549|       |
  550|   234k|      if(const auto max_size = m_limits.max_object_size(); max_size && dl.content_length() > *max_size) {
  ------------------
  |  Branch (550:60): [True: 234k, False: 664]
  |  Branch (550:72): [True: 34, False: 234k]
  ------------------
  551|     34|         throw BER_Decoding_Error("Encoded object exceeds maximum size");
  552|     34|      }
  553|       |
  554|   234k|      if(!m_source->check_available(dl.total_length())) {
  ------------------
  |  Branch (554:10): [True: 129, False: 234k]
  ------------------
  555|    129|         throw BER_Decoding_Error("Value truncated");
  556|    129|      }
  557|       |
  558|   234k|      uint8_t* out = next.mutable_bits(dl.content_length());
  559|   234k|      if(m_source->read(out, dl.content_length()) != dl.content_length()) {
  ------------------
  |  Branch (559:10): [True: 0, False: 234k]
  ------------------
  560|      0|         throw BER_Decoding_Error("Value truncated");
  561|      0|      }
  562|       |
  563|   234k|      if(dl.indefinite_length()) {
  ------------------
  |  Branch (563:10): [True: 55.8k, False: 178k]
  ------------------
  564|       |         // After reading the data consume the 2-byte EOC
  565|  55.8k|         uint8_t eoc[2] = {0xFF, 0xFF};
  566|  55.8k|         if(m_source->read(eoc, 2) != 2 || eoc[0] != 0x00 || eoc[1] != 0x00) {
  ------------------
  |  Branch (566:13): [True: 0, False: 55.8k]
  |  Branch (566:44): [True: 0, False: 55.8k]
  |  Branch (566:62): [True: 0, False: 55.8k]
  ------------------
  567|      0|            throw BER_Decoding_Error("Missing or malformed EOC marker");
  568|      0|         }
  569|  55.8k|      }
  570|       |
  571|   234k|      if(next.tagging() == static_cast<uint32_t>(ASN1_Type::Eoc)) {
  ------------------
  |  Branch (571:10): [True: 70, False: 234k]
  ------------------
  572|     70|         if(m_limits.require_der_encoding()) {
  ------------------
  |  Branch (572:13): [True: 0, False: 70]
  ------------------
  573|      0|            throw BER_Decoding_Error("Detected EOC marker in DER structure");
  574|      0|         }
  575|       |         // An EOC marker is only valid as an indefinite-length terminator, which
  576|       |         // is consumed above when reading the indefinite-length object. A
  577|       |         // standalone EOC is rejected unless the caller opted to tolerate it.
  578|     70|         if(m_limits.allow_standalone_eoc()) {
  ------------------
  |  Branch (578:13): [True: 0, False: 70]
  ------------------
  579|      0|            continue;
  580|      0|         }
  581|     70|         throw BER_Decoding_Error("Encountered EOC marker outside of indefinite-length encoding");
  582|     70|      }
  583|       |
  584|   234k|      break;
  585|   234k|   }
  586|       |
  587|   234k|   return next;
  588|   236k|}
_ZN5Botan11BER_Decoder10start_consENS_9ASN1_TypeENS_10ASN1_ClassE:
  619|  91.8k|BER_Decoder BER_Decoder::start_cons(ASN1_Type type_tag, ASN1_Class class_tag) {
  620|  91.8k|   BER_Object obj = get_next_object();
  621|  91.8k|   obj.assert_is_a(type_tag, class_tag | ASN1_Class::Constructed);
  622|       |
  623|       |   // In DER mode the elements of a universal SET must appear in sorted order
  624|  91.8k|   if(m_limits.require_der_encoding() && type_tag == ASN1_Type::Set && class_tag == ASN1_Class::Universal) {
  ------------------
  |  Branch (624:7): [True: 0, False: 91.8k]
  |  Branch (624:42): [True: 0, False: 0]
  |  Branch (624:72): [True: 0, False: 0]
  ------------------
  625|      0|      verify_set_is_sorted(std::span<const uint8_t>{obj.bits(), obj.length()});
  626|      0|   }
  627|       |
  628|  91.8k|   BER_Decoder child(std::move(obj), this);
  629|  91.8k|   return child;
  630|  91.8k|}
_ZN5Botan11BER_Decoder8end_consEv:
  635|  74.7k|BER_Decoder& BER_Decoder::end_cons() {
  636|  74.7k|   if(m_parent == nullptr) {
  ------------------
  |  Branch (636:7): [True: 0, False: 74.7k]
  ------------------
  637|      0|      throw Invalid_State("BER_Decoder::end_cons called with null parent");
  638|      0|   }
  639|  74.7k|   if(!m_source->end_of_data() || m_pushed.is_set()) {
  ------------------
  |  Branch (639:7): [True: 14, False: 74.7k]
  |  Branch (639:35): [True: 0, False: 74.7k]
  ------------------
  640|     14|      throw Decoding_Error("BER_Decoder::end_cons called with data left");
  641|     14|   }
  642|  74.7k|   return (*m_parent);
  643|  74.7k|}
_ZN5Botan11BER_DecoderC2EONS_10BER_ObjectEPS0_:
  646|  89.3k|      m_limits(parent != nullptr ? parent->limits() : BER_Decoder::Limits::BER()), m_parent(parent) {
  ------------------
  |  Branch (646:16): [True: 89.3k, False: 0]
  ------------------
  647|  89.3k|   m_data_src = std::make_unique<DataSource_BERObject>(std::move(obj));
  648|  89.3k|   m_source = m_data_src.get();
  649|  89.3k|}
_ZN5Botan11BER_DecoderC2ENSt3__14spanIKhLm18446744073709551615EEENS0_6LimitsE:
  664|  6.11k|BER_Decoder::BER_Decoder(std::span<const uint8_t> buf, Limits limits) : m_limits(limits) {
  665|  6.11k|   m_data_src = std::make_unique<DataSource_Memory>(buf);
  666|  6.11k|   m_source = m_data_src.get();
  667|  6.11k|}
_ZN5Botan11BER_Decoder6decodeERNS_11ASN1_ObjectENS_9ASN1_TypeENS_10ASN1_ClassE:
  676|   144k|BER_Decoder& BER_Decoder::decode(ASN1_Object& obj, ASN1_Type type_tag, ASN1_Class class_tag) {
  677|       |   // TODO support this case properly
  678|   144k|   if(type_tag != ASN1_Type::NoObject || class_tag != ASN1_Class::NoObject) {
  ------------------
  |  Branch (678:7): [True: 0, False: 144k]
  |  Branch (678:42): [True: 0, False: 144k]
  ------------------
  679|      0|      throw Not_Implemented("BER_Decoder::decode(ASN1_Object) does not support implicit tagged decoding");
  680|      0|   }
  681|   144k|   obj.decode_from(*this);
  682|   144k|   return (*this);
  683|   144k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_110decode_tagEPNS_10DataSourceERNS_9ASN1_TypeERNS_10ASN1_ClassE:
   29|   236k|size_t decode_tag(DataSource* ber, ASN1_Type& type_tag, ASN1_Class& class_tag) {
   30|   236k|   auto b = ber->read_byte();
   31|       |
   32|   236k|   if(!b) {
  ------------------
  |  Branch (32:7): [True: 1.42k, False: 234k]
  ------------------
   33|  1.42k|      type_tag = ASN1_Type::NoObject;
   34|  1.42k|      class_tag = ASN1_Class::NoObject;
   35|  1.42k|      return 0;
   36|  1.42k|   }
   37|       |
   38|   234k|   if((*b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (38:7): [True: 234k, False: 368]
  ------------------
   39|   234k|      type_tag = ASN1_Type(*b & 0x1F);
   40|   234k|      class_tag = ASN1_Class(*b & 0xE0);
   41|       |      // The EOC marker is primitive; a constructed universal tag 0 has no
   42|       |      // valid meaning and would otherwise bypass the EOC handling, which
   43|       |      // matches on (Eoc, Universal) exactly
   44|   234k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (44:10): [True: 210, False: 234k]
  |  Branch (44:40): [True: 7, False: 203]
  ------------------
   45|      7|         throw BER_Decoding_Error("EOC tag with constructed encoding");
   46|      7|      }
   47|   234k|      return 1;
   48|   234k|   }
   49|       |
   50|    368|   size_t tag_bytes = 1;
   51|    368|   class_tag = ASN1_Class(*b & 0xE0);
   52|       |
   53|    368|   uint32_t tag_buf = 0;
   54|  1.36k|   while(true) {
  ------------------
  |  Branch (54:10): [True: 1.36k, Folded]
  ------------------
   55|  1.36k|      b = ber->read_byte();
   56|  1.36k|      if(!b) {
  ------------------
  |  Branch (56:10): [True: 11, False: 1.35k]
  ------------------
   57|     11|         throw BER_Decoding_Error("Long-form tag truncated");
   58|     11|      }
   59|       |      // Reject if shifting in another 7 bits would overflow the uint32_t tag
   60|  1.35k|      if((tag_buf >> 25) != 0) {
  ------------------
  |  Branch (60:10): [True: 17, False: 1.33k]
  ------------------
   61|     17|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
   62|     17|      }
   63|       |      // This is required even by BER (see X.690 section 8.1.2.4.2 sentence c).
   64|       |      // Bits 7-1 of the first subsequent octet must not be all zero; this rules
   65|       |      // out both 0x80 (continuation with no data) and 0x00 (a long-form encoding
   66|       |      // of tag value 0, which collides with the EOC marker).
   67|  1.33k|      if(tag_bytes == 1 && (*b & 0x7F) == 0) {
  ------------------
  |  Branch (67:10): [True: 365, False: 974]
  |  Branch (67:28): [True: 3, False: 362]
  ------------------
   68|      3|         throw BER_Decoding_Error("Long form tag with leading zero");
   69|      3|      }
   70|  1.33k|      ++tag_bytes;
   71|  1.33k|      tag_buf = (tag_buf << 7) | (*b & 0x7F);
   72|  1.33k|      if((*b & 0x80) == 0) {
  ------------------
  |  Branch (72:10): [True: 337, False: 999]
  ------------------
   73|    337|         break;
   74|    337|      }
   75|  1.33k|   }
   76|       |   // Per X.690 8.1.2.2, tag values 0-30 shall be encoded in the short form.
   77|       |   // Long-form encoding is reserved for tag values >= 31 (X.690 8.1.2.3).
   78|       |   // This is unconditional and applies to BER as well as DER.
   79|    337|   if(tag_buf <= 30) {
  ------------------
  |  Branch (79:7): [True: 7, False: 330]
  ------------------
   80|      7|      throw BER_Decoding_Error("Long-form tag encoding used for small tag value");
   81|      7|   }
   82|       |
   83|    330|   if(tag_buf == static_cast<uint32_t>(ASN1_Type::NoObject)) {
  ------------------
  |  Branch (83:7): [True: 1, False: 329]
  ------------------
   84|      1|      throw BER_Decoding_Error("Tag value collides with internal sentinel");
   85|      1|   }
   86|       |
   87|       |   // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
   88|    329|   type_tag = ASN1_Type(tag_buf);
   89|    329|   return tag_bytes;
   90|    330|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_113decode_lengthEPNS_10DataSourceEmbb:
  135|   234k|BerDecodedLength decode_length(DataSource* ber, size_t allow_indef, bool der_mode, bool constructed) {
  136|   234k|   uint8_t b = 0;
  137|   234k|   if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (137:7): [True: 209, False: 234k]
  ------------------
  138|    209|      throw BER_Decoding_Error("Length field not found");
  139|    209|   }
  140|   234k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (140:7): [True: 177k, False: 57.3k]
  ------------------
  141|   177k|      return BerDecodedLength(b, 1);
  142|   177k|   }
  143|       |
  144|  57.3k|   const size_t num_length_bytes = (b & 0x7F);
  145|  57.3k|   if(num_length_bytes > 4) {
  ------------------
  |  Branch (145:7): [True: 23, False: 57.3k]
  ------------------
  146|     23|      throw BER_Decoding_Error("Length field is too large");
  147|     23|   }
  148|       |
  149|  57.3k|   const size_t field_size = 1 + num_length_bytes;
  150|       |
  151|  57.3k|   if(num_length_bytes == 0) {
  ------------------
  |  Branch (151:7): [True: 56.2k, False: 1.11k]
  ------------------
  152|  56.2k|      if(der_mode) {
  ------------------
  |  Branch (152:10): [True: 0, False: 56.2k]
  ------------------
  153|      0|         throw BER_Decoding_Error("Detected indefinite-length encoding in DER structure");
  154|  56.2k|      } else if(!constructed) {
  ------------------
  |  Branch (154:17): [True: 3, False: 56.2k]
  ------------------
  155|       |         // Indefinite length is only valid for constructed types (X.690 8.1.3.2)
  156|      3|         throw BER_Decoding_Error("Indefinite-length encoding used with non-constructed type");
  157|  56.2k|      } else if(allow_indef == 0) {
  ------------------
  |  Branch (157:17): [True: 0, False: 56.2k]
  ------------------
  158|      0|         throw BER_Decoding_Error("Nested EOC markers too deep, rejecting to avoid stack exhaustion");
  159|  56.2k|      } else {
  160|       |         // find_eoc returns bytes up to and including the EOC marker.
  161|       |         // Return the content length; the caller consumes the EOC separately.
  162|  56.2k|         const size_t eoc_len = find_eoc(ber, /*base_offset=*/0, allow_indef - 1);
  163|  56.2k|         if(eoc_len < 2) {
  ------------------
  |  Branch (163:13): [True: 0, False: 56.2k]
  ------------------
  164|      0|            throw BER_Decoding_Error("Invalid EOC encoding");
  165|      0|         }
  166|  56.2k|         return BerDecodedLength::indefinite(eoc_len - 2, field_size);
  167|  56.2k|      }
  168|  56.2k|   }
  169|       |
  170|  1.11k|   size_t length = 0;
  171|       |
  172|  4.63k|   for(size_t i = 0; i != num_length_bytes; ++i) {
  ------------------
  |  Branch (172:22): [True: 3.53k, False: 1.10k]
  ------------------
  173|  3.53k|      if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (173:10): [True: 13, False: 3.52k]
  ------------------
  174|     13|         throw BER_Decoding_Error("Corrupted length field");
  175|     13|      }
  176|       |      // Can't overflow since we already checked that num_length_bytes <= 4
  177|  3.52k|      length = (length << 8) | b;
  178|  3.52k|   }
  179|       |
  180|       |   // DER requires shortest possible length encoding
  181|  1.10k|   if(der_mode) {
  ------------------
  |  Branch (181:7): [True: 0, False: 1.10k]
  ------------------
  182|      0|      if(length < 128) {
  ------------------
  |  Branch (182:10): [True: 0, False: 0]
  ------------------
  183|      0|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  184|      0|      }
  185|      0|      if(num_length_bytes > 1 && length < (size_t(1) << ((num_length_bytes - 1) * 8))) {
  ------------------
  |  Branch (185:10): [True: 0, False: 0]
  |  Branch (185:34): [True: 0, False: 0]
  ------------------
  186|      0|         throw BER_Decoding_Error("Detected non-canonical length encoding in DER structure");
  187|      0|      }
  188|      0|   }
  189|       |
  190|  1.10k|   return BerDecodedLength(length, field_size);
  191|  1.10k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emm:
  108|   178k|            BerDecodedLength(content_length, field_length, false) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emmb:
  125|   234k|            m_content_length(content_length), m_field_length(field_length), m_indefinite(indefinite) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_18find_eocEPNS_10DataSourceEmm:
  314|   153k|size_t find_eoc(DataSource* src, size_t base_offset, size_t allow_indef) {
  315|   153k|   size_t offset = base_offset;
  316|       |
  317|   564k|   while(true) {
  ------------------
  |  Branch (317:10): [True: 564k, Folded]
  ------------------
  318|   564k|      ASN1_Type type_tag = ASN1_Type::NoObject;
  319|   564k|      ASN1_Class class_tag = ASN1_Class::NoObject;
  320|   564k|      const size_t tag_size = peek_tag(src, offset, type_tag, class_tag);
  321|   564k|      if(type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (321:10): [True: 192, False: 564k]
  ------------------
  322|    192|         throw BER_Decoding_Error("Missing EOC marker in indefinite-length encoding");
  323|    192|      }
  324|       |
  325|   564k|      size_t length_size = 0;
  326|   564k|      const size_t item_size =
  327|   564k|         peek_length(src, offset + tag_size, length_size, allow_indef, is_constructed(class_tag), false);
  328|       |
  329|   564k|      if(auto new_offset = checked_add(offset, tag_size, length_size, item_size)) {
  ------------------
  |  Branch (329:15): [True: 564k, False: 299]
  ------------------
  330|   564k|         offset = new_offset.value();
  331|   564k|      } else {
  332|    299|         throw Decoding_Error("Integer overflow while scanning for EOC");
  333|    299|      }
  334|       |
  335|   564k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal) {
  ------------------
  |  Branch (335:10): [True: 153k, False: 411k]
  |  Branch (335:40): [True: 153k, False: 404]
  ------------------
  336|       |         // Per X.690 8.1.5 the EOC marker is exactly two zero octets
  337|   153k|         if(length_size != 1 || item_size != 0) {
  ------------------
  |  Branch (337:13): [True: 2, False: 153k]
  |  Branch (337:33): [True: 10, False: 153k]
  ------------------
  338|     12|            throw BER_Decoding_Error("EOC marker with non-zero length");
  339|     12|         }
  340|   153k|         break;
  341|   153k|      }
  342|   564k|   }
  343|       |
  344|   153k|   return offset - base_offset;
  345|   153k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_18peek_tagEPKNS_10DataSourceEmRNS_9ASN1_TypeERNS_10ASN1_ClassE:
  197|   564k|size_t peek_tag(const DataSource* src, size_t offset, ASN1_Type& type_tag, ASN1_Class& class_tag) {
  198|   564k|   uint8_t b = 0;
  199|   564k|   if(src->peek(&b, 1, offset) == 0) {
  ------------------
  |  Branch (199:7): [True: 192, False: 564k]
  ------------------
  200|    192|      type_tag = ASN1_Type::NoObject;
  201|    192|      class_tag = ASN1_Class::NoObject;
  202|    192|      return 0;
  203|    192|   }
  204|       |
  205|   564k|   if((b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (205:7): [True: 563k, False: 825]
  ------------------
  206|   563k|      type_tag = ASN1_Type(b & 0x1F);
  207|   563k|      class_tag = ASN1_Class(b & 0xE0);
  208|       |      // The EOC marker is primitive; a constructed universal tag 0 has no
  209|       |      // valid meaning and would otherwise bypass the EOC handling, which
  210|       |      // matches on (Eoc, Universal) exactly
  211|   563k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (211:10): [True: 153k, False: 410k]
  |  Branch (211:40): [True: 1, False: 153k]
  ------------------
  212|      1|         throw BER_Decoding_Error("EOC tag with constructed encoding");
  213|      1|      }
  214|   563k|      return 1;
  215|   563k|   }
  216|       |
  217|    825|   class_tag = ASN1_Class(b & 0xE0);
  218|    825|   size_t tag_bytes = 1;
  219|    825|   uint32_t tag_buf = 0;
  220|       |
  221|  2.00k|   while(true) {
  ------------------
  |  Branch (221:10): [True: 2.00k, Folded]
  ------------------
  222|  2.00k|      if(src->peek(&b, 1, offset + tag_bytes) == 0) {
  ------------------
  |  Branch (222:10): [True: 10, False: 1.99k]
  ------------------
  223|     10|         throw BER_Decoding_Error("Long-form tag truncated");
  224|     10|      }
  225|       |      // Reject if shifting in another 7 bits would overflow the uint32_t tag
  226|  1.99k|      if((tag_buf >> 25) != 0) {
  ------------------
  |  Branch (226:10): [True: 10, False: 1.98k]
  ------------------
  227|     10|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
  228|     10|      }
  229|       |      // Required even by BER (X.690 section 8.1.2.4.2 sentence c).
  230|       |      // Bits 7-1 of the first subsequent octet must not be all zero; this rules
  231|       |      // out both 0x80 (continuation with no data) and 0x00 (a long-form encoding
  232|       |      // of tag value 0, which collides with the EOC marker).
  233|  1.98k|      if(tag_bytes == 1 && (b & 0x7F) == 0) {
  ------------------
  |  Branch (233:10): [True: 820, False: 1.16k]
  |  Branch (233:28): [True: 2, False: 818]
  ------------------
  234|      2|         throw BER_Decoding_Error("Long form tag with leading zero");
  235|      2|      }
  236|  1.98k|      ++tag_bytes;
  237|  1.98k|      tag_buf = (tag_buf << 7) | (b & 0x7F);
  238|  1.98k|      if((b & 0x80) == 0) {
  ------------------
  |  Branch (238:10): [True: 803, False: 1.18k]
  ------------------
  239|    803|         break;
  240|    803|      }
  241|  1.98k|   }
  242|       |
  243|       |   // Per X.690 8.1.2.2, tag values 0-30 shall be encoded in the short form.
  244|       |   // Long-form encoding is reserved for tag values >= 31 (X.690 8.1.2.3).
  245|       |   // This is unconditional and applies to BER as well as DER.
  246|    803|   if(tag_buf <= 30) {
  ------------------
  |  Branch (246:7): [True: 6, False: 797]
  ------------------
  247|      6|      throw BER_Decoding_Error("Long-form tag encoding used for small tag value");
  248|      6|   }
  249|       |
  250|    797|   if(tag_buf == static_cast<uint32_t>(ASN1_Type::NoObject)) {
  ------------------
  |  Branch (250:7): [True: 1, False: 796]
  ------------------
  251|      1|      throw BER_Decoding_Error("Tag value collides with internal sentinel");
  252|      1|   }
  253|       |
  254|       |   // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
  255|    796|   type_tag = ASN1_Type(tag_buf);
  256|    796|   return tag_bytes;
  257|    797|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_111peek_lengthEPNS_10DataSourceEmRmmbb:
  265|   564k|   DataSource* src, size_t offset, size_t& field_size, size_t allow_indef, bool constructed, bool der_mode) {
  266|   564k|   uint8_t b = 0;
  267|   564k|   if(src->peek(&b, 1, offset) == 0) {
  ------------------
  |  Branch (267:7): [True: 117, False: 564k]
  ------------------
  268|    117|      throw BER_Decoding_Error("Length field not found");
  269|    117|   }
  270|       |
  271|   564k|   field_size = 1;
  272|   564k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (272:7): [True: 464k, False: 100k]
  ------------------
  273|   464k|      return b;
  274|   464k|   }
  275|       |
  276|   100k|   const size_t num_length_bytes = (b & 0x7F);
  277|   100k|   field_size += num_length_bytes;
  278|   100k|   if(field_size > 5) {
  ------------------
  |  Branch (278:7): [True: 8, False: 100k]
  ------------------
  279|      8|      throw BER_Decoding_Error("Length field is too large");
  280|      8|   }
  281|       |
  282|   100k|   if(num_length_bytes == 0) {
  ------------------
  |  Branch (282:7): [True: 97.3k, False: 2.94k]
  ------------------
  283|       |      // Indefinite length is not allowed in DER
  284|  97.3k|      if(der_mode) {
  ------------------
  |  Branch (284:10): [True: 0, False: 97.3k]
  ------------------
  285|      0|         throw BER_Decoding_Error("Detected indefinite-length encoding in DER structure");
  286|      0|      }
  287|       |      // Indefinite length is only valid for constructed types (X.690 8.1.3.2)
  288|  97.3k|      if(!constructed) {
  ------------------
  |  Branch (288:10): [True: 1, False: 97.3k]
  ------------------
  289|      1|         throw BER_Decoding_Error("Indefinite-length encoding used with non-constructed type");
  290|      1|      }
  291|  97.3k|      if(allow_indef == 0) {
  ------------------
  |  Branch (291:10): [True: 1, False: 97.3k]
  ------------------
  292|      1|         throw BER_Decoding_Error("Nested EOC markers too deep, rejecting to avoid stack exhaustion");
  293|      1|      }
  294|  97.3k|      return find_eoc(src, offset + 1, allow_indef - 1);
  295|  97.3k|   }
  296|       |
  297|  2.94k|   size_t length = 0;
  298|  11.7k|   for(size_t i = 0; i < num_length_bytes; ++i) {
  ------------------
  |  Branch (298:22): [True: 8.77k, False: 2.93k]
  ------------------
  299|  8.77k|      if(src->peek(&b, 1, offset + 1 + i) == 0) {
  ------------------
  |  Branch (299:10): [True: 9, False: 8.76k]
  ------------------
  300|      9|         throw BER_Decoding_Error("Corrupted length field");
  301|      9|      }
  302|  8.76k|      if(get_byte<0>(length) != 0) {
  ------------------
  |  Branch (302:10): [True: 0, False: 8.76k]
  ------------------
  303|      0|         throw BER_Decoding_Error("Field length overflow");
  304|      0|      }
  305|  8.76k|      length = (length << 8) | b;
  306|  8.76k|   }
  307|  2.93k|   return length;
  308|  2.94k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLength10indefiniteEmm:
  110|  55.8k|      static BerDecodedLength indefinite(size_t content_length, size_t field_length) {
  111|  55.8k|         return BerDecodedLength(content_length, field_length, true);
  112|  55.8k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_114is_constructedENS_10ASN1_ClassE:
   22|   799k|bool is_constructed(ASN1_Class class_tag) {
   23|   799k|   return (static_cast<uint32_t>(class_tag) & static_cast<uint32_t>(ASN1_Class::Constructed)) != 0;
   24|   799k|}
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength14content_lengthEv:
  114|   936k|      size_t content_length() const { return m_content_length; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength17indefinite_lengthEv:
  121|   234k|      bool indefinite_length() const { return m_indefinite; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength12total_lengthEv:
  117|   234k|      size_t total_length() const { return m_indefinite ? m_content_length + 2 : m_content_length; }
  ------------------
  |  Branch (117:44): [True: 55.8k, False: 178k]
  ------------------
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObjectC2EONS_10BER_ObjectE:
  379|  89.3k|      explicit DataSource_BERObject(BER_Object&& obj) : m_obj(std::move(obj)) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject4readEPhm:
  349|   719k|      size_t read(uint8_t out[], size_t length) override {
  350|   719k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   84|   719k|   do {                                                                     \
  |  |   85|   719k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   719k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 719k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   719k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 719k]
  |  |  ------------------
  ------------------
  351|   719k|         const size_t got = std::min<size_t>(m_obj.length() - m_offset, length);
  352|   719k|         copy_mem(out, m_obj.bits() + m_offset, got);
  353|   719k|         m_offset += got;
  354|   719k|         return got;
  355|   719k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject15check_availableEm:
  370|   216k|      bool check_available(size_t n) override {
  371|   216k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   84|   216k|   do {                                                                     \
  |  |   85|   216k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   216k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 216k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   216k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 216k]
  |  |  ------------------
  ------------------
  372|   216k|         return (n <= (m_obj.length() - m_offset));
  373|   216k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject4peekEPhmm:
  357|   253k|      size_t peek(uint8_t out[], size_t length, size_t peek_offset) const override {
  358|   253k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   84|   253k|   do {                                                                     \
  |  |   85|   253k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   253k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 253k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   253k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 253k]
  |  |  ------------------
  ------------------
  359|   253k|         const size_t bytes_left = m_obj.length() - m_offset;
  360|       |
  361|   253k|         if(peek_offset >= bytes_left) {
  ------------------
  |  Branch (361:13): [True: 59, False: 253k]
  ------------------
  362|     59|            return 0;
  363|     59|         }
  364|       |
  365|   253k|         const size_t got = std::min(bytes_left - peek_offset, length);
  366|   253k|         copy_mem(out, m_obj.bits() + m_offset + peek_offset, got);
  367|   253k|         return got;
  368|   253k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject11end_of_dataEv:
  375|   160k|      bool end_of_data() const override { return get_bytes_read() == m_obj.length(); }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject14get_bytes_readEv:
  377|   160k|      size_t get_bytes_read() const override { return m_offset; }

_ZN5Botan11DER_EncoderC2ERNSt3__16vectorIhNS1_9allocatorIhEEEE:
   89|  68.8k|DER_Encoder::DER_Encoder(std::vector<uint8_t>& vec) {
   90|  68.8k|   m_append_output = [&vec](const uint8_t b[], size_t l) {
   91|  68.8k|      if(l > 0) {
   92|  68.8k|         vec.insert(vec.end(), b, b + l);
   93|  68.8k|      }
   94|  68.8k|   };
   95|  68.8k|}
_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassEPKhm:
  285|  68.8k|DER_Encoder& DER_Encoder::add_object(ASN1_Type type_tag, ASN1_Class class_tag, const uint8_t rep[], size_t length) {
  286|  68.8k|   std::vector<uint8_t> hdr;
  287|  68.8k|   encode_tag(hdr, type_tag, class_tag);
  288|  68.8k|   encode_length(hdr, length);
  289|       |
  290|  68.8k|   if(!m_subsequences.empty()) {
  ------------------
  |  Branch (290:7): [True: 0, False: 68.8k]
  ------------------
  291|      0|      m_subsequences[m_subsequences.size() - 1].add_bytes(hdr.data(), hdr.size(), rep, length);
  292|  68.8k|   } else if(m_append_output) {
  ------------------
  |  Branch (292:14): [True: 68.8k, False: 0]
  ------------------
  293|  68.8k|      m_append_output(hdr.data(), hdr.size());
  294|  68.8k|      m_append_output(rep, length);
  295|  68.8k|   } else {
  296|      0|      m_default_outbuf += hdr;
  297|      0|      m_default_outbuf += std::make_pair(rep, length);
  298|      0|   }
  299|       |
  300|  68.8k|   return (*this);
  301|  68.8k|}
der_enc.cpp:_ZN5Botan12_GLOBAL__N_110encode_tagERNSt3__16vectorIhNS1_9allocatorIhEEEENS_9ASN1_TypeENS_10ASN1_ClassE:
   26|  68.8k|void encode_tag(std::vector<uint8_t>& encoded_tag, ASN1_Type type_tag_e, ASN1_Class class_tag_e) {
   27|  68.8k|   const uint32_t type_tag = static_cast<uint32_t>(type_tag_e);
   28|  68.8k|   const uint32_t class_tag = static_cast<uint32_t>(class_tag_e);
   29|       |
   30|  68.8k|   if((class_tag | 0xE0) != 0xE0) {
  ------------------
  |  Branch (30:7): [True: 0, False: 68.8k]
  ------------------
   31|      0|      throw Encoding_Error(fmt("DER_Encoder: Invalid class tag {}", std::to_string(class_tag)));
   32|      0|   }
   33|       |
   34|  68.8k|   if(type_tag <= 30) {
  ------------------
  |  Branch (34:7): [True: 68.8k, False: 0]
  ------------------
   35|  68.8k|      encoded_tag.push_back(static_cast<uint8_t>(type_tag | class_tag));
   36|  68.8k|   } else {
   37|      0|      size_t blocks = high_bit(static_cast<uint32_t>(type_tag)) + 6;
   38|      0|      blocks = (blocks - (blocks % 7)) / 7;
   39|       |
   40|      0|      BOTAN_ASSERT_NOMSG(blocks > 0);
  ------------------
  |  |   84|      0|   do {                                                                     \
  |  |   85|      0|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|      0|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 0]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|      0|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
   41|       |
   42|      0|      encoded_tag.push_back(static_cast<uint8_t>(class_tag | 0x1F));
   43|      0|      for(size_t i = 0; i != blocks - 1; ++i) {
  ------------------
  |  Branch (43:25): [True: 0, False: 0]
  ------------------
   44|      0|         encoded_tag.push_back(0x80 | ((type_tag >> 7 * (blocks - i - 1)) & 0x7F));
   45|      0|      }
   46|      0|      encoded_tag.push_back(type_tag & 0x7F);
   47|      0|   }
   48|  68.8k|}
der_enc.cpp:_ZN5Botan12_GLOBAL__N_113encode_lengthERNSt3__16vectorIhNS1_9allocatorIhEEEEm:
   53|  68.8k|void encode_length(std::vector<uint8_t>& encoded_length, size_t length) {
   54|  68.8k|   if(length <= 127) {
  ------------------
  |  Branch (54:7): [True: 68.6k, False: 167]
  ------------------
   55|  68.6k|      encoded_length.push_back(static_cast<uint8_t>(length));
   56|  68.6k|   } else {
   57|    167|      const size_t bytes_needed = significant_bytes(length);
   58|       |
   59|    167|      encoded_length.push_back(static_cast<uint8_t>(0x80 | bytes_needed));
   60|       |
   61|    421|      for(size_t i = sizeof(length) - bytes_needed; i < sizeof(length); ++i) {
  ------------------
  |  Branch (61:53): [True: 254, False: 167]
  ------------------
   62|    254|         encoded_length.push_back(get_byte_var(i, length));
   63|    254|      }
   64|    167|   }
   65|  68.8k|}
der_enc.cpp:_ZZN5Botan11DER_EncoderC1ERNSt3__16vectorIhNS1_9allocatorIhEEEEENK3$_0clEPKhm:
   90|   137k|   m_append_output = [&vec](const uint8_t b[], size_t l) {
   91|   137k|      if(l > 0) {
  ------------------
  |  Branch (91:10): [True: 137k, False: 0]
  ------------------
   92|   137k|         vec.insert(vec.end(), b, b + l);
   93|   137k|      }
   94|   137k|   };

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

_ZN5Botan19next_utf8_codepointENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERm:
   53|  26.0k|uint32_t next_utf8_codepoint(std::string_view utf8, size_t& pos) {
   54|  26.0k|   const auto read_continuation = [&]() -> uint32_t {
   55|  26.0k|      if(pos >= utf8.size()) {
   56|  26.0k|         throw Decoding_Error("Invalid UTF-8 sequence");
   57|  26.0k|      }
   58|  26.0k|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   59|  26.0k|      if((b & 0xC0) != 0x80) {
   60|  26.0k|         throw Decoding_Error("Invalid UTF-8 sequence");
   61|  26.0k|      }
   62|  26.0k|      return b & 0x3F;
   63|  26.0k|   };
   64|       |
   65|  26.0k|   if(pos >= utf8.size()) {
  ------------------
  |  Branch (65:7): [True: 0, False: 26.0k]
  ------------------
   66|      0|      throw Decoding_Error("Invalid UTF-8 sequence");
   67|      0|   }
   68|  26.0k|   const uint8_t lead = static_cast<uint8_t>(utf8[pos++]);
   69|  26.0k|   uint32_t c = 0;
   70|       |
   71|  26.0k|   if(lead <= 0x7F) {
  ------------------
  |  Branch (71:7): [True: 22.9k, False: 3.09k]
  ------------------
   72|  22.9k|      c = lead;
   73|  22.9k|   } else if((lead & 0xE0) == 0xC0) {
  ------------------
  |  Branch (73:14): [True: 2.06k, False: 1.02k]
  ------------------
   74|  2.06k|      c = (lead & 0x1F) << 6;
   75|  2.06k|      c |= read_continuation();
   76|  2.06k|      if(c < 0x80) {
  ------------------
  |  Branch (76:10): [True: 5, False: 2.06k]
  ------------------
   77|      5|         throw Decoding_Error("Overlong UTF-8 sequence");
   78|      5|      }
   79|  2.06k|   } else if((lead & 0xF0) == 0xE0) {
  ------------------
  |  Branch (79:14): [True: 634, False: 395]
  ------------------
   80|    634|      c = (lead & 0x0F) << 12;
   81|    634|      c |= read_continuation() << 6;
   82|    634|      c |= read_continuation();
   83|    634|      if(c < 0x800) {
  ------------------
  |  Branch (83:10): [True: 6, False: 628]
  ------------------
   84|      6|         throw Decoding_Error("Overlong UTF-8 sequence");
   85|      6|      }
   86|    634|   } else if((lead & 0xF8) == 0xF0) {
  ------------------
  |  Branch (86:14): [True: 380, False: 15]
  ------------------
   87|    380|      c = (lead & 0x07) << 18;
   88|    380|      c |= read_continuation() << 12;
   89|    380|      c |= read_continuation() << 6;
   90|    380|      c |= read_continuation();
   91|    380|      if(c < 0x10000) {
  ------------------
  |  Branch (91:10): [True: 6, False: 374]
  ------------------
   92|      6|         throw Decoding_Error("Overlong UTF-8 sequence");
   93|      6|      }
   94|    380|   } else {
   95|     15|      throw Decoding_Error("Invalid UTF-8 sequence");
   96|     15|   }
   97|       |
   98|  25.9k|   if(c > 0x10FFFF) {
  ------------------
  |  Branch (98:7): [True: 3, False: 25.9k]
  ------------------
   99|      3|      throw Decoding_Error("UTF-8 sequence encodes value outside Unicode range");
  100|      3|   }
  101|  25.9k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (101:7): [True: 885, False: 25.1k]
  |  Branch (101:22): [True: 18, False: 867]
  ------------------
  102|     18|      throw Decoding_Error("UTF-8 sequence encodes surrogate code point");
  103|     18|   }
  104|       |
  105|  25.9k|   return c;
  106|  25.9k|}
_ZN5Botan13is_valid_utf8ENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  108|  4.51k|bool is_valid_utf8(std::string_view utf8) {
  109|  4.51k|   try {
  110|  4.51k|      size_t pos = 0;
  111|  30.5k|      while(pos < utf8.size()) {
  ------------------
  |  Branch (111:13): [True: 26.0k, False: 4.51k]
  ------------------
  112|  26.0k|         const uint32_t c = next_utf8_codepoint(utf8, pos);
  113|  26.0k|         BOTAN_UNUSED(c);
  ------------------
  |  |  151|  26.0k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  114|  26.0k|      }
  115|  4.51k|   } catch(Decoding_Error&) {
  116|     66|      return false;
  117|     66|   }
  118|  4.44k|   return true;
  119|  4.51k|}
_ZN5Botan12ucs2_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  121|  20.7k|std::string ucs2_to_utf8(std::span<const uint8_t> ucs2) {
  122|  20.7k|   if(ucs2.size() % 2 != 0) {
  ------------------
  |  Branch (122:7): [True: 2, False: 20.7k]
  ------------------
  123|      2|      throw Decoding_Error("Invalid length for UCS-2 string");
  124|      2|   }
  125|       |
  126|  20.7k|   const size_t chars = ucs2.size() / 2;
  127|       |
  128|  20.7k|   std::string s;
  129|  47.0k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (129:22): [True: 26.2k, False: 20.7k]
  ------------------
  130|  26.2k|      const uint32_t c = load_be<uint16_t>(ucs2.data(), i);
  131|  26.2k|      append_utf8_for(s, c);
  132|  26.2k|   }
  133|       |
  134|  20.7k|   return s;
  135|  20.7k|}
_ZN5Botan12ucs4_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  155|  4.75k|std::string ucs4_to_utf8(std::span<const uint8_t> ucs4) {
  156|  4.75k|   if(ucs4.size() % 4 != 0) {
  ------------------
  |  Branch (156:7): [True: 3, False: 4.75k]
  ------------------
  157|      3|      throw Decoding_Error("Invalid length for UCS-4 string");
  158|      3|   }
  159|       |
  160|  4.75k|   const size_t chars = ucs4.size() / 4;
  161|       |
  162|  4.75k|   std::string s;
  163|  6.91k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (163:22): [True: 2.16k, False: 4.75k]
  ------------------
  164|  2.16k|      const uint32_t c = load_be<uint32_t>(ucs4.data(), i);
  165|  2.16k|      append_utf8_for(s, c);
  166|  2.16k|   }
  167|       |
  168|  4.75k|   return s;
  169|  4.75k|}
_ZN5Botan14latin1_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  190|  13.9k|std::string latin1_to_utf8(std::span<const uint8_t> chars) {
  191|  13.9k|   std::string s;
  192|   244k|   for(const uint8_t b : chars) {
  ------------------
  |  Branch (192:24): [True: 244k, False: 13.9k]
  ------------------
  193|   244k|      append_utf8_for(s, static_cast<uint32_t>(b));
  194|   244k|   }
  195|  13.9k|   return s;
  196|  13.9k|}
charset.cpp:_ZZN5Botan19next_utf8_codepointENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERmENK3$_0clEv:
   54|  4.47k|   const auto read_continuation = [&]() -> uint32_t {
   55|  4.47k|      if(pos >= utf8.size()) {
  ------------------
  |  Branch (55:10): [True: 5, False: 4.46k]
  ------------------
   56|      5|         throw Decoding_Error("Invalid UTF-8 sequence");
   57|      5|      }
   58|  4.46k|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   59|  4.46k|      if((b & 0xC0) != 0x80) {
  ------------------
  |  Branch (59:10): [True: 8, False: 4.46k]
  ------------------
   60|      8|         throw Decoding_Error("Invalid UTF-8 sequence");
   61|      8|      }
   62|  4.46k|      return b & 0x3F;
   63|  4.46k|   };
charset.cpp:_ZN5Botan12_GLOBAL__N_115append_utf8_forERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEj:
   17|   272k|void append_utf8_for(std::string& s, uint32_t c) {
   18|   272k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (18:7): [True: 5.32k, False: 267k]
  |  Branch (18:22): [True: 14, False: 5.31k]
  ------------------
   19|     14|      throw Decoding_Error("Invalid Unicode character");
   20|     14|   }
   21|       |
   22|   272k|   if(c <= 0x7F) {
  ------------------
  |  Branch (22:7): [True: 117k, False: 154k]
  ------------------
   23|   117k|      const uint8_t b0 = static_cast<uint8_t>(c);
   24|   117k|      s.push_back(static_cast<char>(b0));
   25|   154k|   } else if(c <= 0x7FF) {
  ------------------
  |  Branch (25:14): [True: 138k, False: 16.1k]
  ------------------
   26|   138k|      const uint8_t b0 = 0xC0 | static_cast<uint8_t>(c >> 6);
   27|   138k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   28|   138k|      s.push_back(static_cast<char>(b0));
   29|   138k|      s.push_back(static_cast<char>(b1));
   30|   138k|   } else if(c <= 0xFFFF) {
  ------------------
  |  Branch (30:14): [True: 14.2k, False: 1.90k]
  ------------------
   31|  14.2k|      const uint8_t b0 = 0xE0 | static_cast<uint8_t>(c >> 12);
   32|  14.2k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   33|  14.2k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   34|  14.2k|      s.push_back(static_cast<char>(b0));
   35|  14.2k|      s.push_back(static_cast<char>(b1));
   36|  14.2k|      s.push_back(static_cast<char>(b2));
   37|  14.2k|   } else if(c <= 0x10FFFF) {
  ------------------
  |  Branch (37:14): [True: 1.86k, False: 44]
  ------------------
   38|  1.86k|      const uint8_t b0 = 0xF0 | static_cast<uint8_t>(c >> 18);
   39|  1.86k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 12) & 0x3F);
   40|  1.86k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   41|  1.86k|      const uint8_t b3 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   42|  1.86k|      s.push_back(static_cast<char>(b0));
   43|  1.86k|      s.push_back(static_cast<char>(b1));
   44|  1.86k|      s.push_back(static_cast<char>(b2));
   45|  1.86k|      s.push_back(static_cast<char>(b3));
   46|  1.86k|   } else {
   47|     44|      throw Decoding_Error("Invalid Unicode character");
   48|     44|   }
   49|   272k|}

_ZN5Botan10DataSource9read_byteERh:
   27|   238k|size_t DataSource::read_byte(uint8_t& out) {
   28|   238k|   return read(&out, 1);
   29|   238k|}
_ZN5Botan10DataSource9read_byteEv:
   34|   237k|std::optional<uint8_t> DataSource::read_byte() {
   35|   237k|   uint8_t b = 0;
   36|   237k|   if(this->read(&b, 1) == 1) {
  ------------------
  |  Branch (36:7): [True: 236k, False: 1.44k]
  ------------------
   37|   236k|      return b;
   38|   236k|   } else {
   39|  1.44k|      return {};
   40|  1.44k|   }
   41|   237k|}
_ZN5Botan17DataSource_Memory4readEPhm:
   73|  70.5k|size_t DataSource_Memory::read(uint8_t out[], size_t length) {
   74|  70.5k|   const size_t got = std::min<size_t>(m_source.size() - m_offset, length);
   75|  70.5k|   copy_mem(out, m_source.data() + m_offset, got);
   76|  70.5k|   m_offset += got;
   77|  70.5k|   return got;
   78|  70.5k|}
_ZN5Botan17DataSource_Memory15check_availableEm:
   80|  17.3k|bool DataSource_Memory::check_available(size_t n) {
   81|  17.3k|   return (n <= (m_source.size() - m_offset));
   82|  17.3k|}
_ZNK5Botan17DataSource_Memory4peekEPhmm:
   87|   886k|size_t DataSource_Memory::peek(uint8_t out[], size_t length, size_t peek_offset) const {
   88|   886k|   const size_t bytes_left = m_source.size() - m_offset;
   89|   886k|   if(peek_offset >= bytes_left) {
  ------------------
  |  Branch (89:7): [True: 269, False: 886k]
  ------------------
   90|    269|      return 0;
   91|    269|   }
   92|       |
   93|   886k|   const size_t got = std::min(bytes_left - peek_offset, length);
   94|   886k|   copy_mem(out, &m_source[m_offset + peek_offset], got);
   95|   886k|   return got;
   96|   886k|}
_ZNK5Botan17DataSource_Memory11end_of_dataEv:
  101|  16.2k|bool DataSource_Memory::end_of_data() const {
  102|  16.2k|   return (m_offset == m_source.size());
  103|  16.2k|}

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

_ZN5Botan19secure_scrub_memoryEPvm:
   24|   427k|void secure_scrub_memory(void* ptr, size_t n) {
   25|   427k|   return secure_zeroize_buffer(ptr, n);
   26|   427k|}
_ZN5Botan21secure_zeroize_bufferEPvm:
   28|   427k|void secure_zeroize_buffer(void* ptr, size_t n) {
   29|   427k|   if(n == 0) {
  ------------------
  |  Branch (29:7): [True: 245k, False: 181k]
  ------------------
   30|   245k|      return;
   31|   245k|   }
   32|       |
   33|       |#if defined(BOTAN_TARGET_OS_HAS_RTLSECUREZEROMEMORY)
   34|       |   ::RtlSecureZeroMemory(ptr, n);
   35|       |
   36|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_BZERO)
   37|   181k|   ::explicit_bzero(ptr, n);
   38|       |
   39|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_MEMSET)
   40|       |   (void)::explicit_memset(ptr, 0, n);
   41|       |
   42|       |#else
   43|       |   /*
   44|       |   * Call memset through a static volatile pointer, which the compiler should
   45|       |   * not elide. This construct should be safe in conforming compilers, but who
   46|       |   * knows. This has been checked to generate the expected code, which saves the
   47|       |   * memset address in the data segment and unconditionally loads and jumps to
   48|       |   * that address, with the following targets:
   49|       |   *
   50|       |   * x86-64: Clang 19, GCC 6, 11, 13, 14
   51|       |   * riscv64: GCC 14
   52|       |   * aarch64: GCC 14
   53|       |   * armv7: GCC 14
   54|       |   *
   55|       |   * Actually all of them generated the expected jump even without marking the
   56|       |   * function pointer as volatile. However this seems worth including as an
   57|       |   * additional precaution.
   58|       |   */
   59|       |   static void* (*const volatile memset_ptr)(void*, int, size_t) = std::memset;
   60|       |   (memset_ptr)(ptr, 0, n);
   61|       |#endif
   62|   181k|}

_ZN5BotaneqERKNS_7X509_DNES2_:
  340|    414|bool operator==(const X509_DN& dn1, const X509_DN& dn2) {
  341|    414|   return dn1._canonical_bytes() == dn2._canonical_bytes();
  342|    414|}
_ZN5BotanltERKNS_7X509_DNES2_:
  355|  3.31k|bool operator<(const X509_DN& dn1, const X509_DN& dn2) {
  356|  3.31k|   return dn1._canonical_bytes() < dn2._canonical_bytes();
  357|  3.31k|}
_ZN5Botan7X509_DN11decode_fromERNS_11BER_DecoderE:
  405|  5.26k|void X509_DN::decode_from(BER_Decoder& source) {
  406|  5.26k|   std::vector<uint8_t> bits;
  407|       |
  408|  5.26k|   source.start_sequence().raw_bytes(bits).end_cons();
  409|       |
  410|  5.26k|   BER_Decoder sequence(bits, source.limits());
  411|       |
  412|  5.26k|   std::vector<std::vector<std::pair<OID, ASN1_String>>> rdns;
  413|       |
  414|       |   // Cap AVAs per RDN to bound work for downstream set-based matching.
  415|       |   // No legitimate cert has anywhere near this many AVAs in a single RDN.
  416|  5.26k|   constexpr size_t MAX_AVAS_PER_RDN = 32;
  417|       |
  418|  19.3k|   while(sequence.more_items()) {
  ------------------
  |  Branch (418:10): [True: 14.0k, False: 5.25k]
  ------------------
  419|  14.0k|      BER_Decoder rdn_decoder = sequence.start_set();
  420|       |
  421|  14.0k|      std::vector<std::pair<OID, ASN1_String>> rdn;
  422|  86.5k|      while(rdn_decoder.more_items()) {
  ------------------
  |  Branch (422:13): [True: 72.4k, False: 14.0k]
  ------------------
  423|  72.4k|         OID oid;
  424|  72.4k|         ASN1_String str;
  425|       |
  426|  72.4k|         rdn_decoder.start_sequence()
  427|  72.4k|            .decode(oid)
  428|  72.4k|            .decode(str)  // TODO support Any
  429|  72.4k|            .end_cons();
  430|       |
  431|  72.4k|         rdn.emplace_back(std::move(oid), std::move(str));
  432|       |
  433|  72.4k|         if(rdn.size() > MAX_AVAS_PER_RDN) {
  ------------------
  |  Branch (433:13): [True: 2, False: 72.4k]
  ------------------
  434|      2|            throw Decoding_Error("X.500 RDN has too many attribute-value assertions");
  435|      2|         }
  436|  72.4k|      }
  437|       |
  438|       |      /*
  439|       |      RFC 5280 4.1.2.4:
  440|       |         RelativeDistinguishedName ::=
  441|       |           SET SIZE (1..MAX) OF AttributeTypeAndValue
  442|       |      */
  443|  14.0k|      if(rdn.empty()) {
  ------------------
  |  Branch (443:10): [True: 6, False: 14.0k]
  ------------------
  444|      6|         throw Decoding_Error("X.500 RDN must contain at least one attribute-value assertion");
  445|      6|      }
  446|  14.0k|      rdns.push_back(std::move(rdn));
  447|  14.0k|   }
  448|       |
  449|  5.25k|   auto canonical_bits = canonicalize_dn(rdns);
  450|       |
  451|  5.25k|   m_rdn = std::move(rdns);
  452|  5.25k|   m_dn_bits = std::move(bits);
  453|  5.25k|   m_canonical_dn_bits = std::move(canonical_bits);
  454|  5.25k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_120append_canonical_rdnERNSt3__16vectorIhNS1_9allocatorIhEEEERKNS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS3_ISA_EEEE:
  152|  12.1k|void append_canonical_rdn(std::vector<uint8_t>& canonical_bits, const std::vector<std::pair<OID, ASN1_String>>& rdn) {
  153|  12.1k|   const auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  154|  12.1k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  155|  12.1k|      out.insert(out.end(), data_len.begin(), data_len.end());
  156|  12.1k|      out.insert(out.end(), data.begin(), data.end());
  157|  12.1k|   };
  158|       |
  159|  12.1k|   std::vector<uint8_t> rdn_bits;
  160|       |
  161|  68.8k|   for(const auto& [oid, value] : canonicalize_rdn(rdn)) {
  ------------------
  |  Branch (161:33): [True: 68.8k, False: 12.1k]
  ------------------
  162|  68.8k|      append_canonical_data(rdn_bits, oid.BER_encode());
  163|  68.8k|      append_canonical_data(rdn_bits, value);
  164|  68.8k|   }
  165|       |
  166|  12.1k|   append_canonical_data(canonical_bits, rdn_bits);
  167|  12.1k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_116canonicalize_rdnERKNSt3__16vectorINS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEE:
  136|  12.1k|std::vector<std::pair<OID, std::string>> canonicalize_rdn(const std::vector<std::pair<OID, ASN1_String>>& rdn) {
  137|  12.1k|   std::vector<std::pair<OID, std::string>> result;
  138|  12.1k|   result.reserve(rdn.size());
  139|  68.8k|   for(const auto& ava : rdn) {
  ------------------
  |  Branch (139:24): [True: 68.8k, False: 12.1k]
  ------------------
  140|  68.8k|      result.emplace_back(ava.first, X500_Char_Iterator::canonicalize(ava.second.value()));
  141|  68.8k|   }
  142|  12.1k|   if(result.size() != 1) {
  ------------------
  |  Branch (142:7): [True: 8.67k, False: 3.45k]
  ------------------
  143|  8.67k|      std::sort(result.begin(), result.end());
  144|  8.67k|   }
  145|  12.1k|   return result;
  146|  12.1k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator12canonicalizeENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  114|  68.8k|      static std::string canonicalize(std::string_view name) {
  115|  68.8k|         std::string result;
  116|  68.8k|         result.reserve(name.size());
  117|       |
  118|  68.8k|         X500_Char_Iterator it(name);
  119|   489k|         while(auto c = it.next()) {
  ------------------
  |  Branch (119:21): [True: 421k, False: 68.8k]
  ------------------
  120|   421k|            result += *c;
  121|   421k|         }
  122|       |
  123|  68.8k|         return result;
  124|  68.8k|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_IteratorC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   81|  68.8k|      explicit X500_Char_Iterator(std::string_view s) : m_str(s), m_pos(0) {
   82|       |         // Skip leading whitespace
   83|  70.0k|         while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (83:16): [True: 14.4k, False: 55.6k]
  |  Branch (83:40): [True: 1.20k, False: 13.2k]
  ------------------
   84|  1.20k|            ++m_pos;
   85|  1.20k|         }
   86|  68.8k|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator4nextEv:
   89|   489k|      std::optional<char> next() {
   90|   489k|         if(m_pos >= m_str.size()) {
  ------------------
  |  Branch (90:13): [True: 68.3k, False: 421k]
  ------------------
   91|  68.3k|            return std::nullopt;
   92|  68.3k|         }
   93|       |
   94|   421k|         if(is_space(m_str[m_pos])) {
  ------------------
  |  Branch (94:13): [True: 4.05k, False: 417k]
  ------------------
   95|       |            // Skip the entire whitespace run
   96|  12.0k|            while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (96:19): [True: 11.5k, False: 525]
  |  Branch (96:43): [True: 8.04k, False: 3.52k]
  ------------------
   97|  8.04k|               ++m_pos;
   98|  8.04k|            }
   99|       |            // Emit a single space only if more content follows (strip trailing ws)
  100|  4.05k|            if(m_pos < m_str.size()) {
  ------------------
  |  Branch (100:16): [True: 3.52k, False: 525]
  ------------------
  101|  3.52k|               return ' ';
  102|  3.52k|            }
  103|    525|            return std::nullopt;
  104|  4.05k|         }
  105|       |
  106|   417k|         const char c = m_str[m_pos++];
  107|       |         // Locale-independent ASCII fold; RFC 5280 DN matching does not depend on libc locale
  108|   417k|         if(c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (108:13): [True: 10.6k, False: 406k]
  |  Branch (108:25): [True: 5.25k, False: 5.37k]
  ------------------
  109|  5.25k|            return static_cast<char>(c + ('a' - 'A'));
  110|  5.25k|         }
  111|   412k|         return c;
  112|   417k|      }
x509_dn.cpp:_ZZN5Botan12_GLOBAL__N_120append_canonical_rdnERNSt3__16vectorIhNS1_9allocatorIhEEEERKNS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS3_ISA_EEEEENK3$_0clIS5_EEDaS6_RKT_:
  153|  80.9k|   const auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  154|  80.9k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  155|  80.9k|      out.insert(out.end(), data_len.begin(), data_len.end());
  156|  80.9k|      out.insert(out.end(), data.begin(), data.end());
  157|  80.9k|   };
x509_dn.cpp:_ZZN5Botan12_GLOBAL__N_120append_canonical_rdnERNSt3__16vectorIhNS1_9allocatorIhEEEERKNS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS3_ISA_EEEEENK3$_0clINS1_12basic_stringIcNS1_11char_traitsIcEENS3_IcEEEEEEDaS6_RKT_:
  153|  68.8k|   const auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  154|  68.8k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  155|  68.8k|      out.insert(out.end(), data_len.begin(), data_len.end());
  156|  68.8k|      out.insert(out.end(), data.begin(), data.end());
  157|  68.8k|   };
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEE:
  169|  2.21k|std::vector<uint8_t> canonicalize_dn(const std::vector<std::vector<std::pair<OID, ASN1_String>>>& rdns) {
  170|  2.21k|   std::vector<uint8_t> canonical_bits;
  171|       |
  172|  12.1k|   for(const auto& rdn : rdns) {
  ------------------
  |  Branch (172:24): [True: 12.1k, False: 2.21k]
  ------------------
  173|  12.1k|      append_canonical_rdn(canonical_bits, rdn);
  174|  12.1k|   }
  175|       |
  176|  2.21k|   return canonical_bits;
  177|  2.21k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_18is_spaceEc:
   26|   447k|bool is_space(char c) {
   27|   447k|   return c == ' ' || c == '\t';
  ------------------
  |  Branch (27:11): [True: 9.10k, False: 438k]
  |  Branch (27:23): [True: 4.18k, False: 434k]
  ------------------
   28|   447k|}

