_ZN5Botan17ct_if_is_zero_retITkNSt3__117unsigned_integralEmEEmT_m:
   45|    465|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|    465|   const T a = ~x & (x - 1);
   51|    465|   const size_t a_top = static_cast<size_t>(CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1)));
   52|    465|   const size_t mask = static_cast<size_t>(0) - a_top;
   53|    465|   return mask & s;
   54|    465|}
_ZN5Botan8high_bitITkNSt3__117unsigned_integralEjEEmT_:
   73|  10.5k|BOTAN_FORCE_INLINE constexpr size_t high_bit(T n) {
   74|  10.5k|   size_t hb = 0;
   75|       |
   76|  63.4k|   for(size_t s = 8 * sizeof(T) / 2; s > 0; s /= 2) {
  ------------------
  |  Branch (76:38): [True: 52.9k, False: 10.5k]
  ------------------
   77|       |      // Equivalent to: ((n >> s) == 0) ? 0 : s;
   78|  52.9k|      const size_t z = s - ct_if_is_zero_ret<T>(n >> s, s);
   79|  52.9k|      hb += z;
   80|  52.9k|      n >>= z;
   81|  52.9k|   }
   82|       |
   83|  10.5k|   hb += static_cast<size_t>(n);
   84|       |
   85|  10.5k|   return hb;
   86|  10.5k|}
_ZN5Botan17ct_if_is_zero_retITkNSt3__117unsigned_integralEjEEmT_m:
   45|  52.9k|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|  52.9k|   const T a = ~x & (x - 1);
   51|  52.9k|   const size_t a_top = static_cast<size_t>(CT::value_barrier<T>(a >> (sizeof(T) * 8 - 1)));
   52|  52.9k|   const size_t mask = static_cast<size_t>(0) - a_top;
   53|  52.9k|   return mask & s;
   54|  52.9k|}
_ZN5Botan17significant_bytesITkNSt3__117unsigned_integralEmEEmT_:
   94|    155|BOTAN_FORCE_INLINE constexpr size_t significant_bytes(T n) {
   95|    155|   size_t b = 0;
   96|       |
   97|    620|   for(size_t s = 8 * sizeof(T) / 2; s >= 8; s /= 2) {
  ------------------
  |  Branch (97:38): [True: 465, False: 155]
  ------------------
   98|       |      // Equivalent to: ((n >> s) == 0) ? 0 : s;
   99|    465|      const size_t z = s - ct_if_is_zero_ret<T>(n >> s, s);
  100|    465|      b += z / 8;
  101|    465|      n >>= z;
  102|    465|   }
  103|       |
  104|    155|   b += (n != 0);
  105|       |
  106|    155|   return b;
  107|    155|}

_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEtQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   25|  26.8k|inline constexpr T reverse_bytes(T x) {
   26|       |   if constexpr(sizeof(T) == 1) {
   27|       |      return x;
   28|  26.8k|   } else if constexpr(sizeof(T) == 2) {
   29|  26.8k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap16)
   30|  26.8k|      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.8k|}
_ZN5Botan13reverse_bytesITkNSt3__117unsigned_integralEjQooooooeqstT_Li1EeqstS2_Li2EeqstS2_Li4EeqstS2_Li8EEES2_S2_:
   25|  2.69k|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.69k|   } else if constexpr(sizeof(T) == 4) {
   35|  2.69k|#if BOTAN_COMPILER_HAS_BUILTIN(__builtin_bswap32)
   36|  2.69k|      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.69k|}

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

_ZN5Botan10fmt_detail6do_fmtERNSt3__119basic_ostringstreamIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EE:
   20|  3.11k|inline void do_fmt(std::ostringstream& oss, std::string_view format) {
   21|  3.11k|   oss << format;
   22|  3.11k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|  2.72k|std::string fmt(std::string_view format, const T&... args) {
   54|  2.72k|   std::ostringstream oss;
   55|  2.72k|   oss.imbue(std::locale::classic());
   56|  2.72k|   fmt_detail::do_fmt(oss, format, args...);
   57|  2.72k|   return oss.str();
   58|  2.72k|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|  2.72k|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|  2.72k|   size_t i = 0;
   27|       |
   28|  16.3k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 16.3k, False: 0]
  ------------------
   29|  16.3k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 2.72k, False: 13.6k]
  |  Branch (29:30): [True: 2.72k, False: 0]
  |  Branch (29:59): [True: 2.72k, False: 0]
  ------------------
   30|  2.72k|         oss << val;
   31|  2.72k|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  13.6k|      } else {
   33|  13.6k|         oss << format[i];
   34|  13.6k|      }
   35|       |
   36|  13.6k|      i += 1;
   37|  13.6k|   }
   38|  2.72k|}
_ZN5Botan3fmtIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEjEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEES5_DpRKT_:
   53|    114|std::string fmt(std::string_view format, const T&... args) {
   54|    114|   std::ostringstream oss;
   55|    114|   oss.imbue(std::locale::classic());
   56|    114|   fmt_detail::do_fmt(oss, format, args...);
   57|    114|   return oss.str();
   58|    114|}
_ZN5Botan10fmt_detail6do_fmtINSt3__117basic_string_viewIcNS2_11char_traitsIcEEEEJjEEEvRNS2_19basic_ostringstreamIcS5_NS2_9allocatorIcEEEES6_RKT_DpRKT0_:
   25|    114|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    114|   size_t i = 0;
   27|       |
   28|    114|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 114, False: 0]
  ------------------
   29|    114|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 114, False: 0]
  |  Branch (29:30): [True: 114, False: 0]
  |  Branch (29:59): [True: 114, False: 0]
  ------------------
   30|    114|         oss << val;
   31|    114|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    114|      } else {
   33|      0|         oss << format[i];
   34|      0|      }
   35|       |
   36|      0|      i += 1;
   37|      0|   }
   38|    114|}
_ZN5Botan10fmt_detail6do_fmtIjJEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    288|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    288|   size_t i = 0;
   27|       |
   28|    690|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 690, False: 0]
  ------------------
   29|    690|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 288, False: 402]
  |  Branch (29:30): [True: 288, False: 0]
  |  Branch (29:59): [True: 288, False: 0]
  ------------------
   30|    288|         oss << val;
   31|    288|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|    402|      } else {
   33|    402|         oss << format[i];
   34|    402|      }
   35|       |
   36|    402|      i += 1;
   37|    402|   }
   38|    288|}
_ZN5Botan3fmtIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS1_17basic_string_viewIcS4_EEDpRKT_:
   53|    101|std::string fmt(std::string_view format, const T&... args) {
   54|    101|   std::ostringstream oss;
   55|    101|   oss.imbue(std::locale::classic());
   56|    101|   fmt_detail::do_fmt(oss, format, args...);
   57|    101|   return oss.str();
   58|    101|}
_ZN5Botan10fmt_detail6do_fmtINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEJEEEvRNS2_19basic_ostringstreamIcS5_S7_EENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    101|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    101|   size_t i = 0;
   27|       |
   28|  2.22k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 2.22k, False: 0]
  ------------------
   29|  2.22k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 101, False: 2.12k]
  |  Branch (29:30): [True: 101, False: 0]
  |  Branch (29:59): [True: 101, False: 0]
  ------------------
   30|    101|         oss << val;
   31|    101|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  2.12k|      } else {
   33|  2.12k|         oss << format[i];
   34|  2.12k|      }
   35|       |
   36|  2.12k|      i += 1;
   37|  2.12k|   }
   38|    101|}
_ZN5Botan3fmtIJjjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS1_17basic_string_viewIcS4_EEDpRKT_:
   53|    174|std::string fmt(std::string_view format, const T&... args) {
   54|    174|   std::ostringstream oss;
   55|    174|   oss.imbue(std::locale::classic());
   56|    174|   fmt_detail::do_fmt(oss, format, args...);
   57|    174|   return oss.str();
   58|    174|}
_ZN5Botan10fmt_detail6do_fmtIjJjEEEvRNSt3__119basic_ostringstreamIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS2_17basic_string_viewIcS5_EERKT_DpRKT0_:
   25|    174|void do_fmt(std::ostringstream& oss, std::string_view format, const T& val, const Ts&... rest) {
   26|    174|   size_t i = 0;
   27|       |
   28|  5.91k|   while(i < format.size()) {
  ------------------
  |  Branch (28:10): [True: 5.91k, False: 0]
  ------------------
   29|  5.91k|      if(format[i] == '{' && (format.size() > (i + 1)) && format.at(i + 1) == '}') {
  ------------------
  |  Branch (29:10): [True: 174, False: 5.74k]
  |  Branch (29:30): [True: 174, False: 0]
  |  Branch (29:59): [True: 174, False: 0]
  ------------------
   30|    174|         oss << val;
   31|    174|         return do_fmt(oss, format.substr(i + 2), rest...);
   32|  5.74k|      } else {
   33|  5.74k|         oss << format[i];
   34|  5.74k|      }
   35|       |
   36|  5.74k|      i += 1;
   37|  5.74k|   }
   38|    174|}

_ZN5Botan11checked_addITkNSt3__117unsigned_integralEmTpTkNS1_17unsigned_integralEJmmEQ10all_same_vIT_DpT0_EEENS1_8optionalIS2_EES2_S2_S4_:
   37|   646k|constexpr inline std::optional<T> checked_add(T a, T b, Ts... rest) {
   38|   646k|   if(auto r = checked_add(a, b)) {
  ------------------
  |  Branch (38:12): [True: 646k, False: 0]
  ------------------
   39|   646k|      return checked_add(r.value(), rest...);
   40|   646k|   } else {
   41|      0|      return {};
   42|      0|   }
   43|   646k|}
_ZN5Botan11checked_addITkNSt3__117unsigned_integralEmEENS1_8optionalIT_EES3_S3_:
   19|  1.93M|constexpr inline std::optional<T> checked_add(T a, T b) {
   20|  1.93M|   const T r = a + b;
   21|  1.93M|   if(r < a || r < b) {
  ------------------
  |  Branch (21:7): [True: 0, False: 1.93M]
  |  Branch (21:16): [True: 0, False: 1.93M]
  ------------------
   22|      0|      return {};
   23|      0|   }
   24|  1.93M|   return r;
   25|  1.93M|}
_ZN5Botan11checked_addITkNSt3__117unsigned_integralEmTpTkNS1_17unsigned_integralEJmEQ10all_same_vIT_DpT0_EEENS1_8optionalIS2_EES2_S2_S4_:
   37|   646k|constexpr inline std::optional<T> checked_add(T a, T b, Ts... rest) {
   38|   646k|   if(auto r = checked_add(a, b)) {
  ------------------
  |  Branch (38:12): [True: 646k, False: 0]
  ------------------
   39|   646k|      return checked_add(r.value(), rest...);
   40|   646k|   } else {
   41|      0|      return {};
   42|      0|   }
   43|   646k|}
_ZN5Botan11checked_mulITkNSt3__117unsigned_integralEmEENS1_8optionalIT_EES3_S3_:
   46|  6.19k|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|  6.19k|   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|  6.19k|   if(a != 0 && r / a != b) {
  ------------------
  |  Branch (53:7): [True: 6.19k, False: 0]
  |  Branch (53:17): [True: 0, False: 6.19k]
  ------------------
   54|      0|      return {};
   55|      0|   }
   56|  6.19k|   return r;
   57|  6.19k|}
_ZN5Botan11checked_addITkNSt3__117unsigned_integralEjEENS1_8optionalIT_EES3_S3_:
   19|  64.2k|constexpr inline std::optional<T> checked_add(T a, T b) {
   20|  64.2k|   const T r = a + b;
   21|  64.2k|   if(r < a || r < b) {
  ------------------
  |  Branch (21:7): [True: 0, False: 64.2k]
  |  Branch (21:16): [True: 0, False: 64.2k]
  ------------------
   22|      0|      return {};
   23|      0|   }
   24|  64.2k|   return r;
   25|  64.2k|}

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

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

_ZN5Botan2CT13value_barrierITkNSt3__117unsigned_integralEmQntsr3stdE7same_asIbT_EEES3_S3_:
   43|    465|constexpr inline T value_barrier(T x) {
   44|    465|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (44:7): [Folded, False: 465]
  ------------------
   45|      0|      return x;
   46|    465|   } else {
   47|    465|#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|    465|      asm("" : "+r"(x) : /* no input */);  // NOLINT(*-no-assembler)
   56|    465|      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|    465|   }
   64|    465|}
_ZN5Botan2CT13value_barrierITkNSt3__117unsigned_integralEjQntsr3stdE7same_asIbT_EEES3_S3_:
   43|  52.9k|constexpr inline T value_barrier(T x) {
   44|  52.9k|   if(std::is_constant_evaluated()) {
  ------------------
  |  Branch (44:7): [Folded, False: 52.9k]
  ------------------
   45|      0|      return x;
   46|  52.9k|   } else {
   47|  52.9k|#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|  52.9k|      asm("" : "+r"(x) : /* no input */);  // NOLINT(*-no-assembler)
   56|  52.9k|      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|  52.9k|   }
   64|  52.9k|}

_ZN5Botan11ASN1_ObjectC2Ev:
  146|   146k|      ASN1_Object() = default;
_ZN5Botan11ASN1_ObjectD2Ev:
  168|   527k|      virtual ~ASN1_Object() = default;
_ZNK5Botan10BER_Object6is_setEv:
  267|   530k|      bool is_set() const { return m_type_tag != ASN1_Type::NoObject; }
_ZNK5Botan10BER_Object7taggingEv:
  272|   288k|      uint32_t tagging() const { return type_tag() | class_tag(); }
_ZNK5Botan10BER_Object8type_tagEv:
  277|   288k|      ASN1_Type type_tag() const { return m_type_tag; }
_ZNK5Botan10BER_Object9class_tagEv:
  282|   288k|      ASN1_Class class_tag() const { return m_class_tag; }
_ZNK5Botan10BER_Object4typeEv:
  287|   135k|      ASN1_Type type() const { return m_type_tag; }
_ZNK5Botan10BER_Object9get_classEv:
  292|  67.9k|      ASN1_Class get_class() const { return m_class_tag; }
_ZNK5Botan10BER_Object4bitsEv:
  298|  1.14M|      const uint8_t* bits() const { return m_value.data(); }
_ZNK5Botan10BER_Object6lengthEv:
  303|  2.77M|      size_t length() const { return m_value.size(); }
_ZNK5Botan10BER_Object4dataEv:
  308|   106k|      std::span<const uint8_t> data() const { return std::span{m_value}; }
_ZN5Botan10BER_Object12mutable_bitsEm:
  344|   220k|      uint8_t* mutable_bits(size_t length) {
  345|   220k|         m_value.resize(length);
  346|   220k|         return m_value.data();
  347|   220k|      }
_ZNK5Botan3OID14get_componentsEv:
  530|   657k|      const std::vector<uint32_t>& get_components() const {
  531|   657k|         return m_id;
  532|   657k|      }
_ZNK5Botan11ASN1_String5valueEv:
  590|  64.2k|      const std::string& value() const { return m_utf8_str; }
_ZN5BotanorENS_10ASN1_ClassES0_:
   91|  85.8k|inline ASN1_Class operator|(ASN1_Class x, ASN1_Class y) {
   92|  85.8k|   return static_cast<ASN1_Class>(static_cast<uint32_t>(x) | static_cast<uint32_t>(y));
   93|  85.8k|}
_ZN5BotanorENS_9ASN1_TypeENS_10ASN1_ClassE:
   98|   288k|inline uint32_t operator|(ASN1_Type x, ASN1_Class y) {
   99|   288k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
  100|   288k|}
_ZN5BotanorENS_10ASN1_ClassENS_9ASN1_TypeE:
  105|  67.9k|inline uint32_t operator|(ASN1_Class x, ASN1_Type y) {
  106|  67.9k|   return static_cast<uint32_t>(x) | static_cast<uint32_t>(y);
  107|  67.9k|}
_ZN5Botan10BER_ObjectC2Ev:
  239|   313k|      BER_Object() = default;
_ZN5Botan10BER_ObjectC2EOS0_:
  249|  84.2k|      BER_Object(BER_Object&& other) = default;
_ZN5Botan11ASN1_ObjectC2ERKS0_:
  151|  64.2k|      ASN1_Object(const ASN1_Object&) = default;
_ZN5Botan11ASN1_ObjectC2EOS0_:
  161|   317k|      ASN1_Object(ASN1_Object&&) = default;
_ZN5Botan11ASN1_ObjectaSEOS0_:
  166|   124k|      ASN1_Object& operator=(ASN1_Object&&) = default;
_ZN5Botan3OIDC2Ev:
  423|  68.1k|      explicit OID() = default;

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

_ZN5Botan11BER_Decoder6Limits3BEREm:
   50|  3.31k|            static Limits BER(size_t max_nested_indef = 16) {
   51|  3.31k|               return Limits(true, max_nested_indef, false, DefaultMaxObjectSize, false);
   52|  3.31k|            }
_ZN5Botan11BER_Decoder6LimitsC2EbmbNSt3__18optionalImEEb:
  134|  3.31k|                  m_allow_ber(allow_ber),
  135|  3.31k|                  m_max_nested_indef(max_nested_indef),
  136|  3.31k|                  m_allow_standalone_eoc(allow_standalone_eoc),
  137|  3.31k|                  m_max_object_size(max_object_size),
  138|  3.31k|                  m_reject_default_value_encoding(reject_default_value_encoding) {}
_ZNK5Botan11BER_Decoder6Limits18allow_ber_encodingEv:
   57|   526k|            bool allow_ber_encoding() const { return m_allow_ber; }
_ZNK5Botan11BER_Decoder6Limits20require_der_encodingEv:
   62|   305k|            bool require_der_encoding() const { return !allow_ber_encoding(); }
_ZNK5Botan11BER_Decoder6Limits28max_nested_indefinite_lengthEv:
   67|   221k|            size_t max_nested_indefinite_length() const { return m_max_nested_indef; }
_ZNK5Botan11BER_Decoder6Limits20allow_standalone_eocEv:
   75|     64|            bool allow_standalone_eoc() const { return m_allow_standalone_eoc; }
_ZNK5Botan11BER_Decoder6Limits15max_object_sizeEv:
   81|   220k|            std::optional<size_t> max_object_size() const { return m_max_object_size; }
_ZNK5Botan11BER_Decoder6limitsEv:
  198|  87.2k|      Limits limits() const { return m_limits; }
_ZN5Botan11BER_Decoder14start_sequenceEv:
  276|  73.6k|      BER_Decoder start_sequence() { return start_cons(ASN1_Type::Sequence, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9start_setEv:
  282|  13.2k|      BER_Decoder start_set() { return start_cons(ASN1_Type::Set, ASN1_Class::Universal); }
_ZN5Botan11BER_Decoder9raw_bytesINSt3__19allocatorIhEEEERS0_RNS2_6vectorIhT_EE:
  339|  3.05k|      BER_Decoder& raw_bytes(std::vector<uint8_t, Alloc>& out) {
  340|  3.05k|         out.clear();
  341|  3.05k|         uint8_t buf[64];
  342|  24.0k|         while(const size_t got = this->read_bytes(std::span{buf})) {
  ------------------
  |  Branch (342:29): [True: 21.0k, False: 3.05k]
  ------------------
  343|  21.0k|            out.insert(out.end(), buf, buf + got);
  344|  21.0k|         }
  345|  3.05k|         return (*this);
  346|  3.05k|      }

_ZN5Botan10DataSourceC2Ev:
  107|  90.6k|      DataSource() = default;
_ZN5Botan10DataSourceD2Ev:
  109|  90.6k|      virtual ~DataSource() = default;
_ZN5Botan17DataSource_MemoryC2ENSt3__14spanIKhLm18446744073709551615EEE:
  181|  6.37k|      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.37k|         if(!in.empty()) {
  ------------------
  |  Branch (183:13): [True: 6.19k, False: 178]
  ------------------
  184|  6.19k|            m_source.assign(in.begin(), in.end());
  185|  6.19k|         }
  186|  6.37k|      }

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

_ZN5Botan8copy_memIhQsr3stdE12is_trivial_vIu7__decayIT_EEEEvPS1_PKS1_m:
  144|  2.06M|inline constexpr void copy_mem(T* out, const T* in, size_t n) {
  145|  2.06M|   BOTAN_ASSERT_IMPLICATION(n > 0, in != nullptr && out != nullptr, "If n > 0 then args are not null");
  ------------------
  |  |  110|  2.06M|   do {                                                                                          \
  |  |  111|  2.06M|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                                              \
  |  |  112|  4.01M|      if((expr1) && !(expr2)) {                                                                  \
  |  |  ------------------
  |  |  |  Branch (112:10): [True: 2.00M, False: 57.8k]
  |  |  |  Branch (112:23): [True: 2.00M, False: 0]
  |  |  |  Branch (112:23): [True: 2.00M, False: 0]
  |  |  ------------------
  |  |  113|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                                     \
  |  |  114|      0|         Botan::assertion_failure(#expr1 " implies " #expr2, msg, __func__, __FILE__, __LINE__); \
  |  |  115|      0|      }                                                                                          \
  |  |  116|  2.06M|   } while(0)
  |  |  ------------------
  |  |  |  Branch (116:12): [Folded, False: 2.06M]
  |  |  ------------------
  ------------------
  146|       |
  147|  2.06M|   if(in != nullptr && out != nullptr && n > 0) {
  ------------------
  |  Branch (147:7): [True: 2.06M, False: 195]
  |  Branch (147:24): [True: 2.01M, False: 53.0k]
  |  Branch (147:42): [True: 2.00M, False: 4.55k]
  ------------------
  148|  2.00M|      std::memmove(out, in, sizeof(T) * n);
  149|  2.00M|   }
  150|  2.06M|}
_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|   139k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|   139k|   ranges::assert_equal_byte_lengths(out, in);
  178|   139k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|   139k|}
_ZN5Botan19secure_scrub_memoryITkNS_6ranges23contiguous_output_rangeERNSt3__16vectorIhNS2_9allocatorIhEEEEEEvOT_:
   59|   397k|void secure_scrub_memory(ranges::contiguous_output_range auto&& data) {
   60|   397k|   secure_scrub_memory(std::ranges::data(data), ranges::size_bytes(data));
   61|   397k|}
_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.8k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  26.8k|   ToT dst;  // NOLINT(*-member-init)
  212|  26.8k|   typecast_copy(dst, src);
  213|  26.8k|   return dst;
  214|  26.8k|}
_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.8k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  26.8k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  26.8k|}
_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.8k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  26.8k|   ranges::assert_equal_byte_lengths(out, in);
  178|  26.8k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  26.8k|}
_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.69k|inline constexpr ToT typecast_copy(const FromR& src) {
  211|  2.69k|   ToT dst;  // NOLINT(*-member-init)
  212|  2.69k|   typecast_copy(dst, src);
  213|  2.69k|   return dst;
  214|  2.69k|}
_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.69k|inline constexpr void typecast_copy(ToT& out, const FromR& in) {
  189|  2.69k|   typecast_copy(std::span<ToT, 1>(&out, 1), in);
  190|  2.69k|}
_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.69k|inline constexpr void typecast_copy(ToR&& out /* NOLINT(*-std-forward) */, const FromR& in) {
  177|  2.69k|   ranges::assert_equal_byte_lengths(out, in);
  178|  2.69k|   std::memcpy(std::ranges::data(out), std::ranges::data(in), ranges::size_bytes(out));
  179|  2.69k|}

_ZN5Botan7X509_DNC2Ev:
  159|  9.95k|      X509_DN() = default;
_ZNK5Botan7X509_DN16_canonical_bytesEv:
  274|  7.99k|      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|   278k|{
  101|   278k|   const std::span s0{r0};
  102|       |
  103|   278k|   if constexpr(statically_spanable_range<R0>) {
  104|   278k|      constexpr size_t expected_size = s0.size_bytes();
  105|   278k|      (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|   278k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm8ETkNS0_14spanable_rangeENSt3__15arrayImLm1EEEEEvRKT0_:
   77|   278k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|   278k|   const std::span s{r};
   79|   278k|   if constexpr(statically_spanable_range<R>) {
   80|   278k|      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|   278k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__15arrayIhLm8EEEEEmRKT_:
   59|   139k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   139k|   return std::span{r}.size_bytes();
   61|   139k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__16vectorIhNS2_9allocatorIhEEEEEEmRKT_:
   59|   397k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|   397k|   return std::span{r}.size_bytes();
   61|   397k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm2ETkNS0_14spanable_rangeENSt3__14spanIKhLm2EEEEEvRKT0_:
   77|  53.7k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  53.7k|   const std::span s{r};
   79|  53.7k|   if constexpr(statically_spanable_range<R>) {
   80|  53.7k|      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|  53.7k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanItLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm2EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  26.8k|{
  101|  26.8k|   const std::span s0{r0};
  102|       |
  103|  26.8k|   if constexpr(statically_spanable_range<R0>) {
  104|  26.8k|      constexpr size_t expected_size = s0.size_bytes();
  105|  26.8k|      (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.8k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanItLm1EEEEEmRKT_:
   59|  26.8k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  26.8k|   return std::span{r}.size_bytes();
   61|  26.8k|}
_ZN5Botan6ranges24assert_exact_byte_lengthILm4ETkNS0_14spanable_rangeENSt3__14spanIKhLm4EEEEEvRKT0_:
   77|  5.39k|inline constexpr void assert_exact_byte_length(const R& r) {
   78|  5.39k|   const std::span s{r};
   79|  5.39k|   if constexpr(statically_spanable_range<R>) {
   80|  5.39k|      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|  5.39k|}
_ZN5Botan6ranges25assert_equal_byte_lengthsITkNS0_14spanable_rangeENSt3__14spanIjLm1EEETpTkNS0_14spanable_rangeEJNS3_IKhLm4EEEEEEvRKT_DpRKT0_QgtsZT0_Li0E:
  100|  2.69k|{
  101|  2.69k|   const std::span s0{r0};
  102|       |
  103|  2.69k|   if constexpr(statically_spanable_range<R0>) {
  104|  2.69k|      constexpr size_t expected_size = s0.size_bytes();
  105|  2.69k|      (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.69k|}
_ZN5Botan6ranges10size_bytesITkNS0_14spanable_rangeENSt3__14spanIjLm1EEEEEmRKT_:
   59|  2.69k|inline constexpr size_t size_bytes(const spanable_range auto& r) {
   60|  2.69k|   return std::span{r}.size_bytes();
   61|  2.69k|}

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

_ZN5Botan16wrap_strong_typeItRtQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  353|  26.8k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  354|  26.8k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  355|       |      // Noop, if the parameter type already is the desired return type.
  356|  26.8k|      return std::forward<ParamT>(t);
  357|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  358|       |      // Implicit conversion from the parameter type to the return type.
  359|       |      return T{std::forward<ParamT>(t)};
  360|       |   } else {
  361|       |      // Explicitly calling the wrapped type's constructor to support
  362|       |      // implicit conversions on types that mark their constructors as explicit.
  363|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  364|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  365|       |   }
  366|  26.8k|}
_ZN5Botan16wrap_strong_typeIjRjQoosr3stdE18constructible_fromIT_T0_Eaasr8conceptsE11strong_typeIS2_Esr3stdE18constructible_fromINS2_12wrapped_typeES3_EEEDcOS3_:
  353|  2.69k|[[nodiscard]] constexpr decltype(auto) wrap_strong_type(ParamT&& t) {
  354|  2.69k|   if constexpr(std::same_as<std::remove_cvref_t<ParamT>, T>) {
  355|       |      // Noop, if the parameter type already is the desired return type.
  356|  2.69k|      return std::forward<ParamT>(t);
  357|       |   } else if constexpr(std::constructible_from<T, ParamT>) {
  358|       |      // Implicit conversion from the parameter type to the return type.
  359|       |      return T{std::forward<ParamT>(t)};
  360|       |   } else {
  361|       |      // Explicitly calling the wrapped type's constructor to support
  362|       |      // implicit conversions on types that mark their constructors as explicit.
  363|       |      static_assert(concepts::strong_type<T> && std::constructible_from<typename T::wrapped_type, ParamT>);
  364|       |      return T{typename T::wrapped_type{std::forward<ParamT>(t)}};
  365|       |   }
  366|  2.69k|}

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.32k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t in[], size_t len) {
   40|  3.32k|   if(len <= max_fuzzer_input_size) {
  ------------------
  |  Branch (40:7): [True: 3.31k, False: 9]
  ------------------
   41|  3.31k|      try {
   42|  3.31k|         fuzz(std::span<const uint8_t>(in, len));
   43|  3.31k|      } 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.31k|   }
   51|  3.32k|   return 0;
   52|  3.32k|}

_Z4fuzzNSt3__14spanIKhLm18446744073709551615EEE:
   64|  3.31k|void fuzz(std::span<const uint8_t> in) {
   65|  3.31k|   Botan::X509_DN dn1;
   66|  3.31k|   Botan::X509_DN dn2;
   67|  3.31k|   Botan::X509_DN dn3;
   68|       |
   69|  3.31k|   try {
   70|  3.31k|      Botan::BER_Decoder ber(in);
   71|  3.31k|      dn1.decode_from(ber);
   72|  3.31k|      dn2.decode_from(ber);
   73|  3.31k|      dn3.decode_from(ber);
   74|  3.31k|   } catch(...) {
   75|  3.17k|      return;
   76|  3.17k|   }
   77|       |
   78|       |   // Pairwise consistency of < and ==
   79|    148|   check_pairwise(dn1, dn2);
   80|    148|   check_pairwise(dn1, dn3);
   81|    148|   check_pairwise(dn2, dn3);
   82|       |
   83|       |   // Transitivity across all three
   84|    148|   check_transitivity(dn1, dn2, dn3);
   85|    148|   check_transitivity(dn1, dn3, dn2);
   86|    148|   check_transitivity(dn2, dn1, dn3);
   87|    148|}
x509_dn.cpp:_ZN12_GLOBAL__N_114check_pairwiseERKN5Botan7X509_DNES3_:
   14|    444|void check_pairwise(const Botan::X509_DN& a, const Botan::X509_DN& b) {
   15|    444|   const bool eq = a == b;
   16|    444|   const bool lt1 = a < b;
   17|    444|   const bool lt2 = b < a;
   18|       |
   19|    444|   if(lt1 == false && lt2 == false) {
  ------------------
  |  Branch (19:7): [True: 218, False: 226]
  |  Branch (19:23): [True: 41, False: 177]
  ------------------
   20|     41|      FUZZER_ASSERT_TRUE(eq);
  ------------------
  |  |   89|     41|   do {                                                               \
  |  |   90|     41|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     41|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 41]
  |  |  ------------------
  |  |   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|     41|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 41]
  |  |  ------------------
  ------------------
   21|    403|   } else {
   22|    403|      FUZZER_ASSERT_TRUE(!eq);
  ------------------
  |  |   89|    403|   do {                                                               \
  |  |   90|    403|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    403|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 403]
  |  |  ------------------
  |  |   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|    403|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 403]
  |  |  ------------------
  ------------------
   23|    403|      FUZZER_ASSERT_TRUE(!lt1 || !lt2);
  ------------------
  |  |   89|    403|   do {                                                               \
  |  |   90|    403|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|    629|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:12): [True: 177, False: 226]
  |  |  |  Branch (91:12): [True: 226, 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|    403|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 403]
  |  |  ------------------
  ------------------
   24|    403|   }
   25|    444|}
x509_dn.cpp:_ZN12_GLOBAL__N_118check_transitivityERKN5Botan7X509_DNES3_S3_:
   27|    444|void check_transitivity(const Botan::X509_DN& a, const Botan::X509_DN& b, const Botan::X509_DN& c) {
   28|    444|   const bool ab = a < b;
   29|    444|   const bool ba = b < a;
   30|    444|   const bool bc = b < c;
   31|    444|   const bool cb = c < b;
   32|    444|   const bool ac = a < c;
   33|    444|   const bool ca = c < a;
   34|       |
   35|       |   // a < b && b < c => a < c
   36|    444|   if(ab && bc) {
  ------------------
  |  Branch (36:7): [True: 214, False: 230]
  |  Branch (36:13): [True: 71, False: 143]
  ------------------
   37|     71|      FUZZER_ASSERT_TRUE(ac);
  ------------------
  |  |   89|     71|   do {                                                               \
  |  |   90|     71|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     71|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 71]
  |  |  ------------------
  |  |   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|     71|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 71]
  |  |  ------------------
  ------------------
   38|     71|   }
   39|    444|   if(cb && ba) {
  ------------------
  |  Branch (39:7): [True: 189, False: 255]
  |  Branch (39:13): [True: 46, False: 143]
  ------------------
   40|     46|      FUZZER_ASSERT_TRUE(ca);
  ------------------
  |  |   89|     46|   do {                                                               \
  |  |   90|     46|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     46|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 46]
  |  |  ------------------
  |  |   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|     46|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 46]
  |  |  ------------------
  ------------------
   41|     46|   }
   42|    444|   if(ac && cb) {
  ------------------
  |  Branch (42:7): [True: 226, False: 218]
  |  Branch (42:13): [True: 61, False: 165]
  ------------------
   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|    444|   if(!ab && !ba && bc) {
  ------------------
  |  Branch (48:7): [True: 230, False: 214]
  |  Branch (48:14): [True: 38, False: 192]
  |  Branch (48:21): [True: 15, False: 23]
  ------------------
   49|     15|      FUZZER_ASSERT_TRUE(ac);
  ------------------
  |  |   89|     15|   do {                                                               \
  |  |   90|     15|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     15|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 15]
  |  |  ------------------
  |  |   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|     15|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 15]
  |  |  ------------------
  ------------------
   50|     15|   }
   51|    444|   if(!ab && !ba && cb) {
  ------------------
  |  Branch (51:7): [True: 230, False: 214]
  |  Branch (51:14): [True: 38, False: 192]
  |  Branch (51:21): [True: 8, False: 30]
  ------------------
   52|      8|      FUZZER_ASSERT_TRUE(ca);
  ------------------
  |  |   89|      8|   do {                                                               \
  |  |   90|      8|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|      8|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 8]
  |  |  ------------------
  |  |   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|      8|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 8]
  |  |  ------------------
  ------------------
   53|      8|   }
   54|    444|   if(!bc && !cb && ab) {
  ------------------
  |  Branch (54:7): [True: 233, False: 211]
  |  Branch (54:14): [True: 44, False: 189]
  |  Branch (54:21): [True: 8, False: 36]
  ------------------
   55|      8|      FUZZER_ASSERT_TRUE(ac);
  ------------------
  |  |   89|      8|   do {                                                               \
  |  |   90|      8|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|      8|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 8]
  |  |  ------------------
  |  |   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|      8|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 8]
  |  |  ------------------
  ------------------
   56|      8|   }
   57|    444|   if(!bc && !cb && ca) {
  ------------------
  |  Branch (57:7): [True: 233, False: 211]
  |  Branch (57:14): [True: 44, False: 189]
  |  Branch (57:21): [True: 21, False: 23]
  ------------------
   58|     21|      FUZZER_ASSERT_TRUE(ba);
  ------------------
  |  |   89|     21|   do {                                                               \
  |  |   90|     21|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                   \
  |  |   91|     21|      if(!(e)) {                                                      \
  |  |  ------------------
  |  |  |  Branch (91:10): [True: 0, False: 21]
  |  |  ------------------
  |  |   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|     21|   } while(0)
  |  |  ------------------
  |  |  |  Branch (94:12): [Folded, False: 21]
  |  |  ------------------
  ------------------
   59|     21|   }
   60|    444|}

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

_ZN5BotanltERKNS_3OIDES2_:
  175|   328k|bool operator<(const OID& a, const OID& b) {
  176|   328k|   const std::vector<uint32_t>& oid1 = a.get_components();
  177|   328k|   const std::vector<uint32_t>& oid2 = b.get_components();
  178|       |
  179|   328k|   return std::lexicographical_compare(oid1.begin(), oid1.end(), oid2.begin(), oid2.end());
  180|   328k|}
_ZNK5Botan3OID11encode_intoERNS_11DER_EncoderE:
  185|  64.2k|void OID::encode_into(DER_Encoder& der) const {
  186|  64.2k|   if(m_id.size() < 2) {
  ------------------
  |  Branch (186:7): [True: 0, False: 64.2k]
  ------------------
  187|      0|      throw Invalid_Argument("OID::encode_into: OID is invalid");
  188|      0|   }
  189|       |
  190|  64.2k|   auto append = [](std::vector<uint8_t>& encoding, uint32_t z) {
  191|  64.2k|      if(z <= 0x7F) {
  192|  64.2k|         encoding.push_back(static_cast<uint8_t>(z));
  193|  64.2k|      } else {
  194|  64.2k|         const size_t z7 = (high_bit(z) + 7 - 1) / 7;
  195|       |
  196|  64.2k|         for(size_t j = 0; j != z7; ++j) {
  197|  64.2k|            uint8_t zp = static_cast<uint8_t>(z >> (7 * (z7 - j - 1)) & 0x7F);
  198|       |
  199|  64.2k|            if(j != z7 - 1) {
  200|  64.2k|               zp |= 0x80;
  201|  64.2k|            }
  202|       |
  203|  64.2k|            encoding.push_back(zp);
  204|  64.2k|         }
  205|  64.2k|      }
  206|  64.2k|   };
  207|       |
  208|  64.2k|   std::vector<uint8_t> encoding;
  209|       |
  210|       |   // We know 40 * root can't overflow because root is between 0 and 2
  211|  64.2k|   auto first = checked_add(40 * m_id[0], m_id[1]);
  212|  64.2k|   BOTAN_ASSERT_NOMSG(first.has_value());
  ------------------
  |  |   84|  64.2k|   do {                                                                     \
  |  |   85|  64.2k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|  64.2k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 64.2k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|  64.2k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 64.2k]
  |  |  ------------------
  ------------------
  213|       |
  214|  64.2k|   append(encoding, *first);
  215|       |
  216|   159k|   for(size_t i = 2; i != m_id.size(); ++i) {
  ------------------
  |  Branch (216:22): [True: 95.7k, False: 64.2k]
  ------------------
  217|  95.7k|      append(encoding, m_id[i]);
  218|  95.7k|   }
  219|  64.2k|   der.add_object(ASN1_Type::ObjectId, ASN1_Class::Universal, encoding);
  220|  64.2k|}
_ZN5Botan3OID11decode_fromERNS_11BER_DecoderE:
  225|  67.9k|void OID::decode_from(BER_Decoder& decoder) {
  226|  67.9k|   const BER_Object obj = decoder.get_next_object();
  227|  67.9k|   if(obj.tagging() != (ASN1_Class::Universal | ASN1_Type::ObjectId)) {
  ------------------
  |  Branch (227:7): [True: 114, False: 67.8k]
  ------------------
  228|    114|      throw BER_Bad_Tag("Error decoding OID, unknown tag", obj.tagging());
  229|    114|   }
  230|       |
  231|  67.8k|   if(obj.length() == 0) {
  ------------------
  |  Branch (231:7): [True: 3, False: 67.8k]
  ------------------
  232|      3|      throw BER_Decoding_Error("OID encoding is too short");
  233|      3|   }
  234|       |
  235|  67.8k|   auto consume = [](BufferSlicer& data) -> uint32_t {
  236|  67.8k|      BOTAN_ASSERT_NOMSG(!data.empty());
  237|  67.8k|      uint32_t b = data.take_byte();
  238|       |
  239|  67.8k|      if(b > 0x7F) {
  240|  67.8k|         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|  67.8k|         if(b == 0) {
  246|  67.8k|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  247|  67.8k|         }
  248|       |
  249|  67.8k|         while(true) {
  250|  67.8k|            if(data.empty()) {
  251|  67.8k|               throw Decoding_Error("Truncated OID value");
  252|  67.8k|            }
  253|       |
  254|  67.8k|            const uint8_t next = data.take_byte();
  255|  67.8k|            const bool more = (next & 0x80) == 0x80;
  256|  67.8k|            const uint8_t value = next & 0x7F;
  257|       |
  258|  67.8k|            if((b >> (32 - 7)) != 0) {
  259|  67.8k|               throw Decoding_Error("OID component overflow");
  260|  67.8k|            }
  261|       |
  262|  67.8k|            b = (b << 7) | value;
  263|       |
  264|  67.8k|            if(!more) {
  265|  67.8k|               break;
  266|  67.8k|            }
  267|  67.8k|         }
  268|  67.8k|      }
  269|       |
  270|  67.8k|      return b;
  271|  67.8k|   };
  272|       |
  273|  67.8k|   BufferSlicer data(obj.data());
  274|  67.8k|   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.
  278|  67.8k|   parts.reserve(obj.length() + 1);
  279|       |
  280|   237k|   while(!data.empty()) {
  ------------------
  |  Branch (280:10): [True: 169k, False: 67.8k]
  ------------------
  281|   169k|      const uint32_t comp = consume(data);
  282|       |
  283|   169k|      if(parts.empty()) {
  ------------------
  |  Branch (283:10): [True: 67.8k, False: 101k]
  ------------------
  284|       |         // divide into root and second arc
  285|       |
  286|  67.8k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  287|  67.8k|            if(b0 < 40) {
  288|  67.8k|               return 0;
  289|  67.8k|            } else if(b0 < 80) {
  290|  67.8k|               return 1;
  291|  67.8k|            } else {
  292|  67.8k|               return 2;
  293|  67.8k|            }
  294|  67.8k|         }(comp);
  295|       |
  296|  67.8k|         parts.push_back(root_arc);
  297|  67.8k|         BOTAN_ASSERT_NOMSG(comp >= 40 * root_arc);
  ------------------
  |  |   84|  67.8k|   do {                                                                     \
  |  |   85|  67.8k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|  67.8k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 67.8k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|  67.8k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 67.8k]
  |  |  ------------------
  ------------------
  298|  67.8k|         parts.push_back(comp - 40 * root_arc);
  299|   101k|      } else {
  300|   101k|         parts.push_back(comp);
  301|   101k|      }
  302|   169k|   }
  303|       |
  304|  67.8k|   m_id = std::move(parts);
  305|  67.8k|}
asn1_oid.cpp:_ZZNK5Botan3OID11encode_intoERNS_11DER_EncoderEENK3$_0clERNSt3__16vectorIhNS4_9allocatorIhEEEEj:
  190|   159k|   auto append = [](std::vector<uint8_t>& encoding, uint32_t z) {
  191|   159k|      if(z <= 0x7F) {
  ------------------
  |  Branch (191:10): [True: 149k, False: 10.5k]
  ------------------
  192|   149k|         encoding.push_back(static_cast<uint8_t>(z));
  193|   149k|      } else {
  194|  10.5k|         const size_t z7 = (high_bit(z) + 7 - 1) / 7;
  195|       |
  196|  36.4k|         for(size_t j = 0; j != z7; ++j) {
  ------------------
  |  Branch (196:28): [True: 25.8k, False: 10.5k]
  ------------------
  197|  25.8k|            uint8_t zp = static_cast<uint8_t>(z >> (7 * (z7 - j - 1)) & 0x7F);
  198|       |
  199|  25.8k|            if(j != z7 - 1) {
  ------------------
  |  Branch (199:16): [True: 15.2k, False: 10.5k]
  ------------------
  200|  15.2k|               zp |= 0x80;
  201|  15.2k|            }
  202|       |
  203|  25.8k|            encoding.push_back(zp);
  204|  25.8k|         }
  205|  10.5k|      }
  206|   159k|   };
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_0clERNS_12BufferSlicerE:
  235|   169k|   auto consume = [](BufferSlicer& data) -> uint32_t {
  236|   169k|      BOTAN_ASSERT_NOMSG(!data.empty());
  ------------------
  |  |   84|   169k|   do {                                                                     \
  |  |   85|   169k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   169k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 169k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   169k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 169k]
  |  |  ------------------
  ------------------
  237|   169k|      uint32_t b = data.take_byte();
  238|       |
  239|   169k|      if(b > 0x7F) {
  ------------------
  |  Branch (239:10): [True: 11.6k, False: 157k]
  ------------------
  240|  11.6k|         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.6k|         if(b == 0) {
  ------------------
  |  Branch (245:13): [True: 12, False: 11.6k]
  ------------------
  246|     12|            throw Decoding_Error("Leading zero byte in multibyte OID encoding");
  247|     12|         }
  248|       |
  249|  16.9k|         while(true) {
  ------------------
  |  Branch (249:16): [True: 16.9k, Folded]
  ------------------
  250|  16.9k|            if(data.empty()) {
  ------------------
  |  Branch (250:16): [True: 23, False: 16.9k]
  ------------------
  251|     23|               throw Decoding_Error("Truncated OID value");
  252|     23|            }
  253|       |
  254|  16.9k|            const uint8_t next = data.take_byte();
  255|  16.9k|            const bool more = (next & 0x80) == 0x80;
  256|  16.9k|            const uint8_t value = next & 0x7F;
  257|       |
  258|  16.9k|            if((b >> (32 - 7)) != 0) {
  ------------------
  |  Branch (258:16): [True: 28, False: 16.9k]
  ------------------
  259|     28|               throw Decoding_Error("OID component overflow");
  260|     28|            }
  261|       |
  262|  16.9k|            b = (b << 7) | value;
  263|       |
  264|  16.9k|            if(!more) {
  ------------------
  |  Branch (264:16): [True: 11.6k, False: 5.30k]
  ------------------
  265|  11.6k|               break;
  266|  11.6k|            }
  267|  16.9k|         }
  268|  11.6k|      }
  269|       |
  270|   169k|      return b;
  271|   169k|   };
asn1_oid.cpp:_ZZN5Botan3OID11decode_fromERNS_11BER_DecoderEENK3$_1clEj:
  286|  67.8k|         const uint32_t root_arc = [](uint32_t b0) -> uint32_t {
  287|  67.8k|            if(b0 < 40) {
  ------------------
  |  Branch (287:16): [True: 51.3k, False: 16.4k]
  ------------------
  288|  51.3k|               return 0;
  289|  51.3k|            } else if(b0 < 80) {
  ------------------
  |  Branch (289:23): [True: 11.7k, False: 4.74k]
  ------------------
  290|  11.7k|               return 1;
  291|  11.7k|            } else {
  292|  4.74k|               return 2;
  293|  4.74k|            }
  294|  67.8k|         }(comp);

_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEENS_9ASN1_TypeE:
  135|  68.1k|ASN1_String::ASN1_String(std::string_view str, ASN1_Type t) : m_utf8_str(str), m_tag(t) {
  136|  68.1k|   if(!is_utf8_subset_string_type(m_tag)) {
  ------------------
  |  Branch (136:7): [True: 0, False: 68.1k]
  ------------------
  137|      0|      throw Invalid_Argument("ASN1_String only supports encoding to UTF-8 or a UTF-8 subset");
  138|      0|   }
  139|       |
  140|  68.1k|   if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (140:7): [True: 0, False: 68.1k]
  ------------------
  141|      0|      throw Invalid_Argument(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  142|      0|   }
  143|  68.1k|}
_ZN5Botan11ASN1_StringC2ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  145|  68.1k|ASN1_String::ASN1_String(std::string_view str) : ASN1_String(str, choose_encoding(str)) {}
_ZN5Botan11ASN1_String11decode_fromERNS_11BER_DecoderE:
  162|  67.8k|void ASN1_String::decode_from(BER_Decoder& source) {
  163|  67.8k|   const BER_Object obj = source.get_next_object();
  164|       |
  165|  67.8k|   if(obj.get_class() != ASN1_Class::Universal || !is_asn1_string_type(obj.type())) {
  ------------------
  |  Branch (165:7): [True: 88, False: 67.7k]
  |  Branch (165:51): [True: 96, False: 67.6k]
  ------------------
  166|    174|      auto typ = static_cast<uint32_t>(obj.type());
  167|    174|      auto cls = static_cast<uint32_t>(obj.get_class());
  168|    174|      throw Decoding_Error(fmt("ASN1_String: Unknown string type {}/{}", typ, cls));
  169|    174|   }
  170|       |
  171|  67.6k|   m_tag = obj.type();
  172|  67.6k|   m_data.assign(obj.bits(), obj.bits() + obj.length());
  173|       |
  174|  67.6k|   if(m_tag == ASN1_Type::BmpString) {
  ------------------
  |  Branch (174:7): [True: 6.70k, False: 60.9k]
  ------------------
  175|  6.70k|      m_utf8_str = ucs2_to_utf8(m_data);
  176|  60.9k|   } else if(m_tag == ASN1_Type::UniversalString) {
  ------------------
  |  Branch (176:14): [True: 5.34k, False: 55.5k]
  ------------------
  177|  5.34k|      m_utf8_str = ucs4_to_utf8(m_data);
  178|  55.5k|   } else if(m_tag == ASN1_Type::TeletexString) {
  ------------------
  |  Branch (178:14): [True: 16.8k, False: 38.6k]
  ------------------
  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|  16.8k|      m_utf8_str = latin1_to_utf8(m_data);
  184|  38.6k|   } else {
  185|       |      // All other supported string types are UTF-8 or some subset thereof
  186|  38.6k|      m_utf8_str = ASN1::to_string(obj);
  187|       |
  188|  38.6k|      if(!is_valid_asn1_string_content(m_utf8_str, m_tag)) {
  ------------------
  |  Branch (188:10): [True: 101, False: 38.5k]
  ------------------
  189|    101|         throw Decoding_Error(fmt("ASN1_String: Invalid {} encoding", asn1_tag_to_string(m_tag)));
  190|    101|      }
  191|  38.6k|   }
  192|  67.6k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_119is_asn1_string_typeENS_9ASN1_TypeE:
   99|  67.7k|bool is_asn1_string_type(ASN1_Type tag) {
  100|  67.7k|   return (is_utf8_subset_string_type(tag) || tag == ASN1_Type::TeletexString || tag == ASN1_Type::BmpString ||
  ------------------
  |  Branch (100:12): [True: 38.6k, False: 29.0k]
  |  Branch (100:47): [True: 16.8k, False: 12.1k]
  |  Branch (100:82): [True: 6.70k, False: 5.44k]
  ------------------
  101|  5.44k|           tag == ASN1_Type::UniversalString);
  ------------------
  |  Branch (101:12): [True: 5.34k, False: 96]
  ------------------
  102|  67.7k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_126is_utf8_subset_string_typeENS_9ASN1_TypeE:
   94|   242k|bool is_utf8_subset_string_type(ASN1_Type tag) {
   95|   242k|   return (tag == ASN1_Type::NumericString || tag == ASN1_Type::PrintableString || tag == ASN1_Type::VisibleString ||
  ------------------
  |  Branch (95:12): [True: 2.66k, False: 240k]
  |  Branch (95:47): [True: 192k, False: 47.1k]
  |  Branch (95:84): [True: 3.04k, False: 44.0k]
  ------------------
   96|  44.0k|           tag == ASN1_Type::Ia5String || tag == ASN1_Type::Utf8String);
  ------------------
  |  Branch (96:12): [True: 6.70k, False: 37.3k]
  |  Branch (96:43): [True: 8.35k, False: 29.0k]
  ------------------
   97|   242k|}
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_128is_valid_asn1_string_contentERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_9ASN1_TypeE:
  104|   106k|bool is_valid_asn1_string_content(const std::string& str, ASN1_Type tag) {
  105|   106k|   BOTAN_ASSERT_NOMSG(is_utf8_subset_string_type(tag));
  ------------------
  |  |   84|   106k|   do {                                                                     \
  |  |   85|   106k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   106k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 106k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   106k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 106k]
  |  |  ------------------
  ------------------
  106|       |
  107|   106k|   switch(tag) {
  108|  4.17k|      case ASN1_Type::Utf8String:
  ------------------
  |  Branch (108:7): [True: 4.17k, False: 102k]
  ------------------
  109|  4.17k|         return is_valid_utf8(str);
  110|  1.33k|      case ASN1_Type::NumericString:
  ------------------
  |  Branch (110:7): [True: 1.33k, False: 105k]
  ------------------
  111|  97.7k|      case ASN1_Type::PrintableString:
  ------------------
  |  Branch (111:7): [True: 96.4k, False: 10.3k]
  ------------------
  112|   101k|      case ASN1_Type::Ia5String:
  ------------------
  |  Branch (112:7): [True: 3.35k, False: 103k]
  ------------------
  113|   102k|      case ASN1_Type::VisibleString:
  ------------------
  |  Branch (113:7): [True: 1.52k, False: 105k]
  ------------------
  114|   102k|         return g_char_validator.valid_encoding(str, tag);
  115|      0|      default:
  ------------------
  |  Branch (115:7): [True: 0, False: 106k]
  ------------------
  116|      0|         return false;
  117|   106k|   }
  118|   106k|}
asn1_str.cpp:_ZNK5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator14valid_encodingENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEENS_9ASN1_TypeE:
   25|   170k|      constexpr bool valid_encoding(std::string_view str, ASN1_Type tag) const {
   26|   170k|         const uint8_t mask = mask_for(tag);
   27|   170k|         for(const char c : str) {
  ------------------
  |  Branch (27:27): [True: 6.29k, False: 170k]
  ------------------
   28|  6.29k|            const uint8_t codepoint = static_cast<uint8_t>(c);
   29|  6.29k|            const bool is_valid = (m_table[codepoint] & mask) != 0;
   30|       |
   31|  6.29k|            if(!is_valid) {
  ------------------
  |  Branch (31:16): [True: 25, False: 6.27k]
  ------------------
   32|     25|               return false;
   33|     25|            }
   34|  6.29k|         }
   35|       |
   36|   170k|         return true;
   37|   170k|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_131ASN1_String_Codepoint_Validator8mask_forENS_9ASN1_TypeE:
   45|   170k|      static constexpr uint8_t mask_for(ASN1_Type tag) {
   46|   170k|         switch(tag) {
   47|  1.33k|            case ASN1_Type::NumericString:
  ------------------
  |  Branch (47:13): [True: 1.33k, False: 169k]
  ------------------
   48|  1.33k|               return Numeric_String;
   49|   164k|            case ASN1_Type::PrintableString:
  ------------------
  |  Branch (49:13): [True: 164k, False: 6.20k]
  ------------------
   50|   164k|               return Printable_String;
   51|  3.35k|            case ASN1_Type::Ia5String:
  ------------------
  |  Branch (51:13): [True: 3.35k, False: 167k]
  ------------------
   52|  3.35k|               return IA5_String;
   53|  1.52k|            case ASN1_Type::VisibleString:
  ------------------
  |  Branch (53:13): [True: 1.52k, False: 169k]
  ------------------
   54|  1.52k|               return Visible_String;
   55|      0|            default:
  ------------------
  |  Branch (55:13): [True: 0, False: 170k]
  ------------------
   56|      0|               return 0;
   57|   170k|         }
   58|   170k|      }
asn1_str.cpp:_ZN5Botan12_GLOBAL__N_115choose_encodingENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
  120|  68.1k|ASN1_Type choose_encoding(std::string_view str) {
  121|  68.1k|   if(g_char_validator.valid_encoding(str, ASN1_Type::PrintableString)) {
  ------------------
  |  Branch (121:7): [True: 68.1k, False: 0]
  ------------------
  122|  68.1k|      return ASN1_Type::PrintableString;
  123|  68.1k|   } else {
  124|      0|      return ASN1_Type::Utf8String;
  125|      0|   }
  126|  68.1k|}

_ZN5Botan11BER_DecoderD2Ev:
  456|  90.6k|BER_Decoder::~BER_Decoder() = default;
_ZNK5Botan11BER_Decoder10more_itemsEv:
  461|  96.1k|bool BER_Decoder::more_items() const {
  462|  96.1k|   if(m_source->end_of_data() && !m_pushed.is_set()) {
  ------------------
  |  Branch (462:7): [True: 14.7k, False: 81.3k]
  |  Branch (462:34): [True: 14.7k, False: 0]
  ------------------
  463|  14.7k|      return false;
  464|  14.7k|   }
  465|  81.3k|   return true;
  466|  96.1k|}
_ZN5Botan11BER_Decoder10read_bytesENSt3__14spanIhLm18446744073709551615EEE:
  505|  24.0k|size_t BER_Decoder::read_bytes(std::span<uint8_t> out) {
  506|  24.0k|   BOTAN_ASSERT_NOMSG(m_source != nullptr);
  ------------------
  |  |   84|  24.0k|   do {                                                                     \
  |  |   85|  24.0k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|  24.0k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 24.0k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|  24.0k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 24.0k]
  |  |  ------------------
  ------------------
  507|  24.0k|   return m_source->read(out.data(), out.size());
  508|  24.0k|}
_ZN5Botan11BER_Decoder15get_next_objectEv:
  521|   222k|BER_Object BER_Decoder::get_next_object() {
  522|   222k|   BER_Object next;
  523|       |
  524|   222k|   if(m_pushed.is_set()) {
  ------------------
  |  Branch (524:7): [True: 0, False: 222k]
  ------------------
  525|      0|      std::swap(next, m_pushed);
  526|      0|      return next;
  527|      0|   }
  528|       |
  529|   222k|   for(;;) {
  530|   222k|      ASN1_Type type_tag = ASN1_Type::NoObject;
  531|   222k|      ASN1_Class class_tag = ASN1_Class::NoObject;
  532|   222k|      decode_tag(m_source, type_tag, class_tag);
  533|   222k|      next.set_tagging(type_tag, class_tag);
  534|   222k|      if(next.is_set() == false) {  // no more objects
  ------------------
  |  Branch (534:10): [True: 1.45k, False: 221k]
  ------------------
  535|  1.45k|         return next;
  536|  1.45k|      }
  537|       |
  538|   221k|      const size_t allow_indef = m_limits.allow_ber_encoding() ? m_limits.max_nested_indefinite_length() : 0;
  ------------------
  |  Branch (538:34): [True: 221k, False: 37]
  ------------------
  539|   221k|      const bool der_mode = m_limits.require_der_encoding();
  540|   221k|      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|   221k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal &&
  ------------------
  |  Branch (545:10): [True: 151, False: 221k]
  |  Branch (545:40): [True: 125, False: 26]
  ------------------
  546|    125|         (dl.content_length() != 0 || dl.indefinite_length())) {
  ------------------
  |  Branch (546:11): [True: 61, False: 64]
  |  Branch (546:39): [True: 0, False: 64]
  ------------------
  547|     61|         throw BER_Decoding_Error("EOC marker with non-zero length");
  548|     61|      }
  549|       |
  550|   221k|      if(const auto max_size = m_limits.max_object_size(); max_size && dl.content_length() > *max_size) {
  ------------------
  |  Branch (550:60): [True: 220k, False: 674]
  |  Branch (550:72): [True: 36, False: 220k]
  ------------------
  551|     36|         throw BER_Decoding_Error("Encoded object exceeds maximum size");
  552|     36|      }
  553|       |
  554|   221k|      if(!m_source->check_available(dl.total_length())) {
  ------------------
  |  Branch (554:10): [True: 127, False: 220k]
  ------------------
  555|    127|         throw BER_Decoding_Error("Value truncated");
  556|    127|      }
  557|       |
  558|   220k|      uint8_t* out = next.mutable_bits(dl.content_length());
  559|   220k|      if(m_source->read(out, dl.content_length()) != dl.content_length()) {
  ------------------
  |  Branch (559:10): [True: 0, False: 220k]
  ------------------
  560|      0|         throw BER_Decoding_Error("Value truncated");
  561|      0|      }
  562|       |
  563|   220k|      if(dl.indefinite_length()) {
  ------------------
  |  Branch (563:10): [True: 65.3k, False: 155k]
  ------------------
  564|       |         // After reading the data consume the 2-byte EOC
  565|  65.3k|         uint8_t eoc[2] = {0xFF, 0xFF};
  566|  65.3k|         if(m_source->read(eoc, 2) != 2 || eoc[0] != 0x00 || eoc[1] != 0x00) {
  ------------------
  |  Branch (566:13): [True: 0, False: 65.3k]
  |  Branch (566:44): [True: 0, False: 65.3k]
  |  Branch (566:62): [True: 0, False: 65.3k]
  ------------------
  567|      0|            throw BER_Decoding_Error("Missing or malformed EOC marker");
  568|      0|         }
  569|  65.3k|      }
  570|       |
  571|   220k|      if(next.tagging() == static_cast<uint32_t>(ASN1_Type::Eoc)) {
  ------------------
  |  Branch (571:10): [True: 64, False: 220k]
  ------------------
  572|     64|         if(m_limits.require_der_encoding()) {
  ------------------
  |  Branch (572:13): [True: 0, False: 64]
  ------------------
  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|     64|         if(m_limits.allow_standalone_eoc()) {
  ------------------
  |  Branch (578:13): [True: 0, False: 64]
  ------------------
  579|      0|            continue;
  580|      0|         }
  581|     64|         throw BER_Decoding_Error("Encountered EOC marker outside of indefinite-length encoding");
  582|     64|      }
  583|       |
  584|   220k|      break;
  585|   220k|   }
  586|       |
  587|   220k|   return next;
  588|   222k|}
_ZN5Botan11BER_Decoder10start_consENS_9ASN1_TypeENS_10ASN1_ClassE:
  619|  86.8k|BER_Decoder BER_Decoder::start_cons(ASN1_Type type_tag, ASN1_Class class_tag) {
  620|  86.8k|   BER_Object obj = get_next_object();
  621|  86.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|  86.8k|   if(m_limits.require_der_encoding() && type_tag == ASN1_Type::Set && class_tag == ASN1_Class::Universal) {
  ------------------
  |  Branch (624:7): [True: 0, False: 86.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|  86.8k|   BER_Decoder child(std::move(obj), this);
  629|  86.8k|   return child;
  630|  86.8k|}
_ZN5Botan11BER_Decoder8end_consEv:
  635|  70.5k|BER_Decoder& BER_Decoder::end_cons() {
  636|  70.5k|   if(m_parent == nullptr) {
  ------------------
  |  Branch (636:7): [True: 0, False: 70.5k]
  ------------------
  637|      0|      throw Invalid_State("BER_Decoder::end_cons called with null parent");
  638|      0|   }
  639|  70.5k|   if(!m_source->end_of_data() || m_pushed.is_set()) {
  ------------------
  |  Branch (639:7): [True: 18, False: 70.4k]
  |  Branch (639:35): [True: 0, False: 70.4k]
  ------------------
  640|     18|      throw Decoding_Error("BER_Decoder::end_cons called with data left");
  641|     18|   }
  642|  70.4k|   return (*m_parent);
  643|  70.5k|}
_ZN5Botan11BER_DecoderC2EONS_10BER_ObjectEPS0_:
  646|  84.2k|      m_limits(parent != nullptr ? parent->limits() : BER_Decoder::Limits::BER()), m_parent(parent) {
  ------------------
  |  Branch (646:16): [True: 84.2k, False: 0]
  ------------------
  647|  84.2k|   m_data_src = std::make_unique<DataSource_BERObject>(std::move(obj));
  648|  84.2k|   m_source = m_data_src.get();
  649|  84.2k|}
_ZN5Botan11BER_DecoderC2ENSt3__14spanIKhLm18446744073709551615EEENS0_6LimitsE:
  664|  6.37k|BER_Decoder::BER_Decoder(std::span<const uint8_t> buf, Limits limits) : m_limits(limits) {
  665|  6.37k|   m_data_src = std::make_unique<DataSource_Memory>(buf);
  666|  6.37k|   m_source = m_data_src.get();
  667|  6.37k|}
_ZN5Botan11BER_Decoder6decodeERNS_11ASN1_ObjectENS_9ASN1_TypeENS_10ASN1_ClassE:
  676|   135k|BER_Decoder& BER_Decoder::decode(ASN1_Object& obj, ASN1_Type type_tag, ASN1_Class class_tag) {
  677|       |   // TODO support this case properly
  678|   135k|   if(type_tag != ASN1_Type::NoObject || class_tag != ASN1_Class::NoObject) {
  ------------------
  |  Branch (678:7): [True: 0, False: 135k]
  |  Branch (678:42): [True: 0, False: 135k]
  ------------------
  679|      0|      throw Not_Implemented("BER_Decoder::decode(ASN1_Object) does not support implicit tagged decoding");
  680|      0|   }
  681|   135k|   obj.decode_from(*this);
  682|   135k|   return (*this);
  683|   135k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_110decode_tagEPNS_10DataSourceERNS_9ASN1_TypeERNS_10ASN1_ClassE:
   29|   222k|size_t decode_tag(DataSource* ber, ASN1_Type& type_tag, ASN1_Class& class_tag) {
   30|   222k|   auto b = ber->read_byte();
   31|       |
   32|   222k|   if(!b) {
  ------------------
  |  Branch (32:7): [True: 1.45k, False: 221k]
  ------------------
   33|  1.45k|      type_tag = ASN1_Type::NoObject;
   34|  1.45k|      class_tag = ASN1_Class::NoObject;
   35|  1.45k|      return 0;
   36|  1.45k|   }
   37|       |
   38|   221k|   if((*b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (38:7): [True: 220k, False: 404]
  ------------------
   39|   220k|      type_tag = ASN1_Type(*b & 0x1F);
   40|   220k|      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|   220k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (44:10): [True: 202, False: 220k]
  |  Branch (44:40): [True: 2, False: 200]
  ------------------
   45|      2|         throw BER_Decoding_Error("EOC tag with constructed encoding");
   46|      2|      }
   47|   220k|      return 1;
   48|   220k|   }
   49|       |
   50|    404|   size_t tag_bytes = 1;
   51|    404|   class_tag = ASN1_Class(*b & 0xE0);
   52|       |
   53|    404|   uint32_t tag_buf = 0;
   54|  1.47k|   while(true) {
  ------------------
  |  Branch (54:10): [True: 1.47k, Folded]
  ------------------
   55|  1.47k|      b = ber->read_byte();
   56|  1.47k|      if(!b) {
  ------------------
  |  Branch (56:10): [True: 13, False: 1.46k]
  ------------------
   57|     13|         throw BER_Decoding_Error("Long-form tag truncated");
   58|     13|      }
   59|       |      // Reject if shifting in another 7 bits would overflow the uint32_t tag
   60|  1.46k|      if((tag_buf >> 25) != 0) {
  ------------------
  |  Branch (60:10): [True: 13, False: 1.45k]
  ------------------
   61|     13|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
   62|     13|      }
   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.45k|      if(tag_bytes == 1 && (*b & 0x7F) == 0) {
  ------------------
  |  Branch (67:10): [True: 399, False: 1.05k]
  |  Branch (67:28): [True: 2, False: 397]
  ------------------
   68|      2|         throw BER_Decoding_Error("Long form tag with leading zero");
   69|      2|      }
   70|  1.45k|      ++tag_bytes;
   71|  1.45k|      tag_buf = (tag_buf << 7) | (*b & 0x7F);
   72|  1.45k|      if((*b & 0x80) == 0) {
  ------------------
  |  Branch (72:10): [True: 376, False: 1.07k]
  ------------------
   73|    376|         break;
   74|    376|      }
   75|  1.45k|   }
   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|    376|   if(tag_buf <= 30) {
  ------------------
  |  Branch (79:7): [True: 6, False: 370]
  ------------------
   80|      6|      throw BER_Decoding_Error("Long-form tag encoding used for small tag value");
   81|      6|   }
   82|       |
   83|    370|   if(tag_buf == static_cast<uint32_t>(ASN1_Type::NoObject)) {
  ------------------
  |  Branch (83:7): [True: 1, False: 369]
  ------------------
   84|      1|      throw BER_Decoding_Error("Tag value collides with internal sentinel");
   85|      1|   }
   86|       |
   87|       |   // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
   88|    369|   type_tag = ASN1_Type(tag_buf);
   89|    369|   return tag_bytes;
   90|    370|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_113decode_lengthEPNS_10DataSourceEmbb:
  135|   221k|BerDecodedLength decode_length(DataSource* ber, size_t allow_indef, bool der_mode, bool constructed) {
  136|   221k|   uint8_t b = 0;
  137|   221k|   if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (137:7): [True: 209, False: 220k]
  ------------------
  138|    209|      throw BER_Decoding_Error("Length field not found");
  139|    209|   }
  140|   220k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (140:7): [True: 154k, False: 66.8k]
  ------------------
  141|   154k|      return BerDecodedLength(b, 1);
  142|   154k|   }
  143|       |
  144|  66.8k|   const size_t num_length_bytes = (b & 0x7F);
  145|  66.8k|   if(num_length_bytes > 4) {
  ------------------
  |  Branch (145:7): [True: 16, False: 66.8k]
  ------------------
  146|     16|      throw BER_Decoding_Error("Length field is too large");
  147|     16|   }
  148|       |
  149|  66.8k|   const size_t field_size = 1 + num_length_bytes;
  150|       |
  151|  66.8k|   if(num_length_bytes == 0) {
  ------------------
  |  Branch (151:7): [True: 65.7k, False: 1.15k]
  ------------------
  152|  65.7k|      if(der_mode) {
  ------------------
  |  Branch (152:10): [True: 0, False: 65.7k]
  ------------------
  153|      0|         throw BER_Decoding_Error("Detected indefinite-length encoding in DER structure");
  154|  65.7k|      } else if(!constructed) {
  ------------------
  |  Branch (154:17): [True: 3, False: 65.6k]
  ------------------
  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|  65.6k|      } else if(allow_indef == 0) {
  ------------------
  |  Branch (157:17): [True: 0, False: 65.6k]
  ------------------
  158|      0|         throw BER_Decoding_Error("Nested EOC markers too deep, rejecting to avoid stack exhaustion");
  159|  65.6k|      } 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|  65.6k|         const size_t eoc_len = find_eoc(ber, /*base_offset=*/0, allow_indef - 1);
  163|  65.6k|         if(eoc_len < 2) {
  ------------------
  |  Branch (163:13): [True: 0, False: 65.6k]
  ------------------
  164|      0|            throw BER_Decoding_Error("Invalid EOC encoding");
  165|      0|         }
  166|  65.6k|         return BerDecodedLength::indefinite(eoc_len - 2, field_size);
  167|  65.6k|      }
  168|  65.7k|   }
  169|       |
  170|  1.15k|   size_t length = 0;
  171|       |
  172|  4.89k|   for(size_t i = 0; i != num_length_bytes; ++i) {
  ------------------
  |  Branch (172:22): [True: 3.75k, False: 1.14k]
  ------------------
  173|  3.75k|      if(ber->read_byte(b) == 0) {
  ------------------
  |  Branch (173:10): [True: 14, False: 3.74k]
  ------------------
  174|     14|         throw BER_Decoding_Error("Corrupted length field");
  175|     14|      }
  176|       |      // Can't overflow since we already checked that num_length_bytes <= 4
  177|  3.74k|      length = (length << 8) | b;
  178|  3.74k|   }
  179|       |
  180|       |   // DER requires shortest possible length encoding
  181|  1.14k|   if(der_mode) {
  ------------------
  |  Branch (181:7): [True: 0, False: 1.14k]
  ------------------
  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.14k|   return BerDecodedLength(length, field_size);
  191|  1.14k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emm:
  108|   155k|            BerDecodedLength(content_length, field_length, false) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLengthC2Emmb:
  125|   220k|            m_content_length(content_length), m_field_length(field_length), m_indefinite(indefinite) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_18find_eocEPNS_10DataSourceEmm:
  314|   182k|size_t find_eoc(DataSource* src, size_t base_offset, size_t allow_indef) {
  315|   182k|   size_t offset = base_offset;
  316|       |
  317|   646k|   while(true) {
  ------------------
  |  Branch (317:10): [True: 646k, Folded]
  ------------------
  318|   646k|      ASN1_Type type_tag = ASN1_Type::NoObject;
  319|   646k|      ASN1_Class class_tag = ASN1_Class::NoObject;
  320|   646k|      const size_t tag_size = peek_tag(src, offset, type_tag, class_tag);
  321|   646k|      if(type_tag == ASN1_Type::NoObject) {
  ------------------
  |  Branch (321:10): [True: 208, False: 646k]
  ------------------
  322|    208|         throw BER_Decoding_Error("Missing EOC marker in indefinite-length encoding");
  323|    208|      }
  324|       |
  325|   646k|      size_t length_size = 0;
  326|   646k|      const size_t item_size =
  327|   646k|         peek_length(src, offset + tag_size, length_size, allow_indef, is_constructed(class_tag), false);
  328|       |
  329|   646k|      if(auto new_offset = checked_add(offset, tag_size, length_size, item_size)) {
  ------------------
  |  Branch (329:15): [True: 646k, False: 343]
  ------------------
  330|   646k|         offset = new_offset.value();
  331|   646k|      } else {
  332|    343|         throw Decoding_Error("Integer overflow while scanning for EOC");
  333|    343|      }
  334|       |
  335|   646k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Universal) {
  ------------------
  |  Branch (335:10): [True: 182k, False: 463k]
  |  Branch (335:40): [True: 182k, False: 405]
  ------------------
  336|       |         // Per X.690 8.1.5 the EOC marker is exactly two zero octets
  337|   182k|         if(length_size != 1 || item_size != 0) {
  ------------------
  |  Branch (337:13): [True: 4, False: 182k]
  |  Branch (337:33): [True: 14, False: 182k]
  ------------------
  338|     18|            throw BER_Decoding_Error("EOC marker with non-zero length");
  339|     18|         }
  340|   182k|         break;
  341|   182k|      }
  342|   646k|   }
  343|       |
  344|   182k|   return offset - base_offset;
  345|   182k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_18peek_tagEPNS_10DataSourceEmRNS_9ASN1_TypeERNS_10ASN1_ClassE:
  197|   646k|size_t peek_tag(DataSource* src, size_t offset, ASN1_Type& type_tag, ASN1_Class& class_tag) {
  198|   646k|   uint8_t b = 0;
  199|   646k|   if(src->peek(&b, 1, offset) == 0) {
  ------------------
  |  Branch (199:7): [True: 208, False: 646k]
  ------------------
  200|    208|      type_tag = ASN1_Type::NoObject;
  201|    208|      class_tag = ASN1_Class::NoObject;
  202|    208|      return 0;
  203|    208|   }
  204|       |
  205|   646k|   if((b & 0x1F) != 0x1F) {
  ------------------
  |  Branch (205:7): [True: 645k, False: 834]
  ------------------
  206|   645k|      type_tag = ASN1_Type(b & 0x1F);
  207|   645k|      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|   645k|      if(type_tag == ASN1_Type::Eoc && class_tag == ASN1_Class::Constructed) {
  ------------------
  |  Branch (211:10): [True: 182k, False: 463k]
  |  Branch (211:40): [True: 1, False: 182k]
  ------------------
  212|      1|         throw BER_Decoding_Error("EOC tag with constructed encoding");
  213|      1|      }
  214|   645k|      return 1;
  215|   645k|   }
  216|       |
  217|    834|   class_tag = ASN1_Class(b & 0xE0);
  218|    834|   size_t tag_bytes = 1;
  219|    834|   uint32_t tag_buf = 0;
  220|       |
  221|  1.98k|   while(true) {
  ------------------
  |  Branch (221:10): [True: 1.98k, Folded]
  ------------------
  222|  1.98k|      if(src->peek(&b, 1, offset + tag_bytes) == 0) {
  ------------------
  |  Branch (222:10): [True: 12, False: 1.97k]
  ------------------
  223|     12|         throw BER_Decoding_Error("Long-form tag truncated");
  224|     12|      }
  225|       |      // Reject if shifting in another 7 bits would overflow the uint32_t tag
  226|  1.97k|      if((tag_buf >> 25) != 0) {
  ------------------
  |  Branch (226:10): [True: 3, False: 1.96k]
  ------------------
  227|      3|         throw BER_Decoding_Error("Long-form tag overflowed 32 bits");
  228|      3|      }
  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.96k|      if(tag_bytes == 1 && (b & 0x7F) == 0) {
  ------------------
  |  Branch (233:10): [True: 829, False: 1.14k]
  |  Branch (233:28): [True: 2, False: 827]
  ------------------
  234|      2|         throw BER_Decoding_Error("Long form tag with leading zero");
  235|      2|      }
  236|  1.96k|      ++tag_bytes;
  237|  1.96k|      tag_buf = (tag_buf << 7) | (b & 0x7F);
  238|  1.96k|      if((b & 0x80) == 0) {
  ------------------
  |  Branch (238:10): [True: 817, False: 1.15k]
  ------------------
  239|    817|         break;
  240|    817|      }
  241|  1.96k|   }
  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|    817|   if(tag_buf <= 30) {
  ------------------
  |  Branch (246:7): [True: 7, False: 810]
  ------------------
  247|      7|      throw BER_Decoding_Error("Long-form tag encoding used for small tag value");
  248|      7|   }
  249|       |
  250|    810|   if(tag_buf == static_cast<uint32_t>(ASN1_Type::NoObject)) {
  ------------------
  |  Branch (250:7): [True: 1, False: 809]
  ------------------
  251|      1|      throw BER_Decoding_Error("Tag value collides with internal sentinel");
  252|      1|   }
  253|       |
  254|       |   // NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange)
  255|    809|   type_tag = ASN1_Type(tag_buf);
  256|    809|   return tag_bytes;
  257|    810|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_111peek_lengthEPNS_10DataSourceEmRmmbb:
  265|   646k|   DataSource* src, size_t offset, size_t& field_size, size_t allow_indef, bool constructed, bool der_mode) {
  266|   646k|   uint8_t b = 0;
  267|   646k|   if(src->peek(&b, 1, offset) == 0) {
  ------------------
  |  Branch (267:7): [True: 119, False: 646k]
  ------------------
  268|    119|      throw BER_Decoding_Error("Length field not found");
  269|    119|   }
  270|       |
  271|   646k|   field_size = 1;
  272|   646k|   if((b & 0x80) == 0) {
  ------------------
  |  Branch (272:7): [True: 526k, False: 120k]
  ------------------
  273|   526k|      return b;
  274|   526k|   }
  275|       |
  276|   120k|   const size_t num_length_bytes = (b & 0x7F);
  277|   120k|   field_size += num_length_bytes;
  278|   120k|   if(field_size > 5) {
  ------------------
  |  Branch (278:7): [True: 12, False: 120k]
  ------------------
  279|     12|      throw BER_Decoding_Error("Length field is too large");
  280|     12|   }
  281|       |
  282|   120k|   if(num_length_bytes == 0) {
  ------------------
  |  Branch (282:7): [True: 117k, False: 3.19k]
  ------------------
  283|       |      // Indefinite length is not allowed in DER
  284|   117k|      if(der_mode) {
  ------------------
  |  Branch (284:10): [True: 0, False: 117k]
  ------------------
  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|   117k|      if(!constructed) {
  ------------------
  |  Branch (288:10): [True: 3, False: 117k]
  ------------------
  289|      3|         throw BER_Decoding_Error("Indefinite-length encoding used with non-constructed type");
  290|      3|      }
  291|   117k|      if(allow_indef == 0) {
  ------------------
  |  Branch (291:10): [True: 1, False: 117k]
  ------------------
  292|      1|         throw BER_Decoding_Error("Nested EOC markers too deep, rejecting to avoid stack exhaustion");
  293|      1|      }
  294|   117k|      return find_eoc(src, offset + 1, allow_indef - 1);
  295|   117k|   }
  296|       |
  297|  3.19k|   size_t length = 0;
  298|  13.2k|   for(size_t i = 0; i < num_length_bytes; ++i) {
  ------------------
  |  Branch (298:22): [True: 10.0k, False: 3.18k]
  ------------------
  299|  10.0k|      if(src->peek(&b, 1, offset + 1 + i) == 0) {
  ------------------
  |  Branch (299:10): [True: 8, False: 10.0k]
  ------------------
  300|      8|         throw BER_Decoding_Error("Corrupted length field");
  301|      8|      }
  302|  10.0k|      if(get_byte<0>(length) != 0) {
  ------------------
  |  Branch (302:10): [True: 0, False: 10.0k]
  ------------------
  303|      0|         throw BER_Decoding_Error("Field length overflow");
  304|      0|      }
  305|  10.0k|      length = (length << 8) | b;
  306|  10.0k|   }
  307|  3.18k|   return length;
  308|  3.19k|}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_116BerDecodedLength10indefiniteEmm:
  110|  65.3k|      static BerDecodedLength indefinite(size_t content_length, size_t field_length) {
  111|  65.3k|         return BerDecodedLength(content_length, field_length, true);
  112|  65.3k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_114is_constructedENS_10ASN1_ClassE:
   22|   867k|bool is_constructed(ASN1_Class class_tag) {
   23|   867k|   return (static_cast<uint32_t>(class_tag) & static_cast<uint32_t>(ASN1_Class::Constructed)) != 0;
   24|   867k|}
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength14content_lengthEv:
  114|   881k|      size_t content_length() const { return m_content_length; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength17indefinite_lengthEv:
  121|   220k|      bool indefinite_length() const { return m_indefinite; }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_116BerDecodedLength12total_lengthEv:
  117|   220k|      size_t total_length() const { return m_indefinite ? m_content_length + 2 : m_content_length; }
  ------------------
  |  Branch (117:44): [True: 65.3k, False: 155k]
  ------------------
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObjectC2EONS_10BER_ObjectE:
  379|  84.2k|      explicit DataSource_BERObject(BER_Object&& obj) : m_obj(std::move(obj)) {}
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject4readEPhm:
  349|   691k|      size_t read(uint8_t out[], size_t length) override {
  350|   691k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   84|   691k|   do {                                                                     \
  |  |   85|   691k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   691k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 691k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   691k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 691k]
  |  |  ------------------
  ------------------
  351|   691k|         const size_t got = std::min<size_t>(m_obj.length() - m_offset, length);
  352|   691k|         copy_mem(out, m_obj.bits() + m_offset, got);
  353|   691k|         m_offset += got;
  354|   691k|         return got;
  355|   691k|      }
ber_dec.cpp:_ZN5Botan12_GLOBAL__N_120DataSource_BERObject15check_availableEm:
  370|   203k|      bool check_available(size_t n) override {
  371|   203k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   84|   203k|   do {                                                                     \
  |  |   85|   203k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   203k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 203k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   203k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 203k]
  |  |  ------------------
  ------------------
  372|   203k|         return (n <= (m_obj.length() - m_offset));
  373|   203k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject4peekEPhmm:
  357|   317k|      size_t peek(uint8_t out[], size_t length, size_t peek_offset) const override {
  358|   317k|         BOTAN_ASSERT_NOMSG(m_offset <= m_obj.length());
  ------------------
  |  |   84|   317k|   do {                                                                     \
  |  |   85|   317k|      /* NOLINTNEXTLINE(*-simplify-boolean-expr) */                         \
  |  |   86|   317k|      if(!(expr)) {                                                         \
  |  |  ------------------
  |  |  |  Branch (86:10): [True: 0, False: 317k]
  |  |  ------------------
  |  |   87|      0|         /* NOLINTNEXTLINE(bugprone-lambda-function-name) */                \
  |  |   88|      0|         Botan::assertion_failure(#expr, "", __func__, __FILE__, __LINE__); \
  |  |   89|      0|      }                                                                     \
  |  |   90|   317k|   } while(0)
  |  |  ------------------
  |  |  |  Branch (90:12): [Folded, False: 317k]
  |  |  ------------------
  ------------------
  359|   317k|         const size_t bytes_left = m_obj.length() - m_offset;
  360|       |
  361|   317k|         if(peek_offset >= bytes_left) {
  ------------------
  |  Branch (361:13): [True: 63, False: 317k]
  ------------------
  362|     63|            return 0;
  363|     63|         }
  364|       |
  365|   317k|         const size_t got = std::min(bytes_left - peek_offset, length);
  366|   317k|         copy_mem(out, m_obj.bits() + m_offset + peek_offset, got);
  367|   317k|         return got;
  368|   317k|      }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject11end_of_dataEv:
  375|   151k|      bool end_of_data() const override { return get_bytes_read() == m_obj.length(); }
ber_dec.cpp:_ZNK5Botan12_GLOBAL__N_120DataSource_BERObject14get_bytes_readEv:
  377|   151k|      size_t get_bytes_read() const override { return m_offset; }

_ZN5Botan11DER_EncoderC2ERNSt3__16vectorIhNS1_9allocatorIhEEEE:
   89|  64.2k|DER_Encoder::DER_Encoder(std::vector<uint8_t>& vec) {
   90|  64.2k|   m_append_output = [&vec](const uint8_t b[], size_t l) {
   91|  64.2k|      if(l > 0) {
   92|  64.2k|         vec.insert(vec.end(), b, b + l);
   93|  64.2k|      }
   94|  64.2k|   };
   95|  64.2k|}
_ZN5Botan11DER_Encoder10add_objectENS_9ASN1_TypeENS_10ASN1_ClassEPKhm:
  285|  64.2k|DER_Encoder& DER_Encoder::add_object(ASN1_Type type_tag, ASN1_Class class_tag, const uint8_t rep[], size_t length) {
  286|  64.2k|   std::vector<uint8_t> hdr;
  287|  64.2k|   encode_tag(hdr, type_tag, class_tag);
  288|  64.2k|   encode_length(hdr, length);
  289|       |
  290|  64.2k|   if(!m_subsequences.empty()) {
  ------------------
  |  Branch (290:7): [True: 0, False: 64.2k]
  ------------------
  291|      0|      m_subsequences[m_subsequences.size() - 1].add_bytes(hdr.data(), hdr.size(), rep, length);
  292|  64.2k|   } else if(m_append_output) {
  ------------------
  |  Branch (292:14): [True: 64.2k, False: 0]
  ------------------
  293|  64.2k|      m_append_output(hdr.data(), hdr.size());
  294|  64.2k|      m_append_output(rep, length);
  295|  64.2k|   } else {
  296|      0|      m_default_outbuf += hdr;
  297|      0|      m_default_outbuf += std::make_pair(rep, length);
  298|      0|   }
  299|       |
  300|  64.2k|   return (*this);
  301|  64.2k|}
der_enc.cpp:_ZN5Botan12_GLOBAL__N_110encode_tagERNSt3__16vectorIhNS1_9allocatorIhEEEENS_9ASN1_TypeENS_10ASN1_ClassE:
   26|  64.2k|void encode_tag(std::vector<uint8_t>& encoded_tag, ASN1_Type type_tag_e, ASN1_Class class_tag_e) {
   27|  64.2k|   const uint32_t type_tag = static_cast<uint32_t>(type_tag_e);
   28|  64.2k|   const uint32_t class_tag = static_cast<uint32_t>(class_tag_e);
   29|       |
   30|  64.2k|   if((class_tag | 0xE0) != 0xE0) {
  ------------------
  |  Branch (30:7): [True: 0, False: 64.2k]
  ------------------
   31|      0|      throw Encoding_Error(fmt("DER_Encoder: Invalid class tag {}", std::to_string(class_tag)));
   32|      0|   }
   33|       |
   34|  64.2k|   if(type_tag <= 30) {
  ------------------
  |  Branch (34:7): [True: 64.2k, False: 0]
  ------------------
   35|  64.2k|      encoded_tag.push_back(static_cast<uint8_t>(type_tag | class_tag));
   36|  64.2k|   } 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|  64.2k|}
der_enc.cpp:_ZN5Botan12_GLOBAL__N_113encode_lengthERNSt3__16vectorIhNS1_9allocatorIhEEEEm:
   53|  64.2k|void encode_length(std::vector<uint8_t>& encoded_length, size_t length) {
   54|  64.2k|   if(length <= 127) {
  ------------------
  |  Branch (54:7): [True: 64.1k, False: 155]
  ------------------
   55|  64.1k|      encoded_length.push_back(static_cast<uint8_t>(length));
   56|  64.1k|   } else {
   57|    155|      const size_t bytes_needed = significant_bytes(length);
   58|       |
   59|    155|      encoded_length.push_back(static_cast<uint8_t>(0x80 | bytes_needed));
   60|       |
   61|    389|      for(size_t i = sizeof(length) - bytes_needed; i < sizeof(length); ++i) {
  ------------------
  |  Branch (61:53): [True: 234, False: 155]
  ------------------
   62|    234|         encoded_length.push_back(get_byte_var(i, length));
   63|    234|      }
   64|    155|   }
   65|  64.2k|}
der_enc.cpp:_ZZN5Botan11DER_EncoderC1ERNSt3__16vectorIhNS1_9allocatorIhEEEEENK3$_0clEPKhm:
   90|   128k|   m_append_output = [&vec](const uint8_t b[], size_t l) {
   91|   128k|      if(l > 0) {
  ------------------
  |  Branch (91:10): [True: 128k, False: 0]
  ------------------
   92|   128k|         vec.insert(vec.end(), b, b + l);
   93|   128k|      }
   94|   128k|   };

_ZN5Botan15allocate_memoryEmm:
   21|  6.19k|BOTAN_MALLOC_FN void* allocate_memory(size_t elems, size_t elem_size) {
   22|  6.19k|   if(elems == 0 || elem_size == 0) {
  ------------------
  |  Branch (22:7): [True: 0, False: 6.19k]
  |  Branch (22:21): [True: 0, False: 6.19k]
  ------------------
   23|      0|      return nullptr;
   24|      0|   }
   25|       |
   26|       |   // Some calloc implementations do not check for overflow (?!?)
   27|  6.19k|   if(!checked_mul(elems, elem_size).has_value()) {
  ------------------
  |  Branch (27:7): [True: 0, False: 6.19k]
  ------------------
   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|  6.19k|   void* ptr = std::calloc(elems, elem_size);  // NOLINT(*-no-malloc,*-owning-memory)
   43|  6.19k|#endif
   44|  6.19k|   if(ptr == nullptr) {
  ------------------
  |  Branch (44:7): [True: 0, False: 6.19k]
  ------------------
   45|      0|      [[unlikely]] throw std::bad_alloc();
   46|      0|   }
   47|  6.19k|   return ptr;
   48|  6.19k|}
_ZN5Botan17deallocate_memoryEPvmm:
   50|  6.19k|void deallocate_memory(void* p, size_t elems, size_t elem_size) {
   51|  6.19k|   if(p == nullptr) {
  ------------------
  |  Branch (51:7): [True: 0, False: 6.19k]
  ------------------
   52|      0|      [[unlikely]] return;
   53|      0|   }
   54|       |
   55|  6.19k|   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|  6.19k|   std::free(p);  // NOLINT(*-no-malloc,*-owning-memory)
   64|  6.19k|}

_ZN5Botan19next_utf8_codepointENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERm:
   53|  22.6k|uint32_t next_utf8_codepoint(std::string_view utf8, size_t& pos) {
   54|  22.6k|   auto read_continuation = [&]() -> uint32_t {
   55|  22.6k|      if(pos >= utf8.size()) {
   56|  22.6k|         throw Decoding_Error("Invalid UTF-8 sequence");
   57|  22.6k|      }
   58|  22.6k|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   59|  22.6k|      if((b & 0xC0) != 0x80) {
   60|  22.6k|         throw Decoding_Error("Invalid UTF-8 sequence");
   61|  22.6k|      }
   62|  22.6k|      return b & 0x3F;
   63|  22.6k|   };
   64|       |
   65|  22.6k|   if(pos >= utf8.size()) {
  ------------------
  |  Branch (65:7): [True: 0, False: 22.6k]
  ------------------
   66|      0|      throw Decoding_Error("Invalid UTF-8 sequence");
   67|      0|   }
   68|  22.6k|   const uint8_t lead = static_cast<uint8_t>(utf8[pos++]);
   69|  22.6k|   uint32_t c = 0;
   70|       |
   71|  22.6k|   if(lead <= 0x7F) {
  ------------------
  |  Branch (71:7): [True: 20.2k, False: 2.41k]
  ------------------
   72|  20.2k|      c = lead;
   73|  20.2k|   } else if((lead & 0xE0) == 0xC0) {
  ------------------
  |  Branch (73:14): [True: 1.42k, False: 987]
  ------------------
   74|  1.42k|      c = (lead & 0x1F) << 6;
   75|  1.42k|      c |= read_continuation();
   76|  1.42k|      if(c < 0x80) {
  ------------------
  |  Branch (76:10): [True: 4, False: 1.41k]
  ------------------
   77|      4|         throw Decoding_Error("Overlong UTF-8 sequence");
   78|      4|      }
   79|  1.42k|   } else if((lead & 0xF0) == 0xE0) {
  ------------------
  |  Branch (79:14): [True: 632, False: 355]
  ------------------
   80|    632|      c = (lead & 0x0F) << 12;
   81|    632|      c |= read_continuation() << 6;
   82|    632|      c |= read_continuation();
   83|    632|      if(c < 0x800) {
  ------------------
  |  Branch (83:10): [True: 6, False: 626]
  ------------------
   84|      6|         throw Decoding_Error("Overlong UTF-8 sequence");
   85|      6|      }
   86|    632|   } else if((lead & 0xF8) == 0xF0) {
  ------------------
  |  Branch (86:14): [True: 340, False: 15]
  ------------------
   87|    340|      c = (lead & 0x07) << 18;
   88|    340|      c |= read_continuation() << 12;
   89|    340|      c |= read_continuation() << 6;
   90|    340|      c |= read_continuation();
   91|    340|      if(c < 0x10000) {
  ------------------
  |  Branch (91:10): [True: 6, False: 334]
  ------------------
   92|      6|         throw Decoding_Error("Overlong UTF-8 sequence");
   93|      6|      }
   94|    340|   } else {
   95|     15|      throw Decoding_Error("Invalid UTF-8 sequence");
   96|     15|   }
   97|       |
   98|  22.5k|   if(c > 0x10FFFF) {
  ------------------
  |  Branch (98:7): [True: 7, False: 22.5k]
  ------------------
   99|      7|      throw Decoding_Error("UTF-8 sequence encodes value outside Unicode range");
  100|      7|   }
  101|  22.5k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (101:7): [True: 868, False: 21.7k]
  |  Branch (101:22): [True: 19, False: 849]
  ------------------
  102|     19|      throw Decoding_Error("UTF-8 sequence encodes surrogate code point");
  103|     19|   }
  104|       |
  105|  22.5k|   return c;
  106|  22.5k|}
_ZN5Botan13is_valid_utf8ENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  108|  4.17k|bool is_valid_utf8(std::string_view utf8) {
  109|  4.17k|   try {
  110|  4.17k|      size_t pos = 0;
  111|  26.8k|      while(pos < utf8.size()) {
  ------------------
  |  Branch (111:13): [True: 22.6k, False: 4.17k]
  ------------------
  112|  22.6k|         const uint32_t c = next_utf8_codepoint(utf8, pos);
  113|  22.6k|         BOTAN_UNUSED(c);
  ------------------
  |  |  151|  22.6k|#define BOTAN_UNUSED Botan::ignore_params
  ------------------
  114|  22.6k|      }
  115|  4.17k|   } catch(Decoding_Error&) {
  116|     76|      return false;
  117|     76|   }
  118|  4.10k|   return true;
  119|  4.17k|}
_ZN5Botan12ucs2_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  121|  6.70k|std::string ucs2_to_utf8(std::span<const uint8_t> ucs2) {
  122|  6.70k|   if(ucs2.size() % 2 != 0) {
  ------------------
  |  Branch (122:7): [True: 2, False: 6.70k]
  ------------------
  123|      2|      throw Decoding_Error("Invalid length for UCS-2 string");
  124|      2|   }
  125|       |
  126|  6.70k|   const size_t chars = ucs2.size() / 2;
  127|       |
  128|  6.70k|   std::string s;
  129|  33.5k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (129:22): [True: 26.8k, False: 6.70k]
  ------------------
  130|  26.8k|      const uint32_t c = load_be<uint16_t>(ucs2.data(), i);
  131|  26.8k|      append_utf8_for(s, c);
  132|  26.8k|   }
  133|       |
  134|  6.70k|   return s;
  135|  6.70k|}
_ZN5Botan12ucs4_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  155|  5.34k|std::string ucs4_to_utf8(std::span<const uint8_t> ucs4) {
  156|  5.34k|   if(ucs4.size() % 4 != 0) {
  ------------------
  |  Branch (156:7): [True: 3, False: 5.34k]
  ------------------
  157|      3|      throw Decoding_Error("Invalid length for UCS-4 string");
  158|      3|   }
  159|       |
  160|  5.34k|   const size_t chars = ucs4.size() / 4;
  161|       |
  162|  5.34k|   std::string s;
  163|  8.04k|   for(size_t i = 0; i != chars; ++i) {
  ------------------
  |  Branch (163:22): [True: 2.69k, False: 5.34k]
  ------------------
  164|  2.69k|      const uint32_t c = load_be<uint32_t>(ucs4.data(), i);
  165|  2.69k|      append_utf8_for(s, c);
  166|  2.69k|   }
  167|       |
  168|  5.34k|   return s;
  169|  5.34k|}
_ZN5Botan14latin1_to_utf8ENSt3__14spanIKhLm18446744073709551615EEE:
  190|  16.8k|std::string latin1_to_utf8(std::span<const uint8_t> chars) {
  191|  16.8k|   std::string s;
  192|   269k|   for(const uint8_t b : chars) {
  ------------------
  |  Branch (192:24): [True: 269k, False: 16.8k]
  ------------------
  193|   269k|      append_utf8_for(s, static_cast<uint32_t>(b));
  194|   269k|   }
  195|  16.8k|   return s;
  196|  16.8k|}
charset.cpp:_ZZN5Botan19next_utf8_codepointENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEERmENK3$_0clEv:
   54|  3.69k|   auto read_continuation = [&]() -> uint32_t {
   55|  3.69k|      if(pos >= utf8.size()) {
  ------------------
  |  Branch (55:10): [True: 8, False: 3.68k]
  ------------------
   56|      8|         throw Decoding_Error("Invalid UTF-8 sequence");
   57|      8|      }
   58|  3.68k|      const uint8_t b = static_cast<uint8_t>(utf8[pos++]);
   59|  3.68k|      if((b & 0xC0) != 0x80) {
  ------------------
  |  Branch (59:10): [True: 11, False: 3.67k]
  ------------------
   60|     11|         throw Decoding_Error("Invalid UTF-8 sequence");
   61|     11|      }
   62|  3.67k|      return b & 0x3F;
   63|  3.68k|   };
charset.cpp:_ZN5Botan12_GLOBAL__N_115append_utf8_forERNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEj:
   17|   298k|void append_utf8_for(std::string& s, uint32_t c) {
   18|   298k|   if(c >= 0xD800 && c < 0xE000) {
  ------------------
  |  Branch (18:7): [True: 6.37k, False: 292k]
  |  Branch (18:22): [True: 19, False: 6.35k]
  ------------------
   19|     19|      throw Decoding_Error("Invalid Unicode character");
   20|     19|   }
   21|       |
   22|   298k|   if(c <= 0x7F) {
  ------------------
  |  Branch (22:7): [True: 138k, False: 160k]
  ------------------
   23|   138k|      const uint8_t b0 = static_cast<uint8_t>(c);
   24|   138k|      s.push_back(static_cast<char>(b0));
   25|   160k|   } else if(c <= 0x7FF) {
  ------------------
  |  Branch (25:14): [True: 142k, False: 17.5k]
  ------------------
   26|   142k|      const uint8_t b0 = 0xC0 | static_cast<uint8_t>(c >> 6);
   27|   142k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   28|   142k|      s.push_back(static_cast<char>(b0));
   29|   142k|      s.push_back(static_cast<char>(b1));
   30|   142k|   } else if(c <= 0xFFFF) {
  ------------------
  |  Branch (30:14): [True: 15.1k, False: 2.33k]
  ------------------
   31|  15.1k|      const uint8_t b0 = 0xE0 | static_cast<uint8_t>(c >> 12);
   32|  15.1k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   33|  15.1k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   34|  15.1k|      s.push_back(static_cast<char>(b0));
   35|  15.1k|      s.push_back(static_cast<char>(b1));
   36|  15.1k|      s.push_back(static_cast<char>(b2));
   37|  15.1k|   } else if(c <= 0x10FFFF) {
  ------------------
  |  Branch (37:14): [True: 2.28k, False: 53]
  ------------------
   38|  2.28k|      const uint8_t b0 = 0xF0 | static_cast<uint8_t>(c >> 18);
   39|  2.28k|      const uint8_t b1 = 0x80 | static_cast<uint8_t>((c >> 12) & 0x3F);
   40|  2.28k|      const uint8_t b2 = 0x80 | static_cast<uint8_t>((c >> 6) & 0x3F);
   41|  2.28k|      const uint8_t b3 = 0x80 | static_cast<uint8_t>(c & 0x3F);
   42|  2.28k|      s.push_back(static_cast<char>(b0));
   43|  2.28k|      s.push_back(static_cast<char>(b1));
   44|  2.28k|      s.push_back(static_cast<char>(b2));
   45|  2.28k|      s.push_back(static_cast<char>(b3));
   46|  2.28k|   } else {
   47|     53|      throw Decoding_Error("Invalid Unicode character");
   48|     53|   }
   49|   298k|}

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

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

_ZN5Botan19secure_scrub_memoryEPvm:
   24|   403k|void secure_scrub_memory(void* ptr, size_t n) {
   25|   403k|   return secure_zeroize_buffer(ptr, n);
   26|   403k|}
_ZN5Botan21secure_zeroize_bufferEPvm:
   28|   403k|void secure_zeroize_buffer(void* ptr, size_t n) {
   29|   403k|   if(n == 0) {
  ------------------
  |  Branch (29:7): [True: 230k, False: 173k]
  ------------------
   30|   230k|      return;
   31|   230k|   }
   32|       |
   33|       |#if defined(BOTAN_TARGET_OS_HAS_RTLSECUREZEROMEMORY)
   34|       |   ::RtlSecureZeroMemory(ptr, n);
   35|       |
   36|       |#elif defined(BOTAN_TARGET_OS_HAS_EXPLICIT_BZERO)
   37|   173k|   ::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|   173k|}

_ZN5BotaneqERKNS_7X509_DNES2_:
  338|    444|bool operator==(const X509_DN& dn1, const X509_DN& dn2) {
  339|    444|   return dn1._canonical_bytes() == dn2._canonical_bytes();
  340|    444|}
_ZN5BotanltERKNS_7X509_DNES2_:
  353|  3.55k|bool operator<(const X509_DN& dn1, const X509_DN& dn2) {
  354|  3.55k|   return dn1._canonical_bytes() < dn2._canonical_bytes();
  355|  3.55k|}
_ZN5Botan7X509_DN11decode_fromERNS_11BER_DecoderE:
  407|  5.45k|void X509_DN::decode_from(BER_Decoder& source) {
  408|  5.45k|   std::vector<uint8_t> bits;
  409|       |
  410|  5.45k|   source.start_sequence().raw_bytes(bits).end_cons();
  411|       |
  412|  5.45k|   BER_Decoder sequence(bits, source.limits());
  413|       |
  414|  5.45k|   std::vector<std::vector<std::pair<OID, ASN1_String>>> rdns;
  415|       |
  416|       |   // Cap AVAs per RDN to bound work for downstream set-based matching.
  417|       |   // No legitimate cert has anywhere near this many AVAs in a single RDN.
  418|  5.45k|   constexpr size_t MAX_AVAS_PER_RDN = 32;
  419|       |
  420|  18.6k|   while(sequence.more_items()) {
  ------------------
  |  Branch (420:10): [True: 13.2k, False: 5.44k]
  ------------------
  421|  13.2k|      BER_Decoder rdn_decoder = sequence.start_set();
  422|       |
  423|  13.2k|      std::vector<std::pair<OID, ASN1_String>> rdn;
  424|  81.3k|      while(rdn_decoder.more_items()) {
  ------------------
  |  Branch (424:13): [True: 68.1k, False: 13.2k]
  ------------------
  425|  68.1k|         OID oid;
  426|  68.1k|         ASN1_String str;
  427|       |
  428|  68.1k|         rdn_decoder.start_sequence()
  429|  68.1k|            .decode(oid)
  430|  68.1k|            .decode(str)  // TODO support Any
  431|  68.1k|            .end_cons();
  432|       |
  433|  68.1k|         rdn.emplace_back(std::move(oid), std::move(str));
  434|       |
  435|  68.1k|         if(rdn.size() > MAX_AVAS_PER_RDN) {
  ------------------
  |  Branch (435:13): [True: 5, False: 68.1k]
  ------------------
  436|      5|            throw Decoding_Error("X.500 RDN has too many attribute-value assertions");
  437|      5|         }
  438|  68.1k|      }
  439|       |
  440|       |      /*
  441|       |      RFC 5280 4.1.2.4:
  442|       |         RelativeDistinguishedName ::=
  443|       |           SET SIZE (1..MAX) OF AttributeTypeAndValue
  444|       |      */
  445|  13.2k|      if(rdn.empty()) {
  ------------------
  |  Branch (445:10): [True: 5, False: 13.2k]
  ------------------
  446|      5|         throw Decoding_Error("X.500 RDN must contain at least one attribute-value assertion");
  447|      5|      }
  448|  13.2k|      rdns.push_back(std::move(rdn));
  449|  13.2k|   }
  450|       |
  451|  5.44k|   auto canonical_bits = canonicalize_dn(rdns);
  452|       |
  453|  5.44k|   m_rdn = std::move(rdns);
  454|  5.44k|   m_dn_bits = std::move(bits);
  455|  5.44k|   m_canonical_dn_bits = std::move(canonical_bits);
  456|  5.44k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEE:
  310|  2.27k|std::vector<uint8_t> canonicalize_dn(const std::vector<std::vector<std::pair<OID, ASN1_String>>>& rdns) {
  311|  2.27k|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  312|  2.27k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  313|  2.27k|      out.insert(out.end(), data_len.begin(), data_len.end());
  314|  2.27k|      out.insert(out.end(), data.begin(), data.end());
  315|  2.27k|   };
  316|       |
  317|  2.27k|   std::vector<uint8_t> canonical_bits;
  318|       |
  319|  10.9k|   for(const auto& rdn : rdns) {
  ------------------
  |  Branch (319:24): [True: 10.9k, False: 2.27k]
  ------------------
  320|  10.9k|      std::vector<uint8_t> rdn_bits;
  321|       |
  322|  64.2k|      for(const auto& [oid, value] : canonicalize_rdn(rdn)) {
  ------------------
  |  Branch (322:36): [True: 64.2k, False: 10.9k]
  ------------------
  323|  64.2k|         append_canonical_data(rdn_bits, oid.BER_encode());
  324|  64.2k|         append_canonical_data(rdn_bits, value);
  325|  64.2k|      }
  326|       |
  327|  10.9k|      append_canonical_data(canonical_bits, rdn_bits);
  328|  10.9k|   }
  329|       |
  330|  2.27k|   return canonical_bits;
  331|  2.27k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_116canonicalize_rdnERKNSt3__16vectorINS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEE:
  298|  10.9k|std::vector<std::pair<OID, std::string>> canonicalize_rdn(const std::vector<std::pair<OID, ASN1_String>>& rdn) {
  299|  10.9k|   std::vector<std::pair<OID, std::string>> result;
  300|  10.9k|   result.reserve(rdn.size());
  301|  64.2k|   for(const auto& ava : rdn) {
  ------------------
  |  Branch (301:24): [True: 64.2k, False: 10.9k]
  ------------------
  302|  64.2k|      result.emplace_back(ava.first, X500_Char_Iterator::canonicalize(ava.second.value()));
  303|  64.2k|   }
  304|  10.9k|   if(result.size() != 1) {
  ------------------
  |  Branch (304:7): [True: 7.64k, False: 3.30k]
  ------------------
  305|  7.64k|      std::sort(result.begin(), result.end());
  306|  7.64k|   }
  307|  10.9k|   return result;
  308|  10.9k|}
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator12canonicalizeENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  114|  64.2k|      static std::string canonicalize(std::string_view name) {
  115|  64.2k|         std::string result;
  116|  64.2k|         result.reserve(name.size());
  117|       |
  118|  64.2k|         X500_Char_Iterator it(name);
  119|   518k|         while(auto c = it.next()) {
  ------------------
  |  Branch (119:21): [True: 454k, False: 64.2k]
  ------------------
  120|   454k|            result += *c;
  121|   454k|         }
  122|       |
  123|  64.2k|         return result;
  124|  64.2k|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_IteratorC2ENSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
   81|  64.2k|      explicit X500_Char_Iterator(std::string_view s) : m_str(s), m_pos(0) {
   82|       |         // Skip leading whitespace
   83|  65.7k|         while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (83:16): [True: 15.8k, False: 49.9k]
  |  Branch (83:40): [True: 1.49k, False: 14.3k]
  ------------------
   84|  1.49k|            ++m_pos;
   85|  1.49k|         }
   86|  64.2k|      }
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_118X500_Char_Iterator4nextEv:
   89|   518k|      std::optional<char> next() {
   90|   518k|         if(m_pos >= m_str.size()) {
  ------------------
  |  Branch (90:13): [True: 63.8k, False: 454k]
  ------------------
   91|  63.8k|            return std::nullopt;
   92|  63.8k|         }
   93|       |
   94|   454k|         if(is_space(m_str[m_pos])) {
  ------------------
  |  Branch (94:13): [True: 3.46k, False: 451k]
  ------------------
   95|       |            // Skip the entire whitespace run
   96|  11.2k|            while(m_pos < m_str.size() && is_space(m_str[m_pos])) {
  ------------------
  |  Branch (96:19): [True: 10.8k, False: 382]
  |  Branch (96:43): [True: 7.80k, False: 3.08k]
  ------------------
   97|  7.80k|               ++m_pos;
   98|  7.80k|            }
   99|       |            // Emit a single space only if more content follows (strip trailing ws)
  100|  3.46k|            if(m_pos < m_str.size()) {
  ------------------
  |  Branch (100:16): [True: 3.08k, False: 382]
  ------------------
  101|  3.08k|               return ' ';
  102|  3.08k|            }
  103|    382|            return std::nullopt;
  104|  3.46k|         }
  105|       |
  106|   451k|         const char c = m_str[m_pos++];
  107|       |         // Locale-independent ASCII fold; RFC 5280 DN matching does not depend on libc locale
  108|   451k|         if(c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (108:13): [True: 13.2k, False: 438k]
  |  Branch (108:25): [True: 8.47k, False: 4.75k]
  ------------------
  109|  8.47k|            return static_cast<char>(c + ('a' - 'A'));
  110|  8.47k|         }
  111|   443k|         return c;
  112|   451k|      }
x509_dn.cpp:_ZZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEEENK3$_0clINS2_IhNS7_IhEEEEEEDaRSH_RKT_:
  311|  75.2k|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  312|  75.2k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  313|  75.2k|      out.insert(out.end(), data_len.begin(), data_len.end());
  314|  75.2k|      out.insert(out.end(), data.begin(), data.end());
  315|  75.2k|   };
x509_dn.cpp:_ZZN5Botan12_GLOBAL__N_115canonicalize_dnERKNSt3__16vectorINS2_INS1_4pairINS_3OIDENS_11ASN1_StringEEENS1_9allocatorIS6_EEEENS7_IS9_EEEEENK3$_0clINS1_12basic_stringIcNS1_11char_traitsIcEENS7_IcEEEEEEDaRNS2_IhNS7_IhEEEERKT_:
  311|  64.2k|   auto append_canonical_data = []<typename T>(std::vector<uint8_t>& out, const T& data) {
  312|  64.2k|      const std::array<uint8_t, 8> data_len = store_le(static_cast<uint64_t>(data.size()));
  313|  64.2k|      out.insert(out.end(), data_len.begin(), data_len.end());
  314|  64.2k|      out.insert(out.end(), data.begin(), data.end());
  315|  64.2k|   };
x509_dn.cpp:_ZN5Botan12_GLOBAL__N_18is_spaceEc:
   26|   481k|bool is_space(char c) {
   27|   481k|   return c == ' ' || c == '\t';
  ------------------
  |  Branch (27:11): [True: 7.84k, False: 473k]
  |  Branch (27:23): [True: 4.91k, False: 468k]
  ------------------
   28|   481k|}

